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