sweetalert2 11.7.20 → 11.7.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sweetalert2 v11.7.20
2
+ * sweetalert2 v11.7.21
3
3
  * Released under the MIT License.
4
4
  */
5
5
  (function (global, factory) {
@@ -652,7 +652,7 @@
652
652
  /**
653
653
  * borrowed from jquery $(elem).is(':visible') implementation
654
654
  *
655
- * @param {HTMLElement} elem
655
+ * @param {HTMLElement | null} elem
656
656
  * @returns {boolean}
657
657
  */
658
658
  const isVisible$1 = elem => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length));
@@ -688,6 +688,9 @@
688
688
  const animateTimerProgressBar = function (timer) {
689
689
  let reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
690
690
  const timerProgressBar = getTimerProgressBar();
691
+ if (!timerProgressBar) {
692
+ return;
693
+ }
691
694
  if (isVisible$1(timerProgressBar)) {
692
695
  if (reset) {
693
696
  timerProgressBar.style.transition = 'none';
@@ -701,6 +704,9 @@
701
704
  };
702
705
  const stopTimerProgressBar = () => {
703
706
  const timerProgressBar = getTimerProgressBar();
707
+ if (!timerProgressBar) {
708
+ return;
709
+ }
704
710
  const timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width);
705
711
  timerProgressBar.style.removeProperty('transition');
706
712
  timerProgressBar.style.width = '100%';
@@ -2321,7 +2327,7 @@
2321
2327
  * Shows loader (spinner), this is useful with AJAX requests.
2322
2328
  * By default the loader be shown instead of the "Confirm" button.
2323
2329
  *
2324
- * @param {HTMLButtonElement} [buttonToReplace]
2330
+ * @param {HTMLButtonElement | null} [buttonToReplace]
2325
2331
  */
2326
2332
  const showLoading = buttonToReplace => {
2327
2333
  let popup = getPopup();
@@ -2330,6 +2336,9 @@
2330
2336
  }
2331
2337
 
2332
2338
  popup = getPopup();
2339
+ if (!popup) {
2340
+ return;
2341
+ }
2333
2342
  const loader = getLoader();
2334
2343
  if (isToast()) {
2335
2344
  hide(getIcon());
@@ -2344,11 +2353,14 @@
2344
2353
 
2345
2354
  /**
2346
2355
  * @param {HTMLElement} popup
2347
- * @param {HTMLButtonElement} [buttonToReplace]
2356
+ * @param {HTMLButtonElement | null} [buttonToReplace]
2348
2357
  */
2349
2358
  const replaceButton = (popup, buttonToReplace) => {
2350
2359
  const actions = getActions();
2351
2360
  const loader = getLoader();
2361
+ if (!actions || !loader) {
2362
+ return;
2363
+ }
2352
2364
  if (!buttonToReplace && isVisible$1(getConfirmButton())) {
2353
2365
  buttonToReplace = getConfirmButton();
2354
2366
  }
@@ -2356,13 +2368,13 @@
2356
2368
  if (buttonToReplace) {
2357
2369
  hide(buttonToReplace);
2358
2370
  loader.setAttribute('data-button-to-replace', buttonToReplace.className);
2371
+ actions.insertBefore(loader, buttonToReplace);
2359
2372
  }
2360
- loader.parentNode.insertBefore(loader, buttonToReplace);
2361
2373
  addClass([popup, actions], swalClasses.loading);
2362
2374
  };
2363
2375
 
2364
2376
  /**
2365
- * @typedef { string | number | boolean } InputValue
2377
+ * @typedef { string | number | boolean | undefined } InputValue
2366
2378
  */
2367
2379
 
2368
2380
  /**
@@ -2372,7 +2384,7 @@
2372
2384
  const handleInputOptionsAndValue = (instance, params) => {
2373
2385
  if (params.input === 'select' || params.input === 'radio') {
2374
2386
  handleInputOptions(instance, params);
2375
- } else if (['text', 'email', 'number', 'tel', 'textarea'].includes(params.input) && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) {
2387
+ } else if (['text', 'email', 'number', 'tel', 'textarea'].some(i => i === params.input) && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) {
2376
2388
  showLoading(getConfirmButton());
2377
2389
  handleInputValue(instance, params);
2378
2390
  }
@@ -2416,7 +2428,7 @@
2416
2428
  * @param {HTMLInputElement} input
2417
2429
  * @returns {FileList | File | null}
2418
2430
  */
2419
- const getFileValue = input => input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null;
2431
+ const getFileValue = input => input.files && input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null;
2420
2432
 
2421
2433
  /**
2422
2434
  * @param {SweetAlert} instance
@@ -2424,11 +2436,18 @@
2424
2436
  */
2425
2437
  const handleInputOptions = (instance, params) => {
2426
2438
  const popup = getPopup();
2439
+ if (!popup) {
2440
+ return;
2441
+ }
2427
2442
  /**
2428
2443
  * @param {Record<string, any>} inputOptions
2429
2444
  */
2430
2445
  const processInputOptions = inputOptions => {
2431
- populateInputOptions[params.input](popup, formatInputOptions(inputOptions), params);
2446
+ if (params.input === 'select') {
2447
+ populateSelectOptions(popup, formatInputOptions(inputOptions), params);
2448
+ } else if (params.input === 'radio') {
2449
+ populateRadioOptions(popup, formatInputOptions(inputOptions), params);
2450
+ }
2432
2451
  };
2433
2452
  if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) {
2434
2453
  showLoading(getConfirmButton());
@@ -2449,6 +2468,9 @@
2449
2468
  */
2450
2469
  const handleInputValue = (instance, params) => {
2451
2470
  const input = instance.getInput();
2471
+ if (!input) {
2472
+ return;
2473
+ }
2452
2474
  hide(input);
2453
2475
  asPromise(params.inputValue).then(inputValue => {
2454
2476
  input.value = params.input === 'number' ? `${parseFloat(inputValue) || 0}` : `${inputValue}`;
@@ -2463,88 +2485,96 @@
2463
2485
  instance.hideLoading();
2464
2486
  });
2465
2487
  };
2466
- const populateInputOptions = {
2467
- /**
2468
- * @param {HTMLElement} popup
2469
- * @param {Record<string, any>} inputOptions
2470
- * @param {SweetAlertOptions} params
2471
- */
2472
- select: (popup, inputOptions, params) => {
2473
- const select = getDirectChildByClass(popup, swalClasses.select);
2474
- /**
2475
- * @param {HTMLElement} parent
2476
- * @param {string} optionLabel
2477
- * @param {string} optionValue
2478
- */
2479
- const renderOption = (parent, optionLabel, optionValue) => {
2480
- const option = document.createElement('option');
2481
- option.value = optionValue;
2482
- setInnerHtml(option, optionLabel);
2483
- option.selected = isSelected(optionValue, params.inputValue);
2484
- parent.appendChild(option);
2485
- };
2486
- inputOptions.forEach(inputOption => {
2487
- const optionValue = inputOption[0];
2488
- const optionLabel = inputOption[1];
2489
- // <optgroup> spec:
2490
- // https://www.w3.org/TR/html401/interact/forms.html#h-17.6
2491
- // "...all OPTGROUP elements must be specified directly within a SELECT element (i.e., groups may not be nested)..."
2492
- // check whether this is a <optgroup>
2493
- if (Array.isArray(optionLabel)) {
2494
- // if it is an array, then it is an <optgroup>
2495
- const optgroup = document.createElement('optgroup');
2496
- optgroup.label = optionValue;
2497
- optgroup.disabled = false; // not configurable for now
2498
- select.appendChild(optgroup);
2499
- optionLabel.forEach(o => renderOption(optgroup, o[1], o[0]));
2500
- } else {
2501
- // case of <option>
2502
- renderOption(select, optionLabel, optionValue);
2503
- }
2504
- });
2505
- select.focus();
2506
- },
2488
+
2489
+ /**
2490
+ * @param {HTMLElement} popup
2491
+ * @param {InputOptionFlattened[]} inputOptions
2492
+ * @param {SweetAlertOptions} params
2493
+ */
2494
+ function populateSelectOptions(popup, inputOptions, params) {
2495
+ const select = getDirectChildByClass(popup, swalClasses.select);
2496
+ if (!select) {
2497
+ return;
2498
+ }
2507
2499
  /**
2508
- * @param {HTMLElement} popup
2509
- * @param {Record<string, any>} inputOptions
2510
- * @param {SweetAlertOptions} params
2500
+ * @param {HTMLElement} parent
2501
+ * @param {string} optionLabel
2502
+ * @param {string} optionValue
2511
2503
  */
2512
- radio: (popup, inputOptions, params) => {
2513
- const radio = getDirectChildByClass(popup, swalClasses.radio);
2514
- inputOptions.forEach(inputOption => {
2515
- const radioValue = inputOption[0];
2516
- const radioLabel = inputOption[1];
2517
- const radioInput = document.createElement('input');
2518
- const radioLabelElement = document.createElement('label');
2519
- radioInput.type = 'radio';
2520
- radioInput.name = swalClasses.radio;
2521
- radioInput.value = radioValue;
2522
- if (isSelected(radioValue, params.inputValue)) {
2523
- radioInput.checked = true;
2524
- }
2525
- const label = document.createElement('span');
2526
- setInnerHtml(label, radioLabel);
2527
- label.className = swalClasses.label;
2528
- radioLabelElement.appendChild(radioInput);
2529
- radioLabelElement.appendChild(label);
2530
- radio.appendChild(radioLabelElement);
2531
- });
2532
- const radios = radio.querySelectorAll('input');
2533
- if (radios.length) {
2534
- radios[0].focus();
2504
+ const renderOption = (parent, optionLabel, optionValue) => {
2505
+ const option = document.createElement('option');
2506
+ option.value = optionValue;
2507
+ setInnerHtml(option, optionLabel);
2508
+ option.selected = isSelected(optionValue, params.inputValue);
2509
+ parent.appendChild(option);
2510
+ };
2511
+ inputOptions.forEach(inputOption => {
2512
+ const optionValue = inputOption[0];
2513
+ const optionLabel = inputOption[1];
2514
+ // <optgroup> spec:
2515
+ // https://www.w3.org/TR/html401/interact/forms.html#h-17.6
2516
+ // "...all OPTGROUP elements must be specified directly within a SELECT element (i.e., groups may not be nested)..."
2517
+ // check whether this is a <optgroup>
2518
+ if (Array.isArray(optionLabel)) {
2519
+ // if it is an array, then it is an <optgroup>
2520
+ const optgroup = document.createElement('optgroup');
2521
+ optgroup.label = optionValue;
2522
+ optgroup.disabled = false; // not configurable for now
2523
+ select.appendChild(optgroup);
2524
+ optionLabel.forEach(o => renderOption(optgroup, o[1], o[0]));
2525
+ } else {
2526
+ // case of <option>
2527
+ renderOption(select, optionLabel, optionValue);
2535
2528
  }
2529
+ });
2530
+ select.focus();
2531
+ }
2532
+
2533
+ /**
2534
+ * @param {HTMLElement} popup
2535
+ * @param {InputOptionFlattened[]} inputOptions
2536
+ * @param {SweetAlertOptions} params
2537
+ */
2538
+ function populateRadioOptions(popup, inputOptions, params) {
2539
+ const radio = getDirectChildByClass(popup, swalClasses.radio);
2540
+ if (!radio) {
2541
+ return;
2536
2542
  }
2537
- };
2543
+ inputOptions.forEach(inputOption => {
2544
+ const radioValue = inputOption[0];
2545
+ const radioLabel = inputOption[1];
2546
+ const radioInput = document.createElement('input');
2547
+ const radioLabelElement = document.createElement('label');
2548
+ radioInput.type = 'radio';
2549
+ radioInput.name = swalClasses.radio;
2550
+ radioInput.value = radioValue;
2551
+ if (isSelected(radioValue, params.inputValue)) {
2552
+ radioInput.checked = true;
2553
+ }
2554
+ const label = document.createElement('span');
2555
+ setInnerHtml(label, radioLabel);
2556
+ label.className = swalClasses.label;
2557
+ radioLabelElement.appendChild(radioInput);
2558
+ radioLabelElement.appendChild(label);
2559
+ radio.appendChild(radioLabelElement);
2560
+ });
2561
+ const radios = radio.querySelectorAll('input');
2562
+ if (radios.length) {
2563
+ radios[0].focus();
2564
+ }
2565
+ }
2538
2566
 
2539
2567
  /**
2540
2568
  * Converts `inputOptions` into an array of `[value, label]`s
2541
2569
  *
2542
2570
  * @param {Record<string, any>} inputOptions
2543
- * @returns {Array<Array<string>>}
2571
+ * @typedef {string[]} InputOptionFlattened
2572
+ * @returns {InputOptionFlattened[]}
2544
2573
  */
2545
2574
  const formatInputOptions = inputOptions => {
2575
+ /** @type {InputOptionFlattened[]} */
2546
2576
  const result = [];
2547
- if (typeof Map !== 'undefined' && inputOptions instanceof Map) {
2577
+ if (inputOptions instanceof Map) {
2548
2578
  inputOptions.forEach((value, key) => {
2549
2579
  let valueFormatted = value;
2550
2580
  if (typeof valueFormatted === 'object') {
@@ -2572,7 +2602,7 @@
2572
2602
  * @returns {boolean}
2573
2603
  */
2574
2604
  const isSelected = (optionValue, inputValue) => {
2575
- return inputValue && inputValue.toString() === optionValue.toString();
2605
+ return !!inputValue && inputValue.toString() === optionValue.toString();
2576
2606
  };
2577
2607
 
2578
2608
  /**
@@ -2620,10 +2650,11 @@
2620
2650
  error(`The "input" parameter is needed to be set when using returnInputValueOn${capitalizeFirstLetter(type)}`);
2621
2651
  return;
2622
2652
  }
2653
+ const input = instance.getInput();
2623
2654
  const inputValue = getInputValue(instance, innerParams);
2624
2655
  if (innerParams.inputValidator) {
2625
2656
  handleInputValidator(instance, inputValue, type);
2626
- } else if (!instance.getInput().checkValidity()) {
2657
+ } else if (input && !input.checkValidity()) {
2627
2658
  instance.enableButtons();
2628
2659
  instance.showValidationMessage(innerParams.validationMessage);
2629
2660
  } else if (type === 'deny') {
@@ -2794,16 +2825,17 @@
2794
2825
  }
2795
2826
 
2796
2827
  /**
2797
- * @param {HTMLInputElement} input
2828
+ * @param {HTMLInputElement | null} input
2798
2829
  * @param {boolean} disabled
2799
2830
  */
2800
2831
  function setInputDisabled(input, disabled) {
2801
- if (!input) {
2832
+ const popup = getPopup();
2833
+ if (!popup || !input) {
2802
2834
  return;
2803
2835
  }
2804
2836
  if (input.type === 'radio') {
2805
- const radiosContainer = input.parentNode.parentNode;
2806
- const radios = radiosContainer.querySelectorAll('input');
2837
+ /** @type {NodeListOf<HTMLInputElement>} */
2838
+ const radios = popup.querySelectorAll(`[name="${swalClasses.radio}"]`);
2807
2839
  for (let i = 0; i < radios.length; i++) {
2808
2840
  radios[i].disabled = disabled;
2809
2841
  }
@@ -2814,6 +2846,7 @@
2814
2846
 
2815
2847
  /**
2816
2848
  * Enable all the buttons
2849
+ * @this {SweetAlert}
2817
2850
  */
2818
2851
  function enableButtons() {
2819
2852
  setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], false);
@@ -2821,6 +2854,7 @@
2821
2854
 
2822
2855
  /**
2823
2856
  * Disable all the buttons
2857
+ * @this {SweetAlert}
2824
2858
  */
2825
2859
  function disableButtons() {
2826
2860
  setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], true);
@@ -2828,6 +2862,7 @@
2828
2862
 
2829
2863
  /**
2830
2864
  * Enable the input field
2865
+ * @this {SweetAlert}
2831
2866
  */
2832
2867
  function enableInput() {
2833
2868
  setInputDisabled(this.getInput(), false);
@@ -2835,6 +2870,7 @@
2835
2870
 
2836
2871
  /**
2837
2872
  * Disable the input field
2873
+ * @this {SweetAlert}
2838
2874
  */
2839
2875
  function disableInput() {
2840
2876
  setInputDisabled(this.getInput(), true);
@@ -4190,7 +4226,7 @@
4190
4226
  };
4191
4227
  });
4192
4228
  SweetAlert.DismissReason = DismissReason;
4193
- SweetAlert.version = '11.7.20';
4229
+ SweetAlert.version = '11.7.21';
4194
4230
 
4195
4231
  const Swal = SweetAlert;
4196
4232
  // @ts-ignore
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sweetalert2 v11.7.20
2
+ * sweetalert2 v11.7.21
3
3
  * Released under the MIT License.
4
4
  */
5
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sweetalert2=t()}(this,(function(){"use strict";const e={},t=t=>new Promise((o=>{if(!t)return o();const n=window.scrollX,i=window.scrollY;e.restoreFocusTimeout=setTimeout((()=>{e.previousActiveElement instanceof HTMLElement?(e.previousActiveElement.focus(),e.previousActiveElement=null):document.body&&document.body.focus(),o()}),100),window.scrollTo(n,i)}));var o={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const n="swal2-",i=["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"].reduce(((e,t)=>(e[t]=n+t,e)),{}),s=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=n+t,e)),{}),r="SweetAlert2:",a=e=>e.charAt(0).toUpperCase()+e.slice(1),l=e=>{console.warn(`${r} ${"object"==typeof e?e.join(" "):e}`)},c=e=>{console.error(`${r} ${e}`)},u=[],d=(e,t)=>{var o;o=`"${e}" is deprecated and will be removed in the next major release. Please use "${t}" instead.`,u.includes(o)||(u.push(o),l(o))},p=e=>"function"==typeof e?e():e,m=e=>e&&"function"==typeof e.toPromise,g=e=>m(e)?e.toPromise():Promise.resolve(e),h=e=>e&&Promise.resolve(e)===e,f=()=>document.body.querySelector(`.${i.container}`),b=e=>{const t=f();return t?t.querySelector(e):null},y=e=>b(`.${e}`),w=()=>y(i.popup),v=()=>y(i.icon),C=()=>y(i.title),A=()=>y(i["html-container"]),k=()=>y(i.image),B=()=>y(i["progress-steps"]),$=()=>y(i["validation-message"]),E=()=>b(`.${i.actions} .${i.confirm}`),x=()=>b(`.${i.actions} .${i.cancel}`),P=()=>b(`.${i.actions} .${i.deny}`),T=()=>b(`.${i.loader}`),L=()=>y(i.actions),S=()=>y(i.footer),O=()=>y(i["timer-progress-bar"]),M=()=>y(i.close),j=()=>{const e=w();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),o=Array.from(t).sort(((e,t)=>{const o=parseInt(e.getAttribute("tabindex")||"0"),n=parseInt(t.getAttribute("tabindex")||"0");return o>n?1:o<n?-1:0})),n=e.querySelectorAll('\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'),i=Array.from(n).filter((e=>"-1"!==e.getAttribute("tabindex")));return[...new Set(o.concat(i))].filter((e=>X(e)))},I=()=>q(document.body,i.shown)&&!q(document.body,i["toast-shown"])&&!q(document.body,i["no-backdrop"]),H=()=>{const e=w();return!!e&&q(e,i.toast)},D=(e,t)=>{if(e.textContent="",t){const o=(new DOMParser).parseFromString(t,"text/html"),n=o.querySelector("head");n&&Array.from(n.childNodes).forEach((t=>{e.appendChild(t)}));const i=o.querySelector("body");i&&Array.from(i.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},q=(e,t)=>{if(!t)return!1;const o=t.split(/\s+/);for(let t=0;t<o.length;t++)if(!e.classList.contains(o[t]))return!1;return!0},V=(e,t,o)=>{if(((e,t)=>{Array.from(e.classList).forEach((o=>{Object.values(i).includes(o)||Object.values(s).includes(o)||Object.values(t.showClass||{}).includes(o)||e.classList.remove(o)}))})(e,t),t.customClass&&t.customClass[o]){if("string"!=typeof t.customClass[o]&&!t.customClass[o].forEach)return void l(`Invalid type of customClass.${o}! Expected string or iterable object, got "${typeof t.customClass[o]}"`);R(e,t.customClass[o])}},N=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${i.popup} > .${i[t]}`);case"checkbox":return e.querySelector(`.${i.popup} > .${i.checkbox} input`);case"radio":return e.querySelector(`.${i.popup} > .${i.radio} input:checked`)||e.querySelector(`.${i.popup} > .${i.radio} input:first-child`);case"range":return e.querySelector(`.${i.popup} > .${i.range} input`);default:return e.querySelector(`.${i.popup} > .${i.input}`)}},F=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},_=(e,t,o)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{o?e.classList.add(t):e.classList.remove(t)})):o?e.classList.add(t):e.classList.remove(t)})))},R=(e,t)=>{_(e,t,!0)},U=(e,t)=>{_(e,t,!1)},z=(e,t)=>{const o=Array.from(e.children);for(let e=0;e<o.length;e++){const n=o[e];if(n instanceof HTMLElement&&q(n,t))return n}},W=(e,t,o)=>{o===`${parseInt(o)}`&&(o=parseInt(o)),o||0===parseInt(o)?e.style[t]="number"==typeof o?`${o}px`:o:e.style.removeProperty(t)},K=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Y=e=>{e&&(e.style.display="none")},Z=(e,t,o,n)=>{const i=e.querySelector(t);i&&(i.style[o]=n)},J=function(e,t){t?K(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Y(e)},X=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),G=e=>!!(e.scrollHeight>e.clientHeight),Q=e=>{const t=window.getComputedStyle(e),o=parseFloat(t.getPropertyValue("animation-duration")||"0"),n=parseFloat(t.getPropertyValue("transition-duration")||"0");return o>0||n>0},ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=O();X(o)&&(t&&(o.style.transition="none",o.style.width="100%"),setTimeout((()=>{o.style.transition=`width ${e/1e3}s linear`,o.style.width="0%"}),10))},te=()=>"undefined"==typeof window||"undefined"==typeof document,oe=`\n <div aria-labelledby="${i.title}" aria-describedby="${i["html-container"]}" class="${i.popup}" tabindex="-1">\n <button type="button" class="${i.close}"></button>\n <ul class="${i["progress-steps"]}"></ul>\n <div class="${i.icon}"></div>\n <img class="${i.image}" />\n <h2 class="${i.title}" id="${i.title}"></h2>\n <div class="${i["html-container"]}" id="${i["html-container"]}"></div>\n <input class="${i.input}" id="${i.input}" />\n <input type="file" class="${i.file}" />\n <div class="${i.range}">\n <input type="range" />\n <output></output>\n </div>\n <select class="${i.select}" id="${i.select}"></select>\n <div class="${i.radio}"></div>\n <label class="${i.checkbox}">\n <input type="checkbox" id="${i.checkbox}" />\n <span class="${i.label}"></span>\n </label>\n <textarea class="${i.textarea}" id="${i.textarea}"></textarea>\n <div class="${i["validation-message"]}" id="${i["validation-message"]}"></div>\n <div class="${i.actions}">\n <div class="${i.loader}"></div>\n <button type="button" class="${i.confirm}"></button>\n <button type="button" class="${i.deny}"></button>\n <button type="button" class="${i.cancel}"></button>\n </div>\n <div class="${i.footer}"></div>\n <div class="${i["timer-progress-bar-container"]}">\n <div class="${i["timer-progress-bar"]}"></div>\n </div>\n </div>\n`.replace(/(^|\n)\s*/g,""),ne=()=>{e.currentInstance.resetValidationMessage()},ie=e=>{const t=(()=>{const e=f();return!!e&&(e.remove(),U([document.documentElement,document.body],[i["no-backdrop"],i["toast-shown"],i["has-column"]]),!0)})();if(te())return void c("SweetAlert2 requires document to initialize");const o=document.createElement("div");o.className=i.container,t&&R(o,i["no-transition"]),D(o,oe);const n="string"==typeof(s=e.target)?document.querySelector(s):s;var s;n.appendChild(o),(e=>{const t=w();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&R(f(),i.rtl)})(n),(()=>{const e=w(),t=z(e,i.input),o=z(e,i.file),n=e.querySelector(`.${i.range} input`),s=e.querySelector(`.${i.range} output`),r=z(e,i.select),a=e.querySelector(`.${i.checkbox} input`),l=z(e,i.textarea);t.oninput=ne,o.onchange=ne,r.onchange=ne,a.onchange=ne,l.oninput=ne,n.oninput=()=>{ne(),s.value=n.value},n.onchange=()=>{ne(),s.value=n.value}})()},se=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?re(e,t):e&&D(t,e)},re=(e,t)=>{e.jquery?ae(t,e):D(t,e.toString())},ae=(e,t)=>{if(e.textContent="",0 in t)for(let o=0;o in t;o++)e.appendChild(t[o].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},le=(()=>{if(te())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&void 0!==e.style[o])return t[o];return!1})(),ce=(e,t)=>{const o=L(),n=T();o&&n&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?K(o):Y(o),V(o,t,"actions"),function(e,t,o){const n=E(),s=P(),r=x();if(!n||!s||!r)return;ue(n,"confirm",o),ue(s,"deny",o),ue(r,"cancel",o),function(e,t,o,n){if(!n.buttonsStyling)return void U([e,t,o],i.styled);R([e,t,o],i.styled),n.confirmButtonColor&&(e.style.backgroundColor=n.confirmButtonColor,R(e,i["default-outline"]));n.denyButtonColor&&(t.style.backgroundColor=n.denyButtonColor,R(t,i["default-outline"]));n.cancelButtonColor&&(o.style.backgroundColor=n.cancelButtonColor,R(o,i["default-outline"]))}(n,s,r,o),o.reverseButtons&&(o.toast?(e.insertBefore(r,n),e.insertBefore(s,n)):(e.insertBefore(r,t),e.insertBefore(s,t),e.insertBefore(n,t)))}(o,n,t),D(n,t.loaderHtml||""),V(n,t,"loader"))};function ue(e,t,o){const n=a(t);J(e,o[`show${n}Button`],"inline-block"),D(e,o[`${t}ButtonText`]||""),e.setAttribute("aria-label",o[`${t}ButtonAriaLabel`]||""),e.className=i[t],V(e,o,`${t}Button`)}const de=(e,t)=>{const o=f();o&&(!function(e,t){"string"==typeof t?e.style.background=t:t||R([document.documentElement,document.body],i["no-backdrop"])}(o,t.backdrop),function(e,t){if(!t)return;t in i?R(e,i[t]):(l('The "position" parameter is not valid, defaulting to "center"'),R(e,i.center))}(o,t.position),function(e,t){if(!t)return;R(e,i[`grow-${t}`])}(o,t.grow),V(o,t,"container"))};const pe=["input","file","range","select","radio","checkbox","textarea"],me=e=>{if(!ve[e.input])return void c(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${e.input}"`);const t=ye(e.input),o=ve[e.input](t,e);K(t),e.inputAutoFocus&&setTimeout((()=>{F(o)}))},ge=(e,t)=>{const o=N(w(),e);if(o){(e=>{for(let t=0;t<e.attributes.length;t++){const o=e.attributes[t].name;["id","type","value","style"].includes(o)||e.removeAttribute(o)}})(o);for(const e in t)o.setAttribute(e,t[e])}},he=e=>{const t=ye(e.input);"object"==typeof e.customClass&&R(t,e.customClass.input)},fe=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},be=(e,t,o)=>{if(o.inputLabel){const n=document.createElement("label"),s=i["input-label"];n.setAttribute("for",e.id),n.className=s,"object"==typeof o.customClass&&R(n,o.customClass.inputLabel),n.innerText=o.inputLabel,t.insertAdjacentElement("beforebegin",n)}},ye=e=>z(w(),i[e]||i.input),we=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:h(t)||l(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},ve={};ve.text=ve.email=ve.password=ve.number=ve.tel=ve.url=(e,t)=>(we(e,t.inputValue),be(e,e,t),fe(e,t),e.type=t.input,e),ve.file=(e,t)=>(be(e,e,t),fe(e,t),e),ve.range=(e,t)=>{const o=e.querySelector("input"),n=e.querySelector("output");return we(o,t.inputValue),o.type=t.input,we(n,t.inputValue),be(o,e,t),e},ve.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const o=document.createElement("option");D(o,t.inputPlaceholder),o.value="",o.disabled=!0,o.selected=!0,e.appendChild(o)}return be(e,e,t),e},ve.radio=e=>(e.textContent="",e),ve.checkbox=(e,t)=>{const o=N(w(),"checkbox");o.value="1",o.checked=Boolean(t.inputValue);const n=e.querySelector("span");return D(n,t.inputPlaceholder),o},ve.textarea=(e,t)=>{we(e,t.inputValue),fe(e,t),be(e,e,t);return setTimeout((()=>{if("MutationObserver"in window){const o=parseInt(window.getComputedStyle(w()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const n=e.offsetWidth+(i=e,parseInt(window.getComputedStyle(i).marginLeft)+parseInt(window.getComputedStyle(i).marginRight));var i;n>o?w().style.width=`${n}px`:W(w(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Ce=(e,t)=>{const n=A();n&&(V(n,t,"htmlContainer"),t.html?(se(t.html,n),K(n,"block")):t.text?(n.textContent=t.text,K(n,"block")):Y(n),((e,t)=>{const n=w(),s=o.innerParams.get(e),r=!s||t.input!==s.input;pe.forEach((e=>{const o=z(n,i[e]);ge(e,t.inputAttributes),o.className=i[e],r&&Y(o)})),t.input&&(r&&me(t),he(t))})(e,t))},Ae=(e,t)=>{for(const[o,n]of Object.entries(s))t.icon!==o&&U(e,n);R(e,t.icon&&s[t.icon]),$e(e,t),ke(),V(e,t,"icon")},ke=()=>{const e=w();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),o=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<o.length;e++)o[e].style.backgroundColor=t},Be=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let o=e.innerHTML,n="";if(t.iconHtml)n=Ee(t.iconHtml);else if("success"===t.icon)n='\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n',o=o.replace(/ style=".*?"/g,"");else if("error"===t.icon)n='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n';else if(t.icon){n=Ee({question:"?",warning:"!",info:"i"}[t.icon])}o.trim()!==n.trim()&&D(e,n)},$e=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const o of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])Z(e,o,"backgroundColor",t.iconColor);Z(e,".swal2-success-ring","borderColor",t.iconColor)}},Ee=e=>`<div class="${i["icon-content"]}">${e}</div>`,xe=(e,t)=>{const o=t.showClass||{};e.className=`${i.popup} ${X(e)?o.popup:""}`,t.toast?(R([document.documentElement,document.body],i["toast-shown"]),R(e,i.toast)):R(e,i.modal),V(e,t,"popup"),"string"==typeof t.customClass&&R(e,t.customClass),t.icon&&R(e,i[`icon-${t.icon}`])},Pe=e=>{const t=document.createElement("li");return R(t,i["progress-step"]),D(t,e),t},Te=e=>{const t=document.createElement("li");return R(t,i["progress-step-line"]),e.progressStepsDistance&&W(t,"width",e.progressStepsDistance),t},Le=(e,t)=>{((e,t)=>{const o=f(),n=w();if(o&&n){if(t.toast){W(o,"width",t.width),n.style.width="100%";const e=T();e&&n.insertBefore(e,v())}else W(n,"width",t.width);W(n,"padding",t.padding),t.color&&(n.style.color=t.color),t.background&&(n.style.background=t.background),Y($()),xe(n,t)}})(0,t),de(0,t),((e,t)=>{const o=B();if(!o)return;const{progressSteps:n,currentProgressStep:s}=t;n&&0!==n.length&&void 0!==s?(K(o),o.textContent="",s>=n.length&&l("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),n.forEach(((e,r)=>{const a=Pe(e);if(o.appendChild(a),r===s&&R(a,i["active-progress-step"]),r!==n.length-1){const e=Te(t);o.appendChild(e)}}))):Y(o)})(0,t),((e,t)=>{const n=o.innerParams.get(e),i=v();if(i){if(n&&t.icon===n.icon)return Be(i,t),void Ae(i,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(s).indexOf(t.icon))return c(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void Y(i);K(i),Be(i,t),Ae(i,t),R(i,t.showClass&&t.showClass.icon)}else Y(i)}})(e,t),((e,t)=>{const o=k();o&&(t.imageUrl?(K(o,""),o.setAttribute("src",t.imageUrl),o.setAttribute("alt",t.imageAlt||""),W(o,"width",t.imageWidth),W(o,"height",t.imageHeight),o.className=i.image,V(o,t,"image")):Y(o))})(0,t),((e,t)=>{const o=C();o&&(J(o,t.title||t.titleText,"block"),t.title&&se(t.title,o),t.titleText&&(o.innerText=t.titleText),V(o,t,"title"))})(0,t),((e,t)=>{const o=M();o&&(D(o,t.closeButtonHtml||""),V(o,t,"closeButton"),J(o,t.showCloseButton),o.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),Ce(e,t),ce(0,t),((e,t)=>{const o=S();o&&(J(o,t.footer),t.footer&&se(t.footer,o),V(o,t,"footer"))})(0,t);const n=w();"function"==typeof t.didRender&&n&&t.didRender(n)},Se=()=>E()&&E().click(),Oe=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Me=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},je=(e,t)=>{const o=j();if(o.length)return(e+=t)===o.length?e=0:-1===e&&(e=o.length-1),void o[e].focus();w().focus()},Ie=["ArrowRight","ArrowDown"],He=["ArrowLeft","ArrowUp"],De=(e,t,n)=>{const i=o.innerParams.get(e);i&&(t.isComposing||229===t.keyCode||(i.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?qe(e,t,i):"Tab"===t.key?Ve(t):[...Ie,...He].includes(t.key)?Ne(t.key):"Escape"===t.key&&Fe(t,i,n)))},qe=(e,t,o)=>{if(p(o.allowEnterKey)&&t.target&&e.getInput()&&t.target instanceof HTMLElement&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(o.input))return;Se(),t.preventDefault()}},Ve=e=>{const t=e.target,o=j();let n=-1;for(let e=0;e<o.length;e++)if(t===o[e]){n=e;break}e.shiftKey?je(n,-1):je(n,1),e.stopPropagation(),e.preventDefault()},Ne=e=>{const t=[E(),P(),x()];if(document.activeElement instanceof HTMLElement&&!t.includes(document.activeElement))return;const o=Ie.includes(e)?"nextElementSibling":"previousElementSibling";let n=document.activeElement;for(let e=0;e<L().children.length;e++){if(n=n[o],!n)return;if(n instanceof HTMLButtonElement&&X(n))break}n instanceof HTMLButtonElement&&n.focus()},Fe=(e,t,o)=>{p(t.allowEscapeKey)&&(e.preventDefault(),o(Oe.esc))};var _e={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Re=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Ue="undefined"!=typeof window&&!!window.GestureEvent,ze=()=>{const e=f();let t;e.ontouchstart=e=>{t=We(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},We=e=>{const t=e.target,o=f();return!Ke(e)&&!Ye(e)&&(t===o||!G(o)&&t instanceof HTMLElement&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&(!G(A())||!A().contains(t)))},Ke=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Ye=e=>e.touches&&e.touches.length>1;let Ze=null;const Je=()=>{null===Ze&&document.body.scrollHeight>window.innerHeight&&(Ze=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Ze+(()=>{const e=document.createElement("div");e.className=i["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function Xe(o,n,s,r){H()?st(o,r):(t(s).then((()=>st(o,r))),Me(e)),Ue?(n.setAttribute("style","display:none !important"),n.removeAttribute("class"),n.innerHTML=""):n.remove(),I()&&(null!==Ze&&(document.body.style.paddingRight=`${Ze}px`,Ze=null),(()=>{if(q(document.body,i.iosfix)){const e=parseInt(document.body.style.top,10);U(document.body,i.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),Re()),U([document.documentElement,document.body],[i.shown,i["height-auto"],i["no-backdrop"],i["toast-shown"]])}function Ge(e){e=ot(e);const t=_e.swalPromiseResolve.get(this),o=Qe(this);this.isAwaitingPromise?e.isDismissed||(tt(this),t(e)):o&&t(e)}const Qe=e=>{const t=w();if(!t)return!1;const n=o.innerParams.get(e);if(!n||q(t,n.hideClass.popup))return!1;U(t,n.showClass.popup),R(t,n.hideClass.popup);const i=f();return U(i,n.showClass.backdrop),R(i,n.hideClass.backdrop),nt(e,t,n),!0};function et(e){const t=_e.swalPromiseReject.get(this);tt(this),t&&t(e)}const tt=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,o.innerParams.get(e)||e._destroy())},ot=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),nt=(e,t,o)=>{const n=f(),i=le&&Q(t);"function"==typeof o.willClose&&o.willClose(t),i?it(e,t,n,o.returnFocus,o.didClose):Xe(e,n,o.returnFocus,o.didClose)},it=(t,o,n,i,s)=>{e.swalCloseEventFinishedCallback=Xe.bind(null,t,n,i,s),o.addEventListener(le,(function(t){t.target===o&&(e.swalCloseEventFinishedCallback(),delete e.swalCloseEventFinishedCallback)}))},st=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},rt=e=>{let t=w();t||new Do,t=w();const o=T();H()?Y(v()):at(t,e),K(o),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},at=(e,t)=>{const o=L(),n=T();!t&&X(E())&&(t=E()),K(o),t&&(Y(t),n.setAttribute("data-button-to-replace",t.className)),n.parentNode.insertBefore(n,t),R([e,o],i.loading)},lt=e=>e.checked?1:0,ct=e=>e.checked?e.value:null,ut=e=>e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,dt=(e,t)=>{const o=w(),n=e=>{mt[t.input](o,gt(e),t)};m(t.inputOptions)||h(t.inputOptions)?(rt(E()),g(t.inputOptions).then((t=>{e.hideLoading(),n(t)}))):"object"==typeof t.inputOptions?n(t.inputOptions):c("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},pt=(e,t)=>{const o=e.getInput();Y(o),g(t.inputValue).then((n=>{o.value="number"===t.input?`${parseFloat(n)||0}`:`${n}`,K(o),o.focus(),e.hideLoading()})).catch((t=>{c(`Error in inputValue promise: ${t}`),o.value="",K(o),o.focus(),e.hideLoading()}))},mt={select:(e,t,o)=>{const n=z(e,i.select),s=(e,t,n)=>{const i=document.createElement("option");i.value=n,D(i,t),i.selected=ht(n,o.inputValue),e.appendChild(i)};t.forEach((e=>{const t=e[0],o=e[1];if(Array.isArray(o)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,n.appendChild(e),o.forEach((t=>s(e,t[1],t[0])))}else s(n,o,t)})),n.focus()},radio:(e,t,o)=>{const n=z(e,i.radio);t.forEach((e=>{const t=e[0],s=e[1],r=document.createElement("input"),a=document.createElement("label");r.type="radio",r.name=i.radio,r.value=t,ht(t,o.inputValue)&&(r.checked=!0);const l=document.createElement("span");D(l,s),l.className=i.label,a.appendChild(r),a.appendChild(l),n.appendChild(a)}));const s=n.querySelectorAll("input");s.length&&s[0].focus()}},gt=e=>{const t=[];return"undefined"!=typeof Map&&e instanceof Map?e.forEach(((e,o)=>{let n=e;"object"==typeof n&&(n=gt(n)),t.push([o,n])})):Object.keys(e).forEach((o=>{let n=e[o];"object"==typeof n&&(n=gt(n)),t.push([o,n])})),t},ht=(e,t)=>t&&t.toString()===e.toString(),ft=(e,t)=>{const n=o.innerParams.get(e);if(!n.input)return void c(`The "input" parameter is needed to be set when using returnInputValueOn${a(t)}`);const i=((e,t)=>{const o=e.getInput();if(!o)return null;switch(t.input){case"checkbox":return lt(o);case"radio":return ct(o);case"file":return ut(o);default:return t.inputAutoTrim?o.value.trim():o.value}})(e,n);n.inputValidator?bt(e,i,t):e.getInput().checkValidity()?"deny"===t?yt(e,i):Ct(e,i):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},bt=(e,t,n)=>{const i=o.innerParams.get(e);e.disableInput();Promise.resolve().then((()=>g(i.inputValidator(t,i.validationMessage)))).then((o=>{e.enableButtons(),e.enableInput(),o?e.showValidationMessage(o):"deny"===n?yt(e,t):Ct(e,t)}))},yt=(e,t)=>{const n=o.innerParams.get(e||void 0);if(n.showLoaderOnDeny&&rt(P()),n.preDeny){e.isAwaitingPromise=!0;Promise.resolve().then((()=>g(n.preDeny(t,n.validationMessage)))).then((o=>{!1===o?(e.hideLoading(),tt(e)):e.close({isDenied:!0,value:void 0===o?t:o})})).catch((t=>vt(e||void 0,t)))}else e.close({isDenied:!0,value:t})},wt=(e,t)=>{e.close({isConfirmed:!0,value:t})},vt=(e,t)=>{e.rejectPromise(t)},Ct=(e,t)=>{const n=o.innerParams.get(e||void 0);if(n.showLoaderOnConfirm&&rt(),n.preConfirm){e.resetValidationMessage(),e.isAwaitingPromise=!0;Promise.resolve().then((()=>g(n.preConfirm(t,n.validationMessage)))).then((o=>{X($())||!1===o?(e.hideLoading(),tt(e)):wt(e,void 0===o?t:o)})).catch((t=>vt(e||void 0,t)))}else wt(e,t)};function At(){const e=o.innerParams.get(this);if(!e)return;const t=o.domCache.get(this);Y(t.loader),H()?e.icon&&K(v()):kt(t),U([t.popup,t.actions],i.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const kt=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?K(t[0],"inline-block"):X(E())||X(P())||X(x())||Y(e.actions)};function Bt(){const e=o.innerParams.get(this),t=o.domCache.get(this);return t?N(t.popup,e.input):null}function $t(e,t,n){const i=o.domCache.get(e);t.forEach((e=>{i[e].disabled=n}))}function Et(e,t){if(e)if("radio"===e.type){const o=e.parentNode.parentNode.querySelectorAll("input");for(let e=0;e<o.length;e++)o[e].disabled=t}else e.disabled=t}function xt(){$t(this,["confirmButton","denyButton","cancelButton"],!1)}function Pt(){$t(this,["confirmButton","denyButton","cancelButton"],!0)}function Tt(){Et(this.getInput(),!1)}function Lt(){Et(this.getInput(),!0)}function St(e){const t=o.domCache.get(this),n=o.innerParams.get(this);D(t.validationMessage,e),t.validationMessage.className=i["validation-message"],n.customClass&&n.customClass.validationMessage&&R(t.validationMessage,n.customClass.validationMessage),K(t.validationMessage);const s=this.getInput();s&&(s.setAttribute("aria-invalid",!0),s.setAttribute("aria-describedby",i["validation-message"]),F(s),R(s,i.inputerror))}function Ot(){const e=o.domCache.get(this);e.validationMessage&&Y(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),U(t,i.inputerror))}const Mt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},jt=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],It={},Ht=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Dt=e=>Object.prototype.hasOwnProperty.call(Mt,e),qt=e=>-1!==jt.indexOf(e),Vt=e=>It[e],Nt=e=>{Dt(e)||l(`Unknown parameter "${e}"`)},Ft=e=>{Ht.includes(e)&&l(`The parameter "${e}" is incompatible with toasts`)},_t=e=>{const t=Vt(e);t&&d(e,t)};function Rt(e){const t=w(),n=o.innerParams.get(this);if(!t||q(t,n.hideClass.popup))return void l("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const i=Ut(e),s=Object.assign({},n,i);Le(this,s),o.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Ut=e=>{const t={};return Object.keys(e).forEach((o=>{qt(o)?t[o]=e[o]:l(`Invalid parameter to update: ${o}`)})),t};function zt(){const t=o.domCache.get(this),n=o.innerParams.get(this);n?(t.popup&&e.swalCloseEventFinishedCallback&&(e.swalCloseEventFinishedCallback(),delete e.swalCloseEventFinishedCallback),"function"==typeof n.didDestroy&&n.didDestroy(),Wt(this)):Kt(this)}const Wt=t=>{Kt(t),delete t.params,delete e.keydownHandler,delete e.keydownTarget,delete e.currentInstance},Kt=e=>{e.isAwaitingPromise?(Yt(o,e),e.isAwaitingPromise=!0):(Yt(_e,e),Yt(o,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Yt=(e,t)=>{for(const o in e)e[o].delete(t)};var Zt=Object.freeze({__proto__:null,_destroy:zt,close:Ge,closeModal:Ge,closePopup:Ge,closeToast:Ge,disableButtons:Pt,disableInput:Lt,disableLoading:At,enableButtons:xt,enableInput:Tt,getInput:Bt,handleAwaitingPromise:tt,hideLoading:At,rejectPromise:et,resetValidationMessage:Ot,showValidationMessage:St,update:Rt});const Jt=(e,t,n)=>{t.popup.onclick=()=>{const t=o.innerParams.get(e);t&&(Xt(t)||t.timer||t.input)||n(Oe.close)}},Xt=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Gt=!1;const Qt=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Gt=!0)}}},eo=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Gt=!0)}}},to=(e,t,n)=>{t.container.onclick=i=>{const s=o.innerParams.get(e);Gt?Gt=!1:i.target===t.container&&p(s.allowOutsideClick)&&n(Oe.backdrop)}},oo=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const no=()=>{if(e.timeout)return(()=>{const e=O(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const o=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${o}%`})(),e.timeout.stop()},io=()=>{if(e.timeout){const t=e.timeout.start();return ee(t),t}};let so=!1;const ro={};const ao=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in ro){const o=t.getAttribute(e);if(o)return void ro[e].fire({template:o})}};var lo=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||oo(e[0])?["title","html","icon"].forEach(((o,n)=>{const i=e[n];"string"==typeof i||oo(i)?t[o]=i:void 0!==i&&c(`Unexpected type of ${o}! Expected "string" or "Element", got ${typeof i}`)})):Object.assign(t,e[0]),t},bindClickHandler:function(){ro[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,so||(document.body.addEventListener("click",ao),so=!0)},clickCancel:()=>x()&&x().click(),clickConfirm:Se,clickDeny:()=>P()&&P().click(),enableLoading:rt,fire:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return new this(...t)},getActions:L,getCancelButton:x,getCloseButton:M,getConfirmButton:E,getContainer:f,getDenyButton:P,getFocusableElements:j,getFooter:S,getHtmlContainer:A,getIcon:v,getIconContent:()=>y(i["icon-content"]),getImage:k,getInputLabel:()=>y(i["input-label"]),getLoader:T,getPopup:w,getProgressSteps:B,getTimerLeft:()=>e.timeout&&e.timeout.getTimerLeft(),getTimerProgressBar:O,getTitle:C,getValidationMessage:$,increaseTimer:t=>{if(e.timeout){const o=e.timeout.increase(t);return ee(o,!0),o}},isDeprecatedParameter:Vt,isLoading:()=>{const e=w();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!e.timeout||!e.timeout.isRunning()),isUpdatableParameter:qt,isValidParameter:Dt,isVisible:()=>X(w()),mixin:function(e){return class extends(this){_main(t,o){return super._main(t,Object.assign({},e,o))}}},resumeTimer:io,showLoading:rt,stopTimer:no,toggleTimer:()=>{const t=e.timeout;return t&&(t.running?no():io())}});class co{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const uo=["swal-title","swal-html","swal-footer"],po=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{vo(e,["name","value"]);const o=e.getAttribute("name"),n=e.getAttribute("value");t[o]="boolean"==typeof Mt[o]?"false"!==n:"object"==typeof Mt[o]?JSON.parse(n):n})),t},mo=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const o=e.getAttribute("name"),n=e.getAttribute("value");t[o]=new Function(`return ${n}`)()})),t},go=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{vo(e,["type","color","aria-label"]);const o=e.getAttribute("type");t[`${o}ButtonText`]=e.innerHTML,t[`show${a(o)}Button`]=!0,e.hasAttribute("color")&&(t[`${o}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${o}ButtonAriaLabel`]=e.getAttribute("aria-label"))})),t},ho=e=>{const t={},o=e.querySelector("swal-image");return o&&(vo(o,["src","width","height","alt"]),o.hasAttribute("src")&&(t.imageUrl=o.getAttribute("src")),o.hasAttribute("width")&&(t.imageWidth=o.getAttribute("width")),o.hasAttribute("height")&&(t.imageHeight=o.getAttribute("height")),o.hasAttribute("alt")&&(t.imageAlt=o.getAttribute("alt"))),t},fo=e=>{const t={},o=e.querySelector("swal-icon");return o&&(vo(o,["type","color"]),o.hasAttribute("type")&&(t.icon=o.getAttribute("type")),o.hasAttribute("color")&&(t.iconColor=o.getAttribute("color")),t.iconHtml=o.innerHTML),t},bo=e=>{const t={},o=e.querySelector("swal-input");o&&(vo(o,["type","label","placeholder","value"]),t.input=o.getAttribute("type")||"text",o.hasAttribute("label")&&(t.inputLabel=o.getAttribute("label")),o.hasAttribute("placeholder")&&(t.inputPlaceholder=o.getAttribute("placeholder")),o.hasAttribute("value")&&(t.inputValue=o.getAttribute("value")));const n=Array.from(e.querySelectorAll("swal-input-option"));return n.length&&(t.inputOptions={},n.forEach((e=>{vo(e,["value"]);const o=e.getAttribute("value"),n=e.innerHTML;t.inputOptions[o]=n}))),t},yo=(e,t)=>{const o={};for(const n in t){const i=t[n],s=e.querySelector(i);s&&(vo(s,[]),o[i.replace(/^swal-/,"")]=s.innerHTML.trim())}return o},wo=e=>{const t=uo.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const o=e.tagName.toLowerCase();t.includes(o)||l(`Unrecognized element <${o}>`)}))},vo=(e,t)=>{Array.from(e.attributes).forEach((o=>{-1===t.indexOf(o.name)&&l([`Unrecognized attribute "${o.name}" on <${e.tagName.toLowerCase()}>.`,""+(t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element.")])}))},Co=t=>{const o=f(),n=w();"function"==typeof t.willOpen&&t.willOpen(n);const s=window.getComputedStyle(document.body).overflowY;$o(o,n,t),setTimeout((()=>{ko(o,n)}),10),I()&&(Bo(o,t.scrollbarPadding,s),Array.from(document.body.children).forEach((e=>{e===f()||e.contains(f())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")||""),e.setAttribute("aria-hidden","true"))}))),H()||e.previousActiveElement||(e.previousActiveElement=document.activeElement),"function"==typeof t.didOpen&&setTimeout((()=>t.didOpen(n))),U(o,i["no-transition"])},Ao=e=>{const t=w();if(e.target!==t)return;const o=f();t.removeEventListener(le,Ao),o.style.overflowY="auto"},ko=(e,t)=>{le&&Q(t)?(e.style.overflowY="hidden",t.addEventListener(le,Ao)):e.style.overflowY="auto"},Bo=(e,t,o)=>{(()=>{if(Ue&&!q(document.body,i.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",R(document.body,i.iosfix),ze()}})(),t&&"hidden"!==o&&Je(),setTimeout((()=>{e.scrollTop=0}))},$o=(e,t,o)=>{R(e,o.showClass.backdrop),t.style.setProperty("opacity","0","important"),K(t,"grid"),setTimeout((()=>{R(t,o.showClass.popup),t.style.removeProperty("opacity")}),10),R([document.documentElement,document.body],i.shown),o.heightAuto&&o.backdrop&&!o.toast&&R([document.documentElement,document.body],i["height-auto"])};var Eo={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function xo(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=Eo.email),"url"===e.input&&(e.inputValidator=Eo.url))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&l("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(l('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),ie(e)}let Po;class To{constructor(){if("undefined"==typeof window)return;Po=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=Object.freeze(this.constructor.argsToParams(t));this.params=i,this.isAwaitingPromise=!1;const s=Po._main(Po.params);o.promise.set(this,s)}_main(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(e=>{!1===e.backdrop&&e.allowOutsideClick&&l('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Nt(t),e.toast&&Ft(t),_t(t)})(Object.assign({},n,t)),e.currentInstance&&(e.currentInstance._destroy(),I()&&Re()),e.currentInstance=Po;const i=So(t,n);xo(i),Object.freeze(i),e.timeout&&(e.timeout.stop(),delete e.timeout),clearTimeout(e.restoreFocusTimeout);const s=Oo(Po);return Le(Po,i),o.innerParams.set(Po,i),Lo(Po,s,i)}then(e){return o.promise.get(this).then(e)}finally(e){return o.promise.get(this).finally(e)}}const Lo=(t,n,i)=>new Promise(((s,r)=>{const a=e=>{t.close({isDismissed:!0,dismiss:e})};_e.swalPromiseResolve.set(t,s),_e.swalPromiseReject.set(t,r),n.confirmButton.onclick=()=>{(e=>{const t=o.innerParams.get(e);e.disableButtons(),t.input?ft(e,"confirm"):Ct(e,!0)})(t)},n.denyButton.onclick=()=>{(e=>{const t=o.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?ft(e,"deny"):yt(e,!1)})(t)},n.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Oe.cancel)})(t,a)},n.closeButton.onclick=()=>{a(Oe.close)},((e,t,n)=>{o.innerParams.get(e).toast?Jt(e,t,n):(Qt(t),eo(t),to(e,t,n))})(t,n,a),((e,t,o,n)=>{Me(t),o.toast||(t.keydownHandler=t=>De(e,t,n),t.keydownTarget=o.keydownListenerCapture?window:w(),t.keydownListenerCapture=o.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)})(t,e,i,a),((e,t)=>{"select"===t.input||"radio"===t.input?dt(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(m(t.inputValue)||h(t.inputValue))&&(rt(E()),pt(e,t))})(t,i),Co(i),Mo(e,i,a),jo(n,i),setTimeout((()=>{n.container.scrollTop=0}))})),So=(e,t)=>{const o=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const o=t.content;return wo(o),Object.assign(po(o),mo(o),go(o),ho(o),fo(o),bo(o),yo(o,uo))})(e),n=Object.assign({},Mt,t,o,e);return n.showClass=Object.assign({},Mt.showClass,n.showClass),n.hideClass=Object.assign({},Mt.hideClass,n.hideClass),n},Oo=e=>{const t={popup:w(),container:f(),actions:L(),confirmButton:E(),denyButton:P(),cancelButton:x(),loader:T(),closeButton:M(),validationMessage:$(),progressSteps:B()};return o.domCache.set(e,t),t},Mo=(e,t,o)=>{const n=O();Y(n),t.timer&&(e.timeout=new co((()=>{o("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(K(n),V(n,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&ee(t.timer)}))))},jo=(e,t)=>{t.toast||(p(t.allowEnterKey)?Io(e,t)||je(-1,1):Ho())},Io=(e,t)=>t.focusDeny&&X(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&X(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!X(e.confirmButton))&&(e.confirmButton.focus(),!0),Ho=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}To.prototype.disableButtons=Pt,To.prototype.enableButtons=xt,To.prototype.getInput=Bt,To.prototype.disableInput=Lt,To.prototype.enableInput=Tt,To.prototype.hideLoading=At,To.prototype.disableLoading=At,To.prototype.showValidationMessage=St,To.prototype.resetValidationMessage=Ot,To.prototype.close=Ge,To.prototype.closePopup=Ge,To.prototype.closeModal=Ge,To.prototype.closeToast=Ge,To.prototype.rejectPromise=et,To.prototype.update=Rt,To.prototype._destroy=zt,Object.assign(To,lo),Object.keys(Zt).forEach((e=>{To[e]=function(){return Po&&Po[e]?Po[e](...arguments):null}})),To.DismissReason=Oe,To.version="11.7.20";const Do=To;return Do.default=Do,Do})),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2);
5
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sweetalert2=t()}(this,(function(){"use strict";const e={},t=t=>new Promise((n=>{if(!t)return n();const o=window.scrollX,i=window.scrollY;e.restoreFocusTimeout=setTimeout((()=>{e.previousActiveElement instanceof HTMLElement?(e.previousActiveElement.focus(),e.previousActiveElement=null):document.body&&document.body.focus(),n()}),100),window.scrollTo(o,i)}));var n={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const o="swal2-",i=["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"].reduce(((e,t)=>(e[t]=o+t,e)),{}),s=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=o+t,e)),{}),r="SweetAlert2:",a=e=>e.charAt(0).toUpperCase()+e.slice(1),l=e=>{console.warn(`${r} ${"object"==typeof e?e.join(" "):e}`)},c=e=>{console.error(`${r} ${e}`)},u=[],d=(e,t)=>{var n;n=`"${e}" is deprecated and will be removed in the next major release. Please use "${t}" instead.`,u.includes(n)||(u.push(n),l(n))},p=e=>"function"==typeof e?e():e,m=e=>e&&"function"==typeof e.toPromise,g=e=>m(e)?e.toPromise():Promise.resolve(e),h=e=>e&&Promise.resolve(e)===e,f=()=>document.body.querySelector(`.${i.container}`),b=e=>{const t=f();return t?t.querySelector(e):null},y=e=>b(`.${e}`),w=()=>y(i.popup),v=()=>y(i.icon),C=()=>y(i.title),A=()=>y(i["html-container"]),k=()=>y(i.image),B=()=>y(i["progress-steps"]),$=()=>y(i["validation-message"]),E=()=>b(`.${i.actions} .${i.confirm}`),x=()=>b(`.${i.actions} .${i.cancel}`),P=()=>b(`.${i.actions} .${i.deny}`),T=()=>b(`.${i.loader}`),L=()=>y(i.actions),S=()=>y(i.footer),O=()=>y(i["timer-progress-bar"]),M=()=>y(i.close),j=()=>{const e=w();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),o=parseInt(t.getAttribute("tabindex")||"0");return n>o?1:n<o?-1:0})),o=e.querySelectorAll('\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'),i=Array.from(o).filter((e=>"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(i))].filter((e=>X(e)))},I=()=>q(document.body,i.shown)&&!q(document.body,i["toast-shown"])&&!q(document.body,i["no-backdrop"]),H=()=>{const e=w();return!!e&&q(e,i.toast)},D=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),o=n.querySelector("head");o&&Array.from(o.childNodes).forEach((t=>{e.appendChild(t)}));const i=n.querySelector("body");i&&Array.from(i.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},q=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t<n.length;t++)if(!e.classList.contains(n[t]))return!1;return!0},V=(e,t,n)=>{if(((e,t)=>{Array.from(e.classList).forEach((n=>{Object.values(i).includes(n)||Object.values(s).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))})(e,t),t.customClass&&t.customClass[n]){if("string"!=typeof t.customClass[n]&&!t.customClass[n].forEach)return void l(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof t.customClass[n]}"`);R(e,t.customClass[n])}},N=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${i.popup} > .${i[t]}`);case"checkbox":return e.querySelector(`.${i.popup} > .${i.checkbox} input`);case"radio":return e.querySelector(`.${i.popup} > .${i.radio} input:checked`)||e.querySelector(`.${i.popup} > .${i.radio} input:first-child`);case"range":return e.querySelector(`.${i.popup} > .${i.range} input`);default:return e.querySelector(`.${i.popup} > .${i.input}`)}},F=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},_=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},R=(e,t)=>{_(e,t,!0)},U=(e,t)=>{_(e,t,!1)},z=(e,t)=>{const n=Array.from(e.children);for(let e=0;e<n.length;e++){const o=n[e];if(o instanceof HTMLElement&&q(o,t))return o}},W=(e,t,n)=>{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style[t]="number"==typeof n?`${n}px`:n:e.style.removeProperty(t)},K=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Y=e=>{e&&(e.style.display="none")},Z=(e,t,n,o)=>{const i=e.querySelector(t);i&&(i.style[n]=o)},J=function(e,t){t?K(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Y(e)},X=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),G=e=>!!(e.scrollHeight>e.clientHeight),Q=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),o=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||o>0},ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=O();n&&X(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},te=()=>"undefined"==typeof window||"undefined"==typeof document,ne=`\n <div aria-labelledby="${i.title}" aria-describedby="${i["html-container"]}" class="${i.popup}" tabindex="-1">\n <button type="button" class="${i.close}"></button>\n <ul class="${i["progress-steps"]}"></ul>\n <div class="${i.icon}"></div>\n <img class="${i.image}" />\n <h2 class="${i.title}" id="${i.title}"></h2>\n <div class="${i["html-container"]}" id="${i["html-container"]}"></div>\n <input class="${i.input}" id="${i.input}" />\n <input type="file" class="${i.file}" />\n <div class="${i.range}">\n <input type="range" />\n <output></output>\n </div>\n <select class="${i.select}" id="${i.select}"></select>\n <div class="${i.radio}"></div>\n <label class="${i.checkbox}">\n <input type="checkbox" id="${i.checkbox}" />\n <span class="${i.label}"></span>\n </label>\n <textarea class="${i.textarea}" id="${i.textarea}"></textarea>\n <div class="${i["validation-message"]}" id="${i["validation-message"]}"></div>\n <div class="${i.actions}">\n <div class="${i.loader}"></div>\n <button type="button" class="${i.confirm}"></button>\n <button type="button" class="${i.deny}"></button>\n <button type="button" class="${i.cancel}"></button>\n </div>\n <div class="${i.footer}"></div>\n <div class="${i["timer-progress-bar-container"]}">\n <div class="${i["timer-progress-bar"]}"></div>\n </div>\n </div>\n`.replace(/(^|\n)\s*/g,""),oe=()=>{e.currentInstance.resetValidationMessage()},ie=e=>{const t=(()=>{const e=f();return!!e&&(e.remove(),U([document.documentElement,document.body],[i["no-backdrop"],i["toast-shown"],i["has-column"]]),!0)})();if(te())return void c("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=i.container,t&&R(n,i["no-transition"]),D(n,ne);const o="string"==typeof(s=e.target)?document.querySelector(s):s;var s;o.appendChild(n),(e=>{const t=w();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&R(f(),i.rtl)})(o),(()=>{const e=w(),t=z(e,i.input),n=z(e,i.file),o=e.querySelector(`.${i.range} input`),s=e.querySelector(`.${i.range} output`),r=z(e,i.select),a=e.querySelector(`.${i.checkbox} input`),l=z(e,i.textarea);t.oninput=oe,n.onchange=oe,r.onchange=oe,a.onchange=oe,l.oninput=oe,o.oninput=()=>{oe(),s.value=o.value},o.onchange=()=>{oe(),s.value=o.value}})()},se=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?re(e,t):e&&D(t,e)},re=(e,t)=>{e.jquery?ae(t,e):D(t,e.toString())},ae=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},le=(()=>{if(te())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),ce=(e,t)=>{const n=L(),o=T();n&&o&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?K(n):Y(n),V(n,t,"actions"),function(e,t,n){const o=E(),s=P(),r=x();if(!o||!s||!r)return;ue(o,"confirm",n),ue(s,"deny",n),ue(r,"cancel",n),function(e,t,n,o){if(!o.buttonsStyling)return void U([e,t,n],i.styled);R([e,t,n],i.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,R(e,i["default-outline"]));o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,R(t,i["default-outline"]));o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,R(n,i["default-outline"]))}(o,s,r,n),n.reverseButtons&&(n.toast?(e.insertBefore(r,o),e.insertBefore(s,o)):(e.insertBefore(r,t),e.insertBefore(s,t),e.insertBefore(o,t)))}(n,o,t),D(o,t.loaderHtml||""),V(o,t,"loader"))};function ue(e,t,n){const o=a(t);J(e,n[`show${o}Button`],"inline-block"),D(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=i[t],V(e,n,`${t}Button`)}const de=(e,t)=>{const n=f();n&&(!function(e,t){"string"==typeof t?e.style.background=t:t||R([document.documentElement,document.body],i["no-backdrop"])}(n,t.backdrop),function(e,t){if(!t)return;t in i?R(e,i[t]):(l('The "position" parameter is not valid, defaulting to "center"'),R(e,i.center))}(n,t.position),function(e,t){if(!t)return;R(e,i[`grow-${t}`])}(n,t.grow),V(n,t,"container"))};const pe=["input","file","range","select","radio","checkbox","textarea"],me=e=>{if(!ve[e.input])return void c(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${e.input}"`);const t=ye(e.input),n=ve[e.input](t,e);K(t),e.inputAutoFocus&&setTimeout((()=>{F(n)}))},ge=(e,t)=>{const n=N(w(),e);if(n){(e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["id","type","value","style"].includes(n)||e.removeAttribute(n)}})(n);for(const e in t)n.setAttribute(e,t[e])}},he=e=>{const t=ye(e.input);"object"==typeof e.customClass&&R(t,e.customClass.input)},fe=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},be=(e,t,n)=>{if(n.inputLabel){const o=document.createElement("label"),s=i["input-label"];o.setAttribute("for",e.id),o.className=s,"object"==typeof n.customClass&&R(o,n.customClass.inputLabel),o.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",o)}},ye=e=>z(w(),i[e]||i.input),we=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:h(t)||l(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},ve={};ve.text=ve.email=ve.password=ve.number=ve.tel=ve.url=(e,t)=>(we(e,t.inputValue),be(e,e,t),fe(e,t),e.type=t.input,e),ve.file=(e,t)=>(be(e,e,t),fe(e,t),e),ve.range=(e,t)=>{const n=e.querySelector("input"),o=e.querySelector("output");return we(n,t.inputValue),n.type=t.input,we(o,t.inputValue),be(n,e,t),e},ve.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");D(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return be(e,e,t),e},ve.radio=e=>(e.textContent="",e),ve.checkbox=(e,t)=>{const n=N(w(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const o=e.querySelector("span");return D(o,t.inputPlaceholder),n},ve.textarea=(e,t)=>{we(e,t.inputValue),fe(e,t),be(e,e,t);return setTimeout((()=>{if("MutationObserver"in window){const n=parseInt(window.getComputedStyle(w()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const o=e.offsetWidth+(i=e,parseInt(window.getComputedStyle(i).marginLeft)+parseInt(window.getComputedStyle(i).marginRight));var i;o>n?w().style.width=`${o}px`:W(w(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Ce=(e,t)=>{const o=A();o&&(V(o,t,"htmlContainer"),t.html?(se(t.html,o),K(o,"block")):t.text?(o.textContent=t.text,K(o,"block")):Y(o),((e,t)=>{const o=w(),s=n.innerParams.get(e),r=!s||t.input!==s.input;pe.forEach((e=>{const n=z(o,i[e]);ge(e,t.inputAttributes),n.className=i[e],r&&Y(n)})),t.input&&(r&&me(t),he(t))})(e,t))},Ae=(e,t)=>{for(const[n,o]of Object.entries(s))t.icon!==n&&U(e,o);R(e,t.icon&&s[t.icon]),$e(e,t),ke(),V(e,t,"icon")},ke=()=>{const e=w();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<n.length;e++)n[e].style.backgroundColor=t},Be=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,o="";if(t.iconHtml)o=Ee(t.iconHtml);else if("success"===t.icon)o='\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n',n=n.replace(/ style=".*?"/g,"");else if("error"===t.icon)o='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n';else if(t.icon){o=Ee({question:"?",warning:"!",info:"i"}[t.icon])}n.trim()!==o.trim()&&D(e,o)},$e=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])Z(e,n,"backgroundColor",t.iconColor);Z(e,".swal2-success-ring","borderColor",t.iconColor)}},Ee=e=>`<div class="${i["icon-content"]}">${e}</div>`,xe=(e,t)=>{const n=t.showClass||{};e.className=`${i.popup} ${X(e)?n.popup:""}`,t.toast?(R([document.documentElement,document.body],i["toast-shown"]),R(e,i.toast)):R(e,i.modal),V(e,t,"popup"),"string"==typeof t.customClass&&R(e,t.customClass),t.icon&&R(e,i[`icon-${t.icon}`])},Pe=e=>{const t=document.createElement("li");return R(t,i["progress-step"]),D(t,e),t},Te=e=>{const t=document.createElement("li");return R(t,i["progress-step-line"]),e.progressStepsDistance&&W(t,"width",e.progressStepsDistance),t},Le=(e,t)=>{((e,t)=>{const n=f(),o=w();if(n&&o){if(t.toast){W(n,"width",t.width),o.style.width="100%";const e=T();e&&o.insertBefore(e,v())}else W(o,"width",t.width);W(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),Y($()),xe(o,t)}})(0,t),de(0,t),((e,t)=>{const n=B();if(!n)return;const{progressSteps:o,currentProgressStep:s}=t;o&&0!==o.length&&void 0!==s?(K(n),n.textContent="",s>=o.length&&l("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.forEach(((e,r)=>{const a=Pe(e);if(n.appendChild(a),r===s&&R(a,i["active-progress-step"]),r!==o.length-1){const e=Te(t);n.appendChild(e)}}))):Y(n)})(0,t),((e,t)=>{const o=n.innerParams.get(e),i=v();if(i){if(o&&t.icon===o.icon)return Be(i,t),void Ae(i,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(s).indexOf(t.icon))return c(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void Y(i);K(i),Be(i,t),Ae(i,t),R(i,t.showClass&&t.showClass.icon)}else Y(i)}})(e,t),((e,t)=>{const n=k();n&&(t.imageUrl?(K(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),W(n,"width",t.imageWidth),W(n,"height",t.imageHeight),n.className=i.image,V(n,t,"image")):Y(n))})(0,t),((e,t)=>{const n=C();n&&(J(n,t.title||t.titleText,"block"),t.title&&se(t.title,n),t.titleText&&(n.innerText=t.titleText),V(n,t,"title"))})(0,t),((e,t)=>{const n=M();n&&(D(n,t.closeButtonHtml||""),V(n,t,"closeButton"),J(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),Ce(e,t),ce(0,t),((e,t)=>{const n=S();n&&(J(n,t.footer),t.footer&&se(t.footer,n),V(n,t,"footer"))})(0,t);const o=w();"function"==typeof t.didRender&&o&&t.didRender(o)},Se=()=>E()&&E().click(),Oe=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Me=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},je=(e,t)=>{const n=j();if(n.length)return(e+=t)===n.length?e=0:-1===e&&(e=n.length-1),void n[e].focus();w().focus()},Ie=["ArrowRight","ArrowDown"],He=["ArrowLeft","ArrowUp"],De=(e,t,o)=>{const i=n.innerParams.get(e);i&&(t.isComposing||229===t.keyCode||(i.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?qe(e,t,i):"Tab"===t.key?Ve(t):[...Ie,...He].includes(t.key)?Ne(t.key):"Escape"===t.key&&Fe(t,i,o)))},qe=(e,t,n)=>{if(p(n.allowEnterKey)&&t.target&&e.getInput()&&t.target instanceof HTMLElement&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;Se(),t.preventDefault()}},Ve=e=>{const t=e.target,n=j();let o=-1;for(let e=0;e<n.length;e++)if(t===n[e]){o=e;break}e.shiftKey?je(o,-1):je(o,1),e.stopPropagation(),e.preventDefault()},Ne=e=>{const t=[E(),P(),x()];if(document.activeElement instanceof HTMLElement&&!t.includes(document.activeElement))return;const n=Ie.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;for(let e=0;e<L().children.length;e++){if(o=o[n],!o)return;if(o instanceof HTMLButtonElement&&X(o))break}o instanceof HTMLButtonElement&&o.focus()},Fe=(e,t,n)=>{p(t.allowEscapeKey)&&(e.preventDefault(),n(Oe.esc))};var _e={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Re=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Ue="undefined"!=typeof window&&!!window.GestureEvent,ze=()=>{const e=f();let t;e.ontouchstart=e=>{t=We(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},We=e=>{const t=e.target,n=f();return!Ke(e)&&!Ye(e)&&(t===n||!G(n)&&t instanceof HTMLElement&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&(!G(A())||!A().contains(t)))},Ke=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Ye=e=>e.touches&&e.touches.length>1;let Ze=null;const Je=()=>{null===Ze&&document.body.scrollHeight>window.innerHeight&&(Ze=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Ze+(()=>{const e=document.createElement("div");e.className=i["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function Xe(n,o,s,r){H()?st(n,r):(t(s).then((()=>st(n,r))),Me(e)),Ue?(o.setAttribute("style","display:none !important"),o.removeAttribute("class"),o.innerHTML=""):o.remove(),I()&&(null!==Ze&&(document.body.style.paddingRight=`${Ze}px`,Ze=null),(()=>{if(q(document.body,i.iosfix)){const e=parseInt(document.body.style.top,10);U(document.body,i.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),Re()),U([document.documentElement,document.body],[i.shown,i["height-auto"],i["no-backdrop"],i["toast-shown"]])}function Ge(e){e=nt(e);const t=_e.swalPromiseResolve.get(this),n=Qe(this);this.isAwaitingPromise?e.isDismissed||(tt(this),t(e)):n&&t(e)}const Qe=e=>{const t=w();if(!t)return!1;const o=n.innerParams.get(e);if(!o||q(t,o.hideClass.popup))return!1;U(t,o.showClass.popup),R(t,o.hideClass.popup);const i=f();return U(i,o.showClass.backdrop),R(i,o.hideClass.backdrop),ot(e,t,o),!0};function et(e){const t=_e.swalPromiseReject.get(this);tt(this),t&&t(e)}const tt=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,n.innerParams.get(e)||e._destroy())},nt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),ot=(e,t,n)=>{const o=f(),i=le&&Q(t);"function"==typeof n.willClose&&n.willClose(t),i?it(e,t,o,n.returnFocus,n.didClose):Xe(e,o,n.returnFocus,n.didClose)},it=(t,n,o,i,s)=>{e.swalCloseEventFinishedCallback=Xe.bind(null,t,o,i,s),n.addEventListener(le,(function(t){t.target===n&&(e.swalCloseEventFinishedCallback(),delete e.swalCloseEventFinishedCallback)}))},st=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},rt=e=>{let t=w();if(t||new Hn,t=w(),!t)return;const n=T();H()?Y(v()):at(t,e),K(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},at=(e,t)=>{const n=L(),o=T();n&&o&&(!t&&X(E())&&(t=E()),K(n),t&&(Y(t),o.setAttribute("data-button-to-replace",t.className),n.insertBefore(o,t)),R([e,n],i.loading))},lt=e=>e.checked?1:0,ct=e=>e.checked?e.value:null,ut=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,dt=(e,t)=>{const n=w();if(!n)return;const o=e=>{"select"===t.input?function(e,t,n){const o=z(e,i.select);if(!o)return;const s=(e,t,o)=>{const i=document.createElement("option");i.value=o,D(i,t),i.selected=gt(o,n.inputValue),e.appendChild(i)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,o.appendChild(e),n.forEach((t=>s(e,t[1],t[0])))}else s(o,n,t)})),o.focus()}(n,mt(e),t):"radio"===t.input&&function(e,t,n){const o=z(e,i.radio);if(!o)return;t.forEach((e=>{const t=e[0],s=e[1],r=document.createElement("input"),a=document.createElement("label");r.type="radio",r.name=i.radio,r.value=t,gt(t,n.inputValue)&&(r.checked=!0);const l=document.createElement("span");D(l,s),l.className=i.label,a.appendChild(r),a.appendChild(l),o.appendChild(a)}));const s=o.querySelectorAll("input");s.length&&s[0].focus()}(n,mt(e),t)};m(t.inputOptions)||h(t.inputOptions)?(rt(E()),g(t.inputOptions).then((t=>{e.hideLoading(),o(t)}))):"object"==typeof t.inputOptions?o(t.inputOptions):c("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},pt=(e,t)=>{const n=e.getInput();n&&(Y(n),g(t.inputValue).then((o=>{n.value="number"===t.input?`${parseFloat(o)||0}`:`${o}`,K(n),n.focus(),e.hideLoading()})).catch((t=>{c(`Error in inputValue promise: ${t}`),n.value="",K(n),n.focus(),e.hideLoading()})))};const mt=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let o=e;"object"==typeof o&&(o=mt(o)),t.push([n,o])})):Object.keys(e).forEach((n=>{let o=e[n];"object"==typeof o&&(o=mt(o)),t.push([n,o])})),t},gt=(e,t)=>!!t&&t.toString()===e.toString(),ht=(e,t)=>{const o=n.innerParams.get(e);if(!o.input)return void c(`The "input" parameter is needed to be set when using returnInputValueOn${a(t)}`);const i=e.getInput(),s=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return lt(n);case"radio":return ct(n);case"file":return ut(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,o);o.inputValidator?ft(e,s,t):i&&!i.checkValidity()?(e.enableButtons(),e.showValidationMessage(o.validationMessage)):"deny"===t?bt(e,s):vt(e,s)},ft=(e,t,o)=>{const i=n.innerParams.get(e);e.disableInput();Promise.resolve().then((()=>g(i.inputValidator(t,i.validationMessage)))).then((n=>{e.enableButtons(),e.enableInput(),n?e.showValidationMessage(n):"deny"===o?bt(e,t):vt(e,t)}))},bt=(e,t)=>{const o=n.innerParams.get(e||void 0);if(o.showLoaderOnDeny&&rt(P()),o.preDeny){e.isAwaitingPromise=!0;Promise.resolve().then((()=>g(o.preDeny(t,o.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),tt(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>wt(e||void 0,t)))}else e.close({isDenied:!0,value:t})},yt=(e,t)=>{e.close({isConfirmed:!0,value:t})},wt=(e,t)=>{e.rejectPromise(t)},vt=(e,t)=>{const o=n.innerParams.get(e||void 0);if(o.showLoaderOnConfirm&&rt(),o.preConfirm){e.resetValidationMessage(),e.isAwaitingPromise=!0;Promise.resolve().then((()=>g(o.preConfirm(t,o.validationMessage)))).then((n=>{X($())||!1===n?(e.hideLoading(),tt(e)):yt(e,void 0===n?t:n)})).catch((t=>wt(e||void 0,t)))}else yt(e,t)};function Ct(){const e=n.innerParams.get(this);if(!e)return;const t=n.domCache.get(this);Y(t.loader),H()?e.icon&&K(v()):At(t),U([t.popup,t.actions],i.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const At=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?K(t[0],"inline-block"):X(E())||X(P())||X(x())||Y(e.actions)};function kt(){const e=n.innerParams.get(this),t=n.domCache.get(this);return t?N(t.popup,e.input):null}function Bt(e,t,o){const i=n.domCache.get(e);t.forEach((e=>{i[e].disabled=o}))}function $t(e,t){const n=w();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${i.radio}"]`);for(let n=0;n<e.length;n++)e[n].disabled=t}else e.disabled=t}function Et(){Bt(this,["confirmButton","denyButton","cancelButton"],!1)}function xt(){Bt(this,["confirmButton","denyButton","cancelButton"],!0)}function Pt(){$t(this.getInput(),!1)}function Tt(){$t(this.getInput(),!0)}function Lt(e){const t=n.domCache.get(this),o=n.innerParams.get(this);D(t.validationMessage,e),t.validationMessage.className=i["validation-message"],o.customClass&&o.customClass.validationMessage&&R(t.validationMessage,o.customClass.validationMessage),K(t.validationMessage);const s=this.getInput();s&&(s.setAttribute("aria-invalid",!0),s.setAttribute("aria-describedby",i["validation-message"]),F(s),R(s,i.inputerror))}function St(){const e=n.domCache.get(this);e.validationMessage&&Y(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),U(t,i.inputerror))}const Ot={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},Mt=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],jt={},It=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Ht=e=>Object.prototype.hasOwnProperty.call(Ot,e),Dt=e=>-1!==Mt.indexOf(e),qt=e=>jt[e],Vt=e=>{Ht(e)||l(`Unknown parameter "${e}"`)},Nt=e=>{It.includes(e)&&l(`The parameter "${e}" is incompatible with toasts`)},Ft=e=>{const t=qt(e);t&&d(e,t)};function _t(e){const t=w(),o=n.innerParams.get(this);if(!t||q(t,o.hideClass.popup))return void l("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const i=Rt(e),s=Object.assign({},o,i);Le(this,s),n.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Rt=e=>{const t={};return Object.keys(e).forEach((n=>{Dt(n)?t[n]=e[n]:l(`Invalid parameter to update: ${n}`)})),t};function Ut(){const t=n.domCache.get(this),o=n.innerParams.get(this);o?(t.popup&&e.swalCloseEventFinishedCallback&&(e.swalCloseEventFinishedCallback(),delete e.swalCloseEventFinishedCallback),"function"==typeof o.didDestroy&&o.didDestroy(),zt(this)):Wt(this)}const zt=t=>{Wt(t),delete t.params,delete e.keydownHandler,delete e.keydownTarget,delete e.currentInstance},Wt=e=>{e.isAwaitingPromise?(Kt(n,e),e.isAwaitingPromise=!0):(Kt(_e,e),Kt(n,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Kt=(e,t)=>{for(const n in e)e[n].delete(t)};var Yt=Object.freeze({__proto__:null,_destroy:Ut,close:Ge,closeModal:Ge,closePopup:Ge,closeToast:Ge,disableButtons:xt,disableInput:Tt,disableLoading:Ct,enableButtons:Et,enableInput:Pt,getInput:kt,handleAwaitingPromise:tt,hideLoading:Ct,rejectPromise:et,resetValidationMessage:St,showValidationMessage:Lt,update:_t});const Zt=(e,t,o)=>{t.popup.onclick=()=>{const t=n.innerParams.get(e);t&&(Jt(t)||t.timer||t.input)||o(Oe.close)}},Jt=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Xt=!1;const Gt=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Xt=!0)}}},Qt=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Xt=!0)}}},en=(e,t,o)=>{t.container.onclick=i=>{const s=n.innerParams.get(e);Xt?Xt=!1:i.target===t.container&&p(s.allowOutsideClick)&&o(Oe.backdrop)}},tn=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const nn=()=>{if(e.timeout)return(()=>{const e=O();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`})(),e.timeout.stop()},on=()=>{if(e.timeout){const t=e.timeout.start();return ee(t),t}};let sn=!1;const rn={};const an=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in rn){const n=t.getAttribute(e);if(n)return void rn[e].fire({template:n})}};var ln=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||tn(e[0])?["title","html","icon"].forEach(((n,o)=>{const i=e[o];"string"==typeof i||tn(i)?t[n]=i:void 0!==i&&c(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`)})):Object.assign(t,e[0]),t},bindClickHandler:function(){rn[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,sn||(document.body.addEventListener("click",an),sn=!0)},clickCancel:()=>x()&&x().click(),clickConfirm:Se,clickDeny:()=>P()&&P().click(),enableLoading:rt,fire:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this(...t)},getActions:L,getCancelButton:x,getCloseButton:M,getConfirmButton:E,getContainer:f,getDenyButton:P,getFocusableElements:j,getFooter:S,getHtmlContainer:A,getIcon:v,getIconContent:()=>y(i["icon-content"]),getImage:k,getInputLabel:()=>y(i["input-label"]),getLoader:T,getPopup:w,getProgressSteps:B,getTimerLeft:()=>e.timeout&&e.timeout.getTimerLeft(),getTimerProgressBar:O,getTitle:C,getValidationMessage:$,increaseTimer:t=>{if(e.timeout){const n=e.timeout.increase(t);return ee(n,!0),n}},isDeprecatedParameter:qt,isLoading:()=>{const e=w();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!e.timeout||!e.timeout.isRunning()),isUpdatableParameter:Dt,isValidParameter:Ht,isVisible:()=>X(w()),mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},resumeTimer:on,showLoading:rt,stopTimer:nn,toggleTimer:()=>{const t=e.timeout;return t&&(t.running?nn():on())}});class cn{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const un=["swal-title","swal-html","swal-footer"],dn=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{wn(e,["name","value"]);const n=e.getAttribute("name"),o=e.getAttribute("value");t[n]="boolean"==typeof Ot[n]?"false"!==o:"object"==typeof Ot[n]?JSON.parse(o):o})),t},pn=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),o=e.getAttribute("value");t[n]=new Function(`return ${o}`)()})),t},mn=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{wn(e,["type","color","aria-label"]);const n=e.getAttribute("type");t[`${n}ButtonText`]=e.innerHTML,t[`show${a(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label"))})),t},gn=e=>{const t={},n=e.querySelector("swal-image");return n&&(wn(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},hn=e=>{const t={},n=e.querySelector("swal-icon");return n&&(wn(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},fn=e=>{const t={},n=e.querySelector("swal-input");n&&(wn(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const o=Array.from(e.querySelectorAll("swal-input-option"));return o.length&&(t.inputOptions={},o.forEach((e=>{wn(e,["value"]);const n=e.getAttribute("value"),o=e.innerHTML;t.inputOptions[n]=o}))),t},bn=(e,t)=>{const n={};for(const o in t){const i=t[o],s=e.querySelector(i);s&&(wn(s,[]),n[i.replace(/^swal-/,"")]=s.innerHTML.trim())}return n},yn=e=>{const t=un.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||l(`Unrecognized element <${n}>`)}))},wn=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&l([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,""+(t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element.")])}))},vn=t=>{const n=f(),o=w();"function"==typeof t.willOpen&&t.willOpen(o);const s=window.getComputedStyle(document.body).overflowY;Bn(n,o,t),setTimeout((()=>{An(n,o)}),10),I()&&(kn(n,t.scrollbarPadding,s),Array.from(document.body.children).forEach((e=>{e===f()||e.contains(f())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")||""),e.setAttribute("aria-hidden","true"))}))),H()||e.previousActiveElement||(e.previousActiveElement=document.activeElement),"function"==typeof t.didOpen&&setTimeout((()=>t.didOpen(o))),U(n,i["no-transition"])},Cn=e=>{const t=w();if(e.target!==t)return;const n=f();t.removeEventListener(le,Cn),n.style.overflowY="auto"},An=(e,t)=>{le&&Q(t)?(e.style.overflowY="hidden",t.addEventListener(le,Cn)):e.style.overflowY="auto"},kn=(e,t,n)=>{(()=>{if(Ue&&!q(document.body,i.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",R(document.body,i.iosfix),ze()}})(),t&&"hidden"!==n&&Je(),setTimeout((()=>{e.scrollTop=0}))},Bn=(e,t,n)=>{R(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),K(t,"grid"),setTimeout((()=>{R(t,n.showClass.popup),t.style.removeProperty("opacity")}),10),R([document.documentElement,document.body],i.shown),n.heightAuto&&n.backdrop&&!n.toast&&R([document.documentElement,document.body],i["height-auto"])};var $n={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function En(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=$n.email),"url"===e.input&&(e.inputValidator=$n.url))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&l("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(l('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),ie(e)}let xn;class Pn{constructor(){if("undefined"==typeof window)return;xn=this;for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];const i=Object.freeze(this.constructor.argsToParams(t));this.params=i,this.isAwaitingPromise=!1;const s=xn._main(xn.params);n.promise.set(this,s)}_main(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(e=>{!1===e.backdrop&&e.allowOutsideClick&&l('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Vt(t),e.toast&&Nt(t),Ft(t)})(Object.assign({},o,t)),e.currentInstance&&(e.currentInstance._destroy(),I()&&Re()),e.currentInstance=xn;const i=Ln(t,o);En(i),Object.freeze(i),e.timeout&&(e.timeout.stop(),delete e.timeout),clearTimeout(e.restoreFocusTimeout);const s=Sn(xn);return Le(xn,i),n.innerParams.set(xn,i),Tn(xn,s,i)}then(e){return n.promise.get(this).then(e)}finally(e){return n.promise.get(this).finally(e)}}const Tn=(t,o,i)=>new Promise(((s,r)=>{const a=e=>{t.close({isDismissed:!0,dismiss:e})};_e.swalPromiseResolve.set(t,s),_e.swalPromiseReject.set(t,r),o.confirmButton.onclick=()=>{(e=>{const t=n.innerParams.get(e);e.disableButtons(),t.input?ht(e,"confirm"):vt(e,!0)})(t)},o.denyButton.onclick=()=>{(e=>{const t=n.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?ht(e,"deny"):bt(e,!1)})(t)},o.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Oe.cancel)})(t,a)},o.closeButton.onclick=()=>{a(Oe.close)},((e,t,o)=>{n.innerParams.get(e).toast?Zt(e,t,o):(Gt(t),Qt(t),en(e,t,o))})(t,o,a),((e,t,n,o)=>{Me(t),n.toast||(t.keydownHandler=t=>De(e,t,o),t.keydownTarget=n.keydownListenerCapture?window:w(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)})(t,e,i,a),((e,t)=>{"select"===t.input||"radio"===t.input?dt(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(m(t.inputValue)||h(t.inputValue))&&(rt(E()),pt(e,t))})(t,i),vn(i),On(e,i,a),Mn(o,i),setTimeout((()=>{o.container.scrollTop=0}))})),Ln=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return yn(n),Object.assign(dn(n),pn(n),mn(n),gn(n),hn(n),fn(n),bn(n,un))})(e),o=Object.assign({},Ot,t,n,e);return o.showClass=Object.assign({},Ot.showClass,o.showClass),o.hideClass=Object.assign({},Ot.hideClass,o.hideClass),o},Sn=e=>{const t={popup:w(),container:f(),actions:L(),confirmButton:E(),denyButton:P(),cancelButton:x(),loader:T(),closeButton:M(),validationMessage:$(),progressSteps:B()};return n.domCache.set(e,t),t},On=(e,t,n)=>{const o=O();Y(o),t.timer&&(e.timeout=new cn((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(K(o),V(o,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&ee(t.timer)}))))},Mn=(e,t)=>{t.toast||(p(t.allowEnterKey)?jn(e,t)||je(-1,1):In())},jn=(e,t)=>t.focusDeny&&X(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&X(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!X(e.confirmButton))&&(e.confirmButton.focus(),!0),In=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}Pn.prototype.disableButtons=xt,Pn.prototype.enableButtons=Et,Pn.prototype.getInput=kt,Pn.prototype.disableInput=Tt,Pn.prototype.enableInput=Pt,Pn.prototype.hideLoading=Ct,Pn.prototype.disableLoading=Ct,Pn.prototype.showValidationMessage=Lt,Pn.prototype.resetValidationMessage=St,Pn.prototype.close=Ge,Pn.prototype.closePopup=Ge,Pn.prototype.closeModal=Ge,Pn.prototype.closeToast=Ge,Pn.prototype.rejectPromise=et,Pn.prototype.update=_t,Pn.prototype._destroy=Ut,Object.assign(Pn,ln),Object.keys(Yt).forEach((e=>{Pn[e]=function(){return xn&&xn[e]?xn[e](...arguments):null}})),Pn.DismissReason=Oe,Pn.version="11.7.21";const Hn=Pn;return Hn.default=Hn,Hn})),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2);