!function(t){var e={};function a(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(n,r,function(e){return t[e]}.bind(null,r));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="/",a(a.s=8)}({8:function(t,e,a){t.exports=a("LIGU")},LIGU:function(t,e){$("#tags_table").DataTable({processing:!0,serverSide:!0,order:[[0,"asc"]],ajax:{url:tagUrl},columnDefs:[{targets:[1],orderable:!1,className:"text-center",width:"5%"}],columns:[{data:"name",name:"name"},{data:function(t){return'<a title="Edit" class="btn action-btn btn-primary btn-sm edit-btn mr-1" data-id="'+t.id+'"><i class="cui-pencil action-icon"></i></a><a title="Delete" class="btn action-btn btn-danger btn-sm delete-btn" data-id="'+t.id+'"><i class="cui-trash action-icon"></i></a>'},name:"id"}]}),$("#addNewForm").submit((function(t){t.preventDefault();var e=jQuery(this).find("#btnSave");e.button("loading"),$.ajax({url:tagCreateUrl,type:"POST",data:$(this).serialize(),success:function(t){t.success&&(displaySuccessMessage(t.message),$("#AddModal").modal("hide"),$("#tags_table").DataTable().ajax.reload(null,!1))},error:function(t){printErrorMessage("#validationErrorsBox",t)},complete:function(){e.button("reset")}})})),$("#editForm").submit((function(t){t.preventDefault();var e=jQuery(this).find("#btnEditSave");e.button("loading");var a=$("#tagId").val();$.ajax({url:tagUrl+a,type:"put",data:$(this).serialize(),success:function(t){t.success&&(displaySuccessMessage(t.message),$("#EditModal").modal("hide"),$("#tags_table").DataTable().ajax.reload(null,!1))},error:function(t){manageAjaxErrors(t)},complete:function(){e.button("reset")}})})),$("#AddModal").on("hidden.bs.modal",(function(){$("#tagHeader").html("New Tag"),resetModalForm("#addNewForm","#validationErrorsBox")})),$("#EditModal").on("hidden.bs.modal",(function(){resetModalForm("#editForm","#editValidationErrorsBox")})),window.renderData=function(t){$.ajax({url:tagUrl+t+"/edit",type:"GET",success:function(t){t.success&&($("#tagId").val(t.data.id),$("#tagName").val(t.data.name),$("#EditModal").modal("show"))},error:function(t){manageAjaxErrors(t)}})},window.setBulkTags=function(){$("#isBulkTags").val(!0),$("#tagHeader").html("Add Bulk Tags")},$(document).on("click",".edit-btn",(function(t){var e=$(t.currentTarget).data("id");renderData(e)})),$(document).on("click",".delete-btn",(function(t){var e=$(t.currentTarget).data("id");deleteItem(tagUrl+e,"#tags_table","Tag")}))}});