text: (window.webpackJsonp=window.webpackJsonp||[]).push([[9],{1:function(e,t,s){"use strict";var r={data:function(){return{pMessages:this.messages}},props:{type:{default:"danger"},messages:{default:function(){return[]}}},computed:{alertClass:function(){return{"alert-success":"success"===this.type,"alert-danger":"danger"===this.type,"alert-warning":"warning"===this.type,"alert-info":"info"===this.type}},title:function(){return"danger"===this.type?"Oops!":"success"===this.type?"Great!":"warning"===this.type?"Snap!":"info"===this.type?"":void 0}},watch:{messages:function(e){this.pMessages=e}}},a=s(0),n=Object(a.a)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.pMessages.length?s("div",{staticClass:"alert",class:e.alertClass},[s("strong",{domProps:{textContent:e._s(e.title)}}),e._v(" "),e.pMessages.length>1?s("ul",e._l(e.pMessages,(function(t){return s("li",{domProps:{innerHTML:e._s(t)}})})),0):e._l(e.pMessages,(function(t){return s("p",{staticStyle:{"font-size":"inherit"},domProps:{innerHTML:e._s(t)}})}))],2):e._e()}),[],!1,null,"494a34d0",null).exports,i={props:{permissions:{required:!0,type:Array}},methods:{can:function(e){return this.permissions.indexOf(e)>=0},canAny:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.some((function(t){return e.permissions.includes(t)}))},cannot:function(e){return 0===this.permissions.indexOf(e)},cannotAll:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.permissions.includes(e)}}},o={extends:Object(a.a)(i,void 0,void 0,!1,null,"31519c40",null).exports,data:function(){return{isLoading:!0,isSaving:!1,isUpdating:!1,serverMessageType:"danger",serverMessages:[]}},methods:{resetMessages:function(){this.serverMessages=[]},processErrors:function(e){for(var t in this.resetMessages(),this.serverMessageType="danger",e)this.serverMessages.push(e[t][0]);this.$swal({text:this.serverMessages.join("\r\n"),toast:!0,position:"top-end",icon:"error",timer:5e3,timerProgressBar:!0,showConfirmButton:!1})},showSuccess:function(e){this.resetMessages(),this.serverMessageType="success",this.serverMessages.push(e),this.$swal({text:e,toast:!0,position:"top-end",icon:"success",timer:5e3,timerProgressBar:!0,showConfirmButton:!1})},handleError:function(e){422!==e.response.status?void 0!==e.response.data.message&&(this.resetMessages(),this.serverMessageType="danger",this.serverMessages.push(e.response.data.message),this.$swal({text:e.response.data.message,toast:!0,position:"top-end",icon:"error",showConfirmButton:!1})):this.processErrors(e.response.data.errors)}},computed:{},components:{Alert:n}},c=Object(a.a)(o,(function(){var e=this.$createElement;return(this._self._c||e)("div")}),[],!1,null,"1dafff83",null);t.a=c.exports},128:function(e,t,s){"use strict";s.r(t);var r=s(7),a={extends:s(8).a,data:function(){return{isLoading:!0,headers:[{label:"#",field:"id",width:"40px"},{label:"Category",field:"name",width:"220px"},{label:"Description",field:"description",sortable:!1},{label:"Enabled",field:"is_enabled",width:"70px"},{label:"",field:"",width:"100px",sortable:!1}],dataRows:[],pagination:{current_page:1},queryParams:{perPage:15}}},props:{},methods:{search:function(){this.queryParams=Object.assign(this.queryParams,{sort:null,sort_direction:null,page:null}),this.getData()},switchPage:function(e){this.queryParams=Object.assign(this.queryParams,{page:e}),this.getData()},sort:function(e){this.queryParams=Object.assign(this.queryParams,{sort:e.field,sort_direction:e.order,page:1}),this.getData()},getData:function(){var e=this;this.isLoading=!0,axios.get("/api/admin/v1/categories",{params:Object.assign({},this.queryParams)}).then((function(t){e.dataRows=t.data.data,e.pagination=t.data.meta.pagination})).finally((function(){e.isLoading=!1}))},askDeletion:function(e){var t=this;this.askConfirmation("Remove the selected category <strong>".concat(e.name,"</strong>."),(function(t){return axios.delete("/api/admin/v1/categories/".concat(e.id))}),(function(s){s.isConfirmed&&!0===s.value.data.is_success&&(t.showSuccess(s.value.data.message),t.dataRows=t.dataRows.filter((function(t){return t.id!==e.id})))}))},canPerformActions:function(){return this.canAny(["categories.update","categories.delete"])}},computed:{},components:{TableHeader:r.a},watch:{},created:function(){this.getData()},mounted:function(){},beforeDestroy:function(){}},n=(s(83),s(0)),i=Object(n.a)(a,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("page-header",{attrs:{title:"Project Categories",subtitle:""}}),e._v(" "),s("router-link",{staticClass:"btn btn-primary mb-3",attrs:{to:{name:"project-categories.create",params:{}}}},[s("i",{staticClass:"ik ik-plus"}),e._v(" New Category\n    ")]),e._v(" "),s("div",{staticClass:"card table-card"},[s("div",{staticClass:"card-body"},[s("div",{staticClass:"dataTables_wrapper dt-bootstrap4 no-footer"},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-sm-12 col-md-6"},[s("div",{staticClass:"dataTables_length"},[s("label",[e._v("Show "),s("select",{directives:[{name:"model",rawName:"v-model",value:e.queryParams.perPage,expression:"queryParams.perPage"}],staticClass:"custom-select custom-select-sm form-control form-control-sm",staticStyle:{"min-width":"60px"},attrs:{name:"advanced_table_length","aria-controls":"advanced_table"},on:{change:[function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.queryParams,"perPage",t.target.multiple?s:s[0])},function(t){return e.getData()}]}},[s("option",{attrs:{value:"10"}},[e._v("10")]),e._v(" "),s("option",{attrs:{value:"15"}},[e._v("15")]),e._v(" "),s("option",{attrs:{value:"25"}},[e._v("25")]),e._v(" "),s("option",{attrs:{value:"50"}},[e._v("50")])]),e._v(" entries")])])]),e._v(" "),s("div",{staticClass:"col-sm-12 col-md-6"},[s("div",{staticClass:"dataTables_filter",attrs:{id:"advanced_table_filter"}},[s("label",[e._v("Search:"),s("input",{directives:[{name:"model",rawName:"v-model",value:e.queryParams.search,expression:"queryParams.search"}],staticClass:"form-control form-control-sm",attrs:{type:"search","aria-controls":"advanced_table"},domProps:{value:e.queryParams.search},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search(t)},input:function(t){t.target.composing||e.$set(e.queryParams,"search",t.target.value)}}})])])])])])]),e._v(" "),s("div",{staticClass:"card-block"},[s("div",{staticClass:"table-responsive"},[s("table",{staticClass:"table table-hover mb-0 dataTable "},[s("table-header",{attrs:{headers:e.headers,"enabled-checkall-slot":!1},on:{"sort-changed":e.sort}},[s("div",{staticClass:"custom-control custom-checkbox",attrs:{slot:"checkall"},slot:"checkall"},[s("input",{staticClass:"custom-control-input",attrs:{type:"checkbox",id:"customCheck1",checked:""}}),e._v(" "),s("label",{staticClass:"custom-control-label checkbox-2x",attrs:{for:"customCheck1"}},[e._v(" ")])])]),e._v(" "),s("tbody",[e._l(e.dataRows,(function(t){return s("tr",[s("td",{domProps:{textContent:e._s(t.id)}}),e._v(" "),s("td",{domProps:{textContent:e._s(t.name)}}),e._v(" "),s("td",{domProps:{textContent:e._s(t.description||"-")}}),e._v(" "),s("td",[s("toggle-button",{attrs:{sync:!0,color:{checked:"#26C281"},width:55,labels:{checked:"Yes",unchecked:"No"},height:25},model:{value:t.is_enabled,callback:function(s){e.$set(t,"is_enabled",s)},expression:"row.is_enabled"}})],1),e._v(" "),e.canPerformActions()?s("td",{staticClass:"text-right"},[e.can("categories.update")?s("router-link",{attrs:{to:{name:"project-categories.edit",params:{id:t.id}}}},[s("i",{staticClass:"ik ik-edit f-16 mr-15 text-green"})]):e._e(),e._v(" "),e.can("categories.delete")?s("a",{attrs:{href:"#!"},on:{click:function(s){return s.preventDefault(),e.askDeletion(t)}}},[s("i",{staticClass:"ik ik-trash-2 f-16 text-red"})]):e._e()],1):e._e()])})),e._v(" "),0!==e.dataRows.length||e.isLoading?e._e():s("tr",[s("td",{staticClass:"text-center",attrs:{colspan:e.headers.length}},[e._v("No Records Found.")])])],2)],1)]),e._v(" "),s("div",{staticClass:"float-right mt-30"},[(e.pagination.total_pages||1)>1?s("pagination",{attrs:{"page-count":e.pagination.total_pages||1,"margin-pages":2,"click-handler":e.switchPage,"prev-text":"&laquo;","next-text":"&raquo;","container-class":"pagination","page-class":"page-item","page-link-class":"page-link","prev-link-class":"page-link","prev-class":"page-item","next-class":"page-item","next-link-class":"page-link"},model:{value:e.pagination.current_page,callback:function(t){e.$set(e.pagination,"current_page",t)},expression:"pagination.current_page"}}):e._e()],1)])])],1)}),[],!1,null,"56bdc2f4",null);t.default=i.exports},27:function(e,t,s){var r=s(84);"string"==typeof r&&(r=[[e.i,r,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};s(3)(r,a);r.locals&&(e.exports=r.locals)},7:function(e,t,s){"use strict";var r={data:function(){return{pCurrentOrder:this.currentOrder,pCurrentField:this.currentField,pWidth:this.width}},props:{label:{required:!0,type:String},field:{required:!0,type:String},width:{required:!1,type:String},currentOrder:{required:!0,type:String},currentField:{required:!0}},methods:{changeOrder:function(){this.$emit("sort-changed",{field:this.field,label:this.label,order:this.getSortOrder()})},getSortOrder:function(){return this.currentField===this.field&&"asc"===this.pCurrentOrder?"desc":"asc"}},computed:{},components:{},watch:{currentOrder:function(e){this.pCurrentOrder=e},currentField:function(e){this.pCurrentField=e},width:function(e){this.pWidth=e}},created:function(){},mounted:function(){},beforeDestroy:function(){}},a=s(0),n=Object(a.a)(r,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("a",{staticStyle:{color:"inherit",display:"inline-block",width:"100%"},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.changeOrder(t)}}},[e._v("\n        "+e._s(e.label)+"\n")])}),[],!1,null,"06ff1f34",null).exports,i={data:function(){return{pHeaders:this.headers,pSortField:this.sortField,pSortOrder:this.sortOrder}},props:{headers:{required:!1,type:Array,default:function(){return[{label:"Label",field:"field",sortable:!1}]}},rows:{required:!1,type:Array,default:function(){return[]}},sortField:{default:null},sortOrder:{default:"asc"},enabledCheckallSlot:{default:!1},checkallSlotWidth:{}},methods:{sortChanged:function(e){this.pSortField=e.field,this.pSortOrder=e.order,this.$emit("sort-changed",e)},thStyles:function(e){return{width:e}}},computed:{checkAllSlotStyle:function(){return{width:this.checkallSlotWidth||"20px"}}},watch:{headers:function(e){console.dir(e),this.pHeaders=e},sortOrder:function(e){this.pSortOrder=e},sortField:function(e){this.pSortField=e}},components:{SortableHeaderLink:n},created:function(){},mounted:function(){},beforeDestroy:function(){}},o=Object(a.a)(i,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("thead",[s("tr",[e.enabledCheckallSlot?s("th",{style:e.checkAllSlotStyle},[e._t("checkall")],2):e._e(),e._v(" "),e._l(e.pHeaders,(function(t,r){return!1!==t.show?s("th",{key:r,class:{sorting:!1!==t.sortable,sorting_desc:e.pSortField===t.field&&"desc"===e.pSortOrder,sorting_asc:e.pSortField===t.field&&"asc"===e.pSortOrder},style:e.thStyles(t.width)},[!1!==t.sortable?s("sortable-header-link",{attrs:{label:t.label,field:t.field,"current-order":e.pSortOrder,"current-field":e.pSortField},on:{"sort-changed":e.sortChanged}}):[e._v("\n            "+e._s(t.label)+"\n        ")]],2):e._e()}))],2)])}),[],!1,null,"d9bcc9d6",null);t.a=o.exports},8:function(e,t,s){"use strict";var r={extends:s(1).a,data:function(){return{}},methods:{askConfirmation:function(e,t,s){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this.$swal(Object.assign({title:"Are you sure?",html:e,icon:"info",reverseButtons:!0,confirmButtonColor:"#f54165",showLoaderOnConfirm:!0,allowOutsideClick:function(){return!r.$swal.isLoading()},confirmButtonText:"OK",cancelButtonText:"Cancel",showCancelButton:!0,preConfirm:t},a)).then(s)}},watch:{}},a=s(0),n=Object(a.a)(r,void 0,void 0,!1,null,"44c5ba87",null);t.a=n.exports},83:function(e,t,s){"use strict";var r=s(27);s.n(r).a},84:function(e,t,s){(e.exports=s(2)(!1)).push([e.i,"td .vue-js-switch[data-v-56bdc2f4] {\n  margin-bottom: 0;\n}",""])}}]);