@dcrackel/hematournamentui 1.0.509 → 1.0.511

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.
@@ -34370,7 +34370,9 @@ const lz = /* @__PURE__ */ se(oz, [["render", az]]), cz = {
34370
34370
  },
34371
34371
  computed: {
34372
34372
  lastNote() {
34373
- return (this.fencer1 ? this.bout.Person1 : this.bout.Person2).EventPersons[0].LastNote ?? "";
34373
+ var e, n;
34374
+ const t = this.fencer1 ? (e = this.bout.Person1) == null ? void 0 : e.EventPersons : (n = this.bout.Person2) == null ? void 0 : n.EventPersons;
34375
+ return t && t.length > 0 ? t[0].LastNote ?? "" : "";
34374
34376
  },
34375
34377
  currentScore() {
34376
34378
  return this.isCountingUp ? this.baseScore : this.maxScore - this.baseScore;
@@ -34379,10 +34381,12 @@ const lz = /* @__PURE__ */ se(oz, [["render", az]]), cz = {
34379
34381
  return this.fencer1 ? this.hostingClubColors.Color1.toLowerCase() : this.hostingClubColors.Color2.toLowerCase();
34380
34382
  },
34381
34383
  countYellowCards() {
34382
- return this.fencer1 ? this.bout.Person1.Penalties.filter((t) => t.PenaltyType === "Yellow" && t.BoutId === this.bout.BoutId).length : this.bout.Person2.Penalties.filter((t) => t.PenaltyType === "Yellow" && t.BoutId === this.bout.BoutId).length;
34384
+ const t = this.fencer1 ? this.bout.Person1.Penalties : this.bout.Person2.Penalties;
34385
+ return t ? t.filter((e) => e.PenaltyType === "Yellow" && e.BoutId === this.bout.BoutId).length : 0;
34383
34386
  },
34384
34387
  countRedCards() {
34385
- return this.fencer1 ? this.bout.Person1.Penalties.filter((t) => t.PenaltyType === "Red" && t.BoutId === this.bout.BoutId).length : this.bout.Person2.Penalties.filter((t) => t.PenaltyType === "Red" && t.BoutId === this.bout.BoutId).length;
34388
+ const t = this.fencer1 ? this.bout.Person1.Penalties : this.bout.Person2.Penalties;
34389
+ return t ? t.filter((e) => e.PenaltyType === "Red" && e.BoutId === this.bout.BoutId).length : 0;
34386
34390
  },
34387
34391
  getHandShotValue() {
34388
34392
  const t = this.fencer1 ? this.bout.Person1Id : this.bout.Person2Id, e = this.bout.Metrics.find((n) => n.PersonId === t);
@@ -34809,7 +34813,7 @@ const Gz = /* @__PURE__ */ se(Rz, [["render", Uz]]), Jz = {
34809
34813
  this.toggleAllOff(), this.currentNote = "";
34810
34814
  },
34811
34815
  countCards() {
34812
- this.fencer1 && (this.yellowCardCount = this.bout.Person1.Penalties.filter((t) => t.PenaltyType === "Yellow").length, this.redCardCount = this.bout.Person1.Penalties.filter((t) => t.PenaltyType === "Red").length), this.fencer1 || (this.yellowCardCount = this.bout.Person2.Penalties.filter((t) => t.PenaltyType === "Yellow").length, this.redCardCount = this.bout.Person2.Penalties.filter((t) => t.PenaltyType === "Red").length);
34816
+ this.fencer1 && (this.yellowCardCount = this.bout.Person1.Penalties.filter((t) => t.PenaltyType === "Yellow" && t.BoutId === this.bout.BoutId).length, this.redCardCount = this.bout.Person1.Penalties.filter((t) => t.PenaltyType === "Red" && t.BoutId === this.bout.BoutId).length), this.fencer1 || (this.yellowCardCount = this.bout.Person2.Penalties.filter((t) => t.PenaltyType === "Yellow" && t.BoutId === this.bout.BoutId).length, this.redCardCount = this.bout.Person2.Penalties.filter((t) => t.PenaltyType === "Red" && t.BoutId === this.bout.BoutId).length);
34813
34817
  },
34814
34818
  toggleAllOff() {
34815
34819
  this.yellowCardToggle && this.yellowCardCount--, this.redCardToggle && this.redCardCount--, this.yellowCardToggle = !1, this.redCardToggle = !1, this.noteToggle = !1, this.medicalToggle = !1, this.blackCardToggle = !1;
@@ -34853,11 +34857,11 @@ const Gz = /* @__PURE__ */ se(Rz, [["render", Uz]]), Jz = {
34853
34857
  PenaltyType: this.getToggled(),
34854
34858
  Notes: this.currentNote
34855
34859
  };
34856
- this.fencer1 ? this.bout.Person1.Penalties.push(t) : this.bout.Person2.Penalties.push(t), this.$emit("penalty:add", t), this.currentNote = "";
34860
+ this.fencer1 ? this.bout.Person1.Penalties.push(t) : this.bout.Person2.Penalties.push(t), this.countCards(), this.$emit("penalty:add", t), this.currentNote = "";
34857
34861
  },
34858
34862
  updatePenalty() {
34859
34863
  const t = this.fencer1 ? this.bout.Person1.Penalties : this.bout.Person2.Penalties, e = t.findIndex((n) => n.PenaltyId === this.selectPenaltyId);
34860
- e !== -1 && (t[e].PenaltyType = this.getToggled(), t[e].Notes = this.currentNote, this.$emit("penalty:update", t[e])), this.selectPenaltyId = null, this.currentNote = "";
34864
+ e !== -1 && (t[e].PenaltyType = this.getToggled(), t[e].Notes = this.currentNote, this.$emit("penalty:update", t[e])), this.countCards(), this.selectPenaltyId = null, this.currentNote = "";
34861
34865
  },
34862
34866
  handlePenalty(t) {
34863
34867
  this.selectPenaltyId ? this.updatePenalty(t) : this.addNewPenalty();
@@ -34867,7 +34871,7 @@ const Gz = /* @__PURE__ */ se(Rz, [["render", Uz]]), Jz = {
34867
34871
  const e = this.fencer1 ? this.bout.Person1 : this.bout.Person2, n = e.Penalties.findIndex((r) => r.PenaltyId === t);
34868
34872
  if (n !== -1) {
34869
34873
  const r = e.Penalties.splice(n, 1)[0];
34870
- this.countCards(), this.$emit("penalty:remove", r), e.EventPersons[0].LastNote === r.Notes && (e.Penalties.length > 0 ? e.EventPersons[0].LastNote = e.Penalties[e.Penalties.length - 1].Notes : e.EventPersons[0].LastNote = "");
34874
+ this.countCards(), this.$emit("penalty:remove", r), e.EventPersons[0].LastNote === r.Notes && (e.Penalties.length > 0 ? e.EventPersons[0].LastNote = e.Penalties[e.Penalties.length - 1].Notes : e.EventPersons[0].LastNote = ""), this.countCards();
34871
34875
  }
34872
34876
  },
34873
34877
  getFlagIcon(t) {
@@ -35023,7 +35027,7 @@ function iL(t, e, n, r, o, i) {
35023
35027
  i.toggled ? (C(), ne(l, {
35024
35028
  key: 0,
35025
35029
  type: "primary",
35026
- label: "Save Note",
35030
+ label: "Save Penalty",
35027
35031
  size: "sm",
35028
35032
  onButtonClick: e[6] || (e[6] = (c) => i.handlePenalty())
35029
35033
  })) : b("", !0),
@@ -35039,7 +35043,7 @@ function iL(t, e, n, r, o, i) {
35039
35043
  h("div", null, [
35040
35044
  i.pastCards.length ? (C(), ne(A, {
35041
35045
  key: 0,
35042
- text: "Past Notes",
35046
+ text: "Past Cards in this Event",
35043
35047
  type: "h3",
35044
35048
  size: "lg",
35045
35049
  color: "primary",
@@ -35263,7 +35267,7 @@ const Vp = /* @__PURE__ */ se(AL, [["render", lL]]), cL = {
35263
35267
  },
35264
35268
  preparePenalty(t, e) {
35265
35269
  const n = t.penalty;
35266
- return n.BoutId = this.localBout.BoutId, n.EventId = this.localBout.EventId, e ? (this.localBout.Person1.EventPersons[0].LastNote = n.Notes, n.PersonId = this.localBout.Person1Id, this.localBout.Person1.Penalties.push(n)) : (this.localBout.Person2.EventPersons[0].LastNote = n.Notes, n.PersonId = this.localBout.Person2Id, this.localBout.Person2.Penalties.push(n)), n;
35270
+ return n.BoutId = this.localBout.BoutId, n.EventId = this.localBout.EventId, e ? (this.localBout.Person1.EventPersons[0].LastNote = n.Notes, n.PersonId = this.localBout.Person1Id) : (this.localBout.Person2.EventPersons[0].LastNote = n.Notes, n.PersonId = this.localBout.Person2Id), n;
35267
35271
  },
35268
35272
  handleUpdatePenalty(t) {
35269
35273
  const e = this.preparePenalty(t, t.fencer1);