@depup/cloudflare__vite-plugin 1.59.0-depup.0 → 1.60.0-depup.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.
- package/README.md +3 -3
- package/changes.json +2 -2
- package/dist/experimental-config.d.mts +64 -11
- package/dist/experimental-config.d.mts.map +1 -1
- package/dist/experimental-config.mjs +10 -2
- package/dist/experimental-config.mjs.map +1 -1
- package/dist/index.mjs +768 -1178
- package/dist/index.mjs.map +1 -1
- package/dist/{package-J6bTylIX.mjs → package-DMrDuc8O.mjs} +2 -2
- package/dist/{package-J6bTylIX.mjs.map → package-DMrDuc8O.mjs.map} +1 -1
- package/package.json +15 -15
package/dist/index.mjs
CHANGED
|
@@ -542,7 +542,7 @@ __export(core_exports2, {
|
|
|
542
542
|
isValidJWT: () => isValidJWT$1,
|
|
543
543
|
locales: () => locales_exports,
|
|
544
544
|
meta: () => meta$2,
|
|
545
|
-
parse: () => parse$
|
|
545
|
+
parse: () => parse$12,
|
|
546
546
|
parseAsync: () => parseAsync$2,
|
|
547
547
|
prettifyError: () => prettifyError,
|
|
548
548
|
process: () => process$4,
|
|
@@ -1377,7 +1377,7 @@ var _parse$1 = /* @__PURE__ */ __name$6((_Err) => (schema, value, _ctx, _params)
|
|
|
1377
1377
|
}
|
|
1378
1378
|
return result.value;
|
|
1379
1379
|
}, "_parse");
|
|
1380
|
-
var parse$
|
|
1380
|
+
var parse$12 = /* @__PURE__ */ _parse$1($ZodRealError$1);
|
|
1381
1381
|
var _parseAsync$1 = /* @__PURE__ */ __name$6((_Err) => async (schema, value, _ctx, params) => {
|
|
1382
1382
|
const ctx = _ctx ? {
|
|
1383
1383
|
..._ctx,
|
|
@@ -3930,9 +3930,9 @@ var $ZodFunction = /* @__PURE__ */ $constructor$1("$ZodFunction", (inst, def) =>
|
|
|
3930
3930
|
inst.implement = (func) => {
|
|
3931
3931
|
if (typeof func !== "function") throw new Error("implement() must be called with a function");
|
|
3932
3932
|
return function(...args) {
|
|
3933
|
-
const parsedArgs = inst._def.input ? parse$
|
|
3933
|
+
const parsedArgs = inst._def.input ? parse$12(inst._def.input, args) : args;
|
|
3934
3934
|
const result = Reflect.apply(func, this, parsedArgs);
|
|
3935
|
-
if (inst._def.output) return parse$
|
|
3935
|
+
if (inst._def.output) return parse$12(inst._def.output, result);
|
|
3936
3936
|
return result;
|
|
3937
3937
|
};
|
|
3938
3938
|
};
|
|
@@ -13860,16 +13860,17 @@ function createFatalError$1(message, isJson, options) {
|
|
|
13860
13860
|
__name$6(createFatalError$1, "createFatalError");
|
|
13861
13861
|
|
|
13862
13862
|
//#endregion
|
|
13863
|
-
//#region ../workers-utils/dist/chunk-
|
|
13863
|
+
//#region ../workers-utils/dist/chunk-XNN5XXU4.mjs
|
|
13864
13864
|
function hasKnownExportType(entry) {
|
|
13865
13865
|
const type = entry?.type;
|
|
13866
|
-
return type === "durable-object" || type === "worker";
|
|
13866
|
+
return type === "durable-object" || type === "worker" || type === "workflow";
|
|
13867
13867
|
}
|
|
13868
13868
|
__name$6(hasKnownExportType, "hasKnownExportType");
|
|
13869
13869
|
function partitionExports(exports$1) {
|
|
13870
13870
|
const partitioned = {
|
|
13871
13871
|
"durable-object": {},
|
|
13872
|
-
worker: {}
|
|
13872
|
+
worker: {},
|
|
13873
|
+
workflow: {}
|
|
13873
13874
|
};
|
|
13874
13875
|
if (exports$1 === void 0) return partitioned;
|
|
13875
13876
|
for (const [name, entry] of Object.entries(exports$1)) {
|
|
@@ -14526,7 +14527,7 @@ var ParseOptions;
|
|
|
14526
14527
|
(function(ParseOptions2) {
|
|
14527
14528
|
ParseOptions2.DEFAULT = { allowTrailingComma: false };
|
|
14528
14529
|
})(ParseOptions || (ParseOptions = {}));
|
|
14529
|
-
function parse$
|
|
14530
|
+
function parse$11(text, errors$1 = [], options = ParseOptions.DEFAULT) {
|
|
14530
14531
|
let currentProperty = null;
|
|
14531
14532
|
let currentParent = [];
|
|
14532
14533
|
const previousParents = [];
|
|
@@ -14570,7 +14571,7 @@ function parse$12(text, errors$1 = [], options = ParseOptions.DEFAULT) {
|
|
|
14570
14571
|
}, options);
|
|
14571
14572
|
return currentParent[0];
|
|
14572
14573
|
}
|
|
14573
|
-
__name$6(parse$
|
|
14574
|
+
__name$6(parse$11, "parse");
|
|
14574
14575
|
function parseTree(text, errors$1 = [], options = ParseOptions.DEFAULT) {
|
|
14575
14576
|
let currentParent = {
|
|
14576
14577
|
type: "array",
|
|
@@ -14747,15 +14748,15 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
14747
14748
|
}
|
|
14748
14749
|
}
|
|
14749
14750
|
__name$6(scanNext, "scanNext");
|
|
14750
|
-
function handleError(error$2, skipUntilAfter = [],
|
|
14751
|
+
function handleError(error$2, skipUntilAfter = [], skipUntil = []) {
|
|
14751
14752
|
onError$1(error$2);
|
|
14752
|
-
if (skipUntilAfter.length +
|
|
14753
|
+
if (skipUntilAfter.length + skipUntil.length > 0) {
|
|
14753
14754
|
let token = _scanner.getToken();
|
|
14754
14755
|
while (token !== 17) {
|
|
14755
14756
|
if (skipUntilAfter.indexOf(token) !== -1) {
|
|
14756
14757
|
scanNext();
|
|
14757
14758
|
break;
|
|
14758
|
-
} else if (
|
|
14759
|
+
} else if (skipUntil.indexOf(token) !== -1) break;
|
|
14759
14760
|
token = scanNext();
|
|
14760
14761
|
}
|
|
14761
14762
|
}
|
|
@@ -14807,7 +14808,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
14807
14808
|
if (_scanner.getToken() === 6) {
|
|
14808
14809
|
onSeparator(":");
|
|
14809
14810
|
scanNext();
|
|
14810
|
-
if (!
|
|
14811
|
+
if (!parseValue()) handleError(4, [], [2, 5]);
|
|
14811
14812
|
} else handleError(5, [], [2, 5]);
|
|
14812
14813
|
_jsonPath.pop();
|
|
14813
14814
|
return true;
|
|
@@ -14849,7 +14850,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
14849
14850
|
_jsonPath.push(0);
|
|
14850
14851
|
isFirstElement = false;
|
|
14851
14852
|
} else _jsonPath[_jsonPath.length - 1]++;
|
|
14852
|
-
if (!
|
|
14853
|
+
if (!parseValue()) handleError(4, [], [4, 5]);
|
|
14853
14854
|
needsComma = true;
|
|
14854
14855
|
}
|
|
14855
14856
|
onArrayEnd();
|
|
@@ -14859,7 +14860,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
14859
14860
|
return true;
|
|
14860
14861
|
}
|
|
14861
14862
|
__name$6(parseArray2, "parseArray");
|
|
14862
|
-
function
|
|
14863
|
+
function parseValue() {
|
|
14863
14864
|
switch (_scanner.getToken()) {
|
|
14864
14865
|
case 3: return parseArray2();
|
|
14865
14866
|
case 1: return parseObject();
|
|
@@ -14867,14 +14868,14 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
14867
14868
|
default: return parseLiteral();
|
|
14868
14869
|
}
|
|
14869
14870
|
}
|
|
14870
|
-
__name$6(
|
|
14871
|
+
__name$6(parseValue, "parseValue");
|
|
14871
14872
|
scanNext();
|
|
14872
14873
|
if (_scanner.getToken() === 17) {
|
|
14873
14874
|
if (options.allowEmptyContent) return true;
|
|
14874
14875
|
handleError(4, [], []);
|
|
14875
14876
|
return false;
|
|
14876
14877
|
}
|
|
14877
|
-
if (!
|
|
14878
|
+
if (!parseValue()) {
|
|
14878
14879
|
handleError(4, [], []);
|
|
14879
14880
|
return false;
|
|
14880
14881
|
}
|
|
@@ -15098,7 +15099,7 @@ var SyntaxKind;
|
|
|
15098
15099
|
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
15099
15100
|
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
15100
15101
|
})(SyntaxKind || (SyntaxKind = {}));
|
|
15101
|
-
var parse2 = parse$
|
|
15102
|
+
var parse2 = parse$11;
|
|
15102
15103
|
var ParseErrorCode;
|
|
15103
15104
|
(function(ParseErrorCode2) {
|
|
15104
15105
|
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
@@ -15164,97 +15165,13 @@ function applyEdits(text, edits) {
|
|
|
15164
15165
|
return text;
|
|
15165
15166
|
}
|
|
15166
15167
|
__name$6(applyEdits, "applyEdits");
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
static {
|
|
15170
|
-
__name$6(this, "TomlDate");
|
|
15171
|
-
}
|
|
15172
|
-
#hasDate = false;
|
|
15173
|
-
#hasTime = false;
|
|
15174
|
-
#offset = null;
|
|
15175
|
-
constructor(date$3) {
|
|
15176
|
-
let hasDate = true;
|
|
15177
|
-
let hasTime = true;
|
|
15178
|
-
let offset = "Z";
|
|
15179
|
-
if (typeof date$3 === "string") {
|
|
15180
|
-
let match = date$3.match(DATE_TIME_RE$1);
|
|
15181
|
-
if (match) {
|
|
15182
|
-
if (!match[1]) {
|
|
15183
|
-
hasDate = false;
|
|
15184
|
-
date$3 = `0000-01-01T${date$3}`;
|
|
15185
|
-
}
|
|
15186
|
-
hasTime = !!match[2];
|
|
15187
|
-
hasTime && date$3[10] === " " && (date$3 = date$3.replace(" ", "T"));
|
|
15188
|
-
if (match[2] && +match[2] > 23) date$3 = "";
|
|
15189
|
-
else {
|
|
15190
|
-
offset = match[3] || null;
|
|
15191
|
-
date$3 = date$3.toUpperCase();
|
|
15192
|
-
if (!offset && hasTime) date$3 += "Z";
|
|
15193
|
-
}
|
|
15194
|
-
} else date$3 = "";
|
|
15195
|
-
}
|
|
15196
|
-
super(date$3);
|
|
15197
|
-
if (!isNaN(this.getTime())) {
|
|
15198
|
-
this.#hasDate = hasDate;
|
|
15199
|
-
this.#hasTime = hasTime;
|
|
15200
|
-
this.#offset = offset;
|
|
15201
|
-
}
|
|
15202
|
-
}
|
|
15203
|
-
isDateTime() {
|
|
15204
|
-
return this.#hasDate && this.#hasTime;
|
|
15205
|
-
}
|
|
15206
|
-
isLocal() {
|
|
15207
|
-
return !this.#hasDate || !this.#hasTime || !this.#offset;
|
|
15208
|
-
}
|
|
15209
|
-
isDate() {
|
|
15210
|
-
return this.#hasDate && !this.#hasTime;
|
|
15211
|
-
}
|
|
15212
|
-
isTime() {
|
|
15213
|
-
return this.#hasTime && !this.#hasDate;
|
|
15214
|
-
}
|
|
15215
|
-
isValid() {
|
|
15216
|
-
return this.#hasDate || this.#hasTime;
|
|
15217
|
-
}
|
|
15218
|
-
toISOString() {
|
|
15219
|
-
let iso = super.toISOString();
|
|
15220
|
-
if (this.isDate()) return iso.slice(0, 10);
|
|
15221
|
-
if (this.isTime()) return iso.slice(11, 23);
|
|
15222
|
-
if (this.#offset === null) return iso.slice(0, -1);
|
|
15223
|
-
if (this.#offset === "Z") return iso;
|
|
15224
|
-
let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
|
|
15225
|
-
offset = this.#offset[0] === "-" ? offset : -offset;
|
|
15226
|
-
return (/* @__PURE__ */ new Date(this.getTime() - offset * 6e4)).toISOString().slice(0, -1) + this.#offset;
|
|
15227
|
-
}
|
|
15228
|
-
static wrapAsOffsetDateTime(jsDate, offset = "Z") {
|
|
15229
|
-
let date$3 = new _TomlDate(jsDate);
|
|
15230
|
-
date$3.#offset = offset;
|
|
15231
|
-
return date$3;
|
|
15232
|
-
}
|
|
15233
|
-
static wrapAsLocalDateTime(jsDate) {
|
|
15234
|
-
let date$3 = new _TomlDate(jsDate);
|
|
15235
|
-
date$3.#offset = null;
|
|
15236
|
-
return date$3;
|
|
15237
|
-
}
|
|
15238
|
-
static wrapAsLocalDate(jsDate) {
|
|
15239
|
-
let date$3 = new _TomlDate(jsDate);
|
|
15240
|
-
date$3.#hasTime = false;
|
|
15241
|
-
date$3.#offset = null;
|
|
15242
|
-
return date$3;
|
|
15243
|
-
}
|
|
15244
|
-
static wrapAsLocalTime(jsDate) {
|
|
15245
|
-
let date$3 = new _TomlDate(jsDate);
|
|
15246
|
-
date$3.#hasDate = false;
|
|
15247
|
-
date$3.#offset = null;
|
|
15248
|
-
return date$3;
|
|
15249
|
-
}
|
|
15250
|
-
};
|
|
15251
|
-
function getLineColFromPtr$1(string$3, ptr) {
|
|
15252
|
-
let lines = string$3.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
15168
|
+
function getLineColFromPtr(string$3, ptr) {
|
|
15169
|
+
let lines = string$3.slice(0, ptr).split(/\r?\n/);
|
|
15253
15170
|
return [lines.length, lines.pop().length + 1];
|
|
15254
15171
|
}
|
|
15255
|
-
__name$6(getLineColFromPtr
|
|
15256
|
-
function makeCodeBlock
|
|
15257
|
-
let lines = string$3.split(/\r
|
|
15172
|
+
__name$6(getLineColFromPtr, "getLineColFromPtr");
|
|
15173
|
+
function makeCodeBlock(string$3, line, column) {
|
|
15174
|
+
let lines = string$3.split(/\r?\n/);
|
|
15258
15175
|
let codeblock = "";
|
|
15259
15176
|
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
15260
15177
|
for (let i$1 = line - 1; i$1 <= line + 1; i$1++) {
|
|
@@ -15271,8 +15188,8 @@ function makeCodeBlock$1(string$3, line, column) {
|
|
|
15271
15188
|
}
|
|
15272
15189
|
return codeblock;
|
|
15273
15190
|
}
|
|
15274
|
-
__name$6(makeCodeBlock
|
|
15275
|
-
var TomlError
|
|
15191
|
+
__name$6(makeCodeBlock, "makeCodeBlock");
|
|
15192
|
+
var TomlError = class _TomlError extends Error {
|
|
15276
15193
|
static {
|
|
15277
15194
|
__name$6(this, "TomlError");
|
|
15278
15195
|
}
|
|
@@ -15280,8 +15197,8 @@ var TomlError$1 = class extends Error {
|
|
|
15280
15197
|
column;
|
|
15281
15198
|
codeblock;
|
|
15282
15199
|
constructor(message, options) {
|
|
15283
|
-
const [line, column] = getLineColFromPtr
|
|
15284
|
-
const codeblock = makeCodeBlock
|
|
15200
|
+
const [line, column] = getLineColFromPtr(options.toml, options.ptr);
|
|
15201
|
+
const codeblock = makeCodeBlock(options.toml, line, column);
|
|
15285
15202
|
super(`Invalid TOML document: ${message}
|
|
15286
15203
|
|
|
15287
15204
|
${codeblock}`, options);
|
|
@@ -15289,60 +15206,16 @@ ${codeblock}`, options);
|
|
|
15289
15206
|
this.column = column;
|
|
15290
15207
|
this.codeblock = codeblock;
|
|
15291
15208
|
}
|
|
15292
|
-
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
if (str.charCodeAt(idx - 1) === 13) idx--;
|
|
15296
|
-
return idx;
|
|
15297
|
-
}
|
|
15298
|
-
__name$6(indexOfNewline$1, "indexOfNewline");
|
|
15299
|
-
function skipComment$1(ctx) {
|
|
15300
|
-
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
15301
|
-
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
15302
|
-
if (c$1 === 10) break;
|
|
15303
|
-
if (c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
|
|
15304
|
-
ctx.p++;
|
|
15305
|
-
break;
|
|
15306
|
-
}
|
|
15307
|
-
if (c$1 < 32 && c$1 !== 9 || c$1 === 127) throw new TomlError$1("control characters are not allowed in comments", {
|
|
15209
|
+
/** @internal */
|
|
15210
|
+
static x(message, ctx, ptr) {
|
|
15211
|
+
throw new _TomlError(message, {
|
|
15308
15212
|
toml: ctx.s,
|
|
15309
|
-
ptr: ctx.p
|
|
15213
|
+
ptr: ptr ?? ctx.p
|
|
15310
15214
|
});
|
|
15311
15215
|
}
|
|
15312
|
-
}
|
|
15313
|
-
|
|
15314
|
-
|
|
15315
|
-
let c$1;
|
|
15316
|
-
while (1) {
|
|
15317
|
-
while ((c$1 = ctx.s.charCodeAt(ctx.p)) === 32 || c$1 === 9 || !banNewLines && (c$1 === 10 || c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) ctx.p++;
|
|
15318
|
-
if (banComments || c$1 !== 35) break;
|
|
15319
|
-
skipComment$1(ctx);
|
|
15320
|
-
}
|
|
15321
|
-
}
|
|
15322
|
-
__name$6(skipVoid$1, "skipVoid");
|
|
15323
|
-
function skipUntil$1(ctx, sep$1, end) {
|
|
15324
|
-
let ptr = ctx.p;
|
|
15325
|
-
if (!end) {
|
|
15326
|
-
ptr = indexOfNewline$1(ctx.s, ptr);
|
|
15327
|
-
ctx.p = ptr < 0 ? ctx.s.length : ptr;
|
|
15328
|
-
return;
|
|
15329
|
-
}
|
|
15330
|
-
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
15331
|
-
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
15332
|
-
if (c$1 === 35) skipComment$1(ctx);
|
|
15333
|
-
else if (c$1 === end || c$1 === sep$1) return;
|
|
15334
|
-
}
|
|
15335
|
-
throw new TomlError$1("cannot find end of structure", {
|
|
15336
|
-
toml: ctx.s,
|
|
15337
|
-
ptr
|
|
15338
|
-
});
|
|
15339
|
-
}
|
|
15340
|
-
__name$6(skipUntil$1, "skipUntil");
|
|
15341
|
-
var INT_REGEX$1 = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
|
|
15342
|
-
var FLOAT_REGEX$1 = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
|
|
15343
|
-
var LEADING_ZERO$1 = /^[+-]?0[0-9_]/;
|
|
15344
|
-
function parseString$1(ctx) {
|
|
15345
|
-
let start = ctx.p;
|
|
15216
|
+
};
|
|
15217
|
+
function parseString(ctx) {
|
|
15218
|
+
let startPtr = ctx.p;
|
|
15346
15219
|
let c$1 = ctx.s.charCodeAt(ctx.p++);
|
|
15347
15220
|
let first = c$1;
|
|
15348
15221
|
let isLiteral = c$1 === 39;
|
|
@@ -15357,16 +15230,16 @@ function parseString$1(ctx) {
|
|
|
15357
15230
|
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
15358
15231
|
c$1 = ctx.s.charCodeAt(ctx.p);
|
|
15359
15232
|
if (isMultiline && (c$1 === 10 || c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) state = state && 3;
|
|
15360
|
-
else if (c$1 < 32 && c$1 !== 9 || c$1 === 127)
|
|
15361
|
-
toml: ctx.s,
|
|
15362
|
-
ptr: ctx.p
|
|
15363
|
-
});
|
|
15233
|
+
else if (c$1 < 32 && c$1 !== 9 || c$1 === 127) TomlError.x("control characters are not allowed in strings", ctx);
|
|
15364
15234
|
else if ((!state || state === 3) && c$1 === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
|
|
15365
15235
|
if (isMultiline) {
|
|
15366
15236
|
if (ctx.s.charCodeAt(ctx.p + 3) === first) ctx.p++;
|
|
15367
15237
|
if (ctx.s.charCodeAt(ctx.p + 3) === first) ctx.p++;
|
|
15368
15238
|
}
|
|
15369
|
-
if (!state)
|
|
15239
|
+
if (!state) {
|
|
15240
|
+
let s = ctx.s.slice(sliceStart, ctx.p);
|
|
15241
|
+
parsed = parsed ? parsed + s : s;
|
|
15242
|
+
}
|
|
15370
15243
|
ctx.p += isMultiline ? 3 : 1;
|
|
15371
15244
|
return parsed;
|
|
15372
15245
|
} else if (!state) {
|
|
@@ -15375,25 +15248,20 @@ function parseString$1(ctx) {
|
|
|
15375
15248
|
state = 1;
|
|
15376
15249
|
}
|
|
15377
15250
|
} else if (state === 1) if (c$1 === 120 || c$1 === 117 || c$1 === 85) {
|
|
15251
|
+
let errPtr = ctx.p++ - 1;
|
|
15378
15252
|
let value = 0;
|
|
15379
15253
|
let len = c$1 === 120 ? 2 : c$1 === 117 ? 4 : 8;
|
|
15380
15254
|
for (let j$1 = 0; j$1 < len; j$1++, ctx.p++) {
|
|
15381
|
-
let hex$1 = ctx.s.charCodeAt(ctx.p
|
|
15255
|
+
let hex$1 = ctx.s.charCodeAt(ctx.p);
|
|
15382
15256
|
let digit = hex$1 >= 48 && hex$1 <= 57 ? hex$1 - 48 : hex$1 >= 65 && hex$1 <= 70 ? hex$1 - 65 + 10 : hex$1 >= 97 && hex$1 <= 102 ? hex$1 - 97 + 10 : -1;
|
|
15383
|
-
if (digit < 0)
|
|
15384
|
-
toml: ctx.s,
|
|
15385
|
-
ptr: ctx.p + 1
|
|
15386
|
-
});
|
|
15257
|
+
if (digit < 0) TomlError.x("invalid non-hex character in unicode escape", ctx);
|
|
15387
15258
|
value = value << 4 | digit;
|
|
15388
15259
|
}
|
|
15389
|
-
if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343)
|
|
15390
|
-
toml: ctx.s,
|
|
15391
|
-
ptr: ctx.p
|
|
15392
|
-
});
|
|
15260
|
+
if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) TomlError.x("invalid unicode escape", ctx, errPtr);
|
|
15393
15261
|
parsed += String.fromCodePoint(value);
|
|
15394
|
-
sliceStart = ctx.p
|
|
15262
|
+
sliceStart = ctx.p--;
|
|
15395
15263
|
state = 0;
|
|
15396
|
-
} else if (c$1 === 32 || c$1 === 9) state = 2;
|
|
15264
|
+
} else if (isMultiline && (c$1 === 32 || c$1 === 9)) state = 2;
|
|
15397
15265
|
else {
|
|
15398
15266
|
if (c$1 === 98) parsed += "\b";
|
|
15399
15267
|
else if (c$1 === 116) parsed += " ";
|
|
@@ -15403,162 +15271,326 @@ function parseString$1(ctx) {
|
|
|
15403
15271
|
else if (c$1 === 101) parsed += "\x1B";
|
|
15404
15272
|
else if (c$1 === 34) parsed += "\"";
|
|
15405
15273
|
else if (c$1 === 92) parsed += "\\";
|
|
15406
|
-
else
|
|
15407
|
-
toml: ctx.s,
|
|
15408
|
-
ptr: ctx.p
|
|
15409
|
-
});
|
|
15274
|
+
else TomlError.x("unrecognised escape sequence", ctx);
|
|
15410
15275
|
sliceStart = ctx.p + 1;
|
|
15411
15276
|
state = 0;
|
|
15412
15277
|
}
|
|
15413
15278
|
else if (c$1 !== 32 && c$1 !== 9) {
|
|
15414
|
-
if (state === 2)
|
|
15415
|
-
toml: ctx.s,
|
|
15416
|
-
ptr: sliceStart
|
|
15417
|
-
});
|
|
15279
|
+
if (state === 2) TomlError.x("invalid escape: only line-ending whitespace may be escaped", ctx, sliceStart);
|
|
15418
15280
|
state = !isLiteral && c$1 === 92 ? 1 : 0;
|
|
15419
15281
|
sliceStart = ctx.p;
|
|
15420
15282
|
}
|
|
15421
15283
|
}
|
|
15422
|
-
|
|
15423
|
-
|
|
15424
|
-
|
|
15425
|
-
|
|
15426
|
-
|
|
15427
|
-
|
|
15428
|
-
|
|
15429
|
-
|
|
15430
|
-
|
|
15431
|
-
|
|
15432
|
-
|
|
15433
|
-
|
|
15434
|
-
|
|
15435
|
-
|
|
15436
|
-
|
|
15437
|
-
|
|
15438
|
-
|
|
15439
|
-
|
|
15440
|
-
|
|
15441
|
-
|
|
15442
|
-
|
|
15443
|
-
|
|
15444
|
-
|
|
15445
|
-
|
|
15446
|
-
|
|
15447
|
-
|
|
15448
|
-
|
|
15449
|
-
|
|
15450
|
-
|
|
15451
|
-
|
|
15452
|
-
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
|
|
15458
|
-
|
|
15459
|
-
|
|
15460
|
-
|
|
15461
|
-
|
|
15462
|
-
|
|
15284
|
+
TomlError.x("unfinished string", ctx, startPtr);
|
|
15285
|
+
}
|
|
15286
|
+
__name$6(parseString, "parseString");
|
|
15287
|
+
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i;
|
|
15288
|
+
var TomlDate = class _TomlDate extends Date {
|
|
15289
|
+
static {
|
|
15290
|
+
__name$6(this, "TomlDate");
|
|
15291
|
+
}
|
|
15292
|
+
#hasDate = false;
|
|
15293
|
+
#hasTime = false;
|
|
15294
|
+
#offset = null;
|
|
15295
|
+
constructor(date$3, fasttype, unsafeDelim) {
|
|
15296
|
+
let hasDate = true;
|
|
15297
|
+
let hasTime = true;
|
|
15298
|
+
let offset = "Z";
|
|
15299
|
+
let c$1;
|
|
15300
|
+
if (typeof date$3 === "string") if (fasttype) prep: {
|
|
15301
|
+
if (fasttype < 3) {
|
|
15302
|
+
if (+date$3.slice(11, 13) > 23) {
|
|
15303
|
+
date$3 = "";
|
|
15304
|
+
break prep;
|
|
15305
|
+
}
|
|
15306
|
+
if (fasttype === 2) {
|
|
15307
|
+
offset = null;
|
|
15308
|
+
date$3 += "Z";
|
|
15309
|
+
} else if ((c$1 = date$3.charCodeAt(date$3.length - 1)) !== 90 && c$1 !== 122) offset = date$3.slice(date$3.length - 6);
|
|
15310
|
+
if (unsafeDelim) date$3 = date$3.slice(0, 10) + "T" + date$3.slice(11);
|
|
15311
|
+
} else if (fasttype === 4) date$3 = +date$3.slice(0, 2) > 23 ? "" : `0000-01-01T${date$3}Z`;
|
|
15312
|
+
hasDate = fasttype !== 4;
|
|
15313
|
+
hasTime = fasttype !== 3;
|
|
15314
|
+
}
|
|
15315
|
+
else {
|
|
15316
|
+
let match = date$3.match(DATE_TIME_RE);
|
|
15317
|
+
if (match) {
|
|
15318
|
+
if (!match[1]) {
|
|
15319
|
+
hasDate = false;
|
|
15320
|
+
date$3 = `0000-01-01T${date$3}`;
|
|
15321
|
+
}
|
|
15322
|
+
hasTime = !!match[2];
|
|
15323
|
+
hasTime && date$3[10] === " " && (date$3 = date$3.replace(" ", "T"));
|
|
15324
|
+
if (match[2] && +match[2] > 23) date$3 = "";
|
|
15325
|
+
else {
|
|
15326
|
+
offset = match[3] || null;
|
|
15327
|
+
if (!offset && hasTime) date$3 += "Z";
|
|
15328
|
+
}
|
|
15329
|
+
} else date$3 = "";
|
|
15463
15330
|
}
|
|
15464
|
-
|
|
15331
|
+
super(date$3);
|
|
15332
|
+
if (!isNaN(this.getTime())) {
|
|
15333
|
+
this.#hasDate = hasDate;
|
|
15334
|
+
this.#hasTime = hasTime;
|
|
15335
|
+
this.#offset = offset;
|
|
15336
|
+
}
|
|
15337
|
+
}
|
|
15338
|
+
isDateTime() {
|
|
15339
|
+
return this.#hasDate && this.#hasTime;
|
|
15340
|
+
}
|
|
15341
|
+
isLocal() {
|
|
15342
|
+
return !this.#hasDate || !this.#hasTime || !this.#offset;
|
|
15343
|
+
}
|
|
15344
|
+
isDate() {
|
|
15345
|
+
return this.#hasDate && !this.#hasTime;
|
|
15346
|
+
}
|
|
15347
|
+
isTime() {
|
|
15348
|
+
return this.#hasTime && !this.#hasDate;
|
|
15349
|
+
}
|
|
15350
|
+
isValid() {
|
|
15351
|
+
return this.#hasDate || this.#hasTime;
|
|
15352
|
+
}
|
|
15353
|
+
toISOString() {
|
|
15354
|
+
let iso = super.toISOString();
|
|
15355
|
+
if (this.isDate()) return iso.slice(0, 10);
|
|
15356
|
+
if (this.isTime()) return iso.slice(11, 23);
|
|
15357
|
+
if (this.#offset === null) return iso.slice(0, -1);
|
|
15358
|
+
if (this.#offset === "Z" || this.#offset === "z") return iso;
|
|
15359
|
+
let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
|
|
15360
|
+
offset = this.#offset[0] === "-" ? offset : -offset;
|
|
15361
|
+
return (/* @__PURE__ */ new Date(this.getTime() - offset * 6e4)).toISOString().slice(0, -1) + this.#offset;
|
|
15362
|
+
}
|
|
15363
|
+
static wrapAsOffsetDateTime(jsDate, offset = "Z") {
|
|
15364
|
+
let date$3 = new _TomlDate(jsDate);
|
|
15365
|
+
date$3.#offset = offset;
|
|
15366
|
+
return date$3;
|
|
15367
|
+
}
|
|
15368
|
+
static wrapAsLocalDateTime(jsDate) {
|
|
15369
|
+
let date$3 = new _TomlDate(jsDate);
|
|
15370
|
+
date$3.#offset = null;
|
|
15371
|
+
return date$3;
|
|
15372
|
+
}
|
|
15373
|
+
static wrapAsLocalDate(jsDate) {
|
|
15374
|
+
let date$3 = new _TomlDate(jsDate);
|
|
15375
|
+
date$3.#hasTime = false;
|
|
15376
|
+
date$3.#offset = null;
|
|
15377
|
+
return date$3;
|
|
15465
15378
|
}
|
|
15466
|
-
|
|
15467
|
-
|
|
15468
|
-
|
|
15379
|
+
static wrapAsLocalTime(jsDate) {
|
|
15380
|
+
let date$3 = new _TomlDate(jsDate);
|
|
15381
|
+
date$3.#hasDate = false;
|
|
15382
|
+
date$3.#offset = null;
|
|
15383
|
+
return date$3;
|
|
15384
|
+
}
|
|
15385
|
+
};
|
|
15386
|
+
function isDigit2(char, base = 10) {
|
|
15387
|
+
return base === 16 ? char > 47 && char < 58 || char > 64 && char < 71 || char > 96 && char < 103 : char > 47 && char < 48 + base;
|
|
15388
|
+
}
|
|
15389
|
+
__name$6(isDigit2, "isDigit");
|
|
15390
|
+
function isEndOfValue(char, delim) {
|
|
15391
|
+
return char === 32 || char === 9 || char === 10 || char === 13 || delim && (char === delim || char === 44) || char === 35;
|
|
15469
15392
|
}
|
|
15470
|
-
__name$6(
|
|
15471
|
-
function extractValue
|
|
15472
|
-
let
|
|
15473
|
-
let c$1 = ctx.s.charCodeAt(
|
|
15393
|
+
__name$6(isEndOfValue, "isEndOfValue");
|
|
15394
|
+
function extractValue(ctx, end) {
|
|
15395
|
+
let errPtr = ctx.p;
|
|
15396
|
+
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
15474
15397
|
if (c$1 === 91 || c$1 === 123) {
|
|
15475
|
-
|
|
15476
|
-
|
|
15477
|
-
ptr
|
|
15478
|
-
});
|
|
15479
|
-
let value = c$1 === 91 ? parseArray$1(ctx, integersAsBigInt) : parseInlineTable$1(ctx, integersAsBigInt);
|
|
15398
|
+
ctx.d-- || TomlError.x("document contains excessively nested structures. aborting.", ctx);
|
|
15399
|
+
let value = c$1 === 91 ? parseArray(ctx) : parseInlineTable(ctx);
|
|
15480
15400
|
ctx.d++;
|
|
15481
15401
|
return value;
|
|
15482
15402
|
}
|
|
15483
|
-
if (c$1 === 34 || c$1 === 39) return parseString
|
|
15403
|
+
if (c$1 === 34 || c$1 === 39) return parseString(ctx);
|
|
15484
15404
|
if (c$1 === 116) {
|
|
15485
|
-
if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101)
|
|
15486
|
-
|
|
15487
|
-
ptr
|
|
15488
|
-
});
|
|
15489
|
-
ctx.p++;
|
|
15490
|
-
return true;
|
|
15405
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101) TomlError.x("invalid value", ctx, errPtr);
|
|
15406
|
+
return ctx.p++, true;
|
|
15491
15407
|
}
|
|
15492
15408
|
if (c$1 === 102) {
|
|
15493
|
-
if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101)
|
|
15494
|
-
|
|
15495
|
-
ptr
|
|
15496
|
-
});
|
|
15497
|
-
ctx.p++;
|
|
15498
|
-
return false;
|
|
15409
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101) TomlError.x("invalid value", ctx, errPtr);
|
|
15410
|
+
return ctx.p++, false;
|
|
15499
15411
|
}
|
|
15500
|
-
|
|
15412
|
+
if (c$1 === 43 || c$1 === 45) return parseNumber(ctx, ctx.p, ctx.s.charCodeAt(++ctx.p), 44 - c$1, end);
|
|
15413
|
+
if (ctx.s.charCodeAt(ctx.p + 4) === 45 && ctx.s.charCodeAt(ctx.p + 7) === 45) return parseDate(ctx, c$1, end);
|
|
15414
|
+
if (ctx.s.charCodeAt(ctx.p + 2) === 58) return parseTime(ctx, c$1, end);
|
|
15415
|
+
return parseNumber(ctx, ctx.p, c$1, 0, end);
|
|
15501
15416
|
}
|
|
15502
|
-
__name$6(extractValue
|
|
15503
|
-
|
|
15504
|
-
|
|
15417
|
+
__name$6(extractValue, "extractValue");
|
|
15418
|
+
function parseNumber(ctx, startPtr, startChr, sign, endChr) {
|
|
15419
|
+
let c$1 = startChr;
|
|
15420
|
+
let state = 0;
|
|
15421
|
+
let hasUnderscores = false;
|
|
15422
|
+
if (c$1 === 105) {
|
|
15423
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 110 || ctx.s.charCodeAt(++ctx.p) !== 102) TomlError.x("invalid value", ctx, startPtr);
|
|
15424
|
+
return ctx.p++, (sign || 1) / 0;
|
|
15425
|
+
}
|
|
15426
|
+
if (c$1 === 110) {
|
|
15427
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 110) TomlError.x("invalid value", ctx, startPtr);
|
|
15428
|
+
return ctx.p++, NaN;
|
|
15429
|
+
}
|
|
15430
|
+
if (c$1 === 48) {
|
|
15431
|
+
if (++ctx.p >= ctx.s.length || isEndOfValue(c$1 = ctx.s.charCodeAt(ctx.p), endChr)) return ctx.bi === true ? 0n : 0;
|
|
15432
|
+
if (!sign) {
|
|
15433
|
+
if (c$1 === 120) return parseIntegerBaseN(ctx, startPtr, 16, endChr);
|
|
15434
|
+
else if (c$1 === 98) return parseIntegerBaseN(ctx, startPtr, 2, endChr);
|
|
15435
|
+
else if (c$1 === 111) return parseIntegerBaseN(ctx, startPtr, 8, endChr);
|
|
15436
|
+
}
|
|
15437
|
+
if (c$1 === 46) state = 2;
|
|
15438
|
+
else if (c$1 === 101 || c$1 === 69) state = 4;
|
|
15439
|
+
else TomlError.x("illegal leading zero", ctx, startPtr);
|
|
15440
|
+
} else if (!isDigit2(c$1)) TomlError.x("invalid value", ctx, startPtr);
|
|
15441
|
+
while (++ctx.p < ctx.s.length && (c$1 = ctx.s.charCodeAt(ctx.p), !isEndOfValue(c$1, endChr))) {
|
|
15442
|
+
if (!state) state = 1;
|
|
15443
|
+
if (c$1 === 95) {
|
|
15444
|
+
if (!(state & 1)) TomlError.x("illegal underscore", ctx);
|
|
15445
|
+
state += 11;
|
|
15446
|
+
hasUnderscores = true;
|
|
15447
|
+
} else if (state === 1 && c$1 === 46) state = 2;
|
|
15448
|
+
else if ((state === 1 || state === 3) && (c$1 === 101 || c$1 === 69)) state = 4;
|
|
15449
|
+
else if (state === 4 && (c$1 === 43 || c$1 === 45));
|
|
15450
|
+
else if (!isDigit2(c$1)) TomlError.x(`illegal character in numeric literal`, ctx);
|
|
15451
|
+
else if (state > 9) state -= 11;
|
|
15452
|
+
else if (!(state & 1)) state++;
|
|
15453
|
+
}
|
|
15454
|
+
if (!state) {
|
|
15455
|
+
let val = (startChr - 48) * (sign || 1);
|
|
15456
|
+
return ctx.bi === true ? BigInt(val) : val;
|
|
15457
|
+
}
|
|
15458
|
+
if (!(state & 1)) TomlError.x("unfinished numeric value", ctx, startPtr);
|
|
15459
|
+
let str = ctx.s.slice(startPtr, ctx.p);
|
|
15460
|
+
if (hasUnderscores) str = str.replaceAll("_", "");
|
|
15461
|
+
return state > 1 ? parseFloat(str) : parseInteger(ctx, str, 10, startPtr);
|
|
15462
|
+
}
|
|
15463
|
+
__name$6(parseNumber, "parseNumber");
|
|
15464
|
+
function parseIntegerBaseN(ctx, startPtr, base, endChr) {
|
|
15465
|
+
let c$1, underscore = 1;
|
|
15466
|
+
while (++ctx.p < ctx.s.length && (c$1 = ctx.s.charCodeAt(ctx.p), !isEndOfValue(c$1, endChr))) if (c$1 === 95) {
|
|
15467
|
+
if (underscore & 1) TomlError.x("illegal underscore", ctx);
|
|
15468
|
+
underscore = 3;
|
|
15469
|
+
} else if (!isDigit2(c$1, base)) TomlError.x(`illegal character in numeric literal`, ctx);
|
|
15470
|
+
else if (underscore & 1) underscore--;
|
|
15471
|
+
if (underscore & 1) TomlError.x("unfinished numeric value", ctx);
|
|
15472
|
+
let str = ctx.s.slice(startPtr + 2, ctx.p);
|
|
15473
|
+
if (underscore) str = str.replaceAll("_", "");
|
|
15474
|
+
return parseInteger(ctx, str, base, startPtr);
|
|
15475
|
+
}
|
|
15476
|
+
__name$6(parseIntegerBaseN, "parseIntegerBaseN");
|
|
15477
|
+
function parseInteger(ctx, str, base, startPtr) {
|
|
15478
|
+
if (ctx.bi !== true) int: {
|
|
15479
|
+
let val = parseInt(str, base);
|
|
15480
|
+
if (!Number.isSafeInteger(val)) {
|
|
15481
|
+
if (ctx.bi) break int;
|
|
15482
|
+
TomlError.x("integer value cannot be represented losslessly", ctx, startPtr);
|
|
15483
|
+
}
|
|
15484
|
+
return val;
|
|
15485
|
+
}
|
|
15486
|
+
return base === 10 ? BigInt(str) : BigInt((base === 2 ? "0b" : base === 8 ? "0o" : "0x") + str);
|
|
15487
|
+
}
|
|
15488
|
+
__name$6(parseInteger, "parseInteger");
|
|
15489
|
+
function parseDate(ctx, c$1, endChr) {
|
|
15490
|
+
let startPtr = ctx.p++, unsafeSeparator;
|
|
15491
|
+
if (!isDigit2(c$1) || !isDigit2(ctx.s.charCodeAt(ctx.p++)) || !isDigit2(ctx.s.charCodeAt(ctx.p++)) || !isDigit2(ctx.s.charCodeAt(ctx.p++))) return parseNumber(ctx, ctx.p = startPtr, c$1, 0, endChr);
|
|
15492
|
+
ctx.p += 5;
|
|
15493
|
+
if (!isDigit2(ctx.s.charCodeAt(ctx.p++))) TomlError.x("invalid date-time: date part is malformed", ctx, startPtr);
|
|
15494
|
+
if (ctx.p >= ctx.s.length || ((c$1 = ctx.s.charCodeAt(ctx.p)) !== 32 || (unsafeSeparator = true, !isDigit2(ctx.s.charCodeAt(ctx.p + 1)))) && c$1 !== 84 && c$1 !== 116) return readDate(ctx, ctx.s.slice(startPtr, ctx.p), 3, false, startPtr);
|
|
15495
|
+
if (ctx.s.charCodeAt(ctx.p += 3) !== 58) TomlError.x("invalid date-time: time part is malformed", ctx, startPtr);
|
|
15496
|
+
if (ctx.s.charCodeAt(ctx.p += 3) === 58) ctx.p += 3;
|
|
15497
|
+
if (ctx.s.charCodeAt(ctx.p) === 46) while (isDigit2(ctx.s.charCodeAt(++ctx.p)));
|
|
15498
|
+
if (c$1 = ctx.s.charCodeAt(ctx.p)) {
|
|
15499
|
+
if (c$1 === 90 || c$1 === 122) return readDate(ctx, ctx.s.slice(startPtr, ++ctx.p), 1, unsafeSeparator, startPtr, "[+00:00]");
|
|
15500
|
+
if (c$1 === 43 || c$1 === 45) return readDate(ctx, ctx.s.slice(startPtr, ctx.p += 6), 1, unsafeSeparator, startPtr, !ctx.ld && "[" + ctx.s.slice(ctx.p - 6, ctx.p) + "]");
|
|
15501
|
+
}
|
|
15502
|
+
return readDate(ctx, ctx.s.slice(startPtr, ctx.p), 2, unsafeSeparator, startPtr);
|
|
15503
|
+
}
|
|
15504
|
+
__name$6(parseDate, "parseDate");
|
|
15505
|
+
function parseTime(ctx, c$1, endChr) {
|
|
15505
15506
|
let start = ctx.p;
|
|
15506
|
-
|
|
15507
|
+
if (!isDigit2(c$1) || !isDigit2(ctx.s.charCodeAt(++ctx.p))) return parseNumber(ctx, --ctx.p, c$1, 0, endChr);
|
|
15508
|
+
if (ctx.s.charCodeAt(ctx.p += 4) === 58) ctx.p += 3;
|
|
15509
|
+
if (ctx.s.charCodeAt(ctx.p) === 46) while (isDigit2(ctx.s.charCodeAt(++ctx.p)));
|
|
15510
|
+
return readDate(ctx, ctx.s.slice(start, ctx.p), 4, false, start);
|
|
15511
|
+
}
|
|
15512
|
+
__name$6(parseTime, "parseTime");
|
|
15513
|
+
function readDate(ctx, str, type, unsafeDelim, errPtr, temporalSuffix) {
|
|
15514
|
+
if (ctx.ld) {
|
|
15515
|
+
let date$3 = new TomlDate(str, type, unsafeDelim);
|
|
15516
|
+
if (!date$3.isValid()) TomlError.x("invalid date", ctx, errPtr);
|
|
15517
|
+
return date$3;
|
|
15518
|
+
}
|
|
15519
|
+
try {
|
|
15520
|
+
if (temporalSuffix) str += temporalSuffix;
|
|
15521
|
+
switch (type) {
|
|
15522
|
+
case 1: return Temporal.ZonedDateTime.from(str);
|
|
15523
|
+
case 2: return Temporal.PlainDateTime.from(str);
|
|
15524
|
+
case 3: return Temporal.PlainDate.from(str);
|
|
15525
|
+
case 4: return Temporal.PlainTime.from(str);
|
|
15526
|
+
}
|
|
15527
|
+
} catch (e) {
|
|
15528
|
+
TomlError.x(e instanceof Error ? e.message : "" + e, ctx, errPtr);
|
|
15529
|
+
}
|
|
15530
|
+
}
|
|
15531
|
+
__name$6(readDate, "readDate");
|
|
15532
|
+
function skipComment(ctx) {
|
|
15533
|
+
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
15534
|
+
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
15535
|
+
if (c$1 === 10) break;
|
|
15536
|
+
if (c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
|
|
15537
|
+
ctx.p++;
|
|
15538
|
+
break;
|
|
15539
|
+
}
|
|
15540
|
+
if (c$1 < 32 && c$1 !== 9 || c$1 === 127) TomlError.x("control characters are not allowed in comments", ctx);
|
|
15541
|
+
}
|
|
15542
|
+
}
|
|
15543
|
+
__name$6(skipComment, "skipComment");
|
|
15544
|
+
function skipVoid(ctx, banNewLines, banComments) {
|
|
15545
|
+
let c$1;
|
|
15546
|
+
while (ctx.p < ctx.s.length) {
|
|
15547
|
+
while (ctx.p < ctx.s.length && ((c$1 = ctx.s.charCodeAt(ctx.p)) === 32 || c$1 === 9 || !banNewLines && (c$1 === 10 || c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))) ctx.p++;
|
|
15548
|
+
if (banComments || c$1 !== 35) break;
|
|
15549
|
+
skipComment(ctx);
|
|
15550
|
+
}
|
|
15551
|
+
}
|
|
15552
|
+
__name$6(skipVoid, "skipVoid");
|
|
15553
|
+
function parseKey(ctx, end = 61) {
|
|
15554
|
+
let startPtr;
|
|
15555
|
+
let state = 0;
|
|
15507
15556
|
let parsed = [];
|
|
15508
|
-
let
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
|
-
|
|
15512
|
-
|
|
15513
|
-
|
|
15514
|
-
|
|
15515
|
-
|
|
15516
|
-
if (
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15525
|
-
|
|
15526
|
-
|
|
15527
|
-
|
|
15528
|
-
|
|
15529
|
-
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
|
|
15533
|
-
endPtr = ctx.s.indexOf(end, ctx.p);
|
|
15534
|
-
if (endPtr < 0) throw new TomlError$1("incomplete key-value: cannot find end of key", {
|
|
15535
|
-
toml: ctx.s,
|
|
15536
|
-
ptr: start
|
|
15537
|
-
});
|
|
15538
|
-
}
|
|
15539
|
-
parsed.push(part);
|
|
15540
|
-
} else {
|
|
15541
|
-
dot = ctx.s.indexOf(".", ctx.p);
|
|
15542
|
-
let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
15543
|
-
if (!KEY_PART_RE$1.test(part)) throw new TomlError$1("only letter, numbers, dashes and underscores are allowed in keys", {
|
|
15544
|
-
toml: ctx.s,
|
|
15545
|
-
ptr: ctx.p
|
|
15546
|
-
});
|
|
15547
|
-
parsed.push(part.trimEnd());
|
|
15557
|
+
let sliceStart;
|
|
15558
|
+
let c$1 = ctx.s.charCodeAt(startPtr = ctx.p);
|
|
15559
|
+
do
|
|
15560
|
+
if (c$1 === end) {
|
|
15561
|
+
if (!state) TomlError.x("unexpected end of key", ctx);
|
|
15562
|
+
if (state === 1) parsed.push(ctx.s.slice(sliceStart, ctx.p));
|
|
15563
|
+
return ctx.p++, parsed;
|
|
15564
|
+
} else if (c$1 === 46) {
|
|
15565
|
+
if (!state) TomlError.x("illegal empty bare key", ctx);
|
|
15566
|
+
if (state === 1) parsed.push(ctx.s.slice(sliceStart, ctx.p));
|
|
15567
|
+
state = 0;
|
|
15568
|
+
} else if (!state && (c$1 === 34 || c$1 === 39)) {
|
|
15569
|
+
if (c$1 === ctx.s.charCodeAt(ctx.p + 1) && c$1 === ctx.s.charCodeAt(ctx.p + 2)) TomlError.x("illegal quoted key: multiline strings are not allowed", ctx);
|
|
15570
|
+
parsed.push(parseString(ctx));
|
|
15571
|
+
state = 2;
|
|
15572
|
+
ctx.p--;
|
|
15573
|
+
} else if (c$1 === 32 || c$1 === 9) {
|
|
15574
|
+
if (state === 1) {
|
|
15575
|
+
parsed.push(ctx.s.slice(sliceStart, ctx.p));
|
|
15576
|
+
state = 2;
|
|
15577
|
+
}
|
|
15578
|
+
} else if (state === 2 || c$1 < 48 && c$1 !== 45 || c$1 > 57 && c$1 < 65 || c$1 > 90 && c$1 < 97 && c$1 !== 95 || c$1 > 122) TomlError.x("illegal character in key", ctx);
|
|
15579
|
+
else if (!state) {
|
|
15580
|
+
state = 1;
|
|
15581
|
+
sliceStart = ctx.p;
|
|
15548
15582
|
}
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
skipVoid$1(ctx, true, true);
|
|
15552
|
-
return parsed;
|
|
15583
|
+
while (c$1 = ctx.s.charCodeAt(++ctx.p));
|
|
15584
|
+
TomlError.x("incomplete key-value: cannot find end of key", ctx, startPtr);
|
|
15553
15585
|
}
|
|
15554
|
-
__name$6(parseKey
|
|
15555
|
-
function parseInlineTable
|
|
15556
|
-
let
|
|
15586
|
+
__name$6(parseKey, "parseKey");
|
|
15587
|
+
function parseInlineTable(ctx) {
|
|
15588
|
+
let startPtr = ctx.p++;
|
|
15589
|
+
let res = /* @__PURE__ */ Object.create(null);
|
|
15557
15590
|
let seen = /* @__PURE__ */ new Set();
|
|
15558
15591
|
let c$1;
|
|
15559
|
-
ctx.p++;
|
|
15560
15592
|
while (ctx.p < ctx.s.length) {
|
|
15561
|
-
skipVoid
|
|
15593
|
+
skipVoid(ctx);
|
|
15562
15594
|
if ((c$1 = ctx.s.charCodeAt(ctx.p)) === 125) {
|
|
15563
15595
|
ctx.p++;
|
|
15564
15596
|
return res;
|
|
@@ -15566,65 +15598,53 @@ function parseInlineTable$1(ctx, integersAsBigInt) {
|
|
|
15566
15598
|
let k;
|
|
15567
15599
|
let t$5 = res;
|
|
15568
15600
|
let hasOwn$1 = false;
|
|
15569
|
-
let
|
|
15570
|
-
let key = parseKey
|
|
15601
|
+
let errPtr = ctx.p;
|
|
15602
|
+
let key = parseKey(ctx);
|
|
15571
15603
|
for (let i$1 = 0; i$1 < key.length; i$1++) {
|
|
15572
|
-
if (i$1) t$5 = hasOwn$1 ? t$5[k] : t$5[k] =
|
|
15604
|
+
if (i$1) t$5 = hasOwn$1 ? t$5[k] : t$5[k] = /* @__PURE__ */ Object.create(null);
|
|
15573
15605
|
k = key[i$1];
|
|
15574
|
-
if ((hasOwn$1 = Object.hasOwn(t$5, k)) && (typeof t$5[k] !== "object" || seen.has(t$5[k])))
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
|
|
15606
|
+
if ((hasOwn$1 = Object.hasOwn(t$5, k)) && (typeof t$5[k] !== "object" || seen.has(t$5[k]))) TomlError.x("trying to redefine an already defined value", ctx, errPtr);
|
|
15607
|
+
let unsafe = k === "__proto__";
|
|
15608
|
+
if (ctx.uk && (unsafe || k === "constructor")) {
|
|
15609
|
+
t$5 = ctx.uk !== 1 && TomlError.x("document contains an unsafe property", ctx, errPtr);
|
|
15610
|
+
break;
|
|
15611
|
+
}
|
|
15612
|
+
if (!hasOwn$1 && unsafe) Object.defineProperty(t$5, k, {
|
|
15579
15613
|
enumerable: true,
|
|
15580
15614
|
configurable: true,
|
|
15581
15615
|
writable: true
|
|
15582
15616
|
});
|
|
15583
15617
|
}
|
|
15584
|
-
if (hasOwn$1)
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
seen.add(t$5[k] = value);
|
|
15590
|
-
skipVoid$1(ctx);
|
|
15618
|
+
if (hasOwn$1) TomlError.x("trying to redefine an already defined value", ctx, errPtr);
|
|
15619
|
+
skipVoid(ctx, true, true);
|
|
15620
|
+
let value = extractValue(ctx, 125);
|
|
15621
|
+
if (t$5 && typeof (t$5[k] = value) === "object") seen.add(value);
|
|
15622
|
+
skipVoid(ctx);
|
|
15591
15623
|
if ((c$1 = ctx.s.charCodeAt(ctx.p++)) === 125) return res;
|
|
15592
|
-
if (c$1 !== 44)
|
|
15593
|
-
toml: ctx.s,
|
|
15594
|
-
ptr: ctx.p - 1
|
|
15595
|
-
});
|
|
15624
|
+
if (c$1 !== 44) TomlError.x("expected comma or end of structure", ctx, ctx.p - 1);
|
|
15596
15625
|
}
|
|
15597
|
-
|
|
15598
|
-
toml: ctx.s,
|
|
15599
|
-
ptr: ctx.p
|
|
15600
|
-
});
|
|
15626
|
+
TomlError.x("unfinished table", ctx, startPtr);
|
|
15601
15627
|
}
|
|
15602
|
-
__name$6(parseInlineTable
|
|
15603
|
-
function parseArray
|
|
15628
|
+
__name$6(parseInlineTable, "parseInlineTable");
|
|
15629
|
+
function parseArray(ctx) {
|
|
15630
|
+
let startPtr = ctx.p++;
|
|
15604
15631
|
let res = [];
|
|
15605
15632
|
let c$1;
|
|
15606
|
-
ctx.p++;
|
|
15607
15633
|
while (ctx.p < ctx.s.length) {
|
|
15608
|
-
skipVoid
|
|
15634
|
+
skipVoid(ctx);
|
|
15609
15635
|
if ((c$1 = ctx.s.charCodeAt(ctx.p)) === 93) {
|
|
15610
15636
|
ctx.p++;
|
|
15611
15637
|
return res;
|
|
15612
15638
|
}
|
|
15613
|
-
res.push(extractValue
|
|
15614
|
-
skipVoid
|
|
15639
|
+
res.push(extractValue(ctx, 93));
|
|
15640
|
+
skipVoid(ctx);
|
|
15615
15641
|
if ((c$1 = ctx.s.charCodeAt(ctx.p++)) === 93) return res;
|
|
15616
|
-
if (c$1 !== 44)
|
|
15617
|
-
toml: ctx.s,
|
|
15618
|
-
ptr: ctx.p - 1
|
|
15619
|
-
});
|
|
15642
|
+
if (c$1 !== 44) TomlError.x("expected comma or end of structure", ctx, ctx.p - 1);
|
|
15620
15643
|
}
|
|
15621
|
-
|
|
15622
|
-
toml: ctx.s,
|
|
15623
|
-
ptr: ctx.p
|
|
15624
|
-
});
|
|
15644
|
+
TomlError.x("unfinished array", ctx, startPtr);
|
|
15625
15645
|
}
|
|
15626
|
-
__name$6(parseArray
|
|
15627
|
-
function peekTable
|
|
15646
|
+
__name$6(parseArray, "parseArray");
|
|
15647
|
+
function peekTable(ctx, key, table, meta$3, type) {
|
|
15628
15648
|
let t$5 = table;
|
|
15629
15649
|
let m = meta$3;
|
|
15630
15650
|
let k;
|
|
@@ -15632,7 +15652,7 @@ function peekTable$1(key, table, meta$3, type) {
|
|
|
15632
15652
|
let state;
|
|
15633
15653
|
for (let i$1 = 0; i$1 < key.length; i$1++) {
|
|
15634
15654
|
if (i$1) {
|
|
15635
|
-
t$5 = hasOwn$1 ? t$5[k] : t$5[k] =
|
|
15655
|
+
t$5 = hasOwn$1 ? t$5[k] : t$5[k] = /* @__PURE__ */ Object.create(null);
|
|
15636
15656
|
m = (state = m[k]).c;
|
|
15637
15657
|
if (type === 0 && (state.t === 1 || state.t === 2)) return null;
|
|
15638
15658
|
if (state.t === 2) {
|
|
@@ -15644,7 +15664,9 @@ function peekTable$1(key, table, meta$3, type) {
|
|
|
15644
15664
|
k = key[i$1];
|
|
15645
15665
|
if ((hasOwn$1 = Object.hasOwn(t$5, k)) && m[k]?.t === 0 && m[k]?.d) return null;
|
|
15646
15666
|
if (!hasOwn$1) {
|
|
15647
|
-
|
|
15667
|
+
let unsafe = k === "__proto__";
|
|
15668
|
+
if (ctx.uk && (unsafe || k === "constructor")) return false;
|
|
15669
|
+
if (unsafe) {
|
|
15648
15670
|
Object.defineProperty(t$5, k, {
|
|
15649
15671
|
enumerable: true,
|
|
15650
15672
|
configurable: true,
|
|
@@ -15660,7 +15682,7 @@ function peekTable$1(key, table, meta$3, type) {
|
|
|
15660
15682
|
t: i$1 < key.length - 1 && type === 2 ? 3 : type,
|
|
15661
15683
|
d: false,
|
|
15662
15684
|
i: 0,
|
|
15663
|
-
c:
|
|
15685
|
+
c: /* @__PURE__ */ Object.create(null)
|
|
15664
15686
|
};
|
|
15665
15687
|
}
|
|
15666
15688
|
}
|
|
@@ -15671,17 +15693,17 @@ function peekTable$1(key, table, meta$3, type) {
|
|
|
15671
15693
|
state.d = true;
|
|
15672
15694
|
t$5[k] = [];
|
|
15673
15695
|
}
|
|
15674
|
-
t$5[k].push(t$5 =
|
|
15696
|
+
t$5[k].push(t$5 = /* @__PURE__ */ Object.create(null));
|
|
15675
15697
|
state.c[state.i++] = state = {
|
|
15676
15698
|
t: 1,
|
|
15677
15699
|
d: false,
|
|
15678
15700
|
i: 0,
|
|
15679
|
-
c:
|
|
15701
|
+
c: /* @__PURE__ */ Object.create(null)
|
|
15680
15702
|
};
|
|
15681
15703
|
}
|
|
15682
15704
|
if (state.d) return null;
|
|
15683
15705
|
state.d = true;
|
|
15684
|
-
if (type === 1) t$5 = hasOwn$1 ? t$5[k] : t$5[k] =
|
|
15706
|
+
if (type === 1) t$5 = hasOwn$1 ? t$5[k] : t$5[k] = /* @__PURE__ */ Object.create(null);
|
|
15685
15707
|
else if (type === 0 && hasOwn$1) return null;
|
|
15686
15708
|
return [
|
|
15687
15709
|
k,
|
|
@@ -15689,64 +15711,76 @@ function peekTable$1(key, table, meta$3, type) {
|
|
|
15689
15711
|
state.c
|
|
15690
15712
|
];
|
|
15691
15713
|
}
|
|
15692
|
-
__name$6(peekTable
|
|
15693
|
-
function
|
|
15714
|
+
__name$6(peekTable, "peekTable");
|
|
15715
|
+
function validateTablePeek(ctx, peek, ptr) {
|
|
15716
|
+
if (peek === null || ctx.uk === 2) TomlError.x(peek === null ? "trying to redefine an already defined table or value" : "document contains an unsafe property", ctx, ptr);
|
|
15717
|
+
}
|
|
15718
|
+
__name$6(validateTablePeek, "validateTablePeek");
|
|
15719
|
+
function parse3(toml, options = {}) {
|
|
15694
15720
|
let ctx = {
|
|
15695
15721
|
s: toml,
|
|
15696
15722
|
p: 0,
|
|
15697
|
-
d: maxDepth
|
|
15723
|
+
d: options.maxDepth ?? 1e3,
|
|
15724
|
+
bi: options.integersAsBigInt ?? false,
|
|
15725
|
+
ld: options.useLegacyDate ?? true,
|
|
15726
|
+
uk: options.unsafeKeyBehaviour === "throw" ? 2 : options.unsafeKeyBehaviour === "drop" ? 1 : 0
|
|
15698
15727
|
};
|
|
15699
|
-
let res =
|
|
15700
|
-
let meta$3 =
|
|
15728
|
+
let res = /* @__PURE__ */ Object.create(null);
|
|
15729
|
+
let meta$3 = /* @__PURE__ */ Object.create(null);
|
|
15701
15730
|
let tmp;
|
|
15731
|
+
let skipping = false;
|
|
15702
15732
|
let tbl = res;
|
|
15703
15733
|
let m = meta$3;
|
|
15704
|
-
|
|
15734
|
+
if (toml.charCodeAt(0) === 65279) ctx.p++;
|
|
15735
|
+
skipVoid(ctx);
|
|
15705
15736
|
while (ctx.p < toml.length) {
|
|
15706
15737
|
if (toml.charCodeAt(ctx.p) === 91) {
|
|
15707
15738
|
let isTableArray = toml.charCodeAt(++ctx.p) === 91;
|
|
15708
15739
|
tmp = ctx.p += +isTableArray;
|
|
15709
|
-
|
|
15740
|
+
skipping = false;
|
|
15741
|
+
let k = parseKey(ctx, 93);
|
|
15710
15742
|
if (isTableArray) {
|
|
15711
|
-
if (toml.charCodeAt(ctx.p
|
|
15712
|
-
toml,
|
|
15713
|
-
ptr: ctx.p - 1
|
|
15714
|
-
});
|
|
15743
|
+
if (toml.charCodeAt(ctx.p) !== 93) TomlError.x("expected end of table array declaration", ctx);
|
|
15715
15744
|
ctx.p++;
|
|
15716
15745
|
}
|
|
15717
|
-
let p$2 = peekTable
|
|
15718
|
-
if (!p$2)
|
|
15719
|
-
|
|
15720
|
-
|
|
15721
|
-
}
|
|
15722
|
-
|
|
15723
|
-
|
|
15746
|
+
let p$2 = peekTable(ctx, k, res, meta$3, isTableArray ? 2 : 1);
|
|
15747
|
+
if (!p$2) {
|
|
15748
|
+
validateTablePeek(ctx, p$2, tmp);
|
|
15749
|
+
skipping = true;
|
|
15750
|
+
} else {
|
|
15751
|
+
m = p$2[2];
|
|
15752
|
+
tbl = p$2[1];
|
|
15753
|
+
}
|
|
15724
15754
|
} else {
|
|
15725
15755
|
tmp = ctx.p;
|
|
15726
|
-
let p$2 = peekTable
|
|
15727
|
-
if (!p$2
|
|
15728
|
-
|
|
15729
|
-
|
|
15730
|
-
|
|
15731
|
-
p$2[1][p$2[0]] = extractValue$1(ctx, void 0, integersAsBigInt);
|
|
15756
|
+
let p$2 = peekTable(ctx, parseKey(ctx), tbl, m, 0);
|
|
15757
|
+
if (!p$2 && !skipping) validateTablePeek(ctx, p$2, tmp);
|
|
15758
|
+
skipVoid(ctx, true, true);
|
|
15759
|
+
let v = extractValue(ctx, void 0);
|
|
15760
|
+
if (p$2 && !skipping) p$2[1][p$2[0]] = v;
|
|
15732
15761
|
}
|
|
15733
|
-
skipVoid
|
|
15734
|
-
if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13)
|
|
15735
|
-
|
|
15736
|
-
ptr: ctx.p
|
|
15737
|
-
});
|
|
15738
|
-
skipVoid$1(ctx);
|
|
15762
|
+
skipVoid(ctx, true);
|
|
15763
|
+
if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && (tmp !== 13 || toml.charCodeAt(ctx.p + 1) !== 10)) TomlError.x("each key-value declaration must be followed by an end-of-line", ctx);
|
|
15764
|
+
skipVoid(ctx);
|
|
15739
15765
|
}
|
|
15740
15766
|
return res;
|
|
15741
15767
|
}
|
|
15742
15768
|
__name$6(parse3, "parse");
|
|
15743
15769
|
var BARE_KEY$1 = /^[a-z0-9-_]+$/i;
|
|
15770
|
+
var HAS_WELLFORMED$1 = !!"".isWellFormed;
|
|
15744
15771
|
function extendedTypeOf$1(obj) {
|
|
15745
15772
|
let type = typeof obj;
|
|
15746
15773
|
if (type === "object") {
|
|
15747
15774
|
if (Array.isArray(obj)) return "array";
|
|
15748
|
-
if (typeof obj
|
|
15749
|
-
if (globalThis.Temporal
|
|
15775
|
+
if (typeof obj.getUTCDate === "function" && obj instanceof Date) return "date";
|
|
15776
|
+
if (globalThis.Temporal) {
|
|
15777
|
+
if (obj.until) {
|
|
15778
|
+
if (obj instanceof Temporal.ZonedDateTime) return "temporal/tz+uc";
|
|
15779
|
+
if (obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainDate) return "temporal/uc";
|
|
15780
|
+
if (obj instanceof Temporal.PlainTime || obj instanceof Temporal.Instant) return "temporal";
|
|
15781
|
+
if (obj instanceof Temporal.PlainYearMonth) return "temporal/x";
|
|
15782
|
+
} else if (obj.toPlainDate && obj instanceof Temporal.PlainMonthDay || obj.negated && obj instanceof Temporal.Duration) return "temporal/x";
|
|
15783
|
+
}
|
|
15750
15784
|
}
|
|
15751
15785
|
return type;
|
|
15752
15786
|
}
|
|
@@ -15756,18 +15790,21 @@ function isArrayOfTables$1(obj) {
|
|
|
15756
15790
|
return obj.length != 0;
|
|
15757
15791
|
}
|
|
15758
15792
|
__name$6(isArrayOfTables$1, "isArrayOfTables");
|
|
15793
|
+
function formatWellFormedStringUnchecked$1(s) {
|
|
15794
|
+
return JSON.stringify(s).replaceAll("", "\\u007f");
|
|
15795
|
+
}
|
|
15796
|
+
__name$6(formatWellFormedStringUnchecked$1, "formatWellFormedStringUnchecked");
|
|
15759
15797
|
function formatString$1(s) {
|
|
15760
|
-
return
|
|
15798
|
+
return formatWellFormedStringUnchecked$1(HAS_WELLFORMED$1 ? s.toWellFormed() : s);
|
|
15761
15799
|
}
|
|
15762
15800
|
__name$6(formatString$1, "formatString");
|
|
15763
|
-
function
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
});
|
|
15801
|
+
function formatKey$1(s) {
|
|
15802
|
+
if (BARE_KEY$1.test(s)) return s;
|
|
15803
|
+
if (HAS_WELLFORMED$1 && !s.isWellFormed()) throw new RangeError("key contains illegal lone surrogates");
|
|
15804
|
+
return formatWellFormedStringUnchecked$1(s);
|
|
15768
15805
|
}
|
|
15769
|
-
__name$6(
|
|
15770
|
-
function stringifyValue$1(val, type, depth$1, numberAsFloat) {
|
|
15806
|
+
__name$6(formatKey$1, "formatKey");
|
|
15807
|
+
function stringifyValue$1(val, type, depth$1, numberAsFloat, strictTemporal) {
|
|
15771
15808
|
if (depth$1 === 0) throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
15772
15809
|
switch (type) {
|
|
15773
15810
|
case "number":
|
|
@@ -15776,54 +15813,64 @@ function stringifyValue$1(val, type, depth$1, numberAsFloat) {
|
|
|
15776
15813
|
if (val === -Infinity) return "-inf";
|
|
15777
15814
|
if (Number.isInteger(val) && (numberAsFloat || !Number.isSafeInteger(val))) return val.toFixed(1);
|
|
15778
15815
|
case "bigint":
|
|
15779
|
-
case "boolean":
|
|
15816
|
+
case "boolean":
|
|
15817
|
+
case "temporal": return val.toString();
|
|
15780
15818
|
case "string": return formatString$1(val);
|
|
15781
15819
|
case "date":
|
|
15782
15820
|
if (isNaN(val.getTime())) throw new TypeError("cannot serialize invalid date");
|
|
15783
15821
|
return val.toISOString();
|
|
15784
|
-
case "object": return stringifyInlineTable$1(val, depth$1, numberAsFloat);
|
|
15785
|
-
case "array": return stringifyArray$1(val, depth$1, numberAsFloat);
|
|
15786
|
-
case "temporal":
|
|
15822
|
+
case "object": return stringifyInlineTable$1(val, depth$1, numberAsFloat, strictTemporal);
|
|
15823
|
+
case "array": return stringifyArray$1(val, depth$1, numberAsFloat, strictTemporal);
|
|
15824
|
+
case "temporal/tz+uc": if (strictTemporal) {
|
|
15825
|
+
let tz = val.timeZoneId;
|
|
15826
|
+
let tzc = tz.charCodeAt(0);
|
|
15827
|
+
if (tzc !== 43 && tzc !== 45 && (tzc !== 85 && tzc !== 71 && tzc !== 90 && tzc !== 69 || tz !== "UTC" && tz !== "UCT" && tz !== "Universal" && tz !== "Zulu" && !tz.startsWith("GMT") && tz !== "Greenwich" && !tz.startsWith("Etc/"))) throw new TypeError("Temporal objects with an IANA timezone are not allowed in Temporal strict mode");
|
|
15828
|
+
}
|
|
15829
|
+
case "temporal/uc":
|
|
15830
|
+
if (strictTemporal && val.calendarId !== "iso8601") throw new TypeError("Temporal objects with a non-default calendar are not allowed in Temporal strict mode");
|
|
15831
|
+
return val.toString({
|
|
15832
|
+
calendarName: "never",
|
|
15833
|
+
timeZoneName: "never"
|
|
15834
|
+
});
|
|
15835
|
+
case "temporal/x": throw new TypeError("Unsupported " + val[Symbol.toStringTag]);
|
|
15787
15836
|
}
|
|
15788
15837
|
}
|
|
15789
15838
|
__name$6(stringifyValue$1, "stringifyValue");
|
|
15790
|
-
function stringifyInlineTable$1(obj, depth$1, numberAsFloat) {
|
|
15839
|
+
function stringifyInlineTable$1(obj, depth$1, numberAsFloat, strictTemporal) {
|
|
15791
15840
|
let keys = Object.keys(obj);
|
|
15792
15841
|
if (keys.length === 0) return "{}";
|
|
15793
15842
|
let res = "{ ";
|
|
15794
15843
|
for (let i$1 = 0; i$1 < keys.length; i$1++) {
|
|
15795
15844
|
let k = keys[i$1];
|
|
15796
15845
|
if (i$1) res += ", ";
|
|
15797
|
-
res +=
|
|
15798
|
-
res += " = ";
|
|
15799
|
-
res += stringifyValue$1(obj[k], extendedTypeOf$1(obj[k]), depth$1 - 1, numberAsFloat);
|
|
15846
|
+
res += formatKey$1(k) + " = " + stringifyValue$1(obj[k], extendedTypeOf$1(obj[k]), depth$1 - 1, numberAsFloat, strictTemporal);
|
|
15800
15847
|
}
|
|
15801
15848
|
return res + " }";
|
|
15802
15849
|
}
|
|
15803
15850
|
__name$6(stringifyInlineTable$1, "stringifyInlineTable");
|
|
15804
|
-
function stringifyArray$1(array$2, depth$1, numberAsFloat) {
|
|
15851
|
+
function stringifyArray$1(array$2, depth$1, numberAsFloat, strictTemporal) {
|
|
15805
15852
|
if (array$2.length === 0) return "[]";
|
|
15806
15853
|
let res = "[ ";
|
|
15807
15854
|
for (let i$1 = 0; i$1 < array$2.length; i$1++) {
|
|
15808
15855
|
if (i$1) res += ", ";
|
|
15809
15856
|
if (array$2[i$1] === null || array$2[i$1] === void 0) throw new TypeError("arrays cannot contain null or undefined values");
|
|
15810
|
-
res += stringifyValue$1(array$2[i$1], extendedTypeOf$1(array$2[i$1]), depth$1 - 1, numberAsFloat);
|
|
15857
|
+
res += stringifyValue$1(array$2[i$1], extendedTypeOf$1(array$2[i$1]), depth$1 - 1, numberAsFloat, strictTemporal);
|
|
15811
15858
|
}
|
|
15812
15859
|
return res + " ]";
|
|
15813
15860
|
}
|
|
15814
15861
|
__name$6(stringifyArray$1, "stringifyArray");
|
|
15815
|
-
function stringifyArrayTable$1(array$2, key, depth$1, numberAsFloat) {
|
|
15862
|
+
function stringifyArrayTable$1(array$2, key, depth$1, numberAsFloat, strictTemporal) {
|
|
15816
15863
|
if (depth$1 === 0) throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
15817
15864
|
let res = "";
|
|
15818
15865
|
for (let i$1 = 0; i$1 < array$2.length; i$1++) {
|
|
15819
15866
|
res += `${res && "\n"}[[${key}]]
|
|
15820
15867
|
`;
|
|
15821
|
-
res += stringifyTable$1(0, array$2[i$1], key, depth$1, numberAsFloat);
|
|
15868
|
+
res += stringifyTable$1(0, array$2[i$1], key, depth$1, numberAsFloat, strictTemporal);
|
|
15822
15869
|
}
|
|
15823
15870
|
return res;
|
|
15824
15871
|
}
|
|
15825
15872
|
__name$6(stringifyArrayTable$1, "stringifyArrayTable");
|
|
15826
|
-
function stringifyTable$1(tableKey, obj, prefix, depth$1, numberAsFloat) {
|
|
15873
|
+
function stringifyTable$1(tableKey, obj, prefix, depth$1, numberAsFloat, strictTemporal) {
|
|
15827
15874
|
if (depth$1 === 0) throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
15828
15875
|
let preamble = "";
|
|
15829
15876
|
let tables = "";
|
|
@@ -15833,15 +15880,15 @@ function stringifyTable$1(tableKey, obj, prefix, depth$1, numberAsFloat) {
|
|
|
15833
15880
|
if (obj[k] !== null && obj[k] !== void 0) {
|
|
15834
15881
|
let type = extendedTypeOf$1(obj[k]);
|
|
15835
15882
|
if (type === "symbol" || type === "function") throw new TypeError(`cannot serialize values of type '${type}'`);
|
|
15836
|
-
let key =
|
|
15837
|
-
if (type === "array" && isArrayOfTables$1(obj[k])) tables += (tables && "\n") + stringifyArrayTable$1(obj[k], prefix ? `${prefix}.${key}` : key, depth$1 - 1, numberAsFloat);
|
|
15883
|
+
let key = formatKey$1(k);
|
|
15884
|
+
if (type === "array" && isArrayOfTables$1(obj[k])) tables += (tables && "\n") + stringifyArrayTable$1(obj[k], prefix ? `${prefix}.${key}` : key, depth$1 - 1, numberAsFloat, strictTemporal);
|
|
15838
15885
|
else if (type === "object") {
|
|
15839
15886
|
let tblKey = prefix ? `${prefix}.${key}` : key;
|
|
15840
|
-
tables += (tables && "\n") + stringifyTable$1(tblKey, obj[k], tblKey, depth$1 - 1, numberAsFloat);
|
|
15887
|
+
tables += (tables && "\n") + stringifyTable$1(tblKey, obj[k], tblKey, depth$1 - 1, numberAsFloat, strictTemporal);
|
|
15841
15888
|
} else {
|
|
15842
15889
|
preamble += key;
|
|
15843
15890
|
preamble += " = ";
|
|
15844
|
-
preamble += stringifyValue$1(obj[k], type, depth$1, numberAsFloat);
|
|
15891
|
+
preamble += stringifyValue$1(obj[k], type, depth$1, numberAsFloat, strictTemporal);
|
|
15845
15892
|
preamble += "\n";
|
|
15846
15893
|
}
|
|
15847
15894
|
}
|
|
@@ -15852,19 +15899,13 @@ ${preamble}` : `[${tableKey}]`;
|
|
|
15852
15899
|
${tables}` : preamble || tables;
|
|
15853
15900
|
}
|
|
15854
15901
|
__name$6(stringifyTable$1, "stringifyTable");
|
|
15855
|
-
function stringify$
|
|
15902
|
+
function stringify$1(obj, { maxDepth = 1e3, numbersAsFloat = false, strictTemporal = false } = {}) {
|
|
15856
15903
|
if (extendedTypeOf$1(obj) !== "object") throw new TypeError("stringify can only be called with an object");
|
|
15857
|
-
let str = stringifyTable$1(0, obj, "", maxDepth, numbersAsFloat);
|
|
15904
|
+
let str = stringifyTable$1(0, obj, "", maxDepth, numbersAsFloat, strictTemporal);
|
|
15858
15905
|
if (str[str.length - 1] !== "\n") return str + "\n";
|
|
15859
15906
|
return str;
|
|
15860
15907
|
}
|
|
15861
|
-
__name$6(stringify$
|
|
15862
|
-
var dist_default$3 = {
|
|
15863
|
-
parse: parse3,
|
|
15864
|
-
stringify: stringify$4,
|
|
15865
|
-
TomlDate: TomlDate$1,
|
|
15866
|
-
TomlError: TomlError$1
|
|
15867
|
-
};
|
|
15908
|
+
__name$6(stringify$1, "stringify");
|
|
15868
15909
|
var ParseError = class extends UserError {
|
|
15869
15910
|
static {
|
|
15870
15911
|
__name$6(this, "ParseError");
|
|
@@ -15931,9 +15972,9 @@ var APIError = class extends ParseError {
|
|
|
15931
15972
|
};
|
|
15932
15973
|
function parseTOML(tomlContent, filePath) {
|
|
15933
15974
|
try {
|
|
15934
|
-
return
|
|
15975
|
+
return parse3(tomlContent);
|
|
15935
15976
|
} catch (err) {
|
|
15936
|
-
if (!(err instanceof TomlError
|
|
15977
|
+
if (!(err instanceof TomlError)) throw err;
|
|
15937
15978
|
const location = {
|
|
15938
15979
|
lineText: tomlContent.split("\n")[err.line - 1],
|
|
15939
15980
|
line: err.line,
|
|
@@ -16313,14 +16354,14 @@ function configFileName(configPath) {
|
|
|
16313
16354
|
}
|
|
16314
16355
|
__name$6(configFileName, "configFileName");
|
|
16315
16356
|
function formatConfigSnippet(snippet, configPath, formatted = true) {
|
|
16316
|
-
if (configFormat(configPath) === "toml") return
|
|
16357
|
+
if (configFormat(configPath) === "toml") return stringify$1(snippet);
|
|
16317
16358
|
else return formatted ? JSON.stringify(snippet, null, 2) : JSON.stringify(snippet);
|
|
16318
16359
|
}
|
|
16319
16360
|
__name$6(formatConfigSnippet, "formatConfigSnippet");
|
|
16320
16361
|
|
|
16321
16362
|
//#endregion
|
|
16322
|
-
//#region ../workers-utils/dist/chunk-
|
|
16323
|
-
var DEFAULT_COMPAT_DATE = "2026-09-
|
|
16363
|
+
//#region ../workers-utils/dist/chunk-DKSA7K25.mjs
|
|
16364
|
+
var DEFAULT_COMPAT_DATE = "2026-09-23";
|
|
16324
16365
|
function assertNever(_value) {}
|
|
16325
16366
|
__name$6(assertNever, "assertNever");
|
|
16326
16367
|
function mapWorkerMetadataBindings(bindings) {
|
|
@@ -18370,7 +18411,7 @@ var require_util$5 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/un
|
|
|
18370
18411
|
const { IncomingMessage } = __require$3("node:http");
|
|
18371
18412
|
const stream$1 = __require$3("node:stream");
|
|
18372
18413
|
const net$4 = __require$3("node:net");
|
|
18373
|
-
const { stringify: stringify$
|
|
18414
|
+
const { stringify: stringify$4 } = __require$3("node:querystring");
|
|
18374
18415
|
const { EventEmitter: EE$3 } = __require$3("node:events");
|
|
18375
18416
|
const timers$1 = require_timers();
|
|
18376
18417
|
const { InvalidArgumentError: InvalidArgumentError$37, ConnectTimeoutError } = require_errors();
|
|
@@ -18445,7 +18486,7 @@ var require_util$5 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/un
|
|
|
18445
18486
|
*/
|
|
18446
18487
|
function serializePathWithQuery$4(url$2, queryParams) {
|
|
18447
18488
|
if (pathHasQueryOrFragment$1(url$2)) throw new Error("Query params cannot be passed when url already contains \"?\" or \"#\".");
|
|
18448
|
-
const stringified = stringify$
|
|
18489
|
+
const stringified = stringify$4(queryParams);
|
|
18449
18490
|
if (stringified) url$2 += "?" + stringified;
|
|
18450
18491
|
return url$2;
|
|
18451
18492
|
}
|
|
@@ -21271,7 +21312,7 @@ var require_data_url = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/
|
|
|
21271
21312
|
* @param {{ position: number }} position
|
|
21272
21313
|
* @param {boolean} [extractValue=false]
|
|
21273
21314
|
*/
|
|
21274
|
-
function collectAnHTTPQuotedString$1(input, position, extractValue$
|
|
21315
|
+
function collectAnHTTPQuotedString$1(input, position, extractValue$1 = false) {
|
|
21275
21316
|
const positionStart = position.position;
|
|
21276
21317
|
let value = "";
|
|
21277
21318
|
assert$30(input[position.position] === "\"");
|
|
@@ -21293,7 +21334,7 @@ var require_data_url = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/
|
|
|
21293
21334
|
break;
|
|
21294
21335
|
}
|
|
21295
21336
|
}
|
|
21296
|
-
if (extractValue$
|
|
21337
|
+
if (extractValue$1) return value;
|
|
21297
21338
|
return input.slice(positionStart, position.position);
|
|
21298
21339
|
}
|
|
21299
21340
|
/**
|
|
@@ -36521,7 +36562,7 @@ var require_util$2 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/un
|
|
|
36521
36562
|
* @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
|
|
36522
36563
|
* @param {import('./index').Cookie} cookie
|
|
36523
36564
|
*/
|
|
36524
|
-
function stringify$
|
|
36565
|
+
function stringify$3(cookie) {
|
|
36525
36566
|
if (cookie.name.length === 0) return null;
|
|
36526
36567
|
validateCookieName(cookie.name);
|
|
36527
36568
|
validateCookieValue(cookie.value);
|
|
@@ -36565,7 +36606,7 @@ var require_util$2 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/un
|
|
|
36565
36606
|
validateCookiePath,
|
|
36566
36607
|
validateCookieValue,
|
|
36567
36608
|
toIMFDate,
|
|
36568
|
-
stringify: stringify$
|
|
36609
|
+
stringify: stringify$3
|
|
36569
36610
|
};
|
|
36570
36611
|
}) });
|
|
36571
36612
|
|
|
@@ -36676,7 +36717,7 @@ var require_parse$2 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/u
|
|
|
36676
36717
|
//#region ../../node_modules/.pnpm/undici@7.29.0/node_modules/undici/lib/web/cookies/index.js
|
|
36677
36718
|
var require_cookies = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/undici@7.29.0/node_modules/undici/lib/web/cookies/index.js": ((exports, module) => {
|
|
36678
36719
|
const { parseSetCookie } = require_parse$2();
|
|
36679
|
-
const { stringify: stringify$
|
|
36720
|
+
const { stringify: stringify$2 } = require_util$2();
|
|
36680
36721
|
const { webidl: webidl$5 } = require_webidl();
|
|
36681
36722
|
const { Headers: Headers$3 } = require_headers();
|
|
36682
36723
|
const brandChecks = webidl$5.brandCheckMultiple([Headers$3, globalThis.Headers].filter(Boolean));
|
|
@@ -36757,7 +36798,7 @@ var require_cookies = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/u
|
|
|
36757
36798
|
webidl$5.argumentLengthCheck(arguments, 2, "setCookie");
|
|
36758
36799
|
brandChecks(headers);
|
|
36759
36800
|
cookie = webidl$5.converters.Cookie(cookie);
|
|
36760
|
-
const str = stringify$
|
|
36801
|
+
const str = stringify$2(cookie);
|
|
36761
36802
|
if (str) headers.append("set-cookie", str, true);
|
|
36762
36803
|
}
|
|
36763
36804
|
webidl$5.converters.DeleteCookieAttributes = webidl$5.dictionaryConverter([{
|
|
@@ -40337,7 +40378,7 @@ var require_utils$1 = __commonJS$2({ "../../node_modules/.pnpm/rc@1.2.8/node_mod
|
|
|
40337
40378
|
var ini = require_ini();
|
|
40338
40379
|
var path6 = __require$2("path");
|
|
40339
40380
|
var stripJsonComments = require_strip_json_comments();
|
|
40340
|
-
var parse$
|
|
40381
|
+
var parse$13 = exports$1.parse = function(content) {
|
|
40341
40382
|
if (/^\s*{/.test(content)) return JSON.parse(stripJsonComments(content));
|
|
40342
40383
|
return ini.parse(content);
|
|
40343
40384
|
};
|
|
@@ -40355,7 +40396,7 @@ var require_utils$1 = __commonJS$2({ "../../node_modules/.pnpm/rc@1.2.8/node_mod
|
|
|
40355
40396
|
};
|
|
40356
40397
|
exports$1.json = function() {
|
|
40357
40398
|
var content = file$2.apply(null, arguments);
|
|
40358
|
-
return content ? parse$
|
|
40399
|
+
return content ? parse$13(content) : null;
|
|
40359
40400
|
};
|
|
40360
40401
|
exports$1.env = function(prefix, env2) {
|
|
40361
40402
|
env2 = env2 || process.env;
|
|
@@ -40635,11 +40676,11 @@ var require_rc = __commonJS$2({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/
|
|
|
40635
40676
|
var etc = "/etc";
|
|
40636
40677
|
var win = process.platform === "win32";
|
|
40637
40678
|
var home = win ? process.env.USERPROFILE : process.env.HOME;
|
|
40638
|
-
module$1.exports = function(name, defaults, argv$1, parse$
|
|
40679
|
+
module$1.exports = function(name, defaults, argv$1, parse$13) {
|
|
40639
40680
|
if ("string" !== typeof name) throw new Error("rc(name): name *must* be string");
|
|
40640
40681
|
if (!argv$1) argv$1 = require_minimist()(process.argv.slice(2));
|
|
40641
40682
|
defaults = ("string" === typeof defaults ? cc.json(defaults) : defaults) || {};
|
|
40642
|
-
parse$
|
|
40683
|
+
parse$13 = parse$13 || cc.parse;
|
|
40643
40684
|
var env$3 = cc.env(name + "_");
|
|
40644
40685
|
var configs = [defaults];
|
|
40645
40686
|
var configFiles = [];
|
|
@@ -40647,7 +40688,7 @@ var require_rc = __commonJS$2({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/
|
|
|
40647
40688
|
if (configFiles.indexOf(file$2) >= 0) return;
|
|
40648
40689
|
var fileConfig = cc.file(file$2);
|
|
40649
40690
|
if (fileConfig) {
|
|
40650
|
-
configs.push(parse$
|
|
40691
|
+
configs.push(parse$13(fileConfig));
|
|
40651
40692
|
configFiles.push(file$2);
|
|
40652
40693
|
}
|
|
40653
40694
|
}
|
|
@@ -42644,6 +42685,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
42644
42685
|
};
|
|
42645
42686
|
warnIfDurableObjectsHaveNoLifecycleConfig(diagnostics, environment.durable_objects, environment.migrations, environment.exports, configPath);
|
|
42646
42687
|
errorIfMigrationsAndExportsBothSet(diagnostics, environment.migrations, environment.exports);
|
|
42688
|
+
validateWorkflowExportConflicts(diagnostics, environment.exports);
|
|
42647
42689
|
const containersDeclaredElsewhere = rawConfig !== void 0 ? rawConfig.containers !== void 0 : Object.values("env" in rawEnv ? rawEnv.env ?? {} : {}).some((rawNamedEnv) => rawNamedEnv?.containers !== void 0);
|
|
42648
42690
|
validateContainerExportLinks(diagnostics, environment.containers, environment.exports, containersDeclaredElsewhere);
|
|
42649
42691
|
if (envName !== "top level") validateAdditionalProperties(diagnostics, "env." + envName, Object.keys(rawEnv), Object.keys(environment));
|
|
@@ -42922,14 +42964,93 @@ var validateDurableObjectBinding = /* @__PURE__ */ __name$6((diagnostics, field,
|
|
|
42922
42964
|
return isValid;
|
|
42923
42965
|
}, "validateDurableObjectBinding");
|
|
42924
42966
|
var workflowNameFormatMessage = `Workflow names must be 1-64 characters long, start with a letter, number, or underscore, and may only contain letters, numbers, underscores, or hyphens.`;
|
|
42925
|
-
function validateWorkflowRetentionValue(diagnostics, field, key, value) {
|
|
42967
|
+
function validateWorkflowRetentionValue(diagnostics, field, kind, key, value) {
|
|
42926
42968
|
const isValidNumber = typeof value === "number" && Number.isInteger(value) && value > 0;
|
|
42927
42969
|
const isValidString = typeof value === "string" && value.length > 0;
|
|
42928
42970
|
if (isValidNumber || isValidString) return true;
|
|
42929
|
-
diagnostics.errors.push(`"${field}"
|
|
42971
|
+
diagnostics.errors.push(`"${field}" ${kind} "default_retention.${key}" field must be a positive integer of milliseconds or a duration string such as "3 days", but got ${JSON.stringify(value)}.`);
|
|
42930
42972
|
return false;
|
|
42931
42973
|
}
|
|
42932
42974
|
__name$6(validateWorkflowRetentionValue, "validateWorkflowRetentionValue");
|
|
42975
|
+
function validateWorkflowSchedules(diagnostics, field, kind, value) {
|
|
42976
|
+
const { schedules } = value;
|
|
42977
|
+
if (schedules === void 0) return true;
|
|
42978
|
+
if (typeof schedules === "string") {
|
|
42979
|
+
if (schedules.length === 0) {
|
|
42980
|
+
diagnostics.errors.push(`"${field}" ${kind} "schedules" field must not be an empty string.`);
|
|
42981
|
+
return false;
|
|
42982
|
+
}
|
|
42983
|
+
return true;
|
|
42984
|
+
}
|
|
42985
|
+
if (Array.isArray(schedules)) {
|
|
42986
|
+
if (schedules.length === 0) {
|
|
42987
|
+
diagnostics.errors.push(`"${field}" ${kind} "schedules" field must not be an empty array.`);
|
|
42988
|
+
return false;
|
|
42989
|
+
}
|
|
42990
|
+
if (!schedules.every((s) => typeof s === "string")) {
|
|
42991
|
+
diagnostics.errors.push(`"${field}" ${kind} should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(value)}.`);
|
|
42992
|
+
return false;
|
|
42993
|
+
}
|
|
42994
|
+
if (schedules.some((s) => s === "")) {
|
|
42995
|
+
diagnostics.errors.push(`"${field}" ${kind} "schedules" field must not contain empty strings.`);
|
|
42996
|
+
return false;
|
|
42997
|
+
}
|
|
42998
|
+
return true;
|
|
42999
|
+
}
|
|
43000
|
+
diagnostics.errors.push(`"${field}" ${kind} should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(value)}.`);
|
|
43001
|
+
return false;
|
|
43002
|
+
}
|
|
43003
|
+
__name$6(validateWorkflowSchedules, "validateWorkflowSchedules");
|
|
43004
|
+
function validateWorkflowLimits(diagnostics, field, kind, value) {
|
|
43005
|
+
const { limits } = value;
|
|
43006
|
+
if (limits === void 0) return true;
|
|
43007
|
+
if (typeof limits !== "object" || limits === null || Array.isArray(limits)) {
|
|
43008
|
+
diagnostics.errors.push(`"${field}" ${kind} should, optionally, have an object "limits" field but got ${JSON.stringify(value)}.`);
|
|
43009
|
+
return false;
|
|
43010
|
+
}
|
|
43011
|
+
let valid$2 = true;
|
|
43012
|
+
const { steps } = limits;
|
|
43013
|
+
if (steps !== void 0) {
|
|
43014
|
+
if (typeof steps !== "number" || !Number.isInteger(steps) || steps < 1) {
|
|
43015
|
+
diagnostics.errors.push(`"${field}" ${kind} "limits.steps" field must be a positive integer but got ${JSON.stringify(steps)}.`);
|
|
43016
|
+
valid$2 = false;
|
|
43017
|
+
} else if (steps > 25e3) diagnostics.warnings.push(`"${field}" has a step limit of ${steps}, which exceeds the production maximum of 25,000. This configuration may not work when deployed.`);
|
|
43018
|
+
}
|
|
43019
|
+
validateAdditionalProperties(diagnostics, `${field}.limits`, Object.keys(limits), ["steps"]);
|
|
43020
|
+
return valid$2;
|
|
43021
|
+
}
|
|
43022
|
+
__name$6(validateWorkflowLimits, "validateWorkflowLimits");
|
|
43023
|
+
function validateWorkflowDefaultRetention(diagnostics, field, kind, value) {
|
|
43024
|
+
const { default_retention: defaultRetention } = value;
|
|
43025
|
+
if (defaultRetention === void 0) return true;
|
|
43026
|
+
if (typeof defaultRetention !== "object" || defaultRetention === null || Array.isArray(defaultRetention)) {
|
|
43027
|
+
diagnostics.errors.push(`"${field}" ${kind} should, optionally, have an object "default_retention" field but got ${JSON.stringify(value)}.`);
|
|
43028
|
+
return false;
|
|
43029
|
+
}
|
|
43030
|
+
let valid$2 = true;
|
|
43031
|
+
const retention = defaultRetention;
|
|
43032
|
+
for (const key of ["success_retention", "error_retention"]) if (retention[key] !== void 0 && !validateWorkflowRetentionValue(diagnostics, field, kind, key, retention[key])) valid$2 = false;
|
|
43033
|
+
validateAdditionalProperties(diagnostics, `${field}.default_retention`, Object.keys(retention), ["success_retention", "error_retention"]);
|
|
43034
|
+
return valid$2;
|
|
43035
|
+
}
|
|
43036
|
+
__name$6(validateWorkflowDefaultRetention, "validateWorkflowDefaultRetention");
|
|
43037
|
+
function validateWorkflowConcurrency(diagnostics, field, kind, value) {
|
|
43038
|
+
const { concurrency } = value;
|
|
43039
|
+
if (concurrency === void 0) return true;
|
|
43040
|
+
if (typeof concurrency !== "object" || concurrency === null || Array.isArray(concurrency)) {
|
|
43041
|
+
diagnostics.errors.push(`"${field}" ${kind} should, optionally, have an object "concurrency" field but got ${JSON.stringify(value)}.`);
|
|
43042
|
+
return false;
|
|
43043
|
+
}
|
|
43044
|
+
let valid$2 = true;
|
|
43045
|
+
const { limit } = concurrency;
|
|
43046
|
+
if (limit !== void 0 && (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1)) {
|
|
43047
|
+
diagnostics.errors.push(`"${field}" ${kind} "concurrency.limit" field must be a positive integer but got ${JSON.stringify(limit)}.`);
|
|
43048
|
+
valid$2 = false;
|
|
43049
|
+
}
|
|
43050
|
+
validateAdditionalProperties(diagnostics, `${field}.concurrency`, Object.keys(concurrency), ["limit"]);
|
|
43051
|
+
return valid$2;
|
|
43052
|
+
}
|
|
43053
|
+
__name$6(validateWorkflowConcurrency, "validateWorkflowConcurrency");
|
|
42933
43054
|
var validateWorkflowBinding = /* @__PURE__ */ __name$6((diagnostics, field, value) => {
|
|
42934
43055
|
if (typeof value !== "object" || value === null) {
|
|
42935
43056
|
diagnostics.errors.push(`"workflows" bindings should be objects, but got ${JSON.stringify(value)}`);
|
|
@@ -42955,58 +43076,11 @@ var validateWorkflowBinding = /* @__PURE__ */ __name$6((diagnostics, field, valu
|
|
|
42955
43076
|
diagnostics.errors.push(`"${field}" bindings should, optionally, have a string "script_name" field but got ${JSON.stringify(value)}.`);
|
|
42956
43077
|
isValid = false;
|
|
42957
43078
|
}
|
|
42958
|
-
|
|
42959
|
-
|
|
42960
|
-
|
|
42961
|
-
|
|
42962
|
-
|
|
42963
|
-
} else if (Array.isArray(value.schedules)) {
|
|
42964
|
-
if (value.schedules.length === 0) {
|
|
42965
|
-
diagnostics.errors.push(`"${field}" bindings "schedules" field must not be an empty array.`);
|
|
42966
|
-
isValid = false;
|
|
42967
|
-
} else if (!value.schedules.every((s) => typeof s === "string")) {
|
|
42968
|
-
diagnostics.errors.push(`"${field}" bindings should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(value)}.`);
|
|
42969
|
-
isValid = false;
|
|
42970
|
-
} else if (value.schedules.some((s) => s === "")) {
|
|
42971
|
-
diagnostics.errors.push(`"${field}" bindings "schedules" field must not contain empty strings.`);
|
|
42972
|
-
isValid = false;
|
|
42973
|
-
}
|
|
42974
|
-
} else {
|
|
42975
|
-
diagnostics.errors.push(`"${field}" bindings should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(value)}.`);
|
|
42976
|
-
isValid = false;
|
|
42977
|
-
}
|
|
42978
|
-
if (hasProperty(value, "limits") && value.limits !== void 0) if (typeof value.limits !== "object" || value.limits === null || Array.isArray(value.limits)) {
|
|
42979
|
-
diagnostics.errors.push(`"${field}" bindings should, optionally, have an object "limits" field but got ${JSON.stringify(value)}.`);
|
|
42980
|
-
isValid = false;
|
|
42981
|
-
} else {
|
|
42982
|
-
const limits = value.limits;
|
|
42983
|
-
if (limits.steps !== void 0) {
|
|
42984
|
-
if (typeof limits.steps !== "number" || !Number.isInteger(limits.steps) || limits.steps < 1) {
|
|
42985
|
-
diagnostics.errors.push(`"${field}" bindings "limits.steps" field must be a positive integer but got ${JSON.stringify(limits.steps)}.`);
|
|
42986
|
-
isValid = false;
|
|
42987
|
-
} else if (limits.steps > 25e3) diagnostics.warnings.push(`"${field}" has a step limit of ${limits.steps}, which exceeds the production maximum of 25,000. This configuration may not work when deployed.`);
|
|
42988
|
-
}
|
|
42989
|
-
validateAdditionalProperties(diagnostics, `${field}.limits`, Object.keys(limits), ["steps"]);
|
|
42990
|
-
}
|
|
42991
|
-
if (hasProperty(value, "default_retention") && value.default_retention !== void 0) if (typeof value.default_retention !== "object" || value.default_retention === null || Array.isArray(value.default_retention)) {
|
|
42992
|
-
diagnostics.errors.push(`"${field}" bindings should, optionally, have an object "default_retention" field but got ${JSON.stringify(value)}.`);
|
|
42993
|
-
isValid = false;
|
|
42994
|
-
} else {
|
|
42995
|
-
const defaultRetention = value.default_retention;
|
|
42996
|
-
for (const key of ["success_retention", "error_retention"]) if (defaultRetention[key] !== void 0 && !validateWorkflowRetentionValue(diagnostics, field, key, defaultRetention[key])) isValid = false;
|
|
42997
|
-
validateAdditionalProperties(diagnostics, `${field}.default_retention`, Object.keys(defaultRetention), ["success_retention", "error_retention"]);
|
|
42998
|
-
}
|
|
42999
|
-
if (hasProperty(value, "concurrency") && value.concurrency !== void 0) if (typeof value.concurrency !== "object" || value.concurrency === null || Array.isArray(value.concurrency)) {
|
|
43000
|
-
diagnostics.errors.push(`"${field}" bindings should, optionally, have an object "concurrency" field but got ${JSON.stringify(value)}.`);
|
|
43001
|
-
isValid = false;
|
|
43002
|
-
} else {
|
|
43003
|
-
const concurrency = value.concurrency;
|
|
43004
|
-
if (concurrency.limit !== void 0 && (typeof concurrency.limit !== "number" || !Number.isInteger(concurrency.limit) || concurrency.limit < 1)) {
|
|
43005
|
-
diagnostics.errors.push(`"${field}" bindings "concurrency.limit" field must be a positive integer but got ${JSON.stringify(concurrency.limit)}.`);
|
|
43006
|
-
isValid = false;
|
|
43007
|
-
}
|
|
43008
|
-
validateAdditionalProperties(diagnostics, `${field}.concurrency`, Object.keys(concurrency), ["limit"]);
|
|
43009
|
-
}
|
|
43079
|
+
const settings = value;
|
|
43080
|
+
isValid = validateWorkflowSchedules(diagnostics, field, "bindings", settings) && isValid;
|
|
43081
|
+
isValid = validateWorkflowLimits(diagnostics, field, "bindings", settings) && isValid;
|
|
43082
|
+
isValid = validateWorkflowDefaultRetention(diagnostics, field, "bindings", settings) && isValid;
|
|
43083
|
+
isValid = validateWorkflowConcurrency(diagnostics, field, "bindings", settings) && isValid;
|
|
43010
43084
|
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
43011
43085
|
"binding",
|
|
43012
43086
|
"name",
|
|
@@ -43207,6 +43281,13 @@ function validateSshPublicKeys(diagnostics, field, value, nameRequired) {
|
|
|
43207
43281
|
}
|
|
43208
43282
|
}
|
|
43209
43283
|
__name$6(validateSshPublicKeys, "validateSshPublicKeys");
|
|
43284
|
+
function validateContainerSshConfig(diagnostics, field, value) {
|
|
43285
|
+
const sshConfig = typeof value === "object" && value !== null ? value : {};
|
|
43286
|
+
if (!isRequiredProperty(sshConfig, "enabled", "boolean")) diagnostics.errors.push(`${field}.enabled must be a boolean`);
|
|
43287
|
+
const port = "port" in sshConfig ? sshConfig.port : void 0;
|
|
43288
|
+
if (!isOptionalProperty(sshConfig, "port", "number") || typeof port === "number" && (!Number.isInteger(port) || port < 1 || port > 65535)) diagnostics.errors.push(`${field}.port must be a number between 1 and 65535 inclusive`);
|
|
43289
|
+
}
|
|
43290
|
+
__name$6(validateContainerSshConfig, "validateContainerSshConfig");
|
|
43210
43291
|
function validatePreviewsContainers(envName, configPath) {
|
|
43211
43292
|
const innerValidator = validateContainerApp(envName, void 0, configPath, { generateDefaultName: false });
|
|
43212
43293
|
return (diagnostics, field, value, config$2) => {
|
|
@@ -43358,9 +43439,13 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
|
43358
43439
|
"scheduling_policy",
|
|
43359
43440
|
"images",
|
|
43360
43441
|
"observability",
|
|
43442
|
+
"ssh",
|
|
43443
|
+
"authorized_keys",
|
|
43361
43444
|
"unsafe"
|
|
43362
43445
|
].includes(key));
|
|
43363
|
-
if (unsupportedFields.length > 0) diagnostics.errors.push(`Unsupported fields for Durable Object-managed Containers in ${field}: ${unsupportedFields.map((key) => `"${key}"`).join(",")}. Only "name", "class_name", "scheduling_policy", "images", "observability", and restricted "unsafe" settings are supported.`);
|
|
43446
|
+
if (unsupportedFields.length > 0) diagnostics.errors.push(`Unsupported fields for Durable Object-managed Containers in ${field}: ${unsupportedFields.map((key) => `"${key}"`).join(",")}. Only "name", "class_name", "scheduling_policy", "images", "observability", "ssh", "authorized_keys", and restricted "unsafe" settings are supported.`);
|
|
43447
|
+
if ("ssh" in containerAppOptional) validateContainerSshConfig(diagnostics, `${field}.ssh`, containerAppOptional.ssh);
|
|
43448
|
+
if ("authorized_keys" in containerAppOptional) validateSshPublicKeys(diagnostics, `${field}.authorized_keys`, containerAppOptional.authorized_keys, true);
|
|
43364
43449
|
continue;
|
|
43365
43450
|
}
|
|
43366
43451
|
if (!containerAppOptional.configuration?.image && !containerAppOptional.image) diagnostics.errors.push(`"containers.image" field must be defined for each container app. This should be the path to your Dockerfile or an image URI pointing to the Cloudflare registry.`);
|
|
@@ -43471,23 +43556,11 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
|
43471
43556
|
"vcpu",
|
|
43472
43557
|
"memory_mib"
|
|
43473
43558
|
]);
|
|
43474
|
-
let sshField;
|
|
43475
|
-
let sshConfig;
|
|
43476
43559
|
if ("ssh" in containerAppOptional) {
|
|
43477
|
-
|
|
43478
|
-
sshConfig = containerAppOptional.ssh;
|
|
43560
|
+
validateContainerSshConfig(diagnostics, `${field}.ssh`, containerAppOptional.ssh);
|
|
43479
43561
|
containerAppOptional.wrangler_ssh = containerAppOptional.ssh;
|
|
43480
43562
|
delete containerAppOptional.ssh;
|
|
43481
|
-
} else if ("wrangler_ssh" in containerAppOptional) {
|
|
43482
|
-
sshField = "wrangler_ssh";
|
|
43483
|
-
sshConfig = containerAppOptional.wrangler_ssh;
|
|
43484
|
-
}
|
|
43485
|
-
if (sshField !== void 0) {
|
|
43486
|
-
const sshConfigObject = typeof sshConfig === "object" && sshConfig !== null ? sshConfig : {};
|
|
43487
|
-
if (!isRequiredProperty(sshConfigObject, "enabled", "boolean")) diagnostics.errors.push(`${field}.${sshField}.enabled must be a boolean`);
|
|
43488
|
-
const sshPort = "port" in sshConfigObject ? sshConfigObject.port : void 0;
|
|
43489
|
-
if (!isOptionalProperty(sshConfigObject, "port", "number") || typeof sshPort === "number" && (sshPort < 1 || sshPort > 65535)) diagnostics.errors.push(`${field}.${sshField}.port must be a number between 1 and 65535 inclusive`);
|
|
43490
|
-
}
|
|
43563
|
+
} else if ("wrangler_ssh" in containerAppOptional) validateContainerSshConfig(diagnostics, `${field}.wrangler_ssh`, containerAppOptional.wrangler_ssh);
|
|
43491
43564
|
if ("authorized_keys" in containerAppOptional) validateSshPublicKeys(diagnostics, `${field}.authorized_keys`, containerAppOptional.authorized_keys, true);
|
|
43492
43565
|
if ("trusted_user_ca_keys" in containerAppOptional) validateSshPublicKeys(diagnostics, `${field}.trusted_user_ca_keys`, containerAppOptional.trusted_user_ca_keys, false);
|
|
43493
43566
|
if (validateOptionalProperty(diagnostics, field, "constraints", containerAppOptional.constraints, "object") && containerAppOptional.constraints) {
|
|
@@ -44205,16 +44278,23 @@ var validateConnectHandler = /* @__PURE__ */ __name$6((diagnostics, field, value
|
|
|
44205
44278
|
return false;
|
|
44206
44279
|
}
|
|
44207
44280
|
let isValid = true;
|
|
44208
|
-
|
|
44281
|
+
const connectHandler = value;
|
|
44282
|
+
if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), connectHandler.protocol === "udp" ? [
|
|
44283
|
+
"protocol",
|
|
44284
|
+
"port",
|
|
44285
|
+
"address",
|
|
44286
|
+
"idle_timeout_ms",
|
|
44287
|
+
"max_pending_bytes"
|
|
44288
|
+
] : [
|
|
44209
44289
|
"protocol",
|
|
44210
44290
|
"port",
|
|
44211
44291
|
"address"
|
|
44212
44292
|
])) isValid = false;
|
|
44213
|
-
if ("protocol" in value && value.protocol !== "tcp") {
|
|
44214
|
-
diagnostics.errors.push(`"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(value.protocol)}.`);
|
|
44293
|
+
if ("protocol" in value && value.protocol !== "tcp" && value.protocol !== "udp") {
|
|
44294
|
+
diagnostics.errors.push(`"${field}" should have a "protocol" field of "tcp" or "udp" but got ${JSON.stringify(value.protocol)}.`);
|
|
44215
44295
|
isValid = false;
|
|
44216
44296
|
} else if (!("protocol" in value)) {
|
|
44217
|
-
diagnostics.errors.push(`"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(value)}.`);
|
|
44297
|
+
diagnostics.errors.push(`"${field}" should have a "protocol" field of "tcp" or "udp" but got ${JSON.stringify(value)}.`);
|
|
44218
44298
|
isValid = false;
|
|
44219
44299
|
}
|
|
44220
44300
|
if (!isRequiredProperty(value, "port", "number")) {
|
|
@@ -44228,6 +44308,14 @@ var validateConnectHandler = /* @__PURE__ */ __name$6((diagnostics, field, value
|
|
|
44228
44308
|
diagnostics.errors.push(`"${field}" should, optionally, have a string "address" field but got ${JSON.stringify(value)}.`);
|
|
44229
44309
|
isValid = false;
|
|
44230
44310
|
}
|
|
44311
|
+
if (connectHandler.protocol === "udp") for (const option of ["idle_timeout_ms", "max_pending_bytes"]) {
|
|
44312
|
+
if (!(option in connectHandler)) continue;
|
|
44313
|
+
const optionValue = connectHandler[option];
|
|
44314
|
+
if (typeof optionValue !== "number" || !Number.isInteger(optionValue) || optionValue < 0 || optionValue > 4294967295) {
|
|
44315
|
+
diagnostics.errors.push(`"${field}" should have an integer "${option}" field between 0 and 4294967295 but got ${JSON.stringify(value)}.`);
|
|
44316
|
+
isValid = false;
|
|
44317
|
+
}
|
|
44318
|
+
}
|
|
44231
44319
|
return isValid;
|
|
44232
44320
|
}, "validateConnectHandler");
|
|
44233
44321
|
var validateCompatibilityDate = /* @__PURE__ */ __name$6((diagnostics, field, value) => {
|
|
@@ -44668,6 +44756,29 @@ function validateWorkerExportCache(diagnostics, field, value) {
|
|
|
44668
44756
|
return valid$2;
|
|
44669
44757
|
}
|
|
44670
44758
|
__name$6(validateWorkerExportCache, "validateWorkerExportCache");
|
|
44759
|
+
function validateWorkflowExport(diagnostics, exportName, workflowExport) {
|
|
44760
|
+
const field = `exports.${exportName}`;
|
|
44761
|
+
let valid$2 = true;
|
|
44762
|
+
valid$2 = validateRequiredProperty(diagnostics, field, "name", workflowExport.name, "string") && valid$2;
|
|
44763
|
+
if (typeof workflowExport.name === "string" && !isValidWorkflowName(workflowExport.name)) {
|
|
44764
|
+
diagnostics.errors.push(`"${field}.name" is invalid. ${workflowNameFormatMessage}`);
|
|
44765
|
+
valid$2 = false;
|
|
44766
|
+
}
|
|
44767
|
+
valid$2 = validateWorkflowSchedules(diagnostics, field, "export", workflowExport) && valid$2;
|
|
44768
|
+
valid$2 = validateWorkflowLimits(diagnostics, field, "export", workflowExport) && valid$2;
|
|
44769
|
+
valid$2 = validateWorkflowDefaultRetention(diagnostics, field, "export", workflowExport) && valid$2;
|
|
44770
|
+
valid$2 = validateWorkflowConcurrency(diagnostics, field, "export", workflowExport) && valid$2;
|
|
44771
|
+
valid$2 = validateAdditionalProperties(diagnostics, field, Object.keys(workflowExport), [
|
|
44772
|
+
"type",
|
|
44773
|
+
"name",
|
|
44774
|
+
"limits",
|
|
44775
|
+
"concurrency",
|
|
44776
|
+
"schedules",
|
|
44777
|
+
"default_retention"
|
|
44778
|
+
]) && valid$2;
|
|
44779
|
+
return valid$2;
|
|
44780
|
+
}
|
|
44781
|
+
__name$6(validateWorkflowExport, "validateWorkflowExport");
|
|
44671
44782
|
var validateExports = /* @__PURE__ */ __name$6((diagnostics, field, value) => {
|
|
44672
44783
|
if (value === void 0 || value === null) return true;
|
|
44673
44784
|
if (typeof value !== "object" || Array.isArray(value)) {
|
|
@@ -44683,9 +44794,10 @@ var validateExports = /* @__PURE__ */ __name$6((diagnostics, field, value) => {
|
|
|
44683
44794
|
}
|
|
44684
44795
|
if (exportConfig.type === "durable-object") valid$2 = validateDurableObjectExport(diagnostics, exportName, exportConfig) && valid$2;
|
|
44685
44796
|
else if (exportConfig.type === "worker") valid$2 = validateWorkerExport(diagnostics, exportName, exportConfig) && valid$2;
|
|
44797
|
+
else if (exportConfig.type === "workflow") valid$2 = validateWorkflowExport(diagnostics, exportName, exportConfig) && valid$2;
|
|
44686
44798
|
else {
|
|
44687
44799
|
valid$2 = false;
|
|
44688
|
-
diagnostics.errors.push(`"exports.${exportName}.type" must be "durable-object" or "
|
|
44800
|
+
diagnostics.errors.push(`"exports.${exportName}.type" must be "durable-object", "worker", or "workflow", but got ${JSON.stringify(exportConfig.type)}.`);
|
|
44689
44801
|
}
|
|
44690
44802
|
}
|
|
44691
44803
|
return valid$2;
|
|
@@ -44907,6 +45019,19 @@ function errorIfMigrationsAndExportsBothSet(diagnostics, migrations, exports$1)
|
|
|
44907
45019
|
if (migrations.length > 0 && exports$1 !== void 0 && Object.values(exports$1).some((entry) => entry.type === "durable-object")) diagnostics.errors.push(`\`migrations\` and \`exports\` are mutually exclusive. Choose one or the other to declare your Durable Object lifecycle, but not both.`);
|
|
44908
45020
|
}
|
|
44909
45021
|
__name$6(errorIfMigrationsAndExportsBothSet, "errorIfMigrationsAndExportsBothSet");
|
|
45022
|
+
function validateWorkflowExportConflicts(diagnostics, exports$1) {
|
|
45023
|
+
const classNamesByWorkflowName = /* @__PURE__ */ new Map();
|
|
45024
|
+
for (const [className, workflowExport] of Object.entries(partitionExports(exports$1).workflow)) {
|
|
45025
|
+
if (typeof workflowExport.name !== "string") continue;
|
|
45026
|
+
const existing = classNamesByWorkflowName.get(workflowExport.name);
|
|
45027
|
+
if (existing !== void 0) {
|
|
45028
|
+
diagnostics.errors.push(`"exports.${existing}" and "exports.${className}" both declare the Workflow "${workflowExport.name}". Workflow names must be unique.`);
|
|
45029
|
+
continue;
|
|
45030
|
+
}
|
|
45031
|
+
classNamesByWorkflowName.set(workflowExport.name, className);
|
|
45032
|
+
}
|
|
45033
|
+
}
|
|
45034
|
+
__name$6(validateWorkflowExportConflicts, "validateWorkflowExportConflicts");
|
|
44910
45035
|
function validateContainerExportLinks(diagnostics, containers, exports$1, containersDeclaredElsewhere) {
|
|
44911
45036
|
if (containers !== void 0 && !Array.isArray(containers)) return;
|
|
44912
45037
|
if (containers === void 0 && containersDeclaredElsewhere) return;
|
|
@@ -46776,9 +46901,9 @@ function getInstalledVersion(binPath) {
|
|
|
46776
46901
|
}
|
|
46777
46902
|
__name$6(getInstalledVersion, "getInstalledVersion");
|
|
46778
46903
|
function isVersionOutdated(installed, latest) {
|
|
46779
|
-
const parse$
|
|
46780
|
-
const [iYear, iMonth, iPatch] = parse$
|
|
46781
|
-
const [lYear, lMonth, lPatch] = parse$
|
|
46904
|
+
const parse$13 = /* @__PURE__ */ __name$6((v) => v.split(".").map(Number), "parse");
|
|
46905
|
+
const [iYear, iMonth, iPatch] = parse$13(installed);
|
|
46906
|
+
const [lYear, lMonth, lPatch] = parse$13(latest);
|
|
46782
46907
|
if (iYear !== lYear) return iYear < lYear;
|
|
46783
46908
|
if (iMonth !== lMonth) return iMonth < lMonth;
|
|
46784
46909
|
return iPatch < lPatch;
|
|
@@ -47819,7 +47944,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/
|
|
|
47819
47944
|
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js
|
|
47820
47945
|
var require_parse$1 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js": ((exports, module) => {
|
|
47821
47946
|
const SemVer$14 = require_semver$1();
|
|
47822
|
-
const parse$
|
|
47947
|
+
const parse$10 = (version$6, options, throwErrors = false) => {
|
|
47823
47948
|
if (version$6 instanceof SemVer$14) return version$6;
|
|
47824
47949
|
try {
|
|
47825
47950
|
return new SemVer$14(version$6, options);
|
|
@@ -47828,15 +47953,15 @@ var require_parse$1 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/s
|
|
|
47828
47953
|
throw er;
|
|
47829
47954
|
}
|
|
47830
47955
|
};
|
|
47831
|
-
module.exports = parse$
|
|
47956
|
+
module.exports = parse$10;
|
|
47832
47957
|
}) });
|
|
47833
47958
|
|
|
47834
47959
|
//#endregion
|
|
47835
47960
|
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js
|
|
47836
47961
|
var require_valid$1 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js": ((exports, module) => {
|
|
47837
|
-
const parse$
|
|
47962
|
+
const parse$9 = require_parse$1();
|
|
47838
47963
|
const valid$1 = (version$6, options) => {
|
|
47839
|
-
const v = parse$
|
|
47964
|
+
const v = parse$9(version$6, options);
|
|
47840
47965
|
return v ? v.version : null;
|
|
47841
47966
|
};
|
|
47842
47967
|
module.exports = valid$1;
|
|
@@ -47845,9 +47970,9 @@ var require_valid$1 = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/s
|
|
|
47845
47970
|
//#endregion
|
|
47846
47971
|
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js
|
|
47847
47972
|
var require_clean = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js": ((exports, module) => {
|
|
47848
|
-
const parse$
|
|
47973
|
+
const parse$8 = require_parse$1();
|
|
47849
47974
|
const clean$1 = (version$6, options) => {
|
|
47850
|
-
const s = parse$
|
|
47975
|
+
const s = parse$8(version$6.trim().replace(/^[=v]+/, ""), options);
|
|
47851
47976
|
return s ? s.version : null;
|
|
47852
47977
|
};
|
|
47853
47978
|
module.exports = clean$1;
|
|
@@ -47875,10 +48000,10 @@ var require_inc = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/semve
|
|
|
47875
48000
|
//#endregion
|
|
47876
48001
|
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js
|
|
47877
48002
|
var require_diff = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js": ((exports, module) => {
|
|
47878
|
-
const parse$
|
|
48003
|
+
const parse$7 = require_parse$1();
|
|
47879
48004
|
const diff$1 = (version1, version2) => {
|
|
47880
|
-
const v1 = parse$
|
|
47881
|
-
const v2 = parse$
|
|
48005
|
+
const v1 = parse$7(version1, null, true);
|
|
48006
|
+
const v2 = parse$7(version2, null, true);
|
|
47882
48007
|
const comparison = v1.compare(v2);
|
|
47883
48008
|
if (comparison === 0) return null;
|
|
47884
48009
|
const v1Higher = comparison > 0;
|
|
@@ -47928,9 +48053,9 @@ var require_patch = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/sem
|
|
|
47928
48053
|
//#endregion
|
|
47929
48054
|
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js
|
|
47930
48055
|
var require_prerelease = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js": ((exports, module) => {
|
|
47931
|
-
const parse$
|
|
48056
|
+
const parse$6 = require_parse$1();
|
|
47932
48057
|
const prerelease$1 = (version$6, options) => {
|
|
47933
|
-
const parsed = parse$
|
|
48058
|
+
const parsed = parse$6(version$6, options);
|
|
47934
48059
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
47935
48060
|
};
|
|
47936
48061
|
module.exports = prerelease$1;
|
|
@@ -48073,7 +48198,7 @@ var require_cmp = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/semve
|
|
|
48073
48198
|
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js
|
|
48074
48199
|
var require_coerce = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js": ((exports, module) => {
|
|
48075
48200
|
const SemVer$7 = require_semver$1();
|
|
48076
|
-
const parse$
|
|
48201
|
+
const parse$5 = require_parse$1();
|
|
48077
48202
|
const { safeRe: re$2, t: t$2 } = require_re();
|
|
48078
48203
|
const coerce$1 = (version$6, options) => {
|
|
48079
48204
|
if (version$6 instanceof SemVer$7) return version$6;
|
|
@@ -48093,7 +48218,7 @@ var require_coerce = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/se
|
|
|
48093
48218
|
}
|
|
48094
48219
|
if (match === null) return null;
|
|
48095
48220
|
const major$2 = match[2];
|
|
48096
|
-
return parse$
|
|
48221
|
+
return parse$5(`${major$2}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
48097
48222
|
};
|
|
48098
48223
|
module.exports = coerce$1;
|
|
48099
48224
|
}) });
|
|
@@ -48825,7 +48950,7 @@ var require_semver = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/se
|
|
|
48825
48950
|
const constants$5 = require_constants$2();
|
|
48826
48951
|
const SemVer = require_semver$1();
|
|
48827
48952
|
const identifiers = require_identifiers();
|
|
48828
|
-
const parse$
|
|
48953
|
+
const parse$4 = require_parse$1();
|
|
48829
48954
|
const valid = require_valid$1();
|
|
48830
48955
|
const clean = require_clean();
|
|
48831
48956
|
const inc = require_inc();
|
|
@@ -48863,7 +48988,7 @@ var require_semver = /* @__PURE__ */ __commonJS$3({ "../../node_modules/.pnpm/se
|
|
|
48863
48988
|
const simplifyRange = require_simplify();
|
|
48864
48989
|
const subset = require_subset();
|
|
48865
48990
|
module.exports = {
|
|
48866
|
-
parse: parse$
|
|
48991
|
+
parse: parse$4,
|
|
48867
48992
|
valid,
|
|
48868
48993
|
clean,
|
|
48869
48994
|
inc,
|
|
@@ -52049,7 +52174,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
|
52049
52174
|
}
|
|
52050
52175
|
return result.value;
|
|
52051
52176
|
};
|
|
52052
|
-
const parse$
|
|
52177
|
+
const parse$3 = /* @__PURE__ */ _parse($ZodRealError);
|
|
52053
52178
|
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
52054
52179
|
const ctx = _ctx ? {
|
|
52055
52180
|
..._ctx,
|
|
@@ -55198,7 +55323,7 @@ const ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer, { Par
|
|
|
55198
55323
|
|
|
55199
55324
|
//#endregion
|
|
55200
55325
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
|
|
55201
|
-
const parse$
|
|
55326
|
+
const parse$2 = /* @__PURE__ */ _parse(ZodRealError);
|
|
55202
55327
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
55203
55328
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
55204
55329
|
const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
@@ -55259,7 +55384,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
55259
55384
|
inst.def = def;
|
|
55260
55385
|
inst.type = def.type;
|
|
55261
55386
|
Object.defineProperty(inst, "_def", { value: def });
|
|
55262
|
-
inst.parse = (data$1, params) => parse$
|
|
55387
|
+
inst.parse = (data$1, params) => parse$2(inst, data$1, params, { callee: inst.parse });
|
|
55263
55388
|
inst.safeParse = (data$1, params) => safeParse(inst, data$1, params);
|
|
55264
55389
|
inst.parseAsync = async (data$1, params) => parseAsync(inst, data$1, params, { callee: inst.parseAsync });
|
|
55265
55390
|
inst.safeParseAsync = async (data$1, params) => safeParseAsync(inst, data$1, params);
|
|
@@ -56494,6 +56619,18 @@ const WorkerEntrypointExportSchema = strictObject({
|
|
|
56494
56619
|
type: literal$1("worker"),
|
|
56495
56620
|
cache: strictObject({ enabled: boolean() }).optional()
|
|
56496
56621
|
});
|
|
56622
|
+
const WorkflowRetentionSchema = union([number().int().min(1), string().min(1)]);
|
|
56623
|
+
const WorkflowExportSchema = strictObject({
|
|
56624
|
+
type: literal$1("workflow"),
|
|
56625
|
+
name: string(),
|
|
56626
|
+
limits: strictObject({ steps: number().int().min(1).optional() }).optional(),
|
|
56627
|
+
concurrency: strictObject({ limit: number().int().min(1).optional() }).optional(),
|
|
56628
|
+
schedules: union([string().min(1), array(string().min(1)).min(1)]).optional(),
|
|
56629
|
+
default_retention: strictObject({
|
|
56630
|
+
success_retention: WorkflowRetentionSchema.optional(),
|
|
56631
|
+
error_retention: WorkflowRetentionSchema.optional()
|
|
56632
|
+
}).optional()
|
|
56633
|
+
});
|
|
56497
56634
|
const DurableObjectCreatedSqliteExportSchema = DurableObjectCreatedExportSchema.extend({ storage: literal$1("sqlite") });
|
|
56498
56635
|
const DurableObjectCreatedLegacyKvExportSchema = DurableObjectCreatedExportSchema.omit({ container: true }).extend({ storage: literal$1("legacy-kv") });
|
|
56499
56636
|
const DurableObjectExpectingTransferSqliteExportSchema = DurableObjectExpectingTransferExportSchema.extend({ storage: literal$1("sqlite") });
|
|
@@ -56506,7 +56643,8 @@ const ExportSchema = union([
|
|
|
56506
56643
|
DurableObjectTransferredExportSchema,
|
|
56507
56644
|
DurableObjectExpectingTransferSqliteExportSchema,
|
|
56508
56645
|
DurableObjectExpectingTransferLegacyKvExportSchema,
|
|
56509
|
-
WorkerEntrypointExportSchema
|
|
56646
|
+
WorkerEntrypointExportSchema,
|
|
56647
|
+
WorkflowExportSchema
|
|
56510
56648
|
]);
|
|
56511
56649
|
const LimitsSchema = strictObject({
|
|
56512
56650
|
cpuMs: number().optional(),
|
|
@@ -56578,12 +56716,19 @@ const TriggerSchema = discriminatedUnion("type", [
|
|
|
56578
56716
|
type: literal$1("scheduled"),
|
|
56579
56717
|
schedule: string()
|
|
56580
56718
|
}),
|
|
56581
|
-
strictObject({
|
|
56719
|
+
discriminatedUnion("protocol", [strictObject({
|
|
56582
56720
|
type: literal$1("connect"),
|
|
56583
|
-
protocol:
|
|
56721
|
+
protocol: literal$1("tcp"),
|
|
56584
56722
|
port: number(),
|
|
56585
56723
|
address: string().optional()
|
|
56586
|
-
})
|
|
56724
|
+
}), strictObject({
|
|
56725
|
+
type: literal$1("connect"),
|
|
56726
|
+
protocol: literal$1("udp"),
|
|
56727
|
+
port: number(),
|
|
56728
|
+
address: string().optional(),
|
|
56729
|
+
idleTimeoutMs: number().int().min(0).max(4294967295).optional(),
|
|
56730
|
+
maxPendingBytes: number().int().min(0).max(4294967295).optional()
|
|
56731
|
+
})])
|
|
56587
56732
|
]);
|
|
56588
56733
|
const UnsafeSchema = strictObject({
|
|
56589
56734
|
metadata: record(string(), unknown()).optional(),
|
|
@@ -57292,7 +57437,7 @@ function convertExports(config$2, result) {
|
|
|
57292
57437
|
const converted = {};
|
|
57293
57438
|
const unknownExports = {};
|
|
57294
57439
|
for (const [exportName, value] of Object.entries(exports$2)) {
|
|
57295
|
-
if (value.type === "worker") {
|
|
57440
|
+
if (value.type === "worker" || value.type === "workflow") {
|
|
57296
57441
|
converted[exportName] = value;
|
|
57297
57442
|
continue;
|
|
57298
57443
|
}
|
|
@@ -57386,7 +57531,11 @@ function convertTriggers(config$2, result) {
|
|
|
57386
57531
|
connectHandlers.push(omitUndefined({
|
|
57387
57532
|
protocol: trigger.protocol,
|
|
57388
57533
|
port: trigger.port,
|
|
57389
|
-
address: trigger.address
|
|
57534
|
+
address: trigger.address,
|
|
57535
|
+
...trigger.protocol === "udp" ? {
|
|
57536
|
+
idle_timeout_ms: trigger.idleTimeoutMs,
|
|
57537
|
+
max_pending_bytes: trigger.maxPendingBytes
|
|
57538
|
+
} : {}
|
|
57390
57539
|
}));
|
|
57391
57540
|
break;
|
|
57392
57541
|
}
|
|
@@ -58223,13 +58372,15 @@ async function readBuildOutput(root) {
|
|
|
58223
58372
|
async function readWorkers(root) {
|
|
58224
58373
|
const workersDir = getWorkersDir(root);
|
|
58225
58374
|
const defaultWorker = await readWorker(root, DEFAULT_WORKER_DIRECTORY_NAME);
|
|
58375
|
+
if (defaultWorker === void 0) throw new BuildOutputError(`Default Worker at ${getWorkerDir(root, DEFAULT_WORKER_DIRECTORY_NAME)} has neither a bundle directory (${getWorkerBundleDir(root, DEFAULT_WORKER_DIRECTORY_NAME)}) nor an assets directory (${getWorkerAssetsDir(root, DEFAULT_WORKER_DIRECTORY_NAME)}).`);
|
|
58226
58376
|
const additionalWorkerDirectoryNames = (await fsp.readdir(workersDir, { withFileTypes: true })).filter((entry) => entry.isDirectory() && entry.name !== DEFAULT_WORKER_DIRECTORY_NAME).map((entry) => entry.name);
|
|
58227
58377
|
const additionalWorkers = await Promise.all(additionalWorkerDirectoryNames.map(async (workerDirectoryName) => {
|
|
58228
|
-
|
|
58378
|
+
const worker = await readWorker(root, workerDirectoryName);
|
|
58379
|
+
return worker === void 0 ? void 0 : [workerDirectoryName, worker];
|
|
58229
58380
|
}));
|
|
58230
58381
|
return {
|
|
58231
58382
|
default: defaultWorker,
|
|
58232
|
-
...Object.fromEntries(additionalWorkers)
|
|
58383
|
+
...Object.fromEntries(additionalWorkers.filter((entry) => entry !== void 0))
|
|
58233
58384
|
};
|
|
58234
58385
|
}
|
|
58235
58386
|
/** Read and parse all Container configs, if any. */
|
|
@@ -58255,7 +58406,8 @@ async function readContainer(root, containerDirectoryName) {
|
|
|
58255
58406
|
* Read and parse the Worker's `worker.config.json` and resolve its
|
|
58256
58407
|
* `bundle/` / `assets/` directories.
|
|
58257
58408
|
*
|
|
58258
|
-
* @returns the Worker, with whichever of its directories exist resolved
|
|
58409
|
+
* @returns the Worker, with whichever of its directories exist resolved, or
|
|
58410
|
+
* `undefined` when it has no deployable output.
|
|
58259
58411
|
* @throws {BuildOutputError} if the config is missing, is not valid JSON, or
|
|
58260
58412
|
* does not match its schema.
|
|
58261
58413
|
*/
|
|
@@ -58269,7 +58421,6 @@ async function readWorker(root, workerDirectoryName) {
|
|
|
58269
58421
|
const assetsDir = getWorkerAssetsDir(root, workerDirectoryName);
|
|
58270
58422
|
const hasBundleDir = fs$1.existsSync(bundleDir);
|
|
58271
58423
|
const hasAssetsDir = fs$1.existsSync(assetsDir);
|
|
58272
|
-
if (result.data.manifest && !hasBundleDir) throw new BuildOutputError(`Worker config at ${configPath} contains a manifest, but no bundle directory exists at ${bundleDir}.`);
|
|
58273
58424
|
if (hasBundleDir) return {
|
|
58274
58425
|
configPath,
|
|
58275
58426
|
config: await resolveManifest(result.data, configPath, bundleDir),
|
|
@@ -58285,7 +58436,6 @@ async function readWorker(root, workerDirectoryName) {
|
|
|
58285
58436
|
assetsDir
|
|
58286
58437
|
};
|
|
58287
58438
|
}
|
|
58288
|
-
throw new BuildOutputError(`Worker config at ${configPath} has neither a bundle directory (${bundleDir}) nor an assets directory (${assetsDir}).`);
|
|
58289
58439
|
}
|
|
58290
58440
|
/** Resolve the manifest against the bundle contents. */
|
|
58291
58441
|
async function resolveManifest(config$2, configPath, bundleDir) {
|
|
@@ -59788,7 +59938,7 @@ var prototypeAccessors = {
|
|
|
59788
59938
|
allowUsing: { configurable: true },
|
|
59789
59939
|
inClassStaticBlock: { configurable: true }
|
|
59790
59940
|
};
|
|
59791
|
-
Parser.prototype.parse = function parse$
|
|
59941
|
+
Parser.prototype.parse = function parse$13() {
|
|
59792
59942
|
var node = this.options.program || this.startNode();
|
|
59793
59943
|
this.nextToken();
|
|
59794
59944
|
return this.parseTopLevel(node);
|
|
@@ -59847,7 +59997,7 @@ Parser.extend = function extend$2() {
|
|
|
59847
59997
|
for (var i$1 = 0; i$1 < plugins.length; i$1++) cls = plugins[i$1](cls);
|
|
59848
59998
|
return cls;
|
|
59849
59999
|
};
|
|
59850
|
-
Parser.parse = function parse$
|
|
60000
|
+
Parser.parse = function parse$13(input, options) {
|
|
59851
60001
|
return new this(options, input).parse();
|
|
59852
60002
|
};
|
|
59853
60003
|
Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) {
|
|
@@ -67184,6 +67334,7 @@ function printLocalExplorerAgentHint(server, mode) {
|
|
|
67184
67334
|
`The Local Explorer API is available at ${explorerApiUrl}`,
|
|
67185
67335
|
`Useful routes:`,
|
|
67186
67336
|
` GET ${explorerApiUrl}/local/workers - local Workers and bindings`,
|
|
67337
|
+
` POST ${explorerApiUrl}/local/scheduled?worker=<name> - invoke a Worker's scheduled handler; cron is required (see the OpenAPI schema for the full request)`,
|
|
67187
67338
|
` GET ${explorerApiUrl}/storage/kv/namespaces - KV namespaces`,
|
|
67188
67339
|
` GET ${explorerApiUrl}/d1/database - D1 databases`,
|
|
67189
67340
|
` GET ${explorerApiUrl}/r2/buckets - R2 buckets`,
|
|
@@ -70372,7 +70523,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
|
|
|
70372
70523
|
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
70373
70524
|
};
|
|
70374
70525
|
};
|
|
70375
|
-
var dist_default$
|
|
70526
|
+
var dist_default$1 = getStringTruncatedWidth;
|
|
70376
70527
|
|
|
70377
70528
|
//#endregion
|
|
70378
70529
|
//#region ../../node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
|
|
@@ -70382,9 +70533,9 @@ const NO_TRUNCATION = {
|
|
|
70382
70533
|
ellipsisWidth: 0
|
|
70383
70534
|
};
|
|
70384
70535
|
const fastStringWidth = (input, options = {}) => {
|
|
70385
|
-
return dist_default$
|
|
70536
|
+
return dist_default$1(input, NO_TRUNCATION, options).width;
|
|
70386
70537
|
};
|
|
70387
|
-
var dist_default
|
|
70538
|
+
var dist_default = fastStringWidth;
|
|
70388
70539
|
|
|
70389
70540
|
//#endregion
|
|
70390
70541
|
//#region ../../node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
|
|
@@ -70417,13 +70568,13 @@ const wrapWord$1 = (rows, word, columns) => {
|
|
|
70417
70568
|
let isInsideEscape = false;
|
|
70418
70569
|
let isInsideLinkEscape = false;
|
|
70419
70570
|
let lastRow = rows.at(-1);
|
|
70420
|
-
let visible = lastRow === void 0 ? 0 : dist_default
|
|
70571
|
+
let visible = lastRow === void 0 ? 0 : dist_default(lastRow);
|
|
70421
70572
|
let currentCharacter = characters.next();
|
|
70422
70573
|
let nextCharacter = characters.next();
|
|
70423
70574
|
let rawCharacterIndex = 0;
|
|
70424
70575
|
while (!currentCharacter.done) {
|
|
70425
70576
|
const character = currentCharacter.value;
|
|
70426
|
-
const characterLength = dist_default
|
|
70577
|
+
const characterLength = dist_default(character);
|
|
70427
70578
|
if (visible + characterLength <= columns) rows[rows.length - 1] += character;
|
|
70428
70579
|
else {
|
|
70429
70580
|
rows.push(character);
|
|
@@ -70458,7 +70609,7 @@ const stringVisibleTrimSpacesRight$1 = (string$3) => {
|
|
|
70458
70609
|
const words = string$3.split(" ");
|
|
70459
70610
|
let last = words.length;
|
|
70460
70611
|
while (last) {
|
|
70461
|
-
if (dist_default
|
|
70612
|
+
if (dist_default(words[last - 1])) break;
|
|
70462
70613
|
last--;
|
|
70463
70614
|
}
|
|
70464
70615
|
if (last === words.length) return string$3;
|
|
@@ -70479,7 +70630,7 @@ const exec$2 = (string$3, columns, options = {}) => {
|
|
|
70479
70630
|
const trimmed = row.trimStart();
|
|
70480
70631
|
if (row.length !== trimmed.length) {
|
|
70481
70632
|
rows[rows.length - 1] = trimmed;
|
|
70482
|
-
rowLength = dist_default
|
|
70633
|
+
rowLength = dist_default(trimmed);
|
|
70483
70634
|
}
|
|
70484
70635
|
}
|
|
70485
70636
|
if (index !== 0) {
|
|
@@ -70492,19 +70643,19 @@ const exec$2 = (string$3, columns, options = {}) => {
|
|
|
70492
70643
|
rowLength++;
|
|
70493
70644
|
}
|
|
70494
70645
|
}
|
|
70495
|
-
const wordLength = dist_default
|
|
70646
|
+
const wordLength = dist_default(word);
|
|
70496
70647
|
if (options.hard && wordLength > columns) {
|
|
70497
70648
|
const remainingColumns = columns - rowLength;
|
|
70498
70649
|
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
70499
70650
|
if (Math.floor((wordLength - 1) / columns) < breaksStartingThisLine) rows.push("");
|
|
70500
70651
|
wrapWord$1(rows, word, columns);
|
|
70501
|
-
rowLength = dist_default
|
|
70652
|
+
rowLength = dist_default(rows.at(-1) ?? "");
|
|
70502
70653
|
continue;
|
|
70503
70654
|
}
|
|
70504
70655
|
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
70505
70656
|
if (options.wordWrap === false && rowLength < columns) {
|
|
70506
70657
|
wrapWord$1(rows, word, columns);
|
|
70507
|
-
rowLength = dist_default
|
|
70658
|
+
rowLength = dist_default(rows.at(-1) ?? "");
|
|
70508
70659
|
continue;
|
|
70509
70660
|
}
|
|
70510
70661
|
rows.push("");
|
|
@@ -70512,7 +70663,7 @@ const exec$2 = (string$3, columns, options = {}) => {
|
|
|
70512
70663
|
}
|
|
70513
70664
|
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
70514
70665
|
wrapWord$1(rows, word, columns);
|
|
70515
|
-
rowLength = dist_default
|
|
70666
|
+
rowLength = dist_default(rows.at(-1) ?? "");
|
|
70516
70667
|
continue;
|
|
70517
70668
|
}
|
|
70518
70669
|
rows[rows.length - 1] += word;
|
|
@@ -74039,7 +74190,7 @@ var require_extension = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_mo
|
|
|
74039
74190
|
else dest[name].push(elem);
|
|
74040
74191
|
}
|
|
74041
74192
|
__name$2(push, "push");
|
|
74042
|
-
function parse$
|
|
74193
|
+
function parse$13(header) {
|
|
74043
74194
|
const offers = /* @__PURE__ */ Object.create(null);
|
|
74044
74195
|
let params = /* @__PURE__ */ Object.create(null);
|
|
74045
74196
|
let mustUnescape = false;
|
|
@@ -74132,7 +74283,7 @@ var require_extension = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_mo
|
|
|
74132
74283
|
}
|
|
74133
74284
|
return offers;
|
|
74134
74285
|
}
|
|
74135
|
-
__name$2(parse$
|
|
74286
|
+
__name$2(parse$13, "parse");
|
|
74136
74287
|
function format$3(extensions) {
|
|
74137
74288
|
return Object.keys(extensions).map((extension2) => {
|
|
74138
74289
|
let configurations = extensions[extension2];
|
|
@@ -74149,7 +74300,7 @@ var require_extension = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_mo
|
|
|
74149
74300
|
__name$2(format$3, "format");
|
|
74150
74301
|
module$1.exports = {
|
|
74151
74302
|
format: format$3,
|
|
74152
|
-
parse: parse$
|
|
74303
|
+
parse: parse$13
|
|
74153
74304
|
};
|
|
74154
74305
|
} });
|
|
74155
74306
|
var require_websocket = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket.js"(exports$1, module$1) {
|
|
@@ -74167,7 +74318,7 @@ var require_websocket = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_mo
|
|
|
74167
74318
|
var { isBlob: isBlob2 } = require_validation();
|
|
74168
74319
|
var { BINARY_TYPES, CLOSE_TIMEOUT, EMPTY_BUFFER: EMPTY_BUFFER$1, GUID, kForOnEventAttribute, kListener: kListener$1, kStatusCode, kWebSocket, NOOP } = require_constants$1();
|
|
74169
74320
|
var { EventTarget: { addEventListener, removeEventListener } } = require_event_target();
|
|
74170
|
-
var { format: format$3, parse: parse$
|
|
74321
|
+
var { format: format$3, parse: parse$13 } = require_extension();
|
|
74171
74322
|
var { toBuffer: toBuffer$1 } = require_buffer_util();
|
|
74172
74323
|
var kAborted = Symbol("kAborted");
|
|
74173
74324
|
var protocolVersions = [8, 13];
|
|
@@ -74776,7 +74927,7 @@ var require_websocket = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_mo
|
|
|
74776
74927
|
}
|
|
74777
74928
|
let extensions;
|
|
74778
74929
|
try {
|
|
74779
|
-
extensions = parse$
|
|
74930
|
+
extensions = parse$13(secWebSocketExtensions);
|
|
74780
74931
|
} catch (err) {
|
|
74781
74932
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Extensions header");
|
|
74782
74933
|
return;
|
|
@@ -75060,7 +75211,7 @@ var require_stream = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_modul
|
|
|
75060
75211
|
} });
|
|
75061
75212
|
var require_subprotocol = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js"(exports$1, module$1) {
|
|
75062
75213
|
var { tokenChars } = require_validation();
|
|
75063
|
-
function parse$
|
|
75214
|
+
function parse$13(header) {
|
|
75064
75215
|
const protocols = /* @__PURE__ */ new Set();
|
|
75065
75216
|
let start = -1;
|
|
75066
75217
|
let end = -1;
|
|
@@ -75086,8 +75237,8 @@ var require_subprotocol = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_
|
|
|
75086
75237
|
protocols.add(protocol);
|
|
75087
75238
|
return protocols;
|
|
75088
75239
|
}
|
|
75089
|
-
__name$2(parse$
|
|
75090
|
-
module$1.exports = { parse: parse$
|
|
75240
|
+
__name$2(parse$13, "parse");
|
|
75241
|
+
module$1.exports = { parse: parse$13 };
|
|
75091
75242
|
} });
|
|
75092
75243
|
var require_websocket_server = __commonJS({ "../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket-server.js"(exports$1, module$1) {
|
|
75093
75244
|
var EventEmitter$4 = __require$1("events");
|
|
@@ -80145,7 +80296,7 @@ var __name$1 = (target$1, value) => __defProp$1(target$1, "name", {
|
|
|
80145
80296
|
});
|
|
80146
80297
|
|
|
80147
80298
|
//#endregion
|
|
80148
|
-
//#region ../workers-auth/dist/chunk-
|
|
80299
|
+
//#region ../workers-auth/dist/chunk-WMSASLDV.mjs
|
|
80149
80300
|
var import_undici$2 = require_undici();
|
|
80150
80301
|
var hasWarnedAboutDeprecatedV1ApiToken = false;
|
|
80151
80302
|
function readStoredAuthState(options) {
|
|
@@ -81703,589 +81854,21 @@ function getProfileForDirectoryFromBindings(startDir, bindings) {
|
|
|
81703
81854
|
}
|
|
81704
81855
|
}
|
|
81705
81856
|
__name$1(getProfileForDirectoryFromBindings, "getProfileForDirectoryFromBindings");
|
|
81706
|
-
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
81707
|
-
var TomlDate = class _TomlDate extends Date {
|
|
81708
|
-
static {
|
|
81709
|
-
__name$1(this, "TomlDate");
|
|
81710
|
-
}
|
|
81711
|
-
#hasDate = false;
|
|
81712
|
-
#hasTime = false;
|
|
81713
|
-
#offset = null;
|
|
81714
|
-
constructor(date$3) {
|
|
81715
|
-
let hasDate = true;
|
|
81716
|
-
let hasTime = true;
|
|
81717
|
-
let offset = "Z";
|
|
81718
|
-
if (typeof date$3 === "string") {
|
|
81719
|
-
let match = date$3.match(DATE_TIME_RE);
|
|
81720
|
-
if (match) {
|
|
81721
|
-
if (!match[1]) {
|
|
81722
|
-
hasDate = false;
|
|
81723
|
-
date$3 = `0000-01-01T${date$3}`;
|
|
81724
|
-
}
|
|
81725
|
-
hasTime = !!match[2];
|
|
81726
|
-
hasTime && date$3[10] === " " && (date$3 = date$3.replace(" ", "T"));
|
|
81727
|
-
if (match[2] && +match[2] > 23) date$3 = "";
|
|
81728
|
-
else {
|
|
81729
|
-
offset = match[3] || null;
|
|
81730
|
-
date$3 = date$3.toUpperCase();
|
|
81731
|
-
if (!offset && hasTime) date$3 += "Z";
|
|
81732
|
-
}
|
|
81733
|
-
} else date$3 = "";
|
|
81734
|
-
}
|
|
81735
|
-
super(date$3);
|
|
81736
|
-
if (!isNaN(this.getTime())) {
|
|
81737
|
-
this.#hasDate = hasDate;
|
|
81738
|
-
this.#hasTime = hasTime;
|
|
81739
|
-
this.#offset = offset;
|
|
81740
|
-
}
|
|
81741
|
-
}
|
|
81742
|
-
isDateTime() {
|
|
81743
|
-
return this.#hasDate && this.#hasTime;
|
|
81744
|
-
}
|
|
81745
|
-
isLocal() {
|
|
81746
|
-
return !this.#hasDate || !this.#hasTime || !this.#offset;
|
|
81747
|
-
}
|
|
81748
|
-
isDate() {
|
|
81749
|
-
return this.#hasDate && !this.#hasTime;
|
|
81750
|
-
}
|
|
81751
|
-
isTime() {
|
|
81752
|
-
return this.#hasTime && !this.#hasDate;
|
|
81753
|
-
}
|
|
81754
|
-
isValid() {
|
|
81755
|
-
return this.#hasDate || this.#hasTime;
|
|
81756
|
-
}
|
|
81757
|
-
toISOString() {
|
|
81758
|
-
let iso = super.toISOString();
|
|
81759
|
-
if (this.isDate()) return iso.slice(0, 10);
|
|
81760
|
-
if (this.isTime()) return iso.slice(11, 23);
|
|
81761
|
-
if (this.#offset === null) return iso.slice(0, -1);
|
|
81762
|
-
if (this.#offset === "Z") return iso;
|
|
81763
|
-
let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
|
|
81764
|
-
offset = this.#offset[0] === "-" ? offset : -offset;
|
|
81765
|
-
return (/* @__PURE__ */ new Date(this.getTime() - offset * 6e4)).toISOString().slice(0, -1) + this.#offset;
|
|
81766
|
-
}
|
|
81767
|
-
static wrapAsOffsetDateTime(jsDate, offset = "Z") {
|
|
81768
|
-
let date$3 = new _TomlDate(jsDate);
|
|
81769
|
-
date$3.#offset = offset;
|
|
81770
|
-
return date$3;
|
|
81771
|
-
}
|
|
81772
|
-
static wrapAsLocalDateTime(jsDate) {
|
|
81773
|
-
let date$3 = new _TomlDate(jsDate);
|
|
81774
|
-
date$3.#offset = null;
|
|
81775
|
-
return date$3;
|
|
81776
|
-
}
|
|
81777
|
-
static wrapAsLocalDate(jsDate) {
|
|
81778
|
-
let date$3 = new _TomlDate(jsDate);
|
|
81779
|
-
date$3.#hasTime = false;
|
|
81780
|
-
date$3.#offset = null;
|
|
81781
|
-
return date$3;
|
|
81782
|
-
}
|
|
81783
|
-
static wrapAsLocalTime(jsDate) {
|
|
81784
|
-
let date$3 = new _TomlDate(jsDate);
|
|
81785
|
-
date$3.#hasDate = false;
|
|
81786
|
-
date$3.#offset = null;
|
|
81787
|
-
return date$3;
|
|
81788
|
-
}
|
|
81789
|
-
};
|
|
81790
|
-
function getLineColFromPtr(string$3, ptr) {
|
|
81791
|
-
let lines = string$3.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
81792
|
-
return [lines.length, lines.pop().length + 1];
|
|
81793
|
-
}
|
|
81794
|
-
__name$1(getLineColFromPtr, "getLineColFromPtr");
|
|
81795
|
-
function makeCodeBlock(string$3, line, column) {
|
|
81796
|
-
let lines = string$3.split(/\r\n|\n|\r/g);
|
|
81797
|
-
let codeblock = "";
|
|
81798
|
-
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
81799
|
-
for (let i$1 = line - 1; i$1 <= line + 1; i$1++) {
|
|
81800
|
-
let l = lines[i$1 - 1];
|
|
81801
|
-
if (!l) continue;
|
|
81802
|
-
codeblock += i$1.toString().padEnd(numberLen, " ");
|
|
81803
|
-
codeblock += ": ";
|
|
81804
|
-
codeblock += l;
|
|
81805
|
-
codeblock += "\n";
|
|
81806
|
-
if (i$1 === line) {
|
|
81807
|
-
codeblock += " ".repeat(numberLen + column + 2);
|
|
81808
|
-
codeblock += "^\n";
|
|
81809
|
-
}
|
|
81810
|
-
}
|
|
81811
|
-
return codeblock;
|
|
81812
|
-
}
|
|
81813
|
-
__name$1(makeCodeBlock, "makeCodeBlock");
|
|
81814
|
-
var TomlError = class extends Error {
|
|
81815
|
-
static {
|
|
81816
|
-
__name$1(this, "TomlError");
|
|
81817
|
-
}
|
|
81818
|
-
line;
|
|
81819
|
-
column;
|
|
81820
|
-
codeblock;
|
|
81821
|
-
constructor(message, options) {
|
|
81822
|
-
const [line, column] = getLineColFromPtr(options.toml, options.ptr);
|
|
81823
|
-
const codeblock = makeCodeBlock(options.toml, line, column);
|
|
81824
|
-
super(`Invalid TOML document: ${message}
|
|
81825
|
-
|
|
81826
|
-
${codeblock}`, options);
|
|
81827
|
-
this.line = line;
|
|
81828
|
-
this.column = column;
|
|
81829
|
-
this.codeblock = codeblock;
|
|
81830
|
-
}
|
|
81831
|
-
};
|
|
81832
|
-
function indexOfNewline(str, start = 0) {
|
|
81833
|
-
let idx = str.indexOf("\n", start);
|
|
81834
|
-
if (str.charCodeAt(idx - 1) === 13) idx--;
|
|
81835
|
-
return idx;
|
|
81836
|
-
}
|
|
81837
|
-
__name$1(indexOfNewline, "indexOfNewline");
|
|
81838
|
-
function skipComment(ctx) {
|
|
81839
|
-
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
81840
|
-
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
81841
|
-
if (c$1 === 10) break;
|
|
81842
|
-
if (c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
|
|
81843
|
-
ctx.p++;
|
|
81844
|
-
break;
|
|
81845
|
-
}
|
|
81846
|
-
if (c$1 < 32 && c$1 !== 9 || c$1 === 127) throw new TomlError("control characters are not allowed in comments", {
|
|
81847
|
-
toml: ctx.s,
|
|
81848
|
-
ptr: ctx.p
|
|
81849
|
-
});
|
|
81850
|
-
}
|
|
81851
|
-
}
|
|
81852
|
-
__name$1(skipComment, "skipComment");
|
|
81853
|
-
function skipVoid(ctx, banNewLines, banComments) {
|
|
81854
|
-
let c$1;
|
|
81855
|
-
while (1) {
|
|
81856
|
-
while ((c$1 = ctx.s.charCodeAt(ctx.p)) === 32 || c$1 === 9 || !banNewLines && (c$1 === 10 || c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) ctx.p++;
|
|
81857
|
-
if (banComments || c$1 !== 35) break;
|
|
81858
|
-
skipComment(ctx);
|
|
81859
|
-
}
|
|
81860
|
-
}
|
|
81861
|
-
__name$1(skipVoid, "skipVoid");
|
|
81862
|
-
function skipUntil(ctx, sep$1, end) {
|
|
81863
|
-
let ptr = ctx.p;
|
|
81864
|
-
if (!end) {
|
|
81865
|
-
ptr = indexOfNewline(ctx.s, ptr);
|
|
81866
|
-
ctx.p = ptr < 0 ? ctx.s.length : ptr;
|
|
81867
|
-
return;
|
|
81868
|
-
}
|
|
81869
|
-
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
81870
|
-
let c$1 = ctx.s.charCodeAt(ctx.p);
|
|
81871
|
-
if (c$1 === 35) skipComment(ctx);
|
|
81872
|
-
else if (c$1 === end || c$1 === sep$1) return;
|
|
81873
|
-
}
|
|
81874
|
-
throw new TomlError("cannot find end of structure", {
|
|
81875
|
-
toml: ctx.s,
|
|
81876
|
-
ptr
|
|
81877
|
-
});
|
|
81878
|
-
}
|
|
81879
|
-
__name$1(skipUntil, "skipUntil");
|
|
81880
|
-
var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
|
|
81881
|
-
var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
|
|
81882
|
-
var LEADING_ZERO = /^[+-]?0[0-9_]/;
|
|
81883
|
-
function parseString(ctx) {
|
|
81884
|
-
let start = ctx.p;
|
|
81885
|
-
let c$1 = ctx.s.charCodeAt(ctx.p++);
|
|
81886
|
-
let first = c$1;
|
|
81887
|
-
let isLiteral = c$1 === 39;
|
|
81888
|
-
let isMultiline = c$1 === ctx.s.charCodeAt(ctx.p) && c$1 === ctx.s.charCodeAt(ctx.p + 1);
|
|
81889
|
-
if (isMultiline) {
|
|
81890
|
-
if ((c$1 = ctx.s.charCodeAt(ctx.p += 2)) === 10) ctx.p++;
|
|
81891
|
-
else if (c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) ctx.p += 2;
|
|
81892
|
-
}
|
|
81893
|
-
let parsed = "";
|
|
81894
|
-
let sliceStart = ctx.p;
|
|
81895
|
-
let state = 0;
|
|
81896
|
-
for (; ctx.p < ctx.s.length; ctx.p++) {
|
|
81897
|
-
c$1 = ctx.s.charCodeAt(ctx.p);
|
|
81898
|
-
if (isMultiline && (c$1 === 10 || c$1 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) state = state && 3;
|
|
81899
|
-
else if (c$1 < 32 && c$1 !== 9 || c$1 === 127) throw new TomlError("control characters are not allowed in strings", {
|
|
81900
|
-
toml: ctx.s,
|
|
81901
|
-
ptr: ctx.p
|
|
81902
|
-
});
|
|
81903
|
-
else if ((!state || state === 3) && c$1 === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
|
|
81904
|
-
if (isMultiline) {
|
|
81905
|
-
if (ctx.s.charCodeAt(ctx.p + 3) === first) ctx.p++;
|
|
81906
|
-
if (ctx.s.charCodeAt(ctx.p + 3) === first) ctx.p++;
|
|
81907
|
-
}
|
|
81908
|
-
if (!state) parsed += ctx.s.slice(sliceStart, ctx.p);
|
|
81909
|
-
ctx.p += isMultiline ? 3 : 1;
|
|
81910
|
-
return parsed;
|
|
81911
|
-
} else if (!state) {
|
|
81912
|
-
if (!isLiteral && c$1 === 92) {
|
|
81913
|
-
parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p);
|
|
81914
|
-
state = 1;
|
|
81915
|
-
}
|
|
81916
|
-
} else if (state === 1) if (c$1 === 120 || c$1 === 117 || c$1 === 85) {
|
|
81917
|
-
let value = 0;
|
|
81918
|
-
let len = c$1 === 120 ? 2 : c$1 === 117 ? 4 : 8;
|
|
81919
|
-
for (let j$1 = 0; j$1 < len; j$1++, ctx.p++) {
|
|
81920
|
-
let hex$1 = ctx.s.charCodeAt(ctx.p + 1);
|
|
81921
|
-
let digit = hex$1 >= 48 && hex$1 <= 57 ? hex$1 - 48 : hex$1 >= 65 && hex$1 <= 70 ? hex$1 - 65 + 10 : hex$1 >= 97 && hex$1 <= 102 ? hex$1 - 97 + 10 : -1;
|
|
81922
|
-
if (digit < 0) throw new TomlError("invalid non-hex character in unicode escape", {
|
|
81923
|
-
toml: ctx.s,
|
|
81924
|
-
ptr: ctx.p + 1
|
|
81925
|
-
});
|
|
81926
|
-
value = value << 4 | digit;
|
|
81927
|
-
}
|
|
81928
|
-
if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) throw new TomlError("invalid unicode escape", {
|
|
81929
|
-
toml: ctx.s,
|
|
81930
|
-
ptr: ctx.p
|
|
81931
|
-
});
|
|
81932
|
-
parsed += String.fromCodePoint(value);
|
|
81933
|
-
sliceStart = ctx.p + 1;
|
|
81934
|
-
state = 0;
|
|
81935
|
-
} else if (c$1 === 32 || c$1 === 9) state = 2;
|
|
81936
|
-
else {
|
|
81937
|
-
if (c$1 === 98) parsed += "\b";
|
|
81938
|
-
else if (c$1 === 116) parsed += " ";
|
|
81939
|
-
else if (c$1 === 110) parsed += "\n";
|
|
81940
|
-
else if (c$1 === 102) parsed += "\f";
|
|
81941
|
-
else if (c$1 === 114) parsed += "\r";
|
|
81942
|
-
else if (c$1 === 101) parsed += "\x1B";
|
|
81943
|
-
else if (c$1 === 34) parsed += "\"";
|
|
81944
|
-
else if (c$1 === 92) parsed += "\\";
|
|
81945
|
-
else throw new TomlError("unrecognized escape sequence", {
|
|
81946
|
-
toml: ctx.s,
|
|
81947
|
-
ptr: ctx.p
|
|
81948
|
-
});
|
|
81949
|
-
sliceStart = ctx.p + 1;
|
|
81950
|
-
state = 0;
|
|
81951
|
-
}
|
|
81952
|
-
else if (c$1 !== 32 && c$1 !== 9) {
|
|
81953
|
-
if (state === 2) throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
|
|
81954
|
-
toml: ctx.s,
|
|
81955
|
-
ptr: sliceStart
|
|
81956
|
-
});
|
|
81957
|
-
state = !isLiteral && c$1 === 92 ? 1 : 0;
|
|
81958
|
-
sliceStart = ctx.p;
|
|
81959
|
-
}
|
|
81960
|
-
}
|
|
81961
|
-
throw new TomlError("unfinished string", {
|
|
81962
|
-
toml: ctx.s,
|
|
81963
|
-
ptr: start
|
|
81964
|
-
});
|
|
81965
|
-
}
|
|
81966
|
-
__name$1(parseString, "parseString");
|
|
81967
|
-
function sliceAndTrimEndOf(ctx, start, end) {
|
|
81968
|
-
let value = ctx.s.slice(start, end);
|
|
81969
|
-
let commentIdx = value.indexOf("#");
|
|
81970
|
-
if (commentIdx > 0) {
|
|
81971
|
-
skipComment({
|
|
81972
|
-
s: value,
|
|
81973
|
-
p: commentIdx
|
|
81974
|
-
});
|
|
81975
|
-
value = value.slice(0, commentIdx);
|
|
81976
|
-
}
|
|
81977
|
-
return value.trimEnd();
|
|
81978
|
-
}
|
|
81979
|
-
__name$1(sliceAndTrimEndOf, "sliceAndTrimEndOf");
|
|
81980
|
-
function parseValue(ctx, integersAsBigInt, end) {
|
|
81981
|
-
let ptr = ctx.p;
|
|
81982
|
-
let err = {
|
|
81983
|
-
toml: ctx.s,
|
|
81984
|
-
ptr
|
|
81985
|
-
};
|
|
81986
|
-
skipUntil(ctx, 44, end);
|
|
81987
|
-
let value = sliceAndTrimEndOf(ctx, ptr, ctx.p);
|
|
81988
|
-
if (!value) throw new TomlError("incomplete declaration: value expected", err);
|
|
81989
|
-
if (value === "-inf") return -Infinity;
|
|
81990
|
-
if (value === "inf" || value === "+inf") return Infinity;
|
|
81991
|
-
if (value === "nan" || value === "+nan" || value === "-nan") return NaN;
|
|
81992
|
-
if (value === "-0") return integersAsBigInt ? 0n : 0;
|
|
81993
|
-
let isInt = INT_REGEX.test(value);
|
|
81994
|
-
if (isInt || FLOAT_REGEX.test(value)) {
|
|
81995
|
-
if (LEADING_ZERO.test(value)) throw new TomlError("leading zeroes are not allowed", err);
|
|
81996
|
-
value = value.replace(/_/g, "");
|
|
81997
|
-
let numeric$1 = +value;
|
|
81998
|
-
if (isNaN(numeric$1)) throw new TomlError("invalid number", err);
|
|
81999
|
-
if (isInt) {
|
|
82000
|
-
if ((isInt = !Number.isSafeInteger(numeric$1)) && !integersAsBigInt) throw new TomlError("integer value cannot be represented losslessly", err);
|
|
82001
|
-
if (isInt || integersAsBigInt === true) numeric$1 = BigInt(value);
|
|
82002
|
-
}
|
|
82003
|
-
return numeric$1;
|
|
82004
|
-
}
|
|
82005
|
-
const date$3 = new TomlDate(value);
|
|
82006
|
-
if (!date$3.isValid()) throw new TomlError("invalid value", err);
|
|
82007
|
-
return date$3;
|
|
82008
|
-
}
|
|
82009
|
-
__name$1(parseValue, "parseValue");
|
|
82010
|
-
function extractValue(ctx, end, integersAsBigInt) {
|
|
82011
|
-
let ptr = ctx.p;
|
|
82012
|
-
let c$1 = ctx.s.charCodeAt(ptr);
|
|
82013
|
-
if (c$1 === 91 || c$1 === 123) {
|
|
82014
|
-
if (!ctx.d--) throw new TomlError("document contains excessively nested structures. aborting.", {
|
|
82015
|
-
toml: ctx.s,
|
|
82016
|
-
ptr
|
|
82017
|
-
});
|
|
82018
|
-
let value = c$1 === 91 ? parseArray(ctx, integersAsBigInt) : parseInlineTable(ctx, integersAsBigInt);
|
|
82019
|
-
ctx.d++;
|
|
82020
|
-
return value;
|
|
82021
|
-
}
|
|
82022
|
-
if (c$1 === 34 || c$1 === 39) return parseString(ctx);
|
|
82023
|
-
if (c$1 === 116) {
|
|
82024
|
-
if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101) throw new TomlError("invalid value", {
|
|
82025
|
-
toml: ctx.s,
|
|
82026
|
-
ptr
|
|
82027
|
-
});
|
|
82028
|
-
ctx.p++;
|
|
82029
|
-
return true;
|
|
82030
|
-
}
|
|
82031
|
-
if (c$1 === 102) {
|
|
82032
|
-
if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101) throw new TomlError("invalid value", {
|
|
82033
|
-
toml: ctx.s,
|
|
82034
|
-
ptr
|
|
82035
|
-
});
|
|
82036
|
-
ctx.p++;
|
|
82037
|
-
return false;
|
|
82038
|
-
}
|
|
82039
|
-
return parseValue(ctx, integersAsBigInt, end);
|
|
82040
|
-
}
|
|
82041
|
-
__name$1(extractValue, "extractValue");
|
|
82042
|
-
var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
82043
|
-
function parseKey(ctx, end = "=") {
|
|
82044
|
-
let start = ctx.p;
|
|
82045
|
-
let dot = start - 1;
|
|
82046
|
-
let parsed = [];
|
|
82047
|
-
let endPtr = ctx.s.indexOf(end, start);
|
|
82048
|
-
if (endPtr < 0) throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
82049
|
-
toml: ctx.s,
|
|
82050
|
-
ptr: start
|
|
82051
|
-
});
|
|
82052
|
-
do {
|
|
82053
|
-
let c$1 = ctx.s.charCodeAt(ctx.p = ++dot);
|
|
82054
|
-
if (c$1 !== 32 && c$1 !== 9) if (c$1 === 34 || c$1 === 39) {
|
|
82055
|
-
if (c$1 === ctx.s.charCodeAt(ctx.p + 1) && c$1 === ctx.s.charCodeAt(ctx.p + 2)) throw new TomlError("multiline strings are not allowed in keys", {
|
|
82056
|
-
toml: ctx.s,
|
|
82057
|
-
ptr: ctx.p
|
|
82058
|
-
});
|
|
82059
|
-
let part = parseString(ctx);
|
|
82060
|
-
dot = ctx.s.indexOf(".", ctx.p);
|
|
82061
|
-
let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
82062
|
-
let newLine = indexOfNewline(strEnd);
|
|
82063
|
-
if (newLine > -1) throw new TomlError("newlines are not allowed in keys", {
|
|
82064
|
-
toml: ctx.s,
|
|
82065
|
-
ptr: newLine
|
|
82066
|
-
});
|
|
82067
|
-
if (strEnd.trimStart()) throw new TomlError("found extra tokens after the string part", {
|
|
82068
|
-
toml: ctx.s,
|
|
82069
|
-
ptr: ctx.p
|
|
82070
|
-
});
|
|
82071
|
-
if (endPtr < ctx.p) {
|
|
82072
|
-
endPtr = ctx.s.indexOf(end, ctx.p);
|
|
82073
|
-
if (endPtr < 0) throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
82074
|
-
toml: ctx.s,
|
|
82075
|
-
ptr: start
|
|
82076
|
-
});
|
|
82077
|
-
}
|
|
82078
|
-
parsed.push(part);
|
|
82079
|
-
} else {
|
|
82080
|
-
dot = ctx.s.indexOf(".", ctx.p);
|
|
82081
|
-
let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
82082
|
-
if (!KEY_PART_RE.test(part)) throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
|
|
82083
|
-
toml: ctx.s,
|
|
82084
|
-
ptr: ctx.p
|
|
82085
|
-
});
|
|
82086
|
-
parsed.push(part.trimEnd());
|
|
82087
|
-
}
|
|
82088
|
-
} while (dot + 1 && dot < endPtr);
|
|
82089
|
-
ctx.p = endPtr + 1;
|
|
82090
|
-
skipVoid(ctx, true, true);
|
|
82091
|
-
return parsed;
|
|
82092
|
-
}
|
|
82093
|
-
__name$1(parseKey, "parseKey");
|
|
82094
|
-
function parseInlineTable(ctx, integersAsBigInt) {
|
|
82095
|
-
let res = {};
|
|
82096
|
-
let seen = /* @__PURE__ */ new Set();
|
|
82097
|
-
let c$1;
|
|
82098
|
-
ctx.p++;
|
|
82099
|
-
while (ctx.p < ctx.s.length) {
|
|
82100
|
-
skipVoid(ctx);
|
|
82101
|
-
if ((c$1 = ctx.s.charCodeAt(ctx.p)) === 125) {
|
|
82102
|
-
ctx.p++;
|
|
82103
|
-
return res;
|
|
82104
|
-
}
|
|
82105
|
-
let k;
|
|
82106
|
-
let t$5 = res;
|
|
82107
|
-
let hasOwn$1 = false;
|
|
82108
|
-
let p$2 = ctx.p;
|
|
82109
|
-
let key = parseKey(ctx);
|
|
82110
|
-
for (let i$1 = 0; i$1 < key.length; i$1++) {
|
|
82111
|
-
if (i$1) t$5 = hasOwn$1 ? t$5[k] : t$5[k] = {};
|
|
82112
|
-
k = key[i$1];
|
|
82113
|
-
if ((hasOwn$1 = Object.hasOwn(t$5, k)) && (typeof t$5[k] !== "object" || seen.has(t$5[k]))) throw new TomlError("trying to redefine an already defined value", {
|
|
82114
|
-
toml: ctx.s,
|
|
82115
|
-
ptr: p$2
|
|
82116
|
-
});
|
|
82117
|
-
if (!hasOwn$1 && k === "__proto__") Object.defineProperty(t$5, k, {
|
|
82118
|
-
enumerable: true,
|
|
82119
|
-
configurable: true,
|
|
82120
|
-
writable: true
|
|
82121
|
-
});
|
|
82122
|
-
}
|
|
82123
|
-
if (hasOwn$1) throw new TomlError("trying to redefine an already defined value", {
|
|
82124
|
-
toml: ctx.s,
|
|
82125
|
-
ptr: ctx.p
|
|
82126
|
-
});
|
|
82127
|
-
let value = extractValue(ctx, 125, integersAsBigInt);
|
|
82128
|
-
seen.add(t$5[k] = value);
|
|
82129
|
-
skipVoid(ctx);
|
|
82130
|
-
if ((c$1 = ctx.s.charCodeAt(ctx.p++)) === 125) return res;
|
|
82131
|
-
if (c$1 !== 44) throw new TomlError("expected comma or end of structure", {
|
|
82132
|
-
toml: ctx.s,
|
|
82133
|
-
ptr: ctx.p - 1
|
|
82134
|
-
});
|
|
82135
|
-
}
|
|
82136
|
-
throw new TomlError("unfinished table encountered", {
|
|
82137
|
-
toml: ctx.s,
|
|
82138
|
-
ptr: ctx.p
|
|
82139
|
-
});
|
|
82140
|
-
}
|
|
82141
|
-
__name$1(parseInlineTable, "parseInlineTable");
|
|
82142
|
-
function parseArray(ctx, integersAsBigInt) {
|
|
82143
|
-
let res = [];
|
|
82144
|
-
let c$1;
|
|
82145
|
-
ctx.p++;
|
|
82146
|
-
while (ctx.p < ctx.s.length) {
|
|
82147
|
-
skipVoid(ctx);
|
|
82148
|
-
if ((c$1 = ctx.s.charCodeAt(ctx.p)) === 93) {
|
|
82149
|
-
ctx.p++;
|
|
82150
|
-
return res;
|
|
82151
|
-
}
|
|
82152
|
-
res.push(extractValue(ctx, 93, integersAsBigInt));
|
|
82153
|
-
skipVoid(ctx);
|
|
82154
|
-
if ((c$1 = ctx.s.charCodeAt(ctx.p++)) === 93) return res;
|
|
82155
|
-
if (c$1 !== 44) throw new TomlError("expected comma or end of structure", {
|
|
82156
|
-
toml: ctx.s,
|
|
82157
|
-
ptr: ctx.p - 1
|
|
82158
|
-
});
|
|
82159
|
-
}
|
|
82160
|
-
throw new TomlError("unfinished array encountered", {
|
|
82161
|
-
toml: ctx.s,
|
|
82162
|
-
ptr: ctx.p
|
|
82163
|
-
});
|
|
82164
|
-
}
|
|
82165
|
-
__name$1(parseArray, "parseArray");
|
|
82166
|
-
function peekTable(key, table, meta$3, type) {
|
|
82167
|
-
let t$5 = table;
|
|
82168
|
-
let m = meta$3;
|
|
82169
|
-
let k;
|
|
82170
|
-
let hasOwn$1 = false;
|
|
82171
|
-
let state;
|
|
82172
|
-
for (let i$1 = 0; i$1 < key.length; i$1++) {
|
|
82173
|
-
if (i$1) {
|
|
82174
|
-
t$5 = hasOwn$1 ? t$5[k] : t$5[k] = {};
|
|
82175
|
-
m = (state = m[k]).c;
|
|
82176
|
-
if (type === 0 && (state.t === 1 || state.t === 2)) return null;
|
|
82177
|
-
if (state.t === 2) {
|
|
82178
|
-
let l = t$5.length - 1;
|
|
82179
|
-
t$5 = t$5[l];
|
|
82180
|
-
m = m[l].c;
|
|
82181
|
-
}
|
|
82182
|
-
}
|
|
82183
|
-
k = key[i$1];
|
|
82184
|
-
if ((hasOwn$1 = Object.hasOwn(t$5, k)) && m[k]?.t === 0 && m[k]?.d) return null;
|
|
82185
|
-
if (!hasOwn$1) {
|
|
82186
|
-
if (k === "__proto__") {
|
|
82187
|
-
Object.defineProperty(t$5, k, {
|
|
82188
|
-
enumerable: true,
|
|
82189
|
-
configurable: true,
|
|
82190
|
-
writable: true
|
|
82191
|
-
});
|
|
82192
|
-
Object.defineProperty(m, k, {
|
|
82193
|
-
enumerable: true,
|
|
82194
|
-
configurable: true,
|
|
82195
|
-
writable: true
|
|
82196
|
-
});
|
|
82197
|
-
}
|
|
82198
|
-
m[k] = {
|
|
82199
|
-
t: i$1 < key.length - 1 && type === 2 ? 3 : type,
|
|
82200
|
-
d: false,
|
|
82201
|
-
i: 0,
|
|
82202
|
-
c: {}
|
|
82203
|
-
};
|
|
82204
|
-
}
|
|
82205
|
-
}
|
|
82206
|
-
state = m[k];
|
|
82207
|
-
if (state.t !== type && !(type === 1 && state.t === 3)) return null;
|
|
82208
|
-
if (type === 2) {
|
|
82209
|
-
if (!state.d) {
|
|
82210
|
-
state.d = true;
|
|
82211
|
-
t$5[k] = [];
|
|
82212
|
-
}
|
|
82213
|
-
t$5[k].push(t$5 = {});
|
|
82214
|
-
state.c[state.i++] = state = {
|
|
82215
|
-
t: 1,
|
|
82216
|
-
d: false,
|
|
82217
|
-
i: 0,
|
|
82218
|
-
c: {}
|
|
82219
|
-
};
|
|
82220
|
-
}
|
|
82221
|
-
if (state.d) return null;
|
|
82222
|
-
state.d = true;
|
|
82223
|
-
if (type === 1) t$5 = hasOwn$1 ? t$5[k] : t$5[k] = {};
|
|
82224
|
-
else if (type === 0 && hasOwn$1) return null;
|
|
82225
|
-
return [
|
|
82226
|
-
k,
|
|
82227
|
-
t$5,
|
|
82228
|
-
state.c
|
|
82229
|
-
];
|
|
82230
|
-
}
|
|
82231
|
-
__name$1(peekTable, "peekTable");
|
|
82232
|
-
function parse$2(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
|
|
82233
|
-
let ctx = {
|
|
82234
|
-
s: toml,
|
|
82235
|
-
p: 0,
|
|
82236
|
-
d: maxDepth
|
|
82237
|
-
};
|
|
82238
|
-
let res = {};
|
|
82239
|
-
let meta$3 = {};
|
|
82240
|
-
let tmp;
|
|
82241
|
-
let tbl = res;
|
|
82242
|
-
let m = meta$3;
|
|
82243
|
-
skipVoid(ctx);
|
|
82244
|
-
while (ctx.p < toml.length) {
|
|
82245
|
-
if (toml.charCodeAt(ctx.p) === 91) {
|
|
82246
|
-
let isTableArray = toml.charCodeAt(++ctx.p) === 91;
|
|
82247
|
-
tmp = ctx.p += +isTableArray;
|
|
82248
|
-
let k = parseKey(ctx, "]");
|
|
82249
|
-
if (isTableArray) {
|
|
82250
|
-
if (toml.charCodeAt(ctx.p - 1) !== 93) throw new TomlError("expected end of table declaration", {
|
|
82251
|
-
toml,
|
|
82252
|
-
ptr: ctx.p - 1
|
|
82253
|
-
});
|
|
82254
|
-
ctx.p++;
|
|
82255
|
-
}
|
|
82256
|
-
let p$2 = peekTable(k, res, meta$3, isTableArray ? 2 : 1);
|
|
82257
|
-
if (!p$2) throw new TomlError("trying to redefine an already defined table or value", {
|
|
82258
|
-
toml,
|
|
82259
|
-
ptr: tmp
|
|
82260
|
-
});
|
|
82261
|
-
m = p$2[2];
|
|
82262
|
-
tbl = p$2[1];
|
|
82263
|
-
} else {
|
|
82264
|
-
tmp = ctx.p;
|
|
82265
|
-
let p$2 = peekTable(parseKey(ctx), tbl, m, 0);
|
|
82266
|
-
if (!p$2) throw new TomlError("trying to redefine an already defined table or value", {
|
|
82267
|
-
toml,
|
|
82268
|
-
ptr: tmp
|
|
82269
|
-
});
|
|
82270
|
-
p$2[1][p$2[0]] = extractValue(ctx, void 0, integersAsBigInt);
|
|
82271
|
-
}
|
|
82272
|
-
skipVoid(ctx, true);
|
|
82273
|
-
if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) throw new TomlError("each key-value declaration must be followed by an end-of-line", {
|
|
82274
|
-
toml,
|
|
82275
|
-
ptr: ctx.p
|
|
82276
|
-
});
|
|
82277
|
-
skipVoid(ctx);
|
|
82278
|
-
}
|
|
82279
|
-
return res;
|
|
82280
|
-
}
|
|
82281
|
-
__name$1(parse$2, "parse");
|
|
82282
81857
|
var BARE_KEY = /^[a-z0-9-_]+$/i;
|
|
81858
|
+
var HAS_WELLFORMED = !!"".isWellFormed;
|
|
82283
81859
|
function extendedTypeOf(obj) {
|
|
82284
81860
|
let type = typeof obj;
|
|
82285
81861
|
if (type === "object") {
|
|
82286
81862
|
if (Array.isArray(obj)) return "array";
|
|
82287
|
-
if (typeof obj
|
|
82288
|
-
if (globalThis.Temporal
|
|
81863
|
+
if (typeof obj.getUTCDate === "function" && obj instanceof Date) return "date";
|
|
81864
|
+
if (globalThis.Temporal) {
|
|
81865
|
+
if (obj.until) {
|
|
81866
|
+
if (obj instanceof Temporal.ZonedDateTime) return "temporal/tz+uc";
|
|
81867
|
+
if (obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainDate) return "temporal/uc";
|
|
81868
|
+
if (obj instanceof Temporal.PlainTime || obj instanceof Temporal.Instant) return "temporal";
|
|
81869
|
+
if (obj instanceof Temporal.PlainYearMonth) return "temporal/x";
|
|
81870
|
+
} else if (obj.toPlainDate && obj instanceof Temporal.PlainMonthDay || obj.negated && obj instanceof Temporal.Duration) return "temporal/x";
|
|
81871
|
+
}
|
|
82289
81872
|
}
|
|
82290
81873
|
return type;
|
|
82291
81874
|
}
|
|
@@ -82295,18 +81878,21 @@ function isArrayOfTables(obj) {
|
|
|
82295
81878
|
return obj.length != 0;
|
|
82296
81879
|
}
|
|
82297
81880
|
__name$1(isArrayOfTables, "isArrayOfTables");
|
|
81881
|
+
function formatWellFormedStringUnchecked(s) {
|
|
81882
|
+
return JSON.stringify(s).replaceAll("", "\\u007f");
|
|
81883
|
+
}
|
|
81884
|
+
__name$1(formatWellFormedStringUnchecked, "formatWellFormedStringUnchecked");
|
|
82298
81885
|
function formatString(s) {
|
|
82299
|
-
return
|
|
81886
|
+
return formatWellFormedStringUnchecked(HAS_WELLFORMED ? s.toWellFormed() : s);
|
|
82300
81887
|
}
|
|
82301
81888
|
__name$1(formatString, "formatString");
|
|
82302
|
-
function
|
|
82303
|
-
|
|
82304
|
-
|
|
82305
|
-
|
|
82306
|
-
});
|
|
81889
|
+
function formatKey(s) {
|
|
81890
|
+
if (BARE_KEY.test(s)) return s;
|
|
81891
|
+
if (HAS_WELLFORMED && !s.isWellFormed()) throw new RangeError("key contains illegal lone surrogates");
|
|
81892
|
+
return formatWellFormedStringUnchecked(s);
|
|
82307
81893
|
}
|
|
82308
|
-
__name$1(
|
|
82309
|
-
function stringifyValue(val, type, depth$1, numberAsFloat) {
|
|
81894
|
+
__name$1(formatKey, "formatKey");
|
|
81895
|
+
function stringifyValue(val, type, depth$1, numberAsFloat, strictTemporal) {
|
|
82310
81896
|
if (depth$1 === 0) throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
82311
81897
|
switch (type) {
|
|
82312
81898
|
case "number":
|
|
@@ -82315,54 +81901,64 @@ function stringifyValue(val, type, depth$1, numberAsFloat) {
|
|
|
82315
81901
|
if (val === -Infinity) return "-inf";
|
|
82316
81902
|
if (Number.isInteger(val) && (numberAsFloat || !Number.isSafeInteger(val))) return val.toFixed(1);
|
|
82317
81903
|
case "bigint":
|
|
82318
|
-
case "boolean":
|
|
81904
|
+
case "boolean":
|
|
81905
|
+
case "temporal": return val.toString();
|
|
82319
81906
|
case "string": return formatString(val);
|
|
82320
81907
|
case "date":
|
|
82321
81908
|
if (isNaN(val.getTime())) throw new TypeError("cannot serialize invalid date");
|
|
82322
81909
|
return val.toISOString();
|
|
82323
|
-
case "object": return stringifyInlineTable(val, depth$1, numberAsFloat);
|
|
82324
|
-
case "array": return stringifyArray(val, depth$1, numberAsFloat);
|
|
82325
|
-
case "temporal":
|
|
81910
|
+
case "object": return stringifyInlineTable(val, depth$1, numberAsFloat, strictTemporal);
|
|
81911
|
+
case "array": return stringifyArray(val, depth$1, numberAsFloat, strictTemporal);
|
|
81912
|
+
case "temporal/tz+uc": if (strictTemporal) {
|
|
81913
|
+
let tz = val.timeZoneId;
|
|
81914
|
+
let tzc = tz.charCodeAt(0);
|
|
81915
|
+
if (tzc !== 43 && tzc !== 45 && (tzc !== 85 && tzc !== 71 && tzc !== 90 && tzc !== 69 || tz !== "UTC" && tz !== "UCT" && tz !== "Universal" && tz !== "Zulu" && !tz.startsWith("GMT") && tz !== "Greenwich" && !tz.startsWith("Etc/"))) throw new TypeError("Temporal objects with an IANA timezone are not allowed in Temporal strict mode");
|
|
81916
|
+
}
|
|
81917
|
+
case "temporal/uc":
|
|
81918
|
+
if (strictTemporal && val.calendarId !== "iso8601") throw new TypeError("Temporal objects with a non-default calendar are not allowed in Temporal strict mode");
|
|
81919
|
+
return val.toString({
|
|
81920
|
+
calendarName: "never",
|
|
81921
|
+
timeZoneName: "never"
|
|
81922
|
+
});
|
|
81923
|
+
case "temporal/x": throw new TypeError("Unsupported " + val[Symbol.toStringTag]);
|
|
82326
81924
|
}
|
|
82327
81925
|
}
|
|
82328
81926
|
__name$1(stringifyValue, "stringifyValue");
|
|
82329
|
-
function stringifyInlineTable(obj, depth$1, numberAsFloat) {
|
|
81927
|
+
function stringifyInlineTable(obj, depth$1, numberAsFloat, strictTemporal) {
|
|
82330
81928
|
let keys = Object.keys(obj);
|
|
82331
81929
|
if (keys.length === 0) return "{}";
|
|
82332
81930
|
let res = "{ ";
|
|
82333
81931
|
for (let i$1 = 0; i$1 < keys.length; i$1++) {
|
|
82334
81932
|
let k = keys[i$1];
|
|
82335
81933
|
if (i$1) res += ", ";
|
|
82336
|
-
res +=
|
|
82337
|
-
res += " = ";
|
|
82338
|
-
res += stringifyValue(obj[k], extendedTypeOf(obj[k]), depth$1 - 1, numberAsFloat);
|
|
81934
|
+
res += formatKey(k) + " = " + stringifyValue(obj[k], extendedTypeOf(obj[k]), depth$1 - 1, numberAsFloat, strictTemporal);
|
|
82339
81935
|
}
|
|
82340
81936
|
return res + " }";
|
|
82341
81937
|
}
|
|
82342
81938
|
__name$1(stringifyInlineTable, "stringifyInlineTable");
|
|
82343
|
-
function stringifyArray(array$2, depth$1, numberAsFloat) {
|
|
81939
|
+
function stringifyArray(array$2, depth$1, numberAsFloat, strictTemporal) {
|
|
82344
81940
|
if (array$2.length === 0) return "[]";
|
|
82345
81941
|
let res = "[ ";
|
|
82346
81942
|
for (let i$1 = 0; i$1 < array$2.length; i$1++) {
|
|
82347
81943
|
if (i$1) res += ", ";
|
|
82348
81944
|
if (array$2[i$1] === null || array$2[i$1] === void 0) throw new TypeError("arrays cannot contain null or undefined values");
|
|
82349
|
-
res += stringifyValue(array$2[i$1], extendedTypeOf(array$2[i$1]), depth$1 - 1, numberAsFloat);
|
|
81945
|
+
res += stringifyValue(array$2[i$1], extendedTypeOf(array$2[i$1]), depth$1 - 1, numberAsFloat, strictTemporal);
|
|
82350
81946
|
}
|
|
82351
81947
|
return res + " ]";
|
|
82352
81948
|
}
|
|
82353
81949
|
__name$1(stringifyArray, "stringifyArray");
|
|
82354
|
-
function stringifyArrayTable(array$2, key, depth$1, numberAsFloat) {
|
|
81950
|
+
function stringifyArrayTable(array$2, key, depth$1, numberAsFloat, strictTemporal) {
|
|
82355
81951
|
if (depth$1 === 0) throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
82356
81952
|
let res = "";
|
|
82357
81953
|
for (let i$1 = 0; i$1 < array$2.length; i$1++) {
|
|
82358
81954
|
res += `${res && "\n"}[[${key}]]
|
|
82359
81955
|
`;
|
|
82360
|
-
res += stringifyTable(0, array$2[i$1], key, depth$1, numberAsFloat);
|
|
81956
|
+
res += stringifyTable(0, array$2[i$1], key, depth$1, numberAsFloat, strictTemporal);
|
|
82361
81957
|
}
|
|
82362
81958
|
return res;
|
|
82363
81959
|
}
|
|
82364
81960
|
__name$1(stringifyArrayTable, "stringifyArrayTable");
|
|
82365
|
-
function stringifyTable(tableKey, obj, prefix, depth$1, numberAsFloat) {
|
|
81961
|
+
function stringifyTable(tableKey, obj, prefix, depth$1, numberAsFloat, strictTemporal) {
|
|
82366
81962
|
if (depth$1 === 0) throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
82367
81963
|
let preamble = "";
|
|
82368
81964
|
let tables = "";
|
|
@@ -82372,15 +81968,15 @@ function stringifyTable(tableKey, obj, prefix, depth$1, numberAsFloat) {
|
|
|
82372
81968
|
if (obj[k] !== null && obj[k] !== void 0) {
|
|
82373
81969
|
let type = extendedTypeOf(obj[k]);
|
|
82374
81970
|
if (type === "symbol" || type === "function") throw new TypeError(`cannot serialize values of type '${type}'`);
|
|
82375
|
-
let key =
|
|
82376
|
-
if (type === "array" && isArrayOfTables(obj[k])) tables += (tables && "\n") + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth$1 - 1, numberAsFloat);
|
|
81971
|
+
let key = formatKey(k);
|
|
81972
|
+
if (type === "array" && isArrayOfTables(obj[k])) tables += (tables && "\n") + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth$1 - 1, numberAsFloat, strictTemporal);
|
|
82377
81973
|
else if (type === "object") {
|
|
82378
81974
|
let tblKey = prefix ? `${prefix}.${key}` : key;
|
|
82379
|
-
tables += (tables && "\n") + stringifyTable(tblKey, obj[k], tblKey, depth$1 - 1, numberAsFloat);
|
|
81975
|
+
tables += (tables && "\n") + stringifyTable(tblKey, obj[k], tblKey, depth$1 - 1, numberAsFloat, strictTemporal);
|
|
82380
81976
|
} else {
|
|
82381
81977
|
preamble += key;
|
|
82382
81978
|
preamble += " = ";
|
|
82383
|
-
preamble += stringifyValue(obj[k], type, depth$1, numberAsFloat);
|
|
81979
|
+
preamble += stringifyValue(obj[k], type, depth$1, numberAsFloat, strictTemporal);
|
|
82384
81980
|
preamble += "\n";
|
|
82385
81981
|
}
|
|
82386
81982
|
}
|
|
@@ -82391,23 +81987,17 @@ ${preamble}` : `[${tableKey}]`;
|
|
|
82391
81987
|
${tables}` : preamble || tables;
|
|
82392
81988
|
}
|
|
82393
81989
|
__name$1(stringifyTable, "stringifyTable");
|
|
82394
|
-
function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
|
|
81990
|
+
function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false, strictTemporal = false } = {}) {
|
|
82395
81991
|
if (extendedTypeOf(obj) !== "object") throw new TypeError("stringify can only be called with an object");
|
|
82396
|
-
let str = stringifyTable(0, obj, "", maxDepth, numbersAsFloat);
|
|
81992
|
+
let str = stringifyTable(0, obj, "", maxDepth, numbersAsFloat, strictTemporal);
|
|
82397
81993
|
if (str[str.length - 1] !== "\n") return str + "\n";
|
|
82398
81994
|
return str;
|
|
82399
81995
|
}
|
|
82400
81996
|
__name$1(stringify, "stringify");
|
|
82401
|
-
var dist_default = {
|
|
82402
|
-
parse: parse$2,
|
|
82403
|
-
stringify,
|
|
82404
|
-
TomlDate,
|
|
82405
|
-
TomlError
|
|
82406
|
-
};
|
|
82407
81997
|
var FILE_FORMATS = {
|
|
82408
81998
|
toml: {
|
|
82409
81999
|
parse: /* @__PURE__ */ __name$1((raw) => parseTOML(raw), "parse"),
|
|
82410
|
-
stringify: /* @__PURE__ */ __name$1((value) =>
|
|
82000
|
+
stringify: /* @__PURE__ */ __name$1((value) => stringify(value), "stringify")
|
|
82411
82001
|
},
|
|
82412
82002
|
json: {
|
|
82413
82003
|
parse: /* @__PURE__ */ __name$1((raw) => JSON.parse(raw), "parse"),
|
|
@@ -83152,7 +82742,7 @@ function scrubEncryptedCredentials(options) {
|
|
|
83152
82742
|
__name$1(scrubEncryptedCredentials, "scrubEncryptedCredentials");
|
|
83153
82743
|
|
|
83154
82744
|
//#endregion
|
|
83155
|
-
//#region ../workers-auth/dist/chunk-
|
|
82745
|
+
//#region ../workers-auth/dist/chunk-V6MEAFHI.mjs
|
|
83156
82746
|
function createPreferences(getConfigPath) {
|
|
83157
82747
|
function getUserPreferencesPath() {
|
|
83158
82748
|
return path__default.resolve(getConfigPath(), "preferences.json");
|
|
@@ -85667,7 +85257,7 @@ __name(createWorkerUploadForm, "createWorkerUploadForm");
|
|
|
85667
85257
|
//#endregion
|
|
85668
85258
|
//#region ../remote-bindings/dist/index.mjs
|
|
85669
85259
|
var import_undici = require_undici();
|
|
85670
|
-
var version$2 = "0.0.
|
|
85260
|
+
var version$2 = "0.0.34";
|
|
85671
85261
|
var NoDefaultValueProvided = class extends UserError {
|
|
85672
85262
|
constructor() {
|
|
85673
85263
|
super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
|