@styleframe/cli 2.4.0 → 3.0.0

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.
@@ -1,9 +1,9 @@
1
1
  import { rm, mkdir, writeFile, stat } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { validateInstanceLicense, getLicenseKeyFromEnv } from "@styleframe/license";
4
+ import require$$2, { existsSync } from "node:fs";
4
5
  import require$$1, { createRequire } from "node:module";
5
6
  import require$$0 from "node:os";
6
- import require$$2, { existsSync } from "node:fs";
7
7
  import require$$3 from "node:url";
8
8
  import require$$4 from "node:assert";
9
9
  import require$$5 from "node:process";
@@ -71,7 +71,7 @@ function requireJiti() {
71
71
  function kw(e3, t3) {
72
72
  return void 0 === t3 && (t3 = {}), t3.keyword = e3, d2[e3] = new acorn_TokenType(e3, t3);
73
73
  }
74
- var f = { num: new acorn_TokenType("num", u), regexp: new acorn_TokenType("regexp", u), string: new acorn_TokenType("string", u), name: new acorn_TokenType("name", u), privateId: new acorn_TokenType("privateId", u), eof: new acorn_TokenType("eof"), bracketL: new acorn_TokenType("[", { beforeExpr: true, startsExpr: true }), bracketR: new acorn_TokenType("]"), braceL: new acorn_TokenType("{", { beforeExpr: true, startsExpr: true }), braceR: new acorn_TokenType("}"), parenL: new acorn_TokenType("(", { beforeExpr: true, startsExpr: true }), parenR: new acorn_TokenType(")"), comma: new acorn_TokenType(",", l), semi: new acorn_TokenType(";", l), colon: new acorn_TokenType(":", l), dot: new acorn_TokenType("."), question: new acorn_TokenType("?", l), questionDot: new acorn_TokenType("?."), arrow: new acorn_TokenType("=>", l), template: new acorn_TokenType("template"), invalidTemplate: new acorn_TokenType("invalidTemplate"), ellipsis: new acorn_TokenType("...", l), backQuote: new acorn_TokenType("`", u), dollarBraceL: new acorn_TokenType("${", { beforeExpr: true, startsExpr: true }), eq: new acorn_TokenType("=", { beforeExpr: true, isAssign: true }), assign: new acorn_TokenType("_=", { beforeExpr: true, isAssign: true }), incDec: new acorn_TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), prefix: new acorn_TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), logicalOR: binop("||", 1), logicalAND: binop("&&", 2), bitwiseOR: binop("|", 3), bitwiseXOR: binop("^", 4), bitwiseAND: binop("&", 5), equality: binop("==/!=/===/!==", 6), relational: binop("</>/<=/>=", 7), bitShift: binop("<</>>/>>>", 8), plusMin: new acorn_TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), modulo: binop("%", 10), star: binop("*", 10), slash: binop("/", 10), starstar: new acorn_TokenType("**", { beforeExpr: true }), coalesce: binop("??", 1), _break: kw("break"), _case: kw("case", l), _catch: kw("catch"), _continue: kw("continue"), _debugger: kw("debugger"), _default: kw("default", l), _do: kw("do", { isLoop: true, beforeExpr: true }), _else: kw("else", l), _finally: kw("finally"), _for: kw("for", { isLoop: true }), _function: kw("function", u), _if: kw("if"), _return: kw("return", l), _switch: kw("switch"), _throw: kw("throw", l), _try: kw("try"), _var: kw("var"), _const: kw("const"), _while: kw("while", { isLoop: true }), _with: kw("with"), _new: kw("new", { beforeExpr: true, startsExpr: true }), _this: kw("this", u), _super: kw("super", u), _class: kw("class", u), _extends: kw("extends", l), _export: kw("export"), _import: kw("import", u), _null: kw("null", u), _true: kw("true", u), _false: kw("false", u), _in: kw("in", { beforeExpr: true, binop: 7 }), _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) }, m2 = /\r\n?|\n|\u2028|\u2029/, g2 = new RegExp(m2.source, "g");
74
+ var f = { num: new acorn_TokenType("num", u), regexp: new acorn_TokenType("regexp", u), string: new acorn_TokenType("string", u), name: new acorn_TokenType("name", u), privateId: new acorn_TokenType("privateId", u), eof: new acorn_TokenType("eof"), bracketL: new acorn_TokenType("[", { beforeExpr: true, startsExpr: true }), bracketR: new acorn_TokenType("]"), braceL: new acorn_TokenType("{", { beforeExpr: true, startsExpr: true }), braceR: new acorn_TokenType("}"), parenL: new acorn_TokenType("(", { beforeExpr: true, startsExpr: true }), parenR: new acorn_TokenType(")"), comma: new acorn_TokenType(",", l), semi: new acorn_TokenType(";", l), colon: new acorn_TokenType(":", l), dot: new acorn_TokenType("."), question: new acorn_TokenType("?", l), questionDot: new acorn_TokenType("?."), arrow: new acorn_TokenType("=>", l), template: new acorn_TokenType("template"), invalidTemplate: new acorn_TokenType("invalidTemplate"), ellipsis: new acorn_TokenType("...", l), backQuote: new acorn_TokenType("`", u), dollarBraceL: new acorn_TokenType("${", { beforeExpr: true, startsExpr: true }), eq: new acorn_TokenType("=", { beforeExpr: true, isAssign: true }), assign: new acorn_TokenType("_=", { beforeExpr: true, isAssign: true }), incDec: new acorn_TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), prefix: new acorn_TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), logicalOR: binop("||", 1), logicalAND: binop("&&", 2), bitwiseOR: binop("|", 3), bitwiseXOR: binop("^", 4), bitwiseAND: binop("&", 5), equality: binop("==/!=/===/!==", 6), relational: binop("</>/<=/>=", 7), bitShift: binop("<</>>/>>>", 8), plusMin: new acorn_TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), modulo: binop("%", 10), star: binop("*", 10), slash: binop("/", 10), starstar: new acorn_TokenType("**", { beforeExpr: true }), coalesce: binop("??", 1), _break: kw("break"), _case: kw("case", l), _catch: kw("catch"), _continue: kw("continue"), _debugger: kw("debugger"), _default: kw("default", l), _do: kw("do", { isLoop: true, beforeExpr: true }), _else: kw("else", l), _finally: kw("finally"), _for: kw("for", { isLoop: true }), _function: kw("function", u), _if: kw("if"), _return: kw("return", l), _switch: kw("switch"), _throw: kw("throw", l), _try: kw("try"), _var: kw("var"), _const: kw("const"), _while: kw("while", { isLoop: true }), _with: kw("with"), _new: kw("new", { beforeExpr: true, startsExpr: true }), _this: kw("this", u), _super: kw("super", u), _class: kw("class", u), _extends: kw("extends", l), _export: kw("export"), _import: kw("import", u), _null: kw("null", u), _true: kw("true", u), _false: kw("false", u), _in: kw("in", { beforeExpr: true, binop: 7 }), _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) }, m = /\r\n?|\n|\u2028|\u2029/, g = new RegExp(m.source, "g");
75
75
  function isNewLine(e3) {
76
76
  return 10 === e3 || 13 === e3 || 8232 === e3 || 8233 === e3;
77
77
  }
@@ -83,8 +83,8 @@ function requireJiti() {
83
83
  }
84
84
  return -1;
85
85
  }
86
- var x2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, v2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, y = Object.prototype, _ = y.hasOwnProperty, E2 = y.toString, b = Object.hasOwn || function(e3, t3) {
87
- return _.call(e3, t3);
86
+ var x2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, v2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, y = Object.prototype, _2 = y.hasOwnProperty, E2 = y.toString, b = Object.hasOwn || function(e3, t3) {
87
+ return _2.call(e3, t3);
88
88
  }, S2 = Array.isArray || function(e3) {
89
89
  return "[object Array]" === E2.call(e3);
90
90
  }, k2 = /* @__PURE__ */ Object.create(null);
@@ -136,7 +136,7 @@ function requireJiti() {
136
136
  var s2 = "";
137
137
  true !== e3.allowReserved && (s2 = n[e3.ecmaVersion >= 6 ? 6 : 5 === e3.ecmaVersion ? 5 : 3], "module" === e3.sourceType && (s2 += " await")), this.reservedWords = wordsRegexp(s2);
138
138
  var r2 = (s2 ? s2 + " " : "") + n.strict;
139
- this.reservedWordsStrict = wordsRegexp(r2), this.reservedWordsStrictBind = wordsRegexp(r2 + " " + n.strictBind), this.input = String(t3), this.containsEsc = false, i2 ? (this.pos = i2, this.lineStart = this.input.lastIndexOf("\n", i2 - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(m2).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = f.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = true, this.inModule = "module" === e3.sourceType, this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = false, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), 0 === this.pos && e3.allowHashBang && "#!" === this.input.slice(0, 2) && this.skipLineComment(2), this.scopeStack = [], this.enterScope(1), this.regexpState = null, this.privateNameStack = [];
139
+ this.reservedWordsStrict = wordsRegexp(r2), this.reservedWordsStrictBind = wordsRegexp(r2 + " " + n.strictBind), this.input = String(t3), this.containsEsc = false, i2 ? (this.pos = i2, this.lineStart = this.input.lastIndexOf("\n", i2 - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(m).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = f.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = true, this.inModule = "module" === e3.sourceType, this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = false, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), 0 === this.pos && e3.allowHashBang && "#!" === this.input.slice(0, 2) && this.skipLineComment(2), this.scopeStack = [], this.enterScope(1), this.regexpState = null, this.privateNameStack = [];
140
140
  }, T2 = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } };
141
141
  acorn_Parser.prototype.parse = function() {
142
142
  var e3 = this.options.program || this.startNode();
@@ -190,7 +190,7 @@ function requireJiti() {
190
190
  if ("use strict" === (t3[1] || t3[2])) {
191
191
  v2.lastIndex = e3 + t3[0].length;
192
192
  var i2 = v2.exec(this.input), s2 = i2.index + i2[0].length, r2 = this.input.charAt(s2);
193
- return ";" === r2 || "}" === r2 || m2.test(i2[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(r2) || "!" === r2 && "=" === this.input.charAt(s2 + 1));
193
+ return ";" === r2 || "}" === r2 || m.test(i2[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(r2) || "!" === r2 && "=" === this.input.charAt(s2 + 1));
194
194
  }
195
195
  e3 += t3[0].length, v2.lastIndex = e3, e3 += v2.exec(this.input)[0].length, ";" === this.input[e3] && e3++;
196
196
  }
@@ -203,7 +203,7 @@ function requireJiti() {
203
203
  }, A2.expectContextual = function(e3) {
204
204
  this.eatContextual(e3) || this.unexpected();
205
205
  }, A2.canInsertSemicolon = function() {
206
- return this.type === f.eof || this.type === f.braceR || m2.test(this.input.slice(this.lastTokEnd, this.start));
206
+ return this.type === f.eof || this.type === f.braceR || m.test(this.input.slice(this.lastTokEnd, this.start));
207
207
  }, A2.insertSemicolon = function() {
208
208
  if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), true;
209
209
  }, A2.semicolon = function() {
@@ -266,18 +266,18 @@ function requireJiti() {
266
266
  if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return false;
267
267
  v2.lastIndex = this.pos;
268
268
  var e3, t3 = v2.exec(this.input), i2 = this.pos + t3[0].length;
269
- return !(m2.test(this.input.slice(this.pos, i2)) || "function" !== this.input.slice(i2, i2 + 8) || i2 + 8 !== this.input.length && (isIdentifierChar(e3 = this.input.charCodeAt(i2 + 8)) || e3 > 55295 && e3 < 56320));
269
+ return !(m.test(this.input.slice(this.pos, i2)) || "function" !== this.input.slice(i2, i2 + 8) || i2 + 8 !== this.input.length && (isIdentifierChar(e3 = this.input.charCodeAt(i2 + 8)) || e3 > 55295 && e3 < 56320));
270
270
  }, L2.isUsingKeyword = function(e3, t3) {
271
271
  if (this.options.ecmaVersion < 17 || !this.isContextual(e3 ? "await" : "using")) return false;
272
272
  v2.lastIndex = this.pos;
273
273
  var i2 = v2.exec(this.input), s2 = this.pos + i2[0].length;
274
- if (m2.test(this.input.slice(this.pos, s2))) return false;
274
+ if (m.test(this.input.slice(this.pos, s2))) return false;
275
275
  if (e3) {
276
276
  var r2, n2 = s2 + 5;
277
277
  if ("using" !== this.input.slice(s2, n2) || n2 === this.input.length || isIdentifierChar(r2 = this.input.charCodeAt(n2)) || r2 > 55295 && r2 < 56320) return false;
278
278
  v2.lastIndex = n2;
279
279
  var a2 = v2.exec(this.input);
280
- if (a2 && m2.test(this.input.slice(n2, n2 + a2[0].length))) return false;
280
+ if (a2 && m.test(this.input.slice(n2, n2 + a2[0].length))) return false;
281
281
  }
282
282
  if (t3) {
283
283
  var o2, h3 = s2 + 2;
@@ -389,7 +389,7 @@ function requireJiti() {
389
389
  } else t3 || this.unexpected(), t3.consequent.push(this.parseStatement(null));
390
390
  return this.exitScope(), t3 && this.finishNode(t3, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e3, "SwitchStatement");
391
391
  }, L2.parseThrowStatement = function(e3) {
392
- return this.next(), m2.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e3.argument = this.parseExpression(), this.semicolon(), this.finishNode(e3, "ThrowStatement");
392
+ return this.next(), m.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e3.argument = this.parseExpression(), this.semicolon(), this.finishNode(e3, "ThrowStatement");
393
393
  };
394
394
  var V2 = [];
395
395
  L2.parseCatchClauseParam = function() {
@@ -774,7 +774,7 @@ function requireJiti() {
774
774
  return this.context[this.context.length - 1];
775
775
  }, B2.braceIsBlock = function(e3) {
776
776
  var t3 = this.curContext();
777
- return t3 === F2.f_expr || t3 === F2.f_stat || (e3 !== f.colon || t3 !== F2.b_stat && t3 !== F2.b_expr ? e3 === f._return || e3 === f.name && this.exprAllowed ? m2.test(this.input.slice(this.lastTokEnd, this.start)) : e3 === f._else || e3 === f.semi || e3 === f.eof || e3 === f.parenR || e3 === f.arrow || (e3 === f.braceL ? t3 === F2.b_stat : e3 !== f._var && e3 !== f._const && e3 !== f.name && !this.exprAllowed) : !t3.isExpr);
777
+ return t3 === F2.f_expr || t3 === F2.f_stat || (e3 !== f.colon || t3 !== F2.b_stat && t3 !== F2.b_expr ? e3 === f._return || e3 === f.name && this.exprAllowed ? m.test(this.input.slice(this.lastTokEnd, this.start)) : e3 === f._else || e3 === f.semi || e3 === f.eof || e3 === f.parenR || e3 === f.arrow || (e3 === f.braceL ? t3 === F2.b_stat : e3 !== f._var && e3 !== f._const && e3 !== f.name && !this.exprAllowed) : !t3.isExpr);
778
778
  }, B2.inGeneratorContext = function() {
779
779
  for (var e3 = this.context.length - 1; e3 >= 1; e3--) {
780
780
  var t3 = this.context[e3];
@@ -800,7 +800,7 @@ function requireJiti() {
800
800
  this.context.push(t3 ? F2.p_stat : F2.p_expr), this.exprAllowed = true;
801
801
  }, f.incDec.updateContext = function() {
802
802
  }, f._function.updateContext = f._class.updateContext = function(e3) {
803
- !e3.beforeExpr || e3 === f._else || e3 === f.semi && this.curContext() !== F2.p_stat || e3 === f._return && m2.test(this.input.slice(this.lastTokEnd, this.start)) || (e3 === f.colon || e3 === f.braceL) && this.curContext() === F2.b_stat ? this.context.push(F2.f_stat) : this.context.push(F2.f_expr), this.exprAllowed = false;
803
+ !e3.beforeExpr || e3 === f._else || e3 === f.semi && this.curContext() !== F2.p_stat || e3 === f._return && m.test(this.input.slice(this.lastTokEnd, this.start)) || (e3 === f.colon || e3 === f.braceL) && this.curContext() === F2.b_stat ? this.context.push(F2.f_stat) : this.context.push(F2.f_expr), this.exprAllowed = false;
804
804
  }, f.colon.updateContext = function() {
805
805
  "function" === this.curContext().token && this.context.pop(), this.exprAllowed = true;
806
806
  }, f.backQuote.updateContext = function() {
@@ -936,13 +936,13 @@ function requireJiti() {
936
936
  var p2 = this.startNodeAt(t3, i2);
937
937
  p2.object = e3, c2 ? (p2.property = this.parseExpression(), this.expect(f.bracketR)) : this.type === f.privateId && "Super" !== e3.type ? p2.property = this.parsePrivateIdent() : p2.property = this.parseIdent("never" !== this.options.allowReserved), p2.computed = !!c2, o2 && (p2.optional = h3), e3 = this.finishNode(p2, "MemberExpression");
938
938
  } else if (!s2 && this.eat(f.parenL)) {
939
- var l2 = new acorn_DestructuringErrors(), u2 = this.yieldPos, d3 = this.awaitPos, m3 = this.awaitIdentPos;
939
+ var l2 = new acorn_DestructuringErrors(), u2 = this.yieldPos, d3 = this.awaitPos, m2 = this.awaitIdentPos;
940
940
  this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
941
- var g3 = this.parseExprList(f.parenR, this.options.ecmaVersion >= 8, false, l2);
942
- if (r2 && !h3 && this.shouldParseAsyncArrow()) return this.checkPatternErrors(l2, false), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = u2, this.awaitPos = d3, this.awaitIdentPos = m3, this.parseSubscriptAsyncArrow(t3, i2, g3, a2);
943
- this.checkExpressionErrors(l2, true), this.yieldPos = u2 || this.yieldPos, this.awaitPos = d3 || this.awaitPos, this.awaitIdentPos = m3 || this.awaitIdentPos;
941
+ var g2 = this.parseExprList(f.parenR, this.options.ecmaVersion >= 8, false, l2);
942
+ if (r2 && !h3 && this.shouldParseAsyncArrow()) return this.checkPatternErrors(l2, false), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = u2, this.awaitPos = d3, this.awaitIdentPos = m2, this.parseSubscriptAsyncArrow(t3, i2, g2, a2);
943
+ this.checkExpressionErrors(l2, true), this.yieldPos = u2 || this.yieldPos, this.awaitPos = d3 || this.awaitPos, this.awaitIdentPos = m2 || this.awaitIdentPos;
944
944
  var x3 = this.startNodeAt(t3, i2);
945
- x3.callee = e3, x3.arguments = g3, o2 && (x3.optional = h3), e3 = this.finishNode(x3, "CallExpression");
945
+ x3.callee = e3, x3.arguments = g2, o2 && (x3.optional = h3), e3 = this.finishNode(x3, "CallExpression");
946
946
  } else if (this.type === f.backQuote) {
947
947
  (h3 || n2) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
948
948
  var v3 = this.startNodeAt(t3, i2);
@@ -1029,7 +1029,7 @@ function requireJiti() {
1029
1029
  var i2, s2 = this.start, r2 = this.startLoc, n2 = this.options.ecmaVersion >= 8;
1030
1030
  if (this.options.ecmaVersion >= 6) {
1031
1031
  this.next();
1032
- var a2, o2 = this.start, h3 = this.startLoc, c2 = [], p2 = true, l2 = false, u2 = new acorn_DestructuringErrors(), d3 = this.yieldPos, m3 = this.awaitPos;
1032
+ var a2, o2 = this.start, h3 = this.startLoc, c2 = [], p2 = true, l2 = false, u2 = new acorn_DestructuringErrors(), d3 = this.yieldPos, m2 = this.awaitPos;
1033
1033
  for (this.yieldPos = 0, this.awaitPos = 0; this.type !== f.parenR; ) {
1034
1034
  if (p2 ? p2 = false : this.expect(f.comma), n2 && this.afterTrailingComma(f.parenR, true)) {
1035
1035
  l2 = true;
@@ -1041,9 +1041,9 @@ function requireJiti() {
1041
1041
  }
1042
1042
  c2.push(this.parseMaybeAssign(false, u2, this.parseParenItem));
1043
1043
  }
1044
- var g3 = this.lastTokEnd, x3 = this.lastTokEndLoc;
1045
- if (this.expect(f.parenR), e3 && this.shouldParseArrow(c2) && this.eat(f.arrow)) return this.checkPatternErrors(u2, false), this.checkYieldAwaitInDefaultParams(), this.yieldPos = d3, this.awaitPos = m3, this.parseParenArrowList(s2, r2, c2, t3);
1046
- c2.length && !l2 || this.unexpected(this.lastTokStart), a2 && this.unexpected(a2), this.checkExpressionErrors(u2, true), this.yieldPos = d3 || this.yieldPos, this.awaitPos = m3 || this.awaitPos, c2.length > 1 ? ((i2 = this.startNodeAt(o2, h3)).expressions = c2, this.finishNodeAt(i2, "SequenceExpression", g3, x3)) : i2 = c2[0];
1044
+ var g2 = this.lastTokEnd, x3 = this.lastTokEndLoc;
1045
+ if (this.expect(f.parenR), e3 && this.shouldParseArrow(c2) && this.eat(f.arrow)) return this.checkPatternErrors(u2, false), this.checkYieldAwaitInDefaultParams(), this.yieldPos = d3, this.awaitPos = m2, this.parseParenArrowList(s2, r2, c2, t3);
1046
+ c2.length && !l2 || this.unexpected(this.lastTokStart), a2 && this.unexpected(a2), this.checkExpressionErrors(u2, true), this.yieldPos = d3 || this.yieldPos, this.awaitPos = m2 || this.awaitPos, c2.length > 1 ? ((i2 = this.startNodeAt(o2, h3)).expressions = c2, this.finishNodeAt(i2, "SequenceExpression", g2, x3)) : i2 = c2[0];
1047
1047
  } else i2 = this.parseParenExpression();
1048
1048
  if (this.options.preserveParens) {
1049
1049
  var v3 = this.startNodeAt(s2, r2);
@@ -1080,7 +1080,7 @@ function requireJiti() {
1080
1080
  for (i2.quasis = [s2]; !s2.tail; ) this.type === f.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(f.dollarBraceL), i2.expressions.push(this.parseExpression()), this.expect(f.braceR), i2.quasis.push(s2 = this.parseTemplateElement({ isTagged: t3 }));
1081
1081
  return this.next(), this.finishNode(i2, "TemplateLiteral");
1082
1082
  }, $2.isAsyncProp = function(e3) {
1083
- return !e3.computed && "Identifier" === e3.key.type && "async" === e3.key.name && (this.type === f.name || this.type === f.num || this.type === f.string || this.type === f.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === f.star) && !m2.test(this.input.slice(this.lastTokEnd, this.start));
1083
+ return !e3.computed && "Identifier" === e3.key.type && "async" === e3.key.name && (this.type === f.name || this.type === f.num || this.type === f.string || this.type === f.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === f.star) && !m.test(this.input.slice(this.lastTokEnd, this.start));
1084
1084
  }, $2.parseObj = function(e3, t3) {
1085
1085
  var i2 = this.startNode(), s2 = true, r2 = {};
1086
1086
  for (i2.properties = [], this.next(); !this.eat(f.braceR); ) {
@@ -1813,7 +1813,7 @@ function requireJiti() {
1813
1813
  return 61 === this.input.charCodeAt(this.pos + 1) ? this.finishOp(f.assign, 2) : this.finishOp(f.bitwiseXOR, 1);
1814
1814
  }, ce2.readToken_plus_min = function(e3) {
1815
1815
  var t3 = this.input.charCodeAt(this.pos + 1);
1816
- return t3 === e3 ? 45 !== t3 || this.inModule || 62 !== this.input.charCodeAt(this.pos + 2) || 0 !== this.lastTokEnd && !m2.test(this.input.slice(this.lastTokEnd, this.pos)) ? this.finishOp(f.incDec, 2) : (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : 61 === t3 ? this.finishOp(f.assign, 2) : this.finishOp(f.plusMin, 1);
1816
+ return t3 === e3 ? 45 !== t3 || this.inModule || 62 !== this.input.charCodeAt(this.pos + 2) || 0 !== this.lastTokEnd && !m.test(this.input.slice(this.lastTokEnd, this.pos)) ? this.finishOp(f.incDec, 2) : (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : 61 === t3 ? this.finishOp(f.assign, 2) : this.finishOp(f.plusMin, 1);
1817
1817
  }, ce2.readToken_lt_gt = function(e3) {
1818
1818
  var t3 = this.input.charCodeAt(this.pos + 1), i2 = 1;
1819
1819
  return t3 === e3 ? (i2 = 62 === e3 && 62 === this.input.charCodeAt(this.pos + 2) ? 3 : 2, 61 === this.input.charCodeAt(this.pos + i2) ? this.finishOp(f.assign, i2 + 1) : this.finishOp(f.bitShift, i2)) : 33 !== t3 || 60 !== e3 || this.inModule || 45 !== this.input.charCodeAt(this.pos + 2) || 45 !== this.input.charCodeAt(this.pos + 3) ? (61 === t3 && (i2 = 2), this.finishOp(f.relational, i2)) : (this.skipLineComment(4), this.skipSpace(), this.nextToken());
@@ -1919,7 +1919,7 @@ function requireJiti() {
1919
1919
  for (var e3, t3, i2 = this.pos; ; ) {
1920
1920
  this.pos >= this.input.length && this.raise(i2, "Unterminated regular expression");
1921
1921
  var s2 = this.input.charAt(this.pos);
1922
- if (m2.test(s2) && this.raise(i2, "Unterminated regular expression"), e3) e3 = false;
1922
+ if (m.test(s2) && this.raise(i2, "Unterminated regular expression"), e3) e3 = false;
1923
1923
  else {
1924
1924
  if ("[" === s2) t3 = true;
1925
1925
  else if ("]" === s2 && t3) t3 = false;
@@ -2093,7 +2093,7 @@ function requireJiti() {
2093
2093
  var e3 = this.readWord1(), t3 = f.name;
2094
2094
  return this.keywords.test(e3) && (t3 = d2[e3]), this.finishToken(t3, e3);
2095
2095
  };
2096
- acorn_Parser.acorn = { Parser: acorn_Parser, version: "8.15.0", defaultOptions: I2, Position: acorn_Position, SourceLocation: acorn_SourceLocation, getLineInfo, Node: acorn_Node, TokenType: acorn_TokenType, tokTypes: f, keywordTypes: d2, TokContext: acorn_TokContext, tokContexts: F2, isIdentifierChar, isIdentifierStart, Token: acorn_Token, isNewLine, lineBreak: m2, lineBreakG: g2, nonASCIIwhitespace: x2 };
2096
+ acorn_Parser.acorn = { Parser: acorn_Parser, version: "8.15.0", defaultOptions: I2, Position: acorn_Position, SourceLocation: acorn_SourceLocation, getLineInfo, Node: acorn_Node, TokenType: acorn_TokenType, tokTypes: f, keywordTypes: d2, TokContext: acorn_TokContext, tokContexts: F2, isIdentifierChar, isIdentifierStart, Token: acorn_Token, isNewLine, lineBreak: m, lineBreakG: g, nonASCIIwhitespace: x2 };
2097
2097
  const le2 = require$$1, ue2 = require$$2;
2098
2098
  const fe2 = /^\.?\//;
2099
2099
  function withTrailingSlash(e3 = "", t3) {
@@ -2114,7 +2114,7 @@ function requireJiti() {
2114
2114
  function pathe_M_eThtNZ_normalizeWindowsPath(e3 = "") {
2115
2115
  return e3 ? e3.replace(/\\/g, "/").replace(me2, (e4) => e4.toUpperCase()) : e3;
2116
2116
  }
2117
- const ge2 = /^[/\\]{2}/, xe = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, ve2 = /^[A-Za-z]:$/, ye2 = /.(\.[^./]+|\.)$/, pathe_M_eThtNZ_normalize = function(e3) {
2117
+ const ge2 = /^[/\\]{2}/, xe2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, ve2 = /^[A-Za-z]:$/, ye2 = /.(\.[^./]+|\.)$/, pathe_M_eThtNZ_normalize = function(e3) {
2118
2118
  if (0 === e3.length) return ".";
2119
2119
  const t3 = (e3 = pathe_M_eThtNZ_normalizeWindowsPath(e3)).match(ge2), i2 = isAbsolute(e3), s2 = "/" === e3[e3.length - 1];
2120
2120
  return 0 === (e3 = normalizeString(e3, !i2)).length ? i2 ? "/" : s2 ? "./" : "." : (s2 && (e3 += "/"), ve2.test(e3) && (e3 += "/"), t3 ? i2 ? `//${e3}` : `//./${e3}` : i2 && !isAbsolute(e3) ? `/${e3}` : e3);
@@ -2167,7 +2167,7 @@ function requireJiti() {
2167
2167
  return i2;
2168
2168
  }
2169
2169
  const isAbsolute = function(e3) {
2170
- return xe.test(e3);
2170
+ return xe2.test(e3);
2171
2171
  }, extname = function(e3) {
2172
2172
  if (".." === e3) return "";
2173
2173
  const t3 = ye2.exec(pathe_M_eThtNZ_normalizeWindowsPath(e3));
@@ -2186,11 +2186,11 @@ function requireJiti() {
2186
2186
  }
2187
2187
  }
2188
2188
  return s2;
2189
- }, _e2 = require$$3, Ee2 = require$$4, be2 = require$$5, Se2 = path, ke = require$$7, we2 = require$$8, Ie = new Set(le2.builtinModules);
2189
+ }, _e2 = require$$3, Ee2 = require$$4, be2 = require$$5, Se2 = path, ke2 = require$$7, we2 = require$$8, Ie2 = new Set(le2.builtinModules);
2190
2190
  function normalizeSlash(e3) {
2191
2191
  return e3.replace(/\\/g, "/");
2192
2192
  }
2193
- const Ce2 = {}.hasOwnProperty, Re2 = /^([A-Z][a-z\d]*)+$/, Pe = /* @__PURE__ */ new Set(["string", "function", "number", "object", "Function", "Object", "boolean", "bigint", "symbol"]), Te2 = {};
2193
+ const Ce2 = {}.hasOwnProperty, Re2 = /^([A-Z][a-z\d]*)+$/, Pe2 = /* @__PURE__ */ new Set(["string", "function", "number", "object", "Function", "Object", "boolean", "bigint", "symbol"]), Te2 = {};
2194
2194
  function formatList(e3, t3 = "and") {
2195
2195
  return e3.length < 3 ? e3.join(` ${t3} `) : `${e3.slice(0, -1).join(", ")}, ${t3} ${e3[e3.length - 1]}`;
2196
2196
  }
@@ -2220,7 +2220,7 @@ function requireJiti() {
2220
2220
  }
2221
2221
  function isErrorStackTraceLimitWritable() {
2222
2222
  try {
2223
- if (ke.startupSnapshot.isBuildingSnapshot()) return false;
2223
+ if (ke2.startupSnapshot.isBuildingSnapshot()) return false;
2224
2224
  } catch {
2225
2225
  }
2226
2226
  const e3 = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
@@ -2236,7 +2236,7 @@ function requireJiti() {
2236
2236
  }
2237
2237
  s2 += "must be ";
2238
2238
  const r2 = [], n2 = [], a2 = [];
2239
- for (const e4 of t3) Ee2("string" == typeof e4, "All expected entries have to be of type string"), Pe.has(e4) ? r2.push(e4.toLowerCase()) : null === Re2.exec(e4) ? (Ee2("object" !== e4, 'The value "object" should be written as "Object"'), a2.push(e4)) : n2.push(e4);
2239
+ for (const e4 of t3) Ee2("string" == typeof e4, "All expected entries have to be of type string"), Pe2.has(e4) ? r2.push(e4.toLowerCase()) : null === Re2.exec(e4) ? (Ee2("object" !== e4, 'The value "object" should be written as "Object"'), a2.push(e4)) : n2.push(e4);
2240
2240
  if (n2.length > 0) {
2241
2241
  const e4 = r2.indexOf("object");
2242
2242
  -1 !== e4 && (r2.slice(e4, 1), n2.push("Object"));
@@ -2264,9 +2264,9 @@ function requireJiti() {
2264
2264
  const t3 = isErrorStackTraceLimitWritable();
2265
2265
  return t3 && (Ne2 = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(e3), t3 && (Error.stackTraceLimit = Ne2), e3;
2266
2266
  });
2267
- const Oe2 = {}.hasOwnProperty, { ERR_INVALID_PACKAGE_CONFIG: De } = Te2, Ve = /* @__PURE__ */ new Map();
2267
+ const Oe2 = {}.hasOwnProperty, { ERR_INVALID_PACKAGE_CONFIG: De2 } = Te2, Ve2 = /* @__PURE__ */ new Map();
2268
2268
  function read(e3, { base: t3, specifier: i2 }) {
2269
- const s2 = Ve.get(e3);
2269
+ const s2 = Ve2.get(e3);
2270
2270
  if (s2) return s2;
2271
2271
  let r2;
2272
2272
  try {
@@ -2281,12 +2281,12 @@ function requireJiti() {
2281
2281
  try {
2282
2282
  s3 = JSON.parse(r2);
2283
2283
  } catch (s4) {
2284
- const r3 = s4, n3 = new De(e3, (t3 ? `"${i2}" from ` : "") + (0, _e2.fileURLToPath)(t3 || i2), r3.message);
2284
+ const r3 = s4, n3 = new De2(e3, (t3 ? `"${i2}" from ` : "") + (0, _e2.fileURLToPath)(t3 || i2), r3.message);
2285
2285
  throw n3.cause = r3, n3;
2286
2286
  }
2287
2287
  n2.exists = true, Oe2.call(s3, "name") && "string" == typeof s3.name && (n2.name = s3.name), Oe2.call(s3, "main") && "string" == typeof s3.main && (n2.main = s3.main), Oe2.call(s3, "exports") && (n2.exports = s3.exports), Oe2.call(s3, "imports") && (n2.imports = s3.imports), !Oe2.call(s3, "type") || "commonjs" !== s3.type && "module" !== s3.type || (n2.type = s3.type);
2288
2288
  }
2289
- return Ve.set(e3, n2), n2;
2289
+ return Ve2.set(e3, n2), n2;
2290
2290
  }
2291
2291
  function getPackageScopeConfig(e3) {
2292
2292
  let t3 = new URL("package.json", e3);
@@ -2303,7 +2303,7 @@ function requireJiti() {
2303
2303
  return getPackageScopeConfig(e3).type;
2304
2304
  }
2305
2305
  const { ERR_UNKNOWN_FILE_EXTENSION: Ue } = Te2, Me = {}.hasOwnProperty, je2 = { __proto__: null, ".cjs": "commonjs", ".js": "module", ".json": "json", ".mjs": "module" };
2306
- const Fe = { __proto__: null, "data:": function(e3) {
2306
+ const Fe2 = { __proto__: null, "data:": function(e3) {
2307
2307
  const { 1: t3 } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e3.pathname) || [null, null, null];
2308
2308
  return (function(e4) {
2309
2309
  return e4 && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e4) ? "module" : "application/json" === e4 ? "json" : null;
@@ -2345,7 +2345,7 @@ function requireJiti() {
2345
2345
  if (be2.noDeprecation) return;
2346
2346
  const r2 = (function(e4, t4) {
2347
2347
  const i3 = e4.protocol;
2348
- return Me.call(Fe, i3) && Fe[i3](e4, t4, true) || null;
2348
+ return Me.call(Fe2, i3) && Fe2[i3](e4, t4, true) || null;
2349
2349
  })(e3, { parentURL: i2.href });
2350
2350
  if ("module" !== r2) return;
2351
2351
  const n2 = (0, _e2.fileURLToPath)(e3.href), a2 = (0, _e2.fileURLToPath)(new _e2.URL(".", t3)), o2 = (0, _e2.fileURLToPath)(i2);
@@ -2643,14 +2643,14 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
2643
2643
  e3 = fileURLToPath(e3);
2644
2644
  }
2645
2645
  if (/(?:node|data|http|https):/.test(e3)) return e3;
2646
- if (Ie.has(e3)) return "node:" + e3;
2646
+ if (Ie2.has(e3)) return "node:" + e3;
2647
2647
  if (e3.startsWith("file://") && (e3 = fileURLToPath(e3)), isAbsolute(e3)) try {
2648
2648
  if ((0, ue2.statSync)(e3).isFile()) return pathToFileURL(e3);
2649
2649
  } catch (e4) {
2650
2650
  if ("ENOENT" !== e4?.code) throw e4;
2651
2651
  }
2652
2652
  const i2 = t3.conditions ? new Set(t3.conditions) : rt, s2 = (Array.isArray(t3.url) ? t3.url : [t3.url]).filter(Boolean).map((e4) => new URL((function(e5) {
2653
- return "string" != typeof e5 && (e5 = e5.toString()), /(?:node|data|http|https|file):/.test(e5) ? e5 : Ie.has(e5) ? "node:" + e5 : "file://" + encodeURI(normalizeSlash(e5));
2653
+ return "string" != typeof e5 && (e5 = e5.toString()), /(?:node|data|http|https|file):/.test(e5) ? e5 : Ie2.has(e5) ? "node:" + e5 : "file://" + encodeURI(normalizeSlash(e5));
2654
2654
  })(e4.toString())));
2655
2655
  0 === s2.length && s2.push(new URL(pathToFileURL(process.cwd())));
2656
2656
  const r2 = [...s2];
@@ -2963,21 +2963,21 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
2963
2963
  const d3 = createJiti2(r2, e3.opts, { parentModule: u2, parentCache: a2, nativeImport: e3.nativeImport, onError: e3.onError, createRequire: e3.createRequire }, true);
2964
2964
  let f2;
2965
2965
  u2.require = d3, u2.path = pathe_M_eThtNZ_dirname(r2), u2.paths = le2.Module._nodeModulePaths(u2.path), a2[r2] = u2, e3.opts.moduleCache && (e3.nativeRequire.cache[r2] = u2);
2966
- const m3 = (function(e4, t4) {
2966
+ const m2 = (function(e4, t4) {
2967
2967
  return `(${t4?.async ? "async " : ""}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e4}
2968
2968
  });`;
2969
2969
  })(t3, { async: i2.async });
2970
2970
  try {
2971
- f2 = Kt().runInThisContext(m3, { filename: r2, lineOffset: 0, displayErrors: false });
2971
+ f2 = Kt().runInThisContext(m2, { filename: r2, lineOffset: 0, displayErrors: false });
2972
2972
  } catch (t4) {
2973
2973
  "SyntaxError" === t4.name && i2.async && e3.nativeImport ? (debug(e3, "[esm]", "[import]", "[fallback]", r2), f2 = (function(e4, t5) {
2974
2974
  const i3 = `data:text/javascript;base64,${Buffer.from(`export default ${e4}`).toString("base64")}`;
2975
2975
  return (...e5) => t5(i3).then((t6) => t6.default(...e5));
2976
- })(m3, e3.nativeImport)) : (e3.opts.moduleCache && delete e3.nativeRequire.cache[r2], e3.onError(t4));
2976
+ })(m2, e3.nativeImport)) : (e3.opts.moduleCache && delete e3.nativeRequire.cache[r2], e3.onError(t4));
2977
2977
  }
2978
- let g3;
2978
+ let g2;
2979
2979
  try {
2980
- g3 = f2(u2.exports, u2.require, u2, u2.filename, pathe_M_eThtNZ_dirname(u2.filename), d3.import, d3.esmResolve);
2980
+ g2 = f2(u2.exports, u2.require, u2, u2.filename, pathe_M_eThtNZ_dirname(u2.filename), d3.import, d3.esmResolve);
2981
2981
  } catch (t4) {
2982
2982
  e3.opts.moduleCache && delete e3.nativeRequire.cache[r2], e3.onError(t4);
2983
2983
  }
@@ -2990,7 +2990,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
2990
2990
  u2.loaded = true;
2991
2991
  return jitiInteropDefault(e3, u2.exports);
2992
2992
  }
2993
- return i2.async ? Promise.resolve(g3).then(next) : next();
2993
+ return i2.async ? Promise.resolve(g2).then(next) : next();
2994
2994
  }
2995
2995
  const Jt = "win32" === (0, e2.platform)();
2996
2996
  function createJiti2(e3, t3 = {}, i2, s2 = false) {
@@ -3044,193 +3044,193 @@ function createJiti(id, opts = {}) {
3044
3044
  createRequire
3045
3045
  });
3046
3046
  }
3047
- const F$1 = ["charset", "import", "namespace"], L$1 = ["layer"], D = ({ name: e }) => `[data-theme="${e}"]`, x$1 = ({
3047
+ const P$1 = ["charset", "import", "namespace"], U = ["layer"], k = ({ name: e }) => `[data-theme="${e}"]`, M = ({
3048
3048
  name: e,
3049
3049
  value: t,
3050
3050
  modifiers: r
3051
- }) => `._${[...r, e, ...t === "default" ? [] : [t]].filter(Boolean).join("\\:").replace(/[[\].#()%,]/g, "\\$&")}`, w = ({ name: e }) => e.replace(/^\.+|\.+$/g, "").replace(/\.+/g, "--");
3052
- function I$1(e, t) {
3051
+ }) => `._${[...r, e, ...t === "default" ? [] : [t]].filter(Boolean).join("\\:").replace(/[[\].#()%,]/g, "\\$&")}`, O = ({ name: e }) => e.replace(/^\.+|\.+$/g, "").replace(/\.+/g, "--");
3052
+ function V$1(e, t) {
3053
3053
  return `@${e}${t ? " " : ""}${t}`;
3054
3054
  }
3055
- const U$1 = /\d/, P$1 = ["-", "_", "/", "."];
3056
- function M(e = "") {
3057
- if (!U$1.test(e))
3055
+ const K$1 = /\d/, q = ["-", "_", "/", "."];
3056
+ function z$1(e = "") {
3057
+ if (!K$1.test(e))
3058
3058
  return e !== e.toLowerCase();
3059
3059
  }
3060
- function N(e, t) {
3061
- const r = P$1, n = [];
3060
+ function _$1(e, t) {
3061
+ const r = q, o = [];
3062
3062
  if (!e || typeof e != "string")
3063
- return n;
3064
- let o = "", s, u;
3063
+ return o;
3064
+ let n = "", s, u;
3065
3065
  for (const a of e) {
3066
3066
  const c = r.includes(a);
3067
3067
  if (c === true) {
3068
- n.push(o), o = "", s = void 0;
3068
+ o.push(n), n = "", s = void 0;
3069
3069
  continue;
3070
3070
  }
3071
- const i = M(a);
3071
+ const i = z$1(a);
3072
3072
  if (u === false) {
3073
3073
  if (s === false && i === true) {
3074
- n.push(o), o = a, s = i;
3074
+ o.push(n), n = a, s = i;
3075
3075
  continue;
3076
3076
  }
3077
- if (s === true && i === false && o.length > 1) {
3078
- const f = o.at(-1);
3079
- n.push(o.slice(0, Math.max(0, o.length - 1))), o = f + a, s = i;
3077
+ if (s === true && i === false && n.length > 1) {
3078
+ const f = n.at(-1);
3079
+ o.push(n.slice(0, Math.max(0, n.length - 1))), n = f + a, s = i;
3080
3080
  continue;
3081
3081
  }
3082
3082
  }
3083
- o += a, s = i, u = c;
3083
+ n += a, s = i, u = c;
3084
3084
  }
3085
- return n.push(o), n;
3085
+ return o.push(n), o;
3086
3086
  }
3087
- function k$1(e) {
3087
+ function H(e) {
3088
3088
  return e ? e[0].toUpperCase() + e.slice(1) : "";
3089
3089
  }
3090
- function V(e) {
3090
+ function Q$1(e) {
3091
3091
  return e ? e[0].toLowerCase() + e.slice(1) : "";
3092
3092
  }
3093
- function K$1(e, t) {
3094
- return e ? (Array.isArray(e) ? e : N(e)).map((r) => k$1(r)).join("") : "";
3093
+ function J$1(e, t) {
3094
+ return e ? (Array.isArray(e) ? e : _$1(e)).map((r) => H(r)).join("") : "";
3095
3095
  }
3096
- function q$1(e, t) {
3097
- return V(K$1(e || ""));
3096
+ function Z$1(e, t) {
3097
+ return Q$1(J$1(e || ""));
3098
3098
  }
3099
- function z$1(e, t) {
3100
- return e ? (Array.isArray(e) ? e : N(e)).map((r) => r.toLowerCase()).join("-") : "";
3099
+ function W(e, t) {
3100
+ return e ? (Array.isArray(e) ? e : _$1(e)).map((r) => r.toLowerCase()).join("-") : "";
3101
3101
  }
3102
- function H(e) {
3102
+ function G$1(e) {
3103
3103
  return ` ${e}`;
3104
3104
  }
3105
- function Q$1(e) {
3105
+ function Y$1(e) {
3106
3106
  return e.split(`
3107
- `).map((t) => H(t)).join(`
3107
+ `).map((t) => G$1(t)).join(`
3108
3108
  `);
3109
3109
  }
3110
- function J$1(e) {
3110
+ function x$1(e) {
3111
3111
  return e === e.toUpperCase();
3112
3112
  }
3113
- function Z$1(e) {
3114
- return q$1(e);
3113
+ function T$1(e) {
3114
+ return Z$1(e);
3115
3115
  }
3116
- function W$1(e) {
3117
- return z$1(e);
3116
+ function X$1(e) {
3117
+ return W(e);
3118
3118
  }
3119
- function G$1(e) {
3120
- return W$1(e);
3119
+ function ee$1(e) {
3120
+ return X$1(e);
3121
3121
  }
3122
- function O(e, t) {
3123
- return `${e.startsWith("--") ? e : G$1(e)}: ${t};`;
3122
+ function B(e, t) {
3123
+ return `${e.startsWith("--") ? e : ee$1(e)}: ${t};`;
3124
3124
  }
3125
- function Y$1(e) {
3125
+ function te$1(e) {
3126
3126
  return `{${e.length > 0 ? `
3127
- ` : ""}${e.map((t) => `${Q$1(`${t}`)}
3127
+ ` : ""}${e.map((t) => `${Y$1(`${t}`)}
3128
3128
  `).join("")}}`;
3129
3129
  }
3130
- function B(e) {
3130
+ function E$1(e) {
3131
3131
  return `--${(e.startsWith("--") ? e.slice(2) : e).replace(/[^a-zA-Z0-9_\-\u0080-\uFFFF]/g, "-") || "unknown-variable"}`;
3132
3132
  }
3133
- function X$1(e, t) {
3134
- return O(B(e), t);
3133
+ function re$1(e, t) {
3134
+ return B(E$1(e), t);
3135
3135
  }
3136
- function ee$1(e, t) {
3137
- return `var(${B(e)}${t ? `, ${t}` : ""})`;
3136
+ function ne$1(e, t) {
3137
+ return `var(${E$1(e)}${t ? `, ${t}` : ""})`;
3138
3138
  }
3139
- function R$1(e, t) {
3140
- return `${e} ${Y$1(t)}`;
3139
+ function w(e, t) {
3140
+ return `${e} ${te$1(t)}`;
3141
3141
  }
3142
- function te$1(e) {
3143
- return function(r, n) {
3144
- return Object.entries(r).map(([o, s]) => O(o, e(s, n)));
3142
+ function oe(e) {
3143
+ return function(r, o) {
3144
+ return Object.entries(r).map(([n, s]) => B(n, e(s, o)));
3145
3145
  };
3146
3146
  }
3147
- function E$1(e) {
3148
- return function(r, n) {
3149
- const s = (n.variables?.name ?? w)({ name: r.name });
3150
- return X$1(s, e(r.value, n));
3147
+ function F$1(e) {
3148
+ return function(r, o) {
3149
+ const s = (o.variables?.name ?? O)({ name: r.name });
3150
+ return re$1(s, e(r.value, o));
3151
3151
  };
3152
3152
  }
3153
3153
  function S$1(e) {
3154
- const t = E$1(e), r = te$1(e);
3155
- return function(o, s, u) {
3156
- const { variables: a, declarations: c, children: i } = s, f = o === ":root", l = (a ?? []).map(
3157
- (A2) => t(A2, u)
3158
- ), m2 = r(
3154
+ const t = F$1(e), r = oe(e);
3155
+ return function(n, s, u) {
3156
+ const { variables: a, declarations: c, children: i } = s, f = n === ":root", l = (a ?? []).map(
3157
+ (g) => t(g, u)
3158
+ ), m = r(
3159
3159
  c ?? {},
3160
3160
  u
3161
3161
  ), y = (i ?? []).map(
3162
- (A2) => e(A2, u)
3163
- ), p = l.length > 0, b = m2.length > 0, C2 = y.length > 0;
3164
- return f ? `${p || b ? R$1(o, [
3162
+ (g) => e(g, u)
3163
+ ), p = l.length > 0, b = m.length > 0, j2 = y.length > 0;
3164
+ return f ? `${p || b ? w(n, [
3165
3165
  ...l,
3166
3166
  ...p && b ? [""] : [],
3167
- ...m2
3168
- ]) : ""}${C2 && (p || b) ? `
3167
+ ...m
3168
+ ]) : ""}${j2 && (p || b) ? `
3169
3169
 
3170
3170
  ` : ""}${y.join(`
3171
3171
 
3172
- `)}` : R$1(o, [
3172
+ `)}` : w(n, [
3173
3173
  ...l,
3174
- ...p && (C2 || b) ? [""] : [],
3175
- ...m2,
3176
- ...b && C2 ? [""] : [],
3174
+ ...p && (j2 || b) ? [""] : [],
3175
+ ...m,
3176
+ ...b && j2 ? [""] : [],
3177
3177
  ...y.flatMap(
3178
- (A2, _) => _ === y.length - 1 ? [A2] : [A2, ""]
3178
+ (g, I2) => I2 === y.length - 1 ? [g] : [g, ""]
3179
3179
  )
3180
3180
  ]);
3181
3181
  };
3182
3182
  }
3183
- function re$1(e) {
3183
+ function ce(e) {
3184
3184
  const t = S$1(e);
3185
- return function(n, o) {
3186
- const s = F$1.includes(n.identifier), u = L$1.includes(
3187
- n.identifier
3188
- ), a = Object.keys(n.declarations).length > 0, c = n.variables.length > 0, i = n.children.length > 0, f = I$1(n.identifier, n.rule);
3189
- return s || u && !(a || c || i) ? `${f};` : t(f, n, o);
3185
+ return function(o, n) {
3186
+ const s = P$1.includes(o.identifier), u = U.includes(
3187
+ o.identifier
3188
+ ), a = Object.keys(o.declarations).length > 0, c = o.variables.length > 0, i = o.children.length > 0, f = V$1(o.identifier, o.rule);
3189
+ return s || u && !(a || c || i) ? `${f};` : t(f, o, n);
3190
3190
  };
3191
3191
  }
3192
- function ne$1(e) {
3193
- return function(r, n) {
3194
- return r.value.map((o) => e(o, n)).join("").trim();
3192
+ function ue$1(e) {
3193
+ return function(r, o) {
3194
+ return r.value.map((n) => e(n, o)).join("").trim();
3195
3195
  };
3196
3196
  }
3197
- function oe(e) {
3197
+ function se$1(e) {
3198
3198
  return typeof e == "object" && e !== null;
3199
3199
  }
3200
- function h(e, t) {
3201
- return oe(e) && "type" in e && e.type === t;
3200
+ function h$1(e, t) {
3201
+ return se$1(e) && "type" in e && e.type === t;
3202
3202
  }
3203
- function ce$1(e) {
3204
- return h(e, "variable");
3203
+ function ie$1(e) {
3204
+ return h$1(e, "variable");
3205
3205
  }
3206
- function ue$1(e) {
3207
- return h(e, "reference");
3206
+ function ae$1(e) {
3207
+ return h$1(e, "reference");
3208
3208
  }
3209
- function v$1(e) {
3210
- return h(e, "selector");
3209
+ function C$1(e) {
3210
+ return h$1(e, "selector");
3211
3211
  }
3212
- function ie(e) {
3213
- return h(e, "at-rule");
3212
+ function le$1(e) {
3213
+ return h$1(e, "at-rule");
3214
3214
  }
3215
- function se(e) {
3216
- return h(e, "utility");
3215
+ function fe(e) {
3216
+ return h$1(e, "utility");
3217
3217
  }
3218
- function ae$1(e) {
3219
- return h(e, "css");
3218
+ function me$1(e) {
3219
+ return h$1(e, "css");
3220
3220
  }
3221
- function le$1(e) {
3222
- return h(e, "theme");
3221
+ function pe$1(e) {
3222
+ return h$1(e, "theme");
3223
3223
  }
3224
- function T$1(e) {
3225
- return h(e, "root");
3224
+ function N(e) {
3225
+ return h$1(e, "root");
3226
3226
  }
3227
- function fe$1(e) {
3228
- return h(e, "recipe");
3227
+ function D$1(e) {
3228
+ return h$1(e, "recipe");
3229
3229
  }
3230
- function me$1(e) {
3230
+ function L$1(e) {
3231
3231
  return e.charAt(0).toUpperCase() + e.slice(1);
3232
3232
  }
3233
- function g(e) {
3233
+ function A$1(e) {
3234
3234
  if (e instanceof Buffer)
3235
3235
  return Buffer.from(e);
3236
3236
  const t = e.constructor;
@@ -3240,78 +3240,78 @@ function g(e) {
3240
3240
  e.byteLength / e.BYTES_PER_ELEMENT || 1
3241
3241
  );
3242
3242
  }
3243
- function pe$1(e) {
3243
+ function ye$1(e) {
3244
3244
  if (e = e || {}, e.circular)
3245
- return ye$1(e);
3245
+ return de$1(e);
3246
3246
  const t = /* @__PURE__ */ new Map();
3247
3247
  if (t.set(Date, (u) => new Date(u)), t.set(
3248
3248
  Map,
3249
- (u, a) => new Map(n(Array.from(u), a))
3249
+ (u, a) => new Map(o(Array.from(u), a))
3250
3250
  ), t.set(
3251
3251
  Set,
3252
- (u, a) => new Set(n(Array.from(u), a))
3252
+ (u, a) => new Set(o(Array.from(u), a))
3253
3253
  ), e.constructorHandlers)
3254
3254
  for (const u of e.constructorHandlers)
3255
3255
  t.set(u[0], u[1]);
3256
3256
  let r;
3257
- return e.proto ? s : o;
3258
- function n(u, a) {
3257
+ return e.proto ? s : n;
3258
+ function o(u, a) {
3259
3259
  const c = Object.keys(u), i = Array.from({ length: c.length });
3260
3260
  for (let f = 0; f < c.length; f++) {
3261
- const l = c[f], m2 = u[l];
3262
- typeof m2 != "object" || m2 === null ? i[l] = m2 : m2.constructor !== Object && (r = t.get(m2.constructor)) ? i[l] = r(m2, a) : ArrayBuffer.isView(m2) ? i[l] = g(m2) : i[l] = a(m2);
3261
+ const l = c[f], m = u[l];
3262
+ typeof m != "object" || m === null ? i[l] = m : m.constructor !== Object && (r = t.get(m.constructor)) ? i[l] = r(m, a) : ArrayBuffer.isView(m) ? i[l] = A$1(m) : i[l] = a(m);
3263
3263
  }
3264
3264
  return i;
3265
3265
  }
3266
- function o(u) {
3266
+ function n(u) {
3267
3267
  if (typeof u != "object" || u === null) return u;
3268
- if (Array.isArray(u)) return n(u, o);
3268
+ if (Array.isArray(u)) return o(u, n);
3269
3269
  if (u.constructor !== Object && (r = t.get(u.constructor)))
3270
- return r(u, o);
3270
+ return r(u, n);
3271
3271
  const a = {};
3272
3272
  for (const c in u) {
3273
3273
  if (Object.hasOwnProperty.call(u, c) === false) continue;
3274
3274
  const i = u[c];
3275
- typeof i != "object" || i === null ? a[c] = i : i.constructor !== Object && (r = t.get(i.constructor)) ? a[c] = r(i, o) : ArrayBuffer.isView(i) ? a[c] = g(i) : a[c] = o(i);
3275
+ typeof i != "object" || i === null ? a[c] = i : i.constructor !== Object && (r = t.get(i.constructor)) ? a[c] = r(i, n) : ArrayBuffer.isView(i) ? a[c] = A$1(i) : a[c] = n(i);
3276
3276
  }
3277
3277
  return a;
3278
3278
  }
3279
3279
  function s(u) {
3280
3280
  if (typeof u != "object" || u === null) return u;
3281
- if (Array.isArray(u)) return n(u, s);
3281
+ if (Array.isArray(u)) return o(u, s);
3282
3282
  if (u.constructor !== Object && (r = t.get(u.constructor)))
3283
3283
  return r(u, s);
3284
3284
  const a = {};
3285
3285
  for (const c in u) {
3286
3286
  const i = u[c];
3287
- typeof i != "object" || i === null ? a[c] = i : i.constructor !== Object && (r = t.get(i.constructor)) ? a[c] = r(i, s) : ArrayBuffer.isView(i) ? a[c] = g(i) : a[c] = s(i);
3287
+ typeof i != "object" || i === null ? a[c] = i : i.constructor !== Object && (r = t.get(i.constructor)) ? a[c] = r(i, s) : ArrayBuffer.isView(i) ? a[c] = A$1(i) : a[c] = s(i);
3288
3288
  }
3289
3289
  return a;
3290
3290
  }
3291
3291
  }
3292
- function ye$1(e) {
3293
- const t = [], r = [], n = /* @__PURE__ */ new Map();
3294
- if (n.set(Date, (c) => new Date(c)), n.set(
3292
+ function de$1(e) {
3293
+ const t = [], r = [], o = /* @__PURE__ */ new Map();
3294
+ if (o.set(Date, (c) => new Date(c)), o.set(
3295
3295
  Map,
3296
3296
  (c, i) => new Map(s(Array.from(c), i))
3297
- ), n.set(
3297
+ ), o.set(
3298
3298
  Set,
3299
3299
  (c, i) => new Set(s(Array.from(c), i))
3300
3300
  ), e.constructorHandlers)
3301
3301
  for (const c of e.constructorHandlers)
3302
- n.set(c[0], c[1]);
3303
- let o;
3302
+ o.set(c[0], c[1]);
3303
+ let n;
3304
3304
  return e.proto ? a : u;
3305
3305
  function s(c, i) {
3306
3306
  const f = Object.keys(c), l = Array.from({ length: f.length });
3307
- for (let m2 = 0; m2 < f.length; m2++) {
3308
- const y = f[m2], p = c[y];
3307
+ for (let m = 0; m < f.length; m++) {
3308
+ const y = f[m], p = c[y];
3309
3309
  if (typeof p != "object" || p === null)
3310
3310
  l[y] = p;
3311
- else if (p.constructor !== Object && (o = n.get(p.constructor)))
3312
- l[y] = o(p, i);
3311
+ else if (p.constructor !== Object && (n = o.get(p.constructor)))
3312
+ l[y] = n(p, i);
3313
3313
  else if (ArrayBuffer.isView(p))
3314
- l[y] = g(p);
3314
+ l[y] = A$1(p);
3315
3315
  else {
3316
3316
  const b = t.indexOf(p);
3317
3317
  b !== -1 ? l[y] = r[b] : l[y] = i(p);
@@ -3322,8 +3322,8 @@ function ye$1(e) {
3322
3322
  function u(c) {
3323
3323
  if (typeof c != "object" || c === null) return c;
3324
3324
  if (Array.isArray(c)) return s(c, u);
3325
- if (c.constructor !== Object && (o = n.get(c.constructor)))
3326
- return o(c, u);
3325
+ if (c.constructor !== Object && (n = o.get(c.constructor)))
3326
+ return n(c, u);
3327
3327
  const i = {};
3328
3328
  t.push(c), r.push(i);
3329
3329
  for (const f in c) {
@@ -3331,13 +3331,13 @@ function ye$1(e) {
3331
3331
  const l = c[f];
3332
3332
  if (typeof l != "object" || l === null)
3333
3333
  i[f] = l;
3334
- else if (l.constructor !== Object && (o = n.get(l.constructor)))
3335
- i[f] = o(l, u);
3334
+ else if (l.constructor !== Object && (n = o.get(l.constructor)))
3335
+ i[f] = n(l, u);
3336
3336
  else if (ArrayBuffer.isView(l))
3337
- i[f] = g(l);
3337
+ i[f] = A$1(l);
3338
3338
  else {
3339
- const m2 = t.indexOf(l);
3340
- m2 !== -1 ? i[f] = r[m2] : i[f] = u(l);
3339
+ const m = t.indexOf(l);
3340
+ m !== -1 ? i[f] = r[m] : i[f] = u(l);
3341
3341
  }
3342
3342
  }
3343
3343
  return t.pop(), r.pop(), i;
@@ -3345,47 +3345,47 @@ function ye$1(e) {
3345
3345
  function a(c) {
3346
3346
  if (typeof c != "object" || c === null) return c;
3347
3347
  if (Array.isArray(c)) return s(c, a);
3348
- if (c.constructor !== Object && (o = n.get(c.constructor)))
3349
- return o(c, a);
3348
+ if (c.constructor !== Object && (n = o.get(c.constructor)))
3349
+ return n(c, a);
3350
3350
  const i = {};
3351
3351
  t.push(c), r.push(i);
3352
3352
  for (const f in c) {
3353
3353
  const l = c[f];
3354
3354
  if (typeof l != "object" || l === null)
3355
3355
  i[f] = l;
3356
- else if (l.constructor !== Object && (o = n.get(l.constructor)))
3357
- i[f] = o(l, a);
3356
+ else if (l.constructor !== Object && (n = o.get(l.constructor)))
3357
+ i[f] = n(l, a);
3358
3358
  else if (ArrayBuffer.isView(l))
3359
- i[f] = g(l);
3359
+ i[f] = A$1(l);
3360
3360
  else {
3361
- const m2 = t.indexOf(l);
3362
- m2 !== -1 ? i[f] = r[m2] : i[f] = a(l);
3361
+ const m = t.indexOf(l);
3362
+ m !== -1 ? i[f] = r[m] : i[f] = a(l);
3363
3363
  }
3364
3364
  }
3365
3365
  return t.pop(), r.pop(), i;
3366
3366
  }
3367
3367
  }
3368
- pe$1();
3369
- function de$1(e) {
3370
- return function(r, n) {
3368
+ ye$1();
3369
+ function he$1(e) {
3370
+ return function(r, o) {
3371
3371
  return r != null ? `${r}` : "";
3372
3372
  };
3373
3373
  }
3374
- function he(e) {
3375
- return function(r, n) {
3376
- const s = (n.variables?.name ?? w)({ name: r.name });
3377
- return ee$1(
3374
+ function be$1(e) {
3375
+ return function(r, o) {
3376
+ const s = (o.variables?.name ?? O)({ name: r.name });
3377
+ return ne$1(
3378
3378
  s,
3379
- r.fallback ? e(r.fallback, n) : void 0
3379
+ r.fallback ? e(r.fallback, o) : void 0
3380
3380
  );
3381
3381
  };
3382
3382
  }
3383
- function be(e) {
3383
+ function ge$1(e) {
3384
3384
  const t = S$1(e);
3385
- return function(n, o) {
3386
- return n.themes.reduce(
3387
- (s, u) => (s.push(e(u, o)), s),
3388
- [t(":root", n, o)]
3385
+ return function(o, n) {
3386
+ return o.themes.reduce(
3387
+ (s, u) => (s.push(e(u, n)), s),
3388
+ [t(":root", o, n)]
3389
3389
  // Default theme (root)
3390
3390
  ).join(`
3391
3391
 
@@ -3394,108 +3394,108 @@ function be(e) {
3394
3394
  }
3395
3395
  function Ae$1(e) {
3396
3396
  const t = S$1(e);
3397
- return function(n, o) {
3398
- return t(n.query, n, o);
3397
+ return function(o, n) {
3398
+ return t(o.query, o, n);
3399
3399
  };
3400
3400
  }
3401
- function ge$1(e) {
3401
+ function Se(e) {
3402
3402
  const t = S$1(e);
3403
- return function(n, o) {
3404
- const u = (o.themes?.selector ?? D)({ name: n.name });
3405
- return t(u, n, o);
3403
+ return function(o, n) {
3404
+ const u = (n.themes?.selector ?? k)({ name: o.name });
3405
+ return t(u, o, n);
3406
3406
  };
3407
3407
  }
3408
- function Se(e) {
3408
+ function Ce(e) {
3409
3409
  const t = S$1(e);
3410
- return function(n, o) {
3411
- const s = [], a = (o.utilities?.selector ?? x$1)({
3412
- name: n.name,
3413
- value: n.value,
3414
- modifiers: n.modifiers
3410
+ return function(o, n) {
3411
+ const s = [], a = (n.utilities?.selector ?? M)({
3412
+ name: o.name,
3413
+ value: o.value,
3414
+ modifiers: o.modifiers
3415
3415
  });
3416
- return s.push(t(a, n, o)), s.join(`
3416
+ return s.push(t(a, o, n)), s.join(`
3417
3417
 
3418
3418
  `);
3419
3419
  };
3420
3420
  }
3421
3421
  function d(e, t) {
3422
- const r = be(d), n = Ae$1(d), o = Se(d), s = re$1(d), u = ge$1(d), a = E$1(d), c = he(d), i = ne$1(d), f = de$1();
3422
+ const r = ge$1(d), o = Ae$1(d), n = Ce(d), s = ce(d), u = Se(d), a = F$1(d), c = be$1(d), i = ue$1(d), f = he$1();
3423
3423
  switch (true) {
3424
- case v$1(e):
3425
- return n(e, t);
3426
- case se(e):
3424
+ case C$1(e):
3427
3425
  return o(e, t);
3428
- case ie(e):
3426
+ case fe(e):
3427
+ return n(e, t);
3428
+ case le$1(e):
3429
3429
  return s(e, t);
3430
- case T$1(e):
3430
+ case N(e):
3431
3431
  return r(e, t);
3432
- case le$1(e):
3432
+ case pe$1(e):
3433
3433
  return u(e, t);
3434
- case ce$1(e):
3434
+ case ie$1(e):
3435
3435
  return a(e, t);
3436
- case ue$1(e):
3437
- return c(e, t);
3438
3436
  case ae$1(e):
3437
+ return c(e, t);
3438
+ case me$1(e):
3439
3439
  return i(e, t);
3440
3440
  default:
3441
3441
  return f(e, t);
3442
3442
  }
3443
3443
  }
3444
- function Ce(e) {
3445
- return function(r, n) {
3446
- let o = r._exportName;
3447
- o || (o = Z$1(r.name), r.name[0] && J$1(r.name[0]) && (o = me$1(o)));
3448
- const s = `${o}Recipe`, u = r._runtime ?? {};
3444
+ function je(e) {
3445
+ return function(r, o) {
3446
+ let n = r._exportName;
3447
+ n || (n = T$1(r.name), r.name[0] && x$1(r.name[0]) && (n = L$1(n)));
3448
+ const s = `${n}Recipe`, u = r._runtime ?? {};
3449
3449
  return `const ${s} = ${JSON.stringify(
3450
3450
  u,
3451
3451
  null,
3452
3452
  4
3453
3453
  )} as const satisfies RecipeRuntime;
3454
3454
 
3455
- export const ${o} = createRecipe("${r.name}", ${s});
3455
+ export const ${n} = createRecipe("${r.name}", ${s});
3456
3456
  `;
3457
3457
  };
3458
3458
  }
3459
- function je(e) {
3459
+ function ve(e) {
3460
3460
  return e.filter(
3461
- (t) => v$1(t) && !!t._exportName
3461
+ (t) => C$1(t) && !!t._exportName
3462
3462
  );
3463
3463
  }
3464
- function ve(e) {
3465
- return function(r, n) {
3466
- const o = je(r.children), s = r.recipes.length > 0, u = o.length > 0;
3464
+ function Re(e) {
3465
+ return function(r, o) {
3466
+ const n = ve(r.children), s = r.recipes.length > 0, u = n.length > 0;
3467
3467
  if (!s && !u)
3468
3468
  return "";
3469
3469
  const a = [];
3470
3470
  return s && (a.push(`import { createRecipe } from '@styleframe/runtime';
3471
3471
  import type { RecipeRuntime } from '@styleframe/runtime';
3472
- `), a.push(e(r.recipes, n))), u && a.push(e(o, n)), a.join(`
3472
+ `), a.push(e(r.recipes, o))), u && a.push(e(n, o)), a.join(`
3473
3473
  `);
3474
3474
  };
3475
3475
  }
3476
- function Re$1(e) {
3477
- return function(r, n) {
3476
+ function $e(e) {
3477
+ return function(r, o) {
3478
3478
  return r._exportName ? `export const ${r._exportName} = ${JSON.stringify(r.query)};
3479
3479
  ` : "";
3480
3480
  };
3481
3481
  }
3482
- function j$1(e, t) {
3483
- const r = ve(j$1), n = Ce(), o = Re$1();
3482
+ function R$1(e, t) {
3483
+ const r = Re(R$1), o = je(), n = $e();
3484
3484
  switch (true) {
3485
3485
  case Array.isArray(e):
3486
- return e.map((s) => j$1(s, t)).join(`
3486
+ return e.map((s) => R$1(s, t)).join(`
3487
3487
  `);
3488
- case T$1(e):
3488
+ case N(e):
3489
3489
  return r(e, t);
3490
- case fe$1(e):
3491
- return n(e, t);
3492
- case v$1(e):
3490
+ case D$1(e):
3493
3491
  return o(e, t);
3492
+ case C$1(e):
3493
+ return n(e, t);
3494
3494
  default:
3495
3495
  return "";
3496
3496
  }
3497
3497
  }
3498
- const $e = `-----BEGIN PUBLIC KEY-----
3498
+ const Ne = `-----BEGIN PUBLIC KEY-----
3499
3499
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs7zAFssgxOMPeo80iig4
3500
3500
  qSSshgNOLnW1gd4tPUrsezndaUrAKlsAys6XD8kuF+bBEIR0uFNSgKlqINLjWM1n
3501
3501
  BiTUzCctodyRaq6/tyFSoPLD35iblkwtfxKPM42lAJZsyTu9qoBr8MJyXmhDLuqA
@@ -3503,9 +3503,9 @@ dQ8di7mQHz+mCy96jQR4lFSDfHMgl27qaAh5VboTBRxgZliN8D5Fl590QkS94wAj
3503
3503
  hC7NbH+hPcGc/qIaZSjZfyZeBIZS74qJkrzjEA7/pukROD8UQUrQ512HHZ6XlgMn
3504
3504
  4bWT2K9CpWbbhsKFTecCHuxlmPkFJNMuvAb/LdP08BSnpntlyAJcQeBrna2qBen+
3505
3505
  GwIDAQAB
3506
- -----END PUBLIC KEY-----`, we = "__licenseRequired", Ne = "__licenseValidated";
3507
- async function Oe(e) {
3508
- const t = e.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""), r = Uint8Array.from(atob(t), (n) => n.charCodeAt(0));
3506
+ -----END PUBLIC KEY-----`, we = "__licenseRequired", Oe = "__licenseValidated";
3507
+ async function _e(e) {
3508
+ const t = e.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""), r = Uint8Array.from(atob(t), (o) => o.charCodeAt(0));
3509
3509
  return await crypto.subtle.importKey(
3510
3510
  "spki",
3511
3511
  r,
@@ -3517,18 +3517,18 @@ async function Oe(e) {
3517
3517
  ["verify"]
3518
3518
  );
3519
3519
  }
3520
- async function Be({
3520
+ async function xe({
3521
3521
  payload: e,
3522
3522
  signature: t
3523
3523
  }) {
3524
- const r = new TextEncoder().encode(e), n = Uint8Array.from(
3524
+ const r = new TextEncoder().encode(e), o = Uint8Array.from(
3525
3525
  atob(t),
3526
3526
  (s) => s.charCodeAt(0)
3527
- ), o = await Oe($e);
3527
+ ), n = await _e(Ne);
3528
3528
  if (!await crypto.subtle.verify(
3529
3529
  { name: "RSASSA-PKCS1-v1_5" },
3530
- o,
3531
3530
  n,
3531
+ o,
3532
3532
  r
3533
3533
  ))
3534
3534
  throw new Error(
@@ -3536,13 +3536,13 @@ async function Be({
3536
3536
  );
3537
3537
  return JSON.parse(e);
3538
3538
  }
3539
- function Ee(e) {
3539
+ function Te(e) {
3540
3540
  return Object.prototype.hasOwnProperty.call(e, we);
3541
3541
  }
3542
- async function Te(e) {
3542
+ async function Be(e) {
3543
3543
  const t = Object.getOwnPropertyDescriptor(
3544
3544
  e,
3545
- Ne
3545
+ Oe
3546
3546
  );
3547
3547
  if (!t?.value)
3548
3548
  return {
@@ -3560,7 +3560,7 @@ async function Te(e) {
3560
3560
  valid: false
3561
3561
  };
3562
3562
  try {
3563
- return await Be(
3563
+ return await xe(
3564
3564
  r
3565
3565
  );
3566
3566
  } catch {
@@ -3572,7 +3572,81 @@ async function Te(e) {
3572
3572
  };
3573
3573
  }
3574
3574
  }
3575
- function _e(e) {
3575
+ function Ee(e) {
3576
+ const t = e?.variants;
3577
+ if (!t || Object.keys(t).length === 0)
3578
+ return "Record<string, never>";
3579
+ const r = [];
3580
+ for (const [o, n] of Object.entries(t)) {
3581
+ if (!n) continue;
3582
+ const s = Object.keys(n);
3583
+ if (s.length > 0) {
3584
+ const u = s.map((a) => `"${a}"`).join(" | ");
3585
+ r.push(`${o}?: ${u}`);
3586
+ }
3587
+ }
3588
+ return r.length === 0 ? "Record<string, never>" : `{ ${r.join("; ")} }`;
3589
+ }
3590
+ function Fe$1(e) {
3591
+ return function(r, o) {
3592
+ let n = r._exportName;
3593
+ n || (n = T$1(r.name), r.name[0] && x$1(r.name[0]) && (n = L$1(n)));
3594
+ const s = Ee(r._runtime);
3595
+ return ` export const ${n}: (props?: ${s}) => string;`;
3596
+ };
3597
+ }
3598
+ function De(e) {
3599
+ return e.filter(
3600
+ (t) => C$1(t) && !!t._exportName
3601
+ );
3602
+ }
3603
+ function Le(e) {
3604
+ return function(r, o) {
3605
+ const n = De(r.children), s = r.recipes.length > 0, u = n.length > 0, a = [
3606
+ "// Auto-generated by @styleframe/plugin - DO NOT EDIT",
3607
+ "",
3608
+ 'declare module "virtual:styleframe" {',
3609
+ ' import type { Styleframe } from "@styleframe/core";',
3610
+ "",
3611
+ " /** Returns the global styleframe instance from styleframe.config.ts */",
3612
+ " export function styleframe(): Styleframe;"
3613
+ ];
3614
+ if (s) {
3615
+ a.push("");
3616
+ const c = r.recipes.map((i) => e(i, o)).filter(Boolean);
3617
+ a.push(...c);
3618
+ }
3619
+ if (u) {
3620
+ a.push("");
3621
+ const c = n.map((i) => e(i, o)).filter(Boolean);
3622
+ a.push(...c);
3623
+ }
3624
+ return a.push("}"), a.push(""), a.push('declare module "virtual:styleframe.css" {'), a.push(" const css: string;"), a.push(" export default css;"), a.push("}"), a.push(""), a.join(`
3625
+ `);
3626
+ };
3627
+ }
3628
+ function Ie(e) {
3629
+ return function(r, o) {
3630
+ return r._exportName ? ` export const ${r._exportName}: string;` : "";
3631
+ };
3632
+ }
3633
+ function $(e, t) {
3634
+ const r = Le($), o = Fe$1(), n = Ie();
3635
+ switch (true) {
3636
+ case Array.isArray(e):
3637
+ return e.map((s) => $(s, t)).join(`
3638
+ `);
3639
+ case N(e):
3640
+ return r(e, t);
3641
+ case D$1(e):
3642
+ return o(e, t);
3643
+ case C$1(e):
3644
+ return n(e, t);
3645
+ default:
3646
+ return "";
3647
+ }
3648
+ }
3649
+ function Pe(e) {
3576
3650
  const t = Math.floor(Math.random() * 100);
3577
3651
  e.root.children.push({
3578
3652
  type: "selector",
@@ -3596,36 +3670,43 @@ function _e(e) {
3596
3670
  }
3597
3671
  });
3598
3672
  }
3599
- function $(e, t = "") {
3673
+ function v$1(e, t = "") {
3600
3674
  return {
3601
3675
  name: e,
3602
3676
  content: t
3603
3677
  };
3604
3678
  }
3605
- async function Le(e, {
3679
+ async function ke$1(e, {
3606
3680
  type: t = "all",
3607
- consumers: r = { css: d, ts: j$1 }
3681
+ consumers: r = { css: d, ts: R$1, dts: $ }
3608
3682
  } = {}) {
3609
- const n = { files: [] }, o = e.options;
3610
- if (Ee(e)) {
3611
- const s = await Te(e);
3612
- (!s.valid || s.instanceId !== e.id) && _e(e);
3683
+ const o = { files: [] }, n = e.options;
3684
+ if (Te(e)) {
3685
+ const s = await Be(e);
3686
+ (!s.valid || s.instanceId !== e.id) && Pe(e);
3613
3687
  }
3614
3688
  if (t === "all" || t === "css") {
3615
- const s = $(
3689
+ const s = v$1(
3616
3690
  "index.css",
3617
- r.css(e.root, o)
3691
+ r.css(e.root, n)
3618
3692
  );
3619
- n.files.push(s);
3693
+ o.files.push(s);
3620
3694
  }
3621
3695
  if (t === "all" || t === "ts") {
3622
- const s = $(
3696
+ const s = v$1(
3623
3697
  "index.ts",
3624
- r.ts(e.root, o)
3698
+ r.ts(e.root, n)
3625
3699
  );
3626
- n.files.push(s);
3700
+ o.files.push(s);
3627
3701
  }
3628
- return n;
3702
+ if (t === "dts") {
3703
+ const s = v$1(
3704
+ "index.d.ts",
3705
+ r.dts(e.root, n)
3706
+ );
3707
+ o.files.push(s);
3708
+ }
3709
+ return o;
3629
3710
  }
3630
3711
  async function directoryExists(path2) {
3631
3712
  try {
@@ -3641,7 +3722,7 @@ async function build(instance, { clean = true, outputDir = "./styleframe", trans
3641
3722
  environment: process.env.NODE_ENV || "development",
3642
3723
  isBuild: true
3643
3724
  });
3644
- const output = await Le(instance, transpiler);
3725
+ const output = await ke$1(instance, transpiler);
3645
3726
  const outputDirExists = await directoryExists(outputDir);
3646
3727
  if (clean && outputDirExists) {
3647
3728
  await rm(outputDir, { recursive: true });
@@ -3656,90 +3737,109 @@ async function build(instance, { clean = true, outputDir = "./styleframe", trans
3656
3737
  await writeFile(filePath, file.content);
3657
3738
  }
3658
3739
  }
3659
- function K(e) {
3740
+ function C(e) {
3660
3741
  return typeof e == "object" && e !== null;
3661
3742
  }
3662
- function m(e, r) {
3663
- return K(e) && "type" in e && e.type === r;
3743
+ function h(e, r) {
3744
+ return C(e) && "type" in e && e.type === r;
3664
3745
  }
3665
- function L(e) {
3666
- return m(e, "variable");
3746
+ function G(e) {
3747
+ return h(e, "variable");
3667
3748
  }
3668
- function A(e) {
3669
- return m(e, "reference");
3749
+ function j(e) {
3750
+ return h(e, "reference");
3670
3751
  }
3671
- function ge(e) {
3672
- return m(e, "selector");
3752
+ function Ae(e) {
3753
+ return h(e, "selector");
3673
3754
  }
3674
- function q(e) {
3675
- return m(e, "modifier");
3755
+ function I(e) {
3756
+ return h(e, "modifier");
3676
3757
  }
3677
- function E(e) {
3678
- return m(e, "css");
3758
+ function T(e) {
3759
+ return h(e, "css");
3679
3760
  }
3680
- function Ae(e) {
3681
- return m(e, "recipe");
3761
+ function V(e) {
3762
+ return h(e, "root");
3682
3763
  }
3683
- function G(e) {
3764
+ function ke(e) {
3765
+ return h(e, "recipe");
3766
+ }
3767
+ function z(e) {
3684
3768
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
3685
3769
  }
3686
- function U(e) {
3687
- return G(e) || A(e) || E(e) || Array.isArray(e) && e.every(U);
3770
+ function D(e) {
3771
+ return z(e) || j(e) || T(e) || Array.isArray(e) && e.every(D);
3688
3772
  }
3689
- function I(e) {
3690
- return K(e) && "children" in e && "declarations" in e && "variables" in e;
3773
+ function Y(e) {
3774
+ return C(e) && "children" in e && "declarations" in e && "variables" in e;
3775
+ }
3776
+ function Ve(e) {
3777
+ return C(e) && "id" in e && "root" in e && "variable" in e && "selector" in e && "recipe" in e && typeof e.id == "string" && V(e.root);
3691
3778
  }
3692
- function z(e = (r) => r) {
3693
- return (r) => {
3694
- let n = r, t;
3695
- if (typeof n == "string" && n[0] === "@") {
3696
- const i = n.slice(1);
3697
- t = e(i), n = {
3779
+ function P(e) {
3780
+ const r = typeof e == "function" ? { replacer: e } : e ?? {}, { replacer: n = (c) => c, namespace: t } = r, i = Array.isArray(t) ? t : t ? [t] : [];
3781
+ return (c) => {
3782
+ let s = c, a;
3783
+ if (typeof s == "string" && s[0] === "@") {
3784
+ const o = s.slice(1), f = i.find(
3785
+ (y) => o === y || o.startsWith(`${y}.`)
3786
+ );
3787
+ let l, u;
3788
+ f ? (l = o, u = o.startsWith(`${f}.`) ? o.slice(f.length + 1) : o) : i.length > 0 ? (l = `${i[0]}.${o}`, u = o) : (l = o, u = o), a = n(u), s = {
3698
3789
  type: "reference",
3699
- name: i
3790
+ name: l
3700
3791
  };
3701
- } else A(n) ? t = e(n.name) : t = `[${r}]`;
3792
+ } else if (j(s)) {
3793
+ let o = s.name;
3794
+ for (const f of i)
3795
+ if (o.startsWith(`${f}.`)) {
3796
+ o = o.slice(f.length + 1);
3797
+ break;
3798
+ }
3799
+ a = n(o);
3800
+ } else
3801
+ a = `[${c}]`;
3702
3802
  return {
3703
- [t]: n
3803
+ [a]: s
3704
3804
  };
3705
3805
  };
3706
3806
  }
3707
- function W(e, r) {
3807
+ function Z(e, r) {
3708
3808
  return function(t, ...i) {
3709
3809
  return {
3710
3810
  type: "css",
3711
- value: t.reduce((o, u, s) => (o.push(u), s < i.length && o.push(i[s]), o), [])
3811
+ value: t.reduce((s, a, o) => (s.push(a), o < i.length && s.push(i[o]), s), [])
3712
3812
  };
3713
3813
  };
3714
3814
  }
3715
- function S(e, r) {
3815
+ function K(e, r) {
3716
3816
  return function(t, i, c) {
3717
- const o = {
3817
+ const s = {
3718
3818
  type: "at-rule",
3719
3819
  identifier: t,
3720
3820
  rule: i,
3721
3821
  declarations: {},
3722
3822
  variables: [],
3723
3823
  children: []
3724
- }, u = v(o, r);
3725
- return typeof c == "function" ? o.declarations = c(u) ?? {} : c && (o.declarations = c), k(o.declarations, u), e.children.push(o), o;
3824
+ }, a = v(s, r);
3825
+ return typeof c == "function" ? s.declarations = c(a) ?? {} : c && (s.declarations = c), R(s.declarations, a), e.children.push(s), s;
3726
3826
  };
3727
3827
  }
3728
- function Y(e, r) {
3729
- const n = S(e, r);
3828
+ function J(e, r) {
3829
+ const n = K(e, r);
3730
3830
  return function(i, c) {
3731
3831
  return n("media", i, c);
3732
3832
  };
3733
3833
  }
3734
- function Z(e, r) {
3735
- const n = S(e, r);
3834
+ function Q(e, r) {
3835
+ const n = K(e, r);
3736
3836
  return function(i, c) {
3737
3837
  return n("keyframes", i, c);
3738
3838
  };
3739
3839
  }
3740
- function J(e, r) {
3840
+ function X(e, r) {
3741
3841
  return function(t, i) {
3742
- return L(t) ? {
3842
+ return G(t) ? {
3743
3843
  type: "reference",
3744
3844
  name: t.name,
3745
3845
  fallback: i
@@ -3750,7 +3850,7 @@ function J(e, r) {
3750
3850
  };
3751
3851
  };
3752
3852
  }
3753
- function Q(e, r) {
3853
+ function ee(e, r) {
3754
3854
  return function(t, i) {
3755
3855
  const c = {
3756
3856
  type: "selector",
@@ -3758,56 +3858,60 @@ function Q(e, r) {
3758
3858
  declarations: {},
3759
3859
  variables: [],
3760
3860
  children: []
3761
- }, o = v(c, r);
3762
- return typeof i == "function" ? c.declarations = i(o) ?? {} : I(i) ? (c.variables = i.variables, c.declarations = i.declarations, c.children = i.children) : c.declarations = i, k(c.declarations, o), e.children.push(c), c;
3861
+ }, s = v(c, r);
3862
+ return typeof i == "function" ? c.declarations = i(s) ?? {} : Y(i) ? (c.variables = i.variables, c.declarations = i.declarations, c.children = i.children) : c.declarations = i, R(c.declarations, s), e.children.push(c), c;
3763
3863
  };
3764
3864
  }
3765
- function X(e, r) {
3865
+ function te(e, r) {
3766
3866
  return function(t, i, c = {
3767
3867
  default: false
3768
3868
  }) {
3769
- const o = typeof t == "string" ? t : t.name, u = e.variables.find(
3770
- (f) => f.name === o
3869
+ const s = typeof t == "string" ? t : t.name, a = e.variables.find(
3870
+ (f) => f.name === s
3771
3871
  );
3772
- if (c.default && u)
3773
- return u;
3774
- if (u)
3775
- return u.value = i, u;
3776
- const s = {
3872
+ if (c.default && a)
3873
+ return a;
3874
+ if (a)
3875
+ return a.value = i, a;
3876
+ const o = {
3777
3877
  type: "variable",
3778
- name: o,
3878
+ name: s,
3779
3879
  value: i
3780
3880
  };
3781
- return e.variables.push(s), s;
3881
+ return e.variables.push(o), o;
3782
3882
  };
3783
3883
  }
3784
3884
  function v(e, r) {
3785
- const n = X(e), t = Q(e, r), i = S(e, r), c = Z(r, r), o = Y(e, r), u = J(), s = W();
3885
+ const n = te(e), t = ee(e, r), i = K(e, r), c = Q(r, r), s = J(e, r), a = X(), o = Z();
3786
3886
  return {
3787
3887
  variable: n,
3788
3888
  selector: t,
3789
3889
  keyframes: c,
3790
3890
  atRule: i,
3791
- media: o,
3792
- ref: u,
3793
- css: s
3891
+ media: s,
3892
+ ref: a,
3893
+ css: o
3794
3894
  };
3795
3895
  }
3796
- function k(e, r) {
3896
+ function R(e, r) {
3797
3897
  for (const n in e)
3798
3898
  if (n.startsWith("@")) {
3799
3899
  const t = e[n];
3800
- if (typeof t == "object" && t !== null && !U(t)) {
3900
+ if (typeof t == "object" && t !== null && !D(t)) {
3801
3901
  const i = n.replace(/^@(\w+).*/, "$1"), c = n.replace(`@${i}`, "").trim();
3802
3902
  r.atRule(i, c, t), delete e[n];
3803
3903
  }
3804
- } else if (/^[.&:]/.test(n)) {
3904
+ } else if (/^[.&:]/.test(n) || /^\d+%$/.test(n) || n === "from" || n === "to") {
3805
3905
  const t = e[n];
3806
3906
  typeof t == "object" && (r.selector(n, t), delete e[n]);
3807
3907
  }
3908
+ for (const n in e) {
3909
+ const t = e[n];
3910
+ typeof t == "string" && t[0] === "@" && (e[n] = r.ref(t.slice(1)));
3911
+ }
3808
3912
  return e;
3809
3913
  }
3810
- function j(e) {
3914
+ function A(e) {
3811
3915
  if (e instanceof Buffer)
3812
3916
  return Buffer.from(e);
3813
3917
  const r = e.constructor;
@@ -3817,133 +3921,133 @@ function j(e) {
3817
3921
  e.byteLength / e.BYTES_PER_ELEMENT || 1
3818
3922
  );
3819
3923
  }
3820
- function ee(e) {
3924
+ function ne(e) {
3821
3925
  if (e = e || {}, e.circular)
3822
- return te(e);
3926
+ return re(e);
3823
3927
  const r = /* @__PURE__ */ new Map();
3824
- if (r.set(Date, (o) => new Date(o)), r.set(
3928
+ if (r.set(Date, (s) => new Date(s)), r.set(
3825
3929
  Map,
3826
- (o, u) => new Map(t(Array.from(o), u))
3930
+ (s, a) => new Map(t(Array.from(s), a))
3827
3931
  ), r.set(
3828
3932
  Set,
3829
- (o, u) => new Set(t(Array.from(o), u))
3933
+ (s, a) => new Set(t(Array.from(s), a))
3830
3934
  ), e.constructorHandlers)
3831
- for (const o of e.constructorHandlers)
3832
- r.set(o[0], o[1]);
3935
+ for (const s of e.constructorHandlers)
3936
+ r.set(s[0], s[1]);
3833
3937
  let n;
3834
3938
  return e.proto ? c : i;
3835
- function t(o, u) {
3836
- const s = Object.keys(o), f = Array.from({ length: s.length });
3837
- for (let l = 0; l < s.length; l++) {
3838
- const a = s[l], y = o[a];
3839
- typeof y != "object" || y === null ? f[a] = y : y.constructor !== Object && (n = r.get(y.constructor)) ? f[a] = n(y, u) : ArrayBuffer.isView(y) ? f[a] = j(y) : f[a] = u(y);
3939
+ function t(s, a) {
3940
+ const o = Object.keys(s), f = Array.from({ length: o.length });
3941
+ for (let l = 0; l < o.length; l++) {
3942
+ const u = o[l], y = s[u];
3943
+ typeof y != "object" || y === null ? f[u] = y : y.constructor !== Object && (n = r.get(y.constructor)) ? f[u] = n(y, a) : ArrayBuffer.isView(y) ? f[u] = A(y) : f[u] = a(y);
3840
3944
  }
3841
3945
  return f;
3842
3946
  }
3843
- function i(o) {
3844
- if (typeof o != "object" || o === null) return o;
3845
- if (Array.isArray(o)) return t(o, i);
3846
- if (o.constructor !== Object && (n = r.get(o.constructor)))
3847
- return n(o, i);
3848
- const u = {};
3849
- for (const s in o) {
3850
- if (Object.hasOwnProperty.call(o, s) === false) continue;
3851
- const f = o[s];
3852
- typeof f != "object" || f === null ? u[s] = f : f.constructor !== Object && (n = r.get(f.constructor)) ? u[s] = n(f, i) : ArrayBuffer.isView(f) ? u[s] = j(f) : u[s] = i(f);
3947
+ function i(s) {
3948
+ if (typeof s != "object" || s === null) return s;
3949
+ if (Array.isArray(s)) return t(s, i);
3950
+ if (s.constructor !== Object && (n = r.get(s.constructor)))
3951
+ return n(s, i);
3952
+ const a = {};
3953
+ for (const o in s) {
3954
+ if (Object.hasOwnProperty.call(s, o) === false) continue;
3955
+ const f = s[o];
3956
+ typeof f != "object" || f === null ? a[o] = f : f.constructor !== Object && (n = r.get(f.constructor)) ? a[o] = n(f, i) : ArrayBuffer.isView(f) ? a[o] = A(f) : a[o] = i(f);
3853
3957
  }
3854
- return u;
3958
+ return a;
3855
3959
  }
3856
- function c(o) {
3857
- if (typeof o != "object" || o === null) return o;
3858
- if (Array.isArray(o)) return t(o, c);
3859
- if (o.constructor !== Object && (n = r.get(o.constructor)))
3860
- return n(o, c);
3861
- const u = {};
3862
- for (const s in o) {
3863
- const f = o[s];
3864
- typeof f != "object" || f === null ? u[s] = f : f.constructor !== Object && (n = r.get(f.constructor)) ? u[s] = n(f, c) : ArrayBuffer.isView(f) ? u[s] = j(f) : u[s] = c(f);
3960
+ function c(s) {
3961
+ if (typeof s != "object" || s === null) return s;
3962
+ if (Array.isArray(s)) return t(s, c);
3963
+ if (s.constructor !== Object && (n = r.get(s.constructor)))
3964
+ return n(s, c);
3965
+ const a = {};
3966
+ for (const o in s) {
3967
+ const f = s[o];
3968
+ typeof f != "object" || f === null ? a[o] = f : f.constructor !== Object && (n = r.get(f.constructor)) ? a[o] = n(f, c) : ArrayBuffer.isView(f) ? a[o] = A(f) : a[o] = c(f);
3865
3969
  }
3866
- return u;
3970
+ return a;
3867
3971
  }
3868
3972
  }
3869
- function te(e) {
3973
+ function re(e) {
3870
3974
  const r = [], n = [], t = /* @__PURE__ */ new Map();
3871
- if (t.set(Date, (s) => new Date(s)), t.set(
3975
+ if (t.set(Date, (o) => new Date(o)), t.set(
3872
3976
  Map,
3873
- (s, f) => new Map(c(Array.from(s), f))
3977
+ (o, f) => new Map(c(Array.from(o), f))
3874
3978
  ), t.set(
3875
3979
  Set,
3876
- (s, f) => new Set(c(Array.from(s), f))
3980
+ (o, f) => new Set(c(Array.from(o), f))
3877
3981
  ), e.constructorHandlers)
3878
- for (const s of e.constructorHandlers)
3879
- t.set(s[0], s[1]);
3982
+ for (const o of e.constructorHandlers)
3983
+ t.set(o[0], o[1]);
3880
3984
  let i;
3881
- return e.proto ? u : o;
3882
- function c(s, f) {
3883
- const l = Object.keys(s), a = Array.from({ length: l.length });
3985
+ return e.proto ? a : s;
3986
+ function c(o, f) {
3987
+ const l = Object.keys(o), u = Array.from({ length: l.length });
3884
3988
  for (let y = 0; y < l.length; y++) {
3885
- const p = l[y], d2 = s[p];
3989
+ const p = l[y], d2 = o[p];
3886
3990
  if (typeof d2 != "object" || d2 === null)
3887
- a[p] = d2;
3991
+ u[p] = d2;
3888
3992
  else if (d2.constructor !== Object && (i = t.get(d2.constructor)))
3889
- a[p] = i(d2, f);
3993
+ u[p] = i(d2, f);
3890
3994
  else if (ArrayBuffer.isView(d2))
3891
- a[p] = j(d2);
3995
+ u[p] = A(d2);
3892
3996
  else {
3893
- const h2 = r.indexOf(d2);
3894
- h2 !== -1 ? a[p] = n[h2] : a[p] = f(d2);
3997
+ const w2 = r.indexOf(d2);
3998
+ w2 !== -1 ? u[p] = n[w2] : u[p] = f(d2);
3895
3999
  }
3896
4000
  }
3897
- return a;
4001
+ return u;
3898
4002
  }
3899
- function o(s) {
3900
- if (typeof s != "object" || s === null) return s;
3901
- if (Array.isArray(s)) return c(s, o);
3902
- if (s.constructor !== Object && (i = t.get(s.constructor)))
3903
- return i(s, o);
4003
+ function s(o) {
4004
+ if (typeof o != "object" || o === null) return o;
4005
+ if (Array.isArray(o)) return c(o, s);
4006
+ if (o.constructor !== Object && (i = t.get(o.constructor)))
4007
+ return i(o, s);
3904
4008
  const f = {};
3905
- r.push(s), n.push(f);
3906
- for (const l in s) {
3907
- if (Object.hasOwnProperty.call(s, l) === false) continue;
3908
- const a = s[l];
3909
- if (typeof a != "object" || a === null)
3910
- f[l] = a;
3911
- else if (a.constructor !== Object && (i = t.get(a.constructor)))
3912
- f[l] = i(a, o);
3913
- else if (ArrayBuffer.isView(a))
3914
- f[l] = j(a);
4009
+ r.push(o), n.push(f);
4010
+ for (const l in o) {
4011
+ if (Object.hasOwnProperty.call(o, l) === false) continue;
4012
+ const u = o[l];
4013
+ if (typeof u != "object" || u === null)
4014
+ f[l] = u;
4015
+ else if (u.constructor !== Object && (i = t.get(u.constructor)))
4016
+ f[l] = i(u, s);
4017
+ else if (ArrayBuffer.isView(u))
4018
+ f[l] = A(u);
3915
4019
  else {
3916
- const y = r.indexOf(a);
3917
- y !== -1 ? f[l] = n[y] : f[l] = o(a);
4020
+ const y = r.indexOf(u);
4021
+ y !== -1 ? f[l] = n[y] : f[l] = s(u);
3918
4022
  }
3919
4023
  }
3920
4024
  return r.pop(), n.pop(), f;
3921
4025
  }
3922
- function u(s) {
3923
- if (typeof s != "object" || s === null) return s;
3924
- if (Array.isArray(s)) return c(s, u);
3925
- if (s.constructor !== Object && (i = t.get(s.constructor)))
3926
- return i(s, u);
4026
+ function a(o) {
4027
+ if (typeof o != "object" || o === null) return o;
4028
+ if (Array.isArray(o)) return c(o, a);
4029
+ if (o.constructor !== Object && (i = t.get(o.constructor)))
4030
+ return i(o, a);
3927
4031
  const f = {};
3928
- r.push(s), n.push(f);
3929
- for (const l in s) {
3930
- const a = s[l];
3931
- if (typeof a != "object" || a === null)
3932
- f[l] = a;
3933
- else if (a.constructor !== Object && (i = t.get(a.constructor)))
3934
- f[l] = i(a, u);
3935
- else if (ArrayBuffer.isView(a))
3936
- f[l] = j(a);
4032
+ r.push(o), n.push(f);
4033
+ for (const l in o) {
4034
+ const u = o[l];
4035
+ if (typeof u != "object" || u === null)
4036
+ f[l] = u;
4037
+ else if (u.constructor !== Object && (i = t.get(u.constructor)))
4038
+ f[l] = i(u, a);
4039
+ else if (ArrayBuffer.isView(u))
4040
+ f[l] = A(u);
3937
4041
  else {
3938
- const y = r.indexOf(a);
3939
- y !== -1 ? f[l] = n[y] : f[l] = u(a);
4042
+ const y = r.indexOf(u);
4043
+ y !== -1 ? f[l] = n[y] : f[l] = a(u);
3940
4044
  }
3941
4045
  }
3942
4046
  return r.pop(), n.pop(), f;
3943
4047
  }
3944
4048
  }
3945
- const R = ee();
3946
- function ne(e, r = 8) {
4049
+ const F = ne();
4050
+ function ie(e, r = 8) {
3947
4051
  const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
3948
4052
  let t = "";
3949
4053
  for (let i = 0; i < r; i++) {
@@ -3952,7 +4056,7 @@ function ne(e, r = 8) {
3952
4056
  }
3953
4057
  return e ? `${e}${t}` : t;
3954
4058
  }
3955
- function re(e, r) {
4059
+ function se(e, r) {
3956
4060
  const n = e.modifiers.find(
3957
4061
  (t) => t.key.includes(r)
3958
4062
  );
@@ -3960,23 +4064,23 @@ function re(e, r) {
3960
4064
  throw new Error(`Modifier "${r}" not found`);
3961
4065
  return n;
3962
4066
  }
3963
- function ce(e) {
4067
+ function ae(e) {
3964
4068
  const r = [];
3965
4069
  function n(t, i) {
3966
4070
  i.length > 0 && r.push([...i].sort());
3967
4071
  for (let c = t; c < e.length; c++) {
3968
- const o = e[c];
3969
- if (o)
3970
- if (o.length === 1 && o[0])
3971
- n(c + 1, [...i, o[0]]);
4072
+ const s = e[c];
4073
+ if (s)
4074
+ if (s.length === 1 && s[0])
4075
+ n(c + 1, [...i, s[0]]);
3972
4076
  else
3973
- for (const u of o)
3974
- n(c + 1, [...i, u]);
4077
+ for (const a of s)
4078
+ n(c + 1, [...i, a]);
3975
4079
  }
3976
4080
  }
3977
4081
  return n(0, []), r.sort((t, i) => t.length !== i.length ? t.length - i.length : t.join(",").localeCompare(i.join(",")));
3978
4082
  }
3979
- function fe(e, r, n) {
4083
+ function ue(e, r, n) {
3980
4084
  const t = {
3981
4085
  ...e,
3982
4086
  modifiers: [...n.keys()]
@@ -3984,13 +4088,13 @@ function fe(e, r, n) {
3984
4088
  for (const c of n.values())
3985
4089
  c.factory({
3986
4090
  ...i,
3987
- declarations: R(t.declarations),
3988
- variables: R(t.variables),
3989
- children: R(t.children)
3990
- }), k(t.declarations, i);
4091
+ declarations: F(t.declarations),
4092
+ variables: F(t.variables),
4093
+ children: F(t.children)
4094
+ }), R(t.declarations, i);
3991
4095
  return t;
3992
4096
  }
3993
- function ue(e, r) {
4097
+ function le(e, r) {
3994
4098
  return function(t, i) {
3995
4099
  const c = {
3996
4100
  type: "modifier",
@@ -4000,7 +4104,7 @@ function ue(e, r) {
4000
4104
  return r.modifiers.push(c), c;
4001
4105
  };
4002
4106
  }
4003
- function ae() {
4107
+ function ye() {
4004
4108
  return {
4005
4109
  type: "root",
4006
4110
  declarations: {},
@@ -4012,30 +4116,84 @@ function ae() {
4012
4116
  themes: []
4013
4117
  };
4014
4118
  }
4015
- function le(e, r) {
4119
+ function de(e, r) {
4120
+ const n = P({ namespace: e });
4121
+ return (t) => {
4122
+ if (typeof t == "string" && t[0] === "@") {
4123
+ const i = t.slice(1), c = e.find(
4124
+ (s) => i === s || i.startsWith(`${s}.`)
4125
+ );
4126
+ if (c) {
4127
+ const s = i.slice(c.length + 1) || i;
4128
+ if (r.variables.some((a) => a.name === i))
4129
+ return {
4130
+ [s]: {
4131
+ type: "reference",
4132
+ name: i
4133
+ }
4134
+ };
4135
+ } else
4136
+ for (const s of e) {
4137
+ const a = `${s}.${i}`;
4138
+ if (r.variables.some((o) => o.name === a))
4139
+ return {
4140
+ [i]: {
4141
+ type: "reference",
4142
+ name: a
4143
+ }
4144
+ };
4145
+ }
4146
+ return n(t);
4147
+ }
4148
+ return n(t);
4149
+ };
4150
+ }
4151
+ function me(e, r) {
4016
4152
  return function(t, i, c = {}) {
4017
- const o = {
4153
+ const s = {
4018
4154
  type: "utility",
4019
4155
  name: t,
4020
4156
  factory: i,
4021
4157
  values: [],
4022
- autogenerate: c.autogenerate ?? z(),
4023
- create: (u, s = []) => {
4024
- let f = u;
4025
- if (Array.isArray(u)) {
4158
+ autogenerate: c.autogenerate ?? (Array.isArray(c.namespace) ? de(c.namespace, r) : P(
4159
+ c.namespace ? { namespace: c.namespace } : void 0
4160
+ )),
4161
+ namespace: c.namespace,
4162
+ create: (a, o = []) => {
4163
+ let f = a;
4164
+ if (Array.isArray(a)) {
4026
4165
  f = {};
4027
- for (const l of u) {
4028
- const a = o.autogenerate(l);
4166
+ for (const l of a) {
4167
+ const u = s.autogenerate(l);
4029
4168
  f = {
4030
4169
  ...f,
4031
- ...a
4170
+ ...u
4032
4171
  };
4033
4172
  }
4034
4173
  }
4035
- for (const [l, a] of Object.entries(f)) {
4036
- const y = o.values.find(
4037
- (h2) => h2.key === l && h2.modifiers.length === 0
4038
- ), p = {
4174
+ for (const [l, u] of Object.entries(f)) {
4175
+ let y = u;
4176
+ if (s.namespace && j(u))
4177
+ if (r.variables.some((g) => g.name === u.name))
4178
+ y = u;
4179
+ else {
4180
+ const g = Array.isArray(s.namespace) ? s.namespace : [s.namespace];
4181
+ let $2 = false;
4182
+ for (const O2 of g) {
4183
+ const m = `${O2}.${l}`;
4184
+ if (m !== u.name && r.variables.some((b) => b.name === m)) {
4185
+ y = {
4186
+ type: "reference",
4187
+ name: m
4188
+ }, $2 = true;
4189
+ break;
4190
+ }
4191
+ }
4192
+ $2 || (y = l);
4193
+ }
4194
+ const p = s.values.find(
4195
+ (g) => g.key === l && g.modifiers.length === 0
4196
+ ), d2 = {
4039
4197
  type: "utility",
4040
4198
  name: t,
4041
4199
  value: l,
@@ -4043,200 +4201,246 @@ function le(e, r) {
4043
4201
  variables: [],
4044
4202
  children: [],
4045
4203
  modifiers: []
4046
- }, d2 = v(
4047
- p,
4204
+ }, w2 = v(
4205
+ d2,
4048
4206
  r
4049
4207
  );
4050
- if (p.declarations = i({
4051
- ...d2,
4052
- value: a
4053
- }) ?? {}, k(p.declarations, d2), y || (o.values.push({
4208
+ if (d2.declarations = i({
4209
+ ...w2,
4210
+ value: y
4211
+ }) ?? {}, R(d2.declarations, w2), p || (s.values.push({
4054
4212
  key: l,
4055
- value: a,
4213
+ value: y,
4056
4214
  modifiers: []
4057
- }), e.children.push(p)), s && s.length > 0) {
4058
- const h2 = s.map((g2) => g2.key), H2 = ce(h2).filter((g2) => !o.values.find(
4059
- (b) => b.key === l && b.modifiers.length === g2.length && b.modifiers.every((w2) => g2.includes(w2))
4060
- )).reduce((g2, b) => {
4061
- const w2 = /* @__PURE__ */ new Map();
4062
- for (const $2 of b) {
4063
- const V2 = s.find(
4064
- (N2) => N2.key.includes($2)
4215
+ }), e.children.push(d2)), o && o.length > 0) {
4216
+ const g = o.map((m) => m.key), O2 = ae(g).filter((m) => !s.values.find(
4217
+ (b) => b.key === l && b.modifiers.length === m.length && b.modifiers.every((k2) => m.includes(k2))
4218
+ )).reduce((m, b) => {
4219
+ const k2 = /* @__PURE__ */ new Map();
4220
+ for (const U2 of b) {
4221
+ const M2 = o.find(
4222
+ (q2) => q2.key.includes(U2)
4065
4223
  );
4066
- V2 && q(V2) && w2.set($2, V2);
4224
+ M2 && I(M2) && k2.set(U2, M2);
4067
4225
  }
4068
- return o.values.push({
4226
+ return s.values.push({
4069
4227
  key: l,
4070
- value: a,
4228
+ value: y,
4071
4229
  modifiers: b
4072
- }), g2.push(fe(p, r, w2)), g2;
4230
+ }), m.push(ue(d2, r, k2)), m;
4073
4231
  }, []);
4074
- e.children.push(...H2);
4232
+ e.children.push(...O2);
4075
4233
  }
4076
4234
  }
4077
4235
  }
4078
4236
  };
4079
- return r.utilities.push(o), o.create;
4237
+ return r.utilities.push(s), s.create;
4080
4238
  };
4081
4239
  }
4082
- function ye(e, r) {
4240
+ function pe(e, r) {
4083
4241
  return function(t, i) {
4084
- const c = r.themes.find((s) => s.name === t), o = c ?? {
4242
+ const c = r.themes.find((o) => o.name === t), s = c ?? {
4085
4243
  type: "theme",
4086
4244
  name: t,
4087
4245
  declarations: {},
4088
4246
  variables: [],
4089
4247
  children: []
4090
4248
  };
4091
- c || r.themes.push(o);
4092
- const u = v(o, r);
4093
- return i && i(u), o;
4249
+ c || r.themes.push(s);
4250
+ const a = v(s, r);
4251
+ return i && i(a), s;
4094
4252
  };
4095
4253
  }
4096
- function de(e, r) {
4254
+ function he(e, r) {
4097
4255
  return function(t) {
4098
4256
  const i = {
4099
4257
  type: "recipe",
4100
4258
  ...t
4101
4259
  };
4102
- return i._runtime = pe(i, r), me(i, r), r.recipes.push(i), i;
4260
+ return i._runtime = ge(i, r), be(i, r), r.recipes.push(i), i;
4103
4261
  };
4104
4262
  }
4105
- function C(e, r) {
4263
+ function _(e, r) {
4106
4264
  const n = e.autogenerate(r);
4107
4265
  return Object.keys(n)[0] ?? "default";
4108
4266
  }
4109
- function F(e, r) {
4267
+ function x(e, r) {
4110
4268
  const n = {};
4111
4269
  for (const [t, i] of Object.entries(e))
4112
- if (P(i)) {
4270
+ if (L(i)) {
4113
4271
  const c = {};
4114
- for (const [o, u] of Object.entries(i)) {
4115
- const s = T(r, o);
4116
- s ? c[o] = C(
4117
- s,
4118
- u
4272
+ for (const [s, a] of Object.entries(i)) {
4273
+ const o = S(r, s);
4274
+ o ? c[s] = _(
4275
+ o,
4276
+ a
4119
4277
  ) : console.warn(
4120
- `[styleframe] Utility "${o}" not found in registry. Skipping runtime generation for this declaration.`
4278
+ `[styleframe] Utility "${s}" not found in registry. Skipping runtime generation for this declaration.`
4121
4279
  );
4122
4280
  }
4123
4281
  n[t] = c;
4124
4282
  } else if (typeof i == "boolean")
4125
4283
  n[t] = i;
4126
4284
  else {
4127
- const c = T(r, t);
4128
- c ? n[t] = C(c, i) : console.warn(
4285
+ const c = S(r, t);
4286
+ c ? n[t] = _(c, i) : console.warn(
4129
4287
  `[styleframe] Utility "${t}" not found in registry. Skipping runtime generation for this declaration.`
4130
4288
  );
4131
4289
  }
4132
4290
  return n;
4133
4291
  }
4134
- function pe(e, r) {
4292
+ function ge(e, r) {
4135
4293
  const n = {};
4136
- if (e.base && (n.base = F(e.base, r)), e.variants) {
4294
+ if (e.base && (n.base = x(e.base, r)), e.variants) {
4137
4295
  const t = {};
4138
4296
  for (const [i, c] of Object.entries(e.variants)) {
4139
- const o = {};
4140
- for (const [u, s] of Object.entries(
4297
+ const s = {};
4298
+ for (const [a, o] of Object.entries(
4141
4299
  c
4142
4300
  ))
4143
- s == null ? o[u] = null : o[u] = F(
4144
- s,
4301
+ o == null ? s[a] = null : s[a] = x(
4302
+ o,
4145
4303
  r
4146
4304
  );
4147
- t[i] = o;
4305
+ t[i] = s;
4148
4306
  }
4149
4307
  n.variants = t;
4150
4308
  }
4151
4309
  return e.defaultVariants && (n.defaultVariants = { ...e.defaultVariants }), e.compoundVariants && (n.compoundVariants = e.compoundVariants.map((t) => ({
4152
4310
  match: { ...t.match },
4153
- css: F(t.css, r)
4311
+ css: x(t.css, r)
4154
4312
  }))), n;
4155
4313
  }
4156
- function P(e) {
4157
- return !A(e) && typeof e == "object" && e !== null;
4314
+ function L(e) {
4315
+ return !j(e) && typeof e == "object" && e !== null;
4158
4316
  }
4159
- function x(e, r) {
4317
+ function E(e, r) {
4160
4318
  const n = (t, i, c) => {
4161
- let o = r.get(t);
4162
- o || (o = [], r.set(t, o)), o.push({ value: i, modifiers: c });
4319
+ let s = r.get(t);
4320
+ s || (s = [], r.set(t, s)), s.push({ value: i, modifiers: c });
4163
4321
  };
4164
4322
  for (const [t, i] of Object.entries(e))
4165
- if (P(i)) {
4323
+ if (L(i)) {
4166
4324
  const c = t.split(":");
4167
- for (const [o, u] of Object.entries(i))
4168
- n(o, u, c);
4325
+ for (const [s, a] of Object.entries(i))
4326
+ n(s, a, c);
4169
4327
  } else
4170
4328
  n(t, i, []);
4171
4329
  }
4172
- function T(e, r) {
4330
+ function S(e, r) {
4173
4331
  const n = e.utilities.find((i) => i.name === r);
4174
4332
  if (n)
4175
4333
  return n;
4176
4334
  const t = r.replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
4177
4335
  return e.utilities.find((i) => i.name === t);
4178
4336
  }
4179
- function me(e, r) {
4337
+ function be(e, r) {
4180
4338
  const n = /* @__PURE__ */ new Map();
4181
- if (e.base && x(e.base, n), e.variants)
4339
+ if (e.base && E(e.base, n), e.variants)
4182
4340
  for (const i of Object.values(e.variants))
4183
4341
  for (const c of Object.values(i))
4184
- x(
4342
+ E(
4185
4343
  c,
4186
4344
  n
4187
4345
  );
4188
4346
  if (e.compoundVariants)
4189
4347
  for (const i of e.compoundVariants)
4190
- i.css && x(i.css, n);
4348
+ i.css && E(i.css, n);
4191
4349
  const t = /* @__PURE__ */ new Map();
4192
4350
  for (const [i, c] of n) {
4193
- const o = T(r, i);
4194
- if (!o) {
4351
+ const s = S(r, i);
4352
+ if (!s) {
4195
4353
  console.warn(
4196
4354
  `[styleframe] Utility "${i}" not found in registry. Skipping.`
4197
4355
  );
4198
4356
  continue;
4199
4357
  }
4200
- for (const u of c) {
4201
- const s = [];
4202
- for (const f of u.modifiers) {
4358
+ for (const a of c) {
4359
+ const o = [];
4360
+ for (const f of a.modifiers) {
4203
4361
  if (!t.has(f))
4204
4362
  try {
4205
- t.set(f, re(r, f));
4363
+ t.set(f, se(r, f));
4206
4364
  } catch {
4207
4365
  console.warn(
4208
4366
  `[styleframe] Modifier "${f}" not found in registry. Skipping modifier for utility "${i}".`
4209
4367
  ), t.set(f, null);
4210
4368
  }
4211
4369
  const l = t.get(f);
4212
- l && s.push(l);
4370
+ l && o.push(l);
4213
4371
  }
4214
- o.create(
4215
- [u.value],
4216
- s.length > 0 ? s : void 0
4372
+ s.create(
4373
+ [a.value],
4374
+ o.length > 0 ? o : void 0
4217
4375
  );
4218
4376
  }
4219
4377
  }
4220
4378
  }
4221
- function Re(e) {
4222
- const r = ne("sf-"), n = ae(), t = { ...e }, i = le(n, n), c = ue(n, n), o = de(n, n), u = ye(n, n), { variable: s, selector: f, atRule: l, keyframes: a, media: y, ref: p, css: d2 } = v(n, n);
4379
+ function Fe(e) {
4380
+ const r = ie("sf-"), n = ye(), t = { ...e }, i = me(n, n), c = le(n, n), s = he(n, n), a = pe(n, n), { variable: o, selector: f, atRule: l, keyframes: u, media: y, ref: p, css: d2 } = v(n, n);
4223
4381
  return {
4224
4382
  id: r,
4225
4383
  root: n,
4226
- variable: s,
4384
+ variable: o,
4227
4385
  selector: f,
4228
4386
  utility: i,
4229
4387
  modifier: c,
4230
- recipe: o,
4231
- theme: u,
4388
+ recipe: s,
4389
+ theme: a,
4232
4390
  atRule: l,
4233
- keyframes: a,
4391
+ keyframes: u,
4234
4392
  media: y,
4235
4393
  ref: p,
4236
4394
  css: d2,
4237
4395
  options: t
4238
4396
  };
4239
4397
  }
4398
+ function createLoader(basePath, alias) {
4399
+ return createJiti(basePath, {
4400
+ fsCache: false,
4401
+ moduleCache: false,
4402
+ alias
4403
+ });
4404
+ }
4405
+ function trackExports(module) {
4406
+ const exports = /* @__PURE__ */ new Map();
4407
+ for (const [name, value] of Object.entries(module)) {
4408
+ if (name === "default") continue;
4409
+ let type = null;
4410
+ if (ke(value)) {
4411
+ type = "recipe";
4412
+ value._exportName = name;
4413
+ } else if (Ae(value)) {
4414
+ type = "selector";
4415
+ value._exportName = name;
4416
+ }
4417
+ if (type) {
4418
+ exports.set(name, { name, type });
4419
+ }
4420
+ }
4421
+ return exports;
4422
+ }
4423
+ async function loadModule(filePath, options = {}) {
4424
+ const { alias, validateInstance = true } = options;
4425
+ const jiti2 = createLoader(path.dirname(filePath), alias);
4426
+ const module = await jiti2.import(filePath);
4427
+ if (!module.default) {
4428
+ throw new Error(
4429
+ `Missing default export in ${filePath}. Expected a Styleframe instance.`
4430
+ );
4431
+ }
4432
+ if (validateInstance && !Ve(module.default)) {
4433
+ throw new Error(
4434
+ `Invalid default export in ${filePath}. Expected a Styleframe instance created with styleframe().`
4435
+ );
4436
+ }
4437
+ const exports = trackExports(module);
4438
+ return {
4439
+ module,
4440
+ instance: module.default,
4441
+ exports
4442
+ };
4443
+ }
4240
4444
  const SUPPORTED_EXTENSIONS = [".ts", ".mts", ".cts", ".js", ".mjs", ".cjs"];
4241
4445
  function hasKnownExtension(filePath) {
4242
4446
  return SUPPORTED_EXTENSIONS.some((ext) => filePath.endsWith(ext));
@@ -4254,36 +4458,16 @@ function resolveConfigFile(cwd, entry) {
4254
4458
  }
4255
4459
  return void 0;
4256
4460
  }
4257
- function trackNamedExports(module) {
4258
- for (const [exportName, exportValue] of Object.entries(module)) {
4259
- if (exportName === "default") continue;
4260
- if (Ae(exportValue)) {
4261
- exportValue._exportName = exportName;
4262
- } else if (ge(exportValue)) {
4263
- exportValue._exportName = exportName;
4264
- }
4265
- }
4266
- }
4267
4461
  async function loadConfiguration({
4268
4462
  cwd = process.cwd(),
4269
4463
  entry = "styleframe.config"
4270
4464
  } = {}) {
4271
4465
  const resolvedPath = resolveConfigFile(cwd, entry);
4272
4466
  if (!resolvedPath) {
4273
- return Re();
4274
- }
4275
- const jiti2 = createJiti(path.dirname(resolvedPath), {
4276
- fsCache: false,
4277
- moduleCache: false
4278
- });
4279
- const module = await jiti2.import(resolvedPath);
4280
- if (!module.default) {
4281
- throw new Error(
4282
- `Missing default export in ${resolvedPath}. Expected a Styleframe instance.`
4283
- );
4467
+ return Fe();
4284
4468
  }
4285
- trackNamedExports(module);
4286
- return module.default;
4469
+ const { instance } = await loadModule(resolvedPath);
4470
+ return instance;
4287
4471
  }
4288
4472
  export {
4289
4473
  build as b,