1"use strict";(globalThis.webpackChunkdls_client||=[]).push([[8140],{56091(e,a,l){var t=l(57751),r=l(44978);const n=t.Ay.div` 2.sidebar { 3 height: fit-content; 4 ${"ar"===r.Ay.language?"text-align: right;":"text-align: left;"} 5 & .desc { 6 font-size: 12px; 7 letter-spacing: 0px; 8 color: #000000; 9 margin: 0; 10 } 11 & .ant-divider-horizontal { 12 margin: 15px 0; 13 border-top-color: #018b2b; 14 } 15 16 .steps { 17 .step { 18 align-items: baseline; 19 i { 20 font-size: 11px; 21 font-weight: bold; 22 } 23 p { 24 font-size: 13px; 25 } 26 } 27 } 28 } 29 .form-inputs { 30 input { 31 font-size: 13px; 32 height: 32px 33 } 34 } 35 36 .p-radiobutton .p-radiobutton-box { 37 border: 1px solid var(--main-color); 38 margin: auto; 39 border-radius: 10px; 40 opacity: 1; 41 width: 15px; 42 height: 15px; 43 44 .p-radiobutton-icon { 45 display: none; 46 visibility: hidden; 47 } 48 &.p-highlight { 49 border-color: var(--main-color); 50 background: var(--main-color); 51 } 52 } 53 .p-radiobutton .p-radiobutton-box.p-highlight:not(.p-disabled):hover { 54 border-color: var(--main-color); 55 background: var(--main-color); 56 } 57 .p-radiobutton .p-radiobutton-box:not(.p-disabled):not(.p-highlight):hover { 58 border-color: var(--main-color); 59 } 60 .p-dropdown-label { 61 padding: 3px; 62 } 63 64 .add-buyer { 65 padding: 0; 66 margin: 20px 0; 67 background: transparent; 68 color: var(--main-color); 69 border: none; 70 box-shadow: none; 71 .p-button-icon { 72 margin: 0; 73 background: var(--main-color); 74 color: white; 75 padding: 4px; 76 font-size: 13px; 77 border-radius: 50%; 78 } 79 .p-button-label { 80 margin: 0 5px; 81 } 82 83 &:hover { 84 background: transparent; 85 color: var(--main-color); 86 } 87 } 88 .action-btn { 89 border-radius: 10px; 90 opacity: 1; 91 border: none; 92 color: white; 93 justify-content: center; 94 &.submit-btn { 95 background: var(--main-color); 96 color:white; 97 &:disabled{ 98 background:#d2d2d2; 99 } 100 } 101 &.back-btn { 102 background: white; 103 border: 1px solid var(--main-color); 104 color: var(--main-color); 105 } 106 } 107 .exit-btn { 108 margin: auto auto 0 auto; 109 width: fit-content; 110 border: 1px solid #286c4d; 111 border-radius: 10px; 112 background: #e5ede9; 113 color: #286c4d; 114 } 115 .realty-table { 116 border-radius: 10px; 117 font-size: 13px; 118 background: #ffffff 0% 0% no-repeat padding-box; 119 opacity: 1; 120 121 .p-column-header-content { 122 justify-content: flex-start; 123 } 124 125 & td { 126 text-align: right !important; 127 } 128 .p-checkbox .p-checkbox-box { 129 border: 1px solid var(--main-color); 130 margin: auto; 131 border-radius: 3px; 132 opacity: 1; 133 width: 15px; 134 height: 15px; 135 } 136 } 137 .other-belongings { 138 margin-top: 70px; 139 } 140 141 .addShare { 142 border-radius: 0 5px 5px 0; 143 } 144 .numOfShares { 145 border-radius: 5px 0 0 5px; 146 } 147 .p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight{ 148 color: white !important; 149 } 150 .bHajzx .p-dropdown-label{ 151 font-style: 13px; 152 } 153 .buyerInfo{ 154 .p-input-icon-left>i { 155 position: absolute; 156 top: 50%; 157 margin-top: -5px; 158 } 159 } 160} 161`;l.d(a,["A",0,n])},37195(e,a,l){l(65043);var t=l(35092),r=l(70579);const n=e=>(0,r.jsx)(t.A,{className:"layout "+e.className,children:e.children});l.d(a,["A",0,n])},35092(e,a,l){const t=l(57751).Ay.div` 162 border: 1px solid #D3D3D3; 163 border-radius: 20px; 164 opacity: 1; 165 padding:20px; 166 .clearance-btn{ 167 width: fit-content; 168 } 169 .shares-form{ 170 overflow:scroll; 171 } 172 .shares-min-width{ 173 min-width:450px; 174 } 175 176`;l.d(a,["A",0,t])},91468(e,a,l){l.d(a,{G:()=>s});var t=l(65043),r=l(98595),n=l(82113);function s(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const[l,s]=(0,t.useState)(!0),[o,i]=(0,t.useState)(!0);(0,t.useEffect)(()=>{if(!a&&!(0,r.lQ)(null===e||void 0===e?void 0:e.prcL_TYPE))return i(!0),void s(!1);const l=null===e||void 0===e?void 0:e.vilL_CODE,t=null===e||void 0===e?void 0:e.hoD_CODE,o=null===e||void 0===e?void 0:e.secT_CODE,d=null===e||void 0===e?void 0:e.parC_NO;if(!l&&!t&&!o&&!d)return void s(!1);const c=`${(0,r.Wj)(l,4)}${(0,r.Wj)(t,3)}${(0,r.Wj)(o,3)}${(0,r.Wj)(d,5)}`;(0,n.Bg)(c).then(e=>{const a=null===e||void 0===e?void 0:e.data,l=Array.isArray(a)?a.length>0:!!a;i(l)}).catch(()=>{i(!1)}).finally(()=>{s(!1)})},[a,null===e||void 0===e?void 0:e.hoD_CODE,null===e||void 0===e?void 0:e.parC_NO,null===e||void 0===e?void 0:e.prcL_TYPE,null===e||void 0===e?void 0:e.secT_CODE,null===e||void 0===e?void 0:e.vilL_CODE]);return{realtyNeedsClearance:!l&&(a||(0,r.lQ)(null===e||void 0===e?void 0:e.prcL_TYPE))&&o,gisOrgLoading:l}}},23253(e,a,l){l.d(a,{A:()=>h});var t=l(44978),r=l(65043),n=l(73103),s=l(9255),o=l(90799),i=l(21691),d=l(73421),c=l(75357),u=l(67694),m=l(70579);function h(e){let{onDisableNext:a,demo:l}=e;const{approvalType:h,location:p}=(0,n.d4)(e=>e.sellingFormDetails),{sellingFormDetails:y}=(0,n.d4)(e=>e),g=(0,n.wA)(),[b,f]=(0,r.useState)(h||"personal"),[x,v]=(0,r.useState)([]),[S,N]=(0,r.useState)(""),[j,A]=(0,r.useState)([]),[C,w]=(0,r.useState)("");(0,r.useEffect)(()=>{g((0,c.Xf)({...y})),l||(g((0,c.Xf)({...y,approvalType:b})),a("listeningByRepresentation"===b),w(""),N(""),A([]))},[b]),(0,r.useEffect)(()=>{C.length&&!l&&(g((0,c.Xf)({...y,location:{governate:S,dept:C}})),a(!1))},[C]),(0,r.useEffect)(()=>{v(null!==p&&void 0!==p&&p.governate?[{name:p.governate}]:[]),l||(u.m.getDistrict().then(e=>{var a;e.data.splice(0,1),v(e.data),(null===p||void 0===p?void 0:p.governate)&&u.m.getDept(null===(a=e.data.find(e=>e.name===(null===p||void 0===p?void 0:p.governate)))||void 0===a?void 0:a.id).then(e=>{A(e.data)})}),a(!1)),N((null===p||void 0===p?void 0:p.governate)||""),A(null!==p&&void 0!==p&&p.dept?[{name:p.dept}]:[]),w((null===p||void 0===p?void 0:p.dept)||"")},[]);return(0,m.jsxs)(i.A,{title:(0,t.t)("buildingApproval.title"),children:[(0,m.jsx)(o.A,{children:(0,m.jsx)(s.A,{required:!0,fullWidth:!0,name:"localApprovalType",type:"radio",value:b,onChange:e=>{f(e.target.value)},disabled:l,responsive:!0,options:[{optionValue:"personal",title:(0,t.t)("buildingApproval.personal")},{optionValue:"liteningFromOutSide",title:(0,t.t)("buildingApproval.liteningFromOutSide")},{optionValue:"listeningByRepresentation",title:(0,t.t)("buildingApproval.listeningByRepresentation")}]})}),"listeningByRepresentation"===b&&(0,m.jsxs)(o.A,{children:[(0,m.jsx)(d.A,{title:(0,t.t)("\u0645\u0643\u0627\u0646 \u0627\u0633\u062a\u0645\u0627\u0639 \u0627\u0644\u0625\u0642\u0631\u0627\u0631")}),(0,m.jsx)(s.A,{title:(0,t.t)("quickServices.district"),required:!0,name:"governate",type:"select",value:S,onChange:e=>{N(e.target.value),(e=>{var l;a(!0),u.m.getDept(null===(l=x.find(a=>a.name===e))||void 0===l?void 0:l.id).then(e=>{A(e.data),w("")})})(e.target.value)},options:x,optionLabel:"name",optionValue:"name",disabled:l}),(0,m.jsx)(s.A,{title:(0,t.t)("quickServices.department"),required:!0,name:"dept",type:"select",value:C,onChange:e=>w(e.target.value),options:j,optionLabel:"name",optionValue:"name",disabled:l||!S})]})]})}},53840(e,a,l){l.d(a,{A:()=>u});var t=l(44978),r=l(65043),n=l(73103),s=l(9255),o=l(90799),i=l(21691),d=l(66888),c=l(70579);
176function u(e){let{onUpdateFormData:a,demo:l,selling:u,onDisableNext:m,refund:h,adminPrice:p,takharog:y,transmission:g}=e;const b=(0,n.d4)(e=>h?e.sellingFormDetails.oldContract:e.sellingFormDetails),[f,x]=(0,r.useState)(b.additionalNotes||""),[v,S]=(0,r.useState)(b.legalDisclaimer);(0,r.useEffect)(()=>{(y||g)&&a&&a({feePaymentType:"full"})},[g,y]),(0,r.useEffect)(()=>{(y||g)&&m&&(b.feePaymentType&&b.feePaymentName&&b.feePaymentName.id&&v?(console.log("123"),m(!1)):(m(!0),console.log("444")))},[g,y,v,b.feePaymentType]),console.log(b.buyersDetails);return(0,c.jsxs)(i.A,{title:p?(0,t.t)("realtySelling.infoCorrectness"):(0,t.t)("realtySelling.additionalNotes"),children:[(y||g)&&(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(o.A,{children:[(0,c.jsx)(s.A,{title:(0,t.t)("realtySelling.feePaymentType"),required:!0,fullWidth:!0,name:"feePaymentType",type:"radio",value:b.feePaymentType,onChange:e=>{a&&a({feePaymentType:e.value})},options:[{optionValue:"full",title:(0,t.t)("realtySelling.fullPayment")},{optionValue:"partial",title:(0,t.t)("realtySelling.partialPayment")}],disabled:l}),(0,c.jsx)(s.A,{title:(0,t.t)("realtySelling.getPaymentName"),required:!0,double:!0,disableFilter:!0,name:"feePaymentName",type:"select",value:b.feePaymentName,onChange:e=>{a&&a({feePaymentName:e.value})},options:(b.buyersDetails||[]).map(e=>({label:e.buyerArabicName||e.nationalId,value:{label:e.buyerArabicName,id:e.nationalId||e.buyerArabicName}})),optionLabel:"label",optionValue:"value",disabled:l})]})}),!p&&(0,c.jsx)(o.A,{children:(0,c.jsx)(s.A,{placeholder:(0,t.t)("realtySelling.additionalNotesPlaceholder"),required:!0,fullWidth:!0,name:"additionalNotes",type:"textarea",rows:5,value:f,onBlur:()=>{a({additionalNotes:f})},onChange:e=>x(e.target.value),disabled:l})}),(0,c.jsx)(d.A,{selling:u,onDisableNext:e=>{g||y?S(!e):m&&m(e)},demo:l,refund:h})]})}},58924(e,a,l){l.d(a,{A:()=>p});var t=l(77627),r=l(44978),n=(l(65043),l(73103)),s=l(9255),o=l(90799),i=l(21691),d=l(98595),c=l(75357),u=l(82113),m=l(67694),h=l(70579);function p(e){let{onUpdateFormData:a,onSuccessSubmit:l,checkRequestExist:p,disableSearch:y,deceasedAgent:g,preventCorporate:b,checkWell:f,allowLandsOnly:x,allowApartmentsOnly:v,landTypeDesc:S,belongsToWhichAuthority:N,selling:j,disableByDistrict:A}=e;const C=(0,n.wA)();async function w(e){let t={hasAuthority:!1};N&&(t=await(0,d.H7)(e.data.pRandom));try{if(p&&!g){if(!1===(await p(e.data.reG_NO)).data){const r=await(0,u.Lm)(e.data.reG_NO);a({propertyData:e.data,landRegNo:r.data,authData:t},!0),l()}else C((0,c.Qg)((0,r.t)("errors.openSellingRequest")))}else{const r=await(0,u.Lm)(e.data.reG_NO);a({propertyData:e.data,landRegNo:r.data,authData:t},!0),l()}}catch(n){}}const k=(0,t.Wx)({initialValues:{pRandom:""},validate:e=>{let a={};return e.pRandom||(a.pRandom=(0,r.t)("errors.required")),a},onSubmit:async e=>{if(A){const a=await(0,u.JT)(e.pRandom),l=(await m.m.getLRD_LKP()).data.find(e=>e.depT_CODE===`${a.data}`);if(!l||"1"!==l.activatE_FLAG)return void C((0,c.Qg)((0,r.t)("errors.serviceIsNotAvailable")))}C((0,c.eh)()),(0,u.qz)({pRandom:e.pRandom}).then(e=>{S&&S!==e.data.lanD_TYPE_DESC?C((0,c.Qg)((0,r.t)("errors.landTypeDesc")+S)):v?(0,d.KF)(e.data.prcL_TYPE)?f?(0,u.M)(e.data.dlS_KEY||e.data.flatDlsKey).then(a=>{w({data:{...e.data,...a.data}})}):w(e):C((0,c.Qg)((0,r.t)("errors.apartmentSellingOnly"))):x?(0,d.Q$)(e.data.landFlag)?f?(0,u.M)(e.data.dlS_KEY||e.data.flatDlsKey).then(a=>{w({data:{...e.data,...a.data}})}):w(e):C((0,c.Qg)((0,r.t)("errors.landSellingOnly"))):b&&"5"==e.data.partY_CODE?C((0,c.Qg)((0,r.t)("errors.preventCorporate"))):f?(0,u.M)(e.data.dlS_KEY||e.data.flatDlsKey).then(a=>{w({data:{...e.data,...a.data}})}):w(e)})}});return(0,h.jsx)(i.A,{title:(0,r.t)("OwnershipTransfer.Common.pickRealty"),children:(0,h.jsx)("form",{onSubmit:k.handleSubmit,className:"p-fluid",children:(0,h.jsx)(o.A,{children:(0,h.jsx)(s.A,{title:(0,r.t)("OwnershipTransfer.Common.pNumber"),name:"pRandom",dir:"ltr",className:"text-end",required:!0,double:!0,formik:k,value:k.values.pRandom,onChange:e=>{const a=e.target.value.replace(/\s/g,"");k.setFieldValue("pRandom",a)},afterButton:{type:"submit",label:(0,r.t)("common.search"),disabled:y}})})})})}},61482(e,a,l){l.d(a,{A:()=>S});var t=l(26081),r=l(86178),n=l.n(r),s=l(54972),o=l(9642),i=l(81931),d=l(4504),c=l(65043),u=l(49092),m=l(73103),h=l(73216),p=l(21691),y=l(98595),g=l(75357),b=l(82113),f=l(67694),x=l(70579);const v=["152","60","61","62","63","66","67","68","69","104","105","124","125"];function S(e){let{selectedShares:a,title:l,demo:r,formik:S,pRandom:N,reG_NO:j,dlS_KEY:A,checkAuth:C,selectAll:w,edit:k,endowment:D,disableAutoSelectTotalShares:I,showTableDemo:T,landSharesTitle:F,ownerName:R,deadError:_,selectDead:E,foreclosureSale:O,apartmentShares:P,sellerType:V,withoutMinors:$,withConstraints:B,constraintsError:L,withOrWithoutConstraints:q,checkIfInArray:M,checkIfInArrayError:W,maxSelectedShares:z,allowSoldierSellection:Y,preventSellingReserve:K,ownersOnly:G,apartmentData:U,withInsuranceConstraintsAllow:Q}=e;const{t:J}=(0,u.B)(),H=(0,m.wA)(),[X,Z]=((0,h.Zp)(),(0,c.useState)([])),[ee,ae]=(0,c.useState)([]),[le,te]=(0,c.useState)([]),[re,ne]=(0,c.useState)([]),[se,oe]=(0,c.useState)(!1),[ie,de]=(0,c.useState)(!1),[ce,ue]=(0,c.useState)(!1),me=[{label:J("realtySelling.documentNo"),key:"reservBookNo"},{label:J("realtySelling.reservBookDate"),key:"reservBookDate",body:e=>(0,x.jsx)("p",{children:n()(e.reservBookDate).format("DD/MM/YYYY")})},{label:J("realtySelling.reservetype"),key:"reserveType"},{label:J("realtySelling.partyAttNotes"),key:"partyAttNotes"}],he=[{label:J("realtySelling.documentNo"),key:"rebookNo"},{label:J("realtySelling.reservBookDate"),key:"reservBookDate",body:e=>(0,x.jsx)("p",{children:n()(e.rebookDate).format("DD/MM/YYYY")})},{label:J("realtySelling.reservetype"),key:"reserveType"},{label:J("realtySelling.partyAttNotes"),key:"reservDesc"}],pe=[{label:J("realtySelling.documentNo"),key:"attachNo"},{label:J("realtySelling.reservBookDate"),key:"attachYear"},{label:J("realtySelling.reservetype"),key:"docAame"},{label:J("realtySelling.partyAttNotes"),key:"partyName"}],ye=e=>{S.setFieldValue("selectedShares",e.filter(e=>xe(e))),setTimeout(()=>{S.setFieldTouched("selectedShares",!0)},200)};(0,c.useEffect)(()=>{null!==X&&void 0!==X&&X.length||r||(k?(Z(a),setTimeout(()=>{S.setFieldTouched("selectedShares",!0)}
176,200)):(G?(0,b.VK)(A,U.PRCLTYPE,U.BuildNo,U.StareNo,U.FlatNo):A?(0,b.U8)(N,A,j):(0,b.U8)(N,void 0,j)).then(async e=>{const l=(null===e||void 0===e?void 0:e.data)||[],t=[],r=[];C&&l.length>0&&be(l[0]);for(const o of l){if(null!==a&&void 0!==a&&a.length){const e=a.find(e=>e.partyId===o.partyId);e&&Object.assign(o,e)}if(o.birthdt?(o.sellerAge=n()().diff(n()(o.birthdt),"years"),n()().diff(n()(o.birthdt),"years")<18&&(o.adjective=3),o.card_expiry=o.cexP_DT,o.card_no=o.carD_NO,o.card_issuer=o.officE_D,o.isAlive="\u0645\u062a\u0648\u0641\u064a"!==o.personStatus):o.typeOfSeller="auth",delete o.birthdt,delete o.cexP_DT,delete o.carD_NO,delete o.officE_D,"5"===o.partyCode)try{await(0,b.QR)(o.partyId).then(e=>{o.company_status="active"})}catch(s){}r.includes(o.partyId)||(t.push(o),r.push(o.partyId))}Z(t),w&&ye(t)}))},[N,j]);const ge=e=>{S.setFieldValue("isTotalShares",!1),H((0,g.Qg)(e))},be=e=>{const{regNo:a}=e;f.m.isRelatedToAnyAuthority(a).then(e=>{e.data&&ge(J("errors.relatedToAuthority"))})};(0,c.useEffect)(()=>{S.values.isTotalShares&&S.values.selectedShares.length!==X.length&&!r&&ye(X)},[S.values.isTotalShares]);const fe=e=>-1!==S.values.selectedShares.findIndex(a=>a.partyId===e),xe=e=>{if(!C&&!A&&4==e.partyCode)return ge(J("errors.cantChooseAuthShares")),!1;if(5==e.partyCode&&"active"!==e.company_status)return ge("\u0644\u0627 \u064a\u0645\u0643\u0646 \u0627\u062e\u062a\u064a\u0627\u0631 \u0634\u0631\u0643\u0629 \u063a\u064a\u0631 \u0641\u0639\u0627\u0644\u0629"),!1;if($&&"\u0642\u0627\u0635\u0631"===e.personStatus)return ge(J("errors.cantChooseMinor")),!1;if(!E&&!1===e.isAlive)return ge(_||J("errors.sellerMustBeAlive",{type:V||"\u0627\u0644\u0628\u0627\u0626\u0639"})),!1;if(n()().diff(n()(e.card_expiry))>0&&"\u0645\u062a\u0648\u0641\u064a"!==e.personStatus&&ge(J("errors.ownerSoldierWarning")),M&&W&&(!M.find||!M.find(a=>a.nationalId===e.partyId||a.agentPersonalNumber===e.partyId)))return ge(W),!1;const a=e.internalReserve,l=e.externalReserve,t=e.otherReserve;if(O){let e=!1;for(const l of a)if("90"===l.docCode||"175"===l.docCode){e=!0;break}for(const a of l)if("90"===a.docCode||"175"===a.docCode){e=!0;break}return!!e||(ge(J("errors.noMortgageConstraints")),!1)}if(Q){let e=!1;for(const l of a)if(!v.includes(l.docCode)){e=!0;break}for(const a of l)if(!v.includes(a.docCode)){e=!0;break}return!(!e&&(a.length||l.length))||(ge(L||J("errors.cantChooseShareWithReserve")),!1)}if(B)return!!(null!==a&&void 0!==a&&a.length||null!==l&&void 0!==l&&l.length)||(ge(J("errors.cantChooseShareWithoutReserve")),!1);if(q);else if(K){if(null!==t&&void 0!==t&&t.length||null!==l&&void 0!==l&&l.length)return ge(L||J("errors.cantChooseShareWithReserve")),!1}else if(null!==a&&void 0!==a&&a.length||null!==l&&void 0!==l&&l.length)return ge(L||J("errors.cantChooseShareWithReserve")),!1;return!0};(0,c.useEffect)(()=>{(null!==a&&void 0!==a&&a.length&&!r||null!==a&&void 0!==a&&a.length&&T)&&(S.setFieldValue("selectedShares",a),Z(a))},[]),(0,c.useEffect)(()=>{r||S.values.selectedShares.length!==X.length&&X.length&&S.setFieldValue("isTotalShares",!1)},[S.values.selectedShares,X]);const ve=()=>{let e=!1;return X.forEach(a=>{"FLAT"===a.landFlag&&(e=!0)}),e},Se=()=>{let e=!1;return X.forEach(a=>{(0,y.Q$)(a.landFlag)&&(e=!0)}),e};return(0,x.jsxs)(x.Fragment,{children:[(!r||T)&&(0,x.jsxs)(p.A,{title:l,children:[(0,x.jsx)(i.b,{className:"realty-table fm-kufi-regular",paginator:!0,rows:5,tableClassName:"w-100",value:X,responsiveLayout:"scroll",emptyMessage:J("common.noResultsFound"),children:[{label:"",key:"action",body:e=>(0,x.jsx)(s.S,{disabled:S.values.isTotalShares||r,name:"nationalId",value:e.partyId,className:(0,d.xW)({"custom-radio":!0,"p-invalid":!1}),onChange:a=>(e=>{if(xe(e)){let a=[...S.values.selectedShares];fe(e.partyId)&&!S.values.isTotalShares?a=a.filter(a=>a.partyId!==e.partyId):a.push(e),a.length<=z||!z?((0,y.Cj)(S),S.setFieldValue("selectedShares",[...a])):ge(J("registration-services.correctNameNationalId.canNotPickMoreThanOneOwner"))}})(e),checked:fe(e.partyId)}),show:!0},{label:J("realtySelling.nationalId"),key:"partyId",show:!0},{label:R||J("realtySelling.ownerName"),key:"partyName",show:!0},{label:P||J("realtySelling.apartmentShares"),key:"ownShares",body:e=>"FLAT"===e.landFlag?`${e.ownShares} / ${e.shareNo}`:"-",show:ve(),style:{whiteSpace:"nowrap"}},{label:F||J("realtySelling.landShares"),key:"landShares",body:e=>(0,y.Q$)(e.landFlag)?`${e.ownShares} / ${e.shareNo}`:"-",show:Se(),style:{whiteSpace:"nowrap"}},{label:J("realtySelling.personStatus"),key:"personStatus",body:e=>e.personStatus,show:!0},{label:J("realtySelling.internalActions"),key:"internalActions",body:e=>{var a,l;return e.internalReserve&&null!==(a=e.internalReserve)&&void 0!==a&&a.length?(0,x.jsx)("span",{onClick:()=>
176{return(a=e).internalReserve.forEach(e=>{e.reserveType=J("realtySelling.internalActions")}),ae(a.internalReserve),void oe(!0);var a},className:"text-primary cursor-pointer text-decoration-underline",children:`${J("realtySelling.thereIs")} ${null===(l=e.internalReserve)||void 0===l?void 0:l.length}`}):J("realtySelling.thereIsNot")},show:!0},{label:J("realtySelling.externalActions"),key:"externalActions",body:e=>{var a,l;return e.externalReserve&&null!==(a=e.externalReserve)&&void 0!==a&&a.length?(0,x.jsx)("span",{onClick:()=>{return(a=e).externalReserve.forEach(e=>{e.reserveType=J("realtySelling.externalActions")}),te(a.externalReserve),void de(!0);var a},className:"text-primary cursor-pointer text-decoration-underline",children:`${J("realtySelling.thereIs")} ${null===(l=e.externalReserve)||void 0===l?void 0:l.length}`}):J("realtySelling.thereIsNot")},show:!0},{label:J("realtySelling.preventSellingReserve"),key:"preventSellingReserve",body:e=>{var a,l;return e.otherReserve&&null!==(a=e.otherReserve)&&void 0!==a&&a.length?(0,x.jsx)("span",{onClick:()=>{return(a=e).otherReserve.forEach(e=>{e.reserveType=J("realtySelling.preventSellingReserve")}),ne(a.otherReserve),void ue(!0);var a},className:"text-primary cursor-pointer text-decoration-underline",children:`${J("realtySelling.thereIs")} ${null===(l=e.otherReserve)||void 0===l?void 0:l.length}`}):J("realtySelling.thereIsNot")},show:K}].map(e=>e.show&&(0,x.jsx)(o.V,{field:e.key,header:e.label,body:e.body?e.body:null,style:e.style||{}},e.key))}),(Ne="selectedShares",(e=>!(!S.touched[e]||!S.errors[e]))(Ne)&&(0,x.jsx)("small",{className:"p-error text-xs",children:S.errors[Ne]}))]}),(0,x.jsx)(t.A,{className:"insideModal",closable:!1,okText:J("common.close"),width:"800px",cancelButtonProps:{style:{display:"none"}},okButtonProps:{className:"ant-btn ant-btn-default action-btn col-md-2 col-xs-4 btn-bg-main fm-kufi-regular text-sm submit-btn"},visible:se,onOk:()=>oe(!1),children:(0,x.jsx)(i.b,{className:"mt-4 text-xs fm-kufi-regular",size:"small",value:ee,children:me.map(e=>(0,x.jsx)(o.V,{className:"text-center",field:e.key,header:e.label,body:e.body?e.body:null},e.key))})}),(0,x.jsx)(t.A,{className:"insideModal",closable:!1,cancelButtonProps:{style:{display:"none"}},okText:J("common.close"),width:"800px",okButtonProps:{className:"ant-btn ant-btn-default action-btn col-md-2 col-xs-4 btn-bg-main fm-kufi-regular text-sm submit-btn"},visible:ie,onOk:()=>de(!1),children:(0,x.jsx)(i.b,{className:"mt-4 text-xs fm-kufi-regular",size:"small",value:le,children:he.map(e=>(0,x.jsx)(o.V,{className:"text-center",field:e.key,header:e.label,body:e.body?e.body:null},e.key))})}),(0,x.jsx)(t.A,{className:"insideModal",closable:!1,cancelButtonProps:{style:{display:"none"}},okText:J("common.close"),width:"800px",okButtonProps:{className:"ant-btn ant-btn-default action-btn col-md-2 col-xs-4 btn-bg-main fm-kufi-regular text-sm submit-btn"},visible:ce,onOk:()=>ue(!1),children:(0,x.jsx)(i.b,{className:"mt-4 text-xs fm-kufi-regular",size:"small",value:re,children:pe.map(e=>(0,x.jsx)(o.V,{className:"text-center",field:e.key,header:e.label,body:e.body?e.body:null},e.key))})})]});var Ne}},91613(e,a,l){l.d(a,{A:()=>x});var t=l(77627),r=l(44978),n=l(86178),s=l.n(n),o=l(72018),i=l(9642),d=l(81931),c=l(65043),u=l(73103),m=(l(61135),l(9255)),h=l(90799),p=l(21691),y=l(98595),g=l(75357),b=l(82113),f=l(70579);function x(e){var a,l,n,x;let{onDisableNext:v,demo:S,withPRandom:N,withoutWell:j,selling:A,landAndApartment:C,withElectricityClearance:w,correctServeyInfo:k}=e;const D=(0,u.wA)(),I=(0,u.d4)(e=>e.sellingFormDetails),{propertyData:T}=I,F=null!==(a=null!==(l=null!==(n=null===T||void 0===T?void 0:T.prcL_TYPE)&&void 0!==n?n:null===T||void 0===T?void 0:T.prclType)&&void 0!==l?l:null===T||void 0===T?void 0:T.prcL_Type)&&void 0!==a?a:null===T||void 0===T?void 0:T.PRCL_TYPE,R=[28,29,31,32,33,8,9].includes(Number(F)),_=Boolean(S||R),[E,O]=(0,c.useState)(!R&&(I.hasBelongings||!1)),[P,V]=(0,c.useState)(I.hasDemolishedBuilding||!1);(0,c.useEffect)(()=>{R&&O(!1)},[R]);const[$,B]=(0,c.useState)([]),[L,q]=(0,c.useState)([]),[M,W]=(0,c.useState)(I.physicalLandmarks||{buildings:!1,fences:!1,shrubs:!1,settlementIron:!1,waterWell:!1,railway:!1,houriaChains:!1,waterCanal:!1,valley:!1,none:!1,other:!1,otherText:""}),z=[{label:(0,r.t)("realtySelling.constructionType"),key:"label"},{label:(0,r.t)("realtySelling.buildingArea"),key:"area"},{label:(0,r.t)("realtySelling.constructionYear"),key:"year"},{label:(0,r.t)("realtySelling.sharesRatio"),key:"sharesRatio",body:e=>
176`${e.wholeShares} / ${e.soldShares}`},{label:"",key:"action",body:(e,a)=>{let{rowIndex:l}=a;return(0,f.jsx)(o.$,{icon:"pi pi-trash text-danger text-sm",onClick:()=>G(l),disabled:_,className:"p-button-rounded bg-transparent outline-none"})},hidden:S}],Y=(0,t.Wx)({initialValues:{item:"",area:"",year:"",wholeShares:"",soldShares:"",buildingType:"",hasWell:I.hasWell||!1},validate:e=>{const a=(0,y.XU)(e);let l={};return a.item||(l.item=(0,r.t)("errors.required")),a.area?(a.area<1||isNaN(+a.area))&&(l.area=(0,r.t)("errors.areaMoreThanZero")):l.area=(0,r.t)("errors.required"),a.year||(l.year=(0,r.t)("errors.required")),a.wholeShares||(l.wholeShares=(0,r.t)("errors.required")),a.soldShares?+a.soldShares>+a.wholeShares&&(l.soldShares=(0,r.t)("errors.soldSharesCanNotBeMoreThanWholeShares")):l.soldShares=(0,r.t)("errors.required"),l},onSubmit:e=>{if(_)return;const a=[...L];e.year=s()(e.year).format("YYYY"),e.label=$.find(a=>a.buildCode===e.item).buildDesc,a.push(e),q(a),D((0,g.Te)((0,r.t)("common.saved"))),setTimeout(()=>{D((0,g.Te)(""))},3e3),Y.resetForm()}});(0,c.useEffect)(()=>{S||(D((0,g.Xf)({...I,hasBelongings:E,hasDemolishedBuilding:P,realtyBelongings:L,hasWell:Y.values.hasWell,physicalLandmarks:M})),L.length<1&&E&&!k?v(!0):v(!1))},[L,Y.values.hasWell,P,E,k,M]),(0,c.useEffect)(()=>{S||(E&&!k?L.length<1&&v(!0):v(!1))},[E,k]);const K=[{label:(0,r.t)("realtySelling.swimmingPool"),value:"swimmingPool"},{label:(0,r.t)("realtySelling.enterpriseValue"),value:"enterpriseValue"},{label:(0,r.t)("realtySelling.trees"),value:"trees"},{label:(0,r.t)("realtySelling.others"),value:"others"}],G=e=>{if(_)return;const a=[...L];a.splice(e,1),q(a),D((0,g.Te)((0,r.t)("common.deleted"))),setTimeout(()=>{D((0,g.Te)(""))},3e3)};return(0,c.useEffect)(()=>{if(!S){let e=1;C&&(e=(0,y.Q$)(null===T||void 0===T?void 0:T.landFlag)?1:0),(0,b.Jk)(e).then(e=>{B(e.data)})}q(I.realtyBelongings||[])},[]),(0,f.jsxs)(f.Fragment,{children:[!k&&(0,f.jsxs)(p.A,{title:(0,r.t)("realtySelling.landingBelongingsInformation"),afterText:N&&(null===T||void 0===T?void 0:T.pRandom),children:[(0,f.jsx)(h.A,{children:(0,f.jsx)(m.A,{title:(0,r.t)("realtySelling.hasBelonings"),required:!0,double:!0,formik:Y,name:"hasBelongings",type:"radio",value:E,onChange:e=>!_&&O(e.value),options:[{optionValue:!0,title:(0,r.t)("common.yes")},{optionValue:!1,title:(0,r.t)("common.no")}],disabled:_})}),E&&!k&&(0,f.jsxs)(f.Fragment,{children:[!S&&(0,f.jsx)("form",{onSubmit:Y.handleSubmit,className:"row",children:(0,f.jsxs)(h.A,{children:[(0,f.jsx)(m.A,{title:(0,r.t)("realtySelling.constructionType"),required:!0,formik:Y,name:"item",type:"select",value:Y.values.item,onChange:Y.handleChange,options:$.length?$:[],optionLabel:"buildDesc",optionValue:"buildCode",filterBy:"buildDesc",double:!0,disabled:_}),(0,f.jsx)(m.A,{title:(0,r.t)("realtySelling.buildingArea"),required:!0,formik:Y,name:"area",keyfilter:"pnum",min:1,maxLength:10,value:Y.values.area,onChange:Y.handleChange,afterText:(0,r.t)("realtySelling.meterSequare"),disabled:_}),(0,f.jsx)(m.A,{title:(0,r.t)("realtySelling.constructionYear"),required:!0,formik:Y,name:"year",type:"date",keyfilter:"pnum",min:1,max:new Date,year:!0,readOnlyInput:!0,value:Y.values.year,onChange:e=>{Y.handleChange(e)},disabled:_}),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(m.A,{title:(0,r.t)("realtySelling.wholeShares"),required:!0,formik:Y,name:"wholeShares",keyfilter:"pnum",value:Y.values.wholeShares,onChange:Y.handleChange,disabled:_}),(0,f.jsx)(m.A,{title:A?(0,r.t)("realtySelling.soldShares"):(0,r.t)("OwnershipTransfer.willDocumentation.ownerShare"),required:!0,formik:Y,name:"soldShares",keyfilter:"pnum",value:Y.values.soldShares,onChange:Y.handleChange,disabled:_})]}),(0,f.jsx)(m.A,{type:"button",buttonType:"submit",label:(0,r.t)("realtySelling.add"),disabled:_})]})}),(0,f.jsx)(d.b,{className:"realty-table fm-kufi-regular",tableClassName:"w-100",value:L,responsiveLayout:"scroll",emptyMessage:(0,r.t)("common.noResultsFound"),children:z.map(e=>(0,f.jsx)(i.V,{field:e.key,header:e.label,body:e.body?e.body:null,hidden:e.hidden},e.key))})]}),w&&(0,f.jsx)(f.Fragment,{children:(0,f.jsx)(h.A,{children:(0,f.jsx)(m.A,{title:(0,r.t)("realtySelling.hasDemolishedBuilding"),required:!0,double:!0,formik:Y,name:"hasDemolishedBuilding",type:"radio",value:P,onChange:e=>{_||V(e.value)},options:[{optionValue:!0,title:(0,r.t)("common.yes")},{optionValue:!1,title:(0,r.t)("common.no")}],disabled:_})})}),(0,f.jsx)(h.A,{title:(0,r.t)("realtySelling.additionalOtherBelongings"),children:(0,f.jsx)(m.A,{title:(0,r.t)("realtySelling.valueAdditionalOtherBelongings"),info:K.map(e=>e.label).join(", "),formik:Y,double:!0,name:"hasBelongings",keyfilter:"pnum",value:I.additionalBelongingsValue||"",onChange:e=>{_||isNaN(+e.target.value)||D((0,g.Xf)({...I,additionalBelongingsValue:e.target.value,hasBelongings:E,hasDemolishedBuilding:P}))},disabled:_,afterText:(0,r.t)("realtySelling.jod")})})]}),!j&&"LAND"===(null===(x=I.propertyData)||void 0===x?void 0:x.landFlag)&&(0,f.jsx)(p.A,{title:(0,r.t)("realtySelling.hasWell"),afterText:N&&(null===T||void 0===T?void 0:T.pRandom),children:(0,f.jsx)(h.A,{children:(0,f.jsx)(m.A,{title:(0,r.t)("realtySelling.hasWell?"),required:!0,double:!0,formik:Y,name:"hasWell",type:"radio",value:Y.values.hasWell,onChange:e=>{_||Y.handleChange(e)},options:[{optionValue:!0,title:(0,r.t)("common.yes")},{optionValue:!1,title:(0,r.t)("common.no")}],disabled:_})})}),k&&(0,f.jsxs)(p.A,{title:(0,r.t)("realtySelling.physicalLandmarksOnGround"),afterText:N&&(null===T||void 0===T?void 0:T.pRandom),children:[(0,f.jsx)(h.A,{children:(0,f.jsx)(m.A,{withoutLabel:!0,fullWidth:!0,name:"physicalLandmarks",type:"checkbox",value:[M.buildings&&"buildings",M.fences&&"fences",M.shrubs&&"shrubs",M.settlementIron&&"settlementIron",M.waterWell&&"waterWell",M.railway&&"railway",M.houriaChains&&"houriaChains",M.waterCanal&&"waterCanal",M.valley&&"valley",M.none&&"none",M.other&&"other"].filter(
176Boolean),onChange:e=>{if(_)return;const a=e.value,l=a.includes("none"),t=M.none;W(l&&!t?{...M,buildings:!1,fences:!1,shrubs:!1,settlementIron:!1,waterWell:!1,railway:!1,houriaChains:!1,waterCanal:!1,valley:!1,other:!1,none:!0,otherText:""}:{...M,buildings:a.includes("buildings"),fences:a.includes("fences"),shrubs:a.includes("shrubs"),settlementIron:a.includes("settlementIron"),waterWell:a.includes("waterWell"),railway:a.includes("railway"),houriaChains:a.includes("houriaChains"),waterCanal:a.includes("waterCanal"),valley:a.includes("valley"),other:a.includes("other"),none:!1,otherText:a.includes("other")?M.otherText:""})},disabled:_,labelClassName:"d-inline",options:[{optionValue:"buildings",label:(0,r.t)("realtySelling.buildings")},{optionValue:"fences",label:(0,r.t)("realtySelling.fences")},{optionValue:"shrubs",label:(0,r.t)("realtySelling.shrubs")},{optionValue:"settlementIron",label:(0,r.t)("realtySelling.settlementIron")},{optionValue:"waterWell",label:(0,r.t)("realtySelling.waterWell")},{optionValue:"railway",label:(0,r.t)("realtySelling.railway")},{optionValue:"houriaChains",label:(0,r.t)("realtySelling.houriaChains")},{optionValue:"waterCanal",label:(0,r.t)("realtySelling.waterCanal")},{optionValue:"valley",label:(0,r.t)("realtySelling.valley")},{optionValue:"other",label:(0,r.t)("realtySelling.other")},{optionValue:"none",label:(0,r.t)("realtySelling.none")}]})}),M.other&&(0,f.jsx)(h.A,{children:(0,f.jsx)(m.A,{title:(0,r.t)("realtySelling.otherDetails"),formik:Y,name:"otherText",type:"textarea",double:!0,value:M.otherText,onChange:e=>{_||W({...M,otherText:e.target.value})},disabled:_})})]})]})}},65855(e,a,l){l.d(a,{A:()=>g});var t=l(65043),r=l(49092),n=l(73103),s=l(9255),o=l(90799),i=l(21691),d=l(87668),c=l(98595),u=l(75357),m=l(82113),h=l(72018),p=l(70579);function y(e){let{withoutFrame:a,children:l}=e;const{t:t}=(0,r.B)();return a?(0,p.jsx)(p.Fragment,{children:l}):(0,p.jsx)(i.A,{title:t("realtySelling.clearnaceTitle"),children:l})}function g(e){let{demo:a,propertyData:l,formik:i,withoutFrame:g,apartments:b,alwaysCheck:f,refund:x,oldData:v,pdfClearance:S,realtyNeedsClearance:N,transmission:j}=e;const{t:A}=(0,r.B)(),C=(0,n.wA)(),w=(0,n.d4)(e=>e.sellingFormDetails),[k,D]=(0,t.useState)(!1),[I,T]=(0,t.useState)({}),[F,R]=(0,t.useState)(!0),[_,E]=(0,t.useState)(!0);(0,t.useEffect)(()=>{if(void 0!==N)return void R(!1);if(f||!(0,c.lQ)(l.prcL_TYPE))return void R(!1);const e=`${(0,c.Wj)(l.vilL_CODE,4)}${(0,c.Wj)(l.hoD_CODE,3)}${(0,c.Wj)(l.secT_CODE,3)}${(0,c.Wj)(l.parC_NO,5)}`;e&&l&&l.vilL_CODE&&l.hoD_CODE&&l.secT_CODE&&l.parC_NO?(0,m.Bg)(e).then(e=>{const a=null===e||void 0===e?void 0:e.data,l=Array.isArray(a)?a.length>0:!!a;E(l)}).catch(()=>{E(!1)}).finally(()=>{R(!1)}):R(!1)},[f,l.hoD_CODE,l.parC_NO,l.prcL_TYPE,l.secT_CODE,l.vilL_CODE,N]);const O=void 0!==N?N:!F&&(!!f||(0,c.lQ)(l.prcL_TYPE)&&_),P=()=>{const e=[];
176return i.values.selectedShares.forEach(a=>{e.push(a.partyId)}),e.join(",")};return(0,p.jsx)(p.Fragment,{children:O&&(0,p.jsxs)(y,{withoutFrame:g,children:[i.values.isGam?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.A,{children:(0,p.jsx)(s.A,{title:A("realtySelling.clearnace"),info:A("realtySelling.clearnaceTooltip"),required:!0,double:!0,formik:i,name:"clearanceNumber",keyfilter:"pnum",value:i.values.clearanceNumber||"",disabled:a,onChange:e=>{i.setFieldValue("isValidClearance",!1),i.setFieldValue("clearanceNumber",e.target.value),D(!1)},onBlur:i.handleBlur,afterButton:{label:A("OwnershipTransfer.FinanceLease.checkClearance"),disabled:!i.values.clearanceNumber||a,onClick:()=>{i.values.selectedShares.length>0?(i.setFieldValue("isClearanceSearched",!0),P(),(0,m.Yn)(l.pRandom,i.values.clearanceNumber,P()).then(e=>{const{data:a}=e,{isInnocent:l,sourceCode:t,sourceDesc:r}=a;T({sourceCode:t,sourceDesc:r}),D(!0),l?i.setFieldValue("isValidClearance",!0):"GAM"!==t&&"GAM"!==r?i.setFieldValue("isGam",!1):j?i.setFieldValue("isValidClearance",!0):i.setFieldValue("isValidClearance",!1)})):(i.setFieldValue("isValidClearance",!1),C((0,u.Qg)(A("errors.chooseSellersShareFirst"))))}}})}),i.values.isValidClearance&&(0,p.jsx)("p",{className:"text-main-color text-sm fm-kufi-bold",children:A("realtySelling.clearanceIsActive")})]}):(0,p.jsxs)("div",{className:"mb-4",children:[(0,p.jsxs)("div",{className:"col-lg-3 col-sm-6 offset-lg-9 form-inputs",children:[(0,p.jsx)(d.A,{accept:S&&".pdf",typeError:S&&A("errors.onlyTypes",{types:"pdf"}),allowedExtentions:S&&["application/pdf"],uploadLabel:A("realtySelling.clearnace"),uploadedImage:x?(()=>{var e;return(null===(e=JSON.parse(w.tempAttach.clearanceAttachment||"{}"))||void 0===e?void 0:e.value)||""})():i.values.clearanceAttachment,onUploadFile:e=>{i.setFieldValue("clearanceAttachment",e)},disabled:a}),(V="clearanceAttachment",(e=>!(!i.touched[e]||!i.errors[e]))(V)&&(0,p.jsx)("small",{className:"p-error text-xs",children:i.errors[V]}))]}),(0,p.jsx)(h.$,{type:"button",onClick:()=>{i.setFieldValue("clearanceAttachment",""),i.setFieldValue("isGam","true"),D(!1)},className:"action-btn back-btn my-2 m-md-2 fm-kufi-regular text-sm",children:A("common.cancel")})]}),(k||i.values.clearanceAttachment)&&!i.values.isValidClearance&&(0,p.jsx)("p",{className:"text-danger text-sm fm-kufi-bold",children:i.values.isGam?A("realtySelling.clearanceIncorrect"):A("realtySelling.attachClearanceFrom",{auth:(0,c.vK)(I)})}),b?(0,p.jsx)(o.A,{children:(0,p.jsx)(s.A,{title:A("Efraz.Common.isBuildingComplete"),required:!0,fullWidth:!0,name:"isBuildingComplete",formik:i,type:"radio",value:i.values.isBuildingComplete,onChange:i.handleChange,onBlur:i.onBlur,options:[{optionValue:!0,title:A("common.yes")},{optionValue:!1,title:A("common.no")}],disabled:a})}):null]})});var V}},72208(e,a,l){l.d(a,{A:()=>h});var t=l(65043),r=l(49092),n=l(9255),s=l(90799),o=l(21691),i=l(87668),d=l(67694),c=l(73103),u=l(70579);function m(e){let{withoutFrame:a,children:l}=e;const{t:t}=(0,r.B)();return a?(0,u.jsx)(u.Fragment,{children:l}):(0,u.jsx)(o.A,{title:t("realtySelling.hodClearance"),children:l})}function h(e){let{hodMandatory:a,demo:l,formik:o,withoutFrame:h,refund:p}=e;const[y,g]=(0,t.useState)([]),b=(0,c.d4)(e=>e.sellingFormDetails),{t:f}=(0,r.B)();(0,t.useEffect)(()=>{a&&!l&&d.m.getHodClearanceIssuer().then(e=>{let{data:a}=e;g(a)})},[a]);return console.log("hodMandatory",a),(0,u.jsx)(u.Fragment,{children:a&&(0,u.jsxs)(m,{withoutFrame:h,children:[(0,u.jsxs)(s.A,{children:[(0,u.jsx)(n.A,{title:f("realtySelling.hodClearanceNo"),required:!0,formik:o,name:"hodClearanceNo",maxLength:15,value:o.values.hodClearanceNo,onChange:e=>{const a=e.target.value.replace(/\s/g,"");o.setFieldValue("hodClearanceNo",a)},disabled:l}),(0,u.jsx)(n.A,{title:f("realtySelling.hodClearanceDate"),required:!0,formik:o,name:"hodClearanceDate",type:"date",maxLength:15,value:o.values.hodClearanceDate,onChange:o.handleChange,max:new Date,disabled:l}),(0,u.jsx)(n.A,{title:f("realtySelling.hodClearanceIssuer"),required:!0,double:!0,formik:o,name:"hodClearanceIssuer",type:null!==y&&void 0!==y&&y.length?"select":"text",maxLength:15,value:o.values.hodClearanceIssuer,onChange:o.handleChange,options:y,optionLabel:"agreeBookDesc",optionValue:"agreeBookDesc",filterBy:"agreeBookDesc",disabled:l})]}),(0,u.jsx)(s.A,{children:(0,u.jsxs)("div",{className:"col-lg-3 col-md-6 mb-4 d-flex flex-column justify-content-between",children:[(0,u.jsxs)("label",{className:"block text-xs fm-kufi-regular text-form-label",children:[f("realtySelling.hodClearanceAttach")," ",(0,u.jsx)("span",{className:"text-danger",children:"*"})]}),(0,u.jsx)(i.A,{name:"hodClearance",uploadLabel:f("realtySelling.uploadFile"),onUploadFile:e=>{o.setFieldValue("hodClearance",e)},uploadedImage:p?(()=>{var e;return(null===(e=JSON.parse(b.tempAttach.hodClearance||"{}"))||void 0===e?void 0:e.value)||""})():o.values.hodClearance,disabled:l}),(x="hodClearance",(e=>!(!o.touched[e]||!o.errors[e]))(x)&&(0,u.jsx)("small",{className:"p-error text-xs",children:o.errors[x]}))]})})]})});var x}},62029(e,a,l){l.r(a);const t=(0,l(64091).I)().services.find(e=>"exchange"===e.name),r=t.serviceTitle,n=t.desc,s=t.descriptionUrl,o=t.requirementsUrl,i=t.userManualUrl,d=t.startUrl;l.d(a,["DD",0,r,"Ln",0,o,"h_",0,s,"i8",0,n,"jW",0,i,"ni",0,d])},44539(e,a,l){l.r(a),l.d(a,{default:()=>ie});var t=l(44978),r=l(72018),n=l(70828),s=l(65043),o=l(73103),i=l(73216),d=l(56091),c=l(98595),u=l(80045),m=l(75357),h=l(82113),p=l(23519),y=l(23253),g=l(53840),b=l(51604),f=l(58924),x=l(91613),v=l(77627),S=l(86178),N=l.n(S),j=l(9642),A=l(81931),C=(l(61135),l(9255)),w=l(90799),k=l(21691),D=l(70579);function I(e){var a,l,n;let{onDisableNext:i,demo:d}=e;const u=(0,o.wA)(),p=(0,o.d4)(e=>e.sellingFormDetails),{exchangedProperty:y}
176=p,[g,b]=(0,s.useState)((null===(a=y[0])||void 0===a?void 0:a.hasBelongings)||!1),[f,x]=(0,s.useState)((null===(l=y[0])||void 0===l?void 0:l.hasDemolishedBuilding)||!1),[S,I]=(0,s.useState)([]),[T,F]=(0,s.useState)([]),R=[{label:(0,t.t)("realtySelling.constructionType"),key:"label"},{label:(0,t.t)("realtySelling.buildingArea"),key:"area"},{label:(0,t.t)("realtySelling.constructionYear"),key:"year"},{label:(0,t.t)("realtySelling.sharesRatio"),key:"sharesRatio",body:e=>`${e.wholeShares} / ${e.soldShares}`},{label:"",key:"action",body:(e,a)=>{let{rowIndex:l}=a;return(0,D.jsx)(r.$,{icon:"pi pi-trash text-danger text-sm",onClick:()=>O(l),disabled:d,className:"p-button-rounded bg-transparent outline-none"})},hidden:d}],_=(0,v.Wx)({initialValues:{item:"",area:"",year:"",wholeShares:"",soldShares:"",buildingType:""},validate:e=>{let a={};return e.item||(a.item=(0,t.t)("errors.required")),e.area?e.area<1?a.area=(0,t.t)("errors.areaMoreThanZero"):isNaN(+e.area)&&(a.area=(0,t.t)("errors.enterValidNumber")):a.area=(0,t.t)("errors.required"),e.year||(a.year=(0,t.t)("errors.required")),e.wholeShares||(a.wholeShares=(0,t.t)("errors.required")),e.soldShares?+e.soldShares>+e.wholeShares&&(a.soldShares=(0,t.t)("errors.soldSharesCanNotBeMoreThanWholeShares")):a.soldShares=(0,t.t)("errors.required"),a},onSubmit:e=>{const a=[...T];e.year=N()(e.year).format("YYYY"),e.label=S.find(a=>a.buildCode===e.item).buildDesc,a.push(e),F(a),u((0,m.Te)((0,t.t)("common.saved"))),setTimeout(()=>{u((0,m.Te)(""))},3e3),_.resetForm()}});(0,s.useEffect)(()=>{d||(u((0,m.Xf)({...p,exchangedProperty:[{...p.exchangedProperty[0],hasBelongings:g,hasDemolishedBuilding:f,realtyBelongings:T}]})),T.length<1&&g?i(!0):i(!1))},[T,g,f]),(0,s.useEffect)(()=>{d||(g?T.length<1&&i(!0):i(!1))},[g]);const E=[{label:(0,t.t)("realtySelling.swimmingPool"),value:"swimmingPool"},{label:(0,t.t)("realtySelling.enterpriseValue"),value:"enterpriseValue"},{label:(0,t.t)("realtySelling.trees"),value:"trees"},{label:(0,t.t)("realtySelling.others"),value:"others"}],O=e=>{const a=[...T];a.splice(e,1),F(a),u((0,m.Te)((0,t.t)("common.deleted"))),setTimeout(()=>{u((0,m.Te)(""))},3e3)};return(0,s.useEffect)(()=>{var e;if(!d){var a;const e=(0,c.Q$)(null===(a=y[0])||void 0===a?void 0:a.landFlag)?1:0;(0,h.Jk)(e).then(e=>{I(e.data)})}F((null===(e=y[0])||void 0===e?void 0:e.realtyBelongings)||[])},[]),(0,D.jsx)(D.Fragment,{children:(0,D.jsxs)(k.A,{title:(0,t.t)("realtySelling.landingBelongingsInformation"),afterText:y[0].pRandom,children:[(0,D.jsx)(w.A,{children:(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.hasBelonings"),required:!0,double:!0,formik:_,name:"hasBelongings",type:"radio",value:g,onChange:e=>b(e.value),options:[{optionValue:!0,title:(0,t.t)("common.yes")},{optionValue:!1,title:(0,t.t)("common.no")}],disabled:d})}),g&&(0,D.jsxs)(D.Fragment,{children:[!d&&(0,D.jsx)("form",{onSubmit:_.handleSubmit,className:"row",children:(0,D.jsxs)(w.A,{children:[(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.constructionType"),required:!0,formik:_,name:"item",type:"select",value:_.values.item,onChange:_.handleChange,options:S.length?S.filter(e=>T.find(a=>a.item===e.buildCode)?null:e):[],optionLabel:"buildDesc",optionValue:"buildCode",filterBy:"buildDesc"}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.buildingArea"),required:!0,formik:_,name:"area",keyfilter:"pnum",min:1,maxLength:10,value:_.values.area,onChange:_.handleChange,afterText:(0,t.t)("realtySelling.meterSequare")}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.constructionYear"),required:!0,formik:_,name:"year",type:"date",keyfilter:"pnum",min:1,max:new Date,year:!0,value:_.values.year,onChange:_.handleChange}),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.wholeShares"),required:!0,formik:_,name:"wholeShares",keyfilter:"pnum",value:_.values.wholeShares,onChange:_.handleChange}),(0,D.jsx)(C.A,{title:(0,t.t)("OwnershipTransfer.willDocumentation.ownerShare"),required:!0,formik:_,name:"soldShares",keyfilter:"pnum",value:_.values.soldShares,onChange:_.handleChange})]}),(0,D.jsx)(C.A,{type:"button",buttonType:"submit",label:(0,t.t)("realtySelling.add")})]})}),(0,D.jsx)(A.b,{className:"realty-table fm-kufi-regular",tableClassName:"w-100",value:T,responsiveLayout:"scroll",emptyMessage:(0,t.t)("common.noResultsFound"),children:R.map(e=>(0,D.jsx)(j.V,{field:e.key,header:e.label,body:e.body?e.body:null,hidden:e.hidden},e.key))})]}),(0,D.jsx)(w.A,{title:(0,t.t)("realtySelling.additionalOtherBelongings"),children:(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.valueAdditionalOtherBelongings"),info:E.map(e=>e.label).join(", "),formik:_,double:!0,name:"hasBelongings",keyfilter:"pnum",value:(null===(n=y[0])||void 0===n?void 0:n.additionalBelongingsValue)||"",onChange:e=>{isNaN(+e.target.value)||u((0,m.Xf)({...p,exchangedProperty:[{...p.exchangedProperty[0],additionalBelongingsValue:e.target.value,hasBelongings:g,hasDemolishedBuilding:f}]}))},disabled:d,afterText:(0,t.t)("realtySelling.jod")})})]})})}var T=l(11351),F=l(48024),R=l(62029),_={};l.r(_),l.d(_,{desc:()=>R.i8,description:()=>R.h_,manual:()=>R.jW,requirements:()=>R.Ln,start:()=>R.ni,title:()=>R.DD});var E=l(37944),O=l(87668);function P(e){let{onDisableNext:a,demo:l,refund:r}=e;const n=(0,o.wA)(),i=(0,o.d4)(e=>e.sellingFormDetails),{exchangedProperty:d}=i;function c(e){return function(){let e=arguments.length>1?arguments[1]:void 0,a=0;return(arguments.length>
1760&&void 0!==arguments[0]?arguments[0]:[]).forEach(l=>{e(l)&&a++}),a}(e,e=>N()().diff(N()(e.card_expiry))>0)}function u(e,a,l){const r=[],n=c(a);for(let s=0;s<n;s++)r.push({name:`${(0,t.t)("realtySelling.militaryDesignationCertificateForOwner")} ${s+1}`,file:e[`${l}${s+1}`],key:`${l}${s+1}`});return r}const h=(0,v.Wx)({initialValues:(()=>{var e,a,l,t,n;if(r){var s,o,u,m,h;function y(e,a){const l={};for(let r=0;r<c(e);r++){var t;l[`${a}${r+1}`]=(null===(t=JSON.parse(i.tempAttach[`${a}${r+1}`]||"{}"))||void 0===t?void 0:t.value)||""}return l}return{arrangementPlan:(null===(s=JSON.parse(i.tempAttach.arrangementPlan||"{}"))||void 0===s?void 0:s.value)||"",[`wellClearance_${i.propertyData.pRandom}`]:(null===(o=JSON.parse(i.tempAttach[`wellClearance_${i.propertyData.pRandom}`]||"{}"))||void 0===o?void 0:o.value)||"",[`wellClearance_${d[0].pRandom}`]:(null===(u=JSON.parse(i.tempAttach[`wellClearance_${d[0].pRandom}`]||"{}"))||void 0===u?void 0:u.value)||"",[`electricityClearance_${i.propertyData.pRandom}`]:(null===(m=JSON.parse(i.tempAttach[`electricityClearance_${i.propertyData.pRandom}`]||"{}"))||void 0===m?void 0:m.value)||"",[`electricityClearance_${d[0].pRandom}`]:(null===(h=JSON.parse(i.tempAttach[`electricityClearance_${d[0].pRandom}`]||"{}"))||void 0===h?void 0:h.value)||"",...y(i.selectedShares,`militaryDesignationCertificateForOwner_${i.propertyData.pRandom}`),...y(d[0].selectedShares,`militaryDesignationCertificateForOwner_${d[0].pRandom}`)}}function p(e,a,l){const t={};for(let n=0;n<c(a);n++){var r;t[`${l}${n+1}`]=(null===(r=i.attachments[e+n])||void 0===r?void 0:r.file)||""}return t}return{arrangementPlan:(null===(e=i.attachments[2])||void 0===e?void 0:e.file)||"",[`wellClearance_${i.propertyData.pRandom}`]:(null===(a=i.attachments[3])||void 0===a?void 0:a.file)||"",[`wellClearance_${d[0].pRandom}`]:(null===(l=i.attachments[4])||void 0===l?void 0:l.file)||"",[`electricityClearance_${i.propertyData.pRandom}`]:(null===(t=i.attachments[5])||void 0===t?void 0:t.file)||"",[`electricityClearance_${d[0].pRandom}`]:(null===(n=i.attachments[6])||void 0===n?void 0:n.file)||"",...p(7,i.selectedShares,`militaryDesignationCertificateForOwner_${i.propertyData.pRandom}`),...p(7+c(i.selectedShares),d[0].selectedShares,`militaryDesignationCertificateForOwner_${d[0].pRandom}`)}})(),validate:e=>{let a={};"3"===i.propertyData.prcL_TYPE||e.arrangementPlan||(a.arrangementPlan=(0,t.t)("errors.required")),i.propertyData.isLandContainWell&&(e[`wellClearance_${i.propertyData.pRandom}`]||(a[`wellClearance_${i.propertyData.pRandom}`]=(0,t.t)("errors.required"))),d[0].isLandContainWell&&(e[`wellClearance_${d[0].pRandom}`]||(a[`wellClearance_${d[0].pRandom}`]=(0,t.t)("errors.required")));for(let l=0;l<c(i.selectedShares);l++)e[`militaryDesignationCertificateForOwner_${i.propertyData.pRandom}${l+1}`]||(a[`militaryDesignationCertificateForOwner_${i.propertyData.pRandom}${l+1}`]=(0,t.t)("errors.required"));for(let l=0;l<c(d[0].selectedShares);l++)e[`militaryDesignationCertificateForOwner_${d[0].pRandom}${l+1}`]||(a[`militaryDesignationCertificateForOwner_${d[0].pRandom}${l+1}`]=(0,t.t)("errors.required"));return a},onSubmit:e=>{n((0,m.Xf)({...i,attachments:[{name:(0,t.t)("realtySelling.qoshan"),file:e.qoshan,key:"qoshan"},{name:(0,t.t)("realtySelling.landPlan"),file:e.landPlan,key:"landPlan"},{name:(0,t.t)("realtySelling.arrangementPlan"),file:e.arrangementPlan,key:"arrangementPlan"},{name:(0,t.t)("realtySelling.wellClearance"),file:e[`wellClearance_${i.propertyData.pRandom}`],key:`wellClearance_${i.propertyData.pRandom}`},{name:(0,t.t)("realtySelling.wellClearance"),file:e[`wellClearance_${d[0].pRandom}`],key:`wellClearance_${d[0].pRandom}`},{name:(0,t.t)("realtySelling.electricityClearance"),file:e[`electricityClearance_${i.propertyData.pRandom}`],key:`electricityClearance_${i.propertyData.pRandom}`},{name:(0,t.t)("realtySelling.electricityClearance"),file:e[`electricityClearance_${d[0].pRandom}`],key:`electricityClearance_${d[0].pRandom}`},...u(e,i.selectedShares,`militaryDesignationCertificateForOwner_${i.propertyData.pRandom}`),...u(e,d[0].selectedShares,`militaryDesignationCertificateForOwner_${d[0].pRandom}`)]})),a(!1)}});return(0,s.useEffect)(()=>
176{a(!0),h.isValid&&h.submitForm()},[h.values]),(0,D.jsx)(D.Fragment,{children:(0,D.jsxs)(k.A,{title:(0,t.t)("realtySelling.requiredDocuments"),icon:(0,D.jsx)(E.h,{width:"25"}),children:[(0,D.jsxs)(w.A,{children:[(0,D.jsxs)("div",{className:"col-lg-3 col-sm-12 mb-4 form-inputs d-flex flex-column justify-content-between",children:[(0,D.jsxs)("label",{className:"block text-xs fm-kufi-regular text-form-label",children:[(0,t.t)("realtySelling.arrangementPlan")," ","3"===i.propertyData.prcL_TYPE?null:(0,D.jsx)("span",{className:"text-danger",children:"*"})]}),(0,D.jsx)(O.A,{name:"arrangementPlan",uploadLabel:(0,t.t)("realtySelling.uploadFile"),onUploadFile:e=>{h.setFieldValue("arrangementPlan",e)},uploadedImage:h.values.arrangementPlan,disabled:l})]}),i.propertyData.isLandContainWell&&(0,D.jsxs)("div",{className:"col-lg-3 col-sm-12 mb-4 form-inputs d-flex flex-column justify-content-between",children:[(0,D.jsxs)("label",{className:"block text-xs fm-kufi-regular text-form-label",children:[(0,t.t)("realtySelling.wellClearance")," ",(0,D.jsx)("span",{className:"",dir:"ltr",children:i.propertyData.pRandom})," ",(0,D.jsx)("span",{className:"text-danger",children:"*"})]}),(0,D.jsx)(O.A,{name:`wellClearance_${i.propertyData.pRandom}`,uploadLabel:(0,t.t)("realtySelling.uploadFile"),onUploadFile:e=>{h.setFieldValue(`wellClearance_${i.propertyData.pRandom}`,e)},uploadedImage:h.values[`wellClearance_${i.propertyData.pRandom}`],disabled:l})]}),d[0].isLandContainWell&&(0,D.jsxs)("div",{className:"col-lg-3 col-sm-12 mb-4 form-inputs d-flex flex-column justify-content-between",children:[(0,D.jsxs)("label",{className:"block text-xs fm-kufi-regular text-form-label",children:[(0,t.t)("realtySelling.wellClearance")," ",(0,D.jsx)("span",{dir:"ltr",children:d[0].pRandom})," ",(0,D.jsx)("span",{className:"text-danger",children:"*"})]}),(0,D.jsx)(O.A,{name:`wellClearance_${d[0].pRandom}`,uploadLabel:(0,t.t)("realtySelling.uploadFile"),onUploadFile:e=>{h.setFieldValue(`wellClearance_${d[0].pRandom}`,e)},uploadedImage:h.values[`wellClearance_${d[0].pRandom}`],disabled:l})]}),Array.from({length:c(i.selectedShares)},(e,a)=>(0,D.jsxs)("div",{className:"col-lg-3 col-sm-12 mb-4 form-inputs d-flex flex-column justify-content-between",children:[(0,D.jsxs)("label",{className:"block text-xs fm-kufi-regular text-form-label",children:[(0,t.t)("realtySelling.militaryDesignationCertificateForOwner")," ",a+1," ",(0,D.jsx)("span",{className:"",dir:"ltr",children:i.propertyData.pRandom})," ",(0,D.jsx)("span",{className:"text-danger",children:"*"})]}),(0,D.jsx)(O.A,{name:`militaryDesignationCertificateForOwner_${i.propertyData.pRandom}${a+1}`,uploadLabel:(0,t.t)("realtySelling.uploadFile"),onUploadFile:e=>{h.setFieldValue(`militaryDesignationCertificateForOwner_${i.propertyData.pRandom}${a+1}`,e)},uploadedImage:h.values[`militaryDesignationCertificateForOwner_${i.propertyData.pRandom}${a+1}`],disabled:l,accept:".jpg,.png,.jpeg,.gif",allowGif:!0,typeError:(0,t.t)("errors.onlyTypes",{types:"png, jpg, gif"}),allowedExtentions:["image/jpeg","image/jpg","image/png"]})]},a)),Array.from({length:c(d[0].selectedShares)},(e,a)=>(0,D.jsxs)("div",{className:"col-lg-3 col-sm-12 mb-4 form-inputs d-flex flex-column justify-content-between",children:[(0,D.jsxs)("label",{className:"block text-xs fm-kufi-regular text-form-label",children:[(0,t.t)("realtySelling.militaryDesignationCertificateForOwner")," ",a+1," ",(0,D.jsx)("span",{dir:"ltr",children:d[0].pRandom})," ",(0,D.jsx)("span",{className:"text-danger",children:"*"})]}),(0,D.jsx)(O.A,{name:`militaryDesignationCertificateForOwner_${d[0].pRandom}${a+1}`,uploadLabel:(0,t.t)("realtySelling.uploadFile"),onUploadFile:e=>{h.setFieldValue(`militaryDesignationCertificateForOwner_${d[0].pRandom}${a+1}`,e)},uploadedImage:h.values[`militaryDesignationCertificateForOwner_${d[0].pRandom}${a+1}`],disabled:l,accept:".jpg,.png,.jpeg,.gif",allowGif:!0,typeError:(0,t.t)("errors.onlyTypes",{types:"png, jpg, gif"}),allowedExtentions:["image/jpeg","image/jpg","image/png"]})]},a))]}),(0,D.jsx)(w.A,{children:(0,D.jsx)("p",{className:"text-warning",children:(0,t.t)("OwnershipTransfer.exchange.attachmentNote")})})]})})}var V=l(9180),$=l(29908);function B(e){var a;
176let{onUpdateFormData:l,onDisableNext:n,demo:i}=e;const d=(0,o.d4)(e=>e.sellingFormDetails.selectedShares),{buyersDetails:c,isTotalShares:u,buyerSellersMapper:h,accumilative:p,allShares:y,exchangedProperty:g,...b}=(0,o.d4)(e=>e.sellingFormDetails),f=(0,o.wA)(),[x,S]=(0,s.useState)(!1),[N,I]=(0,s.useState)(+b.expansionFactor||1),[T,F]=(0,s.useState)(+b.expansionFactor2||1),[R,_]=(0,s.useState)(null),[E,O]=(0,s.useState)(""),P=e=>{l({selectedShares:d,buyersDetails:c,isTotalShares:u,...e})},B=(0,v.Wx)({initialValues:{seller:{},seller2:{},buyer:{},sellerShares:"",seller2Shares:"",refernceShares:"",sellersShares:null===(a=d[0])||void 0===a?void 0:a.shareNo,shareDividend:"",relativity:"0",referenceLandShares:"",sellersLandShare:"",aqsamFlag:!1,landShareDividend:"",isShares:!1},validate:e=>{const a={};return e.seller.partyId?(e=>{for(let a=0;a<h.length;a++)if(e.seller2.partyId===h[a].seller2.partyId&&e.seller.partyId===h[a].seller.partyId)return!0})(e)&&null===R?(f((0,m.Qg)((0,t.t)("errors.exchangeBetweenDuplicateOwners"))),a.seller=(0,t.t)("errors.exchangeBetweenDuplicateOwners")):e.seller.partyId===e.seller2.partyId&&null===R&&(f((0,m.Qg)((0,t.t)("errors.exchangeBetweenSameOwner"))),a.seller=(0,t.t)("errors.exchangeBetweenSameOwner")):a.seller=(0,t.t)("errors.required"),e.seller2.partyId||(a.seller2=(0,t.t)("errors.required")),e.sellerShares?0===+e.sellerShares?a.sellerShares=(0,t.t)("errors.biggerThanZero"):(e=>{let a=0;for(let l=0;l<h.length;l++)if(e.seller.partyId===h[l].seller.partyId){if(+e.seller.ownShares*+N<+e.sellerShares)return!0;a+=+h[l].sellerShares}return null!==R?+e.seller.ownShares*+N<+e.sellerShares+(a-+h[R].sellerShares):+e.seller.ownShares*+N<+e.sellerShares+a})(e)&&(a.sellerShares=(0,t.t)("errors.exchangedShareMoreThanOwnerShare")):a.sellerShares=(0,t.t)("errors.required"),e.seller2Shares?0===+e.seller2Shares?a.seller2Shares=(0,t.t)("errors.biggerThanZero"):(e=>{let a=0;for(let l=0;l<h.length;l++)if(e.seller2.partyId===h[l].seller2.partyId){if(+e.seller2.ownShares*+T<+e.seller2Shares)return!0;a+=+h[l].seller2Shares}if(null!==R){if(+e.seller2.ownShares*+T<+e.seller2Shares+(a-+h[R].seller2Shares))return!0}else if(+e.seller2.ownShares*+T<+e.seller2Shares+a)return!0;return!1})(e)&&(a.seller2Shares=(0,t.t)("errors.exchangedShareMoreThanOwnerShare")):a.seller2Shares=(0,t.t)("errors.required"),a},onSubmit:e=>{let a=JSON.parse(JSON.stringify(h||[]));null!==R?a[R]={...e}:a.push(e),P({buyerSellersMapper:a,expansionFactor:N,expansionFactor2:T}),S(!1),B.resetForm(),_(null)}}),L=[{label:(0,t.t)("OwnershipTransfer.willDocumentation.ownerNationalId"),key:"sellerNationalId",body:e=>e.seller.partyId},{label:(0,t.t)("realtySelling.ownerName"),key:"sellerName",body:e=>e.seller.partyName},{label:(0,t.t)("OwnershipTransfer.exchange.exchangedShares"),key:"sellerShares",body:e=>e.sellerShares},{label:(0,t.t)("OwnershipTransfer.willDocumentation.ownerNationalId"),key:"buyerNationalId",body:e=>e.seller2.partyId},{label:(0,t.t)("realtySelling.ownerName"),key:"buyerName",body:e=>e.seller2.partyName},{label:(0,t.t)("OwnershipTransfer.exchange.exchangedShares"),key:"seller2Shares",body:e=>e.seller2Shares},{label:"",key:"actions",body:(e,a)=>{let{rowIndex:l}=a;return(0,D.jsxs)("div",{className:"d-flex",children:[(0,D.jsx)(r.$,{className:"p-button-rounded bg-transparent outline-none",icon:"pi pi-pencil text-main-color text-sm",style:{border:"none"},onClick:()=>(e=>{_(e),B.setValues(h[e]),S(!0)})(l),disabled:x}),(0,D.jsx)(r.$,{className:"p-button-rounded bg-transparent outline-none",icon:"pi pi-trash text-danger text-sm",style:{border:"none"},onClick:()=>(e=>{const a=h.filter((a,l)=>l!==e);P({buyerSellersMapper:a})})(l)})]})},hidden:i}];let q=(0,D.jsxs)(V.o,{children:[(0,D.jsxs)($.f,{children:[(0,D.jsx)(j.V,{header:d[0].pRandom,style:{direction:"ltr"},colSpan:3}),(0,D.jsx)(j.V,{header:g[0].selectedShares[0].pRandom,style:{direction:"ltr"},colSpan:3})]}),(0,D.jsx)($.f,{children:null===L||void 0===L?void 0:L.map(e=>(0,D.jsx)(j.V,{field:e.key,header:e.label,hidden:e.hidden},e.key))})]});return(0,s.useEffect)(()=>{let e=[],a=[];h.forEach(l=>{e.push(l.seller.partyId),a.push(l.seller2.partyId)});const l=d.length===new Set(e).size&&g[0].selectedShares.length===new Set(a
176).size;i||(O(!1===l?(0,t.t)("errors.mustExchangeBetweenAllOwners"):""),h.length&&!1!==l?n(!1):n(!0))},[h,i,n]),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(k.A,{title:(0,t.t)("OwnershipTransfer.exchange.exchangedShares"),children:[(0,D.jsx)(A.b,{className:"realty-table fm-kufi-regular",tableClassName:"w-100",value:h,responsiveLayout:"scroll",emptyMessage:(0,t.t)("common.noResultsFound"),headerColumnGroup:q,children:null===L||void 0===L?void 0:L.map(e=>(0,D.jsx)(j.V,{field:e.key,header:e.label,body:e.body?e.body:null,hidden:e.hidden},e.key))}),(0,D.jsxs)("div",{class:"d-flex mt-2 align-items-center",children:[(0,D.jsx)("span",{class:"fm-kufi-bold text-sm mx-1 my-2",children:(0,t.t)("OwnershipTransfer.exchange.property")}),(0,D.jsx)("span",{class:"fm-kufi-bold text-sm mx-1 my-2",dir:"ltr",children:d[0].pRandom})]}),(0,D.jsx)(w.A,{children:(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.expansionFactor"),required:!0,name:"expansionFactor",keyfilter:"pint",value:N,onChange:e=>{(/^[1-9]+\d*$/.test(e.target.value)||""===e.target.value)&&I(e.target.value)},disabled:h.length||i,maxLength:5,customError:N?"":(0,t.t)("errors.required"),info:(0,t.t)("common.expansionFactorNote")})}),(0,D.jsxs)("div",{class:"d-flex mt-2 align-items-center",children:[(0,D.jsx)("span",{class:"fm-kufi-bold text-sm mx-1 my-2",children:(0,t.t)("OwnershipTransfer.exchange.property")}),(0,D.jsx)("span",{class:"fm-kufi-bold text-sm mx-1 my-2",dir:"ltr",children:g[0].selectedShares[0].pRandom})]}),(0,D.jsx)(w.A,{children:(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.expansionFactor"),required:!0,name:"expansionFactor2",keyfilter:"pint",value:T,onChange:e=>{(/^[1-9]+\d*$/.test(e.target.value)||""===e.target.value)&&F(e.target.value)},disabled:h.length||i,maxLength:5,info:(0,t.t)("common.expansionFactorNote"),customError:T?"":(0,t.t)("errors.required")})}),E&&!i&&(0,D.jsx)("p",{className:"text-warning mt-2 mb-0",children:E})]}),!i&&(0,D.jsxs)(D.Fragment,{children:[x?null:(0,D.jsx)(r.$,{className:"add-buyer fm-kufi-regular text-sm offset-3",label:(0,t.t)("OwnershipTransfer.exchange.exchangeShare"),icon:"pi pi-plus",iconPos:"left",onClick:()=>{S(!0),_(null)}}),x&&(0,D.jsx)(k.A,{title:(0,t.t)("realtySelling.shareDetails"),children:(0,D.jsxs)("form",{className:"shares-form",onSubmit:B.handleSubmit,children:[(0,D.jsxs)("div",{class:"d-flex mt-2 align-items-center",children:[(0,D.jsx)("span",{class:"fm-kufi-bold text-sm mx-1 my-2",children:(0,t.t)("OwnershipTransfer.exchange.property")}),(0,D.jsx)("span",{class:"fm-kufi-bold text-sm mx-1 my-2",dir:"ltr",children:d[0].pRandom})]}),(0,D.jsxs)(w.A,{children:[(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.ownerName"),required:!0,double:!0,formik:B,name:"seller",filterBy:"label",type:"select",value:B.values.seller,onChange:e=>{B.handleChange(e)},options:d.map(e=>{const{salesAuthorizationAttachment:a,guardianshipAttachment:l,...t}=e;return t}).map(e=>({label:e.partyName,value:e})),optionLabel:"label",optionValue:"value"}),B.values.seller.ownShares&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(C.A,{title:(0,t.t)("OwnershipTransfer.exchange.exchangedShares"),formik:B,name:"sellerShares",value:B.values.sellerShares,keyfilter:"pint",onChange:e=>{B.handleChange(e)},disabled:i}),(0,D.jsx)(C.A,{title:(0,t.t)("OwnershipTransfer.exchange.ownerSharesWithExpansion"),value:+B.values.seller.ownShares*N,disabled:!0})]})]}),(0,D.jsxs)("div",{class:"d-flex mt-2 align-items-center",children:[(0,D.jsx)("span",{class:"fm-kufi-bold text-sm mx-1 my-2",children:(0,t.t)("OwnershipTransfer.exchange.property")}),(0,D.jsx)("span",{class:"fm-kufi-bold text-sm mx-1 my-2",dir:"ltr",children:g[0].selectedShares[0].pRandom})]}),(0,D.jsxs)(w.A,{children:[(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.ownerName"),required:!0,double:!0,formik:B,name:"seller2",filterBy:"label",type:"select",value:B.values.seller2,onChange:e=>{B.handleChange(e)},options:g[0].selectedShares.map(e=>{const{salesAuthorizationAttachment:a,guardianshipAttachment:l,...t}=e;return t}).map(e=>({label:e.partyName,value:e})),optionLabel:"label",optionValue:"value"}),B.values.seller2.ownShares&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(C.A,{title:(0,t.t)("OwnershipTransfer.exchange.exchangedShares"),formik:B,name:"seller2Shares",value:
176B.values.seller2Shares,keyfilter:"pint",onChange:e=>{B.handleChange(e)},disabled:i}),(0,D.jsx)(C.A,{title:(0,t.t)("OwnershipTransfer.exchange.ownerSharesWithExpansion"),value:+B.values.seller2.ownShares*T,disabled:!0})]})]}),(0,D.jsxs)("div",{className:"row justify-content-center my-4 submit-action gap-4",children:[(0,D.jsx)(r.$,{type:"submit",label:(0,t.t)("common.save"),className:"action-btn col-lg-2 col-sm-4 d-block h-fit submit-btn m-2 py-1 fm-kufi-regular text-sm"}),(0,D.jsx)(r.$,{onClick:()=>{S(!1)},className:"action-btn col-lg-2 d-block col-sm-4 h-fit py-1 back-btn m-2 fm-kufi-regular text-sm",children:(0,t.t)("common.cancel")})]})]})})]})]})}var L=l(26081),q=l(37195),M=(l(67694),l(4504)),W=l(54972),z=l(31892),Y=l(65855),K=l(72208),G=l(91468);const U=e=>{var a,l;const[n,d]=(0,s.useState)(!1),[u,p]=(0,s.useState)({}),[y,g]=(0,s.useState)(null),[b,f]=(0,s.useState)(!1),[x,S]=(0,s.useState)(null),[k,I]=(0,s.useState)(!1),[T,F]=(0,s.useState)({}),[R,_]=(0,s.useState)(!1),E=(0,o.wA)(),O=((0,i.Zp)(),(0,o.d4)(e=>e.sellingFormDetails)),P=O.exchangedProperty||[],[V,$]=(0,s.useState)((null===(a=P[0])||void 0===a?void 0:a.selectedShares)||[]),B=e=>{const a={...O,exchangedProperty:e};E((0,m.Xf)(a))},{realtyNeedsClearance:U}=(0,G.G)(T),Q=(0,v.Wx)({enableReinitialize:!0,initialValues:{pRandom:"",selectedShares:[],hodClearance:"",hodClearanceNo:"",hodClearanceDate:"",hodClearanceIssuer:"",clearanceNumber:"",isGam:!0,clearanceAttachment:"",isClearanceSearched:!1},validate:e=>{let a={};var l,r;return R&&(e.hodClearance||(a.hodClearance=(0,t.t)("errors.required")),e.hodClearanceNo||(a.hodClearanceNo=(0,t.t)("errors.required")),e.hodClearanceDate||(a.hodClearanceDate=(0,t.t)("errors.required")),e.hodClearanceIssuer||(a.hodClearanceIssuer=(0,t.t)("errors.required"))),""===e.pRandom?a.pRandom=(0,t.t)("errors.required"):(l=e.pRandom,P.find(e=>e.pRandom===l)&&(u.pRandom&&y>=0||(a.pRandom=(0,t.t)("Efraz.tawheed.specialNumberExists")))),0===e.selectedShares.length?a.selectedShares=(0,t.t)("errors.required"):(r=e.selectedShares).filter(e=>!1!==e.isAlive).length!==r.length&&(a.selectedShares=(0,t.t)("errors.sellerMustBeAlive",{type:"\u0627\u0644\u0645\u0627\u0644\u0643\u064a\u0646"})),U&&(e.isGam?e.clearanceNumber?!1===e.isClearanceSearched?a.clearanceNumber=(0,t.t)("errors.clearanceNotValid"):e.isValidClearance||(a.clearanceNumber=""):a.clearanceNumber=(0,t.t)("errors.required"):e.clearanceAttachment||(a.clearanceAttachment=(0,t.t)("errors.required"))),a},onSubmit:e=>{J(e)}});(0,s.useEffect)(()=>{e.demo||(P&&1!==P.length?(e.onDisableNext(!0),I(!1)):(e.onDisableNext(!1),I(!1)))},[P]),(0,s.useEffect)(()=>{e.demo||(0,h.Mw)(T.vilL_CODE,T.hoD_CODE,T.secT_CODE,T.parC_NO).then(e=>{_(e.data)})},[e.demo,T]);const J=a=>{if(u.pRandom&&y>=0){const e=[...P];e[y]=a,B(e)}else B([...P,a]);f(!1),p({}),g(null),e.onHidePageActions(!1),S(null),Q.resetForm()};(0,s.useEffect)(()=>{e.apartments&&Q.values.selectedShares.map(async e=>{await(0,h.Oz)(e.regNo,e.partyId).then(e=>{const{aqsamFlag:a}=e.data,l=!!a;l&&Q.setFieldValue("aqsamFlag",l)})})},[e.apartments,Q.values.selectedShares]);const H=e=>-1!==Q.values.selectedShares.findIndex(a=>a.partyId===e),X=e=>{Q.setFieldValue("isTotalShares",!1),E((0,m.Qg)(e))},Z=e=>{if("\u0645\u062a\u0648\u0641\u064a"===e.personStatus)return X((0,t.t)("errors.sellerMustBeAlive",{type:"\u0627\u0644\u0645\u0627\u0644\u0643"})),!1;N()().diff(N()(e.card_expiry))>0&&X((0,t.t)("errors.ownerSoldierWarning"));const a=e.internalReserve,l=e.externalReserve;return!(null!==a&&void 0!==a&&a.length||null!==l&&void 0!==l&&l.length)||(X((0,t.t)("errors.cantChooseShareWithReserve")),!1)},ee=[{label:"",key:"action",body:a=>(0,D.jsx)(W.S,{disabled:Q.values.isTotalShares||e.demo,name:"nationalId",value:a.partyId,className:(0,M.xW)({"custom-radio":!0,"p-invalid":!1}),onChange:e=>(e=>{if(Z(e)){let a=[...Q.values.selectedShares];H(e.partyId)&&!Q.values.isTotalShares?a=a.filter(a=>a.partyId!==e.partyId):a.push(e),Q.setFieldValue("selectedShares",[...a])}})(a),checked:H(a.partyId)}),show:!0},{label:(0,t.t)("realtySelling.nationalId"),key:"partyId",show:!0},{label:(0,t.t)("realtySelling.ownerName"),key:"partyName",show:!0},{label:(0,t.t)("realtySelling.apartmentShares"),key:"ownShares",body:e=>"FLAT"===e.landFlag?`${e.ownShares} / ${e.shareNo}`:"-",show:(()=>{let e=!1;
176return V.forEach(a=>{"FLAT"===a.landFlag&&(e=!0)}),e})()},{label:(0,t.t)("OwnershipTransfer.willDocumentation.ownerLandShares"),key:"landShares",body:e=>(0,c.Q$)(e.landFlag)?`${e.ownShares} / ${e.shareNo}`:"-",show:(()=>{let e=!1;return V.forEach(a=>{"LAND"===a.landFlag&&(e=!0)}),e})()},{label:(0,t.t)("realtySelling.personStatus"),key:"personStatus",body:e=>e.personStatus,show:!0},{label:(0,t.t)("realtySelling.internalActions"),key:"internalActions",body:e=>e.internalReserve&&e.internalReserve.length?(0,D.jsx)("span",{className:"text-primary cursor-pointer text-decoration-underline",children:`${(0,t.t)("realtySelling.thereIs")} ${e.internalReserve.length}`}):(0,t.t)("realtySelling.thereIsNot"),show:!0},{label:(0,t.t)("realtySelling.externalActions"),key:"externalActions",body:e=>e.externalReserve&&e.externalReserve.length?(0,D.jsx)("span",{className:"text-primary cursor-pointer text-decoration-underline",children:`${(0,t.t)("realtySelling.thereIs")} ${e.externalReserve.length}`}):(0,t.t)("realtySelling.thereIsNot"),show:!0}];return(0,s.useEffect)(()=>{n&&(Q.submitForm(),setTimeout(()=>{d(!1)},1e3))},[]),(0,s.useEffect)(()=>{Q.values.isTotalShares&&Q.values.selectedShares.length!==V.length&&!e.demo&&Q.setFieldValue("selectedShares",V.filter(e=>Z(e)))},[Q.values.isTotalShares]),(0,D.jsxs)(s.Fragment,{children:[(0,D.jsxs)(q.A,{className:"mt-4",children:[(0,D.jsx)("div",{className:"d-flex justify-content-between",children:(0,D.jsx)("p",{className:"fm-kufi-bold text-sm",children:(0,t.t)("OwnershipTransfer.exchange.exchangedPropertyInfo")})}),(0,D.jsx)(A.b,{emptyMessage:(0,t.t)("common.noResultsFound"),className:"realty-table fm-kufi-regular",tableClassName:"w-100",value:P,responsiveLayout:"scroll",children:[{label:(0,t.t)("realtySelling.realtyDirectorate"),key:"depT_ANAME",body:e=>e.depT_ANAME},{label:(0,t.t)("realtySelling.village"),key:"vilL_ANAME",body:e=>e.vilL_ANAME},{label:(0,t.t)("realtySelling.pelvis"),key:"hoD_ANAME",body:e=>e.hoD_ANAME},{label:(0,t.t)("realtySelling.piece"),key:"parC_NO",body:e=>e.parC_NO},{label:(0,t.t)("realtySelling.neighborhood"),key:"secT_ANAME",body:e=>e.secT_ANAME},{label:(0,t.t)("realtySelling.plate"),key:"sheeT_NO",body:e=>e.sheeT_NO},{label:(0,t.t)("realtySelling.landType"),key:"lanD_TYPE_DESC",body:e=>e.lanD_TYPE_DESC},{label:(0,t.t)("realtySelling.building"),key:"builD_NO",body:e=>e.builD_NO},{label:(0,t.t)("realtySelling.floor"),key:"starE_NO",body:e=>e.starE_NO},{label:(0,t.t)("realtySelling.apartment"),key:"flaT_NO",body:e=>e.flaT_NO},{label:(0,t.t)("realtySelling.landArea"),key:"prcL_AREA",body:e=>e.prcL_AREA},{label:"",key:"actions",body:(a,l)=>{let{rowIndex:t}=l;return a.pRandom===u.pRandom?(0,D.jsx)("i",{className:"pi pi-arrow-right bg-main-color text-white p-1 rounded text-sm"}):(0,D.jsxs)("div",{className:"d-flex",children:[(0,D.jsx)(r.$,{icon:`pi ${e.demo?"pi-eye":"pi-pencil"} text-main-color text-sm`,disabled:a.pRandom===u.pRandom,onClick:()=>((a,l)=>{Q.setValues(a),p(a),g(l),e.demo||e.onHidePageActions(!0),f(!0),setTimeout(()=>{Q.setFieldTouched("pRandom",!0)},100)})(a,t),className:"p-button-rounded bg-transparent outline-none","aria-label":"Bookmark"}),(0,D.jsx)(r.$,{icon:"pi pi-trash text-danger text-sm",disabled:a.pRandom===u.pRandom||e.demo,onClick:()=>(e=>{const a=P.filter(a=>a.pRandom!==e.pRandom);B(a)})(a),className:"p-button-rounded bg-transparent outline-none","aria-label":"Bookmark"})]})}}].map(e=>(0,D.jsx)(j.V,{field:e.key,header:e.label,body:e.body?e.body:null},e.key))})]}),!b&&!k&&!e.demo&&!(null!==(l=O.exchangedProperty)&&void 0!==l&&l.length)&&(0,D.jsx)(r.$,{className:"add-buyer fm-kufi-regular text-sm offset-3",label:(0,t.t)("Efraz.tawheed.addNewProperty"),icon:"pi pi-plus",iconPos:"left",onClick:()=>{$([]),Q.resetForm(),f(!0),e.onHidePageActions(!0)}}),(b||u&&u.nationalId)&&(0,D.jsxs)(q.A,{className:"mt-4",children:[(0,D.jsxs)("form",{onSubmit:Q.handleSubmit,children:[(0,D.jsx)("p",{className:"fm-kufi-bold text-sm buyerInfo",children:(0,t.t)("OwnershipTransfer.Common.pickRealty")}),(0,D.jsxs)("div",{className:"gap-3 justify-content-center my-4 submit-action",children:[(0,D.jsx)(w.A,{children:(0,D.jsx)(C.A,{title:(0,t.t)("OwnershipTransfer.Common.pNumber"),name:"pRandom",dir:"ltr",className:"text-end",required:!0,double:!0,disabled:e.demo,formik:Q,value:Q.values.pRandom,onCh
176ange:e=>{Q.resetForm();const a=e.target.value.replace(/\s/g,"");Q.setFieldValue("pRandom",a)},afterButton:{type:"button",label:(0,t.t)("common.search"),disabled:e.demo,onClick:()=>{""===Q.values.pRandom?Q.setFieldError("pRandom",(0,t.t)("errors.required")):async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(O.propertyData.pRandom!==Q.values.pRandom)try{await Promise.all([(0,h.qz)({pRandom:Q.values.pRandom||e}),(0,h.U8)(Q.values.pRandom||e)]).then(async e=>{const[a,l]=e;F(a.data);const t=[],r=[];l.data.forEach(e=>{e.birthdt?(e.sellerAge=N()().diff(N()(e.birthdt),"years"),N()().diff(N()(e.birthdt),"years")<18&&(e.adjective=3),e.card_expiry=e.cexP_DT,e.card_no=e.carD_NO,e.card_issuer=e.officE_D,e.isAlive="\u0645\u062a\u0648\u0641\u064a"!==e.personStatus):e.typeOfSeller="auth",delete e.birthdt,delete e.cexP_DT,delete e.carD_NO,delete e.officE_D,r.includes(e.partyId)||(t.push(e),r.push(e.partyId))});try{const e=await(0,h.M)(a.data.dlS_KEY||a.data.flatDlsKey);$(t),Q.setValues({...Q.values,...a.data,...e.data})}catch(n){}})}catch(a){}else E((0,m.Qg)((0,t.t)("errors.dublicateProperty")))}()}}})}),(0,D.jsx)("div",{children:(0,D.jsxs)(w.A,{children:[(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.realtyDirectorate"),disabled:!0,name:"realtyDirectorate",value:Q.values.depT_ANAME||""}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.village"),disabled:!0,name:"village",value:Q.values.vilL_ANAME||""}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.pelvis"),disabled:!0,name:"village",value:Q.values.hoD_ANAME||""}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.piece"),disabled:!0,name:"village",value:Q.values.parC_NO||""}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.neighborhood"),disabled:!0,name:"neighborhood",value:Q.values.secT_ANAME||""}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.plate"),disabled:!0,name:"plate",value:Q.values.sheeT_NO||""}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.landType"),disabled:!0,name:"landType",value:Q.values.lanD_TYPE_DESC||""}),!(0,c.Q$)()&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.building"),disabled:!0,name:"building",value:Q.values.builD_NO||""}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.floor"),disabled:!0,name:"floor",value:Q.values.starE_NO||""}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.apartment"),disabled:!0,name:"apartment",value:Q.values.flaT_NO||""})]}),(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.landArea"),disabled:!0,name:"landArea",value:Q.values.prcL_AREA||"",afterText:(0,t.t)("realtySelling.meterSequare")})]})}),e.demo?null:(0,D.jsxs)("div",{className:"mt-4",children:[(0,D.jsx)("p",{className:"fm-kufi-bold text-sm buyerInfo",children:(0,t.t)("Efraz.Common.ownersName")}),(0,D.jsx)(A.b,{className:"realty-table fm-kufi-regular",paginator:!0,rows:5,tableClassName:"w-100",value:V,responsiveLayout:"scroll",emptyMessage:(0,t.t)("common.noResultsFound"),children:null===ee||void 0===ee?void 0:ee.map(e=>e.show&&(0,D.jsx)(j.V,{field:e.key,header:e.label,body:e.body?e.body:null},e.key))}),(0,c.AH)(Q,"selectedShares")]}),(0,D.jsxs)("div",{className:"mt-4",children:[(0,D.jsx)("p",{className:"fm-kufi-bold text-sm buyerInfo",children:(0,t.t)("realtySelling.sellingExchangeOptions")}),(0,D.jsxs)("div",{className:"d-flex flex-column flex-md-row gap-2",children:[(0,D.jsxs)("div",{children:[(0,D.jsx)(z.a,{value:!0,checked:Q.values.isTotalShares,name:"isTotalShares",onChange:e=>{Q.handleChange(e),Q.setFieldValue("isTotalShares",!0),Q.setFieldValue("allShares",!1)},disabled:e.demo}),(0,D.jsx)("label",{className:"fm-kufi-regular text-sm",children:(0,t.t)("realtySelling.entireProperty")})]}),(0,D.jsxs)("div",{className:"",children:[(0,D.jsx)(z.a,{value:!1,checked:!Q.values.isTotalShares&&!Q.values.allShares,name:"isTotalShares",onChange:e=>{Q.handleChange(e),Q.setFieldValue("allShares",!1),Q.setFieldValue("isTotalShares",!1),Q.setFieldValue("selectedShares",[])},disabled:e.demo}),(0,D.jsx)("label",{className:"fm-kufi-regular text-sm",children:(0,t.t)("realtySelling.partOfTheQuota")})]}),(0,D.jsxs)("div",{children:[(0,D.jsx)(z.a,{value:!0,checked:Q.values.allShares,name:"allShares",onChange:e=>{Q.handleChange(e),Q.setFieldValue("allShares",!0),Q.setFieldValue("isTotalShares",!1),Q.setFieldValue("selectedShares",[])},disabled:e.demo}),(0,D.jsx)("label",{className:"fm-kufi-regular text-sm",children:(0,t.t)("realtySelling.allShares")}
176)]})]})]}),(0,D.jsx)(Y.A,{propertyData:Q.values,formik:Q,demo:e.demo,withoutFrame:!0,realtyNeedsClearance:U}),(0,D.jsx)(K.A,{hodMandatory:R,formik:Q,demo:e.demo,withoutFrame:!0}),(0,D.jsxs)("div",{className:"d-flex mt-4 justify-content-center",children:[(0,D.jsx)(r.$,{type:"submit",label:(0,t.t)("common.save"),onClick:()=>d(!0),style:{minWidth:"max-content"},disabled:e.demo,className:"action-btn col-lg-2 col-sm-4 d-block h-fit submit-btn py-2 text-xs fm-kufi-regular text-sm"}),(0,D.jsx)(r.$,{onClick:()=>{f(!1),p({}),g(null),e.demo||e.onHidePageActions(!1),Q.resetForm()},className:"action-btn col-lg-2 d-block col-sm-4 h-fit py-2 text-xs back-btn mx-2 fm-kufi-regular text-sm",children:(0,t.t)("common.cancel")})]})]})]}),(0,D.jsx)(L.A,{visible:x,onOk:()=>{},onCancel:()=>{S(!1)},okText:(0,t.t)("common.yes"),cancelText:(0,t.t)("common.cancel"),okButtonProps:{className:"action-btn submit-btn mx-3 px-4",style:{backgroundColor:"#286c4d",borderRadius:"10px",border:"none"}},cancelButtonProps:{style:{borderRadius:"10px",border:"1px solid #286c4d",color:"#286c4d"}},closable:!1,children:(0,D.jsx)("p",{className:"fm-kufi-bold text-sm text-center mb-0",children:(0,t.t)("realtySelling.removeBuyersConfirmation")})})]})]})};var Q=l(20031),J=l(64091),H=l(89421),X=l(80029),Z=l(88778),ee=l(47612);function ae(e){let{onUpdateFormData:a,onHidePageActions:l,onDisableNext:n,demo:i}=e;const[d,u]=(0,s.useState)(""),[m,p]=(0,s.useState)(""),y=(0,o.d4)(e=>e.sellingFormDetails),{selectedShares:g}=y.exchangedProperty[0],b=(0,Q.A)(`(min-width:${J.A.breakdowns.MOBILE_MAX_WIDTH}px)`),f=(0,v.Wx)({initialValues:{adjective:1,nationality:"\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629",investApprovalNum:"",investApproval:"",court:{},isJordanianAgent:!0,isJordanianClient:!0,isInternalAgency:!0,agencyNumber:"",attachAgency:"",agencyDate:"",agencyPlace:"",agentName:"",agencyClientName:"",agencyType:"",agencyStatus:"",agentNationalId:"",agentPersonalNumber:"",agentCardNo:"",agentInfo:{},clientNationalId:"",clientPersonalNumber:"",clientCardNo:"",clientInfo:{},isJordanianGuardian:!0,isJordanianMinor:!0,guardianNationalId:"",guardianPersonalNumber:"",guardianCardNo:"",guardianName:"",guardianInfo:{},guardianshipNumber:"",guardianshipDate:"",guardianshipPlace:"",guardianshipAttachment:"",salesAuthorizationNumber:"",salesAuthorizationDate:"",salesAuthorizationPlace:"",salesAuthorizationAttachment:"",minorNationalId:"",minorName:"",minorCardNo:"",minorPersonalNumber:"",minorInfo:{},isJordanianDeputy:!0,entityNum:"",entityName:"",deputyNum:"",deputyDate:"",phoneNum:"",deputyAttach:"",deputyInfo:{},deputyNationalId:"",deputyPersonalNumber:"",deputyCardNo:""},validate:e=>{let a={};return 4===e.adjective&&(e.isJordanianDeputy?(0,c.L9)(e.deputyNationalId,y)&&(a.deputyNationalId=(0,t.t)("errors.buyerExistsInDeputy")):(0,c.L9)(e.deputyPersonalNumber,y)&&(a.deputyPersonalNumber=(0,t.t)("errors.buyerExistsInDeputy"))),1===e.adjective?("\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==e.nationality&&(e.investApproval&&e.investApproval===(0,t.t)("common.agree")||(a.investApproval=(0,t.t)("errors.required"))),a):(2===e.adjective?a={...a,...(0,c.aZ)(e)}:3===e.adjective||5===e.adjective?a={...a,...(0,c.yI)(e)}:4===e.adjective&&(a={...a,...(0,c.yt)(e)}),"\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==e.nationality&&(e.investApproval&&e.investApproval===(0,t.t)("common.agree")||(a.investApproval=(0,t.t)("errors.required"))),a)},onSubmit:e=>{u({}),l(!1);const t=[...g];var r;t[g.findIndex(a=>a.partyId===e.partyId)]=e,r={exchangedProperty:[{...y.exchangedProperty[0],selectedShares:t}]},a({...r}),f.resetForm()}}),x=()=>{let e=!1;return g.forEach(a=>{"FLAT"===a.landFlag&&(e=!0)}),e},S=()=>{let e=!1;return g.forEach(a=>{"LAND"===a.landFlag&&(e=!0)}),e};(0,s.useEffect)(()=>{const e=[];let a=0;g.forEach(l=>{"\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==l.nationality&&N(y.propertyData.reG_NO,l.nationalId||l.partyId),"\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==l.nationality&&f.values.investApproval!==(0,t.t)("common.agree")?(a++,p((0,t.t)("errors.shouldHaveInvestApproval"))):3!==l.adjective||l.guardianNationalId||l.guardianPersonalNumber||(a++,p((0,t.t)("errors.minorMustHaveGuardian"))),"2"===l.partyCode&&(a++,p((0,t.t)("errors.checkDLS"))),!1===l.isAlive&&e.push(l)}),e.length&&(a++,p((0,t.t)("errors.sellerMustBeAlive",{type:""+("ar"===t.Ay.language?"\u0627\u0644\u0628\u0627\u0626\u0639":"seller")}))),i||(a>0?n(!0):(n(!1),p("")))},[g,f.values.investApproval]);const N=(e,a)=>{(0,h.LB)(e,a).then(e=>{e.data?f.setFieldValue("investApproval",(0,t.t)("common.agree")):f.setFieldValue("investApproval",(0,t.t)("common.notAgree"))})};return(0,D.jsxs)(D.Fragment,{children:[m&&(0,D.jsx)("p",{className:"text-danger fm-kufi-bold text-sm mt-3 text-center",children:m}
176),(0,D.jsx)(k.A,{title:(0,t.t)("Efraz.Common.ownersInfo"),children:(0,D.jsx)(A.b,{className:"realty-table fm-kufi-regular",tableClassName:"w-100",value:g,responsiveLayout:"scroll",emptyMessage:(0,t.t)("common.noResultsFound"),children:[{label:(0,t.t)("realtySelling.nationalId"),key:"partyId",show:!0},{label:(0,t.t)("realtySelling.ownerName"),key:"partyName",show:!0},{label:(0,t.t)("realtySelling.apartmentShares"),key:"apartmentShares",body:e=>"FLAT"===e.landFlag?`${e.ownShares} / ${e.shareNo}`:"-",show:x()},{label:(0,t.t)("OwnershipTransfer.willDocumentation.ownerLandShares"),key:"landShares",body:e=>"LAND"===e.landFlag?`${e.ownShares} / ${e.shareNo}`:"-",show:S()},{label:(0,t.t)("realtySelling.personStatus"),key:"personStatus",body:e=>e.personStatus,show:!0},{label:(0,t.t)("Efraz.Common.ownerAdjective"),key:"sellerAdjective",body:e=>{const a=(e=>{const a=e.adjective||1;return(0,J.I)().userTypesNew.find(e=>e.value===a)})(e);return e.adjective=a.value,(0,D.jsx)("span",{className:"text-danger",children:null===a||void 0===a?void 0:a.label})},show:!0},{label:"",key:"actions",body:e=>e.partyId===d.partyId?(0,D.jsx)("i",{className:"pi pi-arrow-right bg-main-color text-white p-1 rounded text-sm"}):(0,D.jsx)(H.A,{onClick:()=>(e=>{if(e.partyId===d.partyId)return;i||l(!0);const a={...f.values,...e};f.setValues(a),u(e)})(e),disabled:e.partyId===d.partyId,className:"action-btn text-xs mx-1 text-sm main-button buttonWidth bg-success",children:(0,t.t)("common.adjectiveChange")}),show:!0}].map(e=>e.show&&(0,D.jsx)(j.V,{field:e.key,header:e.label,body:e.body?e.body:null},e.key))})}),d&&d.partyId&&(0,D.jsxs)(k.A,{title:(0,t.t)("Efraz.Common.ownerInfo"),children:[(0,D.jsx)(w.A,{children:(0,D.jsx)(C.A,{title:(0,t.t)("Efraz.Common.ownerAdjective"),required:!0,formik:f,name:"adjective",type:"select",value:f.values.adjective,disableFilter:!0,onChange:e=>{(0,c.V_)(f),f.handleChange(e)},options:(0,c.XT)(null===d||void 0===d?void 0:d.partyCode,(0,J.I)().userTypesNew,f.values.sellerAge,f.values.typeOfSeller),optionLabel:"label",optionValue:"value",disabled:i})}),(0,D.jsxs)("form",{onSubmit:f.handleSubmit,className:"p-fluid",children:["\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==f.values.nationality&&(0,D.jsx)(w.A,{children:(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.investApproval"),required:!0,formik:f,name:"investApproval",value:f.values.investApproval,disabled:!0})}),(()=>{switch(f.values.adjective){case 2:return(0,D.jsx)(X.A,{valuesNamesMapper:{agentInfo:"agentInfo",clientInfo:"clientInfo",agentNationalId:"agentNationalId",agentPersonalNumber:"agentPersonalNumber",firstCardNo:"agentCardNo",secondCardNo:"clientCardNo"},formik:f,demo:i,seller:!0,itemToEdit:d,newRepresentationsBy:!0});case 3:case 5:return(0,D.jsx)(Z.A,{valuesNamesMapper:{objectHolderData:"guardianInfo",agentInfo:"agentInfo",clientInfo:"clientInfo",agentNationalId:"agentNationalId",agentPersonalNumber:"agentPersonalNumber",firstCardNo:"guardianCardNo",secondCardNo:"minorCardNo",guardianNationalId:"guardianNationalId",guardianPersonalNumber:"guardianPersonalNumber",guardianCardNo:"guardianCardNo",guardianInfo:"guardianInfo",guardianshipAttachment:"guardianshipAttachment",salesAuthorizationAttachment:"salesAuthorizationAttachment"},demo:i,formik:f,seller:!0});case 4:return(0,D.jsx)(ee.A,{valuesNamesMapper:{agentInfo:"deputyInfo",agentNationalId:"deputyNationalId",agentPersonalNumber:"deputyPersonalNumber",firstCardNo:"deputyCardNo",secondCardNo:"clientCardNo"},demo:i,formik:f,seller:!0});default:return null}})(),(0,D.jsxs)("div",{className:"row justify-content-center my-4 submit-action gap-4",children:[(0,D.jsx)("span",{className:"col-lg-2 col-sm-4",children:(0,D.jsx)(r.$,{type:"submit",disabled:!f.isValid||i,style:{width:b?"max-content":null},className:"action-btn m-2 d-block h-fit submit-btn py-1 fm-kufi-regular text-sm",children:(0,t.t)("common.updateChanges")})}),(0,D.jsx)("span",{className:"col-lg-2 col-sm-4",children:(0,D.jsx)(r.$,{onClick:()=>{i||l(!1),u({}),f.resetForm()},type:"button",className:"action-btn col-lg-2 d-block col-sm-4 h-fit py-1 back-btn m-2 fm-kufi-regular text-sm",children:(0,t.t)("common.cancel")})})]})]})]})]})}var le=l(49092),te=l(61482);function re(e){let{demo:a,onUpdateFormData:l,pRandom:t,onSuccessSubmit:r,onClickNext:n,showTableDemo:i}=e;const{t:d,i18n:u}=(0,le.B)(),{selectedShares:m,isTotalShares:p,allShares:y,realtyValue:g,propertyData:b,clearanceNumber:f,isValidClearance:x,donation:S,support:N,clearanceAttachment:j,hodClearance:A,installmentDuration:C,monthlyInstallment:w,downpayment:I,installmentConditions:T,haveConditions:F,isGam:R,buildingLocationDesc:_,...E}=(0,o.d4)(e=>
176e.sellingFormDetails),[O,P]=(0,s.useState)(!1),{realtyNeedsClearance:V}=(0,G.G)(b),$=(0,v.Wx)({initialValues:{realtyValue:g,isTotalShares:p,allShares:y,isValidClearance:x,clearanceNumber:f,selectedShares:[...m],donation:S,support:N,isGam:"boolean"!=typeof R||R,clearanceAttachment:j||"",hodClearance:A||"",hodClearanceNo:E.hodClearanceNo||"",hodClearanceDate:E.hodClearanceDate||"",hodClearanceIssuer:E.hodClearanceIssuer||"",isClearanceSearched:x||!1,installmentDurationInYears:parseInt(C/12)||0,installmentDurationInMonths:C%12||0,installmentDuration:C||0,monthlyInstallment:w,downpayment:I,installmentConditions:T,haveConditions:F||!1,buildingLocationDesc:_},validate:e=>{let a={};return O&&(e.hodClearance||(a.hodClearance=d("errors.required")),e.hodClearanceNo||(a.hodClearanceNo=d("errors.required")),e.hodClearanceDate||(a.hodClearanceDate=d("errors.required")),e.hodClearanceIssuer||(a.hodClearanceIssuer=d("errors.required"))),e.selectedShares.length?B(e.selectedShares)&&(a.selectedShares=d("errors.sellerMustBeAlive",{type:""+("ar"===u.language?"\u0627\u0644\u0628\u0627\u0626\u0639":"seller")})):a.selectedShares=d("errors.required"),V&&(e.isGam?e.clearanceNumber?!1===e.isClearanceSearched?a.clearanceNumber=d("errors.clearanceNotValid"):e.isValidClearance||(a.clearanceNumber=""):a.clearanceNumber=d("errors.required"):e.clearanceAttachment||(a.clearanceAttachment=d("errors.required"))),a},onSubmit:e=>{var a;a={...e},l({realtyValue:g,selectedShares:m,isTotalShares:p,allShares:y,clearanceNumber:f,isValidClearance:x,donation:S,clearanceAttachment:j,hodClearance:A,installmentDuration:C,monthlyInstallment:w,downpayment:I,installmentConditions:T,haveConditions:F,buildingLocationDesc:_,isGam:R,...a}),r()}}),B=e=>e.filter(e=>!1!==e.isAlive).length!==e.length;return(0,s.useEffect)(()=>{a?A&&P(!0):(0,h.Mw)(b.vilL_CODE,b.hoD_CODE,b.secT_CODE,b.parC_NO).then(e=>{P(e.data)})},[b]),(0,s.useEffect)(()=>{n&&$.submitForm()},[n]),(0,s.useEffect)(()=>{$.values.donation&&($.setFieldValue("realtyValue",0),$.setFieldValue("support",!1))},[$.values.donation]),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(te.A,{title:d("Efraz.Common.selectShares"),pRandom:t,formik:$,frameTitle:d("Efraz.Common.ownerShares"),landSharesTitle:d("OwnershipTransfer.willDocumentation.ownerLandShares"),selectedShares:m,showTableDemo:i,demo:a}),(0,D.jsx)(k.A,{title:d("realtySelling.sellingExchangeOptions"),children:(0,D.jsxs)("div",{className:"d-flex flex-column flex-md-row gap-2",children:[(0,D.jsxs)("div",{children:[(0,D.jsx)(z.a,{value:!0,checked:$.values.isTotalShares,name:"isTotalShares",onChange:e=>{$.handleChange(e),$.setFieldValue("isTotalShares",!0),$.setFieldValue("allShares",!1),(0,c.Cj)($)},disabled:a}),(0,D.jsx)("label",{className:"fm-kufi-regular text-sm",children:d("realtySelling.entireProperty")})]}),(0,D.jsxs)("div",{className:"",children:[(0,D.jsx)(z.a,{value:!1,checked:!$.values.isTotalShares&&!$.values.allShares,name:"isTotalShares",onChange:e=>{$.handleChange(e),$.setFieldValue("allShares",!1),$.setFieldValue("isTotalShares",!1),$.setFieldValue("selectedShares",[]),(0,c.Cj)($)},disabled:a}),(0,D.jsx)("label",{className:"fm-kufi-regular text-sm",children:d("realtySelling.partOfTheQuota")})]}),(0,D.jsxs)("div",{children:[(0,D.jsx)(z.a,{value:!0,checked:$.values.allShares,name:"allShares",onChange:e=>{$.handleChange(e),$.setFieldValue("allShares",!0),$.setFieldValue("isTotalShares",!1),$.setFieldValue("selectedShares",[]),(0,c.Cj)($)},disabled:a}),(0,D.jsx)("label",{className:"fm-kufi-regular text-sm",children:d("realtySelling.allShares")})]})]})}),(0,D.jsx)(Y.A,{propertyData:b,formik:$,demo:a,realtyNeedsClearance:V}),(0,D.jsx)(K.A,{hodMandatory:O,formik:$,demo:a})]})}function ne(e){let{onUpdateFormData:a,onHidePageActions:l,onDisableNext:n,demo:i}=e;const[d,u]=(0,s.useState)(""),[m,p]=(0,s.useState)(""),y=(0,o.d4)(e=>e.sellingFormDetails),{selectedShares:g}=y,b=(0,Q.A)(`(min-width:${J.A.breakdowns.MOBILE_MAX_WIDTH}px)`),f=(0,v.Wx)({initialValues:{adjective:1,nationality:"\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629",investApprovalNum:"",investApproval:"",court:{},isJordanianAgent:!0,isJordanianClient:!0,isInternalAgency:!0,agencyNumber:"",attachAgency:"",agencyDate:"",agencyPlace:"",agentName:"",agencyClientName:"",agencyType:"",agencyStatus:"",agentNationalId:"",agentPersonalNumber:"",agentCardNo:"",agentInfo:{},clientNationalId:"",clientPersonalNumber:"",clientCardNo:"",clientInfo:{},isJordanianGuardian:!0,isJordanianMinor:!0,guardianNationalId:"",guardianPersonalNumber:"",guardianCardNo:"",guardianName:"",guardianInfo:{},guardianshipNumber:"",guardianshipDate:"",guardianshipPlace:"",guardianshipAttachment:"",salesAuthorizationNumber:"",salesAuthorizationDate:"",salesAuthorizationPlace:"",salesAuthorizationAttachment:"",minorNationalId:"",minorName:"",minorCardNo:"",minorPersonalNumber:"",minorInfo:{},isJordanianDeputy:!0,entityNum:"",entityName:"",deputyNum:"",deputyDate:"",phoneNum:"",deputyAttach:"",deputyInfo:{},deputyNationalId:"",deputyPersonalNumber:"",deputyCardNo:""},validate:e=>{let a={};return 4===e.adjective&&(e.isJordanianDeputy?(0,c.L9)(e.deputyNationalId,y)&&(a.deputyNationalId=(0,t.t)("errors.buyerExistsInDeputy")):(0,c.L9)(e.deputyPersonalNumber,y)&&(a.deputyPersonalNumber=(0,t.t)("errors.buyerExistsInDeputy"))),1===e.adjective?("\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==e.nationality&&(e.investApproval&&e.investApproval===(0,t.t)("common.agree")||(a.investApproval=(0,t.t)("errors.required"))),a):(2===e.adjective?a={...a,...(0,c.aZ)(e)}:3===e.adjective||5===e.adjective?a={...a,...(0,c.yI)(e)}:4===e.adjective&&(a={...a,...(0,c.yt)(e)}),"\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==e.nationality&&(e.investApproval&&e.investApproval===(0,t.t)("common.agree")||(a.investApproval=(0,t.t)("errors.required"))),a)},onSubmit:e=>{u({}),l(!1);const t=[...g];var r;t[g.findIndex(a=>a.partyId===e.partyId)]=e,r={selectedShares:t},a({selectedShares:g,...r}),f.resetForm()}}),x=()=>{let e=!1;return g.forEach(a=>{"FLAT"===a.landFlag&&(e=!0)}),e},S=()=>{let e=!1;return g.forEach(a=>{"LAND"===a.landFlag&&(e=!0)}),e};(0,s.useEffect)(()=>{const e=[];let a=0;g.forEach(l=>{"\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==l.nationality&&N(y.propertyData.reG_NO,l.nationalId||l.partyId),"\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==l.nationality&&f.values.investApproval!==(0,t.t)("common.agree")?(a++,p((0,t.t)("errors.shouldHaveInvestApproval"))):3!==l.adjective||l.guardianNationalId||l.guardianPersonalNumber||(a++,p((0,t.t)("errors.minorMustHaveGuardian"))),"2"===l.partyCode&&(a++,p((0,t.t)("errors.checkDLS"))),!1===l.isAlive&&e.push(l)}),e.length&&(a++,p((0,t.t)("errors.sellerMustBeAlive",{type:""+("ar"===t.Ay.language?"\u0627\u0644\u0628\u0627\u0626\u0639":"seller")}))),i||(a>0?n(!0):(n(!1),p("")))},[g,f.values.investApproval]);const N=(e,a)=>{(0,h.LB)(e,a).then(e=>{e.data?f.setFieldValue("investApproval",(0,t.t)("common.agree")):f.setFieldValue("investApproval",(0,t.t)("common.notAgree"))})};return(0,D.jsxs)(D.Fragment,{children:[m&&(0,D.jsx)("p",{className:"text-danger fm-kufi-bold text-sm mt-3 text-center",children:m}
176),(0,D.jsx)(k.A,{title:(0,t.t)("Efraz.Common.ownersInfo"),children:(0,D.jsx)(A.b,{className:"realty-table fm-kufi-regular",tableClassName:"w-100",value:g,responsiveLayout:"scroll",emptyMessage:(0,t.t)("common.noResultsFound"),children:[{label:(0,t.t)("realtySelling.nationalId"),key:"partyId",show:!0},{label:(0,t.t)("realtySelling.ownerName"),key:"partyName",show:!0},{label:(0,t.t)("realtySelling.apartmentShares"),key:"apartmentShares",body:e=>"FLAT"===e.landFlag?`${e.ownShares} / ${e.shareNo}`:"-",show:x()},{label:(0,t.t)("OwnershipTransfer.willDocumentation.ownerLandShares"),key:"landShares",body:e=>"LAND"===e.landFlag?`${e.ownShares} / ${e.shareNo}`:"-",show:S()},{label:(0,t.t)("realtySelling.personStatus"),key:"personStatus",body:e=>e.personStatus,show:!0},{label:(0,t.t)("Efraz.Common.ownerAdjective"),key:"sellerAdjective",body:e=>{const a=(e=>{const a=e.adjective||1;return(0,J.I)().userTypesNew.find(e=>e.value===a)})(e);return e.adjective=a.value,(0,D.jsx)("span",{className:"text-danger",children:null===a||void 0===a?void 0:a.label})},show:!0},{label:"",key:"actions",body:e=>e.partyId===d.partyId?(0,D.jsx)("i",{className:"pi pi-arrow-right bg-main-color text-white p-1 rounded text-sm"}):(0,D.jsx)(H.A,{onClick:()=>(e=>{if(e.partyId===d.partyId)return;i||l(!0);const a={...f.values,...e};f.setValues(a),u(e)})(e),disabled:e.partyId===d.partyId,className:"action-btn text-xs mx-1 text-sm main-button buttonWidth bg-success",children:(0,t.t)("common.adjectiveChange")}),show:!0}].map(e=>e.show&&(0,D.jsx)(j.V,{field:e.key,header:e.label,body:e.body?e.body:null},e.key))})}),d&&d.partyId&&(0,D.jsxs)(k.A,{title:(0,t.t)("Efraz.Common.ownerInfo"),children:[(0,D.jsx)(w.A,{children:(0,D.jsx)(C.A,{title:(0,t.t)("Efraz.Common.ownerAdjective"),required:!0,formik:f,name:"adjective",type:"select",value:f.values.adjective,disableFilter:!0,onChange:e=>{(0,c.V_)(f),f.handleChange(e)},options:(0,c.XT)(null===d||void 0===d?void 0:d.partyCode,(0,J.I)().userTypesNew,f.values.sellerAge,f.values.typeOfSeller),optionLabel:"label",optionValue:"value",disabled:i})}),(0,D.jsxs)("form",{onSubmit:f.handleSubmit,className:"p-fluid",children:["\u0627\u0644\u0623\u0631\u062f\u0646\u064a\u0629"!==f.values.nationality&&(0,D.jsx)(w.A,{children:(0,D.jsx)(C.A,{title:(0,t.t)("realtySelling.investApproval"),required:!0,formik:f,name:"investApproval",value:f.values.investApproval,disabled:!0})}),(()=>{switch(f.values.adjective){case 2:return(0,D.jsx)(X.A,{valuesNamesMapper:{agentInfo:"agentInfo",clientInfo:"clientInfo",agentNationalId:"agentNationalId",agentPersonalNumber:"agentPersonalNumber",firstCardNo:"agentCardNo",secondCardNo:"clientCardNo"},formik:f,demo:i,seller:!0,itemToEdit:d,newRepresentationsBy:!0});case 3:case 5:return(0,D.jsx)(Z.A,{valuesNamesMapper:{objectHolderData:"guardianInfo",agentInfo:"agentInfo",clientInfo:"clientInfo",agentNationalId:"agentNationalId",agentPersonalNumber:"agentPersonalNumber",firstCardNo:"guardianCardNo",secondCardNo:"minorCardNo",guardianNationalId:"guardianNationalId",guardianPersonalNumber:"guardianPersonalNumber",guardianCardNo:"guardianCardNo",guardianInfo:"guardianInfo",guardianshipAttachment:"guardianshipAttachment",salesAuthorizationAttachment:"salesAuthorizationAttachment"},demo:i,seller:!0,formik:f});case 4:return(0,D.jsx)(ee.A,{valuesNamesMapper:{agentInfo:"deputyInfo",agentNationalId:"deputyNationalId",agentPersonalNumber:"deputyPersonalNumber",firstCardNo:"deputyCardNo",secondCardNo:"clientCardNo"},demo:i,formik:f,seller:!0});default:return null}})(),(0,D.jsxs)("div",{className:"row justify-content-center my-4 submit-action gap-4",children:[(0,D.jsx)("span",{className:"col-lg-2 col-sm-4",children:(0,D.jsx)(r.$,{type:"submit",disabled:!f.isValid||i,style:{width:b?"max-content":null},className:"action-btn m-2 d-block h-fit submit-btn py-1 fm-kufi-regular text-sm",children:(0,t.t)("common.updateChanges")})}),(0,D.jsx)("span",{className:"col-lg-2 col-sm-4",children:(0,D.jsx)(r.$,{onClick:()=>{i||l(!1),u({}),f.resetForm()},type:"button",className:"action-btn col-lg-2 d-block col-sm-4 h-fit py-1 back-btn m-2 fm-kufi-regular text-sm",children:(0,t.t)("common.cancel")})})]})]})]})]})}var se=l(15538);l(66888);function oe(e){let{withoutFrame:a,refund:l}=e;const r=(0,o.d4)(e=>e.sellingFormDetails);return a?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(T.A,{data:r.propertyData}),(0,D.jsx)(b.A,{}),(0,D.jsx)(re,{showTableDemo:!0,demo:!0}),(0,D.jsx)(ne,{demo:!0}),(0,D.jsx)(U,{demo:!0}),(0,D.jsx)(ae,{demo:!0}),(0,D.jsx)(B,{onDisableNext:()=>{},demo:!0}),(0,D.jsx)(x.A,{demo:!0,withPRandom:!0,withoutWell:!0}),(0,D.jsx)(I,{demo:!0}),(0,D.jsx)(y.A,{demo:!0}),(0,D.jsx)(P,{onDisableNext:()=>{},onUpdateFormData:()=>{},demo:!0,refund:l}),(0,D.jsx)(g.A,{demo:!0})]}):(0,D.jsxs)(k.A,{title:(0,t.t)("realtySelling.submitRequest"),icon:(0,D.jsx)(se.h,{width:"25"}),children:[(0,D.jsx)(T.A,{data:r.propertyData}),(0,D.jsx)(b.A,{}),(0,D.jsx)(re,{showTableDemo:!0,demo:!0}),(0,D.jsx)(ne,{demo:!0}),(0,D.jsx)(U,{demo:!0}),(0,D.jsx)(ae,{demo:!0}),(0,D.jsx)(B,{onDisableNext:()=>{},demo:!0}),(0,D.jsx)(x.A,{demo:!0,withPRandom:!0,withoutWell:!0}),(0,D.jsx)(I,{demo:!0}),(0,D.jsx)(y.A,{demo:!0}),(0,D.jsx)(P,{onDisableNext:()=>{},onUpdateFormData:()=>{},demo:!0,refund:l}),(0,D.jsx)(g.A,{demo:!0})]})}function ie(e){var a,l;let{isOwner:v}=e;const S=(0,i.zy)(),N=(0,o.wA)(),j=(0,s.useRef)(null),A=(0,i.Zp)(),C=(0,s.useRef)(""),w=(0,o.d4)(e=>
176e.sellingFormDetails),[k,R]=(0,s.useState)(v?"selectSharesToSell":"realtyInformation"),[E,O]=(0,s.useState)(!1),[V,$]=(0,s.useState)(!1),[L,q]=(0,s.useState)(!1),M=function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){N((0,m.eh)());const a={taskId:"",processInstanceId:"",donation:!1,propertyData:{},selectedShares:[],isTotalShares:!1,allShares:!1,buyersDetails:[],realtyValue:"",buyerSellersMapper:[],realtyBelongings:[],additionalBelongingsValue:"",attachments:{},support:!1,accumilative:[],...e};N((0,m.Xf)(a))}else{const a={...w,...e};N((0,m.Xf)(a))}};(0,s.useEffect)(()=>{var e;v&&(e=S.state.reG_NO,(0,h.qz)({reG_NO:e}).then(e=>{M({propertyData:(null===e||void 0===e?void 0:e.data)||{}})}))},[S]);const W=(0,s.useCallback)(()=>[{label:(0,t.t)("Efraz.Common.realtyInfo"),backKey:null,key:"realtyInformation",nextKey:"applicantInformation",hideNext:!0,showRealtyDetails:!1},{label:(0,t.t)("governmentServices.applicantInfo"),backKey:"realtyInformation",key:"applicantInformation",nextKey:"selectSharesToSell",hasFormToSubmit:!0,showRealtyDetails:!1,hideBack:!0},{label:(0,t.t)("Efraz.Common.ownerShares"),backKey:"applicantInformation",key:"selectSharesToSell",nextKey:"sellersInfo",hasFormToSubmit:!0,showRealtyDetails:!0},{label:(0,t.t)("Efraz.Common.ownersInfo"),backKey:"selectSharesToSell",key:"sellersInfo",nextKey:"exchangedPropertyInfo",showRealtyDetails:!0},{label:(0,t.t)("OwnershipTransfer.exchange.exchangedPropertyInfo"),backKey:"sellersInfo",key:"exchangedPropertyInfo",nextKey:"exchangedSellersInfo",showRealtyDetails:!0}
176,{label:(0,t.t)("Efraz.Common.ownersInfo"),backKey:"exchangedPropertyInfo",key:"exchangedSellersInfo",nextKey:"sellerAndBuyerInfo",showRealtyDetails:!0},{label:(0,t.t)("OwnershipTransfer.exchange.exchangedShares"),backKey:"exchangedSellersInfo",key:"sellerAndBuyerInfo",nextKey:"landingBelongingsInformation",showRealtyDetails:!0},{label:(0,t.t)("realtySelling.landingBelongingsInformation"),backKey:"sellerAndBuyerInfo",key:"landingBelongingsInformation",nextKey:"buildingApproval",showRealtyDetails:!0},{label:(0,t.t)("realtySelling.buildingApproval"),backKey:"landingBelongingsInformation",key:"buildingApproval",nextKey:"attachments",showRealtyDetails:!0},{label:(0,t.t)("realtySelling.requiredDocuments"),backKey:"buildingApproval",key:"attachments",nextKey:"additionalNotes",showRealtyDetails:!1},{label:(0,t.t)("realtySelling.additionalNotes"),backKey:"attachments",key:"additionalNotes",nextKey:"submitRequestToCheck",showRealtyDetails:!1},{label:(0,t.t)("realtySelling.submitRequestToCheck"),backKey:"additionalNotes",key:"submitRequestToCheck",nextKey:null,nextLabel:(0,t.t)("realtySelling.submit"),submit:!0,showRealtyDetails:!1}],[]),z=(0,s.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k;const a=W(),l=a.findIndex(a=>a.key===e);return{index:l,step:a[l]}},[k]),[Y,K]=(0,s.useState)(z());(0,s.useEffect)(()=>{K(z())},[k,z]);const G=()=>{Y.step.submit||Y.step.nextKey&&R(Y.step.nextKey)};function Q(e){return(0,p.DsA)(e)}const J=async()=>{N((0,m.Te)("",""));try{Q(w.propertyData.reG_NO).then(e=>{if(!1===e.data){const e=[(C.current=c.YS(w.propertyData.depT_CODE,"DLS1023"),(0,p.SVD)(c.be(w,C.current,"DLS1023","Exchange","\u0627\u0644\u0645\u0628\u0627\u062f\u0644\u0629",!0)))];Promise.allSettled(e).then(e=>{let[a]=e;"fulfilled"==a.status&&(N((0,m.Te)((0,t.t)("common.success"),(0,t.t)("common.yourReference",{refrenceNumber:C.current}))),A("/home"))})}else N((0,m.Qg)((0,t.t)("errors.openSellingRequest")))})}catch(e){console.log(e)}},H=()=>_;return(0,D.jsxs)(d.A,{className:"row flex-column flex-md-row",children:[(0,D.jsx)(n.y,{ref:j}),(0,D.jsx)("div",{className:"col-md-3 d-flex",children:(0,D.jsx)(F.A,{isOwner:v,steps:W(),getClassIcon:e=>Y.index===e?"ar"===u.A.language?"pi pi-arrow-left text-main-color":"pi pi-arrow-right text-main-color":Y.index>e?"pi pi-check text-main-color":"",title:null===(a=H())||void 0===a?void 0:a.title,desc:null===(l=H())||void 0===l?void 0:l.desc,targetStep:Y})}),(0,D.jsxs)("div",{className:"col-md-9 col-xs-12",children:[Y.step.showRealtyDetails&&(0,D.jsx)(T.A,{data:w.propertyData}),(()=>{switch(Y.step.key){case"realtyInformation":return(0,D.jsx)(f.A,{onUpdateFormData:M,onSuccessSubmit:G,checkRequestExist:Q,checkWell:!0});case"applicantInformation":return(0,D.jsx)(b.A,{onClickNext:V,onSuccessSubmit:G,setSubmitForm:$,onDisableNext:e=>q(e)});case"selectSharesToSell":return(0,D.jsx)(re,{onClickNext:V,onSuccessSubmit:G,onUpdateFormData:M,regNum:w.propertyData.reG_NO,pRandom:w.propertyData.pRandom||S.state.pRandom});case"sellersInfo":return(0,D.jsx)(ne,{onUpdateFormData:M,onHidePageActions:e=>O(e),onDisableNext:e=>q(e)});case"exchangedPropertyInfo":return(0,D.jsx)(U,{onHidePageActions:e=>O(e),onDisableNext:e=>q(e)});case"exchangedSellersInfo":return(0,D.jsx)(ae,{onUpdateFormData:M,onHidePageActions:e=>O(e),onDisableNext:e=>q(e)});case"sellerAndBuyerInfo":return(0,D.jsx)(B,{onDisableNext:e=>q(e),onUpdateFormData:M});case"landingBelongingsInformation":return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(x.A,{onDisableNext:e=>q(e),withPRandom:!0,withoutWell:!0}),(0,D.jsx)(I,{onDisableNext:e=>q(e),withPRandom:!0})]});case"buildingApproval":return(0,D.jsx)(y.A,{onDisableNext:e=>q(e)});case"attachments":return(0,D.jsx)(P,{onDisableNext:e=>q(e),onUpdateFormData:M});case"additionalNotes":return(0,D.jsx)(g.A,{onDisableNext:e=>q(e),onUpdateFormData:M});case"submitRequestToCheck":return(0,D.jsx)(oe,{});default:return Y.step.component}})(),!E&&(0,D.jsxs)("div",{className:"row flex-column flex-column-reverse flex-md-row px-0 mx-0 justify-content-end my-4 submit-action",children:[Y.step.backKey&&!Y.step.hideBack&&(0,D.jsx)(r.$,{onClick:()=>{Y.step.backKey&&(R(Y.step.backKey),q(!1))},disabled:!Y.step.backKey,className:"action-btn col-md-2 col-xs-4 back-btn my-2 m-md-2 fm-kufi-regular text-sm",children:(0,t.t)("common.back")}),!Y.step.hideNext&&(0,D.jsx)(r.$,{onClick:()=>{Y.step.hasFormToSubmit?($(!0),setTimeout(()=>{$(!1)},1e3)):Y.step.submit?J():G()},className:"action-btn col-md-2 col-xs-4 my-2 m-md-2 fm-kufi-regular text-sm "+(L?"bg-disabled-color text-dark":"submit-btn"),disabled:L,children:Y.step.nextLabel||(0,t.t)("common.next")})]})]}),(0,D.jsx)(r.$,{onClick:()=>A("/government-services/dls",{replace:!0}),className:"exit-btn fm-kufi-regular text-sm action-btn w-100 d-md-none",children:(0,t.t)("common.exitFromService")})]})}},39998(e,a,l){var t=l(58168),r=l(64467),n=l(98139),s=l.n(n),o=l(65043),i=l(35296),d=function(e,a){var l={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(l[t]=e[t]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)a.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(l[t[r]]=e[t[r]])}return l};const c=function(e){var a=o.useContext(i.QO),l=a.getPrefixCls,n=a.direction,c=e.prefixCls,u=e.type,m=void 0===u?"horizontal":u,h=e.orientation,p=void 0===h?"center":h,y=e.orientationMargin,g=e.className,b=e.children,f=e.dashed,x=e.plain,v=d(e,["prefixCls","type","orientation","orientationMargin","className","children","dashed","plain"]),S=l("divider",c),N=p.length>
1760?"-".concat(p):p,j=!!b,A="left"===p&&null!=y,C="right"===p&&null!=y,w=s()(S,"".concat(S,"-").concat(m),(0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)({},"".concat(S,"-with-text"),j),"".concat(S,"-with-text").concat(N),j),"".concat(S,"-dashed"),!!f),"".concat(S,"-plain"),!!x),"".concat(S,"-rtl"),"rtl"===n),"".concat(S,"-no-default-orientation-margin-left"),A),"".concat(S,"-no-default-orientation-margin-right"),C),g),k=(0,t.A)((0,t.A)({},A&&{marginLeft:y}),C&&{marginRight:y});return o.createElement("div",(0,t.A)({className:w},v,{role:"separator"}),b&&"vertical"!==m&&o.createElement("span",{className:"".concat(S,"-inner-text"),style:k},b))};l.d(a,["A",0,c])},9180(e,a,l){l.d(a,{o:()=>t});var t=function(){};t.displayName="ColumnGroup",t.defaultProps={__TYPE:"ColumnGroup"}},29908(e,a,l){l.d(a,{f:()=>s});var t=l(65043),r=l(4504);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var t in l)Object.prototype.hasOwnProperty.call(l,t)&&(e[t]=l[t])}return e},n.apply(this,arguments)}var s=function e(a){var l=r.BF.findDiffKeys(a,e.defaultProps);return t.createElement("tr",n({className:a.className,style:a.style},l),a.children)};s.displayName="Row",s.defaultProps={__TYPE:"Row",style:null,className:null}}}]); 177//# sourceMappingURL=8140.0a84e738.chunk.js.map
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.