@saasquatch/squatch-js 2.6.0 → 2.6.1

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.
@@ -803,7 +803,6 @@ class EmbedWidget extends Widget {
803
803
  } = entry.contentRect; // @ts-ignore -- number will be cast to string by browsers
804
804
 
805
805
  frame.height = height;
806
- console.log("RESIZE");
807
806
  }
808
807
  });
809
808
  var container = await this._findInnerContainer(frame);
@@ -2069,17 +2068,17 @@ class ImpactEmbed extends DeclarativeEmbedWidget {}
2069
2068
 
2070
2069
  class ImpactPopup extends DeclarativePopupWidget {}
2071
2070
 
2072
- window.customElements.define("squatch-embed", SquatchEmbed);
2073
- window.customElements.define("impact-embed", ImpactEmbed);
2074
- window.customElements.define("squatch-popup", SquatchPopup);
2075
- window.customElements.define("impact-popup", ImpactPopup);
2071
+ if (!window.customElements.get("squatch-embed")) window.customElements.define("squatch-embed", SquatchEmbed);
2072
+ if (!window.customElements.get("impact-embed")) window.customElements.define("impact-embed", ImpactEmbed);
2073
+ if (!window.customElements.get("squatch-popup")) window.customElements.define("squatch-popup", SquatchPopup);
2074
+ if (!window.customElements.get("impact-popup")) window.customElements.define("impact-popup", ImpactPopup);
2076
2075
 
2077
2076
  // @ts-check
2078
2077
  function help() {
2079
2078
  console.log("Having trouble using Squatch.js? Go to https://docs.referralsaasquatch.com/developer/ for tutorials, references and error codes.");
2080
2079
  }
2081
2080
 
2082
- // @ts-check
2081
+ var _window$squatch;
2083
2082
  // debug.disable("squatch-js*");
2084
2083
 
2085
2084
  /** @hidden */
@@ -2267,8 +2266,10 @@ function pushCookie() {
2267
2266
 
2268
2267
  if (typeof document !== "undefined" && !window.SaaSquatchDoNotAutoDrop) {
2269
2268
  pushCookie();
2270
- }
2269
+ } // Show message if squatchjs has already been loaded on the page
2270
+
2271
2271
 
2272
+ if ((_window$squatch = window["squatch"]) != null && _window$squatch.init) _log("Squatchjs is being loaded more than once. This may lead to multiple load events being sent, duplicated widgets, and inaccurate analytics.");
2272
2273
  if (typeof document !== "undefined") asyncLoad();
2273
2274
 
2274
2275
  export { DeclarativeEmbedWidget, DeclarativePopupWidget, EmbedWidget, PopupWidget, WidgetApi, Widgets, _auto, api, autofill, events, help, init, pushCookie, ready, widget, widgets };