@neocompose/cli 0.24.0 → 0.24.2

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/neo.mjs CHANGED
@@ -685,12 +685,13 @@ var init_args = __esm({
685
685
  }
686
686
  });
687
687
 
688
- // ../node_modules/ignore/index.js
688
+ // node_modules/ignore/index.js
689
689
  var require_ignore = __commonJS({
690
- "../node_modules/ignore/index.js"(exports, module) {
690
+ "node_modules/ignore/index.js"(exports, module) {
691
691
  function makeArray(subject) {
692
692
  return Array.isArray(subject) ? subject : [subject];
693
693
  }
694
+ var UNDEFINED = void 0;
694
695
  var EMPTY = "";
695
696
  var SPACE = " ";
696
697
  var ESCAPE = "\\";
@@ -699,27 +700,32 @@ var require_ignore = __commonJS({
699
700
  var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
700
701
  var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
701
702
  var REGEX_SPLITALL_CRLF = /\r?\n/g;
702
- var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
703
+ var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/;
704
+ var REGEX_TEST_TRAILING_SLASH = /\/$/;
703
705
  var SLASH = "/";
704
706
  var TMP_KEY_IGNORE = "node-ignore";
705
707
  if (typeof Symbol !== "undefined") {
706
708
  TMP_KEY_IGNORE = /* @__PURE__ */ Symbol.for("node-ignore");
707
709
  }
708
710
  var KEY_IGNORE = TMP_KEY_IGNORE;
709
- var define = (object2, key, value) => Object.defineProperty(object2, key, { value });
711
+ var define = (object2, key, value) => {
712
+ Object.defineProperty(object2, key, { value });
713
+ return value;
714
+ };
710
715
  var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
711
716
  var RETURN_FALSE = () => false;
712
717
  var sanitizeRange = (range2) => range2.replace(
713
718
  REGEX_REGEXP_RANGE,
714
719
  (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
715
720
  );
721
+ var negateRange = (range2) => range2.startsWith("!") || range2.startsWith("\\^") ? `^${range2.slice(range2[0] === "!" ? 1 : 2)}` : range2;
716
722
  var cleanRangeBackSlash = (slashes) => {
717
723
  const { length } = slashes;
718
724
  return slashes.slice(0, length - length % 2);
719
725
  };
720
726
  var REPLACERS = [
721
727
  [
722
- // remove BOM
728
+ // Remove BOM
723
729
  // TODO:
724
730
  // Other similar zero-width characters?
725
731
  /^\uFEFF/,
@@ -734,7 +740,7 @@ var require_ignore = __commonJS({
734
740
  /((?:\\\\)*?)(\\?\s+)$/,
735
741
  (_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY)
736
742
  ],
737
- // replace (\ ) with ' '
743
+ // Replace (\ ) with ' '
738
744
  // (\ ) -> ' '
739
745
  // (\\ ) -> '\\ '
740
746
  // (\\\ ) -> '\\ '
@@ -790,7 +796,7 @@ var require_ignore = __commonJS({
790
796
  // > "**/foo/bar" matches file or directory "bar" anywhere that is directly
791
797
  // > under directory "foo".
792
798
  // Notice that the '*'s have been replaced as '\\*'
793
- /^\^*\\\*\\\*\\\//,
799
+ /^\^*(?:\\\*\\\*\\\/)+/,
794
800
  // '**/foo' <-> 'foo'
795
801
  () => "^(?:.*\\/)?"
796
802
  ],
@@ -845,7 +851,7 @@ var require_ignore = __commonJS({
845
851
  // > can be used to match one of the characters in a range.
846
852
  // `\` is escaped by step 3
847
853
  /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
848
- (match, leadEscape, range2, endEscape, close) => leadEscape === ESCAPE ? `\\[${range2}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range2)}${endEscape}]` : "[]" : "[]"
854
+ (match, leadEscape, range2, endEscape, close) => leadEscape === ESCAPE ? `\\[${range2}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${negateRange(sanitizeRange(range2))}${endEscape}]` : "[]" : "[]"
849
855
  ],
850
856
  // ending
851
857
  [
@@ -863,55 +869,147 @@ var require_ignore = __commonJS({
863
869
  // 'js/' will not match 'a.js'
864
870
  // 'js' will match 'a.js' and 'a.js/'
865
871
  (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
866
- ],
867
- // trailing wildcard
868
- [
869
- /(\^|\\\/)?\\\*$/,
870
- (_, p1) => {
871
- const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
872
- return `${prefix}(?=$|\\/$)`;
873
- }
874
872
  ]
875
873
  ];
876
- var regexCache = /* @__PURE__ */ Object.create(null);
877
- var makeRegex = (pattern, ignoreCase) => {
878
- let source = regexCache[pattern];
879
- if (!source) {
880
- source = REPLACERS.reduce(
881
- (prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)),
882
- pattern
883
- );
884
- regexCache[pattern] = source;
874
+ var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/;
875
+ var MODE_IGNORE = "regex";
876
+ var MODE_CHECK_IGNORE = "checkRegex";
877
+ var UNDERSCORE = "_";
878
+ var TRAILING_WILD_CARD_REPLACERS = {
879
+ [MODE_IGNORE](_, p1) {
880
+ const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
881
+ return `${prefix}(?=$|\\/$)`;
882
+ },
883
+ [MODE_CHECK_IGNORE](_, p1) {
884
+ const prefix = p1 ? `${p1}[^/]*` : "[^/]*";
885
+ return `${prefix}(?=$|\\/$)`;
885
886
  }
886
- return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
887
887
  };
888
+ var makeRegexPrefix = (pattern) => REPLACERS.reduce(
889
+ (prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)),
890
+ pattern
891
+ );
888
892
  var isString2 = (subject) => typeof subject === "string";
889
893
  var checkPattern = (pattern) => pattern && isString2(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
890
- var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
894
+ var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean);
891
895
  var IgnoreRule = class {
892
- constructor(origin, pattern, negative, regex) {
893
- this.origin = origin;
896
+ constructor(pattern, mark, body, ignoreCase, negative, prefix) {
894
897
  this.pattern = pattern;
898
+ this.mark = mark;
895
899
  this.negative = negative;
896
- this.regex = regex;
900
+ define(this, "body", body);
901
+ define(this, "ignoreCase", ignoreCase);
902
+ define(this, "regexPrefix", prefix);
903
+ }
904
+ get regex() {
905
+ const key = UNDERSCORE + MODE_IGNORE;
906
+ if (this[key]) {
907
+ return this[key];
908
+ }
909
+ return this._make(MODE_IGNORE, key);
910
+ }
911
+ get checkRegex() {
912
+ const key = UNDERSCORE + MODE_CHECK_IGNORE;
913
+ if (this[key]) {
914
+ return this[key];
915
+ }
916
+ return this._make(MODE_CHECK_IGNORE, key);
917
+ }
918
+ _make(mode, key) {
919
+ const str = this.regexPrefix.replace(
920
+ REGEX_REPLACE_TRAILING_WILDCARD,
921
+ // It does not need to bind pattern
922
+ TRAILING_WILD_CARD_REPLACERS[mode]
923
+ );
924
+ const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
925
+ return define(this, key, regex);
897
926
  }
898
927
  };
899
- var createRule = (pattern, ignoreCase) => {
900
- const origin = pattern;
928
+ var createRule = ({
929
+ pattern,
930
+ mark
931
+ }, ignoreCase) => {
901
932
  let negative = false;
902
- if (pattern.indexOf("!") === 0) {
933
+ let body = pattern;
934
+ if (body.indexOf("!") === 0) {
903
935
  negative = true;
904
- pattern = pattern.substr(1);
936
+ body = body.substr(1);
905
937
  }
906
- pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
907
- const regex = makeRegex(pattern, ignoreCase);
938
+ body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
939
+ const regexPrefix = makeRegexPrefix(body);
908
940
  return new IgnoreRule(
909
- origin,
910
941
  pattern,
942
+ mark,
943
+ body,
944
+ ignoreCase,
911
945
  negative,
912
- regex
946
+ regexPrefix
913
947
  );
914
948
  };
949
+ var RuleManager = class {
950
+ constructor(ignoreCase) {
951
+ this._ignoreCase = ignoreCase;
952
+ this._rules = [];
953
+ }
954
+ _add(pattern) {
955
+ if (pattern && pattern[KEY_IGNORE]) {
956
+ this._rules = this._rules.concat(pattern._rules._rules);
957
+ this._added = true;
958
+ return;
959
+ }
960
+ if (isString2(pattern)) {
961
+ pattern = {
962
+ pattern
963
+ };
964
+ }
965
+ if (checkPattern(pattern.pattern)) {
966
+ const rule = createRule(pattern, this._ignoreCase);
967
+ this._added = true;
968
+ this._rules.push(rule);
969
+ }
970
+ }
971
+ // @param {Array<string> | string | Ignore} pattern
972
+ add(pattern) {
973
+ this._added = false;
974
+ makeArray(
975
+ isString2(pattern) ? splitPattern(pattern) : pattern
976
+ ).forEach(this._add, this);
977
+ return this._added;
978
+ }
979
+ // Test one single path without recursively checking parent directories
980
+ //
981
+ // - checkUnignored `boolean` whether should check if the path is unignored,
982
+ // setting `checkUnignored` to `false` could reduce additional
983
+ // path matching.
984
+ // - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
985
+ // @returns {TestResult} true if a file is ignored
986
+ test(path, checkUnignored, mode) {
987
+ let ignored = false;
988
+ let unignored = false;
989
+ let matchedRule;
990
+ this._rules.forEach((rule) => {
991
+ const { negative } = rule;
992
+ if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
993
+ return;
994
+ }
995
+ const matched = rule[mode].test(path);
996
+ if (!matched) {
997
+ return;
998
+ }
999
+ ignored = !negative;
1000
+ unignored = negative;
1001
+ matchedRule = negative ? UNDEFINED : rule;
1002
+ });
1003
+ const ret = {
1004
+ ignored,
1005
+ unignored
1006
+ };
1007
+ if (matchedRule) {
1008
+ ret.rule = matchedRule;
1009
+ }
1010
+ return ret;
1011
+ }
1012
+ };
915
1013
  var throwError = (message, Ctor) => {
916
1014
  throw new Ctor(message);
917
1015
  };
@@ -944,34 +1042,16 @@ var require_ignore = __commonJS({
944
1042
  allowRelativePaths = false
945
1043
  } = {}) {
946
1044
  define(this, KEY_IGNORE, true);
947
- this._rules = [];
948
- this._ignoreCase = ignoreCase;
949
- this._allowRelativePaths = allowRelativePaths;
1045
+ this._rules = new RuleManager(ignoreCase);
1046
+ this._strictPathCheck = !allowRelativePaths;
950
1047
  this._initCache();
951
1048
  }
952
1049
  _initCache() {
953
1050
  this._ignoreCache = /* @__PURE__ */ Object.create(null);
954
1051
  this._testCache = /* @__PURE__ */ Object.create(null);
955
1052
  }
956
- _addPattern(pattern) {
957
- if (pattern && pattern[KEY_IGNORE]) {
958
- this._rules = this._rules.concat(pattern._rules);
959
- this._added = true;
960
- return;
961
- }
962
- if (checkPattern(pattern)) {
963
- const rule = createRule(pattern, this._ignoreCase);
964
- this._added = true;
965
- this._rules.push(rule);
966
- }
967
- }
968
- // @param {Array<string> | string | Ignore} pattern
969
1053
  add(pattern) {
970
- this._added = false;
971
- makeArray(
972
- isString2(pattern) ? splitPattern(pattern) : pattern
973
- ).forEach(this._addPattern, this);
974
- if (this._added) {
1054
+ if (this._rules.add(pattern)) {
975
1055
  this._initCache();
976
1056
  }
977
1057
  return this;
@@ -980,58 +1060,45 @@ var require_ignore = __commonJS({
980
1060
  addPattern(pattern) {
981
1061
  return this.add(pattern);
982
1062
  }
983
- // | ignored : unignored
984
- // negative | 0:0 | 0:1 | 1:0 | 1:1
985
- // -------- | ------- | ------- | ------- | --------
986
- // 0 | TEST | TEST | SKIP | X
987
- // 1 | TESTIF | SKIP | TEST | X
988
- // - SKIP: always skip
989
- // - TEST: always test
990
- // - TESTIF: only test if checkUnignored
991
- // - X: that never happen
992
- // @param {boolean} whether should check if the path is unignored,
993
- // setting `checkUnignored` to `false` could reduce additional
994
- // path matching.
995
- // @returns {TestResult} true if a file is ignored
996
- _testOne(path, checkUnignored) {
997
- let ignored = false;
998
- let unignored = false;
999
- this._rules.forEach((rule) => {
1000
- const { negative } = rule;
1001
- if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
1002
- return;
1003
- }
1004
- const matched = rule.regex.test(path);
1005
- if (matched) {
1006
- ignored = !negative;
1007
- unignored = negative;
1008
- }
1009
- });
1010
- return {
1011
- ignored,
1012
- unignored
1013
- };
1014
- }
1015
1063
  // @returns {TestResult}
1016
1064
  _test(originalPath, cache, checkUnignored, slices) {
1017
1065
  const path = originalPath && checkPath.convert(originalPath);
1018
1066
  checkPath(
1019
1067
  path,
1020
1068
  originalPath,
1021
- this._allowRelativePaths ? RETURN_FALSE : throwError
1069
+ this._strictPathCheck ? throwError : RETURN_FALSE
1022
1070
  );
1023
1071
  return this._t(path, cache, checkUnignored, slices);
1024
1072
  }
1073
+ checkIgnore(path) {
1074
+ if (!REGEX_TEST_TRAILING_SLASH.test(path)) {
1075
+ return this.test(path);
1076
+ }
1077
+ const slices = path.split(SLASH).filter(Boolean);
1078
+ slices.pop();
1079
+ if (slices.length) {
1080
+ const parent = this._t(
1081
+ slices.join(SLASH) + SLASH,
1082
+ this._testCache,
1083
+ true,
1084
+ slices
1085
+ );
1086
+ if (parent.ignored) {
1087
+ return parent;
1088
+ }
1089
+ }
1090
+ return this._rules.test(path, false, MODE_CHECK_IGNORE);
1091
+ }
1025
1092
  _t(path, cache, checkUnignored, slices) {
1026
1093
  if (path in cache) {
1027
1094
  return cache[path];
1028
1095
  }
1029
1096
  if (!slices) {
1030
- slices = path.split(SLASH);
1097
+ slices = path.split(SLASH).filter(Boolean);
1031
1098
  }
1032
1099
  slices.pop();
1033
1100
  if (!slices.length) {
1034
- return cache[path] = this._testOne(path, checkUnignored);
1101
+ return cache[path] = this._rules.test(path, checkUnignored, MODE_IGNORE);
1035
1102
  }
1036
1103
  const parent = this._t(
1037
1104
  slices.join(SLASH) + SLASH,
@@ -1039,7 +1106,7 @@ var require_ignore = __commonJS({
1039
1106
  checkUnignored,
1040
1107
  slices
1041
1108
  );
1042
- return cache[path] = parent.ignored ? parent : this._testOne(path, checkUnignored);
1109
+ return cache[path] = parent.ignored ? parent : this._rules.test(path, checkUnignored, MODE_IGNORE);
1043
1110
  }
1044
1111
  ignores(path) {
1045
1112
  return this._test(path, this._ignoreCache, false).ignored;
@@ -1057,18 +1124,22 @@ var require_ignore = __commonJS({
1057
1124
  };
1058
1125
  var factory = (options) => new Ignore(options);
1059
1126
  var isPathValid = (path) => checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
1060
- factory.isPathValid = isPathValid;
1061
- factory.default = factory;
1062
- module.exports = factory;
1127
+ var setupWindows = () => {
1128
+ const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
1129
+ checkPath.convert = makePosix;
1130
+ const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
1131
+ checkPath.isNotRelative = (path) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
1132
+ };
1063
1133
  if (
1064
1134
  // Detect `process` so that it can run in browsers.
1065
- typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
1135
+ typeof process !== "undefined" && process.platform === "win32"
1066
1136
  ) {
1067
- const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
1068
- checkPath.convert = makePosix;
1069
- const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
1070
- checkPath.isNotRelative = (path) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
1137
+ setupWindows();
1071
1138
  }
1139
+ module.exports = factory;
1140
+ factory.default = factory;
1141
+ module.exports.isPathValid = isPathValid;
1142
+ define(module.exports, /* @__PURE__ */ Symbol.for("setupWindows"), setupWindows);
1072
1143
  }
1073
1144
  });
1074
1145
 
@@ -35344,27 +35415,27 @@ var init_source_format = __esm({
35344
35415
  }
35345
35416
  });
35346
35417
 
35347
- // ../node_modules/uuid/dist-node/regex.js
35418
+ // node_modules/uuid/dist-node/regex.js
35348
35419
  var regex_default;
35349
35420
  var init_regex = __esm({
35350
- "../node_modules/uuid/dist-node/regex.js"() {
35421
+ "node_modules/uuid/dist-node/regex.js"() {
35351
35422
  regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
35352
35423
  }
35353
35424
  });
35354
35425
 
35355
- // ../node_modules/uuid/dist-node/validate.js
35426
+ // node_modules/uuid/dist-node/validate.js
35356
35427
  function validate(uuid) {
35357
35428
  return typeof uuid === "string" && regex_default.test(uuid);
35358
35429
  }
35359
35430
  var validate_default;
35360
35431
  var init_validate2 = __esm({
35361
- "../node_modules/uuid/dist-node/validate.js"() {
35432
+ "node_modules/uuid/dist-node/validate.js"() {
35362
35433
  init_regex();
35363
35434
  validate_default = validate;
35364
35435
  }
35365
35436
  });
35366
35437
 
35367
- // ../node_modules/uuid/dist-node/parse.js
35438
+ // node_modules/uuid/dist-node/parse.js
35368
35439
  function parse(uuid) {
35369
35440
  if (!validate_default(uuid)) {
35370
35441
  throw TypeError("Invalid UUID");
@@ -35374,19 +35445,19 @@ function parse(uuid) {
35374
35445
  }
35375
35446
  var parse_default;
35376
35447
  var init_parse = __esm({
35377
- "../node_modules/uuid/dist-node/parse.js"() {
35448
+ "node_modules/uuid/dist-node/parse.js"() {
35378
35449
  init_validate2();
35379
35450
  parse_default = parse;
35380
35451
  }
35381
35452
  });
35382
35453
 
35383
- // ../node_modules/uuid/dist-node/stringify.js
35454
+ // node_modules/uuid/dist-node/stringify.js
35384
35455
  function unsafeStringify(arr, offset = 0) {
35385
35456
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
35386
35457
  }
35387
35458
  var byteToHex;
35388
35459
  var init_stringify = __esm({
35389
- "../node_modules/uuid/dist-node/stringify.js"() {
35460
+ "node_modules/uuid/dist-node/stringify.js"() {
35390
35461
  byteToHex = [];
35391
35462
  for (let i = 0; i < 256; ++i) {
35392
35463
  byteToHex.push((i + 256).toString(16).slice(1));
@@ -35394,18 +35465,18 @@ var init_stringify = __esm({
35394
35465
  }
35395
35466
  });
35396
35467
 
35397
- // ../node_modules/uuid/dist-node/rng.js
35468
+ // node_modules/uuid/dist-node/rng.js
35398
35469
  function rng() {
35399
35470
  return crypto.getRandomValues(rnds8);
35400
35471
  }
35401
35472
  var rnds8;
35402
35473
  var init_rng = __esm({
35403
- "../node_modules/uuid/dist-node/rng.js"() {
35474
+ "node_modules/uuid/dist-node/rng.js"() {
35404
35475
  rnds8 = new Uint8Array(16);
35405
35476
  }
35406
35477
  });
35407
35478
 
35408
- // ../node_modules/uuid/dist-node/v35.js
35479
+ // node_modules/uuid/dist-node/v35.js
35409
35480
  function stringToBytes(str) {
35410
35481
  str = unescape(encodeURIComponent(str));
35411
35482
  const bytes = new Uint8Array(str.length);
@@ -35443,7 +35514,7 @@ function v35(version, hash, value, namespace, buf, offset) {
35443
35514
  }
35444
35515
  var DNS, URL2;
35445
35516
  var init_v35 = __esm({
35446
- "../node_modules/uuid/dist-node/v35.js"() {
35517
+ "node_modules/uuid/dist-node/v35.js"() {
35447
35518
  init_parse();
35448
35519
  init_stringify();
35449
35520
  DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
@@ -35451,7 +35522,7 @@ var init_v35 = __esm({
35451
35522
  }
35452
35523
  });
35453
35524
 
35454
- // ../node_modules/uuid/dist-node/v4.js
35525
+ // node_modules/uuid/dist-node/v4.js
35455
35526
  function v4(options, buf, offset) {
35456
35527
  if (!buf && !options && crypto.randomUUID) {
35457
35528
  return crypto.randomUUID();
@@ -35480,14 +35551,14 @@ function _v4(options, buf, offset) {
35480
35551
  }
35481
35552
  var v4_default;
35482
35553
  var init_v4 = __esm({
35483
- "../node_modules/uuid/dist-node/v4.js"() {
35554
+ "node_modules/uuid/dist-node/v4.js"() {
35484
35555
  init_rng();
35485
35556
  init_stringify();
35486
35557
  v4_default = v4;
35487
35558
  }
35488
35559
  });
35489
35560
 
35490
- // ../node_modules/uuid/dist-node/sha1.js
35561
+ // node_modules/uuid/dist-node/sha1.js
35491
35562
  import { createHash } from "node:crypto";
35492
35563
  function sha1(bytes) {
35493
35564
  if (Array.isArray(bytes)) {
@@ -35499,18 +35570,18 @@ function sha1(bytes) {
35499
35570
  }
35500
35571
  var sha1_default;
35501
35572
  var init_sha1 = __esm({
35502
- "../node_modules/uuid/dist-node/sha1.js"() {
35573
+ "node_modules/uuid/dist-node/sha1.js"() {
35503
35574
  sha1_default = sha1;
35504
35575
  }
35505
35576
  });
35506
35577
 
35507
- // ../node_modules/uuid/dist-node/v5.js
35578
+ // node_modules/uuid/dist-node/v5.js
35508
35579
  function v5(value, namespace, buf, offset) {
35509
35580
  return v35(80, sha1_default, value, namespace, buf, offset);
35510
35581
  }
35511
35582
  var v5_default;
35512
35583
  var init_v5 = __esm({
35513
- "../node_modules/uuid/dist-node/v5.js"() {
35584
+ "node_modules/uuid/dist-node/v5.js"() {
35514
35585
  init_sha1();
35515
35586
  init_v35();
35516
35587
  v5.DNS = DNS;
@@ -35519,9 +35590,9 @@ var init_v5 = __esm({
35519
35590
  }
35520
35591
  });
35521
35592
 
35522
- // ../node_modules/uuid/dist-node/index.js
35593
+ // node_modules/uuid/dist-node/index.js
35523
35594
  var init_dist_node = __esm({
35524
- "../node_modules/uuid/dist-node/index.js"() {
35595
+ "node_modules/uuid/dist-node/index.js"() {
35525
35596
  init_v4();
35526
35597
  init_v5();
35527
35598
  }
@@ -53720,11 +53791,12 @@ function compileNSInitializer(code, ctx) {
53720
53791
  );
53721
53792
  }
53722
53793
  try {
53794
+ const { lexicalThisClass, ...compilerContext } = ctx;
53723
53795
  return compileStrict(
53724
53796
  `return
53725
53797
  ${code};`,
53726
53798
  createContext(
53727
- { ...ctx, thisClass: null },
53799
+ { ...compilerContext, thisClass: lexicalThisClass ?? null },
53728
53800
  {
53729
53801
  scriptKind: "initializer",
53730
53802
  returnTypeInfo: ctx.returnTypeInfo,
@@ -53897,6 +53969,37 @@ var init_compiler_adapter = __esm({
53897
53969
  });
53898
53970
 
53899
53971
  // ../src/database/compile-ns-property.ts
53972
+ function initializerReferencedIdentifiers(source) {
53973
+ let expression;
53974
+ try {
53975
+ expression = parseExpression(source);
53976
+ } catch {
53977
+ return /* @__PURE__ */ new Set();
53978
+ }
53979
+ const identifiers = /* @__PURE__ */ new Set();
53980
+ const pending = [expression];
53981
+ const visited = /* @__PURE__ */ new Set();
53982
+ while (pending.length > 0) {
53983
+ const value = pending.pop();
53984
+ if (value === null || typeof value !== "object" || visited.has(value)) {
53985
+ continue;
53986
+ }
53987
+ visited.add(value);
53988
+ if (Reflect.get(value, "kind") === "ident") {
53989
+ const name = Reflect.get(value, "name");
53990
+ if (typeof name === "string") identifiers.add(name);
53991
+ }
53992
+ for (const child of Object.values(value)) pending.push(child);
53993
+ }
53994
+ return identifiers;
53995
+ }
53996
+ function initializerReferencesLexicalThis(source) {
53997
+ return initializerReferencedIdentifiers(source).has("this");
53998
+ }
53999
+ function initializerReferencesAnyIdentifier(source, names) {
54000
+ const identifiers = initializerReferencedIdentifiers(source);
54001
+ return [...names].some((name) => identifiers.has(name));
54002
+ }
53900
54003
  function compileNSPropertyBodies(args) {
53901
54004
  if (args.member.kind !== 10 /* NSProperty */) return;
53902
54005
  if (isMemberNSPropertyContractBase(args.member)) return;
@@ -54150,6 +54253,7 @@ function compileValueRowInitializerBody(args) {
54150
54253
  constructors: args.constructors ?? [],
54151
54254
  returnTypeInfo,
54152
54255
  initializerName: args.member.name,
54256
+ lexicalThisClass: args.lexicalThisClass ?? null,
54153
54257
  argumentTypes: initializerArgumentTypes(
54154
54258
  args.initializerOwnerClass,
54155
54259
  args.constructors ?? []
@@ -54704,6 +54808,7 @@ var init_compile_ns_property = __esm({
54704
54808
  init_lookup_declared_type();
54705
54809
  init_compiler_adapter();
54706
54810
  init_compiler_adapter();
54811
+ init_src();
54707
54812
  NeoScriptBodyCompileError = class extends Error {
54708
54813
  memberId;
54709
54814
  memberName;
@@ -54726,6 +54831,41 @@ var init_compile_ns_property = __esm({
54726
54831
  });
54727
54832
 
54728
54833
  // ../src/database/value-row-owner-members.ts
54834
+ function valueIdsWithSourceChains(targetValueIds, valuesById) {
54835
+ const result = new Set(targetValueIds);
54836
+ for (const targetId of targetValueIds) {
54837
+ const visited = /* @__PURE__ */ new Set();
54838
+ let currentId = targetId;
54839
+ while (currentId !== null && !visited.has(currentId)) {
54840
+ visited.add(currentId);
54841
+ result.add(currentId);
54842
+ const sourceValueId = valuesById.get(currentId)?.sourceValueId;
54843
+ currentId = typeof sourceValueId === "string" ? sourceValueId : null;
54844
+ }
54845
+ }
54846
+ return result;
54847
+ }
54848
+ function initializerOwnerContext(document, valueId, rootOwners, valuesById) {
54849
+ const visited = /* @__PURE__ */ new Set();
54850
+ let currentId = valueId;
54851
+ let lexicalRoot = rootOwners.get(valueId);
54852
+ while (currentId !== null && !visited.has(currentId)) {
54853
+ visited.add(currentId);
54854
+ const sourceValueId = valuesById.get(currentId)?.sourceValueId;
54855
+ if (typeof sourceValueId !== "string") break;
54856
+ currentId = sourceValueId;
54857
+ lexicalRoot = rootOwners.get(sourceValueId) ?? lexicalRoot;
54858
+ }
54859
+ if (lexicalRoot === void 0) {
54860
+ return { ownerClass: null, lexicalThisClass: null };
54861
+ }
54862
+ const lexicalRootId = getField(lexicalRoot, "id");
54863
+ const ownerClass = typeof lexicalRootId === "string" ? findSchemaPlacement(lexicalRootId, document.classes)?.ownerClass ?? null : null;
54864
+ return {
54865
+ ownerClass,
54866
+ lexicalThisClass: lexicalRoot.isStatic === true ? null : ownerClass
54867
+ };
54868
+ }
54729
54869
  function isRecordValue(value) {
54730
54870
  if (value === null) return false;
54731
54871
  if (typeof value !== "object") return false;
@@ -63264,7 +63404,11 @@ function evaluateMemberInitializer(args) {
63264
63404
  __constructedArgumentsByValue: /* @__PURE__ */ new WeakMap(),
63265
63405
  __createdStorageKeyDeclarations: args.storageKeyDeclarations ?? /* @__PURE__ */ new Map()
63266
63406
  };
63267
- const result = evaluateNSGetterWithEffects(compiled, ctx);
63407
+ const result = evaluateNSGetterWithEffects(
63408
+ compiled,
63409
+ ctx,
63410
+ args.argumentValues ?? []
63411
+ );
63268
63412
  const created = result.createdSessionValues ?? [];
63269
63413
  if (isMemberLookupBase(args.member)) {
63270
63414
  return encodeLookupInitializerResult(
@@ -63319,7 +63463,8 @@ function evaluateInitializerMaterialization(args) {
63319
63463
  document: args.document,
63320
63464
  createdValues,
63321
63465
  storageKeyDeclarations,
63322
- ...args.storedConstructionReplay === true ? { storedConstructionReplay: true } : {}
63466
+ ...args.storedConstructionReplay === true ? { storedConstructionReplay: true } : {},
63467
+ ...args.argumentValues === void 0 ? {} : { argumentValues: args.argumentValues }
63323
63468
  });
63324
63469
  return { evaluated, createdValues, storageKeyDeclarations };
63325
63470
  }
@@ -63328,7 +63473,8 @@ function materializeInitializerValue(args) {
63328
63473
  init: args.row.init,
63329
63474
  member: args.member,
63330
63475
  document: args.document,
63331
- ...args.storedConstructionReplay === true ? { storedConstructionReplay: true } : {}
63476
+ ...args.storedConstructionReplay === true ? { storedConstructionReplay: true } : {},
63477
+ ...args.argumentValues === void 0 ? {} : { argumentValues: args.argumentValues }
63332
63478
  });
63333
63479
  const {
63334
63480
  init: _init,
@@ -63343,6 +63489,9 @@ function materializeInitializerValue(args) {
63343
63489
  ...evaluated.constructorArgs === void 0 ? {} : { constructorArgs: structuredClone(evaluated.constructorArgs) }
63344
63490
  };
63345
63491
  const allCreated = [root, ...createdValues];
63492
+ for (const created of createdValues) {
63493
+ if (created.classId === void 0) delete created.classId;
63494
+ }
63346
63495
  stampCreatedValuesMapKey(allCreated, args.row.mapKey);
63347
63496
  storageKeyDeclarations.delete(root.id);
63348
63497
  applyDeclaredStorageKeyOverrides({
@@ -76940,6 +77089,12 @@ var init_project_version_static_value_writes = __esm({
76940
77089
  this.validateDialogueLookup(member, value, path);
76941
77090
  return;
76942
77091
  }
77092
+ if (isMemberDelegateBase(member)) {
77093
+ if (!isNSDelegateValue(value.value)) {
77094
+ throw new Error(`${path} must store a valid NeoDelegate value.`);
77095
+ }
77096
+ return;
77097
+ }
76943
77098
  if (isMemberClassBase(member)) {
76944
77099
  this.validateClass({ ...args, member, value });
76945
77100
  return;
@@ -78941,8 +79096,7 @@ function materializeAuthoredValueSeeds(args) {
78941
79096
  document: args.document,
78942
79097
  prepared: args.prepared,
78943
79098
  pendingGraphValidations,
78944
- changeIndex: index,
78945
- change,
79099
+ memberChange: { index, change },
78946
79100
  member,
78947
79101
  seed
78948
79102
  });
@@ -79088,6 +79242,21 @@ function materializeAuthoredValueSeeds(args) {
79088
79242
  }
79089
79243
  for (const seed of args.authoredValueSeeds) {
79090
79244
  if (consumedSeedMemberIds.has(seed.memberId)) continue;
79245
+ const member = args.document.members.find(
79246
+ (candidate) => candidate.id === seed.memberId
79247
+ );
79248
+ if (member !== void 0 && member.isStatic !== true && !isProjectRootMember(args.document.project, member.id)) {
79249
+ materializeInstanceDefaultSeed({
79250
+ document: args.document,
79251
+ prepared: args.prepared,
79252
+ pendingGraphValidations,
79253
+ memberChange: null,
79254
+ member,
79255
+ seed
79256
+ });
79257
+ consumedSeedMemberIds.add(seed.memberId);
79258
+ continue;
79259
+ }
79091
79260
  materializeExistingAuthoredValueSeed({
79092
79261
  document: args.document,
79093
79262
  prepared: args.prepared,
@@ -79308,10 +79477,17 @@ function materializeInstanceDefaultSeed(args) {
79308
79477
  ...args.member,
79309
79478
  defaultValue: seedValueContent(args.seed)
79310
79479
  };
79311
- const { createdValues, localizedTexts, storageKeyDeclarations, rootValue } = materializeAuthoredStaticSeed({
79480
+ const {
79481
+ createdValues,
79482
+ localizedTexts,
79483
+ storageKeyDeclarations,
79484
+ rootValue,
79485
+ existingValueIds
79486
+ } = materializeAuthoredStaticSeed({
79312
79487
  document: args.document,
79313
79488
  member: materializationMember,
79314
- seed: { ...args.seed, values: args.seed.values }
79489
+ seed: { ...args.seed, values: args.seed.values },
79490
+ allowExistingRows: args.memberChange === null || args.memberChange.change.operation === "update"
79315
79491
  });
79316
79492
  stampCreatedValuesMapKey(createdValues, null);
79317
79493
  applyDeclaredStorageKeyOverrides({
@@ -79346,12 +79522,21 @@ function materializeInstanceDefaultSeed(args) {
79346
79522
  ...typeof rootValue.classId === "string" ? { classId: rootValue.classId } : {}
79347
79523
  }
79348
79524
  };
79349
- args.prepared[args.changeIndex] = {
79350
- ...args.change,
79351
- nextData: nextMember
79352
- };
79525
+ if (args.memberChange === null) {
79526
+ if (canonicalJsonStringify(seedValueContent(args.seed)) !== canonicalJsonStringify(args.member.defaultValue)) {
79527
+ throw new Error(
79528
+ `Existing default value seed for member "${args.member.name}" (${args.member.id}) declares ${canonicalJsonStringify(seedValueContent(args.seed))}, but the unchanged member declares ${canonicalJsonStringify(args.member.defaultValue)}.`
79529
+ );
79530
+ }
79531
+ } else {
79532
+ args.prepared[args.memberChange.index] = {
79533
+ ...args.memberChange.change,
79534
+ nextData: nextMember
79535
+ };
79536
+ }
79353
79537
  for (const value of createdValues) {
79354
79538
  if (value.id === rootValue.id) continue;
79539
+ if (existingValueIds.has(value.id)) continue;
79355
79540
  args.prepared.push({
79356
79541
  recordKind: "value",
79357
79542
  recordId: value.id,
@@ -80100,17 +80285,21 @@ function prepareServerOwnedValueInitializerBodies(args) {
80100
80285
  ...[...explicitRows.values()].map((row) => row.id),
80101
80286
  ...sweepRows.map((row) => row.id)
80102
80287
  ]);
80288
+ const valuesById = new Map(
80289
+ committedDocument.values.map((value) => [value.id, value])
80290
+ );
80291
+ const ownershipTargetIds = valueIdsWithSourceChains(targetIds, valuesById);
80103
80292
  const rootOwnerByValueId = /* @__PURE__ */ new Map();
80104
80293
  const ownerByValueId = resolveOwnerMembersForValues(
80105
80294
  committedDocument,
80106
- targetIds,
80295
+ ownershipTargetIds,
80107
80296
  void 0,
80108
80297
  rootOwnerByValueId
80109
80298
  );
80110
80299
  const currentValueById = new Map(
80111
80300
  args.document.values.map((value) => [value.id, value])
80112
80301
  );
80113
- const compileOne = (document, row) => {
80302
+ const compileOne = (document, row, documentValuesById) => {
80114
80303
  const member = ownerByValueId.get(row.id);
80115
80304
  if (member === void 0) {
80116
80305
  throw new Error(
@@ -80119,6 +80308,12 @@ function prepareServerOwnedValueInitializerBodies(args) {
80119
80308
  }
80120
80309
  const currentValue = currentValueById.get(row.id);
80121
80310
  const replaysStoredConstruction = isLiteralValueContent(currentValue) && (typeof currentValue.classId === "string" || currentValue.constructorArgs !== void 0);
80311
+ const ownerContext = initializerOwnerContext(
80312
+ document,
80313
+ row.id,
80314
+ rootOwnerByValueId,
80315
+ documentValuesById
80316
+ );
80122
80317
  compileValueRowInitializerBody({
80123
80318
  project: document.project,
80124
80319
  projectFiles: document.projectFiles,
@@ -80130,16 +80325,14 @@ function prepareServerOwnedValueInitializerBodies(args) {
80130
80325
  member,
80131
80326
  valueRow: row,
80132
80327
  valueId: row.id,
80133
- initializerOwnerClass: findSchemaPlacement(
80134
- rootOwnerByValueId.get(row.id)?.id ?? "",
80135
- document.classes
80136
- )?.ownerClass ?? null,
80328
+ initializerOwnerClass: ownerContext.ownerClass,
80329
+ lexicalThisClass: initializerReferencesLexicalThis(row.init.code) ? ownerContext.lexicalThisClass : null,
80137
80330
  ...replaysStoredConstruction ? { storedConstructionReplay: true } : {}
80138
80331
  });
80139
80332
  };
80140
80333
  for (const [index, row] of explicitRows) {
80141
80334
  const compiled = { ...row, init: { ...row.init } };
80142
- compileOne(committedDocument, compiled);
80335
+ compileOne(committedDocument, compiled, valuesById);
80143
80336
  const change = args.prepared[index];
80144
80337
  if (change === void 0) continue;
80145
80338
  args.prepared[index] = { ...change, nextData: compiled };
@@ -80154,14 +80347,14 @@ function prepareServerOwnedValueInitializerBodies(args) {
80154
80347
  for (const row of sweepRows) {
80155
80348
  const compiled = { ...row, init: { ...row.init } };
80156
80349
  try {
80157
- compileOne(committedDocument, compiled);
80350
+ compileOne(committedDocument, compiled, valuesById);
80158
80351
  } catch (postWriteError) {
80159
80352
  const current2 = currentById.get(row.id);
80160
80353
  if (current2 === void 0) throw postWriteError;
80161
80354
  const preWrite = initBackedValueRow(structuredClone(current2));
80162
80355
  if (preWrite === null) throw postWriteError;
80163
80356
  try {
80164
- compileOne(args.document, preWrite);
80357
+ compileOne(args.document, preWrite, currentValueById);
80165
80358
  } catch (preWriteError) {
80166
80359
  if (sameCompileFailure(preWriteError, postWriteError)) continue;
80167
80360
  }
@@ -82732,9 +82925,16 @@ function replayAnimationDeclarationInitializersV4(records2, document, fallbackDo
82732
82925
  if (initializers.length === 0) return document;
82733
82926
  const rootKinds = /* @__PURE__ */ new Map();
82734
82927
  const rootOwners = /* @__PURE__ */ new Map();
82928
+ const valuesById = new Map(
82929
+ document.values.map((value) => [value.id, value])
82930
+ );
82931
+ const ownershipTargetIds = valueIdsWithSourceChains(
82932
+ new Set(initializers.map(({ row }) => row.id)),
82933
+ valuesById
82934
+ );
82735
82935
  const owners = resolveOwnerMembersForValues(
82736
82936
  document,
82737
- new Set(initializers.map(({ row }) => row.id)),
82937
+ ownershipTargetIds,
82738
82938
  void 0,
82739
82939
  rootOwners,
82740
82940
  rootKinds
@@ -82778,10 +82978,24 @@ function replayAnimationDeclarationInitializersV4(records2, document, fallbackDo
82778
82978
  if (!classBelongsToAnimationFamily(document.classes, declaredClassId)) {
82779
82979
  continue;
82780
82980
  }
82781
- const rootOwner = rootOwners.get(row.id);
82782
- const rootOwnerId = Reflect.get(rootOwner ?? {}, "id");
82783
- const initializerOwnerClass = typeof rootOwnerId !== "string" ? null : findSchemaPlacement(rootOwnerId, document.classes)?.ownerClass ?? null;
82784
- const evaluate = initializerOwnerClass?.requiredConstructorId === void 0 || initializerOwnerClass.requiredConstructorId === null;
82981
+ const fallback = fallbackValues.get(row.id);
82982
+ const ownerContext = initializerOwnerContext(
82983
+ document,
82984
+ row.id,
82985
+ rootOwners,
82986
+ valuesById
82987
+ );
82988
+ const initializerOwnerClass = ownerContext.ownerClass;
82989
+ const requiredConstructor = initializerOwnerClass?.requiredConstructorId === void 0 || initializerOwnerClass.requiredConstructorId === null ? void 0 : (replayDocument.constructors ?? []).find(
82990
+ (constructor2) => constructor2.id === initializerOwnerClass.requiredConstructorId
82991
+ );
82992
+ const requiredArgumentNames = new Set(
82993
+ requiredConstructor?.argumentTypes.map((argument2) => argument2.name) ?? []
82994
+ );
82995
+ const evaluate = !initializerReferencesAnyIdentifier(
82996
+ code,
82997
+ requiredArgumentNames
82998
+ );
82785
82999
  let replay;
82786
83000
  try {
82787
83001
  replay = replayStoredConstructionV4({
@@ -82793,9 +83007,15 @@ function replayAnimationDeclarationInitializersV4(records2, document, fallbackDo
82793
83007
  compileDocumentBodies: !documentBodiesCompiled,
82794
83008
  compilationProject,
82795
83009
  initializerOwnerClass,
82796
- // A parameterized declaration is a template. Its arguments exist only
82797
- // at concrete construction sites, so validate the authored body here
82798
- // without fabricating values for the class header parameters.
83010
+ lexicalThisClass: ownerContext.lexicalThisClass,
83011
+ ...requiredConstructor === void 0 || !evaluate ? {} : {
83012
+ initializerArgumentValues: requiredConstructor.argumentTypes.map(
83013
+ () => null
83014
+ )
83015
+ },
83016
+ // A parameterized declaration is a template. Replay it only when this
83017
+ // row does not read those parameters; null placeholders satisfy the
83018
+ // unused compiler envelope without inventing authored values.
82799
83019
  evaluate
82800
83020
  });
82801
83021
  documentBodiesCompiled = true;
@@ -82806,7 +83026,6 @@ function replayAnimationDeclarationInitializersV4(records2, document, fallbackDo
82806
83026
  );
82807
83027
  }
82808
83028
  if (!evaluate) {
82809
- const fallback = fallbackValues.get(row.id);
82810
83029
  if (fallback !== void 0) values.set(row.id, fallback);
82811
83030
  }
82812
83031
  for (const [id2, value] of replay) {
@@ -83191,7 +83410,6 @@ var init_workspace_status_core = __esm({
83191
83410
  init_project_documents();
83192
83411
  init_animation_clips();
83193
83412
  init_classes();
83194
- init_inheritance();
83195
83413
  init_members();
83196
83414
  init_value_row_owner_members();
83197
83415
  init_project2();
@@ -83199,6 +83417,7 @@ var init_workspace_status_core = __esm({
83199
83417
  init_push_change_intent();
83200
83418
  init_initializer_replay();
83201
83419
  init_compiler_adapter();
83420
+ init_compile_ns_property();
83202
83421
  init_materialized_construction_cache();
83203
83422
  init_project_version_whole_graph_validation();
83204
83423
  }
@@ -84063,6 +84282,7 @@ function replayStoredConstructionV4(args) {
84063
84282
  // Instance calls are self-contained. Declaration calls inherit the class
84064
84283
  // header parameters that are in lexical scope at their source site.
84065
84284
  initializerOwnerClass: args.initializerOwnerClass ?? null,
84285
+ lexicalThisClass: initializerReferencesLexicalThis(args.code) ? args.lexicalThisClass ?? null : null,
84066
84286
  storedConstructionReplay: true,
84067
84287
  ...compilationProject === void 0 ? {} : { compilationProject }
84068
84288
  });
@@ -84084,7 +84304,8 @@ function replayStoredConstructionV4(args) {
84084
84304
  // explicit typed descriptor for evaluation that compiled the replay.
84085
84305
  member: compileMember,
84086
84306
  row: candidate,
84087
- storedConstructionReplay: true
84307
+ storedConstructionReplay: true,
84308
+ ...args.initializerArgumentValues === void 0 ? {} : { argumentValues: args.initializerArgumentValues }
84088
84309
  });
84089
84310
  break;
84090
84311
  } catch (error) {
@@ -84147,10 +84368,17 @@ function valueInitializerCompilationSites(document) {
84147
84368
  const cached = pulledValueInitializerCompilationSites.get(document);
84148
84369
  if (cached !== void 0) return cached;
84149
84370
  const rows = document.values.filter(isInitValueContent);
84371
+ const valuesById = new Map(
84372
+ document.values.map((value) => [value.id, value])
84373
+ );
84374
+ const ownershipTargetIds = valueIdsWithSourceChains(
84375
+ new Set(rows.map((row) => row.id)),
84376
+ valuesById
84377
+ );
84150
84378
  const rootOwners = /* @__PURE__ */ new Map();
84151
84379
  const owners = resolveOwnerMembersForValues(
84152
84380
  document,
84153
- new Set(rows.map((row) => row.id)),
84381
+ ownershipTargetIds,
84154
84382
  void 0,
84155
84383
  rootOwners
84156
84384
  );
@@ -84158,11 +84386,17 @@ function valueInitializerCompilationSites(document) {
84158
84386
  for (const row of rows) {
84159
84387
  const member = owners.get(row.id);
84160
84388
  if (member === void 0) continue;
84161
- const rootOwnerId = Reflect.get(rootOwners.get(row.id) ?? {}, "id");
84389
+ const ownerContext = initializerOwnerContext(
84390
+ document,
84391
+ row.id,
84392
+ rootOwners,
84393
+ valuesById
84394
+ );
84162
84395
  sites.set(row.id, {
84163
84396
  row,
84164
84397
  member,
84165
- ownerClass: typeof rootOwnerId !== "string" ? null : findSchemaPlacement(rootOwnerId, document.classes)?.ownerClass ?? null
84398
+ ownerClass: ownerContext.ownerClass,
84399
+ lexicalThisClass: ownerContext.lexicalThisClass
84166
84400
  });
84167
84401
  }
84168
84402
  pulledValueInitializerCompilationSites.set(document, sites);
@@ -84187,6 +84421,7 @@ function compilePulledValueInitializerBodyV4(document, valueId, compilationProje
84187
84421
  valueRow: site.row,
84188
84422
  valueId: String(Reflect.get(site.row, "id")),
84189
84423
  initializerOwnerClass: site.ownerClass,
84424
+ lexicalThisClass: site.lexicalThisClass,
84190
84425
  storedConstructionReplay: true,
84191
84426
  ...compilationProject === void 0 ? {} : { compilationProject }
84192
84427
  });
@@ -84343,7 +84578,6 @@ var init_initializer_replay = __esm({
84343
84578
  init_compile_ns_property();
84344
84579
  init_init_backed_value_materialization();
84345
84580
  init_value_row_owner_members();
84346
- init_inheritance();
84347
84581
  init_project_document_read();
84348
84582
  init_localization2();
84349
84583
  init_server_preparation_preflight();
@@ -84972,10 +85206,52 @@ function lowerMemberDefaultSourcesV4(state, analysis, manifest, options = {}) {
84972
85206
  const baseData3 = stateData(context, "member", memberId);
84973
85207
  const backed = baseData3 === null || requiresEvaluation ? null : rowBackedDefaultBody(baseData3, (id2) => pulledValueIds.has(id2));
84974
85208
  if (backed !== null && baseData3 !== null) {
84975
- memberDefaultValues.set(
84976
- memberId,
84977
- lowerRowBackedDefault(context, member, backed, baseData3, binding)
85209
+ const existingReconstructedKeys = new Set(context.reconstructed.keys());
85210
+ const existingPendingValueIds = new Set(context.pendingValues.keys());
85211
+ const existingPendingLocalizedTextIds = new Set(
85212
+ context.pendingLocalizedTexts.keys()
85213
+ );
85214
+ const existingPendingBindingMemberIds = new Set(
85215
+ [...context.pendingBindingMembersByClassId.values()].map(
85216
+ (pending) => pending.id
85217
+ )
85218
+ );
85219
+ const lowered = lowerRowBackedDefault(
85220
+ context,
85221
+ member,
85222
+ backed,
85223
+ baseData3,
85224
+ binding
85225
+ );
85226
+ memberDefaultValues.set(memberId, lowered);
85227
+ const pendingRows = [...context.pendingValues.values()].filter(
85228
+ (row) => !existingPendingValueIds.has(row.id)
84978
85229
  );
85230
+ if (pendingRows.length > 0) {
85231
+ const existingRows = [...context.reconstructed].filter(
85232
+ ([key, record3]) => !existingReconstructedKeys.has(key) && record3.recordKind === "value"
85233
+ ).map(
85234
+ ([, record3]) => staticValueSeedRow(
85235
+ record3.fileFields,
85236
+ context.loweredMemberIdByValueId.get(record3.recordId)
85237
+ )
85238
+ );
85239
+ const bindingMembers = [
85240
+ ...context.pendingBindingMembersByClassId.values()
85241
+ ].filter(
85242
+ (pending) => !existingPendingBindingMemberIds.has(pending.id)
85243
+ );
85244
+ const localizedTexts = [
85245
+ ...context.pendingLocalizedTexts.values()
85246
+ ].filter((text) => !existingPendingLocalizedTextIds.has(text.id));
85247
+ seeds.set(memberId, {
85248
+ ...lowered,
85249
+ valueId: pendingValueId(binding, `${label}.default`),
85250
+ values: [...existingRows, ...pendingRows],
85251
+ ...bindingMembers.length === 0 ? {} : { bindingMembers },
85252
+ ...localizedTexts.length === 0 ? {} : { localizedTexts }
85253
+ });
85254
+ }
84979
85255
  continue;
84980
85256
  }
84981
85257
  if (!defaultRequiresOwnedRows(context, member, expression, binding)) {
@@ -85582,9 +85858,22 @@ function lowerRowBackedDefault(context, member, backed, baseData3, binding) {
85582
85858
  return symbolId;
85583
85859
  }
85584
85860
  const itemId = annotatedValue(element).id;
85585
- if (itemId === null) {
85586
- throw new Error(
85587
- `Default list ${binding.label}[${index}] has no @id. Creating new default rows from source is not implemented by this slice.`
85861
+ if (itemId === null || context.state[`value:${itemId}`] === void 0) {
85862
+ if (itemId !== null && !isPendingId(itemId) && !isUuidV4Id(itemId)) {
85863
+ context.loweringFailures.push({
85864
+ message: `Default list ${binding.label} entry @id("${itemId}") names no existing row, and a new row's durable identity must be a UUID v4. Fix the id if it meant an existing row, or drop the @id to mint a fresh identity.`,
85865
+ site: referenceSite(binding, element)
85866
+ });
85867
+ }
85868
+ return lowerPendingListItem(
85869
+ context,
85870
+ entryMember,
85871
+ element,
85872
+ binding,
85873
+ `${binding.label}[${index}]`,
85874
+ void 0,
85875
+ bindingEnvironment,
85876
+ entrySlices[index]
85588
85877
  );
85589
85878
  }
85590
85879
  return lowerValueRow(
@@ -85732,11 +86021,9 @@ function staticValueSeedRow(value, loweredMemberId) {
85732
86021
  if (loweredMemberId === void 0) {
85733
86022
  throw new Error(`Authored value row ${id2} is missing memberId.`);
85734
86023
  }
85735
- return {
86024
+ const fields = {
85736
86025
  id: id2,
85737
86026
  memberId: loweredMemberId,
85738
- value: value.value,
85739
- classId: stringOrNull(value.classId),
85740
86027
  ...typeof value.containerId === "string" ? { containerId: value.containerId } : {},
85741
86028
  ...isObjectRecord2(value.genericBindings) ? {
85742
86029
  genericBindings: Object.fromEntries(
@@ -85747,6 +86034,15 @@ function staticValueSeedRow(value, loweredMemberId) {
85747
86034
  } : {},
85748
86035
  ...typeof value.sourceValueId === "string" ? { sourceValueId: value.sourceValueId } : {}
85749
86036
  };
86037
+ const init = isObjectRecord2(value.init) ? value.init : null;
86038
+ if (init !== null && typeof init.code === "string") {
86039
+ return { ...fields, init: { code: init.code } };
86040
+ }
86041
+ return {
86042
+ ...fields,
86043
+ value: value.value,
86044
+ classId: stringOrNull(value.classId)
86045
+ };
85750
86046
  }
85751
86047
  function preserveReboundValue(context, currentValueId, nextValueId, binding) {
85752
86048
  if (currentValueId === null || currentValueId === nextValueId) return;
@@ -86144,14 +86440,24 @@ function materializedRowStamp(context, materialization) {
86144
86440
  if (materialization === void 0) return null;
86145
86441
  const rowId = materialization.rowId;
86146
86442
  if (rowId === null) return null;
86147
- const forwarded = valueData(context, rowId)?.sourceValueId;
86443
+ const forwarded = materializationSourceValueData(
86444
+ context,
86445
+ rowId
86446
+ )?.sourceValueId;
86148
86447
  return stringOrNull(forwarded) ?? rowId;
86149
86448
  }
86449
+ function materializationSourceValueData(context, valueId) {
86450
+ if (context.pendingValues.has(valueId)) return valueData(context, valueId);
86451
+ return context.reconstructed.get(`value:${valueId}`)?.fileFields ?? valueData(context, valueId);
86452
+ }
86150
86453
  function materializedChild(context, materialization, key) {
86151
86454
  if (materialization === void 0) return void 0;
86152
86455
  const rowId = defaultChildRowId(materialization.body, key);
86153
86456
  if (rowId === null) return { rowId: null, body: void 0 };
86154
- return { rowId, body: valueData(context, rowId)?.value };
86457
+ return {
86458
+ rowId,
86459
+ body: materializationSourceValueData(context, rowId)?.value
86460
+ };
86155
86461
  }
86156
86462
  function defaultChildRowId(body, key) {
86157
86463
  if (typeof key === "number") {
@@ -87114,11 +87420,6 @@ function lowerListValue(context, member, expression, base, source, inheritedEnvi
87114
87420
  }
87115
87421
  const annotatedItemId = annotatedValue(element).id;
87116
87422
  if (annotatedItemId === null) {
87117
- if (source.purpose === "memberDefault") {
87118
- throw new Error(
87119
- `List ${member.name} contains an idless default item. New default list item creation is not implemented by this slice.`
87120
- );
87121
- }
87122
87423
  ids.push(
87123
87424
  lowerPendingListItem(
87124
87425
  context,
@@ -94410,6 +94711,7 @@ function createCliNeoScriptContext(options) {
94410
94711
  };
94411
94712
  const compilerContext = createNeoScriptDocumentContext({
94412
94713
  vm,
94714
+ constructors: [...options.documents.constructors],
94413
94715
  scriptKind: options.kind,
94414
94716
  thisClass: options.thisClass,
94415
94717
  ...options.returnTypeInfo ? { returnTypeInfo: options.returnTypeInfo } : {},
@@ -96117,6 +96419,7 @@ function readDocumentArrays(raw) {
96117
96419
  project: raw.project,
96118
96420
  members: arrayOf2("members"),
96119
96421
  classes: arrayOf2("classes"),
96422
+ constructors: arrayOf2("constructors"),
96120
96423
  enums: arrayOf2("enums"),
96121
96424
  interfaces: arrayOf2("interfaces"),
96122
96425
  values: arrayOf2("values"),
@@ -101243,7 +101546,7 @@ var init_registry2 = __esm({
101243
101546
  PROJECT_SCHEMA_CONTRACT = Object.freeze({
101244
101547
  formatVersion: 3,
101245
101548
  contractVersion: "3.9",
101246
- cliVersion: "0.24.0",
101549
+ cliVersion: "0.24.2",
101247
101550
  projectFileUploadBatchSize: 32,
101248
101551
  documentRecords: {
101249
101552
  member: {