@djb25/digit-ui-module-commonpt 1.0.9 → 1.0.11

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,5 +1,5 @@
1
- import { Loader, VerticalTimeline, FormComposer, Toast, Card, CardText, StatusTable, Row, SubmitBar, Banner, RadioButtons, Dropdown, InfoBannerIcon, Localities, Header, ResponseComposer, Modal, KeyNote, OTPInput, CardLabelError, FormStep, UploadFile, DatePicker, CardSubHeader, PDFSvg, LabelFieldPair, CardLabel, MultiUploadWrapper, CardHeader, CardSectionHeader, CheckBox, TextInput, LinkButton, Close as Close$e, ViewsIcon, BreakLine, Table, TelePhone, DisplayPhotos, EditIcon, CheckPoint, ConnectingCheckPoints, ActionBar, Menu, ButtonSelector, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, Label, CollapsibleCardPage, AddressDetails, DeleteIcon, MobileNumber, RadioOrSelect, TextArea, SearchForm, SearchField, DetailsCard, TickMark, PropertyHouse, EmployeeModuleCard, CitizenHomeCard, PTIcon } from '@djb25/digit-ui-react-components';
2
- import React, { useState, useEffect, useLayoutEffect, useMemo, useRef, Fragment as Fragment$1, memo, useCallback } from 'react';
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';
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';
5
5
  import { useQueryClient } from 'react-query';
@@ -14,7 +14,6 @@ const newConfig = [{
14
14
  component: "CPTPropertyLocationDetails",
15
15
  texts: {
16
16
  headerCaption: "",
17
- header: "PT_LOCATION_DETAILS",
18
17
  cardText: "",
19
18
  submitBarLabel: "PT_COMMONS_NEXT"
20
19
  },
@@ -5898,7 +5897,7 @@ var lodash = createCommonjsModule(function (module, exports) {
5898
5897
  });
5899
5898
 
5900
5899
  const setAddressDetailsLW = data => {
5901
- 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;
5902
5901
  let {
5903
5902
  locationDet,
5904
5903
  propertyAddress
@@ -5927,7 +5926,9 @@ const setAddressDetailsLW = data => {
5927
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),
5928
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),
5929
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),
5930
- 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)
5931
5932
  };
5932
5933
  data.address = propAddress;
5933
5934
  return data;
@@ -7574,1101 +7575,1034 @@ var propTypes = createCommonjsModule(function (module) {
7574
7575
  }
7575
7576
  });
7576
7577
 
7577
- const description = {
7578
- description: "PT_SEARCH_OR_DESC",
7579
- descriptionStyles: {
7580
- fontWeight: "300",
7581
- color: "#505A5F",
7582
- marginTop: "0px",
7583
- textAlign: "center",
7584
- marginBottom: "20px",
7585
- maxWidth: "540px"
7586
- }
7578
+ const TYPE_LOGIN$1 = {
7579
+ type: "login"
7587
7580
  };
7588
- const SearchProperty = ({
7589
- config: propsConfig,
7581
+ const DEFAULT_REDIRECT_URL = "/digit-ui/citizen";
7582
+ const PropertySearchResults = ({
7583
+ template,
7584
+ header,
7585
+ actionButtonLabel,
7586
+ isMutation,
7590
7587
  onSelect,
7591
- redirectToUrl
7588
+ config,
7589
+ clearParams: _clearParams = () => {},
7590
+ stateCode,
7591
+ redirectToUrl,
7592
+ searchQuery
7592
7593
  }) => {
7593
- var _Digit$Hooks$pt$useTe, _Digit$Hooks$tl$useTe, _propertyData$Propert2, _propertyData$Propert3, _searchData$filters2, _Object$values2, _Object$values2$filte;
7594
+ var _result$data, _result$data2, _properties$map, _paymentDetails$data, _paymentDetails$data$, _ref, _modalData$total_due;
7594
7595
  const {
7595
7596
  t
7596
7597
  } = useTranslation();
7597
- const history = useHistory();
7598
+ const modalRef = useRef();
7598
7599
  const {
7599
- action = 0
7600
+ mobileNumber,
7601
+ propertyIds,
7602
+ oldPropertyIds,
7603
+ locality,
7604
+ city,
7605
+ tenantId: tId,
7606
+ doorNo,
7607
+ name,
7608
+ PToffset
7600
7609
  } = Digit.Hooks.useQueryParams();
7601
- const [searchData, setSearchData] = useState({});
7602
- const [showToast, setShowToast] = useState(null);
7603
- sessionStorage.setItem("VisitedCommonPTSearch", true);
7604
- sessionStorage.setItem("VisitedLightCreate", false);
7605
- let allCities = (_Digit$Hooks$pt$useTe = Digit.Hooks.pt.useTenants()) === null || _Digit$Hooks$pt$useTe === void 0 ? void 0 : _Digit$Hooks$pt$useTe.sort((a, b) => {
7606
- var _a$i18nKey, _a$i18nKey$localeComp;
7607
- return a === null || a === void 0 ? void 0 : (_a$i18nKey = a.i18nKey) === null || _a$i18nKey === void 0 ? void 0 : (_a$i18nKey$localeComp = _a$i18nKey.localeCompare) === null || _a$i18nKey$localeComp === void 0 ? void 0 : _a$i18nKey$localeComp.call(_a$i18nKey, b === null || b === void 0 ? void 0 : b.i18nKey);
7608
- });
7609
- allCities = allCities ? allCities : (_Digit$Hooks$tl$useTe = Digit.Hooks.tl.useTenants()) === null || _Digit$Hooks$tl$useTe === void 0 ? void 0 : _Digit$Hooks$tl$useTe.sort((a, b) => {
7610
- var _a$i18nKey2, _a$i18nKey2$localeCom;
7611
- return a === null || a === void 0 ? void 0 : (_a$i18nKey2 = a.i18nKey) === null || _a$i18nKey2 === void 0 ? void 0 : (_a$i18nKey2$localeCom = _a$i18nKey2.localeCompare) === null || _a$i18nKey2$localeCom === void 0 ? void 0 : _a$i18nKey2$localeCom.call(_a$i18nKey2, b === null || b === void 0 ? void 0 : b.i18nKey);
7612
- });
7613
- if (window.location.href.includes("obps")) {
7614
- allCities = Digit.SessionStorage.get("OBPS_TENANTS");
7615
- } else if (window.location.href.includes("fsm")) {
7616
- allCities = [{
7617
- i18nKey: "TENANT_TENANTS_PG_CITYA",
7618
- code: Digit.ULBService.getCurrentTenantId(),
7619
- name: "City A",
7620
- description: "City A",
7621
- pincode: [143001, 143002, 143003, 143004, 143005],
7622
- logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
7623
- imageId: null,
7624
- domainUrl: "https://www.upyog.niua.org",
7625
- type: "CITY",
7626
- twitterUrl: null,
7627
- facebookUrl: null,
7628
- emailId: "citya@gmail.com",
7629
- OfficeTimings: {
7630
- "Mon - Fri": "9.00 AM - 6.00 PM"
7631
- },
7632
- city: {
7633
- name: "City A",
7634
- localName: null,
7635
- districtCode: "CITYA",
7636
- districtName: null,
7637
- districtTenantCode: Digit.ULBService.getCurrentTenantId(),
7638
- regionName: null,
7639
- ulbGrade: "Municipal Corporation",
7640
- longitude: 75.5761829,
7641
- latitude: 31.3260152,
7642
- shapeFileLocation: null,
7643
- captcha: null,
7644
- code: "1013",
7645
- ddrName: "DDR A"
7646
- },
7647
- address: "City A Municipal Corporation",
7648
- contactNumber: "001-2345876"
7649
- }, {
7650
- i18nKey: "TENANT_TENANTS_PG_CITYB",
7651
- code: "pg.cityb",
7652
- name: "City B",
7653
- description: null,
7654
- pincode: [143006, 143007, 143008, 143009, 143010],
7655
- logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
7656
- imageId: null,
7657
- domainUrl: "https://www.upyog.niua.org",
7658
- type: "CITY",
7659
- twitterUrl: null,
7660
- facebookUrl: null,
7661
- emailId: "cityb@gmail.com",
7662
- OfficeTimings: {
7663
- "Mon - Fri": "9.00 AM - 6.00 PM",
7664
- Sat: "9.00 AM - 12.00 PM"
7665
- },
7666
- city: {
7667
- name: "City B",
7668
- localName: null,
7669
- districtCode: "CITYB",
7670
- districtName: null,
7671
- districtTenantCode: "pg.cityb",
7672
- regionName: null,
7673
- ulbGrade: "Municipal Corporation",
7674
- longitude: 74.8722642,
7675
- latitude: 31.6339793,
7676
- shapeFileLocation: null,
7677
- captcha: null,
7678
- code: "107",
7679
- ddrName: "DDR B"
7680
- },
7681
- address: "City B Municipal Corporation Address",
7682
- contactNumber: "0978-7645345",
7683
- helpLineNumber: "0654-8734567"
7684
- }, {
7685
- i18nKey: "TENANT_TENANTS_PG_CITYC",
7686
- code: "pg.cityc",
7687
- name: "City C",
7688
- description: null,
7689
- logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
7690
- imageId: null,
7691
- domainUrl: "https://www.upyog.niua.org",
7692
- type: "CITY",
7693
- twitterUrl: null,
7694
- facebookUrl: null,
7695
- emailId: "cityc@gmail.com",
7696
- OfficeTimings: {
7697
- "Mon - Fri": "9.00 AM - 6.00 PM",
7698
- Sat: "9.00 AM - 12.00 PM"
7699
- },
7700
- city: {
7701
- name: "City C",
7702
- localName: null,
7703
- districtCode: "CITYC",
7704
- districtName: null,
7705
- districtTenantCode: "pg.cityc",
7706
- regionName: null,
7707
- ulbGrade: "Municipal Corporation",
7708
- longitude: 73.8722642,
7709
- latitude: 31.6339793,
7710
- shapeFileLocation: null,
7711
- captcha: null,
7712
- code: "108",
7713
- ddrName: "DDR C"
7714
- },
7715
- address: "City C Municipal Corporation Address",
7716
- contactNumber: "0978-7645345",
7717
- helpLineNumber: "0654-8734567"
7718
- }];
7610
+ const filters = {};
7611
+ const [modalData, setShowModal] = useState(false);
7612
+ const PrivacyInfoLabel = Digit.ComponentRegistryService.getComponent("WSInfoLabel");
7613
+ let OfsetForSearch = PToffset;
7614
+ let t1;
7615
+ let off;
7616
+ if (!isNaN(parseInt(OfsetForSearch))) {
7617
+ off = OfsetForSearch;
7618
+ t1 = parseInt(OfsetForSearch) + 5;
7619
+ } else {
7620
+ t1 = 5;
7719
7621
  }
7720
- console.log("allCities", allCities);
7721
- const [cityCode, setCityCode] = useState();
7722
- const [formValue, setFormValue] = useState();
7723
- const [errorShown, seterrorShown] = useState(false);
7724
- let isMobile = window.Digit.Utils.browser.isMobile();
7622
+ let filter1 = !isNaN(parseInt(OfsetForSearch)) ? {
7623
+ limit: "5",
7624
+ sortOrder: "ASC",
7625
+ sortBy: "createdTime",
7626
+ offset: off
7627
+ } : {
7628
+ limit: "5",
7629
+ sortOrder: "ASC",
7630
+ sortBy: "createdTime",
7631
+ offset: "0"
7632
+ };
7633
+ const closeModal = () => {
7634
+ setShowModal(false);
7635
+ };
7636
+ Digit.Hooks.useClickOutside(modalRef, closeModal, modalData);
7637
+ const sbm = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNo);
7638
+ const spi = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyId);
7639
+ const sop = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyId);
7640
+ const sanitizeParam = param => param && param !== "undefined" ? param : null;
7641
+ const finalMobileNumber = sanitizeParam(mobileNumber) || sanitizeParam(sbm);
7642
+ if (finalMobileNumber) filters.mobileNumber = finalMobileNumber;
7643
+ const finalPropertyIds = sanitizeParam(propertyIds) || sanitizeParam(spi);
7644
+ if (finalPropertyIds) filters.propertyIds = finalPropertyIds;
7645
+ const finalOldPropertyIds = sanitizeParam(oldPropertyIds) || sanitizeParam(sop);
7646
+ if (finalOldPropertyIds) filters.oldPropertyIds = finalOldPropertyIds;
7647
+ const finalLocality = sanitizeParam(locality) || sanitizeParam(searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.locality);
7648
+ if (finalLocality) filters.locality = finalLocality;
7649
+ const finalDoorNo = sanitizeParam(doorNo) || sanitizeParam(searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.doorNo);
7650
+ if (finalDoorNo) filters.doorNo = finalDoorNo;
7651
+ const finalName = sanitizeParam(name) || sanitizeParam(searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.name);
7652
+ if (finalName) filters.name = finalName;
7653
+ filters.limit = filter1.limit;
7654
+ filters.sortOrder = filter1.sortOrder;
7655
+ filters.sortBy = filter1.sortBy;
7656
+ filters.offset = filter1.offset;
7657
+ if (!filters.status) {
7658
+ filters.status = "ACTIVE,INWORKFLOW";
7659
+ }
7660
+ const [owners, setOwners, clearOwners] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS", null);
7661
+ const [lastPath, setLastPath, clearLastPath] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH", null);
7725
7662
  const {
7726
- data: propertyData,
7727
- isLoading: propertyDataLoading,
7728
- error,
7729
- isSuccess,
7730
- billData
7731
- } = Digit.Hooks.pt.usePropertySearchWithDue({
7732
- tenantId: searchData === null || searchData === void 0 ? void 0 : searchData.city,
7733
- filters: searchData === null || searchData === void 0 ? void 0 : searchData.filters,
7734
- auth: false,
7735
- configs: {
7736
- enabled: Object.keys(searchData).length > 0,
7737
- retry: false,
7738
- retryOnMount: false,
7739
- staleTime: Infinity
7740
- }
7741
- });
7742
- useEffect(() => {
7743
- var _searchData$filters, _Object$values, _Object$values$filter;
7744
- if (!(searchData !== null && searchData !== void 0 && (_searchData$filters = searchData.filters) !== null && _searchData$filters !== void 0 && _searchData$filters.mobileNumber && ((_Object$values = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values === void 0 ? void 0 : (_Object$values$filter = _Object$values.filter(ob => ob !== undefined)) === null || _Object$values$filter === void 0 ? void 0 : _Object$values$filter.length) == 1) && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > 0 && ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && !errorShown) {
7745
- setShowToast({
7746
- error: true,
7747
- warning: true,
7748
- label: "ERR_PLEASE_REFINED_UR_SEARCH"
7749
- });
7750
- }
7751
- }, [propertyData]);
7752
- useEffect(() => {
7753
- showToast && (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "ERR_PLEASE_REFINED_UR_SEARCH" && (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "NO_PROPERTIES_FOUND" && setShowToast(null);
7754
- }, [action, propertyDataLoading]);
7663
+ path,
7664
+ url
7665
+ } = useRouteMatch();
7666
+ const searchParams = Digit.Hooks.useQueryParams();
7755
7667
  useEffect(() => {
7756
- var _propertyData$Propert;
7757
- if (!propertyDataLoading && propertyData && searchData && (propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert = propertyData.Properties) === null || _propertyData$Propert === void 0 ? void 0 : _propertyData$Propert.length) <= 0) {
7758
- setShowToast({
7759
- error: true,
7760
- warning: true,
7761
- label: "NO_PROPERTIES_FOUND"
7762
- });
7763
- }
7764
- }, [propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert2 = propertyData.Properties) === null || _propertyData$Propert2 === void 0 ? void 0 : (_propertyData$Propert3 = _propertyData$Propert2[0]) === null || _propertyData$Propert3 === void 0 ? void 0 : _propertyData$Propert3.propertyId, propertyDataLoading]);
7765
- useLayoutEffect(() => {
7766
- const getActionBar = () => {
7767
- let el = document.querySelector("div.action-bar-wrap");
7768
- if (el) {
7769
- el.style.position = "static";
7770
- el.style.padding = "8px 0";
7771
- el.style.boxShadow = "none";
7772
- el.style.marginBottom = "16px";
7773
- el.style.textAlign = "left";
7774
- el.style.zIndex = "0";
7775
- } else {
7776
- setTimeout(() => {
7777
- getActionBar();
7778
- }, 100);
7779
- }
7780
- };
7781
- getActionBar();
7668
+ setOwners([]);
7669
+ _clearParams();
7670
+ setLastPath("");
7782
7671
  }, []);
7783
- const {
7784
- data: ptSearchConfig,
7785
- isLoading
7786
- } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "DIGIT-UI", "HelpText", {
7787
- select: data => {
7788
- var _data$DIGITUI, _data$DIGITUI$HelpTex, _data$DIGITUI$HelpTex2;
7789
- return data === null || data === void 0 ? void 0 : (_data$DIGITUI = data["DIGIT-UI"]) === null || _data$DIGITUI === void 0 ? void 0 : (_data$DIGITUI$HelpTex = _data$DIGITUI["HelpText"]) === null || _data$DIGITUI$HelpTex === void 0 ? void 0 : (_data$DIGITUI$HelpTex2 = _data$DIGITUI$HelpTex[0]) === null || _data$DIGITUI$HelpTex2 === void 0 ? void 0 : _data$DIGITUI$HelpTex2.PT;
7790
- }
7672
+ const auth = false;
7673
+ const tenantId = Digit.ULBService.getCurrentTenantId();
7674
+ const scity = city || tId || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.city) || tenantId;
7675
+ const searchArgs = scity ? {
7676
+ tenantId: scity,
7677
+ filters,
7678
+ auth
7679
+ } : {
7680
+ filters,
7681
+ auth
7682
+ };
7683
+ const result = Digit.Hooks.pt.usePropertySearch(searchArgs, {
7684
+ privacy: Digit.Utils.getPrivacyObject()
7791
7685
  });
7792
- const [mobileNumber, property, oldProperty, name, doorNumber] = propsConfig.inputs;
7793
- const config = [{
7794
- body: [{
7795
- type: "custom",
7796
- populators: {
7797
- name: "addParam",
7798
- defaultValue: {
7799
- code: 0,
7800
- name: t("PT_KNOW_PTID")
7801
- },
7802
- customProps: {
7803
- t,
7804
- isMandatory: true,
7805
- optionsKey: "name",
7806
- options: [{
7807
- code: 0,
7808
- name: t("PT_KNOW_PTID")
7809
- }, {
7810
- code: 1,
7811
- name: t("PT_SEARCH_DOOR_NO")
7812
- }]
7813
- },
7814
- component: (props, customProps) => /*#__PURE__*/React.createElement(RadioButtons, Object.assign({}, customProps, {
7815
- selectedOption: props.value,
7816
- onSelect: d => {
7817
- props === null || props === void 0 ? void 0 : props.setValue("city", {});
7818
- props === null || props === void 0 ? void 0 : props.setValue("locality", {});
7819
- props === null || props === void 0 ? void 0 : props.setValue("mobileNumber", "");
7820
- props === null || props === void 0 ? void 0 : props.setValue("propertyIds", "");
7821
- props === null || props === void 0 ? void 0 : props.setValue("doorNumber", "");
7822
- props === null || props === void 0 ? void 0 : props.setValue("oldPropertyId", "");
7823
- props === null || props === void 0 ? void 0 : props.setValue("name", "");
7824
- history.replace(`${history.location.pathname}?action=${action == 0 ? 1 : 0}`);
7825
- }
7826
- }))
7686
+ const properties = (result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.Properties) || (result === null || result === void 0 ? void 0 : (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.properties) || (Array.isArray(result === null || result === void 0 ? void 0 : result.data) ? result === null || result === void 0 ? void 0 : result.data : []);
7687
+ const consumerCode = properties === null || properties === void 0 ? void 0 : (_properties$map = properties.map) === null || _properties$map === void 0 ? void 0 : _properties$map.call(properties, a => a.propertyId || a.id).filter(id => id).join(",");
7688
+ if (result.isSuccess && (!properties || properties.length === 0)) {
7689
+ console.warn("Property Search: No properties found in result.data", result.data);
7690
+ }
7691
+ const fetchBillParams = mobileNumber ? {
7692
+ mobileNumber,
7693
+ consumerCode
7694
+ } : {
7695
+ consumerCode
7696
+ };
7697
+ const paymentDetails = Digit.Hooks.useFetchBillsForBuissnessService({
7698
+ businessService: "PT",
7699
+ ...fetchBillParams,
7700
+ tenantId: scity
7701
+ }, {
7702
+ enabled: !!(consumerCode && scity),
7703
+ retry: false
7704
+ });
7705
+ const history = useHistory();
7706
+ const proceedToPay = data => {
7707
+ history.push(`/digit-ui/citizen/payment/my-bills/PT/${data.property_id}`, {
7708
+ tenantId
7709
+ });
7710
+ };
7711
+ if (paymentDetails.isLoading || result.isLoading) {
7712
+ return /*#__PURE__*/React.createElement(Loader, null);
7713
+ }
7714
+ if (result.error || result.isSuccess && (!properties || properties.length === 0)) {
7715
+ return /*#__PURE__*/React.createElement("div", {
7716
+ style: {
7717
+ height: "150px"
7827
7718
  }
7828
- }, {
7829
- label: "PT_SELECT_CITY",
7830
- isMandatory: true,
7831
- type: "custom",
7832
- populators: {
7833
- name: "city",
7834
- defaultValue: null,
7835
- rules: {
7836
- required: true
7837
- },
7838
- customProps: {
7839
- t,
7840
- isMandatory: true,
7841
- option: [...allCities],
7842
- optionKey: "i18nKey"
7843
- },
7844
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, customProps, {
7845
- selected: props.value,
7846
- select: d => {
7847
- Digit.ULBService.getCurrentTenantId();
7848
- if (d.code !== cityCode) props.setValue("locality", null);
7849
- props.onChange(d);
7719
+ }, /*#__PURE__*/React.createElement(Card, {
7720
+ style: {
7721
+ display: "flex",
7722
+ justifyContent: "center",
7723
+ alignItems: "center",
7724
+ height: "100%"
7725
+ }
7726
+ }, t("CS_PT_NO_PROPERTIES_FOUND")));
7727
+ }
7728
+ const payment = {};
7729
+ paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data = paymentDetails.data) === null || _paymentDetails$data === void 0 ? void 0 : (_paymentDetails$data$ = _paymentDetails$data.Bill) === null || _paymentDetails$data$ === void 0 ? void 0 : _paymentDetails$data$.forEach(element => {
7730
+ if (element !== null && element !== void 0 && element.consumerCode) {
7731
+ payment[element === null || element === void 0 ? void 0 : element.consumerCode] = {
7732
+ total_due: element === null || element === void 0 ? void 0 : element.totalAmount,
7733
+ bil_due__date: new Date(element === null || element === void 0 ? void 0 : element.billDate).toDateString()
7734
+ };
7735
+ }
7736
+ });
7737
+ const searchResults = (_ref = properties || []) === null || _ref === void 0 ? void 0 : _ref.map(property => {
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$;
7739
+ let addr = (property === null || property === void 0 ? void 0 : property.address) || {};
7740
+ return {
7741
+ property_id: property === null || property === void 0 ? void 0 : property.propertyId,
7742
+ owner_name: (_sort = ((property === null || property === void 0 ? void 0 : property.owners) || []).sort((a, b) => {
7743
+ var _a$additionalDetails, _b$additionalDetails;
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);
7745
+ })) === null || _sort === void 0 ? void 0 : (_sort$ = _sort[0]) === null || _sort$ === void 0 ? void 0 : _sort$.name,
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),
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,
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"),
7750
+ status: t(property.status),
7751
+ owner_mobile: (_2 = ((property === null || property === void 0 ? void 0 : property.owners) || [])[0]) === null || _2 === void 0 ? void 0 : _2.mobileNumber,
7752
+ address: property === null || property === void 0 ? void 0 : property.address,
7753
+ owners: property.owners,
7754
+ propertyDetails: property,
7755
+ privacy: {
7756
+ property_address: {
7757
+ uuid: property === null || property === void 0 ? void 0 : (_property$owners = property.owners) === null || _property$owners === void 0 ? void 0 : (_property$owners$ = _property$owners[0]) === null || _property$owners$ === void 0 ? void 0 : _property$owners$.uuid,
7758
+ fieldName: ["doorNo", "street", "landmark"],
7759
+ model: "Property",
7760
+ showValue: true,
7761
+ loadData: {
7762
+ serviceName: "/property-services/property/_search",
7763
+ requestBody: {},
7764
+ requestParam: {
7765
+ tenantId: property === null || property === void 0 ? void 0 : property.tenantId,
7766
+ propertyIds: property === null || property === void 0 ? void 0 : property.propertyId
7767
+ },
7768
+ jsonPath: "Properties[0].address.street",
7769
+ isArray: false,
7770
+ d: res => {
7771
+ 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")}` : "");
7772
+ return resultString;
7773
+ }
7850
7774
  }
7851
- }))
7775
+ }
7852
7776
  }
7853
- }, {
7854
- label: t("PT_PROVIDE_ONE_MORE_PARAM"),
7855
- isInsideBox: true,
7856
- placementinbox: 0,
7857
- isSectionText: true
7858
- }, {
7859
- label: mobileNumber.label,
7860
- type: mobileNumber.type,
7861
- populators: {
7862
- defaultValue: "",
7863
- name: mobileNumber.name,
7864
- validation: mobileNumber === null || mobileNumber === void 0 ? void 0 : mobileNumber.validation
7865
- },
7866
- ...description,
7867
- isMandatory: false,
7868
- isInsideBox: true,
7869
- placementinbox: 1
7870
- }, {
7871
- label: "",
7872
- labelChildren: /*#__PURE__*/React.createElement("div", {
7873
- className: "tooltip"
7874
- }, /*#__PURE__*/React.createElement("div", {
7875
- style: {
7876
- display: "flex",
7877
- gap: "0 4px"
7777
+ };
7778
+ });
7779
+ const getUserType = () => Digit.UserService.getType();
7780
+ const getFromLocation = (state, searchParams) => {
7781
+ return (state === null || state === void 0 ? void 0 : state.from) || (searchParams === null || searchParams === void 0 ? void 0 : searchParams.from) || DEFAULT_REDIRECT_URL;
7782
+ };
7783
+ const sendOtpToUser = async record => {
7784
+ sessionStorage.setItem("Digit_OBPS_PT", JSON.stringify(record));
7785
+ sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(record));
7786
+ if (onSelect) {
7787
+ onSelect("cptId", {
7788
+ id: record.property_id
7789
+ });
7790
+ } else {
7791
+ const data = {
7792
+ mobileNumber: record === null || record === void 0 ? void 0 : record.owner_mobile,
7793
+ tenantId: stateCode,
7794
+ userType: getUserType()
7795
+ };
7796
+ const [res, err] = await sendOtp({
7797
+ otp: {
7798
+ ...data,
7799
+ ...TYPE_LOGIN$1
7878
7800
  }
7879
- }, /*#__PURE__*/React.createElement("h2", null, t(property.label)), /*#__PURE__*/React.createElement(InfoBannerIcon, {
7880
- fill: "#0b0c0c"
7881
- }), /*#__PURE__*/React.createElement("span", {
7882
- className: "tooltiptext",
7883
- style: {
7884
- position: "absolute",
7885
- width: "72%",
7886
- marginLeft: "50%",
7887
- fontSize: "medium"
7801
+ });
7802
+ if (!err) {
7803
+ let redirectUrl = "/digit-ui/citizen/commonPt/property/link-success/" + record.property_id;
7804
+ if (redirectToUrl) {
7805
+ redirectUrl = redirectToUrl + "?propertyId=" + record.property_id + "&tenantId=" + tenantId;
7888
7806
  }
7889
- }, t(property.description) + " " + "PG-PT-xxxx-xxxxxx"))),
7890
- type: property.type,
7891
- populators: {
7892
- name: property.name,
7893
- defaultValue: "",
7894
- validation: property === null || property === void 0 ? void 0 : property.validation
7895
- },
7896
- ...description,
7897
- isMandatory: false,
7898
- isInsideBox: true,
7899
- placementinbox: 1
7900
- }, {
7901
- label: oldProperty.label,
7902
- type: oldProperty.type,
7903
- populators: {
7904
- name: oldProperty.name,
7905
- defaultValue: "",
7906
- validation: oldProperty === null || oldProperty === void 0 ? void 0 : oldProperty.validation
7907
- },
7908
- isMandatory: false,
7909
- isInsideBox: true,
7910
- placementinbox: 2
7911
- }],
7912
- body1: [{
7913
- type: "custom",
7914
- populators: {
7915
- name: "addParam1",
7916
- defaultValue: {
7917
- code: 1,
7918
- name: t("PT_SEARCH_DOOR_NO")
7919
- },
7920
- customProps: {
7921
- t,
7922
- isMandatory: true,
7923
- optionsKey: "name",
7924
- options: [{
7925
- code: 0,
7926
- name: t("PT_KNOW_PTID")
7927
- }, {
7928
- code: 1,
7929
- name: t("PT_SEARCH_DOOR_NO")
7930
- }]
7931
- },
7932
- component: (props, customProps) => /*#__PURE__*/React.createElement(RadioButtons, Object.assign({}, customProps, {
7933
- selectedOption: props.value,
7934
- onSelect: d => {
7935
- props === null || props === void 0 ? void 0 : props.setValue("city", {});
7936
- props === null || props === void 0 ? void 0 : props.setValue("locality", {});
7937
- props === null || props === void 0 ? void 0 : props.setValue("mobileNumber", "");
7938
- props === null || props === void 0 ? void 0 : props.setValue("propertyIds", "");
7939
- props === null || props === void 0 ? void 0 : props.setValue("doorNumber", "");
7940
- props === null || props === void 0 ? void 0 : props.setValue("oldPropertyId", "");
7941
- props === null || props === void 0 ? void 0 : props.setValue("name", "");
7942
- history.replace(`${history.location.pathname}?action=${action == 0 ? 1 : 0}`);
7943
- }
7944
- }))
7807
+ history.replace(`/digit-ui/citizen/commonPt/property/citizen-otp`, {
7808
+ from: getFromLocation(location.state, searchParams),
7809
+ mobileNumber: record.owner_mobile,
7810
+ redirectBackTo: redirectUrl
7811
+ });
7812
+ return;
7813
+ } else {
7814
+ history.push(`/digit-ui/citizen/`, {
7815
+ from: getFromLocation(location.state, searchParams),
7816
+ data: data
7817
+ });
7945
7818
  }
7819
+ }
7820
+ };
7821
+ const sendOtp = async data => {
7822
+ try {
7823
+ const res = await Digit.UserService.sendOtp(data, stateCode);
7824
+ return [res, null];
7825
+ } catch (err) {
7826
+ return [null, err];
7827
+ }
7828
+ };
7829
+ return /*#__PURE__*/React.createElement("div", {
7830
+ style: {
7831
+ marginTop: "16px"
7832
+ }
7833
+ }, /*#__PURE__*/React.createElement("div", null, header && /*#__PURE__*/React.createElement(Header, {
7834
+ style: {
7835
+ marginLeft: "8px"
7836
+ }
7837
+ }, t(header), " (", searchResults === null || searchResults === void 0 ? void 0 : searchResults.length, ")"), PrivacyInfoLabel && /*#__PURE__*/React.createElement(PrivacyInfoLabel, {
7838
+ t: t
7839
+ }), window.Digit.Utils.browser.isMobile() ? /*#__PURE__*/React.createElement(ResponseComposer, {
7840
+ data: searchResults,
7841
+ template: template,
7842
+ actionButtonLabel: actionButtonLabel,
7843
+ onSubmit: sendOtpToUser
7844
+ }) : /*#__PURE__*/React.createElement(Table, {
7845
+ t: t,
7846
+ data: searchResults,
7847
+ totalCount: searchResults === null || searchResults === void 0 ? void 0 : searchResults.length,
7848
+ totalRecords: searchResults === null || searchResults === void 0 ? void 0 : searchResults.length,
7849
+ columns: [{
7850
+ Header: t("PT_PROPERTY_PTUID"),
7851
+ disableSortBy: true,
7852
+ accessor: "property_id"
7946
7853
  }, {
7947
- label: "PT_SELECT_CITY",
7948
- isMandatory: true,
7949
- type: "custom",
7950
- populators: {
7951
- name: "city",
7952
- defaultValue: null,
7953
- rules: {
7954
- required: true
7955
- },
7956
- customProps: {
7957
- t,
7958
- isMandatory: true,
7959
- option: [...allCities],
7960
- optionKey: "i18nKey"
7961
- },
7962
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, customProps, {
7963
- selected: props.value,
7964
- select: d => {
7965
- var _props$value, _props$value2;
7966
- Digit.LocalizationService.getLocale({
7967
- modules: [`rainmaker-${props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.code}`],
7968
- locale: Digit.StoreData.getCurrentLanguage(),
7969
- tenantId: `${props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.code}`
7970
- });
7971
- if (d.code !== cityCode) props.setValue("locality", null);
7972
- props.onChange(d);
7973
- }
7974
- }))
7975
- }
7976
- }, {
7977
- label: "PT_SELECT_LOCALITY",
7978
- type: "custom",
7979
- isMandatory: true,
7980
- populators: {
7981
- name: "locality",
7982
- defaultValue: "",
7983
- rules: {
7984
- required: true
7985
- },
7986
- customProps: {},
7987
- component: (props, customProps) => /*#__PURE__*/React.createElement(Localities, {
7988
- selectLocality: d => {
7989
- props.onChange(d);
7990
- },
7991
- tenantId: cityCode,
7992
- boundaryType: "revenue",
7993
- keepNull: false,
7994
- optionCardStyles: {
7995
- height: "600px",
7996
- overflow: "auto",
7997
- zIndex: "10",
7998
- maxHeight: "300px"
7999
- },
8000
- selected: formValue === null || formValue === void 0 ? void 0 : formValue.locality,
8001
- disable: !cityCode,
8002
- disableLoader: true
8003
- })
8004
- }
8005
- }, {
8006
- label: t("PT_PROVIDE_ONE_MORE_PARAM"),
8007
- isInsideBox: true,
8008
- placementinbox: 0,
8009
- isSectionText: true
7854
+ Header: t("PT_OWNER_NAME"),
7855
+ disableSortBy: true,
7856
+ accessor: "owner_name"
8010
7857
  }, {
8011
- label: doorNumber.label,
8012
- type: doorNumber.type,
8013
- populators: {
8014
- defaultValue: "",
8015
- name: doorNumber.name,
8016
- validation: doorNumber === null || doorNumber === void 0 ? void 0 : doorNumber.validation
8017
- },
8018
- isMandatory: false,
8019
- isInsideBox: true,
8020
- placementinbox: 1
7858
+ Header: t("PT_PROPERTY_ADDRESS_SUB_HEADER"),
7859
+ disableSortBy: true,
7860
+ accessor: "property_address"
8021
7861
  }, {
8022
- label: name.label,
8023
- type: name.type,
8024
- populators: {
8025
- defaultValue: "",
8026
- name: name.name,
8027
- validation: name === null || name === void 0 ? void 0 : name.validation
8028
- },
8029
- isMandatory: false,
8030
- isInsideBox: true,
8031
- placementinbox: 2
7862
+ Header: t("zroLocation"),
7863
+ disableSortBy: true,
7864
+ accessor: "zroLocation"
8032
7865
  }]
8033
- }];
8034
- const onPropertySearch = async data => {
8035
- var _data$city, _tempObject;
8036
- if (ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > 0 && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && errorShown) {
8037
- seterrorShown(true);
8038
- return;
8039
- }
8040
- if (!(data !== null && data !== void 0 && (_data$city = data.city) !== null && _data$city !== void 0 && _data$city.code)) {
8041
- setShowToast({
8042
- error: true,
8043
- label: "ERR_PT_FILL_VALID_FIELDS"
8044
- });
8045
- return;
7866
+ })), modalData ? /*#__PURE__*/React.createElement(Modal, {
7867
+ hideSubmit: true,
7868
+ isDisabled: false,
7869
+ popupStyles: {
7870
+ width: "319px",
7871
+ height: "250px",
7872
+ margin: "auto"
7873
+ },
7874
+ formId: "modal-action"
7875
+ }, /*#__PURE__*/React.createElement("div", {
7876
+ ref: modalRef
7877
+ }, /*#__PURE__*/React.createElement(KeyNote, {
7878
+ keyValue: t("PT_AMOUNT_DUE"),
7879
+ note: `₹ ${modalData === null || modalData === void 0 ? void 0 : (_modalData$total_due = modalData.total_due) === null || _modalData$total_due === void 0 ? void 0 : _modalData$total_due.toLocaleString("en-IN")}`,
7880
+ noteStyle: {
7881
+ fontSize: "24px",
7882
+ fontWeight: "bold"
8046
7883
  }
8047
- if (action == 0) {
8048
- var _data$mobileNumber, _mobileNumber$validat, _mobileNumber$validat2, _data$propertyIds, _property$validation, _property$validation$, _data$oldPropertyId, _oldProperty$validati, _oldProperty$validati2;
8049
- if (!(data !== null && data !== void 0 && data.mobileNumber || data !== null && data !== void 0 && data.propertyIds || data !== null && data !== void 0 && data.oldPropertyId)) {
8050
- setShowToast({
8051
- error: true,
8052
- label: "ERR_PT_FILL_VALID_FIELDS"
8053
- });
8054
- return;
8055
- }
8056
- if (data !== null && data !== void 0 && data.mobileNumber && !((_data$mobileNumber = data.mobileNumber) !== null && _data$mobileNumber !== void 0 && _data$mobileNumber.match(mobileNumber === null || mobileNumber === void 0 ? void 0 : (_mobileNumber$validat = mobileNumber.validation) === null || _mobileNumber$validat === void 0 ? void 0 : (_mobileNumber$validat2 = _mobileNumber$validat.pattern) === null || _mobileNumber$validat2 === void 0 ? void 0 : _mobileNumber$validat2.value))) {
8057
- var _mobileNumber$validat3, _mobileNumber$validat4;
8058
- setShowToast({
8059
- error: true,
8060
- label: mobileNumber === null || mobileNumber === void 0 ? void 0 : (_mobileNumber$validat3 = mobileNumber.validation) === null || _mobileNumber$validat3 === void 0 ? void 0 : (_mobileNumber$validat4 = _mobileNumber$validat3.pattern) === null || _mobileNumber$validat4 === void 0 ? void 0 : _mobileNumber$validat4.message
8061
- });
8062
- return;
8063
- }
8064
- if (data !== null && data !== void 0 && data.propertyIds && !((_data$propertyIds = data.propertyIds) !== null && _data$propertyIds !== void 0 && _data$propertyIds.match(property === null || property === void 0 ? void 0 : (_property$validation = property.validation) === null || _property$validation === void 0 ? void 0 : (_property$validation$ = _property$validation.pattern) === null || _property$validation$ === void 0 ? void 0 : _property$validation$.value))) {
8065
- var _property$validation2, _property$validation3;
8066
- setShowToast({
8067
- error: true,
8068
- label: property === null || property === void 0 ? void 0 : (_property$validation2 = property.validation) === null || _property$validation2 === void 0 ? void 0 : (_property$validation3 = _property$validation2.pattern) === null || _property$validation3 === void 0 ? void 0 : _property$validation3.message
8069
- });
8070
- return;
8071
- }
8072
- if (data !== null && data !== void 0 && data.oldPropertyId && !((_data$oldPropertyId = data.oldPropertyId) !== null && _data$oldPropertyId !== void 0 && _data$oldPropertyId.match(oldProperty === null || oldProperty === void 0 ? void 0 : (_oldProperty$validati = oldProperty.validation) === null || _oldProperty$validati === void 0 ? void 0 : (_oldProperty$validati2 = _oldProperty$validati.pattern) === null || _oldProperty$validati2 === void 0 ? void 0 : _oldProperty$validati2.value))) {
8073
- var _oldProperty$validati3, _oldProperty$validati4;
8074
- setShowToast({
8075
- error: true,
8076
- label: oldProperty === null || oldProperty === void 0 ? void 0 : (_oldProperty$validati3 = oldProperty.validation) === null || _oldProperty$validati3 === void 0 ? void 0 : (_oldProperty$validati4 = _oldProperty$validati3.pattern) === null || _oldProperty$validati4 === void 0 ? void 0 : _oldProperty$validati4.message
8077
- });
8078
- return;
8079
- }
8080
- } else {
8081
- var _data$locality, _data$name, _name$validation, _name$validation$patt, _data$doorNumber, _doorNumber$validatio, _doorNumber$validatio2;
8082
- if (!(data !== null && data !== void 0 && (_data$locality = data.locality) !== null && _data$locality !== void 0 && _data$locality.code)) {
8083
- setShowToast({
8084
- error: true,
8085
- label: "ERR_PT_FILL_VALID_FIELDS"
8086
- });
8087
- return;
8088
- }
8089
- if (!(data !== null && data !== void 0 && data.doorNumber || data !== null && data !== void 0 && data.name)) {
8090
- setShowToast({
8091
- error: true,
8092
- label: "ERR_PT_FILL_VALID_FIELDS"
8093
- });
8094
- return;
8095
- }
8096
- if (data !== null && data !== void 0 && data.name && !((_data$name = data.name) !== null && _data$name !== void 0 && _data$name.match(name === null || name === void 0 ? void 0 : (_name$validation = name.validation) === null || _name$validation === void 0 ? void 0 : (_name$validation$patt = _name$validation.pattern) === null || _name$validation$patt === void 0 ? void 0 : _name$validation$patt.value))) {
8097
- var _name$validation2, _name$validation2$pat;
8098
- setShowToast({
8099
- error: true,
8100
- label: name === null || name === void 0 ? void 0 : (_name$validation2 = name.validation) === null || _name$validation2 === void 0 ? void 0 : (_name$validation2$pat = _name$validation2.pattern) === null || _name$validation2$pat === void 0 ? void 0 : _name$validation2$pat.message
8101
- });
8102
- return;
8103
- }
8104
- if (data !== null && data !== void 0 && data.doorNumber && !((_data$doorNumber = data.doorNumber) !== null && _data$doorNumber !== void 0 && _data$doorNumber.match(doorNumber === null || doorNumber === void 0 ? void 0 : (_doorNumber$validatio = doorNumber.validation) === null || _doorNumber$validatio === void 0 ? void 0 : (_doorNumber$validatio2 = _doorNumber$validatio.pattern) === null || _doorNumber$validatio2 === void 0 ? void 0 : _doorNumber$validatio2.value))) {
8105
- var _doorNumber$validatio3, _doorNumber$validatio4;
8106
- setShowToast({
8107
- error: true,
8108
- label: doorNumber === null || doorNumber === void 0 ? void 0 : (_doorNumber$validatio3 = doorNumber.validation) === null || _doorNumber$validatio3 === void 0 ? void 0 : (_doorNumber$validatio4 = _doorNumber$validatio3.pattern) === null || _doorNumber$validatio4 === void 0 ? void 0 : _doorNumber$validatio4.message
8109
- });
8110
- return;
8111
- }
7884
+ }), /*#__PURE__*/React.createElement("p", null, t("PT_YOU_HAVE") + " " + "₹" + " " + (modalData === null || modalData === void 0 ? void 0 : modalData.total_due.toLocaleString("en-IN")) + " " + t("PT_PENDING_AMOUNT") + " " + t("PT_INORDER_TO_TRANSFER")), /*#__PURE__*/React.createElement(SubmitBar, {
7885
+ submit: false,
7886
+ onSubmit: () => proceedToPay(modalData),
7887
+ style: {
7888
+ marginTop: "14px",
7889
+ width: "100%"
7890
+ },
7891
+ label: t("PT_PROCEED_PAYMENT")
7892
+ }))) : null, (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) === 0 && /*#__PURE__*/React.createElement("p", {
7893
+ style: {
7894
+ marginLeft: "16px",
7895
+ marginTop: "16px"
8112
7896
  }
8113
- if ((showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "ERR_PLEASE_REFINED_UR_SEARCH" || (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "NO_PROPERTIES_FOUND") setShowToast(null);
8114
- if (data !== null && data !== void 0 && data.doorNumber && (data === null || data === void 0 ? void 0 : data.doorNumber) !== "" && (data === null || data === void 0 ? void 0 : data.propertyIds) !== "") {
8115
- data["propertyIds"] = "";
7897
+ }, t("PT_NO_PROP_FOUND_MSG")), (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) !== 0 && ((searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) == 5 || (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) == 50) && (locality || searchQuery && searchQuery.locality) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
7898
+ style: {
7899
+ marginLeft: "16px",
7900
+ marginTop: "16px"
8116
7901
  }
8117
- let tempObject = Object.keys(data).filter(k => data[k]).reduce((acc, key) => ({
8118
- ...acc,
8119
- [key]: typeof data[key] === "object" ? data[key].code : data[key]
8120
- }), {});
8121
- let city = tempObject.city;
8122
- tempObject.doorNo = tempObject.doorNumber || ((_tempObject = tempObject) === null || _tempObject === void 0 ? void 0 : _tempObject.doorNo);
8123
- delete tempObject.addParam;
8124
- delete tempObject.addParam1;
8125
- delete tempObject.city;
8126
- if (action === "0") {
8127
- var _tempObject2, _tempObject3, _tempObject4;
8128
- tempObject = {
8129
- oldPropertyId: (_tempObject2 = tempObject) === null || _tempObject2 === void 0 ? void 0 : _tempObject2.oldPropertyId,
8130
- mobileNumber: (_tempObject3 = tempObject) === null || _tempObject3 === void 0 ? void 0 : _tempObject3.mobileNumber,
8131
- propertyIds: (_tempObject4 = tempObject) === null || _tempObject4 === void 0 ? void 0 : _tempObject4.propertyIds
8132
- };
8133
- } else if (action === "1") {
8134
- var _tempObject5, _tempObject6, _tempObject7, _tempObject8;
8135
- tempObject = {
8136
- name: (_tempObject5 = tempObject) === null || _tempObject5 === void 0 ? void 0 : _tempObject5.name,
8137
- doorNo: ((_tempObject6 = tempObject) === null || _tempObject6 === void 0 ? void 0 : _tempObject6.doorNumber) || ((_tempObject7 = tempObject) === null || _tempObject7 === void 0 ? void 0 : _tempObject7.doorNo),
8138
- locality: (_tempObject8 = tempObject) === null || _tempObject8 === void 0 ? void 0 : _tempObject8.locality
7902
+ }, t("PT_LOAD_MORE_MSG"), " ", /*#__PURE__*/React.createElement("span", {
7903
+ className: "link"
7904
+ }, /*#__PURE__*/React.createElement(Link, {
7905
+ to: `/digit-ui/citizen/pt/property/search-results?mobileNumber=${mobileNumber || searchQuery.mobileNumber ? mobileNumber || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber) : ""}&propertyIds=${propertyIds || searchQuery !== null && searchQuery !== void 0 && searchQuery.propertyIds ? propertyIds || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds) : ""}&oldPropertyIds=${oldPropertyIds || searchQuery !== null && searchQuery !== void 0 && searchQuery.oldPropertyIds ? oldPropertyIds || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds) : ""}&doorNo=${doorNo || searchQuery !== null && searchQuery !== void 0 && searchQuery.doorNo ? doorNo || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.doorNo) : ""}&name=${name || searchQuery !== null && searchQuery !== void 0 && searchQuery.name ? name || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.name) : ""}&city=${city ? city : ""}&locality=${locality || searchQuery !== null && searchQuery !== void 0 && searchQuery.locality ? locality || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.locality) : ""}&PToffset=${t1}`
7906
+ }, t("PT_COMMON_CLICK_HERE"))))));
7907
+ };
7908
+ PropertySearchResults.propTypes = {
7909
+ template: propTypes.any,
7910
+ header: propTypes.string,
7911
+ actionButtonLabel: propTypes.string
7912
+ };
7913
+ PropertySearchResults.defaultProps = {
7914
+ template: [],
7915
+ header: null,
7916
+ actionButtonLabel: null
7917
+ };
7918
+
7919
+ const SearchProperty = ({
7920
+ config: propsConfig,
7921
+ onSelect,
7922
+ redirectToUrl
7923
+ }) => {
7924
+ var _Digit$Hooks$pt$useTe, _Digit$Hooks$tl$useTe, _propertyData$Propert2, _propertyData$Propert3, _allCities, _allCities2, _Digit$UserService$ge3, _Digit$UserService$ge4, _allCities3, _allCities4, _searchData$filters2, _Object$values2, _Object$values2$filte;
7925
+ const {
7926
+ t
7927
+ } = useTranslation();
7928
+ const history = useHistory();
7929
+ const {
7930
+ action = 0
7931
+ } = Digit.Hooks.useQueryParams();
7932
+ const [searchData, setSearchData] = useState(() => {
7933
+ var _Digit$UserService$ge, _Digit$UserService$ge2;
7934
+ const isFirstVisit = sessionStorage.getItem("VisitedCitizenSearchRedirect");
7935
+ const mobileNumber = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.mobileNumber;
7936
+ if (!isFirstVisit && mobileNumber && window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")) {
7937
+ sessionStorage.setItem("VisitedCitizenSearchRedirect", "true");
7938
+ return {
7939
+ filters: {
7940
+ mobileNumber
7941
+ }
8139
7942
  };
8140
7943
  }
8141
- setSearchData({
8142
- city: city,
8143
- filters: tempObject
8144
- });
8145
- return;
8146
- };
8147
- const onFormValueChange = (setValue, data, formState) => {
8148
- const city = (data === null || data === void 0 ? void 0 : data.city) || allCities[0];
8149
- console.log("citycity", city);
8150
- setCityCode(city.code);
8151
- const locality = data === null || data === void 0 ? void 0 : data.locality;
8152
- if ((city === null || city === void 0 ? void 0 : city.code) !== cityCode) {
8153
- setCityCode(city === null || city === void 0 ? void 0 : city.code);
8154
- }
8155
- if (!lodash.isEqual(data, formValue)) {
8156
- setFormValue(data);
8157
- }
8158
- if (!locality || !city) {
8159
- return;
8160
- }
8161
- };
8162
- if (isLoading) {
8163
- return /*#__PURE__*/React.createElement(Loader, null);
8164
- }
8165
- let validation = ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && !(searchData !== null && searchData !== void 0 && (_searchData$filters2 = searchData.filters) !== null && _searchData$filters2 !== void 0 && _searchData$filters2.mobileNumber && ((_Object$values2 = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values2 === void 0 ? void 0 : (_Object$values2$filte = _Object$values2.filter(ob => ob !== undefined)) === null || _Object$values2$filte === void 0 ? void 0 : _Object$values2$filte.length) == 1) ? (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) < (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && (showToast == null || showToast !== null && !(showToast !== null && showToast !== void 0 && showToast.error)) : true;
8166
- if (propertyData && !propertyDataLoading && !error && validation) {
8167
- var _searchData$filters3, _Object$values3, _Object$values3$filte, _searchData$filters4, _propertyDataLoading$;
8168
- let qs = {};
8169
- qs = {
8170
- ...searchData.filters,
8171
- city: searchData.city
8172
- };
8173
- if (!(searchData !== null && searchData !== void 0 && (_searchData$filters3 = searchData.filters) !== null && _searchData$filters3 !== void 0 && _searchData$filters3.mobileNumber && ((_Object$values3 = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values3 === void 0 ? void 0 : (_Object$values3$filte = _Object$values3.filter(ob => ob !== undefined)) === null || _Object$values3$filte === void 0 ? void 0 : _Object$values3$filte.length) == 1) && ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.ptSearchCount && searchData !== null && searchData !== void 0 && (_searchData$filters4 = searchData.filters) !== null && _searchData$filters4 !== void 0 && _searchData$filters4.locality && propertyDataLoading && propertyDataLoading !== null && propertyDataLoading !== void 0 && (_propertyDataLoading$ = propertyDataLoading.Properties) !== null && _propertyDataLoading$ !== void 0 && _propertyDataLoading$.length && propertyDataLoading.Properties.length > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.ptSearchCount)) {
8174
- !showToast && setShowToast({
8175
- error: true,
8176
- label: "PT_MODIFY_SEARCH_CRITERIA"
8177
- });
8178
- } else if (propsConfig.action === "MUTATION") {
8179
- onSelect(propsConfig.key, qs, null, null, null, {
8180
- queryParams: {
8181
- ...qs
8182
- }
8183
- });
8184
- } else {
8185
- if (redirectToUrl || window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")) {
8186
- history.push(`/digit-ui/citizen/commonPt/property/search-results?${Object.keys(qs).map(key => `${key}=${qs[key]}`).join("&")}${redirectToUrl ? `&redirectToUrl=${redirectToUrl}` : ""}`);
8187
- } else {
8188
- var _qs, _qs2, _qs3, _qs4, _qs5, _qs6, _qs7, _qs8, _qs9, _propertyData$Propert4;
8189
- let SearchParams = {};
8190
- if (action == 0) SearchParams = {
8191
- city: (_qs = qs) === null || _qs === void 0 ? void 0 : _qs.city,
8192
- mobileNumber: ((_qs2 = qs) === null || _qs2 === void 0 ? void 0 : _qs2.mobileNumber) || "",
8193
- propertyIds: ((_qs3 = qs) === null || _qs3 === void 0 ? void 0 : _qs3.propertyIds) || "",
8194
- oldPropertyIds: ((_qs4 = qs) === null || _qs4 === void 0 ? void 0 : _qs4.oldPropertyIds) || "",
8195
- locality: "",
8196
- doorNo: "",
8197
- name: ""
8198
- };else SearchParams = {
8199
- city: (_qs5 = qs) === null || _qs5 === void 0 ? void 0 : _qs5.city,
8200
- locality: ((_qs6 = qs) === null || _qs6 === void 0 ? void 0 : _qs6.locality) || "",
8201
- doorNo: ((_qs7 = qs) === null || _qs7 === void 0 ? void 0 : _qs7.doorNumber) || ((_qs8 = qs) === null || _qs8 === void 0 ? void 0 : _qs8.doorNo) || "",
8202
- name: ((_qs9 = qs) === null || _qs9 === void 0 ? void 0 : _qs9.name) || "",
8203
- mobileNumber: "",
8204
- propertyIds: "",
8205
- oldPropertyIds: ""
8206
- };
8207
- !propertyDataLoading && (propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert4 = propertyData.Properties) === null || _propertyData$Propert4 === void 0 ? void 0 : _propertyData$Propert4.length) > 0 && onSelect("cptSearchQuery", SearchParams, null, null, null, {
8208
- queryParams: {
8209
- ...SearchParams
8210
- }
8211
- });
8212
- }
8213
- }
8214
- }
8215
- if (error) {
8216
- var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
8217
- !showToast && setShowToast({
8218
- error: true,
8219
- label: (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.code) || error
8220
- });
8221
- }
8222
- if (action == 1) {
8223
- config[0].body = [...config[0].body1];
8224
- }
8225
- return /*#__PURE__*/React.createElement("div", {
8226
- style: {
8227
- marginTop: "16px",
8228
- marginBottom: "16px",
8229
- backgroundColor: "white",
8230
- maxWidth: "960px"
8231
- }
8232
- }, /*#__PURE__*/React.createElement(FormComposer, {
8233
- onSubmit: onPropertySearch,
8234
- noBoxShadow: true,
8235
- inline: true,
8236
- config: config,
8237
- label: propsConfig.texts.submitButtonLabel,
8238
- heading: t(propsConfig.texts.header),
8239
- text: t(propsConfig.texts.text),
8240
- headingStyle: {
8241
- fontSize: "32px",
8242
- marginBottom: "16px",
8243
- fontFamily: "Roboto Condensed,sans-serif"
8244
- },
8245
- onFormValueChange: onFormValueChange,
8246
- cardStyle: {
8247
- marginBottom: "0",
8248
- maxWidth: "960px"
8249
- }
8250
- }), /*#__PURE__*/React.createElement("div", {
8251
- style: {
8252
- display: "flex"
8253
- }
8254
- }, window.location.href.includes("/obps/bpa/") ? /*#__PURE__*/React.createElement("span", {
8255
- className: "link",
8256
- style: isMobile ? {
8257
- display: "flex",
8258
- justifyContent: "center",
8259
- paddingBottom: "16px"
8260
- } : {
8261
- display: "flex",
8262
- justifyContent: "left",
8263
- paddingBottom: "16px",
8264
- marginLeft: "45px"
8265
- }
8266
- }, /*#__PURE__*/React.createElement(Link, {
8267
- to: "/digit-ui/citizen/obps/bpa/building_plan_scrutiny/new_construction/location"
8268
- }, t("CORE_COMMON_SKIP_CONTINUE"))) : /*#__PURE__*/React.createElement("span", {
8269
- className: "link",
8270
- style: isMobile ? {
8271
- display: "flex",
8272
- justifyContent: "center",
8273
- paddingBottom: "16px"
8274
- } : {
8275
- display: "flex",
8276
- justifyContent: "left",
8277
- paddingBottom: "16px",
8278
- marginLeft: "45px"
8279
- }
8280
- }, /*#__PURE__*/React.createElement(Link, {
8281
- to: window.location.href.includes("/ws/") ? "/digit-ui/citizen/ws/create-application/create-property" : window.location.href.includes("/tl/tradelicence/") ? "/digit-ui/citizen/tl/tradelicence/new-application/create-property" : window.location.href.includes("/fsm/") ? "/digit-ui/citizen/fsm/new-application/create-property" : "/digit-ui/citizen/commonpt/property/new-application"
8282
- }, t("CPT_REG_NEW_PROPERTY")))), showToast && /*#__PURE__*/React.createElement(Toast, {
8283
- isDleteBtn: true,
8284
- error: showToast.error,
8285
- warning: showToast.warning,
8286
- label: t(showToast.label),
8287
- onClose: () => {
8288
- setShowToast(null);
8289
- }
8290
- }));
8291
- };
8292
- SearchProperty.propTypes = {
8293
- loginParams: propTypes.any
8294
- };
8295
- SearchProperty.defaultProps = {
8296
- loginParams: null
8297
- };
8298
-
8299
- const SearchProperty$1 = ({
8300
- onSelect
8301
- }) => {
8302
- const {
8303
- t
8304
- } = useTranslation();
8305
- const {
8306
- path
8307
- } = useRouteMatch();
8308
- const search = useLocation().search;
8309
- const redirectToUrl = new URLSearchParams(search).get('redirectToUrl');
8310
- const params = useMemo(() => config.map(step => {
8311
- const texts = {};
8312
- for (const key in step.texts) {
8313
- texts[key] = t(step.texts[key]);
8314
- }
8315
- return {
8316
- ...step,
8317
- texts
8318
- };
8319
- }, [config]));
8320
- return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
8321
- path: `${path}`,
8322
- exact: true
8323
- }, /*#__PURE__*/React.createElement(SearchProperty, {
8324
- config: params[0],
8325
- onSelect: onSelect,
8326
- redirectToUrl: redirectToUrl
8327
- })));
8328
- };
8329
-
8330
- const config$1 = [{
8331
- texts: {
8332
- header: "CS_SEARCH_RESULTS",
8333
- actionButtonLabel: "PT_COMMONS_SELECT_PLACEHOLDER"
8334
- },
8335
- labels: [{
8336
- label: "PT_DUES_ARE_PENDING",
8337
- key: "total_due",
8338
- noteStyle: {
8339
- fontSize: "24px",
8340
- fontWeight: "bold"
8341
- },
8342
- notePrefix: "₹ "
8343
- }, {
8344
- label: "TL_PROPERTY_ID",
8345
- key: "property_id"
8346
- }, {
8347
- label: "PT_OWNERS_NAME",
8348
- key: "owner_name"
8349
- }, {
8350
- label: "PT_COMMON_COL_ADDRESS",
8351
- key: "property_address"
8352
- }, {
8353
- label: "PT_COMMON_TABLE_COL_STATUS_LABEL",
8354
- key: "status"
8355
- }]
8356
- }];
8357
-
8358
- const TYPE_LOGIN$1 = {
8359
- type: "login"
8360
- };
8361
- const DEFAULT_REDIRECT_URL = "/digit-ui/citizen";
8362
- const PropertySearchResults = ({
8363
- template,
8364
- header,
8365
- actionButtonLabel,
8366
- isMutation,
8367
- onSelect,
8368
- config,
8369
- clearParams: _clearParams = () => {},
8370
- stateCode,
8371
- redirectToUrl,
8372
- searchQuery
8373
- }) => {
8374
- var _result$data, _result$data2, _properties$map, _paymentDetails$data, _paymentDetails$data$, _ref, _modalData$total_due;
8375
- const {
8376
- t
8377
- } = useTranslation();
8378
- const modalRef = useRef();
8379
- const {
8380
- mobileNumber,
8381
- propertyIds,
8382
- oldPropertyIds,
8383
- locality,
8384
- city,
8385
- tenantId: tId,
8386
- doorNo,
8387
- name,
8388
- PToffset
8389
- } = Digit.Hooks.useQueryParams();
8390
- const filters = {};
8391
- const [modalData, setShowModal] = useState(false);
8392
- const PrivacyInfoLabel = Digit.ComponentRegistryService.getComponent("WSInfoLabel");
8393
- let OfsetForSearch = PToffset;
8394
- let t1;
8395
- let off;
8396
- if (!isNaN(parseInt(OfsetForSearch))) {
8397
- off = OfsetForSearch;
8398
- t1 = parseInt(OfsetForSearch) + 5;
8399
- } else {
8400
- t1 = 5;
8401
- }
8402
- let filter1 = !isNaN(parseInt(OfsetForSearch)) ? {
8403
- limit: "5",
8404
- sortOrder: "ASC",
8405
- sortBy: "createdTime",
8406
- offset: off
8407
- } : {
8408
- limit: "5",
8409
- sortOrder: "ASC",
8410
- sortBy: "createdTime",
8411
- offset: "0"
8412
- };
8413
- const closeModal = () => {
8414
- setShowModal(false);
8415
- };
8416
- Digit.Hooks.useClickOutside(modalRef, closeModal, modalData);
8417
- const sbm = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNo);
8418
- const spi = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyId);
8419
- const sop = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyId);
8420
- if (mobileNumber || sbm) filters.mobileNumber = mobileNumber ? mobileNumber : sbm;
8421
- if (propertyIds || spi) filters.propertyIds = propertyIds ? propertyIds : spi;
8422
- if (oldPropertyIds || sop) filters.oldPropertyIds = oldPropertyIds ? oldPropertyIds : sop;
8423
- if (locality || searchQuery && searchQuery.locality) filters.locality = locality ? locality : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.locality;
8424
- if (doorNo || searchQuery && searchQuery.doorNo) filters.doorNo = doorNo ? doorNo : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.doorNo;
8425
- if (name || searchQuery && searchQuery.name) filters.name = name ? name : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.name;
8426
- filters.limit = filter1.limit;
8427
- filters.sortOrder = filter1.sortOrder;
8428
- filters.sortBy = filter1.sortBy;
8429
- filters.offset = filter1.offset;
8430
- if (!filters.status) {
8431
- filters.status = "ACTIVE,INWORKFLOW";
7944
+ return {};
7945
+ });
7946
+ const [showToast, setShowToast] = useState(null);
7947
+ sessionStorage.setItem("VisitedCommonPTSearch", true);
7948
+ sessionStorage.setItem("VisitedLightCreate", false);
7949
+ let allCities = (_Digit$Hooks$pt$useTe = Digit.Hooks.pt.useTenants()) === null || _Digit$Hooks$pt$useTe === void 0 ? void 0 : _Digit$Hooks$pt$useTe.sort((a, b) => {
7950
+ var _a$i18nKey, _a$i18nKey$localeComp;
7951
+ return a === null || a === void 0 ? void 0 : (_a$i18nKey = a.i18nKey) === null || _a$i18nKey === void 0 ? void 0 : (_a$i18nKey$localeComp = _a$i18nKey.localeCompare) === null || _a$i18nKey$localeComp === void 0 ? void 0 : _a$i18nKey$localeComp.call(_a$i18nKey, b === null || b === void 0 ? void 0 : b.i18nKey);
7952
+ });
7953
+ allCities = allCities ? allCities : (_Digit$Hooks$tl$useTe = Digit.Hooks.tl.useTenants()) === null || _Digit$Hooks$tl$useTe === void 0 ? void 0 : _Digit$Hooks$tl$useTe.sort((a, b) => {
7954
+ var _a$i18nKey2, _a$i18nKey2$localeCom;
7955
+ return a === null || a === void 0 ? void 0 : (_a$i18nKey2 = a.i18nKey) === null || _a$i18nKey2 === void 0 ? void 0 : (_a$i18nKey2$localeCom = _a$i18nKey2.localeCompare) === null || _a$i18nKey2$localeCom === void 0 ? void 0 : _a$i18nKey2$localeCom.call(_a$i18nKey2, b === null || b === void 0 ? void 0 : b.i18nKey);
7956
+ });
7957
+ if (window.location.href.includes("obps")) {
7958
+ allCities = Digit.SessionStorage.get("OBPS_TENANTS");
7959
+ } else if (window.location.href.includes("fsm")) {
7960
+ allCities = [{
7961
+ i18nKey: "TENANT_TENANTS_PG_CITYA",
7962
+ code: Digit.ULBService.getCurrentTenantId(),
7963
+ name: "City A",
7964
+ description: "City A",
7965
+ pincode: [143001, 143002, 143003, 143004, 143005],
7966
+ logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
7967
+ imageId: null,
7968
+ domainUrl: "https://www.upyog.niua.org",
7969
+ type: "CITY",
7970
+ twitterUrl: null,
7971
+ facebookUrl: null,
7972
+ emailId: "citya@gmail.com",
7973
+ OfficeTimings: {
7974
+ "Mon - Fri": "9.00 AM - 6.00 PM"
7975
+ },
7976
+ city: {
7977
+ name: "City A",
7978
+ localName: null,
7979
+ districtCode: "CITYA",
7980
+ districtName: null,
7981
+ districtTenantCode: Digit.ULBService.getCurrentTenantId(),
7982
+ regionName: null,
7983
+ ulbGrade: "Municipal Corporation",
7984
+ longitude: 75.5761829,
7985
+ latitude: 31.3260152,
7986
+ shapeFileLocation: null,
7987
+ captcha: null,
7988
+ code: "1013",
7989
+ ddrName: "DDR A"
7990
+ },
7991
+ address: "City A Municipal Corporation",
7992
+ contactNumber: "001-2345876"
7993
+ }, {
7994
+ i18nKey: "TENANT_TENANTS_PG_CITYB",
7995
+ code: "pg.cityb",
7996
+ name: "City B",
7997
+ description: null,
7998
+ pincode: [143006, 143007, 143008, 143009, 143010],
7999
+ logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
8000
+ imageId: null,
8001
+ domainUrl: "https://www.upyog.niua.org",
8002
+ type: "CITY",
8003
+ twitterUrl: null,
8004
+ facebookUrl: null,
8005
+ emailId: "cityb@gmail.com",
8006
+ OfficeTimings: {
8007
+ "Mon - Fri": "9.00 AM - 6.00 PM",
8008
+ Sat: "9.00 AM - 12.00 PM"
8009
+ },
8010
+ city: {
8011
+ name: "City B",
8012
+ localName: null,
8013
+ districtCode: "CITYB",
8014
+ districtName: null,
8015
+ districtTenantCode: "pg.cityb",
8016
+ regionName: null,
8017
+ ulbGrade: "Municipal Corporation",
8018
+ longitude: 74.8722642,
8019
+ latitude: 31.6339793,
8020
+ shapeFileLocation: null,
8021
+ captcha: null,
8022
+ code: "107",
8023
+ ddrName: "DDR B"
8024
+ },
8025
+ address: "City B Municipal Corporation Address",
8026
+ contactNumber: "0978-7645345",
8027
+ helpLineNumber: "0654-8734567"
8028
+ }, {
8029
+ i18nKey: "TENANT_TENANTS_PG_CITYC",
8030
+ code: "pg.cityc",
8031
+ name: "City C",
8032
+ description: null,
8033
+ logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
8034
+ imageId: null,
8035
+ domainUrl: "https://www.upyog.niua.org",
8036
+ type: "CITY",
8037
+ twitterUrl: null,
8038
+ facebookUrl: null,
8039
+ emailId: "cityc@gmail.com",
8040
+ OfficeTimings: {
8041
+ "Mon - Fri": "9.00 AM - 6.00 PM",
8042
+ Sat: "9.00 AM - 12.00 PM"
8043
+ },
8044
+ city: {
8045
+ name: "City C",
8046
+ localName: null,
8047
+ districtCode: "CITYC",
8048
+ districtName: null,
8049
+ districtTenantCode: "pg.cityc",
8050
+ regionName: null,
8051
+ ulbGrade: "Municipal Corporation",
8052
+ longitude: 73.8722642,
8053
+ latitude: 31.6339793,
8054
+ shapeFileLocation: null,
8055
+ captcha: null,
8056
+ code: "108",
8057
+ ddrName: "DDR C"
8058
+ },
8059
+ address: "City C Municipal Corporation Address",
8060
+ contactNumber: "0978-7645345",
8061
+ helpLineNumber: "0654-8734567"
8062
+ }];
8432
8063
  }
8433
- const [owners, setOwners, clearOwners] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS", null);
8434
- const [lastPath, setLastPath, clearLastPath] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH", null);
8064
+ console.log("allCities", allCities);
8065
+ const [cityCode, setCityCode] = useState();
8066
+ const [formValue, setFormValue] = useState();
8067
+ const [errorShown, seterrorShown] = useState(false);
8068
+ let isMobile = window.Digit.Utils.browser.isMobile();
8435
8069
  const {
8436
- path,
8437
- url
8438
- } = useRouteMatch();
8439
- const searchParams = Digit.Hooks.useQueryParams();
8440
- useEffect(() => {
8441
- setOwners([]);
8442
- _clearParams();
8443
- setLastPath("");
8444
- }, []);
8445
- const auth = false;
8446
- const tenantId = Digit.ULBService.getCurrentTenantId();
8447
- const scity = city || tId || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.city) || tenantId;
8448
- const searchArgs = scity ? {
8449
- tenantId: scity,
8450
- filters,
8451
- auth
8452
- } : {
8453
- filters,
8454
- auth
8455
- };
8456
- const result = Digit.Hooks.pt.usePropertySearch(searchArgs, {
8457
- privacy: Digit.Utils.getPrivacyObject()
8458
- });
8459
- const properties = (result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.Properties) || (result === null || result === void 0 ? void 0 : (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.properties) || (Array.isArray(result === null || result === void 0 ? void 0 : result.data) ? result === null || result === void 0 ? void 0 : result.data : []);
8460
- const consumerCode = properties === null || properties === void 0 ? void 0 : (_properties$map = properties.map) === null || _properties$map === void 0 ? void 0 : _properties$map.call(properties, a => a.propertyId || a.id).filter(id => id).join(",");
8461
- if (result.isSuccess && (!properties || properties.length === 0)) {
8462
- console.warn("Property Search: No properties found in result.data", result.data);
8463
- }
8464
- const fetchBillParams = mobileNumber ? {
8465
- mobileNumber,
8466
- consumerCode
8467
- } : {
8468
- consumerCode
8469
- };
8470
- const paymentDetails = Digit.Hooks.useFetchBillsForBuissnessService({
8471
- businessService: "PT",
8472
- ...fetchBillParams,
8473
- tenantId: scity
8474
- }, {
8475
- enabled: !!(consumerCode && scity),
8476
- retry: false
8070
+ data: propertyData,
8071
+ isLoading: propertyDataLoading,
8072
+ error,
8073
+ isSuccess,
8074
+ billData
8075
+ } = Digit.Hooks.pt.usePropertySearchWithDue({
8076
+ tenantId: searchData === null || searchData === void 0 ? void 0 : searchData.city,
8077
+ filters: searchData === null || searchData === void 0 ? void 0 : searchData.filters,
8078
+ auth: false,
8079
+ configs: {
8080
+ enabled: Object.keys(searchData).length > 0,
8081
+ retry: false,
8082
+ retryOnMount: false,
8083
+ staleTime: Infinity
8084
+ }
8477
8085
  });
8478
- const history = useHistory();
8479
- const proceedToPay = data => {
8480
- history.push(`/digit-ui/citizen/payment/my-bills/PT/${data.property_id}`, {
8481
- tenantId
8482
- });
8483
- };
8484
- if (paymentDetails.isLoading || result.isLoading) {
8485
- return /*#__PURE__*/React.createElement(Loader, null);
8486
- }
8487
- if (result.error || result.isSuccess && (!properties || properties.length === 0)) {
8488
- return /*#__PURE__*/React.createElement("div", {
8489
- style: {
8490
- height: "150px"
8491
- }
8492
- }, /*#__PURE__*/React.createElement(Card, {
8493
- style: {
8494
- display: "flex",
8495
- justifyContent: "center",
8496
- alignItems: "center",
8497
- height: "100%"
8086
+ useEffect(() => {
8087
+ var _searchData$filters, _Object$values, _Object$values$filter;
8088
+ if (!(searchData !== null && searchData !== void 0 && (_searchData$filters = searchData.filters) !== null && _searchData$filters !== void 0 && _searchData$filters.mobileNumber && ((_Object$values = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values === void 0 ? void 0 : (_Object$values$filter = _Object$values.filter(ob => ob !== undefined)) === null || _Object$values$filter === void 0 ? void 0 : _Object$values$filter.length) == 1) && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > 0 && ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && !errorShown) {
8089
+ setShowToast({
8090
+ error: true,
8091
+ warning: true,
8092
+ label: "ERR_PLEASE_REFINED_UR_SEARCH"
8093
+ });
8094
+ }
8095
+ }, [propertyData]);
8096
+ useEffect(() => {
8097
+ showToast && (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "ERR_PLEASE_REFINED_UR_SEARCH" && (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "NO_PROPERTIES_FOUND" && setShowToast(null);
8098
+ }, [action, propertyDataLoading]);
8099
+ useEffect(() => {
8100
+ var _propertyData$Propert;
8101
+ if (!propertyDataLoading && propertyData && searchData && (propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert = propertyData.Properties) === null || _propertyData$Propert === void 0 ? void 0 : _propertyData$Propert.length) <= 0) {
8102
+ setShowToast({
8103
+ error: true,
8104
+ warning: true,
8105
+ label: "NO_PROPERTIES_FOUND"
8106
+ });
8107
+ }
8108
+ }, [propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert2 = propertyData.Properties) === null || _propertyData$Propert2 === void 0 ? void 0 : (_propertyData$Propert3 = _propertyData$Propert2[0]) === null || _propertyData$Propert3 === void 0 ? void 0 : _propertyData$Propert3.propertyId, propertyDataLoading]);
8109
+ useLayoutEffect(() => {
8110
+ const getActionBar = () => {
8111
+ let el = document.querySelector("div.action-bar-wrap");
8112
+ let clearBtn = document.querySelector(".primary-label-btn");
8113
+ if (el && clearBtn) {
8114
+ el.style.position = "static";
8115
+ el.style.padding = "8px 0";
8116
+ el.style.boxShadow = "none";
8117
+ el.style.marginBottom = "16px";
8118
+ el.style.display = "flex";
8119
+ el.style.justifyContent = "flex-end";
8120
+ el.style.alignItems = "center";
8121
+ el.style.zIndex = "0";
8122
+ clearBtn.style.margin = "0";
8123
+ clearBtn.style.marginRight = "24px";
8124
+ clearBtn.style.marginLeft = "auto";
8125
+ if (clearBtn.parentElement !== el) {
8126
+ el.insertBefore(clearBtn, el.firstChild);
8127
+ }
8128
+ } else {
8129
+ setTimeout(() => {
8130
+ getActionBar();
8131
+ }, 100);
8498
8132
  }
8499
- }, t("CS_PT_NO_PROPERTIES_FOUND")));
8500
- }
8501
- const payment = {};
8502
- paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data = paymentDetails.data) === null || _paymentDetails$data === void 0 ? void 0 : (_paymentDetails$data$ = _paymentDetails$data.Bill) === null || _paymentDetails$data$ === void 0 ? void 0 : _paymentDetails$data$.forEach(element => {
8503
- if (element !== null && element !== void 0 && element.consumerCode) {
8504
- payment[element === null || element === void 0 ? void 0 : element.consumerCode] = {
8505
- total_due: element === null || element === void 0 ? void 0 : element.totalAmount,
8506
- bil_due__date: new Date(element === null || element === void 0 ? void 0 : element.billDate).toDateString()
8507
- };
8133
+ };
8134
+ getActionBar();
8135
+ }, [action]);
8136
+ const {
8137
+ data: ptSearchConfig,
8138
+ isLoading
8139
+ } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "DIGIT-UI", "HelpText", {
8140
+ select: data => {
8141
+ var _data$DIGITUI, _data$DIGITUI$HelpTex, _data$DIGITUI$HelpTex2;
8142
+ return data === null || data === void 0 ? void 0 : (_data$DIGITUI = data["DIGIT-UI"]) === null || _data$DIGITUI === void 0 ? void 0 : (_data$DIGITUI$HelpTex = _data$DIGITUI["HelpText"]) === null || _data$DIGITUI$HelpTex === void 0 ? void 0 : (_data$DIGITUI$HelpTex2 = _data$DIGITUI$HelpTex[0]) === null || _data$DIGITUI$HelpTex2 === void 0 ? void 0 : _data$DIGITUI$HelpTex2.PT;
8508
8143
  }
8509
8144
  });
8510
- const searchResults = (_ref = properties || []) === null || _ref === void 0 ? void 0 : _ref.map(property => {
8511
- var _sort, _sort$, _addr$locality, _addr$locality2, _addr$locality3, _addr$locality4, _payment$property$pro, _payment$property$pro2, _2, _property$owners, _property$owners$;
8512
- let addr = (property === null || property === void 0 ? void 0 : property.address) || {};
8513
- return {
8514
- property_id: property === null || property === void 0 ? void 0 : property.propertyId,
8515
- owner_name: (_sort = ((property === null || property === void 0 ? void 0 : property.owners) || []).sort((a, b) => {
8516
- var _a$additionalDetails, _b$additionalDetails;
8517
- 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);
8518
- })) === null || _sort === void 0 ? void 0 : (_sort$ = _sort[0]) === null || _sort$ === void 0 ? void 0 : _sort$.name,
8519
- 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(", "),
8520
- 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,
8521
- 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"),
8522
- status: t(property.status),
8523
- owner_mobile: (_2 = ((property === null || property === void 0 ? void 0 : property.owners) || [])[0]) === null || _2 === void 0 ? void 0 : _2.mobileNumber,
8524
- address: property === null || property === void 0 ? void 0 : property.address,
8525
- owners: property.owners,
8526
- propertyDetails: property,
8527
- privacy: {
8528
- property_address: {
8529
- uuid: property === null || property === void 0 ? void 0 : (_property$owners = property.owners) === null || _property$owners === void 0 ? void 0 : (_property$owners$ = _property$owners[0]) === null || _property$owners$ === void 0 ? void 0 : _property$owners$.uuid,
8530
- fieldName: ["doorNo", "street", "landmark"],
8531
- model: "Property",
8532
- showValue: true,
8533
- loadData: {
8534
- serviceName: "/property-services/property/_search",
8535
- requestBody: {},
8536
- requestParam: {
8537
- tenantId: property === null || property === void 0 ? void 0 : property.tenantId,
8538
- propertyIds: property === null || property === void 0 ? void 0 : property.propertyId
8539
- },
8540
- jsonPath: "Properties[0].address.street",
8541
- isArray: false,
8542
- d: res => {
8543
- 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")}` : "");
8544
- return resultString;
8545
- }
8145
+ const [mobileNumber, property, oldProperty, name, doorNumber] = propsConfig.inputs;
8146
+ const config = [{
8147
+ body: [{
8148
+ label: "PT_SELECT_CITY",
8149
+ isMandatory: true,
8150
+ type: "custom",
8151
+ populators: {
8152
+ name: "city",
8153
+ defaultValue: ((_allCities = allCities) === null || _allCities === void 0 ? void 0 : _allCities.find(c => c.code === "dl.djb" || c.code === "dl")) || ((_allCities2 = allCities) === null || _allCities2 === void 0 ? void 0 : _allCities2[0]) || null,
8154
+ rules: {
8155
+ required: true
8156
+ },
8157
+ customProps: {
8158
+ t,
8159
+ isMandatory: true,
8160
+ option: [...allCities],
8161
+ optionKey: "i18nKey"
8162
+ },
8163
+ component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, customProps, {
8164
+ disable: true,
8165
+ selected: props.value,
8166
+ select: d => {
8167
+ Digit.ULBService.getCurrentTenantId();
8168
+ if (d.code !== cityCode) props.setValue("locality", null);
8169
+ props.onChange(d);
8170
+ }
8171
+ }))
8172
+ }
8173
+ }, {
8174
+ label: mobileNumber.label,
8175
+ type: mobileNumber.type,
8176
+ populators: {
8177
+ defaultValue: ((_Digit$UserService$ge3 = Digit.UserService.getUser()) === null || _Digit$UserService$ge3 === void 0 ? void 0 : (_Digit$UserService$ge4 = _Digit$UserService$ge3.info) === null || _Digit$UserService$ge4 === void 0 ? void 0 : _Digit$UserService$ge4.mobileNumber) || "",
8178
+ name: mobileNumber.name,
8179
+ validation: mobileNumber === null || mobileNumber === void 0 ? void 0 : mobileNumber.validation
8180
+ },
8181
+ isMandatory: false
8182
+ }],
8183
+ body1: [{
8184
+ label: "PT_SELECT_CITY",
8185
+ isMandatory: true,
8186
+ type: "custom",
8187
+ populators: {
8188
+ name: "city",
8189
+ defaultValue: ((_allCities3 = allCities) === null || _allCities3 === void 0 ? void 0 : _allCities3.find(c => c.code === "dl.djb" || c.code === "dl")) || ((_allCities4 = allCities) === null || _allCities4 === void 0 ? void 0 : _allCities4[0]) || null,
8190
+ rules: {
8191
+ required: true
8192
+ },
8193
+ customProps: {
8194
+ t,
8195
+ isMandatory: true,
8196
+ option: [...allCities],
8197
+ optionKey: "i18nKey"
8198
+ },
8199
+ component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, customProps, {
8200
+ disable: true,
8201
+ selected: props.value,
8202
+ select: d => {
8203
+ var _props$value, _props$value2;
8204
+ Digit.LocalizationService.getLocale({
8205
+ modules: [`rainmaker-${props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.code}`],
8206
+ locale: Digit.StoreData.getCurrentLanguage(),
8207
+ tenantId: `${props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.code}`
8208
+ });
8209
+ if (d.code !== cityCode) props.setValue("locality", null);
8210
+ props.onChange(d);
8546
8211
  }
8547
- }
8212
+ }))
8548
8213
  }
8549
- };
8550
- });
8551
- const getUserType = () => Digit.UserService.getType();
8552
- const getFromLocation = (state, searchParams) => {
8553
- return (state === null || state === void 0 ? void 0 : state.from) || (searchParams === null || searchParams === void 0 ? void 0 : searchParams.from) || DEFAULT_REDIRECT_URL;
8554
- };
8555
- const sendOtpToUser = async record => {
8556
- sessionStorage.setItem("Digit_OBPS_PT", JSON.stringify(record));
8557
- sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(record));
8558
- if (onSelect) {
8559
- onSelect('cptId', {
8560
- id: record.property_id
8214
+ }, {
8215
+ label: "PT_SELECT_LOCALITY",
8216
+ type: "custom",
8217
+ isMandatory: true,
8218
+ populators: {
8219
+ name: "locality",
8220
+ defaultValue: "",
8221
+ rules: {
8222
+ required: true
8223
+ },
8224
+ customProps: {},
8225
+ component: (props, customProps) => /*#__PURE__*/React.createElement(Localities, {
8226
+ selectLocality: d => {
8227
+ props.onChange(d);
8228
+ },
8229
+ tenantId: cityCode,
8230
+ boundaryType: "revenue",
8231
+ keepNull: false,
8232
+ optionCardStyles: {
8233
+ height: "600px",
8234
+ overflow: "auto",
8235
+ zIndex: "10",
8236
+ maxHeight: "300px"
8237
+ },
8238
+ selected: formValue === null || formValue === void 0 ? void 0 : formValue.locality,
8239
+ disable: !cityCode,
8240
+ disableLoader: true
8241
+ })
8242
+ }
8243
+ }, {
8244
+ label: doorNumber.label,
8245
+ type: doorNumber.type,
8246
+ populators: {
8247
+ defaultValue: "",
8248
+ name: doorNumber.name,
8249
+ validation: doorNumber === null || doorNumber === void 0 ? void 0 : doorNumber.validation
8250
+ },
8251
+ isMandatory: false
8252
+ }, {
8253
+ label: name.label,
8254
+ type: name.type,
8255
+ populators: {
8256
+ defaultValue: "",
8257
+ name: name.name,
8258
+ validation: name === null || name === void 0 ? void 0 : name.validation
8259
+ },
8260
+ isMandatory: false
8261
+ }]
8262
+ }];
8263
+ const onPropertySearch = async data => {
8264
+ var _data$city, _tempObject;
8265
+ if (ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > 0 && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && errorShown) {
8266
+ seterrorShown(true);
8267
+ return;
8268
+ }
8269
+ if (!(data !== null && data !== void 0 && (_data$city = data.city) !== null && _data$city !== void 0 && _data$city.code)) {
8270
+ setShowToast({
8271
+ error: true,
8272
+ label: "ERR_PT_FILL_VALID_FIELDS"
8561
8273
  });
8274
+ return;
8275
+ }
8276
+ if (action == 0) {
8277
+ var _data$mobileNumber, _mobileNumber$validat, _mobileNumber$validat2, _data$propertyIds, _property$validation, _property$validation$, _data$oldPropertyId, _oldProperty$validati, _oldProperty$validati2;
8278
+ if (!(data !== null && data !== void 0 && data.mobileNumber || data !== null && data !== void 0 && data.propertyIds || data !== null && data !== void 0 && data.oldPropertyId)) {
8279
+ setShowToast({
8280
+ error: true,
8281
+ label: "ERR_PT_FILL_VALID_FIELDS"
8282
+ });
8283
+ return;
8284
+ }
8285
+ if (data !== null && data !== void 0 && data.mobileNumber && !((_data$mobileNumber = data.mobileNumber) !== null && _data$mobileNumber !== void 0 && _data$mobileNumber.match(mobileNumber === null || mobileNumber === void 0 ? void 0 : (_mobileNumber$validat = mobileNumber.validation) === null || _mobileNumber$validat === void 0 ? void 0 : (_mobileNumber$validat2 = _mobileNumber$validat.pattern) === null || _mobileNumber$validat2 === void 0 ? void 0 : _mobileNumber$validat2.value))) {
8286
+ var _mobileNumber$validat3, _mobileNumber$validat4;
8287
+ setShowToast({
8288
+ error: true,
8289
+ label: mobileNumber === null || mobileNumber === void 0 ? void 0 : (_mobileNumber$validat3 = mobileNumber.validation) === null || _mobileNumber$validat3 === void 0 ? void 0 : (_mobileNumber$validat4 = _mobileNumber$validat3.pattern) === null || _mobileNumber$validat4 === void 0 ? void 0 : _mobileNumber$validat4.message
8290
+ });
8291
+ return;
8292
+ }
8293
+ if (data !== null && data !== void 0 && data.propertyIds && !((_data$propertyIds = data.propertyIds) !== null && _data$propertyIds !== void 0 && _data$propertyIds.match(property === null || property === void 0 ? void 0 : (_property$validation = property.validation) === null || _property$validation === void 0 ? void 0 : (_property$validation$ = _property$validation.pattern) === null || _property$validation$ === void 0 ? void 0 : _property$validation$.value))) {
8294
+ var _property$validation2, _property$validation3;
8295
+ setShowToast({
8296
+ error: true,
8297
+ label: property === null || property === void 0 ? void 0 : (_property$validation2 = property.validation) === null || _property$validation2 === void 0 ? void 0 : (_property$validation3 = _property$validation2.pattern) === null || _property$validation3 === void 0 ? void 0 : _property$validation3.message
8298
+ });
8299
+ return;
8300
+ }
8301
+ if (data !== null && data !== void 0 && data.oldPropertyId && !((_data$oldPropertyId = data.oldPropertyId) !== null && _data$oldPropertyId !== void 0 && _data$oldPropertyId.match(oldProperty === null || oldProperty === void 0 ? void 0 : (_oldProperty$validati = oldProperty.validation) === null || _oldProperty$validati === void 0 ? void 0 : (_oldProperty$validati2 = _oldProperty$validati.pattern) === null || _oldProperty$validati2 === void 0 ? void 0 : _oldProperty$validati2.value))) {
8302
+ var _oldProperty$validati3, _oldProperty$validati4;
8303
+ setShowToast({
8304
+ error: true,
8305
+ label: oldProperty === null || oldProperty === void 0 ? void 0 : (_oldProperty$validati3 = oldProperty.validation) === null || _oldProperty$validati3 === void 0 ? void 0 : (_oldProperty$validati4 = _oldProperty$validati3.pattern) === null || _oldProperty$validati4 === void 0 ? void 0 : _oldProperty$validati4.message
8306
+ });
8307
+ return;
8308
+ }
8562
8309
  } else {
8563
- const data = {
8564
- mobileNumber: record === null || record === void 0 ? void 0 : record.owner_mobile,
8565
- tenantId: stateCode,
8566
- userType: getUserType()
8567
- };
8568
- const [res, err] = await sendOtp({
8569
- otp: {
8570
- ...data,
8571
- ...TYPE_LOGIN$1
8572
- }
8573
- });
8574
- if (!err) {
8575
- let redirectUrl = '/digit-ui/citizen/commonPt/property/link-success/' + record.property_id;
8576
- if (redirectToUrl) {
8577
- redirectUrl = redirectToUrl + '?propertyId=' + record.property_id + '&tenantId=' + tenantId;
8578
- }
8579
- history.replace(`/digit-ui/citizen/commonPt/property/citizen-otp`, {
8580
- from: getFromLocation(location.state, searchParams),
8581
- mobileNumber: record.owner_mobile,
8582
- redirectBackTo: redirectUrl
8310
+ var _data$locality, _data$name, _name$validation, _name$validation$patt, _data$doorNumber, _doorNumber$validatio, _doorNumber$validatio2;
8311
+ if (!(data !== null && data !== void 0 && (_data$locality = data.locality) !== null && _data$locality !== void 0 && _data$locality.code)) {
8312
+ setShowToast({
8313
+ error: true,
8314
+ label: "ERR_PT_FILL_VALID_FIELDS"
8583
8315
  });
8584
8316
  return;
8585
- } else {
8586
- history.push(`/digit-ui/citizen/`, {
8587
- from: getFromLocation(location.state, searchParams),
8588
- data: data
8317
+ }
8318
+ if (!(data !== null && data !== void 0 && data.doorNumber || data !== null && data !== void 0 && data.name)) {
8319
+ setShowToast({
8320
+ error: true,
8321
+ label: "ERR_PT_FILL_VALID_FIELDS"
8322
+ });
8323
+ return;
8324
+ }
8325
+ if (data !== null && data !== void 0 && data.name && !((_data$name = data.name) !== null && _data$name !== void 0 && _data$name.match(name === null || name === void 0 ? void 0 : (_name$validation = name.validation) === null || _name$validation === void 0 ? void 0 : (_name$validation$patt = _name$validation.pattern) === null || _name$validation$patt === void 0 ? void 0 : _name$validation$patt.value))) {
8326
+ var _name$validation2, _name$validation2$pat;
8327
+ setShowToast({
8328
+ error: true,
8329
+ label: name === null || name === void 0 ? void 0 : (_name$validation2 = name.validation) === null || _name$validation2 === void 0 ? void 0 : (_name$validation2$pat = _name$validation2.pattern) === null || _name$validation2$pat === void 0 ? void 0 : _name$validation2$pat.message
8330
+ });
8331
+ return;
8332
+ }
8333
+ if (data !== null && data !== void 0 && data.doorNumber && !((_data$doorNumber = data.doorNumber) !== null && _data$doorNumber !== void 0 && _data$doorNumber.match(doorNumber === null || doorNumber === void 0 ? void 0 : (_doorNumber$validatio = doorNumber.validation) === null || _doorNumber$validatio === void 0 ? void 0 : (_doorNumber$validatio2 = _doorNumber$validatio.pattern) === null || _doorNumber$validatio2 === void 0 ? void 0 : _doorNumber$validatio2.value))) {
8334
+ var _doorNumber$validatio3, _doorNumber$validatio4;
8335
+ setShowToast({
8336
+ error: true,
8337
+ label: doorNumber === null || doorNumber === void 0 ? void 0 : (_doorNumber$validatio3 = doorNumber.validation) === null || _doorNumber$validatio3 === void 0 ? void 0 : (_doorNumber$validatio4 = _doorNumber$validatio3.pattern) === null || _doorNumber$validatio4 === void 0 ? void 0 : _doorNumber$validatio4.message
8338
+ });
8339
+ return;
8340
+ }
8341
+ }
8342
+ if ((showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "ERR_PLEASE_REFINED_UR_SEARCH" || (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "NO_PROPERTIES_FOUND") setShowToast(null);
8343
+ if (data !== null && data !== void 0 && data.doorNumber && (data === null || data === void 0 ? void 0 : data.doorNumber) !== "" && (data === null || data === void 0 ? void 0 : data.propertyIds) !== "") {
8344
+ data["propertyIds"] = "";
8345
+ }
8346
+ let tempObject = Object.keys(data).filter(k => data[k]).reduce((acc, key) => ({
8347
+ ...acc,
8348
+ [key]: typeof data[key] === "object" ? data[key].code : data[key]
8349
+ }), {});
8350
+ let city = tempObject.city;
8351
+ tempObject.doorNo = tempObject.doorNumber || ((_tempObject = tempObject) === null || _tempObject === void 0 ? void 0 : _tempObject.doorNo);
8352
+ delete tempObject.addParam;
8353
+ delete tempObject.addParam1;
8354
+ delete tempObject.city;
8355
+ if (action === "0") {
8356
+ var _tempObject2, _tempObject3, _tempObject4;
8357
+ tempObject = {
8358
+ oldPropertyId: (_tempObject2 = tempObject) === null || _tempObject2 === void 0 ? void 0 : _tempObject2.oldPropertyId,
8359
+ mobileNumber: (_tempObject3 = tempObject) === null || _tempObject3 === void 0 ? void 0 : _tempObject3.mobileNumber,
8360
+ propertyIds: (_tempObject4 = tempObject) === null || _tempObject4 === void 0 ? void 0 : _tempObject4.propertyIds
8361
+ };
8362
+ } else if (action === "1") {
8363
+ var _tempObject5, _tempObject6, _tempObject7, _tempObject8;
8364
+ tempObject = {
8365
+ name: (_tempObject5 = tempObject) === null || _tempObject5 === void 0 ? void 0 : _tempObject5.name,
8366
+ doorNo: ((_tempObject6 = tempObject) === null || _tempObject6 === void 0 ? void 0 : _tempObject6.doorNumber) || ((_tempObject7 = tempObject) === null || _tempObject7 === void 0 ? void 0 : _tempObject7.doorNo),
8367
+ locality: (_tempObject8 = tempObject) === null || _tempObject8 === void 0 ? void 0 : _tempObject8.locality
8368
+ };
8369
+ }
8370
+ setSearchData({
8371
+ city: city,
8372
+ filters: tempObject
8373
+ });
8374
+ return;
8375
+ };
8376
+ const onFormValueChange = (setValue, data, formState) => {
8377
+ const city = (data === null || data === void 0 ? void 0 : data.city) || allCities[0];
8378
+ console.log("citycity", city);
8379
+ setCityCode(city.code);
8380
+ const locality = data === null || data === void 0 ? void 0 : data.locality;
8381
+ if ((city === null || city === void 0 ? void 0 : city.code) !== cityCode) {
8382
+ setCityCode(city === null || city === void 0 ? void 0 : city.code);
8383
+ }
8384
+ if (!lodash.isEqual(data, formValue)) {
8385
+ setFormValue(data);
8386
+ }
8387
+ if (!locality || !city) {
8388
+ return;
8389
+ }
8390
+ };
8391
+ if (isLoading) {
8392
+ return /*#__PURE__*/React.createElement(Loader, null);
8393
+ }
8394
+ let validation = ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && !(searchData !== null && searchData !== void 0 && (_searchData$filters2 = searchData.filters) !== null && _searchData$filters2 !== void 0 && _searchData$filters2.mobileNumber && ((_Object$values2 = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values2 === void 0 ? void 0 : (_Object$values2$filte = _Object$values2.filter(ob => ob !== undefined)) === null || _Object$values2$filte === void 0 ? void 0 : _Object$values2$filte.length) == 1) ? (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) < (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && (showToast == null || showToast !== null && !(showToast !== null && showToast !== void 0 && showToast.error)) : true;
8395
+ if (propertyData && !propertyDataLoading && !error && validation) {
8396
+ var _searchData$filters3, _Object$values3, _Object$values3$filte, _searchData$filters4, _propertyDataLoading$;
8397
+ let qs = {};
8398
+ qs = {
8399
+ ...searchData.filters,
8400
+ city: searchData.city
8401
+ };
8402
+ if (!(searchData !== null && searchData !== void 0 && (_searchData$filters3 = searchData.filters) !== null && _searchData$filters3 !== void 0 && _searchData$filters3.mobileNumber && ((_Object$values3 = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values3 === void 0 ? void 0 : (_Object$values3$filte = _Object$values3.filter(ob => ob !== undefined)) === null || _Object$values3$filte === void 0 ? void 0 : _Object$values3$filte.length) == 1) && ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.ptSearchCount && searchData !== null && searchData !== void 0 && (_searchData$filters4 = searchData.filters) !== null && _searchData$filters4 !== void 0 && _searchData$filters4.locality && propertyDataLoading && propertyDataLoading !== null && propertyDataLoading !== void 0 && (_propertyDataLoading$ = propertyDataLoading.Properties) !== null && _propertyDataLoading$ !== void 0 && _propertyDataLoading$.length && propertyDataLoading.Properties.length > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.ptSearchCount)) {
8403
+ !showToast && setShowToast({
8404
+ error: true,
8405
+ label: "PT_MODIFY_SEARCH_CRITERIA"
8406
+ });
8407
+ } else if (propsConfig.action === "MUTATION") {
8408
+ onSelect(propsConfig.key, qs, null, null, null, {
8409
+ queryParams: {
8410
+ ...qs
8411
+ }
8412
+ });
8413
+ } else {
8414
+ if (redirectToUrl && !window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")) {
8415
+ history.push(`/digit-ui/citizen/commonPt/property/search-results?${Object.keys(qs).filter(key => qs[key] !== undefined && qs[key] !== "").map(key => `${key}=${qs[key]}`).join("&")}${redirectToUrl ? `&redirectToUrl=${redirectToUrl}` : ""}`);
8416
+ } else if (!window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")) {
8417
+ var _qs, _qs2, _qs3, _qs4, _qs5, _qs6, _qs7, _qs8, _qs9, _propertyData$Propert4;
8418
+ let SearchParams = {};
8419
+ if (action == 0) SearchParams = {
8420
+ city: (_qs = qs) === null || _qs === void 0 ? void 0 : _qs.city,
8421
+ mobileNumber: ((_qs2 = qs) === null || _qs2 === void 0 ? void 0 : _qs2.mobileNumber) || "",
8422
+ propertyIds: ((_qs3 = qs) === null || _qs3 === void 0 ? void 0 : _qs3.propertyIds) || "",
8423
+ oldPropertyIds: ((_qs4 = qs) === null || _qs4 === void 0 ? void 0 : _qs4.oldPropertyIds) || "",
8424
+ locality: "",
8425
+ doorNo: "",
8426
+ name: ""
8427
+ };else SearchParams = {
8428
+ city: (_qs5 = qs) === null || _qs5 === void 0 ? void 0 : _qs5.city,
8429
+ locality: ((_qs6 = qs) === null || _qs6 === void 0 ? void 0 : _qs6.locality) || "",
8430
+ doorNo: ((_qs7 = qs) === null || _qs7 === void 0 ? void 0 : _qs7.doorNumber) || ((_qs8 = qs) === null || _qs8 === void 0 ? void 0 : _qs8.doorNo) || "",
8431
+ name: ((_qs9 = qs) === null || _qs9 === void 0 ? void 0 : _qs9.name) || "",
8432
+ mobileNumber: "",
8433
+ propertyIds: "",
8434
+ oldPropertyIds: ""
8435
+ };
8436
+ !propertyDataLoading && (propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert4 = propertyData.Properties) === null || _propertyData$Propert4 === void 0 ? void 0 : _propertyData$Propert4.length) > 0 && onSelect("cptSearchQuery", SearchParams, null, null, null, {
8437
+ queryParams: {
8438
+ ...SearchParams
8439
+ }
8589
8440
  });
8590
8441
  }
8591
8442
  }
8592
- };
8593
- const sendOtp = async data => {
8594
- try {
8595
- const res = await Digit.UserService.sendOtp(data, stateCode);
8596
- return [res, null];
8597
- } catch (err) {
8598
- return [null, err];
8599
- }
8600
- };
8601
- return /*#__PURE__*/React.createElement("div", {
8602
- className: "static",
8443
+ }
8444
+ if (error) {
8445
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
8446
+ !showToast && setShowToast({
8447
+ error: true,
8448
+ label: (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.code) || error
8449
+ });
8450
+ }
8451
+ if (action == 1) {
8452
+ config[0].body = [...config[0].body1];
8453
+ }
8454
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
8455
+ className: "search-tabs-container",
8603
8456
  style: {
8604
- marginTop: "16px"
8457
+ marginBottom: "16px",
8458
+ display: "flex",
8459
+ gap: "24px",
8460
+ justifyContent: "flex-start",
8461
+ borderBottom: "1px solid #ccc"
8605
8462
  }
8606
8463
  }, /*#__PURE__*/React.createElement("div", {
8607
- className: "static-wrapper"
8608
- }, header && /*#__PURE__*/React.createElement(Header, {
8464
+ className: `search-tab ${action == 0 ? "active" : ""}`,
8609
8465
  style: {
8610
- marginLeft: "8px"
8611
- }
8612
- }, t(header), " (", searchResults === null || searchResults === void 0 ? void 0 : searchResults.length, ")"), PrivacyInfoLabel && /*#__PURE__*/React.createElement(PrivacyInfoLabel, {
8613
- t: t
8614
- }), /*#__PURE__*/React.createElement(ResponseComposer, {
8615
- data: searchResults,
8616
- template: template,
8617
- actionButtonLabel: actionButtonLabel,
8618
- onSubmit: sendOtpToUser
8619
- })), modalData ? /*#__PURE__*/React.createElement(Modal, {
8620
- hideSubmit: true,
8621
- isDisabled: false,
8622
- popupStyles: {
8623
- width: "319px",
8624
- height: "250px",
8625
- margin: "auto"
8466
+ padding: "8px 16px",
8467
+ cursor: "pointer",
8468
+ borderBottom: action == 0 ? "2px solid #f47738" : "2px solid transparent",
8469
+ color: action == 0 ? "#f47738" : "#0b0c0c",
8470
+ fontWeight: action == 0 ? "bold" : "normal"
8626
8471
  },
8627
- formId: "modal-action"
8628
- }, /*#__PURE__*/React.createElement("div", {
8629
- ref: modalRef
8630
- }, /*#__PURE__*/React.createElement(KeyNote, {
8631
- keyValue: t("PT_AMOUNT_DUE"),
8632
- note: `₹ ${modalData === null || modalData === void 0 ? void 0 : (_modalData$total_due = modalData.total_due) === null || _modalData$total_due === void 0 ? void 0 : _modalData$total_due.toLocaleString("en-IN")}`,
8633
- noteStyle: {
8634
- fontSize: "24px",
8635
- fontWeight: "bold"
8472
+ onClick: () => {
8473
+ history.replace(`${history.location.pathname}?action=0`);
8474
+ setSearchData({});
8636
8475
  }
8637
- }), /*#__PURE__*/React.createElement("p", null, t("PT_YOU_HAVE") + " " + "₹" + " " + (modalData === null || modalData === void 0 ? void 0 : modalData.total_due.toLocaleString("en-IN")) + " " + t("PT_PENDING_AMOUNT") + " " + t("PT_INORDER_TO_TRANSFER")), /*#__PURE__*/React.createElement(SubmitBar, {
8638
- submit: false,
8639
- onSubmit: () => proceedToPay(modalData),
8476
+ }, t("PT_KNOW_PTID")), /*#__PURE__*/React.createElement("div", {
8477
+ className: `search-tab ${action == 1 ? "active" : ""}`,
8640
8478
  style: {
8641
- marginTop: "14px",
8642
- width: "100%"
8479
+ padding: "8px 16px",
8480
+ cursor: "pointer",
8481
+ borderBottom: action == 1 ? "2px solid #f47738" : "2px solid transparent",
8482
+ color: action == 1 ? "#f47738" : "#0b0c0c",
8483
+ fontWeight: action == 1 ? "bold" : "normal"
8643
8484
  },
8644
- label: t("PT_PROCEED_PAYMENT")
8645
- }))) : null, (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) === 0 && /*#__PURE__*/React.createElement("p", {
8485
+ onClick: () => {
8486
+ history.replace(`${history.location.pathname}?action=1`);
8487
+ setSearchData({});
8488
+ }
8489
+ }, t("PT_SEARCH_DOOR_NO")), /*#__PURE__*/React.createElement("div", {
8646
8490
  style: {
8647
- marginLeft: "16px",
8648
- marginTop: "16px"
8491
+ marginLeft: "auto",
8492
+ display: "flex",
8493
+ alignItems: "center"
8649
8494
  }
8650
- }, t("PT_NO_PROP_FOUND_MSG")), (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) !== 0 && ((searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) == 5 || (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) == 50) && (locality || searchQuery && searchQuery.locality) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
8495
+ }, window.location.href.includes("/obps/bpa/") ? /*#__PURE__*/React.createElement(Link, {
8496
+ to: "/digit-ui/citizen/obps/bpa/building_plan_scrutiny/new_construction/location",
8651
8497
  style: {
8652
- marginLeft: "16px",
8653
- marginTop: "16px"
8498
+ padding: "8px 24px",
8499
+ textDecoration: "none",
8500
+ borderRadius: "2px"
8654
8501
  }
8655
- }, t("PT_LOAD_MORE_MSG"), " ", /*#__PURE__*/React.createElement("span", {
8656
- className: "link"
8657
- }, /*#__PURE__*/React.createElement(Link, {
8658
- to: `/digit-ui/citizen/pt/property/search-results?mobileNumber=${mobileNumber || searchQuery.mobileNumber ? mobileNumber || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber) : ""}&propertyIds=${propertyIds || searchQuery !== null && searchQuery !== void 0 && searchQuery.propertyIds ? propertyIds || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds) : ""}&oldPropertyIds=${oldPropertyIds || searchQuery !== null && searchQuery !== void 0 && searchQuery.oldPropertyIds ? oldPropertyIds || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds) : ""}&doorNo=${doorNo || searchQuery !== null && searchQuery !== void 0 && searchQuery.doorNo ? doorNo || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.doorNo) : ""}&name=${name || searchQuery !== null && searchQuery !== void 0 && searchQuery.name ? name || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.name) : ""}&city=${city ? city : ""}&locality=${locality || searchQuery !== null && searchQuery !== void 0 && searchQuery.locality ? locality || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.locality) : ""}&PToffset=${t1}`
8659
- }, t("PT_COMMON_CLICK_HERE"))))));
8502
+ }, t("CORE_COMMON_SKIP_CONTINUE")) : /*#__PURE__*/React.createElement(Link, {
8503
+ to: window.location.href.includes("/ws/") ? "/digit-ui/citizen/ws/create-application/create-property" : window.location.href.includes("/tl/tradelicence/") ? "/digit-ui/citizen/tl/tradelicence/new-application/create-property" : window.location.href.includes("/fsm/") ? "/digit-ui/citizen/fsm/new-application/create-property" : "/digit-ui/citizen/commonpt/property/new-application",
8504
+ style: {
8505
+ padding: "8px 24px",
8506
+ textDecoration: "none",
8507
+ borderRadius: "2px"
8508
+ }
8509
+ }, t("CPT_REG_NEW_PROPERTY")))), /*#__PURE__*/React.createElement(FormComposer, {
8510
+ key: action,
8511
+ onSubmit: onPropertySearch,
8512
+ config: config,
8513
+ label: propsConfig.texts.submitButtonLabel,
8514
+ secondaryActionLabel: t("ES_COMMON_CLEAR_SEARCH"),
8515
+ onSecondayActionClick: () => {
8516
+ setSearchData({});
8517
+ history.replace(`${history.location.pathname}?action=0`);
8518
+ },
8519
+ text: t(propsConfig.texts.text),
8520
+ onFormValueChange: onFormValueChange
8521
+ }), Object.keys(searchData).length > 0 && /*#__PURE__*/React.createElement(PropertySearchResults, {
8522
+ searchQuery: {
8523
+ ...searchData.filters,
8524
+ city: searchData.city
8525
+ },
8526
+ city: searchData.city,
8527
+ stateCode: Digit.ULBService.getStateId(),
8528
+ onSelect: onSelect,
8529
+ config: propsConfig
8530
+ }), showToast && /*#__PURE__*/React.createElement(Toast, {
8531
+ isDleteBtn: true,
8532
+ error: showToast.error,
8533
+ warning: showToast.warning,
8534
+ label: t(showToast.label),
8535
+ onClose: () => {
8536
+ setShowToast(null);
8537
+ }
8538
+ }));
8660
8539
  };
8661
- PropertySearchResults.propTypes = {
8662
- template: propTypes.any,
8663
- header: propTypes.string,
8664
- actionButtonLabel: propTypes.string
8540
+ SearchProperty.propTypes = {
8541
+ loginParams: propTypes.any
8665
8542
  };
8666
- PropertySearchResults.defaultProps = {
8667
- template: [],
8668
- header: null,
8669
- actionButtonLabel: null
8543
+ SearchProperty.defaultProps = {
8544
+ loginParams: null
8545
+ };
8546
+
8547
+ const SearchProperty$1 = ({
8548
+ onSelect
8549
+ }) => {
8550
+ const {
8551
+ t
8552
+ } = useTranslation();
8553
+ const {
8554
+ path
8555
+ } = useRouteMatch();
8556
+ const search = useLocation().search;
8557
+ const redirectToUrl = new URLSearchParams(search).get('redirectToUrl');
8558
+ const params = useMemo(() => config.map(step => {
8559
+ const texts = {};
8560
+ for (const key in step.texts) {
8561
+ texts[key] = t(step.texts[key]);
8562
+ }
8563
+ return {
8564
+ ...step,
8565
+ texts
8566
+ };
8567
+ }, [config]));
8568
+ return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
8569
+ path: `${path}`,
8570
+ exact: true
8571
+ }, /*#__PURE__*/React.createElement(SearchProperty, {
8572
+ config: params[0],
8573
+ onSelect: onSelect,
8574
+ redirectToUrl: redirectToUrl
8575
+ })));
8670
8576
  };
8671
8577
 
8578
+ const config$1 = [{
8579
+ texts: {
8580
+ header: "CS_SEARCH_RESULTS",
8581
+ actionButtonLabel: "PT_COMMONS_SELECT_PLACEHOLDER"
8582
+ },
8583
+ labels: [{
8584
+ label: "PT_DUES_ARE_PENDING",
8585
+ key: "total_due",
8586
+ noteStyle: {
8587
+ fontSize: "24px",
8588
+ fontWeight: "bold"
8589
+ },
8590
+ notePrefix: "₹ "
8591
+ }, {
8592
+ label: "TL_PROPERTY_ID",
8593
+ key: "property_id"
8594
+ }, {
8595
+ label: "PT_OWNERS_NAME",
8596
+ key: "owner_name"
8597
+ }, {
8598
+ label: "PT_COMMON_COL_ADDRESS",
8599
+ key: "property_address"
8600
+ }, {
8601
+ label: "PT_COMMON_TABLE_COL_STATUS_LABEL",
8602
+ key: "status"
8603
+ }]
8604
+ }];
8605
+
8672
8606
  const loginSteps = [{
8673
8607
  texts: {
8674
8608
  header: "CS_LOGIN_PROVIDE_MOBILE_NUMBER",
@@ -17250,6 +17184,7 @@ const App = ({
17250
17184
  const getBreadcrumbLabel = () => {
17251
17185
  const pathname = location.pathname;
17252
17186
  if (pathname.includes("/commonpt/search")) return "SEARCH_PROPERTY";else if (pathname.includes("/view-property")) return "PT_PROPERTY_INFORMATION";
17187
+ if (pathname.includes("/property/new-application")) return "PT_CREATE_PROPERTY";
17253
17188
  return "ES_COMMON_INBOX";
17254
17189
  };
17255
17190
  const breadcrumbs = [{
@@ -17850,7 +17785,7 @@ const PropertySearchNSummary = ({
17850
17785
  formState,
17851
17786
  clearErrors
17852
17787
  }) => {
17853
- var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3;
17788
+ var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3, _propertyDetails$Prop3, _propertyDetails$Prop4, _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop7, _propertyDetails$Prop8;
17854
17789
  const {
17855
17790
  t
17856
17791
  } = useTranslation();
@@ -17945,8 +17880,20 @@ const PropertySearchNSummary = ({
17945
17880
  };
17946
17881
  } else return {};
17947
17882
  };
17883
+ const getOwnerNames = propertyData => {
17884
+ var _propertyData$owners, _getActiveOwners$sort, _getActiveOwners$sort2;
17885
+ 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);
17886
+ const getOwnersList = (_getActiveOwners$sort = getActiveOwners.sort((a, b) => {
17887
+ var _a$additionalDetails, _b$additionalDetails;
17888
+ 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);
17889
+ })) === 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(",");
17890
+ return getOwnersList ? getOwnersList : t("NA");
17891
+ };
17948
17892
  if (window.location.href.includes("/ws/")) ;
17949
- return /*#__PURE__*/React.createElement(React.Fragment, null, (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, {
17893
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
17894
+ title: t("PT_PROPERTY_SEARCH"),
17895
+ defaultOpen: true
17896
+ }, (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, {
17950
17897
  style: getInputStyles()
17951
17898
  }, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
17952
17899
  style: {
@@ -17992,7 +17939,85 @@ const PropertySearchNSummary = ({
17992
17939
  style: {
17993
17940
  color: "white"
17994
17941
  }
17995
- }, t("CPT_CREATE_PROPERTY"))))), showToast && /*#__PURE__*/React.createElement(Toast, {
17942
+ }, t("CPT_CREATE_PROPERTY"))))), searchPropertyId && propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
17943
+ className: "card-with-background",
17944
+ style: {
17945
+ margin: "16px 0px",
17946
+ padding: "20px",
17947
+ boxShadow: "none"
17948
+ }
17949
+ }, /*#__PURE__*/React.createElement(StatusTable, {
17950
+ style: {
17951
+ padding: "0",
17952
+ margin: "0"
17953
+ }
17954
+ }, /*#__PURE__*/React.createElement("div", {
17955
+ className: "formcomposer-section-grid",
17956
+ style: isMobile ? {} : {}
17957
+ }, /*#__PURE__*/React.createElement(Row, {
17958
+ className: "border-none",
17959
+ labelStyle: isMobile ? {
17960
+ width: "40%"
17961
+ } : {
17962
+ width: "30%",
17963
+ color: "#505a5f",
17964
+ fontWeight: "600"
17965
+ },
17966
+ textStyle: {
17967
+ color: "#000"
17968
+ },
17969
+ label: t(`PROPERTY_ID`),
17970
+ text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3.propertyId
17971
+ }), /*#__PURE__*/React.createElement(Row, {
17972
+ className: "border-none",
17973
+ labelStyle: isMobile ? {
17974
+ width: "40%"
17975
+ } : {
17976
+ width: "30%",
17977
+ color: "#505a5f",
17978
+ fontWeight: "600"
17979
+ },
17980
+ textStyle: {
17981
+ color: "#000"
17982
+ },
17983
+ label: t(`OWNER_NAME`),
17984
+ text: getOwnerNames(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0])
17985
+ }), /*#__PURE__*/React.createElement(Row, {
17986
+ className: "border-none",
17987
+ labelStyle: isMobile ? {
17988
+ width: "40%"
17989
+ } : {
17990
+ width: "30%",
17991
+ color: "#505a5f",
17992
+ fontWeight: "600"
17993
+ },
17994
+ textStyle: {
17995
+ wordBreak: "break-word",
17996
+ color: "#000"
17997
+ },
17998
+ label: t(`PROPERTY_ADDRESS`),
17999
+ text: propertyAddress,
18000
+ privacy: {
18001
+ 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,
18002
+ fieldName: ["doorNo", "street", "landmark"],
18003
+ model: "Property",
18004
+ showValue: true,
18005
+ loadData: {
18006
+ serviceName: "/property-services/property/_search",
18007
+ requestBody: {},
18008
+ requestParam: {
18009
+ tenantId: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop7 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop7 === void 0 ? void 0 : _propertyDetails$Prop7.tenantId,
18010
+ propertyIds: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop8 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop8 === void 0 ? void 0 : _propertyDetails$Prop8.propertyId
18011
+ },
18012
+ jsonPath: "Properties[0].address.street",
18013
+ d: res => {
18014
+ 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")}` : "");
18015
+ return resultString;
18016
+ },
18017
+ isArray: false
18018
+ }
18019
+ }
18020
+ }))))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
17996
18021
  isDleteBtn: true,
17997
18022
  labelstyle: {
17998
18023
  width: "100%"
@@ -18003,7 +18028,7 @@ const PropertySearchNSummary = ({
18003
18028
  onClose: () => {
18004
18029
  setShowToast(null);
18005
18030
  }
18006
- })));
18031
+ }))));
18007
18032
  };
18008
18033
 
18009
18034
  const PropertyLocationDetails = ({
@@ -18038,7 +18063,9 @@ const PropertyLocationDetails = ({
18038
18063
  zone: (address === null || address === void 0 ? void 0 : address.zone) || "",
18039
18064
  zroLocation: (address === null || address === void 0 ? void 0 : address.zroLocation) || "",
18040
18065
  subLocality: (address === null || address === void 0 ? void 0 : address.subLocality) || "",
18041
- wardRemarks: (address === null || address === void 0 ? void 0 : address.wardRemarks) || ""
18066
+ actualAssembly: (address === null || address === void 0 ? void 0 : address.actualAssembly) || "",
18067
+ actualWard: (address === null || address === void 0 ? void 0 : address.actualWard) || "",
18068
+ actualZone: (address === null || address === void 0 ? void 0 : address.actualZone) || ""
18042
18069
  });
18043
18070
  const isPropertyFound = window.location.href.includes("ws/old-application");
18044
18071
  useEffect(() => {
@@ -18054,7 +18081,7 @@ const PropertyLocationDetails = ({
18054
18081
  useEffect(() => {
18055
18082
  var _formDataProp$cpt;
18056
18083
  if (formDataProp !== null && formDataProp !== void 0 && (_formDataProp$cpt = formDataProp.cpt) !== null && _formDataProp$cpt !== void 0 && _formDataProp$cpt.details) {
18057
- 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;
18084
+ 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;
18058
18085
  const details = formDataProp.cpt.details;
18059
18086
  const addressData = details.address || {};
18060
18087
  const additionalDetails = details.additionalDetails || {};
@@ -18082,7 +18109,9 @@ const PropertyLocationDetails = ({
18082
18109
  zroLocation: zroCode,
18083
18110
  zro: zroValue,
18084
18111
  subLocality: addressData.subLocality || "",
18085
- wardRemarks: additionalDetails.wardRemarks || ((_addressData$addition5 = addressData.additionalDetails) === null || _addressData$addition5 === void 0 ? void 0 : _addressData$addition5.wardRemarks) || "",
18112
+ actualAssembly: addressData.actualAssembly || additionalDetails.actualAssembly || ((_addressData$addition5 = addressData.additionalDetails) === null || _addressData$addition5 === void 0 ? void 0 : _addressData$addition5.actualAssembly) || "",
18113
+ actualWard: addressData.actualWard || additionalDetails.actualWard || ((_addressData$addition6 = addressData.additionalDetails) === null || _addressData$addition6 === void 0 ? void 0 : _addressData$addition6.actualWard) || "",
18114
+ actualZone: addressData.actualZone || additionalDetails.actualZone || ((_addressData$addition7 = addressData.additionalDetails) === null || _addressData$addition7 === void 0 ? void 0 : _addressData$addition7.actualZone) || "",
18086
18115
  address: {
18087
18116
  ...addressData,
18088
18117
  city: addressData.city || "",
@@ -18095,11 +18124,13 @@ const PropertyLocationDetails = ({
18095
18124
  longitude: lng,
18096
18125
  zroLocation: zroCode,
18097
18126
  zro: zroValue,
18098
- assembly: additionalDetails.assembly || ((_addressData$addition6 = addressData.additionalDetails) === null || _addressData$addition6 === void 0 ? void 0 : _addressData$addition6.assembly) || "",
18099
- block: additionalDetails.block || ((_addressData$addition7 = addressData.additionalDetails) === null || _addressData$addition7 === void 0 ? void 0 : _addressData$addition7.block) || "",
18100
- zone: additionalDetails.zone || ((_addressData$addition8 = addressData.additionalDetails) === null || _addressData$addition8 === void 0 ? void 0 : _addressData$addition8.zone) || "",
18127
+ assembly: additionalDetails.assembly || ((_addressData$addition8 = addressData.additionalDetails) === null || _addressData$addition8 === void 0 ? void 0 : _addressData$addition8.assembly) || "",
18128
+ block: additionalDetails.block || ((_addressData$addition9 = addressData.additionalDetails) === null || _addressData$addition9 === void 0 ? void 0 : _addressData$addition9.block) || "",
18129
+ zone: additionalDetails.zone || ((_addressData$addition0 = addressData.additionalDetails) === null || _addressData$addition0 === void 0 ? void 0 : _addressData$addition0.zone) || "",
18101
18130
  subLocality: addressData.subLocality || "",
18102
- wardRemarks: additionalDetails.wardRemarks || ((_addressData$addition9 = addressData.additionalDetails) === null || _addressData$addition9 === void 0 ? void 0 : _addressData$addition9.wardRemarks) || ""
18131
+ actualWard: addressData.actualWard || additionalDetails.actualWard || ((_addressData$addition1 = addressData.additionalDetails) === null || _addressData$addition1 === void 0 ? void 0 : _addressData$addition1.actualWard) || "",
18132
+ actualZone: addressData.actualZone || additionalDetails.actualZone || ((_addressData$addition10 = addressData.additionalDetails) === null || _addressData$addition10 === void 0 ? void 0 : _addressData$addition10.actualZone) || "",
18133
+ actualAssembly: addressData.actualAssembly || additionalDetails.actualAssembly || ((_addressData$addition11 = addressData.additionalDetails) === null || _addressData$addition11 === void 0 ? void 0 : _addressData$addition11.actualAssembly) || ""
18103
18134
  }
18104
18135
  });
18105
18136
  } else if ((formDataProp === null || formDataProp === void 0 ? void 0 : formDataProp.cpt) === null) {
@@ -18121,7 +18152,9 @@ const PropertyLocationDetails = ({
18121
18152
  zone: "",
18122
18153
  zroLocation: "",
18123
18154
  subLocality: "",
18124
- wardRemarks: "",
18155
+ actualWard: "",
18156
+ actualZone: "",
18157
+ actualAssembly: "",
18125
18158
  zro: "",
18126
18159
  address: {}
18127
18160
  };
@@ -18140,20 +18173,6 @@ const PropertyLocationDetails = ({
18140
18173
  return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
18141
18174
  title: t("PT_LOCATION_DETAILS"),
18142
18175
  defaultOpen: true
18143
- }, /*#__PURE__*/React.createElement("div", {
18144
- style: {
18145
- boxShadow: "none",
18146
- ...props.style
18147
- }
18148
- }, !window.location.href.includes("create-application/create-property") && /*#__PURE__*/React.createElement(PropertySearchNSummary, {
18149
- config: config,
18150
- onSelect: onSelect,
18151
- formData: formDataProp,
18152
- userType: window.location.href.includes("/employee/") ? "employee" : "citizen"
18153
- }), /*#__PURE__*/React.createElement("div", {
18154
- style: {
18155
- marginTop: "20px"
18156
- }
18157
18176
  }, /*#__PURE__*/React.createElement(AddressDetails, {
18158
18177
  t: t,
18159
18178
  formData: formData,
@@ -18170,9 +18189,10 @@ const PropertyLocationDetails = ({
18170
18189
  },
18171
18190
  isEdit: isEdit,
18172
18191
  showZRO: true,
18192
+ showMapActualLocation: true,
18173
18193
  disable: isPropertyFound,
18174
18194
  hideNextButton: true
18175
- }))));
18195
+ }));
18176
18196
  };
18177
18197
 
18178
18198
  const PropertyOwnerDetails = ({
@@ -18973,7 +18993,7 @@ const PropertyWaterConnection = ({
18973
18993
  })
18974
18994
  }))), (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, {
18975
18995
  style: errorStyle
18976
- }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_DWELLING_UNITS")}*`), /*#__PURE__*/React.createElement("div", {
18996
+ }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_DWELLING_UNITS")}`), /*#__PURE__*/React.createElement("div", {
18977
18997
  className: "form-field"
18978
18998
  }, /*#__PURE__*/React.createElement(TextInput, {
18979
18999
  t: t,
@@ -18981,8 +19001,7 @@ const PropertyWaterConnection = ({
18981
19001
  pattern: {
18982
19002
  value: NUMBER_PATTERN,
18983
19003
  message: t("ERR_INVALID_NUMBER")
18984
- },
18985
- required: t("REQUIRED_FIELD")
19004
+ }
18986
19005
  }),
18987
19006
  name: "useDetails.NumberofDwellingUnits",
18988
19007
  disabled: isPropertyFound