tempest.games 0.1.45 → 0.1.46

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.
@@ -1947,7 +1947,7 @@ function osUsername() {
1947
1947
  }
1948
1948
  }
1949
1949
 
1950
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/entity.js
1950
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/entity.js
1951
1951
  var entityKind = Symbol.for("drizzle:entityKind");
1952
1952
  var hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
1953
1953
  function is(value, type) {
@@ -1972,7 +1972,7 @@ function is(value, type) {
1972
1972
  return false;
1973
1973
  }
1974
1974
 
1975
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/logger.js
1975
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/logger.js
1976
1976
  class ConsoleLogWriter {
1977
1977
  static [entityKind] = "ConsoleLogWriter";
1978
1978
  write(message) {
@@ -2004,7 +2004,7 @@ class NoopLogger {
2004
2004
  logQuery() {}
2005
2005
  }
2006
2006
 
2007
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/query-promise.js
2007
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/query-promise.js
2008
2008
  class QueryPromise {
2009
2009
  static [entityKind] = "QueryPromise";
2010
2010
  [Symbol.toStringTag] = "QueryPromise";
@@ -2025,7 +2025,7 @@ class QueryPromise {
2025
2025
  }
2026
2026
  }
2027
2027
 
2028
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/column.js
2028
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/column.js
2029
2029
  class Column {
2030
2030
  constructor(table, config) {
2031
2031
  this.table = table;
@@ -2075,20 +2075,20 @@ class Column {
2075
2075
  }
2076
2076
  }
2077
2077
 
2078
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/table.utils.js
2078
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/table.utils.js
2079
2079
  var TableName = Symbol.for("drizzle:Name");
2080
2080
 
2081
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/tracing-utils.js
2081
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/tracing-utils.js
2082
2082
  function iife(fn, ...args) {
2083
2083
  return fn(...args);
2084
2084
  }
2085
2085
 
2086
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/unique-constraint.js
2086
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/unique-constraint.js
2087
2087
  function uniqueKeyName(table, columns) {
2088
2088
  return `${table[TableName]}_${columns.join("_")}_unique`;
2089
2089
  }
2090
2090
 
2091
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/common.js
2091
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/common.js
2092
2092
  class PgColumn extends Column {
2093
2093
  constructor(table, config) {
2094
2094
  if (!config.uniqueName) {
@@ -2137,7 +2137,19 @@ class ExtraConfigColumn extends PgColumn {
2137
2137
  }
2138
2138
  }
2139
2139
 
2140
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/enum.js
2140
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/enum.js
2141
+ class PgEnumObjectColumn extends PgColumn {
2142
+ static [entityKind] = "PgEnumObjectColumn";
2143
+ enum;
2144
+ enumValues = this.config.enum.enumValues;
2145
+ constructor(table, config) {
2146
+ super(table, config);
2147
+ this.enum = config.enum;
2148
+ }
2149
+ getSQLType() {
2150
+ return this.enum.enumName;
2151
+ }
2152
+ }
2141
2153
  var isPgEnumSym = Symbol.for("drizzle:isPgEnum");
2142
2154
  function isPgEnum(obj) {
2143
2155
  return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
@@ -2155,7 +2167,7 @@ class PgEnumColumn extends PgColumn {
2155
2167
  }
2156
2168
  }
2157
2169
 
2158
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/subquery.js
2170
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/subquery.js
2159
2171
  class Subquery {
2160
2172
  static [entityKind] = "Subquery";
2161
2173
  constructor(sql, selection, alias, isWith = false) {
@@ -2173,10 +2185,10 @@ class WithSubquery extends Subquery {
2173
2185
  static [entityKind] = "WithSubquery";
2174
2186
  }
2175
2187
 
2176
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/version.js
2177
- var version = "0.41.0";
2188
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/version.js
2189
+ var version = "0.42.0";
2178
2190
 
2179
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/tracing.js
2191
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/tracing.js
2180
2192
  var otel;
2181
2193
  var rawTracer;
2182
2194
  var tracer = {
@@ -2203,10 +2215,10 @@ var tracer = {
2203
2215
  }
2204
2216
  };
2205
2217
 
2206
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/view-common.js
2218
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/view-common.js
2207
2219
  var ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
2208
2220
 
2209
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/table.js
2221
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/table.js
2210
2222
  var Schema = Symbol.for("drizzle:Schema");
2211
2223
  var Columns = Symbol.for("drizzle:Columns");
2212
2224
  var ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
@@ -2250,7 +2262,7 @@ function getTableUniqueName(table) {
2250
2262
  return `${table[Schema] ?? "public"}.${table[TableName]}`;
2251
2263
  }
2252
2264
 
2253
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/sql/sql.js
2265
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/sql/sql.js
2254
2266
  function isSQLWrapper(value) {
2255
2267
  return value !== null && value !== undefined && typeof value.getSQL === "function";
2256
2268
  }
@@ -2623,7 +2635,7 @@ Subquery.prototype.getSQL = function() {
2623
2635
  return new SQL([this]);
2624
2636
  };
2625
2637
 
2626
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/alias.js
2638
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/alias.js
2627
2639
  class ColumnAliasProxyHandler {
2628
2640
  constructor(table) {
2629
2641
  this.table = table;
@@ -2702,7 +2714,7 @@ function mapColumnsInSQLToAlias(query, alias) {
2702
2714
  }));
2703
2715
  }
2704
2716
 
2705
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/selection-proxy.js
2717
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/selection-proxy.js
2706
2718
  class SelectionProxyHandler {
2707
2719
  static [entityKind] = "SelectionProxyHandler";
2708
2720
  config;
@@ -2754,7 +2766,7 @@ class SelectionProxyHandler {
2754
2766
  }
2755
2767
  }
2756
2768
 
2757
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/utils.js
2769
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/utils.js
2758
2770
  function mapResultRow(columns, row, joinsNotNullableMap) {
2759
2771
  const nullifyMap = {};
2760
2772
  const result = columns.reduce((result2, { path, field }, columnIndex) => {
@@ -2899,7 +2911,7 @@ function isConfig(data) {
2899
2911
  return false;
2900
2912
  }
2901
2913
 
2902
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/delete.js
2914
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/delete.js
2903
2915
  class PgDeleteBase extends QueryPromise {
2904
2916
  constructor(table, session, dialect, withList) {
2905
2917
  super();
@@ -2955,7 +2967,7 @@ class PgDeleteBase extends QueryPromise {
2955
2967
  }
2956
2968
  }
2957
2969
 
2958
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/casing.js
2970
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/casing.js
2959
2971
  function toSnakeCase(input) {
2960
2972
  const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
2961
2973
  return words.map((word) => word.toLowerCase()).join("_");
@@ -3008,7 +3020,7 @@ class CasingCache {
3008
3020
  }
3009
3021
  }
3010
3022
 
3011
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/errors.js
3023
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/errors.js
3012
3024
  class DrizzleError extends Error {
3013
3025
  static [entityKind] = "DrizzleError";
3014
3026
  constructor({ message, cause }) {
@@ -3025,7 +3037,7 @@ class TransactionRollbackError extends DrizzleError {
3025
3037
  }
3026
3038
  }
3027
3039
 
3028
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/date.js
3040
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/date.js
3029
3041
  class PgDate extends PgColumn {
3030
3042
  static [entityKind] = "PgDate";
3031
3043
  getSQLType() {
@@ -3045,7 +3057,7 @@ class PgDateString extends PgColumn {
3045
3057
  }
3046
3058
  }
3047
3059
 
3048
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/json.js
3060
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/json.js
3049
3061
  class PgJson extends PgColumn {
3050
3062
  static [entityKind] = "PgJson";
3051
3063
  constructor(table, config) {
@@ -3069,7 +3081,7 @@ class PgJson extends PgColumn {
3069
3081
  }
3070
3082
  }
3071
3083
 
3072
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/jsonb.js
3084
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/jsonb.js
3073
3085
  class PgJsonb extends PgColumn {
3074
3086
  static [entityKind] = "PgJsonb";
3075
3087
  constructor(table, config) {
@@ -3093,7 +3105,7 @@ class PgJsonb extends PgColumn {
3093
3105
  }
3094
3106
  }
3095
3107
 
3096
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/numeric.js
3108
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/numeric.js
3097
3109
  class PgNumeric extends PgColumn {
3098
3110
  static [entityKind] = "PgNumeric";
3099
3111
  precision;
@@ -3119,7 +3131,7 @@ class PgNumeric extends PgColumn {
3119
3131
  }
3120
3132
  }
3121
3133
 
3122
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/time.js
3134
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/time.js
3123
3135
  class PgTime extends PgColumn {
3124
3136
  static [entityKind] = "PgTime";
3125
3137
  withTimezone;
@@ -3135,7 +3147,7 @@ class PgTime extends PgColumn {
3135
3147
  }
3136
3148
  }
3137
3149
 
3138
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/timestamp.js
3150
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/timestamp.js
3139
3151
  class PgTimestamp extends PgColumn {
3140
3152
  static [entityKind] = "PgTimestamp";
3141
3153
  withTimezone;
@@ -3171,7 +3183,7 @@ class PgTimestampString extends PgColumn {
3171
3183
  }
3172
3184
  }
3173
3185
 
3174
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/uuid.js
3186
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/columns/uuid.js
3175
3187
  class PgUUID extends PgColumn {
3176
3188
  static [entityKind] = "PgUUID";
3177
3189
  getSQLType() {
@@ -3179,7 +3191,7 @@ class PgUUID extends PgColumn {
3179
3191
  }
3180
3192
  }
3181
3193
 
3182
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/table.js
3194
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/table.js
3183
3195
  var InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
3184
3196
  var EnableRLS = Symbol.for("drizzle:EnableRLS");
3185
3197
 
@@ -3195,7 +3207,7 @@ class PgTable extends Table {
3195
3207
  [Table.Symbol.ExtraConfigColumns] = {};
3196
3208
  }
3197
3209
 
3198
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/primary-keys.js
3210
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/primary-keys.js
3199
3211
  class PrimaryKeyBuilder {
3200
3212
  static [entityKind] = "PgPrimaryKeyBuilder";
3201
3213
  columns;
@@ -3223,7 +3235,7 @@ class PrimaryKey {
3223
3235
  }
3224
3236
  }
3225
3237
 
3226
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/sql/expressions/conditions.js
3238
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/sql/expressions/conditions.js
3227
3239
  function bindIfParam(value, column) {
3228
3240
  if (isDriverValueEncoder(column) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column) && !is(value, Table) && !is(value, View)) {
3229
3241
  return new Param(value, column);
@@ -3328,7 +3340,7 @@ function notIlike(column, value) {
3328
3340
  return sql`${column} not ilike ${value}`;
3329
3341
  }
3330
3342
 
3331
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/sql/expressions/select.js
3343
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/sql/expressions/select.js
3332
3344
  function asc(column) {
3333
3345
  return sql`${column} asc`;
3334
3346
  }
@@ -3336,7 +3348,7 @@ function desc(column) {
3336
3348
  return sql`${column} desc`;
3337
3349
  }
3338
3350
 
3339
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/relations.js
3351
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/relations.js
3340
3352
  class Relation {
3341
3353
  constructor(sourceTable, referencedTable, relationName) {
3342
3354
  this.sourceTable = sourceTable;
@@ -3556,12 +3568,12 @@ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelect
3556
3568
  return result;
3557
3569
  }
3558
3570
 
3559
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/view-base.js
3571
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/view-base.js
3560
3572
  class PgViewBase extends View {
3561
3573
  static [entityKind] = "PgViewBase";
3562
3574
  }
3563
3575
 
3564
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/dialect.js
3576
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/dialect.js
3565
3577
  class PgDialect {
3566
3578
  static [entityKind] = "PgDialect";
3567
3579
  casing;
@@ -4118,7 +4130,7 @@ class PgDialect {
4118
4130
  }
4119
4131
  }
4120
4132
 
4121
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/query-builders/query-builder.js
4133
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/query-builders/query-builder.js
4122
4134
  class TypedQueryBuilder {
4123
4135
  static [entityKind] = "TypedQueryBuilder";
4124
4136
  getSelectedFields() {
@@ -4126,7 +4138,7 @@ class TypedQueryBuilder {
4126
4138
  }
4127
4139
  }
4128
4140
 
4129
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/select.js
4141
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/select.js
4130
4142
  class PgSelectBuilder {
4131
4143
  static [entityKind] = "PgSelectBuilder";
4132
4144
  fields;
@@ -4415,7 +4427,7 @@ var intersectAll = createSetOperator("intersect", true);
4415
4427
  var except = createSetOperator("except", false);
4416
4428
  var exceptAll = createSetOperator("except", true);
4417
4429
 
4418
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/query-builder.js
4430
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/query-builder.js
4419
4431
  class QueryBuilder {
4420
4432
  static [entityKind] = "PgQueryBuilder";
4421
4433
  dialect;
@@ -4493,7 +4505,7 @@ class QueryBuilder {
4493
4505
  }
4494
4506
  }
4495
4507
 
4496
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/insert.js
4508
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/insert.js
4497
4509
  class PgInsertBuilder {
4498
4510
  constructor(table, session, dialect, withList, overridingSystemValue_) {
4499
4511
  this.table = table;
@@ -4612,7 +4624,7 @@ class PgInsertBase extends QueryPromise {
4612
4624
  }
4613
4625
  }
4614
4626
 
4615
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/refresh-materialized-view.js
4627
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/refresh-materialized-view.js
4616
4628
  class PgRefreshMaterializedView extends QueryPromise {
4617
4629
  constructor(view, session, dialect) {
4618
4630
  super();
@@ -4663,7 +4675,7 @@ class PgRefreshMaterializedView extends QueryPromise {
4663
4675
  };
4664
4676
  }
4665
4677
 
4666
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/update.js
4678
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/update.js
4667
4679
  class PgUpdateBuilder {
4668
4680
  constructor(table, session, dialect, withList) {
4669
4681
  this.table = table;
@@ -4813,7 +4825,7 @@ class PgUpdateBase extends QueryPromise {
4813
4825
  }
4814
4826
  }
4815
4827
 
4816
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/count.js
4828
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/count.js
4817
4829
  class PgCountBuilder extends SQL {
4818
4830
  constructor(params) {
4819
4831
  super(PgCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
@@ -4854,7 +4866,7 @@ class PgCountBuilder extends SQL {
4854
4866
  }
4855
4867
  }
4856
4868
 
4857
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/query.js
4869
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/query.js
4858
4870
  class RelationalQueryBuilder {
4859
4871
  constructor(fullSchema, schema, tableNamesMap, table, tableConfig, dialect, session) {
4860
4872
  this.fullSchema = fullSchema;
@@ -4937,7 +4949,7 @@ class PgRelationalQuery extends QueryPromise {
4937
4949
  }
4938
4950
  }
4939
4951
 
4940
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/raw.js
4952
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/query-builders/raw.js
4941
4953
  class PgRaw extends QueryPromise {
4942
4954
  constructor(execute, sql2, query, mapBatchResult) {
4943
4955
  super();
@@ -4964,7 +4976,7 @@ class PgRaw extends QueryPromise {
4964
4976
  }
4965
4977
  }
4966
4978
 
4967
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/db.js
4979
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/db.js
4968
4980
  class PgDatabase {
4969
4981
  constructor(dialect, session, schema) {
4970
4982
  this.dialect = dialect;
@@ -5088,7 +5100,7 @@ class PgDatabase {
5088
5100
  }
5089
5101
  }
5090
5102
 
5091
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/pg-core/session.js
5103
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/pg-core/session.js
5092
5104
  class PgPreparedQuery {
5093
5105
  constructor(query) {
5094
5106
  this.query = query;
@@ -5158,7 +5170,7 @@ class PgTransaction extends PgDatabase {
5158
5170
  }
5159
5171
  }
5160
5172
 
5161
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/postgres-js/session.js
5173
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/postgres-js/session.js
5162
5174
  class PostgresJsPreparedQuery extends PgPreparedQuery {
5163
5175
  constructor(client, queryString, params, logger, fields, _isResponseInArrayMode, customResultMapper) {
5164
5176
  super({ sql: queryString, params });
@@ -5266,7 +5278,7 @@ class PostgresJsTransaction extends PgTransaction {
5266
5278
  }
5267
5279
  }
5268
5280
 
5269
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/postgres-js/driver.js
5281
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/postgres-js/driver.js
5270
5282
  class PostgresJsDatabase extends PgDatabase {
5271
5283
  static [entityKind] = "PostgresJsDatabase";
5272
5284
  }
@@ -5330,7 +5342,7 @@ function drizzle(...params) {
5330
5342
  drizzle2.mock = mock;
5331
5343
  })(drizzle || (drizzle = {}));
5332
5344
 
5333
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/migrator.js
5345
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/migrator.js
5334
5346
  import crypto2 from "crypto";
5335
5347
  import fs2 from "fs";
5336
5348
  function readMigrationFiles(config) {
@@ -5362,23 +5374,24 @@ function readMigrationFiles(config) {
5362
5374
  return migrationQueries;
5363
5375
  }
5364
5376
 
5365
- // ../../node_modules/.pnpm/drizzle-orm@0.41.0_bun-types@1.2.9_gel@2.0.2_postgres@3.4.5/node_modules/drizzle-orm/postgres-js/migrator.js
5377
+ // ../../node_modules/.pnpm/drizzle-orm@0.42.0_bun-types@1.2.10_postgres@3.4.5/node_modules/drizzle-orm/postgres-js/migrator.js
5366
5378
  async function migrate(db, config) {
5367
5379
  const migrations = readMigrationFiles(config);
5368
5380
  await db.dialect.migrate(migrations, db.session, config);
5369
5381
  }
5370
5382
 
5371
- // ../../node_modules/.pnpm/@t3-oss+env-core@0.12.0_typescript@5.8.3_zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js
5383
+ // ../../node_modules/.pnpm/@t3-oss+env-core@0.13.0_arktype@2.1.20_typescript@5.8.3_valibot@1.0.0_typescript@5.8.3__zod@3.24.2/node_modules/@t3-oss/env-core/dist/index.js
5384
+ function ensureSynchronous(value, message) {
5385
+ if (value instanceof Promise) {
5386
+ throw new Error(message);
5387
+ }
5388
+ }
5372
5389
  function parseWithDictionary(dictionary, value) {
5373
5390
  const result = {};
5374
5391
  const issues = [];
5375
5392
  for (const key in dictionary) {
5376
- const schema = dictionary[key];
5377
- const prop = value[key];
5378
- const propResult = schema["~standard"].validate(prop);
5379
- if (propResult instanceof Promise) {
5380
- throw new Error(`Validation must be synchronous, but ${key} returned a Promise.`);
5381
- }
5393
+ const propResult = dictionary[key]["~standard"].validate(value[key]);
5394
+ ensureSynchronous(propResult, `Validation must be synchronous, but ${key} returned a Promise.`);
5382
5395
  if (propResult.issues) {
5383
5396
  issues.push(...propResult.issues.map((issue) => ({
5384
5397
  ...issue,
@@ -5417,7 +5430,7 @@ function createEnv(opts) {
5417
5430
  const _server = typeof opts.server === "object" ? opts.server : {};
5418
5431
  const _shared = typeof opts.shared === "object" ? opts.shared : {};
5419
5432
  const isServer = opts.isServer ?? (typeof window === "undefined" || ("Deno" in window));
5420
- const finalSchema = isServer ? {
5433
+ const finalSchemaShape = isServer ? {
5421
5434
  ..._server,
5422
5435
  ..._shared,
5423
5436
  ..._client
@@ -5425,7 +5438,8 @@ function createEnv(opts) {
5425
5438
  ..._client,
5426
5439
  ..._shared
5427
5440
  };
5428
- const parsed = parseWithDictionary(finalSchema, runtimeEnv);
5441
+ const parsed = opts.createFinalSchema?.(finalSchemaShape, isServer)["~standard"].validate(runtimeEnv) ?? parseWithDictionary(finalSchemaShape, runtimeEnv);
5442
+ ensureSynchronous(parsed, "Validation must be synchronous");
5429
5443
  const onValidationError = opts.onValidationError ?? ((issues) => {
5430
5444
  console.error("\u274C Invalid environment variables:", issues);
5431
5445
  throw new Error("Invalid environment variables");
@@ -5450,7 +5464,7 @@ function createEnv(opts) {
5450
5464
  const extendedObj = (opts.extends ?? []).reduce((acc, curr) => {
5451
5465
  return Object.assign(acc, curr);
5452
5466
  }, {});
5453
- const fullObj = Object.assign(parsed.value, extendedObj);
5467
+ const fullObj = Object.assign(extendedObj, parsed.value);
5454
5468
  const env = new Proxy(fullObj, {
5455
5469
  get(target, prop) {
5456
5470
  if (typeof prop !== "string")
@@ -5465,7 +5479,7 @@ function createEnv(opts) {
5465
5479
  return env;
5466
5480
  }
5467
5481
 
5468
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/arrays.js
5482
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/arrays.js
5469
5483
  var liftArray = (data) => Array.isArray(data) ? data : [data];
5470
5484
  var spliterate = (arr, predicate) => {
5471
5485
  const result = [[], []];
@@ -5509,10 +5523,9 @@ var appendUnique = (to, value, opts) => {
5509
5523
  if (to === undefined)
5510
5524
  return Array.isArray(value) ? value : [value];
5511
5525
  const isEqual = opts?.isEqual ?? ((l, r) => l === r);
5512
- liftArray(value).forEach((v) => {
5526
+ for (const v of liftArray(value))
5513
5527
  if (!to.some((existing) => isEqual(existing, v)))
5514
5528
  to.push(v);
5515
- });
5516
5529
  return to;
5517
5530
  };
5518
5531
  var groupBy = (array, discriminant) => array.reduce((result, item) => {
@@ -5521,7 +5534,7 @@ var groupBy = (array, discriminant) => array.reduce((result, item) => {
5521
5534
  return result;
5522
5535
  }, {});
5523
5536
  var arrayEquals = (l, r, opts) => l.length === r.length && l.every(opts?.isEqual ? (lItem, i) => opts.isEqual(lItem, r[i]) : (lItem, i) => lItem === r[i]);
5524
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/domain.js
5537
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/domain.js
5525
5538
  var hasDomain = (data, kind) => domainOf(data) === kind;
5526
5539
  var domainOf = (data) => {
5527
5540
  const builtinType = typeof data;
@@ -5542,7 +5555,7 @@ var jsTypeOfDescriptions = {
5542
5555
  function: "a function"
5543
5556
  };
5544
5557
 
5545
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/errors.js
5558
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/errors.js
5546
5559
  class InternalArktypeError extends Error {
5547
5560
  }
5548
5561
  var throwInternalError = (message) => throwError(message, InternalArktypeError);
@@ -5556,26 +5569,26 @@ class ParseError extends Error {
5556
5569
  var throwParseError = (message) => throwError(message, ParseError);
5557
5570
  var noSuggest = (s) => ` ${s}`;
5558
5571
 
5559
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/flatMorph.js
5572
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/flatMorph.js
5560
5573
  var flatMorph = (o, flatMapEntry) => {
5561
5574
  const result = {};
5562
5575
  const inputIsArray = Array.isArray(o);
5563
5576
  let outputShouldBeArray = false;
5564
- Object.entries(o).forEach((entry, i) => {
5577
+ for (const [i, entry] of Object.entries(o).entries()) {
5565
5578
  const mapped = inputIsArray ? flatMapEntry(i, entry[1]) : flatMapEntry(...entry, i);
5566
5579
  outputShouldBeArray ||= typeof mapped[0] === "number";
5567
5580
  const flattenedEntries = Array.isArray(mapped[0]) || mapped.length === 0 ? mapped : [mapped];
5568
- flattenedEntries.forEach(([k, v]) => {
5581
+ for (const [k, v] of flattenedEntries) {
5569
5582
  if (typeof k === "object")
5570
5583
  result[k.group] = append(result[k.group], v);
5571
5584
  else
5572
5585
  result[k] = v;
5573
- });
5574
- });
5586
+ }
5587
+ }
5575
5588
  return outputShouldBeArray ? Object.values(result) : result;
5576
5589
  };
5577
5590
 
5578
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/records.js
5591
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/records.js
5579
5592
  var entriesOf = Object.entries;
5580
5593
  var isKeyOf = (k, o) => (k in o);
5581
5594
  var hasKey = (o, k) => (k in o);
@@ -5622,7 +5635,7 @@ var enumValues = (tsEnum) => Object.values(tsEnum).filter((v) => {
5622
5635
  return typeof tsEnum[v] !== "number";
5623
5636
  });
5624
5637
 
5625
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/objectKinds.js
5638
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/objectKinds.js
5626
5639
  var ecmascriptConstructors = {
5627
5640
  Array,
5628
5641
  Boolean,
@@ -5738,7 +5751,7 @@ var constructorExtends = (ctor, base) => {
5738
5751
  return false;
5739
5752
  };
5740
5753
 
5741
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/clone.js
5754
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/clone.js
5742
5755
  var deepClone = (input) => _clone(input, new Map);
5743
5756
  var _clone = (input, seen) => {
5744
5757
  if (typeof input !== "object" || input === null)
@@ -5764,7 +5777,7 @@ var _clone = (input, seen) => {
5764
5777
  Object.defineProperties(cloned, propertyDescriptors);
5765
5778
  return cloned;
5766
5779
  };
5767
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/functions.js
5780
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/functions.js
5768
5781
  var cached = (thunk) => {
5769
5782
  let result = unset;
5770
5783
  return () => result === unset ? result = thunk() : result;
@@ -5798,16 +5811,16 @@ var envHasCsp = cached(() => {
5798
5811
  return true;
5799
5812
  }
5800
5813
  });
5801
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/generics.js
5814
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/generics.js
5802
5815
  var brand = noSuggest("brand");
5803
5816
  var inferred = noSuggest("arkInferred");
5804
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/hkt.js
5817
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/hkt.js
5805
5818
  var args = noSuggest("args");
5806
5819
 
5807
5820
  class Hkt {
5808
5821
  constructor() {}
5809
5822
  }
5810
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/isomorphic.js
5823
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/isomorphic.js
5811
5824
  var fileName = () => {
5812
5825
  try {
5813
5826
  const error = new Error;
@@ -5824,7 +5837,7 @@ var isomorphic = {
5824
5837
  fileName,
5825
5838
  env
5826
5839
  };
5827
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/strings.js
5840
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/strings.js
5828
5841
  var capitalize = (s) => s[0].toUpperCase() + s.slice(1);
5829
5842
  var anchoredRegex = (regex) => new RegExp(anchoredSource(regex), typeof regex === "string" ? "" : regex.flags);
5830
5843
  var anchoredSource = (regex) => {
@@ -5842,7 +5855,7 @@ var whitespaceChars = {
5842
5855
  "\t": 1
5843
5856
  };
5844
5857
 
5845
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/numbers.js
5858
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/numbers.js
5846
5859
  var anchoredNegativeZeroPattern = /^-0\.?0*$/.source;
5847
5860
  var positiveIntegerPattern = /[1-9]\d*/.source;
5848
5861
  var looseDecimalPattern = /\.\d+/.source;
@@ -5904,15 +5917,15 @@ var tryParseWellFormedBigint = (def) => {
5904
5917
  return throwParseError(writeMalformedNumericLiteralMessage(def, "bigint"));
5905
5918
  }
5906
5919
  };
5907
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/registry.js
5908
- var arkUtilVersion = "0.45.9";
5920
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/registry.js
5921
+ var arkUtilVersion = "0.46.0";
5909
5922
  var initialRegistryContents = {
5910
5923
  version: arkUtilVersion,
5911
5924
  filename: isomorphic.fileName(),
5912
5925
  FileConstructor
5913
5926
  };
5914
5927
  var registry = initialRegistryContents;
5915
- var namesByResolution = new WeakMap;
5928
+ var namesByResolution = new Map;
5916
5929
  var nameCounts = Object.create(null);
5917
5930
  var register = (value) => {
5918
5931
  const existingName = namesByResolution.get(value);
@@ -5927,7 +5940,7 @@ var register = (value) => {
5927
5940
  namesByResolution.set(value, name);
5928
5941
  return name;
5929
5942
  };
5930
- var isDotAccessible = (keyName) => /^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(keyName);
5943
+ var isDotAccessible = (keyName) => /^[$A-Z_a-z][\w$]*$/.test(keyName);
5931
5944
  var baseNameFor = (value) => {
5932
5945
  switch (typeof value) {
5933
5946
  case "object": {
@@ -5944,27 +5957,62 @@ var baseNameFor = (value) => {
5944
5957
  return throwInternalError(`Unexpected attempt to register serializable value of type ${domainOf(value)}`);
5945
5958
  };
5946
5959
 
5947
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/primitive.js
5960
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/primitive.js
5948
5961
  var serializePrimitive = (value) => typeof value === "string" ? JSON.stringify(value) : typeof value === "bigint" ? `${value}n` : `${value}`;
5949
5962
 
5950
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/serialize.js
5963
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/serialize.js
5951
5964
  var snapshot = (data, opts = {}) => _serialize(data, {
5952
5965
  onUndefined: `$ark.undefined`,
5953
5966
  onBigInt: (n) => `$ark.bigint-${n}`,
5954
5967
  ...opts
5955
5968
  }, []);
5956
- var printable = (data, indent) => {
5969
+ var printable = (data, opts) => {
5957
5970
  switch (domainOf(data)) {
5958
5971
  case "object":
5959
5972
  const o = data;
5960
5973
  const ctorName = o.constructor.name;
5961
- return ctorName === "Object" || ctorName === "Array" ? JSON.stringify(_serialize(o, printableOpts, []), null, indent) : o instanceof Date ? describeCollapsibleDate(o) : typeof o.expression === "string" ? o.expression : ctorName;
5974
+ return ctorName === "Object" || ctorName === "Array" ? opts?.quoteKeys === false ? stringifyUnquoted(o, opts?.indent ?? 0, "") : JSON.stringify(_serialize(o, printableOpts, []), null, opts?.indent) : stringifyUnquoted(o, opts?.indent ?? 0, "");
5962
5975
  case "symbol":
5963
5976
  return printableOpts.onSymbol(data);
5964
5977
  default:
5965
5978
  return serializePrimitive(data);
5966
5979
  }
5967
5980
  };
5981
+ var stringifyUnquoted = (value, indent, currentIndent) => {
5982
+ if (typeof value === "function")
5983
+ return printableOpts.onFunction(value);
5984
+ if (typeof value !== "object" || value === null)
5985
+ return serializePrimitive(value);
5986
+ const nextIndent = currentIndent + " ".repeat(indent);
5987
+ if (Array.isArray(value)) {
5988
+ if (value.length === 0)
5989
+ return "[]";
5990
+ const items = value.map((item) => stringifyUnquoted(item, indent, nextIndent)).join(`,
5991
+ ` + nextIndent);
5992
+ return indent ? `[
5993
+ ${nextIndent}${items}
5994
+ ${currentIndent}]` : `[${items}]`;
5995
+ }
5996
+ const ctorName = value.constructor.name;
5997
+ if (ctorName === "Object") {
5998
+ const keyValues = stringAndSymbolicEntriesOf(value).map(([key, val]) => {
5999
+ const stringifiedKey = typeof key === "symbol" ? printableOpts.onSymbol(key) : isDotAccessible(key) ? key : JSON.stringify(key);
6000
+ const stringifiedValue = stringifyUnquoted(val, indent, nextIndent);
6001
+ return `${nextIndent}${stringifiedKey}: ${stringifiedValue}`;
6002
+ });
6003
+ if (keyValues.length === 0)
6004
+ return "{}";
6005
+ return indent ? `{
6006
+ ${keyValues.join(`,
6007
+ `)}
6008
+ ${currentIndent}}` : `{${keyValues.join(", ")}}`;
6009
+ }
6010
+ if (value instanceof Date)
6011
+ return describeCollapsibleDate(value);
6012
+ if ("expression" in value && typeof value.expression === "string")
6013
+ return value.expression;
6014
+ return ctorName;
6015
+ };
5968
6016
  var printableOpts = {
5969
6017
  onCycle: () => "(cycle)",
5970
6018
  onSymbol: (v) => `Symbol(${register(v)})`,
@@ -6045,7 +6093,7 @@ var months = [
6045
6093
  var timeWithUnnecessarySeconds = /:\d\d:00$/;
6046
6094
  var pad = (value, length) => String(value).padStart(length, "0");
6047
6095
 
6048
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/path.js
6096
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/path.js
6049
6097
  var appendStringifiedKey = (path, prop, ...[opts]) => {
6050
6098
  const stringifySymbol = opts?.stringifySymbol ?? printable;
6051
6099
  let propAccessChain = path;
@@ -6095,14 +6143,14 @@ class ReadonlyPath extends ReadonlyArray {
6095
6143
  return this.cache.stringifyAncestors;
6096
6144
  let propString = "";
6097
6145
  const result = [propString];
6098
- this.forEach((path) => {
6146
+ for (const path of this) {
6099
6147
  propString = appendStringifiedKey(propString, path);
6100
6148
  result.push(propString);
6101
- });
6149
+ }
6102
6150
  return this.cache.stringifyAncestors = result;
6103
6151
  }
6104
6152
  }
6105
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/scanner.js
6153
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/scanner.js
6106
6154
  class Scanner {
6107
6155
  chars;
6108
6156
  i;
@@ -6168,9 +6216,9 @@ class Scanner {
6168
6216
  return this.lookahead in tokens;
6169
6217
  }
6170
6218
  }
6171
- // ../../node_modules/.pnpm/@ark+util@0.45.9/node_modules/@ark/util/out/traits.js
6219
+ // ../../node_modules/.pnpm/@ark+util@0.46.0/node_modules/@ark/util/out/traits.js
6172
6220
  var implementedTraits = noSuggest("implementedTraits");
6173
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/shared/registry.js
6221
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/shared/registry.js
6174
6222
  var _registryName = "$ark";
6175
6223
  var suffix = 2;
6176
6224
  while (_registryName in globalThis)
@@ -6181,7 +6229,7 @@ var $ark = registry;
6181
6229
  var reference = (name) => `${registryName}.${name}`;
6182
6230
  var registeredReference = (value) => reference(register(value));
6183
6231
 
6184
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/shared/compile.js
6232
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/shared/compile.js
6185
6233
  class CompiledFunction extends CastableBase {
6186
6234
  argNames;
6187
6235
  body = "";
@@ -6317,13 +6365,13 @@ class NodeCompiler extends CompiledFunction {
6317
6365
  }
6318
6366
  }
6319
6367
 
6320
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/shared/utils.js
6368
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/shared/utils.js
6321
6369
  var makeRootAndArrayPropertiesMutable = (o) => flatMorph(o, (k, v) => [k, isArray(v) ? [...v] : v]);
6322
6370
  var arkKind = noSuggest("arkKind");
6323
6371
  var hasArkKind = (value, kind) => value?.[arkKind] === kind;
6324
6372
  var isNode = (value) => hasArkKind(value, "root") || hasArkKind(value, "constraint");
6325
6373
 
6326
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/shared/implement.js
6374
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/shared/implement.js
6327
6375
  var basisKinds = ["unit", "proto", "domain"];
6328
6376
  var structuralKinds = [
6329
6377
  "required",
@@ -6411,33 +6459,102 @@ var implementNode = (_) => {
6411
6459
  return implementation;
6412
6460
  };
6413
6461
 
6414
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/config.js
6462
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/shared/toJsonSchema.js
6463
+ class ToJsonSchemaError extends Error {
6464
+ name = "ToJsonSchemaError";
6465
+ code;
6466
+ context;
6467
+ constructor(code, context) {
6468
+ super(printable(context, { quoteKeys: false, indent: 4 }));
6469
+ this.code = code;
6470
+ this.context = context;
6471
+ }
6472
+ hasCode(code) {
6473
+ return this.code === code;
6474
+ }
6475
+ }
6476
+ var defaultConfig = {
6477
+ dialect: "https://json-schema.org/draft/2020-12/schema",
6478
+ useRefs: false,
6479
+ fallback: {
6480
+ arrayObject: (ctx) => ToJsonSchema.throw("arrayObject", ctx),
6481
+ arrayPostfix: (ctx) => ToJsonSchema.throw("arrayPostfix", ctx),
6482
+ defaultValue: (ctx) => ToJsonSchema.throw("defaultValue", ctx),
6483
+ domain: (ctx) => ToJsonSchema.throw("domain", ctx),
6484
+ morph: (ctx) => ToJsonSchema.throw("morph", ctx),
6485
+ patternIntersection: (ctx) => ToJsonSchema.throw("patternIntersection", ctx),
6486
+ predicate: (ctx) => ToJsonSchema.throw("predicate", ctx),
6487
+ proto: (ctx) => ToJsonSchema.throw("proto", ctx),
6488
+ symbolKey: (ctx) => ToJsonSchema.throw("symbolKey", ctx),
6489
+ unit: (ctx) => ToJsonSchema.throw("unit", ctx),
6490
+ date: (ctx) => ToJsonSchema.throw("date", ctx)
6491
+ }
6492
+ };
6493
+ var ToJsonSchema = {
6494
+ Error: ToJsonSchemaError,
6495
+ throw: (...args2) => {
6496
+ throw new ToJsonSchema.Error(...args2);
6497
+ },
6498
+ throwInternalOperandError: (kind, schema) => throwInternalError(`Unexpected JSON Schema input for ${kind}: ${printable(schema)}`),
6499
+ defaultConfig
6500
+ };
6501
+
6502
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/config.js
6415
6503
  $ark.config ??= {};
6416
- var mergeConfigs = (base, extensions) => {
6417
- if (!extensions)
6504
+ var mergeConfigs = (base, merged) => {
6505
+ if (!merged)
6418
6506
  return base;
6419
6507
  const result = { ...base };
6420
6508
  let k;
6421
- for (k in extensions) {
6509
+ for (k in merged) {
6422
6510
  const keywords = { ...base.keywords };
6423
6511
  if (k === "keywords") {
6424
- for (const flatAlias in extensions[k]) {
6425
- const v = extensions.keywords[flatAlias];
6512
+ for (const flatAlias in merged[k]) {
6513
+ const v = merged.keywords[flatAlias];
6426
6514
  if (v === undefined)
6427
6515
  continue;
6428
6516
  keywords[flatAlias] = typeof v === "string" ? { description: v } : v;
6429
6517
  }
6430
6518
  result.keywords = keywords;
6431
- } else {
6432
- result[k] = isNodeKind(k) ? {
6519
+ } else if (k === "toJsonSchema") {
6520
+ result[k] = mergeToJsonSchemaConfigs(base.toJsonSchema, merged.toJsonSchema);
6521
+ } else if (isNodeKind(k)) {
6522
+ result[k] = {
6433
6523
  ...base[k],
6434
- ...extensions[k]
6435
- } : extensions[k];
6436
- }
6524
+ ...merged[k]
6525
+ };
6526
+ } else
6527
+ result[k] = merged[k];
6437
6528
  }
6438
6529
  return result;
6439
6530
  };
6440
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/shared/errors.js
6531
+ var mergeToJsonSchemaConfigs = (baseConfig, mergedConfig) => {
6532
+ if (!baseConfig)
6533
+ return mergedConfig ?? {};
6534
+ if (!mergedConfig)
6535
+ return baseConfig;
6536
+ const result = { ...baseConfig };
6537
+ let k;
6538
+ for (k in mergedConfig) {
6539
+ if (k === "fallback") {
6540
+ result.fallback = mergeFallbacks(baseConfig.fallback, mergedConfig.fallback);
6541
+ } else
6542
+ result[k] = mergedConfig[k];
6543
+ }
6544
+ return result;
6545
+ };
6546
+ var mergeFallbacks = (base, merged) => {
6547
+ base = normalizeFallback(base);
6548
+ merged = normalizeFallback(merged);
6549
+ const result = {};
6550
+ let code;
6551
+ for (code in ToJsonSchema.defaultConfig.fallback) {
6552
+ result[code] = merged[code] ?? merged.default ?? base[code] ?? base.default ?? ToJsonSchema.defaultConfig.fallback[code];
6553
+ }
6554
+ return result;
6555
+ };
6556
+ var normalizeFallback = (fallback) => typeof fallback === "function" ? { default: fallback } : fallback ?? {};
6557
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/shared/errors.js
6441
6558
  class ArkError extends CastableBase {
6442
6559
  [arkKind] = "error";
6443
6560
  path;
@@ -6560,15 +6677,16 @@ class ArkErrors extends ReadonlyArray {
6560
6677
  }
6561
6678
  transform(f) {
6562
6679
  const result = new ArkErrors(this.ctx);
6563
- this.forEach((e) => result.add(f(e)));
6680
+ for (const e of this)
6681
+ result.add(f(e));
6564
6682
  return result;
6565
6683
  }
6566
6684
  merge(errors2) {
6567
- errors2.forEach((e) => {
6685
+ for (const e of errors2) {
6568
6686
  if (this.includes(e))
6569
- return;
6687
+ continue;
6570
6688
  this._add(new ArkError({ ...e, path: [...this.ctx.path, ...e.path] }, this.ctx));
6571
- });
6689
+ }
6572
6690
  }
6573
6691
  affectsPath(path2) {
6574
6692
  if (this.length === 0)
@@ -6609,9 +6727,9 @@ class ArkErrors extends ReadonlyArray {
6609
6727
  this.count++;
6610
6728
  }
6611
6729
  addAncestorPaths(error) {
6612
- error.path.stringifyAncestors().forEach((propString) => {
6730
+ for (const propString of error.path.stringifyAncestors()) {
6613
6731
  this.byAncestorPath[propString] = append(this.byAncestorPath[propString], error);
6614
- });
6732
+ }
6615
6733
  }
6616
6734
  }
6617
6735
 
@@ -6634,7 +6752,7 @@ var indent = (error) => error.toString().split(`
6634
6752
  `).join(`
6635
6753
  `);
6636
6754
 
6637
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/shared/traversal.js
6755
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/shared/traversal.js
6638
6756
  class Traversal {
6639
6757
  path = [];
6640
6758
  errors = new ArkErrors(this);
@@ -6773,7 +6891,7 @@ var traverseKey = (key, fn, ctx) => {
6773
6891
  return result;
6774
6892
  };
6775
6893
 
6776
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/node.js
6894
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/node.js
6777
6895
  class BaseNode extends Callable {
6778
6896
  attachments;
6779
6897
  $;
@@ -7116,7 +7234,7 @@ var appendUniqueNodes = (existing, refs) => appendUnique(existing, refs, {
7116
7234
  isEqual: (l, r) => l.equals(r)
7117
7235
  });
7118
7236
 
7119
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/shared/disjoint.js
7237
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/shared/disjoint.js
7120
7238
  class Disjoint extends Array {
7121
7239
  static init(kind, l, r, ctx) {
7122
7240
  return new Disjoint({
@@ -7178,7 +7296,7 @@ var describeReasons = (l, r) => `${describeReason(l)} and ${describeReason(r)}`;
7178
7296
  var describeReason = (value) => isNode(value) ? value.expression : isArray(value) ? value.map(describeReason).join(" | ") || "never" : String(value);
7179
7297
  var writeUnsatisfiableExpressionError = (expression) => `${expression} results in an unsatisfiable type`;
7180
7298
 
7181
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/shared/intersections.js
7299
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/shared/intersections.js
7182
7300
  var intersectionCache = {};
7183
7301
  var intersectNodesRoot = (l, r, $) => intersectOrPipeNodes(l, r, {
7184
7302
  $,
@@ -7286,7 +7404,7 @@ var _pipeMorphed = (from, to, ctx) => {
7286
7404
  });
7287
7405
  };
7288
7406
 
7289
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/constraint.js
7407
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/constraint.js
7290
7408
  class BaseConstraint extends BaseNode {
7291
7409
  constructor(attachments, $) {
7292
7410
  super(attachments, $);
@@ -7370,8 +7488,11 @@ var intersectConstraints = (s) => {
7370
7488
  }
7371
7489
  if (!matched)
7372
7490
  s.l.push(head);
7373
- if (s.kind === "intersection")
7374
- head.impliedSiblings?.forEach((node) => appendUnique(s.r, node));
7491
+ if (s.kind === "intersection") {
7492
+ if (head.impliedSiblings)
7493
+ for (const node of head.impliedSiblings)
7494
+ appendUnique(s.r, node);
7495
+ }
7375
7496
  return intersectConstraints(s);
7376
7497
  };
7377
7498
  var flattenConstraints = (inner) => {
@@ -7397,7 +7518,7 @@ var writeInvalidOperandMessage = (kind, expected, actual) => {
7397
7518
  const actualDescription = actual.hasKind("morph") ? "a morph" : actual.isUnknown() ? "unknown" : actual.exclude(expected).defaultShortDescription;
7398
7519
  return `${capitalize(kind)} operand must be ${expected.description} (was ${actualDescription})`;
7399
7520
  };
7400
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/generic.js
7521
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/generic.js
7401
7522
  var parseGeneric = (paramDefs, bodyDef, $) => new GenericRoot(paramDefs, bodyDef, $, $, null);
7402
7523
 
7403
7524
  class LazyGenericBody extends Callable {
@@ -7468,28 +7589,7 @@ class GenericRoot extends Callable {
7468
7589
  }
7469
7590
  }
7470
7591
  var writeUnsatisfiedParameterConstraintMessage = (name, constraint, arg) => `${name} must be assignable to ${constraint} (was ${arg})`;
7471
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/shared/jsonSchema.js
7472
- var unjsonifiableExplanations = {
7473
- morph: "it represents a transformation, while JSON Schema only allows validation. Consider creating a Schema from one of its endpoints using `.in` or `.out`.",
7474
- cyclic: "cyclic types are not yet convertible to JSON Schema. If this feature is important to you, please add your feedback at https://github.com/arktypeio/arktype/issues/1087"
7475
- };
7476
- var writeUnjsonifiableMessage = (description, explanation) => {
7477
- let message = `${description} is not convertible to JSON Schema`;
7478
- if (explanation) {
7479
- const normalizedExplanation = isKeyOf(explanation, unjsonifiableExplanations) ? unjsonifiableExplanations[explanation] : explanation;
7480
- message += ` because ${normalizedExplanation}`;
7481
- }
7482
- return message;
7483
- };
7484
- var JsonSchema = {
7485
- writeUnjsonifiableMessage,
7486
- UnjsonifiableError: class UnjsonifiableError extends Error {
7487
- },
7488
- throwUnjsonifiableError: (...args2) => throwError(writeUnjsonifiableMessage(...args2)),
7489
- throwInternalOperandError: (kind, schema) => throwInternalError(`Unexpected JSON Schema input for ${kind}: ${printable(schema)}`)
7490
- };
7491
-
7492
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/predicate.js
7592
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/predicate.js
7493
7593
  var implementation = implementNode({
7494
7594
  kind: "predicate",
7495
7595
  hasAssociatedError: true,
@@ -7531,8 +7631,12 @@ class PredicateNode extends BaseConstraint {
7531
7631
  }
7532
7632
  js.if(`${this.compiledNegation} && !ctx.hasError()`, () => js.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`));
7533
7633
  }
7534
- reduceJsonSchema() {
7535
- return JsonSchema.throwUnjsonifiableError(`Predicate ${this.expression}`);
7634
+ reduceJsonSchema(base, ctx) {
7635
+ return ctx.fallback.predicate({
7636
+ code: "predicate",
7637
+ base,
7638
+ predicate: this.predicate
7639
+ });
7536
7640
  }
7537
7641
  }
7538
7642
  var Predicate = {
@@ -7540,7 +7644,7 @@ var Predicate = {
7540
7644
  Node: PredicateNode
7541
7645
  };
7542
7646
 
7543
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/divisor.js
7647
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/divisor.js
7544
7648
  var implementation2 = implementNode({
7545
7649
  kind: "divisor",
7546
7650
  collapsibleKey: "rule",
@@ -7593,7 +7697,7 @@ var greatestCommonDivisor = (l, r) => {
7593
7697
  return greatestCommonDivisor2;
7594
7698
  };
7595
7699
 
7596
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/range.js
7700
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/range.js
7597
7701
  class BaseRange extends InternalPrimitiveConstraint {
7598
7702
  boundOperandKind = operandKindsByBoundKind[this.kind];
7599
7703
  compiledActual = this.boundOperandKind === "value" ? `data` : this.boundOperandKind === "length" ? `data.length` : `data.valueOf()`;
@@ -7673,7 +7777,7 @@ var compileComparator = (kind, exclusive) => `${isKeyOf(kind, boundKindPairsByLo
7673
7777
  var dateLimitToString = (limit) => typeof limit === "string" ? limit : new Date(limit).toLocaleString();
7674
7778
  var writeUnboundableMessage = (root) => `Bounded expression ${root} must be exactly one of number, string, Array, or Date`;
7675
7779
 
7676
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/after.js
7780
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/after.js
7677
7781
  var implementation3 = implementNode({
7678
7782
  kind: "after",
7679
7783
  collapsibleKey: "rule",
@@ -7698,8 +7802,8 @@ class AfterNode extends BaseRange {
7698
7802
  impliedBasis = $ark.intrinsic.Date.internal;
7699
7803
  collapsibleLimitString = describeCollapsibleDate(this.rule);
7700
7804
  traverseAllows = (data) => data >= this.rule;
7701
- reduceJsonSchema() {
7702
- return JsonSchema.throwUnjsonifiableError("Date instance");
7805
+ reduceJsonSchema(base, ctx) {
7806
+ return ctx.fallback.date({ code: "date", base, after: this.rule });
7703
7807
  }
7704
7808
  }
7705
7809
  var After = {
@@ -7707,7 +7811,7 @@ var After = {
7707
7811
  Node: AfterNode
7708
7812
  };
7709
7813
 
7710
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/before.js
7814
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/before.js
7711
7815
  var implementation4 = implementNode({
7712
7816
  kind: "before",
7713
7817
  collapsibleKey: "rule",
@@ -7733,8 +7837,8 @@ class BeforeNode extends BaseRange {
7733
7837
  collapsibleLimitString = describeCollapsibleDate(this.rule);
7734
7838
  traverseAllows = (data) => data <= this.rule;
7735
7839
  impliedBasis = $ark.intrinsic.Date.internal;
7736
- reduceJsonSchema() {
7737
- return JsonSchema.throwUnjsonifiableError("Date instance");
7840
+ reduceJsonSchema(base, ctx) {
7841
+ return ctx.fallback.date({ code: "date", base, before: this.rule });
7738
7842
  }
7739
7843
  }
7740
7844
  var Before = {
@@ -7742,7 +7846,7 @@ var Before = {
7742
7846
  Node: BeforeNode
7743
7847
  };
7744
7848
 
7745
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/exactLength.js
7849
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/exactLength.js
7746
7850
  var implementation5 = implementNode({
7747
7851
  kind: "exactLength",
7748
7852
  collapsibleKey: "rule",
@@ -7781,7 +7885,7 @@ class ExactLengthNode extends InternalPrimitiveConstraint {
7781
7885
  schema.maxItems = this.rule;
7782
7886
  return schema;
7783
7887
  default:
7784
- return JsonSchema.throwInternalOperandError("exactLength", schema);
7888
+ return ToJsonSchema.throwInternalOperandError("exactLength", schema);
7785
7889
  }
7786
7890
  }
7787
7891
  }
@@ -7790,7 +7894,7 @@ var ExactLength = {
7790
7894
  Node: ExactLengthNode
7791
7895
  };
7792
7896
 
7793
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/max.js
7897
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/max.js
7794
7898
  var implementation6 = implementNode({
7795
7899
  kind: "max",
7796
7900
  collapsibleKey: "rule",
@@ -7830,7 +7934,7 @@ var Max = {
7830
7934
  Node: MaxNode
7831
7935
  };
7832
7936
 
7833
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/maxLength.js
7937
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/maxLength.js
7834
7938
  var implementation7 = implementNode({
7835
7939
  kind: "maxLength",
7836
7940
  collapsibleKey: "rule",
@@ -7864,7 +7968,7 @@ class MaxLengthNode extends BaseRange {
7864
7968
  schema.maxItems = this.rule;
7865
7969
  return schema;
7866
7970
  default:
7867
- return JsonSchema.throwInternalOperandError("maxLength", schema);
7971
+ return ToJsonSchema.throwInternalOperandError("maxLength", schema);
7868
7972
  }
7869
7973
  }
7870
7974
  }
@@ -7873,7 +7977,7 @@ var MaxLength = {
7873
7977
  Node: MaxLengthNode
7874
7978
  };
7875
7979
 
7876
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/min.js
7980
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/min.js
7877
7981
  var implementation8 = implementNode({
7878
7982
  kind: "min",
7879
7983
  collapsibleKey: "rule",
@@ -7912,7 +8016,7 @@ var Min = {
7912
8016
  Node: MinNode
7913
8017
  };
7914
8018
 
7915
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/minLength.js
8019
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/minLength.js
7916
8020
  var implementation9 = implementNode({
7917
8021
  kind: "minLength",
7918
8022
  collapsibleKey: "rule",
@@ -7945,7 +8049,7 @@ class MinLengthNode extends BaseRange {
7945
8049
  schema.minItems = this.rule;
7946
8050
  return schema;
7947
8051
  default:
7948
- return JsonSchema.throwInternalOperandError("minLength", schema);
8052
+ return ToJsonSchema.throwInternalOperandError("minLength", schema);
7949
8053
  }
7950
8054
  }
7951
8055
  }
@@ -7954,7 +8058,7 @@ var MinLength = {
7954
8058
  Node: MinLengthNode
7955
8059
  };
7956
8060
 
7957
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/kinds.js
8061
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/kinds.js
7958
8062
  var boundImplementationsByKind = {
7959
8063
  min: Min.implementation,
7960
8064
  max: Max.implementation,
@@ -7974,7 +8078,7 @@ var boundClassesByKind = {
7974
8078
  before: Before.Node
7975
8079
  };
7976
8080
 
7977
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/refinements/pattern.js
8081
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/refinements/pattern.js
7978
8082
  var implementation10 = implementNode({
7979
8083
  kind: "pattern",
7980
8084
  collapsibleKey: "rule",
@@ -8002,12 +8106,16 @@ class PatternNode extends InternalPrimitiveConstraint {
8002
8106
  compiledCondition = `${this.expression}.test(data)`;
8003
8107
  compiledNegation = `!${this.compiledCondition}`;
8004
8108
  impliedBasis = $ark.intrinsic.string.internal;
8005
- reduceJsonSchema(schema) {
8006
- if (schema.pattern) {
8007
- return JsonSchema.throwUnjsonifiableError(`Intersection of patterns ${schema.pattern} & ${this.rule}`);
8109
+ reduceJsonSchema(base, ctx) {
8110
+ if (base.pattern) {
8111
+ return ctx.fallback.patternIntersection({
8112
+ code: "patternIntersection",
8113
+ base,
8114
+ pattern: this.rule
8115
+ });
8008
8116
  }
8009
- schema.pattern = this.rule;
8010
- return schema;
8117
+ base.pattern = this.rule;
8118
+ return base;
8011
8119
  }
8012
8120
  }
8013
8121
  var Pattern = {
@@ -8015,7 +8123,7 @@ var Pattern = {
8015
8123
  Node: PatternNode
8016
8124
  };
8017
8125
 
8018
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/parse.js
8126
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/parse.js
8019
8127
  var schemaKindOf = (schema, allowedKinds) => {
8020
8128
  const kind = discriminateRootKind(schema);
8021
8129
  if (allowedKinds && !allowedKinds.includes(kind)) {
@@ -8104,7 +8212,7 @@ var createNode = ({ id, kind, inner, meta, $, ignoreCache }) => {
8104
8212
  const innerEntries = entriesOf(inner);
8105
8213
  const children = [];
8106
8214
  let innerJson = {};
8107
- innerEntries.forEach(([k, v]) => {
8215
+ for (const [k, v] of innerEntries) {
8108
8216
  const keyImpl = impl.keys[k];
8109
8217
  const serialize2 = keyImpl.serialize ?? (keyImpl.child ? serializeListableChild : defaultValueSerializer);
8110
8218
  innerJson[k] = serialize2(v);
@@ -8116,7 +8224,7 @@ var createNode = ({ id, kind, inner, meta, $, ignoreCache }) => {
8116
8224
  children.push(listableNode);
8117
8225
  } else if (typeof keyImpl.child === "function")
8118
8226
  children.push(...keyImpl.child(v));
8119
- });
8227
+ }
8120
8228
  if (impl.finalizeInnerJson)
8121
8229
  innerJson = impl.finalizeInnerJson(innerJson);
8122
8230
  let json = { ...innerJson };
@@ -8196,7 +8304,7 @@ var possiblyCollapse = (json, toKey, allowPrimitive) => {
8196
8304
  return json;
8197
8305
  };
8198
8306
 
8199
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/structure/prop.js
8307
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/structure/prop.js
8200
8308
  var intersectProps = (l, r, ctx) => {
8201
8309
  if (l.key !== r.key)
8202
8310
  return null;
@@ -8255,12 +8363,7 @@ class BaseProp extends BaseConstraint {
8255
8363
  compile(js) {
8256
8364
  js.if(`${this.serializedKey} in data`, () => js.traverseKey(this.serializedKey, `data${js.prop(this.key)}`, this.value));
8257
8365
  if (this.hasKind("required")) {
8258
- js.else(() => {
8259
- if (js.traversalKind === "Apply") {
8260
- return js.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`);
8261
- } else
8262
- return js.return(false);
8263
- });
8366
+ js.else(() => js.traversalKind === "Apply" ? js.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`) : js.return(false));
8264
8367
  }
8265
8368
  if (js.traversalKind === "Allows")
8266
8369
  js.return(true);
@@ -8268,7 +8371,7 @@ class BaseProp extends BaseConstraint {
8268
8371
  }
8269
8372
  var writeDefaultIntersectionMessage = (lValue, rValue) => `Invalid intersection of default values ${printable(lValue)} & ${printable(rValue)}`;
8270
8373
 
8271
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/structure/optional.js
8374
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/structure/optional.js
8272
8375
  var implementation11 = implementNode({
8273
8376
  kind: "optional",
8274
8377
  hasAssociatedError: false,
@@ -8364,7 +8467,7 @@ var writeNonPrimitiveNonFunctionDefaultValueMessage = (key) => {
8364
8467
  return `Non-primitive default ${keyDescription}must be specified as a function like () => ({my: 'object'})`;
8365
8468
  };
8366
8469
 
8367
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/root.js
8470
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/root.js
8368
8471
  class BaseRoot extends BaseNode {
8369
8472
  constructor(attachments, $) {
8370
8473
  super(attachments, $);
@@ -8405,18 +8508,26 @@ class BaseRoot extends BaseNode {
8405
8508
  return this.meta.description ?? this.defaultShortDescription;
8406
8509
  }
8407
8510
  toJsonSchema(opts = {}) {
8408
- const ctx = {
8409
- dialect: "https://json-schema.org/draft/2020-12/schema",
8410
- ...opts
8411
- };
8412
- const schema = this.toJsonSchemaRecurse(ctx);
8413
- if (typeof ctx.dialect === "string")
8414
- schema.$schema = ctx.dialect;
8511
+ const ctx = mergeToJsonSchemaConfigs(this.$.resolvedConfig.toJsonSchema, opts);
8512
+ ctx.useRefs ||= this.isCyclic;
8513
+ const schema = typeof ctx.dialect === "string" ? { $schema: ctx.dialect } : {};
8514
+ Object.assign(schema, this.toJsonSchemaRecurse(ctx));
8515
+ if (ctx.useRefs) {
8516
+ schema.$defs = flatMorph(this.references, (i, ref) => ref.isRoot() && !ref.alwaysExpandJsonSchema ? [ref.id, ref.toResolvedJsonSchema(ctx)] : []);
8517
+ }
8415
8518
  return schema;
8416
8519
  }
8417
8520
  toJsonSchemaRecurse(ctx) {
8418
- const schema = this.innerToJsonSchema(ctx);
8419
- return Object.assign(schema, this.metaJson);
8521
+ if (ctx.useRefs && !this.alwaysExpandJsonSchema)
8522
+ return { $ref: `#/$defs/${this.id}` };
8523
+ return this.toResolvedJsonSchema(ctx);
8524
+ }
8525
+ get alwaysExpandJsonSchema() {
8526
+ return this.isBasis() || this.kind === "alias" || this.hasKind("union") && this.isBoolean;
8527
+ }
8528
+ toResolvedJsonSchema(ctx) {
8529
+ const result = this.innerToJsonSchema(ctx);
8530
+ return Object.assign(result, this.metaJson);
8420
8531
  }
8421
8532
  intersect(r) {
8422
8533
  const rNode = this.$.parseDefinition(r);
@@ -8714,13 +8825,13 @@ var writeLiteralUnionEntriesMessage = (expression) => `Props cannot be extracted
8714
8825
  ${expression}`;
8715
8826
  var writeNonStructuralOperandMessage = (operation, operand) => `${operation} operand must be an object (was ${operand})`;
8716
8827
 
8717
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/utils.js
8828
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/utils.js
8718
8829
  var defineRightwardIntersections = (kind, implementation12) => flatMorph(schemaKindsRightOf(kind), (i, kind2) => [
8719
8830
  kind2,
8720
8831
  implementation12
8721
8832
  ]);
8722
8833
 
8723
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/alias.js
8834
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/alias.js
8724
8835
  var normalizeAliasSchema = (schema) => typeof schema === "string" ? { reference: schema } : schema;
8725
8836
  var neverIfDisjoint = (result) => result instanceof Disjoint ? $ark.intrinsic.never.internal : result;
8726
8837
  var implementation12 = implementNode({
@@ -8797,8 +8908,8 @@ Resolution: ${printable(resolution)}`);
8797
8908
  get defaultShortDescription() {
8798
8909
  return domainDescriptions.object;
8799
8910
  }
8800
- innerToJsonSchema(_ctx) {
8801
- return JsonSchema.throwUnjsonifiableError(this.expression, "cyclic");
8911
+ innerToJsonSchema(ctx) {
8912
+ return this.resolution.toJsonSchemaRecurse(ctx);
8802
8913
  }
8803
8914
  traverseAllows = (data, ctx) => {
8804
8915
  const seen = ctx.seen[this.reference];
@@ -8828,7 +8939,7 @@ var Alias = {
8828
8939
  Node: AliasNode
8829
8940
  };
8830
8941
 
8831
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/basis.js
8942
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/basis.js
8832
8943
  class InternalBasis extends BaseRoot {
8833
8944
  traverseApply = (data, ctx) => {
8834
8945
  if (!this.traverseAllows(data, ctx))
@@ -8854,7 +8965,7 @@ class InternalBasis extends BaseRoot {
8854
8965
  }
8855
8966
  }
8856
8967
 
8857
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/domain.js
8968
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/domain.js
8858
8969
  var implementation13 = implementNode({
8859
8970
  kind: "domain",
8860
8971
  hasAssociatedError: true,
@@ -8886,9 +8997,14 @@ class DomainNode extends InternalBasis {
8886
8997
  get defaultShortDescription() {
8887
8998
  return domainDescriptions[this.domain];
8888
8999
  }
8889
- innerToJsonSchema(_ctx) {
8890
- if (this.domain === "bigint" || this.domain === "symbol")
8891
- return JsonSchema.throwUnjsonifiableError(this.domain);
9000
+ innerToJsonSchema(ctx) {
9001
+ if (this.domain === "bigint" || this.domain === "symbol") {
9002
+ return ctx.fallback.domain({
9003
+ code: "domain",
9004
+ base: {},
9005
+ domain: this.domain
9006
+ });
9007
+ }
8892
9008
  return {
8893
9009
  type: this.domain
8894
9010
  };
@@ -8900,7 +9016,7 @@ var Domain = {
8900
9016
  writeBadAllowNanMessage: (actual) => `numberAllowsNaN may only be specified with domain "number" (was ${actual})`
8901
9017
  };
8902
9018
 
8903
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/intersection.js
9019
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/intersection.js
8904
9020
  var implementation14 = implementNode({
8905
9021
  kind: "intersection",
8906
9022
  hasAssociatedError: true,
@@ -9076,7 +9192,8 @@ class IntersectionNode extends BaseRoot {
9076
9192
  };
9077
9193
  compile(js) {
9078
9194
  if (js.traversalKind === "Allows") {
9079
- this.children.forEach((child) => js.check(child));
9195
+ for (const child of this.children)
9196
+ js.check(child);
9080
9197
  js.return(true);
9081
9198
  return;
9082
9199
  }
@@ -9138,7 +9255,7 @@ var intersectIntersections = (l, r, ctx) => {
9138
9255
  });
9139
9256
  };
9140
9257
 
9141
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/morph.js
9258
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/morph.js
9142
9259
  var implementation15 = implementNode({
9143
9260
  kind: "morph",
9144
9261
  hasAssociatedError: false,
@@ -9236,8 +9353,12 @@ class MorphNode extends BaseRoot {
9236
9353
  get defaultShortDescription() {
9237
9354
  return this.in.meta.description ?? this.in.defaultShortDescription;
9238
9355
  }
9239
- innerToJsonSchema(_ctx) {
9240
- return JsonSchema.throwUnjsonifiableError(this.expression, "morph");
9356
+ innerToJsonSchema(ctx) {
9357
+ return ctx.fallback.morph({
9358
+ code: "morph",
9359
+ base: this.in.toJsonSchemaRecurse(ctx),
9360
+ out: this.introspectableOut?.toJsonSchemaRecurse(ctx) ?? null
9361
+ });
9241
9362
  }
9242
9363
  compile(js) {
9243
9364
  if (js.traversalKind === "Allows") {
@@ -9270,7 +9391,7 @@ var writeMorphIntersectionMessage = (lDescription, rDescription) => `The interse
9270
9391
  Left: ${lDescription}
9271
9392
  Right: ${rDescription}`;
9272
9393
 
9273
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/proto.js
9394
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/proto.js
9274
9395
  var implementation16 = implementNode({
9275
9396
  kind: "proto",
9276
9397
  hasAssociatedError: true,
@@ -9311,14 +9432,20 @@ class ProtoNode extends InternalBasis {
9311
9432
  traverseAllows = this.requiresInvalidDateCheck ? (data) => data instanceof Date && data.toString() !== "Invalid Date" : (data) => data instanceof this.proto;
9312
9433
  compiledCondition = `data instanceof ${this.serializedConstructor}${this.requiresInvalidDateCheck ? ` && data.toString() !== "Invalid Date"` : ""}`;
9313
9434
  compiledNegation = `!(${this.compiledCondition})`;
9314
- innerToJsonSchema(_ctx) {
9435
+ innerToJsonSchema(ctx) {
9315
9436
  switch (this.builtinName) {
9316
9437
  case "Array":
9317
9438
  return {
9318
9439
  type: "array"
9319
9440
  };
9441
+ case "Date":
9442
+ return ctx.fallback.date?.({ code: "date", base: {} }) ?? ctx.fallback.proto({ code: "proto", base: {}, proto: this.proto });
9320
9443
  default:
9321
- return JsonSchema.throwUnjsonifiableError(this.description);
9444
+ return ctx.fallback.proto({
9445
+ code: "proto",
9446
+ base: {},
9447
+ proto: this.proto
9448
+ });
9322
9449
  }
9323
9450
  }
9324
9451
  expression = this.dateAllowsInvalid ? "Date | InvalidDate" : this.proto.name;
@@ -9337,7 +9464,7 @@ var Proto = {
9337
9464
  writeInvalidSchemaMessage: (actual) => `instanceOf operand must be a function (was ${domainOf(actual)})`
9338
9465
  };
9339
9466
 
9340
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/union.js
9467
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/union.js
9341
9468
  var implementation17 = implementNode({
9342
9469
  kind: "union",
9343
9470
  hasAssociatedError: true,
@@ -9348,9 +9475,9 @@ var implementation17 = implementNode({
9348
9475
  child: true,
9349
9476
  parse: (schema, ctx) => {
9350
9477
  const branches = [];
9351
- schema.forEach((branchSchema) => {
9478
+ for (const branchSchema of schema) {
9352
9479
  const branchNodes = hasArkKind(branchSchema, "root") ? branchSchema.branches : ctx.$.parseSchema(branchSchema).branches;
9353
- branchNodes.forEach((node) => {
9480
+ for (const node of branchNodes) {
9354
9481
  if (node.hasKind("morph")) {
9355
9482
  const matchingMorphIndex = branches.findIndex((matching) => matching.hasKind("morph") && matching.hasEqualMorphs(node));
9356
9483
  if (matchingMorphIndex === -1)
@@ -9364,8 +9491,8 @@ var implementation17 = implementNode({
9364
9491
  }
9365
9492
  } else
9366
9493
  branches.push(node);
9367
- });
9368
- });
9494
+ }
9495
+ }
9369
9496
  if (!ctx.def.ordered)
9370
9497
  branches.sort((l, r) => l.hash < r.hash ? -1 : 1);
9371
9498
  return branches;
@@ -9390,7 +9517,8 @@ var implementation17 = implementNode({
9390
9517
  const byPath = groupBy(ctx.errors, "propString");
9391
9518
  const pathDescriptions = Object.entries(byPath).map(([path2, errors2]) => {
9392
9519
  const branchesAtPath = [];
9393
- errors2.forEach((errorAtPath) => appendUnique(branchesAtPath, errorAtPath.expected));
9520
+ for (const errorAtPath of errors2)
9521
+ appendUnique(branchesAtPath, errorAtPath.expected);
9394
9522
  const expected = describeBranches(branchesAtPath);
9395
9523
  const actual = errors2.every((e) => e.actual === errors2[0].actual) ? errors2[0].actual : printable(errors2[0].data);
9396
9524
  return `${path2 && `${path2} `}must be ${expected}${actual && ` (was ${actual})`}`;
@@ -9438,17 +9566,17 @@ class UnionNode extends BaseRoot {
9438
9566
  get branchGroups() {
9439
9567
  const branchGroups = [];
9440
9568
  let firstBooleanIndex = -1;
9441
- this.branches.forEach((branch) => {
9569
+ for (const branch of this.branches) {
9442
9570
  if (branch.hasKind("unit") && branch.domain === "boolean") {
9443
9571
  if (firstBooleanIndex === -1) {
9444
9572
  firstBooleanIndex = branchGroups.length;
9445
9573
  branchGroups.push(branch);
9446
9574
  } else
9447
9575
  branchGroups[firstBooleanIndex] = $ark.intrinsic.boolean;
9448
- return;
9576
+ continue;
9449
9577
  }
9450
9578
  branchGroups.push(branch);
9451
- });
9579
+ }
9452
9580
  return branchGroups;
9453
9581
  }
9454
9582
  unitBranches = this.branches.filter((n) => n.in.hasKind("unit"));
@@ -9550,12 +9678,16 @@ class UnionNode extends BaseRoot {
9550
9678
  compileIndiscriminable(js) {
9551
9679
  if (js.traversalKind === "Apply") {
9552
9680
  js.const("errors", "[]");
9553
- this.branches.forEach((branch) => js.line("ctx.pushBranch()").line(js.invoke(branch)).if("!ctx.hasError()", () => js.return(branch.includesTransform ? "ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)" : "ctx.popBranch()")).line("errors.push(ctx.popBranch().error)"));
9681
+ for (const branch of this.branches) {
9682
+ js.line("ctx.pushBranch()").line(js.invoke(branch)).if("!ctx.hasError()", () => js.return(branch.includesTransform ? "ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)" : "ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");
9683
+ }
9554
9684
  js.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`);
9555
9685
  } else {
9556
9686
  const { optimistic } = js;
9557
9687
  js.optimistic = false;
9558
- this.branches.forEach((branch) => js.if(`${js.invoke(branch)}`, () => js.return(optimistic ? branch.contextFreeMorph ? `${registeredReference(branch.contextFreeMorph)}(${js.data})` : js.data : true)));
9688
+ for (const branch of this.branches) {
9689
+ js.if(`${js.invoke(branch)}`, () => js.return(optimistic ? branch.contextFreeMorph ? `${registeredReference(branch.contextFreeMorph)}(${js.data})` : js.data : true));
9690
+ }
9559
9691
  js.return(optimistic ? `"${unset}"` : false);
9560
9692
  }
9561
9693
  }
@@ -9563,7 +9695,7 @@ class UnionNode extends BaseRoot {
9563
9695
  return this.isBoolean ? "boolean" : `(${this.expression})`;
9564
9696
  }
9565
9697
  discriminate() {
9566
- if (this.branches.length < 2)
9698
+ if (this.branches.length < 2 || this.isCyclic)
9567
9699
  return null;
9568
9700
  if (this.unitBranches.length === this.branches.length) {
9569
9701
  const cases2 = flatMorph(this.unitBranches, (i, n) => [
@@ -9884,7 +10016,7 @@ var writeOrderedIntersectionMessage = (lDescription, rDescription) => `The inter
9884
10016
  Left: ${lDescription}
9885
10017
  Right: ${rDescription}`;
9886
10018
 
9887
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/roots/unit.js
10019
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/roots/unit.js
9888
10020
  var implementation18 = implementNode({
9889
10021
  kind: "unit",
9890
10022
  hasAssociatedError: true,
@@ -9927,8 +10059,8 @@ class UnitNode extends InternalBasis {
9927
10059
  get defaultShortDescription() {
9928
10060
  return this.domain === "object" ? domainDescriptions.object : this.description;
9929
10061
  }
9930
- innerToJsonSchema(_ctx) {
9931
- return this.unit === null ? { type: "null" } : $ark.intrinsic.jsonPrimitive.allows(this.unit) ? { const: this.unit } : JsonSchema.throwUnjsonifiableError(this.defaultShortDescription);
10062
+ innerToJsonSchema(ctx) {
10063
+ return this.unit === null ? { type: "null" } : $ark.intrinsic.jsonPrimitive.allows(this.unit) ? { const: this.unit } : ctx.fallback.unit({ code: "unit", base: {}, unit: this.unit });
9932
10064
  }
9933
10065
  traverseAllows = this.unit instanceof Date ? (data) => data instanceof Date && data.toISOString() === this.compiledValue : Number.isNaN(this.unit) ? (data) => Number.isNaN(data) : (data) => data === this.unit;
9934
10066
  }
@@ -9946,7 +10078,7 @@ var compileEqualityCheck = (unit, serializedValue, negated) => {
9946
10078
  return `data ${negated ? "!" : "="}== ${serializedValue}`;
9947
10079
  };
9948
10080
 
9949
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/structure/index.js
10081
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/structure/index.js
9950
10082
  var implementation19 = implementNode({
9951
10083
  kind: "index",
9952
10084
  hasAssociatedError: false,
@@ -10001,11 +10133,13 @@ class IndexNode extends BaseConstraint {
10001
10133
  }
10002
10134
  return true;
10003
10135
  });
10004
- traverseApply = (data, ctx) => stringAndSymbolicEntriesOf(data).forEach((entry) => {
10005
- if (this.signature.traverseAllows(entry[0], ctx)) {
10006
- traverseKey(entry[0], () => this.value.traverseApply(entry[1], ctx), ctx);
10136
+ traverseApply = (data, ctx) => {
10137
+ for (const entry of stringAndSymbolicEntriesOf(data)) {
10138
+ if (this.signature.traverseAllows(entry[0], ctx)) {
10139
+ traverseKey(entry[0], () => this.value.traverseApply(entry[1], ctx), ctx);
10140
+ }
10007
10141
  }
10008
- });
10142
+ };
10009
10143
  _transform(mapper, ctx) {
10010
10144
  ctx.path.push(this.signature);
10011
10145
  const result = super._transform(mapper, ctx);
@@ -10021,7 +10155,7 @@ var Index = {
10021
10155
  var writeEnumerableIndexBranches = (keys2) => `Index keys ${keys2.join(", ")} should be specified as named props.`;
10022
10156
  var writeInvalidPropertyKeyMessage = (indexSchema) => `Indexed key definition '${indexSchema}' must be a string or symbol`;
10023
10157
 
10024
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/structure/required.js
10158
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/structure/required.js
10025
10159
  var implementation20 = implementNode({
10026
10160
  kind: "required",
10027
10161
  hasAssociatedError: true,
@@ -10060,7 +10194,7 @@ var Required = {
10060
10194
  Node: RequiredNode
10061
10195
  };
10062
10196
 
10063
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/structure/sequence.js
10197
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/structure/sequence.js
10064
10198
  var implementation21 = implementNode({
10065
10199
  kind: "sequence",
10066
10200
  hasAssociatedError: false,
@@ -10250,21 +10384,26 @@ class SequenceNode extends BaseConstraint {
10250
10384
  return this.cacheGetter("element", this.$.node("union", this.children));
10251
10385
  }
10252
10386
  compile(js) {
10253
- this.prefix?.forEach((node, i) => js.traverseKey(`${i}`, `data[${i}]`, node));
10254
- this.defaultablesAndOptionals.forEach((node, i) => {
10387
+ if (this.prefix) {
10388
+ for (const [i, node] of this.prefix.entries())
10389
+ js.traverseKey(`${i}`, `data[${i}]`, node);
10390
+ }
10391
+ for (const [i, node] of this.defaultablesAndOptionals.entries()) {
10255
10392
  const dataIndex = `${i + this.prefixLength}`;
10256
10393
  js.if(`${dataIndex} >= ${js.data}.length`, () => js.traversalKind === "Allows" ? js.return(true) : js.return());
10257
10394
  js.traverseKey(dataIndex, `data[${dataIndex}]`, node);
10258
- });
10395
+ }
10259
10396
  if (this.variadic) {
10260
10397
  if (this.postfix) {
10261
10398
  js.const("firstPostfixIndex", `${js.data}.length${this.postfix ? `- ${this.postfix.length}` : ""}`);
10262
10399
  }
10263
10400
  js.for(`i < ${this.postfix ? "firstPostfixIndex" : "data.length"}`, () => js.traverseKey("i", "data[i]", this.variadic), this.prevariadic.length);
10264
- this.postfix?.forEach((node, i) => {
10265
- const keyExpression = `firstPostfixIndex + ${i}`;
10266
- js.traverseKey(keyExpression, `data[${keyExpression}]`, node);
10267
- });
10401
+ if (this.postfix) {
10402
+ for (const [i, node] of this.postfix.entries()) {
10403
+ const keyExpression = `firstPostfixIndex + ${i}`;
10404
+ js.traverseKey(keyExpression, `data[${keyExpression}]`, node);
10405
+ }
10406
+ }
10268
10407
  }
10269
10408
  if (js.traversalKind === "Allows")
10270
10409
  js.return(true);
@@ -10281,8 +10420,12 @@ class SequenceNode extends BaseConstraint {
10281
10420
  schema.prefixItems = this.prevariadic.map((el) => {
10282
10421
  const valueSchema = el.node.toJsonSchemaRecurse(ctx);
10283
10422
  if (el.kind === "defaultables") {
10284
- const defaultValue = typeof el.default === "function" ? el.default() : el.default;
10285
- valueSchema.default = defaultValue;
10423
+ const value = typeof el.default === "function" ? el.default() : el.default;
10424
+ valueSchema.default = $ark.intrinsic.jsonData.allows(value) ? value : ctx.fallback.defaultValue({
10425
+ code: "defaultValue",
10426
+ base: valueSchema,
10427
+ value
10428
+ });
10286
10429
  }
10287
10430
  return valueSchema;
10288
10431
  });
@@ -10290,16 +10433,23 @@ class SequenceNode extends BaseConstraint {
10290
10433
  if (this.minLength)
10291
10434
  schema.minItems = this.minLength;
10292
10435
  if (this.variadic) {
10293
- schema.items = this.variadic?.toJsonSchemaRecurse(ctx);
10436
+ const variadicSchema = Object.assign(schema, {
10437
+ items: this.variadic.toJsonSchemaRecurse(ctx)
10438
+ });
10294
10439
  if (this.maxLength)
10295
- schema.maxItems = this.maxLength;
10440
+ variadicSchema.maxItems = this.maxLength;
10441
+ if (this.postfix) {
10442
+ const elements = this.postfix.map((el) => el.toJsonSchemaRecurse(ctx));
10443
+ schema = ctx.fallback.arrayPostfix({
10444
+ code: "arrayPostfix",
10445
+ base: variadicSchema,
10446
+ elements
10447
+ });
10448
+ }
10296
10449
  } else {
10297
10450
  schema.items = false;
10298
10451
  delete schema.maxItems;
10299
10452
  }
10300
- if (this.postfix) {
10301
- return JsonSchema.throwUnjsonifiableError(`Postfix tuple element${this.postfixLength > 1 ? "s" : ""} ${this.postfix.join(", ")}`);
10302
- }
10303
10453
  return schema;
10304
10454
  }
10305
10455
  }
@@ -10324,12 +10474,21 @@ var Sequence = {
10324
10474
  };
10325
10475
  var sequenceInnerToTuple = (inner) => {
10326
10476
  const tuple = [];
10327
- inner.prefix?.forEach((node) => tuple.push({ kind: "prefix", node }));
10328
- inner.defaultables?.forEach(([node, defaultValue]) => tuple.push({ kind: "defaultables", node, default: defaultValue }));
10329
- inner.optionals?.forEach((node) => tuple.push({ kind: "optionals", node }));
10477
+ if (inner.prefix)
10478
+ for (const node of inner.prefix)
10479
+ tuple.push({ kind: "prefix", node });
10480
+ if (inner.defaultables) {
10481
+ for (const [node, defaultValue] of inner.defaultables)
10482
+ tuple.push({ kind: "defaultables", node, default: defaultValue });
10483
+ }
10484
+ if (inner.optionals)
10485
+ for (const node of inner.optionals)
10486
+ tuple.push({ kind: "optionals", node });
10330
10487
  if (inner.variadic)
10331
10488
  tuple.push({ kind: "variadic", node: inner.variadic });
10332
- inner.postfix?.forEach((node) => tuple.push({ kind: "postfix", node }));
10489
+ if (inner.postfix)
10490
+ for (const node of inner.postfix)
10491
+ tuple.push({ kind: "postfix", node });
10333
10492
  return tuple;
10334
10493
  };
10335
10494
  var sequenceTupleToInner = (tuple) => tuple.reduce((result, element) => {
@@ -10408,11 +10567,12 @@ var _intersectSequences = (s) => {
10408
10567
  return _intersectSequences(s);
10409
10568
  };
10410
10569
 
10411
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/structure/structure.js
10570
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/structure/structure.js
10412
10571
  var createStructuralWriter = (childStringProp) => (node) => {
10413
10572
  if (node.props.length || node.index) {
10414
10573
  const parts = node.index?.map((index) => index[childStringProp]) ?? [];
10415
- node.props.forEach((prop) => parts.push(prop[childStringProp]));
10574
+ for (const prop of node.props)
10575
+ parts.push(prop[childStringProp]);
10416
10576
  if (node.undeclared)
10417
10577
  parts.push(`+ (undeclared): ${node.undeclared}`);
10418
10578
  const objectLiteralDescription = `{ ${parts.join(", ")} }`;
@@ -10428,13 +10588,10 @@ var intersectPropsAndIndex = (l, r, $) => {
10428
10588
  return null;
10429
10589
  const value = intersectNodesRoot(l.value, r.value, $);
10430
10590
  if (value instanceof Disjoint) {
10431
- if (kind === "optional") {
10432
- return $.node("optional", {
10433
- key: l.key,
10434
- value: $ark.intrinsic.never.internal
10435
- });
10436
- } else
10437
- return value.withPrefixKey(l.key, l.kind);
10591
+ return kind === "optional" ? $.node("optional", {
10592
+ key: l.key,
10593
+ value: $ark.intrinsic.never.internal
10594
+ }) : value.withPrefixKey(l.key, l.kind);
10438
10595
  }
10439
10596
  return null;
10440
10597
  };
@@ -10468,7 +10625,9 @@ var implementation22 = implementNode({
10468
10625
  inner.optional = nodes.map((node) => node.in);
10469
10626
  return;
10470
10627
  }
10471
- nodes.forEach((node) => inner[node.outProp.kind] = append(inner[node.outProp.kind], node.outProp.out));
10628
+ for (const node of nodes) {
10629
+ inner[node.outProp.kind] = append(inner[node.outProp.kind], node.outProp.out);
10630
+ }
10472
10631
  }
10473
10632
  },
10474
10633
  index: {
@@ -10501,13 +10660,13 @@ var implementation22 = implementNode({
10501
10660
  const disjointResult = new Disjoint;
10502
10661
  if (l.undeclared) {
10503
10662
  const lKey = l.keyof();
10504
- r.requiredKeys.forEach((k) => {
10663
+ for (const k of r.requiredKeys) {
10505
10664
  if (!lKey.allows(k)) {
10506
10665
  disjointResult.add("presence", $ark.intrinsic.never.internal, r.propsByKey[k].value, {
10507
10666
  path: [k]
10508
10667
  });
10509
10668
  }
10510
- });
10669
+ }
10511
10670
  if (rInner.optional)
10512
10671
  rInner.optional = rInner.optional.filter((n) => lKey.allows(n.key));
10513
10672
  if (rInner.index) {
@@ -10530,13 +10689,13 @@ var implementation22 = implementNode({
10530
10689
  }
10531
10690
  if (r.undeclared) {
10532
10691
  const rKey = r.keyof();
10533
- l.requiredKeys.forEach((k) => {
10692
+ for (const k of l.requiredKeys) {
10534
10693
  if (!rKey.allows(k)) {
10535
10694
  disjointResult.add("presence", l.propsByKey[k].value, $ark.intrinsic.never.internal, {
10536
10695
  path: [k]
10537
10696
  });
10538
10697
  }
10539
- });
10698
+ }
10540
10699
  if (lInner.optional)
10541
10700
  lInner.optional = lInner.optional.filter((n) => rKey.allows(n.key));
10542
10701
  if (lInner.index) {
@@ -10622,9 +10781,10 @@ class StructureNode extends BaseConstraint {
10622
10781
  if (this._keyof)
10623
10782
  return this._keyof;
10624
10783
  let branches = this.$.units(this.literalKeys).branches;
10625
- this.index?.forEach(({ signature }) => {
10626
- branches = branches.concat(signature.branches);
10627
- });
10784
+ if (this.index) {
10785
+ for (const { signature } of this.index)
10786
+ branches = branches.concat(signature.branches);
10787
+ }
10628
10788
  return this._keyof = this.$.node("union", branches);
10629
10789
  }
10630
10790
  map(flatMapProp) {
@@ -10657,10 +10817,12 @@ class StructureNode extends BaseConstraint {
10657
10817
  value = this.propsByKey[key].value;
10658
10818
  required = this.propsByKey[key].required;
10659
10819
  }
10660
- this.index?.forEach((n) => {
10661
- if (typeOrTermExtends(key, n.signature))
10662
- value = value?.and(n.value) ?? n.value;
10663
- });
10820
+ if (this.index) {
10821
+ for (const n of this.index) {
10822
+ if (typeOrTermExtends(key, n.signature))
10823
+ value = value?.and(n.value) ?? n.value;
10824
+ }
10825
+ }
10664
10826
  if (this.sequence && typeOrTermExtends(key, $ark.intrinsic.nonNegativeIntegerString)) {
10665
10827
  if (hasArkKind(key, "root")) {
10666
10828
  if (this.sequence.variadic)
@@ -10812,7 +10974,10 @@ class StructureNode extends BaseConstraint {
10812
10974
  const parts = [];
10813
10975
  if (this.props.length)
10814
10976
  parts.push(`k in ${this.propsByKeyReference}`);
10815
- this.index?.forEach((index) => parts.push(js.invoke(index.signature, { kind: "Allows", arg: "k" })));
10977
+ if (this.index) {
10978
+ for (const index of this.index)
10979
+ parts.push(js.invoke(index.signature, { kind: "Allows", arg: "k" }));
10980
+ }
10816
10981
  if (this.sequence)
10817
10982
  parts.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)");
10818
10983
  return parts.join(" || ") || "false";
@@ -10824,11 +10989,11 @@ class StructureNode extends BaseConstraint {
10824
10989
  compile(js) {
10825
10990
  if (js.traversalKind === "Apply")
10826
10991
  js.initializeErrorCount();
10827
- this.props.forEach((prop) => {
10992
+ for (const prop of this.props) {
10828
10993
  js.check(prop);
10829
10994
  if (js.traversalKind === "Apply")
10830
10995
  js.returnIfFailFast();
10831
- });
10996
+ }
10832
10997
  if (this.sequence) {
10833
10998
  js.check(this.sequence);
10834
10999
  if (js.traversalKind === "Apply")
@@ -10851,9 +11016,11 @@ class StructureNode extends BaseConstraint {
10851
11016
  }
10852
11017
  compileExhaustiveEntry(js) {
10853
11018
  js.const("k", "keys[i]");
10854
- this.index?.forEach((node) => {
10855
- js.if(`${js.invoke(node.signature, { arg: "k", kind: "Allows" })}`, () => js.traverseKey("k", "data[k]", node.value));
10856
- });
11019
+ if (this.index) {
11020
+ for (const node of this.index) {
11021
+ js.if(`${js.invoke(node.signature, { arg: "k", kind: "Allows" })}`, () => js.traverseKey("k", "data[k]", node.value));
11022
+ }
11023
+ }
10857
11024
  if (this.undeclared === "reject") {
10858
11025
  js.if(`!(${this._compileDeclaresKey(js)})`, () => {
10859
11026
  if (js.traversalKind === "Allows")
@@ -10868,46 +11035,95 @@ class StructureNode extends BaseConstraint {
10868
11035
  case "object":
10869
11036
  return this.reduceObjectJsonSchema(schema, ctx);
10870
11037
  case "array":
11038
+ const arraySchema = this.sequence?.reduceJsonSchema(schema, ctx) ?? schema;
10871
11039
  if (this.props.length || this.index) {
10872
- return JsonSchema.throwUnjsonifiableError(`Additional properties on array ${this.expression}`);
11040
+ return ctx.fallback.arrayObject({
11041
+ code: "arrayObject",
11042
+ base: arraySchema,
11043
+ object: this.reduceObjectJsonSchema({ type: "object" }, ctx)
11044
+ });
10873
11045
  }
10874
- return this.sequence?.reduceJsonSchema(schema, ctx) ?? schema;
11046
+ return arraySchema;
10875
11047
  default:
10876
- return JsonSchema.throwInternalOperandError("structure", schema);
11048
+ return ToJsonSchema.throwInternalOperandError("structure", schema);
10877
11049
  }
10878
11050
  }
10879
11051
  reduceObjectJsonSchema(schema, ctx) {
10880
11052
  if (this.props.length) {
10881
11053
  schema.properties = {};
10882
- this.props.forEach((prop) => {
11054
+ for (const prop of this.props) {
11055
+ const valueSchema = prop.value.toJsonSchemaRecurse(ctx);
10883
11056
  if (typeof prop.key === "symbol") {
10884
- return JsonSchema.throwUnjsonifiableError(`Symbolic key ${prop.serializedKey}`);
11057
+ ctx.fallback.symbolKey({
11058
+ code: "symbolKey",
11059
+ base: schema,
11060
+ key: prop.key,
11061
+ value: valueSchema,
11062
+ optional: prop.optional
11063
+ });
11064
+ continue;
10885
11065
  }
10886
- const valueSchema = prop.value.toJsonSchemaRecurse(ctx);
10887
11066
  if (prop.hasDefault()) {
10888
- const defaultValue = typeof prop.default === "function" ? prop.default() : prop.default;
10889
- valueSchema.default = defaultValue;
11067
+ const value = typeof prop.default === "function" ? prop.default() : prop.default;
11068
+ valueSchema.default = $ark.intrinsic.jsonData.allows(value) ? value : ctx.fallback.defaultValue({
11069
+ code: "defaultValue",
11070
+ base: valueSchema,
11071
+ value
11072
+ });
10890
11073
  }
10891
11074
  schema.properties[prop.key] = valueSchema;
10892
- });
10893
- if (this.requiredKeys.length)
10894
- schema.required = this.requiredKeys;
10895
- }
10896
- this.index?.forEach((index) => {
10897
- if (index.signature.equals($ark.intrinsic.string)) {
10898
- return schema.additionalProperties = index.value.toJsonSchemaRecurse(ctx);
10899
11075
  }
10900
- if (!index.signature.extends($ark.intrinsic.string)) {
10901
- return JsonSchema.throwUnjsonifiableError(`Symbolic index signature ${index.signature.exclude($ark.intrinsic.string)}`);
11076
+ if (this.requiredKeys.length && schema.properties) {
11077
+ schema.required = this.requiredKeys.filter((k) => typeof k === "string" && (k in schema.properties));
10902
11078
  }
10903
- index.signature.branches.forEach((keyBranch) => {
10904
- if (!keyBranch.hasKind("intersection") || keyBranch.inner.pattern?.length !== 1) {
10905
- return JsonSchema.throwUnjsonifiableError(`Index signature ${keyBranch}`);
11079
+ }
11080
+ if (this.index) {
11081
+ for (const index of this.index) {
11082
+ const valueJsonSchema = index.value.toJsonSchemaRecurse(ctx);
11083
+ if (index.signature.equals($ark.intrinsic.string)) {
11084
+ schema.additionalProperties = valueJsonSchema;
11085
+ continue;
10906
11086
  }
10907
- schema.patternProperties ??= {};
10908
- schema.patternProperties[keyBranch.inner.pattern[0].rule] = index.value.toJsonSchemaRecurse(ctx);
10909
- });
10910
- });
11087
+ for (const keyBranch of index.signature.branches) {
11088
+ if (!keyBranch.extends($ark.intrinsic.string)) {
11089
+ schema = ctx.fallback.symbolKey({
11090
+ code: "symbolKey",
11091
+ base: schema,
11092
+ key: null,
11093
+ value: valueJsonSchema,
11094
+ optional: false
11095
+ });
11096
+ continue;
11097
+ }
11098
+ let keySchema = { type: "string" };
11099
+ if (keyBranch.hasKind("morph")) {
11100
+ keySchema = ctx.fallback.morph({
11101
+ code: "morph",
11102
+ base: keyBranch.in.toJsonSchemaRecurse(ctx),
11103
+ out: keyBranch.out.toJsonSchemaRecurse(ctx)
11104
+ });
11105
+ }
11106
+ if (!keyBranch.hasKind("intersection")) {
11107
+ return throwInternalError(`Unexpected index branch kind ${keyBranch.kind}.`);
11108
+ }
11109
+ const { pattern } = keyBranch.inner;
11110
+ if (pattern) {
11111
+ const keySchemaWithPattern = Object.assign(keySchema, {
11112
+ pattern: pattern[0].rule
11113
+ });
11114
+ for (let i = 1;i < pattern.length; i++) {
11115
+ keySchema = ctx.fallback.patternIntersection({
11116
+ code: "patternIntersection",
11117
+ base: keySchemaWithPattern,
11118
+ pattern: pattern[i].rule
11119
+ });
11120
+ }
11121
+ schema.patternProperties ??= {};
11122
+ schema.patternProperties[keySchemaWithPattern.pattern] = valueJsonSchema;
11123
+ }
11124
+ }
11125
+ }
11126
+ }
10911
11127
  if (this.undeclared && !schema.additionalProperties)
10912
11128
  schema.additionalProperties = false;
10913
11129
  return schema;
@@ -10922,14 +11138,21 @@ var constructStructuralMorphCacheKey = (node) => {
10922
11138
  cacheKey += node.sequence?.defaultValueMorphsReference;
10923
11139
  if (node.undeclared === "delete") {
10924
11140
  cacheKey += "delete !(";
10925
- node.required?.forEach((n) => cacheKey += n.compiledKey + " | ");
10926
- node.optional?.forEach((n) => cacheKey += n.compiledKey + " | ");
10927
- node.index?.forEach((index) => cacheKey += index.signature.id + " | ");
11141
+ if (node.required)
11142
+ for (const n of node.required)
11143
+ cacheKey += n.compiledKey + " | ";
11144
+ if (node.optional)
11145
+ for (const n of node.optional)
11146
+ cacheKey += n.compiledKey + " | ";
11147
+ if (node.index)
11148
+ for (const index of node.index)
11149
+ cacheKey += index.signature.id + " | ";
10928
11150
  if (node.sequence) {
10929
11151
  if (node.sequence.maxLength === null)
10930
11152
  cacheKey += intrinsic.nonNegativeIntegerString.id;
10931
11153
  else {
10932
- cacheKey += node.sequence.tuple.forEach((_, i) => cacheKey += i + " | ");
11154
+ for (let i = 0;i < node.sequence.tuple.length; i++)
11155
+ cacheKey += i + " | ";
10933
11156
  }
10934
11157
  }
10935
11158
  cacheKey += ")";
@@ -10994,10 +11217,10 @@ var normalizeIndex = (signature, value, $) => {
10994
11217
  if (!enumerableBranches.length)
10995
11218
  return { index: $.node("index", { signature, value }) };
10996
11219
  const normalized = {};
10997
- enumerableBranches.forEach((n) => {
11220
+ for (const n of enumerableBranches) {
10998
11221
  const prop = $.node("required", { key: n.unit, value });
10999
11222
  normalized[prop.kind] = append(normalized[prop.kind], prop);
11000
- });
11223
+ }
11001
11224
  if (nonEnumerableBranches.length) {
11002
11225
  normalized.index = $.node("index", {
11003
11226
  signature: nonEnumerableBranches,
@@ -11009,7 +11232,7 @@ var normalizeIndex = (signature, value, $) => {
11009
11232
  var typeKeyToString = (k) => hasArkKind(k, "root") ? k.expression : printable(k);
11010
11233
  var writeInvalidKeysMessage = (o, keys2) => `Key${keys2.length === 1 ? "" : "s"} ${keys2.map(typeKeyToString).join(", ")} ${keys2.length === 1 ? "does" : "do"} not exist on ${o}`;
11011
11234
 
11012
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/kinds.js
11235
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/kinds.js
11013
11236
  var nodeImplementationsByKind = {
11014
11237
  ...boundImplementationsByKind,
11015
11238
  alias: Alias.implementation,
@@ -11039,7 +11262,8 @@ $ark.defaultConfig = withAlphabetizedKeys(Object.assign(flatMorph(nodeImplementa
11039
11262
  numberAllowsNaN: false,
11040
11263
  dateAllowsInvalid: false,
11041
11264
  onFail: null,
11042
- keywords: {}
11265
+ keywords: {},
11266
+ toJsonSchema: ToJsonSchema.defaultConfig
11043
11267
  }));
11044
11268
  $ark.resolvedConfig = mergeConfigs($ark.defaultConfig, $ark.config);
11045
11269
  var nodeClassesByKind = {
@@ -11061,7 +11285,7 @@ var nodeClassesByKind = {
11061
11285
  structure: Structure.Node
11062
11286
  };
11063
11287
 
11064
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/module.js
11288
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/module.js
11065
11289
  class RootModule extends DynamicBase {
11066
11290
  get [arkKind]() {
11067
11291
  return "module";
@@ -11072,7 +11296,7 @@ var bindModule = (module, $) => new RootModule(flatMorph(module, (alias, value)
11072
11296
  hasArkKind(value, "module") ? bindModule(value, $) : $.bindReference(value)
11073
11297
  ]));
11074
11298
 
11075
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/scope.js
11299
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/scope.js
11076
11300
  var schemaBranchesOf = (schema) => isArray(schema) ? schema : ("branches" in schema) && isArray(schema.branches) ? schema.branches : undefined;
11077
11301
  var throwMismatchedNodeRootError = (expected, actual) => throwParseError(`Node of kind ${actual} is not valid as a ${expected} definition`);
11078
11302
  var writeDuplicateAliasError = (alias) => `#${alias} duplicates public alias ${alias}`;
@@ -11145,7 +11369,7 @@ class BaseScope {
11145
11369
  throwParseError(`A Scope already named ${this.name} already exists`);
11146
11370
  scopesByName[this.name] = this;
11147
11371
  const aliasEntries = Object.entries(def).map((entry) => this.preparseOwnAliasEntry(...entry));
11148
- aliasEntries.forEach(([k, v]) => {
11372
+ for (const [k, v] of aliasEntries) {
11149
11373
  let name = k;
11150
11374
  if (k[0] === "#") {
11151
11375
  name = k.slice(1);
@@ -11160,12 +11384,9 @@ class BaseScope {
11160
11384
  }
11161
11385
  if (!hasArkKind(v, "module") && !hasArkKind(v, "generic") && !isThunk(v)) {
11162
11386
  const preparsed = this.preparseOwnDefinitionFormat(v, { alias: name });
11163
- if (hasArkKind(preparsed, "root"))
11164
- this.resolutions[name] = this.bindReference(preparsed);
11165
- else
11166
- this.resolutions[name] = this.createParseContext(preparsed).id;
11387
+ this.resolutions[name] = hasArkKind(preparsed, "root") ? this.bindReference(preparsed) : this.createParseContext(preparsed).id;
11167
11388
  }
11168
- });
11389
+ }
11169
11390
  rawUnknownUnion ??= this.node("union", {
11170
11391
  branches: [
11171
11392
  "string",
@@ -11316,10 +11537,9 @@ class BaseScope {
11316
11537
  if (hasArkKind(def, "generic"))
11317
11538
  return this.resolutions[name] = this.bindReference(def);
11318
11539
  if (hasArkKind(def, "module")) {
11319
- if (def.root)
11320
- return this.resolutions[name] = this.bindReference(def.root);
11321
- else
11322
- return throwParseError(writeMissingSubmoduleAccessMessage(name));
11540
+ if (!def.root)
11541
+ throwParseError(writeMissingSubmoduleAccessMessage(name));
11542
+ return this.resolutions[name] = this.bindReference(def.root);
11323
11543
  }
11324
11544
  return this.resolutions[name] = this.parse(def, {
11325
11545
  alias: name
@@ -11353,7 +11573,8 @@ class BaseScope {
11353
11573
  const def = this.aliases[name];
11354
11574
  this._exports[name] = hasArkKind(def, "module") ? bindModule(def, this) : bootstrapAliasReferences(this.maybeResolve(name));
11355
11575
  }
11356
- this.lazyResolutions.forEach((node) => node.resolution);
11576
+ for (const node of this.lazyResolutions)
11577
+ node.resolution;
11357
11578
  this._exportedResolutions = resolutionsOfModule(this, this._exports);
11358
11579
  this._json = resolutionsToJson(this._exportedResolutions);
11359
11580
  Object.assign(this.resolutions, this._exportedResolutions);
@@ -11421,13 +11642,14 @@ class SchemaScope extends BaseScope {
11421
11642
  }
11422
11643
  }
11423
11644
  var bootstrapAliasReferences = (resolution) => {
11424
- resolution.references.filter((node) => node.hasKind("alias")).forEach((aliasNode) => {
11645
+ const aliases = resolution.references.filter((node) => node.hasKind("alias"));
11646
+ for (const aliasNode of aliases) {
11425
11647
  Object.assign(aliasNode.referencesById, aliasNode.resolution.referencesById);
11426
- resolution.references.forEach((ref) => {
11648
+ for (const ref of resolution.references) {
11427
11649
  if (aliasNode.id in ref.referencesById)
11428
11650
  Object.assign(ref.referencesById, aliasNode.referencesById);
11429
- });
11430
- });
11651
+ }
11652
+ }
11431
11653
  return resolution;
11432
11654
  };
11433
11655
  var resolutionsToJson = (resolutions) => flatMorph(resolutions, (k, v) => [
@@ -11481,12 +11703,12 @@ var node = rootSchemaScope.node;
11481
11703
  var defineSchema = rootSchemaScope.defineSchema;
11482
11704
  var genericNode = rootSchemaScope.generic;
11483
11705
 
11484
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/structure/shared.js
11706
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/structure/shared.js
11485
11707
  var arrayIndexSource = `^(?:0|[1-9]\\d*)$`;
11486
11708
  var arrayIndexMatcher = new RegExp(arrayIndexSource);
11487
11709
  var arrayIndexMatcherReference = registeredReference(arrayIndexMatcher);
11488
11710
 
11489
- // ../../node_modules/.pnpm/@ark+schema@0.45.9/node_modules/@ark/schema/out/intrinsic.js
11711
+ // ../../node_modules/.pnpm/@ark+schema@0.46.0/node_modules/@ark/schema/out/intrinsic.js
11490
11712
  var intrinsicBases = schemaScope({
11491
11713
  bigint: "bigint",
11492
11714
  boolean: [{ unit: false }, { unit: true }],
@@ -11538,7 +11760,7 @@ var intrinsic = {
11538
11760
  emptyStructure: node("structure", {}, { prereduced: true })
11539
11761
  };
11540
11762
  $ark.intrinsic = { ...intrinsic };
11541
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operand/date.js
11763
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operand/date.js
11542
11764
  var isDateLiteral = (value) => typeof value === "string" && value[0] === "d" && (value[1] === "'" || value[1] === '"') && value.at(-1) === value[1];
11543
11765
  var isValidDate = (d) => d.toString() !== "Invalid Date";
11544
11766
  var extractDateLiteralSource = (literal) => literal.slice(2, -1);
@@ -11557,7 +11779,7 @@ var maybeParseDate = (source, errorOnFail) => {
11557
11779
  return errorOnFail ? throwParseError(errorOnFail === true ? writeInvalidDateMessage(source) : errorOnFail) : undefined;
11558
11780
  };
11559
11781
 
11560
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operand/enclosed.js
11782
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operand/enclosed.js
11561
11783
  var parseEnclosed = (s, enclosing) => {
11562
11784
  const enclosed = s.scanner.shiftUntil(untilLookaheadIsClosing[enclosingTokens[enclosing]]);
11563
11785
  if (s.scanner.lookahead === "")
@@ -11608,12 +11830,12 @@ var enclosingCharDescriptions = {
11608
11830
  };
11609
11831
  var writeUnterminatedEnclosedMessage = (fragment2, enclosingStart) => `${enclosingStart}${fragment2} requires a closing ${enclosingCharDescriptions[enclosingTokens[enclosingStart]]}`;
11610
11832
 
11611
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/ast/validate.js
11833
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/ast/validate.js
11612
11834
  var writePrefixedPrivateReferenceMessage = (name) => `Private type references should not include '#'. Use '${name}' instead.`;
11613
11835
  var shallowOptionalMessage = "Optional definitions like 'string?' are only valid as properties in an object or tuple";
11614
11836
  var shallowDefaultableMessage = "Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple";
11615
11837
 
11616
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/reduce/shared.js
11838
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/reduce/shared.js
11617
11839
  var minComparators = {
11618
11840
  ">": true,
11619
11841
  ">=": true
@@ -11635,7 +11857,7 @@ var writeOpenRangeMessage = (min2, comparator) => `Left bounds are only valid wh
11635
11857
  var writeUnpairableComparatorMessage = (comparator) => `Left-bounded expressions must specify their limits using < or <= (was ${comparator})`;
11636
11858
  var writeMultipleLeftBoundsMessage = (openLimit, openComparator, limit, comparator) => `An expression may have at most one left bound (parsed ${openLimit}${invertedComparators[openComparator]}, ${limit}${invertedComparators[comparator]})`;
11637
11859
 
11638
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operand/genericArgs.js
11860
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operand/genericArgs.js
11639
11861
  var parseGenericArgs = (name, g, s) => _parseGenericArgs(name, g, s, []);
11640
11862
  var _parseGenericArgs = (name, g, s, argNodes) => {
11641
11863
  const argState = s.parseUntilFinalizer();
@@ -11652,7 +11874,7 @@ var _parseGenericArgs = (name, g, s, argNodes) => {
11652
11874
  };
11653
11875
  var writeInvalidGenericArgCountMessage = (name, params, argDefs) => `${name}<${params.join(", ")}> requires exactly ${params.length} args (got ${argDefs.length}${argDefs.length === 0 ? "" : `: ${argDefs.join(", ")}`})`;
11654
11876
 
11655
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operand/unenclosed.js
11877
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operand/unenclosed.js
11656
11878
  var parseUnenclosed = (s) => {
11657
11879
  const token = s.scanner.shiftUntilNextTerminator();
11658
11880
  if (token === "keyof")
@@ -11700,10 +11922,10 @@ var writeMissingOperandMessage = (s) => {
11700
11922
  var writeMissingRightOperandMessage = (token, unscanned = "") => `Token '${token}' requires a right operand${unscanned ? ` before '${unscanned}'` : ""}`;
11701
11923
  var writeExpressionExpectedMessage = (unscanned) => `Expected an expression${unscanned ? ` before '${unscanned}'` : ""}`;
11702
11924
 
11703
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operand/operand.js
11925
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operand/operand.js
11704
11926
  var parseOperand = (s) => s.scanner.lookahead === "" ? s.error(writeMissingOperandMessage(s)) : s.scanner.lookahead === "(" ? s.shiftedByOne().reduceGroupOpen() : s.scanner.lookaheadIsIn(enclosingChar) ? parseEnclosed(s, s.scanner.shift()) : s.scanner.lookaheadIsIn(whitespaceChars) ? parseOperand(s.shiftedByOne()) : s.scanner.lookahead === "d" ? s.scanner.nextLookahead in enclosingQuote ? parseEnclosed(s, `${s.scanner.shift()}${s.scanner.shift()}`) : parseUnenclosed(s) : parseUnenclosed(s);
11705
11927
 
11706
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/scanner.js
11928
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/scanner.js
11707
11929
  class ArkTypeScanner extends Scanner {
11708
11930
  shiftUntilNextTerminator() {
11709
11931
  this.shiftUntilNonWhitespace();
@@ -11734,7 +11956,7 @@ class ArkTypeScanner extends Scanner {
11734
11956
  static lookaheadIsFinalizing = (lookahead, unscanned) => lookahead === ">" ? unscanned[0] === "=" ? unscanned[1] === "=" : unscanned.trimStart() === "" || isKeyOf(unscanned.trimStart()[0], ArkTypeScanner.terminatingChars) : lookahead === "=" ? unscanned[0] !== "=" : lookahead === "," || lookahead === "?";
11735
11957
  }
11736
11958
 
11737
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operator/bounds.js
11959
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operator/bounds.js
11738
11960
  var parseBound = (s, start) => {
11739
11961
  const comparator = shiftComparator(s, start);
11740
11962
  if (s.root.hasKind("unit")) {
@@ -11805,14 +12027,14 @@ var parseRightBound = (s, comparator) => {
11805
12027
  };
11806
12028
  var writeInvalidLimitMessage = (comparator, limit, boundKind) => `Comparator ${boundKind === "left" ? invertedComparators[comparator] : comparator} must be ${boundKind === "left" ? "preceded" : "followed"} by a corresponding literal (was ${limit})`;
11807
12029
 
11808
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operator/brand.js
12030
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operator/brand.js
11809
12031
  var parseBrand = (s) => {
11810
12032
  s.scanner.shiftUntilNonWhitespace();
11811
12033
  const brandName = s.scanner.shiftUntilNextTerminator();
11812
12034
  s.root = s.root.brand(brandName);
11813
12035
  };
11814
12036
 
11815
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operator/divisor.js
12037
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operator/divisor.js
11816
12038
  var parseDivisor = (s) => {
11817
12039
  const divisorToken = s.scanner.shiftUntilNextTerminator();
11818
12040
  const divisor2 = tryParseInteger(divisorToken, {
@@ -11824,7 +12046,7 @@ var parseDivisor = (s) => {
11824
12046
  };
11825
12047
  var writeInvalidDivisorMessage = (divisor2) => `% operator must be followed by a non-zero integer literal (was ${divisor2})`;
11826
12048
 
11827
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operator/operator.js
12049
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operator/operator.js
11828
12050
  var parseOperator = (s) => {
11829
12051
  const lookahead = s.scanner.shift();
11830
12052
  return lookahead === "" ? s.finalize("") : lookahead === "[" ? s.scanner.shift() === "]" ? s.setRoot(s.root.array()) : s.error(incompleteArrayTokenMessage) : lookahead === "|" ? s.scanner.lookahead === ">" ? s.shiftedByOne().pushRootToBranch("|>") : s.pushRootToBranch(lookahead) : lookahead === "&" ? s.pushRootToBranch(lookahead) : lookahead === ")" ? s.finalizeGroup() : ArkTypeScanner.lookaheadIsFinalizing(lookahead, s.scanner.unscanned) ? s.finalize(lookahead) : isKeyOf(lookahead, comparatorStartChars) ? parseBound(s, lookahead) : lookahead === "%" ? parseDivisor(s) : lookahead === "#" ? parseBrand(s) : (lookahead in whitespaceChars) ? parseOperator(s) : s.error(writeUnexpectedCharacterMessage(lookahead));
@@ -11832,7 +12054,7 @@ var parseOperator = (s) => {
11832
12054
  var writeUnexpectedCharacterMessage = (char, shouldBe = "") => `'${char}' is not allowed here${shouldBe && ` (should be ${shouldBe})`}`;
11833
12055
  var incompleteArrayTokenMessage = `Missing expected ']'`;
11834
12056
 
11835
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/shift/operator/default.js
12057
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/shift/operator/default.js
11836
12058
  var parseDefault = (s) => {
11837
12059
  const baseNode = s.unsetRoot();
11838
12060
  s.parseOperand();
@@ -11844,7 +12066,7 @@ var parseDefault = (s) => {
11844
12066
  };
11845
12067
  var writeNonLiteralDefaultMessage = (defaultDef) => `Default value '${defaultDef}' must a literal value`;
11846
12068
 
11847
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/string.js
12069
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/string.js
11848
12070
  var parseString = (def, ctx) => {
11849
12071
  const aliasResolution = ctx.$.maybeResolveRoot(def);
11850
12072
  if (aliasResolution)
@@ -11883,7 +12105,7 @@ var parseUntilFinalizer = (s) => {
11883
12105
  };
11884
12106
  var next = (s) => s.hasRoot() ? s.parseOperator() : s.parseOperand();
11885
12107
 
11886
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/reduce/dynamic.js
12108
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/reduce/dynamic.js
11887
12109
  class DynamicState {
11888
12110
  root;
11889
12111
  branches = {
@@ -12019,7 +12241,7 @@ class DynamicState {
12019
12241
  }
12020
12242
  }
12021
12243
 
12022
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/generic.js
12244
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/generic.js
12023
12245
  var emptyGenericParameterMessage = "An empty string is not a valid generic parameter name";
12024
12246
  var parseGenericParamName = (scanner2, result, ctx) => {
12025
12247
  scanner2.shiftUntilNonWhitespace();
@@ -12047,7 +12269,7 @@ var _parseOptionalConstraint = (scanner2, name, result, ctx) => {
12047
12269
  result.push([name, s.root]);
12048
12270
  return parseGenericParamName(scanner2, result, ctx);
12049
12271
  };
12050
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/match.js
12272
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/match.js
12051
12273
  class InternalMatchParser extends Callable {
12052
12274
  $;
12053
12275
  constructor($) {
@@ -12141,7 +12363,7 @@ var throwOnDefault = (errors3) => errors3.throw();
12141
12363
  var chainedAtMessage = `A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')`;
12142
12364
  var doubleAtMessage = `At most one key matcher may be specified per expression`;
12143
12365
 
12144
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/property.js
12366
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/property.js
12145
12367
  var parseProperty = (def, ctx) => {
12146
12368
  if (isArray(def)) {
12147
12369
  if (def[1] === "=")
@@ -12154,7 +12376,7 @@ var parseProperty = (def, ctx) => {
12154
12376
  var invalidOptionalKeyKindMessage = `Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }`;
12155
12377
  var invalidDefaultableKeyKindMessage = `Only required keys may specify default values, e.g. { value: 'number = 0' }`;
12156
12378
 
12157
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/objectLiteral.js
12379
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/objectLiteral.js
12158
12380
  var parseObjectLiteral = (def, ctx) => {
12159
12381
  let spread;
12160
12382
  const structure3 = {};
@@ -12239,7 +12461,7 @@ var preparseKey = (key) => typeof key === "symbol" ? { kind: "required", normali
12239
12461
  };
12240
12462
  var writeInvalidSpreadTypeMessage = (def) => `Spread operand must resolve to an object literal type (was ${def})`;
12241
12463
 
12242
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/tupleExpressions.js
12464
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/tupleExpressions.js
12243
12465
  var maybeParseTupleExpression = (def, ctx) => isIndexZeroExpression(def) ? indexZeroParsers[def[0]](def, ctx) : isIndexOneExpression(def) ? indexOneParsers[def[1]](def, ctx) : null;
12244
12466
  var parseKeyOfTuple = (def, ctx) => ctx.$.parseOwnDefinitionFormat(def[1], ctx).keyof();
12245
12467
  var parseBranchTuple = (def, ctx) => {
@@ -12300,7 +12522,7 @@ var indexZeroParsers = defineIndexZeroParsers({
12300
12522
  var isIndexZeroExpression = (def) => indexZeroParsers[def[0]] !== undefined;
12301
12523
  var writeInvalidConstructorMessage = (actual) => `Expected a constructor following 'instanceof' operator (was ${actual})`;
12302
12524
 
12303
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/tupleLiteral.js
12525
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/tupleLiteral.js
12304
12526
  var parseTupleLiteral = (def, ctx) => {
12305
12527
  let sequences = [{}];
12306
12528
  let i = 0;
@@ -12377,11 +12599,17 @@ var appendSpreadBranch = (base, branch) => {
12377
12599
  if (!spread) {
12378
12600
  return appendVariadicElement(base, $ark.intrinsic.unknown);
12379
12601
  }
12380
- spread.prefix?.forEach((node3) => appendRequiredElement(base, node3));
12381
- spread.optionals?.forEach((node3) => appendOptionalElement(base, node3));
12602
+ if (spread.prefix)
12603
+ for (const node3 of spread.prefix)
12604
+ appendRequiredElement(base, node3);
12605
+ if (spread.optionals)
12606
+ for (const node3 of spread.optionals)
12607
+ appendOptionalElement(base, node3);
12382
12608
  if (spread.variadic)
12383
12609
  appendVariadicElement(base, spread.variadic);
12384
- spread.postfix?.forEach((node3) => appendRequiredElement(base, node3));
12610
+ if (spread.postfix)
12611
+ for (const node3 of spread.postfix)
12612
+ appendRequiredElement(base, node3);
12385
12613
  return base;
12386
12614
  };
12387
12615
  var writeNonArraySpreadMessage = (operand) => `Spread element must be an array (was ${operand})`;
@@ -12390,7 +12618,7 @@ var requiredPostOptionalMessage = "A required element may not follow an optional
12390
12618
  var optionalOrDefaultableAfterVariadicMessage = "An optional element may not follow a variadic element";
12391
12619
  var defaultablePostOptionalMessage = "A defaultable element may not follow an optional element without a default";
12392
12620
 
12393
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/parser/definition.js
12621
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/parser/definition.js
12394
12622
  var parseCache = {};
12395
12623
  var parseInnerDefinition = (def, ctx) => {
12396
12624
  if (typeof def === "string") {
@@ -12429,7 +12657,7 @@ var parseObject = (def, ctx) => {
12429
12657
  var parseTuple = (def, ctx) => maybeParseTupleExpression(def, ctx) ?? parseTupleLiteral(def, ctx);
12430
12658
  var writeBadDefinitionTypeMessage = (actual) => `Type definitions must be strings or objects (was ${actual})`;
12431
12659
 
12432
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/type.js
12660
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/type.js
12433
12661
  class InternalTypeParser extends Callable {
12434
12662
  constructor($) {
12435
12663
  const attach = Object.assign({
@@ -12470,7 +12698,7 @@ class InternalTypeParser extends Callable {
12470
12698
  }
12471
12699
  }
12472
12700
 
12473
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/scope.js
12701
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/scope.js
12474
12702
  var $arkTypeRegistry = $ark;
12475
12703
 
12476
12704
  class InternalScope extends BaseScope {
@@ -12563,7 +12791,7 @@ var scope2 = Object.assign(InternalScope.scope, {
12563
12791
  });
12564
12792
  var Scope = InternalScope;
12565
12793
 
12566
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/keywords/builtins.js
12794
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/keywords/builtins.js
12567
12795
  class MergeHkt extends Hkt {
12568
12796
  description = 'merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`';
12569
12797
  }
@@ -12573,7 +12801,7 @@ var arkBuiltins = Scope.module({
12573
12801
  Merge
12574
12802
  });
12575
12803
 
12576
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/keywords/Array.js
12804
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/keywords/Array.js
12577
12805
  class liftFromHkt extends Hkt {
12578
12806
  }
12579
12807
  var liftFrom = genericNode("element")((args2) => {
@@ -12590,7 +12818,7 @@ var arkArray = Scope.module({
12590
12818
  name: "Array"
12591
12819
  });
12592
12820
 
12593
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/keywords/FormData.js
12821
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/keywords/FormData.js
12594
12822
  var value = rootSchema(["string", registry.FileConstructor]);
12595
12823
  var parsedFormDataValue = value.rawOr(value.array());
12596
12824
  var parsed = rootSchema({
@@ -12627,7 +12855,7 @@ var arkFormData = Scope.module({
12627
12855
  name: "FormData"
12628
12856
  });
12629
12857
 
12630
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/keywords/TypedArray.js
12858
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/keywords/TypedArray.js
12631
12859
  var TypedArray = Scope.module({
12632
12860
  Int8: ["instanceof", Int8Array],
12633
12861
  Uint8: ["instanceof", Uint8Array],
@@ -12644,7 +12872,7 @@ var TypedArray = Scope.module({
12644
12872
  name: "TypedArray"
12645
12873
  });
12646
12874
 
12647
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/keywords/constructors.js
12875
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/keywords/constructors.js
12648
12876
  var omittedPrototypes = {
12649
12877
  Boolean: 1,
12650
12878
  Number: 1,
@@ -12657,7 +12885,7 @@ var arkPrototypes = Scope.module({
12657
12885
  FormData: arkFormData
12658
12886
  });
12659
12887
 
12660
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/keywords/number.js
12888
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/keywords/number.js
12661
12889
  var epoch = rootSchema({
12662
12890
  domain: {
12663
12891
  domain: "number",
@@ -12700,15 +12928,20 @@ var number = Scope.module({
12700
12928
  name: "number"
12701
12929
  });
12702
12930
 
12703
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/keywords/string.js
12704
- var regexStringNode = (regex, description) => node("intersection", {
12705
- domain: "string",
12706
- pattern: {
12707
- rule: regex.source,
12708
- flags: regex.flags,
12709
- meta: description
12710
- }
12711
- });
12931
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/keywords/string.js
12932
+ var regexStringNode = (regex, description, jsonSchemaFormat) => {
12933
+ const schema = {
12934
+ domain: "string",
12935
+ pattern: {
12936
+ rule: regex.source,
12937
+ flags: regex.flags,
12938
+ meta: description
12939
+ }
12940
+ };
12941
+ if (jsonSchemaFormat)
12942
+ schema.meta = { format: jsonSchemaFormat };
12943
+ return node("intersection", schema);
12944
+ };
12712
12945
  var stringIntegerRoot = regexStringNode(wellFormedIntegerMatcher, "a well-formed integer string");
12713
12946
  var stringInteger = Scope.module({
12714
12947
  root: stringIntegerRoot,
@@ -12723,10 +12956,10 @@ var stringInteger = Scope.module({
12723
12956
  }, {
12724
12957
  name: "string.integer"
12725
12958
  });
12726
- var hex = regexStringNode(/^[0-9a-fA-F]+$/, "hex characters only");
12959
+ var hex = regexStringNode(/^[\dA-Fa-f]+$/, "hex characters only");
12727
12960
  var base64 = Scope.module({
12728
- root: regexStringNode(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/, "base64-encoded"),
12729
- url: regexStringNode(/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==|%3D%3D)?|[A-Za-z0-9_-]{3}(?:=|%3D)?)?$/, "base64url-encoded")
12961
+ root: regexStringNode(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/, "base64-encoded"),
12962
+ url: regexStringNode(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/, "base64url-encoded")
12730
12963
  }, {
12731
12964
  name: "string.base64"
12732
12965
  });
@@ -12742,7 +12975,7 @@ var capitalize2 = Scope.module({
12742
12975
  name: "string.capitalize"
12743
12976
  });
12744
12977
  var isLuhnValid = (creditCardInput) => {
12745
- const sanitized = creditCardInput.replace(/[- ]+/g, "");
12978
+ const sanitized = creditCardInput.replaceAll(/[ -]+/g, "");
12746
12979
  let sum = 0;
12747
12980
  let digit;
12748
12981
  let tmpNum;
@@ -12752,17 +12985,14 @@ var isLuhnValid = (creditCardInput) => {
12752
12985
  tmpNum = Number.parseInt(digit, 10);
12753
12986
  if (shouldDouble) {
12754
12987
  tmpNum *= 2;
12755
- if (tmpNum >= 10)
12756
- sum += tmpNum % 10 + 1;
12757
- else
12758
- sum += tmpNum;
12988
+ sum += tmpNum >= 10 ? tmpNum % 10 + 1 : tmpNum;
12759
12989
  } else
12760
12990
  sum += tmpNum;
12761
12991
  shouldDouble = !shouldDouble;
12762
12992
  }
12763
12993
  return !!(sum % 10 === 0 ? sanitized : false);
12764
12994
  };
12765
- var creditCardMatcher = /^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/;
12995
+ var creditCardMatcher = /^(?:4\d{12}(?:\d{3,6})?|5[1-5]\d{14}|(222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}|6(?:011|5\d\d)\d{12,15}|3[47]\d{13}|3(?:0[0-5]|[68]\d)\d{11}|(?:2131|1800|35\d{3})\d{11}|6[27]\d{14}|^(81\d{14,17}))$/;
12766
12996
  var creditCard = rootSchema({
12767
12997
  domain: "string",
12768
12998
  pattern: {
@@ -12774,7 +13004,7 @@ var creditCard = rootSchema({
12774
13004
  predicate: isLuhnValid
12775
13005
  }
12776
13006
  });
12777
- var iso8601Matcher = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
13007
+ var iso8601Matcher = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([,.]\d+(?!:))?)?(\17[0-5]\d([,.]\d+)?)?([Zz]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
12778
13008
  var isParsableDate = (s) => !Number.isNaN(new Date(s).valueOf());
12779
13009
  var parsableDate = rootSchema({
12780
13010
  domain: "string",
@@ -12833,7 +13063,7 @@ var stringDate = Scope.module({
12833
13063
  }, {
12834
13064
  name: "string.date"
12835
13065
  });
12836
- var email = regexStringNode(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/, "an email address");
13066
+ var email = regexStringNode(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/, "an email address", "email");
12837
13067
  var ipv4Segment = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])";
12838
13068
  var ipv4Address = `(${ipv4Segment}[.]){3}${ipv4Segment}`;
12839
13069
  var ipv4Matcher = new RegExp(`^${ipv4Address}$`);
@@ -12841,8 +13071,8 @@ var ipv6Segment = "(?:[0-9a-fA-F]{1,4})";
12841
13071
  var ipv6Matcher = new RegExp("^(" + `(?:${ipv6Segment}:){7}(?:${ipv6Segment}|:)|` + `(?:${ipv6Segment}:){6}(?:${ipv4Address}|:${ipv6Segment}|:)|` + `(?:${ipv6Segment}:){5}(?::${ipv4Address}|(:${ipv6Segment}){1,2}|:)|` + `(?:${ipv6Segment}:){4}(?:(:${ipv6Segment}){0,1}:${ipv4Address}|(:${ipv6Segment}){1,3}|:)|` + `(?:${ipv6Segment}:){3}(?:(:${ipv6Segment}){0,2}:${ipv4Address}|(:${ipv6Segment}){1,4}|:)|` + `(?:${ipv6Segment}:){2}(?:(:${ipv6Segment}){0,3}:${ipv4Address}|(:${ipv6Segment}){1,5}|:)|` + `(?:${ipv6Segment}:){1}(?:(:${ipv6Segment}){0,4}:${ipv4Address}|(:${ipv6Segment}){1,6}|:)|` + `(?::((?::${ipv6Segment}){0,5}:${ipv4Address}|(?::${ipv6Segment}){1,7}|:))` + ")(%[0-9a-zA-Z.]{1,})?$");
12842
13072
  var ip = Scope.module({
12843
13073
  root: ["v4 | v6", "@", "an IP address"],
12844
- v4: regexStringNode(ipv4Matcher, "an IPv4 address"),
12845
- v6: regexStringNode(ipv6Matcher, "an IPv6 address")
13074
+ v4: regexStringNode(ipv4Matcher, "an IPv4 address", "ipv4"),
13075
+ v6: regexStringNode(ipv6Matcher, "an IPv6 address", "ipv6")
12846
13076
  }, {
12847
13077
  name: "string.ip"
12848
13078
  });
@@ -12962,7 +13192,7 @@ var normalize = Scope.module({
12962
13192
  name: "string.normalize"
12963
13193
  });
12964
13194
  var numericRoot = regexStringNode(numericStringMatcher, "a well-formed numeric string");
12965
- var numeric = Scope.module({
13195
+ var stringNumeric = Scope.module({
12966
13196
  root: numericRoot,
12967
13197
  parse: rootSchema({
12968
13198
  in: numericRoot,
@@ -12972,7 +13202,27 @@ var numeric = Scope.module({
12972
13202
  }, {
12973
13203
  name: "string.numeric"
12974
13204
  });
12975
- var semverMatcher = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
13205
+ var regexPatternDescription = "a regex pattern";
13206
+ var regex = rootSchema({
13207
+ domain: "string",
13208
+ predicate: {
13209
+ meta: regexPatternDescription,
13210
+ predicate: (s, ctx) => {
13211
+ try {
13212
+ new RegExp(s);
13213
+ return true;
13214
+ } catch (e) {
13215
+ return ctx.reject({
13216
+ code: "predicate",
13217
+ expected: regexPatternDescription,
13218
+ problem: String(e)
13219
+ });
13220
+ }
13221
+ }
13222
+ },
13223
+ meta: { format: "regex" }
13224
+ });
13225
+ var semverMatcher = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*))*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?$/;
12976
13226
  var semver = regexStringNode(semverMatcher, "a semantic version (see https://semver.org/)");
12977
13227
  var preformattedTrim = regexStringNode(/^\S.*\S$|^\S?$/, "trimmed");
12978
13228
  var trim = Scope.module({
@@ -13011,7 +13261,8 @@ var urlRoot = rootSchema({
13011
13261
  predicate: {
13012
13262
  meta: "a URL string",
13013
13263
  predicate: isParsableUrl
13014
- }
13264
+ },
13265
+ meta: { format: "uri" }
13015
13266
  });
13016
13267
  var url = Scope.module({
13017
13268
  root: urlRoot,
@@ -13031,25 +13282,29 @@ var url = Scope.module({
13031
13282
  name: "string.url"
13032
13283
  });
13033
13284
  var uuid = Scope.module({
13034
- root: ["versioned | nil | max", "@", "a UUID"],
13285
+ root: [
13286
+ "versioned | nil | max",
13287
+ "@",
13288
+ { description: "a UUID", format: "uuid" }
13289
+ ],
13035
13290
  "#nil": "'00000000-0000-0000-0000-000000000000'",
13036
13291
  "#max": "'ffffffff-ffff-ffff-ffff-ffffffffffff'",
13037
- "#versioned": /[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,
13038
- v1: regexStringNode(/^[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, "a UUIDv1"),
13039
- v2: regexStringNode(/^[0-9a-f]{8}-[0-9a-f]{4}-2[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, "a UUIDv2"),
13040
- v3: regexStringNode(/^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, "a UUIDv3"),
13041
- v4: regexStringNode(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, "a UUIDv4"),
13042
- v5: regexStringNode(/^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, "a UUIDv5"),
13043
- v6: regexStringNode(/^[0-9a-f]{8}-[0-9a-f]{4}-6[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, "a UUIDv6"),
13044
- v7: regexStringNode(/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, "a UUIDv7"),
13045
- v8: regexStringNode(/^[0-9a-f]{8}-[0-9a-f]{4}-8[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, "a UUIDv8")
13292
+ "#versioned": /[\da-f]{8}-[\da-f]{4}-[1-8][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}/i,
13293
+ v1: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv1"),
13294
+ v2: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv2"),
13295
+ v3: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv3"),
13296
+ v4: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv4"),
13297
+ v5: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv5"),
13298
+ v6: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv6"),
13299
+ v7: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv7"),
13300
+ v8: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv8")
13046
13301
  }, {
13047
13302
  name: "string.uuid"
13048
13303
  });
13049
13304
  var string = Scope.module({
13050
13305
  root: intrinsic.string,
13051
13306
  alpha: regexStringNode(/^[A-Za-z]*$/, "only letters"),
13052
- alphanumeric: regexStringNode(/^[A-Za-z\d]*$/, "only letters and digits 0-9"),
13307
+ alphanumeric: regexStringNode(/^[\dA-Za-z]*$/, "only letters and digits 0-9"),
13053
13308
  hex,
13054
13309
  base64,
13055
13310
  capitalize: capitalize2,
@@ -13062,7 +13317,8 @@ var string = Scope.module({
13062
13317
  json,
13063
13318
  lower,
13064
13319
  normalize,
13065
- numeric,
13320
+ numeric: stringNumeric,
13321
+ regex,
13066
13322
  semver,
13067
13323
  trim,
13068
13324
  upper,
@@ -13072,7 +13328,7 @@ var string = Scope.module({
13072
13328
  name: "string"
13073
13329
  });
13074
13330
 
13075
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/keywords/ts.js
13331
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/keywords/ts.js
13076
13332
  var arkTsKeywords = Scope.module({
13077
13333
  bigint: intrinsic.bigint,
13078
13334
  boolean: intrinsic.boolean,
@@ -13160,7 +13416,7 @@ var arkTsGenerics = Scope.module({
13160
13416
  Required: Required2
13161
13417
  });
13162
13418
 
13163
- // ../../node_modules/.pnpm/arktype@2.1.19/node_modules/arktype/out/keywords/keywords.js
13419
+ // ../../node_modules/.pnpm/arktype@2.1.20/node_modules/arktype/out/keywords/keywords.js
13164
13420
  var ark = scope2({
13165
13421
  ...arkTsKeywords,
13166
13422
  ...arkTsGenerics,