posthog-js 1.46.1 → 1.46.2

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/module.js CHANGED
@@ -921,7 +921,7 @@ var LZString = {
921
921
  }
922
922
  };
923
923
 
924
- var version = "1.46.1";
924
+ var version = "1.46.2";
925
925
 
926
926
  // e.g. Config.DEBUG = Config.DEBUG || instance.get_config('debug')
927
927
 
@@ -1407,7 +1407,7 @@ var _UUID = function () {
1407
1407
  };
1408
1408
 
1409
1409
  return function () {
1410
- var se = (window.screen.height * window.screen.width).toString(16);
1410
+ var se = typeof window !== 'undefined' ? (window.screen.height * window.screen.width).toString(16) : '0';
1411
1411
  return T() + '-' + R() + '-' + UA() + '-' + se + '-' + T();
1412
1412
  };
1413
1413
  }(); // _.isBlockedUA()
@@ -1756,19 +1756,19 @@ var _info = {
1756
1756
  properties: function properties() {
1757
1757
  return _extend(_strip_empty_properties({
1758
1758
  $os: _info.os(),
1759
- $browser: _info.browser(userAgent, navigator.vendor, window.opera),
1759
+ $browser: _info.browser(userAgent, navigator.vendor, win.opera),
1760
1760
  $device: _info.device(userAgent),
1761
1761
  $device_type: _info.deviceType(userAgent)
1762
1762
  }), {
1763
- $current_url: window.location.href,
1764
- $host: window.location.host,
1765
- $pathname: window.location.pathname,
1766
- $browser_version: _info.browserVersion(userAgent, navigator.vendor, window.opera),
1763
+ $current_url: win === null || win === void 0 ? void 0 : win.location.href,
1764
+ $host: win === null || win === void 0 ? void 0 : win.location.host,
1765
+ $pathname: win === null || win === void 0 ? void 0 : win.location.pathname,
1766
+ $browser_version: _info.browserVersion(userAgent, navigator.vendor, win.opera),
1767
1767
  $browser_language: _info.browserLanguage(),
1768
- $screen_height: window.screen.height,
1769
- $screen_width: window.screen.width,
1770
- $viewport_height: window.innerHeight,
1771
- $viewport_width: window.innerWidth,
1768
+ $screen_height: win === null || win === void 0 ? void 0 : win.screen.height,
1769
+ $screen_width: win === null || win === void 0 ? void 0 : win.screen.width,
1770
+ $viewport_height: win === null || win === void 0 ? void 0 : win.innerHeight,
1771
+ $viewport_width: win === null || win === void 0 ? void 0 : win.innerWidth,
1772
1772
  $lib: 'web',
1773
1773
  $lib_version: Config.LIB_VERSION,
1774
1774
  $insert_id: Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10),
@@ -1779,9 +1779,9 @@ var _info = {
1779
1779
  people_properties: function people_properties() {
1780
1780
  return _extend(_strip_empty_properties({
1781
1781
  $os: _info.os(),
1782
- $browser: _info.browser(userAgent, navigator.vendor, window.opera)
1782
+ $browser: _info.browser(userAgent, navigator.vendor, win.opera)
1783
1783
  }), {
1784
- $browser_version: _info.browserVersion(userAgent, navigator.vendor, window.opera)
1784
+ $browser_version: _info.browserVersion(userAgent, navigator.vendor, win.opera)
1785
1785
  });
1786
1786
  }
1787
1787
  };
@@ -2531,7 +2531,7 @@ var localStore = {
2531
2531
 
2532
2532
  var supported = true;
2533
2533
 
2534
- if (window) {
2534
+ if (typeof window !== 'undefined') {
2535
2535
  try {
2536
2536
  var key = '__mplssupport__',
2537
2537
  val = 'xyz';
@@ -2673,7 +2673,7 @@ var sessionStore = {
2673
2673
 
2674
2674
  sessionStorageSupported = true;
2675
2675
 
2676
- if (window) {
2676
+ if (typeof window !== 'undefined') {
2677
2677
  try {
2678
2678
  var key = '__support__',
2679
2679
  val = 'xyz';
@@ -5892,7 +5892,7 @@ var RetryQueue = /*#__PURE__*/function (_RequestQueueScaffold) {
5892
5892
  _this.areWeOnline = true;
5893
5893
  _this.onXHRError = onXHRError;
5894
5894
 
5895
- if ('onLine' in window.navigator) {
5895
+ if (typeof window !== 'undefined' && 'onLine' in window.navigator) {
5896
5896
  _this.areWeOnline = window.navigator.onLine;
5897
5897
  window.addEventListener('online', function () {
5898
5898
  _this._handleWeAreNowOnline();