intelligent-system-design-language 0.4.0 → 0.4.1

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.
Files changed (35) hide show
  1. package/out/cli/cli-util.js +9 -3
  2. package/out/cli/cli-util.js.map +1 -1
  3. package/out/cli/components/derived-data-generator.js +23 -8
  4. package/out/cli/components/derived-data-generator.js.map +1 -1
  5. package/out/cli/components/dev-module-generator.js +399 -0
  6. package/out/cli/components/dev-module-generator.js.map +1 -0
  7. package/out/cli/components/method-generator.js +83 -36
  8. package/out/cli/components/method-generator.js.map +1 -1
  9. package/out/cli/components/vue/base-components/vue-string-choices.js +11 -4
  10. package/out/cli/components/vue/base-components/vue-string-choices.js.map +1 -1
  11. package/out/cli/generator.js +46 -42
  12. package/out/cli/generator.js.map +1 -1
  13. package/out/extension/main.cjs +710 -560
  14. package/out/extension/main.cjs.map +4 -4
  15. package/out/extension/main.js +2 -2
  16. package/out/extension/main.js.map +1 -1
  17. package/out/extension/package.json +1 -1
  18. package/out/language/generated/ast.js +13 -4
  19. package/out/language/generated/ast.js.map +1 -1
  20. package/out/language/generated/grammar.js +106 -32
  21. package/out/language/generated/grammar.js.map +1 -1
  22. package/out/language/intelligent-system-design-language-module.js +3 -1
  23. package/out/language/intelligent-system-design-language-module.js.map +1 -1
  24. package/out/language/intelligent-system-design-language-validator.js +20 -7
  25. package/out/language/intelligent-system-design-language-validator.js.map +1 -1
  26. package/out/language/isdl-completion-provider.js +32 -0
  27. package/out/language/isdl-completion-provider.js.map +1 -0
  28. package/out/language/isdl-docs.js +106 -0
  29. package/out/language/isdl-docs.js.map +1 -0
  30. package/out/language/isdl-hover-provider.js +4 -54
  31. package/out/language/isdl-hover-provider.js.map +1 -1
  32. package/out/language/main.cjs +633 -483
  33. package/out/language/main.cjs.map +4 -4
  34. package/out/package.json +1 -1
  35. package/package.json +1 -1
@@ -66,6 +66,10 @@ export function translateDiceParts(expression, noLabels = false) {
66
66
  `;
67
67
  }
68
68
  if (isParentAccess(expression)) {
69
+ if (expression.nameAccess) {
70
+ const suffix = noLabels ? "" : "[Name]";
71
+ return expandToNode `"@name${suffix}"`;
72
+ }
69
73
  let path = (_j = (_h = (_g = expression.property) === null || _g === void 0 ? void 0 : _g.ref) === null || _h === void 0 ? void 0 : _h.name) !== null && _j !== void 0 ? _j : "";
70
74
  let label = humanize((_m = (_l = (_k = expression.property) === null || _k === void 0 ? void 0 : _k.ref) === null || _l === void 0 ? void 0 : _l.name) !== null && _m !== void 0 ? _m : "");
71
75
  const document = getParentDocument(expression);
@@ -92,6 +96,10 @@ export function translateDiceParts(expression, noLabels = false) {
92
96
  `;
93
97
  }
94
98
  if (isTargetAccess(expression)) {
99
+ if (expression.nameAccess) {
100
+ const suffix = noLabels ? "" : "[Name]";
101
+ return expandToNode `"@name${suffix}"`;
102
+ }
95
103
  let path = (_w = (_v = (_u = expression.property) === null || _u === void 0 ? void 0 : _u.ref) === null || _v === void 0 ? void 0 : _v.name) !== null && _w !== void 0 ? _w : "";
96
104
  let label = humanize((_z = (_y = (_x = expression.property) === null || _x === void 0 ? void 0 : _x.ref) === null || _y === void 0 ? void 0 : _y.name) !== null && _z !== void 0 ? _z : "");
97
105
  const document = getTargetDocument(expression);
@@ -222,9 +230,13 @@ function translateDisplayFormula(expression) {
222
230
  return label.trim();
223
231
  }
224
232
  if (isParentAccess(expression)) {
233
+ if (expression.nameAccess)
234
+ return "Name";
225
235
  return humanize((_m = (_l = (_k = expression.property) === null || _k === void 0 ? void 0 : _k.ref) === null || _l === void 0 ? void 0 : _l.name) !== null && _m !== void 0 ? _m : "");
226
236
  }
227
237
  if (isTargetAccess(expression)) {
238
+ if (expression.nameAccess)
239
+ return "Name";
228
240
  return humanize((_q = (_p = (_o = expression.property) === null || _o === void 0 ? void 0 : _o.ref) === null || _p === void 0 ? void 0 : _p.name) !== null && _q !== void 0 ? _q : "");
229
241
  }
230
242
  if (isFleetingAccess(expression)) {
@@ -236,6 +248,11 @@ export function translateDiceData(expression, entry, id, preDerived, generatingP
236
248
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61;
237
249
  console.log("Translating Dice Data: ", expression.$type);
238
250
  if (isParentAccess(expression)) {
251
+ if (expression.nameAccess) {
252
+ return expandToNode `
253
+ "name": context.object.parent?.name
254
+ `;
255
+ }
239
256
  let path = "context.object.parent.system";
240
257
  let label = (_c = (_b = (_a = expression.property) === null || _a === void 0 ? void 0 : _a.ref) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : "";
241
258
  console.log("Parent Access:", (_e = (_d = expression.property) === null || _d === void 0 ? void 0 : _d.ref) === null || _e === void 0 ? void 0 : _e.name);
@@ -257,6 +274,11 @@ export function translateDiceData(expression, entry, id, preDerived, generatingP
257
274
  `;
258
275
  }
259
276
  if (isTargetAccess(expression)) {
277
+ if (expression.nameAccess) {
278
+ return expandToNode `
279
+ "name": context.target?.name
280
+ `;
281
+ }
260
282
  let path = "context.target.system";
261
283
  let label = (_q = (_p = (_o = expression.property) === null || _o === void 0 ? void 0 : _o.ref) === null || _p === void 0 ? void 0 : _p.name) !== null && _q !== void 0 ? _q : "";
262
284
  console.log("Target Access:", (_s = (_r = expression.property) === null || _r === void 0 ? void 0 : _r.ref) === null || _s === void 0 ? void 0 : _s.name);
@@ -491,7 +513,7 @@ export function translateDiceData(expression, entry, id, preDerived, generatingP
491
513
  return undefined;
492
514
  }
493
515
  export function translateExpression(entry, id, expression, preDerived = false, generatingProperty = undefined) {
494
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
516
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
495
517
  function humanize(string) {
496
518
  if (string == undefined) {
497
519
  return "";
@@ -823,11 +845,30 @@ export function translateExpression(entry, id, expression, preDerived = false, g
823
845
  throw new Error("Reference expression has no reference");
824
846
  }
825
847
  console.log("Translating Reference Expression: " + accessPath);
826
- // Check if we are in an each loop
827
- const eachExp = AstUtils.getContainerOfType(expression.$container, isEach);
828
- if (eachExp != undefined) {
829
- if (isAccess(eachExp.collection) || isParentAccess(eachExp.collection) || isTargetAccess(eachExp.collection)) {
830
- accessPath = `${accessPath}.system`;
848
+ // If this reference resolves to an `each` loop variable, the loop iterates over a
849
+ // collection of Foundry Documents (embedded items). Custom fields on a Document live
850
+ // under `.system` (e.g. `sk.Expertise` -> `sk.system.expertise`), so member access on
851
+ // the loop variable needs the `.system` hop. Built-in Document props like `.name` are
852
+ // handled separately below and must NOT get `.system`.
853
+ //
854
+ // Only the loop VARIABLE itself gets this treatment. Function/method parameters and
855
+ // other locals that merely appear inside the loop body (e.g. `SkillName`, `Expt`) are
856
+ // plain JS values and must be referenced by their bare name -- appending `.system` to a
857
+ // string param produced `SkillName.system` (undefined at runtime). See bug #123.
858
+ //
859
+ // Walk every enclosing `each` (not just the innermost) so a reference to an outer loop
860
+ // variable from within a nested loop still resolves correctly.
861
+ const refTarget0 = expression.val.ref;
862
+ if (isParameter(refTarget0)) {
863
+ let eachAncestor = AstUtils.getContainerOfType(expression.$container, isEach);
864
+ while (eachAncestor != undefined) {
865
+ if (eachAncestor.var === refTarget0) {
866
+ if (isAccess(eachAncestor.collection) || isParentAccess(eachAncestor.collection) || isTargetAccess(eachAncestor.collection)) {
867
+ accessPath = `${accessPath}.system`;
868
+ }
869
+ break;
870
+ }
871
+ eachAncestor = AstUtils.getContainerOfType(eachAncestor.$container, isEach);
831
872
  }
832
873
  }
833
874
  const refTargetIsRoll = isVariableExpression(expression.val.ref) && isRoll(expression.val.ref.value);
@@ -1173,14 +1214,12 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1173
1214
  }
1174
1215
  if (isParentAccess(expression)) {
1175
1216
  let path = "context.object.parent";
1176
- // .name is a top-level Foundry document property, not a system field.
1177
- // If the ref is unresolved but the raw text is "name"/"Name", emit it directly.
1178
- if (!((_a = expression.property) === null || _a === void 0 ? void 0 : _a.ref) && ((_c = (_b = expression.property) === null || _b === void 0 ? void 0 : _b.$refText) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === "name") {
1217
+ if (expression.nameAccess) {
1179
1218
  return expandToNode `
1180
- ${path}?.name ?? 0
1219
+ ${path}?.name
1181
1220
  `;
1182
1221
  }
1183
- let systemPath = getSystemPath((_d = expression.property) === null || _d === void 0 ? void 0 : _d.ref, expression.subProperties, expression, true);
1222
+ let systemPath = getSystemPath((_a = expression.property) === null || _a === void 0 ? void 0 : _a.ref, expression.subProperties, expression, true);
1184
1223
  path = `${path}?.${systemPath}`;
1185
1224
  console.log("Translating Parent Access Expression: ", path);
1186
1225
  return expandToNode `
@@ -1189,14 +1228,12 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1189
1228
  }
1190
1229
  if (isTargetAccess(expression)) {
1191
1230
  let path = "context.target";
1192
- // .name is a top-level Foundry document property, not a system field.
1193
- // If the ref is unresolved but the raw text is "name"/"Name", emit it directly.
1194
- if (!((_e = expression.property) === null || _e === void 0 ? void 0 : _e.ref) && ((_g = (_f = expression.property) === null || _f === void 0 ? void 0 : _f.$refText) === null || _g === void 0 ? void 0 : _g.toLowerCase()) === "name") {
1231
+ if (expression.nameAccess) {
1195
1232
  return expandToNode `
1196
1233
  ${path}?.name
1197
1234
  `;
1198
1235
  }
1199
- let systemPath = getSystemPath((_h = expression.property) === null || _h === void 0 ? void 0 : _h.ref, expression.subProperties, undefined, true);
1236
+ let systemPath = getSystemPath((_b = expression.property) === null || _b === void 0 ? void 0 : _b.ref, expression.subProperties, undefined, true);
1200
1237
  path = `${path}?.${systemPath}`;
1201
1238
  console.log("Translating Target Access Expression: ", path);
1202
1239
  return expandToNode `
@@ -1204,7 +1241,7 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1204
1241
  `;
1205
1242
  }
1206
1243
  if (isItemAccess(expression)) {
1207
- const itemPropName = (_j = expression.property) === null || _j === void 0 ? void 0 : _j.toLowerCase();
1244
+ const itemPropName = (_c = expression.property) === null || _c === void 0 ? void 0 : _c.toLowerCase();
1208
1245
  let path = `item.system.${itemPropName}`;
1209
1246
  if (expression.subProperty != undefined) {
1210
1247
  path = `${path}.${expression.subProperty}`;
@@ -1213,8 +1250,8 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1213
1250
  // `item.X` inside a where: clause iterates over the container's referenced document.
1214
1251
  // Choice fields are stored as {value,...} objects, so resolve the field and compare by
1215
1252
  // its .value rather than the whole object (e.g. `where: item.Type equals "Armor"`).
1216
- const whereContainer = (_m = (_l = (_k = AstUtils.getContainerOfType(expression, isTableField)) !== null && _k !== void 0 ? _k : AstUtils.getContainerOfType(expression, isDocumentChoiceExp)) !== null && _l !== void 0 ? _l : AstUtils.getContainerOfType(expression, isDocumentChoicesExp)) !== null && _m !== void 0 ? _m : AstUtils.getContainerOfType(expression, isInventoryField);
1217
- const refDoc = ((_q = (_p = (_o = whereContainer === null || whereContainer === void 0 ? void 0 : whereContainer.documents) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.ref) !== null && _q !== void 0 ? _q : (_r = whereContainer === null || whereContainer === void 0 ? void 0 : whereContainer.document) === null || _r === void 0 ? void 0 : _r.ref);
1253
+ const whereContainer = (_f = (_e = (_d = AstUtils.getContainerOfType(expression, isTableField)) !== null && _d !== void 0 ? _d : AstUtils.getContainerOfType(expression, isDocumentChoiceExp)) !== null && _e !== void 0 ? _e : AstUtils.getContainerOfType(expression, isDocumentChoicesExp)) !== null && _f !== void 0 ? _f : AstUtils.getContainerOfType(expression, isInventoryField);
1254
+ const refDoc = ((_j = (_h = (_g = whereContainer === null || whereContainer === void 0 ? void 0 : whereContainer.documents) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.ref) !== null && _j !== void 0 ? _j : (_k = whereContainer === null || whereContainer === void 0 ? void 0 : whereContainer.document) === null || _k === void 0 ? void 0 : _k.ref);
1218
1255
  if (refDoc) {
1219
1256
  const prop = AstUtils.streamAllContents(refDoc).find(n => isProperty(n) && n.name.toLowerCase() === itemPropName);
1220
1257
  if (prop && (isStringChoiceField(prop) || isDamageTypeChoiceField(prop))) {
@@ -1236,7 +1273,7 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1236
1273
  return translateComparisonExpression(expression);
1237
1274
  }
1238
1275
  if (isRollResultAccess(expression)) {
1239
- const target = (_s = expression.variable.ref) === null || _s === void 0 ? void 0 : _s.name;
1276
+ const target = (_l = expression.variable.ref) === null || _l === void 0 ? void 0 : _l.name;
1240
1277
  const jsMethod = expression.method === "count" ? "countDice"
1241
1278
  : expression.method === "contains" ? "containsDie"
1242
1279
  : expression.method;
@@ -1247,18 +1284,18 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1247
1284
  return expandToNode `${target}.${jsMethod}(${argJs})`;
1248
1285
  }
1249
1286
  if (isFleetingAccess(expression)) {
1250
- let accessPath = (_t = expression.variable.ref) === null || _t === void 0 ? void 0 : _t.name;
1287
+ let accessPath = (_m = expression.variable.ref) === null || _m === void 0 ? void 0 : _m.name;
1251
1288
  if (expression.subProperty != undefined) {
1252
1289
  // Foundry's Roll#dice returns DiceTerms; remap r.dice to the face-value getter.
1253
- const isRollDice = (isRoll((_u = expression.variable.ref) === null || _u === void 0 ? void 0 : _u.value) || isDamageRoll((_v = expression.variable.ref) === null || _v === void 0 ? void 0 : _v.value))
1290
+ const isRollDice = (isRoll((_o = expression.variable.ref) === null || _o === void 0 ? void 0 : _o.value) || isDamageRoll((_p = expression.variable.ref) === null || _p === void 0 ? void 0 : _p.value))
1254
1291
  && expression.subProperty.toLowerCase() === "dice";
1255
1292
  accessPath = `${accessPath}.${isRollDice ? "diceFaces" : fleetingSubProperty(expression)}`;
1256
1293
  }
1257
1294
  else if (expression.arrayAccess != undefined) {
1258
- const indexStr = (_x = (_w = toString(translateExpression(entry, id, expression.arrayAccess, preDerived, generatingProperty))) === null || _w === void 0 ? void 0 : _w.trim()) !== null && _x !== void 0 ? _x : '';
1295
+ const indexStr = (_r = (_q = toString(translateExpression(entry, id, expression.arrayAccess, preDerived, generatingProperty))) === null || _q === void 0 ? void 0 : _q.trim()) !== null && _r !== void 0 ? _r : '';
1259
1296
  accessPath = `${accessPath}[${indexStr}]`;
1260
1297
  }
1261
- else if (isRoll((_y = expression.variable.ref) === null || _y === void 0 ? void 0 : _y.value) || isDamageRoll((_z = expression.variable.ref) === null || _z === void 0 ? void 0 : _z.value)) {
1298
+ else if (isRoll((_s = expression.variable.ref) === null || _s === void 0 ? void 0 : _s.value) || isDamageRoll((_t = expression.variable.ref) === null || _t === void 0 ? void 0 : _t.value)) {
1262
1299
  // A bare reference to a roll variable used in a general expression
1263
1300
  // (comparison, arithmetic, assignment, return, function arg) should
1264
1301
  // use the roll's numeric total rather than the Roll object itself.
@@ -1367,15 +1404,25 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1367
1404
  `;
1368
1405
  }
1369
1406
  if (isParentAccess(expression)) {
1370
- let systemPath = getSystemPath((_3 = expression.property) === null || _3 === void 0 ? void 0 : _3.ref, expression.subProperties, undefined, true);
1371
1407
  const wide = expression.type == "wide" ? true : false;
1408
+ if (expression.nameAccess) {
1409
+ return expandToNode `
1410
+ { isRoll: false, label: "Name", value: context.object.parent?.name, wide: ${wide}, hasValue: context.object.parent?.name != "" },
1411
+ `;
1412
+ }
1413
+ let systemPath = getSystemPath((_3 = expression.property) === null || _3 === void 0 ? void 0 : _3.ref, expression.subProperties, undefined, true);
1372
1414
  return expandToNode `
1373
1415
  { isRoll: false, label: "${humanize((_6 = (_5 = (_4 = expression.property) === null || _4 === void 0 ? void 0 : _4.ref) === null || _5 === void 0 ? void 0 : _5.name) !== null && _6 !== void 0 ? _6 : "")}", value: context.object.parent?.${systemPath}, wide: ${wide}, hasValue: context.object.parent?.${systemPath} != "" },
1374
1416
  `;
1375
1417
  }
1376
1418
  if (isTargetAccess(expression)) {
1377
- let systemPath = getSystemPath((_7 = expression.property) === null || _7 === void 0 ? void 0 : _7.ref, expression.subProperties, undefined, true);
1378
1419
  const wide = expression.type == "wide" ? true : false;
1420
+ if (expression.nameAccess) {
1421
+ return expandToNode `
1422
+ { isRoll: false, label: "Name", value: context.target?.name, wide: ${wide}, hasValue: context.target?.name != "" },
1423
+ `;
1424
+ }
1425
+ let systemPath = getSystemPath((_7 = expression.property) === null || _7 === void 0 ? void 0 : _7.ref, expression.subProperties, undefined, true);
1379
1426
  return expandToNode `
1380
1427
  { isRoll: false, label: "${humanize((_10 = (_9 = (_8 = expression.property) === null || _8 === void 0 ? void 0 : _8.ref) === null || _9 === void 0 ? void 0 : _9.name) !== null && _10 !== void 0 ? _10 : "")}", value: context.target?.${systemPath}, wide: ${wide}, hasValue: context.target?.${systemPath} != "" },
1381
1428
  `;
@@ -1451,11 +1498,11 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1451
1498
  const typeParam = expression.params.find(isTypeParam);
1452
1499
  let damageTypeDataAccess = '';
1453
1500
  if (isAccess(typeParam.value)) {
1454
- damageTypeDataAccess = `context.object.system.${(_2 = (_1 = (_0 = typeParam.value) === null || _0 === void 0 ? void 0 : _0.property) === null || _1 === void 0 ? void 0 : _1.ref) === null || _2 === void 0 ? void 0 : _2.name.toLowerCase()}`;
1501
+ damageTypeDataAccess = `context.object.system.${(_w = (_v = (_u = typeParam.value) === null || _u === void 0 ? void 0 : _u.property) === null || _v === void 0 ? void 0 : _v.ref) === null || _w === void 0 ? void 0 : _w.name.toLowerCase()}`;
1455
1502
  }
1456
1503
  else if (isParentAccess(typeParam.value)) {
1457
1504
  // Handle parent.SomeDamageType
1458
- const parentPath = (_6 = (_5 = (_4 = (_3 = typeParam.value.property) === null || _3 === void 0 ? void 0 : _3.ref) === null || _4 === void 0 ? void 0 : _4.name) === null || _5 === void 0 ? void 0 : _5.toLowerCase()) !== null && _6 !== void 0 ? _6 : '';
1505
+ const parentPath = (_0 = (_z = (_y = (_x = typeParam.value.property) === null || _x === void 0 ? void 0 : _x.ref) === null || _y === void 0 ? void 0 : _y.name) === null || _z === void 0 ? void 0 : _z.toLowerCase()) !== null && _0 !== void 0 ? _0 : '';
1459
1506
  damageTypeDataAccess = `context.object.parent?.system.${parentPath}`;
1460
1507
  }
1461
1508
  return expandToNode `
@@ -1547,12 +1594,12 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1547
1594
  })) {
1548
1595
  if (isParentAccess(expression.collection)) {
1549
1596
  updateExpression = expandToNode `
1550
- parentEmbeddedUpdate["${getSystemPath((_7 = expression.collection.property) === null || _7 === void 0 ? void 0 : _7.ref, [], undefined, false)}"] = ${collection};
1597
+ parentEmbeddedUpdate["${getSystemPath((_1 = expression.collection.property) === null || _1 === void 0 ? void 0 : _1.ref, [], undefined, false)}"] = ${collection};
1551
1598
  `;
1552
1599
  }
1553
1600
  else if (isTargetAccess(expression.collection)) {
1554
1601
  updateExpression = expandToNode `
1555
- targetEmbeddedUpdate["${getSystemPath((_8 = expression.collection.property) === null || _8 === void 0 ? void 0 : _8.ref, [], undefined, false)}"] = ${collection};
1602
+ targetEmbeddedUpdate["${getSystemPath((_2 = expression.collection.property) === null || _2 === void 0 ? void 0 : _2.ref, [], undefined, false)}"] = ${collection};
1556
1603
  `;
1557
1604
  }
1558
1605
  else {
@@ -1570,9 +1617,9 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1570
1617
  }
1571
1618
  if (isPrompt(expression)) {
1572
1619
  const labelParam = expression.params.find(x => isLabelParam(x));
1573
- const title = (_9 = labelParam === null || labelParam === void 0 ? void 0 : labelParam.value) !== null && _9 !== void 0 ? _9 : "Prompt";
1620
+ const title = (_3 = labelParam === null || labelParam === void 0 ? void 0 : labelParam.value) !== null && _3 !== void 0 ? _3 : "Prompt";
1574
1621
  const targetParam = expression.params.find(x => isTargetParam(x));
1575
- const target = (_10 = targetParam === null || targetParam === void 0 ? void 0 : targetParam.value) !== null && _10 !== void 0 ? _10 : "self";
1622
+ const target = (_4 = targetParam === null || targetParam === void 0 ? void 0 : targetParam.value) !== null && _4 !== void 0 ? _4 : "self";
1576
1623
  // Registry key for the generated Vue prompt app (game.system.prompts.<doc><container><variable>).
1577
1624
  // The container is the enclosing `action` OR `function` -- prompts work inside either.
1578
1625
  const promptContainer = getPromptContainer(expression);
@@ -1591,7 +1638,7 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1591
1638
  if (timeLimitParam != undefined) {
1592
1639
  let durationMod = "";
1593
1640
  const duration = translateExpression(entry, id, timeLimitParam.value, preDerived, generatingProperty);
1594
- let units = (_11 = timeLimitParam.unit) !== null && _11 !== void 0 ? _11 : "ms";
1641
+ let units = (_5 = timeLimitParam.unit) !== null && _5 !== void 0 ? _5 : "ms";
1595
1642
  if (units === "seconds") {
1596
1643
  durationMod = ` * 1000`;
1597
1644
  }
@@ -1761,7 +1808,7 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1761
1808
  }
1762
1809
  if (isUpdate(expression)) {
1763
1810
  console.log("Translating Update Expression:");
1764
- let systemPath = getSystemPath((_12 = expression.property) === null || _12 === void 0 ? void 0 : _12.ref, expression.subProperties, (_13 = expression.propertyLookup) === null || _13 === void 0 ? void 0 : _13.ref, false);
1811
+ let systemPath = getSystemPath((_6 = expression.property) === null || _6 === void 0 ? void 0 : _6.ref, expression.subProperties, (_7 = expression.propertyLookup) === null || _7 === void 0 ? void 0 : _7.ref, false);
1765
1812
  if (isUpdateParent(expression)) {
1766
1813
  return expandToNode `
1767
1814
  parentUpdate["${systemPath}"] = foundry.utils.getProperty(context.object.parent, "system.${systemPath}");
@@ -1791,7 +1838,7 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1791
1838
  // in-scope `system` and no update/await — derived values run synchronously and must be pure.
1792
1839
  if (preDerived) {
1793
1840
  return expandToNode `
1794
- function_${(_14 = expression.method.ref) === null || _14 === void 0 ? void 0 : _14.name}(system${expression.params.length ? ", " : ""}${args})
1841
+ function_${(_8 = expression.method.ref) === null || _8 === void 0 ? void 0 : _8.name}(system${expression.params.length ? ", " : ""}${args})
1795
1842
  `;
1796
1843
  }
1797
1844
  let accessPath = "this";
@@ -1799,7 +1846,7 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1799
1846
  accessPath = "document.sheet";
1800
1847
  }
1801
1848
  return expandToNode `
1802
- await ${accessPath}.function_${(_15 = expression.method.ref) === null || _15 === void 0 ? void 0 : _15.name}(context, update, embeddedUpdate, parentUpdate, parentEmbeddedUpdate, targetUpdate, targetEmbeddedUpdate, ${args})
1849
+ await ${accessPath}.function_${(_9 = expression.method.ref) === null || _9 === void 0 ? void 0 : _9.name}(context, update, embeddedUpdate, parentUpdate, parentEmbeddedUpdate, targetUpdate, targetEmbeddedUpdate, ${args})
1803
1850
  `;
1804
1851
  }
1805
1852
  if (isParentFunctionCall(expression)) {
@@ -1848,7 +1895,7 @@ export function translateExpression(entry, id, expression, preDerived = false, g
1848
1895
  if (!fileParam)
1849
1896
  return undefined;
1850
1897
  const volumeParam = expression.params.find(x => isPlayAudioVolume(x));
1851
- const volume = (_16 = volumeParam === null || volumeParam === void 0 ? void 0 : volumeParam.value) !== null && _16 !== void 0 ? _16 : 0.5;
1898
+ const volume = (_10 = volumeParam === null || volumeParam === void 0 ? void 0 : volumeParam.value) !== null && _10 !== void 0 ? _10 : 0.5;
1852
1899
  return expandToNode `
1853
1900
  await game.system.utils.playSfx(${translateExpression(entry, id, fileParam.value, false, generatingProperty)}, ${translateExpression(entry, id, volume, false, generatingProperty)});
1854
1901
  `;