"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[24385],{24659:(e,t,s)=>{s.d(t,{A:()=>o});s(65043);var a=s(67784),l=s(4701),n=s(17392),i=s(10155),r=s(70579);const u=(0,l.A)({}),d=e=>{let{onClick:t}=e;return(0,r.jsx)(n.A,{onClick:t,children:(0,r.jsx)(i.A,{})})},o=e=>{const t=u();return(0,r.jsx)(a.A,{InputProps:{...t,endAdornment:(0,r.jsxs)(r.Fragment,{children:[" ",e.iscross&&(0,r.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},24385:(e,t,s)=>{s.r(t),s.d(t,{default:()=>I});var a=s(65043),l=s(68903),n=s(11906),i=s(38624),r=s(96446),u=s(63516),d=s(24659),o=s(73216),c=s(66675),m=s(14556),v=s(96801),h=s(73033),x=s(6994),A=s(70579);const j={releaseStatusName:"",statusID:""},S=h.Ik().shape({releaseStatusName:h.Yj().required("Release Status Name is required"),statusID:h.Ik().nullable().required("Select Status")}),p=(0,v.Gq)("enuseloc");p&&Object.keys(p).length>0&&p.user_id;const I=function(e){const t=(0,m.wA)(),s=(0,o.Zp)(),v=a.useRef(null),[h,p]=(0,a.useState)(j),I=(0,o.zy)(),N=null===I||void 0===I?void 0:I.state,b=null===N||void 0===N?void 0:N._original,f=[{id:"1",name:"Active"},{id:"0",name:"In Active"}];return(0,a.useEffect)((()=>{b&&p({...h,releaseStatusName:null===b||void 0===b?void 0:b.release_status_name,statusID:{id:b.release_status_active,name:1==(null===b||void 0===b?void 0:b.release_status_active)?"Active":"InActive"}})}),[b]),(0,A.jsxs)("div",{className:"component-list",children:[(0,A.jsx)(l.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,A.jsxs)(l.Ay,{item:!0,className:"common-header-label",children:[(0,A.jsx)(n.A,{onClick:()=>{s(-1)},children:(0,A.jsx)(c.A,{})}),"Update Release Status"]})}),(0,A.jsx)(u.l1,{enableReinitialize:!0,innerRef:v,initialValues:h,validationSchema:S,onSubmit:async(e,a)=>{var l;const n={statusID:null!==b&&void 0!==b&&b.id?null===b||void 0===b?void 0:b.id:"",releaseStatusName:null!==e&&void 0!==e&&e.releaseStatusName?null===e||void 0===e?void 0:e.releaseStatusName:"",isActive:null!==e&&void 0!==e&&e.statusID.id?null===e||void 0===e||null===(l=e.statusID)||void 0===l?void 0:l.id:""};a.setSubmitting(!0),await t((0,x.CJ)(n)),a.resetForm({}),s("/crm/crm-release-status")},children:e=>{let{errors:t,handleSubmit:s,handleChange:o,setFieldValue:c,handleBlur:m,isSubmitting:v,isValid:h,touched:x,values:j}=e;return(0,A.jsx)(u.lV,{onSubmit:s,children:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(l.Ay,{container:!0,className:"component-form",children:(0,A.jsxs)(l.Ay,{container:!0,children:[(0,A.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(d.A,{fullWidth:!0,name:"releaseStatusName",onBlur:m,onChange:o,value:j.releaseStatusName,error:x.releaseStatusName&&Boolean(t.releaseStatusName),helperText:x.releaseStatusName&&t.releaseStatusName,id:"releaseStatusName",size:"small",label:" Release Status Name *",variant:"outlined"})}),(0,A.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(i.A,{disablePortal:!0,id:"statusID",options:f||[],name:"statusID",value:j.statusID,size:"small",getOptionLabel:e=>(null===e||void 0===e?void 0:e.name)||"",renderOption:(e,t)=>(0,a.createElement)("li",{...e,style:{textAlign:"left"},key:null===t||void 0===t?void 0:t.id},null===t||void 0===t?void 0:t.name),onChange:(e,t)=>{c("statusID",t)},renderInput:e=>(0,A.jsx)(d.A,{...e,label:"Status",size:"small",helperText:x.statusID&&t.StatusValuesID,error:x.statusID&&Boolean(t.statusID)})})})]})}),(0,A.jsx)(l.Ay,{className:"d-flex justify-content-center",p:2,children:(0,A.jsx)(r.A,{children:(0,A.jsx)(n.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:v,children:"SAVE"})})})]})})}})]})}},10155:(e,t,s)=>{var a=s(24994);t.A=void 0;var l=a(s(40039)),n=s(70579);t.A=(0,l.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,t,s)=>{var a=s(24994);t.A=void 0;var l=a(s(40039)),n=s(70579);t.A=(0,l.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=24385.2363771a.chunk.js.map