@bitcobblers/wod-wiki-ui 0.50.2191 → 0.51.2192

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.
@@ -3662,35 +3662,50 @@ var OUTPUT_TYPE_DOT = {
3662
3662
  compiler: "bg-muted-foreground/40",
3663
3663
  analytics: "bg-type-analytics shadow-type-analytics/50"
3664
3664
  };
3665
+ var EFFORT_TYPES = /* @__PURE__ */ new Set(["effort", "text", "action", "label"]);
3666
+ var LOAD_TYPES = /* @__PURE__ */ new Set([
3667
+ "resistance",
3668
+ "intensity",
3669
+ "load",
3670
+ "volume",
3671
+ "work",
3672
+ "power",
3673
+ "calculated",
3674
+ "totalwork",
3675
+ "totalvolume",
3676
+ "tis",
3677
+ "sessionload",
3678
+ "session-load",
3679
+ "calc.metminutes",
3680
+ "metminutes",
3681
+ "totalmetminutes"
3682
+ ]);
3683
+ var ROUND_TYPES = /* @__PURE__ */ new Set(["rounds", "current-round", "increment"]);
3684
+ var DURATION_TYPES = /* @__PURE__ */ new Set(["duration", "time", "elapsed"]);
3685
+ var HINT_TYPES = /* @__PURE__ */ new Set(["hint", "custom", "system", "sound", "lap", "group", "diagnostic"]);
3665
3686
  function extractMetricsByCategory(metrics) {
3666
- if (!metrics) {
3667
- return { efforts: [], reps: [], loads: [], rounds: [], durations: [], distances: [], hints: [] };
3668
- }
3669
- const list = Array.from(metrics);
3670
- return {
3671
- efforts: list.filter((m) => {
3672
- const t = String(m.type).toLowerCase();
3673
- return t === "effort" || t === "text" || t === "action" || t === "label";
3674
- }),
3675
- reps: list.filter((m) => String(m.type).toLowerCase() === "rep"),
3676
- loads: list.filter((m) => {
3677
- const t = String(m.type).toLowerCase();
3678
- return t === "resistance" || t === "intensity" || t === "load" || t === "volume";
3679
- }),
3680
- rounds: list.filter((m) => {
3681
- const t = String(m.type).toLowerCase();
3682
- return t === "rounds" || t === "current-round" || t === "increment";
3683
- }),
3684
- durations: list.filter((m) => {
3685
- const t = String(m.type).toLowerCase();
3686
- return t === "duration" || t === "time" || t === "elapsed";
3687
- }),
3688
- distances: list.filter((m) => String(m.type).toLowerCase() === "distance"),
3689
- hints: list.filter((m) => {
3690
- const t = String(m.type).toLowerCase();
3691
- return t === "hint" || t === "custom" || t === "system" || t === "sound" || t === "lap" || t === "group";
3692
- })
3687
+ const result = {
3688
+ efforts: [],
3689
+ reps: [],
3690
+ loads: [],
3691
+ rounds: [],
3692
+ durations: [],
3693
+ distances: [],
3694
+ hints: []
3693
3695
  };
3696
+ if (!metrics) return result;
3697
+ for (const m of metrics) {
3698
+ const t = String(m.type).toLowerCase();
3699
+ if (EFFORT_TYPES.has(t)) result.efforts.push(m);
3700
+ else if (t === "rep") result.reps.push(m);
3701
+ else if (LOAD_TYPES.has(t)) result.loads.push(m);
3702
+ else if (ROUND_TYPES.has(t)) result.rounds.push(m);
3703
+ else if (DURATION_TYPES.has(t)) result.durations.push(m);
3704
+ else if (t === "distance") result.distances.push(m);
3705
+ else if (HINT_TYPES.has(t) || typeof m.value !== "number") result.hints.push(m);
3706
+ else result.loads.push(m);
3707
+ }
3708
+ return result;
3694
3709
  }
3695
3710
  var DEFAULT_PRIMARY_FILTER = "type:segment";
3696
3711
  var DEFAULT_OUTPUT_FILTERS = [