{"version":3,"file":"sweetalert2-f334f5c6.js","sources":["../../node_modules/sweetalert2/dist/sweetalert2.all.js"],"sourcesContent":["/*!\n* sweetalert2 v11.7.5\n* Released under the MIT License.\n*/\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Sweetalert2 = factory());\n})(this, (function () { 'use strict';\n\n /**\n * This module contains `WeakMap`s for each effectively-\"private property\" that a `Swal` has.\n * For example, to set the private property \"foo\" of `this` to \"bar\", you can `privateProps.foo.set(this, 'bar')`\n * This is the approach that Babel will probably take to implement private methods/fields\n * https://github.com/tc39/proposal-private-methods\n * https://github.com/babel/babel/pull/7555\n * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*\n * then we can use that language feature.\n */\n\n var privateProps = {\n awaitingPromise: new WeakMap(),\n promise: new WeakMap(),\n innerParams: new WeakMap(),\n domCache: new WeakMap()\n };\n\n const swalPrefix = 'swal2-';\n\n /**\n * @param {string[]} items\n * @returns {object}\n */\n const prefix = items => {\n const result = {};\n for (const i in items) {\n result[items[i]] = swalPrefix + items[i];\n }\n return result;\n };\n const swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'no-transition', 'toast', 'toast-shown', 'show', 'hide', 'close', 'title', 'html-container', 'actions', 'confirm', 'deny', 'cancel', 'default-outline', 'footer', 'icon', 'icon-content', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'input-label', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loader', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl', 'timer-progress-bar', 'timer-progress-bar-container', 'scrollbar-measure', 'icon-success', 'icon-warning', 'icon-info', 'icon-question', 'icon-error']);\n const iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);\n\n const consolePrefix = 'SweetAlert2:';\n\n /**\n * Filter the unique values into a new array\n *\n * @param {Array} arr\n * @returns {Array}\n */\n const uniqueArray = arr => {\n const result = [];\n for (let i = 0; i < arr.length; i++) {\n if (result.indexOf(arr[i]) === -1) {\n result.push(arr[i]);\n }\n }\n return result;\n };\n\n /**\n * Capitalize the first letter of a string\n *\n * @param {string} str\n * @returns {string}\n */\n const capitalizeFirstLetter = str => str.charAt(0).toUpperCase() + str.slice(1);\n\n /**\n * Standardize console warnings\n *\n * @param {string | Array} message\n */\n const warn = message => {\n console.warn(`${consolePrefix} ${typeof message === 'object' ? message.join(' ') : message}`);\n };\n\n /**\n * Standardize console errors\n *\n * @param {string} message\n */\n const error = message => {\n console.error(`${consolePrefix} ${message}`);\n };\n\n /**\n * Private global state for `warnOnce`\n *\n * @type {Array}\n * @private\n */\n const previousWarnOnceMessages = [];\n\n /**\n * Show a console warning, but only if it hasn't already been shown\n *\n * @param {string} message\n */\n const warnOnce = message => {\n if (!previousWarnOnceMessages.includes(message)) {\n previousWarnOnceMessages.push(message);\n warn(message);\n }\n };\n\n /**\n * Show a one-time console warning about deprecated params/methods\n *\n * @param {string} deprecatedParam\n * @param {string} useInstead\n */\n const warnAboutDeprecation = (deprecatedParam, useInstead) => {\n warnOnce(`\"${deprecatedParam}\" is deprecated and will be removed in the next major release. Please use \"${useInstead}\" instead.`);\n };\n\n /**\n * If `arg` is a function, call it (with no arguments or context) and return the result.\n * Otherwise, just pass the value through\n *\n * @param {Function | any} arg\n * @returns {any}\n */\n const callIfFunction = arg => typeof arg === 'function' ? arg() : arg;\n\n /**\n * @param {any} arg\n * @returns {boolean}\n */\n const hasToPromiseFn = arg => arg && typeof arg.toPromise === 'function';\n\n /**\n * @param {any} arg\n * @returns {Promise}\n */\n const asPromise = arg => hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg);\n\n /**\n * @param {any} arg\n * @returns {boolean}\n */\n const isPromise = arg => arg && Promise.resolve(arg) === arg;\n\n /**\n * Gets the popup container which contains the backdrop and the popup itself.\n *\n * @returns {HTMLElement | null}\n */\n const getContainer = () => document.body.querySelector(`.${swalClasses.container}`);\n\n /**\n * @param {string} selectorString\n * @returns {HTMLElement | null}\n */\n const elementBySelector = selectorString => {\n const container = getContainer();\n return container ? container.querySelector(selectorString) : null;\n };\n\n /**\n * @param {string} className\n * @returns {HTMLElement | null}\n */\n const elementByClass = className => {\n return elementBySelector(`.${className}`);\n };\n\n /**\n * @returns {HTMLElement | null}\n */\n const getPopup = () => elementByClass(swalClasses.popup);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getIcon = () => elementByClass(swalClasses.icon);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getIconContent = () => elementByClass(swalClasses['icon-content']);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getTitle = () => elementByClass(swalClasses.title);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getHtmlContainer = () => elementByClass(swalClasses['html-container']);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getImage = () => elementByClass(swalClasses.image);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getProgressSteps = () => elementByClass(swalClasses['progress-steps']);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getValidationMessage = () => elementByClass(swalClasses['validation-message']);\n\n /**\n * @returns {HTMLButtonElement | null}\n */\n const getConfirmButton = () => /** @type {HTMLButtonElement} */elementBySelector(`.${swalClasses.actions} .${swalClasses.confirm}`);\n\n /**\n * @returns {HTMLButtonElement | null}\n */\n const getCancelButton = () => /** @type {HTMLButtonElement} */elementBySelector(`.${swalClasses.actions} .${swalClasses.cancel}`);\n\n /**\n * @returns {HTMLButtonElement | null}\n */\n const getDenyButton = () => /** @type {HTMLButtonElement} */elementBySelector(`.${swalClasses.actions} .${swalClasses.deny}`);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getInputLabel = () => elementByClass(swalClasses['input-label']);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getLoader = () => elementBySelector(`.${swalClasses.loader}`);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getActions = () => elementByClass(swalClasses.actions);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getFooter = () => elementByClass(swalClasses.footer);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getTimerProgressBar = () => elementByClass(swalClasses['timer-progress-bar']);\n\n /**\n * @returns {HTMLElement | null}\n */\n const getCloseButton = () => elementByClass(swalClasses.close);\n\n // https://github.com/jkup/focusable/blob/master/index.js\n const focusable = `\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n`;\n /**\n * @returns {HTMLElement[]}\n */\n const getFocusableElements = () => {\n const focusableElementsWithTabindex = Array.from(getPopup().querySelectorAll('[tabindex]:not([tabindex=\"-1\"]):not([tabindex=\"0\"])'))\n // sort according to tabindex\n .sort((a, b) => {\n const tabindexA = parseInt(a.getAttribute('tabindex'));\n const tabindexB = parseInt(b.getAttribute('tabindex'));\n if (tabindexA > tabindexB) {\n return 1;\n } else if (tabindexA < tabindexB) {\n return -1;\n }\n return 0;\n });\n const otherFocusableElements = Array.from(getPopup().querySelectorAll(focusable)).filter(el => el.getAttribute('tabindex') !== '-1');\n return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(el => isVisible$1(el));\n };\n\n /**\n * @returns {boolean}\n */\n const isModal = () => {\n return hasClass(document.body, swalClasses.shown) && !hasClass(document.body, swalClasses['toast-shown']) && !hasClass(document.body, swalClasses['no-backdrop']);\n };\n\n /**\n * @returns {boolean}\n */\n const isToast = () => {\n return getPopup() && hasClass(getPopup(), swalClasses.toast);\n };\n\n /**\n * @returns {boolean}\n */\n const isLoading = () => {\n return getPopup().hasAttribute('data-loading');\n };\n\n // Remember state in cases where opening and handling a modal will fiddle with it.\n const states = {\n previousBodyPadding: null\n };\n\n /**\n * Securely set innerHTML of an element\n * https://github.com/sweetalert2/sweetalert2/issues/1926\n *\n * @param {HTMLElement} elem\n * @param {string} html\n */\n const setInnerHtml = (elem, html) => {\n elem.textContent = '';\n if (html) {\n const parser = new DOMParser();\n const parsed = parser.parseFromString(html, `text/html`);\n Array.from(parsed.querySelector('head').childNodes).forEach(child => {\n elem.appendChild(child);\n });\n Array.from(parsed.querySelector('body').childNodes).forEach(child => {\n if (child instanceof HTMLVideoElement || child instanceof HTMLAudioElement) {\n elem.appendChild(child.cloneNode(true)); // https://github.com/sweetalert2/sweetalert2/issues/2507\n } else {\n elem.appendChild(child);\n }\n });\n }\n };\n\n /**\n * @param {HTMLElement} elem\n * @param {string} className\n * @returns {boolean}\n */\n const hasClass = (elem, className) => {\n if (!className) {\n return false;\n }\n const classList = className.split(/\\s+/);\n for (let i = 0; i < classList.length; i++) {\n if (!elem.classList.contains(classList[i])) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * @param {HTMLElement} elem\n * @param {SweetAlertOptions} params\n */\n const removeCustomClasses = (elem, params) => {\n Array.from(elem.classList).forEach(className => {\n if (!Object.values(swalClasses).includes(className) && !Object.values(iconTypes).includes(className) && !Object.values(params.showClass).includes(className)) {\n elem.classList.remove(className);\n }\n });\n };\n\n /**\n * @param {HTMLElement} elem\n * @param {SweetAlertOptions} params\n * @param {string} className\n */\n const applyCustomClass = (elem, params, className) => {\n removeCustomClasses(elem, params);\n if (params.customClass && params.customClass[className]) {\n if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) {\n warn(`Invalid type of customClass.${className}! Expected string or iterable object, got \"${typeof params.customClass[className]}\"`);\n return;\n }\n addClass(elem, params.customClass[className]);\n }\n };\n\n /**\n * @param {HTMLElement} popup\n * @param {import('./renderers/renderInput').InputClass} inputClass\n * @returns {HTMLInputElement | null}\n */\n const getInput$1 = (popup, inputClass) => {\n if (!inputClass) {\n return null;\n }\n switch (inputClass) {\n case 'select':\n case 'textarea':\n case 'file':\n return popup.querySelector(`.${swalClasses.popup} > .${swalClasses[inputClass]}`);\n case 'checkbox':\n return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.checkbox} input`);\n case 'radio':\n return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.radio} input:checked`) || popup.querySelector(`.${swalClasses.popup} > .${swalClasses.radio} input:first-child`);\n case 'range':\n return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.range} input`);\n default:\n return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.input}`);\n }\n };\n\n /**\n * @param {HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement} input\n */\n const focusInput = input => {\n input.focus();\n\n // place cursor at end of text in text input\n if (input.type !== 'file') {\n // http://stackoverflow.com/a/2345915\n const val = input.value;\n input.value = '';\n input.value = val;\n }\n };\n\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[] | readonly string[]} classList\n * @param {boolean} condition\n */\n const toggleClass = (target, classList, condition) => {\n if (!target || !classList) {\n return;\n }\n if (typeof classList === 'string') {\n classList = classList.split(/\\s+/).filter(Boolean);\n }\n classList.forEach(className => {\n if (Array.isArray(target)) {\n target.forEach(elem => {\n condition ? elem.classList.add(className) : elem.classList.remove(className);\n });\n } else {\n condition ? target.classList.add(className) : target.classList.remove(className);\n }\n });\n };\n\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[] | readonly string[]} classList\n */\n const addClass = (target, classList) => {\n toggleClass(target, classList, true);\n };\n\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[] | readonly string[]} classList\n */\n const removeClass = (target, classList) => {\n toggleClass(target, classList, false);\n };\n\n /**\n * Get direct child of an element by class name\n *\n * @param {HTMLElement} elem\n * @param {string} className\n * @returns {HTMLElement | undefined}\n */\n const getDirectChildByClass = (elem, className) => {\n const children = Array.from(elem.children);\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (child instanceof HTMLElement && hasClass(child, className)) {\n return child;\n }\n }\n };\n\n /**\n * @param {HTMLElement} elem\n * @param {string} property\n * @param {*} value\n */\n const applyNumericalStyle = (elem, property, value) => {\n if (value === `${parseInt(value)}`) {\n value = parseInt(value);\n }\n if (value || parseInt(value) === 0) {\n elem.style[property] = typeof value === 'number' ? `${value}px` : value;\n } else {\n elem.style.removeProperty(property);\n }\n };\n\n /**\n * @param {HTMLElement} elem\n * @param {string} display\n */\n const show = function (elem) {\n let display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex';\n elem.style.display = display;\n };\n\n /**\n * @param {HTMLElement} elem\n */\n const hide = elem => {\n elem.style.display = 'none';\n };\n\n /**\n * @param {HTMLElement} parent\n * @param {string} selector\n * @param {string} property\n * @param {string} value\n */\n const setStyle = (parent, selector, property, value) => {\n /** @type {HTMLElement} */\n const el = parent.querySelector(selector);\n if (el) {\n el.style[property] = value;\n }\n };\n\n /**\n * @param {HTMLElement} elem\n * @param {any} condition\n * @param {string} display\n */\n const toggle = function (elem, condition) {\n let display = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'flex';\n condition ? show(elem, display) : hide(elem);\n };\n\n /**\n * borrowed from jquery $(elem).is(':visible') implementation\n *\n * @param {HTMLElement} elem\n * @returns {boolean}\n */\n const isVisible$1 = elem => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length));\n\n /**\n * @returns {boolean}\n */\n const allButtonsAreHidden = () => !isVisible$1(getConfirmButton()) && !isVisible$1(getDenyButton()) && !isVisible$1(getCancelButton());\n\n /**\n * @param {HTMLElement} elem\n * @returns {boolean}\n */\n const isScrollable = elem => !!(elem.scrollHeight > elem.clientHeight);\n\n /**\n * borrowed from https://stackoverflow.com/a/46352119\n *\n * @param {HTMLElement} elem\n * @returns {boolean}\n */\n const hasCssAnimation = elem => {\n const style = window.getComputedStyle(elem);\n const animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0');\n const transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0');\n return animDuration > 0 || transDuration > 0;\n };\n\n /**\n * @param {number} timer\n * @param {boolean} reset\n */\n const animateTimerProgressBar = function (timer) {\n let reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n const timerProgressBar = getTimerProgressBar();\n if (isVisible$1(timerProgressBar)) {\n if (reset) {\n timerProgressBar.style.transition = 'none';\n timerProgressBar.style.width = '100%';\n }\n setTimeout(() => {\n timerProgressBar.style.transition = `width ${timer / 1000}s linear`;\n timerProgressBar.style.width = '0%';\n }, 10);\n }\n };\n const stopTimerProgressBar = () => {\n const timerProgressBar = getTimerProgressBar();\n const timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width);\n timerProgressBar.style.removeProperty('transition');\n timerProgressBar.style.width = '100%';\n const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width);\n const timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100;\n timerProgressBar.style.width = `${timerProgressBarPercent}%`;\n };\n\n const RESTORE_FOCUS_TIMEOUT = 100;\n\n /** @type {GlobalState} */\n const globalState = {};\n const focusPreviousActiveElement = () => {\n if (globalState.previousActiveElement instanceof HTMLElement) {\n globalState.previousActiveElement.focus();\n globalState.previousActiveElement = null;\n } else if (document.body) {\n document.body.focus();\n }\n };\n\n /**\n * Restore previous active (focused) element\n *\n * @param {boolean} returnFocus\n * @returns {Promise}\n */\n const restoreActiveElement = returnFocus => {\n return new Promise(resolve => {\n if (!returnFocus) {\n return resolve();\n }\n const x = window.scrollX;\n const y = window.scrollY;\n globalState.restoreFocusTimeout = setTimeout(() => {\n focusPreviousActiveElement();\n resolve();\n }, RESTORE_FOCUS_TIMEOUT); // issues/900\n\n window.scrollTo(x, y);\n });\n };\n\n /**\n * Detect Node env\n *\n * @returns {boolean}\n */\n const isNodeEnv = () => typeof window === 'undefined' || typeof document === 'undefined';\n\n const sweetHTML = `\n