@elyx-code/project-logic-tree 0.0.6983 → 0.0.6985

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/index.js CHANGED
@@ -92084,7 +92084,9 @@ const Mi = class Mi extends an {
92084
92084
  !0,
92085
92085
  D.CreateFromGenerationTarget
92086
92086
  )
92087
- ) : a, e = te(i.parent), f = r.get(e), h = (i.calledByEntry || []).map((N) => {
92087
+ ) : a, e = te(i.parent), f = r.get(
92088
+ e
92089
+ ), h = (i.calledByEntry || []).map((N) => {
92088
92090
  const V = te(N);
92089
92091
  return r.get(V);
92090
92092
  }), m = (i.calledBySuccess || []).map((N) => {
@@ -92096,7 +92098,9 @@ const Mi = class Mi extends an {
92096
92098
  });
92097
92099
  let E = null;
92098
92100
  if (i.readsValue) {
92099
- const N = te(i.readsValue);
92101
+ const N = te(
92102
+ i.readsValue
92103
+ );
92100
92104
  E = r.get(
92101
92105
  N
92102
92106
  );
@@ -92227,9 +92231,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92227
92231
  const h = f.entity.afterAllChildrenInitialized(i);
92228
92232
  r.push(...h.updated), a.push(...h.added), c.push(...h.removed), e.push(...h.affected);
92229
92233
  }), i == null || i.attemptAutoclose("sync-dependents", this.id), {
92230
- updated: C(r),
92231
- added: C(a),
92232
- removed: C(c),
92234
+ updated: C(
92235
+ r
92236
+ ),
92237
+ added: C(
92238
+ a
92239
+ ),
92240
+ removed: C(
92241
+ c
92242
+ ),
92233
92243
  affected: C(
92234
92244
  e
92235
92245
  ),
@@ -92265,9 +92275,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92265
92275
  c.push(...m), e.push(...b), f.push(...E);
92266
92276
  }
92267
92277
  return {
92268
- updated: C(c),
92269
- added: C(e),
92270
- removed: C(f),
92278
+ updated: C(
92279
+ c
92280
+ ),
92281
+ added: C(
92282
+ e
92283
+ ),
92284
+ removed: C(
92285
+ f
92286
+ ),
92271
92287
  affected: C(
92272
92288
  h
92273
92289
  ),
@@ -92303,9 +92319,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92303
92319
  c.push(...m), e.push(...b), f.push(...E);
92304
92320
  }
92305
92321
  return {
92306
- updated: C(c),
92307
- added: C(e),
92308
- removed: C(f),
92322
+ updated: C(
92323
+ c
92324
+ ),
92325
+ added: C(
92326
+ e
92327
+ ),
92328
+ removed: C(
92329
+ f
92330
+ ),
92309
92331
  affected: C(
92310
92332
  h
92311
92333
  ),
@@ -92419,7 +92441,10 @@ Specifically for return statements the parent needs to always be the 'function-d
92419
92441
  return this.knownVersions = this.knownVersions ? this.knownVersions.set(this.version, i) : (/* @__PURE__ */ new Map()).set(this.version, i), this.apply(i), this;
92420
92442
  }
92421
92443
  snapshot() {
92422
- const i = new Mi(this, this.project);
92444
+ const i = new Mi(
92445
+ this,
92446
+ this.project
92447
+ );
92423
92448
  return this.apply(i);
92424
92449
  }
92425
92450
  /**
@@ -92442,9 +92467,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92442
92467
  r.push(this.parent, ...f.updated), a.push(...f.added), c.push(...f.removed);
92443
92468
  }
92444
92469
  return {
92445
- updated: C(r),
92446
- added: C(a),
92447
- removed: C(c),
92470
+ updated: C(
92471
+ r
92472
+ ),
92473
+ added: C(
92474
+ a
92475
+ ),
92476
+ removed: C(
92477
+ c
92478
+ ),
92448
92479
  affected: C(
92449
92480
  e
92450
92481
  ),
@@ -92467,7 +92498,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92467
92498
  updated: C(
92468
92499
  a
92469
92500
  ),
92470
- added: C(c),
92501
+ added: C(
92502
+ c
92503
+ ),
92471
92504
  removed: C(
92472
92505
  e
92473
92506
  ),
@@ -92503,9 +92536,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92503
92536
  );
92504
92537
  }
92505
92538
  return this.metaSync(h.toShallowJSON(), null), this.previousVersion = h.previousVersion, this.version = h.version, this.createdAt = h.createdAt, this.author = h.author, this.deleted = h.deleted, this.outputs = [...h.outputs], this.readsValue = h.readsValue, this.defaultValue = h.defaultValue, this.dataType = h.dataType, this.throws = h.throws, this.calledBySuccess = [...h.calledBySuccess], this.calledByError = [...h.calledByError], this.calledByEntry = [...h.calledByEntry], this.parent = h.parent, {
92506
- updated: C(a),
92507
- added: C(c),
92508
- removed: C(e),
92539
+ updated: C(
92540
+ a
92541
+ ),
92542
+ added: C(
92543
+ c
92544
+ ),
92545
+ removed: C(
92546
+ e
92547
+ ),
92509
92548
  affected: C(
92510
92549
  f
92511
92550
  ),
@@ -92530,7 +92569,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92530
92569
  this.id
92531
92570
  ), this;
92532
92571
  if (this.metaSync(i, r), this.version = i.version, this.createdAt = i.createdAt, this.author = i.author, this.deleted = i.deleted, this.previousVersion = i.previousVersion, this.unsubscribeFromDependencies(), i.parent) {
92533
- const a = te(i.parent), c = this.project.get(a), e = this.parent;
92572
+ const a = te(i.parent), c = this.project.get(
92573
+ a
92574
+ ), e = this.parent;
92534
92575
  if (e && e.id !== (c == null ? void 0 : c.id) && this.removeFromParent(r), c)
92535
92576
  this.setParent(c, r), this.addSelfToProject(r);
92536
92577
  else
@@ -92544,7 +92585,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92544
92585
  throw r == null || r.attemptAutoclose(
92545
92586
  D.UpdateWithShallowTransfer,
92546
92587
  this.id
92547
- ), new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
92588
+ ), new Error(
92589
+ `${this.type} with id '${this.id}' must have a 'parent'`
92590
+ );
92548
92591
  if (i.readsValue) {
92549
92592
  const a = te(
92550
92593
  i.readsValue
@@ -92555,7 +92598,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92555
92598
  } else
92556
92599
  this.removeValueWriter(r);
92557
92600
  if (i.calledByEntry.forEach((a) => {
92558
- const c = te(a), e = this.project.get(c);
92601
+ const c = te(a), e = this.project.get(
92602
+ c
92603
+ );
92559
92604
  e && (this.addEntryCaller(e, r), e.addCall(this, r));
92560
92605
  }), [...this.calledByEntry].forEach((a) => {
92561
92606
  i.calledByEntry.find(
@@ -92587,7 +92632,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92587
92632
  (e) => te(e) === a.id
92588
92633
  ) || (this.removeOutput(a, r), a.removeFromParent(r));
92589
92634
  }), i.dataType) {
92590
- const a = te(i.dataType), c = this.project.get(a);
92635
+ const a = te(
92636
+ i.dataType
92637
+ ), c = this.project.get(a);
92591
92638
  c && this.setDataType(c, r);
92592
92639
  } else
92593
92640
  this.setDataType(null, r);
@@ -92624,7 +92671,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92624
92671
  this.id
92625
92672
  ), this;
92626
92673
  if (this.metaSync(i, r), i.parent) {
92627
- const f = te(i.parent), h = this.project.get(f), m = this.parent;
92674
+ const f = te(i.parent), h = this.project.get(
92675
+ f
92676
+ ), m = this.parent;
92628
92677
  if (m && m.id !== (h == null ? void 0 : h.id) && this.removeFromParent(r), h)
92629
92678
  this.setParent(h, r), this.addSelfToProject(r);
92630
92679
  else
@@ -92650,7 +92699,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92650
92699
  } else
92651
92700
  i.readsValue === null && this.removeValueWriter(r);
92652
92701
  return (a = i.calledByEntry) == null || a.forEach((f) => {
92653
- const h = te(f), m = this.project.get(h);
92702
+ const h = te(f), m = this.project.get(
92703
+ h
92704
+ );
92654
92705
  if (m)
92655
92706
  this.addEntryCaller(m, r), m.addCall(this, r);
92656
92707
  else
@@ -92702,7 +92753,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92702
92753
  if (this.initialData.parent) {
92703
92754
  const e = te(
92704
92755
  this.initialData.parent
92705
- ), f = this.project.get(e);
92756
+ ), f = this.project.get(
92757
+ e
92758
+ );
92706
92759
  if (f)
92707
92760
  this.setParent(f, null), i.push(f);
92708
92761
  else
@@ -92710,7 +92763,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92710
92763
  `${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`
92711
92764
  );
92712
92765
  } else
92713
- throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
92766
+ throw new Error(
92767
+ `${this.type} with id '${this.id}' must have a 'parent'`
92768
+ );
92714
92769
  if (this.initialData.readsValue) {
92715
92770
  const e = te(
92716
92771
  this.initialData.readsValue
@@ -92720,7 +92775,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92720
92775
  f && (this.setValueWriter(f, null), i.push(f));
92721
92776
  }
92722
92777
  return this.initialData.calledByEntry.forEach((e) => {
92723
- const f = te(e), h = this.project.get(f);
92778
+ const f = te(e), h = this.project.get(
92779
+ f
92780
+ );
92724
92781
  h && this.addEntryCaller(h, null);
92725
92782
  }), this.initialData.calledBySuccess.forEach((e) => {
92726
92783
  const f = te(e), h = this.project.get(
@@ -92733,9 +92790,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92733
92790
  );
92734
92791
  h && this.addErrorCaller(h, null);
92735
92792
  }), {
92736
- updated: C(i),
92737
- added: C(r),
92738
- removed: C(a),
92793
+ updated: C(
92794
+ i
92795
+ ),
92796
+ added: C(
92797
+ r
92798
+ ),
92799
+ removed: C(
92800
+ a
92801
+ ),
92739
92802
  affected: C(
92740
92803
  c
92741
92804
  ),
@@ -92766,7 +92829,11 @@ Specifically for return statements the parent needs to always be the 'function-d
92766
92829
  self: this
92767
92830
  };
92768
92831
  const r = [], a = [], c = [], e = [];
92769
- if (this.initialized = !0, !this.dataType || this.dataType.inferred, this.readsValue && this.defaultValue && (this.project.diggestedBuiltInBaseEntitiesIds.has(this.defaultValue.id) || this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.setDefaultValue(null, i)), this.defaultValue && !this.readsValue && !this.project.diggestedBuiltInBaseEntitiesIds.has(this.id) && this.project.diggestedBuiltInBaseEntitiesIds.has(this.defaultValue.id)) {
92832
+ if (this.initialized = !0, !this.dataType || this.dataType.inferred, this.readsValue && this.defaultValue && (this.project.diggestedBuiltInBaseEntitiesIds.has(
92833
+ this.defaultValue.id
92834
+ ) || this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.setDefaultValue(null, i)), this.defaultValue && !this.readsValue && !this.project.diggestedBuiltInBaseEntitiesIds.has(this.id) && this.project.diggestedBuiltInBaseEntitiesIds.has(
92835
+ this.defaultValue.id
92836
+ )) {
92770
92837
  const E = this.defaultValue.clone(i, this);
92771
92838
  this.setDefaultValue(E, i);
92772
92839
  }
@@ -92780,9 +92847,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92780
92847
  D.AfterAllChildrenInitialized,
92781
92848
  this.id
92782
92849
  ), {
92783
- updated: C(r),
92784
- added: C(a),
92785
- removed: C(c),
92850
+ updated: C(
92851
+ r
92852
+ ),
92853
+ added: C(
92854
+ a
92855
+ ),
92856
+ removed: C(
92857
+ c
92858
+ ),
92786
92859
  affected: C(
92787
92860
  e
92788
92861
  ),
@@ -92811,9 +92884,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92811
92884
  }), this.parent.addReturnStatement(this), e.push(this.parent), i == null || i.add(this.parent, W.Affected), (f = this.parent) == null || f.returnStatements.forEach((h) => {
92812
92885
  h.id !== this.id && (e.push(h), i == null || i.add(h, W.Affected));
92813
92886
  }), this.subscribe(), this.subscribeToDependencies(), i == null || i.attemptAutoclose("add-self-to-project", this.id), {
92814
- updated: C(r),
92815
- added: C(a),
92816
- removed: C(c),
92887
+ updated: C(
92888
+ r
92889
+ ),
92890
+ added: C(
92891
+ a
92892
+ ),
92893
+ removed: C(
92894
+ c
92895
+ ),
92817
92896
  affected: C(
92818
92897
  e
92819
92898
  ),
@@ -92851,7 +92930,10 @@ Specifically for return statements the parent needs to always be the 'function-d
92851
92930
  owner: this,
92852
92931
  errorReason: Be.CannotSuccessCallItself,
92853
92932
  rootAction: ((c = r == null ? void 0 : r.self) == null ? void 0 : c.id) === this.id && (r == null ? void 0 : r.actionName) === D.AddSuccessCaller
92854
- })), this.calledBySuccess.find((e) => e.id === i.id) || (this.calledBySuccess.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(D.AddSuccessCaller, this.id), this) : this;
92933
+ })), this.calledBySuccess.find((e) => e.id === i.id) || (this.calledBySuccess.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(
92934
+ D.AddSuccessCaller,
92935
+ this.id
92936
+ ), this) : this;
92855
92937
  }
92856
92938
  addErrorCaller(i, r = this.project.addChangeSet(
92857
92939
  new Z(
@@ -92875,7 +92957,10 @@ Specifically for return statements the parent needs to always be the 'function-d
92875
92957
  owner: this,
92876
92958
  errorReason: Be.CannotErrorCallItself,
92877
92959
  rootAction: ((c = r == null ? void 0 : r.self) == null ? void 0 : c.id) === this.id && (r == null ? void 0 : r.actionName) === D.AddErrorCaller
92878
- })), this.calledByError.find((e) => e.id === i.id) || (this.calledByError.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(D.AddErrorCaller, this.id), this) : this;
92960
+ })), this.calledByError.find((e) => e.id === i.id) || (this.calledByError.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(
92961
+ D.AddErrorCaller,
92962
+ this.id
92963
+ ), this) : this;
92879
92964
  }
92880
92965
  addEntryCaller(i, r = this.project.addChangeSet(
92881
92966
  new Z(
@@ -92899,7 +92984,10 @@ Specifically for return statements the parent needs to always be the 'function-d
92899
92984
  owner: this,
92900
92985
  errorReason: Be.CannotEntryCallItself,
92901
92986
  rootAction: ((c = r == null ? void 0 : r.self) == null ? void 0 : c.id) === this.id && (r == null ? void 0 : r.actionName) === D.AddEntryCaller
92902
- })), this.calledByEntry.find((e) => e.id === i.id) || (this.calledByEntry.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(D.AddEntryCaller, this.id), this) : this;
92987
+ })), this.calledByEntry.find((e) => e.id === i.id) || (this.calledByEntry.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(
92988
+ D.AddEntryCaller,
92989
+ this.id
92990
+ ), this) : this;
92903
92991
  }
92904
92992
  removeCaller(i, r = this.project.addChangeSet(
92905
92993
  new Z(
@@ -92967,7 +93055,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92967
93055
  return ce.warn(
92968
93056
  `[removeOutput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
92969
93057
  ), r == null || r.attemptAutoclose("remove-output", this.id), this;
92970
- const a = this.outputs.findIndex((c) => c.id === i.id);
93058
+ const a = this.outputs.findIndex(
93059
+ (c) => c.id === i.id
93060
+ );
92971
93061
  return a > -1 && (this.outputs.splice(a, 1), r && (r == null || r.add(this, W.Affected))), r == null || r.attemptAutoclose("remove-output", this.id), this;
92972
93062
  }
92973
93063
  setParent(i, r = this.project.addChangeSet(
@@ -93009,7 +93099,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93009
93099
  owner: this,
93010
93100
  errorReason: Be.CannotValueWriteItself,
93011
93101
  rootAction: ((a = r == null ? void 0 : r.self) == null ? void 0 : a.id) === this.id && (r == null ? void 0 : r.actionName) === D.SetValueWriter
93012
- })), ((c = this.readsValue) == null ? void 0 : c.id) !== (i == null ? void 0 : i.id) && (this.readsValue = i, this.readsValue && ((e = this.defaultValue) == null || e.remove({ ignoreUpstream: !1 }, r)), this.readsValue && ((f = this.throws) == null || f.remove({ ignoreUpstream: !1 }, r), this.setThrows(null, r)), r == null || r.add(this, W.Updated)), r == null || r.attemptAutoclose(D.SetValueWriter, this.id), this) : this;
93102
+ })), ((c = this.readsValue) == null ? void 0 : c.id) !== (i == null ? void 0 : i.id) && (this.readsValue = i, this.readsValue && ((e = this.defaultValue) == null || e.remove({ ignoreUpstream: !1 }, r)), this.readsValue && ((f = this.throws) == null || f.remove({ ignoreUpstream: !1 }, r), this.setThrows(null, r)), r == null || r.add(this, W.Updated)), r == null || r.attemptAutoclose(
93103
+ D.SetValueWriter,
93104
+ this.id
93105
+ ), this) : this;
93013
93106
  }
93014
93107
  removeValueWriter(i = this.project.addChangeSet(
93015
93108
  new Z(
@@ -93025,7 +93118,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93025
93118
  this,
93026
93119
  D.RemoveValueWriter,
93027
93120
  i
93028
- ) ? this : (this.readsValue && (this.readsValue = null, i == null || i.add(this, W.Updated)), i == null || i.attemptAutoclose(D.RemoveValueWriter, this.id), this);
93121
+ ) ? this : (this.readsValue && (this.readsValue = null, i == null || i.add(this, W.Updated)), i == null || i.attemptAutoclose(
93122
+ D.RemoveValueWriter,
93123
+ this.id
93124
+ ), this);
93029
93125
  }
93030
93126
  initChildren(i = this.project.addChangeSet(
93031
93127
  new Z(
@@ -93138,10 +93234,19 @@ Specifically for return statements the parent needs to always be the 'function-d
93138
93234
  self: this
93139
93235
  };
93140
93236
  const r = [], a = [], c = [], e = [];
93141
- return this.parent.removeReturnStatement(this), e.push(this.parent), i == null || i.attemptAutoclose(D.RemoveFromParent, this.id), {
93142
- added: C(c),
93143
- updated: C(r),
93144
- removed: C(a),
93237
+ return this.parent.removeReturnStatement(this), e.push(this.parent), i == null || i.attemptAutoclose(
93238
+ D.RemoveFromParent,
93239
+ this.id
93240
+ ), {
93241
+ added: C(
93242
+ c
93243
+ ),
93244
+ updated: C(
93245
+ r
93246
+ ),
93247
+ removed: C(
93248
+ a
93249
+ ),
93145
93250
  affected: C(
93146
93251
  e
93147
93252
  ),
@@ -93175,7 +93280,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93175
93280
  owner: this,
93176
93281
  errorReason: Be.ActionOwnerEntityNonDeletable,
93177
93282
  rootAction: ((h = r == null ? void 0 : r.self) == null ? void 0 : h.id) === this.id && (r == null ? void 0 : r.actionName) === D.RemoveEntity
93178
- }), r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
93283
+ }), r == null || r.attemptAutoclose(
93284
+ D.RemoveEntity,
93285
+ this.id
93286
+ ), {
93179
93287
  added: [],
93180
93288
  updated: [],
93181
93289
  removed: [],
@@ -93184,7 +93292,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93184
93292
  };
93185
93293
  const a = [], c = [], e = [], f = [];
93186
93294
  if (r != null && r.hasRemoved(this.id))
93187
- return r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
93295
+ return r == null || r.attemptAutoclose(
93296
+ D.RemoveEntity,
93297
+ this.id
93298
+ ), {
93188
93299
  added: [],
93189
93300
  updated: [],
93190
93301
  removed: [],
@@ -93237,9 +93348,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93237
93348
  return r == null || r.add(this.parent, W.Affected), (m = this.parent) == null || m.returnStatements.forEach((b) => {
93238
93349
  b.id !== this.id && (f.push(b), r == null || r.add(b, W.Affected));
93239
93350
  }), r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
93240
- added: C(e),
93241
- updated: C(a),
93242
- removed: C(c),
93351
+ added: C(
93352
+ e
93353
+ ),
93354
+ updated: C(
93355
+ a
93356
+ ),
93357
+ removed: C(
93358
+ c
93359
+ ),
93243
93360
  affected: C(
93244
93361
  f
93245
93362
  ),
@@ -93262,10 +93379,28 @@ Specifically for return statements the parent needs to always be the 'function-d
93262
93379
  if (!this.checkCanEdit(this, i))
93263
93380
  return ce.warn(
93264
93381
  `[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
93265
- ), i == null || i.attemptAutoclose(D.RestoreEntity, this.id), { added: [], updated: [], removed: [], affected: [], self: this };
93382
+ ), i == null || i.attemptAutoclose(
93383
+ D.RestoreEntity,
93384
+ this.id
93385
+ ), {
93386
+ added: [],
93387
+ updated: [],
93388
+ removed: [],
93389
+ affected: [],
93390
+ self: this
93391
+ };
93266
93392
  const r = [], a = [], c = [], e = [];
93267
93393
  if (i != null && i.hasAdded(this.id))
93268
- return i == null || i.attemptAutoclose(D.RestoreEntity, this.id), { added: [], updated: [], removed: [], affected: [], self: this };
93394
+ return i == null || i.attemptAutoclose(
93395
+ D.RestoreEntity,
93396
+ this.id
93397
+ ), {
93398
+ added: [],
93399
+ updated: [],
93400
+ removed: [],
93401
+ affected: [],
93402
+ self: this
93403
+ };
93269
93404
  if (this.subscribe(), this.project.unsubscribeDeletedInstance(this), this.metaSync({ deleted: !1 }, i), Object.values(this.detachedDependents).forEach((f) => {
93270
93405
  const {
93271
93406
  updated: h,
@@ -93295,9 +93430,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93295
93430
  }), this.calledByEntry.forEach((f) => {
93296
93431
  a.push(f), f.addCall(this, i);
93297
93432
  }), i == null || i.attemptAutoclose(D.RestoreEntity, this.id), {
93298
- added: C(r),
93299
- updated: C(a),
93300
- removed: C(c),
93433
+ added: C(
93434
+ r
93435
+ ),
93436
+ updated: C(
93437
+ a
93438
+ ),
93439
+ removed: C(
93440
+ c
93441
+ ),
93301
93442
  affected: C(
93302
93443
  e
93303
93444
  ),
@@ -93349,14 +93490,20 @@ Specifically for return statements the parent needs to always be the 'function-d
93349
93490
  deletable: this.deletable,
93350
93491
  x: this.x,
93351
93492
  y: this.y,
93352
- defaultValue: ((r = this.defaultValue) == null ? void 0 : r.toJSON(i)) || null,
93493
+ defaultValue: ((r = this.defaultValue) == null ? void 0 : r.toJSON(
93494
+ i
93495
+ )) || null,
93353
93496
  dataType: ((a = this.dataType) == null ? void 0 : a.toJSON(i)) || null,
93354
93497
  readsValue: ((c = this.readsValue) == null ? void 0 : c.toReference()) || null,
93355
93498
  calledBySuccess: this.calledBySuccess.map(
93356
93499
  (h) => h.toReference()
93357
93500
  ),
93358
- calledByError: this.calledByError.map((h) => h.toReference()),
93359
- calledByEntry: this.calledByEntry.map((h) => h.toReference()),
93501
+ calledByError: this.calledByError.map(
93502
+ (h) => h.toReference()
93503
+ ),
93504
+ calledByEntry: this.calledByEntry.map(
93505
+ (h) => h.toReference()
93506
+ ),
93360
93507
  outputs: this.outputs.map(
93361
93508
  (h) => h.toJSON(i)
93362
93509
  ),
@@ -93367,7 +93514,11 @@ Specifically for return statements the parent needs to always be the 'function-d
93367
93514
  toJSONClone(i = lt) {
93368
93515
  var a, c, e, f, h, m, b, E, A, _;
93369
93516
  let r;
93370
- return (a = i.seenEntityMaps) != null && a.has(this.id) ? r = i.seenEntityMaps.get(this.id) : (r = i.newId || fn(this, this.project, i.uuidStrategy), i.seenEntityMaps && i.seenEntityMaps.set(this.id, r)), (c = i.seenEntities) != null && c.has(r) || (e = i.seenEntities) != null && e.has(this.id) ? this.toReference({ seenEntityMaps: i.seenEntityMaps }) : ((f = i.seenEntities) == null || f.add(r), (h = i.seenEntities) == null || h.add(this.id), {
93517
+ return (a = i.seenEntityMaps) != null && a.has(this.id) ? r = i.seenEntityMaps.get(this.id) : (r = i.newId || fn(
93518
+ this,
93519
+ this.project,
93520
+ i.uuidStrategy
93521
+ ), i.seenEntityMaps && i.seenEntityMaps.set(this.id, r)), (c = i.seenEntities) != null && c.has(r) || (e = i.seenEntities) != null && e.has(this.id) ? this.toReference({ seenEntityMaps: i.seenEntityMaps }) : ((f = i.seenEntities) == null || f.add(r), (h = i.seenEntities) == null || h.add(this.id), {
93371
93522
  id: r,
93372
93523
  version: x.UUID.uuid(),
93373
93524
  createdAt: i.timestamp || G().toISOString(),
@@ -93405,7 +93556,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93405
93556
  newId: null
93406
93557
  })
93407
93558
  ),
93408
- parent: ((A = this.parent) == null ? void 0 : A.toReference({ seenEntityMaps: i.seenEntityMaps })) || null,
93559
+ parent: ((A = this.parent) == null ? void 0 : A.toReference({
93560
+ seenEntityMaps: i.seenEntityMaps
93561
+ })) || null,
93409
93562
  throws: ((_ = this.throws) == null ? void 0 : _.toJSONClone({
93410
93563
  ...i,
93411
93564
  newId: null
@@ -93463,7 +93616,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93463
93616
  this.toShallowJSON(),
93464
93617
  ...((a = this.defaultValue) == null ? void 0 : a.toFlatJSON(i)) || [],
93465
93618
  ...((c = this.dataType) == null ? void 0 : c.toFlatJSON(i)) || [],
93466
- ...this.outputs.flatMap((e) => e.toFlatJSON(i)),
93619
+ ...this.outputs.flatMap(
93620
+ (e) => e.toFlatJSON(i)
93621
+ ),
93467
93622
  ...this.throws ? this.throws.toFlatJSON(i) : []
93468
93623
  ]);
93469
93624
  }
@@ -93525,7 +93680,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93525
93680
  a.push(...c);
93526
93681
  }
93527
93682
  if (this.dataType) {
93528
- const c = await this.dataType.getErrorsAsync({ tracker: r });
93683
+ const c = await this.dataType.getErrorsAsync({
93684
+ tracker: r
93685
+ });
93529
93686
  a.push(...c);
93530
93687
  }
93531
93688
  for (const c of this.outputs) {
@@ -93560,7 +93717,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93560
93717
  ), r == null || r.attemptAutoclose("set-default-value", this.id), this;
93561
93718
  const a = this.defaultValue;
93562
93719
  if ((a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id)) {
93563
- if (a == null || a.remove({ ignoreUpstream: !0 }, r), this.defaultValue = i, this.defaultValue) {
93720
+ if (a == null || a.remove(
93721
+ { ignoreUpstream: !0 },
93722
+ r
93723
+ ), this.defaultValue = i, this.defaultValue) {
93564
93724
  const c = this.readsValue;
93565
93725
  this.removeValueWriter(r), c == null || c.removeValueReader(this, r);
93566
93726
  }
@@ -93642,11 +93802,17 @@ Specifically for return statements the parent needs to always be the 'function-d
93642
93802
  };
93643
93803
  const r = [], a = [], c = [], e = [], f = this.getDataType(null);
93644
93804
  return f && !f.isObject() ? [...this.outputs].forEach((m) => {
93645
- const b = m.remove({ ignoreUpstream: !1 }, i);
93805
+ const b = m.remove(
93806
+ { ignoreUpstream: !1 },
93807
+ i
93808
+ );
93646
93809
  c.push(...b.removed), r.push(...b.updated);
93647
93810
  }) : f && f.hasStrictObjectStructure() && [...this.outputs].forEach((m) => {
93648
93811
  if (!m.declaration) {
93649
- const E = m.remove({ ignoreUpstream: !1 }, i);
93812
+ const E = m.remove(
93813
+ { ignoreUpstream: !1 },
93814
+ i
93815
+ );
93650
93816
  c.push(...E.removed), r.push(...E.updated);
93651
93817
  return;
93652
93818
  }
@@ -93660,7 +93826,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93660
93826
  )) || ((N = m.declaration.extends) == null ? void 0 : N.id) == E.id;
93661
93827
  }
93662
93828
  )) {
93663
- const E = m.remove({ ignoreUpstream: !1 }, i);
93829
+ const E = m.remove(
93830
+ { ignoreUpstream: !1 },
93831
+ i
93832
+ );
93664
93833
  c.push(...E.removed), r.push(...E.updated);
93665
93834
  }
93666
93835
  }), this.outputs.filter((m, b) => {
@@ -93678,9 +93847,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93678
93847
  D.RemoveUnrecognizedInputs,
93679
93848
  this.id
93680
93849
  ), {
93681
- updated: C(r),
93682
- added: C(a),
93683
- removed: C(c),
93850
+ updated: C(
93851
+ r
93852
+ ),
93853
+ added: C(
93854
+ a
93855
+ ),
93856
+ removed: C(
93857
+ c
93858
+ ),
93684
93859
  affected: C(
93685
93860
  e
93686
93861
  ),
@@ -93717,7 +93892,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93717
93892
  updated: C(
93718
93893
  r
93719
93894
  ),
93720
- added: C(a),
93895
+ added: C(
93896
+ a
93897
+ ),
93721
93898
  removed: C(
93722
93899
  c
93723
93900
  ),
@@ -93781,7 +93958,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93781
93958
  updated: C(
93782
93959
  r
93783
93960
  ),
93784
- added: C(a),
93961
+ added: C(
93962
+ a
93963
+ ),
93785
93964
  removed: C(
93786
93965
  c
93787
93966
  ),
@@ -93804,9 +93983,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93804
93983
  } = E.afterAllChildrenInitialized(i);
93805
93984
  r.push(...A), a.push(..._), c.push(...N);
93806
93985
  }), this.outputs.sort((E, A) => E.index - A.index), i == null || i.attemptAutoclose("sync-returned-inputs", this.id), {
93807
- updated: C(r),
93808
- added: C(a),
93809
- removed: C(c),
93986
+ updated: C(
93987
+ r
93988
+ ),
93989
+ added: C(
93990
+ a
93991
+ ),
93992
+ removed: C(
93993
+ c
93994
+ ),
93810
93995
  affected: C(
93811
93996
  e
93812
93997
  ),
@@ -93826,9 +94011,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93826
94011
  if (!this.checkCanEdit(this, r))
93827
94012
  return ce.warn(
93828
94013
  `[setDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
93829
- ), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
94014
+ ), r == null || r.attemptAutoclose(
94015
+ D.SetDataType,
94016
+ this.id
94017
+ ), this;
93830
94018
  const a = this.dataType;
93831
- return (a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id) && (a == null || a.remove({ ignoreUpstream: !0 }, r), this.dataType = i, this.subscribeToDependencies(), r == null || r.add(this, W.Affected)), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
94019
+ return (a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id) && (a == null || a.remove(
94020
+ { ignoreUpstream: !0 },
94021
+ r
94022
+ ), this.dataType = i, this.subscribeToDependencies(), r == null || r.add(this, W.Affected)), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
93832
94023
  }
93833
94024
  removeDataType(i = this.project.addChangeSet(
93834
94025
  new Z(
@@ -93840,9 +94031,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93840
94031
  D.RemoveDataType
93841
94032
  )
93842
94033
  )) {
93843
- return this.checkCanEdit(this, i) ? (this.dataType && (this.dataType.remove({ ignoreUpstream: !0 }, i), i == null || i.add(this, W.Affected), this.dataType = null), i == null || i.attemptAutoclose(D.RemoveDataType, this.id), this) : (ce.warn(
94034
+ return this.checkCanEdit(this, i) ? (this.dataType && (this.dataType.remove({ ignoreUpstream: !0 }, i), i == null || i.add(this, W.Affected), this.dataType = null), i == null || i.attemptAutoclose(
94035
+ D.RemoveDataType,
94036
+ this.id
94037
+ ), this) : (ce.warn(
93844
94038
  `[removeDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
93845
- ), i == null || i.attemptAutoclose(D.RemoveDataType, this.id), this);
94039
+ ), i == null || i.attemptAutoclose(
94040
+ D.RemoveDataType,
94041
+ this.id
94042
+ ), this);
93846
94043
  }
93847
94044
  getDataType(i = this.project.addChangeSet(
93848
94045
  new Z(
@@ -105105,9 +105302,9 @@ function* Npi() {
105105
105302
  }
105106
105303
  }
105107
105304
  function Ppi(s, p) {
105108
- const i = new Set(s.map((a) => a.toLowerCase())), r = p > 0 ? "secondary-db" : "main";
105305
+ const i = new Set(s.map((a) => a.toLowerCase())), r = p > 0 ? "secondarydb" : "main";
105109
105306
  for (const a of Npi()) {
105110
- const c = a ? `${r}-${a}` : r;
105307
+ const c = a ? `${r}${a}` : r;
105111
105308
  if (Vpi(c) && !i.has(c))
105112
105309
  return c;
105113
105310
  }
@@ -105121,9 +105318,11 @@ function xpi(s, p) {
105121
105318
  (m) => m.id === ie["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id
105122
105319
  )
105123
105320
  ), r = i.find((h) => {
105124
- const m = h.properties.find((A) => A.implements.find(
105125
- (_) => _.id === ie["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id
105126
- )), b = m == null ? void 0 : m.getDefaultValue();
105321
+ const m = h.properties.find(
105322
+ (A) => A.implements.find(
105323
+ (_) => _.id === ie["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id
105324
+ )
105325
+ ), b = m == null ? void 0 : m.getDefaultValue();
105127
105326
  return (b == null ? void 0 : b.value) === !0;
105128
105327
  });
105129
105328
  if (!r && i.length) {
@@ -105154,7 +105353,10 @@ function xpi(s, p) {
105154
105353
  E,
105155
105354
  s.project
105156
105355
  );
105157
- return A.hydrateAncestors(), A.setParent(m, p), A.addSelfToProject(p), p == null || p.add(A, W.Added), A.initChildren(p), p || A.captureVersion(), {
105356
+ return A.hydrateAncestors(), A.setParent(m, p), A.addSelfToProject(p), p == null || p.add(
105357
+ A,
105358
+ W.Added
105359
+ ), A.initChildren(p), p || A.captureVersion(), {
105158
105360
  newEntities: [A]
105159
105361
  };
105160
105362
  }
@@ -105176,11 +105378,9 @@ function xpi(s, p) {
105176
105378
  return {
105177
105379
  newEntities: []
105178
105380
  };
105179
- const e = c.properties.find(
105180
- (h) => h.implements.find(
105181
- (m) => m.id === ie["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id
105182
- )
105183
- ), f = e == null ? void 0 : e.defaultValue;
105381
+ const e = c.properties.find((h) => h.implements.find(
105382
+ (m) => m.id === ie["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id
105383
+ )), f = e == null ? void 0 : e.defaultValue;
105184
105384
  if (f)
105185
105385
  f.metaSync({ value: !0 }, p);
105186
105386
  else if (e != null && e.dataType) {
@@ -105205,7 +105405,10 @@ function xpi(s, p) {
105205
105405
  h,
105206
105406
  s.project
105207
105407
  );
105208
- m.hydrateAncestors(), m.setParent(e, p), m.addSelfToProject(p), p == null || p.add(m, W.Added), m.initChildren(p), p || m.captureVersion();
105408
+ m.hydrateAncestors(), m.setParent(e, p), m.addSelfToProject(p), p == null || p.add(
105409
+ m,
105410
+ W.Added
105411
+ ), m.initChildren(p), p || m.captureVersion();
105209
105412
  }
105210
105413
  return {
105211
105414
  newEntities: [c]
@@ -105281,7 +105484,10 @@ function $pi(s, p) {
105281
105484
  J,
105282
105485
  s.project
105283
105486
  );
105284
- ee.hydrateAncestors(), ee.setParent(K, p), ee.addSelfToProject(p), p == null || p.add(ee, W.Added), ee.initChildren(p), (K == null ? void 0 : K.defaultValue).setValueAsTypeSingle(U || null, p), r.push(ee), p || ee.captureVersion();
105487
+ ee.hydrateAncestors(), ee.setParent(K, p), ee.addSelfToProject(p), p == null || p.add(
105488
+ ee,
105489
+ W.Added
105490
+ ), ee.initChildren(p), (K == null ? void 0 : K.defaultValue).setValueAsTypeSingle(U || null, p), r.push(ee), p || ee.captureVersion();
105285
105491
  return;
105286
105492
  } else
105287
105493
  K != null && K.defaultValue && !(K != null && K.defaultValue.valueAsTypeSingle) && (K == null || K.defaultValue.setValueAsTypeSingle(
@@ -105316,7 +105522,10 @@ function $pi(s, p) {
105316
105522
  const oe = s.project.getBuiltIn(
105317
105523
  ie["primitive-entity"].number.id
105318
105524
  );
105319
- (m = se.dataType) == null || m.setEntity(oe, p), re && (p || (b = se.dataType) == null || b.captureVersion());
105525
+ (m = se.dataType) == null || m.setEntity(
105526
+ oe,
105527
+ p
105528
+ ), re && (p || (b = se.dataType) == null || b.captureVersion());
105320
105529
  return;
105321
105530
  }
105322
105531
  case ie["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id: {
@@ -105360,7 +105569,10 @@ function $pi(s, p) {
105360
105569
  ae,
105361
105570
  s.project
105362
105571
  );
105363
- ye.hydrateAncestors(), ye.setParent(Y, p), ye.addSelfToProject(p), p == null || p.add(
105572
+ ye.hydrateAncestors(), ye.setParent(
105573
+ Y,
105574
+ p
105575
+ ), ye.addSelfToProject(p), p == null || p.add(
105364
105576
  ye,
105365
105577
  W.Added
105366
105578
  ), ye.initChildren(p), z = !0;
@@ -105384,7 +105596,13 @@ function $pi(s, p) {
105384
105596
  Y,
105385
105597
  s.project
105386
105598
  );
105387
- z.hydrateAncestors(), z.setParent(K, p), z.addSelfToProject(p), p == null || p.add(z, W.Added), z.initChildren(p), re = !0;
105599
+ z.hydrateAncestors(), z.setParent(
105600
+ K,
105601
+ p
105602
+ ), z.addSelfToProject(p), p == null || p.add(
105603
+ z,
105604
+ W.Added
105605
+ ), z.initChildren(p), re = !0;
105388
105606
  }
105389
105607
  const oe = Ppi(
105390
105608
  U,
@@ -105411,7 +105629,10 @@ function $pi(s, p) {
105411
105629
  Y,
105412
105630
  s.project
105413
105631
  );
105414
- z.hydrateAncestors(), z.setParent(J, p), z.addSelfToProject(p), p == null || p.add(
105632
+ z.hydrateAncestors(), z.setParent(
105633
+ J,
105634
+ p
105635
+ ), z.addSelfToProject(p), p == null || p.add(
105415
105636
  z,
105416
105637
  W.Added
105417
105638
  ), z.initChildren(p), r.push(z), ee = !0;
@@ -105439,7 +105660,12 @@ function $pi(s, p) {
105439
105660
  re.parent = M.toReference(), re.name = fe.Date, re.id = x.UUID.uuid(), U = ge(
105440
105661
  re,
105441
105662
  s.project
105442
- ), U.hydrateAncestors(), U.setParent(M, p), U.addSelfToProject(p), U.initChildren(p), p == null || p.add(
105663
+ ), U.hydrateAncestors(), U.setParent(
105664
+ M,
105665
+ p
105666
+ ), U.addSelfToProject(
105667
+ p
105668
+ ), U.initChildren(p), p == null || p.add(
105443
105669
  U,
105444
105670
  W.Added
105445
105671
  );
@@ -105462,9 +105688,11 @@ function $pi(s, p) {
105462
105688
  },
105463
105689
  p
105464
105690
  );
105465
- const K = s.properties.find((re) => re.implements.find(
105466
- (oe) => oe.id === ie["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.definition.id
105467
- ));
105691
+ const K = s.properties.find(
105692
+ (re) => re.implements.find(
105693
+ (oe) => oe.id === ie["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.definition.id
105694
+ )
105695
+ );
105468
105696
  if (!K)
105469
105697
  throw new Error(
105470
105698
  `[handleAfterEntityImplementationSideEffects] Definition property not found for implemented base entity ${ie["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${s.id}`
@@ -105478,7 +105706,11 @@ function $pi(s, p) {
105478
105706
  ), se.hydrateAncestors(), se.setParent(
105479
105707
  K,
105480
105708
  p
105481
- ), se.addSelfToProject(p), se.initChildren(p), p == null || p.add(
105709
+ ), se.addSelfToProject(
105710
+ p
105711
+ ), se.initChildren(
105712
+ p
105713
+ ), p == null || p.add(
105482
105714
  se,
105483
105715
  W.Added
105484
105716
  );
@@ -105487,10 +105719,16 @@ function $pi(s, p) {
105487
105719
  }
105488
105720
  }), {
105489
105721
  self: s,
105490
- updated: C(i),
105722
+ updated: C(
105723
+ i
105724
+ ),
105491
105725
  added: C(r),
105492
- removed: C(a),
105493
- affected: C(c)
105726
+ removed: C(
105727
+ a
105728
+ ),
105729
+ affected: C(
105730
+ c
105731
+ )
105494
105732
  };
105495
105733
  }
105496
105734
  function tV(s, p, i, r) {
@@ -105506,7 +105744,11 @@ function tV(s, p, i, r) {
105506
105744
  }
105507
105745
  function VK(s, p) {
105508
105746
  return p.entities.find((a) => {
105509
- const c = a.properties, e = c.map((E) => E.name), f = s.every((E) => e.includes(E)), h = e.filter((E) => !s.includes(E)), m = c.every(
105747
+ const c = a.properties, e = c.map((E) => E.name), f = s.every(
105748
+ (E) => e.includes(E)
105749
+ ), h = e.filter(
105750
+ (E) => !s.includes(E)
105751
+ ), m = c.every(
105510
105752
  (E) => !h.includes(E.name) || !E.required
105511
105753
  );
105512
105754
  return f && m;
@@ -105520,10 +105762,16 @@ function Lpi(s, p, i, r = Ye.OrDataTypeGroup) {
105520
105762
  s.project
105521
105763
  );
105522
105764
  return c.push(b), b.setParent(p, i), b.addSelfToProject(i), i == null || i.add(b, W.Added), b.setEntity(s, i), b.initChildren(i), i || b.captureVersion(), {
105523
- updated: C(a),
105765
+ updated: C(
105766
+ a
105767
+ ),
105524
105768
  added: C(c),
105525
- removed: C(e),
105526
- affected: C(f),
105769
+ removed: C(
105770
+ e
105771
+ ),
105772
+ affected: C(
105773
+ f
105774
+ ),
105527
105775
  self: b
105528
105776
  };
105529
105777
  }
@@ -105580,7 +105828,9 @@ function NK(s, p, i, r, a) {
105580
105828
  r
105581
105829
  ), s.length > 0) {
105582
105830
  const K = s.slice(0, 5).filter((re) => re !== void 0);
105583
- if (K.every((re) => typeof re == typeof K[0]) && (typeof K[0] != "object" || K[0] === null))
105831
+ if (K.every(
105832
+ (re) => typeof re == typeof K[0]
105833
+ ) && (typeof K[0] != "object" || K[0] === null))
105584
105834
  switch (typeof K[0]) {
105585
105835
  case "string":
105586
105836
  p.setEntity(
@@ -105631,7 +105881,13 @@ function NK(s, p, i, r, a) {
105631
105881
  r,
105632
105882
  a
105633
105883
  );
105634
- ye.hasCreated && re.push((le = ye.changeSet) == null ? void 0 : le.self), c.push(...(Y = ye.changeSet) == null ? void 0 : Y.updated), e.push(...(z = ye.changeSet) == null ? void 0 : z.added), f.push(...(ae = ye.changeSet) == null ? void 0 : ae.removed);
105884
+ ye.hasCreated && re.push(
105885
+ (le = ye.changeSet) == null ? void 0 : le.self
105886
+ ), c.push(
105887
+ ...(Y = ye.changeSet) == null ? void 0 : Y.updated
105888
+ ), e.push(...(z = ye.changeSet) == null ? void 0 : z.added), f.push(
105889
+ ...(ae = ye.changeSet) == null ? void 0 : ae.removed
105890
+ );
105635
105891
  }
105636
105892
  });
105637
105893
  const J = C(
@@ -105645,7 +105901,10 @@ function NK(s, p, i, r, a) {
105645
105901
  le,
105646
105902
  p.project
105647
105903
  );
105648
- switch (Y.hydrateAncestors(), Y.setParent(p, r), Y.addSelfToProject(r), r == null || r.add(
105904
+ switch (Y.hydrateAncestors(), Y.setParent(
105905
+ p,
105906
+ r
105907
+ ), Y.addSelfToProject(r), r == null || r.add(
105649
105908
  Y,
105650
105909
  W.Added
105651
105910
  ), Y.initChildren(r), typeof ee) {
@@ -105686,7 +105945,10 @@ function NK(s, p, i, r, a) {
105686
105945
  });
105687
105946
  break;
105688
105947
  } else
105689
- J.length === 1 && !oe ? p.setEntity(J[0], r) : K.forEach((ee) => {
105948
+ J.length === 1 && !oe ? p.setEntity(
105949
+ J[0],
105950
+ r
105951
+ ) : K.forEach((ee) => {
105690
105952
  if (typeof ee == "object" && !Array.isArray(ee) && ee !== null) {
105691
105953
  const le = VK(
105692
105954
  Object.keys(ee),
@@ -105708,7 +105970,10 @@ function NK(s, p, i, r, a) {
105708
105970
  le,
105709
105971
  p.project
105710
105972
  );
105711
- Y.hydrateAncestors(), Y.setParent(p, r), Y.addSelfToProject(r), r == null || r.add(
105973
+ Y.hydrateAncestors(), Y.setParent(
105974
+ p,
105975
+ r
105976
+ ), Y.addSelfToProject(r), r == null || r.add(
105712
105977
  Y,
105713
105978
  W.Added
105714
105979
  ), Y.initChildren(r);
@@ -105736,7 +106001,10 @@ function NK(s, p, i, r, a) {
105736
106001
  r,
105737
106002
  a
105738
106003
  );
105739
- p.setEntity((m = K.changeSet) == null ? void 0 : m.self, r), c.push(...(b = K.changeSet) == null ? void 0 : b.updated), e.push(...(E = K.changeSet) == null ? void 0 : E.added), f.push(...(A = K.changeSet) == null ? void 0 : A.removed);
106004
+ p.setEntity(
106005
+ (m = K.changeSet) == null ? void 0 : m.self,
106006
+ r
106007
+ ), c.push(...(b = K.changeSet) == null ? void 0 : b.updated), e.push(...(E = K.changeSet) == null ? void 0 : E.added), f.push(...(A = K.changeSet) == null ? void 0 : A.removed);
105740
106008
  break;
105741
106009
  }
105742
106010
  else {
@@ -105749,15 +106017,24 @@ function NK(s, p, i, r, a) {
105749
106017
  r,
105750
106018
  a
105751
106019
  );
105752
- p.setEntity((_ = K.changeSet) == null ? void 0 : _.self, r), c.push(...(N = K.changeSet) == null ? void 0 : N.updated), e.push(...(V = K.changeSet) == null ? void 0 : V.added), f.push(...(B = K.changeSet) == null ? void 0 : B.removed);
106020
+ p.setEntity(
106021
+ (_ = K.changeSet) == null ? void 0 : _.self,
106022
+ r
106023
+ ), c.push(...(N = K.changeSet) == null ? void 0 : N.updated), e.push(...(V = K.changeSet) == null ? void 0 : V.added), f.push(...(B = K.changeSet) == null ? void 0 : B.removed);
105753
106024
  break;
105754
106025
  }
105755
106026
  }
105756
106027
  return {
105757
- updated: C(c),
106028
+ updated: C(
106029
+ c
106030
+ ),
105758
106031
  added: C(e),
105759
- removed: C(f),
105760
- affected: C(h),
106032
+ removed: C(
106033
+ f
106034
+ ),
106035
+ affected: C(
106036
+ h
106037
+ ),
105761
106038
  self: p
105762
106039
  };
105763
106040
  }
@@ -105834,9 +106111,15 @@ function vD(s, p, i, r, a) {
105834
106111
  }), r || N.captureVersion(), {
105835
106112
  hasCreated: !0,
105836
106113
  changeSet: {
105837
- updated: C(c),
105838
- added: C(e),
105839
- removed: C(f),
106114
+ updated: C(
106115
+ c
106116
+ ),
106117
+ added: C(
106118
+ e
106119
+ ),
106120
+ removed: C(
106121
+ f
106122
+ ),
105840
106123
  affected: C(
105841
106124
  h
105842
106125
  ),
@@ -139857,12 +140140,16 @@ const Ci = class Ci extends an {
139857
140140
  );
139858
140141
  let h = null;
139859
140142
  if (i.declaration) {
139860
- const A = te(i.declaration);
140143
+ const A = te(
140144
+ i.declaration
140145
+ );
139861
140146
  h = r.get(A);
139862
140147
  }
139863
140148
  let m = null;
139864
140149
  if (i.readsValue) {
139865
- const A = te(i.readsValue);
140150
+ const A = te(
140151
+ i.readsValue
140152
+ );
139866
140153
  m = r.get(
139867
140154
  A
139868
140155
  );
@@ -139904,7 +140191,10 @@ const Ci = class Ci extends an {
139904
140191
  {
139905
140192
  parent: {
139906
140193
  list: !1,
139907
- types: [...Vt, ...Ot]
140194
+ types: [
140195
+ ...Vt,
140196
+ ...Ot
140197
+ ]
139908
140198
  }
139909
140199
  },
139910
140200
  r
@@ -139961,9 +140251,11 @@ Only 'function-call', 'search' and 'internal-call' entities can have input-maps
139961
140251
  The parent entity of type '${h.type}' with id '${h.id}' is not compatible with this type of declaration.
139962
140252
  Only variables or terminations ('${It([...kt, ...Ot], "', '", "' or '")}') can have input-maps whose 'declaration' points to 'property' entities.`
139963
140253
  })
139964
- ) : h && m.type === d.ValueDescriptor && ![d.Condition, d.Operation, d.Loop].includes(
139965
- h.type
139966
- ) && e.push(
140254
+ ) : h && m.type === d.ValueDescriptor && ![
140255
+ d.Condition,
140256
+ d.Operation,
140257
+ d.Loop
140258
+ ].includes(h.type) && e.push(
139967
140259
  new De({
139968
140260
  id: `${a.id}--${Te.InvalidInputMapDeclaration}`,
139969
140261
  code: Te.InvalidInputMapDeclaration,
@@ -139996,7 +140288,11 @@ This is because a dynamically assembled object can have new properties added to
139996
140288
  severity: ve.Error,
139997
140289
  message: `Entity of type '${d.InputMap}' with id '${a.id}' has a 'declaration' property that points to an entity with id '${a.declaration}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`
139998
140290
  })
139999
- ) : (![...kt, ...Ot].includes(h.type) || [...kt, ...Ot].includes(h.type) && !((A = h.getDataType(null)) != null && A.canModifyObjectStructure())) && e.push(
140291
+ ) : (![...kt, ...Ot].includes(
140292
+ h.type
140293
+ ) || [...kt, ...Ot].includes(
140294
+ h.type
140295
+ ) && !((A = h.getDataType(null)) != null && A.canModifyObjectStructure())) && e.push(
140000
140296
  new De({
140001
140297
  id: `${a.id}--${Te.InvalidInputMapDeclaration}`,
140002
140298
  code: Te.InvalidInputMapDeclaration,
@@ -140033,7 +140329,9 @@ This means it can hold a function-call or operation as its value, to be executed
140033
140329
  Input maps can only be added to variables which hold an entity with properties.`
140034
140330
  })
140035
140331
  );
140036
- else if (U && !(M != null && M.inferred) && !U.properties.find((se) => se.id === m.id)) {
140332
+ else if (U && !(M != null && M.inferred) && !U.properties.find(
140333
+ (se) => se.id === m.id
140334
+ )) {
140037
140335
  const se = U.properties;
140038
140336
  let re = `
140039
140337
  The parent ${h.type} has a data-type that references an entity with `;
@@ -140069,7 +140367,9 @@ This means it can hold a function-call or operation as its value, to be executed
140069
140367
  Input maps can only be added to variables which hold an entity with properties.`
140070
140368
  })
140071
140369
  );
140072
- else if (U && !(M != null && M.inferred) && !U.properties.find((se) => se.id === m.id)) {
140370
+ else if (U && !(M != null && M.inferred) && !U.properties.find(
140371
+ (se) => se.id === m.id
140372
+ )) {
140073
140373
  const se = U.properties;
140074
140374
  let re = `
140075
140375
  The parent ${h.type} has a data-type that references an entity with `;
@@ -140114,7 +140414,10 @@ ${U}`
140114
140414
  const E = sn(
140115
140415
  a
140116
140416
  );
140117
- return e.push(...f.errors, ...E.errors), c.push(...E.explanations), {
140417
+ return e.push(
140418
+ ...f.errors,
140419
+ ...E.errors
140420
+ ), c.push(...E.explanations), {
140118
140421
  errors: e,
140119
140422
  explanations: c,
140120
140423
  modifiedData: a
@@ -140171,9 +140474,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140171
140474
  const h = f.entity.afterAllChildrenInitialized(i);
140172
140475
  r.push(...h.updated), a.push(...h.added), c.push(...h.removed), e.push(...h.affected);
140173
140476
  }), i == null || i.attemptAutoclose("sync-dependents", this.id), {
140174
- updated: C(r),
140175
- added: C(a),
140176
- removed: C(c),
140477
+ updated: C(
140478
+ r
140479
+ ),
140480
+ added: C(
140481
+ a
140482
+ ),
140483
+ removed: C(
140484
+ c
140485
+ ),
140177
140486
  affected: C(
140178
140487
  e
140179
140488
  ),
@@ -140193,9 +140502,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140193
140502
  c.push(...m), e.push(...b), f.push(...E);
140194
140503
  }
140195
140504
  return {
140196
- updated: C(c),
140197
- added: C(e),
140198
- removed: C(f),
140505
+ updated: C(
140506
+ c
140507
+ ),
140508
+ added: C(
140509
+ e
140510
+ ),
140511
+ removed: C(
140512
+ f
140513
+ ),
140199
140514
  affected: C(
140200
140515
  h
140201
140516
  ),
@@ -140215,9 +140530,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140215
140530
  c.push(...m), e.push(...b), f.push(...E);
140216
140531
  }
140217
140532
  return {
140218
- updated: C(c),
140219
- added: C(e),
140220
- removed: C(f),
140533
+ updated: C(
140534
+ c
140535
+ ),
140536
+ added: C(
140537
+ e
140538
+ ),
140539
+ removed: C(
140540
+ f
140541
+ ),
140221
140542
  affected: C(
140222
140543
  h
140223
140544
  ),
@@ -140295,7 +140616,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140295
140616
  return this.knownVersions = this.knownVersions ? this.knownVersions.set(this.version, i) : (/* @__PURE__ */ new Map()).set(this.version, i), this.apply(i), this;
140296
140617
  }
140297
140618
  snapshot() {
140298
- const i = new Ci(this, this.project);
140619
+ const i = new Ci(
140620
+ this,
140621
+ this.project
140622
+ );
140299
140623
  return this.apply(i);
140300
140624
  }
140301
140625
  /**
@@ -140318,9 +140642,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140318
140642
  r.push(this.parent, ...f.updated), a.push(...f.added), c.push(...f.removed);
140319
140643
  }
140320
140644
  return {
140321
- updated: C(r),
140322
- added: C(a),
140323
- removed: C(c),
140645
+ updated: C(
140646
+ r
140647
+ ),
140648
+ added: C(
140649
+ a
140650
+ ),
140651
+ removed: C(
140652
+ c
140653
+ ),
140324
140654
  affected: C(
140325
140655
  e
140326
140656
  ),
@@ -140343,7 +140673,9 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140343
140673
  updated: C(
140344
140674
  a
140345
140675
  ),
140346
- added: C(c),
140676
+ added: C(
140677
+ c
140678
+ ),
140347
140679
  removed: C(
140348
140680
  e
140349
140681
  ),
@@ -140379,9 +140711,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140379
140711
  );
140380
140712
  }
140381
140713
  return this.metaSync(h.toShallowJSON(), null), this.previousVersion = h.previousVersion, this.version = h.version, this.createdAt = h.createdAt, this.author = h.author, this.deleted = h.deleted, this.declaration = h.declaration, this.defaultValue = h.defaultValue, this.readsValue = h.readsValue, this.dataType = h.dataType, this.parent = h.parent, {
140382
- updated: C(a),
140383
- added: C(c),
140384
- removed: C(e),
140714
+ updated: C(
140715
+ a
140716
+ ),
140717
+ added: C(
140718
+ c
140719
+ ),
140720
+ removed: C(
140721
+ e
140722
+ ),
140385
140723
  affected: C(
140386
140724
  f
140387
140725
  ),
@@ -140422,7 +140760,9 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140422
140760
  throw r == null || r.attemptAutoclose(
140423
140761
  D.UpdateWithShallowTransfer,
140424
140762
  this.id
140425
- ), new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
140763
+ ), new Error(
140764
+ `${this.type} with id '${this.id}' must have a 'parent'`
140765
+ );
140426
140766
  if (i.readsValue) {
140427
140767
  const a = te(
140428
140768
  i.readsValue
@@ -140440,7 +140780,9 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140440
140780
  } else
140441
140781
  this.setDeclaration(null, r);
140442
140782
  if (i.dataType) {
140443
- const a = te(i.dataType), c = this.project.get(a);
140783
+ const a = te(
140784
+ i.dataType
140785
+ ), c = this.project.get(a);
140444
140786
  c && this.setDataType(c, r);
140445
140787
  } else
140446
140788
  this.setDataType(null, r);
@@ -140535,7 +140877,9 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140535
140877
  `${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`
140536
140878
  );
140537
140879
  } else
140538
- throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
140880
+ throw new Error(
140881
+ `${this.type} with id '${this.id}' must have a 'parent'`
140882
+ );
140539
140883
  if (this.initialData.readsValue) {
140540
140884
  const e = te(
140541
140885
  this.initialData.readsValue
@@ -140551,9 +140895,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140551
140895
  f && (this.setDeclaration(f, null), i.push(f));
140552
140896
  }
140553
140897
  return {
140554
- updated: C(i),
140555
- added: C(r),
140556
- removed: C(a),
140898
+ updated: C(
140899
+ i
140900
+ ),
140901
+ added: C(
140902
+ r
140903
+ ),
140904
+ removed: C(
140905
+ a
140906
+ ),
140557
140907
  affected: C(
140558
140908
  c
140559
140909
  ),
@@ -140590,11 +140940,20 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140590
140940
  const h = (Ot.includes(this.parent.type) ? this.parent.outputs : this.parent.inputs).filter((V) => !V.deleted && V.id !== this.id);
140591
140941
  h.length && (f > h.length + 1 ? f = h.length : f < 0 && (f = 0)), h.find(
140592
140942
  (V) => (V.index || 0) === f && !V.deleted
140593
- ) && h.filter((V) => (V.index || 0) >= f && !V.deleted).forEach((V) => {
140594
- V.metaSync({ index: (V.index || 0) + 1 }, i), i == null || i.add(V, W.Updated), r.push(V);
140943
+ ) && h.filter(
140944
+ (V) => (V.index || 0) >= f && !V.deleted
140945
+ ).forEach((V) => {
140946
+ V.metaSync(
140947
+ { index: (V.index || 0) + 1 },
140948
+ i
140949
+ ), i == null || i.add(V, W.Updated), r.push(V);
140595
140950
  });
140596
140951
  const b = this.parent.type === d.VariableInstance && ((A = this.declaration) == null ? void 0 : A.type) === d.Property && ((_ = this.declaration) == null ? void 0 : _.constant);
140597
- if (b && this.readsValue && (this.readsValue.removeValueReader(this, i), this.removeValueWriter(i)), b && this.defaultValue && this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.readsValue && this.defaultValue && (this.project.diggestedBuiltInBaseEntitiesIds.has(this.defaultValue.id) || this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.setDefaultValue(null, i)), this.defaultValue && !this.readsValue && !this.project.diggestedBuiltInBaseEntitiesIds.has(this.id) && this.project.diggestedBuiltInBaseEntitiesIds.has(this.defaultValue.id)) {
140952
+ if (b && this.readsValue && (this.readsValue.removeValueReader(this, i), this.removeValueWriter(i)), b && this.defaultValue && this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.readsValue && this.defaultValue && (this.project.diggestedBuiltInBaseEntitiesIds.has(
140953
+ this.defaultValue.id
140954
+ ) || this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.setDefaultValue(null, i)), this.defaultValue && !this.readsValue && !this.project.diggestedBuiltInBaseEntitiesIds.has(this.id) && this.project.diggestedBuiltInBaseEntitiesIds.has(
140955
+ this.defaultValue.id
140956
+ )) {
140598
140957
  const V = this.defaultValue.clone(i, this);
140599
140958
  this.setDefaultValue(V, i);
140600
140959
  }
@@ -140613,9 +140972,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140613
140972
  D.AfterAllChildrenInitialized,
140614
140973
  this.id
140615
140974
  ), {
140616
- updated: C(r),
140617
- added: C(a),
140618
- removed: C(c),
140975
+ updated: C(
140976
+ r
140977
+ ),
140978
+ added: C(
140979
+ a
140980
+ ),
140981
+ removed: C(
140982
+ c
140983
+ ),
140619
140984
  affected: C(
140620
140985
  e
140621
140986
  ),
@@ -140635,13 +141000,25 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140635
141000
  )) {
140636
141001
  var f;
140637
141002
  const r = [this], a = [], c = [], e = [];
140638
- return Ot.includes(this.parent.type) ? this.parentRelationType === Fd.Error ? this.parent.setThrows(this, i) : this.parent.addOutput(this, i) : this.parent.addInput(
141003
+ return Ot.includes(this.parent.type) ? this.parentRelationType === Fd.Error ? this.parent.setThrows(
141004
+ this,
141005
+ i
141006
+ ) : this.parent.addOutput(
141007
+ this,
141008
+ i
141009
+ ) : this.parent.addInput(
140639
141010
  this,
140640
141011
  i
140641
141012
  ), e.push(this.parent), (f = this.readsValue) == null || f.addValueReader(this, i), this.readsValue && r.push(this.readsValue), this.subscribe(), this.subscribeToDependencies(), i == null || i.attemptAutoclose("add-self-to-project", this.id), {
140642
- updated: C(r),
140643
- added: C(a),
140644
- removed: C(c),
141013
+ updated: C(
141014
+ r
141015
+ ),
141016
+ added: C(
141017
+ a
141018
+ ),
141019
+ removed: C(
141020
+ c
141021
+ ),
140645
141022
  affected: C(
140646
141023
  e
140647
141024
  ),
@@ -140679,9 +141056,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140679
141056
  if (!this.checkCanEdit(this, r))
140680
141057
  return ce.warn(
140681
141058
  `[setDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
140682
- ), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
141059
+ ), r == null || r.attemptAutoclose(
141060
+ D.SetDataType,
141061
+ this.id
141062
+ ), this;
140683
141063
  const a = this.dataType;
140684
- return (a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id) && (a == null || a.remove({ ignoreUpstream: !0 }, r), this.dataType = i, this.subscribeToDependencies(), r == null || r.add(this, W.Affected)), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
141064
+ return (a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id) && (a == null || a.remove(
141065
+ { ignoreUpstream: !0 },
141066
+ r
141067
+ ), this.dataType = i, this.subscribeToDependencies(), r == null || r.add(this, W.Affected)), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
140685
141068
  }
140686
141069
  removeDataType(i = this.project.addChangeSet(
140687
141070
  new Z(
@@ -140693,9 +141076,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140693
141076
  D.RemoveDataType
140694
141077
  )
140695
141078
  )) {
140696
- return this.checkCanEdit(this, i) ? (this.dataType && (this.dataType.remove({ ignoreUpstream: !0 }, i), i == null || i.add(this, W.Affected), this.dataType = null), i == null || i.attemptAutoclose(D.RemoveDataType, this.id), this) : (ce.warn(
141079
+ return this.checkCanEdit(this, i) ? (this.dataType && (this.dataType.remove({ ignoreUpstream: !0 }, i), i == null || i.add(this, W.Affected), this.dataType = null), i == null || i.attemptAutoclose(
141080
+ D.RemoveDataType,
141081
+ this.id
141082
+ ), this) : (ce.warn(
140697
141083
  `[removeDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
140698
- ), i == null || i.attemptAutoclose(D.RemoveDataType, this.id), this);
141084
+ ), i == null || i.attemptAutoclose(
141085
+ D.RemoveDataType,
141086
+ this.id
141087
+ ), this);
140699
141088
  }
140700
141089
  setDeclaration(i, r = this.project.addChangeSet(
140701
141090
  new Z(
@@ -140756,7 +141145,13 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140756
141145
  counterpart: i,
140757
141146
  errorReason: Be.ValueReadingOverridesConstantVariable,
140758
141147
  rootAction: ((h = r == null ? void 0 : r.self) == null ? void 0 : h.id) === this.id && (r == null ? void 0 : r.actionName) === D.SetValueWriter
140759
- }), r == null || r.attemptAutoclose(D.SetValueWriter, this.id), this) : (((m = this.readsValue) == null ? void 0 : m.id) !== (i == null ? void 0 : i.id) && (this.readsValue = i, this.readsValue && ((b = this.defaultValue) == null || b.remove({ ignoreUpstream: !1 }, r), this.parent.type === d.Search && ((E = this.declaration) == null || E.setDefaultValue(null, r))), r == null || r.add(this, W.Updated)), r == null || r.attemptAutoclose(D.SetValueWriter, this.id), this)) : this;
141148
+ }), r == null || r.attemptAutoclose(
141149
+ D.SetValueWriter,
141150
+ this.id
141151
+ ), this) : (((m = this.readsValue) == null ? void 0 : m.id) !== (i == null ? void 0 : i.id) && (this.readsValue = i, this.readsValue && ((b = this.defaultValue) == null || b.remove({ ignoreUpstream: !1 }, r), this.parent.type === d.Search && ((E = this.declaration) == null || E.setDefaultValue(null, r))), r == null || r.add(this, W.Updated)), r == null || r.attemptAutoclose(
141152
+ D.SetValueWriter,
141153
+ this.id
141154
+ ), this)) : this;
140760
141155
  }
140761
141156
  removeValueWriter(i = this.project.addChangeSet(
140762
141157
  new Z(
@@ -140772,7 +141167,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140772
141167
  this,
140773
141168
  D.RemoveValueWriter,
140774
141169
  i
140775
- ) ? this : (this.readsValue && (this.readsValue = null, i == null || i.add(this, W.Updated)), i == null || i.attemptAutoclose(D.RemoveValueWriter, this.id), this);
141170
+ ) ? this : (this.readsValue && (this.readsValue = null, i == null || i.add(this, W.Updated)), i == null || i.attemptAutoclose(
141171
+ D.RemoveValueWriter,
141172
+ this.id
141173
+ ), this);
140776
141174
  }
140777
141175
  subscribe() {
140778
141176
  var i;
@@ -140856,16 +141254,28 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140856
141254
  self: this
140857
141255
  };
140858
141256
  const r = [], a = [], c = [], e = [];
140859
- return Ot.includes((f = this.parent) == null ? void 0 : f.type) ? this.parentRelationType === Fd.Error ? (this.parent.setThrows(null, i), e.push(this.parent)) : (this.parent.removeOutput(
141257
+ return Ot.includes((f = this.parent) == null ? void 0 : f.type) ? this.parentRelationType === Fd.Error ? (this.parent.setThrows(
141258
+ null,
141259
+ i
141260
+ ), e.push(this.parent)) : (this.parent.removeOutput(
140860
141261
  this,
140861
141262
  i
140862
141263
  ), e.push(this.parent)) : (this.parent.removeInput(
140863
141264
  this,
140864
141265
  i
140865
- ), e.push(this.parent)), i == null || i.attemptAutoclose(D.RemoveFromParent, this.id), {
140866
- added: C(c),
140867
- updated: C(r),
140868
- removed: C(a),
141266
+ ), e.push(this.parent)), i == null || i.attemptAutoclose(
141267
+ D.RemoveFromParent,
141268
+ this.id
141269
+ ), {
141270
+ added: C(
141271
+ c
141272
+ ),
141273
+ updated: C(
141274
+ r
141275
+ ),
141276
+ removed: C(
141277
+ a
141278
+ ),
140869
141279
  affected: C(
140870
141280
  e
140871
141281
  ),
@@ -140891,7 +141301,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140891
141301
  )) {
140892
141302
  var h, m, b, E, A;
140893
141303
  if (this.deleted)
140894
- return r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
141304
+ return r == null || r.attemptAutoclose(
141305
+ D.RemoveEntity,
141306
+ this.id
141307
+ ), {
140895
141308
  added: [],
140896
141309
  updated: [],
140897
141310
  removed: [],
@@ -140907,7 +141320,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140907
141320
  owner: this,
140908
141321
  errorReason: Be.ActionOwnerEntityNonDeletable,
140909
141322
  rootAction: ((h = r == null ? void 0 : r.self) == null ? void 0 : h.id) === this.id && (r == null ? void 0 : r.actionName) === D.RemoveEntity
140910
- }), r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
141323
+ }), r == null || r.attemptAutoclose(
141324
+ D.RemoveEntity,
141325
+ this.id
141326
+ ), {
140911
141327
  added: [],
140912
141328
  updated: [],
140913
141329
  removed: [],
@@ -140916,7 +141332,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140916
141332
  };
140917
141333
  const a = [], c = [], e = [], f = [];
140918
141334
  if (r != null && r.hasRemoved(this.id))
140919
- return r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
141335
+ return r == null || r.attemptAutoclose(
141336
+ D.RemoveEntity,
141337
+ this.id
141338
+ ), {
140920
141339
  added: [],
140921
141340
  updated: [],
140922
141341
  removed: [],
@@ -140946,15 +141365,25 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140946
141365
  if (this.readsValue && (a.push(this.readsValue), this.readsValue.removeValueReader(this, r)), this.defaultValue && (a.push(this.defaultValue), this.defaultValue.remove({ ignoreUpstream: !0 }, r)), this.declaration) {
140947
141366
  if (
140948
141367
  // If the declaration is a property, aprt of an inferred, dynamic data type entity, we delete the property too
140949
- this.declaration.type === d.Property && ((m = this.declaration.parent) == null ? void 0 : m.type) === d.DefinitionEntity && ((E = (b = this.declaration.parent) == null ? void 0 : b.parent) == null ? void 0 : E.type) === d.DataType && !(r != null && r.hasRemoved(this.declaration.id)) && !this.declaration.deleted
141368
+ this.declaration.type === d.Property && ((m = this.declaration.parent) == null ? void 0 : m.type) === d.DefinitionEntity && ((E = (b = this.declaration.parent) == null ? void 0 : b.parent) == null ? void 0 : E.type) === d.DataType && !(r != null && r.hasRemoved(this.declaration.id)) && !this.declaration.deleted && !this.project.diggestedBuiltInBaseEntitiesIds.has(
141369
+ this.declaration.id
141370
+ )
140950
141371
  ) {
140951
- const { updated: _, removed: N } = this.declaration.remove({ ignoreUpstream: !1 }, r);
141372
+ const { updated: _, removed: N } = this.declaration.remove(
141373
+ { ignoreUpstream: !1 },
141374
+ r
141375
+ );
140952
141376
  a.push(..._), c.push(...N);
140953
141377
  } else if (
140954
141378
  // If the declaraiton if a value-descriptor, part of a search statement, we delete the value-descriptor too
140955
- this.declaration.type === d.ValueDescriptor && ((A = this.declaration.parent) == null ? void 0 : A.type) === d.Search && !(r != null && r.hasRemoved(this.declaration.id)) && !this.declaration.deleted
141379
+ this.declaration.type === d.ValueDescriptor && ((A = this.declaration.parent) == null ? void 0 : A.type) === d.Search && !(r != null && r.hasRemoved(this.declaration.id)) && !this.declaration.deleted && !this.project.diggestedBuiltInBaseEntitiesIds.has(
141380
+ this.declaration.id
141381
+ )
140956
141382
  ) {
140957
- const { updated: _, removed: N } = this.declaration.remove({ ignoreUpstream: !1 }, r);
141383
+ const { updated: _, removed: N } = this.declaration.remove(
141384
+ { ignoreUpstream: !1 },
141385
+ r
141386
+ );
140958
141387
  a.push(..._), c.push(...N);
140959
141388
  }
140960
141389
  }
@@ -140974,9 +141403,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140974
141403
  a.push(..._), e.push(...N), c.push(...V), f.push(...B);
140975
141404
  }
140976
141405
  return r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
140977
- added: C(e),
140978
- updated: C(a),
140979
- removed: C(c),
141406
+ added: C(
141407
+ e
141408
+ ),
141409
+ updated: C(
141410
+ a
141411
+ ),
141412
+ removed: C(
141413
+ c
141414
+ ),
140980
141415
  affected: C(
140981
141416
  f
140982
141417
  ),
@@ -140999,10 +141434,28 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140999
141434
  if (!this.checkCanEdit(this, i))
141000
141435
  return ce.warn(
141001
141436
  `[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
141002
- ), i == null || i.attemptAutoclose(D.RestoreEntity, this.id), { added: [], updated: [], removed: [], affected: [], self: this };
141437
+ ), i == null || i.attemptAutoclose(
141438
+ D.RestoreEntity,
141439
+ this.id
141440
+ ), {
141441
+ added: [],
141442
+ updated: [],
141443
+ removed: [],
141444
+ affected: [],
141445
+ self: this
141446
+ };
141003
141447
  const r = [], a = [], c = [], e = [];
141004
141448
  if (i != null && i.hasAdded(this.id))
141005
- return i == null || i.attemptAutoclose(D.RestoreEntity, this.id), { added: [], updated: [], removed: [], affected: [], self: this };
141449
+ return i == null || i.attemptAutoclose(
141450
+ D.RestoreEntity,
141451
+ this.id
141452
+ ), {
141453
+ added: [],
141454
+ updated: [],
141455
+ removed: [],
141456
+ affected: [],
141457
+ self: this
141458
+ };
141006
141459
  if (this.subscribe(), this.project.unsubscribeDeletedInstance(this), this.metaSync({ deleted: !1 }, i), Object.values(this.detachedDependents).forEach((f) => {
141007
141460
  const {
141008
141461
  updated: h,
@@ -141025,9 +141478,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
141025
141478
  this,
141026
141479
  i
141027
141480
  ), i == null || i.attemptAutoclose(D.RestoreEntity, this.id), {
141028
- added: C(r),
141029
- updated: C(a),
141030
- removed: C(c),
141481
+ added: C(
141482
+ r
141483
+ ),
141484
+ updated: C(
141485
+ a
141486
+ ),
141487
+ removed: C(
141488
+ c
141489
+ ),
141031
141490
  affected: C(
141032
141491
  e
141033
141492
  ),
@@ -141087,9 +141546,13 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
141087
141546
  codeName: this.codeName,
141088
141547
  description: this.description,
141089
141548
  parentRelationType: this.parentRelationType,
141090
- defaultValue: ((r = this.defaultValue) == null ? void 0 : r.toJSON(i)) || null,
141549
+ defaultValue: ((r = this.defaultValue) == null ? void 0 : r.toJSON(
141550
+ i
141551
+ )) || null,
141091
141552
  dataType: ((a = this.dataType) == null ? void 0 : a.toJSON(i)) || null,
141092
- declaration: ((c = this.declaration) == null ? void 0 : c.toJSON(i)) || null,
141553
+ declaration: ((c = this.declaration) == null ? void 0 : c.toJSON(
141554
+ i
141555
+ )) || null,
141093
141556
  readsValue: ((e = this.readsValue) == null ? void 0 : e.toReference()) || null,
141094
141557
  parent: this.parent.toReference()
141095
141558
  });
@@ -141097,7 +141560,11 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
141097
141560
  toJSONClone(i = lt) {
141098
141561
  var a, c, e, f, h, m, b, E, A, _, N, V;
141099
141562
  let r;
141100
- return (a = i.seenEntityMaps) != null && a.has(this.id) ? r = i.seenEntityMaps.get(this.id) : (r = i.newId || fn(this, this.project, i.uuidStrategy), i.seenEntityMaps && i.seenEntityMaps.set(this.id, r)), (c = i.seenEntities) != null && c.has(r) || (e = i.seenEntities) != null && e.has(this.id) ? this.toReference({ seenEntityMaps: i.seenEntityMaps }) : ((f = i.seenEntities) == null || f.add(r), (h = i.seenEntities) == null || h.add(this.id), {
141563
+ return (a = i.seenEntityMaps) != null && a.has(this.id) ? r = i.seenEntityMaps.get(this.id) : (r = i.newId || fn(
141564
+ this,
141565
+ this.project,
141566
+ i.uuidStrategy
141567
+ ), i.seenEntityMaps && i.seenEntityMaps.set(this.id, r)), (c = i.seenEntities) != null && c.has(r) || (e = i.seenEntities) != null && e.has(this.id) ? this.toReference({ seenEntityMaps: i.seenEntityMaps }) : ((f = i.seenEntities) == null || f.add(r), (h = i.seenEntities) == null || h.add(this.id), {
141101
141568
  id: r,
141102
141569
  version: x.UUID.uuid(),
141103
141570
  createdAt: i.timestamp || G().toISOString(),
@@ -141254,7 +141721,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
141254
141721
  ), r == null || r.attemptAutoclose("set-default-value", this.id), this;
141255
141722
  const a = this.defaultValue;
141256
141723
  if ((a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id)) {
141257
- if (a == null || a.remove({ ignoreUpstream: !0 }, r), this.defaultValue = i, this.defaultValue) {
141724
+ if (a == null || a.remove(
141725
+ { ignoreUpstream: !0 },
141726
+ r
141727
+ ), this.defaultValue = i, this.defaultValue) {
141258
141728
  const c = this.readsValue;
141259
141729
  this.removeValueWriter(r), c == null || c.removeValueReader(this, r);
141260
141730
  }