@djb25/digit-ui-module-commonpt 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Loader, VerticalTimeline, FormComposer, Toast, Card, CardText, StatusTable, Row, SubmitBar, Banner, Header, ResponseComposer, Table, Modal, KeyNote, Dropdown, Localities, OTPInput, CardLabelError, FormStep, UploadFile, RadioButtons, DatePicker, CardSubHeader, PDFSvg, LabelFieldPair, CardLabel, MultiUploadWrapper, CardHeader, CardSectionHeader, CheckBox, TextInput, LinkButton, Close as Close$e, ViewsIcon, BreakLine, TelePhone, DisplayPhotos, InfoBannerIcon, EditIcon, CheckPoint, ConnectingCheckPoints, ActionBar, Menu, ButtonSelector, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, CollapsibleCardPage, Label, AddressDetails, DeleteIcon, MobileNumber, RadioOrSelect, TextArea, SearchForm, SearchField, DetailsCard, TickMark, PropertyHouse, EmployeeModuleCard, CitizenHomeCard, PTIcon } from '@djb25/digit-ui-react-components';
1
+ import { Loader, VerticalTimeline, FormComposer, Toast, Card, CardText, StatusTable, Row, SubmitBar, Banner, Header, ResponseComposer, Table, Modal, KeyNote, Dropdown, Localities, OTPInput, CardLabelError, FormStep, UploadFile, RadioButtons, DatePicker, CardSubHeader, PDFSvg, LabelFieldPair, CardLabel, MultiUploadWrapper, CardHeader, CardSectionHeader, CheckBox, TextInput, LinkButton, Close as Close$e, ViewsIcon, BreakLine, TelePhone, DisplayPhotos, InfoBannerIcon, EditIcon, CheckPoint, ConnectingCheckPoints, ActionBar, Menu, ButtonSelector, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, CollapsibleCardPage, AddressDetails, DeleteIcon, MobileNumber, RadioOrSelect, TextArea, SearchForm, SearchField, DetailsCard, TickMark, Label, PropertyHouse, EmployeeModuleCard, CitizenHomeCard, PTIcon } from '@djb25/digit-ui-react-components';
2
2
  import React, { useState, useEffect, useRef, useLayoutEffect, useMemo, Fragment as Fragment$1, memo, useCallback } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useHistory, useRouteMatch, Switch, Route, Link, useParams } from 'react-router-dom';
@@ -5897,7 +5897,7 @@ var lodash = createCommonjsModule(function (module, exports) {
5897
5897
  });
5898
5898
 
5899
5899
  const setAddressDetailsLW = data => {
5900
- var _address$city, _address$city2, _address$locality, _address$locality2, _address$locality3, _address$locality4, _address$zro, _address$addressType, _address$subLocality, _address$wardRemark;
5900
+ var _address$city, _address$city2, _address$locality, _address$locality2, _address$locality3, _address$locality4, _address$zro, _address$addressType, _address$subLocality, _address$actualWard, _address$actualAssemb, _address$actualZone;
5901
5901
  let {
5902
5902
  locationDet,
5903
5903
  propertyAddress
@@ -5926,7 +5926,9 @@ const setAddressDetailsLW = data => {
5926
5926
  zroLocation: (address === null || address === void 0 ? void 0 : (_address$zro = address.zro) === null || _address$zro === void 0 ? void 0 : _address$zro.code) || (address === null || address === void 0 ? void 0 : address.zro),
5927
5927
  addressType: (address === null || address === void 0 ? void 0 : (_address$addressType = address.addressType) === null || _address$addressType === void 0 ? void 0 : _address$addressType.code) || (address === null || address === void 0 ? void 0 : address.addressType),
5928
5928
  subLocality: (address === null || address === void 0 ? void 0 : address.subLocality) || (address === null || address === void 0 ? void 0 : (_address$subLocality = address.subLocality) === null || _address$subLocality === void 0 ? void 0 : _address$subLocality.name) || (address === null || address === void 0 ? void 0 : address.subLocality),
5929
- wardRemark: (address === null || address === void 0 ? void 0 : address.wardRemark) || (address === null || address === void 0 ? void 0 : (_address$wardRemark = address.wardRemark) === null || _address$wardRemark === void 0 ? void 0 : _address$wardRemark.name) || (address === null || address === void 0 ? void 0 : address.wardRemark)
5929
+ actualWard: (address === null || address === void 0 ? void 0 : address.actualWard) || (address === null || address === void 0 ? void 0 : (_address$actualWard = address.actualWard) === null || _address$actualWard === void 0 ? void 0 : _address$actualWard.name) || (address === null || address === void 0 ? void 0 : address.actualWard),
5930
+ actualAssembly: (address === null || address === void 0 ? void 0 : address.actualAssembly) || (address === null || address === void 0 ? void 0 : (_address$actualAssemb = address.actualAssembly) === null || _address$actualAssemb === void 0 ? void 0 : _address$actualAssemb.name) || (address === null || address === void 0 ? void 0 : address.actualAssembly),
5931
+ actualZone: (address === null || address === void 0 ? void 0 : address.actualZone) || (address === null || address === void 0 ? void 0 : (_address$actualZone = address.actualZone) === null || _address$actualZone === void 0 ? void 0 : _address$actualZone.name) || (address === null || address === void 0 ? void 0 : address.actualZone)
5930
5932
  };
5931
5933
  data.address = propAddress;
5932
5934
  return data;
@@ -7733,7 +7735,7 @@ const PropertySearchResults = ({
7733
7735
  }
7734
7736
  });
7735
7737
  const searchResults = (_ref = properties || []) === null || _ref === void 0 ? void 0 : _ref.map(property => {
7736
- var _sort, _sort$, _addr$locality, _addr$locality2, _addr$locality3, _addr$locality4, _payment$property$pro, _payment$property$pro2, _2, _property$owners, _property$owners$;
7738
+ var _sort, _sort$, _addr$locality, _addr$locality2, _addr$locality3, _addr$locality4, _property$address, _property$address2, _payment$property$pro, _payment$property$pro2, _2, _property$owners, _property$owners$;
7737
7739
  let addr = (property === null || property === void 0 ? void 0 : property.address) || {};
7738
7740
  return {
7739
7741
  property_id: property === null || property === void 0 ? void 0 : property.propertyId,
@@ -7741,7 +7743,8 @@ const PropertySearchResults = ({
7741
7743
  var _a$additionalDetails, _b$additionalDetails;
7742
7744
  return ((a === null || a === void 0 ? void 0 : (_a$additionalDetails = a.additionalDetails) === null || _a$additionalDetails === void 0 ? void 0 : _a$additionalDetails.ownerSequence) || 0) - ((b === null || b === void 0 ? void 0 : (_b$additionalDetails = b.additionalDetails) === null || _b$additionalDetails === void 0 ? void 0 : _b$additionalDetails.ownerSequence) || 0);
7743
7745
  })) === null || _sort === void 0 ? void 0 : (_sort$ = _sort[0]) === null || _sort$ === void 0 ? void 0 : _sort$.name,
7744
- property_address: [addr.doorNo || "", addr.buildingName || "", addr.street || "", t(`TENANTS_MOHALLA_${(_addr$locality = addr.locality) === null || _addr$locality === void 0 ? void 0 : _addr$locality.code}`) !== `TENANTS_MOHALLA_${(_addr$locality2 = addr.locality) === null || _addr$locality2 === void 0 ? void 0 : _addr$locality2.code}` ? t(`TENANTS_MOHALLA_${(_addr$locality3 = addr.locality) === null || _addr$locality3 === void 0 ? void 0 : _addr$locality3.code}`) : ((_addr$locality4 = addr.locality) === null || _addr$locality4 === void 0 ? void 0 : _addr$locality4.name) || "", t(addr.tenantId) || ""].filter(a => a).join(", "),
7746
+ property_address: [addr.doorNo || "", addr.buildingName || "", addr.street || "", t(`TENANTS_MOHALLA_${(_addr$locality = addr.locality) === null || _addr$locality === void 0 ? void 0 : _addr$locality.code}`) !== `TENANTS_MOHALLA_${(_addr$locality2 = addr.locality) === null || _addr$locality2 === void 0 ? void 0 : _addr$locality2.code}` ? t(`TENANTS_MOHALLA_${(_addr$locality3 = addr.locality) === null || _addr$locality3 === void 0 ? void 0 : _addr$locality3.code}`) : ((_addr$locality4 = addr.locality) === null || _addr$locality4 === void 0 ? void 0 : _addr$locality4.name) || ""].filter(a => a).join(", "),
7747
+ zroLocation: (property === null || property === void 0 ? void 0 : (_property$address = property.address) === null || _property$address === void 0 ? void 0 : _property$address.zroLocation) || (property === null || property === void 0 ? void 0 : (_property$address2 = property.address) === null || _property$address2 === void 0 ? void 0 : _property$address2.zroLocation),
7745
7748
  total_due: ((_payment$property$pro = payment[property === null || property === void 0 ? void 0 : property.propertyId]) === null || _payment$property$pro === void 0 ? void 0 : _payment$property$pro.total_due) || 0,
7746
7749
  bil_due__date: ((_payment$property$pro2 = payment[property === null || property === void 0 ? void 0 : property.propertyId]) === null || _payment$property$pro2 === void 0 ? void 0 : _payment$property$pro2.bil_due__date) || t("N/A"),
7747
7750
  status: t(property.status),
@@ -7855,6 +7858,10 @@ const PropertySearchResults = ({
7855
7858
  Header: t("PT_PROPERTY_ADDRESS_SUB_HEADER"),
7856
7859
  disableSortBy: true,
7857
7860
  accessor: "property_address"
7861
+ }, {
7862
+ Header: t("zroLocation"),
7863
+ disableSortBy: true,
7864
+ accessor: "zroLocation"
7858
7865
  }]
7859
7866
  })), modalData ? /*#__PURE__*/React.createElement(Modal, {
7860
7867
  hideSubmit: true,
@@ -9231,9 +9238,7 @@ const configWSApproverApplication = ({
9231
9238
  error
9232
9239
  }) => {
9233
9240
  var _action$action;
9234
- let checkCondtions = true;
9235
- if (action !== null && action !== void 0 && (_action$action = action.action) !== null && _action$action !== void 0 && _action$action.includes("SEND_BACK") || (action === null || action === void 0 ? void 0 : action.action) == "APPROVE_FOR_CONNECTION") checkCondtions = false;
9236
- if (action.isTerminateState) checkCondtions = false;
9241
+ if (action !== null && action !== void 0 && (_action$action = action.action) !== null && _action$action !== void 0 && _action$action.includes("SEND_BACK") || (action === null || action === void 0 ? void 0 : action.action) == "APPROVE_FOR_CONNECTION") ;
9237
9242
  return {
9238
9243
  label: {
9239
9244
  heading: `WF_${action === null || action === void 0 ? void 0 : action.action}_APPLICATION`,
@@ -9242,18 +9247,6 @@ const configWSApproverApplication = ({
9242
9247
  },
9243
9248
  form: [{
9244
9249
  body: [{
9245
- label: !checkCondtions ? null : t("WF_ASSIGNEE_NAME_LABEL"),
9246
- placeholder: !checkCondtions ? null : t("WF_ASSIGNEE_NAME_PLACEHOLDER"),
9247
- type: "dropdown",
9248
- populators: !checkCondtions ? null : /*#__PURE__*/React.createElement(Dropdown, {
9249
- option: approvers,
9250
- autoComplete: "off",
9251
- optionKey: "name",
9252
- id: "fieldInspector",
9253
- select: setSelectedApprover,
9254
- selected: selectedApprover
9255
- })
9256
- }, {
9257
9250
  label: t("WF_COMMON_COMMENTS"),
9258
9251
  type: "textarea",
9259
9252
  populators: {
@@ -9293,10 +9286,8 @@ const configWSDisConnectApplication = ({
9293
9286
  error
9294
9287
  }) => {
9295
9288
  var _action$action;
9296
- let checkCondtions = true,
9297
- isDatePickerDisplay = false;
9298
- if (action !== null && action !== void 0 && (_action$action = action.action) !== null && _action$action !== void 0 && _action$action.includes("SEND_BACK") || (action === null || action === void 0 ? void 0 : action.action) == "APPROVE_FOR_DISCONNECTION" || (action === null || action === void 0 ? void 0 : action.action) == "RESUBMIT_APPLICATION") checkCondtions = false;
9299
- if (action.isTerminateState) checkCondtions = false;
9289
+ let isDatePickerDisplay = false;
9290
+ if (action !== null && action !== void 0 && (_action$action = action.action) !== null && _action$action !== void 0 && _action$action.includes("SEND_BACK") || (action === null || action === void 0 ? void 0 : action.action) == "APPROVE_FOR_DISCONNECTION" || (action === null || action === void 0 ? void 0 : action.action) == "RESUBMIT_APPLICATION") ;
9300
9291
  if ((action === null || action === void 0 ? void 0 : action.action) == "EXECUTE_DISCONNECTION" || (action === null || action === void 0 ? void 0 : action.action) == "DISCONNECTION_EXECUTED") isDatePickerDisplay = true;
9301
9292
  return {
9302
9293
  label: {
@@ -9305,19 +9296,7 @@ const configWSDisConnectApplication = ({
9305
9296
  cancel: "CS_COMMON_CANCEL"
9306
9297
  },
9307
9298
  form: [{
9308
- body: [{
9309
- label: !checkCondtions ? null : t("WF_ASSIGNEE_NAME_LABEL"),
9310
- placeholder: !checkCondtions ? null : t("WF_ASSIGNEE_NAME_PLACEHOLDER"),
9311
- type: "dropdown",
9312
- populators: !checkCondtions ? null : /*#__PURE__*/React.createElement(Dropdown, {
9313
- option: approvers,
9314
- autoComplete: "off",
9315
- optionKey: "name",
9316
- id: "fieldInspector",
9317
- select: setSelectedApprover,
9318
- selected: selectedApprover
9319
- })
9320
- }, isDatePickerDisplay && {
9299
+ body: [isDatePickerDisplay && {
9321
9300
  label: t("ES_FSM_ACTION_SERVICE_DATE"),
9322
9301
  isMandatory: isDatePickerDisplay ? true : false,
9323
9302
  type: "custom",
@@ -14022,7 +14001,7 @@ function PropertyDocuments({
14022
14001
  }));
14023
14002
  };
14024
14003
  const renderDocumentRow = (value, index) => {
14025
- var _pdfFiles$value$fileS;
14004
+ var _pdfFiles$value$fileS, _value$originalDoc, _value$originalDoc$ad;
14026
14005
  const fileUrl = (_pdfFiles$value$fileS = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS === void 0 ? void 0 : _pdfFiles$value$fileS.split(",")[0];
14027
14006
  const docSubType = getDocSubType(value === null || value === void 0 ? void 0 : value.documentType);
14028
14007
  const docUid = (value === null || value === void 0 ? void 0 : value.documentUid) || "";
@@ -14110,6 +14089,15 @@ function PropertyDocuments({
14110
14089
  width: "18px",
14111
14090
  height: "18px",
14112
14091
  accentColor: "#F47738"
14092
+ },
14093
+ defaultChecked: value === null || value === void 0 ? void 0 : (_value$originalDoc = value.originalDoc) === null || _value$originalDoc === void 0 ? void 0 : (_value$originalDoc$ad = _value$originalDoc.additionalDetails) === null || _value$originalDoc$ad === void 0 ? void 0 : _value$originalDoc$ad.isDocumentVerified,
14094
+ onChange: e => {
14095
+ if (value !== null && value !== void 0 && value.originalDoc) {
14096
+ if (!value.originalDoc.additionalDetails) {
14097
+ value.originalDoc.additionalDetails = {};
14098
+ }
14099
+ value.originalDoc.additionalDetails.isDocumentVerified = e.target.checked;
14100
+ }
14113
14101
  }
14114
14102
  }), "Check Verified"))
14115
14103
  })));
@@ -17177,6 +17165,7 @@ const App = ({
17177
17165
  const getBreadcrumbLabel = () => {
17178
17166
  const pathname = location.pathname;
17179
17167
  if (pathname.includes("/commonpt/search")) return "SEARCH_PROPERTY";else if (pathname.includes("/view-property")) return "PT_PROPERTY_INFORMATION";
17168
+ if (pathname.includes("/property/new-application")) return "PT_CREATE_PROPERTY";
17180
17169
  return "ES_COMMON_INBOX";
17181
17170
  };
17182
17171
  const breadcrumbs = [{
@@ -17765,398 +17754,158 @@ const PropertyAssemblyDetails = ({
17765
17754
  }, errors === null || errors === void 0 ? void 0 : (_errors$usageCategory2 = errors.usageCategoryMajor) === null || _errors$usageCategory2 === void 0 ? void 0 : _errors$usageCategory2.message));
17766
17755
  };
17767
17756
 
17768
- const getAddress = (address, t) => {
17769
- return `${address !== null && address !== void 0 && address.doorNo ? `${address === null || address === void 0 ? void 0 : address.doorNo}, ` : ""} ${address !== null && address !== void 0 && address.street ? `${address === null || address === void 0 ? void 0 : address.street}, ` : ""}${address !== null && address !== void 0 && address.landmark ? `${address === null || address === void 0 ? void 0 : address.landmark}, ` : ""}${t(Digit.Utils.pt.getMohallaLocale(address === null || address === void 0 ? void 0 : address.locality.code, address === null || address === void 0 ? void 0 : address.tenantId))}, ${t(Digit.Utils.pt.getCityLocale(address === null || address === void 0 ? void 0 : address.tenantId))}${address !== null && address !== void 0 && address.pincode && t(address === null || address === void 0 ? void 0 : address.pincode) ? `, ${address.pincode}` : " "}`;
17770
- };
17771
- const PropertySearchNSummary = ({
17772
- config,
17757
+ const PropertyLocationDetails = ({
17758
+ address,
17759
+ actionCancelOnSubmit,
17760
+ isEdit,
17773
17761
  onSelect,
17774
- userType,
17775
- formData,
17776
- setError,
17777
- formState,
17778
- clearErrors
17762
+ config,
17763
+ hideZRO,
17764
+ formData: formDataProp,
17765
+ ...props
17779
17766
  }) => {
17780
- var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3, _propertyDetails$Prop3, _propertyDetails$Prop4, _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop7, _propertyDetails$Prop8;
17767
+ var _formDataProp$cpt2;
17781
17768
  const {
17782
17769
  t
17783
17770
  } = useTranslation();
17784
- const history = useHistory();
17785
- let {
17786
- pathname,
17787
- state
17788
- } = useLocation();
17789
- state = state && (typeof state === "string" || state instanceof String) ? JSON.parse(state) : state;
17790
- const isEditScreen = pathname.includes("/modify-application/");
17791
- const tenantId = Digit.ULBService.getCurrentTenantId();
17792
- const isEmpNewApplication = window.location.href.includes("/employee/tl/new-application");
17793
- const isEmpRenewLicense = window.location.href.includes("/employee/tl/renew-application-details") || window.location.href.includes("/employee/tl/edit-application-details");
17794
- const search = useLocation().search;
17795
- const urlPropertyId = new URLSearchParams(search).get("propertyId");
17796
- const [propertyId, setPropertyId] = useState((formData === null || formData === void 0 ? void 0 : (_formData$cptId = formData.cptId) === null || _formData$cptId === void 0 ? void 0 : _formData$cptId.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || "");
17797
- const [searchPropertyId, setSearchPropertyId] = useState(urlPropertyId !== "null" ? urlPropertyId : "");
17798
17771
  const [showToast, setShowToast] = useState(null);
17799
- const isMobile = window.Digit.Utils.browser.isMobile();
17800
- const serachParams = window.location.href.includes("?") ? window.location.href.substring(window.location.href.indexOf("?") + 1, window.location.href.length) : "";
17801
- const {
17802
- isLoading,
17803
- isError,
17804
- error,
17805
- data: propertyDetails
17806
- } = Digit.Hooks.pt.usePropertySearch({
17807
- filters: {
17808
- propertyIds: searchPropertyId
17809
- },
17810
- tenantId: tenantId
17811
- }, {
17812
- filters: {
17813
- propertyIds: searchPropertyId
17814
- },
17815
- tenantId: tenantId,
17816
- enabled: searchPropertyId ? true : false,
17817
- privacy: Digit.Utils.getPrivacyObject()
17772
+ const [formData, setFormData] = useState({
17773
+ addressType: (address === null || address === void 0 ? void 0 : address.addressType) || "",
17774
+ pincode: (address === null || address === void 0 ? void 0 : address.pinCode) || "",
17775
+ city: (address === null || address === void 0 ? void 0 : address.city) || "",
17776
+ locality: (address === null || address === void 0 ? void 0 : address.locality) || "",
17777
+ streetName: (address === null || address === void 0 ? void 0 : address.streetName) || "",
17778
+ houseNo: (address === null || address === void 0 ? void 0 : address.houseNumber) || "",
17779
+ houseName: (address === null || address === void 0 ? void 0 : address.houseName) || "",
17780
+ landmark: (address === null || address === void 0 ? void 0 : address.landmark) || "",
17781
+ addressLine1: (address === null || address === void 0 ? void 0 : address.address) || "",
17782
+ addressLine2: (address === null || address === void 0 ? void 0 : address.address2) || "",
17783
+ latitude: (address === null || address === void 0 ? void 0 : address.latitude) || "",
17784
+ longitude: (address === null || address === void 0 ? void 0 : address.longitude) || "",
17785
+ assembly: (address === null || address === void 0 ? void 0 : address.assembly) || "",
17786
+ block: (address === null || address === void 0 ? void 0 : address.block) || "",
17787
+ zone: (address === null || address === void 0 ? void 0 : address.zone) || "",
17788
+ zroLocation: (address === null || address === void 0 ? void 0 : address.zroLocation) || "",
17789
+ subLocality: (address === null || address === void 0 ? void 0 : address.subLocality) || "",
17790
+ actualAssembly: (address === null || address === void 0 ? void 0 : address.actualAssembly) || "",
17791
+ actualWard: (address === null || address === void 0 ? void 0 : address.actualWard) || "",
17792
+ actualZone: (address === null || address === void 0 ? void 0 : address.actualZone) || ""
17818
17793
  });
17794
+ const isPropertyFound = window.location.href.includes("ws/old-application");
17819
17795
  useEffect(() => {
17820
- if (propertyId && (window.location.href.includes("/renew-application-details/") || window.location.href.includes("/edit-application-details/"))) setSearchPropertyId(propertyId);
17821
- }, [propertyId]);
17822
- useEffect(() => {
17823
- var _propertyDetails$Prop;
17824
- if (isLoading == false && error && error == true || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop.length) == 0) {
17825
- setShowToast({
17826
- error: true,
17827
- label: "PT_ENTER_VALID_PROPERTY_ID"
17796
+ if (props.register) {
17797
+ props.register({
17798
+ name: "cpt"
17799
+ });
17800
+ props.register({
17801
+ name: "cptId"
17828
17802
  });
17829
17803
  }
17830
- }, [error, propertyDetails]);
17804
+ }, [props.register]);
17831
17805
  useEffect(() => {
17832
- onSelect("cpt", {
17833
- details: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]
17834
- });
17835
- sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]));
17836
- localStorage.setItem("pgrProperty", JSON.stringify(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]));
17837
- }, [propertyDetails, pathname]);
17838
- const searchProperty = () => {
17839
- if (!propertyId) {
17840
- setShowToast({
17841
- error: true,
17842
- label: "PT_ENTER_PROPERTY_ID_AND_SEARCH"
17806
+ var _formDataProp$cpt;
17807
+ if (formDataProp !== null && formDataProp !== void 0 && (_formDataProp$cpt = formDataProp.cpt) !== null && _formDataProp$cpt !== void 0 && _formDataProp$cpt.details) {
17808
+ var _addressData$locality, _addressData$geoLocat, _addressData$geoLocat2, _addressData$locality2, _addressData$geoLocat3, _addressData$geoLocat4, _addressData$locality3, _addressData$addition, _addressData$addition2, _addressData$addition3, _addressData$addition4, _addressData$addition5, _addressData$addition6, _addressData$addition7, _addressData$addition8, _addressData$addition9, _addressData$addition0, _addressData$addition1, _addressData$addition10, _addressData$addition11;
17809
+ const details = formDataProp.cpt.details;
17810
+ const addressData = details.address || {};
17811
+ const additionalDetails = details.additionalDetails || {};
17812
+ const localityCode = ((_addressData$locality = addressData.locality) === null || _addressData$locality === void 0 ? void 0 : _addressData$locality.code) || addressData.locality || "";
17813
+ const lat = (_addressData$geoLocat = addressData.geoLocation) !== null && _addressData$geoLocat !== void 0 && _addressData$geoLocat.latitude && ((_addressData$geoLocat2 = addressData.geoLocation) === null || _addressData$geoLocat2 === void 0 ? void 0 : _addressData$geoLocat2.latitude) !== 0 ? addressData.geoLocation.latitude : ((_addressData$locality2 = addressData.locality) === null || _addressData$locality2 === void 0 ? void 0 : _addressData$locality2.latitude) || addressData.latitude || "";
17814
+ const lng = (_addressData$geoLocat3 = addressData.geoLocation) !== null && _addressData$geoLocat3 !== void 0 && _addressData$geoLocat3.longitude && ((_addressData$geoLocat4 = addressData.geoLocation) === null || _addressData$geoLocat4 === void 0 ? void 0 : _addressData$geoLocat4.longitude) !== 0 ? addressData.geoLocation.longitude : ((_addressData$locality3 = addressData.locality) === null || _addressData$locality3 === void 0 ? void 0 : _addressData$locality3.longitude) || addressData.longitude || "";
17815
+ const zroCode = addressData.zroLocation || additionalDetails.zroLocation || ((_addressData$addition = addressData.additionalDetails) === null || _addressData$addition === void 0 ? void 0 : _addressData$addition.zroLocation) || "";
17816
+ const zroValue = zroCode ? {
17817
+ code: zroCode,
17818
+ name: zroCode,
17819
+ i18nKey: zroCode
17820
+ } : "";
17821
+ setFormData({
17822
+ pincode: addressData.pincode || "",
17823
+ city: addressData.city || "",
17824
+ locality: localityCode,
17825
+ streetName: addressData.street || "",
17826
+ houseNo: addressData.houseNo || "",
17827
+ landmark: addressData.landmark || "",
17828
+ latitude: lat,
17829
+ longitude: lng,
17830
+ assembly: additionalDetails.assembly || ((_addressData$addition2 = addressData.additionalDetails) === null || _addressData$addition2 === void 0 ? void 0 : _addressData$addition2.assembly) || "",
17831
+ block: additionalDetails.block || ((_addressData$addition3 = addressData.additionalDetails) === null || _addressData$addition3 === void 0 ? void 0 : _addressData$addition3.block) || "",
17832
+ zone: additionalDetails.zone || ((_addressData$addition4 = addressData.additionalDetails) === null || _addressData$addition4 === void 0 ? void 0 : _addressData$addition4.zone) || "",
17833
+ zroLocation: zroCode,
17834
+ zro: zroValue,
17835
+ subLocality: addressData.subLocality || "",
17836
+ actualAssembly: addressData.actualAssembly || additionalDetails.actualAssembly || ((_addressData$addition5 = addressData.additionalDetails) === null || _addressData$addition5 === void 0 ? void 0 : _addressData$addition5.actualAssembly) || "",
17837
+ actualWard: addressData.actualWard || additionalDetails.actualWard || ((_addressData$addition6 = addressData.additionalDetails) === null || _addressData$addition6 === void 0 ? void 0 : _addressData$addition6.actualWard) || "",
17838
+ actualZone: addressData.actualZone || additionalDetails.actualZone || ((_addressData$addition7 = addressData.additionalDetails) === null || _addressData$addition7 === void 0 ? void 0 : _addressData$addition7.actualZone) || "",
17839
+ address: {
17840
+ ...addressData,
17841
+ city: addressData.city || "",
17842
+ pincode: addressData.pincode || "",
17843
+ locality: localityCode,
17844
+ streetName: addressData.street || "",
17845
+ houseNo: addressData.houseNo || "",
17846
+ addressLine1: addressData.street || "",
17847
+ latitude: lat,
17848
+ longitude: lng,
17849
+ zroLocation: zroCode,
17850
+ zro: zroValue,
17851
+ assembly: additionalDetails.assembly || ((_addressData$addition8 = addressData.additionalDetails) === null || _addressData$addition8 === void 0 ? void 0 : _addressData$addition8.assembly) || "",
17852
+ block: additionalDetails.block || ((_addressData$addition9 = addressData.additionalDetails) === null || _addressData$addition9 === void 0 ? void 0 : _addressData$addition9.block) || "",
17853
+ zone: additionalDetails.zone || ((_addressData$addition0 = addressData.additionalDetails) === null || _addressData$addition0 === void 0 ? void 0 : _addressData$addition0.zone) || "",
17854
+ subLocality: addressData.subLocality || "",
17855
+ actualWard: addressData.actualWard || additionalDetails.actualWard || ((_addressData$addition1 = addressData.additionalDetails) === null || _addressData$addition1 === void 0 ? void 0 : _addressData$addition1.actualWard) || "",
17856
+ actualZone: addressData.actualZone || additionalDetails.actualZone || ((_addressData$addition10 = addressData.additionalDetails) === null || _addressData$addition10 === void 0 ? void 0 : _addressData$addition10.actualZone) || "",
17857
+ actualAssembly: addressData.actualAssembly || additionalDetails.actualAssembly || ((_addressData$addition11 = addressData.additionalDetails) === null || _addressData$addition11 === void 0 ? void 0 : _addressData$addition11.actualAssembly) || ""
17858
+ }
17843
17859
  });
17844
- }
17845
- setSearchPropertyId(propertyId);
17846
- if (window.location.pathname.includes("/tl/new-application")) {
17847
- history.push(`/digit-ui/employee/tl/new-application?propertyId=${propertyId}`);
17848
- const scrollConst = 1600;
17849
- setTimeout(() => window.scrollTo(0, scrollConst), 0);
17850
- } else if (window.location.pathname.includes("/ws/new-application")) history.push(`/digit-ui/employee/ws/new-application?propertyId=${propertyId}`);
17851
- };
17852
- const clearSearch = () => {
17853
- setPropertyId("");
17854
- setSearchPropertyId("");
17855
- onSelect(config === null || config === void 0 ? void 0 : config.key, {
17856
- id: ""
17857
- });
17858
- onSelect("cpt", null);
17859
- };
17860
- if (isEditScreen) {
17861
- return /*#__PURE__*/React.createElement(React.Fragment, null);
17862
- }
17863
- let propertyAddress = "";
17864
- if (propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length) {
17865
- var _propertyDetails$Prop2;
17866
- propertyAddress = getAddress(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop2 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.address, t);
17867
- }
17868
- const getInputStyles = () => {
17869
- if (window.location.href.includes("/ws/")) {
17870
- return {
17871
- fontWeight: "700"
17860
+ } else if ((formDataProp === null || formDataProp === void 0 ? void 0 : formDataProp.cpt) === null) {
17861
+ const clearedData = {
17862
+ addressType: "",
17863
+ pincode: "",
17864
+ city: "",
17865
+ locality: "",
17866
+ streetName: "",
17867
+ houseNo: "",
17868
+ houseName: "",
17869
+ landmark: "",
17870
+ addressLine1: "",
17871
+ addressLine2: "",
17872
+ latitude: "",
17873
+ longitude: "",
17874
+ assembly: "",
17875
+ block: "",
17876
+ zone: "",
17877
+ zroLocation: "",
17878
+ subLocality: "",
17879
+ actualWard: "",
17880
+ actualZone: "",
17881
+ actualAssembly: "",
17882
+ zro: "",
17883
+ address: {}
17872
17884
  };
17873
- } else return {};
17874
- };
17875
- const getOwnerNames = propertyData => {
17876
- var _propertyData$owners, _getActiveOwners$sort, _getActiveOwners$sort2;
17877
- const getActiveOwners = propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$owners = propertyData.owners) === null || _propertyData$owners === void 0 ? void 0 : _propertyData$owners.filter(owner => owner === null || owner === void 0 ? void 0 : owner.active);
17878
- const getOwnersList = (_getActiveOwners$sort = getActiveOwners.sort((a, b) => {
17879
- var _a$additionalDetails, _b$additionalDetails;
17880
- return (a === null || a === void 0 ? void 0 : (_a$additionalDetails = a.additionalDetails) === null || _a$additionalDetails === void 0 ? void 0 : _a$additionalDetails.ownerSequence) - (b === null || b === void 0 ? void 0 : (_b$additionalDetails = b.additionalDetails) === null || _b$additionalDetails === void 0 ? void 0 : _b$additionalDetails.ownerSequence);
17881
- })) === null || _getActiveOwners$sort === void 0 ? void 0 : (_getActiveOwners$sort2 = _getActiveOwners$sort.map(activeOwner => activeOwner === null || activeOwner === void 0 ? void 0 : activeOwner.name)) === null || _getActiveOwners$sort2 === void 0 ? void 0 : _getActiveOwners$sort2.join(",");
17882
- return getOwnersList ? getOwnersList : t("NA");
17883
- };
17884
- if (window.location.href.includes("/ws/")) ;
17885
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
17886
- title: t("PT_PROPERTY_SEARCH"),
17885
+ setFormData(clearedData);
17886
+ onSelect((config === null || config === void 0 ? void 0 : config.key) || "address", clearedData);
17887
+ }
17888
+ }, [formDataProp === null || formDataProp === void 0 ? void 0 : (_formDataProp$cpt2 = formDataProp.cpt) === null || _formDataProp$cpt2 === void 0 ? void 0 : _formDataProp$cpt2.details, formDataProp === null || formDataProp === void 0 ? void 0 : formDataProp.cpt]);
17889
+ useEffect(() => {
17890
+ if (showToast) {
17891
+ const timer = setTimeout(() => {
17892
+ setShowToast(null);
17893
+ }, 1000);
17894
+ return () => clearTimeout(timer);
17895
+ }
17896
+ }, [showToast]);
17897
+ return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
17898
+ title: t("PT_LOCATION_DETAILS"),
17887
17899
  defaultOpen: true
17888
- }, (window.location.href.includes("/tl/") ? !((formData === null || formData === void 0 ? void 0 : (_formData$tradedetils = formData.tradedetils) === null || _formData$tradedetils === void 0 ? void 0 : (_formData$tradedetils2 = _formData$tradedetils[0]) === null || _formData$tradedetils2 === void 0 ? void 0 : (_formData$tradedetils3 = _formData$tradedetils2.structureType) === null || _formData$tradedetils3 === void 0 ? void 0 : _formData$tradedetils3.code) === "MOVABLE") && (isEmpNewApplication || isEmpRenewLicense) : true) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(Label, {
17889
- style: getInputStyles()
17890
- }, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
17900
+ }, /*#__PURE__*/React.createElement("div", {
17891
17901
  style: {
17892
- display: "flex",
17893
- gap: "12px"
17894
- }
17895
- }, /*#__PURE__*/React.createElement(TextInput, {
17896
- key: config === null || config === void 0 ? void 0 : config.key,
17897
- value: propertyId,
17898
- onChange: e => {
17899
- setPropertyId(e.target.value);
17900
- onSelect(config === null || config === void 0 ? void 0 : config.key, {
17901
- id: e.target.value
17902
- });
17903
- },
17904
- style: {
17905
- width: "80%",
17906
- float: "left"
17907
- },
17908
- placeholder: `${t("PT_ENTER_PROPERTY_ID")}`
17909
- }), /*#__PURE__*/React.createElement("button", {
17910
- className: "submit-bar",
17911
- type: "button",
17912
- style: {
17913
- color: "white"
17914
- },
17915
- onClick: searchProperty
17916
- }, `${t("PT_SEARCH")}`), /*#__PURE__*/React.createElement("button", {
17917
- className: "submit-bar",
17918
- type: "button",
17919
- style: {
17920
- color: "white"
17921
- },
17922
- onClick: clearSearch
17923
- }, `${t("CLEAR")}`), /*#__PURE__*/React.createElement("span", {
17924
- onClick: () => history.push(`/digit-ui/${userType}/${pathname.split("/")[3]}/create-application/create-property`, {
17925
- ...state,
17926
- ...formData
17927
- })
17928
- }, /*#__PURE__*/React.createElement("button", {
17929
- className: "submit-bar",
17930
- type: "button",
17931
- style: {
17932
- color: "white"
17933
- }
17934
- }, t("CPT_CREATE_PROPERTY"))))), searchPropertyId && propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
17935
- className: "card-with-background",
17936
- style: {
17937
- margin: "16px 0px",
17938
- padding: "20px",
17939
- boxShadow: "none"
17940
- }
17941
- }, /*#__PURE__*/React.createElement(StatusTable, {
17942
- style: {
17943
- padding: "0",
17944
- margin: "0"
17902
+ boxShadow: "none",
17903
+ ...props.style
17945
17904
  }
17946
17905
  }, /*#__PURE__*/React.createElement("div", {
17947
- className: "formcomposer-section-grid",
17948
- style: isMobile ? {} : {}
17949
- }, /*#__PURE__*/React.createElement(Row, {
17950
- className: "border-none",
17951
- labelStyle: isMobile ? {
17952
- width: "40%"
17953
- } : {
17954
- width: "30%",
17955
- color: "#505a5f",
17956
- fontWeight: "600"
17957
- },
17958
- textStyle: {
17959
- color: "#000"
17960
- },
17961
- label: t(`PROPERTY_ID`),
17962
- text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3.propertyId
17963
- }), /*#__PURE__*/React.createElement(Row, {
17964
- className: "border-none",
17965
- labelStyle: isMobile ? {
17966
- width: "40%"
17967
- } : {
17968
- width: "30%",
17969
- color: "#505a5f",
17970
- fontWeight: "600"
17971
- },
17972
- textStyle: {
17973
- color: "#000"
17974
- },
17975
- label: t(`OWNER_NAME`),
17976
- text: getOwnerNames(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0])
17977
- }), /*#__PURE__*/React.createElement(Row, {
17978
- className: "border-none",
17979
- labelStyle: isMobile ? {
17980
- width: "40%"
17981
- } : {
17982
- width: "30%",
17983
- color: "#505a5f",
17984
- fontWeight: "600"
17985
- },
17986
- textStyle: {
17987
- wordBreak: "break-word",
17988
- color: "#000"
17989
- },
17990
- label: t(`PROPERTY_ADDRESS`),
17991
- text: propertyAddress,
17992
- privacy: {
17993
- uuid: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop4 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : (_propertyDetails$Prop5 = _propertyDetails$Prop4.owners) === null || _propertyDetails$Prop5 === void 0 ? void 0 : (_propertyDetails$Prop6 = _propertyDetails$Prop5[0]) === null || _propertyDetails$Prop6 === void 0 ? void 0 : _propertyDetails$Prop6.uuid,
17994
- fieldName: ["doorNo", "street", "landmark"],
17995
- model: "Property",
17996
- showValue: true,
17997
- loadData: {
17998
- serviceName: "/property-services/property/_search",
17999
- requestBody: {},
18000
- requestParam: {
18001
- tenantId: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop7 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop7 === void 0 ? void 0 : _propertyDetails$Prop7.tenantId,
18002
- propertyIds: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop8 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop8 === void 0 ? void 0 : _propertyDetails$Prop8.propertyId
18003
- },
18004
- jsonPath: "Properties[0].address.street",
18005
- d: res => {
18006
- let resultString = (lodash.get(res, "Properties[0].address.doorNo") ? `${lodash.get(res, "Properties[0].address.doorNo")}, ` : "") + (lodash.get(res, "Properties[0].address.street") ? `${lodash.get(res, "Properties[0].address.street")}, ` : "") + (lodash.get(res, "Properties[0].address.landmark") ? `${lodash.get(res, "Properties[0].address.landmark")}` : "");
18007
- return resultString;
18008
- },
18009
- isArray: false
18010
- }
18011
- }
18012
- }))))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
18013
- isDleteBtn: true,
18014
- labelstyle: {
18015
- width: "100%"
18016
- },
18017
- error: showToast.error,
18018
- warning: showToast.warning,
18019
- label: t(showToast.label),
18020
- onClose: () => {
18021
- setShowToast(null);
18022
- }
18023
- }))));
18024
- };
18025
-
18026
- const PropertyLocationDetails = ({
18027
- address,
18028
- actionCancelOnSubmit,
18029
- isEdit,
18030
- onSelect,
18031
- config,
18032
- formData: formDataProp,
18033
- ...props
18034
- }) => {
18035
- var _formDataProp$cpt2;
18036
- const {
18037
- t
18038
- } = useTranslation();
18039
- const [showToast, setShowToast] = useState(null);
18040
- const [formData, setFormData] = useState({
18041
- addressType: (address === null || address === void 0 ? void 0 : address.addressType) || "",
18042
- pincode: (address === null || address === void 0 ? void 0 : address.pinCode) || "",
18043
- city: (address === null || address === void 0 ? void 0 : address.city) || "",
18044
- locality: (address === null || address === void 0 ? void 0 : address.locality) || "",
18045
- streetName: (address === null || address === void 0 ? void 0 : address.streetName) || "",
18046
- houseNo: (address === null || address === void 0 ? void 0 : address.houseNumber) || "",
18047
- houseName: (address === null || address === void 0 ? void 0 : address.houseName) || "",
18048
- landmark: (address === null || address === void 0 ? void 0 : address.landmark) || "",
18049
- addressLine1: (address === null || address === void 0 ? void 0 : address.address) || "",
18050
- addressLine2: (address === null || address === void 0 ? void 0 : address.address2) || "",
18051
- latitude: (address === null || address === void 0 ? void 0 : address.latitude) || "",
18052
- longitude: (address === null || address === void 0 ? void 0 : address.longitude) || "",
18053
- assembly: (address === null || address === void 0 ? void 0 : address.assembly) || "",
18054
- block: (address === null || address === void 0 ? void 0 : address.block) || "",
18055
- zone: (address === null || address === void 0 ? void 0 : address.zone) || "",
18056
- zroLocation: (address === null || address === void 0 ? void 0 : address.zroLocation) || "",
18057
- subLocality: (address === null || address === void 0 ? void 0 : address.subLocality) || "",
18058
- wardRemarks: (address === null || address === void 0 ? void 0 : address.wardRemarks) || ""
18059
- });
18060
- const isPropertyFound = window.location.href.includes("ws/old-application");
18061
- useEffect(() => {
18062
- if (props.register) {
18063
- props.register({
18064
- name: "cpt"
18065
- });
18066
- props.register({
18067
- name: "cptId"
18068
- });
18069
- }
18070
- }, [props.register]);
18071
- useEffect(() => {
18072
- var _formDataProp$cpt;
18073
- if (formDataProp !== null && formDataProp !== void 0 && (_formDataProp$cpt = formDataProp.cpt) !== null && _formDataProp$cpt !== void 0 && _formDataProp$cpt.details) {
18074
- var _addressData$locality, _addressData$geoLocat, _addressData$geoLocat2, _addressData$locality2, _addressData$geoLocat3, _addressData$geoLocat4, _addressData$locality3, _addressData$addition, _addressData$addition2, _addressData$addition3, _addressData$addition4, _addressData$addition5, _addressData$addition6, _addressData$addition7, _addressData$addition8, _addressData$addition9;
18075
- const details = formDataProp.cpt.details;
18076
- const addressData = details.address || {};
18077
- const additionalDetails = details.additionalDetails || {};
18078
- const localityCode = ((_addressData$locality = addressData.locality) === null || _addressData$locality === void 0 ? void 0 : _addressData$locality.code) || addressData.locality || "";
18079
- const lat = (_addressData$geoLocat = addressData.geoLocation) !== null && _addressData$geoLocat !== void 0 && _addressData$geoLocat.latitude && ((_addressData$geoLocat2 = addressData.geoLocation) === null || _addressData$geoLocat2 === void 0 ? void 0 : _addressData$geoLocat2.latitude) !== 0 ? addressData.geoLocation.latitude : ((_addressData$locality2 = addressData.locality) === null || _addressData$locality2 === void 0 ? void 0 : _addressData$locality2.latitude) || addressData.latitude || "";
18080
- const lng = (_addressData$geoLocat3 = addressData.geoLocation) !== null && _addressData$geoLocat3 !== void 0 && _addressData$geoLocat3.longitude && ((_addressData$geoLocat4 = addressData.geoLocation) === null || _addressData$geoLocat4 === void 0 ? void 0 : _addressData$geoLocat4.longitude) !== 0 ? addressData.geoLocation.longitude : ((_addressData$locality3 = addressData.locality) === null || _addressData$locality3 === void 0 ? void 0 : _addressData$locality3.longitude) || addressData.longitude || "";
18081
- const zroCode = addressData.zroLocation || additionalDetails.zroLocation || ((_addressData$addition = addressData.additionalDetails) === null || _addressData$addition === void 0 ? void 0 : _addressData$addition.zroLocation) || "";
18082
- const zroValue = zroCode ? {
18083
- code: zroCode,
18084
- name: zroCode,
18085
- i18nKey: zroCode
18086
- } : "";
18087
- setFormData({
18088
- pincode: addressData.pincode || "",
18089
- city: addressData.city || "",
18090
- locality: localityCode,
18091
- streetName: addressData.street || "",
18092
- houseNo: addressData.houseNo || "",
18093
- landmark: addressData.landmark || "",
18094
- latitude: lat,
18095
- longitude: lng,
18096
- assembly: additionalDetails.assembly || ((_addressData$addition2 = addressData.additionalDetails) === null || _addressData$addition2 === void 0 ? void 0 : _addressData$addition2.assembly) || "",
18097
- block: additionalDetails.block || ((_addressData$addition3 = addressData.additionalDetails) === null || _addressData$addition3 === void 0 ? void 0 : _addressData$addition3.block) || "",
18098
- zone: additionalDetails.zone || ((_addressData$addition4 = addressData.additionalDetails) === null || _addressData$addition4 === void 0 ? void 0 : _addressData$addition4.zone) || "",
18099
- zroLocation: zroCode,
18100
- zro: zroValue,
18101
- subLocality: addressData.subLocality || "",
18102
- wardRemarks: additionalDetails.wardRemarks || ((_addressData$addition5 = addressData.additionalDetails) === null || _addressData$addition5 === void 0 ? void 0 : _addressData$addition5.wardRemarks) || "",
18103
- address: {
18104
- ...addressData,
18105
- city: addressData.city || "",
18106
- pincode: addressData.pincode || "",
18107
- locality: localityCode,
18108
- streetName: addressData.street || "",
18109
- houseNo: addressData.houseNo || "",
18110
- addressLine1: addressData.street || "",
18111
- latitude: lat,
18112
- longitude: lng,
18113
- zroLocation: zroCode,
18114
- zro: zroValue,
18115
- assembly: additionalDetails.assembly || ((_addressData$addition6 = addressData.additionalDetails) === null || _addressData$addition6 === void 0 ? void 0 : _addressData$addition6.assembly) || "",
18116
- block: additionalDetails.block || ((_addressData$addition7 = addressData.additionalDetails) === null || _addressData$addition7 === void 0 ? void 0 : _addressData$addition7.block) || "",
18117
- zone: additionalDetails.zone || ((_addressData$addition8 = addressData.additionalDetails) === null || _addressData$addition8 === void 0 ? void 0 : _addressData$addition8.zone) || "",
18118
- subLocality: addressData.subLocality || "",
18119
- wardRemarks: additionalDetails.wardRemarks || ((_addressData$addition9 = addressData.additionalDetails) === null || _addressData$addition9 === void 0 ? void 0 : _addressData$addition9.wardRemarks) || ""
18120
- }
18121
- });
18122
- } else if ((formDataProp === null || formDataProp === void 0 ? void 0 : formDataProp.cpt) === null) {
18123
- const clearedData = {
18124
- addressType: "",
18125
- pincode: "",
18126
- city: "",
18127
- locality: "",
18128
- streetName: "",
18129
- houseNo: "",
18130
- houseName: "",
18131
- landmark: "",
18132
- addressLine1: "",
18133
- addressLine2: "",
18134
- latitude: "",
18135
- longitude: "",
18136
- assembly: "",
18137
- block: "",
18138
- zone: "",
18139
- zroLocation: "",
18140
- subLocality: "",
18141
- wardRemarks: "",
18142
- zro: "",
18143
- address: {}
18144
- };
18145
- setFormData(clearedData);
18146
- onSelect((config === null || config === void 0 ? void 0 : config.key) || "address", clearedData);
18147
- }
18148
- }, [formDataProp === null || formDataProp === void 0 ? void 0 : (_formDataProp$cpt2 = formDataProp.cpt) === null || _formDataProp$cpt2 === void 0 ? void 0 : _formDataProp$cpt2.details, formDataProp === null || formDataProp === void 0 ? void 0 : formDataProp.cpt]);
18149
- useEffect(() => {
18150
- if (showToast) {
18151
- const timer = setTimeout(() => {
18152
- setShowToast(null);
18153
- }, 1000);
18154
- return () => clearTimeout(timer);
17906
+ style: {
17907
+ marginTop: "20px"
18155
17908
  }
18156
- }, [showToast]);
18157
- return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
18158
- title: t("PT_LOCATION_DETAILS"),
18159
- defaultOpen: true
18160
17909
  }, /*#__PURE__*/React.createElement(AddressDetails, {
18161
17910
  t: t,
18162
17911
  formData: formData,
@@ -18172,10 +17921,11 @@ const PropertyLocationDetails = ({
18172
17921
  ...config
18173
17922
  },
18174
17923
  isEdit: isEdit,
18175
- showZRO: true,
17924
+ showZRO: hideZRO ? false : true,
17925
+ showMapActualLocation: true,
18176
17926
  disable: isPropertyFound,
18177
17927
  hideNextButton: true
18178
- }));
17928
+ }))));
18179
17929
  };
18180
17930
 
18181
17931
  const PropertyOwnerDetails = ({
@@ -18976,7 +18726,7 @@ const PropertyWaterConnection = ({
18976
18726
  })
18977
18727
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails8 = errors.useDetails) === null || _errors$useDetails8 === void 0 ? void 0 : _errors$useDetails8.SelectYearofConstruction) && /*#__PURE__*/React.createElement(CardLabelError, {
18978
18728
  style: errorStyle
18979
- }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_DWELLING_UNITS")}*`), /*#__PURE__*/React.createElement("div", {
18729
+ }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_DWELLING_UNITS")}`), /*#__PURE__*/React.createElement("div", {
18980
18730
  className: "form-field"
18981
18731
  }, /*#__PURE__*/React.createElement(TextInput, {
18982
18732
  t: t,
@@ -18984,8 +18734,7 @@ const PropertyWaterConnection = ({
18984
18734
  pattern: {
18985
18735
  value: NUMBER_PATTERN,
18986
18736
  message: t("ERR_INVALID_NUMBER")
18987
- },
18988
- required: t("REQUIRED_FIELD")
18737
+ }
18989
18738
  }),
18990
18739
  name: "useDetails.NumberofDwellingUnits",
18991
18740
  disabled: isPropertyFound
@@ -19411,84 +19160,363 @@ const PropertyDetails = ({
19411
19160
  filters: {
19412
19161
  propertyIds: (_formData4 = formData) !== null && _formData4 !== void 0 && (_formData4$cptId = _formData4.cptId) !== null && _formData4$cptId !== void 0 && _formData4$cptId.id || (_formData5 = formData) !== null && _formData5 !== void 0 && (_formData5$cpt = _formData5.cpt) !== null && _formData5$cpt !== void 0 && (_formData5$cpt$detail = _formData5$cpt.details) !== null && _formData5$cpt$detail !== void 0 && _formData5$cpt$detail.propertyId ? ((_formData6 = formData) === null || _formData6 === void 0 ? void 0 : (_formData6$knowyourpr = _formData6.knowyourproperty) === null || _formData6$knowyourpr === void 0 ? void 0 : (_formData6$knowyourpr2 = _formData6$knowyourpr.KnowProperty) === null || _formData6$knowyourpr2 === void 0 ? void 0 : _formData6$knowyourpr2.code) === "YES" || sessionStorage.getItem("VisitedLightCreate") === "false" ? (_formData7 = formData) === null || _formData7 === void 0 ? void 0 : (_formData7$cptId = _formData7.cptId) === null || _formData7$cptId === void 0 ? void 0 : _formData7$cptId.id : (_formData8 = formData) === null || _formData8 === void 0 ? void 0 : (_formData8$cpt = _formData8.cpt) === null || _formData8$cpt === void 0 ? void 0 : (_formData8$cpt$detail = _formData8$cpt.details) === null || _formData8$cpt$detail === void 0 ? void 0 : _formData8$cpt$detail.propertyId : window.location.href.includes("/tl/tradelicence/edit-application") || window.location.href.includes("/renew-trade/") ? (_formData9 = formData) === null || _formData9 === void 0 ? void 0 : (_formData9$tradeLicen = _formData9.tradeLicenseDetail) === null || _formData9$tradeLicen === void 0 ? void 0 : (_formData9$tradeLicen2 = _formData9$tradeLicen.additionalDetail) === null || _formData9$tradeLicen2 === void 0 ? void 0 : _formData9$tradeLicen2.propertyId : ((_formData0 = formData) === null || _formData0 === void 0 ? void 0 : (_formData0$cptId = _formData0.cptId) === null || _formData0$cptId === void 0 ? void 0 : _formData0$cptId.id) || ((_formData1 = formData) === null || _formData1 === void 0 ? void 0 : (_formData1$cpt = _formData1.cpt) === null || _formData1$cpt === void 0 ? void 0 : (_formData1$cpt$detail = _formData1$cpt.details) === null || _formData1$cpt$detail === void 0 ? void 0 : _formData1$cpt$detail.propertyId)
19413
19162
  },
19414
- tenantId: tenantId,
19415
- privacy: Digit.Utils.getPrivacyObject()
19163
+ tenantId: tenantId,
19164
+ privacy: Digit.Utils.getPrivacyObject()
19165
+ }, {
19166
+ filters: {
19167
+ propertyIds: (_formData10 = formData) !== null && _formData10 !== void 0 && (_formData10$cptId = _formData10.cptId) !== null && _formData10$cptId !== void 0 && _formData10$cptId.id || (_formData11 = formData) !== null && _formData11 !== void 0 && (_formData11$cpt = _formData11.cpt) !== null && _formData11$cpt !== void 0 && (_formData11$cpt$detai = _formData11$cpt.details) !== null && _formData11$cpt$detai !== void 0 && _formData11$cpt$detai.propertyId ? ((_formData12 = formData) === null || _formData12 === void 0 ? void 0 : (_formData12$knowyourp = _formData12.knowyourproperty) === null || _formData12$knowyourp === void 0 ? void 0 : (_formData12$knowyourp2 = _formData12$knowyourp.KnowProperty) === null || _formData12$knowyourp2 === void 0 ? void 0 : _formData12$knowyourp2.code) === "YES" || sessionStorage.getItem("VisitedLightCreate") === "false" ? (_formData13 = formData) === null || _formData13 === void 0 ? void 0 : (_formData13$cptId = _formData13.cptId) === null || _formData13$cptId === void 0 ? void 0 : _formData13$cptId.id : (_formData14 = formData) === null || _formData14 === void 0 ? void 0 : (_formData14$cpt = _formData14.cpt) === null || _formData14$cpt === void 0 ? void 0 : (_formData14$cpt$detai = _formData14$cpt.details) === null || _formData14$cpt$detai === void 0 ? void 0 : _formData14$cpt$detai.propertyId : window.location.href.includes("/tl/tradelicence/edit-application") || window.location.href.includes("/renew-trade/") ? (_formData15 = formData) === null || _formData15 === void 0 ? void 0 : (_formData15$tradeLice = _formData15.tradeLicenseDetail) === null || _formData15$tradeLice === void 0 ? void 0 : (_formData15$tradeLice2 = _formData15$tradeLice.additionalDetail) === null || _formData15$tradeLice2 === void 0 ? void 0 : _formData15$tradeLice2.propertyId : ((_formData16 = formData) === null || _formData16 === void 0 ? void 0 : (_formData16$cptId = _formData16.cptId) === null || _formData16$cptId === void 0 ? void 0 : _formData16$cptId.id) || ((_formData17 = formData) === null || _formData17 === void 0 ? void 0 : (_formData17$cpt = _formData17.cpt) === null || _formData17$cpt === void 0 ? void 0 : (_formData17$cpt$detai = _formData17$cpt.details) === null || _formData17$cpt$detai === void 0 ? void 0 : _formData17$cpt$detai.propertyId)
19168
+ },
19169
+ tenantId: tenantId,
19170
+ privacy: Digit.Utils.getPrivacyObject()
19171
+ });
19172
+ const onSkip = () => onSelect();
19173
+ const goNext = () => {
19174
+ sessionStorage.setItem("cpt", propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]);
19175
+ onSelect("cpt", {
19176
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]
19177
+ });
19178
+ };
19179
+ const reversedOwners = Array.isArray(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : (_propertyDetails$Prop2 = _propertyDetails$Prop[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.owners) ? propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : (_propertyDetails$Prop4 = _propertyDetails$Prop3[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : _propertyDetails$Prop4.owners.slice().reverse() : [];
19180
+ let propAddArr = [];
19181
+ if (propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length) {
19182
+ var _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop9, _propertyDetails$Prop0, _propertyDetails$Prop1, _propertyDetails$Prop10, _propertyDetails$Prop15, _propertyDetails$Prop16, _propertyDetails$Prop19, _propertyDetails$Prop20, _propertyDetails$Prop21, _propertyDetails$Prop26, _propertyDetails$Prop28, _propertyDetails$Prop29;
19183
+ if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop5 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop5 !== void 0 && (_propertyDetails$Prop6 = _propertyDetails$Prop5.address) !== null && _propertyDetails$Prop6 !== void 0 && _propertyDetails$Prop6.doorNo) {
19184
+ var _propertyDetails$Prop7, _propertyDetails$Prop8;
19185
+ propAddArr.push(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop7 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop7 === void 0 ? void 0 : (_propertyDetails$Prop8 = _propertyDetails$Prop7.address) === null || _propertyDetails$Prop8 === void 0 ? void 0 : _propertyDetails$Prop8.doorNo);
19186
+ }
19187
+ if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop9 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop9 !== void 0 && (_propertyDetails$Prop0 = _propertyDetails$Prop9.address) !== null && _propertyDetails$Prop0 !== void 0 && _propertyDetails$Prop0.street || propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop1 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop1 !== void 0 && (_propertyDetails$Prop10 = _propertyDetails$Prop1.address) !== null && _propertyDetails$Prop10 !== void 0 && _propertyDetails$Prop10.buildingName) {
19188
+ var _propertyDetails$Prop11, _propertyDetails$Prop12, _propertyDetails$Prop13, _propertyDetails$Prop14;
19189
+ propAddArr.push((propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop11 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop11 === void 0 ? void 0 : (_propertyDetails$Prop12 = _propertyDetails$Prop11.address) === null || _propertyDetails$Prop12 === void 0 ? void 0 : _propertyDetails$Prop12.street) || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop13 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop13 === void 0 ? void 0 : (_propertyDetails$Prop14 = _propertyDetails$Prop13.address) === null || _propertyDetails$Prop14 === void 0 ? void 0 : _propertyDetails$Prop14.buildingName));
19190
+ }
19191
+ if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop15 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop15 !== void 0 && (_propertyDetails$Prop16 = _propertyDetails$Prop15.address) !== null && _propertyDetails$Prop16 !== void 0 && _propertyDetails$Prop16.landmark) {
19192
+ var _propertyDetails$Prop17, _propertyDetails$Prop18;
19193
+ propAddArr.push(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop17 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop17 === void 0 ? void 0 : (_propertyDetails$Prop18 = _propertyDetails$Prop17.address) === null || _propertyDetails$Prop18 === void 0 ? void 0 : _propertyDetails$Prop18.landmark);
19194
+ }
19195
+ if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop19 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop19 !== void 0 && (_propertyDetails$Prop20 = _propertyDetails$Prop19.address) !== null && _propertyDetails$Prop20 !== void 0 && (_propertyDetails$Prop21 = _propertyDetails$Prop20.locality) !== null && _propertyDetails$Prop21 !== void 0 && _propertyDetails$Prop21.code) {
19196
+ var _propertyDetails$Prop22, _propertyDetails$Prop23, _propertyDetails$Prop24, _propertyDetails$Prop25;
19197
+ propAddArr.push(t(Digit.Utils.pt.getMohallaLocale(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop22 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop22 === void 0 ? void 0 : (_propertyDetails$Prop23 = _propertyDetails$Prop22.address) === null || _propertyDetails$Prop23 === void 0 ? void 0 : (_propertyDetails$Prop24 = _propertyDetails$Prop23.locality) === null || _propertyDetails$Prop24 === void 0 ? void 0 : _propertyDetails$Prop24.code, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop25 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop25 === void 0 ? void 0 : _propertyDetails$Prop25.tenantId)));
19198
+ }
19199
+ if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop26 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop26 !== void 0 && _propertyDetails$Prop26.tenantId) {
19200
+ var _propertyDetails$Prop27;
19201
+ propAddArr.push(t(Digit.Utils.pt.getCityLocale(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop27 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop27 === void 0 ? void 0 : _propertyDetails$Prop27.tenantId)));
19202
+ }
19203
+ if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop28 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop28 !== void 0 && (_propertyDetails$Prop29 = _propertyDetails$Prop28.address) !== null && _propertyDetails$Prop29 !== void 0 && _propertyDetails$Prop29.pincode) {
19204
+ var _propertyDetails$Prop30, _propertyDetails$Prop31;
19205
+ propAddArr.push(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop30 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop30 === void 0 ? void 0 : (_propertyDetails$Prop31 = _propertyDetails$Prop30.address) === null || _propertyDetails$Prop31 === void 0 ? void 0 : _propertyDetails$Prop31.pincode);
19206
+ }
19207
+ }
19208
+ if (isLoading) {
19209
+ return /*#__PURE__*/React.createElement(Loader, null);
19210
+ }
19211
+ function getChangePropertyPath() {
19212
+ var _formData18, _formData19, _formData20, _formData21, _formData22, _formData23;
19213
+ if (window.location.href.includes("/ws/modify-connection/")) return `/digit-ui/citizen/ws/modify-connection/${(_formData18 = formData) === null || _formData18 === void 0 ? void 0 : _formData18.tenantId}/search-property`;else if (window.location.href.includes("/ws/edit-application/")) return `/digit-ui/citizen/ws/edit-application/${(_formData19 = formData) === null || _formData19 === void 0 ? void 0 : _formData19.tenantId}/search-property`;else if (window.location.href.includes("/ws/")) return `/digit-ui/citizen/ws/create-application/search-property`;else if (window.location.href.includes("/renew-trade/")) return `/digit-ui/citizen/tl/tradelicence/renew-trade/${(_formData20 = formData) === null || _formData20 === void 0 ? void 0 : _formData20.applicationNumber}/${(_formData21 = formData) === null || _formData21 === void 0 ? void 0 : _formData21.tenantId}/know-your-property`;else if (window.location.href.includes("/edit-application/")) return `/digit-ui/citizen/tl/tradelicence/edit-application/${(_formData22 = formData) === null || _formData22 === void 0 ? void 0 : _formData22.applicationNumber}/${(_formData23 = formData) === null || _formData23 === void 0 ? void 0 : _formData23.tenantId}/know-your-property`;else return `/digit-ui/citizen/tl/tradelicence/new-application/know-your-property`;
19214
+ }
19215
+ return /*#__PURE__*/React.createElement(React.Fragment, null, window.location.href.includes("/citizen") ? /*#__PURE__*/React.createElement(CPTTimeline, {
19216
+ currentStep: window.location.href.includes("/ws/") ? 1 : 2,
19217
+ flow: window.location.href.includes("/ws/") ? "WS" : "",
19218
+ businessService: "WS"
19219
+ }) : null, /*#__PURE__*/React.createElement(FormStep, {
19220
+ t: t,
19221
+ config: config,
19222
+ onSelect: goNext,
19223
+ onSkip: onSkip
19224
+ }, propertyDetails && (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties.length) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardHeader, null, t("PT_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
19225
+ className: "border-none",
19226
+ label: t(`PROPERTY_ID`),
19227
+ text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop32 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop32 === void 0 ? void 0 : _propertyDetails$Prop32.propertyId
19228
+ }), /*#__PURE__*/React.createElement(Row, {
19229
+ className: "border-none",
19230
+ label: t(`OWNER_NAME`),
19231
+ text: reversedOwners === null || reversedOwners === void 0 ? void 0 : (_reversedOwners$ = reversedOwners[0]) === null || _reversedOwners$ === void 0 ? void 0 : _reversedOwners$.name
19232
+ }), /*#__PURE__*/React.createElement(Row, {
19233
+ className: "border-none",
19234
+ textStyle: {
19235
+ wordBreak: "break-word"
19236
+ },
19237
+ label: t(`PROPERTY_ADDRESS`),
19238
+ text: propAddArr.join(', '),
19239
+ privacy: {
19240
+ uuid: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop33 = propertyDetails.Properties) === null || _propertyDetails$Prop33 === void 0 ? void 0 : (_propertyDetails$Prop34 = _propertyDetails$Prop33[0]) === null || _propertyDetails$Prop34 === void 0 ? void 0 : (_propertyDetails$Prop35 = _propertyDetails$Prop34.owners) === null || _propertyDetails$Prop35 === void 0 ? void 0 : (_propertyDetails$Prop36 = _propertyDetails$Prop35[0]) === null || _propertyDetails$Prop36 === void 0 ? void 0 : _propertyDetails$Prop36.uuid,
19241
+ fieldName: ["doorNo", "street", "landmark"],
19242
+ model: "Property",
19243
+ showValue: true,
19244
+ loadData: {
19245
+ serviceName: "/property-services/property/_search",
19246
+ requestBody: {},
19247
+ requestParam: {
19248
+ tenantId: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop37 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop37 === void 0 ? void 0 : _propertyDetails$Prop37.tenantId,
19249
+ propertyIds: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop38 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop38 === void 0 ? void 0 : _propertyDetails$Prop38.propertyId
19250
+ },
19251
+ jsonPath: "Properties[0].address.street",
19252
+ d: res => {
19253
+ let resultString = (_.get(res, "Properties[0].address.doorNo") ? `${_.get(res, "Properties[0].address.doorNo")}, ` : "") + (_.get(res, "Properties[0].address.street") ? `${_.get(res, "Properties[0].address.street")}, ` : "") + (_.get(res, "Properties[0].address.landmark") ? `${_.get(res, "Properties[0].address.landmark")}` : "");
19254
+ return resultString;
19255
+ },
19256
+ isArray: false
19257
+ }
19258
+ }
19259
+ }), /*#__PURE__*/React.createElement(Row, {
19260
+ className: "border-none",
19261
+ label: t(`PT_MUTATION_STATUS`),
19262
+ text: t(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop39 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop39 === void 0 ? void 0 : _propertyDetails$Prop39.status)
19263
+ }), /*#__PURE__*/React.createElement("div", {
19264
+ style: {
19265
+ textAlign: "left"
19266
+ }
19267
+ }, /*#__PURE__*/React.createElement(Link, {
19268
+ to: `/digit-ui/citizen/commonpt/view-property?propertyId=${propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop40 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop40 === void 0 ? void 0 : _propertyDetails$Prop40.propertyId}&tenantId=${propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop41 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop41 === void 0 ? void 0 : _propertyDetails$Prop41.tenantId}`
19269
+ }, /*#__PURE__*/React.createElement(LinkButton, {
19270
+ style: {
19271
+ textAlign: "left"
19272
+ },
19273
+ label: t("PT_VIEW_MORE_DETAILS")
19274
+ })), /*#__PURE__*/React.createElement(Link, {
19275
+ to: getChangePropertyPath()
19276
+ }, /*#__PURE__*/React.createElement(LinkButton, {
19277
+ style: {
19278
+ textAlign: "left"
19279
+ },
19280
+ label: t("PT_CHANGE_PROPERTY"),
19281
+ onClick: () => {
19282
+ sessionStorage.setItem("changePropertySelected", "yes");
19283
+ sessionStorage.setItem("EditFormData", JSON.stringify(formData));
19284
+ }
19285
+ })))), /*#__PURE__*/React.createElement(SubmitBar, {
19286
+ style: {
19287
+ marginTop: "10px"
19288
+ },
19289
+ onSubmit: goNext,
19290
+ label: t("CS_COMMON_NEXT")
19291
+ }))));
19292
+ };
19293
+
19294
+ const getAddress = (address, t) => {
19295
+ return `${address !== null && address !== void 0 && address.doorNo ? `${address === null || address === void 0 ? void 0 : address.doorNo}, ` : ""} ${address !== null && address !== void 0 && address.street ? `${address === null || address === void 0 ? void 0 : address.street}, ` : ""}${address !== null && address !== void 0 && address.landmark ? `${address === null || address === void 0 ? void 0 : address.landmark}, ` : ""}${t(Digit.Utils.pt.getMohallaLocale(address === null || address === void 0 ? void 0 : address.locality.code, address === null || address === void 0 ? void 0 : address.tenantId))}, ${t(Digit.Utils.pt.getCityLocale(address === null || address === void 0 ? void 0 : address.tenantId))}${address !== null && address !== void 0 && address.pincode && t(address === null || address === void 0 ? void 0 : address.pincode) ? `, ${address.pincode}` : " "}`;
19296
+ };
19297
+ const PropertySearchNSummary = ({
19298
+ config,
19299
+ onSelect,
19300
+ userType,
19301
+ formData,
19302
+ setError,
19303
+ formState,
19304
+ clearErrors
19305
+ }) => {
19306
+ var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3, _propertyDetails$Prop3, _propertyDetails$Prop4, _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop7, _propertyDetails$Prop8;
19307
+ const {
19308
+ t
19309
+ } = useTranslation();
19310
+ const history = useHistory();
19311
+ let {
19312
+ pathname,
19313
+ state
19314
+ } = useLocation();
19315
+ state = state && (typeof state === "string" || state instanceof String) ? JSON.parse(state) : state;
19316
+ const isEditScreen = pathname.includes("/modify-application/");
19317
+ const tenantId = Digit.ULBService.getCurrentTenantId();
19318
+ const isEmpNewApplication = window.location.href.includes("/employee/tl/new-application");
19319
+ const isEmpRenewLicense = window.location.href.includes("/employee/tl/renew-application-details") || window.location.href.includes("/employee/tl/edit-application-details");
19320
+ const search = useLocation().search;
19321
+ const urlPropertyId = new URLSearchParams(search).get("propertyId");
19322
+ const [propertyId, setPropertyId] = useState((formData === null || formData === void 0 ? void 0 : (_formData$cptId = formData.cptId) === null || _formData$cptId === void 0 ? void 0 : _formData$cptId.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || "");
19323
+ const [searchPropertyId, setSearchPropertyId] = useState(urlPropertyId !== "null" ? urlPropertyId : "");
19324
+ const [showToast, setShowToast] = useState(null);
19325
+ const isMobile = window.Digit.Utils.browser.isMobile();
19326
+ const serachParams = window.location.href.includes("?") ? window.location.href.substring(window.location.href.indexOf("?") + 1, window.location.href.length) : "";
19327
+ const {
19328
+ isLoading,
19329
+ isError,
19330
+ error,
19331
+ data: propertyDetails
19332
+ } = Digit.Hooks.pt.usePropertySearch({
19333
+ filters: {
19334
+ propertyIds: searchPropertyId
19335
+ },
19336
+ tenantId: tenantId
19416
19337
  }, {
19417
19338
  filters: {
19418
- propertyIds: (_formData10 = formData) !== null && _formData10 !== void 0 && (_formData10$cptId = _formData10.cptId) !== null && _formData10$cptId !== void 0 && _formData10$cptId.id || (_formData11 = formData) !== null && _formData11 !== void 0 && (_formData11$cpt = _formData11.cpt) !== null && _formData11$cpt !== void 0 && (_formData11$cpt$detai = _formData11$cpt.details) !== null && _formData11$cpt$detai !== void 0 && _formData11$cpt$detai.propertyId ? ((_formData12 = formData) === null || _formData12 === void 0 ? void 0 : (_formData12$knowyourp = _formData12.knowyourproperty) === null || _formData12$knowyourp === void 0 ? void 0 : (_formData12$knowyourp2 = _formData12$knowyourp.KnowProperty) === null || _formData12$knowyourp2 === void 0 ? void 0 : _formData12$knowyourp2.code) === "YES" || sessionStorage.getItem("VisitedLightCreate") === "false" ? (_formData13 = formData) === null || _formData13 === void 0 ? void 0 : (_formData13$cptId = _formData13.cptId) === null || _formData13$cptId === void 0 ? void 0 : _formData13$cptId.id : (_formData14 = formData) === null || _formData14 === void 0 ? void 0 : (_formData14$cpt = _formData14.cpt) === null || _formData14$cpt === void 0 ? void 0 : (_formData14$cpt$detai = _formData14$cpt.details) === null || _formData14$cpt$detai === void 0 ? void 0 : _formData14$cpt$detai.propertyId : window.location.href.includes("/tl/tradelicence/edit-application") || window.location.href.includes("/renew-trade/") ? (_formData15 = formData) === null || _formData15 === void 0 ? void 0 : (_formData15$tradeLice = _formData15.tradeLicenseDetail) === null || _formData15$tradeLice === void 0 ? void 0 : (_formData15$tradeLice2 = _formData15$tradeLice.additionalDetail) === null || _formData15$tradeLice2 === void 0 ? void 0 : _formData15$tradeLice2.propertyId : ((_formData16 = formData) === null || _formData16 === void 0 ? void 0 : (_formData16$cptId = _formData16.cptId) === null || _formData16$cptId === void 0 ? void 0 : _formData16$cptId.id) || ((_formData17 = formData) === null || _formData17 === void 0 ? void 0 : (_formData17$cpt = _formData17.cpt) === null || _formData17$cpt === void 0 ? void 0 : (_formData17$cpt$detai = _formData17$cpt.details) === null || _formData17$cpt$detai === void 0 ? void 0 : _formData17$cpt$detai.propertyId)
19339
+ propertyIds: searchPropertyId
19419
19340
  },
19420
19341
  tenantId: tenantId,
19342
+ enabled: searchPropertyId ? true : false,
19421
19343
  privacy: Digit.Utils.getPrivacyObject()
19422
19344
  });
19423
- const onSkip = () => onSelect();
19424
- const goNext = () => {
19425
- sessionStorage.setItem("cpt", propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]);
19345
+ useEffect(() => {
19346
+ if (propertyId && (window.location.href.includes("/renew-application-details/") || window.location.href.includes("/edit-application-details/"))) setSearchPropertyId(propertyId);
19347
+ }, [propertyId]);
19348
+ useEffect(() => {
19349
+ var _propertyDetails$Prop;
19350
+ if (isLoading == false && error && error == true || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop.length) == 0) {
19351
+ setShowToast({
19352
+ error: true,
19353
+ label: "PT_ENTER_VALID_PROPERTY_ID"
19354
+ });
19355
+ }
19356
+ }, [error, propertyDetails]);
19357
+ useEffect(() => {
19426
19358
  onSelect("cpt", {
19427
19359
  details: propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]
19428
19360
  });
19361
+ sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]));
19362
+ localStorage.setItem("pgrProperty", JSON.stringify(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0]));
19363
+ }, [propertyDetails, pathname]);
19364
+ const searchProperty = () => {
19365
+ if (!propertyId) {
19366
+ setShowToast({
19367
+ error: true,
19368
+ label: "PT_ENTER_PROPERTY_ID_AND_SEARCH"
19369
+ });
19370
+ }
19371
+ setSearchPropertyId(propertyId);
19372
+ if (window.location.pathname.includes("/tl/new-application")) {
19373
+ history.push(`/digit-ui/employee/tl/new-application?propertyId=${propertyId}`);
19374
+ const scrollConst = 1600;
19375
+ setTimeout(() => window.scrollTo(0, scrollConst), 0);
19376
+ } else if (window.location.pathname.includes("/ws/new-application")) history.push(`/digit-ui/employee/ws/new-application?propertyId=${propertyId}`);
19377
+ };
19378
+ const clearSearch = () => {
19379
+ setPropertyId("");
19380
+ setSearchPropertyId("");
19381
+ onSelect(config === null || config === void 0 ? void 0 : config.key, {
19382
+ id: ""
19383
+ });
19384
+ onSelect("cpt", null);
19429
19385
  };
19430
- const reversedOwners = Array.isArray(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : (_propertyDetails$Prop2 = _propertyDetails$Prop[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.owners) ? propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : (_propertyDetails$Prop4 = _propertyDetails$Prop3[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : _propertyDetails$Prop4.owners.slice().reverse() : [];
19431
- let propAddArr = [];
19386
+ if (isEditScreen) {
19387
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
19388
+ }
19389
+ let propertyAddress = "";
19432
19390
  if (propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length) {
19433
- var _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop9, _propertyDetails$Prop0, _propertyDetails$Prop1, _propertyDetails$Prop10, _propertyDetails$Prop15, _propertyDetails$Prop16, _propertyDetails$Prop19, _propertyDetails$Prop20, _propertyDetails$Prop21, _propertyDetails$Prop26, _propertyDetails$Prop28, _propertyDetails$Prop29;
19434
- if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop5 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop5 !== void 0 && (_propertyDetails$Prop6 = _propertyDetails$Prop5.address) !== null && _propertyDetails$Prop6 !== void 0 && _propertyDetails$Prop6.doorNo) {
19435
- var _propertyDetails$Prop7, _propertyDetails$Prop8;
19436
- propAddArr.push(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop7 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop7 === void 0 ? void 0 : (_propertyDetails$Prop8 = _propertyDetails$Prop7.address) === null || _propertyDetails$Prop8 === void 0 ? void 0 : _propertyDetails$Prop8.doorNo);
19437
- }
19438
- if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop9 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop9 !== void 0 && (_propertyDetails$Prop0 = _propertyDetails$Prop9.address) !== null && _propertyDetails$Prop0 !== void 0 && _propertyDetails$Prop0.street || propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop1 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop1 !== void 0 && (_propertyDetails$Prop10 = _propertyDetails$Prop1.address) !== null && _propertyDetails$Prop10 !== void 0 && _propertyDetails$Prop10.buildingName) {
19439
- var _propertyDetails$Prop11, _propertyDetails$Prop12, _propertyDetails$Prop13, _propertyDetails$Prop14;
19440
- propAddArr.push((propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop11 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop11 === void 0 ? void 0 : (_propertyDetails$Prop12 = _propertyDetails$Prop11.address) === null || _propertyDetails$Prop12 === void 0 ? void 0 : _propertyDetails$Prop12.street) || (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop13 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop13 === void 0 ? void 0 : (_propertyDetails$Prop14 = _propertyDetails$Prop13.address) === null || _propertyDetails$Prop14 === void 0 ? void 0 : _propertyDetails$Prop14.buildingName));
19441
- }
19442
- if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop15 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop15 !== void 0 && (_propertyDetails$Prop16 = _propertyDetails$Prop15.address) !== null && _propertyDetails$Prop16 !== void 0 && _propertyDetails$Prop16.landmark) {
19443
- var _propertyDetails$Prop17, _propertyDetails$Prop18;
19444
- propAddArr.push(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop17 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop17 === void 0 ? void 0 : (_propertyDetails$Prop18 = _propertyDetails$Prop17.address) === null || _propertyDetails$Prop18 === void 0 ? void 0 : _propertyDetails$Prop18.landmark);
19391
+ var _propertyDetails$Prop2;
19392
+ propertyAddress = getAddress(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop2 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop2 === void 0 ? void 0 : _propertyDetails$Prop2.address, t);
19393
+ }
19394
+ const getInputStyles = () => {
19395
+ if (window.location.href.includes("/ws/")) {
19396
+ return {
19397
+ fontWeight: "700"
19398
+ };
19399
+ } else return {};
19400
+ };
19401
+ const getOwnerNames = propertyData => {
19402
+ var _propertyData$owners, _getActiveOwners$sort, _getActiveOwners$sort2;
19403
+ const getActiveOwners = propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$owners = propertyData.owners) === null || _propertyData$owners === void 0 ? void 0 : _propertyData$owners.filter(owner => owner === null || owner === void 0 ? void 0 : owner.active);
19404
+ const getOwnersList = (_getActiveOwners$sort = getActiveOwners.sort((a, b) => {
19405
+ var _a$additionalDetails, _b$additionalDetails;
19406
+ return (a === null || a === void 0 ? void 0 : (_a$additionalDetails = a.additionalDetails) === null || _a$additionalDetails === void 0 ? void 0 : _a$additionalDetails.ownerSequence) - (b === null || b === void 0 ? void 0 : (_b$additionalDetails = b.additionalDetails) === null || _b$additionalDetails === void 0 ? void 0 : _b$additionalDetails.ownerSequence);
19407
+ })) === null || _getActiveOwners$sort === void 0 ? void 0 : (_getActiveOwners$sort2 = _getActiveOwners$sort.map(activeOwner => activeOwner === null || activeOwner === void 0 ? void 0 : activeOwner.name)) === null || _getActiveOwners$sort2 === void 0 ? void 0 : _getActiveOwners$sort2.join(",");
19408
+ return getOwnersList ? getOwnersList : t("NA");
19409
+ };
19410
+ if (window.location.href.includes("/ws/")) ;
19411
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
19412
+ title: t("PT_PROPERTY_SEARCH"),
19413
+ defaultOpen: true
19414
+ }, (window.location.href.includes("/tl/") ? !((formData === null || formData === void 0 ? void 0 : (_formData$tradedetils = formData.tradedetils) === null || _formData$tradedetils === void 0 ? void 0 : (_formData$tradedetils2 = _formData$tradedetils[0]) === null || _formData$tradedetils2 === void 0 ? void 0 : (_formData$tradedetils3 = _formData$tradedetils2.structureType) === null || _formData$tradedetils3 === void 0 ? void 0 : _formData$tradedetils3.code) === "MOVABLE") && (isEmpNewApplication || isEmpRenewLicense) : true) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(Label, {
19415
+ style: getInputStyles()
19416
+ }, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
19417
+ style: {
19418
+ display: "flex",
19419
+ gap: "12px"
19445
19420
  }
19446
- if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop19 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop19 !== void 0 && (_propertyDetails$Prop20 = _propertyDetails$Prop19.address) !== null && _propertyDetails$Prop20 !== void 0 && (_propertyDetails$Prop21 = _propertyDetails$Prop20.locality) !== null && _propertyDetails$Prop21 !== void 0 && _propertyDetails$Prop21.code) {
19447
- var _propertyDetails$Prop22, _propertyDetails$Prop23, _propertyDetails$Prop24, _propertyDetails$Prop25;
19448
- propAddArr.push(t(Digit.Utils.pt.getMohallaLocale(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop22 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop22 === void 0 ? void 0 : (_propertyDetails$Prop23 = _propertyDetails$Prop22.address) === null || _propertyDetails$Prop23 === void 0 ? void 0 : (_propertyDetails$Prop24 = _propertyDetails$Prop23.locality) === null || _propertyDetails$Prop24 === void 0 ? void 0 : _propertyDetails$Prop24.code, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop25 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop25 === void 0 ? void 0 : _propertyDetails$Prop25.tenantId)));
19421
+ }, /*#__PURE__*/React.createElement(TextInput, {
19422
+ key: config === null || config === void 0 ? void 0 : config.key,
19423
+ value: propertyId,
19424
+ onChange: e => {
19425
+ setPropertyId(e.target.value);
19426
+ onSelect(config === null || config === void 0 ? void 0 : config.key, {
19427
+ id: e.target.value
19428
+ });
19429
+ },
19430
+ style: {
19431
+ width: "80%",
19432
+ float: "left"
19433
+ },
19434
+ placeholder: `${t("PT_ENTER_PROPERTY_ID")}`
19435
+ }), /*#__PURE__*/React.createElement("button", {
19436
+ className: "submit-bar",
19437
+ type: "button",
19438
+ style: {
19439
+ color: "white"
19440
+ },
19441
+ onClick: searchProperty
19442
+ }, `${t("PT_SEARCH")}`), /*#__PURE__*/React.createElement("button", {
19443
+ className: "submit-bar",
19444
+ type: "button",
19445
+ style: {
19446
+ color: "white"
19447
+ },
19448
+ onClick: clearSearch
19449
+ }, `${t("CLEAR")}`), /*#__PURE__*/React.createElement("span", {
19450
+ onClick: () => history.push(`/digit-ui/${userType}/${pathname.split("/")[3]}/create-application/create-property`, {
19451
+ ...state,
19452
+ ...formData
19453
+ })
19454
+ }, /*#__PURE__*/React.createElement("button", {
19455
+ className: "submit-bar",
19456
+ type: "button",
19457
+ style: {
19458
+ color: "white"
19449
19459
  }
19450
- if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop26 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop26 !== void 0 && _propertyDetails$Prop26.tenantId) {
19451
- var _propertyDetails$Prop27;
19452
- propAddArr.push(t(Digit.Utils.pt.getCityLocale(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop27 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop27 === void 0 ? void 0 : _propertyDetails$Prop27.tenantId)));
19460
+ }, t("CPT_CREATE_PROPERTY"))))), searchPropertyId && propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
19461
+ className: "card-with-background",
19462
+ style: {
19463
+ margin: "16px 0px",
19464
+ padding: "20px",
19465
+ boxShadow: "none"
19453
19466
  }
19454
- if (propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop28 = propertyDetails.Properties[0]) !== null && _propertyDetails$Prop28 !== void 0 && (_propertyDetails$Prop29 = _propertyDetails$Prop28.address) !== null && _propertyDetails$Prop29 !== void 0 && _propertyDetails$Prop29.pincode) {
19455
- var _propertyDetails$Prop30, _propertyDetails$Prop31;
19456
- propAddArr.push(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop30 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop30 === void 0 ? void 0 : (_propertyDetails$Prop31 = _propertyDetails$Prop30.address) === null || _propertyDetails$Prop31 === void 0 ? void 0 : _propertyDetails$Prop31.pincode);
19467
+ }, /*#__PURE__*/React.createElement(StatusTable, {
19468
+ style: {
19469
+ padding: "0",
19470
+ margin: "0"
19457
19471
  }
19458
- }
19459
- if (isLoading) {
19460
- return /*#__PURE__*/React.createElement(Loader, null);
19461
- }
19462
- function getChangePropertyPath() {
19463
- var _formData18, _formData19, _formData20, _formData21, _formData22, _formData23;
19464
- if (window.location.href.includes("/ws/modify-connection/")) return `/digit-ui/citizen/ws/modify-connection/${(_formData18 = formData) === null || _formData18 === void 0 ? void 0 : _formData18.tenantId}/search-property`;else if (window.location.href.includes("/ws/edit-application/")) return `/digit-ui/citizen/ws/edit-application/${(_formData19 = formData) === null || _formData19 === void 0 ? void 0 : _formData19.tenantId}/search-property`;else if (window.location.href.includes("/ws/")) return `/digit-ui/citizen/ws/create-application/search-property`;else if (window.location.href.includes("/renew-trade/")) return `/digit-ui/citizen/tl/tradelicence/renew-trade/${(_formData20 = formData) === null || _formData20 === void 0 ? void 0 : _formData20.applicationNumber}/${(_formData21 = formData) === null || _formData21 === void 0 ? void 0 : _formData21.tenantId}/know-your-property`;else if (window.location.href.includes("/edit-application/")) return `/digit-ui/citizen/tl/tradelicence/edit-application/${(_formData22 = formData) === null || _formData22 === void 0 ? void 0 : _formData22.applicationNumber}/${(_formData23 = formData) === null || _formData23 === void 0 ? void 0 : _formData23.tenantId}/know-your-property`;else return `/digit-ui/citizen/tl/tradelicence/new-application/know-your-property`;
19465
- }
19466
- return /*#__PURE__*/React.createElement(React.Fragment, null, window.location.href.includes("/citizen") ? /*#__PURE__*/React.createElement(CPTTimeline, {
19467
- currentStep: window.location.href.includes("/ws/") ? 1 : 2,
19468
- flow: window.location.href.includes("/ws/") ? "WS" : "",
19469
- businessService: "WS"
19470
- }) : null, /*#__PURE__*/React.createElement(FormStep, {
19471
- t: t,
19472
- config: config,
19473
- onSelect: goNext,
19474
- onSkip: onSkip
19475
- }, propertyDetails && (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties.length) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardHeader, null, t("PT_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
19472
+ }, /*#__PURE__*/React.createElement("div", {
19473
+ className: "formcomposer-section-grid",
19474
+ style: isMobile ? {} : {}
19475
+ }, /*#__PURE__*/React.createElement(Row, {
19476
19476
  className: "border-none",
19477
+ labelStyle: isMobile ? {
19478
+ width: "40%"
19479
+ } : {
19480
+ width: "30%",
19481
+ color: "#505a5f",
19482
+ fontWeight: "600"
19483
+ },
19484
+ textStyle: {
19485
+ color: "#000"
19486
+ },
19477
19487
  label: t(`PROPERTY_ID`),
19478
- text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop32 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop32 === void 0 ? void 0 : _propertyDetails$Prop32.propertyId
19488
+ text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3.propertyId
19479
19489
  }), /*#__PURE__*/React.createElement(Row, {
19480
19490
  className: "border-none",
19491
+ labelStyle: isMobile ? {
19492
+ width: "40%"
19493
+ } : {
19494
+ width: "30%",
19495
+ color: "#505a5f",
19496
+ fontWeight: "600"
19497
+ },
19498
+ textStyle: {
19499
+ color: "#000"
19500
+ },
19481
19501
  label: t(`OWNER_NAME`),
19482
- text: reversedOwners === null || reversedOwners === void 0 ? void 0 : (_reversedOwners$ = reversedOwners[0]) === null || _reversedOwners$ === void 0 ? void 0 : _reversedOwners$.name
19502
+ text: getOwnerNames(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0])
19483
19503
  }), /*#__PURE__*/React.createElement(Row, {
19484
19504
  className: "border-none",
19505
+ labelStyle: isMobile ? {
19506
+ width: "40%"
19507
+ } : {
19508
+ width: "30%",
19509
+ color: "#505a5f",
19510
+ fontWeight: "600"
19511
+ },
19485
19512
  textStyle: {
19486
- wordBreak: "break-word"
19513
+ wordBreak: "break-word",
19514
+ color: "#000"
19487
19515
  },
19488
19516
  label: t(`PROPERTY_ADDRESS`),
19489
- text: propAddArr.join(', '),
19517
+ text: propertyAddress,
19490
19518
  privacy: {
19491
- uuid: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop33 = propertyDetails.Properties) === null || _propertyDetails$Prop33 === void 0 ? void 0 : (_propertyDetails$Prop34 = _propertyDetails$Prop33[0]) === null || _propertyDetails$Prop34 === void 0 ? void 0 : (_propertyDetails$Prop35 = _propertyDetails$Prop34.owners) === null || _propertyDetails$Prop35 === void 0 ? void 0 : (_propertyDetails$Prop36 = _propertyDetails$Prop35[0]) === null || _propertyDetails$Prop36 === void 0 ? void 0 : _propertyDetails$Prop36.uuid,
19519
+ uuid: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop4 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : (_propertyDetails$Prop5 = _propertyDetails$Prop4.owners) === null || _propertyDetails$Prop5 === void 0 ? void 0 : (_propertyDetails$Prop6 = _propertyDetails$Prop5[0]) === null || _propertyDetails$Prop6 === void 0 ? void 0 : _propertyDetails$Prop6.uuid,
19492
19520
  fieldName: ["doorNo", "street", "landmark"],
19493
19521
  model: "Property",
19494
19522
  showValue: true,
@@ -19496,49 +19524,28 @@ const PropertyDetails = ({
19496
19524
  serviceName: "/property-services/property/_search",
19497
19525
  requestBody: {},
19498
19526
  requestParam: {
19499
- tenantId: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop37 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop37 === void 0 ? void 0 : _propertyDetails$Prop37.tenantId,
19500
- propertyIds: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop38 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop38 === void 0 ? void 0 : _propertyDetails$Prop38.propertyId
19527
+ tenantId: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop7 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop7 === void 0 ? void 0 : _propertyDetails$Prop7.tenantId,
19528
+ propertyIds: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop8 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop8 === void 0 ? void 0 : _propertyDetails$Prop8.propertyId
19501
19529
  },
19502
19530
  jsonPath: "Properties[0].address.street",
19503
19531
  d: res => {
19504
- let resultString = (_.get(res, "Properties[0].address.doorNo") ? `${_.get(res, "Properties[0].address.doorNo")}, ` : "") + (_.get(res, "Properties[0].address.street") ? `${_.get(res, "Properties[0].address.street")}, ` : "") + (_.get(res, "Properties[0].address.landmark") ? `${_.get(res, "Properties[0].address.landmark")}` : "");
19532
+ let resultString = (lodash.get(res, "Properties[0].address.doorNo") ? `${lodash.get(res, "Properties[0].address.doorNo")}, ` : "") + (lodash.get(res, "Properties[0].address.street") ? `${lodash.get(res, "Properties[0].address.street")}, ` : "") + (lodash.get(res, "Properties[0].address.landmark") ? `${lodash.get(res, "Properties[0].address.landmark")}` : "");
19505
19533
  return resultString;
19506
19534
  },
19507
19535
  isArray: false
19508
19536
  }
19509
19537
  }
19510
- }), /*#__PURE__*/React.createElement(Row, {
19511
- className: "border-none",
19512
- label: t(`PT_MUTATION_STATUS`),
19513
- text: t(propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop39 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop39 === void 0 ? void 0 : _propertyDetails$Prop39.status)
19514
- }), /*#__PURE__*/React.createElement("div", {
19515
- style: {
19516
- textAlign: "left"
19517
- }
19518
- }, /*#__PURE__*/React.createElement(Link, {
19519
- to: `/digit-ui/citizen/commonpt/view-property?propertyId=${propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop40 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop40 === void 0 ? void 0 : _propertyDetails$Prop40.propertyId}&tenantId=${propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop41 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop41 === void 0 ? void 0 : _propertyDetails$Prop41.tenantId}`
19520
- }, /*#__PURE__*/React.createElement(LinkButton, {
19521
- style: {
19522
- textAlign: "left"
19523
- },
19524
- label: t("PT_VIEW_MORE_DETAILS")
19525
- })), /*#__PURE__*/React.createElement(Link, {
19526
- to: getChangePropertyPath()
19527
- }, /*#__PURE__*/React.createElement(LinkButton, {
19528
- style: {
19529
- textAlign: "left"
19538
+ }))))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
19539
+ isDleteBtn: true,
19540
+ labelstyle: {
19541
+ width: "100%"
19530
19542
  },
19531
- label: t("PT_CHANGE_PROPERTY"),
19532
- onClick: () => {
19533
- sessionStorage.setItem("changePropertySelected", "yes");
19534
- sessionStorage.setItem("EditFormData", JSON.stringify(formData));
19543
+ error: showToast.error,
19544
+ warning: showToast.warning,
19545
+ label: t(showToast.label),
19546
+ onClose: () => {
19547
+ setShowToast(null);
19535
19548
  }
19536
- })))), /*#__PURE__*/React.createElement(SubmitBar, {
19537
- style: {
19538
- marginTop: "10px"
19539
- },
19540
- onSubmit: goNext,
19541
- label: t("CS_COMMON_NEXT")
19542
19549
  }))));
19543
19550
  };
19544
19551