@djb25/digit-ui-module-ws 1.0.122 → 1.0.123

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,7 +1,7 @@
1
- import React, { useState, useEffect, useMemo, useReducer, Fragment as Fragment$1, useRef, useCallback } from 'react';
1
+ import React, { useState, useMemo, useEffect, useReducer, Fragment as Fragment$1, useRef, useCallback } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { useHistory, Link, useLocation, useParams, Switch, Route, useRouteMatch, Redirect } from 'react-router-dom';
4
- import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, SearchForm, SearchField, Dropdown, TextInput, Table, Banner, CardText, ActionBar, Header, LabelFieldPair, CardLabel, CardSectionHeader, CardSectionSubText, CheckBox, CardLabelError, DatePicker, UploadFile, Toast, RadioButtons, Modal, FormComposer, CardSubHeader, PDFSvg, MultiUploadWrapper, CardHeader, StatusTable, Row, LinkButton, Close as Close$g, ViewsIcon, BreakLine, TelePhone, DisplayPhotos, TextArea, EditIcon, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector as ButtonSelector$1, MultiLink, DownloadIcon, CardLabelDesc, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, VerticalTimeline, CollapsibleCardPage, PrintBtnCommon, TickMark, FormStep, RadioOrSelect, CitizenInfoLabel, MobileNumber, DeleteIcon, WrapUnMaskComponent, RemoveIcon, InfoIcon, FilterFormField, RemoveableTag as RemoveableTag$1, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, CloseSvg, Localities, DownloadBtnCommon, CollectionIcon, ResponseComposer, GenericFileIcon, Label, OTPInput, CitizenHomeCard } from '@djb25/digit-ui-react-components';
4
+ import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, SearchForm, SearchField, Dropdown, TextInput, Table, Banner, CardText, ActionBar, Header, LabelFieldPair, CardLabel, CardSectionHeader, CardSectionSubText, CheckBox, CardLabelError, DatePicker, UploadFile, Toast, RadioButtons, Modal, FormComposer, CardSubHeader, PDFSvg, MultiUploadWrapper, CardHeader, StatusTable, Row, LinkButton, Close as Close$g, ViewsIcon, BreakLine, TelePhone, DisplayPhotos, TextArea, EditIcon, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector as ButtonSelector$1, MultiLink, DownloadIcon, CardLabelDesc, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, VerticalTimeline, CollapsibleCardPage, PrintBtnCommon, TickMark, FormStep, RadioOrSelect, CitizenInfoLabel, FieldLabelWithTooltip, MobileNumber, DeleteIcon, WrapUnMaskComponent, RemoveIcon, InfoIcon, FilterFormField, RemoveableTag as RemoveableTag$1, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, CloseSvg, Localities, DownloadBtnCommon, CollectionIcon, ResponseComposer, GenericFileIcon, Label, OTPInput, CitizenHomeCard } from '@djb25/digit-ui-react-components';
5
5
  import { useForm, Controller, useWatch, useFormContext } from 'react-hook-form';
6
6
  import { useQueryClient, useQuery } from 'react-query';
7
7
  import { read, utils as utils$1 } from 'xlsx';
@@ -509,23 +509,6 @@ const convertDateToEpoch = function (dateString, dayStartOrEnd) {
509
509
  return dateString;
510
510
  }
511
511
  };
512
- const convertDateToEpochNew = function (dateString, dayStartOrEnd) {
513
- if (dayStartOrEnd === void 0) {
514
- dayStartOrEnd = "dayend";
515
- }
516
- try {
517
- const parts = dateString.match(/(\d{4})-(\d{1,2})-(\d{1,2})/);
518
- const DateObj = new Date(Date.UTC(parts[1], parts[3] - 1, parts[2]));
519
- DateObj.setMinutes(DateObj.getMinutes() + DateObj.getTimezoneOffset());
520
- if (dayStartOrEnd === "dayend") {
521
- DateObj.setHours(DateObj.getHours() + 24);
522
- DateObj.setSeconds(DateObj.getSeconds() - 1);
523
- }
524
- return DateObj.getTime();
525
- } catch (e) {
526
- return dateString;
527
- }
528
- };
529
512
  const convertEpochToDates = dateEpoch => {
530
513
  if (dateEpoch) {
531
514
  const dateFromApi = new Date(dateEpoch);
@@ -8879,6 +8862,16 @@ const WSInfoLabel = _ref2 => {
8879
8862
  }), ` ${t("WS_CLICK_ON_INFO_LABEL")}`)));
8880
8863
  };
8881
8864
 
8865
+ const chunkArray = function (arr, size) {
8866
+ if (size === void 0) {
8867
+ size = 100;
8868
+ }
8869
+ const chunks = [];
8870
+ for (let i = 0; i < arr.length; i += size) {
8871
+ chunks.push(arr.slice(i, i + size));
8872
+ }
8873
+ return chunks;
8874
+ };
8882
8875
  const WSMyApplications = () => {
8883
8876
  var _user$info, _user$info$userName, _user$info2, _user$info3, _data$WaterConnection, _SWdata$SewerageConne, _data$WaterConnection2, _SWdata$SewerageConne2, _WSapplicationsList, _SWapplicationsList, _WSapplicationsList2, _SWapplicationsList2, _applicationsList, _filteredApplications;
8884
8877
  const {
@@ -8946,8 +8939,11 @@ const WSMyApplications = () => {
8946
8939
  },
8947
8940
  enabled: userMobileNumber ? true : false
8948
8941
  });
8942
+ const userConnectionsEnabled = !!(userMobileNumber && tenantId);
8949
8943
  const {
8950
- data: userConnections
8944
+ isLoading: isConnectionsLoading,
8945
+ data: userConnections,
8946
+ error: connectionsError
8951
8947
  } = Digit.Hooks.ws.useMyApplicationSearch({
8952
8948
  filters: {
8953
8949
  tenantId,
@@ -8960,54 +8956,108 @@ const WSMyApplications = () => {
8960
8956
  mobileNumber: userMobileNumber,
8961
8957
  searchType: "CONNECTION"
8962
8958
  },
8963
- enabled: !!userMobileNumber
8959
+ enabled: userConnectionsEnabled
8964
8960
  });
8961
+ const {
8962
+ isLoading: isSWConnectionsLoading,
8963
+ data: userSWConnections,
8964
+ error: swConnectionsError
8965
+ } = Digit.Hooks.ws.useMyApplicationSearch({
8966
+ filters: {
8967
+ tenantId,
8968
+ mobileNumber: userMobileNumber,
8969
+ searchType: "CONNECTION"
8970
+ },
8971
+ BusinessService: "SW"
8972
+ }, {
8973
+ filters: {
8974
+ tenantId,
8975
+ mobileNumber: userMobileNumber,
8976
+ searchType: "CONNECTION"
8977
+ },
8978
+ enabled: userConnectionsEnabled
8979
+ });
8980
+ const isConnectionsFetching = userConnectionsEnabled && (isConnectionsLoading && !connectionsError || isSWConnectionsLoading && !swConnectionsError);
8965
8981
  const [pageOffset, setPageOffset] = useState(0);
8966
8982
  const [pageSize, setPageSize] = useState(10);
8967
8983
  const [searchParams, setSearchParams] = useState(null);
8968
8984
  const [billAmendments, setBillAmendments] = useState([]);
8969
8985
  const [isBillAmendLoading, setIsBillAmendLoading] = useState(false);
8986
+ const wsConnectionKeys = useMemo(() => {
8987
+ const codes = new Set();
8988
+ ((userConnections === null || userConnections === void 0 ? void 0 : userConnections.WaterConnection) || []).forEach(c => {
8989
+ if (c !== null && c !== void 0 && c.connectionNo && typeof c.connectionNo === "string" && c.connectionNo.trim().length > 0) {
8990
+ codes.add(c.connectionNo.trim());
8991
+ }
8992
+ });
8993
+ return Array.from(codes).sort().join(",");
8994
+ }, [userConnections === null || userConnections === void 0 ? void 0 : userConnections.WaterConnection]);
8995
+ const swConnectionKeys = useMemo(() => {
8996
+ const codes = new Set();
8997
+ ((userSWConnections === null || userSWConnections === void 0 ? void 0 : userSWConnections.SewerageConnections) || []).forEach(c => {
8998
+ if (c !== null && c !== void 0 && c.connectionNo && typeof c.connectionNo === "string" && c.connectionNo.trim().length > 0) {
8999
+ codes.add(c.connectionNo.trim());
9000
+ }
9001
+ });
9002
+ return Array.from(codes).sort().join(",");
9003
+ }, [userSWConnections === null || userSWConnections === void 0 ? void 0 : userSWConnections.SewerageConnections]);
8970
9004
  useEffect(() => {
8971
9005
  let isMounted = true;
8972
9006
  const fetchBillAmendments = function () {
8973
9007
  try {
9008
+ var _searchParams$applica;
8974
9009
  if (!userMobileNumber) return Promise.resolve();
9010
+ if (isConnectionsFetching) return Promise.resolve();
9011
+ const wsCodes = wsConnectionKeys ? wsConnectionKeys.split(",").filter(Boolean) : [];
9012
+ const swCodes = swConnectionKeys ? swConnectionKeys.split(",").filter(Boolean) : [];
9013
+ const searchAppNo = searchParams === null || searchParams === void 0 ? void 0 : (_searchParams$applica = searchParams.applicationNo) === null || _searchParams$applica === void 0 ? void 0 : _searchParams$applica.trim();
9014
+ if (wsCodes.length === 0 && swCodes.length === 0 && !searchAppNo) {
9015
+ setBillAmendments([]);
9016
+ setIsBillAmendLoading(false);
9017
+ return Promise.resolve();
9018
+ }
8975
9019
  setIsBillAmendLoading(true);
8976
9020
  const _temp = _finallyRethrows(function () {
8977
9021
  return _catch(function () {
8978
- const consumerCodes = new Set();
8979
- ((data === null || data === void 0 ? void 0 : data.WaterConnection) || []).forEach(c => (c === null || c === void 0 ? void 0 : c.connectionNo) && consumerCodes.add(c.connectionNo));
8980
- ((SWdata === null || SWdata === void 0 ? void 0 : SWdata.SewerageConnections) || []).forEach(c => (c === null || c === void 0 ? void 0 : c.connectionNo) && consumerCodes.add(c.connectionNo));
8981
- ((userConnections === null || userConnections === void 0 ? void 0 : userConnections.WaterConnection) || []).forEach(c => (c === null || c === void 0 ? void 0 : c.connectionNo) && consumerCodes.add(c.connectionNo));
8982
- ((userConnections === null || userConnections === void 0 ? void 0 : userConnections.SewerageConnections) || []).forEach(c => (c === null || c === void 0 ? void 0 : c.connectionNo) && consumerCodes.add(c.connectionNo));
8983
9022
  const amendmentPromises = [];
8984
- consumerCodes.forEach(code => {
8985
- amendmentPromises.push(Digit.PaymentService.searchAmendment(tenantId, {
8986
- consumerCode: code,
8987
- businessService: "WS"
8988
- }).catch(() => ({
8989
- Amendments: []
8990
- })));
8991
- amendmentPromises.push(Digit.PaymentService.searchAmendment(tenantId, {
8992
- consumerCode: code,
8993
- businessService: "SW"
8994
- }).catch(() => ({
8995
- Amendments: []
8996
- })));
8997
- });
8998
- if (searchParams !== null && searchParams !== void 0 && searchParams.applicationNo) {
8999
- amendmentPromises.push(Digit.PaymentService.searchAmendment(tenantId, {
9000
- amendmentId: searchParams.applicationNo,
9001
- businessService: "WS"
9002
- }).catch(() => ({
9003
- Amendments: []
9004
- })));
9005
- amendmentPromises.push(Digit.PaymentService.searchAmendment(tenantId, {
9006
- amendmentId: searchParams.applicationNo,
9007
- businessService: "SW"
9008
- }).catch(() => ({
9009
- Amendments: []
9010
- })));
9023
+ if (wsCodes.length > 0) {
9024
+ const wsChunks = chunkArray(wsCodes, 100);
9025
+ wsChunks.forEach(chunk => {
9026
+ amendmentPromises.push(Digit.PaymentService.searchAmendment(tenantId, {
9027
+ consumerCode: chunk.join(","),
9028
+ businessService: "WS"
9029
+ }).catch(() => ({
9030
+ Amendments: []
9031
+ })));
9032
+ });
9033
+ }
9034
+ if (swCodes.length > 0) {
9035
+ const swChunks = chunkArray(swCodes, 100);
9036
+ swChunks.forEach(chunk => {
9037
+ amendmentPromises.push(Digit.PaymentService.searchAmendment(tenantId, {
9038
+ consumerCode: chunk.join(","),
9039
+ businessService: "SW"
9040
+ }).catch(() => ({
9041
+ Amendments: []
9042
+ })));
9043
+ });
9044
+ }
9045
+ if (searchAppNo) {
9046
+ if (searchAppNo.includes("SW")) {
9047
+ amendmentPromises.push(Digit.PaymentService.searchAmendment(tenantId, {
9048
+ amendmentId: searchAppNo,
9049
+ businessService: "SW"
9050
+ }).catch(() => ({
9051
+ Amendments: []
9052
+ })));
9053
+ } else {
9054
+ amendmentPromises.push(Digit.PaymentService.searchAmendment(tenantId, {
9055
+ amendmentId: searchAppNo,
9056
+ businessService: "WS"
9057
+ }).catch(() => ({
9058
+ Amendments: []
9059
+ })));
9060
+ }
9011
9061
  }
9012
9062
  return Promise.resolve(Promise.all(amendmentPromises)).then(function (responses) {
9013
9063
  const allAmendmentsMap = new Map();
@@ -9041,7 +9091,7 @@ const WSMyApplications = () => {
9041
9091
  return () => {
9042
9092
  isMounted = false;
9043
9093
  };
9044
- }, [tenantId, userMobileNumber, data, SWdata, userConnections, searchParams === null || searchParams === void 0 ? void 0 : searchParams.applicationNo]);
9094
+ }, [tenantId, userMobileNumber, wsConnectionKeys, swConnectionKeys, searchParams === null || searchParams === void 0 ? void 0 : searchParams.applicationNo, isConnectionsFetching]);
9045
9095
  const isMobile = window.Digit.Utils.browser.isMobile();
9046
9096
  const GetCell = value => /*#__PURE__*/React.createElement("span", {
9047
9097
  className: "cell-text"
@@ -9209,7 +9259,7 @@ const WSMyApplications = () => {
9209
9259
  setSearchParams(data);
9210
9260
  setPageOffset(0);
9211
9261
  };
9212
- if (isLoading || isSWLoading || PTisLoading || isBillAmendLoading) {
9262
+ if (isLoading || isSWLoading || PTisLoading || isBillAmendLoading || isConnectionsFetching) {
9213
9263
  return /*#__PURE__*/React.createElement(Loader, null);
9214
9264
  }
9215
9265
  let {
@@ -14137,7 +14187,7 @@ const CloseBtn$5 = props => {
14137
14187
  onClick: props.onClick
14138
14188
  }, /*#__PURE__*/React.createElement(Close$5, null));
14139
14189
  };
14140
- const convertDateToEpochNew$1 = function (dateString, dayStartOrEnd) {
14190
+ const convertDateToEpochNew = function (dateString, dayStartOrEnd) {
14141
14191
  if (dayStartOrEnd === void 0) {
14142
14192
  dayStartOrEnd = "dayend";
14143
14193
  }
@@ -14392,10 +14442,10 @@ const ActionModal$5 = _ref => {
14392
14442
  }
14393
14443
  if (data !== null && data !== void 0 && data.date && (_applicationData11 = applicationData) !== null && _applicationData11 !== void 0 && (_applicationData11$ap = _applicationData11.applicationType) !== null && _applicationData11$ap !== void 0 && _applicationData11$ap.includes("DISCONNECT")) {
14394
14444
  const disconnectionExecutionDate = cloneDeep_1(data === null || data === void 0 ? void 0 : data.date);
14395
- applicationData.disconnectionExecutionDate = convertDateToEpochNew$1(disconnectionExecutionDate);
14445
+ applicationData.disconnectionExecutionDate = convertDateToEpochNew(disconnectionExecutionDate);
14396
14446
  } else if (data !== null && data !== void 0 && data.date) {
14397
14447
  const connectionExecutionDate = cloneDeep_1(data === null || data === void 0 ? void 0 : data.date);
14398
- applicationData.connectionExecutionDate = convertDateToEpochNew$1(connectionExecutionDate);
14448
+ applicationData.connectionExecutionDate = convertDateToEpochNew(connectionExecutionDate);
14399
14449
  }
14400
14450
  if (((_applicationData12 = applicationData) === null || _applicationData12 === void 0 ? void 0 : (_applicationData12$pr = _applicationData12.processInstance) === null || _applicationData12$pr === void 0 ? void 0 : _applicationData12$pr.businessService) == "DisconnectWSConnection" || ((_applicationData13 = applicationData) === null || _applicationData13 === void 0 ? void 0 : (_applicationData13$pr = _applicationData13.processInstance) === null || _applicationData13$pr === void 0 ? void 0 : _applicationData13$pr.businessService) == "DisconnectSWConnection" || window.location.href.includes("disconnection")) {
14401
14451
  var _applicationData14, _applicationData14$se, _applicationData15, _applicationData15$ap;
@@ -17666,7 +17716,7 @@ const Rebate_menu = [{
17666
17716
  value: "Others"
17667
17717
  }];
17668
17718
  const WSFeeEstimation = _ref => {
17669
- var _wsAdditionalDetails$, _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _wsAdditionalDetails$5, _wsAdditionalDetails$6, _wsAdditionalDetails$7, _workflowDetails$data0, _wsAdditionalDetails$8, _wsAdditionalDetails$9, _wsAdditionalDetails$0, _wsAdditionalDetails$1, _wsAdditionalDetails$10, _wsAdditionalDetails$11, _wsAdditionalDetails$12, _wsAdditionalDetails$13, _wsAdditionalDetails$14, _wsAdditionalDetails$15, _wsAdditionalDetails$16, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$Proc, _workflowDetails$Proc2, _wsAdditionalDetails$17, _wsAdditionalDetails$18, _billDetails$billDeta, _billDetails$billDeta2, _fields$adhocPenaltyR, _fields$adhocRebateRe;
17719
+ var _wsAdditionalDetails$, _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _wsAdditionalDetails$5, _wsAdditionalDetails$6, _wsAdditionalDetails$7, _workflowDetails$data0, _wsAdditionalDetails$8, _wsAdditionalDetails$9, _wsAdditionalDetails$0, _wsAdditionalDetails$1, _wsAdditionalDetails$10, _wsAdditionalDetails$11, _wsAdditionalDetails$12, _wsAdditionalDetails$13, _wsAdditionalDetails$14, _wsAdditionalDetails$15, _wsAdditionalDetails$16, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$Proc, _workflowDetails$Proc2, _wsAdditionalDetails$17, _wsAdditionalDetails$18, _billDetails$billDeta, _billDetails$billDeta2, _wsAdditionalDetails$19, _wsAdditionalDetails$20, _wsAdditionalDetails$21, _wsAdditionalDetails$22, _wsAdditionalDetails$23, _wsAdditionalDetails$24, _wsAdditionalDetails$25, _wsAdditionalDetails$26, _wsAdditionalDetails$27, _wsAdditionalDetails$28, _wsAdditionalDetails$29, _wsAdditionalDetails$35, _wsAdditionalDetails$36, _fields$adhocPenaltyR, _fields$adhocRebateRe;
17670
17720
  let {
17671
17721
  wsAdditionalDetails,
17672
17722
  workflowDetails,
@@ -17708,40 +17758,64 @@ const WSFeeEstimation = _ref => {
17708
17758
  const reopeningFee = billRows.find(row => (row === null || row === void 0 ? void 0 : row.taxHeadCode) === "WS_REOPENING_FEE" || (row === null || row === void 0 ? void 0 : row.taxHeadCode) === "SW_REOPENING_FEE");
17709
17759
  const displayedValues = isDisconnectionFeeOnly ? values.filter(value => (value === null || value === void 0 ? void 0 : value.title) === "WS_DISCONNECTION_FEE" || (value === null || value === void 0 ? void 0 : value.title) === "SW_DISCONNECTION_FEE") : isReconnectionFeeOnly ? values.filter(value => (value === null || value === void 0 ? void 0 : value.title) === "WS_REOPENING_FEE" || (value === null || value === void 0 ? void 0 : value.title) === "SW_REOPENING_FEE") : values;
17710
17760
  const displayedTotalAmount = isDisconnectionFeeOnly ? (disconnectionFee === null || disconnectionFee === void 0 ? void 0 : disconnectionFee.amount) ?? (disconnectionFee === null || disconnectionFee === void 0 ? void 0 : disconnectionFee.estimateAmount) ?? 0 : isReconnectionFeeOnly ? (reopeningFee === null || reopeningFee === void 0 ? void 0 : reopeningFee.amount) ?? (reopeningFee === null || reopeningFee === void 0 ? void 0 : reopeningFee.estimateAmount) ?? 0 : billDetails === null || billDetails === void 0 ? void 0 : billDetails.totalAmount;
17711
- const displayedIsPaid = isDisconnectionExecuted ? (disconnectionFee === null || disconnectionFee === void 0 ? void 0 : disconnectionFee.status) === "PAID" || isPaid : isPaid;
17761
+ const hasAdditionalInfraCharge = Boolean((wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$19 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$19 === void 0 ? void 0 : _wsAdditionalDetails$19.hasAdditionalInfraCharge) || billRows.some(b => (b === null || b === void 0 ? void 0 : b.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE") || values.some(v => (v === null || v === void 0 ? void 0 : v.title) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" || (v === null || v === void 0 ? void 0 : v.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE"));
17762
+ const isPropUpdated = Boolean(hasAdditionalInfraCharge || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$20 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$20 === void 0 ? void 0 : _wsAdditionalDetails$20.isPropUpdated) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$21 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$21 === void 0 ? void 0 : _wsAdditionalDetails$21.isPropertyUpdated) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$22 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$22 === void 0 ? void 0 : (_wsAdditionalDetails$23 = _wsAdditionalDetails$22.appDetails) === null || _wsAdditionalDetails$23 === void 0 ? void 0 : (_wsAdditionalDetails$24 = _wsAdditionalDetails$23.additionalDetails) === null || _wsAdditionalDetails$24 === void 0 ? void 0 : _wsAdditionalDetails$24.isPropertyUpdated) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$25 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$25 === void 0 ? void 0 : (_wsAdditionalDetails$26 = _wsAdditionalDetails$25.appDetails) === null || _wsAdditionalDetails$26 === void 0 ? void 0 : (_wsAdditionalDetails$27 = _wsAdditionalDetails$26.additionalDetails) === null || _wsAdditionalDetails$27 === void 0 ? void 0 : _wsAdditionalDetails$27.isPropUpdated));
17763
+ const hasUnpaidCharge = isPropUpdated && Boolean((wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$28 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$28 === void 0 ? void 0 : _wsAdditionalDetails$28.hasUnpaidCharge) !== undefined ? wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$29 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$29 === void 0 ? void 0 : _wsAdditionalDetails$29.hasUnpaidCharge : billRows.some(b => {
17764
+ const st = String((b === null || b === void 0 ? void 0 : b.status) || "").toUpperCase();
17765
+ return st === "UNPAID" || (b === null || b === void 0 ? void 0 : b.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" && st !== "PAID";
17766
+ }) || values.some(v => {
17767
+ const st = String((v === null || v === void 0 ? void 0 : v.status) || "").toUpperCase();
17768
+ return st === "UNPAID" || ((v === null || v === void 0 ? void 0 : v.title) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" || (v === null || v === void 0 ? void 0 : v.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE") && st !== "PAID";
17769
+ }));
17770
+ const displayedIsPaid = isPropUpdated ? !hasUnpaidCharge : isDisconnectionExecuted ? (disconnectionFee === null || disconnectionFee === void 0 ? void 0 : disconnectionFee.status) === "PAID" || isPaid : isPaid;
17712
17771
  const stateCode = Digit.ULBService.getStateId();
17713
17772
  const {
17714
17773
  isMdmsLoading,
17715
17774
  data: mdmsRes
17716
17775
  } = Digit.Hooks.ws.useMDMS(stateCode, "BillingService", ["TaxHeadMaster"]);
17717
17776
  useEffect(() => {
17718
- var _wsAdditionalDetails$19, _wsAdditionalDetails$20, _sessionFormData$bill;
17777
+ var _wsAdditionalDetails$30, _wsAdditionalDetails$31, _sessionFormData$bill;
17719
17778
  const data = {
17720
- ...(wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$19 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$19 === void 0 ? void 0 : (_wsAdditionalDetails$20 = _wsAdditionalDetails$19.appDetails) === null || _wsAdditionalDetails$20 === void 0 ? void 0 : _wsAdditionalDetails$20.additionalDetails)
17779
+ ...(wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$30 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$30 === void 0 ? void 0 : (_wsAdditionalDetails$31 = _wsAdditionalDetails$30.appDetails) === null || _wsAdditionalDetails$31 === void 0 ? void 0 : _wsAdditionalDetails$31.additionalDetails)
17721
17780
  };
17722
17781
  if ((sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill = sessionFormData.billDetails) === null || _sessionFormData$bill === void 0 ? void 0 : _sessionFormData$bill.length) > 0) {
17723
- var _sessionFormData$bill2, _sessionFormData$bill3, _sessionFormData$bill4, _sessionFormData$bill5, _sessionFormData$bill6, _sessionFormData$bill7, _sessionFormData$bill8, _sessionFormData$bill9, _sessionFormData$bill0, _sessionFormData$bill1, _sessionFormData$bill10;
17782
+ var _sessionFormData$bill2, _sessionFormData$bill3, _sessionFormData$bill4, _sessionFormData$bill5, _sessionFormData$bill6, _sessionFormData$bill7, _sessionFormData$bill8, _sessionFormData$bill9, _sessionFormData$bill0, _sessionFormData$bill1, _sessionFormData$bill10, _sessionFormData$bill11, _sessionFormData$bill12, _sessionFormData$bill13, _sessionFormData$bill14, _sessionFormData$bill15, _sessionFormData$bill16;
17724
17783
  const billAccountDetails = (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill2 = sessionFormData.billDetails) === null || _sessionFormData$bill2 === void 0 ? void 0 : (_sessionFormData$bill3 = _sessionFormData$bill2[0]) === null || _sessionFormData$bill3 === void 0 ? void 0 : _sessionFormData$bill3.billAccountDetails) || (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill4 = sessionFormData.billDetails) === null || _sessionFormData$bill4 === void 0 ? void 0 : (_sessionFormData$bill5 = _sessionFormData$bill4[0]) === null || _sessionFormData$bill5 === void 0 ? void 0 : _sessionFormData$bill5.taxHeadEstimates) || [];
17725
17784
  const values = billAccountDetails.length > 0 ? billAccountDetails.map(bill => ({
17726
17785
  title: bill === null || bill === void 0 ? void 0 : bill.taxHeadCode,
17727
- value: /*#__PURE__*/React.createElement("span", null, "\u20B9", Number(bill === null || bill === void 0 ? void 0 : bill.amount).toFixed(2))
17786
+ value: /*#__PURE__*/React.createElement("span", null, "\u20B9", Number((bill === null || bill === void 0 ? void 0 : bill.amount) ?? (bill === null || bill === void 0 ? void 0 : bill.estimateAmount) ?? 0).toFixed(2)),
17787
+ status: bill === null || bill === void 0 ? void 0 : bill.status,
17788
+ taxHeadCode: bill === null || bill === void 0 ? void 0 : bill.taxHeadCode,
17789
+ amount: (bill === null || bill === void 0 ? void 0 : bill.amount) ?? (bill === null || bill === void 0 ? void 0 : bill.estimateAmount) ?? 0
17728
17790
  })) : [{
17729
17791
  title: "WS_APPLICATION_FEE_HEADER",
17730
- value: /*#__PURE__*/React.createElement("span", null, "\u20B9", sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill6 = sessionFormData.billDetails) === null || _sessionFormData$bill6 === void 0 ? void 0 : (_sessionFormData$bill7 = _sessionFormData$bill6[0]) === null || _sessionFormData$bill7 === void 0 ? void 0 : _sessionFormData$bill7.fee)
17792
+ value: /*#__PURE__*/React.createElement("span", null, "\u20B9", (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill6 = sessionFormData.billDetails) === null || _sessionFormData$bill6 === void 0 ? void 0 : (_sessionFormData$bill7 = _sessionFormData$bill6[0]) === null || _sessionFormData$bill7 === void 0 ? void 0 : _sessionFormData$bill7.fee) || 0),
17793
+ amount: (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill8 = sessionFormData.billDetails) === null || _sessionFormData$bill8 === void 0 ? void 0 : (_sessionFormData$bill9 = _sessionFormData$bill8[0]) === null || _sessionFormData$bill9 === void 0 ? void 0 : _sessionFormData$bill9.fee) || 0
17731
17794
  }, {
17732
17795
  title: "WS_SERVICE_FEE_HEADER",
17733
- value: /*#__PURE__*/React.createElement("span", null, "\u20B9", sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill8 = sessionFormData.billDetails) === null || _sessionFormData$bill8 === void 0 ? void 0 : (_sessionFormData$bill9 = _sessionFormData$bill8[0]) === null || _sessionFormData$bill9 === void 0 ? void 0 : _sessionFormData$bill9.charge)
17796
+ value: /*#__PURE__*/React.createElement("span", null, "\u20B9", (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill0 = sessionFormData.billDetails) === null || _sessionFormData$bill0 === void 0 ? void 0 : (_sessionFormData$bill1 = _sessionFormData$bill0[0]) === null || _sessionFormData$bill1 === void 0 ? void 0 : _sessionFormData$bill1.charge) || 0),
17797
+ amount: (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill10 = sessionFormData.billDetails) === null || _sessionFormData$bill10 === void 0 ? void 0 : (_sessionFormData$bill11 = _sessionFormData$bill10[0]) === null || _sessionFormData$bill11 === void 0 ? void 0 : _sessionFormData$bill11.charge) || 0
17734
17798
  }, {
17735
17799
  title: "WS_TAX_HEADER",
17736
- value: /*#__PURE__*/React.createElement("span", null, "\u20B9", sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill0 = sessionFormData.billDetails) === null || _sessionFormData$bill0 === void 0 ? void 0 : (_sessionFormData$bill1 = _sessionFormData$bill0[0]) === null || _sessionFormData$bill1 === void 0 ? void 0 : _sessionFormData$bill1.taxAmount)
17800
+ value: /*#__PURE__*/React.createElement("span", null, "\u20B9", (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill12 = sessionFormData.billDetails) === null || _sessionFormData$bill12 === void 0 ? void 0 : (_sessionFormData$bill13 = _sessionFormData$bill12[0]) === null || _sessionFormData$bill13 === void 0 ? void 0 : _sessionFormData$bill13.taxAmount) || 0),
17801
+ amount: (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill14 = sessionFormData.billDetails) === null || _sessionFormData$bill14 === void 0 ? void 0 : (_sessionFormData$bill15 = _sessionFormData$bill14[0]) === null || _sessionFormData$bill15 === void 0 ? void 0 : _sessionFormData$bill15.taxAmount) || 0
17737
17802
  }];
17738
17803
  setValues(values);
17739
- setBillDetails(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill10 = sessionFormData.billDetails) === null || _sessionFormData$bill10 === void 0 ? void 0 : _sessionFormData$bill10[0]);
17804
+ setBillDetails(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill16 = sessionFormData.billDetails) === null || _sessionFormData$bill16 === void 0 ? void 0 : _sessionFormData$bill16[0]);
17740
17805
  } else {
17741
17806
  setSessionFormData(data);
17742
17807
  setFields(data);
17743
17808
  }
17744
17809
  }, []);
17810
+ useEffect(() => {
17811
+ var _wsAdditionalDetails$32, _wsAdditionalDetails$33, _sessionFormData$bill17, _wsAdditionalDetails$34, _sessionFormData$bill18;
17812
+ if ((wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$32 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$32 === void 0 ? void 0 : (_wsAdditionalDetails$33 = _wsAdditionalDetails$32.values) === null || _wsAdditionalDetails$33 === void 0 ? void 0 : _wsAdditionalDetails$33.length) > 0 && (!(sessionFormData !== null && sessionFormData !== void 0 && sessionFormData.billDetails) || (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill17 = sessionFormData.billDetails) === null || _sessionFormData$bill17 === void 0 ? void 0 : _sessionFormData$bill17.length) === 0)) {
17813
+ setValues(wsAdditionalDetails.additionalDetails.values);
17814
+ }
17815
+ if (wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$34 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$34 !== void 0 && _wsAdditionalDetails$34.data && (!(sessionFormData !== null && sessionFormData !== void 0 && sessionFormData.billDetails) || (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$bill18 = sessionFormData.billDetails) === null || _sessionFormData$bill18 === void 0 ? void 0 : _sessionFormData$bill18.length) === 0)) {
17816
+ setBillDetails(wsAdditionalDetails.additionalDetails.data);
17817
+ }
17818
+ }, [wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$35 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$35 === void 0 ? void 0 : _wsAdditionalDetails$35.values, wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$36 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$36 === void 0 ? void 0 : _wsAdditionalDetails$36.data]);
17745
17819
  let validation = {};
17746
17820
  const Heading = props => {
17747
17821
  return /*#__PURE__*/React.createElement("h1", {
@@ -17771,8 +17845,8 @@ const WSFeeEstimation = _ref => {
17771
17845
  const adhocAmount = fields !== null && fields !== void 0 && fields.adhocPenalty ? Number(fields === null || fields === void 0 ? void 0 : fields.adhocPenalty) : 0;
17772
17846
  const rebateAmount = fields !== null && fields !== void 0 && fields.adhocRebate ? Number(fields === null || fields === void 0 ? void 0 : fields.adhocRebate) : 0;
17773
17847
  if (adhocAmount || rebateAmount) {
17774
- var _wsAdditionalDetails$21, _wsAdditionalDetails$22;
17775
- const totalAmount = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$21 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$21 === void 0 ? void 0 : (_wsAdditionalDetails$22 = _wsAdditionalDetails$21.data) === null || _wsAdditionalDetails$22 === void 0 ? void 0 : _wsAdditionalDetails$22.totalAmount;
17848
+ var _wsAdditionalDetails$37, _wsAdditionalDetails$38;
17849
+ const totalAmount = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$37 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$37 === void 0 ? void 0 : (_wsAdditionalDetails$38 = _wsAdditionalDetails$37.data) === null || _wsAdditionalDetails$38 === void 0 ? void 0 : _wsAdditionalDetails$38.totalAmount;
17776
17850
  if (rebateAmount > totalAmount) {
17777
17851
  setShowToast({
17778
17852
  isError: false,
@@ -17781,16 +17855,16 @@ const WSFeeEstimation = _ref => {
17781
17855
  message: t("ERR_WS_REBATE_GREATER_THAN_AMOUNT")
17782
17856
  });
17783
17857
  } else {
17784
- var _wsAdditionalDetails$27, _wsAdditionalDetails$28, _wsAdditionalDetails$29, _wsAdditionalDetails$30, _wsAdditionalDetails$31, _wsAdditionalDetails$32, _wsAdditionalDetails$33, _wsAdditionalDetails$34, _wsAdditionalDetails$35, _wsAdditionalDetails$36;
17785
- const applicationNo = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$27 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$27 === void 0 ? void 0 : (_wsAdditionalDetails$28 = _wsAdditionalDetails$27.appDetails) === null || _wsAdditionalDetails$28 === void 0 ? void 0 : _wsAdditionalDetails$28.applicationNo;
17786
- const tenantId = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$29 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$29 === void 0 ? void 0 : (_wsAdditionalDetails$30 = _wsAdditionalDetails$29.appDetails) === null || _wsAdditionalDetails$30 === void 0 ? void 0 : _wsAdditionalDetails$30.tenantId;
17858
+ var _wsAdditionalDetails$43, _wsAdditionalDetails$44, _wsAdditionalDetails$45, _wsAdditionalDetails$46, _wsAdditionalDetails$47, _wsAdditionalDetails$48, _wsAdditionalDetails$49, _wsAdditionalDetails$50, _wsAdditionalDetails$51, _wsAdditionalDetails$52;
17859
+ const applicationNo = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$43 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$43 === void 0 ? void 0 : (_wsAdditionalDetails$44 = _wsAdditionalDetails$43.appDetails) === null || _wsAdditionalDetails$44 === void 0 ? void 0 : _wsAdditionalDetails$44.applicationNo;
17860
+ const tenantId = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$45 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$45 === void 0 ? void 0 : (_wsAdditionalDetails$46 = _wsAdditionalDetails$45.appDetails) === null || _wsAdditionalDetails$46 === void 0 ? void 0 : _wsAdditionalDetails$46.tenantId;
17787
17861
  const appAdditionalDetails = {
17788
- ...(wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$31 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$31 === void 0 ? void 0 : (_wsAdditionalDetails$32 = _wsAdditionalDetails$31.appDetails) === null || _wsAdditionalDetails$32 === void 0 ? void 0 : _wsAdditionalDetails$32.additionalDetails),
17862
+ ...(wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$47 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$47 === void 0 ? void 0 : (_wsAdditionalDetails$48 = _wsAdditionalDetails$47.appDetails) === null || _wsAdditionalDetails$48 === void 0 ? void 0 : _wsAdditionalDetails$48.additionalDetails),
17789
17863
  ...fields
17790
17864
  };
17791
17865
  wsAdditionalDetails.additionalDetails.appDetails.additionalDetails = appAdditionalDetails;
17792
17866
  const data = {
17793
- CalculationCriteria: (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$33 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$33 === void 0 ? void 0 : (_wsAdditionalDetails$34 = _wsAdditionalDetails$33.appDetails) === null || _wsAdditionalDetails$34 === void 0 ? void 0 : _wsAdditionalDetails$34.service) == "WATER" ? [{
17867
+ CalculationCriteria: (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$49 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$49 === void 0 ? void 0 : (_wsAdditionalDetails$50 = _wsAdditionalDetails$49.appDetails) === null || _wsAdditionalDetails$50 === void 0 ? void 0 : _wsAdditionalDetails$50.service) == "WATER" ? [{
17794
17868
  applicationNo: applicationNo,
17795
17869
  tenantId: tenantId,
17796
17870
  waterConnection: wsAdditionalDetails.additionalDetails.appDetails
@@ -17801,9 +17875,9 @@ const WSFeeEstimation = _ref => {
17801
17875
  }],
17802
17876
  isconnectionCalculation: false
17803
17877
  };
17804
- let businessService = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$35 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$35 === void 0 ? void 0 : (_wsAdditionalDetails$36 = _wsAdditionalDetails$35.appDetails) === null || _wsAdditionalDetails$36 === void 0 ? void 0 : _wsAdditionalDetails$36.service) == "WATER" ? "WS" : "SW";
17878
+ let businessService = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$51 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$51 === void 0 ? void 0 : (_wsAdditionalDetails$52 = _wsAdditionalDetails$51.appDetails) === null || _wsAdditionalDetails$52 === void 0 ? void 0 : _wsAdditionalDetails$52.service) == "WATER" ? "WS" : "SW";
17805
17879
  Digit.WSService.wsCalculationEstimate(data, businessService).then((result, err) => {
17806
- var _result$Calculation, _result$Calculation$, _result$Calculation$$, _result$Calculation3, _result$Calculation3$, _result$Calculation4, _result$Calculation4$, _result$Calculation5, _result$Calculation5$, _result$Calculation6, _result$Calculation6$, _result$Calculation7, _result$Calculation7$, _result$Calculation8;
17880
+ var _result$Calculation, _result$Calculation$, _result$Calculation$$, _result$Calculation3, _result$Calculation3$, _result$Calculation4, _result$Calculation4$, _result$Calculation5, _result$Calculation5$, _result$Calculation6, _result$Calculation6$, _result$Calculation7, _result$Calculation7$, _result$Calculation8, _result$Calculation8$, _result$Calculation9, _result$Calculation9$, _result$Calculation0, _result$Calculation0$, _result$Calculation1;
17807
17881
  if ((result === null || result === void 0 ? void 0 : (_result$Calculation = result.Calculation) === null || _result$Calculation === void 0 ? void 0 : (_result$Calculation$ = _result$Calculation[0]) === null || _result$Calculation$ === void 0 ? void 0 : (_result$Calculation$$ = _result$Calculation$.taxHeadEstimates) === null || _result$Calculation$$ === void 0 ? void 0 : _result$Calculation$$.length) > 0) {
17808
17882
  var _result$Calculation2, _result$Calculation2$, _result$Calculation2$2;
17809
17883
  result === null || result === void 0 ? void 0 : (_result$Calculation2 = result.Calculation) === null || _result$Calculation2 === void 0 ? void 0 : (_result$Calculation2$ = _result$Calculation2[0]) === null || _result$Calculation2$ === void 0 ? void 0 : (_result$Calculation2$2 = _result$Calculation2$.taxHeadEstimates) === null || _result$Calculation2$2 === void 0 ? void 0 : _result$Calculation2$2.forEach(data => data.amount = data.estimateAmount);
@@ -17812,19 +17886,25 @@ const WSFeeEstimation = _ref => {
17812
17886
  const taxHeadEstimates = (result === null || result === void 0 ? void 0 : (_result$Calculation4 = result.Calculation) === null || _result$Calculation4 === void 0 ? void 0 : (_result$Calculation4$ = _result$Calculation4[0]) === null || _result$Calculation4$ === void 0 ? void 0 : _result$Calculation4$.taxHeadEstimates) || [];
17813
17887
  const values = taxHeadEstimates.length > 0 ? taxHeadEstimates.map(data => ({
17814
17888
  title: data === null || data === void 0 ? void 0 : data.taxHeadCode,
17815
- value: /*#__PURE__*/React.createElement("span", null, "\u20B9", Number(data === null || data === void 0 ? void 0 : data.estimateAmount).toFixed(2))
17889
+ value: /*#__PURE__*/React.createElement("span", null, "\u20B9", Number((data === null || data === void 0 ? void 0 : data.estimateAmount) ?? (data === null || data === void 0 ? void 0 : data.amount) ?? 0).toFixed(2)),
17890
+ status: data === null || data === void 0 ? void 0 : data.status,
17891
+ taxHeadCode: data === null || data === void 0 ? void 0 : data.taxHeadCode,
17892
+ amount: (data === null || data === void 0 ? void 0 : data.estimateAmount) ?? (data === null || data === void 0 ? void 0 : data.amount) ?? 0
17816
17893
  })) : [{
17817
17894
  title: "WS_APPLICATION_FEE_HEADER",
17818
- value: (_result$Calculation5 = result.Calculation) === null || _result$Calculation5 === void 0 ? void 0 : (_result$Calculation5$ = _result$Calculation5[0]) === null || _result$Calculation5$ === void 0 ? void 0 : _result$Calculation5$.fee
17895
+ value: /*#__PURE__*/React.createElement("span", null, "\u20B9", ((_result$Calculation5 = result.Calculation) === null || _result$Calculation5 === void 0 ? void 0 : (_result$Calculation5$ = _result$Calculation5[0]) === null || _result$Calculation5$ === void 0 ? void 0 : _result$Calculation5$.fee) || 0),
17896
+ amount: ((_result$Calculation6 = result.Calculation) === null || _result$Calculation6 === void 0 ? void 0 : (_result$Calculation6$ = _result$Calculation6[0]) === null || _result$Calculation6$ === void 0 ? void 0 : _result$Calculation6$.fee) || 0
17819
17897
  }, {
17820
17898
  title: "WS_SERVICE_FEE_HEADER",
17821
- value: (_result$Calculation6 = result.Calculation) === null || _result$Calculation6 === void 0 ? void 0 : (_result$Calculation6$ = _result$Calculation6[0]) === null || _result$Calculation6$ === void 0 ? void 0 : _result$Calculation6$.charge
17899
+ value: /*#__PURE__*/React.createElement("span", null, "\u20B9", ((_result$Calculation7 = result.Calculation) === null || _result$Calculation7 === void 0 ? void 0 : (_result$Calculation7$ = _result$Calculation7[0]) === null || _result$Calculation7$ === void 0 ? void 0 : _result$Calculation7$.charge) || 0),
17900
+ amount: ((_result$Calculation8 = result.Calculation) === null || _result$Calculation8 === void 0 ? void 0 : (_result$Calculation8$ = _result$Calculation8[0]) === null || _result$Calculation8$ === void 0 ? void 0 : _result$Calculation8$.charge) || 0
17822
17901
  }, {
17823
17902
  title: "WS_TAX_HEADER",
17824
- value: (_result$Calculation7 = result.Calculation) === null || _result$Calculation7 === void 0 ? void 0 : (_result$Calculation7$ = _result$Calculation7[0]) === null || _result$Calculation7$ === void 0 ? void 0 : _result$Calculation7$.taxAmount
17903
+ value: /*#__PURE__*/React.createElement("span", null, "\u20B9", ((_result$Calculation9 = result.Calculation) === null || _result$Calculation9 === void 0 ? void 0 : (_result$Calculation9$ = _result$Calculation9[0]) === null || _result$Calculation9$ === void 0 ? void 0 : _result$Calculation9$.taxAmount) || 0),
17904
+ amount: ((_result$Calculation0 = result.Calculation) === null || _result$Calculation0 === void 0 ? void 0 : (_result$Calculation0$ = _result$Calculation0[0]) === null || _result$Calculation0$ === void 0 ? void 0 : _result$Calculation0$.taxAmount) || 0
17825
17905
  }];
17826
17906
  setSessionBillFormData(cloneDeep_1(result.Calculation[0]));
17827
- setBillDetails(result === null || result === void 0 ? void 0 : (_result$Calculation8 = result.Calculation) === null || _result$Calculation8 === void 0 ? void 0 : _result$Calculation8[0]);
17907
+ setBillDetails(result === null || result === void 0 ? void 0 : (_result$Calculation1 = result.Calculation) === null || _result$Calculation1 === void 0 ? void 0 : _result$Calculation1[0]);
17828
17908
  setValues(values);
17829
17909
  fields.billDetails = result === null || result === void 0 ? void 0 : result.Calculation;
17830
17910
  setSessionFormData(fields);
@@ -17880,11 +17960,24 @@ const WSFeeEstimation = _ref => {
17880
17960
  minWidth: "280px"
17881
17961
  }
17882
17962
  }, values && /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement("div", null, displayedValues === null || displayedValues === void 0 ? void 0 : displayedValues.map((value, index) => {
17963
+ const billRow = billRows === null || billRows === void 0 ? void 0 : billRows.find(b => (b === null || b === void 0 ? void 0 : b.taxHeadCode) === (value === null || value === void 0 ? void 0 : value.title) || (b === null || b === void 0 ? void 0 : b.taxHeadCode) === (value === null || value === void 0 ? void 0 : value.taxHeadCode));
17964
+ const rawStatus = (value === null || value === void 0 ? void 0 : value.status) || (billRow === null || billRow === void 0 ? void 0 : billRow.status) || ((value === null || value === void 0 ? void 0 : value.title) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" || (value === null || value === void 0 ? void 0 : value.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" ? "UNPAID" : "");
17965
+ const status = String(rawStatus || "").toUpperCase();
17966
+ const isItemPaid = status === "PAID";
17967
+ const isItemUnpaid = status === "UNPAID";
17968
+ const showItemStatus = isPropUpdated && (isItemPaid || isItemUnpaid);
17883
17969
  return /*#__PURE__*/React.createElement(Row, {
17884
17970
  className: "border-none",
17885
- key: `${value.title}`,
17971
+ key: `${value.title || index}`,
17886
17972
  label: `${t(`${value.title}`)}`,
17887
- text: value !== null && value !== void 0 && value.value ? value === null || value === void 0 ? void 0 : value.value : ""
17973
+ text: showItemStatus ? /*#__PURE__*/React.createElement("span", null, value !== null && value !== void 0 && value.value ? value === null || value === void 0 ? void 0 : value.value : /*#__PURE__*/React.createElement("span", null, "\u20B9", Number((value === null || value === void 0 ? void 0 : value.amount) ?? (billRow === null || billRow === void 0 ? void 0 : billRow.amount) ?? (billRow === null || billRow === void 0 ? void 0 : billRow.estimateAmount) ?? 0).toFixed(2)), /*#__PURE__*/React.createElement("span", {
17974
+ style: {
17975
+ color: isItemPaid ? "#2E9E8F" : "#D83A2F",
17976
+ marginLeft: "8px",
17977
+ fontWeight: "600",
17978
+ fontSize: "14px"
17979
+ }
17980
+ }, isItemPaid ? "(paid)" : "(unpaid)")) : value !== null && value !== void 0 && value.value ? value === null || value === void 0 ? void 0 : value.value : ""
17888
17981
  });
17889
17982
  })), /*#__PURE__*/React.createElement("hr", {
17890
17983
  style: {
@@ -17905,7 +17998,7 @@ const WSFeeEstimation = _ref => {
17905
17998
  className: "border-none",
17906
17999
  key: `CS_INBOX_STATUS_FILTER`,
17907
18000
  label: `${t(`CS_INBOX_STATUS_FILTER`)}`,
17908
- text: displayedIsPaid ? t("WS_COMMON_PAID_LABEL") : t("WS_COMMON_NOT_PAID"),
18001
+ text: displayedIsPaid ? t("WS_COMMON_PAID_LABEL") || "PAID" : isPropUpdated ? "UNPAID" : t("WS_COMMON_NOT_PAID"),
17909
18002
  textStyle: !displayedIsPaid ? {
17910
18003
  color: "#D83A2F"
17911
18004
  } : {
@@ -18106,7 +18199,7 @@ const InfoDetails = _ref2 => {
18106
18199
  };
18107
18200
 
18108
18201
  const ViewBreakup = _ref => {
18109
- var _breakUpData$calculat, _breakUpData$calculat2, _breakUpData$calculat3, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
18202
+ var _wsAdditionalDetails$2, _wsAdditionalDetails$3, _breakUpData$taxHeadE, _breakUpData$billDeta, _breakUpData$billDeta2, _breakUpData$billDeta3, _wsAdditionalDetails$4, _wsAdditionalDetails$5, _breakUpData$calculat, _breakUpData$calculat2, _breakUpData$calculat3, _wsAdditionalDetails$10, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
18110
18203
  let {
18111
18204
  wsAdditionalDetails,
18112
18205
  workflowDetails,
@@ -18187,8 +18280,27 @@ const ViewBreakup = _ref => {
18187
18280
  setBreakUpData(breakupData);
18188
18281
  showPopUp(true);
18189
18282
  };
18283
+ const isPropUpdated = Boolean((wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$2 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$2 === void 0 ? void 0 : _wsAdditionalDetails$2.isPropUpdated) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$3 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$3 === void 0 ? void 0 : _wsAdditionalDetails$3.hasAdditionalInfraCharge) || (breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$taxHeadE = breakUpData.taxHeadEstimates) === null || _breakUpData$taxHeadE === void 0 ? void 0 : _breakUpData$taxHeadE.some(b => (b === null || b === void 0 ? void 0 : b.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE")) || (breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billDeta = breakUpData.billDetails) === null || _breakUpData$billDeta === void 0 ? void 0 : (_breakUpData$billDeta2 = _breakUpData$billDeta[0]) === null || _breakUpData$billDeta2 === void 0 ? void 0 : (_breakUpData$billDeta3 = _breakUpData$billDeta2.billAccountDetails) === null || _breakUpData$billDeta3 === void 0 ? void 0 : _breakUpData$billDeta3.some(b => (b === null || b === void 0 ? void 0 : b.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE")) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$4 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$4 === void 0 ? void 0 : (_wsAdditionalDetails$5 = _wsAdditionalDetails$4.values) === null || _wsAdditionalDetails$5 === void 0 ? void 0 : _wsAdditionalDetails$5.some(v => (v === null || v === void 0 ? void 0 : v.title) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" || (v === null || v === void 0 ? void 0 : v.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE")));
18284
+ const renderAmountWithStatus = data => {
18285
+ const rawStatus = (data === null || data === void 0 ? void 0 : data.status) || ((data === null || data === void 0 ? void 0 : data.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" ? "UNPAID" : "");
18286
+ const status = String(rawStatus || "").toUpperCase();
18287
+ const isItemPaid = status === "PAID";
18288
+ const isItemUnpaid = status === "UNPAID";
18289
+ const showItemStatus = isPropUpdated && (isItemPaid || isItemUnpaid);
18290
+ if (!showItemStatus) {
18291
+ return /*#__PURE__*/React.createElement("span", null, "\u20B9", Number(data === null || data === void 0 ? void 0 : data.amount) || 0);
18292
+ }
18293
+ return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "\u20B9", Number(data === null || data === void 0 ? void 0 : data.amount) || 0), /*#__PURE__*/React.createElement("span", {
18294
+ style: {
18295
+ color: isItemPaid ? "#2E9E8F" : "#D83A2F",
18296
+ marginLeft: "8px",
18297
+ fontWeight: "600",
18298
+ fontSize: "14px"
18299
+ }
18300
+ }, isItemPaid ? "(paid)" : "(unpaid)"));
18301
+ };
18190
18302
  const getBreakupReportDetails = () => {
18191
- var _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4, _wsAdditionalDetails$5, _wsAdditionalDetails$6, _wsAdditionalDetails$7, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3;
18303
+ var _wsAdditionalDetails$6, _wsAdditionalDetails$7, _wsAdditionalDetails$8, _wsAdditionalDetails$9, _wsAdditionalDetails$0, _wsAdditionalDetails$1, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3;
18192
18304
  const amountRows = function (rows) {
18193
18305
  if (rows === void 0) {
18194
18306
  rows = [];
@@ -18198,10 +18310,10 @@ const ViewBreakup = _ref => {
18198
18310
  value: /*#__PURE__*/React.createElement("span", null, `₹${formatNumber(row === null || row === void 0 ? void 0 : row.amount)}`)
18199
18311
  }));
18200
18312
  };
18201
- const connectionHolder = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$2 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$2 === void 0 ? void 0 : (_wsAdditionalDetails$3 = _wsAdditionalDetails$2.appDetails) === null || _wsAdditionalDetails$3 === void 0 ? void 0 : (_wsAdditionalDetails$4 = _wsAdditionalDetails$3.connectionHolders) === null || _wsAdditionalDetails$4 === void 0 ? void 0 : _wsAdditionalDetails$4[0];
18313
+ const connectionHolder = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$6 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$6 === void 0 ? void 0 : (_wsAdditionalDetails$7 = _wsAdditionalDetails$6.appDetails) === null || _wsAdditionalDetails$7 === void 0 ? void 0 : (_wsAdditionalDetails$8 = _wsAdditionalDetails$7.connectionHolders) === null || _wsAdditionalDetails$8 === void 0 ? void 0 : _wsAdditionalDetails$8[0];
18202
18314
  const applicantName = [connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.name, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.middleName, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.lastName].filter(Boolean).join(" ") || "-";
18203
18315
  const mobileNumber = (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.mobileNumber) || "-";
18204
- const appNumber = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$5 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$5 === void 0 ? void 0 : (_wsAdditionalDetails$6 = _wsAdditionalDetails$5.data) === null || _wsAdditionalDetails$6 === void 0 ? void 0 : _wsAdditionalDetails$6.applicationNo) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$7 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$7 === void 0 ? void 0 : _wsAdditionalDetails$7.applicationNumber) || "-";
18316
+ const appNumber = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$9 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$9 === void 0 ? void 0 : (_wsAdditionalDetails$0 = _wsAdditionalDetails$9.data) === null || _wsAdditionalDetails$0 === void 0 ? void 0 : _wsAdditionalDetails$0.applicationNo) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$1 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$1 === void 0 ? void 0 : _wsAdditionalDetails$1.applicationNumber) || "-";
18205
18317
  return [{
18206
18318
  title: "Applicant Details",
18207
18319
  values: [{
@@ -18435,7 +18547,7 @@ const ViewBreakup = _ref => {
18435
18547
  maxWidth: "950px",
18436
18548
  minWidth: "280px"
18437
18549
  }
18438
- }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$8 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$8 !== void 0 && _wsAdditionalDetails$8.isViewBreakup ? /*#__PURE__*/React.createElement("div", {
18550
+ }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$10 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$10 !== void 0 && _wsAdditionalDetails$10.isViewBreakup ? /*#__PURE__*/React.createElement("div", {
18439
18551
  onClick: e => onPopupOpen(),
18440
18552
  style: {
18441
18553
  marginTop: "12px"
@@ -18480,7 +18592,7 @@ const ViewBreakup = _ref => {
18480
18592
  },
18481
18593
  key: `${data === null || data === void 0 ? void 0 : data.taxHeadCode}`,
18482
18594
  label: `${t(`${data === null || data === void 0 ? void 0 : data.taxHeadCode}`)}`,
18483
- text: /*#__PURE__*/React.createElement("span", null, "\u20B9", Number(data === null || data === void 0 ? void 0 : data.amount) || 0),
18595
+ text: renderAmountWithStatus(data),
18484
18596
  textStyle: {
18485
18597
  textAlign: "right"
18486
18598
  }
@@ -18494,7 +18606,7 @@ const ViewBreakup = _ref => {
18494
18606
  },
18495
18607
  key: `${data === null || data === void 0 ? void 0 : data.taxHeadCode}`,
18496
18608
  label: `${t(`${data === null || data === void 0 ? void 0 : data.taxHeadCode}`)}`,
18497
- text: /*#__PURE__*/React.createElement("span", null, "\u20B9", Number(data === null || data === void 0 ? void 0 : data.amount) || 0),
18609
+ text: renderAmountWithStatus(data),
18498
18610
  textStyle: {
18499
18611
  textAlign: "right"
18500
18612
  }
@@ -18508,7 +18620,7 @@ const ViewBreakup = _ref => {
18508
18620
  },
18509
18621
  key: `${data === null || data === void 0 ? void 0 : data.taxHeadCode}`,
18510
18622
  label: `${t(`${data === null || data === void 0 ? void 0 : data.taxHeadCode}`)}`,
18511
- text: /*#__PURE__*/React.createElement("span", null, "\u20B9", Number(data === null || data === void 0 ? void 0 : data.amount) || 0),
18623
+ text: renderAmountWithStatus(data),
18512
18624
  textStyle: {
18513
18625
  textAlign: "right"
18514
18626
  }
@@ -21507,7 +21619,9 @@ const App = _ref => {
21507
21619
  component: WSExecuteDisconnection
21508
21620
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
21509
21621
  path: `${path}/activate-connection`,
21510
- component: WSActivateConnection
21622
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
21623
+ layoutClass: "action"
21624
+ }, /*#__PURE__*/React.createElement(WSActivateConnection, null))
21511
21625
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
21512
21626
  path: `${path}/restore-application`,
21513
21627
  component: WSRestoration
@@ -22277,12 +22391,12 @@ const WSCalculation = _ref => {
22277
22391
  var _formValue$useDetails, _formValue$useDetails2, _formValue$useDetails3, _formValue$useDetails4;
22278
22392
  const plotAreaNum = parseFloat(formValue === null || formValue === void 0 ? void 0 : (_formValue$useDetails = formValue.useDetails) === null || _formValue$useDetails === void 0 ? void 0 : _formValue$useDetails.plotArea);
22279
22393
  const builtUpAreaNum = parseFloat(formValue === null || formValue === void 0 ? void 0 : (_formValue$useDetails2 = formValue.useDetails) === null || _formValue$useDetails2 === void 0 ? void 0 : _formValue$useDetails2.builtUpArea);
22280
- if (!isNaN(plotAreaNum) && !isNaN(builtUpAreaNum) && plotAreaNum <= builtUpAreaNum) {
22281
- const plotTrans = t("WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA");
22394
+ if (!isNaN(plotAreaNum) && !isNaN(builtUpAreaNum) && plotAreaNum < builtUpAreaNum) {
22395
+ const plotTrans = t("WS_PLOT_AREA_MORE_THAN_OR_EQUAL_BUILT_UP_AREA") || t("WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA");
22282
22396
  if (setError) {
22283
22397
  setError(config === null || config === void 0 ? void 0 : config.key, {
22284
22398
  type: "custom",
22285
- message: plotTrans && plotTrans !== "WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA" ? plotTrans : "Plot area should always be more than built up area."
22399
+ message: plotTrans && plotTrans !== "WS_PLOT_AREA_MORE_THAN_OR_EQUAL_BUILT_UP_AREA" && plotTrans !== "WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA" ? plotTrans : "Plot area should always be more than or equal to built up area."
22286
22400
  });
22287
22401
  }
22288
22402
  return;
@@ -22755,8 +22869,8 @@ const WSCalculation = _ref => {
22755
22869
  var _formValue$useDetails5;
22756
22870
  const plot = parseFloat(formValue === null || formValue === void 0 ? void 0 : (_formValue$useDetails5 = formValue.useDetails) === null || _formValue$useDetails5 === void 0 ? void 0 : _formValue$useDetails5.plotArea);
22757
22871
  const built = parseFloat(value);
22758
- if (!isNaN(plot) && !isNaN(built) && plot <= built) {
22759
- return t("WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA") || "Plot area should always be more than built up area.";
22872
+ if (!isNaN(plot) && !isNaN(built) && plot < built) {
22873
+ return t("WS_PLOT_AREA_MORE_THAN_OR_EQUAL_BUILT_UP_AREA") || t("WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA") || "Plot area should always be more than or equal to built up area.";
22760
22874
  }
22761
22875
  return true;
22762
22876
  }
@@ -25976,7 +26090,9 @@ const App$1 = _ref2 => {
25976
26090
  })
25977
26091
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
25978
26092
  path: `${path}/activate-connection`,
25979
- component: WSActivateConnection
26093
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
26094
+ layoutClass: "action"
26095
+ }, /*#__PURE__*/React.createElement(WSActivateConnection, null))
25980
26096
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
25981
26097
  path: `${path}/water/bill-amendment/search-application`,
25982
26098
  component: props => /*#__PURE__*/React.createElement(WSSearchBillAmendment, _extends({}, props, {
@@ -26821,8 +26937,53 @@ const WSPlumberPreference = _ref => {
26821
26937
  })));
26822
26938
  };
26823
26939
 
26940
+ const METER_MAKES = [{
26941
+ name: "Anand Asahi",
26942
+ code: "ANAND_ASAHI",
26943
+ i18nKey: "WS_METER_MAKE_ANAND_ASAHI"
26944
+ }, {
26945
+ name: "Arad",
26946
+ code: "ARAD",
26947
+ i18nKey: "WS_METER_MAKE_ARAD"
26948
+ }, {
26949
+ name: "Baylan",
26950
+ code: "BAYLAN",
26951
+ i18nKey: "WS_METER_MAKE_BAYLAN"
26952
+ }, {
26953
+ name: "Crescent",
26954
+ code: "CRESCENT",
26955
+ i18nKey: "WS_METER_MAKE_CRESCENT"
26956
+ }, {
26957
+ name: "Dasmesh / DMB",
26958
+ code: "DASMESH",
26959
+ i18nKey: "WS_METER_MAKE_DASMESH"
26960
+ }, {
26961
+ name: "Fedrel",
26962
+ code: "FEDREL",
26963
+ i18nKey: "WS_METER_MAKE_FEDREL"
26964
+ }, {
26965
+ name: "Itron",
26966
+ code: "ITRON",
26967
+ i18nKey: "WS_METER_MAKE_ITRON"
26968
+ }, {
26969
+ name: "Konark",
26970
+ code: "KONARK",
26971
+ i18nKey: "WS_METER_MAKE_KONARK"
26972
+ }, {
26973
+ name: "Kranti",
26974
+ code: "KRANTI",
26975
+ i18nKey: "WS_METER_MAKE_KRANTI"
26976
+ }, {
26977
+ name: "Teksan",
26978
+ code: "TEKSAN",
26979
+ i18nKey: "WS_METER_MAKE_TEKSAN"
26980
+ }, {
26981
+ name: "Other",
26982
+ code: "OTHER",
26983
+ i18nKey: "WS_METER_MAKE_OTHER"
26984
+ }];
26824
26985
  const WSActivationDetails = _ref => {
26825
- var _formData$activationD;
26986
+ var _formData$activationD, _formData$formDetails, _formData$connectionD, _formData$connectionD2, _formData$connectionD3, _appData$additionalDe, _appData$additionalDe2, _appData$additionalDe3, _appData$additionalDe4, _activationDetails$me, _activationDetails$me2, _activationDetails$fe, _activationDetails$fe2;
26826
26987
  let {
26827
26988
  t,
26828
26989
  config,
@@ -26830,12 +26991,39 @@ const WSActivationDetails = _ref => {
26830
26991
  formData,
26831
26992
  onSelect
26832
26993
  } = _ref;
26994
+ const getTrans = (key, defaultVal) => {
26995
+ const val = t(key);
26996
+ return val && val !== key ? val : defaultVal;
26997
+ };
26833
26998
  const initialData = Array.isArray(formData === null || formData === void 0 ? void 0 : formData.activationDetails) ? formData === null || formData === void 0 ? void 0 : (_formData$activationD = formData.activationDetails) === null || _formData$activationD === void 0 ? void 0 : _formData$activationD[0] : (formData === null || formData === void 0 ? void 0 : formData.activationDetails) || {};
26999
+ const appData = (formData === null || formData === void 0 ? void 0 : (_formData$formDetails = formData.formDetails) === null || _formData$formDetails === void 0 ? void 0 : _formData$formDetails.applicationData) || (formData === null || formData === void 0 ? void 0 : (_formData$connectionD = formData.connectionDetails) === null || _formData$connectionD === void 0 ? void 0 : (_formData$connectionD2 = _formData$connectionD[0]) === null || _formData$connectionD2 === void 0 ? void 0 : (_formData$connectionD3 = _formData$connectionD2.formDetails) === null || _formData$connectionD3 === void 0 ? void 0 : _formData$connectionD3.applicationData) || {};
27000
+ const findMeterMake = val => {
27001
+ if (!val) return null;
27002
+ if (typeof val === "object" && val !== null && val !== void 0 && val.name) return val;
27003
+ return METER_MAKES.find(m => m.code === val || m.name === val) || {
27004
+ name: val,
27005
+ code: val
27006
+ };
27007
+ };
27008
+ const findMeterSize = val => {
27009
+ if (!val) return "";
27010
+ if (typeof val === "object") return (val === null || val === void 0 ? void 0 : val.value) || (val === null || val === void 0 ? void 0 : val.name) || (val === null || val === void 0 ? void 0 : val.code) || "";
27011
+ return String(val);
27012
+ };
27013
+ const findFerruleSize = val => {
27014
+ if (!val) return "";
27015
+ if (typeof val === "object") return (val === null || val === void 0 ? void 0 : val.value) || (val === null || val === void 0 ? void 0 : val.name) || (val === null || val === void 0 ? void 0 : val.code) || "";
27016
+ return String(val);
27017
+ };
26834
27018
  const [activationDetails, setActivationDetails] = React.useState({
26835
- meterId: (initialData === null || initialData === void 0 ? void 0 : initialData.meterId) || "",
26836
- meterInstallationDate: (initialData === null || initialData === void 0 ? void 0 : initialData.meterInstallationDate) || "",
26837
- meterInitialReading: "0",
26838
- connectionExecutionDate: (initialData === null || initialData === void 0 ? void 0 : initialData.connectionExecutionDate) || ""
27019
+ meterMake: findMeterMake((initialData === null || initialData === void 0 ? void 0 : initialData.meterMake) || (appData === null || appData === void 0 ? void 0 : (_appData$additionalDe = appData.additionalDetails) === null || _appData$additionalDe === void 0 ? void 0 : _appData$additionalDe.meterMake)),
27020
+ meterNo: (initialData === null || initialData === void 0 ? void 0 : initialData.meterNo) || (initialData === null || initialData === void 0 ? void 0 : initialData.meterId) || (appData === null || appData === void 0 ? void 0 : appData.meterId) || "",
27021
+ meterId: (initialData === null || initialData === void 0 ? void 0 : initialData.meterNo) || (initialData === null || initialData === void 0 ? void 0 : initialData.meterId) || (appData === null || appData === void 0 ? void 0 : appData.meterId) || "",
27022
+ meterSize: findMeterSize((initialData === null || initialData === void 0 ? void 0 : initialData.meterSize) || (appData === null || appData === void 0 ? void 0 : (_appData$additionalDe2 = appData.additionalDetails) === null || _appData$additionalDe2 === void 0 ? void 0 : _appData$additionalDe2.meterSize)),
27023
+ ferruleSize: findFerruleSize((initialData === null || initialData === void 0 ? void 0 : initialData.ferruleSize) || (appData === null || appData === void 0 ? void 0 : (_appData$additionalDe3 = appData.additionalDetails) === null || _appData$additionalDe3 === void 0 ? void 0 : _appData$additionalDe3.ferruleSize)),
27024
+ meterInstallationDate: (initialData === null || initialData === void 0 ? void 0 : initialData.meterInstallationDate) || (appData === null || appData === void 0 ? void 0 : appData.meterInstallationDate) || "",
27025
+ meterInitialReading: (initialData === null || initialData === void 0 ? void 0 : initialData.meterInitialReading) || (appData === null || appData === void 0 ? void 0 : (_appData$additionalDe4 = appData.additionalDetails) === null || _appData$additionalDe4 === void 0 ? void 0 : _appData$additionalDe4.initialMeterReading) || "0",
27026
+ connectionExecutionDate: (initialData === null || initialData === void 0 ? void 0 : initialData.connectionExecutionDate) || (appData === null || appData === void 0 ? void 0 : appData.connectionExecutionDate) || ""
26839
27027
  });
26840
27028
  React.useEffect(() => {
26841
27029
  var _formData$activationD2;
@@ -26843,12 +27031,16 @@ const WSActivationDetails = _ref => {
26843
27031
  if (actData) {
26844
27032
  setActivationDetails(prev => {
26845
27033
  const nextState = {
26846
- meterId: actData.meterId !== undefined ? actData.meterId : prev.meterId,
27034
+ meterMake: actData.meterMake !== undefined ? findMeterMake(actData.meterMake) : prev.meterMake,
27035
+ meterNo: actData.meterNo !== undefined ? actData.meterNo : actData.meterId !== undefined ? actData.meterId : prev.meterNo,
27036
+ meterId: actData.meterNo !== undefined ? actData.meterNo : actData.meterId !== undefined ? actData.meterId : prev.meterId,
27037
+ meterSize: actData.meterSize !== undefined ? findMeterSize(actData.meterSize) : prev.meterSize,
27038
+ ferruleSize: actData.ferruleSize !== undefined ? findFerruleSize(actData.ferruleSize) : prev.ferruleSize,
26847
27039
  meterInstallationDate: actData.meterInstallationDate !== undefined ? actData.meterInstallationDate : prev.meterInstallationDate,
26848
- meterInitialReading: "0",
27040
+ meterInitialReading: actData.meterInitialReading !== undefined && actData.meterInitialReading !== "" ? actData.meterInitialReading : prev.meterInitialReading,
26849
27041
  connectionExecutionDate: actData.connectionExecutionDate !== undefined ? actData.connectionExecutionDate : prev.connectionExecutionDate
26850
27042
  };
26851
- if (prev.meterId === nextState.meterId && prev.meterInstallationDate === nextState.meterInstallationDate && prev.meterInitialReading === nextState.meterInitialReading && prev.connectionExecutionDate === nextState.connectionExecutionDate) {
27043
+ if (lodash.isEqual(prev, nextState)) {
26852
27044
  return prev;
26853
27045
  }
26854
27046
  return nextState;
@@ -26860,58 +27052,145 @@ const WSActivationDetails = _ref => {
26860
27052
  onSelect(config.key, [activationDetails]);
26861
27053
  }
26862
27054
  }, [activationDetails]);
26863
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t(`WS_METER_ID`)}`, /*#__PURE__*/React.createElement("span", {
26864
- className: "check-page-link-button"
26865
- }, " *")), /*#__PURE__*/React.createElement("div", {
27055
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27056
+ style: {
27057
+ margin: 0
27058
+ },
27059
+ label: getTrans("WS_METER_MAKE_LABEL", "Meter make/brand name"),
27060
+ isMandatory: true,
27061
+ infoText: t("WS_METER_MAKE_INFO_MSG", "Select approved meter manufacturer or brand name")
27062
+ }), /*#__PURE__*/React.createElement("div", {
27063
+ className: "field"
27064
+ }, /*#__PURE__*/React.createElement(Dropdown, {
27065
+ className: "form-field",
27066
+ selected: activationDetails.meterMake,
27067
+ disable: false,
27068
+ option: METER_MAKES,
27069
+ placeholder: getTrans("WS_METER_MAKE_PLACEHOLDER", "Select approved meter name"),
27070
+ select: val => {
27071
+ setActivationDetails({
27072
+ ...activationDetails,
27073
+ meterMake: val
27074
+ });
27075
+ },
27076
+ optionKey: "name",
27077
+ t: t
27078
+ }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27079
+ style: {
27080
+ margin: 0
27081
+ },
27082
+ label: getTrans("WS_METER_NO_LABEL", "Meter No"),
27083
+ isMandatory: true,
27084
+ infoText: t("WS_METER_NO_INFO_MSG", "Enter Serial Number or Meter No engraved on the meter")
27085
+ }), /*#__PURE__*/React.createElement("div", {
26866
27086
  className: "field"
26867
27087
  }, /*#__PURE__*/React.createElement(TextInput, {
26868
27088
  t: t,
26869
27089
  type: "text",
26870
- optionKey: "i18nKey",
26871
- name: "meterId",
26872
- value: activationDetails.meterId,
26873
- placeholder: `${t(`WS_METER_ID_PLACEHOLDER`)}`,
27090
+ name: "meterNo",
27091
+ value: activationDetails.meterNo,
27092
+ placeholder: getTrans("WS_METER_NO_PLACEHOLDER", "Enter Meter No"),
26874
27093
  onChange: ev => {
27094
+ const val = ev.target.value;
26875
27095
  setActivationDetails({
26876
27096
  ...activationDetails,
26877
- meterId: ev.target.value
27097
+ meterNo: val,
27098
+ meterId: val
26878
27099
  });
26879
27100
  }
26880
- }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t(`WS_METER_INSTALLATION_DATE`)}`, /*#__PURE__*/React.createElement("span", {
26881
- className: "check-page-link-button"
26882
- }, " *")), /*#__PURE__*/React.createElement("div", {
27101
+ }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27102
+ style: {
27103
+ margin: 0
27104
+ },
27105
+ label: getTrans("WS_METER_SIZE_LABEL", "Meter Size"),
27106
+ isMandatory: true,
27107
+ infoText: t("WS_METER_SIZE_INFO_MSG", "Enter diameter / size of the water meter")
27108
+ }), /*#__PURE__*/React.createElement("div", {
27109
+ className: "field"
27110
+ }, /*#__PURE__*/React.createElement(TextInput, {
27111
+ t: t,
27112
+ type: "text",
27113
+ name: "meterSize",
27114
+ value: typeof activationDetails.meterSize === "object" ? ((_activationDetails$me = activationDetails.meterSize) === null || _activationDetails$me === void 0 ? void 0 : _activationDetails$me.name) || ((_activationDetails$me2 = activationDetails.meterSize) === null || _activationDetails$me2 === void 0 ? void 0 : _activationDetails$me2.value) || "" : activationDetails.meterSize || "",
27115
+ placeholder: getTrans("WS_METER_SIZE_PLACEHOLDER", "Enter Meter Size"),
27116
+ onChange: ev => {
27117
+ const val = ev.target.value;
27118
+ setActivationDetails({
27119
+ ...activationDetails,
27120
+ meterSize: val
27121
+ });
27122
+ }
27123
+ }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27124
+ style: {
27125
+ margin: 0
27126
+ },
27127
+ label: getTrans("WS_FERRULE_SIZE_LABEL", "Ferrule Size"),
27128
+ isMandatory: true,
27129
+ infoText: t("WS_FERRULE_SIZE_INFO_MSG", "Enter size of ferrule connection")
27130
+ }), /*#__PURE__*/React.createElement("div", {
27131
+ className: "field"
27132
+ }, /*#__PURE__*/React.createElement(TextInput, {
27133
+ t: t,
27134
+ type: "text",
27135
+ name: "ferruleSize",
27136
+ value: typeof activationDetails.ferruleSize === "object" ? ((_activationDetails$fe = activationDetails.ferruleSize) === null || _activationDetails$fe === void 0 ? void 0 : _activationDetails$fe.name) || ((_activationDetails$fe2 = activationDetails.ferruleSize) === null || _activationDetails$fe2 === void 0 ? void 0 : _activationDetails$fe2.value) || "" : activationDetails.ferruleSize || "",
27137
+ placeholder: getTrans("WS_FERRULE_SIZE_PLACEHOLDER", "Enter Ferrule Size"),
27138
+ onChange: ev => {
27139
+ const val = ev.target.value;
27140
+ setActivationDetails({
27141
+ ...activationDetails,
27142
+ ferruleSize: val
27143
+ });
27144
+ }
27145
+ }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27146
+ style: {
27147
+ margin: 0
27148
+ },
27149
+ label: getTrans("WS_METER_INSTALLATION_DATE", "Meter Installation Date"),
27150
+ isMandatory: true,
27151
+ infoText: t("WS_METER_INSTALLATION_DATE_INFO_MSG", "Select date when the meter was physically installed")
27152
+ }), /*#__PURE__*/React.createElement("div", {
26883
27153
  className: "field"
26884
27154
  }, /*#__PURE__*/React.createElement(DatePicker, {
26885
27155
  date: activationDetails.meterInstallationDate,
26886
- placeholder: `${t(`WS_METER_INSTALLATION_DATE_PLACEHOLDER`)}`,
27156
+ placeholder: getTrans("WS_METER_INSTALLATION_DATE_PLACEHOLDER", "DD/MM/YYYY"),
26887
27157
  onChange: date => {
26888
27158
  setActivationDetails({
26889
27159
  ...activationDetails,
26890
27160
  meterInstallationDate: date
26891
27161
  });
26892
27162
  }
26893
- }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t(`WS_INIT_METER_READING`)}`, /*#__PURE__*/React.createElement("span", {
26894
- className: "check-page-link-button"
26895
- }, " *")), /*#__PURE__*/React.createElement("div", {
27163
+ }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27164
+ style: {
27165
+ margin: 0
27166
+ },
27167
+ label: getTrans("WS_INIT_METER_READING", "Initial Meter Reading"),
27168
+ isMandatory: true,
27169
+ infoText: t("WS_INIT_METER_READING_INFO_MSG", "Enter the initial reading shown on the meter dial")
27170
+ }), /*#__PURE__*/React.createElement("div", {
26896
27171
  className: "field"
26897
27172
  }, /*#__PURE__*/React.createElement(TextInput, {
26898
- value: activationDetails.meterInitialReading || "0",
26899
- disabled: true,
26900
- disable: true,
26901
- placeholder: `${t(`WS_INIT_METER_READING_PLACEHOLDER`)}`,
27173
+ type: "text",
27174
+ value: activationDetails.meterInitialReading !== undefined ? activationDetails.meterInitialReading : "0",
27175
+ placeholder: getTrans("WS_INIT_METER_READING_PLACEHOLDER", "0"),
26902
27176
  onChange: ev => {
26903
27177
  setActivationDetails({
26904
27178
  ...activationDetails,
26905
- meterInitialReading: "0"
27179
+ meterInitialReading: ev.target.value
26906
27180
  });
26907
27181
  }
26908
- }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t(`WS_CONN_EXEC_DATE`)}`, /*#__PURE__*/React.createElement("span", {
26909
- className: "check-page-link-button"
26910
- }, " *")), /*#__PURE__*/React.createElement("div", {
27182
+ }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27183
+ style: {
27184
+ margin: 0
27185
+ },
27186
+ label: getTrans("WS_CONN_EXEC_DATE", "Connection Date"),
27187
+ isMandatory: true,
27188
+ infoText: t("WS_CONN_EXEC_DATE_INFO_MSG", "Select the date when connection was activated/executed")
27189
+ }), /*#__PURE__*/React.createElement("div", {
26911
27190
  className: "field"
26912
27191
  }, /*#__PURE__*/React.createElement(DatePicker, {
26913
27192
  date: activationDetails.connectionExecutionDate,
26914
- placeholder: `${t(`WS_CONN_EXEC_DATE_PLACEHOLDER`)}`,
27193
+ placeholder: getTrans("WS_CONN_EXEC_DATE_PLACEHOLDER", "DD/MM/YYYY"),
26915
27194
  onChange: date => {
26916
27195
  setActivationDetails({
26917
27196
  ...activationDetails,
@@ -27553,9 +27832,11 @@ const ConnectionDetails = _props => {
27553
27832
  defaultOpen: true
27554
27833
  }, /*#__PURE__*/React.createElement("div", {
27555
27834
  className: "formcomposer-section-grid"
27556
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Service Type")}`, /*#__PURE__*/React.createElement("span", {
27557
- className: "check-page-link-button"
27558
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
27835
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27836
+ label: t("Service Type"),
27837
+ isMandatory: true,
27838
+ infoText: t("WS_SERVICE_TYPE_INFO_MSG", "Select Service Type")
27839
+ }), /*#__PURE__*/React.createElement(Controller, {
27559
27840
  control: control,
27560
27841
  name: "serviceType",
27561
27842
  defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.serviceType) || "",
@@ -27576,9 +27857,11 @@ const ConnectionDetails = _props => {
27576
27857
  onBlur: props.onBlur,
27577
27858
  t: t
27578
27859
  })
27579
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Applicant Type")}`, /*#__PURE__*/React.createElement("span", {
27580
- className: "check-page-link-button"
27581
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
27860
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27861
+ label: t("Applicant Type"),
27862
+ isMandatory: true,
27863
+ infoText: t("WS_APPLICANT_TYPE_INFO_MSG", "Select Applicant Type")
27864
+ }), /*#__PURE__*/React.createElement(Controller, {
27582
27865
  control: control,
27583
27866
  name: "applicantType",
27584
27867
  defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.applicantType) || "",
@@ -27603,9 +27886,11 @@ const ConnectionDetails = _props => {
27603
27886
  placeholder: t("Select Applicant Type")
27604
27887
  });
27605
27888
  }
27606
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_Billing_Address_Type"), /*#__PURE__*/React.createElement("span", {
27607
- className: "check-page-link-button"
27608
- }, "*")), /*#__PURE__*/React.createElement("div", {
27889
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27890
+ label: t("WS_Billing_Address_Type"),
27891
+ isMandatory: true,
27892
+ infoText: t("WS_BILLING_ADDRESS_TYPE_INFO_MSG", "Enter or verify Billing Address")
27893
+ }), /*#__PURE__*/React.createElement("div", {
27609
27894
  className: "field"
27610
27895
  }, /*#__PURE__*/React.createElement(Controller, {
27611
27896
  control: control,
@@ -27691,9 +27976,11 @@ const ConnectionDetails = _props => {
27691
27976
  defaultOpen: true
27692
27977
  }, /*#__PURE__*/React.createElement("div", {
27693
27978
  className: "formcomposer-section-grid"
27694
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Name")}`, /*#__PURE__*/React.createElement("span", {
27695
- className: "check-page-link-button"
27696
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
27979
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
27980
+ label: t("Name"),
27981
+ isMandatory: true,
27982
+ infoText: t("WS_AUTH_REP_NAME_INFO_MSG", "Enter Authorized Representative Name")
27983
+ }), /*#__PURE__*/React.createElement(Controller, {
27697
27984
  control: control,
27698
27985
  name: "authorizedRepresentativeName",
27699
27986
  defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.authorizedRepresentativeName) || "",
@@ -27726,9 +28013,11 @@ const ConnectionDetails = _props => {
27726
28013
  }
27727
28014
  }, errors.authorizedRepresentativeName.message));
27728
28015
  }
27729
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("Designation")}`, /*#__PURE__*/React.createElement("span", {
27730
- className: "check-page-link-button"
27731
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
28016
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
28017
+ label: t("Designation"),
28018
+ isMandatory: true,
28019
+ infoText: t("WS_AUTH_REP_DESIGNATION_INFO_MSG", "Enter Authorized Representative Designation")
28020
+ }), /*#__PURE__*/React.createElement(Controller, {
27732
28021
  control: control,
27733
28022
  name: "authorizedRepresentativeDesignation",
27734
28023
  defaultValue: (connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.authorizedRepresentativeDesignation) || "",
@@ -27761,9 +28050,11 @@ const ConnectionDetails = _props => {
27761
28050
  }
27762
28051
  }, errors.authorizedRepresentativeDesignation.message));
27763
28052
  }
27764
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CORE_COMMON_MOBILE_NUMBER")}`, /*#__PURE__*/React.createElement("span", {
27765
- className: "check-page-link-button"
27766
- }, "*")), /*#__PURE__*/React.createElement("div", {
28053
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
28054
+ label: t("CORE_COMMON_MOBILE_NUMBER"),
28055
+ isMandatory: true,
28056
+ infoText: t("WS_AUTH_REP_MOBILE_INFO_MSG", "Enter 10-digit Mobile Number")
28057
+ }), /*#__PURE__*/React.createElement("div", {
27767
28058
  className: "field"
27768
28059
  }, /*#__PURE__*/React.createElement(Controller, {
27769
28060
  control: control,
@@ -28667,9 +28958,11 @@ const ConnectionDetails$1 = _props => {
28667
28958
  defaultOpen: true
28668
28959
  }, !sameAsOwnerDetails ? /*#__PURE__*/React.createElement("div", {
28669
28960
  className: "formcomposer-section-grid"
28670
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_OWN_DETAIL_NAME")}`, " ", /*#__PURE__*/React.createElement("span", {
28671
- className: "check-page-link-button"
28672
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
28961
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
28962
+ label: t("WS_OWN_DETAIL_NAME"),
28963
+ isMandatory: true,
28964
+ infoText: t("CORE_COMMON_FIRST_NAME_INFO_MSG", "Enter First Name")
28965
+ }), /*#__PURE__*/React.createElement(Controller, {
28673
28966
  control: control,
28674
28967
  name: "name",
28675
28968
  defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.name,
@@ -28724,7 +29017,11 @@ const ConnectionDetails$1 = _props => {
28724
29017
  }
28725
29018
  })), localFormState.touched.name && (errors === null || errors === void 0 ? void 0 : (_errors$name2 = errors.name) === null || _errors$name2 === void 0 ? void 0 : _errors$name2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
28726
29019
  style: errorStyle
28727
- }, errors === null || errors === void 0 ? void 0 : (_errors$name3 = errors.name) === null || _errors$name3 === void 0 ? void 0 : _errors$name3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_OWN_DETAIL_MIDDLE_NAME")}`), /*#__PURE__*/React.createElement(Controller, {
29020
+ }, errors === null || errors === void 0 ? void 0 : (_errors$name3 = errors.name) === null || _errors$name3 === void 0 ? void 0 : _errors$name3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29021
+ label: t("WS_OWN_DETAIL_MIDDLE_NAME"),
29022
+ isMandatory: false,
29023
+ infoText: t("CORE_COMMON_MIDDLE_NAME_INFO_MSG", "Enter Middle Name (Optional)")
29024
+ }), /*#__PURE__*/React.createElement(Controller, {
28728
29025
  control: control,
28729
29026
  name: "middleName",
28730
29027
  defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.middleName,
@@ -28756,7 +29053,11 @@ const ConnectionDetails$1 = _props => {
28756
29053
  }
28757
29054
  })), localFormState.touched.middleName && (errors === null || errors === void 0 ? void 0 : (_errors$middleName2 = errors.middleName) === null || _errors$middleName2 === void 0 ? void 0 : _errors$middleName2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
28758
29055
  style: errorStyle
28759
- }, errors === null || errors === void 0 ? void 0 : (_errors$middleName3 = errors.middleName) === null || _errors$middleName3 === void 0 ? void 0 : _errors$middleName3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_OWN_DETAIL_LAST_NAME")}`), /*#__PURE__*/React.createElement(Controller, {
29056
+ }, errors === null || errors === void 0 ? void 0 : (_errors$middleName3 = errors.middleName) === null || _errors$middleName3 === void 0 ? void 0 : _errors$middleName3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29057
+ label: t("WS_OWN_DETAIL_LAST_NAME"),
29058
+ isMandatory: false,
29059
+ infoText: t("CORE_COMMON_LAST_NAME_INFO_MSG", "Enter Last Name")
29060
+ }), /*#__PURE__*/React.createElement(Controller, {
28760
29061
  control: control,
28761
29062
  name: "lastName",
28762
29063
  defaultValue: connectionHolderDetail === null || connectionHolderDetail === void 0 ? void 0 : connectionHolderDetail.lastName,
@@ -28788,9 +29089,11 @@ const ConnectionDetails$1 = _props => {
28788
29089
  }
28789
29090
  })), localFormState.touched.lastName && (errors === null || errors === void 0 ? void 0 : (_errors$lastName2 = errors.lastName) === null || _errors$lastName2 === void 0 ? void 0 : _errors$lastName2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
28790
29091
  style: errorStyle
28791
- }, errors === null || errors === void 0 ? void 0 : (_errors$lastName3 = errors.lastName) === null || _errors$lastName3 === void 0 ? void 0 : _errors$lastName3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_CONN_HOLDER_OWN_DETAIL_GENDER_LABEL")}`, " ", /*#__PURE__*/React.createElement("span", {
28792
- className: "check-page-link-button"
28793
- }, "*")), /*#__PURE__*/React.createElement("div", {
29092
+ }, errors === null || errors === void 0 ? void 0 : (_errors$lastName3 = errors.lastName) === null || _errors$lastName3 === void 0 ? void 0 : _errors$lastName3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29093
+ label: t("WS_CONN_HOLDER_OWN_DETAIL_GENDER_LABEL"),
29094
+ isMandatory: true,
29095
+ infoText: t("WS_GENDER_INFO_MSG", "Select Gender")
29096
+ }), /*#__PURE__*/React.createElement("div", {
28794
29097
  className: "field"
28795
29098
  }, /*#__PURE__*/React.createElement(Controller, {
28796
29099
  control: control,
@@ -28846,9 +29149,11 @@ const ConnectionDetails$1 = _props => {
28846
29149
  }
28847
29150
  }))), localFormState.touched.gender && (errors === null || errors === void 0 ? void 0 : (_errors$gender2 = errors.gender) === null || _errors$gender2 === void 0 ? void 0 : _errors$gender2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
28848
29151
  style: errorStyle
28849
- }, errors === null || errors === void 0 ? void 0 : (_errors$gender3 = errors.gender) === null || _errors$gender3 === void 0 ? void 0 : _errors$gender3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CORE_COMMON_MOBILE_NUMBER")}`, " ", /*#__PURE__*/React.createElement("span", {
28850
- className: "check-page-link-button"
28851
- }, "*")), /*#__PURE__*/React.createElement("div", {
29152
+ }, errors === null || errors === void 0 ? void 0 : (_errors$gender3 = errors.gender) === null || _errors$gender3 === void 0 ? void 0 : _errors$gender3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29153
+ label: t("CORE_COMMON_MOBILE_NUMBER"),
29154
+ isMandatory: true,
29155
+ infoText: t("PT_MOBILE_NUMBER_INFO_MSG", "Enter 10 digit Mobile Number")
29156
+ }), /*#__PURE__*/React.createElement("div", {
28852
29157
  className: "field"
28853
29158
  }, /*#__PURE__*/React.createElement(Controller, {
28854
29159
  control: control,
@@ -28917,9 +29222,11 @@ const ConnectionDetails$1 = _props => {
28917
29222
  }
28918
29223
  }))), localFormState.touched.mobileNumber && (errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber2 = errors.mobileNumber) === null || _errors$mobileNumber2 === void 0 ? void 0 : _errors$mobileNumber2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
28919
29224
  style: errorStyle
28920
- }, errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber3 = errors.mobileNumber) === null || _errors$mobileNumber3 === void 0 ? void 0 : _errors$mobileNumber3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CORE_COMMON_WHATSAPP_MOBILE_NUMBER")}`, /*#__PURE__*/React.createElement("span", {
28921
- className: "check-page-link-button"
28922
- }, "*")), /*#__PURE__*/React.createElement("div", {
29225
+ }, errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber3 = errors.mobileNumber) === null || _errors$mobileNumber3 === void 0 ? void 0 : _errors$mobileNumber3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29226
+ label: t("CORE_COMMON_WHATSAPP_MOBILE_NUMBER"),
29227
+ isMandatory: true,
29228
+ infoText: t("WS_WHATSAPP_MOBILE_NUMBER_INFO_MSG", "Enter 10 digit WhatsApp or Alternate Mobile Number")
29229
+ }), /*#__PURE__*/React.createElement("div", {
28923
29230
  className: "field"
28924
29231
  }, /*#__PURE__*/React.createElement(Controller, {
28925
29232
  control: control,
@@ -29022,7 +29329,11 @@ const ConnectionDetails$1 = _props => {
29022
29329
  }
29023
29330
  })))), localFormState.touched.watsAppMobileNumber && (errors === null || errors === void 0 ? void 0 : (_errors$watsAppMobile2 = errors.watsAppMobileNumber) === null || _errors$watsAppMobile2 === void 0 ? void 0 : _errors$watsAppMobile2.message) && /*#__PURE__*/React.createElement(CardLabelError, {
29024
29331
  style: errorStyle
29025
- }, errors === null || errors === void 0 ? void 0 : (_errors$watsAppMobile3 = errors.watsAppMobileNumber) === null || _errors$watsAppMobile3 === void 0 ? void 0 : _errors$watsAppMobile3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_EMAIL_ID")}`), /*#__PURE__*/React.createElement("div", {
29332
+ }, errors === null || errors === void 0 ? void 0 : (_errors$watsAppMobile3 = errors.watsAppMobileNumber) === null || _errors$watsAppMobile3 === void 0 ? void 0 : _errors$watsAppMobile3.message)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29333
+ label: t("WS_EMAIL_ID"),
29334
+ isMandatory: false,
29335
+ infoText: t("CORE_COMMON_EMAIL_INFO_MSG", "Enter Email Address")
29336
+ }), /*#__PURE__*/React.createElement("div", {
29026
29337
  className: "field"
29027
29338
  }, /*#__PURE__*/React.createElement(Controller, {
29028
29339
  control: control,
@@ -29314,20 +29625,26 @@ const ConnectionDetails$2 = _props => {
29314
29625
  fontSize: "12px",
29315
29626
  marginTop: "-21px"
29316
29627
  };
29317
- return /*#__PURE__*/React.createElement(React.Fragment, null, !window.location.href.includes("by-config") && !window.location.href.includes("ws/modify-application") ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_ACK_COMMON_APP_NO_LABEL"), " ", /*#__PURE__*/React.createElement("span", {
29628
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !window.location.href.includes("by-config") && !window.location.href.includes("ws/modify-application") ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29318
29629
  style: {
29319
- color: "red"
29320
- }
29321
- }, "*")), /*#__PURE__*/React.createElement("div", {
29630
+ margin: 0
29631
+ },
29632
+ label: t("WS_ACK_COMMON_APP_NO_LABEL") || "Application Number",
29633
+ isMandatory: true,
29634
+ infoText: t("WS_APP_NO_INFO_MSG", "Application Number of the connection")
29635
+ }), /*#__PURE__*/React.createElement("div", {
29322
29636
  className: "field"
29323
29637
  }, /*#__PURE__*/React.createElement(TextInput, {
29324
29638
  disabled: true,
29325
29639
  value: filters === null || filters === void 0 ? void 0 : filters.applicationNumber
29326
- }))) : null, (filters === null || filters === void 0 ? void 0 : filters.service) === "WATER" ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_SERV_DETAIL_CONN_TYPE"), " ", /*#__PURE__*/React.createElement("span", {
29640
+ }))) : null, (filters === null || filters === void 0 ? void 0 : filters.service) === "WATER" ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29327
29641
  style: {
29328
- color: "red"
29329
- }
29330
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
29642
+ margin: 0
29643
+ },
29644
+ label: t("WS_SERV_DETAIL_CONN_TYPE") || "Nature of Connection",
29645
+ isMandatory: true,
29646
+ infoText: t("WS_CONN_TYPE_INFO_MSG", "Nature / Type of Connection (Metered / Non-Metered)")
29647
+ }), /*#__PURE__*/React.createElement(Controller, {
29331
29648
  control: control,
29332
29649
  name: "connectionType",
29333
29650
  defaultValue: connectionDetail === null || connectionDetail === void 0 ? void 0 : connectionDetail.connectionType,
@@ -29353,11 +29670,14 @@ const ConnectionDetails$2 = _props => {
29353
29670
  }
29354
29671
  }), localFormState.touched.connectionType && errors !== null && errors !== void 0 && (_errors$connectionTyp2 = errors.connectionType) !== null && _errors$connectionTyp2 !== void 0 && _errors$connectionTyp2.message ? /*#__PURE__*/React.createElement(CardLabelError, {
29355
29672
  style: errorStyle
29356
- }, " ", errors === null || errors === void 0 ? void 0 : (_errors$connectionTyp3 = errors.connectionType) === null || _errors$connectionTyp3 === void 0 ? void 0 : _errors$connectionTyp3.message) : null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NUMBER_WATER_CLOSETS_LABEL"), " ", /*#__PURE__*/React.createElement("span", {
29673
+ }, " ", errors === null || errors === void 0 ? void 0 : (_errors$connectionTyp3 = errors.connectionType) === null || _errors$connectionTyp3 === void 0 ? void 0 : _errors$connectionTyp3.message) : null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29357
29674
  style: {
29358
- color: "red"
29359
- }
29360
- }, "*")), /*#__PURE__*/React.createElement("div", {
29675
+ margin: 0
29676
+ },
29677
+ label: t("WS_NUMBER_WATER_CLOSETS_LABEL") || "Number of Water Closets",
29678
+ isMandatory: true,
29679
+ infoText: t("WS_NUMBER_WATER_CLOSETS_INFO_MSG", "Enter number of water closets")
29680
+ }), /*#__PURE__*/React.createElement("div", {
29361
29681
  className: "field"
29362
29682
  }, /*#__PURE__*/React.createElement(Controller, {
29363
29683
  control: control,
@@ -29391,11 +29711,14 @@ const ConnectionDetails$2 = _props => {
29391
29711
  }
29392
29712
  })), localFormState.touched.noOfWaterClosets && errors !== null && errors !== void 0 && (_errors$noOfWaterClos2 = errors.noOfWaterClosets) !== null && _errors$noOfWaterClos2 !== void 0 && _errors$noOfWaterClos2.message ? /*#__PURE__*/React.createElement(CardLabelError, {
29393
29713
  style: errorStyle
29394
- }, " ", errors === null || errors === void 0 ? void 0 : (_errors$noOfWaterClos3 = errors.noOfWaterClosets) === null || _errors$noOfWaterClos3 === void 0 ? void 0 : _errors$noOfWaterClos3.message) : null), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_SERV_DETAIL_NO_OF_TOILETS"), " ", /*#__PURE__*/React.createElement("span", {
29714
+ }, " ", errors === null || errors === void 0 ? void 0 : (_errors$noOfWaterClos3 = errors.noOfWaterClosets) === null || _errors$noOfWaterClos3 === void 0 ? void 0 : _errors$noOfWaterClos3.message) : null), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29395
29715
  style: {
29396
- color: "red"
29397
- }
29398
- }, "*")), /*#__PURE__*/React.createElement("div", {
29716
+ margin: 0
29717
+ },
29718
+ label: t("WS_SERV_DETAIL_NO_OF_TOILETS") || "Number of Toilets",
29719
+ isMandatory: true,
29720
+ infoText: t("WS_SERV_DETAIL_NO_OF_TOILETS_INFO_MSG", "Enter number of toilets")
29721
+ }), /*#__PURE__*/React.createElement("div", {
29399
29722
  className: "field"
29400
29723
  }, /*#__PURE__*/React.createElement(Controller, {
29401
29724
  control: control,
@@ -29432,14 +29755,40 @@ const ConnectionDetails$2 = _props => {
29432
29755
  }, " ", errors === null || errors === void 0 ? void 0 : (_errors$noOfToilets3 = errors.noOfToilets) === null || _errors$noOfToilets3 === void 0 ? void 0 : _errors$noOfToilets3.message) : null)));
29433
29756
  };
29434
29757
 
29435
- const createPlumberDetails = () => ({
29436
- plumberName: "",
29437
- plumberMobileNo: "",
29438
- plumberLicenseNo: "",
29439
- detailsProvidedBy: ""
29440
- });
29758
+ const options = [{
29759
+ name: "Self",
29760
+ code: "Self",
29761
+ i18nKey: "WS_PLUMBER_SELF"
29762
+ }, {
29763
+ name: "Delhi Jal Board",
29764
+ code: "DJB",
29765
+ i18nKey: "WS_PLUMBER_DJB"
29766
+ }];
29767
+ const getAppPlumberInfo = formData => {
29768
+ var _formData$formDetails, _formData$formDetails2, _formData$formDetails3, _formData$connectionD, _formData$connectionD2, _formData$connectionD3, _formData$connectionD4, _formData$connectionD5, _formData$plumberInfo;
29769
+ return (formData === null || formData === void 0 ? void 0 : (_formData$formDetails = formData.formDetails) === null || _formData$formDetails === void 0 ? void 0 : (_formData$formDetails2 = _formData$formDetails.applicationData) === null || _formData$formDetails2 === void 0 ? void 0 : (_formData$formDetails3 = _formData$formDetails2.plumberInfo) === null || _formData$formDetails3 === void 0 ? void 0 : _formData$formDetails3[0]) || (formData === null || formData === void 0 ? void 0 : (_formData$connectionD = formData.connectionDetails) === null || _formData$connectionD === void 0 ? void 0 : (_formData$connectionD2 = _formData$connectionD[0]) === null || _formData$connectionD2 === void 0 ? void 0 : (_formData$connectionD3 = _formData$connectionD2.formDetails) === null || _formData$connectionD3 === void 0 ? void 0 : (_formData$connectionD4 = _formData$connectionD3.applicationData) === null || _formData$connectionD4 === void 0 ? void 0 : (_formData$connectionD5 = _formData$connectionD4.plumberInfo) === null || _formData$connectionD5 === void 0 ? void 0 : _formData$connectionD5[0]) || (formData === null || formData === void 0 ? void 0 : (_formData$plumberInfo = formData.plumberInfo) === null || _formData$plumberInfo === void 0 ? void 0 : _formData$plumberInfo[0]) || null;
29770
+ };
29771
+ const createPlumberDetails = formData => {
29772
+ var _formData$formDetails4, _formData$formDetails5, _formData$formDetails6, _formData$additionalD, _formData$formDetails7, _formData$formDetails8, _formData$formDetails9, _formData$formDetails0, _formData$formDetails1, _formData$formDetails10;
29773
+ const appPlumber = getAppPlumberInfo(formData);
29774
+ const existingPref = (formData === null || formData === void 0 ? void 0 : (_formData$formDetails4 = formData.formDetails) === null || _formData$formDetails4 === void 0 ? void 0 : (_formData$formDetails5 = _formData$formDetails4.applicationData) === null || _formData$formDetails5 === void 0 ? void 0 : (_formData$formDetails6 = _formData$formDetails5.additionalDetails) === null || _formData$formDetails6 === void 0 ? void 0 : _formData$formDetails6.detailsProvidedBy) || (formData === null || formData === void 0 ? void 0 : (_formData$additionalD = formData.additionalDetails) === null || _formData$additionalD === void 0 ? void 0 : _formData$additionalD.detailsProvidedBy);
29775
+ let defaultPref = null;
29776
+ if (existingPref === "DJB" || existingPref === "ULB" || existingPref === "Delhi Jal Board") {
29777
+ defaultPref = options[1];
29778
+ } else if (existingPref === "Self" || appPlumber !== null && appPlumber !== void 0 && appPlumber.name) {
29779
+ defaultPref = options[0];
29780
+ }
29781
+ return {
29782
+ detailsProvidedBy: defaultPref,
29783
+ plumberName: (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.name) || "",
29784
+ plumberMobileNo: (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.mobileNumber) || "",
29785
+ plumberLicenseNo: (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.licenseNo) || "",
29786
+ jeOrFirmName: (formData === null || formData === void 0 ? void 0 : (_formData$formDetails7 = formData.formDetails) === null || _formData$formDetails7 === void 0 ? void 0 : (_formData$formDetails8 = _formData$formDetails7.applicationData) === null || _formData$formDetails8 === void 0 ? void 0 : (_formData$formDetails9 = _formData$formDetails8.additionalDetails) === null || _formData$formDetails9 === void 0 ? void 0 : _formData$formDetails9.nameOfJEOrFirm) || (formData === null || formData === void 0 ? void 0 : (_formData$formDetails0 = formData.formDetails) === null || _formData$formDetails0 === void 0 ? void 0 : (_formData$formDetails1 = _formData$formDetails0.applicationData) === null || _formData$formDetails1 === void 0 ? void 0 : (_formData$formDetails10 = _formData$formDetails1.additionalDetails) === null || _formData$formDetails10 === void 0 ? void 0 : _formData$formDetails10.jeOrFirmName) || "",
29787
+ key: Date.now()
29788
+ };
29789
+ };
29441
29790
  const WSActivationPlumberDetails = _ref => {
29442
- var _formData$plumberDeta, _formData$connectionD, _formData$connectionD2;
29791
+ var _formData$connectionD6, _formData$connectionD7;
29443
29792
  let {
29444
29793
  config,
29445
29794
  onSelect,
@@ -29453,19 +29802,18 @@ const WSActivationPlumberDetails = _ref => {
29453
29802
  t
29454
29803
  } = useTranslation();
29455
29804
  const filters = getQueryStringParams(location.search);
29456
- const [plumberDetails, setPlumberDetails] = useState((formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta = formData.plumberDetails) === null || _formData$plumberDeta === void 0 ? void 0 : _formData$plumberDeta.length) > 0 ? formData === null || formData === void 0 ? void 0 : formData.plumberDetails : [createPlumberDetails()]);
29805
+ const [plumberDetails, setPlumberDetails] = useState(() => {
29806
+ var _formData$plumberDeta;
29807
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta = formData.plumberDetails) === null || _formData$plumberDeta === void 0 ? void 0 : _formData$plumberDeta.length) > 0) {
29808
+ return formData.plumberDetails;
29809
+ }
29810
+ return [createPlumberDetails(formData)];
29811
+ });
29457
29812
  const [focusIndex, setFocusIndex] = useState({
29458
29813
  index: -1,
29459
29814
  type: ""
29460
29815
  });
29461
29816
  const [isErrors, setIsErrors] = useState(true);
29462
- const options = [{
29463
- i18nKey: "WS_PLUMBER_ULB",
29464
- code: "ULB"
29465
- }, {
29466
- i18nKey: "WS_PLUMBER_SELF",
29467
- code: "Self"
29468
- }];
29469
29817
  useEffect(() => {
29470
29818
  const data = plumberDetails.length && plumberDetails.map(e => {
29471
29819
  return e;
@@ -29473,7 +29821,7 @@ const WSActivationPlumberDetails = _ref => {
29473
29821
  if (data && !lodash.isEqual(formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key], data)) {
29474
29822
  onSelect(config === null || config === void 0 ? void 0 : config.key, data);
29475
29823
  }
29476
- }, [plumberDetails, formData === null || formData === void 0 ? void 0 : (_formData$connectionD = formData.connectionDetails) === null || _formData$connectionD === void 0 ? void 0 : (_formData$connectionD2 = _formData$connectionD[0]) === null || _formData$connectionD2 === void 0 ? void 0 : _formData$connectionD2.connectionType, config === null || config === void 0 ? void 0 : config.key]);
29824
+ }, [plumberDetails, formData === null || formData === void 0 ? void 0 : (_formData$connectionD6 = formData.connectionDetails) === null || _formData$connectionD6 === void 0 ? void 0 : (_formData$connectionD7 = _formData$connectionD6[0]) === null || _formData$connectionD7 === void 0 ? void 0 : _formData$connectionD7.connectionType, config === null || config === void 0 ? void 0 : config.key]);
29477
29825
  const commonProps = {
29478
29826
  focusIndex,
29479
29827
  allOwners: plumberDetails,
@@ -29489,8 +29837,7 @@ const WSActivationPlumberDetails = _ref => {
29489
29837
  isErrors,
29490
29838
  plumberDetails,
29491
29839
  filters,
29492
- options,
29493
- setPlumberDetails
29840
+ options
29494
29841
  };
29495
29842
  return /*#__PURE__*/React.createElement(React.Fragment, null, (plumberDetails === null || plumberDetails === void 0 ? void 0 : plumberDetails.length) && plumberDetails.map((plumberDetail, index) => /*#__PURE__*/React.createElement(PlumberDetails, _extends({
29496
29843
  key: plumberDetail.key || index,
@@ -29499,7 +29846,7 @@ const WSActivationPlumberDetails = _ref => {
29499
29846
  }, commonProps))));
29500
29847
  };
29501
29848
  const PlumberDetails = _props => {
29502
- var _plumberDetails$, _formData$disConnecti, _errors$detailsProvid2, _errors$detailsProvid3, _plumberDetail$detail, _plumberDetail$detail2, _errors$plumberLicens2, _errors$plumberLicens3, _errors$plumberName2, _errors$plumberName3, _errors$plumberMobile2, _errors$plumberMobile3;
29849
+ var _plumberDetail$detail, _plumberDetail$detail2, _plumberDetail$detail3, _plumberDetail$detail4, _formValue$detailsPro, _plumberDetail$detail5, _formValue$detailsPro2, _errors$detailsProvid2, _errors$detailsProvid3, _errors$jeOrFirmName2, _errors$jeOrFirmName3, _errors$plumberName2, _errors$plumberName3, _errors$plumberLicens2, _errors$plumberLicens3, _errors$plumberMobile2, _errors$plumberMobile3;
29503
29850
  const {
29504
29851
  plumberDetail,
29505
29852
  index,
@@ -29520,6 +29867,12 @@ const PlumberDetails = _props => {
29520
29867
  options,
29521
29868
  setPlumberDetails
29522
29869
  } = _props;
29870
+ const getTrans = (key, defaultVal) => {
29871
+ const val = t(key);
29872
+ return val && val !== key ? val : defaultVal;
29873
+ };
29874
+ const appPlumber = getAppPlumberInfo(formData);
29875
+ const initialPref = (plumberDetail === null || plumberDetail === void 0 ? void 0 : (_plumberDetail$detail = plumberDetail.detailsProvidedBy) === null || _plumberDetail$detail === void 0 ? void 0 : _plumberDetail$detail.code) === "DJB" || (plumberDetail === null || plumberDetail === void 0 ? void 0 : (_plumberDetail$detail2 = plumberDetail.detailsProvidedBy) === null || _plumberDetail$detail2 === void 0 ? void 0 : _plumberDetail$detail2.code) === "ULB" || (plumberDetail === null || plumberDetail === void 0 ? void 0 : (_plumberDetail$detail3 = plumberDetail.detailsProvidedBy) === null || _plumberDetail$detail3 === void 0 ? void 0 : _plumberDetail$detail3.name) === "Delhi Jal Board" ? options[1] : (plumberDetail === null || plumberDetail === void 0 ? void 0 : (_plumberDetail$detail4 = plumberDetail.detailsProvidedBy) === null || _plumberDetail$detail4 === void 0 ? void 0 : _plumberDetail$detail4.code) === "Self" || appPlumber !== null && appPlumber !== void 0 && appPlumber.name ? options[0] : (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.detailsProvidedBy) || null;
29523
29876
  const {
29524
29877
  control,
29525
29878
  formState: localFormState,
@@ -29529,42 +29882,49 @@ const PlumberDetails = _props => {
29529
29882
  setValue,
29530
29883
  trigger,
29531
29884
  getValues
29532
- } = useForm();
29885
+ } = useForm({
29886
+ defaultValues: {
29887
+ detailsProvidedBy: initialPref,
29888
+ plumberName: (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.plumberName) || (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.name) || "",
29889
+ plumberLicenseNo: (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.plumberLicenseNo) || (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.licenseNo) || "",
29890
+ plumberMobileNo: (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.plumberMobileNo) || (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.mobileNumber) || "",
29891
+ jeOrFirmName: (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.jeOrFirmName) || ""
29892
+ }
29893
+ });
29533
29894
  const formValue = watch();
29534
29895
  const {
29535
29896
  errors
29536
29897
  } = localFormState;
29537
29898
  const isMobile = window.Digit.Utils.browser.isMobile();
29538
29899
  let isEmployee = window.location.href.includes("/employee");
29900
+ const currentPref = (formValue === null || formValue === void 0 ? void 0 : (_formValue$detailsPro = formValue.detailsProvidedBy) === null || _formValue$detailsPro === void 0 ? void 0 : _formValue$detailsPro.code) || (plumberDetail === null || plumberDetail === void 0 ? void 0 : (_plumberDetail$detail5 = plumberDetail.detailsProvidedBy) === null || _plumberDetail$detail5 === void 0 ? void 0 : _plumberDetail$detail5.code);
29901
+ const isDJB = currentPref === "DJB" || currentPref === "ULB" || (formValue === null || formValue === void 0 ? void 0 : (_formValue$detailsPro2 = formValue.detailsProvidedBy) === null || _formValue$detailsPro2 === void 0 ? void 0 : _formValue$detailsPro2.name) === "Delhi Jal Board";
29902
+ const isSelf = currentPref === "Self";
29539
29903
  useEffect(() => {
29540
29904
  trigger();
29541
29905
  }, []);
29542
29906
  useEffect(() => {
29907
+ if (isDJB) {
29908
+ clearLocalErrors(["plumberName", "plumberLicenseNo", "plumberMobileNo"]);
29909
+ } else if (isSelf) {
29910
+ clearLocalErrors(["jeOrFirmName"]);
29911
+ }
29543
29912
  trigger();
29544
- }, [plumberDetails === null || plumberDetails === void 0 ? void 0 : (_plumberDetails$ = plumberDetails[0]) === null || _plumberDetails$ === void 0 ? void 0 : _plumberDetails$.detailsProvidedBy, formData === null || formData === void 0 ? void 0 : (_formData$disConnecti = formData.disConnectionDetails) === null || _formData$disConnecti === void 0 ? void 0 : _formData$disConnecti[0]]);
29913
+ }, [currentPref]);
29545
29914
  useEffect(() => {
29546
29915
  if (Object.entries(formValue).length > 0) {
29547
29916
  const keys = Object.keys(formValue);
29548
29917
  const part = {};
29549
29918
  keys.forEach(key => part[key] = plumberDetail[key]);
29550
- let plumbermobileCheck = window.location.href.includes("ws/config-by-disconnection-application") ? (formValue === null || formValue === void 0 ? void 0 : formValue.plumberMobileNo) !== undefined && (part === null || part === void 0 ? void 0 : part.plumberMobileNo) : true;
29551
- if (!lodash.isEqual(formValue, part) && plumbermobileCheck) {
29552
- let isErrorsFound = true;
29553
- Object.keys(formValue).map(data => {
29554
- if (!formValue[data] && isErrorsFound) {
29555
- isErrorsFound = false;
29556
- setIsErrors(true);
29557
- }
29558
- });
29559
- if (isErrorsFound) setIsErrors(false);
29919
+ if (!lodash.isEqual(formValue, part)) {
29560
29920
  let ob = [{
29921
+ ...plumberDetail,
29561
29922
  ...formValue
29562
29923
  }];
29563
29924
  setPlumberDetails(ob);
29564
- trigger();
29565
29925
  }
29566
29926
  }
29567
- }, [formValue, plumberDetails]);
29927
+ }, [formValue]);
29568
29928
  useEffect(() => {
29569
29929
  var _formState$errors$con;
29570
29930
  if (Object.keys(errors).length && !lodash.isEqual(((_formState$errors$con = formState.errors[config.key]) === null || _formState$errors$con === void 0 ? void 0 : _formState$errors$con.type) || {}, errors)) {
@@ -29581,102 +29941,127 @@ const PlumberDetails = _props => {
29581
29941
  fontSize: "12px",
29582
29942
  marginTop: "-21px"
29583
29943
  };
29584
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_ADDN_DETAILS_PLUMBER_PROVIDED_BY"), " ", /*#__PURE__*/React.createElement("span", {
29944
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29585
29945
  style: {
29586
- color: "red"
29587
- }
29588
- }, "*")), /*#__PURE__*/React.createElement(Controller, {
29946
+ margin: 0
29947
+ },
29948
+ label: getTrans("WS_ADDN_DETAILS_PLUMBER_PROVIDED_BY", "Plumber Provided By"),
29949
+ isMandatory: true,
29950
+ infoText: t("WS_PLUMBER_PROVIDED_BY_INFO_MSG", "Select whether plumber is Self or provided by Delhi Jal Board")
29951
+ }), /*#__PURE__*/React.createElement(Controller, {
29589
29952
  control: control,
29590
29953
  name: "detailsProvidedBy",
29591
- defaultValue: plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.detailsProvidedBy,
29954
+ defaultValue: initialPref,
29592
29955
  rules: {
29593
- required: t("REQUIRED_FIELD")
29956
+ required: getTrans("REQUIRED_FIELD", "Required")
29594
29957
  },
29595
29958
  isMandatory: true,
29596
29959
  render: props => {
29597
29960
  var _errors$detailsProvid;
29598
29961
  return /*#__PURE__*/React.createElement(Dropdown, {
29599
29962
  className: "form-field",
29600
- selected: getValues("detailsProvidedBy"),
29963
+ selected: props.value || getValues("detailsProvidedBy"),
29601
29964
  disable: false,
29602
29965
  option: options,
29603
- placeholder: `${t(`WS_ADDN_DETAILS_PLUMBER_PROVIDED_BY_PLACEHOLDER`)}`,
29966
+ placeholder: getTrans("WS_ADDN_DETAILS_PLUMBER_PROVIDED_BY_PLACEHOLDER", "Select plumber provided by"),
29604
29967
  errorStyle: localFormState.touched.detailsProvidedBy && errors !== null && errors !== void 0 && (_errors$detailsProvid = errors.detailsProvidedBy) !== null && _errors$detailsProvid !== void 0 && _errors$detailsProvid.message ? true : false,
29605
29968
  select: e => {
29606
- if (e.code == "ULB") {
29969
+ if (e.code === "DJB") {
29970
+ setValue("plumberName", "");
29971
+ setValue("plumberLicenseNo", "");
29972
+ setValue("plumberMobileNo", "");
29973
+ clearLocalErrors(["plumberName", "plumberLicenseNo", "plumberMobileNo"]);
29607
29974
  let obj = {
29608
29975
  ...(plumberDetails === null || plumberDetails === void 0 ? void 0 : plumberDetails[0]),
29609
29976
  detailsProvidedBy: e,
29610
29977
  plumberName: "",
29611
- plumberMobileNo: "",
29612
- plumberLicenseNo: ""
29978
+ plumberLicenseNo: "",
29979
+ plumberMobileNo: ""
29613
29980
  };
29614
29981
  setPlumberDetails([obj]);
29615
- } else {
29982
+ } else if (e.code === "Self") {
29983
+ setValue("jeOrFirmName", "");
29984
+ clearLocalErrors(["jeOrFirmName"]);
29985
+ const pName = (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.name) || getValues("plumberName") || "";
29986
+ const pLic = (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.licenseNo) || getValues("plumberLicenseNo") || "";
29987
+ const pMob = (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.mobileNumber) || getValues("plumberMobileNo") || "";
29988
+ if (pName) setValue("plumberName", pName);
29989
+ if (pLic) setValue("plumberLicenseNo", pLic);
29990
+ if (pMob) setValue("plumberMobileNo", pMob);
29616
29991
  let obj = {
29617
- detailsProvidedBy: e
29992
+ ...(plumberDetails === null || plumberDetails === void 0 ? void 0 : plumberDetails[0]),
29993
+ detailsProvidedBy: e,
29994
+ plumberName: pName,
29995
+ plumberLicenseNo: pLic,
29996
+ plumberMobileNo: pMob,
29997
+ jeOrFirmName: ""
29618
29998
  };
29619
29999
  setPlumberDetails([obj]);
29620
30000
  }
29621
30001
  props.onChange(e);
29622
30002
  },
29623
- optionKey: "i18nKey",
30003
+ optionKey: "name",
29624
30004
  onBlur: props.onBlur,
29625
30005
  t: t
29626
30006
  });
29627
30007
  }
29628
30008
  }), localFormState.touched.detailsProvidedBy && errors !== null && errors !== void 0 && (_errors$detailsProvid2 = errors.detailsProvidedBy) !== null && _errors$detailsProvid2 !== void 0 && _errors$detailsProvid2.message ? /*#__PURE__*/React.createElement(CardLabelError, {
29629
30009
  style: errorStyle
29630
- }, " ", errors === null || errors === void 0 ? void 0 : (_errors$detailsProvid3 = errors.detailsProvidedBy) === null || _errors$detailsProvid3 === void 0 ? void 0 : _errors$detailsProvid3.message) : null), !(plumberDetail !== null && plumberDetail !== void 0 && (_plumberDetail$detail = plumberDetail.detailsProvidedBy) !== null && _plumberDetail$detail !== void 0 && _plumberDetail$detail.code) || (plumberDetail === null || plumberDetail === void 0 ? void 0 : (_plumberDetail$detail2 = plumberDetail.detailsProvidedBy) === null || _plumberDetail$detail2 === void 0 ? void 0 : _plumberDetail$detail2.code) == "ULB" ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_PLIMBER_LICENSE_NO_LABEL"), " ", /*#__PURE__*/React.createElement("span", {
30010
+ }, " ", errors === null || errors === void 0 ? void 0 : (_errors$detailsProvid3 = errors.detailsProvidedBy) === null || _errors$detailsProvid3 === void 0 ? void 0 : _errors$detailsProvid3.message) : null), isDJB ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29631
30011
  style: {
29632
- color: "red"
29633
- }
29634
- }, "*")), /*#__PURE__*/React.createElement("div", {
30012
+ margin: 0
30013
+ },
30014
+ label: getTrans("WS_NAME_OF_JE_OR_FIRM", "Name of JE / Name of Firm"),
30015
+ isMandatory: true,
30016
+ infoText: t("WS_NAME_OF_JE_OR_FIRM_INFO_MSG", "Enter Name of JE or Name of Firm")
30017
+ }), /*#__PURE__*/React.createElement("div", {
29635
30018
  className: "field"
29636
30019
  }, /*#__PURE__*/React.createElement(Controller, {
29637
30020
  control: control,
29638
- name: "plumberLicenseNo",
29639
- defaultValue: plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.plumberLicenseNo,
30021
+ name: "jeOrFirmName",
30022
+ defaultValue: plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.jeOrFirmName,
29640
30023
  rules: {
29641
- validate: e => e && getPattern("WSOnlyNumbers").test(e) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG"),
29642
- required: t("REQUIRED_FIELD")
30024
+ required: getTrans("REQUIRED_FIELD", "Required")
29643
30025
  },
29644
30026
  isMandatory: true,
29645
30027
  render: props => {
29646
- var _errors$plumberLicens;
30028
+ var _errors$jeOrFirmName;
29647
30029
  return /*#__PURE__*/React.createElement(TextInput, {
29648
30030
  value: props.value,
29649
- autoFocus: focusIndex.index === (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.key) && focusIndex.type === "plumberLicenseNo",
29650
- errorStyle: localFormState.touched.plumberLicenseNo && errors !== null && errors !== void 0 && (_errors$plumberLicens = errors.plumberLicenseNo) !== null && _errors$plumberLicens !== void 0 && _errors$plumberLicens.message ? true : false,
30031
+ autoFocus: focusIndex.index === (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.key) && focusIndex.type === "jeOrFirmName",
30032
+ errorStyle: localFormState.touched.jeOrFirmName && errors !== null && errors !== void 0 && (_errors$jeOrFirmName = errors.jeOrFirmName) !== null && _errors$jeOrFirmName !== void 0 && _errors$jeOrFirmName.message ? true : false,
29651
30033
  onChange: e => {
29652
30034
  props.onChange(e.target.value);
29653
30035
  setFocusIndex({
29654
30036
  index: plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.key,
29655
- type: "plumberLicenseNo"
30037
+ type: "jeOrFirmName"
29656
30038
  });
29657
30039
  },
29658
30040
  labelStyle: {
29659
30041
  marginTop: "unset"
29660
30042
  },
29661
30043
  onBlur: props.onBlur,
29662
- placeholder: `${t(`WS_PLIMBER_LICENSE_NO_PLACEHOLDER`)}`
30044
+ placeholder: getTrans("WS_NAME_OF_JE_OR_FIRM_PLACEHOLDER", "Enter Name of JE / Name of Firm")
29663
30045
  });
29664
30046
  }
29665
- })), localFormState.touched.plumberLicenseNo && errors !== null && errors !== void 0 && (_errors$plumberLicens2 = errors.plumberLicenseNo) !== null && _errors$plumberLicens2 !== void 0 && _errors$plumberLicens2.message ? /*#__PURE__*/React.createElement(CardLabelError, {
30047
+ })), localFormState.touched.jeOrFirmName && errors !== null && errors !== void 0 && (_errors$jeOrFirmName2 = errors.jeOrFirmName) !== null && _errors$jeOrFirmName2 !== void 0 && _errors$jeOrFirmName2.message ? /*#__PURE__*/React.createElement(CardLabelError, {
29666
30048
  style: errorStyle
29667
- }, errors === null || errors === void 0 ? void 0 : (_errors$plumberLicens3 = errors.plumberLicenseNo) === null || _errors$plumberLicens3 === void 0 ? void 0 : _errors$plumberLicens3.message) : null), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_ADDN_DETAILS_PLUMBER_NAME_LABEL"), " ", /*#__PURE__*/React.createElement("span", {
30049
+ }, " ", errors === null || errors === void 0 ? void 0 : (_errors$jeOrFirmName3 = errors.jeOrFirmName) === null || _errors$jeOrFirmName3 === void 0 ? void 0 : _errors$jeOrFirmName3.message) : null) : null, isSelf || !currentPref ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29668
30050
  style: {
29669
- color: "red"
29670
- }
29671
- }, "*")), /*#__PURE__*/React.createElement("div", {
30051
+ margin: 0
30052
+ },
30053
+ label: getTrans("WS_ADDN_DETAILS_PLUMBER_NAME_LABEL", "Plumber Name"),
30054
+ isMandatory: true,
30055
+ infoText: t("WS_PLUMBER_NAME_INFO_MSG", "Enter Name of Plumber")
30056
+ }), /*#__PURE__*/React.createElement("div", {
29672
30057
  className: "field"
29673
30058
  }, /*#__PURE__*/React.createElement(Controller, {
29674
30059
  control: control,
29675
30060
  name: "plumberName",
29676
- defaultValue: plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.plumberName,
30061
+ defaultValue: (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.plumberName) || (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.name) || "",
29677
30062
  rules: {
29678
- validate: e => !e || !e.trim() ? t("REQUIRED_FIELD") : /^[a-zA-Z\s]{1,50}$/.test(e) ? true : t("WS_NAME_ERROR_MESSAGE") || t("PT_NAME_ERROR_MESSAGE") || "Only alphabets are allowed",
29679
- required: t("REQUIRED_FIELD")
30063
+ validate: e => !e || !e.trim() ? getTrans("REQUIRED_FIELD", "Required") : /^[a-zA-Z\s]{1,50}$/.test(e) ? true : getTrans("WS_NAME_ERROR_MESSAGE", "Only alphabets are allowed"),
30064
+ required: getTrans("REQUIRED_FIELD", "Required")
29680
30065
  },
29681
30066
  isMandatory: true,
29682
30067
  render: props => {
@@ -29698,34 +30083,76 @@ const PlumberDetails = _props => {
29698
30083
  marginTop: "unset"
29699
30084
  },
29700
30085
  onBlur: props.onBlur,
29701
- placeholder: `${t(`WS_ADDN_DETAILS_PLUMBER_NAME_PLACEHOLDER`)}`
30086
+ placeholder: getTrans("WS_ADDN_DETAILS_PLUMBER_NAME_PLACEHOLDER", "Enter Name of Plumber")
29702
30087
  });
29703
30088
  }
29704
30089
  })), localFormState.touched.plumberName && errors !== null && errors !== void 0 && (_errors$plumberName2 = errors.plumberName) !== null && _errors$plumberName2 !== void 0 && _errors$plumberName2.message ? /*#__PURE__*/React.createElement(CardLabelError, {
29705
30090
  style: errorStyle
29706
- }, " ", errors === null || errors === void 0 ? void 0 : (_errors$plumberName3 = errors.plumberName) === null || _errors$plumberName3 === void 0 ? void 0 : _errors$plumberName3.message) : null), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_PLUMBER_MOBILE_NO_LABEL"), " ", /*#__PURE__*/React.createElement("span", {
30091
+ }, " ", errors === null || errors === void 0 ? void 0 : (_errors$plumberName3 = errors.plumberName) === null || _errors$plumberName3 === void 0 ? void 0 : _errors$plumberName3.message) : null), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
29707
30092
  style: {
29708
- color: "red"
30093
+ margin: 0
30094
+ },
30095
+ label: getTrans("WS_PLIMBER_LICENSE_NO_LABEL", "Plumber License Number"),
30096
+ isMandatory: true,
30097
+ infoText: t("WS_PLUMBER_LICENSE_NO_INFO_MSG", "Enter Plumber License Number")
30098
+ }), /*#__PURE__*/React.createElement("div", {
30099
+ className: "field"
30100
+ }, /*#__PURE__*/React.createElement(Controller, {
30101
+ control: control,
30102
+ name: "plumberLicenseNo",
30103
+ defaultValue: (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.plumberLicenseNo) || (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.licenseNo) || "",
30104
+ rules: {
30105
+ required: getTrans("REQUIRED_FIELD", "Required")
30106
+ },
30107
+ isMandatory: true,
30108
+ render: props => {
30109
+ var _errors$plumberLicens;
30110
+ return /*#__PURE__*/React.createElement(TextInput, {
30111
+ value: props.value,
30112
+ autoFocus: focusIndex.index === (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.key) && focusIndex.type === "plumberLicenseNo",
30113
+ errorStyle: localFormState.touched.plumberLicenseNo && errors !== null && errors !== void 0 && (_errors$plumberLicens = errors.plumberLicenseNo) !== null && _errors$plumberLicens !== void 0 && _errors$plumberLicens.message ? true : false,
30114
+ onChange: e => {
30115
+ props.onChange(e.target.value);
30116
+ setFocusIndex({
30117
+ index: plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.key,
30118
+ type: "plumberLicenseNo"
30119
+ });
30120
+ },
30121
+ labelStyle: {
30122
+ marginTop: "unset"
30123
+ },
30124
+ onBlur: props.onBlur,
30125
+ placeholder: getTrans("WS_PLIMBER_LICENSE_NO_PLACEHOLDER", "Enter Plumber License Number")
30126
+ });
29709
30127
  }
29710
- }, "*")), /*#__PURE__*/React.createElement("div", {
30128
+ })), localFormState.touched.plumberLicenseNo && errors !== null && errors !== void 0 && (_errors$plumberLicens2 = errors.plumberLicenseNo) !== null && _errors$plumberLicens2 !== void 0 && _errors$plumberLicens2.message ? /*#__PURE__*/React.createElement(CardLabelError, {
30129
+ style: errorStyle
30130
+ }, errors === null || errors === void 0 ? void 0 : (_errors$plumberLicens3 = errors.plumberLicenseNo) === null || _errors$plumberLicens3 === void 0 ? void 0 : _errors$plumberLicens3.message) : null), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
30131
+ style: {
30132
+ margin: 0
30133
+ },
30134
+ label: getTrans("WS_PLUMBER_MOBILE_NO_LABEL", "Plumber Mobile Number"),
30135
+ isMandatory: true,
30136
+ infoText: t("WS_PLUMBER_MOBILE_NO_INFO_MSG", "Enter 10-digit Plumber Mobile Number")
30137
+ }), /*#__PURE__*/React.createElement("div", {
29711
30138
  className: "field"
29712
30139
  }, /*#__PURE__*/React.createElement(Controller, {
29713
30140
  control: control,
29714
30141
  name: "plumberMobileNo",
29715
- defaultValue: plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.plumberMobileNo,
30142
+ defaultValue: (plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.plumberMobileNo) || (appPlumber === null || appPlumber === void 0 ? void 0 : appPlumber.mobileNumber) || "",
29716
30143
  rules: {
29717
30144
  validate: e => {
29718
- if (!e || !e.trim()) return t("REQUIRED_FIELD");
30145
+ if (!e || !e.trim()) return getTrans("REQUIRED_FIELD", "Required");
29719
30146
  if (e.includes("*")) return true;
29720
30147
  if (/^[6-9]\d{9}$/.test(e)) return true;
29721
- return t("CORE_COMMON_PHONENO_INVALID") || "Please enter a valid 10-digit mobile number";
30148
+ return getTrans("CORE_COMMON_PHONENO_INVALID", "Please enter a valid 10-digit mobile number");
29722
30149
  },
29723
- required: t("REQUIRED_FIELD")
30150
+ required: getTrans("REQUIRED_FIELD", "Required")
29724
30151
  },
29725
30152
  type: "mobileNumber",
29726
30153
  isMandatory: true,
29727
30154
  render: props => {
29728
- var _errors$plumberMobile, _props$value, _formData$connectionD3, _formData$connectionD4, _formData$connectionD5, _formData$connectionD6, _formData$disConnecti2, _formData$disConnecti3, _formData$disConnecti4, _formData$connectionD7, _formData$connectionD8, _formData$connectionD9, _formData$connectionD0, _formData$connectionD1, _formData$connectionD10, _formData$connectionD11, _formData$disConnecti5, _formData$disConnecti6, _formData$disConnecti7;
30155
+ var _errors$plumberMobile, _props$value, _formData$connectionD8, _formData$connectionD9, _formData$connectionD0, _formData$connectionD1, _formData$disConnecti, _formData$disConnecti2, _formData$disConnecti3, _formData$connectionD10, _formData$connectionD11, _formData$connectionD12, _formData$connectionD13, _formData$connectionD14, _formData$connectionD15, _formData$connectionD16, _formData$disConnecti4, _formData$disConnecti5, _formData$disConnecti6;
29729
30156
  return /*#__PURE__*/React.createElement("div", {
29730
30157
  style: {
29731
30158
  display: "flex",
@@ -29764,7 +30191,7 @@ const PlumberDetails = _props => {
29764
30191
  marginTop: "unset"
29765
30192
  },
29766
30193
  onBlur: props.onBlur,
29767
- placeholder: `${t(`WS_PLUMBER_MOBILE_NO_PLACEHOLDER`)}`
30194
+ placeholder: getTrans("WS_PLUMBER_MOBILE_NO_PLACEHOLDER", "Enter Plumber Mobile Number")
29768
30195
  }), /*#__PURE__*/React.createElement("div", {
29769
30196
  style: isMobile && isEmployee ? {} : {
29770
30197
  marginRight: "-50px",
@@ -29780,13 +30207,13 @@ const PlumberDetails = _props => {
29780
30207
  fieldName: "plumberInfoMobileNumber",
29781
30208
  model: "WnSConnectionPlumber",
29782
30209
  loadData: {
29783
- serviceName: (formData === null || formData === void 0 ? void 0 : (_formData$connectionD3 = formData.connectionDetails) === null || _formData$connectionD3 === void 0 ? void 0 : (_formData$connectionD4 = _formData$connectionD3[0]) === null || _formData$connectionD4 === void 0 ? void 0 : (_formData$connectionD5 = _formData$connectionD4.formDetails) === null || _formData$connectionD5 === void 0 ? void 0 : (_formData$connectionD6 = _formData$connectionD5.applicationData) === null || _formData$connectionD6 === void 0 ? void 0 : _formData$connectionD6.serviceType) === "WATER" || formData !== null && formData !== void 0 && (_formData$disConnecti2 = formData.disConnectionDetails) !== null && _formData$disConnecti2 !== void 0 && (_formData$disConnecti3 = _formData$disConnecti2[0]) !== null && _formData$disConnecti3 !== void 0 && (_formData$disConnecti4 = _formData$disConnecti3.consumerNumber) !== null && _formData$disConnecti4 !== void 0 && _formData$disConnecti4.includes("WS") ? "/ws-services/wc/_search" : "/sw-services/swc/_search",
30210
+ serviceName: (formData === null || formData === void 0 ? void 0 : (_formData$connectionD8 = formData.connectionDetails) === null || _formData$connectionD8 === void 0 ? void 0 : (_formData$connectionD9 = _formData$connectionD8[0]) === null || _formData$connectionD9 === void 0 ? void 0 : (_formData$connectionD0 = _formData$connectionD9.formDetails) === null || _formData$connectionD0 === void 0 ? void 0 : (_formData$connectionD1 = _formData$connectionD0.applicationData) === null || _formData$connectionD1 === void 0 ? void 0 : _formData$connectionD1.serviceType) === "WATER" || formData !== null && formData !== void 0 && (_formData$disConnecti = formData.disConnectionDetails) !== null && _formData$disConnecti !== void 0 && (_formData$disConnecti2 = _formData$disConnecti[0]) !== null && _formData$disConnecti2 !== void 0 && (_formData$disConnecti3 = _formData$disConnecti2.consumerNumber) !== null && _formData$disConnecti3 !== void 0 && _formData$disConnecti3.includes("WS") ? "/ws-services/wc/_search" : "/sw-services/swc/_search",
29784
30211
  requestBody: {},
29785
30212
  requestParam: {
29786
- tenantId: formData === null || formData === void 0 ? void 0 : (_formData$connectionD7 = formData.connectionDetails) === null || _formData$connectionD7 === void 0 ? void 0 : (_formData$connectionD8 = _formData$connectionD7[0]) === null || _formData$connectionD8 === void 0 ? void 0 : (_formData$connectionD9 = _formData$connectionD8.formDetails) === null || _formData$connectionD9 === void 0 ? void 0 : _formData$connectionD9.tenantId,
30213
+ tenantId: formData === null || formData === void 0 ? void 0 : (_formData$connectionD10 = formData.connectionDetails) === null || _formData$connectionD10 === void 0 ? void 0 : (_formData$connectionD11 = _formData$connectionD10[0]) === null || _formData$connectionD11 === void 0 ? void 0 : (_formData$connectionD12 = _formData$connectionD11.formDetails) === null || _formData$connectionD12 === void 0 ? void 0 : _formData$connectionD12.tenantId,
29787
30214
  applicationNumber: plumberDetail === null || plumberDetail === void 0 ? void 0 : plumberDetail.applicationNo
29788
30215
  },
29789
- jsonPath: (formData === null || formData === void 0 ? void 0 : (_formData$connectionD0 = formData.connectionDetails) === null || _formData$connectionD0 === void 0 ? void 0 : (_formData$connectionD1 = _formData$connectionD0[0]) === null || _formData$connectionD1 === void 0 ? void 0 : (_formData$connectionD10 = _formData$connectionD1.formDetails) === null || _formData$connectionD10 === void 0 ? void 0 : (_formData$connectionD11 = _formData$connectionD10.applicationData) === null || _formData$connectionD11 === void 0 ? void 0 : _formData$connectionD11.serviceType) === "WATER" || formData !== null && formData !== void 0 && (_formData$disConnecti5 = formData.disConnectionDetails) !== null && _formData$disConnecti5 !== void 0 && (_formData$disConnecti6 = _formData$disConnecti5[0]) !== null && _formData$disConnecti6 !== void 0 && (_formData$disConnecti7 = _formData$disConnecti6.consumerNumber) !== null && _formData$disConnecti7 !== void 0 && _formData$disConnecti7.includes("WS") ? "WaterConnection[0].plumberInfo[0].mobileNumber" : "SewerageConnections[0].plumberInfo[0].mobileNumber",
30216
+ jsonPath: (formData === null || formData === void 0 ? void 0 : (_formData$connectionD13 = formData.connectionDetails) === null || _formData$connectionD13 === void 0 ? void 0 : (_formData$connectionD14 = _formData$connectionD13[0]) === null || _formData$connectionD14 === void 0 ? void 0 : (_formData$connectionD15 = _formData$connectionD14.formDetails) === null || _formData$connectionD15 === void 0 ? void 0 : (_formData$connectionD16 = _formData$connectionD15.applicationData) === null || _formData$connectionD16 === void 0 ? void 0 : _formData$connectionD16.serviceType) === "WATER" || formData !== null && formData !== void 0 && (_formData$disConnecti4 = formData.disConnectionDetails) !== null && _formData$disConnecti4 !== void 0 && (_formData$disConnecti5 = _formData$disConnecti4[0]) !== null && _formData$disConnecti5 !== void 0 && (_formData$disConnecti6 = _formData$disConnecti5.consumerNumber) !== null && _formData$disConnecti6 !== void 0 && _formData$disConnecti6.includes("WS") ? "WaterConnection[0].plumberInfo[0].mobileNumber" : "SewerageConnections[0].plumberInfo[0].mobileNumber",
29790
30217
  isArray: false
29791
30218
  }
29792
30219
  }
@@ -30112,16 +30539,21 @@ const WSActivationCommentsDetails = _ref => {
30112
30539
  comments: (formData === null || formData === void 0 ? void 0 : (_formData$comments = formData.comments) === null || _formData$comments === void 0 ? void 0 : _formData$comments.comments) || ""
30113
30540
  });
30114
30541
  useEffect(() => {
30115
- });
30116
- useEffect(() => {
30117
- if (userType === "employee") {
30542
+ if (onSelect && config !== null && config !== void 0 && config.key) {
30118
30543
  onSelect(config.key, {
30119
- ...formData[config.key],
30544
+ ...(formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key]),
30120
30545
  ...comments
30121
30546
  });
30122
30547
  }
30123
30548
  }, [comments]);
30124
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WF_COMMON_COMMENTS"), ":"), /*#__PURE__*/React.createElement("div", {
30549
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
30550
+ style: {
30551
+ margin: 0
30552
+ },
30553
+ label: t("WF_COMMON_COMMENTS") || "Comments",
30554
+ isMandatory: false,
30555
+ infoText: t("WF_COMMON_COMMENTS_INFO_MSG", "Enter any remarks or comments")
30556
+ }), /*#__PURE__*/React.createElement("div", {
30125
30557
  className: "field"
30126
30558
  }, /*#__PURE__*/React.createElement(TextInput, {
30127
30559
  key: config.key,
@@ -30136,7 +30568,7 @@ const WSActivationCommentsDetails = _ref => {
30136
30568
  };
30137
30569
 
30138
30570
  const WSActivationSupportingDocuments = _ref => {
30139
- var _formData$supportingD, _formData$supportingD2, _formData$supportingD3, _formData$supportingD4, _formState$errors, _formState$errors2, _formState$errors2$co, _formErrors$config$ke, _formState$errors3, _formState$errors3$co, _formErrors$config$ke2;
30571
+ var _formData$plumberDeta, _formData$plumberDeta2, _formData$plumberDeta3, _formData$plumberDeta4, _formData$plumberDeta5, _formData$plumberDeta6, _formData$plumberDeta7, _formData$plumberDeta8, _formData$additionalD, _formData$supportingD, _formData$supportingD2, _existingDocs$, _formData$supportingD3, _formData$supportingD4;
30140
30572
  let {
30141
30573
  t,
30142
30574
  config,
@@ -30149,28 +30581,69 @@ const WSActivationSupportingDocuments = _ref => {
30149
30581
  errors: formErrors
30150
30582
  } = _ref;
30151
30583
  const tenantIdCode = Digit.ULBService.getCurrentTenantId();
30152
- const initialDoc = (formData === null || formData === void 0 ? void 0 : (_formData$supportingD = formData.supportingDocuments) === null || _formData$supportingD === void 0 ? void 0 : _formData$supportingD[0]) || (formData === null || formData === void 0 ? void 0 : (_formData$supportingD2 = formData.supportingDocuments) === null || _formData$supportingD2 === void 0 ? void 0 : (_formData$supportingD3 = _formData$supportingD2.documents) === null || _formData$supportingD3 === void 0 ? void 0 : _formData$supportingD3[0]) || (formData !== null && formData !== void 0 && (_formData$supportingD4 = formData.supportingDocuments) !== null && _formData$supportingD4 !== void 0 && _formData$supportingD4.fileStoreId ? formData === null || formData === void 0 ? void 0 : formData.supportingDocuments : null);
30153
- const [documents, setDocuments] = useState(initialDoc !== null && initialDoc !== void 0 && initialDoc.fileStoreId ? [initialDoc] : []);
30154
- const [error, setError] = useState(null);
30155
- const [uploadedFile, setUploadedFile] = useState((initialDoc === null || initialDoc === void 0 ? void 0 : initialDoc.fileStoreId) || null);
30156
- const [file, setFile] = useState(null);
30157
- function selectfile(e) {
30158
- var _e$target$files;
30159
- const selectedFile = (_e$target$files = e.target.files) === null || _e$target$files === void 0 ? void 0 : _e$target$files[0];
30160
- if (selectedFile) {
30161
- setFile(selectedFile);
30162
- }
30163
- }
30584
+ const getTrans = (key, defaultVal) => {
30585
+ const val = t(key);
30586
+ return val && val !== key ? val : defaultVal;
30587
+ };
30588
+ const plumberPref = (formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta = formData.plumberDetails) === null || _formData$plumberDeta === void 0 ? void 0 : (_formData$plumberDeta2 = _formData$plumberDeta[0]) === null || _formData$plumberDeta2 === void 0 ? void 0 : (_formData$plumberDeta3 = _formData$plumberDeta2.detailsProvidedBy) === null || _formData$plumberDeta3 === void 0 ? void 0 : _formData$plumberDeta3.code) || (formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta4 = formData.plumberDetails) === null || _formData$plumberDeta4 === void 0 ? void 0 : (_formData$plumberDeta5 = _formData$plumberDeta4[0]) === null || _formData$plumberDeta5 === void 0 ? void 0 : (_formData$plumberDeta6 = _formData$plumberDeta5.detailsProvidedBy) === null || _formData$plumberDeta6 === void 0 ? void 0 : _formData$plumberDeta6.name) || (formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta7 = formData.plumberDetails) === null || _formData$plumberDeta7 === void 0 ? void 0 : (_formData$plumberDeta8 = _formData$plumberDeta7[0]) === null || _formData$plumberDeta8 === void 0 ? void 0 : _formData$plumberDeta8.detailsProvidedBy) || (formData === null || formData === void 0 ? void 0 : (_formData$additionalD = formData.additionalDetails) === null || _formData$additionalD === void 0 ? void 0 : _formData$additionalD.detailsProvidedBy) || "";
30589
+ const isDJB = plumberPref === "DJB" || plumberPref === "ULB" || plumberPref === "Delhi Jal Board" || typeof plumberPref === "string" && plumberPref.toLowerCase().includes("djb");
30590
+ const isSelf = !isDJB;
30591
+ const existingDocs = (formData === null || formData === void 0 ? void 0 : (_formData$supportingD = formData.supportingDocuments) === null || _formData$supportingD === void 0 ? void 0 : _formData$supportingD.documents) || (Array.isArray(formData === null || formData === void 0 ? void 0 : formData.supportingDocuments) ? formData.supportingDocuments : []);
30592
+ const initialPhoto = (formData === null || formData === void 0 ? void 0 : (_formData$supportingD2 = formData.supportingDocuments) === null || _formData$supportingD2 === void 0 ? void 0 : _formData$supportingD2.meterPhoto) || existingDocs.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === "METER_PHOTO") || ((_existingDocs$ = existingDocs[0]) !== null && _existingDocs$ !== void 0 && _existingDocs$.fileStoreId ? existingDocs[0] : null);
30593
+ const initialWarranty = (formData === null || formData === void 0 ? void 0 : (_formData$supportingD3 = formData.supportingDocuments) === null || _formData$supportingD3 === void 0 ? void 0 : _formData$supportingD3.meterWarranty) || existingDocs.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === "METER_WARRANTY_CARD_TESTING_REPORT_INVOICE");
30594
+ const initialDeclaration = (formData === null || formData === void 0 ? void 0 : (_formData$supportingD4 = formData.supportingDocuments) === null || _formData$supportingD4 === void 0 ? void 0 : _formData$supportingD4.plumberDeclaration) || existingDocs.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === "DECLARATION_OF_LICENSED_PLUMBER");
30595
+ const [meterPhoto, setMeterPhoto] = useState(initialPhoto || null);
30596
+ const [meterWarranty, setMeterWarranty] = useState(initialWarranty || null);
30597
+ const [plumberDeclaration, setPlumberDeclaration] = useState(initialDeclaration || null);
30598
+ const [errors, setErrors] = useState({
30599
+ meterPhoto: null,
30600
+ meterWarranty: null,
30601
+ plumberDeclaration: null
30602
+ });
30603
+ const [uploading, setUploading] = useState({
30604
+ meterPhoto: false,
30605
+ meterWarranty: false,
30606
+ plumberDeclaration: false
30607
+ });
30608
+ const [isDownloadingTemplate, setIsDownloadingTemplate] = useState(false);
30164
30609
  useEffect(() => {
30165
- var _formData$supportingD5, _formData$supportingD6, _formData$supportingD7, _formData$supportingD8;
30166
- const doc = (formData === null || formData === void 0 ? void 0 : (_formData$supportingD5 = formData.supportingDocuments) === null || _formData$supportingD5 === void 0 ? void 0 : _formData$supportingD5[0]) || (formData === null || formData === void 0 ? void 0 : (_formData$supportingD6 = formData.supportingDocuments) === null || _formData$supportingD6 === void 0 ? void 0 : (_formData$supportingD7 = _formData$supportingD6.documents) === null || _formData$supportingD7 === void 0 ? void 0 : _formData$supportingD7[0]) || (formData !== null && formData !== void 0 && (_formData$supportingD8 = formData.supportingDocuments) !== null && _formData$supportingD8 !== void 0 && _formData$supportingD8.fileStoreId ? formData === null || formData === void 0 ? void 0 : formData.supportingDocuments : null);
30167
- if (doc !== null && doc !== void 0 && doc.fileStoreId && !uploadedFile) {
30168
- setUploadedFile(doc.fileStoreId);
30169
- setDocuments([doc]);
30610
+ var _docs$;
30611
+ const docs = [];
30612
+ if (meterPhoto !== null && meterPhoto !== void 0 && meterPhoto.fileStoreId) {
30613
+ docs.push({
30614
+ documentType: "METER_PHOTO",
30615
+ fileStoreId: meterPhoto.fileStoreId,
30616
+ fileName: meterPhoto.fileName
30617
+ });
30170
30618
  }
30171
- }, [formData === null || formData === void 0 ? void 0 : formData.supportingDocuments]);
30172
- useEffect(() => {
30173
- if (uploadedFile) {
30619
+ if (meterWarranty !== null && meterWarranty !== void 0 && meterWarranty.fileStoreId) {
30620
+ docs.push({
30621
+ documentType: "METER_WARRANTY_CARD_TESTING_REPORT_INVOICE",
30622
+ fileStoreId: meterWarranty.fileStoreId,
30623
+ fileName: meterWarranty.fileName
30624
+ });
30625
+ }
30626
+ if (plumberDeclaration !== null && plumberDeclaration !== void 0 && plumberDeclaration.fileStoreId) {
30627
+ docs.push({
30628
+ documentType: "DECLARATION_OF_LICENSED_PLUMBER",
30629
+ fileStoreId: plumberDeclaration.fileStoreId,
30630
+ fileName: plumberDeclaration.fileName
30631
+ });
30632
+ }
30633
+ const payloadData = {
30634
+ documents: docs,
30635
+ meterPhoto: meterPhoto || null,
30636
+ meterWarranty: meterWarranty || null,
30637
+ plumberDeclaration: plumberDeclaration || null,
30638
+ fileStoreId: (meterPhoto === null || meterPhoto === void 0 ? void 0 : meterPhoto.fileStoreId) || ((_docs$ = docs[0]) === null || _docs$ === void 0 ? void 0 : _docs$.fileStoreId) || null
30639
+ };
30640
+ if (onSelect && config !== null && config !== void 0 && config.key) {
30641
+ onSelect(config.key, payloadData);
30642
+ }
30643
+ const isPhotoValid = !!(meterPhoto !== null && meterPhoto !== void 0 && meterPhoto.fileStoreId);
30644
+ const isWarrantyValid = isDJB ? true : !!(meterWarranty !== null && meterWarranty !== void 0 && meterWarranty.fileStoreId);
30645
+ const isDeclarationValid = true;
30646
+ if (isPhotoValid && isWarrantyValid && isDeclarationValid) {
30174
30647
  if (clearFormErrors && config !== null && config !== void 0 && config.key) {
30175
30648
  clearFormErrors(config.key);
30176
30649
  }
@@ -30178,101 +30651,104 @@ const WSActivationSupportingDocuments = _ref => {
30178
30651
  if (setFormError && config !== null && config !== void 0 && config.key) {
30179
30652
  setFormError(config.key, {
30180
30653
  type: "required",
30181
- message: t("CORE_COMMON_REQUIRED_ERRMSG") || t("REQUIRED_FIELD") || "Required"
30654
+ message: getTrans("CORE_COMMON_REQUIRED_ERRMSG", "Required")
30182
30655
  });
30183
30656
  }
30184
30657
  }
30185
- }, [uploadedFile, setFormError, clearFormErrors, config === null || config === void 0 ? void 0 : config.key]);
30186
- useEffect(() => {
30187
- (function () {
30188
- try {
30189
- setError(null);
30190
- const _temp4 = function () {
30191
- if (file) {
30192
- const allowedFileTypesRegex = /(.*?)(jpg|jpeg|png|image|pdf)$/i;
30193
- const _temp3 = function () {
30194
- if (file.size >= 5242880) {
30195
- setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
30196
- } else {
30197
- const _temp2 = function () {
30198
- if (file !== null && file !== void 0 && file.type && !allowedFileTypesRegex.test(file === null || file === void 0 ? void 0 : file.type)) {
30199
- setError(t(`NOT_SUPPORTED_FILE_TYPE`));
30200
- } else {
30201
- const _temp = _catch(function () {
30202
- return Promise.resolve(Digit.UploadServices.Filestorage("WS", file, tenantIdCode)).then(function (response) {
30203
- var _response$data, _response$data$files;
30204
- if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
30205
- var _response$data2, _response$data2$files;
30206
- const fsId = response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId;
30207
- setUploadedFile(fsId);
30208
- setDocuments([{
30209
- fileStoreId: fsId,
30210
- documentUid: fsId
30211
- }]);
30212
- if (onSelect && config !== null && config !== void 0 && config.key) {
30213
- onSelect(config.key, [{
30214
- fileStoreId: fsId,
30215
- documentUid: fsId
30216
- }]);
30217
- }
30218
- if (clearFormErrors && config !== null && config !== void 0 && config.key) {
30219
- clearFormErrors(config.key);
30220
- }
30221
- } else {
30222
- setError(t("CS_FILE_UPLOAD_ERROR"));
30223
- }
30224
- });
30225
- }, function () {
30226
- setError(t("CS_FILE_UPLOAD_ERROR"));
30227
- });
30228
- if (_temp && _temp.then) return _temp.then(function () {});
30229
- }
30230
- }();
30231
- if (_temp2 && _temp2.then) return _temp2.then(function () {});
30232
- }
30233
- }();
30234
- if (_temp3 && _temp3.then) return _temp3.then(function () {});
30235
- }
30236
- }();
30237
- return _temp4 && _temp4.then ? _temp4.then(function () {}) : void 0;
30238
- } catch (e) {
30239
- Promise.reject(e);
30658
+ }, [meterPhoto, meterWarranty, plumberDeclaration, isDJB, isSelf]);
30659
+ const uploadFileToServer = function (file, fieldKey, maxSizeInBytes, allowedTypesRegex, errorMsgSize, errorMsgType) {
30660
+ try {
30661
+ setErrors(prev => ({
30662
+ ...prev,
30663
+ [fieldKey]: null
30664
+ }));
30665
+ if (!file) return Promise.resolve();
30666
+ if (file.size > maxSizeInBytes) {
30667
+ setErrors(prev => ({
30668
+ ...prev,
30669
+ [fieldKey]: errorMsgSize
30670
+ }));
30671
+ return Promise.resolve();
30240
30672
  }
30241
- })();
30242
- }, [file]);
30243
- const handleDelete = () => {
30244
- setUploadedFile(null);
30245
- setDocuments([]);
30246
- setFile(null);
30247
- setError(null);
30248
- if (onSelect && config !== null && config !== void 0 && config.key) {
30249
- onSelect(config.key, null);
30250
- }
30251
- if (setFormError && config !== null && config !== void 0 && config.key) {
30252
- setFormError(config.key, {
30253
- type: "required",
30254
- message: t("CORE_COMMON_REQUIRED_ERRMSG") || t("REQUIRED_FIELD") || "Required"
30673
+ if (file !== null && file !== void 0 && file.type && !allowedTypesRegex.test(file === null || file === void 0 ? void 0 : file.type) && !allowedTypesRegex.test(file === null || file === void 0 ? void 0 : file.name)) {
30674
+ setErrors(prev => ({
30675
+ ...prev,
30676
+ [fieldKey]: errorMsgType
30677
+ }));
30678
+ return Promise.resolve();
30679
+ }
30680
+ const _temp = _catch(function () {
30681
+ setUploading(prev => ({
30682
+ ...prev,
30683
+ [fieldKey]: true
30684
+ }));
30685
+ return Promise.resolve(Digit.UploadServices.Filestorage("WS", file, tenantIdCode)).then(function (response) {
30686
+ var _response$data, _response$data$files;
30687
+ setUploading(prev => ({
30688
+ ...prev,
30689
+ [fieldKey]: false
30690
+ }));
30691
+ if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
30692
+ var _response$data2, _response$data2$files;
30693
+ const fsId = response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId;
30694
+ const fileObj = {
30695
+ fileStoreId: fsId,
30696
+ documentUid: fsId,
30697
+ fileName: file.name
30698
+ };
30699
+ if (fieldKey === "meterPhoto") setMeterPhoto(fileObj);else if (fieldKey === "meterWarranty") setMeterWarranty(fileObj);else if (fieldKey === "plumberDeclaration") setPlumberDeclaration(fileObj);
30700
+ } else {
30701
+ setErrors(prev => ({
30702
+ ...prev,
30703
+ [fieldKey]: getTrans("CS_FILE_UPLOAD_ERROR", "File upload failed")
30704
+ }));
30705
+ }
30706
+ });
30707
+ }, function () {
30708
+ setUploading(prev => ({
30709
+ ...prev,
30710
+ [fieldKey]: false
30711
+ }));
30712
+ setErrors(prev => ({
30713
+ ...prev,
30714
+ [fieldKey]: getTrans("CS_FILE_UPLOAD_ERROR", "File upload failed")
30715
+ }));
30255
30716
  });
30717
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
30718
+ } catch (e) {
30719
+ return Promise.reject(e);
30256
30720
  }
30257
30721
  };
30258
- const hasValidationError = !uploadedFile && ((formState === null || formState === void 0 ? void 0 : (_formState$errors = formState.errors) === null || _formState$errors === void 0 ? void 0 : _formState$errors[config === null || config === void 0 ? void 0 : config.key]) || (formErrors === null || formErrors === void 0 ? void 0 : formErrors[config === null || config === void 0 ? void 0 : config.key]));
30259
30722
  const errorStyle = {
30260
30723
  width: "100%",
30261
30724
  marginLeft: "0px",
30262
30725
  fontSize: "12px",
30263
30726
  marginTop: "4px"
30264
30727
  };
30265
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(`WF_APPROVAL_UPLOAD_HEAD`), /*#__PURE__*/React.createElement("span", {
30266
- className: "check-page-link-button"
30267
- }, " *"), ":"), /*#__PURE__*/React.createElement("div", {
30728
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
30729
+ style: {
30730
+ margin: 0
30731
+ },
30732
+ label: getTrans("WS_METER_PHOTO_UPLOAD_LABEL", "Meter Photo(JPEG/PDF size up to 500KB)"),
30733
+ isMandatory: true,
30734
+ infoText: t("WS_METER_PHOTO_INFO_MSG", "Upload photo of installed water meter")
30735
+ }), /*#__PURE__*/React.createElement("div", {
30268
30736
  className: "field"
30269
30737
  }, /*#__PURE__*/React.createElement(UploadFile, {
30270
- id: "activation-supporting-documents",
30738
+ id: "activation-meter-photo",
30271
30739
  onUpload: e => {
30272
- selectfile(e);
30740
+ var _e$target$files;
30741
+ const f = (_e$target$files = e.target.files) === null || _e$target$files === void 0 ? void 0 : _e$target$files[0];
30742
+ uploadFileToServer(f, "meterPhoto", 500 * 1024, /(.*?)(jpg|jpeg|png|image|pdf)$/i, "File size exceeds maximum limit of 500 KB", "Only JPEG/PNG images or PDF files are allowed");
30273
30743
  },
30274
- onDelete: handleDelete,
30275
- message: uploadedFile ? `1 ${t(`CS_ACTION_FILEUPLOADED`)}` : t(`CS_ACTION_NO_FILEUPLOADED`),
30744
+ onDelete: () => {
30745
+ setMeterPhoto(null);
30746
+ setErrors(prev => ({
30747
+ ...prev,
30748
+ meterPhoto: null
30749
+ }));
30750
+ },
30751
+ message: uploading.meterPhoto ? "Uploading..." : meterPhoto ? meterPhoto.fileName || `1 ${getTrans("CS_ACTION_FILEUPLOADED", "File Uploaded")}` : getTrans("CS_ACTION_NO_FILEUPLOADED", "No File Uploaded"),
30276
30752
  textStyles: {
30277
30753
  width: "100%"
30278
30754
  },
@@ -30281,13 +30757,47 @@ const WSActivationSupportingDocuments = _ref => {
30281
30757
  },
30282
30758
  buttonType: "button",
30283
30759
  accept: "image/*, .pdf, .png, .jpeg, .jpg",
30284
- iserror: error || (hasValidationError && (formState !== null && formState !== void 0 && formState.isSubmitted || (formState === null || formState === void 0 ? void 0 : formState.submitCount) > 0) ? (formState === null || formState === void 0 ? void 0 : (_formState$errors2 = formState.errors) === null || _formState$errors2 === void 0 ? void 0 : (_formState$errors2$co = _formState$errors2[config === null || config === void 0 ? void 0 : config.key]) === null || _formState$errors2$co === void 0 ? void 0 : _formState$errors2$co.message) || (formErrors === null || formErrors === void 0 ? void 0 : (_formErrors$config$ke = formErrors[config === null || config === void 0 ? void 0 : config.key]) === null || _formErrors$config$ke === void 0 ? void 0 : _formErrors$config$ke.message) || t("CORE_COMMON_REQUIRED_ERRMSG") : null),
30760
+ iserror: errors.meterPhoto,
30285
30761
  isMandatory: true
30286
- }), error ? /*#__PURE__*/React.createElement(CardLabelError, {
30762
+ }), errors.meterPhoto ? /*#__PURE__*/React.createElement(CardLabelError, {
30287
30763
  style: errorStyle
30288
- }, error) : null, !error && hasValidationError && (formState !== null && formState !== void 0 && formState.isSubmitted || (formState === null || formState === void 0 ? void 0 : formState.submitCount) > 0) ? /*#__PURE__*/React.createElement(CardLabelError, {
30764
+ }, errors.meterPhoto) : null)), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
30765
+ style: {
30766
+ margin: 0
30767
+ },
30768
+ label: getTrans("WS_METER_WARRANTY_REPORT_INVOICE_LABEL", "Meter warranty card, Meter testing report, Invoice of meter JPEG/PDF up to size 1 MB"),
30769
+ isMandatory: isSelf,
30770
+ infoText: t("WS_METER_WARRANTY_INFO_MSG", "Upload meter warranty card, testing report or invoice")
30771
+ }), /*#__PURE__*/React.createElement("div", {
30772
+ className: "field"
30773
+ }, /*#__PURE__*/React.createElement(UploadFile, {
30774
+ id: "activation-meter-warranty",
30775
+ onUpload: e => {
30776
+ var _e$target$files2;
30777
+ const f = (_e$target$files2 = e.target.files) === null || _e$target$files2 === void 0 ? void 0 : _e$target$files2[0];
30778
+ uploadFileToServer(f, "meterWarranty", 1024 * 1024, /(.*?)(jpg|jpeg|png|image|pdf)$/i, "File size exceeds maximum limit of 1 MB", "Only JPEG/PNG images or PDF files are allowed");
30779
+ },
30780
+ onDelete: () => {
30781
+ setMeterWarranty(null);
30782
+ setErrors(prev => ({
30783
+ ...prev,
30784
+ meterWarranty: null
30785
+ }));
30786
+ },
30787
+ message: uploading.meterWarranty ? "Uploading..." : meterWarranty ? meterWarranty.fileName || `1 ${getTrans("CS_ACTION_FILEUPLOADED", "File Uploaded")}` : getTrans("CS_ACTION_NO_FILEUPLOADED", "No File Uploaded"),
30788
+ textStyles: {
30789
+ width: "100%"
30790
+ },
30791
+ inputStyles: {
30792
+ width: "280px"
30793
+ },
30794
+ buttonType: "button",
30795
+ accept: "image/*, .pdf, .png, .jpeg, .jpg",
30796
+ iserror: errors.meterWarranty,
30797
+ isMandatory: isSelf
30798
+ }), errors.meterWarranty ? /*#__PURE__*/React.createElement(CardLabelError, {
30289
30799
  style: errorStyle
30290
- }, (formState === null || formState === void 0 ? void 0 : (_formState$errors3 = formState.errors) === null || _formState$errors3 === void 0 ? void 0 : (_formState$errors3$co = _formState$errors3[config === null || config === void 0 ? void 0 : config.key]) === null || _formState$errors3$co === void 0 ? void 0 : _formState$errors3$co.message) || (formErrors === null || formErrors === void 0 ? void 0 : (_formErrors$config$ke2 = formErrors[config === null || config === void 0 ? void 0 : config.key]) === null || _formErrors$config$ke2 === void 0 ? void 0 : _formErrors$config$ke2.message) || t("CORE_COMMON_REQUIRED_ERRMSG")) : null)));
30800
+ }, errors.meterWarranty) : null)));
30291
30801
  };
30292
30802
 
30293
30803
  var b = "function" === typeof Symbol && Symbol.for,
@@ -31950,7 +32460,7 @@ const getDocUploadSpecs = (doc, isApplicantPhoto) => {
31950
32460
  };
31951
32461
  };
31952
32462
  const WSDocumentsEmployee = _ref => {
31953
- var _formData$ConnectionD, _formData$ConnectionD2, _formData$ConnectionD3, _formData$application, _formData$application2, _formData$application3, _formData$connectionH, _formData$connectionH2, _formData$ConnectionH, _formData$ConnectionH2, _formData$additionalD, _formData$rainWaterHa, _formData$rainWaterHa2, _formData$rainWaterHa3, _formData$rainWaterHa4, _formData$additionalD2, _formData$additionalD3, _Digit$SessionStorage, _applicationDetailsDa, _applicationDetailsDa2, _wsDocs$wsDocsData3;
32463
+ var _formData$ConnectionD, _formData$ConnectionD2, _formData$ConnectionD3, _formData$application, _formData$application2, _formData$application3, _formData$connectionH, _formData$connectionH2, _formData$ConnectionH, _formData$ConnectionH2, _formData$additionalD, _formData$rainWaterHa, _formData$rainWaterHa2, _formData$rainWaterHa3, _formData$rainWaterHa4, _formData$additionalD2, _formData$additionalD3, _Digit$SessionStorage, _applicationDetailsDa, _applicationDetailsDa2, _wsDocs$wsDocsData3, _wsDocs$wsDocsData3$f;
31954
32464
  let {
31955
32465
  t,
31956
32466
  config,
@@ -32120,15 +32630,18 @@ const WSDocumentsEmployee = _ref => {
32120
32630
  }
32121
32631
  };
32122
32632
  useEffect(() => {
32123
- var _wsDocs$wsDocsData;
32633
+ var _wsDocs$wsDocsData, _wsDocs$wsDocsData$fi;
32124
32634
  let count = 0;
32125
- wsDocs === null || wsDocs === void 0 ? void 0 : (_wsDocs$wsDocsData = wsDocs[wsDocsData]) === null || _wsDocs$wsDocsData === void 0 ? void 0 : _wsDocs$wsDocsData.map(doc => {
32635
+ wsDocs === null || wsDocs === void 0 ? void 0 : (_wsDocs$wsDocsData = wsDocs[wsDocsData]) === null || _wsDocs$wsDocsData === void 0 ? void 0 : (_wsDocs$wsDocsData$fi = _wsDocs$wsDocsData.filter(doc => {
32636
+ var _doc$code, _doc$code2;
32637
+ return (doc === null || doc === void 0 ? void 0 : doc.code) !== "OWNER.APPLICANTPHOTO" && !(doc !== null && doc !== void 0 && (_doc$code = doc.code) !== null && _doc$code !== void 0 && _doc$code.includes("APPLICANTPHOTO")) && !(doc !== null && doc !== void 0 && (_doc$code2 = doc.code) !== null && _doc$code2 !== void 0 && _doc$code2.includes("PHOTO"));
32638
+ })) === null || _wsDocs$wsDocsData$fi === void 0 ? void 0 : _wsDocs$wsDocsData$fi.map(doc => {
32126
32639
  const isDocRequired = isOtherDocument(doc === null || doc === void 0 ? void 0 : doc.code) ? false : doc.required;
32127
32640
  let isRequired = false;
32128
32641
  documents.map(data => {
32129
32642
  if (isDocRequired && data !== null && data !== void 0 && data.documentType.includes(doc.code)) {
32130
- var _doc$code, _doc$code2, _doc$code3;
32131
- const isIdOrOwn = doc.code === "OWNER.IDENTITYPROOF" || doc.code === "OWNER.ADDRESSPROOF" || doc.code === "OWNER.OWNERSHIPPROOF" || ((_doc$code = doc.code) === null || _doc$code === void 0 ? void 0 : _doc$code.includes("IDENTITY")) || ((_doc$code2 = doc.code) === null || _doc$code2 === void 0 ? void 0 : _doc$code2.includes("ADDRESS")) || ((_doc$code3 = doc.code) === null || _doc$code3 === void 0 ? void 0 : _doc$code3.includes("OWNERSHIP"));
32643
+ var _doc$code3, _doc$code4, _doc$code5;
32644
+ const isIdOrOwn = doc.code === "OWNER.IDENTITYPROOF" || doc.code === "OWNER.ADDRESSPROOF" || doc.code === "OWNER.OWNERSHIPPROOF" || ((_doc$code3 = doc.code) === null || _doc$code3 === void 0 ? void 0 : _doc$code3.includes("IDENTITY")) || ((_doc$code4 = doc.code) === null || _doc$code4 === void 0 ? void 0 : _doc$code4.includes("ADDRESS")) || ((_doc$code5 = doc.code) === null || _doc$code5 === void 0 ? void 0 : _doc$code5.includes("OWNERSHIP"));
32132
32645
  if (isIdOrOwn) {
32133
32646
  if (data !== null && data !== void 0 && data.fileStoreId && data !== null && data !== void 0 && data.documentUid && String(data.documentUid).trim()) {
32134
32647
  isRequired = true;
@@ -32176,7 +32689,10 @@ const WSDocumentsEmployee = _ref => {
32176
32689
  }
32177
32690
  const innerContent = /*#__PURE__*/React.createElement("div", {
32178
32691
  className: "formcomposer-section-grid ws-doc-upload"
32179
- }, wsDocs === null || wsDocs === void 0 ? void 0 : (_wsDocs$wsDocsData3 = wsDocs[wsDocsData]) === null || _wsDocs$wsDocsData3 === void 0 ? void 0 : _wsDocs$wsDocsData3.map((document, index) => {
32692
+ }, wsDocs === null || wsDocs === void 0 ? void 0 : (_wsDocs$wsDocsData3 = wsDocs[wsDocsData]) === null || _wsDocs$wsDocsData3 === void 0 ? void 0 : (_wsDocs$wsDocsData3$f = _wsDocs$wsDocsData3.filter(document => {
32693
+ var _document$code, _document$code2;
32694
+ return (document === null || document === void 0 ? void 0 : document.code) !== "OWNER.APPLICANTPHOTO" && !(document !== null && document !== void 0 && (_document$code = document.code) !== null && _document$code !== void 0 && _document$code.includes("APPLICANTPHOTO")) && !(document !== null && document !== void 0 && (_document$code2 = document.code) !== null && _document$code2 !== void 0 && _document$code2.includes("PHOTO"));
32695
+ })) === null || _wsDocs$wsDocsData3$f === void 0 ? void 0 : _wsDocs$wsDocsData3$f.map((document, index) => {
32180
32696
  let modifiedDocument = {
32181
32697
  ...document
32182
32698
  };
@@ -32530,13 +33046,14 @@ function EmployeeIdDocumentUpload(_ref2) {
32530
33046
  alignItems: "center",
32531
33047
  justifyContent: "space-between"
32532
33048
  }
32533
- }, /*#__PURE__*/React.createElement(CardLabel, {
33049
+ }, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
32534
33050
  style: {
32535
33051
  margin: 0
32536
- }
32537
- }, t("WS_UPLOAD_EMPLOYEE_ID_DOC") || t("Upload Employee ID Document"), /*#__PURE__*/React.createElement("span", {
32538
- className: "check-page-link-button"
32539
- }, "*"))), /*#__PURE__*/React.createElement("div", {
33052
+ },
33053
+ label: t("WS_UPLOAD_EMPLOYEE_ID_DOC") || t("Upload Employee ID Document"),
33054
+ isMandatory: true,
33055
+ infoText: t("WS_EMPLOYEE_ID_DOC_INFO_MSG", "Upload DJB Employee ID Card")
33056
+ })), /*#__PURE__*/React.createElement("div", {
32540
33057
  style: {
32541
33058
  fontSize: "12px",
32542
33059
  color: "#555",
@@ -32611,7 +33128,7 @@ function EmployeeIdDocumentUpload(_ref2) {
32611
33128
  }, /*#__PURE__*/React.createElement(RemoveIcon, null)))));
32612
33129
  }
32613
33130
  function SelectDocument$2(_ref3) {
32614
- var _doc$code4, _doc$code5, _doc$code6, _doc$code7, _selectedDocument$cod, _selectedDocument$cod2, _selectedDocument$nam, _selectedDocument$nam2, _selectedDocument$i, _formData$ConnectionD4, _formData$ConnectionD5, _formData$ConnectionD6, _formData$application4, _formData$application5, _formData$application6, _formData$connectionH3, _formData$connectionH4, _formData$ConnectionH3, _formData$ConnectionH4, _formData$additionalD4, _formData$ConnectionD7, _doc$i18nKey, _selectedDocument$cod4, _selectedDocument$cod5, _selectedDocument$cod6, _selectedDocument$cod7, _selectedDocument$cod8, _selectedDocument$cod9, _selectedDocument$cod0, _selectedDocument$cod1, _selectedDocument$cod10, _selectedDocument$cod11, _selectedDocument$cod12, _selectedDocument$cod13, _selectedDocument$cod14, _selectedDocument$cod15, _selectedDocument$cod16, _selectedDocument$cod17, _doc$i18nKey2;
33131
+ var _doc$code6, _doc$code7, _doc$code8, _doc$code9, _selectedDocument$cod, _selectedDocument$cod2, _selectedDocument$nam, _selectedDocument$nam2, _selectedDocument$i, _formData$ConnectionD4, _formData$ConnectionD5, _formData$ConnectionD6, _formData$application4, _formData$application5, _formData$application6, _formData$connectionH3, _formData$connectionH4, _formData$ConnectionH3, _formData$ConnectionH4, _formData$additionalD4, _formData$ConnectionD7, _doc$i18nKey, _doc$i18nKey2, _doc$i18nKey3, _doc$i18nKey4, _selectedDocument$cod4, _selectedDocument$cod5, _selectedDocument$cod6, _selectedDocument$cod7, _selectedDocument$cod8, _selectedDocument$cod9, _selectedDocument$cod0, _selectedDocument$cod1, _selectedDocument$cod10, _selectedDocument$cod11, _selectedDocument$cod12, _selectedDocument$cod13, _selectedDocument$cod14, _selectedDocument$cod15, _selectedDocument$cod16, _selectedDocument$cod17, _doc$i18nKey5, _doc$i18nKey6, _doc$i18nKey7;
32615
33132
  let {
32616
33133
  t,
32617
33134
  document: doc,
@@ -32647,8 +33164,8 @@ function SelectDocument$2(_ref3) {
32647
33164
  const isApplicantPhoto = (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.APPLICANTPHOTO";
32648
33165
  const specs = getDocUploadSpecs(doc, isApplicantPhoto);
32649
33166
  const [fileError, setFileError] = useState(null);
32650
- const isIdentityProof = (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.IDENTITYPROOF" || (doc === null || doc === void 0 ? void 0 : (_doc$code4 = doc.code) === null || _doc$code4 === void 0 ? void 0 : _doc$code4.includes("IDENTITYPROOF")) || (doc === null || doc === void 0 ? void 0 : (_doc$code5 = doc.code) === null || _doc$code5 === void 0 ? void 0 : _doc$code5.includes("IDENTITY"));
32651
- const isOwnershipProof = (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.ADDRESSPROOF" || (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.OWNERSHIPPROOF" || (doc === null || doc === void 0 ? void 0 : (_doc$code6 = doc.code) === null || _doc$code6 === void 0 ? void 0 : _doc$code6.includes("ADDRESSPROOF")) || (doc === null || doc === void 0 ? void 0 : (_doc$code7 = doc.code) === null || _doc$code7 === void 0 ? void 0 : _doc$code7.includes("OWNERSHIP"));
33167
+ const isIdentityProof = (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.IDENTITYPROOF" || (doc === null || doc === void 0 ? void 0 : (_doc$code6 = doc.code) === null || _doc$code6 === void 0 ? void 0 : _doc$code6.includes("IDENTITYPROOF")) || (doc === null || doc === void 0 ? void 0 : (_doc$code7 = doc.code) === null || _doc$code7 === void 0 ? void 0 : _doc$code7.includes("IDENTITY"));
33168
+ const isOwnershipProof = (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.ADDRESSPROOF" || (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.OWNERSHIPPROOF" || (doc === null || doc === void 0 ? void 0 : (_doc$code8 = doc.code) === null || _doc$code8 === void 0 ? void 0 : _doc$code8.includes("ADDRESSPROOF")) || (doc === null || doc === void 0 ? void 0 : (_doc$code9 = doc.code) === null || _doc$code9 === void 0 ? void 0 : _doc$code9.includes("OWNERSHIP"));
32652
33169
  const isDocNumberMandatory = isIdentityProof || isOwnershipProof;
32653
33170
  const [selectedDocument, setSelectedDocument] = useState(() => {
32654
33171
  var _filteredDocument$doc, _doc$dropdownData4, _doc$dropdownData5;
@@ -33154,13 +33671,14 @@ function SelectDocument$2(_ref3) {
33154
33671
  flexDirection: "column",
33155
33672
  gap: "8px"
33156
33673
  }
33157
- }, /*#__PURE__*/React.createElement(CardLabel, {
33674
+ }, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
33158
33675
  style: {
33159
33676
  margin: 0
33160
- }
33161
- }, t(doc === null || doc === void 0 ? void 0 : doc.i18nKey), ((doc === null || doc === void 0 ? void 0 : doc.required) || !isTenant && isOther && (isRwhMandatory || isStpMandatory)) && /*#__PURE__*/React.createElement("span", {
33162
- className: "check-page-link-button"
33163
- }, "*")), " ", !isTenant && isOther && isRwhMandatory && !hasRwhUploaded && !(uploadedFile && isRwhDocType$1(selectedDocument)) && /*#__PURE__*/React.createElement("div", {
33677
+ },
33678
+ label: t(doc === null || doc === void 0 ? void 0 : doc.i18nKey),
33679
+ isMandatory: (doc === null || doc === void 0 ? void 0 : doc.required) || !isTenant && isOther && (isRwhMandatory || isStpMandatory),
33680
+ infoText: t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey = doc.i18nKey) === null || _doc$i18nKey === void 0 ? void 0 : _doc$i18nKey.replaceAll(".", "_")}_INFO_MSG`, `Select ${t(doc === null || doc === void 0 ? void 0 : doc.i18nKey)}`)
33681
+ }), " ", !isTenant && isOther && isRwhMandatory && !hasRwhUploaded && !(uploadedFile && isRwhDocType$1(selectedDocument)) && /*#__PURE__*/React.createElement("div", {
33164
33682
  style: {
33165
33683
  fontSize: "12px",
33166
33684
  color: "#d32f2f",
@@ -33194,13 +33712,14 @@ function SelectDocument$2(_ref3) {
33194
33712
  flexDirection: "column",
33195
33713
  gap: "8px"
33196
33714
  }
33197
- }, /*#__PURE__*/React.createElement(CardLabel, {
33715
+ }, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
33198
33716
  style: {
33199
33717
  margin: 0
33200
- }
33201
- }, isOtherDocumentsRemark ? !t("WS_OTHER_DOCUMENT_REMARK") || t("WS_OTHER_DOCUMENT_REMARK") === "WS_OTHER_DOCUMENT_REMARK" ? "Other Document Remark" : t("WS_OTHER_DOCUMENT_REMARK") : t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey = doc.i18nKey) === null || _doc$i18nKey === void 0 ? void 0 : _doc$i18nKey.replaceAll(".", "_")}_DOCUMENT_NO`), isDocNumberMandatory && /*#__PURE__*/React.createElement("span", {
33202
- className: "check-page-link-button"
33203
- }, " *")), /*#__PURE__*/React.createElement("div", {
33718
+ },
33719
+ label: isOtherDocumentsRemark ? !t("WS_OTHER_DOCUMENT_REMARK") || t("WS_OTHER_DOCUMENT_REMARK") === "WS_OTHER_DOCUMENT_REMARK" ? "Other Document Remark" : t("WS_OTHER_DOCUMENT_REMARK") : t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey2 = doc.i18nKey) === null || _doc$i18nKey2 === void 0 ? void 0 : _doc$i18nKey2.replaceAll(".", "_")}_DOCUMENT_NO`),
33720
+ isMandatory: isDocNumberMandatory,
33721
+ infoText: isOtherDocumentsRemark ? t("WS_OTHER_DOC_REMARK_INFO_MSG", "Enter Other Document Remark") : t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey3 = doc.i18nKey) === null || _doc$i18nKey3 === void 0 ? void 0 : _doc$i18nKey3.replaceAll(".", "_")}_DOC_NO_INFO_MSG`, `Enter ${t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey4 = doc.i18nKey) === null || _doc$i18nKey4 === void 0 ? void 0 : _doc$i18nKey4.replaceAll(".", "_")}_DOCUMENT_NO`)}`)
33722
+ }), /*#__PURE__*/React.createElement("div", {
33204
33723
  className: "field"
33205
33724
  }, /*#__PURE__*/React.createElement(TextInput, {
33206
33725
  type: "text",
@@ -33284,13 +33803,14 @@ function SelectDocument$2(_ref3) {
33284
33803
  alignItems: "center",
33285
33804
  justifyContent: "space-between"
33286
33805
  }
33287
- }, /*#__PURE__*/React.createElement(CardLabel, {
33806
+ }, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
33288
33807
  style: {
33289
33808
  margin: 0
33290
- }
33291
- }, (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.APPLICANTPHOTO" ? !t("WS_UPLOAD_APPLICANT_PHOTO") || t("WS_UPLOAD_APPLICANT_PHOTO") === "WS_UPLOAD_APPLICANT_PHOTO" ? (doc === null || doc === void 0 ? void 0 : doc.description) || "Upload Applicant Photo" : t("WS_UPLOAD_APPLICANT_PHOTO") : t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey2 = doc.i18nKey) === null || _doc$i18nKey2 === void 0 ? void 0 : _doc$i18nKey2.replaceAll(".", "_")}_UPLOAD_DOCUMENT`), (doc === null || doc === void 0 ? void 0 : doc.required) && /*#__PURE__*/React.createElement("span", {
33292
- className: "check-page-link-button"
33293
- }, "*"))), /*#__PURE__*/React.createElement("div", {
33809
+ },
33810
+ label: (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.APPLICANTPHOTO" ? !t("WS_UPLOAD_APPLICANT_PHOTO") || t("WS_UPLOAD_APPLICANT_PHOTO") === "WS_UPLOAD_APPLICANT_PHOTO" ? (doc === null || doc === void 0 ? void 0 : doc.description) || "Upload Applicant Photo" : t("WS_UPLOAD_APPLICANT_PHOTO") : t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey5 = doc.i18nKey) === null || _doc$i18nKey5 === void 0 ? void 0 : _doc$i18nKey5.replaceAll(".", "_")}_UPLOAD_DOCUMENT`),
33811
+ isMandatory: doc === null || doc === void 0 ? void 0 : doc.required,
33812
+ infoText: (doc === null || doc === void 0 ? void 0 : doc.code) === "OWNER.APPLICANTPHOTO" ? t("WS_UPLOAD_APPLICANT_PHOTO_INFO_MSG", "Upload recent passport size photo of applicant") : t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey6 = doc.i18nKey) === null || _doc$i18nKey6 === void 0 ? void 0 : _doc$i18nKey6.replaceAll(".", "_")}_UPLOAD_INFO_MSG`, `Upload ${t(`${doc === null || doc === void 0 ? void 0 : (_doc$i18nKey7 = doc.i18nKey) === null || _doc$i18nKey7 === void 0 ? void 0 : _doc$i18nKey7.replaceAll(".", "_")}_UPLOAD_DOCUMENT`)}`)
33813
+ })), /*#__PURE__*/React.createElement("div", {
33294
33814
  style: {
33295
33815
  fontSize: "12px",
33296
33816
  color: "#555",
@@ -33492,11 +34012,14 @@ function SelectDocument$2(_ref3) {
33492
34012
  gap: "8px",
33493
34013
  gridColumn: "span 1"
33494
34014
  }
33495
- }, /*#__PURE__*/React.createElement(CardLabel, {
34015
+ }, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
33496
34016
  style: {
33497
34017
  margin: 0
33498
- }
33499
- }, !t("WS_CLICK_APPLICANT_PHOTO") || t("WS_CLICK_APPLICANT_PHOTO") === "WS_CLICK_APPLICANT_PHOTO" ? "Click Applicant Photo" : t("WS_CLICK_APPLICANT_PHOTO")), /*#__PURE__*/React.createElement("div", {
34018
+ },
34019
+ label: !t("WS_CLICK_APPLICANT_PHOTO") || t("WS_CLICK_APPLICANT_PHOTO") === "WS_CLICK_APPLICANT_PHOTO" ? "Click Applicant Photo" : t("WS_CLICK_APPLICANT_PHOTO"),
34020
+ isMandatory: false,
34021
+ infoText: t("WS_CLICK_APPLICANT_PHOTO_INFO_MSG", "Click photo directly using device camera")
34022
+ }), /*#__PURE__*/React.createElement("div", {
33500
34023
  style: {
33501
34024
  display: "flex",
33502
34025
  alignItems: "center",
@@ -39025,7 +39548,7 @@ const PlumberDetails$1 = _props => {
39025
39548
  };
39026
39549
 
39027
39550
  const WSBankDetails = _ref => {
39028
- var _formData$WaterConnec4, _formData$WaterConnec5, _formData$WaterConnec6, _formData$WaterConnec0, _formData$WaterConnec1, _formData$WaterConnec10, _localFormState$touch, _errors$bankName, _errors$bankName2, _localFormState$touch2, _errors$bankBranchNam, _errors$bankBranchNam2, _localFormState$touch3, _errors$ifscCode, _errors$ifscCode2, _localFormState$touch4, _errors$accountNumber, _errors$accountNumber2;
39551
+ var _formData$WaterConnec4, _formData$WaterConnec5, _formData$WaterConnec6, _formData$WaterConnec0, _formData$WaterConnec1, _formData$WaterConnec10, _localFormState$touch, _errors$ifscCode, _errors$ifscCode2, _localFormState$touch2, _errors$bankName, _errors$bankName2, _localFormState$touch3, _errors$bankBranchNam, _errors$bankBranchNam2, _localFormState$touch4, _errors$accountNumber, _errors$accountNumber2;
39029
39552
  let {
39030
39553
  config,
39031
39554
  onSelect,
@@ -39223,103 +39746,101 @@ const WSBankDetails = _ref => {
39223
39746
  defaultOpen: true
39224
39747
  }, /*#__PURE__*/React.createElement("div", {
39225
39748
  className: "formcomposer-section-grid"
39226
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NAME_OF_BANK"), " ", /*#__PURE__*/React.createElement("span", {
39227
- className: "astericColor",
39228
- style: {
39229
- color: "#d4351c"
39230
- }
39231
- }, "*")), /*#__PURE__*/React.createElement("div", {
39749
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
39750
+ label: t("WS_IFSC_CODE"),
39751
+ isMandatory: true,
39752
+ infoText: t("WS_IFSC_CODE_INFO_MSG", "Enter 11-character IFSC code")
39753
+ }), /*#__PURE__*/React.createElement("div", {
39232
39754
  className: "field"
39233
39755
  }, /*#__PURE__*/React.createElement(Controller, {
39234
39756
  control: control,
39235
- name: "bankName",
39757
+ name: "ifscCode",
39236
39758
  rules: {
39237
- required: t("CORE_COMMON_REQUIRED_ERRMSG")
39759
+ required: t("CORE_COMMON_REQUIRED_ERRMSG"),
39760
+ pattern: {
39761
+ value: /^[A-Z]{4}0[A-Z0-9]{6}$/,
39762
+ message: t("ERR_INVALID_IFSC_CODE")
39763
+ }
39238
39764
  },
39239
39765
  render: props => /*#__PURE__*/React.createElement(TextInput, {
39240
39766
  value: props.value,
39241
- placeholder: t("WS_NAME_OF_BANK_PLACEHOLDER"),
39767
+ placeholder: t("WS_IFSC_CODE_PLACEHOLDER"),
39242
39768
  onChange: e => {
39243
- props.onChange(e.target.value);
39244
- trigger("bankName");
39769
+ let val = e.target.value.toUpperCase();
39770
+ if (val.length > 11) val = val.slice(0, 11);
39771
+ props.onChange(val);
39772
+ trigger("ifscCode");
39245
39773
  },
39246
39774
  onBlur: e => {
39247
39775
  props.onBlur(e);
39248
- trigger("bankName");
39776
+ trigger("ifscCode");
39249
39777
  triggerParentSync();
39250
- }
39778
+ },
39779
+ maxLength: 11
39251
39780
  })
39252
- }))), ((_localFormState$touch = localFormState.touched) !== null && _localFormState$touch !== void 0 && _localFormState$touch.bankName || localFormState.isSubmitted) && (errors !== null && errors !== void 0 && (_errors$bankName = errors.bankName) !== null && _errors$bankName !== void 0 && _errors$bankName.message || bankErrors !== null && bankErrors !== void 0 && bankErrors.bankName) ? /*#__PURE__*/React.createElement(CardLabelError, {
39781
+ }))), ((_localFormState$touch = localFormState.touched) !== null && _localFormState$touch !== void 0 && _localFormState$touch.ifscCode || localFormState.isSubmitted) && (errors !== null && errors !== void 0 && (_errors$ifscCode = errors.ifscCode) !== null && _errors$ifscCode !== void 0 && _errors$ifscCode.message || bankErrors !== null && bankErrors !== void 0 && bankErrors.ifscCode) ? /*#__PURE__*/React.createElement(CardLabelError, {
39253
39782
  style: errorStyle
39254
- }, " ", (errors === null || errors === void 0 ? void 0 : (_errors$bankName2 = errors.bankName) === null || _errors$bankName2 === void 0 ? void 0 : _errors$bankName2.message) || (bankErrors === null || bankErrors === void 0 ? void 0 : bankErrors.bankName)) : null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NAME_OF_BRANCH"), " ", /*#__PURE__*/React.createElement("span", {
39255
- className: "astericColor",
39256
- style: {
39257
- color: "#d4351c"
39258
- }
39259
- }, "*")), /*#__PURE__*/React.createElement("div", {
39783
+ }, " ", (errors === null || errors === void 0 ? void 0 : (_errors$ifscCode2 = errors.ifscCode) === null || _errors$ifscCode2 === void 0 ? void 0 : _errors$ifscCode2.message) || (bankErrors === null || bankErrors === void 0 ? void 0 : bankErrors.ifscCode)) : null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
39784
+ label: t("WS_NAME_OF_BANK"),
39785
+ isMandatory: true,
39786
+ infoText: t("WS_NAME_OF_BANK_INFO_MSG", "Bank Name fetched automatically from IFSC code")
39787
+ }), /*#__PURE__*/React.createElement("div", {
39260
39788
  className: "field"
39261
39789
  }, /*#__PURE__*/React.createElement(Controller, {
39262
39790
  control: control,
39263
- name: "bankBranchName",
39791
+ name: "bankName",
39264
39792
  rules: {
39265
39793
  required: t("CORE_COMMON_REQUIRED_ERRMSG")
39266
39794
  },
39267
39795
  render: props => /*#__PURE__*/React.createElement(TextInput, {
39268
39796
  value: props.value,
39269
- placeholder: t("WS_NAME_OF_BRANCH_PLACEHOLDER"),
39797
+ placeholder: t("WS_NAME_OF_BANK_PLACEHOLDER"),
39270
39798
  onChange: e => {
39271
39799
  props.onChange(e.target.value);
39272
- trigger("bankBranchName");
39800
+ trigger("bankName");
39273
39801
  },
39274
39802
  onBlur: e => {
39275
39803
  props.onBlur(e);
39276
- trigger("bankBranchName");
39804
+ trigger("bankName");
39277
39805
  triggerParentSync();
39278
- }
39806
+ },
39807
+ disabled: true
39279
39808
  })
39280
- }))), ((_localFormState$touch2 = localFormState.touched) !== null && _localFormState$touch2 !== void 0 && _localFormState$touch2.bankBranchName || localFormState.isSubmitted) && (errors !== null && errors !== void 0 && (_errors$bankBranchNam = errors.bankBranchName) !== null && _errors$bankBranchNam !== void 0 && _errors$bankBranchNam.message || bankErrors !== null && bankErrors !== void 0 && bankErrors.bankBranchName) ? /*#__PURE__*/React.createElement(CardLabelError, {
39809
+ }))), ((_localFormState$touch2 = localFormState.touched) !== null && _localFormState$touch2 !== void 0 && _localFormState$touch2.bankName || localFormState.isSubmitted) && (errors !== null && errors !== void 0 && (_errors$bankName = errors.bankName) !== null && _errors$bankName !== void 0 && _errors$bankName.message || bankErrors !== null && bankErrors !== void 0 && bankErrors.bankName) ? /*#__PURE__*/React.createElement(CardLabelError, {
39281
39810
  style: errorStyle
39282
- }, " ", (errors === null || errors === void 0 ? void 0 : (_errors$bankBranchNam2 = errors.bankBranchName) === null || _errors$bankBranchNam2 === void 0 ? void 0 : _errors$bankBranchNam2.message) || (bankErrors === null || bankErrors === void 0 ? void 0 : bankErrors.bankBranchName)) : null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_IFSC_CODE"), " ", /*#__PURE__*/React.createElement("span", {
39283
- className: "astericColor",
39284
- style: {
39285
- color: "#d4351c"
39286
- }
39287
- }, "*")), /*#__PURE__*/React.createElement("div", {
39811
+ }, " ", (errors === null || errors === void 0 ? void 0 : (_errors$bankName2 = errors.bankName) === null || _errors$bankName2 === void 0 ? void 0 : _errors$bankName2.message) || (bankErrors === null || bankErrors === void 0 ? void 0 : bankErrors.bankName)) : null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
39812
+ label: t("WS_NAME_OF_BRANCH"),
39813
+ isMandatory: true,
39814
+ infoText: t("WS_NAME_OF_BRANCH_INFO_MSG", "Branch Name fetched automatically from IFSC code")
39815
+ }), /*#__PURE__*/React.createElement("div", {
39288
39816
  className: "field"
39289
39817
  }, /*#__PURE__*/React.createElement(Controller, {
39290
39818
  control: control,
39291
- name: "ifscCode",
39819
+ name: "bankBranchName",
39292
39820
  rules: {
39293
- required: t("CORE_COMMON_REQUIRED_ERRMSG"),
39294
- pattern: {
39295
- value: /^[A-Z]{4}0[A-Z0-9]{6}$/,
39296
- message: t("ERR_INVALID_IFSC_CODE")
39297
- }
39821
+ required: t("CORE_COMMON_REQUIRED_ERRMSG")
39298
39822
  },
39299
39823
  render: props => /*#__PURE__*/React.createElement(TextInput, {
39300
39824
  value: props.value,
39301
- placeholder: t("WS_IFSC_CODE_PLACEHOLDER"),
39825
+ placeholder: t("WS_NAME_OF_BRANCH_PLACEHOLDER"),
39302
39826
  onChange: e => {
39303
- let val = e.target.value.toUpperCase();
39304
- if (val.length > 11) val = val.slice(0, 11);
39305
- props.onChange(val);
39306
- trigger("ifscCode");
39827
+ props.onChange(e.target.value);
39828
+ trigger("bankBranchName");
39307
39829
  },
39308
39830
  onBlur: e => {
39309
39831
  props.onBlur(e);
39310
- trigger("ifscCode");
39832
+ trigger("bankBranchName");
39311
39833
  triggerParentSync();
39312
39834
  },
39313
- maxLength: 11
39835
+ disabled: true
39314
39836
  })
39315
- }))), ((_localFormState$touch3 = localFormState.touched) !== null && _localFormState$touch3 !== void 0 && _localFormState$touch3.ifscCode || localFormState.isSubmitted) && (errors !== null && errors !== void 0 && (_errors$ifscCode = errors.ifscCode) !== null && _errors$ifscCode !== void 0 && _errors$ifscCode.message || bankErrors !== null && bankErrors !== void 0 && bankErrors.ifscCode) ? /*#__PURE__*/React.createElement(CardLabelError, {
39837
+ }))), ((_localFormState$touch3 = localFormState.touched) !== null && _localFormState$touch3 !== void 0 && _localFormState$touch3.bankBranchName || localFormState.isSubmitted) && (errors !== null && errors !== void 0 && (_errors$bankBranchNam = errors.bankBranchName) !== null && _errors$bankBranchNam !== void 0 && _errors$bankBranchNam.message || bankErrors !== null && bankErrors !== void 0 && bankErrors.bankBranchName) ? /*#__PURE__*/React.createElement(CardLabelError, {
39316
39838
  style: errorStyle
39317
- }, " ", (errors === null || errors === void 0 ? void 0 : (_errors$ifscCode2 = errors.ifscCode) === null || _errors$ifscCode2 === void 0 ? void 0 : _errors$ifscCode2.message) || (bankErrors === null || bankErrors === void 0 ? void 0 : bankErrors.ifscCode)) : null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_BANK_ACCOUNT_NO"), " ", /*#__PURE__*/React.createElement("span", {
39318
- className: "astericColor",
39319
- style: {
39320
- color: "#d4351c"
39321
- }
39322
- }, "*")), /*#__PURE__*/React.createElement("div", {
39839
+ }, " ", (errors === null || errors === void 0 ? void 0 : (_errors$bankBranchNam2 = errors.bankBranchName) === null || _errors$bankBranchNam2 === void 0 ? void 0 : _errors$bankBranchNam2.message) || (bankErrors === null || bankErrors === void 0 ? void 0 : bankErrors.bankBranchName)) : null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
39840
+ label: t("WS_BANK_ACCOUNT_NO"),
39841
+ isMandatory: true,
39842
+ infoText: t("WS_BANK_ACCOUNT_NO_INFO_MSG", "Enter Bank Account Number")
39843
+ }), /*#__PURE__*/React.createElement("div", {
39323
39844
  className: "field"
39324
39845
  }, /*#__PURE__*/React.createElement(Controller, {
39325
39846
  control: control,
@@ -39407,16 +39928,6 @@ const WSDeclaration = _ref => {
39407
39928
  const [signatureFileStoreId, setSignatureFileStoreId] = useState(initialFsId);
39408
39929
  const [localFile, setLocalFile] = useState(null);
39409
39930
  const [signError, setSignError] = useState(null);
39410
- const signSpecs = {
39411
- maxSize: 50 * 1024,
39412
- maxSizeText: "50KB",
39413
- allowedExtensions: ["jpg", "jpeg"],
39414
- allowedMimeTypes: ["image/jpeg", "image/jpg"],
39415
- accept: "image/jpeg, .jpg, .jpeg",
39416
- uiMessage: "Allowed format: JPEG | Max file size: 50KB",
39417
- formatErrorMessage: "Only JPEG format (.jpg, .jpeg) is allowed for Signature",
39418
- sizeErrorMessage: "Signature size should not exceed 50KB"
39419
- };
39420
39931
  const [signatureFile, setSignatureFile] = useState((formData === null || formData === void 0 ? void 0 : (_formData$declaration19 = formData.declarationData) === null || _formData$declaration19 === void 0 ? void 0 : _formData$declaration19.signatureFile) || (formData === null || formData === void 0 ? void 0 : (_formData$declaration20 = formData.declaration) === null || _formData$declaration20 === void 0 ? void 0 : _formData$declaration20.signatureFile) || (initialFsId ? {
39421
39932
  fileStoreId: initialFsId,
39422
39933
  fileName: initialFileName
@@ -39495,103 +40006,9 @@ const WSDeclaration = _ref => {
39495
40006
  onSelect(config === null || config === void 0 ? void 0 : config.key, currentValues);
39496
40007
  }
39497
40008
  }, [formValue, signatureFileStoreId, signatureFile, config === null || config === void 0 ? void 0 : config.key, onSelect]);
39498
- const onUploadSignature = function (e) {
39499
- try {
39500
- var _e$target$files;
39501
- setSignError(null);
39502
- const file = (_e$target$files = e.target.files) === null || _e$target$files === void 0 ? void 0 : _e$target$files[0];
39503
- return Promise.resolve(function () {
39504
- if (file) {
39505
- const ext = (file.name || "").split(".").pop().toLowerCase();
39506
- const isExtAllowed = signSpecs.allowedExtensions.includes(ext);
39507
- const isMimeAllowed = signSpecs.allowedMimeTypes.includes(file.type);
39508
- if (!isExtAllowed && !isMimeAllowed) {
39509
- setSignError(t("WS_SIGNATURE_ONLY_JPEG") || signSpecs.formatErrorMessage);
39510
- if (e.target) e.target.value = "";
39511
- return;
39512
- }
39513
- if (file.size > signSpecs.maxSize) {
39514
- setSignError(t("WS_SIGNATURE_MAX_SIZE_EXCEEDED") || signSpecs.sizeErrorMessage);
39515
- if (e.target) e.target.value = "";
39516
- return;
39517
- }
39518
- setLocalFile(file);
39519
- const _temp = _catch(function () {
39520
- return Promise.resolve(Digit.UploadServices.Filestorage("WS", file, Digit.ULBService.getStateId())).then(function (response) {
39521
- var _response$data, _response$data$files;
39522
- if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
39523
- var _response$data2, _response$data2$files;
39524
- const fsId = response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId;
39525
- const sigObj = {
39526
- fileStoreId: fsId,
39527
- fileName: file.name
39528
- };
39529
- setSignatureFileStoreId(fsId);
39530
- setSignatureFile(sigObj);
39531
- setValue("signatureFileStoreId", fsId, {
39532
- shouldDirty: true,
39533
- shouldValidate: true
39534
- });
39535
- setValue("signatureFile", sigObj, {
39536
- shouldDirty: true,
39537
- shouldValidate: true
39538
- });
39539
- setValue("signatureFileName", file.name, {
39540
- shouldDirty: true,
39541
- shouldValidate: true
39542
- });
39543
- } else {
39544
- setSignError(t("CS_FILE_UPLOAD_ERROR") || "File upload failed");
39545
- setLocalFile(null);
39546
- }
39547
- });
39548
- }, function (err) {
39549
- console.error("Signature upload failed", err);
39550
- setSignError(t("CS_FILE_UPLOAD_ERROR") || "File upload failed");
39551
- setLocalFile(null);
39552
- });
39553
- if (_temp && _temp.then) return _temp.then(function () {});
39554
- }
39555
- }());
39556
- } catch (e) {
39557
- return Promise.reject(e);
39558
- }
39559
- };
39560
40009
  const [showDocModal, setShowDocModal] = useState(false);
39561
40010
  const [docFileUrl, setDocFileUrl] = useState("");
39562
40011
  const [docFileType, setDocFileType] = useState("");
39563
- const viewDocument = function () {
39564
- try {
39565
- const _temp3 = function () {
39566
- if (signatureFileStoreId) {
39567
- const _temp2 = _catch(function () {
39568
- return Promise.resolve(Digit.UploadServices.FileFetchbyid(signatureFileStoreId, Digit.ULBService.getStateId())).then(function (res) {
39569
- if (res !== null && res !== void 0 && res.data) {
39570
- const blob = res.data instanceof Blob ? res.data : new Blob([res.data], {
39571
- type: res.headers["content-type"] || res.headers["Content-Type"] || "image/jpeg"
39572
- });
39573
- const fileURL = URL.createObjectURL(blob);
39574
- setDocFileUrl(fileURL);
39575
- const contentType = res.headers["content-type"] || res.headers["Content-Type"] || "";
39576
- if (contentType.toLowerCase().includes("pdf")) {
39577
- setDocFileType("pdf");
39578
- } else {
39579
- setDocFileType("image");
39580
- }
39581
- setShowDocModal(true);
39582
- }
39583
- });
39584
- }, function (err) {
39585
- console.error("Failed to fetch file URL via FileFetchbyid", err);
39586
- });
39587
- if (_temp2 && _temp2.then) return _temp2.then(function () {});
39588
- }
39589
- }();
39590
- return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {}) : void 0);
39591
- } catch (e) {
39592
- return Promise.reject(e);
39593
- }
39594
- };
39595
40012
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
39596
40013
  title: t("WS_DECLARATION"),
39597
40014
  defaultOpen: true
@@ -39634,105 +40051,7 @@ const WSDeclaration = _ref => {
39634
40051
  })
39635
40052
  })), /*#__PURE__*/React.createElement("div", {
39636
40053
  className: "formcomposer-section-grid"
39637
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, {
39638
- style: {
39639
- margin: 0
39640
- }
39641
- }, t("WS_UPLOAD_SIGNATURE_FILE") || "Upload Signature", " ", /*#__PURE__*/React.createElement("span", {
39642
- style: {
39643
- color: "red"
39644
- }
39645
- }, "*")), /*#__PURE__*/React.createElement("div", {
39646
- style: {
39647
- fontSize: "12px",
39648
- color: "#555",
39649
- marginTop: "2px",
39650
- marginBottom: "4px"
39651
- }
39652
- }, signSpecs.uiMessage)), /*#__PURE__*/React.createElement("div", {
39653
- className: "field",
39654
- style: {
39655
- display: "flex",
39656
- flexDirection: "column",
39657
- gap: "6px"
39658
- }
39659
- }, /*#__PURE__*/React.createElement("div", {
39660
- style: {
39661
- display: "flex",
39662
- gap: "10px",
39663
- alignItems: "center",
39664
- width: "100%"
39665
- }
39666
- }, /*#__PURE__*/React.createElement("div", {
39667
- style: {
39668
- flex: 1
39669
- }
39670
- }, /*#__PURE__*/React.createElement(UploadFile, {
39671
- onUpload: onUploadSignature,
39672
- onDelete: () => {
39673
- setLocalFile(null);
39674
- setSignatureFile(null);
39675
- setSignatureFileStoreId(null);
39676
- setSignError(null);
39677
- setValue("signatureFile", null, {
39678
- shouldDirty: true,
39679
- shouldValidate: true
39680
- });
39681
- setValue("signatureFileStoreId", null, {
39682
- shouldDirty: true,
39683
- shouldValidate: true
39684
- });
39685
- setValue("signatureFileName", "", {
39686
- shouldDirty: true,
39687
- shouldValidate: true
39688
- });
39689
- },
39690
- id: "ws-declaration-signature",
39691
- message: signatureFileStoreId ? `1 ${t(`CS_ACTION_FILEUPLOADED`)}` : t(`CS_ACTION_NO_FILEUPLOADED`),
39692
- textStyles: {
39693
- width: "100%"
39694
- },
39695
- buttonType: "button",
39696
- accept: signSpecs.accept,
39697
- uploadedFiles: signatureFileStoreId && !localFile ? [[(formValue === null || formValue === void 0 ? void 0 : formValue.signatureFileName) || (signatureFile === null || signatureFile === void 0 ? void 0 : signatureFile.fileName) || (signatureFile === null || signatureFile === void 0 ? void 0 : signatureFile.name) || "signature.jpg", {
39698
- fileStoreId: signatureFileStoreId
39699
- }]] : undefined,
39700
- removeTargetedFile: () => {
39701
- setLocalFile(null);
39702
- setSignatureFile(null);
39703
- setSignatureFileStoreId(null);
39704
- setSignError(null);
39705
- setValue("signatureFile", null, {
39706
- shouldDirty: true,
39707
- shouldValidate: true
39708
- });
39709
- setValue("signatureFileStoreId", null, {
39710
- shouldDirty: true,
39711
- shouldValidate: true
39712
- });
39713
- setValue("signatureFileName", "", {
39714
- shouldDirty: true,
39715
- shouldValidate: true
39716
- });
39717
- }
39718
- })), signatureFileStoreId && /*#__PURE__*/React.createElement("div", {
39719
- onClick: viewDocument,
39720
- style: {
39721
- cursor: "pointer"
39722
- }
39723
- }, /*#__PURE__*/React.createElement(ViewsIcon, null))), signError && /*#__PURE__*/React.createElement("div", {
39724
- style: {
39725
- fontSize: "12px",
39726
- color: "#d32f2f",
39727
- marginTop: "4px"
39728
- }
39729
- }, signError), !signatureFileStoreId && (formValue === null || formValue === void 0 ? void 0 : formValue.agree) && /*#__PURE__*/React.createElement(CardLabelError, {
39730
- style: {
39731
- color: "red",
39732
- fontSize: "12px",
39733
- marginTop: "4px"
39734
- }
39735
- }, t("WS_SIGNATURE_MANDATORY_ERROR") || "Signature is mandatory to submit application")))))), showDocModal && /*#__PURE__*/React.createElement(Modal, {
40054
+ })), showDocModal && /*#__PURE__*/React.createElement(Modal, {
39736
40055
  open: showDocModal,
39737
40056
  headerBarMain: t("WS_VIEW_DOCUMENT") || "View Document",
39738
40057
  headerBarEnd: /*#__PURE__*/React.createElement("div", {
@@ -39938,7 +40257,11 @@ const WSDjbEmployee = _ref => {
39938
40257
  defaultOpen: true
39939
40258
  }, /*#__PURE__*/React.createElement("div", {
39940
40259
  className: "formcomposer-section-grid"
39941
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("Are you a DJB Employee?")), /*#__PURE__*/React.createElement("div", {
40260
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
40261
+ label: t("Are you a DJB Employee?"),
40262
+ isMandatory: false,
40263
+ infoText: t("WS_DJB_EMPLOYEE_INFO_MSG", "Select Yes if applicant is an active or retired DJB Employee")
40264
+ }), /*#__PURE__*/React.createElement("div", {
39942
40265
  className: "field"
39943
40266
  }, /*#__PURE__*/React.createElement(Controller, {
39944
40267
  control: control,
@@ -39971,9 +40294,11 @@ const WSDjbEmployee = _ref => {
39971
40294
  })
39972
40295
  })))), isDjbEmployee && /*#__PURE__*/React.createElement("div", {
39973
40296
  className: "formcomposer-section-grid"
39974
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("Employee ID"), isDjbEmployee && /*#__PURE__*/React.createElement("span", {
39975
- className: "check-page-link-button"
39976
- }, " *")), /*#__PURE__*/React.createElement("div", {
40297
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
40298
+ label: t("Employee ID"),
40299
+ isMandatory: isDjbEmployee,
40300
+ infoText: t("WS_EMPLOYEE_ID_INFO_MSG", "Enter 8-digit DJB Employee ID")
40301
+ }), /*#__PURE__*/React.createElement("div", {
39977
40302
  className: "field",
39978
40303
  style: {
39979
40304
  width: "100%"
@@ -40011,9 +40336,11 @@ const WSDjbEmployee = _ref => {
40011
40336
  })
40012
40337
  }), (localFormState === null || localFormState === void 0 ? void 0 : (_localFormState$touch = localFormState.touched) === null || _localFormState$touch === void 0 ? void 0 : _localFormState$touch.employeeId) && (localFormState !== null && localFormState !== void 0 && (_localFormState$error = localFormState.errors) !== null && _localFormState$error !== void 0 && (_localFormState$error2 = _localFormState$error.employeeId) !== null && _localFormState$error2 !== void 0 && _localFormState$error2.message || djbErrors !== null && djbErrors !== void 0 && djbErrors.employeeId ? /*#__PURE__*/React.createElement(CardLabelError, {
40013
40338
  style: errorStyle
40014
- }, (localFormState === null || localFormState === void 0 ? void 0 : (_localFormState$error3 = localFormState.errors) === null || _localFormState$error3 === void 0 ? void 0 : (_localFormState$error4 = _localFormState$error3.employeeId) === null || _localFormState$error4 === void 0 ? void 0 : _localFormState$error4.message) || (djbErrors === null || djbErrors === void 0 ? void 0 : djbErrors.employeeId)) : null)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("Date of Retirement"), isDjbEmployee && /*#__PURE__*/React.createElement("span", {
40015
- className: "check-page-link-button"
40016
- }, " *")), /*#__PURE__*/React.createElement("div", {
40339
+ }, (localFormState === null || localFormState === void 0 ? void 0 : (_localFormState$error3 = localFormState.errors) === null || _localFormState$error3 === void 0 ? void 0 : (_localFormState$error4 = _localFormState$error3.employeeId) === null || _localFormState$error4 === void 0 ? void 0 : _localFormState$error4.message) || (djbErrors === null || djbErrors === void 0 ? void 0 : djbErrors.employeeId)) : null)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
40340
+ label: t("Date of Retirement"),
40341
+ isMandatory: isDjbEmployee,
40342
+ infoText: t("WS_DOR_INFO_MSG", "Select Date of Retirement")
40343
+ }), /*#__PURE__*/React.createElement("div", {
40017
40344
  className: "field"
40018
40345
  }, /*#__PURE__*/React.createElement(Controller, {
40019
40346
  control: control,
@@ -40025,9 +40352,11 @@ const WSDjbEmployee = _ref => {
40025
40352
  date: props.value,
40026
40353
  onChange: date => props.onChange(date)
40027
40354
  })
40028
- })))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("Employee Designation"), isDjbEmployee && /*#__PURE__*/React.createElement("span", {
40029
- className: "check-page-link-button"
40030
- }, " *")), /*#__PURE__*/React.createElement("div", {
40355
+ })))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
40356
+ label: t("Employee Designation"),
40357
+ isMandatory: isDjbEmployee,
40358
+ infoText: t("WS_EMPLOYEE_DESIGNATION_INFO_MSG", "Enter Employee Designation")
40359
+ }), /*#__PURE__*/React.createElement("div", {
40031
40360
  className: "field",
40032
40361
  style: {
40033
40362
  width: "100%"
@@ -40234,7 +40563,11 @@ const WSDivyangjan = _ref => {
40234
40563
  defaultOpen: true
40235
40564
  }, /*#__PURE__*/React.createElement("div", {
40236
40565
  className: "formcomposer-section-grid"
40237
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("Are you a Divyangjan/Person with Disability?")), /*#__PURE__*/React.createElement("div", {
40566
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
40567
+ label: t("Are you a Divyangjan/Person with Disability?"),
40568
+ isMandatory: false,
40569
+ infoText: t("WS_DIVYANGJAN_INFO_MSG", "Select Yes if applicant is a Divyangjan / Person with Disability")
40570
+ }), /*#__PURE__*/React.createElement("div", {
40238
40571
  className: "field"
40239
40572
  }, /*#__PURE__*/React.createElement(Controller, {
40240
40573
  control: control,
@@ -40351,7 +40684,11 @@ const WSRainWaterHarvesting = _ref => {
40351
40684
  defaultOpen: true
40352
40685
  }, /*#__PURE__*/React.createElement("div", {
40353
40686
  className: "formcomposer-section-grid"
40354
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("Rain Water Harvesting Certificate")), /*#__PURE__*/React.createElement("div", {
40687
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
40688
+ label: t("Rain Water Harvesting Certificate"),
40689
+ isMandatory: false,
40690
+ infoText: t("WS_RWH_INFO_MSG", "Select Yes if Rain Water Harvesting Certificate is available")
40691
+ }), /*#__PURE__*/React.createElement("div", {
40355
40692
  className: "field"
40356
40693
  }, /*#__PURE__*/React.createElement(Controller, {
40357
40694
  control: control,
@@ -40479,7 +40816,11 @@ const WSSewerTreatmentPlant = _ref => {
40479
40816
  defaultOpen: true
40480
40817
  }, /*#__PURE__*/React.createElement("div", {
40481
40818
  className: "formcomposer-section-grid"
40482
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("Sewer Treatment Plant (STP)")), /*#__PURE__*/React.createElement("div", {
40819
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
40820
+ label: t("Sewer Treatment Plant (STP)"),
40821
+ isMandatory: false,
40822
+ infoText: t("WS_STP_INFO_MSG", "Select Yes if Sewer Treatment Plant is available")
40823
+ }), /*#__PURE__*/React.createElement("div", {
40483
40824
  className: "field"
40484
40825
  }, /*#__PURE__*/React.createElement(Controller, {
40485
40826
  control: control,
@@ -40617,8 +40958,8 @@ const PropertyWaterConnection = _ref => {
40617
40958
  }
40618
40959
  }, [showToast]);
40619
40960
  const getPlotAreaError = () => {
40620
- const trans = t("WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA");
40621
- return trans && trans !== "WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA" ? trans : "Plot area should always be more than built up area.";
40961
+ const trans = t("WS_PLOT_AREA_MORE_THAN_OR_EQUAL_BUILT_UP_AREA") || t("WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA");
40962
+ return trans && trans !== "WS_PLOT_AREA_MORE_THAN_OR_EQUAL_BUILT_UP_AREA" && trans !== "WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA" ? trans : "Plot area should always be more than or equal to built up area.";
40622
40963
  };
40623
40964
  const getHeightErrorMessage = () => {
40624
40965
  const trans = t("WS_HEIGHT_OF_BUILDING_NORMAL_ERROR");
@@ -40629,7 +40970,7 @@ const PropertyWaterConnection = _ref => {
40629
40970
  const plot = parseFloat(watchPlotArea);
40630
40971
  const built = parseFloat(watchBuiltUpArea);
40631
40972
  if (!isNaN(plot) && !isNaN(built)) {
40632
- return plot <= built;
40973
+ return plot < built;
40633
40974
  }
40634
40975
  return false;
40635
40976
  }, [watchPlotArea, watchBuiltUpArea]);
@@ -40644,7 +40985,7 @@ const PropertyWaterConnection = _ref => {
40644
40985
  const handleAreaBlur = () => {
40645
40986
  const plot = parseFloat(watchPlotArea);
40646
40987
  const built = parseFloat(watchBuiltUpArea);
40647
- if (!isNaN(plot) && !isNaN(built) && plot <= built) {
40988
+ if (!isNaN(plot) && !isNaN(built) && plot < built) {
40648
40989
  setShowToast({
40649
40990
  key: true,
40650
40991
  label: getPlotAreaError()
@@ -41034,9 +41375,11 @@ const PropertyWaterConnection = _ref => {
41034
41375
  style: props.style
41035
41376
  }, /*#__PURE__*/React.createElement("div", {
41036
41377
  className: "formcomposer-section-grid"
41037
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PROPERTY_TYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
41038
- className: "check-page-link-button"
41039
- }, "*")), /*#__PURE__*/React.createElement("div", {
41378
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41379
+ label: t("WS_PROPERTY_TYPE"),
41380
+ isMandatory: true,
41381
+ infoText: t("WS_PROPERTY_TYPE_INFO_MSG", "Select Property Type")
41382
+ }), /*#__PURE__*/React.createElement("div", {
41040
41383
  className: "form-field"
41041
41384
  }, /*#__PURE__*/React.createElement(Controller, {
41042
41385
  control: control,
@@ -41081,7 +41424,11 @@ const PropertyWaterConnection = _ref => {
41081
41424
  placeholder: "Enter Answer",
41082
41425
  onChange: e => handleAnswerChange(index, questionText, e.target.value)
41083
41426
  })));
41084
- }), isSchoolCollegeProperty ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_STUDENTS")}`), /*#__PURE__*/React.createElement("div", {
41427
+ }), isSchoolCollegeProperty ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41428
+ label: t("WS_NUMBER_OF_STUDENTS"),
41429
+ isMandatory: false,
41430
+ infoText: t("WS_NUMBER_OF_STUDENTS_INFO_MSG", "Enter Number of Students")
41431
+ }), /*#__PURE__*/React.createElement("div", {
41085
41432
  className: "form-field"
41086
41433
  }, /*#__PURE__*/React.createElement(TextInput, {
41087
41434
  t: t,
@@ -41096,9 +41443,11 @@ const PropertyWaterConnection = _ref => {
41096
41443
  placeholder: t("WS_NUMBER_OF_STUDENTS")
41097
41444
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails2 = errors.useDetails) === null || _errors$useDetails2 === void 0 ? void 0 : _errors$useDetails2.numberOfStudents) && /*#__PURE__*/React.createElement(CardLabelError, {
41098
41445
  style: errorStyle
41099
- }, errors.useDetails.numberOfStudents.message)) : null, isHotelRestaurantProperty ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_ROOMS")}`, /*#__PURE__*/React.createElement("span", {
41100
- className: "check-page-link-button"
41101
- }, " *")), /*#__PURE__*/React.createElement("div", {
41446
+ }, errors.useDetails.numberOfStudents.message)) : null, isHotelRestaurantProperty ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41447
+ label: t("WS_NUMBER_OF_ROOMS"),
41448
+ isMandatory: true,
41449
+ infoText: t("WS_NUMBER_OF_ROOMS_INFO_MSG", "Enter Number of Rooms")
41450
+ }), /*#__PURE__*/React.createElement("div", {
41102
41451
  className: "form-field"
41103
41452
  }, /*#__PURE__*/React.createElement(TextInput, {
41104
41453
  t: t,
@@ -41114,9 +41463,11 @@ const PropertyWaterConnection = _ref => {
41114
41463
  placeholder: t("WS_NUMBER_OF_ROOMS")
41115
41464
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails3 = errors.useDetails) === null || _errors$useDetails3 === void 0 ? void 0 : _errors$useDetails3.NumberofRooms) && /*#__PURE__*/React.createElement(CardLabelError, {
41116
41465
  style: errorStyle
41117
- }, errors.useDetails.NumberofRooms.message)) : null, isHospitalProperty ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_BEDS")}`, /*#__PURE__*/React.createElement("span", {
41118
- className: "check-page-link-button"
41119
- }, " *")), /*#__PURE__*/React.createElement("div", {
41466
+ }, errors.useDetails.NumberofRooms.message)) : null, isHospitalProperty ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41467
+ label: t("WS_NUMBER_OF_BEDS"),
41468
+ isMandatory: true,
41469
+ infoText: t("WS_NUMBER_OF_BEDS_INFO_MSG", "Enter Number of Beds")
41470
+ }), /*#__PURE__*/React.createElement("div", {
41120
41471
  className: "form-field"
41121
41472
  }, /*#__PURE__*/React.createElement(TextInput, {
41122
41473
  t: t,
@@ -41132,9 +41483,11 @@ const PropertyWaterConnection = _ref => {
41132
41483
  placeholder: t("WS_NUMBER_OF_BEDS")
41133
41484
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails4 = errors.useDetails) === null || _errors$useDetails4 === void 0 ? void 0 : _errors$useDetails4.numberOfBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
41134
41485
  style: errorStyle
41135
- }, errors.useDetails.numberOfBeds.message)) : null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_CATEGORY_TYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
41136
- className: "check-page-link-button"
41137
- }, "*")), /*#__PURE__*/React.createElement("div", {
41486
+ }, errors.useDetails.numberOfBeds.message)) : null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41487
+ label: t("WS_CATEGORY_TYPE"),
41488
+ isMandatory: true,
41489
+ infoText: t("WS_CATEGORY_TYPE_INFO_MSG", "Select Category Type")
41490
+ }), /*#__PURE__*/React.createElement("div", {
41138
41491
  className: "form-field"
41139
41492
  }, /*#__PURE__*/React.createElement(Controller, {
41140
41493
  control: control,
@@ -41154,9 +41507,11 @@ const PropertyWaterConnection = _ref => {
41154
41507
  })
41155
41508
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails5 = errors.useDetails) === null || _errors$useDetails5 === void 0 ? void 0 : _errors$useDetails5.categoryType) && /*#__PURE__*/React.createElement(CardLabelError, {
41156
41509
  style: errorStyle
41157
- }, errors.useDetails.categoryType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PROPERTY_CATEGORY")}`, " ", /*#__PURE__*/React.createElement("span", {
41158
- className: "check-page-link-button"
41159
- }, "*")), /*#__PURE__*/React.createElement("div", {
41510
+ }, errors.useDetails.categoryType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41511
+ label: t("WS_PROPERTY_CATEGORY"),
41512
+ isMandatory: true,
41513
+ infoText: t("WS_PROPERTY_CATEGORY_INFO_MSG", "Select Property Category")
41514
+ }), /*#__PURE__*/React.createElement("div", {
41160
41515
  className: "form-field"
41161
41516
  }, /*#__PURE__*/React.createElement(Controller, {
41162
41517
  control: control,
@@ -41176,9 +41531,11 @@ const PropertyWaterConnection = _ref => {
41176
41531
  })
41177
41532
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails6 = errors.useDetails) === null || _errors$useDetails6 === void 0 ? void 0 : _errors$useDetails6.propertyCategory) && /*#__PURE__*/React.createElement(CardLabelError, {
41178
41533
  style: errorStyle
41179
- }, errors.useDetails.propertyCategory.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_WATER_CONNECTION_USAGE_TYPE")}`, " ", /*#__PURE__*/React.createElement("span", {
41180
- className: "check-page-link-button"
41181
- }, "*")), /*#__PURE__*/React.createElement("div", {
41534
+ }, errors.useDetails.propertyCategory.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41535
+ label: t("WS_WATER_CONNECTION_USAGE_TYPE"),
41536
+ isMandatory: true,
41537
+ infoText: t("WS_WATER_CONNECTION_USAGE_TYPE_INFO_MSG", "Select Water Connection Usage Type")
41538
+ }), /*#__PURE__*/React.createElement("div", {
41182
41539
  className: "form-field"
41183
41540
  }, /*#__PURE__*/React.createElement(Controller, {
41184
41541
  control: control,
@@ -41198,9 +41555,11 @@ const PropertyWaterConnection = _ref => {
41198
41555
  })
41199
41556
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails7 = errors.useDetails) === null || _errors$useDetails7 === void 0 ? void 0 : _errors$useDetails7.WaterConnectionUsageType) && /*#__PURE__*/React.createElement(CardLabelError, {
41200
41557
  style: errorStyle
41201
- }, errors.useDetails.WaterConnectionUsageType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_PLOT_AREA")}`, " ", /*#__PURE__*/React.createElement("span", {
41202
- className: "check-page-link-button"
41203
- }, "*")), /*#__PURE__*/React.createElement("div", {
41558
+ }, errors.useDetails.WaterConnectionUsageType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41559
+ label: t("WS_PLOT_AREA"),
41560
+ isMandatory: true,
41561
+ infoText: t("WS_PLOT_AREA_INFO_MSG", "Enter Plot Area (sq. meter.)")
41562
+ }), /*#__PURE__*/React.createElement("div", {
41204
41563
  className: "form-field"
41205
41564
  }, /*#__PURE__*/React.createElement(TextInput, {
41206
41565
  t: t,
@@ -41232,9 +41591,11 @@ const PropertyWaterConnection = _ref => {
41232
41591
  color: "#d4351c",
41233
41592
  marginTop: "4px"
41234
41593
  }
41235
- }, errors.useDetails.plotArea.message))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_BUILT_UP_AREA")}`, " ", /*#__PURE__*/React.createElement("span", {
41236
- className: "check-page-link-button"
41237
- }, "*")), /*#__PURE__*/React.createElement("div", {
41594
+ }, errors.useDetails.plotArea.message))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41595
+ label: t("WS_BUILT_UP_AREA"),
41596
+ isMandatory: true,
41597
+ infoText: t("WS_BUILT_UP_AREA_INFO_MSG", "Enter Built-up Area (sq. meter.)")
41598
+ }), /*#__PURE__*/React.createElement("div", {
41238
41599
  className: "form-field"
41239
41600
  }, /*#__PURE__*/React.createElement(TextInput, {
41240
41601
  t: t,
@@ -41272,9 +41633,11 @@ const PropertyWaterConnection = _ref => {
41272
41633
  color: "#d4351c",
41273
41634
  marginTop: "4px"
41274
41635
  }
41275
- }, getPlotAreaError()) : null)), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_HEIGHT_OF_THE_BUILDING(meters)")}`, /*#__PURE__*/React.createElement("span", {
41276
- className: "check-page-link-button"
41277
- }, " *")), /*#__PURE__*/React.createElement("div", {
41636
+ }, getPlotAreaError()) : null)), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41637
+ label: t("WS_HEIGHT_OF_THE_BUILDING(meters)"),
41638
+ isMandatory: true,
41639
+ infoText: t("WS_HEIGHT_OF_THE_BUILDING_INFO_MSG", "Enter Height of The Building (meter)")
41640
+ }), /*#__PURE__*/React.createElement("div", {
41278
41641
  className: "form-field"
41279
41642
  }, /*#__PURE__*/React.createElement(TextInput, {
41280
41643
  t: t,
@@ -41313,7 +41676,11 @@ const PropertyWaterConnection = _ref => {
41313
41676
  color: "#d4351c",
41314
41677
  marginTop: "4px"
41315
41678
  }
41316
- }, getHeightErrorMessage()) : null)), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_SELECT_YEAR_OF_CONSTRUCTION")}`), /*#__PURE__*/React.createElement("div", {
41679
+ }, getHeightErrorMessage()) : null)), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41680
+ label: t("WS_SELECT_YEAR_OF_CONSTRUCTION"),
41681
+ isMandatory: false,
41682
+ infoText: t("WS_SELECT_YEAR_OF_CONSTRUCTION_INFO_MSG", "Select Year of Construction")
41683
+ }), /*#__PURE__*/React.createElement("div", {
41317
41684
  className: "form-field"
41318
41685
  }, /*#__PURE__*/React.createElement(Controller, {
41319
41686
  control: control,
@@ -41330,9 +41697,11 @@ const PropertyWaterConnection = _ref => {
41330
41697
  })
41331
41698
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails1 = errors.useDetails) === null || _errors$useDetails1 === void 0 ? void 0 : _errors$useDetails1.SelectYearofConstruction) && /*#__PURE__*/React.createElement(CardLabelError, {
41332
41699
  style: errorStyle
41333
- }, errors.useDetails.SelectYearofConstruction.message), isDwellingUnit ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("WS_NUMBER_OF_DWELLING_UNITS")}`, /*#__PURE__*/React.createElement("span", {
41334
- className: "check-page-link-button"
41335
- }, " *")), /*#__PURE__*/React.createElement("div", {
41700
+ }, errors.useDetails.SelectYearofConstruction.message), isDwellingUnit ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(FieldLabelWithTooltip, {
41701
+ label: t("WS_NUMBER_OF_DWELLING_UNITS"),
41702
+ isMandatory: true,
41703
+ infoText: t("WS_NUMBER_OF_DWELLING_UNITS_INFO_MSG", "Enter Number of Dwelling Units")
41704
+ }), /*#__PURE__*/React.createElement("div", {
41336
41705
  className: "form-field"
41337
41706
  }, /*#__PURE__*/React.createElement(TextInput, {
41338
41707
  t: t,
@@ -48988,7 +49357,23 @@ const WSApplicationDetails = () => {
48988
49357
  } = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, applicationNobyData, applicationNobyData !== null && applicationNobyData !== void 0 && applicationNobyData.includes("SW") ? "SEWERAGE" : "WATER", user);
48989
49358
  const feeEstimationSection = appDetailsData === null || appDetailsData === void 0 ? void 0 : (_appDetailsData$appli = appDetailsData.applicationDetails) === null || _appDetailsData$appli === void 0 ? void 0 : _appDetailsData$appli.find(section => (section === null || section === void 0 ? void 0 : section.title) === "WS_TASK_DETAILS_FEE_ESTIMATE");
48990
49359
  if (feeEstimationSection && feeEstimationSection.additionalDetails) {
48991
- feeEstimationSection.additionalDetails.isPaid = isPaid;
49360
+ var _feeEstimationSection, _feeEstimationSection2, _feeEstimationSection3, _feeEstimationSection4, _feeEstimationSection5, _feeEstimationSection6, _feeEstimationSection7;
49361
+ const isPropUpdated = Boolean(feeEstimationSection.additionalDetails.isPropUpdated || feeEstimationSection.additionalDetails.hasAdditionalInfraCharge || ((_feeEstimationSection = feeEstimationSection.additionalDetails.values) === null || _feeEstimationSection === void 0 ? void 0 : _feeEstimationSection.some(v => (v === null || v === void 0 ? void 0 : v.title) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" || (v === null || v === void 0 ? void 0 : v.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE")) || ((_feeEstimationSection2 = feeEstimationSection.additionalDetails.data) === null || _feeEstimationSection2 === void 0 ? void 0 : (_feeEstimationSection3 = _feeEstimationSection2.taxHeadEstimates) === null || _feeEstimationSection3 === void 0 ? void 0 : _feeEstimationSection3.some(t => (t === null || t === void 0 ? void 0 : t.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE")) || ((_feeEstimationSection4 = feeEstimationSection.additionalDetails.data) === null || _feeEstimationSection4 === void 0 ? void 0 : (_feeEstimationSection5 = _feeEstimationSection4.billDetails) === null || _feeEstimationSection5 === void 0 ? void 0 : (_feeEstimationSection6 = _feeEstimationSection5[0]) === null || _feeEstimationSection6 === void 0 ? void 0 : (_feeEstimationSection7 = _feeEstimationSection6.billAccountDetails) === null || _feeEstimationSection7 === void 0 ? void 0 : _feeEstimationSection7.some(t => (t === null || t === void 0 ? void 0 : t.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE")));
49362
+ if (isPropUpdated) {
49363
+ var _feeEstimationSection8, _feeEstimationSection9, _feeEstimationSection0;
49364
+ const hasUnpaid = feeEstimationSection.additionalDetails.hasUnpaidCharge !== undefined ? feeEstimationSection.additionalDetails.hasUnpaidCharge : ((_feeEstimationSection8 = feeEstimationSection.additionalDetails.data) === null || _feeEstimationSection8 === void 0 ? void 0 : (_feeEstimationSection9 = _feeEstimationSection8.taxHeadEstimates) === null || _feeEstimationSection9 === void 0 ? void 0 : _feeEstimationSection9.some(t => {
49365
+ const st = String((t === null || t === void 0 ? void 0 : t.status) || "").toUpperCase();
49366
+ return st === "UNPAID" || (t === null || t === void 0 ? void 0 : t.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" && st !== "PAID";
49367
+ })) || ((_feeEstimationSection0 = feeEstimationSection.additionalDetails.values) === null || _feeEstimationSection0 === void 0 ? void 0 : _feeEstimationSection0.some(v => {
49368
+ const st = String((v === null || v === void 0 ? void 0 : v.status) || "").toUpperCase();
49369
+ return st === "UNPAID" || ((v === null || v === void 0 ? void 0 : v.title) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE" || (v === null || v === void 0 ? void 0 : v.taxHeadCode) === "WS_ADDITIONAL_INFRASTRUCTURE_CHARGE") && st !== "PAID";
49370
+ }));
49371
+ feeEstimationSection.additionalDetails.isPaid = !hasUnpaid;
49372
+ feeEstimationSection.additionalDetails.hasUnpaidCharge = hasUnpaid;
49373
+ feeEstimationSection.additionalDetails.isPropUpdated = true;
49374
+ } else {
49375
+ feeEstimationSection.additionalDetails.isPaid = isPaid;
49376
+ }
48992
49377
  }
48993
49378
  if (isLoading || isAppDetailsLoading) {
48994
49379
  return /*#__PURE__*/React.createElement(Loader, null);
@@ -55286,7 +55671,7 @@ const WSInfoPage = () => {
55286
55671
  const fullAddr = getAddress$1(target.address, t, target);
55287
55672
  const formatted = {
55288
55673
  ...target,
55289
- displayName: fullAddr ? `${target.propertyId} - ${fullAddr}` : target.propertyId
55674
+ displayName: fullAddr ? `${fullAddr}` : ""
55290
55675
  };
55291
55676
  setSelectedProperty(formatted);
55292
55677
  sessionStorage.setItem("WS_OTP_VERIFIED_PROPERTY_ID", target.propertyId);
@@ -55434,7 +55819,7 @@ const WSInfoPage = () => {
55434
55819
  const fullAddr = getAddress$1(fallbackProp.address, t, fallbackProp);
55435
55820
  const formatted = {
55436
55821
  ...fallbackProp,
55437
- displayName: fullAddr ? `${fallbackProp.propertyId} - ${fullAddr}` : fallbackProp.propertyId
55822
+ displayName: fullAddr ? `${fullAddr}` : ""
55438
55823
  };
55439
55824
  setSelectedProperty(formatted);
55440
55825
  sessionStorage.setItem("WS_OTP_VERIFIED_PROPERTY_ID", fallbackProp.propertyId);
@@ -55499,19 +55884,26 @@ const WSInfoPage = () => {
55499
55884
  const fullAddr = getAddress$1(prop.address, t, prop);
55500
55885
  return {
55501
55886
  ...prop,
55502
- displayName: fullAddr ? `${prop.propertyId} - ${fullAddr}` : prop.propertyId
55887
+ displayName: fullAddr ? `${fullAddr}` : ""
55503
55888
  };
55504
55889
  });
55505
55890
  if (selectedProperty && !list.some(p => p.propertyId === selectedProperty.propertyId)) {
55506
55891
  const fullAddr = getAddress$1(selectedProperty.address, t, selectedProperty);
55507
55892
  const selProp = {
55508
55893
  ...selectedProperty,
55509
- displayName: fullAddr ? `${selectedProperty.propertyId} - ${fullAddr}` : selectedProperty.propertyId
55894
+ displayName: fullAddr ? `${fullAddr}` : ""
55510
55895
  };
55511
55896
  return [selProp, ...list];
55512
55897
  }
55513
55898
  return list;
55514
55899
  }, [propertyDetails, selectedProperty, t]);
55900
+ const propertyAddressDisplay = React.useMemo(() => {
55901
+ var _propertyDetails$Prop, _propByIdData$Propert3;
55902
+ if (!isMobileVerified) return "";
55903
+ const prop = selectedProperty || createdPropertyId && ((propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop.find(p => p.propertyId === createdPropertyId)) || (propByIdData === null || propByIdData === void 0 ? void 0 : (_propByIdData$Propert3 = propByIdData.Properties) === null || _propByIdData$Propert3 === void 0 ? void 0 : _propByIdData$Propert3[0])) || createdProperty;
55904
+ if (!prop) return "";
55905
+ return getAddress$1(prop === null || prop === void 0 ? void 0 : prop.address, t, prop) || (prop === null || prop === void 0 ? void 0 : prop.displayName) || "";
55906
+ }, [isMobileVerified, selectedProperty, createdPropertyId, propertyDetails, propByIdData, createdProperty, t]);
55515
55907
  const handleDigiLockerLogin = function (e) {
55516
55908
  try {
55517
55909
  if (e && e.preventDefault) e.preventDefault();
@@ -56377,7 +56769,7 @@ const WSInfoPage = () => {
56377
56769
  className: "ws-service-tag"
56378
56770
  }, t("Apply For New Connection")), /*#__PURE__*/React.createElement("span", {
56379
56771
  className: "ws-portal-tag"
56380
- }, isEmployee ? t("Employee Portal") : t("Citizen Services"))), /*#__PURE__*/React.createElement("div", {
56772
+ }, isEmployee ? t("Employee Portal") : t("Citizen Services"))), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) !== "YES" && /*#__PURE__*/React.createElement("div", {
56381
56773
  className: "ws-digilocker-box"
56382
56774
  }, /*#__PURE__*/React.createElement("div", {
56383
56775
  className: "ws-digilocker-content"
@@ -56403,24 +56795,20 @@ const WSInfoPage = () => {
56403
56795
  }, t("RECOMMENDED"))), /*#__PURE__*/React.createElement("p", {
56404
56796
  className: "ws-dl-sub"
56405
56797
  }, t("Fetch your verified Aadhaar, Electricity Bill, and Identity documents directly without manual upload.")))), /*#__PURE__*/React.createElement("button", {
56798
+ className: "ws-btn ws-btn-primary",
56799
+ type: "button",
56800
+ onClick: handleCreateProperty
56801
+ }, t("Start Your Application")), /*#__PURE__*/React.createElement("button", {
56406
56802
  type: "button",
56407
56803
  className: "ws-btn ws-btn-digilocker",
56408
56804
  onClick: handleDigiLockerLogin
56409
- }, /*#__PURE__*/React.createElement("span", null, "\uD83D\uDD10"), /*#__PURE__*/React.createElement("span", null, t("DigiLocker Consent")))), /*#__PURE__*/React.createElement("div", {
56805
+ }, /*#__PURE__*/React.createElement("span", null, "\uD83D\uDD10"), /*#__PURE__*/React.createElement("span", null, t("DigiLocker Consent")))), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
56410
56806
  className: "ws-card"
56411
56807
  }, /*#__PURE__*/React.createElement("div", {
56412
- className: "ws-step-header"
56413
- }, /*#__PURE__*/React.createElement("div", {
56414
- className: "ws-step-num-badge"
56415
- }, "1"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", {
56416
- className: "ws-step-title"
56417
- }, t("Property Verification & Linking")), /*#__PURE__*/React.createElement("p", {
56418
- className: "ws-step-subtitle"
56419
- }, t("A Registered Property Details is required to apply for a water/sewerage connection. Linking your Details enables to apply for a New Connection.")))), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
56420
56808
  className: "ws-prop-guide-banner"
56421
56809
  }, /*#__PURE__*/React.createElement("span", {
56422
56810
  className: "ws-guide-step-tag"
56423
- }, "Step 1.1"), /*#__PURE__*/React.createElement("span", null, t("Enter your registered mobile number, verify via OTP, and select your property from the dropdown."))), /*#__PURE__*/React.createElement("div", {
56811
+ }, "Step 1.1"), /*#__PURE__*/React.createElement("span", null, t("Enter your registered mobile number and verify via OTP."))), /*#__PURE__*/React.createElement("div", {
56424
56812
  className: "ws-prop-grid"
56425
56813
  }, /*#__PURE__*/React.createElement("div", {
56426
56814
  className: "ws-field-col"
@@ -56448,7 +56836,7 @@ const WSInfoPage = () => {
56448
56836
  },
56449
56837
  placeholder: t("Enter 10-digit mobile number"),
56450
56838
  maxLength: 10,
56451
- disabled: isMobileVerified
56839
+ disabled: true
56452
56840
  })), (searchMobileNumber === null || searchMobileNumber === void 0 ? void 0 : searchMobileNumber.length) === 10 && !isMobileVerified && !showOtpVerification && /*#__PURE__*/React.createElement("button", {
56453
56841
  type: "button",
56454
56842
  className: "ws-btn ws-btn-outline",
@@ -56462,39 +56850,18 @@ const WSInfoPage = () => {
56462
56850
  style: {
56463
56851
  padding: "12px 0"
56464
56852
  }
56465
- }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
56466
- option: propertyOptions,
56467
- optionKey: "displayName",
56468
- id: "propertyId",
56469
- selected: selectedProperty,
56470
- select: val => {
56471
- const fullAddr = getAddress$1(val === null || val === void 0 ? void 0 : val.address, t, val);
56472
- const formattedVal = val ? {
56473
- ...val,
56474
- displayName: fullAddr ? `${val.propertyId} - ${fullAddr}` : val.propertyId
56475
- } : null;
56476
- setSelectedProperty(formattedVal);
56477
- setShowOtpVerification(false);
56478
- setOtp("");
56479
- if (val !== null && val !== void 0 && val.propertyId) {
56480
- sessionStorage.setItem("WS_OTP_VERIFIED_PROPERTY_ID", val.propertyId);
56481
- }
56482
- },
56853
+ }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextInput, {
56483
56854
  t: t,
56484
- placeholder: isMobileVerified ? t("Select Property from list") : t("Verify mobile number to view properties"),
56485
- disable: !isMobileVerified || propertyOptions.length === 0
56486
- }), selectedProperty && /*#__PURE__*/React.createElement("div", {
56487
- className: "ws-selected-prop-badge"
56488
- }, /*#__PURE__*/React.createElement("svg", {
56489
- width: "14",
56490
- height: "14",
56491
- viewBox: "0 0 24 24",
56492
- fill: "none",
56493
- stroke: "#00703c",
56494
- strokeWidth: "2.5"
56495
- }, /*#__PURE__*/React.createElement("polyline", {
56496
- points: "20 6 9 17 4 12"
56497
- })), /*#__PURE__*/React.createElement("span", null, t("Property details & address will be automatically populated in the application.")))))), showOtpVerification && !isMobileVerified && /*#__PURE__*/React.createElement("div", {
56855
+ type: "text",
56856
+ isMandatory: false,
56857
+ name: "propertyAddress",
56858
+ value: propertyAddressDisplay,
56859
+ placeholder: isMobileVerified ? t("Property Address") : t("Verify mobile number to view property"),
56860
+ disabled: true,
56861
+ style: {
56862
+ width: "100%"
56863
+ }
56864
+ })))), showOtpVerification && !isMobileVerified && /*#__PURE__*/React.createElement("div", {
56498
56865
  className: "ws-otp-box"
56499
56866
  }, /*#__PURE__*/React.createElement("div", {
56500
56867
  className: "ws-otp-header"
@@ -56541,26 +56908,7 @@ const WSInfoPage = () => {
56541
56908
  disabled: timeLeft > 0 || isOtpSending
56542
56909
  }, timeLeft > 0 ? `${t("Resend OTP")} (${timeLeft < 10 ? `0${timeLeft}` : timeLeft}s)` : t("Resend OTP")))), timeLeft > 0 && /*#__PURE__*/React.createElement("div", {
56543
56910
  className: "ws-otp-timer-note"
56544
- }, t("Didn't receive OTP? You can resend after"), " ", timeLeft, " ", t("seconds"), ".")), isMobileVerified && /*#__PURE__*/React.createElement("div", {
56545
- className: "ws-verified-banner"
56546
- }, /*#__PURE__*/React.createElement("div", {
56547
- className: "ws-verified-text"
56548
- }, /*#__PURE__*/React.createElement("span", {
56549
- className: "ws-verified-check"
56550
- }, "\u2713"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("strong", null, t("Mobile number verified successfully!")), /*#__PURE__*/React.createElement("div", {
56551
- className: "ws-verified-sub"
56552
- }, t("Properties linked to this mobile number are available in the dropdown below.")))), /*#__PURE__*/React.createElement("button", {
56553
- type: "button",
56554
- className: "ws-btn-link",
56555
- onClick: () => {
56556
- setIsMobileVerified(false);
56557
- setSelectedProperty(null);
56558
- setOtp("");
56559
- setShowOtpVerification(false);
56560
- sessionStorage.removeItem("WS_OTP_VERIFIED_PROPERTY_ID");
56561
- hasAutoSelected.current = false;
56562
- }
56563
- }, t("Change Number"))), (searchMobileNumber === null || searchMobileNumber === void 0 ? void 0 : searchMobileNumber.length) === 10 && isMobileVerified && !isLoading && propertyOptions.length === 0 && /*#__PURE__*/React.createElement("div", {
56911
+ }, t("Didn't receive OTP? You can resend after"), " ", timeLeft, " ", t("seconds"), ".")), (searchMobileNumber === null || searchMobileNumber === void 0 ? void 0 : searchMobileNumber.length) === 10 && isMobileVerified && !isLoading && propertyOptions.length === 0 && /*#__PURE__*/React.createElement("div", {
56564
56912
  className: "ws-no-prop-alert"
56565
56913
  }, /*#__PURE__*/React.createElement("div", {
56566
56914
  className: "ws-no-prop-icon"
@@ -56570,54 +56918,13 @@ const WSInfoPage = () => {
56570
56918
  className: "ws-btn ws-btn-primary",
56571
56919
  type: "button",
56572
56920
  onClick: handleCreateProperty
56573
- }, t("WS_Register_New_Property"))))), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "NO" && /*#__PURE__*/React.createElement("div", {
56574
- className: "ws-prop-no-block"
56575
- }, /*#__PURE__*/React.createElement("div", {
56576
- className: "ws-no-prop-notice"
56577
- }, /*#__PURE__*/React.createElement("div", {
56578
- className: "ws-notice-icon-circle"
56579
- }, "\u2139\uFE0F"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, t("Property Registration is Mandatory")), /*#__PURE__*/React.createElement("p", null, t("To apply for a new water or sewerage connection with Delhi Jal Board, your premises must first be registered with a Property ID. Please click below to register your property.")))), /*#__PURE__*/React.createElement("div", {
56580
- style: {
56581
- display: "flex",
56582
- gap: "16px",
56583
- alignItems: "center",
56584
- flexWrap: "wrap",
56585
- marginTop: "12px"
56586
- }
56587
- }, /*#__PURE__*/React.createElement("button", {
56588
- className: "ws-btn ws-btn-primary",
56589
- type: "button",
56590
- onClick: handleCreateProperty
56591
56921
  }, t("WS_Register_New_Property"))))), /*#__PURE__*/React.createElement("div", {
56592
56922
  className: "ws-action-card"
56593
56923
  }, /*#__PURE__*/React.createElement("div", {
56594
56924
  className: "ws-action-content"
56595
56925
  }, /*#__PURE__*/React.createElement("div", {
56596
56926
  className: "ws-action-hint"
56597
- }, !hasProperty ? /*#__PURE__*/React.createElement("div", {
56598
- className: "ws-hint-badge ws-hint-warning"
56599
- }, /*#__PURE__*/React.createElement("svg", {
56600
- width: "18",
56601
- height: "18",
56602
- viewBox: "0 0 24 24",
56603
- fill: "none",
56604
- stroke: "currentColor",
56605
- strokeWidth: "2"
56606
- }, /*#__PURE__*/React.createElement("circle", {
56607
- cx: "12",
56608
- cy: "12",
56609
- r: "10"
56610
- }), /*#__PURE__*/React.createElement("line", {
56611
- x1: "12",
56612
- y1: "8",
56613
- x2: "12",
56614
- y2: "12"
56615
- }), /*#__PURE__*/React.createElement("line", {
56616
- x1: "12",
56617
- y1: "16",
56618
- x2: "12.01",
56619
- y2: "16"
56620
- })), /*#__PURE__*/React.createElement("span", null, t("Please select whether you have an existing property in Step 1 to continue."))) : (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && !selectedProperty ? /*#__PURE__*/React.createElement("div", {
56927
+ }, !selectedProperty ? /*#__PURE__*/React.createElement("div", {
56621
56928
  className: "ws-hint-badge ws-hint-warning"
56622
56929
  }, /*#__PURE__*/React.createElement("svg", {
56623
56930
  width: "18",
@@ -56640,30 +56947,7 @@ const WSInfoPage = () => {
56640
56947
  y1: "16",
56641
56948
  x2: "12.01",
56642
56949
  y2: "16"
56643
- })), /*#__PURE__*/React.createElement("span", null, t("Please verify your mobile number and select a property from the dropdown to proceed."))) : (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "NO" ? /*#__PURE__*/React.createElement("div", {
56644
- className: "ws-hint-badge ws-hint-info"
56645
- }, /*#__PURE__*/React.createElement("svg", {
56646
- width: "18",
56647
- height: "18",
56648
- viewBox: "0 0 24 24",
56649
- fill: "none",
56650
- stroke: "currentColor",
56651
- strokeWidth: "2"
56652
- }, /*#__PURE__*/React.createElement("circle", {
56653
- cx: "12",
56654
- cy: "12",
56655
- r: "10"
56656
- }), /*#__PURE__*/React.createElement("line", {
56657
- x1: "12",
56658
- y1: "16",
56659
- x2: "12",
56660
- y2: "12"
56661
- }), /*#__PURE__*/React.createElement("line", {
56662
- x1: "12",
56663
- y1: "8",
56664
- x2: "12.01",
56665
- y2: "8"
56666
- })), /*#__PURE__*/React.createElement("span", null, t("Please register your property using the button in Step 1 before applying."))) : /*#__PURE__*/React.createElement("div", {
56950
+ })), /*#__PURE__*/React.createElement("span", null, t("Please verify your mobile number via OTP to proceed."))) : /*#__PURE__*/React.createElement("div", {
56667
56951
  className: "ws-hint-badge ws-hint-success"
56668
56952
  }, /*#__PURE__*/React.createElement("svg", {
56669
56953
  width: "18",
@@ -56695,7 +56979,7 @@ const WSInfoPage = () => {
56695
56979
  y2: "12"
56696
56980
  }), /*#__PURE__*/React.createElement("polyline", {
56697
56981
  points: "12 5 19 12 12 19"
56698
- }))))))), showToast && /*#__PURE__*/React.createElement(Toast, {
56982
+ })))))))), showToast && /*#__PURE__*/React.createElement(Toast, {
56699
56983
  error: showToast.key === "error",
56700
56984
  warning: showToast.key === "warning",
56701
56985
  label: t(showToast.message),
@@ -58103,11 +58387,11 @@ const NewApplication = () => {
58103
58387
  }
58104
58388
  const plotAreaNum = parseFloat(data === null || data === void 0 ? void 0 : (_data$useDetails = data.useDetails) === null || _data$useDetails === void 0 ? void 0 : _data$useDetails.plotArea);
58105
58389
  const builtUpAreaNum = parseFloat(data === null || data === void 0 ? void 0 : (_data$useDetails2 = data.useDetails) === null || _data$useDetails2 === void 0 ? void 0 : _data$useDetails2.builtUpArea);
58106
- if (!isNaN(plotAreaNum) && !isNaN(builtUpAreaNum) && plotAreaNum <= builtUpAreaNum) {
58107
- const plotTrans = t("WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA");
58390
+ if (!isNaN(plotAreaNum) && !isNaN(builtUpAreaNum) && plotAreaNum < builtUpAreaNum) {
58391
+ const plotTrans = t("WS_PLOT_AREA_MORE_THAN_OR_EQUAL_BUILT_UP_AREA") || t("WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA");
58108
58392
  setShowToast({
58109
58393
  key: "error",
58110
- message: plotTrans && plotTrans !== "WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA" ? plotTrans : "Plot area should always be more than built up area."
58394
+ message: plotTrans && plotTrans !== "WS_PLOT_AREA_MORE_THAN_OR_EQUAL_BUILT_UP_AREA" && plotTrans !== "WS_PLOT_AREA_MORE_THAN_BUILT_UP_AREA" ? plotTrans : "Plot area should always be more than or equal to built up area."
58111
58395
  });
58112
58396
  return Promise.resolve();
58113
58397
  }
@@ -60952,8 +61236,53 @@ const newConfig$2 = [{
60952
61236
  }]
60953
61237
  }];
60954
61238
 
61239
+ const METER_MAKES$1 = [{
61240
+ name: "Anand Asahi",
61241
+ code: "ANAND_ASAHI",
61242
+ i18nKey: "WS_METER_MAKE_ANAND_ASAHI"
61243
+ }, {
61244
+ name: "Arad",
61245
+ code: "ARAD",
61246
+ i18nKey: "WS_METER_MAKE_ARAD"
61247
+ }, {
61248
+ name: "Baylan",
61249
+ code: "BAYLAN",
61250
+ i18nKey: "WS_METER_MAKE_BAYLAN"
61251
+ }, {
61252
+ name: "Crescent",
61253
+ code: "CRESCENT",
61254
+ i18nKey: "WS_METER_MAKE_CRESCENT"
61255
+ }, {
61256
+ name: "Dasmesh / DMB",
61257
+ code: "DASMESH",
61258
+ i18nKey: "WS_METER_MAKE_DASMESH"
61259
+ }, {
61260
+ name: "Fedrel",
61261
+ code: "FEDREL",
61262
+ i18nKey: "WS_METER_MAKE_FEDREL"
61263
+ }, {
61264
+ name: "Itron",
61265
+ code: "ITRON",
61266
+ i18nKey: "WS_METER_MAKE_ITRON"
61267
+ }, {
61268
+ name: "Konark",
61269
+ code: "KONARK",
61270
+ i18nKey: "WS_METER_MAKE_KONARK"
61271
+ }, {
61272
+ name: "Kranti",
61273
+ code: "KRANTI",
61274
+ i18nKey: "WS_METER_MAKE_KRANTI"
61275
+ }, {
61276
+ name: "Teksan",
61277
+ code: "TEKSAN",
61278
+ i18nKey: "WS_METER_MAKE_TEKSAN"
61279
+ }, {
61280
+ name: "Other",
61281
+ code: "OTHER",
61282
+ i18nKey: "WS_METER_MAKE_OTHER"
61283
+ }];
60955
61284
  const ActivateConnection = () => {
60956
- var _state, _state2, _state3, _Digit$SessionStorage, _details, _details2, _state6, _state6$data, _state7, _state7$data, _state8, _state8$data, _state9, _state9$data, _ref, _ref$split$, _state0, _state0$data, _state1, _state1$data, _state10, _state10$data, _state11, _state11$data, _state12, _state12$data, _state13, _state13$data, _state14, _state14$data, _state15, _state15$data, _state16, _state16$data, _state17, _state17$data, _state18, _state18$data, _state19, _state19$data, _state19$data$plumber, _state19$data$plumber2, _state20, _state20$data, _state20$data$plumber, _state20$data$plumber2, _state21, _state21$data, _state21$data$plumber, _state21$data$plumber2, _state22, _state22$data, _state22$data$additio, _state23, _state23$data, _state23$data$additio, _state23$data$additio2, _state24, _state24$data, _state24$data$additio, _state25, _state25$data, _state26, _state26$data, _state27, _state27$data, _state27$data$connect, _state28, _state28$data, _state28$data$connect, _state29, _state29$data, _state29$data$additio, _state29$data$additio2, _state30, _state30$data, _state30$data$additio, _state30$data$additio2, _state31, _state31$data, _state32, _state32$data, _state33, _state33$data, _state34, _state34$data, _state34$data$additio, _state35, _state35$data, _state36, _state36$data, _state37, _state37$data, _state38, _state38$data, _state41, _applicationDetails$a5, _applicationDetails$a6, _initialAppData$appli3, _details5, _details5$application, _details5$application2, _appDetails$applicati, _state42, _applicationDetails$a7, _applicationDetails$a8, _initialAppData$appli4, _details6, _details6$application, _details6$application2, _appDetails$applicati2;
61285
+ var _state, _state2, _state3, _Digit$SessionStorage, _details, _details2, _state6, _state6$data, _state7, _state7$data, _state8, _state8$data, _state9, _state9$data, _ref, _ref$split$, _state0, _state0$data, _state1, _state1$data, _state10, _state10$data, _state11, _state11$data, _state12, _state12$data, _state13, _state13$data, _state14, _state14$data, _state15, _state15$data, _state16, _state16$data, _state17, _state17$data, _state18, _state18$data, _state19, _state19$data, _state19$data$additio, _state20, _state20$data, _state20$data$plumber, _state20$data$plumber2, _state21, _state21$data, _state21$data$plumber, _state21$data$plumber2, _state22, _state22$data, _state22$data$additio, _state23, _state23$data, _state23$data$plumber, _state23$data$plumber2, _state24, _state24$data, _state24$data$additio, _state25, _state25$data, _state25$data$plumber, _state25$data$plumber2, _state26, _state26$data, _state26$data$additio, _state27, _state27$data, _state27$data$additio, _state28, _state28$data, _state28$data$additio, _state29, _state29$data, _state30, _state30$data, _state31, _state31$data, _state32, _state32$data, _state32$data$connect, _state33, _state33$data, _state33$data$connect, _state34, _state34$data, _state34$data$additio, _state34$data$additio2, _state35, _state35$data, _state35$data$additio, _state35$data$additio2, _state36, _state36$data, _state37, _state37$data, _state37$data$additio, _state38, _state38$data, _state39, _state39$data, _state39$data$additio, _state40, _state40$data, _state41, _state41$data, _state41$data$additio, _state42, _state42$data, _state43, _state43$data, _state43$data$additio, _state44, _state44$data, _state45, _state45$data, _state45$data$additio, _state46, _state46$data, _state47, _state47$data, _state48, _state48$data, _state48$data$additio, _state49, _state49$data, _state49$data$additio, _state50, _state50$data, _state51, _state51$data, _state52, _state52$data, _state53, _state53$data, _state56, _applicationDetails$a5, _applicationDetails$a6, _initialAppData$appli3, _details5, _details5$application, _details5$application2, _appDetails$applicati, _state57, _applicationDetails$a7, _applicationDetails$a8, _initialAppData$appli4, _details6, _details6$application, _details6$application2, _appDetails$applicati2;
60957
61286
  const {
60958
61287
  t
60959
61288
  } = useTranslation();
@@ -61008,7 +61337,7 @@ const ActivateConnection = () => {
61008
61337
  configObj.body.forEach(section => {
61009
61338
  if (section.body && Array.isArray(section.body)) {
61010
61339
  const mappedSectionBody = section.body.map(item => {
61011
- if (item.key === "activationDetails" && (isCitizen || item.component === "WSActivationPageDetails")) {
61340
+ if (item.key === "activationDetails") {
61012
61341
  return {
61013
61342
  ...item,
61014
61343
  component: "WSActivationDetails"
@@ -61069,25 +61398,43 @@ const ActivateConnection = () => {
61069
61398
  noOfToilets: ((_state18 = state) === null || _state18 === void 0 ? void 0 : (_state18$data = _state18.data) === null || _state18$data === void 0 ? void 0 : _state18$data.noOfToilets) || "",
61070
61399
  formDetails: details
61071
61400
  };
61401
+ const plumberPrefCode = ((_state19 = state) === null || _state19 === void 0 ? void 0 : (_state19$data = _state19.data) === null || _state19$data === void 0 ? void 0 : (_state19$data$additio = _state19$data.additionalDetails) === null || _state19$data$additio === void 0 ? void 0 : _state19$data$additio.detailsProvidedBy) || ((_state20 = state) !== null && _state20 !== void 0 && (_state20$data = _state20.data) !== null && _state20$data !== void 0 && (_state20$data$plumber = _state20$data.plumberInfo) !== null && _state20$data$plumber !== void 0 && (_state20$data$plumber2 = _state20$data$plumber[0]) !== null && _state20$data$plumber2 !== void 0 && _state20$data$plumber2.name ? "Self" : "");
61402
+ const defaultPlumberPref = plumberPrefCode === "DJB" || plumberPrefCode === "ULB" ? {
61403
+ name: "DJB",
61404
+ code: "DJB",
61405
+ i18nKey: "WS_PLUMBER_DJB"
61406
+ } : plumberPrefCode === "Self" ? {
61407
+ name: "Self",
61408
+ code: "Self",
61409
+ i18nKey: "WS_PLUMBER_SELF"
61410
+ } : null;
61072
61411
  const plumberDetails = [{
61073
- plumberName: ((_state19 = state) === null || _state19 === void 0 ? void 0 : (_state19$data = _state19.data) === null || _state19$data === void 0 ? void 0 : (_state19$data$plumber = _state19$data.plumberInfo) === null || _state19$data$plumber === void 0 ? void 0 : (_state19$data$plumber2 = _state19$data$plumber[0]) === null || _state19$data$plumber2 === void 0 ? void 0 : _state19$data$plumber2.name) || "",
61074
- plumberMobileNo: ((_state20 = state) === null || _state20 === void 0 ? void 0 : (_state20$data = _state20.data) === null || _state20$data === void 0 ? void 0 : (_state20$data$plumber = _state20$data.plumberInfo) === null || _state20$data$plumber === void 0 ? void 0 : (_state20$data$plumber2 = _state20$data$plumber[0]) === null || _state20$data$plumber2 === void 0 ? void 0 : _state20$data$plumber2.mobileNumber) || "",
61075
- plumberLicenseNo: ((_state21 = state) === null || _state21 === void 0 ? void 0 : (_state21$data = _state21.data) === null || _state21$data === void 0 ? void 0 : (_state21$data$plumber = _state21$data.plumberInfo) === null || _state21$data$plumber === void 0 ? void 0 : (_state21$data$plumber2 = _state21$data$plumber[0]) === null || _state21$data$plumber2 === void 0 ? void 0 : _state21$data$plumber2.licenseNo) || "",
61076
- detailsProvidedBy: (_state22 = state) !== null && _state22 !== void 0 && (_state22$data = _state22.data) !== null && _state22$data !== void 0 && (_state22$data$additio = _state22$data.additionalDetails) !== null && _state22$data$additio !== void 0 && _state22$data$additio.detailsProvidedBy ? {
61077
- i18nKey: `WS_PLUMBER_${(_state23 = state) === null || _state23 === void 0 ? void 0 : (_state23$data = _state23.data) === null || _state23$data === void 0 ? void 0 : (_state23$data$additio = _state23$data.additionalDetails) === null || _state23$data$additio === void 0 ? void 0 : (_state23$data$additio2 = _state23$data$additio.detailsProvidedBy) === null || _state23$data$additio2 === void 0 ? void 0 : _state23$data$additio2.toUpperCase()}`,
61078
- code: (_state24 = state) === null || _state24 === void 0 ? void 0 : (_state24$data = _state24.data) === null || _state24$data === void 0 ? void 0 : (_state24$data$additio = _state24$data.additionalDetails) === null || _state24$data$additio === void 0 ? void 0 : _state24$data$additio.detailsProvidedBy
61079
- } : "",
61080
- applicationNo: (_state25 = state) === null || _state25 === void 0 ? void 0 : (_state25$data = _state25.data) === null || _state25$data === void 0 ? void 0 : _state25$data.applicationNo,
61412
+ plumberName: ((_state21 = state) === null || _state21 === void 0 ? void 0 : (_state21$data = _state21.data) === null || _state21$data === void 0 ? void 0 : (_state21$data$plumber = _state21$data.plumberInfo) === null || _state21$data$plumber === void 0 ? void 0 : (_state21$data$plumber2 = _state21$data$plumber[0]) === null || _state21$data$plumber2 === void 0 ? void 0 : _state21$data$plumber2.name) || ((_state22 = state) === null || _state22 === void 0 ? void 0 : (_state22$data = _state22.data) === null || _state22$data === void 0 ? void 0 : (_state22$data$additio = _state22$data.additionalDetails) === null || _state22$data$additio === void 0 ? void 0 : _state22$data$additio.plumberName) || "",
61413
+ plumberMobileNo: ((_state23 = state) === null || _state23 === void 0 ? void 0 : (_state23$data = _state23.data) === null || _state23$data === void 0 ? void 0 : (_state23$data$plumber = _state23$data.plumberInfo) === null || _state23$data$plumber === void 0 ? void 0 : (_state23$data$plumber2 = _state23$data$plumber[0]) === null || _state23$data$plumber2 === void 0 ? void 0 : _state23$data$plumber2.mobileNumber) || ((_state24 = state) === null || _state24 === void 0 ? void 0 : (_state24$data = _state24.data) === null || _state24$data === void 0 ? void 0 : (_state24$data$additio = _state24$data.additionalDetails) === null || _state24$data$additio === void 0 ? void 0 : _state24$data$additio.plumberMobileNo) || "",
61414
+ plumberLicenseNo: ((_state25 = state) === null || _state25 === void 0 ? void 0 : (_state25$data = _state25.data) === null || _state25$data === void 0 ? void 0 : (_state25$data$plumber = _state25$data.plumberInfo) === null || _state25$data$plumber === void 0 ? void 0 : (_state25$data$plumber2 = _state25$data$plumber[0]) === null || _state25$data$plumber2 === void 0 ? void 0 : _state25$data$plumber2.licenseNo) || ((_state26 = state) === null || _state26 === void 0 ? void 0 : (_state26$data = _state26.data) === null || _state26$data === void 0 ? void 0 : (_state26$data$additio = _state26$data.additionalDetails) === null || _state26$data$additio === void 0 ? void 0 : _state26$data$additio.plumberLicenseNo) || "",
61415
+ detailsProvidedBy: defaultPlumberPref,
61416
+ jeOrFirmName: ((_state27 = state) === null || _state27 === void 0 ? void 0 : (_state27$data = _state27.data) === null || _state27$data === void 0 ? void 0 : (_state27$data$additio = _state27$data.additionalDetails) === null || _state27$data$additio === void 0 ? void 0 : _state27$data$additio.nameOfJEOrFirm) || ((_state28 = state) === null || _state28 === void 0 ? void 0 : (_state28$data = _state28.data) === null || _state28$data === void 0 ? void 0 : (_state28$data$additio = _state28$data.additionalDetails) === null || _state28$data$additio === void 0 ? void 0 : _state28$data$additio.jeOrFirmName) || ((_state29 = state) === null || _state29 === void 0 ? void 0 : (_state29$data = _state29.data) === null || _state29$data === void 0 ? void 0 : _state29$data.nameOfJEOrFirm) || "",
61417
+ applicationNo: (_state30 = state) === null || _state30 === void 0 ? void 0 : (_state30$data = _state30.data) === null || _state30$data === void 0 ? void 0 : _state30$data.applicationNo,
61081
61418
  key: Date.now()
61082
61419
  }];
61083
- const isMeteredConn = !((_state26 = state) !== null && _state26 !== void 0 && (_state26$data = _state26.data) !== null && _state26$data !== void 0 && _state26$data.connectionType) || ((_state27 = state) === null || _state27 === void 0 ? void 0 : (_state27$data = _state27.data) === null || _state27$data === void 0 ? void 0 : (_state27$data$connect = _state27$data.connectionType) === null || _state27$data$connect === void 0 ? void 0 : _state27$data$connect.toUpperCase()) === "METERED" || ((_state28 = state) === null || _state28 === void 0 ? void 0 : (_state28$data = _state28.data) === null || _state28$data === void 0 ? void 0 : (_state28$data$connect = _state28$data.connectionType) === null || _state28$data$connect === void 0 ? void 0 : _state28$data$connect.toUpperCase()) === "PERMANENT" || ((_state29 = state) === null || _state29 === void 0 ? void 0 : (_state29$data = _state29.data) === null || _state29$data === void 0 ? void 0 : (_state29$data$additio = _state29$data.additionalDetails) === null || _state29$data$additio === void 0 ? void 0 : (_state29$data$additio2 = _state29$data$additio.connectionType) === null || _state29$data$additio2 === void 0 ? void 0 : _state29$data$additio2.toUpperCase()) === "METERED" || ((_state30 = state) === null || _state30 === void 0 ? void 0 : (_state30$data = _state30.data) === null || _state30$data === void 0 ? void 0 : (_state30$data$additio = _state30$data.additionalDetails) === null || _state30$data$additio === void 0 ? void 0 : (_state30$data$additio2 = _state30$data$additio.connectionType) === null || _state30$data$additio2 === void 0 ? void 0 : _state30$data$additio2.toUpperCase()) === "PERMANENT";
61420
+ const isMeteredConn = !((_state31 = state) !== null && _state31 !== void 0 && (_state31$data = _state31.data) !== null && _state31$data !== void 0 && _state31$data.connectionType) || ((_state32 = state) === null || _state32 === void 0 ? void 0 : (_state32$data = _state32.data) === null || _state32$data === void 0 ? void 0 : (_state32$data$connect = _state32$data.connectionType) === null || _state32$data$connect === void 0 ? void 0 : _state32$data$connect.toUpperCase()) === "METERED" || ((_state33 = state) === null || _state33 === void 0 ? void 0 : (_state33$data = _state33.data) === null || _state33$data === void 0 ? void 0 : (_state33$data$connect = _state33$data.connectionType) === null || _state33$data$connect === void 0 ? void 0 : _state33$data$connect.toUpperCase()) === "PERMANENT" || ((_state34 = state) === null || _state34 === void 0 ? void 0 : (_state34$data = _state34.data) === null || _state34$data === void 0 ? void 0 : (_state34$data$additio = _state34$data.additionalDetails) === null || _state34$data$additio === void 0 ? void 0 : (_state34$data$additio2 = _state34$data$additio.connectionType) === null || _state34$data$additio2 === void 0 ? void 0 : _state34$data$additio2.toUpperCase()) === "METERED" || ((_state35 = state) === null || _state35 === void 0 ? void 0 : (_state35$data = _state35.data) === null || _state35$data === void 0 ? void 0 : (_state35$data$additio = _state35$data.additionalDetails) === null || _state35$data$additio === void 0 ? void 0 : (_state35$data$additio2 = _state35$data$additio.connectionType) === null || _state35$data$additio2 === void 0 ? void 0 : _state35$data$additio2.toUpperCase()) === "PERMANENT";
61421
+ const defaultMeterMake = ((_state36 = state) === null || _state36 === void 0 ? void 0 : (_state36$data = _state36.data) === null || _state36$data === void 0 ? void 0 : _state36$data.meterMake) || ((_state37 = state) === null || _state37 === void 0 ? void 0 : (_state37$data = _state37.data) === null || _state37$data === void 0 ? void 0 : (_state37$data$additio = _state37$data.additionalDetails) === null || _state37$data$additio === void 0 ? void 0 : _state37$data$additio.meterMake);
61422
+ const defaultMeterSize = ((_state38 = state) === null || _state38 === void 0 ? void 0 : (_state38$data = _state38.data) === null || _state38$data === void 0 ? void 0 : _state38$data.meterSize) || ((_state39 = state) === null || _state39 === void 0 ? void 0 : (_state39$data = _state39.data) === null || _state39$data === void 0 ? void 0 : (_state39$data$additio = _state39$data.additionalDetails) === null || _state39$data$additio === void 0 ? void 0 : _state39$data$additio.meterSize);
61423
+ const defaultFerruleSize = ((_state40 = state) === null || _state40 === void 0 ? void 0 : (_state40$data = _state40.data) === null || _state40$data === void 0 ? void 0 : _state40$data.ferruleSize) || ((_state41 = state) === null || _state41 === void 0 ? void 0 : (_state41$data = _state41.data) === null || _state41$data === void 0 ? void 0 : (_state41$data$additio = _state41$data.additionalDetails) === null || _state41$data$additio === void 0 ? void 0 : _state41$data$additio.ferruleSize);
61084
61424
  const activationDetails = isMeteredConn ? [{
61085
- meterId: ((_state31 = state) === null || _state31 === void 0 ? void 0 : (_state31$data = _state31.data) === null || _state31$data === void 0 ? void 0 : _state31$data.meterId) || "",
61086
- meterInstallationDate: (_state32 = state) !== null && _state32 !== void 0 && (_state32$data = _state32.data) !== null && _state32$data !== void 0 && _state32$data.meterInstallationDate ? convertEpochToDates((_state33 = state) === null || _state33 === void 0 ? void 0 : (_state33$data = _state33.data) === null || _state33$data === void 0 ? void 0 : _state33$data.meterInstallationDate) : null,
61087
- meterInitialReading: ((_state34 = state) === null || _state34 === void 0 ? void 0 : (_state34$data = _state34.data) === null || _state34$data === void 0 ? void 0 : (_state34$data$additio = _state34$data.additionalDetails) === null || _state34$data$additio === void 0 ? void 0 : _state34$data$additio.initialMeterReading) || "",
61088
- connectionExecutionDate: (_state35 = state) !== null && _state35 !== void 0 && (_state35$data = _state35.data) !== null && _state35$data !== void 0 && _state35$data.connectionExecutionDate ? convertEpochToDates((_state36 = state) === null || _state36 === void 0 ? void 0 : (_state36$data = _state36.data) === null || _state36$data === void 0 ? void 0 : _state36$data.connectionExecutionDate) : null
61425
+ meterMake: defaultMeterMake ? typeof defaultMeterMake === "object" ? defaultMeterMake : METER_MAKES$1.find(m => m.code === defaultMeterMake || m.name === defaultMeterMake) || {
61426
+ name: defaultMeterMake,
61427
+ code: defaultMeterMake
61428
+ } : null,
61429
+ meterNo: ((_state42 = state) === null || _state42 === void 0 ? void 0 : (_state42$data = _state42.data) === null || _state42$data === void 0 ? void 0 : _state42$data.meterId) || ((_state43 = state) === null || _state43 === void 0 ? void 0 : (_state43$data = _state43.data) === null || _state43$data === void 0 ? void 0 : (_state43$data$additio = _state43$data.additionalDetails) === null || _state43$data$additio === void 0 ? void 0 : _state43$data$additio.meterNo) || "",
61430
+ meterId: ((_state44 = state) === null || _state44 === void 0 ? void 0 : (_state44$data = _state44.data) === null || _state44$data === void 0 ? void 0 : _state44$data.meterId) || ((_state45 = state) === null || _state45 === void 0 ? void 0 : (_state45$data = _state45.data) === null || _state45$data === void 0 ? void 0 : (_state45$data$additio = _state45$data.additionalDetails) === null || _state45$data$additio === void 0 ? void 0 : _state45$data$additio.meterNo) || "",
61431
+ meterSize: defaultMeterSize ? typeof defaultMeterSize === "object" ? (defaultMeterSize === null || defaultMeterSize === void 0 ? void 0 : defaultMeterSize.value) || (defaultMeterSize === null || defaultMeterSize === void 0 ? void 0 : defaultMeterSize.name) || (defaultMeterSize === null || defaultMeterSize === void 0 ? void 0 : defaultMeterSize.code) || "" : defaultMeterSize : "",
61432
+ ferruleSize: defaultFerruleSize ? typeof defaultFerruleSize === "object" ? (defaultFerruleSize === null || defaultFerruleSize === void 0 ? void 0 : defaultFerruleSize.value) || (defaultFerruleSize === null || defaultFerruleSize === void 0 ? void 0 : defaultFerruleSize.name) || (defaultFerruleSize === null || defaultFerruleSize === void 0 ? void 0 : defaultFerruleSize.code) || "" : defaultFerruleSize : "",
61433
+ meterInstallationDate: (_state46 = state) !== null && _state46 !== void 0 && (_state46$data = _state46.data) !== null && _state46$data !== void 0 && _state46$data.meterInstallationDate ? convertEpochToDates((_state47 = state) === null || _state47 === void 0 ? void 0 : (_state47$data = _state47.data) === null || _state47$data === void 0 ? void 0 : _state47$data.meterInstallationDate) : null,
61434
+ meterInitialReading: ((_state48 = state) === null || _state48 === void 0 ? void 0 : (_state48$data = _state48.data) === null || _state48$data === void 0 ? void 0 : (_state48$data$additio = _state48$data.additionalDetails) === null || _state48$data$additio === void 0 ? void 0 : _state48$data$additio.initialMeterReading) !== undefined ? (_state49 = state) === null || _state49 === void 0 ? void 0 : (_state49$data = _state49.data) === null || _state49$data === void 0 ? void 0 : (_state49$data$additio = _state49$data.additionalDetails) === null || _state49$data$additio === void 0 ? void 0 : _state49$data$additio.initialMeterReading : "0",
61435
+ connectionExecutionDate: (_state50 = state) !== null && _state50 !== void 0 && (_state50$data = _state50.data) !== null && _state50$data !== void 0 && _state50$data.connectionExecutionDate ? convertEpochToDates((_state51 = state) === null || _state51 === void 0 ? void 0 : (_state51$data = _state51.data) === null || _state51$data === void 0 ? void 0 : _state51$data.connectionExecutionDate) : null
61089
61436
  }] : [{
61090
- connectionExecutionDate: (_state37 = state) !== null && _state37 !== void 0 && (_state37$data = _state37.data) !== null && _state37$data !== void 0 && _state37$data.connectionExecutionDate ? convertEpochToDates((_state38 = state) === null || _state38 === void 0 ? void 0 : (_state38$data = _state38.data) === null || _state38$data === void 0 ? void 0 : _state38$data.connectionExecutionDate) : null
61437
+ connectionExecutionDate: (_state52 = state) !== null && _state52 !== void 0 && (_state52$data = _state52.data) !== null && _state52$data !== void 0 && _state52$data.connectionExecutionDate ? convertEpochToDates((_state53 = state) === null || _state53 === void 0 ? void 0 : (_state53$data = _state53.data) === null || _state53$data === void 0 ? void 0 : _state53$data.connectionExecutionDate) : null
61091
61438
  }];
61092
61439
  const defaultValues = {
61093
61440
  formDetails: details,
@@ -61121,24 +61468,77 @@ const ActivateConnection = () => {
61121
61468
  }, 3000);
61122
61469
  return () => clearTimeout(timer);
61123
61470
  }, [isAppDetailsPage]);
61124
- const onFormValueChange = (setValue, formData, formState) => {
61125
- var _formData$supportingD, _formData$supportingD2, _formData$supportingD3, _formData$supportingD4, _formData$supportingD5;
61126
- const hasDoc = !!(formData !== null && formData !== void 0 && (_formData$supportingD = formData.supportingDocuments) !== null && _formData$supportingD !== void 0 && (_formData$supportingD2 = _formData$supportingD[0]) !== null && _formData$supportingD2 !== void 0 && _formData$supportingD2.fileStoreId || formData !== null && formData !== void 0 && (_formData$supportingD3 = formData.supportingDocuments) !== null && _formData$supportingD3 !== void 0 && _formData$supportingD3.fileStoreId || Array.isArray(formData === null || formData === void 0 ? void 0 : formData.supportingDocuments) && formData !== null && formData !== void 0 && (_formData$supportingD4 = formData.supportingDocuments) !== null && _formData$supportingD4 !== void 0 && (_formData$supportingD5 = _formData$supportingD4[0]) !== null && _formData$supportingD5 !== void 0 && _formData$supportingD5.fileStoreId);
61127
- if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter(ob => ob.type === "required").length == 0 && Object.getPrototypeOf(formState.errors) === Object.prototype) setSubmitValve(hasDoc);else setSubmitValve(!Object.keys(formState.errors).length && hasDoc);
61128
- };
61129
- const getConvertedDate = function (dateOfTime) {
61130
- try {
61131
- let dateOfReplace = stringReplaceAll(dateOfTime, "/", "-");
61132
- let formattedDate = "";
61133
- if (dateOfReplace.split("-")[2] > 1900) {
61134
- formattedDate = `${dateOfReplace.split("-")[2]}-${dateOfReplace.split("-")[1]}-${dateOfReplace.split("-")[0]}`;
61135
- } else {
61136
- formattedDate = `${dateOfReplace.split("-")[0]}-${dateOfReplace.split("-")[2]}-${dateOfReplace.split("-")[1]}`;
61137
- }
61138
- return Promise.resolve(convertDateToEpochNew(formattedDate));
61139
- } catch (e) {
61140
- return Promise.reject(e);
61471
+ const checkCanSubmit = formData => {
61472
+ var _formData$plumberDeta, _formData$plumberDeta2, _formData$plumberDeta3, _formData$plumberDeta4, _formData$plumberDeta5, _formData$plumberDeta6, _formData$plumberDeta7, _formData$plumberDeta8, _formData$activationD, _act$meterMake, _act$meterMake2, _act$meterSize, _act$meterSize2, _act$ferruleSize, _act$ferruleSize2, _supDocs$meterPhoto, _docsList$find, _supDocs$;
61473
+ const plumberPref = (formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta = formData.plumberDetails) === null || _formData$plumberDeta === void 0 ? void 0 : (_formData$plumberDeta2 = _formData$plumberDeta[0]) === null || _formData$plumberDeta2 === void 0 ? void 0 : (_formData$plumberDeta3 = _formData$plumberDeta2.detailsProvidedBy) === null || _formData$plumberDeta3 === void 0 ? void 0 : _formData$plumberDeta3.code) || (formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta4 = formData.plumberDetails) === null || _formData$plumberDeta4 === void 0 ? void 0 : (_formData$plumberDeta5 = _formData$plumberDeta4[0]) === null || _formData$plumberDeta5 === void 0 ? void 0 : (_formData$plumberDeta6 = _formData$plumberDeta5.detailsProvidedBy) === null || _formData$plumberDeta6 === void 0 ? void 0 : _formData$plumberDeta6.name) || (formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta7 = formData.plumberDetails) === null || _formData$plumberDeta7 === void 0 ? void 0 : (_formData$plumberDeta8 = _formData$plumberDeta7[0]) === null || _formData$plumberDeta8 === void 0 ? void 0 : _formData$plumberDeta8.detailsProvidedBy) || "";
61474
+ const isDJB = plumberPref === "DJB" || plumberPref === "ULB" || plumberPref === "Delhi Jal Board" || typeof plumberPref === "string" && plumberPref.toLowerCase().includes("djb");
61475
+ const isSelf = !isDJB;
61476
+ if (!plumberPref) return false;
61477
+ if (isSelf) {
61478
+ var _formData$plumberDeta9, _formData$plumberDeta0, _formData$plumberDeta1, _formData$plumberDeta10, _formData$plumberDeta11, _formData$plumberDeta12;
61479
+ const pName = formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta9 = formData.plumberDetails) === null || _formData$plumberDeta9 === void 0 ? void 0 : (_formData$plumberDeta0 = _formData$plumberDeta9[0]) === null || _formData$plumberDeta0 === void 0 ? void 0 : _formData$plumberDeta0.plumberName;
61480
+ const pLic = formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta1 = formData.plumberDetails) === null || _formData$plumberDeta1 === void 0 ? void 0 : (_formData$plumberDeta10 = _formData$plumberDeta1[0]) === null || _formData$plumberDeta10 === void 0 ? void 0 : _formData$plumberDeta10.plumberLicenseNo;
61481
+ const pMob = formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta11 = formData.plumberDetails) === null || _formData$plumberDeta11 === void 0 ? void 0 : (_formData$plumberDeta12 = _formData$plumberDeta11[0]) === null || _formData$plumberDeta12 === void 0 ? void 0 : _formData$plumberDeta12.plumberMobileNo;
61482
+ if (!pName || !pName.trim()) return false;
61483
+ if (!pLic || !pLic.toString().trim()) return false;
61484
+ if (!pMob || !/^[6-9]\d{9}$/.test(pMob.toString().trim())) return false;
61485
+ } else if (isDJB) {
61486
+ var _formData$plumberDeta13, _formData$plumberDeta14;
61487
+ const jeFirm = formData === null || formData === void 0 ? void 0 : (_formData$plumberDeta13 = formData.plumberDetails) === null || _formData$plumberDeta13 === void 0 ? void 0 : (_formData$plumberDeta14 = _formData$plumberDeta13[0]) === null || _formData$plumberDeta14 === void 0 ? void 0 : _formData$plumberDeta14.jeOrFirmName;
61488
+ if (!jeFirm || !jeFirm.trim()) return false;
61489
+ } else {
61490
+ return false;
61491
+ }
61492
+ const act = Array.isArray(formData === null || formData === void 0 ? void 0 : formData.activationDetails) ? formData === null || formData === void 0 ? void 0 : (_formData$activationD = formData.activationDetails) === null || _formData$activationD === void 0 ? void 0 : _formData$activationD[0] : formData === null || formData === void 0 ? void 0 : formData.activationDetails;
61493
+ const meterMake = (act === null || act === void 0 ? void 0 : (_act$meterMake = act.meterMake) === null || _act$meterMake === void 0 ? void 0 : _act$meterMake.code) || (act === null || act === void 0 ? void 0 : (_act$meterMake2 = act.meterMake) === null || _act$meterMake2 === void 0 ? void 0 : _act$meterMake2.name) || (act === null || act === void 0 ? void 0 : act.meterMake);
61494
+ const meterNo = (act === null || act === void 0 ? void 0 : act.meterNo) || (act === null || act === void 0 ? void 0 : act.meterId);
61495
+ const meterSize = (act === null || act === void 0 ? void 0 : (_act$meterSize = act.meterSize) === null || _act$meterSize === void 0 ? void 0 : _act$meterSize.value) || (act === null || act === void 0 ? void 0 : (_act$meterSize2 = act.meterSize) === null || _act$meterSize2 === void 0 ? void 0 : _act$meterSize2.name) || (act === null || act === void 0 ? void 0 : act.meterSize);
61496
+ const ferruleSize = (act === null || act === void 0 ? void 0 : (_act$ferruleSize = act.ferruleSize) === null || _act$ferruleSize === void 0 ? void 0 : _act$ferruleSize.value) || (act === null || act === void 0 ? void 0 : (_act$ferruleSize2 = act.ferruleSize) === null || _act$ferruleSize2 === void 0 ? void 0 : _act$ferruleSize2.name) || (act === null || act === void 0 ? void 0 : act.ferruleSize);
61497
+ const meterInstDate = act === null || act === void 0 ? void 0 : act.meterInstallationDate;
61498
+ const connExecDate = act === null || act === void 0 ? void 0 : act.connectionExecutionDate;
61499
+ if (!meterMake) return false;
61500
+ if (!meterNo || !meterNo.toString().trim()) return false;
61501
+ if (!meterSize || !meterSize.toString().trim()) return false;
61502
+ if (!ferruleSize || !ferruleSize.toString().trim()) return false;
61503
+ if (!meterInstDate) return false;
61504
+ if (!connExecDate) return false;
61505
+ const supDocs = formData === null || formData === void 0 ? void 0 : formData.supportingDocuments;
61506
+ const docsList = Array.isArray(supDocs === null || supDocs === void 0 ? void 0 : supDocs.documents) ? supDocs.documents : Array.isArray(supDocs) ? supDocs : [];
61507
+ const meterPhotoId = (supDocs === null || supDocs === void 0 ? void 0 : (_supDocs$meterPhoto = supDocs.meterPhoto) === null || _supDocs$meterPhoto === void 0 ? void 0 : _supDocs$meterPhoto.fileStoreId) || ((_docsList$find = docsList.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === "METER_PHOTO")) === null || _docsList$find === void 0 ? void 0 : _docsList$find.fileStoreId) || (supDocs === null || supDocs === void 0 ? void 0 : (_supDocs$ = supDocs[0]) === null || _supDocs$ === void 0 ? void 0 : _supDocs$.fileStoreId);
61508
+ if (!meterPhotoId) return false;
61509
+ if (isSelf) {
61510
+ var _supDocs$meterWarrant, _docsList$find2, _supDocs$plumberDecla, _docsList$find3;
61511
+ const meterWarrantyId = (supDocs === null || supDocs === void 0 ? void 0 : (_supDocs$meterWarrant = supDocs.meterWarranty) === null || _supDocs$meterWarrant === void 0 ? void 0 : _supDocs$meterWarrant.fileStoreId) || ((_docsList$find2 = docsList.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === "METER_WARRANTY_CARD_TESTING_REPORT_INVOICE")) === null || _docsList$find2 === void 0 ? void 0 : _docsList$find2.fileStoreId);
61512
+ const plumberDeclId = (supDocs === null || supDocs === void 0 ? void 0 : (_supDocs$plumberDecla = supDocs.plumberDeclaration) === null || _supDocs$plumberDecla === void 0 ? void 0 : _supDocs$plumberDecla.fileStoreId) || ((_docsList$find3 = docsList.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === "DECLARATION_OF_LICENSED_PLUMBER")) === null || _docsList$find3 === void 0 ? void 0 : _docsList$find3.fileStoreId);
61513
+ if (!meterWarrantyId) return false;
61141
61514
  }
61515
+ return true;
61516
+ };
61517
+ const onFormValueChange = (setValue, formData, formState) => {
61518
+ const canSub = checkCanSubmit(formData);
61519
+ setSubmitValve(canSub);
61520
+ };
61521
+ const getConvertedDate = dateOfTime => {
61522
+ if (!dateOfTime) return null;
61523
+ if (typeof dateOfTime === "number") return dateOfTime;
61524
+ const str = String(dateOfTime).trim();
61525
+ if (/^\d+$/.test(str)) return Number(str);
61526
+ const ymd = str.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/);
61527
+ if (ymd) {
61528
+ const year = parseInt(ymd[1], 10);
61529
+ const month = parseInt(ymd[2], 10) - 1;
61530
+ const day = parseInt(ymd[3], 10);
61531
+ return new Date(year, month, day, 23, 59, 59).getTime();
61532
+ }
61533
+ const dmy = str.match(/^(\d{1,2})[-/](\d{1,2})[-/](\d{4})$/);
61534
+ if (dmy) {
61535
+ const day = parseInt(dmy[1], 10);
61536
+ const month = parseInt(dmy[2], 10) - 1;
61537
+ const year = parseInt(dmy[3], 10);
61538
+ return new Date(year, month, day, 23, 59, 59).getTime();
61539
+ }
61540
+ const d = new Date(str);
61541
+ return isNaN(d.getTime()) ? null : d.getTime();
61142
61542
  };
61143
61543
  const closeToast = () => {
61144
61544
  setShowToast(null);
@@ -61148,144 +61548,250 @@ const ActivateConnection = () => {
61148
61548
  };
61149
61549
  const onSubmit = function (data) {
61150
61550
  try {
61151
- var _data$supportingDocum, _data$supportingDocum2, _data$supportingDocum3, _data$supportingDocum4, _data$supportingDocum5;
61152
- const docFileStoreId = (data === null || data === void 0 ? void 0 : (_data$supportingDocum = data.supportingDocuments) === null || _data$supportingDocum === void 0 ? void 0 : (_data$supportingDocum2 = _data$supportingDocum[0]) === null || _data$supportingDocum2 === void 0 ? void 0 : _data$supportingDocum2.fileStoreId) || (data === null || data === void 0 ? void 0 : (_data$supportingDocum3 = data.supportingDocuments) === null || _data$supportingDocum3 === void 0 ? void 0 : _data$supportingDocum3.fileStoreId) || Array.isArray(data === null || data === void 0 ? void 0 : data.supportingDocuments) && (data === null || data === void 0 ? void 0 : (_data$supportingDocum4 = data.supportingDocuments) === null || _data$supportingDocum4 === void 0 ? void 0 : (_data$supportingDocum5 = _data$supportingDocum4[0]) === null || _data$supportingDocum5 === void 0 ? void 0 : _data$supportingDocum5.fileStoreId);
61153
- return Promise.resolve(function () {
61154
- if (!canSubmit || !docFileStoreId) {
61155
- setShowToast({
61156
- warning: true,
61157
- message: "PLEASE_FILL_MANDATORY_DETAILS"
61551
+ if (!checkCanSubmit(data)) {
61552
+ setShowToast({
61553
+ warning: true,
61554
+ message: "PLEASE_FILL_MANDATORY_DETAILS"
61555
+ });
61556
+ setTimeout(() => {
61557
+ setShowToast(false);
61558
+ }, 3000);
61559
+ return Promise.resolve();
61560
+ } else {
61561
+ var _details4, _formDetails$connecti, _formDetails$connecti2, _formDetails$connecti3, _formDetails$connecti4, _formDetails$connecti5, _formDetails$connecti6, _formDetails$connecti7, _formDetails$connecti8, _formDetails$connecti9, _formDetails$connecti0, _formDetails$connecti1, _formDetails$connecti10, _formDetails$connecti11, _formDetails$connecti12, _formDetails$connecti13, _formDetails$connecti14, _formDetails$connecti15, _formDetails$connecti16, _formDetails$connecti17, _formDetails$connecti18, _formDetails$connecti19, _formDetails$connecti20, _formDetails$connecti21, _formDetails$connecti22, _formDetails$connecti23, _formDetails$connecti24, _formDetails$connecti25, _formDetails$connecti26, _formDetails$connecti27, _formDetails$connecti28, _formDetails$plumberD, _formDetails$plumberD2, _formDetails$plumberD3, _formDetails$plumberD4, _formDetails$plumberD5, _formDetails$plumberD6, _formDetails$plumberD7, _formDetails$plumberD8, _data$plumberDetails, _data$plumberDetails$, _data$plumberDetails$2, _data$plumberDetails2, _data$plumberDetails3, _data$plumberDetails4, _data$plumberDetails5, _data$plumberDetails6, _formDetails$activati, _data$activationDetai, _actObj$meterMake, _actObj$meterMake2, _actObj$meterSize, _actObj$meterSize2, _actObj$ferruleSize, _actObj$ferruleSize2, _data$supportingDocum, _data$supportingDocum2, _data$supportingDocum3, _formDetails$comments, _formDetails$comments2, _formData$application, _baseAppData$applicat, _state54, _formData$application2, _baseAppData$applicat2, _state55, _formDetails$comments3, _formData$application3, _formData$application4;
61562
+ const formDetails = cloneDeep_1(data);
61563
+ const baseAppData = (appDetails === null || appDetails === void 0 ? void 0 : appDetails.applicationData) || (appDetails !== null && appDetails !== void 0 && appDetails.applicationNo ? appDetails : null) || ((_details4 = details) === null || _details4 === void 0 ? void 0 : _details4.applicationData) || initialAppData || {};
61564
+ const formData = cloneDeep_1(baseAppData);
61565
+ if (!formData.additionalDetails) formData.additionalDetails = {};
61566
+ if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti = formDetails.connectionDetails) !== null && _formDetails$connecti !== void 0 && (_formDetails$connecti2 = _formDetails$connecti[0]) !== null && _formDetails$connecti2 !== void 0 && (_formDetails$connecti3 = _formDetails$connecti2.connectionType) !== null && _formDetails$connecti3 !== void 0 && _formDetails$connecti3.code) formData.connectionType = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti4 = formDetails.connectionDetails) === null || _formDetails$connecti4 === void 0 ? void 0 : (_formDetails$connecti5 = _formDetails$connecti4[0]) === null || _formDetails$connecti5 === void 0 ? void 0 : (_formDetails$connecti6 = _formDetails$connecti5.connectionType) === null || _formDetails$connecti6 === void 0 ? void 0 : _formDetails$connecti6.code;
61567
+ if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti7 = formDetails.connectionDetails) !== null && _formDetails$connecti7 !== void 0 && (_formDetails$connecti8 = _formDetails$connecti7[0]) !== null && _formDetails$connecti8 !== void 0 && (_formDetails$connecti9 = _formDetails$connecti8.waterSource) !== null && _formDetails$connecti9 !== void 0 && _formDetails$connecti9.code) formData.waterSource = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti0 = formDetails.connectionDetails) === null || _formDetails$connecti0 === void 0 ? void 0 : (_formDetails$connecti1 = _formDetails$connecti0[0]) === null || _formDetails$connecti1 === void 0 ? void 0 : (_formDetails$connecti10 = _formDetails$connecti1.sourceSubData) === null || _formDetails$connecti10 === void 0 ? void 0 : _formDetails$connecti10.code;
61568
+ if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti11 = formDetails.connectionDetails) !== null && _formDetails$connecti11 !== void 0 && (_formDetails$connecti12 = _formDetails$connecti11[0]) !== null && _formDetails$connecti12 !== void 0 && (_formDetails$connecti13 = _formDetails$connecti12.pipeSize) !== null && _formDetails$connecti13 !== void 0 && _formDetails$connecti13.size) formData.pipeSize = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti14 = formDetails.connectionDetails) === null || _formDetails$connecti14 === void 0 ? void 0 : (_formDetails$connecti15 = _formDetails$connecti14[0]) === null || _formDetails$connecti15 === void 0 ? void 0 : (_formDetails$connecti16 = _formDetails$connecti15.pipeSize) === null || _formDetails$connecti16 === void 0 ? void 0 : _formDetails$connecti16.size;
61569
+ if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti17 = formDetails.connectionDetails) !== null && _formDetails$connecti17 !== void 0 && (_formDetails$connecti18 = _formDetails$connecti17[0]) !== null && _formDetails$connecti18 !== void 0 && _formDetails$connecti18.noOfTaps) formData.noOfTaps = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti19 = formDetails.connectionDetails) === null || _formDetails$connecti19 === void 0 ? void 0 : (_formDetails$connecti20 = _formDetails$connecti19[0]) === null || _formDetails$connecti20 === void 0 ? void 0 : _formDetails$connecti20.noOfTaps;
61570
+ if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti21 = formDetails.connectionDetails) !== null && _formDetails$connecti21 !== void 0 && (_formDetails$connecti22 = _formDetails$connecti21[0]) !== null && _formDetails$connecti22 !== void 0 && _formDetails$connecti22.noOfWaterClosets) formData.noOfWaterClosets = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti23 = formDetails.connectionDetails) === null || _formDetails$connecti23 === void 0 ? void 0 : (_formDetails$connecti24 = _formDetails$connecti23[0]) === null || _formDetails$connecti24 === void 0 ? void 0 : _formDetails$connecti24.noOfWaterClosets;
61571
+ if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti25 = formDetails.connectionDetails) !== null && _formDetails$connecti25 !== void 0 && (_formDetails$connecti26 = _formDetails$connecti25[0]) !== null && _formDetails$connecti26 !== void 0 && _formDetails$connecti26.noOfToilets) formData.noOfToilets = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti27 = formDetails.connectionDetails) === null || _formDetails$connecti27 === void 0 ? void 0 : (_formDetails$connecti28 = _formDetails$connecti27[0]) === null || _formDetails$connecti28 === void 0 ? void 0 : _formDetails$connecti28.noOfToilets;
61572
+ const plumberPref = (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD = formDetails.plumberDetails) === null || _formDetails$plumberD === void 0 ? void 0 : (_formDetails$plumberD2 = _formDetails$plumberD[0]) === null || _formDetails$plumberD2 === void 0 ? void 0 : (_formDetails$plumberD3 = _formDetails$plumberD2.detailsProvidedBy) === null || _formDetails$plumberD3 === void 0 ? void 0 : _formDetails$plumberD3.code) || (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD4 = formDetails.plumberDetails) === null || _formDetails$plumberD4 === void 0 ? void 0 : (_formDetails$plumberD5 = _formDetails$plumberD4[0]) === null || _formDetails$plumberD5 === void 0 ? void 0 : (_formDetails$plumberD6 = _formDetails$plumberD5.detailsProvidedBy) === null || _formDetails$plumberD6 === void 0 ? void 0 : _formDetails$plumberD6.name) || (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD7 = formDetails.plumberDetails) === null || _formDetails$plumberD7 === void 0 ? void 0 : (_formDetails$plumberD8 = _formDetails$plumberD7[0]) === null || _formDetails$plumberD8 === void 0 ? void 0 : _formDetails$plumberD8.detailsProvidedBy) || (data === null || data === void 0 ? void 0 : (_data$plumberDetails = data.plumberDetails) === null || _data$plumberDetails === void 0 ? void 0 : (_data$plumberDetails$ = _data$plumberDetails[0]) === null || _data$plumberDetails$ === void 0 ? void 0 : (_data$plumberDetails$2 = _data$plumberDetails$.detailsProvidedBy) === null || _data$plumberDetails$2 === void 0 ? void 0 : _data$plumberDetails$2.code) || (data === null || data === void 0 ? void 0 : (_data$plumberDetails2 = data.plumberDetails) === null || _data$plumberDetails2 === void 0 ? void 0 : (_data$plumberDetails3 = _data$plumberDetails2[0]) === null || _data$plumberDetails3 === void 0 ? void 0 : (_data$plumberDetails4 = _data$plumberDetails3.detailsProvidedBy) === null || _data$plumberDetails4 === void 0 ? void 0 : _data$plumberDetails4.name) || (data === null || data === void 0 ? void 0 : (_data$plumberDetails5 = data.plumberDetails) === null || _data$plumberDetails5 === void 0 ? void 0 : (_data$plumberDetails6 = _data$plumberDetails5[0]) === null || _data$plumberDetails6 === void 0 ? void 0 : _data$plumberDetails6.detailsProvidedBy) || "";
61573
+ const isDJB = plumberPref === "DJB" || plumberPref === "ULB" || plumberPref === "Delhi Jal Board" || typeof plumberPref === "string" && plumberPref.toLowerCase().includes("djb");
61574
+ const isSelf = !isDJB;
61575
+ formData.additionalDetails.detailsProvidedBy = isDJB ? "DJB" : "Self";
61576
+ formData.additionalDetails.plumberProvidedBy = isDJB ? "DJB" : "Self";
61577
+ if (isSelf) {
61578
+ var _formDetails$plumberD9, _formDetails$plumberD0, _data$plumberDetails7, _data$plumberDetails8, _formDetails$plumberD1, _formDetails$plumberD10, _data$plumberDetails9, _data$plumberDetails0, _formDetails$plumberD11, _formDetails$plumberD12, _data$plumberDetails1, _data$plumberDetails10;
61579
+ const pName = (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD9 = formDetails.plumberDetails) === null || _formDetails$plumberD9 === void 0 ? void 0 : (_formDetails$plumberD0 = _formDetails$plumberD9[0]) === null || _formDetails$plumberD0 === void 0 ? void 0 : _formDetails$plumberD0.plumberName) || (data === null || data === void 0 ? void 0 : (_data$plumberDetails7 = data.plumberDetails) === null || _data$plumberDetails7 === void 0 ? void 0 : (_data$plumberDetails8 = _data$plumberDetails7[0]) === null || _data$plumberDetails8 === void 0 ? void 0 : _data$plumberDetails8.plumberName) || "";
61580
+ const pLic = (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD1 = formDetails.plumberDetails) === null || _formDetails$plumberD1 === void 0 ? void 0 : (_formDetails$plumberD10 = _formDetails$plumberD1[0]) === null || _formDetails$plumberD10 === void 0 ? void 0 : _formDetails$plumberD10.plumberLicenseNo) || (data === null || data === void 0 ? void 0 : (_data$plumberDetails9 = data.plumberDetails) === null || _data$plumberDetails9 === void 0 ? void 0 : (_data$plumberDetails0 = _data$plumberDetails9[0]) === null || _data$plumberDetails0 === void 0 ? void 0 : _data$plumberDetails0.plumberLicenseNo) || "";
61581
+ const pMob = (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD11 = formDetails.plumberDetails) === null || _formDetails$plumberD11 === void 0 ? void 0 : (_formDetails$plumberD12 = _formDetails$plumberD11[0]) === null || _formDetails$plumberD12 === void 0 ? void 0 : _formDetails$plumberD12.plumberMobileNo) || (data === null || data === void 0 ? void 0 : (_data$plumberDetails1 = data.plumberDetails) === null || _data$plumberDetails1 === void 0 ? void 0 : (_data$plumberDetails10 = _data$plumberDetails1[0]) === null || _data$plumberDetails10 === void 0 ? void 0 : _data$plumberDetails10.plumberMobileNo) || "";
61582
+ formData.plumberInfo = [{
61583
+ name: pName,
61584
+ licenseNo: pLic,
61585
+ mobileNumber: pMob
61586
+ }];
61587
+ formData.additionalDetails.plumberName = pName;
61588
+ formData.additionalDetails.plumberLicenseNo = pLic;
61589
+ formData.additionalDetails.plumberMobileNo = pMob;
61590
+ formData.additionalDetails.plumberInfo = formData.plumberInfo;
61591
+ } else if (isDJB) {
61592
+ var _formDetails$plumberD13, _formDetails$plumberD14, _data$plumberDetails11, _data$plumberDetails12;
61593
+ const jeFirm = (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD13 = formDetails.plumberDetails) === null || _formDetails$plumberD13 === void 0 ? void 0 : (_formDetails$plumberD14 = _formDetails$plumberD13[0]) === null || _formDetails$plumberD14 === void 0 ? void 0 : _formDetails$plumberD14.jeOrFirmName) || (data === null || data === void 0 ? void 0 : (_data$plumberDetails11 = data.plumberDetails) === null || _data$plumberDetails11 === void 0 ? void 0 : (_data$plumberDetails12 = _data$plumberDetails11[0]) === null || _data$plumberDetails12 === void 0 ? void 0 : _data$plumberDetails12.jeOrFirmName) || "";
61594
+ formData.plumberInfo = [{
61595
+ name: jeFirm,
61596
+ licenseNo: "",
61597
+ mobileNumber: ""
61598
+ }];
61599
+ formData.additionalDetails.nameOfJEOrFirm = jeFirm;
61600
+ formData.additionalDetails.jeOrFirmName = jeFirm;
61601
+ formData.nameOfJEOrFirm = jeFirm;
61602
+ formData.additionalDetails.plumberInfo = formData.plumberInfo;
61603
+ }
61604
+ const actObj = Array.isArray(formDetails === null || formDetails === void 0 ? void 0 : formDetails.activationDetails) ? formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$activati = formDetails.activationDetails) === null || _formDetails$activati === void 0 ? void 0 : _formDetails$activati[0] : (formDetails === null || formDetails === void 0 ? void 0 : formDetails.activationDetails) || (Array.isArray(data === null || data === void 0 ? void 0 : data.activationDetails) ? data === null || data === void 0 ? void 0 : (_data$activationDetai = data.activationDetails) === null || _data$activationDetai === void 0 ? void 0 : _data$activationDetai[0] : data === null || data === void 0 ? void 0 : data.activationDetails);
61605
+ const meterMakeVal = (actObj === null || actObj === void 0 ? void 0 : (_actObj$meterMake = actObj.meterMake) === null || _actObj$meterMake === void 0 ? void 0 : _actObj$meterMake.name) || (actObj === null || actObj === void 0 ? void 0 : (_actObj$meterMake2 = actObj.meterMake) === null || _actObj$meterMake2 === void 0 ? void 0 : _actObj$meterMake2.code) || (actObj === null || actObj === void 0 ? void 0 : actObj.meterMake) || "";
61606
+ const meterNoVal = (actObj === null || actObj === void 0 ? void 0 : actObj.meterNo) || (actObj === null || actObj === void 0 ? void 0 : actObj.meterId) || "";
61607
+ const meterSizeVal = (actObj === null || actObj === void 0 ? void 0 : (_actObj$meterSize = actObj.meterSize) === null || _actObj$meterSize === void 0 ? void 0 : _actObj$meterSize.name) || (actObj === null || actObj === void 0 ? void 0 : (_actObj$meterSize2 = actObj.meterSize) === null || _actObj$meterSize2 === void 0 ? void 0 : _actObj$meterSize2.value) || (actObj === null || actObj === void 0 ? void 0 : actObj.meterSize) || "";
61608
+ const ferruleSizeVal = (actObj === null || actObj === void 0 ? void 0 : (_actObj$ferruleSize = actObj.ferruleSize) === null || _actObj$ferruleSize === void 0 ? void 0 : _actObj$ferruleSize.name) || (actObj === null || actObj === void 0 ? void 0 : (_actObj$ferruleSize2 = actObj.ferruleSize) === null || _actObj$ferruleSize2 === void 0 ? void 0 : _actObj$ferruleSize2.value) || (actObj === null || actObj === void 0 ? void 0 : actObj.ferruleSize) || "";
61609
+ const initialReadingVal = (actObj === null || actObj === void 0 ? void 0 : actObj.meterInitialReading) !== undefined && (actObj === null || actObj === void 0 ? void 0 : actObj.meterInitialReading) !== "" ? String(actObj.meterInitialReading) : "0";
61610
+ formData.meterId = meterNoVal;
61611
+ formData.meterNo = meterNoVal;
61612
+ formData.meterMake = meterMakeVal;
61613
+ formData.meterSize = meterSizeVal;
61614
+ formData.ferruleSize = ferruleSizeVal;
61615
+ formData.initialMeterReading = initialReadingVal;
61616
+ if (actObj !== null && actObj !== void 0 && actObj.meterInstallationDate) {
61617
+ formData.meterInstallationDate = getConvertedDate(actObj === null || actObj === void 0 ? void 0 : actObj.meterInstallationDate);
61618
+ }
61619
+ if (actObj !== null && actObj !== void 0 && actObj.connectionExecutionDate) {
61620
+ formData.connectionExecutionDate = getConvertedDate(actObj === null || actObj === void 0 ? void 0 : actObj.connectionExecutionDate);
61621
+ }
61622
+ formData.additionalDetails.meterMake = meterMakeVal;
61623
+ formData.additionalDetails.meterNo = meterNoVal;
61624
+ formData.additionalDetails.meterId = meterNoVal;
61625
+ formData.additionalDetails.meterSize = meterSizeVal;
61626
+ formData.additionalDetails.ferruleSize = ferruleSizeVal;
61627
+ formData.additionalDetails.initialMeterReading = initialReadingVal;
61628
+ formData.additionalDetails.meterInstallationDate = formData.meterInstallationDate;
61629
+ formData.additionalDetails.connectionExecutionDate = formData.connectionExecutionDate;
61630
+ const supDocs = (formDetails === null || formDetails === void 0 ? void 0 : formDetails.supportingDocuments) || (data === null || data === void 0 ? void 0 : data.supportingDocuments);
61631
+ const docsList = Array.isArray(supDocs === null || supDocs === void 0 ? void 0 : supDocs.documents) ? supDocs.documents : Array.isArray(supDocs) ? supDocs : [];
61632
+ const meterPhotoObj = (supDocs === null || supDocs === void 0 ? void 0 : supDocs.meterPhoto) || (data === null || data === void 0 ? void 0 : (_data$supportingDocum = data.supportingDocuments) === null || _data$supportingDocum === void 0 ? void 0 : _data$supportingDocum.meterPhoto) || docsList.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === "METER_PHOTO") || (Array.isArray(supDocs) ? supDocs[0] : null);
61633
+ const meterWarrantyObj = (supDocs === null || supDocs === void 0 ? void 0 : supDocs.meterWarranty) || (data === null || data === void 0 ? void 0 : (_data$supportingDocum2 = data.supportingDocuments) === null || _data$supportingDocum2 === void 0 ? void 0 : _data$supportingDocum2.meterWarranty) || docsList.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === "METER_WARRANTY_CARD_TESTING_REPORT_INVOICE");
61634
+ const plumberDeclObj = (supDocs === null || supDocs === void 0 ? void 0 : supDocs.plumberDeclaration) || (data === null || data === void 0 ? void 0 : (_data$supportingDocum3 = data.supportingDocuments) === null || _data$supportingDocum3 === void 0 ? void 0 : _data$supportingDocum3.plumberDeclaration) || docsList.find(d => (d === null || d === void 0 ? void 0 : d.documentType) === "DECLARATION_OF_LICENSED_PLUMBER");
61635
+ const meterPhotoId = meterPhotoObj === null || meterPhotoObj === void 0 ? void 0 : meterPhotoObj.fileStoreId;
61636
+ const meterWarrantyId = meterWarrantyObj === null || meterWarrantyObj === void 0 ? void 0 : meterWarrantyObj.fileStoreId;
61637
+ const plumberDeclId = plumberDeclObj === null || plumberDeclObj === void 0 ? void 0 : plumberDeclObj.fileStoreId;
61638
+ if (meterPhotoId) {
61639
+ formData.additionalDetails.meterPhotoFileStoreId = meterPhotoId;
61640
+ formData.additionalDetails.meterPhoto = {
61641
+ fileStoreId: meterPhotoId,
61642
+ documentType: "METER_PHOTO",
61643
+ fileName: (meterPhotoObj === null || meterPhotoObj === void 0 ? void 0 : meterPhotoObj.fileName) || "Meter_Photo"
61644
+ };
61645
+ }
61646
+ if (meterWarrantyId) {
61647
+ formData.additionalDetails.meterWarrantyFileStoreId = meterWarrantyId;
61648
+ formData.additionalDetails.meterWarranty = {
61649
+ fileStoreId: meterWarrantyId,
61650
+ documentType: "METER_WARRANTY_CARD_TESTING_REPORT_INVOICE",
61651
+ fileName: (meterWarrantyObj === null || meterWarrantyObj === void 0 ? void 0 : meterWarrantyObj.fileName) || "Meter_Warranty_Card_Testing_Report_Invoice"
61652
+ };
61653
+ }
61654
+ if (plumberDeclId) {
61655
+ formData.additionalDetails.plumberDeclarationFileStoreId = plumberDeclId;
61656
+ formData.additionalDetails.plumberDeclaration = {
61657
+ fileStoreId: plumberDeclId,
61658
+ documentType: "DECLARATION_OF_LICENSED_PLUMBER",
61659
+ fileName: (plumberDeclObj === null || plumberDeclObj === void 0 ? void 0 : plumberDeclObj.fileName) || "Declaration_Of_Licensed_Plumber"
61660
+ };
61661
+ }
61662
+ const wfDocs = [];
61663
+ if (meterPhotoId) {
61664
+ wfDocs.push({
61665
+ documentType: "METER_PHOTO",
61666
+ fileStoreId: meterPhotoId,
61667
+ fileName: (meterPhotoObj === null || meterPhotoObj === void 0 ? void 0 : meterPhotoObj.fileName) || "Meter_Photo"
61158
61668
  });
61159
- setTimeout(() => {
61160
- setShowToast(false);
61161
- }, 3000);
61162
- } else {
61163
- var _details4, _formDetails$connecti, _formDetails$connecti2, _formDetails$connecti3, _formDetails$connecti4, _formDetails$connecti5, _formDetails$connecti6, _formDetails$connecti7, _formDetails$connecti8, _formDetails$connecti9, _formDetails$connecti0, _formDetails$connecti1, _formDetails$connecti10, _formDetails$connecti11, _formDetails$connecti12, _formDetails$connecti13, _formDetails$connecti14, _formDetails$connecti15, _formDetails$connecti16, _formDetails$connecti17, _formDetails$connecti18, _formDetails$connecti19, _formDetails$connecti20, _formDetails$connecti21, _formDetails$connecti22, _formDetails$connecti23, _formDetails$connecti24, _formDetails$connecti25, _formDetails$connecti26, _formDetails$connecti27, _formDetails$connecti28, _formDetails$plumberD, _formDetails$plumberD2, _formDetails$plumberD3, _formData$plumberInfo, _formDetails$plumberD7, _formDetails$plumberD8, _formDetails$plumberD9, _formDetails$plumberD0, _formDetails$plumberD1, _formDetails$plumberD10, _formDetails$plumberD11, _formDetails$plumberD12, _formDetails$plumberD13, _formDetails$plumberD14, _formDetails$plumberD15, _formDetails$plumberD16, _formDetails$activati;
61164
- function _temp4() {
61165
- function _temp2() {
61166
- var _formDetails$comments, _formData$application, _baseAppData$applicat, _state39, _formData$application2, _baseAppData$applicat2, _state40, _formDetails$comments2, _formData$application3, _formData$application4;
61167
- formData.comment = (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$comments = formDetails.comments) === null || _formDetails$comments === void 0 ? void 0 : _formDetails$comments.comments) || "";
61168
- const isPendingActivation = (formData === null || formData === void 0 ? void 0 : (_formData$application = formData.applicationStatus) === null || _formData$application === void 0 ? void 0 : _formData$application.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || (baseAppData === null || baseAppData === void 0 ? void 0 : (_baseAppData$applicat = baseAppData.applicationStatus) === null || _baseAppData$applicat === void 0 ? void 0 : _baseAppData$applicat.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || (filters === null || filters === void 0 ? void 0 : filters.action) === "ACTIVATE_CONNECTION" || ((_state39 = state) === null || _state39 === void 0 ? void 0 : _state39.action) === "ACTIVATE_CONNECTION";
61169
- const isPendingMeter = !isPendingActivation && ((formData === null || formData === void 0 ? void 0 : (_formData$application2 = formData.applicationStatus) === null || _formData$application2 === void 0 ? void 0 : _formData$application2.includes("PENDING_FOR_METER_INSTALLATION")) || (baseAppData === null || baseAppData === void 0 ? void 0 : (_baseAppData$applicat2 = baseAppData.applicationStatus) === null || _baseAppData$applicat2 === void 0 ? void 0 : _baseAppData$applicat2.includes("PENDING_FOR_METER_INSTALLATION")) || (filters === null || filters === void 0 ? void 0 : filters.action) === "ENTER_METER_DETAILS" || ((_state40 = state) === null || _state40 === void 0 ? void 0 : _state40.action) === "ENTER_METER_DETAILS");
61170
- const currentAction = isPendingActivation ? "ACTIVATE_CONNECTION" : isPendingMeter ? "ENTER_METER_DETAILS" : (filters === null || filters === void 0 ? void 0 : filters.action) || "ACTIVATE_CONNECTION";
61171
- formData.action = currentAction;
61172
- formData.wfDocuments = docFileStoreId ? [{
61173
- documentType: "Document - 1",
61174
- fileStoreId: docFileStoreId
61175
- }] : [];
61176
- formData.processInstance = {
61177
- action: currentAction,
61178
- comment: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$comments2 = formDetails.comments) === null || _formDetails$comments2 === void 0 ? void 0 : _formDetails$comments2.comments) || "",
61179
- documents: docFileStoreId ? [{
61180
- documentType: "Document - 1",
61181
- fileStoreId: docFileStoreId
61182
- }] : []
61183
- };
61184
- const isWater = filters !== null && filters !== void 0 && filters.service ? filters.service.toUpperCase() === "WATER" : (formData === null || formData === void 0 ? void 0 : formData.serviceType) === "WATER" || !(formData !== null && formData !== void 0 && formData.serviceType);
61185
- const isReconnection = (formData === null || formData === void 0 ? void 0 : (_formData$application3 = formData.applicationType) === null || _formData$application3 === void 0 ? void 0 : _formData$application3.includes("RECONNECT")) || (formData === null || formData === void 0 ? void 0 : (_formData$application4 = formData.applicationNo) === null || _formData$application4 === void 0 ? void 0 : _formData$application4.includes("RC"));
61186
- if (isWater) {
61187
- formData.waterSource = "GROUND.WELL";
61188
- formData.proposedPipeSize = 0;
61189
- formData.proposedTaps = 0;
61190
- formData.pipeSize = 0;
61191
- formData.noOfTaps = 0;
61192
- formData.connectionType = "Metered";
61193
- if (!formData.additionalDetails) formData.additionalDetails = {};
61194
- formData.additionalDetails.connectionType = "Permanent";
61195
- }
61196
- const reqDetails = isWater ? isReconnection ? {
61197
- WaterConnection: formData,
61198
- reconnectRequest: true,
61199
- disconnectRequest: false
61200
- } : {
61201
- WaterConnection: formData,
61202
- reconnectRequest: false,
61203
- disconnectRequest: false
61204
- } : isReconnection ? {
61205
- SewerageConnection: formData,
61206
- reconnectRequest: true,
61207
- disconnectRequest: false
61208
- } : {
61209
- SewerageConnection: formData,
61210
- reconnectRequest: false,
61211
- disconnectRequest: false
61212
- };
61213
- if (reqDetails !== null && reqDetails !== void 0 && reqDetails.WaterConnection) {
61214
- reqDetails.WaterConnection.waterSource = "GROUND.WELL";
61215
- reqDetails.WaterConnection.proposedPipeSize = 0;
61216
- reqDetails.WaterConnection.proposedTaps = 0;
61217
- reqDetails.WaterConnection.pipeSize = 0;
61218
- reqDetails.WaterConnection.noOfTaps = 0;
61219
- reqDetails.WaterConnection.connectionType = "Metered";
61220
- if (!reqDetails.WaterConnection.additionalDetails) reqDetails.WaterConnection.additionalDetails = {};
61221
- reqDetails.WaterConnection.additionalDetails.connectionType = "Permanent";
61222
- }
61223
- if (reqDetails !== null && reqDetails !== void 0 && reqDetails.SewerageConnection) {
61224
- if (!reqDetails.SewerageConnection.additionalDetails) reqDetails.SewerageConnection.additionalDetails = {};
61225
- reqDetails.SewerageConnection.additionalDetails.connectionType = "Permanent";
61226
- }
61227
- if (mutate) {
61228
- mutate(reqDetails, {
61229
- onError: (error, variables) => {
61230
- setShowToast({
61231
- key: "error",
61232
- message: error !== null && error !== void 0 && error.message ? error.message : error
61233
- });
61234
- setTimeout(closeToastOfError, 5000);
61235
- },
61236
- onSuccess: (data, variables) => {
61237
- setShowToast({
61238
- key: false,
61239
- message: "WS_ACTIVATE_SUCCESS_MESSAGE_MAIN"
61240
- });
61241
- setIsAppDetailsPage(true);
61242
- }
61243
- });
61244
- }
61245
- }
61246
- if (!formData.additionalDetails) formData.additionalDetails = {};
61247
- formData.additionalDetails.initialMeterReading = (actObj === null || actObj === void 0 ? void 0 : actObj.meterInitialReading) !== undefined && (actObj === null || actObj === void 0 ? void 0 : actObj.meterInitialReading) !== "" ? actObj.meterInitialReading : "0";
61248
- const _temp = function () {
61249
- if (actObj !== null && actObj !== void 0 && actObj.connectionExecutionDate) return Promise.resolve(getConvertedDate(actObj === null || actObj === void 0 ? void 0 : actObj.connectionExecutionDate)).then(function (_getConvertedDate2) {
61250
- formData.connectionExecutionDate = _getConvertedDate2;
61251
- });
61252
- }();
61253
- return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
61254
- }
61255
- const formDetails = cloneDeep_1(data);
61256
- const baseAppData = (appDetails === null || appDetails === void 0 ? void 0 : appDetails.applicationData) || (appDetails !== null && appDetails !== void 0 && appDetails.applicationNo ? appDetails : null) || ((_details4 = details) === null || _details4 === void 0 ? void 0 : _details4.applicationData) || initialAppData || {};
61257
- const formData = cloneDeep_1(baseAppData);
61258
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti = formDetails.connectionDetails) !== null && _formDetails$connecti !== void 0 && (_formDetails$connecti2 = _formDetails$connecti[0]) !== null && _formDetails$connecti2 !== void 0 && (_formDetails$connecti3 = _formDetails$connecti2.connectionType) !== null && _formDetails$connecti3 !== void 0 && _formDetails$connecti3.code) formData.connectionType = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti4 = formDetails.connectionDetails) === null || _formDetails$connecti4 === void 0 ? void 0 : (_formDetails$connecti5 = _formDetails$connecti4[0]) === null || _formDetails$connecti5 === void 0 ? void 0 : (_formDetails$connecti6 = _formDetails$connecti5.connectionType) === null || _formDetails$connecti6 === void 0 ? void 0 : _formDetails$connecti6.code;
61259
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti7 = formDetails.connectionDetails) !== null && _formDetails$connecti7 !== void 0 && (_formDetails$connecti8 = _formDetails$connecti7[0]) !== null && _formDetails$connecti8 !== void 0 && (_formDetails$connecti9 = _formDetails$connecti8.waterSource) !== null && _formDetails$connecti9 !== void 0 && _formDetails$connecti9.code) formData.waterSource = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti0 = formDetails.connectionDetails) === null || _formDetails$connecti0 === void 0 ? void 0 : (_formDetails$connecti1 = _formDetails$connecti0[0]) === null || _formDetails$connecti1 === void 0 ? void 0 : (_formDetails$connecti10 = _formDetails$connecti1.sourceSubData) === null || _formDetails$connecti10 === void 0 ? void 0 : _formDetails$connecti10.code;
61260
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti11 = formDetails.connectionDetails) !== null && _formDetails$connecti11 !== void 0 && (_formDetails$connecti12 = _formDetails$connecti11[0]) !== null && _formDetails$connecti12 !== void 0 && (_formDetails$connecti13 = _formDetails$connecti12.pipeSize) !== null && _formDetails$connecti13 !== void 0 && _formDetails$connecti13.size) formData.pipeSize = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti14 = formDetails.connectionDetails) === null || _formDetails$connecti14 === void 0 ? void 0 : (_formDetails$connecti15 = _formDetails$connecti14[0]) === null || _formDetails$connecti15 === void 0 ? void 0 : (_formDetails$connecti16 = _formDetails$connecti15.pipeSize) === null || _formDetails$connecti16 === void 0 ? void 0 : _formDetails$connecti16.size;
61261
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti17 = formDetails.connectionDetails) !== null && _formDetails$connecti17 !== void 0 && (_formDetails$connecti18 = _formDetails$connecti17[0]) !== null && _formDetails$connecti18 !== void 0 && _formDetails$connecti18.noOfTaps) formData.noOfTaps = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti19 = formDetails.connectionDetails) === null || _formDetails$connecti19 === void 0 ? void 0 : (_formDetails$connecti20 = _formDetails$connecti19[0]) === null || _formDetails$connecti20 === void 0 ? void 0 : _formDetails$connecti20.noOfTaps;
61262
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti21 = formDetails.connectionDetails) !== null && _formDetails$connecti21 !== void 0 && (_formDetails$connecti22 = _formDetails$connecti21[0]) !== null && _formDetails$connecti22 !== void 0 && _formDetails$connecti22.noOfWaterClosets) formData.noOfWaterClosets = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti23 = formDetails.connectionDetails) === null || _formDetails$connecti23 === void 0 ? void 0 : (_formDetails$connecti24 = _formDetails$connecti23[0]) === null || _formDetails$connecti24 === void 0 ? void 0 : _formDetails$connecti24.noOfWaterClosets;
61263
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$connecti25 = formDetails.connectionDetails) !== null && _formDetails$connecti25 !== void 0 && (_formDetails$connecti26 = _formDetails$connecti25[0]) !== null && _formDetails$connecti26 !== void 0 && _formDetails$connecti26.noOfToilets) formData.noOfToilets = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$connecti27 = formDetails.connectionDetails) === null || _formDetails$connecti27 === void 0 ? void 0 : (_formDetails$connecti28 = _formDetails$connecti27[0]) === null || _formDetails$connecti28 === void 0 ? void 0 : _formDetails$connecti28.noOfToilets;
61264
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$plumberD = formDetails.plumberDetails) !== null && _formDetails$plumberD !== void 0 && (_formDetails$plumberD2 = _formDetails$plumberD[0]) !== null && _formDetails$plumberD2 !== void 0 && (_formDetails$plumberD3 = _formDetails$plumberD2.detailsProvidedBy) !== null && _formDetails$plumberD3 !== void 0 && _formDetails$plumberD3.code) {
61265
- var _formDetails$plumberD4, _formDetails$plumberD5, _formDetails$plumberD6;
61266
- if (!formData.additionalDetails) formData.additionalDetails = {};
61267
- formData.additionalDetails.detailsProvidedBy = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD4 = formDetails.plumberDetails) === null || _formDetails$plumberD4 === void 0 ? void 0 : (_formDetails$plumberD5 = _formDetails$plumberD4[0]) === null || _formDetails$plumberD5 === void 0 ? void 0 : (_formDetails$plumberD6 = _formDetails$plumberD5.detailsProvidedBy) === null || _formDetails$plumberD6 === void 0 ? void 0 : _formDetails$plumberD6.code;
61669
+ }
61670
+ if (meterWarrantyId) {
61671
+ wfDocs.push({
61672
+ documentType: "METER_WARRANTY_CARD_TESTING_REPORT_INVOICE",
61673
+ fileStoreId: meterWarrantyId,
61674
+ fileName: (meterWarrantyObj === null || meterWarrantyObj === void 0 ? void 0 : meterWarrantyObj.fileName) || "Meter_Warranty_Card_Testing_Report_Invoice"
61675
+ });
61676
+ }
61677
+ if (plumberDeclId) {
61678
+ wfDocs.push({
61679
+ documentType: "DECLARATION_OF_LICENSED_PLUMBER",
61680
+ fileStoreId: plumberDeclId,
61681
+ fileName: (plumberDeclObj === null || plumberDeclObj === void 0 ? void 0 : plumberDeclObj.fileName) || "Declaration_Of_Licensed_Plumber"
61682
+ });
61683
+ }
61684
+ if (wfDocs.length === 0 && meterPhotoId) {
61685
+ wfDocs.push({
61686
+ documentType: "Document - 1",
61687
+ fileStoreId: meterPhotoId
61688
+ });
61689
+ }
61690
+ formData.comment = (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$comments = formDetails.comments) === null || _formDetails$comments === void 0 ? void 0 : _formDetails$comments.comments) || "";
61691
+ formData.comments = (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$comments2 = formDetails.comments) === null || _formDetails$comments2 === void 0 ? void 0 : _formDetails$comments2.comments) || "";
61692
+ const isPendingActivation = (formData === null || formData === void 0 ? void 0 : (_formData$application = formData.applicationStatus) === null || _formData$application === void 0 ? void 0 : _formData$application.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || (baseAppData === null || baseAppData === void 0 ? void 0 : (_baseAppData$applicat = baseAppData.applicationStatus) === null || _baseAppData$applicat === void 0 ? void 0 : _baseAppData$applicat.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || (filters === null || filters === void 0 ? void 0 : filters.action) === "ACTIVATE_CONNECTION" || ((_state54 = state) === null || _state54 === void 0 ? void 0 : _state54.action) === "ACTIVATE_CONNECTION";
61693
+ const isPendingMeter = !isPendingActivation && ((formData === null || formData === void 0 ? void 0 : (_formData$application2 = formData.applicationStatus) === null || _formData$application2 === void 0 ? void 0 : _formData$application2.includes("PENDING_FOR_METER_INSTALLATION")) || (baseAppData === null || baseAppData === void 0 ? void 0 : (_baseAppData$applicat2 = baseAppData.applicationStatus) === null || _baseAppData$applicat2 === void 0 ? void 0 : _baseAppData$applicat2.includes("PENDING_FOR_METER_INSTALLATION")) || (filters === null || filters === void 0 ? void 0 : filters.action) === "ENTER_METER_DETAILS" || ((_state55 = state) === null || _state55 === void 0 ? void 0 : _state55.action) === "ENTER_METER_DETAILS");
61694
+ const currentAction = isPendingActivation ? "ACTIVATE_CONNECTION" : isPendingMeter ? "ENTER_METER_DETAILS" : (filters === null || filters === void 0 ? void 0 : filters.action) || "ACTIVATE_CONNECTION";
61695
+ formData.action = currentAction;
61696
+ formData.wfDocuments = wfDocs;
61697
+ formData.processInstance = {
61698
+ action: currentAction,
61699
+ comment: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$comments3 = formDetails.comments) === null || _formDetails$comments3 === void 0 ? void 0 : _formDetails$comments3.comments) || "",
61700
+ documents: wfDocs
61701
+ };
61702
+ const existingDocs = Array.isArray(formData.documents) ? formData.documents.filter(d => !["METER_PHOTO", "METER_WARRANTY_CARD_TESTING_REPORT_INVOICE", "DECLARATION_OF_LICENSED_PLUMBER", "Document - 1"].includes(d === null || d === void 0 ? void 0 : d.documentType)) : [];
61703
+ formData.documents = [...existingDocs, ...wfDocs.map(d => ({
61704
+ documentType: d.documentType,
61705
+ fileStoreId: d.fileStoreId,
61706
+ documentUid: d.fileStoreId,
61707
+ fileName: d.fileName,
61708
+ status: "ACTIVE"
61709
+ }))];
61710
+ const isWater = filters !== null && filters !== void 0 && filters.service ? filters.service.toUpperCase() === "WATER" : (formData === null || formData === void 0 ? void 0 : formData.serviceType) === "WATER" || !(formData !== null && formData !== void 0 && formData.serviceType);
61711
+ const isReconnection = (formData === null || formData === void 0 ? void 0 : (_formData$application3 = formData.applicationType) === null || _formData$application3 === void 0 ? void 0 : _formData$application3.includes("RECONNECT")) || (formData === null || formData === void 0 ? void 0 : (_formData$application4 = formData.applicationNo) === null || _formData$application4 === void 0 ? void 0 : _formData$application4.includes("RC"));
61712
+ if (isWater) {
61713
+ formData.waterSource = "GROUND.WELL";
61714
+ formData.proposedPipeSize = 0;
61715
+ formData.proposedTaps = 0;
61716
+ formData.pipeSize = 0;
61717
+ formData.noOfTaps = 0;
61718
+ formData.connectionType = "Metered";
61719
+ if (!formData.additionalDetails) formData.additionalDetails = {};
61720
+ formData.additionalDetails.connectionType = "Permanent";
61721
+ }
61722
+ const reqDetails = isWater ? isReconnection ? {
61723
+ WaterConnection: formData,
61724
+ reconnectRequest: true,
61725
+ disconnectRequest: false
61726
+ } : {
61727
+ WaterConnection: formData,
61728
+ reconnectRequest: false,
61729
+ disconnectRequest: false
61730
+ } : isReconnection ? {
61731
+ SewerageConnection: formData,
61732
+ reconnectRequest: true,
61733
+ disconnectRequest: false
61734
+ } : {
61735
+ SewerageConnection: formData,
61736
+ reconnectRequest: false,
61737
+ disconnectRequest: false
61738
+ };
61739
+ const targetConn = (reqDetails === null || reqDetails === void 0 ? void 0 : reqDetails.WaterConnection) || (reqDetails === null || reqDetails === void 0 ? void 0 : reqDetails.SewerageConnection);
61740
+ if (targetConn) {
61741
+ if (isWater) {
61742
+ targetConn.waterSource = "GROUND.WELL";
61743
+ targetConn.proposedPipeSize = 0;
61744
+ targetConn.proposedTaps = 0;
61745
+ targetConn.pipeSize = 0;
61746
+ targetConn.noOfTaps = 0;
61268
61747
  }
61269
- if (!(formData !== null && formData !== void 0 && formData.plumberInfo) || !(formData !== null && formData !== void 0 && (_formData$plumberInfo = formData.plumberInfo) !== null && _formData$plumberInfo !== void 0 && _formData$plumberInfo[0])) formData.plumberInfo = [{}];
61270
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$plumberD7 = formDetails.plumberDetails) !== null && _formDetails$plumberD7 !== void 0 && (_formDetails$plumberD8 = _formDetails$plumberD7[0]) !== null && _formDetails$plumberD8 !== void 0 && _formDetails$plumberD8.plumberName) formData.plumberInfo[0].name = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD9 = formDetails.plumberDetails) === null || _formDetails$plumberD9 === void 0 ? void 0 : (_formDetails$plumberD0 = _formDetails$plumberD9[0]) === null || _formDetails$plumberD0 === void 0 ? void 0 : _formDetails$plumberD0.plumberName;
61271
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$plumberD1 = formDetails.plumberDetails) !== null && _formDetails$plumberD1 !== void 0 && (_formDetails$plumberD10 = _formDetails$plumberD1[0]) !== null && _formDetails$plumberD10 !== void 0 && _formDetails$plumberD10.plumberLicenseNo) formData.plumberInfo[0].licenseNo = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD11 = formDetails.plumberDetails) === null || _formDetails$plumberD11 === void 0 ? void 0 : (_formDetails$plumberD12 = _formDetails$plumberD11[0]) === null || _formDetails$plumberD12 === void 0 ? void 0 : _formDetails$plumberD12.plumberLicenseNo;
61272
- if (formDetails !== null && formDetails !== void 0 && (_formDetails$plumberD13 = formDetails.plumberDetails) !== null && _formDetails$plumberD13 !== void 0 && (_formDetails$plumberD14 = _formDetails$plumberD13[0]) !== null && _formDetails$plumberD14 !== void 0 && _formDetails$plumberD14.plumberMobileNo) formData.plumberInfo[0].mobileNumber = formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$plumberD15 = formDetails.plumberDetails) === null || _formDetails$plumberD15 === void 0 ? void 0 : (_formDetails$plumberD16 = _formDetails$plumberD15[0]) === null || _formDetails$plumberD16 === void 0 ? void 0 : _formDetails$plumberD16.plumberMobileNo;
61273
- const actObj = Array.isArray(formDetails === null || formDetails === void 0 ? void 0 : formDetails.activationDetails) ? formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$activati = formDetails.activationDetails) === null || _formDetails$activati === void 0 ? void 0 : _formDetails$activati[0] : formDetails === null || formDetails === void 0 ? void 0 : formDetails.activationDetails;
61274
- if (actObj !== null && actObj !== void 0 && actObj.meterId) formData.meterId = actObj === null || actObj === void 0 ? void 0 : actObj.meterId;
61275
- const _temp3 = function () {
61276
- if (actObj !== null && actObj !== void 0 && actObj.meterInstallationDate) return Promise.resolve(getConvertedDate(actObj === null || actObj === void 0 ? void 0 : actObj.meterInstallationDate)).then(function (_getConvertedDate) {
61277
- formData.meterInstallationDate = _getConvertedDate;
61278
- });
61279
- }();
61280
- return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
61748
+ targetConn.connectionType = "Metered";
61749
+ if (!targetConn.additionalDetails) targetConn.additionalDetails = {};
61750
+ targetConn.additionalDetails.connectionType = "Permanent";
61751
+ targetConn.meterId = formData.meterId;
61752
+ targetConn.meterNo = formData.meterNo;
61753
+ targetConn.meterMake = formData.meterMake;
61754
+ targetConn.meterSize = formData.meterSize;
61755
+ targetConn.ferruleSize = formData.ferruleSize;
61756
+ targetConn.initialMeterReading = formData.initialMeterReading;
61757
+ targetConn.meterInstallationDate = formData.meterInstallationDate;
61758
+ targetConn.connectionExecutionDate = formData.connectionExecutionDate;
61759
+ targetConn.additionalDetails = {
61760
+ ...targetConn.additionalDetails,
61761
+ ...formData.additionalDetails
61762
+ };
61763
+ targetConn.wfDocuments = formData.wfDocuments;
61764
+ targetConn.documents = formData.documents;
61765
+ targetConn.processInstance = formData.processInstance;
61766
+ targetConn.plumberInfo = formData.plumberInfo;
61767
+ if (formData.nameOfJEOrFirm) targetConn.nameOfJEOrFirm = formData.nameOfJEOrFirm;
61768
+ }
61769
+ if (mutate) {
61770
+ mutate(reqDetails, {
61771
+ onError: (error, variables) => {
61772
+ setShowToast({
61773
+ key: "error",
61774
+ message: error !== null && error !== void 0 && error.message ? error.message : error
61775
+ });
61776
+ setTimeout(closeToastOfError, 5000);
61777
+ },
61778
+ onSuccess: (data, variables) => {
61779
+ setShowToast({
61780
+ key: false,
61781
+ message: "WS_ACTIVATE_SUCCESS_MESSAGE_MAIN"
61782
+ });
61783
+ setIsAppDetailsPage(true);
61784
+ }
61785
+ });
61281
61786
  }
61282
- }());
61787
+ }
61788
+ return Promise.resolve();
61283
61789
  } catch (e) {
61284
61790
  return Promise.reject(e);
61285
61791
  }
61286
61792
  };
61287
- const isPendingActivation = (filters === null || filters === void 0 ? void 0 : filters.action) === "ACTIVATE_CONNECTION" || ((_state41 = state) === null || _state41 === void 0 ? void 0 : _state41.action) === "ACTIVATE_CONNECTION" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a5 = applicationDetails.applicationData) === null || _applicationDetails$a5 === void 0 ? void 0 : (_applicationDetails$a6 = _applicationDetails$a5.applicationStatus) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || (initialAppData === null || initialAppData === void 0 ? void 0 : (_initialAppData$appli3 = initialAppData.applicationStatus) === null || _initialAppData$appli3 === void 0 ? void 0 : _initialAppData$appli3.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || ((_details5 = details) === null || _details5 === void 0 ? void 0 : (_details5$application = _details5.applicationData) === null || _details5$application === void 0 ? void 0 : (_details5$application2 = _details5$application.applicationStatus) === null || _details5$application2 === void 0 ? void 0 : _details5$application2.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || (appDetails === null || appDetails === void 0 ? void 0 : (_appDetails$applicati = appDetails.applicationStatus) === null || _appDetails$applicati === void 0 ? void 0 : _appDetails$applicati.includes("PENDING_FOR_CONNECTION_ACTIVATION"));
61288
- const isPendingMeter = !isPendingActivation && ((filters === null || filters === void 0 ? void 0 : filters.action) === "ENTER_METER_DETAILS" || ((_state42 = state) === null || _state42 === void 0 ? void 0 : _state42.action) === "ENTER_METER_DETAILS" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a7 = applicationDetails.applicationData) === null || _applicationDetails$a7 === void 0 ? void 0 : (_applicationDetails$a8 = _applicationDetails$a7.applicationStatus) === null || _applicationDetails$a8 === void 0 ? void 0 : _applicationDetails$a8.includes("PENDING_FOR_METER_INSTALLATION")) || (initialAppData === null || initialAppData === void 0 ? void 0 : (_initialAppData$appli4 = initialAppData.applicationStatus) === null || _initialAppData$appli4 === void 0 ? void 0 : _initialAppData$appli4.includes("PENDING_FOR_METER_INSTALLATION")) || ((_details6 = details) === null || _details6 === void 0 ? void 0 : (_details6$application = _details6.applicationData) === null || _details6$application === void 0 ? void 0 : (_details6$application2 = _details6$application.applicationStatus) === null || _details6$application2 === void 0 ? void 0 : _details6$application2.includes("PENDING_FOR_METER_INSTALLATION")) || (appDetails === null || appDetails === void 0 ? void 0 : (_appDetails$applicati2 = appDetails.applicationStatus) === null || _appDetails$applicati2 === void 0 ? void 0 : _appDetails$applicati2.includes("PENDING_FOR_METER_INSTALLATION")));
61793
+ const isPendingActivation = (filters === null || filters === void 0 ? void 0 : filters.action) === "ACTIVATE_CONNECTION" || ((_state56 = state) === null || _state56 === void 0 ? void 0 : _state56.action) === "ACTIVATE_CONNECTION" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a5 = applicationDetails.applicationData) === null || _applicationDetails$a5 === void 0 ? void 0 : (_applicationDetails$a6 = _applicationDetails$a5.applicationStatus) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || (initialAppData === null || initialAppData === void 0 ? void 0 : (_initialAppData$appli3 = initialAppData.applicationStatus) === null || _initialAppData$appli3 === void 0 ? void 0 : _initialAppData$appli3.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || ((_details5 = details) === null || _details5 === void 0 ? void 0 : (_details5$application = _details5.applicationData) === null || _details5$application === void 0 ? void 0 : (_details5$application2 = _details5$application.applicationStatus) === null || _details5$application2 === void 0 ? void 0 : _details5$application2.includes("PENDING_FOR_CONNECTION_ACTIVATION")) || (appDetails === null || appDetails === void 0 ? void 0 : (_appDetails$applicati = appDetails.applicationStatus) === null || _appDetails$applicati === void 0 ? void 0 : _appDetails$applicati.includes("PENDING_FOR_CONNECTION_ACTIVATION"));
61794
+ const isPendingMeter = !isPendingActivation && ((filters === null || filters === void 0 ? void 0 : filters.action) === "ENTER_METER_DETAILS" || ((_state57 = state) === null || _state57 === void 0 ? void 0 : _state57.action) === "ENTER_METER_DETAILS" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a7 = applicationDetails.applicationData) === null || _applicationDetails$a7 === void 0 ? void 0 : (_applicationDetails$a8 = _applicationDetails$a7.applicationStatus) === null || _applicationDetails$a8 === void 0 ? void 0 : _applicationDetails$a8.includes("PENDING_FOR_METER_INSTALLATION")) || (initialAppData === null || initialAppData === void 0 ? void 0 : (_initialAppData$appli4 = initialAppData.applicationStatus) === null || _initialAppData$appli4 === void 0 ? void 0 : _initialAppData$appli4.includes("PENDING_FOR_METER_INSTALLATION")) || ((_details6 = details) === null || _details6 === void 0 ? void 0 : (_details6$application = _details6.applicationData) === null || _details6$application === void 0 ? void 0 : (_details6$application2 = _details6$application.applicationStatus) === null || _details6$application2 === void 0 ? void 0 : _details6$application2.includes("PENDING_FOR_METER_INSTALLATION")) || (appDetails === null || appDetails === void 0 ? void 0 : (_appDetails$applicati2 = appDetails.applicationStatus) === null || _appDetails$applicati2 === void 0 ? void 0 : _appDetails$applicati2.includes("PENDING_FOR_METER_INSTALLATION")));
61289
61795
  const getActionLabel = () => {
61290
61796
  if (isPendingActivation) {
61291
61797
  return t("WF_EMPLOYEE_NEWSW1_ACTIVATE_CONNECTION") && t("WF_EMPLOYEE_NEWSW1_ACTIVATE_CONNECTION") !== "WF_EMPLOYEE_NEWSW1_ACTIVATE_CONNECTION" ? t("WF_EMPLOYEE_NEWSW1_ACTIVATE_CONNECTION") : t("WS_ACTIVATE_CONNECTION") && t("WS_ACTIVATE_CONNECTION") !== "WS_ACTIVATE_CONNECTION" ? t("WS_ACTIVATE_CONNECTION") : "Activate Connection";
@@ -61326,6 +61832,7 @@ const ActivateConnection = () => {
61326
61832
  onSubmit: onSubmit,
61327
61833
  label: getActionLabel(),
61328
61834
  onFormValueChange: onFormValueChange,
61835
+ isDisabled: !canSubmit,
61329
61836
  noBreakLine: true,
61330
61837
  noCard: true
61331
61838
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
@@ -68694,9 +69201,8 @@ const CheckPage$4 = _ref2 => {
68694
69201
  declarationData: declarationData
68695
69202
  },
68696
69203
  userType: "employee"
68697
- })), ((_declarationData$sign, _data$declarationData, _data$declaration, _data$additionalDetai8) => {
68698
- const hasSignature = Boolean((declarationData === null || declarationData === void 0 ? void 0 : declarationData.signatureFileStoreId) || (declarationData === null || declarationData === void 0 ? void 0 : declarationData.signature) || (declarationData === null || declarationData === void 0 ? void 0 : (_declarationData$sign = declarationData.signatureFile) === null || _declarationData$sign === void 0 ? void 0 : _declarationData$sign.fileStoreId) || typeof (declarationData === null || declarationData === void 0 ? void 0 : declarationData.signatureFile) === "string" && (declarationData === null || declarationData === void 0 ? void 0 : declarationData.signatureFile.trim()) || (data === null || data === void 0 ? void 0 : (_data$declarationData = data.declarationData) === null || _data$declarationData === void 0 ? void 0 : _data$declarationData.signatureFileStoreId) || (data === null || data === void 0 ? void 0 : (_data$declaration = data.declaration) === null || _data$declaration === void 0 ? void 0 : _data$declaration.signatureFileStoreId) || (data === null || data === void 0 ? void 0 : (_data$additionalDetai8 = data.additionalDetails) === null || _data$additionalDetai8 === void 0 ? void 0 : _data$additionalDetai8.signatureFileStoreId));
68699
- const isSubmitDisabled = !(declarationData !== null && declarationData !== void 0 && declarationData.agree) || !hasSignature;
69204
+ })), (() => {
69205
+ const isSubmitDisabled = !(declarationData !== null && declarationData !== void 0 && declarationData.agree);
68700
69206
  return /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
68701
69207
  label: t("CS_COMMON_SUBMIT"),
68702
69208
  onSubmit: () => {
@@ -69168,20 +69674,9 @@ const OLDApplication = () => {
69168
69674
  return;
69169
69675
  }
69170
69676
  }
69171
- const hasPhoto = allSubmitDocs.some(d => {
69172
- var _d$documentType3;
69173
- return ((d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.PHOTO" || (d === null || d === void 0 ? void 0 : (_d$documentType3 = d.documentType) === null || _d$documentType3 === void 0 ? void 0 : _d$documentType3.includes("PHOTO")) || (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.APPLICANTPHOTO") && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file));
69174
- });
69175
- if (!hasPhoto) {
69176
- setShowToast({
69177
- key: "error",
69178
- message: t("WS_PHOTO_MANDATORY") || "Applicant Photo is mandatory"
69179
- });
69180
- return;
69181
- }
69182
69677
  const hasIdentity = allSubmitDocs.some(d => {
69183
- var _d$documentType4, _d$documentType5;
69184
- return ((d === null || d === void 0 ? void 0 : (_d$documentType4 = d.documentType) === null || _d$documentType4 === void 0 ? void 0 : _d$documentType4.includes("IDENTITYPROOF")) || (d === null || d === void 0 ? void 0 : (_d$documentType5 = d.documentType) === null || _d$documentType5 === void 0 ? void 0 : _d$documentType5.includes("IDENTITY"))) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file));
69678
+ var _d$documentType3, _d$documentType4;
69679
+ return ((d === null || d === void 0 ? void 0 : (_d$documentType3 = d.documentType) === null || _d$documentType3 === void 0 ? void 0 : _d$documentType3.includes("IDENTITYPROOF")) || (d === null || d === void 0 ? void 0 : (_d$documentType4 = d.documentType) === null || _d$documentType4 === void 0 ? void 0 : _d$documentType4.includes("IDENTITY"))) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file));
69185
69680
  });
69186
69681
  if (!hasIdentity) {
69187
69682
  setShowToast({
@@ -69191,8 +69686,8 @@ const OLDApplication = () => {
69191
69686
  return;
69192
69687
  }
69193
69688
  const hasOwnership = allSubmitDocs.some(d => {
69194
- var _d$documentType6, _d$documentType7;
69195
- return ((d === null || d === void 0 ? void 0 : (_d$documentType6 = d.documentType) === null || _d$documentType6 === void 0 ? void 0 : _d$documentType6.includes("ADDRESSPROOF")) || (d === null || d === void 0 ? void 0 : (_d$documentType7 = d.documentType) === null || _d$documentType7 === void 0 ? void 0 : _d$documentType7.includes("OWNERSHIP"))) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file));
69689
+ var _d$documentType5, _d$documentType6;
69690
+ return ((d === null || d === void 0 ? void 0 : (_d$documentType5 = d.documentType) === null || _d$documentType5 === void 0 ? void 0 : _d$documentType5.includes("ADDRESSPROOF")) || (d === null || d === void 0 ? void 0 : (_d$documentType6 = d.documentType) === null || _d$documentType6 === void 0 ? void 0 : _d$documentType6.includes("OWNERSHIP"))) && ((d === null || d === void 0 ? void 0 : d.fileStoreId) || (d === null || d === void 0 ? void 0 : d.file));
69196
69691
  });
69197
69692
  if (!hasOwnership) {
69198
69693
  setShowToast({
@@ -69265,16 +69760,16 @@ const OLDApplication = () => {
69265
69760
  var _docWithValidity$addi, _docWithValidity$addi2, _rwhDoc$additionalDet, _stpDoc$additionalDet;
69266
69761
  const docs = data.DocumentsRequired.documents;
69267
69762
  const identityDoc = docs.find(d => {
69268
- var _d$documentType8;
69269
- return d === null || d === void 0 ? void 0 : (_d$documentType8 = d.documentType) === null || _d$documentType8 === void 0 ? void 0 : _d$documentType8.includes("IDENTITYPROOF");
69763
+ var _d$documentType7;
69764
+ return d === null || d === void 0 ? void 0 : (_d$documentType7 = d.documentType) === null || _d$documentType7 === void 0 ? void 0 : _d$documentType7.includes("IDENTITYPROOF");
69270
69765
  });
69271
69766
  const ownershipDoc = docs.find(d => {
69272
- var _d$documentType9, _d$documentType0;
69273
- return (d === null || d === void 0 ? void 0 : (_d$documentType9 = d.documentType) === null || _d$documentType9 === void 0 ? void 0 : _d$documentType9.includes("ADDRESSPROOF")) || (d === null || d === void 0 ? void 0 : (_d$documentType0 = d.documentType) === null || _d$documentType0 === void 0 ? void 0 : _d$documentType0.includes("OWNERSHIPPROOF"));
69767
+ var _d$documentType8, _d$documentType9;
69768
+ return (d === null || d === void 0 ? void 0 : (_d$documentType8 = d.documentType) === null || _d$documentType8 === void 0 ? void 0 : _d$documentType8.includes("ADDRESSPROOF")) || (d === null || d === void 0 ? void 0 : (_d$documentType9 = d.documentType) === null || _d$documentType9 === void 0 ? void 0 : _d$documentType9.includes("OWNERSHIPPROOF"));
69274
69769
  });
69275
69770
  const otherDoc = docs.find(d => {
69276
- var _d$documentType1;
69277
- return d === null || d === void 0 ? void 0 : (_d$documentType1 = d.documentType) === null || _d$documentType1 === void 0 ? void 0 : _d$documentType1.includes("OTHERDOCUMENTS");
69771
+ var _d$documentType0;
69772
+ return d === null || d === void 0 ? void 0 : (_d$documentType0 = d.documentType) === null || _d$documentType0 === void 0 ? void 0 : _d$documentType0.includes("OTHERDOCUMENTS");
69278
69773
  });
69279
69774
  const docWithValidity = docs.find(d => {
69280
69775
  var _d$additionalDetails, _d$additionalDetails2;
@@ -69298,11 +69793,11 @@ const OLDApplication = () => {
69298
69793
  };
69299
69794
  }
69300
69795
  const djbDoc = (data === null || data === void 0 ? void 0 : (_data$djbEmployee = data.djbEmployee) === null || _data$djbEmployee === void 0 ? void 0 : (_data$djbEmployee$doc = _data$djbEmployee.document) === null || _data$djbEmployee$doc === void 0 ? void 0 : _data$djbEmployee$doc.fileStoreId) || typeof (data === null || data === void 0 ? void 0 : (_data$djbEmployee2 = data.djbEmployee) === null || _data$djbEmployee2 === void 0 ? void 0 : _data$djbEmployee2.document) === "string" && (data === null || data === void 0 ? void 0 : (_data$djbEmployee3 = data.djbEmployee) === null || _data$djbEmployee3 === void 0 ? void 0 : _data$djbEmployee3.document.trim()) || (data === null || data === void 0 ? void 0 : (_data$djbEmployee4 = data.djbEmployee) === null || _data$djbEmployee4 === void 0 ? void 0 : _data$djbEmployee4.document) || (data === null || data === void 0 ? void 0 : (_data$DocumentsRequir2 = data.DocumentsRequired) === null || _data$DocumentsRequir2 === void 0 ? void 0 : (_data$DocumentsRequir3 = _data$DocumentsRequir2.documents) === null || _data$DocumentsRequir3 === void 0 ? void 0 : (_data$DocumentsRequir4 = _data$DocumentsRequir3.find(d => {
69796
+ var _d$documentType1;
69797
+ return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType1 = d.documentType) === null || _d$documentType1 === void 0 ? void 0 : _d$documentType1.includes("DJB_EMPLOYEE_ID"));
69798
+ })) === null || _data$DocumentsRequir4 === void 0 ? void 0 : _data$DocumentsRequir4.fileStoreId) || (data === null || data === void 0 ? void 0 : (_data$documents = data.documents) === null || _data$documents === void 0 ? void 0 : (_data$documents$docum = _data$documents.documents) === null || _data$documents$docum === void 0 ? void 0 : (_data$documents$docum2 = _data$documents$docum.find(d => {
69301
69799
  var _d$documentType10;
69302
69800
  return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType10 = d.documentType) === null || _d$documentType10 === void 0 ? void 0 : _d$documentType10.includes("DJB_EMPLOYEE_ID"));
69303
- })) === null || _data$DocumentsRequir4 === void 0 ? void 0 : _data$DocumentsRequir4.fileStoreId) || (data === null || data === void 0 ? void 0 : (_data$documents = data.documents) === null || _data$documents === void 0 ? void 0 : (_data$documents$docum = _data$documents.documents) === null || _data$documents$docum === void 0 ? void 0 : (_data$documents$docum2 = _data$documents$docum.find(d => {
69304
- var _d$documentType11;
69305
- return (d === null || d === void 0 ? void 0 : d.documentType) === "OWNER.DJB_EMPLOYEE_ID" || (d === null || d === void 0 ? void 0 : (_d$documentType11 = d.documentType) === null || _d$documentType11 === void 0 ? void 0 : _d$documentType11.includes("DJB_EMPLOYEE_ID"));
69306
69801
  })) === null || _data$documents$docum2 === void 0 ? void 0 : _data$documents$docum2.fileStoreId);
69307
69802
  if (djbDoc) {
69308
69803
  if (!data.djbEmployee) data.djbEmployee = {};
@@ -69335,13 +69830,6 @@ const OLDApplication = () => {
69335
69830
  var _data$declarationData, _data$declarationData2, _data$declarationData3, _data$declarationData4, _data$declarationData5, _data$declarationData6, _data$declarationData7, _data$declarationData8, _data$declarationData9, _data$declarationData0, _data$declarationData1, _data$declarationData10, _data$declarationData11, _data$declarationData12, _data$declarationData13, _data$declarationData14, _data$declarationData15;
69336
69831
  const declarations = (_data$declarationData = data.declarationData) !== null && _data$declarationData !== void 0 && _data$declarationData.agree ? true : false;
69337
69832
  const sigFsId = ((_data$declarationData2 = data.declarationData) === null || _data$declarationData2 === void 0 ? void 0 : _data$declarationData2.signatureFileStoreId) || ((_data$declarationData3 = data.declarationData) === null || _data$declarationData3 === void 0 ? void 0 : (_data$declarationData4 = _data$declarationData3.signatureFile) === null || _data$declarationData4 === void 0 ? void 0 : _data$declarationData4.fileStoreId) || (typeof ((_data$declarationData5 = data.declarationData) === null || _data$declarationData5 === void 0 ? void 0 : _data$declarationData5.signatureFile) === "string" ? (_data$declarationData6 = data.declarationData) === null || _data$declarationData6 === void 0 ? void 0 : _data$declarationData6.signatureFile : null) || ((_data$declarationData7 = data.declarationData) === null || _data$declarationData7 === void 0 ? void 0 : _data$declarationData7.signature) || null;
69338
- if (!sigFsId) {
69339
- setShowToast({
69340
- key: "error",
69341
- message: t("ERR_SIGNATURE_MANDATORY") || "Signature is mandatory to submit application"
69342
- });
69343
- return Promise.resolve();
69344
- }
69345
69833
  const sigFileName = ((_data$declarationData8 = data.declarationData) === null || _data$declarationData8 === void 0 ? void 0 : _data$declarationData8.signatureFileName) || ((_data$declarationData9 = data.declarationData) === null || _data$declarationData9 === void 0 ? void 0 : (_data$declarationData0 = _data$declarationData9.signatureFile) === null || _data$declarationData0 === void 0 ? void 0 : _data$declarationData0.name) || ((_data$declarationData1 = data.declarationData) === null || _data$declarationData1 === void 0 ? void 0 : (_data$declarationData10 = _data$declarationData1.signatureFile) === null || _data$declarationData10 === void 0 ? void 0 : _data$declarationData10.fileName) || "signature.png";
69346
69834
  data.declaration = {
69347
69835
  ...data.declarationData,