1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9502],{9483:function(e,t,r){"use strict";r.r(t);var s=r(9499),i=r(6835),n=r(2407),a=r(8654),o=r(7294),c=r(2939),l=r.n(c),d=r(3918),u=r(5948),h=r(2664),p=r(5233),_=r(6534),x=r(9810),m=r(8050),f=r(8966),j=r.n(f),g=r(5128),y=r(7725),b=r(5893);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.default=function(){var e=(0,o.useState)([]),t=e[0],r=e[1],s=(0,h.v9)((function(e){return e.userData})),c=(0,o.useState)(!1),f=c[0],v=c[1],w=(0,o.useState)(),N=w[0],P=w[1],C=(0,o.useState)(""),O=C[0],S=C[1],D=(0,o.useState)(""),E=D[0],M=D[1],T=(0,o.useState)(!1),Z=T[0],L=T[1],B=(0,o.useState)(!1),F=B[0],W=B[1],A=(0,o.useState)(!1),H=A[0],R=A[1],I=(0,o.useState)(!1),U=I[0],V=I[1],X=(0,o.useState)(""),q=X[0],K=X[1],z=(0,o.useState)(!1),G=z[0],J=z[1],Q=(0,o.useState)(!1),Y=Q[0],$=Q[1];(0,o.useEffect)((function(){1===s.role&&ee()}),[]);var ee=function(){s.user_id&&(R(!0),(0,d.F)({method:"POST",url:"api/getAllTicketPriority",data:{agency_id:1===s.role?s.user_id:s.agency_id},loading:!1,alert:!1},(function(e){1===e.status?(R(!1),r(e.data),0===e.data.length?W(!0):W(!1),$(!1)):$(!0)})))},te=function(){v(!1),M(""),S("")};return 1!==s.role||Y?(0,b.jsx)(y.default,{}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"xs_pagetitle_wrapper "+l().set_head,children:[(0,b.jsx)(n.Z,{title:"Settings"}),(0,b.jsx)("p",{className:l().set_subtitle,children:"Manage your system settings and preferences."})]}),(0,b.jsxs)("div",{className:l().wrapper,children:[(0,b.jsx)(a.Z,{}),(0,b.jsxs)("div",{className:"bg_setting",children:[(0,b.jsxs)("div",{className:l().st_panel_head,children:[(0,b.jsxs)("div",{className:l().st_panel_titles,children:[(0,b.jsx)("h3",{children:"Ticket Priority"}),(0,b.jsx)("p",{children:"Set how urgent a ticket is. Drag to reorder \u2014 the top of the list is the highest priority."})]}),f?null:(0,b.jsxs)("button",{type:"button",className:l().st_add_btn,onClick:function(){return v(!0)},children:[(0,b.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M8 3.2v9.6M3.2 8h9.6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})}),"Add Priority"]})]}),f?(0,b.jsxs)("form",{onSubmit:function(e){if(e.preventDefault(),j().isEmpty(O,{ignore_whitespace:!0}))return(0,g.iP)("error","Enter Priority name!","Field can not be empty!"),!1;var t={name:O,isdefault:0};V(!0),(0,d.F)({method:"POST",url:E?"api/manageTicket_priority?id="+E:"api/manageTicket_priority",data:t,loading:!1},(function(e){V(!1),1===e.status&&(ee(),S(""),v(!1),M(""))}))},className:l().st_form,children:[(0,b.jsxs)("div",{className:l().st_form_head,children:[(0,b.jsx)("span",{className:l().st_form_title,children:E?"Edit Priority":"New Priority"}),(0,b.jsx)("button",{type:"button",className:l().st_form_close,onClick:te,"aria-label":"Cancel",children:(0,b.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 12 12",fill:"none",children:(0,b.jsx)("path",{d:"m3 3 6 6M9 3l-6 6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})})]}),(0,b.jsx)("div",{className:"".concat(l().st_form_grid," ").concat(l().st_form_grid_solo),children:(0,b.jsxs)("div",{className:l().st_form_field,children:[(0,b.jsxs)("label",{className:l().st_form_label,htmlFor:"tp_name",children:["Priority Title ",(0,b.jsx)("span",{className:l().st_req,children:"*"})]}),(0,b.jsx)("input",{id:"tp_name",type:"text",className:l().st_input,value:O,onChange:function(e){return S(e.target.value)},placeholder:"e.g. High",autoFocus:!0})]})}),(0,b.jsxs)("div",{className:l().st_form_foot,children:[(0,b.jsx)("button",{type:"button",className:l().st_cancel,onClick:te,disabled:U,children:"Cancel"}),(0,b.jsxs)("button",{type:"submit",className:l().st_submit,disabled:U,children:[U?(0,b.jsx)("span",{className:l().st_spinner,"aria-hidden":"true"}):null,U?"Saving\u2026":E?"Update Priority":"Add Priority"]})]})]}):null,H?(0,b.jsx)("div",{className:l().st_list,children:[1,2,3,4].map((function(e){return(0,b.jsxs)("div",{className:l().st_row_skeleton,style:{animationDelay:"".concat(60*e,"ms")},children:[(0,b.jsx)("span",{className:"".concat(l().st_shimmer," ").concat(l().st_sk_grip)}),(0,b.jsx)("span",{className:"".concat(l().st_shimmer," ").concat(l().st_sk_pill)}),(0,b.jsx)("span",{className:"".concat(l().st_shimmer," ").concat(l().st_sk_actions)})]},e)}))}):t.length>0?(0,b.jsx)(u.Z5,{onDragEnd:function(e){if(e.destination){var s=function(e,t,r){var s=Array.from(e),n=s.splice(t,1),a=(0,i.Z)(n,1)[0];return s.splice(r,0,a),s}(t,e.source.index,e.destination.index),n=t;r(s),J(!0),(0,d.F)({method:"POST",url:"api/tickets_ChangeOrder",data:{list:s,status:"priority"},loading:!1,alert:!0},(function(e){J(!1),1==e.status?ee():r(n)}))}},children:(0,b.jsx)(u.bK,{droppableId:"droppable",children:function(e){return(0,b.jsxs)("div",k(k({className:"".concat(l().st_list," ").concat(G?l().st_list_busy:"")},e.droppableProps),{},{ref:e.innerRef,children:[t.map((function(e,r){var s=function(e,t){var r=(0,b.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M7 11V3.4M7 3.4 3.8 6.6M7 3.4l3.2 3.2",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),s=(0,b.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M3.4 7h7.2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})});if(t<=1)return{color:"#D98207",arrow:s};var i=e/(t-1);return i<=.33?{color:"#E5484D",arrow:r}:i>=.67?{color:"#12A150",arrow:(0,b.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M7 3v7.6M7 10.6l3.2-3.2M7 10.6 3.8 7.4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}:{color:"#D98207",arrow:s}}(r,t.length);return(0,b.jsx)(u._l,{draggableId:e._id.toString(),index:r,children:function(i,n){return(0,b.jsxs)("div",k(k({ref:i.innerRef},i.draggableProps),{},{className:"".concat(l().st_row," ").concat(n.isDragging?l().st_row_dragging:""," ").concat(q===e._id?l().st_row_busy:""),style:k(k({},i.draggableProps.style),{},{"--st-color":s.color}),children:[(0,b.jsx)(p.ZP,{title:"Drag to reorder",placement:"top",arrow:!0,children:(0,b.jsx)("div",k(k({className:l().st_grip},i.dragHandleProps),{},{"aria-label":"Drag to reorder",children:(0,b.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[(0,b.jsx)("circle",{cx:"5",cy:"3",r:"1.15",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"9",cy:"3",r:"1.15",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"5",cy:"7",r:"1.15",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"9",cy:"7",r:"1.15",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"5",cy:"11",r:"1.15",fill:"currentColor"}),(0,b.jsx)("circle",{cx:"9",cy:"11",r:"1.15",fill:"currentColor"})]})}))}),(0,b.jsx)("span",{className:l().st_order,children:r+1}),(0,b.jsxs)("div",{className:l().st_identity,children:[(0,b.jsxs)("span",{className:l().st_pill,style:{backgroundColor:(0,g.mR)(s.color,.12),color:s.color},children:[(0,b.jsx)("span",{className:l().st_pill_arrow,children:s.arrow}),e.name]}),1===e.isdefault?(0,b.jsx)(p.ZP,{title:"Built-in priority \u2014 cannot be deleted",placement:"top",arrow:!0,children:(0,b.jsx)("span",{className:l().st_default_tag,children:"Default"})}):null]}),(0,b.jsxs)("div",{className:l().st_actions,children:[(0,b.jsx)(p.ZP,{title:"Edit",placement:"top",arrow:!0,children:(0,b.jsx)("button",{type:"button",className:l().st_action_btn,onClick:function(){return function(e){var r=t.find((function(t){return t._id===e}));r&&(M(e),v(!0),S(r.name))}(e._id)},"aria-label":"Edit ".concat(e.name),children:_.Z.edit_icon})}),0===e.isdefault?(0,b.jsx)(p.ZP,{title:"Delete",placement:"top",arrow:!0,children:(0,b.jsx)("button",{type:"button",className:"".concat(l().st_action_btn," ").concat(l().st_action_danger),onClick:function(){return t=e._id,L(!0),void P(t);var t},"aria-label":"Delete ".concat(e.name),children:_.Z.icon_delete})}):(0,b.jsx)("span",{className:l().st_action_spacer})]})]}))}},e._id)})),e.placeholder]}))}})}):F&&!f?(0,b.jsxs)("div",{className:l().st_empty,children:[(0,b.jsx)("span",{className:l().st_empty_icon,children:(0,b.jsx)("svg",{width:"34",height:"34",viewBox:"0 0 34 34",fill:"none","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M8.4 29.5V4.5M8.4 5.7h17.2l-3.4 5.6 3.4 5.6H8.4",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,b.jsx)("h4",{children:"No ticket priorities yet"}),(0,b.jsx)("p",{children:"Create your first priority so tickets can be triaged by urgency."}),(0,b.jsxs)("button",{type:"button",className:l().st_add_btn,onClick:function(){return v(!0)},children:[(0,b.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,b.jsx)("path",{d:"M8 3.2v9.6M3.2 8h9.6",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round"})}),"Add Priority"]})]}):null]})]}),(0,b.jsx)(x.Z,{heading:"Delete Ticket Priority",show:Z,type:"delete",onClose:function(){P(""),L(!1)},children:(0,b.jsx)(m.Z,{handlePopUp:function(e){var t;e&&((t=N)?(K(t),(0,d.F)({method:"POST",url:"api/deleteTicketPriority?id="+t,loading:!1},(function(e){K(""),1===e.status&&(ee(),P(""),L(!1))}))):(P(""),L(!1))),L(!1)},title:"ticket priority"})})]})}},157:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/ticket-priority",function(){return r(9483)}])}},function(e){e.O(0,[630,8159,3014,8966,7493,7739,7495,5887,9774,2888,179],(function(){return t=157,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.