@djb25/digit-ui-module-ekyc 1.0.75 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import React, { useState, useRef, useEffect, useMemo, createContext, useContext, isValidElement, cloneElement, createElement, useCallback, useReducer, Fragment } from 'react';
1
+ import React, { useState, useRef, useEffect, useMemo, Fragment, createContext, useContext, isValidElement, cloneElement, createElement, useCallback, useReducer } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { useHistory, Link, useParams, useLocation, useRouteMatch, Switch, Route, Redirect } from 'react-router-dom';
4
- import { PersonIcon, EmployeeModuleCard, FaChartBar, MdDownloadIcon, Loader, InboxLinks, Card, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, FaDatabase, FaFileAlt, Label, CustomTooltip, CardLabelError, SearchField, RadioButtons, InboxComposer, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, ActionBar, Menu, LinkButton, Toast, EditIcon, UploadFile, FormComposer, VerticalTimeline, Modal, Close, CollapsibleCardPage, DatePicker, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, CardHeader, CardText, CitizenHomeCard, DocumentIcon } from '@djb25/digit-ui-react-components';
4
+ import { PersonIcon, EmployeeModuleCard, FaChartBar, MdDownloadIcon, Loader, InboxLinks, Card, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Modal, CloseSvg, DateRange, FaDatabase, FaFileAlt, Label, CustomTooltip, CardLabelError, SearchField, RadioButtons, InboxComposer, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, ActionBar, Menu, LinkButton, Toast, EditIcon, UploadFile, FormComposer, VerticalTimeline, Close, CollapsibleCardPage, DatePicker, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, CardHeader, CardText, CitizenHomeCard, DocumentIcon } from '@djb25/digit-ui-react-components';
5
5
  import * as Chartjs from 'chart.js/auto';
6
6
  import Chartjs__default, { Chart } from 'chart.js/auto';
7
7
  import { FaBuilding, FaUser, FaClock, FaChartLine, FaUsers, FaCheckCircle } from 'react-icons/fa';
@@ -101,39 +101,32 @@ const EKYCCard = () => {
101
101
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
102
102
  };
103
103
 
104
- // A type of promise-like that resolves synchronously and supports only one observer
105
-
106
- const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
107
-
108
- const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
109
-
110
- // Asynchronously call a function and send errors to recovery continuation
104
+ const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
105
+ const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
111
106
  function _catch(body, recover) {
112
- try {
113
- var result = body();
114
- } catch(e) {
115
- return recover(e);
116
- }
117
- if (result && result.then) {
118
- return result.then(void 0, recover);
119
- }
120
- return result;
107
+ try {
108
+ var result = body();
109
+ } catch (e) {
110
+ return recover(e);
111
+ }
112
+ if (result && result.then) {
113
+ return result.then(void 0, recover);
114
+ }
115
+ return result;
121
116
  }
122
-
123
- // Asynchronously await a promise and pass the result to a finally continuation
124
117
  function _finallyRethrows(body, finalizer) {
125
- try {
126
- var result = body();
127
- } catch (e) {
128
- return finalizer(true, e);
129
- }
130
- if (result && result.then) {
131
- return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
132
- }
133
- return finalizer(false, result);
118
+ try {
119
+ var result = body();
120
+ } catch (e) {
121
+ return finalizer(true, e);
122
+ }
123
+ if (result && result.then) {
124
+ return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
125
+ }
126
+ return finalizer(false, result);
134
127
  }
135
128
 
136
- const excludedKeys = ["status", "source", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
129
+ const excludedKeys = ["status", "source", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory", "firstName", "middleName", "lastName", "assembly", "ward", "pincode", "addressRaw", "mobileNo", "revisitCount", "consumerType", "occupantType", "knoCategory", "gender", "parentSpouse", "whatsappNo", "email", "landlineNo", "noOfPerson", "proofOfIdentityType", "documentNumber", "informantName", "informantRelation", "informantIsConsumer", "contactPerson", "relation", "entityName", "designation", "department", "employeeId", "ownerMobile", "ownerVerificationDone", "consentGiven", "flatHouseNumber", "streetName", "locality", "subLocality", "landmark", "latitude", "longitude", "gpsValid", "meterNumber", "meterMake", "meterStatus", "meterCondition", "meterLocation", "meterLocationAddress", "workingStatus", "sewerConnection", "septicTank", "lastBillRaised", "lastBillReceivedDate", "accessToMeter", "systemMeterId", "lastBillNotRaisedReason", "waterConnectionYears", "sewerConnectionYears", "pidNumber", "noOfFloor", "noOfRooms", "noOfBeds", "numberOfDwellingUnits", "floorNo", "userType", "tenantName", "tenantMobile", "houseBuiltDuration", "meterLatitude", "meterLongitude"];
137
130
  const createHeaderMapping = t => ({
138
131
  kno: t("KNO"),
139
132
  firstName: t("FIRST_NAME"),
@@ -178,15 +171,9 @@ const createHeaderMapping = t => ({
178
171
  relationship: t("RELATIONSHIP"),
179
172
  informantName: t("INFORMANT_NAME"),
180
173
  informantRelation: t("INFORMANT_RELATION"),
181
- informantIs: t("INFORMANT_IS"),
182
174
  contactPerson: t("CONTACT_PERSON"),
183
175
  relation: t("RELATION"),
184
- entityName: t("ENTITY_NAME"),
185
- designation: t("DESIGNATION"),
186
- department: t("DEPARTMENT"),
187
- employeeId: t("EMPLOYEE_ID"),
188
176
  ownerMobile: t("OWNER_MOBILE"),
189
- ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
190
177
  consentGiven: t("CONSENT_GIVEN"),
191
178
  proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
192
179
  documentNumber: t("DOCUMENT_NUMBER"),
@@ -1125,302 +1112,88 @@ function _extends() {
1125
1112
  }, _extends.apply(null, arguments);
1126
1113
  }
1127
1114
 
1128
- const downloadSurveyorPDF = function (_ref) {
1115
+ const EkycFilterModal = _ref => {
1129
1116
  let {
1130
- rows,
1131
- surveyorName,
1132
- employeeId,
1133
- mobileNumber,
1134
- vendorName,
1135
- supervisorName,
1136
- dashboardInfo,
1137
- t
1117
+ t,
1118
+ onApply,
1119
+ onClose,
1120
+ customDate,
1121
+ setCustomDate,
1122
+ ekycStatus,
1123
+ setEkycStatus
1138
1124
  } = _ref;
1139
- try {
1140
- const tenantId = Digit.ULBService.getCurrentTenantId();
1141
- const name = "Delhi Jal Board";
1142
- const email = "contact@delhijalboard.nic.in";
1143
- const phoneNumber = "+91-11-23538416";
1144
- const currentDate = new Date();
1145
- const formattedDate = currentDate.toLocaleDateString("en-IN", {
1146
- day: "2-digit",
1147
- month: "2-digit",
1148
- year: "numeric"
1149
- });
1150
- const formattedTime = currentDate.toLocaleTimeString("en-IN", {
1151
- hour: "2-digit",
1152
- minute: "2-digit",
1153
- second: "2-digit",
1154
- hour12: false
1155
- });
1156
- const downloadDateTime = `${formattedDate} ${formattedTime}`;
1157
- const isValDefined = val => val !== undefined && val !== null && val !== "";
1158
- const details = [{
1159
- title: t("SURVEYOR_DETAILS"),
1160
- asSectionHeader: true,
1161
- values: [{
1162
- title: t("SURVEYOR_NAME"),
1163
- value: surveyorName
1164
- }, {
1165
- title: t("MOBILE_NUMBER"),
1166
- value: mobileNumber
1167
- }, {
1168
- title: t("VENDOR_NAME"),
1169
- value: vendorName
1170
- }, {
1171
- title: t("SUPERVISOR_NAME"),
1172
- value: supervisorName
1173
- }].filter(item => isValDefined(item.value))
1174
- }, {
1175
- title: t("SUMMARY_STATISTICS"),
1176
- asSectionHeader: true,
1177
- values: [{
1178
- title: t("TOTAL_ASSIGNED"),
1179
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
1180
- }, {
1181
- title: t("COMPLETED"),
1182
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
1183
- }, {
1184
- title: t("PENDING"),
1185
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
1186
- }, {
1187
- title: t("SUBMITTED"),
1188
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
1189
- }].filter(item => isValDefined(item.value))
1190
- }];
1191
- if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
1192
- window.Digit.Utils.pdf.generateSurveyorReport({
1193
- tenantId,
1194
- logo: null,
1195
- name,
1196
- email,
1197
- phoneNumber,
1198
- heading: t("EKYC_SURVEYOR_REPORT"),
1199
- details,
1200
- applicationNumber: employeeId,
1201
- rows,
1202
- t,
1203
- hideApplicationNumber: true,
1204
- downloadTime: downloadDateTime
1205
- });
1206
- } else {
1207
- console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
1208
- }
1209
- return Promise.resolve();
1210
- } catch (e) {
1211
- return Promise.reject(e);
1212
- }
1213
- };
1214
- const downloadSupervisorPDF = function (_ref2) {
1215
- let {
1216
- rows,
1217
- supervisorName,
1218
- mobileNumber,
1219
- vendorName,
1220
- dashboardInfo,
1221
- t
1222
- } = _ref2;
1223
- try {
1224
- const tenantId = Digit.ULBService.getCurrentTenantId();
1225
- const name = "Delhi Jal Board";
1226
- const email = "contact@delhijalboard.nic.in";
1227
- const phoneNumber = "+91-11-23538416";
1228
- const currentDate = new Date();
1229
- const formattedDate = currentDate.toLocaleDateString("en-IN", {
1230
- day: "2-digit",
1231
- month: "2-digit",
1232
- year: "numeric"
1233
- });
1234
- const formattedTime = currentDate.toLocaleTimeString("en-IN", {
1235
- hour: "2-digit",
1236
- minute: "2-digit",
1237
- second: "2-digit",
1238
- hour12: false
1239
- });
1240
- const downloadDateTime = `${formattedDate} ${formattedTime}`;
1241
- const isValDefined = val => val !== undefined && val !== null && val !== "";
1242
- const details = [{
1243
- title: t("SUPERVISOR_DETAILS") || "Supervisor Details",
1244
- asSectionHeader: true,
1245
- values: [{
1246
- title: t("SUPERVISOR_NAME") || "Supervisor Name",
1247
- value: supervisorName
1248
- }, {
1249
- title: t("MOBILE_NUMBER") || "Mobile Number",
1250
- value: mobileNumber
1251
- }, {
1252
- title: t("VENDOR_NAME") || "Vendor Name",
1253
- value: vendorName
1254
- }].filter(item => isValDefined(item.value))
1255
- }, {
1256
- title: t("SUMMARY_STATISTICS") || "Summary Statistics",
1257
- asSectionHeader: true,
1258
- values: [{
1259
- title: t("TOTAL_ASSIGNED") || "Total Assigned",
1260
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
1261
- }, {
1262
- title: t("COMPLETED") || "Completed",
1263
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
1264
- }, {
1265
- title: t("PENDING") || "Pending",
1266
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
1267
- }, {
1268
- title: t("SUBMITTED") || "Submitted",
1269
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
1270
- }].filter(item => isValDefined(item.value))
1271
- }];
1272
- const mappedRows = rows.map(row => {
1273
- var _row$owner, _row$owner2;
1274
- return {
1275
- kno: row.name || ((_row$owner = row.owner) === null || _row$owner === void 0 ? void 0 : _row$owner.name) || "N/A",
1276
- firstName: ((_row$owner2 = row.owner) === null || _row$owner2 === void 0 ? void 0 : _row$owner2.mobileNumber) || row.mobileNo || "N/A",
1277
- lastName: "",
1278
- mobileNo: row.status || "N/A",
1279
- zoneName: String(row.total || 0),
1280
- ekycStatus: `${row.completed || 0} / ${row.pending || 0}`,
1281
- progress: row.progress || "0%",
1282
- submittedAt: null
1283
- };
1284
- });
1285
- const customT = key => {
1286
- if (key === "KNO") return t("SURVEYOR_NAME") || "Surveyor Name";
1287
- if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
1288
- if (key === "MOBILE") return t("STATUS") || "Status";
1289
- if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
1290
- if (key === "EKYC_STATUS") return t("COMPLETED_PENDING") || "Completed / Pending";
1291
- if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
1292
- if (key === "CONSUMER_LIST") return t("CONNECTED_SURVEYORS") || "Connected Surveyors";
1293
- return t(key);
1294
- };
1295
- try {
1296
- if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
1297
- window.Digit.Utils.pdf.generateSurveyorReport({
1298
- tenantId,
1299
- logo: null,
1300
- name,
1301
- email,
1302
- phoneNumber,
1303
- heading: t("EKYC_SUPERVISOR_REPORT") || "eKYC Supervisor Report",
1304
- details,
1305
- applicationNumber: mobileNumber,
1306
- rows: mappedRows,
1307
- t: customT,
1308
- hideApplicationNumber: true,
1309
- downloadTime: downloadDateTime
1310
- });
1311
- } else {
1312
- console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
1313
- }
1314
- } catch {}
1315
- return Promise.resolve();
1316
- } catch (e) {
1317
- return Promise.reject(e);
1318
- }
1319
- };
1320
- const downloadVendorPDF = function (_ref3) {
1321
- let {
1322
- rows,
1323
- vendorName,
1324
- mobileNumber,
1325
- email,
1326
- dashboardInfo,
1327
- t
1328
- } = _ref3;
1329
- try {
1330
- const tenantId = Digit.ULBService.getCurrentTenantId();
1331
- const name = "Delhi Jal Board";
1332
- const emailContact = "contact@delhijalboard.nic.in";
1333
- const phoneNumber = "+91-11-23538416";
1334
- const currentDate = new Date();
1335
- const formattedDate = currentDate.toLocaleDateString("en-IN", {
1336
- day: "2-digit",
1337
- month: "2-digit",
1338
- year: "numeric"
1339
- });
1340
- const formattedTime = currentDate.toLocaleTimeString("en-IN", {
1341
- hour: "2-digit",
1342
- minute: "2-digit",
1343
- second: "2-digit",
1344
- hour12: false
1345
- });
1346
- const downloadDateTime = `${formattedDate} ${formattedTime}`;
1347
- const isValDefined = val => val !== undefined && val !== null && val !== "";
1348
- const details = [{
1349
- title: t("VENDOR_DETAILS") || "Vendor Details",
1350
- asSectionHeader: true,
1351
- values: [{
1352
- title: t("VENDOR_NAME") || "Vendor Name",
1353
- value: vendorName
1354
- }, {
1355
- title: t("MOBILE_NUMBER") || "Mobile Number",
1356
- value: mobileNumber
1357
- }, {
1358
- title: t("EMAIL") || "Email",
1359
- value: email
1360
- }].filter(item => isValDefined(item.value))
1361
- }, {
1362
- title: t("SUMMARY_STATISTICS") || "Summary Statistics",
1363
- asSectionHeader: true,
1364
- values: [{
1365
- title: t("TOTAL_ASSIGNED") || "Total Assigned",
1366
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
1367
- }, {
1368
- title: t("TOTAL_EKYC_APPLICATIONS") || "Completed",
1369
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
1370
- }, {
1371
- title: t("PENDING") || "Pending",
1372
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
1373
- }, {
1374
- title: t("SUBMITTED") || "Submitted",
1375
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
1376
- }].filter(item => isValDefined(item.value))
1377
- }];
1378
- const mappedRows = rows.map(row => ({
1379
- kno: row.name || "N/A",
1380
- firstName: row.mobileNo || "N/A",
1381
- lastName: "",
1382
- mobileNo: row.status || "N/A",
1383
- zoneName: String(row.total || 0),
1384
- ekycStatus: `${row.completed || 0} / ${row.pending || 0}`,
1385
- progress: row.progress || "0%"
1386
- }));
1387
- const customT = key => {
1388
- if (key === "KNO") return t("SUPERVISOR_NAME") || "Supervisor Name";
1389
- if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
1390
- if (key === "MOBILE") return t("STATUS") || "Status";
1391
- if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
1392
- if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
1393
- if (key === "CONSUMER_LIST") return t("CONNECTED_SUPERVISORS") || "Connected Supervisors";
1394
- return t(key);
1395
- };
1396
- try {
1397
- if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
1398
- window.Digit.Utils.pdf.generateSurveyorReport({
1399
- tenantId,
1400
- logo: null,
1401
- name,
1402
- email: emailContact,
1403
- phoneNumber,
1404
- heading: t("EKYC_VENDOR_REPORT") || "eKYC Vendor Report",
1405
- details,
1406
- applicationNumber: mobileNumber,
1407
- rows: mappedRows,
1408
- t: customT,
1409
- hideApplicationNumber: true,
1410
- downloadTime: downloadDateTime
1411
- });
1412
- } else {
1413
- console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
1414
- }
1415
- } catch {}
1416
- return Promise.resolve();
1417
- } catch (e) {
1418
- return Promise.reject(e);
1419
- }
1125
+ const [isDatePickerOpen, setIsDatePickerOpen] = useState(false);
1126
+ const ekycStatusOptions = [{
1127
+ label: "All",
1128
+ value: "ALL"
1129
+ }, {
1130
+ label: "Submitted",
1131
+ value: "SUBMITTED"
1132
+ }, {
1133
+ label: "In Progress",
1134
+ value: "IN_PROGRESS"
1135
+ }, {
1136
+ label: "Revisit",
1137
+ value: "REVISIT"
1138
+ }];
1139
+ return /*#__PURE__*/React.createElement("div", {
1140
+ className: `ekyc-report-filter ${isDatePickerOpen ? "ekyc-report-filter--date-open" : ""}`
1141
+ }, /*#__PURE__*/React.createElement(Modal, {
1142
+ headerBarMain: "Download eKYC Report",
1143
+ headerBarEnd: /*#__PURE__*/React.createElement("button", {
1144
+ type: "button",
1145
+ onClick: onClose,
1146
+ "aria-label": "Close",
1147
+ className: "ekyc-filter-modal-close"
1148
+ }, /*#__PURE__*/React.createElement(CloseSvg, {
1149
+ height: "24",
1150
+ width: "24"
1151
+ })),
1152
+ actionSaveLabel: t("DOWNLOAD_REPORT"),
1153
+ actionSaveOnSubmit: onApply,
1154
+ actionCancelLabel: "Cancel",
1155
+ actionCancelOnSubmit: onClose,
1156
+ width: "fitContent"
1157
+ }, /*#__PURE__*/React.createElement("div", {
1158
+ className: "ekyc-filter-modal"
1159
+ }, /*#__PURE__*/React.createElement("section", {
1160
+ className: "ekyc-filter-modal-section"
1161
+ }, /*#__PURE__*/React.createElement("div", {
1162
+ className: "ekyc-filter-modal-section-header"
1163
+ }, /*#__PURE__*/React.createElement("span", {
1164
+ className: "ekyc-filter-modal-label"
1165
+ }, "eKYC Status"), /*#__PURE__*/React.createElement("span", {
1166
+ className: "ekyc-filter-modal-hint"
1167
+ }, "Select one")), /*#__PURE__*/React.createElement("div", {
1168
+ className: "ekyc-filter-modal-options"
1169
+ }, ekycStatusOptions.map(option => {
1170
+ const selected = ekycStatus === option.value;
1171
+ return /*#__PURE__*/React.createElement("button", {
1172
+ key: option.value,
1173
+ type: "button",
1174
+ onClick: () => setEkycStatus(option.value),
1175
+ className: selected ? "ekyc-filter-modal-option ekyc-filter-modal-option-selected" : "ekyc-filter-modal-option",
1176
+ "aria-pressed": selected
1177
+ }, option.label);
1178
+ }))), /*#__PURE__*/React.createElement("div", {
1179
+ className: "ekyc-filter-modal-divider"
1180
+ }), /*#__PURE__*/React.createElement("section", {
1181
+ className: "ekyc-filter-modal-section"
1182
+ }, /*#__PURE__*/React.createElement("div", {
1183
+ className: "ekyc-filter-modal-label"
1184
+ }, "Date Range"), /*#__PURE__*/React.createElement(DateRange, {
1185
+ values: customDate,
1186
+ t: t,
1187
+ hideLabel: true,
1188
+ onFilterChange: data => {
1189
+ setCustomDate(data.range);
1190
+ },
1191
+ onOpenChange: setIsDatePickerOpen
1192
+ })))));
1420
1193
  };
1421
1194
 
1422
1195
  const VendorDetailsCard = () => {
1423
- var _vendor$owner, _vendor$owner2, _vendorName$charAt, _progressData$supervi;
1196
+ var _Digit$SessionStorage, _vendor$owner, _vendor$owner2, _vendor$owner3, _vendor$owner4, _progressData$supervi;
1424
1197
  const {
1425
1198
  t
1426
1199
  } = useTranslation();
@@ -1429,6 +1202,10 @@ const VendorDetailsCard = () => {
1429
1202
  const {
1430
1203
  vendorId
1431
1204
  } = useParams();
1205
+ const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
1206
+ const targetVendorId = vendorId || (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid);
1207
+ const [showFilterModal, setShowFilterModal] = useState(false);
1208
+ const [ekycStatus, setEkycStatus] = useState("ALL");
1432
1209
  const {
1433
1210
  data: {
1434
1211
  vendor: [vendor] = []
@@ -1438,26 +1215,27 @@ const VendorDetailsCard = () => {
1438
1215
  tenantId,
1439
1216
  filters: {
1440
1217
  status: "ACTIVE",
1441
- ids: vendorId
1218
+ ids: targetVendorId
1442
1219
  },
1443
1220
  config: {
1444
1221
  enabled: !!tenantId,
1445
1222
  staleTime: 300000
1446
1223
  }
1447
1224
  });
1448
- const targetVendorId = vendorId || (vendor === null || vendor === void 0 ? void 0 : vendor.id) || (vendor === null || vendor === void 0 ? void 0 : vendor.vendorId);
1449
1225
  const {
1450
1226
  isLoading: isProgressLoading,
1451
1227
  data: progressData
1452
- } = Digit.Hooks.ekyc.useEkycAssignmentProgress(targetVendorId ? {
1228
+ } = Digit.Hooks.ekyc.useEkycAssignmentProgress({
1453
1229
  vendorId: targetVendorId
1454
- } : {}, {
1230
+ }, {
1455
1231
  enabled: !!tenantId,
1456
1232
  keepPreviousData: true
1457
1233
  });
1458
1234
  const vendorName = (vendor === null || vendor === void 0 ? void 0 : vendor.name) || "N/A";
1459
1235
  const mobileNumber = (vendor === null || vendor === void 0 ? void 0 : vendor.mobileNumber) || (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner = vendor.owner) === null || _vendor$owner === void 0 ? void 0 : _vendor$owner.mobileNumber) || "N/A";
1460
1236
  const email = (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner2 = vendor.owner) === null || _vendor$owner2 === void 0 ? void 0 : _vendor$owner2.emailId) || "N/A";
1237
+ const gender = (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner3 = vendor.owner) === null || _vendor$owner3 === void 0 ? void 0 : _vendor$owner3.gender) || "N/A";
1238
+ const ownerName = (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner4 = vendor.owner) === null || _vendor$owner4 === void 0 ? void 0 : _vendor$owner4.name) || "N/A";
1461
1239
  const zoneIds = useMemo(() => {
1462
1240
  var _vendor$zoneIds;
1463
1241
  return vendor !== null && vendor !== void 0 && (_vendor$zoneIds = vendor.zoneIds) !== null && _vendor$zoneIds !== void 0 && _vendor$zoneIds.length ? vendor.zoneIds.filter(Boolean).map(zone => String(zone).trim().toUpperCase()) : [];
@@ -1504,6 +1282,7 @@ const VendorDetailsCard = () => {
1504
1282
  const [ekycDownloadLoading, setEkycDownloadLoading] = useState(false);
1505
1283
  const handleDownloadEkycData = function (fromDate, toDate) {
1506
1284
  try {
1285
+ console.log(ekycStatus, fromDate, toDate);
1507
1286
  setEkycDownloadLoading(true);
1508
1287
  return Promise.resolve(_finallyRethrows(function () {
1509
1288
  return _catch(function () {
@@ -1512,6 +1291,7 @@ const VendorDetailsCard = () => {
1512
1291
  offset: 0,
1513
1292
  limit: 10000,
1514
1293
  vendorId: targetVendorId,
1294
+ ekycStatus: ekycStatus,
1515
1295
  reportDownload: true,
1516
1296
  ...(fromDate && {
1517
1297
  fromDate
@@ -1525,6 +1305,14 @@ const VendorDetailsCard = () => {
1525
1305
  alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
1526
1306
  return;
1527
1307
  }
1308
+ consumerList.forEach(item => {
1309
+ if (item.assignedTime) {
1310
+ item.assignedTime = new Date(item.assignedTime).toLocaleDateString("en-GB");
1311
+ }
1312
+ if (item.submittedAt) {
1313
+ item.submittedAt = new Date(item.submittedAt).toLocaleDateString("en-GB");
1314
+ }
1315
+ });
1528
1316
  const excelData = getEkycExcelData(consumerList, t);
1529
1317
  const cleanFileName = `eKYC_Data_${vendorName.replace(/[^a-zA-Z0-9]/g, "_")}`;
1530
1318
  Digit.Download.Excel(excelData, cleanFileName);
@@ -1542,47 +1330,28 @@ const VendorDetailsCard = () => {
1542
1330
  return Promise.reject(e);
1543
1331
  }
1544
1332
  };
1545
- const getDateRange = filter => {
1546
- const now = new Date();
1547
- const start = new Date(now);
1548
- if (filter === "today") {
1549
- start.setHours(0, 0, 0, 0);
1550
- return {
1551
- from: start,
1552
- to: now
1553
- };
1554
- }
1555
- if (filter === "week") {
1556
- start.setDate(now.getDate() - now.getDay());
1557
- start.setHours(0, 0, 0, 0);
1558
- return {
1559
- from: start,
1560
- to: now
1561
- };
1562
- }
1563
- if (filter === "month") {
1564
- start.setDate(1);
1565
- start.setHours(0, 0, 0, 0);
1566
- return {
1567
- from: start,
1568
- to: now
1569
- };
1333
+ const handleApplyFilters = function () {
1334
+ try {
1335
+ setShowFilterModal(false);
1336
+ return Promise.resolve(handleDownloadEkycData(customDate.startDate.getTime(), customDate.endDate.getTime())).then(function () {});
1337
+ } catch (e) {
1338
+ return Promise.reject(e);
1570
1339
  }
1571
- return null;
1572
1340
  };
1573
- const supervisorColumns = useMemo(() => [{
1341
+ const supervisorColumns = [{
1574
1342
  Header: t("SUPERVISOR_NAME") || "Supervisor Name",
1575
1343
  accessor: row => {
1576
1344
  var _row$original;
1577
1345
  return (row === null || row === void 0 ? void 0 : (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.supervisorName) || "N/A";
1578
1346
  },
1579
1347
  Cell: _ref => {
1580
- var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _row$original2, _row$original3;
1348
+ var _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4, _row$original2, _row$original3, _row$original4;
1581
1349
  let {
1582
1350
  row
1583
1351
  } = _ref;
1584
- const userType = ((_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.type) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.toLowerCase()) || "citizen";
1585
- const targetPath = `/digit-ui/${userType}/ekyc/supervisor-dashboard/${row === null || row === void 0 ? void 0 : (_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.supervisorId}`;
1352
+ console.log(row);
1353
+ const userType = ((_Digit$SessionStorage2 = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.info) === null || _Digit$SessionStorage3 === void 0 ? void 0 : (_Digit$SessionStorage4 = _Digit$SessionStorage3.type) === null || _Digit$SessionStorage4 === void 0 ? void 0 : _Digit$SessionStorage4.toLowerCase()) || "citizen";
1354
+ const targetPath = `/digit-ui/${userType}/ekyc/supervisor-dashboard/${row === null || row === void 0 ? void 0 : (_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.supervisorId}/${row === null || row === void 0 ? void 0 : (_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.vendorId}`;
1586
1355
  return /*#__PURE__*/React.createElement("a", {
1587
1356
  href: targetPath,
1588
1357
  style: {
@@ -1594,7 +1363,7 @@ const VendorDetailsCard = () => {
1594
1363
  e.preventDefault();
1595
1364
  history.push(targetPath);
1596
1365
  }
1597
- }, (row === null || row === void 0 ? void 0 : (_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.supervisorName) || "N/A");
1366
+ }, (row === null || row === void 0 ? void 0 : (_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.supervisorName) || "N/A");
1598
1367
  }
1599
1368
  }, {
1600
1369
  Header: t("MOBILE_NUMBER") || "Mobile Number",
@@ -1612,6 +1381,16 @@ const VendorDetailsCard = () => {
1612
1381
  className: `status-badge verified`
1613
1382
  }, t(value) || value);
1614
1383
  }
1384
+ }, {
1385
+ Header: t("ASSIGNED_ZONE") || "Assigned Zone",
1386
+ accessor: row => (row === null || row === void 0 ? void 0 : row.assignedZoneId) || "",
1387
+ id: "zone",
1388
+ Cell: _ref3 => {
1389
+ let {
1390
+ value
1391
+ } = _ref3;
1392
+ return t(value) || value;
1393
+ }
1615
1394
  }, {
1616
1395
  Header: t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications",
1617
1396
  accessor: row => (row === null || row === void 0 ? void 0 : row.totalKnos) || 0,
@@ -1628,91 +1407,24 @@ const VendorDetailsCard = () => {
1628
1407
  Header: t("OVERALL_PROGRESS") || "Overall Progress",
1629
1408
  accessor: row => `${(row === null || row === void 0 ? void 0 : row.progressPercent) || 0}%`,
1630
1409
  id: "overallProgress"
1631
- }], [t, history]);
1632
- const [showReportMenu, setShowReportMenu] = useState(false);
1633
- const [customDate, setCustomDate] = useState({
1634
- from: "",
1635
- to: ""
1636
- });
1637
- const [showCustomPicker, setShowCustomPicker] = useState(false);
1638
- const [reportLoading, setReportLoading] = useState(false);
1410
+ }];
1411
+ const [customDate, setCustomDate] = useState("");
1639
1412
  const reportMenuRef = useRef(null);
1640
1413
  useEffect(() => {
1641
1414
  const handler = e => {
1642
- if (reportMenuRef.current && !reportMenuRef.current.contains(e.target)) {
1643
- setShowReportMenu(false);
1644
- setShowCustomPicker(false);
1645
- }
1415
+ if (reportMenuRef.current && !reportMenuRef.current.contains(e.target)) ;
1646
1416
  };
1647
1417
  document.addEventListener("mousedown", handler);
1648
1418
  return () => document.removeEventListener("mousedown", handler);
1649
1419
  }, []);
1650
- const handleDownload = () => {
1651
- setReportLoading(true);
1652
- try {
1653
- const rowsWithStats = progressData === null || progressData === void 0 ? void 0 : progressData.supervisorReport.map(s => ({
1654
- name: s.supervisorName,
1655
- mobileNo: s.mobileNo,
1656
- total: s.totalKnos,
1657
- completed: s.submittedKnos,
1658
- pending: s.pendingKnos,
1659
- progress: `${s.progressPercent || 0}%`
1660
- }));
1661
- downloadVendorPDF({
1662
- rows: rowsWithStats,
1663
- vendorName,
1664
- mobileNumber,
1665
- email,
1666
- dashboardInfo: {
1667
- total: progressData === null || progressData === void 0 ? void 0 : progressData.totalKnosInZones,
1668
- completed: (progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnosInZones) + (progressData === null || progressData === void 0 ? void 0 : progressData.selfEkycCountInZones),
1669
- pending: progressData === null || progressData === void 0 ? void 0 : progressData.pendingKnosInZones,
1670
- submittedCount: progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnosInZones
1671
- },
1672
- t
1673
- });
1674
- } catch (err) {
1675
- console.error("Failed to generate report:", err);
1676
- } finally {
1677
- setReportLoading(false);
1678
- }
1679
- };
1680
- const handlePresetDownload = function (filter) {
1681
- try {
1682
- const range = getDateRange(filter);
1683
- if (!range) return Promise.resolve();
1684
- setShowReportMenu(false);
1685
- setShowCustomPicker(false);
1686
- return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
1687
- } catch (e) {
1688
- return Promise.reject(e);
1689
- }
1690
- };
1691
- const handleCustomDownload = function () {
1692
- try {
1693
- if (!customDate.from || !customDate.to) {
1694
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
1695
- return Promise.resolve();
1696
- }
1697
- const from = new Date(customDate.from);
1698
- from.setHours(0, 0, 0, 0);
1699
- const to = new Date(customDate.to);
1700
- to.setHours(23, 59, 59, 999);
1701
- setShowReportMenu(false);
1702
- setShowCustomPicker(false);
1703
- return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
1704
- } catch (e) {
1705
- return Promise.reject(e);
1706
- }
1707
- };
1708
- const StatCard = _ref3 => {
1420
+ const StatCard = _ref4 => {
1709
1421
  let {
1710
1422
  title,
1711
1423
  value,
1712
1424
  type,
1713
1425
  isLoading,
1714
1426
  icon
1715
- } = _ref3;
1427
+ } = _ref4;
1716
1428
  return /*#__PURE__*/React.createElement("div", {
1717
1429
  className: `stat-card ${type}`
1718
1430
  }, isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
@@ -1738,45 +1450,48 @@ const VendorDetailsCard = () => {
1738
1450
  }
1739
1451
  }, t("NO_VENDOR_FOUND") || "No Vendor Found"));
1740
1452
  }
1741
- return /*#__PURE__*/React.createElement(Card, {
1453
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Card, {
1742
1454
  className: "surveyor-dashboard"
1743
1455
  }, /*#__PURE__*/React.createElement("div", {
1744
1456
  className: "ekyc-dashboard-section"
1457
+ }, /*#__PURE__*/React.createElement("div", {
1458
+ className: "ekyc-details-wrapper"
1459
+ }, /*#__PURE__*/React.createElement("div", {
1460
+ className: "details-top-row"
1461
+ }, /*#__PURE__*/React.createElement("div", {
1462
+ className: "detail-item first-row"
1745
1463
  }, /*#__PURE__*/React.createElement("div", {
1746
1464
  className: "ekyc-dashboard-header"
1747
1465
  }, /*#__PURE__*/React.createElement("div", {
1748
- className: "avatar"
1749
- }, vendorName === null || vendorName === void 0 ? void 0 : (_vendorName$charAt = vendorName.charAt(0)) === null || _vendorName$charAt === void 0 ? void 0 : _vendorName$charAt.toUpperCase()), /*#__PURE__*/React.createElement("div", {
1750
1466
  className: "header-content"
1751
1467
  }, /*#__PURE__*/React.createElement("h2", {
1752
1468
  className: "name"
1753
1469
  }, vendorName), /*#__PURE__*/React.createElement("div", {
1754
1470
  className: "designation"
1755
- }, t("VENDOR_AGENCY") || "Agency / Vendor"))), /*#__PURE__*/React.createElement("div", {
1756
- className: "report-download"
1471
+ }, "(", t("VENDOR_AGENCY") || "Agency / Vendor", ")"))), /*#__PURE__*/React.createElement("div", {
1472
+ className: "report-download relative"
1757
1473
  }, /*#__PURE__*/React.createElement("button", {
1758
- className: "download-btn",
1759
- disabled: reportLoading,
1760
- onClick: handleDownload
1761
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
1762
- className: "stats-wrapper"
1763
- }, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
1764
- key: idx,
1765
- title: t(card.label),
1766
- value: card.count,
1767
- type: card.type,
1768
- isLoading: isPageLoading,
1769
- icon: card.icon
1770
- }))), /*#__PURE__*/React.createElement("div", {
1771
- className: "ekyc-dashboard-section"
1772
- }, /*#__PURE__*/React.createElement("div", {
1773
- className: "ekyc-details-wrapper"
1774
- }, /*#__PURE__*/React.createElement("div", {
1474
+ disabled: ekycDownloadLoading,
1475
+ className: `download-btn relative ${ekycDownloadLoading ? "disabled" : ""}`,
1476
+ onClick: () => setShowFilterModal(true)
1477
+ }, /*#__PURE__*/React.createElement(MdDownloadIcon, null), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading" : t("DOWNLOAD_REPORT") || "Download Report")))), /*#__PURE__*/React.createElement("div", {
1775
1478
  className: "details-top-row"
1776
1479
  }, /*#__PURE__*/React.createElement("div", {
1777
1480
  className: "detail-item"
1778
1481
  }, /*#__PURE__*/React.createElement("span", {
1779
1482
  className: "label"
1483
+ }, t("NAME")), /*#__PURE__*/React.createElement("span", {
1484
+ className: "value"
1485
+ }, ownerName)), /*#__PURE__*/React.createElement("div", {
1486
+ className: "detail-item"
1487
+ }, /*#__PURE__*/React.createElement("span", {
1488
+ className: "label"
1489
+ }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
1490
+ className: "value"
1491
+ }, gender)), /*#__PURE__*/React.createElement("div", {
1492
+ className: "detail-item"
1493
+ }, /*#__PURE__*/React.createElement("span", {
1494
+ className: "label"
1780
1495
  }, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
1781
1496
  className: "value"
1782
1497
  }, mobileNumber)), /*#__PURE__*/React.createElement("div", {
@@ -1785,97 +1500,34 @@ const VendorDetailsCard = () => {
1785
1500
  className: "label"
1786
1501
  }, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
1787
1502
  className: "value"
1788
- }, email)), /*#__PURE__*/React.createElement("div", {
1789
- className: "download-card"
1790
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format.")), /*#__PURE__*/React.createElement("div", {
1791
- className: "report-download",
1792
- ref: reportMenuRef
1793
- }, /*#__PURE__*/React.createElement("button", {
1794
- className: "download-excel-btn",
1795
- disabled: ekycDownloadLoading,
1796
- onClick: () => {
1797
- setShowReportMenu(p => !p);
1798
- setShowCustomPicker(false);
1799
- }
1800
- }, /*#__PURE__*/React.createElement(MdDownloadIcon, null), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
1801
- className: "report-menu"
1802
- }, [{
1803
- label: t("TODAY") || "Today",
1804
- key: "today"
1805
- }, {
1806
- label: t("THIS_WEEK") || "This Week",
1807
- key: "week"
1808
- }, {
1809
- label: t("THIS_MONTH") || "This Month",
1810
- key: "month"
1811
- }].map(_ref4 => {
1812
- let {
1813
- label,
1814
- key
1815
- } = _ref4;
1816
- return /*#__PURE__*/React.createElement("div", {
1817
- key: key,
1818
- className: "menu-item",
1819
- onClick: () => handlePresetDownload(key)
1820
- }, label);
1821
- }), /*#__PURE__*/React.createElement("div", {
1822
- className: "custom-date-trigger",
1823
- onClick: () => setShowCustomPicker(p => !p)
1824
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
1825
- className: "custom-picker"
1826
- }, /*#__PURE__*/React.createElement("div", {
1827
- className: "date-inputs"
1828
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
1829
- type: "date",
1830
- value: customDate.from,
1831
- onChange: e => setCustomDate({
1832
- ...customDate,
1833
- from: e.target.value
1834
- })
1835
- })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
1836
- type: "date",
1837
- value: customDate.to,
1838
- onChange: e => setCustomDate({
1839
- ...customDate,
1840
- to: e.target.value
1841
- })
1842
- }))), /*#__PURE__*/React.createElement("div", {
1843
- style: {
1844
- display: "flex",
1845
- gap: "10px",
1846
- marginTop: "10px"
1847
- }
1848
- }, /*#__PURE__*/React.createElement("button", {
1849
- className: "picker-cancel-btn",
1850
- onClick: () => {
1851
- setShowCustomPicker(false);
1852
- setCustomDate({
1853
- from: "",
1854
- to: ""
1855
- });
1856
- }
1857
- }, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
1858
- className: "picker-apply-btn",
1859
- onClick: handleCustomDownload
1860
- }, t("APPLY") || "Apply"))))))), /*#__PURE__*/React.createElement("div", {
1861
- className: "full-width-item"
1862
- }, /*#__PURE__*/React.createElement("span", {
1863
- className: "label"
1864
- }, t("ASSIGNED_ZONES") || "Assigned Zones"), /*#__PURE__*/React.createElement("span", {
1865
- className: "value"
1866
- }, zoneIds.length > 0 ? /*#__PURE__*/React.createElement("div", {
1867
- className: "selected-zones",
1868
- style: {
1869
- marginTop: "4px",
1870
- width: "100%",
1871
- display: "flex",
1872
- flexWrap: "wrap",
1873
- gap: "8px"
1503
+ }, email))), /*#__PURE__*/React.createElement("div", {
1504
+ className: "full-width-item"
1505
+ }, /*#__PURE__*/React.createElement("span", {
1506
+ className: "label"
1507
+ }, t("ASSIGNED_ZONES") || "Assigned Zones"), /*#__PURE__*/React.createElement("span", {
1508
+ className: "value"
1509
+ }, zoneIds.length > 0 ? /*#__PURE__*/React.createElement("div", {
1510
+ className: "selected-zones",
1511
+ style: {
1512
+ marginTop: "4px",
1513
+ width: "100%",
1514
+ display: "flex",
1515
+ flexWrap: "wrap",
1516
+ gap: "8px"
1874
1517
  }
1875
1518
  }, zoneIds.map(zone => /*#__PURE__*/React.createElement("span", {
1876
1519
  key: zone,
1877
1520
  className: "selected-zone-chip"
1878
- }, t(zone) || zone))) : "N/A")))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, {
1521
+ }, t(zone) || zone))) : "N/A")))), /*#__PURE__*/React.createElement("div", {
1522
+ className: "stats-wrapper"
1523
+ }, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
1524
+ key: idx,
1525
+ title: t(card.label),
1526
+ value: card.count,
1527
+ type: card.type,
1528
+ isLoading: isPageLoading,
1529
+ icon: card.icon
1530
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, {
1879
1531
  t: t,
1880
1532
  tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
1881
1533
  tableClass: "ekycTable",
@@ -1907,7 +1559,15 @@ const VendorDetailsCard = () => {
1907
1559
  setPageSize(Number(e.target.value));
1908
1560
  setCurrentPage(0);
1909
1561
  }
1910
- })));
1562
+ }))), showFilterModal && /*#__PURE__*/React.createElement(EkycFilterModal, {
1563
+ t: t,
1564
+ onClose: () => setShowFilterModal(false),
1565
+ onApply: handleApplyFilters,
1566
+ customDate: customDate,
1567
+ setCustomDate: setCustomDate,
1568
+ ekycStatus: ekycStatus,
1569
+ setEkycStatus: setEkycStatus
1570
+ }));
1911
1571
  };
1912
1572
 
1913
1573
  const useInboxTableConfig = _ref => {
@@ -2086,263 +1746,249 @@ const useInboxTableConfig = _ref => {
2086
1746
  };
2087
1747
  };
2088
1748
 
2089
- var isNullOrUndefined = (value) => value == null;
2090
-
2091
- const isObjectType = (value) => typeof value === 'object';
2092
- var isObject = (value) => !isNullOrUndefined(value) &&
2093
- !Array.isArray(value) &&
2094
- isObjectType(value) &&
2095
- !(value instanceof Date);
2096
-
2097
- var isKey = (value) => /^\w*$/.test(value);
2098
-
2099
- var compact = (value) => value.filter(Boolean);
2100
-
2101
- var stringToPath = (input) => compact(input
2102
- .replace(/["|']/g, '')
2103
- .replace(/\[/g, '.')
2104
- .replace(/\]/g, '')
2105
- .split('.'));
2106
-
2107
- function set(object, path, value) {
2108
- let index = -1;
2109
- const tempPath = isKey(path) ? [path] : stringToPath(path);
2110
- const length = tempPath.length;
2111
- const lastIndex = length - 1;
2112
- while (++index < length) {
2113
- const key = tempPath[index];
2114
- let newValue = value;
2115
- if (index !== lastIndex) {
2116
- const objValue = object[key];
2117
- newValue =
2118
- isObject(objValue) || Array.isArray(objValue)
2119
- ? objValue
2120
- : !isNaN(+tempPath[index + 1])
2121
- ? []
2122
- : {};
2123
- }
2124
- object[key] = newValue;
2125
- object = object[key];
2126
- }
2127
- return object;
1749
+ var isNullOrUndefined = value => value == null;
1750
+ const isObjectType = value => typeof value === 'object';
1751
+ var isObject = value => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !(value instanceof Date);
1752
+ var isKey = value => /^\w*$/.test(value);
1753
+ var compact = value => value.filter(Boolean);
1754
+ var stringToPath = input => compact(input.replace(/["|']/g, '').replace(/\[/g, '.').replace(/\]/g, '').split('.'));
1755
+ function set(object, path, value) {
1756
+ let index = -1;
1757
+ const tempPath = isKey(path) ? [path] : stringToPath(path);
1758
+ const length = tempPath.length;
1759
+ const lastIndex = length - 1;
1760
+ while (++index < length) {
1761
+ const key = tempPath[index];
1762
+ let newValue = value;
1763
+ if (index !== lastIndex) {
1764
+ const objValue = object[key];
1765
+ newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
1766
+ }
1767
+ object[key] = newValue;
1768
+ object = object[key];
1769
+ }
1770
+ return object;
2128
1771
  }
2129
-
2130
- var isUndefined = (val) => val === undefined;
2131
-
2132
- var get = (obj = {}, path, defaultValue) => {
2133
- const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => (isNullOrUndefined(result) ? result : result[key]), obj);
2134
- return isUndefined(result) || result === obj
2135
- ? isUndefined(obj[path])
2136
- ? defaultValue
2137
- : obj[path]
2138
- : result;
1772
+ var isUndefined = val => val === undefined;
1773
+ var get = function (obj, path, defaultValue) {
1774
+ if (obj === void 0) {
1775
+ obj = {};
1776
+ }
1777
+ const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
1778
+ return isUndefined(result) || result === obj ? isUndefined(obj[path]) ? defaultValue : obj[path] : result;
2139
1779
  };
2140
-
2141
- var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
2142
-
2143
- var isFunction = (value) => typeof value === 'function';
2144
-
2145
- var skipValidation = ({ isOnBlur, isOnChange, isOnTouch, isTouched, isReValidateOnBlur, isReValidateOnChange, isBlurEvent, isSubmitted, isOnAll, }) => {
2146
- if (isOnAll) {
2147
- return false;
2148
- }
2149
- else if (!isSubmitted && isOnTouch) {
2150
- return !(isTouched || isBlurEvent);
2151
- }
2152
- else if (isSubmitted ? isReValidateOnBlur : isOnBlur) {
2153
- return !isBlurEvent;
2154
- }
2155
- else if (isSubmitted ? isReValidateOnChange : isOnChange) {
2156
- return isBlurEvent;
2157
- }
2158
- return true;
1780
+ var isPrimitive = value => isNullOrUndefined(value) || !isObjectType(value);
1781
+ var isFunction = value => typeof value === 'function';
1782
+ var skipValidation = _ref8 => {
1783
+ let {
1784
+ isOnBlur,
1785
+ isOnChange,
1786
+ isOnTouch,
1787
+ isTouched,
1788
+ isReValidateOnBlur,
1789
+ isReValidateOnChange,
1790
+ isBlurEvent,
1791
+ isSubmitted,
1792
+ isOnAll
1793
+ } = _ref8;
1794
+ if (isOnAll) {
1795
+ return false;
1796
+ } else if (!isSubmitted && isOnTouch) {
1797
+ return !(isTouched || isBlurEvent);
1798
+ } else if (isSubmitted ? isReValidateOnBlur : isOnBlur) {
1799
+ return !isBlurEvent;
1800
+ } else if (isSubmitted ? isReValidateOnChange : isOnChange) {
1801
+ return isBlurEvent;
1802
+ }
1803
+ return true;
2159
1804
  };
2160
-
2161
- const isMatchFieldArrayName = (name, searchName) => RegExp(`^${searchName}([|.)\\d+`.replace(/\[/g, '\\[').replace(/\]/g, '\\]')).test(name);
2162
- var isNameInFieldArray = (names, name) => [...names].some((current) => isMatchFieldArrayName(name, current));
2163
-
2164
- /*! *****************************************************************************
2165
- Copyright (c) Microsoft Corporation.
2166
-
2167
- Permission to use, copy, modify, and/or distribute this software for any
2168
- purpose with or without fee is hereby granted.
2169
-
2170
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2171
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2172
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2173
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2174
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2175
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2176
- PERFORMANCE OF THIS SOFTWARE.
2177
- ***************************************************************************** */
2178
-
2179
- function __rest(s, e) {
2180
- var t = {};
2181
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
2182
- t[p] = s[p];
2183
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
2184
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2185
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
2186
- t[p[i]] = s[p[i]];
2187
- }
2188
- return t;
1805
+ const isMatchFieldArrayName = (name, searchName) => RegExp(`^${searchName}([|.)\\d+`.replace(/\[/g, '\\[').replace(/\]/g, '\\]')).test(name);
1806
+ var isNameInFieldArray = (names, name) => [...names].some(current => isMatchFieldArrayName(name, current));
1807
+ function __rest(s, e) {
1808
+ var t = {};
1809
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1810
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1811
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1812
+ }
1813
+ return t;
2189
1814
  }
2190
-
2191
- const FormContext = createContext(null);
2192
- FormContext.displayName = 'RHFContext';
2193
- const useFormContext = () => useContext(FormContext);
2194
-
2195
- var getInputValue = (event) => isPrimitive(event) ||
2196
- !isObject(event.target) ||
2197
- (isObject(event.target) && !event.type)
2198
- ? event
2199
- : isUndefined(event.target.value)
2200
- ? event.target.checked
2201
- : event.target.value;
2202
-
2203
- function useController({ name, rules, defaultValue, control, onFocus, }) {
2204
- const methods = useFormContext();
2205
- if (process.env.NODE_ENV !== 'production') {
2206
- if (!control && !methods) {
2207
- throw new Error('📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller');
2208
- }
2209
- }
2210
- const { defaultValuesRef, setValue, register, unregister, trigger, mode, reValidateMode: { isReValidateOnBlur, isReValidateOnChange }, formState, formStateRef: { current: { isSubmitted, touched, errors }, }, updateFormState, readFormStateRef, fieldsRef, fieldArrayNamesRef, shallowFieldsStateRef, } = control || methods.control;
2211
- const isNotFieldArray = !isNameInFieldArray(fieldArrayNamesRef.current, name);
2212
- const getInitialValue = () => !isUndefined(get(shallowFieldsStateRef.current, name)) && isNotFieldArray
2213
- ? get(shallowFieldsStateRef.current, name)
2214
- : isUndefined(defaultValue)
2215
- ? get(defaultValuesRef.current, name)
2216
- : defaultValue;
2217
- const [value, setInputStateValue] = useState(getInitialValue());
2218
- const valueRef = useRef(value);
2219
- const ref = useRef({
2220
- focus: () => null,
2221
- });
2222
- const onFocusRef = useRef(onFocus ||
2223
- (() => {
2224
- if (isFunction(ref.current.focus)) {
2225
- ref.current.focus();
2226
- }
2227
- if (process.env.NODE_ENV !== 'production') {
2228
- if (!isFunction(ref.current.focus)) {
2229
- console.warn(`📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method`);
2230
- }
2231
- }
2232
- }));
2233
- const shouldValidate = useCallback((isBlurEvent) => !skipValidation(Object.assign({ isBlurEvent,
2234
- isReValidateOnBlur,
2235
- isReValidateOnChange,
2236
- isSubmitted, isTouched: !!get(touched, name) }, mode)), [
2237
- isReValidateOnBlur,
2238
- isReValidateOnChange,
2239
- isSubmitted,
2240
- touched,
2241
- name,
2242
- mode,
2243
- ]);
2244
- const commonTask = useCallback(([event]) => {
2245
- const data = getInputValue(event);
2246
- setInputStateValue(data);
2247
- valueRef.current = data;
2248
- return data;
2249
- }, []);
2250
- const registerField = useCallback((shouldUpdateValue) => {
2251
- if (process.env.NODE_ENV !== 'production') {
2252
- if (!name) {
2253
- return console.warn('📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller');
2254
- }
2255
- }
2256
- if (fieldsRef.current[name]) {
2257
- fieldsRef.current[name] = Object.assign({ ref: fieldsRef.current[name].ref }, rules);
2258
- }
2259
- else {
2260
- register(Object.defineProperties({
2261
- name,
2262
- focus: onFocusRef.current,
2263
- }, {
2264
- value: {
2265
- set(data) {
2266
- setInputStateValue(data);
2267
- valueRef.current = data;
2268
- },
2269
- get() {
2270
- return valueRef.current;
2271
- },
2272
- },
2273
- }), rules);
2274
- shouldUpdateValue = isUndefined(get(defaultValuesRef.current, name));
2275
- }
2276
- shouldUpdateValue &&
2277
- isNotFieldArray &&
2278
- setInputStateValue(getInitialValue());
2279
- }, [rules, name, register]);
2280
- useEffect(() => () => unregister(name), [name]);
2281
- useEffect(() => {
2282
- if (process.env.NODE_ENV !== 'production') {
2283
- if (isUndefined(value)) {
2284
- console.warn(`📋 ${name} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`);
2285
- }
2286
- if (!isNotFieldArray && isUndefined(defaultValue)) {
2287
- console.warn('📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller');
2288
- }
2289
- }
2290
- registerField();
2291
- }, [registerField]);
2292
- useEffect(() => {
2293
- !fieldsRef.current[name] && registerField(true);
2294
- });
2295
- const onBlur = useCallback(() => {
2296
- if (readFormStateRef.current.touched && !get(touched, name)) {
2297
- set(touched, name, true);
2298
- updateFormState({
2299
- touched,
2300
- });
2301
- }
2302
- shouldValidate(true) && trigger(name);
2303
- }, [name, updateFormState, shouldValidate, trigger, readFormStateRef]);
2304
- const onChange = useCallback((...event) => setValue(name, commonTask(event), {
2305
- shouldValidate: shouldValidate(),
2306
- shouldDirty: true,
2307
- }), [setValue, name, shouldValidate]);
2308
- return {
2309
- field: {
2310
- onChange,
2311
- onBlur,
2312
- name,
2313
- value,
2314
- ref,
2315
- },
2316
- meta: Object.defineProperties({
2317
- invalid: !!get(errors, name),
2318
- }, {
2319
- isDirty: {
2320
- get() {
2321
- return !!get(formState.dirtyFields, name);
2322
- },
2323
- },
2324
- isTouched: {
2325
- get() {
2326
- return !!get(formState.touched, name);
2327
- },
2328
- },
2329
- }),
2330
- };
1815
+ const FormContext = createContext(null);
1816
+ FormContext.displayName = 'RHFContext';
1817
+ const useFormContext = () => useContext(FormContext);
1818
+ var getInputValue = event => isPrimitive(event) || !isObject(event.target) || isObject(event.target) && !event.type ? event : isUndefined(event.target.value) ? event.target.checked : event.target.value;
1819
+ function useController(_ref17) {
1820
+ let {
1821
+ name,
1822
+ rules,
1823
+ defaultValue,
1824
+ control,
1825
+ onFocus
1826
+ } = _ref17;
1827
+ const methods = useFormContext();
1828
+ if (process.env.NODE_ENV !== 'production') {
1829
+ if (!control && !methods) {
1830
+ throw new Error('📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller');
1831
+ }
1832
+ }
1833
+ const {
1834
+ defaultValuesRef,
1835
+ setValue,
1836
+ register,
1837
+ unregister,
1838
+ trigger,
1839
+ mode,
1840
+ reValidateMode: {
1841
+ isReValidateOnBlur,
1842
+ isReValidateOnChange
1843
+ },
1844
+ formState,
1845
+ formStateRef: {
1846
+ current: {
1847
+ isSubmitted,
1848
+ touched,
1849
+ errors
1850
+ }
1851
+ },
1852
+ updateFormState,
1853
+ readFormStateRef,
1854
+ fieldsRef,
1855
+ fieldArrayNamesRef,
1856
+ shallowFieldsStateRef
1857
+ } = control || methods.control;
1858
+ const isNotFieldArray = !isNameInFieldArray(fieldArrayNamesRef.current, name);
1859
+ const getInitialValue = () => !isUndefined(get(shallowFieldsStateRef.current, name)) && isNotFieldArray ? get(shallowFieldsStateRef.current, name) : isUndefined(defaultValue) ? get(defaultValuesRef.current, name) : defaultValue;
1860
+ const [value, setInputStateValue] = useState(getInitialValue());
1861
+ const valueRef = useRef(value);
1862
+ const ref = useRef({
1863
+ focus: () => null
1864
+ });
1865
+ const onFocusRef = useRef(onFocus || (() => {
1866
+ if (isFunction(ref.current.focus)) {
1867
+ ref.current.focus();
1868
+ }
1869
+ if (process.env.NODE_ENV !== 'production') {
1870
+ if (!isFunction(ref.current.focus)) {
1871
+ console.warn(`📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method`);
1872
+ }
1873
+ }
1874
+ }));
1875
+ const shouldValidate = useCallback(isBlurEvent => !skipValidation(Object.assign({
1876
+ isBlurEvent,
1877
+ isReValidateOnBlur,
1878
+ isReValidateOnChange,
1879
+ isSubmitted,
1880
+ isTouched: !!get(touched, name)
1881
+ }, mode)), [isReValidateOnBlur, isReValidateOnChange, isSubmitted, touched, name, mode]);
1882
+ const commonTask = useCallback(_ref18 => {
1883
+ let [event] = _ref18;
1884
+ const data = getInputValue(event);
1885
+ setInputStateValue(data);
1886
+ valueRef.current = data;
1887
+ return data;
1888
+ }, []);
1889
+ const registerField = useCallback(shouldUpdateValue => {
1890
+ if (process.env.NODE_ENV !== 'production') {
1891
+ if (!name) {
1892
+ return console.warn('📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller');
1893
+ }
1894
+ }
1895
+ if (fieldsRef.current[name]) {
1896
+ fieldsRef.current[name] = Object.assign({
1897
+ ref: fieldsRef.current[name].ref
1898
+ }, rules);
1899
+ } else {
1900
+ register(Object.defineProperties({
1901
+ name,
1902
+ focus: onFocusRef.current
1903
+ }, {
1904
+ value: {
1905
+ set(data) {
1906
+ setInputStateValue(data);
1907
+ valueRef.current = data;
1908
+ },
1909
+ get() {
1910
+ return valueRef.current;
1911
+ }
1912
+ }
1913
+ }), rules);
1914
+ shouldUpdateValue = isUndefined(get(defaultValuesRef.current, name));
1915
+ }
1916
+ shouldUpdateValue && isNotFieldArray && setInputStateValue(getInitialValue());
1917
+ }, [rules, name, register]);
1918
+ useEffect(() => () => unregister(name), [name]);
1919
+ useEffect(() => {
1920
+ if (process.env.NODE_ENV !== 'production') {
1921
+ if (isUndefined(value)) {
1922
+ console.warn(`📋 ${name} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`);
1923
+ }
1924
+ if (!isNotFieldArray && isUndefined(defaultValue)) {
1925
+ console.warn('📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller');
1926
+ }
1927
+ }
1928
+ registerField();
1929
+ }, [registerField]);
1930
+ useEffect(() => {
1931
+ !fieldsRef.current[name] && registerField(true);
1932
+ });
1933
+ const onBlur = useCallback(() => {
1934
+ if (readFormStateRef.current.touched && !get(touched, name)) {
1935
+ set(touched, name, true);
1936
+ updateFormState({
1937
+ touched
1938
+ });
1939
+ }
1940
+ shouldValidate(true) && trigger(name);
1941
+ }, [name, updateFormState, shouldValidate, trigger, readFormStateRef]);
1942
+ const onChange = useCallback(function () {
1943
+ for (var _len = arguments.length, event = new Array(_len), _key = 0; _key < _len; _key++) {
1944
+ event[_key] = arguments[_key];
1945
+ }
1946
+ return setValue(name, commonTask(event), {
1947
+ shouldValidate: shouldValidate(),
1948
+ shouldDirty: true
1949
+ });
1950
+ }, [setValue, name, shouldValidate]);
1951
+ return {
1952
+ field: {
1953
+ onChange,
1954
+ onBlur,
1955
+ name,
1956
+ value,
1957
+ ref
1958
+ },
1959
+ meta: Object.defineProperties({
1960
+ invalid: !!get(errors, name)
1961
+ }, {
1962
+ isDirty: {
1963
+ get() {
1964
+ return !!get(formState.dirtyFields, name);
1965
+ }
1966
+ },
1967
+ isTouched: {
1968
+ get() {
1969
+ return !!get(formState.touched, name);
1970
+ }
1971
+ }
1972
+ })
1973
+ };
2331
1974
  }
2332
-
2333
- const Controller = (props) => {
2334
- const { rules, as, render, defaultValue, control, onFocus } = props, rest = __rest(props, ["rules", "as", "render", "defaultValue", "control", "onFocus"]);
2335
- const { field, meta } = useController(props);
2336
- const componentProps = Object.assign(Object.assign({}, rest), field);
2337
- return as
2338
- ? isValidElement(as)
2339
- ? cloneElement(as, componentProps)
2340
- : createElement(as, componentProps)
2341
- : render
2342
- ? render(field, meta)
2343
- : null;
1975
+ const Controller = props => {
1976
+ const {
1977
+ rules,
1978
+ as,
1979
+ render,
1980
+ defaultValue,
1981
+ control,
1982
+ onFocus
1983
+ } = props,
1984
+ rest = __rest(props, ["rules", "as", "render", "defaultValue", "control", "onFocus"]);
1985
+ const {
1986
+ field,
1987
+ meta
1988
+ } = useController(props);
1989
+ const componentProps = Object.assign(Object.assign({}, rest), field);
1990
+ return as ? isValidElement(as) ? cloneElement(as, componentProps) : createElement(as, componentProps) : render ? render(field, meta) : null;
2344
1991
  };
2345
- //# sourceMappingURL=index.esm.js.map
2346
1992
 
2347
1993
  const SearchFormFieldsComponents = _ref => {
2348
1994
  let {
@@ -4716,9 +4362,7 @@ const VendorCardSkeleton = () => {
4716
4362
  className: "skeleton skeleton-subtitle"
4717
4363
  }))), /*#__PURE__*/React.createElement("div", {
4718
4364
  className: "skeleton skeleton-kno-badge"
4719
- })), /*#__PURE__*/React.createElement("div", {
4720
- className: "progress-section"
4721
- }, /*#__PURE__*/React.createElement("div", {
4365
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
4722
4366
  className: "skeleton skeleton-progress-bar"
4723
4367
  }), /*#__PURE__*/React.createElement("div", {
4724
4368
  className: "progress-label"
@@ -4779,87 +4423,83 @@ const AdminDashboard = () => {
4779
4423
  className: "section-title"
4780
4424
  }, t("EKYC_VENDORS_PERFORMANCE") || "eKYC Vendors Performance"), isProgressLoading ? /*#__PURE__*/React.createElement(VendorPerformanceSkeleton, null) : /*#__PURE__*/React.createElement("div", {
4781
4425
  className: "vendors-grid"
4782
- }, Array.isArray(progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports) && (progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports.length) && (progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports.map(vendor => {
4783
- var _vendor$vendorName, _vendor$vendorName$;
4784
- return /*#__PURE__*/React.createElement("div", {
4785
- key: vendor.vendorId,
4786
- className: "vendor-perf-card",
4787
- onClick: () => history.push(`/digit-ui/employee/ekyc/vendors/${vendor.vendorId}`)
4788
- }, /*#__PURE__*/React.createElement("div", {
4789
- className: "vendor-card-header"
4790
- }, /*#__PURE__*/React.createElement("div", {
4791
- className: "vendor-title"
4792
- }, /*#__PURE__*/React.createElement("div", {
4793
- className: "vendor-icon"
4794
- }, /*#__PURE__*/React.createElement("span", null, (_vendor$vendorName = vendor.vendorName) === null || _vendor$vendorName === void 0 ? void 0 : (_vendor$vendorName$ = _vendor$vendorName[0]) === null || _vendor$vendorName$ === void 0 ? void 0 : _vendor$vendorName$.toUpperCase())), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, vendor.vendorName), /*#__PURE__*/React.createElement("span", {
4795
- className: "vendor-subtitle"
4796
- }, t("EKYC_VENDOR") || "eKYC Vendor"))), /*#__PURE__*/React.createElement("div", {
4797
- className: "kno-count-badge"
4798
- }, /*#__PURE__*/React.createElement("span", {
4799
- className: "kno-count-label"
4800
- }, t("TOTAL_KNOS") || "Total KNOs", " -"), /*#__PURE__*/React.createElement("span", {
4801
- className: "kno-count-value"
4802
- }, vendor.totalKnosInZones))), /*#__PURE__*/React.createElement("div", {
4803
- className: "progress-section"
4804
- }, /*#__PURE__*/React.createElement("div", {
4805
- className: "progress-bar-container"
4806
- }, /*#__PURE__*/React.createElement("div", {
4807
- className: "progress-bar-fill",
4808
- style: {
4809
- width: `${vendor.progressPercent}%`
4810
- }
4811
- })), /*#__PURE__*/React.createElement("div", {
4812
- className: "progress-label"
4813
- }, /*#__PURE__*/React.createElement("span", null, t("PROGRESS") || "Progress"), /*#__PURE__*/React.createElement("span", null, vendor.progressPercent, "%"))), /*#__PURE__*/React.createElement("div", {
4814
- className: "stats-grid"
4815
- }, /*#__PURE__*/React.createElement("div", {
4816
- className: "stat-item"
4817
- }, /*#__PURE__*/React.createElement("span", {
4818
- className: "stat-value"
4819
- }, vendor.totalSupervisors), /*#__PURE__*/React.createElement("span", {
4820
- className: "stat-label"
4821
- }, t("SUPERVISORS") || "Supervisors")), /*#__PURE__*/React.createElement("div", {
4822
- className: "stat-item"
4823
- }, /*#__PURE__*/React.createElement("span", {
4824
- className: "stat-value"
4825
- }, vendor.totalSurveyors), /*#__PURE__*/React.createElement("span", {
4826
- className: "stat-label"
4827
- }, t("SURVEYORS") || "Surveyors")), /*#__PURE__*/React.createElement("div", {
4828
- className: "stat-item"
4829
- }, /*#__PURE__*/React.createElement("span", {
4830
- className: "stat-value"
4831
- }, vendor.totalAssignments), /*#__PURE__*/React.createElement("span", {
4832
- className: "stat-label"
4833
- }, t("TOTAL_EKYC_APPLICATIONS") || "Total KNOs"))), /*#__PURE__*/React.createElement("div", {
4834
- className: "knos-summary"
4835
- }, /*#__PURE__*/React.createElement("div", {
4836
- className: "kno-stat"
4837
- }, /*#__PURE__*/React.createElement("span", {
4838
- className: "kno-label"
4839
- }, t("SUBMITTED") || "Submitted"), /*#__PURE__*/React.createElement("strong", null, vendor.submittedKnosInZones)), /*#__PURE__*/React.createElement("div", {
4840
- className: "kno-stat pending"
4841
- }, /*#__PURE__*/React.createElement("span", {
4842
- className: "kno-label"
4843
- }, t("PENDING") || "Pending"), /*#__PURE__*/React.createElement("strong", null, vendor.pendingKnosInZones)), /*#__PURE__*/React.createElement("div", {
4844
- className: "kno-stat rejected"
4845
- }, /*#__PURE__*/React.createElement("span", {
4846
- className: "kno-label"
4847
- }, t("EKYC_SUBMITTED_BY_CITIZENS").toLowerCase() || "Submitted by citizen"), /*#__PURE__*/React.createElement("strong", null, vendor.selfEkycCountInZones))));
4848
- })))));
4426
+ }, Array.isArray(progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports) && (progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports.length) && (progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports.map(vendor => /*#__PURE__*/React.createElement("div", {
4427
+ key: vendor.vendorId,
4428
+ className: "vendor-perf-card",
4429
+ onClick: () => history.push(`/digit-ui/employee/ekyc/vendors/${vendor.vendorId}`)
4430
+ }, /*#__PURE__*/React.createElement("div", {
4431
+ className: "vendor-card-header"
4432
+ }, /*#__PURE__*/React.createElement("div", {
4433
+ className: "vendor-title"
4434
+ }, /*#__PURE__*/React.createElement("h4", null, vendor.vendorName)), /*#__PURE__*/React.createElement("div", {
4435
+ className: "kno-count-badge"
4436
+ }, /*#__PURE__*/React.createElement("span", {
4437
+ className: "kno-count-label"
4438
+ }, t("TOTAL_KNOS") || "Total KNOs", " -"), /*#__PURE__*/React.createElement("span", {
4439
+ className: "kno-count-value"
4440
+ }, vendor.totalKnosInZones))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
4441
+ className: "progress-bar-container"
4442
+ }, /*#__PURE__*/React.createElement("div", {
4443
+ className: "progress-bar-fill",
4444
+ style: {
4445
+ width: `${vendor.progressPercent}%`
4446
+ }
4447
+ })), /*#__PURE__*/React.createElement("div", {
4448
+ className: "progress-label"
4449
+ }, /*#__PURE__*/React.createElement("span", null, t("PROGRESS") || "Progress"), /*#__PURE__*/React.createElement("span", null, vendor.progressPercent, "%"))), /*#__PURE__*/React.createElement("div", {
4450
+ className: "stats-grid"
4451
+ }, /*#__PURE__*/React.createElement("div", {
4452
+ className: "stat-item"
4453
+ }, /*#__PURE__*/React.createElement("span", {
4454
+ className: "stat-value"
4455
+ }, vendor.totalSupervisors), /*#__PURE__*/React.createElement("span", {
4456
+ className: "stat-label"
4457
+ }, t("SUPERVISORS") || "Supervisors")), /*#__PURE__*/React.createElement("div", {
4458
+ className: "stat-item"
4459
+ }, /*#__PURE__*/React.createElement("span", {
4460
+ className: "stat-value"
4461
+ }, vendor.totalSurveyors), /*#__PURE__*/React.createElement("span", {
4462
+ className: "stat-label"
4463
+ }, t("SURVEYORS") || "Surveyors")), /*#__PURE__*/React.createElement("div", {
4464
+ className: "stat-item"
4465
+ }, /*#__PURE__*/React.createElement("span", {
4466
+ className: "stat-value"
4467
+ }, vendor.totalAssignments), /*#__PURE__*/React.createElement("span", {
4468
+ className: "stat-label"
4469
+ }, t("TOTAL_EKYC_APPLICATIONS") || "Total KNOs"))), /*#__PURE__*/React.createElement("div", {
4470
+ className: "knos-summary"
4471
+ }, /*#__PURE__*/React.createElement("div", {
4472
+ className: "kno-stat"
4473
+ }, /*#__PURE__*/React.createElement("span", {
4474
+ className: "kno-label"
4475
+ }, t("SUBMITTED") || "Submitted"), /*#__PURE__*/React.createElement("strong", null, vendor.submittedKnosInZones)), /*#__PURE__*/React.createElement("div", {
4476
+ className: "kno-stat pending"
4477
+ }, /*#__PURE__*/React.createElement("span", {
4478
+ className: "kno-label"
4479
+ }, t("PENDING") || "Pending"), /*#__PURE__*/React.createElement("strong", null, vendor.pendingKnosInZones)), /*#__PURE__*/React.createElement("div", {
4480
+ className: "kno-stat rejected"
4481
+ }, /*#__PURE__*/React.createElement("span", {
4482
+ className: "kno-label"
4483
+ }, t("EKYC_SUBMITTED_BY_CITIZENS").toLowerCase() || "Submitted by citizen"), /*#__PURE__*/React.createElement("strong", null, vendor.selfEkycCountInZones)))))))));
4849
4484
  };
4850
4485
 
4851
4486
  const SupervisorDetailsCard = () => {
4852
- var _Digit$SessionStorage, _Digit$UserService$ge, _Digit$UserService$ge2, _progressData$supervi, _fullName$charAt;
4487
+ var _Digit$SessionStorage, _Digit$UserService$ge, _Digit$UserService$ge2, _progressData$supervi;
4853
4488
  const {
4854
4489
  t
4855
4490
  } = useTranslation();
4856
4491
  const history = useHistory();
4857
4492
  const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
4858
4493
  const {
4859
- id: supervisorId
4494
+ id: supervisorId,
4495
+ vendorId
4860
4496
  } = useParams();
4861
4497
  const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
4862
4498
  const [ekycDownloadLoading, setEkycDownloadLoading] = useState(false);
4499
+ const [showFilterModal, setShowFilterModal] = useState(false);
4500
+ const [currentPage, setCurrentPage] = useState(0);
4501
+ const [pageSize, setPageSize] = useState(20);
4502
+ const [ekycStatus, setEkycStatus] = useState("ALL");
4863
4503
  const {
4864
4504
  data: supervisorSearchResponse,
4865
4505
  isLoading: isSupervisorSearchLoading
@@ -4882,11 +4522,15 @@ const SupervisorDetailsCard = () => {
4882
4522
  isLoading: isProgressLoading,
4883
4523
  data: progressData
4884
4524
  } = Digit.Hooks.ekyc.useEkycAssignmentProgress({
4885
- vendorId: targetVendorId
4525
+ vendorId: vendorId || targetVendorId
4886
4526
  }, {
4887
4527
  enabled: !!tenantId,
4888
4528
  keepPreviousData: true
4889
4529
  });
4530
+ const userRoles = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.roles;
4531
+ const isSupervisor = userRoles === null || userRoles === void 0 ? void 0 : userRoles.some(role => role.code === "EKYC_SUPERVISOR");
4532
+ const currentSupervisor = isSupervisor ? (progressData === null || progressData === void 0 ? void 0 : progressData.supervisorReport[0]) || [] : progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.find(ele => ele.supervisorId === supervisorId);
4533
+ const surveyorsData = (currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.surveyors) || [];
4890
4534
  const {
4891
4535
  data: surveyorSearchResponse,
4892
4536
  isLoading: isSurveyorSearchLoading
@@ -5034,12 +4678,12 @@ const SupervisorDetailsCard = () => {
5034
4678
  }
5035
4679
  return null;
5036
4680
  }, [progressData, supervisorSearchResponse, surveyorSearchResponse, supervisorId, loggedInUser]);
5037
- const fullName = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorName) || "N/A";
5038
- const mobileNumber = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.mobileNo) || "N/A";
4681
+ const fullName = (currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.supervisorName) || "N/A";
4682
+ const mobileNumber = (currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.mobileNo) || "N/A";
5039
4683
  const email = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.email) || ((supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorId) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid) ? loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.emailId : null) || "N/A";
5040
4684
  const gender = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.gender) || ((supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorId) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid) ? loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.gender : null) || "N/A";
5041
4685
  const status = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.status) || "N/A";
5042
- const assignedZone = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.assignedZoneId) || "N/A";
4686
+ const assignedZone = t(currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.assignedZoneId) || "N/A";
5043
4687
  const vendorName = useMemo(() => {
5044
4688
  var _matchedVendor$dsoDet;
5045
4689
  if (!vendorSearchResponse || !supervisor) return "N/A";
@@ -5054,12 +4698,6 @@ const SupervisorDetailsCard = () => {
5054
4698
  const surveyors = useMemo(() => {
5055
4699
  return (supervisor === null || supervisor === void 0 ? void 0 : supervisor.surveyors) || [];
5056
4700
  }, [supervisor]);
5057
- const [currentPage, setCurrentPage] = useState(0);
5058
- const [pageSize, setPageSize] = useState(20);
5059
- const userRoles = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.roles;
5060
- const isSupervisor = userRoles === null || userRoles === void 0 ? void 0 : userRoles.some(role => role.code === "EKYC_SUPERVISOR");
5061
- const currentSupervisor = isSupervisor ? (progressData === null || progressData === void 0 ? void 0 : progressData.supervisorReport[0]) || [] : progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.find(ele => ele.supervisorId === supervisorId);
5062
- const surveyorsData = (currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.surveyors) || [];
5063
4701
  const cards = useMemo(() => [{
5064
4702
  label: "TOTAL_EKYC_APPLICATIONS",
5065
4703
  count: (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0,
@@ -5141,100 +4779,54 @@ const SupervisorDetailsCard = () => {
5141
4779
  accessor: row => `${(row === null || row === void 0 ? void 0 : row.progressPercent) || 0}%`,
5142
4780
  id: "overallProgress"
5143
4781
  }], [t, history]);
5144
- const [showReportMenu, setShowReportMenu] = useState(false);
5145
4782
  const [customDate, setCustomDate] = useState({
5146
4783
  from: "",
5147
4784
  to: ""
5148
4785
  });
5149
- const [showCustomPicker, setShowCustomPicker] = useState(false);
5150
- const [reportLoading, setReportLoading] = useState(false);
5151
- const reportMenuRef = useRef(null);
5152
- useEffect(() => {
5153
- const handler = e => {
5154
- if (reportMenuRef.current && !reportMenuRef.current.contains(e.target)) {
5155
- setShowReportMenu(false);
5156
- setShowCustomPicker(false);
5157
- }
5158
- };
5159
- document.addEventListener("mousedown", handler);
5160
- return () => document.removeEventListener("mousedown", handler);
5161
- }, []);
5162
- const handleDownload = () => {
5163
- setReportLoading(true);
5164
- try {
5165
- const rowsWithStats = surveyors.map(s => ({
5166
- name: s.surveyorName,
5167
- mobileNo: s.mobileNo,
5168
- status: s.status,
5169
- total: s.totalKnos,
5170
- completed: s.submittedKnos,
5171
- pending: s.pendingKnos,
5172
- progress: `${s.progressPercent}%`
5173
- }));
5174
- const totalKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0;
5175
- const completedKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.submittedKnos) || 0;
5176
- downloadSupervisorPDF({
5177
- rows: rowsWithStats,
5178
- supervisorName: fullName,
5179
- vendorName,
5180
- mobileNumber,
5181
- email,
5182
- dashboardInfo: {
5183
- total: totalKnos,
5184
- completed: completedKnos,
5185
- pending: totalKnos - completedKnos,
5186
- submittedCount: completedKnos
5187
- },
5188
- t
5189
- });
5190
- } catch (err) {
5191
- console.error("Failed to generate supervisor report:", err);
5192
- } finally {
5193
- setReportLoading(false);
5194
- }
5195
- };
5196
- const handlePresetDownload = function (filter) {
5197
- try {
5198
- const range = getDateRange(filter);
5199
- if (!range) return Promise.resolve();
5200
- setShowReportMenu(false);
5201
- setShowCustomPicker(false);
5202
- return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
5203
- } catch (e) {
5204
- return Promise.reject(e);
5205
- }
4786
+ const StatCard = _ref5 => {
4787
+ let {
4788
+ title,
4789
+ value,
4790
+ type,
4791
+ isLoading,
4792
+ icon
4793
+ } = _ref5;
4794
+ return /*#__PURE__*/React.createElement("div", {
4795
+ className: `stat-card ${type}`
4796
+ }, isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
4797
+ className: "stat-title skeleton skeleton-text"
4798
+ }), /*#__PURE__*/React.createElement("div", {
4799
+ className: "stat-value skeleton skeleton-number"
4800
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
4801
+ className: "stat-title"
4802
+ }, title), /*#__PURE__*/React.createElement("div", {
4803
+ className: "stat-value"
4804
+ }, value), icon && /*#__PURE__*/React.createElement("div", {
4805
+ className: "stat-icon"
4806
+ }, icon)));
5206
4807
  };
5207
- const handleCustomDownload = function () {
5208
- try {
5209
- if (!customDate.from || !customDate.to) {
5210
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
5211
- return Promise.resolve();
4808
+ const isPageLoading = isProgressLoading || isSupervisorSearchLoading || isSurveyorSearchLoading || isVendorSearchLoading;
4809
+ if (isPageLoading && !supervisor) {
4810
+ return /*#__PURE__*/React.createElement(Loader, null);
4811
+ }
4812
+ if (!supervisor) {
4813
+ return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
4814
+ style: {
4815
+ padding: "24px"
5212
4816
  }
5213
- const from = new Date(customDate.from);
5214
- from.setHours(0, 0, 0, 0);
5215
- const to = new Date(customDate.to);
5216
- to.setHours(23, 59, 59, 999);
5217
- setShowReportMenu(false);
5218
- setShowCustomPicker(false);
5219
- return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
5220
- } catch (e) {
5221
- return Promise.reject(e);
5222
- }
5223
- };
4817
+ }, t("NO_SUPERVISOR_FOUND")));
4818
+ }
5224
4819
  const handleDownloadEkycData = function (fromDate, toDate) {
5225
4820
  try {
5226
- if (!surveyors || surveyors.length === 0) {
5227
- alert(t("NO_SURVEYORS_ASSIGNED") || "No surveyors assigned to this supervisor.");
5228
- return Promise.resolve();
5229
- }
5230
4821
  setEkycDownloadLoading(true);
5231
4822
  return Promise.resolve(_finallyRethrows(function () {
5232
4823
  return _catch(function () {
5233
4824
  return Promise.resolve(Digit.EkycService.application_list({
5234
- tenantId: tenantId || "dl.djb",
4825
+ tenantId: tenantId,
5235
4826
  offset: 0,
5236
4827
  limit: 10000,
5237
- supervisorId: (supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorId) || supervisorId,
4828
+ vendorId: targetVendorId,
4829
+ ekycStatus: ekycStatus,
5238
4830
  reportDownload: true,
5239
4831
  ...(fromDate && {
5240
4832
  fromDate
@@ -5244,16 +4836,25 @@ const SupervisorDetailsCard = () => {
5244
4836
  })
5245
4837
  })).then(function (response) {
5246
4838
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
5247
- if (consumerList.length === 0) {
5248
- alert(t("NO_DATA_FOUND") || "No data found for download.");
4839
+ if (!consumerList || consumerList.length === 0) {
4840
+ alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
5249
4841
  return;
5250
4842
  }
4843
+ consumerList.forEach(item => {
4844
+ if (item.assignedTime) {
4845
+ item.assignedTime = new Date(item.assignedTime).toLocaleDateString("en-GB");
4846
+ }
4847
+ if (item.submittedAt) {
4848
+ item.submittedAt = new Date(item.submittedAt).toLocaleDateString("en-GB");
4849
+ }
4850
+ });
5251
4851
  const excelData = getEkycExcelData(consumerList, t);
5252
- const cleanFileName = `eKYC_Data_Supervisor_${fullName.replace(/[^a-zA-Z0-9]/g, "_")}`;
4852
+ const cleanFileName = `eKYC_Data_${vendorName.replace(/[^a-zA-Z0-9]/g, "_")}`;
5253
4853
  Digit.Download.Excel(excelData, cleanFileName);
5254
4854
  });
5255
4855
  }, function (error) {
5256
- console.error("Error downloading eKYC Excel:", error);
4856
+ console.error("Failed to download eKYC data:", error);
4857
+ alert(t("EKYC_DOWNLOAD_FAILED") || "Failed to download eKYC data. Please try again.");
5257
4858
  });
5258
4859
  }, function (_wasThrown, _result) {
5259
4860
  setEkycDownloadLoading(false);
@@ -5264,106 +4865,50 @@ const SupervisorDetailsCard = () => {
5264
4865
  return Promise.reject(e);
5265
4866
  }
5266
4867
  };
5267
- const getDateRange = filter => {
5268
- const now = new Date();
5269
- const start = new Date(now);
5270
- if (filter === "today") {
5271
- start.setHours(0, 0, 0, 0);
5272
- return {
5273
- from: start,
5274
- to: now
5275
- };
5276
- }
5277
- if (filter === "week") {
5278
- start.setDate(now.getDate() - now.getDay());
5279
- start.setHours(0, 0, 0, 0);
5280
- return {
5281
- from: start,
5282
- to: now
5283
- };
5284
- }
5285
- if (filter === "month") {
5286
- start.setDate(1);
5287
- start.setHours(0, 0, 0, 0);
5288
- return {
5289
- from: start,
5290
- to: now
5291
- };
4868
+ const handleApplyFilters = function () {
4869
+ try {
4870
+ setShowFilterModal(false);
4871
+ return Promise.resolve(handleDownloadEkycData(customDate.startDate.getTime(), customDate.endDate.getTime())).then(function () {});
4872
+ } catch (e) {
4873
+ return Promise.reject(e);
5292
4874
  }
5293
- return null;
5294
- };
5295
- const StatCard = _ref5 => {
5296
- let {
5297
- title,
5298
- value,
5299
- type,
5300
- isLoading,
5301
- icon
5302
- } = _ref5;
5303
- return /*#__PURE__*/React.createElement("div", {
5304
- className: `stat-card ${type}`
5305
- }, isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5306
- className: "stat-title skeleton skeleton-text"
5307
- }), /*#__PURE__*/React.createElement("div", {
5308
- className: "stat-value skeleton skeleton-number"
5309
- })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5310
- className: "stat-title"
5311
- }, title), /*#__PURE__*/React.createElement("div", {
5312
- className: "stat-value"
5313
- }, value), icon && /*#__PURE__*/React.createElement("div", {
5314
- className: "stat-icon"
5315
- }, icon)));
5316
4875
  };
5317
- const isPageLoading = isProgressLoading || isSupervisorSearchLoading || isSurveyorSearchLoading || isVendorSearchLoading;
5318
- if (isPageLoading && !supervisor) {
5319
- return /*#__PURE__*/React.createElement(Loader, null);
5320
- }
5321
- if (!supervisor) {
5322
- return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
5323
- style: {
5324
- padding: "24px"
5325
- }
5326
- }, t("NO_SUPERVISOR_FOUND")));
5327
- }
5328
- return /*#__PURE__*/React.createElement(Card, {
4876
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Card, {
5329
4877
  className: "surveyor-dashboard"
5330
4878
  }, /*#__PURE__*/React.createElement("div", {
5331
4879
  className: "ekyc-dashboard-section"
4880
+ }, /*#__PURE__*/React.createElement("div", {
4881
+ className: "ekyc-details-wrapper"
4882
+ }, /*#__PURE__*/React.createElement("div", {
4883
+ className: "details-top-row"
4884
+ }, /*#__PURE__*/React.createElement("div", {
4885
+ className: "detail-item first-row"
5332
4886
  }, /*#__PURE__*/React.createElement("div", {
5333
4887
  className: "ekyc-dashboard-header"
5334
4888
  }, /*#__PURE__*/React.createElement("div", {
5335
- className: "avatar"
5336
- }, fullName === null || fullName === void 0 ? void 0 : (_fullName$charAt = fullName.charAt(0)) === null || _fullName$charAt === void 0 ? void 0 : _fullName$charAt.toUpperCase()), /*#__PURE__*/React.createElement("div", {
5337
4889
  className: "header-content"
5338
4890
  }, /*#__PURE__*/React.createElement("h2", {
5339
4891
  className: "name"
5340
4892
  }, fullName), /*#__PURE__*/React.createElement("div", {
5341
4893
  className: "designation"
5342
- }, t("FIELD_SUPERVISOR") || "Field Supervisor"))), /*#__PURE__*/React.createElement("div", {
5343
- className: "report-download"
4894
+ }, "(", t("FIELD_SUPERVISOR") || "Field Supervisor", ")"))), /*#__PURE__*/React.createElement("div", {
4895
+ className: "report-download relative"
5344
4896
  }, /*#__PURE__*/React.createElement("button", {
5345
- className: "download-btn",
5346
- disabled: reportLoading,
5347
- onClick: handleDownload
5348
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
5349
- className: "stats-wrapper"
5350
- }, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
5351
- key: idx,
5352
- title: t(card.label),
5353
- value: card.count,
5354
- type: card.type,
5355
- isLoading: isProgressLoading,
5356
- icon: card.icon
5357
- }))), /*#__PURE__*/React.createElement("div", {
5358
- className: "ekyc-dashboard-section"
5359
- }, /*#__PURE__*/React.createElement("div", {
5360
- className: "ekyc-details-wrapper"
5361
- }, /*#__PURE__*/React.createElement("div", {
5362
- className: "details-top-row"
4897
+ disabled: ekycDownloadLoading,
4898
+ className: `download-btn relative ${ekycDownloadLoading ? "disabled" : ""}`,
4899
+ onClick: () => setShowFilterModal(true)
4900
+ }, /*#__PURE__*/React.createElement(MdDownloadIcon, null), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading" : t("DOWNLOAD_REPORT") || "Download Report")))), /*#__PURE__*/React.createElement("div", {
4901
+ className: "details-grid-row"
5363
4902
  }, /*#__PURE__*/React.createElement("div", {
5364
4903
  className: "detail-item"
5365
4904
  }, /*#__PURE__*/React.createElement("span", {
5366
4905
  className: "label"
4906
+ }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React.createElement("span", {
4907
+ className: "value"
4908
+ }, vendorName)), /*#__PURE__*/React.createElement("div", {
4909
+ className: "detail-item"
4910
+ }, /*#__PURE__*/React.createElement("span", {
4911
+ className: "label"
5367
4912
  }, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
5368
4913
  className: "value"
5369
4914
  }, mobileNumber)), /*#__PURE__*/React.createElement("div", {
@@ -5372,130 +4917,36 @@ const SupervisorDetailsCard = () => {
5372
4917
  className: "label"
5373
4918
  }, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
5374
4919
  className: "value"
5375
- }, email)), /*#__PURE__*/React.createElement("div", {
5376
- className: "download-card"
5377
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format.")), /*#__PURE__*/React.createElement("div", {
5378
- className: "report-download",
5379
- ref: reportMenuRef
5380
- }, /*#__PURE__*/React.createElement("button", {
5381
- className: "download-excel-btn",
5382
- disabled: ekycDownloadLoading,
5383
- onClick: () => {
5384
- setShowReportMenu(p => !p);
5385
- setShowCustomPicker(false);
5386
- }
5387
- }, /*#__PURE__*/React.createElement("svg", {
5388
- width: "16",
5389
- height: "16",
5390
- viewBox: "0 0 24 24",
5391
- fill: "none",
5392
- stroke: "currentColor",
5393
- strokeWidth: "2.5",
5394
- strokeLinecap: "round",
5395
- strokeLinejoin: "round"
5396
- }, /*#__PURE__*/React.createElement("path", {
5397
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
5398
- }), /*#__PURE__*/React.createElement("polyline", {
5399
- points: "7 10 12 15 17 10"
5400
- }), /*#__PURE__*/React.createElement("line", {
5401
- x1: "12",
5402
- y1: "15",
5403
- x2: "12",
5404
- y2: "3"
5405
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
5406
- className: "report-menu"
5407
- }, [{
5408
- label: t("TODAY") || "Today",
5409
- key: "today"
5410
- }, {
5411
- label: t("THIS_WEEK") || "This Week",
5412
- key: "week"
5413
- }, {
5414
- label: t("THIS_MONTH") || "This Month",
5415
- key: "month"
5416
- }].map(_ref6 => {
5417
- let {
5418
- label,
5419
- key
5420
- } = _ref6;
5421
- return /*#__PURE__*/React.createElement("div", {
5422
- key: key,
5423
- className: "menu-item",
5424
- onClick: () => handlePresetDownload(key)
5425
- }, label);
5426
- }), /*#__PURE__*/React.createElement("div", {
5427
- className: "custom-date-trigger",
5428
- onClick: () => setShowCustomPicker(p => !p)
5429
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
5430
- className: "custom-picker"
5431
- }, /*#__PURE__*/React.createElement("div", {
5432
- className: "date-inputs"
5433
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
5434
- type: "date",
5435
- value: customDate.from,
5436
- onChange: e => setCustomDate({
5437
- ...customDate,
5438
- from: e.target.value
5439
- })
5440
- })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
5441
- type: "date",
5442
- value: customDate.to,
5443
- onChange: e => setCustomDate({
5444
- ...customDate,
5445
- to: e.target.value
5446
- })
5447
- }))), /*#__PURE__*/React.createElement("div", {
5448
- style: {
5449
- display: "flex",
5450
- gap: "10px",
5451
- marginTop: "10px"
5452
- }
5453
- }, /*#__PURE__*/React.createElement("button", {
5454
- className: "picker-cancel-btn",
5455
- onClick: () => {
5456
- setShowCustomPicker(false);
5457
- setCustomDate({
5458
- from: "",
5459
- to: ""
5460
- });
5461
- }
5462
- }, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
5463
- className: "picker-apply-btn",
5464
- onClick: handleCustomDownload
5465
- }, t("APPLY") || "Apply"))))))), /*#__PURE__*/React.createElement("div", {
4920
+ }, email))), /*#__PURE__*/React.createElement("div", {
5466
4921
  className: "details-grid-row"
5467
4922
  }, /*#__PURE__*/React.createElement("div", {
5468
4923
  className: "detail-item"
5469
4924
  }, /*#__PURE__*/React.createElement("span", {
5470
4925
  className: "label"
5471
- }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
5472
- className: "value"
5473
- }, t(gender) || gender)), /*#__PURE__*/React.createElement("div", {
5474
- className: "detail-item"
5475
- }, /*#__PURE__*/React.createElement("span", {
5476
- className: "label"
5477
- }, t("STATUS")), /*#__PURE__*/React.createElement("span", {
4926
+ }, t("ASSIGNED_ZONE") || "Assigned Zone"), /*#__PURE__*/React.createElement("span", {
5478
4927
  className: "value"
5479
- }, status)), /*#__PURE__*/React.createElement("div", {
4928
+ }, assignedZone && assignedZone !== "N/A" ? t(assignedZone.trim().toUpperCase()) || assignedZone : assignedZone)), /*#__PURE__*/React.createElement("div", {
5480
4929
  className: "detail-item"
5481
4930
  }, /*#__PURE__*/React.createElement("span", {
5482
4931
  className: "label"
5483
- }, t("ASSIGNED_ZONE") || "Assigned Zone"), /*#__PURE__*/React.createElement("span", {
4932
+ }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
5484
4933
  className: "value"
5485
- }, assignedZone && assignedZone !== "N/A" ? /*#__PURE__*/React.createElement("div", {
5486
- className: "selected-zones",
5487
- style: {
5488
- marginTop: "4px"
5489
- }
5490
- }, /*#__PURE__*/React.createElement("span", {
5491
- className: "selected-zone-chip"
5492
- }, t(assignedZone.trim().toUpperCase()) || assignedZone)) : assignedZone)), /*#__PURE__*/React.createElement("div", {
4934
+ }, t(gender) || gender)), /*#__PURE__*/React.createElement("div", {
5493
4935
  className: "detail-item"
5494
4936
  }, /*#__PURE__*/React.createElement("span", {
5495
4937
  className: "label"
5496
- }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React.createElement("span", {
4938
+ }, t("STATUS")), /*#__PURE__*/React.createElement("span", {
5497
4939
  className: "value"
5498
- }, vendorName))))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, {
4940
+ }, status))))), /*#__PURE__*/React.createElement("div", {
4941
+ className: "stats-wrapper"
4942
+ }, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
4943
+ key: idx,
4944
+ title: t(card.label),
4945
+ value: card.count,
4946
+ type: card.type,
4947
+ isLoading: isProgressLoading,
4948
+ icon: card.icon
4949
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, {
5499
4950
  t: t,
5500
4951
  tableTitle: t("CONNECTED_SURVEYORS") || "Connected Surveyors",
5501
4952
  tableClass: "ekycTable",
@@ -5527,7 +4978,15 @@ const SupervisorDetailsCard = () => {
5527
4978
  setPageSize(Number(e.target.value));
5528
4979
  setCurrentPage(0);
5529
4980
  }
5530
- })));
4981
+ }))), showFilterModal && /*#__PURE__*/React.createElement(EkycFilterModal, {
4982
+ t: t,
4983
+ onClose: () => setShowFilterModal(false),
4984
+ onApply: handleApplyFilters,
4985
+ customDate: customDate,
4986
+ setCustomDate: setCustomDate,
4987
+ ekycStatus: ekycStatus,
4988
+ setEkycStatus: setEkycStatus
4989
+ }));
5531
4990
  };
5532
4991
 
5533
4992
  const AssignEkycModal = _ref => {
@@ -5974,11 +5433,13 @@ const AssignEkycModal = _ref => {
5974
5433
  };
5975
5434
 
5976
5435
  const SurveyorDetailsCard = () => {
5977
- var _Digit$SessionStorage, _Digit$SessionStorage2, _surveyorSearchById$s, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _surveyor$owner7, _surveyor$owner8, _surveyor$owner9, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _dashboardData$dashbo5, _dashboardData$dashbo6;
5436
+ var _Digit$SessionStorage, _Digit$SessionStorage2, _surveyorSearchById$s, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner4, _surveyor$owner5, _surveyor$owner6, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _dashboardData$dashbo5, _dashboardData$dashbo6;
5978
5437
  const tenantId = Digit.ULBService.getCurrentTenantId();
5979
5438
  const [showModal, setShowModal] = useState(null);
5980
5439
  const [showOptions, setShowOptions] = useState(false);
5981
5440
  const [ekycDownloadLoading, setEkycDownloadLoading] = useState(false);
5441
+ const [showFilterModal, setShowFilterModal] = useState(false);
5442
+ const [ekycStatus, setEkycStatus] = useState("ALL");
5982
5443
  const {
5983
5444
  id: surveyorId
5984
5445
  } = useParams();
@@ -6058,15 +5519,13 @@ const SurveyorDetailsCard = () => {
6058
5519
  return (mappedSupervisor === null || mappedSupervisor === void 0 ? void 0 : mappedSupervisor.name) || (mappedSupervisor === null || mappedSupervisor === void 0 ? void 0 : (_mappedSupervisor$own = mappedSupervisor.owner) === null || _mappedSupervisor$own === void 0 ? void 0 : _mappedSupervisor$own.name) || surveyor.supervisorId || "N/A";
6059
5520
  }, [supervisorSearchResponse, surveyor === null || surveyor === void 0 ? void 0 : surveyor.supervisorId, surveyor === null || surveyor === void 0 ? void 0 : surveyor.supervisorName]);
6060
5521
  const fullName = (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner = surveyor.owner) === null || _surveyor$owner === void 0 ? void 0 : _surveyor$owner.name) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.name) || "N/A";
6061
- const employeeId = (surveyor === null || surveyor === void 0 ? void 0 : surveyor.employeeId) || (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner2 = surveyor.owner) === null || _surveyor$owner2 === void 0 ? void 0 : _surveyor$owner2.uuid) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.id);
6062
- const mobileNumber = (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner3 = surveyor.owner) === null || _surveyor$owner3 === void 0 ? void 0 : _surveyor$owner3.mobileNumber) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.mobileNo) || "N/A";
6063
5522
  const [currentPage, setCurrentPage] = useState(0);
6064
5523
  const [pageSize, setPageSize] = useState(20);
6065
5524
  const queryParams = {
6066
5525
  tenantId: "dl.djb",
6067
5526
  offset: currentPage * pageSize,
6068
5527
  limit: pageSize,
6069
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner4 = surveyor.owner) === null || _surveyor$owner4 === void 0 ? void 0 : _surveyor$owner4.uuid
5528
+ surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner2 = surveyor.owner) === null || _surveyor$owner2 === void 0 ? void 0 : _surveyor$owner2.uuid
6070
5529
  };
6071
5530
  const {
6072
5531
  isFetching: isDashboardLoading,
@@ -6123,24 +5582,10 @@ const SurveyorDetailsCard = () => {
6123
5582
  return value ? Digit.DateUtils.ConvertEpochToDate(value) : "-";
6124
5583
  }
6125
5584
  }], [t]);
6126
- const [showReportMenu, setShowReportMenu] = useState(false);
6127
5585
  const [customDate, setCustomDate] = useState({
6128
5586
  from: "",
6129
5587
  to: ""
6130
5588
  });
6131
- const [showCustomPicker, setShowCustomPicker] = useState(false);
6132
- const [reportLoading, setReportLoading] = useState(false);
6133
- const reportMenuRef = useRef(null);
6134
- useEffect(() => {
6135
- const handler = e => {
6136
- if (reportMenuRef.current && !reportMenuRef.current.contains(e.target)) {
6137
- setShowReportMenu(false);
6138
- setShowCustomPicker(false);
6139
- }
6140
- };
6141
- document.addEventListener("mousedown", handler);
6142
- return () => document.removeEventListener("mousedown", handler);
6143
- }, []);
6144
5589
  const isPageLoading = isLoading || isVendorLoading || isSupervisorSearchLoading;
6145
5590
  if (isPageLoading && !surveyor) {
6146
5591
  return /*#__PURE__*/React.createElement(Loader, null);
@@ -6152,100 +5597,6 @@ const SurveyorDetailsCard = () => {
6152
5597
  }
6153
5598
  }, t("NO_SURVEYOR_FOUND")));
6154
5599
  }
6155
- const getDateRange = filter => {
6156
- const now = new Date();
6157
- const start = new Date(now);
6158
- if (filter === "today") {
6159
- start.setHours(0, 0, 0, 0);
6160
- return {
6161
- from: start,
6162
- to: now
6163
- };
6164
- }
6165
- if (filter === "week") {
6166
- start.setDate(now.getDate() - now.getDay());
6167
- start.setHours(0, 0, 0, 0);
6168
- return {
6169
- from: start,
6170
- to: now
6171
- };
6172
- }
6173
- if (filter === "month") {
6174
- start.setDate(1);
6175
- start.setHours(0, 0, 0, 0);
6176
- return {
6177
- from: start,
6178
- to: now
6179
- };
6180
- }
6181
- return null;
6182
- };
6183
- const handleDownload = function () {
6184
- try {
6185
- setReportLoading(true);
6186
- const _temp = _finallyRethrows(function () {
6187
- return _catch(function () {
6188
- var _surveyor$owner5;
6189
- return Promise.resolve(Digit.EkycService.dashboard({}, {
6190
- tenantId: "dl.djb",
6191
- offset: 0,
6192
- limit: 1000,
6193
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
6194
- })).then(function (response) {
6195
- var _response$dashboardIn;
6196
- const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn = response.dashboardInfo) === null || _response$dashboardIn === void 0 ? void 0 : _response$dashboardIn.consumerList) || [];
6197
- downloadSurveyorPDF({
6198
- rows: rows,
6199
- surveyorName: fullName,
6200
- vendorName,
6201
- supervisorName,
6202
- employeeId,
6203
- mobileNumber,
6204
- dashboardInfo: (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {},
6205
- t
6206
- });
6207
- });
6208
- }, function (err) {
6209
- console.error("Failed to fetch dashboard data for report download:", err);
6210
- });
6211
- }, function (_wasThrown, _result) {
6212
- setReportLoading(false);
6213
- if (_wasThrown) throw _result;
6214
- return _result;
6215
- });
6216
- return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
6217
- } catch (e) {
6218
- return Promise.reject(e);
6219
- }
6220
- };
6221
- const handlePresetDownload = function (filter) {
6222
- try {
6223
- const range = getDateRange(filter);
6224
- if (!range) return Promise.resolve();
6225
- setShowReportMenu(false);
6226
- setShowCustomPicker(false);
6227
- return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
6228
- } catch (e) {
6229
- return Promise.reject(e);
6230
- }
6231
- };
6232
- const handleCustomDownload = function () {
6233
- try {
6234
- if (!customDate.from || !customDate.to) {
6235
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
6236
- return Promise.resolve();
6237
- }
6238
- const from = new Date(customDate.from);
6239
- from.setHours(0, 0, 0, 0);
6240
- const to = new Date(customDate.to);
6241
- to.setHours(23, 59, 59, 999);
6242
- setShowReportMenu(false);
6243
- setShowCustomPicker(false);
6244
- return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
6245
- } catch (e) {
6246
- return Promise.reject(e);
6247
- }
6248
- };
6249
5600
  const StatCard = _ref4 => {
6250
5601
  let {
6251
5602
  title,
@@ -6277,17 +5628,26 @@ const SurveyorDetailsCard = () => {
6277
5628
  setShowOptions(false);
6278
5629
  setShowModal(option.action);
6279
5630
  };
5631
+ const closeModal = function () {
5632
+ try {
5633
+ setShowModal(null);
5634
+ return Promise.resolve();
5635
+ } catch (e) {
5636
+ return Promise.reject(e);
5637
+ }
5638
+ };
6280
5639
  const handleDownloadEkycData = function (fromDate, toDate) {
6281
5640
  try {
6282
5641
  setEkycDownloadLoading(true);
6283
5642
  return Promise.resolve(_finallyRethrows(function () {
6284
5643
  return _catch(function () {
6285
- var _surveyor$owner6;
5644
+ var _surveyor$owner3;
6286
5645
  return Promise.resolve(Digit.EkycService.application_list({
6287
- tenantId: tenantId || "dl.djb",
5646
+ tenantId: tenantId,
6288
5647
  offset: 0,
6289
5648
  limit: 10000,
6290
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.uuid,
5649
+ surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner3 = surveyor.owner) === null || _surveyor$owner3 === void 0 ? void 0 : _surveyor$owner3.uuid,
5650
+ ekycStatus: ekycStatus,
6291
5651
  reportDownload: true,
6292
5652
  ...(fromDate && {
6293
5653
  fromDate
@@ -6297,35 +5657,44 @@ const SurveyorDetailsCard = () => {
6297
5657
  })
6298
5658
  })).then(function (response) {
6299
5659
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
6300
- if (consumerList.length === 0) {
6301
- alert(t("NO_DATA_FOUND") || "No data found for download.");
5660
+ if (!consumerList || consumerList.length === 0) {
5661
+ alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
6302
5662
  return;
6303
5663
  }
5664
+ consumerList.forEach(item => {
5665
+ if (item.assignedTime) {
5666
+ item.assignedTime = new Date(item.assignedTime).toLocaleDateString("en-GB");
5667
+ }
5668
+ if (item.submittedAt) {
5669
+ item.submittedAt = new Date(item.submittedAt).toLocaleDateString("en-GB");
5670
+ }
5671
+ });
6304
5672
  const excelData = getEkycExcelData(consumerList, t);
6305
- const cleanFileName = `eKYC_Data_${fullName.replace(/[^a-zA-Z0-9]/g, "_")}`;
5673
+ const cleanFileName = `eKYC_Data_${vendorName.replace(/[^a-zA-Z0-9]/g, "_")}`;
6306
5674
  Digit.Download.Excel(excelData, cleanFileName);
6307
5675
  });
6308
5676
  }, function (error) {
6309
- console.error("Error downloading eKYC Excel:", error);
5677
+ console.error("Failed to download eKYC data:", error);
5678
+ alert(t("EKYC_DOWNLOAD_FAILED") || "Failed to download eKYC data. Please try again.");
6310
5679
  });
6311
- }, function (_wasThrown2, _result2) {
5680
+ }, function (_wasThrown, _result) {
6312
5681
  setEkycDownloadLoading(false);
6313
- if (_wasThrown2) throw _result2;
6314
- return _result2;
5682
+ if (_wasThrown) throw _result;
5683
+ return _result;
6315
5684
  }));
6316
5685
  } catch (e) {
6317
5686
  return Promise.reject(e);
6318
5687
  }
6319
5688
  };
6320
- const closeModal = function () {
5689
+ const handleApplyFilters = function () {
6321
5690
  try {
6322
- setShowModal(null);
6323
- return Promise.resolve();
5691
+ setShowFilterModal(false);
5692
+ return Promise.resolve(handleDownloadEkycData(customDate.startDate.getTime(), customDate.endDate.getTime())).then(function () {});
6324
5693
  } catch (e) {
6325
5694
  return Promise.reject(e);
6326
5695
  }
6327
5696
  };
6328
- return /*#__PURE__*/React.createElement(Card, {
5697
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Card, {
6329
5698
  className: "surveyor-dashboard"
6330
5699
  }, /*#__PURE__*/React.createElement("div", {
6331
5700
  className: "ekyc-dashboard-section"
@@ -6344,142 +5713,52 @@ const SurveyorDetailsCard = () => {
6344
5713
  }, fullName), /*#__PURE__*/React.createElement("div", {
6345
5714
  className: "designation"
6346
5715
  }, "(", (surveyor === null || surveyor === void 0 ? void 0 : surveyor.description) || t("FIELD_SURVEYOR"), ")"))), /*#__PURE__*/React.createElement("div", {
6347
- className: "report-download"
5716
+ className: "report-download relative"
6348
5717
  }, /*#__PURE__*/React.createElement("button", {
6349
- className: "download-btn",
6350
- disabled: reportLoading,
6351
- onClick: handleDownload
6352
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report")))), /*#__PURE__*/React.createElement("div", {
6353
- className: "details-top-row"
5718
+ disabled: ekycDownloadLoading,
5719
+ className: `download-btn relative ${ekycDownloadLoading ? "disabled" : ""}`,
5720
+ onClick: () => setShowFilterModal(true)
5721
+ }, /*#__PURE__*/React.createElement(MdDownloadIcon, null), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading" : t("DOWNLOAD_REPORT") || "Download Report")))), /*#__PURE__*/React.createElement("div", {
5722
+ className: "details-grid-row"
6354
5723
  }, /*#__PURE__*/React.createElement("div", {
6355
5724
  className: "detail-item"
6356
5725
  }, /*#__PURE__*/React.createElement("span", {
6357
5726
  className: "label"
6358
- }, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
5727
+ }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React.createElement("span", {
6359
5728
  className: "value"
6360
- }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner7 = surveyor.owner) === null || _surveyor$owner7 === void 0 ? void 0 : _surveyor$owner7.mobileNumber) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.mobileNo) || "N/A")), /*#__PURE__*/React.createElement("div", {
5729
+ }, vendorName)), /*#__PURE__*/React.createElement("div", {
6361
5730
  className: "detail-item"
6362
5731
  }, /*#__PURE__*/React.createElement("span", {
6363
5732
  className: "label"
6364
- }, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
5733
+ }, t("SUPERVISOR_NAME") || "Supervisor Name"), /*#__PURE__*/React.createElement("span", {
6365
5734
  className: "value"
6366
- }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner8 = surveyor.owner) === null || _surveyor$owner8 === void 0 ? void 0 : _surveyor$owner8.emailId) || "N/A")), /*#__PURE__*/React.createElement("div", {
6367
- className: "download-card"
6368
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format.")), /*#__PURE__*/React.createElement("div", {
6369
- className: "report-download",
6370
- ref: reportMenuRef
6371
- }, /*#__PURE__*/React.createElement("button", {
6372
- className: "download-excel-btn",
6373
- disabled: ekycDownloadLoading,
6374
- onClick: () => {
6375
- setShowReportMenu(p => !p);
6376
- setShowCustomPicker(false);
6377
- }
6378
- }, /*#__PURE__*/React.createElement("svg", {
6379
- width: "16",
6380
- height: "16",
6381
- viewBox: "0 0 24 24",
6382
- fill: "none",
6383
- stroke: "currentColor",
6384
- strokeWidth: "2.5",
6385
- strokeLinecap: "round",
6386
- strokeLinejoin: "round"
6387
- }, /*#__PURE__*/React.createElement("path", {
6388
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
6389
- }), /*#__PURE__*/React.createElement("polyline", {
6390
- points: "7 10 12 15 17 10"
6391
- }), /*#__PURE__*/React.createElement("line", {
6392
- x1: "12",
6393
- y1: "15",
6394
- x2: "12",
6395
- y2: "3"
6396
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
6397
- className: "report-menu"
6398
- }, [{
6399
- label: t("TODAY") || "Today",
6400
- key: "today"
6401
- }, {
6402
- label: t("THIS_WEEK") || "This Week",
6403
- key: "week"
6404
- }, {
6405
- label: t("THIS_MONTH") || "This Month",
6406
- key: "month"
6407
- }].map(_ref5 => {
6408
- let {
6409
- label,
6410
- key
6411
- } = _ref5;
6412
- return /*#__PURE__*/React.createElement("div", {
6413
- key: key,
6414
- className: "menu-item",
6415
- onClick: () => handlePresetDownload(key)
6416
- }, label);
6417
- }), /*#__PURE__*/React.createElement("div", {
6418
- className: "custom-date-trigger",
6419
- onClick: () => setShowCustomPicker(p => !p)
6420
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
6421
- className: "custom-picker"
6422
- }, /*#__PURE__*/React.createElement("div", {
6423
- className: "date-inputs"
6424
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
6425
- type: "date",
6426
- value: customDate.from,
6427
- onChange: e => setCustomDate({
6428
- ...customDate,
6429
- from: e.target.value
6430
- })
6431
- })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
6432
- type: "date",
6433
- value: customDate.to,
6434
- onChange: e => setCustomDate({
6435
- ...customDate,
6436
- to: e.target.value
6437
- })
6438
- }))), /*#__PURE__*/React.createElement("div", {
6439
- style: {
6440
- display: "flex",
6441
- gap: "10px",
6442
- marginTop: "10px"
6443
- }
6444
- }, /*#__PURE__*/React.createElement("button", {
6445
- className: "picker-cancel-btn",
6446
- onClick: () => {
6447
- setShowCustomPicker(false);
6448
- setCustomDate({
6449
- from: "",
6450
- to: ""
6451
- });
6452
- }
6453
- }, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
6454
- className: "picker-apply-btn",
6455
- onClick: handleCustomDownload
6456
- }, t("APPLY") || "Apply"))))))), /*#__PURE__*/React.createElement("div", {
6457
- className: "details-grid-row"
6458
- }, /*#__PURE__*/React.createElement("div", {
5735
+ }, supervisorName)), /*#__PURE__*/React.createElement("div", {
6459
5736
  className: "detail-item"
6460
5737
  }, /*#__PURE__*/React.createElement("span", {
6461
5738
  className: "label"
6462
- }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
5739
+ }, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
6463
5740
  className: "value"
6464
- }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner9 = surveyor.owner) === null || _surveyor$owner9 === void 0 ? void 0 : _surveyor$owner9.gender) || "N/A")), /*#__PURE__*/React.createElement("div", {
5741
+ }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner4 = surveyor.owner) === null || _surveyor$owner4 === void 0 ? void 0 : _surveyor$owner4.mobileNumber) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.mobileNo) || "N/A"))), /*#__PURE__*/React.createElement("div", {
5742
+ className: "details-grid-row"
5743
+ }, /*#__PURE__*/React.createElement("div", {
6465
5744
  className: "detail-item"
6466
5745
  }, /*#__PURE__*/React.createElement("span", {
6467
5746
  className: "label"
6468
- }, t("STATUS")), /*#__PURE__*/React.createElement("span", {
5747
+ }, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
6469
5748
  className: "value"
6470
- }, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.status) || "N/A")), /*#__PURE__*/React.createElement("div", {
5749
+ }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.emailId) || "N/A")), /*#__PURE__*/React.createElement("div", {
6471
5750
  className: "detail-item"
6472
5751
  }, /*#__PURE__*/React.createElement("span", {
6473
5752
  className: "label"
6474
- }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React.createElement("span", {
5753
+ }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
6475
5754
  className: "value"
6476
- }, vendorName)), /*#__PURE__*/React.createElement("div", {
5755
+ }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.gender) || "N/A")), /*#__PURE__*/React.createElement("div", {
6477
5756
  className: "detail-item"
6478
5757
  }, /*#__PURE__*/React.createElement("span", {
6479
5758
  className: "label"
6480
- }, t("SUPERVISOR_NAME") || "Supervisor Name"), /*#__PURE__*/React.createElement("span", {
5759
+ }, t("STATUS")), /*#__PURE__*/React.createElement("span", {
6481
5760
  className: "value"
6482
- }, supervisorName))))), /*#__PURE__*/React.createElement("div", {
5761
+ }, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.status) || "N/A"))))), /*#__PURE__*/React.createElement("div", {
6483
5762
  className: "stats-wrapper"
6484
5763
  }, /*#__PURE__*/React.createElement(StatCard, {
6485
5764
  title: t("TOTAL_ASSIGNED"),
@@ -6559,6 +5838,14 @@ const SurveyorDetailsCard = () => {
6559
5838
  isReassign: showModal === "EKYC_REASSIGN",
6560
5839
  closeModal: closeModal,
6561
5840
  refetchDashboard: refetchDashboard
5841
+ })), showFilterModal && /*#__PURE__*/React.createElement(EkycFilterModal, {
5842
+ t: t,
5843
+ onClose: () => setShowFilterModal(false),
5844
+ onApply: handleApplyFilters,
5845
+ customDate: customDate,
5846
+ setCustomDate: setCustomDate,
5847
+ ekycStatus: ekycStatus,
5848
+ setEkycStatus: setEkycStatus
6562
5849
  }));
6563
5850
  };
6564
5851
 
@@ -7316,12 +6603,12 @@ const EmployeeApp = _ref => {
7316
6603
  layoutClass: "normal"
7317
6604
  }, /*#__PURE__*/React.createElement(VendorDetailsCard, null))
7318
6605
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
7319
- path: [`${path}/supervisor-dashboard/:id`, `${path}/supervisor-dashboard`],
6606
+ path: `${path}/supervisor-dashboard/:id/:vendorId?`,
7320
6607
  component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
7321
6608
  layoutClass: "normal"
7322
6609
  }, /*#__PURE__*/React.createElement(SupervisorDetailsCard, null))
7323
6610
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
7324
- path: [`${path}/surveyor-dashboard/:id`, `${path}/surveyor-dashboard`],
6611
+ path: `${path}/surveyor-dashboard/:id?`,
7325
6612
  component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
7326
6613
  layoutClass: "normal"
7327
6614
  }, /*#__PURE__*/React.createElement(SurveyorDetailsCard, null))
@@ -9028,7 +8315,7 @@ const CitizenApp = () => {
9028
8315
  layoutClass: "normal"
9029
8316
  }, /*#__PURE__*/React.createElement(Review, null))
9030
8317
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
9031
- path: [`${path}/vendor-dashboard/:vendorId`, `${path}/vendor-dashboard`],
8318
+ path: `${path}/vendor-dashboard/:vendorId?`,
9032
8319
  component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
9033
8320
  layoutClass: "normal"
9034
8321
  }, /*#__PURE__*/React.createElement(VendorDetailsCard, null))