;(function(window, document, undefined) {
"use strict";
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };
Object.defineProperty(exports, '__esModule', {
value: true
});
// SweetAlert
// 2014-2015 (c) - Tristan Edwards
// github.com/t4t5/sweetalert
/*
* jQuery-like functions for manipulating the DOM
*/
var _hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation = require('./modules/handle-dom');
/*
* Handy utilities
*/
var _extend$hexToRgb$isIE8$logStr$colorLuminance = require('./modules/utils');
/*
* Handle sweetAlert's DOM elements
*/
var _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition = require('./modules/handle-swal-dom');
// Handle button events and keyboard events
var _handleButton$handleConfirm$handleCancel = require('./modules/handle-click');
var _handleKeyDown = require('./modules/handle-key');
var _handleKeyDown2 = _interopRequireWildcard(_handleKeyDown);
// Default values
var _defaultParams = require('./modules/default-params');
var _defaultParams2 = _interopRequireWildcard(_defaultParams);
var _setParameters = require('./modules/set-params');
var _setParameters2 = _interopRequireWildcard(_setParameters);
/*
* Remember state in cases where opening and handling a modal will fiddle with it.
* (We also use window.previousActiveElement as a global variable)
*/
var previousWindowKeyDown;
var lastFocusedButton;
/*
* Global sweetAlert function
* (this is what the user calls)
*/
var sweetAlert, swal;
exports['default'] = sweetAlert = swal = function () {
var customizations = arguments[0];
_hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.addClass(document.body, 'stop-scrolling');
_sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.resetInput();
/*
* Use argument if defined or default value from params object otherwise.
* Supports the case where a default value is boolean true and should be
* overridden by a corresponding explicit argument which is boolean false.
*/
function argumentOrDefault(key) {
var args = customizations;
return args[key] === undefined ? _defaultParams2['default'][key] : args[key];
}
if (customizations === undefined) {
_extend$hexToRgb$isIE8$logStr$colorLuminance.logStr('SweetAlert expects at least 1 attribute!');
return false;
}
var params = _extend$hexToRgb$isIE8$logStr$colorLuminance.extend({}, _defaultParams2['default']);
switch (typeof customizations) {
// Ex: swal("Hello", "Just testing", "info");
case 'string':
params.title = customizations;
params.text = arguments[1] || '';
params.type = arguments[2] || '';
break;
// Ex: swal({ title:"Hello", text: "Just testing", type: "info" });
case 'object':
if (customizations.title === undefined) {
_extend$hexToRgb$isIE8$logStr$colorLuminance.logStr('Missing "title" argument!');
return false;
}
params.title = customizations.title;
for (var customName in _defaultParams2['default']) {
params[customName] = argumentOrDefault(customName);
}
// Show "Confirm" instead of "OK" if cancel button is visible
params.confirmButtonText = params.showCancelButton ? 'Confirm' : _defaultParams2['default'].confirmButtonText;
params.confirmButtonText = argumentOrDefault('confirmButtonText');
// Callback function when clicking on "OK"/"Cancel"
params.doneFunction = arguments[1] || null;
break;
default:
_extend$hexToRgb$isIE8$logStr$colorLuminance.logStr('Unexpected type of argument! Expected "string" or "object", got ' + typeof customizations);
return false;
}
_setParameters2['default'](params);
_sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.fixVerticalPosition();
_sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.openModal(arguments[1]);
// Modal interactions
var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal();
/*
* Make sure all modal buttons respond to all events
*/
var $buttons = modal.querySelectorAll('button');
var buttonEvents = ['onclick', 'onmouseover', 'onmouseout', 'onmousedown', 'onmouseup', 'onfocus'];
var onButtonEvent = function onButtonEvent(e) {
return _handleButton$handleConfirm$handleCancel.handleButton(e, params, modal);
};
for (var btnIndex = 0; btnIndex < $buttons.length; btnIndex++) {
for (var evtIndex = 0; evtIndex < buttonEvents.length; evtIndex++) {
var btnEvt = buttonEvents[evtIndex];
$buttons[btnIndex][btnEvt] = onButtonEvent;
}
}
// Clicking outside the modal dismisses it (if allowed by user)
_sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getOverlay().onclick = onButtonEvent;
previousWindowKeyDown = window.onkeydown;
var onKeyEvent = function onKeyEvent(e) {
return _handleKeyDown2['default'](e, params, modal);
};
window.onkeydown = onKeyEvent;
window.onfocus = function () {
// When the user has focused away and focused back from the whole window.
setTimeout(function () {
// Put in a timeout to jump out of the event sequence.
// Calling focus() in the event sequence confuses things.
if (lastFocusedButton !== undefined) {
lastFocusedButton.focus();
lastFocusedButton = undefined;
}
}, 0);
};
// Show alert with enabled buttons always
swal.enableButtons();
};
/*
* Set default params for each popup
* @param {Object} userParams
*/
sweetAlert.setDefaults = swal.setDefaults = function (userParams) {
if (!userParams) {
throw new Error('userParams is required');
}
if (typeof userParams !== 'object') {
throw new Error('userParams has to be a object');
}
_extend$hexToRgb$isIE8$logStr$colorLuminance.extend(_defaultParams2['default'], userParams);
};
/*
* Animation when closing modal
*/
sweetAlert.close = swal.close = function () {
var modal = _sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getModal();
_hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.fadeOut(_sweetAlertInitialize$getModal$getOverlay$getInput$setFocusStyle$openModal$resetInput$fixVerticalPosition.getOverlay(), 5);
_hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.fadeOut(modal, 5);
_hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.removeClass(modal, 'showSweetAlert');
_hasClass$addClass$removeClass$escapeHtml$_show$show$_hide$hide$isDescendant$getTopMargin$fadeIn$fadeOut$fireClick$stopEventPropagation.addClass(modal, 'hideSweetAlert');
_h