"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[69385],{24659:(e,a,i)=>{i.d(a,{A:()=>c});i(65043);var r=i(67784),s=i(4701),n=i(17392),t=i(10155),l=i(70579);const d=(0,s.A)({}),m=e=>{let{onClick:a}=e;return(0,l.jsx)(n.A,{onClick:a,children:(0,l.jsx)(t.A,{})})},c=e=>{const a=d();return(0,l.jsx)(r.A,{InputProps:{...a,endAdornment:(0,l.jsxs)(l.Fragment,{children:[" ",e.iscross&&(0,l.jsx)(m,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},69385:(e,a,i)=>{i.r(a),i.d(a,{default:()=>x});var r=i(65043),s=i(68903),n=i(11906),t=i(96446),l=i(63516),d=i(24659),m=i(73216),c=i(66675),o=i(14556),u=i(11852),f=i(73033),A=i(70579);const N={OfficeName:"",Address:"",AreaName:"",CityName:""},h=f.Ik().shape({OfficeName:f.Yj("Enter OfficeName").min(6,"Enter Minimum 4 characters").required("Enter OfficeName is Required"),Address:f.Yj("Enter Address").min(6,"Enter Minimum 4 characters").required("Enter Address is Required"),AreaName:f.Yj("Enter AreaName").min(6,"Enter Minimum 4 characters").required("Enter AreaName is Required"),CityName:f.Yj("Enter CityName").min(6,"Enter Minimum 4 characters").required("Enter CityName is Required")});const x=function(e){const a=(0,o.wA)(),i=r.useRef(null),[f,x]=(0,r.useState)(N),j=(0,m.Zp)(),y=(0,m.zy)(),v=(null===y||void 0===y?void 0:y.state)._original;return(0,r.useEffect)((()=>{v&&x({...f,OfficeName:v.office_name,Address:v.address,AreaName:v.area,CityName:v.city})}),[v]),(0,A.jsxs)("div",{className:"component-list",children:[(0,A.jsx)(s.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,A.jsxs)(s.Ay,{item:!0,className:"common-header-label",children:[(0,A.jsx)(n.A,{onClick:()=>{j(-1)},children:(0,A.jsx)(c.A,{})}),"Update Sub Registrar Office List"]})}),(0,A.jsx)(l.l1,{enableReinitialize:!0,innerRef:i,initialValues:f,validationSchema:h,onSubmit:async(e,i)=>{const r={officeID:null!==v&&void 0!==v&&v.office_id?null===v||void 0===v?void 0:v.office_id:"",officeName:null!==e&&void 0!==e&&e.OfficeName?null===e||void 0===e?void 0:e.OfficeName:"",address:e.Address?e.Address:"",area:e.AreaName?e.AreaName:"",city:e.CityName?e.CityName:"",location:""};console.log("finalPayload",r),i.setSubmitting(!0),await a((0,u.anm)(r)),i.resetForm({}),j("/BD-Master/SubRegistrarOfficeList")},children:e=>{let{errors:a,handleSubmit:i,handleChange:r,setFieldValue:m,handleBlur:c,isSubmitting:o,isValid:u,touched:f,values:N}=e;return(0,A.jsx)(l.lV,{onSubmit:i,children:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(s.Ay,{container:!0,className:"component-form",children:(0,A.jsxs)(s.Ay,{container:!0,children:[(0,A.jsx)(s.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(d.A,{name:"OfficeName",fullWidth:!0,onBlur:c,onChange:r,value:N.OfficeName,error:f.OfficeName&&Boolean(a.OfficeName),helperText:a.OfficeName&&a.OfficeName,id:"OfficeName",size:"small",label:"Office Name *",variant:"outlined"})}),(0,A.jsx)(s.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(d.A,{name:"Address",fullWidth:!0,onBlur:c,onChange:r,value:N.Address,error:f.Address&&Boolean(a.Address),helperText:a.Address&&a.Address,id:"Address",size:"small",label:"Address *",variant:"outlined"})}),(0,A.jsx)(s.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(d.A,{name:"AreaName",fullWidth:!0,onBlur:c,onChange:r,value:N.AreaName,error:f.AreaName&&Boolean(a.AreaName),helperText:a.AreaName&&a.AreaName,id:"AreaName",size:"small",label:"Area Name *",variant:"outlined"})}),(0,A.jsx)(s.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(d.A,{name:"CityName",fullWidth:!0,onBlur:c,onChange:r,value:N.CityName,error:f.CityName&&Boolean(a.CityName),helperText:a.CityName&&a.CityName,id:"CityName",size:"small",label:"City Name *",variant:"outlined"})})]})}),(0,A.jsx)(s.Ay,{className:"d-flex justify-content-center",p:2,children:(0,A.jsx)(t.A,{children:(0,A.jsx)(n.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:o,children:"SAVE"})})})]})})}})]})}},10155:(e,a,i)=>{var r=i(24994);a.A=void 0;var s=r(i(40039)),n=i(70579);a.A=(0,s.default)((0,n.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,i)=>{var r=i(24994);a.A=void 0;var s=r(i(40039)),n=i(70579);a.A=(0,s.default)((0,n.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=69385.c2f22da7.chunk.js.map