{"version":3,"sources":["node_modules/bootbox/bootbox.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,qBAAqB;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;AACjC;AACA;;AAEA;AACA;AACA,mCAAmC,iBAAiB;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,iBAAiB;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kCAAkC,iBAAiB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+BAA+B;AAC/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,OAAO;AACP;;AAEA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,iDAAiD;AACjD;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,mCAAmC;AACnC;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qCAAqC;AACrC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;;AAEA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;;AAEA;AACA,sBAAsB,mBAAmB;AACzC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;;AAEA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA,SAAS;AACT;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;;;AAIA;AACA;AACA,+BAA+B;AAC/B;AACA;;AAEA,sCAAsC,OAAO;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;AAIA;AACA;AACA;AACA;;AAEA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA,KAAK;AACL;AACA,K;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE;AAClC;;AAEA;AACA;AACA,CAAC","file":"scripts.js","sourcesContent":["/*! @preserve\r\n * bootbox.js\r\n * version: 5.5.2\r\n * author: Nick Payne \r\n * license: MIT\r\n * http://bootboxjs.com/\r\n */\r\n(function (root, factory) {\r\n 'use strict';\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD\r\n define(['jquery'], factory);\r\n } else if (typeof exports === 'object') {\r\n // Node, CommonJS-like\r\n module.exports = factory(require('jquery'));\r\n } else {\r\n // Browser globals (root is window)\r\n root.bootbox = factory(root.jQuery);\r\n }\r\n}(this, function init($, undefined) {\r\n 'use strict';\r\n\r\n // Polyfills Object.keys, if necessary.\r\n // @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys\r\n if (!Object.keys) {\r\n Object.keys = (function () {\r\n var hasOwnProperty = Object.prototype.hasOwnProperty,\r\n hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'),\r\n dontEnums = [\r\n 'toString',\r\n 'toLocaleString',\r\n 'valueOf',\r\n 'hasOwnProperty',\r\n 'isPrototypeOf',\r\n 'propertyIsEnumerable',\r\n 'constructor'\r\n ],\r\n dontEnumsLength = dontEnums.length;\r\n\r\n return function (obj) {\r\n if (typeof obj !== 'function' && (typeof obj !== 'object' || obj === null)) {\r\n throw new TypeError('Object.keys called on non-object');\r\n }\r\n\r\n var result = [], prop, i;\r\n\r\n for (prop in obj) {\r\n if (hasOwnProperty.call(obj, prop)) {\r\n result.push(prop);\r\n }\r\n }\r\n\r\n if (hasDontEnumBug) {\r\n for (i = 0; i < dontEnumsLength; i++) {\r\n if (hasOwnProperty.call(obj, dontEnums[i])) {\r\n result.push(dontEnums[i]);\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n };\r\n }());\r\n }\r\n\r\n var exports = {};\r\n\r\n var VERSION = '5.5.2';\r\n exports.VERSION = VERSION;\r\n\r\n var locales = {\r\n en : {\r\n OK : 'OK',\r\n CANCEL : 'Cancel',\r\n CONFIRM : 'OK'\r\n }\r\n };\r\n\r\n var templates = {\r\n dialog:\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
',\r\n header:\r\n '
' +\r\n '
' +\r\n '
',\r\n footer:\r\n '
',\r\n closeButton:\r\n '',\r\n form:\r\n '
',\r\n button:\r\n '',\r\n option:\r\n '',\r\n promptMessage:\r\n '
',\r\n inputs: {\r\n text:\r\n '',\r\n textarea:\r\n '',\r\n email:\r\n '',\r\n select:\r\n '',\r\n checkbox:\r\n '
',\r\n radio:\r\n '
',\r\n date:\r\n '',\r\n time:\r\n '',\r\n number:\r\n '',\r\n password:\r\n '',\r\n range:\r\n ''\r\n }\r\n };\r\n\r\n\r\n var defaults = {\r\n // default language\r\n locale: 'en',\r\n // show backdrop or not. Default to static so user has to interact with dialog\r\n backdrop: 'static',\r\n // animate the modal in/out\r\n animate: true,\r\n // additional class string applied to the top level dialog\r\n className: null,\r\n // whether or not to include a close button\r\n closeButton: true,\r\n // show the dialog immediately by default\r\n show: true,\r\n // dialog container\r\n container: 'body',\r\n // default value (used by the prompt helper)\r\n value: '',\r\n // default input type (used by the prompt helper)\r\n inputType: 'text',\r\n // switch button order from cancel/confirm (default) to confirm/cancel\r\n swapButtonOrder: false,\r\n // center modal vertically in page\r\n centerVertical: false,\r\n // Append \"multiple\" property to the select when using the \"prompt\" helper\r\n multiple: false,\r\n // Automatically scroll modal content when height exceeds viewport height\r\n scrollable: false,\r\n // whether or not to destroy the modal on hide\r\n reusable: false\r\n };\r\n\r\n\r\n // PUBLIC FUNCTIONS\r\n // *************************************************************************************************************\r\n\r\n // Return all currently registered locales, or a specific locale if \"name\" is defined\r\n exports.locales = function (name) {\r\n return name ? locales[name] : locales;\r\n };\r\n\r\n\r\n // Register localized strings for the OK, CONFIRM, and CANCEL buttons\r\n exports.addLocale = function (name, values) {\r\n $.each(['OK', 'CANCEL', 'CONFIRM'], function (_, v) {\r\n if (!values[v]) {\r\n throw new Error('Please supply a translation for \"' + v + '\"');\r\n }\r\n });\r\n\r\n locales[name] = {\r\n OK: values.OK,\r\n CANCEL: values.CANCEL,\r\n CONFIRM: values.CONFIRM\r\n };\r\n\r\n return exports;\r\n };\r\n\r\n\r\n // Remove a previously-registered locale\r\n exports.removeLocale = function (name) {\r\n if (name !== 'en') {\r\n delete locales[name];\r\n }\r\n else {\r\n throw new Error('\"en\" is used as the default and fallback locale and cannot be removed.');\r\n }\r\n\r\n return exports;\r\n };\r\n\r\n\r\n // Set the default locale\r\n exports.setLocale = function (name) {\r\n return exports.setDefaults('locale', name);\r\n };\r\n\r\n\r\n // Override default value(s) of Bootbox.\r\n exports.setDefaults = function () {\r\n var values = {};\r\n\r\n if (arguments.length === 2) {\r\n // allow passing of single key/value...\r\n values[arguments[0]] = arguments[1];\r\n } else {\r\n // ... and as an object too\r\n values = arguments[0];\r\n }\r\n\r\n $.extend(defaults, values);\r\n\r\n return exports;\r\n };\r\n\r\n\r\n // Hides all currently active Bootbox modals\r\n exports.hideAll = function () {\r\n $('.bootbox').modal('hide');\r\n\r\n return exports;\r\n };\r\n\r\n\r\n // Allows the base init() function to be overridden\r\n exports.init = function (_$) {\r\n return init(_$ || $);\r\n };\r\n\r\n\r\n // CORE HELPER FUNCTIONS\r\n // *************************************************************************************************************\r\n\r\n // Core dialog function\r\n exports.dialog = function (options) {\r\n if ($.fn.modal === undefined) {\r\n throw new Error(\r\n '\"$.fn.modal\" is not defined; please double check you have included ' +\r\n 'the Bootstrap JavaScript library. See https://getbootstrap.com/docs/4.4/getting-started/javascript/ ' +\r\n 'for more details.'\r\n );\r\n }\r\n\r\n options = sanitize(options);\r\n\r\n if ($.fn.modal.Constructor.VERSION) {\r\n options.fullBootstrapVersion = $.fn.modal.Constructor.VERSION;\r\n var i = options.fullBootstrapVersion.indexOf('.');\r\n options.bootstrap = options.fullBootstrapVersion.substring(0, i);\r\n }\r\n else {\r\n // Assuming version 2.3.2, as that was the last \"supported\" 2.x version\r\n options.bootstrap = '2';\r\n options.fullBootstrapVersion = '2.3.2';\r\n console.warn('Bootbox will *mostly* work with Bootstrap 2, but we do not officially support it. Please upgrade, if possible.');\r\n }\r\n\r\n var dialog = $(templates.dialog);\r\n var innerDialog = dialog.find('.modal-dialog');\r\n var body = dialog.find('.modal-body');\r\n var header = $(templates.header);\r\n var footer = $(templates.footer);\r\n var buttons = options.buttons;\r\n\r\n var callbacks = {\r\n onEscape: options.onEscape\r\n };\r\n\r\n body.find('.bootbox-body').html(options.message);\r\n\r\n // Only attempt to create buttons if at least one has \r\n // been defined in the options object\r\n if (getKeyLength(options.buttons) > 0) {\r\n each(buttons, function (key, b) {\r\n var button = $(templates.button);\r\n button.data('bb-handler', key);\r\n button.addClass(b.className);\r\n\r\n switch (key) {\r\n case 'ok':\r\n case 'confirm':\r\n button.addClass('bootbox-accept');\r\n break;\r\n\r\n case 'cancel':\r\n button.addClass('bootbox-cancel');\r\n break;\r\n }\r\n\r\n button.html(b.label);\r\n footer.append(button);\r\n\r\n callbacks[key] = b.callback;\r\n });\r\n\r\n body.after(footer);\r\n }\r\n\r\n if (options.animate === true) {\r\n dialog.addClass('fade');\r\n }\r\n\r\n if (options.className) {\r\n dialog.addClass(options.className);\r\n }\r\n\r\n if (options.size) {\r\n // Requires Bootstrap 3.1.0 or higher\r\n if (options.fullBootstrapVersion.substring(0, 3) < '3.1') {\r\n console.warn('\"size\" requires Bootstrap 3.1.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n\r\n switch (options.size) {\r\n case 'small':\r\n case 'sm':\r\n innerDialog.addClass('modal-sm');\r\n break;\r\n\r\n case 'large':\r\n case 'lg':\r\n innerDialog.addClass('modal-lg');\r\n break;\r\n\r\n case 'extra-large':\r\n case 'xl':\r\n innerDialog.addClass('modal-xl');\r\n\r\n // Requires Bootstrap 4.2.0 or higher\r\n if (options.fullBootstrapVersion.substring(0, 3) < '4.2') {\r\n console.warn('Using size \"xl\"/\"extra-large\" requires Bootstrap 4.2.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n break;\r\n }\r\n }\r\n\r\n if (options.scrollable) {\r\n innerDialog.addClass('modal-dialog-scrollable');\r\n\r\n // Requires Bootstrap 4.3.0 or higher\r\n if (options.fullBootstrapVersion.substring(0, 3) < '4.3') {\r\n console.warn('Using \"scrollable\" requires Bootstrap 4.3.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n }\r\n\r\n if (options.title) {\r\n body.before(header);\r\n dialog.find('.modal-title').html(options.title);\r\n }\r\n\r\n if (options.closeButton) {\r\n var closeButton = $(templates.closeButton);\r\n\r\n if (options.title) {\r\n if (options.bootstrap > 3) {\r\n dialog.find('.modal-header').append(closeButton);\r\n }\r\n else {\r\n dialog.find('.modal-header').prepend(closeButton);\r\n }\r\n } else {\r\n closeButton.prependTo(body);\r\n }\r\n }\r\n\r\n if (options.centerVertical) {\r\n innerDialog.addClass('modal-dialog-centered');\r\n\r\n // Requires Bootstrap 4.0.0-beta.3 or higher\r\n if (options.fullBootstrapVersion < '4.0.0') {\r\n console.warn('\"centerVertical\" requires Bootstrap 4.0.0-beta.3 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n }\r\n\r\n // Bootstrap event listeners; these handle extra\r\n // setup & teardown required after the underlying\r\n // modal has performed certain actions.\r\n\r\n if(!options.reusable) {\r\n // make sure we unbind any listeners once the dialog has definitively been dismissed\r\n dialog.one('hide.bs.modal', { dialog: dialog }, unbindModal);\r\n }\r\n\r\n if (options.onHide) {\r\n if ($.isFunction(options.onHide)) {\r\n dialog.on('hide.bs.modal', options.onHide);\r\n }\r\n else {\r\n throw new Error('Argument supplied to \"onHide\" must be a function');\r\n }\r\n }\r\n\r\n if(!options.reusable) {\r\n dialog.one('hidden.bs.modal', { dialog: dialog }, destroyModal);\r\n }\r\n\r\n if (options.onHidden) {\r\n if ($.isFunction(options.onHidden)) {\r\n dialog.on('hidden.bs.modal', options.onHidden);\r\n }\r\n else {\r\n throw new Error('Argument supplied to \"onHidden\" must be a function');\r\n }\r\n }\r\n\r\n if (options.onShow) {\r\n if ($.isFunction(options.onShow)) {\r\n dialog.on('show.bs.modal', options.onShow);\r\n }\r\n else {\r\n throw new Error('Argument supplied to \"onShow\" must be a function');\r\n }\r\n }\r\n\r\n dialog.one('shown.bs.modal', { dialog: dialog }, focusPrimaryButton);\r\n\r\n if (options.onShown) {\r\n if ($.isFunction(options.onShown)) {\r\n dialog.on('shown.bs.modal', options.onShown);\r\n }\r\n else {\r\n throw new Error('Argument supplied to \"onShown\" must be a function');\r\n }\r\n }\r\n\r\n // Bootbox event listeners; used to decouple some\r\n // behaviours from their respective triggers\r\n\r\n if (options.backdrop === true) {\r\n // A boolean true/false according to the Bootstrap docs\r\n // should show a dialog the user can dismiss by clicking on\r\n // the background.\r\n // We always only ever pass static/false to the actual\r\n // $.modal function because with \"true\" we can't trap\r\n // this event (the .modal-backdrop swallows it)\r\n // However, we still want to sort-of respect true\r\n // and invoke the escape mechanism instead\r\n dialog.on('click.dismiss.bs.modal', function (e) {\r\n // @NOTE: the target varies in >= 3.3.x releases since the modal backdrop\r\n // moved *inside* the outer dialog rather than *alongside* it\r\n if (dialog.children('.modal-backdrop').length) {\r\n e.currentTarget = dialog.children('.modal-backdrop').get(0);\r\n }\r\n\r\n if (e.target !== e.currentTarget) {\r\n return;\r\n }\r\n\r\n dialog.trigger('escape.close.bb');\r\n });\r\n }\r\n\r\n dialog.on('escape.close.bb', function (e) {\r\n // the if statement looks redundant but it isn't; without it\r\n // if we *didn't* have an onEscape handler then processCallback\r\n // would automatically dismiss the dialog\r\n if (callbacks.onEscape) {\r\n processCallback(e, dialog, callbacks.onEscape);\r\n }\r\n });\r\n\r\n\r\n dialog.on('click', '.modal-footer button:not(.disabled)', function (e) {\r\n var callbackKey = $(this).data('bb-handler');\r\n\r\n if (callbackKey !== undefined) {\r\n // Only process callbacks for buttons we recognize:\r\n processCallback(e, dialog, callbacks[callbackKey]);\r\n }\r\n });\r\n\r\n dialog.on('click', '.bootbox-close-button', function (e) {\r\n // onEscape might be falsy but that's fine; the fact is\r\n // if the user has managed to click the close button we\r\n // have to close the dialog, callback or not\r\n processCallback(e, dialog, callbacks.onEscape);\r\n });\r\n\r\n dialog.on('keyup', function (e) {\r\n if (e.which === 27) {\r\n dialog.trigger('escape.close.bb');\r\n }\r\n });\r\n\r\n // the remainder of this method simply deals with adding our\r\n // dialog element to the DOM, augmenting it with Bootstrap's modal\r\n // functionality and then giving the resulting object back\r\n // to our caller\r\n\r\n $(options.container).append(dialog);\r\n\r\n dialog.modal({\r\n backdrop: options.backdrop,\r\n keyboard: false,\r\n show: false\r\n });\r\n\r\n if (options.show) {\r\n dialog.modal('show');\r\n }\r\n\r\n return dialog;\r\n };\r\n\r\n\r\n // Helper function to simulate the native alert() behavior. **NOTE**: This is non-blocking, so any\r\n // code that must happen after the alert is dismissed should be placed within the callback function \r\n // for this alert.\r\n exports.alert = function () {\r\n var options;\r\n\r\n options = mergeDialogOptions('alert', ['ok'], ['message', 'callback'], arguments);\r\n\r\n // @TODO: can this move inside exports.dialog when we're iterating over each\r\n // button and checking its button.callback value instead?\r\n if (options.callback && !$.isFunction(options.callback)) {\r\n throw new Error('alert requires the \"callback\" property to be a function when provided');\r\n }\r\n\r\n // override the ok and escape callback to make sure they just invoke\r\n // the single user-supplied one (if provided)\r\n options.buttons.ok.callback = options.onEscape = function () {\r\n if ($.isFunction(options.callback)) {\r\n return options.callback.call(this);\r\n }\r\n\r\n return true;\r\n };\r\n\r\n return exports.dialog(options);\r\n };\r\n\r\n\r\n // Helper function to simulate the native confirm() behavior. **NOTE**: This is non-blocking, so any\r\n // code that must happen after the confirm is dismissed should be placed within the callback function \r\n // for this confirm.\r\n exports.confirm = function () {\r\n var options;\r\n\r\n options = mergeDialogOptions('confirm', ['cancel', 'confirm'], ['message', 'callback'], arguments);\r\n\r\n // confirm specific validation; they don't make sense without a callback so make\r\n // sure it's present\r\n if (!$.isFunction(options.callback)) {\r\n throw new Error('confirm requires a callback');\r\n }\r\n\r\n // overrides; undo anything the user tried to set they shouldn't have\r\n options.buttons.cancel.callback = options.onEscape = function () {\r\n return options.callback.call(this, false);\r\n };\r\n\r\n options.buttons.confirm.callback = function () {\r\n return options.callback.call(this, true);\r\n };\r\n\r\n return exports.dialog(options);\r\n };\r\n\r\n\r\n // Helper function to simulate the native prompt() behavior. **NOTE**: This is non-blocking, so any\r\n // code that must happen after the prompt is dismissed should be placed within the callback function \r\n // for this prompt.\r\n exports.prompt = function () {\r\n var options;\r\n var promptDialog;\r\n var form;\r\n var input;\r\n var shouldShow;\r\n var inputOptions;\r\n\r\n // we have to create our form first otherwise\r\n // its value is undefined when gearing up our options\r\n // @TODO this could be solved by allowing message to\r\n // be a function instead...\r\n form = $(templates.form);\r\n\r\n // prompt defaults are more complex than others in that\r\n // users can override more defaults\r\n options = mergeDialogOptions('prompt', ['cancel', 'confirm'], ['title', 'callback'], arguments);\r\n\r\n if (!options.value) {\r\n options.value = defaults.value;\r\n }\r\n\r\n if (!options.inputType) {\r\n options.inputType = defaults.inputType;\r\n }\r\n\r\n // capture the user's show value; we always set this to false before\r\n // spawning the dialog to give us a chance to attach some handlers to\r\n // it, but we need to make sure we respect a preference not to show it\r\n shouldShow = (options.show === undefined) ? defaults.show : options.show;\r\n\r\n // This is required prior to calling the dialog builder below - we need to \r\n // add an event handler just before the prompt is shown\r\n options.show = false;\r\n\r\n // Handles the 'cancel' action\r\n options.buttons.cancel.callback = options.onEscape = function () {\r\n return options.callback.call(this, null);\r\n };\r\n\r\n // Prompt submitted - extract the prompt value. This requires a bit of work, \r\n // given the different input types available.\r\n options.buttons.confirm.callback = function () {\r\n var value;\r\n\r\n if (options.inputType === 'checkbox') {\r\n value = input.find('input:checked').map(function () {\r\n return $(this).val();\r\n }).get();\r\n } else if (options.inputType === 'radio') {\r\n value = input.find('input:checked').val();\r\n }\r\n else {\r\n if (input[0].checkValidity && !input[0].checkValidity()) {\r\n // prevents button callback from being called\r\n return false;\r\n } else {\r\n if (options.inputType === 'select' && options.multiple === true) {\r\n value = input.find('option:selected').map(function () {\r\n return $(this).val();\r\n }).get();\r\n }\r\n else {\r\n value = input.val();\r\n }\r\n }\r\n }\r\n\r\n return options.callback.call(this, value);\r\n };\r\n\r\n // prompt-specific validation\r\n if (!options.title) {\r\n throw new Error('prompt requires a title');\r\n }\r\n\r\n if (!$.isFunction(options.callback)) {\r\n throw new Error('prompt requires a callback');\r\n }\r\n\r\n if (!templates.inputs[options.inputType]) {\r\n throw new Error('Invalid prompt type');\r\n }\r\n\r\n // create the input based on the supplied type\r\n input = $(templates.inputs[options.inputType]);\r\n\r\n switch (options.inputType) {\r\n case 'text':\r\n case 'textarea':\r\n case 'email':\r\n case 'password':\r\n input.val(options.value);\r\n\r\n if (options.placeholder) {\r\n input.attr('placeholder', options.placeholder);\r\n }\r\n\r\n if (options.pattern) {\r\n input.attr('pattern', options.pattern);\r\n }\r\n\r\n if (options.maxlength) {\r\n input.attr('maxlength', options.maxlength);\r\n }\r\n\r\n if (options.required) {\r\n input.prop({ 'required': true });\r\n }\r\n\r\n if (options.rows && !isNaN(parseInt(options.rows))) {\r\n if (options.inputType === 'textarea') {\r\n input.attr({ 'rows': options.rows });\r\n }\r\n }\r\n\r\n break;\r\n\r\n\r\n case 'date':\r\n case 'time':\r\n case 'number':\r\n case 'range':\r\n input.val(options.value);\r\n\r\n if (options.placeholder) {\r\n input.attr('placeholder', options.placeholder);\r\n }\r\n\r\n if (options.pattern) {\r\n input.attr('pattern', options.pattern);\r\n }\r\n\r\n if (options.required) {\r\n input.prop({ 'required': true });\r\n }\r\n\r\n // These input types have extra attributes which affect their input validation.\r\n // Warning: For most browsers, date inputs are buggy in their implementation of 'step', so \r\n // this attribute will have no effect. Therefore, we don't set the attribute for date inputs.\r\n // @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates\r\n if (options.inputType !== 'date') {\r\n if (options.step) {\r\n if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) {\r\n input.attr('step', options.step);\r\n }\r\n else {\r\n throw new Error('\"step\" must be a valid positive number or the value \"any\". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');\r\n }\r\n }\r\n }\r\n\r\n if (minAndMaxAreValid(options.inputType, options.min, options.max)) {\r\n if (options.min !== undefined) {\r\n input.attr('min', options.min);\r\n }\r\n if (options.max !== undefined) {\r\n input.attr('max', options.max);\r\n }\r\n }\r\n\r\n break;\r\n\r\n\r\n case 'select':\r\n var groups = {};\r\n inputOptions = options.inputOptions || [];\r\n\r\n if (!$.isArray(inputOptions)) {\r\n throw new Error('Please pass an array of input options');\r\n }\r\n\r\n if (!inputOptions.length) {\r\n throw new Error('prompt with \"inputType\" set to \"select\" requires at least one option');\r\n }\r\n\r\n // placeholder is not actually a valid attribute for select,\r\n // but we'll allow it, assuming it might be used for a plugin\r\n if (options.placeholder) {\r\n input.attr('placeholder', options.placeholder);\r\n }\r\n\r\n if (options.required) {\r\n input.prop({ 'required': true });\r\n }\r\n\r\n if (options.multiple) {\r\n input.prop({ 'multiple': true });\r\n }\r\n\r\n each(inputOptions, function (_, option) {\r\n // assume the element to attach to is the input...\r\n var elem = input;\r\n\r\n if (option.value === undefined || option.text === undefined) {\r\n throw new Error('each option needs a \"value\" property and a \"text\" property');\r\n }\r\n\r\n // ... but override that element if this option sits in a group\r\n\r\n if (option.group) {\r\n // initialise group if necessary\r\n if (!groups[option.group]) {\r\n groups[option.group] = $('').attr('label', option.group);\r\n }\r\n\r\n elem = groups[option.group];\r\n }\r\n\r\n var o = $(templates.option);\r\n o.attr('value', option.value).text(option.text);\r\n elem.append(o);\r\n });\r\n\r\n each(groups, function (_, group) {\r\n input.append(group);\r\n });\r\n\r\n // safe to set a select's value as per a normal input\r\n input.val(options.value);\r\n\r\n break;\r\n\r\n\r\n case 'checkbox':\r\n var checkboxValues = $.isArray(options.value) ? options.value : [options.value];\r\n inputOptions = options.inputOptions || [];\r\n\r\n if (!inputOptions.length) {\r\n throw new Error('prompt with \"inputType\" set to \"checkbox\" requires at least one option');\r\n }\r\n\r\n // checkboxes have to nest within a containing element, so\r\n // they break the rules a bit and we end up re-assigning\r\n // our 'input' element to this container instead\r\n input = $('
');\r\n\r\n each(inputOptions, function (_, option) {\r\n if (option.value === undefined || option.text === undefined) {\r\n throw new Error('each option needs a \"value\" property and a \"text\" property');\r\n }\r\n\r\n var checkbox = $(templates.inputs[options.inputType]);\r\n\r\n checkbox.find('input').attr('value', option.value);\r\n checkbox.find('label').append('\\n' + option.text);\r\n\r\n // we've ensured values is an array so we can always iterate over it\r\n each(checkboxValues, function (_, value) {\r\n if (value === option.value) {\r\n checkbox.find('input').prop('checked', true);\r\n }\r\n });\r\n\r\n input.append(checkbox);\r\n });\r\n break;\r\n\r\n\r\n case 'radio':\r\n // Make sure that value is not an array (only a single radio can ever be checked)\r\n if (options.value !== undefined && $.isArray(options.value)) {\r\n throw new Error('prompt with \"inputType\" set to \"radio\" requires a single, non-array value for \"value\"');\r\n }\r\n\r\n inputOptions = options.inputOptions || [];\r\n\r\n if (!inputOptions.length) {\r\n throw new Error('prompt with \"inputType\" set to \"radio\" requires at least one option');\r\n }\r\n\r\n // Radiobuttons have to nest within a containing element, so\r\n // they break the rules a bit and we end up re-assigning\r\n // our 'input' element to this container instead\r\n input = $('
');\r\n\r\n // Radiobuttons should always have an initial checked input checked in a \"group\".\r\n // If value is undefined or doesn't match an input option, select the first radiobutton\r\n var checkFirstRadio = true;\r\n\r\n each(inputOptions, function (_, option) {\r\n if (option.value === undefined || option.text === undefined) {\r\n throw new Error('each option needs a \"value\" property and a \"text\" property');\r\n }\r\n\r\n var radio = $(templates.inputs[options.inputType]);\r\n\r\n radio.find('input').attr('value', option.value);\r\n radio.find('label').append('\\n' + option.text);\r\n\r\n if (options.value !== undefined) {\r\n if (option.value === options.value) {\r\n radio.find('input').prop('checked', true);\r\n checkFirstRadio = false;\r\n }\r\n }\r\n\r\n input.append(radio);\r\n });\r\n\r\n if (checkFirstRadio) {\r\n input.find('input[type=\"radio\"]').first().prop('checked', true);\r\n }\r\n break;\r\n }\r\n\r\n // now place it in our form\r\n form.append(input);\r\n\r\n form.on('submit', function (e) {\r\n e.preventDefault();\r\n // Fix for SammyJS (or similar JS routing library) hijacking the form post.\r\n e.stopPropagation();\r\n\r\n // @TODO can we actually click *the* button object instead?\r\n // e.g. buttons.confirm.click() or similar\r\n promptDialog.find('.bootbox-accept').trigger('click');\r\n });\r\n\r\n if ($.trim(options.message) !== '') {\r\n // Add the form to whatever content the user may have added.\r\n var message = $(templates.promptMessage).html(options.message);\r\n form.prepend(message);\r\n options.message = form;\r\n }\r\n else {\r\n options.message = form;\r\n }\r\n\r\n // Generate the dialog\r\n promptDialog = exports.dialog(options);\r\n\r\n // clear the existing handler focusing the submit button...\r\n promptDialog.off('shown.bs.modal', focusPrimaryButton);\r\n\r\n // ...and replace it with one focusing our input, if possible\r\n promptDialog.on('shown.bs.modal', function () {\r\n // need the closure here since input isn't\r\n // an object otherwise\r\n input.focus();\r\n });\r\n\r\n if (shouldShow === true) {\r\n promptDialog.modal('show');\r\n }\r\n\r\n return promptDialog;\r\n };\r\n\r\n\r\n // INTERNAL FUNCTIONS\r\n // *************************************************************************************************************\r\n\r\n // Map a flexible set of arguments into a single returned object\r\n // If args.length is already one just return it, otherwise\r\n // use the properties argument to map the unnamed args to\r\n // object properties.\r\n // So in the latter case:\r\n // mapArguments([\"foo\", $.noop], [\"message\", \"callback\"])\r\n // -> { message: \"foo\", callback: $.noop }\r\n function mapArguments(args, properties) {\r\n var argn = args.length;\r\n var options = {};\r\n\r\n if (argn < 1 || argn > 2) {\r\n throw new Error('Invalid argument length');\r\n }\r\n\r\n if (argn === 2 || typeof args[0] === 'string') {\r\n options[properties[0]] = args[0];\r\n options[properties[1]] = args[1];\r\n } else {\r\n options = args[0];\r\n }\r\n\r\n return options;\r\n }\r\n\r\n\r\n // Merge a set of default dialog options with user supplied arguments\r\n function mergeArguments(defaults, args, properties) {\r\n return $.extend(\r\n // deep merge\r\n true,\r\n // ensure the target is an empty, unreferenced object\r\n {},\r\n // the base options object for this type of dialog (often just buttons)\r\n defaults,\r\n // args could be an object or array; if it's an array properties will\r\n // map it to a proper options object\r\n mapArguments(\r\n args,\r\n properties\r\n )\r\n );\r\n }\r\n\r\n\r\n // This entry-level method makes heavy use of composition to take a simple\r\n // range of inputs and return valid options suitable for passing to bootbox.dialog\r\n function mergeDialogOptions(className, labels, properties, args) {\r\n var locale;\r\n if (args && args[0]) {\r\n locale = args[0].locale || defaults.locale;\r\n var swapButtons = args[0].swapButtonOrder || defaults.swapButtonOrder;\r\n\r\n if (swapButtons) {\r\n labels = labels.reverse();\r\n }\r\n }\r\n\r\n // build up a base set of dialog properties\r\n var baseOptions = {\r\n className: 'bootbox-' + className,\r\n buttons: createLabels(labels, locale)\r\n };\r\n\r\n // Ensure the buttons properties generated, *after* merging\r\n // with user args are still valid against the supplied labels\r\n return validateButtons(\r\n // merge the generated base properties with user supplied arguments\r\n mergeArguments(\r\n baseOptions,\r\n args,\r\n // if args.length > 1, properties specify how each arg maps to an object key\r\n properties\r\n ),\r\n labels\r\n );\r\n }\r\n\r\n\r\n // Checks each button object to see if key is valid. \r\n // This function will only be called by the alert, confirm, and prompt helpers. \r\n function validateButtons(options, buttons) {\r\n var allowedButtons = {};\r\n each(buttons, function (key, value) {\r\n allowedButtons[value] = true;\r\n });\r\n\r\n each(options.buttons, function (key) {\r\n if (allowedButtons[key] === undefined) {\r\n throw new Error('button key \"' + key + '\" is not allowed (options are ' + buttons.join(' ') + ')');\r\n }\r\n });\r\n\r\n return options;\r\n }\r\n\r\n\r\n\r\n // From a given list of arguments, return a suitable object of button labels.\r\n // All this does is normalise the given labels and translate them where possible.\r\n // e.g. \"ok\", \"confirm\" -> { ok: \"OK\", cancel: \"Annuleren\" }\r\n function createLabels(labels, locale) {\r\n var buttons = {};\r\n\r\n for (var i = 0, j = labels.length; i < j; i++) {\r\n var argument = labels[i];\r\n var key = argument.toLowerCase();\r\n var value = argument.toUpperCase();\r\n\r\n buttons[key] = {\r\n label: getText(value, locale)\r\n };\r\n }\r\n\r\n return buttons;\r\n }\r\n\r\n\r\n\r\n // Get localized text from a locale. Defaults to 'en' locale if no locale \r\n // provided or a non-registered locale is requested\r\n function getText(key, locale) {\r\n var labels = locales[locale];\r\n\r\n return labels ? labels[key] : locales.en[key];\r\n }\r\n\r\n\r\n\r\n // Filter and tidy up any user supplied parameters to this dialog.\r\n // Also looks for any shorthands used and ensures that the options\r\n // which are returned are all normalized properly\r\n function sanitize(options) {\r\n var buttons;\r\n var total;\r\n\r\n if (typeof options !== 'object') {\r\n throw new Error('Please supply an object of options');\r\n }\r\n\r\n if (!options.message) {\r\n throw new Error('\"message\" option must not be null or an empty string.');\r\n }\r\n\r\n // make sure any supplied options take precedence over defaults\r\n options = $.extend({}, defaults, options);\r\n\r\n //make sure backdrop is either true, false, or 'static'\r\n if (!options.backdrop) {\r\n options.backdrop = (options.backdrop === false || options.backdrop === 0) ? false : 'static';\r\n } else {\r\n options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true;\r\n } \r\n\r\n // no buttons is still a valid dialog but it's cleaner to always have\r\n // a buttons object to iterate over, even if it's empty\r\n if (!options.buttons) {\r\n options.buttons = {};\r\n }\r\n \r\n buttons = options.buttons;\r\n\r\n total = getKeyLength(buttons);\r\n\r\n each(buttons, function (key, button, index) {\r\n if ($.isFunction(button)) {\r\n // short form, assume value is our callback. Since button\r\n // isn't an object it isn't a reference either so re-assign it\r\n button = buttons[key] = {\r\n callback: button\r\n };\r\n }\r\n\r\n // before any further checks make sure by now button is the correct type\r\n if ($.type(button) !== 'object') {\r\n throw new Error('button with key \"' + key + '\" must be an object');\r\n }\r\n\r\n if (!button.label) {\r\n // the lack of an explicit label means we'll assume the key is good enough\r\n button.label = key;\r\n }\r\n\r\n if (!button.className) {\r\n var isPrimary = false;\r\n if (options.swapButtonOrder) {\r\n isPrimary = index === 0;\r\n }\r\n else {\r\n isPrimary = index === total - 1;\r\n }\r\n\r\n if (total <= 2 && isPrimary) {\r\n // always add a primary to the main option in a one or two-button dialog\r\n button.className = 'btn-primary';\r\n } else {\r\n // adding both classes allows us to target both BS3 and BS4 without needing to check the version\r\n button.className = 'btn-secondary btn-default';\r\n }\r\n }\r\n });\r\n\r\n return options;\r\n }\r\n\r\n\r\n // Returns a count of the properties defined on the object\r\n function getKeyLength(obj) {\r\n return Object.keys(obj).length;\r\n }\r\n\r\n\r\n // Tiny wrapper function around jQuery.each; just adds index as the third parameter\r\n function each(collection, iterator) {\r\n var index = 0;\r\n $.each(collection, function (key, value) {\r\n iterator(key, value, index++);\r\n });\r\n }\r\n\r\n\r\n function focusPrimaryButton(e) {\r\n e.data.dialog.find('.bootbox-accept').first().trigger('focus');\r\n }\r\n\r\n\r\n function destroyModal(e) {\r\n // ensure we don't accidentally intercept hidden events triggered\r\n // by children of the current dialog. We shouldn't need to handle this anymore, \r\n // now that Bootstrap namespaces its events, but still worth doing.\r\n if (e.target === e.data.dialog[0]) {\r\n e.data.dialog.remove();\r\n }\r\n }\r\n\r\n\r\n function unbindModal(e) {\r\n if (e.target === e.data.dialog[0]) {\r\n e.data.dialog.off('escape.close.bb');\r\n e.data.dialog.off('click');\r\n }\r\n }\r\n\r\n\r\n // Handle the invoked dialog callback\r\n function processCallback(e, dialog, callback) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n\r\n // by default we assume a callback will get rid of the dialog,\r\n // although it is given the opportunity to override this\r\n\r\n // so, if the callback can be invoked and it *explicitly returns false*\r\n // then we'll set a flag to keep the dialog active...\r\n var preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false;\r\n\r\n // ... otherwise we'll bin it\r\n if (!preserveDialog) {\r\n dialog.modal('hide');\r\n }\r\n }\r\n\r\n // Validate `min` and `max` values based on the current `inputType` value\r\n function minAndMaxAreValid(type, min, max) {\r\n var result = false;\r\n var minValid = true;\r\n var maxValid = true;\r\n\r\n if (type === 'date') {\r\n if (min !== undefined && !(minValid = dateIsValid(min))) {\r\n console.warn('Browsers which natively support the \"date\" input type expect date values to be of the form \"YYYY-MM-DD\" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your min value may not be enforced by this browser.');\r\n }\r\n else if (max !== undefined && !(maxValid = dateIsValid(max))) {\r\n console.warn('Browsers which natively support the \"date\" input type expect date values to be of the form \"YYYY-MM-DD\" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your max value may not be enforced by this browser.');\r\n }\r\n }\r\n else if (type === 'time') {\r\n if (min !== undefined && !(minValid = timeIsValid(min))) {\r\n throw new Error('\"min\" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');\r\n }\r\n else if (max !== undefined && !(maxValid = timeIsValid(max))) {\r\n throw new Error('\"max\" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');\r\n }\r\n }\r\n else {\r\n if (min !== undefined && isNaN(min)) {\r\n minValid = false;\r\n throw new Error('\"min\" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.');\r\n }\r\n\r\n if (max !== undefined && isNaN(max)) {\r\n maxValid = false;\r\n throw new Error('\"max\" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');\r\n }\r\n }\r\n\r\n if (minValid && maxValid) {\r\n if (max <= min) {\r\n throw new Error('\"max\" must be greater than \"min\". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');\r\n }\r\n else {\r\n result = true;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function timeIsValid(value) {\r\n return /([01][0-9]|2[0-3]):[0-5][0-9]?:[0-5][0-9]/.test(value);\r\n }\r\n\r\n function dateIsValid(value) {\r\n return /(\\d{4})-(\\d{2})-(\\d{2})/.test(value);\r\n }\r\n\r\n // The Bootbox object\r\n return exports;\r\n}));\r\n"],"sourceRoot":"webpack:///"}