!function(x,w,S){"use strict";w=void0!==w&&w.Math===Math?w:globalThis,x.fn.nag=function(g){varp,e=x(this),m=e.selector||"",f=Date.now(),h=[],v=g,b="string"==typeofv,y=[].slice.call(arguments,1);returne.each(function(){vart,i=x.isPlainObject(g)?x.extend(!0,{},x.fn.nag.settings,g):x.extend({},x.fn.nag.settings),e=i.selector,c=i.error,o=i.namespace,n="."+o,a=o+"-module",r=x(this),s=i.context?[w,S].indexOf(i.context)<0?x(S).find(i.context):x(i.context):x("body"),l=this,d=r.data(a),u={initialize:function(){u.verbose("Initializing element"),"string"!=typeofi.value&&(i.value=JSON.stringify(i.value)),t=u.get.storage(),r.on("click"+n,e.close,u.dismiss).data(a,u),i.detachable&&r.parent()[0]!==s[0]&&r.detach().prependTo(s),0<i.displayTime&&setTimeout(u.hide,i.displayTime),u.show()},destroy:function(){u.verbose("Destroying instance"),r.removeData(a).off(n)},show:function(){if(u.should.show()&&!r.is(":visible")){if(!1===i.onShow.call(l))returnu.debug("onShow callback returned false, cancelling nag animation"),!1;u.debug("Showing nag",i.animation.show),"fade"===i.animation.show?r.fadeIn(i.duration,i.easing,i.onVisible):r.slideDown(i.duration,i.easing,i.onVisible)}},hide:function(){if(!1===i.onHide.call(l))returnu.debug("onHide callback returned false, cancelling nag animation"),!1;u.debug("Hiding nag",i.animation.hide),"fade"===i.animation.hide?r.fadeOut(i.duration,i.easing,i.onHidden):r.slideUp(i.duration,i.easing,i.onHidden)},dismiss:function(e){!1!==u.hide()&&i.storageMethod&&(u.debug("Dismissing nag",i.storageMethod,i.key,i.value,i.expires),u.storage.set(i.key,i.value)),e.stopImmediatePropagation(),e.preventDefault()},should:{show:function(){returni.persist?(u.debug("Persistent nag is set, can show nag"),!0):u.storage.get(i.key)!=i.value.toString()?(u.debug("Stored value is not set, can show nag",u.storage.get(i.key)),!0):(u.debug("Stored value is set, cannot show nag",u.storage.get(i.key)),!1)}},get:{expirationDate:function(e){if((e="number"==typeofe?newDate(Date.now()+864e5*e):e)instanceofDate&&e.getTime())returne.toUTCString();u.error(c.expiresFormat)},storage:function(){return"localstorage"===i.storageMethod&&void0!==w.localStorage?(u.debug("Using local storage"),w.localStorage):"sessionstorage"===i.storageMethod&&void0!==w.sessionStorage?(u.debug("Using session storage"),w.sessionStorage):"cookie"inS?(u.debug("Using cookie"),{setItem:function(e,o,n){e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),o=encodeURIComponent(o).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[B-D])/g,decodeURIComponent);vart,i="";for(tinn)Object.prototype.hasOwnProperty.call(n,t)&&(i+="; "+t,"string"==typeofn[t]&&(i+="="+n[t].split(";")[0]));S.cookie=e+"="+o+i},getItem:function(e){for(varo=S.cookie.split("; "),n=0,t=o.length;n<t;n++){vari=o[n].split("=");if(e===i[0].replace(/(%[\da-f]{2})+/gi,decodeURIComponent))returni[1]||""}},removeItem:function(e,o){t.setItem(e,"",o)}}):voidu.error(c.noStorage)},storageOptions:function(){vare={};returni.expires&&(e.expires=u.get.expirationDate(i.expires)),i.domain&&(e.domain=i.domain),i.path&&(e.path=i.path),i.secure&&(e.secure=i.secure),i.samesite&&(e.samesite=i.samesite),e}},clear:function(){u.storage.remove(i.key)},storage:{set:function(e,o){varn=u.get.storageOptions();t===w.localStorage&&n.expires&&(u.debug("Storing expiration value in localStorage",e,n.expires),t.setItem(e+i.expirationKey,n.expires)),u.debug("Value stored",e,o);try{t.setItem(e,o,n)}catch(e){u.error(c.setItem,e)}},get:function(e){varo,n=t.getItem(e);returnt===w.localStorage&&null!=(o=t.getItem(e+i.expirationKey))&&newDate(o)<newDate&&(u.debug("Value in localStorage has expired. Deleting key",e),u.storage.remove(e),n=null),n="undefined"!==n&&"null"!==n&&null!=n?n:void0},remove:function(e){varo=u.get.storageOptions();o.expires=u.get.expirationDate(-1),t===w.localStorage&&t.removeItem(e+i.expirationKey),t.removeItem(e,o)}},setting:function(e,o){if(u.debug("Changing setting",e,o),x.isPlainObject(e))x.extend(!0,i,e);else{if(void0===o)returni[e];x.isPlainObject(i[e])?x