@vizbeetv/homesso-sdk-qa 1.0.3 → 1.0.5

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/es5/index.cjs CHANGED
@@ -493,19 +493,19 @@ var Logger = /** @class */ (function () {
493
493
  var logger = new Logger();
494
494
 
495
495
  var LOG_TAG$1 = 'VizbeeHomeSSOManager';
496
- /* eslint-disable @typescript-eslint/no-explicit-any */
497
496
  var VizbeeMetricsManager = /** @class */ (function () {
498
497
  function VizbeeMetricsManager() {
499
498
  var _this = this;
500
- var _a, _b, _c;
499
+ var _a, _b;
500
+ this.metricsManager = null;
501
501
  this.senderInfo = null;
502
502
  this.getSignInInfo = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
503
503
  return [2 /*return*/, []];
504
504
  }); }); };
505
- if ((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.analytics) === null || _c === void 0 ? void 0 : _c.AnalyticsProvider) {
505
+ var vizbee = window === null || window === void 0 ? void 0 : window.vizbee;
506
+ if ((_b = (_a = vizbee === null || vizbee === void 0 ? void 0 : vizbee.continuity) === null || _a === void 0 ? void 0 : _a.analytics) === null || _b === void 0 ? void 0 : _b.AnalyticsProvider) {
506
507
  this.metricsManager =
507
- new window.vizbee.continuity.analytics.AnalyticsProvider();
508
- // Create a wrapper with 'provider' property
508
+ new vizbee.continuity.analytics.AnalyticsProvider();
509
509
  var attributesProvider = {
510
510
  getAttributes: function () { return _this.getAttributes(); },
511
511
  };
@@ -534,7 +534,8 @@ var VizbeeMetricsManager = /** @class */ (function () {
534
534
  this.metricsManager.logMetrics(event, attributesToBeSent);
535
535
  };
536
536
  VizbeeMetricsManager.prototype.setCustomAttributes = function (customAttributes) {
537
- this.metricsManager.setCustomAttributes(customAttributes);
537
+ var _a;
538
+ (_a = this.metricsManager) === null || _a === void 0 ? void 0 : _a.setCustomAttributes(customAttributes);
538
539
  };
539
540
  VizbeeMetricsManager.prototype.getAttributes = function () {
540
541
  return this.createAttributesJson();
@@ -584,7 +585,7 @@ var VizbeeMetricsManager = /** @class */ (function () {
584
585
  var _a, _b, _c, _d;
585
586
  var attributes = {};
586
587
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
587
- '1.0.1';
588
+ '1.0.5';
588
589
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
589
590
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
590
591
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -618,15 +619,24 @@ var VizbeeConstants = {
618
619
  // SDK events types
619
620
  VIZBEE_SESSION_READY: 'vizbee-bicast-session-ready',
620
621
  };
622
+ /**
623
+ * Numeric session states reported by the Continuity SDK's bicast session manager.
624
+ * Mirrors SessionState in the VTV SDK — defined here so HomeSSO has no magic numbers.
625
+ */
626
+ var VizbeeSessionState = {
627
+ NOT_CONNECTED: 1,
628
+ CONNECTING: 2,
629
+ CONNECTED: 3,
630
+ };
621
631
  // Enum for sign in states
622
- var VizbeeSignInState;
632
+ exports.VizbeeSignInState = void 0;
623
633
  (function (VizbeeSignInState) {
624
634
  VizbeeSignInState["SIGN_IN_NOT_STARTED"] = "not_started";
625
635
  VizbeeSignInState["SIGN_IN_IN_PROGRESS"] = "in_progress";
626
636
  VizbeeSignInState["SIGN_IN_COMPLETED"] = "completed";
627
637
  VizbeeSignInState["SIGN_IN_FAILED"] = "failed";
628
638
  VizbeeSignInState["SIGN_IN_CANCELLED"] = "cancelled";
629
- })(VizbeeSignInState || (VizbeeSignInState = {}));
639
+ })(exports.VizbeeSignInState || (exports.VizbeeSignInState = {}));
630
640
 
631
641
  // Base abstract class for sign in status
632
642
  var VizbeeSignInStatus = /** @class */ (function () {
@@ -655,7 +665,7 @@ var ProgressStatus = /** @class */ (function (_super) {
655
665
  return _this;
656
666
  }
657
667
  ProgressStatus.prototype.getState = function () {
658
- return VizbeeSignInState.SIGN_IN_IN_PROGRESS;
668
+ return exports.VizbeeSignInState.SIGN_IN_IN_PROGRESS;
659
669
  };
660
670
  return ProgressStatus;
661
671
  }(VizbeeSignInStatus));
@@ -672,7 +682,7 @@ var SuccessStatus = /** @class */ (function (_super) {
672
682
  return _this;
673
683
  }
674
684
  SuccessStatus.prototype.getState = function () {
675
- return VizbeeSignInState.SIGN_IN_COMPLETED;
685
+ return exports.VizbeeSignInState.SIGN_IN_COMPLETED;
676
686
  };
677
687
  return SuccessStatus;
678
688
  }(VizbeeSignInStatus));
@@ -693,8 +703,8 @@ var FailureStatus = /** @class */ (function (_super) {
693
703
  }
694
704
  FailureStatus.prototype.getState = function () {
695
705
  return this.isCancelled
696
- ? VizbeeSignInState.SIGN_IN_CANCELLED
697
- : VizbeeSignInState.SIGN_IN_FAILED;
706
+ ? exports.VizbeeSignInState.SIGN_IN_CANCELLED
707
+ : exports.VizbeeSignInState.SIGN_IN_FAILED;
698
708
  };
699
709
  return FailureStatus;
700
710
  }(VizbeeSignInStatus));
@@ -706,12 +716,12 @@ var FailureStatus = /** @class */ (function (_super) {
706
716
  /**
707
717
  * Enum defining the different types of sign-in modals available in the system
708
718
  */
709
- var SignInModalType;
719
+ exports.SignInModalType = void 0;
710
720
  (function (SignInModalType) {
711
721
  SignInModalType["INFORMATION"] = "information";
712
722
  SignInModalType["PROGRESS"] = "progress";
713
723
  SignInModalType["SUCCESS"] = "success";
714
- })(SignInModalType || (SignInModalType = {}));
724
+ })(exports.SignInModalType || (exports.SignInModalType = {}));
715
725
  /**
716
726
  * Default theme configuration with basic color scheme
717
727
  */
@@ -1294,7 +1304,11 @@ var VizbeeSnackbar = /** @class */ (function () {
1294
1304
  return VizbeeSnackbar;
1295
1305
  }());
1296
1306
 
1297
- /* eslint-disable @typescript-eslint/no-explicit-any */
1307
+ /**
1308
+ * @fileoverview Manages Single Sign-On (SSO) functionality for Vizbee home devices.
1309
+ * Handles communication between mobile and TV devices for authentication purposes.
1310
+ * @module VizbeeHomeSSOManager
1311
+ */
1298
1312
  var LOG_TAG = 'VizbeeHomeSSOManager';
1299
1313
  /**
1300
1314
  * Manages Single Sign-On (SSO) functionality between mobile and TV devices in the Vizbee ecosystem.
@@ -1326,8 +1340,14 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1326
1340
  this.isScreenSignedIn = false;
1327
1341
  /** @internal Tracks if sign-in process is currently active */
1328
1342
  this.isSignInInProgress = false;
1343
+ /**
1344
+ * @internal Tracks which modal is currently shown so the same progress modal
1345
+ * is not re-shown (snackbar.show() hides + re-mounts, which would flicker).
1346
+ */
1347
+ this.shownModal = 'none';
1329
1348
  /** @internal Information about the sender device */
1330
1349
  this.senderInfo = null;
1350
+ this.signInHandler = null;
1331
1351
  /**
1332
1352
  * Modal display preferences for the SSO UI
1333
1353
  * @public
@@ -1481,12 +1501,11 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1481
1501
  var _a, _b;
1482
1502
  try {
1483
1503
  logger.info("[".concat(LOG_TAG, "][initializeVizbeeSession] - Initializing Vizbee session"));
1484
- // Check if vizbee and continuity exist before accessing xmessages
1485
- if (!((_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages)) {
1504
+ var xmessages = (_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages;
1505
+ if (!xmessages) {
1486
1506
  throw new Error('Vizbee continuity or xmessages not initialized');
1487
1507
  }
1488
- // Access VizbeeBicastSessionManager directly from the existing object
1489
- var sessionManager_1 = new window.vizbee.continuity.xmessages.VizbeeBicastSessionManager();
1508
+ var sessionManager_1 = new xmessages.VizbeeBicastSessionManager();
1490
1509
  if (!sessionManager_1) {
1491
1510
  throw new Error('Session manager initialization failed');
1492
1511
  }
@@ -1495,7 +1514,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1495
1514
  sessionManager_1.addSessionStateListener({
1496
1515
  onSessionStateChanged: function (state) {
1497
1516
  logger.info("[".concat(LOG_TAG, "][onSessionStateChanged] - Session state changed:"), state);
1498
- if (state === 3) {
1517
+ if (state === VizbeeSessionState.CONNECTED) {
1499
1518
  _this.vizbeeSession = sessionManager_1.getSession();
1500
1519
  _this.vizbeeMessagingClient =
1501
1520
  _this.vizbeeSession.getMessagingClient();
@@ -1564,6 +1583,8 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1564
1583
  if (_d.sent()) {
1565
1584
  return [2 /*return*/];
1566
1585
  }
1586
+ this.isSignInInProgress = true;
1587
+ this.updateProgressUI();
1567
1588
  signInInfo = {
1568
1589
  isSignedIn: this.isRemoteSignedIn,
1569
1590
  signInType: signInType,
@@ -1615,9 +1636,9 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1615
1636
  attributes = _c.sent();
1616
1637
  signInInfoList = attributes === null || attributes === void 0 ? void 0 : attributes['SCREEN_HOMESSO_USER_INFO'];
1617
1638
  logger.info("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - signInInfoList"), signInInfoList);
1618
- tvSignInInfo = signInInfoList.find(function (info) { return info.user_login_type === signInType; });
1639
+ tvSignInInfo = signInInfoList === null || signInInfoList === void 0 ? void 0 : signInInfoList.find(function (info) { return info.user_login_type === signInType; });
1619
1640
  logger.debug("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - TV sign in status fetched:"), tvSignInInfo);
1620
- return [2 /*return*/, tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in];
1641
+ return [2 /*return*/, (tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in) === true];
1621
1642
  case 2:
1622
1643
  error_1 = _c.sent();
1623
1644
  logger.warn("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - Error checking sign-in status:"), error_1);
@@ -1659,13 +1680,24 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1659
1680
  * @internal
1660
1681
  */
1661
1682
  VizbeeHomeSSOManager.prototype.sendStatusToSender = function (status) {
1662
- var _a;
1663
- var signInStatus = this.serializeStatus(status);
1664
- var data = (_a = {},
1665
- _a[VizbeeConstants.KEY_SUB_TYPE] = VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1666
- _a[VizbeeConstants.KEY_SIGN_IN_STATUS] = signInStatus,
1667
- _a);
1668
- this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME);
1683
+ return __awaiter(this, void 0, void 0, function () {
1684
+ var signInStatus, data;
1685
+ var _a;
1686
+ return __generator(this, function (_b) {
1687
+ switch (_b.label) {
1688
+ case 0:
1689
+ signInStatus = this.serializeStatus(status);
1690
+ data = (_a = {},
1691
+ _a[VizbeeConstants.KEY_SUB_TYPE] = VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1692
+ _a[VizbeeConstants.KEY_SIGN_IN_STATUS] = signInStatus,
1693
+ _a);
1694
+ return [4 /*yield*/, this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME)];
1695
+ case 1:
1696
+ _b.sent();
1697
+ return [2 /*return*/];
1698
+ }
1699
+ });
1700
+ });
1669
1701
  };
1670
1702
  /**
1671
1703
  * Serializes status objects for transmission to mobile device
@@ -1675,16 +1707,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1675
1707
  * @internal
1676
1708
  */
1677
1709
  VizbeeHomeSSOManager.prototype.serializeStatus = function (status) {
1678
- if (status instanceof ProgressStatus) {
1679
- return status.serialize();
1680
- }
1681
- else if (status instanceof SuccessStatus) {
1682
- return status.serialize();
1683
- }
1684
- else if (status instanceof FailureStatus) {
1685
- return status.serialize();
1686
- }
1687
- return null;
1710
+ return status.serialize();
1688
1711
  };
1689
1712
  /**
1690
1713
  * Updates UI for sign-in progress state
@@ -1693,6 +1716,12 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1693
1716
  * @internal
1694
1717
  */
1695
1718
  VizbeeHomeSSOManager.prototype.updateProgressUI = function () {
1719
+ var targetModal = this.isRemoteSignedIn ? 'progress' : 'informational';
1720
+ // Avoid re-showing the same modal
1721
+ if (this.shownModal === targetModal) {
1722
+ return;
1723
+ }
1724
+ this.shownModal = targetModal;
1696
1725
  if (!this.isRemoteSignedIn) {
1697
1726
  var modalOptions = this.vizbeeHomeSSOUIManager.getInformationalSignInModalConfig();
1698
1727
  this.snackbar.show(modalOptions);
@@ -1714,6 +1743,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1714
1743
  // themed/localized like the informational and progress modals.
1715
1744
  this.vizbeeHomeSSOUIManager.setSuccessSignInModalConfig({ duration: 10000 });
1716
1745
  var modalOptions = this.vizbeeHomeSSOUIManager.getSuccessSignInModalConfig();
1746
+ this.shownModal = 'success';
1717
1747
  this.snackbar.show(modalOptions);
1718
1748
  };
1719
1749
  /**
@@ -1723,6 +1753,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1723
1753
  * @internal
1724
1754
  */
1725
1755
  VizbeeHomeSSOManager.prototype.updateFailureUI = function () {
1756
+ this.shownModal = 'none';
1726
1757
  this.snackbar.hide();
1727
1758
  };
1728
1759
  /** @internal Singleton instance of the manager */
@@ -1795,6 +1826,8 @@ var init = function () {
1795
1826
  }
1796
1827
  };
1797
1828
  var setupHomeSSO = function () {
1829
+ if (!window.vizbee)
1830
+ return;
1798
1831
  window.vizbee.homesso = {
1799
1832
  HomeSSOContext: HomeSSOContext,
1800
1833
  messages: {
@@ -1806,7 +1839,7 @@ var setupHomeSSO = function () {
1806
1839
  // Replaced at build time with package.json's version by
1807
1840
  // @rollup/plugin-replace (same token the metrics manager uses), so
1808
1841
  // integrators can read the loaded SDK version off the namespace.
1809
- VERSION: '1.0.1',
1842
+ VERSION: '1.0.5',
1810
1843
  };
1811
1844
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1812
1845
  };
package/es5/index.mjs CHANGED
@@ -489,19 +489,19 @@ var Logger = /** @class */ (function () {
489
489
  var logger = new Logger();
490
490
 
491
491
  var LOG_TAG$1 = 'VizbeeHomeSSOManager';
492
- /* eslint-disable @typescript-eslint/no-explicit-any */
493
492
  var VizbeeMetricsManager = /** @class */ (function () {
494
493
  function VizbeeMetricsManager() {
495
494
  var _this = this;
496
- var _a, _b, _c;
495
+ var _a, _b;
496
+ this.metricsManager = null;
497
497
  this.senderInfo = null;
498
498
  this.getSignInInfo = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
499
499
  return [2 /*return*/, []];
500
500
  }); }); };
501
- if ((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.analytics) === null || _c === void 0 ? void 0 : _c.AnalyticsProvider) {
501
+ var vizbee = window === null || window === void 0 ? void 0 : window.vizbee;
502
+ if ((_b = (_a = vizbee === null || vizbee === void 0 ? void 0 : vizbee.continuity) === null || _a === void 0 ? void 0 : _a.analytics) === null || _b === void 0 ? void 0 : _b.AnalyticsProvider) {
502
503
  this.metricsManager =
503
- new window.vizbee.continuity.analytics.AnalyticsProvider();
504
- // Create a wrapper with 'provider' property
504
+ new vizbee.continuity.analytics.AnalyticsProvider();
505
505
  var attributesProvider = {
506
506
  getAttributes: function () { return _this.getAttributes(); },
507
507
  };
@@ -530,7 +530,8 @@ var VizbeeMetricsManager = /** @class */ (function () {
530
530
  this.metricsManager.logMetrics(event, attributesToBeSent);
531
531
  };
532
532
  VizbeeMetricsManager.prototype.setCustomAttributes = function (customAttributes) {
533
- this.metricsManager.setCustomAttributes(customAttributes);
533
+ var _a;
534
+ (_a = this.metricsManager) === null || _a === void 0 ? void 0 : _a.setCustomAttributes(customAttributes);
534
535
  };
535
536
  VizbeeMetricsManager.prototype.getAttributes = function () {
536
537
  return this.createAttributesJson();
@@ -580,7 +581,7 @@ var VizbeeMetricsManager = /** @class */ (function () {
580
581
  var _a, _b, _c, _d;
581
582
  var attributes = {};
582
583
  attributes[VizbeeMetricsConstants.METRICS_ATTR_SCREEN_HOMESSO_SDK_VERSION] =
583
- '1.0.1';
584
+ '1.0.5';
584
585
  attributes['REMOTE_FRIENDLY_NAME'] = (_a = this.senderInfo) === null || _a === void 0 ? void 0 : _a.friendlyName;
585
586
  attributes['REMOTE_DEVICE_ID'] = (_b = this.senderInfo) === null || _b === void 0 ? void 0 : _b.deviceId;
586
587
  attributes['REMOTE_DEVICE_TYPE'] = (_c = this.senderInfo) === null || _c === void 0 ? void 0 : _c.deviceType;
@@ -614,6 +615,15 @@ var VizbeeConstants = {
614
615
  // SDK events types
615
616
  VIZBEE_SESSION_READY: 'vizbee-bicast-session-ready',
616
617
  };
618
+ /**
619
+ * Numeric session states reported by the Continuity SDK's bicast session manager.
620
+ * Mirrors SessionState in the VTV SDK — defined here so HomeSSO has no magic numbers.
621
+ */
622
+ var VizbeeSessionState = {
623
+ NOT_CONNECTED: 1,
624
+ CONNECTING: 2,
625
+ CONNECTED: 3,
626
+ };
617
627
  // Enum for sign in states
618
628
  var VizbeeSignInState;
619
629
  (function (VizbeeSignInState) {
@@ -1290,7 +1300,11 @@ var VizbeeSnackbar = /** @class */ (function () {
1290
1300
  return VizbeeSnackbar;
1291
1301
  }());
1292
1302
 
1293
- /* eslint-disable @typescript-eslint/no-explicit-any */
1303
+ /**
1304
+ * @fileoverview Manages Single Sign-On (SSO) functionality for Vizbee home devices.
1305
+ * Handles communication between mobile and TV devices for authentication purposes.
1306
+ * @module VizbeeHomeSSOManager
1307
+ */
1294
1308
  var LOG_TAG = 'VizbeeHomeSSOManager';
1295
1309
  /**
1296
1310
  * Manages Single Sign-On (SSO) functionality between mobile and TV devices in the Vizbee ecosystem.
@@ -1322,8 +1336,14 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1322
1336
  this.isScreenSignedIn = false;
1323
1337
  /** @internal Tracks if sign-in process is currently active */
1324
1338
  this.isSignInInProgress = false;
1339
+ /**
1340
+ * @internal Tracks which modal is currently shown so the same progress modal
1341
+ * is not re-shown (snackbar.show() hides + re-mounts, which would flicker).
1342
+ */
1343
+ this.shownModal = 'none';
1325
1344
  /** @internal Information about the sender device */
1326
1345
  this.senderInfo = null;
1346
+ this.signInHandler = null;
1327
1347
  /**
1328
1348
  * Modal display preferences for the SSO UI
1329
1349
  * @public
@@ -1477,12 +1497,11 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1477
1497
  var _a, _b;
1478
1498
  try {
1479
1499
  logger.info("[".concat(LOG_TAG, "][initializeVizbeeSession] - Initializing Vizbee session"));
1480
- // Check if vizbee and continuity exist before accessing xmessages
1481
- if (!((_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages)) {
1500
+ var xmessages = (_b = (_a = window.vizbee) === null || _a === void 0 ? void 0 : _a.continuity) === null || _b === void 0 ? void 0 : _b.xmessages;
1501
+ if (!xmessages) {
1482
1502
  throw new Error('Vizbee continuity or xmessages not initialized');
1483
1503
  }
1484
- // Access VizbeeBicastSessionManager directly from the existing object
1485
- var sessionManager_1 = new window.vizbee.continuity.xmessages.VizbeeBicastSessionManager();
1504
+ var sessionManager_1 = new xmessages.VizbeeBicastSessionManager();
1486
1505
  if (!sessionManager_1) {
1487
1506
  throw new Error('Session manager initialization failed');
1488
1507
  }
@@ -1491,7 +1510,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1491
1510
  sessionManager_1.addSessionStateListener({
1492
1511
  onSessionStateChanged: function (state) {
1493
1512
  logger.info("[".concat(LOG_TAG, "][onSessionStateChanged] - Session state changed:"), state);
1494
- if (state === 3) {
1513
+ if (state === VizbeeSessionState.CONNECTED) {
1495
1514
  _this.vizbeeSession = sessionManager_1.getSession();
1496
1515
  _this.vizbeeMessagingClient =
1497
1516
  _this.vizbeeSession.getMessagingClient();
@@ -1560,6 +1579,8 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1560
1579
  if (_d.sent()) {
1561
1580
  return [2 /*return*/];
1562
1581
  }
1582
+ this.isSignInInProgress = true;
1583
+ this.updateProgressUI();
1563
1584
  signInInfo = {
1564
1585
  isSignedIn: this.isRemoteSignedIn,
1565
1586
  signInType: signInType,
@@ -1611,9 +1632,9 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1611
1632
  attributes = _c.sent();
1612
1633
  signInInfoList = attributes === null || attributes === void 0 ? void 0 : attributes['SCREEN_HOMESSO_USER_INFO'];
1613
1634
  logger.info("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - signInInfoList"), signInInfoList);
1614
- tvSignInInfo = signInInfoList.find(function (info) { return info.user_login_type === signInType; });
1635
+ tvSignInInfo = signInInfoList === null || signInInfoList === void 0 ? void 0 : signInInfoList.find(function (info) { return info.user_login_type === signInType; });
1615
1636
  logger.debug("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - TV sign in status fetched:"), tvSignInInfo);
1616
- return [2 /*return*/, tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in];
1637
+ return [2 /*return*/, (tvSignInInfo === null || tvSignInInfo === void 0 ? void 0 : tvSignInInfo.user_is_signed_in) === true];
1617
1638
  case 2:
1618
1639
  error_1 = _c.sent();
1619
1640
  logger.warn("[".concat(LOG_TAG, "][isUserAlreadySignedIn] - Error checking sign-in status:"), error_1);
@@ -1655,13 +1676,24 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1655
1676
  * @internal
1656
1677
  */
1657
1678
  VizbeeHomeSSOManager.prototype.sendStatusToSender = function (status) {
1658
- var _a;
1659
- var signInStatus = this.serializeStatus(status);
1660
- var data = (_a = {},
1661
- _a[VizbeeConstants.KEY_SUB_TYPE] = VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1662
- _a[VizbeeConstants.KEY_SIGN_IN_STATUS] = signInStatus,
1663
- _a);
1664
- this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME);
1679
+ return __awaiter(this, void 0, void 0, function () {
1680
+ var signInStatus, data;
1681
+ var _a;
1682
+ return __generator(this, function (_b) {
1683
+ switch (_b.label) {
1684
+ case 0:
1685
+ signInStatus = this.serializeStatus(status);
1686
+ data = (_a = {},
1687
+ _a[VizbeeConstants.KEY_SUB_TYPE] = VizbeeConstants.EVENT_SUBTYPE_SIGN_IN_STATUS,
1688
+ _a[VizbeeConstants.KEY_SIGN_IN_STATUS] = signInStatus,
1689
+ _a);
1690
+ return [4 /*yield*/, this.vizbeeMessagingClient.send(data, VizbeeConstants.EVENT_SSO_NAME)];
1691
+ case 1:
1692
+ _b.sent();
1693
+ return [2 /*return*/];
1694
+ }
1695
+ });
1696
+ });
1665
1697
  };
1666
1698
  /**
1667
1699
  * Serializes status objects for transmission to mobile device
@@ -1671,16 +1703,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1671
1703
  * @internal
1672
1704
  */
1673
1705
  VizbeeHomeSSOManager.prototype.serializeStatus = function (status) {
1674
- if (status instanceof ProgressStatus) {
1675
- return status.serialize();
1676
- }
1677
- else if (status instanceof SuccessStatus) {
1678
- return status.serialize();
1679
- }
1680
- else if (status instanceof FailureStatus) {
1681
- return status.serialize();
1682
- }
1683
- return null;
1706
+ return status.serialize();
1684
1707
  };
1685
1708
  /**
1686
1709
  * Updates UI for sign-in progress state
@@ -1689,6 +1712,12 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1689
1712
  * @internal
1690
1713
  */
1691
1714
  VizbeeHomeSSOManager.prototype.updateProgressUI = function () {
1715
+ var targetModal = this.isRemoteSignedIn ? 'progress' : 'informational';
1716
+ // Avoid re-showing the same modal
1717
+ if (this.shownModal === targetModal) {
1718
+ return;
1719
+ }
1720
+ this.shownModal = targetModal;
1692
1721
  if (!this.isRemoteSignedIn) {
1693
1722
  var modalOptions = this.vizbeeHomeSSOUIManager.getInformationalSignInModalConfig();
1694
1723
  this.snackbar.show(modalOptions);
@@ -1710,6 +1739,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1710
1739
  // themed/localized like the informational and progress modals.
1711
1740
  this.vizbeeHomeSSOUIManager.setSuccessSignInModalConfig({ duration: 10000 });
1712
1741
  var modalOptions = this.vizbeeHomeSSOUIManager.getSuccessSignInModalConfig();
1742
+ this.shownModal = 'success';
1713
1743
  this.snackbar.show(modalOptions);
1714
1744
  };
1715
1745
  /**
@@ -1719,6 +1749,7 @@ var VizbeeHomeSSOManager = /** @class */ (function () {
1719
1749
  * @internal
1720
1750
  */
1721
1751
  VizbeeHomeSSOManager.prototype.updateFailureUI = function () {
1752
+ this.shownModal = 'none';
1722
1753
  this.snackbar.hide();
1723
1754
  };
1724
1755
  /** @internal Singleton instance of the manager */
@@ -1791,6 +1822,8 @@ var init = function () {
1791
1822
  }
1792
1823
  };
1793
1824
  var setupHomeSSO = function () {
1825
+ if (!window.vizbee)
1826
+ return;
1794
1827
  window.vizbee.homesso = {
1795
1828
  HomeSSOContext: HomeSSOContext,
1796
1829
  messages: {
@@ -1802,10 +1835,10 @@ var setupHomeSSO = function () {
1802
1835
  // Replaced at build time with package.json's version by
1803
1836
  // @rollup/plugin-replace (same token the metrics manager uses), so
1804
1837
  // integrators can read the loaded SDK version off the namespace.
1805
- VERSION: '1.0.1',
1838
+ VERSION: '1.0.5',
1806
1839
  };
1807
1840
  window.dispatchEvent(new Event('VIZBEE_HOMESSO_READY'));
1808
1841
  };
1809
1842
  init();
1810
1843
 
1811
- export { FailureStatus, HomeSSOContext, LogLevel, ProgressStatus, SuccessStatus, UNKNOWN_VALUE, VizbeeHomeSSOManager, VizbeeHomeSSOUIManager };
1844
+ export { FailureStatus, HomeSSOContext, LogLevel, ProgressStatus, SignInModalType, SuccessStatus, UNKNOWN_VALUE, VizbeeHomeSSOManager, VizbeeHomeSSOUIManager, VizbeeSignInState };