app/assets/build/coco/coco.js in coveragebook_components-0.18.7 vs app/assets/build/coco/coco.js in coveragebook_components-0.18.8

- old
+ new

@@ -26,10 +26,11311 @@ // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); +// ../../../node_modules/lodash.camelcase/index.js +var require_lodash = __commonJS({ + "../../../node_modules/lodash.camelcase/index.js"(exports, module) { + var INFINITY = 1 / 0; + var symbolTag = "[object Symbol]"; + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + var rsAstralRange = "\\ud800-\\udfff"; + var rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23"; + var rsComboSymbolsRange = "\\u20d0-\\u20f0"; + var rsDingbatRange = "\\u2700-\\u27bf"; + var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff"; + var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7"; + var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf"; + var rsPunctuationRange = "\\u2000-\\u206f"; + var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000"; + var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde"; + var rsVarRange = "\\ufe0e\\ufe0f"; + var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + var rsApos = "['\u2019]"; + var rsAstral = "[" + rsAstralRange + "]"; + var rsBreak = "[" + rsBreakRange + "]"; + var rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]"; + var rsDigits = "\\d+"; + var rsDingbat = "[" + rsDingbatRange + "]"; + var rsLower = "[" + rsLowerRange + "]"; + var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]"; + var rsFitz = "\\ud83c[\\udffb-\\udfff]"; + var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")"; + var rsNonAstral = "[^" + rsAstralRange + "]"; + var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + var rsUpper = "[" + rsUpperRange + "]"; + var rsZWJ = "\\u200d"; + var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")"; + var rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")"; + var rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?"; + var rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?"; + var reOptMod = rsModifier + "?"; + var rsOptVar = "[" + rsVarRange + "]?"; + var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*"; + var rsSeq = rsOptVar + reOptMod + rsOptJoin; + var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq; + var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; + var reApos = RegExp(rsApos, "g"); + var reComboMark = RegExp(rsCombo, "g"); + var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); + var reUnicodeWord = RegExp([ + rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", + rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")", + rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr, + rsUpper + "+" + rsOptUpperContr, + rsDigits, + rsEmoji + ].join("|"), "g"); + var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + "]"); + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var deburredLetters = { + // Latin-1 Supplement block. + "\xC0": "A", + "\xC1": "A", + "\xC2": "A", + "\xC3": "A", + "\xC4": "A", + "\xC5": "A", + "\xE0": "a", + "\xE1": "a", + "\xE2": "a", + "\xE3": "a", + "\xE4": "a", + "\xE5": "a", + "\xC7": "C", + "\xE7": "c", + "\xD0": "D", + "\xF0": "d", + "\xC8": "E", + "\xC9": "E", + "\xCA": "E", + "\xCB": "E", + "\xE8": "e", + "\xE9": "e", + "\xEA": "e", + "\xEB": "e", + "\xCC": "I", + "\xCD": "I", + "\xCE": "I", + "\xCF": "I", + "\xEC": "i", + "\xED": "i", + "\xEE": "i", + "\xEF": "i", + "\xD1": "N", + "\xF1": "n", + "\xD2": "O", + "\xD3": "O", + "\xD4": "O", + "\xD5": "O", + "\xD6": "O", + "\xD8": "O", + "\xF2": "o", + "\xF3": "o", + "\xF4": "o", + "\xF5": "o", + "\xF6": "o", + "\xF8": "o", + "\xD9": "U", + "\xDA": "U", + "\xDB": "U", + "\xDC": "U", + "\xF9": "u", + "\xFA": "u", + "\xFB": "u", + "\xFC": "u", + "\xDD": "Y", + "\xFD": "y", + "\xFF": "y", + "\xC6": "Ae", + "\xE6": "ae", + "\xDE": "Th", + "\xFE": "th", + "\xDF": "ss", + // Latin Extended-A block. + "\u0100": "A", + "\u0102": "A", + "\u0104": "A", + "\u0101": "a", + "\u0103": "a", + "\u0105": "a", + "\u0106": "C", + "\u0108": "C", + "\u010A": "C", + "\u010C": "C", + "\u0107": "c", + "\u0109": "c", + "\u010B": "c", + "\u010D": "c", + "\u010E": "D", + "\u0110": "D", + "\u010F": "d", + "\u0111": "d", + "\u0112": "E", + "\u0114": "E", + "\u0116": "E", + "\u0118": "E", + "\u011A": "E", + "\u0113": "e", + "\u0115": "e", + "\u0117": "e", + "\u0119": "e", + "\u011B": "e", + "\u011C": "G", + "\u011E": "G", + "\u0120": "G", + "\u0122": "G", + "\u011D": "g", + "\u011F": "g", + "\u0121": "g", + "\u0123": "g", + "\u0124": "H", + "\u0126": "H", + "\u0125": "h", + "\u0127": "h", + "\u0128": "I", + "\u012A": "I", + "\u012C": "I", + "\u012E": "I", + "\u0130": "I", + "\u0129": "i", + "\u012B": "i", + "\u012D": "i", + "\u012F": "i", + "\u0131": "i", + "\u0134": "J", + "\u0135": "j", + "\u0136": "K", + "\u0137": "k", + "\u0138": "k", + "\u0139": "L", + "\u013B": "L", + "\u013D": "L", + "\u013F": "L", + "\u0141": "L", + "\u013A": "l", + "\u013C": "l", + "\u013E": "l", + "\u0140": "l", + "\u0142": "l", + "\u0143": "N", + "\u0145": "N", + "\u0147": "N", + "\u014A": "N", + "\u0144": "n", + "\u0146": "n", + "\u0148": "n", + "\u014B": "n", + "\u014C": "O", + "\u014E": "O", + "\u0150": "O", + "\u014D": "o", + "\u014F": "o", + "\u0151": "o", + "\u0154": "R", + "\u0156": "R", + "\u0158": "R", + "\u0155": "r", + "\u0157": "r", + "\u0159": "r", + "\u015A": "S", + "\u015C": "S", + "\u015E": "S", + "\u0160": "S", + "\u015B": "s", + "\u015D": "s", + "\u015F": "s", + "\u0161": "s", + "\u0162": "T", + "\u0164": "T", + "\u0166": "T", + "\u0163": "t", + "\u0165": "t", + "\u0167": "t", + "\u0168": "U", + "\u016A": "U", + "\u016C": "U", + "\u016E": "U", + "\u0170": "U", + "\u0172": "U", + "\u0169": "u", + "\u016B": "u", + "\u016D": "u", + "\u016F": "u", + "\u0171": "u", + "\u0173": "u", + "\u0174": "W", + "\u0175": "w", + "\u0176": "Y", + "\u0177": "y", + "\u0178": "Y", + "\u0179": "Z", + "\u017B": "Z", + "\u017D": "Z", + "\u017A": "z", + "\u017C": "z", + "\u017E": "z", + "\u0132": "IJ", + "\u0133": "ij", + "\u0152": "Oe", + "\u0153": "oe", + "\u0149": "'n", + "\u017F": "ss" + }; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, length = array ? array.length : 0; + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + function asciiToArray(string) { + return string.split(""); + } + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + function basePropertyOf(object) { + return function(key) { + return object == null ? void 0 : object[key]; + }; + } + var deburrLetter = basePropertyOf(deburredLetters); + function hasUnicode(string) { + return reHasUnicode.test(string); + } + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + function stringToArray(string) { + return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); + } + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + var Symbol2 = root.Symbol; + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function baseSlice(array, start, end) { + var index = -1, length = array.length; + if (start < 0) { + start = -start > length ? 0 : length + start; + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : end - start >>> 0; + start >>>= 0; + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + function baseToString(value) { + if (typeof value == "string") { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + function castSlice(array, start, end) { + var length = array.length; + end = end === void 0 ? length : end; + return !start && end >= length ? array : baseSlice(array, start, end); + } + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + var strSymbols = hasUnicode(string) ? stringToArray(string) : void 0; + var chr = strSymbols ? strSymbols[0] : string.charAt(0); + var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1); + return chr[methodName]() + trailing; + }; + } + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); + }; + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + function toString(value) { + return value == null ? "" : baseToString(value); + } + var camelCase2 = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); + } + var upperFirst = createCaseFirst("toUpperCase"); + function words(string, pattern, guard) { + string = toString(string); + pattern = guard ? void 0 : pattern; + if (pattern === void 0) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); + } + return string.match(pattern) || []; + } + module.exports = camelCase2; + } +}); + +// ../../../node_modules/lodash.kebabcase/index.js +var require_lodash2 = __commonJS({ + "../../../node_modules/lodash.kebabcase/index.js"(exports, module) { + var INFINITY = 1 / 0; + var symbolTag = "[object Symbol]"; + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + var rsAstralRange = "\\ud800-\\udfff"; + var rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23"; + var rsComboSymbolsRange = "\\u20d0-\\u20f0"; + var rsDingbatRange = "\\u2700-\\u27bf"; + var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff"; + var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7"; + var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf"; + var rsPunctuationRange = "\\u2000-\\u206f"; + var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000"; + var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde"; + var rsVarRange = "\\ufe0e\\ufe0f"; + var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + var rsApos = "['\u2019]"; + var rsBreak = "[" + rsBreakRange + "]"; + var rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]"; + var rsDigits = "\\d+"; + var rsDingbat = "[" + rsDingbatRange + "]"; + var rsLower = "[" + rsLowerRange + "]"; + var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]"; + var rsFitz = "\\ud83c[\\udffb-\\udfff]"; + var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")"; + var rsNonAstral = "[^" + rsAstralRange + "]"; + var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + var rsUpper = "[" + rsUpperRange + "]"; + var rsZWJ = "\\u200d"; + var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")"; + var rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")"; + var rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?"; + var rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?"; + var reOptMod = rsModifier + "?"; + var rsOptVar = "[" + rsVarRange + "]?"; + var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*"; + var rsSeq = rsOptVar + reOptMod + rsOptJoin; + var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq; + var reApos = RegExp(rsApos, "g"); + var reComboMark = RegExp(rsCombo, "g"); + var reUnicodeWord = RegExp([ + rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", + rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")", + rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr, + rsUpper + "+" + rsOptUpperContr, + rsDigits, + rsEmoji + ].join("|"), "g"); + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var deburredLetters = { + // Latin-1 Supplement block. + "\xC0": "A", + "\xC1": "A", + "\xC2": "A", + "\xC3": "A", + "\xC4": "A", + "\xC5": "A", + "\xE0": "a", + "\xE1": "a", + "\xE2": "a", + "\xE3": "a", + "\xE4": "a", + "\xE5": "a", + "\xC7": "C", + "\xE7": "c", + "\xD0": "D", + "\xF0": "d", + "\xC8": "E", + "\xC9": "E", + "\xCA": "E", + "\xCB": "E", + "\xE8": "e", + "\xE9": "e", + "\xEA": "e", + "\xEB": "e", + "\xCC": "I", + "\xCD": "I", + "\xCE": "I", + "\xCF": "I", + "\xEC": "i", + "\xED": "i", + "\xEE": "i", + "\xEF": "i", + "\xD1": "N", + "\xF1": "n", + "\xD2": "O", + "\xD3": "O", + "\xD4": "O", + "\xD5": "O", + "\xD6": "O", + "\xD8": "O", + "\xF2": "o", + "\xF3": "o", + "\xF4": "o", + "\xF5": "o", + "\xF6": "o", + "\xF8": "o", + "\xD9": "U", + "\xDA": "U", + "\xDB": "U", + "\xDC": "U", + "\xF9": "u", + "\xFA": "u", + "\xFB": "u", + "\xFC": "u", + "\xDD": "Y", + "\xFD": "y", + "\xFF": "y", + "\xC6": "Ae", + "\xE6": "ae", + "\xDE": "Th", + "\xFE": "th", + "\xDF": "ss", + // Latin Extended-A block. + "\u0100": "A", + "\u0102": "A", + "\u0104": "A", + "\u0101": "a", + "\u0103": "a", + "\u0105": "a", + "\u0106": "C", + "\u0108": "C", + "\u010A": "C", + "\u010C": "C", + "\u0107": "c", + "\u0109": "c", + "\u010B": "c", + "\u010D": "c", + "\u010E": "D", + "\u0110": "D", + "\u010F": "d", + "\u0111": "d", + "\u0112": "E", + "\u0114": "E", + "\u0116": "E", + "\u0118": "E", + "\u011A": "E", + "\u0113": "e", + "\u0115": "e", + "\u0117": "e", + "\u0119": "e", + "\u011B": "e", + "\u011C": "G", + "\u011E": "G", + "\u0120": "G", + "\u0122": "G", + "\u011D": "g", + "\u011F": "g", + "\u0121": "g", + "\u0123": "g", + "\u0124": "H", + "\u0126": "H", + "\u0125": "h", + "\u0127": "h", + "\u0128": "I", + "\u012A": "I", + "\u012C": "I", + "\u012E": "I", + "\u0130": "I", + "\u0129": "i", + "\u012B": "i", + "\u012D": "i", + "\u012F": "i", + "\u0131": "i", + "\u0134": "J", + "\u0135": "j", + "\u0136": "K", + "\u0137": "k", + "\u0138": "k", + "\u0139": "L", + "\u013B": "L", + "\u013D": "L", + "\u013F": "L", + "\u0141": "L", + "\u013A": "l", + "\u013C": "l", + "\u013E": "l", + "\u0140": "l", + "\u0142": "l", + "\u0143": "N", + "\u0145": "N", + "\u0147": "N", + "\u014A": "N", + "\u0144": "n", + "\u0146": "n", + "\u0148": "n", + "\u014B": "n", + "\u014C": "O", + "\u014E": "O", + "\u0150": "O", + "\u014D": "o", + "\u014F": "o", + "\u0151": "o", + "\u0154": "R", + "\u0156": "R", + "\u0158": "R", + "\u0155": "r", + "\u0157": "r", + "\u0159": "r", + "\u015A": "S", + "\u015C": "S", + "\u015E": "S", + "\u0160": "S", + "\u015B": "s", + "\u015D": "s", + "\u015F": "s", + "\u0161": "s", + "\u0162": "T", + "\u0164": "T", + "\u0166": "T", + "\u0163": "t", + "\u0165": "t", + "\u0167": "t", + "\u0168": "U", + "\u016A": "U", + "\u016C": "U", + "\u016E": "U", + "\u0170": "U", + "\u0172": "U", + "\u0169": "u", + "\u016B": "u", + "\u016D": "u", + "\u016F": "u", + "\u0171": "u", + "\u0173": "u", + "\u0174": "W", + "\u0175": "w", + "\u0176": "Y", + "\u0177": "y", + "\u0178": "Y", + "\u0179": "Z", + "\u017B": "Z", + "\u017D": "Z", + "\u017A": "z", + "\u017C": "z", + "\u017E": "z", + "\u0132": "IJ", + "\u0133": "ij", + "\u0152": "Oe", + "\u0153": "oe", + "\u0149": "'n", + "\u017F": "ss" + }; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, length = array ? array.length : 0; + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + function basePropertyOf(object) { + return function(key) { + return object == null ? void 0 : object[key]; + }; + } + var deburrLetter = basePropertyOf(deburredLetters); + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + var Symbol2 = root.Symbol; + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function baseToString(value) { + if (typeof value == "string") { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); + }; + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + function toString(value) { + return value == null ? "" : baseToString(value); + } + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); + } + var kebabCase2 = createCompounder(function(result, word, index) { + return result + (index ? "-" : "") + word.toLowerCase(); + }); + function words(string, pattern, guard) { + string = toString(string); + pattern = guard ? void 0 : pattern; + if (pattern === void 0) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); + } + return string.match(pattern) || []; + } + module.exports = kebabCase2; + } +}); + +// ../../../node_modules/lodash.mapvalues/index.js +var require_lodash3 = __commonJS({ + "../../../node_modules/lodash.mapvalues/index.js"(exports, module) { + var LARGE_ARRAY_SIZE = 200; + var FUNC_ERROR_TEXT = "Expected a function"; + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + var UNORDERED_COMPARE_FLAG = 1; + var PARTIAL_COMPARE_FLAG = 2; + var INFINITY = 1 / 0; + var MAX_SAFE_INTEGER = 9007199254740991; + var argsTag = "[object Arguments]"; + var arrayTag = "[object Array]"; + var boolTag = "[object Boolean]"; + var dateTag = "[object Date]"; + var errorTag = "[object Error]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var mapTag = "[object Map]"; + var numberTag = "[object Number]"; + var objectTag = "[object Object]"; + var promiseTag = "[object Promise]"; + var regexpTag = "[object RegExp]"; + var setTag = "[object Set]"; + var stringTag = "[object String]"; + var symbolTag = "[object Symbol]"; + var weakMapTag = "[object WeakMap]"; + var arrayBufferTag = "[object ArrayBuffer]"; + var dataViewTag = "[object DataView]"; + var float32Tag = "[object Float32Array]"; + var float64Tag = "[object Float64Array]"; + var int8Tag = "[object Int8Array]"; + var int16Tag = "[object Int16Array]"; + var int32Tag = "[object Int32Array]"; + var uint8Tag = "[object Uint8Array]"; + var uint8ClampedTag = "[object Uint8ClampedArray]"; + var uint16Tag = "[object Uint16Array]"; + var uint32Tag = "[object Uint32Array]"; + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + var reIsPlainProp = /^\w*$/; + var reLeadingDot = /^\./; + var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + var reEscapeChar = /\\(\\)?/g; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var freeProcess = moduleExports && freeGlobal.process; + var nodeUtil = function() { + try { + return freeProcess && freeProcess.binding("util"); + } catch (e2) { + } + }(); + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + function arraySome(array, predicate) { + var index = -1, length = array ? array.length : 0; + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + function baseProperty(key) { + return function(object) { + return object == null ? void 0 : object[key]; + }; + } + function baseTimes(n2, iteratee) { + var index = -1, result = Array(n2); + while (++index < n2) { + result[index] = iteratee(index); + } + return result; + } + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + function getValue(object, key) { + return object == null ? void 0 : object[key]; + } + function isHostObject(value) { + var result = false; + if (value != null && typeof value.toString != "function") { + try { + result = !!(value + ""); + } catch (e2) { + } + } + return result; + } + function mapToArray(map) { + var index = -1, result = Array(map.size); + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + function setToArray(set) { + var index = -1, result = Array(set.size); + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + var arrayProto = Array.prototype; + var funcProto = Function.prototype; + var objectProto = Object.prototype; + var coreJsData = root["__core-js_shared__"]; + var maskSrcKey = function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectToString = objectProto.toString; + var reIsNative = RegExp( + "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + var Symbol2 = root.Symbol; + var Uint8Array2 = root.Uint8Array; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var splice = arrayProto.splice; + var nativeKeys = overArg(Object.keys, Object); + var DataView = getNative(root, "DataView"); + var Map2 = getNative(root, "Map"); + var Promise2 = getNative(root, "Promise"); + var Set2 = getNative(root, "Set"); + var WeakMap2 = getNative(root, "WeakMap"); + var nativeCreate = getNative(Object, "create"); + var dataViewCtorString = toSource(DataView); + var mapCtorString = toSource(Map2); + var promiseCtorString = toSource(Promise2); + var setCtorString = toSource(Set2); + var weakMapCtorString = toSource(WeakMap2); + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function Hash(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + } + function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; + } + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? void 0 : result; + } + return hasOwnProperty.call(data, key) ? data[key] : void 0; + } + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key); + } + function hashSet(key, value) { + var data = this.__data__; + data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value; + return this; + } + Hash.prototype.clear = hashClear; + Hash.prototype["delete"] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + function ListCache(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + function listCacheClear() { + this.__data__ = []; + } + function listCacheDelete(key) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; + } + function listCacheGet(key) { + var data = this.__data__, index = assocIndexOf(data, key); + return index < 0 ? void 0 : data[index][1]; + } + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + function listCacheSet(key, value) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + ListCache.prototype.clear = listCacheClear; + ListCache.prototype["delete"] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + function MapCache(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + function mapCacheClear() { + this.__data__ = { + "hash": new Hash(), + "map": new (Map2 || ListCache)(), + "string": new Hash() + }; + } + function mapCacheDelete(key) { + return getMapData(this, key)["delete"](key); + } + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; + } + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype["delete"] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + function SetCache(values) { + var index = -1, length = values ? values.length : 0; + this.__data__ = new MapCache(); + while (++index < length) { + this.add(values[index]); + } + } + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + function setCacheHas(value) { + return this.__data__.has(value); + } + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + function Stack(entries) { + this.__data__ = new ListCache(entries); + } + function stackClear() { + this.__data__ = new ListCache(); + } + function stackDelete(key) { + return this.__data__["delete"](key); + } + function stackGet(key) { + return this.__data__.get(key); + } + function stackHas(key) { + return this.__data__.has(key); + } + function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; + } + Stack.prototype.clear = stackClear; + Stack.prototype["delete"] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + function arrayLikeKeys(value, inherited) { + var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; + var length = result.length, skipIndexes = !!length; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + var baseFor = createBaseFor(); + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + var index = 0, length = path.length; + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return index && index == length ? object : void 0; + } + function baseGetTag(value) { + return objectToString.call(value); + } + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || !isObject2(value) && !isObjectLike(other)) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); + } + function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag; + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag; + if (isSameTag && !objIsObj) { + stack || (stack = new Stack()); + return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__"); + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; + stack || (stack = new Stack()); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack()); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); + } + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, length = index, noCustomizer = !customizer; + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], objValue = object[key], srcValue = data[1]; + if (noCustomizer && data[2]) { + if (objValue === void 0 && !(key in object)) { + return false; + } + } else { + var stack = new Stack(); + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === void 0 ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) { + return false; + } + } + } + return true; + } + function baseIsNative(value) { + if (!isObject2(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + function baseIsTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + function baseIteratee(value) { + if (typeof value == "function") { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == "object") { + return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); + } + return property(value); + } + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != "constructor") { + result.push(key); + } + } + return result; + } + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, void 0, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; + } + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + function baseToString(value) { + if (typeof value == "string") { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + function castPath(value) { + return isArray(value) ? value : stringToPath(value); + } + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length; + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, result = true, seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : void 0; + stack.set(array, other); + stack.set(other, array); + while (++index < arrLength) { + var arrValue = array[index], othValue = other[index]; + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== void 0) { + if (compared) { + continue; + } + result = false; + break; + } + if (seen) { + if (!arraySome(other, function(othValue2, othIndex) { + if (!seen.has(othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + result = false; + break; + } + } + stack["delete"](array); + stack["delete"](other); + return result; + } + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + return false; + } + object = object.buffer; + other = other.buffer; + case arrayBufferTag: + if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { + return false; + } + return true; + case boolTag: + case dateTag: + case numberTag: + return eq(+object, +other); + case errorTag: + return object.name == other.name && object.message == other.message; + case regexpTag: + case stringTag: + return object == other + ""; + case mapTag: + var convert = mapToArray; + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + if (object.size != other.size && !isPartial) { + return false; + } + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack["delete"](object); + return result; + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], othValue = other[key]; + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); + } + if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) { + result = false; + break; + } + skipCtor || (skipCtor = key == "constructor"); + } + if (result && !skipCtor) { + var objCtor = object.constructor, othCtor = other.constructor; + if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { + result = false; + } + } + stack["delete"](object); + stack["delete"](other); + return result; + } + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; + } + function getMatchData(object) { + var result = keys(object), length = result.length; + while (length--) { + var key = result[length], value = object[key]; + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : void 0; + } + var getTag = baseGetTag; + if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { + getTag = function(value) { + var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + case mapCtorString: + return mapTag; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag; + case weakMapCtorString: + return weakMapTag; + } + } + return result; + }; + } + function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + var result, index = -1, length = path.length; + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); + } + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + } + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); + } + function isKeyable(value) { + var type = typeof value; + return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; + } + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; + } + function isPrototype(value) { + var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto; + } + function isStrictComparable(value) { + return value === value && !isObject2(value); + } + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && (srcValue !== void 0 || key in Object(object)); + }; + } + var stringToPath = memoize(function(string) { + string = toString(string); + var result = []; + if (reLeadingDot.test(string)) { + result.push(""); + } + string.replace(rePropName, function(match, number, quote, string2) { + result.push(quote ? string2.replace(reEscapeChar, "$1") : number || match); + }); + return result; + }); + function toKey(value) { + if (typeof value == "string" || isSymbol(value)) { + return value; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e2) { + } + try { + return func + ""; + } catch (e2) { + } + } + return ""; + } + function memoize(func, resolver) { + if (typeof func != "function" || resolver && typeof resolver != "function") { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache)(); + return memoized; + } + memoize.Cache = MapCache; + function eq(value, other) { + return value === other || value !== value && other !== other; + } + function isArguments(value) { + return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); + } + var isArray = Array.isArray; + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + function isFunction(value) { + var tag = isObject2(value) ? objectToString.call(value) : ""; + return tag == funcTag || tag == genTag; + } + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + function isObject2(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + function toString(value) { + return value == null ? "" : baseToString(value); + } + function get(object, path, defaultValue) { + var result = object == null ? void 0 : baseGet(object, path); + return result === void 0 ? defaultValue : result; + } + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + function mapValues2(object, iteratee) { + var result = {}; + iteratee = baseIteratee(iteratee, 3); + baseForOwn(object, function(value, key, object2) { + result[key] = iteratee(value, key, object2); + }); + return result; + } + function identity(value) { + return value; + } + function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); + } + module.exports = mapValues2; + } +}); + +// ../../../node_modules/lodash.keyby/index.js +var require_lodash4 = __commonJS({ + "../../../node_modules/lodash.keyby/index.js"(exports, module) { + var LARGE_ARRAY_SIZE = 200; + var FUNC_ERROR_TEXT = "Expected a function"; + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + var UNORDERED_COMPARE_FLAG = 1; + var PARTIAL_COMPARE_FLAG = 2; + var INFINITY = 1 / 0; + var MAX_SAFE_INTEGER = 9007199254740991; + var argsTag = "[object Arguments]"; + var arrayTag = "[object Array]"; + var boolTag = "[object Boolean]"; + var dateTag = "[object Date]"; + var errorTag = "[object Error]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var mapTag = "[object Map]"; + var numberTag = "[object Number]"; + var objectTag = "[object Object]"; + var promiseTag = "[object Promise]"; + var regexpTag = "[object RegExp]"; + var setTag = "[object Set]"; + var stringTag = "[object String]"; + var symbolTag = "[object Symbol]"; + var weakMapTag = "[object WeakMap]"; + var arrayBufferTag = "[object ArrayBuffer]"; + var dataViewTag = "[object DataView]"; + var float32Tag = "[object Float32Array]"; + var float64Tag = "[object Float64Array]"; + var int8Tag = "[object Int8Array]"; + var int16Tag = "[object Int16Array]"; + var int32Tag = "[object Int32Array]"; + var uint8Tag = "[object Uint8Array]"; + var uint8ClampedTag = "[object Uint8ClampedArray]"; + var uint16Tag = "[object Uint16Array]"; + var uint32Tag = "[object Uint32Array]"; + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + var reIsPlainProp = /^\w*$/; + var reLeadingDot = /^\./; + var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + var reEscapeChar = /\\(\\)?/g; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var freeProcess = moduleExports && freeGlobal.process; + var nodeUtil = function() { + try { + return freeProcess && freeProcess.binding("util"); + } catch (e2) { + } + }(); + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, length = array ? array.length : 0; + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + function arraySome(array, predicate) { + var index = -1, length = array ? array.length : 0; + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + function baseProperty(key) { + return function(object) { + return object == null ? void 0 : object[key]; + }; + } + function baseTimes(n2, iteratee) { + var index = -1, result = Array(n2); + while (++index < n2) { + result[index] = iteratee(index); + } + return result; + } + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + function getValue(object, key) { + return object == null ? void 0 : object[key]; + } + function isHostObject(value) { + var result = false; + if (value != null && typeof value.toString != "function") { + try { + result = !!(value + ""); + } catch (e2) { + } + } + return result; + } + function mapToArray(map) { + var index = -1, result = Array(map.size); + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + function setToArray(set) { + var index = -1, result = Array(set.size); + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + var arrayProto = Array.prototype; + var funcProto = Function.prototype; + var objectProto = Object.prototype; + var coreJsData = root["__core-js_shared__"]; + var maskSrcKey = function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectToString = objectProto.toString; + var reIsNative = RegExp( + "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + var Symbol2 = root.Symbol; + var Uint8Array2 = root.Uint8Array; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var splice = arrayProto.splice; + var nativeKeys = overArg(Object.keys, Object); + var DataView = getNative(root, "DataView"); + var Map2 = getNative(root, "Map"); + var Promise2 = getNative(root, "Promise"); + var Set2 = getNative(root, "Set"); + var WeakMap2 = getNative(root, "WeakMap"); + var nativeCreate = getNative(Object, "create"); + var dataViewCtorString = toSource(DataView); + var mapCtorString = toSource(Map2); + var promiseCtorString = toSource(Promise2); + var setCtorString = toSource(Set2); + var weakMapCtorString = toSource(WeakMap2); + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function Hash(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + } + function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; + } + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? void 0 : result; + } + return hasOwnProperty.call(data, key) ? data[key] : void 0; + } + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key); + } + function hashSet(key, value) { + var data = this.__data__; + data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value; + return this; + } + Hash.prototype.clear = hashClear; + Hash.prototype["delete"] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + function ListCache(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + function listCacheClear() { + this.__data__ = []; + } + function listCacheDelete(key) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; + } + function listCacheGet(key) { + var data = this.__data__, index = assocIndexOf(data, key); + return index < 0 ? void 0 : data[index][1]; + } + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + function listCacheSet(key, value) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + ListCache.prototype.clear = listCacheClear; + ListCache.prototype["delete"] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + function MapCache(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + function mapCacheClear() { + this.__data__ = { + "hash": new Hash(), + "map": new (Map2 || ListCache)(), + "string": new Hash() + }; + } + function mapCacheDelete(key) { + return getMapData(this, key)["delete"](key); + } + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; + } + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype["delete"] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + function SetCache(values) { + var index = -1, length = values ? values.length : 0; + this.__data__ = new MapCache(); + while (++index < length) { + this.add(values[index]); + } + } + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + function setCacheHas(value) { + return this.__data__.has(value); + } + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + function Stack(entries) { + this.__data__ = new ListCache(entries); + } + function stackClear() { + this.__data__ = new ListCache(); + } + function stackDelete(key) { + return this.__data__["delete"](key); + } + function stackGet(key) { + return this.__data__.get(key); + } + function stackHas(key) { + return this.__data__.has(key); + } + function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; + } + Stack.prototype.clear = stackClear; + Stack.prototype["delete"] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + function arrayLikeKeys(value, inherited) { + var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; + var length = result.length, skipIndexes = !!length; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection2) { + setter(accumulator, value, iteratee(value), collection2); + }); + return accumulator; + } + var baseEach = createBaseEach(baseForOwn); + var baseFor = createBaseFor(); + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + var index = 0, length = path.length; + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return index && index == length ? object : void 0; + } + function baseGetTag(value) { + return objectToString.call(value); + } + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || !isObject2(value) && !isObjectLike(other)) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); + } + function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag; + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag; + if (isSameTag && !objIsObj) { + stack || (stack = new Stack()); + return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__"); + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; + stack || (stack = new Stack()); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack()); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); + } + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, length = index, noCustomizer = !customizer; + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], objValue = object[key], srcValue = data[1]; + if (noCustomizer && data[2]) { + if (objValue === void 0 && !(key in object)) { + return false; + } + } else { + var stack = new Stack(); + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === void 0 ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) { + return false; + } + } + } + return true; + } + function baseIsNative(value) { + if (!isObject2(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + function baseIsTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + function baseIteratee(value) { + if (typeof value == "function") { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == "object") { + return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); + } + return property(value); + } + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != "constructor") { + result.push(key); + } + } + return result; + } + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, void 0, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; + } + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + function baseToString(value) { + if (typeof value == "string") { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + function castPath(value) { + return isArray(value) ? value : stringToPath(value); + } + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; + return func(collection, setter, baseIteratee(iteratee, 2), accumulator); + }; + } + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); + while (fromRight ? index-- : ++index < length) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length; + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, result = true, seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : void 0; + stack.set(array, other); + stack.set(other, array); + while (++index < arrLength) { + var arrValue = array[index], othValue = other[index]; + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== void 0) { + if (compared) { + continue; + } + result = false; + break; + } + if (seen) { + if (!arraySome(other, function(othValue2, othIndex) { + if (!seen.has(othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + result = false; + break; + } + } + stack["delete"](array); + stack["delete"](other); + return result; + } + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + return false; + } + object = object.buffer; + other = other.buffer; + case arrayBufferTag: + if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { + return false; + } + return true; + case boolTag: + case dateTag: + case numberTag: + return eq(+object, +other); + case errorTag: + return object.name == other.name && object.message == other.message; + case regexpTag: + case stringTag: + return object == other + ""; + case mapTag: + var convert = mapToArray; + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + if (object.size != other.size && !isPartial) { + return false; + } + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack["delete"](object); + return result; + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], othValue = other[key]; + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); + } + if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) { + result = false; + break; + } + skipCtor || (skipCtor = key == "constructor"); + } + if (result && !skipCtor) { + var objCtor = object.constructor, othCtor = other.constructor; + if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { + result = false; + } + } + stack["delete"](object); + stack["delete"](other); + return result; + } + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; + } + function getMatchData(object) { + var result = keys(object), length = result.length; + while (length--) { + var key = result[length], value = object[key]; + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : void 0; + } + var getTag = baseGetTag; + if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { + getTag = function(value) { + var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + case mapCtorString: + return mapTag; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag; + case weakMapCtorString: + return weakMapTag; + } + } + return result; + }; + } + function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + var result, index = -1, length = path.length; + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); + } + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + } + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); + } + function isKeyable(value) { + var type = typeof value; + return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; + } + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; + } + function isPrototype(value) { + var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto; + } + function isStrictComparable(value) { + return value === value && !isObject2(value); + } + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && (srcValue !== void 0 || key in Object(object)); + }; + } + var stringToPath = memoize(function(string) { + string = toString(string); + var result = []; + if (reLeadingDot.test(string)) { + result.push(""); + } + string.replace(rePropName, function(match, number, quote, string2) { + result.push(quote ? string2.replace(reEscapeChar, "$1") : number || match); + }); + return result; + }); + function toKey(value) { + if (typeof value == "string" || isSymbol(value)) { + return value; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e2) { + } + try { + return func + ""; + } catch (e2) { + } + } + return ""; + } + var keyBy2 = createAggregator(function(result, value, key) { + result[key] = value; + }); + function memoize(func, resolver) { + if (typeof func != "function" || resolver && typeof resolver != "function") { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache)(); + return memoized; + } + memoize.Cache = MapCache; + function eq(value, other) { + return value === other || value !== value && other !== other; + } + function isArguments(value) { + return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); + } + var isArray = Array.isArray; + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + function isFunction(value) { + var tag = isObject2(value) ? objectToString.call(value) : ""; + return tag == funcTag || tag == genTag; + } + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + function isObject2(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + function toString(value) { + return value == null ? "" : baseToString(value); + } + function get(object, path, defaultValue) { + var result = object == null ? void 0 : baseGet(object, path); + return result === void 0 ? defaultValue : result; + } + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + function identity(value) { + return value; + } + function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); + } + module.exports = keyBy2; + } +}); + +// ../../../node_modules/@popperjs/core/dist/cjs/popper.js +var require_popper = __commonJS({ + "../../../node_modules/@popperjs/core/dist/cjs/popper.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + function getWindow(node) { + if (node == null) { + return window; + } + if (node.toString() !== "[object Window]") { + var ownerDocument = node.ownerDocument; + return ownerDocument ? ownerDocument.defaultView || window : window; + } + return node; + } + function isElement(node) { + var OwnElement = getWindow(node).Element; + return node instanceof OwnElement || node instanceof Element; + } + function isHTMLElement(node) { + var OwnElement = getWindow(node).HTMLElement; + return node instanceof OwnElement || node instanceof HTMLElement; + } + function isShadowRoot(node) { + if (typeof ShadowRoot === "undefined") { + return false; + } + var OwnElement = getWindow(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; + } + var max = Math.max; + var min = Math.min; + var round = Math.round; + function getUAString() { + var uaData = navigator.userAgentData; + if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) { + return uaData.brands.map(function(item) { + return item.brand + "/" + item.version; + }).join(" "); + } + return navigator.userAgent; + } + function isLayoutViewport() { + return !/^((?!chrome|android).)*safari/i.test(getUAString()); + } + function getBoundingClientRect(element, includeScale, isFixedStrategy) { + if (includeScale === void 0) { + includeScale = false; + } + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + var clientRect = element.getBoundingClientRect(); + var scaleX = 1; + var scaleY = 1; + if (includeScale && isHTMLElement(element)) { + scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; + scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; + } + var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport; + var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; + var x2 = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; + var y2 = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; + var width = clientRect.width / scaleX; + var height = clientRect.height / scaleY; + return { + width, + height, + top: y2, + right: x2 + width, + bottom: y2 + height, + left: x2, + x: x2, + y: y2 + }; + } + function getWindowScroll(node) { + var win = getWindow(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft, + scrollTop + }; + } + function getHTMLElementScroll(element) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; + } + function getNodeScroll(node) { + if (node === getWindow(node) || !isHTMLElement(node)) { + return getWindowScroll(node); + } else { + return getHTMLElementScroll(node); + } + } + function getNodeName(element) { + return element ? (element.nodeName || "").toLowerCase() : null; + } + function getDocumentElement(element) { + return ((isElement(element) ? element.ownerDocument : ( + // $FlowFixMe[prop-missing] + element.document + )) || window.document).documentElement; + } + function getWindowScrollBarX(element) { + return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; + } + function getComputedStyle2(element) { + return getWindow(element).getComputedStyle(element); + } + function isScrollParent(element) { + var _getComputedStyle = getComputedStyle2(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY; + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); + } + function isElementScaled(element) { + var rect = element.getBoundingClientRect(); + var scaleX = round(rect.width) / element.offsetWidth || 1; + var scaleY = round(rect.height) / element.offsetHeight || 1; + return scaleX !== 1 || scaleY !== 1; + } + function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { + if (isFixed === void 0) { + isFixed = false; + } + var isOffsetParentAnElement = isHTMLElement(offsetParent); + var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); + var documentElement = getDocumentElement(offsetParent); + var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); + var scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + var offsets = { + x: 0, + y: 0 + }; + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078 + isScrollParent(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + if (isHTMLElement(offsetParent)) { + offsets = getBoundingClientRect(offsetParent, true); + offsets.x += offsetParent.clientLeft; + offsets.y += offsetParent.clientTop; + } else if (documentElement) { + offsets.x = getWindowScrollBarX(documentElement); + } + } + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; + } + function getLayoutRect(element) { + var clientRect = getBoundingClientRect(element); + var width = element.offsetWidth; + var height = element.offsetHeight; + if (Math.abs(clientRect.width - width) <= 1) { + width = clientRect.width; + } + if (Math.abs(clientRect.height - height) <= 1) { + height = clientRect.height; + } + return { + x: element.offsetLeft, + y: element.offsetTop, + width, + height + }; + } + function getParentNode(element) { + if (getNodeName(element) === "html") { + return element; + } + return ( + // this is a quicker (but less type safe) way to save quite some bytes from the bundle + // $FlowFixMe[incompatible-return] + // $FlowFixMe[prop-missing] + element.assignedSlot || // step into the shadow DOM of the parent of a slotted node + element.parentNode || // DOM Element detected + (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + // $FlowFixMe[incompatible-call]: HTMLElement is a Node + getDocumentElement(element) + ); + } + function getScrollParent(node) { + if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) { + return node.ownerDocument.body; + } + if (isHTMLElement(node) && isScrollParent(node)) { + return node; + } + return getScrollParent(getParentNode(node)); + } + function listScrollParents(element, list) { + var _element$ownerDocumen; + if (list === void 0) { + list = []; + } + var scrollParent = getScrollParent(element); + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var win = getWindow(scrollParent); + var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; + var updatedList = list.concat(target); + return isBody ? updatedList : ( + // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + updatedList.concat(listScrollParents(getParentNode(target))) + ); + } + function isTableElement(element) { + return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0; + } + function getTrueOffsetParent(element) { + if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 + getComputedStyle2(element).position === "fixed") { + return null; + } + return element.offsetParent; + } + function getContainingBlock(element) { + var isFirefox = /firefox/i.test(getUAString()); + var isIE = /Trident/i.test(getUAString()); + if (isIE && isHTMLElement(element)) { + var elementCss = getComputedStyle2(element); + if (elementCss.position === "fixed") { + return null; + } + } + var currentNode = getParentNode(element); + if (isShadowRoot(currentNode)) { + currentNode = currentNode.host; + } + while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) { + var css = getComputedStyle2(currentNode); + if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") { + return currentNode; + } else { + currentNode = currentNode.parentNode; + } + } + return null; + } + function getOffsetParent(element) { + var window2 = getWindow(element); + var offsetParent = getTrueOffsetParent(element); + while (offsetParent && isTableElement(offsetParent) && getComputedStyle2(offsetParent).position === "static") { + offsetParent = getTrueOffsetParent(offsetParent); + } + if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static")) { + return window2; + } + return offsetParent || getContainingBlock(element) || window2; + } + var top = "top"; + var bottom = "bottom"; + var right = "right"; + var left = "left"; + var auto = "auto"; + var basePlacements = [top, bottom, right, left]; + var start = "start"; + var end = "end"; + var clippingParents = "clippingParents"; + var viewport = "viewport"; + var popper = "popper"; + var reference = "reference"; + var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) { + return acc.concat([placement + "-" + start, placement + "-" + end]); + }, []); + var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) { + return acc.concat([placement, placement + "-" + start, placement + "-" + end]); + }, []); + var beforeRead = "beforeRead"; + var read = "read"; + var afterRead = "afterRead"; + var beforeMain = "beforeMain"; + var main = "main"; + var afterMain = "afterMain"; + var beforeWrite = "beforeWrite"; + var write = "write"; + var afterWrite = "afterWrite"; + var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; + function order(modifiers) { + var map = /* @__PURE__ */ new Map(); + var visited = /* @__PURE__ */ new Set(); + var result = []; + modifiers.forEach(function(modifier) { + map.set(modifier.name, modifier); + }); + function sort(modifier) { + visited.add(modifier.name); + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + requires.forEach(function(dep) { + if (!visited.has(dep)) { + var depModifier = map.get(dep); + if (depModifier) { + sort(depModifier); + } + } + }); + result.push(modifier); + } + modifiers.forEach(function(modifier) { + if (!visited.has(modifier.name)) { + sort(modifier); + } + }); + return result; + } + function orderModifiers(modifiers) { + var orderedModifiers = order(modifiers); + return modifierPhases.reduce(function(acc, phase) { + return acc.concat(orderedModifiers.filter(function(modifier) { + return modifier.phase === phase; + })); + }, []); + } + function debounce(fn) { + var pending; + return function() { + if (!pending) { + pending = new Promise(function(resolve) { + Promise.resolve().then(function() { + pending = void 0; + resolve(fn()); + }); + }); + } + return pending; + }; + } + function mergeByName(modifiers) { + var merged = modifiers.reduce(function(merged2, current) { + var existing = merged2[current.name]; + merged2[current.name] = existing ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data) + }) : current; + return merged2; + }, {}); + return Object.keys(merged).map(function(key) { + return merged[key]; + }); + } + function getViewportRect(element, strategy) { + var win = getWindow(element); + var html = getDocumentElement(element); + var visualViewport = win.visualViewport; + var width = html.clientWidth; + var height = html.clientHeight; + var x2 = 0; + var y2 = 0; + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + var layoutViewport = isLayoutViewport(); + if (layoutViewport || !layoutViewport && strategy === "fixed") { + x2 = visualViewport.offsetLeft; + y2 = visualViewport.offsetTop; + } + } + return { + width, + height, + x: x2 + getWindowScrollBarX(element), + y: y2 + }; + } + function getDocumentRect(element) { + var _element$ownerDocumen; + var html = getDocumentElement(element); + var winScroll = getWindowScroll(element); + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; + var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var x2 = -winScroll.scrollLeft + getWindowScrollBarX(element); + var y2 = -winScroll.scrollTop; + if (getComputedStyle2(body || html).direction === "rtl") { + x2 += max(html.clientWidth, body ? body.clientWidth : 0) - width; + } + return { + width, + height, + x: x2, + y: y2 + }; + } + function contains(parent, child) { + var rootNode = child.getRootNode && child.getRootNode(); + if (parent.contains(child)) { + return true; + } else if (rootNode && isShadowRoot(rootNode)) { + var next = child; + do { + if (next && parent.isSameNode(next)) { + return true; + } + next = next.parentNode || next.host; + } while (next); + } + return false; + } + function rectToClientRect(rect) { + return Object.assign({}, rect, { + left: rect.x, + top: rect.y, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }); + } + function getInnerBoundingClientRect(element, strategy) { + var rect = getBoundingClientRect(element, false, strategy === "fixed"); + rect.top = rect.top + element.clientTop; + rect.left = rect.left + element.clientLeft; + rect.bottom = rect.top + element.clientHeight; + rect.right = rect.left + element.clientWidth; + rect.width = element.clientWidth; + rect.height = element.clientHeight; + rect.x = rect.left; + rect.y = rect.top; + return rect; + } + function getClientRectFromMixedType(element, clippingParent, strategy) { + return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); + } + function getClippingParents(element) { + var clippingParents2 = listScrollParents(getParentNode(element)); + var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle2(element).position) >= 0; + var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; + if (!isElement(clipperElement)) { + return []; + } + return clippingParents2.filter(function(clippingParent) { + return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body"; + }); + } + function getClippingRect(element, boundary, rootBoundary, strategy) { + var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary); + var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]); + var firstClippingParent = clippingParents2[0]; + var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) { + var rect = getClientRectFromMixedType(element, clippingParent, strategy); + accRect.top = max(rect.top, accRect.top); + accRect.right = min(rect.right, accRect.right); + accRect.bottom = min(rect.bottom, accRect.bottom); + accRect.left = max(rect.left, accRect.left); + return accRect; + }, getClientRectFromMixedType(element, firstClippingParent, strategy)); + clippingRect.width = clippingRect.right - clippingRect.left; + clippingRect.height = clippingRect.bottom - clippingRect.top; + clippingRect.x = clippingRect.left; + clippingRect.y = clippingRect.top; + return clippingRect; + } + function getBasePlacement(placement) { + return placement.split("-")[0]; + } + function getVariation(placement) { + return placement.split("-")[1]; + } + function getMainAxisFromPlacement(placement) { + return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y"; + } + function computeOffsets(_ref) { + var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement; + var basePlacement = placement ? getBasePlacement(placement) : null; + var variation = placement ? getVariation(placement) : null; + var commonX = reference2.x + reference2.width / 2 - element.width / 2; + var commonY = reference2.y + reference2.height / 2 - element.height / 2; + var offsets; + switch (basePlacement) { + case top: + offsets = { + x: commonX, + y: reference2.y - element.height + }; + break; + case bottom: + offsets = { + x: commonX, + y: reference2.y + reference2.height + }; + break; + case right: + offsets = { + x: reference2.x + reference2.width, + y: commonY + }; + break; + case left: + offsets = { + x: reference2.x - element.width, + y: commonY + }; + break; + default: + offsets = { + x: reference2.x, + y: reference2.y + }; + } + var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; + if (mainAxis != null) { + var len = mainAxis === "y" ? "height" : "width"; + switch (variation) { + case start: + offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2); + break; + case end: + offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2); + break; + } + } + return offsets; + } + function getFreshSideObject() { + return { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; + } + function mergePaddingObject(paddingObject) { + return Object.assign({}, getFreshSideObject(), paddingObject); + } + function expandToHashMap(value, keys) { + return keys.reduce(function(hashMap, key) { + hashMap[key] = value; + return hashMap; + }, {}); + } + function detectOverflow(state, options) { + if (options === void 0) { + options = {}; + } + var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); + var altContext = elementContext === popper ? reference : popper; + var popperRect = state.rects.popper; + var element = state.elements[altBoundary ? altContext : elementContext]; + var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); + var referenceClientRect = getBoundingClientRect(state.elements.reference); + var popperOffsets2 = computeOffsets({ + reference: referenceClientRect, + element: popperRect, + strategy: "absolute", + placement + }); + var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2)); + var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; + var overflowOffsets = { + top: clippingClientRect.top - elementClientRect.top + paddingObject.top, + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, + left: clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: elementClientRect.right - clippingClientRect.right + paddingObject.right + }; + var offsetData = state.modifiersData.offset; + if (elementContext === popper && offsetData) { + var offset2 = offsetData[placement]; + Object.keys(overflowOffsets).forEach(function(key) { + var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; + var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x"; + overflowOffsets[key] += offset2[axis] * multiply; + }); + } + return overflowOffsets; + } + var DEFAULT_OPTIONS = { + placement: "bottom", + modifiers: [], + strategy: "absolute" + }; + function areValidElements() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return !args.some(function(element) { + return !(element && typeof element.getBoundingClientRect === "function"); + }); + } + function popperGenerator(generatorOptions) { + if (generatorOptions === void 0) { + generatorOptions = {}; + } + var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + return function createPopper2(reference2, popper2, options) { + if (options === void 0) { + options = defaultOptions; + } + var state = { + placement: "bottom", + orderedModifiers: [], + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + modifiersData: {}, + elements: { + reference: reference2, + popper: popper2 + }, + attributes: {}, + styles: {} + }; + var effectCleanupFns = []; + var isDestroyed = false; + var instance = { + state, + setOptions: function setOptions(setOptionsAction) { + var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction; + cleanupModifierEffects(); + state.options = Object.assign({}, defaultOptions, state.options, options2); + state.scrollParents = { + reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [], + popper: listScrollParents(popper2) + }; + var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers))); + state.orderedModifiers = orderedModifiers.filter(function(m2) { + return m2.enabled; + }); + runModifierEffects(); + return instance.update(); + }, + // Sync update – it will always be executed, even if not necessary. This + // is useful for low frequency updates where sync behavior simplifies the + // logic. + // For high frequency updates (e.g. `resize` and `scroll` events), always + // prefer the async Popper#update method + forceUpdate: function forceUpdate() { + if (isDestroyed) { + return; + } + var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper; + if (!areValidElements(reference3, popper3)) { + return; + } + state.rects = { + reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"), + popper: getLayoutRect(popper3) + }; + state.reset = false; + state.placement = state.options.placement; + state.orderedModifiers.forEach(function(modifier) { + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + }); + for (var index = 0; index < state.orderedModifiers.length; index++) { + if (state.reset === true) { + state.reset = false; + index = -1; + continue; + } + var _state$orderedModifie = state.orderedModifiers[index], fn = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name; + if (typeof fn === "function") { + state = fn({ + state, + options: _options, + name, + instance + }) || state; + } + } + }, + // Async and optimistically optimized update – it will not be executed if + // not necessary (debounced to run at most once-per-tick) + update: debounce(function() { + return new Promise(function(resolve) { + instance.forceUpdate(); + resolve(state); + }); + }), + destroy: function destroy() { + cleanupModifierEffects(); + isDestroyed = true; + } + }; + if (!areValidElements(reference2, popper2)) { + return instance; + } + instance.setOptions(options).then(function(state2) { + if (!isDestroyed && options.onFirstUpdate) { + options.onFirstUpdate(state2); + } + }); + function runModifierEffects() { + state.orderedModifiers.forEach(function(_ref) { + var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect2 = _ref.effect; + if (typeof effect2 === "function") { + var cleanupFn = effect2({ + state, + name, + instance, + options: options2 + }); + var noopFn = function noopFn2() { + }; + effectCleanupFns.push(cleanupFn || noopFn); + } + }); + } + function cleanupModifierEffects() { + effectCleanupFns.forEach(function(fn) { + return fn(); + }); + effectCleanupFns = []; + } + return instance; + }; + } + var passive = { + passive: true + }; + function effect$2(_ref) { + var state = _ref.state, instance = _ref.instance, options = _ref.options; + var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize; + var window2 = getWindow(state.elements.popper); + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + if (scroll) { + scrollParents.forEach(function(scrollParent) { + scrollParent.addEventListener("scroll", instance.update, passive); + }); + } + if (resize) { + window2.addEventListener("resize", instance.update, passive); + } + return function() { + if (scroll) { + scrollParents.forEach(function(scrollParent) { + scrollParent.removeEventListener("scroll", instance.update, passive); + }); + } + if (resize) { + window2.removeEventListener("resize", instance.update, passive); + } + }; + } + var eventListeners = { + name: "eventListeners", + enabled: true, + phase: "write", + fn: function fn() { + }, + effect: effect$2, + data: {} + }; + function popperOffsets(_ref) { + var state = _ref.state, name = _ref.name; + state.modifiersData[name] = computeOffsets({ + reference: state.rects.reference, + element: state.rects.popper, + strategy: "absolute", + placement: state.placement + }); + } + var popperOffsets$1 = { + name: "popperOffsets", + enabled: true, + phase: "read", + fn: popperOffsets, + data: {} + }; + var unsetSides = { + top: "auto", + right: "auto", + bottom: "auto", + left: "auto" + }; + function roundOffsetsByDPR(_ref, win) { + var x2 = _ref.x, y2 = _ref.y; + var dpr = win.devicePixelRatio || 1; + return { + x: round(x2 * dpr) / dpr || 0, + y: round(y2 * dpr) / dpr || 0 + }; + } + function mapToStyles(_ref2) { + var _Object$assign2; + var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed; + var _offsets$x = offsets.x, x2 = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y2 = _offsets$y === void 0 ? 0 : _offsets$y; + var _ref3 = typeof roundOffsets === "function" ? roundOffsets({ + x: x2, + y: y2 + }) : { + x: x2, + y: y2 + }; + x2 = _ref3.x; + y2 = _ref3.y; + var hasX = offsets.hasOwnProperty("x"); + var hasY = offsets.hasOwnProperty("y"); + var sideX = left; + var sideY = top; + var win = window; + if (adaptive) { + var offsetParent = getOffsetParent(popper2); + var heightProp = "clientHeight"; + var widthProp = "clientWidth"; + if (offsetParent === getWindow(popper2)) { + offsetParent = getDocumentElement(popper2); + if (getComputedStyle2(offsetParent).position !== "static" && position === "absolute") { + heightProp = "scrollHeight"; + widthProp = "scrollWidth"; + } + } + offsetParent = offsetParent; + if (placement === top || (placement === left || placement === right) && variation === end) { + sideY = bottom; + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : ( + // $FlowFixMe[prop-missing] + offsetParent[heightProp] + ); + y2 -= offsetY - popperRect.height; + y2 *= gpuAcceleration ? 1 : -1; + } + if (placement === left || (placement === top || placement === bottom) && variation === end) { + sideX = right; + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : ( + // $FlowFixMe[prop-missing] + offsetParent[widthProp] + ); + x2 -= offsetX - popperRect.width; + x2 *= gpuAcceleration ? 1 : -1; + } + } + var commonStyles = Object.assign({ + position + }, adaptive && unsetSides); + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ + x: x2, + y: y2 + }, getWindow(popper2)) : { + x: x2, + y: y2 + }; + x2 = _ref4.x; + y2 = _ref4.y; + if (gpuAcceleration) { + var _Object$assign; + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x2 + "px, " + y2 + "px)" : "translate3d(" + x2 + "px, " + y2 + "px, 0)", _Object$assign)); + } + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y2 + "px" : "", _Object$assign2[sideX] = hasX ? x2 + "px" : "", _Object$assign2.transform = "", _Object$assign2)); + } + function computeStyles(_ref5) { + var state = _ref5.state, options = _ref5.options; + var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + var commonStyles = { + placement: getBasePlacement(state.placement), + variation: getVariation(state.placement), + popper: state.elements.popper, + popperRect: state.rects.popper, + gpuAcceleration, + isFixed: state.options.strategy === "fixed" + }; + if (state.modifiersData.popperOffsets != null) { + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive, + roundOffsets + }))); + } + if (state.modifiersData.arrow != null) { + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: "absolute", + adaptive: false, + roundOffsets + }))); + } + state.attributes.popper = Object.assign({}, state.attributes.popper, { + "data-popper-placement": state.placement + }); + } + var computeStyles$1 = { + name: "computeStyles", + enabled: true, + phase: "beforeWrite", + fn: computeStyles, + data: {} + }; + function applyStyles(_ref) { + var state = _ref.state; + Object.keys(state.elements).forEach(function(name) { + var style = state.styles[name] || {}; + var attributes = state.attributes[name] || {}; + var element = state.elements[name]; + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + Object.assign(element.style, style); + Object.keys(attributes).forEach(function(name2) { + var value = attributes[name2]; + if (value === false) { + element.removeAttribute(name2); + } else { + element.setAttribute(name2, value === true ? "" : value); + } + }); + }); + } + function effect$1(_ref2) { + var state = _ref2.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: "0", + top: "0", + margin: "0" + }, + arrow: { + position: "absolute" + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + return function() { + Object.keys(state.elements).forEach(function(name) { + var element = state.elements[name]; + var attributes = state.attributes[name] || {}; + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); + var style = styleProperties.reduce(function(style2, property) { + style2[property] = ""; + return style2; + }, {}); + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + Object.assign(element.style, style); + Object.keys(attributes).forEach(function(attribute) { + element.removeAttribute(attribute); + }); + }); + }; + } + var applyStyles$1 = { + name: "applyStyles", + enabled: true, + phase: "write", + fn: applyStyles, + effect: effect$1, + requires: ["computeStyles"] + }; + function distanceAndSkiddingToXY(placement, rects, offset2) { + var basePlacement = getBasePlacement(placement); + var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; + var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, { + placement + })) : offset2, skidding = _ref[0], distance = _ref[1]; + skidding = skidding || 0; + distance = (distance || 0) * invertDistance; + return [left, right].indexOf(basePlacement) >= 0 ? { + x: distance, + y: skidding + } : { + x: skidding, + y: distance + }; + } + function offset(_ref2) { + var state = _ref2.state, options = _ref2.options, name = _ref2.name; + var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset; + var data = placements.reduce(function(acc, placement) { + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2); + return acc; + }, {}); + var _data$state$placement = data[state.placement], x2 = _data$state$placement.x, y2 = _data$state$placement.y; + if (state.modifiersData.popperOffsets != null) { + state.modifiersData.popperOffsets.x += x2; + state.modifiersData.popperOffsets.y += y2; + } + state.modifiersData[name] = data; + } + var offset$1 = { + name: "offset", + enabled: true, + phase: "main", + requires: ["popperOffsets"], + fn: offset + }; + var hash$1 = { + left: "right", + right: "left", + bottom: "top", + top: "bottom" + }; + function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, function(matched) { + return hash$1[matched]; + }); + } + var hash = { + start: "end", + end: "start" + }; + function getOppositeVariationPlacement(placement) { + return placement.replace(/start|end/g, function(matched) { + return hash[matched]; + }); + } + function computeAutoPlacement(state, options) { + if (options === void 0) { + options = {}; + } + var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; + var variation = getVariation(placement); + var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) { + return getVariation(placement2) === variation; + }) : basePlacements; + var allowedPlacements = placements$1.filter(function(placement2) { + return allowedAutoPlacements.indexOf(placement2) >= 0; + }); + if (allowedPlacements.length === 0) { + allowedPlacements = placements$1; + } + var overflows = allowedPlacements.reduce(function(acc, placement2) { + acc[placement2] = detectOverflow(state, { + placement: placement2, + boundary, + rootBoundary, + padding + })[getBasePlacement(placement2)]; + return acc; + }, {}); + return Object.keys(overflows).sort(function(a2, b2) { + return overflows[a2] - overflows[b2]; + }); + } + function getExpandedFallbackPlacements(placement) { + if (getBasePlacement(placement) === auto) { + return []; + } + var oppositePlacement = getOppositePlacement(placement); + return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; + } + function flip(_ref) { + var state = _ref.state, options = _ref.options, name = _ref.name; + if (state.modifiersData[name]._skip) { + return; + } + var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements; + var preferredPlacement = state.options.placement; + var basePlacement = getBasePlacement(preferredPlacement); + var isBasePlacement = basePlacement === preferredPlacement; + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); + var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) { + return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, { + placement: placement2, + boundary, + rootBoundary, + padding, + flipVariations, + allowedAutoPlacements + }) : placement2); + }, []); + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var checksMap = /* @__PURE__ */ new Map(); + var makeFallbackChecks = true; + var firstFittingPlacement = placements2[0]; + for (var i2 = 0; i2 < placements2.length; i2++) { + var placement = placements2[i2]; + var _basePlacement = getBasePlacement(placement); + var isStartVariation = getVariation(placement) === start; + var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; + var len = isVertical ? "width" : "height"; + var overflow = detectOverflow(state, { + placement, + boundary, + rootBoundary, + altBoundary, + padding + }); + var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; + if (referenceRect[len] > popperRect[len]) { + mainVariationSide = getOppositePlacement(mainVariationSide); + } + var altVariationSide = getOppositePlacement(mainVariationSide); + var checks = []; + if (checkMainAxis) { + checks.push(overflow[_basePlacement] <= 0); + } + if (checkAltAxis) { + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + } + if (checks.every(function(check) { + return check; + })) { + firstFittingPlacement = placement; + makeFallbackChecks = false; + break; + } + checksMap.set(placement, checks); + } + if (makeFallbackChecks) { + var numberOfChecks = flipVariations ? 3 : 1; + var _loop = function _loop2(_i2) { + var fittingPlacement = placements2.find(function(placement2) { + var checks2 = checksMap.get(placement2); + if (checks2) { + return checks2.slice(0, _i2).every(function(check) { + return check; + }); + } + }); + if (fittingPlacement) { + firstFittingPlacement = fittingPlacement; + return "break"; + } + }; + for (var _i = numberOfChecks; _i > 0; _i--) { + var _ret = _loop(_i); + if (_ret === "break") break; + } + } + if (state.placement !== firstFittingPlacement) { + state.modifiersData[name]._skip = true; + state.placement = firstFittingPlacement; + state.reset = true; + } + } + var flip$1 = { + name: "flip", + enabled: true, + phase: "main", + fn: flip, + requiresIfExists: ["offset"], + data: { + _skip: false + } + }; + function getAltAxis(axis) { + return axis === "x" ? "y" : "x"; + } + function within(min$1, value, max$1) { + return max(min$1, min(value, max$1)); + } + function withinMaxClamp(min2, value, max2) { + var v2 = within(min2, value, max2); + return v2 > max2 ? max2 : v2; + } + function preventOverflow(_ref) { + var state = _ref.state, options = _ref.options, name = _ref.name; + var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + var overflow = detectOverflow(state, { + boundary, + rootBoundary, + padding, + altBoundary + }); + var basePlacement = getBasePlacement(state.placement); + var variation = getVariation(state.placement); + var isBasePlacement = !variation; + var mainAxis = getMainAxisFromPlacement(basePlacement); + var altAxis = getAltAxis(mainAxis); + var popperOffsets2 = state.modifiersData.popperOffsets; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, { + placement: state.placement + })) : tetherOffset; + var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? { + mainAxis: tetherOffsetValue, + altAxis: tetherOffsetValue + } : Object.assign({ + mainAxis: 0, + altAxis: 0 + }, tetherOffsetValue); + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; + var data = { + x: 0, + y: 0 + }; + if (!popperOffsets2) { + return; + } + if (checkMainAxis) { + var _offsetModifierState$; + var mainSide = mainAxis === "y" ? top : left; + var altSide = mainAxis === "y" ? bottom : right; + var len = mainAxis === "y" ? "height" : "width"; + var offset2 = popperOffsets2[mainAxis]; + var min$1 = offset2 + overflow[mainSide]; + var max$1 = offset2 - overflow[altSide]; + var additive = tether ? -popperRect[len] / 2 : 0; + var minLen = variation === start ? referenceRect[len] : popperRect[len]; + var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; + var arrowElement = state.elements.arrow; + var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { + width: 0, + height: 0 + }; + var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject(); + var arrowPaddingMin = arrowPaddingObject[mainSide]; + var arrowPaddingMax = arrowPaddingObject[altSide]; + var arrowLen = within(0, referenceRect[len], arrowRect[len]); + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; + var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); + var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; + var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset; + var tetherMax = offset2 + maxOffset - offsetModifierValue; + var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset2, tether ? max(max$1, tetherMax) : max$1); + popperOffsets2[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset2; + } + if (checkAltAxis) { + var _offsetModifierState$2; + var _mainSide = mainAxis === "x" ? top : left; + var _altSide = mainAxis === "x" ? bottom : right; + var _offset = popperOffsets2[altAxis]; + var _len = altAxis === "y" ? "height" : "width"; + var _min = _offset + overflow[_mainSide]; + var _max = _offset - overflow[_altSide]; + var isOriginSide = [top, left].indexOf(basePlacement) !== -1; + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; + var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); + popperOffsets2[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; + } + state.modifiersData[name] = data; + } + var preventOverflow$1 = { + name: "preventOverflow", + enabled: true, + phase: "main", + fn: preventOverflow, + requiresIfExists: ["offset"] + }; + var toPaddingObject = function toPaddingObject2(padding, state) { + padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, { + placement: state.placement + })) : padding; + return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); + }; + function arrow(_ref) { + var _state$modifiersData$; + var state = _ref.state, name = _ref.name, options = _ref.options; + var arrowElement = state.elements.arrow; + var popperOffsets2 = state.modifiersData.popperOffsets; + var basePlacement = getBasePlacement(state.placement); + var axis = getMainAxisFromPlacement(basePlacement); + var isVertical = [left, right].indexOf(basePlacement) >= 0; + var len = isVertical ? "height" : "width"; + if (!arrowElement || !popperOffsets2) { + return; + } + var paddingObject = toPaddingObject(options.padding, state); + var arrowRect = getLayoutRect(arrowElement); + var minProp = axis === "y" ? top : left; + var maxProp = axis === "y" ? bottom : right; + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len]; + var startDiff = popperOffsets2[axis] - state.rects.reference[axis]; + var arrowOffsetParent = getOffsetParent(arrowElement); + var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var centerToReference = endDiff / 2 - startDiff / 2; + var min2 = paddingObject[minProp]; + var max2 = clientSize - arrowRect[len] - paddingObject[maxProp]; + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; + var offset2 = within(min2, center, max2); + var axisProp = axis; + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$); + } + function effect(_ref2) { + var state = _ref2.state, options = _ref2.options; + var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element; + if (arrowElement == null) { + return; + } + if (typeof arrowElement === "string") { + arrowElement = state.elements.popper.querySelector(arrowElement); + if (!arrowElement) { + return; + } + } + if (!contains(state.elements.popper, arrowElement)) { + return; + } + state.elements.arrow = arrowElement; + } + var arrow$1 = { + name: "arrow", + enabled: true, + phase: "main", + fn: arrow, + effect, + requires: ["popperOffsets"], + requiresIfExists: ["preventOverflow"] + }; + function getSideOffsets(overflow, rect, preventedOffsets) { + if (preventedOffsets === void 0) { + preventedOffsets = { + x: 0, + y: 0 + }; + } + return { + top: overflow.top - rect.height - preventedOffsets.y, + right: overflow.right - rect.width + preventedOffsets.x, + bottom: overflow.bottom - rect.height + preventedOffsets.y, + left: overflow.left - rect.width - preventedOffsets.x + }; + } + function isAnySideFullyClipped(overflow) { + return [top, right, bottom, left].some(function(side) { + return overflow[side] >= 0; + }); + } + function hide(_ref) { + var state = _ref.state, name = _ref.name; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var preventedOffsets = state.modifiersData.preventOverflow; + var referenceOverflow = detectOverflow(state, { + elementContext: "reference" + }); + var popperAltOverflow = detectOverflow(state, { + altBoundary: true + }); + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); + state.modifiersData[name] = { + referenceClippingOffsets, + popperEscapeOffsets, + isReferenceHidden, + hasPopperEscaped + }; + state.attributes.popper = Object.assign({}, state.attributes.popper, { + "data-popper-reference-hidden": isReferenceHidden, + "data-popper-escaped": hasPopperEscaped + }); + } + var hide$1 = { + name: "hide", + enabled: true, + phase: "main", + requiresIfExists: ["preventOverflow"], + fn: hide + }; + var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1]; + var createPopper$1 = /* @__PURE__ */ popperGenerator({ + defaultModifiers: defaultModifiers$1 + }); + var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1]; + var createPopper = /* @__PURE__ */ popperGenerator({ + defaultModifiers + }); + exports.applyStyles = applyStyles$1; + exports.arrow = arrow$1; + exports.computeStyles = computeStyles$1; + exports.createPopper = createPopper; + exports.createPopperLite = createPopper$1; + exports.defaultModifiers = defaultModifiers; + exports.detectOverflow = detectOverflow; + exports.eventListeners = eventListeners; + exports.flip = flip$1; + exports.hide = hide$1; + exports.offset = offset$1; + exports.popperGenerator = popperGenerator; + exports.popperOffsets = popperOffsets$1; + exports.preventOverflow = preventOverflow$1; + } +}); + +// ../../../node_modules/tippy.js/dist/tippy.cjs.js +var require_tippy_cjs = __commonJS({ + "../../../node_modules/tippy.js/dist/tippy.cjs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var core = require_popper(); + var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>'; + var BOX_CLASS = "tippy-box"; + var CONTENT_CLASS = "tippy-content"; + var BACKDROP_CLASS = "tippy-backdrop"; + var ARROW_CLASS = "tippy-arrow"; + var SVG_ARROW_CLASS = "tippy-svg-arrow"; + var TOUCH_OPTIONS = { + passive: true, + capture: true + }; + var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO2() { + return document.body; + }; + function hasOwnProperty(obj, key) { + return {}.hasOwnProperty.call(obj, key); + } + function getValueAtIndexOrReturn(value, index, defaultValue) { + if (Array.isArray(value)) { + var v2 = value[index]; + return v2 == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v2; + } + return value; + } + function isType(value, type) { + var str = {}.toString.call(value); + return str.indexOf("[object") === 0 && str.indexOf(type + "]") > -1; + } + function invokeWithArgsOrReturn(value, args) { + return typeof value === "function" ? value.apply(void 0, args) : value; + } + function debounce(fn, ms) { + if (ms === 0) { + return fn; + } + var timeout; + return function(arg) { + clearTimeout(timeout); + timeout = setTimeout(function() { + fn(arg); + }, ms); + }; + } + function removeProperties(obj, keys) { + var clone = Object.assign({}, obj); + keys.forEach(function(key) { + delete clone[key]; + }); + return clone; + } + function splitBySpaces(value) { + return value.split(/\s+/).filter(Boolean); + } + function normalizeToArray(value) { + return [].concat(value); + } + function pushIfUnique(arr, value) { + if (arr.indexOf(value) === -1) { + arr.push(value); + } + } + function unique(arr) { + return arr.filter(function(item, index) { + return arr.indexOf(item) === index; + }); + } + function getBasePlacement(placement) { + return placement.split("-")[0]; + } + function arrayFrom(value) { + return [].slice.call(value); + } + function removeUndefinedProps(obj) { + return Object.keys(obj).reduce(function(acc, key) { + if (obj[key] !== void 0) { + acc[key] = obj[key]; + } + return acc; + }, {}); + } + function div() { + return document.createElement("div"); + } + function isElement(value) { + return ["Element", "Fragment"].some(function(type) { + return isType(value, type); + }); + } + function isNodeList(value) { + return isType(value, "NodeList"); + } + function isMouseEvent(value) { + return isType(value, "MouseEvent"); + } + function isReferenceElement(value) { + return !!(value && value._tippy && value._tippy.reference === value); + } + function getArrayOfElements(value) { + if (isElement(value)) { + return [value]; + } + if (isNodeList(value)) { + return arrayFrom(value); + } + if (Array.isArray(value)) { + return value; + } + return arrayFrom(document.querySelectorAll(value)); + } + function setTransitionDuration(els, value) { + els.forEach(function(el) { + if (el) { + el.style.transitionDuration = value + "ms"; + } + }); + } + function setVisibilityState(els, state) { + els.forEach(function(el) { + if (el) { + el.setAttribute("data-state", state); + } + }); + } + function getOwnerDocument(elementOrElements) { + var _element$ownerDocumen; + var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0]; + return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document; + } + function isCursorOutsideInteractiveBorder(popperTreeData, event) { + var clientX = event.clientX, clientY = event.clientY; + return popperTreeData.every(function(_ref) { + var popperRect = _ref.popperRect, popperState = _ref.popperState, props = _ref.props; + var interactiveBorder = props.interactiveBorder; + var basePlacement = getBasePlacement(popperState.placement); + var offsetData = popperState.modifiersData.offset; + if (!offsetData) { + return true; + } + var topDistance = basePlacement === "bottom" ? offsetData.top.y : 0; + var bottomDistance = basePlacement === "top" ? offsetData.bottom.y : 0; + var leftDistance = basePlacement === "right" ? offsetData.left.x : 0; + var rightDistance = basePlacement === "left" ? offsetData.right.x : 0; + var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder; + var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder; + var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder; + var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder; + return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight; + }); + } + function updateTransitionEndListener(box, action, listener) { + var method = action + "EventListener"; + ["transitionend", "webkitTransitionEnd"].forEach(function(event) { + box[method](event, listener); + }); + } + function actualContains(parent, child) { + var target = child; + while (target) { + var _target$getRootNode; + if (parent.contains(target)) { + return true; + } + target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host; + } + return false; + } + var currentInput = { + isTouch: false + }; + var lastMouseMoveTime = 0; + function onDocumentTouchStart() { + if (currentInput.isTouch) { + return; + } + currentInput.isTouch = true; + if (window.performance) { + document.addEventListener("mousemove", onDocumentMouseMove); + } + } + function onDocumentMouseMove() { + var now = performance.now(); + if (now - lastMouseMoveTime < 20) { + currentInput.isTouch = false; + document.removeEventListener("mousemove", onDocumentMouseMove); + } + lastMouseMoveTime = now; + } + function onWindowBlur() { + var activeElement = document.activeElement; + if (isReferenceElement(activeElement)) { + var instance = activeElement._tippy; + if (activeElement.blur && !instance.state.isVisible) { + activeElement.blur(); + } + } + } + function bindGlobalEventListeners() { + document.addEventListener("touchstart", onDocumentTouchStart, TOUCH_OPTIONS); + window.addEventListener("blur", onWindowBlur); + } + var isBrowser = typeof window !== "undefined" && typeof document !== "undefined"; + var isIE11 = isBrowser ? ( + // @ts-ignore + !!window.msCrypto + ) : false; + function createMemoryLeakWarning(method) { + var txt = method === "destroy" ? "n already-" : " "; + return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" "); + } + function clean(value) { + var spacesAndTabs = /[ \t]{2,}/g; + var lineStartWithSpaces = /^[ \t]*/gm; + return value.replace(spacesAndTabs, " ").replace(lineStartWithSpaces, "").trim(); + } + function getDevMessage(message) { + return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\u{1F477}\u200D This is a development-only message. It will be removed in production.\n "); + } + function getFormattedMessage(message) { + return [ + getDevMessage(message), + // title + "color: #00C584; font-size: 1.3em; font-weight: bold;", + // message + "line-height: 1.5", + // footer + "color: #a6a095;" + ]; + } + var visitedMessages; + if (process.env.NODE_ENV !== "production") { + resetVisitedMessages(); + } + function resetVisitedMessages() { + visitedMessages = /* @__PURE__ */ new Set(); + } + function warnWhen(condition, message) { + if (condition && !visitedMessages.has(message)) { + var _console; + visitedMessages.add(message); + (_console = console).warn.apply(_console, getFormattedMessage(message)); + } + } + function errorWhen(condition, message) { + if (condition && !visitedMessages.has(message)) { + var _console2; + visitedMessages.add(message); + (_console2 = console).error.apply(_console2, getFormattedMessage(message)); + } + } + function validateTargets(targets) { + var didPassFalsyValue = !targets; + var didPassPlainObject = Object.prototype.toString.call(targets) === "[object Object]" && !targets.addEventListener; + errorWhen(didPassFalsyValue, ["tippy() was passed", "`" + String(targets) + "`", "as its targets (first) argument. Valid types are: String, Element,", "Element[], or NodeList."].join(" ")); + errorWhen(didPassPlainObject, ["tippy() was passed a plain object which is not supported as an argument", "for virtual positioning. Use props.getReferenceClientRect instead."].join(" ")); + } + var pluginProps = { + animateFill: false, + followCursor: false, + inlinePositioning: false, + sticky: false + }; + var renderProps = { + allowHTML: false, + animation: "fade", + arrow: true, + content: "", + inertia: false, + maxWidth: 350, + role: "tooltip", + theme: "", + zIndex: 9999 + }; + var defaultProps = Object.assign({ + appendTo: TIPPY_DEFAULT_APPEND_TO, + aria: { + content: "auto", + expanded: "auto" + }, + delay: 0, + duration: [300, 250], + getReferenceClientRect: null, + hideOnClick: true, + ignoreAttributes: false, + interactive: false, + interactiveBorder: 2, + interactiveDebounce: 0, + moveTransition: "", + offset: [0, 10], + onAfterUpdate: function onAfterUpdate() { + }, + onBeforeUpdate: function onBeforeUpdate() { + }, + onCreate: function onCreate() { + }, + onDestroy: function onDestroy() { + }, + onHidden: function onHidden() { + }, + onHide: function onHide() { + }, + onMount: function onMount() { + }, + onShow: function onShow() { + }, + onShown: function onShown() { + }, + onTrigger: function onTrigger() { + }, + onUntrigger: function onUntrigger() { + }, + onClickOutside: function onClickOutside() { + }, + placement: "top", + plugins: [], + popperOptions: {}, + render: null, + showOnCreate: false, + touch: true, + trigger: "mouseenter focus", + triggerTarget: null + }, pluginProps, renderProps); + var defaultKeys = Object.keys(defaultProps); + var setDefaultProps = function setDefaultProps2(partialProps) { + if (process.env.NODE_ENV !== "production") { + validateProps(partialProps, []); + } + var keys = Object.keys(partialProps); + keys.forEach(function(key) { + defaultProps[key] = partialProps[key]; + }); + }; + function getExtendedPassedProps(passedProps) { + var plugins = passedProps.plugins || []; + var pluginProps2 = plugins.reduce(function(acc, plugin) { + var name = plugin.name, defaultValue = plugin.defaultValue; + if (name) { + var _name; + acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue; + } + return acc; + }, {}); + return Object.assign({}, passedProps, pluginProps2); + } + function getDataAttributeProps(reference, plugins) { + var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, { + plugins + }))) : defaultKeys; + var props = propKeys.reduce(function(acc, key) { + var valueAsString = (reference.getAttribute("data-tippy-" + key) || "").trim(); + if (!valueAsString) { + return acc; + } + if (key === "content") { + acc[key] = valueAsString; + } else { + try { + acc[key] = JSON.parse(valueAsString); + } catch (e2) { + acc[key] = valueAsString; + } + } + return acc; + }, {}); + return props; + } + function evaluateProps(reference, props) { + var out = Object.assign({}, props, { + content: invokeWithArgsOrReturn(props.content, [reference]) + }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins)); + out.aria = Object.assign({}, defaultProps.aria, out.aria); + out.aria = { + expanded: out.aria.expanded === "auto" ? props.interactive : out.aria.expanded, + content: out.aria.content === "auto" ? props.interactive ? null : "describedby" : out.aria.content + }; + return out; + } + function validateProps(partialProps, plugins) { + if (partialProps === void 0) { + partialProps = {}; + } + if (plugins === void 0) { + plugins = []; + } + var keys = Object.keys(partialProps); + keys.forEach(function(prop) { + var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps)); + var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop); + if (didPassUnknownProp) { + didPassUnknownProp = plugins.filter(function(plugin) { + return plugin.name === prop; + }).length === 0; + } + warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", "\n\n", "All props: https://atomiks.github.io/tippyjs/v6/all-props/\n", "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" ")); + }); + } + var innerHTML = function innerHTML2() { + return "innerHTML"; + }; + function dangerouslySetInnerHTML(element, html) { + element[innerHTML()] = html; + } + function createArrowElement(value) { + var arrow = div(); + if (value === true) { + arrow.className = ARROW_CLASS; + } else { + arrow.className = SVG_ARROW_CLASS; + if (isElement(value)) { + arrow.appendChild(value); + } else { + dangerouslySetInnerHTML(arrow, value); + } + } + return arrow; + } + function setContent(content, props) { + if (isElement(props.content)) { + dangerouslySetInnerHTML(content, ""); + content.appendChild(props.content); + } else if (typeof props.content !== "function") { + if (props.allowHTML) { + dangerouslySetInnerHTML(content, props.content); + } else { + content.textContent = props.content; + } + } + } + function getChildren(popper) { + var box = popper.firstElementChild; + var boxChildren = arrayFrom(box.children); + return { + box, + content: boxChildren.find(function(node) { + return node.classList.contains(CONTENT_CLASS); + }), + arrow: boxChildren.find(function(node) { + return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS); + }), + backdrop: boxChildren.find(function(node) { + return node.classList.contains(BACKDROP_CLASS); + }) + }; + } + function render(instance) { + var popper = div(); + var box = div(); + box.className = BOX_CLASS; + box.setAttribute("data-state", "hidden"); + box.setAttribute("tabindex", "-1"); + var content = div(); + content.className = CONTENT_CLASS; + content.setAttribute("data-state", "hidden"); + setContent(content, instance.props); + popper.appendChild(box); + box.appendChild(content); + onUpdate(instance.props, instance.props); + function onUpdate(prevProps, nextProps) { + var _getChildren = getChildren(popper), box2 = _getChildren.box, content2 = _getChildren.content, arrow = _getChildren.arrow; + if (nextProps.theme) { + box2.setAttribute("data-theme", nextProps.theme); + } else { + box2.removeAttribute("data-theme"); + } + if (typeof nextProps.animation === "string") { + box2.setAttribute("data-animation", nextProps.animation); + } else { + box2.removeAttribute("data-animation"); + } + if (nextProps.inertia) { + box2.setAttribute("data-inertia", ""); + } else { + box2.removeAttribute("data-inertia"); + } + box2.style.maxWidth = typeof nextProps.maxWidth === "number" ? nextProps.maxWidth + "px" : nextProps.maxWidth; + if (nextProps.role) { + box2.setAttribute("role", nextProps.role); + } else { + box2.removeAttribute("role"); + } + if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) { + setContent(content2, instance.props); + } + if (nextProps.arrow) { + if (!arrow) { + box2.appendChild(createArrowElement(nextProps.arrow)); + } else if (prevProps.arrow !== nextProps.arrow) { + box2.removeChild(arrow); + box2.appendChild(createArrowElement(nextProps.arrow)); + } + } else if (arrow) { + box2.removeChild(arrow); + } + } + return { + popper, + onUpdate + }; + } + render.$$tippy = true; + var idCounter = 1; + var mouseMoveListeners = []; + var mountedInstances = []; + function createTippy(reference, passedProps) { + var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); + var showTimeout; + var hideTimeout; + var scheduleHideAnimationFrame; + var isVisibleFromClick = false; + var didHideDueToDocumentMouseDown = false; + var didTouchMove = false; + var ignoreOnFirstUpdate = false; + var lastTriggerEvent; + var currentTransitionEndListener; + var onFirstUpdate; + var listeners = []; + var debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce); + var currentTarget; + var id = idCounter++; + var popperInstance = null; + var plugins = unique(props.plugins); + var state = { + // Is the instance currently enabled? + isEnabled: true, + // Is the tippy currently showing and not transitioning out? + isVisible: false, + // Has the instance been destroyed? + isDestroyed: false, + // Is the tippy currently mounted to the DOM? + isMounted: false, + // Has the tippy finished transitioning in? + isShown: false + }; + var instance = { + // properties + id, + reference, + popper: div(), + popperInstance, + props, + state, + plugins, + // methods + clearDelayTimeouts, + setProps, + setContent: setContent2, + show, + hide, + hideWithInteractivity, + enable, + disable, + unmount, + destroy + }; + if (!props.render) { + if (process.env.NODE_ENV !== "production") { + errorWhen(true, "render() function has not been supplied."); + } + return instance; + } + var _props$render = props.render(instance), popper = _props$render.popper, onUpdate = _props$render.onUpdate; + popper.setAttribute("data-tippy-root", ""); + popper.id = "tippy-" + instance.id; + instance.popper = popper; + reference._tippy = instance; + popper._tippy = instance; + var pluginsHooks = plugins.map(function(plugin) { + return plugin.fn(instance); + }); + var hasAriaExpanded = reference.hasAttribute("aria-expanded"); + addListeners(); + handleAriaExpandedAttribute(); + handleStyles(); + invokeHook("onCreate", [instance]); + if (props.showOnCreate) { + scheduleShow(); + } + popper.addEventListener("mouseenter", function() { + if (instance.props.interactive && instance.state.isVisible) { + instance.clearDelayTimeouts(); + } + }); + popper.addEventListener("mouseleave", function() { + if (instance.props.interactive && instance.props.trigger.indexOf("mouseenter") >= 0) { + getDocument().addEventListener("mousemove", debouncedOnMouseMove); + } + }); + return instance; + function getNormalizedTouchSettings() { + var touch = instance.props.touch; + return Array.isArray(touch) ? touch : [touch, 0]; + } + function getIsCustomTouchBehavior() { + return getNormalizedTouchSettings()[0] === "hold"; + } + function getIsDefaultRenderFn() { + var _instance$props$rende; + return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy); + } + function getCurrentTarget() { + return currentTarget || reference; + } + function getDocument() { + var parent = getCurrentTarget().parentNode; + return parent ? getOwnerDocument(parent) : document; + } + function getDefaultTemplateChildren() { + return getChildren(popper); + } + function getDelay(isShow) { + if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") { + return 0; + } + return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay); + } + function handleStyles(fromHide) { + if (fromHide === void 0) { + fromHide = false; + } + popper.style.pointerEvents = instance.props.interactive && !fromHide ? "" : "none"; + popper.style.zIndex = "" + instance.props.zIndex; + } + function invokeHook(hook, args, shouldInvokePropsHook) { + if (shouldInvokePropsHook === void 0) { + shouldInvokePropsHook = true; + } + pluginsHooks.forEach(function(pluginHooks) { + if (pluginHooks[hook]) { + pluginHooks[hook].apply(pluginHooks, args); + } + }); + if (shouldInvokePropsHook) { + var _instance$props; + (_instance$props = instance.props)[hook].apply(_instance$props, args); + } + } + function handleAriaContentAttribute() { + var aria = instance.props.aria; + if (!aria.content) { + return; + } + var attr = "aria-" + aria.content; + var id2 = popper.id; + var nodes = normalizeToArray(instance.props.triggerTarget || reference); + nodes.forEach(function(node) { + var currentValue = node.getAttribute(attr); + if (instance.state.isVisible) { + node.setAttribute(attr, currentValue ? currentValue + " " + id2 : id2); + } else { + var nextValue = currentValue && currentValue.replace(id2, "").trim(); + if (nextValue) { + node.setAttribute(attr, nextValue); + } else { + node.removeAttribute(attr); + } + } + }); + } + function handleAriaExpandedAttribute() { + if (hasAriaExpanded || !instance.props.aria.expanded) { + return; + } + var nodes = normalizeToArray(instance.props.triggerTarget || reference); + nodes.forEach(function(node) { + if (instance.props.interactive) { + node.setAttribute("aria-expanded", instance.state.isVisible && node === getCurrentTarget() ? "true" : "false"); + } else { + node.removeAttribute("aria-expanded"); + } + }); + } + function cleanupInteractiveMouseListeners() { + getDocument().removeEventListener("mousemove", debouncedOnMouseMove); + mouseMoveListeners = mouseMoveListeners.filter(function(listener) { + return listener !== debouncedOnMouseMove; + }); + } + function onDocumentPress(event) { + if (currentInput.isTouch) { + if (didTouchMove || event.type === "mousedown") { + return; + } + } + var actualTarget = event.composedPath && event.composedPath()[0] || event.target; + if (instance.props.interactive && actualContains(popper, actualTarget)) { + return; + } + if (normalizeToArray(instance.props.triggerTarget || reference).some(function(el) { + return actualContains(el, actualTarget); + })) { + if (currentInput.isTouch) { + return; + } + if (instance.state.isVisible && instance.props.trigger.indexOf("click") >= 0) { + return; + } + } else { + invokeHook("onClickOutside", [instance, event]); + } + if (instance.props.hideOnClick === true) { + instance.clearDelayTimeouts(); + instance.hide(); + didHideDueToDocumentMouseDown = true; + setTimeout(function() { + didHideDueToDocumentMouseDown = false; + }); + if (!instance.state.isMounted) { + removeDocumentPress(); + } + } + } + function onTouchMove() { + didTouchMove = true; + } + function onTouchStart() { + didTouchMove = false; + } + function addDocumentPress() { + var doc = getDocument(); + doc.addEventListener("mousedown", onDocumentPress, true); + doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS); + doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS); + doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS); + } + function removeDocumentPress() { + var doc = getDocument(); + doc.removeEventListener("mousedown", onDocumentPress, true); + doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS); + doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS); + doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS); + } + function onTransitionedOut(duration, callback) { + onTransitionEnd(duration, function() { + if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) { + callback(); + } + }); + } + function onTransitionedIn(duration, callback) { + onTransitionEnd(duration, callback); + } + function onTransitionEnd(duration, callback) { + var box = getDefaultTemplateChildren().box; + function listener(event) { + if (event.target === box) { + updateTransitionEndListener(box, "remove", listener); + callback(); + } + } + if (duration === 0) { + return callback(); + } + updateTransitionEndListener(box, "remove", currentTransitionEndListener); + updateTransitionEndListener(box, "add", listener); + currentTransitionEndListener = listener; + } + function on(eventType, handler, options) { + if (options === void 0) { + options = false; + } + var nodes = normalizeToArray(instance.props.triggerTarget || reference); + nodes.forEach(function(node) { + node.addEventListener(eventType, handler, options); + listeners.push({ + node, + eventType, + handler, + options + }); + }); + } + function addListeners() { + if (getIsCustomTouchBehavior()) { + on("touchstart", onTrigger, { + passive: true + }); + on("touchend", onMouseLeave, { + passive: true + }); + } + splitBySpaces(instance.props.trigger).forEach(function(eventType) { + if (eventType === "manual") { + return; + } + on(eventType, onTrigger); + switch (eventType) { + case "mouseenter": + on("mouseleave", onMouseLeave); + break; + case "focus": + on(isIE11 ? "focusout" : "blur", onBlurOrFocusOut); + break; + case "focusin": + on("focusout", onBlurOrFocusOut); + break; + } + }); + } + function removeListeners() { + listeners.forEach(function(_ref) { + var node = _ref.node, eventType = _ref.eventType, handler = _ref.handler, options = _ref.options; + node.removeEventListener(eventType, handler, options); + }); + listeners = []; + } + function onTrigger(event) { + var _lastTriggerEvent; + var shouldScheduleClickHide = false; + if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) { + return; + } + var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus"; + lastTriggerEvent = event; + currentTarget = event.currentTarget; + handleAriaExpandedAttribute(); + if (!instance.state.isVisible && isMouseEvent(event)) { + mouseMoveListeners.forEach(function(listener) { + return listener(event); + }); + } + if (event.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) { + shouldScheduleClickHide = true; + } else { + scheduleShow(event); + } + if (event.type === "click") { + isVisibleFromClick = !shouldScheduleClickHide; + } + if (shouldScheduleClickHide && !wasFocused) { + scheduleHide(event); + } + } + function onMouseMove(event) { + var target = event.target; + var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target); + if (event.type === "mousemove" && isCursorOverReferenceOrPopper) { + return; + } + var popperTreeData = getNestedPopperTree().concat(popper).map(function(popper2) { + var _instance$popperInsta; + var instance2 = popper2._tippy; + var state2 = (_instance$popperInsta = instance2.popperInstance) == null ? void 0 : _instance$popperInsta.state; + if (state2) { + return { + popperRect: popper2.getBoundingClientRect(), + popperState: state2, + props + }; + } + return null; + }).filter(Boolean); + if (isCursorOutsideInteractiveBorder(popperTreeData, event)) { + cleanupInteractiveMouseListeners(); + scheduleHide(event); + } + } + function onMouseLeave(event) { + var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick; + if (shouldBail) { + return; + } + if (instance.props.interactive) { + instance.hideWithInteractivity(event); + return; + } + scheduleHide(event); + } + function onBlurOrFocusOut(event) { + if (instance.props.trigger.indexOf("focusin") < 0 && event.target !== getCurrentTarget()) { + return; + } + if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) { + return; + } + scheduleHide(event); + } + function isEventListenerStopped(event) { + return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf("touch") >= 0 : false; + } + function createPopperInstance() { + destroyPopperInstance(); + var _instance$props2 = instance.props, popperOptions = _instance$props2.popperOptions, placement = _instance$props2.placement, offset = _instance$props2.offset, getReferenceClientRect = _instance$props2.getReferenceClientRect, moveTransition = _instance$props2.moveTransition; + var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null; + var computedReference = getReferenceClientRect ? { + getBoundingClientRect: getReferenceClientRect, + contextElement: getReferenceClientRect.contextElement || getCurrentTarget() + } : reference; + var tippyModifier = { + name: "$$tippy", + enabled: true, + phase: "beforeWrite", + requires: ["computeStyles"], + fn: function fn(_ref2) { + var state2 = _ref2.state; + if (getIsDefaultRenderFn()) { + var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box; + ["placement", "reference-hidden", "escaped"].forEach(function(attr) { + if (attr === "placement") { + box.setAttribute("data-placement", state2.placement); + } else { + if (state2.attributes.popper["data-popper-" + attr]) { + box.setAttribute("data-" + attr, ""); + } else { + box.removeAttribute("data-" + attr); + } + } + }); + state2.attributes.popper = {}; + } + } + }; + var modifiers = [{ + name: "offset", + options: { + offset + } + }, { + name: "preventOverflow", + options: { + padding: { + top: 2, + bottom: 2, + left: 5, + right: 5 + } + } + }, { + name: "flip", + options: { + padding: 5 + } + }, { + name: "computeStyles", + options: { + adaptive: !moveTransition + } + }, tippyModifier]; + if (getIsDefaultRenderFn() && arrow) { + modifiers.push({ + name: "arrow", + options: { + element: arrow, + padding: 3 + } + }); + } + modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []); + instance.popperInstance = core.createPopper(computedReference, popper, Object.assign({}, popperOptions, { + placement, + onFirstUpdate, + modifiers + })); + } + function destroyPopperInstance() { + if (instance.popperInstance) { + instance.popperInstance.destroy(); + instance.popperInstance = null; + } + } + function mount() { + var appendTo = instance.props.appendTo; + var parentNode; + var node = getCurrentTarget(); + if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === "parent") { + parentNode = node.parentNode; + } else { + parentNode = invokeWithArgsOrReturn(appendTo, [node]); + } + if (!parentNode.contains(popper)) { + parentNode.appendChild(popper); + } + instance.state.isMounted = true; + createPopperInstance(); + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", "\n\n", "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", "\n\n", "Specifying `appendTo: document.body` silences this warning, but it", "assumes you are using a focus management solution to handle", "keyboard navigation.", "\n\n", "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" ")); + } + } + function getNestedPopperTree() { + return arrayFrom(popper.querySelectorAll("[data-tippy-root]")); + } + function scheduleShow(event) { + instance.clearDelayTimeouts(); + if (event) { + invokeHook("onTrigger", [instance, event]); + } + addDocumentPress(); + var delay = getDelay(true); + var _getNormalizedTouchSe = getNormalizedTouchSettings(), touchValue = _getNormalizedTouchSe[0], touchDelay = _getNormalizedTouchSe[1]; + if (currentInput.isTouch && touchValue === "hold" && touchDelay) { + delay = touchDelay; + } + if (delay) { + showTimeout = setTimeout(function() { + instance.show(); + }, delay); + } else { + instance.show(); + } + } + function scheduleHide(event) { + instance.clearDelayTimeouts(); + invokeHook("onUntrigger", [instance, event]); + if (!instance.state.isVisible) { + removeDocumentPress(); + return; + } + if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event.type) >= 0 && isVisibleFromClick) { + return; + } + var delay = getDelay(false); + if (delay) { + hideTimeout = setTimeout(function() { + if (instance.state.isVisible) { + instance.hide(); + } + }, delay); + } else { + scheduleHideAnimationFrame = requestAnimationFrame(function() { + instance.hide(); + }); + } + } + function enable() { + instance.state.isEnabled = true; + } + function disable() { + instance.hide(); + instance.state.isEnabled = false; + } + function clearDelayTimeouts() { + clearTimeout(showTimeout); + clearTimeout(hideTimeout); + cancelAnimationFrame(scheduleHideAnimationFrame); + } + function setProps(partialProps) { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("setProps")); + } + if (instance.state.isDestroyed) { + return; + } + invokeHook("onBeforeUpdate", [instance, partialProps]); + removeListeners(); + var prevProps = instance.props; + var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), { + ignoreAttributes: true + })); + instance.props = nextProps; + addListeners(); + if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) { + cleanupInteractiveMouseListeners(); + debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce); + } + if (prevProps.triggerTarget && !nextProps.triggerTarget) { + normalizeToArray(prevProps.triggerTarget).forEach(function(node) { + node.removeAttribute("aria-expanded"); + }); + } else if (nextProps.triggerTarget) { + reference.removeAttribute("aria-expanded"); + } + handleAriaExpandedAttribute(); + handleStyles(); + if (onUpdate) { + onUpdate(prevProps, nextProps); + } + if (instance.popperInstance) { + createPopperInstance(); + getNestedPopperTree().forEach(function(nestedPopper) { + requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate); + }); + } + invokeHook("onAfterUpdate", [instance, partialProps]); + } + function setContent2(content) { + instance.setProps({ + content + }); + } + function show() { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("show")); + } + var isAlreadyVisible = instance.state.isVisible; + var isDestroyed = instance.state.isDestroyed; + var isDisabled = !instance.state.isEnabled; + var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch; + var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration); + if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) { + return; + } + if (getCurrentTarget().hasAttribute("disabled")) { + return; + } + invokeHook("onShow", [instance], false); + if (instance.props.onShow(instance) === false) { + return; + } + instance.state.isVisible = true; + if (getIsDefaultRenderFn()) { + popper.style.visibility = "visible"; + } + handleStyles(); + addDocumentPress(); + if (!instance.state.isMounted) { + popper.style.transition = "none"; + } + if (getIsDefaultRenderFn()) { + var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content = _getDefaultTemplateCh2.content; + setTransitionDuration([box, content], 0); + } + onFirstUpdate = function onFirstUpdate2() { + var _instance$popperInsta2; + if (!instance.state.isVisible || ignoreOnFirstUpdate) { + return; + } + ignoreOnFirstUpdate = true; + void popper.offsetHeight; + popper.style.transition = instance.props.moveTransition; + if (getIsDefaultRenderFn() && instance.props.animation) { + var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), _box = _getDefaultTemplateCh3.box, _content = _getDefaultTemplateCh3.content; + setTransitionDuration([_box, _content], duration); + setVisibilityState([_box, _content], "visible"); + } + handleAriaContentAttribute(); + handleAriaExpandedAttribute(); + pushIfUnique(mountedInstances, instance); + (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate(); + invokeHook("onMount", [instance]); + if (instance.props.animation && getIsDefaultRenderFn()) { + onTransitionedIn(duration, function() { + instance.state.isShown = true; + invokeHook("onShown", [instance]); + }); + } + }; + mount(); + } + function hide() { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hide")); + } + var isAlreadyHidden = !instance.state.isVisible; + var isDestroyed = instance.state.isDestroyed; + var isDisabled = !instance.state.isEnabled; + var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration); + if (isAlreadyHidden || isDestroyed || isDisabled) { + return; + } + invokeHook("onHide", [instance], false); + if (instance.props.onHide(instance) === false) { + return; + } + instance.state.isVisible = false; + instance.state.isShown = false; + ignoreOnFirstUpdate = false; + isVisibleFromClick = false; + if (getIsDefaultRenderFn()) { + popper.style.visibility = "hidden"; + } + cleanupInteractiveMouseListeners(); + removeDocumentPress(); + handleStyles(true); + if (getIsDefaultRenderFn()) { + var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content = _getDefaultTemplateCh4.content; + if (instance.props.animation) { + setTransitionDuration([box, content], duration); + setVisibilityState([box, content], "hidden"); + } + } + handleAriaContentAttribute(); + handleAriaExpandedAttribute(); + if (instance.props.animation) { + if (getIsDefaultRenderFn()) { + onTransitionedOut(duration, instance.unmount); + } + } else { + instance.unmount(); + } + } + function hideWithInteractivity(event) { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity")); + } + getDocument().addEventListener("mousemove", debouncedOnMouseMove); + pushIfUnique(mouseMoveListeners, debouncedOnMouseMove); + debouncedOnMouseMove(event); + } + function unmount() { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("unmount")); + } + if (instance.state.isVisible) { + instance.hide(); + } + if (!instance.state.isMounted) { + return; + } + destroyPopperInstance(); + getNestedPopperTree().forEach(function(nestedPopper) { + nestedPopper._tippy.unmount(); + }); + if (popper.parentNode) { + popper.parentNode.removeChild(popper); + } + mountedInstances = mountedInstances.filter(function(i2) { + return i2 !== instance; + }); + instance.state.isMounted = false; + invokeHook("onHidden", [instance]); + } + function destroy() { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("destroy")); + } + if (instance.state.isDestroyed) { + return; + } + instance.clearDelayTimeouts(); + instance.unmount(); + removeListeners(); + delete reference._tippy; + instance.state.isDestroyed = true; + invokeHook("onDestroy", [instance]); + } + } + function tippy2(targets, optionalProps) { + if (optionalProps === void 0) { + optionalProps = {}; + } + var plugins = defaultProps.plugins.concat(optionalProps.plugins || []); + if (process.env.NODE_ENV !== "production") { + validateTargets(targets); + validateProps(optionalProps, plugins); + } + bindGlobalEventListeners(); + var passedProps = Object.assign({}, optionalProps, { + plugins + }); + var elements = getArrayOfElements(targets); + if (process.env.NODE_ENV !== "production") { + var isSingleContentElement = isElement(passedProps.content); + var isMoreThanOneReferenceElement = elements.length > 1; + warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", "\n\n", "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", "\n\n", "1) content: element.innerHTML\n", "2) content: () => element.cloneNode(true)"].join(" ")); + } + var instances = elements.reduce(function(acc, reference) { + var instance = reference && createTippy(reference, passedProps); + if (instance) { + acc.push(instance); + } + return acc; + }, []); + return isElement(targets) ? instances[0] : instances; + } + tippy2.defaultProps = defaultProps; + tippy2.setDefaultProps = setDefaultProps; + tippy2.currentInput = currentInput; + var hideAll2 = function hideAll3(_temp) { + var _ref = _temp === void 0 ? {} : _temp, excludedReferenceOrInstance = _ref.exclude, duration = _ref.duration; + mountedInstances.forEach(function(instance) { + var isExcluded = false; + if (excludedReferenceOrInstance) { + isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper; + } + if (!isExcluded) { + var originalDuration = instance.props.duration; + instance.setProps({ + duration + }); + instance.hide(); + if (!instance.state.isDestroyed) { + instance.setProps({ + duration: originalDuration + }); + } + } + }); + }; + var applyStylesModifier = Object.assign({}, core.applyStyles, { + effect: function effect(_ref) { + var state = _ref.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: "0", + top: "0", + margin: "0" + }, + arrow: { + position: "absolute" + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + } + }); + var createSingleton2 = function createSingleton3(tippyInstances, optionalProps) { + var _optionalProps$popper; + if (optionalProps === void 0) { + optionalProps = {}; + } + if (process.env.NODE_ENV !== "production") { + errorWhen(!Array.isArray(tippyInstances), ["The first argument passed to createSingleton() must be an array of", "tippy instances. The passed value was", String(tippyInstances)].join(" ")); + } + var individualInstances = tippyInstances; + var references = []; + var triggerTargets = []; + var currentTarget; + var overrides = optionalProps.overrides; + var interceptSetPropsCleanups = []; + var shownOnCreate = false; + function setTriggerTargets() { + triggerTargets = individualInstances.map(function(instance) { + return normalizeToArray(instance.props.triggerTarget || instance.reference); + }).reduce(function(acc, item) { + return acc.concat(item); + }, []); + } + function setReferences() { + references = individualInstances.map(function(instance) { + return instance.reference; + }); + } + function enableInstances(isEnabled) { + individualInstances.forEach(function(instance) { + if (isEnabled) { + instance.enable(); + } else { + instance.disable(); + } + }); + } + function interceptSetProps(singleton2) { + return individualInstances.map(function(instance) { + var originalSetProps2 = instance.setProps; + instance.setProps = function(props) { + originalSetProps2(props); + if (instance.reference === currentTarget) { + singleton2.setProps(props); + } + }; + return function() { + instance.setProps = originalSetProps2; + }; + }); + } + function prepareInstance(singleton2, target) { + var index = triggerTargets.indexOf(target); + if (target === currentTarget) { + return; + } + currentTarget = target; + var overrideProps = (overrides || []).concat("content").reduce(function(acc, prop) { + acc[prop] = individualInstances[index].props[prop]; + return acc; + }, {}); + singleton2.setProps(Object.assign({}, overrideProps, { + getReferenceClientRect: typeof overrideProps.getReferenceClientRect === "function" ? overrideProps.getReferenceClientRect : function() { + var _references$index; + return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect(); + } + })); + } + enableInstances(false); + setReferences(); + setTriggerTargets(); + var plugin = { + fn: function fn() { + return { + onDestroy: function onDestroy() { + enableInstances(true); + }, + onHidden: function onHidden() { + currentTarget = null; + }, + onClickOutside: function onClickOutside(instance) { + if (instance.props.showOnCreate && !shownOnCreate) { + shownOnCreate = true; + currentTarget = null; + } + }, + onShow: function onShow(instance) { + if (instance.props.showOnCreate && !shownOnCreate) { + shownOnCreate = true; + prepareInstance(instance, references[0]); + } + }, + onTrigger: function onTrigger(instance, event) { + prepareInstance(instance, event.currentTarget); + } + }; + } + }; + var singleton = tippy2(div(), Object.assign({}, removeProperties(optionalProps, ["overrides"]), { + plugins: [plugin].concat(optionalProps.plugins || []), + triggerTarget: triggerTargets, + popperOptions: Object.assign({}, optionalProps.popperOptions, { + modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier]) + }) + })); + var originalShow = singleton.show; + singleton.show = function(target) { + originalShow(); + if (!currentTarget && target == null) { + return prepareInstance(singleton, references[0]); + } + if (currentTarget && target == null) { + return; + } + if (typeof target === "number") { + return references[target] && prepareInstance(singleton, references[target]); + } + if (individualInstances.indexOf(target) >= 0) { + var ref = target.reference; + return prepareInstance(singleton, ref); + } + if (references.indexOf(target) >= 0) { + return prepareInstance(singleton, target); + } + }; + singleton.showNext = function() { + var first = references[0]; + if (!currentTarget) { + return singleton.show(0); + } + var index = references.indexOf(currentTarget); + singleton.show(references[index + 1] || first); + }; + singleton.showPrevious = function() { + var last = references[references.length - 1]; + if (!currentTarget) { + return singleton.show(last); + } + var index = references.indexOf(currentTarget); + var target = references[index - 1] || last; + singleton.show(target); + }; + var originalSetProps = singleton.setProps; + singleton.setProps = function(props) { + overrides = props.overrides || overrides; + originalSetProps(props); + }; + singleton.setInstances = function(nextInstances) { + enableInstances(true); + interceptSetPropsCleanups.forEach(function(fn) { + return fn(); + }); + individualInstances = nextInstances; + enableInstances(false); + setReferences(); + setTriggerTargets(); + interceptSetPropsCleanups = interceptSetProps(singleton); + singleton.setProps({ + triggerTarget: triggerTargets + }); + }; + interceptSetPropsCleanups = interceptSetProps(singleton); + return singleton; + }; + var BUBBLING_EVENTS_MAP = { + mouseover: "mouseenter", + focusin: "focus", + click: "click" + }; + function delegate(targets, props) { + if (process.env.NODE_ENV !== "production") { + errorWhen(!(props && props.target), ["You must specity a `target` prop indicating a CSS selector string matching", "the target elements that should receive a tippy."].join(" ")); + } + var listeners = []; + var childTippyInstances = []; + var disabled = false; + var target = props.target; + var nativeProps = removeProperties(props, ["target"]); + var parentProps = Object.assign({}, nativeProps, { + trigger: "manual", + touch: false + }); + var childProps = Object.assign({ + touch: defaultProps.touch + }, nativeProps, { + showOnCreate: true + }); + var returnValue = tippy2(targets, parentProps); + var normalizedReturnValue = normalizeToArray(returnValue); + function onTrigger(event) { + if (!event.target || disabled) { + return; + } + var targetNode = event.target.closest(target); + if (!targetNode) { + return; + } + var trigger = targetNode.getAttribute("data-tippy-trigger") || props.trigger || defaultProps.trigger; + if (targetNode._tippy) { + return; + } + if (event.type === "touchstart" && typeof childProps.touch === "boolean") { + return; + } + if (event.type !== "touchstart" && trigger.indexOf(BUBBLING_EVENTS_MAP[event.type]) < 0) { + return; + } + var instance = tippy2(targetNode, childProps); + if (instance) { + childTippyInstances = childTippyInstances.concat(instance); + } + } + function on(node, eventType, handler, options) { + if (options === void 0) { + options = false; + } + node.addEventListener(eventType, handler, options); + listeners.push({ + node, + eventType, + handler, + options + }); + } + function addEventListeners(instance) { + var reference = instance.reference; + on(reference, "touchstart", onTrigger, TOUCH_OPTIONS); + on(reference, "mouseover", onTrigger); + on(reference, "focusin", onTrigger); + on(reference, "click", onTrigger); + } + function removeEventListeners() { + listeners.forEach(function(_ref) { + var node = _ref.node, eventType = _ref.eventType, handler = _ref.handler, options = _ref.options; + node.removeEventListener(eventType, handler, options); + }); + listeners = []; + } + function applyMutations(instance) { + var originalDestroy = instance.destroy; + var originalEnable = instance.enable; + var originalDisable = instance.disable; + instance.destroy = function(shouldDestroyChildInstances) { + if (shouldDestroyChildInstances === void 0) { + shouldDestroyChildInstances = true; + } + if (shouldDestroyChildInstances) { + childTippyInstances.forEach(function(instance2) { + instance2.destroy(); + }); + } + childTippyInstances = []; + removeEventListeners(); + originalDestroy(); + }; + instance.enable = function() { + originalEnable(); + childTippyInstances.forEach(function(instance2) { + return instance2.enable(); + }); + disabled = false; + }; + instance.disable = function() { + originalDisable(); + childTippyInstances.forEach(function(instance2) { + return instance2.disable(); + }); + disabled = true; + }; + addEventListeners(instance); + } + normalizedReturnValue.forEach(applyMutations); + return returnValue; + } + var animateFill = { + name: "animateFill", + defaultValue: false, + fn: function fn(instance) { + var _instance$props$rende; + if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) { + if (process.env.NODE_ENV !== "production") { + errorWhen(instance.props.animateFill, "The `animateFill` plugin requires the default render function."); + } + return {}; + } + var _getChildren = getChildren(instance.popper), box = _getChildren.box, content = _getChildren.content; + var backdrop = instance.props.animateFill ? createBackdropElement() : null; + return { + onCreate: function onCreate() { + if (backdrop) { + box.insertBefore(backdrop, box.firstElementChild); + box.setAttribute("data-animatefill", ""); + box.style.overflow = "hidden"; + instance.setProps({ + arrow: false, + animation: "shift-away" + }); + } + }, + onMount: function onMount() { + if (backdrop) { + var transitionDuration = box.style.transitionDuration; + var duration = Number(transitionDuration.replace("ms", "")); + content.style.transitionDelay = Math.round(duration / 10) + "ms"; + backdrop.style.transitionDuration = transitionDuration; + setVisibilityState([backdrop], "visible"); + } + }, + onShow: function onShow() { + if (backdrop) { + backdrop.style.transitionDuration = "0ms"; + } + }, + onHide: function onHide() { + if (backdrop) { + setVisibilityState([backdrop], "hidden"); + } + } + }; + } + }; + function createBackdropElement() { + var backdrop = div(); + backdrop.className = BACKDROP_CLASS; + setVisibilityState([backdrop], "hidden"); + return backdrop; + } + var mouseCoords = { + clientX: 0, + clientY: 0 + }; + var activeInstances = []; + function storeMouseCoords(_ref) { + var clientX = _ref.clientX, clientY = _ref.clientY; + mouseCoords = { + clientX, + clientY + }; + } + function addMouseCoordsListener(doc) { + doc.addEventListener("mousemove", storeMouseCoords); + } + function removeMouseCoordsListener(doc) { + doc.removeEventListener("mousemove", storeMouseCoords); + } + var followCursor2 = { + name: "followCursor", + defaultValue: false, + fn: function fn(instance) { + var reference = instance.reference; + var doc = getOwnerDocument(instance.props.triggerTarget || reference); + var isInternalUpdate = false; + var wasFocusEvent = false; + var isUnmounted = true; + var prevProps = instance.props; + function getIsInitialBehavior() { + return instance.props.followCursor === "initial" && instance.state.isVisible; + } + function addListener() { + doc.addEventListener("mousemove", onMouseMove); + } + function removeListener() { + doc.removeEventListener("mousemove", onMouseMove); + } + function unsetGetReferenceClientRect() { + isInternalUpdate = true; + instance.setProps({ + getReferenceClientRect: null + }); + isInternalUpdate = false; + } + function onMouseMove(event) { + var isCursorOverReference = event.target ? reference.contains(event.target) : true; + var followCursor3 = instance.props.followCursor; + var clientX = event.clientX, clientY = event.clientY; + var rect = reference.getBoundingClientRect(); + var relativeX = clientX - rect.left; + var relativeY = clientY - rect.top; + if (isCursorOverReference || !instance.props.interactive) { + instance.setProps({ + // @ts-ignore - unneeded DOMRect properties + getReferenceClientRect: function getReferenceClientRect() { + var rect2 = reference.getBoundingClientRect(); + var x2 = clientX; + var y2 = clientY; + if (followCursor3 === "initial") { + x2 = rect2.left + relativeX; + y2 = rect2.top + relativeY; + } + var top = followCursor3 === "horizontal" ? rect2.top : y2; + var right = followCursor3 === "vertical" ? rect2.right : x2; + var bottom = followCursor3 === "horizontal" ? rect2.bottom : y2; + var left = followCursor3 === "vertical" ? rect2.left : x2; + return { + width: right - left, + height: bottom - top, + top, + right, + bottom, + left + }; + } + }); + } + } + function create() { + if (instance.props.followCursor) { + activeInstances.push({ + instance, + doc + }); + addMouseCoordsListener(doc); + } + } + function destroy() { + activeInstances = activeInstances.filter(function(data) { + return data.instance !== instance; + }); + if (activeInstances.filter(function(data) { + return data.doc === doc; + }).length === 0) { + removeMouseCoordsListener(doc); + } + } + return { + onCreate: create, + onDestroy: destroy, + onBeforeUpdate: function onBeforeUpdate() { + prevProps = instance.props; + }, + onAfterUpdate: function onAfterUpdate(_2, _ref2) { + var followCursor3 = _ref2.followCursor; + if (isInternalUpdate) { + return; + } + if (followCursor3 !== void 0 && prevProps.followCursor !== followCursor3) { + destroy(); + if (followCursor3) { + create(); + if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) { + addListener(); + } + } else { + removeListener(); + unsetGetReferenceClientRect(); + } + } + }, + onMount: function onMount() { + if (instance.props.followCursor && !wasFocusEvent) { + if (isUnmounted) { + onMouseMove(mouseCoords); + isUnmounted = false; + } + if (!getIsInitialBehavior()) { + addListener(); + } + } + }, + onTrigger: function onTrigger(_2, event) { + if (isMouseEvent(event)) { + mouseCoords = { + clientX: event.clientX, + clientY: event.clientY + }; + } + wasFocusEvent = event.type === "focus"; + }, + onHidden: function onHidden() { + if (instance.props.followCursor) { + unsetGetReferenceClientRect(); + removeListener(); + isUnmounted = true; + } + } + }; + } + }; + function getProps(props, modifier) { + var _props$popperOptions; + return { + popperOptions: Object.assign({}, props.popperOptions, { + modifiers: [].concat((((_props$popperOptions = props.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function(_ref) { + var name = _ref.name; + return name !== modifier.name; + }), [modifier]) + }) + }; + } + var inlinePositioning = { + name: "inlinePositioning", + defaultValue: false, + fn: function fn(instance) { + var reference = instance.reference; + function isEnabled() { + return !!instance.props.inlinePositioning; + } + var placement; + var cursorRectIndex = -1; + var isInternalUpdate = false; + var triedPlacements = []; + var modifier = { + name: "tippyInlinePositioning", + enabled: true, + phase: "afterWrite", + fn: function fn2(_ref2) { + var state = _ref2.state; + if (isEnabled()) { + if (triedPlacements.indexOf(state.placement) !== -1) { + triedPlacements = []; + } + if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) { + triedPlacements.push(state.placement); + instance.setProps({ + // @ts-ignore - unneeded DOMRect properties + getReferenceClientRect: function getReferenceClientRect() { + return _getReferenceClientRect(state.placement); + } + }); + } + placement = state.placement; + } + } + }; + function _getReferenceClientRect(placement2) { + return getInlineBoundingClientRect(getBasePlacement(placement2), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()), cursorRectIndex); + } + function setInternalProps(partialProps) { + isInternalUpdate = true; + instance.setProps(partialProps); + isInternalUpdate = false; + } + function addModifier() { + if (!isInternalUpdate) { + setInternalProps(getProps(instance.props, modifier)); + } + } + return { + onCreate: addModifier, + onAfterUpdate: addModifier, + onTrigger: function onTrigger(_2, event) { + if (isMouseEvent(event)) { + var rects = arrayFrom(instance.reference.getClientRects()); + var cursorRect = rects.find(function(rect) { + return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY; + }); + var index = rects.indexOf(cursorRect); + cursorRectIndex = index > -1 ? index : cursorRectIndex; + } + }, + onHidden: function onHidden() { + cursorRectIndex = -1; + } + }; + } + }; + function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) { + if (clientRects.length < 2 || currentBasePlacement === null) { + return boundingRect; + } + if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) { + return clientRects[cursorRectIndex] || boundingRect; + } + switch (currentBasePlacement) { + case "top": + case "bottom": { + var firstRect = clientRects[0]; + var lastRect = clientRects[clientRects.length - 1]; + var isTop = currentBasePlacement === "top"; + var top = firstRect.top; + var bottom = lastRect.bottom; + var left = isTop ? firstRect.left : lastRect.left; + var right = isTop ? firstRect.right : lastRect.right; + var width = right - left; + var height = bottom - top; + return { + top, + bottom, + left, + right, + width, + height + }; + } + case "left": + case "right": { + var minLeft = Math.min.apply(Math, clientRects.map(function(rects) { + return rects.left; + })); + var maxRight = Math.max.apply(Math, clientRects.map(function(rects) { + return rects.right; + })); + var measureRects = clientRects.filter(function(rect) { + return currentBasePlacement === "left" ? rect.left === minLeft : rect.right === maxRight; + }); + var _top = measureRects[0].top; + var _bottom = measureRects[measureRects.length - 1].bottom; + var _left = minLeft; + var _right = maxRight; + var _width = _right - _left; + var _height = _bottom - _top; + return { + top: _top, + bottom: _bottom, + left: _left, + right: _right, + width: _width, + height: _height + }; + } + default: { + return boundingRect; + } + } + } + var sticky = { + name: "sticky", + defaultValue: false, + fn: function fn(instance) { + var reference = instance.reference, popper = instance.popper; + function getReference() { + return instance.popperInstance ? instance.popperInstance.state.elements.reference : reference; + } + function shouldCheck(value) { + return instance.props.sticky === true || instance.props.sticky === value; + } + var prevRefRect = null; + var prevPopRect = null; + function updatePosition() { + var currentRefRect = shouldCheck("reference") ? getReference().getBoundingClientRect() : null; + var currentPopRect = shouldCheck("popper") ? popper.getBoundingClientRect() : null; + if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) { + if (instance.popperInstance) { + instance.popperInstance.update(); + } + } + prevRefRect = currentRefRect; + prevPopRect = currentPopRect; + if (instance.state.isMounted) { + requestAnimationFrame(updatePosition); + } + } + return { + onMount: function onMount() { + if (instance.props.sticky) { + updatePosition(); + } + } + }; + } + }; + function areRectsDifferent(rectA, rectB) { + if (rectA && rectB) { + return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left; + } + return true; + } + tippy2.setDefaultProps({ + render + }); + exports.animateFill = animateFill; + exports.createSingleton = createSingleton2; + exports.default = tippy2; + exports.delegate = delegate; + exports.followCursor = followCursor2; + exports.hideAll = hideAll2; + exports.inlinePositioning = inlinePositioning; + exports.roundArrow = ROUND_ARROW; + exports.sticky = sticky; + } +}); + +// ../../../node_modules/alpinejs/dist/module.cjs.js +var require_module_cjs = __commonJS({ + "../../../node_modules/alpinejs/dist/module.cjs.js"(exports, module) { + var __create2 = Object.create; + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __getProtoOf2 = Object.getPrototypeOf; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __commonJS2 = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var require_shared_cjs = __commonJS2({ + "node_modules/@vue/shared/dist/shared.cjs.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + function makeMap(str, expectsLowerCase) { + const map = /* @__PURE__ */ Object.create(null); + const list = str.split(","); + for (let i2 = 0; i2 < list.length; i2++) { + map[list[i2]] = true; + } + return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; + } + var PatchFlagNames = { + [ + 1 + /* TEXT */ + ]: `TEXT`, + [ + 2 + /* CLASS */ + ]: `CLASS`, + [ + 4 + /* STYLE */ + ]: `STYLE`, + [ + 8 + /* PROPS */ + ]: `PROPS`, + [ + 16 + /* FULL_PROPS */ + ]: `FULL_PROPS`, + [ + 32 + /* HYDRATE_EVENTS */ + ]: `HYDRATE_EVENTS`, + [ + 64 + /* STABLE_FRAGMENT */ + ]: `STABLE_FRAGMENT`, + [ + 128 + /* KEYED_FRAGMENT */ + ]: `KEYED_FRAGMENT`, + [ + 256 + /* UNKEYED_FRAGMENT */ + ]: `UNKEYED_FRAGMENT`, + [ + 512 + /* NEED_PATCH */ + ]: `NEED_PATCH`, + [ + 1024 + /* DYNAMIC_SLOTS */ + ]: `DYNAMIC_SLOTS`, + [ + 2048 + /* DEV_ROOT_FRAGMENT */ + ]: `DEV_ROOT_FRAGMENT`, + [ + -1 + /* HOISTED */ + ]: `HOISTED`, + [ + -2 + /* BAIL */ + ]: `BAIL` + }; + var slotFlagsText = { + [ + 1 + /* STABLE */ + ]: "STABLE", + [ + 2 + /* DYNAMIC */ + ]: "DYNAMIC", + [ + 3 + /* FORWARDED */ + ]: "FORWARDED" + }; + var GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt"; + var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED); + var range = 2; + function generateCodeFrame(source, start2 = 0, end = source.length) { + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_2, idx) => idx % 2 === 1); + lines = lines.filter((_2, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i2 = 0; i2 < lines.length; i2++) { + count += lines[i2].length + (newlineSequences[i2] && newlineSequences[i2].length || 0); + if (count >= start2) { + for (let j2 = i2 - range; j2 <= i2 + range || end > count; j2++) { + if (j2 < 0 || j2 >= lines.length) + continue; + const line = j2 + 1; + res.push(`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j2]}`); + const lineLength = lines[j2].length; + const newLineSeqLength = newlineSequences[j2] && newlineSequences[j2].length || 0; + if (j2 === i2) { + const pad = start2 - (count - (lineLength + newLineSeqLength)); + const length = Math.max(1, end > count ? lineLength - pad : end - start2); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j2 > i2) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); + } + var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; + var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); + var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`); + var unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; + var attrValidationCache = {}; + function isSSRSafeAttrName(name) { + if (attrValidationCache.hasOwnProperty(name)) { + return attrValidationCache[name]; + } + const isUnsafe = unsafeAttrCharRE.test(name); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name}`); + } + return attrValidationCache[name] = !isUnsafe; + } + var propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" + }; + var isNoUnitNumericStyleProp = /* @__PURE__ */ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width`); + var isKnownAttr = /* @__PURE__ */ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`); + function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i2 = 0; i2 < value.length; i2++) { + const item = value[i2]; + const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isObject2(value)) { + return value; + } + } + var listDelimiterRE = /;(?![^(]*\))/g; + var propertyDelimiterRE = /:(.+)/; + function parseStringStyle(cssText) { + const ret = {}; + cssText.split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; + } + function stringifyStyle(styles) { + let ret = ""; + if (!styles) { + return ret; + } + for (const key in styles) { + const value = styles[key]; + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + if (isString(value) || typeof value === "number" && isNoUnitNumericStyleProp(normalizedKey)) { + ret += `${normalizedKey}:${value};`; + } + } + return ret; + } + function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i2 = 0; i2 < value.length; i2++) { + const normalized = normalizeClass(value[i2]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject2(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); + } + var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; + var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; + var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; + var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); + var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); + var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + var escapeRE = /["'&<>]/; + function escapeHtml(string) { + const str = "" + string; + const match = escapeRE.exec(str); + if (!match) { + return str; + } + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escaped = "&quot;"; + break; + case 38: + escaped = "&amp;"; + break; + case 39: + escaped = "&#39;"; + break; + case 60: + escaped = "&lt;"; + break; + case 62: + escaped = "&gt;"; + break; + default: + continue; + } + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + lastIndex = index + 1; + html += escaped; + } + return lastIndex !== index ? html + str.substring(lastIndex, index) : html; + } + var commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; + function escapeHtmlComment(src) { + return src.replace(commentStripRE, ""); + } + function looseCompareArrays(a2, b2) { + if (a2.length !== b2.length) + return false; + let equal = true; + for (let i2 = 0; equal && i2 < a2.length; i2++) { + equal = looseEqual(a2[i2], b2[i2]); + } + return equal; + } + function looseEqual(a2, b2) { + if (a2 === b2) + return true; + let aValidType = isDate(a2); + let bValidType = isDate(b2); + if (aValidType || bValidType) { + return aValidType && bValidType ? a2.getTime() === b2.getTime() : false; + } + aValidType = isArray(a2); + bValidType = isArray(b2); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a2, b2) : false; + } + aValidType = isObject2(a2); + bValidType = isObject2(b2); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a2).length; + const bKeysCount = Object.keys(b2).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a2) { + const aHasKey = a2.hasOwnProperty(key); + const bHasKey = b2.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a2[key], b2[key])) { + return false; + } + } + } + return String(a2) === String(b2); + } + function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); + } + var toDisplayString = (val) => { + return val == null ? "" : isObject2(val) ? JSON.stringify(val, replacer, 2) : String(val); + }; + var replacer = (_key, val) => { + if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => { + entries[`${key} =>`] = val2; + return entries; + }, {}) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()] + }; + } else if (isObject2(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; + }; + var babelParserDefaultPlugins = [ + "bigInt", + "optionalChaining", + "nullishCoalescingOperator" + ]; + var EMPTY_OBJ = Object.freeze({}); + var EMPTY_ARR = Object.freeze([]); + var NOOP = () => { + }; + var NO = () => false; + var onRE = /^on[^a-z]/; + var isOn = (key) => onRE.test(key); + var isModelListener = (key) => key.startsWith("onUpdate:"); + var extend = Object.assign; + var remove = (arr, el) => { + const i2 = arr.indexOf(el); + if (i2 > -1) { + arr.splice(i2, 1); + } + }; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var hasOwn = (val, key) => hasOwnProperty.call(val, key); + var isArray = Array.isArray; + var isMap = (val) => toTypeString(val) === "[object Map]"; + var isSet = (val) => toTypeString(val) === "[object Set]"; + var isDate = (val) => val instanceof Date; + var isFunction = (val) => typeof val === "function"; + var isString = (val) => typeof val === "string"; + var isSymbol = (val) => typeof val === "symbol"; + var isObject2 = (val) => val !== null && typeof val === "object"; + var isPromise = (val) => { + return isObject2(val) && isFunction(val.then) && isFunction(val.catch); + }; + var objectToString = Object.prototype.toString; + var toTypeString = (value) => objectToString.call(value); + var toRawType = (value) => { + return toTypeString(value).slice(8, -1); + }; + var isPlainObject = (val) => toTypeString(val) === "[object Object]"; + var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; + var isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" + ); + var cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; + }; + var camelizeRE = /-(\w)/g; + var camelize = cacheStringFunction((str) => { + return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : ""); + }); + var hyphenateRE = /\B([A-Z])/g; + var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); + var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1)); + var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``); + var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue); + var invokeArrayFns = (fns, arg) => { + for (let i2 = 0; i2 < fns.length; i2++) { + fns[i2](arg); + } + }; + var def = (obj, key, value) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + value + }); + }; + var toNumber = (val) => { + const n2 = parseFloat(val); + return isNaN(n2) ? val : n2; + }; + var _globalThis; + var getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); + }; + exports2.EMPTY_ARR = EMPTY_ARR; + exports2.EMPTY_OBJ = EMPTY_OBJ; + exports2.NO = NO; + exports2.NOOP = NOOP; + exports2.PatchFlagNames = PatchFlagNames; + exports2.babelParserDefaultPlugins = babelParserDefaultPlugins; + exports2.camelize = camelize; + exports2.capitalize = capitalize; + exports2.def = def; + exports2.escapeHtml = escapeHtml; + exports2.escapeHtmlComment = escapeHtmlComment; + exports2.extend = extend; + exports2.generateCodeFrame = generateCodeFrame; + exports2.getGlobalThis = getGlobalThis; + exports2.hasChanged = hasChanged; + exports2.hasOwn = hasOwn; + exports2.hyphenate = hyphenate; + exports2.invokeArrayFns = invokeArrayFns; + exports2.isArray = isArray; + exports2.isBooleanAttr = isBooleanAttr2; + exports2.isDate = isDate; + exports2.isFunction = isFunction; + exports2.isGloballyWhitelisted = isGloballyWhitelisted; + exports2.isHTMLTag = isHTMLTag; + exports2.isIntegerKey = isIntegerKey; + exports2.isKnownAttr = isKnownAttr; + exports2.isMap = isMap; + exports2.isModelListener = isModelListener; + exports2.isNoUnitNumericStyleProp = isNoUnitNumericStyleProp; + exports2.isObject = isObject2; + exports2.isOn = isOn; + exports2.isPlainObject = isPlainObject; + exports2.isPromise = isPromise; + exports2.isReservedProp = isReservedProp; + exports2.isSSRSafeAttrName = isSSRSafeAttrName; + exports2.isSVGTag = isSVGTag; + exports2.isSet = isSet; + exports2.isSpecialBooleanAttr = isSpecialBooleanAttr; + exports2.isString = isString; + exports2.isSymbol = isSymbol; + exports2.isVoidTag = isVoidTag; + exports2.looseEqual = looseEqual; + exports2.looseIndexOf = looseIndexOf; + exports2.makeMap = makeMap; + exports2.normalizeClass = normalizeClass; + exports2.normalizeStyle = normalizeStyle; + exports2.objectToString = objectToString; + exports2.parseStringStyle = parseStringStyle; + exports2.propsToAttrMap = propsToAttrMap; + exports2.remove = remove; + exports2.slotFlagsText = slotFlagsText; + exports2.stringifyStyle = stringifyStyle; + exports2.toDisplayString = toDisplayString; + exports2.toHandlerKey = toHandlerKey; + exports2.toNumber = toNumber; + exports2.toRawType = toRawType; + exports2.toTypeString = toTypeString; + } + }); + var require_shared = __commonJS2({ + "node_modules/@vue/shared/index.js"(exports2, module2) { + "use strict"; + if (false) { + module2.exports = null; + } else { + module2.exports = require_shared_cjs(); + } + } + }); + var require_reactivity_cjs = __commonJS2({ + "node_modules/@vue/reactivity/dist/reactivity.cjs.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var shared = require_shared(); + var targetMap = /* @__PURE__ */ new WeakMap(); + var effectStack = []; + var activeEffect; + var ITERATE_KEY = Symbol("iterate"); + var MAP_KEY_ITERATE_KEY = Symbol("Map key iterate"); + function isEffect(fn) { + return fn && fn._isEffect === true; + } + function effect3(fn, options = shared.EMPTY_OBJ) { + if (isEffect(fn)) { + fn = fn.raw; + } + const effect4 = createReactiveEffect(fn, options); + if (!options.lazy) { + effect4(); + } + return effect4; + } + function stop2(effect4) { + if (effect4.active) { + cleanup(effect4); + if (effect4.options.onStop) { + effect4.options.onStop(); + } + effect4.active = false; + } + } + var uid = 0; + function createReactiveEffect(fn, options) { + const effect4 = function reactiveEffect() { + if (!effect4.active) { + return fn(); + } + if (!effectStack.includes(effect4)) { + cleanup(effect4); + try { + enableTracking(); + effectStack.push(effect4); + activeEffect = effect4; + return fn(); + } finally { + effectStack.pop(); + resetTracking(); + activeEffect = effectStack[effectStack.length - 1]; + } + } + }; + effect4.id = uid++; + effect4.allowRecurse = !!options.allowRecurse; + effect4._isEffect = true; + effect4.active = true; + effect4.raw = fn; + effect4.deps = []; + effect4.options = options; + return effect4; + } + function cleanup(effect4) { + const { deps } = effect4; + if (deps.length) { + for (let i2 = 0; i2 < deps.length; i2++) { + deps[i2].delete(effect4); + } + deps.length = 0; + } + } + var shouldTrack = true; + var trackStack = []; + function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; + } + function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; + } + function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; + } + function track(target, type, key) { + if (!shouldTrack || activeEffect === void 0) { + return; + } + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = /* @__PURE__ */ new Set()); + } + if (!dep.has(activeEffect)) { + dep.add(activeEffect); + activeEffect.deps.push(dep); + if (activeEffect.options.onTrack) { + activeEffect.options.onTrack({ + effect: activeEffect, + target, + type, + key + }); + } + } + } + function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + return; + } + const effects = /* @__PURE__ */ new Set(); + const add2 = (effectsToAdd) => { + if (effectsToAdd) { + effectsToAdd.forEach((effect4) => { + if (effect4 !== activeEffect || effect4.allowRecurse) { + effects.add(effect4); + } + }); + } + }; + if (type === "clear") { + depsMap.forEach(add2); + } else if (key === "length" && shared.isArray(target)) { + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 >= newValue) { + add2(dep); + } + }); + } else { + if (key !== void 0) { + add2(depsMap.get(key)); + } + switch (type) { + case "add": + if (!shared.isArray(target)) { + add2(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + add2(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (shared.isIntegerKey(key)) { + add2(depsMap.get("length")); + } + break; + case "delete": + if (!shared.isArray(target)) { + add2(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + add2(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (shared.isMap(target)) { + add2(depsMap.get(ITERATE_KEY)); + } + break; + } + } + const run = (effect4) => { + if (effect4.options.onTrigger) { + effect4.options.onTrigger({ + effect: effect4, + target, + key, + type, + newValue, + oldValue, + oldTarget + }); + } + if (effect4.options.scheduler) { + effect4.options.scheduler(effect4); + } else { + effect4(); + } + }; + effects.forEach(run); + } + var isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`); + var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(shared.isSymbol)); + var get2 = /* @__PURE__ */ createGetter(); + var shallowGet = /* @__PURE__ */ createGetter(false, true); + var readonlyGet = /* @__PURE__ */ createGetter(true); + var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true); + var arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); + function createArrayInstrumentations() { + const instrumentations = {}; + ["includes", "indexOf", "lastIndexOf"].forEach((key) => { + instrumentations[key] = function(...args) { + const arr = toRaw2(this); + for (let i2 = 0, l2 = this.length; i2 < l2; i2++) { + track(arr, "get", i2 + ""); + } + const res = arr[key](...args); + if (res === -1 || res === false) { + return arr[key](...args.map(toRaw2)); + } else { + return res; + } + }; + }); + ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { + instrumentations[key] = function(...args) { + pauseTracking(); + const res = toRaw2(this)[key].apply(this, args); + resetTracking(); + return res; + }; + }); + return instrumentations; + } + function createGetter(isReadonly2 = false, shallow = false) { + return function get3(target, key, receiver) { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { + return target; + } + const targetIsArray = shared.isArray(target); + if (!isReadonly2 && targetIsArray && shared.hasOwn(arrayInstrumentations, key)) { + return Reflect.get(arrayInstrumentations, key, receiver); + } + const res = Reflect.get(target, key, receiver); + if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (shallow) { + return res; + } + if (isRef(res)) { + const shouldUnwrap = !targetIsArray || !shared.isIntegerKey(key); + return shouldUnwrap ? res.value : res; + } + if (shared.isObject(res)) { + return isReadonly2 ? readonly(res) : reactive3(res); + } + return res; + }; + } + var set2 = /* @__PURE__ */ createSetter(); + var shallowSet = /* @__PURE__ */ createSetter(true); + function createSetter(shallow = false) { + return function set3(target, key, value, receiver) { + let oldValue = target[key]; + if (!shallow) { + value = toRaw2(value); + oldValue = toRaw2(oldValue); + if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } + } + const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key); + const result = Reflect.set(target, key, value, receiver); + if (target === toRaw2(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + }; + } + function deleteProperty(target, key) { + const hadKey = shared.hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + function has(target, key) { + const result = Reflect.has(target, key); + if (!shared.isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + function ownKeys(target) { + track(target, "iterate", shared.isArray(target) ? "length" : ITERATE_KEY); + return Reflect.ownKeys(target); + } + var mutableHandlers = { + get: get2, + set: set2, + deleteProperty, + has, + ownKeys + }; + var readonlyHandlers = { + get: readonlyGet, + set(target, key) { + { + console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target); + } + return true; + }, + deleteProperty(target, key) { + { + console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target); + } + return true; + } + }; + var shallowReactiveHandlers = /* @__PURE__ */ shared.extend({}, mutableHandlers, { + get: shallowGet, + set: shallowSet + }); + var shallowReadonlyHandlers = /* @__PURE__ */ shared.extend({}, readonlyHandlers, { + get: shallowReadonlyGet + }); + var toReactive = (value) => shared.isObject(value) ? reactive3(value) : value; + var toReadonly = (value) => shared.isObject(value) ? readonly(value) : value; + var toShallow = (value) => value; + var getProto = (v2) => Reflect.getPrototypeOf(v2); + function get$1(target, key, isReadonly2 = false, isShallow = false) { + target = target[ + "__v_raw" + /* RAW */ + ]; + const rawTarget = toRaw2(target); + const rawKey = toRaw2(key); + if (key !== rawKey) { + !isReadonly2 && track(rawTarget, "get", key); + } + !isReadonly2 && track(rawTarget, "get", rawKey); + const { has: has2 } = getProto(rawTarget); + const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive; + if (has2.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has2.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + } + function has$1(key, isReadonly2 = false) { + const target = this[ + "__v_raw" + /* RAW */ + ]; + const rawTarget = toRaw2(target); + const rawKey = toRaw2(key); + if (key !== rawKey) { + !isReadonly2 && track(rawTarget, "has", key); + } + !isReadonly2 && track(rawTarget, "has", rawKey); + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + } + function size(target, isReadonly2 = false) { + target = target[ + "__v_raw" + /* RAW */ + ]; + !isReadonly2 && track(toRaw2(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + } + function add(value) { + value = toRaw2(value); + const target = toRaw2(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; + } + function set$1(key, value) { + value = toRaw2(value); + const target = toRaw2(this); + const { has: has2, get: get3 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw2(key); + hadKey = has2.call(target, key); + } else { + checkIdentityKeys(target, has2, key); + } + const oldValue = get3.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; + } + function deleteEntry(key) { + const target = toRaw2(this); + const { has: has2, get: get3 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw2(key); + hadKey = has2.call(target, key); + } else { + checkIdentityKeys(target, has2, key); + } + const oldValue = get3 ? get3.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + function clear() { + const target = toRaw2(this); + const hadItems = target.size !== 0; + const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target); + const result = target.clear(); + if (hadItems) { + trigger(target, "clear", void 0, void 0, oldTarget); + } + return result; + } + function createForEach(isReadonly2, isShallow) { + return function forEach(callback, thisArg) { + const observed = this; + const target = observed[ + "__v_raw" + /* RAW */ + ]; + const rawTarget = toRaw2(target); + const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + }; + } + function createIterableMethod(method, isReadonly2, isShallow) { + return function(...args) { + const target = this[ + "__v_raw" + /* RAW */ + ]; + const rawTarget = toRaw2(target); + const targetIsMap = shared.isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; + } + function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + console.warn(`${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw2(this)); + } + return type === "delete" ? false : this; + }; + } + function createInstrumentations() { + const mutableInstrumentations2 = { + get(key) { + return get$1(this, key); + }, + get size() { + return size(this); + }, + has: has$1, + add, + set: set$1, + delete: deleteEntry, + clear, + forEach: createForEach(false, false) + }; + const shallowInstrumentations2 = { + get(key) { + return get$1(this, key, false, true); + }, + get size() { + return size(this); + }, + has: has$1, + add, + set: set$1, + delete: deleteEntry, + clear, + forEach: createForEach(false, true) + }; + const readonlyInstrumentations2 = { + get(key) { + return get$1(this, key, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has$1.call(this, key, true); + }, + add: createReadonlyMethod( + "add" + /* ADD */ + ), + set: createReadonlyMethod( + "set" + /* SET */ + ), + delete: createReadonlyMethod( + "delete" + /* DELETE */ + ), + clear: createReadonlyMethod( + "clear" + /* CLEAR */ + ), + forEach: createForEach(true, false) + }; + const shallowReadonlyInstrumentations2 = { + get(key) { + return get$1(this, key, true, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has$1.call(this, key, true); + }, + add: createReadonlyMethod( + "add" + /* ADD */ + ), + set: createReadonlyMethod( + "set" + /* SET */ + ), + delete: createReadonlyMethod( + "delete" + /* DELETE */ + ), + clear: createReadonlyMethod( + "clear" + /* CLEAR */ + ), + forEach: createForEach(true, true) + }; + const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; + iteratorMethods.forEach((method) => { + mutableInstrumentations2[method] = createIterableMethod(method, false, false); + readonlyInstrumentations2[method] = createIterableMethod(method, true, false); + shallowInstrumentations2[method] = createIterableMethod(method, false, true); + shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true); + }); + return [ + mutableInstrumentations2, + readonlyInstrumentations2, + shallowInstrumentations2, + shallowReadonlyInstrumentations2 + ]; + } + var [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations(); + function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations; + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get(shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); + }; + } + var mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) + }; + var shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) + }; + var readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) + }; + var shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) + }; + function checkIdentityKeys(target, has2, key) { + const rawKey = toRaw2(key); + if (rawKey !== key && has2.call(target, rawKey)) { + const type = shared.toRawType(target); + console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`); + } + } + var reactiveMap = /* @__PURE__ */ new WeakMap(); + var shallowReactiveMap = /* @__PURE__ */ new WeakMap(); + var readonlyMap = /* @__PURE__ */ new WeakMap(); + var shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); + function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2; + default: + return 0; + } + } + function getTargetType(value) { + return value[ + "__v_skip" + /* SKIP */ + ] || !Object.isExtensible(value) ? 0 : targetTypeMap(shared.toRawType(value)); + } + function reactive3(target) { + if (target && target[ + "__v_isReadonly" + /* IS_READONLY */ + ]) { + return target; + } + return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); + } + function shallowReactive(target) { + return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap); + } + function readonly(target) { + return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); + } + function shallowReadonly(target) { + return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap); + } + function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!shared.isObject(target)) { + { + console.warn(`value cannot be made reactive: ${String(target)}`); + } + return target; + } + if (target[ + "__v_raw" + /* RAW */ + ] && !(isReadonly2 && target[ + "__v_isReactive" + /* IS_REACTIVE */ + ])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0) { + return target; + } + const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers); + proxyMap.set(target, proxy); + return proxy; + } + function isReactive2(value) { + if (isReadonly(value)) { + return isReactive2(value[ + "__v_raw" + /* RAW */ + ]); + } + return !!(value && value[ + "__v_isReactive" + /* IS_REACTIVE */ + ]); + } + function isReadonly(value) { + return !!(value && value[ + "__v_isReadonly" + /* IS_READONLY */ + ]); + } + function isProxy(value) { + return isReactive2(value) || isReadonly(value); + } + function toRaw2(observed) { + return observed && toRaw2(observed[ + "__v_raw" + /* RAW */ + ]) || observed; + } + function markRaw(value) { + shared.def(value, "__v_skip", true); + return value; + } + var convert = (val) => shared.isObject(val) ? reactive3(val) : val; + function isRef(r2) { + return Boolean(r2 && r2.__v_isRef === true); + } + function ref(value) { + return createRef(value); + } + function shallowRef(value) { + return createRef(value, true); + } + var RefImpl = class { + constructor(value, _shallow = false) { + this._shallow = _shallow; + this.__v_isRef = true; + this._rawValue = _shallow ? value : toRaw2(value); + this._value = _shallow ? value : convert(value); + } + get value() { + track(toRaw2(this), "get", "value"); + return this._value; + } + set value(newVal) { + newVal = this._shallow ? newVal : toRaw2(newVal); + if (shared.hasChanged(newVal, this._rawValue)) { + this._rawValue = newVal; + this._value = this._shallow ? newVal : convert(newVal); + trigger(toRaw2(this), "set", "value", newVal); + } + } + }; + function createRef(rawValue, shallow = false) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); + } + function triggerRef(ref2) { + trigger(toRaw2(ref2), "set", "value", ref2.value); + } + function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; + } + var shallowUnwrapHandlers = { + get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } + }; + function proxyRefs(objectWithRefs) { + return isReactive2(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); + } + var CustomRefImpl = class { + constructor(factory) { + this.__v_isRef = true; + const { get: get3, set: set3 } = factory(() => track(this, "get", "value"), () => trigger(this, "set", "value")); + this._get = get3; + this._set = set3; + } + get value() { + return this._get(); + } + set value(newVal) { + this._set(newVal); + } + }; + function customRef(factory) { + return new CustomRefImpl(factory); + } + function toRefs(object) { + if (!isProxy(object)) { + console.warn(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = shared.isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = toRef(object, key); + } + return ret; + } + var ObjectRefImpl = class { + constructor(_object, _key) { + this._object = _object; + this._key = _key; + this.__v_isRef = true; + } + get value() { + return this._object[this._key]; + } + set value(newVal) { + this._object[this._key] = newVal; + } + }; + function toRef(object, key) { + return isRef(object[key]) ? object[key] : new ObjectRefImpl(object, key); + } + var ComputedRefImpl = class { + constructor(getter, _setter, isReadonly2) { + this._setter = _setter; + this._dirty = true; + this.__v_isRef = true; + this.effect = effect3(getter, { + lazy: true, + scheduler: () => { + if (!this._dirty) { + this._dirty = true; + trigger(toRaw2(this), "set", "value"); + } + } + }); + this[ + "__v_isReadonly" + /* IS_READONLY */ + ] = isReadonly2; + } + get value() { + const self2 = toRaw2(this); + if (self2._dirty) { + self2._value = this.effect(); + self2._dirty = false; + } + track(self2, "get", "value"); + return self2._value; + } + set value(newValue) { + this._setter(newValue); + } + }; + function computed(getterOrOptions) { + let getter; + let setter; + if (shared.isFunction(getterOrOptions)) { + getter = getterOrOptions; + setter = () => { + console.warn("Write operation failed: computed value is readonly"); + }; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + return new ComputedRefImpl(getter, setter, shared.isFunction(getterOrOptions) || !getterOrOptions.set); + } + exports2.ITERATE_KEY = ITERATE_KEY; + exports2.computed = computed; + exports2.customRef = customRef; + exports2.effect = effect3; + exports2.enableTracking = enableTracking; + exports2.isProxy = isProxy; + exports2.isReactive = isReactive2; + exports2.isReadonly = isReadonly; + exports2.isRef = isRef; + exports2.markRaw = markRaw; + exports2.pauseTracking = pauseTracking; + exports2.proxyRefs = proxyRefs; + exports2.reactive = reactive3; + exports2.readonly = readonly; + exports2.ref = ref; + exports2.resetTracking = resetTracking; + exports2.shallowReactive = shallowReactive; + exports2.shallowReadonly = shallowReadonly; + exports2.shallowRef = shallowRef; + exports2.stop = stop2; + exports2.toRaw = toRaw2; + exports2.toRef = toRef; + exports2.toRefs = toRefs; + exports2.track = track; + exports2.trigger = trigger; + exports2.triggerRef = triggerRef; + exports2.unref = unref; + } + }); + var require_reactivity = __commonJS2({ + "node_modules/@vue/reactivity/index.js"(exports2, module2) { + "use strict"; + if (false) { + module2.exports = null; + } else { + module2.exports = require_reactivity_cjs(); + } + } + }); + var module_exports = {}; + __export2(module_exports, { + Alpine: () => src_default, + default: () => module_default + }); + module.exports = __toCommonJS(module_exports); + var flushPending = false; + var flushing = false; + var queue = []; + var lastFlushedIndex = -1; + function scheduler(callback) { + queueJob(callback); + } + function queueJob(job) { + if (!queue.includes(job)) + queue.push(job); + queueFlush(); + } + function dequeueJob(job) { + let index = queue.indexOf(job); + if (index !== -1 && index > lastFlushedIndex) + queue.splice(index, 1); + } + function queueFlush() { + if (!flushing && !flushPending) { + flushPending = true; + queueMicrotask(flushJobs); + } + } + function flushJobs() { + flushPending = false; + flushing = true; + for (let i2 = 0; i2 < queue.length; i2++) { + queue[i2](); + lastFlushedIndex = i2; + } + queue.length = 0; + lastFlushedIndex = -1; + flushing = false; + } + var reactive; + var effect; + var release; + var raw; + var shouldSchedule = true; + function disableEffectScheduling(callback) { + shouldSchedule = false; + callback(); + shouldSchedule = true; + } + function setReactivityEngine(engine) { + reactive = engine.reactive; + release = engine.release; + effect = (callback) => engine.effect(callback, { scheduler: (task) => { + if (shouldSchedule) { + scheduler(task); + } else { + task(); + } + } }); + raw = engine.raw; + } + function overrideEffect(override) { + effect = override; + } + function elementBoundEffect(el) { + let cleanup = () => { + }; + let wrappedEffect = (callback) => { + let effectReference = effect(callback); + if (!el._x_effects) { + el._x_effects = /* @__PURE__ */ new Set(); + el._x_runEffects = () => { + el._x_effects.forEach((i2) => i2()); + }; + } + el._x_effects.add(effectReference); + cleanup = () => { + if (effectReference === void 0) + return; + el._x_effects.delete(effectReference); + release(effectReference); + }; + return effectReference; + }; + return [wrappedEffect, () => { + cleanup(); + }]; + } + function watch(getter, callback) { + let firstTime = true; + let oldValue; + let effectReference = effect(() => { + let value = getter(); + JSON.stringify(value); + if (!firstTime) { + queueMicrotask(() => { + callback(value, oldValue); + oldValue = value; + }); + } else { + oldValue = value; + } + firstTime = false; + }); + return () => release(effectReference); + } + function dispatch(el, name, detail = {}) { + el.dispatchEvent( + new CustomEvent(name, { + detail, + bubbles: true, + // Allows events to pass the shadow DOM barrier. + composed: true, + cancelable: true + }) + ); + } + function walk(el, callback) { + if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) { + Array.from(el.children).forEach((el2) => walk(el2, callback)); + return; + } + let skip = false; + callback(el, () => skip = true); + if (skip) + return; + let node = el.firstElementChild; + while (node) { + walk(node, callback, false); + node = node.nextElementSibling; + } + } + function warn(message, ...args) { + console.warn(`Alpine Warning: ${message}`, ...args); + } + var started = false; + function start() { + if (started) + warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."); + started = true; + if (!document.body) + warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"); + dispatch(document, "alpine:init"); + dispatch(document, "alpine:initializing"); + startObservingMutations(); + onElAdded((el) => initTree(el, walk)); + onElRemoved((el) => destroyTree(el)); + onAttributesAdded((el, attrs) => { + directives(el, attrs).forEach((handle) => handle()); + }); + let outNestedComponents = (el) => !closestRoot(el.parentElement, true); + Array.from(document.querySelectorAll(allSelectors().join(","))).filter(outNestedComponents).forEach((el) => { + initTree(el); + }); + dispatch(document, "alpine:initialized"); + } + var rootSelectorCallbacks = []; + var initSelectorCallbacks = []; + function rootSelectors() { + return rootSelectorCallbacks.map((fn) => fn()); + } + function allSelectors() { + return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn()); + } + function addRootSelector(selectorCallback) { + rootSelectorCallbacks.push(selectorCallback); + } + function addInitSelector(selectorCallback) { + initSelectorCallbacks.push(selectorCallback); + } + function closestRoot(el, includeInitSelectors = false) { + return findClosest(el, (element) => { + const selectors = includeInitSelectors ? allSelectors() : rootSelectors(); + if (selectors.some((selector) => element.matches(selector))) + return true; + }); + } + function findClosest(el, callback) { + if (!el) + return; + if (callback(el)) + return el; + if (el._x_teleportBack) + el = el._x_teleportBack; + if (!el.parentElement) + return; + return findClosest(el.parentElement, callback); + } + function isRoot(el) { + return rootSelectors().some((selector) => el.matches(selector)); + } + var initInterceptors = []; + function interceptInit(callback) { + initInterceptors.push(callback); + } + function initTree(el, walker = walk, intercept = () => { + }) { + deferHandlingDirectives(() => { + walker(el, (el2, skip) => { + intercept(el2, skip); + initInterceptors.forEach((i2) => i2(el2, skip)); + directives(el2, el2.attributes).forEach((handle) => handle()); + el2._x_ignore && skip(); + }); + }); + } + function destroyTree(root, walker = walk) { + walker(root, (el) => { + cleanupAttributes(el); + cleanupElement(el); + }); + } + var onAttributeAddeds = []; + var onElRemoveds = []; + var onElAddeds = []; + function onElAdded(callback) { + onElAddeds.push(callback); + } + function onElRemoved(el, callback) { + if (typeof callback === "function") { + if (!el._x_cleanups) + el._x_cleanups = []; + el._x_cleanups.push(callback); + } else { + callback = el; + onElRemoveds.push(callback); + } + } + function onAttributesAdded(callback) { + onAttributeAddeds.push(callback); + } + function onAttributeRemoved(el, name, callback) { + if (!el._x_attributeCleanups) + el._x_attributeCleanups = {}; + if (!el._x_attributeCleanups[name]) + el._x_attributeCleanups[name] = []; + el._x_attributeCleanups[name].push(callback); + } + function cleanupAttributes(el, names) { + if (!el._x_attributeCleanups) + return; + Object.entries(el._x_attributeCleanups).forEach(([name, value]) => { + if (names === void 0 || names.includes(name)) { + value.forEach((i2) => i2()); + delete el._x_attributeCleanups[name]; + } + }); + } + function cleanupElement(el) { + if (el._x_cleanups) { + while (el._x_cleanups.length) + el._x_cleanups.pop()(); + } + } + var observer = new MutationObserver(onMutate); + var currentlyObserving = false; + function startObservingMutations() { + observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true }); + currentlyObserving = true; + } + function stopObservingMutations() { + flushObserver(); + observer.disconnect(); + currentlyObserving = false; + } + var queuedMutations = []; + function flushObserver() { + let records = observer.takeRecords(); + queuedMutations.push(() => records.length > 0 && onMutate(records)); + let queueLengthWhenTriggered = queuedMutations.length; + queueMicrotask(() => { + if (queuedMutations.length === queueLengthWhenTriggered) { + while (queuedMutations.length > 0) + queuedMutations.shift()(); + } + }); + } + function mutateDom(callback) { + if (!currentlyObserving) + return callback(); + stopObservingMutations(); + let result = callback(); + startObservingMutations(); + return result; + } + var isCollecting = false; + var deferredMutations = []; + function deferMutations() { + isCollecting = true; + } + function flushAndStopDeferringMutations() { + isCollecting = false; + onMutate(deferredMutations); + deferredMutations = []; + } + function onMutate(mutations) { + if (isCollecting) { + deferredMutations = deferredMutations.concat(mutations); + return; + } + let addedNodes = /* @__PURE__ */ new Set(); + let removedNodes = /* @__PURE__ */ new Set(); + let addedAttributes = /* @__PURE__ */ new Map(); + let removedAttributes = /* @__PURE__ */ new Map(); + for (let i2 = 0; i2 < mutations.length; i2++) { + if (mutations[i2].target._x_ignoreMutationObserver) + continue; + if (mutations[i2].type === "childList") { + mutations[i2].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.add(node)); + mutations[i2].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.add(node)); + } + if (mutations[i2].type === "attributes") { + let el = mutations[i2].target; + let name = mutations[i2].attributeName; + let oldValue = mutations[i2].oldValue; + let add = () => { + if (!addedAttributes.has(el)) + addedAttributes.set(el, []); + addedAttributes.get(el).push({ name, value: el.getAttribute(name) }); + }; + let remove = () => { + if (!removedAttributes.has(el)) + removedAttributes.set(el, []); + removedAttributes.get(el).push(name); + }; + if (el.hasAttribute(name) && oldValue === null) { + add(); + } else if (el.hasAttribute(name)) { + remove(); + add(); + } else { + remove(); + } + } + } + removedAttributes.forEach((attrs, el) => { + cleanupAttributes(el, attrs); + }); + addedAttributes.forEach((attrs, el) => { + onAttributeAddeds.forEach((i2) => i2(el, attrs)); + }); + for (let node of removedNodes) { + if (addedNodes.has(node)) + continue; + onElRemoveds.forEach((i2) => i2(node)); + destroyTree(node); + } + addedNodes.forEach((node) => { + node._x_ignoreSelf = true; + node._x_ignore = true; + }); + for (let node of addedNodes) { + if (removedNodes.has(node)) + continue; + if (!node.isConnected) + continue; + delete node._x_ignoreSelf; + delete node._x_ignore; + onElAddeds.forEach((i2) => i2(node)); + node._x_ignore = true; + node._x_ignoreSelf = true; + } + addedNodes.forEach((node) => { + delete node._x_ignoreSelf; + delete node._x_ignore; + }); + addedNodes = null; + removedNodes = null; + addedAttributes = null; + removedAttributes = null; + } + function scope(node) { + return mergeProxies(closestDataStack(node)); + } + function addScopeToNode(node, data2, referenceNode) { + node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)]; + return () => { + node._x_dataStack = node._x_dataStack.filter((i2) => i2 !== data2); + }; + } + function closestDataStack(node) { + if (node._x_dataStack) + return node._x_dataStack; + if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) { + return closestDataStack(node.host); + } + if (!node.parentNode) { + return []; + } + return closestDataStack(node.parentNode); + } + function mergeProxies(objects) { + return new Proxy({ objects }, mergeProxyTrap); + } + var mergeProxyTrap = { + ownKeys({ objects }) { + return Array.from( + new Set(objects.flatMap((i2) => Object.keys(i2))) + ); + }, + has({ objects }, name) { + if (name == Symbol.unscopables) + return false; + return objects.some( + (obj) => Object.prototype.hasOwnProperty.call(obj, name) || Reflect.has(obj, name) + ); + }, + get({ objects }, name, thisProxy) { + if (name == "toJSON") + return collapseProxies; + return Reflect.get( + objects.find( + (obj) => Reflect.has(obj, name) + ) || {}, + name, + thisProxy + ); + }, + set({ objects }, name, value, thisProxy) { + const target = objects.find( + (obj) => Object.prototype.hasOwnProperty.call(obj, name) + ) || objects[objects.length - 1]; + const descriptor = Object.getOwnPropertyDescriptor(target, name); + if ((descriptor == null ? void 0 : descriptor.set) && (descriptor == null ? void 0 : descriptor.get)) + return Reflect.set(target, name, value, thisProxy); + return Reflect.set(target, name, value); + } + }; + function collapseProxies() { + let keys = Reflect.ownKeys(this); + return keys.reduce((acc, key) => { + acc[key] = Reflect.get(this, key); + return acc; + }, {}); + } + function initInterceptors2(data2) { + let isObject2 = (val) => typeof val === "object" && !Array.isArray(val) && val !== null; + let recurse = (obj, basePath = "") => { + Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => { + if (enumerable === false || value === void 0) + return; + if (typeof value === "object" && value !== null && value.__v_skip) + return; + let path = basePath === "" ? key : `${basePath}.${key}`; + if (typeof value === "object" && value !== null && value._x_interceptor) { + obj[key] = value.initialize(data2, path, key); + } else { + if (isObject2(value) && value !== obj && !(value instanceof Element)) { + recurse(value, path); + } + } + }); + }; + return recurse(data2); + } + function interceptor(callback, mutateObj = () => { + }) { + let obj = { + initialValue: void 0, + _x_interceptor: true, + initialize(data2, path, key) { + return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key); + } + }; + mutateObj(obj); + return (initialValue) => { + if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) { + let initialize = obj.initialize.bind(obj); + obj.initialize = (data2, path, key) => { + let innerValue = initialValue.initialize(data2, path, key); + obj.initialValue = innerValue; + return initialize(data2, path, key); + }; + } else { + obj.initialValue = initialValue; + } + return obj; + }; + } + function get(obj, path) { + return path.split(".").reduce((carry, segment) => carry[segment], obj); + } + function set(obj, path, value) { + if (typeof path === "string") + path = path.split("."); + if (path.length === 1) + obj[path[0]] = value; + else if (path.length === 0) + throw error; + else { + if (obj[path[0]]) + return set(obj[path[0]], path.slice(1), value); + else { + obj[path[0]] = {}; + return set(obj[path[0]], path.slice(1), value); + } + } + } + var magics = {}; + function magic(name, callback) { + magics[name] = callback; + } + function injectMagics(obj, el) { + Object.entries(magics).forEach(([name, callback]) => { + let memoizedUtilities = null; + function getUtilities() { + if (memoizedUtilities) { + return memoizedUtilities; + } else { + let [utilities, cleanup] = getElementBoundUtilities(el); + memoizedUtilities = { interceptor, ...utilities }; + onElRemoved(el, cleanup); + return memoizedUtilities; + } + } + Object.defineProperty(obj, `$${name}`, { + get() { + return callback(el, getUtilities()); + }, + enumerable: false + }); + }); + return obj; + } + function tryCatch(el, expression, callback, ...args) { + try { + return callback(...args); + } catch (e2) { + handleError(e2, el, expression); + } + } + function handleError(error2, el, expression = void 0) { + error2 = Object.assign( + error2 != null ? error2 : { message: "No error message given." }, + { el, expression } + ); + console.warn(`Alpine Expression Error: ${error2.message} + +${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); + setTimeout(() => { + throw error2; + }, 0); + } + var shouldAutoEvaluateFunctions = true; + function dontAutoEvaluateFunctions(callback) { + let cache = shouldAutoEvaluateFunctions; + shouldAutoEvaluateFunctions = false; + let result = callback(); + shouldAutoEvaluateFunctions = cache; + return result; + } + function evaluate(el, expression, extras = {}) { + let result; + evaluateLater(el, expression)((value) => result = value, extras); + return result; + } + function evaluateLater(...args) { + return theEvaluatorFunction(...args); + } + var theEvaluatorFunction = normalEvaluator; + function setEvaluator(newEvaluator) { + theEvaluatorFunction = newEvaluator; + } + function normalEvaluator(el, expression) { + let overriddenMagics = {}; + injectMagics(overriddenMagics, el); + let dataStack = [overriddenMagics, ...closestDataStack(el)]; + let evaluator = typeof expression === "function" ? generateEvaluatorFromFunction(dataStack, expression) : generateEvaluatorFromString(dataStack, expression, el); + return tryCatch.bind(null, el, expression, evaluator); + } + function generateEvaluatorFromFunction(dataStack, func) { + return (receiver = () => { + }, { scope: scope2 = {}, params = [] } = {}) => { + let result = func.apply(mergeProxies([scope2, ...dataStack]), params); + runIfTypeOfFunction(receiver, result); + }; + } + var evaluatorMemo = {}; + function generateFunctionFromString(expression, el) { + if (evaluatorMemo[expression]) { + return evaluatorMemo[expression]; + } + let AsyncFunction = Object.getPrototypeOf(async function() { + }).constructor; + let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression.trim()) || /^(let|const)\s/.test(expression.trim()) ? `(async()=>{ ${expression} })()` : expression; + const safeAsyncFunction = () => { + try { + let func2 = new AsyncFunction( + ["__self", "scope"], + `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;` + ); + Object.defineProperty(func2, "name", { + value: `[Alpine] ${expression}` + }); + return func2; + } catch (error2) { + handleError(error2, el, expression); + return Promise.resolve(); + } + }; + let func = safeAsyncFunction(); + evaluatorMemo[expression] = func; + return func; + } + function generateEvaluatorFromString(dataStack, expression, el) { + let func = generateFunctionFromString(expression, el); + return (receiver = () => { + }, { scope: scope2 = {}, params = [] } = {}) => { + func.result = void 0; + func.finished = false; + let completeScope = mergeProxies([scope2, ...dataStack]); + if (typeof func === "function") { + let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression)); + if (func.finished) { + runIfTypeOfFunction(receiver, func.result, completeScope, params, el); + func.result = void 0; + } else { + promise.then((result) => { + runIfTypeOfFunction(receiver, result, completeScope, params, el); + }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0); + } + } + }; + } + function runIfTypeOfFunction(receiver, value, scope2, params, el) { + if (shouldAutoEvaluateFunctions && typeof value === "function") { + let result = value.apply(scope2, params); + if (result instanceof Promise) { + result.then((i2) => runIfTypeOfFunction(receiver, i2, scope2, params)).catch((error2) => handleError(error2, el, value)); + } else { + receiver(result); + } + } else if (typeof value === "object" && value instanceof Promise) { + value.then((i2) => receiver(i2)); + } else { + receiver(value); + } + } + var prefixAsString = "x-"; + function prefix(subject = "") { + return prefixAsString + subject; + } + function setPrefix(newPrefix) { + prefixAsString = newPrefix; + } + var directiveHandlers = {}; + function directive(name, callback) { + directiveHandlers[name] = callback; + return { + before(directive2) { + if (!directiveHandlers[directive2]) { + console.warn(String.raw`Cannot find directive \`${directive2}\`. \`${name}\` will use the default order of execution`); + return; + } + const pos = directiveOrder.indexOf(directive2); + directiveOrder.splice(pos >= 0 ? pos : directiveOrder.indexOf("DEFAULT"), 0, name); + } + }; + } + function directives(el, attributes, originalAttributeOverride) { + attributes = Array.from(attributes); + if (el._x_virtualDirectives) { + let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value })); + let staticAttributes = attributesOnly(vAttributes); + vAttributes = vAttributes.map((attribute) => { + if (staticAttributes.find((attr) => attr.name === attribute.name)) { + return { + name: `x-bind:${attribute.name}`, + value: `"${attribute.value}"` + }; + } + return attribute; + }); + attributes = attributes.concat(vAttributes); + } + let transformedAttributeMap = {}; + let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority); + return directives2.map((directive2) => { + return getDirectiveHandler(el, directive2); + }); + } + function attributesOnly(attributes) { + return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr)); + } + var isDeferringHandlers = false; + var directiveHandlerStacks = /* @__PURE__ */ new Map(); + var currentHandlerStackKey = Symbol(); + function deferHandlingDirectives(callback) { + isDeferringHandlers = true; + let key = Symbol(); + currentHandlerStackKey = key; + directiveHandlerStacks.set(key, []); + let flushHandlers = () => { + while (directiveHandlerStacks.get(key).length) + directiveHandlerStacks.get(key).shift()(); + directiveHandlerStacks.delete(key); + }; + let stopDeferring = () => { + isDeferringHandlers = false; + flushHandlers(); + }; + callback(flushHandlers); + stopDeferring(); + } + function getElementBoundUtilities(el) { + let cleanups = []; + let cleanup = (callback) => cleanups.push(callback); + let [effect3, cleanupEffect] = elementBoundEffect(el); + cleanups.push(cleanupEffect); + let utilities = { + Alpine: alpine_default2, + effect: effect3, + cleanup, + evaluateLater: evaluateLater.bind(evaluateLater, el), + evaluate: evaluate.bind(evaluate, el) + }; + let doCleanup = () => cleanups.forEach((i2) => i2()); + return [utilities, doCleanup]; + } + function getDirectiveHandler(el, directive2) { + let noop = () => { + }; + let handler4 = directiveHandlers[directive2.type] || noop; + let [utilities, cleanup] = getElementBoundUtilities(el); + onAttributeRemoved(el, directive2.original, cleanup); + let fullHandler = () => { + if (el._x_ignore || el._x_ignoreSelf) + return; + handler4.inline && handler4.inline(el, directive2, utilities); + handler4 = handler4.bind(handler4, el, directive2, utilities); + isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler4) : handler4(); + }; + fullHandler.runCleanups = cleanup; + return fullHandler; + } + var startingWith = (subject, replacement) => ({ name, value }) => { + if (name.startsWith(subject)) + name = name.replace(subject, replacement); + return { name, value }; + }; + var into = (i2) => i2; + function toTransformedAttributes(callback = () => { + }) { + return ({ name, value }) => { + let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => { + return transform(carry); + }, { name, value }); + if (newName !== name) + callback(newName, name); + return { name: newName, value: newValue }; + }; + } + var attributeTransformers = []; + function mapAttributes(callback) { + attributeTransformers.push(callback); + } + function outNonAlpineAttributes({ name }) { + return alpineAttributeRegex().test(name); + } + var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`); + function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) { + return ({ name, value }) => { + let typeMatch = name.match(alpineAttributeRegex()); + let valueMatch = name.match(/:([a-zA-Z0-9\-_:]+)/); + let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || []; + let original = originalAttributeOverride || transformedAttributeMap[name] || name; + return { + type: typeMatch ? typeMatch[1] : null, + value: valueMatch ? valueMatch[1] : null, + modifiers: modifiers.map((i2) => i2.replace(".", "")), + expression: value, + original + }; + }; + } + var DEFAULT = "DEFAULT"; + var directiveOrder = [ + "ignore", + "ref", + "data", + "id", + "anchor", + "bind", + "init", + "for", + "model", + "modelable", + "transition", + "show", + "if", + DEFAULT, + "teleport" + ]; + function byPriority(a2, b2) { + let typeA = directiveOrder.indexOf(a2.type) === -1 ? DEFAULT : a2.type; + let typeB = directiveOrder.indexOf(b2.type) === -1 ? DEFAULT : b2.type; + return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB); + } + var tickStack = []; + var isHolding = false; + function nextTick(callback = () => { + }) { + queueMicrotask(() => { + isHolding || setTimeout(() => { + releaseNextTicks(); + }); + }); + return new Promise((res) => { + tickStack.push(() => { + callback(); + res(); + }); + }); + } + function releaseNextTicks() { + isHolding = false; + while (tickStack.length) + tickStack.shift()(); + } + function holdNextTicks() { + isHolding = true; + } + function setClasses(el, value) { + if (Array.isArray(value)) { + return setClassesFromString(el, value.join(" ")); + } else if (typeof value === "object" && value !== null) { + return setClassesFromObject(el, value); + } else if (typeof value === "function") { + return setClasses(el, value()); + } + return setClassesFromString(el, value); + } + function setClassesFromString(el, classString) { + let split = (classString2) => classString2.split(" ").filter(Boolean); + let missingClasses = (classString2) => classString2.split(" ").filter((i2) => !el.classList.contains(i2)).filter(Boolean); + let addClassesAndReturnUndo = (classes) => { + el.classList.add(...classes); + return () => { + el.classList.remove(...classes); + }; + }; + classString = classString === true ? classString = "" : classString || ""; + return addClassesAndReturnUndo(missingClasses(classString)); + } + function setClassesFromObject(el, classObject) { + let split = (classString) => classString.split(" ").filter(Boolean); + let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean); + let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean); + let added = []; + let removed = []; + forRemove.forEach((i2) => { + if (el.classList.contains(i2)) { + el.classList.remove(i2); + removed.push(i2); + } + }); + forAdd.forEach((i2) => { + if (!el.classList.contains(i2)) { + el.classList.add(i2); + added.push(i2); + } + }); + return () => { + removed.forEach((i2) => el.classList.add(i2)); + added.forEach((i2) => el.classList.remove(i2)); + }; + } + function setStyles(el, value) { + if (typeof value === "object" && value !== null) { + return setStylesFromObject(el, value); + } + return setStylesFromString(el, value); + } + function setStylesFromObject(el, value) { + let previousStyles = {}; + Object.entries(value).forEach(([key, value2]) => { + previousStyles[key] = el.style[key]; + if (!key.startsWith("--")) { + key = kebabCase2(key); + } + el.style.setProperty(key, value2); + }); + setTimeout(() => { + if (el.style.length === 0) { + el.removeAttribute("style"); + } + }); + return () => { + setStyles(el, previousStyles); + }; + } + function setStylesFromString(el, value) { + let cache = el.getAttribute("style", value); + el.setAttribute("style", value); + return () => { + el.setAttribute("style", cache || ""); + }; + } + function kebabCase2(subject) { + return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); + } + function once(callback, fallback = () => { + }) { + let called = false; + return function() { + if (!called) { + called = true; + callback.apply(this, arguments); + } else { + fallback.apply(this, arguments); + } + }; + } + directive("transition", (el, { value, modifiers, expression }, { evaluate: evaluate2 }) => { + if (typeof expression === "function") + expression = evaluate2(expression); + if (expression === false) + return; + if (!expression || typeof expression === "boolean") { + registerTransitionsFromHelper(el, modifiers, value); + } else { + registerTransitionsFromClassString(el, expression, value); + } + }); + function registerTransitionsFromClassString(el, classString, stage) { + registerTransitionObject(el, setClasses, ""); + let directiveStorageMap = { + "enter": (classes) => { + el._x_transition.enter.during = classes; + }, + "enter-start": (classes) => { + el._x_transition.enter.start = classes; + }, + "enter-end": (classes) => { + el._x_transition.enter.end = classes; + }, + "leave": (classes) => { + el._x_transition.leave.during = classes; + }, + "leave-start": (classes) => { + el._x_transition.leave.start = classes; + }, + "leave-end": (classes) => { + el._x_transition.leave.end = classes; + } + }; + directiveStorageMap[stage](classString); + } + function registerTransitionsFromHelper(el, modifiers, stage) { + registerTransitionObject(el, setStyles); + let doesntSpecify = !modifiers.includes("in") && !modifiers.includes("out") && !stage; + let transitioningIn = doesntSpecify || modifiers.includes("in") || ["enter"].includes(stage); + let transitioningOut = doesntSpecify || modifiers.includes("out") || ["leave"].includes(stage); + if (modifiers.includes("in") && !doesntSpecify) { + modifiers = modifiers.filter((i2, index) => index < modifiers.indexOf("out")); + } + if (modifiers.includes("out") && !doesntSpecify) { + modifiers = modifiers.filter((i2, index) => index > modifiers.indexOf("out")); + } + let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale"); + let wantsOpacity = wantsAll || modifiers.includes("opacity"); + let wantsScale = wantsAll || modifiers.includes("scale"); + let opacityValue = wantsOpacity ? 0 : 1; + let scaleValue = wantsScale ? modifierValue(modifiers, "scale", 95) / 100 : 1; + let delay = modifierValue(modifiers, "delay", 0) / 1e3; + let origin = modifierValue(modifiers, "origin", "center"); + let property = "opacity, transform"; + let durationIn = modifierValue(modifiers, "duration", 150) / 1e3; + let durationOut = modifierValue(modifiers, "duration", 75) / 1e3; + let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`; + if (transitioningIn) { + el._x_transition.enter.during = { + transformOrigin: origin, + transitionDelay: `${delay}s`, + transitionProperty: property, + transitionDuration: `${durationIn}s`, + transitionTimingFunction: easing + }; + el._x_transition.enter.start = { + opacity: opacityValue, + transform: `scale(${scaleValue})` + }; + el._x_transition.enter.end = { + opacity: 1, + transform: `scale(1)` + }; + } + if (transitioningOut) { + el._x_transition.leave.during = { + transformOrigin: origin, + transitionDelay: `${delay}s`, + transitionProperty: property, + transitionDuration: `${durationOut}s`, + transitionTimingFunction: easing + }; + el._x_transition.leave.start = { + opacity: 1, + transform: `scale(1)` + }; + el._x_transition.leave.end = { + opacity: opacityValue, + transform: `scale(${scaleValue})` + }; + } + } + function registerTransitionObject(el, setFunction, defaultValue = {}) { + if (!el._x_transition) + el._x_transition = { + enter: { during: defaultValue, start: defaultValue, end: defaultValue }, + leave: { during: defaultValue, start: defaultValue, end: defaultValue }, + in(before = () => { + }, after = () => { + }) { + transition(el, setFunction, { + during: this.enter.during, + start: this.enter.start, + end: this.enter.end + }, before, after); + }, + out(before = () => { + }, after = () => { + }) { + transition(el, setFunction, { + during: this.leave.during, + start: this.leave.start, + end: this.leave.end + }, before, after); + } + }; + } + window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) { + const nextTick2 = document.visibilityState === "visible" ? requestAnimationFrame : setTimeout; + let clickAwayCompatibleShow = () => nextTick2(show); + if (value) { + if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) { + el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow(); + } else { + el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow(); + } + return; + } + el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => { + el._x_transition.out(() => { + }, () => resolve(hide)); + el._x_transitioning && el._x_transitioning.beforeCancel(() => reject({ isFromCancelledTransition: true })); + }) : Promise.resolve(hide); + queueMicrotask(() => { + let closest = closestHide(el); + if (closest) { + if (!closest._x_hideChildren) + closest._x_hideChildren = []; + closest._x_hideChildren.push(el); + } else { + nextTick2(() => { + let hideAfterChildren = (el2) => { + let carry = Promise.all([ + el2._x_hidePromise, + ...(el2._x_hideChildren || []).map(hideAfterChildren) + ]).then(([i2]) => i2()); + delete el2._x_hidePromise; + delete el2._x_hideChildren; + return carry; + }; + hideAfterChildren(el).catch((e2) => { + if (!e2.isFromCancelledTransition) + throw e2; + }); + }); + } + }); + }; + function closestHide(el) { + let parent = el.parentNode; + if (!parent) + return; + return parent._x_hidePromise ? parent : closestHide(parent); + } + function transition(el, setFunction, { during, start: start2, end } = {}, before = () => { + }, after = () => { + }) { + if (el._x_transitioning) + el._x_transitioning.cancel(); + if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) { + before(); + after(); + return; + } + let undoStart, undoDuring, undoEnd; + performTransition(el, { + start() { + undoStart = setFunction(el, start2); + }, + during() { + undoDuring = setFunction(el, during); + }, + before, + end() { + undoStart(); + undoEnd = setFunction(el, end); + }, + after, + cleanup() { + undoDuring(); + undoEnd(); + } + }); + } + function performTransition(el, stages) { + let interrupted, reachedBefore, reachedEnd; + let finish = once(() => { + mutateDom(() => { + interrupted = true; + if (!reachedBefore) + stages.before(); + if (!reachedEnd) { + stages.end(); + releaseNextTicks(); + } + stages.after(); + if (el.isConnected) + stages.cleanup(); + delete el._x_transitioning; + }); + }); + el._x_transitioning = { + beforeCancels: [], + beforeCancel(callback) { + this.beforeCancels.push(callback); + }, + cancel: once(function() { + while (this.beforeCancels.length) { + this.beforeCancels.shift()(); + } + ; + finish(); + }), + finish + }; + mutateDom(() => { + stages.start(); + stages.during(); + }); + holdNextTicks(); + requestAnimationFrame(() => { + if (interrupted) + return; + let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, "").replace("s", "")) * 1e3; + let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, "").replace("s", "")) * 1e3; + if (duration === 0) + duration = Number(getComputedStyle(el).animationDuration.replace("s", "")) * 1e3; + mutateDom(() => { + stages.before(); + }); + reachedBefore = true; + requestAnimationFrame(() => { + if (interrupted) + return; + mutateDom(() => { + stages.end(); + }); + releaseNextTicks(); + setTimeout(el._x_transitioning.finish, duration + delay); + reachedEnd = true; + }); + }); + } + function modifierValue(modifiers, key, fallback) { + if (modifiers.indexOf(key) === -1) + return fallback; + const rawValue = modifiers[modifiers.indexOf(key) + 1]; + if (!rawValue) + return fallback; + if (key === "scale") { + if (isNaN(rawValue)) + return fallback; + } + if (key === "duration" || key === "delay") { + let match = rawValue.match(/([0-9]+)ms/); + if (match) + return match[1]; + } + if (key === "origin") { + if (["top", "right", "left", "center", "bottom"].includes(modifiers[modifiers.indexOf(key) + 2])) { + return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(" "); + } + } + return rawValue; + } + var isCloning = false; + function skipDuringClone(callback, fallback = () => { + }) { + return (...args) => isCloning ? fallback(...args) : callback(...args); + } + function onlyDuringClone(callback) { + return (...args) => isCloning && callback(...args); + } + var interceptors = []; + function interceptClone(callback) { + interceptors.push(callback); + } + function cloneNode(from, to) { + interceptors.forEach((i2) => i2(from, to)); + isCloning = true; + dontRegisterReactiveSideEffects(() => { + initTree(to, (el, callback) => { + callback(el, () => { + }); + }); + }); + isCloning = false; + } + var isCloningLegacy = false; + function clone(oldEl, newEl) { + if (!newEl._x_dataStack) + newEl._x_dataStack = oldEl._x_dataStack; + isCloning = true; + isCloningLegacy = true; + dontRegisterReactiveSideEffects(() => { + cloneTree(newEl); + }); + isCloning = false; + isCloningLegacy = false; + } + function cloneTree(el) { + let hasRunThroughFirstEl = false; + let shallowWalker = (el2, callback) => { + walk(el2, (el3, skip) => { + if (hasRunThroughFirstEl && isRoot(el3)) + return skip(); + hasRunThroughFirstEl = true; + callback(el3, skip); + }); + }; + initTree(el, shallowWalker); + } + function dontRegisterReactiveSideEffects(callback) { + let cache = effect; + overrideEffect((callback2, el) => { + let storedEffect = cache(callback2); + release(storedEffect); + return () => { + }; + }); + callback(); + overrideEffect(cache); + } + function bind(el, name, value, modifiers = []) { + if (!el._x_bindings) + el._x_bindings = reactive({}); + el._x_bindings[name] = value; + name = modifiers.includes("camel") ? camelCase2(name) : name; + switch (name) { + case "value": + bindInputValue(el, value); + break; + case "style": + bindStyles(el, value); + break; + case "class": + bindClasses(el, value); + break; + case "selected": + case "checked": + bindAttributeAndProperty(el, name, value); + break; + default: + bindAttribute(el, name, value); + break; + } + } + function bindInputValue(el, value) { + if (el.type === "radio") { + if (el.attributes.value === void 0) { + el.value = value; + } + if (window.fromModel) { + if (typeof value === "boolean") { + el.checked = safeParseBoolean(el.value) === value; + } else { + el.checked = checkedAttrLooseCompare(el.value, value); + } + } + } else if (el.type === "checkbox") { + if (Number.isInteger(value)) { + el.value = value; + } else if (!Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) { + el.value = String(value); + } else { + if (Array.isArray(value)) { + el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value)); + } else { + el.checked = !!value; + } + } + } else if (el.tagName === "SELECT") { + updateSelect(el, value); + } else { + if (el.value === value) + return; + el.value = value === void 0 ? "" : value; + } + } + function bindClasses(el, value) { + if (el._x_undoAddedClasses) + el._x_undoAddedClasses(); + el._x_undoAddedClasses = setClasses(el, value); + } + function bindStyles(el, value) { + if (el._x_undoAddedStyles) + el._x_undoAddedStyles(); + el._x_undoAddedStyles = setStyles(el, value); + } + function bindAttributeAndProperty(el, name, value) { + bindAttribute(el, name, value); + setPropertyIfChanged(el, name, value); + } + function bindAttribute(el, name, value) { + if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) { + el.removeAttribute(name); + } else { + if (isBooleanAttr(name)) + value = name; + setIfChanged(el, name, value); + } + } + function setIfChanged(el, attrName, value) { + if (el.getAttribute(attrName) != value) { + el.setAttribute(attrName, value); + } + } + function setPropertyIfChanged(el, propName, value) { + if (el[propName] !== value) { + el[propName] = value; + } + } + function updateSelect(el, value) { + const arrayWrappedValue = [].concat(value).map((value2) => { + return value2 + ""; + }); + Array.from(el.options).forEach((option) => { + option.selected = arrayWrappedValue.includes(option.value); + }); + } + function camelCase2(subject) { + return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase()); + } + function checkedAttrLooseCompare(valueA, valueB) { + return valueA == valueB; + } + function safeParseBoolean(rawValue) { + if ([1, "1", "true", "on", "yes", true].includes(rawValue)) { + return true; + } + if ([0, "0", "false", "off", "no", false].includes(rawValue)) { + return false; + } + return rawValue ? Boolean(rawValue) : null; + } + function isBooleanAttr(attrName) { + const booleanAttributes = [ + "disabled", + "checked", + "required", + "readonly", + "open", + "selected", + "autofocus", + "itemscope", + "multiple", + "novalidate", + "allowfullscreen", + "allowpaymentrequest", + "formnovalidate", + "autoplay", + "controls", + "loop", + "muted", + "playsinline", + "default", + "ismap", + "reversed", + "async", + "defer", + "nomodule" + ]; + return booleanAttributes.includes(attrName); + } + function attributeShouldntBePreservedIfFalsy(name) { + return !["aria-pressed", "aria-checked", "aria-expanded", "aria-selected"].includes(name); + } + function getBinding(el, name, fallback) { + if (el._x_bindings && el._x_bindings[name] !== void 0) + return el._x_bindings[name]; + return getAttributeBinding(el, name, fallback); + } + function extractProp(el, name, fallback, extract = true) { + if (el._x_bindings && el._x_bindings[name] !== void 0) + return el._x_bindings[name]; + if (el._x_inlineBindings && el._x_inlineBindings[name] !== void 0) { + let binding = el._x_inlineBindings[name]; + binding.extract = extract; + return dontAutoEvaluateFunctions(() => { + return evaluate(el, binding.expression); + }); + } + return getAttributeBinding(el, name, fallback); + } + function getAttributeBinding(el, name, fallback) { + let attr = el.getAttribute(name); + if (attr === null) + return typeof fallback === "function" ? fallback() : fallback; + if (attr === "") + return true; + if (isBooleanAttr(name)) { + return !![name, "true"].includes(attr); + } + return attr; + } + function debounce(func, wait) { + var timeout; + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + func.apply(context, args); + }; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + }; + } + function throttle(func, limit) { + let inThrottle; + return function() { + let context = this, args = arguments; + if (!inThrottle) { + func.apply(context, args); + inThrottle = true; + setTimeout(() => inThrottle = false, limit); + } + }; + } + function entangle({ get: outerGet, set: outerSet }, { get: innerGet, set: innerSet }) { + let firstRun = true; + let outerHash; + let innerHash; + let reference = effect(() => { + let outer = outerGet(); + let inner = innerGet(); + if (firstRun) { + innerSet(cloneIfObject(outer)); + firstRun = false; + } else { + let outerHashLatest = JSON.stringify(outer); + let innerHashLatest = JSON.stringify(inner); + if (outerHashLatest !== outerHash) { + innerSet(cloneIfObject(outer)); + } else if (outerHashLatest !== innerHashLatest) { + outerSet(cloneIfObject(inner)); + } else { + } + } + outerHash = JSON.stringify(outerGet()); + innerHash = JSON.stringify(innerGet()); + }); + return () => { + release(reference); + }; + } + function cloneIfObject(value) { + return typeof value === "object" ? JSON.parse(JSON.stringify(value)) : value; + } + function plugin(callback) { + let callbacks = Array.isArray(callback) ? callback : [callback]; + callbacks.forEach((i2) => i2(alpine_default2)); + } + var stores = {}; + var isReactive = false; + function store(name, value) { + if (!isReactive) { + stores = reactive(stores); + isReactive = true; + } + if (value === void 0) { + return stores[name]; + } + stores[name] = value; + if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") { + stores[name].init(); + } + initInterceptors2(stores[name]); + } + function getStores() { + return stores; + } + var binds = {}; + function bind2(name, bindings) { + let getBindings = typeof bindings !== "function" ? () => bindings : bindings; + if (name instanceof Element) { + return applyBindingsObject(name, getBindings()); + } else { + binds[name] = getBindings; + } + return () => { + }; + } + function injectBindingProviders(obj) { + Object.entries(binds).forEach(([name, callback]) => { + Object.defineProperty(obj, name, { + get() { + return (...args) => { + return callback(...args); + }; + } + }); + }); + return obj; + } + function applyBindingsObject(el, obj, original) { + let cleanupRunners = []; + while (cleanupRunners.length) + cleanupRunners.pop()(); + let attributes = Object.entries(obj).map(([name, value]) => ({ name, value })); + let staticAttributes = attributesOnly(attributes); + attributes = attributes.map((attribute) => { + if (staticAttributes.find((attr) => attr.name === attribute.name)) { + return { + name: `x-bind:${attribute.name}`, + value: `"${attribute.value}"` + }; + } + return attribute; + }); + directives(el, attributes, original).map((handle) => { + cleanupRunners.push(handle.runCleanups); + handle(); + }); + return () => { + while (cleanupRunners.length) + cleanupRunners.pop()(); + }; + } + var datas = {}; + function data(name, callback) { + datas[name] = callback; + } + function injectDataProviders(obj, context) { + Object.entries(datas).forEach(([name, callback]) => { + Object.defineProperty(obj, name, { + get() { + return (...args) => { + return callback.bind(context)(...args); + }; + }, + enumerable: false + }); + }); + return obj; + } + var Alpine3 = { + get reactive() { + return reactive; + }, + get release() { + return release; + }, + get effect() { + return effect; + }, + get raw() { + return raw; + }, + version: "3.13.8", + flushAndStopDeferringMutations, + dontAutoEvaluateFunctions, + disableEffectScheduling, + startObservingMutations, + stopObservingMutations, + setReactivityEngine, + onAttributeRemoved, + onAttributesAdded, + closestDataStack, + skipDuringClone, + onlyDuringClone, + addRootSelector, + addInitSelector, + interceptClone, + addScopeToNode, + deferMutations, + mapAttributes, + evaluateLater, + interceptInit, + setEvaluator, + mergeProxies, + extractProp, + findClosest, + onElRemoved, + closestRoot, + destroyTree, + interceptor, + // INTERNAL: not public API and is subject to change without major release. + transition, + // INTERNAL + setStyles, + // INTERNAL + mutateDom, + directive, + entangle, + throttle, + debounce, + evaluate, + initTree, + nextTick, + prefixed: prefix, + prefix: setPrefix, + plugin, + magic, + store, + start, + clone, + // INTERNAL + cloneNode, + // INTERNAL + bound: getBinding, + $data: scope, + watch, + walk, + data, + bind: bind2 + }; + var alpine_default2 = Alpine3; + var import_reactivity10 = __toESM2(require_reactivity()); + magic("nextTick", () => nextTick); + magic("dispatch", (el) => dispatch.bind(dispatch, el)); + magic("watch", (el, { evaluateLater: evaluateLater2, cleanup }) => (key, callback) => { + let evaluate2 = evaluateLater2(key); + let getter = () => { + let value; + evaluate2((i2) => value = i2); + return value; + }; + let unwatch = watch(getter, callback); + cleanup(unwatch); + }); + magic("store", getStores); + magic("data", (el) => scope(el)); + magic("root", (el) => closestRoot(el)); + magic("refs", (el) => { + if (el._x_refs_proxy) + return el._x_refs_proxy; + el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el)); + return el._x_refs_proxy; + }); + function getArrayOfRefObject(el) { + let refObjects = []; + findClosest(el, (i2) => { + if (i2._x_refs) + refObjects.push(i2._x_refs); + }); + return refObjects; + } + var globalIdMemo = {}; + function findAndIncrementId(name) { + if (!globalIdMemo[name]) + globalIdMemo[name] = 0; + return ++globalIdMemo[name]; + } + function closestIdRoot(el, name) { + return findClosest(el, (element) => { + if (element._x_ids && element._x_ids[name]) + return true; + }); + } + function setIdRoot(el, name) { + if (!el._x_ids) + el._x_ids = {}; + if (!el._x_ids[name]) + el._x_ids[name] = findAndIncrementId(name); + } + magic("id", (el, { cleanup }) => (name, key = null) => { + let cacheKey = `${name}${key ? `-${key}` : ""}`; + return cacheIdByNameOnElement(el, cacheKey, cleanup, () => { + let root = closestIdRoot(el, name); + let id = root ? root._x_ids[name] : findAndIncrementId(name); + return key ? `${name}-${id}-${key}` : `${name}-${id}`; + }); + }); + interceptClone((from, to) => { + if (from._x_id) { + to._x_id = from._x_id; + } + }); + function cacheIdByNameOnElement(el, cacheKey, cleanup, callback) { + if (!el._x_id) + el._x_id = {}; + if (el._x_id[cacheKey]) + return el._x_id[cacheKey]; + let output = callback(); + el._x_id[cacheKey] = output; + cleanup(() => { + delete el._x_id[cacheKey]; + }); + return output; + } + magic("el", (el) => el); + warnMissingPluginMagic("Focus", "focus", "focus"); + warnMissingPluginMagic("Persist", "persist", "persist"); + function warnMissingPluginMagic(name, magicName, slug) { + magic(magicName, (el) => warn(`You can't use [$${magicName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el)); + } + directive("modelable", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2, cleanup }) => { + let func = evaluateLater2(expression); + let innerGet = () => { + let result; + func((i2) => result = i2); + return result; + }; + let evaluateInnerSet = evaluateLater2(`${expression} = __placeholder`); + let innerSet = (val) => evaluateInnerSet(() => { + }, { scope: { "__placeholder": val } }); + let initialValue = innerGet(); + innerSet(initialValue); + queueMicrotask(() => { + if (!el._x_model) + return; + el._x_removeModelListeners["default"](); + let outerGet = el._x_model.get; + let outerSet = el._x_model.set; + let releaseEntanglement = entangle( + { + get() { + return outerGet(); + }, + set(value) { + outerSet(value); + } + }, + { + get() { + return innerGet(); + }, + set(value) { + innerSet(value); + } + } + ); + cleanup(releaseEntanglement); + }); + }); + directive("teleport", (el, { modifiers, expression }, { cleanup }) => { + if (el.tagName.toLowerCase() !== "template") + warn("x-teleport can only be used on a <template> tag", el); + let target = getTarget(expression); + let clone2 = el.content.cloneNode(true).firstElementChild; + el._x_teleport = clone2; + clone2._x_teleportBack = el; + el.setAttribute("data-teleport-template", true); + clone2.setAttribute("data-teleport-target", true); + if (el._x_forwardEvents) { + el._x_forwardEvents.forEach((eventName) => { + clone2.addEventListener(eventName, (e2) => { + e2.stopPropagation(); + el.dispatchEvent(new e2.constructor(e2.type, e2)); + }); + }); + } + addScopeToNode(clone2, {}, el); + let placeInDom = (clone3, target2, modifiers2) => { + if (modifiers2.includes("prepend")) { + target2.parentNode.insertBefore(clone3, target2); + } else if (modifiers2.includes("append")) { + target2.parentNode.insertBefore(clone3, target2.nextSibling); + } else { + target2.appendChild(clone3); + } + }; + mutateDom(() => { + placeInDom(clone2, target, modifiers); + initTree(clone2); + clone2._x_ignore = true; + }); + el._x_teleportPutBack = () => { + let target2 = getTarget(expression); + mutateDom(() => { + placeInDom(el._x_teleport, target2, modifiers); + }); + }; + cleanup(() => clone2.remove()); + }); + var teleportContainerDuringClone = document.createElement("div"); + function getTarget(expression) { + let target = skipDuringClone(() => { + return document.querySelector(expression); + }, () => { + return teleportContainerDuringClone; + })(); + if (!target) + warn(`Cannot find x-teleport element for selector: "${expression}"`); + return target; + } + var handler = () => { + }; + handler.inline = (el, { modifiers }, { cleanup }) => { + modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true; + cleanup(() => { + modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore; + }); + }; + directive("ignore", handler); + directive("effect", skipDuringClone((el, { expression }, { effect: effect3 }) => { + effect3(evaluateLater(el, expression)); + })); + function on(el, event, modifiers, callback) { + let listenerTarget = el; + let handler4 = (e2) => callback(e2); + let options = {}; + let wrapHandler = (callback2, wrapper) => (e2) => wrapper(callback2, e2); + if (modifiers.includes("dot")) + event = dotSyntax(event); + if (modifiers.includes("camel")) + event = camelCase22(event); + if (modifiers.includes("passive")) + options.passive = true; + if (modifiers.includes("capture")) + options.capture = true; + if (modifiers.includes("window")) + listenerTarget = window; + if (modifiers.includes("document")) + listenerTarget = document; + if (modifiers.includes("debounce")) { + let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait"; + let wait = isNumeric2(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; + handler4 = debounce(handler4, wait); + } + if (modifiers.includes("throttle")) { + let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait"; + let wait = isNumeric2(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; + handler4 = throttle(handler4, wait); + } + if (modifiers.includes("prevent")) + handler4 = wrapHandler(handler4, (next, e2) => { + e2.preventDefault(); + next(e2); + }); + if (modifiers.includes("stop")) + handler4 = wrapHandler(handler4, (next, e2) => { + e2.stopPropagation(); + next(e2); + }); + if (modifiers.includes("self")) + handler4 = wrapHandler(handler4, (next, e2) => { + e2.target === el && next(e2); + }); + if (modifiers.includes("away") || modifiers.includes("outside")) { + listenerTarget = document; + handler4 = wrapHandler(handler4, (next, e2) => { + if (el.contains(e2.target)) + return; + if (e2.target.isConnected === false) + return; + if (el.offsetWidth < 1 && el.offsetHeight < 1) + return; + if (el._x_isShown === false) + return; + next(e2); + }); + } + if (modifiers.includes("once")) { + handler4 = wrapHandler(handler4, (next, e2) => { + next(e2); + listenerTarget.removeEventListener(event, handler4, options); + }); + } + handler4 = wrapHandler(handler4, (next, e2) => { + if (isKeyEvent(event)) { + if (isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers)) { + return; + } + } + next(e2); + }); + listenerTarget.addEventListener(event, handler4, options); + return () => { + listenerTarget.removeEventListener(event, handler4, options); + }; + } + function dotSyntax(subject) { + return subject.replace(/-/g, "."); + } + function camelCase22(subject) { + return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase()); + } + function isNumeric2(subject) { + return !Array.isArray(subject) && !isNaN(subject); + } + function kebabCase22(subject) { + if ([" ", "_"].includes( + subject + )) + return subject; + return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase(); + } + function isKeyEvent(event) { + return ["keydown", "keyup"].includes(event); + } + function isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers) { + let keyModifiers = modifiers.filter((i2) => { + return !["window", "document", "prevent", "stop", "once", "capture"].includes(i2); + }); + if (keyModifiers.includes("debounce")) { + let debounceIndex = keyModifiers.indexOf("debounce"); + keyModifiers.splice(debounceIndex, isNumeric2((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1); + } + if (keyModifiers.includes("throttle")) { + let debounceIndex = keyModifiers.indexOf("throttle"); + keyModifiers.splice(debounceIndex, isNumeric2((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1); + } + if (keyModifiers.length === 0) + return false; + if (keyModifiers.length === 1 && keyToModifiers(e2.key).includes(keyModifiers[0])) + return false; + const systemKeyModifiers = ["ctrl", "shift", "alt", "meta", "cmd", "super"]; + const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier)); + keyModifiers = keyModifiers.filter((i2) => !selectedSystemKeyModifiers.includes(i2)); + if (selectedSystemKeyModifiers.length > 0) { + const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => { + if (modifier === "cmd" || modifier === "super") + modifier = "meta"; + return e2[`${modifier}Key`]; + }); + if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) { + if (keyToModifiers(e2.key).includes(keyModifiers[0])) + return false; + } + } + return true; + } + function keyToModifiers(key) { + if (!key) + return []; + key = kebabCase22(key); + let modifierToKeyMap = { + "ctrl": "control", + "slash": "/", + "space": " ", + "spacebar": " ", + "cmd": "meta", + "esc": "escape", + "up": "arrow-up", + "down": "arrow-down", + "left": "arrow-left", + "right": "arrow-right", + "period": ".", + "equal": "=", + "minus": "-", + "underscore": "_" + }; + modifierToKeyMap[key] = key; + return Object.keys(modifierToKeyMap).map((modifier) => { + if (modifierToKeyMap[modifier] === key) + return modifier; + }).filter((modifier) => modifier); + } + directive("model", (el, { modifiers, expression }, { effect: effect3, cleanup }) => { + let scopeTarget = el; + if (modifiers.includes("parent")) { + scopeTarget = el.parentNode; + } + let evaluateGet = evaluateLater(scopeTarget, expression); + let evaluateSet; + if (typeof expression === "string") { + evaluateSet = evaluateLater(scopeTarget, `${expression} = __placeholder`); + } else if (typeof expression === "function" && typeof expression() === "string") { + evaluateSet = evaluateLater(scopeTarget, `${expression()} = __placeholder`); + } else { + evaluateSet = () => { + }; + } + let getValue = () => { + let result; + evaluateGet((value) => result = value); + return isGetterSetter(result) ? result.get() : result; + }; + let setValue = (value) => { + let result; + evaluateGet((value2) => result = value2); + if (isGetterSetter(result)) { + result.set(value); + } else { + evaluateSet(() => { + }, { + scope: { "__placeholder": value } + }); + } + }; + if (typeof expression === "string" && el.type === "radio") { + mutateDom(() => { + if (!el.hasAttribute("name")) + el.setAttribute("name", expression); + }); + } + var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input"; + let removeListener = isCloning ? () => { + } : on(el, event, modifiers, (e2) => { + setValue(getInputValue(el, modifiers, e2, getValue())); + }); + if (modifiers.includes("fill")) { + if ([void 0, null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue())) { + setValue( + getInputValue(el, modifiers, { target: el }, getValue()) + ); + } + } + if (!el._x_removeModelListeners) + el._x_removeModelListeners = {}; + el._x_removeModelListeners["default"] = removeListener; + cleanup(() => el._x_removeModelListeners["default"]()); + if (el.form) { + let removeResetListener = on(el.form, "reset", [], (e2) => { + nextTick(() => el._x_model && el._x_model.set(el.value)); + }); + cleanup(() => removeResetListener()); + } + el._x_model = { + get() { + return getValue(); + }, + set(value) { + setValue(value); + } + }; + el._x_forceModelUpdate = (value) => { + if (value === void 0 && typeof expression === "string" && expression.match(/\./)) + value = ""; + window.fromModel = true; + mutateDom(() => bind(el, "value", value)); + delete window.fromModel; + }; + effect3(() => { + let value = getValue(); + if (modifiers.includes("unintrusive") && document.activeElement.isSameNode(el)) + return; + el._x_forceModelUpdate(value); + }); + }); + function getInputValue(el, modifiers, event, currentValue) { + return mutateDom(() => { + if (event instanceof CustomEvent && event.detail !== void 0) + return event.detail !== null && event.detail !== void 0 ? event.detail : event.target.value; + else if (el.type === "checkbox") { + if (Array.isArray(currentValue)) { + let newValue = null; + if (modifiers.includes("number")) { + newValue = safeParseNumber(event.target.value); + } else if (modifiers.includes("boolean")) { + newValue = safeParseBoolean(event.target.value); + } else { + newValue = event.target.value; + } + return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue)); + } else { + return event.target.checked; + } + } else if (el.tagName.toLowerCase() === "select" && el.multiple) { + if (modifiers.includes("number")) { + return Array.from(event.target.selectedOptions).map((option) => { + let rawValue = option.value || option.text; + return safeParseNumber(rawValue); + }); + } else if (modifiers.includes("boolean")) { + return Array.from(event.target.selectedOptions).map((option) => { + let rawValue = option.value || option.text; + return safeParseBoolean(rawValue); + }); + } + return Array.from(event.target.selectedOptions).map((option) => { + return option.value || option.text; + }); + } else { + let newValue; + if (el.type === "radio") { + if (event.target.checked) { + newValue = event.target.value; + } else { + newValue = currentValue; + } + } else { + newValue = event.target.value; + } + if (modifiers.includes("number")) { + return safeParseNumber(newValue); + } else if (modifiers.includes("boolean")) { + return safeParseBoolean(newValue); + } else if (modifiers.includes("trim")) { + return newValue.trim(); + } else { + return newValue; + } + } + }); + } + function safeParseNumber(rawValue) { + let number = rawValue ? parseFloat(rawValue) : null; + return isNumeric22(number) ? number : rawValue; + } + function checkedAttrLooseCompare2(valueA, valueB) { + return valueA == valueB; + } + function isNumeric22(subject) { + return !Array.isArray(subject) && !isNaN(subject); + } + function isGetterSetter(value) { + return value !== null && typeof value === "object" && typeof value.get === "function" && typeof value.set === "function"; + } + directive("cloak", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix("cloak"))))); + addInitSelector(() => `[${prefix("init")}]`); + directive("init", skipDuringClone((el, { expression }, { evaluate: evaluate2 }) => { + if (typeof expression === "string") { + return !!expression.trim() && evaluate2(expression, {}, false); + } + return evaluate2(expression, {}, false); + })); + directive("text", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2 }) => { + let evaluate2 = evaluateLater2(expression); + effect3(() => { + evaluate2((value) => { + mutateDom(() => { + el.textContent = value; + }); + }); + }); + }); + directive("html", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2 }) => { + let evaluate2 = evaluateLater2(expression); + effect3(() => { + evaluate2((value) => { + mutateDom(() => { + el.innerHTML = value; + el._x_ignoreSelf = true; + initTree(el); + delete el._x_ignoreSelf; + }); + }); + }); + }); + mapAttributes(startingWith(":", into(prefix("bind:")))); + var handler2 = (el, { value, modifiers, expression, original }, { effect: effect3, cleanup }) => { + if (!value) { + let bindingProviders = {}; + injectBindingProviders(bindingProviders); + let getBindings = evaluateLater(el, expression); + getBindings((bindings) => { + applyBindingsObject(el, bindings, original); + }, { scope: bindingProviders }); + return; + } + if (value === "key") + return storeKeyForXFor(el, expression); + if (el._x_inlineBindings && el._x_inlineBindings[value] && el._x_inlineBindings[value].extract) { + return; + } + let evaluate2 = evaluateLater(el, expression); + effect3(() => evaluate2((result) => { + if (result === void 0 && typeof expression === "string" && expression.match(/\./)) { + result = ""; + } + mutateDom(() => bind(el, value, result, modifiers)); + })); + cleanup(() => { + el._x_undoAddedClasses && el._x_undoAddedClasses(); + el._x_undoAddedStyles && el._x_undoAddedStyles(); + }); + }; + handler2.inline = (el, { value, modifiers, expression }) => { + if (!value) + return; + if (!el._x_inlineBindings) + el._x_inlineBindings = {}; + el._x_inlineBindings[value] = { expression, extract: false }; + }; + directive("bind", handler2); + function storeKeyForXFor(el, expression) { + el._x_keyExpression = expression; + } + addRootSelector(() => `[${prefix("data")}]`); + directive("data", (el, { expression }, { cleanup }) => { + if (shouldSkipRegisteringDataDuringClone(el)) + return; + expression = expression === "" ? "{}" : expression; + let magicContext = {}; + injectMagics(magicContext, el); + let dataProviderContext = {}; + injectDataProviders(dataProviderContext, magicContext); + let data2 = evaluate(el, expression, { scope: dataProviderContext }); + if (data2 === void 0 || data2 === true) + data2 = {}; + injectMagics(data2, el); + let reactiveData = reactive(data2); + initInterceptors2(reactiveData); + let undo = addScopeToNode(el, reactiveData); + reactiveData["init"] && evaluate(el, reactiveData["init"]); + cleanup(() => { + reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]); + undo(); + }); + }); + interceptClone((from, to) => { + if (from._x_dataStack) { + to._x_dataStack = from._x_dataStack; + to.setAttribute("data-has-alpine-state", true); + } + }); + function shouldSkipRegisteringDataDuringClone(el) { + if (!isCloning) + return false; + if (isCloningLegacy) + return true; + return el.hasAttribute("data-has-alpine-state"); + } + directive("show", (el, { modifiers, expression }, { effect: effect3 }) => { + let evaluate2 = evaluateLater(el, expression); + if (!el._x_doHide) + el._x_doHide = () => { + mutateDom(() => { + el.style.setProperty("display", "none", modifiers.includes("important") ? "important" : void 0); + }); + }; + if (!el._x_doShow) + el._x_doShow = () => { + mutateDom(() => { + if (el.style.length === 1 && el.style.display === "none") { + el.removeAttribute("style"); + } else { + el.style.removeProperty("display"); + } + }); + }; + let hide = () => { + el._x_doHide(); + el._x_isShown = false; + }; + let show = () => { + el._x_doShow(); + el._x_isShown = true; + }; + let clickAwayCompatibleShow = () => setTimeout(show); + let toggle = once( + (value) => value ? show() : hide(), + (value) => { + if (typeof el._x_toggleAndCascadeWithTransitions === "function") { + el._x_toggleAndCascadeWithTransitions(el, value, show, hide); + } else { + value ? clickAwayCompatibleShow() : hide(); + } + } + ); + let oldValue; + let firstTime = true; + effect3(() => evaluate2((value) => { + if (!firstTime && value === oldValue) + return; + if (modifiers.includes("immediate")) + value ? clickAwayCompatibleShow() : hide(); + toggle(value); + oldValue = value; + firstTime = false; + })); + }); + directive("for", (el, { expression }, { effect: effect3, cleanup }) => { + let iteratorNames = parseForExpression(expression); + let evaluateItems = evaluateLater(el, iteratorNames.items); + let evaluateKey = evaluateLater( + el, + // the x-bind:key expression is stored for our use instead of evaluated. + el._x_keyExpression || "index" + ); + el._x_prevKeys = []; + el._x_lookup = {}; + effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey)); + cleanup(() => { + Object.values(el._x_lookup).forEach((el2) => el2.remove()); + delete el._x_prevKeys; + delete el._x_lookup; + }); + }); + function loop(el, iteratorNames, evaluateItems, evaluateKey) { + let isObject2 = (i2) => typeof i2 === "object" && !Array.isArray(i2); + let templateEl = el; + evaluateItems((items) => { + if (isNumeric3(items) && items >= 0) { + items = Array.from(Array(items).keys(), (i2) => i2 + 1); + } + if (items === void 0) + items = []; + let lookup = el._x_lookup; + let prevKeys = el._x_prevKeys; + let scopes = []; + let keys = []; + if (isObject2(items)) { + items = Object.entries(items).map(([key, value]) => { + let scope2 = getIterationScopeVariables(iteratorNames, value, key, items); + evaluateKey((value2) => { + if (keys.includes(value2)) + warn("Duplicate key on x-for", el); + keys.push(value2); + }, { scope: { index: key, ...scope2 } }); + scopes.push(scope2); + }); + } else { + for (let i2 = 0; i2 < items.length; i2++) { + let scope2 = getIterationScopeVariables(iteratorNames, items[i2], i2, items); + evaluateKey((value) => { + if (keys.includes(value)) + warn("Duplicate key on x-for", el); + keys.push(value); + }, { scope: { index: i2, ...scope2 } }); + scopes.push(scope2); + } + } + let adds = []; + let moves = []; + let removes = []; + let sames = []; + for (let i2 = 0; i2 < prevKeys.length; i2++) { + let key = prevKeys[i2]; + if (keys.indexOf(key) === -1) + removes.push(key); + } + prevKeys = prevKeys.filter((key) => !removes.includes(key)); + let lastKey = "template"; + for (let i2 = 0; i2 < keys.length; i2++) { + let key = keys[i2]; + let prevIndex = prevKeys.indexOf(key); + if (prevIndex === -1) { + prevKeys.splice(i2, 0, key); + adds.push([lastKey, i2]); + } else if (prevIndex !== i2) { + let keyInSpot = prevKeys.splice(i2, 1)[0]; + let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0]; + prevKeys.splice(i2, 0, keyForSpot); + prevKeys.splice(prevIndex, 0, keyInSpot); + moves.push([keyInSpot, keyForSpot]); + } else { + sames.push(key); + } + lastKey = key; + } + for (let i2 = 0; i2 < removes.length; i2++) { + let key = removes[i2]; + if (!!lookup[key]._x_effects) { + lookup[key]._x_effects.forEach(dequeueJob); + } + lookup[key].remove(); + lookup[key] = null; + delete lookup[key]; + } + for (let i2 = 0; i2 < moves.length; i2++) { + let [keyInSpot, keyForSpot] = moves[i2]; + let elInSpot = lookup[keyInSpot]; + let elForSpot = lookup[keyForSpot]; + let marker = document.createElement("div"); + mutateDom(() => { + if (!elForSpot) + warn(`x-for ":key" is undefined or invalid`, templateEl, keyForSpot, lookup); + elForSpot.after(marker); + elInSpot.after(elForSpot); + elForSpot._x_currentIfEl && elForSpot.after(elForSpot._x_currentIfEl); + marker.before(elInSpot); + elInSpot._x_currentIfEl && elInSpot.after(elInSpot._x_currentIfEl); + marker.remove(); + }); + elForSpot._x_refreshXForScope(scopes[keys.indexOf(keyForSpot)]); + } + for (let i2 = 0; i2 < adds.length; i2++) { + let [lastKey2, index] = adds[i2]; + let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2]; + if (lastEl._x_currentIfEl) + lastEl = lastEl._x_currentIfEl; + let scope2 = scopes[index]; + let key = keys[index]; + let clone2 = document.importNode(templateEl.content, true).firstElementChild; + let reactiveScope = reactive(scope2); + addScopeToNode(clone2, reactiveScope, templateEl); + clone2._x_refreshXForScope = (newScope) => { + Object.entries(newScope).forEach(([key2, value]) => { + reactiveScope[key2] = value; + }); + }; + mutateDom(() => { + lastEl.after(clone2); + skipDuringClone(() => initTree(clone2))(); + }); + if (typeof key === "object") { + warn("x-for key cannot be an object, it must be a string or an integer", templateEl); + } + lookup[key] = clone2; + } + for (let i2 = 0; i2 < sames.length; i2++) { + lookup[sames[i2]]._x_refreshXForScope(scopes[keys.indexOf(sames[i2])]); + } + templateEl._x_prevKeys = keys; + }); + } + function parseForExpression(expression) { + let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; + let stripParensRE = /^\s*\(|\)\s*$/g; + let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; + let inMatch = expression.match(forAliasRE); + if (!inMatch) + return; + let res = {}; + res.items = inMatch[2].trim(); + let item = inMatch[1].replace(stripParensRE, "").trim(); + let iteratorMatch = item.match(forIteratorRE); + if (iteratorMatch) { + res.item = item.replace(forIteratorRE, "").trim(); + res.index = iteratorMatch[1].trim(); + if (iteratorMatch[2]) { + res.collection = iteratorMatch[2].trim(); + } + } else { + res.item = item; + } + return res; + } + function getIterationScopeVariables(iteratorNames, item, index, items) { + let scopeVariables = {}; + if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) { + let names = iteratorNames.item.replace("[", "").replace("]", "").split(",").map((i2) => i2.trim()); + names.forEach((name, i2) => { + scopeVariables[name] = item[i2]; + }); + } else if (/^\{.*\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === "object") { + let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i2) => i2.trim()); + names.forEach((name) => { + scopeVariables[name] = item[name]; + }); + } else { + scopeVariables[iteratorNames.item] = item; + } + if (iteratorNames.index) + scopeVariables[iteratorNames.index] = index; + if (iteratorNames.collection) + scopeVariables[iteratorNames.collection] = items; + return scopeVariables; + } + function isNumeric3(subject) { + return !Array.isArray(subject) && !isNaN(subject); + } + function handler3() { + } + handler3.inline = (el, { expression }, { cleanup }) => { + let root = closestRoot(el); + if (!root._x_refs) + root._x_refs = {}; + root._x_refs[expression] = el; + cleanup(() => delete root._x_refs[expression]); + }; + directive("ref", handler3); + directive("if", (el, { expression }, { effect: effect3, cleanup }) => { + if (el.tagName.toLowerCase() !== "template") + warn("x-if can only be used on a <template> tag", el); + let evaluate2 = evaluateLater(el, expression); + let show = () => { + if (el._x_currentIfEl) + return el._x_currentIfEl; + let clone2 = el.content.cloneNode(true).firstElementChild; + addScopeToNode(clone2, {}, el); + mutateDom(() => { + el.after(clone2); + skipDuringClone(() => initTree(clone2))(); + }); + el._x_currentIfEl = clone2; + el._x_undoIf = () => { + walk(clone2, (node) => { + if (!!node._x_effects) { + node._x_effects.forEach(dequeueJob); + } + }); + clone2.remove(); + delete el._x_currentIfEl; + }; + return clone2; + }; + let hide = () => { + if (!el._x_undoIf) + return; + el._x_undoIf(); + delete el._x_undoIf; + }; + effect3(() => evaluate2((value) => { + value ? show() : hide(); + })); + cleanup(() => el._x_undoIf && el._x_undoIf()); + }); + directive("id", (el, { expression }, { evaluate: evaluate2 }) => { + let names = evaluate2(expression); + names.forEach((name) => setIdRoot(el, name)); + }); + interceptClone((from, to) => { + if (from._x_ids) { + to._x_ids = from._x_ids; + } + }); + mapAttributes(startingWith("@", into(prefix("on:")))); + directive("on", skipDuringClone((el, { value, modifiers, expression }, { cleanup }) => { + let evaluate2 = expression ? evaluateLater(el, expression) : () => { + }; + if (el.tagName.toLowerCase() === "template") { + if (!el._x_forwardEvents) + el._x_forwardEvents = []; + if (!el._x_forwardEvents.includes(value)) + el._x_forwardEvents.push(value); + } + let removeListener = on(el, value, modifiers, (e2) => { + evaluate2(() => { + }, { scope: { "$event": e2 }, params: [e2] }); + }); + cleanup(() => removeListener()); + })); + warnMissingPluginDirective("Collapse", "collapse", "collapse"); + warnMissingPluginDirective("Intersect", "intersect", "intersect"); + warnMissingPluginDirective("Focus", "trap", "focus"); + warnMissingPluginDirective("Mask", "mask", "mask"); + function warnMissingPluginDirective(name, directiveName, slug) { + directive(directiveName, (el) => warn(`You can't use [x-${directiveName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el)); + } + alpine_default2.setEvaluator(normalEvaluator); + alpine_default2.setReactivityEngine({ reactive: import_reactivity10.reactive, effect: import_reactivity10.effect, release: import_reactivity10.stop, raw: import_reactivity10.toRaw }); + var src_default = alpine_default2; + var module_default = src_default; + } +}); + +// ../../../node_modules/@alpinejs/morph/dist/module.cjs.js +var require_module_cjs2 = __commonJS({ + "../../../node_modules/@alpinejs/morph/dist/module.cjs.js"(exports, module) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var module_exports = {}; + __export2(module_exports, { + default: () => module_default, + morph: () => src_default + }); + module.exports = __toCommonJS(module_exports); + function morph2(from, toHtml, options) { + monkeyPatchDomSetAttributeToAllowAtSymbols(); + let fromEl; + let toEl; + let key, lookahead, updating, updated, removing, removed, adding, added; + function assignOptions(options2 = {}) { + let defaultGetKey = (el) => el.getAttribute("key"); + let noop = () => { + }; + updating = options2.updating || noop; + updated = options2.updated || noop; + removing = options2.removing || noop; + removed = options2.removed || noop; + adding = options2.adding || noop; + added = options2.added || noop; + key = options2.key || defaultGetKey; + lookahead = options2.lookahead || false; + } + function patch(from2, to) { + if (differentElementNamesTypesOrKeys(from2, to)) { + return swapElements(from2, to); + } + let updateChildrenOnly = false; + if (shouldSkip(updating, from2, to, () => updateChildrenOnly = true)) + return; + if (from2.nodeType === 1 && window.Alpine) { + window.Alpine.cloneNode(from2, to); + } + if (textOrComment(to)) { + patchNodeValue(from2, to); + updated(from2, to); + return; + } + if (!updateChildrenOnly) { + patchAttributes(from2, to); + } + updated(from2, to); + patchChildren(from2, to); + } + function differentElementNamesTypesOrKeys(from2, to) { + return from2.nodeType != to.nodeType || from2.nodeName != to.nodeName || getKey(from2) != getKey(to); + } + function swapElements(from2, to) { + if (shouldSkip(removing, from2)) + return; + let toCloned = to.cloneNode(true); + if (shouldSkip(adding, toCloned)) + return; + from2.replaceWith(toCloned); + removed(from2); + added(toCloned); + } + function patchNodeValue(from2, to) { + let value = to.nodeValue; + if (from2.nodeValue !== value) { + from2.nodeValue = value; + } + } + function patchAttributes(from2, to) { + if (from2._x_transitioning) + return; + if (from2._x_isShown && !to._x_isShown) { + return; + } + if (!from2._x_isShown && to._x_isShown) { + return; + } + let domAttributes = Array.from(from2.attributes); + let toAttributes = Array.from(to.attributes); + for (let i2 = domAttributes.length - 1; i2 >= 0; i2--) { + let name = domAttributes[i2].name; + if (!to.hasAttribute(name)) { + from2.removeAttribute(name); + } + } + for (let i2 = toAttributes.length - 1; i2 >= 0; i2--) { + let name = toAttributes[i2].name; + let value = toAttributes[i2].value; + if (from2.getAttribute(name) !== value) { + from2.setAttribute(name, value); + } + } + } + function patchChildren(from2, to) { + if (from2._x_teleport) + from2 = from2._x_teleport; + if (to._x_teleport) + to = to._x_teleport; + let fromKeys = keyToMap(from2.children); + let fromKeyHoldovers = {}; + let currentTo = getFirstNode(to); + let currentFrom = getFirstNode(from2); + while (currentTo) { + seedingMatchingId(currentTo, currentFrom); + let toKey = getKey(currentTo); + let fromKey = getKey(currentFrom); + if (!currentFrom) { + if (toKey && fromKeyHoldovers[toKey]) { + let holdover = fromKeyHoldovers[toKey]; + from2.appendChild(holdover); + currentFrom = holdover; + } else { + if (!shouldSkip(adding, currentTo)) { + let clone = currentTo.cloneNode(true); + from2.appendChild(clone); + added(clone); + } + currentTo = getNextSibling(to, currentTo); + continue; + } + } + let isIf = (node) => node && node.nodeType === 8 && node.textContent === "[if BLOCK]><![endif]"; + let isEnd = (node) => node && node.nodeType === 8 && node.textContent === "[if ENDBLOCK]><![endif]"; + if (isIf(currentTo) && isIf(currentFrom)) { + let nestedIfCount = 0; + let fromBlockStart = currentFrom; + while (currentFrom) { + let next = getNextSibling(from2, currentFrom); + if (isIf(next)) { + nestedIfCount++; + } else if (isEnd(next) && nestedIfCount > 0) { + nestedIfCount--; + } else if (isEnd(next) && nestedIfCount === 0) { + currentFrom = next; + break; + } + currentFrom = next; + } + let fromBlockEnd = currentFrom; + nestedIfCount = 0; + let toBlockStart = currentTo; + while (currentTo) { + let next = getNextSibling(to, currentTo); + if (isIf(next)) { + nestedIfCount++; + } else if (isEnd(next) && nestedIfCount > 0) { + nestedIfCount--; + } else if (isEnd(next) && nestedIfCount === 0) { + currentTo = next; + break; + } + currentTo = next; + } + let toBlockEnd = currentTo; + let fromBlock = new Block(fromBlockStart, fromBlockEnd); + let toBlock = new Block(toBlockStart, toBlockEnd); + patchChildren(fromBlock, toBlock); + continue; + } + if (currentFrom.nodeType === 1 && lookahead && !currentFrom.isEqualNode(currentTo)) { + let nextToElementSibling = getNextSibling(to, currentTo); + let found = false; + while (!found && nextToElementSibling) { + if (nextToElementSibling.nodeType === 1 && currentFrom.isEqualNode(nextToElementSibling)) { + found = true; + currentFrom = addNodeBefore(from2, currentTo, currentFrom); + fromKey = getKey(currentFrom); + } + nextToElementSibling = getNextSibling(to, nextToElementSibling); + } + } + if (toKey !== fromKey) { + if (!toKey && fromKey) { + fromKeyHoldovers[fromKey] = currentFrom; + currentFrom = addNodeBefore(from2, currentTo, currentFrom); + fromKeyHoldovers[fromKey].remove(); + currentFrom = getNextSibling(from2, currentFrom); + currentTo = getNextSibling(to, currentTo); + continue; + } + if (toKey && !fromKey) { + if (fromKeys[toKey]) { + currentFrom.replaceWith(fromKeys[toKey]); + currentFrom = fromKeys[toKey]; + } + } + if (toKey && fromKey) { + let fromKeyNode = fromKeys[toKey]; + if (fromKeyNode) { + fromKeyHoldovers[fromKey] = currentFrom; + currentFrom.replaceWith(fromKeyNode); + currentFrom = fromKeyNode; + } else { + fromKeyHoldovers[fromKey] = currentFrom; + currentFrom = addNodeBefore(from2, currentTo, currentFrom); + fromKeyHoldovers[fromKey].remove(); + currentFrom = getNextSibling(from2, currentFrom); + currentTo = getNextSibling(to, currentTo); + continue; + } + } + } + let currentFromNext = currentFrom && getNextSibling(from2, currentFrom); + patch(currentFrom, currentTo); + currentTo = currentTo && getNextSibling(to, currentTo); + currentFrom = currentFromNext; + } + let removals = []; + while (currentFrom) { + if (!shouldSkip(removing, currentFrom)) + removals.push(currentFrom); + currentFrom = getNextSibling(from2, currentFrom); + } + while (removals.length) { + let domForRemoval = removals.shift(); + domForRemoval.remove(); + removed(domForRemoval); + } + } + function getKey(el) { + return el && el.nodeType === 1 && key(el); + } + function keyToMap(els) { + let map = {}; + for (let el of els) { + let theKey = getKey(el); + if (theKey) { + map[theKey] = el; + } + } + return map; + } + function addNodeBefore(parent, node, beforeMe) { + if (!shouldSkip(adding, node)) { + let clone = node.cloneNode(true); + parent.insertBefore(clone, beforeMe); + added(clone); + return clone; + } + return node; + } + assignOptions(options); + fromEl = from; + toEl = typeof toHtml === "string" ? createElement(toHtml) : toHtml; + if (window.Alpine && window.Alpine.closestDataStack && !from._x_dataStack) { + toEl._x_dataStack = window.Alpine.closestDataStack(from); + toEl._x_dataStack && window.Alpine.cloneNode(from, toEl); + } + patch(from, toEl); + fromEl = void 0; + toEl = void 0; + return from; + } + morph2.step = () => { + }; + morph2.log = () => { + }; + function shouldSkip(hook, ...args) { + let skip = false; + hook(...args, () => skip = true); + return skip; + } + var patched = false; + function createElement(html) { + const template = document.createElement("template"); + template.innerHTML = html; + return template.content.firstElementChild; + } + function textOrComment(el) { + return el.nodeType === 3 || el.nodeType === 8; + } + var Block = class { + constructor(start, end) { + this.startComment = start; + this.endComment = end; + } + get children() { + let children = []; + let currentNode = this.startComment.nextSibling; + while (currentNode && currentNode !== this.endComment) { + children.push(currentNode); + currentNode = currentNode.nextSibling; + } + return children; + } + appendChild(child) { + this.endComment.before(child); + } + get firstChild() { + let first = this.startComment.nextSibling; + if (first === this.endComment) + return; + return first; + } + nextNode(reference) { + let next = reference.nextSibling; + if (next === this.endComment) + return; + return next; + } + insertBefore(newNode, reference) { + reference.before(newNode); + return newNode; + } + }; + function getFirstNode(parent) { + return parent.firstChild; + } + function getNextSibling(parent, reference) { + let next; + if (parent instanceof Block) { + next = parent.nextNode(reference); + } else { + next = reference.nextSibling; + } + return next; + } + function monkeyPatchDomSetAttributeToAllowAtSymbols() { + if (patched) + return; + patched = true; + let original = Element.prototype.setAttribute; + let hostDiv = document.createElement("div"); + Element.prototype.setAttribute = function newSetAttribute(name, value) { + if (!name.includes("@")) { + return original.call(this, name, value); + } + hostDiv.innerHTML = `<span ${name}="${value}"></span>`; + let attr = hostDiv.firstElementChild.getAttributeNode(name); + hostDiv.firstElementChild.removeAttributeNode(attr); + this.setAttributeNode(attr); + }; + } + function seedingMatchingId(to, from) { + let fromId = from && from._x_bindings && from._x_bindings.id; + if (!fromId) + return; + to.setAttribute("id", fromId); + to.id = fromId; + } + function src_default(Alpine3) { + Alpine3.morph = morph2; + } + var module_default = src_default; + } +}); + +// ../../../node_modules/@alpinejs/mask/dist/module.cjs.js +var require_module_cjs3 = __commonJS({ + "../../../node_modules/@alpinejs/mask/dist/module.cjs.js"(exports, module) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var module_exports = {}; + __export2(module_exports, { + default: () => module_default, + mask: () => src_default, + stripDown: () => stripDown + }); + module.exports = __toCommonJS(module_exports); + function src_default(Alpine3) { + Alpine3.directive("mask", (el, { value, expression }, { effect, evaluateLater, cleanup }) => { + let templateFn = () => expression; + let lastInputValue = ""; + queueMicrotask(() => { + if (["function", "dynamic"].includes(value)) { + let evaluator = evaluateLater(expression); + effect(() => { + templateFn = (input) => { + let result; + Alpine3.dontAutoEvaluateFunctions(() => { + evaluator((value2) => { + result = typeof value2 === "function" ? value2(input) : value2; + }, { scope: { + // These are "magics" we'll make available to the x-mask:function: + "$input": input, + "$money": formatMoney.bind({ el }) + } }); + }); + return result; + }; + processInputValue(el, false); + }); + } else { + processInputValue(el, false); + } + if (el._x_model) + el._x_model.set(el.value); + }); + const controller = new AbortController(); + cleanup(() => { + controller.abort(); + }); + el.addEventListener("input", () => processInputValue(el), { + signal: controller.signal, + // Setting this as a capture phase listener to ensure it runs + // before wire:model or x-model added as a latent binding... + capture: true + }); + el.addEventListener("blur", () => processInputValue(el, false), { signal: controller.signal }); + function processInputValue(el2, shouldRestoreCursor = true) { + let input = el2.value; + let template = templateFn(input); + if (!template || template === "false") + return false; + if (lastInputValue.length - el2.value.length === 1) { + return lastInputValue = el2.value; + } + let setInput = () => { + lastInputValue = el2.value = formatInput(input, template); + }; + if (shouldRestoreCursor) { + restoreCursorPosition(el2, template, () => { + setInput(); + }); + } else { + setInput(); + } + } + function formatInput(input, template) { + if (input === "") + return ""; + let strippedDownInput = stripDown(template, input); + let rebuiltInput = buildUp(template, strippedDownInput); + return rebuiltInput; + } + }).before("model"); + } + function restoreCursorPosition(el, template, callback) { + let cursorPosition = el.selectionStart; + let unformattedValue = el.value; + callback(); + let beforeLeftOfCursorBeforeFormatting = unformattedValue.slice(0, cursorPosition); + let newPosition = buildUp( + template, + stripDown( + template, + beforeLeftOfCursorBeforeFormatting + ) + ).length; + el.setSelectionRange(newPosition, newPosition); + } + function stripDown(template, input) { + let inputToBeStripped = input; + let output = ""; + let regexes = { + "9": /[0-9]/, + "a": /[a-zA-Z]/, + "*": /[a-zA-Z0-9]/ + }; + let wildcardTemplate = ""; + for (let i2 = 0; i2 < template.length; i2++) { + if (["9", "a", "*"].includes(template[i2])) { + wildcardTemplate += template[i2]; + continue; + } + for (let j2 = 0; j2 < inputToBeStripped.length; j2++) { + if (inputToBeStripped[j2] === template[i2]) { + inputToBeStripped = inputToBeStripped.slice(0, j2) + inputToBeStripped.slice(j2 + 1); + break; + } + } + } + for (let i2 = 0; i2 < wildcardTemplate.length; i2++) { + let found = false; + for (let j2 = 0; j2 < inputToBeStripped.length; j2++) { + if (regexes[wildcardTemplate[i2]].test(inputToBeStripped[j2])) { + output += inputToBeStripped[j2]; + inputToBeStripped = inputToBeStripped.slice(0, j2) + inputToBeStripped.slice(j2 + 1); + found = true; + break; + } + } + if (!found) + break; + } + return output; + } + function buildUp(template, input) { + let clean = Array.from(input); + let output = ""; + for (let i2 = 0; i2 < template.length; i2++) { + if (!["9", "a", "*"].includes(template[i2])) { + output += template[i2]; + continue; + } + if (clean.length === 0) + break; + output += clean.shift(); + } + return output; + } + function formatMoney(input, delimiter = ".", thousands, precision = 2) { + if (input === "-") + return "-"; + if (/^\D+$/.test(input)) + return "9"; + if (thousands === null || thousands === void 0) { + thousands = delimiter === "," ? "." : ","; + } + let addThousands = (input2, thousands2) => { + let output = ""; + let counter = 0; + for (let i2 = input2.length - 1; i2 >= 0; i2--) { + if (input2[i2] === thousands2) + continue; + if (counter === 3) { + output = input2[i2] + thousands2 + output; + counter = 0; + } else { + output = input2[i2] + output; + } + counter++; + } + return output; + }; + let minus = input.startsWith("-") ? "-" : ""; + let strippedInput = input.replaceAll(new RegExp(`[^0-9\\${delimiter}]`, "g"), ""); + let template = Array.from({ length: strippedInput.split(delimiter)[0].length }).fill("9").join(""); + template = `${minus}${addThousands(template, thousands)}`; + if (precision > 0 && input.includes(delimiter)) + template += `${delimiter}` + "9".repeat(precision); + queueMicrotask(() => { + if (this.el.value.endsWith(delimiter)) + return; + if (this.el.value[this.el.selectionStart - 1] === delimiter) { + this.el.setSelectionRange(this.el.selectionStart - 1, this.el.selectionStart - 1); + } + }); + return template; + } + var module_default = src_default; + } +}); + +// ../../../node_modules/@alpinejs/focus/dist/module.cjs.js +var require_module_cjs4 = __commonJS({ + "../../../node_modules/@alpinejs/focus/dist/module.cjs.js"(exports, module) { + var __create2 = Object.create; + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __getProtoOf2 = Object.getPrototypeOf; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __commonJS2 = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var require_dist = __commonJS2({ + "node_modules/tabbable/dist/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"]; + var candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); + var NoElement = typeof Element === "undefined"; + var matches = NoElement ? function() { + } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + return element.getRootNode(); + } : function(element) { + return element.ownerDocument; + }; + var getCandidates = function getCandidates2(el, includeContainer, filter) { + var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector)); + if (includeContainer && matches.call(el, candidateSelector)) { + candidates.unshift(el); + } + candidates = candidates.filter(filter); + return candidates; + }; + var getCandidatesIteratively = function getCandidatesIteratively2(elements, includeContainer, options) { + var candidates = []; + var elementsToCheck = Array.from(elements); + while (elementsToCheck.length) { + var element = elementsToCheck.shift(); + if (element.tagName === "SLOT") { + var assigned = element.assignedElements(); + var content = assigned.length ? assigned : element.children; + var nestedCandidates = getCandidatesIteratively2(content, true, options); + if (options.flatten) { + candidates.push.apply(candidates, nestedCandidates); + } else { + candidates.push({ + scope: element, + candidates: nestedCandidates + }); + } + } else { + var validCandidate = matches.call(element, candidateSelector); + if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) { + candidates.push(element); + } + var shadowRoot = element.shadowRoot || // check for an undisclosed shadow + typeof options.getShadowRoot === "function" && options.getShadowRoot(element); + var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element); + if (shadowRoot && validShadowRoot) { + var _nestedCandidates = getCandidatesIteratively2(shadowRoot === true ? element.children : shadowRoot.children, true, options); + if (options.flatten) { + candidates.push.apply(candidates, _nestedCandidates); + } else { + candidates.push({ + scope: element, + candidates: _nestedCandidates + }); + } + } else { + elementsToCheck.unshift.apply(elementsToCheck, element.children); + } + } + } + return candidates; + }; + var getTabindex = function getTabindex2(node, isScope) { + if (node.tabIndex < 0) { + if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) { + return 0; + } + } + return node.tabIndex; + }; + var sortOrderedTabbables = function sortOrderedTabbables2(a2, b2) { + return a2.tabIndex === b2.tabIndex ? a2.documentOrder - b2.documentOrder : a2.tabIndex - b2.tabIndex; + }; + var isInput = function isInput2(node) { + return node.tagName === "INPUT"; + }; + var isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; + }; + var isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r2 = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; + }); + return r2; + }; + var getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i2 = 0; i2 < nodes.length; i2++) { + if (nodes[i2].checked && nodes[i2].form === form) { + return nodes[i2]; + } + } + }; + var isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; + } + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message); + return false; + } + } + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; + }; + var isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; + }; + var isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); + }; + var isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; + }; + var isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot = _ref.getShadowRoot; + if (getComputedStyle(node).visibility === "hidden") { + return true; + } + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; + } + var nodeRootHost = getRootNode(node).host; + var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node); + if (!displayCheck || displayCheck === "full") { + if (typeof getShadowRoot === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } + } + node = originalNode; + } + if (nodeIsAttached) { + return !node.getClientRects().length; + } + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); + } + return false; + }; + var isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i2 = 0; i2 < parentNode.children.length; i2++) { + var child = parentNode.children.item(i2); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; + } + parentNode = parentNode.parentElement; + } + } + return false; + }; + var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; + } + return true; + }; + var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; + } + return true; + }; + var isValidShadowRootTabbable = function isValidShadowRootTabbable2(shadowHostNode) { + var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10); + if (isNaN(tabIndex) || tabIndex >= 0) { + return true; + } + return false; + }; + var sortByOrder = function sortByOrder2(candidates) { + var regularTabbables = []; + var orderedTabbables = []; + candidates.forEach(function(item, i2) { + var isScope = !!item.scope; + var element = isScope ? item.scope : item; + var candidateTabindex = getTabindex(element, isScope); + var elements = isScope ? sortByOrder2(item.candidates) : element; + if (candidateTabindex === 0) { + isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element); + } else { + orderedTabbables.push({ + documentOrder: i2, + tabIndex: candidateTabindex, + item, + isScope, + content: elements + }); + } + }); + return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) { + sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content); + return acc; + }, []).concat(regularTabbables); + }; + var tabbable = function tabbable2(el, options) { + options = options || {}; + var candidates; + if (options.getShadowRoot) { + candidates = getCandidatesIteratively([el], options.includeContainer, { + filter: isNodeMatchingSelectorTabbable.bind(null, options), + flatten: false, + getShadowRoot: options.getShadowRoot, + shadowRootFilter: isValidShadowRootTabbable + }); + } else { + candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options)); + } + return sortByOrder(candidates); + }; + var focusable2 = function focusable3(el, options) { + options = options || {}; + var candidates; + if (options.getShadowRoot) { + candidates = getCandidatesIteratively([el], options.includeContainer, { + filter: isNodeMatchingSelectorFocusable.bind(null, options), + flatten: true, + getShadowRoot: options.getShadowRoot + }); + } else { + candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options)); + } + return candidates; + }; + var isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, candidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorTabbable(options, node); + }; + var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","); + var isFocusable2 = function isFocusable3(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, focusableCandidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorFocusable(options, node); + }; + exports2.focusable = focusable2; + exports2.isFocusable = isFocusable2; + exports2.isTabbable = isTabbable; + exports2.tabbable = tabbable; + } + }); + var require_focus_trap = __commonJS2({ + "node_modules/focus-trap/dist/focus-trap.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tabbable = require_dist(); + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread2(target) { + for (var i2 = 1; i2 < arguments.length; i2++) { + var source = null != arguments[i2] ? arguments[i2] : {}; + i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + var activeFocusTraps = /* @__PURE__ */ function() { + var trapQueue = []; + return { + activateTrap: function activateTrap(trap) { + if (trapQueue.length > 0) { + var activeTrap = trapQueue[trapQueue.length - 1]; + if (activeTrap !== trap) { + activeTrap.pause(); + } + } + var trapIndex = trapQueue.indexOf(trap); + if (trapIndex === -1) { + trapQueue.push(trap); + } else { + trapQueue.splice(trapIndex, 1); + trapQueue.push(trap); + } + }, + deactivateTrap: function deactivateTrap(trap) { + var trapIndex = trapQueue.indexOf(trap); + if (trapIndex !== -1) { + trapQueue.splice(trapIndex, 1); + } + if (trapQueue.length > 0) { + trapQueue[trapQueue.length - 1].unpause(); + } + } + }; + }(); + var isSelectableInput = function isSelectableInput2(node) { + return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function"; + }; + var isEscapeEvent = function isEscapeEvent2(e2) { + return e2.key === "Escape" || e2.key === "Esc" || e2.keyCode === 27; + }; + var isTabEvent = function isTabEvent2(e2) { + return e2.key === "Tab" || e2.keyCode === 9; + }; + var delay = function delay2(fn) { + return setTimeout(fn, 0); + }; + var findIndex = function findIndex2(arr, fn) { + var idx = -1; + arr.every(function(value, i2) { + if (fn(value)) { + idx = i2; + return false; + } + return true; + }); + return idx; + }; + var valueOrHandler = function valueOrHandler2(value) { + for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + params[_key - 1] = arguments[_key]; + } + return typeof value === "function" ? value.apply(void 0, params) : value; + }; + var getActualTarget = function getActualTarget2(event) { + return event.target.shadowRoot && typeof event.composedPath === "function" ? event.composedPath()[0] : event.target; + }; + var createFocusTrap2 = function createFocusTrap3(elements, userOptions) { + var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document; + var config = _objectSpread2({ + returnFocusOnDeactivate: true, + escapeDeactivates: true, + delayInitialFocus: true + }, userOptions); + var state = { + // containers given to createFocusTrap() + // @type {Array<HTMLElement>} + containers: [], + // list of objects identifying tabbable nodes in `containers` in the trap + // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap + // is active, but the trap should never get to a state where there isn't at least one group + // with at least one tabbable node in it (that would lead to an error condition that would + // result in an error being thrown) + // @type {Array<{ + // container: HTMLElement, + // tabbableNodes: Array<HTMLElement>, // empty if none + // focusableNodes: Array<HTMLElement>, // empty if none + // firstTabbableNode: HTMLElement|null, + // lastTabbableNode: HTMLElement|null, + // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined + // }>} + containerGroups: [], + // same order/length as `containers` list + // references to objects in `containerGroups`, but only those that actually have + // tabbable nodes in them + // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__ + // the same length + tabbableGroups: [], + nodeFocusedBeforeActivation: null, + mostRecentlyFocusedNode: null, + active: false, + paused: false, + // timer ID for when delayInitialFocus is true and initial focus in this trap + // has been delayed during activation + delayInitialFocusTimer: void 0 + }; + var trap; + var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) { + return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config[configOptionName || optionName]; + }; + var findContainerIndex = function findContainerIndex2(element) { + return state.containerGroups.findIndex(function(_ref) { + var container = _ref.container, tabbableNodes = _ref.tabbableNodes; + return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any + // web components if the `tabbableOptions.getShadowRoot` option was used for + // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't + // look inside web components even if open) + tabbableNodes.find(function(node) { + return node === element; + }); + }); + }; + var getNodeForOption = function getNodeForOption2(optionName) { + var optionValue = config[optionName]; + if (typeof optionValue === "function") { + for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + params[_key2 - 1] = arguments[_key2]; + } + optionValue = optionValue.apply(void 0, params); + } + if (optionValue === true) { + optionValue = void 0; + } + if (!optionValue) { + if (optionValue === void 0 || optionValue === false) { + return optionValue; + } + throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node")); + } + var node = optionValue; + if (typeof optionValue === "string") { + node = doc.querySelector(optionValue); + if (!node) { + throw new Error("`".concat(optionName, "` as selector refers to no known node")); + } + } + return node; + }; + var getInitialFocusNode = function getInitialFocusNode2() { + var node = getNodeForOption("initialFocus"); + if (node === false) { + return false; + } + if (node === void 0) { + if (findContainerIndex(doc.activeElement) >= 0) { + node = doc.activeElement; + } else { + var firstTabbableGroup = state.tabbableGroups[0]; + var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; + node = firstTabbableNode || getNodeForOption("fallbackFocus"); + } + } + if (!node) { + throw new Error("Your focus-trap needs to have at least one focusable element"); + } + return node; + }; + var updateTabbableNodes = function updateTabbableNodes2() { + state.containerGroups = state.containers.map(function(container) { + var tabbableNodes = tabbable.tabbable(container, config.tabbableOptions); + var focusableNodes = tabbable.focusable(container, config.tabbableOptions); + return { + container, + tabbableNodes, + focusableNodes, + firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null, + lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null, + /** + * Finds the __tabbable__ node that follows the given node in the specified direction, + * in this container, if any. + * @param {HTMLElement} node + * @param {boolean} [forward] True if going in forward tab order; false if going + * in reverse. + * @returns {HTMLElement|undefined} The next tabbable node, if any. + */ + nextTabbableNode: function nextTabbableNode(node) { + var forward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + var nodeIdx = focusableNodes.findIndex(function(n2) { + return n2 === node; + }); + if (nodeIdx < 0) { + return void 0; + } + if (forward) { + return focusableNodes.slice(nodeIdx + 1).find(function(n2) { + return tabbable.isTabbable(n2, config.tabbableOptions); + }); + } + return focusableNodes.slice(0, nodeIdx).reverse().find(function(n2) { + return tabbable.isTabbable(n2, config.tabbableOptions); + }); + } + }; + }); + state.tabbableGroups = state.containerGroups.filter(function(group) { + return group.tabbableNodes.length > 0; + }); + if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) { + throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times"); + } + }; + var tryFocus = function tryFocus2(node) { + if (node === false) { + return; + } + if (node === doc.activeElement) { + return; + } + if (!node || !node.focus) { + tryFocus2(getInitialFocusNode()); + return; + } + node.focus({ + preventScroll: !!config.preventScroll + }); + state.mostRecentlyFocusedNode = node; + if (isSelectableInput(node)) { + node.select(); + } + }; + var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) { + var node = getNodeForOption("setReturnFocus", previousActiveElement); + return node ? node : node === false ? false : previousActiveElement; + }; + var checkPointerDown = function checkPointerDown2(e2) { + var target = getActualTarget(e2); + if (findContainerIndex(target) >= 0) { + return; + } + if (valueOrHandler(config.clickOutsideDeactivates, e2)) { + trap.deactivate({ + // if, on deactivation, we should return focus to the node originally-focused + // when the trap was activated (or the configured `setReturnFocus` node), + // then assume it's also OK to return focus to the outside node that was + // just clicked, causing deactivation, as long as that node is focusable; + // if it isn't focusable, then return focus to the original node focused + // on activation (or the configured `setReturnFocus` node) + // NOTE: by setting `returnFocus: false`, deactivate() will do nothing, + // which will result in the outside click setting focus to the node + // that was clicked, whether it's focusable or not; by setting + // `returnFocus: true`, we'll attempt to re-focus the node originally-focused + // on activation (or the configured `setReturnFocus` node) + returnFocus: config.returnFocusOnDeactivate && !tabbable.isFocusable(target, config.tabbableOptions) + }); + return; + } + if (valueOrHandler(config.allowOutsideClick, e2)) { + return; + } + e2.preventDefault(); + }; + var checkFocusIn = function checkFocusIn2(e2) { + var target = getActualTarget(e2); + var targetContained = findContainerIndex(target) >= 0; + if (targetContained || target instanceof Document) { + if (targetContained) { + state.mostRecentlyFocusedNode = target; + } + } else { + e2.stopImmediatePropagation(); + tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode()); + } + }; + var checkTab = function checkTab2(e2) { + var target = getActualTarget(e2); + updateTabbableNodes(); + var destinationNode = null; + if (state.tabbableGroups.length > 0) { + var containerIndex = findContainerIndex(target); + var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : void 0; + if (containerIndex < 0) { + if (e2.shiftKey) { + destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode; + } else { + destinationNode = state.tabbableGroups[0].firstTabbableNode; + } + } else if (e2.shiftKey) { + var startOfGroupIndex = findIndex(state.tabbableGroups, function(_ref2) { + var firstTabbableNode = _ref2.firstTabbableNode; + return target === firstTabbableNode; + }); + if (startOfGroupIndex < 0 && (containerGroup.container === target || tabbable.isFocusable(target, config.tabbableOptions) && !tabbable.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) { + startOfGroupIndex = containerIndex; + } + if (startOfGroupIndex >= 0) { + var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1; + var destinationGroup = state.tabbableGroups[destinationGroupIndex]; + destinationNode = destinationGroup.lastTabbableNode; + } + } else { + var lastOfGroupIndex = findIndex(state.tabbableGroups, function(_ref3) { + var lastTabbableNode = _ref3.lastTabbableNode; + return target === lastTabbableNode; + }); + if (lastOfGroupIndex < 0 && (containerGroup.container === target || tabbable.isFocusable(target, config.tabbableOptions) && !tabbable.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) { + lastOfGroupIndex = containerIndex; + } + if (lastOfGroupIndex >= 0) { + var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1; + var _destinationGroup = state.tabbableGroups[_destinationGroupIndex]; + destinationNode = _destinationGroup.firstTabbableNode; + } + } + } else { + destinationNode = getNodeForOption("fallbackFocus"); + } + if (destinationNode) { + e2.preventDefault(); + tryFocus(destinationNode); + } + }; + var checkKey = function checkKey2(e2) { + if (isEscapeEvent(e2) && valueOrHandler(config.escapeDeactivates, e2) !== false) { + e2.preventDefault(); + trap.deactivate(); + return; + } + if (isTabEvent(e2)) { + checkTab(e2); + return; + } + }; + var checkClick = function checkClick2(e2) { + var target = getActualTarget(e2); + if (findContainerIndex(target) >= 0) { + return; + } + if (valueOrHandler(config.clickOutsideDeactivates, e2)) { + return; + } + if (valueOrHandler(config.allowOutsideClick, e2)) { + return; + } + e2.preventDefault(); + e2.stopImmediatePropagation(); + }; + var addListeners = function addListeners2() { + if (!state.active) { + return; + } + activeFocusTraps.activateTrap(trap); + state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function() { + tryFocus(getInitialFocusNode()); + }) : tryFocus(getInitialFocusNode()); + doc.addEventListener("focusin", checkFocusIn, true); + doc.addEventListener("mousedown", checkPointerDown, { + capture: true, + passive: false + }); + doc.addEventListener("touchstart", checkPointerDown, { + capture: true, + passive: false + }); + doc.addEventListener("click", checkClick, { + capture: true, + passive: false + }); + doc.addEventListener("keydown", checkKey, { + capture: true, + passive: false + }); + return trap; + }; + var removeListeners = function removeListeners2() { + if (!state.active) { + return; + } + doc.removeEventListener("focusin", checkFocusIn, true); + doc.removeEventListener("mousedown", checkPointerDown, true); + doc.removeEventListener("touchstart", checkPointerDown, true); + doc.removeEventListener("click", checkClick, true); + doc.removeEventListener("keydown", checkKey, true); + return trap; + }; + trap = { + get active() { + return state.active; + }, + get paused() { + return state.paused; + }, + activate: function activate(activateOptions) { + if (state.active) { + return this; + } + var onActivate = getOption(activateOptions, "onActivate"); + var onPostActivate = getOption(activateOptions, "onPostActivate"); + var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap"); + if (!checkCanFocusTrap) { + updateTabbableNodes(); + } + state.active = true; + state.paused = false; + state.nodeFocusedBeforeActivation = doc.activeElement; + if (onActivate) { + onActivate(); + } + var finishActivation = function finishActivation2() { + if (checkCanFocusTrap) { + updateTabbableNodes(); + } + addListeners(); + if (onPostActivate) { + onPostActivate(); + } + }; + if (checkCanFocusTrap) { + checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation); + return this; + } + finishActivation(); + return this; + }, + deactivate: function deactivate(deactivateOptions) { + if (!state.active) { + return this; + } + var options = _objectSpread2({ + onDeactivate: config.onDeactivate, + onPostDeactivate: config.onPostDeactivate, + checkCanReturnFocus: config.checkCanReturnFocus + }, deactivateOptions); + clearTimeout(state.delayInitialFocusTimer); + state.delayInitialFocusTimer = void 0; + removeListeners(); + state.active = false; + state.paused = false; + activeFocusTraps.deactivateTrap(trap); + var onDeactivate = getOption(options, "onDeactivate"); + var onPostDeactivate = getOption(options, "onPostDeactivate"); + var checkCanReturnFocus = getOption(options, "checkCanReturnFocus"); + var returnFocus = getOption(options, "returnFocus", "returnFocusOnDeactivate"); + if (onDeactivate) { + onDeactivate(); + } + var finishDeactivation = function finishDeactivation2() { + delay(function() { + if (returnFocus) { + tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)); + } + if (onPostDeactivate) { + onPostDeactivate(); + } + }); + }; + if (returnFocus && checkCanReturnFocus) { + checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation); + return this; + } + finishDeactivation(); + return this; + }, + pause: function pause() { + if (state.paused || !state.active) { + return this; + } + state.paused = true; + removeListeners(); + return this; + }, + unpause: function unpause() { + if (!state.paused || !state.active) { + return this; + } + state.paused = false; + updateTabbableNodes(); + addListeners(); + return this; + }, + updateContainerElements: function updateContainerElements(containerElements) { + var elementsAsArray = [].concat(containerElements).filter(Boolean); + state.containers = elementsAsArray.map(function(element) { + return typeof element === "string" ? doc.querySelector(element) : element; + }); + if (state.active) { + updateTabbableNodes(); + } + return this; + } + }; + trap.updateContainerElements(elements); + return trap; + }; + exports2.createFocusTrap = createFocusTrap2; + } + }); + var module_exports = {}; + __export2(module_exports, { + default: () => module_default + }); + module.exports = __toCommonJS(module_exports); + var import_focus_trap = __toESM2(require_focus_trap()); + var import_tabbable = __toESM2(require_dist()); + function src_default(Alpine3) { + let lastFocused; + let currentFocused; + window.addEventListener("focusin", () => { + lastFocused = currentFocused; + currentFocused = document.activeElement; + }); + Alpine3.magic("focus", (el) => { + let within = el; + return { + __noscroll: false, + __wrapAround: false, + within(el2) { + within = el2; + return this; + }, + withoutScrolling() { + this.__noscroll = true; + return this; + }, + noscroll() { + this.__noscroll = true; + return this; + }, + withWrapAround() { + this.__wrapAround = true; + return this; + }, + wrap() { + return this.withWrapAround(); + }, + focusable(el2) { + return (0, import_tabbable.isFocusable)(el2); + }, + previouslyFocused() { + return lastFocused; + }, + lastFocused() { + return lastFocused; + }, + focused() { + return currentFocused; + }, + focusables() { + if (Array.isArray(within)) + return within; + return (0, import_tabbable.focusable)(within, { displayCheck: "none" }); + }, + all() { + return this.focusables(); + }, + isFirst(el2) { + let els = this.all(); + return els[0] && els[0].isSameNode(el2); + }, + isLast(el2) { + let els = this.all(); + return els.length && els.slice(-1)[0].isSameNode(el2); + }, + getFirst() { + return this.all()[0]; + }, + getLast() { + return this.all().slice(-1)[0]; + }, + getNext() { + let list = this.all(); + let current = document.activeElement; + if (list.indexOf(current) === -1) + return; + if (this.__wrapAround && list.indexOf(current) === list.length - 1) { + return list[0]; + } + return list[list.indexOf(current) + 1]; + }, + getPrevious() { + let list = this.all(); + let current = document.activeElement; + if (list.indexOf(current) === -1) + return; + if (this.__wrapAround && list.indexOf(current) === 0) { + return list.slice(-1)[0]; + } + return list[list.indexOf(current) - 1]; + }, + first() { + this.focus(this.getFirst()); + }, + last() { + this.focus(this.getLast()); + }, + next() { + this.focus(this.getNext()); + }, + previous() { + this.focus(this.getPrevious()); + }, + prev() { + return this.previous(); + }, + focus(el2) { + if (!el2) + return; + setTimeout(() => { + if (!el2.hasAttribute("tabindex")) + el2.setAttribute("tabindex", "0"); + el2.focus({ preventScroll: this._noscroll }); + }); + } + }; + }); + Alpine3.directive("trap", Alpine3.skipDuringClone( + (el, { expression, modifiers }, { effect, evaluateLater, cleanup }) => { + let evaluator = evaluateLater(expression); + let oldValue = false; + let options = { + escapeDeactivates: false, + allowOutsideClick: true, + fallbackFocus: () => el + }; + let autofocusEl = el.querySelector("[autofocus]"); + if (autofocusEl) + options.initialFocus = autofocusEl; + let trap = (0, import_focus_trap.createFocusTrap)(el, options); + let undoInert = () => { + }; + let undoDisableScrolling = () => { + }; + const releaseFocus = () => { + undoInert(); + undoInert = () => { + }; + undoDisableScrolling(); + undoDisableScrolling = () => { + }; + trap.deactivate({ + returnFocus: !modifiers.includes("noreturn") + }); + }; + effect(() => evaluator((value) => { + if (oldValue === value) + return; + if (value && !oldValue) { + if (modifiers.includes("noscroll")) + undoDisableScrolling = disableScrolling(); + if (modifiers.includes("inert")) + undoInert = setInert(el); + setTimeout(() => { + trap.activate(); + }, 15); + } + if (!value && oldValue) { + releaseFocus(); + } + oldValue = !!value; + })); + cleanup(releaseFocus); + }, + // When cloning, we only want to add aria-hidden attributes to the + // DOM and not try to actually trap, as trapping can mess with the + // live DOM and isn't just isolated to the cloned DOM. + (el, { expression, modifiers }, { evaluate }) => { + if (modifiers.includes("inert") && evaluate(expression)) + setInert(el); + } + )); + } + function setInert(el) { + let undos = []; + crawlSiblingsUp(el, (sibling) => { + let cache = sibling.hasAttribute("aria-hidden"); + sibling.setAttribute("aria-hidden", "true"); + undos.push(() => cache || sibling.removeAttribute("aria-hidden")); + }); + return () => { + while (undos.length) + undos.pop()(); + }; + } + function crawlSiblingsUp(el, callback) { + if (el.isSameNode(document.body) || !el.parentNode) + return; + Array.from(el.parentNode.children).forEach((sibling) => { + if (sibling.isSameNode(el)) { + crawlSiblingsUp(el.parentNode, callback); + } else { + callback(sibling); + } + }); + } + function disableScrolling() { + let overflow = document.documentElement.style.overflow; + let paddingRight = document.documentElement.style.paddingRight; + let scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; + document.documentElement.style.overflow = "hidden"; + document.documentElement.style.paddingRight = `${scrollbarWidth}px`; + return () => { + document.documentElement.style.overflow = overflow; + document.documentElement.style.paddingRight = paddingRight; + }; + } + var module_default = src_default; + } +}); + // ../../../config/tokens.js var require_tokens = __commonJS({ "../../../config/tokens.js"(exports, module) { var colors = { transparent: "transparent", @@ -271,13 +11572,3074 @@ } }; } }); -// base/polyfills.js -import "container-query-polyfill"; +// ../../../node_modules/@jaames/iro/dist/iro.js +var require_iro = __commonJS({ + "../../../node_modules/@jaames/iro/dist/iro.js"(exports, module) { + (function(global2, factory) { + typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = global2 || self, global2.iro = factory()); + })(exports, function() { + "use strict"; + var n2, u2, t2, i2, r2, o2, f2 = {}, e2 = [], c2 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i; + function s2(n3, l2) { + for (var u3 in l2) { + n3[u3] = l2[u3]; + } + return n3; + } + function a2(n3) { + var l2 = n3.parentNode; + l2 && l2.removeChild(n3); + } + function h2(n3, l2, u3) { + var t3, i3, r3, o3, f3 = arguments; + if (l2 = s2({}, l2), arguments.length > 3) { + for (u3 = [u3], t3 = 3; t3 < arguments.length; t3++) { + u3.push(f3[t3]); + } + } + if (null != u3 && (l2.children = u3), null != n3 && null != n3.defaultProps) { + for (i3 in n3.defaultProps) { + void 0 === l2[i3] && (l2[i3] = n3.defaultProps[i3]); + } + } + return o3 = l2.key, null != (r3 = l2.ref) && delete l2.ref, null != o3 && delete l2.key, v2(n3, l2, o3, r3); + } + function v2(l2, u3, t3, i3) { + var r3 = { type: l2, props: u3, key: t3, ref: i3, __k: null, __p: null, __b: 0, __e: null, l: null, __c: null, constructor: void 0 }; + return n2.vnode && n2.vnode(r3), r3; + } + function d2(n3) { + return n3.children; + } + function y2(n3) { + if (null == n3 || "boolean" == typeof n3) { + return null; + } + if ("string" == typeof n3 || "number" == typeof n3) { + return v2(null, n3, null, null); + } + if (null != n3.__e || null != n3.__c) { + var l2 = v2(n3.type, n3.props, n3.key, null); + return l2.__e = n3.__e, l2; + } + return n3; + } + function m2(n3, l2) { + this.props = n3, this.context = l2; + } + function w2(n3, l2) { + if (null == l2) { + return n3.__p ? w2(n3.__p, n3.__p.__k.indexOf(n3) + 1) : null; + } + for (var u3; l2 < n3.__k.length; l2++) { + if (null != (u3 = n3.__k[l2]) && null != u3.__e) { + return u3.__e; + } + } + return "function" == typeof n3.type ? w2(n3) : null; + } + function g2(n3) { + var l2, u3; + if (null != (n3 = n3.__p) && null != n3.__c) { + for (n3.__e = n3.__c.base = null, l2 = 0; l2 < n3.__k.length; l2++) { + if (null != (u3 = n3.__k[l2]) && null != u3.__e) { + n3.__e = n3.__c.base = u3.__e; + break; + } + } + return g2(n3); + } + } + function k2(l2) { + (!l2.__d && (l2.__d = true) && 1 === u2.push(l2) || i2 !== n2.debounceRendering) && (i2 = n2.debounceRendering, (n2.debounceRendering || t2)(_2)); + } + function _2() { + var n3, l2, t3, i3, r3, o3, f3, e3; + for (u2.sort(function(n4, l3) { + return l3.__v.__b - n4.__v.__b; + }); n3 = u2.pop(); ) { + n3.__d && (t3 = void 0, i3 = void 0, o3 = (r3 = (l2 = n3).__v).__e, f3 = l2.__P, e3 = l2.u, l2.u = false, f3 && (t3 = [], i3 = $2(f3, r3, s2({}, r3), l2.__n, void 0 !== f3.ownerSVGElement, null, t3, e3, null == o3 ? w2(r3) : o3), j2(t3, r3), i3 != o3 && g2(r3))); + } + } + function b2(n3, l2, u3, t3, i3, r3, o3, c3, s3) { + var h3, v3, p2, d3, y3, m3, g3, k3 = u3 && u3.__k || e2, _3 = k3.length; + if (c3 == f2 && (c3 = null != r3 ? r3[0] : _3 ? w2(u3, 0) : null), h3 = 0, l2.__k = x2(l2.__k, function(u4) { + if (null != u4) { + if (u4.__p = l2, u4.__b = l2.__b + 1, null === (p2 = k3[h3]) || p2 && u4.key == p2.key && u4.type === p2.type) { + k3[h3] = void 0; + } else { + for (v3 = 0; v3 < _3; v3++) { + if ((p2 = k3[v3]) && u4.key == p2.key && u4.type === p2.type) { + k3[v3] = void 0; + break; + } + p2 = null; + } + } + if (d3 = $2(n3, u4, p2 = p2 || f2, t3, i3, r3, o3, null, c3, s3), (v3 = u4.ref) && p2.ref != v3 && (g3 || (g3 = [])).push(v3, u4.__c || d3, u4), null != d3) { + if (null == m3 && (m3 = d3), null != u4.l) { + d3 = u4.l, u4.l = null; + } else if (r3 == p2 || d3 != c3 || null == d3.parentNode) { + n: if (null == c3 || c3.parentNode !== n3) { + n3.appendChild(d3); + } else { + for (y3 = c3, v3 = 0; (y3 = y3.nextSibling) && v3 < _3; v3 += 2) { + if (y3 == d3) { + break n; + } + } + n3.insertBefore(d3, c3); + } + "option" == l2.type && (n3.value = ""); + } + c3 = d3.nextSibling, "function" == typeof l2.type && (l2.l = d3); + } + } + return h3++, u4; + }), l2.__e = m3, null != r3 && "function" != typeof l2.type) { + for (h3 = r3.length; h3--; ) { + null != r3[h3] && a2(r3[h3]); + } + } + for (h3 = _3; h3--; ) { + null != k3[h3] && D2(k3[h3], k3[h3]); + } + if (g3) { + for (h3 = 0; h3 < g3.length; h3++) { + A2(g3[h3], g3[++h3], g3[++h3]); + } + } + } + function x2(n3, l2, u3) { + if (null == u3 && (u3 = []), null == n3 || "boolean" == typeof n3) { + l2 && u3.push(l2(null)); + } else if (Array.isArray(n3)) { + for (var t3 = 0; t3 < n3.length; t3++) { + x2(n3[t3], l2, u3); + } + } else { + u3.push(l2 ? l2(y2(n3)) : n3); + } + return u3; + } + function C2(n3, l2, u3, t3, i3) { + var r3; + for (r3 in u3) { + r3 in l2 || N2(n3, r3, null, u3[r3], t3); + } + for (r3 in l2) { + i3 && "function" != typeof l2[r3] || "value" === r3 || "checked" === r3 || u3[r3] === l2[r3] || N2(n3, r3, l2[r3], u3[r3], t3); + } + } + function P2(n3, l2, u3) { + "-" === l2[0] ? n3.setProperty(l2, u3) : n3[l2] = "number" == typeof u3 && false === c2.test(l2) ? u3 + "px" : null == u3 ? "" : u3; + } + function N2(n3, l2, u3, t3, i3) { + var r3, o3, f3, e3, c3; + if ("key" === (l2 = i3 ? "className" === l2 ? "class" : l2 : "class" === l2 ? "className" : l2) || "children" === l2) ; + else if ("style" === l2) { + if (r3 = n3.style, "string" == typeof u3) { + r3.cssText = u3; + } else { + if ("string" == typeof t3 && (r3.cssText = "", t3 = null), t3) { + for (o3 in t3) { + u3 && o3 in u3 || P2(r3, o3, ""); + } + } + if (u3) { + for (f3 in u3) { + t3 && u3[f3] === t3[f3] || P2(r3, f3, u3[f3]); + } + } + } + } else { + "o" === l2[0] && "n" === l2[1] ? (e3 = l2 !== (l2 = l2.replace(/Capture$/, "")), c3 = l2.toLowerCase(), l2 = (c3 in n3 ? c3 : l2).slice(2), u3 ? (t3 || n3.addEventListener(l2, T2, e3), (n3.t || (n3.t = {}))[l2] = u3) : n3.removeEventListener(l2, T2, e3)) : "list" !== l2 && "tagName" !== l2 && "form" !== l2 && !i3 && l2 in n3 ? n3[l2] = null == u3 ? "" : u3 : "function" != typeof u3 && "dangerouslySetInnerHTML" !== l2 && (l2 !== (l2 = l2.replace(/^xlink:?/, "")) ? null == u3 || false === u3 ? n3.removeAttributeNS("http://www.w3.org/1999/xlink", l2.toLowerCase()) : n3.setAttributeNS("http://www.w3.org/1999/xlink", l2.toLowerCase(), u3) : null == u3 || false === u3 ? n3.removeAttribute(l2) : n3.setAttribute(l2, u3)); + } + } + function T2(l2) { + return this.t[l2.type](n2.event ? n2.event(l2) : l2); + } + function $2(l2, u3, t3, i3, r3, o3, f3, e3, c3, a3) { + var h3, v3, p2, y3, w3, g3, k3, _3, C3, P3, N3 = u3.type; + if (void 0 !== u3.constructor) { + return null; + } + (h3 = n2.__b) && h3(u3); + try { + n: if ("function" == typeof N3) { + if (_3 = u3.props, C3 = (h3 = N3.contextType) && i3[h3.__c], P3 = h3 ? C3 ? C3.props.value : h3.__p : i3, t3.__c ? k3 = (v3 = u3.__c = t3.__c).__p = v3.__E : ("prototype" in N3 && N3.prototype.render ? u3.__c = v3 = new N3(_3, P3) : (u3.__c = v3 = new m2(_3, P3), v3.constructor = N3, v3.render = H2), C3 && C3.sub(v3), v3.props = _3, v3.state || (v3.state = {}), v3.context = P3, v3.__n = i3, p2 = v3.__d = true, v3.__h = []), null == v3.__s && (v3.__s = v3.state), null != N3.getDerivedStateFromProps && s2(v3.__s == v3.state ? v3.__s = s2({}, v3.__s) : v3.__s, N3.getDerivedStateFromProps(_3, v3.__s)), p2) { + null == N3.getDerivedStateFromProps && null != v3.componentWillMount && v3.componentWillMount(), null != v3.componentDidMount && f3.push(v3); + } else { + if (null == N3.getDerivedStateFromProps && null == e3 && null != v3.componentWillReceiveProps && v3.componentWillReceiveProps(_3, P3), !e3 && null != v3.shouldComponentUpdate && false === v3.shouldComponentUpdate(_3, v3.__s, P3)) { + for (v3.props = _3, v3.state = v3.__s, v3.__d = false, v3.__v = u3, u3.__e = null != c3 ? c3 !== t3.__e ? c3 : t3.__e : null, u3.__k = t3.__k, h3 = 0; h3 < u3.__k.length; h3++) { + u3.__k[h3] && (u3.__k[h3].__p = u3); + } + break n; + } + null != v3.componentWillUpdate && v3.componentWillUpdate(_3, v3.__s, P3); + } + for (y3 = v3.props, w3 = v3.state, v3.context = P3, v3.props = _3, v3.state = v3.__s, (h3 = n2.__r) && h3(u3), v3.__d = false, v3.__v = u3, v3.__P = l2, h3 = v3.render(v3.props, v3.state, v3.context), u3.__k = x2(null != h3 && h3.type == d2 && null == h3.key ? h3.props.children : h3), null != v3.getChildContext && (i3 = s2(s2({}, i3), v3.getChildContext())), p2 || null == v3.getSnapshotBeforeUpdate || (g3 = v3.getSnapshotBeforeUpdate(y3, w3)), b2(l2, u3, t3, i3, r3, o3, f3, c3, a3), v3.base = u3.__e; h3 = v3.__h.pop(); ) { + v3.__s && (v3.state = v3.__s), h3.call(v3); + } + p2 || null == y3 || null == v3.componentDidUpdate || v3.componentDidUpdate(y3, w3, g3), k3 && (v3.__E = v3.__p = null); + } else { + u3.__e = z2(t3.__e, u3, t3, i3, r3, o3, f3, a3); + } + (h3 = n2.diffed) && h3(u3); + } catch (l3) { + n2.__e(l3, u3, t3); + } + return u3.__e; + } + function j2(l2, u3) { + for (var t3; t3 = l2.pop(); ) { + try { + t3.componentDidMount(); + } catch (l3) { + n2.__e(l3, t3.__v); + } + } + n2.__c && n2.__c(u3); + } + function z2(n3, l2, u3, t3, i3, r3, o3, c3) { + var s3, a3, h3, v3, p2 = u3.props, d3 = l2.props; + if (i3 = "svg" === l2.type || i3, null == n3 && null != r3) { + for (s3 = 0; s3 < r3.length; s3++) { + if (null != (a3 = r3[s3]) && (null === l2.type ? 3 === a3.nodeType : a3.localName === l2.type)) { + n3 = a3, r3[s3] = null; + break; + } + } + } + if (null == n3) { + if (null === l2.type) { + return document.createTextNode(d3); + } + n3 = i3 ? document.createElementNS("http://www.w3.org/2000/svg", l2.type) : document.createElement(l2.type), r3 = null; + } + return null === l2.type ? p2 !== d3 && (null != r3 && (r3[r3.indexOf(n3)] = null), n3.data = d3) : l2 !== u3 && (null != r3 && (r3 = e2.slice.call(n3.childNodes)), h3 = (p2 = u3.props || f2).dangerouslySetInnerHTML, v3 = d3.dangerouslySetInnerHTML, c3 || (v3 || h3) && (v3 && h3 && v3.__html == h3.__html || (n3.innerHTML = v3 && v3.__html || "")), C2(n3, d3, p2, i3, c3), l2.__k = l2.props.children, v3 || b2(n3, l2, u3, t3, "foreignObject" !== l2.type && i3, r3, o3, f2, c3), c3 || ("value" in d3 && void 0 !== d3.value && d3.value !== n3.value && (n3.value = null == d3.value ? "" : d3.value), "checked" in d3 && void 0 !== d3.checked && d3.checked !== n3.checked && (n3.checked = d3.checked))), n3; + } + function A2(l2, u3, t3) { + try { + "function" == typeof l2 ? l2(u3) : l2.current = u3; + } catch (l3) { + n2.__e(l3, t3); + } + } + function D2(l2, u3, t3) { + var i3, r3, o3; + if (n2.unmount && n2.unmount(l2), (i3 = l2.ref) && A2(i3, null, u3), t3 || "function" == typeof l2.type || (t3 = null != (r3 = l2.__e)), l2.__e = l2.l = null, null != (i3 = l2.__c)) { + if (i3.componentWillUnmount) { + try { + i3.componentWillUnmount(); + } catch (l3) { + n2.__e(l3, u3); + } + } + i3.base = i3.__P = null; + } + if (i3 = l2.__k) { + for (o3 = 0; o3 < i3.length; o3++) { + i3[o3] && D2(i3[o3], u3, t3); + } + } + null != r3 && a2(r3); + } + function H2(n3, l2, u3) { + return this.constructor(n3, u3); + } + function I2(l2, u3, t3) { + var i3, o3, c3; + n2.__p && n2.__p(l2, u3), o3 = (i3 = t3 === r2) ? null : t3 && t3.__k || u3.__k, l2 = h2(d2, null, [l2]), c3 = [], $2(u3, i3 ? u3.__k = l2 : (t3 || u3).__k = l2, o3 || f2, f2, void 0 !== u3.ownerSVGElement, t3 && !i3 ? [t3] : o3 ? null : e2.slice.call(u3.childNodes), c3, false, t3 || f2, i3), j2(c3, l2); + } + n2 = {}, m2.prototype.setState = function(n3, l2) { + var u3 = this.__s !== this.state && this.__s || (this.__s = s2({}, this.state)); + ("function" != typeof n3 || (n3 = n3(u3, this.props))) && s2(u3, n3), null != n3 && this.__v && (this.u = false, l2 && this.__h.push(l2), k2(this)); + }, m2.prototype.forceUpdate = function(n3) { + this.__v && (n3 && this.__h.push(n3), this.u = true, k2(this)); + }, m2.prototype.render = d2, u2 = [], t2 = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, i2 = n2.debounceRendering, n2.__e = function(n3, l2, u3) { + for (var t3; l2 = l2.__p; ) { + if ((t3 = l2.__c) && !t3.__p) { + try { + if (t3.constructor && null != t3.constructor.getDerivedStateFromError) { + t3.setState(t3.constructor.getDerivedStateFromError(n3)); + } else { + if (null == t3.componentDidCatch) { + continue; + } + t3.componentDidCatch(n3); + } + return k2(t3.__E = t3); + } catch (l3) { + n3 = l3; + } + } + } + throw n3; + }, r2 = f2, o2 = 0; + function _defineProperties(target, props) { + for (var i3 = 0; i3 < props.length; i3++) { + var descriptor = props[i3]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) { + descriptor.writable = true; + } + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) { + _defineProperties(Constructor.prototype, protoProps); + } + if (staticProps) { + _defineProperties(Constructor, staticProps); + } + return Constructor; + } + function _extends() { + _extends = Object.assign || function(target) { + var arguments$1 = arguments; + for (var i3 = 1; i3 < arguments.length; i3++) { + var source = arguments$1[i3]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + var CSS_INTEGER = "[-\\+]?\\d+%?"; + var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; + var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; + var PERMISSIVE_MATCH_3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + var PERMISSIVE_MATCH_4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + var REGEX_FUNCTIONAL_RGB = new RegExp("rgb" + PERMISSIVE_MATCH_3); + var REGEX_FUNCTIONAL_RGBA = new RegExp("rgba" + PERMISSIVE_MATCH_4); + var REGEX_FUNCTIONAL_HSL = new RegExp("hsl" + PERMISSIVE_MATCH_3); + var REGEX_FUNCTIONAL_HSLA = new RegExp("hsla" + PERMISSIVE_MATCH_4); + var HEX_START = "^(?:#?|0x?)"; + var HEX_INT_SINGLE = "([0-9a-fA-F]{1})"; + var HEX_INT_DOUBLE = "([0-9a-fA-F]{2})"; + var REGEX_HEX_3 = new RegExp(HEX_START + HEX_INT_SINGLE + HEX_INT_SINGLE + HEX_INT_SINGLE + "$"); + var REGEX_HEX_4 = new RegExp(HEX_START + HEX_INT_SINGLE + HEX_INT_SINGLE + HEX_INT_SINGLE + HEX_INT_SINGLE + "$"); + var REGEX_HEX_6 = new RegExp(HEX_START + HEX_INT_DOUBLE + HEX_INT_DOUBLE + HEX_INT_DOUBLE + "$"); + var REGEX_HEX_8 = new RegExp(HEX_START + HEX_INT_DOUBLE + HEX_INT_DOUBLE + HEX_INT_DOUBLE + HEX_INT_DOUBLE + "$"); + var KELVIN_MIN = 2e3; + var KELVIN_MAX = 4e4; + var log = Math.log, round = Math.round, floor = Math.floor; + function clamp(num, min, max) { + return Math.min(Math.max(num, min), max); + } + function parseUnit(str, max) { + var isPercentage = str.indexOf("%") > -1; + var num = parseFloat(str); + return isPercentage ? max / 100 * num : num; + } + function parseHexInt(str) { + return parseInt(str, 16); + } + function intToHex(_int) { + return _int.toString(16).padStart(2, "0"); + } + var IroColor = /* @__PURE__ */ function() { + function IroColor2(value, onChange) { + this.$ = { + h: 0, + s: 0, + v: 0, + a: 1 + }; + if (value) { + this.set(value); + } + this.onChange = onChange; + this.initialValue = _extends({}, this.$); + } + var _proto = IroColor2.prototype; + _proto.set = function set(value) { + if (typeof value === "string") { + if (/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(value)) { + this.hexString = value; + } else if (/^rgba?/.test(value)) { + this.rgbString = value; + } else if (/^hsla?/.test(value)) { + this.hslString = value; + } + } else if (typeof value === "object") { + if (value instanceof IroColor2) { + this.hsva = value.hsva; + } else if ("r" in value && "g" in value && "b" in value) { + this.rgb = value; + } else if ("h" in value && "s" in value && "v" in value) { + this.hsv = value; + } else if ("h" in value && "s" in value && "l" in value) { + this.hsl = value; + } else if ("kelvin" in value) { + this.kelvin = value.kelvin; + } + } else { + throw new Error("Invalid color value"); + } + }; + _proto.setChannel = function setChannel(format, channel, value) { + var _extends2; + this[format] = _extends({}, this[format], (_extends2 = {}, _extends2[channel] = value, _extends2)); + }; + _proto.reset = function reset() { + this.hsva = this.initialValue; + }; + _proto.clone = function clone() { + return new IroColor2(this); + }; + _proto.unbind = function unbind() { + this.onChange = void 0; + }; + IroColor2.hsvToRgb = function hsvToRgb(hsv) { + var h3 = hsv.h / 60; + var s3 = hsv.s / 100; + var v3 = hsv.v / 100; + var i3 = floor(h3); + var f3 = h3 - i3; + var p2 = v3 * (1 - s3); + var q2 = v3 * (1 - f3 * s3); + var t3 = v3 * (1 - (1 - f3) * s3); + var mod2 = i3 % 6; + var r3 = [v3, q2, p2, p2, t3, v3][mod2]; + var g3 = [t3, v3, v3, q2, p2, p2][mod2]; + var b3 = [p2, p2, t3, v3, v3, q2][mod2]; + return { + r: clamp(r3 * 255, 0, 255), + g: clamp(g3 * 255, 0, 255), + b: clamp(b3 * 255, 0, 255) + }; + }; + IroColor2.rgbToHsv = function rgbToHsv(rgb) { + var r3 = rgb.r / 255; + var g3 = rgb.g / 255; + var b3 = rgb.b / 255; + var max = Math.max(r3, g3, b3); + var min = Math.min(r3, g3, b3); + var delta = max - min; + var hue = 0; + var value = max; + var saturation = max === 0 ? 0 : delta / max; + switch (max) { + case min: + hue = 0; + break; + case r3: + hue = (g3 - b3) / delta + (g3 < b3 ? 6 : 0); + break; + case g3: + hue = (b3 - r3) / delta + 2; + break; + case b3: + hue = (r3 - g3) / delta + 4; + break; + } + return { + h: hue * 60 % 360, + s: clamp(saturation * 100, 0, 100), + v: clamp(value * 100, 0, 100) + }; + }; + IroColor2.hsvToHsl = function hsvToHsl(hsv) { + var s3 = hsv.s / 100; + var v3 = hsv.v / 100; + var l2 = (2 - s3) * v3; + var divisor = l2 <= 1 ? l2 : 2 - l2; + var saturation = divisor < 1e-9 ? 0 : s3 * v3 / divisor; + return { + h: hsv.h, + s: clamp(saturation * 100, 0, 100), + l: clamp(l2 * 50, 0, 100) + }; + }; + IroColor2.hslToHsv = function hslToHsv(hsl) { + var l2 = hsl.l * 2; + var s3 = hsl.s * (l2 <= 100 ? l2 : 200 - l2) / 100; + var saturation = l2 + s3 < 1e-9 ? 0 : 2 * s3 / (l2 + s3); + return { + h: hsl.h, + s: clamp(saturation * 100, 0, 100), + v: clamp((l2 + s3) / 2, 0, 100) + }; + }; + IroColor2.kelvinToRgb = function kelvinToRgb(kelvin) { + var temp = kelvin / 100; + var r3, g3, b3; + if (temp < 66) { + r3 = 255; + g3 = -155.25485562709179 - 0.44596950469579133 * (g3 = temp - 2) + 104.49216199393888 * log(g3); + b3 = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b3 = temp - 10) + 115.67994401066147 * log(b3); + } else { + r3 = 351.97690566805693 + 0.114206453784165 * (r3 = temp - 55) - 40.25366309332127 * log(r3); + g3 = 325.4494125711974 + 0.07943456536662342 * (g3 = temp - 50) - 28.0852963507957 * log(g3); + b3 = 255; + } + return { + r: clamp(floor(r3), 0, 255), + g: clamp(floor(g3), 0, 255), + b: clamp(floor(b3), 0, 255) + }; + }; + IroColor2.rgbToKelvin = function rgbToKelvin(rgb) { + var r3 = rgb.r, b3 = rgb.b; + var eps = 0.4; + var minTemp = KELVIN_MIN; + var maxTemp = KELVIN_MAX; + var temp; + while (maxTemp - minTemp > eps) { + temp = (maxTemp + minTemp) * 0.5; + var _rgb = IroColor2.kelvinToRgb(temp); + if (_rgb.b / _rgb.r >= b3 / r3) { + maxTemp = temp; + } else { + minTemp = temp; + } + } + return temp; + }; + _createClass(IroColor2, [{ + key: "hsv", + get: function get() { + var value = this.$; + return { + h: value.h, + s: value.s, + v: value.v + }; + }, + set: function set(newValue) { + var oldValue = this.$; + newValue = _extends({}, oldValue, newValue); + if (this.onChange) { + var changes = { + h: false, + v: false, + s: false, + a: false + }; + for (var key in oldValue) { + changes[key] = newValue[key] != oldValue[key]; + } + this.$ = newValue; + if (changes.h || changes.s || changes.v || changes.a) { + this.onChange(this, changes); + } + } else { + this.$ = newValue; + } + } + }, { + key: "hsva", + get: function get() { + return _extends({}, this.$); + }, + set: function set(value) { + this.hsv = value; + } + }, { + key: "hue", + get: function get() { + return this.$.h; + }, + set: function set(value) { + this.hsv = { + h: value + }; + } + }, { + key: "saturation", + get: function get() { + return this.$.s; + }, + set: function set(value) { + this.hsv = { + s: value + }; + } + }, { + key: "value", + get: function get() { + return this.$.v; + }, + set: function set(value) { + this.hsv = { + v: value + }; + } + }, { + key: "alpha", + get: function get() { + return this.$.a; + }, + set: function set(value) { + this.hsv = _extends({}, this.hsv, { + a: value + }); + } + }, { + key: "kelvin", + get: function get() { + return IroColor2.rgbToKelvin(this.rgb); + }, + set: function set(value) { + this.rgb = IroColor2.kelvinToRgb(value); + } + }, { + key: "red", + get: function get() { + var rgb = this.rgb; + return rgb.r; + }, + set: function set(value) { + this.rgb = _extends({}, this.rgb, { + r: value + }); + } + }, { + key: "green", + get: function get() { + var rgb = this.rgb; + return rgb.g; + }, + set: function set(value) { + this.rgb = _extends({}, this.rgb, { + g: value + }); + } + }, { + key: "blue", + get: function get() { + var rgb = this.rgb; + return rgb.b; + }, + set: function set(value) { + this.rgb = _extends({}, this.rgb, { + b: value + }); + } + }, { + key: "rgb", + get: function get() { + var _IroColor$hsvToRgb = IroColor2.hsvToRgb(this.$), r3 = _IroColor$hsvToRgb.r, g3 = _IroColor$hsvToRgb.g, b3 = _IroColor$hsvToRgb.b; + return { + r: round(r3), + g: round(g3), + b: round(b3) + }; + }, + set: function set(value) { + this.hsv = _extends({}, IroColor2.rgbToHsv(value), { + a: value.a === void 0 ? 1 : value.a + }); + } + }, { + key: "rgba", + get: function get() { + return _extends({}, this.rgb, { + a: this.alpha + }); + }, + set: function set(value) { + this.rgb = value; + } + }, { + key: "hsl", + get: function get() { + var _IroColor$hsvToHsl = IroColor2.hsvToHsl(this.$), h3 = _IroColor$hsvToHsl.h, s3 = _IroColor$hsvToHsl.s, l2 = _IroColor$hsvToHsl.l; + return { + h: round(h3), + s: round(s3), + l: round(l2) + }; + }, + set: function set(value) { + this.hsv = _extends({}, IroColor2.hslToHsv(value), { + a: value.a === void 0 ? 1 : value.a + }); + } + }, { + key: "hsla", + get: function get() { + return _extends({}, this.hsl, { + a: this.alpha + }); + }, + set: function set(value) { + this.hsl = value; + } + }, { + key: "rgbString", + get: function get() { + var rgb = this.rgb; + return "rgb(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ")"; + }, + set: function set(value) { + var match; + var r3, g3, b3, a3 = 1; + if (match = REGEX_FUNCTIONAL_RGB.exec(value)) { + r3 = parseUnit(match[1], 255); + g3 = parseUnit(match[2], 255); + b3 = parseUnit(match[3], 255); + } else if (match = REGEX_FUNCTIONAL_RGBA.exec(value)) { + r3 = parseUnit(match[1], 255); + g3 = parseUnit(match[2], 255); + b3 = parseUnit(match[3], 255); + a3 = parseUnit(match[4], 1); + } + if (match) { + this.rgb = { + r: r3, + g: g3, + b: b3, + a: a3 + }; + } else { + throw new Error("Invalid rgb string"); + } + } + }, { + key: "rgbaString", + get: function get() { + var rgba = this.rgba; + return "rgba(" + rgba.r + ", " + rgba.g + ", " + rgba.b + ", " + rgba.a + ")"; + }, + set: function set(value) { + this.rgbString = value; + } + }, { + key: "hexString", + get: function get() { + var rgb = this.rgb; + return "#" + intToHex(rgb.r) + intToHex(rgb.g) + intToHex(rgb.b); + }, + set: function set(value) { + var match; + var r3, g3, b3, a3 = 255; + if (match = REGEX_HEX_3.exec(value)) { + r3 = parseHexInt(match[1]) * 17; + g3 = parseHexInt(match[2]) * 17; + b3 = parseHexInt(match[3]) * 17; + } else if (match = REGEX_HEX_4.exec(value)) { + r3 = parseHexInt(match[1]) * 17; + g3 = parseHexInt(match[2]) * 17; + b3 = parseHexInt(match[3]) * 17; + a3 = parseHexInt(match[4]) * 17; + } else if (match = REGEX_HEX_6.exec(value)) { + r3 = parseHexInt(match[1]); + g3 = parseHexInt(match[2]); + b3 = parseHexInt(match[3]); + } else if (match = REGEX_HEX_8.exec(value)) { + r3 = parseHexInt(match[1]); + g3 = parseHexInt(match[2]); + b3 = parseHexInt(match[3]); + a3 = parseHexInt(match[4]); + } + if (match) { + this.rgb = { + r: r3, + g: g3, + b: b3, + a: a3 / 255 + }; + } else { + throw new Error("Invalid hex string"); + } + } + }, { + key: "hex8String", + get: function get() { + var rgba = this.rgba; + return "#" + intToHex(rgba.r) + intToHex(rgba.g) + intToHex(rgba.b) + intToHex(floor(rgba.a * 255)); + }, + set: function set(value) { + this.hexString = value; + } + }, { + key: "hslString", + get: function get() { + var hsl = this.hsl; + return "hsl(" + hsl.h + ", " + hsl.s + "%, " + hsl.l + "%)"; + }, + set: function set(value) { + var match; + var h3, s3, l2, a3 = 1; + if (match = REGEX_FUNCTIONAL_HSL.exec(value)) { + h3 = parseUnit(match[1], 360); + s3 = parseUnit(match[2], 100); + l2 = parseUnit(match[3], 100); + } else if (match = REGEX_FUNCTIONAL_HSLA.exec(value)) { + h3 = parseUnit(match[1], 360); + s3 = parseUnit(match[2], 100); + l2 = parseUnit(match[3], 100); + a3 = parseUnit(match[4], 1); + } + if (match) { + this.hsl = { + h: h3, + s: s3, + l: l2, + a: a3 + }; + } else { + throw new Error("Invalid hsl string"); + } + } + }, { + key: "hslaString", + get: function get() { + var hsla = this.hsla; + return "hsla(" + hsla.h + ", " + hsla.s + "%, " + hsla.l + "%, " + hsla.a + ")"; + }, + set: function set(value) { + this.hslString = value; + } + }]); + return IroColor2; + }(); + var sliderDefaultOptions = { + sliderShape: "bar", + sliderType: "value", + minTemperature: 2200, + maxTemperature: 11e3 + }; + function getSliderDimensions(props) { + var _sliderSize; + var width = props.width, sliderSize = props.sliderSize, borderWidth = props.borderWidth, handleRadius = props.handleRadius, padding = props.padding, sliderShape = props.sliderShape; + var ishorizontal = props.layoutDirection === "horizontal"; + sliderSize = (_sliderSize = sliderSize) != null ? _sliderSize : padding * 2 + handleRadius * 2; + if (sliderShape === "circle") { + return { + handleStart: props.padding + props.handleRadius, + handleRange: width - padding * 2 - handleRadius * 2, + width, + height: width, + cx: width / 2, + cy: width / 2, + radius: width / 2 - borderWidth / 2 + }; + } else { + return { + handleStart: sliderSize / 2, + handleRange: width - sliderSize, + radius: sliderSize / 2, + x: 0, + y: 0, + width: ishorizontal ? sliderSize : width, + height: ishorizontal ? width : sliderSize + }; + } + } + function getCurrentSliderValue(props, color) { + var hsva = color.hsva; + var rgb = color.rgb; + switch (props.sliderType) { + case "red": + return rgb.r / 2.55; + case "green": + return rgb.g / 2.55; + case "blue": + return rgb.b / 2.55; + case "alpha": + return hsva.a * 100; + case "kelvin": + var minTemperature = props.minTemperature, maxTemperature = props.maxTemperature; + var temperatureRange = maxTemperature - minTemperature; + var percent = (color.kelvin - minTemperature) / temperatureRange * 100; + return Math.max(0, Math.min(percent, 100)); + case "hue": + return hsva.h /= 3.6; + case "saturation": + return hsva.s; + case "value": + default: + return hsva.v; + } + } + function getSliderValueFromInput(props, x3, y3) { + var _getSliderDimensions = getSliderDimensions(props), handleRange = _getSliderDimensions.handleRange, handleStart = _getSliderDimensions.handleStart; + var handlePos; + if (props.layoutDirection === "horizontal") { + handlePos = -1 * y3 + handleRange + handleStart; + } else { + handlePos = x3 - handleStart; + } + handlePos = Math.max(Math.min(handlePos, handleRange), 0); + var percent = Math.round(100 / handleRange * handlePos); + switch (props.sliderType) { + case "kelvin": + var minTemperature = props.minTemperature, maxTemperature = props.maxTemperature; + var temperatureRange = maxTemperature - minTemperature; + return minTemperature + temperatureRange * (percent / 100); + case "alpha": + return percent / 100; + case "hue": + return percent * 3.6; + case "red": + case "blue": + case "green": + return percent * 2.55; + default: + return percent; + } + } + function getSliderHandlePosition(props, color) { + var _getSliderDimensions2 = getSliderDimensions(props), width = _getSliderDimensions2.width, height = _getSliderDimensions2.height, handleRange = _getSliderDimensions2.handleRange, handleStart = _getSliderDimensions2.handleStart; + var ishorizontal = props.layoutDirection === "horizontal"; + var sliderValue = getCurrentSliderValue(props, color); + var midPoint = ishorizontal ? width / 2 : height / 2; + var handlePos = handleStart + sliderValue / 100 * handleRange; + if (ishorizontal) { + handlePos = -1 * handlePos + handleRange + handleStart * 2; + } + return { + x: ishorizontal ? midPoint : handlePos, + y: ishorizontal ? handlePos : midPoint + }; + } + function getSliderGradient(props, color) { + var hsv = color.hsv; + var rgb = color.rgb; + switch (props.sliderType) { + case "red": + return [[0, "rgb(0," + rgb.g + "," + rgb.b + ")"], [100, "rgb(255," + rgb.g + "," + rgb.b + ")"]]; + case "green": + return [[0, "rgb(" + rgb.r + ",0," + rgb.b + ")"], [100, "rgb(" + rgb.r + ",255," + rgb.b + ")"]]; + case "blue": + return [[0, "rgb(" + rgb.r + "," + rgb.g + ",0)"], [100, "rgb(" + rgb.r + "," + rgb.g + ",255)"]]; + case "alpha": + return [[0, "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0)"], [100, "rgb(" + rgb.r + "," + rgb.g + "," + rgb.b + ")"]]; + case "kelvin": + var stops = []; + var min = props.minTemperature; + var max = props.maxTemperature; + var numStops = 8; + var range = max - min; + for (var kelvin = min, stop = 0; kelvin < max; kelvin += range / numStops, stop += 1) { + var _IroColor$kelvinToRgb = IroColor.kelvinToRgb(kelvin), r3 = _IroColor$kelvinToRgb.r, g3 = _IroColor$kelvinToRgb.g, b3 = _IroColor$kelvinToRgb.b; + stops.push([100 / numStops * stop, "rgb(" + r3 + "," + g3 + "," + b3 + ")"]); + } + return stops; + case "hue": + return [[0, "#f00"], [16.666, "#ff0"], [33.333, "#0f0"], [50, "#0ff"], [66.666, "#00f"], [83.333, "#f0f"], [100, "#f00"]]; + case "saturation": + var noSat = IroColor.hsvToHsl({ + h: hsv.h, + s: 0, + v: hsv.v + }); + var fullSat = IroColor.hsvToHsl({ + h: hsv.h, + s: 100, + v: hsv.v + }); + return [[0, "hsl(" + noSat.h + "," + noSat.s + "%," + noSat.l + "%)"], [100, "hsl(" + fullSat.h + "," + fullSat.s + "%," + fullSat.l + "%)"]]; + case "value": + default: + var hsl = IroColor.hsvToHsl({ + h: hsv.h, + s: hsv.s, + v: 100 + }); + return [[0, "#000"], [100, "hsl(" + hsl.h + "," + hsl.s + "%," + hsl.l + "%)"]]; + } + } + var TAU = Math.PI * 2; + var mod = function mod2(a3, n3) { + return (a3 % n3 + n3) % n3; + }; + var dist = function dist2(x3, y3) { + return Math.sqrt(x3 * x3 + y3 * y3); + }; + function getHandleRange(props) { + return props.width / 2 - props.padding - props.handleRadius - props.borderWidth; + } + function isInputInsideWheel(props, x3, y3) { + var _getWheelDimensions = getWheelDimensions(props), cx = _getWheelDimensions.cx, cy = _getWheelDimensions.cy; + var r3 = props.width / 2; + return dist(cx - x3, cy - y3) < r3; + } + function getWheelDimensions(props) { + var r3 = props.width / 2; + return { + width: props.width, + radius: r3 - props.borderWidth, + cx: r3, + cy: r3 + }; + } + function translateWheelAngle(props, angle, invert) { + var wheelAngle = props.wheelAngle; + var wheelDirection = props.wheelDirection; + if (invert && wheelDirection === "clockwise") { + angle = wheelAngle + angle; + } else if (wheelDirection === "clockwise") { + angle = 360 - wheelAngle + angle; + } else if (invert && wheelDirection === "anticlockwise") { + angle = wheelAngle + 180 - angle; + } else if (wheelDirection === "anticlockwise") { + angle = wheelAngle - angle; + } + return mod(angle, 360); + } + function getWheelHandlePosition(props, color) { + var hsv = color.hsv; + var _getWheelDimensions2 = getWheelDimensions(props), cx = _getWheelDimensions2.cx, cy = _getWheelDimensions2.cy; + var handleRange = getHandleRange(props); + var handleAngle = (180 + translateWheelAngle(props, hsv.h, true)) * (TAU / 360); + var handleDist = hsv.s / 100 * handleRange; + var direction = props.wheelDirection === "clockwise" ? -1 : 1; + return { + x: cx + handleDist * Math.cos(handleAngle) * direction, + y: cy + handleDist * Math.sin(handleAngle) * direction + }; + } + function getWheelValueFromInput(props, x3, y3) { + var _getWheelDimensions3 = getWheelDimensions(props), cx = _getWheelDimensions3.cx, cy = _getWheelDimensions3.cy; + var handleRange = getHandleRange(props); + x3 = cx - x3; + y3 = cy - y3; + var hue = translateWheelAngle(props, Math.atan2(-y3, -x3) * (360 / TAU)); + var handleDist = Math.min(dist(x3, y3), handleRange); + return { + h: Math.round(hue), + s: Math.round(100 / handleRange * handleDist) + }; + } + function getBoxDimensions(props) { + var width = props.width, boxHeight = props.boxHeight, padding = props.padding, handleRadius = props.handleRadius; + return { + width, + height: boxHeight != null ? boxHeight : width, + radius: padding + handleRadius + }; + } + function getBoxValueFromInput(props, x3, y3) { + var _getBoxDimensions = getBoxDimensions(props), width = _getBoxDimensions.width, height = _getBoxDimensions.height, radius = _getBoxDimensions.radius; + var handleStart = radius; + var handleRangeX = width - radius * 2; + var handleRangeY = height - radius * 2; + var percentX = (x3 - handleStart) / handleRangeX * 100; + var percentY = (y3 - handleStart) / handleRangeY * 100; + return { + s: Math.max(0, Math.min(percentX, 100)), + v: Math.max(0, Math.min(100 - percentY, 100)) + }; + } + function getBoxHandlePosition(props, color) { + var _getBoxDimensions2 = getBoxDimensions(props), width = _getBoxDimensions2.width, height = _getBoxDimensions2.height, radius = _getBoxDimensions2.radius; + var hsv = color.hsv; + var handleStart = radius; + var handleRangeX = width - radius * 2; + var handleRangeY = height - radius * 2; + return { + x: handleStart + hsv.s / 100 * handleRangeX, + y: handleStart + (handleRangeY - hsv.v / 100 * handleRangeY) + }; + } + function getBoxGradients(props, color) { + var hue = color.hue; + return [ + // saturation gradient + [[0, "#fff"], [100, "hsl(" + hue + ",100%,50%)"]], + // lightness gradient + [[0, "rgba(0,0,0,0)"], [100, "#000"]] + ]; + } + var BASE_ELEMENTS; + function resolveSvgUrl(url) { + if (!BASE_ELEMENTS) { + BASE_ELEMENTS = document.getElementsByTagName("base"); + } + var ua = window.navigator.userAgent; + var isSafari = /^((?!chrome|android).)*safari/i.test(ua); + var isIos = /iPhone|iPod|iPad/i.test(ua); + var location2 = window.location; + return (isSafari || isIos) && BASE_ELEMENTS.length > 0 ? location2.protocol + "//" + location2.host + location2.pathname + location2.search + url : url; + } + function getHandleAtPoint(props, x3, y3, handlePositions) { + for (var i3 = 0; i3 < handlePositions.length; i3++) { + var dX = handlePositions[i3].x - x3; + var dY = handlePositions[i3].y - y3; + var dist2 = Math.sqrt(dX * dX + dY * dY); + if (dist2 < props.handleRadius) { + return i3; + } + } + return null; + } + function cssBorderStyles(props) { + return { + boxSizing: "border-box", + border: props.borderWidth + "px solid " + props.borderColor + }; + } + function cssGradient(type, direction, stops) { + return type + "-gradient(" + direction + ", " + stops.map(function(_ref) { + var o3 = _ref[0], col = _ref[1]; + return col + " " + o3 + "%"; + }).join(",") + ")"; + } + function cssValue(value) { + if (typeof value === "string") { + return value; + } + return value + "px"; + } + var iroColorPickerOptionDefaults = { + width: 300, + height: 300, + color: "#fff", + colors: [], + padding: 6, + layoutDirection: "vertical", + borderColor: "#fff", + borderWidth: 0, + handleRadius: 8, + activeHandleRadius: null, + handleSvg: null, + handleProps: { + x: 0, + y: 0 + }, + wheelLightness: true, + wheelAngle: 0, + wheelDirection: "anticlockwise", + sliderSize: null, + sliderMargin: 12, + boxHeight: null + }; + var SECONDARY_EVENTS = [ + "mousemove", + "touchmove", + "mouseup", + "touchend" + /* TouchEnd */ + ]; + var IroComponentWrapper = /* @__PURE__ */ function(Component) { + function IroComponentWrapper2(props) { + Component.call(this, props); + this.uid = (Math.random() + 1).toString(36).substring(5); + } + if (Component) IroComponentWrapper2.__proto__ = Component; + IroComponentWrapper2.prototype = Object.create(Component && Component.prototype); + IroComponentWrapper2.prototype.constructor = IroComponentWrapper2; + IroComponentWrapper2.prototype.render = function render(props) { + var eventHandler = this.handleEvent.bind(this); + var rootProps = { + onMouseDown: eventHandler, + // https://github.com/jaames/iro.js/issues/126 + // https://github.com/preactjs/preact/issues/2113#issuecomment-553408767 + ontouchstart: eventHandler + }; + var isHorizontal = props.layoutDirection === "horizontal"; + var margin = props.margin === null ? props.sliderMargin : props.margin; + var rootStyles = { + overflow: "visible", + display: isHorizontal ? "inline-block" : "block" + }; + if (props.index > 0) { + rootStyles[isHorizontal ? "marginLeft" : "marginTop"] = margin; + } + return h2(d2, null, props.children(this.uid, rootProps, rootStyles)); + }; + IroComponentWrapper2.prototype.handleEvent = function handleEvent(e3) { + var this$1 = this; + var inputHandler = this.props.onInput; + var bounds = this.base.getBoundingClientRect(); + e3.preventDefault(); + var point = e3.touches ? e3.changedTouches[0] : e3; + var x3 = point.clientX - bounds.left; + var y3 = point.clientY - bounds.top; + switch (e3.type) { + case "mousedown": + case "touchstart": + var result = inputHandler( + x3, + y3, + 0 + /* Start */ + ); + if (result !== false) { + SECONDARY_EVENTS.forEach(function(event) { + document.addEventListener(event, this$1, { passive: false }); + }); + } + break; + case "mousemove": + case "touchmove": + inputHandler( + x3, + y3, + 1 + /* Move */ + ); + break; + case "mouseup": + case "touchend": + inputHandler( + x3, + y3, + 2 + /* End */ + ); + SECONDARY_EVENTS.forEach(function(event) { + document.removeEventListener(event, this$1, { passive: false }); + }); + break; + } + }; + return IroComponentWrapper2; + }(m2); + function IroHandle(props) { + var radius = props.r; + var url = props.url; + var cx = radius; + var cy = radius; + return h2( + "svg", + { className: "IroHandle IroHandle--" + props.index + " " + (props.isActive ? "IroHandle--isActive" : ""), style: { + "-webkit-tap-highlight-color": "rgba(0, 0, 0, 0);", + transform: "translate(" + cssValue(props.x) + ", " + cssValue(props.y) + ")", + willChange: "transform", + top: cssValue(-radius), + left: cssValue(-radius), + width: cssValue(radius * 2), + height: cssValue(radius * 2), + position: "absolute", + overflow: "visible" + } }, + url && h2("use", Object.assign({ xlinkHref: resolveSvgUrl(url) }, props.props)), + !url && h2("circle", { cx, cy, r: radius, fill: "none", "stroke-width": 2, stroke: "#000" }), + !url && h2("circle", { cx, cy, r: radius - 2, fill: props.fill, "stroke-width": 2, stroke: "#fff" }) + ); + } + IroHandle.defaultProps = { + fill: "none", + x: 0, + y: 0, + r: 8, + url: null, + props: { x: 0, y: 0 } + }; + function IroSlider(props) { + var activeIndex = props.activeIndex; + var activeColor = activeIndex !== void 0 && activeIndex < props.colors.length ? props.colors[activeIndex] : props.color; + var ref = getSliderDimensions(props); + var width = ref.width; + var height = ref.height; + var radius = ref.radius; + var handlePos = getSliderHandlePosition(props, activeColor); + var gradient = getSliderGradient(props, activeColor); + function handleInput(x3, y3, type) { + var value = getSliderValueFromInput(props, x3, y3); + props.parent.inputActive = true; + activeColor[props.sliderType] = value; + props.onInput(type, props.id); + } + return h2(IroComponentWrapper, Object.assign({}, props, { onInput: handleInput }), function(uid, rootProps, rootStyles) { + return h2( + "div", + Object.assign({}, rootProps, { className: "IroSlider", style: Object.assign( + {}, + { + position: "relative", + width: cssValue(width), + height: cssValue(height), + borderRadius: cssValue(radius), + // checkered bg to represent alpha + background: "conic-gradient(#ccc 25%, #fff 0 50%, #ccc 0 75%, #fff 0)", + backgroundSize: "8px 8px" + }, + rootStyles + ) }), + h2("div", { className: "IroSliderGradient", style: Object.assign( + {}, + { + position: "absolute", + top: 0, + left: 0, + width: "100%", + height: "100%", + borderRadius: cssValue(radius), + background: cssGradient("linear", props.layoutDirection === "horizontal" ? "to top" : "to right", gradient) + }, + cssBorderStyles(props) + ) }), + h2(IroHandle, { isActive: true, index: activeColor.index, r: props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePos.x, y: handlePos.y }) + ); + }); + } + IroSlider.defaultProps = Object.assign({}, sliderDefaultOptions); + function IroBox(props) { + var ref = getBoxDimensions(props); + var width = ref.width; + var height = ref.height; + var radius = ref.radius; + var colors = props.colors; + var colorPicker = props.parent; + var activeIndex = props.activeIndex; + var activeColor = activeIndex !== void 0 && activeIndex < props.colors.length ? props.colors[activeIndex] : props.color; + var gradients = getBoxGradients(props, activeColor); + var handlePositions = colors.map(function(color) { + return getBoxHandlePosition(props, color); + }); + function handleInput(x3, y3, inputType) { + if (inputType === 0) { + var activeHandle = getHandleAtPoint(props, x3, y3, handlePositions); + if (activeHandle !== null) { + colorPicker.setActiveColor(activeHandle); + } else { + colorPicker.inputActive = true; + activeColor.hsv = getBoxValueFromInput(props, x3, y3); + props.onInput(inputType, props.id); + } + } else if (inputType === 1) { + colorPicker.inputActive = true; + activeColor.hsv = getBoxValueFromInput(props, x3, y3); + } + props.onInput(inputType, props.id); + } + return h2(IroComponentWrapper, Object.assign({}, props, { onInput: handleInput }), function(uid, rootProps, rootStyles) { + return h2( + "div", + Object.assign({}, rootProps, { className: "IroBox", style: Object.assign( + {}, + { + width: cssValue(width), + height: cssValue(height), + position: "relative" + }, + rootStyles + ) }), + h2("div", { className: "IroBox", style: Object.assign( + {}, + { + width: "100%", + height: "100%", + borderRadius: cssValue(radius) + }, + cssBorderStyles(props), + { background: cssGradient("linear", "to bottom", gradients[1]) + "," + cssGradient("linear", "to right", gradients[0]) } + ) }), + colors.filter(function(color) { + return color !== activeColor; + }).map(function(color) { + return h2(IroHandle, { isActive: false, index: color.index, fill: color.hslString, r: props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[color.index].x, y: handlePositions[color.index].y }); + }), + h2(IroHandle, { isActive: true, index: activeColor.index, fill: activeColor.hslString, r: props.activeHandleRadius || props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[activeColor.index].x, y: handlePositions[activeColor.index].y }) + ); + }); + } + var HUE_GRADIENT_CLOCKWISE = "conic-gradient(red, yellow, lime, aqua, blue, magenta, red)"; + var HUE_GRADIENT_ANTICLOCKWISE = "conic-gradient(red, magenta, blue, aqua, lime, yellow, red)"; + function IroWheel(props) { + var ref = getWheelDimensions(props); + var width = ref.width; + var colors = props.colors; + var borderWidth = props.borderWidth; + var colorPicker = props.parent; + var activeColor = props.color; + var hsv = activeColor.hsv; + var handlePositions = colors.map(function(color) { + return getWheelHandlePosition(props, color); + }); + var circleStyles = { + position: "absolute", + top: 0, + left: 0, + width: "100%", + height: "100%", + borderRadius: "50%", + boxSizing: "border-box" + }; + function handleInput(x3, y3, inputType) { + if (inputType === 0) { + if (!isInputInsideWheel(props, x3, y3)) { + return false; + } + var activeHandle = getHandleAtPoint(props, x3, y3, handlePositions); + if (activeHandle !== null) { + colorPicker.setActiveColor(activeHandle); + } else { + colorPicker.inputActive = true; + activeColor.hsv = getWheelValueFromInput(props, x3, y3); + props.onInput(inputType, props.id); + } + } else if (inputType === 1) { + colorPicker.inputActive = true; + activeColor.hsv = getWheelValueFromInput(props, x3, y3); + } + props.onInput(inputType, props.id); + } + return h2(IroComponentWrapper, Object.assign({}, props, { onInput: handleInput }), function(uid, rootProps, rootStyles) { + return h2( + "div", + Object.assign({}, rootProps, { className: "IroWheel", style: Object.assign( + {}, + { + width: cssValue(width), + height: cssValue(width), + position: "relative" + }, + rootStyles + ) }), + h2("div", { className: "IroWheelHue", style: Object.assign( + {}, + circleStyles, + { + transform: "rotateZ(" + (props.wheelAngle + 90) + "deg)", + background: props.wheelDirection === "clockwise" ? HUE_GRADIENT_CLOCKWISE : HUE_GRADIENT_ANTICLOCKWISE + } + ) }), + h2("div", { className: "IroWheelSaturation", style: Object.assign( + {}, + circleStyles, + { background: "radial-gradient(circle closest-side, #fff, transparent)" } + ) }), + props.wheelLightness && h2("div", { className: "IroWheelLightness", style: Object.assign( + {}, + circleStyles, + { + background: "#000", + opacity: 1 - hsv.v / 100 + } + ) }), + h2("div", { className: "IroWheelBorder", style: Object.assign( + {}, + circleStyles, + cssBorderStyles(props) + ) }), + colors.filter(function(color) { + return color !== activeColor; + }).map(function(color) { + return h2(IroHandle, { isActive: false, index: color.index, fill: color.hslString, r: props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[color.index].x, y: handlePositions[color.index].y }); + }), + h2(IroHandle, { isActive: true, index: activeColor.index, fill: activeColor.hslString, r: props.activeHandleRadius || props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[activeColor.index].x, y: handlePositions[activeColor.index].y }) + ); + }); + } + function createWidget(WidgetComponent) { + var widgetFactory = function(parent, props) { + var widget; + var widgetRoot = document.createElement("div"); + I2(h2(WidgetComponent, Object.assign( + {}, + { ref: function(ref) { + return widget = ref; + } }, + props + )), widgetRoot); + function mountWidget() { + var container = parent instanceof Element ? parent : document.querySelector(parent); + container.appendChild(widget.base); + widget.onMount(container); + } + if (document.readyState !== "loading") { + mountWidget(); + } else { + document.addEventListener("DOMContentLoaded", mountWidget); + } + return widget; + }; + widgetFactory.prototype = WidgetComponent.prototype; + Object.assign(widgetFactory, WidgetComponent); + widgetFactory.__component = WidgetComponent; + return widgetFactory; + } + var IroColorPicker = /* @__PURE__ */ function(Component) { + function IroColorPicker2(props) { + var this$1 = this; + Component.call(this, props); + this.colors = []; + this.inputActive = false; + this.events = {}; + this.activeEvents = {}; + this.deferredEvents = {}; + this.id = props.id; + var colors = props.colors.length > 0 ? props.colors : [props.color]; + colors.forEach(function(colorValue) { + return this$1.addColor(colorValue); + }); + this.setActiveColor(0); + this.state = Object.assign( + {}, + props, + { + color: this.color, + colors: this.colors, + layout: props.layout + } + ); + } + if (Component) IroColorPicker2.__proto__ = Component; + IroColorPicker2.prototype = Object.create(Component && Component.prototype); + IroColorPicker2.prototype.constructor = IroColorPicker2; + IroColorPicker2.prototype.addColor = function addColor(color, index) { + if (index === void 0) index = this.colors.length; + var newColor = new IroColor(color, this.onColorChange.bind(this)); + this.colors.splice(index, 0, newColor); + this.colors.forEach(function(color2, index2) { + return color2.index = index2; + }); + if (this.state) { + this.setState({ colors: this.colors }); + } + this.deferredEmit("color:init", newColor); + }; + IroColorPicker2.prototype.removeColor = function removeColor(index) { + var color = this.colors.splice(index, 1)[0]; + color.unbind(); + this.colors.forEach(function(color2, index2) { + return color2.index = index2; + }); + if (this.state) { + this.setState({ colors: this.colors }); + } + if (color.index === this.color.index) { + this.setActiveColor(0); + } + this.emit("color:remove", color); + }; + IroColorPicker2.prototype.setActiveColor = function setActiveColor(index) { + this.color = this.colors[index]; + if (this.state) { + this.setState({ color: this.color }); + } + this.emit("color:setActive", this.color); + }; + IroColorPicker2.prototype.setColors = function setColors(newColorValues, activeColorIndex) { + var this$1 = this; + if (activeColorIndex === void 0) activeColorIndex = 0; + this.colors.forEach(function(color) { + return color.unbind(); + }); + this.colors = []; + newColorValues.forEach(function(colorValue) { + return this$1.addColor(colorValue); + }); + this.setActiveColor(activeColorIndex); + this.emit("color:setAll", this.colors); + }; + IroColorPicker2.prototype.on = function on(eventList, callback) { + var this$1 = this; + var events = this.events; + (!Array.isArray(eventList) ? [eventList] : eventList).forEach(function(eventType) { + (events[eventType] || (events[eventType] = [])).push(callback); + if (this$1.deferredEvents[eventType]) { + this$1.deferredEvents[eventType].forEach(function(args) { + callback.apply(null, args); + }); + this$1.deferredEvents[eventType] = []; + } + }); + }; + IroColorPicker2.prototype.off = function off(eventList, callback) { + var this$1 = this; + (!Array.isArray(eventList) ? [eventList] : eventList).forEach(function(eventType) { + var callbackList = this$1.events[eventType]; + if (callbackList) { + callbackList.splice(callbackList.indexOf(callback), 1); + } + }); + }; + IroColorPicker2.prototype.emit = function emit(eventType) { + var this$1 = this; + var args = [], len = arguments.length - 1; + while (len-- > 0) args[len] = arguments[len + 1]; + var activeEvents = this.activeEvents; + var isEventActive = activeEvents.hasOwnProperty(eventType) ? activeEvents[eventType] : false; + if (!isEventActive) { + activeEvents[eventType] = true; + var callbackList = this.events[eventType] || []; + callbackList.forEach(function(fn) { + return fn.apply(this$1, args); + }); + activeEvents[eventType] = false; + } + }; + IroColorPicker2.prototype.deferredEmit = function deferredEmit(eventType) { + var ref; + var args = [], len = arguments.length - 1; + while (len-- > 0) args[len] = arguments[len + 1]; + var deferredEvents = this.deferredEvents; + (ref = this).emit.apply(ref, [eventType].concat(args)); + (deferredEvents[eventType] || (deferredEvents[eventType] = [])).push(args); + }; + IroColorPicker2.prototype.setOptions = function setOptions(newOptions) { + this.setState(newOptions); + }; + IroColorPicker2.prototype.resize = function resize(width) { + this.setOptions({ width }); + }; + IroColorPicker2.prototype.reset = function reset() { + this.colors.forEach(function(color) { + return color.reset(); + }); + this.setState({ colors: this.colors }); + }; + IroColorPicker2.prototype.onMount = function onMount(container) { + this.el = container; + this.deferredEmit("mount", this); + }; + IroColorPicker2.prototype.onColorChange = function onColorChange(color, changes) { + this.setState({ color: this.color }); + if (this.inputActive) { + this.inputActive = false; + this.emit("input:change", color, changes); + } + this.emit("color:change", color, changes); + }; + IroColorPicker2.prototype.emitInputEvent = function emitInputEvent(type, originId) { + if (type === 0) { + this.emit("input:start", this.color, originId); + } else if (type === 1) { + this.emit("input:move", this.color, originId); + } else if (type === 2) { + this.emit("input:end", this.color, originId); + } + }; + IroColorPicker2.prototype.render = function render(props, state) { + var this$1 = this; + var layout = state.layout; + if (!Array.isArray(layout)) { + switch (layout) { + default: + layout = [ + { component: IroWheel }, + { component: IroSlider } + ]; + } + if (state.transparency) { + layout.push({ + component: IroSlider, + options: { + sliderType: "alpha" + } + }); + } + } + return h2("div", { class: "IroColorPicker", id: state.id, style: { + display: state.display + } }, layout.map(function(ref, componentIndex) { + var UiComponent = ref.component; + var options = ref.options; + return h2(UiComponent, Object.assign({}, state, options, { ref: void 0, onInput: this$1.emitInputEvent.bind(this$1), parent: this$1, index: componentIndex })); + })); + }; + return IroColorPicker2; + }(m2); + IroColorPicker.defaultProps = Object.assign( + {}, + iroColorPickerOptionDefaults, + { + colors: [], + display: "block", + id: null, + layout: "default", + margin: null + } + ); + var IroColorPickerWidget = createWidget(IroColorPicker); + var iro2; + (function(iro3) { + iro3.version = "5.5.2"; + iro3.Color = IroColor; + iro3.ColorPicker = IroColorPickerWidget; + var ui; + (function(ui2) { + ui2.h = h2; + ui2.ComponentBase = IroComponentWrapper; + ui2.Handle = IroHandle; + ui2.Slider = IroSlider; + ui2.Wheel = IroWheel; + ui2.Box = IroBox; + })(ui = iro3.ui || (iro3.ui = {})); + })(iro2 || (iro2 = {})); + var iro$1 = iro2; + return iro$1; + }); + } +}); +// ../../../node_modules/container-query-polyfill/dist/container-query-polyfill.modern.js +function e() { + return e = Object.assign ? Object.assign.bind() : function(e2) { + for (var t2 = 1; t2 < arguments.length; t2++) { + var n2 = arguments[t2]; + for (var r2 in n2) Object.prototype.hasOwnProperty.call(n2, r2) && (e2[r2] = n2[r2]); + } + return e2; + }, e.apply(this, arguments); +} +function t(e2, t2) { + const n2 = t2.width, r2 = t2.height, u2 = t2.inlineSize, o2 = t2.blockSize; + switch (e2) { + case 1: + return null != n2 ? { type: 3, value: n2, unit: "px" } : { type: 1 }; + case 3: + return null != u2 ? { type: 3, value: u2, unit: "px" } : { type: 1 }; + case 2: + return null != r2 ? { type: 3, value: r2, unit: "px" } : { type: 1 }; + case 4: + return null != o2 ? { type: 3, value: o2, unit: "px" } : { type: 1 }; + case 5: + return null != n2 && null != r2 && r2 > 0 ? { type: 2, value: n2 / r2 } : { type: 1 }; + case 6: + return null != n2 && null != r2 ? { type: 4, value: r2 >= n2 ? "portrait" : "landscape" } : { type: 1 }; + } +} +function n(e2, t2) { + switch (e2.type) { + case 1: + case 2: + case 3: + case 4: + return i(e2, t2); + case 5: { + const n2 = t2.sizeFeatures.get(e2.feature); + return null == n2 ? { type: 1 } : n2; + } + case 6: + return e2.value; + } +} +function r(e2) { + return { type: 5, value: e2 }; +} +function u(e2, t2, n2) { + return r(function(e3, t3, n3) { + switch (n3) { + case 1: + return e3 === t3; + case 2: + return e3 > t3; + case 3: + return e3 >= t3; + case 4: + return e3 < t3; + case 5: + return e3 <= t3; + } + }(e2, t2, n2)); +} +function o(e2, t2, n2) { + return null == e2 ? t2 : null == t2 ? e2 : n2(e2, t2); +} +function s(e2, t2) { + switch (e2) { + case "cqw": + return t2.cqw; + case "cqh": + return t2.cqh; + case "cqi": + return 0 === t2.writingAxis ? t2.cqw : t2.cqh; + case "cqb": + return 1 === t2.writingAxis ? t2.cqw : t2.cqh; + case "cqmin": + return o(s("cqi", t2), s("cqb", t2), Math.min); + case "cqmax": + return o(s("cqi", t2), s("cqb", t2), Math.max); + } +} +function l(e2, { treeContext: t2 }) { + switch (e2.unit) { + case "px": + return e2.value; + case "rem": + return e2.value * t2.rootFontSize; + case "em": + return e2.value * t2.fontSize; + case "cqw": + case "cqh": + case "cqi": + case "cqb": + case "cqmin": + case "cqmax": + return o(e2.value, s(e2.unit, t2), (e3, t3) => e3 * t3); + } + return null; +} +function c(e2, t2) { + switch (e2.type) { + case 2: + return 0 === e2.value ? 0 : null; + case 3: + return l(e2, t2); + } + return null; +} +function i(e2, t2) { + switch (e2.type) { + case 4: + return function(e3, t3) { + const o2 = n(e3.left, t3), s2 = n(e3.right, t3), l2 = e3.operator; + if (4 === o2.type && 4 === s2.type || 5 === o2.type && 5 === s2.type) return function(e4, t4, n2) { + return 1 === n2 ? r(e4.value === t4.value) : { type: 1 }; + }(o2, s2, l2); + if (3 === o2.type || 3 === s2.type) { + const e4 = c(o2, t3), n2 = c(s2, t3); + if (null != e4 && null != n2) return u(e4, n2, l2); + } else if (2 === o2.type && 2 === s2.type) return u(o2.value, s2.value, l2); + return { type: 1 }; + }(e2, t2); + case 2: + return function(e3, t3) { + const n2 = i(e3.left, t3); + return 5 !== n2.type || true !== n2.value ? n2 : i(e3.right, t3); + }(e2, t2); + case 3: + return function(e3, t3) { + const n2 = i(e3.left, t3); + return 5 === n2.type && true === n2.value ? n2 : i(e3.right, t3); + }(e2, t2); + case 1: { + const n2 = i(e2.value, t2); + return 5 === n2.type ? { type: 5, value: !n2.value } : { type: 1 }; + } + case 5: + return a(n(e2, t2)); + case 6: + return a(e2.value); + } +} +function a(e2) { + switch (e2.type) { + case 5: + return e2; + case 2: + case 3: + return { type: 5, value: e2.value > 0 }; + } + return { type: 1 }; +} +var f = Array.from({ length: 4 }, () => Math.floor(256 * Math.random()).toString(16)).join(""); +var p = S("container"); +var y = S("container-type"); +var h = S("container-name"); +var v = `data-cqs-${f}`; +var d = `data-cqc-${f}`; +var m = S("cqw"); +var w = S("cqh"); +var g = S("cqi"); +var b = S("cqb"); +function S(e2) { + return `--cq-${e2}-${f}`; +} +var x = Symbol(); +function q(e2, t2) { + const n2 = { value: t2, errorIndices: [], index: -1, at(r2) { + const u2 = n2.index + r2; + return u2 >= e2.length ? t2 : e2[u2]; + }, consume: (e3) => (n2.index += e3, n2.value = n2.at(0), n2.value), reconsume() { + n2.index -= 1; + }, error() { + n2.errorIndices.push(n2.index); + } }; + return n2; +} +function C(e2) { + return q(e2, { type: 0 }); +} +function* $(e2) { + const t2 = []; + let n2 = false; + for (const r3 of e2) { + const e3 = r3.codePointAt(0); + n2 && 10 !== e3 && (n2 = false, t2.push(10)), 0 === e3 || e3 >= 55296 && e3 <= 57343 ? t2.push(65533) : 13 === e3 ? n2 = true : t2.push(e3); + } + const r2 = q(t2, -1), { at: u2, consume: o2, error: s2, reconsume: l2 } = r2; + function c2() { + return String.fromCodePoint(r2.value); + } + function i2() { + return { type: 13, value: c2() }; + } + function a2() { + for (; z(u2(1)); ) o2(1); + } + function f2() { + for (; -1 !== r2.value; ) if (o2(1), 42 === u2(0) && 47 === u2(1)) return void o2(1); + s2(); + } + function p2() { + const [e3, t3] = function() { + let e4 = 0, t4 = "", n4 = u2(1); + for (43 !== n4 && 45 !== n4 || (o2(1), t4 += c2()); k(u2(1)); ) o2(1), t4 += c2(); + if (46 === u2(1) && k(u2(2))) for (e4 = 1, o2(1), t4 += c2(); k(u2(1)); ) o2(1), t4 += c2(); + if (n4 = u2(1), 69 === n4 || 101 === n4) { + const n5 = u2(2); + if (k(n5)) for (e4 = 1, o2(1), t4 += c2(); k(u2(1)); ) o2(1), t4 += c2(); + else if ((45 === n5 || 43 === n5) && k(u2(3))) for (e4 = 1, o2(1), t4 += c2(), o2(1), t4 += c2(); k(u2(1)); ) o2(1), t4 += c2(); + } + return [t4, e4]; + }(), n3 = u2(1); + return d2(n3, u2(1), u2(2)) ? { type: 15, value: e3, flag: t3, unit: w2() } : 37 === n3 ? (o2(1), { type: 16, value: e3 }) : { type: 17, value: e3, flag: t3 }; + } + function y2() { + const e3 = w2(); + let t3 = u2(1); + if ("url" === e3.toLowerCase() && 40 === t3) { + for (o2(1); z(u2(1)) && z(u2(2)); ) o2(1); + t3 = u2(1); + const n3 = u2(2); + return 34 === t3 || 39 === t3 ? { type: 23, value: e3 } : !z(t3) || 34 !== n3 && 39 !== n3 ? function() { + let e4 = ""; + for (a2(); ; ) { + const n4 = o2(1); + if (41 === n4) return { type: 20, value: e4 }; + if (-1 === n4) return s2(), { type: 20, value: e4 }; + if (z(n4)) { + a2(); + const t5 = u2(1); + return 41 === t5 || -1 === t5 ? (o2(1), -1 === n4 && s2(), { type: 20, value: e4 }) : (g2(), { type: 21 }); + } + if (34 === n4 || 39 === n4 || 40 === n4 || (t4 = n4) >= 0 && t4 <= 8 || 11 === t4 || t4 >= 14 && t4 <= 31 || 127 === t4) return s2(), g2(), { type: 21 }; + if (92 === n4) { + if (!j(n4, u2(1))) return s2(), { type: 21 }; + e4 += v2(); + } else e4 += c2(); + } + var t4; + }() : { type: 23, value: e3 }; + } + return 40 === t3 ? (o2(1), { type: 23, value: e3 }) : { type: 24, value: e3 }; + } + function h2(e3) { + let t3 = ""; + for (; ; ) { + const n3 = o2(1); + if (-1 === n3 || n3 === e3) return -1 === n3 && s2(), { type: 2, value: t3 }; + if (E(n3)) return s2(), l2(), { type: 3 }; + if (92 === n3) { + const e4 = u2(1); + if (-1 === e4) continue; + E(e4) ? o2(1) : t3 += v2(); + } else t3 += c2(); + } + } + function v2() { + const e3 = o2(1); + if (A(e3)) { + const t3 = [e3]; + for (let e4 = 0; e4 < 5; e4++) { + const e5 = u2(1); + if (!A(e5)) break; + t3.push(e5), o2(1); + } + z(u2(1)) && o2(1); + let n3 = parseInt(String.fromCodePoint(...t3), 16); + return (0 === n3 || n3 >= 55296 && n3 <= 57343 || n3 > 1114111) && (n3 = 65533), String.fromCodePoint(n3); + } + return -1 === e3 ? (s2(), String.fromCodePoint(65533)) : c2(); + } + function d2(e3, t3, n3) { + return 45 === e3 ? L(t3) || 45 === t3 || j(t3, n3) : !!L(e3); + } + function m2(e3, t3, n3) { + return 43 === e3 || 45 === e3 ? k(t3) || 46 === t3 && k(n3) : !(46 !== e3 || !k(t3)) || !!k(e3); + } + function w2() { + let e3 = ""; + for (; ; ) { + const t3 = o2(1); + if (M(t3)) e3 += c2(); + else { + if (!j(t3, u2(1))) return l2(), e3; + e3 += v2(); + } + } + } + function g2() { + for (; ; ) { + const e3 = o2(1); + if (-1 === e3) return; + j(e3, u2(1)) && v2(); + } + } + for (; ; ) { + const e3 = o2(1); + if (47 === e3 && 42 === u2(1)) o2(2), f2(); + else if (z(e3)) a2(), yield { type: 1 }; + else if (34 === e3) yield h2(e3); + else if (35 === e3) { + const e4 = u2(1); + M(e4) || j(e4, u2(2)) ? yield { type: 14, flag: d2(u2(1), u2(2), u2(3)) ? 1 : 0, value: w2() } : yield i2(); + } else if (39 === e3) yield h2(e3); + else if (40 === e3) yield { type: 4 }; + else if (41 === e3) yield { type: 5 }; + else if (43 === e3) m2(e3, u2(1), u2(2)) ? (l2(), yield p2()) : yield i2(); + else if (44 === e3) yield { type: 6 }; + else if (45 === e3) { + const t3 = u2(1), n3 = u2(2); + m2(e3, t3, n3) ? (l2(), yield p2()) : 45 === t3 && 62 === n3 ? (o2(2), yield { type: 19 }) : d2(e3, t3, n3) ? (l2(), yield y2()) : yield i2(); + } else if (46 === e3) m2(e3, u2(1), u2(2)) ? (l2(), yield p2()) : yield i2(); + else if (58 === e3) yield { type: 7 }; + else if (59 === e3) yield { type: 8 }; + else if (60 === e3) 33 === u2(1) && 45 === u2(2) && 45 === u2(3) ? yield { type: 18 } : yield i2(); + else if (64 === e3) if (d2(u2(1), u2(2), u2(3))) { + const e4 = w2(); + yield { type: 22, value: e4 }; + } else yield i2(); + else if (91 === e3) yield { type: 9 }; + else if (92 === e3) j(e3, u2(1)) ? (l2(), yield y2()) : (s2(), yield i2()); + else if (93 === e3) yield { type: 10 }; + else if (123 === e3) yield { type: 11 }; + else if (125 === e3) yield { type: 12 }; + else if (k(e3)) l2(), yield p2(); + else if (L(e3)) l2(), yield y2(); + else { + if (-1 === e3) return yield { type: 0 }, r2.errorIndices; + yield { type: 13, value: c2() }; + } + } +} +function k(e2) { + return e2 >= 48 && e2 <= 57; +} +function A(e2) { + return k(e2) || e2 >= 65 && e2 <= 70 || e2 >= 97 && e2 <= 102; +} +function E(e2) { + return 10 === e2 || 13 === e2 || 12 === e2; +} +function z(e2) { + return E(e2) || 9 === e2 || 32 === e2; +} +function L(e2) { + return e2 >= 65 && e2 <= 90 || e2 >= 97 && e2 <= 122 || e2 >= 128 || 95 === e2; +} +function j(e2, t2) { + return 92 === e2 && !E(t2); +} +function M(e2) { + return L(e2) || k(e2) || 45 === e2; +} +var T = { 11: 12, 9: 10, 4: 5 }; +function P(t2, n2) { + const r2 = function(e2, t3) { + const n3 = []; + for (; ; ) switch (e2.consume(1).type) { + case 1: + break; + case 0: + return { type: 3, value: n3 }; + case 18: + case 19: + if (false !== t3) { + e2.reconsume(); + const t4 = R(e2); + t4 !== x && n3.push(t4); + } + break; + case 22: + e2.reconsume(), n3.push(U(e2)); + break; + default: { + e2.reconsume(); + const t4 = R(e2); + t4 !== x && n3.push(t4); + break; + } + } + }(C(t2), true === n2); + return e({}, r2, { value: r2.value.map((t3) => 26 === t3.type ? function(t4, n3) { + return 0 === t4.value.value.type ? e({}, t4, { value: e({}, t4.value, { value: O(t4.value.value.value) }) }) : t4; + }(t3) : t3) }); +} +function N(e2) { + const t2 = C(e2), n2 = []; + for (; ; ) { + if (0 === t2.consume(1).type) return n2; + t2.reconsume(), n2.push(Q(t2)); + } +} +function O(e2) { + return function(e3) { + const t2 = [], n2 = []; + for (; ; ) { + const r2 = e3.consume(1); + switch (r2.type) { + case 1: + case 8: + break; + case 0: + return { type: 1, value: [...n2, ...t2] }; + case 22: + e3.reconsume(), t2.push(U(e3)); + break; + case 24: { + const t3 = [r2]; + let u2 = e3.at(1); + for (; 8 !== u2.type && 0 !== u2.type; ) t3.push(Q(e3)), u2 = e3.at(1); + const o2 = I(C(t3)); + o2 !== x && n2.push(o2); + break; + } + case 13: + if ("&" === r2.value) { + e3.reconsume(); + const n3 = R(e3); + n3 !== x && t2.push(n3); + break; + } + default: { + e3.error(), e3.reconsume(); + let t3 = e3.at(1); + for (; 8 !== t3.type && 0 !== t3.type; ) Q(e3), t3 = e3.at(1); + break; + } + } + } + }(C(e2)); +} +function F(e2) { + for (; 1 === e2.at(1).type; ) e2.consume(1); +} +function U(e2) { + let t2 = e2.consume(1); + if (22 !== t2.type) throw new Error(`Unexpected type ${t2.type}`); + const n2 = t2.value, r2 = []; + for (; ; ) switch (t2 = e2.consume(1), t2.type) { + case 8: + return { type: 25, name: n2, prelude: r2, value: null }; + case 0: + return e2.error(), { type: 25, name: n2, prelude: r2, value: null }; + case 11: + return { type: 25, name: n2, prelude: r2, value: H(e2) }; + case 28: + if (11 === t2.source.type) return { type: 25, name: n2, prelude: r2, value: t2 }; + default: + e2.reconsume(), r2.push(Q(e2)); + } +} +function R(e2) { + let t2 = e2.value; + const n2 = []; + for (; ; ) switch (t2 = e2.consume(1), t2.type) { + case 0: + return e2.error(), x; + case 11: + return { type: 26, prelude: n2, value: H(e2) }; + case 28: + if (11 === t2.source.type) return { type: 26, prelude: n2, value: t2 }; + default: + e2.reconsume(), n2.push(Q(e2)); + } +} +function I(e2) { + const t2 = e2.consume(1); + if (24 !== t2.type) throw new Error(`Unexpected type ${t2.type}`); + const n2 = t2.value, r2 = []; + let u2 = false; + if (F(e2), 7 !== e2.at(1).type) return e2.error(), x; + for (e2.consume(1), F(e2); 0 !== e2.at(1).type; ) r2.push(Q(e2)); + const o2 = r2[r2.length - 2], s2 = r2[r2.length - 1]; + return o2 && 13 === o2.type && "!" === o2.value && 24 === s2.type && "important" === s2.value.toLowerCase() && (u2 = true, r2.splice(r2.length - 2)), { type: 29, name: n2, value: r2, important: u2 }; +} +function Q(e2) { + const t2 = e2.consume(1); + switch (t2.type) { + case 11: + case 9: + case 4: + return H(e2); + case 23: + return function(e3) { + let t3 = e3.value; + if (23 !== t3.type) throw new Error(`Unexpected type ${t3.type}`); + const n2 = t3.value, r2 = []; + for (; ; ) switch (t3 = e3.consume(1), t3.type) { + case 5: + return { type: 27, name: n2, value: r2 }; + case 0: + return e3.error(), { type: 27, name: n2, value: r2 }; + default: + e3.reconsume(), r2.push(Q(e3)); + } + }(e2); + default: + return t2; + } +} +function H(e2) { + let t2 = e2.value; + const n2 = t2, r2 = T[n2.type]; + if (!r2) throw new Error(`Unexpected type ${t2.type}`); + const u2 = []; + for (; ; ) switch (t2 = e2.consume(1), t2.type) { + case r2: + return { type: 28, source: n2, value: { type: 0, value: u2 } }; + case 0: + return e2.error(), { type: 28, source: n2, value: { type: 0, value: u2 } }; + default: + e2.reconsume(), u2.push(Q(e2)); + } +} +function V(e2) { + return F(e2), 0 === e2.at(1).type; +} +var D = { 11: ["{", "}"], 9: ["[", "]"], 4: ["(", ")"] }; +function W(e2, t2) { + switch (e2.type) { + case 25: + return `@${CSS.escape(e2.name)} ${e2.prelude.map((e3) => W(e3)).join("")}${e2.value ? W(e2.value) : ";"}`; + case 26: + return `${e2.prelude.map((e3) => W(e3)).join("")}${W(e2.value)}`; + case 28: { + const [t3, n2] = D[e2.source.type]; + return `${t3}${_(e2.value)}${n2}`; + } + case 27: + return `${CSS.escape(e2.name)}(${e2.value.map((e3) => W(e3)).join("")})`; + case 29: + return `${CSS.escape(e2.name)}:${e2.value.map((e3) => W(e3)).join("")}${e2.important ? " !important" : ""}`; + case 1: + return " "; + case 8: + return ";"; + case 7: + return ":"; + case 14: + return "#" + CSS.escape(e2.value); + case 24: + return CSS.escape(e2.value); + case 15: + return e2.value + CSS.escape(e2.unit); + case 13: + case 17: + return e2.value; + case 2: + return `"${CSS.escape(e2.value)}"`; + case 6: + return ","; + case 20: + return "url(" + CSS.escape(e2.value) + ")"; + case 22: + return "@" + CSS.escape(e2.value); + case 16: + return e2.value + "%"; + default: + throw new Error(`Unsupported token ${e2.type}`); + } +} +function _(e2, t2) { + return e2.value.map((t3) => { + let n2 = W(t3); + return 29 === t3.type && 0 !== e2.type && (n2 += ";"), n2; + }).join(""); +} +function B(e2) { + return W(e2); +} +function G(e2) { + const t2 = e2.at(1); + return 13 === t2.type && "=" === t2.value && (e2.consume(1), true); +} +function Y(e2, t2) { + const n2 = []; + for (; ; ) { + const r2 = e2.at(1); + if (0 === r2.type || t2 && 7 === r2.type || 13 === r2.type && (">" === r2.value || "<" === r2.value || "=" === r2.value)) break; + n2.push(e2.consume(1)); + } + return n2; +} +function J(e2) { + F(e2); + const t2 = e2.consume(1); + return 13 !== t2.type ? x : ">" === t2.value ? G(e2) ? 3 : 2 : "<" === t2.value ? G(e2) ? 5 : 4 : "=" === t2.value ? 1 : x; +} +function K(e2) { + return 4 === e2 || 5 === e2; +} +function X(e2) { + return 2 === e2 || 3 === e2; +} +function Z(e2, t2, n2) { + const r2 = function(e3) { + F(e3); + const t3 = e3.consume(1); + return F(e3), 24 !== t3.type || 0 !== e3.at(1).type ? x : t3.value; + }(C(e2)); + if (r2 === x) return x; + let u2 = r2.toLowerCase(); + return u2 = n2 ? n2(u2) : u2, t2.has(u2) ? u2 : x; +} +function ee(e2) { + return { type: 13, value: e2 }; +} +function te(e2, t2) { + return { type: 29, name: e2, value: t2, important: false }; +} +function ne(e2) { + return { type: 24, value: e2 }; +} +function re(e2, t2) { + return { type: 27, name: e2, value: t2 }; +} +function ue(e2) { + return re("var", [ne(e2)]); +} +function oe(e2, t2) { + F(e2); + let n2 = false, r2 = e2.at(1); + if (24 === r2.type) { + if ("not" !== r2.value.toLowerCase()) return x; + e2.consume(1), F(e2), n2 = true; + } + let u2 = function(e3) { + const t3 = e3.consume(1); + switch (t3.type) { + case 28: { + if (4 !== t3.source.type) return x; + const e4 = oe(C(t3.value.value), null); + return e4 !== x ? e4 : { type: 4, value: t3 }; + } + case 27: + return { type: 4, value: t3 }; + default: + return x; + } + }(e2); + if (u2 === x) return x; + u2 = n2 ? { type: 1, value: u2 } : u2, F(e2), r2 = e2.at(1); + const o2 = 24 === r2.type ? r2.value.toLowerCase() : null; + if (null !== o2) { + if (e2.consume(1), F(e2), "and" !== o2 && "or" !== o2 || null !== t2 && o2 !== t2) return x; + const n3 = oe(e2, o2); + return n3 === x ? x : { type: "and" === o2 ? 2 : 3, left: u2, right: n3 }; + } + return V(e2) ? u2 : x; +} +function se(e2) { + return oe(e2, null); +} +function le(e2) { + switch (e2.type) { + case 1: + return [ne("not"), { type: 1 }, ...le(e2.value)]; + case 2: + case 3: + return [...le(e2.left), { type: 1 }, ne(2 === e2.type ? "and" : "or"), { type: 1 }, ...le(e2.right)]; + case 4: + return [e2.value]; + } +} +var ce = { width: 1, height: 2, "inline-size": 3, "block-size": 4, "aspect-ratio": 5, orientation: 6 }; +var ie = new Set(Object.keys(ce)); +var ae = /* @__PURE__ */ new Set(["none", "and", "not", "or", "normal", "auto"]); +var fe = /* @__PURE__ */ new Set(["initial", "inherit", "revert", "revert-layer", "unset"]); +var pe = /* @__PURE__ */ new Set(["size", "inline-size"]); +function ye(e2, t2, n2, r2) { + const u2 = n2(); + if (u2 === x) return x; + let o2 = [u2, null]; + F(e2); + const s2 = e2.at(1); + if (13 === s2.type) { + if (s2.value !== t2) return x; + e2.consume(1), F(e2); + const n3 = r2(); + F(e2), n3 !== x && (o2 = [u2, n3]); + } + return V(e2) ? o2 : x; +} +function he(e2) { + const t2 = e2.consume(1); + return 17 === t2.type ? parseInt(t2.value) : x; +} +function ve(e2) { + const t2 = C(e2); + F(t2); + const n2 = t2.consume(1); + let r2 = x; + switch (n2.type) { + case 17: + t2.reconsume(), r2 = function(e3) { + const t3 = ye(e3, "/", () => he(e3), () => he(e3)); + return t3 === x ? x : { type: 2, value: t3[0] / (null !== t3[1] ? t3[1] : 1) }; + }(t2); + break; + case 15: + r2 = { type: 3, value: parseInt(n2.value), unit: n2.unit.toLowerCase() }; + break; + case 24: { + const e3 = n2.value.toLowerCase(); + switch (e3) { + case "landscape": + case "portrait": + r2 = { type: 4, value: e3 }; + } + } + } + return r2 === x ? x : V(t2) ? { type: 6, value: r2 } : x; +} +function de(e2) { + return !ge(e2 = e2.toLowerCase()) && !ae.has(e2); +} +function me(e2, t2) { + const n2 = []; + for (; ; ) { + F(e2); + const r2 = e2.at(1); + if (24 !== r2.type || !t2(r2.value)) return n2; + e2.consume(1), n2.push(r2.value); + } +} +function we(e2) { + const t2 = []; + for (; ; ) { + F(e2); + const n2 = e2.at(1); + if (24 !== n2.type) break; + const r2 = n2.value; + if (!de(r2)) break; + e2.consume(1), t2.push(r2); + } + return t2; +} +function ge(e2) { + return fe.has(e2); +} +function be(e2) { + return e2.map((e3) => "cq-" + e3); +} +function Se(e2) { + const t2 = me(e2, (e3) => ge(e3)); + return 1 === t2.length ? be(t2) : x; +} +function xe(e2, t2) { + const n2 = me(e2, (e3) => "none" === e3); + if (1 === n2.length) return be(n2); + if (0 !== n2.length) return x; + if (t2) { + const t3 = Se(e2); + if (t3 !== x) return t3; + } + const r2 = we(e2); + return r2.length > 0 && (!t2 || V(e2)) ? r2 : x; +} +function qe(e2, t2) { + if (t2) { + const t3 = Se(e2); + if (t3 !== x) return t3; + } + return function(e3) { + const t3 = me(e3, (e4) => "normal" === e4); + if (1 === t3.length) return be(t3); + if (0 !== t3.length) return x; + const n2 = me(e3, (e4) => pe.has(e4)); + return n2.length > 0 && V(e3) ? n2 : x; + }(e2); +} +function Ce(e2) { + const t2 = C(e2), n2 = Se(t2); + if (n2 !== x) return [n2, n2]; + const r2 = ye(t2, "/", () => xe(t2, false), () => qe(t2, false)); + return r2 !== x && V(t2) ? [r2[0], r2[1] || []] : x; +} +function $e(e2) { + const t2 = C(e2), n2 = we(t2); + if (!n2 || n2.length > 1) return x; + const r2 = se(t2); + if (r2 === x) return x; + const u2 = { features: /* @__PURE__ */ new Set() }, o2 = ke(r2, u2); + return V(t2) ? { name: n2.length > 0 ? n2[0] : null, condition: o2, features: u2.features } : x; +} +function ke(e2, t2) { + switch (e2.type) { + case 1: + return { type: 1, value: ke(e2.value, t2) }; + case 2: + case 3: + return { type: 2 === e2.type ? 2 : 3, left: ke(e2.left, t2), right: ke(e2.right, t2) }; + case 4: + if (28 === e2.value.type) { + const n2 = function(e3, t3) { + const n3 = function(e4, t4) { + const n4 = Y(e4, true), r3 = e4.at(1); + if (0 === r3.type) { + const e5 = Z(n4, t4); + return e5 !== x && t4.has(e5) ? { type: 1, feature: e5 } : x; + } + if (7 === r3.type) { + e4.consume(1); + const r4 = Y(e4, false); + let u3 = 1; + const o3 = Z(n4, t4, (e5) => e5.startsWith("min-") ? (u3 = 3, e5.substring(4)) : e5.startsWith("max-") ? (u3 = 5, e5.substring(4)) : e5); + return o3 !== x ? { type: 2, feature: o3, bounds: [null, [u3, r4]] } : x; + } + const u2 = J(e4); + if (u2 === x) return x; + const o2 = Y(e4, false); + if (0 === e4.at(1).type) { + const e5 = Z(n4, t4); + if (e5 !== x) return { type: 2, feature: e5, bounds: [null, [u2, o2]] }; + const r4 = Z(o2, t4); + return r4 !== x ? { type: 2, feature: r4, bounds: [[u2, n4], null] } : x; + } + const s2 = J(e4); + if (s2 === x || !(X(u2) && X(s2) || K(u2) && K(s2))) return x; + const l2 = Y(e4, false), c2 = Z(o2, t4); + return c2 !== x ? { type: 2, feature: c2, bounds: [[u2, n4], [s2, l2]] } : x; + }(e3, ie); + if (n3 === x) return x; + const r2 = ce[n3.feature]; + if (null == r2) return x; + if (t3.features.add(r2), 1 === n3.type) return { type: 5, feature: r2 }; + { + const e4 = { type: 5, feature: r2 }; + let t4 = x; + if (null !== n3.bounds[0]) { + const r3 = ve(n3.bounds[0][1]); + if (r3 === x) return x; + t4 = { type: 4, operator: n3.bounds[0][0], left: r3, right: e4 }; + } + if (null !== n3.bounds[1]) { + const r3 = ve(n3.bounds[1][1]); + if (r3 === x) return x; + const u2 = { type: 4, operator: n3.bounds[1][0], left: e4, right: r3 }; + t4 = t4 !== x ? { type: 2, left: t4, right: u2 } : u2; + } + return t4; + } + }(C(e2.value.value.value), t2); + if (n2 !== x) return n2; + } + return { type: 6, value: { type: 1 } }; + } +} +var Ae = 0; +var Ee = { cqw: m, cqh: w, cqi: g, cqb: b }; +var ze = CSS.supports("selector(:where(div))"); +var Le = ":not(.container-query-polyfill)"; +N(Array.from($(Le))); +var je = document.createElement("div"); +var Me = /* @__PURE__ */ new Set(["before", "after", "first-line", "first-letter"]); +function Te(e2, t2) { + return re("calc", [{ type: 17, flag: e2.flag, value: e2.value }, ee("*"), t2]); +} +function Pe(t2) { + return t2.map((t3) => { + switch (t3.type) { + case 15: + return function(e2) { + const t4 = e2.unit, n2 = Ee[t4]; + return null != n2 ? Te(e2, ue(n2)) : "cqmin" === t4 || "cqmax" === t4 ? Te(e2, re(e2.unit.slice(2), [ue(g), { type: 6 }, ue(b)])) : e2; + }(t3); + case 27: + return e({}, t3, { value: Pe(t3.value) }); + } + return t3; + }); +} +function Ne(t2) { + switch (t2.name) { + case "container": + return Ce(t2.value) ? e({}, t2, { name: p }) : t2; + case "container-name": + return xe(C(t2.value), true) ? e({}, t2, { name: h }) : t2; + case "container-type": + return null != qe(C(t2.value), true) ? e({}, t2, { name: y }) : t2; + } + return e({}, t2, { value: Pe(t2.value) }); +} +function Oe(t2, n2) { + return e({}, t2, { value: t2.value.map((t3) => { + switch (t3.type) { + case 25: + return He(t3, n2); + case 26: + return function(t4, n3) { + return n3.transformStyleRule(e({}, t4, { value: Re(t4.value, n3) })); + }(t3, n2); + default: + return t3; + } + }) }); +} +function Fe(e2) { + return 0 === e2.type || 6 === e2.type; +} +function Ue(e2) { + for (let t2 = e2.length - 1; t2 >= 0; t2--) if (1 !== e2[t2].type) return e2.slice(0, t2 + 1); + return e2; +} +function Re(t2, n2) { + return function(t3, n3) { + const r2 = []; + let u2 = null, o2 = null; + for (const e2 of t3.value.value) switch (e2.type) { + case 25: + { + const t4 = n3 ? n3(e2) : e2; + t4 && r2.push(t4); + } + break; + case 29: { + const t4 = Ne(e2); + switch (t4.name) { + case p: { + const t5 = Ce(e2.value); + t5 !== x && (u2 = t5[0], o2 = t5[1]); + break; + } + case h: { + const t5 = xe(C(e2.value), true); + t5 !== x && (u2 = t5); + break; + } + case y: { + const t5 = qe(C(e2.value), true); + t5 !== x && (o2 = t5); + break; + } + default: + r2.push(t4); + } + } + } + return u2 && u2.length > 0 && r2.push(te(h, [ne(u2.join(" "))])), o2 && o2.length > 0 && r2.push(te(y, [ne(o2.join(" "))])), e({}, t3, { value: { type: 2, value: r2 } }); + }(t2, (e2) => He(e2, n2)); +} +function Ie(t2) { + if (1 === t2.type) return e({}, t2, { value: Ie(t2.value) }); + if (2 === t2.type || 3 === t2.type) return e({}, t2, { left: Ie(t2.left), right: Ie(t2.right) }); + if (4 === t2.type && 28 === t2.value.type) { + const n2 = function(e2) { + const t3 = C(e2); + return F(t3), 24 !== t3.at(1).type ? x : I(t3) || x; + }(t2.value.value.value); + if (n2 !== x) return e({}, t2, { value: e({}, t2.value, { value: { type: 0, value: [Ne(n2)] } }) }); + } + return t2; +} +function Qe(t2, n2) { + let r2 = se(C(t2.prelude)); + return r2 = r2 !== x ? Ie(r2) : x, e({}, t2, { prelude: r2 !== x ? le(r2) : t2.prelude, value: t2.value ? e({}, t2.value, { value: Oe(P(t2.value.value.value), n2) }) : null }); +} +function He(t2, n2) { + switch (t2.name.toLocaleLowerCase()) { + case "media": + case "layer": + return function(t3, n3) { + return e({}, t3, { value: t3.value ? e({}, t3.value, { value: Oe(P(t3.value.value.value), n3) }) : null }); + }(t2, n2); + case "keyframes": + return function(t3, n3) { + let r2 = null; + return t3.value && (r2 = e({}, t3.value, { value: { type: 3, value: P(t3.value.value.value).value.map((t4) => { + switch (t4.type) { + case 26: + return function(t5, n4) { + return e({}, t5, { value: Re(t5.value, n4) }); + }(t4, n3); + case 25: + return He(t4, n3); + } + }) } })), e({}, t3, { value: r2 }); + }(t2, n2); + case "supports": + return Qe(t2, n2); + case "container": + return function(t3, n3) { + if (t3.value) { + const r2 = $e(t3.prelude); + if (r2 !== x) { + const u2 = { rule: r2, selector: null, parent: n3.parent, uid: "c" + Ae++ }, o2 = /* @__PURE__ */ new Set(), s2 = [], l2 = Oe(P(t3.value.value.value), { descriptors: n3.descriptors, parent: u2, transformStyleRule: (t4) => { + const [n4, r3] = function(e2, t5, n5) { + const r4 = C(e2), u3 = [], o3 = []; + for (; ; ) { + if (0 === r4.at(1).type) return [u3, o3]; + const n6 = Math.max(0, r4.index); + for (; l4 = r4.at(1), c2 = r4.at(2), !(Fe(l4) || 7 === l4.type && (7 === c2.type || 24 === c2.type && Me.has(c2.value.toLowerCase()))); ) r4.consume(1); + const i2 = r4.index + 1, a2 = e2.slice(n6, i2), f2 = a2.length > 0 ? Ue(a2) : [ee("*")]; + for (; !Fe(r4.at(1)); ) r4.consume(1); + const p2 = e2.slice(i2, Math.max(0, r4.index + 1)); + let y2 = f2, h2 = [{ type: 28, source: { type: 9 }, value: { type: 0, value: [ne(p2.length > 0 ? v : d), ee("~"), ee("="), { type: 2, value: t5 }] } }]; + if (ze) h2 = [ee(":"), re("where", h2)]; + else { + const e3 = f2.map(B).join(""); + e3.endsWith(Le) ? y2 = N(Array.from($(e3.substring(0, e3.length - Le.length)))) : s2.push({ actual: e3, expected: e3 + Le }); + } + u3.push(...f2), o3.push(...y2), o3.push(...h2), o3.push(...p2), r4.consume(1); + } + var l4, c2; + }(t4.prelude, u2.uid); + if (s2.length > 0) return t4; + const l3 = n4.map(B).join(""); + try { + je.matches(l3), o2.add(l3); + } catch (e2) { + } + return e({}, t4, { prelude: r3 }); + } }).value; + if (s2.length > 0) { + const e2 = /* @__PURE__ */ new Set(), t4 = []; + let n4 = 0; + for (const { actual: e3 } of s2) n4 = Math.max(n4, e3.length); + const r3 = Array.from({ length: n4 }, () => " ").join(""); + for (const { actual: u3, expected: o3 } of s2) e2.has(u3) || (t4.push(`${u3}${r3.substring(0, n4 - u3.length)} => ${o3}`), e2.add(u3)); + console.warn(`The :where() pseudo-class is not supported by this browser. To use the Container Query Polyfill, you must modify the selectors under your @container rules: + +${t4.join("\n")}`); + } + return o2.size > 0 && (u2.selector = Array.from(o2).join(", ")), n3.descriptors.push(u2), { type: 25, name: "media", prelude: [ne("all")], value: e({}, t3.value, { value: { type: 3, value: l2 } }) }; + } + } + return t3; + }(t2, n2); + } + return t2; +} +var Ve = class { + constructor(e2) { + this.value = void 0, this.value = e2; + } +}; +function De(e2, t2) { + if (e2 === t2) return true; + if (typeof e2 == typeof t2 && null !== e2 && null !== t2 && "object" == typeof e2) { + if (Array.isArray(e2)) { + if (!Array.isArray(t2) || t2.length !== e2.length) return false; + for (let n2 = 0, r2 = e2.length; n2 < r2; n2++) if (!De(e2[n2], t2[n2])) return false; + return true; + } + if (e2 instanceof Ve) return t2 instanceof Ve && e2.value === t2.value; + { + const n2 = Object.keys(e2); + if (n2.length !== Object.keys(t2).length) return false; + for (let r2 = 0, u2 = n2.length; r2 < u2; r2++) { + const u3 = n2[r2]; + if (!De(e2[u3], t2[u3])) return false; + } + return true; + } + } + return false; +} +var We = Symbol("CQ_INSTANCE"); +var _e = Symbol("CQ_STYLESHEET"); +var Be = CSS.supports("width: 1svh"); +var Ge = /* @__PURE__ */ new Set(["vertical-lr", "vertical-rl", "sideways-rl", "sideways-lr", "tb", "tb-lr", "tb-rl"]); +var Ye = ["padding-left", "padding-right", "border-left-width", "border-right-width"]; +var Je = ["padding-top", "padding-bottom", "border-top-width", "border-bottom-width"]; +var Ke = /(\w*(\s|-))?(table|ruby)(-\w*)?/; +var Xe = class { + constructor(e2) { + this.node = void 0, this.node = e2; + } + connected() { + } + disconnected() { + } + updated() { + } +}; +var Ze = class extends Xe { + constructor(e2, t2) { + super(e2), this.context = void 0, this.controller = null, this.styleSheet = null, this.context = t2; + } + connected() { + var e2 = this; + const t2 = this.node; + if ("stylesheet" === t2.rel) { + const n2 = new URL(t2.href, document.baseURI); + n2.origin === location.origin && (this.controller = rt(async function(r2) { + const u2 = await fetch(n2.toString(), { signal: r2 }), o2 = await u2.text(), s2 = e2.styleSheet = await e2.context.registerStyleSheet({ source: o2, url: n2, signal: r2 }), l2 = new Blob([s2.source], { type: "text/css" }), c2 = new Image(); + c2.onload = c2.onerror = s2.refresh, c2.src = t2.href = URL.createObjectURL(l2); + })); + } + } + disconnected() { + var e2, t2; + null == (e2 = this.controller) || e2.abort(), this.controller = null, null == (t2 = this.styleSheet) || t2.dispose(), this.styleSheet = null; + } +}; +var et = class extends Xe { + constructor(e2, t2) { + super(e2), this.context = void 0, this.controller = null, this.styleSheet = null, this.context = t2; + } + connected() { + var e2 = this; + this.controller = rt(async function(t2) { + const n2 = e2.node, r2 = e2.styleSheet = await e2.context.registerStyleSheet({ source: n2.innerHTML, signal: t2 }); + n2.innerHTML = r2.source, r2.refresh(); + }); + } + disconnected() { + var e2, t2; + null == (e2 = this.controller) || e2.abort(), this.controller = null, null == (t2 = this.styleSheet) || t2.dispose(), this.styleSheet = null; + } +}; +var tt = class extends Xe { + connected() { + const e2 = `* { ${y}: cq-normal; ${h}: cq-none; }`; + this.node.innerHTML = void 0 === window.CSSLayerBlockRule ? e2 : `@layer cq-polyfill-${f} { ${e2} }`; + } +}; +var nt = class extends Xe { + constructor(e2, t2) { + super(e2), this.context = void 0, this.styles = void 0, this.context = t2, this.styles = window.getComputedStyle(e2); + } + connected() { + this.node.style.cssText = "position: fixed; top: 0; left: 0; visibility: hidden; " + (Be ? "width: 1svw; height: 1svh;" : "width: 1%; height: 1%;"); + } + updated() { + const e2 = ct((e3) => this.styles.getPropertyValue(e3)); + this.context.viewportChanged({ width: e2.width, height: e2.height }); + } +}; +function rt(e2) { + const t2 = new AbortController(); + return e2(t2.signal).catch((e3) => { + if (!(e3 instanceof DOMException && "AbortError" === e3.message)) throw e3; + }), t2; +} +function ut(e2) { + let t2 = 0; + if (0 === e2.length) return t2; + if (e2.startsWith("cq-") && ("normal" === (e2 = e2.substring("cq-".length)) || ge(e2))) return t2; + const n2 = e2.split(" "); + for (const e3 of n2) switch (e3) { + case "size": + t2 |= 3; + break; + case "inline-size": + t2 |= 1; + break; + default: + return 0; + } + return t2; +} +function ot(e2) { + let t2 = 0; + return "none" !== e2 && (t2 |= 1, "contents" === e2 || "inline" === e2 || Ke.test(e2) || (t2 |= 2)), t2; +} +function st(e2, t2) { + return parseFloat(e2(t2)); +} +function lt(e2, t2) { + return t2.reduce((t3, n2) => t3 + st(e2, n2), 0); +} +function ct(e2) { + let t2 = 0, n2 = 0; + return "border-box" === e2("box-sizing") && (t2 = lt(e2, Ye), n2 = lt(e2, Je)), { fontSize: st(e2, "font-size"), width: st(e2, "width") - t2, height: st(e2, "height") - n2 }; +} +function it(e2) { + return { containerType: ut(e2(y).trim()), containerNames: (n2 = e2(h).trim(), n2.startsWith("cq-") && ("none" === (n2 = n2.substring("cq-".length)) || ge(n2)) ? /* @__PURE__ */ new Set([]) : new Set(0 === n2.length ? [] : n2.split(" "))), writingAxis: (t2 = e2("writing-mode").trim(), Ge.has(t2) ? 1 : 0), displayFlags: ot(e2("display").trim()) }; + var t2, n2; +} +function at(e2, t2, n2) { + null != n2 ? n2 != e2.getPropertyValue(t2) && e2.setProperty(t2, n2) : e2.removeProperty(t2); +} +function ft(e2) { + const t2 = e2[_e]; + return null != t2 ? t2 : []; +} +function pt(e2, t2) { + e2[_e] = t2; +} +new Promise((e2) => { +}), window.CQPolyfill = { version: "1.0.2" }, "container" in document.documentElement.style || function(n2) { + function r2(e2) { + return e2[We] || null; + } + const u2 = document.documentElement; + if (r2(u2)) return; + const o2 = document.createElement(`cq-polyfill-${f}`), s2 = document.createElement("style"); + new MutationObserver((e2) => { + for (const t2 of e2) { + for (const e3 of t2.removedNodes) { + const t3 = r2(e3); + null == t3 || t3.disconnect(); + } + t2.target.nodeType !== Node.DOCUMENT_NODE && t2.target.nodeType !== Node.DOCUMENT_FRAGMENT_NODE && null === t2.target.parentNode || "attributes" === t2.type && t2.attributeName && (t2.attributeName === v || t2.attributeName === d || t2.target instanceof Element && t2.target.getAttribute(t2.attributeName) === t2.oldValue) || (A2(t2.target).mutate(), S2()); + } + }).observe(u2, { childList: true, subtree: true, attributes: true, attributeOldValue: true }); + const l2 = new ResizeObserver((e2) => { + for (const t2 of e2) A2(t2.target).resize(); + A2(u2).update(C2()); + }), c2 = new Xe(u2); + async function a2(e2, { source: t2, url: n3, signal: r3 }) { + const o3 = function(e3, t3) { + try { + const n4 = Array.from($(e3)); + if (t3) for (let e4 = 0; e4 < n4.length; e4++) { + const r5 = n4[e4]; + if (20 === r5.type) r5.value = new URL(r5.value, t3).toString(); + else if (23 === r5.type && "url" === r5.value.toLowerCase()) { + const r6 = e4 + 1 < n4.length ? n4[e4 + 1] : null; + r6 && 2 === r6.type && (r6.value = new URL(r6.value, t3).toString()); + } + } + const r4 = { descriptors: [], parent: null, transformStyleRule: (e4) => e4 }; + return { source: _(Oe(P(n4, true), r4)), descriptors: r4.descriptors }; + } catch (t4) { + return console.warn("An error occurred while transpiling stylesheet: " + t4), { source: e3, descriptors: [] }; + } + }(t2, n3 ? n3.toString() : void 0); + let s3 = () => { + }, l3 = () => { + }; + const c3 = A2(u2); + let i2 = false; + return null != r3 && r3.aborted || (l3 = () => { + if (!i2) { + const { sheet: t3 } = e2; + null != t3 && (pt(t3, o3.descriptors), i2 = true, s3 = () => { + pt(t3), c3.mutate(), S2(); + }, c3.mutate(), S2()); + } + }), { source: o3.source, dispose: s3, refresh: l3 }; + } + const p2 = { cqw: null, cqh: null }; + function y2({ width: e2, height: t2 }) { + p2.cqw = e2, p2.cqh = t2; + } + function h2(e2, t2, n3) { + if (e2 instanceof Element && t2) { + let r3 = ""; + for (const [n4, u3] of t2.conditions) { + const t3 = n4.value; + null != t3.selector && null != u3 && 2 == (2 & u3) && e2.matches(t3.selector) && (r3.length > 0 && (r3 += " "), r3 += t3.uid); + } + r3.length > 0 ? e2.setAttribute(n3, r3) : e2.removeAttribute(n3); + } + } + function S2() { + l2.unobserve(u2), l2.observe(u2); + } + const x2 = () => { + const e2 = []; + for (const t2 of document.styleSheets) for (const n3 of ft(t2)) e2.push([new Ve(n3), 0]); + return e2; + }, q2 = window.getComputedStyle(u2), C2 = () => { + const t2 = (e2) => q2.getPropertyValue(e2), n3 = it(t2), r3 = ct(t2); + return { parentState: null, conditions: x2(), context: e({}, p2, { fontSize: r3.fontSize, rootFontSize: r3.fontSize, writingAxis: n3.writingAxis }), displayFlags: n3.displayFlags, isQueryContainer: false }; + }, k2 = (e2) => e2; + function A2(n3) { + let f2 = r2(n3); + if (!f2) { + let p3, S3 = null, x3 = false; + n3 === u2 ? (p3 = c2, S3 = k2) : n3 === o2 ? (x3 = true, p3 = new nt(o2, { viewportChanged: y2 })) : p3 = n3 === s2 ? new tt(s2) : n3 instanceof HTMLLinkElement ? new Ze(n3, { registerStyleSheet: (t2) => a2(n3, e({}, t2)) }) : n3 instanceof HTMLStyleElement ? new et(n3, { registerStyleSheet: (t2) => a2(n3, e({}, t2)) }) : new Xe(n3); + let q3 = Symbol(); + if (null == S3 && n3 instanceof Element) { + const r3 = function(n4) { + const r4 = window.getComputedStyle(n4); + return /* @__PURE__ */ function(n5) { + let u3 = null; + return (...n6) => { + if (null == u3 || !De(u3[0], n6)) { + const o3 = ((n7, u4) => { + const { context: o4, conditions: s3 } = n7, l3 = (e2) => r4.getPropertyValue(e2), c3 = it(l3), a3 = e({}, o4, { writingAxis: c3.writingAxis }); + let f3 = s3, p4 = false, y3 = c3.displayFlags; + 0 == (1 & n7.displayFlags) && (y3 = 0); + const { containerType: h3, containerNames: v2 } = c3; + if (h3 > 0) { + const e2 = h3 > 0 && 2 == (2 & y3), n8 = new Map(s3.map((e3) => [e3[0].value, e3[1]])); + if (f3 = [], p4 = true, e2) { + const e3 = ct(l3); + a3.fontSize = e3.fontSize; + const r5 = function(e4, t2) { + const n9 = { value: t2.width }, r6 = { value: t2.height }; + let u6 = n9, o5 = r6; + if (1 === e4.writingAxis) { + const e5 = u6; + u6 = o5, o5 = e5; + } + return 2 != (2 & e4.containerType) && (o5.value = void 0), { width: n9.value, height: r6.value, inlineSize: u6.value, blockSize: o5.value }; + }(c3, e3), u5 = { sizeFeatures: r5, treeContext: a3 }, p5 = (e4) => { + const { rule: r6 } = e4, o5 = r6.name, s4 = null == o5 || v2.has(o5) ? function(e5, n9) { + const r7 = /* @__PURE__ */ new Map(), u6 = n9.sizeFeatures; + for (const n10 of e5.features) { + const e6 = t(n10, u6); + if (1 === e6.type) return null; + r7.set(n10, e6); + } + const o6 = i(e5.condition, { sizeFeatures: r7, treeContext: n9.treeContext }); + return 5 === o6.type ? o6.value : null; + }(r6, u5) : null; + var l4; + return null == s4 ? 1 === ((null != (l4 = n8.get(e4)) ? l4 : 0) && 1) : true === s4; + }, y4 = (e4, t2) => { + let n9 = e4.get(t2); + if (null == n9) { + const r6 = p5(t2); + n9 = (r6 ? 1 : 0) | (true !== r6 || null != t2.parent && 1 != (1 & y4(e4, t2.parent)) ? 0 : 2), e4.set(t2, n9); + } + return n9; + }, h4 = /* @__PURE__ */ new Map(); + for (const e4 of s3) f3.push([e4[0], y4(h4, e4[0].value)]); + a3.cqw = null != r5.width ? r5.width / 100 : o4.cqw, a3.cqh = null != r5.height ? r5.height / 100 : o4.cqh; + } + } + return { parentState: new Ve(n7), conditions: f3, context: a3, displayFlags: y3, isQueryContainer: p4 }; + })(...n6); + null != u3 && De(u3[1], o3) || (u3 = [n6, o3]); + } + return u3[1]; + }; + }(); + }(n3); + S3 = (e2) => r3(e2, q3); + } + const C3 = S3 || k2; + let $2 = null; + const E2 = (e2) => { + const t2 = $2, n4 = C3(e2); + return $2 = n4, [$2, $2 !== t2]; + }, z2 = n3 instanceof HTMLElement || n3 instanceof SVGElement ? n3.style : null; + let L2 = false; + f2 = { connect() { + for (let e2 = n3.firstChild; null != e2; e2 = e2.nextSibling) A2(e2); + p3.connected(); + }, disconnect() { + n3 instanceof Element && (l2.unobserve(n3), n3.removeAttribute(v), n3.removeAttribute(d)), z2 && (z2.removeProperty(g), z2.removeProperty(b), z2.removeProperty(m), z2.removeProperty(w)); + for (let e2 = n3.firstChild; null != e2; e2 = e2.nextSibling) { + const t2 = r2(e2); + null == t2 || t2.disconnect(); + } + p3.disconnected(), delete n3[We]; + }, update(e2) { + const [t2, r3] = E2(e2); + if (r3) { + if (h2(n3, e2, d), h2(n3, t2, v), n3 instanceof Element) { + const e3 = x3 || t2.isQueryContainer; + e3 && !L2 ? (l2.observe(n3), L2 = true) : !e3 && L2 && (l2.unobserve(n3), L2 = false); + } + if (z2) { + const n4 = t2.context, r4 = n4.writingAxis; + let u3 = null, o3 = null, s3 = null, l3 = null; + (r4 !== e2.context.writingAxis || t2.isQueryContainer) && (u3 = `var(${0 === r4 ? m : w})`, o3 = `var(${1 === r4 ? m : w})`), e2 && !t2.isQueryContainer || (n4.cqw && (s3 = n4.cqw + "px"), n4.cqh && (l3 = n4.cqh + "px")), at(z2, g, u3), at(z2, b, o3), at(z2, m, s3), at(z2, w, l3); + } + p3.updated(); + } + for (let e3 = n3.firstChild; null != e3; e3 = e3.nextSibling) A2(e3).update(t2); + }, resize() { + q3 = Symbol(); + }, mutate() { + q3 = Symbol(); + for (let e2 = n3.firstChild; null != e2; e2 = e2.nextSibling) A2(e2).mutate(); + } }, n3[We] = f2, f2.connect(); + } + return f2; + } + u2.prepend(s2, o2), A2(u2), S2(); +}(); + // helpers/alpine.js var alpine_exports = {}; __export(alpine_exports, { getComponent: () => getComponent, getData: () => getData, @@ -295,13 +14657,13 @@ return components; } function getComponent(el, throwOnError = false) { try { return Alpine.$data(el); - } catch (error) { + } catch (error2) { if (throwOnError) { - throw error; + throw error2; } else { return null; } } } @@ -321,19 +14683,19 @@ isDark: () => isDark, isLight: () => isLight, isValidHex: () => isValidHex }); function isDark(color) { - let r; - let g; - let b; + let r2; + let g2; + let b2; let hsp; color = +`0x${color.slice(1).replace(color.length < 5 && /./g, "$&$&")}`; - r = color >> 16; - g = color >> 8 & 255; - b = color & 255; - hsp = Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b)); + r2 = color >> 16; + g2 = color >> 8 & 255; + b2 = color & 255; + hsp = Math.sqrt(0.299 * (r2 * r2) + 0.587 * (g2 * g2) + 0.114 * (b2 * b2)); if (hsp > 127.5) { return false; } return true; } @@ -366,23 +14728,23 @@ }); // helpers/lang.js var lang_exports = {}; __export(lang_exports, { - camelCase: () => camelCase, + camelCase: () => import_lodash.default, isNumeric: () => isNumeric, isObject: () => isObject, - kebabCase: () => kebabCase, - keyBy: () => keyBy, - mapValues: () => mapValues, + kebabCase: () => import_lodash2.default, + keyBy: () => import_lodash4.default, + mapValues: () => import_lodash3.default, nameFunction: () => nameFunction, roughSizeOfObject: () => roughSizeOfObject }); -import camelCase from "lodash.camelcase"; -import kebabCase from "lodash.kebabcase"; -import mapValues from "lodash.mapvalues"; -import keyBy from "lodash.keyby"; +var import_lodash = __toESM(require_lodash()); +var import_lodash2 = __toESM(require_lodash2()); +var import_lodash3 = __toESM(require_lodash3()); +var import_lodash4 = __toESM(require_lodash4()); function nameFunction(name, body) { return { [name](...args) { return body.apply(this, args); } @@ -408,12 +14770,12 @@ bytes += value.length * 2; } else if (typeof value === "number") { bytes += 8; } else if (typeof value === "object" && objectList.indexOf(value) === -1) { objectList.push(value); - for (var i in value) { - stack.push(value[i]); + for (var i2 in value) { + stack.push(value[i2]); } } } return bytes; } @@ -429,12 +14791,12 @@ if (isNumeric(value)) { return parseInt(value, 10); } return value; } -function isNode(o) { - return typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string"; +function isNode(o2) { + return typeof Node === "object" ? o2 instanceof Node : o2 && typeof o2 === "object" && typeof o2.nodeType === "number" && typeof o2.nodeName === "string"; } // helpers/location.js var location_exports = {}; __export(location_exports, { @@ -476,16 +14838,11 @@ ...location_exports, ...path_exports }; // base/tippy/index.js -import tippy, { - createSingleton, - followCursor, - roundArrow, - hideAll -} from "tippy.js"; +var import_tippy = __toESM(require_tippy_cjs()); // base/tippy/plugins/hide_on_esc.js var hideOnEsc = { name: "hideOnEsc", defaultValue: true, @@ -506,23 +14863,23 @@ } }; var hide_on_esc_default = hideOnEsc; // base/tippy/index.js -tippy.setDefaultProps({ +import_tippy.default.setDefaultProps({ theme: null, allowHTML: true, - arrow: roundArrow + roundArrow, - plugins: [hide_on_esc_default, followCursor] + arrow: import_tippy.roundArrow + import_tippy.roundArrow, + plugins: [hide_on_esc_default, import_tippy.followCursor] }); -var tippy_default = tippy; +var tippy_default = import_tippy.default; // base/alpine/index.js -import Alpine2 from "alpinejs"; -import morph from "@alpinejs/morph"; -import mask from "@alpinejs/mask"; -import focus from "@alpinejs/focus"; +var import_alpinejs = __toESM(require_module_cjs()); +var import_morph = __toESM(require_module_cjs2()); +var import_mask = __toESM(require_module_cjs3()); +var import_focus = __toESM(require_module_cjs4()); // base/alpine/directives/undo.js function undo_default(Alpine3) { const maxHistorySize = 100; Alpine3.directive("undo", (el, { expression }, { evaluate }) => { @@ -607,11 +14964,11 @@ }) ); effect(() => { Object.entries(data.$options).forEach(([key, value]) => { Alpine3.mutateDom(() => { - const attrName = `data-${kebabCase(key)}`; + const attrName = `data-${(0, import_lodash2.default)(key)}`; if (value === null) { el.removeAttribute(attrName); } else { el.setAttribute(attrName, value); } @@ -623,11 +14980,11 @@ const attrName = mutation.attributeName; if (mutation.type !== "attributes" || !optionAttrs.includes(attrName)) { return; } const value = mutation.target.getAttribute(attrName); - const option = camelCase(attrName.replace("data-", "")); + const option = (0, import_lodash.default)(attrName.replace("data-", "")); data.$options[option] = castAttributeValue(value); } }).observe(el, { attributes: true }); cleanup(() => { attrObserver && attrObserver.disconnect(); @@ -635,22 +14992,22 @@ } ).before("bind"); } function buildOptionsData(el, optionNames) { return optionNames.map((name) => { - const key = camelCase(name); - const attr = `data-${kebabCase(name)}`; + const key = (0, import_lodash.default)(name); + const attr = `data-${(0, import_lodash2.default)(name)}`; let value = null; if (el.hasAttribute(attr)) { const strValue = el.getAttribute(attr); value = castAttributeValue(strValue); } return { name, key, attr, value }; }); } function toPairs(optionsData) { - return mapValues(keyBy(optionsData, "key"), "value"); + return (0, import_lodash3.default)((0, import_lodash4.default)(optionsData, "key"), "value"); } // base/alpine/utils/tippy_modifiers.js function tippyModifiers(modifiers) { if (modifiers.length === 0) return {}; @@ -663,11 +15020,11 @@ if (modifiers.includes("duration")) { config.duration = parseInt(getModifierArgument("duration")); } if (modifiers.includes("delay")) { const delay = getModifierArgument("delay"); - config.delay = delay.includes("-") ? delay.split("-").map((n) => parseInt(n)) : parseInt(delay); + config.delay = delay.includes("-") ? delay.split("-").map((n2) => parseInt(n2)) : parseInt(delay); } if (modifiers.includes("debounce") && config.interactive) { config.interactiveDebounce = parseInt(getModifierArgument("debounce")); } if (modifiers.includes("theme")) { @@ -921,27 +15278,27 @@ evaluate("notification.init"); }).before("init"); } // base/alpine/index.js -window.Alpine = Alpine2; -Alpine2.plugin(mask); -Alpine2.plugin(focus); -Alpine2.plugin(morph); -Alpine2.plugin(undo_default); -Alpine2.plugin(options_default); -Alpine2.plugin(tooltip_default); -Alpine2.plugin(destroy_default); -Alpine2.plugin(dropdown_default); -Alpine2.plugin(dimensions_default); -Alpine2.plugin(notification_default); -var alpine_default = Alpine2; +window.Alpine = import_alpinejs.default; +import_alpinejs.default.plugin(import_mask.default); +import_alpinejs.default.plugin(import_focus.default); +import_alpinejs.default.plugin(import_morph.default); +import_alpinejs.default.plugin(undo_default); +import_alpinejs.default.plugin(options_default); +import_alpinejs.default.plugin(tooltip_default); +import_alpinejs.default.plugin(destroy_default); +import_alpinejs.default.plugin(dropdown_default); +import_alpinejs.default.plugin(dimensions_default); +import_alpinejs.default.plugin(notification_default); +var alpine_default = import_alpinejs.default; // ../../../package.json var package_default = { name: "coveragebook-components", - version: "0.18.7", + version: "0.18.8", repository: "git@github.com:coveragebook/coco.git", license: "NO LICENSE", author: "Mark Perkins <mark@coveragebook.com>", main: "app/assets/build/coco/coco.js", engines: { @@ -990,11 +15347,11 @@ "alias-hq": "^6.2.2", alpinejs: "^3.13.8", autoprefixer: "^10.4.16", "container-query-polyfill": "^1.0.2", del: "^7.1.0", - esbuild: "^0.22.0", + esbuild: "^0.23.0", "esbuild-plugin-copy": "^2.0.2", "fast-glob": "^3.3.1", "fast-sort": "^3.2.1", husky: "^9.0.11", "js-cookie": "^3.0.5", @@ -1178,11 +15535,11 @@ set loading(value) { this.$options.state = value === true ? "loading" : "default"; }, setState(name) { this.lastState = this.state; - this.$options.state = camelCase(name); + this.$options.state = (0, import_lodash.default)(name); }, resetState() { this.$options.state = this.lastState || "default"; this.lastState = this.$options.state; }, @@ -1306,12 +15663,12 @@ this.destroySingletonTooltip(); this.tooltipInstances = this.buttons.map((button) => { if (button.tippyInstance && button.shouldShowTooltip && button.shouldShowTooltip()) { return button.tippyInstance; } - }).filter((t) => t); - this.singletonTooltip = createSingleton(this.tooltipInstances, { + }).filter((t2) => t2); + this.singletonTooltip = (0, import_tippy.createSingleton)(this.tooltipInstances, { theme: "coco-tooltip", delay: 100, moveTransition: "transform 0.1s ease-out" }); }, @@ -1481,11 +15838,11 @@ }, get endGroupEl() { return this.$refs.endSection.firstElementChild; }, get groups() { - return [this.startGroupEl, this.endGroupEl].filter((g) => g).map((el) => getComponent(el, false)); + return [this.startGroupEl, this.endGroupEl].filter((g2) => g2).map((el) => getComponent(el, false)); }, init() { const toolbarWidth = this.$el.offsetWidth; let startSectionWidth = 0; let endSectionWidth = 0; @@ -1831,11 +16188,110 @@ // ../../components/coco/messaging/system_banner/system_banner.js var system_banner_exports = {}; __export(system_banner_exports, { default: () => system_banner_default }); -import Cookies from "js-cookie"; + +// ../../../node_modules/js-cookie/dist/js.cookie.mjs +function assign(target) { + for (var i2 = 1; i2 < arguments.length; i2++) { + var source = arguments[i2]; + for (var key in source) { + target[key] = source[key]; + } + } + return target; +} +var defaultConverter = { + read: function(value) { + if (value[0] === '"') { + value = value.slice(1, -1); + } + return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); + }, + write: function(value) { + return encodeURIComponent(value).replace( + /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, + decodeURIComponent + ); + } +}; +function init(converter, defaultAttributes) { + function set(name, value, attributes) { + if (typeof document === "undefined") { + return; + } + attributes = assign({}, defaultAttributes, attributes); + if (typeof attributes.expires === "number") { + attributes.expires = new Date(Date.now() + attributes.expires * 864e5); + } + if (attributes.expires) { + attributes.expires = attributes.expires.toUTCString(); + } + name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); + var stringifiedAttributes = ""; + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + stringifiedAttributes += "; " + attributeName; + if (attributes[attributeName] === true) { + continue; + } + stringifiedAttributes += "=" + attributes[attributeName].split(";")[0]; + } + return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes; + } + function get(name) { + if (typeof document === "undefined" || arguments.length && !name) { + return; + } + var cookies = document.cookie ? document.cookie.split("; ") : []; + var jar = {}; + for (var i2 = 0; i2 < cookies.length; i2++) { + var parts = cookies[i2].split("="); + var value = parts.slice(1).join("="); + try { + var found = decodeURIComponent(parts[0]); + jar[found] = converter.read(value, found); + if (name === found) { + break; + } + } catch (e2) { + } + } + return name ? jar[name] : jar; + } + return Object.create( + { + set, + get, + remove: function(name, attributes) { + set( + name, + "", + assign({}, attributes, { + expires: -1 + }) + ); + }, + withAttributes: function(attributes) { + return init(this.converter, assign({}, this.attributes, attributes)); + }, + withConverter: function(converter2) { + return init(assign({}, this.converter, converter2), this.attributes); + } + }, + { + attributes: { value: Object.freeze(defaultAttributes) }, + converter: { value: Object.freeze(converter) } + } + ); +} +var api = init(defaultConverter, { path: "/" }); + +// ../../components/coco/messaging/system_banner/system_banner.js var system_banner_default = CocoComponent("systemBanner", (opts = {}) => { return { cookieName: null, cookieValue: null, cookieExpiry: null, @@ -1845,11 +16301,11 @@ this.cookieExpiry = opts.cookieExpiry; }, onDismiss() { this.$dispatch("banner:dismiss", { banner: this }); if (this.shouldSetCookie) { - Cookies.set(this.cookieName, this.cookieValue, { + api.set(this.cookieName, this.cookieValue, { expires: this.cookieExpiry }); } }, remove() { @@ -1930,11 +16386,11 @@ this.frame.addEventListener("turbo:submit-end", this.onFrameSubmitEnd); this.$nextTick(() => this.show()); }, show() { this.open = true; - hideAll(); + (0, import_tippy.hideAll)(); setTimeout(() => { this.$dispatch("modal:shown"); }, 400); }, hide() { @@ -2080,11 +16536,11 @@ // ../../components/coco/pickers/color_picker/color_picker.js var color_picker_exports = {}; __export(color_picker_exports, { default: () => color_picker_default }); -import iro from "@jaames/iro"; +var import_iro = __toESM(require_iro()); var color_picker_default = CocoComponent("colorPicker", ({ selected }) => { return { selectedColor: selected, display: selected, updating: false, @@ -2129,11 +16585,11 @@ toggleAdvancedView() { this.colorWheel.show = !this.colorWheel.show; }, initColorWheel() { this.cleanupColorWheel(); - const colorWheel = new iro.ColorPicker(this.$refs.colorWheel, { + const colorWheel = new import_iro.default.ColorPicker(this.$refs.colorWheel, { width: this.$refs.swatches.clientWidth, color: this.selectedColor }); colorWheel.on("input:end", (color) => { if (!this.updating) { @@ -2358,5 +16814,34 @@ coco_default2 as default, helpers_default as helpers, tippy_default as tippy, export_tokens as tokens }; +/*! Bundled license information: + +@alpinejs/focus/dist/module.cjs.js: + (*! Bundled license information: + + tabbable/dist/index.js: + (*! + * tabbable 5.3.3 + * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE + *) + + focus-trap/dist/focus-trap.js: + (*! + * focus-trap 6.9.4 + * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE + *) + *) + +@jaames/iro/dist/iro.js: + (*! + * iro.js v5.5.2 + * 2016-2021 James Daniel + * Licensed under MPL 2.0 + * github.com/jaames/iro.js + *) + +js-cookie/dist/js.cookie.mjs: + (*! js-cookie v3.0.5 | MIT *) +*/