text: !function(t){function e(e){t.ac.config.enableResponseHandlers&&t.each(t.ac.config.responseHandlers,function(a,n){a in e&&(t.isPlainObject(e[a])||t.isArray(e[a])?t.each(e[a],n):n.call(e[a],e[a]))})}function a(a,n){var i=t.ajax(t.extend(!0,{},t.ac.config.ajaxDefaults,a)).done(e).done(t.ac.config.doneHandler).fail(t.ac.config.errorHandler).always(t.ac.config.alwaysHandler);return n&&i.done(function(t){n.resolve(this,t)}).fail(function(t,e,a){n.reject(this,t,e,a)}),i}function n(e,n,r){var o=function(e){return!1!==e&&null!==e&&(!(!t.ac.config.alertAllowEmpty&&""===e)&&("string"==typeof e&&(i(n,"data")[t.ac.config.alertInputDataKey]=e),void a(n,r)))};e=t.extend(!0,{},t.ac.config.alertDefaults,e),"function"==typeof t.ac.config.swal?t.ac.config.swal(e,o):"type"in e&&"input"===e.type?o(prompt(e.title+(e.text?"\n"+e.text:""),"inputValue"in e?e.inputValue:"")):"showCancelButton"in e&&e.showCancelButton?o(confirm(e.title+(e.text?"\n"+e.text:""))):(alert(e.title+(e.text?"\n"+e.text:"")),o())}function i(t,e,a){return void 0===a&&(a={}),e in t||(t[e]=a),t[e]}function r(e,a,n){t.isPlainObject(n)&&a in e&&t.isPlainObject(e[a])?t.extend(!0,e[a],n):t.isArray(n)&&a in e&&t.isArray(e[a])?e.push.apply(e[a],n):e[a]=n}function o(e,a){var n={};return t.each(t(e).data(),function(e,o){var l,c,s=e.match(a);if(s)if((s=s.filter(function(t){return t})).length>1){c=n;for(var f=1;f<s.length;f++)s[f]&&(l=s[f].charAt(0).toLowerCase()+s[f].slice(1),f<s.length-1?c=i(c,l):r(c,l,o))}else t.isPlainObject(o)&&t.extend(!0,n,o)}),n}function l(e,a){"FORM"===t(a).prop("tagName")&&(e.ajax.url=t(a).attr("action")||e.ajax.url,e.ajax.method=t(a).attr("method")||e.ajax.method,t.extend(!0,i(e.ajax,"data"),t.ac.config.serializeObject.call(t(a))))}function c(e,a){t.extend(!0,i(e,p),o(a,t.ac.config.alertAttrRegex)),t.extend(!0,i(e,u),o(a,t.ac.config.ajaxAttrRegex)),l(e,a)}function s(e){var i=t.extend(!0,{},e.data.opts),r=this;return"data"in i.ajax&&"function"==typeof i.ajax.data&&(i.ajax.data=i.ajax.data.call(this,e),!1===i.ajax.data)?(t.ac.config.stopPropagation&&e.stopPropagation(),t.ac.config.preventDefault&&e.preventDefault(),t.ac.config.eventReturn):(r!==e.delegateTarget&&c(i,e.delegateTarget),c(i,r),p in i&&i[p]?!0===i[p]?n({},i[u],e.data.deferred):t.isPlainObject(i[p])&&!t.isEmptyObject(i[p])?n(i[p],i[u],e.data.deferred):a(i[u],e.data.deferred):a(i[u],e.data.deferred),t.ac.config.stopPropagation&&e.stopPropagation(),t.ac.config.preventDefault&&e.preventDefault(),t.ac.config.eventReturn)}function f(e,a,n,i,r){var o={};return o[u]=n||{},o[p]=i||{},t(this).on(e+t.ac.config.eventSuffix,a,{opts:o,deferred:r},s).trigger(t.ac.config.initEvent+t.ac.config.eventSuffix),this}var u="ajax",p="alert";t.fn.ac=function(){for(var e=[],a=0,n=0;a<4;n++)1!==n||!t.isPlainObject(arguments[n])&&null!==arguments[n]||(e.push(null),a++),e.push(arguments[n]),a++;var i=new d;e.push(i);var r=this.each(function(){f.apply(this,e)});return t.ac.config.returnDeferred?i:r},t.ac=a,t.ac.config={doneHandler:null,errorHandler:null,alwaysHandler:null,responseHandlers:{html:function(e,a){t(e).html(a)},remove:function(e,a){t(a).remove()},hide:function(e,a){t(a).hide()},show:function(e,a){t(a).show()},hideModal:function(e,a){t(a).modal("hide")},showModal:function(e,a){t(a).modal("show")},append:function(e,a){t(e).append(a)},prepend:function(e,a){t(e).prepend(a)},val:function(e,a){t(e).val(a).trigger("chosen:updated")}},enableResponseHandlers:!0,returnDeferred:!0,ajaxAttrRegex:/acAjax(Accepts|Contents|Context|Converters|Data|Headers|StatusCode|XhrFields)?([a-z]*)/i,alertAttrRegex:/acAlert([a-z]*)/i,initEvent:"ac.init",eventSuffix:".ac",preventDefault:!0,stopPropagation:!1,eventReturn:!0,alertInputDataKey:"input",alertAllowEmpty:!0,ajaxDefaults:{dataType:"json"},alertDefaults:{title:"Are you sure?",type:"warning",showCancelButton:!0},swal:"function"==typeof swal?swal:null,serializeObject:function(){var e={};return t.each(this.serializeArray(),function(t,a){var n=e[a.name];e[a.name]=void 0!==n&&null!==n?n+","+a.value:a.value}),e}};var d=function(){this._doneCallbacks=[],this._failCallbacks=[],this._alwaysCallbacks=[]};d.prototype._settle=function(t,e){for(var a=t?this._doneCallbacks:this._failCallbacks,n=Array.prototype.splice.call(e,1),i=0;i<a.length;i++)a[i].apply(e[0],n);for(var r=0;r<this._alwaysCallbacks.length;r++)this._alwaysCallbacks[r].apply(e[0],n);return a.length+this._alwaysCallbacks.length},d.prototype.resolve=function(){return this._settle(!0,arguments),this},d.prototype.reject=function(){return this._settle(!1,arguments),this},d.prototype.done=function(t){return this._doneCallbacks.push(t),this},d.prototype.fail=function(t){return this._failCallbacks.push(t),this},d.prototype.always=function(t){return this._alwaysCallbacks.push(t),this},d.prototype.then=d.prototype.always,d.prototype.catch=d.prototype.fail}(jQuery);