@bikematrix/web-components 1.1.48 → 1.1.49

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.
@@ -4425,7 +4425,7 @@ const H2 = class Oa {
4425
4425
  ...e
4426
4426
  }), this.initializeConfig(), this.service = new Ct(this.config.apiUrl, this.config.apiKey, this.config.apiToken, this.config.isShopify), this.initializeActiveSubscription(), localStorage.bm_currentBike && (this.currentBike = JSON.parse(localStorage.bm_currentBike)), this.setupEventListeners(), this.registerComponents(), this.initialized = !0, Su.value = !0;
4427
4427
  const t = new Event("BM:Initialized");
4428
- document.dispatchEvent(t), this.config.logLevel === "verbose" && (console.log("BikeMatrix WebComponent Version: 1.1.48"), console.log("BikeMatrixCore initialized"));
4428
+ document.dispatchEvent(t), this.config.logLevel === "verbose" && (console.log("BikeMatrix WebComponent Version: 1.1.49"), console.log("BikeMatrixCore initialized"));
4429
4429
  }
4430
4430
  // Singleton pattern to ensure a single global instance
4431
4431
  static getInstance() {
@@ -4512,10 +4512,10 @@ const H2 = class Oa {
4512
4512
  composed: !0
4513
4513
  }));
4514
4514
  });
4515
- }), document.addEventListener("on:facet-filters:updated", this.handleRefreshCompatibleSkus.bind(this)), document.addEventListener("BikeChanged", this.handleBikeChanged.bind(this));
4515
+ }), document.addEventListener("on:facet-filters:updated", this.handleRefreshCompatibleSkus.bind(this)), document.addEventListener("BikeChanging", this.handleBikeChanging.bind(this));
4516
4516
  }
4517
4517
  removeEventListeners() {
4518
- document.removeEventListener("BikeMatrix:RefreshCompatibleSkus", this.handleRefreshCompatibleSkus), document.removeEventListener("on:facet-filters:updated", this.handleRefreshCompatibleSkus), document.removeEventListener("BikeChanged", this.handleBikeChanged);
4518
+ document.removeEventListener("BikeMatrix:RefreshCompatibleSkus", this.handleRefreshCompatibleSkus), document.removeEventListener("on:facet-filters:updated", this.handleRefreshCompatibleSkus), document.removeEventListener("BikeChanging", this.handleBikeChanging);
4519
4519
  }
4520
4520
  async handleRefreshCompatibleSkus(e) {
4521
4521
  this.RefreshCompatibleSkus().then(() => {
@@ -4525,8 +4525,8 @@ const H2 = class Oa {
4525
4525
  }));
4526
4526
  });
4527
4527
  }
4528
- async handleBikeChanged(e) {
4529
- this.config.logLevel === "verbose" && console.log("Listener BikeChanged..."), this.ChangeBike();
4528
+ async handleBikeChanging(e) {
4529
+ this.config.logLevel === "verbose" && console.log("Listener BikeChanging (pre) ..."), this.ChangeBike();
4530
4530
  }
4531
4531
  getConfig() {
4532
4532
  return this.config;
@@ -4552,6 +4552,9 @@ const H2 = class Oa {
4552
4552
  document.dispatchEvent(new Event("RefreshCompatibility", {
4553
4553
  bubbles: !0,
4554
4554
  composed: !0
4555
+ })), document.dispatchEvent(new Event("BikeChanged", {
4556
+ bubbles: !0,
4557
+ composed: !0
4555
4558
  }));
4556
4559
  });
4557
4560
  }));
@@ -4964,7 +4967,7 @@ const lu = {
4964
4967
  }, D = (F) => {
4965
4968
  (t == null ? void 0 : t.key) === F && r(null), o([...(i || []).filter((M) => !!M.key && M.key !== F)]);
4966
4969
  }, O = () => {
4967
- e.logLevel === "verbose" && console.log("Dispatch BikeChanged..."), document.dispatchEvent(new Event("BikeChanged", {
4970
+ e.logLevel === "verbose" && console.log("Dispatch BikeChanging (pre-change)..."), document.dispatchEvent(new Event("BikeChanging", {
4968
4971
  bubbles: !0,
4969
4972
  composed: !0
4970
4973
  }));
@@ -6142,7 +6145,7 @@ function l6() {
6142
6145
  } = Mt(), [t, r] = K(!0), [i, o] = K(), {
6143
6146
  t: l
6144
6147
  } = De(), u = () => {
6145
- if (e.length > 0) {
6148
+ if (e && e.length > 0) {
6146
6149
  let c = [];
6147
6150
  e.map((f) => {
6148
6151
  c.some((p) => p.text_id === f.text_id) || c.push(f);