@seatlayer/core 0.5.0 → 0.7.0

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.cjs CHANGED
@@ -3134,6 +3134,19 @@ var PickerController = class {
3134
3134
  }
3135
3135
  }
3136
3136
  /** Public GA inventory derived from the live synthetic-unit status stream. */
3137
+ /**
3138
+ * Live seats-left per category key (status 'free' right now). Recompute on
3139
+ * onStatusChange — this is what a price panel's "N left" counters read.
3140
+ */
3141
+ categoryAvailability() {
3142
+ const out = {};
3143
+ for (const [id, s] of this.seatById) {
3144
+ if ((this.getStatus(id) ?? "free") === "free") {
3145
+ out[s.categoryKey] = (out[s.categoryKey] ?? 0) + 1;
3146
+ }
3147
+ }
3148
+ return out;
3149
+ }
3137
3150
  getGAAreas() {
3138
3151
  const doc = this.visibleDoc();
3139
3152
  if (!doc) return [];
@@ -3675,7 +3688,7 @@ var PickerController = class {
3675
3688
  if (!id) continue;
3676
3689
  const next = mapStatus(ch.status);
3677
3690
  if (this.opts.flashOnLiveChange && next !== "free" && r.getStatus(id) === "free" && !this.hold_?.labels.includes(ch.label)) {
3678
- r.flashSeat(id);
3691
+ r.flashSeat(id, next === "held" ? "#f4b740" : "#f43f5e");
3679
3692
  }
3680
3693
  r.setStatus([id], next);
3681
3694
  }