@djb25/digit-ui-module-ekyc 1.0.34 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import React, { useRef, useEffect, useMemo, useState, createContext, isValidElement, cloneElement, createElement, useContext, useCallback, useReducer, Fragment } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { useHistory, Link, useLocation, useParams, useRouteMatch, Switch, Route, Redirect } from 'react-router-dom';
4
- import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, CustomTooltip, CardLabelError, InboxComposer, EditIcon, DeleteIcon, CardHeader, CardText, LabelFieldPair, CardLabel, ActionBar, Modal, Toast, RadioButtons, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, Menu, LinkButton, UploadFile, FormComposer, VerticalTimeline, Close, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, ModuleLinksView, CitizenHomeCard, DocumentIcon } from '@djb25/digit-ui-react-components';
4
+ import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, CustomTooltip, CardLabelError, InboxComposer, EditIcon, DeleteIcon, CardHeader, CardText, LabelFieldPair, CardLabel, ActionBar, Modal, Toast, RadioButtons, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, Menu, LinkButton, UploadFile, FormComposer, VerticalTimeline, Close, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, CitizenHomeCard, DocumentIcon, BackButton } from '@djb25/digit-ui-react-components';
5
5
  import * as Chartjs from 'chart.js/auto';
6
6
  import Chartjs__default, { Chart } from 'chart.js/auto';
7
7
  import { FaUsers, FaCheckCircle, FaClock, FaExclamationTriangle, FaUserTie, FaChartLine, FaSearch, FaArrowRight, FaMapMarkedAlt, FaArrowLeft } from 'react-icons/fa';
@@ -294,12 +294,7 @@ const DesktopInbox = _ref => {
294
294
  let row = _ref2.row;
295
295
  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";
296
296
  return /*#__PURE__*/React.createElement("span", {
297
- className: "ekyc-application-link",
298
- style: {
299
- color: "#add8f7",
300
- cursor: "pointer",
301
- fontWeight: "bold"
302
- },
297
+ className: "link",
303
298
  onClick: () => handleReview(kno)
304
299
  }, kno);
305
300
  }
@@ -341,12 +336,7 @@ const DesktopInbox = _ref => {
341
336
  let row = _ref6.row;
342
337
  const kno = ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.kno) || ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.applicationNumber) || "NA";
343
338
  return /*#__PURE__*/React.createElement("span", {
344
- className: "ekyc-application-link",
345
- style: {
346
- color: "#add8f7",
347
- cursor: "pointer",
348
- fontWeight: "bold"
349
- },
339
+ className: "link",
350
340
  onClick: () => handleReview(kno)
351
341
  }, t("EKYC_REVIEW"));
352
342
  }
@@ -1795,7 +1785,7 @@ const useInboxTableConfig = _ref => {
1795
1785
  let row = _ref2.row;
1796
1786
  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";
1797
1787
  return /*#__PURE__*/React.createElement("span", {
1798
- className: "ekyc-application-link",
1788
+ className: "link",
1799
1789
  onClick: () => handleReview(kno)
1800
1790
  }, kno);
1801
1791
  }
@@ -1829,23 +1819,6 @@ const useInboxTableConfig = _ref => {
1829
1819
  className: "ekyc-status-tag " + ekycStatus
1830
1820
  }, t("" + ekycStatus));
1831
1821
  }
1832
- }, {
1833
- Header: t("EKYC_REVIEW"),
1834
- accessor: "review",
1835
- Cell: _ref6 => {
1836
- var _row$original7, _row$original8;
1837
- let row = _ref6.row;
1838
- const kno = ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.kno) || ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.applicationNumber) || "NA";
1839
- return /*#__PURE__*/React.createElement("span", {
1840
- className: "ekyc-application-link",
1841
- style: {
1842
- color: "#add8f7",
1843
- cursor: "pointer",
1844
- fontWeight: "bold"
1845
- },
1846
- onClick: () => handleReview(kno)
1847
- }, t("EKYC_REVIEW"));
1848
- }
1849
1822
  }];
1850
1823
  return {
1851
1824
  disableSort: false,
@@ -1899,263 +1872,260 @@ const useInboxTableConfig = _ref => {
1899
1872
  };
1900
1873
  };
1901
1874
 
1902
- var isNullOrUndefined = (value) => value == null;
1903
-
1904
- const isObjectType = (value) => typeof value === 'object';
1905
- var isObject = (value) => !isNullOrUndefined(value) &&
1906
- !Array.isArray(value) &&
1907
- isObjectType(value) &&
1908
- !(value instanceof Date);
1909
-
1910
- var isKey = (value) => /^\w*$/.test(value);
1911
-
1912
- var compact = (value) => value.filter(Boolean);
1913
-
1914
- var stringToPath = (input) => compact(input
1915
- .replace(/["|']/g, '')
1916
- .replace(/\[/g, '.')
1917
- .replace(/\]/g, '')
1918
- .split('.'));
1919
-
1920
- function set(object, path, value) {
1921
- let index = -1;
1922
- const tempPath = isKey(path) ? [path] : stringToPath(path);
1923
- const length = tempPath.length;
1924
- const lastIndex = length - 1;
1925
- while (++index < length) {
1926
- const key = tempPath[index];
1927
- let newValue = value;
1928
- if (index !== lastIndex) {
1929
- const objValue = object[key];
1930
- newValue =
1931
- isObject(objValue) || Array.isArray(objValue)
1932
- ? objValue
1933
- : !isNaN(+tempPath[index + 1])
1934
- ? []
1935
- : {};
1936
- }
1937
- object[key] = newValue;
1938
- object = object[key];
1939
- }
1940
- return object;
1875
+ const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
1876
+ const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
1877
+ function _catch(body, recover) {
1878
+ try {
1879
+ var result = body();
1880
+ } catch (e) {
1881
+ return recover(e);
1882
+ }
1883
+ if (result && result.then) {
1884
+ return result.then(void 0, recover);
1885
+ }
1886
+ return result;
1887
+ }
1888
+ function _finallyRethrows(body, finalizer) {
1889
+ try {
1890
+ var result = body();
1891
+ } catch (e) {
1892
+ return finalizer(true, e);
1893
+ }
1894
+ if (result && result.then) {
1895
+ return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
1896
+ }
1897
+ return finalizer(false, result);
1941
1898
  }
1942
1899
 
1943
- var isUndefined = (val) => val === undefined;
1944
-
1945
- var get = (obj = {}, path, defaultValue) => {
1946
- const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => (isNullOrUndefined(result) ? result : result[key]), obj);
1947
- return isUndefined(result) || result === obj
1948
- ? isUndefined(obj[path])
1949
- ? defaultValue
1950
- : obj[path]
1951
- : result;
1900
+ var isNullOrUndefined = value => value == null;
1901
+ const isObjectType = value => typeof value === 'object';
1902
+ var isObject = value => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !(value instanceof Date);
1903
+ var isKey = value => /^\w*$/.test(value);
1904
+ var compact = value => value.filter(Boolean);
1905
+ var stringToPath = input => compact(input.replace(/["|']/g, '').replace(/\[/g, '.').replace(/\]/g, '').split('.'));
1906
+ function set(object, path, value) {
1907
+ let index = -1;
1908
+ const tempPath = isKey(path) ? [path] : stringToPath(path);
1909
+ const length = tempPath.length;
1910
+ const lastIndex = length - 1;
1911
+ while (++index < length) {
1912
+ const key = tempPath[index];
1913
+ let newValue = value;
1914
+ if (index !== lastIndex) {
1915
+ const objValue = object[key];
1916
+ newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
1917
+ }
1918
+ object[key] = newValue;
1919
+ object = object[key];
1920
+ }
1921
+ return object;
1922
+ }
1923
+ var isUndefined = val => val === undefined;
1924
+ var get = function (obj, path, defaultValue) {
1925
+ if (obj === void 0) {
1926
+ obj = {};
1927
+ }
1928
+ const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
1929
+ return isUndefined(result) || result === obj ? isUndefined(obj[path]) ? defaultValue : obj[path] : result;
1952
1930
  };
1953
-
1954
- var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
1955
-
1956
- var isFunction = (value) => typeof value === 'function';
1957
-
1958
- var skipValidation = ({ isOnBlur, isOnChange, isOnTouch, isTouched, isReValidateOnBlur, isReValidateOnChange, isBlurEvent, isSubmitted, isOnAll, }) => {
1959
- if (isOnAll) {
1960
- return false;
1961
- }
1962
- else if (!isSubmitted && isOnTouch) {
1963
- return !(isTouched || isBlurEvent);
1964
- }
1965
- else if (isSubmitted ? isReValidateOnBlur : isOnBlur) {
1966
- return !isBlurEvent;
1967
- }
1968
- else if (isSubmitted ? isReValidateOnChange : isOnChange) {
1969
- return isBlurEvent;
1970
- }
1971
- return true;
1931
+ var isPrimitive = value => isNullOrUndefined(value) || !isObjectType(value);
1932
+ var isFunction = value => typeof value === 'function';
1933
+ var skipValidation = _ref9 => {
1934
+ let isOnBlur = _ref9.isOnBlur,
1935
+ isOnChange = _ref9.isOnChange,
1936
+ isOnTouch = _ref9.isOnTouch,
1937
+ isTouched = _ref9.isTouched,
1938
+ isReValidateOnBlur = _ref9.isReValidateOnBlur,
1939
+ isReValidateOnChange = _ref9.isReValidateOnChange,
1940
+ isBlurEvent = _ref9.isBlurEvent,
1941
+ isSubmitted = _ref9.isSubmitted,
1942
+ isOnAll = _ref9.isOnAll;
1943
+ if (isOnAll) {
1944
+ return false;
1945
+ } else if (!isSubmitted && isOnTouch) {
1946
+ return !(isTouched || isBlurEvent);
1947
+ } else if (isSubmitted ? isReValidateOnBlur : isOnBlur) {
1948
+ return !isBlurEvent;
1949
+ } else if (isSubmitted ? isReValidateOnChange : isOnChange) {
1950
+ return isBlurEvent;
1951
+ }
1952
+ return true;
1972
1953
  };
1973
-
1974
- const isMatchFieldArrayName = (name, searchName) => RegExp(`^${searchName}([|.)\\d+`.replace(/\[/g, '\\[').replace(/\]/g, '\\]')).test(name);
1975
- var isNameInFieldArray = (names, name) => [...names].some((current) => isMatchFieldArrayName(name, current));
1976
-
1977
- /*! *****************************************************************************
1978
- Copyright (c) Microsoft Corporation.
1979
-
1980
- Permission to use, copy, modify, and/or distribute this software for any
1981
- purpose with or without fee is hereby granted.
1982
-
1983
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1984
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1985
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1986
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1987
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1988
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1989
- PERFORMANCE OF THIS SOFTWARE.
1990
- ***************************************************************************** */
1991
-
1992
- function __rest(s, e) {
1993
- var t = {};
1994
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1995
- t[p] = s[p];
1996
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1997
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1998
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1999
- t[p[i]] = s[p[i]];
2000
- }
2001
- return t;
1954
+ const isMatchFieldArrayName = (name, searchName) => RegExp(("^" + searchName + "([|.)\\d+").replace(/\[/g, '\\[').replace(/\]/g, '\\]')).test(name);
1955
+ var isNameInFieldArray = (names, name) => [...names].some(current => isMatchFieldArrayName(name, current));
1956
+ function __rest(s, e) {
1957
+ var t = {};
1958
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1959
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1960
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1961
+ }
1962
+ return t;
2002
1963
  }
2003
-
2004
- const FormContext = createContext(null);
2005
- FormContext.displayName = 'RHFContext';
2006
- const useFormContext = () => useContext(FormContext);
2007
-
2008
- var getInputValue = (event) => isPrimitive(event) ||
2009
- !isObject(event.target) ||
2010
- (isObject(event.target) && !event.type)
2011
- ? event
2012
- : isUndefined(event.target.value)
2013
- ? event.target.checked
2014
- : event.target.value;
2015
-
2016
- function useController({ name, rules, defaultValue, control, onFocus, }) {
2017
- const methods = useFormContext();
2018
- if (process.env.NODE_ENV !== 'production') {
2019
- if (!control && !methods) {
2020
- throw new Error('📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller');
2021
- }
2022
- }
2023
- const { defaultValuesRef, setValue, register, unregister, trigger, mode, reValidateMode: { isReValidateOnBlur, isReValidateOnChange }, formState, formStateRef: { current: { isSubmitted, touched, errors }, }, updateFormState, readFormStateRef, fieldsRef, fieldArrayNamesRef, shallowFieldsStateRef, } = control || methods.control;
2024
- const isNotFieldArray = !isNameInFieldArray(fieldArrayNamesRef.current, name);
2025
- const getInitialValue = () => !isUndefined(get(shallowFieldsStateRef.current, name)) && isNotFieldArray
2026
- ? get(shallowFieldsStateRef.current, name)
2027
- : isUndefined(defaultValue)
2028
- ? get(defaultValuesRef.current, name)
2029
- : defaultValue;
2030
- const [value, setInputStateValue] = useState(getInitialValue());
2031
- const valueRef = useRef(value);
2032
- const ref = useRef({
2033
- focus: () => null,
2034
- });
2035
- const onFocusRef = useRef(onFocus ||
2036
- (() => {
2037
- if (isFunction(ref.current.focus)) {
2038
- ref.current.focus();
2039
- }
2040
- if (process.env.NODE_ENV !== 'production') {
2041
- if (!isFunction(ref.current.focus)) {
2042
- console.warn(`📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method`);
2043
- }
2044
- }
2045
- }));
2046
- const shouldValidate = useCallback((isBlurEvent) => !skipValidation(Object.assign({ isBlurEvent,
2047
- isReValidateOnBlur,
2048
- isReValidateOnChange,
2049
- isSubmitted, isTouched: !!get(touched, name) }, mode)), [
2050
- isReValidateOnBlur,
2051
- isReValidateOnChange,
2052
- isSubmitted,
2053
- touched,
2054
- name,
2055
- mode,
2056
- ]);
2057
- const commonTask = useCallback(([event]) => {
2058
- const data = getInputValue(event);
2059
- setInputStateValue(data);
2060
- valueRef.current = data;
2061
- return data;
2062
- }, []);
2063
- const registerField = useCallback((shouldUpdateValue) => {
2064
- if (process.env.NODE_ENV !== 'production') {
2065
- if (!name) {
2066
- return console.warn('📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller');
2067
- }
2068
- }
2069
- if (fieldsRef.current[name]) {
2070
- fieldsRef.current[name] = Object.assign({ ref: fieldsRef.current[name].ref }, rules);
2071
- }
2072
- else {
2073
- register(Object.defineProperties({
2074
- name,
2075
- focus: onFocusRef.current,
2076
- }, {
2077
- value: {
2078
- set(data) {
2079
- setInputStateValue(data);
2080
- valueRef.current = data;
2081
- },
2082
- get() {
2083
- return valueRef.current;
2084
- },
2085
- },
2086
- }), rules);
2087
- shouldUpdateValue = isUndefined(get(defaultValuesRef.current, name));
2088
- }
2089
- shouldUpdateValue &&
2090
- isNotFieldArray &&
2091
- setInputStateValue(getInitialValue());
2092
- }, [rules, name, register]);
2093
- useEffect(() => () => unregister(name), [name]);
2094
- useEffect(() => {
2095
- if (process.env.NODE_ENV !== 'production') {
2096
- if (isUndefined(value)) {
2097
- console.warn(`📋 ${name} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`);
2098
- }
2099
- if (!isNotFieldArray && isUndefined(defaultValue)) {
2100
- console.warn('📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller');
2101
- }
2102
- }
2103
- registerField();
2104
- }, [registerField]);
2105
- useEffect(() => {
2106
- !fieldsRef.current[name] && registerField(true);
2107
- });
2108
- const onBlur = useCallback(() => {
2109
- if (readFormStateRef.current.touched && !get(touched, name)) {
2110
- set(touched, name, true);
2111
- updateFormState({
2112
- touched,
2113
- });
2114
- }
2115
- shouldValidate(true) && trigger(name);
2116
- }, [name, updateFormState, shouldValidate, trigger, readFormStateRef]);
2117
- const onChange = useCallback((...event) => setValue(name, commonTask(event), {
2118
- shouldValidate: shouldValidate(),
2119
- shouldDirty: true,
2120
- }), [setValue, name, shouldValidate]);
2121
- return {
2122
- field: {
2123
- onChange,
2124
- onBlur,
2125
- name,
2126
- value,
2127
- ref,
2128
- },
2129
- meta: Object.defineProperties({
2130
- invalid: !!get(errors, name),
2131
- }, {
2132
- isDirty: {
2133
- get() {
2134
- return !!get(formState.dirtyFields, name);
2135
- },
2136
- },
2137
- isTouched: {
2138
- get() {
2139
- return !!get(formState.touched, name);
2140
- },
2141
- },
2142
- }),
2143
- };
1964
+ const FormContext = createContext(null);
1965
+ FormContext.displayName = 'RHFContext';
1966
+ const useFormContext = () => useContext(FormContext);
1967
+ var getInputValue = event => isPrimitive(event) || !isObject(event.target) || isObject(event.target) && !event.type ? event : isUndefined(event.target.value) ? event.target.checked : event.target.value;
1968
+ function useController(_ref20) {
1969
+ let name = _ref20.name,
1970
+ rules = _ref20.rules,
1971
+ defaultValue = _ref20.defaultValue,
1972
+ control = _ref20.control,
1973
+ onFocus = _ref20.onFocus;
1974
+ const methods = useFormContext();
1975
+ if (process.env.NODE_ENV !== 'production') {
1976
+ if (!control && !methods) {
1977
+ throw new Error('📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller');
1978
+ }
1979
+ }
1980
+ const _ref21 = control || methods.control,
1981
+ defaultValuesRef = _ref21.defaultValuesRef,
1982
+ setValue = _ref21.setValue,
1983
+ register = _ref21.register,
1984
+ unregister = _ref21.unregister,
1985
+ trigger = _ref21.trigger,
1986
+ mode = _ref21.mode,
1987
+ _ref21$reValidateMode = _ref21.reValidateMode,
1988
+ isReValidateOnBlur = _ref21$reValidateMode.isReValidateOnBlur,
1989
+ isReValidateOnChange = _ref21$reValidateMode.isReValidateOnChange,
1990
+ formState = _ref21.formState,
1991
+ _ref21$formStateRef$c = _ref21.formStateRef.current,
1992
+ isSubmitted = _ref21$formStateRef$c.isSubmitted,
1993
+ touched = _ref21$formStateRef$c.touched,
1994
+ errors = _ref21$formStateRef$c.errors,
1995
+ updateFormState = _ref21.updateFormState,
1996
+ readFormStateRef = _ref21.readFormStateRef,
1997
+ fieldsRef = _ref21.fieldsRef,
1998
+ fieldArrayNamesRef = _ref21.fieldArrayNamesRef,
1999
+ shallowFieldsStateRef = _ref21.shallowFieldsStateRef;
2000
+ const isNotFieldArray = !isNameInFieldArray(fieldArrayNamesRef.current, name);
2001
+ const getInitialValue = () => !isUndefined(get(shallowFieldsStateRef.current, name)) && isNotFieldArray ? get(shallowFieldsStateRef.current, name) : isUndefined(defaultValue) ? get(defaultValuesRef.current, name) : defaultValue;
2002
+ const _useState3 = useState(getInitialValue()),
2003
+ value = _useState3[0],
2004
+ setInputStateValue = _useState3[1];
2005
+ const valueRef = useRef(value);
2006
+ const ref = useRef({
2007
+ focus: () => null
2008
+ });
2009
+ const onFocusRef = useRef(onFocus || (() => {
2010
+ if (isFunction(ref.current.focus)) {
2011
+ ref.current.focus();
2012
+ }
2013
+ if (process.env.NODE_ENV !== 'production') {
2014
+ if (!isFunction(ref.current.focus)) {
2015
+ console.warn("\uD83D\uDCCB 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method");
2016
+ }
2017
+ }
2018
+ }));
2019
+ const shouldValidate = useCallback(isBlurEvent => !skipValidation(Object.assign({
2020
+ isBlurEvent,
2021
+ isReValidateOnBlur,
2022
+ isReValidateOnChange,
2023
+ isSubmitted,
2024
+ isTouched: !!get(touched, name)
2025
+ }, mode)), [isReValidateOnBlur, isReValidateOnChange, isSubmitted, touched, name, mode]);
2026
+ const commonTask = useCallback(_ref22 => {
2027
+ let event = _ref22[0];
2028
+ const data = getInputValue(event);
2029
+ setInputStateValue(data);
2030
+ valueRef.current = data;
2031
+ return data;
2032
+ }, []);
2033
+ const registerField = useCallback(shouldUpdateValue => {
2034
+ if (process.env.NODE_ENV !== 'production') {
2035
+ if (!name) {
2036
+ return console.warn('📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller');
2037
+ }
2038
+ }
2039
+ if (fieldsRef.current[name]) {
2040
+ fieldsRef.current[name] = Object.assign({
2041
+ ref: fieldsRef.current[name].ref
2042
+ }, rules);
2043
+ } else {
2044
+ register(Object.defineProperties({
2045
+ name,
2046
+ focus: onFocusRef.current
2047
+ }, {
2048
+ value: {
2049
+ set(data) {
2050
+ setInputStateValue(data);
2051
+ valueRef.current = data;
2052
+ },
2053
+ get() {
2054
+ return valueRef.current;
2055
+ }
2056
+ }
2057
+ }), rules);
2058
+ shouldUpdateValue = isUndefined(get(defaultValuesRef.current, name));
2059
+ }
2060
+ shouldUpdateValue && isNotFieldArray && setInputStateValue(getInitialValue());
2061
+ }, [rules, name, register]);
2062
+ useEffect(() => () => unregister(name), [name]);
2063
+ useEffect(() => {
2064
+ if (process.env.NODE_ENV !== 'production') {
2065
+ if (isUndefined(value)) {
2066
+ console.warn("\uD83D\uDCCB " + name + " is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)");
2067
+ }
2068
+ if (!isNotFieldArray && isUndefined(defaultValue)) {
2069
+ console.warn('📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller');
2070
+ }
2071
+ }
2072
+ registerField();
2073
+ }, [registerField]);
2074
+ useEffect(() => {
2075
+ !fieldsRef.current[name] && registerField(true);
2076
+ });
2077
+ const onBlur = useCallback(() => {
2078
+ if (readFormStateRef.current.touched && !get(touched, name)) {
2079
+ set(touched, name, true);
2080
+ updateFormState({
2081
+ touched
2082
+ });
2083
+ }
2084
+ shouldValidate(true) && trigger(name);
2085
+ }, [name, updateFormState, shouldValidate, trigger, readFormStateRef]);
2086
+ const onChange = useCallback(function () {
2087
+ for (var _len = arguments.length, event = new Array(_len), _key = 0; _key < _len; _key++) {
2088
+ event[_key] = arguments[_key];
2089
+ }
2090
+ return setValue(name, commonTask(event), {
2091
+ shouldValidate: shouldValidate(),
2092
+ shouldDirty: true
2093
+ });
2094
+ }, [setValue, name, shouldValidate]);
2095
+ return {
2096
+ field: {
2097
+ onChange,
2098
+ onBlur,
2099
+ name,
2100
+ value,
2101
+ ref
2102
+ },
2103
+ meta: Object.defineProperties({
2104
+ invalid: !!get(errors, name)
2105
+ }, {
2106
+ isDirty: {
2107
+ get() {
2108
+ return !!get(formState.dirtyFields, name);
2109
+ }
2110
+ },
2111
+ isTouched: {
2112
+ get() {
2113
+ return !!get(formState.touched, name);
2114
+ }
2115
+ }
2116
+ })
2117
+ };
2144
2118
  }
2145
-
2146
- const Controller = (props) => {
2147
- const { rules, as, render, defaultValue, control, onFocus } = props, rest = __rest(props, ["rules", "as", "render", "defaultValue", "control", "onFocus"]);
2148
- const { field, meta } = useController(props);
2149
- const componentProps = Object.assign(Object.assign({}, rest), field);
2150
- return as
2151
- ? isValidElement(as)
2152
- ? cloneElement(as, componentProps)
2153
- : createElement(as, componentProps)
2154
- : render
2155
- ? render(field, meta)
2156
- : null;
2119
+ const Controller = props => {
2120
+ const as = props.as,
2121
+ render = props.render,
2122
+ rest = __rest(props, ["rules", "as", "render", "defaultValue", "control", "onFocus"]);
2123
+ const _useController = useController(props),
2124
+ field = _useController.field,
2125
+ meta = _useController.meta;
2126
+ const componentProps = Object.assign(Object.assign({}, rest), field);
2127
+ return as ? isValidElement(as) ? cloneElement(as, componentProps) : createElement(as, componentProps) : render ? render(field, meta) : null;
2157
2128
  };
2158
- //# sourceMappingURL=index.esm.js.map
2159
2129
 
2160
2130
  const SearchFormFieldsComponents = _ref => {
2161
2131
  let searchFormState = _ref.searchFormState,
@@ -2366,28 +2336,24 @@ const Inbox = _ref => {
2366
2336
  onSearchFormReset,
2367
2337
  className: "search-form-wns-inbox"
2368
2338
  };
2369
- const FilterFormFields = useCallback(_ref3 => {
2370
- return /*#__PURE__*/React.createElement(React.Fragment, null);
2371
- }, []);
2372
2339
  function formReducer(state, payload) {
2373
- const storageKey = payload.checkPathName ? "EKYC.INBOX" : "EKYC.SW.INBOX";
2374
2340
  switch (payload.action) {
2375
2341
  case "mutateSearchForm":
2376
- Digit.SessionStorage.set(storageKey, _extends({}, state, {
2342
+ Digit.SessionStorage.set("EKYC.INBOX", _extends({}, state, {
2377
2343
  searchForm: payload.data
2378
2344
  }));
2379
2345
  return _extends({}, state, {
2380
2346
  searchForm: payload.data
2381
2347
  });
2382
2348
  case "mutateFilterForm":
2383
- Digit.SessionStorage.set(storageKey, _extends({}, state, {
2349
+ Digit.SessionStorage.set("EKYC.INBOX", _extends({}, state, {
2384
2350
  filterForm: payload.data
2385
2351
  }));
2386
2352
  return _extends({}, state, {
2387
2353
  filterForm: payload.data
2388
2354
  });
2389
2355
  case "mutateTableForm":
2390
- Digit.SessionStorage.set(storageKey, _extends({}, state, {
2356
+ Digit.SessionStorage.set("EKYC.INBOX", _extends({}, state, {
2391
2357
  tableForm: payload.data
2392
2358
  }));
2393
2359
  return _extends({}, state, {
@@ -3190,38 +3156,6 @@ const Create = () => {
3190
3156
  }));
3191
3157
  };
3192
3158
 
3193
- // A type of promise-like that resolves synchronously and supports only one observer
3194
-
3195
- const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
3196
-
3197
- const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
3198
-
3199
- // Asynchronously call a function and send errors to recovery continuation
3200
- function _catch(body, recover) {
3201
- try {
3202
- var result = body();
3203
- } catch(e) {
3204
- return recover(e);
3205
- }
3206
- if (result && result.then) {
3207
- return result.then(void 0, recover);
3208
- }
3209
- return result;
3210
- }
3211
-
3212
- // Asynchronously await a promise and pass the result to a finally continuation
3213
- function _finallyRethrows(body, finalizer) {
3214
- try {
3215
- var result = body();
3216
- } catch (e) {
3217
- return finalizer(true, e);
3218
- }
3219
- if (result && result.then) {
3220
- return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
3221
- }
3222
- return finalizer(false, result);
3223
- }
3224
-
3225
3159
  const ActionButton = _ref => {
3226
3160
  let jumpTo = _ref.jumpTo,
3227
3161
  state = _ref.state;
@@ -4996,42 +4930,41 @@ const AssignEkycModal = _ref => {
4996
4930
  }),
4997
4931
  applicationData = _Digit$Hooks$ekyc$use.data,
4998
4932
  isLoading = _Digit$Hooks$ekyc$use.isFetching;
4933
+ const handleAssignmentError = (errMsg, variables) => {
4934
+ const isAlreadyAssigned = errMsg.toLowerCase().includes("already assigned") || errMsg.toLowerCase().includes("already assign") || errMsg.toLowerCase().includes("active assignment") || errMsg.toLowerCase().includes("mrkey") || errMsg.toLowerCase().includes("mr key") || errMsg.toLowerCase().includes("kno") || errMsg.toLowerCase().includes("already exists");
4935
+ if (isAlreadyAssigned) {
4936
+ const isMrKeyType = (variables === null || variables === void 0 ? void 0 : variables.assignmentType) === "MRKEY";
4937
+ if (isMrKeyType) {
4938
+ setToastData({
4939
+ error: true,
4940
+ label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
4941
+ });
4942
+ } else {
4943
+ setToastData({
4944
+ error: true,
4945
+ label: t("EKYC_KNO_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "kno is already assign with another surveyor"
4946
+ });
4947
+ }
4948
+ } else {
4949
+ setToastData({
4950
+ error: true,
4951
+ label: t(errMsg) || errMsg || t("EKYC_SOMETHING_WENT_WRONG") || "Something went wrong"
4952
+ });
4953
+ }
4954
+ setShowToast(true);
4955
+ };
4999
4956
  const assignmentMutation = Digit.Hooks.ekyc.useEkycAssignmentCreate({
5000
- onSuccess: response => {
4957
+ onSuccess: (response, variables) => {
5001
4958
  if (response !== null && response !== void 0 && response.error) {
5002
4959
  var _response$data;
5003
4960
  const errMsg = (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.message) || "";
5004
- const isMrKeyAlreadyAssigned = errMsg.toLowerCase().includes("already assigned") || errMsg.toLowerCase().includes("already assign") || errMsg.toLowerCase().includes("mrkey") || errMsg.toLowerCase().includes("mr key");
5005
- if (isMrKeyAlreadyAssigned) {
5006
- setToastData({
5007
- error: true,
5008
- label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
5009
- });
5010
- } else {
5011
- setToastData({
5012
- error: true,
5013
- label: t(errMsg) || errMsg || t("EKYC_SOMETHING_WENT_WRONG") || "Something went wrong"
5014
- });
5015
- }
5016
- setShowToast(true);
4961
+ handleAssignmentError(errMsg, variables);
5017
4962
  return;
5018
4963
  }
5019
4964
  if (response !== null && response !== void 0 && response.skipped && response.skipped.length > 0) {
5020
4965
  var _response$skipped$;
5021
4966
  const reason = ((_response$skipped$ = response.skipped[0]) === null || _response$skipped$ === void 0 ? void 0 : _response$skipped$.reason) || "";
5022
- const isMrKeyAlreadyAssigned = reason.toLowerCase().includes("already exists") || reason.toLowerCase().includes("already assign") || reason.toLowerCase().includes("active assignment") || reason.toLowerCase().includes("mrkey") || reason.toLowerCase().includes("mr key");
5023
- if (isMrKeyAlreadyAssigned) {
5024
- setToastData({
5025
- error: true,
5026
- label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
5027
- });
5028
- } else {
5029
- setToastData({
5030
- error: true,
5031
- label: t(reason) || reason || t("EKYC_ASSIGNMENT_SKIPPED") || "Assignment skipped"
5032
- });
5033
- }
5034
- setShowToast(true);
4967
+ handleAssignmentError(reason, variables);
5035
4968
  return;
5036
4969
  }
5037
4970
  setToastData({
@@ -5049,22 +4982,10 @@ const AssignEkycModal = _ref => {
5049
4982
  }
5050
4983
  }, 1000);
5051
4984
  },
5052
- onError: error => {
4985
+ onError: (error, variables) => {
5053
4986
  var _error$data, _error$response, _error$response$data;
5054
4987
  const errMsg = (error === null || error === void 0 ? void 0 : (_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.message) || (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.message) || "";
5055
- const isMrKeyAlreadyAssigned = errMsg.toLowerCase().includes("already assigned") || errMsg.toLowerCase().includes("already assign") || errMsg.toLowerCase().includes("mrkey") || errMsg.toLowerCase().includes("mr key");
5056
- if (isMrKeyAlreadyAssigned) {
5057
- setToastData({
5058
- error: true,
5059
- label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
5060
- });
5061
- } else {
5062
- setToastData({
5063
- error: true,
5064
- label: t(errMsg) || errMsg || t("EKYC_SOMETHING_WENT_WRONG") || "Something went wrong"
5065
- });
5066
- }
5067
- setShowToast(true);
4988
+ handleAssignmentError(errMsg, variables);
5068
4989
  }
5069
4990
  });
5070
4991
  const tableData = (applicationData === null || applicationData === void 0 ? void 0 : applicationData.consumerList) || [];
@@ -6045,12 +5966,7 @@ const tableColumnConfig = (t, handleReview) => [{
6045
5966
  let row = _ref.row;
6046
5967
  const id = (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.id;
6047
5968
  return /*#__PURE__*/React.createElement("span", {
6048
- className: "ekyc-application-link",
6049
- style: {
6050
- color: "#318ED0",
6051
- cursor: "pointer",
6052
- fontSize: "16px"
6053
- },
5969
+ className: "link",
6054
5970
  onClick: () => handleReview(id)
6055
5971
  }, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.surveyorName) || ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.name) || "NA");
6056
5972
  }
@@ -7554,14 +7470,35 @@ const Home = () => {
7554
7470
  link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
7555
7471
  });
7556
7472
  }
7473
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
7474
+ propsForModuleCard.links.push({
7475
+ label: t("TITLE_VENDOR_MANAGEMENT"),
7476
+ link: "/digit-ui/citizen/vendor/search-vendor"
7477
+ });
7478
+ }
7557
7479
  if (roles.length === 1 && roles.includes("CITIZEN")) {
7558
7480
  propsForModuleCard.links.push({
7481
+ label: t("EKYC_CREATE_KYC"),
7482
+ link: "/digit-ui/citizen/ekyc/create-kyc"
7483
+ }, {
7484
+ label: t("EKYC_UPDATE_KYC"),
7485
+ link: "/digit-ui/citizen/ekyc/update-kyc"
7486
+ }, {
7559
7487
  label: t("EKYC_STATUS"),
7560
7488
  link: "/digit-ui/citizen/ekyc/:id"
7561
7489
  });
7562
7490
  }
7563
- return /*#__PURE__*/React.createElement(ModuleLinksView, {
7564
- links: propsForModuleCard.links
7491
+ const formattedLinks = propsForModuleCard.links.map(l => ({
7492
+ i18nKey: l.label,
7493
+ link: l.link,
7494
+ count: l.count
7495
+ }));
7496
+ return /*#__PURE__*/React.createElement(CitizenHomeCard, {
7497
+ header: t("EKYC_MODULE_NAME"),
7498
+ links: formattedLinks,
7499
+ Icon: () => /*#__PURE__*/React.createElement(DocumentIcon, {
7500
+ className: "fill-path-primary-main"
7501
+ })
7565
7502
  });
7566
7503
  };
7567
7504
 
@@ -8671,6 +8608,10 @@ const CitizenApp = () => {
8671
8608
  const location = useLocation();
8672
8609
  const _useRouteMatch = useRouteMatch(),
8673
8610
  path = _useRouteMatch.path;
8611
+ const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData(),
8612
+ _Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data,
8613
+ _Digit$Hooks$useStore3 = _Digit$Hooks$useStore2 === void 0 ? {} : _Digit$Hooks$useStore2,
8614
+ stateInfo = _Digit$Hooks$useStore3.stateInfo;
8674
8615
  sessionStorage.removeItem("revalidateddone");
8675
8616
  const getDynamicBreadcrumbs = () => {
8676
8617
  const pathname = location.pathname;
@@ -8745,6 +8686,29 @@ const CitizenApp = () => {
8745
8686
  }
8746
8687
  return crumbs;
8747
8688
  };
8689
+ const isEkycHome = location.pathname === "/digit-ui/citizen/ekyc" || location.pathname === "/digit-ui/citizen/ekyc/";
8690
+ if (isEkycHome) {
8691
+ const isMobile = window.Digit.Utils.browser.isMobile();
8692
+ return (
8693
+ /*#__PURE__*/
8694
+ React.createElement("div", {
8695
+ className: "moduleLinkHomePage"
8696
+ }, /*#__PURE__*/React.createElement("div", {
8697
+ style: {
8698
+ position: "relative"
8699
+ }
8700
+ }, /*#__PURE__*/React.createElement("img", {
8701
+ src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl,
8702
+ alt: "noimagefound"
8703
+ }), /*#__PURE__*/React.createElement(BackButton, {
8704
+ className: "moduleLinkHomePageBackButton"
8705
+ }), /*#__PURE__*/React.createElement("div", {
8706
+ className: "moduleTitle"
8707
+ }, isMobile ? /*#__PURE__*/React.createElement("h4", null, t("MODULE_EKYC")) : /*#__PURE__*/React.createElement("h1", null, t("MODULE_EKYC")))), /*#__PURE__*/React.createElement("div", {
8708
+ className: "moduleLinkHomePageModuleLinks"
8709
+ }, /*#__PURE__*/React.createElement(Home, null)))
8710
+ );
8711
+ }
8748
8712
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
8749
8713
  className: "ground-container form-container"
8750
8714
  }, /*#__PURE__*/React.createElement(ModuleHeader, {