let defaultButtonClasses={confirmButton:"btn btn-primary mt-2",cancelButton:"btn btn-danger mt-2"},successToastConfig={icon:"success",text:"Saved successfully!",showConfirmButton:!1,timer:1500,buttonsStyling:!1,customClass:{confirmButton:defaultButtonClasses.confirmButton}},showAlert=t=>{Swal.fire({buttonsStyling:!1,customClass:{confirmButton:defaultButtonClasses.confirmButton},...t})},bindAlert=(t,e)=>{t=document.getElementById(t);t&&t.addEventListener("click",()=>showAlert(e))},bindPositionalAlert=(t,e)=>{t=document.getElementById(t);t&&t.addEventListener("click",()=>{Swal.fire({position:e,...successToastConfig})})},confirmBtn=(bindAlert("sweetalert-basic",{title:"Simple Alert",text:"This is a basic SweetAlert dialog."}),bindAlert("sweetalert-title",{title:"Notice",text:"This is a titled alert with additional details.",icon:"question",showCloseButton:!0}),bindAlert("sweetalert-longcontent",{imageUrl:"https://placehold.co/300x1000/1ab394/white",imageHeight:1e3,imageAlt:"Very tall content image",showCloseButton:!0,customClass:{confirmButton:"btn btn-secondary mt-2"}}),document.getElementById("sweetalert-confirm-button")),paramsBtn=(confirmBtn&&confirmBtn.addEventListener("click",()=>{Swal.fire({title:"Confirm Deletion",text:"Are you sure you want to delete this item?",icon:"warning",showCancelButton:!0,confirmButtonText:"Yes, delete it!",showCloseButton:!0,buttonsStyling:!1,customClass:{confirmButton:"btn btn-primary me-2 mt-2",cancelButton:"btn btn-danger mt-2"}}).then(t=>{t.isConfirmed&&showAlert({title:"Deleted!",text:"Your item has been successfully removed.",icon:"success"})})}),document.getElementById("sweetalert-params")),closeButton=(paramsBtn&¶msBtn.addEventListener("click",()=>{Swal.fire({title:"Delete File?",text:"This action cannot be undone!",icon:"warning",showCancelButton:!0,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCloseButton:!0,buttonsStyling:!1,customClass:{confirmButton:defaultButtonClasses.confirmButton+" me-2",cancelButton:defaultButtonClasses.cancelButton}}).then(t=>{t.isConfirmed?showAlert({title:"Deleted!",text:"The file has been deleted.",icon:"success"}):t.dismiss===Swal.DismissReason.cancel&&showAlert({title:"Action Cancelled",text:"Your file is safe.",icon:"error"})})}),bindAlert("sweetalert-image",{title:"Custom Branding",text:"This alert includes a logo.",imageUrl:"assets/images/logo-sm.png",imageHeight:40,showCloseButton:!0}),document.getElementById("sweetalert-close")),ajaxBtn=(closeButton&&closeButton.addEventListener("click",()=>{let t;Swal.fire({title:"Auto Dismiss",html:"Closing in seconds...",timer:2e3,timerProgressBar:!0,showCloseButton:!0,didOpen:()=>{Swal.showLoading(),t=setInterval(()=>{var t=Swal.getHtmlContainer()?.querySelector("b");t&&(t.textContent=Math.ceil(Swal.getTimerLeft()/1e3))},100)},willClose:()=>clearInterval(t)}).then(t=>{t.dismiss===Swal.DismissReason.timer&&console.log("Alert closed by timer")})}),bindPositionalAlert("position-top-start","top-start"),bindPositionalAlert("position-top-end","top-end"),bindPositionalAlert("position-bottom-start","bottom-start"),bindPositionalAlert("position-bottom-end","bottom-end"),bindAlert("sweetalert-info",{text:"This is an informational message to keep you updated.",icon:"info",confirmButtonText:"Understood",customClass:{confirmButton:"btn btn-info"}}),bindAlert("sweetalert-warning",{text:"Heads up! Something might require your attention.",icon:"warning",confirmButtonText:"Got it",customClass:{confirmButton:"btn btn-warning"}}),bindAlert("sweetalert-error",{text:"An unexpected error occurred. Please try again.",icon:"error",confirmButtonText:"Dismiss",customClass:{confirmButton:"btn btn-danger"}}),bindAlert("sweetalert-success",{text:"Action completed successfully!",icon:"success",confirmButtonText:"Great!",customClass:{confirmButton:"btn btn-success"}}),bindAlert("sweetalert-question",{text:"Do you need more information about this feature?",icon:"question",confirmButtonText:"Yes, please"}),bindAlert("custom-html-alert",{title:"HTML Alert",html:'Use bold, links, and other HTML here.',icon:"info",showCloseButton:!0,showCancelButton:!0,confirmButtonText:' Like it!',cancelButtonText:'',customClass:{confirmButton:"btn btn-success me-2",cancelButton:"btn btn-danger"}}),bindAlert("custom-padding-width-alert",{title:"Custom Design",html:'
This alert has custom size, padding, and background.
',width:600,padding:"100px",color:"#fff",background:"var(--ins-secondary-bg) url(assets/images/landing-cta.jpg) no-repeat center",customClass:{confirmButton:"btn btn-primary"}}),document.getElementById("ajax-alert"));ajaxBtn&&ajaxBtn.addEventListener("click",()=>{Swal.fire({title:"