1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5284],{26468:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/landlord/staff-management/add-staff",function(){return n(35089)}])},30386:function(e,t,n){"use strict";n.d(t,{E8:function(){return x},XU:function(){return f},pW:function(){return h},wc:function(){return m},h_:function(){return y}});var r=n(73921),i=n(43686),l=n(20743);let o=async e=>{let{...t}=e,n=e.isDefaultAccount?e.isDefaultAccount:null,r={...t,isDefaultAccount:n},{data:i}=await l.o.post("Landlord/EFT/add-edit-eft",{...r});return i},s=async e=>await d(l.o,e),a=async()=>{let{data:e}=await l.o.get("Landlord/EFT/get-filtered-eft-property-with-lcode");return e.data},d=async(e,t)=>{let{data:n}=await e.get("Landlord/EFT/get-eft",{params:{eftId:t}});return n},c=async e=>{let{data:t}=await l.o.post("LandLord/EFT/update-eft-by-Id",e);return t},u=async e=>{let{data:t}=await l.o.post("LandLord/EFT/save-eft-and-send-email",e);return t};var p=n(58005);let m=(e,t)=>(0,r.D)({mutationFn:async e=>await o(e),onSuccess:()=>{e()},onError:e=>{var n;if((0,p.IZ)(e)&&(null===(n=e.response)||void 0===n?void 0:n.data)){t(e.response.data.description);return}t()}}),x=e=>(0,i.a)(["eft",e],()=>s(e),{staleTime:0,enabled:!!e}),f=()=>(0,i.a)(["FilteredEftPropertyWithLCode"],()=>a(),{staleTime:0,cacheTime:0}),y=(e,t)=>(0,r.D)({mutationFn:async e=>await c(e),onSuccess:()=>{e()},onError:e=>{var n,r;if((0,p.IZ)(e)&&(null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.message)){t(e.response.data.message);return}t()}}),h=(e,t,n)=>(0,r.D)(()=>u(e),{onSuccess:()=>{t()},onError:()=>{n()}})},70635:function(e,t,n){"use strict";n.d(t,{w0:function(){return m},$A:function(){return p},cH:function(){return x},Vs:function(){return f}});var r=n(73921),i=n(43686),l=n(92114),o=n(20743);let s=async e=>{let{data:t}=await o.o.post("Common/User/invite-landlord-user",{...e});return t},a=async(e,t,n,r,i,l,s)=>{let{data:a}=await o.o.get("/Common/User/get-sub-landlords",{params:{search:i,pageSize:e,pageNumber:t,sortAscending:"ASC"==n,allRecords:r,filter:l,sortBy:s}});return a},d=async e=>{let{data:t}=await o.o.get("/Common/User/get-landlord-user/".concat(e));return t},c=async e=>{let{data:t}=await o.o.put("Common/User/update-landlord-user",{...e});return t};var u=n(58005);let p=(e,t)=>(0,r.D)({mutationFn:async e=>await s(e),onSuccess:()=>{e()},onError(e){if((0,u.IZ)(e)){var n;t(null===(n=e.response)||void 0===n?void 0:n.data.description)}else t()}}),m=e=>{let{pageSize:t,pageNumber:n,sortOrder:r,allRecords:l,searchTerm:o,filter:s,onError:d,onSuccess:c,sortColumn:u}=e;return(0,i.a)(["all staffs",t,n,r,l,o,s,u],()=>a(t,n,r,l,o,s,u),{onSuccess(e){c(e)},onError:()=>{d()}})},x=e=>{let t=(0,l.NL)();return(0,i.a)(["staffDetails"],()=>d(e),{enabled:!!e,staleTime:0,cacheTime:0,onSuccess:()=>{t.invalidateQueries(["all staffs"])}})},f=(e,t)=>(0,r.D)({mutationFn:async e=>await c(e),onSuccess:()=>{e()},onError(e){if((0,u.IZ)(e)){var n;t(null===(n=e.response)||void 0===n?void 0:n.data.description)}else t()}})},15957:function(e,t,n){"use strict";var r=n(15311);t.Z=e=>(0,r.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,r.jsx)("path",{d:"M5.9165 10.75L1.6665 6.5L5.9165 2.25",stroke:"#2F0B7C",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})},38382:function(e,t,n){"use strict";var r=n(3247),i=n(15311),l=n(15957),o=n(58571),s=n(80185);function a(){let e=(0,r._)(["\n border: none;\n background: transparent;\n cursor: pointer;\n display: flex;\n gap: 10px;\n align-items: center;\n"]);return a=function(){return e},e}function d(){let e=(0,r._)(["\n height: 48px;\n display: flex;\n align-items: center;\n padding: 8px;\n"]);return d=function(){return e},e}n(20132);let c=(0,o.Z)("button")(a()),u=(0,o.Z)("div")(d());t.Z=e=>{let{onClick:t}=e;return(0,i.jsx)(u,{children:(0,i.jsxs)(c,{onClick:t,children:[(0,i.jsx)(l.Z,{}),(0,i.jsx)(s.Z,{variant:"subtitle1",component:"span",sx:{cursor:"pointer"},children:"Go back"})]})})}},64289:function(e,t,n){"use strict";var r=n(3247),i=n(15311),l=n(64344);function o(){let e=(0,r._)(["\n width: 100%;\n height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n"]);return o=function(){return e},e}let s=(0,n(84819).ZP)("div")(o());t.Z=function(){return(0,i.jsx)(s,{children:(0,i.jsx)(l.Z,{})})}},33483:function(e,t,n){"use strict";var r=n(3247),i=n(15311),l=n(84819);function o(){let e=(0,r._)(["\n width: 100%;\n height: 2px;\n background-color: ",";\n margin-bottom: 25px;\n"]);return o=function(){return e},e}n(20132);let s=(0,l.ZP)("div")(o(),e=>{let{theme:t}=e;return t.palette.grey[300]});t.Z=()=>(0,i.jsx)(s,{})},11888:function(e,t,n){"use strict";n.d(t,{CU:function(){return r},_D:function(){return s},bn:function(){return i},qC:function(){return o},zU:function(){return l}});let r=/^[\w-\.+]+@([\w-]+\.)+[\w-]{2,4}$/,i=/^[a-zA-Z0-9_]*$/,l=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#])[A-Za-z\d@$!#%*?&]{8,}$/,o=/^[+-]?\d+(\.\d+)?$/,s=/^[0-9]{10}$/},62025:function(e,t,n){"use strict";n.d(t,{u:function(){return o}});var r=n(33659),i=n(68102),l=n(20132);let o=()=>{let{data:e}=(0,r.v$)();(0,l.useEffect)(()=>
1{if(e){if("1"===e.locale){localStorage.setItem("lang","en"),(0,i.Z)("en");return}localStorage.setItem("lang","es"),(0,i.Z)("es")}},[e])}},35089:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return R},default:function(){return b}});var r=n(15311),i=n(33659),l=n(64289),o=n(62025),s=n(23262),a=n(30386),d=n(67914),c=n(38382),u=n(72155),p=n(88207),m=n(33483),x=n(36809),f=n(57017),y=n(80185),h=n(54001),j=n(37637),v=n(28500),I=n(5762),g=n(20132),A=n(17723),N=n(8487),L=n(32005),C=n(11888),E=n(26662),D=n(9912);let S=D.z.object({eftId:D.z.number().optional(),firstName:D.z.string().nonempty((0,E.L)("COMMON:VALIDATION_REQUIRED")),lastName:D.z.string().nonempty((0,E.L)("COMMON:VALIDATION_REQUIRED")),lCodePropertyPairs:D.z.array(D.z.any()).nonempty().optional(),emailId:D.z.string().nonempty((0,E.L)("COMMON:VALIDATION_REQUIRED")).regex(C.CU,"Email is invalid")}),_=D.z.object({eftId:D.z.number().optional(),firstName:D.z.string().nonempty((0,E.L)("COMMON:VALIDATION_REQUIRED")),lastName:D.z.string().nonempty((0,E.L)("COMMON:VALIDATION_REQUIRED")),lCodePropertyPairs:D.z.array(D.z.any()).nonempty().optional(),landLine:D.z.string().max(10,(0,E.L)("COMMON:VALIDATION_MAX_LENGTH",{max:10})).optional(),emailId:D.z.string().nonempty((0,E.L)("COMMON:VALIDATION_REQUIRED")).regex(C.CU,"Email is invalid")});var P=n(70635),Z=e=>{let{}=e,t=(0,I.useRouter)(),n=t.query,[i,o]=(0,g.useState)([]),[C,E]=(0,g.useState)([]),[D,Z]=(0,g.useState)([]),[O,w]=(0,g.useState)({}),[T,R]=(0,g.useState)(!0),{data:b,isLoading:F,isSuccess:M}=(0,a.XU)(),{data:z}=(0,P.cH)(null==n?void 0:n.userId),{control:k,handleSubmit:U,getValues:V,formState:{errors:G}}=(0,A.cI)({mode:"onSubmit",resolver:(0,f.F)((null==n?void 0:n.userId)==void 0?S:_),values:{emailId:n?null==z?void 0:z.email:"",lCodePropertyPairs:n&&(null==z?void 0:z.lCodePropertyPairs)?null==z?void 0:z.lCodePropertyPairs.map(e=>e.propertyId):[],firstName:n?null==z?void 0:z.firstName:"",lastName:n?null==z?void 0:z.lastName:""}}),Q=()=>{let e=null==b?void 0:b.filter(e=>C.includes(String(e.propertyCode))).map(e=>{let{propertyCode:t,propertyId:n}=e;return{lCode:t,propertyId:n}}),t={email:V("emailId"),id:0,firstName:V("firstName"),lastName:V("lastName"),roleName:"landlord",locale:"1",lCodePropertyPairs:e,userId:(null==n?void 0:n.userId)?null==n?void 0:n.userId:null,isActive:T};(null==n?void 0:n.userId)?K(t):$(t)},{mutate:$}=(0,P.$A)(()=>{B()},()=>{}),{mutate:K}=(0,P.Vs)(()=>{B()},()=>{}),B=()=>{t.push(x.default.LANDLORD_VIEW_STAFF.ROUTE)},W=e=>{R(e)};(0,g.useEffect)(()=>{let e=[],t=[],r={},i=[];if((null==n?void 0:n.userId)&&M){var l,s;null==z||null===(l=z.lCodePropertyPairs)||void 0===l||l.forEach(e=>{i.push(e.propertyId),t.push(e.lCode)});let n=null==z?void 0:null===(s=z.lCodePropertyPairs)||void 0===s?void 0:s.map(e=>e.propertyId),o=null==b?void 0:b.filter(e=>null==n?void 0:n.includes(e.propertyId));null==o||o.forEach(t=>{e.push(null==t?void 0:t.propertyId),r[t.propertyId]=!0})}else null==b||b.forEach(e=>{r[e.propertyId]=!1});0!==e.length&&o(e),w(r),Z(i),E(t),(null==n?void 0:n.userId)?R(null==z?void 0:z.isActive):R(!0)},[b]);let X=(e,t,n,r)=>{w(e=>({...e,[n]:t})),o(e=>t?[...e.filter(e=>"Select Property"!==e),n]:e.filter(e=>e!==n&&"Select Property"!==e)),Z(e=>t?[...e,n]:e.filter(e=>e!==n)),E(e=>t?[...e,r]:e.filter(e=>e!==r))},q=()=>{N.Am.dismiss()},H=()=>{N.Am.info((0,r.jsxs)("div",{children:[(0,r.jsx)(y.Z,{fontSize:"20px",marginBottom:"10px",color:"black",fontWeight:500,textAlign:"center",children:(0,r.jsx)(v.Z,{i18nKey:"LANDLORD:ACCESS_DISCLOSURE"})}),(0,r.jsx)(y.Z,{fontSize:"20px",marginBottom:"10px",color:"black",fontWeight:500,textAlign:"center",children:(0,r.jsx)(v.Z,{i18nKey:"LANDLORD:PRESSING_ACCEPT"})}),(0,r.jsx)(u.MG,{size:"small",styletype:"Secondary",onClick:Q,children:(0,r.jsx)(v.Z,{i18nKey:"LANDLORD:I_ACCEPT"})}),(0,r.jsx)(u.MG,{style:{marginLeft:"10px"},size:"small",onClick:q,children:(0,r.jsx)(v.Z,{i18nKey:"LANDLORD:DO_NOT_ACCEPT"})})]}),{style:{padding:"20px",width:"70%",top:"20%"},position:"top-right",autoClose:!1,closeButton:!1})};return F&&l.Z,(0,r.jsxs)(s._U,{navigation:(0,r.jsx)(p.X,{}),children:[(0,r.jsx)(c.Z,{onClick:B}),(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center",fontSize:"24px",color:"#26284e",fontWeight:700,alignItems:"center"},children:(0,r.jsx)("p",{children:(null==n?void 0:n.userId)?(0,r.jsx)(v.Z,{i18nKey:"LANDLORD:EDIT_STAFF"}):(0,r.jsx)(v.Z,{i18nKey:"LANDLORD:ADD_STAFF"})})}),(0,r.jsx)("div",{style:{margin:"1rem 0px 0.5rem 0px"},children:(0,r.jsx)(m.Z,{})}),(0,r.jsx)(y.Z,{margin:"0px 0px 20px 0px",color:"rgb(38, 40, 78)",children:(0,r.jsx)(v.Z,{i18nKey:"LANDLORD:GRANT_ACCESS_PROPERTY_MANAGER"})}),(0,r.jsx)(h.ZP,{container:!0,flexDirection:"column",flexWrap:"nowrap",children:(0,r.jsxs)(h.ZP,{item:!0,xs:12,children:[(0,r.jsxs)(h.ZP,{container:!0,justifyItems:"center",rowGap:"20px",columnSpacing:4,children:[(0,r.jsxs)(h.ZP,{item:!0,xs:12,mobile:12,md:6,children:[M&&(0,r.jsx)(A.Qr,{name:"lCodePropertyPairs",control:k,defaultValue:i,render:e=>{let{field:t}=e;return(0,r.jsx)(u.RG,{...t,sx:{width:"50%","@media (max-width: 768px)":{width:"100%"},border:G.lCodePropertyPairs?"1px solid #cc2811":"1px solid black"},starMark:"*",multiple:!0,value:i,renderValue:e=>0===e.length||e.includes("Select Property")?"":e.map(e=>{let t=b.find(t=>t.propertyId===e);return t?t.propertyName:""}).filter(e=>""!==e).join(", "),customlabel:"LANDLORD:STAFF_PROPERTY",children:b.map(e=>(0,r.jsxs)(j.Z,{value:e.propertyId,"data-property-id":e.propertyId,"data-property-llcode":e.propertyCode,children:[(0,r.jsx)(L.Z,{checked:O[e.propertyId],onChange:t=>X(e.propertyName,t.target.checked,e.propertyId,e.propertyCode)}
1),"".concat(e.propertyName," - ").concat(e.propertyCode)]},e.propertyId))})}}),G.lCodePropertyPairs&&(0,r.jsx)("span",{style:{color:"#cc2811",fontSize:"14px"},children:"Property Selection is required"})]}),(0,r.jsxs)(h.ZP,{item:!0,xs:12,mobile:12,md:6,children:[(0,r.jsx)(A.Qr,{name:"firstName",control:k,defaultValue:"",render:e=>{let{field:t}=e;return(0,r.jsx)(u._l,{customlabel:"LANDLORD:STAFF_FIRST_NAME",...t,sx:{width:"50%","@media (max-width: 768px)":{width:"100%"}},starMark:"*",error:!!G.firstName})}}),!!G.firstName&&(0,r.jsx)("span",{style:{color:"#cc2811",fontSize:"14px"},children:"First Name is required"})]}),(0,r.jsxs)(h.ZP,{item:!0,xs:12,mobile:12,md:6,children:[(0,r.jsx)(A.Qr,{name:"lastName",control:k,defaultValue:"",render:e=>{let{field:t}=e;return(0,r.jsx)(u._l,{customlabel:"LANDLORD:STAFF_LAST_NAME",...t,sx:{width:"50%","@media (max-width: 768px)":{width:"100%"}},starMark:"*",error:!!G.lastName})}}),!!G.lastName&&(0,r.jsx)("span",{style:{color:"#cc2811",fontSize:"14px"},children:"Last Name is required"})]}),(0,r.jsxs)(h.ZP,{item:!0,xs:12,mobile:12,md:6,children:[(0,r.jsx)(A.Qr,{name:"emailId",control:k,defaultValue:"",render:e=>{let{field:t}=e;return(0,r.jsx)(u._l,{customlabel:"LANDLORD:RFTA_FORM_LABEL_EMAIL",...t,sx:{width:"50%","@media (max-width: 768px)":{width:"100%"}},disabled:null==n?void 0:n.userId,starMark:"*",onPaste:e=>e.preventDefault(),error:!!G.emailId})}}),!!G.emailId&&(0,r.jsx)("span",{style:{color:"#cc2811",fontSize:"14px"},children:"Email is required"})]}),(null==n?void 0:n.userId)!==void 0&&(0,r.jsx)(h.ZP,{item:!0,xs:12,mobile:6,children:(0,r.jsxs)("span",{style:{margin:"20px 0px 15px 0px",display:"block"},children:[(0,r.jsx)(u.x1,{checked:T,onChange:e=>{W(e.target.checked)}}),(0,r.jsx)("label",{style:{marginLeft:"15px",marginTop:"15px"},children:(0,r.jsx)(v.Z,{i18nKey:"LANDLORD:STAFF_IS_ACTIVE"})})]})})]}),(0,r.jsx)(h.ZP,{item:!0,xs:12,children:(0,r.jsxs)(h.ZP,{container:!0,gap:"35px",marginTop:"40px",justifyContent:"center",children:[(0,r.jsx)(h.ZP,{item:!0,children:(0,r.jsx)(u.MG,{size:"small",styletype:"Secondary",onClick:B,children:(0,r.jsx)(v.Z,{i18nKey:"COMMON:CLOSE"})})}),(0,r.jsx)(h.ZP,{item:!0,children:(0,r.jsx)(u.MG,{size:"small",onClick:()=>{U(()=>{H()})()},endIcon:(0,r.jsx)(d.BX,{}),children:(0,r.jsx)(v.Z,{i18nKey:"COMMON:SAVE"})})})]})})]})})]})},O=n(5724),w=n(33326),T=n.n(w),R=!0,b=()=>{let{isLoading:e,isError:t}=(0,i.v$)();(0,o.u)();let{t:n}=(0,O.Z)();return e?(0,r.jsx)(l.Z,{}):t?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T(),{children:(0,r.jsx)("title",{children:n("LANDLORD:STAFF_HEADER")})}),(0,r.jsx)(s.Nm,{children:(0,r.jsx)(Z,{})})]})}},26662:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});let r=(e,t)=>JSON.stringify({translationKey:e,...t})}},function(e){e.O(0,[6637,8753,9912,7017,5705,608,2888,9774,179],function(){return e(e.s=26468)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.