@hexclave/dashboard-ui-components 1.0.18 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1294,938 +1294,400 @@ var DashboardUI = (() => {
1294
1294
  }
1295
1295
  var Fragment24 = import_react2.default.Fragment;
1296
1296
 
1297
- // ../shared/dist/esm/utils/arrays.js
1298
- function findLastIndex(arr, predicate) {
1299
- for (let i = arr.length - 1; i >= 0; i--) if (predicate(arr[i])) return i;
1300
- return -1;
1297
+ // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
1298
+ function r6(e40) {
1299
+ var t3, f4, n9 = "";
1300
+ if ("string" == typeof e40 || "number" == typeof e40) n9 += e40;
1301
+ else if ("object" == typeof e40) if (Array.isArray(e40)) {
1302
+ var o21 = e40.length;
1303
+ for (t3 = 0; t3 < o21; t3++) e40[t3] && (f4 = r6(e40[t3])) && (n9 && (n9 += " "), n9 += f4);
1304
+ } else for (f4 in e40) e40[f4] && (n9 && (n9 += " "), n9 += f4);
1305
+ return n9;
1301
1306
  }
1302
- function unique(arr) {
1303
- return [...new Set(arr)];
1307
+ function clsx() {
1308
+ for (var e40, t3, f4 = 0, n9 = "", o21 = arguments.length; f4 < o21; f4++) (e40 = arguments[f4]) && (t3 = r6(e40)) && (n9 && (n9 += " "), n9 += t3);
1309
+ return n9;
1304
1310
  }
1305
1311
 
1306
- // ../shared/dist/esm/utils/strings.js
1307
- function stringCompare(a26, b) {
1308
- if (typeof a26 !== "string" || typeof b !== "string") throw new HexclaveAssertionError(`Expected two strings for stringCompare, found ${typeof a26} and ${typeof b}`, {
1309
- a: a26,
1310
- b
1312
+ // ../../node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
1313
+ var CLASS_PART_SEPARATOR = "-";
1314
+ var createClassGroupUtils = (config) => {
1315
+ const classMap = createClassMap(config);
1316
+ const {
1317
+ conflictingClassGroups,
1318
+ conflictingClassGroupModifiers
1319
+ } = config;
1320
+ const getClassGroupId = (className) => {
1321
+ const classParts = className.split(CLASS_PART_SEPARATOR);
1322
+ if (classParts[0] === "" && classParts.length !== 1) {
1323
+ classParts.shift();
1324
+ }
1325
+ return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
1326
+ };
1327
+ const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
1328
+ const conflicts = conflictingClassGroups[classGroupId] || [];
1329
+ if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
1330
+ return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
1331
+ }
1332
+ return conflicts;
1333
+ };
1334
+ return {
1335
+ getClassGroupId,
1336
+ getConflictingClassGroupIds
1337
+ };
1338
+ };
1339
+ var getGroupRecursive = (classParts, classPartObject) => {
1340
+ if (classParts.length === 0) {
1341
+ return classPartObject.classGroupId;
1342
+ }
1343
+ const currentClassPart = classParts[0];
1344
+ const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
1345
+ const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
1346
+ if (classGroupFromNextClassPart) {
1347
+ return classGroupFromNextClassPart;
1348
+ }
1349
+ if (classPartObject.validators.length === 0) {
1350
+ return void 0;
1351
+ }
1352
+ const classRest = classParts.join(CLASS_PART_SEPARATOR);
1353
+ return classPartObject.validators.find(({
1354
+ validator
1355
+ }) => validator(classRest))?.classGroupId;
1356
+ };
1357
+ var arbitraryPropertyRegex = /^\[(.+)\]$/;
1358
+ var getGroupIdForArbitraryProperty = (className) => {
1359
+ if (arbitraryPropertyRegex.test(className)) {
1360
+ const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
1361
+ const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
1362
+ if (property) {
1363
+ return "arbitrary.." + property;
1364
+ }
1365
+ }
1366
+ };
1367
+ var createClassMap = (config) => {
1368
+ const {
1369
+ theme,
1370
+ prefix
1371
+ } = config;
1372
+ const classMap = {
1373
+ nextPart: /* @__PURE__ */ new Map(),
1374
+ validators: []
1375
+ };
1376
+ const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);
1377
+ prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
1378
+ processClassesRecursively(classGroup, classMap, classGroupId, theme);
1311
1379
  });
1312
- const cmp = (a27, b2) => a27 < b2 ? -1 : a27 > b2 ? 1 : 0;
1313
- return cmp(a26.toUpperCase(), b.toUpperCase()) || cmp(b, a26);
1314
- }
1315
- function getWhitespacePrefix(s8) {
1316
- return s8.substring(0, s8.length - s8.trimStart().length);
1317
- }
1318
- function trimEmptyLinesStart(s8) {
1319
- const lines = s8.split("\n");
1320
- const firstNonEmptyLineIndex = lines.findIndex((line) => line.trim() !== "");
1321
- if (firstNonEmptyLineIndex === -1) return "";
1322
- return lines.slice(firstNonEmptyLineIndex).join("\n");
1323
- }
1324
- function trimEmptyLinesEnd(s8) {
1325
- const lines = s8.split("\n");
1326
- const lastNonEmptyLineIndex = findLastIndex(lines, (line) => line.trim() !== "");
1327
- return lines.slice(0, lastNonEmptyLineIndex + 1).join("\n");
1328
- }
1329
- function templateIdentity(strings, ...values) {
1330
- if (values.length !== strings.length - 1) throw new HexclaveAssertionError("Invalid number of values; must be one less than strings", {
1331
- strings,
1332
- values
1380
+ return classMap;
1381
+ };
1382
+ var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
1383
+ classGroup.forEach((classDefinition) => {
1384
+ if (typeof classDefinition === "string") {
1385
+ const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
1386
+ classPartObjectToEdit.classGroupId = classGroupId;
1387
+ return;
1388
+ }
1389
+ if (typeof classDefinition === "function") {
1390
+ if (isThemeGetter(classDefinition)) {
1391
+ processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
1392
+ return;
1393
+ }
1394
+ classPartObject.validators.push({
1395
+ validator: classDefinition,
1396
+ classGroupId
1397
+ });
1398
+ return;
1399
+ }
1400
+ Object.entries(classDefinition).forEach(([key, classGroup2]) => {
1401
+ processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme);
1402
+ });
1333
1403
  });
1334
- return strings.reduce((result, str, i) => result + str + (values[i] ?? ""), "");
1335
- }
1336
- function deindent(strings, ...values) {
1337
- if (typeof strings === "string") return deindent([strings]);
1338
- return templateIdentity(...deindentTemplate(strings, ...values));
1339
- }
1340
- function deindentTemplate(strings, ...values) {
1341
- if (values.length !== strings.length - 1) throw new HexclaveAssertionError("Invalid number of values; must be one less than strings", {
1342
- strings,
1343
- values
1404
+ };
1405
+ var getPart = (classPartObject, path) => {
1406
+ let currentClassPartObject = classPartObject;
1407
+ path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
1408
+ if (!currentClassPartObject.nextPart.has(pathPart)) {
1409
+ currentClassPartObject.nextPart.set(pathPart, {
1410
+ nextPart: /* @__PURE__ */ new Map(),
1411
+ validators: []
1412
+ });
1413
+ }
1414
+ currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
1344
1415
  });
1345
- const trimmedStrings = [...strings];
1346
- trimmedStrings[0] = trimEmptyLinesStart(trimmedStrings[0] + "+").slice(0, -1);
1347
- trimmedStrings[trimmedStrings.length - 1] = trimEmptyLinesEnd("+" + trimmedStrings[trimmedStrings.length - 1]).slice(1);
1348
- const indentation = trimmedStrings.join("${SOME_VALUE}").split("\n").filter((line) => line.trim() !== "").map((line) => getWhitespacePrefix(line).length).reduce((min3, current) => Math.min(min3, current), Infinity);
1349
- const deindentedStrings = trimmedStrings.map((string2, stringIndex) => {
1350
- return string2.split("\n").map((line, lineIndex) => stringIndex !== 0 && lineIndex === 0 ? line : line.substring(indentation)).join("\n");
1416
+ return currentClassPartObject;
1417
+ };
1418
+ var isThemeGetter = (func) => func.isThemeGetter;
1419
+ var getPrefixedClassGroupEntries = (classGroupEntries, prefix) => {
1420
+ if (!prefix) {
1421
+ return classGroupEntries;
1422
+ }
1423
+ return classGroupEntries.map(([classGroupId, classGroup]) => {
1424
+ const prefixedClassGroup = classGroup.map((classDefinition) => {
1425
+ if (typeof classDefinition === "string") {
1426
+ return prefix + classDefinition;
1427
+ }
1428
+ if (typeof classDefinition === "object") {
1429
+ return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));
1430
+ }
1431
+ return classDefinition;
1432
+ });
1433
+ return [classGroupId, prefixedClassGroup];
1351
1434
  });
1352
- return [deindentedStrings, ...values.map((value, i) => {
1353
- const firstLineIndentation = getWhitespacePrefix(deindentedStrings[i].split("\n").at(-1));
1354
- return `${value}`.replaceAll("\n", `
1355
- ${firstLineIndentation}`);
1356
- })];
1357
- }
1358
- function escapeTemplateLiteral(s8) {
1359
- return s8.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${");
1360
- }
1361
- var nicifiableClassNameOverrides = new Map(Object.entries({ Headers }).map(([k, v]) => [v, k]));
1362
- function nicify(value, options = {}) {
1363
- const fullOptions = {
1364
- maxDepth: 5,
1365
- currentIndent: "",
1366
- lineIndent: " ",
1367
- multiline: true,
1368
- refs: /* @__PURE__ */ new Map(),
1369
- path: "value",
1370
- parent: null,
1371
- overrides: () => null,
1372
- keyInParent: null,
1373
- hideFields: [],
1374
- ...filterUndefined(options)
1375
- };
1376
- const { maxDepth, currentIndent, lineIndent, multiline, refs, path, overrides, hideFields } = fullOptions;
1377
- const nl = `
1378
- ${currentIndent}`;
1379
- const overrideResult = overrides(value, options);
1380
- if (overrideResult !== null) return overrideResult;
1381
- if ([
1382
- "function",
1383
- "object",
1384
- "symbol"
1385
- ].includes(typeof value) && value !== null) {
1386
- if (refs.has(value)) return `Ref<${refs.get(value)}>`;
1387
- refs.set(value, path);
1435
+ };
1436
+ var createLruCache = (maxCacheSize) => {
1437
+ if (maxCacheSize < 1) {
1438
+ return {
1439
+ get: () => void 0,
1440
+ set: () => {
1441
+ }
1442
+ };
1388
1443
  }
1389
- const newOptions = {
1390
- maxDepth: maxDepth - 1,
1391
- currentIndent,
1392
- lineIndent,
1393
- multiline,
1394
- refs,
1395
- path: path + "->[unknown property]",
1396
- overrides,
1397
- parent: {
1398
- value,
1399
- options: fullOptions
1400
- },
1401
- keyInParent: null,
1402
- hideFields: []
1444
+ let cacheSize = 0;
1445
+ let cache = /* @__PURE__ */ new Map();
1446
+ let previousCache = /* @__PURE__ */ new Map();
1447
+ const update = (key, value) => {
1448
+ cache.set(key, value);
1449
+ cacheSize++;
1450
+ if (cacheSize > maxCacheSize) {
1451
+ cacheSize = 0;
1452
+ previousCache = cache;
1453
+ cache = /* @__PURE__ */ new Map();
1454
+ }
1403
1455
  };
1404
- const nestedNicify = (newValue, newPath, keyInParent, options2 = {}) => {
1405
- return nicify(newValue, {
1406
- ...newOptions,
1407
- path: newPath,
1408
- currentIndent: currentIndent + lineIndent,
1409
- keyInParent,
1410
- ...options2
1411
- });
1456
+ return {
1457
+ get(key) {
1458
+ let value = cache.get(key);
1459
+ if (value !== void 0) {
1460
+ return value;
1461
+ }
1462
+ if ((value = previousCache.get(key)) !== void 0) {
1463
+ update(key, value);
1464
+ return value;
1465
+ }
1466
+ },
1467
+ set(key, value) {
1468
+ if (cache.has(key)) {
1469
+ cache.set(key, value);
1470
+ } else {
1471
+ update(key, value);
1472
+ }
1473
+ }
1412
1474
  };
1413
- switch (typeof value) {
1414
- case "boolean":
1415
- case "number":
1416
- return JSON.stringify(value);
1417
- case "string": {
1418
- const isDeindentable = (v) => deindent(v) === v && v.includes("\n");
1419
- const wrapInDeindent = (v) => deindent`
1420
- deindent\`
1421
- ${currentIndent + lineIndent}${escapeTemplateLiteral(v).replaceAll("\n", nl + lineIndent)}
1422
- ${currentIndent}\`
1423
- `;
1424
- if (isDeindentable(value)) return wrapInDeindent(value);
1425
- else if (value.endsWith("\n") && isDeindentable(value.slice(0, -1))) return wrapInDeindent(value.slice(0, -1)) + ' + "\\n"';
1426
- else return JSON.stringify(value);
1475
+ };
1476
+ var IMPORTANT_MODIFIER = "!";
1477
+ var createParseClassName = (config) => {
1478
+ const {
1479
+ separator,
1480
+ experimentalParseClassName
1481
+ } = config;
1482
+ const isSeparatorSingleCharacter = separator.length === 1;
1483
+ const firstSeparatorCharacter = separator[0];
1484
+ const separatorLength = separator.length;
1485
+ const parseClassName = (className) => {
1486
+ const modifiers = [];
1487
+ let bracketDepth = 0;
1488
+ let modifierStart = 0;
1489
+ let postfixModifierPosition;
1490
+ for (let index2 = 0; index2 < className.length; index2++) {
1491
+ let currentCharacter = className[index2];
1492
+ if (bracketDepth === 0) {
1493
+ if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index2, index2 + separatorLength) === separator)) {
1494
+ modifiers.push(className.slice(modifierStart, index2));
1495
+ modifierStart = index2 + separatorLength;
1496
+ continue;
1497
+ }
1498
+ if (currentCharacter === "/") {
1499
+ postfixModifierPosition = index2;
1500
+ continue;
1501
+ }
1502
+ }
1503
+ if (currentCharacter === "[") {
1504
+ bracketDepth++;
1505
+ } else if (currentCharacter === "]") {
1506
+ bracketDepth--;
1507
+ }
1427
1508
  }
1428
- case "undefined":
1429
- return "undefined";
1430
- case "symbol":
1431
- return value.toString();
1432
- case "bigint":
1433
- return `${value}n`;
1434
- case "function":
1435
- if (value.name) return `function ${value.name}(...) { ... }`;
1436
- return `(...) => { ... }`;
1437
- case "object": {
1438
- if (value === null) return "null";
1439
- if (Array.isArray(value)) {
1440
- const extraLines2 = getNicifiedObjectExtraLines(value);
1441
- const resValueLength2 = value.length + extraLines2.length;
1442
- if (resValueLength2 === 0) return "[]";
1443
- if (maxDepth <= 0) return `[...]`;
1444
- const resValues2 = value.map((v, i) => nestedNicify(v, `${path}[${i}]`, i));
1445
- resValues2.push(...extraLines2);
1446
- if (resValues2.length !== resValueLength2) throw new HexclaveAssertionError("nicify of object: resValues.length !== resValueLength", {
1447
- value,
1448
- resValues: resValues2,
1449
- resValueLength: resValueLength2
1450
- });
1451
- if (resValues2.length > 4 || resValues2.some((x) => resValues2.length > 1 && x.length > 4 || x.includes("\n"))) return `[${nl}${resValues2.map((x) => `${lineIndent}${x},${nl}`).join("")}]`;
1452
- else return `[${resValues2.join(", ")}]`;
1509
+ const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
1510
+ const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
1511
+ const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;
1512
+ const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
1513
+ return {
1514
+ modifiers,
1515
+ hasImportantModifier,
1516
+ baseClassName,
1517
+ maybePostfixModifierPosition
1518
+ };
1519
+ };
1520
+ if (experimentalParseClassName) {
1521
+ return (className) => experimentalParseClassName({
1522
+ className,
1523
+ parseClassName
1524
+ });
1525
+ }
1526
+ return parseClassName;
1527
+ };
1528
+ var sortModifiers = (modifiers) => {
1529
+ if (modifiers.length <= 1) {
1530
+ return modifiers;
1531
+ }
1532
+ const sortedModifiers = [];
1533
+ let unsortedModifiers = [];
1534
+ modifiers.forEach((modifier) => {
1535
+ const isArbitraryVariant = modifier[0] === "[";
1536
+ if (isArbitraryVariant) {
1537
+ sortedModifiers.push(...unsortedModifiers.sort(), modifier);
1538
+ unsortedModifiers = [];
1539
+ } else {
1540
+ unsortedModifiers.push(modifier);
1541
+ }
1542
+ });
1543
+ sortedModifiers.push(...unsortedModifiers.sort());
1544
+ return sortedModifiers;
1545
+ };
1546
+ var createConfigUtils = (config) => ({
1547
+ cache: createLruCache(config.cacheSize),
1548
+ parseClassName: createParseClassName(config),
1549
+ ...createClassGroupUtils(config)
1550
+ });
1551
+ var SPLIT_CLASSES_REGEX = /\s+/;
1552
+ var mergeClassList = (classList, configUtils) => {
1553
+ const {
1554
+ parseClassName,
1555
+ getClassGroupId,
1556
+ getConflictingClassGroupIds
1557
+ } = configUtils;
1558
+ const classGroupsInConflict = [];
1559
+ const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
1560
+ let result = "";
1561
+ for (let index2 = classNames.length - 1; index2 >= 0; index2 -= 1) {
1562
+ const originalClassName = classNames[index2];
1563
+ const {
1564
+ modifiers,
1565
+ hasImportantModifier,
1566
+ baseClassName,
1567
+ maybePostfixModifierPosition
1568
+ } = parseClassName(originalClassName);
1569
+ let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
1570
+ let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
1571
+ if (!classGroupId) {
1572
+ if (!hasPostfixModifier) {
1573
+ result = originalClassName + (result.length > 0 ? " " + result : result);
1574
+ continue;
1453
1575
  }
1454
- if (value instanceof Date) return `Date(${nestedNicify(value.toISOString(), `${path}.toISOString()`, null)})`;
1455
- if (value instanceof URL) return `URL(${nestedNicify(value.toString(), `${path}.toString()`, null)})`;
1456
- if (ArrayBuffer.isView(value)) return `${value.constructor.name}([${value.toString()}])`;
1457
- if (value instanceof ArrayBuffer) return `ArrayBuffer [${new Uint8Array(value).toString()}]`;
1458
- if (value instanceof Error) {
1459
- let stack = value.stack ?? "";
1460
- const toString3 = value.toString();
1461
- if (!stack.startsWith(toString3)) stack = `${toString3}
1462
- ${stack}`;
1463
- stack = stack.trimEnd();
1464
- stack = stack.replace(/\n\s+/g, `
1465
- ${lineIndent}${lineIndent}`);
1466
- stack = stack.replace("\n", `
1467
- ${lineIndent}Stack:
1468
- `);
1469
- if (Object.keys(value).length > 0) stack += `
1470
- ${lineIndent}Extra properties: ${nestedNicify(Object.fromEntries(Object.entries(value)), path, null)}`;
1471
- if (value.cause) stack += `
1472
- ${lineIndent}Cause:
1473
- ${lineIndent}${lineIndent}${nestedNicify(value.cause, path, null, { currentIndent: currentIndent + lineIndent + lineIndent })}`;
1474
- stack = stack.replaceAll("\n", `
1475
- ${currentIndent}`);
1476
- return stack;
1576
+ classGroupId = getClassGroupId(baseClassName);
1577
+ if (!classGroupId) {
1578
+ result = originalClassName + (result.length > 0 ? " " + result : result);
1579
+ continue;
1477
1580
  }
1478
- const constructorName = [null, Object.prototype].includes(Object.getPrototypeOf(value)) ? null : nicifiableClassNameOverrides.get(value.constructor) ?? value.constructor.name;
1479
- const constructorString = constructorName ? `${constructorName} ` : "";
1480
- const entries = getNicifiableEntries(value).filter(([k]) => !hideFields.includes(k));
1481
- const extraLines = [...getNicifiedObjectExtraLines(value), ...hideFields.length > 0 ? [`<some fields may have been hidden>`] : []];
1482
- const resValueLength = entries.length + extraLines.length;
1483
- if (resValueLength === 0) return `${constructorString}{}`;
1484
- if (maxDepth <= 0) return `${constructorString}{ ... }`;
1485
- const resValues = entries.map(([k, v], keyIndex) => {
1486
- const keyNicified = nestedNicify(k, `Object.keys(${path})[${keyIndex}]`, null);
1487
- const keyInObjectLiteral = typeof k === "string" ? nicifyPropertyString(k) : `[${keyNicified}]`;
1488
- if (typeof v === "function" && v.name === k) return `${keyInObjectLiteral}(...): { ... }`;
1489
- else return `${keyInObjectLiteral}: ${nestedNicify(v, `${path}[${keyNicified}]`, k)}`;
1490
- });
1491
- resValues.push(...extraLines);
1492
- if (resValues.length !== resValueLength) throw new HexclaveAssertionError("nicify of object: resValues.length !== resValueLength", {
1493
- value,
1494
- resValues,
1495
- resValueLength
1496
- });
1497
- const shouldIndent = resValues.length > 1 || resValues.some((x) => x.includes("\n"));
1498
- if (resValues.length === 0) return `${constructorString}{}`;
1499
- if (shouldIndent) return `${constructorString}{${nl}${resValues.map((x) => `${lineIndent}${x},${nl}`).join("")}}`;
1500
- else return `${constructorString}{ ${resValues.join(", ")} }`;
1581
+ hasPostfixModifier = false;
1501
1582
  }
1502
- default:
1503
- return `${typeof value}<${value}>`;
1583
+ const variantModifier = sortModifiers(modifiers).join(":");
1584
+ const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
1585
+ const classId = modifierId + classGroupId;
1586
+ if (classGroupsInConflict.includes(classId)) {
1587
+ continue;
1588
+ }
1589
+ classGroupsInConflict.push(classId);
1590
+ const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
1591
+ for (let i = 0; i < conflictGroups.length; ++i) {
1592
+ const group = conflictGroups[i];
1593
+ classGroupsInConflict.push(modifierId + group);
1594
+ }
1595
+ result = originalClassName + (result.length > 0 ? " " + result : result);
1504
1596
  }
1505
- }
1506
- function nicifyPropertyString(str) {
1507
- return JSON.stringify(str);
1508
- }
1509
- function getNicifiableKeys(value) {
1510
- const overridden = ("getNicifiableKeys" in value ? value.getNicifiableKeys?.bind(value) : null)?.();
1511
- if (overridden != null) return overridden;
1512
- if (value instanceof Response) return ["status", "headers"];
1513
- return unique(Object.keys(value).sort());
1514
- }
1515
- function getNicifiableEntries(value) {
1516
- const recordLikes = [Headers];
1517
- function isRecordLike(value2) {
1518
- return recordLikes.some((x) => value2 instanceof x);
1597
+ return result;
1598
+ };
1599
+ function twJoin() {
1600
+ let index2 = 0;
1601
+ let argument;
1602
+ let resolvedValue;
1603
+ let string2 = "";
1604
+ while (index2 < arguments.length) {
1605
+ if (argument = arguments[index2++]) {
1606
+ if (resolvedValue = toValue(argument)) {
1607
+ string2 && (string2 += " ");
1608
+ string2 += resolvedValue;
1609
+ }
1610
+ }
1519
1611
  }
1520
- if (isRecordLike(value)) return [...value.entries()].sort(([a26], [b]) => stringCompare(`${a26}`, `${b}`));
1521
- return getNicifiableKeys(value).map((k) => [k, value[k]]);
1522
- }
1523
- function getNicifiedObjectExtraLines(value) {
1524
- return ("getNicifiedObjectExtraLines" in value ? value.getNicifiedObjectExtraLines : null)?.() ?? [];
1612
+ return string2;
1525
1613
  }
1526
-
1527
- // ../shared/dist/esm/utils/functions.js
1528
- function identityArgs(...args) {
1529
- return args;
1530
- }
1531
-
1532
- // ../shared/dist/esm/utils/types.js
1533
- typeAssertIs()();
1534
- typeAssertIs()();
1535
- typeAssertIs()();
1536
- typeAssertExtends()();
1537
- typeAssertExtends()();
1538
- typeAssertExtends()();
1539
- typeAssertExtends()();
1540
- function typeAssertExtends() {
1541
- return () => void 0;
1542
- }
1543
- typeAssertExtends()();
1544
- typeAssertExtends()();
1545
- typeAssertExtends()();
1546
- typeAssertExtends()();
1547
- typeAssertExtends()();
1548
- typeAssertExtends()();
1549
- typeAssertExtends()();
1550
- typeAssertExtends()();
1551
- typeAssertExtends()();
1552
- typeAssertExtends()();
1553
- typeAssertExtends()();
1554
- function typeAssertIs() {
1555
- return () => void 0;
1556
- }
1557
- typeAssertExtends()();
1558
- typeAssertExtends()();
1559
- typeAssertExtends()();
1560
- typeAssertExtends()();
1561
- typeAssertExtends()();
1562
- typeAssertExtends()();
1563
- typeAssertExtends()();
1564
- typeAssertExtends()();
1565
- typeAssertExtends()();
1566
- typeAssertExtends()();
1567
- typeAssertExtends()();
1568
- typeAssertExtends()();
1569
-
1570
- // ../shared/dist/esm/utils/objects.js
1571
- function deepPlainClone(obj) {
1572
- if (typeof obj === "function") throw new HexclaveAssertionError("deepPlainClone does not support functions");
1573
- if (typeof obj === "symbol") throw new HexclaveAssertionError("deepPlainClone does not support symbols");
1574
- if (typeof obj !== "object" || !obj) return obj;
1575
- if (Array.isArray(obj)) return obj.map(deepPlainClone);
1576
- return Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, deepPlainClone(v)]));
1577
- }
1578
- function typedFromEntries(entries) {
1579
- return Object.fromEntries(entries);
1580
- }
1581
- function filterUndefined(obj) {
1582
- return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== void 0));
1583
- }
1584
- typeAssertIs()();
1585
- function pick(obj, keys) {
1586
- return Object.fromEntries(Object.entries(obj).filter(([k]) => keys.includes(k)));
1587
- }
1588
- function omit(obj, keys) {
1589
- if (!Array.isArray(keys)) throw new HexclaveAssertionError("omit: keys must be an array", {
1590
- obj,
1591
- keys
1592
- });
1593
- return Object.fromEntries(Object.entries(obj).filter(([k]) => !keys.includes(k)));
1594
- }
1595
-
1596
- // ../shared/dist/esm/utils/globals.js
1597
- var globalVar = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {};
1598
- if (typeof globalThis === "undefined") globalVar.globalThis = globalVar;
1599
- var hexclaveGlobalsSymbol = Symbol.for("__hexclave-globals");
1600
- globalVar[hexclaveGlobalsSymbol] ??= {};
1601
-
1602
- // ../shared/dist/esm/utils/errors.js
1603
- function throwErr(...args) {
1604
- if (typeof args[0] === "string") throw new HexclaveAssertionError(args[0], args[1]);
1605
- else if (args[0] instanceof Error) throw args[0];
1606
- else throw new StatusError(...args);
1607
- }
1608
- function removeStacktraceNameLine(stack) {
1609
- const addsNameLine = (/* @__PURE__ */ new Error()).stack?.startsWith("Error\n");
1610
- return stack.split("\n").slice(addsNameLine ? 1 : 0).join("\n");
1611
- }
1612
- function concatStacktraces(first, ...errors) {
1613
- const addsEmptyLineAtEnd = first.stack?.endsWith("\n");
1614
- const separator = removeStacktraceNameLine((/* @__PURE__ */ new Error()).stack ?? "").split("\n")[0];
1615
- for (const error of errors) {
1616
- const toAppend = removeStacktraceNameLine(error.stack ?? "");
1617
- first.stack += (addsEmptyLineAtEnd ? "" : "\n") + separator + "\n" + toAppend;
1618
- }
1619
- }
1620
- var HexclaveAssertionError = class extends Error {
1621
- constructor(message, extraData) {
1622
- const disclaimer = `
1623
-
1624
- This is likely an error in Hexclave. Please make sure you are running the newest version and report it.`;
1625
- super(`${message}${message.endsWith(disclaimer) ? "" : disclaimer}`, pick(extraData ?? {}, ["cause"]));
1626
- this.extraData = extraData;
1627
- Object.defineProperty(this, "customCaptureExtraArgs", {
1628
- get() {
1629
- return [this.extraData];
1630
- },
1631
- enumerable: false
1632
- });
1633
- if ((typeof process !== "undefined" ? process.env.NEXT_PUBLIC_STACK_DEBUGGER_ON_ASSERTION_ERROR : void 0) === "true") debugger;
1614
+ var toValue = (mix) => {
1615
+ if (typeof mix === "string") {
1616
+ return mix;
1634
1617
  }
1635
- };
1636
- HexclaveAssertionError.prototype.name = "HexclaveAssertionError";
1637
- function errorToNiceString(error) {
1638
- if (!(error instanceof Error)) return `${typeof error}<${nicify(error)}>`;
1639
- return nicify(error, { maxDepth: 8 });
1640
- }
1641
- var errorSinks = /* @__PURE__ */ new Set();
1642
- function registerErrorSink(sink) {
1643
- if (errorSinks.has(sink)) return;
1644
- errorSinks.add(sink);
1645
- }
1646
- registerErrorSink((location, error, level, ...extraArgs) => {
1647
- (level === "warning" ? console.warn : console.error)(`${level === "warning" ? "\x1B[43m" : "\x1B[41m"}Captured ${level === "warning" ? "warning" : "error"} in ${location}:`, errorToNiceString(error), ...extraArgs, "\x1B[0m");
1648
- });
1649
- registerErrorSink((location, error, level, ...extraArgs) => {
1650
- globalVar.hexclaveCapturedErrors = globalVar.hexclaveCapturedErrors ?? [];
1651
- globalVar.hexclaveCapturedErrors.push({
1652
- location,
1653
- error,
1654
- level,
1655
- extraArgs
1656
- });
1657
- });
1658
- function dispatchToSinks(location, error, level) {
1659
- for (const sink of errorSinks) sink(location, error, level, ...error && (typeof error === "object" || typeof error === "function") && "customCaptureExtraArgs" in error && Array.isArray(error.customCaptureExtraArgs) ? error.customCaptureExtraArgs : []);
1660
- }
1661
- function captureError(location, error) {
1662
- dispatchToSinks(location, error, "error");
1663
- }
1664
- var _a;
1665
- var StatusError = (_a = class extends Error {
1666
- constructor(status, message) {
1667
- if (typeof status === "object") {
1668
- message ??= status.message;
1669
- status = status.statusCode;
1618
+ let resolvedValue;
1619
+ let string2 = "";
1620
+ for (let k = 0; k < mix.length; k++) {
1621
+ if (mix[k]) {
1622
+ if (resolvedValue = toValue(mix[k])) {
1623
+ string2 && (string2 += " ");
1624
+ string2 += resolvedValue;
1625
+ }
1670
1626
  }
1671
- super(message);
1672
- this.__stackStatusErrorBrand = "stack-status-error-brand-sentinel";
1673
- this.name = "StatusError";
1674
- this.statusCode = status;
1675
- if (!message) throw new HexclaveAssertionError("StatusError always requires a message unless a Status object is passed", { cause: this });
1676
- }
1677
- static isStatusError(error) {
1678
- return typeof error === "object" && error !== null && "__stackStatusErrorBrand" in error && error.__stackStatusErrorBrand === "stack-status-error-brand-sentinel";
1679
- }
1680
- isClientError() {
1681
- return this.statusCode >= 400 && this.statusCode < 500;
1682
- }
1683
- isServerError() {
1684
- return !this.isClientError();
1685
1627
  }
1686
- getStatusCode() {
1687
- return this.statusCode;
1688
- }
1689
- getBody() {
1690
- return new TextEncoder().encode(this.message);
1691
- }
1692
- getHeaders() {
1693
- return { "Content-Type": ["text/plain; charset=utf-8"] };
1628
+ return string2;
1629
+ };
1630
+ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
1631
+ let configUtils;
1632
+ let cacheGet;
1633
+ let cacheSet;
1634
+ let functionToCall = initTailwindMerge;
1635
+ function initTailwindMerge(classList) {
1636
+ const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
1637
+ configUtils = createConfigUtils(config);
1638
+ cacheGet = configUtils.cache.get;
1639
+ cacheSet = configUtils.cache.set;
1640
+ functionToCall = tailwindMerge;
1641
+ return tailwindMerge(classList);
1694
1642
  }
1695
- toDescriptiveJson() {
1696
- return {
1697
- status_code: this.getStatusCode(),
1698
- message: this.message,
1699
- headers: this.getHeaders()
1700
- };
1643
+ function tailwindMerge(classList) {
1644
+ const cachedResult = cacheGet(classList);
1645
+ if (cachedResult) {
1646
+ return cachedResult;
1647
+ }
1648
+ const result = mergeClassList(classList, configUtils);
1649
+ cacheSet(classList, result);
1650
+ return result;
1701
1651
  }
1702
- /**
1703
- * @deprecated this is not a good way to make status errors human-readable, use toDescriptiveJson instead
1704
- */
1705
- toHttpJson() {
1706
- return {
1707
- status_code: this.statusCode,
1708
- body: this.message,
1709
- headers: this.getHeaders()
1710
- };
1711
- }
1712
- }, _a.BadRequest = {
1713
- statusCode: 400,
1714
- message: "Bad Request"
1715
- }, _a.Unauthorized = {
1716
- statusCode: 401,
1717
- message: "Unauthorized"
1718
- }, _a.PaymentRequired = {
1719
- statusCode: 402,
1720
- message: "Payment Required"
1721
- }, _a.Forbidden = {
1722
- statusCode: 403,
1723
- message: "Forbidden"
1724
- }, _a.NotFound = {
1725
- statusCode: 404,
1726
- message: "Not Found"
1727
- }, _a.MethodNotAllowed = {
1728
- statusCode: 405,
1729
- message: "Method Not Allowed"
1730
- }, _a.NotAcceptable = {
1731
- statusCode: 406,
1732
- message: "Not Acceptable"
1733
- }, _a.ProxyAuthenticationRequired = {
1734
- statusCode: 407,
1735
- message: "Proxy Authentication Required"
1736
- }, _a.RequestTimeout = {
1737
- statusCode: 408,
1738
- message: "Request Timeout"
1739
- }, _a.Conflict = {
1740
- statusCode: 409,
1741
- message: "Conflict"
1742
- }, _a.Gone = {
1743
- statusCode: 410,
1744
- message: "Gone"
1745
- }, _a.LengthRequired = {
1746
- statusCode: 411,
1747
- message: "Length Required"
1748
- }, _a.PreconditionFailed = {
1749
- statusCode: 412,
1750
- message: "Precondition Failed"
1751
- }, _a.PayloadTooLarge = {
1752
- statusCode: 413,
1753
- message: "Payload Too Large"
1754
- }, _a.URITooLong = {
1755
- statusCode: 414,
1756
- message: "URI Too Long"
1757
- }, _a.UnsupportedMediaType = {
1758
- statusCode: 415,
1759
- message: "Unsupported Media Type"
1760
- }, _a.RangeNotSatisfiable = {
1761
- statusCode: 416,
1762
- message: "Range Not Satisfiable"
1763
- }, _a.ExpectationFailed = {
1764
- statusCode: 417,
1765
- message: "Expectation Failed"
1766
- }, _a.ImATeapot = {
1767
- statusCode: 418,
1768
- message: "I'm a teapot"
1769
- }, _a.MisdirectedRequest = {
1770
- statusCode: 421,
1771
- message: "Misdirected Request"
1772
- }, _a.UnprocessableEntity = {
1773
- statusCode: 422,
1774
- message: "Unprocessable Entity"
1775
- }, _a.Locked = {
1776
- statusCode: 423,
1777
- message: "Locked"
1778
- }, _a.FailedDependency = {
1779
- statusCode: 424,
1780
- message: "Failed Dependency"
1781
- }, _a.TooEarly = {
1782
- statusCode: 425,
1783
- message: "Too Early"
1784
- }, _a.UpgradeRequired = {
1785
- statusCode: 426,
1786
- message: "Upgrade Required"
1787
- }, _a.PreconditionRequired = {
1788
- statusCode: 428,
1789
- message: "Precondition Required"
1790
- }, _a.TooManyRequests = {
1791
- statusCode: 429,
1792
- message: "Too Many Requests"
1793
- }, _a.RequestHeaderFieldsTooLarge = {
1794
- statusCode: 431,
1795
- message: "Request Header Fields Too Large"
1796
- }, _a.UnavailableForLegalReasons = {
1797
- statusCode: 451,
1798
- message: "Unavailable For Legal Reasons"
1799
- }, _a.InternalServerError = {
1800
- statusCode: 500,
1801
- message: "Internal Server Error"
1802
- }, _a.NotImplemented = {
1803
- statusCode: 501,
1804
- message: "Not Implemented"
1805
- }, _a.BadGateway = {
1806
- statusCode: 502,
1807
- message: "Bad Gateway"
1808
- }, _a.ServiceUnavailable = {
1809
- statusCode: 503,
1810
- message: "Service Unavailable"
1811
- }, _a.GatewayTimeout = {
1812
- statusCode: 504,
1813
- message: "Gateway Timeout"
1814
- }, _a.HTTPVersionNotSupported = {
1815
- statusCode: 505,
1816
- message: "HTTP Version Not Supported"
1817
- }, _a.VariantAlsoNegotiates = {
1818
- statusCode: 506,
1819
- message: "Variant Also Negotiates"
1820
- }, _a.InsufficientStorage = {
1821
- statusCode: 507,
1822
- message: "Insufficient Storage"
1823
- }, _a.LoopDetected = {
1824
- statusCode: 508,
1825
- message: "Loop Detected"
1826
- }, _a.NotExtended = {
1827
- statusCode: 510,
1828
- message: "Not Extended"
1829
- }, _a.NetworkAuthenticationRequired = {
1830
- statusCode: 511,
1831
- message: "Network Authentication Required"
1832
- }, _a);
1833
- StatusError.prototype.name = "StatusError";
1834
-
1835
- // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
1836
- function r6(e40) {
1837
- var t3, f4, n9 = "";
1838
- if ("string" == typeof e40 || "number" == typeof e40) n9 += e40;
1839
- else if ("object" == typeof e40) if (Array.isArray(e40)) {
1840
- var o21 = e40.length;
1841
- for (t3 = 0; t3 < o21; t3++) e40[t3] && (f4 = r6(e40[t3])) && (n9 && (n9 += " "), n9 += f4);
1842
- } else for (f4 in e40) e40[f4] && (n9 && (n9 += " "), n9 += f4);
1843
- return n9;
1844
- }
1845
- function clsx() {
1846
- for (var e40, t3, f4 = 0, n9 = "", o21 = arguments.length; f4 < o21; f4++) (e40 = arguments[f4]) && (t3 = r6(e40)) && (n9 && (n9 += " "), n9 += t3);
1847
- return n9;
1848
- }
1849
-
1850
- // ../../node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
1851
- var CLASS_PART_SEPARATOR = "-";
1852
- var createClassGroupUtils = (config) => {
1853
- const classMap = createClassMap(config);
1854
- const {
1855
- conflictingClassGroups,
1856
- conflictingClassGroupModifiers
1857
- } = config;
1858
- const getClassGroupId = (className) => {
1859
- const classParts = className.split(CLASS_PART_SEPARATOR);
1860
- if (classParts[0] === "" && classParts.length !== 1) {
1861
- classParts.shift();
1862
- }
1863
- return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
1864
- };
1865
- const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
1866
- const conflicts = conflictingClassGroups[classGroupId] || [];
1867
- if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
1868
- return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
1869
- }
1870
- return conflicts;
1871
- };
1872
- return {
1873
- getClassGroupId,
1874
- getConflictingClassGroupIds
1875
- };
1876
- };
1877
- var getGroupRecursive = (classParts, classPartObject) => {
1878
- if (classParts.length === 0) {
1879
- return classPartObject.classGroupId;
1880
- }
1881
- const currentClassPart = classParts[0];
1882
- const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
1883
- const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
1884
- if (classGroupFromNextClassPart) {
1885
- return classGroupFromNextClassPart;
1886
- }
1887
- if (classPartObject.validators.length === 0) {
1888
- return void 0;
1889
- }
1890
- const classRest = classParts.join(CLASS_PART_SEPARATOR);
1891
- return classPartObject.validators.find(({
1892
- validator
1893
- }) => validator(classRest))?.classGroupId;
1894
- };
1895
- var arbitraryPropertyRegex = /^\[(.+)\]$/;
1896
- var getGroupIdForArbitraryProperty = (className) => {
1897
- if (arbitraryPropertyRegex.test(className)) {
1898
- const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
1899
- const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
1900
- if (property) {
1901
- return "arbitrary.." + property;
1902
- }
1903
- }
1904
- };
1905
- var createClassMap = (config) => {
1906
- const {
1907
- theme,
1908
- prefix
1909
- } = config;
1910
- const classMap = {
1911
- nextPart: /* @__PURE__ */ new Map(),
1912
- validators: []
1913
- };
1914
- const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);
1915
- prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
1916
- processClassesRecursively(classGroup, classMap, classGroupId, theme);
1917
- });
1918
- return classMap;
1919
- };
1920
- var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
1921
- classGroup.forEach((classDefinition) => {
1922
- if (typeof classDefinition === "string") {
1923
- const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
1924
- classPartObjectToEdit.classGroupId = classGroupId;
1925
- return;
1926
- }
1927
- if (typeof classDefinition === "function") {
1928
- if (isThemeGetter(classDefinition)) {
1929
- processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
1930
- return;
1931
- }
1932
- classPartObject.validators.push({
1933
- validator: classDefinition,
1934
- classGroupId
1935
- });
1936
- return;
1937
- }
1938
- Object.entries(classDefinition).forEach(([key, classGroup2]) => {
1939
- processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme);
1940
- });
1941
- });
1942
- };
1943
- var getPart = (classPartObject, path) => {
1944
- let currentClassPartObject = classPartObject;
1945
- path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
1946
- if (!currentClassPartObject.nextPart.has(pathPart)) {
1947
- currentClassPartObject.nextPart.set(pathPart, {
1948
- nextPart: /* @__PURE__ */ new Map(),
1949
- validators: []
1950
- });
1951
- }
1952
- currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
1953
- });
1954
- return currentClassPartObject;
1955
- };
1956
- var isThemeGetter = (func) => func.isThemeGetter;
1957
- var getPrefixedClassGroupEntries = (classGroupEntries, prefix) => {
1958
- if (!prefix) {
1959
- return classGroupEntries;
1960
- }
1961
- return classGroupEntries.map(([classGroupId, classGroup]) => {
1962
- const prefixedClassGroup = classGroup.map((classDefinition) => {
1963
- if (typeof classDefinition === "string") {
1964
- return prefix + classDefinition;
1965
- }
1966
- if (typeof classDefinition === "object") {
1967
- return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));
1968
- }
1969
- return classDefinition;
1970
- });
1971
- return [classGroupId, prefixedClassGroup];
1972
- });
1973
- };
1974
- var createLruCache = (maxCacheSize) => {
1975
- if (maxCacheSize < 1) {
1976
- return {
1977
- get: () => void 0,
1978
- set: () => {
1979
- }
1980
- };
1981
- }
1982
- let cacheSize = 0;
1983
- let cache = /* @__PURE__ */ new Map();
1984
- let previousCache = /* @__PURE__ */ new Map();
1985
- const update = (key, value) => {
1986
- cache.set(key, value);
1987
- cacheSize++;
1988
- if (cacheSize > maxCacheSize) {
1989
- cacheSize = 0;
1990
- previousCache = cache;
1991
- cache = /* @__PURE__ */ new Map();
1992
- }
1993
- };
1994
- return {
1995
- get(key) {
1996
- let value = cache.get(key);
1997
- if (value !== void 0) {
1998
- return value;
1999
- }
2000
- if ((value = previousCache.get(key)) !== void 0) {
2001
- update(key, value);
2002
- return value;
2003
- }
2004
- },
2005
- set(key, value) {
2006
- if (cache.has(key)) {
2007
- cache.set(key, value);
2008
- } else {
2009
- update(key, value);
2010
- }
2011
- }
2012
- };
2013
- };
2014
- var IMPORTANT_MODIFIER = "!";
2015
- var createParseClassName = (config) => {
2016
- const {
2017
- separator,
2018
- experimentalParseClassName
2019
- } = config;
2020
- const isSeparatorSingleCharacter = separator.length === 1;
2021
- const firstSeparatorCharacter = separator[0];
2022
- const separatorLength = separator.length;
2023
- const parseClassName = (className) => {
2024
- const modifiers = [];
2025
- let bracketDepth = 0;
2026
- let modifierStart = 0;
2027
- let postfixModifierPosition;
2028
- for (let index2 = 0; index2 < className.length; index2++) {
2029
- let currentCharacter = className[index2];
2030
- if (bracketDepth === 0) {
2031
- if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index2, index2 + separatorLength) === separator)) {
2032
- modifiers.push(className.slice(modifierStart, index2));
2033
- modifierStart = index2 + separatorLength;
2034
- continue;
2035
- }
2036
- if (currentCharacter === "/") {
2037
- postfixModifierPosition = index2;
2038
- continue;
2039
- }
2040
- }
2041
- if (currentCharacter === "[") {
2042
- bracketDepth++;
2043
- } else if (currentCharacter === "]") {
2044
- bracketDepth--;
2045
- }
2046
- }
2047
- const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
2048
- const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
2049
- const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;
2050
- const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
2051
- return {
2052
- modifiers,
2053
- hasImportantModifier,
2054
- baseClassName,
2055
- maybePostfixModifierPosition
2056
- };
2057
- };
2058
- if (experimentalParseClassName) {
2059
- return (className) => experimentalParseClassName({
2060
- className,
2061
- parseClassName
2062
- });
2063
- }
2064
- return parseClassName;
2065
- };
2066
- var sortModifiers = (modifiers) => {
2067
- if (modifiers.length <= 1) {
2068
- return modifiers;
2069
- }
2070
- const sortedModifiers = [];
2071
- let unsortedModifiers = [];
2072
- modifiers.forEach((modifier) => {
2073
- const isArbitraryVariant = modifier[0] === "[";
2074
- if (isArbitraryVariant) {
2075
- sortedModifiers.push(...unsortedModifiers.sort(), modifier);
2076
- unsortedModifiers = [];
2077
- } else {
2078
- unsortedModifiers.push(modifier);
2079
- }
2080
- });
2081
- sortedModifiers.push(...unsortedModifiers.sort());
2082
- return sortedModifiers;
2083
- };
2084
- var createConfigUtils = (config) => ({
2085
- cache: createLruCache(config.cacheSize),
2086
- parseClassName: createParseClassName(config),
2087
- ...createClassGroupUtils(config)
2088
- });
2089
- var SPLIT_CLASSES_REGEX = /\s+/;
2090
- var mergeClassList = (classList, configUtils) => {
2091
- const {
2092
- parseClassName,
2093
- getClassGroupId,
2094
- getConflictingClassGroupIds
2095
- } = configUtils;
2096
- const classGroupsInConflict = [];
2097
- const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
2098
- let result = "";
2099
- for (let index2 = classNames.length - 1; index2 >= 0; index2 -= 1) {
2100
- const originalClassName = classNames[index2];
2101
- const {
2102
- modifiers,
2103
- hasImportantModifier,
2104
- baseClassName,
2105
- maybePostfixModifierPosition
2106
- } = parseClassName(originalClassName);
2107
- let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
2108
- let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
2109
- if (!classGroupId) {
2110
- if (!hasPostfixModifier) {
2111
- result = originalClassName + (result.length > 0 ? " " + result : result);
2112
- continue;
2113
- }
2114
- classGroupId = getClassGroupId(baseClassName);
2115
- if (!classGroupId) {
2116
- result = originalClassName + (result.length > 0 ? " " + result : result);
2117
- continue;
2118
- }
2119
- hasPostfixModifier = false;
2120
- }
2121
- const variantModifier = sortModifiers(modifiers).join(":");
2122
- const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
2123
- const classId = modifierId + classGroupId;
2124
- if (classGroupsInConflict.includes(classId)) {
2125
- continue;
2126
- }
2127
- classGroupsInConflict.push(classId);
2128
- const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
2129
- for (let i = 0; i < conflictGroups.length; ++i) {
2130
- const group = conflictGroups[i];
2131
- classGroupsInConflict.push(modifierId + group);
2132
- }
2133
- result = originalClassName + (result.length > 0 ? " " + result : result);
2134
- }
2135
- return result;
2136
- };
2137
- function twJoin() {
2138
- let index2 = 0;
2139
- let argument;
2140
- let resolvedValue;
2141
- let string2 = "";
2142
- while (index2 < arguments.length) {
2143
- if (argument = arguments[index2++]) {
2144
- if (resolvedValue = toValue(argument)) {
2145
- string2 && (string2 += " ");
2146
- string2 += resolvedValue;
2147
- }
2148
- }
2149
- }
2150
- return string2;
2151
- }
2152
- var toValue = (mix) => {
2153
- if (typeof mix === "string") {
2154
- return mix;
2155
- }
2156
- let resolvedValue;
2157
- let string2 = "";
2158
- for (let k = 0; k < mix.length; k++) {
2159
- if (mix[k]) {
2160
- if (resolvedValue = toValue(mix[k])) {
2161
- string2 && (string2 += " ");
2162
- string2 += resolvedValue;
2163
- }
2164
- }
2165
- }
2166
- return string2;
2167
- };
2168
- function createTailwindMerge(createConfigFirst, ...createConfigRest) {
2169
- let configUtils;
2170
- let cacheGet;
2171
- let cacheSet;
2172
- let functionToCall = initTailwindMerge;
2173
- function initTailwindMerge(classList) {
2174
- const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
2175
- configUtils = createConfigUtils(config);
2176
- cacheGet = configUtils.cache.get;
2177
- cacheSet = configUtils.cache.set;
2178
- functionToCall = tailwindMerge;
2179
- return tailwindMerge(classList);
2180
- }
2181
- function tailwindMerge(classList) {
2182
- const cachedResult = cacheGet(classList);
2183
- if (cachedResult) {
2184
- return cachedResult;
2185
- }
2186
- const result = mergeClassList(classList, configUtils);
2187
- cacheSet(classList, result);
2188
- return result;
2189
- }
2190
- return function callTailwindMerge() {
2191
- return functionToCall(twJoin.apply(null, arguments));
2192
- };
2193
- }
2194
- var fromTheme = (key) => {
2195
- const themeGetter = (theme) => theme[key] || [];
2196
- themeGetter.isThemeGetter = true;
2197
- return themeGetter;
2198
- };
2199
- var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
2200
- var fractionRegex = /^\d+\/\d+$/;
2201
- var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
2202
- var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
2203
- var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
2204
- var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
2205
- var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
2206
- var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
2207
- var isLength = (value) => isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
2208
- var isArbitraryLength = (value) => getIsArbitraryValue(value, "length", isLengthOnly);
2209
- var isNumber = (value) => Boolean(value) && !Number.isNaN(Number(value));
2210
- var isArbitraryNumber = (value) => getIsArbitraryValue(value, "number", isNumber);
2211
- var isInteger = (value) => Boolean(value) && Number.isInteger(Number(value));
2212
- var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
2213
- var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
2214
- var isTshirtSize = (value) => tshirtUnitRegex.test(value);
2215
- var sizeLabels = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
2216
- var isArbitrarySize = (value) => getIsArbitraryValue(value, sizeLabels, isNever);
2217
- var isArbitraryPosition = (value) => getIsArbitraryValue(value, "position", isNever);
2218
- var imageLabels = /* @__PURE__ */ new Set(["image", "url"]);
2219
- var isArbitraryImage = (value) => getIsArbitraryValue(value, imageLabels, isImage);
2220
- var isArbitraryShadow = (value) => getIsArbitraryValue(value, "", isShadow);
2221
- var isAny = () => true;
2222
- var getIsArbitraryValue = (value, label, testValue) => {
2223
- const result = arbitraryValueRegex.exec(value);
2224
- if (result) {
2225
- if (result[1]) {
2226
- return typeof label === "string" ? result[1] === label : label.has(result[1]);
2227
- }
2228
- return testValue(result[2]);
1652
+ return function callTailwindMerge() {
1653
+ return functionToCall(twJoin.apply(null, arguments));
1654
+ };
1655
+ }
1656
+ var fromTheme = (key) => {
1657
+ const themeGetter = (theme) => theme[key] || [];
1658
+ themeGetter.isThemeGetter = true;
1659
+ return themeGetter;
1660
+ };
1661
+ var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
1662
+ var fractionRegex = /^\d+\/\d+$/;
1663
+ var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
1664
+ var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
1665
+ var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
1666
+ var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
1667
+ var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
1668
+ var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
1669
+ var isLength = (value) => isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
1670
+ var isArbitraryLength = (value) => getIsArbitraryValue(value, "length", isLengthOnly);
1671
+ var isNumber = (value) => Boolean(value) && !Number.isNaN(Number(value));
1672
+ var isArbitraryNumber = (value) => getIsArbitraryValue(value, "number", isNumber);
1673
+ var isInteger = (value) => Boolean(value) && Number.isInteger(Number(value));
1674
+ var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
1675
+ var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
1676
+ var isTshirtSize = (value) => tshirtUnitRegex.test(value);
1677
+ var sizeLabels = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
1678
+ var isArbitrarySize = (value) => getIsArbitraryValue(value, sizeLabels, isNever);
1679
+ var isArbitraryPosition = (value) => getIsArbitraryValue(value, "position", isNever);
1680
+ var imageLabels = /* @__PURE__ */ new Set(["image", "url"]);
1681
+ var isArbitraryImage = (value) => getIsArbitraryValue(value, imageLabels, isImage);
1682
+ var isArbitraryShadow = (value) => getIsArbitraryValue(value, "", isShadow);
1683
+ var isAny = () => true;
1684
+ var getIsArbitraryValue = (value, label, testValue) => {
1685
+ const result = arbitraryValueRegex.exec(value);
1686
+ if (result) {
1687
+ if (result[1]) {
1688
+ return typeof label === "string" ? result[1] === label : label.has(result[1]);
1689
+ }
1690
+ return testValue(result[2]);
2229
1691
  }
2230
1692
  return false;
2231
1693
  };
@@ -4300,20 +3762,558 @@ This is likely an error in Hexclave. Please make sure you are running the newest
4300
3762
  "touch-y": ["touch"],
4301
3763
  "touch-pz": ["touch"]
4302
3764
  },
4303
- conflictingClassGroupModifiers: {
4304
- "font-size": ["leading"]
4305
- }
3765
+ conflictingClassGroupModifiers: {
3766
+ "font-size": ["leading"]
3767
+ }
3768
+ };
3769
+ };
3770
+ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
3771
+
3772
+ // ../ui/dist/esm/lib/utils.js
3773
+ function cn(...inputs) {
3774
+ return twMerge(clsx(inputs));
3775
+ }
3776
+
3777
+ // ../shared/dist/esm/utils/react.js
3778
+ var import_react3 = __toESM(require_react());
3779
+
3780
+ // ../shared/dist/esm/utils/arrays.js
3781
+ function findLastIndex(arr, predicate) {
3782
+ for (let i = arr.length - 1; i >= 0; i--) if (predicate(arr[i])) return i;
3783
+ return -1;
3784
+ }
3785
+ function unique(arr) {
3786
+ return [...new Set(arr)];
3787
+ }
3788
+
3789
+ // ../shared/dist/esm/utils/strings.js
3790
+ function stringCompare(a26, b) {
3791
+ if (typeof a26 !== "string" || typeof b !== "string") throw new HexclaveAssertionError(`Expected two strings for stringCompare, found ${typeof a26} and ${typeof b}`, {
3792
+ a: a26,
3793
+ b
3794
+ });
3795
+ const cmp = (a27, b2) => a27 < b2 ? -1 : a27 > b2 ? 1 : 0;
3796
+ return cmp(a26.toUpperCase(), b.toUpperCase()) || cmp(b, a26);
3797
+ }
3798
+ function getWhitespacePrefix(s8) {
3799
+ return s8.substring(0, s8.length - s8.trimStart().length);
3800
+ }
3801
+ function trimEmptyLinesStart(s8) {
3802
+ const lines = s8.split("\n");
3803
+ const firstNonEmptyLineIndex = lines.findIndex((line) => line.trim() !== "");
3804
+ if (firstNonEmptyLineIndex === -1) return "";
3805
+ return lines.slice(firstNonEmptyLineIndex).join("\n");
3806
+ }
3807
+ function trimEmptyLinesEnd(s8) {
3808
+ const lines = s8.split("\n");
3809
+ const lastNonEmptyLineIndex = findLastIndex(lines, (line) => line.trim() !== "");
3810
+ return lines.slice(0, lastNonEmptyLineIndex + 1).join("\n");
3811
+ }
3812
+ function templateIdentity(strings, ...values) {
3813
+ if (values.length !== strings.length - 1) throw new HexclaveAssertionError("Invalid number of values; must be one less than strings", {
3814
+ strings,
3815
+ values
3816
+ });
3817
+ return strings.reduce((result, str, i) => result + str + (values[i] ?? ""), "");
3818
+ }
3819
+ function deindent(strings, ...values) {
3820
+ if (typeof strings === "string") return deindent([strings]);
3821
+ return templateIdentity(...deindentTemplate(strings, ...values));
3822
+ }
3823
+ function deindentTemplate(strings, ...values) {
3824
+ if (values.length !== strings.length - 1) throw new HexclaveAssertionError("Invalid number of values; must be one less than strings", {
3825
+ strings,
3826
+ values
3827
+ });
3828
+ const trimmedStrings = [...strings];
3829
+ trimmedStrings[0] = trimEmptyLinesStart(trimmedStrings[0] + "+").slice(0, -1);
3830
+ trimmedStrings[trimmedStrings.length - 1] = trimEmptyLinesEnd("+" + trimmedStrings[trimmedStrings.length - 1]).slice(1);
3831
+ const indentation = trimmedStrings.join("${SOME_VALUE}").split("\n").filter((line) => line.trim() !== "").map((line) => getWhitespacePrefix(line).length).reduce((min3, current) => Math.min(min3, current), Infinity);
3832
+ const deindentedStrings = trimmedStrings.map((string2, stringIndex) => {
3833
+ return string2.split("\n").map((line, lineIndex) => stringIndex !== 0 && lineIndex === 0 ? line : line.substring(indentation)).join("\n");
3834
+ });
3835
+ return [deindentedStrings, ...values.map((value, i) => {
3836
+ const firstLineIndentation = getWhitespacePrefix(deindentedStrings[i].split("\n").at(-1));
3837
+ return `${value}`.replaceAll("\n", `
3838
+ ${firstLineIndentation}`);
3839
+ })];
3840
+ }
3841
+ function escapeTemplateLiteral(s8) {
3842
+ return s8.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${");
3843
+ }
3844
+ var nicifiableClassNameOverrides = new Map(Object.entries({ Headers }).map(([k, v]) => [v, k]));
3845
+ function nicify(value, options = {}) {
3846
+ const fullOptions = {
3847
+ maxDepth: 5,
3848
+ currentIndent: "",
3849
+ lineIndent: " ",
3850
+ multiline: true,
3851
+ refs: /* @__PURE__ */ new Map(),
3852
+ path: "value",
3853
+ parent: null,
3854
+ overrides: () => null,
3855
+ keyInParent: null,
3856
+ hideFields: [],
3857
+ ...filterUndefined(options)
3858
+ };
3859
+ const { maxDepth, currentIndent, lineIndent, multiline, refs, path, overrides, hideFields } = fullOptions;
3860
+ const nl = `
3861
+ ${currentIndent}`;
3862
+ const overrideResult = overrides(value, options);
3863
+ if (overrideResult !== null) return overrideResult;
3864
+ if ([
3865
+ "function",
3866
+ "object",
3867
+ "symbol"
3868
+ ].includes(typeof value) && value !== null) {
3869
+ if (refs.has(value)) return `Ref<${refs.get(value)}>`;
3870
+ refs.set(value, path);
3871
+ }
3872
+ const newOptions = {
3873
+ maxDepth: maxDepth - 1,
3874
+ currentIndent,
3875
+ lineIndent,
3876
+ multiline,
3877
+ refs,
3878
+ path: path + "->[unknown property]",
3879
+ overrides,
3880
+ parent: {
3881
+ value,
3882
+ options: fullOptions
3883
+ },
3884
+ keyInParent: null,
3885
+ hideFields: []
4306
3886
  };
4307
- };
4308
- var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
3887
+ const nestedNicify = (newValue, newPath, keyInParent, options2 = {}) => {
3888
+ return nicify(newValue, {
3889
+ ...newOptions,
3890
+ path: newPath,
3891
+ currentIndent: currentIndent + lineIndent,
3892
+ keyInParent,
3893
+ ...options2
3894
+ });
3895
+ };
3896
+ switch (typeof value) {
3897
+ case "boolean":
3898
+ case "number":
3899
+ return JSON.stringify(value);
3900
+ case "string": {
3901
+ const isDeindentable = (v) => deindent(v) === v && v.includes("\n");
3902
+ const wrapInDeindent = (v) => deindent`
3903
+ deindent\`
3904
+ ${currentIndent + lineIndent}${escapeTemplateLiteral(v).replaceAll("\n", nl + lineIndent)}
3905
+ ${currentIndent}\`
3906
+ `;
3907
+ if (isDeindentable(value)) return wrapInDeindent(value);
3908
+ else if (value.endsWith("\n") && isDeindentable(value.slice(0, -1))) return wrapInDeindent(value.slice(0, -1)) + ' + "\\n"';
3909
+ else return JSON.stringify(value);
3910
+ }
3911
+ case "undefined":
3912
+ return "undefined";
3913
+ case "symbol":
3914
+ return value.toString();
3915
+ case "bigint":
3916
+ return `${value}n`;
3917
+ case "function":
3918
+ if (value.name) return `function ${value.name}(...) { ... }`;
3919
+ return `(...) => { ... }`;
3920
+ case "object": {
3921
+ if (value === null) return "null";
3922
+ if (Array.isArray(value)) {
3923
+ const extraLines2 = getNicifiedObjectExtraLines(value);
3924
+ const resValueLength2 = value.length + extraLines2.length;
3925
+ if (resValueLength2 === 0) return "[]";
3926
+ if (maxDepth <= 0) return `[...]`;
3927
+ const resValues2 = value.map((v, i) => nestedNicify(v, `${path}[${i}]`, i));
3928
+ resValues2.push(...extraLines2);
3929
+ if (resValues2.length !== resValueLength2) throw new HexclaveAssertionError("nicify of object: resValues.length !== resValueLength", {
3930
+ value,
3931
+ resValues: resValues2,
3932
+ resValueLength: resValueLength2
3933
+ });
3934
+ if (resValues2.length > 4 || resValues2.some((x) => resValues2.length > 1 && x.length > 4 || x.includes("\n"))) return `[${nl}${resValues2.map((x) => `${lineIndent}${x},${nl}`).join("")}]`;
3935
+ else return `[${resValues2.join(", ")}]`;
3936
+ }
3937
+ if (value instanceof Date) return `Date(${nestedNicify(value.toISOString(), `${path}.toISOString()`, null)})`;
3938
+ if (value instanceof URL) return `URL(${nestedNicify(value.toString(), `${path}.toString()`, null)})`;
3939
+ if (ArrayBuffer.isView(value)) return `${value.constructor.name}([${value.toString()}])`;
3940
+ if (value instanceof ArrayBuffer) return `ArrayBuffer [${new Uint8Array(value).toString()}]`;
3941
+ if (value instanceof Error) {
3942
+ let stack = value.stack ?? "";
3943
+ const toString3 = value.toString();
3944
+ if (!stack.startsWith(toString3)) stack = `${toString3}
3945
+ ${stack}`;
3946
+ stack = stack.trimEnd();
3947
+ stack = stack.replace(/\n\s+/g, `
3948
+ ${lineIndent}${lineIndent}`);
3949
+ stack = stack.replace("\n", `
3950
+ ${lineIndent}Stack:
3951
+ `);
3952
+ if (Object.keys(value).length > 0) stack += `
3953
+ ${lineIndent}Extra properties: ${nestedNicify(Object.fromEntries(Object.entries(value)), path, null)}`;
3954
+ if (value.cause) stack += `
3955
+ ${lineIndent}Cause:
3956
+ ${lineIndent}${lineIndent}${nestedNicify(value.cause, path, null, { currentIndent: currentIndent + lineIndent + lineIndent })}`;
3957
+ stack = stack.replaceAll("\n", `
3958
+ ${currentIndent}`);
3959
+ return stack;
3960
+ }
3961
+ const constructorName = [null, Object.prototype].includes(Object.getPrototypeOf(value)) ? null : nicifiableClassNameOverrides.get(value.constructor) ?? value.constructor.name;
3962
+ const constructorString = constructorName ? `${constructorName} ` : "";
3963
+ const entries = getNicifiableEntries(value).filter(([k]) => !hideFields.includes(k));
3964
+ const extraLines = [...getNicifiedObjectExtraLines(value), ...hideFields.length > 0 ? [`<some fields may have been hidden>`] : []];
3965
+ const resValueLength = entries.length + extraLines.length;
3966
+ if (resValueLength === 0) return `${constructorString}{}`;
3967
+ if (maxDepth <= 0) return `${constructorString}{ ... }`;
3968
+ const resValues = entries.map(([k, v], keyIndex) => {
3969
+ const keyNicified = nestedNicify(k, `Object.keys(${path})[${keyIndex}]`, null);
3970
+ const keyInObjectLiteral = typeof k === "string" ? nicifyPropertyString(k) : `[${keyNicified}]`;
3971
+ if (typeof v === "function" && v.name === k) return `${keyInObjectLiteral}(...): { ... }`;
3972
+ else return `${keyInObjectLiteral}: ${nestedNicify(v, `${path}[${keyNicified}]`, k)}`;
3973
+ });
3974
+ resValues.push(...extraLines);
3975
+ if (resValues.length !== resValueLength) throw new HexclaveAssertionError("nicify of object: resValues.length !== resValueLength", {
3976
+ value,
3977
+ resValues,
3978
+ resValueLength
3979
+ });
3980
+ const shouldIndent = resValues.length > 1 || resValues.some((x) => x.includes("\n"));
3981
+ if (resValues.length === 0) return `${constructorString}{}`;
3982
+ if (shouldIndent) return `${constructorString}{${nl}${resValues.map((x) => `${lineIndent}${x},${nl}`).join("")}}`;
3983
+ else return `${constructorString}{ ${resValues.join(", ")} }`;
3984
+ }
3985
+ default:
3986
+ return `${typeof value}<${value}>`;
3987
+ }
3988
+ }
3989
+ function nicifyPropertyString(str) {
3990
+ return JSON.stringify(str);
3991
+ }
3992
+ function getNicifiableKeys(value) {
3993
+ const overridden = ("getNicifiableKeys" in value ? value.getNicifiableKeys?.bind(value) : null)?.();
3994
+ if (overridden != null) return overridden;
3995
+ if (value instanceof Response) return ["status", "headers"];
3996
+ return unique(Object.keys(value).sort());
3997
+ }
3998
+ function getNicifiableEntries(value) {
3999
+ const recordLikes = [Headers];
4000
+ function isRecordLike(value2) {
4001
+ return recordLikes.some((x) => value2 instanceof x);
4002
+ }
4003
+ if (isRecordLike(value)) return [...value.entries()].sort(([a26], [b]) => stringCompare(`${a26}`, `${b}`));
4004
+ return getNicifiableKeys(value).map((k) => [k, value[k]]);
4005
+ }
4006
+ function getNicifiedObjectExtraLines(value) {
4007
+ return ("getNicifiedObjectExtraLines" in value ? value.getNicifiedObjectExtraLines : null)?.() ?? [];
4008
+ }
4009
+
4010
+ // ../shared/dist/esm/utils/functions.js
4011
+ function identityArgs(...args) {
4012
+ return args;
4013
+ }
4014
+
4015
+ // ../shared/dist/esm/utils/types.js
4016
+ typeAssertIs()();
4017
+ typeAssertIs()();
4018
+ typeAssertIs()();
4019
+ typeAssertExtends()();
4020
+ typeAssertExtends()();
4021
+ typeAssertExtends()();
4022
+ typeAssertExtends()();
4023
+ function typeAssertExtends() {
4024
+ return () => void 0;
4025
+ }
4026
+ typeAssertExtends()();
4027
+ typeAssertExtends()();
4028
+ typeAssertExtends()();
4029
+ typeAssertExtends()();
4030
+ typeAssertExtends()();
4031
+ typeAssertExtends()();
4032
+ typeAssertExtends()();
4033
+ typeAssertExtends()();
4034
+ typeAssertExtends()();
4035
+ typeAssertExtends()();
4036
+ typeAssertExtends()();
4037
+ function typeAssertIs() {
4038
+ return () => void 0;
4039
+ }
4040
+ typeAssertExtends()();
4041
+ typeAssertExtends()();
4042
+ typeAssertExtends()();
4043
+ typeAssertExtends()();
4044
+ typeAssertExtends()();
4045
+ typeAssertExtends()();
4046
+ typeAssertExtends()();
4047
+ typeAssertExtends()();
4048
+ typeAssertExtends()();
4049
+ typeAssertExtends()();
4050
+ typeAssertExtends()();
4051
+ typeAssertExtends()();
4052
+
4053
+ // ../shared/dist/esm/utils/objects.js
4054
+ function deepPlainClone(obj) {
4055
+ if (typeof obj === "function") throw new HexclaveAssertionError("deepPlainClone does not support functions");
4056
+ if (typeof obj === "symbol") throw new HexclaveAssertionError("deepPlainClone does not support symbols");
4057
+ if (typeof obj !== "object" || !obj) return obj;
4058
+ if (Array.isArray(obj)) return obj.map(deepPlainClone);
4059
+ return Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, deepPlainClone(v)]));
4060
+ }
4061
+ function typedFromEntries(entries) {
4062
+ return Object.fromEntries(entries);
4063
+ }
4064
+ function filterUndefined(obj) {
4065
+ return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== void 0));
4066
+ }
4067
+ typeAssertIs()();
4068
+ function pick(obj, keys) {
4069
+ return Object.fromEntries(Object.entries(obj).filter(([k]) => keys.includes(k)));
4070
+ }
4071
+ function omit(obj, keys) {
4072
+ if (!Array.isArray(keys)) throw new HexclaveAssertionError("omit: keys must be an array", {
4073
+ obj,
4074
+ keys
4075
+ });
4076
+ return Object.fromEntries(Object.entries(obj).filter(([k]) => !keys.includes(k)));
4077
+ }
4309
4078
 
4310
- // ../ui/dist/esm/lib/utils.js
4311
- function cn(...inputs) {
4312
- return twMerge(clsx(inputs));
4079
+ // ../shared/dist/esm/utils/globals.js
4080
+ var globalVar = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {};
4081
+ if (typeof globalThis === "undefined") globalVar.globalThis = globalVar;
4082
+ var hexclaveGlobalsSymbol = Symbol.for("__hexclave-globals");
4083
+ globalVar[hexclaveGlobalsSymbol] ??= {};
4084
+
4085
+ // ../shared/dist/esm/utils/errors.js
4086
+ function throwErr(...args) {
4087
+ if (typeof args[0] === "string") throw new HexclaveAssertionError(args[0], args[1]);
4088
+ else if (args[0] instanceof Error) throw args[0];
4089
+ else throw new StatusError(...args);
4090
+ }
4091
+ function removeStacktraceNameLine(stack) {
4092
+ const addsNameLine = (/* @__PURE__ */ new Error()).stack?.startsWith("Error\n");
4093
+ return stack.split("\n").slice(addsNameLine ? 1 : 0).join("\n");
4094
+ }
4095
+ function concatStacktraces(first, ...errors) {
4096
+ const addsEmptyLineAtEnd = first.stack?.endsWith("\n");
4097
+ const separator = removeStacktraceNameLine((/* @__PURE__ */ new Error()).stack ?? "").split("\n")[0];
4098
+ for (const error of errors) {
4099
+ const toAppend = removeStacktraceNameLine(error.stack ?? "");
4100
+ first.stack += (addsEmptyLineAtEnd ? "" : "\n") + separator + "\n" + toAppend;
4101
+ }
4313
4102
  }
4103
+ var HexclaveAssertionError = class extends Error {
4104
+ constructor(message, extraData) {
4105
+ const disclaimer = `
4314
4106
 
4315
- // ../shared/dist/esm/utils/react.js
4316
- var import_react3 = __toESM(require_react());
4107
+ This is likely an error in Hexclave. Please make sure you are running the newest version and report it.`;
4108
+ super(`${message}${message.endsWith(disclaimer) ? "" : disclaimer}`, pick(extraData ?? {}, ["cause"]));
4109
+ this.extraData = extraData;
4110
+ Object.defineProperty(this, "customCaptureExtraArgs", {
4111
+ get() {
4112
+ return [this.extraData];
4113
+ },
4114
+ enumerable: false
4115
+ });
4116
+ if ((typeof process !== "undefined" ? process.env.NEXT_PUBLIC_STACK_DEBUGGER_ON_ASSERTION_ERROR : void 0) === "true") debugger;
4117
+ }
4118
+ };
4119
+ HexclaveAssertionError.prototype.name = "HexclaveAssertionError";
4120
+ function errorToNiceString(error) {
4121
+ if (!(error instanceof Error)) return `${typeof error}<${nicify(error)}>`;
4122
+ return nicify(error, { maxDepth: 8 });
4123
+ }
4124
+ var errorSinks = /* @__PURE__ */ new Set();
4125
+ function registerErrorSink(sink) {
4126
+ if (errorSinks.has(sink)) return;
4127
+ errorSinks.add(sink);
4128
+ }
4129
+ registerErrorSink((location, error, level, ...extraArgs) => {
4130
+ (level === "warning" ? console.warn : console.error)(`${level === "warning" ? "\x1B[43m" : "\x1B[41m"}Captured ${level === "warning" ? "warning" : "error"} in ${location}:`, errorToNiceString(error), ...extraArgs, "\x1B[0m");
4131
+ });
4132
+ registerErrorSink((location, error, level, ...extraArgs) => {
4133
+ globalVar.hexclaveCapturedErrors = globalVar.hexclaveCapturedErrors ?? [];
4134
+ globalVar.hexclaveCapturedErrors.push({
4135
+ location,
4136
+ error,
4137
+ level,
4138
+ extraArgs
4139
+ });
4140
+ });
4141
+ function dispatchToSinks(location, error, level) {
4142
+ for (const sink of errorSinks) sink(location, error, level, ...error && (typeof error === "object" || typeof error === "function") && "customCaptureExtraArgs" in error && Array.isArray(error.customCaptureExtraArgs) ? error.customCaptureExtraArgs : []);
4143
+ }
4144
+ function captureError(location, error) {
4145
+ dispatchToSinks(location, error, "error");
4146
+ }
4147
+ var _a;
4148
+ var StatusError = (_a = class extends Error {
4149
+ constructor(status, message) {
4150
+ if (typeof status === "object") {
4151
+ message ??= status.message;
4152
+ status = status.statusCode;
4153
+ }
4154
+ super(message);
4155
+ this.__stackStatusErrorBrand = "stack-status-error-brand-sentinel";
4156
+ this.name = "StatusError";
4157
+ this.statusCode = status;
4158
+ if (!message) throw new HexclaveAssertionError("StatusError always requires a message unless a Status object is passed", { cause: this });
4159
+ }
4160
+ static isStatusError(error) {
4161
+ return typeof error === "object" && error !== null && "__stackStatusErrorBrand" in error && error.__stackStatusErrorBrand === "stack-status-error-brand-sentinel";
4162
+ }
4163
+ isClientError() {
4164
+ return this.statusCode >= 400 && this.statusCode < 500;
4165
+ }
4166
+ isServerError() {
4167
+ return !this.isClientError();
4168
+ }
4169
+ getStatusCode() {
4170
+ return this.statusCode;
4171
+ }
4172
+ getBody() {
4173
+ return new TextEncoder().encode(this.message);
4174
+ }
4175
+ getHeaders() {
4176
+ return { "Content-Type": ["text/plain; charset=utf-8"] };
4177
+ }
4178
+ toDescriptiveJson() {
4179
+ return {
4180
+ status_code: this.getStatusCode(),
4181
+ message: this.message,
4182
+ headers: this.getHeaders()
4183
+ };
4184
+ }
4185
+ /**
4186
+ * @deprecated this is not a good way to make status errors human-readable, use toDescriptiveJson instead
4187
+ */
4188
+ toHttpJson() {
4189
+ return {
4190
+ status_code: this.statusCode,
4191
+ body: this.message,
4192
+ headers: this.getHeaders()
4193
+ };
4194
+ }
4195
+ }, _a.BadRequest = {
4196
+ statusCode: 400,
4197
+ message: "Bad Request"
4198
+ }, _a.Unauthorized = {
4199
+ statusCode: 401,
4200
+ message: "Unauthorized"
4201
+ }, _a.PaymentRequired = {
4202
+ statusCode: 402,
4203
+ message: "Payment Required"
4204
+ }, _a.Forbidden = {
4205
+ statusCode: 403,
4206
+ message: "Forbidden"
4207
+ }, _a.NotFound = {
4208
+ statusCode: 404,
4209
+ message: "Not Found"
4210
+ }, _a.MethodNotAllowed = {
4211
+ statusCode: 405,
4212
+ message: "Method Not Allowed"
4213
+ }, _a.NotAcceptable = {
4214
+ statusCode: 406,
4215
+ message: "Not Acceptable"
4216
+ }, _a.ProxyAuthenticationRequired = {
4217
+ statusCode: 407,
4218
+ message: "Proxy Authentication Required"
4219
+ }, _a.RequestTimeout = {
4220
+ statusCode: 408,
4221
+ message: "Request Timeout"
4222
+ }, _a.Conflict = {
4223
+ statusCode: 409,
4224
+ message: "Conflict"
4225
+ }, _a.Gone = {
4226
+ statusCode: 410,
4227
+ message: "Gone"
4228
+ }, _a.LengthRequired = {
4229
+ statusCode: 411,
4230
+ message: "Length Required"
4231
+ }, _a.PreconditionFailed = {
4232
+ statusCode: 412,
4233
+ message: "Precondition Failed"
4234
+ }, _a.PayloadTooLarge = {
4235
+ statusCode: 413,
4236
+ message: "Payload Too Large"
4237
+ }, _a.URITooLong = {
4238
+ statusCode: 414,
4239
+ message: "URI Too Long"
4240
+ }, _a.UnsupportedMediaType = {
4241
+ statusCode: 415,
4242
+ message: "Unsupported Media Type"
4243
+ }, _a.RangeNotSatisfiable = {
4244
+ statusCode: 416,
4245
+ message: "Range Not Satisfiable"
4246
+ }, _a.ExpectationFailed = {
4247
+ statusCode: 417,
4248
+ message: "Expectation Failed"
4249
+ }, _a.ImATeapot = {
4250
+ statusCode: 418,
4251
+ message: "I'm a teapot"
4252
+ }, _a.MisdirectedRequest = {
4253
+ statusCode: 421,
4254
+ message: "Misdirected Request"
4255
+ }, _a.UnprocessableEntity = {
4256
+ statusCode: 422,
4257
+ message: "Unprocessable Entity"
4258
+ }, _a.Locked = {
4259
+ statusCode: 423,
4260
+ message: "Locked"
4261
+ }, _a.FailedDependency = {
4262
+ statusCode: 424,
4263
+ message: "Failed Dependency"
4264
+ }, _a.TooEarly = {
4265
+ statusCode: 425,
4266
+ message: "Too Early"
4267
+ }, _a.UpgradeRequired = {
4268
+ statusCode: 426,
4269
+ message: "Upgrade Required"
4270
+ }, _a.PreconditionRequired = {
4271
+ statusCode: 428,
4272
+ message: "Precondition Required"
4273
+ }, _a.TooManyRequests = {
4274
+ statusCode: 429,
4275
+ message: "Too Many Requests"
4276
+ }, _a.RequestHeaderFieldsTooLarge = {
4277
+ statusCode: 431,
4278
+ message: "Request Header Fields Too Large"
4279
+ }, _a.UnavailableForLegalReasons = {
4280
+ statusCode: 451,
4281
+ message: "Unavailable For Legal Reasons"
4282
+ }, _a.InternalServerError = {
4283
+ statusCode: 500,
4284
+ message: "Internal Server Error"
4285
+ }, _a.NotImplemented = {
4286
+ statusCode: 501,
4287
+ message: "Not Implemented"
4288
+ }, _a.BadGateway = {
4289
+ statusCode: 502,
4290
+ message: "Bad Gateway"
4291
+ }, _a.ServiceUnavailable = {
4292
+ statusCode: 503,
4293
+ message: "Service Unavailable"
4294
+ }, _a.GatewayTimeout = {
4295
+ statusCode: 504,
4296
+ message: "Gateway Timeout"
4297
+ }, _a.HTTPVersionNotSupported = {
4298
+ statusCode: 505,
4299
+ message: "HTTP Version Not Supported"
4300
+ }, _a.VariantAlsoNegotiates = {
4301
+ statusCode: 506,
4302
+ message: "Variant Also Negotiates"
4303
+ }, _a.InsufficientStorage = {
4304
+ statusCode: 507,
4305
+ message: "Insufficient Storage"
4306
+ }, _a.LoopDetected = {
4307
+ statusCode: 508,
4308
+ message: "Loop Detected"
4309
+ }, _a.NotExtended = {
4310
+ statusCode: 510,
4311
+ message: "Not Extended"
4312
+ }, _a.NetworkAuthenticationRequired = {
4313
+ statusCode: 511,
4314
+ message: "Network Authentication Required"
4315
+ }, _a);
4316
+ StatusError.prototype.name = "StatusError";
4317
4317
 
4318
4318
  // ../shared/dist/esm/utils/env.js
4319
4319
  function getHexclaveEnvVarName(name) {
@@ -7620,6 +7620,7 @@ attempted value: ${formattedValue}
7620
7620
  "twitch"
7621
7621
  ];
7622
7622
  var allProviders = standardProviders;
7623
+ var allProviderTypes = [...standardProviders, "custom_oidc"];
7623
7624
 
7624
7625
  // ../shared/dist/esm/utils/country-codes.js
7625
7626
  function normalizeCountryCode(countryCode) {
@@ -8065,6 +8066,14 @@ attempted value: ${formattedValue}
8065
8066
  description: "Determines how to handle OAuth logins that match an existing user by email. `link_method` adds the OAuth method to the existing user. `raise_error` rejects the login with an error. `allow_duplicates` creates a new user.",
8066
8067
  exampleValue: "link_method"
8067
8068
  } });
8069
+ var oauthIssuerUrlSchema = urlSchema.meta({ openapiField: {
8070
+ description: 'OIDC issuer URL for custom OIDC providers. Must support OIDC discovery (/.well-known/openid-configuration). Only used when type is "custom_oidc".',
8071
+ exampleValue: "https://accounts.google.com"
8072
+ } });
8073
+ var oauthScopeSchema = yupString().meta({ openapiField: {
8074
+ description: 'Space-separated OAuth scopes to request from the custom OIDC provider. Defaults to "openid email profile" if not specified.',
8075
+ exampleValue: "openid email profile"
8076
+ } });
8068
8077
  var emailTypeSchema = yupString().oneOf(["shared", "standard"]).meta({ openapiField: {
8069
8078
  description: 'Email provider type, one of shared, standard. "shared" uses Stack shared email provider and it is only meant for development. "standard" uses your own email server and will have your email address as the sender.',
8070
8079
  exampleValue: "standard"