@dcrackel/hematournamentui 1.0.508 → 1.0.510

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