1import{_ as A,n as c,p as B,o as i,y as l,w as d,q as g,s as t,x as m,v as p,a1 as P,c as r,C as _,a3 as M,A as I,z as V,B as u,F as k}from"./app4991810000.js";const N={data(){return{breadcrumb:{pages:[{name:"Support",href:"/admin/troubleshoot",current:!1},{name:"Open Issues",href:"/",current:!0}],icon:"las la-ticket-alt"},thead:[{title:"ID"},{title:"Title",classes:["max-w-[10rem] w-10"]},{title:"Department"},{title:"Priority"},{title:"Last Response"},{title:"Created At"},{title:"Actions",classes:"text-center"}],showConfirmLoader:!1,showConfirmation:!1,ticketData:null,status:"",filter:"all",pagination:null,refreshing:!1,tickets:[],search:""}},computed:{filteredTickets(){return this.filter==="new"?this.tickets.filter(a=>a.is_new):this.filter==="latest"?this.tickets.filter(a=>a.latest_customer_reply):this.tickets}},mounted(){this.hasAdminPermission("troubleshoot","open-issues")&&this.refresh(),this.debouncedTicket=this.$debounce(this.refresh,500)},methods:{clearSearch(){this.search="",this.refresh()},openConfirmationModal(a,e){this.ticketData=a,this.status=e,this.showConfirmation=!this.showConfirmation},closeConfirmationModal(){this.showConfirmLoader=!1,this.showConfirmation=!1,this.ticketData=null,this.status=""},async refresh(a=""){this.refreshing=!0;let e=`admin/tickets/open/status?search=${this.search}`;a!==""&&(e=`${e}&page=${a}`),await this.$axios.get(e).then(({data:h})=>{this.tickets=h.tickets.data,this.pagination=h.tickets}).catch(({response:{data:h}})=>{this.$toast.error(h.message)}).finally(()=>{this.refreshing=!1})},async toggleTicket(){this.showConfirmLoader=!0,await this.$axios.get(`/admin/tickets/${this.ticketData.id}/${this.status}/toggle`).then(({data:a})=>{this.$toast.success(a.message)}).catch(({response:{data:a}})=>{this.$toast.error(a.message)}).finally(()=>{this.refresh(),this.showConfirmation=!1,this.showConfirmLoader=!1})}}},j={class:"container-fluid mx-auto"},F={class:"grid xl:grid-cols-2 grid-cols-1 gap-4 items-center mt-5"},z={class:"sm:flex flex-wrap sm:flex-nowrap gap-5"},O={class:"sm:flex flex-1 gap-4"},R={class:"relative block flex-1"},U={class:"material-symbols-outlined text-xl font-medium bg-white"},q={key:0,class:"text-end mt-4 sm:mt-0"},E={class:"whitespace-nowrap py-4 px-4 text-sm"},H={class:"whitespace-nowrap py-4 px-4 text-sm truncate max-w-[10rem] w-10"},W={class:"flex"},Y={class:"truncate"},G={class:"whitespace-nowrap py-4 px-4 text-sm"},J={class:"whitespace-nowrap py-4 px-4 text-sm"},K={class:"whitespace-nowrap py-4 px-4 text-sm"},Q={class:"whitespace-nowrap py-4 px-4 text-sm"},X={class:"whitespace-nowrap py-4 px-4 text-sm flex gap-6 justify-center"},Z=["onClick"],$=["onClick"],ee={colspan:"7",class:"text-center text-sm whitespace-nowrap py-4 px-4 sm:pl-6"},te={class:"flex justify-end mt-4"},se={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},oe={key:0},ie={key:1};function ae(a,e,h,ne,o,n){const b=c("Breadcrumb"),x=c("router-link"),f=c("Badge"),w=c("Table"),C=c("TableSkeleton"),v=c("TailwindPagination"),T=c("Confirmation"),D=c("SuperAdminLayout"),y=B("tooltip");return i(),l(D,null,{breadcrumb:d(()=>[g(b,{breadcrumb:o.breadcrumb},null,8,["breadcrumb"])]),default:d(()=>[t("div",j,[t("div",F,[a.hasAdminPermission("troubleshoot","troubleshoot")?(i(),l(x,{key:0,to:{name:"adminSupportIndex"}},{default:d(()=>[...e[6]||(e[6]=[t("i",{class:"las la-arrow-alt-circle-left text-lg text-sa-500 mr-2"},null,-1),t("span",{class:"text-sa-500 text-tiny"},"Back",-1)])]),_:1})):m("",!0),t("div",z,[t("div",O,[t("label",R,[e[8]||(e[8]=t("span",{class:"absolute inset-y-0 left-0 flex items-center pl-3"},[t("i",{class:"las la-search text-xl -rotate-90"})],-1)),p(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>o.search=s),onInput:e[1]||(e[1]=s=>a.debouncedTicket()),class:"w-full placeholder:font-italitc text-sm focus:ring-0 rounded-md py-2 pl-10 pr-8 focus:outline-none",placeholder:"Search",type:"text"},null,544),[[P,o.search]]),o.search.length?(i(),r("button",{key:0,onClick:e[2]||(e[2]=(...s)=>n.clearSearch&&n.clearSearch(...s)),class:"absolute inset-y-0 right-0 px-2 flex items-center justify-center text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-400"},[p((i(),r("span",U,[...e[7]||(e[7]=[_("close",-1)])])),[[y,"Clear"]])])):m("",!0)]),p(t("select",{"onUpdate:modelValue":e[3]||(e[3]=s=>o.filter=s),onChange:e[4]||(e[4]=s=>n.refresh()),class:"form-select flex-1 mt-4 sm:mt-0 w-full placeholder:font-italitc text-sm focus:ring-0 focus:border-sa-500 rounded-md py-2 pl-5 pr-4 focus:outline-none"},[...e[9]||(e[9]=[t("option",{value:"all"},"All Issues",-1),t("option",{value:"new"},"New Issues",-1),t("option",{value:"latest"},"Latest Customer Reply Issues",-1)])],544),[[M,o.filter]])]),a.hasAdminPermission("troubleshoot","open-issues")?(i(),r("div",q,[t("button",{type:"button",onClick:e[5]||(e[5]=s=>n.refresh(o.pagination.current_page)),class:"rounded inline-block px-3 py-2 bg-white shadow text-[#8C8C8C] disabled:opacity-60 disabled:cursor-not-allowed"},[t("i",{class:I(["fas fa-sync-alt",{"fa-spin":o.refreshing}])},null,2)])])):m("",!0)])]),n.filteredTickets.length>0?(i(),l(w,{key:0,head:o.thead},{default:d(()=>[(i(!0),r(k,null,V(n.filteredTickets,(s,L)=>(i(),r("tr",{class:"even:bg-gray-50",key:L},[t("td",E," #"+u(s.ticket_no),1),t("td",H,[t("div",W,[p((i(),r("span",Y,[_(u(s.title),1)])),[[y,s.title]])])]),t("td",G,u(s.department),1),t("td",J,[s.priority==3?(i(),l(f,{key:0,badgeTitle:"High",variant:"danger"})):s.priority==2?(i(),l(f,{key:1,badgeTitle:"Medium",variant:"warning"})):(i(),l(f,{key:2,badgeTitle:"Low",variant:"primary"}))]),t("td",K,u(s.last_response.trim()),1),t("td",Q,u(s.created_by_humans),1),t("td",X,[g(x,{to:{name:"adminViewTicket",params:{id:s.id}}},{default:d(()=>[...e[10]||(e[10]=[t("i",{class:"las la-eye text-xl text-sa-500"},null,-1)])]),_:1},8,["to"]),t("button",{onClick:S=>n.openConfirmationModal(s,"closed")},[...e[11]||(e[11]=[t("i",{class:"las la-window-close text-lg text-red-600"},null,-1)])],8,Z),t("button",{onClick:S=>n.openConfirmationModal(s,"working")},[...e[12]||(e[12]=[t("i",{class:"las la-thumbs-up text-lg text-green-600"},null,-1)])],8,$)])]))),128))]),_:1},8,["head"])):(i(),r(k,{key:1},[o.refreshing?(i(),l(C,{key:0,heads:7})):(i(),l(w,{key:1,head:o.thead},{default:d(()=>[t("tr",null,[t("td",ee,u(o.refreshing?"Please Wait":"No Data Found"),1)])]),_:1},8,["head"]))],64)),t("div",te,[n.filteredTickets.length>0?(i(),l(v,{key:0,class:"flex-wrap","active-classes":["bg-sa-100 text-sa-500"],"item-classes":[" bg-white text-gray-500 border-gray-300 dark:bg-gray-800 dark:border-gray-500 dark:text-white"],limit:1,data:o.pagination,onPaginationChangePage:n.refresh},null,8,["data","onPaginationChangePage"])):m("",!0)])]),g(T,{confirmationTitle:"Issue",submitBtnTitle:"Yes, I'm sure",showLoader:o.showConfirmLoader,show:o.showConfirmation,onConfirm:n.toggleTicket,onCloseModal:n.closeConfirmationModal},{icon:d(()=>[...e[13]||(e[13]=[t("i",{class:"fas fa-warning h-6 w-6 text-xl text-red-600 text-center flex items-center justify-center","aria-hidden":"true"},null,-1)])]),content:d(()=>[o.ticketData?(i(),r("p",se,[o.status=="closed"?(i(),r("span",oe," Are you sure to close this issue("+u(o.ticketData.ticket_no)+")? ",1)):(i(),r("span",ie," Are you sure to move this issue("+u(o.ticketData.ticket_no)+") to working issues? ",1))])):m("",!0)]),_:1},8,["showLoader","show","onConfirm","onCloseModal"])]),_:1})}const le=A(N,[["render",ae]]);export{le as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.