"use strict";
(function (factory) {
if (typeof module === "object" && module.exports) {
module.exports = factory;
return;
}
if (typeof window.jQuery !== "undefined") {
factory(window.jQuery);
}
})(function ($) {
if (!$ || !$.fn) {
return;
}
const DEFAULTS = {
type: "info",
dismissible: true,
timeout: 0,
classPrefix: "jq-alert",
};
function removeAlert($el) {
$el.removeClass("is-visible");
window.setTimeout(function () {
$el.remove();
}, 180);
}
$.fn.orderProAlert = function (options) {
const settings = $.extend({}, DEFAULTS, options);
return this.each(function () {
const $host = $(this);
const $alert = $("
", {
class: settings.classPrefix + " " + settings.classPrefix + "--" + settings.type + " is-visible",
role: "alert",
});
const $content = $("
", {
class: settings.classPrefix + "__content",
text: String(settings.message || ""),
});
$alert.append($content);
if (settings.dismissible) {
const $close = $("