var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name41 in all)
__defProp(target, name41, { get: all[name41], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/base64.js
var require_base64 = __commonJS({
"node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/base64.js"(exports) {
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
exports.encode = function(number3) {
if (0 <= number3 && number3 < intToCharMap.length) {
return intToCharMap[number3];
}
throw new TypeError("Must be between 0 and 63: " + number3);
};
exports.decode = function(charCode) {
var bigA = 65;
var bigZ = 90;
var littleA = 97;
var littleZ = 122;
var zero2 = 48;
var nine = 57;
var plus = 43;
var slash = 47;
var littleOffset = 26;
var numberOffset = 52;
if (bigA <= charCode && charCode <= bigZ) {
return charCode - bigA;
}
if (littleA <= charCode && charCode <= littleZ) {
return charCode - littleA + littleOffset;
}
if (zero2 <= charCode && charCode <= nine) {
return charCode - zero2 + numberOffset;
}
if (charCode == plus) {
return 62;
}
if (charCode == slash) {
return 63;
}
return -1;
};
}
});
// node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/base64-vlq.js
var require_base64_vlq = __commonJS({
"node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/base64-vlq.js"(exports) {
var base64 = require_base64();
var VLQ_BASE_SHIFT = 5;
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
var VLQ_BASE_MASK = VLQ_BASE - 1;
var VLQ_CONTINUATION_BIT = VLQ_BASE;
function toVLQSigned(aValue) {
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
}
function fromVLQSigned(aValue) {
var isNegative = (aValue & 1) === 1;
var shifted = aValue >> 1;
return isNegative ? -shifted : shifted;
}
exports.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var digit;
var vlq = toVLQSigned(aValue);
do {
digit = vlq & VLQ_BASE_MASK;
vlq >>>= VLQ_BASE_SHIFT;
if (vlq > 0) {
digit |= VLQ_CONTINUATION_BIT;
}
encoded += base64.encode(digit);
} while (vlq > 0);
return encoded;
};
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
var strLen = aStr.length;
var result = 0;
var shift2 = 0;
var continuation, digit;
do {
if (aIndex >= strLen) {
throw new Error("Expected more digits in base 64 VLQ value.");
}
digit = base64.decode(aStr.charCodeAt(aIndex++));
if (digit === -1) {
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
}
continuation = !!(digit & VLQ_CONTINUATION_BIT);
digit &= VLQ_BASE_MASK;
result = result + (digit << shift2);
shift2 += VLQ_BASE_SHIFT;
} while (continuation);
aOutParam.value = fromVLQSigned(result);
aOutParam.rest = aIndex;
};
}
});
// node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/util.js
var require_util = __commonJS({
"node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/util.js"(exports) {
function getArg(aArgs, aName, aDefaultValue) {
if (aName in aArgs) {
return aArgs[aName];
} else if (arguments.length === 3) {
return aDefaultValue;
} else {
throw new Error('"' + aName + '" is a required argument.');
}
}
exports.getArg = getArg;
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
var dataUrlRegexp = /^data:.+\,.+$/;
function urlParse(aUrl) {
var match = aUrl.match(urlRegexp);
if (!match) {
return null;
}
return {
scheme: match[1],
auth: match[2],
host: match[3],
port: match[4],
path: match[5]
};
}
exports.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url = "";
if (aParsedUrl.scheme) {
url += aParsedUrl.scheme + ":";
}
url += "//";
if (aParsedUrl.auth) {
url += aParsedUrl.auth + "@";
}
if (aParsedUrl.host) {
url += aParsedUrl.host;
}
if (aParsedUrl.port) {
url += ":" + aParsedUrl.port;
}
if (aParsedUrl.path) {
url += aParsedUrl.path;
}
return url;
}
exports.urlGenerate = urlGenerate;
var MAX_CACHED_INPUTS = 32;
function lruMemoize(f) {
var cache = [];
return function(input) {
for (var i = 0; i < cache.length; i++) {
if (cache[i].input === input) {
var temp = cache[0];
cache[0] = cache[i];
cache[i] = temp;
return cache[0].result;
}
}
var result = f(input);
cache.unshift({
input,
result
});
if (cache.length > MAX_CACHED_INPUTS) {
cache.pop();
}
return result;
};
}
var normalize = lruMemoize(function normalize2(aPath) {
var path = aPath;
var url = urlParse(aPath);
if (url) {
if (!url.path) {
return aPath;
}
path = url.path;
}
var isAbsolute = exports.isAbsolute(path);
var parts = [];
var start = 0;
var i = 0;
while (true) {
start = i;
i = path.indexOf("/", start);
if (i === -1) {
parts.push(path.slice(start));
break;
} else {
parts.push(path.slice(start, i));
while (i < path.length && path[i] === "/") {
i++;
}
}
}
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
part = parts[i];
if (part === ".") {
parts.splice(i, 1);
} else if (part === "..") {
up++;
} else if (up > 0) {
if (part === "") {
parts.splice(i + 1, up);
up = 0;
} else {
parts.splice(i, 2);
up--;
}
}
}
path = parts.join("/");
if (path === "") {
path = isAbsolute ? "/" : ".";
}
if (url) {
url.path = path;
return urlGenerate(url);
}
return path;
});
exports.normalize = normalize;
function join(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
if (aPath === "") {
aPath = ".";
}
var aPathUrl = urlParse(aPath);
var aRootUrl = urlParse(aRoot);
if (aRootUrl) {
aRoot = aRootUrl.path || "/";
}
if (aPathUrl && !aPathUrl.scheme) {
if (aRootUrl) {
aPathUrl.scheme = aRootUrl.scheme;
}
return urlGenerate(aPathUrl);
}
if (aPathUrl || aPath.match(dataUrlRegexp)) {
return aPath;
}
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
aRootUrl.host = aPath;
return urlGenerate(aRootUrl);
}
var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
if (aRootUrl) {
aRootUrl.path = joined;
return urlGenerate(aRootUrl);
}
return joined;
}
exports.join = join;
exports.isAbsolute = function(aPath) {
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
};
function relative(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
aRoot = aRoot.replace(/\/$/, "");
var level = 0;
while (aPath.indexOf(aRoot + "/") !== 0) {
var index = aRoot.lastIndexOf("/");
if (index < 0) {
return aPath;
}
aRoot = aRoot.slice(0, index);
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
return aPath;
}
++level;
}
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports.relative = relative;
var supportsNullProto = function() {
var obj = /* @__PURE__ */ Object.create(null);
return !("__proto__" in obj);
}();
function identity(s) {
return s;
}
function toSetString(aStr) {
if (isProtoString(aStr)) {
return "$" + aStr;
}
return aStr;
}
exports.toSetString = supportsNullProto ? identity : toSetString;
function fromSetString(aStr) {
if (isProtoString(aStr)) {
return aStr.slice(1);
}
return aStr;
}
exports.fromSetString = supportsNullProto ? identity : fromSetString;
function isProtoString(s) {
if (!s) {
return false;
}
var length = s.length;
if (length < 9) {
return false;
}
if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
return false;
}
for (var i = length - 10; i >= 0; i--) {
if (s.charCodeAt(i) !== 36) {
return false;
}
}
return true;
}
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByOriginalPositions = compareByOriginalPositions;
function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
var cmp;
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
function strcmp(aStr1, aStr2) {
if (aStr1 === aStr2) {
return 0;
}
if (aStr1 === null) {
return 1;
}
if (aStr2 === null) {
return -1;
}
if (aStr1 > aStr2) {
return 1;
}
return -1;
}
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
function parseSourceMapInput(str) {
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
}
exports.parseSourceMapInput = parseSourceMapInput;
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
sourceURL = sourceURL || "";
if (sourceRoot) {
if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
sourceRoot += "/";
}
sourceURL = sourceRoot + sourceURL;
}
if (sourceMapURL) {
var parsed = urlParse(sourceMapURL);
if (!parsed) {
throw new Error("sourceMapURL could not be parsed");
}
if (parsed.path) {
var index = parsed.path.lastIndexOf("/");
if (index >= 0) {
parsed.path = parsed.path.substring(0, index + 1);
}
}
sourceURL = join(urlGenerate(parsed), sourceURL);
}
return normalize(sourceURL);
}
exports.computeSourceURL = computeSourceURL;
}
});
// node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/array-set.js
var require_array_set = __commonJS({
"node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/array-set.js"(exports) {
var util = require_util();
var has = Object.prototype.hasOwnProperty;
var hasNativeMap = typeof Map !== "undefined";
function ArraySet() {
this._array = [];
this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
}
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
var set = new ArraySet();
for (var i = 0, len = aArray.length; i < len; i++) {
set.add(aArray[i], aAllowDuplicates);
}
return set;
};
ArraySet.prototype.size = function ArraySet_size() {
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
};
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
var idx = this._array.length;
if (!isDuplicate || aAllowDuplicates) {
this._array.push(aStr);
}
if (!isDuplicate) {
if (hasNativeMap) {
this._set.set(aStr, idx);
} else {
this._set[sStr] = idx;
}
}
};
ArraySet.prototype.has = function ArraySet_has(aStr) {
if (hasNativeMap) {
return this._set.has(aStr);
} else {
var sStr = util.toSetString(aStr);
return has.call(this._set, sStr);
}
};
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
if (hasNativeMap) {
var idx = this._set.get(aStr);
if (idx >= 0) {
return idx;
}
} else {
var sStr = util.toSetString(aStr);
if (has.call(this._set, sStr)) {
return this._set[sStr];
}
}
throw new Error('"' + aStr + '" is not in the set.');
};
ArraySet.prototype.at = function ArraySet_at(aIdx) {
if (aIdx >= 0 && aIdx < this._array.length) {
return this._array[aIdx];
}
throw new Error("No element indexed by " + aIdx);
};
ArraySet.prototype.toArray = function ArraySet_toArray() {
return this._array.slice();
};
exports.ArraySet = ArraySet;
}
});
// node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/mapping-list.js
var require_mapping_list = __commonJS({
"node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/mapping-list.js"(exports) {
var util = require_util();
function generatedPositionAfter(mappingA, mappingB) {
var lineA = mappingA.generatedLine;
var lineB = mappingB.generatedLine;
var columnA = mappingA.generatedColumn;
var columnB = mappingB.generatedColumn;
return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
}
function MappingList() {
this._array = [];
this._sorted = true;
this._last = { generatedLine: -1, generatedColumn: 0 };
}
MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
this._array.forEach(aCallback, aThisArg);
};
MappingList.prototype.add = function MappingList_add(aMapping) {
if (generatedPositionAfter(this._last, aMapping)) {
this._last = aMapping;
this._array.push(aMapping);
} else {
this._sorted = false;
this._array.push(aMapping);
}
};
MappingList.prototype.toArray = function MappingList_toArray() {
if (!this._sorted) {
this._array.sort(util.compareByGeneratedPositionsInflated);
this._sorted = true;
}
return this._array;
};
exports.MappingList = MappingList;
}
});
// node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/source-map-generator.js
var require_source_map_generator = __commonJS({
"node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/lib/source-map-generator.js"(exports) {
var base64VLQ = require_base64_vlq();
var util = require_util();
var ArraySet = require_array_set().ArraySet;
var MappingList = require_mapping_list().MappingList;
function SourceMapGenerator2(aArgs) {
if (!aArgs) {
aArgs = {};
}
this._file = util.getArg(aArgs, "file", null);
this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
this._skipValidation = util.getArg(aArgs, "skipValidation", false);
this._sources = new ArraySet();
this._names = new ArraySet();
this._mappings = new MappingList();
this._sourcesContents = null;
}
SourceMapGenerator2.prototype._version = 3;
SourceMapGenerator2.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
var generator = new SourceMapGenerator2({
file: aSourceMapConsumer.file,
sourceRoot
});
aSourceMapConsumer.eachMapping(function(mapping) {
var newMapping = {
generated: {
line: mapping.generatedLine,
column: mapping.generatedColumn
}
};
if (mapping.source != null) {
newMapping.source = mapping.source;
if (sourceRoot != null) {
newMapping.source = util.relative(sourceRoot, newMapping.source);
}
newMapping.original = {
line: mapping.originalLine,
column: mapping.originalColumn
};
if (mapping.name != null) {
newMapping.name = mapping.name;
}
}
generator.addMapping(newMapping);
});
aSourceMapConsumer.sources.forEach(function(sourceFile) {
var sourceRelative = sourceFile;
if (sourceRoot !== null) {
sourceRelative = util.relative(sourceRoot, sourceFile);
}
if (!generator._sources.has(sourceRelative)) {
generator._sources.add(sourceRelative);
}
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
generator.setSourceContent(sourceFile, content);
}
});
return generator;
};
SourceMapGenerator2.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
var generated = util.getArg(aArgs, "generated");
var original = util.getArg(aArgs, "original", null);
var source = util.getArg(aArgs, "source", null);
var name41 = util.getArg(aArgs, "name", null);
if (!this._skipValidation) {
this._validateMapping(generated, original, source, name41);
}
if (source != null) {
source = String(source);
if (!this._sources.has(source)) {
this._sources.add(source);
}
}
if (name41 != null) {
name41 = String(name41);
if (!this._names.has(name41)) {
this._names.add(name41);
}
}
this._mappings.add({
generatedLine: generated.line,
generatedColumn: generated.column,
originalLine: original != null && original.line,
originalColumn: original != null && original.column,
source,
name: name41
});
};
SourceMapGenerator2.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
var source = aSourceFile;
if (this._sourceRoot != null) {
source = util.relative(this._sourceRoot, source);
}
if (aSourceContent != null) {
if (!this._sourcesContents) {
this._sourcesContents = /* @__PURE__ */ Object.create(null);
}
this._sourcesContents[util.toSetString(source)] = aSourceContent;
} else if (this._sourcesContents) {
delete this._sourcesContents[util.toSetString(source)];
if (Object.keys(this._sourcesContents).length === 0) {
this._sourcesContents = null;
}
}
};
SourceMapGenerator2.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
var sourceFile = aSourceFile;
if (aSourceFile == null) {
if (aSourceMapConsumer.file == null) {
throw new Error(
`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
);
}
sourceFile = aSourceMapConsumer.file;
}
var sourceRoot = this._sourceRoot;
if (sourceRoot != null) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
var newSources = new ArraySet();
var newNames = new ArraySet();
this._mappings.unsortedForEach(function(mapping) {
if (mapping.source === sourceFile && mapping.originalLine != null) {
var original = aSourceMapConsumer.originalPositionFor({
line: mapping.originalLine,
column: mapping.originalColumn
});
if (original.source != null) {
mapping.source = original.source;
if (aSourceMapPath != null) {
mapping.source = util.join(aSourceMapPath, mapping.source);
}
if (sourceRoot != null) {
mapping.source = util.relative(sourceRoot, mapping.source);
}
mapping.originalLine = original.line;
mapping.originalColumn = original.column;
if (original.name != null) {
mapping.name = original.name;
}
}
}
var source = mapping.source;
if (source != null && !newSources.has(source)) {
newSources.add(source);
}
var name41 = mapping.name;
if (name41 != null && !newNames.has(name41)) {
newNames.add(name41);
}
}, this);
this._sources = newSources;
this._names = newNames;
aSourceMapConsumer.sources.forEach(function(sourceFile2) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
if (content != null) {
if (aSourceMapPath != null) {
sourceFile2 = util.join(aSourceMapPath, sourceFile2);
}
if (sourceRoot != null) {
sourceFile2 = util.relative(sourceRoot, sourceFile2);
}
this.setSourceContent(sourceFile2, content);
}
}, this);
};
SourceMapGenerator2.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
throw new Error(
"original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
);
}
if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
return;
} else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
return;
} else {
throw new Error("Invalid mapping: " + JSON.stringify({
generated: aGenerated,
source: aSource,
original: aOriginal,
name: aName
}));
}
};
SourceMapGenerator2.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
var previousOriginalColumn = 0;
var previousOriginalLine = 0;
var previousName = 0;
var previousSource = 0;
var result = "";
var next;
var mapping;
var nameIdx;
var sourceIdx;
var mappings = this._mappings.toArray();
for (var i = 0, len = mappings.length; i < len; i++) {
mapping = mappings[i];
next = "";
if (mapping.generatedLine !== previousGeneratedLine) {
previousGeneratedColumn = 0;
while (mapping.generatedLine !== previousGeneratedLine) {
next += ";";
previousGeneratedLine++;
}
} else {
if (i > 0) {
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
continue;
}
next += ",";
}
}
next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
previousGeneratedColumn = mapping.generatedColumn;
if (mapping.source != null) {
sourceIdx = this._sources.indexOf(mapping.source);
next += base64VLQ.encode(sourceIdx - previousSource);
previousSource = sourceIdx;
next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
previousOriginalLine = mapping.originalLine - 1;
next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
previousOriginalColumn = mapping.originalColumn;
if (mapping.name != null) {
nameIdx = this._names.indexOf(mapping.name);
next += base64VLQ.encode(nameIdx - previousName);
previousName = nameIdx;
}
}
result += next;
}
return result;
};
SourceMapGenerator2.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
return aSources.map(function(source) {
if (!this._sourcesContents) {
return null;
}
if (aSourceRoot != null) {
source = util.relative(aSourceRoot, source);
}
var key = util.toSetString(source);
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
}, this);
};
SourceMapGenerator2.prototype.toJSON = function SourceMapGenerator_toJSON() {
var map = {
version: this._version,
sources: this._sources.toArray(),
names: this._names.toArray(),
mappings: this._serializeMappings()
};
if (this._file != null) {
map.file = this._file;
}
if (this._sourceRoot != null) {
map.sourceRoot = this._sourceRoot;
}
if (this._sourcesContents) {
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
}
return map;
};
SourceMapGenerator2.prototype.toString = function SourceMapGenerator_toString() {
return JSON.stringify(this.toJSON());
};
exports.SourceMapGenerator = SourceMapGenerator2;
}
});
// node_modules/.pnpm/@unocss+core@0.46.0/node_modules/@unocss/core/dist/index.mjs
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function escapeSelector(str) {
const length = str.length;
let index = -1;
let codeUnit;
let result = "";
const firstCodeUnit = str.charCodeAt(0);
while (++index < length) {
codeUnit = str.charCodeAt(index);
if (codeUnit === 0) {
result += "\uFFFD";
continue;
}
if (codeUnit === 44) {
result += "\\,";
continue;
}
if (codeUnit >= 1 && codeUnit <= 31 || codeUnit === 127 || index === 0 && codeUnit >= 48 && codeUnit <= 57 || index === 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit === 45) {
result += `\\${codeUnit.toString(16)} `;
continue;
}
if (index === 0 && length === 1 && codeUnit === 45) {
result += `\\${str.charAt(index)}`;
continue;
}
if (codeUnit >= 128 || codeUnit === 45 || codeUnit === 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
result += str.charAt(index);
continue;
}
result += `\\${str.charAt(index)}`;
}
return result;
}
var e = escapeSelector;
function toArray(value = []) {
return Array.isArray(value) ? value : [value];
}
function uniq(value) {
return Array.from(new Set(value));
}
function isString(s) {
return typeof s === "string";
}
function normalizeCSSEntries(obj) {
if (isString(obj))
return obj;
return (!Array.isArray(obj) ? Object.entries(obj) : obj).filter((i) => i[1] != null);
}
function normalizeCSSValues(obj) {
if (Array.isArray(obj)) {
if (obj.find((i) => !Array.isArray(i) || Array.isArray(i[0])))
return obj.map((i) => normalizeCSSEntries(i));
else
return [obj];
} else {
return [normalizeCSSEntries(obj)];
}
}
function clearIdenticalEntries(entry) {
return entry.filter(([k, v], idx) => {
if (k.startsWith("$$"))
return false;
for (let i = idx - 1; i >= 0; i--) {
if (entry[i][0] === k && entry[i][1] === v)
return false;
}
return true;
});
}
function entriesToCss(arr) {
if (arr == null)
return "";
return clearIdenticalEntries(arr).map(([key, value]) => value != null ? `${key}:${value};` : void 0).filter(Boolean).join("");
}
function isObject(item) {
return item && typeof item === "object" && !Array.isArray(item);
}
function mergeDeep(original, patch) {
const o = original;
const p = patch;
if (Array.isArray(o))
return [...p];
const output = { ...o };
if (isObject(o) && isObject(p)) {
Object.keys(p).forEach((key) => {
if (isObject(o[key]) && isObject(p[key]) || Array.isArray(o[key]) && Array.isArray(p[key]))
output[key] = mergeDeep(o[key], p[key]);
else
Object.assign(output, { [key]: p[key] });
});
}
return output;
}
function clone(val) {
let k, out, tmp;
if (Array.isArray(val)) {
out = Array(k = val.length);
while (k--)
out[k] = (tmp = val[k]) && typeof tmp === "object" ? clone(tmp) : tmp;
return out;
}
if (Object.prototype.toString.call(val) === "[object Object]") {
out = {};
for (k in val) {
if (k === "__proto__") {
Object.defineProperty(out, k, {
value: clone(val[k]),
configurable: true,
enumerable: true,
writable: true
});
} else {
out[k] = (tmp = val[k]) && typeof tmp === "object" ? clone(tmp) : tmp;
}
}
return out;
}
return val;
}
function isStaticRule(rule) {
return isString(rule[0]);
}
function isStaticShortcut(sc) {
return isString(sc[0]);
}
var attributifyRE = /^\[(.+?)~?="(.*)"\]$/;
var cssIdRE = /\.(css|postcss|sass|scss|less|stylus|styl)($|\?)/;
var validateFilterRE = /[\w\u00A0-\uFFFF-_:%-?]/;
var CONTROL_SHORTCUT_NO_MERGE = "$$shortcut-no-merge";
function isAttributifySelector(selector2) {
return selector2.match(attributifyRE);
}
function isValidSelector(selector2 = "") {
return validateFilterRE.test(selector2);
}
function normalizeVariant(variant) {
return typeof variant === "function" ? { match: variant } : variant;
}
function isRawUtil(util) {
return util.length === 3;
}
function notNull(value) {
return value != null;
}
function noop() {
}
var TwoKeyMap = class {
constructor() {
this._map = /* @__PURE__ */ new Map();
}
get(key1, key2) {
const m2 = this._map.get(key1);
if (m2)
return m2.get(key2);
}
getFallback(key1, key2, fallback) {
let m2 = this._map.get(key1);
if (!m2) {
m2 = /* @__PURE__ */ new Map();
this._map.set(key1, m2);
}
if (!m2.has(key2))
m2.set(key2, fallback);
return m2.get(key2);
}
set(key1, key2, value) {
let m2 = this._map.get(key1);
if (!m2) {
m2 = /* @__PURE__ */ new Map();
this._map.set(key1, m2);
}
m2.set(key2, value);
return this;
}
has(key1, key2) {
return this._map.get(key1)?.has(key2);
}
delete(key1, key2) {
return this._map.get(key1)?.delete(key2) || false;
}
deleteTop(key1) {
return this._map.delete(key1);
}
map(fn) {
return Array.from(this._map.entries()).flatMap(
([k1, m2]) => Array.from(m2.entries()).map(([k2, v]) => {
return fn(v, k1, k2);
})
);
}
};
var regexClassGroup = /((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;
function expandVariantGroup(str, seperators = ["-", ":"], depth = 5) {
regexClassGroup.lastIndex = 0;
let hasChanged = false;
let content = str.toString();
do {
const before = content;
content = content.replace(
regexClassGroup,
(from, pre, sep, body) => {
if (!seperators.includes(sep))
return from;
return body.split(/\s/g).filter(Boolean).map((i) => i === "~" ? pre : i.replace(/^(!?)(.*)/, `$1${pre}${sep}$2`)).join(" ");
}
);
hasChanged = content !== before;
depth -= 1;
} while (hasChanged && depth);
if (typeof str === "string") {
return content;
} else {
return str.length() ? str.overwrite(0, str.length(), content) : str;
}
}
var warned = /* @__PURE__ */ new Set();
function warnOnce(msg) {
if (warned.has(msg))
return;
console.warn("[unocss]", msg);
warned.add(msg);
}
function createValueHandler(handlers) {
const handler2 = function(str) {
const s = this.__options?.sequence || [];
this.__options.sequence = [];
for (const n of s) {
const res = handlers[n](str);
if (res != null)
return res;
}
};
function addProcessor(that, name41) {
if (!that.__options) {
that.__options = {
sequence: []
};
}
that.__options.sequence.push(name41);
return that;
}
for (const name41 of Object.keys(handlers)) {
Object.defineProperty(handler2, name41, {
enumerable: true,
get() {
return addProcessor(this, name41);
}
});
}
return handler2;
}
var splitCode = (code2) => [...new Set(code2.split(/\\?[\s'"`;={}]+/g))].filter(isValidSelector);
var extractorSplit = {
name: "split",
order: 0,
extract({ code: code2 }) {
return splitCode(code2);
}
};
function createNanoEvents() {
return {
events: {},
emit(event, ...args) {
(this.events[event] || []).forEach((i) => i(...args));
},
on(event, cb) {
(this.events[event] = this.events[event] || []).push(cb);
return () => this.events[event] = (this.events[event] || []).filter((i) => i !== cb);
}
};
}
var LAYER_DEFAULT = "default";
var LAYER_PREFLIGHTS = "preflights";
var LAYER_SHORTCUTS = "shortcuts";
var DEFAULT_LAYERS = {
[LAYER_PREFLIGHTS]: -100,
[LAYER_SHORTCUTS]: -10,
[LAYER_DEFAULT]: 0
};
function resolveShortcuts(shortcuts2) {
return toArray(shortcuts2).flatMap((s) => {
if (Array.isArray(s))
return [s];
return Object.entries(s);
});
}
function resolvePreset(preset2) {
const shortcuts2 = preset2.shortcuts ? resolveShortcuts(preset2.shortcuts) : void 0;
preset2.shortcuts = shortcuts2;
if (preset2.prefix || preset2.layer) {
const apply = (i) => {
if (!i[2])
i[2] = {};
const meta = i[2];
if (meta.prefix == null && preset2.prefix)
meta.prefix = preset2.prefix;
if (meta.layer == null && preset2.layer)
meta.prefix = preset2.layer;
};
shortcuts2?.forEach(apply);
preset2.rules?.forEach(apply);
}
return preset2;
}
function resolveConfig(userConfig = {}, defaults = {}) {
const config = Object.assign({}, defaults, userConfig);
const rawPresets = (config.presets || []).flatMap(toArray).map(resolvePreset);
const sortedPresets = [
...rawPresets.filter((p) => p.enforce === "pre"),
...rawPresets.filter((p) => !p.enforce),
...rawPresets.filter((p) => p.enforce === "post")
];
const layers = Object.assign(DEFAULT_LAYERS, ...rawPresets.map((i) => i.layers), userConfig.layers);
function mergePresets(key) {
return uniq([
...sortedPresets.flatMap((p) => toArray(p[key] || [])),
...toArray(config[key] || [])
]);
}
const extractors = mergePresets("extractors");
if (!extractors.length)
extractors.push(extractorSplit);
extractors.sort((a, b) => (a.order || 0) - (b.order || 0));
const rules3 = mergePresets("rules");
const rulesStaticMap = {};
const rulesSize = rules3.length;
const rulesDynamic = rules3.map((rule, i) => {
if (isStaticRule(rule)) {
const prefix = rule[2]?.prefix || "";
rulesStaticMap[prefix + rule[0]] = [i, rule[1], rule[2], rule];
return void 0;
}
return [i, ...rule];
}).filter(Boolean).reverse();
const theme3 = clone([
...sortedPresets.map((p) => p.theme || {}),
config.theme || {}
].reduce((a, p) => mergeDeep(a, p), {}));
mergePresets("extendTheme").forEach((extendTheme) => extendTheme(theme3));
const autocomplete = {
templates: uniq(sortedPresets.map((p) => toArray(p.autocomplete?.templates)).flat()),
extractors: sortedPresets.map((p) => toArray(p.autocomplete?.extractors)).flat().sort((a, b) => (a.order || 0) - (b.order || 0))
};
return {
mergeSelectors: true,
warn: true,
blocklist: [],
sortLayers: (layers2) => layers2,
...config,
presets: sortedPresets,
envMode: config.envMode || "build",
shortcutsLayer: config.shortcutsLayer || "shortcuts",
layers,
theme: theme3,
rulesSize,
rulesDynamic,
rulesStaticMap,
preprocess: mergePresets("preprocess"),
postprocess: mergePresets("postprocess"),
preflights: mergePresets("preflights"),
autocomplete,
variants: mergePresets("variants").map(normalizeVariant),
shortcuts: resolveShortcuts(mergePresets("shortcuts")),
extractors,
safelist: mergePresets("safelist")
};
}
var version = "0.46.0";
var UnoGenerator = class {
constructor(userConfig = {}, defaults = {}) {
this.userConfig = userConfig;
this.defaults = defaults;
this.version = version;
this._cache = /* @__PURE__ */ new Map();
this.blocked = /* @__PURE__ */ new Set();
this.parentOrders = /* @__PURE__ */ new Map();
this.events = createNanoEvents();
this.config = resolveConfig(userConfig, defaults);
this.events.emit("config", this.config);
}
setConfig(userConfig, defaults) {
if (!userConfig)
return;
if (defaults)
this.defaults = defaults;
this.userConfig = userConfig;
this.blocked.clear();
this.parentOrders.clear();
this._cache.clear();
this.config = resolveConfig(userConfig, this.defaults);
this.events.emit("config", this.config);
}
async applyExtractors(code2, id, set = /* @__PURE__ */ new Set()) {
const context = {
get original() {
return code2;
},
code: code2,
id
};
for (const extractor of this.config.extractors) {
const result = await extractor.extract(context);
if (result) {
for (const token of result)
set.add(token);
}
}
return set;
}
makeContext(raw, applied) {
const context = {
rawSelector: raw,
currentSelector: applied[1],
theme: this.config.theme,
generator: this,
variantHandlers: applied[2],
constructCSS: (...args) => this.constructCustomCSS(context, ...args),
variantMatch: applied
};
return context;
}
async parseToken(raw, alias) {
if (this.blocked.has(raw))
return;
const cacheKey = `${raw}${alias ? ` ${alias}` : ""}`;
if (this._cache.has(cacheKey))
return this._cache.get(cacheKey);
let current = raw;
for (const p of this.config.preprocess)
current = p(raw);
if (this.isBlocked(current)) {
this.blocked.add(raw);
this._cache.set(cacheKey, null);
return;
}
const applied = this.matchVariants(raw, current);
if (!applied || this.isBlocked(applied[1])) {
this.blocked.add(raw);
this._cache.set(cacheKey, null);
return;
}
const context = this.makeContext(raw, [alias || applied[0], applied[1], applied[2], applied[3]]);
if (this.config.details)
context.variants = [...applied[3]];
const expanded = this.expandShortcut(context.currentSelector, context);
const utils = expanded ? await this.stringifyShortcuts(context.variantMatch, context, expanded[0], expanded[1]) : (await this.parseUtil(context.variantMatch, context))?.map((i) => this.stringifyUtil(i, context)).filter(notNull);
if (utils?.length) {
this._cache.set(cacheKey, utils);
return utils;
}
this._cache.set(cacheKey, null);
}
async generate(input, options = {}) {
const {
id,
scope,
preflights: preflights2 = true,
safelist = true,
minify = false
} = options;
const tokens = isString(input) ? await this.applyExtractors(input, id) : Array.isArray(input) ? new Set(input) : input;
if (safelist)
this.config.safelist.forEach((s) => tokens.add(s));
const nl = minify ? "" : "\n";
const layerSet = /* @__PURE__ */ new Set([LAYER_DEFAULT]);
const matched = /* @__PURE__ */ new Set();
const sheet = /* @__PURE__ */ new Map();
let preflightsMap = {};
const tokenPromises = Array.from(tokens).map(async (raw) => {
if (matched.has(raw))
return;
const payload = await this.parseToken(raw);
if (payload == null)
return;
matched.add(raw);
for (const item of payload) {
const parent = item[3] || "";
const layer = item[4]?.layer;
if (!sheet.has(parent))
sheet.set(parent, []);
sheet.get(parent).push(item);
if (layer)
layerSet.add(layer);
}
});
await Promise.all(tokenPromises);
await (async () => {
if (!preflights2)
return;
const preflightContext = {
generator: this,
theme: this.config.theme
};
const preflightLayerSet = /* @__PURE__ */ new Set([]);
this.config.preflights.forEach(({ layer = LAYER_PREFLIGHTS }) => {
layerSet.add(layer);
preflightLayerSet.add(layer);
});
preflightsMap = Object.fromEntries(
await Promise.all(Array.from(preflightLayerSet).map(
async (layer) => {
const preflights22 = await Promise.all(
this.config.preflights.filter((i) => (i.layer || LAYER_PREFLIGHTS) === layer).map(async (i) => await i.getCSS(preflightContext))
);
const css = preflights22.filter(Boolean).join(nl);
return [layer, css];
}
))
);
})();
const layers = this.config.sortLayers(
Array.from(layerSet).sort((a, b) => (this.config.layers[a] ?? 0) - (this.config.layers[b] ?? 0) || a.localeCompare(b))
);
const layerCache = {};
const getLayer = (layer) => {
if (layerCache[layer])
return layerCache[layer];
let css = Array.from(sheet).sort((a, b) => (this.parentOrders.get(a[0]) ?? 0) - (this.parentOrders.get(b[0]) ?? 0) || a[0]?.localeCompare(b[0] || "") || 0).map(([parent, items]) => {
const size = items.length;
const sorted = items.filter((i) => (i[4]?.layer || LAYER_DEFAULT) === layer).sort((a, b) => a[0] - b[0] || (a[4]?.sort || 0) - (b[4]?.sort || 0) || a[1]?.localeCompare(b[1] || "") || a[2]?.localeCompare(b[2] || "") || 0).map(([, selector2, body, , meta, , variantNoMerge]) => {
const scopedSelector = selector2 ? applyScope(selector2, scope) : selector2;
return [
[[scopedSelector ?? "", meta?.sort ?? 0]],
body,
!!(variantNoMerge ?? meta?.noMerge)
];
});
if (!sorted.length)
return void 0;
const rules3 = sorted.reverse().map(([selectorSortPair, body, noMerge], idx) => {
if (!noMerge && this.config.mergeSelectors) {
for (let i = idx + 1; i < size; i++) {
const current = sorted[i];
if (current && !current[2] && (selectorSortPair && current[0] || selectorSortPair == null && current[0] == null) && current[1] === body) {
if (selectorSortPair && current[0])
current[0].push(...selectorSortPair);
return null;
}
}
}
const selectors = selectorSortPair ? uniq(
selectorSortPair.sort((a, b) => a[1] - b[1] || a[0]?.localeCompare(b[0] || "") || 0).map((pair) => pair[0]).filter(Boolean)
) : [];
return selectors.length ? `${selectors.join(`,${nl}`)}{${body}}` : body;
}).filter(Boolean).reverse().join(nl);
if (!parent)
return rules3;
const parents = parent.split(" $$ ");
return `${parents.join("{")}{${nl}${rules3}${nl}}${parents.map((_) => "").join("}")}`;
}).filter(Boolean).join(nl);
if (preflights2) {
css = [preflightsMap[layer], css].filter(Boolean).join(nl);
}
const layerMark = minify ? "" : `/* layer: ${layer} */${nl}`;
return layerCache[layer] = css ? layerMark + css : "";
};
const getLayers = (includes = layers, excludes) => {
return includes.filter((i) => !excludes?.includes(i)).map((i) => getLayer(i) || "").filter(Boolean).join(nl);
};
return {
get css() {
return getLayers();
},
layers,
matched,
getLayers,
getLayer
};
}
matchVariants(raw, current) {
const variants3 = /* @__PURE__ */ new Set();
const handlers = [];
let processed = current || raw;
let applied = false;
const context = {
rawSelector: raw,
theme: this.config.theme,
generator: this
};
while (true) {
applied = false;
for (const v of this.config.variants) {
if (!v.multiPass && variants3.has(v))
continue;
let handler2 = v.match(processed, context);
if (!handler2)
continue;
if (isString(handler2))
handler2 = { matcher: handler2 };
processed = handler2.matcher;
handlers.unshift(handler2);
variants3.add(v);
applied = true;
break;
}
if (!applied)
break;
if (handlers.length > 500)
throw new Error(`Too many variants applied to "${raw}"`);
}
return [raw, processed, handlers, variants3];
}
applyVariants(parsed, variantHandlers = parsed[4], raw = parsed[1]) {
const handler2 = variantHandlers.slice().sort((a, b) => (a.order || 0) - (b.order || 0)).reduceRight(
(previous, v) => (input) => {
const entries = v.body?.(input.entries) || input.entries;
const parents = Array.isArray(v.parent) ? v.parent : [v.parent, void 0];
return (v.handle ?? defaultVariantHandler)({
...input,
entries,
selector: v.selector?.(input.selector, entries) || input.selector,
parent: parents[0] || input.parent,
parentOrder: parents[1] || input.parentOrder,
layer: v.layer || input.layer,
sort: v.sort || input.sort
}, previous);
},
(input) => input
);
const variantContextResult = handler2({
prefix: "",
selector: toEscapedSelector(raw),
pseudo: "",
entries: parsed[2]
});
const { parent, parentOrder } = variantContextResult;
if (parent != null && parentOrder != null)
this.parentOrders.set(parent, parentOrder);
const obj = {
selector: movePseudoElementsEnd([
variantContextResult.prefix,
variantContextResult.selector,
variantContextResult.pseudo
].join("")),
entries: variantContextResult.entries,
parent,
layer: variantContextResult.layer,
sort: variantContextResult.sort,
noMerge: variantContextResult.noMerge
};
for (const p of this.config.postprocess)
p(obj);
return obj;
}
constructCustomCSS(context, body, overrideSelector) {
const normalizedBody = normalizeCSSEntries(body);
if (isString(normalizedBody))
return normalizedBody;
const { selector: selector2, entries, parent } = this.applyVariants([0, overrideSelector || context.rawSelector, normalizedBody, void 0, context.variantHandlers]);
const cssBody = `${selector2}{${entriesToCss(entries)}}`;
if (parent)
return `${parent}{${cssBody}}`;
return cssBody;
}
async parseUtil(input, context, internal = false) {
const [raw, processed, variantHandlers] = isString(input) ? this.matchVariants(input) : input;
if (this.config.details)
context.rules = context.rules ?? [];
const staticMatch = this.config.rulesStaticMap[processed];
if (staticMatch) {
if (staticMatch[1] && (internal || !staticMatch[2]?.internal)) {
if (this.config.details)
context.rules.push(staticMatch[3]);
const index = staticMatch[0];
const entry = normalizeCSSEntries(staticMatch[1]);
const meta = staticMatch[2];
if (isString(entry))
return [[index, entry, meta]];
else
return [[index, raw, entry, meta, variantHandlers]];
}
}
context.variantHandlers = variantHandlers;
const { rulesDynamic } = this.config;
for (const [i, matcher, handler2, meta] of rulesDynamic) {
if (meta?.internal && !internal)
continue;
let unprefixed = processed;
if (meta?.prefix) {
if (!processed.startsWith(meta.prefix))
continue;
unprefixed = processed.slice(meta.prefix.length);
}
const match = unprefixed.match(matcher);
if (!match)
continue;
const result = await handler2(match, context);
if (!result)
continue;
if (this.config.details)
context.rules.push([matcher, handler2, meta]);
const entries = normalizeCSSValues(result).filter((i2) => i2.length);
if (entries.length) {
return entries.map((e2) => {
if (isString(e2))
return [i, e2, meta];
else
return [i, raw, e2, meta, variantHandlers];
});
}
}
}
stringifyUtil(parsed, context) {
if (!parsed)
return;
if (isRawUtil(parsed))
return [parsed[0], void 0, parsed[1], void 0, parsed[2], this.config.details ? context : void 0, void 0];
const { selector: selector2, entries, parent, layer: variantLayer, sort: variantSort, noMerge } = this.applyVariants(parsed);
const body = entriesToCss(entries);
if (!body)
return;
const { layer: metaLayer, sort: metaSort, ...meta } = parsed[3] ?? {};
const ruleMeta = {
...meta,
layer: variantLayer ?? metaLayer,
sort: variantSort ?? metaSort
};
return [parsed[0], selector2, body, parent, ruleMeta, this.config.details ? context : void 0, noMerge];
}
expandShortcut(input, context, depth = 5) {
if (depth === 0)
return;
const recordShortcut = this.config.details ? (s) => {
context.shortcuts = context.shortcuts ?? [];
context.shortcuts.push(s);
} : noop;
let meta;
let result;
for (const s of this.config.shortcuts) {
const unprefixed = s[2]?.prefix ? input.slice(s[2].prefix.length) : input;
if (isStaticShortcut(s)) {
if (s[0] === unprefixed) {
meta = meta || s[2];
result = s[1];
recordShortcut(s);
break;
}
} else {
const match = unprefixed.match(s[0]);
if (match)
result = s[1](match, context);
if (result) {
meta = meta || s[2];
recordShortcut(s);
break;
}
}
}
if (isString(result))
result = expandVariantGroup(result.trim()).split(/\s+/g);
if (!result) {
const [raw, inputWithoutVariant] = isString(input) ? this.matchVariants(input) : input;
if (raw !== inputWithoutVariant) {
const expanded = this.expandShortcut(inputWithoutVariant, context, depth - 1);
if (expanded)
result = expanded[0].map((item) => isString(item) ? raw.replace(inputWithoutVariant, item) : item);
}
}
if (!result)
return;
return [
result.flatMap((r2) => (isString(r2) ? this.expandShortcut(r2, context, depth - 1)?.[0] : void 0) || [r2]).filter(Boolean),
meta
];
}
async stringifyShortcuts(parent, context, expanded, meta = { layer: this.config.shortcutsLayer }) {
const selectorMap = new TwoKeyMap();
const parsed = (await Promise.all(uniq(expanded).map(async (i) => {
const result = isString(i) ? await this.parseUtil(i, context, true) : [[Infinity, "{inline}", normalizeCSSEntries(i), void 0, []]];
if (!result)
warnOnce(`unmatched utility "${i}" in shortcut "${parent[1]}"`);
return result || [];
}))).flat(1).filter(Boolean).sort((a, b) => a[0] - b[0]);
const [raw, , parentVariants] = parent;
const rawStringfieldUtil = [];
for (const item of parsed) {
if (isRawUtil(item)) {
rawStringfieldUtil.push([item[0], void 0, item[1], void 0, item[2], context, void 0]);
continue;
}
const { selector: selector2, entries, parent: parent2, sort, noMerge } = this.applyVariants(item, [...item[4], ...parentVariants], raw);
const mapItem = selectorMap.getFallback(selector2, parent2, [[], item[0]]);
mapItem[0].push([entries, !!(noMerge ?? item[3]?.noMerge), sort ?? 0]);
}
return rawStringfieldUtil.concat(selectorMap.map(([e2, index], selector2, joinedParents) => {
const stringify = (flatten, noMerge, entrySortPair) => {
const maxSort = Math.max(...entrySortPair.map((e3) => e3[1]));
const entriesList = entrySortPair.map((e3) => e3[0]);
return (flatten ? [entriesList.flat(1)] : entriesList).map((entries) => {
const body = entriesToCss(entries);
if (body)
return [index, selector2, body, joinedParents, { ...meta, noMerge, sort: maxSort }, context, void 0];
return void 0;
});
};
const merges = [
[e2.filter(([, noMerge]) => noMerge).map(([entries, , sort]) => [entries, sort]), true],
[e2.filter(([, noMerge]) => !noMerge).map(([entries, , sort]) => [entries, sort]), false]
];
return merges.map(([e3, noMerge]) => [
...stringify(false, noMerge, e3.filter(([entries]) => entries.some((entry) => entry[0] === CONTROL_SHORTCUT_NO_MERGE))),
...stringify(true, noMerge, e3.filter(([entries]) => entries.every((entry) => entry[0] !== CONTROL_SHORTCUT_NO_MERGE)))
]);
}).flat(2).filter(Boolean));
}
isBlocked(raw) {
return !raw || this.config.blocklist.some((e2) => isString(e2) ? e2 === raw : e2.test(raw));
}
};
function createGenerator(config, defaults) {
return new UnoGenerator(config, defaults);
}
var regexScopePlaceholder = / \$\$ /;
var hasScopePlaceholder = (css) => css.match(regexScopePlaceholder);
function applyScope(css, scope) {
if (hasScopePlaceholder(css))
return css.replace(regexScopePlaceholder, scope ? ` ${scope} ` : " ");
else
return scope ? `${scope} ${css}` : css;
}
function movePseudoElementsEnd(selector2) {
const pseudoElements = selector2.match(/::[\w-]+(\([\w-]+\))?/g);
if (pseudoElements) {
for (const e2 of pseudoElements)
selector2 = selector2.replace(e2, "");
selector2 += pseudoElements.join("");
}
return selector2;
}
var attributifyRe = /^\[(.+?)(~?=)"(.*)"\]$/;
function toEscapedSelector(raw) {
if (attributifyRe.test(raw))
return raw.replace(attributifyRe, (_, n, s, i) => `[${e(n)}${s}"${e(i)}"]`);
return `.${e(raw)}`;
}
function defaultVariantHandler(input, next) {
return next(input);
}
// node_modules/.pnpm/@unocss+runtime@0.46.0/node_modules/@unocss/runtime/dist/index.mjs
var camelize = (str) => str.replace(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
var hyphenate = (str) => str.replace(/(?:^|\B)([A-Z])/g, "-$1").toLowerCase();
var prefixes = ["Webkit", "Moz", "ms"];
function autoPrefixer(style) {
const prefixCache = {};
function autoPrefix(rawName) {
const cached = prefixCache[rawName];
if (cached)
return cached;
let name41 = camelize(rawName);
if (name41 !== "filter" && name41 in style)
return prefixCache[rawName] = hyphenate(name41);
name41 = capitalize(name41);
for (let i = 0; i < prefixes.length; i++) {
const prefixed = `${prefixes[i]}${name41}`;
if (prefixed in style)
return prefixCache[rawName] = hyphenate(capitalize(prefixed));
}
return rawName;
}
return ({ entries }) => entries.forEach((e2) => {
if (!e2[0].startsWith("--"))
e2[0] = autoPrefix(e2[0]);
});
}
function decodeHtml(html) {
return html.replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<");
}
function init(inlineConfig = {}) {
var _a, _b;
if (typeof window == "undefined") {
console.warn("@unocss/runtime been used in non-browser environment, skipped.");
return;
}
const defaultWindow = window;
const defaultDocument = document;
const userConfig = defaultWindow.__unocss || {};
const runtimeOptions = Object.assign({}, inlineConfig, userConfig.runtime);
const userConfigDefaults = runtimeOptions.defaults || {};
const cloakAttribute = runtimeOptions.cloakAttribute ?? "un-cloak";
if (runtimeOptions.autoPrefix) {
const postprocessors = userConfigDefaults.postprocess = toArray(userConfigDefaults.postprocess);
postprocessors.unshift(autoPrefixer(defaultDocument.createElement("div").style));
}
(_a = runtimeOptions.configResolved) == null ? void 0 : _a.call(runtimeOptions, userConfig, userConfigDefaults);
const uno = createGenerator(userConfig, userConfigDefaults);
let paused = true;
let tokens = /* @__PURE__ */ new Set();
let styleElement;
let inspector;
let _timer;
let _resolvers = [];
const scheduleUpdate = () => new Promise((resolve) => {
_resolvers.push(resolve);
if (_timer != null)
clearTimeout(_timer);
_timer = setTimeout(() => updateStyle().then(() => {
const resolvers = _resolvers;
_resolvers = [];
resolvers.forEach((r2) => r2());
}), 0);
});
function removeCloak(node) {
if (node.nodeType !== 1)
return;
const el = node;
if (el.hasAttribute(cloakAttribute))
el.removeAttribute(cloakAttribute);
el.querySelectorAll(`[${cloakAttribute}]`).forEach((n) => {
n.removeAttribute(cloakAttribute);
});
}
function getStyleElement() {
if (!styleElement) {
styleElement = defaultDocument.createElement("style");
defaultDocument.documentElement.prepend(styleElement);
}
return styleElement;
}
async function updateStyle() {
const result = await uno.generate(tokens);
const styleElement2 = getStyleElement();
styleElement2.innerHTML = result.css;
tokens = result.matched;
return {
...result,
styleElement: styleElement2
};
}
async function extract(str) {
const tokenSize = tokens.size;
await uno.applyExtractors(str, void 0, tokens);
if (tokenSize !== tokens.size)
await scheduleUpdate();
}
async function extractAll() {
const body = defaultDocument.body;
const html = body && body.outerHTML;
if (html) {
await extract(`${html} ${decodeHtml(html)}`);
removeCloak(body);
}
}
const mutationObserver = new MutationObserver((mutations) => {
if (paused)
return;
mutations.forEach(async (mutation) => {
if (mutation.target.nodeType !== 1)
return;
const target = mutation.target;
if (target === styleElement)
return;
if (mutation.type === "childList") {
mutation.addedNodes.forEach(async (node) => {
if (node.nodeType !== 1)
return;
const el = node;
if (inspector && !inspector(el))
return;
await extract(el.outerHTML);
removeCloak(el);
});
} else {
if (inspector && !inspector(target))
return;
if (mutation.attributeName !== cloakAttribute) {
const attrs = Array.from(target.attributes).map((i) => i.value ? `${i.name}="${i.value}"` : i.name).join(" ");
const tag = `<${target.tagName.toLowerCase()} ${attrs}>`;
await extract(tag);
}
if (target.hasAttribute(cloakAttribute))
target.removeAttribute(cloakAttribute);
}
});
});
let observing = false;
function observe() {
if (observing)
return;
const target = defaultDocument.documentElement || defaultDocument.body;
if (!target)
return;
mutationObserver.observe(target, {
childList: true,
subtree: true,
attributes: true
});
observing = true;
}
function execute() {
extractAll();
observe();
}
function ready() {
if (defaultDocument.readyState === "loading")
defaultWindow.addEventListener("DOMContentLoaded", execute);
else
execute();
}
const unoCssRuntime = defaultWindow.__unocss_runtime = defaultWindow.__unocss_runtime = {
version: uno.version,
uno,
async extract(userTokens) {
if (!isString(userTokens)) {
userTokens.forEach((t) => tokens.add(t));
userTokens = "";
}
await extract(userTokens);
},
extractAll,
inspect(callback) {
inspector = callback;
},
toggleObserver(set) {
if (set === void 0)
paused = !paused;
else
paused = !!set;
if (!observing && !paused)
ready();
},
update: updateStyle
};
if (((_b = runtimeOptions.ready) == null ? void 0 : _b.call(runtimeOptions, unoCssRuntime)) !== false) {
paused = false;
ready();
}
}
// node_modules/.pnpm/@unocss+preset-attributify@0.46.0/node_modules/@unocss/preset-attributify/dist/index.mjs
var variantsRE = /^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/;
var variantAttributify = (options = {}) => {
const prefix = options.prefix ?? "un-";
const prefixedOnly = options.prefixedOnly ?? false;
const trueToNonValued = options.trueToNonValued ?? false;
return {
name: "attributify",
match(input) {
const match = isAttributifySelector(input);
if (!match)
return;
let name41 = match[1];
if (name41.startsWith(prefix))
name41 = name41.slice(prefix.length);
else if (prefixedOnly)
return;
const content = match[2];
const [, variants3 = "", body = content] = content.match(variantsRE) || [];
if (body === "~" || trueToNonValued && body === "true" || !body)
return `${variants3}${name41}`;
else
return `${variants3}${name41}-${body}`;
}
};
};
var elementRE$1 = /(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`[^>]*?`|\{[^>]*?\}|[^>]*?)*)/g;
var valuedAttributeRE$1 = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-]+)(?:=("[^"]*|'[^']*))?/g;
var splitterRE$1 = /[\s'"`;>]+/;
var autocompleteExtractorAttributify = {
name: "attributify",
extract: ({ content, cursor }) => {
const matchedElements = content.matchAll(elementRE$1);
let attrs;
let elPos = 0;
for (const match of matchedElements) {
const [, prefix, content2] = match;
const currentPos2 = match.index + prefix.length;
if (cursor > currentPos2 && cursor <= currentPos2 + content2.length) {
elPos = currentPos2;
attrs = content2;
break;
}
}
if (!attrs)
return null;
const matchedAttributes = attrs.matchAll(valuedAttributeRE$1);
let attrsPos = 0;
let attrName;
let attrValues;
for (const match of matchedAttributes) {
const [matched, name41, rawValues] = match;
const currentPos2 = elPos + match.index;
if (cursor > currentPos2 && cursor <= currentPos2 + matched.length) {
attrsPos = currentPos2;
attrName = name41;
attrValues = rawValues?.slice(1);
break;
}
}
if (!attrName)
return null;
if (attrName === "class" || attrName === "className" || attrName === ":class")
return null;
if (attrValues === void 0) {
return {
extracted: attrName,
resolveReplacement(suggestion) {
return {
start: attrsPos,
end: attrsPos + attrName.length,
replacement: suggestion
};
}
};
}
const attrValuePos = attrsPos + attrName.length + 2;
let matchSplit = splitterRE$1.exec(attrValues);
let currentPos = 0;
let value;
while (matchSplit) {
const [matched] = matchSplit;
if (cursor > attrValuePos + currentPos && cursor <= attrValuePos + currentPos + matchSplit.index) {
value = attrValues.slice(currentPos, currentPos + matchSplit.index);
break;
}
currentPos += matchSplit.index + matched.length;
matchSplit = splitterRE$1.exec(attrValues.slice(currentPos));
}
if (value === void 0)
value = attrValues.slice(currentPos);
const [, variants3 = "", body] = value.match(variantsRE) || [];
return {
extracted: `${variants3}${attrName}-${body}`,
transformSuggestions(suggestions) {
return suggestions.filter((v) => v.startsWith(`${variants3}${attrName}-`)).map((v) => variants3 + v.slice(variants3.length + attrName.length + 1));
},
resolveReplacement(suggestion) {
return {
start: currentPos + attrValuePos,
end: currentPos + attrValuePos + value.length,
replacement: variants3 + suggestion.slice(variants3.length + attrName.length + 1)
};
}
};
}
};
var strippedPrefixes = [
"v-bind:",
":"
];
var splitterRE = /[\s'"`;]+/g;
var elementRE = /<\w(?=.*>)[\w:\.$-]*\s((?:['"`\{].*?['"`\}]|.*?)*?)>/gs;
var valuedAttributeRE = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)(?:={?(["'])([^\2]*?)\2}?)?/g;
var defaultIgnoreAttributes = ["placeholder"];
var extractorAttributify = (options) => {
const ignoreAttributes = options?.ignoreAttributes ?? defaultIgnoreAttributes;
const nonValuedAttribute = options?.nonValuedAttribute ?? true;
const trueToNonValued = options?.trueToNonValued ?? false;
return {
name: "attributify",
extract({ code: code2 }) {
const result = Array.from(code2.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name41, _, content]) => {
if (ignoreAttributes.includes(name41))
return [];
for (const prefix of strippedPrefixes) {
if (name41.startsWith(prefix)) {
name41 = name41.slice(prefix.length);
break;
}
}
if (!content) {
if (isValidSelector(name41) && nonValuedAttribute !== false) {
const result2 = [`[${name41}=""]`];
if (trueToNonValued)
result2.push(`[${name41}="true"]`);
return result2;
}
return [];
}
if (["class", "className"].includes(name41)) {
return content.split(splitterRE).filter(isValidSelector);
} else {
return content.split(splitterRE).filter(Boolean).map((v) => `[${name41}~="${v}"]`);
}
});
return new Set(result);
}
};
};
var preset = (options = {}) => {
options.strict = options.strict ?? false;
options.prefix = options.prefix ?? "un-";
options.prefixedOnly = options.prefixedOnly ?? false;
options.nonValuedAttribute = options.nonValuedAttribute ?? true;
options.ignoreAttributes = options.ignoreAttributes ?? defaultIgnoreAttributes;
const variants3 = [
variantAttributify(options)
];
const extractors = [
extractorAttributify(options)
];
const autocompleteExtractors = [
autocompleteExtractorAttributify
];
if (!options.strict)
extractors.unshift(extractorSplit);
return {
name: "@unocss/preset-attributify",
variants: variants3,
extractors,
options,
autocomplete: {
extractors: autocompleteExtractors
}
};
};
// node_modules/.pnpm/destr@1.2.0/node_modules/destr/dist/index.mjs
var suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
var JsonSigRx = /^["{[]|^-?[0-9][0-9.]{0,14}$/;
function jsonParseTransform(key, value) {
if (key === "__proto__" || key === "constructor") {
return;
}
return value;
}
function destr(val, options = {}) {
if (typeof val !== "string") {
return val;
}
const _lval = val.toLowerCase();
if (_lval === "true") {
return true;
}
if (_lval === "false") {
return false;
}
if (_lval === "null") {
return null;
}
if (_lval === "nan") {
return NaN;
}
if (_lval === "infinity") {
return Infinity;
}
if (_lval === "undefined") {
return void 0;
}
if (!JsonSigRx.test(val)) {
if (options.strict) {
throw new SyntaxError("Invalid JSON");
}
return val;
}
try {
if (suspectProtoRx.test(val) || suspectConstructorRx.test(val)) {
return JSON.parse(val, jsonParseTransform);
}
return JSON.parse(val);
} catch (error) {
if (options.strict) {
throw error;
}
return val;
}
}
// node_modules/.pnpm/ufo@0.8.6/node_modules/ufo/dist/index.mjs
var r = String.fromCharCode;
var HASH_RE = /#/g;
var AMPERSAND_RE = /&/g;
var EQUAL_RE = /=/g;
var PLUS_RE = /\+/g;
var ENC_BRACKET_OPEN_RE = /%5B/gi;
var ENC_BRACKET_CLOSE_RE = /%5D/gi;
var ENC_CARET_RE = /%5E/gi;
var ENC_BACKTICK_RE = /%60/gi;
var ENC_CURLY_OPEN_RE = /%7B/gi;
var ENC_PIPE_RE = /%7C/gi;
var ENC_CURLY_CLOSE_RE = /%7D/gi;
var ENC_SPACE_RE = /%20/gi;
function encode(text) {
return encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
}
function encodeQueryValue(text) {
return encode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
}
function encodeQueryKey(text) {
return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
}
function decode(text = "") {
try {
return decodeURIComponent("" + text);
} catch (_err) {
return "" + text;
}
}
function decodeQueryValue(text) {
return decode(text.replace(PLUS_RE, " "));
}
function parseQuery(paramsStr = "") {
const obj = {};
if (paramsStr[0] === "?") {
paramsStr = paramsStr.substr(1);
}
for (const param of paramsStr.split("&")) {
const s = param.match(/([^=]+)=?(.*)/) || [];
if (s.length < 2) {
continue;
}
const key = decode(s[1]);
if (key === "__proto__" || key === "constructor") {
continue;
}
const value = decodeQueryValue(s[2] || "");
if (obj[key]) {
if (Array.isArray(obj[key])) {
obj[key].push(value);
} else {
obj[key] = [obj[key], value];
}
} else {
obj[key] = value;
}
}
return obj;
}
function encodeQueryItem(key, val) {
if (typeof val === "number" || typeof val === "boolean") {
val = String(val);
}
if (!val) {
return encodeQueryKey(key);
}
if (Array.isArray(val)) {
return val.map((_val) => `${encodeQueryKey(key)}=${encodeQueryValue(_val)}`).join("&");
}
return `${encodeQueryKey(key)}=${encodeQueryValue(val)}`;
}
function stringifyQuery(query) {
return Object.keys(query).map((k) => encodeQueryItem(k, query[k])).join("&");
}
var PROTOCOL_REGEX = /^\w+:(\/\/)?/;
var PROTOCOL_RELATIVE_REGEX = /^\/\/[^/]+/;
function hasProtocol(inputStr, acceptProtocolRelative = false) {
return PROTOCOL_REGEX.test(inputStr) || acceptProtocolRelative && PROTOCOL_RELATIVE_REGEX.test(inputStr);
}
var TRAILING_SLASH_RE = /\/$|\/\?/;
function hasTrailingSlash(input = "", queryParams = false) {
if (!queryParams) {
return input.endsWith("/");
}
return TRAILING_SLASH_RE.test(input);
}
function withoutTrailingSlash(input = "", queryParams = false) {
if (!queryParams) {
return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
}
if (!hasTrailingSlash(input, true)) {
return input || "/";
}
const [s0, ...s] = input.split("?");
return (s0.slice(0, -1) || "/") + (s.length ? `?${s.join("?")}` : "");
}
function withTrailingSlash(input = "", queryParams = false) {
if (!queryParams) {
return input.endsWith("/") ? input : input + "/";
}
if (hasTrailingSlash(input, true)) {
return input || "/";
}
const [s0, ...s] = input.split("?");
return s0 + "/" + (s.length ? `?${s.join("?")}` : "");
}
function hasLeadingSlash(input = "") {
return input.startsWith("/");
}
function withoutLeadingSlash(input = "") {
return (hasLeadingSlash(input) ? input.substr(1) : input) || "/";
}
function withBase(input, base) {
if (isEmptyURL(base) || hasProtocol(input)) {
return input;
}
const _base = withoutTrailingSlash(base);
if (input.startsWith(_base)) {
return input;
}
return joinURL(_base, input);
}
function withQuery(input, query) {
const parsed = parseURL(input);
const mergedQuery = { ...parseQuery(parsed.search), ...query };
parsed.search = stringifyQuery(mergedQuery);
return stringifyParsedURL(parsed);
}
function isEmptyURL(url) {
return !url || url === "/";
}
function isNonEmptyURL(url) {
return url && url !== "/";
}
function joinURL(base, ...input) {
let url = base || "";
for (const i of input.filter(isNonEmptyURL)) {
url = url ? withTrailingSlash(url) + withoutLeadingSlash(i) : i;
}
return url;
}
function parseURL(input = "", defaultProto) {
if (!hasProtocol(input, true)) {
return defaultProto ? parseURL(defaultProto + input) : parsePath(input);
}
const [protocol = "", auth, hostAndPath = ""] = (input.replace(/\\/g, "/").match(/([^:/]+:)?\/\/([^/@]+@)?(.*)/) || []).splice(1);
const [host = "", path = ""] = (hostAndPath.match(/([^/?#]*)(.*)?/) || []).splice(1);
const { pathname, search, hash } = parsePath(path);
return {
protocol,
auth: auth ? auth.substr(0, auth.length - 1) : "",
host,
pathname,
search,
hash
};
}
function parsePath(input = "") {
const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
return {
pathname,
search,
hash
};
}
function stringifyParsedURL(parsed) {
const fullpath = parsed.pathname + (parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "") + parsed.hash;
if (!parsed.protocol) {
return fullpath;
}
return parsed.protocol + "//" + (parsed.auth ? parsed.auth + "@" : "") + parsed.host + fullpath;
}
// node_modules/.pnpm/ohmyfetch@0.4.20/node_modules/ohmyfetch/dist/shared/ohmyfetch.fb8dc89e.mjs
var FetchError = class extends Error {
constructor() {
super(...arguments);
this.name = "FetchError";
}
};
function createFetchError(request, error, response) {
let message = "";
if (request && response) {
message = `${response.status} ${response.statusText} (${request.toString()})`;
}
if (error) {
message = `${error.message} (${message})`;
}
const fetchError = new FetchError(message);
Object.defineProperty(fetchError, "request", { get() {
return request;
} });
Object.defineProperty(fetchError, "response", { get() {
return response;
} });
Object.defineProperty(fetchError, "data", { get() {
return response && response._data;
} });
return fetchError;
}
var payloadMethods = new Set(Object.freeze(["PATCH", "POST", "PUT", "DELETE"]));
function isPayloadMethod(method = "GET") {
return payloadMethods.has(method.toUpperCase());
}
function isJSONSerializable(val) {
if (val === void 0) {
return false;
}
const t = typeof val;
if (t === "string" || t === "number" || t === "boolean" || t === null) {
return true;
}
if (t !== "object") {
return false;
}
if (Array.isArray(val)) {
return true;
}
return val.constructor && val.constructor.name === "Object" || typeof val.toJSON === "function";
}
var textTypes = /* @__PURE__ */ new Set([
"image/svg",
"application/xml",
"application/xhtml",
"application/html"
]);
var JSON_RE = /^application\/(?:[\w!#$%&*`\-.^~]*\+)?json(;.+)?$/i;
function detectResponseType(_contentType = "") {
if (!_contentType) {
return "json";
}
const contentType = _contentType.split(";").shift();
if (JSON_RE.test(contentType)) {
return "json";
}
if (textTypes.has(contentType) || contentType.startsWith("text/")) {
return "text";
}
return "blob";
}
var retryStatusCodes = /* @__PURE__ */ new Set([
408,
409,
425,
429,
500,
502,
503,
504
]);
function createFetch(globalOptions) {
const { fetch: fetch3, Headers: Headers2 } = globalOptions;
function onError(ctx) {
const isAbort = ctx.error && ctx.error.name === "AbortError" || false;
if (ctx.options.retry !== false && !isAbort) {
const retries = typeof ctx.options.retry === "number" ? ctx.options.retry : isPayloadMethod(ctx.options.method) ? 0 : 1;
const responseCode = ctx.response && ctx.response.status || 500;
if (retries > 0 && retryStatusCodes.has(responseCode)) {
return $fetchRaw(ctx.request, {
...ctx.options,
retry: retries - 1
});
}
}
const err = createFetchError(ctx.request, ctx.error, ctx.response);
if (Error.captureStackTrace) {
Error.captureStackTrace(err, $fetchRaw);
}
throw err;
}
const $fetchRaw = async function $fetchRaw2(_request, _opts = {}) {
const ctx = {
request: _request,
options: { ...globalOptions.defaults, ..._opts },
response: void 0,
error: void 0
};
if (ctx.options.onRequest) {
await ctx.options.onRequest(ctx);
}
if (typeof ctx.request === "string") {
if (ctx.options.baseURL) {
ctx.request = withBase(ctx.request, ctx.options.baseURL);
}
if (ctx.options.query || ctx.options.params) {
ctx.request = withQuery(ctx.request, { ...ctx.options.params, ...ctx.options.query });
}
if (ctx.options.body && isPayloadMethod(ctx.options.method)) {
if (isJSONSerializable(ctx.options.body)) {
ctx.options.body = typeof ctx.options.body === "string" ? ctx.options.body : JSON.stringify(ctx.options.body);
ctx.options.headers = new Headers2(ctx.options.headers);
if (!ctx.options.headers.has("content-type")) {
ctx.options.headers.set("content-type", "application/json");
}
if (!ctx.options.headers.has("accept")) {
ctx.options.headers.set("accept", "application/json");
}
}
}
}
ctx.response = await fetch3(ctx.request, ctx.options).catch(async (error) => {
ctx.error = error;
if (ctx.options.onRequestError) {
await ctx.options.onRequestError(ctx);
}
return onError(ctx);
});
const responseType = (ctx.options.parseResponse ? "json" : ctx.options.responseType) || detectResponseType(ctx.response.headers.get("content-type") || "");
if (responseType === "json") {
const data = await ctx.response.text();
const parseFn = ctx.options.parseResponse || destr;
ctx.response._data = parseFn(data);
} else if (responseType === "stream") {
ctx.response._data = ctx.response.body;
} else {
ctx.response._data = await ctx.response[responseType]();
}
if (ctx.options.onResponse) {
await ctx.options.onResponse(ctx);
}
if (!ctx.response.ok) {
if (ctx.options.onResponseError) {
await ctx.options.onResponseError(ctx);
}
}
return ctx.response.ok ? ctx.response : onError(ctx);
};
const $fetch2 = function $fetch22(request, opts) {
return $fetchRaw(request, opts).then((r2) => r2._data);
};
$fetch2.raw = $fetchRaw;
$fetch2.create = (defaultOptions = {}) => createFetch({
...globalOptions,
defaults: {
...globalOptions.defaults,
...defaultOptions
}
});
return $fetch2;
}
// node_modules/.pnpm/ohmyfetch@0.4.20/node_modules/ohmyfetch/dist/index.mjs
var _globalThis = function() {
if (typeof globalThis !== "undefined") {
return globalThis;
}
if (typeof self !== "undefined") {
return self;
}
if (typeof window !== "undefined") {
return window;
}
if (typeof globalThis !== "undefined") {
return globalThis;
}
throw new Error("unable to locate global object");
}();
var fetch2 = _globalThis.fetch || (() => Promise.reject(new Error("[ohmyfetch] global.fetch is not supported!")));
var Headers = _globalThis.Headers;
var $fetch = createFetch({ fetch: fetch2, Headers });
// node_modules/.pnpm/@unocss+preset-icons@0.46.0/node_modules/@unocss/preset-icons/dist/shared/preset-icons.b465130e.mjs
var defaultIconDimensions = Object.freeze(
{
left: 0,
top: 0,
width: 16,
height: 16
}
);
var defaultIconTransformations = Object.freeze({
rotate: 0,
vFlip: false,
hFlip: false
});
var defaultIconProps = Object.freeze({
...defaultIconDimensions,
...defaultIconTransformations
});
var defaultExtendedIconProps = Object.freeze({
...defaultIconProps,
body: "",
hidden: false
});
var defaultIconSizeCustomisations = Object.freeze({
width: null,
height: null
});
var defaultIconCustomisations = Object.freeze({
...defaultIconSizeCustomisations,
...defaultIconTransformations
});
function mergeIconTransformations(obj1, obj2) {
const result = {};
if (!obj1.hFlip !== !obj2.hFlip) {
result.hFlip = true;
}
if (!obj1.vFlip !== !obj2.vFlip) {
result.vFlip = true;
}
const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
if (rotate) {
result.rotate = rotate;
}
return result;
}
function mergeIconData(parent, child) {
const result = mergeIconTransformations(parent, child);
for (const key in defaultExtendedIconProps) {
if (key in defaultIconTransformations) {
if (key in parent && !(key in result)) {
result[key] = defaultIconTransformations[key];
}
} else if (key in child) {
result[key] = child[key];
} else if (key in parent) {
result[key] = parent[key];
}
}
return result;
}
function getIconsTree(data, names) {
const icons = data.icons;
const aliases = data.aliases || {};
const resolved = /* @__PURE__ */ Object.create(null);
function resolve(name41) {
if (icons[name41]) {
return resolved[name41] = [];
}
if (!(name41 in resolved)) {
resolved[name41] = null;
const parent = aliases[name41] && aliases[name41].parent;
const value = parent && resolve(parent);
if (value) {
resolved[name41] = [parent].concat(value);
}
}
return resolved[name41];
}
(names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
return resolved;
}
function internalGetIconData(data, name41, tree) {
const icons = data.icons;
const aliases = data.aliases || {};
let currentProps = {};
function parse43(name210) {
currentProps = mergeIconData(
icons[name210] || aliases[name210],
currentProps
);
}
parse43(name41);
tree.forEach(parse43);
return mergeIconData(data, currentProps);
}
function getIconData(data, name41) {
if (data.icons[name41]) {
return internalGetIconData(data, name41, []);
}
const tree = getIconsTree(data, [name41])[name41];
return tree ? internalGetIconData(data, name41, tree) : null;
}
({
provider: "",
aliases: {},
not_found: {},
...defaultIconDimensions
});
Object.keys(defaultIconDimensions).concat([
"provider"
]);
var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
var unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
function calculateSize(size, ratio, precision) {
if (ratio === 1) {
return size;
}
precision = precision || 100;
if (typeof size === "number") {
return Math.ceil(size * ratio * precision) / precision;
}
if (typeof size !== "string") {
return size;
}
const oldParts = size.split(unitsSplit);
if (oldParts === null || !oldParts.length) {
return size;
}
const newParts = [];
let code2 = oldParts.shift();
let isNumber = unitsTest.test(code2);
while (true) {
if (isNumber) {
const num = parseFloat(code2);
if (isNaN(num)) {
newParts.push(code2);
} else {
newParts.push(Math.ceil(num * ratio * precision) / precision);
}
} else {
newParts.push(code2);
}
code2 = oldParts.shift();
if (code2 === void 0) {
return newParts.join("");
}
isNumber = !isNumber;
}
}
function iconToSVG(icon, customisations) {
const fullIcon = {
...defaultIconProps,
...icon
};
const fullCustomisations = {
...defaultIconCustomisations,
...customisations
};
const box = {
left: fullIcon.left,
top: fullIcon.top,
width: fullIcon.width,
height: fullIcon.height
};
let body = fullIcon.body;
[fullIcon, fullCustomisations].forEach((props) => {
const transformations = [];
const hFlip = props.hFlip;
const vFlip = props.vFlip;
let rotation = props.rotate;
if (hFlip) {
if (vFlip) {
rotation += 2;
} else {
transformations.push(
"translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
);
transformations.push("scale(-1 1)");
box.top = box.left = 0;
}
} else if (vFlip) {
transformations.push(
"translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
);
transformations.push("scale(1 -1)");
box.top = box.left = 0;
}
let tempValue;
if (rotation < 0) {
rotation -= Math.floor(rotation / 4) * 4;
}
rotation = rotation % 4;
switch (rotation) {
case 1:
tempValue = box.height / 2 + box.top;
transformations.unshift(
"rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
);
break;
case 2:
transformations.unshift(
"rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
);
break;
case 3:
tempValue = box.width / 2 + box.left;
transformations.unshift(
"rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
);
break;
}
if (rotation % 2 === 1) {
if (box.left !== box.top) {
tempValue = box.left;
box.left = box.top;
box.top = tempValue;
}
if (box.width !== box.height) {
tempValue = box.width;
box.width = box.height;
box.height = tempValue;
}
}
if (transformations.length) {
body = '' + body + "";
}
});
const customisationsWidth = fullCustomisations.width;
const customisationsHeight = fullCustomisations.height;
const boxWidth = box.width;
const boxHeight = box.height;
let width2;
let height2;
if (customisationsWidth === null) {
height2 = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
width2 = calculateSize(height2, boxWidth / boxHeight);
} else {
width2 = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
height2 = customisationsHeight === null ? calculateSize(width2, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
}
const result = {
attributes: {
width: width2.toString(),
height: height2.toString(),
viewBox: box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString()
},
body
};
return result;
}
"IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
function trimSVG(str) {
return str.replace(/(['"])\s*\n\s*([^>\\/\s])/g, "$1 $2").replace(/(["';{}><])\s*\n\s*/g, "$1").replace(/\s*\n\s*/g, " ").replace(/\s+"/g, '"').replace(/="\s+/g, '="').trim();
}
function add(keyword2, colors2) {
const type = "rgb";
const r2 = colors2[0];
const length = colors2.length;
({
type,
r: r2,
g: length > 1 ? colors2[1] : r2,
b: length > 2 ? colors2[2] : r2,
alpha: length > 3 ? colors2[3] : 1
});
}
add("silver", [192]);
add("gray", [128]);
add("white", [255]);
add("maroon", [128, 0, 0]);
add("red", [255, 0, 0]);
add("purple", [128, 0]);
add("fuchsia", [255, 0]);
add("green", [0, 128]);
add("lime", [0, 255]);
add("olive", [128, 128, 0]);
add("yellow", [255, 255, 0]);
add("navy", [0, 0, 128]);
add("blue", [0, 0, 255]);
add("teal", [0, 128, 128]);
add("aqua", [0, 255, 255]);
add("aliceblue", [240, 248, 255]);
add("antiquewhite", [250, 235, 215]);
add("aqua", [0, 255, 255]);
add("aquamarine", [127, 255, 212]);
add("azure", [240, 255, 255]);
add("beige", [245, 245, 220]);
add("bisque", [255, 228, 196]);
add("black", [0]);
add("blanchedalmond", [255, 235, 205]);
add("blue", [0, 0, 255]);
add("blueviolet", [138, 43, 226]);
add("brown", [165, 42, 42]);
add("burlywood", [222, 184, 135]);
add("cadetblue", [95, 158, 160]);
add("chartreuse", [127, 255, 0]);
add("chocolate", [210, 105, 30]);
add("coral", [255, 127, 80]);
add("cornflowerblue", [100, 149, 237]);
add("cornsilk", [255, 248, 220]);
add("crimson", [220, 20, 60]);
add("cyan", [0, 255, 255]);
add("darkblue", [0, 0, 139]);
add("darkcyan", [0, 139, 139]);
add("darkgoldenrod", [184, 134, 11]);
add("darkgray", [169]);
add("darkgreen", [0, 100]);
add("darkgrey", [169]);
add("darkkhaki", [189, 183, 107]);
add("darkmagenta", [139, 0]);
add("darkolivegreen", [85, 107, 47]);
add("darkorange", [255, 140, 0]);
add("darkorchid", [153, 50, 204]);
add("darkred", [139, 0, 0]);
add("darksalmon", [233, 150, 122]);
add("darkseagreen", [143, 188]);
add("darkslateblue", [72, 61, 139]);
add("darkslategray", [47, 79, 79]);
add("darkslategrey", [47, 79, 79]);
add("darkturquoise", [0, 206, 209]);
add("darkviolet", [148, 0, 211]);
add("deeppink", [255, 20, 147]);
add("deepskyblue", [0, 191, 255]);
add("dimgray", [105]);
add("dimgrey", [105]);
add("dodgerblue", [30, 144, 255]);
add("firebrick", [178, 34, 34]);
add("floralwhite", [255, 250, 240]);
add("forestgreen", [34, 139]);
add("fuchsia", [255, 0]);
add("gainsboro", [220]);
add("ghostwhite", [248, 248, 255]);
add("gold", [255, 215, 0]);
add("goldenrod", [218, 165, 32]);
add("gray", [128]);
add("green", [0, 128]);
add("greenyellow", [173, 255, 47]);
add("grey", [128]);
add("honeydew", [240, 255]);
add("hotpink", [255, 105, 180]);
add("indianred", [205, 92, 92]);
add("indigo", [75, 0, 130]);
add("ivory", [255, 255, 240]);
add("khaki", [240, 230, 140]);
add("lavender", [230, 230, 250]);
add("lavenderblush", [255, 240, 245]);
add("lawngreen", [124, 252, 0]);
add("lemonchiffon", [255, 250, 205]);
add("lightblue", [173, 216, 230]);
add("lightcoral", [240, 128, 128]);
add("lightcyan", [224, 255, 255]);
add("lightgoldenrodyellow", [250, 250, 210]);
add("lightgray", [211]);
add("lightgreen", [144, 238]);
add("lightgrey", [211]);
add("lightpink", [255, 182, 193]);
add("lightsalmon", [255, 160, 122]);
add("lightseagreen", [32, 178, 170]);
add("lightskyblue", [135, 206, 250]);
add("lightslategray", [119, 136, 153]);
add("lightslategrey", [119, 136, 153]);
add("lightsteelblue", [176, 196, 222]);
add("lightyellow", [255, 255, 224]);
add("lime", [0, 255]);
add("limegreen", [50, 205]);
add("linen", [250, 240, 230]);
add("magenta", [255, 0]);
add("maroon", [128, 0, 0]);
add("mediumaquamarine", [102, 205, 170]);
add("mediumblue", [0, 0, 205]);
add("mediumorchid", [186, 85, 211]);
add("mediumpurple", [147, 112, 219]);
add("mediumseagreen", [60, 179, 113]);
add("mediumslateblue", [123, 104, 238]);
add("mediumspringgreen", [0, 250, 154]);
add("mediumturquoise", [72, 209, 204]);
add("mediumvioletred", [199, 21, 133]);
add("midnightblue", [25, 25, 112]);
add("mintcream", [245, 255, 250]);
add("mistyrose", [255, 228, 225]);
add("moccasin", [255, 228, 181]);
add("navajowhite", [255, 222, 173]);
add("navy", [0, 0, 128]);
add("oldlace", [253, 245, 230]);
add("olive", [128, 128, 0]);
add("olivedrab", [107, 142, 35]);
add("orange", [255, 165, 0]);
add("orangered", [255, 69, 0]);
add("orchid", [218, 112, 214]);
add("palegoldenrod", [238, 232, 170]);
add("palegreen", [152, 251]);
add("paleturquoise", [175, 238, 238]);
add("palevioletred", [219, 112, 147]);
add("papayawhip", [255, 239, 213]);
add("peachpuff", [255, 218, 185]);
add("peru", [205, 133, 63]);
add("pink", [255, 192, 203]);
add("plum", [221, 160]);
add("powderblue", [176, 224, 230]);
add("purple", [128, 0]);
add("rebeccapurple", [102, 51, 153]);
add("red", [255, 0, 0]);
add("rosybrown", [188, 143, 143]);
add("royalblue", [65, 105, 225]);
add("saddlebrown", [139, 69, 19]);
add("salmon", [250, 128, 114]);
add("sandybrown", [244, 164, 96]);
add("seagreen", [46, 139, 87]);
add("seashell", [255, 245, 238]);
add("sienna", [160, 82, 45]);
add("silver", [192]);
add("skyblue", [135, 206, 235]);
add("slateblue", [106, 90, 205]);
add("slategray", [112, 128, 144]);
add("slategrey", [112, 128, 144]);
add("snow", [255, 250, 250]);
add("springgreen", [0, 255, 127]);
add("steelblue", [70, 130, 180]);
add("tan", [210, 180, 140]);
add("teal", [0, 128, 128]);
add("thistle", [216, 191]);
add("tomato", [255, 99, 71]);
add("turquoise", [64, 224, 208]);
add("violet", [238, 130]);
add("wheat", [245, 222, 179]);
add("white", [255]);
add("whitesmoke", [245]);
add("yellow", [255, 255, 0]);
add("yellowgreen", [154, 205, 50]);
var svgWidthRegex = /width\s*=\s*["'](\w+)["']/;
var svgHeightRegex = /height\s*=\s*["'](\w+)["']/;
function configureSvgSize(svg, props, scale) {
const svgNode = svg.slice(0, svg.indexOf(">"));
let result = svgWidthRegex.exec(svgNode);
const w = result != null;
if (typeof props.width === "undefined" || props.width === null) {
if (typeof scale === "number") {
props.width = `${scale}em`;
} else if (result) {
props.width = result[1];
}
}
result = svgHeightRegex.exec(svgNode);
const h2 = result != null;
if (typeof props.height === "undefined" || props.height === null) {
if (typeof scale === "number") {
props.height = `${scale}em`;
} else if (result) {
props.height = result[1];
}
}
return [w, h2];
}
async function mergeIconProps(svg, collection, icon, options, propsProvider, afterCustomizations) {
const { scale, addXmlNs = false } = options ?? {};
const { additionalProps = {}, iconCustomizer } = options?.customizations ?? {};
const props = await propsProvider?.() ?? {};
await iconCustomizer?.(collection, icon, props);
Object.keys(additionalProps).forEach((p) => {
const v = additionalProps[p];
if (v !== void 0 && v !== null)
props[p] = v;
});
afterCustomizations?.(props);
const [widthOnSvg, heightOnSvg] = configureSvgSize(svg, props, scale);
if (addXmlNs) {
if (!svg.includes(" xmlns=") && !props["xmlns"]) {
props["xmlns"] = "http://www.w3.org/2000/svg";
}
if (!svg.includes(" xmlns:xlink=") && svg.includes("xlink:") && !props["xmlns:xlink"]) {
props["xmlns:xlink"] = "http://www.w3.org/1999/xlink";
}
}
const propsToAdd = Object.keys(props).map(
(p) => p === "width" && widthOnSvg || p === "height" && heightOnSvg ? null : `${p}="${props[p]}"`
).filter((p) => p != null);
if (propsToAdd.length) {
svg = svg.replace("