/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ 666:
/***/ ((module) => {

/* global browser, chrome */

const apis = [
  'alarms',
  'bookmarks',
  'browserAction',
  'action',
  'commands',
  'contextMenus',
  'cookies',
  'downloads',
  'events',
  'extension',
  'extensionTypes',
  'history',
  'i18n',
  'idle',
  'notifications',
  'pageAction',
  'offscreen',
  'runtime',
  'storage',
  'tabs',
  'activeTab',
  'webNavigation',
  'webRequest',
  'windows',
  'clipboardWrite',
  'tabCapture',
  'desktopCapture',
  'browsingData',
  'scripting'
];

/**
 * API Extension Class
 */
function Extension() {
  const _this = this;

  apis.forEach((api) => {
    _this[api] = null;

    try {
      if (chrome[api]) {
        _this[api] = chrome[api];
      }
    } catch (e) {}

    try {
      if (window[api]) {
        _this[api] = window[api];
      }
    } catch (e) {}

    try {
      if (browser[api]) {
        _this[api] = browser[api];
      }
    } catch (e) {}
    try {
      _this.api = browser.extension[api];
    } catch (e) {}
  });

  try {
    if (browser && browser.runtime) {
      this.runtime = browser.runtime;
    }
  } catch (e) {}

  try {
    if (browser && (browser.browserAction || browser.action)) {
      this.browserAction = browser.browserAction || browser.action;
    }
  } catch (e) {}
}

module.exports = new Extension();


/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
/* unused harmony exports closeDialog, onCancel, onConfirm */
/* harmony import */ var _core_ext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(666);
/* harmony import */ var _core_ext__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_core_ext__WEBPACK_IMPORTED_MODULE_0__);


_core_ext__WEBPACK_IMPORTED_MODULE_0___default().runtime.sendMessage({
  method: 'sessionTabCount',
}, (tabCount) => {
  if (tabCount > 0) {
    const sessionText = document.getElementById('message');
    if (tabCount === 1) {
      sessionText.innerHTML = `Web Password Filler is currently logged into a different Secret Server. There is ${tabCount} open tab with security restrictions set by the current Secret Server. This tab will be closed if you switch. <p>Switch and continue?</p>`;
    } else {
      sessionText.innerHTML = `Web Password Filler is currently logged into a different Secret Server. There are ${tabCount} open tabs with security restrictions set by the current Secret Server. These tabs will be closed if you switch. <p>Switch and continue?</p>`;
    }
  }
});

_core_ext__WEBPACK_IMPORTED_MODULE_0___default().runtime.sendMessage({
  method: 'havingConfigUrl',
}, (response) => {
    const sessionText = document.getElementById('message');
    const confirmButtonText = document.getElementById('btn-confirm');
    if (!response.isConfigUrl || !response.isLoggedIn) {
      sessionText.innerHTML = `Web Password Filler is not currently logged in. <p>Log in and continue?</p>`;
      confirmButtonText.innerHTML = "Login & Continue";
    } 
    return;
});

/**
 * closeDialog
 */
function closeDialog() {
  window.parent.postMessage('close-dialog', '*');
}

/**
 * onCancel
 * @param {*} e
 */
function onCancel(e) {
  e.preventDefault();
  closeDialog();
}

/**
 * onConfirm
 * @param {*} e
 */
function onConfirm(e) {
  e.preventDefault();
  _core_ext__WEBPACK_IMPORTED_MODULE_0___default().runtime.sendMessage({
    method: 'switch-ss',
    isSwitchSS: true,
  });
}

const cancelButton = document.getElementById('btn-cancel');
cancelButton && cancelButton.addEventListener('click', onCancel);
const confirmButton = document.getElementById('btn-confirm');
cancelButton && confirmButton.addEventListener('click', onConfirm);

})();

/******/ })()
;
//# sourceMappingURL=confirm-switch-ss.js.map