@djb25/digit-ui-module-ekyc 1.0.74 → 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, _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
@@ -4881,13 +4521,16 @@ const SupervisorDetailsCard = () => {
4881
4521
  const {
4882
4522
  isLoading: isProgressLoading,
4883
4523
  data: progressData
4884
- } = Digit.Hooks.ekyc.useEkycAssignmentProgress(targetVendorId ? {
4885
- vendorId: targetVendorId,
4886
- vendorIds: [targetVendorId]
4887
- } : {}, {
4524
+ } = Digit.Hooks.ekyc.useEkycAssignmentProgress({
4525
+ vendorId: vendorId || targetVendorId
4526
+ }, {
4888
4527
  enabled: !!tenantId,
4889
4528
  keepPreviousData: true
4890
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) || [];
4891
4534
  const {
4892
4535
  data: surveyorSearchResponse,
4893
4536
  isLoading: isSurveyorSearchLoading
@@ -5035,12 +4678,12 @@ const SupervisorDetailsCard = () => {
5035
4678
  }
5036
4679
  return null;
5037
4680
  }, [progressData, supervisorSearchResponse, surveyorSearchResponse, supervisorId, loggedInUser]);
5038
- const fullName = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorName) || "N/A";
5039
- 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";
5040
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";
5041
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";
5042
4685
  const status = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.status) || "N/A";
5043
- 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";
5044
4687
  const vendorName = useMemo(() => {
5045
4688
  var _matchedVendor$dsoDet;
5046
4689
  if (!vendorSearchResponse || !supervisor) return "N/A";
@@ -5055,10 +4698,6 @@ const SupervisorDetailsCard = () => {
5055
4698
  const surveyors = useMemo(() => {
5056
4699
  return (supervisor === null || supervisor === void 0 ? void 0 : supervisor.surveyors) || [];
5057
4700
  }, [supervisor]);
5058
- const [currentPage, setCurrentPage] = useState(0);
5059
- const [pageSize, setPageSize] = useState(20);
5060
- const currentSupervisor = 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);
5061
- const surveyorsData = (currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.surveyors) || [];
5062
4701
  const cards = useMemo(() => [{
5063
4702
  label: "TOTAL_EKYC_APPLICATIONS",
5064
4703
  count: (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0,
@@ -5140,100 +4779,54 @@ const SupervisorDetailsCard = () => {
5140
4779
  accessor: row => `${(row === null || row === void 0 ? void 0 : row.progressPercent) || 0}%`,
5141
4780
  id: "overallProgress"
5142
4781
  }], [t, history]);
5143
- const [showReportMenu, setShowReportMenu] = useState(false);
5144
4782
  const [customDate, setCustomDate] = useState({
5145
4783
  from: "",
5146
4784
  to: ""
5147
4785
  });
5148
- const [showCustomPicker, setShowCustomPicker] = useState(false);
5149
- const [reportLoading, setReportLoading] = useState(false);
5150
- const reportMenuRef = useRef(null);
5151
- useEffect(() => {
5152
- const handler = e => {
5153
- if (reportMenuRef.current && !reportMenuRef.current.contains(e.target)) {
5154
- setShowReportMenu(false);
5155
- setShowCustomPicker(false);
5156
- }
5157
- };
5158
- document.addEventListener("mousedown", handler);
5159
- return () => document.removeEventListener("mousedown", handler);
5160
- }, []);
5161
- const handleDownload = () => {
5162
- setReportLoading(true);
5163
- try {
5164
- const rowsWithStats = surveyors.map(s => ({
5165
- name: s.surveyorName,
5166
- mobileNo: s.mobileNo,
5167
- status: s.status,
5168
- total: s.totalKnos,
5169
- completed: s.submittedKnos,
5170
- pending: s.pendingKnos,
5171
- progress: `${s.progressPercent}%`
5172
- }));
5173
- const totalKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0;
5174
- const completedKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.submittedKnos) || 0;
5175
- downloadSupervisorPDF({
5176
- rows: rowsWithStats,
5177
- supervisorName: fullName,
5178
- vendorName,
5179
- mobileNumber,
5180
- email,
5181
- dashboardInfo: {
5182
- total: totalKnos,
5183
- completed: completedKnos,
5184
- pending: totalKnos - completedKnos,
5185
- submittedCount: completedKnos
5186
- },
5187
- t
5188
- });
5189
- } catch (err) {
5190
- console.error("Failed to generate supervisor report:", err);
5191
- } finally {
5192
- setReportLoading(false);
5193
- }
5194
- };
5195
- const handlePresetDownload = function (filter) {
5196
- try {
5197
- const range = getDateRange(filter);
5198
- if (!range) return Promise.resolve();
5199
- setShowReportMenu(false);
5200
- setShowCustomPicker(false);
5201
- return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
5202
- } catch (e) {
5203
- return Promise.reject(e);
5204
- }
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)));
5205
4807
  };
5206
- const handleCustomDownload = function () {
5207
- try {
5208
- if (!customDate.from || !customDate.to) {
5209
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
5210
- 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"
5211
4816
  }
5212
- const from = new Date(customDate.from);
5213
- from.setHours(0, 0, 0, 0);
5214
- const to = new Date(customDate.to);
5215
- to.setHours(23, 59, 59, 999);
5216
- setShowReportMenu(false);
5217
- setShowCustomPicker(false);
5218
- return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
5219
- } catch (e) {
5220
- return Promise.reject(e);
5221
- }
5222
- };
4817
+ }, t("NO_SUPERVISOR_FOUND")));
4818
+ }
5223
4819
  const handleDownloadEkycData = function (fromDate, toDate) {
5224
4820
  try {
5225
- if (!surveyors || surveyors.length === 0) {
5226
- alert(t("NO_SURVEYORS_ASSIGNED") || "No surveyors assigned to this supervisor.");
5227
- return Promise.resolve();
5228
- }
5229
4821
  setEkycDownloadLoading(true);
5230
4822
  return Promise.resolve(_finallyRethrows(function () {
5231
4823
  return _catch(function () {
5232
4824
  return Promise.resolve(Digit.EkycService.application_list({
5233
- tenantId: tenantId || "dl.djb",
4825
+ tenantId: tenantId,
5234
4826
  offset: 0,
5235
4827
  limit: 10000,
5236
- supervisorId: (supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorId) || supervisorId,
4828
+ vendorId: targetVendorId,
4829
+ ekycStatus: ekycStatus,
5237
4830
  reportDownload: true,
5238
4831
  ...(fromDate && {
5239
4832
  fromDate
@@ -5243,16 +4836,25 @@ const SupervisorDetailsCard = () => {
5243
4836
  })
5244
4837
  })).then(function (response) {
5245
4838
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
5246
- if (consumerList.length === 0) {
5247
- 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.");
5248
4841
  return;
5249
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
+ });
5250
4851
  const excelData = getEkycExcelData(consumerList, t);
5251
- const cleanFileName = `eKYC_Data_Supervisor_${fullName.replace(/[^a-zA-Z0-9]/g, "_")}`;
4852
+ const cleanFileName = `eKYC_Data_${vendorName.replace(/[^a-zA-Z0-9]/g, "_")}`;
5252
4853
  Digit.Download.Excel(excelData, cleanFileName);
5253
4854
  });
5254
4855
  }, function (error) {
5255
- 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.");
5256
4858
  });
5257
4859
  }, function (_wasThrown, _result) {
5258
4860
  setEkycDownloadLoading(false);
@@ -5263,106 +4865,50 @@ const SupervisorDetailsCard = () => {
5263
4865
  return Promise.reject(e);
5264
4866
  }
5265
4867
  };
5266
- const getDateRange = filter => {
5267
- const now = new Date();
5268
- const start = new Date(now);
5269
- if (filter === "today") {
5270
- start.setHours(0, 0, 0, 0);
5271
- return {
5272
- from: start,
5273
- to: now
5274
- };
5275
- }
5276
- if (filter === "week") {
5277
- start.setDate(now.getDate() - now.getDay());
5278
- start.setHours(0, 0, 0, 0);
5279
- return {
5280
- from: start,
5281
- to: now
5282
- };
5283
- }
5284
- if (filter === "month") {
5285
- start.setDate(1);
5286
- start.setHours(0, 0, 0, 0);
5287
- return {
5288
- from: start,
5289
- to: now
5290
- };
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);
5291
4874
  }
5292
- return null;
5293
4875
  };
5294
- const StatCard = _ref5 => {
5295
- let {
5296
- title,
5297
- value,
5298
- type,
5299
- isLoading,
5300
- icon
5301
- } = _ref5;
5302
- return /*#__PURE__*/React.createElement("div", {
5303
- className: `stat-card ${type}`
5304
- }, isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5305
- className: "stat-title skeleton skeleton-text"
5306
- }), /*#__PURE__*/React.createElement("div", {
5307
- className: "stat-value skeleton skeleton-number"
5308
- })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5309
- className: "stat-title"
5310
- }, title), /*#__PURE__*/React.createElement("div", {
5311
- className: "stat-value"
5312
- }, value), icon && /*#__PURE__*/React.createElement("div", {
5313
- className: "stat-icon"
5314
- }, icon)));
5315
- };
5316
- const isPageLoading = isProgressLoading || isSupervisorSearchLoading || isSurveyorSearchLoading || isVendorSearchLoading;
5317
- if (isPageLoading && !supervisor) {
5318
- return /*#__PURE__*/React.createElement(Loader, null);
5319
- }
5320
- if (!supervisor) {
5321
- return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
5322
- style: {
5323
- padding: "24px"
5324
- }
5325
- }, t("NO_SUPERVISOR_FOUND")));
5326
- }
5327
- return /*#__PURE__*/React.createElement(Card, {
4876
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Card, {
5328
4877
  className: "surveyor-dashboard"
5329
4878
  }, /*#__PURE__*/React.createElement("div", {
5330
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"
5331
4886
  }, /*#__PURE__*/React.createElement("div", {
5332
4887
  className: "ekyc-dashboard-header"
5333
4888
  }, /*#__PURE__*/React.createElement("div", {
5334
- className: "avatar"
5335
- }, 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", {
5336
4889
  className: "header-content"
5337
4890
  }, /*#__PURE__*/React.createElement("h2", {
5338
4891
  className: "name"
5339
4892
  }, fullName), /*#__PURE__*/React.createElement("div", {
5340
4893
  className: "designation"
5341
- }, t("FIELD_SUPERVISOR") || "Field Supervisor"))), /*#__PURE__*/React.createElement("div", {
5342
- className: "report-download"
4894
+ }, "(", t("FIELD_SUPERVISOR") || "Field Supervisor", ")"))), /*#__PURE__*/React.createElement("div", {
4895
+ className: "report-download relative"
5343
4896
  }, /*#__PURE__*/React.createElement("button", {
5344
- className: "download-btn",
5345
- disabled: reportLoading,
5346
- onClick: handleDownload
5347
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"))), /*#__PURE__*/React.createElement("div", {
5348
- className: "stats-wrapper"
5349
- }, cards.map((card, idx) => /*#__PURE__*/React.createElement(StatCard, {
5350
- key: idx,
5351
- title: t(card.label),
5352
- value: card.count,
5353
- type: card.type,
5354
- isLoading: isProgressLoading,
5355
- icon: card.icon
5356
- }))), /*#__PURE__*/React.createElement("div", {
5357
- className: "ekyc-dashboard-section"
5358
- }, /*#__PURE__*/React.createElement("div", {
5359
- className: "ekyc-details-wrapper"
5360
- }, /*#__PURE__*/React.createElement("div", {
5361
- 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"
5362
4902
  }, /*#__PURE__*/React.createElement("div", {
5363
4903
  className: "detail-item"
5364
4904
  }, /*#__PURE__*/React.createElement("span", {
5365
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"
5366
4912
  }, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
5367
4913
  className: "value"
5368
4914
  }, mobileNumber)), /*#__PURE__*/React.createElement("div", {
@@ -5371,130 +4917,36 @@ const SupervisorDetailsCard = () => {
5371
4917
  className: "label"
5372
4918
  }, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
5373
4919
  className: "value"
5374
- }, email)), /*#__PURE__*/React.createElement("div", {
5375
- className: "download-card"
5376
- }, /*#__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", {
5377
- className: "report-download",
5378
- ref: reportMenuRef
5379
- }, /*#__PURE__*/React.createElement("button", {
5380
- className: "download-excel-btn",
5381
- disabled: ekycDownloadLoading,
5382
- onClick: () => {
5383
- setShowReportMenu(p => !p);
5384
- setShowCustomPicker(false);
5385
- }
5386
- }, /*#__PURE__*/React.createElement("svg", {
5387
- width: "16",
5388
- height: "16",
5389
- viewBox: "0 0 24 24",
5390
- fill: "none",
5391
- stroke: "currentColor",
5392
- strokeWidth: "2.5",
5393
- strokeLinecap: "round",
5394
- strokeLinejoin: "round"
5395
- }, /*#__PURE__*/React.createElement("path", {
5396
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
5397
- }), /*#__PURE__*/React.createElement("polyline", {
5398
- points: "7 10 12 15 17 10"
5399
- }), /*#__PURE__*/React.createElement("line", {
5400
- x1: "12",
5401
- y1: "15",
5402
- x2: "12",
5403
- y2: "3"
5404
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
5405
- className: "report-menu"
5406
- }, [{
5407
- label: t("TODAY") || "Today",
5408
- key: "today"
5409
- }, {
5410
- label: t("THIS_WEEK") || "This Week",
5411
- key: "week"
5412
- }, {
5413
- label: t("THIS_MONTH") || "This Month",
5414
- key: "month"
5415
- }].map(_ref6 => {
5416
- let {
5417
- label,
5418
- key
5419
- } = _ref6;
5420
- return /*#__PURE__*/React.createElement("div", {
5421
- key: key,
5422
- className: "menu-item",
5423
- onClick: () => handlePresetDownload(key)
5424
- }, label);
5425
- }), /*#__PURE__*/React.createElement("div", {
5426
- className: "custom-date-trigger",
5427
- onClick: () => setShowCustomPicker(p => !p)
5428
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
5429
- className: "custom-picker"
5430
- }, /*#__PURE__*/React.createElement("div", {
5431
- className: "date-inputs"
5432
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
5433
- type: "date",
5434
- value: customDate.from,
5435
- onChange: e => setCustomDate({
5436
- ...customDate,
5437
- from: e.target.value
5438
- })
5439
- })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
5440
- type: "date",
5441
- value: customDate.to,
5442
- onChange: e => setCustomDate({
5443
- ...customDate,
5444
- to: e.target.value
5445
- })
5446
- }))), /*#__PURE__*/React.createElement("div", {
5447
- style: {
5448
- display: "flex",
5449
- gap: "10px",
5450
- marginTop: "10px"
5451
- }
5452
- }, /*#__PURE__*/React.createElement("button", {
5453
- className: "picker-cancel-btn",
5454
- onClick: () => {
5455
- setShowCustomPicker(false);
5456
- setCustomDate({
5457
- from: "",
5458
- to: ""
5459
- });
5460
- }
5461
- }, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
5462
- className: "picker-apply-btn",
5463
- onClick: handleCustomDownload
5464
- }, t("APPLY") || "Apply"))))))), /*#__PURE__*/React.createElement("div", {
4920
+ }, email))), /*#__PURE__*/React.createElement("div", {
5465
4921
  className: "details-grid-row"
5466
4922
  }, /*#__PURE__*/React.createElement("div", {
5467
4923
  className: "detail-item"
5468
4924
  }, /*#__PURE__*/React.createElement("span", {
5469
4925
  className: "label"
5470
- }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
5471
- className: "value"
5472
- }, t(gender) || gender)), /*#__PURE__*/React.createElement("div", {
5473
- className: "detail-item"
5474
- }, /*#__PURE__*/React.createElement("span", {
5475
- className: "label"
5476
- }, t("STATUS")), /*#__PURE__*/React.createElement("span", {
4926
+ }, t("ASSIGNED_ZONE") || "Assigned Zone"), /*#__PURE__*/React.createElement("span", {
5477
4927
  className: "value"
5478
- }, status)), /*#__PURE__*/React.createElement("div", {
4928
+ }, assignedZone && assignedZone !== "N/A" ? t(assignedZone.trim().toUpperCase()) || assignedZone : assignedZone)), /*#__PURE__*/React.createElement("div", {
5479
4929
  className: "detail-item"
5480
4930
  }, /*#__PURE__*/React.createElement("span", {
5481
4931
  className: "label"
5482
- }, t("ASSIGNED_ZONE") || "Assigned Zone"), /*#__PURE__*/React.createElement("span", {
4932
+ }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
5483
4933
  className: "value"
5484
- }, assignedZone && assignedZone !== "N/A" ? /*#__PURE__*/React.createElement("div", {
5485
- className: "selected-zones",
5486
- style: {
5487
- marginTop: "4px"
5488
- }
5489
- }, /*#__PURE__*/React.createElement("span", {
5490
- className: "selected-zone-chip"
5491
- }, t(assignedZone.trim().toUpperCase()) || assignedZone)) : assignedZone)), /*#__PURE__*/React.createElement("div", {
4934
+ }, t(gender) || gender)), /*#__PURE__*/React.createElement("div", {
5492
4935
  className: "detail-item"
5493
4936
  }, /*#__PURE__*/React.createElement("span", {
5494
4937
  className: "label"
5495
- }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React.createElement("span", {
4938
+ }, t("STATUS")), /*#__PURE__*/React.createElement("span", {
5496
4939
  className: "value"
5497
- }, 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, {
5498
4950
  t: t,
5499
4951
  tableTitle: t("CONNECTED_SURVEYORS") || "Connected Surveyors",
5500
4952
  tableClass: "ekycTable",
@@ -5526,7 +4978,15 @@ const SupervisorDetailsCard = () => {
5526
4978
  setPageSize(Number(e.target.value));
5527
4979
  setCurrentPage(0);
5528
4980
  }
5529
- })));
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
+ }));
5530
4990
  };
5531
4991
 
5532
4992
  const AssignEkycModal = _ref => {
@@ -5973,11 +5433,13 @@ const AssignEkycModal = _ref => {
5973
5433
  };
5974
5434
 
5975
5435
  const SurveyorDetailsCard = () => {
5976
- 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;
5977
5437
  const tenantId = Digit.ULBService.getCurrentTenantId();
5978
5438
  const [showModal, setShowModal] = useState(null);
5979
5439
  const [showOptions, setShowOptions] = useState(false);
5980
5440
  const [ekycDownloadLoading, setEkycDownloadLoading] = useState(false);
5441
+ const [showFilterModal, setShowFilterModal] = useState(false);
5442
+ const [ekycStatus, setEkycStatus] = useState("ALL");
5981
5443
  const {
5982
5444
  id: surveyorId
5983
5445
  } = useParams();
@@ -6057,15 +5519,13 @@ const SurveyorDetailsCard = () => {
6057
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";
6058
5520
  }, [supervisorSearchResponse, surveyor === null || surveyor === void 0 ? void 0 : surveyor.supervisorId, surveyor === null || surveyor === void 0 ? void 0 : surveyor.supervisorName]);
6059
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";
6060
- 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);
6061
- 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";
6062
5522
  const [currentPage, setCurrentPage] = useState(0);
6063
5523
  const [pageSize, setPageSize] = useState(20);
6064
5524
  const queryParams = {
6065
5525
  tenantId: "dl.djb",
6066
5526
  offset: currentPage * pageSize,
6067
5527
  limit: pageSize,
6068
- 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
6069
5529
  };
6070
5530
  const {
6071
5531
  isFetching: isDashboardLoading,
@@ -6122,24 +5582,10 @@ const SurveyorDetailsCard = () => {
6122
5582
  return value ? Digit.DateUtils.ConvertEpochToDate(value) : "-";
6123
5583
  }
6124
5584
  }], [t]);
6125
- const [showReportMenu, setShowReportMenu] = useState(false);
6126
5585
  const [customDate, setCustomDate] = useState({
6127
5586
  from: "",
6128
5587
  to: ""
6129
5588
  });
6130
- const [showCustomPicker, setShowCustomPicker] = useState(false);
6131
- const [reportLoading, setReportLoading] = useState(false);
6132
- const reportMenuRef = useRef(null);
6133
- useEffect(() => {
6134
- const handler = e => {
6135
- if (reportMenuRef.current && !reportMenuRef.current.contains(e.target)) {
6136
- setShowReportMenu(false);
6137
- setShowCustomPicker(false);
6138
- }
6139
- };
6140
- document.addEventListener("mousedown", handler);
6141
- return () => document.removeEventListener("mousedown", handler);
6142
- }, []);
6143
5589
  const isPageLoading = isLoading || isVendorLoading || isSupervisorSearchLoading;
6144
5590
  if (isPageLoading && !surveyor) {
6145
5591
  return /*#__PURE__*/React.createElement(Loader, null);
@@ -6151,100 +5597,6 @@ const SurveyorDetailsCard = () => {
6151
5597
  }
6152
5598
  }, t("NO_SURVEYOR_FOUND")));
6153
5599
  }
6154
- const getDateRange = filter => {
6155
- const now = new Date();
6156
- const start = new Date(now);
6157
- if (filter === "today") {
6158
- start.setHours(0, 0, 0, 0);
6159
- return {
6160
- from: start,
6161
- to: now
6162
- };
6163
- }
6164
- if (filter === "week") {
6165
- start.setDate(now.getDate() - now.getDay());
6166
- start.setHours(0, 0, 0, 0);
6167
- return {
6168
- from: start,
6169
- to: now
6170
- };
6171
- }
6172
- if (filter === "month") {
6173
- start.setDate(1);
6174
- start.setHours(0, 0, 0, 0);
6175
- return {
6176
- from: start,
6177
- to: now
6178
- };
6179
- }
6180
- return null;
6181
- };
6182
- const handleDownload = function () {
6183
- try {
6184
- setReportLoading(true);
6185
- const _temp = _finallyRethrows(function () {
6186
- return _catch(function () {
6187
- var _surveyor$owner5;
6188
- return Promise.resolve(Digit.EkycService.dashboard({}, {
6189
- tenantId: "dl.djb",
6190
- offset: 0,
6191
- limit: 1000,
6192
- surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
6193
- })).then(function (response) {
6194
- var _response$dashboardIn;
6195
- const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn = response.dashboardInfo) === null || _response$dashboardIn === void 0 ? void 0 : _response$dashboardIn.consumerList) || [];
6196
- downloadSurveyorPDF({
6197
- rows: rows,
6198
- surveyorName: fullName,
6199
- vendorName,
6200
- supervisorName,
6201
- employeeId,
6202
- mobileNumber,
6203
- dashboardInfo: (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {},
6204
- t
6205
- });
6206
- });
6207
- }, function (err) {
6208
- console.error("Failed to fetch dashboard data for report download:", err);
6209
- });
6210
- }, function (_wasThrown, _result) {
6211
- setReportLoading(false);
6212
- if (_wasThrown) throw _result;
6213
- return _result;
6214
- });
6215
- return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
6216
- } catch (e) {
6217
- return Promise.reject(e);
6218
- }
6219
- };
6220
- const handlePresetDownload = function (filter) {
6221
- try {
6222
- const range = getDateRange(filter);
6223
- if (!range) return Promise.resolve();
6224
- setShowReportMenu(false);
6225
- setShowCustomPicker(false);
6226
- return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
6227
- } catch (e) {
6228
- return Promise.reject(e);
6229
- }
6230
- };
6231
- const handleCustomDownload = function () {
6232
- try {
6233
- if (!customDate.from || !customDate.to) {
6234
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
6235
- return Promise.resolve();
6236
- }
6237
- const from = new Date(customDate.from);
6238
- from.setHours(0, 0, 0, 0);
6239
- const to = new Date(customDate.to);
6240
- to.setHours(23, 59, 59, 999);
6241
- setShowReportMenu(false);
6242
- setShowCustomPicker(false);
6243
- return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
6244
- } catch (e) {
6245
- return Promise.reject(e);
6246
- }
6247
- };
6248
5600
  const StatCard = _ref4 => {
6249
5601
  let {
6250
5602
  title,
@@ -6276,17 +5628,26 @@ const SurveyorDetailsCard = () => {
6276
5628
  setShowOptions(false);
6277
5629
  setShowModal(option.action);
6278
5630
  };
5631
+ const closeModal = function () {
5632
+ try {
5633
+ setShowModal(null);
5634
+ return Promise.resolve();
5635
+ } catch (e) {
5636
+ return Promise.reject(e);
5637
+ }
5638
+ };
6279
5639
  const handleDownloadEkycData = function (fromDate, toDate) {
6280
5640
  try {
6281
5641
  setEkycDownloadLoading(true);
6282
5642
  return Promise.resolve(_finallyRethrows(function () {
6283
5643
  return _catch(function () {
6284
- var _surveyor$owner6;
5644
+ var _surveyor$owner3;
6285
5645
  return Promise.resolve(Digit.EkycService.application_list({
6286
- tenantId: tenantId || "dl.djb",
5646
+ tenantId: tenantId,
6287
5647
  offset: 0,
6288
5648
  limit: 10000,
6289
- 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,
6290
5651
  reportDownload: true,
6291
5652
  ...(fromDate && {
6292
5653
  fromDate
@@ -6296,35 +5657,44 @@ const SurveyorDetailsCard = () => {
6296
5657
  })
6297
5658
  })).then(function (response) {
6298
5659
  const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
6299
- if (consumerList.length === 0) {
6300
- 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.");
6301
5662
  return;
6302
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
+ });
6303
5672
  const excelData = getEkycExcelData(consumerList, t);
6304
- const cleanFileName = `eKYC_Data_${fullName.replace(/[^a-zA-Z0-9]/g, "_")}`;
5673
+ const cleanFileName = `eKYC_Data_${vendorName.replace(/[^a-zA-Z0-9]/g, "_")}`;
6305
5674
  Digit.Download.Excel(excelData, cleanFileName);
6306
5675
  });
6307
5676
  }, function (error) {
6308
- 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.");
6309
5679
  });
6310
- }, function (_wasThrown2, _result2) {
5680
+ }, function (_wasThrown, _result) {
6311
5681
  setEkycDownloadLoading(false);
6312
- if (_wasThrown2) throw _result2;
6313
- return _result2;
5682
+ if (_wasThrown) throw _result;
5683
+ return _result;
6314
5684
  }));
6315
5685
  } catch (e) {
6316
5686
  return Promise.reject(e);
6317
5687
  }
6318
5688
  };
6319
- const closeModal = function () {
5689
+ const handleApplyFilters = function () {
6320
5690
  try {
6321
- setShowModal(null);
6322
- return Promise.resolve();
5691
+ setShowFilterModal(false);
5692
+ return Promise.resolve(handleDownloadEkycData(customDate.startDate.getTime(), customDate.endDate.getTime())).then(function () {});
6323
5693
  } catch (e) {
6324
5694
  return Promise.reject(e);
6325
5695
  }
6326
5696
  };
6327
- return /*#__PURE__*/React.createElement(Card, {
5697
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Card, {
6328
5698
  className: "surveyor-dashboard"
6329
5699
  }, /*#__PURE__*/React.createElement("div", {
6330
5700
  className: "ekyc-dashboard-section"
@@ -6343,142 +5713,52 @@ const SurveyorDetailsCard = () => {
6343
5713
  }, fullName), /*#__PURE__*/React.createElement("div", {
6344
5714
  className: "designation"
6345
5715
  }, "(", (surveyor === null || surveyor === void 0 ? void 0 : surveyor.description) || t("FIELD_SURVEYOR"), ")"))), /*#__PURE__*/React.createElement("div", {
6346
- className: "report-download"
5716
+ className: "report-download relative"
6347
5717
  }, /*#__PURE__*/React.createElement("button", {
6348
- className: "download-btn",
6349
- disabled: reportLoading,
6350
- onClick: handleDownload
6351
- }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report")))), /*#__PURE__*/React.createElement("div", {
6352
- 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"
6353
5723
  }, /*#__PURE__*/React.createElement("div", {
6354
5724
  className: "detail-item"
6355
5725
  }, /*#__PURE__*/React.createElement("span", {
6356
5726
  className: "label"
6357
- }, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
5727
+ }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React.createElement("span", {
6358
5728
  className: "value"
6359
- }, (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", {
6360
5730
  className: "detail-item"
6361
5731
  }, /*#__PURE__*/React.createElement("span", {
6362
5732
  className: "label"
6363
- }, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
5733
+ }, t("SUPERVISOR_NAME") || "Supervisor Name"), /*#__PURE__*/React.createElement("span", {
6364
5734
  className: "value"
6365
- }, (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", {
6366
- className: "download-card"
6367
- }, /*#__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", {
6368
- className: "report-download",
6369
- ref: reportMenuRef
6370
- }, /*#__PURE__*/React.createElement("button", {
6371
- className: "download-excel-btn",
6372
- disabled: ekycDownloadLoading,
6373
- onClick: () => {
6374
- setShowReportMenu(p => !p);
6375
- setShowCustomPicker(false);
6376
- }
6377
- }, /*#__PURE__*/React.createElement("svg", {
6378
- width: "16",
6379
- height: "16",
6380
- viewBox: "0 0 24 24",
6381
- fill: "none",
6382
- stroke: "currentColor",
6383
- strokeWidth: "2.5",
6384
- strokeLinecap: "round",
6385
- strokeLinejoin: "round"
6386
- }, /*#__PURE__*/React.createElement("path", {
6387
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
6388
- }), /*#__PURE__*/React.createElement("polyline", {
6389
- points: "7 10 12 15 17 10"
6390
- }), /*#__PURE__*/React.createElement("line", {
6391
- x1: "12",
6392
- y1: "15",
6393
- x2: "12",
6394
- y2: "3"
6395
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React.createElement("div", {
6396
- className: "report-menu"
6397
- }, [{
6398
- label: t("TODAY") || "Today",
6399
- key: "today"
6400
- }, {
6401
- label: t("THIS_WEEK") || "This Week",
6402
- key: "week"
6403
- }, {
6404
- label: t("THIS_MONTH") || "This Month",
6405
- key: "month"
6406
- }].map(_ref5 => {
6407
- let {
6408
- label,
6409
- key
6410
- } = _ref5;
6411
- return /*#__PURE__*/React.createElement("div", {
6412
- key: key,
6413
- className: "menu-item",
6414
- onClick: () => handlePresetDownload(key)
6415
- }, label);
6416
- }), /*#__PURE__*/React.createElement("div", {
6417
- className: "custom-date-trigger",
6418
- onClick: () => setShowCustomPicker(p => !p)
6419
- }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React.createElement("div", {
6420
- className: "custom-picker"
6421
- }, /*#__PURE__*/React.createElement("div", {
6422
- className: "date-inputs"
6423
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "From"), /*#__PURE__*/React.createElement("input", {
6424
- type: "date",
6425
- value: customDate.from,
6426
- onChange: e => setCustomDate({
6427
- ...customDate,
6428
- from: e.target.value
6429
- })
6430
- })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, "To"), /*#__PURE__*/React.createElement("input", {
6431
- type: "date",
6432
- value: customDate.to,
6433
- onChange: e => setCustomDate({
6434
- ...customDate,
6435
- to: e.target.value
6436
- })
6437
- }))), /*#__PURE__*/React.createElement("div", {
6438
- style: {
6439
- display: "flex",
6440
- gap: "10px",
6441
- marginTop: "10px"
6442
- }
6443
- }, /*#__PURE__*/React.createElement("button", {
6444
- className: "picker-cancel-btn",
6445
- onClick: () => {
6446
- setShowCustomPicker(false);
6447
- setCustomDate({
6448
- from: "",
6449
- to: ""
6450
- });
6451
- }
6452
- }, t("CANCEL") || "Cancel"), /*#__PURE__*/React.createElement("button", {
6453
- className: "picker-apply-btn",
6454
- onClick: handleCustomDownload
6455
- }, t("APPLY") || "Apply"))))))), /*#__PURE__*/React.createElement("div", {
6456
- className: "details-grid-row"
6457
- }, /*#__PURE__*/React.createElement("div", {
5735
+ }, supervisorName)), /*#__PURE__*/React.createElement("div", {
6458
5736
  className: "detail-item"
6459
5737
  }, /*#__PURE__*/React.createElement("span", {
6460
5738
  className: "label"
6461
- }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
5739
+ }, t("MOBILE")), /*#__PURE__*/React.createElement("span", {
6462
5740
  className: "value"
6463
- }, (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", {
6464
5744
  className: "detail-item"
6465
5745
  }, /*#__PURE__*/React.createElement("span", {
6466
5746
  className: "label"
6467
- }, t("STATUS")), /*#__PURE__*/React.createElement("span", {
5747
+ }, t("EMAIL")), /*#__PURE__*/React.createElement("span", {
6468
5748
  className: "value"
6469
- }, (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", {
6470
5750
  className: "detail-item"
6471
5751
  }, /*#__PURE__*/React.createElement("span", {
6472
5752
  className: "label"
6473
- }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React.createElement("span", {
5753
+ }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
6474
5754
  className: "value"
6475
- }, 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", {
6476
5756
  className: "detail-item"
6477
5757
  }, /*#__PURE__*/React.createElement("span", {
6478
5758
  className: "label"
6479
- }, t("SUPERVISOR_NAME") || "Supervisor Name"), /*#__PURE__*/React.createElement("span", {
5759
+ }, t("STATUS")), /*#__PURE__*/React.createElement("span", {
6480
5760
  className: "value"
6481
- }, supervisorName))))), /*#__PURE__*/React.createElement("div", {
5761
+ }, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.status) || "N/A"))))), /*#__PURE__*/React.createElement("div", {
6482
5762
  className: "stats-wrapper"
6483
5763
  }, /*#__PURE__*/React.createElement(StatCard, {
6484
5764
  title: t("TOTAL_ASSIGNED"),
@@ -6558,6 +5838,14 @@ const SurveyorDetailsCard = () => {
6558
5838
  isReassign: showModal === "EKYC_REASSIGN",
6559
5839
  closeModal: closeModal,
6560
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
6561
5849
  }));
6562
5850
  };
6563
5851
 
@@ -7315,12 +6603,12 @@ const EmployeeApp = _ref => {
7315
6603
  layoutClass: "normal"
7316
6604
  }, /*#__PURE__*/React.createElement(VendorDetailsCard, null))
7317
6605
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
7318
- path: [`${path}/supervisor-dashboard/:id`, `${path}/supervisor-dashboard`],
6606
+ path: `${path}/supervisor-dashboard/:id/:vendorId?`,
7319
6607
  component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
7320
6608
  layoutClass: "normal"
7321
6609
  }, /*#__PURE__*/React.createElement(SupervisorDetailsCard, null))
7322
6610
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
7323
- path: [`${path}/surveyor-dashboard/:id`, `${path}/surveyor-dashboard`],
6611
+ path: `${path}/surveyor-dashboard/:id?`,
7324
6612
  component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
7325
6613
  layoutClass: "normal"
7326
6614
  }, /*#__PURE__*/React.createElement(SurveyorDetailsCard, null))
@@ -9027,7 +8315,7 @@ const CitizenApp = () => {
9027
8315
  layoutClass: "normal"
9028
8316
  }, /*#__PURE__*/React.createElement(Review, null))
9029
8317
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
9030
- path: [`${path}/vendor-dashboard/:vendorId`, `${path}/vendor-dashboard`],
8318
+ path: `${path}/vendor-dashboard/:vendorId?`,
9031
8319
  component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
9032
8320
  layoutClass: "normal"
9033
8321
  }, /*#__PURE__*/React.createElement(VendorDetailsCard, null))