@djb25/digit-ui-module-ekyc 1.0.37 → 1.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -13,11 +13,22 @@ var recharts = require('recharts');
13
13
  const EKYCCard = () => {
14
14
  const _useTranslation = reactI18next.useTranslation(),
15
15
  t = _useTranslation.t;
16
+ const tenantId = Digit.ULBService.getCurrentTenantId();
17
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycApplicationList({}, {
18
+ tenantId,
19
+ offset: 0,
20
+ limit: 1
21
+ }, {
22
+ enabled: !!tenantId
23
+ }),
24
+ listData = _Digit$Hooks$ekyc$use.data,
25
+ isLoading = _Digit$Hooks$ekyc$use.isLoading;
26
+ const totalCount = isLoading ? "-" : (listData === null || listData === void 0 ? void 0 : listData.totalCount) || 0;
16
27
  const propsForModuleCard = {
17
28
  Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.PersonIcon, null),
18
29
  moduleName: t("ACTION_TEST_EKYC"),
19
30
  kpis: [{
20
- count: "-",
31
+ count: totalCount,
21
32
  label: t("TOTAL_EKYC"),
22
33
  link: "/digit-ui/employee/ekyc/dashboard"
23
34
  }],
@@ -25,6 +36,10 @@ const EKYCCard = () => {
25
36
  label: t("CEO_M.F_DOR_FINANCE_VIEW"),
26
37
  link: "/digit-ui/employee/ekyc/ceo-dashboard"
27
38
  }, {
39
+ label: t("EKYC_ADMIN_DASHBOARD") || "Admin Dashboard",
40
+ link: "/digit-ui/employee/ekyc/admin-dashboard"
41
+ }, {
42
+ count: totalCount,
28
43
  label: t("EKYC_INBOX"),
29
44
  link: "/digit-ui/employee/ekyc/inbox"
30
45
  }, {
@@ -1576,305 +1591,6 @@ const CeoDashboard = () => {
1576
1591
  }, /*#__PURE__*/React__default.createElement("h3", null, topKpis.successRate, "%"), /*#__PURE__*/React__default.createElement("p", null, "Operational Efficiency")))))));
1577
1592
  };
1578
1593
 
1579
- const VendorDetails = () => {
1580
- var _vendor$dailyPerforma, _vendor$dailyPerforma2;
1581
- const history = reactRouterDom.useHistory();
1582
- const _useParams = reactRouterDom.useParams(),
1583
- _useParams$vendorId = _useParams.vendorId,
1584
- vendorId = _useParams$vendorId === void 0 ? 1 : _useParams$vendorId;
1585
- const vendor = React.useMemo(() => ekycMockData.vendors.find(item => item.id === Number(vendorId)), [vendorId]);
1586
- const tenantId = Digit.ULBService.getCurrentTenantId();
1587
- const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycSurveyorDashboard({}, {
1588
- tenantId,
1589
- offset: 0,
1590
- limit: 10
1591
- }, {
1592
- enabled: !!tenantId
1593
- });
1594
- if (!vendor) {
1595
- return /*#__PURE__*/React__default.createElement("div", {
1596
- className: "ekyc-dashboard-wrapper"
1597
- }, /*#__PURE__*/React__default.createElement("div", {
1598
- className: "dashboard-shell"
1599
- }, /*#__PURE__*/React__default.createElement("div", {
1600
- className: "detail-header"
1601
- }, /*#__PURE__*/React__default.createElement("button", {
1602
- className: "back-button",
1603
- onClick: () => history.goBack()
1604
- }, /*#__PURE__*/React__default.createElement(fa.FaArrowLeft, null), " Back")), /*#__PURE__*/React__default.createElement("div", {
1605
- className: "empty-state"
1606
- }, /*#__PURE__*/React__default.createElement("h2", null, "Vendor analytics not found"), /*#__PURE__*/React__default.createElement("p", null, "The selected vendor does not exist in the current report. Please return to the dashboard."))));
1607
- }
1608
- const zoneRows = vendor.zones.slice(0, 8);
1609
- const performanceData = vendor.dailyPerformance.map(row => ({
1610
- day: row.day,
1611
- completed: row.completed,
1612
- pending: row.pending,
1613
- rejected: row.rejected
1614
- }));
1615
- return /*#__PURE__*/React__default.createElement("div", {
1616
- className: "ekyc-dashboard-wrapper"
1617
- }, /*#__PURE__*/React__default.createElement("div", {
1618
- className: "dashboard-shell detail-shell"
1619
- }, /*#__PURE__*/React__default.createElement("section", {
1620
- className: "kpi-grid detail-kpi-grid"
1621
- }, [{
1622
- label: "Assigned Connections",
1623
- value: vendor.assignedConnections,
1624
- icon: /*#__PURE__*/React__default.createElement(fa.FaUsers, null),
1625
- variant: "primary"
1626
- }, {
1627
- label: "Agency eKYC",
1628
- value: vendor.completedEkyc,
1629
- icon: /*#__PURE__*/React__default.createElement(fa.FaCheckCircle, null),
1630
- variant: "success"
1631
- }, {
1632
- label: "Self eKYC",
1633
- value: vendor.selfEkyc,
1634
- icon: /*#__PURE__*/React__default.createElement(fa.FaUsers, null),
1635
- variant: "info"
1636
- }, {
1637
- label: "Pending",
1638
- value: vendor.pending,
1639
- icon: /*#__PURE__*/React__default.createElement(fa.FaClock, null),
1640
- variant: "warning"
1641
- }, {
1642
- label: "Rejected",
1643
- value: vendor.rejected,
1644
- icon: /*#__PURE__*/React__default.createElement(fa.FaExclamationTriangle, null),
1645
- variant: "danger"
1646
- }, {
1647
- label: "Success Rate",
1648
- value: vendor.successRate + "%",
1649
- icon: /*#__PURE__*/React__default.createElement(fa.FaCheckCircle, null),
1650
- variant: "success"
1651
- }].map(item => {
1652
- var _item$value$toLocaleS, _item$value, _item$value$toLocaleS2;
1653
- return /*#__PURE__*/React__default.createElement("article", {
1654
- key: item.label,
1655
- className: "kpi-card card-" + item.variant
1656
- }, /*#__PURE__*/React__default.createElement("div", {
1657
- className: "kpi-icon"
1658
- }, item.icon), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("p", {
1659
- className: "kpi-title"
1660
- }, item.label), /*#__PURE__*/React__default.createElement("h2", null, (_item$value$toLocaleS = (_item$value = item.value) === null || _item$value === void 0 ? void 0 : (_item$value$toLocaleS2 = _item$value.toLocaleString) === null || _item$value$toLocaleS2 === void 0 ? void 0 : _item$value$toLocaleS2.call(_item$value)) != null ? _item$value$toLocaleS : item.value)));
1661
- })), /*#__PURE__*/React__default.createElement("section", {
1662
- className: "analytics-grid detail-analytics-grid"
1663
- }, /*#__PURE__*/React__default.createElement("div", {
1664
- className: "analytics-panel glass-card"
1665
- }, /*#__PURE__*/React__default.createElement("div", {
1666
- className: "section-header"
1667
- }, /*#__PURE__*/React__default.createElement("h2", null, "Daily Completion Trend"), /*#__PURE__*/React__default.createElement("span", {
1668
- className: "badge success"
1669
- }, "Performance")), /*#__PURE__*/React__default.createElement(ExecutiveLineChart, {
1670
- data: performanceData,
1671
- dataKey: "completed",
1672
- name: "Completed"
1673
- })), /*#__PURE__*/React__default.createElement("div", {
1674
- className: "analytics-panel glass-card"
1675
- }, /*#__PURE__*/React__default.createElement("div", {
1676
- className: "section-header"
1677
- }, /*#__PURE__*/React__default.createElement("h2", null, "Pending vs Completed"), /*#__PURE__*/React__default.createElement("span", {
1678
- className: "badge warning"
1679
- }, "Workload")), /*#__PURE__*/React__default.createElement(ExecutiveBarChart, {
1680
- data: performanceData,
1681
- categories: [{
1682
- key: "completed",
1683
- name: "Completed"
1684
- }, {
1685
- key: "pending",
1686
- name: "Pending"
1687
- }],
1688
- xKey: "day"
1689
- })), /*#__PURE__*/React__default.createElement("div", {
1690
- className: "analytics-panel glass-card"
1691
- }, /*#__PURE__*/React__default.createElement("div", {
1692
- className: "section-header"
1693
- }, /*#__PURE__*/React__default.createElement("h2", null, "Self vs Agency Split"), /*#__PURE__*/React__default.createElement("span", {
1694
- className: "badge info"
1695
- }, "Adoption")), /*#__PURE__*/React__default.createElement(ExecutivePieChart, {
1696
- data: [{
1697
- label: "Agency eKYC",
1698
- value: vendor.completedEkyc
1699
- }, {
1700
- label: "Citizen Self eKYC",
1701
- value: vendor.selfEkyc
1702
- }],
1703
- dataKey: "value",
1704
- labelKey: "label"
1705
- }))), /*#__PURE__*/React__default.createElement("section", {
1706
- className: "zone-section detail-zone-section"
1707
- }, /*#__PURE__*/React__default.createElement("div", {
1708
- className: "section-header"
1709
- }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h2", null, /*#__PURE__*/React__default.createElement(fa.FaMapMarkedAlt, null), " Zone-wise Jurisdiction Analytics"), /*#__PURE__*/React__default.createElement("p", null, "Drill into the current operational load and heatmap intensity for this vendor."))), /*#__PURE__*/React__default.createElement("div", {
1710
- className: "table-wrapper glass-card"
1711
- }, /*#__PURE__*/React__default.createElement("table", null, /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", null, "Zone"), /*#__PURE__*/React__default.createElement("th", null, "Cluster"), /*#__PURE__*/React__default.createElement("th", null, "Assigned"), /*#__PURE__*/React__default.createElement("th", null, "Agency eKYC"), /*#__PURE__*/React__default.createElement("th", null, "Pending"), /*#__PURE__*/React__default.createElement("th", null, "Activity Score"))), /*#__PURE__*/React__default.createElement("tbody", null, zoneRows.map((row, index) => {
1712
- var _row$activeDemand$toL, _row$activeDemand, _row$pppZones$toLocal, _row$pppZones, _row$inactiveDemand$t, _row$inactiveDemand;
1713
- return /*#__PURE__*/React__default.createElement("tr", {
1714
- key: row.location + "-" + index
1715
- }, /*#__PURE__*/React__default.createElement("td", null, row.location), /*#__PURE__*/React__default.createElement("td", null, row.cluster || row.district), /*#__PURE__*/React__default.createElement("td", null, (_row$activeDemand$toL = (_row$activeDemand = row.activeDemand) === null || _row$activeDemand === void 0 ? void 0 : _row$activeDemand.toLocaleString()) != null ? _row$activeDemand$toL : "—"), /*#__PURE__*/React__default.createElement("td", null, (_row$pppZones$toLocal = (_row$pppZones = row.pppZones) === null || _row$pppZones === void 0 ? void 0 : _row$pppZones.toLocaleString()) != null ? _row$pppZones$toLocal : "—"), /*#__PURE__*/React__default.createElement("td", null, (_row$inactiveDemand$t = (_row$inactiveDemand = row.inactiveDemand) === null || _row$inactiveDemand === void 0 ? void 0 : _row$inactiveDemand.toLocaleString()) != null ? _row$inactiveDemand$t : "—"), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("span", {
1716
- className: "status-badge " + (row.intensityScore > 65 ? "danger" : row.intensityScore > 45 ? "warning" : "success")
1717
- }, row.intensityScore, "%")));
1718
- }))))), /*#__PURE__*/React__default.createElement("section", {
1719
- className: "bottom-grid detail-bottom-grid"
1720
- }, /*#__PURE__*/React__default.createElement("div", {
1721
- className: "cards-summary glass-card"
1722
- }, /*#__PURE__*/React__default.createElement("h2", null, "Operational Efficiency"), /*#__PURE__*/React__default.createElement("div", {
1723
- className: "efficiency-grid"
1724
- }, /*#__PURE__*/React__default.createElement("div", {
1725
- className: "efficiency-box"
1726
- }, /*#__PURE__*/React__default.createElement("h3", null, vendor.activeSurveyors), /*#__PURE__*/React__default.createElement("p", null, "Active Surveyors")), /*#__PURE__*/React__default.createElement("div", {
1727
- className: "efficiency-box"
1728
- }, /*#__PURE__*/React__default.createElement("h3", null, vendor.supervisors), /*#__PURE__*/React__default.createElement("p", null, "Supervisors")), /*#__PURE__*/React__default.createElement("div", {
1729
- className: "efficiency-box"
1730
- }, /*#__PURE__*/React__default.createElement("h3", null, vendor.progress, "%"), /*#__PURE__*/React__default.createElement("p", null, "Execution Rate")), /*#__PURE__*/React__default.createElement("div", {
1731
- className: "efficiency-box"
1732
- }, /*#__PURE__*/React__default.createElement("h3", null, (_vendor$dailyPerforma = vendor.dailyPerformance.slice(-1)[0]) === null || _vendor$dailyPerforma === void 0 ? void 0 : (_vendor$dailyPerforma2 = _vendor$dailyPerforma.completed) === null || _vendor$dailyPerforma2 === void 0 ? void 0 : _vendor$dailyPerforma2.toLocaleString()), /*#__PURE__*/React__default.createElement("p", null, "Latest Day Completed")))), /*#__PURE__*/React__default.createElement("div", {
1733
- className: "cards-summary glass-card"
1734
- }, /*#__PURE__*/React__default.createElement("h2", null, "Supervisor Pulse"), /*#__PURE__*/React__default.createElement("div", {
1735
- className: "pulse-list"
1736
- }, vendor.jurisdictions.map(zone => /*#__PURE__*/React__default.createElement("div", {
1737
- key: zone,
1738
- className: "pulse-row"
1739
- }, /*#__PURE__*/React__default.createElement("span", null, zone), /*#__PURE__*/React__default.createElement("span", null, Math.max(12, Math.round(Math.random() * 38)), " active"))))))));
1740
- };
1741
-
1742
- const useInboxTableConfig = _ref => {
1743
- var _formState$tableForm, _formState$tableForm2, _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _formState$searchForm;
1744
- let onPageSizeChange = _ref.onPageSizeChange,
1745
- formState = _ref.formState,
1746
- totalCount = _ref.totalCount,
1747
- table = _ref.table,
1748
- dispatch = _ref.dispatch,
1749
- checkPathName = _ref.checkPathName,
1750
- onSortingByData = _ref.onSortingByData,
1751
- tenantId = _ref.tenantId,
1752
- _ref$inboxStyles = _ref.inboxStyles,
1753
- inboxStyles = _ref$inboxStyles === void 0 ? {} : _ref$inboxStyles,
1754
- _ref$tableStyle = _ref.tableStyle,
1755
- tableStyle = _ref$tableStyle === void 0 ? {} : _ref$tableStyle;
1756
- const _useTranslation = reactI18next.useTranslation(),
1757
- t = _useTranslation.t;
1758
- const history = reactRouterDom.useHistory();
1759
- const _useState = React.useState(""),
1760
- selectedKno = _useState[0],
1761
- setSelectedKno = _useState[1];
1762
- const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAPI("review", tenantId),
1763
- reviewData = _Digit$Hooks$ekyc$use.data,
1764
- getReview = _Digit$Hooks$ekyc$use.getReview;
1765
- const handleReview = kno => {
1766
- setSelectedKno(kno);
1767
- getReview({
1768
- kno
1769
- });
1770
- };
1771
- const limit = (formState === null || formState === void 0 ? void 0 : (_formState$tableForm = formState.tableForm) === null || _formState$tableForm === void 0 ? void 0 : _formState$tableForm.limit) || 10;
1772
- const offset = (formState === null || formState === void 0 ? void 0 : (_formState$tableForm2 = formState.tableForm) === null || _formState$tableForm2 === void 0 ? void 0 : _formState$tableForm2.offset) || 0;
1773
- 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";
1774
- React__default.useEffect(() => {
1775
- if (reviewData) {
1776
- history.push("/digit-ui/" + userType + "/ekyc/review/" + selectedKno, {
1777
- aadhaarData: reviewData === null || reviewData === void 0 ? void 0 : reviewData.aadhaarData,
1778
- reviewData
1779
- });
1780
- }
1781
- }, [reviewData]);
1782
- const tableColumnConfig = [{
1783
- Header: t("EKYC_APPLICATION_NO"),
1784
- accessor: "applicationNumber",
1785
- disableSortBy: true,
1786
- Cell: _ref2 => {
1787
- var _row$original, _row$original2;
1788
- let row = _ref2.row;
1789
- const kno = ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.kno) || ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.applicationNumber) || "NA";
1790
- return /*#__PURE__*/React__default.createElement("span", {
1791
- className: "link",
1792
- onClick: () => handleReview(kno)
1793
- }, kno);
1794
- }
1795
- }, {
1796
- Header: t("EKYC_CITIZEN_NAME"),
1797
- accessor: "citizenName",
1798
- Cell: _ref3 => {
1799
- var _row$original3;
1800
- let row = _ref3.row;
1801
- return /*#__PURE__*/React__default.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
1802
- }
1803
- }, {
1804
- Header: t("EKYC_STATUS"),
1805
- accessor: "actionStatus",
1806
- Cell: _ref4 => {
1807
- var _row$original4;
1808
- let row = _ref4.row;
1809
- const status = ((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT";
1810
- return /*#__PURE__*/React__default.createElement("span", {
1811
- className: "ekyc-status-tag " + status
1812
- }, t("" + status));
1813
- }
1814
- }, {
1815
- Header: t("EKYC_EKYC_STATUS"),
1816
- accessor: "ekycStatus",
1817
- Cell: _ref5 => {
1818
- var _row$original5, _row$original6;
1819
- let row = _ref5.row;
1820
- const ekycStatus = (((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.ekycStatus) || ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycstatus) || "NA").toUpperCase();
1821
- return /*#__PURE__*/React__default.createElement("span", {
1822
- className: "ekyc-status-tag " + ekycStatus
1823
- }, t("" + ekycStatus));
1824
- }
1825
- }];
1826
- return {
1827
- disableSort: false,
1828
- autoSort: false,
1829
- manualPagination: true,
1830
- initSortId: "applicationDate",
1831
- onPageSizeChange: onPageSizeChange,
1832
- currentPage: offset,
1833
- onNextPage: () => {
1834
- var _formState$tableForm3;
1835
- return dispatch({
1836
- action: "mutateTableForm",
1837
- data: _extends({}, formState.tableForm, {
1838
- offset: parseInt((_formState$tableForm3 = formState.tableForm) === null || _formState$tableForm3 === void 0 ? void 0 : _formState$tableForm3.offset) + limit
1839
- }),
1840
- checkPathName
1841
- });
1842
- },
1843
- onPrevPage: () => {
1844
- var _formState$tableForm4;
1845
- return dispatch({
1846
- action: "mutateTableForm",
1847
- data: _extends({}, formState.tableForm, {
1848
- offset: parseInt((_formState$tableForm4 = formState.tableForm) === null || _formState$tableForm4 === void 0 ? void 0 : _formState$tableForm4.offset) - limit
1849
- }),
1850
- checkPathName
1851
- });
1852
- },
1853
- pageSizeLimit: limit,
1854
- onSort: onSortingByData,
1855
- totalRecords: totalCount,
1856
- onSearch: formState === null || formState === void 0 ? void 0 : (_formState$searchForm = formState.searchForm) === null || _formState$searchForm === void 0 ? void 0 : _formState$searchForm.message,
1857
- onLastPage: () => dispatch({
1858
- action: "mutateTableForm",
1859
- data: _extends({}, formState.tableForm, {
1860
- offset: Math.max(0, Math.floor((totalCount - 1) / limit) * limit)
1861
- }),
1862
- checkPathName
1863
- }),
1864
- onFirstPage: () => dispatch({
1865
- action: "mutateTableForm",
1866
- data: _extends({}, formState.tableForm, {
1867
- offset: 0
1868
- }),
1869
- checkPathName
1870
- }),
1871
- data: table,
1872
- columns: tableColumnConfig,
1873
- inboxStyles: _extends({}, inboxStyles),
1874
- tableStyle: _extends({}, tableStyle)
1875
- };
1876
- };
1877
-
1878
1594
  const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
1879
1595
  const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
1880
1596
  function _catch(body, recover) {
@@ -1900,35 +1616,937 @@ function _finallyRethrows(body, finalizer) {
1900
1616
  return finalizer(false, result);
1901
1617
  }
1902
1618
 
1903
- var isNullOrUndefined = value => value == null;
1904
- const isObjectType = value => typeof value === 'object';
1905
- var isObject = value => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !(value instanceof Date);
1906
- var isKey = value => /^\w*$/.test(value);
1907
- var compact = value => value.filter(Boolean);
1908
- var stringToPath = input => compact(input.replace(/["|']/g, '').replace(/\[/g, '.').replace(/\]/g, '').split('.'));
1909
- function set(object, path, value) {
1910
- let index = -1;
1911
- const tempPath = isKey(path) ? [path] : stringToPath(path);
1912
- const length = tempPath.length;
1913
- const lastIndex = length - 1;
1914
- while (++index < length) {
1915
- const key = tempPath[index];
1916
- let newValue = value;
1917
- if (index !== lastIndex) {
1918
- const objValue = object[key];
1919
- newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
1920
- }
1921
- object[key] = newValue;
1922
- object = object[key];
1923
- }
1924
- return object;
1925
- }
1926
- var isUndefined = val => val === undefined;
1927
- var get = function (obj, path, defaultValue) {
1928
- if (obj === void 0) {
1929
- obj = {};
1930
- }
1931
- const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
1619
+ const downloadSurveyorPDF = function (_ref) {
1620
+ let rows = _ref.rows,
1621
+ surveyorName = _ref.surveyorName,
1622
+ employeeId = _ref.employeeId,
1623
+ mobileNumber = _ref.mobileNumber,
1624
+ vendorName = _ref.vendorName,
1625
+ supervisorName = _ref.supervisorName,
1626
+ dashboardInfo = _ref.dashboardInfo,
1627
+ t = _ref.t;
1628
+ try {
1629
+ const tenantId = Digit.ULBService.getCurrentTenantId();
1630
+ const initData = Digit.SessionStorage.get("initData");
1631
+ const tenants = (initData === null || initData === void 0 ? void 0 : initData.tenants) || [];
1632
+ const tenantInfo = tenants.find(tenant => tenant.code === tenantId);
1633
+ const capitalize = text => text && text.substr(0, 1).toUpperCase() + text.substr(1);
1634
+ const ulbCamel = ulb => ulb && ulb.toLowerCase().split(" ").map(capitalize).join(" ");
1635
+ const name = "Delhi Jal Board";
1636
+ const email = "contact@delhijalboard.nic.in";
1637
+ const phoneNumber = "+91-11-23538416";
1638
+ const currentDate = new Date();
1639
+ const formattedDate = currentDate.toLocaleDateString("en-IN", {
1640
+ day: "2-digit",
1641
+ month: "2-digit",
1642
+ year: "numeric"
1643
+ });
1644
+ const formattedTime = currentDate.toLocaleTimeString("en-IN", {
1645
+ hour: "2-digit",
1646
+ minute: "2-digit",
1647
+ second: "2-digit",
1648
+ hour12: false
1649
+ });
1650
+ const downloadDateTime = formattedDate + " " + formattedTime;
1651
+ const isValDefined = val => val !== undefined && val !== null && val !== "";
1652
+ const details = [{
1653
+ title: t("SURVEYOR_DETAILS"),
1654
+ asSectionHeader: true,
1655
+ values: [{
1656
+ title: t("SURVEYOR_NAME"),
1657
+ value: surveyorName
1658
+ }, {
1659
+ title: t("MOBILE_NUMBER"),
1660
+ value: mobileNumber
1661
+ }, {
1662
+ title: t("VENDOR_NAME"),
1663
+ value: vendorName
1664
+ }, {
1665
+ title: t("SUPERVISOR_NAME"),
1666
+ value: supervisorName
1667
+ }].filter(item => isValDefined(item.value))
1668
+ }, {
1669
+ title: t("SUMMARY_STATISTICS"),
1670
+ asSectionHeader: true,
1671
+ values: [{
1672
+ title: t("TOTAL_ASSIGNED"),
1673
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
1674
+ }, {
1675
+ title: t("COMPLETED"),
1676
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
1677
+ }, {
1678
+ title: t("PENDING"),
1679
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
1680
+ }, {
1681
+ title: t("SUBMITTED"),
1682
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
1683
+ }].filter(item => isValDefined(item.value))
1684
+ }];
1685
+ if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
1686
+ window.Digit.Utils.pdf.generateSurveyorReport({
1687
+ tenantId,
1688
+ logo: null,
1689
+ name,
1690
+ email,
1691
+ phoneNumber,
1692
+ heading: t("EKYC_SURVEYOR_REPORT"),
1693
+ details,
1694
+ applicationNumber: employeeId,
1695
+ rows,
1696
+ t,
1697
+ hideApplicationNumber: true,
1698
+ downloadTime: downloadDateTime
1699
+ });
1700
+ } else {
1701
+ console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
1702
+ }
1703
+ return Promise.resolve();
1704
+ } catch (e) {
1705
+ return Promise.reject(e);
1706
+ }
1707
+ };
1708
+ const downloadVendorPDF = function (_ref3) {
1709
+ let rows = _ref3.rows,
1710
+ vendorName = _ref3.vendorName,
1711
+ mobileNumber = _ref3.mobileNumber,
1712
+ email = _ref3.email,
1713
+ dashboardInfo = _ref3.dashboardInfo,
1714
+ t = _ref3.t;
1715
+ try {
1716
+ const tenantId = Digit.ULBService.getCurrentTenantId();
1717
+ const name = "Delhi Jal Board";
1718
+ const emailContact = "contact@delhijalboard.nic.in";
1719
+ const phoneNumber = "+91-11-23538416";
1720
+ const currentDate = new Date();
1721
+ const formattedDate = currentDate.toLocaleDateString("en-IN", {
1722
+ day: "2-digit",
1723
+ month: "2-digit",
1724
+ year: "numeric"
1725
+ });
1726
+ const formattedTime = currentDate.toLocaleTimeString("en-IN", {
1727
+ hour: "2-digit",
1728
+ minute: "2-digit",
1729
+ second: "2-digit",
1730
+ hour12: false
1731
+ });
1732
+ const downloadDateTime = formattedDate + " " + formattedTime;
1733
+ const isValDefined = val => val !== undefined && val !== null && val !== "";
1734
+ const details = [{
1735
+ title: t("VENDOR_DETAILS") || "Vendor Details",
1736
+ asSectionHeader: true,
1737
+ values: [{
1738
+ title: t("VENDOR_NAME") || "Vendor Name",
1739
+ value: vendorName
1740
+ }, {
1741
+ title: t("MOBILE_NUMBER") || "Mobile Number",
1742
+ value: mobileNumber
1743
+ }, {
1744
+ title: t("EMAIL") || "Email",
1745
+ value: email
1746
+ }].filter(item => isValDefined(item.value))
1747
+ }, {
1748
+ title: t("SUMMARY_STATISTICS") || "Summary Statistics",
1749
+ asSectionHeader: true,
1750
+ values: [{
1751
+ title: t("TOTAL_ASSIGNED") || "Total Assigned",
1752
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
1753
+ }, {
1754
+ title: t("COMPLETED") || "Completed",
1755
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
1756
+ }, {
1757
+ title: t("PENDING") || "Pending",
1758
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
1759
+ }, {
1760
+ title: t("SUBMITTED") || "Submitted",
1761
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
1762
+ }].filter(item => isValDefined(item.value))
1763
+ }];
1764
+ const mappedRows = rows.map(row => ({
1765
+ kno: row.name || "N/A",
1766
+ firstName: row.mobileNo || "N/A",
1767
+ lastName: "",
1768
+ mobileNo: row.status || "N/A",
1769
+ zoneName: String(row.total || 0),
1770
+ ekycStatus: (row.completed || 0) + " / " + (row.pending || 0),
1771
+ submittedAt: 1717171717171,
1772
+ progress: row.progress || "0%"
1773
+ }));
1774
+ const originalToLocaleDateString = Date.prototype.toLocaleDateString;
1775
+ let progressIndex = 0;
1776
+ Date.prototype.toLocaleDateString = function () {
1777
+ if (progressIndex < mappedRows.length) {
1778
+ return mappedRows[progressIndex++].progress || "0%";
1779
+ }
1780
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1781
+ args[_key2] = arguments[_key2];
1782
+ }
1783
+ return originalToLocaleDateString.apply(this, args);
1784
+ };
1785
+ const customT = key => {
1786
+ if (key === "KNO") return t("SUPERVISOR_NAME") || "Supervisor Name";
1787
+ if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
1788
+ if (key === "MOBILE") return t("STATUS") || "Status";
1789
+ if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
1790
+ if (key === "EKYC_STATUS") return t("COMPLETED_PENDING") || "Completed / Pending";
1791
+ if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
1792
+ if (key === "CONSUMER_LIST") return t("CONNECTED_SUPERVISORS") || "Connected Supervisors";
1793
+ return t(key);
1794
+ };
1795
+ try {
1796
+ if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
1797
+ window.Digit.Utils.pdf.generateSurveyorReport({
1798
+ tenantId,
1799
+ logo: null,
1800
+ name,
1801
+ email: emailContact,
1802
+ phoneNumber,
1803
+ heading: t("EKYC_VENDOR_REPORT") || "eKYC Vendor Report",
1804
+ details,
1805
+ applicationNumber: mobileNumber,
1806
+ rows: mappedRows,
1807
+ t: customT,
1808
+ hideApplicationNumber: true,
1809
+ downloadTime: downloadDateTime
1810
+ });
1811
+ } else {
1812
+ console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
1813
+ }
1814
+ } finally {
1815
+ Date.prototype.toLocaleDateString = originalToLocaleDateString;
1816
+ }
1817
+ return Promise.resolve();
1818
+ } catch (e) {
1819
+ return Promise.reject(e);
1820
+ }
1821
+ };
1822
+
1823
+ const VendorDetailsCard = () => {
1824
+ var _Digit$SessionStorage, _vendor$owner, _vendor$owner2, _vendorName$charAt;
1825
+ const _useTranslation = reactI18next.useTranslation(),
1826
+ t = _useTranslation.t;
1827
+ const history = reactRouterDom.useHistory();
1828
+ const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
1829
+ const _useParams = reactRouterDom.useParams(),
1830
+ vendorId = _useParams.vendorId;
1831
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
1832
+ enabled: !!tenantId,
1833
+ keepPreviousData: true
1834
+ }),
1835
+ isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
1836
+ progressData = _Digit$Hooks$ekyc$use.data;
1837
+ const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
1838
+ status: "ACTIVE"
1839
+ }, {
1840
+ enabled: !!tenantId
1841
+ }),
1842
+ vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
1843
+ isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
1844
+ const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorSearch(tenantId, {
1845
+ status: "ACTIVE"
1846
+ }, {
1847
+ enabled: !!tenantId
1848
+ }),
1849
+ supervisorSearchResponse = _Digit$Hooks$fsm$useS.data,
1850
+ isSupervisorSearchLoading = _Digit$Hooks$fsm$useS.isLoading;
1851
+ const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
1852
+ const vendor = React.useMemo(() => {
1853
+ const userUuid = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid;
1854
+ const userMobile = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber;
1855
+ const matchesUser = v => {
1856
+ var _v$owner, _v$owner2, _v$owner3;
1857
+ const ownerUuid = ((_v$owner = v.owner) === null || _v$owner === void 0 ? void 0 : _v$owner.uuid) || ((_v$owner2 = v.owner) === null || _v$owner2 === void 0 ? void 0 : _v$owner2.id);
1858
+ const ownerMobile = ((_v$owner3 = v.owner) === null || _v$owner3 === void 0 ? void 0 : _v$owner3.mobileNumber) || v.mobileNumber;
1859
+ return userUuid && ownerUuid === userUuid || userMobile && ownerMobile === userMobile;
1860
+ };
1861
+ if (vendorSearchResponse) {
1862
+ if (vendorId) {
1863
+ const matched = vendorSearchResponse.find(v => {
1864
+ var _v$dsoDetails, _v$dsoDetails2;
1865
+ return ((_v$dsoDetails = v.dsoDetails) === null || _v$dsoDetails === void 0 ? void 0 : _v$dsoDetails.id) === vendorId || ((_v$dsoDetails2 = v.dsoDetails) === null || _v$dsoDetails2 === void 0 ? void 0 : _v$dsoDetails2.vendorId) === vendorId || v.id === vendorId || v.vendorId === vendorId;
1866
+ });
1867
+ if (matched) return matched.dsoDetails || matched;
1868
+ } else {
1869
+ const matched = vendorSearchResponse.find(v => matchesUser(v.dsoDetails || v));
1870
+ if (matched) return matched.dsoDetails || matched;
1871
+ if (vendorSearchResponse.length > 0) return vendorSearchResponse[0].dsoDetails || vendorSearchResponse[0];
1872
+ }
1873
+ }
1874
+ if (vendorId) {
1875
+ return ekycMockData.vendors.find(v => v.id === Number(vendorId) || v.name === vendorId) || ekycMockData.vendors[0];
1876
+ } else {
1877
+ const matchedMock = ekycMockData.vendors.find(v => {
1878
+ var _v$name, _loggedInUser$name;
1879
+ return ((_v$name = v.name) === null || _v$name === void 0 ? void 0 : _v$name.toLowerCase()) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$name = loggedInUser.name) === null || _loggedInUser$name === void 0 ? void 0 : _loggedInUser$name.toLowerCase());
1880
+ });
1881
+ return matchedMock || ekycMockData.vendors[0];
1882
+ }
1883
+ }, [vendorSearchResponse, vendorId, loggedInUser]);
1884
+ const vendorSupervisors = React.useMemo(() => {
1885
+ if (!(supervisorSearchResponse !== null && supervisorSearchResponse !== void 0 && supervisorSearchResponse.supervisors)) {
1886
+ if (vendor && Array.isArray(ekycMockData.vendors)) {
1887
+ const mockSupList = Array.from({
1888
+ length: vendor.supervisors || 5
1889
+ }, (_, i) => ({
1890
+ id: "SUP_V_" + (vendor.id || 1) + "_" + i,
1891
+ name: "Supervisor " + (i + 1) + " (" + vendor.name + ")",
1892
+ mobileNo: "99999120" + i,
1893
+ status: "ACTIVE",
1894
+ totalKnos: Math.round(1000 + Math.random() * 4000),
1895
+ submittedKnos: Math.round(500 + Math.random() * 2000),
1896
+ pendingKnos: Math.round(200 + Math.random() * 1000),
1897
+ progressPercent: Math.round(40 + Math.random() * 50)
1898
+ }));
1899
+ return mockSupList;
1900
+ }
1901
+ return [];
1902
+ }
1903
+ const currentVendorId = (vendor === null || vendor === void 0 ? void 0 : vendor.id) || (vendor === null || vendor === void 0 ? void 0 : vendor.vendorId) || vendorId;
1904
+ const matchedSups = supervisorSearchResponse.supervisors.filter(s => s.vendorId === currentVendorId);
1905
+ return matchedSups.map(sup => {
1906
+ var _progressData$supervi, _sup$owner2, _sup$owner3, _sup$owner4;
1907
+ const report = progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.find(r => {
1908
+ var _sup$owner;
1909
+ return r.supervisorId === sup.id || r.supervisorId === ((_sup$owner = sup.owner) === null || _sup$owner === void 0 ? void 0 : _sup$owner.uuid);
1910
+ });
1911
+ return {
1912
+ id: sup.id || ((_sup$owner2 = sup.owner) === null || _sup$owner2 === void 0 ? void 0 : _sup$owner2.uuid),
1913
+ name: sup.name || ((_sup$owner3 = sup.owner) === null || _sup$owner3 === void 0 ? void 0 : _sup$owner3.name) || "N/A",
1914
+ mobileNo: ((_sup$owner4 = sup.owner) === null || _sup$owner4 === void 0 ? void 0 : _sup$owner4.mobileNumber) || sup.mobileNo || "N/A",
1915
+ status: sup.status || "ACTIVE",
1916
+ totalKnos: (report === null || report === void 0 ? void 0 : report.totalKnos) || 0,
1917
+ submittedKnos: (report === null || report === void 0 ? void 0 : report.submittedKnos) || 0,
1918
+ pendingKnos: (report === null || report === void 0 ? void 0 : report.pendingKnos) || 0,
1919
+ progressPercent: (report === null || report === void 0 ? void 0 : report.progressPercent) || 0
1920
+ };
1921
+ });
1922
+ }, [supervisorSearchResponse, vendor, progressData, vendorId]);
1923
+ const vendorName = (vendor === null || vendor === void 0 ? void 0 : vendor.name) || "N/A";
1924
+ 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";
1925
+ 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";
1926
+ const status = vendor ? "ACTIVE" : "N/A";
1927
+ const jurisdictions = React.useMemo(() => {
1928
+ if (Array.isArray(vendor === null || vendor === void 0 ? void 0 : vendor.jurisdictions)) {
1929
+ return vendor.jurisdictions.join(", ");
1930
+ }
1931
+ return "N/A";
1932
+ }, [vendor]);
1933
+ const cards = React.useMemo(() => {
1934
+ const hasRealData = vendorSupervisors.some(s => s.totalKnos > 0);
1935
+ const totalKnos = hasRealData ? vendorSupervisors.reduce((acc, s) => acc + (s.totalKnos || 0), 0) : (progressData === null || progressData === void 0 ? void 0 : progressData.totalKnos) || (vendor === null || vendor === void 0 ? void 0 : vendor.assignedConnections) || 0;
1936
+ const completedKnos = hasRealData ? vendorSupervisors.reduce((acc, s) => acc + (s.submittedKnos || 0), 0) : (progressData === null || progressData === void 0 ? void 0 : progressData.completedKnos) || (vendor === null || vendor === void 0 ? void 0 : vendor.completedEkyc) || 0;
1937
+ const pendingKnos = hasRealData ? vendorSupervisors.reduce((acc, s) => acc + (s.pendingKnos || 0), 0) : totalKnos - completedKnos;
1938
+ const progressPercent = totalKnos > 0 ? Math.round(completedKnos / totalKnos * 100) : (vendor === null || vendor === void 0 ? void 0 : vendor.progress) || 0;
1939
+ return [{
1940
+ label: "TOTAL_EKYC_APPLICATIONS",
1941
+ count: totalKnos,
1942
+ color: "#0B2559",
1943
+ type: "today",
1944
+ icon: /*#__PURE__*/React__default.createElement(fa.FaUsers, null)
1945
+ }, {
1946
+ label: "TOTAL_ASSIGNMENTS",
1947
+ count: totalKnos,
1948
+ color: "#3B82F6",
1949
+ type: "week",
1950
+ icon: /*#__PURE__*/React__default.createElement(fa.FaMapMarkedAlt, null)
1951
+ }, {
1952
+ label: "EKYC_COMPLETED",
1953
+ count: completedKnos,
1954
+ color: "#10B981",
1955
+ type: "month",
1956
+ icon: /*#__PURE__*/React__default.createElement(fa.FaCheckCircle, null)
1957
+ }, {
1958
+ label: "PENDING_APPLICATIONS",
1959
+ count: pendingKnos,
1960
+ color: "#F59E0B",
1961
+ type: "pending",
1962
+ icon: /*#__PURE__*/React__default.createElement(fa.FaClock, null)
1963
+ }, {
1964
+ label: "OVERALL_PROGRESS",
1965
+ count: progressPercent + "%",
1966
+ color: "#A855F7",
1967
+ type: "progress",
1968
+ icon: /*#__PURE__*/React__default.createElement(fa.FaChartLine, null)
1969
+ }];
1970
+ }, [vendorSupervisors, vendor, progressData]);
1971
+ const _useState = React.useState(0),
1972
+ currentPage = _useState[0],
1973
+ setCurrentPage = _useState[1];
1974
+ const _useState2 = React.useState(20),
1975
+ pageSize = _useState2[0],
1976
+ setPageSize = _useState2[1];
1977
+ const _useState3 = React.useState(false),
1978
+ ekycDownloadLoading = _useState3[0],
1979
+ setEkycDownloadLoading = _useState3[1];
1980
+ const handleDownloadEkycData = function () {
1981
+ try {
1982
+ setEkycDownloadLoading(true);
1983
+ return Promise.resolve(_finallyRethrows(function () {
1984
+ return _catch(function () {
1985
+ return Promise.resolve(Digit.EkycService.application_list({
1986
+ tenantId: tenantId,
1987
+ offset: 0,
1988
+ limit: 10000,
1989
+ reportDownload: true
1990
+ })).then(function (response) {
1991
+ const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
1992
+ if (!consumerList || consumerList.length === 0) {
1993
+ alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
1994
+ return;
1995
+ }
1996
+ const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
1997
+ const headerMapping = {
1998
+ kno: t("KNO") || "KNO",
1999
+ firstName: t("FIRST_NAME") || "First Name",
2000
+ middleName: t("MIDDLE_NAME") || "Middle Name",
2001
+ lastName: t("LAST_NAME") || "Last Name",
2002
+ gender: t("GENDER") || "Gender",
2003
+ mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
2004
+ emailId: t("EMAIL_ID") || "Email ID",
2005
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
2006
+ relationship: t("RELATIONSHIP") || "Relationship",
2007
+ dob: t("DOB") || "Date of Birth",
2008
+ ekycStatus: t("EKYC_STATUS") || "eKYC Status",
2009
+ zoneName: t("ZONE") || "Zone",
2010
+ assembly: t("ASSEMBLY") || "Assembly",
2011
+ ward: t("WARD") || "Ward",
2012
+ pincode: t("PINCODE") || "Pincode",
2013
+ mrkey: t("MR_KEY") || "MR Key",
2014
+ createdTime: t("CREATED_TIME") || "Created Time",
2015
+ lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
2016
+ };
2017
+ const excelData = consumerList.map(item => {
2018
+ const cleanObj = {};
2019
+ const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
2020
+ if (fullName) {
2021
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
2022
+ }
2023
+ Object.keys(item).forEach(key => {
2024
+ if (excludedKeys.includes(key)) return;
2025
+ const val = item[key];
2026
+ if (typeof val === "object" && val !== null) {
2027
+ return;
2028
+ }
2029
+ const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
2030
+ cleanObj[friendlyHeader] = val;
2031
+ });
2032
+ return cleanObj;
2033
+ });
2034
+ const cleanFileName = "eKYC_Data_" + vendorName.replace(/[^a-zA-Z0-9]/g, "_");
2035
+ Digit.Download.Excel(excelData, cleanFileName);
2036
+ });
2037
+ }, function (error) {
2038
+ console.error("Failed to download eKYC data:", error);
2039
+ alert(t("EKYC_DOWNLOAD_FAILED") || "Failed to download eKYC data. Please try again.");
2040
+ });
2041
+ }, function (_wasThrown, _result) {
2042
+ setEkycDownloadLoading(false);
2043
+ if (_wasThrown) throw _result;
2044
+ return _result;
2045
+ }));
2046
+ } catch (e) {
2047
+ return Promise.reject(e);
2048
+ }
2049
+ };
2050
+ const paginatedSupervisors = React.useMemo(() => {
2051
+ const start = currentPage * pageSize;
2052
+ const end = start + pageSize;
2053
+ return vendorSupervisors.slice(start, end);
2054
+ }, [vendorSupervisors, currentPage, pageSize]);
2055
+ const supervisorColumns = React.useMemo(() => [{
2056
+ Header: t("SUPERVISOR_NAME") || "Supervisor Name",
2057
+ accessor: row => (row === null || row === void 0 ? void 0 : row.name) || "N/A",
2058
+ Cell: _ref => {
2059
+ var _row$original;
2060
+ let row = _ref.row;
2061
+ return /*#__PURE__*/React__default.createElement("a", {
2062
+ href: "/digit-ui/employee/ekyc/assign/surveyor-details/" + row.original.id,
2063
+ style: {
2064
+ color: "#1D70B8",
2065
+ fontWeight: "600",
2066
+ textDecoration: "none"
2067
+ },
2068
+ onClick: e => {
2069
+ var _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4;
2070
+ 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";
2071
+ e.preventDefault();
2072
+ history.push("/digit-ui/" + userType + "/ekyc/assign/surveyor-details/" + row.original.id);
2073
+ }
2074
+ }, ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.name) || "N/A");
2075
+ }
2076
+ }, {
2077
+ Header: t("MOBILE_NUMBER") || "Mobile Number",
2078
+ accessor: row => (row === null || row === void 0 ? void 0 : row.mobileNo) || "N/A",
2079
+ id: "mobileNumber"
2080
+ }, {
2081
+ Header: t("STATUS") || "Status",
2082
+ accessor: row => (row === null || row === void 0 ? void 0 : row.status) || "ACTIVE",
2083
+ id: "status",
2084
+ Cell: _ref2 => {
2085
+ let value = _ref2.value;
2086
+ return /*#__PURE__*/React__default.createElement("span", {
2087
+ className: "status-badge verified"
2088
+ }, t(value) || value);
2089
+ }
2090
+ }, {
2091
+ Header: t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications",
2092
+ accessor: row => (row === null || row === void 0 ? void 0 : row.totalKnos) || 0,
2093
+ id: "totalEkycApplications"
2094
+ }, {
2095
+ Header: t("EKYC_COMPLETED") || "eKYC Completed",
2096
+ accessor: row => (row === null || row === void 0 ? void 0 : row.submittedKnos) || 0,
2097
+ id: "ekycCompleted"
2098
+ }, {
2099
+ Header: t("PENDING_APPLICATIONS") || "Pending Applications",
2100
+ accessor: row => (row === null || row === void 0 ? void 0 : row.pendingKnos) || 0,
2101
+ id: "pendingApplications"
2102
+ }, {
2103
+ Header: t("OVERALL_PROGRESS") || "Overall Progress",
2104
+ accessor: row => (row !== null && row !== void 0 && row.progressPercent || (row === null || row === void 0 ? void 0 : row.progressPercent) === 0 ? row.progressPercent : row.progress) + "%",
2105
+ id: "overallProgress"
2106
+ }], [t, history]);
2107
+ const _useState4 = React.useState(false),
2108
+ showReportMenu = _useState4[0],
2109
+ setShowReportMenu = _useState4[1];
2110
+ const _useState5 = React.useState({
2111
+ from: "",
2112
+ to: ""
2113
+ }),
2114
+ customDate = _useState5[0],
2115
+ setCustomDate = _useState5[1];
2116
+ const _useState6 = React.useState(false),
2117
+ showCustomPicker = _useState6[0],
2118
+ setShowCustomPicker = _useState6[1];
2119
+ const _useState7 = React.useState(false),
2120
+ reportLoading = _useState7[0],
2121
+ setReportLoading = _useState7[1];
2122
+ const reportMenuRef = React.useRef(null);
2123
+ React.useEffect(() => {
2124
+ const handler = e => {
2125
+ if (reportMenuRef.current && !reportMenuRef.current.contains(e.target)) {
2126
+ setShowReportMenu(false);
2127
+ setShowCustomPicker(false);
2128
+ }
2129
+ };
2130
+ document.addEventListener("mousedown", handler);
2131
+ return () => document.removeEventListener("mousedown", handler);
2132
+ }, []);
2133
+ const handleDownload = () => {
2134
+ setReportLoading(true);
2135
+ try {
2136
+ const rowsWithStats = vendorSupervisors.map(s => ({
2137
+ name: s.name,
2138
+ mobileNo: s.mobileNo,
2139
+ status: s.status,
2140
+ total: s.totalKnos,
2141
+ completed: s.submittedKnos,
2142
+ pending: s.pendingKnos,
2143
+ progress: s.progressPercent + "%"
2144
+ }));
2145
+ const totalKnos = vendorSupervisors.reduce((acc, s) => acc + (s.totalKnos || 0), 0) || (vendor === null || vendor === void 0 ? void 0 : vendor.assignedConnections) || 0;
2146
+ const completedKnos = vendorSupervisors.reduce((acc, s) => acc + (s.submittedKnos || 0), 0) || (vendor === null || vendor === void 0 ? void 0 : vendor.completedEkyc) || 0;
2147
+ downloadVendorPDF({
2148
+ rows: rowsWithStats,
2149
+ vendorName,
2150
+ mobileNumber,
2151
+ email,
2152
+ dashboardInfo: {
2153
+ total: totalKnos,
2154
+ completed: completedKnos,
2155
+ pending: totalKnos - completedKnos,
2156
+ submittedCount: completedKnos
2157
+ },
2158
+ t
2159
+ });
2160
+ } catch (err) {
2161
+ console.error("Failed to generate report:", err);
2162
+ } finally {
2163
+ setReportLoading(false);
2164
+ setShowReportMenu(false);
2165
+ setShowCustomPicker(false);
2166
+ }
2167
+ };
2168
+ const handlePresetDownload = filter => {
2169
+ handleDownload();
2170
+ };
2171
+ const handleCustomDownload = () => {
2172
+ if (!customDate.from || !customDate.to) {
2173
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
2174
+ return;
2175
+ }
2176
+ handleDownload();
2177
+ };
2178
+ const StatCard = _ref3 => {
2179
+ let title = _ref3.title,
2180
+ value = _ref3.value,
2181
+ type = _ref3.type,
2182
+ isLoading = _ref3.isLoading,
2183
+ icon = _ref3.icon;
2184
+ return /*#__PURE__*/React__default.createElement("div", {
2185
+ className: "stat-card " + type
2186
+ }, isLoading ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
2187
+ className: "stat-title skeleton skeleton-text"
2188
+ }), /*#__PURE__*/React__default.createElement("div", {
2189
+ className: "stat-value skeleton skeleton-number"
2190
+ })) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
2191
+ className: "stat-title"
2192
+ }, title), /*#__PURE__*/React__default.createElement("div", {
2193
+ className: "stat-value"
2194
+ }, value), icon && /*#__PURE__*/React__default.createElement("div", {
2195
+ className: "stat-icon"
2196
+ }, icon)));
2197
+ };
2198
+ const isPageLoading = isProgressLoading || isVendorSearchLoading || isSupervisorSearchLoading;
2199
+ if (isPageLoading && !vendor) {
2200
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
2201
+ }
2202
+ if (!vendor) {
2203
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("div", {
2204
+ style: {
2205
+ padding: "24px"
2206
+ }
2207
+ }, t("NO_VENDOR_FOUND") || "No Vendor Found"));
2208
+ }
2209
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
2210
+ className: "surveyor-dashboard"
2211
+ }, /*#__PURE__*/React__default.createElement("div", {
2212
+ className: "ekyc-dashboard-section"
2213
+ }, /*#__PURE__*/React__default.createElement("div", {
2214
+ className: "ekyc-dashboard-header"
2215
+ }, /*#__PURE__*/React__default.createElement("div", {
2216
+ className: "avatar"
2217
+ }, vendorName === null || vendorName === void 0 ? void 0 : (_vendorName$charAt = vendorName.charAt(0)) === null || _vendorName$charAt === void 0 ? void 0 : _vendorName$charAt.toUpperCase()), /*#__PURE__*/React__default.createElement("div", {
2218
+ className: "header-content"
2219
+ }, /*#__PURE__*/React__default.createElement("h2", {
2220
+ className: "name"
2221
+ }, vendorName), /*#__PURE__*/React__default.createElement("div", {
2222
+ className: "designation"
2223
+ }, t("VENDOR_AGENCY") || "Agency / Vendor"))), /*#__PURE__*/React__default.createElement("div", {
2224
+ className: "report-download",
2225
+ ref: reportMenuRef
2226
+ }, /*#__PURE__*/React__default.createElement("button", {
2227
+ className: "download-btn",
2228
+ disabled: reportLoading,
2229
+ onClick: () => {
2230
+ setShowReportMenu(p => !p);
2231
+ setShowCustomPicker(false);
2232
+ }
2233
+ }, reportLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_REPORT") || "Download Report"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
2234
+ className: "report-menu"
2235
+ }, [{
2236
+ label: t("TODAY") || "Today",
2237
+ key: "today"
2238
+ }, {
2239
+ label: t("THIS_WEEK") || "This Week",
2240
+ key: "week"
2241
+ }, {
2242
+ label: t("THIS_MONTH") || "This Month",
2243
+ key: "month"
2244
+ }].map(_ref4 => {
2245
+ let label = _ref4.label,
2246
+ key = _ref4.key;
2247
+ return /*#__PURE__*/React__default.createElement("div", {
2248
+ key: key,
2249
+ className: "menu-item",
2250
+ onClick: () => handlePresetDownload()
2251
+ }, label);
2252
+ }), /*#__PURE__*/React__default.createElement("div", {
2253
+ className: "custom-date-trigger",
2254
+ onClick: () => setShowCustomPicker(p => !p)
2255
+ }, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
2256
+ className: "custom-picker"
2257
+ }, /*#__PURE__*/React__default.createElement("div", {
2258
+ className: "date-field"
2259
+ }, /*#__PURE__*/React__default.createElement("label", {
2260
+ className: "date-label"
2261
+ }, t("FROM_DATE") || "From"), /*#__PURE__*/React__default.createElement("input", {
2262
+ type: "date",
2263
+ className: "date-input",
2264
+ value: customDate.from,
2265
+ onChange: e => setCustomDate(d => _extends({}, d, {
2266
+ from: e.target.value
2267
+ }))
2268
+ })), /*#__PURE__*/React__default.createElement("div", {
2269
+ className: "date-field"
2270
+ }, /*#__PURE__*/React__default.createElement("label", {
2271
+ className: "date-label"
2272
+ }, t("TO_DATE") || "To"), /*#__PURE__*/React__default.createElement("input", {
2273
+ type: "date",
2274
+ className: "date-input",
2275
+ value: customDate.to,
2276
+ onChange: e => setCustomDate(d => _extends({}, d, {
2277
+ to: e.target.value
2278
+ }))
2279
+ })), /*#__PURE__*/React__default.createElement("button", {
2280
+ className: "download-action-btn",
2281
+ onClick: handleCustomDownload
2282
+ }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React__default.createElement("div", {
2283
+ className: "stats-wrapper"
2284
+ }, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
2285
+ key: idx,
2286
+ title: t(card.label),
2287
+ value: card.count,
2288
+ type: card.type,
2289
+ isLoading: isPageLoading,
2290
+ icon: card.icon
2291
+ }))), /*#__PURE__*/React__default.createElement("div", {
2292
+ className: "ekyc-dashboard-section"
2293
+ }, /*#__PURE__*/React__default.createElement("div", {
2294
+ className: "ekyc-details-wrapper"
2295
+ }, /*#__PURE__*/React__default.createElement("div", {
2296
+ className: "details-left"
2297
+ }, /*#__PURE__*/React__default.createElement("div", {
2298
+ className: "details-grid"
2299
+ }, /*#__PURE__*/React__default.createElement("div", {
2300
+ className: "detail-item"
2301
+ }, /*#__PURE__*/React__default.createElement("span", {
2302
+ className: "label"
2303
+ }, t("MOBILE")), /*#__PURE__*/React__default.createElement("span", {
2304
+ className: "value"
2305
+ }, mobileNumber)), /*#__PURE__*/React__default.createElement("div", {
2306
+ className: "detail-item"
2307
+ }, /*#__PURE__*/React__default.createElement("span", {
2308
+ className: "label"
2309
+ }, t("EMAIL")), /*#__PURE__*/React__default.createElement("span", {
2310
+ className: "value"
2311
+ }, email)), /*#__PURE__*/React__default.createElement("div", {
2312
+ className: "detail-item"
2313
+ }, /*#__PURE__*/React__default.createElement("span", {
2314
+ className: "label"
2315
+ }, t("STATUS")), /*#__PURE__*/React__default.createElement("span", {
2316
+ className: "value"
2317
+ }, status)), /*#__PURE__*/React__default.createElement("div", {
2318
+ className: "detail-item"
2319
+ }, /*#__PURE__*/React__default.createElement("span", {
2320
+ className: "label"
2321
+ }, t("JURISDICTIONS") || "Jurisdictions"), /*#__PURE__*/React__default.createElement("span", {
2322
+ className: "value"
2323
+ }, jurisdictions)))), /*#__PURE__*/React__default.createElement("div", {
2324
+ className: "details-right"
2325
+ }, /*#__PURE__*/React__default.createElement("div", {
2326
+ className: "download-card"
2327
+ }, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React__default.createElement("button", {
2328
+ className: "download-excel-btn",
2329
+ disabled: ekycDownloadLoading,
2330
+ onClick: handleDownloadEkycData
2331
+ }, /*#__PURE__*/React__default.createElement("svg", {
2332
+ width: "16",
2333
+ height: "16",
2334
+ viewBox: "0 0 24 24",
2335
+ fill: "none",
2336
+ stroke: "currentColor",
2337
+ strokeWidth: "2.5",
2338
+ strokeLinecap: "round",
2339
+ strokeLinejoin: "round"
2340
+ }, /*#__PURE__*/React__default.createElement("path", {
2341
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
2342
+ }), /*#__PURE__*/React__default.createElement("polyline", {
2343
+ points: "7 10 12 15 17 10"
2344
+ }), /*#__PURE__*/React__default.createElement("line", {
2345
+ x1: "12",
2346
+ y1: "15",
2347
+ x2: "12",
2348
+ y2: "3"
2349
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
2350
+ className: "dashboard-card"
2351
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
2352
+ t: t,
2353
+ tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
2354
+ tableClass: "ekycTable",
2355
+ data: paginatedSupervisors,
2356
+ columns: supervisorColumns,
2357
+ isLoading: isPageLoading,
2358
+ totalRecords: vendorSupervisors.length,
2359
+ currentPage: currentPage,
2360
+ pageSizeLimit: pageSize,
2361
+ isPaginationRequired: true,
2362
+ onNextPage: () => {
2363
+ if (currentPage < Math.ceil(vendorSupervisors.length / pageSize) - 1) {
2364
+ setCurrentPage(prev => prev + 1);
2365
+ }
2366
+ },
2367
+ onPrevPage: () => {
2368
+ if (currentPage > 0) {
2369
+ setCurrentPage(prev => prev - 1);
2370
+ }
2371
+ },
2372
+ onFirstPage: () => {
2373
+ setCurrentPage(0);
2374
+ },
2375
+ onLastPage: () => {
2376
+ setCurrentPage(Math.max(Math.ceil(vendorSupervisors.length / pageSize) - 1, 0));
2377
+ },
2378
+ onPageSizeChange: e => {
2379
+ setPageSize(Number(e.target.value));
2380
+ setCurrentPage(0);
2381
+ }
2382
+ })));
2383
+ };
2384
+
2385
+ const useInboxTableConfig = _ref => {
2386
+ var _formState$tableForm, _formState$tableForm2, _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _formState$searchForm;
2387
+ let onPageSizeChange = _ref.onPageSizeChange,
2388
+ formState = _ref.formState,
2389
+ totalCount = _ref.totalCount,
2390
+ table = _ref.table,
2391
+ dispatch = _ref.dispatch,
2392
+ checkPathName = _ref.checkPathName,
2393
+ onSortingByData = _ref.onSortingByData,
2394
+ tenantId = _ref.tenantId,
2395
+ _ref$inboxStyles = _ref.inboxStyles,
2396
+ inboxStyles = _ref$inboxStyles === void 0 ? {} : _ref$inboxStyles,
2397
+ _ref$tableStyle = _ref.tableStyle,
2398
+ tableStyle = _ref$tableStyle === void 0 ? {} : _ref$tableStyle;
2399
+ const _useTranslation = reactI18next.useTranslation(),
2400
+ t = _useTranslation.t;
2401
+ const history = reactRouterDom.useHistory();
2402
+ const _useState = React.useState(""),
2403
+ selectedKno = _useState[0],
2404
+ setSelectedKno = _useState[1];
2405
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAPI("review", tenantId),
2406
+ reviewData = _Digit$Hooks$ekyc$use.data,
2407
+ getReview = _Digit$Hooks$ekyc$use.getReview;
2408
+ const handleReview = kno => {
2409
+ setSelectedKno(kno);
2410
+ getReview({
2411
+ kno
2412
+ });
2413
+ };
2414
+ const limit = (formState === null || formState === void 0 ? void 0 : (_formState$tableForm = formState.tableForm) === null || _formState$tableForm === void 0 ? void 0 : _formState$tableForm.limit) || 10;
2415
+ const offset = (formState === null || formState === void 0 ? void 0 : (_formState$tableForm2 = formState.tableForm) === null || _formState$tableForm2 === void 0 ? void 0 : _formState$tableForm2.offset) || 0;
2416
+ 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";
2417
+ React__default.useEffect(() => {
2418
+ if (reviewData) {
2419
+ history.push("/digit-ui/" + userType + "/ekyc/review/" + selectedKno, {
2420
+ aadhaarData: reviewData === null || reviewData === void 0 ? void 0 : reviewData.aadhaarData,
2421
+ reviewData
2422
+ });
2423
+ }
2424
+ }, [reviewData]);
2425
+ const tableColumnConfig = [{
2426
+ Header: t("EKYC_APPLICATION_NO"),
2427
+ accessor: "applicationNumber",
2428
+ disableSortBy: true,
2429
+ Cell: _ref2 => {
2430
+ var _row$original, _row$original2;
2431
+ let row = _ref2.row;
2432
+ const kno = ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.kno) || ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.applicationNumber) || "NA";
2433
+ return /*#__PURE__*/React__default.createElement("span", {
2434
+ className: "link",
2435
+ onClick: () => handleReview(kno)
2436
+ }, kno);
2437
+ }
2438
+ }, {
2439
+ Header: t("EKYC_CITIZEN_NAME"),
2440
+ accessor: "citizenName",
2441
+ Cell: _ref3 => {
2442
+ var _row$original3;
2443
+ let row = _ref3.row;
2444
+ return /*#__PURE__*/React__default.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
2445
+ }
2446
+ }, {
2447
+ Header: t("EKYC_STATUS"),
2448
+ accessor: "actionStatus",
2449
+ Cell: _ref4 => {
2450
+ var _row$original4;
2451
+ let row = _ref4.row;
2452
+ const status = ((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT";
2453
+ return /*#__PURE__*/React__default.createElement("span", {
2454
+ className: "ekyc-status-tag " + status
2455
+ }, t("" + status));
2456
+ }
2457
+ }, {
2458
+ Header: t("EKYC_EKYC_STATUS"),
2459
+ accessor: "ekycStatus",
2460
+ Cell: _ref5 => {
2461
+ var _row$original5, _row$original6;
2462
+ let row = _ref5.row;
2463
+ const ekycStatus = (((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.ekycStatus) || ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycstatus) || "NA").toUpperCase();
2464
+ return /*#__PURE__*/React__default.createElement("span", {
2465
+ className: "ekyc-status-tag " + ekycStatus
2466
+ }, t("" + ekycStatus));
2467
+ }
2468
+ }];
2469
+ return {
2470
+ disableSort: false,
2471
+ autoSort: false,
2472
+ manualPagination: true,
2473
+ initSortId: "applicationDate",
2474
+ onPageSizeChange: onPageSizeChange,
2475
+ currentPage: offset,
2476
+ onNextPage: () => {
2477
+ var _formState$tableForm3;
2478
+ return dispatch({
2479
+ action: "mutateTableForm",
2480
+ data: _extends({}, formState.tableForm, {
2481
+ offset: parseInt((_formState$tableForm3 = formState.tableForm) === null || _formState$tableForm3 === void 0 ? void 0 : _formState$tableForm3.offset) + limit
2482
+ }),
2483
+ checkPathName
2484
+ });
2485
+ },
2486
+ onPrevPage: () => {
2487
+ var _formState$tableForm4;
2488
+ return dispatch({
2489
+ action: "mutateTableForm",
2490
+ data: _extends({}, formState.tableForm, {
2491
+ offset: parseInt((_formState$tableForm4 = formState.tableForm) === null || _formState$tableForm4 === void 0 ? void 0 : _formState$tableForm4.offset) - limit
2492
+ }),
2493
+ checkPathName
2494
+ });
2495
+ },
2496
+ pageSizeLimit: limit,
2497
+ onSort: onSortingByData,
2498
+ totalRecords: totalCount,
2499
+ onSearch: formState === null || formState === void 0 ? void 0 : (_formState$searchForm = formState.searchForm) === null || _formState$searchForm === void 0 ? void 0 : _formState$searchForm.message,
2500
+ onLastPage: () => dispatch({
2501
+ action: "mutateTableForm",
2502
+ data: _extends({}, formState.tableForm, {
2503
+ offset: Math.max(0, Math.floor((totalCount - 1) / limit) * limit)
2504
+ }),
2505
+ checkPathName
2506
+ }),
2507
+ onFirstPage: () => dispatch({
2508
+ action: "mutateTableForm",
2509
+ data: _extends({}, formState.tableForm, {
2510
+ offset: 0
2511
+ }),
2512
+ checkPathName
2513
+ }),
2514
+ data: table,
2515
+ columns: tableColumnConfig,
2516
+ inboxStyles: _extends({}, inboxStyles),
2517
+ tableStyle: _extends({}, tableStyle)
2518
+ };
2519
+ };
2520
+
2521
+ var isNullOrUndefined = value => value == null;
2522
+ const isObjectType = value => typeof value === 'object';
2523
+ var isObject = value => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !(value instanceof Date);
2524
+ var isKey = value => /^\w*$/.test(value);
2525
+ var compact = value => value.filter(Boolean);
2526
+ var stringToPath = input => compact(input.replace(/["|']/g, '').replace(/\[/g, '.').replace(/\]/g, '').split('.'));
2527
+ function set(object, path, value) {
2528
+ let index = -1;
2529
+ const tempPath = isKey(path) ? [path] : stringToPath(path);
2530
+ const length = tempPath.length;
2531
+ const lastIndex = length - 1;
2532
+ while (++index < length) {
2533
+ const key = tempPath[index];
2534
+ let newValue = value;
2535
+ if (index !== lastIndex) {
2536
+ const objValue = object[key];
2537
+ newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
2538
+ }
2539
+ object[key] = newValue;
2540
+ object = object[key];
2541
+ }
2542
+ return object;
2543
+ }
2544
+ var isUndefined = val => val === undefined;
2545
+ var get = function (obj, path, defaultValue) {
2546
+ if (obj === void 0) {
2547
+ obj = {};
2548
+ }
2549
+ const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
1932
2550
  return isUndefined(result) || result === obj ? isUndefined(obj[path]) ? defaultValue : obj[path] : result;
1933
2551
  };
1934
2552
  var isPrimitive = value => isNullOrUndefined(value) || !isObjectType(value);
@@ -4910,7 +5528,9 @@ const AssignEkycModal = _ref => {
4910
5528
  React.useEffect(() => {
4911
5529
  setCurrentPage(0);
4912
5530
  }, [debouncedFilters, filters.kno]);
4913
- const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycApplicationList(_extends({}, filters.kno && {
5531
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycApplicationList(_extends({
5532
+ unassignedOnly: true
5533
+ }, filters.kno && {
4914
5534
  kno: filters.kno
4915
5535
  }, debouncedFilters.ekycStatus && {
4916
5536
  ekycStatus: debouncedFilters.ekycStatus
@@ -5185,240 +5805,33 @@ const AssignEkycModal = _ref => {
5185
5805
  isPaginationRequired: true,
5186
5806
  onNextPage: () => {
5187
5807
  if (currentPage < ((applicationData === null || applicationData === void 0 ? void 0 : applicationData.totalPages) || 1) - 1) {
5188
- setCurrentPage(prev => prev + 1);
5189
- }
5190
- },
5191
- onPrevPage: () => {
5192
- if (currentPage > 0) {
5193
- setCurrentPage(prev => prev - 1);
5194
- }
5195
- },
5196
- onFirstPage: () => {
5197
- setCurrentPage(0);
5198
- },
5199
- onLastPage: () => {
5200
- setCurrentPage(Math.max(((applicationData === null || applicationData === void 0 ? void 0 : applicationData.totalPages) || 1) - 1, 0));
5201
- },
5202
- onPageSizeChange: e => {
5203
- setPageSize(Number(e.target.value));
5204
- setCurrentPage(0);
5205
- }
5206
- })), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
5207
- error: toastData.error,
5208
- label: toastData.label,
5209
- onClose: () => setShowToast(false)
5210
- }));
5211
- };
5212
-
5213
- const downloadSurveyorPDF = function (_ref) {
5214
- let rows = _ref.rows,
5215
- surveyorName = _ref.surveyorName,
5216
- employeeId = _ref.employeeId,
5217
- mobileNumber = _ref.mobileNumber,
5218
- vendorName = _ref.vendorName,
5219
- supervisorName = _ref.supervisorName,
5220
- dashboardInfo = _ref.dashboardInfo,
5221
- t = _ref.t;
5222
- try {
5223
- const tenantId = Digit.ULBService.getCurrentTenantId();
5224
- const initData = Digit.SessionStorage.get("initData");
5225
- const tenants = (initData === null || initData === void 0 ? void 0 : initData.tenants) || [];
5226
- const tenantInfo = tenants.find(tenant => tenant.code === tenantId);
5227
- const capitalize = text => text && text.substr(0, 1).toUpperCase() + text.substr(1);
5228
- const ulbCamel = ulb => ulb && ulb.toLowerCase().split(" ").map(capitalize).join(" ");
5229
- const name = "Delhi Jal Board";
5230
- const email = "contact@delhijalboard.nic.in";
5231
- const phoneNumber = "+91-11-23538416";
5232
- const currentDate = new Date();
5233
- const formattedDate = currentDate.toLocaleDateString("en-IN", {
5234
- day: "2-digit",
5235
- month: "2-digit",
5236
- year: "numeric"
5237
- });
5238
- const formattedTime = currentDate.toLocaleTimeString("en-IN", {
5239
- hour: "2-digit",
5240
- minute: "2-digit",
5241
- second: "2-digit",
5242
- hour12: false
5243
- });
5244
- const downloadDateTime = formattedDate + " " + formattedTime;
5245
- const isValDefined = val => val !== undefined && val !== null && val !== "";
5246
- const details = [{
5247
- title: t("SURVEYOR_DETAILS"),
5248
- asSectionHeader: true,
5249
- values: [{
5250
- title: t("SURVEYOR_NAME"),
5251
- value: surveyorName
5252
- }, {
5253
- title: t("MOBILE_NUMBER"),
5254
- value: mobileNumber
5255
- }, {
5256
- title: t("VENDOR_NAME"),
5257
- value: vendorName
5258
- }, {
5259
- title: t("SUPERVISOR_NAME"),
5260
- value: supervisorName
5261
- }].filter(item => isValDefined(item.value))
5262
- }, {
5263
- title: t("SUMMARY_STATISTICS"),
5264
- asSectionHeader: true,
5265
- values: [{
5266
- title: t("TOTAL_ASSIGNED"),
5267
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
5268
- }, {
5269
- title: t("COMPLETED"),
5270
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
5271
- }, {
5272
- title: t("PENDING"),
5273
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
5274
- }, {
5275
- title: t("SUBMITTED"),
5276
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
5277
- }].filter(item => isValDefined(item.value))
5278
- }];
5279
- if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
5280
- window.Digit.Utils.pdf.generateSurveyorReport({
5281
- tenantId,
5282
- logo: null,
5283
- name,
5284
- email,
5285
- phoneNumber,
5286
- heading: t("EKYC_SURVEYOR_REPORT"),
5287
- details,
5288
- applicationNumber: employeeId,
5289
- rows,
5290
- t,
5291
- hideApplicationNumber: true,
5292
- downloadTime: downloadDateTime
5293
- });
5294
- } else {
5295
- console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
5296
- }
5297
- return Promise.resolve();
5298
- } catch (e) {
5299
- return Promise.reject(e);
5300
- }
5301
- };
5302
- const downloadSupervisorPDF = function (_ref2) {
5303
- let rows = _ref2.rows,
5304
- supervisorName = _ref2.supervisorName,
5305
- mobileNumber = _ref2.mobileNumber,
5306
- vendorName = _ref2.vendorName,
5307
- dashboardInfo = _ref2.dashboardInfo,
5308
- t = _ref2.t;
5309
- try {
5310
- const tenantId = Digit.ULBService.getCurrentTenantId();
5311
- const name = "Delhi Jal Board";
5312
- const email = "contact@delhijalboard.nic.in";
5313
- const phoneNumber = "+91-11-23538416";
5314
- const currentDate = new Date();
5315
- const formattedDate = currentDate.toLocaleDateString("en-IN", {
5316
- day: "2-digit",
5317
- month: "2-digit",
5318
- year: "numeric"
5319
- });
5320
- const formattedTime = currentDate.toLocaleTimeString("en-IN", {
5321
- hour: "2-digit",
5322
- minute: "2-digit",
5323
- second: "2-digit",
5324
- hour12: false
5325
- });
5326
- const downloadDateTime = formattedDate + " " + formattedTime;
5327
- const isValDefined = val => val !== undefined && val !== null && val !== "";
5328
- const details = [{
5329
- title: t("SUPERVISOR_DETAILS") || "Supervisor Details",
5330
- asSectionHeader: true,
5331
- values: [{
5332
- title: t("SUPERVISOR_NAME") || "Supervisor Name",
5333
- value: supervisorName
5334
- }, {
5335
- title: t("MOBILE_NUMBER") || "Mobile Number",
5336
- value: mobileNumber
5337
- }, {
5338
- title: t("VENDOR_NAME") || "Vendor Name",
5339
- value: vendorName
5340
- }].filter(item => isValDefined(item.value))
5341
- }, {
5342
- title: t("SUMMARY_STATISTICS") || "Summary Statistics",
5343
- asSectionHeader: true,
5344
- values: [{
5345
- title: t("TOTAL_ASSIGNED") || "Total Assigned",
5346
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
5347
- }, {
5348
- title: t("COMPLETED") || "Completed",
5349
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
5350
- }, {
5351
- title: t("PENDING") || "Pending",
5352
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
5353
- }, {
5354
- title: t("SUBMITTED") || "Submitted",
5355
- value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
5356
- }].filter(item => isValDefined(item.value))
5357
- }];
5358
- const mappedRows = rows.map(row => {
5359
- var _row$owner, _row$owner2;
5360
- return {
5361
- kno: row.name || ((_row$owner = row.owner) === null || _row$owner === void 0 ? void 0 : _row$owner.name) || "N/A",
5362
- firstName: ((_row$owner2 = row.owner) === null || _row$owner2 === void 0 ? void 0 : _row$owner2.mobileNumber) || row.mobileNo || "N/A",
5363
- lastName: "",
5364
- mobileNo: row.status || "N/A",
5365
- zoneName: String(row.total || 0),
5366
- ekycStatus: (row.completed || 0) + " / " + (row.pending || 0),
5367
- submittedAt: 1717171717171,
5368
- progress: row.progress || "0%"
5369
- };
5370
- });
5371
- const originalToLocaleDateString = Date.prototype.toLocaleDateString;
5372
- let progressIndex = 0;
5373
- Date.prototype.toLocaleDateString = function () {
5374
- if (progressIndex < mappedRows.length) {
5375
- return mappedRows[progressIndex++].progress || "0%";
5376
- }
5377
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5378
- args[_key] = arguments[_key];
5808
+ setCurrentPage(prev => prev + 1);
5379
5809
  }
5380
- return originalToLocaleDateString.apply(this, args);
5381
- };
5382
- const customT = key => {
5383
- if (key === "KNO") return t("SURVEYOR_NAME") || "Surveyor Name";
5384
- if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
5385
- if (key === "MOBILE") return t("STATUS") || "Status";
5386
- if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
5387
- if (key === "EKYC_STATUS") return t("COMPLETED_PENDING") || "Completed / Pending";
5388
- if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
5389
- if (key === "CONSUMER_LIST") return t("CONNECTED_SURVEYORS") || "Connected Surveyors";
5390
- return t(key);
5391
- };
5392
- try {
5393
- if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
5394
- window.Digit.Utils.pdf.generateSurveyorReport({
5395
- tenantId,
5396
- logo: null,
5397
- name,
5398
- email,
5399
- phoneNumber,
5400
- heading: t("EKYC_SUPERVISOR_REPORT") || "eKYC Supervisor Report",
5401
- details,
5402
- applicationNumber: mobileNumber,
5403
- rows: mappedRows,
5404
- t: customT,
5405
- hideApplicationNumber: true,
5406
- downloadTime: downloadDateTime
5407
- });
5408
- } else {
5409
- console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
5810
+ },
5811
+ onPrevPage: () => {
5812
+ if (currentPage > 0) {
5813
+ setCurrentPage(prev => prev - 1);
5410
5814
  }
5411
- } finally {
5412
- Date.prototype.toLocaleDateString = originalToLocaleDateString;
5815
+ },
5816
+ onFirstPage: () => {
5817
+ setCurrentPage(0);
5818
+ },
5819
+ onLastPage: () => {
5820
+ setCurrentPage(Math.max(((applicationData === null || applicationData === void 0 ? void 0 : applicationData.totalPages) || 1) - 1, 0));
5821
+ },
5822
+ onPageSizeChange: e => {
5823
+ setPageSize(Number(e.target.value));
5824
+ setCurrentPage(0);
5413
5825
  }
5414
- return Promise.resolve();
5415
- } catch (e) {
5416
- return Promise.reject(e);
5417
- }
5826
+ })), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
5827
+ error: toastData.error,
5828
+ label: toastData.label,
5829
+ onClose: () => setShowToast(false)
5830
+ }));
5418
5831
  };
5419
5832
 
5420
5833
  const SurveyorDetailsDashboard = () => {
5421
- var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$owner7, _surveyor$owner8, _surveyor$owner9, _surveyor$additionalD, _dashboardData$dashbo5, _dashboardData$dashbo6;
5834
+ var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$owner8, _surveyor$owner9, _surveyor$owner0, _surveyor$additionalD, _dashboardData$dashbo5, _dashboardData$dashbo6;
5422
5835
  const tenantId = Digit.ULBService.getCurrentTenantId();
5423
5836
  const _useState = React.useState(false),
5424
5837
  showModal = _useState[0],
@@ -5426,6 +5839,9 @@ const SurveyorDetailsDashboard = () => {
5426
5839
  const _useState2 = React.useState(false),
5427
5840
  showOptions = _useState2[0],
5428
5841
  setShowOptions = _useState2[1];
5842
+ const _useState3 = React.useState(false),
5843
+ ekycDownloadLoading = _useState3[0],
5844
+ setEkycDownloadLoading = _useState3[1];
5429
5845
  const _useParams = reactRouterDom.useParams(),
5430
5846
  surveyorId = _useParams.id;
5431
5847
  const ownerIds = (_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$SessionStorage2.uuid;
@@ -5481,12 +5897,12 @@ const SurveyorDetailsDashboard = () => {
5481
5897
  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";
5482
5898
  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);
5483
5899
  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";
5484
- const _useState3 = React.useState(0),
5485
- currentPage = _useState3[0],
5486
- setCurrentPage = _useState3[1];
5487
- const _useState4 = React.useState(20),
5488
- pageSize = _useState4[0],
5489
- setPageSize = _useState4[1];
5900
+ const _useState4 = React.useState(0),
5901
+ currentPage = _useState4[0],
5902
+ setCurrentPage = _useState4[1];
5903
+ const _useState5 = React.useState(20),
5904
+ pageSize = _useState5[0],
5905
+ setPageSize = _useState5[1];
5490
5906
  const queryParams = {
5491
5907
  tenantId: "dl.djb",
5492
5908
  offset: currentPage * pageSize,
@@ -5528,21 +5944,21 @@ const SurveyorDetailsDashboard = () => {
5528
5944
  return value || "-";
5529
5945
  }
5530
5946
  }], []);
5531
- const _useState5 = React.useState(false),
5532
- showReportMenu = _useState5[0],
5533
- setShowReportMenu = _useState5[1];
5534
- const _useState6 = React.useState({
5947
+ const _useState6 = React.useState(false),
5948
+ showReportMenu = _useState6[0],
5949
+ setShowReportMenu = _useState6[1];
5950
+ const _useState7 = React.useState({
5535
5951
  from: "",
5536
5952
  to: ""
5537
5953
  }),
5538
- customDate = _useState6[0],
5539
- setCustomDate = _useState6[1];
5540
- const _useState7 = React.useState(false),
5541
- showCustomPicker = _useState7[0],
5542
- setShowCustomPicker = _useState7[1];
5954
+ customDate = _useState7[0],
5955
+ setCustomDate = _useState7[1];
5543
5956
  const _useState8 = React.useState(false),
5544
- reportLoading = _useState8[0],
5545
- setReportLoading = _useState8[1];
5957
+ showCustomPicker = _useState8[0],
5958
+ setShowCustomPicker = _useState8[1];
5959
+ const _useState9 = React.useState(false),
5960
+ reportLoading = _useState9[0],
5961
+ setReportLoading = _useState9[1];
5546
5962
  const reportMenuRef = React.useRef(null);
5547
5963
  React.useEffect(() => {
5548
5964
  const handler = e => {
@@ -5690,7 +6106,8 @@ const SurveyorDetailsDashboard = () => {
5690
6106
  let title = _ref3.title,
5691
6107
  value = _ref3.value,
5692
6108
  type = _ref3.type,
5693
- isLoading = _ref3.isLoading;
6109
+ isLoading = _ref3.isLoading,
6110
+ icon = _ref3.icon;
5694
6111
  return /*#__PURE__*/React__default.createElement("div", {
5695
6112
  className: "stat-card " + type
5696
6113
  }, isLoading ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
@@ -5701,7 +6118,9 @@ const SurveyorDetailsDashboard = () => {
5701
6118
  className: "stat-title"
5702
6119
  }, title), /*#__PURE__*/React__default.createElement("div", {
5703
6120
  className: "stat-value"
5704
- }, value)));
6121
+ }, value), icon && /*#__PURE__*/React__default.createElement("div", {
6122
+ className: "stat-icon"
6123
+ }, icon)));
5705
6124
  };
5706
6125
  const options = [{
5707
6126
  action: "Assign"
@@ -5710,6 +6129,77 @@ const SurveyorDetailsDashboard = () => {
5710
6129
  setShowOptions(false);
5711
6130
  setShowModal(true);
5712
6131
  };
6132
+ const handleDownloadEkycData = function () {
6133
+ try {
6134
+ setEkycDownloadLoading(true);
6135
+ return Promise.resolve(_finallyRethrows(function () {
6136
+ return _catch(function () {
6137
+ var _surveyor$owner7;
6138
+ return Promise.resolve(Digit.EkycService.application_list({
6139
+ tenantId: tenantId || "dl.djb",
6140
+ offset: 0,
6141
+ limit: 10000,
6142
+ surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner7 = surveyor.owner) === null || _surveyor$owner7 === void 0 ? void 0 : _surveyor$owner7.uuid,
6143
+ reportDownload: true
6144
+ })).then(function (response) {
6145
+ const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
6146
+ if (consumerList.length === 0) {
6147
+ alert(t("NO_DATA_FOUND") || "No data found for download.");
6148
+ return;
6149
+ }
6150
+ const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
6151
+ const headerMapping = {
6152
+ kno: t("KNO") || "KNO",
6153
+ firstName: t("FIRST_NAME") || "First Name",
6154
+ middleName: t("MIDDLE_NAME") || "Middle Name",
6155
+ lastName: t("LAST_NAME") || "Last Name",
6156
+ gender: t("GENDER") || "Gender",
6157
+ mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
6158
+ emailId: t("EMAIL_ID") || "Email ID",
6159
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
6160
+ relationship: t("RELATIONSHIP") || "Relationship",
6161
+ dob: t("DOB") || "Date of Birth",
6162
+ ekycStatus: t("EKYC_STATUS") || "eKYC Status",
6163
+ zoneName: t("ZONE") || "Zone",
6164
+ assembly: t("ASSEMBLY") || "Assembly",
6165
+ ward: t("WARD") || "Ward",
6166
+ pincode: t("PINCODE") || "Pincode",
6167
+ mrkey: t("MR_KEY") || "MR Key",
6168
+ createdTime: t("CREATED_TIME") || "Created Time",
6169
+ lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
6170
+ };
6171
+ const excelData = consumerList.map(item => {
6172
+ const cleanObj = {};
6173
+ const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
6174
+ if (fullName) {
6175
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
6176
+ }
6177
+ Object.keys(item).forEach(key => {
6178
+ if (excludedKeys.includes(key)) return;
6179
+ const val = item[key];
6180
+ if (typeof val === "object" && val !== null) {
6181
+ return;
6182
+ }
6183
+ const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
6184
+ cleanObj[friendlyHeader] = val;
6185
+ });
6186
+ return cleanObj;
6187
+ });
6188
+ const cleanFileName = "eKYC_Data_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
6189
+ Digit.Download.Excel(excelData, cleanFileName);
6190
+ });
6191
+ }, function (error) {
6192
+ console.error("Error downloading eKYC Excel:", error);
6193
+ });
6194
+ }, function (_wasThrown3, _result3) {
6195
+ setEkycDownloadLoading(false);
6196
+ if (_wasThrown3) throw _result3;
6197
+ return _result3;
6198
+ }));
6199
+ } catch (e) {
6200
+ return Promise.reject(e);
6201
+ }
6202
+ };
5713
6203
  const closeModal = function () {
5714
6204
  try {
5715
6205
  setShowModal(false);
@@ -5797,71 +6287,105 @@ const SurveyorDetailsDashboard = () => {
5797
6287
  title: t("TOTAL_ASSIGNED"),
5798
6288
  value: (dashboardData === null || dashboardData === void 0 ? void 0 : (_dashboardData$dashbo = dashboardData.dashboardInfo) === null || _dashboardData$dashbo === void 0 ? void 0 : _dashboardData$dashbo.total) || 0,
5799
6289
  type: "today",
5800
- isLoading: isDashboardLoading
6290
+ isLoading: isDashboardLoading,
6291
+ icon: /*#__PURE__*/React__default.createElement(fa.FaUsers, null)
5801
6292
  }), /*#__PURE__*/React__default.createElement(StatCard, {
5802
6293
  title: t("COMPLETED"),
5803
6294
  value: (dashboardData === null || dashboardData === void 0 ? void 0 : (_dashboardData$dashbo2 = dashboardData.dashboardInfo) === null || _dashboardData$dashbo2 === void 0 ? void 0 : _dashboardData$dashbo2.completed) || 0,
5804
6295
  type: "week",
5805
- isLoading: isDashboardLoading
6296
+ isLoading: isDashboardLoading,
6297
+ icon: /*#__PURE__*/React__default.createElement(fa.FaCheckCircle, null)
5806
6298
  }), /*#__PURE__*/React__default.createElement(StatCard, {
5807
6299
  title: t("PENDING"),
5808
6300
  value: (dashboardData === null || dashboardData === void 0 ? void 0 : (_dashboardData$dashbo3 = dashboardData.dashboardInfo) === null || _dashboardData$dashbo3 === void 0 ? void 0 : _dashboardData$dashbo3.pending) || 0,
5809
6301
  type: "pending",
5810
- isLoading: isDashboardLoading
6302
+ isLoading: isDashboardLoading,
6303
+ icon: /*#__PURE__*/React__default.createElement(fa.FaClock, null)
5811
6304
  }), /*#__PURE__*/React__default.createElement(StatCard, {
5812
6305
  title: t("SUBMITTED"),
5813
6306
  value: (dashboardData === null || dashboardData === void 0 ? void 0 : (_dashboardData$dashbo4 = dashboardData.dashboardInfo) === null || _dashboardData$dashbo4 === void 0 ? void 0 : _dashboardData$dashbo4.submittedCount) || 0,
5814
6307
  type: "month",
5815
- isLoading: isDashboardLoading
6308
+ isLoading: isDashboardLoading,
6309
+ icon: /*#__PURE__*/React__default.createElement(fa.FaChartLine, null)
5816
6310
  })), /*#__PURE__*/React__default.createElement("div", {
5817
6311
  className: "charts-wrapper"
5818
6312
  }), /*#__PURE__*/React__default.createElement("div", {
5819
6313
  className: "ekyc-dashboard-section"
6314
+ }, /*#__PURE__*/React__default.createElement("div", {
6315
+ className: "ekyc-details-wrapper"
6316
+ }, /*#__PURE__*/React__default.createElement("div", {
6317
+ className: "details-left"
5820
6318
  }, /*#__PURE__*/React__default.createElement("div", {
5821
6319
  className: "details-grid"
5822
6320
  }, /*#__PURE__*/React__default.createElement("div", {
5823
6321
  className: "detail-item"
5824
6322
  }, /*#__PURE__*/React__default.createElement("span", {
5825
6323
  className: "label"
5826
- }, t("MOBILE"), ":"), /*#__PURE__*/React__default.createElement("span", {
6324
+ }, t("MOBILE")), /*#__PURE__*/React__default.createElement("span", {
5827
6325
  className: "value"
5828
- }, (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__default.createElement("div", {
6326
+ }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner8 = surveyor.owner) === null || _surveyor$owner8 === void 0 ? void 0 : _surveyor$owner8.mobileNumber) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.mobileNo) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
5829
6327
  className: "detail-item"
5830
6328
  }, /*#__PURE__*/React__default.createElement("span", {
5831
6329
  className: "label"
5832
- }, t("EMAIL"), ":"), /*#__PURE__*/React__default.createElement("span", {
6330
+ }, t("EMAIL")), /*#__PURE__*/React__default.createElement("span", {
5833
6331
  className: "value"
5834
- }, (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__default.createElement("div", {
6332
+ }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner9 = surveyor.owner) === null || _surveyor$owner9 === void 0 ? void 0 : _surveyor$owner9.emailId) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
5835
6333
  className: "detail-item"
5836
6334
  }, /*#__PURE__*/React__default.createElement("span", {
5837
6335
  className: "label"
5838
- }, t("GENDER"), ":"), /*#__PURE__*/React__default.createElement("span", {
6336
+ }, t("GENDER")), /*#__PURE__*/React__default.createElement("span", {
5839
6337
  className: "value"
5840
- }, (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__default.createElement("div", {
6338
+ }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner0 = surveyor.owner) === null || _surveyor$owner0 === void 0 ? void 0 : _surveyor$owner0.gender) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
5841
6339
  className: "detail-item"
5842
6340
  }, /*#__PURE__*/React__default.createElement("span", {
5843
6341
  className: "label"
5844
- }, t("STATUS"), ":"), /*#__PURE__*/React__default.createElement("span", {
6342
+ }, t("STATUS")), /*#__PURE__*/React__default.createElement("span", {
5845
6343
  className: "value"
5846
6344
  }, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.status) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
5847
6345
  className: "detail-item"
5848
6346
  }, /*#__PURE__*/React__default.createElement("span", {
5849
6347
  className: "label"
5850
- }, t("SERVICE_TYPE"), ":"), /*#__PURE__*/React__default.createElement("span", {
6348
+ }, t("SERVICE_TYPE")), /*#__PURE__*/React__default.createElement("span", {
5851
6349
  className: "value"
5852
6350
  }, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$additionalD = surveyor.additionalDetails) === null || _surveyor$additionalD === void 0 ? void 0 : _surveyor$additionalD.serviceType) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
5853
6351
  className: "detail-item"
5854
6352
  }, /*#__PURE__*/React__default.createElement("span", {
5855
6353
  className: "label"
5856
- }, t("VENDOR_NAME") || "Vendor Name", ":"), /*#__PURE__*/React__default.createElement("span", {
6354
+ }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React__default.createElement("span", {
5857
6355
  className: "value"
5858
6356
  }, vendorName)), /*#__PURE__*/React__default.createElement("div", {
5859
6357
  className: "detail-item"
5860
6358
  }, /*#__PURE__*/React__default.createElement("span", {
5861
6359
  className: "label"
5862
- }, t("SUPERVISOR_NAME") || "Supervisor Name", ":"), /*#__PURE__*/React__default.createElement("span", {
6360
+ }, t("SUPERVISOR_NAME") || "Supervisor Name"), /*#__PURE__*/React__default.createElement("span", {
5863
6361
  className: "value"
5864
- }, supervisorName)))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
6362
+ }, supervisorName)))), /*#__PURE__*/React__default.createElement("div", {
6363
+ className: "details-right"
6364
+ }, /*#__PURE__*/React__default.createElement("div", {
6365
+ className: "download-card"
6366
+ }, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React__default.createElement("button", {
6367
+ className: "download-excel-btn",
6368
+ disabled: ekycDownloadLoading,
6369
+ onClick: handleDownloadEkycData
6370
+ }, /*#__PURE__*/React__default.createElement("svg", {
6371
+ width: "16",
6372
+ height: "16",
6373
+ viewBox: "0 0 24 24",
6374
+ fill: "none",
6375
+ stroke: "currentColor",
6376
+ strokeWidth: "2.5",
6377
+ strokeLinecap: "round",
6378
+ strokeLinejoin: "round"
6379
+ }, /*#__PURE__*/React__default.createElement("path", {
6380
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
6381
+ }), /*#__PURE__*/React__default.createElement("polyline", {
6382
+ points: "7 10 12 15 17 10"
6383
+ }), /*#__PURE__*/React__default.createElement("line", {
6384
+ x1: "12",
6385
+ y1: "15",
6386
+ x2: "12",
6387
+ y2: "3"
6388
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
5865
6389
  className: "dashboard-card"
5866
6390
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
5867
6391
  t: t,
@@ -5873,6 +6397,7 @@ const SurveyorDetailsDashboard = () => {
5873
6397
  totalRecords: dashboardData === null || dashboardData === void 0 ? void 0 : (_dashboardData$dashbo6 = dashboardData.dashboardInfo) === null || _dashboardData$dashbo6 === void 0 ? void 0 : _dashboardData$dashbo6.total,
5874
6398
  currentPage: currentPage,
5875
6399
  pageSizeLimit: pageSize,
6400
+ showAutoSerialNo: true,
5876
6401
  isPaginationRequired: true,
5877
6402
  onNextPage: () => {
5878
6403
  var _dashboardData$dashbo7;
@@ -6087,8 +6612,7 @@ const AssignEkyc = () => {
6087
6612
  enabled: !!tenantId,
6088
6613
  keepPreviousData: true
6089
6614
  }),
6090
- isDataSearchLoading = _Digit$Hooks$ekyc$use.isLoading,
6091
- data = _Digit$Hooks$ekyc$use.data;
6615
+ isDataSearchLoading = _Digit$Hooks$ekyc$use.isLoading;
6092
6616
  const sourceData = React.useMemo(() => {
6093
6617
  return (dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.surveyors) || [];
6094
6618
  }, [dashboardData]);
@@ -6194,62 +6718,411 @@ const AssignEkyc = () => {
6194
6718
  });
6195
6719
  }
6196
6720
  }
6197
- };
6198
- const propsForInboxTable = SupervisorInboxTableConfig(_extends({}, {
6199
- onPageSizeChange,
6200
- formState,
6201
- totalCount: totalRecords,
6202
- table: filteredData,
6203
- dispatch,
6204
- onSortingByData,
6205
- tenantId,
6206
- inboxStyles: {
6207
- overflowX: "scroll",
6208
- overflowY: "hidden"
6209
- },
6210
- tableStyle: {
6211
- width: "70%"
6721
+ };
6722
+ const propsForInboxTable = SupervisorInboxTableConfig(_extends({}, {
6723
+ onPageSizeChange,
6724
+ formState,
6725
+ totalCount: totalRecords,
6726
+ table: filteredData,
6727
+ dispatch,
6728
+ onSortingByData,
6729
+ tenantId,
6730
+ inboxStyles: {
6731
+ overflowX: "scroll",
6732
+ overflowY: "hidden"
6733
+ },
6734
+ tableStyle: {
6735
+ width: "70%"
6736
+ }
6737
+ }));
6738
+ const isInboxLoading = isLoading;
6739
+ return /*#__PURE__*/React__default.createElement("div", {
6740
+ className: "app-container"
6741
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.InboxComposer, _extends({
6742
+ isInboxLoading
6743
+ }, propsForSearchForm, {
6744
+ propsForInboxTable,
6745
+ formState,
6746
+ countData: dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo,
6747
+ isCardLoading: isDataSearchLoading
6748
+ })));
6749
+ };
6750
+
6751
+ const AdminDashboard = () => {
6752
+ var _Digit$SessionStorage, _loggedInUser$roles, _fullName$charAt;
6753
+ const _useTranslation = reactI18next.useTranslation(),
6754
+ t = _useTranslation.t;
6755
+ const history = reactRouterDom.useHistory();
6756
+ let tenantId = Digit.ULBService.getCurrentTenantId();
6757
+ if (!tenantId || tenantId === "dl") {
6758
+ tenantId = "dl.djb";
6759
+ }
6760
+ const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
6761
+ const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
6762
+ status: "ACTIVE"
6763
+ }, {
6764
+ enabled: !!tenantId
6765
+ }),
6766
+ vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
6767
+ isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
6768
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
6769
+ enabled: !!tenantId,
6770
+ keepPreviousData: true
6771
+ }),
6772
+ progressData = _Digit$Hooks$ekyc$use.data,
6773
+ isProgressLoading = _Digit$Hooks$ekyc$use.isLoading;
6774
+ const vendorsList = React.useMemo(() => {
6775
+ if (vendorSearchResponse && vendorSearchResponse.length > 0) {
6776
+ return vendorSearchResponse.map(v => {
6777
+ var _progressData$supervi, _dso$owner, _v$owner, _dso$owner2;
6778
+ const dso = v.dsoDetails || v;
6779
+ const supervisorsList = dso.supervisors || [];
6780
+ const surveyorsList = dso.surveyors || [];
6781
+ const supervisorIds = supervisorsList.map(s => {
6782
+ var _s$owner;
6783
+ return s.id || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid);
6784
+ }).filter(Boolean);
6785
+ const matchedReports = (progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.filter(r => supervisorIds.includes(r.supervisorId))) || [];
6786
+ const completed = matchedReports.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
6787
+ const pending = matchedReports.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
6788
+ const total = matchedReports.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
6789
+ const progress = total > 0 ? Math.round(completed / total * 100) : 0;
6790
+ const rejected = 0;
6791
+ return {
6792
+ id: dso.id || dso.vendorId || v.id || v.vendorId,
6793
+ name: dso.name || dso.displayName || v.name || "N/A",
6794
+ ownerName: ((_dso$owner = dso.owner) === null || _dso$owner === void 0 ? void 0 : _dso$owner.name) || ((_v$owner = v.owner) === null || _v$owner === void 0 ? void 0 : _v$owner.name) || "N/A",
6795
+ mobileNumber: dso.mobileNumber || ((_dso$owner2 = dso.owner) === null || _dso$owner2 === void 0 ? void 0 : _dso$owner2.mobileNumber) || v.mobileNumber || "N/A",
6796
+ supervisors: supervisorsList.length,
6797
+ surveyors: surveyorsList.length,
6798
+ completed: completed,
6799
+ progress: progress,
6800
+ pending: pending,
6801
+ rejected: rejected
6802
+ };
6803
+ });
6804
+ }
6805
+ return [];
6806
+ }, [vendorSearchResponse, progressData]);
6807
+ const _useState = React.useState(false),
6808
+ ekycDownloadLoading = _useState[0],
6809
+ setEkycDownloadLoading = _useState[1];
6810
+ const _useState2 = React.useState(0),
6811
+ currentPage = _useState2[0];
6812
+ const _useState3 = React.useState(20),
6813
+ pageSize = _useState3[0];
6814
+ const _Digit$Hooks$ekyc$use2 = Digit.Hooks.ekyc.useEkycApplicationList({}, {
6815
+ tenantId,
6816
+ offset: currentPage * pageSize,
6817
+ limit: pageSize
6818
+ }, {
6819
+ keepPreviousData: true
6820
+ });
6821
+ const fullName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "Admin";
6822
+ const mobileNumber = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber) || "N/A";
6823
+ const roleText = (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$roles = loggedInUser.roles) === null || _loggedInUser$roles === void 0 ? void 0 : _loggedInUser$roles.map(r => r.name).join(", ")) || "EKYC Admin";
6824
+ const handleDownloadEkycData = function () {
6825
+ try {
6826
+ setEkycDownloadLoading(true);
6827
+ return Promise.resolve(_finallyRethrows(function () {
6828
+ return _catch(function () {
6829
+ return Promise.resolve(Digit.EkycService.application_list({
6830
+ tenantId: tenantId,
6831
+ offset: 0,
6832
+ limit: 10000,
6833
+ reportDownload: true
6834
+ })).then(function (response) {
6835
+ const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
6836
+ if (consumerList.length === 0) {
6837
+ alert(t("NO_DATA_FOUND") || "No data found for download.");
6838
+ return;
6839
+ }
6840
+ const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
6841
+ const headerMapping = {
6842
+ kno: t("KNO") || "KNO",
6843
+ firstName: t("FIRST_NAME") || "First Name",
6844
+ middleName: t("MIDDLE_NAME") || "Middle Name",
6845
+ lastName: t("LAST_NAME") || "Last Name",
6846
+ gender: t("GENDER") || "Gender",
6847
+ mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
6848
+ emailId: t("EMAIL_ID") || "Email ID",
6849
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
6850
+ relationship: t("RELATIONSHIP") || "Relationship",
6851
+ dob: t("DOB") || "Date of Birth",
6852
+ ekycStatus: t("EKYC_STATUS") || "eKYC Status",
6853
+ zoneName: t("ZONE") || "Zone",
6854
+ assembly: t("ASSEMBLY") || "Assembly",
6855
+ ward: t("WARD") || "Ward",
6856
+ pincode: t("PINCODE") || "Pincode",
6857
+ mrkey: t("MR_KEY") || "MR Key",
6858
+ createdTime: t("CREATED_TIME") || "Created Time",
6859
+ lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
6860
+ };
6861
+ const excelData = consumerList.map(item => {
6862
+ const cleanObj = {};
6863
+ const name = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
6864
+ if (name) {
6865
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = name;
6866
+ }
6867
+ Object.keys(item).forEach(key => {
6868
+ if (excludedKeys.includes(key)) return;
6869
+ const val = item[key];
6870
+ if (typeof val === "object" && val !== null) {
6871
+ return;
6872
+ }
6873
+ const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
6874
+ cleanObj[friendlyHeader] = val;
6875
+ });
6876
+ return cleanObj;
6877
+ });
6878
+ const cleanFileName = "eKYC_All_Data_Admin_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
6879
+ Digit.Download.Excel(excelData, cleanFileName);
6880
+ });
6881
+ }, function (error) {
6882
+ console.error("Error downloading eKYC Excel:", error);
6883
+ });
6884
+ }, function (_wasThrown, _result) {
6885
+ setEkycDownloadLoading(false);
6886
+ if (_wasThrown) throw _result;
6887
+ return _result;
6888
+ }));
6889
+ } catch (e) {
6890
+ return Promise.reject(e);
6891
+ }
6892
+ };
6893
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
6894
+ className: "surveyor-dashboard"
6895
+ }, /*#__PURE__*/React__default.createElement("div", {
6896
+ className: "ekyc-dashboard-section"
6897
+ }, /*#__PURE__*/React__default.createElement("div", {
6898
+ className: "ekyc-dashboard-header"
6899
+ }, /*#__PURE__*/React__default.createElement("div", {
6900
+ className: "avatar"
6901
+ }, fullName === null || fullName === void 0 ? void 0 : (_fullName$charAt = fullName.charAt(0)) === null || _fullName$charAt === void 0 ? void 0 : _fullName$charAt.toUpperCase()), /*#__PURE__*/React__default.createElement("div", {
6902
+ className: "header-content"
6903
+ }, /*#__PURE__*/React__default.createElement("h2", {
6904
+ className: "name"
6905
+ }, fullName), /*#__PURE__*/React__default.createElement("div", {
6906
+ className: "designation"
6907
+ }, t("EKYC_ADMIN") || "eKYC Admin / Manager"), /*#__PURE__*/React__default.createElement("div", {
6908
+ className: "mobile-number"
6909
+ }, mobileNumber))), /*#__PURE__*/React__default.createElement("button", {
6910
+ className: "download-excel-btn",
6911
+ disabled: ekycDownloadLoading,
6912
+ onClick: handleDownloadEkycData,
6913
+ style: {
6914
+ margin: 0,
6915
+ padding: "8px 16px",
6916
+ height: "auto",
6917
+ minHeight: "36px",
6918
+ width: "auto"
6919
+ }
6920
+ }, /*#__PURE__*/React__default.createElement("svg", {
6921
+ width: "16",
6922
+ height: "16",
6923
+ viewBox: "0 0 24 24",
6924
+ fill: "none",
6925
+ stroke: "currentColor",
6926
+ strokeWidth: "2.5",
6927
+ strokeLinecap: "round",
6928
+ strokeLinejoin: "round",
6929
+ style: {
6930
+ marginRight: "8px"
6931
+ }
6932
+ }, /*#__PURE__*/React__default.createElement("path", {
6933
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
6934
+ }), /*#__PURE__*/React__default.createElement("polyline", {
6935
+ points: "7 10 12 15 17 10"
6936
+ }), /*#__PURE__*/React__default.createElement("line", {
6937
+ x1: "12",
6938
+ y1: "15",
6939
+ x2: "12",
6940
+ y2: "3"
6941
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")), /*#__PURE__*/React__default.createElement("div", {
6942
+ style: {
6943
+ marginTop: "32px"
6944
+ }
6945
+ }, /*#__PURE__*/React__default.createElement("h3", {
6946
+ style: {
6947
+ fontSize: "20px",
6948
+ fontWeight: "700",
6949
+ color: "#101828",
6950
+ marginBottom: "20px"
6951
+ }
6952
+ }, t("EKYC_VENDORS_PERFORMANCE") || "eKYC Vendors Performance"), isVendorSearchLoading || isProgressLoading ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null) : /*#__PURE__*/React__default.createElement("div", {
6953
+ style: {
6954
+ display: "grid",
6955
+ gridTemplateColumns: "repeat(3, 1fr)",
6956
+ gap: "24px",
6957
+ width: "100%"
6958
+ }
6959
+ }, vendorsList.length === 0 ? /*#__PURE__*/React__default.createElement("div", {
6960
+ style: {
6961
+ gridColumn: "span 3",
6962
+ textAlign: "center",
6963
+ padding: "40px",
6964
+ color: "#64748B",
6965
+ fontSize: "16px"
6966
+ }
6967
+ }, t("NO_VENDORS_FOUND") || "No vendors found.") : vendorsList.map(vendor => /*#__PURE__*/React__default.createElement("div", {
6968
+ key: vendor.id,
6969
+ onClick: () => history.push("/digit-ui/employee/ekyc/vendors/" + vendor.id),
6970
+ style: {
6971
+ background: "#ffffff",
6972
+ border: "1px solid #E2E8F0",
6973
+ borderRadius: "16px",
6974
+ padding: "24px",
6975
+ boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03)",
6976
+ cursor: "pointer",
6977
+ transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
6978
+ display: "flex",
6979
+ flexDirection: "column",
6980
+ justifyContent: "space-between",
6981
+ gap: "16px"
6982
+ },
6983
+ onMouseEnter: e => {
6984
+ e.currentTarget.style.transform = "translateY(-4px)";
6985
+ e.currentTarget.style.boxShadow = "0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04)";
6986
+ e.currentTarget.style.borderColor = "#CBD5E1";
6987
+ },
6988
+ onMouseLeave: e => {
6989
+ e.currentTarget.style.transform = "translateY(0)";
6990
+ e.currentTarget.style.boxShadow = "0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03)";
6991
+ e.currentTarget.style.borderColor = "#E2E8F0";
6992
+ }
6993
+ }, /*#__PURE__*/React__default.createElement("div", {
6994
+ style: {
6995
+ display: "flex",
6996
+ justifyContent: "space-between",
6997
+ alignItems: "flex-start"
6998
+ }
6999
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h4", {
7000
+ style: {
7001
+ fontSize: "18px",
7002
+ fontWeight: "700",
7003
+ color: "#0B2559",
7004
+ margin: 0
7005
+ }
7006
+ }, vendor.name), /*#__PURE__*/React__default.createElement("p", {
7007
+ style: {
7008
+ fontSize: "12px",
7009
+ color: "#64748B",
7010
+ marginTop: "2px",
7011
+ marginBottom: 0
7012
+ }
7013
+ }, t("MOBILE") || "Mobile", ": ", vendor.mobileNumber)), /*#__PURE__*/React__default.createElement("span", {
7014
+ style: {
7015
+ background: "#E0F2FE",
7016
+ color: "#0369A1",
7017
+ padding: "6px 12px",
7018
+ borderRadius: "999px",
7019
+ fontSize: "13px",
7020
+ fontWeight: "700"
7021
+ }
7022
+ }, vendor.progress, "%")), /*#__PURE__*/React__default.createElement("div", {
7023
+ style: {
7024
+ width: "100%",
7025
+ height: "8px",
7026
+ background: "#F1F5F9",
7027
+ borderRadius: "999px",
7028
+ overflow: "hidden"
7029
+ }
7030
+ }, /*#__PURE__*/React__default.createElement("div", {
7031
+ style: {
7032
+ width: vendor.progress + "%",
7033
+ height: "100%",
7034
+ background: "linear-gradient(90deg, #3B82F6 0%, #10B981 100%)",
7035
+ borderRadius: "999px"
7036
+ }
7037
+ })), /*#__PURE__*/React__default.createElement("div", {
7038
+ style: {
7039
+ display: "grid",
7040
+ gridTemplateColumns: "repeat(3, 1fr)",
7041
+ gap: "12px"
7042
+ }
7043
+ }, /*#__PURE__*/React__default.createElement("div", {
7044
+ style: {
7045
+ background: "#F8FAFC",
7046
+ padding: "12px 8px",
7047
+ borderRadius: "10px",
7048
+ textAlign: "center"
7049
+ }
7050
+ }, /*#__PURE__*/React__default.createElement("div", {
7051
+ style: {
7052
+ fontSize: "16px",
7053
+ fontWeight: "700",
7054
+ color: "#1E293B"
6212
7055
  }
6213
- }));
6214
- const isInboxLoading = isLoading;
6215
- const cards = [{
6216
- label: "TOTAL_EKYC_APPLICATIONS",
6217
- count: (data === null || data === void 0 ? void 0 : data.totalKnos) || 0,
6218
- color: "#0B2559",
6219
- filter: null,
6220
- active: true
6221
- }, {
6222
- label: "TOTAL_ASSIGNMENTS",
6223
- count: (data === null || data === void 0 ? void 0 : data.totalAssignments) || 0,
6224
- color: "#3B82F6",
6225
- filter: ["ASSIGNED"]
6226
- }, {
6227
- label: "EKYC_COMPLETED",
6228
- count: (data === null || data === void 0 ? void 0 : data.completedKnos) || 0,
6229
- color: "#10B981",
6230
- filter: ["COMPLETED"]
6231
- }, {
6232
- label: "PENDING_APPLICATIONS",
6233
- count: ((data === null || data === void 0 ? void 0 : data.totalKnos) || 0) - ((data === null || data === void 0 ? void 0 : data.completedKnos) || 0),
6234
- color: "#F59E0B",
6235
- filter: ["PENDING"]
6236
- }, {
6237
- label: "OVERALL_PROGRESS",
6238
- count: ((data === null || data === void 0 ? void 0 : data.overallProgressPercent) || 0) + "%",
6239
- color: "#A855F7",
6240
- filter: ["IN_PROGRESS"]
6241
- }];
6242
- return /*#__PURE__*/React__default.createElement("div", {
6243
- className: "app-container"
6244
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.InboxComposer, _extends({
6245
- isInboxLoading
6246
- }, propsForSearchForm, {
6247
- propsForInboxTable,
6248
- formState,
6249
- countData: dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo,
6250
- cards,
6251
- isCardLoading: isDataSearchLoading
6252
- })));
7056
+ }, vendor.supervisors), /*#__PURE__*/React__default.createElement("div", {
7057
+ style: {
7058
+ fontSize: "10px",
7059
+ fontWeight: "600",
7060
+ color: "#64748B",
7061
+ textTransform: "uppercase",
7062
+ marginTop: "4px"
7063
+ }
7064
+ }, t("SUPERVISORS") || "Supervisors")), /*#__PURE__*/React__default.createElement("div", {
7065
+ style: {
7066
+ background: "#F8FAFC",
7067
+ padding: "12px 8px",
7068
+ borderRadius: "10px",
7069
+ textAlign: "center"
7070
+ }
7071
+ }, /*#__PURE__*/React__default.createElement("div", {
7072
+ style: {
7073
+ fontSize: "16px",
7074
+ fontWeight: "700",
7075
+ color: "#1E293B"
7076
+ }
7077
+ }, vendor.surveyors), /*#__PURE__*/React__default.createElement("div", {
7078
+ style: {
7079
+ fontSize: "10px",
7080
+ fontWeight: "600",
7081
+ color: "#64748B",
7082
+ textTransform: "uppercase",
7083
+ marginTop: "4px"
7084
+ }
7085
+ }, t("SURVEYORS") || "Surveyors")), /*#__PURE__*/React__default.createElement("div", {
7086
+ style: {
7087
+ background: "#F8FAFC",
7088
+ padding: "12px 8px",
7089
+ borderRadius: "10px",
7090
+ textAlign: "center"
7091
+ }
7092
+ }, /*#__PURE__*/React__default.createElement("div", {
7093
+ style: {
7094
+ fontSize: "16px",
7095
+ fontWeight: "700",
7096
+ color: "#10B981"
7097
+ }
7098
+ }, vendor.completed), /*#__PURE__*/React__default.createElement("div", {
7099
+ style: {
7100
+ fontSize: "10px",
7101
+ fontWeight: "600",
7102
+ color: "#64748B",
7103
+ textTransform: "uppercase",
7104
+ marginTop: "4px"
7105
+ }
7106
+ }, t("COMPLETED") || "Completed"))), /*#__PURE__*/React__default.createElement("div", {
7107
+ style: {
7108
+ display: "flex",
7109
+ justifyContent: "space-between",
7110
+ fontSize: "12px",
7111
+ color: "#64748B",
7112
+ borderTop: "1px solid #F1F5F9",
7113
+ paddingTop: "12px"
7114
+ }
7115
+ }, /*#__PURE__*/React__default.createElement("span", null, t("PENDING") || "Pending", ": ", /*#__PURE__*/React__default.createElement("span", {
7116
+ style: {
7117
+ fontWeight: "700",
7118
+ color: "#F59E0B"
7119
+ }
7120
+ }, vendor.pending)), /*#__PURE__*/React__default.createElement("span", null, t("REJECTED") || "Rejected", ": ", /*#__PURE__*/React__default.createElement("span", {
7121
+ style: {
7122
+ fontWeight: "700",
7123
+ color: "#EF4444"
7124
+ }
7125
+ }, vendor.rejected))))))));
6253
7126
  };
6254
7127
 
6255
7128
  const EmployeeApp = _ref => {
@@ -6311,6 +7184,10 @@ const EmployeeApp = _ref => {
6311
7184
  crumbs.push({
6312
7185
  label: t("CEO_M.F_DOR_FINANCE_VIEW")
6313
7186
  });
7187
+ } else if (pathname.includes("/admin-dashboard")) {
7188
+ crumbs.push({
7189
+ label: t("EKYC_ADMIN_DASHBOARD") || "Admin Dashboard"
7190
+ });
6314
7191
  } else if (pathname.includes("/vendors/")) {
6315
7192
  crumbs.push({
6316
7193
  label: t("EKYC_VENDOR_DETAILS")
@@ -6400,11 +7277,16 @@ const EmployeeApp = _ref => {
6400
7277
  component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
6401
7278
  layoutClass: "normal"
6402
7279
  }, /*#__PURE__*/React__default.createElement(CeoDashboard, null))
7280
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
7281
+ path: path + "/admin-dashboard",
7282
+ component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
7283
+ layoutClass: "normal"
7284
+ }, /*#__PURE__*/React__default.createElement(AdminDashboard, null))
6403
7285
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
6404
7286
  path: path + "/vendors/:vendorId",
6405
7287
  component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
6406
7288
  layoutClass: "normal"
6407
- }, /*#__PURE__*/React__default.createElement(VendorDetails, null))
7289
+ }, /*#__PURE__*/React__default.createElement(VendorDetailsCard, null))
6408
7290
  })))));
6409
7291
  };
6410
7292
 
@@ -7465,6 +8347,12 @@ const Home = () => {
7465
8347
  link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
7466
8348
  });
7467
8349
  }
8350
+ if (roles.includes("EKYC_VENDOR")) {
8351
+ propsForModuleCard.links.push({
8352
+ label: t("EKYC_VENDOR_DASHBOARD"),
8353
+ link: "/digit-ui/citizen/ekyc/vendor-dashboard"
8354
+ });
8355
+ }
7468
8356
  if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
7469
8357
  propsForModuleCard.links.push({
7470
8358
  label: t("TITLE_VENDOR_MANAGEMENT"),
@@ -7473,12 +8361,6 @@ const Home = () => {
7473
8361
  }
7474
8362
  if (roles.length === 1 && roles.includes("CITIZEN")) {
7475
8363
  propsForModuleCard.links.push({
7476
- label: t("EKYC_CREATE_KYC"),
7477
- link: "/digit-ui/citizen/ekyc/create-kyc"
7478
- }, {
7479
- label: t("EKYC_UPDATE_KYC"),
7480
- link: "/digit-ui/citizen/ekyc/update-kyc"
7481
- }, {
7482
8364
  label: t("EKYC_STATUS"),
7483
8365
  link: "/digit-ui/citizen/ekyc/:id"
7484
8366
  });
@@ -7735,119 +8617,50 @@ const Inbox$1 = _ref => {
7735
8617
  })));
7736
8618
  };
7737
8619
 
7738
- const SurveyorStatsCell = _ref => {
7739
- let surveyorId = _ref.surveyorId,
7740
- type = _ref.type;
7741
- const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycSurveyorDashboard({}, {
7742
- tenantId: "dl.djb",
7743
- offset: 0,
7744
- limit: 1,
7745
- surveyorId: surveyorId
7746
- }, {
7747
- enabled: !!surveyorId,
7748
- staleTime: 60000
7749
- }),
7750
- data = _Digit$Hooks$ekyc$use.data,
7751
- isLoading = _Digit$Hooks$ekyc$use.isLoading;
7752
- if (isLoading) return "...";
7753
- const dashboardInfo = (data === null || data === void 0 ? void 0 : data.dashboardInfo) || {};
7754
- const total = (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0;
7755
- const completed = (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0;
7756
- const pending = (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0;
7757
- const progress = total > 0 ? Math.round(completed / total * 100) + "%" : "0%";
7758
- if (type === "total") return total;
7759
- if (type === "completed") return completed;
7760
- if (type === "pending") return pending;
7761
- if (type === "progress") return progress;
7762
- return null;
7763
- };
7764
8620
  const SupervisorDetailsCard = () => {
7765
- var _Digit$SessionStorage, _Digit$SessionStorage2, _supervisor$owner, _supervisor$owner3, _fullName$charAt, _supervisor$owner6, _supervisor$owner7, _supervisor$owner8, _supervisor$additiona;
8621
+ var _Digit$SessionStorage, _fullName$charAt;
7766
8622
  const _useTranslation = reactI18next.useTranslation(),
7767
8623
  t = _useTranslation.t;
7768
8624
  const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
7769
8625
  const _useParams = reactRouterDom.useParams(),
7770
8626
  supervisorId = _useParams.id;
7771
- const ownerIds = (_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$SessionStorage2.uuid;
7772
- const searchParams = supervisorId ? {
7773
- ids: supervisorId
7774
- } : {
7775
- ownerIds
7776
- };
7777
- const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorSearch(tenantId, searchParams, {
7778
- staleTime: Infinity
7779
- }),
7780
- supervisorSearchResponse = _Digit$Hooks$fsm$useS.data,
7781
- isSupervisorSearchLoading = _Digit$Hooks$fsm$useS.isLoading;
7782
- const supervisor = React.useMemo(() => {
7783
- var _supervisorSearchResp;
7784
- return (supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : (_supervisorSearchResp = supervisorSearchResponse.supervisors) === null || _supervisorSearchResp === void 0 ? void 0 : _supervisorSearchResp[0]) || null;
7785
- }, [supervisorSearchResponse]);
7786
- const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
7787
- status: "ACTIVE"
7788
- }, {
7789
- enabled: !!tenantId
7790
- }),
7791
- vendorData = _Digit$Hooks$fsm$useD.data;
7792
- const vendorName = React.useMemo(() => {
7793
- var _mappedVendor$dsoDeta;
7794
- if (!vendorData || !(supervisor !== null && supervisor !== void 0 && supervisor.vendorId)) return "N/A";
7795
- const mappedVendor = vendorData.find(v => {
7796
- var _v$dsoDetails, _v$dsoDetails2;
7797
- return ((_v$dsoDetails = v.dsoDetails) === null || _v$dsoDetails === void 0 ? void 0 : _v$dsoDetails.id) === supervisor.vendorId || ((_v$dsoDetails2 = v.dsoDetails) === null || _v$dsoDetails2 === void 0 ? void 0 : _v$dsoDetails2.vendorId) === supervisor.vendorId;
7798
- });
7799
- return (mappedVendor === null || mappedVendor === void 0 ? void 0 : (_mappedVendor$dsoDeta = mappedVendor.dsoDetails) === null || _mappedVendor$dsoDeta === void 0 ? void 0 : _mappedVendor$dsoDeta.name) || supervisor.vendorId || "N/A";
7800
- }, [vendorData, supervisor === null || supervisor === void 0 ? void 0 : supervisor.vendorId]);
7801
- const fullName = (supervisor === null || supervisor === void 0 ? void 0 : (_supervisor$owner = supervisor.owner) === null || _supervisor$owner === void 0 ? void 0 : _supervisor$owner.name) || (supervisor === null || supervisor === void 0 ? void 0 : supervisor.name) || "N/A";
7802
- const mobileNumber = (supervisor === null || supervisor === void 0 ? void 0 : (_supervisor$owner3 = supervisor.owner) === null || _supervisor$owner3 === void 0 ? void 0 : _supervisor$owner3.mobileNumber) || (supervisor === null || supervisor === void 0 ? void 0 : supervisor.mobileNo) || "N/A";
7803
- const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSurveyorSearch(tenantId, {
7804
- supervisorIds: supervisor === null || supervisor === void 0 ? void 0 : supervisor.id
7805
- }, {
7806
- enabled: !!tenantId && !!(supervisor !== null && supervisor !== void 0 && supervisor.id)
7807
- }),
7808
- surveyorsResponse = _Digit$Hooks$fsm$useS2.data,
7809
- isSurveyorsLoading = _Digit$Hooks$fsm$useS2.isLoading;
7810
- const surveyors = React.useMemo(() => {
7811
- return (surveyorsResponse === null || surveyorsResponse === void 0 ? void 0 : surveyorsResponse.surveyors) || (surveyorsResponse === null || surveyorsResponse === void 0 ? void 0 : surveyorsResponse.surveyor) || [];
7812
- }, [surveyorsResponse]);
7813
- const _Digit$Hooks$ekyc$use2 = Digit.Hooks.ekyc.useEkycAssignmentProgress({
8627
+ const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
8628
+ const _useState = React.useState(false),
8629
+ ekycDownloadLoading = _useState[0],
8630
+ setEkycDownloadLoading = _useState[1];
8631
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
7814
8632
  enabled: !!tenantId,
7815
8633
  keepPreviousData: true
7816
8634
  }),
7817
- isProgressLoading = _Digit$Hooks$ekyc$use2.isLoading,
7818
- progressData = _Digit$Hooks$ekyc$use2.data;
7819
- const cards = React.useMemo(() => [{
7820
- label: "TOTAL_EKYC_APPLICATIONS",
7821
- count: (progressData === null || progressData === void 0 ? void 0 : progressData.totalKnos) || 0,
7822
- color: "#0B2559",
7823
- type: "today"
7824
- }, {
7825
- label: "TOTAL_ASSIGNMENTS",
7826
- count: (progressData === null || progressData === void 0 ? void 0 : progressData.totalAssignments) || 0,
7827
- color: "#3B82F6",
7828
- type: "week"
7829
- }, {
7830
- label: "EKYC_COMPLETED",
7831
- count: (progressData === null || progressData === void 0 ? void 0 : progressData.completedKnos) || 0,
7832
- color: "#10B981",
7833
- type: "month"
7834
- }, {
7835
- label: "PENDING_APPLICATIONS",
7836
- count: ((progressData === null || progressData === void 0 ? void 0 : progressData.totalKnos) || 0) - ((progressData === null || progressData === void 0 ? void 0 : progressData.completedKnos) || 0),
7837
- color: "#F59E0B",
7838
- type: "pending"
7839
- }, {
7840
- label: "OVERALL_PROGRESS",
7841
- count: ((progressData === null || progressData === void 0 ? void 0 : progressData.overallProgressPercent) || 0) + "%",
7842
- color: "#A855F7",
7843
- type: "progress"
7844
- }], [progressData]);
7845
- const _useState = React.useState(0),
7846
- currentPage = _useState[0],
7847
- setCurrentPage = _useState[1];
7848
- const _useState2 = React.useState(20),
7849
- pageSize = _useState2[0],
7850
- setPageSize = _useState2[1];
8635
+ isProgressLoading = _Digit$Hooks$ekyc$use.isLoading,
8636
+ progressData = _Digit$Hooks$ekyc$use.data;
8637
+ const supervisor = React.useMemo(() => {
8638
+ if (!(progressData !== null && progressData !== void 0 && progressData.supervisorReport)) return null;
8639
+ if (supervisorId) {
8640
+ return progressData.supervisorReport.find(s => s.supervisorId === supervisorId) || progressData.supervisorReport[0];
8641
+ }
8642
+ const userUuid = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid;
8643
+ if (userUuid) {
8644
+ return progressData.supervisorReport.find(s => s.supervisorId === userUuid) || progressData.supervisorReport[0];
8645
+ }
8646
+ return progressData.supervisorReport[0];
8647
+ }, [progressData, supervisorId, loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid]);
8648
+ const fullName = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorName) || (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "N/A";
8649
+ const mobileNumber = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.mobileNo) || (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber) || "N/A";
8650
+ const email = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.emailId) || "N/A";
8651
+ const gender = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.gender) || "N/A";
8652
+ const status = supervisor ? "ACTIVE" : "N/A";
8653
+ const assignedZone = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.assignedZoneId) || "N/A";
8654
+ const vendorName = "N/A";
8655
+ const surveyors = React.useMemo(() => {
8656
+ return (supervisor === null || supervisor === void 0 ? void 0 : supervisor.surveyors) || [];
8657
+ }, [supervisor]);
8658
+ const _useState2 = React.useState(0),
8659
+ currentPage = _useState2[0],
8660
+ setCurrentPage = _useState2[1];
8661
+ const _useState3 = React.useState(20),
8662
+ pageSize = _useState3[0],
8663
+ setPageSize = _useState3[1];
7851
8664
  const paginatedSurveyors = React.useMemo(() => {
7852
8665
  const start = currentPage * pageSize;
7853
8666
  const end = start + pageSize;
@@ -7855,102 +8668,64 @@ const SupervisorDetailsCard = () => {
7855
8668
  }, [surveyors, currentPage, pageSize]);
7856
8669
  const surveyorColumns = React.useMemo(() => [{
7857
8670
  Header: t("SURVEYOR_NAME") || "Surveyor Name",
7858
- accessor: row => {
7859
- var _row$owner;
7860
- return (row === null || row === void 0 ? void 0 : row.name) || (row === null || row === void 0 ? void 0 : (_row$owner = row.owner) === null || _row$owner === void 0 ? void 0 : _row$owner.name) || "N/A";
7861
- },
7862
- Cell: _ref2 => {
7863
- var _row$original, _row$original2, _row$original2$owner;
7864
- let row = _ref2.row;
8671
+ accessor: row => (row === null || row === void 0 ? void 0 : row.surveyorName) || "N/A",
8672
+ Cell: _ref => {
8673
+ var _row$original;
8674
+ let row = _ref.row;
7865
8675
  return /*#__PURE__*/React__default.createElement("a", {
7866
- href: "/digit-ui/citizen/ekyc/surveyor-dashboard/" + row.original.id,
8676
+ href: "/digit-ui/citizen/ekyc/surveyor-dashboard/" + row.original.surveyorId,
7867
8677
  style: {
7868
8678
  color: "#1D70B8",
7869
8679
  fontWeight: "600",
7870
8680
  textDecoration: "none"
7871
8681
  }
7872
- }, ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.name) || ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : (_row$original2$owner = _row$original2.owner) === null || _row$original2$owner === void 0 ? void 0 : _row$original2$owner.name) || "N/A");
8682
+ }, ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.surveyorName) || "N/A");
7873
8683
  }
7874
8684
  }, {
7875
8685
  Header: t("MOBILE_NUMBER") || "Mobile Number",
7876
- accessor: row => {
7877
- var _row$owner2;
7878
- return (row === null || row === void 0 ? void 0 : (_row$owner2 = row.owner) === null || _row$owner2 === void 0 ? void 0 : _row$owner2.mobileNumber) || (row === null || row === void 0 ? void 0 : row.mobileNo) || "N/A";
7879
- },
8686
+ accessor: row => (row === null || row === void 0 ? void 0 : row.mobileNo) || "N/A",
7880
8687
  id: "mobileNumber"
7881
8688
  }, {
7882
8689
  Header: t("STATUS") || "Status",
7883
- accessor: "status",
7884
- Cell: _ref3 => {
7885
- let value = _ref3.value;
8690
+ accessor: () => "ACTIVE",
8691
+ id: "status",
8692
+ Cell: _ref2 => {
8693
+ let value = _ref2.value;
7886
8694
  return /*#__PURE__*/React__default.createElement("span", {
7887
- className: "status-badge " + (value === "ACTIVE" ? "verified" : "pending")
8695
+ className: "status-badge verified"
7888
8696
  }, t(value) || value);
7889
8697
  }
7890
8698
  }, {
7891
8699
  Header: t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications",
7892
- accessor: row => (row === null || row === void 0 ? void 0 : row.totalEkycApplications) || 0,
7893
- id: "totalEkycApplications",
7894
- Cell: _ref4 => {
7895
- var _row$original3, _row$original3$owner;
7896
- let row = _ref4.row;
7897
- return /*#__PURE__*/React__default.createElement(SurveyorStatsCell, {
7898
- surveyorId: (_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : (_row$original3$owner = _row$original3.owner) === null || _row$original3$owner === void 0 ? void 0 : _row$original3$owner.uuid,
7899
- type: "total"
7900
- });
7901
- }
8700
+ accessor: row => (row === null || row === void 0 ? void 0 : row.totalKnos) || 0,
8701
+ id: "totalEkycApplications"
7902
8702
  }, {
7903
8703
  Header: t("EKYC_COMPLETED") || "eKYC Completed",
7904
- accessor: row => (row === null || row === void 0 ? void 0 : row.ekycCompleted) || 0,
7905
- id: "ekycCompleted",
7906
- Cell: _ref5 => {
7907
- var _row$original4, _row$original4$owner;
7908
- let row = _ref5.row;
7909
- return /*#__PURE__*/React__default.createElement(SurveyorStatsCell, {
7910
- surveyorId: (_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : (_row$original4$owner = _row$original4.owner) === null || _row$original4$owner === void 0 ? void 0 : _row$original4$owner.uuid,
7911
- type: "completed"
7912
- });
7913
- }
8704
+ accessor: row => (row === null || row === void 0 ? void 0 : row.submittedKnos) || 0,
8705
+ id: "ekycCompleted"
7914
8706
  }, {
7915
8707
  Header: t("PENDING_APPLICATIONS") || "Pending Applications",
7916
- accessor: row => (row === null || row === void 0 ? void 0 : row.pendingApplications) || 0,
7917
- id: "pendingApplications",
7918
- Cell: _ref6 => {
7919
- var _row$original5, _row$original5$owner;
7920
- let row = _ref6.row;
7921
- return /*#__PURE__*/React__default.createElement(SurveyorStatsCell, {
7922
- surveyorId: (_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : (_row$original5$owner = _row$original5.owner) === null || _row$original5$owner === void 0 ? void 0 : _row$original5$owner.uuid,
7923
- type: "pending"
7924
- });
7925
- }
8708
+ accessor: row => (row === null || row === void 0 ? void 0 : row.pendingKnos) || 0,
8709
+ id: "pendingApplications"
7926
8710
  }, {
7927
8711
  Header: t("OVERALL_PROGRESS") || "Overall Progress",
7928
- accessor: row => (row === null || row === void 0 ? void 0 : row.overallProgress) || "N/A",
7929
- id: "overallProgress",
7930
- Cell: _ref7 => {
7931
- var _row$original6, _row$original6$owner;
7932
- let row = _ref7.row;
7933
- return /*#__PURE__*/React__default.createElement(SurveyorStatsCell, {
7934
- surveyorId: (_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : (_row$original6$owner = _row$original6.owner) === null || _row$original6$owner === void 0 ? void 0 : _row$original6$owner.uuid,
7935
- type: "progress"
7936
- });
7937
- }
8712
+ accessor: row => ((row === null || row === void 0 ? void 0 : row.progressPercent) || 0) + "%",
8713
+ id: "overallProgress"
7938
8714
  }], [t]);
7939
- const _useState3 = React.useState(false),
7940
- showReportMenu = _useState3[0],
7941
- setShowReportMenu = _useState3[1];
7942
- const _useState4 = React.useState({
8715
+ const _useState4 = React.useState(false),
8716
+ showReportMenu = _useState4[0],
8717
+ setShowReportMenu = _useState4[1];
8718
+ const _useState5 = React.useState({
7943
8719
  from: "",
7944
8720
  to: ""
7945
8721
  }),
7946
- customDate = _useState4[0],
7947
- setCustomDate = _useState4[1];
7948
- const _useState5 = React.useState(false),
7949
- showCustomPicker = _useState5[0],
7950
- setShowCustomPicker = _useState5[1];
8722
+ customDate = _useState5[0],
8723
+ setCustomDate = _useState5[1];
7951
8724
  const _useState6 = React.useState(false),
7952
- reportLoading = _useState6[0],
7953
- setReportLoading = _useState6[1];
8725
+ showCustomPicker = _useState6[0],
8726
+ setShowCustomPicker = _useState6[1];
8727
+ const _useState7 = React.useState(false),
8728
+ reportLoading = _useState7[0];
7954
8729
  const reportMenuRef = React.useRef(null);
7955
8730
  React.useEffect(() => {
7956
8731
  const handler = e => {
@@ -7962,223 +8737,97 @@ const SupervisorDetailsCard = () => {
7962
8737
  document.addEventListener("mousedown", handler);
7963
8738
  return () => document.removeEventListener("mousedown", handler);
7964
8739
  }, []);
7965
- const getDateRange = filter => {
7966
- const now = new Date();
7967
- const start = new Date(now);
7968
- if (filter === "today") {
7969
- start.setHours(0, 0, 0, 0);
7970
- return {
7971
- from: start,
7972
- to: now
7973
- };
7974
- }
7975
- if (filter === "week") {
7976
- start.setDate(now.getDate() - now.getDay());
7977
- start.setHours(0, 0, 0, 0);
7978
- return {
7979
- from: start,
7980
- to: now
7981
- };
7982
- }
7983
- if (filter === "month") {
7984
- start.setDate(1);
7985
- start.setHours(0, 0, 0, 0);
7986
- return {
7987
- from: start,
7988
- to: now
7989
- };
7990
- }
7991
- return null;
8740
+ const handlePresetDownload = filter => {
8741
+ handleDownload();
7992
8742
  };
7993
- const handlePresetDownload = function (filter) {
7994
- try {
7995
- const range = getDateRange(filter);
7996
- if (!range) return Promise.resolve();
7997
- setReportLoading(true);
7998
- const _temp = _finallyRethrows(function () {
7999
- return _catch(function () {
8000
- const surveyorsList = surveyors || [];
8001
- return Promise.resolve(Promise.all(surveyorsList.map(function (surveyor) {
8002
- try {
8003
- return Promise.resolve(_catch(function () {
8004
- var _surveyor$owner;
8005
- return Promise.resolve(Digit.EkycService.dashboard({}, {
8006
- tenantId: "dl.djb",
8007
- offset: 0,
8008
- limit: 1,
8009
- surveyorId: (_surveyor$owner = surveyor.owner) === null || _surveyor$owner === void 0 ? void 0 : _surveyor$owner.uuid,
8010
- fromDate: range.from.getTime(),
8011
- toDate: range.to.getTime()
8012
- })).then(function (response) {
8013
- const info = (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {};
8014
- const total = info.total || 0;
8015
- const completed = info.completed || 0;
8016
- const pending = info.pending || 0;
8017
- const progress = total > 0 ? Math.round(completed / total * 100) + "%" : "0%";
8018
- return _extends({}, surveyor, {
8019
- total,
8020
- completed,
8021
- pending,
8022
- progress
8023
- });
8024
- });
8025
- }, function (err) {
8026
- console.error("Failed to fetch stats for surveyor:", surveyor.id, err);
8027
- return _extends({}, surveyor, {
8028
- total: 0,
8029
- completed: 0,
8030
- pending: 0,
8031
- progress: "0%"
8032
- });
8033
- }));
8034
- } catch (e) {
8035
- return Promise.reject(e);
8036
- }
8037
- }))).then(function (rowsWithStats) {
8038
- var _supervisor$owner4;
8039
- return Promise.resolve(Digit.EkycService.dashboard({}, {
8040
- tenantId: "dl.djb",
8041
- offset: 0,
8042
- limit: 1,
8043
- supervisorId: supervisor === null || supervisor === void 0 ? void 0 : (_supervisor$owner4 = supervisor.owner) === null || _supervisor$owner4 === void 0 ? void 0 : _supervisor$owner4.uuid,
8044
- fromDate: range.from.getTime(),
8045
- toDate: range.to.getTime()
8046
- })).then(function (overallResponse) {
8047
- downloadSupervisorPDF({
8048
- rows: rowsWithStats,
8049
- supervisorName: fullName,
8050
- mobileNumber,
8051
- vendorName,
8052
- dashboardInfo: (overallResponse === null || overallResponse === void 0 ? void 0 : overallResponse.dashboardInfo) || {},
8053
- t
8054
- });
8055
- });
8056
- });
8057
- }, function (err) {
8058
- console.error("Failed to fetch dashboard data for report download:", err);
8059
- });
8060
- }, function (_wasThrown, _result) {
8061
- setReportLoading(false);
8062
- setShowReportMenu(false);
8063
- setShowCustomPicker(false);
8064
- if (_wasThrown) throw _result;
8065
- return _result;
8066
- });
8067
- return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
8068
- } catch (e) {
8069
- return Promise.reject(e);
8743
+ const handleCustomDownload = () => {
8744
+ if (!customDate.from || !customDate.to) {
8745
+ alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
8746
+ return;
8070
8747
  }
8748
+ handleDownload();
8071
8749
  };
8072
- const handleCustomDownload = function () {
8750
+ const handleDownloadEkycData = function () {
8073
8751
  try {
8074
- if (!customDate.from || !customDate.to) {
8075
- alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
8752
+ if (!surveyors || surveyors.length === 0) {
8753
+ alert(t("NO_SURVEYORS_ASSIGNED") || "No surveyors assigned to this supervisor.");
8076
8754
  return Promise.resolve();
8077
8755
  }
8078
- const from = new Date(customDate.from);
8079
- from.setHours(0, 0, 0, 0);
8080
- const to = new Date(customDate.to);
8081
- to.setHours(23, 59, 59, 999);
8082
- setReportLoading(true);
8083
- const _temp2 = _finallyRethrows(function () {
8756
+ setEkycDownloadLoading(true);
8757
+ return Promise.resolve(_finallyRethrows(function () {
8084
8758
  return _catch(function () {
8085
- const surveyorsList = surveyors || [];
8086
- return Promise.resolve(Promise.all(surveyorsList.map(function (surveyor) {
8087
- try {
8088
- return Promise.resolve(_catch(function () {
8089
- var _surveyor$owner2;
8090
- return Promise.resolve(Digit.EkycService.dashboard({}, {
8091
- tenantId: "dl.djb",
8092
- offset: 0,
8093
- limit: 1,
8094
- surveyorId: (_surveyor$owner2 = surveyor.owner) === null || _surveyor$owner2 === void 0 ? void 0 : _surveyor$owner2.uuid,
8095
- fromDate: from.getTime(),
8096
- toDate: to.getTime()
8097
- })).then(function (response) {
8098
- const info = (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {};
8099
- const total = info.total || 0;
8100
- const completed = info.completed || 0;
8101
- const pending = info.pending || 0;
8102
- const progress = total > 0 ? Math.round(completed / total * 100) + "%" : "0%";
8103
- return _extends({}, surveyor, {
8104
- total,
8105
- completed,
8106
- pending,
8107
- progress
8108
- });
8109
- });
8110
- }, function (err) {
8111
- console.error("Failed to fetch stats for surveyor:", surveyor.id, err);
8112
- return _extends({}, surveyor, {
8113
- total: 0,
8114
- completed: 0,
8115
- pending: 0,
8116
- progress: "0%"
8117
- });
8118
- }));
8119
- } catch (e) {
8120
- return Promise.reject(e);
8759
+ const fetchPromises = surveyors.map(s => Digit.EkycService.application_list({
8760
+ tenantId: tenantId || "dl.djb",
8761
+ offset: 0,
8762
+ limit: 5000,
8763
+ surveyorId: s.surveyorId || s.id,
8764
+ reportDownload: true
8765
+ }).catch(err => {
8766
+ console.error("Error fetching applications for surveyor " + s.surveyorName + ":", err);
8767
+ return {
8768
+ consumerList: []
8769
+ };
8770
+ }));
8771
+ return Promise.resolve(Promise.all(fetchPromises)).then(function (results) {
8772
+ const consumerList = results.flatMap(res => (res === null || res === void 0 ? void 0 : res.consumerList) || []);
8773
+ if (consumerList.length === 0) {
8774
+ alert(t("NO_DATA_FOUND") || "No data found for download.");
8775
+ return;
8121
8776
  }
8122
- }))).then(function (rowsWithStats) {
8123
- var _supervisor$owner5;
8124
- return Promise.resolve(Digit.EkycService.dashboard({}, {
8125
- tenantId: "dl.djb",
8126
- offset: 0,
8127
- limit: 1,
8128
- supervisorId: supervisor === null || supervisor === void 0 ? void 0 : (_supervisor$owner5 = supervisor.owner) === null || _supervisor$owner5 === void 0 ? void 0 : _supervisor$owner5.uuid,
8129
- fromDate: from.getTime(),
8130
- toDate: to.getTime()
8131
- })).then(function (overallResponse) {
8132
- downloadSupervisorPDF({
8133
- rows: rowsWithStats,
8134
- supervisorName: fullName,
8135
- mobileNumber,
8136
- vendorName,
8137
- dashboardInfo: (overallResponse === null || overallResponse === void 0 ? void 0 : overallResponse.dashboardInfo) || {},
8138
- t
8777
+ const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
8778
+ const headerMapping = {
8779
+ kno: t("KNO") || "KNO",
8780
+ firstName: t("FIRST_NAME") || "First Name",
8781
+ middleName: t("MIDDLE_NAME") || "Middle Name",
8782
+ lastName: t("LAST_NAME") || "Last Name",
8783
+ gender: t("GENDER") || "Gender",
8784
+ mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
8785
+ emailId: t("EMAIL_ID") || "Email ID",
8786
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
8787
+ relationship: t("RELATIONSHIP") || "Relationship",
8788
+ dob: t("DOB") || "Date of Birth",
8789
+ ekycStatus: t("EKYC_STATUS") || "eKYC Status",
8790
+ zoneName: t("ZONE") || "Zone",
8791
+ assembly: t("ASSEMBLY") || "Assembly",
8792
+ ward: t("WARD") || "Ward",
8793
+ pincode: t("PINCODE") || "Pincode",
8794
+ mrkey: t("MR_KEY") || "MR Key",
8795
+ createdTime: t("CREATED_TIME") || "Created Time",
8796
+ lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
8797
+ };
8798
+ const excelData = consumerList.map(item => {
8799
+ const cleanObj = {};
8800
+ const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
8801
+ if (fullName) {
8802
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
8803
+ }
8804
+ Object.keys(item).forEach(key => {
8805
+ if (excludedKeys.includes(key)) return;
8806
+ const val = item[key];
8807
+ if (typeof val === "object" && val !== null) {
8808
+ return;
8809
+ }
8810
+ const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
8811
+ cleanObj[friendlyHeader] = val;
8139
8812
  });
8813
+ return cleanObj;
8140
8814
  });
8815
+ const cleanFileName = "eKYC_Data_Supervisor_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
8816
+ Digit.Download.Excel(excelData, cleanFileName);
8141
8817
  });
8142
- }, function (err) {
8143
- console.error("Failed to fetch custom dashboard data for report download:", err);
8818
+ }, function (error) {
8819
+ console.error("Error downloading eKYC Excel:", error);
8144
8820
  });
8145
- }, function (_wasThrown2, _result2) {
8146
- setReportLoading(false);
8147
- setShowReportMenu(false);
8148
- setShowCustomPicker(false);
8149
- if (_wasThrown2) throw _result2;
8150
- return _result2;
8151
- });
8152
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
8821
+ }, function (_wasThrown, _result) {
8822
+ setEkycDownloadLoading(false);
8823
+ if (_wasThrown) throw _result;
8824
+ return _result;
8825
+ }));
8153
8826
  } catch (e) {
8154
8827
  return Promise.reject(e);
8155
8828
  }
8156
8829
  };
8157
- const StatCard = _ref8 => {
8158
- let title = _ref8.title,
8159
- value = _ref8.value,
8160
- type = _ref8.type,
8161
- color = _ref8.color,
8162
- isLoading = _ref8.isLoading;
8163
- return /*#__PURE__*/React__default.createElement("div", {
8164
- className: "stat-card " + type,
8165
- style: color ? {
8166
- borderLeft: "5px solid " + color
8167
- } : {}
8168
- }, isLoading ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8169
- className: "stat-title skeleton skeleton-text"
8170
- }), /*#__PURE__*/React__default.createElement("div", {
8171
- className: "stat-value skeleton skeleton-number"
8172
- })) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8173
- className: "stat-title"
8174
- }, title), /*#__PURE__*/React__default.createElement("div", {
8175
- className: "stat-value",
8176
- style: color ? {
8177
- color
8178
- } : {}
8179
- }, value)));
8180
- };
8181
- if (isSupervisorSearchLoading) {
8830
+ if (isProgressLoading) {
8182
8831
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
8183
8832
  }
8184
8833
  if (!supervisor) {
@@ -8223,13 +8872,13 @@ const SupervisorDetailsCard = () => {
8223
8872
  }, {
8224
8873
  label: t("THIS_MONTH") || "This Month",
8225
8874
  key: "month"
8226
- }].map(_ref9 => {
8227
- let label = _ref9.label,
8228
- key = _ref9.key;
8875
+ }].map(_ref3 => {
8876
+ let label = _ref3.label,
8877
+ key = _ref3.key;
8229
8878
  return /*#__PURE__*/React__default.createElement("div", {
8230
8879
  key: key,
8231
8880
  className: "menu-item",
8232
- onClick: () => handlePresetDownload(key)
8881
+ onClick: () => handlePresetDownload()
8233
8882
  }, label);
8234
8883
  }), /*#__PURE__*/React__default.createElement("div", {
8235
8884
  className: "custom-date-trigger",
@@ -8262,55 +8911,76 @@ const SupervisorDetailsCard = () => {
8262
8911
  className: "download-action-btn",
8263
8912
  onClick: handleCustomDownload
8264
8913
  }, t("DOWNLOAD") || "Download"))))), /*#__PURE__*/React__default.createElement("div", {
8265
- className: "stats-wrapper"
8266
- }, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
8267
- key: idx,
8268
- title: t(card.label),
8269
- value: card.count,
8270
- type: card.type,
8271
- color: card.color,
8272
- isLoading: isProgressLoading
8273
- }))), /*#__PURE__*/React__default.createElement("div", {
8274
8914
  className: "ekyc-dashboard-section"
8915
+ }, /*#__PURE__*/React__default.createElement("div", {
8916
+ className: "ekyc-details-wrapper"
8917
+ }, /*#__PURE__*/React__default.createElement("div", {
8918
+ className: "details-left"
8275
8919
  }, /*#__PURE__*/React__default.createElement("div", {
8276
8920
  className: "details-grid"
8277
8921
  }, /*#__PURE__*/React__default.createElement("div", {
8278
8922
  className: "detail-item"
8279
8923
  }, /*#__PURE__*/React__default.createElement("span", {
8280
8924
  className: "label"
8281
- }, t("MOBILE"), ":"), /*#__PURE__*/React__default.createElement("span", {
8925
+ }, t("MOBILE")), /*#__PURE__*/React__default.createElement("span", {
8282
8926
  className: "value"
8283
- }, (supervisor === null || supervisor === void 0 ? void 0 : (_supervisor$owner6 = supervisor.owner) === null || _supervisor$owner6 === void 0 ? void 0 : _supervisor$owner6.mobileNumber) || (supervisor === null || supervisor === void 0 ? void 0 : supervisor.mobileNo) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
8927
+ }, mobileNumber)), /*#__PURE__*/React__default.createElement("div", {
8284
8928
  className: "detail-item"
8285
8929
  }, /*#__PURE__*/React__default.createElement("span", {
8286
8930
  className: "label"
8287
- }, t("EMAIL"), ":"), /*#__PURE__*/React__default.createElement("span", {
8931
+ }, t("EMAIL")), /*#__PURE__*/React__default.createElement("span", {
8288
8932
  className: "value"
8289
- }, (supervisor === null || supervisor === void 0 ? void 0 : (_supervisor$owner7 = supervisor.owner) === null || _supervisor$owner7 === void 0 ? void 0 : _supervisor$owner7.emailId) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
8933
+ }, email)), /*#__PURE__*/React__default.createElement("div", {
8290
8934
  className: "detail-item"
8291
8935
  }, /*#__PURE__*/React__default.createElement("span", {
8292
8936
  className: "label"
8293
- }, t("GENDER"), ":"), /*#__PURE__*/React__default.createElement("span", {
8937
+ }, t("GENDER")), /*#__PURE__*/React__default.createElement("span", {
8294
8938
  className: "value"
8295
- }, (supervisor === null || supervisor === void 0 ? void 0 : (_supervisor$owner8 = supervisor.owner) === null || _supervisor$owner8 === void 0 ? void 0 : _supervisor$owner8.gender) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
8939
+ }, gender)), /*#__PURE__*/React__default.createElement("div", {
8296
8940
  className: "detail-item"
8297
8941
  }, /*#__PURE__*/React__default.createElement("span", {
8298
8942
  className: "label"
8299
- }, t("STATUS"), ":"), /*#__PURE__*/React__default.createElement("span", {
8943
+ }, t("STATUS")), /*#__PURE__*/React__default.createElement("span", {
8300
8944
  className: "value"
8301
- }, (supervisor === null || supervisor === void 0 ? void 0 : supervisor.status) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
8945
+ }, status)), /*#__PURE__*/React__default.createElement("div", {
8302
8946
  className: "detail-item"
8303
8947
  }, /*#__PURE__*/React__default.createElement("span", {
8304
8948
  className: "label"
8305
- }, t("SERVICE_TYPE"), ":"), /*#__PURE__*/React__default.createElement("span", {
8949
+ }, t("ASSIGNED_ZONE") || "Assigned Zone"), /*#__PURE__*/React__default.createElement("span", {
8306
8950
  className: "value"
8307
- }, (supervisor === null || supervisor === void 0 ? void 0 : (_supervisor$additiona = supervisor.additionalDetails) === null || _supervisor$additiona === void 0 ? void 0 : _supervisor$additiona.serviceType) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
8951
+ }, assignedZone)), /*#__PURE__*/React__default.createElement("div", {
8308
8952
  className: "detail-item"
8309
8953
  }, /*#__PURE__*/React__default.createElement("span", {
8310
8954
  className: "label"
8311
- }, t("VENDOR_NAME") || "Vendor Name", ":"), /*#__PURE__*/React__default.createElement("span", {
8955
+ }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React__default.createElement("span", {
8312
8956
  className: "value"
8313
- }, vendorName)))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
8957
+ }, vendorName)))), /*#__PURE__*/React__default.createElement("div", {
8958
+ className: "details-right"
8959
+ }, /*#__PURE__*/React__default.createElement("div", {
8960
+ className: "download-card"
8961
+ }, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format."), /*#__PURE__*/React__default.createElement("button", {
8962
+ className: "download-excel-btn",
8963
+ disabled: ekycDownloadLoading,
8964
+ onClick: handleDownloadEkycData
8965
+ }, /*#__PURE__*/React__default.createElement("svg", {
8966
+ width: "16",
8967
+ height: "16",
8968
+ viewBox: "0 0 24 24",
8969
+ fill: "none",
8970
+ stroke: "currentColor",
8971
+ strokeWidth: "2.5",
8972
+ strokeLinecap: "round",
8973
+ strokeLinejoin: "round"
8974
+ }, /*#__PURE__*/React__default.createElement("path", {
8975
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
8976
+ }), /*#__PURE__*/React__default.createElement("polyline", {
8977
+ points: "7 10 12 15 17 10"
8978
+ }), /*#__PURE__*/React__default.createElement("line", {
8979
+ x1: "12",
8980
+ y1: "15",
8981
+ x2: "12",
8982
+ y2: "3"
8983
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
8314
8984
  className: "dashboard-card"
8315
8985
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
8316
8986
  t: t,
@@ -8318,7 +8988,7 @@ const SupervisorDetailsCard = () => {
8318
8988
  tableClass: "ekycTable",
8319
8989
  data: paginatedSurveyors,
8320
8990
  columns: surveyorColumns,
8321
- isLoading: isSurveyorsLoading,
8991
+ isLoading: isProgressLoading,
8322
8992
  totalRecords: surveyors.length,
8323
8993
  currentPage: currentPage,
8324
8994
  pageSizeLimit: pageSize,
@@ -8665,6 +9335,10 @@ const CitizenApp = () => {
8665
9335
  crumbs.push({
8666
9336
  label: t("EKYC_SURVEYOR_DASHBOARD")
8667
9337
  });
9338
+ } else if (pathname.includes("/vendor-dashboard")) {
9339
+ crumbs.push({
9340
+ label: t("EKYC_VENDOR_DASHBOARD") || "Vendor Dashboard"
9341
+ });
8668
9342
  } else if (pathname.includes("/dashboard")) {
8669
9343
  crumbs.push({
8670
9344
  label: t("EKYC_DASHBOARD")
@@ -8719,10 +9393,10 @@ const CitizenApp = () => {
8719
9393
  layoutClass: "normal"
8720
9394
  }, /*#__PURE__*/React__default.createElement(Home, null))
8721
9395
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
8722
- path: path + "/dashboard",
9396
+ path: [path + "/vendor-dashboard/:vendorId", path + "/vendor-dashboard", path + "/dashboard"],
8723
9397
  component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
8724
9398
  layoutClass: "normal"
8725
- }, /*#__PURE__*/React__default.createElement(VendorDetails, null))
9399
+ }, /*#__PURE__*/React__default.createElement(VendorDetailsCard, null))
8726
9400
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
8727
9401
  path: path + "/inbox",
8728
9402
  component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {