1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9559],{79401:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/master-setup/master-type/edit",function(){return s(72690)}])},72690:function(e,t,s){"use strict";s.r(t);var l=s(85893),r=s(77533),i=s(15861),n=s(93946),a=s(79878),o=s(67720),u=s(86886),d=s(18972),c=s(83321),x=s(98456),m=s(66476),h=s(87536),p=s(24704),f=s(43591),j=s(67294),Z=s(95715),v=s(85329),b=s(86501),C=s(88085),g=s(61213),y=s(9473);let P=e=>{let{open:t,handleClose:s,objData:P}=e,w=(0,Z.a)(),k=(0,y.I0)(),{reset:E,control:_,handleSubmit:S,setValue:T,getValues:q,formState:{errors:J}}=(0,h.cI)({mode:"all",defaultValues:{title:"",status:"A"}}),[D,I]=(0,j.useState)(!1),{masterTypeEdit:M}=(0,y.v9)(e=>e.masterTypeStore);(0,j.useEffect)(()=>(t&&null!==t&&P&&null!==P&&(T("title",null==P?void 0:P.title),T("status",null==P?void 0:P.status)),()=>{E()}),[t,P]),(0,j.useEffect)(()=>{if(M&&null!==M){if(k((0,g.L2)()),!0===M.result)b.ZP.dismiss(),b.ZP.success("Master Type Edited Successfully",{duration:p.QE,position:p.JJ}),s(),I(!1),k((0,g.a$)());else switch(I(!1),M.status){case p.WY:w.logout();break;case p.pn:b.ZP.dismiss(),b.ZP.error(null==M?void 0:M.message,{duration:p.QE,position:p.JJ}),k((0,g.L2)());break;case p.CA:b.ZP.dismiss(),b.ZP.error(null==M?void 0:M.message,{duration:p.QE,position:p.JJ})}}},[M]);let N=e=>{I(!0);let t={id:null==P?void 0:P.id,title:null==e?void 0:e.title,status:(0,f.lm)(e.status)};k((0,g.e6)(t))};return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(r.ZP,{open:t,anchor:"right",variant:"temporary",onClose:()=>{s()},ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{width:{xs:300,sm:400}}},children:(0,l.jsxs)(C.Z,{sx:{height:"100%"},justifyContent:"flex-start",flexDirection:"column",children:[(0,l.jsxs)(C.Z,{sx:{flexDirection:"row",py:5,px:5},alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(i.Z,{variant:"h5",children:"Edit Master Type"}),(0,l.jsx)(n.Z,{size:"small",onClick:()=>{s()},sx:{p:"0.438rem",borderRadius:1,color:"text.primary",backgroundColor:"action.selected","&:hover":{backgroundColor:e=>"rgba(".concat(e.palette.customColors.main,", 0.16)")}},children:(0,l.jsx)(a.Z,{icon:"tabler:x",fontSize:"1.125rem"})})]}),(0,l.jsx)(o.Z,{sx:{my:"0 !important"}}),(0,l.jsx)(C.Z,{sx:{px:5},flexGrow:1,children:(0,l.jsx)("form",{onSubmit:S(N),children:(0,l.jsxs)(u.ZP,{container:!0,children:[(0,l.jsx)(u.ZP,{item:!0,xs:12,children:(0,l.jsx)(h.Qr,{name:"title",control:_,rules:{required:"Title is required"},render:e=>{let{field:t}=e;return(0,l.jsx)(m.Z,{fullWidth:!0,value:t.value,sx:{mt:4},label:(0,l.jsx)(v.Z,{label:"Title",required:!0}),onChange:t.onChange,onKeyPress:e=>{(null==t?void 0:t.value)&&(null==t?void 0:t.value.length)>=35&&e.preventDefault()},error:!!J.title,...J.title&&{helperText:J.title.message}})}})}),(0,l.jsx)(u.ZP,{item:!0,xs:12,children:(0,l.jsx)(h.Qr,{name:"status",control:_,rules:{required:"Status is required"},render:e=>{let{field:t}=e;return(0,l.jsxs)(m.Z,{select:!0,fullWidth:!0,value:t.value,sx:{mt:4,mb:4},label:(0,l.jsx)(v.Z,{label:"Status",required:!0}),onChange:t.onChange,error:!!J.status,...J.status&&{helperText:J.status.message},children:[(0,l.jsx)(d.Z,{value:"A",children:"Active"}),(0,l.jsx)(d.Z,{value:"I",children:"Inactive"})]})}})})]})})}),(0,l.jsx)(o.Z,{sx:{my:"0 !important"}}),(0,l.jsxs)(C.Z,{sx:{p:5},flexDirection:"row",justifyContent:"flex-end",children:[(0,l.jsx)(c.Z,{variant:"outlined",sx:{mr:3},color:"secondary",onClick:()=>{s()},children:"Cancel"}),(0,l.jsx)(c.Z,{onClick:()=>{S(N)()},type:"submit",variant:"contained",disabled:D,children:D?(0,l.jsx)(x.Z,{size:18}):"Submit"})]})]})})})};t.default=P}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=79401)}),_N_E=e.O()}]);
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.