@danielx/civet 0.10.5 → 0.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -34,9 +34,9 @@ var Civet = (() => {
34
34
  mod
35
35
  )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
36
36
 
37
- // node_modules/@danielx/hera/dist/machine.js
37
+ // ../Hera/dist/machine.js
38
38
  var require_machine = __commonJS({
39
- "node_modules/@danielx/hera/dist/machine.js"(exports, module) {
39
+ "../Hera/dist/machine.js"(exports, module) {
40
40
  "use strict";
41
41
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
42
42
  for (var name in all)
@@ -400,7 +400,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
400
400
  }
401
401
  });
402
402
 
403
- // unplugin-civet:/home/daniel/apps/Civet/source/browser.civet.jsx
403
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\browser.civet.jsx
404
404
  var browser_civet_exports = {};
405
405
  __export(browser_civet_exports, {
406
406
  ParseError: () => import_lib2.ParseError,
@@ -408,6 +408,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
408
408
  SourceMap: () => SourceMap2,
409
409
  autoRunScripts: () => autoRunScripts,
410
410
  compile: () => compile,
411
+ decode: () => decode,
411
412
  generate: () => generate_civet_default,
412
413
  isCompileError: () => isCompileError,
413
414
  lib: () => lib_civet_exports,
@@ -422,7 +423,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
422
423
  // source/parser.hera
423
424
  var import_lib2 = __toESM(require_machine());
424
425
 
425
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
426
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
426
427
  var lib_civet_exports = {};
427
428
  __export(lib_civet_exports, {
428
429
  addPostfixStatement: () => addPostfixStatement,
@@ -433,6 +434,8 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
433
434
  blockWithPrefix: () => blockWithPrefix,
434
435
  braceBlock: () => braceBlock,
435
436
  bracedBlock: () => bracedBlock,
437
+ convertArrowFunctionToMethod: () => convertArrowFunctionToMethod,
438
+ convertFunctionToMethod: () => convertFunctionToMethod,
436
439
  convertNamedImportsToObject: () => convertNamedImportsToObject,
437
440
  convertObjectToJSXAttributes: () => convertObjectToJSXAttributes,
438
441
  convertWithClause: () => convertWithClause,
@@ -502,7 +505,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
502
505
  wrapTypeInPromise: () => wrapTypeInPromise
503
506
  });
504
507
 
505
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/util.civet.jsx
508
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\util.civet.jsx
506
509
  function len(arr, length) {
507
510
  return arr.length === length;
508
511
  }
@@ -1238,7 +1241,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1238
1241
  return result;
1239
1242
  }
1240
1243
 
1241
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/traversal.civet.jsx
1244
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\traversal.civet.jsx
1242
1245
  function gatherRecursiveWithinFunction(node, predicate) {
1243
1246
  return gatherRecursive(node, predicate, isFunction);
1244
1247
  }
@@ -1312,7 +1315,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1312
1315
  return predicate(node) && nodes.push(node), nodes;
1313
1316
  }
1314
1317
 
1315
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/ref.civet.jsx
1318
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\ref.civet.jsx
1316
1319
  var range = (start, end) => {
1317
1320
  let length = end - start;
1318
1321
  if (length <= 0) return [];
@@ -1388,7 +1391,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1388
1391
  }
1389
1392
  }
1390
1393
 
1391
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/binding.civet.jsx
1394
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\binding.civet.jsx
1392
1395
  function adjustAtBindings(statements, asThis = !1) {
1393
1396
  for (let ref1 = gatherRecursiveAll(statements, ($1) => $1.type === "AtBindingProperty"), i1 = 0, len3 = ref1.length; i1 < len3; i1++) {
1394
1397
  let binding = ref1[i1], { ref } = binding;
@@ -1586,12 +1589,12 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1586
1589
  return pattern;
1587
1590
  }
1588
1591
 
1589
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
1592
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
1590
1593
  init_browser_shim();
1591
1594
  init_browser_shim();
1592
1595
  init_browser_shim();
1593
1596
 
1594
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/helper.civet.jsx
1597
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\helper.civet.jsx
1595
1598
  var preludeVar = "var ";
1596
1599
  function ts(children) {
1597
1600
  return {
@@ -1927,7 +1930,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1927
1930
  }
1928
1931
  }
1929
1932
 
1930
- // unplugin-civet:/home/daniel/apps/Civet/source/generate.civet.jsx
1933
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\generate.civet.jsx
1931
1934
  function stringify(node) {
1932
1935
  try {
1933
1936
  return JSON.stringify(removeParentPointers(node));
@@ -1995,7 +1998,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1995
1998
  }
1996
1999
  }
1997
2000
 
1998
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
2001
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
1999
2002
  function expressionizeComptime(statement) {
2000
2003
  let { expressions } = statement.block, expression = wrapIIFE(expressions, hasAwait(expressions));
2001
2004
  return makeNode({
@@ -2229,7 +2232,7 @@ ${js}`
2229
2232
  return recurse(value);
2230
2233
  }
2231
2234
 
2232
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/function.civet.jsx
2235
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\function.civet.jsx
2233
2236
  var concatAssign = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
2234
2237
  function getTypeArguments(args) {
2235
2238
  for (; typeof args == "object" && args != null && "args" in args; )
@@ -3112,7 +3115,11 @@ ${js}`
3112
3115
  message: `yield invalid in ${f.type === "ArrowFunction" ? "=> arrow function" : signature.modifier.get ? "getter" : signature.modifier.set ? "setter" : signature.name}`
3113
3116
  });
3114
3117
  }
3115
- signature.modifier.async && !signature.modifier.generator && signature.returnType && !isPromiseType(signature.returnType.t) && replaceNode(signature.returnType.t, wrapTypeInPromise(signature.returnType.t));
3118
+ signature.modifier.async && !signature.modifier.generator && signature.returnType && !isPromiseType(signature.returnType.t) && replaceNode(
3119
+ signature.returnType.t,
3120
+ wrapTypeInPromise(signature.returnType.t),
3121
+ signature.returnType
3122
+ );
3116
3123
  }
3117
3124
  function processFunctions(statements, config2) {
3118
3125
  for (let ref23 = gatherRecursiveAll(statements, ($20) => $20.type === "FunctionExpression" || $20.type === "ArrowFunction" || $20.type === "MethodDefinition"), i14 = 0, len13 = ref23.length; i14 < len13; i14++) {
@@ -3258,7 +3265,7 @@ ${js}`
3258
3265
  ).length > 1 && (fn.ampersandBlock = !1), fn;
3259
3266
  }
3260
3267
 
3261
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/block.civet.jsx
3268
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\block.civet.jsx
3262
3269
  function blockWithPrefix(prefixStatements, block) {
3263
3270
  if (prefixStatements && prefixStatements.length) {
3264
3271
  let expressions = [...prefixStatements, ...block.expressions];
@@ -3408,7 +3415,7 @@ ${js}`
3408
3415
  };
3409
3416
  }
3410
3417
 
3411
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/op.civet.jsx
3418
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\op.civet.jsx
3412
3419
  var precedenceOrder = [
3413
3420
  ["||", "??"],
3414
3421
  ["^^"],
@@ -3602,7 +3609,7 @@ ${js}`
3602
3609
  }
3603
3610
  }
3604
3611
 
3605
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/pattern-matching.civet.jsx
3612
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pattern-matching.civet.jsx
3606
3613
  function processPatternTest(lhs, patterns) {
3607
3614
  let { ref, refAssignmentComma } = maybeRefAssignment(lhs, "m"), conditionExpression = flatJoin(patterns.map(($1) => getPatternConditions($1, ref)).map(($2) => flatJoin($2, " && ")), " || ");
3608
3615
  return makeLeftHandSideExpression(makeNode({
@@ -4006,7 +4013,7 @@ ${js}`
4006
4013
  }
4007
4014
  }
4008
4015
 
4009
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/declaration.civet.jsx
4016
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\declaration.civet.jsx
4010
4017
  function len2(arr, length) {
4011
4018
  return arr.length === length;
4012
4019
  }
@@ -4415,7 +4422,7 @@ ${js}`
4415
4422
  return [extendsToken, insertTrimmingSpace(ws, " "), wrapped];
4416
4423
  }
4417
4424
 
4418
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/unary.civet.jsx
4425
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\unary.civet.jsx
4419
4426
  function processUnaryExpression(pre, exp, post) {
4420
4427
  if (!(pre.length || post))
4421
4428
  return exp;
@@ -4526,7 +4533,7 @@ ${js}`
4526
4533
  return processUnaryExpression(pre, args, post);
4527
4534
  }
4528
4535
 
4529
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/pipe.civet.jsx
4536
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pipe.civet.jsx
4530
4537
  function constructInvocation(fn, arg) {
4531
4538
  let expr = fn.expr;
4532
4539
  for (; expr.type === "ParenthesizedExpression"; )
@@ -4687,7 +4694,7 @@ ${js}`
4687
4694
  }
4688
4695
  }
4689
4696
 
4690
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/for.civet.jsx
4697
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\for.civet.jsx
4691
4698
  function processRangeExpression(start, ws1, range2, end) {
4692
4699
  ws1 = [ws1, range2.children[0]];
4693
4700
  let ws2 = range2.children[1], comma = { $loc: range2.$loc, token: "," }, ref;
@@ -5010,7 +5017,7 @@ ${js}`
5010
5017
  };
5011
5018
  }
5012
5019
 
5013
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/auto-dec.civet.jsx
5020
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\auto-dec.civet.jsx
5014
5021
  var concatAssign2 = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
5015
5022
  function findDecs(statements) {
5016
5023
  let declarationNames = gatherNodes(statements, ($) => $.type === "Declaration").flatMap((d) => d.names), globals = getConfig().globals || [];
@@ -5071,13 +5078,13 @@ ${js}`
5071
5078
  return assignmentStatements2.length && concatAssign2(
5072
5079
  assignmentStatements2,
5073
5080
  findAssignments(assignmentStatements2.map((s) => s.children), decs2)
5074
- ), assignmentStatements2;
5081
+ ), assignmentStatements2.filter(($4) => $4.parent?.type !== "CoffeeClassPublic");
5075
5082
  }
5076
5083
  pushVar ??= (name) => (varIds.push(name), decs.add(name));
5077
5084
  let { expressions: statements } = block, decs = findDecs(statements);
5078
5085
  scopes.push(decs);
5079
5086
  let varIds = [];
5080
- findAssignments(statements, scopes).flatMap(($4) => $4?.names || []).filter((x, i, a) => {
5087
+ findAssignments(statements, scopes).flatMap(($5) => $5?.names || []).filter((x, i, a) => {
5081
5088
  if (!hasDec(x)) return a.indexOf(x) === i;
5082
5089
  }).forEach(pushVar);
5083
5090
  let fnNodes = gatherNodes(statements, isFunction), forNodes = gatherNodes(statements, (s) => s.type === "ForStatement"), blockNodes = new Set(gatherNodes(statements, (s) => s.type === "BlockStatement"));
@@ -5092,7 +5099,7 @@ ${js}`
5092
5099
  scopes.pop();
5093
5100
  }
5094
5101
 
5095
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/string.civet.jsx
5102
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\string.civet.jsx
5096
5103
  function getIndentLevel(str, tab) {
5097
5104
  if (tab != null && tab != 1) {
5098
5105
  let tabs = str.match(/\t/g), numTabs = tabs ? tabs.length : 0;
@@ -5202,7 +5209,7 @@ ${js}`
5202
5209
  return JSON.stringify(str);
5203
5210
  }
5204
5211
 
5205
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
5212
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
5206
5213
  var xor = (a, b) => a ? !b && a : b;
5207
5214
  function addPostfixStatement(statement, ws, post) {
5208
5215
  let expressions = [
@@ -5697,16 +5704,14 @@ ${js}`
5697
5704
  ] : expression?.type === "ObjectExpression" || expression?.type === "FunctionExpression" && !expression.id || expression?.type === "UnaryExpression" && !expression.pre?.length && expression.expression !== makeExpressionStatement(expression.expression) ? makeLeftHandSideExpression(expression) : expression;
5698
5705
  }
5699
5706
  function lastAccessInCallExpression(exp) {
5700
- if (exp.type === "Identifier")
5701
- return exp;
5702
- let children, i;
5703
- do {
5704
- if (exp.children == null)
5705
- return;
5706
- for ({ children } = exp, i = children.length - 1; i >= 0 && (children[i].type === "Call" || children[i].type === "NonNullAssertion" || children[i].type === "Optional"); ) i--;
5707
+ for (; exp.type === "MemberExpression" || exp.type === "CallExpression"; ) {
5708
+ let { children } = exp, i = children.length - 1;
5709
+ for (; i >= 0 && typeof children[i] == "object" && (children[i].type === "Call" || children[i].type === "NonNullAssertion" || children[i].type === "Optional"); ) i--;
5707
5710
  if (i < 0) return;
5708
- } while (children[i].type === "MemberExpression" && (exp = children[i]));
5709
- return children[i];
5711
+ exp = children[i];
5712
+ }
5713
+ if (exp.type === "Identifier" || exp.type === "PropertyAccess" || exp.type === "Index")
5714
+ return exp;
5710
5715
  }
5711
5716
  function convertMethodToFunction(method) {
5712
5717
  let { signature, block } = method, { async, modifier, optional } = signature;
@@ -5725,6 +5730,34 @@ ${js}`
5725
5730
  block
5726
5731
  };
5727
5732
  }
5733
+ function convertFunctionToMethod(id, exp) {
5734
+ let fnTokenIndex = exp.children.findIndex(function(c) {
5735
+ return c?.token?.startsWith("function");
5736
+ }), children = exp.children.slice();
5737
+ return exp.generator ? children.splice(fnTokenIndex, 2, children[fnTokenIndex + 1], id) : children.splice(fnTokenIndex, 1, id), {
5738
+ ...exp,
5739
+ type: "MethodDefinition",
5740
+ name: id.name,
5741
+ signature: { ...exp.signature, id, name: id.name },
5742
+ children
5743
+ };
5744
+ }
5745
+ function convertArrowFunctionToMethod(id, exp) {
5746
+ let block = { ...exp.block }, children = exp.children.filter(function(c) {
5747
+ return !(Array.isArray(c) && c[c.length - 1]?.token?.includes("=>"));
5748
+ }).map(function(c) {
5749
+ return c === exp.block ? block : c;
5750
+ });
5751
+ return children.unshift(id), exp = {
5752
+ ...exp,
5753
+ type: "MethodDefinition",
5754
+ name: id.name,
5755
+ signature: { ...exp.signature, id, name: id.name },
5756
+ block,
5757
+ children,
5758
+ autoBind: !0
5759
+ }, block.parent = exp, braceBlock(block), exp;
5760
+ }
5728
5761
  function convertNamedImportsToObject(node, pattern) {
5729
5762
  let properties = node.specifiers.map((specifier) => {
5730
5763
  if (specifier.ts)
@@ -6282,7 +6315,17 @@ ${js}`
6282
6315
  })()
6283
6316
  );
6284
6317
  }
6285
- let privates = expressions.filter(($15) => $15[1]?.type === "CoffeeClassPrivate");
6318
+ let public_static_function_assignments = expressions.filter(($15) => $15[1]?.type === "CoffeeClassPublic" && $15[1].assignment?.expression?.type === "FunctionExpression").map(($16) => $16[1].assignment);
6319
+ for (let public_static_function_assignment of public_static_function_assignments) {
6320
+ let id = public_static_function_assignment.lhs[0][1];
6321
+ replaceNode(public_static_function_assignment, convertFunctionToMethod(id, public_static_function_assignment.expression));
6322
+ }
6323
+ let public_static_arrow_function_assignments = expressions.filter(($17) => $17[1]?.type === "CoffeeClassPublic" && $17[1].assignment?.expression?.type === "ArrowFunction").map(($18) => $18[1].assignment);
6324
+ for (let public_static_arrow_function_assignment of public_static_arrow_function_assignments) {
6325
+ let id = public_static_arrow_function_assignment.lhs[0][1];
6326
+ replaceNode(public_static_arrow_function_assignment, convertArrowFunctionToMethod(id, public_static_arrow_function_assignment.expression));
6327
+ }
6328
+ let privates = expressions.filter(($19) => $19[1]?.type === "CoffeeClassPrivate");
6286
6329
  if (!privates.length)
6287
6330
  continue;
6288
6331
  let { parent } = ce;
@@ -6319,30 +6362,30 @@ ${js}`
6319
6362
  root.expressions,
6320
6363
  root.topLevelAwait,
6321
6364
  root.topLevelYield ? "*" : void 0
6322
- ), statements = [["", rootIIFE]], root.children = root.children.map(($16) => $16 === root.expressions ? statements : $16), root.expressions = statements), hoistRefDecs(statements), processFunctions(statements, config2), config2.coffeeClasses && processCoffeeClasses(statements), statements.unshift(...extractPreludeFor(statements)), config2.autoLet ? createConstLetDecs(statements, [], "let") : config2.autoConst ? createConstLetDecs(statements, [], "const") : config2.autoVar && createVarDecs(root, []), config2.repl && processRepl(root, rootIIFE), processBlocks(statements), populateRefs(statements), adjustAtBindings(statements), getSync() && processComptime(statements);
6365
+ ), statements = [["", rootIIFE]], root.children = root.children.map(($20) => $20 === root.expressions ? statements : $20), root.expressions = statements), hoistRefDecs(statements), processFunctions(statements, config2), config2.coffeeClasses && processCoffeeClasses(statements), statements.unshift(...extractPreludeFor(statements)), config2.autoLet ? createConstLetDecs(statements, [], "let") : config2.autoConst ? createConstLetDecs(statements, [], "const") : config2.autoVar && createVarDecs(root, []), config2.repl && processRepl(root, rootIIFE), processBlocks(statements), populateRefs(statements), adjustAtBindings(statements), getSync() && processComptime(statements);
6323
6366
  }
6324
6367
  async function processProgramAsync(root) {
6325
6368
  let { expressions: statements } = root;
6326
6369
  await processComptime(statements);
6327
6370
  }
6328
6371
  function processRepl(root, rootIIFE) {
6329
- let topBlock = gatherRecursive(rootIIFE, ($17) => $17.type === "BlockStatement")[0], i = 0;
6330
- for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($18) => $18.type === "Declaration"), i14 = 0, len11 = ref23.length; i14 < len11; i14++) {
6372
+ let topBlock = gatherRecursive(rootIIFE, ($21) => $21.type === "BlockStatement")[0], i = 0;
6373
+ for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($22) => $22.type === "Declaration"), i14 = 0, len11 = ref23.length; i14 < len11; i14++) {
6331
6374
  let decl = ref23[i14];
6332
6375
  decl.names?.length && (decl.parent === topBlock || decl.decl === "var") && (decl.children.shift(), decl.bindings[0]?.pattern?.type === "ObjectBindingPattern" && (decl.children.unshift("("), decl.children.push(")")), root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")}`, ";"]));
6333
6376
  }
6334
- for (let ref24 = gatherRecursive(topBlock, ($19) => $19.type === "FunctionExpression"), i15 = 0, len12 = ref24.length; i15 < len12; i15++) {
6377
+ for (let ref24 = gatherRecursive(topBlock, ($23) => $23.type === "FunctionExpression"), i15 = 0, len12 = ref24.length; i15 < len12; i15++) {
6335
6378
  let func = ref24[i15];
6336
6379
  func.name && func.parent?.type === "BlockStatement" && (func.parent === topBlock ? (replaceNode(func, void 0), root.expressions.splice(i++, 0, ["", func]), func.parent = root) : (func.children.unshift(func.name, "="), root.expressions.splice(i++, 0, ["", `var ${func.name}`, ";"])));
6337
6380
  }
6338
- for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($20) => $20.type === "ClassExpression"), i16 = 0, len13 = ref25.length; i16 < len13; i16++) {
6381
+ for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($24) => $24.type === "ClassExpression"), i16 = 0, len13 = ref25.length; i16 < len13; i16++) {
6339
6382
  let classExp = ref25[i16], m8;
6340
6383
  (classExp.name && classExp.parent === topBlock || (m8 = classExp.parent, typeof m8 == "object" && m8 != null && "type" in m8 && m8.type === "ReturnStatement" && "parent" in m8 && m8.parent === topBlock)) && (classExp.children.unshift(classExp.name, "="), root.expressions.splice(i++, 0, ["", `var ${classExp.name}`, ";"]));
6341
6384
  }
6342
6385
  }
6343
6386
  function processPlaceholders(statements) {
6344
6387
  let placeholderMap = /* @__PURE__ */ new Map(), liftedIfs = /* @__PURE__ */ new Set();
6345
- for (let ref26 = gatherRecursiveAll(statements, ($21) => $21.type === "Placeholder"), i17 = 0, len14 = ref26.length; i17 < len14; i17++) {
6388
+ for (let ref26 = gatherRecursiveAll(statements, ($25) => $25.type === "Placeholder"), i17 = 0, len14 = ref26.length; i17 < len14; i17++) {
6346
6389
  let exp = ref26[i17], ancestor;
6347
6390
  if (exp.subtype === ".") {
6348
6391
  ({ ancestor } = findAncestor(
@@ -7369,7 +7412,8 @@ ${js}`
7369
7412
  SameLineOrIndentedFurther,
7370
7413
  Dedented,
7371
7414
  PushExtraIndent1
7372
- }, $L0 = (0, import_lib2.$L)(""), $L1 = (0, import_lib2.$L)("{"), $L2 = (0, import_lib2.$L)("/ "), $L3 = (0, import_lib2.$L)("="), $L4 = (0, import_lib2.$L)("("), $L5 = (0, import_lib2.$L)("... "), $L6 = (0, import_lib2.$L)("?"), $L7 = (0, import_lib2.$L)("."), $L8 = (0, import_lib2.$L)("tuple"), $L9 = (0, import_lib2.$L)("++"), $L10 = (0, import_lib2.$L)("--"), $L11 = (0, import_lib2.$L)("\u29FA"), $L12 = (0, import_lib2.$L)("\u2014"), $L13 = (0, import_lib2.$L)("=>"), $L14 = (0, import_lib2.$L)("\u21D2"), $L15 = (0, import_lib2.$L)("import"), $L16 = (0, import_lib2.$L)(":"), $L17 = (0, import_lib2.$L)(" "), $L18 = (0, import_lib2.$L)("<"), $L19 = (0, import_lib2.$L)("implements"), $L20 = (0, import_lib2.$L)("<:"), $L21 = (0, import_lib2.$L)("^"), $L22 = (0, import_lib2.$L)("<?"), $L23 = (0, import_lib2.$L)("-"), $L24 = (0, import_lib2.$L)("import.meta"), $L25 = (0, import_lib2.$L)("return.value"), $L26 = (0, import_lib2.$L)(","), $L27 = (0, import_lib2.$L)("tighter"), $L28 = (0, import_lib2.$L)("looser"), $L29 = (0, import_lib2.$L)("same"), $L30 = (0, import_lib2.$L)("left"), $L31 = (0, import_lib2.$L)("right"), $L32 = (0, import_lib2.$L)("non"), $L33 = (0, import_lib2.$L)("relational"), $L34 = (0, import_lib2.$L)("arguments"), $L35 = (0, import_lib2.$L)("->"), $L36 = (0, import_lib2.$L)("\u2192"), $L37 = (0, import_lib2.$L)("}"), $L38 = (0, import_lib2.$L)("null"), $L39 = (0, import_lib2.$L)("true"), $L40 = (0, import_lib2.$L)("false"), $L41 = (0, import_lib2.$L)("yes"), $L42 = (0, import_lib2.$L)("on"), $L43 = (0, import_lib2.$L)("no"), $L44 = (0, import_lib2.$L)("off"), $L45 = (0, import_lib2.$L)(">"), $L46 = (0, import_lib2.$L)("]"), $L47 = (0, import_lib2.$L)("\u2022"), $L48 = (0, import_lib2.$L)("//"), $L49 = (0, import_lib2.$L)("**="), $L50 = (0, import_lib2.$L)("*="), $L51 = (0, import_lib2.$L)("%/"), $L52 = (0, import_lib2.$L)("\xF7"), $L53 = (0, import_lib2.$L)("%%"), $L54 = (0, import_lib2.$L)("/="), $L55 = (0, import_lib2.$L)("%="), $L56 = (0, import_lib2.$L)("+="), $L57 = (0, import_lib2.$L)("-="), $L58 = (0, import_lib2.$L)("<<="), $L59 = (0, import_lib2.$L)("\u226A="), $L60 = (0, import_lib2.$L)(">>>="), $L61 = (0, import_lib2.$L)("\u22D9="), $L62 = (0, import_lib2.$L)(">>="), $L63 = (0, import_lib2.$L)("\u226B="), $L64 = (0, import_lib2.$L)("&&="), $L65 = (0, import_lib2.$L)("&="), $L66 = (0, import_lib2.$L)("^="), $L67 = (0, import_lib2.$L)("||="), $L68 = (0, import_lib2.$L)("\u2016="), $L69 = (0, import_lib2.$L)("|="), $L70 = (0, import_lib2.$L)("??="), $L71 = (0, import_lib2.$L)("\u2047="), $L72 = (0, import_lib2.$L)("?="), $L73 = (0, import_lib2.$L)("and="), $L74 = (0, import_lib2.$L)("or="), $L75 = (0, import_lib2.$L)("*"), $L76 = (0, import_lib2.$L)("**"), $L77 = (0, import_lib2.$L)("/"), $L78 = (0, import_lib2.$L)("%"), $L79 = (0, import_lib2.$L)("+"), $L80 = (0, import_lib2.$L)("<="), $L81 = (0, import_lib2.$L)("\u2264"), $L82 = (0, import_lib2.$L)(">="), $L83 = (0, import_lib2.$L)("\u2265"), $L84 = (0, import_lib2.$L)("!<?"), $L85 = (0, import_lib2.$L)("<<"), $L86 = (0, import_lib2.$L)("\u226A"), $L87 = (0, import_lib2.$L)(">>>"), $L88 = (0, import_lib2.$L)("\u22D9"), $L89 = (0, import_lib2.$L)(">>"), $L90 = (0, import_lib2.$L)("\u226B"), $L91 = (0, import_lib2.$L)("!=="), $L92 = (0, import_lib2.$L)("\u2262"), $L93 = (0, import_lib2.$L)("!="), $L94 = (0, import_lib2.$L)("\u2260"), $L95 = (0, import_lib2.$L)("isnt"), $L96 = (0, import_lib2.$L)("==="), $L97 = (0, import_lib2.$L)("\u2263"), $L98 = (0, import_lib2.$L)("\u2A76"), $L99 = (0, import_lib2.$L)("=="), $L100 = (0, import_lib2.$L)("\u2261"), $L101 = (0, import_lib2.$L)("\u2A75"), $L102 = (0, import_lib2.$L)("and"), $L103 = (0, import_lib2.$L)("&&"), $L104 = (0, import_lib2.$L)("or"), $L105 = (0, import_lib2.$L)("||"), $L106 = (0, import_lib2.$L)("\u2016"), $L107 = (0, import_lib2.$L)("^^"), $L108 = (0, import_lib2.$L)("xor"), $L109 = (0, import_lib2.$L)("xnor"), $L110 = (0, import_lib2.$L)("??"), $L111 = (0, import_lib2.$L)("\u2047"), $L112 = (0, import_lib2.$L)("instanceof"), $L113 = (0, import_lib2.$L)("\u2208"), $L114 = (0, import_lib2.$L)("\u220B"), $L115 = (0, import_lib2.$L)("\u220C"), $L116 = (0, import_lib2.$L)("\u2209"), $L117 = (0, import_lib2.$L)("&"), $L118 = (0, import_lib2.$L)("|"), $L119 = (0, import_lib2.$L)(";"), $L120 = (0, import_lib2.$L)("some"), $L121 = (0, import_lib2.$L)("every"), $L122 = (0, import_lib2.$L)("count"), $L123 = (0, import_lib2.$L)("first"), $L124 = (0, import_lib2.$L)("sum"), $L125 = (0, import_lib2.$L)("product"), $L126 = (0, import_lib2.$L)("min"), $L127 = (0, import_lib2.$L)("max"), $L128 = (0, import_lib2.$L)("join"), $L129 = (0, import_lib2.$L)("concat"), $L130 = (0, import_lib2.$L)("break"), $L131 = (0, import_lib2.$L)("continue"), $L132 = (0, import_lib2.$L)("debugger"), $L133 = (0, import_lib2.$L)("require"), $L134 = (0, import_lib2.$L)("with"), $L135 = (0, import_lib2.$L)("assert"), $L136 = (0, import_lib2.$L)(":="), $L137 = (0, import_lib2.$L)("\u2254"), $L138 = (0, import_lib2.$L)(".="), $L139 = (0, import_lib2.$L)("::="), $L140 = (0, import_lib2.$L)("/*"), $L141 = (0, import_lib2.$L)("*/"), $L142 = (0, import_lib2.$L)("\\"), $L143 = (0, import_lib2.$L)(")"), $L144 = (0, import_lib2.$L)("abstract"), $L145 = (0, import_lib2.$L)("as"), $L146 = (0, import_lib2.$L)("@"), $L147 = (0, import_lib2.$L)("@@"), $L148 = (0, import_lib2.$L)("async"), $L149 = (0, import_lib2.$L)("await"), $L150 = (0, import_lib2.$L)("`"), $L151 = (0, import_lib2.$L)("by"), $L152 = (0, import_lib2.$L)("case"), $L153 = (0, import_lib2.$L)("catch"), $L154 = (0, import_lib2.$L)("class"), $L155 = (0, import_lib2.$L)("#{"), $L156 = (0, import_lib2.$L)("comptime"), $L157 = (0, import_lib2.$L)("declare"), $L158 = (0, import_lib2.$L)("default"), $L159 = (0, import_lib2.$L)("delete"), $L160 = (0, import_lib2.$L)("do"), $L161 = (0, import_lib2.$L)(".."), $L162 = (0, import_lib2.$L)("\u2025"), $L163 = (0, import_lib2.$L)("..."), $L164 = (0, import_lib2.$L)("\u2026"), $L165 = (0, import_lib2.$L)("::"), $L166 = (0, import_lib2.$L)('"'), $L167 = (0, import_lib2.$L)("each"), $L168 = (0, import_lib2.$L)("else"), $L169 = (0, import_lib2.$L)("!"), $L170 = (0, import_lib2.$L)("export"), $L171 = (0, import_lib2.$L)("extends"), $L172 = (0, import_lib2.$L)("finally"), $L173 = (0, import_lib2.$L)("for"), $L174 = (0, import_lib2.$L)("from"), $L175 = (0, import_lib2.$L)("function"), $L176 = (0, import_lib2.$L)("get"), $L177 = (0, import_lib2.$L)("set"), $L178 = (0, import_lib2.$L)("#"), $L179 = (0, import_lib2.$L)("if"), $L180 = (0, import_lib2.$L)("in"), $L181 = (0, import_lib2.$L)("infer"), $L182 = (0, import_lib2.$L)("let"), $L183 = (0, import_lib2.$L)("const"), $L184 = (0, import_lib2.$L)("is"), $L185 = (0, import_lib2.$L)("var"), $L186 = (0, import_lib2.$L)("like"), $L187 = (0, import_lib2.$L)("loop"), $L188 = (0, import_lib2.$L)("new"), $L189 = (0, import_lib2.$L)("not"), $L190 = (0, import_lib2.$L)("of"), $L191 = (0, import_lib2.$L)("["), $L192 = (0, import_lib2.$L)("operator"), $L193 = (0, import_lib2.$L)("override"), $L194 = (0, import_lib2.$L)("own"), $L195 = (0, import_lib2.$L)("public"), $L196 = (0, import_lib2.$L)("private"), $L197 = (0, import_lib2.$L)("protected"), $L198 = (0, import_lib2.$L)("||>"), $L199 = (0, import_lib2.$L)("|\u25B7"), $L200 = (0, import_lib2.$L)("|>="), $L201 = (0, import_lib2.$L)("\u25B7="), $L202 = (0, import_lib2.$L)("|>"), $L203 = (0, import_lib2.$L)("\u25B7"), $L204 = (0, import_lib2.$L)("readonly"), $L205 = (0, import_lib2.$L)("return"), $L206 = (0, import_lib2.$L)("satisfies"), $L207 = (0, import_lib2.$L)("'"), $L208 = (0, import_lib2.$L)("static"), $L209 = (0, import_lib2.$L)("${"), $L210 = (0, import_lib2.$L)("super"), $L211 = (0, import_lib2.$L)("switch"), $L212 = (0, import_lib2.$L)("target"), $L213 = (0, import_lib2.$L)("then"), $L214 = (0, import_lib2.$L)("this"), $L215 = (0, import_lib2.$L)("throw"), $L216 = (0, import_lib2.$L)('"""'), $L217 = (0, import_lib2.$L)("'''"), $L218 = (0, import_lib2.$L)("///"), $L219 = (0, import_lib2.$L)("```"), $L220 = (0, import_lib2.$L)("try"), $L221 = (0, import_lib2.$L)("typeof"), $L222 = (0, import_lib2.$L)("undefined"), $L223 = (0, import_lib2.$L)("unless"), $L224 = (0, import_lib2.$L)("until"), $L225 = (0, import_lib2.$L)("using"), $L226 = (0, import_lib2.$L)("void"), $L227 = (0, import_lib2.$L)("when"), $L228 = (0, import_lib2.$L)("while"), $L229 = (0, import_lib2.$L)("yield"), $L230 = (0, import_lib2.$L)("/>"), $L231 = (0, import_lib2.$L)("</"), $L232 = (0, import_lib2.$L)("<>"), $L233 = (0, import_lib2.$L)("</>"), $L234 = (0, import_lib2.$L)("<!--"), $L235 = (0, import_lib2.$L)("-->"), $L236 = (0, import_lib2.$L)("type"), $L237 = (0, import_lib2.$L)("enum"), $L238 = (0, import_lib2.$L)("interface"), $L239 = (0, import_lib2.$L)("global"), $L240 = (0, import_lib2.$L)("module"), $L241 = (0, import_lib2.$L)("namespace"), $L242 = (0, import_lib2.$L)("asserts"), $L243 = (0, import_lib2.$L)("keyof"), $L244 = (0, import_lib2.$L)("???"), $L245 = (0, import_lib2.$L)("unique"), $L246 = (0, import_lib2.$L)("symbol"), $L247 = (0, import_lib2.$L)("[]"), $L248 = (0, import_lib2.$L)("civet"), $R0 = (0, import_lib2.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy")), $R1 = (0, import_lib2.$R)(new RegExp("&(?=\\s)", "suy")), $R2 = (0, import_lib2.$R)(new RegExp("(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy")), $R3 = (0, import_lib2.$R)(new RegExp("[0-9]", "suy")), $R4 = (0, import_lib2.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy")), $R5 = (0, import_lib2.$R)(new RegExp("[ \\t]", "suy")), $R6 = (0, import_lib2.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{=]", "suy")), $R7 = (0, import_lib2.$R)(new RegExp("[&=]", "suy")), $R8 = (0, import_lib2.$R)(new RegExp("(?=['\"`])", "suy")), $R9 = (0, import_lib2.$R)(new RegExp("(?=[\\/?])", "suy")), $R10 = (0, import_lib2.$R)(new RegExp("(?=[\\/\\[{?.!@#'\u2019:])", "suy")), $R11 = (0, import_lib2.$R)(new RegExp("%%?", "suy")), $R12 = (0, import_lib2.$R)(new RegExp("[.\\s]", "suy")), $R13 = (0, import_lib2.$R)(new RegExp("[)}]", "suy")), $R14 = (0, import_lib2.$R)(new RegExp("[+-]", "suy")), $R15 = (0, import_lib2.$R)(new RegExp("\\+\\+|--|\u29FA|\u2014|[\\+\\-&]\\S", "suy")), $R16 = (0, import_lib2.$R)(new RegExp(`(?=[0-9.'"tfyno])`, "suy")), $R17 = (0, import_lib2.$R)(new RegExp("(?=true|false|yes|no|on|off)", "suy")), $R18 = (0, import_lib2.$R)(new RegExp("(?=\\p{ID_Start}|[_$])", "suy")), $R19 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy")), $R20 = (0, import_lib2.$R)(new RegExp("(?=\\[|\\s*[.\u2022\\/])", "suy")), $R21 = (0, import_lib2.$R)(new RegExp("([<>])(=?)|([\u2264\u2265])", "suy")), $R22 = (0, import_lib2.$R)(new RegExp("[ \\t]*", "suy")), $R23 = (0, import_lib2.$R)(new RegExp("[ \\t]+", "suy")), $R24 = (0, import_lib2.$R)(new RegExp("[!+-]?", "suy")), $R25 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy")), $R26 = (0, import_lib2.$R)(new RegExp("[=>]", "suy")), $R27 = (0, import_lib2.$R)(new RegExp("(?=\\p{ID_Start}|[_$^\u226A\u226B\u22D9\u2264\u2265\u2208\u220B\u2209\u220C\u2263\u2261\u2262\u2260=\u2A76\u2A75\u2016\u2047&|*\\/!?%\xF7<>\u29FA+-])", "suy")), $R28 = (0, import_lib2.$R)(new RegExp("!\\^\\^?", "suy")), $R29 = (0, import_lib2.$R)(new RegExp("(?!\\+\\+|--)[!~+-](?!\\s)", "suy")), $R30 = (0, import_lib2.$R)(new RegExp("[:.]", "suy")), $R31 = (0, import_lib2.$R)(new RegExp("(?=for|if|loop|unless|until|while)", "suy")), $R32 = (0, import_lib2.$R)(new RegExp("(?:loop|while|until|for|do)(?!\\p{ID_Continue})", "suy")), $R33 = (0, import_lib2.$R)(new RegExp("(?=loop|comptime|do|for|until|while)", "suy")), $R34 = (0, import_lib2.$R)(new RegExp('[^;"\\s=>]+', "suy")), $R35 = (0, import_lib2.$R)(new RegExp("(?=[0-9.])", "suy")), $R36 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy")), $R37 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy")), $R38 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?", "suy")), $R39 = (0, import_lib2.$R)(new RegExp("(?:\\.[0-9](?:_[0-9]|[0-9])*)", "suy")), $R40 = (0, import_lib2.$R)(new RegExp("(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)", "suy")), $R41 = (0, import_lib2.$R)(new RegExp("0[bB][01](?:[01]|_[01])*n?", "suy")), $R42 = (0, import_lib2.$R)(new RegExp("0[oO][0-7](?:[0-7]|_[0-7])*n?", "suy")), $R43 = (0, import_lib2.$R)(new RegExp("0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?", "suy")), $R44 = (0, import_lib2.$R)(new RegExp("(?=[0-9])", "suy")), $R45 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)", "suy")), $R46 = (0, import_lib2.$R)(new RegExp('(?:\\\\.|[^"])*', "suy")), $R47 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^'])*", "suy")), $R48 = (0, import_lib2.$R)(new RegExp('(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+', "suy")), $R49 = (0, import_lib2.$R)(new RegExp('(?:"(?!"")|\\\\.|[^"])+', "suy")), $R50 = (0, import_lib2.$R)(new RegExp("(?:'(?!'')|\\\\.|[^'])*", "suy")), $R51 = (0, import_lib2.$R)(new RegExp('(?:\\\\.|#(?!\\{)|[^"#])+', "suy")), $R52 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^\\]])*", "suy")), $R53 = (0, import_lib2.$R)(new RegExp("(?:\\\\.)", "suy")), $R54 = (0, import_lib2.$R)(new RegExp("[\\s]+", "suy")), $R55 = (0, import_lib2.$R)(new RegExp("\\/(?!\\/\\/)", "suy")), $R56 = (0, import_lib2.$R)(new RegExp("[^[\\/\\s#$\\\\]+|[#$]", "suy")), $R57 = (0, import_lib2.$R)(new RegExp("[*\\/\\r\\n]", "suy")), $R58 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^[\\/\\r\\n])+", "suy")), $R59 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy")), $R60 = (0, import_lib2.$R)(new RegExp("(?=[`'\"])", "suy")), $R61 = (0, import_lib2.$R)(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy")), $R62 = (0, import_lib2.$R)(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy")), $R63 = (0, import_lib2.$R)(new RegExp("(?:on|off|yes|no)(?!\\p{ID_Continue})", "suy")), $R64 = (0, import_lib2.$R)(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy")), $R65 = (0, import_lib2.$R)(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy")), $R66 = (0, import_lib2.$R)(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy")), $R67 = (0, import_lib2.$R)(new RegExp("(?:and|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|let|loop|new|not|null|or|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy")), $R68 = (0, import_lib2.$R)(new RegExp("(?=\\/|#)", "suy")), $R69 = (0, import_lib2.$R)(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy")), $R70 = (0, import_lib2.$R)(new RegExp(".", "suy")), $R71 = (0, import_lib2.$R)(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy")), $R72 = (0, import_lib2.$R)(new RegExp("[^]*?###", "suy")), $R73 = (0, import_lib2.$R)(new RegExp("###(?!#)", "suy")), $R74 = (0, import_lib2.$R)(new RegExp("\\/\\*(?:(?!\\*\\/)[^\\r\\n])*\\*\\/", "suy")), $R75 = (0, import_lib2.$R)(new RegExp("(?=[ \\t\\/\\\\])", "suy")), $R76 = (0, import_lib2.$R)(new RegExp("(?=\\s|\\/|#)", "suy")), $R77 = (0, import_lib2.$R)(new RegExp("(?!\\p{ID_Continue})", "suy")), $R78 = (0, import_lib2.$R)(new RegExp("[=:]", "suy")), $R79 = (0, import_lib2.$R)(new RegExp("['\u2019]s", "suy")), $R80 = (0, import_lib2.$R)(new RegExp("\\s", "suy")), $R81 = (0, import_lib2.$R)(new RegExp("(?=[<])", "suy")), $R82 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy")), $R83 = (0, import_lib2.$R)(new RegExp("[!+-]", "suy")), $R84 = (0, import_lib2.$R)(new RegExp("[\\s>]|\\/>", "suy")), $R85 = (0, import_lib2.$R)(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy")), $R86 = (0, import_lib2.$R)(new RegExp(`"[^"]*"|'[^']*'`, "suy")), $R87 = (0, import_lib2.$R)(new RegExp("[<>]", "suy")), $R88 = (0, import_lib2.$R)(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy")), $R89 = (0, import_lib2.$R)(new RegExp("(?:-[^-]|[^-]*)*", "suy")), $R90 = (0, import_lib2.$R)(new RegExp("[^{}<>\\r\\n]+", "suy")), $R91 = (0, import_lib2.$R)(new RegExp("[+-]?", "suy")), $R92 = (0, import_lib2.$R)(new RegExp("(?=if|unless)", "suy")), $R93 = (0, import_lib2.$R)(new RegExp("[|&<!=\\-\u21D2\u2192]", "suy")), $R94 = (0, import_lib2.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy")), $R95 = (0, import_lib2.$R)(new RegExp("const|in|out", "suy")), $R96 = (0, import_lib2.$R)(new RegExp("#![^\\r\\n]*", "suy")), $R97 = (0, import_lib2.$R)(new RegExp("[\\t ]*", "suy")), $R98 = (0, import_lib2.$R)(new RegExp("[\\s]*", "suy")), $R99 = (0, import_lib2.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([\\p{ID_Continue}.,+-]*))?", "suy")), $R100 = (0, import_lib2.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy")), $R101 = (0, import_lib2.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy")), $R102 = (0, import_lib2.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy")), $R103 = (0, import_lib2.$R)(new RegExp("[^]*", "suy")), Program$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(Reset, Init, (0, import_lib2.$E)(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
7415
+ };
7416
+ var $L0 = (0, import_lib2.$L)(""), $L1 = (0, import_lib2.$L)("{"), $L2 = (0, import_lib2.$L)("/ "), $L3 = (0, import_lib2.$L)("="), $L4 = (0, import_lib2.$L)("("), $L5 = (0, import_lib2.$L)("... "), $L6 = (0, import_lib2.$L)("?"), $L7 = (0, import_lib2.$L)("."), $L8 = (0, import_lib2.$L)("tuple"), $L9 = (0, import_lib2.$L)("++"), $L10 = (0, import_lib2.$L)("--"), $L11 = (0, import_lib2.$L)("\u29FA"), $L12 = (0, import_lib2.$L)("\u2014"), $L13 = (0, import_lib2.$L)("=>"), $L14 = (0, import_lib2.$L)("\u21D2"), $L15 = (0, import_lib2.$L)("import"), $L16 = (0, import_lib2.$L)(":"), $L17 = (0, import_lib2.$L)(" "), $L18 = (0, import_lib2.$L)("<"), $L19 = (0, import_lib2.$L)("implements"), $L20 = (0, import_lib2.$L)("<:"), $L21 = (0, import_lib2.$L)("^"), $L22 = (0, import_lib2.$L)("<?"), $L23 = (0, import_lib2.$L)("-"), $L24 = (0, import_lib2.$L)("import.meta"), $L25 = (0, import_lib2.$L)("return.value"), $L26 = (0, import_lib2.$L)(","), $L27 = (0, import_lib2.$L)("tighter"), $L28 = (0, import_lib2.$L)("looser"), $L29 = (0, import_lib2.$L)("same"), $L30 = (0, import_lib2.$L)("left"), $L31 = (0, import_lib2.$L)("right"), $L32 = (0, import_lib2.$L)("non"), $L33 = (0, import_lib2.$L)("relational"), $L34 = (0, import_lib2.$L)("arguments"), $L35 = (0, import_lib2.$L)("->"), $L36 = (0, import_lib2.$L)("\u2192"), $L37 = (0, import_lib2.$L)("}"), $L38 = (0, import_lib2.$L)("null"), $L39 = (0, import_lib2.$L)("true"), $L40 = (0, import_lib2.$L)("false"), $L41 = (0, import_lib2.$L)("yes"), $L42 = (0, import_lib2.$L)("on"), $L43 = (0, import_lib2.$L)("no"), $L44 = (0, import_lib2.$L)("off"), $L45 = (0, import_lib2.$L)(">"), $L46 = (0, import_lib2.$L)("]"), $L47 = (0, import_lib2.$L)("\u2022"), $L48 = (0, import_lib2.$L)("//"), $L49 = (0, import_lib2.$L)("**="), $L50 = (0, import_lib2.$L)("*="), $L51 = (0, import_lib2.$L)("%/"), $L52 = (0, import_lib2.$L)("\xF7"), $L53 = (0, import_lib2.$L)("%%"), $L54 = (0, import_lib2.$L)("/="), $L55 = (0, import_lib2.$L)("%="), $L56 = (0, import_lib2.$L)("+="), $L57 = (0, import_lib2.$L)("-="), $L58 = (0, import_lib2.$L)("<<="), $L59 = (0, import_lib2.$L)("\u226A="), $L60 = (0, import_lib2.$L)(">>>="), $L61 = (0, import_lib2.$L)("\u22D9="), $L62 = (0, import_lib2.$L)(">>="), $L63 = (0, import_lib2.$L)("\u226B="), $L64 = (0, import_lib2.$L)("&&="), $L65 = (0, import_lib2.$L)("&="), $L66 = (0, import_lib2.$L)("^="), $L67 = (0, import_lib2.$L)("||="), $L68 = (0, import_lib2.$L)("\u2016="), $L69 = (0, import_lib2.$L)("|="), $L70 = (0, import_lib2.$L)("??="), $L71 = (0, import_lib2.$L)("\u2047="), $L72 = (0, import_lib2.$L)("?="), $L73 = (0, import_lib2.$L)("and="), $L74 = (0, import_lib2.$L)("or="), $L75 = (0, import_lib2.$L)("*"), $L76 = (0, import_lib2.$L)("**"), $L77 = (0, import_lib2.$L)("/"), $L78 = (0, import_lib2.$L)("%"), $L79 = (0, import_lib2.$L)("+"), $L80 = (0, import_lib2.$L)("<="), $L81 = (0, import_lib2.$L)("\u2264"), $L82 = (0, import_lib2.$L)(">="), $L83 = (0, import_lib2.$L)("\u2265"), $L84 = (0, import_lib2.$L)("!<?"), $L85 = (0, import_lib2.$L)("<<"), $L86 = (0, import_lib2.$L)("\u226A"), $L87 = (0, import_lib2.$L)(">>>"), $L88 = (0, import_lib2.$L)("\u22D9"), $L89 = (0, import_lib2.$L)(">>"), $L90 = (0, import_lib2.$L)("\u226B"), $L91 = (0, import_lib2.$L)("!=="), $L92 = (0, import_lib2.$L)("\u2262"), $L93 = (0, import_lib2.$L)("!="), $L94 = (0, import_lib2.$L)("\u2260"), $L95 = (0, import_lib2.$L)("isnt"), $L96 = (0, import_lib2.$L)("==="), $L97 = (0, import_lib2.$L)("\u2263"), $L98 = (0, import_lib2.$L)("\u2A76"), $L99 = (0, import_lib2.$L)("=="), $L100 = (0, import_lib2.$L)("\u2261"), $L101 = (0, import_lib2.$L)("\u2A75"), $L102 = (0, import_lib2.$L)("and"), $L103 = (0, import_lib2.$L)("&&"), $L104 = (0, import_lib2.$L)("or"), $L105 = (0, import_lib2.$L)("||"), $L106 = (0, import_lib2.$L)("\u2016"), $L107 = (0, import_lib2.$L)("^^"), $L108 = (0, import_lib2.$L)("xor"), $L109 = (0, import_lib2.$L)("xnor"), $L110 = (0, import_lib2.$L)("??"), $L111 = (0, import_lib2.$L)("\u2047"), $L112 = (0, import_lib2.$L)("instanceof"), $L113 = (0, import_lib2.$L)("\u2208"), $L114 = (0, import_lib2.$L)("\u220B"), $L115 = (0, import_lib2.$L)("\u220C"), $L116 = (0, import_lib2.$L)("\u2209"), $L117 = (0, import_lib2.$L)("&"), $L118 = (0, import_lib2.$L)("|"), $L119 = (0, import_lib2.$L)(";"), $L120 = (0, import_lib2.$L)("some"), $L121 = (0, import_lib2.$L)("every"), $L122 = (0, import_lib2.$L)("count"), $L123 = (0, import_lib2.$L)("first"), $L124 = (0, import_lib2.$L)("sum"), $L125 = (0, import_lib2.$L)("product"), $L126 = (0, import_lib2.$L)("min"), $L127 = (0, import_lib2.$L)("max"), $L128 = (0, import_lib2.$L)("join"), $L129 = (0, import_lib2.$L)("concat"), $L130 = (0, import_lib2.$L)("break"), $L131 = (0, import_lib2.$L)("continue"), $L132 = (0, import_lib2.$L)("debugger"), $L133 = (0, import_lib2.$L)("require"), $L134 = (0, import_lib2.$L)("with"), $L135 = (0, import_lib2.$L)("assert"), $L136 = (0, import_lib2.$L)(":="), $L137 = (0, import_lib2.$L)("\u2254"), $L138 = (0, import_lib2.$L)(".="), $L139 = (0, import_lib2.$L)("::="), $L140 = (0, import_lib2.$L)("/*"), $L141 = (0, import_lib2.$L)("*/"), $L142 = (0, import_lib2.$L)("\\"), $L143 = (0, import_lib2.$L)(")"), $L144 = (0, import_lib2.$L)("abstract"), $L145 = (0, import_lib2.$L)("as"), $L146 = (0, import_lib2.$L)("@"), $L147 = (0, import_lib2.$L)("@@"), $L148 = (0, import_lib2.$L)("async"), $L149 = (0, import_lib2.$L)("await"), $L150 = (0, import_lib2.$L)("`"), $L151 = (0, import_lib2.$L)("by"), $L152 = (0, import_lib2.$L)("case"), $L153 = (0, import_lib2.$L)("catch"), $L154 = (0, import_lib2.$L)("class"), $L155 = (0, import_lib2.$L)("#{"), $L156 = (0, import_lib2.$L)("comptime"), $L157 = (0, import_lib2.$L)("declare"), $L158 = (0, import_lib2.$L)("default"), $L159 = (0, import_lib2.$L)("delete"), $L160 = (0, import_lib2.$L)("do"), $L161 = (0, import_lib2.$L)(".."), $L162 = (0, import_lib2.$L)("\u2025"), $L163 = (0, import_lib2.$L)("..."), $L164 = (0, import_lib2.$L)("\u2026"), $L165 = (0, import_lib2.$L)("::"), $L166 = (0, import_lib2.$L)('"'), $L167 = (0, import_lib2.$L)("each"), $L168 = (0, import_lib2.$L)("else"), $L169 = (0, import_lib2.$L)("!"), $L170 = (0, import_lib2.$L)("export"), $L171 = (0, import_lib2.$L)("extends"), $L172 = (0, import_lib2.$L)("finally"), $L173 = (0, import_lib2.$L)("for"), $L174 = (0, import_lib2.$L)("from"), $L175 = (0, import_lib2.$L)("function"), $L176 = (0, import_lib2.$L)("get"), $L177 = (0, import_lib2.$L)("set"), $L178 = (0, import_lib2.$L)("#"), $L179 = (0, import_lib2.$L)("if"), $L180 = (0, import_lib2.$L)("in"), $L181 = (0, import_lib2.$L)("infer"), $L182 = (0, import_lib2.$L)("let"), $L183 = (0, import_lib2.$L)("const"), $L184 = (0, import_lib2.$L)("is"), $L185 = (0, import_lib2.$L)("var"), $L186 = (0, import_lib2.$L)("like"), $L187 = (0, import_lib2.$L)("loop"), $L188 = (0, import_lib2.$L)("new"), $L189 = (0, import_lib2.$L)("not"), $L190 = (0, import_lib2.$L)("of"), $L191 = (0, import_lib2.$L)("["), $L192 = (0, import_lib2.$L)("operator"), $L193 = (0, import_lib2.$L)("override"), $L194 = (0, import_lib2.$L)("own"), $L195 = (0, import_lib2.$L)("public"), $L196 = (0, import_lib2.$L)("private"), $L197 = (0, import_lib2.$L)("protected"), $L198 = (0, import_lib2.$L)("||>"), $L199 = (0, import_lib2.$L)("|\u25B7"), $L200 = (0, import_lib2.$L)("|>="), $L201 = (0, import_lib2.$L)("\u25B7="), $L202 = (0, import_lib2.$L)("|>"), $L203 = (0, import_lib2.$L)("\u25B7"), $L204 = (0, import_lib2.$L)("readonly"), $L205 = (0, import_lib2.$L)("return"), $L206 = (0, import_lib2.$L)("satisfies"), $L207 = (0, import_lib2.$L)("'"), $L208 = (0, import_lib2.$L)("static"), $L209 = (0, import_lib2.$L)("${"), $L210 = (0, import_lib2.$L)("super"), $L211 = (0, import_lib2.$L)("switch"), $L212 = (0, import_lib2.$L)("target"), $L213 = (0, import_lib2.$L)("then"), $L214 = (0, import_lib2.$L)("this"), $L215 = (0, import_lib2.$L)("throw"), $L216 = (0, import_lib2.$L)('"""'), $L217 = (0, import_lib2.$L)("'''"), $L218 = (0, import_lib2.$L)("///"), $L219 = (0, import_lib2.$L)("```"), $L220 = (0, import_lib2.$L)("try"), $L221 = (0, import_lib2.$L)("typeof"), $L222 = (0, import_lib2.$L)("undefined"), $L223 = (0, import_lib2.$L)("unless"), $L224 = (0, import_lib2.$L)("until"), $L225 = (0, import_lib2.$L)("using"), $L226 = (0, import_lib2.$L)("void"), $L227 = (0, import_lib2.$L)("when"), $L228 = (0, import_lib2.$L)("while"), $L229 = (0, import_lib2.$L)("yield"), $L230 = (0, import_lib2.$L)("/>"), $L231 = (0, import_lib2.$L)("</"), $L232 = (0, import_lib2.$L)("<>"), $L233 = (0, import_lib2.$L)("</>"), $L234 = (0, import_lib2.$L)("<!--"), $L235 = (0, import_lib2.$L)("-->"), $L236 = (0, import_lib2.$L)("type"), $L237 = (0, import_lib2.$L)("enum"), $L238 = (0, import_lib2.$L)("interface"), $L239 = (0, import_lib2.$L)("global"), $L240 = (0, import_lib2.$L)("module"), $L241 = (0, import_lib2.$L)("namespace"), $L242 = (0, import_lib2.$L)("asserts"), $L243 = (0, import_lib2.$L)("keyof"), $L244 = (0, import_lib2.$L)("???"), $L245 = (0, import_lib2.$L)("unique"), $L246 = (0, import_lib2.$L)("symbol"), $L247 = (0, import_lib2.$L)("[]"), $L248 = (0, import_lib2.$L)("civet"), $R0 = (0, import_lib2.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy")), $R1 = (0, import_lib2.$R)(new RegExp("&(?=\\s)", "suy")), $R2 = (0, import_lib2.$R)(new RegExp("(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy")), $R3 = (0, import_lib2.$R)(new RegExp("[0-9]", "suy")), $R4 = (0, import_lib2.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy")), $R5 = (0, import_lib2.$R)(new RegExp("[ \\t]", "suy")), $R6 = (0, import_lib2.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{=]", "suy")), $R7 = (0, import_lib2.$R)(new RegExp("[&=]", "suy")), $R8 = (0, import_lib2.$R)(new RegExp("(?=['\"`])", "suy")), $R9 = (0, import_lib2.$R)(new RegExp("(?=[\\/?])", "suy")), $R10 = (0, import_lib2.$R)(new RegExp("(?=[\\/\\[{?.!@#'\u2019:])", "suy")), $R11 = (0, import_lib2.$R)(new RegExp("%%?", "suy")), $R12 = (0, import_lib2.$R)(new RegExp("[.\\s]", "suy")), $R13 = (0, import_lib2.$R)(new RegExp("[)\\]}]", "suy")), $R14 = (0, import_lib2.$R)(new RegExp("[+-]", "suy")), $R15 = (0, import_lib2.$R)(new RegExp("\\+\\+|--|\u29FA|\u2014|[\\+\\-&]\\S", "suy")), $R16 = (0, import_lib2.$R)(new RegExp(`(?=[0-9.'"tfyno])`, "suy")), $R17 = (0, import_lib2.$R)(new RegExp("(?=true|false|yes|no|on|off)", "suy")), $R18 = (0, import_lib2.$R)(new RegExp("(?=\\p{ID_Start}|[_$])", "suy")), $R19 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy")), $R20 = (0, import_lib2.$R)(new RegExp("(?=\\[|\\s*[.\u2022\\/])", "suy")), $R21 = (0, import_lib2.$R)(new RegExp("([<>])(=?)|([\u2264\u2265])", "suy")), $R22 = (0, import_lib2.$R)(new RegExp("[ \\t]*", "suy")), $R23 = (0, import_lib2.$R)(new RegExp("[ \\t]+", "suy")), $R24 = (0, import_lib2.$R)(new RegExp("[!+-]?", "suy")), $R25 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy")), $R26 = (0, import_lib2.$R)(new RegExp("[=>]", "suy")), $R27 = (0, import_lib2.$R)(new RegExp("(?=\\p{ID_Start}|[_$^\u226A\u226B\u22D9\u2264\u2265\u2208\u220B\u2209\u220C\u2263\u2261\u2262\u2260=\u2A76\u2A75\u2016\u2047&|*\\/!?%\xF7<>\u29FA+-])", "suy")), $R28 = (0, import_lib2.$R)(new RegExp("!\\^\\^?", "suy")), $R29 = (0, import_lib2.$R)(new RegExp("(?!\\+\\+|--)[!~+-](?!\\s)", "suy")), $R30 = (0, import_lib2.$R)(new RegExp("[:.]", "suy")), $R31 = (0, import_lib2.$R)(new RegExp("(?=for|if|loop|unless|until|while)", "suy")), $R32 = (0, import_lib2.$R)(new RegExp("(?:loop|while|until|for|do)(?!\\p{ID_Continue})", "suy")), $R33 = (0, import_lib2.$R)(new RegExp("(?=loop|comptime|do|for|until|while)", "suy")), $R34 = (0, import_lib2.$R)(new RegExp('[^;"\\s=>]+', "suy")), $R35 = (0, import_lib2.$R)(new RegExp("(?=[0-9.])", "suy")), $R36 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy")), $R37 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy")), $R38 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?", "suy")), $R39 = (0, import_lib2.$R)(new RegExp("(?:\\.[0-9](?:_[0-9]|[0-9])*)", "suy")), $R40 = (0, import_lib2.$R)(new RegExp("(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)", "suy")), $R41 = (0, import_lib2.$R)(new RegExp("0[bB][01](?:[01]|_[01])*n?", "suy")), $R42 = (0, import_lib2.$R)(new RegExp("0[oO][0-7](?:[0-7]|_[0-7])*n?", "suy")), $R43 = (0, import_lib2.$R)(new RegExp("0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?", "suy")), $R44 = (0, import_lib2.$R)(new RegExp("(?=[0-9])", "suy")), $R45 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)", "suy")), $R46 = (0, import_lib2.$R)(new RegExp('(?:\\\\.|[^"])*', "suy")), $R47 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^'])*", "suy")), $R48 = (0, import_lib2.$R)(new RegExp('(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+', "suy")), $R49 = (0, import_lib2.$R)(new RegExp('(?:"(?!"")|\\\\.|[^"])+', "suy")), $R50 = (0, import_lib2.$R)(new RegExp("(?:'(?!'')|\\\\.|[^'])*", "suy")), $R51 = (0, import_lib2.$R)(new RegExp('(?:\\\\.|#(?!\\{)|[^"#])+', "suy")), $R52 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^\\]])*", "suy")), $R53 = (0, import_lib2.$R)(new RegExp("(?:\\\\.)", "suy")), $R54 = (0, import_lib2.$R)(new RegExp("[\\s]+", "suy")), $R55 = (0, import_lib2.$R)(new RegExp("\\/(?!\\/\\/)", "suy")), $R56 = (0, import_lib2.$R)(new RegExp("[^[\\/\\s#$\\\\]+|[#$]", "suy")), $R57 = (0, import_lib2.$R)(new RegExp("[*\\/\\r\\n]", "suy")), $R58 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^[\\/\\r\\n])+", "suy")), $R59 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy")), $R60 = (0, import_lib2.$R)(new RegExp("(?=[`'\"])", "suy")), $R61 = (0, import_lib2.$R)(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy")), $R62 = (0, import_lib2.$R)(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy")), $R63 = (0, import_lib2.$R)(new RegExp("(?:on|off|yes|no)(?!\\p{ID_Continue})", "suy")), $R64 = (0, import_lib2.$R)(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy")), $R65 = (0, import_lib2.$R)(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy")), $R66 = (0, import_lib2.$R)(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy")), $R67 = (0, import_lib2.$R)(new RegExp("(?:and|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|let|loop|new|not|null|or|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy")), $R68 = (0, import_lib2.$R)(new RegExp("(?=\\/|#)", "suy")), $R69 = (0, import_lib2.$R)(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy")), $R70 = (0, import_lib2.$R)(new RegExp(".", "suy")), $R71 = (0, import_lib2.$R)(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy")), $R72 = (0, import_lib2.$R)(new RegExp("[^]*?###", "suy")), $R73 = (0, import_lib2.$R)(new RegExp("###(?!#)", "suy")), $R74 = (0, import_lib2.$R)(new RegExp("\\/\\*(?:(?!\\*\\/)[^\\r\\n])*\\*\\/", "suy")), $R75 = (0, import_lib2.$R)(new RegExp("(?=[ \\t\\/\\\\])", "suy")), $R76 = (0, import_lib2.$R)(new RegExp("(?=\\s|\\/|#)", "suy")), $R77 = (0, import_lib2.$R)(new RegExp("(?!\\p{ID_Continue})", "suy")), $R78 = (0, import_lib2.$R)(new RegExp("[=:]", "suy")), $R79 = (0, import_lib2.$R)(new RegExp("['\u2019]s", "suy")), $R80 = (0, import_lib2.$R)(new RegExp("\\s", "suy")), $R81 = (0, import_lib2.$R)(new RegExp("(?=[<])", "suy")), $R82 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy")), $R83 = (0, import_lib2.$R)(new RegExp("[!+-]", "suy")), $R84 = (0, import_lib2.$R)(new RegExp("[\\s>]|\\/>", "suy")), $R85 = (0, import_lib2.$R)(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy")), $R86 = (0, import_lib2.$R)(new RegExp(`"[^"]*"|'[^']*'`, "suy")), $R87 = (0, import_lib2.$R)(new RegExp("[<>]", "suy")), $R88 = (0, import_lib2.$R)(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy")), $R89 = (0, import_lib2.$R)(new RegExp("(?:-[^-]|[^-]*)*", "suy")), $R90 = (0, import_lib2.$R)(new RegExp("[^{}<>\\r\\n]+", "suy")), $R91 = (0, import_lib2.$R)(new RegExp("[+-]?", "suy")), $R92 = (0, import_lib2.$R)(new RegExp("(?=if|unless)", "suy")), $R93 = (0, import_lib2.$R)(new RegExp("[|&<!=\\-\u21D2\u2192]", "suy")), $R94 = (0, import_lib2.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy")), $R95 = (0, import_lib2.$R)(new RegExp("const|in|out", "suy")), $R96 = (0, import_lib2.$R)(new RegExp("#![^\\r\\n]*", "suy")), $R97 = (0, import_lib2.$R)(new RegExp("[\\t ]*", "suy")), $R98 = (0, import_lib2.$R)(new RegExp("[\\s]*", "suy")), $R99 = (0, import_lib2.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([\\p{ID_Continue}.,+-]*))?", "suy")), $R100 = (0, import_lib2.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy")), $R101 = (0, import_lib2.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy")), $R102 = (0, import_lib2.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy")), $R103 = (0, import_lib2.$R)(new RegExp("[^]*", "suy")), Program$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(Reset, Init, (0, import_lib2.$E)(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
7373
7417
  var reset = $1, init = $2, ws1 = $3, statements = $4, ws2 = $5;
7374
7418
  let program = {
7375
7419
  type: "BlockStatement",
@@ -8349,7 +8393,14 @@ ${js}`
8349
8393
  function NestedClassElement(ctx, state2) {
8350
8394
  return (0, import_lib2.$EVENT)(ctx, state2, "NestedClassElement", NestedClassElement$0);
8351
8395
  }
8352
- var ClassElement$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(Decorators), (0, import_lib2.$E)((0, import_lib2.$S)(Declare, (0, import_lib2.$E)(_))), (0, import_lib2.$E)(AccessModifier), (0, import_lib2.$E)((0, import_lib2.$S)(Static, (0, import_lib2.$E)(_))), (0, import_lib2.$E)((0, import_lib2.$S)(Override, (0, import_lib2.$E)(_))), ClassElementDefinition), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
8396
+ var ClassElement$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(CoffeeClassesEnabled, (0, import_lib2.$E)(Decorators), (0, import_lib2.$E)((0, import_lib2.$S)(Declare, (0, import_lib2.$E)(_))), (0, import_lib2.$E)(AccessModifier), (0, import_lib2.$E)((0, import_lib2.$S)(Static, (0, import_lib2.$E)(_))), (0, import_lib2.$E)((0, import_lib2.$S)(Override, (0, import_lib2.$E)(_))), ActualAssignment), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
8397
+ var decorators = $2, declare = $3, access = $4, static_ = $5, override = $6, assignment = $7;
8398
+ return {
8399
+ type: static_ ? "CoffeeClassPublic" : "CoffeeClassPrivate",
8400
+ children: [decorators, declare, access, static_, override, assignment],
8401
+ assignment
8402
+ };
8403
+ }), ClassElement$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(Decorators), (0, import_lib2.$E)((0, import_lib2.$S)(Declare, (0, import_lib2.$E)(_))), (0, import_lib2.$E)(AccessModifier), (0, import_lib2.$E)((0, import_lib2.$S)(Static, (0, import_lib2.$E)(_))), (0, import_lib2.$E)((0, import_lib2.$S)(Override, (0, import_lib2.$E)(_))), ClassElementDefinition), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
8353
8404
  var decorators = $1, declare = $2, access = $3, static_ = $4, override = $5, definition = $6;
8354
8405
  let ts2 = definition.ts || !!declare;
8355
8406
  return definition.type === "MultiMethodDefinition" ? {
@@ -8364,12 +8415,12 @@ ${js}`
8364
8415
  ts: ts2,
8365
8416
  children: [decorators, declare, access, static_, override, ...definition.children]
8366
8417
  };
8367
- }), ClassElement$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Static, BracedBlock), function($skip, $loc, $0, $1, $2) {
8418
+ }), ClassElement$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(Static, BracedBlock), function($skip, $loc, $0, $1, $2) {
8368
8419
  return {
8369
8420
  type: "ClassStaticBlock",
8370
8421
  children: $0
8371
8422
  };
8372
- }), ClassElement$2 = EmptyStatement, ClassElement$$ = [ClassElement$0, ClassElement$1, ClassElement$2];
8423
+ }), ClassElement$3 = EmptyStatement, ClassElement$$ = [ClassElement$0, ClassElement$1, ClassElement$2, ClassElement$3];
8373
8424
  function ClassElement(ctx, state2) {
8374
8425
  return (0, import_lib2.$EVENT_C)(ctx, state2, "ClassElement", ClassElement$$);
8375
8426
  }
@@ -8412,28 +8463,10 @@ ${js}`
8412
8463
  var FieldDefinition$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(CoffeeClassesEnabled, ClassElementName, (0, import_lib2.$E)(_), Colon, __, AssignmentExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
8413
8464
  var id = $2, exp = $6;
8414
8465
  switch (exp.type) {
8415
- case "FunctionExpression": {
8416
- let fnTokenIndex = exp.children.findIndex((c) => c?.token?.startsWith("function")), children = exp.children.slice();
8417
- return exp.generator ? children.splice(fnTokenIndex, 2, children[fnTokenIndex + 1], id) : children.splice(fnTokenIndex, 1, id), {
8418
- ...exp,
8419
- type: "MethodDefinition",
8420
- name: id.name,
8421
- signature: { ...exp.signature, id, name: id.name },
8422
- children
8423
- };
8424
- }
8425
- case "ArrowFunction": {
8426
- let block = { ...exp.block }, children = exp.children.filter((c) => !(Array.isArray(c) && c[c.length - 1]?.token?.includes("=>"))).map((c) => c === exp.block ? block : c);
8427
- return children.unshift(id), exp = {
8428
- ...exp,
8429
- type: "MethodDefinition",
8430
- name: id.name,
8431
- signature: { ...exp.signature, id, name: id.name },
8432
- block,
8433
- children,
8434
- autoBind: !0
8435
- }, block.parent = exp, braceBlock(block), exp;
8436
- }
8466
+ case "FunctionExpression":
8467
+ return convertFunctionToMethod(id, exp);
8468
+ case "ArrowFunction":
8469
+ return convertArrowFunctionToMethod(id, exp);
8437
8470
  default:
8438
8471
  return {
8439
8472
  type: "FieldDefinition",
@@ -8453,14 +8486,7 @@ ${js}`
8453
8486
  children: $0,
8454
8487
  readonly
8455
8488
  };
8456
- }), FieldDefinition$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(CoffeeClassesEnabled, ActualAssignment), function($skip, $loc, $0, $1, $2) {
8457
- var assignment = $2;
8458
- return {
8459
- type: "CoffeeClassPrivate",
8460
- children: [assignment],
8461
- assignment
8462
- };
8463
- }), FieldDefinition$3 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(Abstract, (0, import_lib2.$E)(_))), (0, import_lib2.$E)((0, import_lib2.$S)(Readonly, (0, import_lib2.$E)(_))), ClassElementName, (0, import_lib2.$E)(TypeSuffix), (0, import_lib2.$E)(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
8489
+ }), FieldDefinition$2 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(Abstract, (0, import_lib2.$E)(_))), (0, import_lib2.$E)((0, import_lib2.$S)(Readonly, (0, import_lib2.$E)(_))), ClassElementName, (0, import_lib2.$E)(TypeSuffix), (0, import_lib2.$E)(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
8464
8490
  var abstract = $1, readonly = $2, id = $3, typeSuffix = $4, initializer = $5;
8465
8491
  return {
8466
8492
  type: "FieldDefinition",
@@ -8472,7 +8498,7 @@ ${js}`
8472
8498
  readonly,
8473
8499
  initializer
8474
8500
  };
8475
- }), FieldDefinition$$ = [FieldDefinition$0, FieldDefinition$1, FieldDefinition$2, FieldDefinition$3];
8501
+ }), FieldDefinition$$ = [FieldDefinition$0, FieldDefinition$1, FieldDefinition$2];
8476
8502
  function FieldDefinition(ctx, state2) {
8477
8503
  return (0, import_lib2.$EVENT_C)(ctx, state2, "FieldDefinition", FieldDefinition$$);
8478
8504
  }
@@ -9053,7 +9079,7 @@ ${js}`
9053
9079
  function ParameterElement(ctx, state2) {
9054
9080
  return (0, import_lib2.$EVENT)(ctx, state2, "ParameterElement", ParameterElement$0);
9055
9081
  }
9056
- var ParameterElementDelimiter$0 = (0, import_lib2.$S)((0, import_lib2.$E)(_), Comma), ParameterElementDelimiter$1 = (0, import_lib2.$Y)((0, import_lib2.$S)(__, (0, import_lib2.$R$0)((0, import_lib2.$EXPECT)($R13, "ParameterElementDelimiter /[)}]/")))), ParameterElementDelimiter$2 = (0, import_lib2.$T)((0, import_lib2.$S)((0, import_lib2.$Y)(EOS), InsertComma), function(value) {
9082
+ var ParameterElementDelimiter$0 = (0, import_lib2.$S)((0, import_lib2.$E)(_), Comma), ParameterElementDelimiter$1 = (0, import_lib2.$Y)((0, import_lib2.$S)(__, (0, import_lib2.$R$0)((0, import_lib2.$EXPECT)($R13, "ParameterElementDelimiter /[)\\]}]/")))), ParameterElementDelimiter$2 = (0, import_lib2.$T)((0, import_lib2.$S)((0, import_lib2.$Y)(EOS), InsertComma), function(value) {
9057
9083
  return value[1];
9058
9084
  }), ParameterElementDelimiter$$ = [ParameterElementDelimiter$0, ParameterElementDelimiter$1, ParameterElementDelimiter$2];
9059
9085
  function ParameterElementDelimiter(ctx, state2) {
@@ -9558,10 +9584,10 @@ ${js}`
9558
9584
  }
9559
9585
  var OperatorDeclaration$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(Operator, (0, import_lib2.$E)(OperatorBehavior), _, LexicalDeclaration), function($skip, $loc, $0, $1, $2, $3, $4) {
9560
9586
  var op = $1, behavior = $2, w = $3, decl = $4;
9561
- return decl.names.forEach((name) => state.operators.set(name, behavior)), behavior?.error && (decl = prepend(behavior.error, decl)), decl = prepend(trimFirstSpace(w), decl), decl;
9587
+ return decl.names.forEach((name) => setOperatorBehavior(name, behavior)), behavior?.error && (decl = prepend(behavior.error, decl)), decl = prepend(trimFirstSpace(w), decl), decl;
9562
9588
  }), OperatorDeclaration$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(OperatorSignature, BracedBlock), function($skip, $loc, $0, $1, $2) {
9563
9589
  var signature = $1, block = $2;
9564
- return state.operators.set(signature.id.name, signature.behavior), {
9590
+ return setOperatorBehavior(signature.id.name, signature.behavior), {
9565
9591
  ...signature,
9566
9592
  type: "FunctionExpression",
9567
9593
  signature,
@@ -9572,8 +9598,8 @@ ${js}`
9572
9598
  }), OperatorDeclaration$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(Operator, _, Identifier, (0, import_lib2.$E)(OperatorBehavior), (0, import_lib2.$Q)((0, import_lib2.$S)(CommaDelimiter, (0, import_lib2.$E)(_), Identifier, (0, import_lib2.$E)(OperatorBehavior)))), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9573
9599
  var op = $1, w1 = $2, id = $3, behavior = $4, ids = $5;
9574
9600
  let children = [];
9575
- return state.operators.set(id.name, behavior), behavior?.error && children.push(behavior.error), ids.forEach(([, , id2, behavior2]) => {
9576
- state.operators.set(id2.name, behavior2), behavior2?.error && children.push(behavior2.error);
9601
+ return setOperatorBehavior(id.name, behavior), behavior?.error && children.push(behavior.error), ids.forEach(([, , id2, behavior2]) => {
9602
+ setOperatorBehavior(id2.name, behavior2), behavior2?.error && children.push(behavior2.error);
9577
9603
  }), {
9578
9604
  id,
9579
9605
  children
@@ -10537,7 +10563,7 @@ ${js}`
10537
10563
  function InlineObjectPropertyDelimiter(ctx, state2) {
10538
10564
  return (0, import_lib2.$EVENT)(ctx, state2, "InlineObjectPropertyDelimiter", InlineObjectPropertyDelimiter$0);
10539
10565
  }
10540
- var ObjectPropertyDelimiter$0 = (0, import_lib2.$S)((0, import_lib2.$E)(_), Comma), ObjectPropertyDelimiter$1 = (0, import_lib2.$Y)((0, import_lib2.$S)(__, (0, import_lib2.$EXPECT)($L37, 'ObjectPropertyDelimiter "}"'))), ObjectPropertyDelimiter$2 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$Y)(EOS), InsertComma), function($skip, $loc, $0, $1, $2) {
10566
+ var ObjectPropertyDelimiter$0 = (0, import_lib2.$S)((0, import_lib2.$E)(_), Comma), ObjectPropertyDelimiter$1 = (0, import_lib2.$Y)((0, import_lib2.$S)(__, (0, import_lib2.$R$0)((0, import_lib2.$EXPECT)($R13, "ObjectPropertyDelimiter /[)\\]}]/")))), ObjectPropertyDelimiter$2 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$Y)(EOS), InsertComma), function($skip, $loc, $0, $1, $2) {
10541
10567
  return { ...$2, implicit: !0 };
10542
10568
  }), ObjectPropertyDelimiter$$ = [ObjectPropertyDelimiter$0, ObjectPropertyDelimiter$1, ObjectPropertyDelimiter$2];
10543
10569
  function ObjectPropertyDelimiter(ctx, state2) {
@@ -12444,7 +12470,7 @@ ${js}`
12444
12470
  var i = $1, behavior = $3, ws1 = $4, imports = $5, ws2 = $6, from = $7;
12445
12471
  let errors = [];
12446
12472
  return behavior?.error && errors.push(behavior.error), imports.specifiers.forEach((spec) => {
12447
- state.operators.set(spec.binding.name, spec.behavior ?? behavior), spec.behavior?.error && errors.push(spec.behavior.error);
12473
+ setOperatorBehavior(spec.binding.name, spec.behavior ?? behavior), spec.behavior?.error && errors.push(spec.behavior.error);
12448
12474
  }), {
12449
12475
  type: "ImportDeclaration",
12450
12476
  children: [i, ...errors, trimFirstSpace(ws1), imports, ws2, from],
@@ -12474,7 +12500,7 @@ ${js}`
12474
12500
  var from = $1, fws = $2, i = $3, iws = $4, behavior = $6, ows = $7, imports = $8;
12475
12501
  let errors = [];
12476
12502
  return behavior?.error && errors.push(behavior.error), imports.specifiers.forEach((spec) => {
12477
- state.operators.set(spec.binding.name, spec.behavior ?? behavior), spec.behavior?.error && errors.push(spec.behavior.error);
12503
+ setOperatorBehavior(spec.binding.name, spec.behavior ?? behavior), spec.behavior?.error && errors.push(spec.behavior.error);
12478
12504
  }), {
12479
12505
  type: "ImportDeclaration",
12480
12506
  children: [i, iws, ...errors, trimFirstSpace(ows), imports, fws, from],
@@ -12583,7 +12609,7 @@ ${js}`
12583
12609
  var ws = $1, spec = $3;
12584
12610
  if (spec.binding.type !== "Identifier")
12585
12611
  throw new Error("Expected identifier after `operator`");
12586
- return state.operators.set(spec.binding.name, spec.behavior), {
12612
+ return setOperatorBehavior(spec.binding.name, spec.behavior), {
12587
12613
  ...spec,
12588
12614
  children: [
12589
12615
  ws,
@@ -15520,6 +15546,7 @@ ${js}`
15520
15546
  break;
15521
15547
  case "globals":
15522
15548
  case "symbols":
15549
+ case "operators":
15523
15550
  value = value.split(",").filter(Boolean);
15524
15551
  break;
15525
15552
  }
@@ -15906,6 +15933,28 @@ ${js}`
15906
15933
  ])
15907
15934
  config[option] = b;
15908
15935
  }
15936
+ }), Object.defineProperty(config, "operators", {
15937
+ set(o) {
15938
+ if (o) {
15939
+ if (typeof o != "object")
15940
+ throw new Error("operators configuration must be an object or array");
15941
+ if (Array.isArray(o))
15942
+ o.forEach((name) => {
15943
+ if (typeof name != "string")
15944
+ throw new Error("operators configuration array must contain only strings");
15945
+ setOperatorBehavior(name, void 0);
15946
+ });
15947
+ else
15948
+ for (let [name, behavior] of Object.entries(o)) {
15949
+ if (typeof behavior == "string" && (behavior = behavior.trim(), behavior = behavior ? parse(behavior, {
15950
+ startRule: "OperatorBehavior",
15951
+ filename: `operator config for ${name}`
15952
+ }) : void 0), behavior && typeof behavior != "object")
15953
+ throw new Error("operators configuration object must have string or object values");
15954
+ setOperatorBehavior(name, behavior);
15955
+ }
15956
+ }
15957
+ }
15909
15958
  }), Object.assign(config, initialConfig);
15910
15959
  });
15911
15960
  function Reset(ctx, state2) {
@@ -16010,23 +16059,21 @@ ${js}`
16010
16059
  function PushExtraIndent1(ctx, state2) {
16011
16060
  return (0, import_lib2.$EVENT)(ctx, state2, "PushExtraIndent1", PushExtraIndent1$0);
16012
16061
  }
16013
- var parser = function() {
16014
- let { fail, validate, reset } = (0, import_lib2.Validator)(), ctx = { expectation: "", fail };
16015
- return {
16016
- parse: (input, options = {}) => {
16017
- if (typeof input != "string") throw new Error("Input must be a string");
16018
- let parser2 = options.startRule != null ? grammar[options.startRule] : Object.values(grammar)[0];
16019
- if (!parser2) throw new Error(`Could not find rule with name '${options.startRule}'`);
16020
- let filename2 = options.filename || "<anonymous>";
16021
- return reset(), Object.assign(ctx, { ...options.events, tokenize: options.tokenize }), validate(input, parser2(ctx, {
16022
- input,
16023
- pos: 0
16024
- }), {
16025
- filename: filename2
16026
- });
16027
- }
16028
- };
16029
- }();
16062
+ var parser = {
16063
+ parse: (input, options = {}) => {
16064
+ let { fail, validate, reset } = (0, import_lib2.Validator)(), ctx = { expectation: "", fail };
16065
+ if (typeof input != "string") throw new Error("Input must be a string");
16066
+ let parser2 = options.startRule != null ? grammar[options.startRule] : Object.values(grammar)[0];
16067
+ if (!parser2) throw new Error(`Could not find rule with name '${options.startRule}'`);
16068
+ let filename2 = options.filename || "<anonymous>";
16069
+ return reset(), Object.assign(ctx, { ...options.events, tokenize: options.tokenize }), validate(input, parser2(ctx, {
16070
+ input,
16071
+ pos: 0
16072
+ }), {
16073
+ filename: filename2
16074
+ });
16075
+ }
16076
+ };
16030
16077
  var { parse } = parser;
16031
16078
  var filename, initialConfig, config, sync, state = {
16032
16079
  // parser state
@@ -16096,6 +16143,10 @@ ${js}`
16096
16143
  }
16097
16144
  }
16098
16145
  });
16146
+ function setOperatorBehavior(name, behavior) {
16147
+ let existing = state.operators.get(name);
16148
+ existing && behavior ? state.operators.set(name, { ...existing, ...behavior }) : state.operators.set(name, behavior || existing);
16149
+ }
16099
16150
  function getStateKey() {
16100
16151
  return [state.currentIndent.level % 256 << 8 | state.classImplicitCallForbidden << 7 | state.indentedApplicationForbidden << 6 | state.bracedApplicationForbidden << 5 | state.trailingMemberPropertyForbidden << 4 | state.nestedBinaryOpForbidden << 3 | state.newlineBinaryOpForbidden << 2 | state.pipelineForbidden << 1 | // This is slightly different than the rest of the state,
16101
16152
  // since it is affected by the directive prologue and may be hit
@@ -16125,11 +16176,12 @@ ${js}`
16125
16176
  "unscopables"
16126
16177
  ];
16127
16178
 
16128
- // unplugin-civet:/home/daniel/apps/Civet/source/sourcemap.civet.jsx
16179
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\sourcemap.civet.jsx
16129
16180
  var sourcemap_civet_exports = {};
16130
16181
  __export(sourcemap_civet_exports, {
16131
16182
  SourceMap: () => SourceMap,
16132
16183
  base64Encode: () => base64Encode,
16184
+ decodeVLQ: () => decodeVLQ,
16133
16185
  locationTable: () => locationTable,
16134
16186
  lookupLineColumn: () => lookupLineColumn
16135
16187
  });
@@ -16152,11 +16204,10 @@ ${js}`
16152
16204
  // relative to previous entry
16153
16205
  srcLine;
16154
16206
  srcColumn;
16155
- srcOffset;
16156
16207
  srcTable;
16157
16208
  source;
16158
16209
  constructor(source1) {
16159
- this.source = source1, this.lines = [[]], this.line = 0, this.colOffset = 0, this.srcLine = 0, this.srcColumn = 0, this.srcOffset = 0, this.srcTable = locationTable(this.source);
16210
+ this.source = source1, this.lines = [[]], this.line = 0, this.colOffset = 0, this.srcLine = 0, this.srcColumn = 0, this.srcTable = locationTable(this.source);
16160
16211
  }
16161
16212
  renderMappings() {
16162
16213
  let lastSourceLine = 0, lastSourceColumn = 0;
@@ -16193,9 +16244,13 @@ ${js}`
16193
16244
  }
16194
16245
  };
16195
16246
  }
16247
+ /** Generate a comment with the source mapping URL. */
16248
+ comment(srcFileName, outFileName) {
16249
+ return `//# sourceMappingURL=data:application/json;base64,${base64Encode(JSON.stringify(this.json(srcFileName, outFileName)))}`;
16250
+ }
16196
16251
  updateSourceMap(outputStr, inputPos, colOffset = 0) {
16197
16252
  let outLines = outputStr.split(EOL2), srcLine, srcCol;
16198
- inputPos != null && ([srcLine, srcCol] = lookupLineColumn(this.srcTable, inputPos), srcCol += colOffset, this.srcLine = srcLine, this.srcColumn = srcCol, this.srcOffset = inputPos + outputStr.length);
16253
+ inputPos != null && ([srcLine, srcCol] = lookupLineColumn(this.srcTable, inputPos), srcCol += colOffset, this.srcLine = srcLine, this.srcColumn = srcCol);
16199
16254
  for (let i3 = 0, len22 = outLines.length; i3 < len22; i3++) {
16200
16255
  let i = i3, line = outLines[i3];
16201
16256
  i > 0 && (this.line++, this.srcLine++, this.colOffset = 0, this.lines[this.line] = [], this.srcColumn = srcCol = colOffset);
@@ -16203,17 +16258,24 @@ ${js}`
16203
16258
  this.colOffset = line.length, this.srcColumn += line.length, inputPos != null ? this.lines[this.line].push([l, 0, srcLine + i, srcCol]) : l != 0 && this.lines[this.line].push([l]);
16204
16259
  }
16205
16260
  }
16206
- }, smRegexp = /\n\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,([+a-zA-Z0-9\/]*=?=?)$/, remap = function(codeWithSourceMap, upstreamMap, sourcePath, targetPath) {
16207
- let sourceMapText, codeWithoutSourceMap = codeWithSourceMap.replace(smRegexp, (match, sm) => (sourceMapText = sm, ""));
16208
- if (sourceMapText) {
16209
- let parsed = parseWithLines(sourceMapText), composedLines = composeLines(upstreamMap.lines, parsed.lines);
16210
- upstreamMap.lines = composedLines;
16211
- }
16212
- let remappedSourceMapJSON = upstreamMap.json(sourcePath, targetPath), newSourceMap = `sourceMappingURL=data:application/json;charset=utf-8;base64,${base64Encode(JSON.stringify(remappedSourceMapJSON))}`;
16213
- return `${codeWithoutSourceMap}
16214
- //# ${newSourceMap}`;
16215
- }, composeLines = function(upstreamMapping, lines) {
16216
- return lines.map((line) => line.map((entry) => {
16261
+ /**
16262
+ Remap a string with compiled code and a source map to use a new source map
16263
+ referencing upstream source files.
16264
+ This modifies the upstream map in place.
16265
+ */
16266
+ static remap = (codeWithSourceMap, upstreamMap, sourcePath, targetPath) => {
16267
+ let sourceMapText, codeWithoutSourceMap = codeWithSourceMap.replace(smRegexp, (_match, sm) => (sourceMapText = sm, ""));
16268
+ if (sourceMapText) {
16269
+ let parsed = this.parseWithLines(sourceMapText), composedLines = this.composeLines(upstreamMap.lines, parsed.lines);
16270
+ upstreamMap.lines = composedLines;
16271
+ }
16272
+ return `${codeWithoutSourceMap}
16273
+ ${upstreamMap.comment(sourcePath, targetPath)}`;
16274
+ };
16275
+ /**
16276
+ Compose lines from an upstream source map with lines from a downstream source map.
16277
+ */
16278
+ static composeLines = (upstreamMapping, lines) => lines.map((line) => line.map((entry) => {
16217
16279
  if (entry.length === 1)
16218
16280
  return entry;
16219
16281
  let [colDelta, sourceFileIndex, srcLine, srcCol] = entry, srcPos = remapPosition([srcLine, srcCol], upstreamMapping);
@@ -16222,38 +16284,44 @@ ${js}`
16222
16284
  let [upstreamLine, upstreamCol] = srcPos;
16223
16285
  return entry.length === 4 ? [colDelta, sourceFileIndex, upstreamLine, upstreamCol] : [colDelta, sourceFileIndex, upstreamLine, upstreamCol, entry[4]];
16224
16286
  }));
16225
- }, parseWithLines = function(base64encodedJSONstr) {
16226
- let json = JSON.parse(Buffer.from(base64encodedJSONstr, "base64").toString("utf8")), sourceLine = 0, sourceColumn = 0, lines = json.mappings.split(";").map((line) => line.length === 0 ? [] : line.split(",").map((entry) => {
16227
- let result = decodeVLQ(entry);
16228
- switch (result.length) {
16229
- case 1:
16230
- return [result[0]];
16231
- case 4:
16232
- return [result[0], result[1], sourceLine += result[2], sourceColumn += result[3]];
16233
- case 5:
16234
- return [result[0], result[1], sourceLine += result[2], sourceColumn += result[3], result[4]];
16235
- default:
16236
- throw new Error("Unknown source map entry", result);
16237
- }
16238
- }));
16239
- return json.lines = lines, json;
16240
- };
16241
- Object.assign(SourceMap, { remap, parseWithLines, composeLines });
16287
+ /**
16288
+ Parse a base64 encoded source map string into a SourceMapJSON object with lines.
16289
+ */
16290
+ static parseWithLines = (base64encodedJSONstr) => {
16291
+ let json = JSON.parse(Buffer.from(base64encodedJSONstr, "base64").toString("utf8")), sourceLine = 0, sourceColumn = 0, lines = json.mappings.split(";").map((line) => line.length === 0 ? [] : line.split(",").map((entry) => {
16292
+ let result = decodeVLQ(entry);
16293
+ switch (result.length) {
16294
+ case 1:
16295
+ break;
16296
+ case 4:
16297
+ case 5: {
16298
+ sourceLine += result[2], result[2] = sourceLine, sourceColumn += result[3], result[3] = sourceColumn;
16299
+ break;
16300
+ }
16301
+ default:
16302
+ throw new Error(`Unknown source map entry ${JSON.stringify(result)}`);
16303
+ }
16304
+ return result;
16305
+ }));
16306
+ return { ...json, lines };
16307
+ };
16308
+ }, smRegexp = /(?:\r?\n|\r)\/\/# sourceMappingURL=data:application\/json;(?:charset=[^;]*;)?base64,([+a-zA-Z0-9\/]*=?=?)(?:\s*)$/;
16242
16309
  var VLQ_SHIFT = 5, VLQ_CONTINUATION_BIT = 1 << VLQ_SHIFT, VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - 1, encodeVlq = function(value) {
16243
16310
  let answer = "", ref2;
16244
16311
  value < 0 ? ref2 = 1 : ref2 = 0;
16245
16312
  let signBit = ref2, valueToEncode = (Math.abs(value) << 1) + signBit;
16246
16313
  for (; valueToEncode || !answer; ) {
16247
16314
  let nextChunk = valueToEncode & VLQ_VALUE_MASK;
16248
- valueToEncode = valueToEncode >> VLQ_SHIFT, valueToEncode && (nextChunk |= VLQ_CONTINUATION_BIT), answer += encodeBase64(nextChunk);
16315
+ valueToEncode = valueToEncode >> VLQ_SHIFT, valueToEncode && (nextChunk |= VLQ_CONTINUATION_BIT), answer += BASE64_CHARS[nextChunk];
16249
16316
  }
16250
16317
  return answer;
16251
- }, BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", encodeBase64 = function(value) {
16252
- return BASE64_CHARS[value] || (() => {
16253
- throw new Error("Cannot Base64 encode value: ${value}");
16254
- })();
16255
- }, base64Encode = function(src) {
16256
- return typeof Buffer < "u" ? Buffer.from(src).toString("base64") : btoa(src);
16318
+ }, BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", base64Encode = function(src) {
16319
+ if (typeof Buffer < "u")
16320
+ return Buffer.from(src).toString("base64");
16321
+ {
16322
+ let bytes = new TextEncoder().encode(src), binaryString = String.fromCodePoint(...bytes);
16323
+ return btoa(binaryString);
16324
+ }
16257
16325
  }, vlqTable = new Uint8Array(128), vlqChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
16258
16326
  {
16259
16327
  let i = 0, l = vlqTable.length;
@@ -16264,22 +16332,22 @@ ${js}`
16264
16332
  }
16265
16333
  var decodeError = function(message) {
16266
16334
  throw new Error(message);
16267
- }, decodeVLQ = function(mapping) {
16335
+ }, decodeVLQ = (mapping) => {
16268
16336
  let i = 0, l = mapping.length, result = [];
16269
16337
  for (; i < l; ) {
16270
16338
  let shift = 0, vlq = 0, v = 0;
16271
16339
  for (; ; ) {
16272
16340
  i >= l && decodeError("Unexpected early end of mapping data");
16273
16341
  let c = mapping.charCodeAt(i);
16274
- (c & 127) != c && decodeError("Invalid mapping character: ${JSON.stringify(String.fromCharCode(c))}");
16342
+ (c & 127) != c && decodeError(`Invalid mapping character: ${JSON.stringify(String.fromCharCode(c))}`);
16275
16343
  let index = vlqTable[c & 127];
16276
- if (index === 255 && decodeError("Invalid mapping character: ${JSON.stringify(String.fromCharCode(c))}"), i++, vlq |= (index & 31) << shift, shift += 5, !(index & 32))
16344
+ if (index === 255 && decodeError(`Invalid mapping character: ${JSON.stringify(String.fromCharCode(c))}`), i++, vlq |= (index & 31) << shift, shift += 5, !(index & 32))
16277
16345
  break;
16278
16346
  }
16279
16347
  vlq & 1 ? v = -(vlq >> 1) : v = vlq >> 1, result.push(v);
16280
16348
  }
16281
16349
  return result;
16282
- }, remapPosition = function(position, sourcemapLines) {
16350
+ }, remapPosition = (position, sourcemapLines) => {
16283
16351
  let [line, character] = position, textLine = sourcemapLines[line];
16284
16352
  if (!textLine?.length)
16285
16353
  return;
@@ -16294,7 +16362,7 @@ ${js}`
16294
16362
  return [lastMapping[2], lastMapping[3]];
16295
16363
  };
16296
16364
 
16297
- // unplugin-civet:/home/daniel/apps/Civet/source/state-cache.civet.jsx
16365
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\state-cache.civet.jsx
16298
16366
  var StateCache = class {
16299
16367
  cache = /* @__PURE__ */ new Map();
16300
16368
  get(key) {
@@ -16317,7 +16385,7 @@ ${js}`
16317
16385
  }
16318
16386
  };
16319
16387
 
16320
- // unplugin-civet:/home/daniel/apps/Civet/source/main.civet.jsx
16388
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\main.civet.jsx
16321
16389
  var { SourceMap: SourceMap2 } = sourcemap_civet_exports;
16322
16390
  var ParseErrors = class extends Error {
16323
16391
  name = "ParseErrors";
@@ -16375,8 +16443,24 @@ ${js}`
16375
16443
  "RestoreNewlineBinaryOp",
16376
16444
  "RestorePipeline"
16377
16445
  ]);
16446
+ function decode(src) {
16447
+ if (typeof src == "string" || typeof Buffer > "u" || !Buffer?.isBuffer(src))
16448
+ return src;
16449
+ if (src[0] === 239 && src[1] === 187 && src[2] === 191)
16450
+ return src.toString("utf8", 3);
16451
+ if (src[0] === 255 && src[1] === 254)
16452
+ return src.toString("utf16le", 2);
16453
+ if (src[0] === 254 && src[1] === 255) {
16454
+ for (let end = src.length - 2, i1 = 2; i1 <= end; i1 += 2) {
16455
+ let i = i1;
16456
+ [src[i], src[i + 1]] = [src[i + 1], src[i]];
16457
+ }
16458
+ return src.toString("utf16le", 2);
16459
+ } else
16460
+ return src.toString("utf8");
16461
+ }
16378
16462
  function compile(src, options) {
16379
- options ? options = { ...options } : options = {}, options.parseOptions = { ...options.parseOptions };
16463
+ src = decode(src), options ? options = { ...options } : options = {}, options.parseOptions = { ...options.parseOptions };
16380
16464
  let filename2 = options.filename || "unknown";
16381
16465
  filename2.endsWith(".coffee") && !/^(#![^\r\n]*(\r\n|\n|\r))?\s*['"]civet/.test(src) && (options.parseOptions.coffeeCompat = !0);
16382
16466
  let { hits, trace, noCache } = options, events;
@@ -16424,7 +16508,8 @@ ${counts}`;
16424
16508
  if (options.sourceMap || options.inlineMap) {
16425
16509
  options.sourceMap = new SourceMap2(src);
16426
16510
  let code = generate_civet_default(ast2, options);
16427
- return checkErrors(), options.inlineMap ? SourceMap2.remap(code, options.sourceMap, filename2, filename2 + ".tsx") : {
16511
+ return checkErrors(), options.inlineMap ? `${code}
16512
+ ${options.sourceMap.comment(filename2, filename2 + ".tsx")}` : {
16428
16513
  code,
16429
16514
  sourceMap: options.sourceMap
16430
16515
  };
@@ -16467,7 +16552,7 @@ ${counts}`;
16467
16552
  return err instanceof import_lib2.ParseError || err instanceof ParseErrors;
16468
16553
  };
16469
16554
 
16470
- // unplugin-civet:/home/daniel/apps/Civet/source/browser.civet.jsx
16555
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\browser.civet.jsx
16471
16556
  async function runScripts(type = "text/civet") {
16472
16557
  let scripts = window.document.querySelectorAll(`script[type=${JSON.stringify(type)}]`);
16473
16558
  for (let i1 = 0, len3 = scripts.length; i1 < len3; i1++) {