@djb25/digit-ui-module-ws 1.0.88 → 1.0.90

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.
package/dist/index.js CHANGED
@@ -8275,8 +8275,8 @@ const WSMyApplications = () => {
8275
8275
  };
8276
8276
  });
8277
8277
  const sortedApplications = ((_applicationsList = applicationsList) === null || _applicationsList === void 0 ? void 0 : _applicationsList.length) > 0 ? applicationsList.sort((a, b) => {
8278
- var _b$auditDetails, _a$auditDetails;
8279
- return ((_b$auditDetails = b.auditDetails) === null || _b$auditDetails === void 0 ? void 0 : _b$auditDetails.lastModifiedTime) - ((_a$auditDetails = a.auditDetails) === null || _a$auditDetails === void 0 ? void 0 : _a$auditDetails.lastModifiedTime);
8278
+ var _b$auditDetails, _b$auditDetails2, _a$auditDetails, _a$auditDetails2;
8279
+ return (((_b$auditDetails = b.auditDetails) === null || _b$auditDetails === void 0 ? void 0 : _b$auditDetails.createdTime) || ((_b$auditDetails2 = b.auditDetails) === null || _b$auditDetails2 === void 0 ? void 0 : _b$auditDetails2.lastModifiedTime) || 0) - (((_a$auditDetails = a.auditDetails) === null || _a$auditDetails === void 0 ? void 0 : _a$auditDetails.createdTime) || ((_a$auditDetails2 = a.auditDetails) === null || _a$auditDetails2 === void 0 ? void 0 : _a$auditDetails2.lastModifiedTime) || 0);
8280
8280
  }) : [];
8281
8281
  let filteredApplications = sortedApplications;
8282
8282
  if (searchParams) {
@@ -10792,6 +10792,353 @@ const WSCalculation = _ref => {
10792
10792
  })));
10793
10793
  };
10794
10794
 
10795
+ const WSZROVerification = () => {
10796
+ const {
10797
+ t
10798
+ } = reactI18next.useTranslation();
10799
+ const tenantId = Digit.ULBService.getCurrentTenantId();
10800
+ const {
10801
+ isLoading,
10802
+ data
10803
+ } = Digit.Hooks.ws.useWSZROVerification({
10804
+ tenantId,
10805
+ filters: {
10806
+ status: "PENDING",
10807
+ offset: 0,
10808
+ limit: 20
10809
+ },
10810
+ config: {
10811
+ select: res => (res === null || res === void 0 ? void 0 : res.cases) || []
10812
+ }
10813
+ });
10814
+ const columns = React__default.useMemo(() => [{
10815
+ Header: t("WS_CONNECTION_NO_LABEL"),
10816
+ accessor: "connectionNo",
10817
+ Cell: _ref => {
10818
+ var _row$original, _row$original2;
10819
+ let {
10820
+ row
10821
+ } = _ref;
10822
+ return /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
10823
+ to: {
10824
+ pathname: `/digit-ui/employee/ws/zro-verification-details`,
10825
+ search: `?connectionNumber=${(_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.connectionNo}&tenantId=${tenantId}`,
10826
+ state: {
10827
+ caseData: row.original
10828
+ }
10829
+ },
10830
+ style: {
10831
+ color: "#f47738",
10832
+ textDecoration: "none"
10833
+ }
10834
+ }, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.connectionNo) || "NA");
10835
+ }
10836
+ }, {
10837
+ Header: t("WS_BILLING_PERIOD_LABEL"),
10838
+ Cell: _ref2 => {
10839
+ var _row$original3, _row$original4;
10840
+ let {
10841
+ row
10842
+ } = _ref2;
10843
+ const from = (_row$original3 = row.original) !== null && _row$original3 !== void 0 && _row$original3.billingPeriodFrom ? Digit.DateUtils.ConvertTimestampToDate(row.original.billingPeriodFrom) : "NA";
10844
+ const to = (_row$original4 = row.original) !== null && _row$original4 !== void 0 && _row$original4.billingPeriodTo ? Digit.DateUtils.ConvertTimestampToDate(row.original.billingPeriodTo) : "NA";
10845
+ return /*#__PURE__*/React__default.createElement("span", null, `${from} - ${to}`);
10846
+ }
10847
+ }, {
10848
+ Header: t("WS_PREVIOUS_READING_LABEL"),
10849
+ accessor: "previousReading",
10850
+ Cell: _ref3 => {
10851
+ var _row$original5;
10852
+ let {
10853
+ row
10854
+ } = _ref3;
10855
+ return ((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.previousReading) ?? "NA";
10856
+ }
10857
+ }, {
10858
+ Header: t("WS_CURRENT_READING_LABEL"),
10859
+ accessor: "currentReading",
10860
+ Cell: _ref4 => {
10861
+ var _row$original6;
10862
+ let {
10863
+ row
10864
+ } = _ref4;
10865
+ return ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.currentReading) ?? "NA";
10866
+ }
10867
+ }, {
10868
+ Header: t("WS_CONSUMPTION_LABEL"),
10869
+ accessor: "actualConsumption",
10870
+ Cell: _ref5 => {
10871
+ var _row$original7;
10872
+ let {
10873
+ row
10874
+ } = _ref5;
10875
+ return ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.actualConsumption) ?? "NA";
10876
+ }
10877
+ }, {
10878
+ Header: t("WS_COMMON_TABLE_COL_APP_STATUS_LABEL"),
10879
+ accessor: "verification.status",
10880
+ Cell: _ref6 => {
10881
+ var _row$original8, _row$original8$verifi;
10882
+ let {
10883
+ row
10884
+ } = _ref6;
10885
+ return (_row$original8 = row.original) !== null && _row$original8 !== void 0 && (_row$original8$verifi = _row$original8.verification) !== null && _row$original8$verifi !== void 0 && _row$original8$verifi.status ? t(`WS_ZRO_STATUS_${row.original.verification.status}`) : "NA";
10886
+ }
10887
+ }], [t]);
10888
+ if (isLoading) {
10889
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
10890
+ }
10891
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
10892
+ t: t,
10893
+ data: data || [],
10894
+ totalRecords: (data === null || data === void 0 ? void 0 : data.length) || 0,
10895
+ isLoading: isLoading,
10896
+ isPaginationRequired: true,
10897
+ csvExportData: data,
10898
+ columns: columns
10899
+ }));
10900
+ };
10901
+
10902
+ const Heading = props => {
10903
+ return /*#__PURE__*/React__default.createElement("h1", {
10904
+ className: "heading-m"
10905
+ }, props.label);
10906
+ };
10907
+ const Close = () => /*#__PURE__*/React__default.createElement("svg", {
10908
+ xmlns: "http://www.w3.org/2000/svg",
10909
+ viewBox: "0 0 24 24",
10910
+ fill: "#FFFFFF"
10911
+ }, /*#__PURE__*/React__default.createElement("path", {
10912
+ d: "M0 0h24v24H0V0z",
10913
+ fill: "none"
10914
+ }), /*#__PURE__*/React__default.createElement("path", {
10915
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
10916
+ }));
10917
+ const CloseBtn = props => {
10918
+ return /*#__PURE__*/React__default.createElement("div", {
10919
+ className: "icon-bg-secondary",
10920
+ onClick: props.onClick
10921
+ }, /*#__PURE__*/React__default.createElement(Close, null));
10922
+ };
10923
+ const WSZROVerificationDetails = () => {
10924
+ var _location$state;
10925
+ const {
10926
+ t
10927
+ } = reactI18next.useTranslation();
10928
+ const location = reactRouterDom.useLocation();
10929
+ const history = reactRouterDom.useHistory();
10930
+ const [displayMenu, setDisplayMenu] = React.useState(false);
10931
+ const [showModal, setShowModal] = React.useState(false);
10932
+ const [selectedAction, setSelectedAction] = React.useState(null);
10933
+ const [comments, setComments] = React.useState("");
10934
+ const [toast, setToast] = React.useState(null);
10935
+ const [isSuccess, setIsSuccess] = React.useState(false);
10936
+ const [apiResponse, setApiResponse] = React.useState(null);
10937
+ React.useEffect(() => {
10938
+ let timer;
10939
+ if (isSuccess) {
10940
+ timer = setTimeout(() => {
10941
+ history.push("/digit-ui/employee/ws/zro-application");
10942
+ }, 10000);
10943
+ }
10944
+ return () => {
10945
+ if (timer) clearTimeout(timer);
10946
+ };
10947
+ }, [isSuccess, history]);
10948
+ const caseDataFromState = (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.caseData;
10949
+ const searchParams = new URLSearchParams(location.search);
10950
+ const connectionNumber = searchParams.get("connectionNumber");
10951
+ const tenantId = searchParams.get("tenantId") || Digit.ULBService.getCurrentTenantId();
10952
+ const {
10953
+ isLoading,
10954
+ data
10955
+ } = Digit.Hooks.ws.useWSZROVerification({
10956
+ tenantId,
10957
+ filters: {
10958
+ connectionNo: connectionNumber,
10959
+ status: "PENDING",
10960
+ offset: 0,
10961
+ limit: 20
10962
+ },
10963
+ config: {
10964
+ enabled: !caseDataFromState && !!connectionNumber,
10965
+ select: res => {
10966
+ var _res$cases;
10967
+ return res === null || res === void 0 ? void 0 : (_res$cases = res.cases) === null || _res$cases === void 0 ? void 0 : _res$cases[0];
10968
+ }
10969
+ }
10970
+ });
10971
+ const caseDetails = caseDataFromState || data;
10972
+ if (isLoading) {
10973
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
10974
+ }
10975
+ if (!caseDetails) {
10976
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("div", {
10977
+ style: {
10978
+ textAlign: "center"
10979
+ }
10980
+ }, t("CS_COMMON_NO_DATA")));
10981
+ }
10982
+ const {
10983
+ verification,
10984
+ ...billingData
10985
+ } = caseDetails;
10986
+ const formatDate = timestamp => {
10987
+ if (!timestamp) return "NA";
10988
+ return Digit.DateUtils.ConvertTimestampToDate(timestamp);
10989
+ };
10990
+ const onActionSelect = action => {
10991
+ setSelectedAction(action);
10992
+ setDisplayMenu(false);
10993
+ setShowModal(true);
10994
+ };
10995
+ const closeModal = () => {
10996
+ setShowModal(false);
10997
+ setComments("");
10998
+ setSelectedAction(null);
10999
+ };
11000
+ const submitAction = function () {
11001
+ try {
11002
+ const _temp = _catch(function () {
11003
+ const payload = {
11004
+ billingCycleId: billingData === null || billingData === void 0 ? void 0 : billingData.billingCycleId,
11005
+ action: selectedAction === "VERIFY" ? "APPROVE" : "REJECT",
11006
+ remarks: comments
11007
+ };
11008
+ return Promise.resolve(Digit.WSService.updateZROVerification(payload, tenantId)).then(function (res) {
11009
+ setApiResponse(res);
11010
+ setToast({
11011
+ key: "success",
11012
+ error: false,
11013
+ message: t("WF_ZRO_ACTION_SUCCESS")
11014
+ });
11015
+ setShowModal(false);
11016
+ setIsSuccess(true);
11017
+ });
11018
+ }, function (err) {
11019
+ var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
11020
+ console.error(err);
11021
+ setToast({
11022
+ key: "error",
11023
+ error: true,
11024
+ message: (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : (_err$response$data$Er = _err$response$data.Errors) === null || _err$response$data$Er === void 0 ? void 0 : (_err$response$data$Er2 = _err$response$data$Er[0]) === null || _err$response$data$Er2 === void 0 ? void 0 : _err$response$data$Er2.message) || t("CS_ACTION_ERROR")
11025
+ });
11026
+ closeModal();
11027
+ });
11028
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
11029
+ } catch (e) {
11030
+ return Promise.reject(e);
11031
+ }
11032
+ };
11033
+ if (isSuccess) {
11034
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Banner, {
11035
+ message: t(selectedAction === "VERIFY" ? "WF_ZRO_VERIFY_SUCCESS" : "WF_ZRO_REJECT_SUCCESS"),
11036
+ applicationNumber: apiResponse !== null && apiResponse !== void 0 && apiResponse.connectionno ? apiResponse.connectionno : connectionNumber,
11037
+ info: apiResponse !== null && apiResponse !== void 0 && apiResponse.connectionno ? t("WS_CONNECTION_NO_LABEL") : t("WS_CONNECTION_NO_LABEL"),
11038
+ successful: selectedAction === "VERIFY"
11039
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardText, null, apiResponse !== null && apiResponse !== void 0 && apiResponse.message ? apiResponse.message : t("WF_ZRO_SUCCESS_MESSAGE_MAIN")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
11040
+ label: t("CORE_COMMON_GO_TO_HOME"),
11041
+ onSubmit: () => history.push("/digit-ui/employee/ws/zro-application")
11042
+ })));
11043
+ }
11044
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSubHeader, null, t("WS_VERIFICATION_DETAILS")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11045
+ label: t("WS_CONNECTION_NO_LABEL"),
11046
+ text: (verification === null || verification === void 0 ? void 0 : verification.connectionno) || "NA"
11047
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11048
+ label: t("WS_VERIFICATION_STATUS"),
11049
+ text: (verification === null || verification === void 0 ? void 0 : verification.status) || "NA"
11050
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11051
+ label: t("WS_CONSUMPTION_LABEL"),
11052
+ text: (verification === null || verification === void 0 ? void 0 : verification.consumption) ?? "NA"
11053
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11054
+ label: t("WS_PREVIOUS_CONSUMPTION"),
11055
+ text: (verification === null || verification === void 0 ? void 0 : verification.previousconsumption) ?? "NA"
11056
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11057
+ label: t("WS_DEVIATION_FACTOR"),
11058
+ text: verification !== null && verification !== void 0 && verification.deviationfactor ? Number(verification.deviationfactor).toFixed(2) : "NA"
11059
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11060
+ label: t("WS_REMARKS"),
11061
+ text: (verification === null || verification === void 0 ? void 0 : verification.remarks) || "NA"
11062
+ })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSubHeader, {
11063
+ style: {
11064
+ marginTop: "32px"
11065
+ }
11066
+ }, t("WS_BILLING_AND_CONSUMPTION_DETAILS")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11067
+ label: t("WS_BILLING_CYCLE_ID"),
11068
+ text: billingData.billingCycleId || "NA"
11069
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11070
+ label: t("WS_BILLING_PERIOD"),
11071
+ text: `${formatDate(billingData.billingPeriodFrom)} - ${formatDate(billingData.billingPeriodTo)}`
11072
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11073
+ label: t("WS_BILLING_DAYS"),
11074
+ text: billingData.billingDays ?? "NA"
11075
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11076
+ label: t("WS_PREVIOUS_READING_LABEL"),
11077
+ text: billingData.previousReading ?? "NA"
11078
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11079
+ label: t("WS_PREVIOUS_OK_READING_DATE"),
11080
+ text: formatDate(billingData.previousOkReadingDate)
11081
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11082
+ label: t("WS_CURRENT_READING_LABEL"),
11083
+ text: billingData.currentReading ?? "NA"
11084
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11085
+ label: t("WS_READING_QUALITY_CODE"),
11086
+ text: billingData.readingQualityCode || "NA"
11087
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11088
+ label: t("WS_BILLING_BASIS"),
11089
+ text: billingData.billingBasis || "NA"
11090
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11091
+ label: t("WS_ACTUAL_CONSUMPTION"),
11092
+ text: billingData.actualConsumption ?? "NA"
11093
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11094
+ label: t("WS_MONTHLY_CONSUMPTION"),
11095
+ text: billingData.monthlyConsumption ? Number(billingData.monthlyConsumption).toFixed(2) : "NA"
11096
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11097
+ label: t("WS_THRESHOLD_CONSUMPTION"),
11098
+ text: billingData.thresholdConsumption ? Number(billingData.thresholdConsumption).toFixed(2) : "NA"
11099
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11100
+ label: t("WS_1_5X_FLAG"),
11101
+ text: billingData.onePointFiveXFlag ? t("CORE_COMMON_YES") : t("CORE_COMMON_NO")
11102
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11103
+ label: t("WS_BILLING_CYCLE_STATUS"),
11104
+ text: billingData.billingCycleStatus || "NA"
11105
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
11106
+ label: t("WS_CORRECTION_STATUS"),
11107
+ text: billingData.correctionStatus || "NA"
11108
+ }))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, displayMenu ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Menu, {
11109
+ localeKeyPrefix: "WF_ZRO",
11110
+ options: ["VERIFY", "REJECT"],
11111
+ t: t,
11112
+ onSelect: onActionSelect
11113
+ }) : null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
11114
+ label: t("WF_TAKE_ACTION"),
11115
+ onSubmit: () => setDisplayMenu(!displayMenu)
11116
+ })), showModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
11117
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading, {
11118
+ label: selectedAction === "VERIFY" ? t("WF_ZRO_VERIFY") : t("WF_ZRO_REJECT")
11119
+ }),
11120
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn, {
11121
+ onClick: closeModal
11122
+ }),
11123
+ actionCancelLabel: t("CS_COMMON_CANCEL"),
11124
+ actionCancelOnSubmit: closeModal,
11125
+ actionSaveLabel: selectedAction === "VERIFY" ? t("WF_ZRO_VERIFY") : t("WF_ZRO_REJECT"),
11126
+ actionSaveOnSubmit: submitAction
11127
+ }, /*#__PURE__*/React__default.createElement("div", {
11128
+ style: {
11129
+ marginBottom: "16px"
11130
+ }
11131
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WF_COMMON_COMMENTS")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextArea, {
11132
+ name: "comments",
11133
+ value: comments,
11134
+ onChange: e => setComments(e.target.value)
11135
+ }))), toast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
11136
+ error: toast.error,
11137
+ label: toast.message,
11138
+ onClose: () => setToast(null)
11139
+ }));
11140
+ };
11141
+
10795
11142
  const BILLSBreadCrumbs = _ref => {
10796
11143
  var _applicationDetails$a, _applicationDetails$a9, _applicationDetails$a0, _applicationDetails$a1, _applicationDetails$a13, _applicationDetails$a14, _reciept_data$Payment2;
10797
11144
  const getRecieptSearch = function (tenantId, payments, consumerCodes, receiptKey) {
@@ -11241,6 +11588,10 @@ const BILLSBreadCrumbs = _ref => {
11241
11588
  path: "/digit-ui/employee/ws/water/calculation",
11242
11589
  label: t("WS_CALCULATION"),
11243
11590
  show: location.pathname.includes("/ws/water/calculation") ? true : false
11591
+ }, {
11592
+ path: "/digit-ui/employee/ws/zro-application",
11593
+ label: t("WS_ZRO_VERIFICATION"),
11594
+ show: location.pathname.includes("/ws/zro-application") ? true : false
11244
11595
  }];
11245
11596
  let lastCrumbIndex = findLastIndex(crumbs, "show", true);
11246
11597
  crumbs[lastCrumbIndex] = {
@@ -11580,6 +11931,12 @@ const App$1 = _ref2 => {
11580
11931
  component: props => /*#__PURE__*/React__default.createElement(WSCalculation, _extends({}, props, {
11581
11932
  parentRoute: path
11582
11933
  }))
11934
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
11935
+ path: `${path}/zro-application`,
11936
+ component: () => /*#__PURE__*/React__default.createElement(WSZROVerification, null)
11937
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
11938
+ path: `${path}/zro-verification-details`,
11939
+ component: () => /*#__PURE__*/React__default.createElement(WSZROVerificationDetails, null)
11583
11940
  }))))));
11584
11941
  };
11585
11942
 
@@ -17672,7 +18029,7 @@ ButtonSelector.defaultProps = {
17672
18029
  onSubmit: undefined
17673
18030
  };
17674
18031
 
17675
- const Close = _ref23 => {
18032
+ const Close$1 = _ref23 => {
17676
18033
  let {
17677
18034
  className,
17678
18035
  style
@@ -17708,7 +18065,7 @@ const RemoveableTag = _ref => {
17708
18065
  style: extraStyles ? extraStyles === null || extraStyles === void 0 ? void 0 : extraStyles.textStyles : {}
17709
18066
  }, text), /*#__PURE__*/React__default.createElement("span", {
17710
18067
  onClick: disabled ? null : onClick
17711
- }, /*#__PURE__*/React__default.createElement(Close, {
18068
+ }, /*#__PURE__*/React__default.createElement(Close$1, {
17712
18069
  className: "close",
17713
18070
  style: extraStyles ? extraStyles === null || extraStyles === void 0 ? void 0 : extraStyles.closeIconStyles : {}
17714
18071
  })));
@@ -27490,7 +27847,11 @@ const WSCard = () => {
27490
27847
  label: t("WS_APPLY_MUTATION"),
27491
27848
  link: `/digit-ui/employee/ws/mutation-application`,
27492
27849
  roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK", "SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER", "SW_CLERK"]
27493
- }]
27850
+ }, {
27851
+ label: t("WS_ZRO_VERIFICATION"),
27852
+ link: `/digit-ui/employee/ws/zro-application`,
27853
+ roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK", "SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER", "SW_CLERK"]
27854
+ }].filter(link => link.roles ? checkForEmployee(link.roles) : true)
27494
27855
  };
27495
27856
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard);
27496
27857
  };
@@ -37742,6 +38103,15 @@ const WSInfoPage = () => {
37742
38103
  const [isOtpSending, setIsOtpSending] = React.useState(false);
37743
38104
  const [isOtpVerifying, setIsOtpVerifying] = React.useState(false);
37744
38105
  const [showToast, setShowToast] = React.useState(null);
38106
+ const [isMobileVerified, setIsMobileVerified] = React.useState(false);
38107
+ const [timeLeft, setTimeLeft] = React.useState(0);
38108
+ React.useEffect(() => {
38109
+ let timer;
38110
+ if (timeLeft > 0) {
38111
+ timer = setTimeout(() => setTimeLeft(timeLeft - 1), 1000);
38112
+ }
38113
+ return () => clearTimeout(timer);
38114
+ }, [timeLeft]);
37745
38115
  React.useEffect(() => {
37746
38116
  sessionStorage.removeItem("WS_OTP_VERIFIED_PROPERTY_ID");
37747
38117
  }, []);
@@ -37760,7 +38130,7 @@ const WSInfoPage = () => {
37760
38130
  mobileNumber: mobileNumberToSearch
37761
38131
  },
37762
38132
  tenantId: tenantId,
37763
- enabled: (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && (mobileNumberToSearch === null || mobileNumberToSearch === void 0 ? void 0 : mobileNumberToSearch.length) === 10 ? true : false
38133
+ enabled: (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && (mobileNumberToSearch === null || mobileNumberToSearch === void 0 ? void 0 : mobileNumberToSearch.length) === 10 && isMobileVerified ? true : false
37764
38134
  });
37765
38135
  const radioOptions = [{
37766
38136
  code: "YES",
@@ -37811,7 +38181,7 @@ const WSInfoPage = () => {
37811
38181
  setIsOtpSending(false);
37812
38182
  setShowToast({
37813
38183
  key: "error",
37814
- message: (errObj === null || errObj === void 0 ? void 0 : (_errObj$fields = errObj.fields) === null || _errObj$fields === void 0 ? void 0 : (_errObj$fields$ = _errObj$fields[0]) === null || _errObj$fields$ === void 0 ? void 0 : _errObj$fields$.message) || (errObj === null || errObj === void 0 ? void 0 : errObj.message) || "Failed to send OTP"
38184
+ message: (errObj === null || errObj === void 0 ? void 0 : (_errObj$fields = errObj.fields) === null || _errObj$fields === void 0 ? void 0 : (_errObj$fields$ = _errObj$fields[0]) === null || _errObj$fields$ === void 0 ? void 0 : _errObj$fields$.message) || (errObj === null || errObj === void 0 ? void 0 : errObj.message) || t("WS_FAILED_TO_SEND_OTP") || "Failed to send OTP"
37815
38185
  });
37816
38186
  return;
37817
38187
  }
@@ -37821,21 +38191,22 @@ const WSInfoPage = () => {
37821
38191
  setIsOtpSending(false);
37822
38192
  setShowToast({
37823
38193
  key: "error",
37824
- message: (errObj === null || errObj === void 0 ? void 0 : (_errObj$ = errObj[0]) === null || _errObj$ === void 0 ? void 0 : _errObj$.message) || "Failed to send OTP"
38194
+ message: (errObj === null || errObj === void 0 ? void 0 : (_errObj$ = errObj[0]) === null || _errObj$ === void 0 ? void 0 : _errObj$.message) || t("WS_FAILED_TO_SEND_OTP") || "Failed to send OTP"
37825
38195
  });
37826
38196
  return;
37827
38197
  }
37828
38198
  setIsOtpSending(false);
37829
38199
  setShowOtpVerification(true);
38200
+ setTimeLeft(30);
37830
38201
  setShowToast({
37831
38202
  key: "success",
37832
- message: "OTP sent successfully!"
38203
+ message: t("PT_SEC_OTP_SENT_SUCEESS") || "OTP sent successfully!"
37833
38204
  });
37834
38205
  });
37835
38206
  }, function (err) {
37836
38207
  var _err$response, _err$response$data, _err$response2, _err$response2$data;
37837
38208
  setIsOtpSending(false);
37838
- let errMsg = "Failed to send OTP";
38209
+ let errMsg = t("WS_FAILED_TO_SEND_OTP") || "Failed to send OTP";
37839
38210
  if (err !== null && err !== void 0 && (_err$response = err.response) !== null && _err$response !== void 0 && (_err$response$data = _err$response.data) !== null && _err$response$data !== void 0 && _err$response$data.error) {
37840
38211
  var _err$response$data$er, _err$response$data$er2, _err$response$data$er3, _err$response$data$er4;
37841
38212
  errMsg = ((_err$response$data$er = err.response.data.error) === null || _err$response$data$er === void 0 ? void 0 : (_err$response$data$er2 = _err$response$data$er.fields) === null || _err$response$data$er2 === void 0 ? void 0 : (_err$response$data$er3 = _err$response$data$er2[0]) === null || _err$response$data$er3 === void 0 ? void 0 : _err$response$data$er3.message) || ((_err$response$data$er4 = err.response.data.error) === null || _err$response$data$er4 === void 0 ? void 0 : _err$response$data$er4.message) || errMsg;
@@ -37863,7 +38234,7 @@ const WSInfoPage = () => {
37863
38234
  if (!otp || otp.length < 6) {
37864
38235
  setShowToast({
37865
38236
  key: "warning",
37866
- message: "Please enter a valid 6-digit OTP"
38237
+ message: t("WS_PLEASE_ENTER_VALID_OTP") || "Please enter a valid 6-digit OTP"
37867
38238
  });
37868
38239
  return Promise.resolve();
37869
38240
  }
@@ -37894,14 +38265,15 @@ const WSInfoPage = () => {
37894
38265
  setIsOtpVerifying(false);
37895
38266
  setShowToast({
37896
38267
  key: "success",
37897
- message: "OTP verified successfully!"
38268
+ message: t("WS_OTP_VERIFIED_SUCCESSFULLY") || "OTP verified successfully!"
37898
38269
  });
37899
- proceedToNext();
38270
+ setShowOtpVerification(false);
38271
+ setIsMobileVerified(true);
37900
38272
  });
37901
38273
  }, function (err) {
37902
38274
  var _err$response3, _err$response3$data, _err$response4, _err$response4$data;
37903
38275
  setIsOtpVerifying(false);
37904
- let errMsg = err.message || "Failed to verify OTP";
38276
+ let errMsg = err.message || t("WS_FAILED_TO_VERIFY_OTP") || "Failed to verify OTP";
37905
38277
  if (err !== null && err !== void 0 && (_err$response3 = err.response) !== null && _err$response3 !== void 0 && (_err$response3$data = _err$response3.data) !== null && _err$response3$data !== void 0 && _err$response3$data.error) {
37906
38278
  var _err$response$data$er5, _err$response$data$er6, _err$response$data$er7, _err$response$data$er8;
37907
38279
  errMsg = ((_err$response$data$er5 = err.response.data.error) === null || _err$response$data$er5 === void 0 ? void 0 : (_err$response$data$er6 = _err$response$data$er5.fields) === null || _err$response$data$er6 === void 0 ? void 0 : (_err$response$data$er7 = _err$response$data$er6[0]) === null || _err$response$data$er7 === void 0 ? void 0 : _err$response$data$er7.message) || ((_err$response$data$er8 = err.response.data.error) === null || _err$response$data$er8 === void 0 ? void 0 : _err$response$data$er8.message) || errMsg;
@@ -37926,7 +38298,14 @@ const WSInfoPage = () => {
37926
38298
  if (e.stopPropagation) e.stopPropagation();
37927
38299
  }
37928
38300
  if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && selectedProperty) {
37929
- handleSendOtp(e);
38301
+ if (!isMobileVerified) {
38302
+ setShowToast({
38303
+ key: "warning",
38304
+ message: t("WS_PLEASE_VERIFY_MOBILE_NUMBER") || "Please verify mobile number first"
38305
+ });
38306
+ return;
38307
+ }
38308
+ proceedToNext();
37930
38309
  } else if ((hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && !selectedProperty) {
37931
38310
  return;
37932
38311
  } else {
@@ -37941,72 +38320,6 @@ const WSInfoPage = () => {
37941
38320
  ...prop,
37942
38321
  displayName: `${prop.propertyId} - ${getAddress$1(prop.address, t)}`
37943
38322
  }))) || [];
37944
- if (showOtpVerification) {
37945
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("form", {
37946
- onSubmit: handleVerifyOtp
37947
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardHeader, null, t("WS_VERIFY_OTP_HEADER") || "Verify OTP"), /*#__PURE__*/React__default.createElement("div", {
37948
- style: {
37949
- marginBottom: "24px"
37950
- }
37951
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Label, null, t("WS_ENTER_OTP_SENT_TO") || "Enter OTP sent to", " +91 ", getMaskedPhone(mobileNumberToSearch), " *"), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
37952
- t: t,
37953
- type: "text",
37954
- inputMode: "numeric",
37955
- pattern: "[0-9]*",
37956
- isMandatory: false,
37957
- value: otp,
37958
- maxLength: 6,
37959
- onChange: e => setOtp(e.target.value.replace(/\D/g, "").slice(0, 6)),
37960
- onKeyDown: e => {
37961
- if (["-", "+", "e", "E", "."].includes(e.key)) e.preventDefault();
37962
- },
37963
- placeholder: t("WS_ENTER_6_DIGIT_OTP") || "Enter 6-digit OTP",
37964
- style: {
37965
- width: "100%",
37966
- maxWidth: "300px"
37967
- }
37968
- })), /*#__PURE__*/React__default.createElement("div", {
37969
- style: {
37970
- display: "flex",
37971
- gap: "16px",
37972
- marginBottom: "24px"
37973
- }
37974
- }, /*#__PURE__*/React__default.createElement("button", {
37975
- type: "button",
37976
- onClick: handleSendOtp,
37977
- disabled: isOtpSending,
37978
- style: {
37979
- color: "#f47738",
37980
- background: "none",
37981
- border: "none",
37982
- cursor: "pointer",
37983
- fontWeight: "bold",
37984
- textDecoration: "underline"
37985
- }
37986
- }, isOtpSending ? t("WS_SENDING_OTP") || "Sending..." : t("WS_RESEND_OTP") || "Resend OTP"), /*#__PURE__*/React__default.createElement("button", {
37987
- type: "button",
37988
- onClick: () => setShowOtpVerification(false),
37989
- style: {
37990
- color: "#f47738",
37991
- background: "none",
37992
- border: "none",
37993
- cursor: "pointer",
37994
- fontWeight: "bold",
37995
- textDecoration: "underline"
37996
- }
37997
- }, t("CS_COMMON_CANCEL") || "Cancel")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
37998
- label: t("WS_VERIFY_OTP_AND_PROCEED") || "Verify & Proceed",
37999
- onSubmit: handleVerifyOtp,
38000
- disabled: otp.length < 6 || isOtpVerifying,
38001
- submit: true
38002
- }))), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
38003
- error: showToast.key === "error",
38004
- warning: showToast.key === "warning",
38005
- label: t(showToast.message),
38006
- onClose: () => setShowToast(null),
38007
- isDleteBtn: true
38008
- }));
38009
- }
38010
38323
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardHeader, null, t("WS_COMMON_APPL_NEW_CONNECTION")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CitizenInfoLabel, {
38011
38324
  style: {
38012
38325
  margin: "0px",
@@ -38038,30 +38351,7 @@ const WSInfoPage = () => {
38038
38351
  display: "flex",
38039
38352
  gap: "24px"
38040
38353
  }
38041
- })), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && /*#__PURE__*/React__default.createElement("div", {
38042
- style: {
38043
- marginBottom: "24px"
38044
- }
38045
- }, !isEmployee && /*#__PURE__*/React__default.createElement("div", {
38046
- style: {
38047
- marginBottom: "16px"
38048
- }
38049
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Label, null, t("CORE_COMMON_MOBILE_NUMBER")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
38050
- t: t,
38051
- type: "number",
38052
- isMandatory: false,
38053
- name: "mobileNumber",
38054
- value: searchMobileNumber,
38055
- onChange: e => {
38056
- const val = e.target.value.replace(/\D/g, "").slice(0, 10);
38057
- setSearchMobileNumber(val);
38058
- setSelectedProperty(null);
38059
- setShowOtpVerification(false);
38060
- setOtp("");
38061
- },
38062
- placeholder: t("Enter mobile number"),
38063
- maxLength: 10
38064
- })), isEmployee && /*#__PURE__*/React__default.createElement("div", {
38354
+ })), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
38065
38355
  style: {
38066
38356
  display: "flex",
38067
38357
  flexDirection: "column",
@@ -38070,39 +38360,59 @@ const WSInfoPage = () => {
38070
38360
  }
38071
38361
  }, /*#__PURE__*/React__default.createElement("div", {
38072
38362
  style: {
38073
- display: "flex",
38363
+ display: "grid",
38364
+ gridTemplateColumns: "1fr 1fr",
38074
38365
  gap: "24px",
38075
- alignItems: "flex-end"
38366
+ alignItems: "start"
38367
+ }
38368
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Label, null, t("CORE_COMMON_MOBILE_NUMBER")), /*#__PURE__*/React__default.createElement("div", {
38369
+ style: {
38370
+ display: "flex",
38371
+ gap: "16px",
38372
+ alignItems: "center"
38076
38373
  }
38077
38374
  }, /*#__PURE__*/React__default.createElement("div", {
38078
38375
  style: {
38079
38376
  flex: 1
38080
38377
  }
38081
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Label, null, t("CORE_COMMON_MOBILE_NUMBER")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
38378
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
38082
38379
  t: t,
38083
38380
  type: "number",
38084
38381
  isMandatory: false,
38085
38382
  name: "mobileNumber",
38086
38383
  value: searchMobileNumber,
38087
38384
  onChange: e => {
38088
- const val = e.target.value;
38089
- if (val.length <= 10) {
38090
- setSearchMobileNumber(val);
38091
- setSelectedProperty(null);
38092
- setShowOtpVerification(false);
38093
- setOtp("");
38094
- }
38385
+ const val = e.target.value.replace(/\D/g, "").slice(0, 10);
38386
+ setSearchMobileNumber(val);
38387
+ setSelectedProperty(null);
38388
+ setShowOtpVerification(false);
38389
+ setOtp("");
38390
+ setIsMobileVerified(false);
38095
38391
  },
38096
- placeholder: t("Enter mobile number"),
38097
- maxLength: 10
38098
- })), /*#__PURE__*/React__default.createElement("div", {
38392
+ placeholder: t("WS_ENTER_MOBILE_NUMBER") || "Enter mobile number",
38393
+ maxLength: 10,
38394
+ disabled: isMobileVerified
38395
+ })), (searchMobileNumber === null || searchMobileNumber === void 0 ? void 0 : searchMobileNumber.length) === 10 && !isMobileVerified && !showOtpVerification && /*#__PURE__*/React__default.createElement("button", {
38396
+ type: "button",
38397
+ onClick: handleSendOtp,
38398
+ disabled: isOtpSending,
38099
38399
  style: {
38100
- flex: 1
38400
+ padding: "8px 16px",
38401
+ border: "1px solid #1a67a3",
38402
+ background: "white",
38403
+ color: "#1a67a3",
38404
+ borderRadius: "4px",
38405
+ cursor: "pointer",
38406
+ fontWeight: "bold",
38407
+ whiteSpace: "nowrap"
38408
+ }
38409
+ }, isOtpSending ? t("WS_SENDING_OTP") || "Sending..." : t("PTUPNO_SENDOTP") || "Send OTP"))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Label, null, t("WS_SELECT_EXISTING_PROPERTY")), isLoading ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null) : /*#__PURE__*/React__default.createElement("div", {
38410
+ style: {
38411
+ display: "flex",
38412
+ flexDirection: "column",
38413
+ gap: "8px"
38101
38414
  }
38102
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Label, null, t("WS_SELECT_EXISTING_PROPERTY")), /*#__PURE__*/React__default.createElement("div", {
38103
- className: "field"
38104
38415
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
38105
- className: "form-field",
38106
38416
  option: propertyOptions,
38107
38417
  optionKey: "displayName",
38108
38418
  id: "propertyId",
@@ -38114,51 +38424,125 @@ const WSInfoPage = () => {
38114
38424
  },
38115
38425
  t: t,
38116
38426
  placeholder: t("PT_SELECT_PROPERTY"),
38117
- disable: isLoading || propertyOptions.length === 0
38118
- })))), (searchMobileNumber === null || searchMobileNumber === void 0 ? void 0 : searchMobileNumber.length) === 10 && !isLoading && propertyOptions.length === 0 && /*#__PURE__*/React__default.createElement("div", {
38427
+ disable: !isMobileVerified || propertyOptions.length === 0
38428
+ }), propertyOptions.length > 0 && /*#__PURE__*/React__default.createElement("span", {
38429
+ style: {
38430
+ fontSize: "14px",
38431
+ color: "#505A5F"
38432
+ }
38433
+ }, t("WS_PROPERTY_AUTOFILL_MSG"))))), showOtpVerification && !isMobileVerified && /*#__PURE__*/React__default.createElement("div", {
38434
+ style: {
38435
+ border: "1px solid #d6d5d4",
38436
+ borderRadius: "4px",
38437
+ background: "#f8f9fa",
38438
+ padding: "12px"
38439
+ }
38440
+ }, /*#__PURE__*/React__default.createElement("div", {
38441
+ style: {
38442
+ fontWeight: "bold",
38443
+ fontSize: "18px",
38444
+ marginBottom: "8px"
38445
+ }
38446
+ }, t("WS_VERIFY_OTP_HEADER") || "OTP Verification"), /*#__PURE__*/React__default.createElement("div", {
38447
+ style: {
38448
+ color: "#505A5F",
38449
+ marginBottom: "16px"
38450
+ }
38451
+ }, t("WS_ENTER_OTP_SENT_TO") || "Enter the 6-digit OTP sent to", " ", getMaskedPhone(searchMobileNumber)), /*#__PURE__*/React__default.createElement("div", {
38119
38452
  style: {
38120
38453
  display: "flex",
38121
- flexDirection: "column",
38122
- gap: "16px"
38454
+ flexWrap: "wrap",
38455
+ gap: "15px",
38456
+ alignItems: "center"
38123
38457
  }
38124
- }, /*#__PURE__*/React__default.createElement("span", {
38458
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.OTPInput, {
38125
38459
  style: {
38126
- color: "#d63031",
38460
+ marginBottom: "0px"
38461
+ },
38462
+ length: 6,
38463
+ onChange: setOtp,
38464
+ value: otp
38465
+ }), /*#__PURE__*/React__default.createElement("button", {
38466
+ type: "button",
38467
+ onClick: handleVerifyOtp,
38468
+ disabled: otp.length < 6 || isOtpVerifying,
38469
+ style: {
38470
+ padding: "6px 20px",
38471
+ background: otp.length < 6 || isOtpVerifying ? "#ccc" : "#1a67a3",
38472
+ color: "white",
38473
+ border: "none",
38474
+ borderRadius: "4px",
38475
+ cursor: otp.length < 6 || isOtpVerifying ? "not-allowed" : "pointer",
38127
38476
  fontWeight: "bold"
38128
38477
  }
38129
- }, t("WS_NO_PROPERTY_FOUND_ON_THIS_NUMBER") || "No property found on this number, please create the property first."), /*#__PURE__*/React__default.createElement("span", {
38130
- onClick: handleCreateProperty
38131
- }, /*#__PURE__*/React__default.createElement("button", {
38132
- className: "submit-bar",
38478
+ }, isOtpVerifying ? t("WS_VERIFYING_OTP") || "Verifying..." : t("WS_VERIFY_OTP_AND_PROCEED") || "Verify OTP"), /*#__PURE__*/React__default.createElement("button", {
38133
38479
  type: "button",
38480
+ onClick: handleSendOtp,
38481
+ disabled: timeLeft > 0 || isOtpSending,
38134
38482
  style: {
38135
- color: "white",
38136
- margin: 0
38483
+ padding: "6px 20px",
38484
+ background: "white",
38485
+ color: timeLeft > 0 || isOtpSending ? "#ccc" : "#1a67a3",
38486
+ border: `1px solid ${timeLeft > 0 || isOtpSending ? "#ccc" : "#1a67a3"}`,
38487
+ borderRadius: "4px",
38488
+ cursor: timeLeft > 0 || isOtpSending ? "not-allowed" : "pointer",
38489
+ fontWeight: "bold"
38137
38490
  }
38138
- }, t("CPT_CREATE_PROPERTY"))))), !isEmployee && (isLoading || propertyOptions.length > 0) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Label, null, t("WS_SELECT_EXISTING_PROPERTY")), isLoading && !isEmployee ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null) : !isEmployee ? propertyOptions.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
38491
+ }, timeLeft > 0 ? `${t("WS_RESEND_OTP") || "Resend OTP"} (00:${timeLeft < 10 ? `0${timeLeft}` : timeLeft})` : t("WS_RESEND_OTP") || "Resend OTP")), timeLeft > 0 && /*#__PURE__*/React__default.createElement("div", {
38492
+ style: {
38493
+ marginTop: "12px",
38494
+ color: "#505A5F",
38495
+ fontSize: "14px"
38496
+ }
38497
+ }, t("WS_DIDNT_RECEIVE_OTP_RESEND") || "Didn't receive OTP? You can resend after", " ", timeLeft, " ", t("WS_SECONDS") || "seconds", ".")), isMobileVerified && /*#__PURE__*/React__default.createElement("div", {
38139
38498
  style: {
38140
38499
  display: "flex",
38141
- flexDirection: "column",
38500
+ justifyContent: "space-between",
38501
+ alignItems: "center",
38502
+ background: "#d4edda",
38503
+ border: "1px solid #c3e6cb",
38504
+ color: "#155724",
38505
+ padding: "12px 16px",
38506
+ borderRadius: "4px"
38507
+ }
38508
+ }, /*#__PURE__*/React__default.createElement("div", {
38509
+ style: {
38510
+ display: "flex",
38511
+ alignItems: "center",
38142
38512
  gap: "8px"
38143
38513
  }
38144
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
38145
- option: propertyOptions,
38146
- optionKey: "displayName",
38147
- id: "propertyId",
38148
- selected: selectedProperty,
38149
- select: val => {
38150
- setSelectedProperty(val);
38151
- setShowOtpVerification(false);
38514
+ }, /*#__PURE__*/React__default.createElement("span", {
38515
+ style: {
38516
+ background: "#28a745",
38517
+ color: "white",
38518
+ borderRadius: "50%",
38519
+ width: "24px",
38520
+ height: "24px",
38521
+ display: "inline-flex",
38522
+ justifyContent: "center",
38523
+ alignItems: "center",
38524
+ fontWeight: "bold"
38525
+ }
38526
+ }, "\u2713"), /*#__PURE__*/React__default.createElement("span", {
38527
+ style: {
38528
+ fontWeight: "bold"
38529
+ }
38530
+ }, t("WS_MOBILE_VERIFIED_SUCCESSFULLY") || "Mobile number verified successfully!")), /*#__PURE__*/React__default.createElement("button", {
38531
+ type: "button",
38532
+ onClick: () => {
38533
+ setIsMobileVerified(false);
38152
38534
  setOtp("");
38535
+ setShowOtpVerification(false);
38153
38536
  },
38154
- t: t,
38155
- placeholder: t("PT_SELECT_PROPERTY")
38156
- }), /*#__PURE__*/React__default.createElement("span", {
38157
38537
  style: {
38158
- fontSize: "14px",
38159
- color: "#505A5F"
38538
+ color: "#1a67a3",
38539
+ background: "none",
38540
+ border: "none",
38541
+ cursor: "pointer",
38542
+ fontWeight: "bold",
38543
+ textDecoration: "underline"
38160
38544
  }
38161
- }, t("WS_PROPERTY_AUTOFILL_MSG"))) : /*#__PURE__*/React__default.createElement("div", {
38545
+ }, t("WS_CHANGE_NUMBER") || "Change Number")), (searchMobileNumber === null || searchMobileNumber === void 0 ? void 0 : searchMobileNumber.length) === 10 && isMobileVerified && !isLoading && propertyOptions.length === 0 && /*#__PURE__*/React__default.createElement("div", {
38162
38546
  style: {
38163
38547
  display: "flex",
38164
38548
  flexDirection: "column",
@@ -38179,7 +38563,7 @@ const WSInfoPage = () => {
38179
38563
  color: "white",
38180
38564
  margin: 0
38181
38565
  }
38182
- }, t("CPT_CREATE_PROPERTY")))) : null), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "NO" && /*#__PURE__*/React__default.createElement("div", {
38566
+ }, t("CPT_CREATE_PROPERTY")))))), (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "NO" && /*#__PURE__*/React__default.createElement("div", {
38183
38567
  style: {
38184
38568
  marginBottom: "24px",
38185
38569
  display: "flex",
@@ -38195,7 +38579,7 @@ const WSInfoPage = () => {
38195
38579
  color: "white",
38196
38580
  margin: 0
38197
38581
  }
38198
- }, t("CPT_CREATE_PROPERTY")))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSubHeader, {
38582
+ }, t("CPT_CREATE_PROPERTY")))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSubHeader, {
38199
38583
  style: {
38200
38584
  marginTop: "0",
38201
38585
  marginBottom: "0"
@@ -38287,7 +38671,7 @@ const WSInfoPage = () => {
38287
38671
  marginBottom: "24px",
38288
38672
  lineHeight: "2"
38289
38673
  }
38290
- }, /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_IDENTITY_PROOF")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_ADDRESS_PROOF")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_ELECTRICITY_BILL")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_PLUMBER_REPORT")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_BUILDING_PLAN")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_PROPERTY_TAX_RECEIPT")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_APPLICANT_PHOTOGRAPH"))), !hasProperty || (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && !selectedProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
38674
+ }, /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_IDENTITY_PROOF")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_ADDRESS_PROOF")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_ELECTRICITY_BILL")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_PLUMBER_REPORT")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_BUILDING_PLAN")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_PROPERTY_TAX_RECEIPT")), /*#__PURE__*/React__default.createElement("li", null, t("WS_DOC_APPLICANT_PHOTOGRAPH")))), !hasProperty || (hasProperty === null || hasProperty === void 0 ? void 0 : hasProperty.code) === "YES" && !selectedProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
38291
38675
  label: t("CS_COMMON_NEXT"),
38292
38676
  onSubmit: () => {},
38293
38677
  disabled: true
@@ -43338,12 +43722,12 @@ const configSVApproverApplication = _ref => {
43338
43722
  };
43339
43723
  };
43340
43724
 
43341
- const Heading = props => {
43725
+ const Heading$1 = props => {
43342
43726
  return /*#__PURE__*/React__default.createElement("h1", {
43343
43727
  className: "heading-m"
43344
43728
  }, props.label);
43345
43729
  };
43346
- const Close$1 = () => /*#__PURE__*/React__default.createElement("svg", {
43730
+ const Close$2 = () => /*#__PURE__*/React__default.createElement("svg", {
43347
43731
  xmlns: "http://www.w3.org/2000/svg",
43348
43732
  viewBox: "0 0 24 24",
43349
43733
  fill: "#FFFFFF"
@@ -43353,11 +43737,11 @@ const Close$1 = () => /*#__PURE__*/React__default.createElement("svg", {
43353
43737
  }), /*#__PURE__*/React__default.createElement("path", {
43354
43738
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
43355
43739
  }));
43356
- const CloseBtn = props => {
43740
+ const CloseBtn$1 = props => {
43357
43741
  return /*#__PURE__*/React__default.createElement("div", {
43358
43742
  className: "icon-bg-secondary",
43359
43743
  onClick: props.onClick
43360
- }, /*#__PURE__*/React__default.createElement(Close$1, null));
43744
+ }, /*#__PURE__*/React__default.createElement(Close$2, null));
43361
43745
  };
43362
43746
  const ActionModal = _ref => {
43363
43747
  var _action$assigneeRoles, _action$assigneeRoles2;
@@ -43539,10 +43923,10 @@ const ActionModal = _ref => {
43539
43923
  }
43540
43924
  }, [action, approvers, financialYears, selectedFinancialYear, uploadedFile]);
43541
43925
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
43542
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading, {
43926
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$1, {
43543
43927
  label: t(config.label.heading)
43544
43928
  }),
43545
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn, {
43929
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$1, {
43546
43930
  onClick: closeModal
43547
43931
  }),
43548
43932
  actionCancelLabel: t(config.label.cancel),
@@ -43562,12 +43946,12 @@ const ActionModal = _ref => {
43562
43946
  })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
43563
43947
  };
43564
43948
 
43565
- const Heading$1 = props => {
43949
+ const Heading$2 = props => {
43566
43950
  return /*#__PURE__*/React__default.createElement("h1", {
43567
43951
  className: "heading-m"
43568
43952
  }, props.label);
43569
43953
  };
43570
- const Close$2 = () => /*#__PURE__*/React__default.createElement("svg", {
43954
+ const Close$3 = () => /*#__PURE__*/React__default.createElement("svg", {
43571
43955
  xmlns: "http://www.w3.org/2000/svg",
43572
43956
  viewBox: "0 0 24 24",
43573
43957
  fill: "#FFFFFF"
@@ -43577,11 +43961,11 @@ const Close$2 = () => /*#__PURE__*/React__default.createElement("svg", {
43577
43961
  }), /*#__PURE__*/React__default.createElement("path", {
43578
43962
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
43579
43963
  }));
43580
- const CloseBtn$1 = props => {
43964
+ const CloseBtn$2 = props => {
43581
43965
  return /*#__PURE__*/React__default.createElement("div", {
43582
43966
  className: "icon-bg-secondary",
43583
43967
  onClick: props.onClick
43584
- }, /*#__PURE__*/React__default.createElement(Close$2, null));
43968
+ }, /*#__PURE__*/React__default.createElement(Close$3, null));
43585
43969
  };
43586
43970
  const ActionModal$1 = _ref => {
43587
43971
  var _action$assigneeRoles, _action$assigneeRoles2;
@@ -43719,10 +44103,10 @@ const ActionModal$1 = _ref => {
43719
44103
  }
43720
44104
  }, [action, approvers, financialYears, selectedFinancialYear, uploadedFile]);
43721
44105
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
43722
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$1, {
44106
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$2, {
43723
44107
  label: t(config.label.heading)
43724
44108
  }),
43725
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$1, {
44109
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$2, {
43726
44110
  onClick: closeModal
43727
44111
  }),
43728
44112
  actionCancelLabel: t(config.label.cancel),
@@ -43741,7 +44125,7 @@ const ActionModal$1 = _ref => {
43741
44125
  })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
43742
44126
  };
43743
44127
 
43744
- const Heading$2 = props => {
44128
+ const Heading$3 = props => {
43745
44129
  return /*#__PURE__*/React__default.createElement("h1", {
43746
44130
  style: {
43747
44131
  marginLeft: "22px"
@@ -43749,7 +44133,7 @@ const Heading$2 = props => {
43749
44133
  className: "heading-m BPAheading-m"
43750
44134
  }, props.label);
43751
44135
  };
43752
- const Close$3 = () => /*#__PURE__*/React__default.createElement("svg", {
44136
+ const Close$4 = () => /*#__PURE__*/React__default.createElement("svg", {
43753
44137
  xmlns: "http://www.w3.org/2000/svg",
43754
44138
  viewBox: "0 0 24 24",
43755
44139
  fill: "#FFFFFF"
@@ -43759,11 +44143,11 @@ const Close$3 = () => /*#__PURE__*/React__default.createElement("svg", {
43759
44143
  }), /*#__PURE__*/React__default.createElement("path", {
43760
44144
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
43761
44145
  }));
43762
- const CloseBtn$2 = props => {
44146
+ const CloseBtn$3 = props => {
43763
44147
  return /*#__PURE__*/React__default.createElement("div", {
43764
44148
  className: "icon-bg-secondary",
43765
44149
  onClick: props.onClick
43766
- }, /*#__PURE__*/React__default.createElement(Close$3, null));
44150
+ }, /*#__PURE__*/React__default.createElement(Close$4, null));
43767
44151
  };
43768
44152
  const ActionModal$2 = _ref => {
43769
44153
  var _action$assigneeRoles, _action$assigneeRoles2;
@@ -43891,10 +44275,10 @@ const ActionModal$2 = _ref => {
43891
44275
  }
43892
44276
  }, [action, approvers, uploadedFile, error]);
43893
44277
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
43894
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$2, {
44278
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$3, {
43895
44279
  label: t(config.label.heading)
43896
44280
  }),
43897
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$2, {
44281
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$3, {
43898
44282
  onClick: closeModal
43899
44283
  }),
43900
44284
  actionCancelLabel: t(config.label.cancel),
@@ -43935,7 +44319,7 @@ const ActionModal$2 = _ref => {
43935
44319
  })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
43936
44320
  };
43937
44321
 
43938
- const Heading$3 = props => {
44322
+ const Heading$4 = props => {
43939
44323
  return /*#__PURE__*/React__default.createElement("h1", {
43940
44324
  style: {
43941
44325
  marginLeft: "22px"
@@ -43943,7 +44327,7 @@ const Heading$3 = props => {
43943
44327
  className: "heading-m BPAheading-m"
43944
44328
  }, props.label);
43945
44329
  };
43946
- const Close$4 = () => /*#__PURE__*/React__default.createElement("svg", {
44330
+ const Close$5 = () => /*#__PURE__*/React__default.createElement("svg", {
43947
44331
  xmlns: "http://www.w3.org/2000/svg",
43948
44332
  viewBox: "0 0 24 24",
43949
44333
  fill: "#FFFFFF"
@@ -43953,11 +44337,11 @@ const Close$4 = () => /*#__PURE__*/React__default.createElement("svg", {
43953
44337
  }), /*#__PURE__*/React__default.createElement("path", {
43954
44338
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
43955
44339
  }));
43956
- const CloseBtn$3 = props => {
44340
+ const CloseBtn$4 = props => {
43957
44341
  return /*#__PURE__*/React__default.createElement("div", {
43958
44342
  className: "icon-bg-secondary",
43959
44343
  onClick: props.onClick
43960
- }, /*#__PURE__*/React__default.createElement(Close$4, null));
44344
+ }, /*#__PURE__*/React__default.createElement(Close$5, null));
43961
44345
  };
43962
44346
  const ActionModal$3 = _ref => {
43963
44347
  var _applicationData, _applicationData$land, _applicationData$land2, _applicationData2, _applicationData2$lan, _applicationData2$lan2, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6;
@@ -44224,10 +44608,10 @@ const ActionModal$3 = _ref => {
44224
44608
  }
44225
44609
  }, [action, approvers, selectedFinancialYear, uploadedFile, error]);
44226
44610
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
44227
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$3, {
44611
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$4, {
44228
44612
  label: t(config.label.heading)
44229
44613
  }),
44230
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$3, {
44614
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$4, {
44231
44615
  onClick: closeModal
44232
44616
  }),
44233
44617
  actionCancelLabel: t(config.label.cancel),
@@ -44270,7 +44654,7 @@ const ActionModal$3 = _ref => {
44270
44654
  })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
44271
44655
  };
44272
44656
 
44273
- const Heading$4 = props => {
44657
+ const Heading$5 = props => {
44274
44658
  return /*#__PURE__*/React__default.createElement("h1", {
44275
44659
  style: {
44276
44660
  marginLeft: "22px"
@@ -44278,7 +44662,7 @@ const Heading$4 = props => {
44278
44662
  className: "heading-m BPAheading-m"
44279
44663
  }, props.label);
44280
44664
  };
44281
- const Close$5 = () => /*#__PURE__*/React__default.createElement("svg", {
44665
+ const Close$6 = () => /*#__PURE__*/React__default.createElement("svg", {
44282
44666
  xmlns: "http://www.w3.org/2000/svg",
44283
44667
  viewBox: "0 0 24 24",
44284
44668
  fill: "#FFFFFF"
@@ -44288,11 +44672,11 @@ const Close$5 = () => /*#__PURE__*/React__default.createElement("svg", {
44288
44672
  }), /*#__PURE__*/React__default.createElement("path", {
44289
44673
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
44290
44674
  }));
44291
- const CloseBtn$4 = props => {
44675
+ const CloseBtn$5 = props => {
44292
44676
  return /*#__PURE__*/React__default.createElement("div", {
44293
44677
  className: "icon-bg-secondary",
44294
44678
  onClick: props.onClick
44295
- }, /*#__PURE__*/React__default.createElement(Close$5, null));
44679
+ }, /*#__PURE__*/React__default.createElement(Close$6, null));
44296
44680
  };
44297
44681
  const ActionModal$4 = _ref => {
44298
44682
  var _action$assigneeRoles, _action$assigneeRoles2;
@@ -44431,10 +44815,10 @@ const ActionModal$4 = _ref => {
44431
44815
  }
44432
44816
  }, [action, approvers, uploadedFile, error]);
44433
44817
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
44434
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$4, {
44818
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$5, {
44435
44819
  label: t(config.label.heading)
44436
44820
  }),
44437
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$4, {
44821
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$5, {
44438
44822
  onClick: closeModal
44439
44823
  }),
44440
44824
  actionCancelLabel: t(config.label.cancel),
@@ -44475,12 +44859,12 @@ const ActionModal$4 = _ref => {
44475
44859
  })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
44476
44860
  };
44477
44861
 
44478
- const Heading$5 = props => {
44862
+ const Heading$6 = props => {
44479
44863
  return /*#__PURE__*/React__default.createElement("h1", {
44480
44864
  className: "heading-m"
44481
44865
  }, props.label);
44482
44866
  };
44483
- const Close$6 = () => /*#__PURE__*/React__default.createElement("svg", {
44867
+ const Close$7 = () => /*#__PURE__*/React__default.createElement("svg", {
44484
44868
  xmlns: "http://www.w3.org/2000/svg",
44485
44869
  viewBox: "0 0 24 24",
44486
44870
  fill: "#FFFFFF"
@@ -44490,11 +44874,11 @@ const Close$6 = () => /*#__PURE__*/React__default.createElement("svg", {
44490
44874
  }), /*#__PURE__*/React__default.createElement("path", {
44491
44875
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
44492
44876
  }));
44493
- const CloseBtn$5 = props => {
44877
+ const CloseBtn$6 = props => {
44494
44878
  return /*#__PURE__*/React__default.createElement("div", {
44495
44879
  className: "icon-bg-secondary",
44496
44880
  onClick: props.onClick
44497
- }, /*#__PURE__*/React__default.createElement(Close$6, null));
44881
+ }, /*#__PURE__*/React__default.createElement(Close$7, null));
44498
44882
  };
44499
44883
  const convertDateToEpochNew$1 = function (dateString, dayStartOrEnd) {
44500
44884
  if (dayStartOrEnd === void 0) {
@@ -44807,10 +45191,10 @@ const ActionModal$5 = _ref => {
44807
45191
  }
44808
45192
  }, [action, approvers, uploadedFile, error, isReasonRequiredAction, selectedReason, otherReasonText, showApprovalChecklist, approvalChecklist, applicationData]);
44809
45193
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
44810
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$5, {
45194
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$6, {
44811
45195
  label: t(config.label.heading)
44812
45196
  }),
44813
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$5, {
45197
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$6, {
44814
45198
  onClick: closeModal
44815
45199
  }),
44816
45200
  actionCancelLabel: t(config.label.cancel),
@@ -44843,167 +45227,6 @@ const ActionModal$5 = _ref => {
44843
45227
  }))) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
44844
45228
  };
44845
45229
 
44846
- const Heading$6 = props => {
44847
- return /*#__PURE__*/React__default.createElement("h1", {
44848
- className: "heading-m"
44849
- }, props.label);
44850
- };
44851
- const Close$7 = () => /*#__PURE__*/React__default.createElement("svg", {
44852
- xmlns: "http://www.w3.org/2000/svg",
44853
- viewBox: "0 0 24 24",
44854
- fill: "#FFFFFF"
44855
- }, /*#__PURE__*/React__default.createElement("path", {
44856
- d: "M0 0h24v24H0V0z",
44857
- fill: "none"
44858
- }), /*#__PURE__*/React__default.createElement("path", {
44859
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
44860
- }));
44861
- const CloseBtn$6 = props => {
44862
- return /*#__PURE__*/React__default.createElement("div", {
44863
- className: "icon-bg-secondary",
44864
- onClick: props.onClick
44865
- }, /*#__PURE__*/React__default.createElement(Close$7, null));
44866
- };
44867
- const ActionModal$6 = _ref => {
44868
- var _action$assigneeRoles, _action$assigneeRoles2;
44869
- let {
44870
- t,
44871
- action,
44872
- tenantId,
44873
- state,
44874
- id,
44875
- closeModal,
44876
- submitAction,
44877
- actionData,
44878
- applicationData,
44879
- businessService,
44880
- moduleCode
44881
- } = _ref;
44882
- console.log("applicationData", applicationData);
44883
- const {
44884
- data: approverData,
44885
- isLoading: PTALoading
44886
- } = Digit.Hooks.useEmployeeSearch(tenantId, {
44887
- roles: action === null || action === void 0 ? void 0 : (_action$assigneeRoles = action.assigneeRoles) === null || _action$assigneeRoles === void 0 ? void 0 : (_action$assigneeRoles2 = _action$assigneeRoles.map) === null || _action$assigneeRoles2 === void 0 ? void 0 : _action$assigneeRoles2.call(_action$assigneeRoles, e => ({
44888
- code: e
44889
- })),
44890
- isActive: true
44891
- }, {
44892
- enabled: !(action !== null && action !== void 0 && action.isTerminateState)
44893
- });
44894
- const [config, setConfig] = React.useState({});
44895
- const [defaultValues, setDefaultValues] = React.useState({});
44896
- const [approvers, setApprovers] = React.useState([]);
44897
- const [selectedApprover, setSelectedApprover] = React.useState(null);
44898
- const [file, setFile] = React.useState(null);
44899
- const [uploadedFile, setUploadedFile] = React.useState(null);
44900
- const [error, setError] = React.useState(null);
44901
- const [disableActionSubmit, setDisableActionSubmit] = React.useState(false);
44902
- React.useEffect(() => {
44903
- var _approverData$Employe;
44904
- setApprovers(approverData === null || approverData === void 0 ? void 0 : (_approverData$Employe = approverData.Employees) === null || _approverData$Employe === void 0 ? void 0 : _approverData$Employe.map(employee => {
44905
- var _employee$user;
44906
- return {
44907
- uuid: employee === null || employee === void 0 ? void 0 : employee.uuid,
44908
- name: employee === null || employee === void 0 ? void 0 : (_employee$user = employee.user) === null || _employee$user === void 0 ? void 0 : _employee$user.name
44909
- };
44910
- }));
44911
- }, [approverData]);
44912
- function selectFile(e) {
44913
- setFile(e.target.files[0]);
44914
- }
44915
- React.useEffect(() => {
44916
- (function () {
44917
- try {
44918
- setError(null);
44919
- const _temp3 = function () {
44920
- if (file) {
44921
- const _temp2 = function () {
44922
- if (file.size >= 5242880) {
44923
- setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
44924
- } else {
44925
- const _temp = _catch(function () {
44926
- return Promise.resolve(Digit.UploadServices.Filestorage("PTR", file, Digit.ULBService.getStateId())).then(function (response) {
44927
- var _response$data, _response$data$files;
44928
- 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) {
44929
- var _response$data2, _response$data2$files;
44930
- setUploadedFile(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);
44931
- } else {
44932
- setError(t("CS_FILE_UPLOAD_ERROR"));
44933
- }
44934
- });
44935
- }, function () {
44936
- setError(t("CS_FILE_UPLOAD_ERROR"));
44937
- });
44938
- if (_temp && _temp.then) return _temp.then(function () {});
44939
- }
44940
- }();
44941
- if (_temp2 && _temp2.then) return _temp2.then(function () {});
44942
- }
44943
- }();
44944
- return _temp3 && _temp3.then ? _temp3.then(function () {}) : void 0;
44945
- } catch (e) {
44946
- Promise.reject(e);
44947
- }
44948
- })();
44949
- }, [file]);
44950
- function submit(data) {
44951
- let workflow = {
44952
- action: action === null || action === void 0 ? void 0 : action.action,
44953
- comments: data === null || data === void 0 ? void 0 : data.comments,
44954
- businessService,
44955
- moduleName: moduleCode
44956
- };
44957
- if (uploadedFile) workflow["documents"] = [{
44958
- documentType: (action === null || action === void 0 ? void 0 : action.action) + " DOC",
44959
- fileName: file === null || file === void 0 ? void 0 : file.name,
44960
- filestoreId: uploadedFile
44961
- }];
44962
- submitAction({
44963
- PetRegistrationApplications: [{
44964
- ...applicationData,
44965
- workflow
44966
- }]
44967
- });
44968
- }
44969
- React.useEffect(() => {
44970
- if (action) {
44971
- setConfig(configPTRApproverApplication({
44972
- t,
44973
- action,
44974
- approvers,
44975
- selectedApprover,
44976
- setSelectedApprover,
44977
- selectFile,
44978
- uploadedFile,
44979
- setUploadedFile,
44980
- businessService
44981
- }));
44982
- }
44983
- }, [action, approvers, uploadedFile]);
44984
- return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
44985
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$6, {
44986
- label: t(config.label.heading)
44987
- }),
44988
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$6, {
44989
- onClick: closeModal
44990
- }),
44991
- actionCancelLabel: t(config.label.cancel),
44992
- actionCancelOnSubmit: closeModal,
44993
- actionSaveLabel: t(config.label.submit),
44994
- actionSaveOnSubmit: () => {},
44995
- formId: "modal-action"
44996
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
44997
- config: config.form,
44998
- noBoxShadow: true,
44999
- inline: true,
45000
- childrenAtTheBottom: true,
45001
- onSubmit: submit,
45002
- defaultValues: defaultValues,
45003
- formId: "modal-action"
45004
- })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
45005
- };
45006
-
45007
45230
  const Heading$7 = props => {
45008
45231
  return /*#__PURE__*/React__default.createElement("h1", {
45009
45232
  className: "heading-m"
@@ -45025,6 +45248,167 @@ const CloseBtn$7 = props => {
45025
45248
  onClick: props.onClick
45026
45249
  }, /*#__PURE__*/React__default.createElement(Close$8, null));
45027
45250
  };
45251
+ const ActionModal$6 = _ref => {
45252
+ var _action$assigneeRoles, _action$assigneeRoles2;
45253
+ let {
45254
+ t,
45255
+ action,
45256
+ tenantId,
45257
+ state,
45258
+ id,
45259
+ closeModal,
45260
+ submitAction,
45261
+ actionData,
45262
+ applicationData,
45263
+ businessService,
45264
+ moduleCode
45265
+ } = _ref;
45266
+ console.log("applicationData", applicationData);
45267
+ const {
45268
+ data: approverData,
45269
+ isLoading: PTALoading
45270
+ } = Digit.Hooks.useEmployeeSearch(tenantId, {
45271
+ roles: action === null || action === void 0 ? void 0 : (_action$assigneeRoles = action.assigneeRoles) === null || _action$assigneeRoles === void 0 ? void 0 : (_action$assigneeRoles2 = _action$assigneeRoles.map) === null || _action$assigneeRoles2 === void 0 ? void 0 : _action$assigneeRoles2.call(_action$assigneeRoles, e => ({
45272
+ code: e
45273
+ })),
45274
+ isActive: true
45275
+ }, {
45276
+ enabled: !(action !== null && action !== void 0 && action.isTerminateState)
45277
+ });
45278
+ const [config, setConfig] = React.useState({});
45279
+ const [defaultValues, setDefaultValues] = React.useState({});
45280
+ const [approvers, setApprovers] = React.useState([]);
45281
+ const [selectedApprover, setSelectedApprover] = React.useState(null);
45282
+ const [file, setFile] = React.useState(null);
45283
+ const [uploadedFile, setUploadedFile] = React.useState(null);
45284
+ const [error, setError] = React.useState(null);
45285
+ const [disableActionSubmit, setDisableActionSubmit] = React.useState(false);
45286
+ React.useEffect(() => {
45287
+ var _approverData$Employe;
45288
+ setApprovers(approverData === null || approverData === void 0 ? void 0 : (_approverData$Employe = approverData.Employees) === null || _approverData$Employe === void 0 ? void 0 : _approverData$Employe.map(employee => {
45289
+ var _employee$user;
45290
+ return {
45291
+ uuid: employee === null || employee === void 0 ? void 0 : employee.uuid,
45292
+ name: employee === null || employee === void 0 ? void 0 : (_employee$user = employee.user) === null || _employee$user === void 0 ? void 0 : _employee$user.name
45293
+ };
45294
+ }));
45295
+ }, [approverData]);
45296
+ function selectFile(e) {
45297
+ setFile(e.target.files[0]);
45298
+ }
45299
+ React.useEffect(() => {
45300
+ (function () {
45301
+ try {
45302
+ setError(null);
45303
+ const _temp3 = function () {
45304
+ if (file) {
45305
+ const _temp2 = function () {
45306
+ if (file.size >= 5242880) {
45307
+ setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
45308
+ } else {
45309
+ const _temp = _catch(function () {
45310
+ return Promise.resolve(Digit.UploadServices.Filestorage("PTR", file, Digit.ULBService.getStateId())).then(function (response) {
45311
+ var _response$data, _response$data$files;
45312
+ 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) {
45313
+ var _response$data2, _response$data2$files;
45314
+ setUploadedFile(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);
45315
+ } else {
45316
+ setError(t("CS_FILE_UPLOAD_ERROR"));
45317
+ }
45318
+ });
45319
+ }, function () {
45320
+ setError(t("CS_FILE_UPLOAD_ERROR"));
45321
+ });
45322
+ if (_temp && _temp.then) return _temp.then(function () {});
45323
+ }
45324
+ }();
45325
+ if (_temp2 && _temp2.then) return _temp2.then(function () {});
45326
+ }
45327
+ }();
45328
+ return _temp3 && _temp3.then ? _temp3.then(function () {}) : void 0;
45329
+ } catch (e) {
45330
+ Promise.reject(e);
45331
+ }
45332
+ })();
45333
+ }, [file]);
45334
+ function submit(data) {
45335
+ let workflow = {
45336
+ action: action === null || action === void 0 ? void 0 : action.action,
45337
+ comments: data === null || data === void 0 ? void 0 : data.comments,
45338
+ businessService,
45339
+ moduleName: moduleCode
45340
+ };
45341
+ if (uploadedFile) workflow["documents"] = [{
45342
+ documentType: (action === null || action === void 0 ? void 0 : action.action) + " DOC",
45343
+ fileName: file === null || file === void 0 ? void 0 : file.name,
45344
+ filestoreId: uploadedFile
45345
+ }];
45346
+ submitAction({
45347
+ PetRegistrationApplications: [{
45348
+ ...applicationData,
45349
+ workflow
45350
+ }]
45351
+ });
45352
+ }
45353
+ React.useEffect(() => {
45354
+ if (action) {
45355
+ setConfig(configPTRApproverApplication({
45356
+ t,
45357
+ action,
45358
+ approvers,
45359
+ selectedApprover,
45360
+ setSelectedApprover,
45361
+ selectFile,
45362
+ uploadedFile,
45363
+ setUploadedFile,
45364
+ businessService
45365
+ }));
45366
+ }
45367
+ }, [action, approvers, uploadedFile]);
45368
+ return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
45369
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$7, {
45370
+ label: t(config.label.heading)
45371
+ }),
45372
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$7, {
45373
+ onClick: closeModal
45374
+ }),
45375
+ actionCancelLabel: t(config.label.cancel),
45376
+ actionCancelOnSubmit: closeModal,
45377
+ actionSaveLabel: t(config.label.submit),
45378
+ actionSaveOnSubmit: () => {},
45379
+ formId: "modal-action"
45380
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
45381
+ config: config.form,
45382
+ noBoxShadow: true,
45383
+ inline: true,
45384
+ childrenAtTheBottom: true,
45385
+ onSubmit: submit,
45386
+ defaultValues: defaultValues,
45387
+ formId: "modal-action"
45388
+ })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
45389
+ };
45390
+
45391
+ const Heading$8 = props => {
45392
+ return /*#__PURE__*/React__default.createElement("h1", {
45393
+ className: "heading-m"
45394
+ }, props.label);
45395
+ };
45396
+ const Close$9 = () => /*#__PURE__*/React__default.createElement("svg", {
45397
+ xmlns: "http://www.w3.org/2000/svg",
45398
+ viewBox: "0 0 24 24",
45399
+ fill: "#FFFFFF"
45400
+ }, /*#__PURE__*/React__default.createElement("path", {
45401
+ d: "M0 0h24v24H0V0z",
45402
+ fill: "none"
45403
+ }), /*#__PURE__*/React__default.createElement("path", {
45404
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
45405
+ }));
45406
+ const CloseBtn$8 = props => {
45407
+ return /*#__PURE__*/React__default.createElement("div", {
45408
+ className: "icon-bg-secondary",
45409
+ onClick: props.onClick
45410
+ }, /*#__PURE__*/React__default.createElement(Close$9, null));
45411
+ };
45028
45412
  const ActionModal$7 = _ref => {
45029
45413
  var _action$roles, _action$roles$, _action$roles$$map;
45030
45414
  let {
@@ -45103,10 +45487,10 @@ const ActionModal$7 = _ref => {
45103
45487
  }
45104
45488
  }, [action, approvers, uploadedFile]);
45105
45489
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
45106
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$7, {
45490
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$8, {
45107
45491
  label: t(config.label.heading)
45108
45492
  }),
45109
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$7, {
45493
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$8, {
45110
45494
  onClick: closeModal
45111
45495
  }),
45112
45496
  actionCancelLabel: t(config.label.cancel),
@@ -45129,12 +45513,12 @@ const ActionModal$7 = _ref => {
45129
45513
  })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
45130
45514
  };
45131
45515
 
45132
- const Heading$8 = props => {
45516
+ const Heading$9 = props => {
45133
45517
  return /*#__PURE__*/React__default.createElement("h1", {
45134
45518
  className: "heading-m"
45135
45519
  }, props.label);
45136
45520
  };
45137
- const Close$9 = () => /*#__PURE__*/React__default.createElement("svg", {
45521
+ const Close$a = () => /*#__PURE__*/React__default.createElement("svg", {
45138
45522
  xmlns: "http://www.w3.org/2000/svg",
45139
45523
  viewBox: "0 0 24 24",
45140
45524
  fill: "#FFFFFF"
@@ -45144,11 +45528,11 @@ const Close$9 = () => /*#__PURE__*/React__default.createElement("svg", {
45144
45528
  }), /*#__PURE__*/React__default.createElement("path", {
45145
45529
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
45146
45530
  }));
45147
- const CloseBtn$8 = props => {
45531
+ const CloseBtn$9 = props => {
45148
45532
  return /*#__PURE__*/React__default.createElement("div", {
45149
45533
  className: "icon-bg-secondary",
45150
45534
  onClick: props.onClick
45151
- }, /*#__PURE__*/React__default.createElement(Close$9, null));
45535
+ }, /*#__PURE__*/React__default.createElement(Close$a, null));
45152
45536
  };
45153
45537
  const ActionModal$8 = _ref => {
45154
45538
  var _action$assigneeRoles, _action$assigneeRoles2;
@@ -45267,10 +45651,10 @@ const ActionModal$8 = _ref => {
45267
45651
  }
45268
45652
  }, [action, approvers, uploadedFile]);
45269
45653
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
45270
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$8, {
45654
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$9, {
45271
45655
  label: t(config.label.heading)
45272
45656
  }),
45273
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$8, {
45657
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$9, {
45274
45658
  onClick: closeModal
45275
45659
  }),
45276
45660
  actionCancelLabel: t(config.label.cancel),
@@ -45289,12 +45673,12 @@ const ActionModal$8 = _ref => {
45289
45673
  })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
45290
45674
  };
45291
45675
 
45292
- const Heading$9 = props => {
45676
+ const Heading$a = props => {
45293
45677
  return /*#__PURE__*/React__default.createElement("h1", {
45294
45678
  className: "heading-m"
45295
45679
  }, props.label);
45296
45680
  };
45297
- const Close$a = () => /*#__PURE__*/React__default.createElement("svg", {
45681
+ const Close$b = () => /*#__PURE__*/React__default.createElement("svg", {
45298
45682
  xmlns: "http://www.w3.org/2000/svg",
45299
45683
  viewBox: "0 0 24 24",
45300
45684
  fill: "#FFFFFF"
@@ -45304,11 +45688,11 @@ const Close$a = () => /*#__PURE__*/React__default.createElement("svg", {
45304
45688
  }), /*#__PURE__*/React__default.createElement("path", {
45305
45689
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
45306
45690
  }));
45307
- const CloseBtn$9 = props => {
45691
+ const CloseBtn$a = props => {
45308
45692
  return /*#__PURE__*/React__default.createElement("div", {
45309
45693
  className: "icon-bg-secondary",
45310
45694
  onClick: props.onClick
45311
- }, /*#__PURE__*/React__default.createElement(Close$a, null));
45695
+ }, /*#__PURE__*/React__default.createElement(Close$b, null));
45312
45696
  };
45313
45697
  const ActionModal$9 = _ref => {
45314
45698
  var _action$assigneeRoles, _action$assigneeRoles2;
@@ -45434,10 +45818,10 @@ const ActionModal$9 = _ref => {
45434
45818
  }, [action, approvers, uploadedFile]);
45435
45819
  console.log("conggg", config);
45436
45820
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
45437
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$9, {
45821
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$a, {
45438
45822
  label: t(config.label.heading)
45439
45823
  }),
45440
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$9, {
45824
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$a, {
45441
45825
  onClick: closeModal
45442
45826
  }),
45443
45827
  actionCancelLabel: t(config.label.cancel),
@@ -45456,12 +45840,12 @@ const ActionModal$9 = _ref => {
45456
45840
  })) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
45457
45841
  };
45458
45842
 
45459
- const Heading$a = props => {
45843
+ const Heading$b = props => {
45460
45844
  return /*#__PURE__*/React__default.createElement("h1", {
45461
45845
  className: "heading-m"
45462
45846
  }, props.label);
45463
45847
  };
45464
- const Close$b = () => /*#__PURE__*/React__default.createElement("svg", {
45848
+ const Close$c = () => /*#__PURE__*/React__default.createElement("svg", {
45465
45849
  xmlns: "http://www.w3.org/2000/svg",
45466
45850
  viewBox: "0 0 24 24",
45467
45851
  fill: "#FFFFFF"
@@ -45471,11 +45855,11 @@ const Close$b = () => /*#__PURE__*/React__default.createElement("svg", {
45471
45855
  }), /*#__PURE__*/React__default.createElement("path", {
45472
45856
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
45473
45857
  }));
45474
- const CloseBtn$a = props => {
45858
+ const CloseBtn$b = props => {
45475
45859
  return /*#__PURE__*/React__default.createElement("div", {
45476
45860
  className: "icon-bg-secondary",
45477
45861
  onClick: props.onClick
45478
- }, /*#__PURE__*/React__default.createElement(Close$b, null));
45862
+ }, /*#__PURE__*/React__default.createElement(Close$c, null));
45479
45863
  };
45480
45864
  const ActionModal$a = _ref => {
45481
45865
  var _action$assigneeRoles, _action$assigneeRoles2;
@@ -45603,10 +45987,10 @@ const ActionModal$a = _ref => {
45603
45987
  }));
45604
45988
  }, [action, approvers, uploadedFile]);
45605
45989
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
45606
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$a, {
45990
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$b, {
45607
45991
  label: t(config.label.heading)
45608
45992
  }),
45609
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$a, {
45993
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$b, {
45610
45994
  onClick: closeModal
45611
45995
  }),
45612
45996
  actionCancelLabel: t(config.label.cancel),
@@ -45690,12 +46074,12 @@ const configWTApproverApplication = _ref => {
45690
46074
  };
45691
46075
  };
45692
46076
 
45693
- const Heading$b = props => {
46077
+ const Heading$c = props => {
45694
46078
  return /*#__PURE__*/React__default.createElement("h1", {
45695
46079
  className: "heading-m"
45696
46080
  }, props.label);
45697
46081
  };
45698
- const Close$c = () => /*#__PURE__*/React__default.createElement("svg", {
46082
+ const Close$d = () => /*#__PURE__*/React__default.createElement("svg", {
45699
46083
  xmlns: "http://www.w3.org/2000/svg",
45700
46084
  viewBox: "0 0 24 24",
45701
46085
  fill: "#FFFFFF"
@@ -45705,11 +46089,11 @@ const Close$c = () => /*#__PURE__*/React__default.createElement("svg", {
45705
46089
  }), /*#__PURE__*/React__default.createElement("path", {
45706
46090
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
45707
46091
  }));
45708
- const CloseBtn$b = props => {
46092
+ const CloseBtn$c = props => {
45709
46093
  return /*#__PURE__*/React__default.createElement("div", {
45710
46094
  className: "icon-bg-secondary",
45711
46095
  onClick: props.onClick
45712
- }, /*#__PURE__*/React__default.createElement(Close$c, null));
46096
+ }, /*#__PURE__*/React__default.createElement(Close$d, null));
45713
46097
  };
45714
46098
  const ActionModal$b = _ref => {
45715
46099
  var _action$assigneeRoles, _action$assigneeRoles2, _dsoData$vendor, _vehicleData$vehicle, _vehicleData$vehicle$;
@@ -45907,10 +46291,10 @@ const ActionModal$b = _ref => {
45907
46291
  }
45908
46292
  }, [action, approvers, uploadedFile, dsoData, selectVehicle, vehicleData]);
45909
46293
  return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
45910
- headerBarMain: /*#__PURE__*/React__default.createElement(Heading$b, {
46294
+ headerBarMain: /*#__PURE__*/React__default.createElement(Heading$c, {
45911
46295
  label: t(config.label.heading)
45912
46296
  }),
45913
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$b, {
46297
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$c, {
45914
46298
  onClick: closeModal
45915
46299
  }),
45916
46300
  actionCancelLabel: t(config.label.cancel),
@@ -48201,7 +48585,7 @@ const ArrearSummary = _ref => {
48201
48585
  }, t("CS_HIDE_CARD"))));
48202
48586
  };
48203
48587
 
48204
- const Close$d = () => /*#__PURE__*/React__default.createElement("svg", {
48588
+ const Close$e = () => /*#__PURE__*/React__default.createElement("svg", {
48205
48589
  xmlns: "http://www.w3.org/2000/svg",
48206
48590
  viewBox: "0 0 24 24",
48207
48591
  fill: "#FFFFFF"
@@ -48211,11 +48595,11 @@ const Close$d = () => /*#__PURE__*/React__default.createElement("svg", {
48211
48595
  }), /*#__PURE__*/React__default.createElement("path", {
48212
48596
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
48213
48597
  }));
48214
- const CloseBtn$c = props => {
48598
+ const CloseBtn$d = props => {
48215
48599
  return /*#__PURE__*/React__default.createElement("div", {
48216
48600
  className: "icon-bg-secondary",
48217
48601
  onClick: props.onClick
48218
- }, /*#__PURE__*/React__default.createElement(Close$d, null));
48602
+ }, /*#__PURE__*/React__default.createElement(Close$e, null));
48219
48603
  };
48220
48604
  const RenewPopup = _ref => {
48221
48605
  let {
@@ -48243,7 +48627,7 @@ const RenewPopup = _ref => {
48243
48627
  headerBarMain: /*#__PURE__*/React__default.createElement(Heading, {
48244
48628
  label: "SV_WANT_TO_EDIT"
48245
48629
  }),
48246
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$c, {
48630
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$d, {
48247
48631
  onClick: closeModal
48248
48632
  }),
48249
48633
  actionCancelLabel: t("CS_COMMON_BACK"),
@@ -49477,7 +49861,7 @@ function ApplicationDetailsActionBar(_ref) {
49477
49861
  }, t(`${forcedActionPrefix || `WF_EMPLOYEE_${businessService === null || businessService === void 0 ? void 0 : businessService.toUpperCase()}`}_${actions === null || actions === void 0 ? void 0 : (_actions$4 = actions[0]) === null || _actions$4 === void 0 ? void 0 : _actions$4.action}`))));
49478
49862
  }
49479
49863
 
49480
- const Close$e = () => /*#__PURE__*/React__default.createElement("svg", {
49864
+ const Close$f = () => /*#__PURE__*/React__default.createElement("svg", {
49481
49865
  xmlns: "http://www.w3.org/2000/svg",
49482
49866
  viewBox: "0 0 24 24",
49483
49867
  fill: "#FFFFFF"
@@ -49487,11 +49871,11 @@ const Close$e = () => /*#__PURE__*/React__default.createElement("svg", {
49487
49871
  }), /*#__PURE__*/React__default.createElement("path", {
49488
49872
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
49489
49873
  }));
49490
- const CloseBtn$d = props => {
49874
+ const CloseBtn$e = props => {
49491
49875
  return /*#__PURE__*/React__default.createElement("div", {
49492
49876
  className: "icon-bg-secondary",
49493
49877
  onClick: props.onClick
49494
- }, /*#__PURE__*/React__default.createElement(Close$e, null));
49878
+ }, /*#__PURE__*/React__default.createElement(Close$f, null));
49495
49879
  };
49496
49880
  function ApplicationDetailsWarningPopup(_ref) {
49497
49881
  let {
@@ -49509,7 +49893,7 @@ function ApplicationDetailsWarningPopup(_ref) {
49509
49893
  headerBarMain: /*#__PURE__*/React__default.createElement("h1", {
49510
49894
  className: "heading-m"
49511
49895
  }, t("PT_DUES_ARE_PENDING")),
49512
- headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$d, {
49896
+ headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$e, {
49513
49897
  onClick: () => {
49514
49898
  closeWarningPopup();
49515
49899
  }
@@ -53112,56 +53496,110 @@ const Step1_SearchConnection = _ref => {
53112
53496
  businessService: "WS"
53113
53497
  }).catch(() => null)).then(function (wsResponse) {
53114
53498
  var _wsResponse$WaterConn;
53115
- function _temp3() {
53116
- var _connection, _connection$connectio, _connection$connectio2, _connection2;
53117
- if (!connection) {
53118
- setIsLoading(false);
53119
- setShowToast({
53120
- key: "error",
53121
- message: "Active connection not found for the given K Number"
53499
+ function _temp5() {
53500
+ let _exit = false;
53501
+ function _temp3(_result5) {
53502
+ var _connection, _connection$connectio, _connection$connectio2, _connection2;
53503
+ if (_exit) return _result5;
53504
+ const fetchedMobileNumber = ((_connection = connection) === null || _connection === void 0 ? void 0 : (_connection$connectio = _connection.connectionHolders) === null || _connection$connectio === void 0 ? void 0 : (_connection$connectio2 = _connection$connectio[0]) === null || _connection$connectio2 === void 0 ? void 0 : _connection$connectio2.mobileNumber) || ((_connection2 = connection) === null || _connection2 === void 0 ? void 0 : _connection2.mobileNumber);
53505
+ if (!fetchedMobileNumber || fetchedMobileNumber.length !== 10) {
53506
+ setIsLoading(false);
53507
+ setShowToast({
53508
+ key: "error",
53509
+ message: "No valid registered mobile number found for this connection"
53510
+ });
53511
+ return;
53512
+ }
53513
+ if (isEditFlow) {
53514
+ setIsLoading(false);
53515
+ onNext({
53516
+ kNumber,
53517
+ mobileNumber: fetchedMobileNumber,
53518
+ serviceType: detectedServiceType,
53519
+ activeConnection: connection
53520
+ });
53521
+ return;
53522
+ }
53523
+ const userType = Digit.UserService.getType().toUpperCase();
53524
+ const payload = {
53525
+ otp: {
53526
+ mobileNumber: fetchedMobileNumber,
53527
+ tenantId: "dl",
53528
+ type: "register",
53529
+ userType: userType
53530
+ }
53531
+ };
53532
+ return Promise.resolve(Digit.UserService.sendOtp(payload, "dl")).then(function () {
53533
+ setIsLoading(false);
53534
+ onNext({
53535
+ kNumber,
53536
+ mobileNumber: fetchedMobileNumber,
53537
+ serviceType: detectedServiceType,
53538
+ activeConnection: connection
53539
+ });
53122
53540
  });
53123
- return;
53124
53541
  }
53125
- const fetchedMobileNumber = ((_connection = connection) === null || _connection === void 0 ? void 0 : (_connection$connectio = _connection.connectionHolders) === null || _connection$connectio === void 0 ? void 0 : (_connection$connectio2 = _connection$connectio[0]) === null || _connection$connectio2 === void 0 ? void 0 : _connection$connectio2.mobileNumber) || ((_connection2 = connection) === null || _connection2 === void 0 ? void 0 : _connection2.mobileNumber);
53126
- if (!fetchedMobileNumber || fetchedMobileNumber.length !== 10) {
53542
+ if (!connection) {
53127
53543
  setIsLoading(false);
53128
53544
  setShowToast({
53129
53545
  key: "error",
53130
- message: "No valid registered mobile number found for this connection"
53131
- });
53132
- return;
53133
- }
53134
- if (isEditFlow) {
53135
- setIsLoading(false);
53136
- onNext({
53137
- kNumber,
53138
- mobileNumber: fetchedMobileNumber,
53139
- serviceType: detectedServiceType,
53140
- activeConnection: connection
53546
+ message: "Active connection not found for the given K Number"
53141
53547
  });
53142
53548
  return;
53143
53549
  }
53144
- const userType = Digit.UserService.getType().toUpperCase();
53145
- const payload = {
53146
- otp: {
53147
- mobileNumber: fetchedMobileNumber,
53148
- tenantId: "dl",
53149
- type: "register",
53150
- userType: userType
53550
+ const _temp2 = function () {
53551
+ if (detectedServiceType === "WATER") {
53552
+ const allConnections = (wsResponse === null || wsResponse === void 0 ? void 0 : wsResponse.WaterConnection) || [];
53553
+ const terminalStatuses = ["CONNECTION_ACTIVATED", "APPROVED", "REJECTED", "DISAPPROVED", "CANCELLED", "TERMINATED", "DISCONNECTION_EXECUTED", "CONNECTION_DISCONNECTED"];
53554
+ const pendingStatusApp = allConnections.find(c => c.applicationNo && c.applicationStatus && !terminalStatuses.includes(c.applicationStatus));
53555
+ if (pendingStatusApp) {
53556
+ var _connection3;
53557
+ setIsLoading(false);
53558
+ setShowToast({
53559
+ key: "error",
53560
+ message: `Application (${pendingStatusApp.applicationNo}) already exists in Workflow for Connection No. ${((_connection3 = connection) === null || _connection3 === void 0 ? void 0 : _connection3.connectionNo) || kNumber}. Cannot modify connection.`
53561
+ });
53562
+ _exit = true;
53563
+ return;
53564
+ }
53565
+ const appsToCheck = allConnections.filter(c => c.applicationNo && !terminalStatuses.includes(c.applicationStatus)).map(c => c.applicationNo);
53566
+ return function (_Digit, _Digit$WorkflowServic) {
53567
+ if (appsToCheck.length > 0 && (_Digit = Digit) !== null && _Digit !== void 0 && (_Digit$WorkflowServic = _Digit.WorkflowService) !== null && _Digit$WorkflowServic !== void 0 && _Digit$WorkflowServic.getByBusinessId) {
53568
+ return _catch(function () {
53569
+ var _connection4;
53570
+ return Promise.resolve(Digit.WorkflowService.getByBusinessId(((_connection4 = connection) === null || _connection4 === void 0 ? void 0 : _connection4.tenantId) || tenantId, appsToCheck.join(","), {}, false)).then(function (wfRes) {
53571
+ const latestProcessMap = {};
53572
+ ((wfRes === null || wfRes === void 0 ? void 0 : wfRes.ProcessInstances) || []).forEach(pi => {
53573
+ if (pi !== null && pi !== void 0 && pi.businessId) {
53574
+ var _pi$auditDetails, _existing$auditDetail;
53575
+ const existing = latestProcessMap[pi.businessId];
53576
+ if (!existing || (((_pi$auditDetails = pi.auditDetails) === null || _pi$auditDetails === void 0 ? void 0 : _pi$auditDetails.lastModifiedTime) || 0) > (((_existing$auditDetail = existing.auditDetails) === null || _existing$auditDetail === void 0 ? void 0 : _existing$auditDetail.lastModifiedTime) || 0)) {
53577
+ latestProcessMap[pi.businessId] = pi;
53578
+ }
53579
+ }
53580
+ });
53581
+ const activeProcess = Object.values(latestProcessMap).find(pi => (pi === null || pi === void 0 ? void 0 : pi.state) && !pi.state.isTerminateState && !terminalStatuses.includes(pi.state.state) && !terminalStatuses.includes(pi.state.applicationStatus));
53582
+ if (activeProcess) {
53583
+ var _connection5;
53584
+ setIsLoading(false);
53585
+ setShowToast({
53586
+ key: "error",
53587
+ message: `Application (${activeProcess.businessId}) already exists in Workflow for Connection No. ${((_connection5 = connection) === null || _connection5 === void 0 ? void 0 : _connection5.connectionNo) || kNumber}. Cannot modify connection.`
53588
+ });
53589
+ _exit = true;
53590
+ }
53591
+ });
53592
+ }, function (wfErr) {
53593
+ console.error("Workflow check error:", wfErr);
53594
+ });
53595
+ }
53596
+ }();
53151
53597
  }
53152
- };
53153
- return Promise.resolve(Digit.UserService.sendOtp(payload, "dl")).then(function () {
53154
- setIsLoading(false);
53155
- onNext({
53156
- kNumber,
53157
- mobileNumber: fetchedMobileNumber,
53158
- serviceType: detectedServiceType,
53159
- activeConnection: connection
53160
- });
53161
- });
53598
+ }();
53599
+ return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
53162
53600
  }
53163
53601
  let connection = wsResponse === null || wsResponse === void 0 ? void 0 : (_wsResponse$WaterConn = wsResponse.WaterConnection) === null || _wsResponse$WaterConn === void 0 ? void 0 : _wsResponse$WaterConn.find(c => c.applicationStatus === 'CONNECTION_ACTIVATED');
53164
- const _temp2 = function () {
53602
+ const _temp4 = function () {
53165
53603
  if (!connection) {
53166
53604
  return Promise.resolve(Digit.WSService.search({
53167
53605
  tenantId,
@@ -53174,7 +53612,7 @@ const Step1_SearchConnection = _ref => {
53174
53612
  });
53175
53613
  }
53176
53614
  }();
53177
- return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
53615
+ return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
53178
53616
  });
53179
53617
  }, function (err) {
53180
53618
  var _err$response2, _err$response2$data, _err$response2$data$E, _err$response2$data$E2;