@mseva/digit-ui-module-engagement 1.1.30 → 1.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { SurveyIconSolid, PMBIconSolid, EventsIconSolid, DocumentIconSolid, EmployeeModuleCard, LabelFieldPair as LabelFieldPair$1, CardLabel as CardLabel$1, Dropdown, RemoveableTag, TextInput as TextInput$1, TextArea as TextArea$1, CardLabelError as CardLabelError$2, UploadFile, Loader, Header, FormComposer as FormComposer$1, Card as Card$1, CardText as CardText$1, ActionBar as ActionBar$1, SubmitBar as SubmitBar$1, Banner, Table, CloseSvg, Label, LinkLabel, EventCalendar, DocumentIcon, CheckBox, RefreshIcon, DateRange, DetailsCard, SearchAction, FilterAction, PopUp, PMBIcon, RadioButtons, ArrowDown, DatePicker, Modal, CardSubHeader as CardSubHeader$1, PDFSvg, MultiUploadWrapper, CardHeader, CardSectionHeader as CardSectionHeader$1, StatusTable, Row, LinkButton as LinkButton$1, Close as Close$f, BreakLine as BreakLine$1, TelePhone, DisplayPhotos, Toast as Toast$1, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector, GenericFileIcon, PrivateRoute, LocationSearch, OnGroundEventCard, WhatsNewCard, CardCaption, SearchIconSvg, ViewsIcon, ExternalLinkIcon, DownloadImgIcon, AppContainer, PrevIcon, SearchField, BackButton, MapMarker, Clock, FilterFormField, EditIcon, InboxComposer, InfoIcon, DustbinIcon, MultiLink, BreadCrumb } from '@mseva/digit-ui-react-components';
1
+ import { SurveyIconSolid, PMBIconSolid, EventsIconSolid, DocumentIconSolid, EmployeeModuleCard, LabelFieldPair as LabelFieldPair$1, CardLabel as CardLabel$1, Dropdown, RemoveableTag, TextInput as TextInput$1, TextArea as TextArea$1, CardLabelError as CardLabelError$2, UploadFile, Loader, Header, FormComposer as FormComposer$1, Card as Card$1, CardText as CardText$1, ActionBar as ActionBar$1, SubmitBar as SubmitBar$1, Banner, Table, CloseSvg, Label, LinkLabel, EventCalendar, DocumentIcon, CheckBox, RefreshIcon, DateRange, DetailsCard, SearchAction, FilterAction, PopUp, PMBIcon, RadioButtons, ArrowDown, DatePicker, Modal, CardSubHeader as CardSubHeader$1, PDFSvg as PDFSvg$1, MultiUploadWrapper, CardHeader, CardSectionHeader as CardSectionHeader$1, StatusTable, Row, LinkButton as LinkButton$1, Close as Close$g, BreakLine as BreakLine$1, TelePhone, DisplayPhotos, Toast as Toast$1, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector, GenericFileIcon, PrivateRoute, LocationSearch, OnGroundEventCard, WhatsNewCard, CardCaption, SearchIconSvg, ViewsIcon, ExternalLinkIcon, DownloadImgIcon, AppContainer, PrevIcon, SearchField, BackButton, MapMarker, Clock, FilterFormField, EditIcon, InboxComposer, InfoIcon, DustbinIcon, MultiLink, BreadCrumb } from '@mseva/digit-ui-react-components';
2
2
  import React, { useEffect, useMemo, Fragment as Fragment$1, useState, useCallback, useRef, useReducer, forwardRef } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useHistory, useParams, Link, Switch, Redirect as Redirect$1, Route, useRouteMatch } from 'react-router-dom';
@@ -6884,7 +6884,7 @@ const ActionModal$3 = ({
6884
6884
  workflowDetails,
6885
6885
  blockReason
6886
6886
  }) => {
6887
- var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _applicationData, _applicationData$land, _applicationData$land2, _applicationData2, _applicationData2$lan, _applicationData2$lan2;
6887
+ var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _applicationData, _applicationData$land, _applicationData$land2, _applicationData2, _applicationData2$lan, _applicationData2$lan2, _applicationData3, _applicationData3$add, _applicationData4, _applicationData4$add, _applicationData5, _applicationData5$add, _applicationData6;
6888
6888
  console.log("applicationData_BPAACTIONMODAL", applicationData);
6889
6889
  const uniqueRoles = [...new Set(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : (_workflowDetails$data2 = _workflowDetails$data.initialActionState) === null || _workflowDetails$data2 === void 0 ? void 0 : (_workflowDetails$data3 = _workflowDetails$data2.nextActions) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.find(ele => (ele === null || ele === void 0 ? void 0 : ele.action) === (action === null || action === void 0 ? void 0 : action.action))) === null || _workflowDetails$data4 === void 0 ? void 0 : (_workflowDetails$data5 = _workflowDetails$data4.actions) === null || _workflowDetails$data5 === void 0 ? void 0 : _workflowDetails$data5.flatMap(e => e.roles || []))];
6890
6890
  console.log("workflowDetails_BPAACTIONMODAL", workflowDetails, uniqueRoles, action);
@@ -6896,6 +6896,10 @@ const ActionModal$3 = ({
6896
6896
  roles: uniqueRoles === null || uniqueRoles === void 0 ? void 0 : uniqueRoles.map(role => ({
6897
6897
  code: role
6898
6898
  })),
6899
+ zones: (_applicationData3 = applicationData) === null || _applicationData3 === void 0 ? void 0 : (_applicationData3$add = _applicationData3.additionalDetails) === null || _applicationData3$add === void 0 ? void 0 : _applicationData3$add.zonenumber,
6900
+ categories: (_applicationData4 = applicationData) === null || _applicationData4 === void 0 ? void 0 : (_applicationData4$add = _applicationData4.additionalDetails) === null || _applicationData4$add === void 0 ? void 0 : _applicationData4$add.categories,
6901
+ subcategories: (_applicationData5 = applicationData) === null || _applicationData5 === void 0 ? void 0 : (_applicationData5$add = _applicationData5.additionalDetails) === null || _applicationData5$add === void 0 ? void 0 : _applicationData5$add.subcategories,
6902
+ assignedtenattids: (_applicationData6 = applicationData) === null || _applicationData6 === void 0 ? void 0 : _applicationData6.tenantId,
6899
6903
  isActive: true
6900
6904
  }, {
6901
6905
  enabled: !(action !== null && action !== void 0 && action.isTerminateState)
@@ -7024,12 +7028,12 @@ const ActionModal$3 = ({
7024
7028
  return result;
7025
7029
  };
7026
7030
  async function submit(data) {
7027
- var _applicationData3, _applicationData4, _data$comments, _data$comments2, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data14, _workflowDetails$data15, _workflowDetails$data16, _workflowDetails$data17, _workflowDetails$data18, _workflowDetails$data19, _applicationData5, _applicationData5$add, _workflowDetails$data20, _workflowDetails$data21, _workflowDetails$data22, _workflowDetails$data23, _workflowDetails$data24, _workflowDetails$data25, _workflowDetails$data26, _workflowDetails$data27, _applicationData6, _applicationData6$add, _applicationData6$add2, _applicationData7, _applicationData7$add, _applicationData7$add2, _applicationData8, _applicationData8$add, _applicationData8$add2, _applicationData9, _applicationData9$add, _applicationData9$add2;
7031
+ var _applicationData7, _applicationData8, _data$comments, _data$comments2, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data14, _workflowDetails$data15, _workflowDetails$data16, _workflowDetails$data17, _workflowDetails$data18, _workflowDetails$data19, _applicationData9, _applicationData9$add, _workflowDetails$data20, _workflowDetails$data21, _workflowDetails$data22, _workflowDetails$data23, _workflowDetails$data24, _workflowDetails$data25, _workflowDetails$data26, _workflowDetails$data27, _applicationData0, _applicationData0$add, _applicationData0$add2, _applicationData1, _applicationData1$add, _applicationData1$add2, _applicationData10, _applicationData10$ad, _applicationData10$ad2, _applicationData11, _applicationData11$ad, _applicationData11$ad2;
7028
7032
  applicationData = {
7029
7033
  ...applicationData,
7030
- documents: (_applicationData3 = applicationData) === null || _applicationData3 === void 0 ? void 0 : _applicationData3.documents,
7034
+ documents: (_applicationData7 = applicationData) === null || _applicationData7 === void 0 ? void 0 : _applicationData7.documents,
7031
7035
  additionalDetails: {
7032
- ...((_applicationData4 = applicationData) === null || _applicationData4 === void 0 ? void 0 : _applicationData4.additionalDetails),
7036
+ ...((_applicationData8 = applicationData) === null || _applicationData8 === void 0 ? void 0 : _applicationData8.additionalDetails),
7033
7037
  fieldinspection_pending: getfeildInspection(applicationData),
7034
7038
  pendingapproval: getPendingApprovals(),
7035
7039
  blockingReason: selectedBlockReason === null || selectedBlockReason === void 0 ? void 0 : selectedBlockReason.name
@@ -7047,7 +7051,7 @@ const ActionModal$3 = ({
7047
7051
  }] : null
7048
7052
  },
7049
7053
  action: action === null || action === void 0 ? void 0 : action.action,
7050
- riskType: (_applicationData5 = applicationData) === null || _applicationData5 === void 0 ? void 0 : (_applicationData5$add = _applicationData5.additionalDetails) === null || _applicationData5$add === void 0 ? void 0 : _applicationData5$add.riskType,
7054
+ riskType: (_applicationData9 = applicationData) === null || _applicationData9 === void 0 ? void 0 : (_applicationData9$add = _applicationData9.additionalDetails) === null || _applicationData9$add === void 0 ? void 0 : _applicationData9$add.riskType,
7051
7055
  comment: data === null || data === void 0 ? void 0 : data.comments,
7052
7056
  assignee: (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data20 = workflowDetails.data) === null || _workflowDetails$data20 === void 0 ? void 0 : (_workflowDetails$data21 = _workflowDetails$data20.processInstances) === null || _workflowDetails$data21 === void 0 ? void 0 : (_workflowDetails$data22 = _workflowDetails$data21[0]) === null || _workflowDetails$data22 === void 0 ? void 0 : (_workflowDetails$data23 = _workflowDetails$data22.state) === null || _workflowDetails$data23 === void 0 ? void 0 : _workflowDetails$data23.applicationStatus) === "FIELDINSPECTION_INPROGRESS" ? [workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data24 = workflowDetails.data) === null || _workflowDetails$data24 === void 0 ? void 0 : (_workflowDetails$data25 = _workflowDetails$data24.processInstances) === null || _workflowDetails$data25 === void 0 ? void 0 : (_workflowDetails$data26 = _workflowDetails$data25[0]) === null || _workflowDetails$data26 === void 0 ? void 0 : (_workflowDetails$data27 = _workflowDetails$data26.assigner) === null || _workflowDetails$data27 === void 0 ? void 0 : _workflowDetails$data27.uuid] : !(selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid) ? null : [selectedApprover === null || selectedApprover === void 0 ? void 0 : selectedApprover.uuid],
7053
7057
  wfDocuments: uploadedFile ? [{
@@ -7056,7 +7060,7 @@ const ActionModal$3 = ({
7056
7060
  fileStoreId: uploadedFile
7057
7061
  }] : null
7058
7062
  };
7059
- if (parseInt(sessionStorage.getItem("lessAdjusment")) > parseInt(sessionStorage.getItem("development")) + parseInt(sessionStorage.getItem("otherCharges")) + parseInt((_applicationData6 = applicationData) === null || _applicationData6 === void 0 ? void 0 : (_applicationData6$add = _applicationData6.additionalDetails) === null || _applicationData6$add === void 0 ? void 0 : (_applicationData6$add2 = _applicationData6$add.selfCertificationCharges) === null || _applicationData6$add2 === void 0 ? void 0 : _applicationData6$add2.BPA_MALBA_CHARGES) + parseInt((_applicationData7 = applicationData) === null || _applicationData7 === void 0 ? void 0 : (_applicationData7$add = _applicationData7.additionalDetails) === null || _applicationData7$add === void 0 ? void 0 : (_applicationData7$add2 = _applicationData7$add.selfCertificationCharges) === null || _applicationData7$add2 === void 0 ? void 0 : _applicationData7$add2.BPA_LABOUR_CESS) + parseInt((_applicationData8 = applicationData) === null || _applicationData8 === void 0 ? void 0 : (_applicationData8$add = _applicationData8.additionalDetails) === null || _applicationData8$add === void 0 ? void 0 : (_applicationData8$add2 = _applicationData8$add.selfCertificationCharges) === null || _applicationData8$add2 === void 0 ? void 0 : _applicationData8$add2.BPA_WATER_CHARGES) + parseInt((_applicationData9 = applicationData) === null || _applicationData9 === void 0 ? void 0 : (_applicationData9$add = _applicationData9.additionalDetails) === null || _applicationData9$add === void 0 ? void 0 : (_applicationData9$add2 = _applicationData9$add.selfCertificationCharges) === null || _applicationData9$add2 === void 0 ? void 0 : _applicationData9$add2.BPA_GAUSHALA_CHARGES_CESS)) {
7063
+ if (parseInt(sessionStorage.getItem("lessAdjusment")) > parseInt(sessionStorage.getItem("development")) + parseInt(sessionStorage.getItem("otherCharges")) + parseInt((_applicationData0 = applicationData) === null || _applicationData0 === void 0 ? void 0 : (_applicationData0$add = _applicationData0.additionalDetails) === null || _applicationData0$add === void 0 ? void 0 : (_applicationData0$add2 = _applicationData0$add.selfCertificationCharges) === null || _applicationData0$add2 === void 0 ? void 0 : _applicationData0$add2.BPA_MALBA_CHARGES) + parseInt((_applicationData1 = applicationData) === null || _applicationData1 === void 0 ? void 0 : (_applicationData1$add = _applicationData1.additionalDetails) === null || _applicationData1$add === void 0 ? void 0 : (_applicationData1$add2 = _applicationData1$add.selfCertificationCharges) === null || _applicationData1$add2 === void 0 ? void 0 : _applicationData1$add2.BPA_LABOUR_CESS) + parseInt((_applicationData10 = applicationData) === null || _applicationData10 === void 0 ? void 0 : (_applicationData10$ad = _applicationData10.additionalDetails) === null || _applicationData10$ad === void 0 ? void 0 : (_applicationData10$ad2 = _applicationData10$ad.selfCertificationCharges) === null || _applicationData10$ad2 === void 0 ? void 0 : _applicationData10$ad2.BPA_WATER_CHARGES) + parseInt((_applicationData11 = applicationData) === null || _applicationData11 === void 0 ? void 0 : (_applicationData11$ad = _applicationData11.additionalDetails) === null || _applicationData11$ad === void 0 ? void 0 : (_applicationData11$ad2 = _applicationData11$ad.selfCertificationCharges) === null || _applicationData11$ad2 === void 0 ? void 0 : _applicationData11$ad2.BPA_GAUSHALA_CHARGES_CESS)) {
7060
7064
  closeModal();
7061
7065
  alert(t("Enterd Less Adjustment amount is invalid"));
7062
7066
  } else {
@@ -15382,7 +15386,7 @@ function DocumentsPreview({
15382
15386
  display: "flex",
15383
15387
  justifyContent: "flex-start"
15384
15388
  }
15385
- }, /*#__PURE__*/React.createElement(PDFSvg, null)), /*#__PURE__*/React.createElement("p", {
15389
+ }, /*#__PURE__*/React.createElement(PDFSvg$1, null)), /*#__PURE__*/React.createElement("p", {
15386
15390
  style: {
15387
15391
  marginTop: "8px",
15388
15392
  fontWeight: "bold",
@@ -15423,7 +15427,7 @@ function DocumentsPreview({
15423
15427
  display: "flex",
15424
15428
  justifyContent: "flex-start"
15425
15429
  }
15426
- }, /*#__PURE__*/React.createElement(PDFSvg, null)), /*#__PURE__*/React.createElement("p", {
15430
+ }, /*#__PURE__*/React.createElement(PDFSvg$1, null)), /*#__PURE__*/React.createElement("p", {
15427
15431
  style: {
15428
15432
  marginTop: "8px",
15429
15433
  fontWeight: "bold",
@@ -15488,7 +15492,7 @@ function DocumentsPreview({
15488
15492
  lineHeight: "15px",
15489
15493
  marginBottom: "10px"
15490
15494
  }
15491
- }, `${t(value === null || value === void 0 ? void 0 : value.docInfo)}`) : null, /*#__PURE__*/React.createElement(PDFSvg, null), /*#__PURE__*/React.createElement("p", {
15495
+ }, `${t(value === null || value === void 0 ? void 0 : value.docInfo)}`) : null, /*#__PURE__*/React.createElement(PDFSvg$1, null), /*#__PURE__*/React.createElement("p", {
15492
15496
  style: {
15493
15497
  marginTop: "8px",
15494
15498
  fontSize: "16px",
@@ -16177,7 +16181,7 @@ const PermissionCheck = ({
16177
16181
  } : {},
16178
16182
  placeholder: t("BPA_ENTER_PERMIT_CONDITIONS_LABEL")
16179
16183
  }), /*#__PURE__*/React.createElement(LinkButton$1, {
16180
- label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Close$f, {
16184
+ label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Close$g, {
16181
16185
  style: {
16182
16186
  float: "right",
16183
16187
  position: "relative",
@@ -16190,7 +16194,6 @@ const PermissionCheck = ({
16190
16194
  onClick: e => handleRemove(index)
16191
16195
  }))), /*#__PURE__*/React.createElement(LinkButton$1, {
16192
16196
  style: {
16193
- color: "#a82227",
16194
16197
  maxWidth: isMobile ? "fit-content" : "10%",
16195
16198
  marginRight: "3%"
16196
16199
  },
@@ -18174,6 +18177,285 @@ const PaymentHistory = ({
18174
18177
  }, "Total Payments: ", payments.length))));
18175
18178
  };
18176
18179
 
18180
+ const getTimelineAcknowledgementData = (workflowDetails, tenantInfo, pdfFiles = {}, t) => {
18181
+ var _workflowDetails$data, _workflowDetails$data2, _processInstances$, _processInstances$2, _processInstances$3, _timeline$, _timeline$2, _timeline$3, _timeline$4;
18182
+ console.log('pdfFiles', pdfFiles);
18183
+ const timeline = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline) || (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.timeline) || [];
18184
+ const processInstances = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.processInstances) || (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.processInstances) || [];
18185
+ const businessId = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$ = processInstances[0]) === null || _processInstances$ === void 0 ? void 0 : _processInstances$.businessId) || "N/A";
18186
+ const businessService = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$2 = processInstances[0]) === null || _processInstances$2 === void 0 ? void 0 : _processInstances$2.businessService) || "N/A";
18187
+ const moduleName = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$3 = processInstances[0]) === null || _processInstances$3 === void 0 ? void 0 : _processInstances$3.moduleName) || "N/A";
18188
+ const pdfDownloadLink = (documents, fileStoreId) => {
18189
+ var _downloadLink$split;
18190
+ const downloadLink = (documents === null || documents === void 0 ? void 0 : documents[fileStoreId]) || "";
18191
+ const formats = (downloadLink === null || downloadLink === void 0 ? void 0 : (_downloadLink$split = downloadLink.split(",")) === null || _downloadLink$split === void 0 ? void 0 : _downloadLink$split.filter(Boolean)) || [];
18192
+ return (formats === null || formats === void 0 ? void 0 : formats.find(link => !(link !== null && link !== void 0 && link.includes("large")) && !(link !== null && link !== void 0 && link.includes("medium")) && !(link !== null && link !== void 0 && link.includes("small")))) || (formats === null || formats === void 0 ? void 0 : formats[0]) || "";
18193
+ };
18194
+ const timelineRows = timeline.map((item, index) => {
18195
+ var _item$auditDetails, _item$auditDetails2, _item$assigner, _item$assigner2, _item$assigner3, _item$wfComment;
18196
+ const createdDate = (item === null || item === void 0 ? void 0 : (_item$auditDetails = item.auditDetails) === null || _item$auditDetails === void 0 ? void 0 : _item$auditDetails.created) || "N/A";
18197
+ const timing = (item === null || item === void 0 ? void 0 : (_item$auditDetails2 = item.auditDetails) === null || _item$auditDetails2 === void 0 ? void 0 : _item$auditDetails2.timing) || "N/A";
18198
+ const assignerName = (item === null || item === void 0 ? void 0 : (_item$assigner = item.assigner) === null || _item$assigner === void 0 ? void 0 : _item$assigner.name) || "N/A";
18199
+ const assignerType = (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.type) || "N/A";
18200
+ const mobileNumber = (item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.mobileNumber) || "N/A";
18201
+ const action = (item === null || item === void 0 ? void 0 : item.performedAction) || "N/A";
18202
+ const status = (item === null || item === void 0 ? void 0 : item.status) || (item === null || item === void 0 ? void 0 : item.state) || "N/A";
18203
+ const comment = (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "-";
18204
+ const documents = (item === null || item === void 0 ? void 0 : item.wfDocuments) || [];
18205
+ return {
18206
+ sNo: index + 1,
18207
+ action: t ? t(action) : action,
18208
+ status: t ? t(status) : status,
18209
+ assignerName,
18210
+ assignerType,
18211
+ mobileNumber,
18212
+ designation: assignerType,
18213
+ date: createdDate,
18214
+ time: timing,
18215
+ dateTime: `${createdDate} ${timing !== "N/A" ? timing : ""}`.trim(),
18216
+ comment,
18217
+ documents: documents.map(doc => ({
18218
+ name: (doc === null || doc === void 0 ? void 0 : doc.fileName) || (doc === null || doc === void 0 ? void 0 : doc.documentType) || "Document",
18219
+ type: (doc === null || doc === void 0 ? void 0 : doc.documentType) || "Document",
18220
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
18221
+ link: pdfDownloadLink(pdfFiles, doc === null || doc === void 0 ? void 0 : doc.fileStoreId)
18222
+ })),
18223
+ hasDocuments: documents.length > 0
18224
+ };
18225
+ });
18226
+ return {
18227
+ t,
18228
+ tenantId: (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.code) || "",
18229
+ tenantName: (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.name) || (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.i18nKey) || "Government Department",
18230
+ name: t ? t("TIMELINE_PDF_TITLE") : "Application Timeline",
18231
+ heading: t ? t("TIMELINE_PDF_HEADING") : "File Movement Report",
18232
+ businessId,
18233
+ businessService: t ? t(`CS_COMMON_${businessService === null || businessService === void 0 ? void 0 : businessService.toUpperCase()}`) : businessService,
18234
+ moduleName,
18235
+ currentStatus: t ? t((timeline === null || timeline === void 0 ? void 0 : (_timeline$ = timeline[0]) === null || _timeline$ === void 0 ? void 0 : _timeline$.status) || (timeline === null || timeline === void 0 ? void 0 : (_timeline$2 = timeline[0]) === null || _timeline$2 === void 0 ? void 0 : _timeline$2.state) || "N/A") : (timeline === null || timeline === void 0 ? void 0 : (_timeline$3 = timeline[0]) === null || _timeline$3 === void 0 ? void 0 : _timeline$3.status) || (timeline === null || timeline === void 0 ? void 0 : (_timeline$4 = timeline[0]) === null || _timeline$4 === void 0 ? void 0 : _timeline$4.state) || "N/A",
18236
+ generatedDate: new Date().toLocaleDateString("en-IN", {
18237
+ day: "2-digit",
18238
+ month: "long",
18239
+ year: "numeric"
18240
+ }),
18241
+ generatedDateTime: new Date().toLocaleString("en-IN", {
18242
+ day: "2-digit",
18243
+ month: "2-digit",
18244
+ year: "numeric",
18245
+ hour: "2-digit",
18246
+ minute: "2-digit",
18247
+ hour12: true
18248
+ }),
18249
+ timelineRows,
18250
+ totalSteps: timelineRows.length
18251
+ };
18252
+ };
18253
+
18254
+ const parseDate = dateStr => {
18255
+ if (!dateStr || dateStr === "N/A") return null;
18256
+ if (typeof dateStr === "string" && dateStr !== null && dateStr !== void 0 && dateStr.includes("/")) {
18257
+ const [day, month, year] = dateStr === null || dateStr === void 0 ? void 0 : dateStr.split("/");
18258
+ return new Date(year, month - 1, day);
18259
+ }
18260
+ return new Date(dateStr);
18261
+ };
18262
+ const calculateDays = (start, end) => {
18263
+ if (!start || !end) return "N/A";
18264
+ const startDate = parseDate(start);
18265
+ const endDate = parseDate(end);
18266
+ if (!startDate || !endDate || isNaN(startDate === null || startDate === void 0 ? void 0 : startDate.getTime()) || isNaN(endDate === null || endDate === void 0 ? void 0 : endDate.getTime())) {
18267
+ return "N/A";
18268
+ }
18269
+ const diffDays = Math.floor((endDate - startDate) / 86400000);
18270
+ return diffDays < 0 ? "N/A" : diffDays === 0 ? "0 Days" : `${diffDays} Days`;
18271
+ };
18272
+ const PDFSvg = React.memo(({
18273
+ width: _width = 85,
18274
+ height: _height = 100,
18275
+ style
18276
+ }) => /*#__PURE__*/React.createElement("svg", {
18277
+ style: style,
18278
+ xmlns: "http://www.w3.org/2000/svg",
18279
+ width: _width,
18280
+ height: _height,
18281
+ viewBox: "0 0 20 20",
18282
+ fill: "gray"
18283
+ }, /*#__PURE__*/React.createElement("path", {
18284
+ d: "M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"
18285
+ })));
18286
+ const pdfDownloadLink = (documents, fileStoreId) => {
18287
+ var _downloadLink$split;
18288
+ const downloadLink = (documents === null || documents === void 0 ? void 0 : documents[fileStoreId]) || "";
18289
+ const formats = (downloadLink === null || downloadLink === void 0 ? void 0 : (_downloadLink$split = downloadLink.split(",")) === null || _downloadLink$split === void 0 ? void 0 : _downloadLink$split.filter(Boolean)) || [];
18290
+ return (formats === null || formats === void 0 ? void 0 : formats.find(link => !(link !== null && link !== void 0 && link.includes("large")) && !(link !== null && link !== void 0 && link.includes("medium")) && !(link !== null && link !== void 0 && link.includes("small")))) || (formats === null || formats === void 0 ? void 0 : formats[0]) || "";
18291
+ };
18292
+ const TimelineDocument = React.memo(({
18293
+ value,
18294
+ Code,
18295
+ index
18296
+ }) => {
18297
+ const {
18298
+ isLoading,
18299
+ data
18300
+ } = Digit.Hooks.ads.useADSDocumentSearch({
18301
+ value
18302
+ }, {
18303
+ value
18304
+ }, Code, index);
18305
+ const documents = useMemo(() => {
18306
+ var _value$documents;
18307
+ const docs = value !== null && value !== void 0 && value.documents ? value === null || value === void 0 ? void 0 : (_value$documents = value.documents) === null || _value$documents === void 0 ? void 0 : _value$documents.documents : value;
18308
+ return (docs === null || docs === void 0 ? void 0 : docs.filter(doc => (doc === null || doc === void 0 ? void 0 : doc.documentType) === Code)) || [];
18309
+ }, [value, Code]);
18310
+ if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
18311
+ return /*#__PURE__*/React.createElement("div", {
18312
+ className: "timeline-docs-wrapper"
18313
+ }, documents === null || documents === void 0 ? void 0 : documents.map((document, idx) => {
18314
+ const documentLink = pdfDownloadLink(data === null || data === void 0 ? void 0 : data.pdfFiles, document === null || document === void 0 ? void 0 : document.fileStoreId);
18315
+ if (!documentLink) return null;
18316
+ return /*#__PURE__*/React.createElement("a", {
18317
+ key: idx,
18318
+ target: "_blank",
18319
+ rel: "noopener noreferrer",
18320
+ href: documentLink,
18321
+ className: "timeline-doc-link"
18322
+ }, /*#__PURE__*/React.createElement(PDFSvg, {
18323
+ className: "timeline-doc-icon"
18324
+ }));
18325
+ }));
18326
+ });
18327
+ const normalizeTimeline = workflowDetails => {
18328
+ var _workflowDetails$data;
18329
+ const rawTimeline = workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline;
18330
+ if (!rawTimeline || !Array.isArray(rawTimeline)) return [];
18331
+ return rawTimeline === null || rawTimeline === void 0 ? void 0 : rawTimeline.map((item, index) => {
18332
+ var _item$auditDetails, _item$auditDetails2, _item$assigner, _item$wfComment;
18333
+ const createdDate = (item === null || item === void 0 ? void 0 : (_item$auditDetails = item.auditDetails) === null || _item$auditDetails === void 0 ? void 0 : _item$auditDetails.created) || "N/A";
18334
+ const lastModified = (item === null || item === void 0 ? void 0 : (_item$auditDetails2 = item.auditDetails) === null || _item$auditDetails2 === void 0 ? void 0 : _item$auditDetails2.lastModified) || "N/A";
18335
+ return {
18336
+ id: index,
18337
+ state: item === null || item === void 0 ? void 0 : item.state,
18338
+ assignerName: (item === null || item === void 0 ? void 0 : (_item$assigner = item.assigner) === null || _item$assigner === void 0 ? void 0 : _item$assigner.name) || "N/A",
18339
+ performedAction: item === null || item === void 0 ? void 0 : item.performedAction,
18340
+ comment: (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "",
18341
+ documents: (item === null || item === void 0 ? void 0 : item.wfDocuments) || [],
18342
+ createdDate,
18343
+ lastModified,
18344
+ noOfDays: calculateDays(createdDate, lastModified)
18345
+ };
18346
+ });
18347
+ };
18348
+ const HEADER_FIELDS = [{
18349
+ label: "CM_TIMELINE_NAME",
18350
+ key: "assignerName"
18351
+ }, {
18352
+ label: "CM_TIMELINE_ACTION_TAKEN",
18353
+ key: "performedAction"
18354
+ }, {
18355
+ label: "CM_TIMELINE_ACTION_TAKEN_ON",
18356
+ key: "lastModified"
18357
+ }, {
18358
+ label: "CM_TIMELINE_DATE_RECEIVED",
18359
+ key: "createdDate"
18360
+ }, {
18361
+ label: "CM_TIMELINE_NO_OF_DAYS",
18362
+ key: "noOfDays"
18363
+ }];
18364
+ const TimelineCaption = React.memo(({
18365
+ checkpoint,
18366
+ t,
18367
+ onDownloadPDF
18368
+ }) => {
18369
+ var _checkpoint$documents, _checkpoint$documents2;
18370
+ return /*#__PURE__*/React.createElement("div", {
18371
+ className: "timeline-card"
18372
+ }, /*#__PURE__*/React.createElement("div", {
18373
+ className: "timeline-header"
18374
+ }, HEADER_FIELDS === null || HEADER_FIELDS === void 0 ? void 0 : HEADER_FIELDS.map(({
18375
+ label,
18376
+ key
18377
+ }) => /*#__PURE__*/React.createElement("div", {
18378
+ key: key,
18379
+ className: "timeline-header-item"
18380
+ }, /*#__PURE__*/React.createElement("span", {
18381
+ className: "timeline-label"
18382
+ }, t(label), ":"), /*#__PURE__*/React.createElement("span", {
18383
+ className: "timeline-value"
18384
+ }, t(checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint[key]) || "N/A")))), /*#__PURE__*/React.createElement("div", {
18385
+ className: "timeline-note"
18386
+ }, /*#__PURE__*/React.createElement("span", {
18387
+ className: "timeline-label"
18388
+ }, t("CM_TIMELINE_NOTE"), ":"), /*#__PURE__*/React.createElement("div", {
18389
+ className: "note-box"
18390
+ }, (checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.comment) || t("CM_TIMELINE_NO_COMMENTS"))), (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$documents = checkpoint.documents) === null || _checkpoint$documents === void 0 ? void 0 : _checkpoint$documents.length) > 0 && /*#__PURE__*/React.createElement("div", {
18391
+ className: "timeline-docs"
18392
+ }, /*#__PURE__*/React.createElement("span", {
18393
+ className: "timeline-label"
18394
+ }, t("CM_TIMELINE_DOCUMENT_ATTACHED"), ":"), checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$documents2 = checkpoint.documents) === null || _checkpoint$documents2 === void 0 ? void 0 : _checkpoint$documents2.map((doc, index) => /*#__PURE__*/React.createElement(TimelineDocument, {
18395
+ key: `${doc === null || doc === void 0 ? void 0 : doc.documentType}-${index}`,
18396
+ value: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.documents,
18397
+ Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
18398
+ index: index
18399
+ }))));
18400
+ });
18401
+ const ApplicationTimeline = ({
18402
+ workflowDetails,
18403
+ t
18404
+ }) => {
18405
+ var _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _timeline$;
18406
+ const details = (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.data) || workflowDetails;
18407
+ const timeline = useMemo(() => normalizeTimeline({
18408
+ data: details
18409
+ }), [details]);
18410
+ const currentState = workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : (_workflowDetails$data3 = _workflowDetails$data2.timeline) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3[0]) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.state;
18411
+ const {
18412
+ isLoading,
18413
+ data
18414
+ } = Digit.Hooks.ads.useADSDocumentSearch({
18415
+ value: (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data5 = workflowDetails.data) === null || _workflowDetails$data5 === void 0 ? void 0 : (_workflowDetails$data6 = _workflowDetails$data5.timeline) === null || _workflowDetails$data6 === void 0 ? void 0 : _workflowDetails$data6.flatMap(item => item === null || item === void 0 ? void 0 : item.wfDocuments)) || []
18416
+ }, {
18417
+ value: (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data7 = workflowDetails.data) === null || _workflowDetails$data7 === void 0 ? void 0 : (_workflowDetails$data8 = _workflowDetails$data7.timeline) === null || _workflowDetails$data8 === void 0 ? void 0 : _workflowDetails$data8.flatMap(item => item === null || item === void 0 ? void 0 : item.wfDocuments)) || []
18418
+ }, null, 0);
18419
+ console.log('data of doc hook', data);
18420
+ const handleDownloadPDF = useCallback(() => {
18421
+ if (!isLoading) {
18422
+ const tenantInfo = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY") || {};
18423
+ const acknowledgementData = getTimelineAcknowledgementData(workflowDetails, tenantInfo, (data === null || data === void 0 ? void 0 : data.pdfFiles) || {}, t);
18424
+ Digit.Utils.pdf.generateTimelinePDF(acknowledgementData);
18425
+ }
18426
+ }, [workflowDetails, data, t]);
18427
+ if (!(timeline !== null && timeline !== void 0 && timeline.length)) return null;
18428
+ if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
18429
+ return /*#__PURE__*/React.createElement("div", {
18430
+ className: "timeline-hoc-container"
18431
+ }, /*#__PURE__*/React.createElement("div", {
18432
+ className: "timeline-header-wrapper"
18433
+ }, /*#__PURE__*/React.createElement(CardSubHeader$1, {
18434
+ className: "timeline-subheader"
18435
+ }, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), /*#__PURE__*/React.createElement("span", {
18436
+ onClick: handleDownloadPDF,
18437
+ className: "download-button"
18438
+ }, t("CS_COMMON_DOWNLOAD"))), (timeline === null || timeline === void 0 ? void 0 : timeline.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
18439
+ isCompleted: true,
18440
+ label: t(timeline === null || timeline === void 0 ? void 0 : (_timeline$ = timeline[0]) === null || _timeline$ === void 0 ? void 0 : _timeline$.state),
18441
+ customChild: /*#__PURE__*/React.createElement(TimelineCaption, {
18442
+ checkpoint: timeline === null || timeline === void 0 ? void 0 : timeline[0],
18443
+ t: t,
18444
+ onDownloadPDF: handleDownloadPDF
18445
+ })
18446
+ }) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, timeline === null || timeline === void 0 ? void 0 : timeline.map(checkpoint => /*#__PURE__*/React.createElement(CheckPoint, {
18447
+ key: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.id,
18448
+ keyValue: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.id,
18449
+ isCompleted: (checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.state) === currentState,
18450
+ label: t(checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.state),
18451
+ customChild: /*#__PURE__*/React.createElement(TimelineCaption, {
18452
+ checkpoint: checkpoint,
18453
+ t: t,
18454
+ onDownloadPDF: handleDownloadPDF
18455
+ })
18456
+ }))));
18457
+ };
18458
+
18177
18459
  function ApplicationDetailsContent({
18178
18460
  applicationDetails,
18179
18461
  demandData,
@@ -18218,14 +18500,13 @@ function ApplicationDetailsContent({
18218
18500
  }) => value ? /*#__PURE__*/React.createElement(LinkButton$1, {
18219
18501
  style: {
18220
18502
  float: "right",
18221
- display: "inline",
18222
- background: "#fff"
18503
+ display: "inline"
18223
18504
  },
18224
18505
  label: t("View"),
18225
18506
  onClick: () => routeTo(value)
18226
18507
  }) : t("CS_NA")
18227
18508
  }];
18228
- console.log("TIMELINE", applicationDetails);
18509
+ console.log("TIMELINE", applicationDetails, moduleCode);
18229
18510
  useEffect(() => {
18230
18511
  const fetchPaymentHistory = async () => {
18231
18512
  if (window.location.href.includes("employee/ws") && applicationData !== null && applicationData !== void 0 && applicationData.connectionNo) {
@@ -18826,7 +19107,7 @@ function ApplicationDetailsContent({
18826
19107
  payments: payments
18827
19108
  }), moduleCode !== "WS" && moduleCode !== "SW" && moduleCode !== "OBPS" && moduleCode !== "BPAStakeholder" && moduleCode !== "BPAREG" && /*#__PURE__*/React.createElement(ApplicationHistory, {
18828
19109
  applicationData: applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData
18829
- }), showTimeLine && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.timeline) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.length) > 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BreakLine$1, null), ((workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.isLoading) || isDataLoading) && /*#__PURE__*/React.createElement(Loader, null), !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && !isDataLoading && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", {
19110
+ }), showTimeLine && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.timeline) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.length) > 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BreakLine$1, null), ((workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.isLoading) || isDataLoading) && /*#__PURE__*/React.createElement(Loader, null), !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && !isDataLoading && moduleCode !== "BPAREG" && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", {
18830
19111
  id: "timeline"
18831
19112
  }, /*#__PURE__*/React.createElement(CardSectionHeader$1, {
18832
19113
  style: {
@@ -18856,7 +19137,10 @@ function ApplicationDetailsContent({
18856
19137
  }))), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data19 = workflowDetails.data) === null || _workflowDetails$data19 === void 0 ? void 0 : (_workflowDetails$data20 = _workflowDetails$data19.timeline) === null || _workflowDetails$data20 === void 0 ? void 0 : _workflowDetails$data20.length) > 2 && /*#__PURE__*/React.createElement(LinkButton$1, {
18857
19138
  label: showAllTimeline ? t("COLLAPSE") : t("VIEW_TIMELINE"),
18858
19139
  onClick: toggleTimeline
18859
- })))), window.location.href.includes("/pt/") ? /*#__PURE__*/React.createElement(ActionBar$1, {
19140
+ }))), !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && !isDataLoading && moduleCode === "BPAREG" && /*#__PURE__*/React.createElement(ApplicationTimeline, {
19141
+ workflowDetails: workflowDetails,
19142
+ t: t
19143
+ })), window.location.href.includes("/pt/") ? /*#__PURE__*/React.createElement(ActionBar$1, {
18860
19144
  className: "clear-search-container",
18861
19145
  style: {
18862
19146
  display: "block"
@@ -20815,6 +21099,7 @@ const Acknowledgement = props => {
20815
21099
 
20816
21100
  const ActiveAndOpenSurveys = props => {
20817
21101
  var _userUlbs, _userUlbs2, _userUlbs3;
21102
+ const tableWrapperRef = useRef(null);
20818
21103
  const {
20819
21104
  userType
20820
21105
  } = props;
@@ -20868,6 +21153,15 @@ const ActiveAndOpenSurveys = props => {
20868
21153
  const GetCell = value => /*#__PURE__*/React.createElement("span", {
20869
21154
  className: "cell-text styled-cell"
20870
21155
  }, value);
21156
+ useEffect(() => {
21157
+ var _tableWrapperRef$curr;
21158
+ const el = (_tableWrapperRef$curr = tableWrapperRef.current) === null || _tableWrapperRef$curr === void 0 ? void 0 : _tableWrapperRef$curr.querySelector(".table");
21159
+ if (el) {
21160
+ el.style.overflowX = "auto";
21161
+ el.style.overflowY = "hidden";
21162
+ el.style.WebkitOverflowScrolling = "touch";
21163
+ }
21164
+ }, []);
20871
21165
  const columns = useMemo(() => {
20872
21166
  return [{
20873
21167
  Header: t("Survey Name"),
@@ -20886,15 +21180,6 @@ const ActiveAndOpenSurveys = props => {
20886
21180
  var _row$original, _row$original2;
20887
21181
  return (_row$original = row.original) !== null && _row$original !== void 0 && _row$original.startDate ? GetCell(format(new Date((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.startDate), "dd/MM/yyyy")) : "";
20888
21182
  }
20889
- }, {
20890
- Header: t("EVENTS_END_DATE_LABEL"),
20891
- accessor: "endDate",
20892
- Cell: ({
20893
- row
20894
- }) => {
20895
- var _row$original3, _row$original4;
20896
- return (_row$original3 = row.original) !== null && _row$original3 !== void 0 && _row$original3.endDate ? GetCell(format(new Date((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.endDate), "dd/MM/yyyy")) : "";
20897
- }
20898
21183
  }, {
20899
21184
  Header: t("Fill Survey"),
20900
21185
  accessor: "fillSurvey",
@@ -20952,6 +21237,7 @@ const ActiveAndOpenSurveys = props => {
20952
21237
  }
20953
21238
  });
20954
21239
  };
21240
+ let isMobile = Digit.Utils.browser.isMobile();
20955
21241
  return /*#__PURE__*/React.createElement("div", null, tenantId === "pb.punjab" && window.location.href.includes("/employee") ? /*#__PURE__*/React.createElement(Card$1, {
20956
21242
  style: {
20957
21243
  marginTop: "16px",
@@ -21006,7 +21292,32 @@ const ActiveAndOpenSurveys = props => {
21006
21292
  label: "Search",
21007
21293
  submit: "submit",
21008
21294
  onSubmit: fetchActiveAndOpenSurveys
21009
- })))) : null, /*#__PURE__*/React.createElement(Table, {
21295
+ })))) : null, /*#__PURE__*/React.createElement("div", null, isMobile ? /*#__PURE__*/React.createElement("div", {
21296
+ style: {
21297
+ display: "flex",
21298
+ flexDirection: "column",
21299
+ gap: "12px"
21300
+ }
21301
+ }, (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.map((survey, index) => /*#__PURE__*/React.createElement(Card$1, {
21302
+ key: index,
21303
+ style: {
21304
+ padding: "12px",
21305
+ borderRadius: "8px",
21306
+ boxShadow: "0px 2px 6px rgba(0,0,0,0.1)"
21307
+ }
21308
+ }, /*#__PURE__*/React.createElement("h3", {
21309
+ style: {
21310
+ fontSize: "16px",
21311
+ marginBottom: "8px"
21312
+ }
21313
+ }, survey === null || survey === void 0 ? void 0 : survey.surveyTitle), /*#__PURE__*/React.createElement("p", {
21314
+ style: {
21315
+ margin: "4px 0"
21316
+ }
21317
+ }, /*#__PURE__*/React.createElement("b", null, "Start:"), " ", survey !== null && survey !== void 0 && survey.startDate ? format(new Date(survey === null || survey === void 0 ? void 0 : survey.startDate), "dd/MM/yyyy") : "NA"), /*#__PURE__*/React.createElement(SubmitBar$1, {
21318
+ label: t("Start Survey"),
21319
+ onSubmit: () => handleStartSurvey(survey)
21320
+ }))) : /*#__PURE__*/React.createElement(Card$1, null, t("No Questions found"))) : /*#__PURE__*/React.createElement(Table, {
21010
21321
  t: t,
21011
21322
  data: data,
21012
21323
  totalRecords: count,
@@ -21020,12 +21331,8 @@ const ActiveAndOpenSurveys = props => {
21020
21331
  }
21021
21332
  };
21022
21333
  },
21023
- noResultsMessage: "No Questions found",
21024
- inboxStyles: {
21025
- overflowX: "scroll",
21026
- overflowY: "hidden"
21027
- }
21028
- }), loading && /*#__PURE__*/React.createElement(Loader, null));
21334
+ noResultsMessage: "No Questions found"
21335
+ })), loading && /*#__PURE__*/React.createElement(Loader, null));
21029
21336
  };
21030
21337
 
21031
21338
  const Heading$d = props => {
@@ -27013,60 +27320,59 @@ const StepWrapper = ({
27013
27320
  const {
27014
27321
  t
27015
27322
  } = useTranslation();
27016
- const stepStyle = isActive => ({
27323
+ const stepStyle = (isActive, isLast) => ({
27017
27324
  display: "flex",
27018
27325
  alignItems: "center",
27019
27326
  justifyContent: "flex-end",
27020
- flex: 1,
27021
- color: isActive ? "#3f51b5" : "#ccc",
27022
- padding: "10px 10px",
27023
- width: "260px"
27327
+ flex: "0 0 auto",
27328
+ color: isActive ? "#0D43A7" : "#9CA3AF",
27329
+ padding: "14px 12px",
27330
+ width: "260px",
27331
+ marginBottom: isLast ? "6px" : "18px"
27024
27332
  });
27025
27333
  const circleStyle = stepNumber => {
27026
- let backgroundColor;
27027
- if (stepNumber <= _currentStep) {
27028
- backgroundColor = "#0D43A7";
27029
- } else {
27030
- backgroundColor = "#FFFFFF";
27031
- }
27334
+ const completed = stepNumber <= _currentStep;
27032
27335
  return {
27033
- width: "60px",
27034
- height: "60px",
27336
+ width: "56px",
27337
+ height: "56px",
27035
27338
  borderRadius: "50%",
27036
- backgroundColor,
27037
- color: stepNumber <= _currentStep ? "white" : "black",
27339
+ background: completed ? "linear-gradient(135deg,#2563eb,#7c3aed)" : "#ffffff",
27340
+ color: completed ? "#ffffff" : "#0f172a",
27038
27341
  display: "flex",
27039
27342
  alignItems: "center",
27040
27343
  justifyContent: "center",
27041
- marginBottom: "10px",
27042
- fontWeight: "normal",
27344
+ marginBottom: "8px",
27345
+ fontWeight: 600,
27043
27346
  fontSize: "18px",
27044
- border: stepNumber > _currentStep ? "1px solid black" : "",
27347
+ border: completed ? "none" : "1px solid rgba(15,23,42,0.08)",
27348
+ boxShadow: completed ? "0 6px 18px rgba(37,99,235,0.18)" : "0 2px 6px rgba(2,6,23,0.04)",
27045
27349
  position: "relative"
27046
27350
  };
27047
27351
  };
27048
27352
  const labelStyle = {
27049
- fontSize: "18px",
27050
- color: "#1E1E1E",
27051
- fontWeight: "500",
27052
- fontFamily: "Noto Sans,sans-serif",
27053
- marginRight: "6px"
27353
+ fontSize: "16px",
27354
+ color: "#0f172a",
27355
+ fontWeight: 600,
27356
+ fontFamily: "Noto Sans, sans-serif",
27357
+ marginRight: "8px",
27358
+ textAlign: "right"
27054
27359
  };
27055
27360
  const stepNumberStyle = {
27056
- fontSize: "18px",
27057
- color: "#263238",
27058
- fontWeight: "400",
27059
- fontFamily: "Noto Sans,sans-serif",
27060
- margin: "0px 6px 0px 0px"
27361
+ fontSize: "14px",
27362
+ color: "#6b7280",
27363
+ fontWeight: 500,
27364
+ fontFamily: "Noto Sans, sans-serif",
27365
+ margin: "0 6px 0 0"
27061
27366
  };
27062
27367
  const lineStyle = {
27063
27368
  position: "absolute",
27064
- width: "2px",
27065
- height: "50px",
27066
- backgroundColor: "grey",
27369
+ width: "3px",
27370
+ height: "56px",
27371
+ backgroundColor: "rgba(15,23,42,0.06)",
27067
27372
  left: "50%",
27068
27373
  top: "100%",
27069
- transform: "translateX(-50%)"
27374
+ transform: "translateX(-50%)",
27375
+ borderRadius: "2px"
27070
27376
  };
27071
27377
  const isMobile = window.Digit.Utils.browser.isMobile();
27072
27378
  const totalSteps = _stepsList.length;
@@ -27076,22 +27382,25 @@ const StepWrapper = ({
27076
27382
  width: "100%",
27077
27383
  display: "flex",
27078
27384
  flexDirection: "row",
27079
- alignItems: "top",
27080
- justifyContent: "flex-start"
27385
+ alignItems: "flex-start",
27386
+ justifyContent: "flex-start",
27387
+ gap: "24px"
27081
27388
  }
27082
27389
  }, /*#__PURE__*/React.createElement("div", {
27083
27390
  className: "stepper-navigation-bar",
27084
27391
  style: {
27085
27392
  display: "flex",
27086
27393
  flexDirection: "column",
27087
- justifyContent: "space-between",
27088
- height: "50%",
27394
+ alignItems: "center",
27395
+ padding: "18px",
27396
+ minWidth: "120px",
27397
+ maxWidth: "320px",
27089
27398
  marginBottom: "20px"
27090
27399
  }
27091
27400
  }, [...Array(totalSteps)].map((_, index) => /*#__PURE__*/React.createElement("div", {
27092
27401
  className: "step-content",
27093
27402
  key: index,
27094
- style: stepStyle(index + 1 <= _currentStep)
27403
+ style: stepStyle(index + 1 <= _currentStep, index === totalSteps - 1)
27095
27404
  }, /*#__PURE__*/React.createElement("div", {
27096
27405
  className: "step-sub-content",
27097
27406
  style: {
@@ -27115,7 +27424,8 @@ const StepWrapper = ({
27115
27424
  className: "stepper-body",
27116
27425
  style: {
27117
27426
  width: "100%",
27118
- marginBottom: "20px"
27427
+ marginBottom: "20px",
27428
+ background: "transparent"
27119
27429
  }
27120
27430
  }, children));
27121
27431
  };
@@ -30842,13 +31152,15 @@ const LabelFieldPair = props => {
30842
31152
  };
30843
31153
 
30844
31154
  const LinkButton = props => {
31155
+ const hasSubmitBarClass = props.className && props.className.includes('submit-bar');
31156
+ const appliedStyle = hasSubmitBarClass ? props.style : {
31157
+ ...LinkButton.defaultProps.style,
31158
+ ...props.style
31159
+ };
30845
31160
  return /*#__PURE__*/React.createElement("button", {
30846
- className: `card-link cp ${props.className}`,
31161
+ className: `card-link cp ${props.className || ''}`,
30847
31162
  onClick: props.onClick,
30848
- style: {
30849
- ...props.style,
30850
- ...LinkButton.defaultProps.style
30851
- }
31163
+ style: appliedStyle
30852
31164
  }, props.label);
30853
31165
  };
30854
31166
  LinkButton.propTypes = {
@@ -30857,17 +31169,7 @@ LinkButton.propTypes = {
30857
31169
  style: propTypes.object
30858
31170
  };
30859
31171
  LinkButton.defaultProps = {
30860
- style: {
30861
- color: "#FFFFFF",
30862
- backgroundColor: "#2947A3",
30863
- border: "none",
30864
- borderRadius: "8px",
30865
- cursor: "pointer",
30866
- padding: "8px 16px",
30867
- display: "inline-block",
30868
- height: "35px",
30869
- fontSize: "18px"
30870
- }
31172
+ style: {}
30871
31173
  };
30872
31174
 
30873
31175
  const MobileNumber = props => {
@@ -30882,27 +31184,23 @@ const MobileNumber = props => {
30882
31184
  };
30883
31185
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
30884
31186
  className: "field-container"
30885
- }, !props.hideSpan ? /*#__PURE__*/React.createElement("span", {
31187
+ }, /*#__PURE__*/React.createElement("div", {
31188
+ className: `text-input ${user_type === "EMPLOYEE" ? "" : "text-mobile-input-width"} ${props.className}`,
30886
31189
  style: {
30887
- maxWidth: "50px",
30888
- marginTop: "unset",
30889
- ...props.labelStyle
30890
- },
30891
- className: "citizen-card-input citizen-card-input--front"
30892
- }, "+91") : null, /*#__PURE__*/React.createElement("div", {
30893
- className: `text-input ${user_type === "employee" ? "" : "text-mobile-input-width"} ${props.className}`
30894
- }, /*#__PURE__*/React.createElement("input", {
31190
+ position: "relative"
31191
+ }
31192
+ }, !props.hideSpan && /*#__PURE__*/React.createElement("span", {
31193
+ className: "mobile-number-prefix"
31194
+ }, "+91"), /*#__PURE__*/React.createElement("input", {
30895
31195
  type: "text",
30896
31196
  name: props.name,
30897
31197
  id: props.id,
30898
- className: `${user_type ? "employee-card-input" : "citizen-card-input"} ${props.disable && "disabled"} focus-visible ${props.errorStyle && "employee-card-input-error"}`,
31198
+ className: `${user_type ? "employee-card-input" : "citizen-card-input"} ${props.disable && "disabled"} focus-visible ${props.errorStyle && "employee-card-input-error"} ${!props.hideSpan ? "mobile-number-input-with-prefix" : ""}`,
30899
31199
  placeholder: props.placeholder,
30900
31200
  onChange: onChange,
30901
31201
  ref: props.inputRef,
30902
31202
  value: props.value,
30903
- style: {
30904
- ...props.style
30905
- },
31203
+ style: props.style,
30906
31204
  minLength: props.minlength,
30907
31205
  maxLength: props.maxlength,
30908
31206
  max: props.max,
@@ -31206,24 +31504,6 @@ const FormComposer = props => {
31206
31504
  }
31207
31505
  };
31208
31506
  console.log(props);
31209
- const buttonStyle = {
31210
- next: {
31211
- backgroundColor: "#3f51b5",
31212
- color: "white",
31213
- border: "none",
31214
- padding: "10px 20px",
31215
- cursor: "pointer",
31216
- marginLeft: "10px"
31217
- },
31218
- back: {
31219
- backgroundColor: "transparent",
31220
- color: "#3f51b5",
31221
- border: "1px solid #3f51b5",
31222
- padding: "10px 10px",
31223
- margin: "10px",
31224
- cursor: "pointer"
31225
- }
31226
- };
31227
31507
  const handleBackClick = () => {
31228
31508
  props.onBackClick && props.onBackClick(formData);
31229
31509
  };
@@ -31259,9 +31539,8 @@ const FormComposer = props => {
31259
31539
  disabled: isDisabled,
31260
31540
  className: "submitButtonNew"
31261
31541
  }), !props.submitInForm && props.label && /*#__PURE__*/React.createElement(ActionBar, null, props.currentStep > 1 && /*#__PURE__*/React.createElement("button", {
31262
- style: buttonStyle.back,
31263
31542
  onClick: handleBackClick,
31264
- className: "submit-bar"
31543
+ className: "submit-bar submit-bar-back"
31265
31544
  }, t("COMMON_BACK")), /*#__PURE__*/React.createElement(SubmitBar, {
31266
31545
  label: t(props.label),
31267
31546
  submit: "submit",
@@ -32242,6 +32521,213 @@ const FillSurveyNew = () => {
32242
32521
  return /*#__PURE__*/React.createElement(CitizenSurveyFormNew, null);
32243
32522
  };
32244
32523
 
32524
+ const Close$f = () => /*#__PURE__*/React.createElement("svg", {
32525
+ xmlns: "http://www.w3.org/2000/svg",
32526
+ viewBox: "0 0 24 24",
32527
+ fill: "#FFFFFF"
32528
+ }, /*#__PURE__*/React.createElement("path", {
32529
+ d: "M0 0h24v24H0V0z",
32530
+ fill: "none"
32531
+ }), /*#__PURE__*/React.createElement("path", {
32532
+ 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"
32533
+ }));
32534
+ const CloseBtn$f = props => {
32535
+ return /*#__PURE__*/React.createElement("div", {
32536
+ className: "icon-bg-secondary",
32537
+ onClick: props.onClick
32538
+ }, /*#__PURE__*/React.createElement(Close$f, null));
32539
+ };
32540
+ const SurveyModal = ({
32541
+ isOpen,
32542
+ onClose
32543
+ }) => {
32544
+ const history = useHistory();
32545
+ const {
32546
+ t
32547
+ } = useTranslation();
32548
+ const userInfo = Digit.UserService.getUser().info;
32549
+ const [loading, setLoading] = useState(false);
32550
+ const [data, setData] = useState([]);
32551
+ const tenantId = localStorage.getItem("CITIZEN.CITY");
32552
+ console.log(tenantId, "TENANTTTTTT");
32553
+ useEffect(() => {
32554
+ const cachedData = sessionStorage.getItem("survey_modal_data");
32555
+ if (cachedData) {
32556
+ try {
32557
+ const parsedData = JSON.parse(cachedData);
32558
+ setData(parsedData);
32559
+ } catch (e) {
32560
+ console.error("Failed to parse cached survey data", e);
32561
+ }
32562
+ }
32563
+ }, []);
32564
+ useEffect(() => {
32565
+ if (isOpen && tenantId && data.length === 0) {
32566
+ fetchActiveAndOpenSurveys();
32567
+ }
32568
+ }, [isOpen, tenantId, data.length]);
32569
+ function fetchActiveAndOpenSurveys() {
32570
+ setLoading(true);
32571
+ const payload = {
32572
+ tenantId: tenantId,
32573
+ active: true,
32574
+ openSurveyFlag: true
32575
+ };
32576
+ Digit.Surveys.searchSurvey(payload).then(response => {
32577
+ let tableData = response.Surveys.filter(item => item.active);
32578
+ tableData = tableData.sort((a, b) => b.auditDetails.lastModifiedTime - a.auditDetails.lastModifiedTime);
32579
+ setData(tableData);
32580
+ sessionStorage.setItem("survey_modal_data", JSON.stringify(tableData));
32581
+ setLoading(false);
32582
+ }).catch(error => {
32583
+ setLoading(false);
32584
+ console.error("Failed to fetch surveys", error);
32585
+ });
32586
+ }
32587
+ const handleStartSurvey = surveyDetails => {
32588
+ history.push({
32589
+ pathname: "/digit-ui/citizen/engagement/surveys/fill-survey",
32590
+ state: {
32591
+ surveyDetails: surveyDetails,
32592
+ userInfo: userInfo,
32593
+ userType: "citizen"
32594
+ }
32595
+ });
32596
+ onClose();
32597
+ };
32598
+ if (!isOpen) {
32599
+ return null;
32600
+ }
32601
+ return /*#__PURE__*/React.createElement(Modal, {
32602
+ headerBarMain: /*#__PURE__*/React.createElement("div", {
32603
+ style: {
32604
+ display: "flex",
32605
+ alignItems: "center",
32606
+ gap: "8px"
32607
+ }
32608
+ }, /*#__PURE__*/React.createElement("span", null, t("Active Surveys")), (data === null || data === void 0 ? void 0 : data.length) > 0 && /*#__PURE__*/React.createElement("span", {
32609
+ style: {
32610
+ background: "#2563eb",
32611
+ color: "#fff",
32612
+ borderRadius: "12px",
32613
+ padding: "2px 8px",
32614
+ fontSize: "12px",
32615
+ fontWeight: "600"
32616
+ }
32617
+ }, data.length)),
32618
+ headerBarEnd: /*#__PURE__*/React.createElement(CloseBtn$f, {
32619
+ onClick: onClose
32620
+ }),
32621
+ hideSubmit: true,
32622
+ popupStyles: {
32623
+ width: "95%",
32624
+ maxWidth: "600px",
32625
+ height: "auto",
32626
+ maxHeight: "90vh",
32627
+ borderRadius: "16px",
32628
+ boxShadow: "0 20px 60px rgba(0, 0, 0, 0.15)",
32629
+ padding: "15px"
32630
+ },
32631
+ popupModuleMianStyles: {
32632
+ maxHeight: "calc(90vh - 120px)",
32633
+ overflowY: "auto",
32634
+ padding: "24px",
32635
+ backgroundColor: "#f9fafb"
32636
+ }
32637
+ }, /*#__PURE__*/React.createElement("div", {
32638
+ className: "survey-modal-wrapper"
32639
+ }, loading ? /*#__PURE__*/React.createElement("div", {
32640
+ className: "survey-modal-loader"
32641
+ }, /*#__PURE__*/React.createElement(Loader, null)) : data && data.length > 0 ? /*#__PURE__*/React.createElement("div", {
32642
+ className: "new-card-cards-grid"
32643
+ }, data === null || data === void 0 ? void 0 : data.map((survey, index) => /*#__PURE__*/React.createElement("div", {
32644
+ key: index,
32645
+ className: "new-card-option"
32646
+ }, /*#__PURE__*/React.createElement("h3", {
32647
+ style: {
32648
+ margin: "0 0 16px 0",
32649
+ fontSize: "16px",
32650
+ fontWeight: "600",
32651
+ color: "#1a202c"
32652
+ }
32653
+ }, survey === null || survey === void 0 ? void 0 : survey.surveyTitle), /*#__PURE__*/React.createElement("div", {
32654
+ style: {
32655
+ display: "flex",
32656
+ flexDirection: "column",
32657
+ gap: "12px",
32658
+ marginBottom: "16px"
32659
+ }
32660
+ }, /*#__PURE__*/React.createElement("div", {
32661
+ style: {
32662
+ fontSize: "12px"
32663
+ }
32664
+ }, /*#__PURE__*/React.createElement("span", {
32665
+ style: {
32666
+ color: "#6b7280",
32667
+ fontWeight: "600"
32668
+ }
32669
+ }, "Start Date:"), /*#__PURE__*/React.createElement("p", {
32670
+ style: {
32671
+ margin: "4px 0 0 0",
32672
+ color: "#1f2937",
32673
+ fontSize: "14px"
32674
+ }
32675
+ }, survey !== null && survey !== void 0 && survey.startDate ? format(new Date(survey === null || survey === void 0 ? void 0 : survey.startDate), "dd/MM/yyyy") : "NA")), (survey === null || survey === void 0 ? void 0 : survey.endDate) && /*#__PURE__*/React.createElement("div", {
32676
+ style: {
32677
+ fontSize: "12px"
32678
+ }
32679
+ }, /*#__PURE__*/React.createElement("span", {
32680
+ style: {
32681
+ color: "#6b7280",
32682
+ fontWeight: "600"
32683
+ }
32684
+ }, "End Date:"), /*#__PURE__*/React.createElement("p", {
32685
+ style: {
32686
+ margin: "4px 0 0 0",
32687
+ color: "#1f2937",
32688
+ fontSize: "14px"
32689
+ }
32690
+ }, format(new Date(survey === null || survey === void 0 ? void 0 : survey.endDate), "dd/MM/yyyy"))), /*#__PURE__*/React.createElement("div", {
32691
+ style: {
32692
+ fontSize: "12px"
32693
+ }
32694
+ }, /*#__PURE__*/React.createElement("span", {
32695
+ style: {
32696
+ color: "#6b7280",
32697
+ fontWeight: "600"
32698
+ }
32699
+ }, "Description:"), /*#__PURE__*/React.createElement("p", {
32700
+ style: {
32701
+ margin: "4px 0 0 0",
32702
+ color: "#1f2937",
32703
+ fontSize: "14px",
32704
+ lineHeight: "1.4"
32705
+ }
32706
+ }, (survey === null || survey === void 0 ? void 0 : survey.surveyDescription) || "No description available"))), /*#__PURE__*/React.createElement(SubmitBar$1, {
32707
+ label: t("Start Survey"),
32708
+ onSubmit: () => handleStartSurvey(survey)
32709
+ })))) : /*#__PURE__*/React.createElement("div", {
32710
+ className: "survey-modal-empty-state",
32711
+ style: {
32712
+ textAlign: "center",
32713
+ padding: "40px 20px"
32714
+ }
32715
+ }, /*#__PURE__*/React.createElement("p", {
32716
+ style: {
32717
+ margin: "0 0 8px 0",
32718
+ fontSize: "16px",
32719
+ fontWeight: "500",
32720
+ color: "#374151"
32721
+ }
32722
+ }, t("No active surveys available at this time")), /*#__PURE__*/React.createElement("p", {
32723
+ style: {
32724
+ margin: "0",
32725
+ fontSize: "12px",
32726
+ color: "#6b7280"
32727
+ }
32728
+ }, "Please check back later for new surveys"))));
32729
+ };
32730
+
32245
32731
  const SurveyReducers = getRootReducer;
32246
32732
  const EventsBreadCrumb = ({
32247
32733
  location
@@ -32552,7 +33038,8 @@ const componentsToRegister = {
32552
33038
  SurveySummary,
32553
33039
  FillSurveyNew,
32554
33040
  FillSurveyEmp: FillSurvey,
32555
- FillQuestions
33041
+ FillQuestions,
33042
+ SurveyModal
32556
33043
  };
32557
33044
  const initEngagementComponents = () => {
32558
33045
  Object.entries(componentsToRegister).forEach(([key, value]) => {