@egovernments/digit-ui-module-core 1.4.0 → 1.5.0-alpha.3

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
@@ -26,9 +26,11 @@ var CitizenHome = function CitizenHome(_ref) {
26
26
  var showQuickPay = moduleArr.some(function (module) {
27
27
  return module.code === "QuickPayLinks";
28
28
  });
29
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
29
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.BackButton, null), /*#__PURE__*/React__default.createElement("div", {
30
30
  className: "citizenAllServiceGrid"
31
- }, moduleArray.map(function (_ref4, index) {
31
+ }, moduleArray.filter(function (mod) {
32
+ return mod;
33
+ }).map(function (_ref4, index) {
32
34
  var code = _ref4.code;
33
35
 
34
36
  var Links = Digit.ComponentRegistryService.getComponent(code + "Links") || function () {
@@ -320,7 +322,7 @@ var getFromLocation = function getFromLocation(state, searchParams) {
320
322
  };
321
323
 
322
324
  var Login = function Login(_ref) {
323
- var _location$state, _location$state6;
325
+ var _location$state, _location$state7;
324
326
 
325
327
  var stateCode = _ref.stateCode,
326
328
  _ref$isUserRegistered = _ref.isUserRegistered,
@@ -369,7 +371,6 @@ var Login = function Login(_ref) {
369
371
  }
370
372
 
371
373
  errorTimeout = setTimeout(function () {
372
- console.error("clearing err");
373
374
  setError("");
374
375
  }, 5000);
375
376
  setErrorTO(errorTimeout);
@@ -450,14 +451,18 @@ var Login = function Login(_ref) {
450
451
  });
451
452
  return;
452
453
  } else {
453
- history.push("/digit-ui/citizen/register/name", {
454
- from: getFromLocation(location.state, searchParams),
455
- data: data
456
- });
454
+ if (!(location.state && location.state.role === 'FSM_DSO')) {
455
+ history.push("/digit-ui/citizen/register/name", {
456
+ from: getFromLocation(location.state, searchParams),
457
+ data: data
458
+ });
459
+ }
457
460
  }
458
461
 
459
462
  if ((_location$state4 = location.state) !== null && _location$state4 !== void 0 && _location$state4.role) {
460
- setError("User not registered.");
463
+ var _location$state5;
464
+
465
+ setError(((_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.role) === "FSM_DSO" ? t("ES_ERROR_DSO_LOGIN") : "User not registered.");
461
466
  }
462
467
  });
463
468
  } else {
@@ -521,13 +526,13 @@ var Login = function Login(_ref) {
521
526
  userType: getUserType()
522
527
  };
523
528
  return Promise.resolve(Digit.UserService.authenticate(requestData)).then(function (_ref5) {
524
- var _location$state5, _window, _window$globalConfigs;
529
+ var _location$state6, _window, _window$globalConfigs;
525
530
 
526
531
  var ResponseInfo = _ref5.ResponseInfo,
527
532
  info = _ref5.UserRequest,
528
533
  tokens = _objectWithoutPropertiesLoose(_ref5, _excluded);
529
534
 
530
- if ((_location$state5 = location.state) !== null && _location$state5 !== void 0 && _location$state5.role) {
535
+ if ((_location$state6 = location.state) !== null && _location$state6 !== void 0 && _location$state6.role) {
531
536
  var roleInfo = info.roles.find(function (userRole) {
532
537
  return userRole.code === location.state.role;
533
538
  });
@@ -579,9 +584,8 @@ var Login = function Login(_ref) {
579
584
  if (_temp2 && _temp2.then) return _temp2.then(function () {});
580
585
  }
581
586
  }();
582
- }, function (err) {
587
+ }, function () {
583
588
  setIsOtpValid(false);
584
- console.error(err);
585
589
  }));
586
590
  } catch (e) {
587
591
  return Promise.reject(e);
@@ -639,7 +643,7 @@ var Login = function Login(_ref) {
639
643
  config: stepItems[0],
640
644
  mobileNumber: params.mobileNumber || "",
641
645
  onMobileChange: handleMobileChange,
642
- showRegisterLink: isUserRegistered && !((_location$state6 = location.state) !== null && _location$state6 !== void 0 && _location$state6.role),
646
+ showRegisterLink: isUserRegistered && !((_location$state7 = location.state) !== null && _location$state7 !== void 0 && _location$state7.role),
643
647
  t: t
644
648
  })), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
645
649
  path: path + "/otp"
@@ -1812,11 +1816,27 @@ var Header = function Header() {
1812
1816
 
1813
1817
  var _excluded$1 = ["UserRequest"];
1814
1818
 
1819
+ var setEmployeeDetail = function setEmployeeDetail(userObject, token) {
1820
+ var _JSON$parse;
1821
+
1822
+ var locale = ((_JSON$parse = JSON.parse(sessionStorage.getItem("Digit.locale"))) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.value) || "en_IN";
1823
+ localStorage.setItem("Employee.tenant-id", userObject === null || userObject === void 0 ? void 0 : userObject.tenantId);
1824
+ localStorage.setItem("tenant-id", userObject === null || userObject === void 0 ? void 0 : userObject.tenantId);
1825
+ localStorage.setItem("citizen.userRequestObject", JSON.stringify(userObject));
1826
+ localStorage.setItem("locale", locale);
1827
+ localStorage.setItem("Employee.locale", locale);
1828
+ localStorage.setItem("token", token);
1829
+ localStorage.setItem("Employee.token", token);
1830
+ localStorage.setItem("user-info", JSON.stringify(userObject));
1831
+ localStorage.setItem("Employee.user-info", JSON.stringify(userObject));
1832
+ };
1833
+
1815
1834
  var Login$1 = function Login(_ref) {
1816
- var _window, _window$globalConfigs, _window$globalConfigs2;
1835
+ var _window3, _window3$globalConfig, _window3$globalConfig2;
1817
1836
 
1818
1837
  var propsConfig = _ref.config,
1819
- t = _ref.t;
1838
+ t = _ref.t,
1839
+ isDisabled = _ref.isDisabled;
1820
1840
 
1821
1841
  var _Digit$Hooks$useTenan = Digit.Hooks.useTenants(),
1822
1842
  cities = _Digit$Hooks$useTenan.data,
@@ -1833,26 +1853,60 @@ var Login$1 = function Login(_ref) {
1833
1853
  showToast = _useState2[0],
1834
1854
  setShowToast = _useState2[1];
1835
1855
 
1856
+ var _useState3 = React.useState(false),
1857
+ setDisable = _useState3[1];
1858
+
1836
1859
  var history = reactRouterDom.useHistory();
1837
1860
  React.useEffect(function () {
1838
- var _location$state;
1861
+ var _user$info, _user$info$roles, _user$info2, _user$info2$roles, _window, _window$location, _window$location$href, _user$info3, _user$info4, _user$info4$roles, _user$info5, _user$info6, _user$info6$roles;
1839
1862
 
1840
1863
  if (!user) {
1841
1864
  return;
1842
1865
  }
1843
1866
 
1867
+ Digit.SessionStorage.set("citizen.userRequestObject", user);
1868
+ var filteredRoles = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : (_user$info$roles = _user$info.roles) === null || _user$info$roles === void 0 ? void 0 : _user$info$roles.filter(function (role) {
1869
+ return role.tenantId === Digit.SessionStorage.get("Employee.tenantId");
1870
+ });
1871
+ if ((user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : (_user$info2$roles = _user$info2.roles) === null || _user$info2$roles === void 0 ? void 0 : _user$info2$roles.length) > 0) user.info.roles = filteredRoles;
1844
1872
  Digit.UserService.setUser(user);
1845
- var redirectPath = ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.from) || "/digit-ui/employee";
1873
+ setEmployeeDetail(user === null || user === void 0 ? void 0 : user.info, user === null || user === void 0 ? void 0 : user.access_token);
1874
+ var redirectPath = "/digit-ui/employee";
1875
+
1876
+ if ((_window = window) !== null && _window !== void 0 && (_window$location = _window.location) !== null && _window$location !== void 0 && (_window$location$href = _window$location.href) !== null && _window$location$href !== void 0 && _window$location$href.includes("from=")) {
1877
+ var _window2, _window2$location, _window2$location$hre, _window2$location$hre2;
1878
+
1879
+ redirectPath = decodeURIComponent((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$location = _window2.location) === null || _window2$location === void 0 ? void 0 : (_window2$location$hre = _window2$location.href) === null || _window2$location$hre === void 0 ? void 0 : (_window2$location$hre2 = _window2$location$hre.split("from=")) === null || _window2$location$hre2 === void 0 ? void 0 : _window2$location$hre2[1]) || "/digit-ui/employee";
1880
+ }
1881
+
1882
+ if (user !== null && user !== void 0 && (_user$info3 = user.info) !== null && _user$info3 !== void 0 && _user$info3.roles && user !== null && user !== void 0 && (_user$info4 = user.info) !== null && _user$info4 !== void 0 && (_user$info4$roles = _user$info4.roles) !== null && _user$info4$roles !== void 0 && _user$info4$roles.every(function (e) {
1883
+ return e.code === "NATADMIN";
1884
+ })) {
1885
+ redirectPath = "/digit-ui/employee/payment/integration/dss/NURT_DASHBOARD";
1886
+ }
1887
+
1888
+ if (user !== null && user !== void 0 && (_user$info5 = user.info) !== null && _user$info5 !== void 0 && _user$info5.roles && user !== null && user !== void 0 && (_user$info6 = user.info) !== null && _user$info6 !== void 0 && (_user$info6$roles = _user$info6.roles) !== null && _user$info6$roles !== void 0 && _user$info6$roles.every(function (e) {
1889
+ return e.code === "STADMIN";
1890
+ })) {
1891
+ redirectPath = "/digit-ui/employee/payment/integration/dss/home";
1892
+ }
1893
+
1846
1894
  history.replace(redirectPath);
1847
1895
  }, [user]);
1848
1896
 
1849
1897
  var onLogin = function onLogin(data) {
1850
1898
  try {
1899
+ var _temp3 = function _temp3() {
1900
+ setDisable(false);
1901
+ };
1902
+
1851
1903
  if (!data.city) {
1852
1904
  alert("Please Select City!");
1853
1905
  return Promise.resolve();
1854
1906
  }
1855
1907
 
1908
+ setDisable(true);
1909
+
1856
1910
  var requestData = _extends({}, data, {
1857
1911
  userType: "EMPLOYEE"
1858
1912
  });
@@ -1860,7 +1914,7 @@ var Login$1 = function Login(_ref) {
1860
1914
  requestData.tenantId = data.city.code;
1861
1915
  delete requestData.city;
1862
1916
 
1863
- var _temp2 = _catch(function () {
1917
+ var _temp4 = _catch(function () {
1864
1918
  return Promise.resolve(Digit.UserService.authenticate(requestData)).then(function (_ref3) {
1865
1919
  var info = _ref3.UserRequest,
1866
1920
  tokens = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
@@ -1877,7 +1931,7 @@ var Login$1 = function Login(_ref) {
1877
1931
  setTimeout(closeToast, 5000);
1878
1932
  });
1879
1933
 
1880
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
1934
+ return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
1881
1935
  } catch (e) {
1882
1936
  return Promise.reject(e);
1883
1937
  }
@@ -1940,6 +1994,7 @@ var Login$1 = function Login(_ref) {
1940
1994
  }
1941
1995
  })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
1942
1996
  onSubmit: onLogin,
1997
+ isDisabled: isDisabled,
1943
1998
  noBoxShadow: true,
1944
1999
  inline: true,
1945
2000
  submitInForm: true,
@@ -1955,26 +2010,29 @@ var Login$1 = function Login(_ref) {
1955
2010
  margin: "auto",
1956
2011
  minWidth: "408px"
1957
2012
  },
1958
- className: "loginFormStyleEmployee"
2013
+ className: "loginFormStyleEmployee",
2014
+ buttonStyle: {
2015
+ maxWidth: "100%"
2016
+ }
1959
2017
  }, /*#__PURE__*/React__default.createElement(Header, null)), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
1960
2018
  error: true,
1961
2019
  label: t(showToast),
1962
2020
  onClose: closeToast
1963
2021
  }), /*#__PURE__*/React__default.createElement("div", {
1964
- className: "employee-home-footer",
2022
+ className: "employee-login-home-footer",
1965
2023
  style: {
1966
2024
  backgroundColor: "unset"
1967
2025
  }
1968
2026
  }, /*#__PURE__*/React__default.createElement("img", {
1969
2027
  alt: "Powered by DIGIT",
1970
- src: (_window = window) === null || _window === void 0 ? void 0 : (_window$globalConfigs = _window.globalConfigs) === null || _window$globalConfigs === void 0 ? void 0 : (_window$globalConfigs2 = _window$globalConfigs.getConfig) === null || _window$globalConfigs2 === void 0 ? void 0 : _window$globalConfigs2.call(_window$globalConfigs, "DIGIT_FOOTER_BW"),
2028
+ src: (_window3 = window) === null || _window3 === void 0 ? void 0 : (_window3$globalConfig = _window3.globalConfigs) === null || _window3$globalConfig === void 0 ? void 0 : (_window3$globalConfig2 = _window3$globalConfig.getConfig) === null || _window3$globalConfig2 === void 0 ? void 0 : _window3$globalConfig2.call(_window3$globalConfig, "DIGIT_FOOTER_BW"),
1971
2029
  style: {
1972
2030
  cursor: "pointer"
1973
2031
  },
1974
2032
  onClick: function onClick() {
1975
- var _window2, _window2$globalConfig, _window2$globalConfig2;
2033
+ var _window4, _window4$globalConfig, _window4$globalConfig2;
1976
2034
 
1977
- window.open((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$globalConfig = _window2.globalConfigs) === null || _window2$globalConfig === void 0 ? void 0 : (_window2$globalConfig2 = _window2$globalConfig.getConfig) === null || _window2$globalConfig2 === void 0 ? void 0 : _window2$globalConfig2.call(_window2$globalConfig, "DIGIT_HOME_URL"), "_blank").focus();
2035
+ window.open((_window4 = window) === null || _window4 === void 0 ? void 0 : (_window4$globalConfig = _window4.globalConfigs) === null || _window4$globalConfig === void 0 ? void 0 : (_window4$globalConfig2 = _window4$globalConfig.getConfig) === null || _window4$globalConfig2 === void 0 ? void 0 : _window4$globalConfig2.call(_window4$globalConfig, "DIGIT_HOME_URL"), "_blank").focus();
1978
2036
  }
1979
2037
  }), " "));
1980
2038
  };
@@ -2520,8 +2578,9 @@ var LanguageSelection = function LanguageSelection() {
2520
2578
  }), /*#__PURE__*/React__default.createElement("p", null, t("TENANT_TENANTS_" + (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.code.toUpperCase())))), /*#__PURE__*/React__default.createElement("div", {
2521
2579
  className: "language-selector",
2522
2580
  style: {
2523
- justifyContent: "space-between",
2524
- marginBottom: "24px"
2581
+ justifyContent: "space-around",
2582
+ marginBottom: "24px",
2583
+ padding: "0 5%"
2525
2584
  }
2526
2585
  }, languages.map(function (language, index) {
2527
2586
  return /*#__PURE__*/React__default.createElement("div", {
@@ -2579,7 +2638,7 @@ var AppModules = function AppModules(_ref) {
2579
2638
  var location = reactRouterDom.useLocation();
2580
2639
  var user = Digit.UserService.getUser();
2581
2640
 
2582
- if (!user) {
2641
+ if (!user || !(user !== null && user !== void 0 && user.access_token) || !(user !== null && user !== void 0 && user.info)) {
2583
2642
  return /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
2584
2643
  to: {
2585
2644
  pathname: "/digit-ui/employee/user/login",
@@ -2625,6 +2684,169 @@ var AppModules = function AppModules(_ref) {
2625
2684
  }))));
2626
2685
  };
2627
2686
 
2687
+ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
2688
+ _inheritsLoose(ErrorBoundary, _React$Component);
2689
+
2690
+ function ErrorBoundary(props) {
2691
+ var _this;
2692
+
2693
+ _this = _React$Component.call(this, props) || this;
2694
+ _this.state = {
2695
+ error: null,
2696
+ errorStack: null,
2697
+ hasError: false
2698
+ };
2699
+ return _this;
2700
+ }
2701
+
2702
+ ErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError(error) {
2703
+ return {
2704
+ error: error === null || error === void 0 ? void 0 : error.message,
2705
+ hasError: true,
2706
+ errorStack: error === null || error === void 0 ? void 0 : error.stack
2707
+ };
2708
+ };
2709
+
2710
+ var _proto = ErrorBoundary.prototype;
2711
+
2712
+ _proto.componentDidCatch = function componentDidCatch(error, errorInfo) {
2713
+ this.setState({
2714
+ error: error === null || error === void 0 ? void 0 : error.message,
2715
+ hasError: true,
2716
+ errorStack: error === null || error === void 0 ? void 0 : error.stack
2717
+ });
2718
+ };
2719
+
2720
+ _proto.render = function render() {
2721
+ if (this.state.hasError) {
2722
+ var _this$state, _this$state2, _this$state3;
2723
+
2724
+ console.error("UI-error", (_this$state = this.state) === null || _this$state === void 0 ? void 0 : _this$state.error);
2725
+ return /*#__PURE__*/React__default.createElement("div", {
2726
+ className: "error-boundary"
2727
+ }, /*#__PURE__*/React__default.createElement("summary", null, "Something went wrong"), /*#__PURE__*/React__default.createElement("details", {
2728
+ style: {
2729
+ whiteSpace: "pre-wrap"
2730
+ }
2731
+ }, ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.errorStack) && this.state.errorStack.toString().substring(0, 600), (_this$state3 = this.state) === null || _this$state3 === void 0 ? void 0 : _this$state3.error));
2732
+ }
2733
+
2734
+ return this.props.children;
2735
+ };
2736
+
2737
+ return ErrorBoundary;
2738
+ }(React__default.Component);
2739
+
2740
+ var stringReplaceAll = function stringReplaceAll(str, searcher, replaceWith) {
2741
+ if (str === void 0) {
2742
+ str = "";
2743
+ }
2744
+
2745
+ if (searcher === void 0) {
2746
+ searcher = "";
2747
+ }
2748
+
2749
+ if (replaceWith === void 0) {
2750
+ replaceWith = "";
2751
+ }
2752
+
2753
+ if (searcher == "") return str;
2754
+
2755
+ while ((_str = str) !== null && _str !== void 0 && _str.includes(searcher)) {
2756
+ var _str, _str2;
2757
+
2758
+ str = (_str2 = str) === null || _str2 === void 0 ? void 0 : _str2.replace(searcher, replaceWith);
2759
+ }
2760
+
2761
+ return str;
2762
+ };
2763
+
2764
+ var ChangeCity = function ChangeCity(prop) {
2765
+ var _stringReplaceAll2;
2766
+
2767
+ var _useState = React.useState(null),
2768
+ dropDownData = _useState[0],
2769
+ setDropDownData = _useState[1];
2770
+
2771
+ var _useState2 = React.useState([]),
2772
+ selectCityData = _useState2[0],
2773
+ setSelectCityData = _useState2[1];
2774
+
2775
+ var _useState3 = React.useState([]);
2776
+
2777
+ var history = reactRouterDom.useHistory();
2778
+ var selectedCities = [];
2779
+
2780
+ var handleChangeCity = function handleChangeCity(city) {
2781
+ var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3;
2782
+
2783
+ var loggedInData = Digit.SessionStorage.get("citizen.userRequestObject");
2784
+ var filteredRoles = (_Digit$SessionStorage = Digit.SessionStorage.get("citizen.userRequestObject")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.roles) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.filter(function (role) {
2785
+ return role.tenantId === city.value;
2786
+ });
2787
+
2788
+ if ((filteredRoles === null || filteredRoles === void 0 ? void 0 : filteredRoles.length) > 0) {
2789
+ loggedInData.info.roles = filteredRoles;
2790
+ loggedInData.info.tenantId = city === null || city === void 0 ? void 0 : city.value;
2791
+ }
2792
+
2793
+ Digit.SessionStorage.set("Employee.tenantId", city === null || city === void 0 ? void 0 : city.value);
2794
+ Digit.UserService.setUser(loggedInData);
2795
+ setDropDownData(city);
2796
+
2797
+ if (window.location.href.includes("/digit-ui/employee/")) {
2798
+ var _location$state;
2799
+
2800
+ var redirectPath = ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.from) || "/digit-ui/employee";
2801
+ history.replace(redirectPath);
2802
+ }
2803
+
2804
+ window.location.reload();
2805
+ };
2806
+
2807
+ React.useEffect(function () {
2808
+ var _userloggedValues$inf, _userloggedValues$inf2;
2809
+
2810
+ var userloggedValues = Digit.SessionStorage.get("citizen.userRequestObject");
2811
+ var teantsArray = [],
2812
+ filteredArray = [];
2813
+ userloggedValues === null || userloggedValues === void 0 ? void 0 : (_userloggedValues$inf = userloggedValues.info) === null || _userloggedValues$inf === void 0 ? void 0 : (_userloggedValues$inf2 = _userloggedValues$inf.roles) === null || _userloggedValues$inf2 === void 0 ? void 0 : _userloggedValues$inf2.forEach(function (role) {
2814
+ return teantsArray.push(role.tenantId);
2815
+ });
2816
+ var unique = teantsArray.filter(function (item, i, ar) {
2817
+ return ar.indexOf(item) === i;
2818
+ });
2819
+ unique === null || unique === void 0 ? void 0 : unique.forEach(function (uniCode) {
2820
+ var _stringReplaceAll;
2821
+
2822
+ filteredArray.push({
2823
+ label: prop === null || prop === void 0 ? void 0 : prop.t("TENANT_TENANTS_" + ((_stringReplaceAll = stringReplaceAll(uniCode, ".", "_")) === null || _stringReplaceAll === void 0 ? void 0 : _stringReplaceAll.toUpperCase())),
2824
+ value: uniCode
2825
+ });
2826
+ });
2827
+ selectedCities = filteredArray === null || filteredArray === void 0 ? void 0 : filteredArray.filter(function (select) {
2828
+ return select.value == Digit.SessionStorage.get("Employee.tenantId");
2829
+ });
2830
+ setSelectCityData(filteredArray);
2831
+ }, [dropDownData]);
2832
+ return /*#__PURE__*/React__default.createElement("div", {
2833
+ style: prop !== null && prop !== void 0 && prop.mobileView ? {
2834
+ color: "#767676"
2835
+ } : {}
2836
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
2837
+ option: selectCityData,
2838
+ selected: selectCityData.find(function (cityValue) {
2839
+ return cityValue.value === (dropDownData === null || dropDownData === void 0 ? void 0 : dropDownData.value);
2840
+ }),
2841
+ optionKey: "label",
2842
+ select: handleChangeCity,
2843
+ freeze: true,
2844
+ customSelector: /*#__PURE__*/React__default.createElement("label", {
2845
+ className: "cp"
2846
+ }, prop === null || prop === void 0 ? void 0 : prop.t("TENANT_TENANTS_" + ((_stringReplaceAll2 = stringReplaceAll(Digit.SessionStorage.get("Employee.tenantId"), ".", "_")) === null || _stringReplaceAll2 === void 0 ? void 0 : _stringReplaceAll2.toUpperCase())))
2847
+ }));
2848
+ };
2849
+
2628
2850
  var ChangeLanguage = function ChangeLanguage(prop) {
2629
2851
  var isDropdown = prop.dropdown || false;
2630
2852
 
@@ -2695,7 +2917,7 @@ var TextToImg = function TextToImg(props) {
2695
2917
  };
2696
2918
 
2697
2919
  var TopBar = function TopBar(_ref) {
2698
- var _Digit$SessionStorage, _cityDetails$city, _cityDetails$city2, _stateInfo$code, _userDetails$info, _userDetails$info2, _userDetails$info2$us;
2920
+ var _userDetails$info2, _cityDetails$city, _cityDetails$city2, _stateInfo$code, _userDetails$info3, _userDetails$info4, _userDetails$info4$us;
2699
2921
 
2700
2922
  var t = _ref.t,
2701
2923
  stateInfo = _ref.stateInfo,
@@ -2710,7 +2932,40 @@ var TopBar = function TopBar(_ref) {
2710
2932
  logoUrl = _ref.logoUrl,
2711
2933
  _ref$showLanguageChan = _ref.showLanguageChange,
2712
2934
  showLanguageChange = _ref$showLanguageChan === void 0 ? true : _ref$showLanguageChan;
2713
- var CitizenHomePageTenantId = (_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code;
2935
+
2936
+ var _React$useState = React__default.useState(null),
2937
+ profilePic = _React$useState[0],
2938
+ setProfilePic = _React$useState[1];
2939
+
2940
+ React__default.useEffect(function () {
2941
+ try {
2942
+ var _userDetails$info;
2943
+
2944
+ var tenant = Digit.ULBService.getCurrentTenantId();
2945
+ var uuid = userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info = userDetails.info) === null || _userDetails$info === void 0 ? void 0 : _userDetails$info.uuid;
2946
+
2947
+ var _temp2 = function () {
2948
+ if (uuid) {
2949
+ return Promise.resolve(Digit.UserService.userSearch(tenant, {
2950
+ uuid: [uuid]
2951
+ }, {})).then(function (usersResponse) {
2952
+ if (usersResponse && usersResponse.user && usersResponse.user.length) {
2953
+ var _userDetails$photo;
2954
+
2955
+ var _userDetails = usersResponse.user[0];
2956
+ var thumbs = _userDetails === null || _userDetails === void 0 ? void 0 : (_userDetails$photo = _userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
2957
+ setProfilePic(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
2958
+ }
2959
+ });
2960
+ }
2961
+ }();
2962
+
2963
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
2964
+ } catch (e) {
2965
+ return Promise.reject(e);
2966
+ }
2967
+ }, [profilePic !== null, userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info2 = userDetails.info) === null || _userDetails$info2 === void 0 ? void 0 : _userDetails$info2.uuid]);
2968
+ var CitizenHomePageTenantId = Digit.ULBService.getCitizenCurrentTenant(true);
2714
2969
  var history = reactRouterDom.useHistory();
2715
2970
 
2716
2971
  var _useLocation = reactRouterDom.useLocation(),
@@ -2783,7 +3038,14 @@ var TopBar = function TopBar(_ref) {
2783
3038
  }) : null, /*#__PURE__*/React__default.createElement("img", {
2784
3039
  className: "city",
2785
3040
  src: loggedin ? cityDetails === null || cityDetails === void 0 ? void 0 : cityDetails.logoId : stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.statelogo
2786
- }), loggedin && (cityDetails !== null && cityDetails !== void 0 && (_cityDetails$city = cityDetails.city) !== null && _cityDetails$city !== void 0 && _cityDetails$city.ulbGrade ? /*#__PURE__*/React__default.createElement("p", {
3041
+ }), /*#__PURE__*/React__default.createElement("span", {
3042
+ style: {
3043
+ display: "flex",
3044
+ alignItems: "center",
3045
+ justifyContent: "space-between",
3046
+ width: "100%"
3047
+ }
3048
+ }, loggedin && (cityDetails !== null && cityDetails !== void 0 && (_cityDetails$city = cityDetails.city) !== null && _cityDetails$city !== void 0 && _cityDetails$city.ulbGrade ? /*#__PURE__*/React__default.createElement("p", {
2787
3049
  className: "ulb",
2788
3050
  style: mobileView ? {
2789
3051
  fontSize: "14px",
@@ -2801,10 +3063,15 @@ var TopBar = function TopBar(_ref) {
2801
3063
  }, t("MYCITY_" + (stateInfo === null || stateInfo === void 0 ? void 0 : (_stateInfo$code = stateInfo.code) === null || _stateInfo$code === void 0 ? void 0 : _stateInfo$code.toUpperCase()) + "_LABEL"), " ", t("MYCITY_STATECODE_LABEL")), !mobileView && /*#__PURE__*/React__default.createElement("div", {
2802
3064
  className: mobileView ? "right" : "flex-right right w-80 column-gap-15",
2803
3065
  style: !loggedin ? {
2804
- width: '80%'
3066
+ width: "80%"
2805
3067
  } : {}
2806
3068
  }, /*#__PURE__*/React__default.createElement("div", {
2807
3069
  className: "left"
3070
+ }, !window.location.href.includes("employee/user/login") && !window.location.href.includes("employee/user/language-selection") && /*#__PURE__*/React__default.createElement(ChangeCity, {
3071
+ dropdown: true,
3072
+ t: t
3073
+ })), /*#__PURE__*/React__default.createElement("div", {
3074
+ className: "left"
2808
3075
  }, showLanguageChange && /*#__PURE__*/React__default.createElement(ChangeLanguage, {
2809
3076
  dropdown: true
2810
3077
  })), (userDetails === null || userDetails === void 0 ? void 0 : userDetails.access_token) && /*#__PURE__*/React__default.createElement("div", {
@@ -2813,7 +3080,7 @@ var TopBar = function TopBar(_ref) {
2813
3080
  option: userOptions,
2814
3081
  optionKey: "name",
2815
3082
  select: handleUserDropdownSelection,
2816
- showArrow: false,
3083
+ showArrow: true,
2817
3084
  freeze: true,
2818
3085
  style: mobileView ? {
2819
3086
  right: 0
@@ -2821,13 +3088,20 @@ var TopBar = function TopBar(_ref) {
2821
3088
  optionCardStyles: {
2822
3089
  overflow: "revert"
2823
3090
  },
2824
- customSelector: /*#__PURE__*/React__default.createElement(TextToImg, {
2825
- name: (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info = userDetails.info) === null || _userDetails$info === void 0 ? void 0 : _userDetails$info.name) || (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info2 = userDetails.info) === null || _userDetails$info2 === void 0 ? void 0 : (_userDetails$info2$us = _userDetails$info2.userInfo) === null || _userDetails$info2$us === void 0 ? void 0 : _userDetails$info2$us.name) || "Employee"
3091
+ customSelector: profilePic == null ? /*#__PURE__*/React__default.createElement(TextToImg, {
3092
+ name: (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info3 = userDetails.info) === null || _userDetails$info3 === void 0 ? void 0 : _userDetails$info3.name) || (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info4 = userDetails.info) === null || _userDetails$info4 === void 0 ? void 0 : (_userDetails$info4$us = _userDetails$info4.userInfo) === null || _userDetails$info4$us === void 0 ? void 0 : _userDetails$info4$us.name) || "Employee"
3093
+ }) : /*#__PURE__*/React__default.createElement("img", {
3094
+ src: profilePic,
3095
+ style: {
3096
+ height: "48px",
3097
+ width: "48px",
3098
+ borderRadius: "50%"
3099
+ }
2826
3100
  })
2827
3101
  })), /*#__PURE__*/React__default.createElement("img", {
2828
3102
  className: "state",
2829
3103
  src: logoUrl
2830
- })));
3104
+ }))));
2831
3105
  };
2832
3106
 
2833
3107
  var SideBarMenu = function SideBarMenu(t, closeSidebar, redirectToLoginPage, isEmployee) {
@@ -2865,30 +3139,69 @@ var SideBarMenu = function SideBarMenu(t, closeSidebar, redirectToLoginPage, isE
2865
3139
  var defaultImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL" + "/" + "/" + "/" + "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";
2866
3140
 
2867
3141
  var Profile = function Profile(_ref) {
2868
- var info = _ref.info;
3142
+ var info = _ref.info,
3143
+ t = _ref.t;
3144
+
3145
+ var _React$useState = React__default.useState(null),
3146
+ profilePic = _React$useState[0],
3147
+ setProfilePic = _React$useState[1];
3148
+
3149
+ React__default.useEffect(function () {
3150
+ try {
3151
+ var tenant = Digit.ULBService.getCurrentTenantId();
3152
+ var uuid = info === null || info === void 0 ? void 0 : info.uuid;
3153
+
3154
+ var _temp2 = function () {
3155
+ if (uuid) {
3156
+ return Promise.resolve(Digit.UserService.userSearch(tenant, {
3157
+ uuid: [uuid]
3158
+ }, {})).then(function (usersResponse) {
3159
+ if (usersResponse && usersResponse.user && usersResponse.user.length) {
3160
+ var _userDetails$photo;
3161
+
3162
+ var userDetails = usersResponse.user[0];
3163
+ var thumbs = userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$photo = userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
3164
+ setProfilePic(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
3165
+ }
3166
+ });
3167
+ }
3168
+ }();
3169
+
3170
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
3171
+ } catch (e) {
3172
+ return Promise.reject(e);
3173
+ }
3174
+ }, [profilePic !== null]);
2869
3175
  return /*#__PURE__*/React__default.createElement("div", {
2870
3176
  className: "profile-section"
2871
3177
  }, /*#__PURE__*/React__default.createElement("div", {
2872
3178
  className: "imageloader imageloader-loaded"
2873
3179
  }, /*#__PURE__*/React__default.createElement("img", {
2874
3180
  className: "img-responsive img-circle img-Profile",
2875
- src: defaultImage
3181
+ src: profilePic ? profilePic : defaultImage,
3182
+ style: {
3183
+ objectFit: "cover",
3184
+ objectPosition: "center"
3185
+ }
2876
3186
  })), /*#__PURE__*/React__default.createElement("div", {
2877
3187
  id: "profile-name",
2878
3188
  className: "label-container name-Profile"
2879
3189
  }, /*#__PURE__*/React__default.createElement("div", {
2880
3190
  className: "label-text"
2881
- }, " ", info.name, " ")), /*#__PURE__*/React__default.createElement("div", {
3191
+ }, " ", info === null || info === void 0 ? void 0 : info.name, " ")), /*#__PURE__*/React__default.createElement("div", {
2882
3192
  id: "profile-location",
2883
3193
  className: "label-container loc-Profile"
2884
3194
  }, /*#__PURE__*/React__default.createElement("div", {
2885
3195
  className: "label-text"
2886
- }, " ", info === null || info === void 0 ? void 0 : info.mobileNumber, " ")), info.emailId && /*#__PURE__*/React__default.createElement("div", {
3196
+ }, " ", info === null || info === void 0 ? void 0 : info.mobileNumber, " ")), (info === null || info === void 0 ? void 0 : info.emailId) && /*#__PURE__*/React__default.createElement("div", {
2887
3197
  id: "profile-emailid",
2888
3198
  className: "label-container loc-Profile"
2889
3199
  }, /*#__PURE__*/React__default.createElement("div", {
2890
3200
  className: "label-text"
2891
- }, " ", info.emailId, " ")));
3201
+ }, " ", info.emailId, " ")), window.location.href.includes("/employee") && !window.location.href.includes("/employee/user/login") && !window.location.href.includes("employee/user/language-selection") && /*#__PURE__*/React__default.createElement(ChangeCity, {
3202
+ t: t,
3203
+ mobileView: true
3204
+ }));
2892
3205
  };
2893
3206
 
2894
3207
  var PoweredBy = function PoweredBy() {
@@ -2936,6 +3249,14 @@ var CitizenSideBar = function CitizenSideBar(_ref2) {
2936
3249
  toggleSidebar(false);
2937
3250
  };
2938
3251
 
3252
+ var tenantId = Digit.ULBService.getCurrentTenantId();
3253
+
3254
+ var showProfilePage = function showProfilePage() {
3255
+ var redirectUrl = isEmployee ? "/digit-ui/employee/user/profile" : "/digit-ui/citizen/user/profile";
3256
+ history.push(redirectUrl);
3257
+ closeSidebar();
3258
+ };
3259
+
2939
3260
  var redirectToLoginPage = function redirectToLoginPage() {
2940
3261
  history.push("/digit-ui/citizen/login");
2941
3262
  closeSidebar();
@@ -2946,13 +3267,25 @@ var CitizenSideBar = function CitizenSideBar(_ref2) {
2946
3267
 
2947
3268
  if (isFetched && user && user.access_token) {
2948
3269
  profileItem = /*#__PURE__*/React__default.createElement(Profile, {
2949
- info: user.info,
2950
- stateName: stateInfo.name
3270
+ info: user === null || user === void 0 ? void 0 : user.info,
3271
+ stateName: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.name,
3272
+ t: t
2951
3273
  });
2952
3274
  menuItems = menuItems.filter(function (item) {
2953
3275
  return (item === null || item === void 0 ? void 0 : item.id) !== "login-btn";
2954
3276
  });
2955
3277
  menuItems = [].concat(menuItems, [{
3278
+ text: t("EDIT_PROFILE"),
3279
+ element: "PROFILE",
3280
+ icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.EditPencilIcon, {
3281
+ className: "icon edit-btn-ico",
3282
+ width: "16",
3283
+ height: "16"
3284
+ }),
3285
+ populators: {
3286
+ onClick: showProfilePage
3287
+ }
3288
+ }, {
2956
3289
  text: t("CORE_COMMON_LOGOUT"),
2957
3290
  element: "LOGOUT",
2958
3291
  icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.LogoutIcon, {
@@ -2961,6 +3294,22 @@ var CitizenSideBar = function CitizenSideBar(_ref2) {
2961
3294
  populators: {
2962
3295
  onClick: onLogout
2963
3296
  }
3297
+ }, {
3298
+ text: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, t("CS_COMMON_HELPLINE"), /*#__PURE__*/React__default.createElement("div", {
3299
+ className: "telephone",
3300
+ style: {
3301
+ marginTop: "-10%"
3302
+ }
3303
+ }, storeData === null || storeData === void 0 ? void 0 : storeData.tenants.map(function (i) {
3304
+ }), /*#__PURE__*/React__default.createElement("div", {
3305
+ className: "link"
3306
+ }, /*#__PURE__*/React__default.createElement("a", {
3307
+ href: "tel:" + (storeData === null || storeData === void 0 ? void 0 : storeData.tenants[0].contactNumber)
3308
+ }, storeData === null || storeData === void 0 ? void 0 : storeData.tenants[0].contactNumber)))),
3309
+ element: "Helpline",
3310
+ icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.Phone, {
3311
+ className: "icon"
3312
+ })
2964
3313
  }]);
2965
3314
  }
2966
3315
 
@@ -2980,76 +3329,84 @@ var CitizenSideBar = function CitizenSideBar(_ref2) {
2980
3329
  }));
2981
3330
  };
2982
3331
 
3332
+ var ToolTipWrapper = function ToolTipWrapper(_ref) {
3333
+ var child = _ref.child,
3334
+ label = _ref.label,
3335
+ t = _ref.t;
3336
+ return /*#__PURE__*/React__default.createElement("span", {
3337
+ className: "tooltip"
3338
+ }, child, /*#__PURE__*/React__default.createElement("span", {
3339
+ className: "tooltiptext",
3340
+ style: {
3341
+ fontSize: "14px",
3342
+ marginLeft: "0px",
3343
+ bottom: "20%"
3344
+ }
3345
+ }, /*#__PURE__*/React__default.createElement("div", {
3346
+ style: {
3347
+ background: "#555",
3348
+ width: "100%",
3349
+ padding: "5px",
3350
+ borderRadius: "6px",
3351
+ whiteSpace: "pre"
3352
+ }
3353
+ }, t(label))));
3354
+ };
3355
+
2983
3356
  var EmployeeSideBar = function EmployeeSideBar() {
3357
+ var STADMIN = Digit.UserService.hasAccess("STADMIN");
3358
+ var NATADMIN = Digit.UserService.hasAccess("NATADMIN");
3359
+
3360
+ var _useTranslation = reactI18next.useTranslation(),
3361
+ t = _useTranslation.t;
3362
+
2984
3363
  return /*#__PURE__*/React__default.createElement("div", {
2985
3364
  className: "sidebar"
2986
3365
  }, /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
2987
3366
  to: "/digit-ui/employee"
2988
3367
  }, /*#__PURE__*/React__default.createElement("div", {
2989
3368
  className: "actions active"
2990
- }, /*#__PURE__*/React__default.createElement("svg", {
2991
- xmlns: "http://www.w3.org/2000/svg",
2992
- height: "24",
2993
- viewBox: "0 0 24 24",
2994
- width: "24"
2995
- }, /*#__PURE__*/React__default.createElement("path", {
2996
- d: "M0 0h24v24H0z",
2997
- fill: "none"
2998
- }), /*#__PURE__*/React__default.createElement("path", {
2999
- d: "M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z",
3000
- fill: "white"
3001
- })))), /*#__PURE__*/React__default.createElement("a", {
3002
- href: "/employee"
3003
- }, /*#__PURE__*/React__default.createElement("div", {
3004
- className: "actions"
3005
- }, /*#__PURE__*/React__default.createElement("svg", {
3006
- xmlns: "http://www.w3.org/2000/svg",
3007
- height: "24",
3008
- viewBox: "0 0 24 24",
3009
- width: "24"
3010
- }, /*#__PURE__*/React__default.createElement("path", {
3011
- d: "M0 0h24v24H0z",
3012
- fill: "none"
3013
- }), /*#__PURE__*/React__default.createElement("path", {
3014
- d: "M8.17 5.7L1 10.48V21h5v-8h4v8h5V10.25z",
3015
- fill: "white"
3016
- }), /*#__PURE__*/React__default.createElement("path", {
3017
- d: "M17 7h2v2h-2z",
3018
- fill: "none"
3019
- }), /*#__PURE__*/React__default.createElement("path", {
3020
- d: "M10 3v1.51l2 1.33L13.73 7H15v.85l2 1.34V11h2v2h-2v2h2v2h-2v4h6V3H10zm9 6h-2V7h2v2z",
3021
- fill: "white"
3022
- })))), /*#__PURE__*/React__default.createElement("a", {
3023
- href: "/employee"
3024
- }, /*#__PURE__*/React__default.createElement("div", {
3025
- className: "actions"
3026
- }, /*#__PURE__*/React__default.createElement("svg", {
3027
- xmlns: "http://www.w3.org/2000/svg",
3028
- height: "24",
3029
- viewBox: "0 0 24 24",
3030
- width: "24"
3031
- }, /*#__PURE__*/React__default.createElement("path", {
3032
- d: "M0 0h24v24H0z",
3033
- fill: "none"
3034
- }), /*#__PURE__*/React__default.createElement("path", {
3035
- d: "M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-6 0h-4V4h4v2z",
3036
- fill: "white"
3037
- })))), /*#__PURE__*/React__default.createElement("a", {
3369
+ }, /*#__PURE__*/React__default.createElement(ToolTipWrapper, {
3370
+ child: /*#__PURE__*/React__default.createElement("svg", {
3371
+ xmlns: "http://www.w3.org/2000/svg",
3372
+ height: "24",
3373
+ viewBox: "0 0 24 24",
3374
+ width: "24"
3375
+ }, /*#__PURE__*/React__default.createElement("path", {
3376
+ d: "M0 0h24v24H0z",
3377
+ fill: "none"
3378
+ }), /*#__PURE__*/React__default.createElement("path", {
3379
+ d: "M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z",
3380
+ fill: "white"
3381
+ })),
3382
+ t: t,
3383
+ label: "ACTION_TEST_HOME"
3384
+ }))), /*#__PURE__*/React__default.createElement("a", {
3038
3385
  href: "/employee"
3039
3386
  }, /*#__PURE__*/React__default.createElement("div", {
3040
3387
  className: "actions"
3041
- }, /*#__PURE__*/React__default.createElement("svg", {
3042
- xmlns: "http://www.w3.org/2000/svg",
3043
- height: "24",
3044
- viewBox: "0 0 24 24",
3045
- width: "24"
3046
- }, /*#__PURE__*/React__default.createElement("path", {
3047
- d: "M24 0H0v24h24z",
3048
- fill: "none"
3049
- }), /*#__PURE__*/React__default.createElement("path", {
3050
- d: "M17.66 7.93L12 2.27 6.34 7.93c-3.12 3.12-3.12 8.19 0 11.31C7.9 20.8 9.95 21.58 12 21.58c2.05 0 4.1-.78 5.66-2.34 3.12-3.12 3.12-8.19 0-11.31zM12 19.59c-1.6 0-3.11-.62-4.24-1.76C6.62 16.69 6 15.19 6 13.59s.62-3.11 1.76-4.24L12 5.1v14.49z",
3051
- fill: "white"
3052
- })))));
3388
+ }, /*#__PURE__*/React__default.createElement(ToolTipWrapper, {
3389
+ child: /*#__PURE__*/React__default.createElement("svg", {
3390
+ xmlns: "http://www.w3.org/2000/svg",
3391
+ height: "24",
3392
+ viewBox: "0 0 24 24",
3393
+ width: "24"
3394
+ }, /*#__PURE__*/React__default.createElement("path", {
3395
+ d: "M0 0h24v24H0z",
3396
+ fill: "none"
3397
+ }), /*#__PURE__*/React__default.createElement("path", {
3398
+ d: "M8.17 5.7L1 10.48V21h5v-8h4v8h5V10.25z",
3399
+ fill: "white"
3400
+ }), /*#__PURE__*/React__default.createElement("path", {
3401
+ d: "M17 7h2v2h-2z",
3402
+ fill: "none"
3403
+ }), /*#__PURE__*/React__default.createElement("path", {
3404
+ d: "M10 3v1.51l2 1.33L13.73 7H15v.85l2 1.34V11h2v2h-2v2h2v2h-2v4h6V3H10zm9 6h-2V7h2v2z",
3405
+ fill: "white"
3406
+ })),
3407
+ t: t,
3408
+ label: "CORE_CHANGE_TENANT_DESCRIPTION"
3409
+ }))));
3053
3410
  };
3054
3411
 
3055
3412
  var SideBar = function SideBar(_ref) {
@@ -3095,12 +3452,24 @@ var TopBarSideBar = function TopBarSideBar(_ref) {
3095
3452
  isSidebarOpen = _useState[0],
3096
3453
  toggleSidebar = _useState[1];
3097
3454
 
3455
+ var history = reactRouterDom.useHistory();
3456
+
3098
3457
  var handleLogout = function handleLogout() {
3099
3458
  toggleSidebar(false);
3100
3459
  Digit.UserService.logout();
3101
3460
  };
3102
3461
 
3462
+ var userProfile = function userProfile() {
3463
+ history.push("/digit-ui/employee/user/profile");
3464
+ };
3465
+
3103
3466
  var userOptions = [{
3467
+ name: t("EDIT_PROFILE"),
3468
+ icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.EditPencilIcon, {
3469
+ className: "icon"
3470
+ }),
3471
+ func: userProfile
3472
+ }, {
3104
3473
  name: t("CORE_COMMON_LOGOUT"),
3105
3474
  icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.LogoutIcon, {
3106
3475
  className: "icon"
@@ -3132,51 +3501,1108 @@ var TopBarSideBar = function TopBarSideBar(_ref) {
3132
3501
  }));
3133
3502
  };
3134
3503
 
3135
- var EmployeeApp = function EmployeeApp(_ref) {
3136
- var _location$pathname, _window, _window$globalConfigs, _window$globalConfigs2;
3504
+ function UploadDrawer(_ref) {
3505
+ var setProfilePic = _ref.setProfilePic,
3506
+ closeDrawer = _ref.closeDrawer,
3507
+ userType = _ref.userType,
3508
+ removeProfilePic = _ref.removeProfilePic,
3509
+ showToast = _ref.showToast;
3137
3510
 
3138
- var stateInfo = _ref.stateInfo,
3139
- userDetails = _ref.userDetails,
3140
- CITIZEN = _ref.CITIZEN,
3141
- cityDetails = _ref.cityDetails,
3142
- mobileView = _ref.mobileView,
3143
- handleUserDropdownSelection = _ref.handleUserDropdownSelection,
3144
- logoUrl = _ref.logoUrl,
3145
- DSO = _ref.DSO,
3146
- stateCode = _ref.stateCode,
3147
- modules = _ref.modules,
3148
- appTenants = _ref.appTenants;
3511
+ var _useState = React.useState(null),
3512
+ setUploadedFile = _useState[1];
3513
+
3514
+ var _useState2 = React.useState(""),
3515
+ file = _useState2[0],
3516
+ setFile = _useState2[1];
3517
+
3518
+ var _useState3 = React.useState(null),
3519
+ setError = _useState3[1];
3149
3520
 
3150
3521
  var _useTranslation = reactI18next.useTranslation(),
3151
3522
  t = _useTranslation.t;
3152
3523
 
3153
- var _useRouteMatch = reactRouterDom.useRouteMatch(),
3154
- path = _useRouteMatch.path;
3524
+ var selectfile = function selectfile(e) {
3525
+ return setFile(e.target.files[0]);
3526
+ };
3527
+
3528
+ var removeimg = function removeimg() {
3529
+ removeProfilePic();
3530
+ closeDrawer();
3531
+ };
3532
+
3533
+ var onOverlayBodyClick = function onOverlayBodyClick() {
3534
+ return closeDrawer();
3535
+ };
3155
3536
 
3156
- var location = reactRouterDom.useLocation();
3157
- var showLanguageChange = location === null || location === void 0 ? void 0 : (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : _location$pathname.includes("language-selection");
3158
3537
  React.useEffect(function () {
3159
- Digit.UserService.setType("employee");
3160
- }, []);
3161
- return /*#__PURE__*/React__default.createElement("div", {
3162
- className: "employee"
3163
- }, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
3164
- path: path + "/user"
3165
- }, /*#__PURE__*/React__default.createElement(TopBarSideBar, {
3166
- t: t,
3167
- stateInfo: stateInfo,
3168
- userDetails: userDetails,
3538
+ (function () {
3539
+ try {
3540
+ setError(null);
3541
+
3542
+ var _temp4 = function () {
3543
+ if (file) {
3544
+ var _temp5 = function () {
3545
+ if (file.size >= 1000000) {
3546
+ showToast("error", t("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
3547
+ setError(t("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
3548
+ } else {
3549
+ var _temp6 = _catch(function () {
3550
+ return Promise.resolve(Digit.UploadServices.Filestorage(userType + "-profile", file, Digit.ULBService.getStateId())).then(function (response) {
3551
+ var _response$data, _response$data$files;
3552
+
3553
+ if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
3554
+ var _response$data2, _response$data2$files;
3555
+
3556
+ var fileStoreId = response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId;
3557
+ setUploadedFile(fileStoreId);
3558
+ setProfilePic(fileStoreId);
3559
+ } else {
3560
+ showToast("error", t("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"));
3561
+ setError(t("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"));
3562
+ }
3563
+ });
3564
+ }, function () {
3565
+ showToast("error", t("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"));
3566
+ });
3567
+
3568
+ if (_temp6 && _temp6.then) return _temp6.then(function () {});
3569
+ }
3570
+ }();
3571
+
3572
+ if (_temp5 && _temp5.then) return _temp5.then(function () {});
3573
+ }
3574
+ }();
3575
+
3576
+ return _temp4 && _temp4.then ? _temp4.then(function () {}) : void 0;
3577
+ } catch (e) {
3578
+ Promise.reject(e);
3579
+ }
3580
+ })();
3581
+ }, [file]);
3582
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
3583
+ style: {
3584
+ position: "fixed",
3585
+ top: "0",
3586
+ left: "0",
3587
+ right: "0",
3588
+ bottom: "0",
3589
+ width: "100%",
3590
+ height: "100vh",
3591
+ backgroundColor: "rgba(0,0,0,.5)"
3592
+ },
3593
+ onClick: onOverlayBodyClick
3594
+ }), /*#__PURE__*/React__default.createElement("div", {
3595
+ style: {
3596
+ width: "100%",
3597
+ justifyContent: "space-between",
3598
+ display: "flex",
3599
+ backgroundColor: "white",
3600
+ alignItems: "center",
3601
+ position: "fixed",
3602
+ left: "0",
3603
+ right: "0",
3604
+ height: "20%",
3605
+ bottom: userType === "citizen" ? "2.5rem" : "0",
3606
+ zIndex: "2"
3607
+ }
3608
+ }, /*#__PURE__*/React__default.createElement("div", {
3609
+ style: {
3610
+ display: "flex",
3611
+ flex: "1",
3612
+ flexDirection: "column",
3613
+ width: "100%",
3614
+ justifyContent: "center",
3615
+ alignItems: "center",
3616
+ gap: "8px 0"
3617
+ }
3618
+ }, /*#__PURE__*/React__default.createElement("label", {
3619
+ for: "file",
3620
+ style: {
3621
+ cursor: "pointer"
3622
+ }
3623
+ }, " ", /*#__PURE__*/React__default.createElement(digitUiReactComponents.GalleryIcon, null)), /*#__PURE__*/React__default.createElement("label", {
3624
+ style: {
3625
+ cursor: "pointer"
3626
+ }
3627
+ }, " Gallery"), /*#__PURE__*/React__default.createElement("input", {
3628
+ type: "file",
3629
+ id: "file",
3630
+ accept: "image/*, .png, .jpeg, .jpg",
3631
+ onChange: selectfile,
3632
+ style: {
3633
+ display: "none"
3634
+ }
3635
+ })), /*#__PURE__*/React__default.createElement("div", {
3636
+ style: {
3637
+ display: "flex",
3638
+ flex: "1",
3639
+ width: "100%",
3640
+ justifyContent: "center",
3641
+ alignItems: "center",
3642
+ flexDirection: "column",
3643
+ gap: "8px 0"
3644
+ }
3645
+ }, /*#__PURE__*/React__default.createElement("button", {
3646
+ onClick: removeimg
3647
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.RemoveIcon, null)), /*#__PURE__*/React__default.createElement("label", {
3648
+ style: {
3649
+ cursor: "pointer"
3650
+ }
3651
+ }, "Remove"))));
3652
+ }
3653
+
3654
+ var defaultImage$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL" + "/" + "/" + "/" + "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";
3655
+
3656
+ var UserProfile = function UserProfile(_ref) {
3657
+ var _Digit$UserService$ge, _errors$userName, _errors$emailAddress, _errors$userName2, _errors$mobileNumber, _errors$emailAddress2, _ref3, _errors$currentPasswo, _errors$newPassword, _errors$confirmPasswo;
3658
+
3659
+ var stateCode = _ref.stateCode,
3660
+ userType = _ref.userType,
3661
+ cityDetails = _ref.cityDetails;
3662
+ var history = reactRouterDom.useHistory();
3663
+
3664
+ var _useTranslation = reactI18next.useTranslation(),
3665
+ t = _useTranslation.t;
3666
+
3667
+ var url = window.location.href;
3668
+ var stateId = Digit.ULBService.getStateId();
3669
+ var tenant = Digit.ULBService.getCurrentTenantId();
3670
+ var userInfo = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
3671
+
3672
+ var _useState = React.useState(null),
3673
+ userDetails = _useState[0],
3674
+ setUserDetails = _useState[1];
3675
+
3676
+ var _useState2 = React.useState(userInfo !== null && userInfo !== void 0 && userInfo.name ? userInfo.name : ""),
3677
+ name = _useState2[0],
3678
+ setName = _useState2[1];
3679
+
3680
+ var _useState3 = React.useState(userInfo !== null && userInfo !== void 0 && userInfo.emailId ? userInfo.emailId : ""),
3681
+ email = _useState3[0],
3682
+ setEmail = _useState3[1];
3683
+
3684
+ var _useState4 = React.useState(userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender),
3685
+ gender = _useState4[0],
3686
+ setGender = _useState4[1];
3687
+
3688
+ var _useState5 = React.useState(userInfo !== null && userInfo !== void 0 && userInfo.permanentCity ? userInfo.permanentCity : cityDetails.name),
3689
+ city = _useState5[0],
3690
+ setCity = _useState5[1];
3691
+
3692
+ var _useState6 = React.useState(userInfo !== null && userInfo !== void 0 && userInfo.mobileNumber ? userInfo.mobileNumber : ""),
3693
+ mobileNumber = _useState6[0],
3694
+ setMobileNo = _useState6[1];
3695
+
3696
+ var _useState7 = React.useState(null),
3697
+ profilePic = _useState7[0],
3698
+ setProfilePic = _useState7[1];
3699
+
3700
+ var _useState8 = React.useState(""),
3701
+ profileImg = _useState8[0],
3702
+ setProfileImg = _useState8[1];
3703
+
3704
+ var _useState9 = React.useState(false),
3705
+ openUploadSlide = _useState9[0],
3706
+ setOpenUploadSide = _useState9[1];
3707
+
3708
+ var _useState10 = React.useState(false),
3709
+ changepassword = _useState10[0],
3710
+ setChangepassword = _useState10[1];
3711
+
3712
+ var _useState11 = React.useState(""),
3713
+ currentPassword = _useState11[0],
3714
+ setCurrentPassword = _useState11[1];
3715
+
3716
+ var _useState12 = React.useState(""),
3717
+ newPassword = _useState12[0],
3718
+ setNewPassword = _useState12[1];
3719
+
3720
+ var _useState13 = React.useState(""),
3721
+ confirmPassword = _useState13[0],
3722
+ setConfirmPassword = _useState13[1];
3723
+
3724
+ var _useState14 = React.useState(null),
3725
+ toast = _useState14[0],
3726
+ setToast = _useState14[1];
3727
+
3728
+ var _useState15 = React.useState(false),
3729
+ loading = _useState15[0],
3730
+ setLoading = _useState15[1];
3731
+
3732
+ var _React$useState = React__default.useState(window.innerWidth),
3733
+ windowWidth = _React$useState[0],
3734
+ setWindowWidth = _React$useState[1];
3735
+
3736
+ var _React$useState2 = React__default.useState({}),
3737
+ errors = _React$useState2[0],
3738
+ setErrors = _React$useState2[1];
3739
+
3740
+ var getUserInfo = function getUserInfo() {
3741
+ try {
3742
+ var uuid = userInfo === null || userInfo === void 0 ? void 0 : userInfo.uuid;
3743
+
3744
+ var _temp2 = function () {
3745
+ if (uuid) {
3746
+ return Promise.resolve(Digit.UserService.userSearch(tenant, {
3747
+ uuid: [uuid]
3748
+ }, {})).then(function (usersResponse) {
3749
+ usersResponse && usersResponse.user && usersResponse.user.length && setUserDetails(usersResponse.user[0]);
3750
+ });
3751
+ }
3752
+ }();
3753
+
3754
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
3755
+ } catch (e) {
3756
+ return Promise.reject(e);
3757
+ }
3758
+ };
3759
+
3760
+ React__default.useEffect(function () {
3761
+ window.addEventListener("resize", function () {
3762
+ return setWindowWidth(window.innerWidth);
3763
+ });
3764
+ return function () {
3765
+ window.removeEventListener("resize", function () {
3766
+ return setWindowWidth(window.innerWidth);
3767
+ });
3768
+ };
3769
+ });
3770
+ React.useEffect(function () {
3771
+ var _userDetails$photo;
3772
+
3773
+ setLoading(true);
3774
+ getUserInfo();
3775
+ setGender({
3776
+ i18nKey: undefined,
3777
+ code: userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender,
3778
+ value: userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender
3779
+ });
3780
+ var thumbs = userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$photo = userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
3781
+ setProfileImg(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
3782
+ setLoading(false);
3783
+ }, [userDetails !== null]);
3784
+ var validation = {};
3785
+ var editScreen = false;
3786
+
3787
+ var onClickAddPic = function onClickAddPic() {
3788
+ return setOpenUploadSide(!openUploadSlide);
3789
+ };
3790
+
3791
+ var TogleforPassword = function TogleforPassword() {
3792
+ return setChangepassword(!changepassword);
3793
+ };
3794
+
3795
+ var setGenderName = function setGenderName(value) {
3796
+ return setGender(value);
3797
+ };
3798
+
3799
+ var closeFileUploadDrawer = function closeFileUploadDrawer() {
3800
+ return setOpenUploadSide(false);
3801
+ };
3802
+
3803
+ var setUserName = function setUserName(value) {
3804
+ setName(value);
3805
+
3806
+ if (!new RegExp(/^[a-zA-Z ]+$/i).test(value) || value.length === 0 || value.length > 50) {
3807
+ setErrors(_extends({}, errors, {
3808
+ userName: {
3809
+ type: "pattern",
3810
+ message: "CORE_COMMON_PROFILE_NAME_INVALID"
3811
+ }
3812
+ }));
3813
+ } else {
3814
+ setErrors(_extends({}, errors, {
3815
+ userName: null
3816
+ }));
3817
+ }
3818
+ };
3819
+
3820
+ var setUserEmailAddress = function setUserEmailAddress(value) {
3821
+ setEmail(value);
3822
+
3823
+ if (value.length && !(value.includes("@") && value.includes("."))) {
3824
+ setErrors(_extends({}, errors, {
3825
+ emailAddress: {
3826
+ type: "pattern",
3827
+ message: "CORE_COMMON_PROFILE_EMAIL_INVALID"
3828
+ }
3829
+ }));
3830
+ } else {
3831
+ setErrors(_extends({}, errors, {
3832
+ emailAddress: null
3833
+ }));
3834
+ }
3835
+ };
3836
+
3837
+ var setUserMobileNumber = function setUserMobileNumber(value) {
3838
+ setMobileNo(value);
3839
+
3840
+ if (userType === "employee" && !new RegExp(/^[6-9]{1}[0-9]{9}$/).test(value)) {
3841
+ setErrors(_extends({}, errors, {
3842
+ mobileNumber: {
3843
+ type: 'pattern',
3844
+ message: "CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"
3845
+ }
3846
+ }));
3847
+ } else {
3848
+ setErrors(_extends({}, errors, {
3849
+ mobileNumber: null
3850
+ }));
3851
+ }
3852
+ };
3853
+
3854
+ var setUserCurrentPassword = function setUserCurrentPassword(value) {
3855
+ setCurrentPassword(value);
3856
+
3857
+ if (value.length && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) {
3858
+ setErrors(_extends({}, errors, {
3859
+ currentPassword: {
3860
+ type: "pattern",
3861
+ message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
3862
+ }
3863
+ }));
3864
+ } else {
3865
+ setErrors(_extends({}, errors, {
3866
+ currentPassword: null
3867
+ }));
3868
+ }
3869
+ };
3870
+
3871
+ var setUserNewPassword = function setUserNewPassword(value) {
3872
+ setNewPassword(value);
3873
+
3874
+ if (value.length && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) {
3875
+ setErrors(_extends({}, errors, {
3876
+ newPassword: {
3877
+ type: "pattern",
3878
+ message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
3879
+ }
3880
+ }));
3881
+ } else {
3882
+ setErrors(_extends({}, errors, {
3883
+ newPassword: null
3884
+ }));
3885
+ }
3886
+ };
3887
+
3888
+ var setUserConfirmPassword = function setUserConfirmPassword(value) {
3889
+ setConfirmPassword(value);
3890
+
3891
+ if (value.length && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(value)) {
3892
+ setErrors(_extends({}, errors, {
3893
+ confirmPassword: {
3894
+ type: "pattern",
3895
+ message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
3896
+ }
3897
+ }));
3898
+ } else {
3899
+ setErrors(_extends({}, errors, {
3900
+ confirmPassword: null
3901
+ }));
3902
+ }
3903
+ };
3904
+
3905
+ var removeProfilePic = function removeProfilePic() {
3906
+ setProfilePic(null);
3907
+ setProfileImg(null);
3908
+ };
3909
+
3910
+ var showToast = function showToast(type, message, duration) {
3911
+ if (duration === void 0) {
3912
+ duration = 5000;
3913
+ }
3914
+
3915
+ setToast({
3916
+ key: type,
3917
+ action: message
3918
+ });
3919
+ setTimeout(function () {
3920
+ setToast(null);
3921
+ }, duration);
3922
+ };
3923
+
3924
+ var updateProfile = function updateProfile() {
3925
+ try {
3926
+ var _temp5 = function _temp5(_result) {
3927
+ if (_exit2) return _result;
3928
+ setLoading(false);
3929
+ };
3930
+
3931
+ var _exit2 = false;
3932
+ setLoading(true);
3933
+
3934
+ var _temp6 = _catch(function () {
3935
+ var requestData = _extends({}, userInfo, {
3936
+ name: name,
3937
+ gender: gender === null || gender === void 0 ? void 0 : gender.value,
3938
+ emailId: email,
3939
+ photo: profilePic
3940
+ });
3941
+
3942
+ if (!new RegExp(/^([a-zA-Z ])*$/).test(name) || name === "" || name.length > 50 || name.length < 1) {
3943
+ throw JSON.stringify({
3944
+ type: "error",
3945
+ message: "CORE_COMMON_PROFILE_NAME_INVALID"
3946
+ });
3947
+ }
3948
+
3949
+ if (userType === "employee" && !new RegExp(/^[6-9]{1}[0-9]{9}$/).test(mobileNumber)) {
3950
+ throw JSON.stringify({
3951
+ type: "error",
3952
+ message: "CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"
3953
+ });
3954
+ }
3955
+
3956
+ if (email.length && !(email.includes("@") && email.includes("."))) {
3957
+ throw JSON.stringify({
3958
+ type: "error",
3959
+ message: "CORE_COMMON_PROFILE_EMAIL_INVALID"
3960
+ });
3961
+ }
3962
+
3963
+ if (currentPassword.length || newPassword.length || confirmPassword.length) {
3964
+ if (newPassword !== confirmPassword) {
3965
+ throw JSON.stringify({
3966
+ type: "error",
3967
+ message: "CORE_COMMON_PROFILE_PASSWORD_MISMATCH"
3968
+ });
3969
+ }
3970
+
3971
+ if (!(currentPassword.length && newPassword.length && confirmPassword.length)) {
3972
+ throw JSON.stringify({
3973
+ type: "error",
3974
+ message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
3975
+ });
3976
+ }
3977
+
3978
+ if (!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(newPassword) && !new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(confirmPassword)) {
3979
+ throw JSON.stringify({
3980
+ type: "error",
3981
+ message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
3982
+ });
3983
+ }
3984
+ }
3985
+
3986
+ return Promise.resolve(Digit.UserService.updateUser(requestData, stateCode)).then(function (_ref2) {
3987
+ var responseInfo = _ref2.responseInfo,
3988
+ user = _ref2.user;
3989
+
3990
+ if (responseInfo && responseInfo.status === "200") {
3991
+ var _user = Digit.UserService.getUser();
3992
+
3993
+ if (_user) {
3994
+ Digit.UserService.setUser(_extends({}, _user, {
3995
+ info: _extends({}, _user.info, {
3996
+ name: name,
3997
+ mobileNumber: mobileNumber,
3998
+ emailId: email,
3999
+ permanentCity: city
4000
+ })
4001
+ }));
4002
+ }
4003
+ }
4004
+
4005
+ return function () {
4006
+ if (currentPassword.length && newPassword.length && confirmPassword.length) {
4007
+ var _requestData = {
4008
+ existingPassword: currentPassword,
4009
+ newPassword: newPassword,
4010
+ tenantId: tenant,
4011
+ type: "EMPLOYEE",
4012
+ username: userInfo === null || userInfo === void 0 ? void 0 : userInfo.userName,
4013
+ confirmPassword: confirmPassword
4014
+ };
4015
+ return function () {
4016
+ if (newPassword === confirmPassword) {
4017
+ return _catch(function () {
4018
+ return Promise.resolve(Digit.UserService.changePassword(_requestData, tenant)).then(function (res) {
4019
+ var changePasswordResponseInfo = res.responseInfo;
4020
+
4021
+ if (changePasswordResponseInfo !== null && changePasswordResponseInfo !== void 0 && changePasswordResponseInfo.status && changePasswordResponseInfo.status === "200") {
4022
+ showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"), 5000);
4023
+ } else {
4024
+ throw "";
4025
+ }
4026
+ });
4027
+ }, function (error) {
4028
+ var _error$Errors, _error$Errors$at;
4029
+
4030
+ throw JSON.stringify({
4031
+ type: "error",
4032
+ message: (_error$Errors = error.Errors) !== null && _error$Errors !== void 0 && (_error$Errors$at = _error$Errors.at(0)) !== null && _error$Errors$at !== void 0 && _error$Errors$at.description ? error.Errors.at(0).description : "CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"
4033
+ });
4034
+ });
4035
+ } else {
4036
+ throw JSON.stringify({
4037
+ type: "error",
4038
+ message: "CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"
4039
+ });
4040
+ }
4041
+ }();
4042
+ } else if (responseInfo !== null && responseInfo !== void 0 && responseInfo.status && responseInfo.status === "200") {
4043
+ showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS"), 5000);
4044
+ }
4045
+ }();
4046
+ });
4047
+ }, function (error) {
4048
+ var errorObj = JSON.parse(error);
4049
+ showToast(errorObj.type, t(errorObj.message), 5000);
4050
+ });
4051
+
4052
+ return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
4053
+ } catch (e) {
4054
+ return Promise.reject(e);
4055
+ }
4056
+ };
4057
+
4058
+ var menu = [];
4059
+
4060
+ var _Digit$Hooks$pt$useGe = Digit.Hooks.pt.useGenderMDMS(stateId, "common-masters", "GenderType"),
4061
+ Menu = _Digit$Hooks$pt$useGe.data;
4062
+
4063
+ Menu && Menu.map(function (genderDetails) {
4064
+ menu.push({
4065
+ i18nKey: "PT_COMMON_GENDER_" + genderDetails.code,
4066
+ code: "" + genderDetails.code,
4067
+ value: "" + genderDetails.code
4068
+ });
4069
+ });
4070
+
4071
+ var setFileStoreId = function setFileStoreId(fileStoreId) {
4072
+ try {
4073
+ var _temp8 = function _temp8(thumbnails) {
4074
+ setProfileImg(thumbnails === null || thumbnails === void 0 ? void 0 : thumbnails.thumbs[0]);
4075
+ closeFileUploadDrawer();
4076
+ };
4077
+
4078
+ setProfilePic(fileStoreId);
4079
+ return Promise.resolve(fileStoreId ? Promise.resolve(getThumbnails([fileStoreId], stateId)).then(_temp8) : _temp8(null));
4080
+ } catch (e) {
4081
+ return Promise.reject(e);
4082
+ }
4083
+ };
4084
+
4085
+ var getThumbnails = function getThumbnails(ids, tenantId) {
4086
+ try {
4087
+ return Promise.resolve(Digit.UploadServices.Filefetch(ids, tenantId)).then(function (res) {
4088
+ if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) {
4089
+ return {
4090
+ thumbs: res.data.fileStoreIds.map(function (o) {
4091
+ return o.url.split(",")[3];
4092
+ }),
4093
+ images: res.data.fileStoreIds.map(function (o) {
4094
+ return Digit.Utils.getFileUrl(o.url);
4095
+ })
4096
+ };
4097
+ } else {
4098
+ return null;
4099
+ }
4100
+ });
4101
+ } catch (e) {
4102
+ return Promise.reject(e);
4103
+ }
4104
+ };
4105
+
4106
+ if (loading) return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
4107
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("section", {
4108
+ style: {
4109
+ margin: userType === "citizen" ? "8px" : "24px"
4110
+ }
4111
+ }, userType === "citizen" ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.BackButton, null) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.BreadCrumb, {
4112
+ crumbs: [{
4113
+ path: "/digit-ui/employee",
4114
+ content: t("ES_COMMON_HOME"),
4115
+ show: true
4116
+ }, {
4117
+ path: "/digit-ui/employee/user/profile",
4118
+ content: t("ES_COMMON_PAGE_1"),
4119
+ show: url.includes("/user/profile")
4120
+ }]
4121
+ })), /*#__PURE__*/React__default.createElement("div", {
4122
+ style: {
4123
+ display: "flex",
4124
+ flex: 1,
4125
+ flexDirection: windowWidth < 768 || userType === "citizen" ? "column" : "row",
4126
+ margin: userType === "citizen" ? "8px" : "16px",
4127
+ gap: userType === "citizen" ? "" : "0 24px",
4128
+ boxShadow: userType === "citizen" ? "1px 1px 4px 0px rgba(0,0,0,0.2)" : "",
4129
+ background: userType === "citizen" ? "white" : "",
4130
+ borderRadius: userType === "citizen" ? "4px" : ""
4131
+ }
4132
+ }, /*#__PURE__*/React__default.createElement("section", {
4133
+ style: {
4134
+ position: "relative",
4135
+ display: "flex",
4136
+ flex: userType === "citizen" ? 1 : 2.5,
4137
+ justifyContent: "center",
4138
+ alignItems: "center",
4139
+ maxWidth: "100%",
4140
+ height: "376px",
4141
+ borderRadius: "4px",
4142
+ boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)",
4143
+ border: (userType === "citizen" ? "8px" : "24px") + " solid #fff",
4144
+ background: "#EEEEEE",
4145
+ padding: userType === "citizen" ? "8px" : "16px"
4146
+ }
4147
+ }, /*#__PURE__*/React__default.createElement("div", {
4148
+ style: {
4149
+ position: "relative",
4150
+ height: userType === "citizen" ? "114px" : "150px",
4151
+ width: userType === "citizen" ? "114px" : "150px",
4152
+ margin: "16px"
4153
+ }
4154
+ }, /*#__PURE__*/React__default.createElement("img", {
4155
+ style: {
4156
+ margin: "auto",
4157
+ borderRadius: "300px",
4158
+ justifyContent: "center",
4159
+ height: "100%",
4160
+ width: "100%"
4161
+ },
4162
+ src: !profileImg || profileImg === "" ? defaultImage$1 : profileImg
4163
+ }), /*#__PURE__*/React__default.createElement("button", {
4164
+ style: {
4165
+ position: "absolute",
4166
+ left: "50%",
4167
+ bottom: "-24px",
4168
+ transform: "translateX(-50%)"
4169
+ },
4170
+ onClick: onClickAddPic
4171
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CameraIcon, null)))), /*#__PURE__*/React__default.createElement("section", {
4172
+ style: {
4173
+ display: "flex",
4174
+ flexDirection: "column",
4175
+ flex: userType === "citizen" ? 1 : 7.5,
4176
+ width: "100%",
4177
+ borderRadius: "4px",
4178
+ height: "fit-content",
4179
+ boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)",
4180
+ background: "white",
4181
+ padding: userType === "citizen" ? "8px" : "24px",
4182
+ paddingBottom: "20px"
4183
+ }
4184
+ }, userType === "citizen" ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4185
+ style: {}
4186
+ }, "" + t("CORE_COMMON_PROFILE_NAME"), "*"), /*#__PURE__*/React__default.createElement("div", {
4187
+ style: {
4188
+ width: "100%"
4189
+ }
4190
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, _extends({
4191
+ t: t,
4192
+ style: {
4193
+ width: "100%"
4194
+ },
4195
+ type: "text",
4196
+ isMandatory: false,
4197
+ name: "name",
4198
+ value: name,
4199
+ onChange: function onChange(e) {
4200
+ return setUserName(e.target.value);
4201
+ }
4202
+ }, validation = {
4203
+ isRequired: true,
4204
+ pattern: "^[a-zA-Z-.`' ]*$",
4205
+ type: "tel",
4206
+ title: t("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")
4207
+ }, {
4208
+ disable: editScreen
4209
+ })), (errors === null || errors === void 0 ? void 0 : errors.userName) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
4210
+ style: {
4211
+ width: "70%",
4212
+ fontSize: "12px",
4213
+ marginTop: "-21px"
4214
+ }
4215
+ }, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$userName = errors.userName) === null || _errors$userName === void 0 ? void 0 : _errors$userName.message), " "))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4216
+ style: {}
4217
+ }, "" + t("CORE_COMMON_PROFILE_GENDER")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
4218
+ style: {
4219
+ width: "100%"
4220
+ },
4221
+ className: "form-field",
4222
+ selected: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 ? gender[0] : gender,
4223
+ disable: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 || editScreen,
4224
+ option: menu,
4225
+ select: setGenderName,
4226
+ value: gender,
4227
+ optionKey: "code",
4228
+ t: t,
4229
+ name: "gender"
4230
+ })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, null), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4231
+ style: {}
4232
+ }, "" + t("CORE_COMMON_PROFILE_EMAIL")), /*#__PURE__*/React__default.createElement("div", {
4233
+ style: {
4234
+ width: "100%"
4235
+ }
4236
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
4237
+ t: t,
4238
+ style: {
4239
+ width: "100%"
4240
+ },
4241
+ type: "email",
4242
+ isMandatory: false,
4243
+ optionKey: "i18nKey",
4244
+ name: "email",
4245
+ value: email,
4246
+ onChange: function onChange(e) {
4247
+ return setUserEmailAddress(e.target.value);
4248
+ },
4249
+ disable: editScreen
4250
+ }), (errors === null || errors === void 0 ? void 0 : errors.emailAddress) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
4251
+ style: {
4252
+ width: "70%",
4253
+ fontSize: "12px",
4254
+ marginTop: "-21px"
4255
+ }
4256
+ }, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$emailAddress = errors.emailAddress) === null || _errors$emailAddress === void 0 ? void 0 : _errors$emailAddress.message), " "))), /*#__PURE__*/React__default.createElement("button", {
4257
+ onClick: updateProfile,
4258
+ style: {
4259
+ marginTop: "24px",
4260
+ backgroundColor: "#F47738",
4261
+ width: "100%",
4262
+ height: "40px",
4263
+ color: "white",
4264
+ borderBottom: "1px solid black"
4265
+ }
4266
+ }, t("CORE_COMMON_SAVE"))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
4267
+ style: {
4268
+ display: "flex"
4269
+ }
4270
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4271
+ className: "profile-label-margin",
4272
+ style: {
4273
+ width: "300px"
4274
+ }
4275
+ }, "" + t("CORE_COMMON_PROFILE_NAME"), "*"), /*#__PURE__*/React__default.createElement("div", {
4276
+ style: {
4277
+ width: "100%"
4278
+ }
4279
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, _extends({
4280
+ t: t,
4281
+ type: "text",
4282
+ isMandatory: false,
4283
+ name: "name",
4284
+ value: name,
4285
+ onChange: function onChange(e) {
4286
+ return setUserName(e.target.value);
4287
+ },
4288
+ placeholder: "Enter Your Name"
4289
+ }, validation = {
4290
+ isRequired: true,
4291
+ pattern: "^[a-zA-Z-.`' ]*$",
4292
+ type: "text",
4293
+ title: t("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")
4294
+ }, {
4295
+ disable: editScreen
4296
+ })), (errors === null || errors === void 0 ? void 0 : errors.userName) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
4297
+ style: {
4298
+ width: "70%",
4299
+ fontSize: "12px",
4300
+ marginTop: "-21px"
4301
+ }
4302
+ }, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$userName2 = errors.userName) === null || _errors$userName2 === void 0 ? void 0 : _errors$userName2.message), " "))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
4303
+ style: {
4304
+ display: "flex"
4305
+ }
4306
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4307
+ className: "profile-label-margin",
4308
+ style: {
4309
+ width: "300px"
4310
+ }
4311
+ }, "" + t("CORE_COMMON_PROFILE_GENDER")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
4312
+ style: {
4313
+ width: "100%"
4314
+ },
4315
+ selected: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 ? gender[0] : gender,
4316
+ disable: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 || editScreen,
4317
+ option: menu,
4318
+ select: setGenderName,
4319
+ value: gender,
4320
+ optionKey: "code",
4321
+ t: t,
4322
+ name: "gender"
4323
+ })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
4324
+ style: {
4325
+ display: "flex"
4326
+ }
4327
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4328
+ className: "profile-label-margin",
4329
+ style: {
4330
+ width: "300px"
4331
+ }
4332
+ }, "" + t("CORE_COMMON_PROFILE_CITY")), /*#__PURE__*/React__default.createElement("div", {
4333
+ style: {
4334
+ width: "100%"
4335
+ }
4336
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, _extends({
4337
+ t: t,
4338
+ type: "text",
4339
+ isMandatory: false,
4340
+ name: "city",
4341
+ value: city,
4342
+ onChange: function onChange(e) {
4343
+ return setCity(e.target.value);
4344
+ },
4345
+ placeholder: "Enter Your City Name"
4346
+ }, validation = {
4347
+ isRequired: true,
4348
+ type: "text",
4349
+ title: t("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")
4350
+ }, {
4351
+ disable: true
4352
+ })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, null))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
4353
+ style: {
4354
+ display: "flex"
4355
+ }
4356
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4357
+ className: "profile-label-margin",
4358
+ style: {
4359
+ width: "300px"
4360
+ }
4361
+ }, t("CORE_COMMON_PROFILE_MOBILE_NUMBER") + "*"), /*#__PURE__*/React__default.createElement("div", {
4362
+ style: {
4363
+ width: "100%"
4364
+ }
4365
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.MobileNumber, {
4366
+ value: mobileNumber,
4367
+ style: {
4368
+ width: "100%"
4369
+ },
4370
+ name: "mobileNumber",
4371
+ placeholder: "Enter a valid Mobile No.",
4372
+ onChange: function onChange(value) {
4373
+ return setUserMobileNumber(value);
4374
+ },
4375
+ disable: true,
4376
+ required: true,
4377
+ pattern: "[6-9]{1}[0-9]{9}",
4378
+ type: "tel",
4379
+ title: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")
4380
+ }), (errors === null || errors === void 0 ? void 0 : errors.mobileNumber) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
4381
+ style: {
4382
+ width: "70%",
4383
+ fontSize: "12px",
4384
+ marginTop: "-21px"
4385
+ }
4386
+ }, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$mobileNumber = errors.mobileNumber) === null || _errors$mobileNumber === void 0 ? void 0 : _errors$mobileNumber.message), " "))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
4387
+ style: {
4388
+ display: "flex"
4389
+ }
4390
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4391
+ className: "profile-label-margin",
4392
+ style: {
4393
+ width: "300px"
4394
+ }
4395
+ }, "" + t("CORE_COMMON_PROFILE_EMAIL")), /*#__PURE__*/React__default.createElement("div", {
4396
+ style: {
4397
+ width: "100%"
4398
+ }
4399
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
4400
+ t: t,
4401
+ type: "email",
4402
+ isMandatory: false,
4403
+ placeholder: "Enter a valid Email",
4404
+ optionKey: "i18nKey",
4405
+ name: "email",
4406
+ value: email,
4407
+ onChange: function onChange(e) {
4408
+ return setUserEmailAddress(e.target.value);
4409
+ },
4410
+ disable: editScreen
4411
+ }), (errors === null || errors === void 0 ? void 0 : errors.emailAddress) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
4412
+ style: {
4413
+ width: "70%",
4414
+ fontSize: "12px",
4415
+ marginTop: "-21px"
4416
+ }
4417
+ }, " ", t(errors === null || errors === void 0 ? void 0 : (_errors$emailAddress2 = errors.emailAddress) === null || _errors$emailAddress2 === void 0 ? void 0 : _errors$emailAddress2.message), " "))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("a", {
4418
+ style: (_ref3 = {
4419
+ color: "orange",
4420
+ cursor: "default",
4421
+ marginBottom: "5"
4422
+ }, _ref3["cursor"] = "pointer", _ref3),
4423
+ onClick: TogleforPassword
4424
+ }, t("CORE_COMMON_CHANGE_PASSWORD")), changepassword ? /*#__PURE__*/React__default.createElement("div", {
4425
+ style: {
4426
+ marginTop: "10px"
4427
+ }
4428
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
4429
+ style: {
4430
+ display: "flex"
4431
+ }
4432
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4433
+ className: "profile-label-margin",
4434
+ style: {
4435
+ width: "300px"
4436
+ }
4437
+ }, "" + t("CORE_COMMON_PROFILE_CURRENT_PASSWORD")), /*#__PURE__*/React__default.createElement("div", {
4438
+ style: {
4439
+ width: "100%"
4440
+ }
4441
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
4442
+ t: t,
4443
+ type: "password",
4444
+ isMandatory: false,
4445
+ name: "name",
4446
+ pattern: "^([a-zA-Z0-9@#$%])+$",
4447
+ onChange: function onChange(e) {
4448
+ return setUserCurrentPassword(e.target.value);
4449
+ },
4450
+ disable: editScreen
4451
+ }), (errors === null || errors === void 0 ? void 0 : errors.currentPassword) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
4452
+ style: {
4453
+ width: "70%",
4454
+ fontSize: "12px",
4455
+ marginTop: "-21px"
4456
+ }
4457
+ }, t(errors === null || errors === void 0 ? void 0 : (_errors$currentPasswo = errors.currentPassword) === null || _errors$currentPasswo === void 0 ? void 0 : _errors$currentPasswo.message)))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
4458
+ style: {
4459
+ display: "flex"
4460
+ }
4461
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4462
+ className: "profile-label-margin",
4463
+ style: {
4464
+ width: "300px"
4465
+ }
4466
+ }, "" + t("CORE_COMMON_PROFILE_NEW_PASSWORD")), /*#__PURE__*/React__default.createElement("div", {
4467
+ style: {
4468
+ width: "100%"
4469
+ }
4470
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
4471
+ t: t,
4472
+ type: "password",
4473
+ isMandatory: false,
4474
+ name: "name",
4475
+ pattern: "^([a-zA-Z0-9@#$%])+$",
4476
+ onChange: function onChange(e) {
4477
+ return setUserNewPassword(e.target.value);
4478
+ },
4479
+ disable: editScreen
4480
+ }), (errors === null || errors === void 0 ? void 0 : errors.newPassword) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
4481
+ style: {
4482
+ width: "70%",
4483
+ fontSize: "12px",
4484
+ marginTop: "-21px"
4485
+ }
4486
+ }, t(errors === null || errors === void 0 ? void 0 : (_errors$newPassword = errors.newPassword) === null || _errors$newPassword === void 0 ? void 0 : _errors$newPassword.message)))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
4487
+ style: {
4488
+ display: "flex"
4489
+ }
4490
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
4491
+ className: "profile-label-margin",
4492
+ style: {
4493
+ width: "300px"
4494
+ }
4495
+ }, "" + t("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")), /*#__PURE__*/React__default.createElement("div", {
4496
+ style: {
4497
+ width: "100%"
4498
+ }
4499
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
4500
+ t: t,
4501
+ type: "password",
4502
+ isMandatory: false,
4503
+ name: "name",
4504
+ pattern: "^([a-zA-Z0-9@#$%])+$",
4505
+ onChange: function onChange(e) {
4506
+ return setUserConfirmPassword(e.target.value);
4507
+ },
4508
+ disable: editScreen
4509
+ }), (errors === null || errors === void 0 ? void 0 : errors.confirmPassword) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
4510
+ style: {
4511
+ width: "70%",
4512
+ fontSize: "12px",
4513
+ marginTop: "-21px"
4514
+ }
4515
+ }, t(errors === null || errors === void 0 ? void 0 : (_errors$confirmPasswo = errors.confirmPassword) === null || _errors$confirmPasswo === void 0 ? void 0 : _errors$confirmPasswo.message))))) : ""))))), userType === "employee" ? /*#__PURE__*/React__default.createElement("div", {
4516
+ style: {
4517
+ height: "88px",
4518
+ backgroundColor: "#FFFFFF",
4519
+ display: "flex",
4520
+ justifyContent: "flex-end",
4521
+ marginTop: "64px",
4522
+ alignItems: "center"
4523
+ }
4524
+ }, /*#__PURE__*/React__default.createElement("button", {
4525
+ onClick: updateProfile,
4526
+ style: {
4527
+ marginTop: "24px",
4528
+ backgroundColor: "#F47738",
4529
+ width: windowWidth < 768 ? "100%" : "248px",
4530
+ height: "40px",
4531
+ float: "right",
4532
+ margin: windowWidth < 768 ? "0 16px" : "",
4533
+ marginRight: windowWidth < 768 ? "16px" : "31px",
4534
+ color: "white",
4535
+ borderBottom: "1px solid black"
4536
+ }
4537
+ }, t("CORE_COMMON_SAVE"))) : "", toast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
4538
+ error: toast.key === "error",
4539
+ label: t(toast.key === "success" ? "CORE_COMMON_PROFILE_UPDATE_SUCCESS" : toast.action),
4540
+ onClose: function onClose() {
4541
+ return setToast(null);
4542
+ },
4543
+ style: {
4544
+ maxWidth: "670px"
4545
+ }
4546
+ }), openUploadSlide == true ? /*#__PURE__*/React__default.createElement(UploadDrawer, {
4547
+ setProfilePic: setFileStoreId,
4548
+ closeDrawer: closeFileUploadDrawer,
4549
+ userType: userType,
4550
+ removeProfilePic: removeProfilePic,
4551
+ showToast: showToast
4552
+ }) : "");
4553
+ };
4554
+
4555
+ var EmployeeApp = function EmployeeApp(_ref) {
4556
+ var _location$pathname, _location$pathname2, _window, _window$globalConfigs, _window$globalConfigs2;
4557
+
4558
+ var stateInfo = _ref.stateInfo,
4559
+ userDetails = _ref.userDetails,
4560
+ CITIZEN = _ref.CITIZEN,
4561
+ cityDetails = _ref.cityDetails,
4562
+ mobileView = _ref.mobileView,
4563
+ handleUserDropdownSelection = _ref.handleUserDropdownSelection,
4564
+ logoUrl = _ref.logoUrl,
4565
+ DSO = _ref.DSO,
4566
+ stateCode = _ref.stateCode,
4567
+ modules = _ref.modules,
4568
+ appTenants = _ref.appTenants;
4569
+
4570
+ var _useTranslation = reactI18next.useTranslation(),
4571
+ t = _useTranslation.t;
4572
+
4573
+ var _useRouteMatch = reactRouterDom.useRouteMatch(),
4574
+ path = _useRouteMatch.path;
4575
+
4576
+ var location = reactRouterDom.useLocation();
4577
+ var showLanguageChange = location === null || location === void 0 ? void 0 : (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : _location$pathname.includes("language-selection");
4578
+ var isUserProfile = location === null || location === void 0 ? void 0 : (_location$pathname2 = location.pathname) === null || _location$pathname2 === void 0 ? void 0 : _location$pathname2.includes("user/profile");
4579
+ React.useEffect(function () {
4580
+ Digit.UserService.setType("employee");
4581
+ }, []);
4582
+ return /*#__PURE__*/React__default.createElement("div", {
4583
+ className: "employee"
4584
+ }, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
4585
+ path: path + "/user"
4586
+ }, isUserProfile && /*#__PURE__*/React__default.createElement(TopBarSideBar, {
4587
+ t: t,
4588
+ stateInfo: stateInfo,
4589
+ userDetails: userDetails,
3169
4590
  CITIZEN: CITIZEN,
3170
4591
  cityDetails: cityDetails,
3171
4592
  mobileView: mobileView,
3172
4593
  handleUserDropdownSelection: handleUserDropdownSelection,
3173
4594
  logoUrl: logoUrl,
3174
- showSidebar: false,
4595
+ showSidebar: isUserProfile ? true : false,
3175
4596
  showLanguageChange: !showLanguageChange
3176
4597
  }), /*#__PURE__*/React__default.createElement("div", {
3177
- className: "loginContainer",
3178
- style: {
3179
- "--banner-url": "url(" + (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl) + ")"
4598
+ className: isUserProfile ? "grounded-container" : "loginContainer",
4599
+ style: isUserProfile ? {
4600
+ padding: 0,
4601
+ paddingTop: "80px",
4602
+ marginLeft: mobileView ? "" : "64px"
4603
+ } : {
4604
+ "--banner-url": "url(" + (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl) + ")",
4605
+ padding: "0px"
3180
4606
  }
3181
4607
  }, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
3182
4608
  path: path + "/user/login"
@@ -3184,7 +4610,13 @@ var EmployeeApp = function EmployeeApp(_ref) {
3184
4610
  path: path + "/user/forgot-password"
3185
4611
  }, /*#__PURE__*/React__default.createElement(EmployeeForgotPassword, null)), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
3186
4612
  path: path + "/user/change-password"
3187
- }, " ", /*#__PURE__*/React__default.createElement(EmployeeChangePassword, null)), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
4613
+ }, /*#__PURE__*/React__default.createElement(EmployeeChangePassword, null)), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
4614
+ path: path + "/user/profile"
4615
+ }, /*#__PURE__*/React__default.createElement(UserProfile, {
4616
+ stateCode: stateCode,
4617
+ userType: "employee",
4618
+ cityDetails: cityDetails
4619
+ })), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
3188
4620
  path: path + "/user/language-selection"
3189
4621
  }, /*#__PURE__*/React__default.createElement(LanguageSelection, null)), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
3190
4622
  to: path + "/user/language-selection"
@@ -3199,13 +4631,18 @@ var EmployeeApp = function EmployeeApp(_ref) {
3199
4631
  logoUrl: logoUrl
3200
4632
  }), /*#__PURE__*/React__default.createElement("div", {
3201
4633
  className: "main " + (DSO ? "m-auto" : "")
3202
- }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(AppModules, {
4634
+ }, /*#__PURE__*/React__default.createElement("div", {
4635
+ className: "employee-app-wrapper"
4636
+ }, /*#__PURE__*/React__default.createElement(ErrorBoundary, null, /*#__PURE__*/React__default.createElement(AppModules, {
3203
4637
  stateCode: stateCode,
3204
4638
  userType: "employee",
3205
4639
  modules: modules,
3206
4640
  appTenants: appTenants
3207
- })), /*#__PURE__*/React__default.createElement("div", {
3208
- className: "employee-home-footer"
4641
+ }))), /*#__PURE__*/React__default.createElement("div", {
4642
+ className: "employee-home-footer",
4643
+ style: {
4644
+ position: "absolute"
4645
+ }
3209
4646
  }, /*#__PURE__*/React__default.createElement("img", {
3210
4647
  alt: "Powered by DIGIT",
3211
4648
  src: (_window = window) === null || _window === void 0 ? void 0 : (_window$globalConfigs = _window.globalConfigs) === null || _window$globalConfigs === void 0 ? void 0 : (_window$globalConfigs2 = _window$globalConfigs.getConfig) === null || _window$globalConfigs2 === void 0 ? void 0 : _window$globalConfigs2.call(_window$globalConfigs, "DIGIT_FOOTER"),
@@ -3223,148 +4660,6 @@ var EmployeeApp = function EmployeeApp(_ref) {
3223
4660
  }))));
3224
4661
  };
3225
4662
 
3226
- var Home = function Home() {
3227
- var _Digit$SessionStorage;
3228
-
3229
- var _useTranslation = reactI18next.useTranslation(),
3230
- t = _useTranslation.t;
3231
-
3232
- var history = reactRouterDom.useHistory();
3233
- var tenantId = (_Digit$SessionStorage = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.code;
3234
-
3235
- var _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData(),
3236
- _Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data;
3237
-
3238
- _Digit$Hooks$useStore2 = _Digit$Hooks$useStore2 === void 0 ? {} : _Digit$Hooks$useStore2;
3239
- var stateInfo = _Digit$Hooks$useStore2.stateInfo,
3240
- isLoading = _Digit$Hooks$useStore.isLoading;
3241
-
3242
- var conditionsToDisableNotificationCountTrigger = function conditionsToDisableNotificationCountTrigger() {
3243
- var _Digit$UserService, _Digit$UserService$ge, _Digit$UserService$ge2, _Digit$UserService2, _Digit$UserService2$g;
3244
-
3245
- if (((_Digit$UserService = Digit.UserService) === null || _Digit$UserService === void 0 ? void 0 : (_Digit$UserService$ge = _Digit$UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.type) === "EMPLOYEE") return false;
3246
- if (!((_Digit$UserService2 = Digit.UserService) !== null && _Digit$UserService2 !== void 0 && (_Digit$UserService2$g = _Digit$UserService2.getUser()) !== null && _Digit$UserService2$g !== void 0 && _Digit$UserService2$g.access_token)) return false;
3247
- return true;
3248
- };
3249
-
3250
- var _Digit$Hooks$useEvent = Digit.Hooks.useEvents({
3251
- tenantId: tenantId,
3252
- variant: "whats-new",
3253
- config: {
3254
- enabled: conditionsToDisableNotificationCountTrigger()
3255
- }
3256
- }),
3257
- EventsData = _Digit$Hooks$useEvent.data,
3258
- EventsDataLoading = _Digit$Hooks$useEvent.isLoading;
3259
-
3260
- if (!tenantId) {
3261
- history.push("/digit-ui/citizen/select-language");
3262
- }
3263
-
3264
- var allCitizenServicesProps = {
3265
- header: t("DASHBOARD_CITIZEN_SERVICES_LABEL"),
3266
- sideOption: {
3267
- name: t("DASHBOARD_VIEW_ALL_LABEL"),
3268
- onClick: function onClick() {
3269
- return history.push("/digit-ui/citizen/all-services");
3270
- }
3271
- },
3272
- options: [{
3273
- name: t("ES_PGR_HEADER_COMPLAINT"),
3274
- Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.ComplaintIcon, null),
3275
- onClick: function onClick() {
3276
- return history.push("/digit-ui/citizen/pgr-home");
3277
- }
3278
- }, {
3279
- name: t("MODULE_PT"),
3280
- Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.PTIcon, {
3281
- className: "fill-path-primary-main"
3282
- }),
3283
- onClick: function onClick() {
3284
- return history.push("/digit-ui/citizen/pt-home");
3285
- }
3286
- }, {
3287
- name: t("MODULE_TL"),
3288
- Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.CaseIcon, {
3289
- className: "fill-path-primary-main"
3290
- }),
3291
- onClick: function onClick() {
3292
- return history.push("/digit-ui/citizen/tl-home");
3293
- }
3294
- }, {
3295
- name: t("CS_COMMON_INBOX_BPA"),
3296
- Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.OBPSIcon, null),
3297
- onClick: function onClick() {
3298
- return history.push("/digit-ui/citizen/obps-home");
3299
- }
3300
- }],
3301
- styles: {
3302
- display: "flex",
3303
- flexWrap: "wrap",
3304
- justifyContent: "flex-start",
3305
- width: "100%"
3306
- }
3307
- };
3308
- var allInfoAndUpdatesProps = {
3309
- header: t("CS_COMMON_DASHBOARD_INFO_UPDATES"),
3310
- sideOption: {
3311
- name: t("DASHBOARD_VIEW_ALL_LABEL"),
3312
- onClick: function onClick() {
3313
- return console.debug("view all");
3314
- }
3315
- },
3316
- options: [{
3317
- name: t("CS_HEADER_MYCITY"),
3318
- Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.HomeIcon, null)
3319
- }, {
3320
- name: t("EVENTS_EVENTS_HEADER"),
3321
- Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.Calender, null),
3322
- onClick: function onClick() {
3323
- return history.push("/digit-ui/citizen/engagement/events");
3324
- }
3325
- }, {
3326
- name: t("CS_COMMON_DOCUMENTS"),
3327
- Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.DocumentIcon, null),
3328
- onClick: function onClick() {
3329
- return history.push("/digit-ui/citizen/engagement/docs");
3330
- }
3331
- }, {
3332
- name: t("CS_COMMON_SURVEYS"),
3333
- Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.DocumentIcon, null),
3334
- onClick: function onClick() {
3335
- return history.push("/digit-ui/citizen/engagement/SurveyList");
3336
- }
3337
- }],
3338
- styles: {
3339
- display: "flex",
3340
- flexWrap: "wrap",
3341
- justifyContent: "flex-start",
3342
- width: "100%"
3343
- }
3344
- };
3345
- return isLoading ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null) : /*#__PURE__*/React__default.createElement("div", {
3346
- className: "HomePageWrapper"
3347
- }, /*#__PURE__*/React__default.createElement("div", {
3348
- className: "BannerWithSearch"
3349
- }, /*#__PURE__*/React__default.createElement("img", {
3350
- src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl
3351
- }), /*#__PURE__*/React__default.createElement("div", {
3352
- className: "Search"
3353
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.StandaloneSearchBar, {
3354
- placeholder: t("CS_COMMON_SEARCH_PLACEHOLDER")
3355
- }))), /*#__PURE__*/React__default.createElement("div", {
3356
- className: "ServicesSection"
3357
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardBasedOptions, allCitizenServicesProps), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardBasedOptions, allInfoAndUpdatesProps)), conditionsToDisableNotificationCountTrigger() ? EventsDataLoading ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null) : /*#__PURE__*/React__default.createElement("div", {
3358
- className: "WhatsNewSection"
3359
- }, /*#__PURE__*/React__default.createElement("div", {
3360
- className: "headSection"
3361
- }, /*#__PURE__*/React__default.createElement("h2", null, t("DASHBOARD_WHATS_NEW_LABEL")), /*#__PURE__*/React__default.createElement("p", {
3362
- onClick: function onClick() {
3363
- return history.push("/digit-ui/citizen/engagement/whats-new");
3364
- }
3365
- }, t("DASHBOARD_VIEW_ALL_LABEL"))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.WhatsNewCard, EventsData === null || EventsData === void 0 ? void 0 : EventsData[0])) : null);
3366
- };
3367
-
3368
4663
  var LanguageSelection$1 = function LanguageSelection() {
3369
4664
  var _useTranslation = reactI18next.useTranslation(),
3370
4665
  t = _useTranslation.t;
@@ -3420,7 +4715,9 @@ var LocationSelection = function LocationSelection() {
3420
4715
  isLoading = _Digit$Hooks$useTenan.isLoading;
3421
4716
 
3422
4717
  var _useState = React.useState(function () {
3423
- return Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY");
4718
+ return {
4719
+ code: Digit.ULBService.getCitizenCurrentTenant(true)
4720
+ };
3424
4721
  }),
3425
4722
  selectedCity = _useState[0],
3426
4723
  setSelectedCity = _useState[1];
@@ -3476,7 +4773,7 @@ var getTenants$1 = function getTenants(codes, tenants) {
3476
4773
  });
3477
4774
  };
3478
4775
 
3479
- var Home$1 = function Home$1(_ref) {
4776
+ var Home = function Home(_ref) {
3480
4777
  var _window, _window$globalConfigs, _window$globalConfigs2;
3481
4778
 
3482
4779
  var stateInfo = _ref.stateInfo,
@@ -3526,7 +4823,8 @@ var Home$1 = function Home$1(_ref) {
3526
4823
  }, /*#__PURE__*/React__default.createElement("div", {
3527
4824
  className: "moduleLinkHomePage"
3528
4825
  }, /*#__PURE__*/React__default.createElement("img", {
3529
- src: bannerImage || (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl)
4826
+ src: bannerImage || (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl),
4827
+ alt: "noimagefound"
3530
4828
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.BackButton, {
3531
4829
  className: "moduleLinkHomePageBackButton"
3532
4830
  }), /*#__PURE__*/React__default.createElement("h1", null, t("MODULE_" + code.toUpperCase()))), /*#__PURE__*/React__default.createElement("div", {
@@ -3547,13 +4845,17 @@ var Home$1 = function Home$1(_ref) {
3547
4845
  cityDetails: cityDetails,
3548
4846
  mobileView: mobileView,
3549
4847
  handleUserDropdownSelection: handleUserDropdownSelection,
3550
- logoUrl: logoUrl
4848
+ logoUrl: logoUrl,
4849
+ showSidebar: true
3551
4850
  }), /*#__PURE__*/React__default.createElement("div", {
3552
4851
  className: "main center-container mb-25"
3553
4852
  }, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
3554
4853
  exact: true,
3555
4854
  path: path
3556
- }, /*#__PURE__*/React__default.createElement(Home, null)), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
4855
+ }, /*#__PURE__*/React__default.createElement(AppHome, {
4856
+ userType: "citizen",
4857
+ modules: modules
4858
+ })), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
3557
4859
  exact: true,
3558
4860
  path: path + "/select-language"
3559
4861
  }, /*#__PURE__*/React__default.createElement(LanguageSelection$1, null)), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
@@ -3566,14 +4868,20 @@ var Home$1 = function Home$1(_ref) {
3566
4868
  modules: modules
3567
4869
  })), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
3568
4870
  path: path + "/login"
3569
- }, " ", /*#__PURE__*/React__default.createElement(Login, {
4871
+ }, /*#__PURE__*/React__default.createElement(Login, {
3570
4872
  stateCode: stateCode
3571
4873
  })), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
3572
4874
  path: path + "/register"
3573
4875
  }, /*#__PURE__*/React__default.createElement(Login, {
3574
4876
  stateCode: stateCode,
3575
4877
  isUserRegistered: false
3576
- })), appRoutes, ModuleLevelLinkHomePages)), /*#__PURE__*/React__default.createElement("div", {
4878
+ })), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
4879
+ path: path + "/user/profile"
4880
+ }, /*#__PURE__*/React__default.createElement(UserProfile, {
4881
+ stateCode: stateCode,
4882
+ userType: "citizen",
4883
+ cityDetails: cityDetails
4884
+ })), /*#__PURE__*/React__default.createElement(ErrorBoundary, null, appRoutes, ModuleLevelLinkHomePages))), /*#__PURE__*/React__default.createElement("div", {
3577
4885
  className: "citizen-home-footer",
3578
4886
  style: window.location.href.includes("citizen/obps") ? {
3579
4887
  zIndex: "-1"
@@ -3615,8 +4923,9 @@ var DigitApp = function DigitApp(_ref) {
3615
4923
  var _ref2 = storeData || {},
3616
4924
  stateInfo = _ref2.stateInfo;
3617
4925
 
3618
- var CITIZEN = (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info = userDetails.info) === null || _userDetails$info === void 0 ? void 0 : _userDetails$info.type) === "CITIZEN" || !window.location.pathname.split("/").includes("employee") ? true : false;
3619
4926
  var DSO = Digit.UserService.hasAccess(["FSM_DSO"]);
4927
+ var CITIZEN = (userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info = userDetails.info) === null || _userDetails$info === void 0 ? void 0 : _userDetails$info.type) === "CITIZEN" || !window.location.pathname.split("/").includes("employee") ? true : false;
4928
+ if (window.location.pathname.split("/").includes("employee")) CITIZEN = false;
3620
4929
  React.useEffect(function () {
3621
4930
  if (!(pathname !== null && pathname !== void 0 && pathname.includes("application-details"))) {
3622
4931
  if (!(pathname !== null && pathname !== void 0 && pathname.includes("inbox"))) {
@@ -3667,7 +4976,7 @@ var DigitApp = function DigitApp(_ref) {
3667
4976
  path: "/digit-ui/employee"
3668
4977
  }, /*#__PURE__*/React__default.createElement(EmployeeApp, commonProps)), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
3669
4978
  path: "/digit-ui/citizen"
3670
- }, /*#__PURE__*/React__default.createElement(Home$1, commonProps)), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
4979
+ }, /*#__PURE__*/React__default.createElement(Home, commonProps)), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
3671
4980
  to: "/digit-ui/citizen"
3672
4981
  })));
3673
4982
  };
@@ -3708,55 +5017,6 @@ var getStore = function getStore(defaultStore, moduleReducers) {
3708
5017
  return redux.createStore(getRootReducer(defaultStore, moduleReducers), enhancer);
3709
5018
  };
3710
5019
 
3711
- var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
3712
- _inheritsLoose(ErrorBoundary, _React$Component);
3713
-
3714
- function ErrorBoundary(props) {
3715
- var _this;
3716
-
3717
- _this = _React$Component.call(this, props) || this;
3718
- _this.state = {
3719
- error: null,
3720
- errorStack: null,
3721
- hasError: false
3722
- };
3723
- return _this;
3724
- }
3725
-
3726
- ErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError(error) {
3727
- return {
3728
- error: error === null || error === void 0 ? void 0 : error.message,
3729
- hasError: true,
3730
- errorStack: error === null || error === void 0 ? void 0 : error.stack
3731
- };
3732
- };
3733
-
3734
- var _proto = ErrorBoundary.prototype;
3735
-
3736
- _proto.componentDidCatch = function componentDidCatch(error, errorInfo) {
3737
- this.setState({
3738
- error: error === null || error === void 0 ? void 0 : error.message,
3739
- hasError: true,
3740
- errorStack: error === null || error === void 0 ? void 0 : error.stack
3741
- });
3742
- };
3743
-
3744
- _proto.render = function render() {
3745
- if (this.state.hasError) {
3746
- var _this$state, _this$state2;
3747
-
3748
- console.error("UI-error", (_this$state = this.state) === null || _this$state === void 0 ? void 0 : _this$state.error);
3749
- console.error("UI-errorInfo", (_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.errorStack);
3750
- console.error("UI-component-details", this.props);
3751
- return /*#__PURE__*/React__default.createElement("h1", null, "Something went wrong.");
3752
- }
3753
-
3754
- return this.props.children;
3755
- };
3756
-
3757
- return ErrorBoundary;
3758
- }(React__default.Component);
3759
-
3760
5020
  var DigitUIWrapper = function DigitUIWrapper(_ref) {
3761
5021
  var _initData$stateInfo;
3762
5022
 
@@ -3796,7 +5056,10 @@ var DigitUI = function DigitUI(_ref2) {
3796
5056
  defaultOptions: {
3797
5057
  queries: {
3798
5058
  staleTime: 15 * 60 * 1000,
3799
- cacheTime: 30 * 60 * 1000
5059
+ cacheTime: 50 * 60 * 1000,
5060
+ retryDelay: function retryDelay(attemptIndex) {
5061
+ return Infinity;
5062
+ }
3800
5063
  }
3801
5064
  }
3802
5065
  });
@@ -3812,7 +5075,9 @@ var DigitUI = function DigitUI(_ref2) {
3812
5075
  moduleReducers: moduleReducers
3813
5076
  })))));
3814
5077
  };
3815
- var componentsToRegister = {};
5078
+ var componentsToRegister = {
5079
+ SelectOtp: SelectOtp
5080
+ };
3816
5081
  var initCoreComponents = function initCoreComponents() {
3817
5082
  Object.entries(componentsToRegister).forEach(function (_ref3) {
3818
5083
  var key = _ref3[0],