{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./Components/exit-intent/assets/scripts/modules/Module.js","webpack:///./Components/exit-intent/assets/scripts/exitIntent.js","webpack:///./Components/exit-intent/assets/scripts/modules/ModuleExitIntent.js","webpack:///./node_modules/dialog-polyfill/dist/dialog-polyfill.esm.js","webpack:///./Components/exit-intent/assets/scripts/modules/ModuleModal.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Module","constructor","el","this","dom","$el","body","document","querySelector","html","site","w","window","ModulesExitIntent","require","ExitIntent","Modal","Modules","ModuleExitIntent","super","requirementsMet","delayInitModule","delayInactivityBeforeFire","inactivityTimeout","exitIntentModal","isShown","cookieFrequency","cookieValue","cookieName","cookieExpiryDays","dataset","cookieExpirydays","init","delayInit","delayInactivity","cookieExpiry","openModal","setInactivityTimer","bindEvents","ModuleModal","classes","setTimeout","addEventListener","disableAllListeners","removeEventListener","clearTimeout","isDataDisplayable","setCookie","open","click","sessionStorage","getItem","isCookiePresent","expiry","setItem","cookie","getExpireFromNow","split","some","item","trim","startsWith","numberOfDay","date","Date","setTime","toGMTString","supportCustomEvent","CustomEvent","safeDispatchEvent","target","event","check","type","toLowerCase","dispatchEvent","findNearestDialog","localName","parentElement","parentNode","host","safeBlur","shadowRoot","activeElement","blur","inNodeList","nodeList","node","length","isFormMethodDialog","hasAttribute","getAttribute","isConnected","element","contains","findFormSubmitter","submitter","form","HTMLFormElement","dialogPolyfill","formSubmitter","getRootNode","maybeHandleSubmit","defaultPrevented","imagemapUseValue","dialog","preventDefault","close","dialogPolyfillInfo","dialog_","replacedStyleTop_","openAsModal_","setAttribute","show","showModal","returnValue","MutationObserver","maybeHideModal","observe","attributes","attributeFilter","timeout","removed","cb","downgradeModal","delayModel","ev","cand","substr","forEach","set","setOpen","backdrop_","createElement","className","backdropMouseEvent_","x","createEvent","initCustomEvent","bubbles","cancelable","detail","Event","style","zIndex","top","removeChild","dm","removeDialog","removeAttribute","e","focus","fake","insertBefore","firstChild","tabIndex","redirectedEvent","initMouseEvent","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","stopPropagation","focus_","findFocusableElementWithin","hostElement","query","map","push","join","Element","elems","querySelectorAll","tagName","updateZIndex","dialogZ","backdropZ","Error","pushDialog","getComputedStyle","invalid","k","ok","undefined","opacity","position","webkitOverflowScrolling","createsStackingContext","console","warn","needsCentering","reposition","nextSibling","opt_returnValue","closeEvent","scrollTop","documentElement","topValue","innerHeight","offsetHeight","Math","max","styleSheets","styleSheet","cssRules","j","rule","selectedNodes","selectorText","cssTop","getPropertyValue","cssBottom","bottom","isInlinePositionSetByStylesheet","HTMLDialogElement","forceRegisterDialog","pendingDialogStack","checkDOM","checkDOM_","overlay","forwardTab_","handleKey_","handleFocus_","zIndexLow_","zIndexHigh_","mo_","records","rec","removedNodes","concat","DialogManager","blockDocument","childList","subtree","unblockDocument","disconnect","updateStacking","dpi","last","appendChild","containedByTopDialog_","candidate","composedPath","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","keyCode","cancelEvent","slice","indexOf","allowed","unshift","index","splice","testForm","method","methodDescriptor","getOwnPropertyDescriptor","realGet","realSet","v","shift","offsetX","offsetY","nativeFormSubmit","submit","elDialog","elDialogWrapper","elOpenTrigger","elCloseButton","elContent","elCancelElements","elPreviousFocus","options","customClasses","keyCodes","enter","spacebar","arrowUp","arrowDown","tab","escape","jQuery","$","data","trigger","openCallback","closeCallback","createModalDialog","bindEvent","classList","add","maxWidth","registerDialog","remove","innerHTML","closeLabel","currentTarget","Array","elFocus","elForceFocus"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,E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,KAAK6Q,UACrB7Q,KAAKwG,SAELnH,KAAKW,OAIRA,KAAKgR,cAAczO,iBAClB,QACA,SAAU4G,GACTnJ,KAAKwG,SACJnH,KAAKW,OAIRI,SAASmC,iBACR,UACA,SAAU4G,GACLA,EAAEsG,UAAYzP,KAAKsR,SAASM,QAC/B5R,KAAKwG,SAELnH,KAAKW,OAIR6S,MAAMpT,UAAUqI,QAAQ9J,KACvBgC,KAAKkR,kBACL,SAAU1N,GACTA,EAAKjB,iBAAiB,QAASvC,KAAKwG,MAAMnH,KAAKW,SAEhDA,MAIF6C,KAAKiQ,GACJ9S,KAAKmR,gBAAkB2B,GAAW1S,SAAS4E,cAEvChF,KAAK+Q,eACR/Q,KAAK+Q,cAAclK,aAAa,gBAAiB,QAGlD7G,KAAKC,IAAIE,KAAKkS,UAAUC,IAAI,iBAC5BtS,KAAKC,IAAIE,KAAKwE,cAAc0N,UAAUC,IAAI,iBAE1CtS,KAAK6Q,SAAS9J,YACd/G,KAAKiS,eAGNzL,MAAMuM,GACD/S,KAAK+Q,eACR/Q,KAAK+Q,cAAc7H,gBAAgB,iBAGpClJ,KAAKC,IAAIE,KAAKkS,UAAUI,OAAO,iBAC/BzS,KAAKC,IAAIE,KAAKwE,cAAc0N,UAAUI,OAAO,iBAE7CzS,KAAK6Q,SAASrK,QAEVuM,EACHA,EAAa3J,QAEbpJ,KAAKmR,gBAAgB/H,QAGtBpJ,KAAKkS","file":"components.exitIntent.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","export default class Module {\r\n constructor(el) {\r\n this.dom = {\r\n el: el,\r\n $el: el,\r\n body: document.querySelector(\"body\"),\r\n html: document.querySelector(\"html\"),\r\n site: document.querySelector(\"#site\"),\r\n w: window\r\n };\r\n }\r\n}\r\n","var ModulesExitIntent = {\r\n\tModule: require('./modules/Module'),\r\n\tExitIntent: require('./modules/ModuleExitIntent'),\r\n\tModal: require('./modules/ModuleModal'),\r\n};\r\n\r\nwindow.Modules = { ...window.Modules, ...ModulesExitIntent };\r\n","import Module from './Module';\r\nimport ModuleModal from './ModuleModal';\r\n\r\nexport default class ModuleExitIntent extends Module {\r\n\tconstructor(el) {\r\n\t\tsuper(el);\r\n\r\n\t\tthis.requirementsMet = true;\r\n\t\tif (!this.requirementsMet) return;\r\n\r\n\t\t//-- properties\r\n\t\tthis.delayInitModule = null;\r\n\t\tthis.delayInactivityBeforeFire = null;\r\n\t\tthis.inactivityTimeout = null;\r\n\t\tthis.exitIntentModal = null;\r\n\t\tthis.isShown = false;\r\n\t\tthis.cookieFrequency = null;\r\n\t\tthis.cookieValue = null;\r\n\t\tthis.cookieName = 'exitIntent';\r\n\t\tthis.cookieExpiryDays = !this.dom.el\r\n\t\t\t? 1\r\n\t\t\t: this.dom.$el.dataset.cookieExpirydays;\r\n\t}\r\n\r\n\tinit() {\r\n\t\tif (!this.dom.el) return;\r\n\r\n\t\tthis.delayInitModule = this.dom.$el.dataset.delayInit || 3000;\r\n\t\tthis.delayInactivityBeforeFire =\r\n\t\t\tthis.dom.$el.dataset.delayInactivity || 30000;\r\n\r\n\t\tthis.cookieFrequency = this.dom.$el.dataset.cookieExpiry;\r\n\t\tthis.cookieValue = this.dom.$el.dataset.cookieName;\r\n\r\n\t\t// binding 'this' to the functions\r\n\t\tthis.openModal = this.openModal.bind(this);\r\n\t\tthis.setInactivityTimer = this.setInactivityTimer.bind(this);\r\n\t\tthis.bindEvents = this.bindEvents.bind(this);\r\n\t\tthis.exitIntentModal = new ModuleModal();\r\n\t\tthis.exitIntentModal.init(this.dom.$el, {\r\n\t\t\tclasses: 'exit-intent',\r\n\t\t});\r\n\r\n\t\tsetTimeout(this.bindEvents, this.delayInitModule);\r\n\t}\r\n\r\n\tbindEvents() {\r\n\t\tthis.dom.body.addEventListener('mouseleave', this.openModal);\r\n\t\tthis.setInactivityTimer();\r\n\r\n\t\t// set inactivity events\r\n\t\tdocument.addEventListener('mousemove', this.setInactivityTimer);\r\n\t\tdocument.addEventListener('click', this.setInactivityTimer);\r\n\t\tdocument.addEventListener('keydown', this.setInactivityTimer);\r\n\t\tdocument.addEventListener('keyup', this.setInactivityTimer);\r\n\t}\r\n\r\n\tdisableAllListeners() {\r\n\t\tthis.dom.body.removeEventListener('mouseleave', this.openModal);\r\n\t\tdocument.removeEventListener('mousemove', this.setInactivityTimer);\r\n\t\tdocument.removeEventListener('click', this.setInactivityTimer);\r\n\t\tdocument.removeEventListener('keydown', this.setInactivityTimer);\r\n\t\tdocument.removeEventListener('keyup', this.setInactivityTimer);\r\n\t}\r\n\r\n\tsetInactivityTimer() {\r\n\t\tclearTimeout(this.inactivityTimeout);\r\n\r\n\t\tthis.inactivityTimeout = setTimeout(\r\n\t\t\tfunction () {\r\n\t\t\t\tthis.openModal();\r\n\t\t\t}.bind(this),\r\n\t\t\tthis.delayInactivityBeforeFire\r\n\t\t);\r\n\t}\r\n\r\n\topenModal() {\r\n\t\tif (this.isShown) return;\r\n\r\n\t\tthis.isShown = true;\r\n\t\tthis.disableAllListeners();\r\n\r\n\t\tif (this.isDataDisplayable()) {\r\n\t\t\tthis.setCookie(this.cookieValue, this.cookieFrequency);\r\n\r\n\t\t\tthis.exitIntentModal.open();\r\n\t\t\tdocument.querySelector('.exitIntentbtn').click();\r\n\t\t}\r\n\t}\r\n\r\n\tisDataDisplayable() {\r\n\t\tif (this.cookieName !== '') {\r\n\t\t\tif (this.cookieFrequency == 'session') {\r\n\t\t\t\treturn !sessionStorage.getItem(this.cookieName);\r\n\t\t\t} else {\r\n\t\t\t\treturn !this.isCookiePresent(this.cookieName);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\tsetCookie(value, expiry) {\r\n\t\tif (this.cookieName !== '') {\r\n\t\t\tif (expiry == 'session') {\r\n\t\t\t\tsessionStorage.setItem(this.cookieName, value);\r\n\t\t\t} else {\r\n\t\t\t\tdocument.cookie = `${\r\n\t\t\t\t\tthis.cookieName\r\n\t\t\t\t}=${value}; expires=${this.getExpireFromNow(\r\n\t\t\t\t\tthis.cookieExpiryDays\r\n\t\t\t\t)};`;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisCookiePresent(cookieName) {\r\n\t\tif (\r\n\t\t\tdocument.cookie\r\n\t\t\t\t.split(';')\r\n\t\t\t\t.some((item) => item.trim().startsWith(`${cookieName}=`))\r\n\t\t) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tgetExpireFromNow(numberOfDay) {\r\n\t\tlet date = new Date();\r\n\t\tdate.setTime(+date + numberOfDay * 86400000);\r\n\t\treturn date.toGMTString();\r\n\t}\r\n}\r\n","// nb. This is for IE10 and lower _only_.\nvar supportCustomEvent = window.CustomEvent;\nif (!supportCustomEvent || typeof supportCustomEvent === 'object') {\n supportCustomEvent = function CustomEvent(event, x) {\n x = x || {};\n var ev = document.createEvent('CustomEvent');\n ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);\n return ev;\n };\n supportCustomEvent.prototype = window.Event.prototype;\n}\n\n/**\n * Dispatches the passed event to both an \"on\" handler as well as via the\n * normal dispatch operation. Does not bubble.\n *\n * @param {!EventTarget} target\n * @param {!Event} event\n * @return {boolean}\n */\nfunction safeDispatchEvent(target, event) {\n var check = 'on' + event.type.toLowerCase();\n if (typeof target[check] === 'function') {\n target[check](event);\n }\n return target.dispatchEvent(event);\n}\n\n/**\n * @param {Element} el to check for stacking context\n * @return {boolean} whether this el or its parents creates a stacking context\n */\nfunction createsStackingContext(el) {\n while (el && el !== document.body) {\n var s = window.getComputedStyle(el);\n var invalid = function(k, ok) {\n return !(s[k] === undefined || s[k] === ok);\n };\n\n if (s.opacity < 1 ||\n invalid('zIndex', 'auto') ||\n invalid('transform', 'none') ||\n invalid('mixBlendMode', 'normal') ||\n invalid('filter', 'none') ||\n invalid('perspective', 'none') ||\n s['isolation'] === 'isolate' ||\n s.position === 'fixed' ||\n s.webkitOverflowScrolling === 'touch') {\n return true;\n }\n el = el.parentElement;\n }\n return false;\n}\n\n/**\n * Finds the nearest from the passed element.\n *\n * @param {Element} el to search from\n * @return {HTMLDialogElement} dialog found\n */\nfunction findNearestDialog(el) {\n while (el) {\n if (el.localName === 'dialog') {\n return /** @type {HTMLDialogElement} */ (el);\n }\n if (el.parentElement) {\n el = el.parentElement;\n } else if (el.parentNode) {\n el = el.parentNode.host;\n } else {\n el = null;\n }\n }\n return null;\n}\n\n/**\n * Blur the specified element, as long as it's not the HTML body element.\n * This works around an IE9/10 bug - blurring the body causes Windows to\n * blur the whole application.\n *\n * @param {Element} el to blur\n */\nfunction safeBlur(el) {\n // Find the actual focused element when the active element is inside a shadow root\n while (el && el.shadowRoot && el.shadowRoot.activeElement) {\n el = el.shadowRoot.activeElement;\n }\n\n if (el && el.blur && el !== document.body) {\n el.blur();\n }\n}\n\n/**\n * @param {!NodeList} nodeList to search\n * @param {Node} node to find\n * @return {boolean} whether node is inside nodeList\n */\nfunction inNodeList(nodeList, node) {\n for (var i = 0; i < nodeList.length; ++i) {\n if (nodeList[i] === node) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * @param {HTMLFormElement} el to check\n * @return {boolean} whether this form has method=\"dialog\"\n */\nfunction isFormMethodDialog(el) {\n if (!el || !el.hasAttribute('method')) {\n return false;\n }\n return el.getAttribute('method').toLowerCase() === 'dialog';\n}\n\n/**\n * @param {!DocumentFragment|!Element} hostElement\n * @return {?Element}\n */\nfunction findFocusableElementWithin(hostElement) {\n // Note that this is 'any focusable area'. This list is probably not exhaustive, but the\n // alternative involves stepping through and trying to focus everything.\n var opts = ['button', 'input', 'keygen', 'select', 'textarea'];\n var query = opts.map(function(el) {\n return el + ':not([disabled])';\n });\n // TODO(samthor): tabindex values that are not numeric are not focusable.\n query.push('[tabindex]:not([disabled]):not([tabindex=\"\"])'); // tabindex != \"\", not disabled\n var target = hostElement.querySelector(query.join(', '));\n\n if (!target && 'attachShadow' in Element.prototype) {\n // If we haven't found a focusable target, see if the host element contains an element\n // which has a shadowRoot.\n // Recursively search for the first focusable item in shadow roots.\n var elems = hostElement.querySelectorAll('*');\n for (var i = 0; i < elems.length; i++) {\n if (elems[i].tagName && elems[i].shadowRoot) {\n target = findFocusableElementWithin(elems[i].shadowRoot);\n if (target) {\n break;\n }\n }\n }\n }\n return target;\n}\n\n/**\n * Determines if an element is attached to the DOM.\n * @param {Element} element to check\n * @return {boolean} whether the element is in DOM\n */\nfunction isConnected(element) {\n return element.isConnected || document.body.contains(element);\n}\n\n/**\n * @param {!Event} event\n * @return {?Element}\n */\nfunction findFormSubmitter(event) {\n if (event.submitter) {\n return event.submitter;\n }\n\n var form = event.target;\n if (!(form instanceof HTMLFormElement)) {\n return null;\n }\n\n var submitter = dialogPolyfill.formSubmitter;\n if (!submitter) {\n var target = event.target;\n var root = ('getRootNode' in target && target.getRootNode() || document);\n submitter = root.activeElement;\n }\n\n if (!submitter || submitter.form !== form) {\n return null;\n }\n return submitter;\n}\n\n/**\n * @param {!Event} event\n */\nfunction maybeHandleSubmit(event) {\n if (event.defaultPrevented) {\n return;\n }\n var form = /** @type {!HTMLFormElement} */ (event.target);\n\n // We'd have a value if we clicked on an imagemap.\n var value = dialogPolyfill.imagemapUseValue;\n var submitter = findFormSubmitter(event);\n if (value === null && submitter) {\n value = submitter.value;\n }\n\n // There should always be a dialog as this handler is added specifically on them, but check just\n // in case.\n var dialog = findNearestDialog(form);\n if (!dialog) {\n return;\n }\n\n // Prefer formmethod on the button.\n var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');\n if (formmethod !== 'dialog') {\n return;\n }\n event.preventDefault();\n\n if (value != null) {\n // nb. we explicitly check against null/undefined\n dialog.close(value);\n } else {\n dialog.close();\n }\n}\n\n/**\n * @param {!HTMLDialogElement} dialog to upgrade\n * @constructor\n */\nfunction dialogPolyfillInfo(dialog) {\n this.dialog_ = dialog;\n this.replacedStyleTop_ = false;\n this.openAsModal_ = false;\n\n // Set a11y role. Browsers that support dialog implicitly know this already.\n if (!dialog.hasAttribute('role')) {\n dialog.setAttribute('role', 'dialog');\n }\n\n dialog.show = this.show.bind(this);\n dialog.showModal = this.showModal.bind(this);\n dialog.close = this.close.bind(this);\n\n dialog.addEventListener('submit', maybeHandleSubmit, false);\n\n if (!('returnValue' in dialog)) {\n dialog.returnValue = '';\n }\n\n if ('MutationObserver' in window) {\n var mo = new MutationObserver(this.maybeHideModal.bind(this));\n mo.observe(dialog, {attributes: true, attributeFilter: ['open']});\n } else {\n // IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also\n // seem to fire even if the element was removed as part of a parent removal. Use the removed\n // events to force downgrade (useful if removed/immediately added).\n var removed = false;\n var cb = function() {\n removed ? this.downgradeModal() : this.maybeHideModal();\n removed = false;\n }.bind(this);\n var timeout;\n var delayModel = function(ev) {\n if (ev.target !== dialog) { return; } // not for a child element\n var cand = 'DOMNodeRemoved';\n removed |= (ev.type.substr(0, cand.length) === cand);\n window.clearTimeout(timeout);\n timeout = window.setTimeout(cb, 0);\n };\n ['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {\n dialog.addEventListener(name, delayModel);\n });\n }\n // Note that the DOM is observed inside DialogManager while any dialog\n // is being displayed as a modal, to catch modal removal from the DOM.\n\n Object.defineProperty(dialog, 'open', {\n set: this.setOpen.bind(this),\n get: dialog.hasAttribute.bind(dialog, 'open')\n });\n\n this.backdrop_ = document.createElement('div');\n this.backdrop_.className = 'backdrop';\n this.backdrop_.addEventListener('mouseup' , this.backdropMouseEvent_.bind(this));\n this.backdrop_.addEventListener('mousedown', this.backdropMouseEvent_.bind(this));\n this.backdrop_.addEventListener('click' , this.backdropMouseEvent_.bind(this));\n}\n\ndialogPolyfillInfo.prototype = /** @type {HTMLDialogElement.prototype} */ ({\n\n get dialog() {\n return this.dialog_;\n },\n\n /**\n * Maybe remove this dialog from the modal top layer. This is called when\n * a modal dialog may no longer be tenable, e.g., when the dialog is no\n * longer open or is no longer part of the DOM.\n */\n maybeHideModal: function() {\n if (this.dialog_.hasAttribute('open') && isConnected(this.dialog_)) { return; }\n this.downgradeModal();\n },\n\n /**\n * Remove this dialog from the modal top layer, leaving it as a non-modal.\n */\n downgradeModal: function() {\n if (!this.openAsModal_) { return; }\n this.openAsModal_ = false;\n this.dialog_.style.zIndex = '';\n\n // This won't match the native exactly because if the user set top on a centered\n // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's\n // possible to polyfill this perfectly.\n if (this.replacedStyleTop_) {\n this.dialog_.style.top = '';\n this.replacedStyleTop_ = false;\n }\n\n // Clear the backdrop and remove from the manager.\n this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);\n dialogPolyfill.dm.removeDialog(this);\n },\n\n /**\n * @param {boolean} value whether to open or close this dialog\n */\n setOpen: function(value) {\n if (value) {\n this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');\n } else {\n this.dialog_.removeAttribute('open');\n this.maybeHideModal(); // nb. redundant with MutationObserver\n }\n },\n\n /**\n * Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if\n * they were on the dialog itself.\n *\n * @param {!Event} e to redirect\n */\n backdropMouseEvent_: function(e) {\n if (!this.dialog_.hasAttribute('tabindex')) {\n // Clicking on the backdrop should move the implicit cursor, even if dialog cannot be\n // focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this\n // would not be needed - clicks would move the implicit cursor there.\n var fake = document.createElement('div');\n this.dialog_.insertBefore(fake, this.dialog_.firstChild);\n fake.tabIndex = -1;\n fake.focus();\n this.dialog_.removeChild(fake);\n } else {\n this.dialog_.focus();\n }\n\n var redirectedEvent = document.createEvent('MouseEvents');\n redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,\n e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,\n e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);\n this.dialog_.dispatchEvent(redirectedEvent);\n e.stopPropagation();\n },\n\n /**\n * Focuses on the first focusable element within the dialog. This will always blur the current\n * focus, even if nothing within the dialog is found.\n */\n focus_: function() {\n // Find element with `autofocus` attribute, or fall back to the first form/tabindex control.\n var target = this.dialog_.querySelector('[autofocus]:not([disabled])');\n if (!target && this.dialog_.tabIndex >= 0) {\n target = this.dialog_;\n }\n if (!target) {\n target = findFocusableElementWithin(this.dialog_);\n }\n safeBlur(document.activeElement);\n target && target.focus();\n },\n\n /**\n * Sets the zIndex for the backdrop and dialog.\n *\n * @param {number} dialogZ\n * @param {number} backdropZ\n */\n updateZIndex: function(dialogZ, backdropZ) {\n if (dialogZ < backdropZ) {\n throw new Error('dialogZ should never be < backdropZ');\n }\n this.dialog_.style.zIndex = dialogZ;\n this.backdrop_.style.zIndex = backdropZ;\n },\n\n /**\n * Shows the dialog. If the dialog is already open, this does nothing.\n */\n show: function() {\n if (!this.dialog_.open) {\n this.setOpen(true);\n this.focus_();\n }\n },\n\n /**\n * Show this dialog modally.\n */\n showModal: function() {\n if (this.dialog_.hasAttribute('open')) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: The element is already open, and therefore cannot be opened modally.');\n }\n if (!isConnected(this.dialog_)) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: The element is not in a Document.');\n }\n if (!dialogPolyfill.dm.pushDialog(this)) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: There are too many open modal dialogs.');\n }\n\n if (createsStackingContext(this.dialog_.parentElement)) {\n console.warn('A dialog is being shown inside a stacking context. ' +\n 'This may cause it to be unusable. For more information, see this link: ' +\n 'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');\n }\n\n this.setOpen(true);\n this.openAsModal_ = true;\n\n // Optionally center vertically, relative to the current viewport.\n if (dialogPolyfill.needsCentering(this.dialog_)) {\n dialogPolyfill.reposition(this.dialog_);\n this.replacedStyleTop_ = true;\n } else {\n this.replacedStyleTop_ = false;\n }\n\n // Insert backdrop.\n this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);\n\n // Focus on whatever inside the dialog.\n this.focus_();\n },\n\n /**\n * Closes this HTMLDialogElement. This is optional vs clearing the open\n * attribute, however this fires a 'close' event.\n *\n * @param {string=} opt_returnValue to use as the returnValue\n */\n close: function(opt_returnValue) {\n if (!this.dialog_.hasAttribute('open')) {\n throw new Error('Failed to execute \\'close\\' on dialog: The element does not have an \\'open\\' attribute, and therefore cannot be closed.');\n }\n this.setOpen(false);\n\n // Leave returnValue untouched in case it was set directly on the element\n if (opt_returnValue !== undefined) {\n this.dialog_.returnValue = opt_returnValue;\n }\n\n // Triggering \"close\" event for any attached listeners on the .\n var closeEvent = new supportCustomEvent('close', {\n bubbles: false,\n cancelable: false\n });\n safeDispatchEvent(this.dialog_, closeEvent);\n }\n\n});\n\nvar dialogPolyfill = {};\n\ndialogPolyfill.reposition = function(element) {\n var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;\n var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;\n element.style.top = Math.max(scrollTop, topValue) + 'px';\n};\n\ndialogPolyfill.isInlinePositionSetByStylesheet = function(element) {\n for (var i = 0; i < document.styleSheets.length; ++i) {\n var styleSheet = document.styleSheets[i];\n var cssRules = null;\n // Some browsers throw on cssRules.\n try {\n cssRules = styleSheet.cssRules;\n } catch (e) {}\n if (!cssRules) { continue; }\n for (var j = 0; j < cssRules.length; ++j) {\n var rule = cssRules[j];\n var selectedNodes = null;\n // Ignore errors on invalid selector texts.\n try {\n selectedNodes = document.querySelectorAll(rule.selectorText);\n } catch(e) {}\n if (!selectedNodes || !inNodeList(selectedNodes, element)) {\n continue;\n }\n var cssTop = rule.style.getPropertyValue('top');\n var cssBottom = rule.style.getPropertyValue('bottom');\n if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {\n return true;\n }\n }\n }\n return false;\n};\n\ndialogPolyfill.needsCentering = function(dialog) {\n var computedStyle = window.getComputedStyle(dialog);\n if (computedStyle.position !== 'absolute') {\n return false;\n }\n\n // We must determine whether the top/bottom specified value is non-auto. In\n // WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but\n // Firefox returns the used value. So we do this crazy thing instead: check\n // the inline style and then go through CSS rules.\n if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||\n (dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {\n return false;\n }\n return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);\n};\n\n/**\n * @param {!Element} element to force upgrade\n */\ndialogPolyfill.forceRegisterDialog = function(element) {\n if (window.HTMLDialogElement || element.showModal) {\n console.warn('This browser already supports , the polyfill ' +\n 'may not work correctly', element);\n }\n if (element.localName !== 'dialog') {\n throw new Error('Failed to register dialog: The element is not a dialog.');\n }\n new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));\n};\n\n/**\n * @param {!Element} element to upgrade, if necessary\n */\ndialogPolyfill.registerDialog = function(element) {\n if (!element.showModal) {\n dialogPolyfill.forceRegisterDialog(element);\n }\n};\n\n/**\n * @constructor\n */\ndialogPolyfill.DialogManager = function() {\n /** @type {!Array} */\n this.pendingDialogStack = [];\n\n var checkDOM = this.checkDOM_.bind(this);\n\n // The overlay is used to simulate how a modal dialog blocks the document.\n // The blocking dialog is positioned on top of the overlay, and the rest of\n // the dialogs on the pending dialog stack are positioned below it. In the\n // actual implementation, the modal dialog stacking is controlled by the\n // top layer, where z-index has no effect.\n this.overlay = document.createElement('div');\n this.overlay.className = '_dialog_overlay';\n this.overlay.addEventListener('click', function(e) {\n this.forwardTab_ = undefined;\n e.stopPropagation();\n checkDOM([]); // sanity-check DOM\n }.bind(this));\n\n this.handleKey_ = this.handleKey_.bind(this);\n this.handleFocus_ = this.handleFocus_.bind(this);\n\n this.zIndexLow_ = 100000;\n this.zIndexHigh_ = 100000 + 150;\n\n this.forwardTab_ = undefined;\n\n if ('MutationObserver' in window) {\n this.mo_ = new MutationObserver(function(records) {\n var removed = [];\n records.forEach(function(rec) {\n for (var i = 0, c; c = rec.removedNodes[i]; ++i) {\n if (!(c instanceof Element)) {\n continue;\n } else if (c.localName === 'dialog') {\n removed.push(c);\n }\n removed = removed.concat(c.querySelectorAll('dialog'));\n }\n });\n removed.length && checkDOM(removed);\n });\n }\n};\n\n/**\n * Called on the first modal dialog being shown. Adds the overlay and related\n * handlers.\n */\ndialogPolyfill.DialogManager.prototype.blockDocument = function() {\n document.documentElement.addEventListener('focus', this.handleFocus_, true);\n document.addEventListener('keydown', this.handleKey_);\n this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});\n};\n\n/**\n * Called on the first modal dialog being removed, i.e., when no more modal\n * dialogs are visible.\n */\ndialogPolyfill.DialogManager.prototype.unblockDocument = function() {\n document.documentElement.removeEventListener('focus', this.handleFocus_, true);\n document.removeEventListener('keydown', this.handleKey_);\n this.mo_ && this.mo_.disconnect();\n};\n\n/**\n * Updates the stacking of all known dialogs.\n */\ndialogPolyfill.DialogManager.prototype.updateStacking = function() {\n var zIndex = this.zIndexHigh_;\n\n for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n dpi.updateZIndex(--zIndex, --zIndex);\n if (i === 0) {\n this.overlay.style.zIndex = --zIndex;\n }\n }\n\n // Make the overlay a sibling of the dialog itself.\n var last = this.pendingDialogStack[0];\n if (last) {\n var p = last.dialog.parentNode || document.body;\n p.appendChild(this.overlay);\n } else if (this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n};\n\n/**\n * @param {Element} candidate to check if contained or is the top-most modal dialog\n * @return {boolean} whether candidate is contained in top dialog\n */\ndialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {\n while (candidate = findNearestDialog(candidate)) {\n for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n if (dpi.dialog === candidate) {\n return i === 0; // only valid if top-most\n }\n }\n candidate = candidate.parentElement;\n }\n return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {\n var target = event.composedPath ? event.composedPath()[0] : event.target;\n\n if (this.containedByTopDialog_(target)) { return; }\n\n if (document.activeElement === document.documentElement) { return; }\n\n event.preventDefault();\n event.stopPropagation();\n safeBlur(/** @type {Element} */ (target));\n\n if (this.forwardTab_ === undefined) { return; } // move focus only from a tab key\n\n var dpi = this.pendingDialogStack[0];\n var dialog = dpi.dialog;\n var position = dialog.compareDocumentPosition(target);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n if (this.forwardTab_) {\n // forward\n dpi.focus_();\n } else if (target !== document.documentElement) {\n // backwards if we're not already focused on \n document.documentElement.focus();\n }\n }\n\n return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {\n this.forwardTab_ = undefined;\n if (event.keyCode === 27) {\n event.preventDefault();\n event.stopPropagation();\n var cancelEvent = new supportCustomEvent('cancel', {\n bubbles: false,\n cancelable: true\n });\n var dpi = this.pendingDialogStack[0];\n if (dpi && safeDispatchEvent(dpi.dialog, cancelEvent)) {\n dpi.dialog.close();\n }\n } else if (event.keyCode === 9) {\n this.forwardTab_ = !event.shiftKey;\n }\n};\n\n/**\n * Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are\n * removed and immediately readded don't stay modal, they become normal.\n *\n * @param {!Array} removed that have definitely been removed\n */\ndialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {\n // This operates on a clone because it may cause it to change. Each change also calls\n // updateStacking, which only actually needs to happen once. But who removes many modal dialogs\n // at a time?!\n var clone = this.pendingDialogStack.slice();\n clone.forEach(function(dpi) {\n if (removed.indexOf(dpi.dialog) !== -1) {\n dpi.downgradeModal();\n } else {\n dpi.maybeHideModal();\n }\n });\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n * @return {boolean} whether the dialog was allowed\n */\ndialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {\n var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;\n if (this.pendingDialogStack.length >= allowed) {\n return false;\n }\n if (this.pendingDialogStack.unshift(dpi) === 1) {\n this.blockDocument();\n }\n this.updateStacking();\n return true;\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n */\ndialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {\n var index = this.pendingDialogStack.indexOf(dpi);\n if (index === -1) { return; }\n\n this.pendingDialogStack.splice(index, 1);\n if (this.pendingDialogStack.length === 0) {\n this.unblockDocument();\n }\n this.updateStacking();\n};\n\ndialogPolyfill.dm = new dialogPolyfill.DialogManager();\ndialogPolyfill.formSubmitter = null;\ndialogPolyfill.imagemapUseValue = null;\n\n/**\n * Installs global handlers, such as click listers and native method overrides. These are needed\n * even if a no dialog is registered, as they deal with
.\n */\nif (window.HTMLDialogElement === undefined) {\n\n /**\n * If HTMLFormElement translates method=\"DIALOG\" into 'get', then replace the descriptor with\n * one that returns the correct value.\n */\n var testForm = document.createElement('form');\n testForm.setAttribute('method', 'dialog');\n if (testForm.method !== 'dialog') {\n var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');\n if (methodDescriptor) {\n // nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything\n // and don't bother to update the element.\n var realGet = methodDescriptor.get;\n methodDescriptor.get = function() {\n if (isFormMethodDialog(this)) {\n return 'dialog';\n }\n return realGet.call(this);\n };\n var realSet = methodDescriptor.set;\n /** @this {HTMLElement} */\n methodDescriptor.set = function(v) {\n if (typeof v === 'string' && v.toLowerCase() === 'dialog') {\n return this.setAttribute('method', v);\n }\n return realSet.call(this, v);\n };\n Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);\n }\n }\n\n /**\n * Global 'click' handler, to capture the or