"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[95615],{24659:(e,n,s)=>{s.d(n,{A:()=>c});s(65043);var a=s(67784),i=s(4701),t=s(17392),r=s(10155),l=s(70579);const o=(0,i.A)({}),d=e=>{let{onClick:n}=e;return(0,l.jsx)(t.A,{onClick:n,children:(0,l.jsx)(r.A,{})})},c=e=>{const n=o();return(0,l.jsx)(a.A,{InputProps:{...n,endAdornment:(0,l.jsxs)(l.Fragment,{children:[" ",e.iscross&&(0,l.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},17996:(e,n,s)=>{s.r(n),s.d(n,{default:()=>y});var a=s(65043),i=s(68903),t=s(11906),r=s(96446),l=s(63516),o=s(24659),d=s(73216),c=s(66675),u=s(11852),m=s(73033),h=s(14556),v=s(96801),x=s(70579);const j={reasonName:""},p=m.Ik().shape({reasonName:m.Yj("Enter Reason Name ").required("Reason Name is required")}),A=[],N=(0,v.Gq)("enuseloc"),f=N&&Object.keys(N).length>0?N.user_id:null;const y=function(e){const n=a.useRef(null),[s,m]=(0,a.useState)(j),v=(0,d.Zp)(),N=(0,h.wA)(),[y,b]=(0,a.useState)([]),k=(0,h.d4)((e=>{var n;return null===(n=e.bd.getFunctionalityPermissionDetail)||void 0===n?void 0:n.data})),g=a.useRef("No"),C=a.useRef("No");return(0,a.useEffect)((()=>{const e={userID:f,functionalityID:143,functionalityItemIDs:A};return N((0,u.P8M)(e)),()=>{N((0,u.qo7)())}}),[]),(0,a.useEffect)((()=>(k&&143===(null===k||void 0===k?void 0:k.functionalityID)&&(b(k),g.current=null===k||void 0===k?void 0:k.permission_report,C.current=null===k||void 0===k?void 0:k.permission_admin),()=>{b([]),g.current="NO",C.current="NO"})),[k]),(0,x.jsxs)("div",{className:"component-list",children:[(0,x.jsx)(i.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,x.jsxs)(i.Ay,{item:!0,className:"common-header-label",children:[(0,x.jsx)(t.A,{onClick:()=>{v(-1)},children:(0,x.jsx)(c.A,{})}),"Add Project Drop Reason"]})}),y&&Object.keys(y).length>0&&143===(null===y||void 0===y?void 0:y.functionalityID)&&"YES"===(null===y||void 0===y?void 0:y.permission_admin)?(0,x.jsx)(l.l1,{enableReinitialize:!0,innerRef:n,initialValues:s,validationSchema:p,onSubmit:async(e,n)=>{const s={reasonName:null!==e&&void 0!==e&&e.reasonName?null===e||void 0===e?void 0:e.reasonName:""};n.setSubmitting(!0),await N((0,u.Eq9)(s)),n.resetForm({}),v("/bd-masters/ProjectDropReason")},children:e=>{let{errors:n,handleSubmit:s,handleChange:a,setFieldValue:d,handleBlur:c,isSubmitting:u,isValid:h,touched:v,values:p}=e;return(0,x.jsx)(l.lV,{onSubmit:s,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(i.Ay,{container:!0,className:"component-form",children:(0,x.jsx)(i.Ay,{container:!0,children:(0,x.jsx)(i.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(o.A,{name:"reasonName",fullWidth:!0,onBlur:c,onChange:a,value:p.reasonName,error:n.reasonName&&Boolean(n.reasonName),helperText:n.reasonName&&n.reasonName,id:"reasonName",size:"small",label:"Reason Name*",variant:"outlined"})})})}),(0,x.jsxs)(i.Ay,{className:"d-flex justify-content-start",p:2,children:[(0,x.jsxs)(r.A,{mx:2,children:[" ",(0,x.jsx)(t.A,{text:"CANCEL",variant:"contained",color:"secondary",size:"medium",type:"reset",onClick:()=>{m({...j})},children:"RESET"})]}),(0,x.jsx)(r.A,{children:(0,x.jsx)(t.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:u,children:"SAVE"})})]})]})})}}):(0,x.jsx)("div",{className:"common-header-label-bold",children:"You don't have permission to access this page!"})]})}},10155:(e,n,s)=>{var a=s(24994);n.A=void 0;var i=a(s(40039)),t=s(70579);n.A=(0,i.default)((0,t.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,n,s)=>{var a=s(24994);n.A=void 0;var i=a(s(40039)),t=s(70579);n.A=(0,i.default)((0,t.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=95615.901de03f.chunk.js.map