@ada-support/embed2 1.4.6 → 1.4.9

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.
@@ -15811,7 +15811,7 @@ const client = new error_tracker_BrowserClient({
15811
15811
  },
15812
15812
 
15813
15813
  environment: "production",
15814
- release: "1.4.6-655db5f",
15814
+ release: "1.4.9-737fcae",
15815
15815
  sampleRate: 0.25,
15816
15816
  autoSessionTracking: false,
15817
15817
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -16432,7 +16432,7 @@ function getEmbedURL(_ref) {
16432
16432
  host = "http://".concat(window.location.hostname, ":9001");
16433
16433
  }
16434
16434
 
16435
- return "".concat(host, "/embed/").concat(frameName, "/").concat("655db5f", "/index.html");
16435
+ return "".concat(host, "/embed/").concat(frameName, "/").concat("737fcae", "/index.html");
16436
16436
  }
16437
16437
 
16438
16438
  function constructQueryString(query) {
@@ -17663,7 +17663,7 @@ function readRollout(handle) {
17663
17663
 
17664
17664
  try {
17665
17665
  rollout.group = window.localStorage.getItem("".concat(handle, "_ada_chap_rollout_group"));
17666
- rollout.lastProb = JSON.parse(window.localStorage.getItem("".concat(handle, "_ada_chap_rollout_last_prob")));
17666
+ rollout.lastProb = JSON.parse(window.localStorage.getItem("".concat(handle, "_ada_chap_rollout_last_prob")) || "null");
17667
17667
  return rollout;
17668
17668
  } catch (e) {
17669
17669
  // Failed to read localStorage
@@ -17672,7 +17672,7 @@ function readRollout(handle) {
17672
17672
  }
17673
17673
 
17674
17674
  function checkRollout(rollout, handle) {
17675
- if (typeof rollout === "number" && rollout >= 0 && rollout <= 1) {
17675
+ if (rollout >= 0 && rollout <= 1) {
17676
17676
  // We should first check the storage to see if this user is already grouped
17677
17677
  const rg = readRollout(handle);
17678
17678
  const rand = Math.random();
@@ -17683,8 +17683,7 @@ function checkRollout(rollout, handle) {
17683
17683
  // B is variant (sees chat button)
17684
17684
  const roll = rand <= rollout;
17685
17685
  const group = roll ? "B" : "A";
17686
- const lastProb = rollout;
17687
- storeRollout(handle, group, lastProb);
17686
+ storeRollout(handle, group, rollout);
17688
17687
  return roll;
17689
17688
  }
17690
17689
 
@@ -18299,9 +18298,9 @@ async function log(message, extra, options) {
18299
18298
  service: "embed",
18300
18299
  env: "production",
18301
18300
  embedVersion: 2,
18302
- version: "1.4.6",
18301
+ version: "1.4.9",
18303
18302
  isNpm: true,
18304
- commitHash: "655db5f"
18303
+ commitHash: "737fcae"
18305
18304
  }))
18306
18305
  });
18307
18306
  }
@@ -18743,7 +18742,7 @@ class ChatFrame extends d {
18743
18742
  const hostPageUrlParams = new (url_default())(window.location.href).searchParams;
18744
18743
  const smsToken = hostPageUrlParams.get("adaSMSToken");
18745
18744
  const queryParams = {
18746
- embedVersion: "655db5f".slice(0, 7),
18745
+ embedVersion: "737fcae".slice(0, 7),
18747
18746
  greeting,
18748
18747
  language,
18749
18748
  skipGreeting,
@@ -20056,7 +20055,6 @@ class Container extends d {
20056
20055
  } = adaSettings;
20057
20056
  const localChannel = messageService.getChannel("local");
20058
20057
  const xStorageChannel = messageService.getChannel(XSTORAGE_IFRAME);
20059
- const chatChannel = messageService.getChannel(CHAT_IFRAME);
20060
20058
 
20061
20059
  if (!localChannel) {
20062
20060
  throw new AdaEmbedError("`localChannel` is null");
@@ -20290,6 +20288,8 @@ class Container extends d {
20290
20288
 
20291
20289
  case CLOSE_CAMPAIGN:
20292
20290
  {
20291
+ const chatChannel = messageService.getChannel(CHAT_IFRAME);
20292
+
20293
20293
  if (chatChannel) {
20294
20294
  chatChannel.postMessage(CLOSE_CAMPAIGN);
20295
20295
  }
@@ -20924,7 +20924,7 @@ class Embed {
20924
20924
 
20925
20925
  }
20926
20926
 
20927
- _defineProperty(Embed, "embed2Version", "655db5f");
20927
+ _defineProperty(Embed, "embed2Version", "737fcae");
20928
20928
  ;// CONCATENATED MODULE: ./src/common/helpers/startup.ts
20929
20929
 
20930
20930
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.4.6",
3
+ "version": "1.4.9",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",
@@ -83,7 +83,7 @@
83
83
  "webpack-dev-server": "^4.3.1"
84
84
  },
85
85
  "dependencies": {
86
- "@ada-support/embed-types": "^1.1.1",
86
+ "@ada-support/embed-types": "^1.1.2",
87
87
  "@babel/core": "^7.16.12",
88
88
  "@babel/plugin-proposal-class-properties": "^7.16.7",
89
89
  "@babel/plugin-proposal-numeric-separator": "^7.16.7",