63 lines
158 KiB
JavaScript
63 lines
158 KiB
JavaScript
var H="top",U="bottom",q="right",j="left",un="auto",lt=[H,U,q,j],Re="start",Je="end",Vs="clippingParents",oo="viewport",qe="popper",Hs="reference",Yn=lt.reduce(function(t,e){return t.concat([e+"-"+Re,e+"-"+Je])},[]),so=[].concat(lt,[un]).reduce(function(t,e){return t.concat([e,e+"-"+Re,e+"-"+Je])},[]),js="beforeRead",Ws="read",Fs="afterRead",zs="beforeMain",Ks="main",Ys="afterMain",Us="beforeWrite",qs="write",Gs="afterWrite",Xs=[js,Ws,Fs,zs,Ks,Ys,Us,qs,Gs];function ue(t){return t?(t.nodeName||"").toLowerCase():null}function G(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ve(t){var e=G(t).Element;return t instanceof e||t instanceof Element}function J(t){var e=G(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function io(t){if(typeof ShadowRoot>"u")return!1;var e=G(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Vr(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var o=e.styles[n]||{},s=e.attributes[n]||{},i=e.elements[n];!J(i)||!ue(i)||(Object.assign(i.style,o),Object.keys(s).forEach(function(r){var a=s[r];a===!1?i.removeAttribute(r):i.setAttribute(r,a===!0?"":a)}))})}function Hr(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(o){var s=e.elements[o],i=e.attributes[o]||{},r=Object.keys(e.styles.hasOwnProperty(o)?e.styles[o]:n[o]),a=r.reduce(function(c,f){return c[f]="",c},{});!J(s)||!ue(s)||(Object.assign(s.style,a),Object.keys(i).forEach(function(c){s.removeAttribute(c)}))})}}const ro={name:"applyStyles",enabled:!0,phase:"write",fn:Vr,effect:Hr,requires:["computeStyles"]};function le(t){return t.split("-")[0]}var Me=Math.max,Xt=Math.min,et=Math.round;function Un(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Qs(){return!/^((?!chrome|android).)*safari/i.test(Un())}function tt(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var o=t.getBoundingClientRect(),s=1,i=1;e&&J(t)&&(s=t.offsetWidth>0&&et(o.width)/t.offsetWidth||1,i=t.offsetHeight>0&&et(o.height)/t.offsetHeight||1);var r=Ve(t)?G(t):window,a=r.visualViewport,c=!Qs()&&n,f=(o.left+(c&&a?a.offsetLeft:0))/s,d=(o.top+(c&&a?a.offsetTop:0))/i,g=o.width/s,w=o.height/i;return{width:g,height:w,top:d,right:f+g,bottom:d+w,left:f,x:f,y:d}}function ao(t){var e=tt(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function Zs(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&io(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function me(t){return G(t).getComputedStyle(t)}function jr(t){return["table","td","th"].indexOf(ue(t))>=0}function Ce(t){return((Ve(t)?t.ownerDocument:t.document)||window.document).documentElement}function dn(t){return ue(t)==="html"?t:t.assignedSlot||t.parentNode||(io(t)?t.host:null)||Ce(t)}function Yo(t){return!J(t)||me(t).position==="fixed"?null:t.offsetParent}function Wr(t){var e=/firefox/i.test(Un()),n=/Trident/i.test(Un());if(n&&J(t)){var o=me(t);if(o.position==="fixed")return null}var s=dn(t);for(io(s)&&(s=s.host);J(s)&&["html","body"].indexOf(ue(s))<0;){var i=me(s);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return s;s=s.parentNode}return null}function At(t){for(var e=G(t),n=Yo(t);n&&jr(n)&&me(n).position==="static";)n=Yo(n);return n&&(ue(n)==="html"||ue(n)==="body"&&me(n).position==="static")?e:n||Wr(t)||e}function lo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function _t(t,e,n){return Me(t,Xt(e,n))}function Fr(t,e,n){
|
|||
|
|
a[href],
|
||
|
|
area[href],
|
||
|
|
input:not([disabled]),
|
||
|
|
select:not([disabled]),
|
||
|
|
textarea:not([disabled]),
|
||
|
|
button:not([disabled]),
|
||
|
|
iframe,
|
||
|
|
object,
|
||
|
|
embed,
|
||
|
|
[tabindex="0"],
|
||
|
|
[contenteditable],
|
||
|
|
audio[controls],
|
||
|
|
video[controls],
|
||
|
|
summary
|
||
|
|
`,So=()=>{const t=y();if(!t)return[];const e=t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(e).sort((i,r)=>{const a=parseInt(i.getAttribute("tabindex")||"0"),c=parseInt(r.getAttribute("tabindex")||"0");return a>c?1:a<c?-1:0}),o=t.querySelectorAll(Gd),s=Array.from(o).filter(i=>i.getAttribute("tabindex")!=="-1");return[...new Set(n.concat(s))].filter(i=>K(i))},xo=()=>pe(document.body,l.shown)&&!pe(document.body,l["toast-shown"])&&!pe(document.body,l["no-backdrop"]),En=()=>{const t=y();return t?pe(t,l.toast):!1},Xd=()=>{const t=y();return t?t.hasAttribute("data-loading"):!1},Z=(t,e)=>{if(t.textContent="",e){const o=new DOMParser().parseFromString(e,"text/html"),s=o.querySelector("head");s&&Array.from(s.childNodes).forEach(r=>{t.appendChild(r)});const i=o.querySelector("body");i&&Array.from(i.childNodes).forEach(r=>{r instanceof HTMLVideoElement||r instanceof HTMLAudioElement?t.appendChild(r.cloneNode(!0)):t.appendChild(r)})}},pe=(t,e)=>{if(!e)return!1;const n=e.split(/\s+/);for(let o=0;o<n.length;o++)if(!t.classList.contains(n[o]))return!1;return!0},Qd=(t,e)=>{Array.from(t.classList).forEach(n=>{!Object.values(l).includes(n)&&!Object.values(en).includes(n)&&!Object.values(e.showClass||{}).includes(n)&&t.classList.remove(n)})},X=(t,e,n)=>{if(Qd(t,e),!e.customClass)return;const o=e.customClass[n];if(o){if(typeof o!="string"&&!o.forEach){W(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof o}"`);return}E(t,o)}},yn=(t,e)=>{if(!e)return null;switch(e){case"select":case"textarea":case"file":return t.querySelector(`.${l.popup} > .${l[e]}`);case"checkbox":return t.querySelector(`.${l.popup} > .${l.checkbox} input`);case"radio":return t.querySelector(`.${l.popup} > .${l.radio} input:checked`)||t.querySelector(`.${l.popup} > .${l.radio} input:first-child`);case"range":return t.querySelector(`.${l.popup} > .${l.range} input`);default:return t.querySelector(`.${l.popup} > .${l.input}`)}},Yi=t=>{if(t.focus(),t.type!=="file"){const e=t.value;t.value="",t.value=e}},Ui=(t,e,n)=>{!t||!e||(typeof e=="string"&&(e=e.split(/\s+/).filter(Boolean)),e.forEach(o=>{Array.isArray(t)?t.forEach(s=>{n?s.classList.add(o):s.classList.remove(o)}):n?t.classList.add(o):t.classList.remove(o)}))},E=(t,e)=>{Ui(t,e,!0)},ne=(t,e)=>{Ui(t,e,!1)},ve=(t,e)=>{const n=Array.from(t.children);for(let o=0;o<n.length;o++){const s=n[o];if(s instanceof HTMLElement&&pe(s,e))return s}},Be=(t,e,n)=>{n===`${parseInt(`${n}`)}`&&(n=parseInt(n)),n||parseInt(`${n}`)===0?t.style.setProperty(e,typeof n=="number"?`${n}px`:n):t.style.removeProperty(e)},P=(t,e="flex")=>{t&&(t.style.display=e)},R=t=>{t&&(t.style.display="none")},$o=(t,e="block")=>{t&&new MutationObserver(()=>{Lt(t,t.innerHTML,e)}).observe(t,{childList:!0,subtree:!0})},$s=(t,e,n,o)=>{const s=t.querySelector(e);s&&s.style.setProperty(n,o)},Lt=(t,e,n="flex")=>{e?P(t,n):R(t)},K=t=>!!(t&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)),Zd=()=>!K(de())&&!K(ze())&&!K(ht()),Jn=t=>t.scrollHeight>t.clientHeight,Jd=(t,e)=>{let n=t;for(;n&&n!==e;){if(Jn(n))return!0;n=n.parentElement}return!1},qi=t=>{const e=window.getComputedStyle(t),n=parseFloat(e.getPropertyValue("animation-duration")||"0"),o=parseFloat(e.getPropertyValue("transition-duration")||"0");return n>0||o>0},Lo=(t,e=!1)=>{const n=_n();n&&K(n)&&(e&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition=`width ${t/1e3}s linear`,n.style.width="0%"},10))},ef=()=>{const t=_n();if(!t)return;const e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";const n=parseInt(window.getComputedStyle(t).width),o=e/n*100;t.style.width=`${o}%`},tf=()=>typeof window>"u"||typeof document>"u",nf=`
|
||
|
|
<div aria-labelledby="${l.title}" aria-describedby="${l["html-container"]}" class="${l.popup}" tabindex="-1">
|
||
|
|
<button type="button" class="${l.close}"></button>
|
||
|
|
<ul class="${l["progress-steps"]}"></ul>
|
||
|
|
<div class="${l.icon}"></div>
|
||
|
|
<img class="${l.image}" />
|
||
|
|
<h2 class="${l.title}" id="${l.title}"></h2>
|
||
|
|
<div class="${l["html-container"]}" id="${l["html-container"]}"></div>
|
||
|
|
<input class="${l.input}" id="${l.input}" />
|
||
|
|
<input type="file" class="${l.file}" />
|
||
|
|
<div class="${l.range}">
|
||
|
|
<input type="range" />
|
||
|
|
<output></output>
|
||
|
|
</div>
|
||
|
|
<select class="${l.select}" id="${l.select}"></select>
|
||
|
|
<div class="${l.radio}"></div>
|
||
|
|
<label class="${l.checkbox}">
|
||
|
|
<input type="checkbox" id="${l.checkbox}" />
|
||
|
|
<span class="${l.label}"></span>
|
||
|
|
</label>
|
||
|
|
<textarea class="${l.textarea}" id="${l.textarea}"></textarea>
|
||
|
|
<div class="${l["validation-message"]}" id="${l["validation-message"]}"></div>
|
||
|
|
<div class="${l.actions}">
|
||
|
|
<div class="${l.loader}"></div>
|
||
|
|
<button type="button" class="${l.confirm}"></button>
|
||
|
|
<button type="button" class="${l.deny}"></button>
|
||
|
|
<button type="button" class="${l.cancel}"></button>
|
||
|
|
</div>
|
||
|
|
<div class="${l.footer}"></div>
|
||
|
|
<div class="${l["timer-progress-bar-container"]}">
|
||
|
|
<div class="${l["timer-progress-bar"]}"></div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
`.replace(/(^|\n)\s*/g,""),of=()=>{const t=F();return t?(t.remove(),ne([document.documentElement,document.body],[l["no-backdrop"],l["toast-shown"],l["has-column"]]),!0):!1},De=()=>{h.currentInstance&&h.currentInstance.resetValidationMessage()},sf=()=>{const t=y();if(!t)return;const e=ve(t,l.input),n=ve(t,l.file),o=t.querySelector(`.${l.range} input`),s=t.querySelector(`.${l.range} output`),i=ve(t,l.select),r=t.querySelector(`.${l.checkbox} input`),a=ve(t,l.textarea);e&&(e.oninput=De),n&&(n.onchange=De),i&&(i.onchange=De),r&&(r.onchange=De),a&&(a.oninput=De),o&&s&&(o.oninput=()=>{De(),s.value=o.value},o.onchange=()=>{De(),s.value=o.value})},rf=t=>{if(typeof t=="string"){const e=document.querySelector(t);if(!e)throw new Error(`Target element "${t}" not found`);return e}return t},af=t=>{const e=y();e&&(e.setAttribute("role",t.toast?"alert":"dialog"),e.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||e.setAttribute("aria-modal","true"))},lf=t=>{window.getComputedStyle(t).direction==="rtl"&&(E(F(),l.rtl),h.isRTL=!0)},cf=t=>{const e=of();if(tf()){Fe("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");n.className=l.container,e&&E(n,l["no-transition"]),Z(n,nf),n.dataset.swal2Theme=t.theme;const o=rf(t.target||"body");o.appendChild(n),t.topLayer&&(n.setAttribute("popover",""),n.showPopover()),af(t),lf(o),sf()},No=(t,e)=>{t instanceof HTMLElement?e.appendChild(t):typeof t=="object"?uf(t,e):t&&Z(e,t)},uf=(t,e)=>{"jquery"in t?df(e,t):Z(e,t.toString())},df=(t,e)=>{if(t.textContent="",0 in e)for(let n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},ff=(t,e)=>{const n=$t(),o=pt();!n||!o||(!e.showConfirmButton&&!e.showDenyButton&&!e.showCancelButton?R(n):P(n),X(n,e,"actions"),hf(n,o,e),Z(o,e.loaderHtml||""),X(o,e,"loader"))};function hf(t,e,n){const o=de(),s=ze(),i=ht();!o||!s||!i||(zn(o,"confirm",n),zn(s,"deny",n),zn(i,"cancel",n),pf(o,s,i,n),n.reverseButtons&&(n.toast?(t.insertBefore(i,o),t.insertBefore(s,o)):(t.insertBefore(i,e),t.insertBefore(s,e),t.insertBefore(o,e))))}function pf(t,e,n,o){if(!o.buttonsStyling){ne([t,e,n],l.styled);return}E([t,e,n],l.styled),o.confirmButtonColor&&t.style.setProperty("--swal2-confirm-button-background-color",o.confirmButtonColor),o.denyButtonColor&&e.style.setProperty("--swal2-deny-button-background-color",o.denyButtonColor),o.cancelButtonColor&&n.style.setProperty("--swal2-cancel-button-background-color",o.cancelButtonColor),Fn(t),Fn(e),Fn(n)}function Fn(t){const e=window.getComputedStyle(t);if(e.getPropertyValue("--swal2-action-button-focus-box-shadow"))return;const n=e.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,"rgba($1, $2, $3, 0.5)");t.style.setProperty("--swal2-action-button-focus-box-shadow",e.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/,` ${n}`))}function zn(t,e,n){const o=yo(e);Lt(t,n[`show${o}Button`],"inline-block"),Z(t,n[`${e}ButtonText`]||""),t.setAttribute("aria-label",n[`${e}ButtonAriaLabel`]||""),t.className=l[e],X(t,n,`${e}Button`)}const mf=(t,e)=>{const n=ko();n&&(Z(n,e.closeButtonHtml||""),X(n,e,"closeButton"),Lt(n,e.showCloseButton),n.setAttribute("aria-label",e.closeButtonAriaLabel||""))},gf=(t,e)=>{const n=F();n&&(wf(n,e.backdrop),bf(n,e.position),vf(n,e.grow),X(n,e,"container"))};function wf(t,e){typeof e=="string"?t.style.background=e:e||E([document.documentElement,document.body],l["no-backdrop"])}function bf(t,e){e&&(e in l?E(t,l[e]):(W('The "position" parameter is not valid, defaulting to "center"'),E(t,l.center)))}function vf(t,e){e&&E(t,l[`grow-${e}`])}var O={innerParams:new WeakMap,domCache:new WeakMap};const _f=["input","file","range","select","radio","checkbox","textarea"],Ef=(t,e)=>{const n=y();if(!n)return;const o=O.innerParams.get(t),s=!o||e.input!==o.input;_f.forEach(i=>{const r=ve(n,l[i]);r&&(Tf(i,e.inputAttributes),r.className=l[i],s&&R(r))}),e.input&&(s&&yf(e),Cf(e))},yf=t=>{if(!t.input)return;if(!L[t.input]){Fe(`Unexpected type of input! Expected ${Object.keys(L).join(" | ")}, got "${t.input}"`);return}const e=Gi(t.input);if(!e)return;const n=L[t.i
|
||
|
|
${t.animation?'<div class="swal2-success-circular-line-left"></div>':""}
|
||
|
|
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
||
|
|
<div class="swal2-success-ring"></div>
|
||
|
|
${t.animation?'<div class="swal2-success-fix"></div>':""}
|
||
|
|
${t.animation?'<div class="swal2-success-circular-line-right"></div>':""}
|
||
|
|
`,$f=`
|
||
|
|
<span class="swal2-x-mark">
|
||
|
|
<span class="swal2-x-mark-line-left"></span>
|
||
|
|
<span class="swal2-x-mark-line-right"></span>
|
||
|
|
</span>
|
||
|
|
`,Ns=(t,e)=>{if(!e.icon&&!e.iconHtml)return;let n=t.innerHTML,o="";e.iconHtml?o=Ds(e.iconHtml):e.icon==="success"?(o=xf(e),n=n.replace(/ style=".*?"/g,"")):e.icon==="error"?o=$f:e.icon&&(o=Ds({question:"?",warning:"!",info:"i"}[e.icon])),n.trim()!==o.trim()&&Z(t,o)},Lf=(t,e)=>{if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])$s(t,n,"background-color",e.iconColor);$s(t,".swal2-success-ring","border-color",e.iconColor)}},Ds=t=>`<div class="${l["icon-content"]}">${t}</div>`,Nf=(t,e)=>{const n=zi();if(n){if(!e.imageUrl){R(n);return}P(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt||""),Be(n,"width",e.imageWidth),Be(n,"height",e.imageHeight),n.className=l.image,X(n,e,"image")}};let Io=!1,Qi=0,Zi=0,Ji=0,er=0;const Df=t=>{t.addEventListener("mousedown",nn),document.body.addEventListener("mousemove",on),t.addEventListener("mouseup",sn),t.addEventListener("touchstart",nn),document.body.addEventListener("touchmove",on),t.addEventListener("touchend",sn)},If=t=>{t.removeEventListener("mousedown",nn),document.body.removeEventListener("mousemove",on),t.removeEventListener("mouseup",sn),t.removeEventListener("touchstart",nn),document.body.removeEventListener("touchmove",on),t.removeEventListener("touchend",sn)},nn=t=>{const e=y();if(!e)return;const n=ft();if(t.target===e||n&&n.contains(t.target)){Io=!0;const o=tr(t);Qi=o.clientX,Zi=o.clientY,Ji=parseInt(e.style.insetInlineStart)||0,er=parseInt(e.style.insetBlockStart)||0,E(e,"swal2-dragging")}},on=t=>{const e=y();if(e&&Io){let{clientX:n,clientY:o}=tr(t);const s=n-Qi;e.style.insetInlineStart=`${Ji+(h.isRTL?-s:s)}px`,e.style.insetBlockStart=`${er+(o-Zi)}px`}},sn=()=>{const t=y();Io=!1,ne(t,"swal2-dragging")},tr=t=>{let e=0,n=0;return t.type.startsWith("mouse")?(e=t.clientX,n=t.clientY):t.type.startsWith("touch")&&(e=t.touches[0].clientX,n=t.touches[0].clientY),{clientX:e,clientY:n}},Pf=(t,e)=>{const n=F(),o=y();if(!(!n||!o)){if(e.toast){Be(n,"width",e.width),o.style.width="100%";const s=pt();s&&o.insertBefore(s,ft())}else Be(o,"width",e.width);Be(o,"padding",e.padding),e.color&&(o.style.color=e.color),e.background&&(o.style.background=e.background),R(vn()),Mf(o,e),e.draggable&&!e.toast?(E(o,l.draggable),Df(o)):(ne(o,l.draggable),If(o))}},Mf=(t,e)=>{const n=e.showClass||{};t.className=`${l.popup} ${K(t)?n.popup:""}`,e.toast?(E([document.documentElement,document.body],l["toast-shown"]),E(t,l.toast)):E(t,l.modal),X(t,e,"popup"),typeof e.customClass=="string"&&E(t,e.customClass),e.icon&&E(t,l[`icon-${e.icon}`])},Bf=(t,e)=>{const n=Oo();if(!n)return;const{progressSteps:o,currentProgressStep:s}=e;if(!o||o.length===0||s===void 0){R(n);return}P(n),n.textContent="",s>=o.length&&W("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.forEach((i,r)=>{const a=Rf(i);if(n.appendChild(a),r===s&&E(a,l["active-progress-step"]),r!==o.length-1){const c=Vf(e);n.appendChild(c)}})},Rf=t=>{const e=document.createElement("li");return E(e,l["progress-step"]),Z(e,t),e},Vf=t=>{const e=document.createElement("li");return E(e,l["progress-step-line"]),t.progressStepsDistance&&Be(e,"width",t.progressStepsDistance),e},Hf=(t,e)=>{const n=Fi();n&&($o(n),Lt(n,!!(e.title||e.titleText),"block"),e.title&&No(e.title,n),e.titleText&&(n.innerText=e.titleText),X(n,e,"title"))},nr=(t,e)=>{var n;Pf(t,e),gf(t,e),Bf(t,e),Sf(t,e),Nf(t,e),Hf(t,e),mf(t,e),Of(t,e),ff(t,e),kf(t,e);const o=y();typeof e.didRender=="function"&&o&&e.didRender(o),(n=h.eventEmitter)===null||n===void 0||n.emit("didRender",o)},jf=()=>K(y()),or=()=>{var t;return(t=de())===null||t===void 0?void 0:t.click()},Wf=()=>{var t;return(t=ze())===null||t===void 0?void 0:t.click()},Ff=()=>{var t;return(t=ht())===null||t===void 0?void 0:t.click()},mt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),sr=t=>{if(t.keydownTarget&&t.keydownHandlerAdded&&t.keydownHandler){const e=t.keydown
|
||
|
|
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
||
|
|
https://sweetalert2.github.io/#ajax-request`),bp(t),typeof t.title=="string"&&(t.title=t.title.split(`
|
||
|
|
`).join("<br />")),cf(t)}let ae;var Yt=new WeakMap;class N{constructor(...e){if(Vd(this,Yt,Promise.resolve({isConfirmed:!1,isDenied:!1,isDismissed:!0})),typeof window>"u")return;ae=this;const n=Object.freeze(this.constructor.argsToParams(e));this.params=n,this.isAwaitingPromise=!1,Hd(Yt,this,this._main(ae.params))}_main(e,n={}){if(Cr(Object.assign({},n,e)),h.currentInstance){const i=rt.swalPromiseResolve.get(h.currentInstance),{isAwaitingPromise:r}=h.currentInstance;h.currentInstance._destroy(),r||i({isDismissed:!0}),xo()&&rr()}h.currentInstance=ae;const o=Ep(e,n);vp(o),Object.freeze(o),h.timeout&&(h.timeout.stop(),delete h.timeout),clearTimeout(h.restoreFocusTimeout);const s=yp(ae);return nr(ae,o),O.innerParams.set(ae,o),_p(ae,s,o)}then(e){return Ss(Yt,this).then(e)}finally(e){return Ss(Yt,this).finally(e)}}const _p=(t,e,n)=>new Promise((o,s)=>{const i=r=>{t.close({isDismissed:!0,dismiss:r,isConfirmed:!1,isDenied:!1})};rt.swalPromiseResolve.set(t,o),rt.swalPromiseReject.set(t,s),e.confirmButton.onclick=()=>{yh(t)},e.denyButton.onclick=()=>{Ah(t)},e.cancelButton.onclick=()=>{Th(t,i)},e.closeButton.onclick=()=>{i(mt.close)},Mh(n,e,i),zf(h,n,i),hh(t,n),hp(n),Ap(h,n,i),Tp(e,n),setTimeout(()=>{e.container.scrollTop=0})}),Ep=(t,e)=>{const n=sp(t),o=Object.assign({},Ee,e,n,t);return o.showClass=Object.assign({},Ee.showClass,o.showClass),o.hideClass=Object.assign({},Ee.hideClass,o.hideClass),o.animation===!1&&(o.showClass={backdrop:"swal2-noanimation"},o.hideClass={}),o},yp=t=>{const e={popup:y(),container:F(),actions:$t(),confirmButton:de(),denyButton:ze(),cancelButton:ht(),loader:pt(),closeButton:ko(),validationMessage:vn(),progressSteps:Oo()};return O.domCache.set(t,e),e},Ap=(t,e,n)=>{const o=_n();R(o),e.timer&&(t.timeout=new op(()=>{n("timer"),delete t.timeout},e.timer),e.timerProgressBar&&o&&(P(o),X(o,e,"timerProgressBar"),setTimeout(()=>{t.timeout&&t.timeout.running&&Lo(e.timer)})))},Tp=(t,e)=>{if(!e.toast){if(!bn(e.allowEnterKey)){Wi("allowEnterKey"),kp();return}Cp(t)||Op(t,e)||eo(-1,1)}},Cp=t=>{const e=Array.from(t.popup.querySelectorAll("[autofocus]"));for(const n of e)if(n instanceof HTMLElement&&K(n))return n.focus(),!0;return!1},Op=(t,e)=>e.focusDeny&&K(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&K(t.cancelButton)?(t.cancelButton.focus(),!0):e.focusConfirm&&K(t.confirmButton)?(t.confirmButton.focus(),!0):!1,kp=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};N.prototype.disableButtons=wr;N.prototype.enableButtons=gr;N.prototype.getInput=hr;N.prototype.disableInput=vr;N.prototype.enableInput=br;N.prototype.hideLoading=an;N.prototype.disableLoading=an;N.prototype.showValidationMessage=_r;N.prototype.resetValidationMessage=Er;N.prototype.close=_e;N.prototype.closePopup=_e;N.prototype.closeModal=_e;N.prototype.closeToast=_e;N.prototype.rejectPromise=cr;N.prototype.update=Or;N.prototype._destroy=kr;Object.assign(N,np);Object.keys(Ph).forEach(t=>{N[t]=function(...e){if(ae&&ae[t])return ae[t](...e)}});N.DismissReason=mt;N.version="11.26.17";const no=N;no.default=no;typeof document<"u"&&(function(t,e){var n=t.createElement("style");if(t.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=e);else try{n.innerHTML=e}catch{n.innerText=e}})(document,':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: tr
|