"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[35063],{24659:(e,a,n)=>{n.d(a,{A:()=>u});n(65043);var t=n(67784),s=n(4701),l=n(17392),i=n(10155),r=n(70579);const d=(0,s.A)({}),o=e=>{let{onClick:a}=e;return(0,r.jsx)(l.A,{onClick:a,children:(0,r.jsx)(i.A,{})})},u=e=>{const a=d();return(0,r.jsx)(t.A,{InputProps:{...a,endAdornment:(0,r.jsxs)(r.Fragment,{children:[" ",e.iscross&&(0,r.jsx)(o,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},35063:(e,a,n)=>{n.r(a),n.d(a,{default:()=>N});var t=n(65043),s=n(11906),l=n(68903),i=n(38624),r=n(96446),d=n(24659),o=n(63516),u=n(14556),c=n(73033),m=n(73216),v=n(66675),h=n(48376),b=n(96801),x=n(70579);const A=(0,b.Gq)("enuseloc"),j=(A&&Object.keys(A).length>0&&A.user_id,{brandName:"",status:""}),p=c.Ik().shape({brandName:c.Yj().nullable().required("Enter Brand Name"),status:c.Ik().nullable().required("Select Status")});const N=function(e){const a=(0,m.zy)(),n=(null===a||void 0===a?void 0:a.state)._original,[c,b]=(0,t.useState)(!1),A=t.useRef(null),[N,f]=(0,t.useState)(j),g=(0,u.wA)(),k=(0,m.Zp)(),S=()=>{k(-1)};(0,t.useEffect)((()=>{n&&f({...N,brandName:null===n||void 0===n?void 0:n.brand_name,status:{id:null===n||void 0===n?void 0:n.status,name:1==(null===n||void 0===n?void 0:n.status)?"Active":"InActive"}})}),[n]),console.log("procurementitemCategoryData",n);const y=()=>{const{brandName:e,status:a,...n}=j;f({...N,...n})};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"common-header-label-bold",children:[(0,x.jsx)(s.A,{onClick:S,children:(0,x.jsx)(v.A,{})}),"Update Brand"]}),(0,x.jsx)("div",{className:"component-list",children:(0,x.jsx)(o.l1,{enableReinitialize:!0,innerRef:A,validationSchema:p,initialValues:N,onSubmit:async(e,a)=>{var t,s;const l={brandID:null===n||void 0===n?void 0:n.id,brandName:e.brandName,status:null!==e&&void 0!==e&&null!==(t=e.status)&&void 0!==t&&t.id?null===e||void 0===e||null===(s=e.status)||void 0===s?void 0:s.id:""};console.log("finalPayload",l),a.setSubmitting(!0),await g((0,h.o71)(l)),y(),S()},children:e=>{let{errors:a,handleSubmit:n,handleChange:t,handleBlur:u,setFieldValue:c,isSubmitting:m,isValid:v,touched:h,values:b}=e;return(0,x.jsx)(o.lV,{onSubmit:n,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(l.Ay,{container:!0,className:"component-form",children:(0,x.jsxs)(l.Ay,{container:!0,children:[(0,x.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(d.A,{fullWidth:!0,label:"Brand Name*",name:"brandName",onBlur:u,value:b.brandName,onChange:(e,a)=>{c("brandName",a),f({...N,brandName:e.target.value})},variant:"outlined",size:"small",helperText:h.brandName&&a.brandName,error:h.brandName&&Boolean(a.brandName)})}),(0,x.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(i.A,{name:"status",value:b.status,fullWidth:!0,options:[{id:"1",name:"Active"},{id:"0",name:"In Active"}],onBlur:u,size:"small",getOptionLabel:e=>(null===e||void 0===e?void 0:e.name)||"",onChange:(e,a)=>{c("status",a),f({...N,status:a})},renderInput:e=>(0,x.jsx)(d.A,{...e,fullWidth:!0,label:"Status*",name:"status",variant:"outlined",helperText:a.status&&h.status,error:a.status&&Boolean(h.status)})})})]})}),(0,x.jsx)(l.Ay,{className:"d-flex justify-content-center",p:2,children:(0,x.jsx)(r.A,{children:(0,x.jsx)(s.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:m,children:"SAVE"})})})]})})}})})]})}},10155:(e,a,n)=>{var t=n(24994);a.A=void 0;var s=t(n(40039)),l=n(70579);a.A=(0,s.default)((0,l.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")},66675:(e,a,n)=>{var t=n(24994);a.A=void 0;var s=t(n(40039)),l=n(70579);a.A=(0,s.default)((0,l.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")}}]);
//# sourceMappingURL=35063.0aa9f1a8.chunk.js.map