UNPKG

@egovernments/digit-ui-module-core

Version:

## Version: 1.9.0 **Release Date:** October 23, 2025

19,901 lines 1.01 MB
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("@egovernments/digit-ui-components"), require("React"), require("react-i18next"), require("@tanstack/react-query"), require("react-redux"), require("react-router-dom"), require("@egovernments/digit-ui-svg-components"), require("@egovernments/digit-ui-react-components"), require("redux"), require("redux-thunk"));
	else if(typeof define === 'function' && define.amd)
		define(["@egovernments/digit-ui-components", "React", "react-i18next", "@tanstack/react-query", "react-redux", "react-router-dom", "@egovernments/digit-ui-svg-components", "@egovernments/digit-ui-react-components", "redux", "redux-thunk"], factory);
	else if(typeof exports === 'object')
		exports["@egovernments/digit-ui-module-core"] = factory(require("@egovernments/digit-ui-components"), require("React"), require("react-i18next"), require("@tanstack/react-query"), require("react-redux"), require("react-router-dom"), require("@egovernments/digit-ui-svg-components"), require("@egovernments/digit-ui-react-components"), require("redux"), require("redux-thunk"));
	else
		root["@egovernments/digit-ui-module-core"] = factory(root["@egovernments/digit-ui-components"], root["React"], root["react-i18next"], root["@tanstack/react-query"], root["react-redux"], root["react-router-dom"], root["@egovernments/digit-ui-svg-components"], root["@egovernments/digit-ui-react-components"], root["redux"], root["redux-thunk"]);
})(this, (__WEBPACK_EXTERNAL_MODULE__egovernments_digit_ui_components__, __WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_i18next__, __WEBPACK_EXTERNAL_MODULE__tanstack_react_query__, __WEBPACK_EXTERNAL_MODULE_react_redux__, __WEBPACK_EXTERNAL_MODULE_react_router_dom__, __WEBPACK_EXTERNAL_MODULE__egovernments_digit_ui_svg_components__, __WEBPACK_EXTERNAL_MODULE__egovernments_digit_ui_react_components__, __WEBPACK_EXTERNAL_MODULE_redux__, __WEBPACK_EXTERNAL_MODULE_redux_thunk__) => {
return /******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "../../../node_modules/css-mediaquery/index.js":
/*!*****************************************************!*\
  !*** ../../../node_modules/css-mediaquery/index.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
var __webpack_unused_export__;
/*
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
Copyrights licensed under the New BSD License.
See the accompanying LICENSE file for terms.
*/



exports.match = matchQuery;
__webpack_unused_export__ = parseQuery;

// -----------------------------------------------------------------------------

var RE_MEDIA_QUERY     = /(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,
    RE_MQ_EXPRESSION   = /\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,
    RE_MQ_FEATURE      = /^(?:(min|max)-)?(.+)/,
    RE_LENGTH_UNIT     = /(em|rem|px|cm|mm|in|pt|pc)?$/,
    RE_RESOLUTION_UNIT = /(dpi|dpcm|dppx)?$/;

function matchQuery(mediaQuery, values) {
    return parseQuery(mediaQuery).some(function (query) {
        var inverse = query.inverse;

        // Either the parsed or specified `type` is "all", or the types must be
        // equal for a match.
        var typeMatch = query.type === 'all' || values.type === query.type;

        // Quit early when `type` doesn't match, but take "not" into account.
        if ((typeMatch && inverse) || !(typeMatch || inverse)) {
            return false;
        }

        var expressionsMatch = query.expressions.every(function (expression) {
            var feature  = expression.feature,
                modifier = expression.modifier,
                expValue = expression.value,
                value    = values[feature];

            // Missing or falsy values don't match.
            if (!value) { return false; }

            switch (feature) {
                case 'orientation':
                case 'scan':
                    return value.toLowerCase() === expValue.toLowerCase();

                case 'width':
                case 'height':
                case 'device-width':
                case 'device-height':
                    expValue = toPx(expValue);
                    value    = toPx(value);
                    break;

                case 'resolution':
                    expValue = toDpi(expValue);
                    value    = toDpi(value);
                    break;

                case 'aspect-ratio':
                case 'device-aspect-ratio':
                case /* Deprecated */ 'device-pixel-ratio':
                    expValue = toDecimal(expValue);
                    value    = toDecimal(value);
                    break;

                case 'grid':
                case 'color':
                case 'color-index':
                case 'monochrome':
                    expValue = parseInt(expValue, 10) || 1;
                    value    = parseInt(value, 10) || 0;
                    break;
            }

            switch (modifier) {
                case 'min': return value >= expValue;
                case 'max': return value <= expValue;
                default   : return value === expValue;
            }
        });

        return (expressionsMatch && !inverse) || (!expressionsMatch && inverse);
    });
}

function parseQuery(mediaQuery) {
    return mediaQuery.split(',').map(function (query) {
        query = query.trim();

        var captures    = query.match(RE_MEDIA_QUERY),
            modifier    = captures[1],
            type        = captures[2],
            expressions = captures[3] || '',
            parsed      = {};

        parsed.inverse = !!modifier && modifier.toLowerCase() === 'not';
        parsed.type    = type ? type.toLowerCase() : 'all';

        // Split expressions into a list.
        expressions = expressions.match(/\([^\)]+\)/g) || [];

        parsed.expressions = expressions.map(function (expression) {
            var captures = expression.match(RE_MQ_EXPRESSION),
                feature  = captures[1].toLowerCase().match(RE_MQ_FEATURE);

            return {
                modifier: feature[1],
                feature : feature[2],
                value   : captures[2]
            };
        });

        return parsed;
    });
}

// -- Utilities ----------------------------------------------------------------

function toDecimal(ratio) {
    var decimal = Number(ratio),
        numbers;

    if (!decimal) {
        numbers = ratio.match(/^(\d+)\s*\/\s*(\d+)$/);
        decimal = numbers[1] / numbers[2];
    }

    return decimal;
}

function toDpi(resolution) {
    var value = parseFloat(resolution),
        units = String(resolution).match(RE_RESOLUTION_UNIT)[1];

    switch (units) {
        case 'dpcm': return value / 2.54;
        case 'dppx': return value * 96;
        default    : return value;
    }
}

function toPx(length) {
    var value = parseFloat(length),
        units = String(length).match(RE_LENGTH_UNIT)[1];

    switch (units) {
        case 'em' : return value * 16;
        case 'rem': return value * 16;
        case 'cm' : return value * 96 / 2.54;
        case 'mm' : return value * 96 / 2.54 / 10;
        case 'in' : return value * 96;
        case 'pt' : return value * 72;
        case 'pc' : return value * 72 / 12;
        default   : return value;
    }
}


/***/ }),

/***/ "../../../node_modules/hyphenate-style-name/index.js":
/*!***********************************************************!*\
  !*** ../../../node_modules/hyphenate-style-name/index.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* eslint-disable no-var, prefer-template */
var uppercasePattern = /[A-Z]/g
var msPattern = /^ms-/
var cache = {}

function toHyphenLower(match) {
  return '-' + match.toLowerCase()
}

function hyphenateStyleName(name) {
  if (cache.hasOwnProperty(name)) {
    return cache[name]
  }

  var hName = name.replace(uppercasePattern, toHyphenLower)
  return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hyphenateStyleName);


/***/ }),

/***/ "../../../node_modules/matchmediaquery/index.js":
/*!******************************************************!*\
  !*** ../../../node_modules/matchmediaquery/index.js ***!
  \******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var staticMatch = (__webpack_require__(/*! css-mediaquery */ "../../../node_modules/css-mediaquery/index.js").match);
var dynamicMatch = typeof window !== 'undefined' ? window.matchMedia : null;

// our fake MediaQueryList
function Mql(query, values, forceStatic){
  var self = this;
  var mql;

  // matchMedia will return null in FF when it's called in a hidden iframe
  // ref: https://stackoverflow.com/a/12330568
  if(dynamicMatch && !forceStatic) mql = dynamicMatch.call(window, query);

  if (mql) {
    this.matches = mql.matches;
    this.media = mql.media;
    // TODO: is there a time it makes sense to remove this listener?
    mql.addListener(update);
  } else {
    this.matches = staticMatch(query, values);
    this.media = query;
  }

  this.addListener = addListener;
  this.removeListener = removeListener;
  this.dispose = dispose;

  function addListener(listener){
    if(mql){
      mql.addListener(listener);
    }
  }

  function removeListener(listener){
    if(mql){
      mql.removeListener(listener);
    }
  }

  // update ourselves!
  function update(evt){
    self.matches = evt.matches;
    self.media = evt.media;
  }

  function dispose(){
    if(mql){
      mql.removeListener(update);
    }
  }
}

function matchMedia(query, values, forceStatic){
  return new Mql(query, values, forceStatic);
}

module.exports = matchMedia;


/***/ }),

/***/ "../../../node_modules/object-assign/index.js":
/*!****************************************************!*\
  !*** ../../../node_modules/object-assign/index.js ***!
  \****************************************************/
/***/ ((module) => {

"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/


/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;

function toObject(val) {
	if (val === null || val === undefined) {
		throw new TypeError('Object.assign cannot be called with null or undefined');
	}

	return Object(val);
}

function shouldUseNative() {
	try {
		if (!Object.assign) {
			return false;
		}

		// Detect buggy property enumeration order in older V8 versions.

		// https://bugs.chromium.org/p/v8/issues/detail?id=4118
		var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
		test1[5] = 'de';
		if (Object.getOwnPropertyNames(test1)[0] === '5') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test2 = {};
		for (var i = 0; i < 10; i++) {
			test2['_' + String.fromCharCode(i)] = i;
		}
		var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
			return test2[n];
		});
		if (order2.join('') !== '0123456789') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test3 = {};
		'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
			test3[letter] = letter;
		});
		if (Object.keys(Object.assign({}, test3)).join('') !==
				'abcdefghijklmnopqrst') {
			return false;
		}

		return true;
	} catch (err) {
		// We don't expect any of the above to throw, but better to be safe.
		return false;
	}
}

module.exports = shouldUseNative() ? Object.assign : function (target, source) {
	var from;
	var to = toObject(target);
	var symbols;

	for (var s = 1; s < arguments.length; s++) {
		from = Object(arguments[s]);

		for (var key in from) {
			if (hasOwnProperty.call(from, key)) {
				to[key] = from[key];
			}
		}

		if (getOwnPropertySymbols) {
			symbols = getOwnPropertySymbols(from);
			for (var i = 0; i < symbols.length; i++) {
				if (propIsEnumerable.call(from, symbols[i])) {
					to[symbols[i]] = from[symbols[i]];
				}
			}
		}
	}

	return to;
};


/***/ }),

/***/ "../../../node_modules/prop-types/checkPropTypes.js":
/*!**********************************************************!*\
  !*** ../../../node_modules/prop-types/checkPropTypes.js ***!
  \**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var printWarning = function() {};

if (true) {
  var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../../../node_modules/prop-types/lib/ReactPropTypesSecret.js");
  var loggedTypeFailures = {};
  var has = __webpack_require__(/*! ./lib/has */ "../../../node_modules/prop-types/lib/has.js");

  printWarning = function(text) {
    var message = 'Warning: ' + text;
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) { /**/ }
  };
}

/**
 * Assert that the values match with the type specs.
 * Error messages are memorized and will only be shown once.
 *
 * @param {object} typeSpecs Map of name to a ReactPropType
 * @param {object} values Runtime values that need to be type-checked
 * @param {string} location e.g. "prop", "context", "child context"
 * @param {string} componentName Name of the component for error messages.
 * @param {?Function} getStack Returns the component stack.
 * @private
 */
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  if (true) {
    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error;
        // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.
        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error(
              (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
              'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
              'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
            );
            err.name = 'Invariant Violation';
            throw err;
          }
          error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
        } catch (ex) {
          error = ex;
        }
        if (error && !(error instanceof Error)) {
          printWarning(
            (componentName || 'React class') + ': type specification of ' +
            location + ' `' + typeSpecName + '` is invalid; the type checker ' +
            'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
            'You may have forgotten to pass an argument to the type checker ' +
            'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
            'shape all require an argument).'
          );
        }
        if (error instanceof Error && !(error.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error.message] = true;

          var stack = getStack ? getStack() : '';

          printWarning(
            'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
          );
        }
      }
    }
  }
}

/**
 * Resets warning cache when testing.
 *
 * @private
 */
checkPropTypes.resetWarningCache = function() {
  if (true) {
    loggedTypeFailures = {};
  }
}

module.exports = checkPropTypes;


/***/ }),

/***/ "../../../node_modules/prop-types/factoryWithTypeCheckers.js":
/*!*******************************************************************!*\
  !*** ../../../node_modules/prop-types/factoryWithTypeCheckers.js ***!
  \*******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var ReactIs = __webpack_require__(/*! react-is */ "../../../node_modules/react-is/index.js");
var assign = __webpack_require__(/*! object-assign */ "../../../node_modules/object-assign/index.js");

var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../../../node_modules/prop-types/lib/ReactPropTypesSecret.js");
var has = __webpack_require__(/*! ./lib/has */ "../../../node_modules/prop-types/lib/has.js");
var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../../../node_modules/prop-types/checkPropTypes.js");

var printWarning = function() {};

if (true) {
  printWarning = function(text) {
    var message = 'Warning: ' + text;
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };
}

function emptyFunctionThatReturnsNull() {
  return null;
}

module.exports = function(isValidElement, throwOnDirectAccess) {
  /* global Symbol */
  var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.

  /**
   * Returns the iterator method function contained on the iterable object.
   *
   * Be sure to invoke the function with the iterable as context:
   *
   *     var iteratorFn = getIteratorFn(myIterable);
   *     if (iteratorFn) {
   *       var iterator = iteratorFn.call(myIterable);
   *       ...
   *     }
   *
   * @param {?object} maybeIterable
   * @return {?function}
   */
  function getIteratorFn(maybeIterable) {
    var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
    if (typeof iteratorFn === 'function') {
      return iteratorFn;
    }
  }

  /**
   * Collection of methods that allow declaration and validation of props that are
   * supplied to React components. Example usage:
   *
   *   var Props = require('ReactPropTypes');
   *   var MyArticle = React.createClass({
   *     propTypes: {
   *       // An optional string prop named "description".
   *       description: Props.string,
   *
   *       // A required enum prop named "category".
   *       category: Props.oneOf(['News','Photos']).isRequired,
   *
   *       // A prop named "dialog" that requires an instance of Dialog.
   *       dialog: Props.instanceOf(Dialog).isRequired
   *     },
   *     render: function() { ... }
   *   });
   *
   * A more formal specification of how these methods are used:
   *
   *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
   *   decl := ReactPropTypes.{type}(.isRequired)?
   *
   * Each and every declaration produces a function with the same signature. This
   * allows the creation of custom validation functions. For example:
   *
   *  var MyLink = React.createClass({
   *    propTypes: {
   *      // An optional string or URI prop named "href".
   *      href: function(props, propName, componentName) {
   *        var propValue = props[propName];
   *        if (propValue != null && typeof propValue !== 'string' &&
   *            !(propValue instanceof URI)) {
   *          return new Error(
   *            'Expected a string or an URI for ' + propName + ' in ' +
   *            componentName
   *          );
   *        }
   *      }
   *    },
   *    render: function() {...}
   *  });
   *
   * @internal
   */

  var ANONYMOUS = '<<anonymous>>';

  // Important!
  // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
  var ReactPropTypes = {
    array: createPrimitiveTypeChecker('array'),
    bigint: createPrimitiveTypeChecker('bigint'),
    bool: createPrimitiveTypeChecker('boolean'),
    func: createPrimitiveTypeChecker('function'),
    number: createPrimitiveTypeChecker('number'),
    object: createPrimitiveTypeChecker('object'),
    string: createPrimitiveTypeChecker('string'),
    symbol: createPrimitiveTypeChecker('symbol'),

    any: createAnyTypeChecker(),
    arrayOf: createArrayOfTypeChecker,
    element: createElementTypeChecker(),
    elementType: createElementTypeTypeChecker(),
    instanceOf: createInstanceTypeChecker,
    node: createNodeChecker(),
    objectOf: createObjectOfTypeChecker,
    oneOf: createEnumTypeChecker,
    oneOfType: createUnionTypeChecker,
    shape: createShapeTypeChecker,
    exact: createStrictShapeTypeChecker,
  };

  /**
   * inlined Object.is polyfill to avoid requiring consumers ship their own
   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
   */
  /*eslint-disable no-self-compare*/
  function is(x, y) {
    // SameValue algorithm
    if (x === y) {
      // Steps 1-5, 7-10
      // Steps 6.b-6.e: +0 != -0
      return x !== 0 || 1 / x === 1 / y;
    } else {
      // Step 6.a: NaN == NaN
      return x !== x && y !== y;
    }
  }
  /*eslint-enable no-self-compare*/

  /**
   * We use an Error-like object for backward compatibility as people may call
   * PropTypes directly and inspect their output. However, we don't use real
   * Errors anymore. We don't inspect their stack anyway, and creating them
   * is prohibitively expensive if they are created too often, such as what
   * happens in oneOfType() for any type before the one that matched.
   */
  function PropTypeError(message, data) {
    this.message = message;
    this.data = data && typeof data === 'object' ? data: {};
    this.stack = '';
  }
  // Make `instanceof Error` still work for returned errors.
  PropTypeError.prototype = Error.prototype;

  function createChainableTypeChecker(validate) {
    if (true) {
      var manualPropTypeCallCache = {};
      var manualPropTypeWarningCount = 0;
    }
    function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
      componentName = componentName || ANONYMOUS;
      propFullName = propFullName || propName;

      if (secret !== ReactPropTypesSecret) {
        if (throwOnDirectAccess) {
          // New behavior only for users of `prop-types` package
          var err = new Error(
            'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
            'Use `PropTypes.checkPropTypes()` to call them. ' +
            'Read more at http://fb.me/use-check-prop-types'
          );
          err.name = 'Invariant Violation';
          throw err;
        } else if ( true && typeof console !== 'undefined') {
          // Old behavior for people using React.PropTypes
          var cacheKey = componentName + ':' + propName;
          if (
            !manualPropTypeCallCache[cacheKey] &&
            // Avoid spamming the console because they are often not actionable except for lib authors
            manualPropTypeWarningCount < 3
          ) {
            printWarning(
              'You are manually calling a React.PropTypes validation ' +
              'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
              'and will throw in the standalone `prop-types` package. ' +
              'You may be seeing this warning due to a third-party PropTypes ' +
              'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
            );
            manualPropTypeCallCache[cacheKey] = true;
            manualPropTypeWarningCount++;
          }
        }
      }
      if (props[propName] == null) {
        if (isRequired) {
          if (props[propName] === null) {
            return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
          }
          return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
        }
        return null;
      } else {
        return validate(props, propName, componentName, location, propFullName);
      }
    }

    var chainedCheckType = checkType.bind(null, false);
    chainedCheckType.isRequired = checkType.bind(null, true);

    return chainedCheckType;
  }

  function createPrimitiveTypeChecker(expectedType) {
    function validate(props, propName, componentName, location, propFullName, secret) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== expectedType) {
        // `propValue` being instance of, say, date/regexp, pass the 'object'
        // check, but we can offer a more precise error message here rather than
        // 'of type `object`'.
        var preciseType = getPreciseType(propValue);

        return new PropTypeError(
          'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
          {expectedType: expectedType}
        );
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createAnyTypeChecker() {
    return createChainableTypeChecker(emptyFunctionThatReturnsNull);
  }

  function createArrayOfTypeChecker(typeChecker) {
    function validate(props, propName, componentName, location, propFullName) {
      if (typeof typeChecker !== 'function') {
        return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
      }
      var propValue = props[propName];
      if (!Array.isArray(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
      }
      for (var i = 0; i < propValue.length; i++) {
        var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
        if (error instanceof Error) {
          return error;
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createElementTypeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      if (!isValidElement(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createElementTypeTypeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      if (!ReactIs.isValidElementType(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createInstanceTypeChecker(expectedClass) {
    function validate(props, propName, componentName, location, propFullName) {
      if (!(props[propName] instanceof expectedClass)) {
        var expectedClassName = expectedClass.name || ANONYMOUS;
        var actualClassName = getClassName(props[propName]);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createEnumTypeChecker(expectedValues) {
    if (!Array.isArray(expectedValues)) {
      if (true) {
        if (arguments.length > 1) {
          printWarning(
            'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
            'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
          );
        } else {
          printWarning('Invalid argument supplied to oneOf, expected an array.');
        }
      }
      return emptyFunctionThatReturnsNull;
    }

    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      for (var i = 0; i < expectedValues.length; i++) {
        if (is(propValue, expectedValues[i])) {
          return null;
        }
      }

      var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
        var type = getPreciseType(value);
        if (type === 'symbol') {
          return String(value);
        }
        return value;
      });
      return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
    }
    return createChainableTypeChecker(validate);
  }

  function createObjectOfTypeChecker(typeChecker) {
    function validate(props, propName, componentName, location, propFullName) {
      if (typeof typeChecker !== 'function') {
        return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
      }
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
      }
      for (var key in propValue) {
        if (has(propValue, key)) {
          var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
          if (error instanceof Error) {
            return error;
          }
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createUnionTypeChecker(arrayOfTypeCheckers) {
    if (!Array.isArray(arrayOfTypeCheckers)) {
       true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
      return emptyFunctionThatReturnsNull;
    }

    for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
      var checker = arrayOfTypeCheckers[i];
      if (typeof checker !== 'function') {
        printWarning(
          'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
          'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
        );
        return emptyFunctionThatReturnsNull;
      }
    }

    function validate(props, propName, componentName, location, propFullName) {
      var expectedTypes = [];
      for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
        var checker = arrayOfTypeCheckers[i];
        var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
        if (checkerResult == null) {
          return null;
        }
        if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
          expectedTypes.push(checkerResult.data.expectedType);
        }
      }
      var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
      return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
    }
    return createChainableTypeChecker(validate);
  }

  function createNodeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      if (!isNode(props[propName])) {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function invalidValidatorError(componentName, location, propFullName, key, type) {
    return new PropTypeError(
      (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
      'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
    );
  }

  function createShapeTypeChecker(shapeTypes) {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
      }
      for (var key in shapeTypes) {
        var checker = shapeTypes[key];
        if (typeof checker !== 'function') {
          return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
        }
        var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
        if (error) {
          return error;
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createStrictShapeTypeChecker(shapeTypes) {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
      }
      // We need to check all keys in case some are required but missing from props.
      var allKeys = assign({}, props[propName], shapeTypes);
      for (var key in allKeys) {
        var checker = shapeTypes[key];
        if (has(shapeTypes, key) && typeof checker !== 'function') {
          return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
        }
        if (!checker) {
          return new PropTypeError(
            'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
            '\nBad object: ' + JSON.stringify(props[propName], null, '  ') +
            '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, '  ')
          );
        }
        var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
        if (error) {
          return error;
        }
      }
      return null;
    }

    return createChainableTypeChecker(validate);
  }

  function isNode(propValue) {
    switch (typeof propValue) {
      case 'number':
      case 'string':
      case 'undefined':
        return true;
      case 'boolean':
        return !propValue;
      case 'object':
        if (Array.isArray(propValue)) {
          return propValue.every(isNode);
        }
        if (propValue === null || isValidElement(propValue)) {
          return true;
        }

        var iteratorFn = getIteratorFn(propValue);
        if (iteratorFn) {
          var iterator = iteratorFn.call(propValue);
          var step;
          if (iteratorFn !== propValue.entries) {
            while (!(step = iterator.next()).done) {
              if (!isNode(step.value)) {
                return false;
              }
            }
          } else {
            // Iterator will provide entry [k,v] tuples rather than values.
            while (!(step = iterator.next()).done) {
              var entry = step.value;
              if (entry) {
                if (!isNode(entry[1])) {
                  return false;
                }
              }
            }
          }
        } else {
          return false;
        }

        return true;
      default:
        return false;
    }
  }

  function isSymbol(propType, propValue) {
    // Native Symbol.
    if (propType === 'symbol') {
      return true;
    }

    // falsy value can't be a Symbol
    if (!propValue) {
      return false;
    }

    // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
    if (propValue['@@toStringTag'] === 'Symbol') {
      return true;
    }

    // Fallback for non-spec compliant Symbols which are polyfilled.
    if (typeof Symbol === 'function' && propValue instanceof Symbol) {
      return true;
    }

    return false;
  }

  // Equivalent of `typeof` but with special handling for array and regexp.
  function getPropType(propValue) {
    var propType = typeof propValue;
    if (Array.isArray(propValue)) {
      return 'array';
    }
    if (propValue instanceof RegExp) {
      // Old webkits (at least until Android 4.0) return 'function' rather than
      // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
      // passes PropTypes.object.
      return 'object';
    }
    if (isSymbol(propType, propValue)) {
      return 'symbol';
    }
    return propType;
  }

  // This handles more types than `getPropType`. Only used for error messages.
  // See `createPrimitiveTypeChecker`.
  function getPreciseType(propValue) {
    if (typeof propValue === 'undefined' || propValue === null) {
      return '' + propValue;
    }
    var propType = getPropType(propValue);
    if (propType === 'object') {
      if (propValue instanceof Date) {
        return 'date';
      } else if (propValue instanceof RegExp) {
        return 'regexp';
      }
    }
    return propType;
  }

  // Returns a string that is postfixed to a warning about an invalid type.
  // For example, "undefined" or "of type array"
  function getPostfixForTypeWarning(value) {
    var type = getPreciseType(value);
    switch (type) {
      case 'array':
      case 'object':
        return 'an ' + type;
      case 'boolean':
      case 'date':
      case 'regexp':
        return 'a ' + type;
      default:
        return type;
    }
  }

  // Returns class name of the object, if any.
  function getClassName(propValue) {
    if (!propValue.constructor || !propValue.constructor.name) {
      return ANONYMOUS;
    }
    return propValue.constructor.name;
  }

  ReactPropTypes.checkPropTypes = checkPropTypes;
  ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
  ReactPropTypes.PropTypes = ReactPropTypes;

  return ReactPropTypes;
};


/***/ }),

/***/ "../../../node_modules/prop-types/index.js":
/*!*************************************************!*\
  !*** ../../../node_modules/prop-types/index.js ***!
  \*************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

if (true) {
  var ReactIs = __webpack_require__(/*! react-is */ "../../../node_modules/react-is/index.js");

  // By explicitly using `prop-types` you are opting into new development behavior.
  // http://fb.me/prop-types-in-prod
  var throwOnDirectAccess = true;
  module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../../../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
} else // removed by dead control flow
{}


/***/ }),

/***/ "../../../node_modules/prop-types/lib/ReactPropTypesSecret.js":
/*!********************************************************************!*\
  !*** ../../../node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
  \********************************************************************/
/***/ ((module) => {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';

module.exports = ReactPropTypesSecret;


/***/ }),

/***/ "../../../node_modules/prop-types/lib/has.js":
/*!***************************************************!*\
  !*** ../../../node_modules/prop-types/lib/has.js ***!
  \***************************************************/
/***/ ((module) => {

module.exports = Function.call.bind(Object.prototype.hasOwnProperty);


/***/ }),

/***/ "../../../node_modules/react-hook-form/dist/index.esm.mjs":
/*!****************************************************************!*\
  !*** ../../../node_modules/react-hook-form/dist/index.esm.mjs ***!
  \****************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Controller: () => (/* binding */ Controller),
/* harmony export */   useForm: () => (/* binding */ useForm)
/* harmony export */ });
/* unused harmony exports Form, FormProvider, appendErrors, get, set, useController, useFieldArray, useFormContext, useFormState, useWatch */
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");


var isCheckBoxInput = (element) => element.type === 'checkbox';

var isDateObject = (value) => value instanceof Date;

var isNullOrUndefined = (value) => value == null;

const isObjectType = (value) => typeof value === 'object';
var isObject = (value) => !isNullOrUndefined(value) &&
    !Array.isArray(value) &&
    isObjectType(value) &&
    !isDateObject(value);

var getEventValue = (event) => isObject(event) && event.target
    ? isCheckBoxInput(event.target)
        ? event.target.checked
        : event.target.value
    : event;

var getNodeParentName = (name) => name.substring(0, name.search(/\.\d+(\.|$)/)) || name;

var isNameInFieldArray = (names, name) => names.has(getNodeParentName(name));

var isPlainObject = (tempObject) => {
    const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype;
    return (isObject(prototypeCopy) && prototypeCopy.hasOwnProperty('isPrototypeOf'));
};

var isWeb = typeof window !== 'undefined' &&
    typeof window.HTMLElement !== 'undefined' &&
    typeof document !== 'undefined';

function cloneObject(data) {
    let copy;
    const isArray = Array.isArray(data);
    if (data instanceof Date) {
        copy = new Date(data);
    }
    else if (data instanceof Set) {
        copy = new Set(data);
    }
    else if (!(isWeb && (data instanceof Blob || data instanceof FileList)) &&
        (isArray || isObject(data))) {
        copy = isArray ? [] : {};
        if (!isArray && !isPlainObject(data)) {
            copy = data;
        }
        else {
            for (const key in data) {
                if (data.hasOwnProperty(key)) {
                    copy[key] = cloneObject(data[key]);
                }
            }
        }
    }
    else {
        return data;
    }
    return copy;
}

var compact = (value) => Array.isArray(value) ? value.filter(Boolean) : [];

var isUndefined = (val) => val === undefined;

var get = (object, path, defaultValue) => {
    if (!path || !isObject(object)) {
        return defaultValue;
    }
    const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);
    return isUndefined(result) || result === object
        ? isUndefined(object[path])
            ? defaultValue
            : object[path]
        : result;
};

var isBoolean = (value) => typeof value === 'boolean';

var isKey = (value) => /^\w*$/.test(value);

var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));

var set = (object, path, value) => {
    let index = -1;
    const tempPath = isKey(path) ? [path] : stringToPath(path);
    const length = tempPath.length;
    const lastIndex = length - 1;
    while (++index < length) {
        const key = tempPath[index];
        let newValue = value;
        if (index !== lastIndex) {
            const objValue = object[key];
            newValue =
                isObject(objValue) || Array.isArray(objValue)
                    ? objValue
                    : !isNaN(+tempPath[index + 1])
                        ? []
                        : {};
        }
        if (key === '__proto__') {
            return;
        }
        object[key] = newValue;
        object = object[key];
    }
    return object;
};

const EVENTS = {
    BLUR: 'blur',
    FOCUS_OUT: 'focusout',
    CHANGE: 'change',
};
const VALIDATION_MODE = {
    onBlur: 'onBlur',
    onChange: 'onChange',
    onSubmit: 'onSubmit',
    onTouched: 'onTouched',
    all: 'all',
};
const INPUT_VALIDATION_RULES = {
    max: 'max',
    min: 'min',
    maxLength: 'maxLength',
    minLength: 'minLength',
    pattern: 'pattern',
    required: 'required',
    validate: 'validate',
};

const HookFormContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);
/**
 * This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
 *
 * @returns return all useForm methods
 *
 * @example
 * ```tsx
 * function App() {
 *   const methods = useForm();
 *   const onSubmit = data => console.log(data);
 *
 *   return (
 *     <FormProvider {...methods} >
 *       <form onSubmit={methods.handleSubmit(onSubmit)}>
 *         <NestedInput />
 *         <input type="submit" />
 *       </form>
 *     </FormProvider>
 *   );
 * }
 *
 *  function NestedInput() {
 *   const { register } = useFormContext(); // retrieve all hook methods
 *   return <input {...register("test")} />;
 * }
 * ```
 */
const useFormContext = () => react__WEBPACK_IMPORTED_MODULE_0__.useContext(HookFormContext);
/**
 * A provider component that propagates the `useForm` methods to all children components via [React Context](https://reactjs.org/docs/context.html) API. To be used with {@link useFormContext}.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
 *
 * @param props - all useForm methods
 *
 * @example
 * ```tsx
 * function App() {
 *   const methods = useForm();
 *   const onSubmit = data => console.log(data);
 *
 *   return (
 *     <FormProvider {...methods} >
 *       <form onSubmit={methods.handleSubmit(onSubmit)}>
 *         <NestedInput />
 *         <input type="submit" />
 *       </form>
 *     </FormProvider>
 *   );
 * }
 *
 *  function NestedInput() {
 *   const { register } = useFormContext(); // retrieve all hook methods
 *   return <input {...register("test")} />;
 * }
 * ```
 */
const FormProvider = (props) => {
    const { children, ...data } = props;
    return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(HookFormContext.Provider, { value: data }, children));
};

var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
    const result = {
        defaultValues: control._defaultValues,
    };
    for (const key in formState) {
        Object.defineProperty(result, key, {
            get: () => {
                const _key = key;
                if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {
                    control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;
                }
                localProxyFormState && (localProxyFormState[_key] = true);
                return formState[_key];
            },
        });
    }
    return result;
};

var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;

var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {
    updateFormState(formStateData);
    const { name, ...formState } = formStateData;
    return (isEmptyObject(formState) ||
        Object.keys(formState).length >= Object.keys(_proxyFormState).length ||
        Object.keys(formState).find((key) => _proxyFormState[key] ===
            (!isRoot || VALIDATION_MODE.all)));
};

var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);

var shouldSubscribeByName = (name, signalName, exact) => !name ||
    !signalName ||
    name === signalName ||
    convertToArrayPayload(name).some((currentName) => currentName &&
        (exact
            ? currentName === signalName
            : currentName.startsWith(signalName) ||
                signalName.startsWith(currentName)));

function useSubscribe(props) {
    const _props = react__WEBPACK_IMPORTED_MODULE_0__.useRef(props);
    _props.current = props;
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        const subscription = !props.disabled &&
            _props.current.subject &&
            _props.current.subject.subscribe({
                next: _props.current.next,
            });
        return () => {
            subscription && subscription.unsubscribe();
        };
    }, [props.disabled]);
}

/**
 * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly)
 *
 * @param props - include options on specify fields to subscribe. {@link UseFormStateReturn}
 *
 * @example
 * ```tsx
 * function App() {
 *   const { register, handleSubmit, control } = useForm({
 *     defaultValues: {
 *     firstName: "firstName"
 *   }});
 *   const { dirtyFields } = useFormState({
 *     control
 *   });
 *   const onSubmit = (data) => console.log(data);
 *
 *   return (
 *     <form onSubmit={handleSubmit(onSubmit)}>
 *       <input {...register("firstName")} placeholder="First Name" />
 *       {dirtyFields.firstName && <p>Field is dirty.</p>}
 *       <input type="submit" />
 *     </form>
 *   );
 * }
 * ```
 */
function useFormState(props) {
    const methods = useFormContext();
    const { control = methods.control, disabled, name, exact } = props || {};
    const [formState, updateFormState] = react__WEBPACK_IMPORTED_MODULE_0__.useState(control._formState);
    const _mounted = react__WEBPACK_IMPORTED_MODULE_0__.useRef(true);
    const _localProxyFormState = react__WEBPACK_IMPORTED_MODULE_0__.useRef({
        isDirty: false,
        isLoading: false,
        dirtyFields: false,
        touchedFields: false,
        validatingFields: false,
        isValidating: false,
        isValid: false,
        errors: false,
    });
    const _name = react__WEBPACK_IMPORTED_MODULE_0__.useRef(name);
    _name.current = name;
    useSubscribe({
        disabled,
        next: (value) => _mounted.current &&
            shouldSubscribeByName(_name.current, value.name, exact) &&
            shouldRenderFormState(value, _localProxyFormState.current, control._updateFormState) &&
            updateFormState({
                ...control._formState,
                ...value,
            }),
        subject: control._subjects.state,
    });
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        _mounted.current = true;
        _localProxyFormState.current.isValid && control._updateValid(true);
        return () => {
            _mounted.current = false;
        };
    }, [control]);
    return getProxyFormState(formState, control, _localProxyFormState.current, false);
}

var isString = (value) => typeof value === 'string';

var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
    if (isString(names)) {
        isGlobal && _names.watch.add(names);
        return get(formValues, names, defaultValue);
    }
    if (Array.isArray(names)) {
        return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName), get(formValues, fieldName)));
    }
    isGlobal && (_names.watchAll = true);
    return formValues;
};

/**
 * Custom hook to subscribe to field change and isolate re-rendering at the component level.
 *
 * @remarks
 *
 * [API](https://react-hook-form.com/docs/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)
 *
 * @example
 * ```tsx
 * const { control } = useForm();
 * const values = useWatch({
 *   name: "fieldName"
 *   control,
 * })
 * ```
 */
function useWatch(props) {
    const methods = useFormContext();
    const { control = methods.control, name, defaultValue, disabled, exact, } = props || {};
    const _name = react__WEBPACK_IMPORTED_MODULE_0__.useRef(name);
    _name.current = name;
    useSubscribe({
        disabled,
        subject: control._subjects.values,
        next: (formState) => {
            if (shouldSubscribeByName(_name.current, formState.name, exact)) {
                updateValue(cloneObject(generateWatchOutput(_name.current, control._names, formState.values || control._formValues, false, defaultValue)));
            }
        },
    });
    const [value, updateValue] = react__WEBPACK_IMPORTED_MODULE_0__.useState(control._getWatch(name, defaultValue));
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => control._removeUnmounted());
    return value;
}

/**
 * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/usecontroller) • [Demo](https://codesandbox.io/s/usecontroller-0o8px)
 *
 * @param props - the path name to the form field value, and validation rules.
 *
 * @returns field properties, field and form state. {@link UseControllerReturn}
 *
 * @example
 * ```tsx
 * function Input(props) {
 *   const { field, fieldState, formState } = useController(props);
 *   return (
 *     <div>
 *       <input {...field} placeholder={props.name} />
 *       <p>{fieldState.isTouched && "Touched"}</p>
 *       <p>{formState.isSubmitted ? "submitted" : ""}</p>
 *     </div>
 *   );
 * }
 * ```
 */
function useController(props) {
    const methods = useFormContext();
    const { name, disabled, control = methods.control, shouldUnregister } = props;
    const isArrayField = isNameInFieldArray(control._names.array, name);
    const value = useWatch({
        control,
        name,
        defaultValue: get(control._formValues, name, get(control._defaultValues, name, props.defaultValue)),
        exact: true,
    });
    const formState = useFormState({
        control,
        name,
        exact: true,
    });
    const _registerProps = react__WEBPACK_IMPORTED_MODULE_0__.useRef(control.register(name, {
        ...props.rules,
        value,
        ...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
    }));
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
        const updateMounted = (name, value) => {
            const field = get(control._fields, name);
            if (field && field._f) {
                field._f.mount = value;
            }
        };
        updateMounted(name, true);
        if (_shouldUnregisterField) {
            const value = cloneObject(get(control._options.defaultValues, name));
            set(control._defaultValues, name, value);
            if (isUndefined(get(control._formValues, name))) {
                set(control._formValues, name, value);
            }
        }
        return () => {
            (isArrayField
                ? _shouldUnregisterField && !control._state.action
                : _shouldUnregisterField)
                ? control.unregister(name)
                : updateMounted(name, false);
        };
    }, [name, control, isArrayField, shouldUnregister]);
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        if (get(control._fields, name)) {
            control._updateDisabledField({
                disabled,
                fields: control._fields,
                name,
                value: get(control._fields, name)._f.value,
            });
        }
    }, [disabled, name, control]);
    return {
        field: {
            name,
            value,
            ...(isBoolean(disabled) || formState.disabled
                ? { disabled: formState.disabled || disabled }
                : {}),
            onChange: react__WEBPACK_IMPORTED_MODULE_0__.useCallback((event) => _registerProps.current.onChange({
                target: {
                    value: getEventValue(event),
                    name: name,
                },
                type: EVENTS.CHANGE,
            }), [name]),
            onBlur: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => _registerProps.current.onBlur({
                target: {
                    value: get(control._formValues, name),
                    name: name,
                },
                type: EVENTS.BLUR,
            }), [name, control]),
            ref: react__WEBPACK_IMPORTED_MODULE_0__.useCallback((elm) => {
                const field = get(control._fields, name);
                if (field && elm) {
                    field._f.ref = {
                        focus: () => elm.focus(),
                        select: () => elm.select(),
                        setCustomValidity: (message) => elm.setCustomValidity(message),
                        reportValidity: () => elm.reportValidity(),
                    };
                }
            }, [control._fields, name]),
        },
        formState,
        fieldState: Object.defineProperties({}, {
            invalid: {
                enumerable: true,
                get: () => !!get(formState.errors, name),
            },
            isDirty: {
                enumerable: true,
                get: () => !!get(formState.dirtyFields, name),
            },
            isTouched: {
                enumerable: true,
                get: () => !!get(formState.touchedFields, name),
            },
            isValidating: {
                enumerable: true,
                get: () => !!get(formState.validatingFields, name),
            },
            error: {
                enumerable: true,
                get: () => get(formState.errors, name),
            },
        }),
    };
}

/**
 * Component based on `useController` hook to work with controlled component.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/usecontroller/controller) • [Demo](https://codesandbox.io/s/react-hook-form-v6-controller-ts-jwyzw) • [Video](https://www.youtube.com/watch?v=N2UNk_UCVyA)
 *
 * @param props - the path name to the form field value, and validation rules.
 *
 * @returns provide field handler functions, field and form state.
 *
 * @example
 * ```tsx
 * function App() {
 *   const { control } = useForm<FormValues>({
 *     defaultValues: {
 *       test: ""
 *     }
 *   });
 *
 *   return (
 *     <form>
 *       <Controller
 *         control={control}
 *         name="test"
 *         render={({ field: { onChange, onBlur, value, ref }, formState, fieldState }) => (
 *           <>
 *             <input
 *               onChange={onChange} // send value to hook form
 *               onBlur={onBlur} // notify when input is touched
 *               value={value} // return updated value
 *               ref={ref} // set ref for focus management
 *             />
 *             <p>{formState.isSubmitted ? "submitted" : ""}</p>
 *             <p>{fieldState.isTouched ? "touched" : ""}</p>
 *           </>
 *         )}
 *       />
 *     </form>
 *   );
 * }
 * ```
 */
const Controller = (props) => props.render(useController(props));

const POST_REQUEST = 'post';
/**
 * Form component to manage submission.
 *
 * @param props - to setup submission detail. {@link FormProps}
 *
 * @returns form component or headless render prop.
 *
 * @example
 * ```tsx
 * function App() {
 *   const { control, formState: { errors } } = useForm();
 *
 *   return (
 *     <Form action="/api" control={control}>
 *       <input {...register("name")} />
 *       <p>{errors?.root?.server && 'Server error'}</p>
 *       <button>Submit</button>
 *     </Form>
 *   );
 * }
 * ```
 */
function Form(props) {
    const methods = useFormContext();
    const [mounted, setMounted] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false);
    const { control = methods.control, onSubmit, children, action, method = POST_REQUEST, headers, encType, onError, render, onSuccess, validateStatus, ...rest } = props;
    const submit = async (event) => {
        let hasError = false;
        let type = '';
        await control.handleSubmit(async (data) => {
            const formData = new FormData();
            let formDataJson = '';
            try {
                formDataJson = JSON.stringify(data);
            }
            catch (_a) { }
            for (const name of control._names.mount) {
                formData.append(name, get(data, name));
            }
            if (onSubmit) {
                await onSubmit({
                    data,
                    event,
                    method,
                    formData,
                    formDataJson,
                });
            }
            if (action) {
                try {
                    const shouldStringifySubmissionData = [
                        headers && headers['Content-Type'],
                        encType,
                    ].some((value) => value && value.includes('json'));
                    const response = await fetch(action, {
                        method,
                        headers: {
                            ...headers,
                            ...(encType ? { 'Content-Type': encType } : {}),
                        },
                        body: shouldStringifySubmissionData ? formDataJson : formData,
                    });
                    if (response &&
                        (validateStatus
                            ? !validateStatus(response.status)
                            : response.status < 200 || response.status >= 300)) {
                        hasError = true;
                        onError && onError({ response });
                        type = String(response.status);
                    }
                    else {
                        onSuccess && onSuccess({ response });
                    }
                }
                catch (error) {
                    hasError = true;
                    onError && onError({ error });
                }
            }
        })(event);
        if (hasError && props.control) {
            props.control._subjects.state.next({
                isSubmitSuccessful: false,
            });
            props.control.setError('root.server', {
                type,
            });
        }
    };
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        setMounted(true);
    }, []);
    return render ? (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, render({
        submit,
    }))) : (react__WEBPACK_IMPORTED_MODULE_0__.createElement("form", { noValidate: mounted, action: action, method: method, encType: encType, onSubmit: submit, ...rest }, children));
}

var appendErrors = (name, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria
    ? {
        ...errors[name],
        types: {
            ...(errors[name] && errors[name].types ? errors[name].types : {}),
            [type]: message || true,
        },
    }
    : {};

var generateId = () => {
    const d = typeof performance === 'undefined' ? Date.now() : performance.now() * 1000;
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
        const r = (Math.random() * 16 + d) % 16 | 0;
        return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);
    });
};

var getFocusFieldName = (name, index, options = {}) => options.shouldFocus || isUndefined(options.shouldFocus)
    ? options.focusName ||
        `${name}.${isUndefined(options.focusIndex) ? index : options.focusIndex}.`
    : '';

var getValidationModes = (mode) => ({
    isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,
    isOnBlur: mode === VALIDATION_MODE.onBlur,
    isOnChange: mode === VALIDATION_MODE.onChange,
    isOnAll: mode === VALIDATION_MODE.all,
    isOnTouch: mode === VALIDATION_MODE.onTouched,
});

var isWatched = (name, _names, isBlurEvent) => !isBlurEvent &&
    (_names.watchAll ||
        _names.watch.has(name) ||
        [..._names.watch].some((watchName) => name.startsWith(watchName) &&
            /^\.\w+/.test(name.slice(watchName.length))));

const iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => {
    for (const key of fieldsNames || Object.keys(fields)) {
        const field = get(fields, key);
        if (field) {
            const { _f, ...currentField } = field;
            if (_f) {
                if (_f.refs && _f.refs[0] && action(_f.refs[0], key) && !abortEarly) {
                    break;
                }
                else if (_f.ref && action(_f.ref, _f.name) && !abortEarly) {
                    break;
                }
                else {
                    iterateFieldsByAction(currentField, action);
                }
            }
            else if (isObject(currentField)) {
                iterateFieldsByAction(currentField, action);
            }
        }
    }
};

var updateFieldArrayRootError = (errors, error, name) => {
    const fieldArrayErrors = convertToArrayPayload(get(errors, name));
    set(fieldArrayErrors, 'root', error[name]);
    set(errors, name, fieldArrayErrors);
    return errors;
};

var isFileInput = (element) => element.type === 'file';

var isFunction = (value) => typeof value === 'function';

var isHTMLElement = (value) => {
    if (!isWeb) {
        return false;
    }
    const owner = value ? value.ownerDocument : 0;
    return (value instanceof
        (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement));
};

var isMessage = (value) => isString(value);

var isRadioInput = (element) => element.type === 'radio';

var isRegex = (value) => value instanceof RegExp;

const defaultResult = {
    value: false,
    isValid: false,
};
const validResult = { value: true, isValid: true };
var getCheckboxValue = (options) => {
    if (Array.isArray(options)) {
        if (options.length > 1) {
            const values = options
                .filter((option) => option && option.checked && !option.disabled)
                .map((option) => option.value);
            return { value: values, isValid: !!values.length };
        }
        return options[0].checked && !options[0].disabled
            ? // @ts-expect-error expected to work in the browser
                options[0].attributes && !isUndefined(options[0].attributes.value)
                    ? isUndefined(options[0].value) || options[0].value === ''
                        ? validResult
                        : { value: options[0].value, isValid: true }
                    : validResult
            : defaultResult;
    }
    return defaultResult;
};

const defaultReturn = {
    isValid: false,
    value: null,
};
var getRadioValue = (options) => Array.isArray(options)
    ? options.reduce((previous, option) => option && option.checked && !option.disabled
        ? {
            isValid: true,
            value: option.value,
        }
        : previous, defaultReturn)
    : defaultReturn;

function getValidateError(result, ref, type = 'validate') {
    if (isMessage(result) ||
        (Array.isArray(result) && result.every(isMessage)) ||
        (isBoolean(result) && !result)) {
        return {
            type,
            message: isMessage(result) ? result : '',
            ref,
        };
    }
}

var getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData)
    ? validationData
    : {
        value: validationData,
        message: '',
    };

var validateField = async (field, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {
    const { ref, refs, required, maxLength, minLength, min, max, pattern, validate, name, valueAsNumber, mount, disabled, } = field._f;
    const inputValue = get(formValues, name);
    if (!mount || disabled) {
        return {};
    }
    const inputRef = refs ? refs[0] : ref;
    const setCustomValidity = (message) => {
        if (shouldUseNativeValidation && inputRef.reportValidity) {
            inputRef.setCustomValidity(isBoolean(message) ? '' : message || '');
            inputRef.reportValidity();
        }
    };
    const error = {};
    const isRadio = isRadioInput(ref);
    const isCheckBox = isCheckBoxInput(ref);
    const isRadioOrCheckbox = isRadio || isCheckBox;
    const isEmpty = ((valueAsNumber || isFileInput(ref)) &&
        isUndefined(ref.value) &&
        isUndefined(inputValue)) ||
        (isHTMLElement(ref) && ref.value === '') ||
        inputValue === '' ||
        (Array.isArray(inputValue) && !inputValue.length);
    const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);
    const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
        const message = exceedMax ? maxLengthMessage : minLengthMessage;
        error[name] = {
            type: exceedMax ? maxType : minType,
            message,
            ref,
            ...appendErrorsCurry(exceedMax ? maxType : minType, message),
        };
    };
    if (isFieldArray
        ? !Array.isArray(inputValue) || !inputValue.length
        : required &&
            ((!isRadioOrCheckbox && (isEmpty || isNullOrUndefined(inputValue))) ||
                (isBoolean(inputValue) && !inputValue) ||
                (isCheckBox && !getCheckboxValue(refs).isValid) ||
                (isRadio && !getRadioValue(refs).isValid))) {
        const { value, message } = isMessage(required)
            ? { value: !!required, message: required }
            : getValueAndMessage(required);
        if (value) {
            error[name] = {
                type: INPUT_VALIDATION_RULES.required,
                message,
                ref: inputRef,
                ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message),
            };
            if (!validateAllFieldCriteria) {
                setCustomValidity(message);
                return error;
            }
        }
    }
    if (!isEmpty && (!isNullOrUndefined(min) || !isNullOrUndefined(max))) {
        let exceedMax;
        let exceedMin;
        const maxOutput = getValueAndMessage(max);
        const minOutput = getValueAndMessage(min);
        if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {
            const valueNumber = ref.valueAsNumber ||
                (inputValue ? +inputValue : inputValue);
            if (!isNullOrUndefined(maxOutput.value)) {
                exceedMax = valueNumber > maxOutput.value;
            }
            if (!isNullOrUndefined(minOutput.value)) {
                exceedMin = valueNumber < minOutput.value;
            }
        }
        else {
            const valueDate = ref.valueAsDate || new Date(inputValue);
            const convertTimeToDate = (time) => new Date(new Date().toDateString() + ' ' + time);
            const isTime = ref.type == 'time';
            const isWeek = ref.type == 'week';
            if (isString(maxOutput.value) && inputValue) {
                exceedMax = isTime
                    ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value)
                    : isWeek
                        ? inputValue > maxOutput.value
                        : valueDate > new Date(maxOutput.value);
            }
            if (isString(minOutput.value) && inputValue) {
                exceedMin = isTime
                    ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value)
                    : isWeek
                        ? inputValue < minOutput.value
                        : valueDate < new Date(minOutput.value);
            }
        }
        if (exceedMax || exceedMin) {
            getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);
            if (!validateAllFieldCriteria) {
                setCustomValidity(error[name].message);
                return error;
            }
        }
    }
    if ((maxLength || minLength) &&
        !isEmpty &&
        (isString(inputValue) || (isFieldArray && Array.isArray(inputValue)))) {
        const maxLengthOutput = getValueAndMessage(maxLength);
        const minLengthOutput = getValueAndMessage(minLength);
        const exceedMax = !isNullOrUndefined(maxLengthOutput.value) &&
            inputValue.length > +maxLengthOutput.value;
        const exceedMin = !isNullOrUndefined(minLengthOutput.value) &&
            inputValue.length < +minLengthOutput.value;
        if (exceedMax || exceedMin) {
            getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);
            if (!validateAllFieldCriteria) {
                setCustomValidity(error[name].message);
                return error;
            }
        }
    }
    if (pattern && !isEmpty && isString(inputValue)) {
        const { value: patternValue, message } = getValueAndMessage(pattern);
        if (isRegex(patternValue) && !inputValue.match(patternValue)) {
            error[name] = {
                type: INPUT_VALIDATION_RULES.pattern,
                message,
                ref,
                ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message),
            };
            if (!validateAllFieldCriteria) {
                setCustomValidity(message);
                return error;
            }
        }
    }
    if (validate) {
        if (isFunction(validate)) {
            const result = await validate(inputValue, formValues);
            const validateError = getValidateError(result, inputRef);
            if (validateError) {
                error[name] = {
                    ...validateError,
                    ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message),
                };
                if (!validateAllFieldCriteria) {
                    setCustomValidity(validateError.message);
                    return error;
                }
            }
        }
        else if (isObject(validate)) {
            let validationResult = {};
            for (const key in validate) {
                if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {
                    break;
                }
                const validateError = getValidateError(await validate[key](inputValue, formValues), inputRef, key);
                if (validateError) {
                    validationResult = {
                        ...validateError,
                        ...appendErrorsCurry(key, validateError.message),
                    };
                    setCustomValidity(validateError.message);
                    if (validateAllFieldCriteria) {
                        error[name] = validationResult;
                    }
                }
            }
            if (!isEmptyObject(validationResult)) {
                error[name] = {
                    ref: inputRef,
                    ...validationResult,
                };
                if (!validateAllFieldCriteria) {
                    return error;
                }
            }
        }
    }
    setCustomValidity(true);
    return error;
};

var appendAt = (data, value) => [
    ...data,
    ...convertToArrayPayload(value),
];

var fillEmptyArray = (value) => Array.isArray(value) ? value.map(() => undefined) : undefined;

function insert(data, index, value) {
    return [
        ...data.slice(0, index),
        ...convertToArrayPayload(value),
        ...data.slice(index),
    ];
}

var moveArrayAt = (data, from, to) => {
    if (!Array.isArray(data)) {
        return [];
    }
    if (isUndefined(data[to])) {
        data[to] = undefined;
    }
    data.splice(to, 0, data.splice(from, 1)[0]);
    return data;
};

var prependAt = (data, value) => [
    ...convertToArrayPayload(value),
    ...convertToArrayPayload(data),
];

function removeAtIndexes(data, indexes) {
    let i = 0;
    const temp = [...data];
    for (const index of indexes) {
        temp.splice(index - i, 1);
        i++;
    }
    return compact(temp).length ? temp : [];
}
var removeArrayAt = (data, index) => isUndefined(index)
    ? []
    : removeAtIndexes(data, convertToArrayPayload(index).sort((a, b) => a - b));

var swapArrayAt = (data, indexA, indexB) => {
    [data[indexA], data[indexB]] = [data[indexB], data[indexA]];
};

function baseGet(object, updatePath) {
    const length = updatePath.slice(0, -1).length;
    let index = 0;
    while (index < length) {
        object = isUndefined(object) ? index++ : object[updatePath[index++]];
    }
    return object;
}
function isEmptyArray(obj) {
    for (const key in obj) {
        if (obj.hasOwnProperty(key) && !isUndefined(obj[key])) {
            return false;
        }
    }
    return true;
}
function unset(object, path) {
    const paths = Array.isArray(path)
        ? path
        : isKey(path)
            ? [path]
            : stringToPath(path);
    const childObject = paths.length === 1 ? object : baseGet(object, paths);
    const index = paths.length - 1;
    const key = paths[index];
    if (childObject) {
        delete childObject[key];
    }
    if (index !== 0 &&
        ((isObject(childObject) && isEmptyObject(childObject)) ||
            (Array.isArray(childObject) && isEmptyArray(childObject)))) {
        unset(object, paths.slice(0, -1));
    }
    return object;
}

var updateAt = (fieldValues, index, value) => {
    fieldValues[index] = value;
    return fieldValues;
};

/**
 * A custom hook that exposes convenient methods to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc. • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn) • [Video](https://youtu.be/4MrbfGSFY2A)
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn)
 *
 * @param props - useFieldArray props
 *
 * @returns methods - functions to manipulate with the Field Arrays (dynamic inputs) {@link UseFieldArrayReturn}
 *
 * @example
 * ```tsx
 * function App() {
 *   const { register, control, handleSubmit, reset, trigger, setError } = useForm({
 *     defaultValues: {
 *       test: []
 *     }
 *   });
 *   const { fields, append } = useFieldArray({
 *     control,
 *     name: "test"
 *   });
 *
 *   return (
 *     <form onSubmit={handleSubmit(data => console.log(data))}>
 *       {fields.map((item, index) => (
 *          <input key={item.id} {...register(`test.${index}.firstName`)}  />
 *       ))}
 *       <button type="button" onClick={() => append({ firstName: "bill" })}>
 *         append
 *       </button>
 *       <input type="submit" />
 *     </form>
 *   );
 * }
 * ```
 */
function useFieldArray(props) {
    const methods = useFormContext();
    const { control = methods.control, name, keyName = 'id', shouldUnregister, } = props;
    const [fields, setFields] = react__WEBPACK_IMPORTED_MODULE_0__.useState(control._getFieldArray(name));
    const ids = react__WEBPACK_IMPORTED_MODULE_0__.useRef(control._getFieldArray(name).map(generateId));
    const _fieldIds = react__WEBPACK_IMPORTED_MODULE_0__.useRef(fields);
    const _name = react__WEBPACK_IMPORTED_MODULE_0__.useRef(name);
    const _actioned = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
    _name.current = name;
    _fieldIds.current = fields;
    control._names.array.add(name);
    props.rules &&
        control.register(name, props.rules);
    useSubscribe({
        next: ({ values, name: fieldArrayName, }) => {
            if (fieldArrayName === _name.current || !fieldArrayName) {
                const fieldValues = get(values, _name.current);
                if (Array.isArray(fieldValues)) {
                    setFields(fieldValues);
                    ids.current = fieldValues.map(generateId);
                }
            }
        },
        subject: control._subjects.array,
    });
    const updateValues = react__WEBPACK_IMPORTED_MODULE_0__.useCallback((updatedFieldArrayValues) => {
        _actioned.current = true;
        control._updateFieldArray(name, updatedFieldArrayValues);
    }, [control, name]);
    const append = (value, options) => {
        const appendValue = convertToArrayPayload(cloneObject(value));
        const updatedFieldArrayValues = appendAt(control._getFieldArray(name), appendValue);
        control._names.focus = getFocusFieldName(name, updatedFieldArrayValues.length - 1, options);
        ids.current = appendAt(ids.current, appendValue.map(generateId));
        updateValues(updatedFieldArrayValues);
        setFields(updatedFieldArrayValues);
        control._updateFieldArray(name, updatedFieldArrayValues, appendAt, {
            argA: fillEmptyArray(value),
        });
    };
    const prepend = (value, options) => {
        const prependValue = convertToArrayPayload(cloneObject(value));
        const updatedFieldArrayValues = prependAt(control._getFieldArray(name), prependValue);
        control._names.focus = getFocusFieldName(name, 0, options);
        ids.current = prependAt(ids.current, prependValue.map(generateId));
        updateValues(updatedFieldArrayValues);
        setFields(updatedFieldArrayValues);
        control._updateFieldArray(name, updatedFieldArrayValues, prependAt, {
            argA: fillEmptyArray(value),
        });
    };
    const remove = (index) => {
        const updatedFieldArrayValues = removeArrayAt(control._getFieldArray(name), index);
        ids.current = removeArrayAt(ids.current, index);
        updateValues(updatedFieldArrayValues);
        setFields(updatedFieldArrayValues);
        control._updateFieldArray(name, updatedFieldArrayValues, removeArrayAt, {
            argA: index,
        });
    };
    const insert$1 = (index, value, options) => {
        const insertValue = convertToArrayPayload(cloneObject(value));
        const updatedFieldArrayValues = insert(control._getFieldArray(name), index, insertValue);
        control._names.focus = getFocusFieldName(name, index, options);
        ids.current = insert(ids.current, index, insertValue.map(generateId));
        updateValues(updatedFieldArrayValues);
        setFields(updatedFieldArrayValues);
        control._updateFieldArray(name, updatedFieldArrayValues, insert, {
            argA: index,
            argB: fillEmptyArray(value),
        });
    };
    const swap = (indexA, indexB) => {
        const updatedFieldArrayValues = control._getFieldArray(name);
        swapArrayAt(updatedFieldArrayValues, indexA, indexB);
        swapArrayAt(ids.current, indexA, indexB);
        updateValues(updatedFieldArrayValues);
        setFields(updatedFieldArrayValues);
        control._updateFieldArray(name, updatedFieldArrayValues, swapArrayAt, {
            argA: indexA,
            argB: indexB,
        }, false);
    };
    const move = (from, to) => {
        const updatedFieldArrayValues = control._getFieldArray(name);
        moveArrayAt(updatedFieldArrayValues, from, to);
        moveArrayAt(ids.current, from, to);
        updateValues(updatedFieldArrayValues);
        setFields(updatedFieldArrayValues);
        control._updateFieldArray(name, updatedFieldArrayValues, moveArrayAt, {
            argA: from,
            argB: to,
        }, false);
    };
    const update = (index, value) => {
        const updateValue = cloneObject(value);
        const updatedFieldArrayValues = updateAt(control._getFieldArray(name), index, updateValue);
        ids.current = [...updatedFieldArrayValues].map((item, i) => !item || i === index ? generateId() : ids.current[i]);
        updateValues(updatedFieldArrayValues);
        setFields([...updatedFieldArrayValues]);
        control._updateFieldArray(name, updatedFieldArrayValues, updateAt, {
            argA: index,
            argB: updateValue,
        }, true, false);
    };
    const replace = (value) => {
        const updatedFieldArrayValues = convertToArrayPayload(cloneObject(value));
        ids.current = updatedFieldArrayValues.map(generateId);
        updateValues([...updatedFieldArrayValues]);
        setFields([...updatedFieldArrayValues]);
        control._updateFieldArray(name, [...updatedFieldArrayValues], (data) => data, {}, true, false);
    };
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        control._state.action = false;
        isWatched(name, control._names) &&
            control._subjects.state.next({
                ...control._formState,
            });
        if (_actioned.current &&
            (!getValidationModes(control._options.mode).isOnSubmit ||
                control._formState.isSubmitted)) {
            if (control._options.resolver) {
                control._executeSchema([name]).then((result) => {
                    const error = get(result.errors, name);
                    const existingError = get(control._formState.errors, name);
                    if (existingError
                        ? (!error && existingError.type) ||
                            (error &&
                                (existingError.type !== error.type ||
                                    existingError.message !== error.message))
                        : error && error.type) {
                        error
                            ? set(control._formState.errors, name, error)
                            : unset(control._formState.errors, name);
                        control._subjects.state.next({
                            errors: control._formState.errors,
                        });
                    }
                });
            }
            else {
                const field = get(control._fields, name);
                if (field &&
                    field._f &&
                    !(getValidationModes(control._options.reValidateMode).isOnSubmit &&
                        getValidationModes(control._options.mode).isOnSubmit)) {
                    validateField(field, control._formValues, control._options.criteriaMode === VALIDATION_MODE.all, control._options.shouldUseNativeValidation, true).then((error) => !isEmptyObject(error) &&
                        control._subjects.state.next({
                            errors: updateFieldArrayRootError(control._formState.errors, error, name),
                        }));
                }
            }
        }
        control._subjects.values.next({
            name,
            values: { ...control._formValues },
        });
        control._names.focus &&
            iterateFieldsByAction(control._fields, (ref, key) => {
                if (control._names.focus &&
                    key.startsWith(control._names.focus) &&
                    ref.focus) {
                    ref.focus();
                    return 1;
                }
                return;
            });
        control._names.focus = '';
        control._updateValid();
        _actioned.current = false;
    }, [fields, name, control]);
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        !get(control._formValues, name) && control._updateFieldArray(name);
        return () => {
            (control._options.shouldUnregister || shouldUnregister) &&
                control.unregister(name);
        };
    }, [name, control, keyName, shouldUnregister]);
    return {
        swap: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(swap, [updateValues, name, control]),
        move: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(move, [updateValues, name, control]),
        prepend: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(prepend, [updateValues, name, control]),
        append: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(append, [updateValues, name, control]),
        remove: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(remove, [updateValues, name, control]),
        insert: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(insert$1, [updateValues, name, control]),
        update: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(update, [updateValues, name, control]),
        replace: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(replace, [updateValues, name, control]),
        fields: react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => fields.map((field, index) => ({
            ...field,
            [keyName]: ids.current[index] || generateId(),
        })), [fields, keyName]),
    };
}

var createSubject = () => {
    let _observers = [];
    const next = (value) => {
        for (const observer of _observers) {
            observer.next && observer.next(value);
        }
    };
    const subscribe = (observer) => {
        _observers.push(observer);
        return {
            unsubscribe: () => {
                _observers = _observers.filter((o) => o !== observer);
            },
        };
    };
    const unsubscribe = () => {
        _observers = [];
    };
    return {
        get observers() {
            return _observers;
        },
        next,
        subscribe,
        unsubscribe,
    };
};

var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);

function deepEqual(object1, object2) {
    if (isPrimitive(object1) || isPrimitive(object2)) {
        return object1 === object2;
    }
    if (isDateObject(object1) && isDateObject(object2)) {
        return object1.getTime() === object2.getTime();
    }
    const keys1 = Object.keys(object1);
    const keys2 = Object.keys(object2);
    if (keys1.length !== keys2.length) {
        return false;
    }
    for (const key of keys1) {
        const val1 = object1[key];
        if (!keys2.includes(key)) {
            return false;
        }
        if (key !== 'ref') {
            const val2 = object2[key];
            if ((isDateObject(val1) && isDateObject(val2)) ||
                (isObject(val1) && isObject(val2)) ||
                (Array.isArray(val1) && Array.isArray(val2))
                ? !deepEqual(val1, val2)
                : val1 !== val2) {
                return false;
            }
        }
    }
    return true;
}

var isMultipleSelect = (element) => element.type === `select-multiple`;

var isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);

var live = (ref) => isHTMLElement(ref) && ref.isConnected;

var objectHasFunction = (data) => {
    for (const key in data) {
        if (isFunction(data[key])) {
            return true;
        }
    }
    return false;
};

function markFieldsDirty(data, fields = {}) {
    const isParentNodeArray = Array.isArray(data);
    if (isObject(data) || isParentNodeArray) {
        for (const key in data) {
            if (Array.isArray(data[key]) ||
                (isObject(data[key]) && !objectHasFunction(data[key]))) {
                fields[key] = Array.isArray(data[key]) ? [] : {};
                markFieldsDirty(data[key], fields[key]);
            }
            else if (!isNullOrUndefined(data[key])) {
                fields[key] = true;
            }
        }
    }
    return fields;
}
function getDirtyFieldsFromDefaultValues(data, formValues, dirtyFieldsFromValues) {
    const isParentNodeArray = Array.isArray(data);
    if (isObject(data) || isParentNodeArray) {
        for (const key in data) {
            if (Array.isArray(data[key]) ||
                (isObject(data[key]) && !objectHasFunction(data[key]))) {
                if (isUndefined(formValues) ||
                    isPrimitive(dirtyFieldsFromValues[key])) {
                    dirtyFieldsFromValues[key] = Array.isArray(data[key])
                        ? markFieldsDirty(data[key], [])
                        : { ...markFieldsDirty(data[key]) };
                }
                else {
                    getDirtyFieldsFromDefaultValues(data[key], isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
                }
            }
            else {
                dirtyFieldsFromValues[key] = !deepEqual(data[key], formValues[key]);
            }
        }
    }
    return dirtyFieldsFromValues;
}
var getDirtyFields = (defaultValues, formValues) => getDirtyFieldsFromDefaultValues(defaultValues, formValues, markFieldsDirty(formValues));

var getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => isUndefined(value)
    ? value
    : valueAsNumber
        ? value === ''
            ? NaN
            : value
                ? +value
                : value
        : valueAsDate && isString(value)
            ? new Date(value)
            : setValueAs
                ? setValueAs(value)
                : value;

function getFieldValue(_f) {
    const ref = _f.ref;
    if (_f.refs ? _f.refs.every((ref) => ref.disabled) : ref.disabled) {
        return;
    }
    if (isFileInput(ref)) {
        return ref.files;
    }
    if (isRadioInput(ref)) {
        return getRadioValue(_f.refs).value;
    }
    if (isMultipleSelect(ref)) {
        return [...ref.selectedOptions].map(({ value }) => value);
    }
    if (isCheckBoxInput(ref)) {
        return getCheckboxValue(_f.refs).value;
    }
    return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);
}

var getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => {
    const fields = {};
    for (const name of fieldsNames) {
        const field = get(_fields, name);
        field && set(fields, name, field._f);
    }
    return {
        criteriaMode,
        names: [...fieldsNames],
        fields,
        shouldUseNativeValidation,
    };
};

var getRuleValue = (rule) => isUndefined(rule)
    ? rule
    : isRegex(rule)
        ? rule.source
        : isObject(rule)
            ? isRegex(rule.value)
                ? rule.value.source
                : rule.value
            : rule;

var hasValidation = (options) => options.mount &&
    (options.required ||
        options.min ||
        options.max ||
        options.maxLength ||
        options.minLength ||
        options.pattern ||
        options.validate);

function schemaErrorLookup(errors, _fields, name) {
    const error = get(errors, name);
    if (error || isKey(name)) {
        return {
            error,
            name,
        };
    }
    const names = name.split('.');
    while (names.length) {
        const fieldName = names.join('.');
        const field = get(_fields, fieldName);
        const foundError = get(errors, fieldName);
        if (field && !Array.isArray(field) && name !== fieldName) {
            return { name };
        }
        if (foundError && foundError.type) {
            return {
                name: fieldName,
                error: foundError,
            };
        }
        names.pop();
    }
    return {
        name,
    };
}

var skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => {
    if (mode.isOnAll) {
        return false;
    }
    else if (!isSubmitted && mode.isOnTouch) {
        return !(isTouched || isBlurEvent);
    }
    else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {
        return !isBlurEvent;
    }
    else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {
        return isBlurEvent;
    }
    return true;
};

var unsetEmptyArray = (ref, name) => !compact(get(ref, name)).length && unset(ref, name);

const defaultOptions = {
    mode: VALIDATION_MODE.onSubmit,
    reValidateMode: VALIDATION_MODE.onChange,
    shouldFocusError: true,
};
function createFormControl(props = {}) {
    let _options = {
        ...defaultOptions,
        ...props,
    };
    let _formState = {
        submitCount: 0,
        isDirty: false,
        isLoading: isFunction(_options.defaultValues),
        isValidating: false,
        isSubmitted: false,
        isSubmitting: false,
        isSubmitSuccessful: false,
        isValid: false,
        touchedFields: {},
        dirtyFields: {},
        validatingFields: {},
        errors: _options.errors || {},
        disabled: _options.disabled || false,
    };
    let _fields = {};
    let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)
        ? cloneObject(_options.defaultValues || _options.values) || {}
        : {};
    let _formValues = _options.shouldUnregister
        ? {}
        : cloneObject(_defaultValues);
    let _state = {
        action: false,
        mount: false,
        watch: false,
    };
    let _names = {
        mount: new Set(),
        unMount: new Set(),
        array: new Set(),
        watch: new Set(),
    };
    let delayErrorCallback;
    let timer = 0;
    const _proxyFormState = {
        isDirty: false,
        dirtyFields: false,
        validatingFields: false,
        touchedFields: false,
        isValidating: false,
        isValid: false,
        errors: false,
    };
    const _subjects = {
        values: createSubject(),
        array: createSubject(),
        state: createSubject(),
    };
    const validationModeBeforeSubmit = getValidationModes(_options.mode);
    const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
    const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
    const debounce = (callback) => (wait) => {
        clearTimeout(timer);
        timer = setTimeout(callback, wait);
    };
    const _updateValid = async (shouldUpdateValid) => {
        if (_proxyFormState.isValid || shouldUpdateValid) {
            const isValid = _options.resolver
                ? isEmptyObject((await _executeSchema()).errors)
                : await executeBuiltInValidation(_fields, true);
            if (isValid !== _formState.isValid) {
                _subjects.state.next({
                    isValid,
                });
            }
        }
    };
    const _updateIsValidating = (names, isValidating) => {
        if (_proxyFormState.isValidating || _proxyFormState.validatingFields) {
            (names || Array.from(_names.mount)).forEach((name) => {
                if (name) {
                    isValidating
                        ? set(_formState.validatingFields, name, isValidating)
                        : unset(_formState.validatingFields, name);
                }
            });
            _subjects.state.next({
                validatingFields: _formState.validatingFields,
                isValidating: !isEmptyObject(_formState.validatingFields),
            });
        }
    };
    const _updateFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
        if (args && method) {
            _state.action = true;
            if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name))) {
                const fieldValues = method(get(_fields, name), args.argA, args.argB);
                shouldSetValues && set(_fields, name, fieldValues);
            }
            if (shouldUpdateFieldsAndState &&
                Array.isArray(get(_formState.errors, name))) {
                const errors = method(get(_formState.errors, name), args.argA, args.argB);
                shouldSetValues && set(_formState.errors, name, errors);
                unsetEmptyArray(_formState.errors, name);
            }
            if (_proxyFormState.touchedFields &&
                shouldUpdateFieldsAndState &&
                Array.isArray(get(_formState.touchedFields, name))) {
                const touchedFields = method(get(_formState.touchedFields, name), args.argA, args.argB);
                shouldSetValues && set(_formState.touchedFields, name, touchedFields);
            }
            if (_proxyFormState.dirtyFields) {
                _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);
            }
            _subjects.state.next({
                name,
                isDirty: _getDirty(name, values),
                dirtyFields: _formState.dirtyFields,
                errors: _formState.errors,
                isValid: _formState.isValid,
            });
        }
        else {
            set(_formValues, name, values);
        }
    };
    const updateErrors = (name, error) => {
        set(_formState.errors, name, error);
        _subjects.state.next({
            errors: _formState.errors,
        });
    };
    const _setErrors = (errors) => {
        _formState.errors = errors;
        _subjects.state.next({
            errors: _formState.errors,
            isValid: false,
        });
    };
    const updateValidAndValue = (name, shouldSkipSetValueAs, value, ref) => {
        const field = get(_fields, name);
        if (field) {
            const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);
            isUndefined(defaultValue) ||
                (ref && ref.defaultChecked) ||
                shouldSkipSetValueAs
                ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f))
                : setFieldValue(name, defaultValue);
            _state.mount && _updateValid();
        }
    };
    const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
        let shouldUpdateField = false;
        let isPreviousDirty = false;
        const output = {
            name,
        };
        const disabledField = !!(get(_fields, name) &&
            get(_fields, name)._f &&
            get(_fields, name)._f.disabled);
        if (!isBlurEvent || shouldDirty) {
            if (_proxyFormState.isDirty) {
                isPreviousDirty = _formState.isDirty;
                _formState.isDirty = output.isDirty = _getDirty();
                shouldUpdateField = isPreviousDirty !== output.isDirty;
            }
            const isCurrentFieldPristine = disabledField || deepEqual(get(_defaultValues, name), fieldValue);
            isPreviousDirty = !!(!disabledField && get(_formState.dirtyFields, name));
            isCurrentFieldPristine || disabledField
                ? unset(_formState.dirtyFields, name)
                : set(_formState.dirtyFields, name, true);
            output.dirtyFields = _formState.dirtyFields;
            shouldUpdateField =
                shouldUpdateField ||
                    (_proxyFormState.dirtyFields &&
                        isPreviousDirty !== !isCurrentFieldPristine);
        }
        if (isBlurEvent) {
            const isPreviousFieldTouched = get(_formState.touchedFields, name);
            if (!isPreviousFieldTouched) {
                set(_formState.touchedFields, name, isBlurEvent);
                output.touchedFields = _formState.touchedFields;
                shouldUpdateField =
                    shouldUpdateField ||
                        (_proxyFormState.touchedFields &&
                            isPreviousFieldTouched !== isBlurEvent);
            }
        }
        shouldUpdateField && shouldRender && _subjects.state.next(output);
        return shouldUpdateField ? output : {};
    };
    const shouldRenderByError = (name, isValid, error, fieldState) => {
        const previousFieldError = get(_formState.errors, name);
        const shouldUpdateValid = _proxyFormState.isValid &&
            isBoolean(isValid) &&
            _formState.isValid !== isValid;
        if (props.delayError && error) {
            delayErrorCallback = debounce(() => updateErrors(name, error));
            delayErrorCallback(props.delayError);
        }
        else {
            clearTimeout(timer);
            delayErrorCallback = null;
            error
                ? set(_formState.errors, name, error)
                : unset(_formState.errors, name);
        }
        if ((error ? !deepEqual(previousFieldError, error) : previousFieldError) ||
            !isEmptyObject(fieldState) ||
            shouldUpdateValid) {
            const updatedFormState = {
                ...fieldState,
                ...(shouldUpdateValid && isBoolean(isValid) ? { isValid } : {}),
                errors: _formState.errors,
                name,
            };
            _formState = {
                ..._formState,
                ...updatedFormState,
            };
            _subjects.state.next(updatedFormState);
        }
    };
    const _executeSchema = async (name) => {
        _updateIsValidating(name, true);
        const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
        _updateIsValidating(name);
        return result;
    };
    const executeSchemaAndUpdateState = async (names) => {
        const { errors } = await _executeSchema(names);
        if (names) {
            for (const name of names) {
                const error = get(errors, name);
                error
                    ? set(_formState.errors, name, error)
                    : unset(_formState.errors, name);
            }
        }
        else {
            _formState.errors = errors;
        }
        return errors;
    };
    const executeBuiltInValidation = async (fields, shouldOnlyCheckValid, context = {
        valid: true,
    }) => {
        for (const name in fields) {
            const field = fields[name];
            if (field) {
                const { _f, ...fieldValue } = field;
                if (_f) {
                    const isFieldArrayRoot = _names.array.has(_f.name);
                    _updateIsValidating([name], true);
                    const fieldError = await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !shouldOnlyCheckValid, isFieldArrayRoot);
                    _updateIsValidating([name]);
                    if (fieldError[_f.name]) {
                        context.valid = false;
                        if (shouldOnlyCheckValid) {
                            break;
                        }
                    }
                    !shouldOnlyCheckValid &&
                        (get(fieldError, _f.name)
                            ? isFieldArrayRoot
                                ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name)
                                : set(_formState.errors, _f.name, fieldError[_f.name])
                            : unset(_formState.errors, _f.name));
                }
                !isEmptyObject(fieldValue) &&
                    (await executeBuiltInValidation(fieldValue, shouldOnlyCheckValid, context));
            }
        }
        return context.valid;
    };
    const _removeUnmounted = () => {
        for (const name of _names.unMount) {
            const field = get(_fields, name);
            field &&
                (field._f.refs
                    ? field._f.refs.every((ref) => !live(ref))
                    : !live(field._f.ref)) &&
                unregister(name);
        }
        _names.unMount = new Set();
    };
    const _getDirty = (name, data) => (name && data && set(_formValues, name, data),
        !deepEqual(getValues(), _defaultValues));
    const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {
        ...(_state.mount
            ? _formValues
            : isUndefined(defaultValue)
                ? _defaultValues
                : isString(names)
                    ? { [names]: defaultValue }
                    : defaultValue),
    }, isGlobal, defaultValue);
    const _getFieldArray = (name) => compact(get(_state.mount ? _formValues : _defaultValues, name, props.shouldUnregister ? get(_defaultValues, name, []) : []));
    const setFieldValue = (name, value, options = {}) => {
        const field = get(_fields, name);
        let fieldValue = value;
        if (field) {
            const fieldReference = field._f;
            if (fieldReference) {
                !fieldReference.disabled &&
                    set(_formValues, name, getFieldValueAs(value, fieldReference));
                fieldValue =
                    isHTMLElement(fieldReference.ref) && isNullOrUndefined(value)
                        ? ''
                        : value;
                if (isMultipleSelect(fieldReference.ref)) {
                    [...fieldReference.ref.options].forEach((optionRef) => (optionRef.selected = fieldValue.includes(optionRef.value)));
                }
                else if (fieldReference.refs) {
                    if (isCheckBoxInput(fieldReference.ref)) {
                        fieldReference.refs.length > 1
                            ? fieldReference.refs.forEach((checkboxRef) => (!checkboxRef.defaultChecked || !checkboxRef.disabled) &&
                                (checkboxRef.checked = Array.isArray(fieldValue)
                                    ? !!fieldValue.find((data) => data === checkboxRef.value)
                                    : fieldValue === checkboxRef.value))
                            : fieldReference.refs[0] &&
                                (fieldReference.refs[0].checked = !!fieldValue);
                    }
                    else {
                        fieldReference.refs.forEach((radioRef) => (radioRef.checked = radioRef.value === fieldValue));
                    }
                }
                else if (isFileInput(fieldReference.ref)) {
                    fieldReference.ref.value = '';
                }
                else {
                    fieldReference.ref.value = fieldValue;
                    if (!fieldReference.ref.type) {
                        _subjects.values.next({
                            name,
                            values: { ..._formValues },
                        });
                    }
                }
            }
        }
        (options.shouldDirty || options.shouldTouch) &&
            updateTouchAndDirty(name, fieldValue, options.shouldTouch, options.shouldDirty, true);
        options.shouldValidate && trigger(name);
    };
    const setValues = (name, value, options) => {
        for (const fieldKey in value) {
            const fieldValue = value[fieldKey];
            const fieldName = `${name}.${fieldKey}`;
            const field = get(_fields, fieldName);
            (_names.array.has(name) ||
                !isPrimitive(fieldValue) ||
                (field && !field._f)) &&
                !isDateObject(fieldValue)
                ? setValues(fieldName, fieldValue, options)
                : setFieldValue(fieldName, fieldValue, options);
        }
    };
    const setValue = (name, value, options = {}) => {
        const field = get(_fields, name);
        const isFieldArray = _names.array.has(name);
        const cloneValue = cloneObject(value);
        set(_formValues, name, cloneValue);
        if (isFieldArray) {
            _subjects.array.next({
                name,
                values: { ..._formValues },
            });
            if ((_proxyFormState.isDirty || _proxyFormState.dirtyFields) &&
                options.shouldDirty) {
                _subjects.state.next({
                    name,
                    dirtyFields: getDirtyFields(_defaultValues, _formValues),
                    isDirty: _getDirty(name, cloneValue),
                });
            }
        }
        else {
            field && !field._f && !isNullOrUndefined(cloneValue)
                ? setValues(name, cloneValue, options)
                : setFieldValue(name, cloneValue, options);
        }
        isWatched(name, _names) && _subjects.state.next({ ..._formState });
        _subjects.values.next({
            name: _state.mount ? name : undefined,
            values: { ..._formValues },
        });
    };
    const onChange = async (event) => {
        _state.mount = true;
        const target = event.target;
        let name = target.name;
        let isFieldValueUpdated = true;
        const field = get(_fields, name);
        const getCurrentFieldValue = () => target.type ? getFieldValue(field._f) : getEventValue(event);
        const _updateIsFieldValueUpdated = (fieldValue) => {
            isFieldValueUpdated =
                Number.isNaN(fieldValue) ||
                    fieldValue === get(_formValues, name, fieldValue);
        };
        if (field) {
            let error;
            let isValid;
            const fieldValue = getCurrentFieldValue();
            const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;
            const shouldSkipValidation = (!hasValidation(field._f) &&
                !_options.resolver &&
                !get(_formState.errors, name) &&
                !field._f.deps) ||
                skipValidation(isBlurEvent, get(_formState.touchedFields, name), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);
            const watched = isWatched(name, _names, isBlurEvent);
            set(_formValues, name, fieldValue);
            if (isBlurEvent) {
                field._f.onBlur && field._f.onBlur(event);
                delayErrorCallback && delayErrorCallback(0);
            }
            else if (field._f.onChange) {
                field._f.onChange(event);
            }
            const fieldState = updateTouchAndDirty(name, fieldValue, isBlurEvent, false);
            const shouldRender = !isEmptyObject(fieldState) || watched;
            !isBlurEvent &&
                _subjects.values.next({
                    name,
                    type: event.type,
                    values: { ..._formValues },
                });
            if (shouldSkipValidation) {
                _proxyFormState.isValid && _updateValid();
                return (shouldRender &&
                    _subjects.state.next({ name, ...(watched ? {} : fieldState) }));
            }
            !isBlurEvent && watched && _subjects.state.next({ ..._formState });
            if (_options.resolver) {
                const { errors } = await _executeSchema([name]);
                _updateIsFieldValueUpdated(fieldValue);
                if (isFieldValueUpdated) {
                    const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
                    const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);
                    error = errorLookupResult.error;
                    name = errorLookupResult.name;
                    isValid = isEmptyObject(errors);
                }
            }
            else {
                _updateIsValidating([name], true);
                error = (await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];
                _updateIsValidating([name]);
                _updateIsFieldValueUpdated(fieldValue);
                if (isFieldValueUpdated) {
                    if (error) {
                        isValid = false;
                    }
                    else if (_proxyFormState.isValid) {
                        isValid = await executeBuiltInValidation(_fields, true);
                    }
                }
            }
            if (isFieldValueUpdated) {
                field._f.deps &&
                    trigger(field._f.deps);
                shouldRenderByError(name, isValid, error, fieldState);
            }
        }
    };
    const _focusInput = (ref, key) => {
        if (get(_formState.errors, key) && ref.focus) {
            ref.focus();
            return 1;
        }
        return;
    };
    const trigger = async (name, options = {}) => {
        let isValid;
        let validationResult;
        const fieldNames = convertToArrayPayload(name);
        if (_options.resolver) {
            const errors = await executeSchemaAndUpdateState(isUndefined(name) ? name : fieldNames);
            isValid = isEmptyObject(errors);
            validationResult = name
                ? !fieldNames.some((name) => get(errors, name))
                : isValid;
        }
        else if (name) {
            validationResult = (await Promise.all(fieldNames.map(async (fieldName) => {
                const field = get(_fields, fieldName);
                return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field);
            }))).every(Boolean);
            !(!validationResult && !_formState.isValid) && _updateValid();
        }
        else {
            validationResult = isValid = await executeBuiltInValidation(_fields);
        }
        _subjects.state.next({
            ...(!isString(name) ||
                (_proxyFormState.isValid && isValid !== _formState.isValid)
                ? {}
                : { name }),
            ...(_options.resolver || !name ? { isValid } : {}),
            errors: _formState.errors,
        });
        options.shouldFocus &&
            !validationResult &&
            iterateFieldsByAction(_fields, _focusInput, name ? fieldNames : _names.mount);
        return validationResult;
    };
    const getValues = (fieldNames) => {
        const values = {
            ...(_state.mount ? _formValues : _defaultValues),
        };
        return isUndefined(fieldNames)
            ? values
            : isString(fieldNames)
                ? get(values, fieldNames)
                : fieldNames.map((name) => get(values, name));
    };
    const getFieldState = (name, formState) => ({
        invalid: !!get((formState || _formState).errors, name),
        isDirty: !!get((formState || _formState).dirtyFields, name),
        error: get((formState || _formState).errors, name),
        isValidating: !!get(_formState.validatingFields, name),
        isTouched: !!get((formState || _formState).touchedFields, name),
    });
    const clearErrors = (name) => {
        name &&
            convertToArrayPayload(name).forEach((inputName) => unset(_formState.errors, inputName));
        _subjects.state.next({
            errors: name ? _formState.errors : {},
        });
    };
    const setError = (name, error, options) => {
        const ref = (get(_fields, name, { _f: {} })._f || {}).ref;
        const currentError = get(_formState.errors, name) || {};
        // Don't override existing error messages elsewhere in the object tree.
        const { ref: currentRef, message, type, ...restOfErrorTree } = currentError;
        set(_formState.errors, name, {
            ...restOfErrorTree,
            ...error,
            ref,
        });
        _subjects.state.next({
            name,
            errors: _formState.errors,
            isValid: false,
        });
        options && options.shouldFocus && ref && ref.focus && ref.focus();
    };
    const watch = (name, defaultValue) => isFunction(name)
        ? _subjects.values.subscribe({
            next: (payload) => name(_getWatch(undefined, defaultValue), payload),
        })
        : _getWatch(name, defaultValue, true);
    const unregister = (name, options = {}) => {
        for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) {
            _names.mount.delete(fieldName);
            _names.array.delete(fieldName);
            if (!options.keepValue) {
                unset(_fields, fieldName);
                unset(_formValues, fieldName);
            }
            !options.keepError && unset(_formState.errors, fieldName);
            !options.keepDirty && unset(_formState.dirtyFields, fieldName);
            !options.keepTouched && unset(_formState.touchedFields, fieldName);
            !options.keepIsValidating &&
                unset(_formState.validatingFields, fieldName);
            !_options.shouldUnregister &&
                !options.keepDefaultValue &&
                unset(_defaultValues, fieldName);
        }
        _subjects.values.next({
            values: { ..._formValues },
        });
        _subjects.state.next({
            ..._formState,
            ...(!options.keepDirty ? {} : { isDirty: _getDirty() }),
        });
        !options.keepIsValid && _updateValid();
    };
    const _updateDisabledField = ({ disabled, name, field, fields, value, }) => {
        if ((isBoolean(disabled) && _state.mount) || !!disabled) {
            const inputValue = disabled
                ? undefined
                : isUndefined(value)
                    ? getFieldValue(field ? field._f : get(fields, name)._f)
                    : value;
            set(_formValues, name, inputValue);
            updateTouchAndDirty(name, inputValue, false, false, true);
        }
    };
    const register = (name, options = {}) => {
        let field = get(_fields, name);
        const disabledIsDefined = isBoolean(options.disabled);
        set(_fields, name, {
            ...(field || {}),
            _f: {
                ...(field && field._f ? field._f : { ref: { name } }),
                name,
                mount: true,
                ...options,
            },
        });
        _names.mount.add(name);
        if (field) {
            _updateDisabledField({
                field,
                disabled: options.disabled,
                name,
                value: options.value,
            });
        }
        else {
            updateValidAndValue(name, true, options.value);
        }
        return {
            ...(disabledIsDefined ? { disabled: options.disabled } : {}),
            ...(_options.progressive
                ? {
                    required: !!options.required,
                    min: getRuleValue(options.min),
                    max: getRuleValue(options.max),
                    minLength: getRuleValue(options.minLength),
                    maxLength: getRuleValue(options.maxLength),
                    pattern: getRuleValue(options.pattern),
                }
                : {}),
            name,
            onChange,
            onBlur: onChange,
            ref: (ref) => {
                if (ref) {
                    register(name, options);
                    field = get(_fields, name);
                    const fieldRef = isUndefined(ref.value)
                        ? ref.querySelectorAll
                            ? ref.querySelectorAll('input,select,textarea')[0] || ref
                            : ref
                        : ref;
                    const radioOrCheckbox = isRadioOrCheckbox(fieldRef);
                    const refs = field._f.refs || [];
                    if (radioOrCheckbox
                        ? refs.find((option) => option === fieldRef)
                        : fieldRef === field._f.ref) {
                        return;
                    }
                    set(_fields, name, {
                        _f: {
                            ...field._f,
                            ...(radioOrCheckbox
                                ? {
                                    refs: [
                                        ...refs.filter(live),
                                        fieldRef,
                                        ...(Array.isArray(get(_defaultValues, name)) ? [{}] : []),
                                    ],
                                    ref: { type: fieldRef.type, name },
                                }
                                : { ref: fieldRef }),
                        },
                    });
                    updateValidAndValue(name, false, undefined, fieldRef);
                }
                else {
                    field = get(_fields, name, {});
                    if (field._f) {
                        field._f.mount = false;
                    }
                    (_options.shouldUnregister || options.shouldUnregister) &&
                        !(isNameInFieldArray(_names.array, name) && _state.action) &&
                        _names.unMount.add(name);
                }
            },
        };
    };
    const _focusError = () => _options.shouldFocusError &&
        iterateFieldsByAction(_fields, _focusInput, _names.mount);
    const _disableForm = (disabled) => {
        if (isBoolean(disabled)) {
            _subjects.state.next({ disabled });
            iterateFieldsByAction(_fields, (ref, name) => {
                const currentField = get(_fields, name);
                if (currentField) {
                    ref.disabled = currentField._f.disabled || disabled;
                    if (Array.isArray(currentField._f.refs)) {
                        currentField._f.refs.forEach((inputRef) => {
                            inputRef.disabled = currentField._f.disabled || disabled;
                        });
                    }
                }
            }, 0, false);
        }
    };
    const handleSubmit = (onValid, onInvalid) => async (e) => {
        let onValidError = undefined;
        if (e) {
            e.preventDefault && e.preventDefault();
            e.persist && e.persist();
        }
        let fieldValues = cloneObject(_formValues);
        _subjects.state.next({
            isSubmitting: true,
        });
        if (_options.resolver) {
            const { errors, values } = await _executeSchema();
            _formState.errors = errors;
            fieldValues = values;
        }
        else {
            await executeBuiltInValidation(_fields);
        }
        unset(_formState.errors, 'root');
        if (isEmptyObject(_formState.errors)) {
            _subjects.state.next({
                errors: {},
            });
            try {
                await onValid(fieldValues, e);
            }
            catch (error) {
                onValidError = error;
            }
        }
        else {
            if (onInvalid) {
                await onInvalid({ ..._formState.errors }, e);
            }
            _focusError();
            setTimeout(_focusError);
        }
        _subjects.state.next({
            isSubmitted: true,
            isSubmitting: false,
            isSubmitSuccessful: isEmptyObject(_formState.errors) && !onValidError,
            submitCount: _formState.submitCount + 1,
            errors: _formState.errors,
        });
        if (onValidError) {
            throw onValidError;
        }
    };
    const resetField = (name, options = {}) => {
        if (get(_fields, name)) {
            if (isUndefined(options.defaultValue)) {
                setValue(name, cloneObject(get(_defaultValues, name)));
            }
            else {
                setValue(name, options.defaultValue);
                set(_defaultValues, name, cloneObject(options.defaultValue));
            }
            if (!options.keepTouched) {
                unset(_formState.touchedFields, name);
            }
            if (!options.keepDirty) {
                unset(_formState.dirtyFields, name);
                _formState.isDirty = options.defaultValue
                    ? _getDirty(name, cloneObject(get(_defaultValues, name)))
                    : _getDirty();
            }
            if (!options.keepError) {
                unset(_formState.errors, name);
                _proxyFormState.isValid && _updateValid();
            }
            _subjects.state.next({ ..._formState });
        }
    };
    const _reset = (formValues, keepStateOptions = {}) => {
        const updatedValues = formValues ? cloneObject(formValues) : _defaultValues;
        const cloneUpdatedValues = cloneObject(updatedValues);
        const isEmptyResetValues = isEmptyObject(formValues);
        const values = isEmptyResetValues ? _defaultValues : cloneUpdatedValues;
        if (!keepStateOptions.keepDefaultValues) {
            _defaultValues = updatedValues;
        }
        if (!keepStateOptions.keepValues) {
            if (keepStateOptions.keepDirtyValues) {
                for (const fieldName of _names.mount) {
                    get(_formState.dirtyFields, fieldName)
                        ? set(values, fieldName, get(_formValues, fieldName))
                        : setValue(fieldName, get(values, fieldName));
                }
            }
            else {
                if (isWeb && isUndefined(formValues)) {
                    for (const name of _names.mount) {
                        const field = get(_fields, name);
                        if (field && field._f) {
                            const fieldReference = Array.isArray(field._f.refs)
                                ? field._f.refs[0]
                                : field._f.ref;
                            if (isHTMLElement(fieldReference)) {
                                const form = fieldReference.closest('form');
                                if (form) {
                                    form.reset();
                                    break;
                                }
                            }
                        }
                    }
                }
                _fields = {};
            }
            _formValues = props.shouldUnregister
                ? keepStateOptions.keepDefaultValues
                    ? cloneObject(_defaultValues)
                    : {}
                : cloneObject(values);
            _subjects.array.next({
                values: { ...values },
            });
            _subjects.values.next({
                values: { ...values },
            });
        }
        _names = {
            mount: keepStateOptions.keepDirtyValues ? _names.mount : new Set(),
            unMount: new Set(),
            array: new Set(),
            watch: new Set(),
            watchAll: false,
            focus: '',
        };
        _state.mount =
            !_proxyFormState.isValid ||
                !!keepStateOptions.keepIsValid ||
                !!keepStateOptions.keepDirtyValues;
        _state.watch = !!props.shouldUnregister;
        _subjects.state.next({
            submitCount: keepStateOptions.keepSubmitCount
                ? _formState.submitCount
                : 0,
            isDirty: isEmptyResetValues
                ? false
                : keepStateOptions.keepDirty
                    ? _formState.isDirty
                    : !!(keepStateOptions.keepDefaultValues &&
                        !deepEqual(formValues, _defaultValues)),
            isSubmitted: keepStateOptions.keepIsSubmitted
                ? _formState.isSubmitted
                : false,
            dirtyFields: isEmptyResetValues
                ? {}
                : keepStateOptions.keepDirtyValues
                    ? keepStateOptions.keepDefaultValues && _formValues
                        ? getDirtyFields(_defaultValues, _formValues)
                        : _formState.dirtyFields
                    : keepStateOptions.keepDefaultValues && formValues
                        ? getDirtyFields(_defaultValues, formValues)
                        : keepStateOptions.keepDirty
                            ? _formState.dirtyFields
                            : {},
            touchedFields: keepStateOptions.keepTouched
                ? _formState.touchedFields
                : {},
            errors: keepStateOptions.keepErrors ? _formState.errors : {},
            isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful
                ? _formState.isSubmitSuccessful
                : false,
            isSubmitting: false,
        });
    };
    const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues)
        ? formValues(_formValues)
        : formValues, keepStateOptions);
    const setFocus = (name, options = {}) => {
        const field = get(_fields, name);
        const fieldReference = field && field._f;
        if (fieldReference) {
            const fieldRef = fieldReference.refs
                ? fieldReference.refs[0]
                : fieldReference.ref;
            if (fieldRef.focus) {
                fieldRef.focus();
                options.shouldSelect && fieldRef.select();
            }
        }
    };
    const _updateFormState = (updatedFormState) => {
        _formState = {
            ..._formState,
            ...updatedFormState,
        };
    };
    const _resetDefaultValues = () => isFunction(_options.defaultValues) &&
        _options.defaultValues().then((values) => {
            reset(values, _options.resetOptions);
            _subjects.state.next({
                isLoading: false,
            });
        });
    return {
        control: {
            register,
            unregister,
            getFieldState,
            handleSubmit,
            setError,
            _executeSchema,
            _getWatch,
            _getDirty,
            _updateValid,
            _removeUnmounted,
            _updateFieldArray,
            _updateDisabledField,
            _getFieldArray,
            _reset,
            _resetDefaultValues,
            _updateFormState,
            _disableForm,
            _subjects,
            _proxyFormState,
            _setErrors,
            get _fields() {
                return _fields;
            },
            get _formValues() {
                return _formValues;
            },
            get _state() {
                return _state;
            },
            set _state(value) {
                _state = value;
            },
            get _defaultValues() {
                return _defaultValues;
            },
            get _names() {
                return _names;
            },
            set _names(value) {
                _names = value;
            },
            get _formState() {
                return _formState;
            },
            set _formState(value) {
                _formState = value;
            },
            get _options() {
                return _options;
            },
            set _options(value) {
                _options = {
                    ..._options,
                    ...value,
                };
            },
        },
        trigger,
        register,
        handleSubmit,
        watch,
        setValue,
        getValues,
        reset,
        resetField,
        clearErrors,
        unregister,
        setError,
        setFocus,
        getFieldState,
    };
}

/**
 * Custom hook to manage the entire form.
 *
 * @remarks
 * [API](https://react-hook-form.com/docs/useform) • [Demo](https://codesandbox.io/s/react-hook-form-get-started-ts-5ksmm) • [Video](https://www.youtube.com/watch?v=RkXv4AXXC_4)
 *
 * @param props - form configuration and validation parameters.
 *
 * @returns methods - individual functions to manage the form state. {@link UseFormReturn}
 *
 * @example
 * ```tsx
 * function App() {
 *   const { register, handleSubmit, watch, formState: { errors } } = useForm();
 *   const onSubmit = data => console.log(data);
 *
 *   console.log(watch("example"));
 *
 *   return (
 *     <form onSubmit={handleSubmit(onSubmit)}>
 *       <input defaultValue="test" {...register("example")} />
 *       <input {...register("exampleRequired", { required: true })} />
 *       {errors.exampleRequired && <span>This field is required</span>}
 *       <button>Submit</button>
 *     </form>
 *   );
 * }
 * ```
 */
function useForm(props = {}) {
    const _formControl = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
    const _values = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
    const [formState, updateFormState] = react__WEBPACK_IMPORTED_MODULE_0__.useState({
        isDirty: false,
        isValidating: false,
        isLoading: isFunction(props.defaultValues),
        isSubmitted: false,
        isSubmitting: false,
        isSubmitSuccessful: false,
        isValid: false,
        submitCount: 0,
        dirtyFields: {},
        touchedFields: {},
        validatingFields: {},
        errors: props.errors || {},
        disabled: props.disabled || false,
        defaultValues: isFunction(props.defaultValues)
            ? undefined
            : props.defaultValues,
    });
    if (!_formControl.current) {
        _formControl.current = {
            ...createFormControl(props),
            formState,
        };
    }
    const control = _formControl.current.control;
    control._options = props;
    useSubscribe({
        subject: control._subjects.state,
        next: (value) => {
            if (shouldRenderFormState(value, control._proxyFormState, control._updateFormState, true)) {
                updateFormState({ ...control._formState });
            }
        },
    });
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        if (control._proxyFormState.isDirty) {
            const isDirty = control._getDirty();
            if (isDirty !== formState.isDirty) {
                control._subjects.state.next({
                    isDirty,
                });
            }
        }
    }, [control, formState.isDirty]);
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        if (props.values && !deepEqual(props.values, _values.current)) {
            control._reset(props.values, control._options.resetOptions);
            _values.current = props.values;
            updateFormState((state) => ({ ...state }));
        }
        else {
            control._resetDefaultValues();
        }
    }, [props.values, control]);
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        if (props.errors) {
            control._setErrors(props.errors);
        }
    }, [props.errors, control]);
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        if (!control._state.mount) {
            control._updateValid();
            control._state.mount = true;
        }
        if (control._state.watch) {
            control._state.watch = false;
            control._subjects.state.next({ ...control._formState });
        }
        control._removeUnmounted();
    });
    react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
        props.shouldUnregister &&
            control._subjects.values.next({
                values: control._getWatch(),
            });
    }, [props.shouldUnregister, control]);
    _formControl.current.formState = getProxyFormState(formState, control);
    return _formControl.current;
}


//# sourceMappingURL=index.esm.mjs.map


/***/ }),

/***/ "../../../node_modules/react-is/cjs/react-is.development.js":
/*!******************************************************************!*\
  !*** ../../../node_modules/react-is/cjs/react-is.development.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";
/** @license React v16.13.1
 * react-is.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
// (unstable) APIs that have been removed. Can we remove the symbols?

var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;

function isValidElementType(type) {
  return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
}

function typeOf(object) {
  if (typeof object === 'object' && object !== null) {
    var $$typeof = object.$$typeof;

    switch ($$typeof) {
      case REACT_ELEMENT_TYPE:
        var type = object.type;

        switch (type) {
          case REACT_ASYNC_MODE_TYPE:
          case REACT_CONCURRENT_MODE_TYPE:
          case REACT_FRAGMENT_TYPE:
          case REACT_PROFILER_TYPE:
          case REACT_STRICT_MODE_TYPE:
          case REACT_SUSPENSE_TYPE:
            return type;

          default:
            var $$typeofType = type && type.$$typeof;

            switch ($$typeofType) {
              case REACT_CONTEXT_TYPE:
              case REACT_FORWARD_REF_TYPE:
              case REACT_LAZY_TYPE:
              case REACT_MEMO_TYPE:
              case REACT_PROVIDER_TYPE:
                return $$typeofType;

              default:
                return $$typeof;
            }

        }

      case REACT_PORTAL_TYPE:
        return $$typeof;
    }
  }

  return undefined;
} // AsyncMode is deprecated along with isAsyncMode

var AsyncMode = REACT_ASYNC_MODE_TYPE;
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated

function isAsyncMode(object) {
  {
    if (!hasWarnedAboutDeprecatedIsAsyncMode) {
      hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint

      console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
    }
  }

  return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
}
function isConcurrentMode(object) {
  return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
}
function isContextConsumer(object) {
  return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
  return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
  return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
  return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
  return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
  return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
  return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
  return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
  return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
  return typeOf(object) === REACT_SUSPENSE_TYPE;
}

exports.AsyncMode = AsyncMode;
exports.ConcurrentMode = ConcurrentMode;
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
  })();
}


/***/ }),

/***/ "../../../node_modules/react-is/index.js":
/*!***********************************************!*\
  !*** ../../../node_modules/react-is/index.js ***!
  \***********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


if (false) // removed by dead control flow
{} else {
  module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../../../node_modules/react-is/cjs/react-is.development.js");
}


/***/ }),

/***/ "../../../node_modules/react/cjs/react-jsx-runtime.development.js":
/*!************************************************************************!*\
  !*** ../../../node_modules/react/cjs/react-jsx-runtime.development.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";
/**
 * @license React
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


 true &&
  (function () {
    function getComponentNameFromType(type) {
      if (null == type) return null;
      if ("function" === typeof type)
        return type.$$typeof === REACT_CLIENT_REFERENCE$2
          ? null
          : type.displayName || type.name || null;
      if ("string" === typeof type) return type;
      switch (type) {
        case REACT_FRAGMENT_TYPE:
          return "Fragment";
        case REACT_PORTAL_TYPE:
          return "Portal";
        case REACT_PROFILER_TYPE:
          return "Profiler";
        case REACT_STRICT_MODE_TYPE:
          return "StrictMode";
        case REACT_SUSPENSE_TYPE:
          return "Suspense";
        case REACT_SUSPENSE_LIST_TYPE:
          return "SuspenseList";
      }
      if ("object" === typeof type)
        switch (
          ("number" === typeof type.tag &&
            console.error(
              "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
            ),
          type.$$typeof)
        ) {
          case REACT_CONTEXT_TYPE:
            return (type.displayName || "Context") + ".Provider";
          case REACT_CONSUMER_TYPE:
            return (type._context.displayName || "Context") + ".Consumer";
          case REACT_FORWARD_REF_TYPE:
            var innerType = type.render;
            type = type.displayName;
            type ||
              ((type = innerType.displayName || innerType.name || ""),
              (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
            return type;
          case REACT_MEMO_TYPE:
            return (
              (innerType = type.displayName || null),
              null !== innerType
                ? innerType
                : getComponentNameFromType(type.type) || "Memo"
            );
          case REACT_LAZY_TYPE:
            innerType = type._payload;
            type = type._init;
            try {
              return getComponentNameFromType(type(innerType));
            } catch (x) {}
        }
      return null;
    }
    function testStringCoercion(value) {
      return "" + value;
    }
    function checkKeyStringCoercion(value) {
      try {
        testStringCoercion(value);
        var JSCompiler_inline_result = !1;
      } catch (e) {
        JSCompiler_inline_result = !0;
      }
      if (JSCompiler_inline_result) {
        JSCompiler_inline_result = console;
        var JSCompiler_temp_const = JSCompiler_inline_result.error;
        var JSCompiler_inline_result$jscomp$0 =
          ("function" === typeof Symbol &&
            Symbol.toStringTag &&
            value[Symbol.toStringTag]) ||
          value.constructor.name ||
          "Object";
        JSCompiler_temp_const.call(
          JSCompiler_inline_result,
          "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
          JSCompiler_inline_result$jscomp$0
        );
        return testStringCoercion(value);
      }
    }
    function disabledLog() {}
    function disableLogs() {
      if (0 === disabledDepth) {
        prevLog = console.log;
        prevInfo = console.info;
        prevWarn = console.warn;
        prevError = console.error;
        prevGroup = console.group;
        prevGroupCollapsed = console.groupCollapsed;
        prevGroupEnd = console.groupEnd;
        var props = {
          configurable: !0,
          enumerable: !0,
          value: disabledLog,
          writable: !0
        };
        Object.defineProperties(console, {
          info: props,
          log: props,
          warn: props,
          error: props,
          group: props,
          groupCollapsed: props,
          groupEnd: props
        });
      }
      disabledDepth++;
    }
    function reenableLogs() {
      disabledDepth--;
      if (0 === disabledDepth) {
        var props = { configurable: !0, enumerable: !0, writable: !0 };
        Object.defineProperties(console, {
          log: assign({}, props, { value: prevLog }),
          info: assign({}, props, { value: prevInfo }),
          warn: assign({}, props, { value: prevWarn }),
          error: assign({}, props, { value: prevError }),
          group: assign({}, props, { value: prevGroup }),
          groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
          groupEnd: assign({}, props, { value: prevGroupEnd })
        });
      }
      0 > disabledDepth &&
        console.error(
          "disabledDepth fell below zero. This is a bug in React. Please file an issue."
        );
    }
    function describeBuiltInComponentFrame(name) {
      if (void 0 === prefix)
        try {
          throw Error();
        } catch (x) {
          var match = x.stack.trim().match(/\n( *(at )?)/);
          prefix = (match && match[1]) || "";
          suffix =
            -1 < x.stack.indexOf("\n    at")
              ? " (<anonymous>)"
              : -1 < x.stack.indexOf("@")
                ? "@unknown:0:0"
                : "";
        }
      return "\n" + prefix + name + suffix;
    }
    function describeNativeComponentFrame(fn, construct) {
      if (!fn || reentry) return "";
      var frame = componentFrameCache.get(fn);
      if (void 0 !== frame) return frame;
      reentry = !0;
      frame = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var previousDispatcher = null;
      previousDispatcher = ReactSharedInternals.H;
      ReactSharedInternals.H = null;
      disableLogs();
      try {
        var RunInRootFrame = {
          DetermineComponentFrameRoot: function () {
            try {
              if (construct) {
                var Fake = function () {
                  throw Error();
                };
                Object.defineProperty(Fake.prototype, "props", {
                  set: function () {
                    throw Error();
                  }
                });
                if ("object" === typeof Reflect && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x) {
                    var control = x;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x$0) {
                    control = x$0;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x$1) {
                  control = x$1;
                }
                (Fake = fn()) &&
                  "function" === typeof Fake.catch &&
                  Fake.catch(function () {});
              }
            } catch (sample) {
              if (sample && control && "string" === typeof sample.stack)
                return [sample.stack, control.stack];
            }
            return [null, null];
          }
        };
        RunInRootFrame.DetermineComponentFrameRoot.displayName =
          "DetermineComponentFrameRoot";
        var namePropDescriptor = Object.getOwnPropertyDescriptor(
          RunInRootFrame.DetermineComponentFrameRoot,
          "name"
        );
        namePropDescriptor &&
          namePropDescriptor.configurable &&
          Object.defineProperty(
            RunInRootFrame.DetermineComponentFrameRoot,
            "name",
            { value: "DetermineComponentFrameRoot" }
          );
        var _RunInRootFrame$Deter =
            RunInRootFrame.DetermineComponentFrameRoot(),
          sampleStack = _RunInRootFrame$Deter[0],
          controlStack = _RunInRootFrame$Deter[1];
        if (sampleStack && controlStack) {
          var sampleLines = sampleStack.split("\n"),
            controlLines = controlStack.split("\n");
          for (
            _RunInRootFrame$Deter = namePropDescriptor = 0;
            namePropDescriptor < sampleLines.length &&
            !sampleLines[namePropDescriptor].includes(
              "DetermineComponentFrameRoot"
            );

          )
            namePropDescriptor++;
          for (
            ;
            _RunInRootFrame$Deter < controlLines.length &&
            !controlLines[_RunInRootFrame$Deter].includes(
              "DetermineComponentFrameRoot"
            );

          )
            _RunInRootFrame$Deter++;
          if (
            namePropDescriptor === sampleLines.length ||
            _RunInRootFrame$Deter === controlLines.length
          )
            for (
              namePropDescriptor = sampleLines.length - 1,
                _RunInRootFrame$Deter = controlLines.length - 1;
              1 <= namePropDescriptor &&
              0 <= _RunInRootFrame$Deter &&
              sampleLines[namePropDescriptor] !==
                controlLines[_RunInRootFrame$Deter];

            )
              _RunInRootFrame$Deter--;
          for (
            ;
            1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;
            namePropDescriptor--, _RunInRootFrame$Deter--
          )
            if (
              sampleLines[namePropDescriptor] !==
              controlLines[_RunInRootFrame$Deter]
            ) {
              if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
                do
                  if (
                    (namePropDescriptor--,
                    _RunInRootFrame$Deter--,
                    0 > _RunInRootFrame$Deter ||
                      sampleLines[namePropDescriptor] !==
                        controlLines[_RunInRootFrame$Deter])
                  ) {
                    var _frame =
                      "\n" +
                      sampleLines[namePropDescriptor].replace(
                        " at new ",
                        " at "
                      );
                    fn.displayName &&
                      _frame.includes("<anonymous>") &&
                      (_frame = _frame.replace("<anonymous>", fn.displayName));
                    "function" === typeof fn &&
                      componentFrameCache.set(fn, _frame);
                    return _frame;
                  }
                while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
              }
              break;
            }
        }
      } finally {
        (reentry = !1),
          (ReactSharedInternals.H = previousDispatcher),
          reenableLogs(),
          (Error.prepareStackTrace = frame);
      }
      sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
        ? describeBuiltInComponentFrame(sampleLines)
        : "";
      "function" === typeof fn && componentFrameCache.set(fn, sampleLines);
      return sampleLines;
    }
    function describeUnknownElementTypeFrameInDEV(type) {
      if (null == type) return "";
      if ("function" === typeof type) {
        var prototype = type.prototype;
        return describeNativeComponentFrame(
          type,
          !(!prototype || !prototype.isReactComponent)
        );
      }
      if ("string" === typeof type) return describeBuiltInComponentFrame(type);
      switch (type) {
        case REACT_SUSPENSE_TYPE:
          return describeBuiltInComponentFrame("Suspense");
        case REACT_SUSPENSE_LIST_TYPE:
          return describeBuiltInComponentFrame("SuspenseList");
      }
      if ("object" === typeof type)
        switch (type.$$typeof) {
          case REACT_FORWARD_REF_TYPE:
            return (type = describeNativeComponentFrame(type.render, !1)), type;
          case REACT_MEMO_TYPE:
            return describeUnknownElementTypeFrameInDEV(type.type);
          case REACT_LAZY_TYPE:
            prototype = type._payload;
            type = type._init;
            try {
              return describeUnknownElementTypeFrameInDEV(type(prototype));
            } catch (x) {}
        }
      return "";
    }
    function getOwner() {
      var dispatcher = ReactSharedInternals.A;
      return null === dispatcher ? null : dispatcher.getOwner();
    }
    function hasValidKey(config) {
      if (hasOwnProperty.call(config, "key")) {
        var getter = Object.getOwnPropertyDescriptor(config, "key").get;
        if (getter && getter.isReactWarning) return !1;
      }
      return void 0 !== config.key;
    }
    function defineKeyPropWarningGetter(props, displayName) {
      function warnAboutAccessingKey() {
        specialPropKeyWarningShown ||
          ((specialPropKeyWarningShown = !0),
          console.error(
            "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
            displayName
          ));
      }
      warnAboutAccessingKey.isReactWarning = !0;
      Object.defineProperty(props, "key", {
        get: warnAboutAccessingKey,
        configurable: !0
      });
    }
    function elementRefGetterWithDeprecationWarning() {
      var componentName = getComponentNameFromType(this.type);
      didWarnAboutElementRef[componentName] ||
        ((didWarnAboutElementRef[componentName] = !0),
        console.error(
          "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
        ));
      componentName = this.props.ref;
      return void 0 !== componentName ? componentName : null;
    }
    function ReactElement(type, key, self, source, owner, props) {
      self = props.ref;
      type = {
        $$typeof: REACT_ELEMENT_TYPE,
        type: type,
        key: key,
        props: props,
        _owner: owner
      };
      null !== (void 0 !== self ? self : null)
        ? Object.defineProperty(type, "ref", {
            enumerable: !1,
            get: elementRefGetterWithDeprecationWarning
          })
        : Object.defineProperty(type, "ref", { enumerable: !1, value: null });
      type._store = {};
      Object.defineProperty(type._store, "validated", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: 0
      });
      Object.defineProperty(type, "_debugInfo", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: null
      });
      Object.freeze && (Object.freeze(type.props), Object.freeze(type));
      return type;
    }
    function jsxDEVImpl(
      type,
      config,
      maybeKey,
      isStaticChildren,
      source,
      self
    ) {
      if (
        "string" === typeof type ||
        "function" === typeof type ||
        type === REACT_FRAGMENT_TYPE ||
        type === REACT_PROFILER_TYPE ||
        type === REACT_STRICT_MODE_TYPE ||
        type === REACT_SUSPENSE_TYPE ||
        type === REACT_SUSPENSE_LIST_TYPE ||
        type === REACT_OFFSCREEN_TYPE ||
        ("object" === typeof type &&
          null !== type &&
          (type.$$typeof === REACT_LAZY_TYPE ||
            type.$$typeof === REACT_MEMO_TYPE ||
            type.$$typeof === REACT_CONTEXT_TYPE ||
            type.$$typeof === REACT_CONSUMER_TYPE ||
            type.$$typeof === REACT_FORWARD_REF_TYPE ||
            type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
            void 0 !== type.getModuleId))
      ) {
        var children = config.children;
        if (void 0 !== children)
          if (isStaticChildren)
            if (isArrayImpl(children)) {
              for (
                isStaticChildren = 0;
                isStaticChildren < children.length;
                isStaticChildren++
              )
                validateChildKeys(children[isStaticChildren], type);
              Object.freeze && Object.freeze(children);
            } else
              console.error(
                "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
              );
          else validateChildKeys(children, type);
      } else {
        children = "";
        if (
          void 0 === type ||
          ("object" === typeof type &&
            null !== type &&
            0 === Object.keys(type).length)
        )
          children +=
            " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
        null === type
          ? (isStaticChildren = "null")
          : isArrayImpl(type)
            ? (isStaticChildren = "array")
            : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
              ? ((isStaticChildren =
                  "<" +
                  (getComponentNameFromType(type.type) || "Unknown") +
                  " />"),
                (children =
                  " Did you accidentally export a JSX literal instead of a component?"))
              : (isStaticChildren = typeof type);
        console.error(
          "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
          isStaticChildren,
          children
        );
      }
      if (hasOwnProperty.call(config, "key")) {
        children = getComponentNameFromType(type);
        var keys = Object.keys(config).filter(function (k) {
          return "key" !== k;
        });
        isStaticChildren =
          0 < keys.length
            ? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
            : "{key: someKey}";
        didWarnAboutKeySpread[children + isStaticChildren] ||
          ((keys =
            0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
          console.error(
            'A props object containing a "key" prop is being spread into JSX:\n  let props = %s;\n  <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n  let props = %s;\n  <%s key={someKey} {...props} />',
            isStaticChildren,
            children,
            keys,
            children
          ),
          (didWarnAboutKeySpread[children + isStaticChildren] = !0));
      }
      children = null;
      void 0 !== maybeKey &&
        (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
      hasValidKey(config) &&
        (checkKeyStringCoercion(config.key), (children = "" + config.key));
      if ("key" in config) {
        maybeKey = {};
        for (var propName in config)
          "key" !== propName && (maybeKey[propName] = config[propName]);
      } else maybeKey = config;
      children &&
        defineKeyPropWarningGetter(
          maybeKey,
          "function" === typeof type
            ? type.displayName || type.name || "Unknown"
            : type
        );
      return ReactElement(type, children, self, source, getOwner(), maybeKey);
    }
    function validateChildKeys(node, parentType) {
      if (
        "object" === typeof node &&
        node &&
        node.$$typeof !== REACT_CLIENT_REFERENCE
      )
        if (isArrayImpl(node))
          for (var i = 0; i < node.length; i++) {
            var child = node[i];
            isValidElement(child) && validateExplicitKey(child, parentType);
          }
        else if (isValidElement(node))
          node._store && (node._store.validated = 1);
        else if (
          (null === node || "object" !== typeof node
            ? (i = null)
            : ((i =
                (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||
                node["@@iterator"]),
              (i = "function" === typeof i ? i : null)),
          "function" === typeof i &&
            i !== node.entries &&
            ((i = i.call(node)), i !== node))
        )
          for (; !(node = i.next()).done; )
            isValidElement(node.value) &&
              validateExplicitKey(node.value, parentType);
    }
    function isValidElement(object) {
      return (
        "object" === typeof object &&
        null !== object &&
        object.$$typeof === REACT_ELEMENT_TYPE
      );
    }
    function validateExplicitKey(element, parentType) {
      if (
        element._store &&
        !element._store.validated &&
        null == element.key &&
        ((element._store.validated = 1),
        (parentType = getCurrentComponentErrorInfo(parentType)),
        !ownerHasKeyUseWarning[parentType])
      ) {
        ownerHasKeyUseWarning[parentType] = !0;
        var childOwner = "";
        element &&
          null != element._owner &&
          element._owner !== getOwner() &&
          ((childOwner = null),
          "number" === typeof element._owner.tag
            ? (childOwner = getComponentNameFromType(element._owner.type))
            : "string" === typeof element._owner.name &&
              (childOwner = element._owner.name),
          (childOwner = " It was passed a child from " + childOwner + "."));
        var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
        ReactSharedInternals.getCurrentStack = function () {
          var stack = describeUnknownElementTypeFrameInDEV(element.type);
          prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
          return stack;
        };
        console.error(
          'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
          parentType,
          childOwner
        );
        ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
      }
    }
    function getCurrentComponentErrorInfo(parentType) {
      var info = "",
        owner = getOwner();
      owner &&
        (owner = getComponentNameFromType(owner.type)) &&
        (info = "\n\nCheck the render method of `" + owner + "`.");
      info ||
        ((parentType = getComponentNameFromType(parentType)) &&
          (info =
            "\n\nCheck the top-level render call using <" + parentType + ">."));
      return info;
    }
    var React = __webpack_require__(/*! react */ "react"),
      REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
      REACT_PORTAL_TYPE = Symbol.for("react.portal"),
      REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
      REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
      REACT_PROFILER_TYPE = Symbol.for("react.profiler");
    Symbol.for("react.provider");
    var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
      REACT_CONTEXT_TYPE = Symbol.for("react.context"),
      REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
      REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
      REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
      REACT_MEMO_TYPE = Symbol.for("react.memo"),
      REACT_LAZY_TYPE = Symbol.for("react.lazy"),
      REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
      MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
      REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
      ReactSharedInternals =
        React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
      hasOwnProperty = Object.prototype.hasOwnProperty,
      assign = Object.assign,
      REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
      isArrayImpl = Array.isArray,
      disabledDepth = 0,
      prevLog,
      prevInfo,
      prevWarn,
      prevError,
      prevGroup,
      prevGroupCollapsed,
      prevGroupEnd;
    disabledLog.__reactDisabledLog = !0;
    var prefix,
      suffix,
      reentry = !1;
    var componentFrameCache = new (
      "function" === typeof WeakMap ? WeakMap : Map
    )();
    var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
      specialPropKeyWarningShown;
    var didWarnAboutElementRef = {};
    var didWarnAboutKeySpread = {},
      ownerHasKeyUseWarning = {};
    exports.Fragment = REACT_FRAGMENT_TYPE;
    exports.jsx = function (type, config, maybeKey, source, self) {
      return jsxDEVImpl(type, config, maybeKey, !1, source, self);
    };
    exports.jsxs = function (type, config, maybeKey, source, self) {
      return jsxDEVImpl(type, config, maybeKey, !0, source, self);
    };
  })();


/***/ }),

/***/ "../../../node_modules/react/jsx-runtime.js":
/*!**************************************************!*\
  !*** ../../../node_modules/react/jsx-runtime.js ***!
  \**************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


if (false) // removed by dead control flow
{} else {
  module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "../../../node_modules/react/cjs/react-jsx-runtime.development.js");
}


/***/ }),

/***/ "./node_modules/react-responsive/dist/esm/index.js":
/*!*********************************************************!*\
  !*** ./node_modules/react-responsive/dist/esm/index.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MediaQuery)
/* harmony export */ });
/* unused harmony exports Context, MediaQuery, toQuery, useMediaQuery */
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var matchmediaquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! matchmediaquery */ "../../../node_modules/matchmediaquery/index.js");
/* harmony import */ var matchmediaquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(matchmediaquery__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var hyphenate_style_name__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! hyphenate-style-name */ "../../../node_modules/hyphenate-style-name/index.js");
/* harmony import */ var shallow_equal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shallow-equal */ "./node_modules/shallow-equal/dist/index.modern.mjs");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);






const stringOrNumber = prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number)]);
// media types
const types = {
    all: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    grid: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    aural: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    braille: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    handheld: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    print: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    projection: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    screen: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    tty: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    tv: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    embossed: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool)
};
// properties that match media queries
const matchers = {
    orientation: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(['portrait', 'landscape']),
    scan: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(['progressive', 'interlace']),
    aspectRatio: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
    deviceAspectRatio: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
    height: stringOrNumber,
    deviceHeight: stringOrNumber,
    width: stringOrNumber,
    deviceWidth: stringOrNumber,
    color: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    colorIndex: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    monochrome: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
    resolution: stringOrNumber,
    type: Object.keys(types)
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { type, ...featureMatchers } = matchers;
// media features
const features = {
    minAspectRatio: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
    maxAspectRatio: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
    minDeviceAspectRatio: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
    maxDeviceAspectRatio: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
    minHeight: stringOrNumber,
    maxHeight: stringOrNumber,
    minDeviceHeight: stringOrNumber,
    maxDeviceHeight: stringOrNumber,
    minWidth: stringOrNumber,
    maxWidth: stringOrNumber,
    minDeviceWidth: stringOrNumber,
    maxDeviceWidth: stringOrNumber,
    minColor: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
    maxColor: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
    minColorIndex: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
    maxColorIndex: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
    minMonochrome: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
    maxMonochrome: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
    minResolution: stringOrNumber,
    maxResolution: stringOrNumber,
    ...featureMatchers
};
const all = { ...types, ...features };
var mq = {
    all: all,
    types: types,
    matchers: matchers,
    features: features
};

const negate = (cond) => `not ${cond}`;
const keyVal = (k, v) => {
    const realKey = (0,hyphenate_style_name__WEBPACK_IMPORTED_MODULE_2__["default"])(k);
    // px shorthand
    if (typeof v === 'number') {
        v = `${v}px`;
    }
    if (v === true) {
        return realKey;
    }
    if (v === false) {
        return negate(realKey);
    }
    return `(${realKey}: ${v})`;
};
const join = (conds) => conds.join(' and ');
const toQuery = (obj) => {
    const rules = [];
    Object.keys(mq.all).forEach((k) => {
        const v = obj[k];
        if (v != null) {
            rules.push(keyVal(k, v));
        }
    });
    return join(rules);
};

const Context = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(undefined);

const makeQuery = (settings) => settings.query || toQuery(settings);
const hyphenateKeys = (obj) => {
    if (!obj)
        return undefined;
    const keys = Object.keys(obj);
    return keys.reduce((result, key) => {
        result[(0,hyphenate_style_name__WEBPACK_IMPORTED_MODULE_2__["default"])(key)] = obj[key];
        return result;
    }, {});
};
const useIsUpdate = () => {
    const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        ref.current = true;
    }, []);
    return ref.current;
};
const useDevice = (deviceFromProps) => {
    const deviceFromContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(Context);
    const getDevice = () => hyphenateKeys(deviceFromProps) || hyphenateKeys(deviceFromContext);
    const [device, setDevice] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(getDevice);
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        const newDevice = getDevice();
        if (!(0,shallow_equal__WEBPACK_IMPORTED_MODULE_3__.shallowEqualObjects)(device, newDevice)) {
            setDevice(newDevice);
        }
    }, [deviceFromProps, deviceFromContext]);
    return device;
};
const useQuery = (settings) => {
    const getQuery = () => makeQuery(settings);
    const [query, setQuery] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(getQuery);
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        const newQuery = getQuery();
        if (query !== newQuery) {
            setQuery(newQuery);
        }
    }, [settings]);
    return query;
};
const useMatchMedia = (query, device) => {
    const getMatchMedia = () => matchmediaquery__WEBPACK_IMPORTED_MODULE_1___default()(query, device || {}, !!device);
    const [mq, setMq] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(getMatchMedia);
    const isUpdate = useIsUpdate();
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        if (isUpdate) {
            // skip on mounting, it has already been set
            const newMq = getMatchMedia();
            setMq(newMq);
            return () => {
                if (newMq) {
                    newMq.dispose();
                }
            };
        }
    }, [query, device]);
    return mq;
};
const useMatches = (mediaQuery) => {
    const [matches, setMatches] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(mediaQuery.matches);
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        const updateMatches = (ev) => {
            setMatches(ev.matches);
        };
        mediaQuery.addListener(updateMatches);
        setMatches(mediaQuery.matches);
        return () => {
            mediaQuery.removeListener(updateMatches);
        };
    }, [mediaQuery]);
    return matches;
};
const useMediaQuery = (settings, device, onChange) => {
    const deviceSettings = useDevice(device);
    const query = useQuery(settings);
    if (!query)
        throw new Error('Invalid or missing MediaQuery!');
    const mq = useMatchMedia(query, deviceSettings);
    const matches = useMatches(mq);
    const isUpdate = useIsUpdate();
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        if (isUpdate && onChange) {
            onChange(matches);
        }
    }, [matches]);
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => () => {
        if (mq) {
            mq.dispose();
        }
    }, []);
    return matches;
};

// ReactNode and ReactElement typings are a little funky for functional components, so the ReactElement cast is needed on the return
const MediaQuery = ({ children, device, onChange, ...settings }) => {
    const matches = useMediaQuery(settings, device, onChange);
    if (typeof children === 'function') {
        return children(matches);
    }
    return matches ? children : null;
};


//# sourceMappingURL=index.js.map


/***/ }),

/***/ "./node_modules/shallow-equal/dist/index.modern.mjs":
/*!**********************************************************!*\
  !*** ./node_modules/shallow-equal/dist/index.modern.mjs ***!
  \**********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shallowEqualObjects: () => (/* binding */ shallowEqualObjects)
/* harmony export */ });
/* unused harmony exports shallowEqual, shallowEqualArrays */
function shallowEqualArrays(arrA, arrB) {
  if (arrA === arrB) {
    return true;
  }
  if (!arrA || !arrB) {
    return false;
  }
  const len = arrA.length;
  if (arrB.length !== len) {
    return false;
  }
  for (let i = 0; i < len; i++) {
    if (arrA[i] !== arrB[i]) {
      return false;
    }
  }
  return true;
}

function shallowEqualObjects(objA, objB) {
  if (objA === objB) {
    return true;
  }
  if (!objA || !objB) {
    return false;
  }
  const aKeys = Object.keys(objA);
  const bKeys = Object.keys(objB);
  const len = aKeys.length;
  if (bKeys.length !== len) {
    return false;
  }
  for (let i = 0; i < len; i++) {
    const key = aKeys[i];
    if (objA[key] !== objB[key] || !Object.prototype.hasOwnProperty.call(objB, key)) {
      return false;
    }
  }
  return true;
}

function shallowEqual(a, b) {
  const aIsArr = Array.isArray(a);
  const bIsArr = Array.isArray(b);
  if (aIsArr !== bIsArr) {
    return false;
  }
  if (aIsArr && bIsArr) {
    return shallowEqualArrays(a, b);
  }
  return shallowEqualObjects(a, b);
}


//# sourceMappingURL=index.modern.mjs.map


/***/ }),

/***/ "./src/App.js":
/*!********************!*\
  !*** ./src/App.js ***!
  \********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DigitApp: () => (/* binding */ DigitApp),
/* harmony export */   DigitAppWrapper: () => (/* binding */ DigitAppWrapper)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }





// Create lazy components with fallbacks using the utility

var CitizenApp = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./pages/citizen */ "./src/pages/citizen/index.js")), () => (__webpack_require__(/*! ./pages/citizen */ "./src/pages/citizen/index.js")["default"]), {
  loaderText: "CORE_LOADING_CITIZEN_APP"
});
var EmployeeApp = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./pages/employee */ "./src/pages/employee/index.js")), () => (__webpack_require__(/*! ./pages/employee */ "./src/pages/employee/index.js")["default"]), {
  loaderText: "CORE_LOADING_EMPLOYEE_APP"
});
var SignUp = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./pages/employee/SignUp */ "./src/pages/employee/SignUp/index.js")), () => (__webpack_require__(/*! ./pages/employee/SignUp */ "./src/pages/employee/SignUp/index.js")["default"]), {
  loaderText: "CORE_LOADING_SIGN_UP"
});
var Otp = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./pages/employee/Otp */ "./src/pages/employee/Otp/index.js")), () => (__webpack_require__(/*! ./pages/employee/Otp */ "./src/pages/employee/Otp/index.js")["default"]), {
  loaderText: "CORE_LOADING_OTP"
});
var ViewUrl = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./pages/employee/ViewUrl */ "./src/pages/employee/ViewUrl/index.js")), () => (__webpack_require__(/*! ./pages/employee/ViewUrl */ "./src/pages/employee/ViewUrl/index.js")["default"]), {
  loaderText: "CORE_LOADING_VIEW_URL"
});
var CustomErrorComponent = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./components/CustomErrorComponent */ "./src/components/CustomErrorComponent.js")), () => (__webpack_require__(/*! ./components/CustomErrorComponent */ "./src/components/CustomErrorComponent.js")["default"]), {
  loaderText: "CORE_LOADING_ERROR_COMPONENT"
});
var DummyLoaderScreen = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./components/DummyLoader */ "./src/components/DummyLoader.js")), () => (__webpack_require__(/*! ./components/DummyLoader */ "./src/components/DummyLoader.js")["default"]), {
  loaderText: "CORE_LOADING"
});
var DigitApp = _ref => {
  var _userDetails$info, _window, _window2, _window3, _window4;
  var {
    stateCode,
    modules,
    appTenants,
    logoUrl,
    logoUrlWhite,
    initData,
    defaultLanding = "citizen",
    allowedUserTypes = ["citizen", "employee"]
  } = _ref;
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_1__.useNavigate)();
  var {
    pathname
  } = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_1__.useLocation)();
  var innerWidth = window.innerWidth;
  var cityDetails = Digit.ULBService.getCurrentUlb();
  var userDetails = Digit.UserService.getUser();
  var {
    data: storeData
  } = Digit.Hooks.useStore.getInitData();
  var {
    stateInfo
  } = storeData || {};
  var DSO = Digit.UserService.hasAccess(["FSM_DSO"]);
  var CITIZEN = (userDetails === null || userDetails === 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;
  if (window.location.pathname.split("/").includes("employee")) CITIZEN = false;
  var handleUserDropdownSelection = option => {
    option.func();
  };
  var mobileView = innerWidth <= 640;
  var sourceUrl = "".concat(window.location.origin, "/citizen");
  var commonProps = {
    stateInfo,
    userDetails,
    CITIZEN,
    cityDetails,
    mobileView,
    handleUserDropdownSelection,
    logoUrl,
    logoUrlWhite,
    DSO,
    stateCode,
    modules,
    appTenants,
    sourceUrl,
    pathname,
    initData
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Routes, {
    children: [(allowedUserTypes === null || allowedUserTypes === void 0 ? void 0 : allowedUserTypes.includes("employee")) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
      path: "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/employee/*"),
      element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(EmployeeApp, _objectSpread({}, commonProps))
    }), (allowedUserTypes === null || allowedUserTypes === void 0 ? void 0 : allowedUserTypes.includes("citizen")) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
      path: "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/citizen/*"),
      element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(CitizenApp, _objectSpread({}, commonProps))
    }), (allowedUserTypes === null || allowedUserTypes === void 0 ? void 0 : allowedUserTypes.includes("employee")) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
      path: "/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/no-top-bar/employee"),
      element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(EmployeeApp, _objectSpread(_objectSpread({}, commonProps), {}, {
        noTopBar: true
      }))
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
      path: "*",
      element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Navigate, {
        to: "/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/").concat(defaultLanding)
      })
    })]
  });
};
var DigitAppWrapper = _ref2 => {
  var _userDetails$info2, _window5, _window6, _window7, _window8, _window9, _window0, _window1, _window10, _window11;
  var {
    stateCode,
    modules,
    appTenants,
    logoUrl,
    logoUrlWhite,
    initData,
    defaultLanding = "citizen",
    allowedUserTypes
  } = _ref2;
  // const globalPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") || "digit-ui";
  var {
    data: storeData
  } = Digit.Hooks.useStore.getInitData();
  var {
    stateInfo
  } = storeData || {};
  var userScreensExempted = ["user/error"];
  var isUserProfile = userScreensExempted.some(url => {
    var _location;
    return (_location = location) === null || _location === void 0 || (_location = _location.pathname) === null || _location === void 0 ? void 0 : _location.includes(url);
  });
  var userDetails = Digit.UserService.getUser();
  var CITIZEN = (userDetails === null || userDetails === void 0 || (_userDetails$info2 = userDetails.info) === null || _userDetails$info2 === void 0 ? void 0 : _userDetails$info2.type) === "CITIZEN" || !window.location.pathname.split("/").includes("employee") ? true : false;
  var innerWidth = window.innerWidth;
  var mobileView = innerWidth <= 640;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
    className: isUserProfile ? "grounded-container" : "loginContainer",
    style: isUserProfile ? {
      padding: 0,
      paddingTop: CITIZEN ? "0" : mobileView && !CITIZEN ? "3rem" : "80px",
      marginLeft: CITIZEN || mobileView ? "0" : "40px"
    } : {
      "--banner-url": "url(".concat(stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl, ")"),
      padding: "0px"
    },
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Routes, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.globalPath, "/user/invalid-url"),
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(CustomErrorComponent, {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "/".concat((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.globalPath, "/user/sign-up"),
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(SignUp, {
          stateCode: stateCode
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "/".concat((_window7 = window) === null || _window7 === void 0 ? void 0 : _window7.globalPath, "/user/otp"),
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Otp, {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "/".concat((_window8 = window) === null || _window8 === void 0 ? void 0 : _window8.globalPath, "/user/setup"),
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(DummyLoaderScreen, {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "/".concat((_window9 = window) === null || _window9 === void 0 ? void 0 : _window9.globalPath, "/user/url"),
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(ViewUrl, {})
      }), ((_window0 = window) === null || _window0 === void 0 ? void 0 : _window0.globalPath) !== ((_window1 = window) === null || _window1 === void 0 ? void 0 : _window1.contextPath) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "/".concat((_window10 = window) === null || _window10 === void 0 ? void 0 : _window10.contextPath, "/*"),
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(DigitApp, {
          stateCode: stateCode,
          modules: modules,
          appTenants: appTenants,
          logoUrl: logoUrl,
          logoUrlWhite: logoUrlWhite,
          initData: initData,
          defaultLanding: defaultLanding,
          allowedUserTypes: allowedUserTypes
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "*",
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Navigate, {
          to: "/".concat((_window11 = window) === null || _window11 === void 0 ? void 0 : _window11.globalPath, "/user/sign-up")
        })
      })]
    })
  });
};

/***/ }),

/***/ "./src/Module.js":
/*!***********************!*\
  !*** ./src/Module.js ***!
  \***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DigitUI: () => (/* binding */ DigitUI),
/* harmony export */   initCoreComponents: () => (/* binding */ initCoreComponents)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tanstack/react-query */ "@tanstack/react-query");
/* harmony import */ var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-redux */ "react-redux");
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _App__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./App */ "./src/App.js");
/* harmony import */ var _pages_citizen_Login_SelectOtp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./pages/citizen/Login/SelectOtp */ "./src/pages/citizen/Login/SelectOtp.js");
/* harmony import */ var _components_ChangeCity__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/ChangeCity */ "./src/components/ChangeCity.js");
/* harmony import */ var _components_ChangeLanguage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/ChangeLanguage */ "./src/components/ChangeLanguage.js");
/* harmony import */ var _components_ErrorBoundaries__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./components/ErrorBoundaries */ "./src/components/ErrorBoundaries.js");
/* harmony import */ var _redux_store__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./redux/store */ "./src/redux/store.js");
/* harmony import */ var _components_PrivacyComponent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./components/PrivacyComponent */ "./src/components/PrivacyComponent.js");
/* harmony import */ var _pages_employee_Otp_OtpCustomComponent__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./pages/employee/Otp/OtpCustomComponent */ "./src/pages/employee/Otp/OtpCustomComponent.js");
/* harmony import */ var _components_LoginSignupSelector__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./components/LoginSignupSelector */ "./src/components/LoginSignupSelector.js");
/* harmony import */ var _components_ForgotOrganizationTooltip__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./components/ForgotOrganizationTooltip */ "./src/components/ForgotOrganizationTooltip.js");
/* harmony import */ var _components_EmployeeSSOLoginOptions__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./components/EmployeeSSOLoginOptions */ "./src/components/EmployeeSSOLoginOptions.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }




















// Create QueryClient instance outside component to prevent recreation

var createQueryClient = () => new _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.QueryClient({
  defaultOptions: {
    queries: {
      staleTime: 15 * 60 * 1000,
      gcTime: 50 * 60 * 1000,
      retry: false,
      retryDelay: attemptIndex => Infinity
      /*
        enable this to have auto retry incase of failure
        retryDelay: attemptIndex => Math.min(1000 * 3 ** attemptIndex, 60000)
       */
    }
  }
});
var DigitUIWrapper = _ref => {
  var _initData$stateInfo, _initData$stateInfo2, _initData$stateInfo3;
  var {
    stateCode,
    enabledModules,
    defaultLanding,
    allowedUserTypes
  } = _ref;
  var {
    isLoading,
    data: initData = {}
  } = Digit.Hooks.useInitStore(stateCode, enabledModules);
  if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {
      page: true,
      variant: "PageLoader"
    });
  }
  var data = (0,_redux_store__WEBPACK_IMPORTED_MODULE_11__["default"])(initData) || {};
  var i18n = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.getI18n)();
  if (!Digit.ComponentRegistryService.getComponent("PrivacyComponent")) {
    Digit.ComponentRegistryService.setComponent("PrivacyComponent", _components_PrivacyComponent__WEBPACK_IMPORTED_MODULE_12__["default"]);
  }
  if (!Digit.ComponentRegistryService.getComponent("EmployeeSSOLoginOptions")) {
    Digit.ComponentRegistryService.setComponent("EmployeeSSOLoginOptions", _components_EmployeeSSOLoginOptions__WEBPACK_IMPORTED_MODULE_16__["default"]);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(react_redux__WEBPACK_IMPORTED_MODULE_4__.Provider, {
    store: data,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.BrowserRouter, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BodyContainer, {
        children: Digit.Utils.getMultiRootTenant() ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_App__WEBPACK_IMPORTED_MODULE_6__.DigitAppWrapper, {
          initData: initData,
          stateCode: stateCode,
          modules: initData === null || initData === void 0 ? void 0 : initData.modules,
          appTenants: initData.tenants,
          logoUrl: initData === null || initData === void 0 || (_initData$stateInfo = initData.stateInfo) === null || _initData$stateInfo === void 0 ? void 0 : _initData$stateInfo.logoUrl,
          logoUrlWhite: initData === null || initData === void 0 || (_initData$stateInfo2 = initData.stateInfo) === null || _initData$stateInfo2 === void 0 ? void 0 : _initData$stateInfo2.logoUrlWhite,
          defaultLanding: defaultLanding,
          allowedUserTypes: allowedUserTypes
        }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_App__WEBPACK_IMPORTED_MODULE_6__.DigitApp, {
          initData: initData,
          stateCode: stateCode,
          modules: initData === null || initData === void 0 ? void 0 : initData.modules,
          appTenants: initData.tenants,
          logoUrl: initData === null || initData === void 0 || (_initData$stateInfo3 = initData.stateInfo) === null || _initData$stateInfo3 === void 0 ? void 0 : _initData$stateInfo3.logoUrl,
          defaultLanding: defaultLanding,
          allowedUserTypes: allowedUserTypes
        })
      })
    })
  });
};

/**
 * DigitUI Component - The main entry point for the UI.
 *
 * @param {Object} props - The properties passed to the component.
 * @param {string} props.stateCode - The state code for the application.
 * @param {Object} props.registry - The registry object containing components registrations.
 * @param {Array<string>} props.enabledModules - A list of enabled modules, if any modules to be disabled due to some condition.
 * @param {Object} props.moduleReducers - Reducers associated with enabled modules.
 * @param {string} props.defaultLanding - The default landing page (e.g., "employee", "citizen"), default is citizen.
 * @param {Array<string>} props.allowedUserTypes - A list of allowed user types (e.g., ["employee", "citizen"]) if any restriction to be applied, and default is both employee & citizen.
 * 
 * @author jagankumar-egov
 *
 * @example
 * <DigitUI
 *   stateCode="pg"
 *   registry={registry}
 *   enabledModules={["Workbench", "PGR"]}
 *   defaultLanding="employee"
 *   allowedUserTypes={["employee", "citizen"]}
 *   moduleReducers={moduleReducers}
 * />
 */
var DigitUI = _ref2 => {
  var {
    stateCode,
    registry,
    enabledModules,
    defaultLanding,
    allowedUserTypes
  } = _ref2;
  // Memoize initial privacy state to prevent unnecessary re-renders
  var initialPrivacy = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => Digit.Utils.getPrivacyObject() || {}, []);
  var [privacy, setPrivacy] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialPrivacy);
  var userType = Digit.UserService.getType();

  // Use memoized QueryClient to prevent recreation on every render
  var queryClient = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => createQueryClient(), []);
  var ComponentProvider = Digit.Contexts.ComponentProvider;
  var PrivacyProvider = Digit.Contexts.PrivacyProvider;
  var DSO = Digit.UserService.hasAccess(["FSM_DSO"]);

  // Memoize privacy context methods to prevent unnecessary re-renders
  var resetPrivacy = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(_data => {
    Digit.Utils.setPrivacyObject({});
    setPrivacy({});
  }, []);
  var getPrivacy = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    var privacyObj = Digit.Utils.getPrivacyObject();
    setPrivacy(privacyObj);
    return privacyObj;
  }, []);
  var updatePrivacyDescoped = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(_data => {
    var privacyObj = Digit.Utils.getAllPrivacyObject();
    // Safely access pathname with fallback
    var pathname = typeof window !== 'undefined' ? window.location.pathname : '';
    var newObj = _objectSpread(_objectSpread({}, privacyObj), {}, {
      [pathname]: _data
    });
    Digit.Utils.setPrivacyObject(_objectSpread({}, newObj));
    setPrivacy((privacyObj === null || privacyObj === void 0 ? void 0 : privacyObj[pathname]) || {});
  }, []);
  var updatePrivacy = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((uuid, fieldName) => {
    setPrivacy(Digit.Utils.updatePrivacy(uuid, fieldName) || {});
  }, []);

  // Memoize privacy context value to prevent unnecessary re-renders
  var privacyContextValue = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    privacy: typeof window !== 'undefined' ? privacy === null || privacy === void 0 ? void 0 : privacy[window.location.pathname] : privacy,
    resetPrivacy,
    getPrivacy,
    updatePrivacyDescoped,
    updatePrivacy
  }), [privacy, resetPrivacy, getPrivacy, updatePrivacyDescoped, updatePrivacy]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("div", {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_components_ErrorBoundaries__WEBPACK_IMPORTED_MODULE_10__["default"], {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.QueryClientProvider, {
        client: queryClient,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(ComponentProvider.Provider, {
          value: registry,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(PrivacyProvider.Provider, {
            value: privacyContextValue,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(DigitUIWrapper, {
              stateCode: stateCode,
              enabledModules: enabledModules,
              defaultLanding: defaultLanding,
              allowedUserTypes: allowedUserTypes
            })
          })
        })
      })
    })
  });
};
var componentsToRegister = {
  SelectOtp: _pages_citizen_Login_SelectOtp__WEBPACK_IMPORTED_MODULE_7__["default"],
  ChangeCity: _components_ChangeCity__WEBPACK_IMPORTED_MODULE_8__["default"],
  ChangeLanguage: _components_ChangeLanguage__WEBPACK_IMPORTED_MODULE_9__["default"],
  PrivacyComponent: _components_PrivacyComponent__WEBPACK_IMPORTED_MODULE_12__["default"],
  OtpComponent: _pages_employee_Otp_OtpCustomComponent__WEBPACK_IMPORTED_MODULE_13__["default"],
  ForgotOrganizationTooltip: _components_ForgotOrganizationTooltip__WEBPACK_IMPORTED_MODULE_15__["default"],
  LoginSignupSelector: _components_LoginSignupSelector__WEBPACK_IMPORTED_MODULE_14__["default"],
  EmployeeSSOLoginOptions: _components_EmployeeSSOLoginOptions__WEBPACK_IMPORTED_MODULE_16__["default"]
};
var initCoreComponents = () => {
  // Ensure hooks introduced in newer libraries versions are always available.
  // Old deployments (e.g. digit-ui-libraries@1.8.8) won't have useSSOConfig,
  // so we register a no-op fallback so login.js never crashes with "not a function".
  if (!Digit.Hooks.useSSOConfig) {
    Digit.Hooks.useSSOConfig = () => ({
      data: [],
      isLoading: false
    });
  }
  Object.entries(componentsToRegister).forEach(_ref3 => {
    var [key, value] = _ref3;
    Digit.ComponentRegistryService.setComponent(key, value);
  });
};

/***/ }),

/***/ "./src/components/AppModules.js":
/*!**************************************!*\
  !*** ./src/components/AppModules.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AppModules: () => (/* binding */ AppModules)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _DynamicModuleLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DynamicModuleLoader */ "./src/components/DynamicModuleLoader.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");





// Create lazy components with fallbacks using the utility

var ChangePassword = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ../pages/employee/ChangePassword/index */ "./src/pages/employee/ChangePassword/index.js")), () => (__webpack_require__(/*! ../pages/employee/ChangePassword/index */ "./src/pages/employee/ChangePassword/index.js")["default"]), {
  loaderText: "CORE_LOADING_CHANGE_PASSWORD"
});
var ForgotPassword = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ../pages/employee/ForgotPassword/index */ "./src/pages/employee/ForgotPassword/index.js")), () => (__webpack_require__(/*! ../pages/employee/ForgotPassword/index */ "./src/pages/employee/ForgotPassword/index.js")["default"]), {
  loaderText: "CORE_LOADING_FORGOT_PASSWORD"
});
var AppHome = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Home */ "./src/components/Home.js")).then(module => ({
  default: module.AppHome
})), () => (__webpack_require__(/*! ./Home */ "./src/components/Home.js").AppHome), {
  loaderText: "CORE_LOADING_HOME"
});
var getTenants = (codes, tenants) => {
  return tenants.filter(tenant => {
    var _codes$map;
    return codes === null || codes === void 0 || (_codes$map = codes.map) === null || _codes$map === void 0 ? void 0 : _codes$map.call(codes, item => item.code).includes(tenant.code);
  });
};
var AppModules = _ref => {
  var _window2;
  var {
    stateCode,
    userType,
    modules,
    appTenants,
    additionalComponent
  } = _ref;
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_1__.useLocation)();
  var user = Digit.UserService.getUser();
  if (!user || !(user !== null && user !== void 0 && user.access_token) || !(user !== null && user !== void 0 && user.info)) {
    var _window;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Navigate, {
      to: {
        pathname: "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/").concat(userType, "/user/login"),
        state: {
          from: location.pathname + location.search
        }
      },
      replace: true
    });
  }

  // Create app routes with dynamic module loading and loading states
  var appRoutes = modules === null || modules === void 0 ? void 0 : modules.map((_ref2, index) => {
    var {
      code,
      tenants
    } = _ref2;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
      path: "".concat(code.toLowerCase(), "/*"),
      element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_DynamicModuleLoader__WEBPACK_IMPORTED_MODULE_3__["default"], {
        moduleCode: code,
        stateCode: stateCode,
        userType: userType,
        tenants: getTenants(tenants, appTenants),
        maxRetries: 3,
        retryDelay: 1000,
        initialDelay: 800
      })
    }, index);
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
    className: "ground-container digit-home-ground",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Routes, {
      children: [appRoutes, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "login",
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Navigate, {
          to: {
            pathname: "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/").concat(userType, "/user/login"),
            state: {
              from: location.pathname + location.search
            }
          },
          replace: true
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "forgot-password",
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ForgotPassword, {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "change-password",
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ChangePassword, {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Route, {
        path: "*",
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(AppHome, {
          userType: userType,
          modules: modules,
          additionalComponent: additionalComponent
        })
      })]
    })
  });
};

/***/ }),

/***/ "./src/components/Background.js":
/*!**************************************!*\
  !*** ./src/components/Background.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");


var Background = _ref => {
  var {
    children
  } = _ref;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
    className: "banner banner-container",
    children: children
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Background);

/***/ }),

/***/ "./src/components/ChangeCity.js":
/*!**************************************!*\
  !*** ./src/components/ChangeCity.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var stringReplaceAll = function stringReplaceAll() {
  var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  var searcher = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  var replaceWith = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
  if (searcher == "") return str;
  while ((_str = str) !== null && _str !== void 0 && _str.includes(searcher)) {
    var _str, _str2;
    str = (_str2 = str) === null || _str2 === void 0 ? void 0 : _str2.replace(searcher, replaceWith);
  }
  return str;
};
var ChangeCity = prop => {
  var _selectCityData$, _stringReplaceAll2;
  var [dropDownData, setDropDownData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  var [selectCityData, setSelectCityData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  var [selectedCity, setSelectedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useNavigate)();
  var isDropdown = prop.dropdown || false;
  var selectedCities = [];
  var isMultiRootTenant = Digit.Utils.getMultiRootTenant();
  var handleChangeCity = city => {
    var _Digit$SessionStorage, _window$location, _window;
    var loggedInData = Digit.SessionStorage.get("citizen.userRequestObject");
    var filteredRoles = (_Digit$SessionStorage = Digit.SessionStorage.get("citizen.userRequestObject")) === null || _Digit$SessionStorage === void 0 || (_Digit$SessionStorage = _Digit$SessionStorage.info) === null || _Digit$SessionStorage === void 0 || (_Digit$SessionStorage = _Digit$SessionStorage.roles) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.filter(role => role.tenantId === city.value);
    if ((filteredRoles === null || filteredRoles === void 0 ? void 0 : filteredRoles.length) > 0) {
      loggedInData.info.roles = filteredRoles;
      loggedInData.info.tenantId = city === null || city === void 0 ? void 0 : city.value;
    }
    Digit.SessionStorage.set("Employee.tenantId", city === null || city === void 0 ? void 0 : city.value);
    Digit.UserService.setUser(loggedInData);
    setDropDownData(city);
    if (typeof window !== 'undefined' && (_window$location = window.location) !== null && _window$location !== void 0 && (_window$location = _window$location.href) !== null && _window$location !== void 0 && _window$location.includes("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/employee/"))) {
      var _location$state, _window2;
      var redirectPath = ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.from) || "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/employee");
      navigate(redirectPath, {
        replace: true
      });
    }
    // Safe reload with error handling
    try {
      if (typeof window !== 'undefined') {
        window.location.reload();
      }
    } catch (error) {
      console.warn('Failed to reload page:', error);
    }
  };
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    var _userloggedValues$inf;
    var userloggedValues = Digit.SessionStorage.get("citizen.userRequestObject");
    var teantsArray = [],
      filteredArray = [];
    userloggedValues === null || userloggedValues === void 0 || (_userloggedValues$inf = userloggedValues.info) === null || _userloggedValues$inf === void 0 || (_userloggedValues$inf = _userloggedValues$inf.roles) === null || _userloggedValues$inf === void 0 || _userloggedValues$inf.forEach(role => teantsArray.push(role.tenantId));
    var unique = teantsArray.filter((item, i, ar) => ar.indexOf(item) === i);
    unique === null || unique === void 0 || unique.forEach(uniCode => {
      var _stringReplaceAll;
      filteredArray.push({
        label: "TENANT_TENANTS_".concat((_stringReplaceAll = stringReplaceAll(uniCode, ".", "_")) === null || _stringReplaceAll === void 0 ? void 0 : _stringReplaceAll.toUpperCase()),
        value: uniCode
      });
    });
    selectedCities = filteredArray === null || filteredArray === void 0 ? void 0 : filteredArray.filter(select => select.value == Digit.SessionStorage.get("Employee.tenantId"));
    setSelectCityData(filteredArray);
  }, [dropDownData]);

  // if (isDropdown) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
    style: prop !== null && prop !== void 0 && prop.mobileView ? {
      color: "#767676"
    } : {},
    children: isMultiRootTenant && selectCityData.length == 1 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardText, {
      style: {
        color: "#363636"
      },
      children: selectCityData === null || selectCityData === void 0 || (_selectCityData$ = selectCityData[0]) === null || _selectCityData$ === void 0 ? void 0 : _selectCityData$.value
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Dropdown, {
      t: prop === null || prop === void 0 ? void 0 : prop.t,
      option: selectCityData,
      selected: selectCityData.find(cityValue => cityValue.value === (dropDownData === null || dropDownData === void 0 ? void 0 : dropDownData.value)),
      optionKey: "label",
      select: handleChangeCity,
      freeze: true,
      customSelector: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
        className: "cp",
        children: prop === null || prop === void 0 ? void 0 : prop.t("TENANT_TENANTS_".concat((_stringReplaceAll2 = stringReplaceAll(Digit.SessionStorage.get("Employee.tenantId"), ".", "_")) === null || _stringReplaceAll2 === void 0 ? void 0 : _stringReplaceAll2.toUpperCase()))
      })
    })
  });
  // } else {
  //   return (
  //     <React.Fragment>
  //       <div style={{ marginBottom: "5px" }}>City</div>
  //       <div className="language-selector" style={{display: "flex", flexWrap: "wrap"}}>
  //         {selectCityData?.map((city, index) => (
  //           <div className="language-button-container" key={index}>
  //             <CustomButton
  //               selected={city.value === Digit.SessionStorage.get("Employee.tenantId")}
  //               text={city.label}
  //               onClick={() => handleChangeCity(city)}
  //             ></CustomButton>
  //           </div>
  //         ))}
  //       </div>
  //     </React.Fragment>
  //   );
  // }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChangeCity);

/***/ }),

/***/ "./src/components/ChangeLanguage.js":
/*!******************************************!*\
  !*** ./src/components/ChangeLanguage.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var ChangeLanguage = prop => {
  var isDropdown = prop.dropdown || false;
  var {
    data: storeData,
    isLoading
  } = Digit.Hooks.useStore.getInitData();
  var {
    languages,
    stateInfo
  } = storeData || {};
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var selectedLanguage = Digit.StoreData.getCurrentLanguage();
  var [selected, setselected] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(selectedLanguage);
  var handleChangeLanguage = language => {
    setselected(language.value);
    Digit.LocalizationService.changeLanguage(language.value, stateInfo.code);
  };
  if (isLoading) return null;
  if (isDropdown) {
    var _languages$find;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Dropdown, {
        className: "language-dropdown",
        option: languages,
        selected: languages === null || languages === void 0 ? void 0 : languages.find(language => (language === null || language === void 0 ? void 0 : language.value) === selectedLanguage),
        optionKey: "label",
        select: handleChangeLanguage,
        freeze: true,
        customSelector: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
          className: "cp",
          children: t(languages === null || languages === void 0 || (_languages$find = languages.find(language => (language === null || language === void 0 ? void 0 : language.value) === selected)) === null || _languages$find === void 0 ? void 0 : _languages$find.label)
        })
      })
    });
  } else {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        style: {
          marginBottom: "5px"
        },
        children: "Language"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "language-selector",
        children: languages.map((language, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "language-button-container",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
            label: language.label,
            onClick: () => handleChangeLanguage(language),
            variation: language.value === selected ? "primary" : ""
          })
        }, index))
      })]
    });
  }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChangeLanguage);

/***/ }),

/***/ "./src/components/CustomErrorComponent.js":
/*!************************************************!*\
  !*** ./src/components/CustomErrorComponent.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Background__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Background */ "./src/components/Background.js");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _Header__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Header */ "./src/components/Header.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");







var CustomErrorComponent = props => {
  var {
    state = {}
  } = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useLocation)();
  // const module = state?.module;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var stateInfo = props.stateInfo;
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useNavigate)();
  var ModuleBasedErrorConfig = {
    sandbox: {
      imgUrl: "https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",
      infoHeader: "WRONG_TENANT_SIGN_UP",
      infoMessage: "WRONG_TENANT_SIGN_UP_MESSAGE",
      buttonInfo: "WRONG_TENANT_SIGN_UP_BUTTON",
      action: () => {
        navigate("/".concat(window.globalPath, "/"));
      }
    }
  };
  var config = ModuleBasedErrorConfig["sandbox"];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Background__WEBPACK_IMPORTED_MODULE_3__["default"], {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_4__.Card, {
      className: "digit-employee-card customError",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Header__WEBPACK_IMPORTED_MODULE_5__["default"], {
        showTenant: false
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_4__.CardHeader, {
        className: "center",
        children: t(config.infoHeader)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_4__.CardText, {
        className: "center",
        children: t(config.infoMessage)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
        className: "customErrorButton",
        label: t(config === null || config === void 0 ? void 0 : config.buttonInfo),
        variation: "primary",
        isSuffix: true,
        onClick: e => {
          e.preventDefault();
          config === null || config === void 0 || config.action();
        }
      })]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomErrorComponent);

/***/ }),

/***/ "./src/components/Dialog/LogoutDialog.js":
/*!***********************************************!*\
  !*** ./src/components/Dialog/LogoutDialog.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var LogoutDialog = _ref => {
  var {
    onSelect,
    onCancel,
    onDismiss,
    PopupStyles,
    isDisabled,
    hideSubmit
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var children = [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardText, {
      children: [t("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE") + " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("strong", {
        children: t("CORE_LOGOUT_MESSAGE")
      })]
    })
  })];
  var footer = [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
    type: "button",
    size: "large",
    variation: "secondary",
    label: t("CORE_LOGOUT_CANCEL"),
    className: "logout-cancel-button",
    onClick: onCancel
  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
    type: "button",
    size: "large",
    variation: "primary",
    label: t("CORE_LOGOUT_WEB_YES"),
    formId: "modal-action",
    onClick: onSelect,
    isDisabled: isDisabled
  })];
  var footerWithoutSubmit = [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
    type: "button",
    size: "large",
    variation: "digit-action-cancel",
    label: t("CORE_LOGOUT_CANCEL"),
    className: "logout-cancel-button",
    onClick: onCancel
  })];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.PopUp, {
    type: "default",
    children: children,
    heading: t("CORE_LOGOUT_WEB_HEADER"),
    footerChildren: hideSubmit ? footerWithoutSubmit : footer,
    sortFooterButtons: true,
    onClose: onDismiss,
    className: "digit-logout-popup-wrapper",
    onOverlayClick: onDismiss,
    equalWidthButtons: true,
    style: PopupStyles
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LogoutDialog);

/***/ }),

/***/ "./src/components/DummyLoader.js":
/*!***************************************!*\
  !*** ./src/components/DummyLoader.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-svg-components */ "@egovernments/digit-ui-svg-components");
/* harmony import */ var _egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");





var DummyLoaderScreen = () => {
  var _Digit$SessionStorage;
  var [currentStep, setCurrentStep] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useNavigate)();
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useLocation)();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  var {
    tenant
  } = location.state || {};
  var steps = ["SANDBOX_GUIDE_SETUP_ACCOUNT", "SANDBOX_GUIDE_DEFAULT_MASTER_DATA", "SANDBOX_GUIDE_CONFIGURING_COMPLAINTS", "SANDBOX_GUIDE_CONFIGURING_EMPLOYEE_MANAGEMENT", "SANDBOX_GUIDE_SETTING_UP_CITIZEN_PORTAL", "SANDBOX_GUIDE_SETTING_UP_EMPLOYEE_PORTAL", "SANDBOX_GUIDE_LOADING_CONFIGURATION_INTERFACE", "SANDBOX_GUIDE_CREATING_DASHBOARD", "SANDBOX_GUIDE_ALL_SETUP_DONE"];
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    var stepInterval = setInterval(() => {
      if (currentStep < steps.length) {
        setCurrentStep(prev => prev + 1);
      }
    }, 2000); // 1 second delay for each step

    if (currentStep === steps.length) {
      var _window;
      clearInterval(stepInterval); // Clear the interval to stop further updates
      var globalPath = typeof window !== 'undefined' ? (_window = window) === null || _window === void 0 ? void 0 : _window.globalPath : '';
      var navigateTimeout = setTimeout(() => {
        if (roleForLandingPage(getUserRoles, MdmsRes)) {
          var _window2;
          navigate({
            pathname: "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.globalPath, "/").concat(tenant).concat(RoleLandingUrl),
            state: {
              tenant: tenant
            }
          });
        } else {
          var _window3;
          navigate({
            pathname: "/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.globalPath, "/").concat(tenant, "/employee"),
            state: {
              tenant: tenant
            }
          });
        }
      }, 1000);
      return () => clearTimeout(navigateTimeout); // Cleanup timeout
    }
    return () => {
      clearInterval(stepInterval);
    };
  }, [currentStep]);
  var ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  var getUserRoles = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 || (_Digit$SessionStorage = _Digit$SessionStorage.info) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.roles;
  var [buttonDisabled, setButtonDisabled] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
  var {
    data: MdmsRes
  } = Digit.Hooks.useCustomMDMS(tenant, "SandBoxLanding", [{
    name: "LandingPageRoles"
  }], {
    enabled: true,
    staleTime: 0,
    cacheTime: 0,
    select: data => {
      var _data$SandBoxLanding;
      return data === null || data === void 0 || (_data$SandBoxLanding = data["SandBoxLanding"]) === null || _data$SandBoxLanding === void 0 ? void 0 : _data$SandBoxLanding["LandingPageRoles"];
    }
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (MdmsRes !== null && MdmsRes !== void 0 && MdmsRes[0].url) {
      setButtonDisabled(false);
    }
  }, [MdmsRes]);
  var RoleLandingUrl = MdmsRes === null || MdmsRes === void 0 ? void 0 : MdmsRes[0].url;
  var roleForLandingPage = (getUserRoles, MdmsRes) => {
    var _getUserRoles$;
    var userRole = getUserRoles === null || getUserRoles === void 0 || (_getUserRoles$ = getUserRoles[0]) === null || _getUserRoles$ === void 0 ? void 0 : _getUserRoles$.code;
    return userRole === "SUPERUSER" && MdmsRes.some(page => page.rolesForLandingPage.includes("SUPERUSER"));
  };
  var onButtonClick = () => {
    if (roleForLandingPage(getUserRoles, MdmsRes)) {
      var _window4;
      window.location.href = "/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.globalPath, "/").concat(tenant).concat(RoleLandingUrl);
    } else {
      var _window5;
      window.location.href = "/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.globalPath, "/").concat(tenant, "/employee");
    }
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
    className: "sandbox-loader-screen",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
      className: "sandbox-loader"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", {
      className: "sandbox-installation-steps",
      children: steps.map((step, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", {
        className: "sandbox-step ".concat(index < currentStep ? "sandbox-visible" : ""),
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
          className: "sandbox-step-text",
          children: t(step)
        }), index < currentStep && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_1__.CheckCircle, {
          fill: "#00703C"
        })]
      }, index))
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DummyLoaderScreen);

/***/ }),

/***/ "./src/components/DynamicModuleLoader.js":
/*!***********************************************!*\
  !*** ./src/components/DynamicModuleLoader.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }





/**
 * DynamicModuleLoader handles loading of modules from the ComponentRegistryService
 * with loading states, retries, and graceful error handling
 */

var DynamicModuleLoader = _ref => {
  var {
    moduleCode,
    stateCode,
    userType,
    tenants,
    maxRetries = 5,
    retryDelay = 1500,
    initialDelay = 100 // Initial delay before first check to allow modules to register
  } = _ref;
  var [moduleState, setModuleState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
    module: null,
    loading: true,
    error: null,
    retryCount: 0,
    initialDelayComplete: false
  });
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    var retryTimeout;
    var initialTimeout;
    var _loadModule = /*#__PURE__*/function () {
      var _ref2 = _asyncToGenerator(function* () {
        try {
          // Check if module is available in ComponentRegistryService
          var _Module = Digit.ComponentRegistryService.getComponent("".concat(moduleCode, "Module"));
          if (_Module) {
            setModuleState({
              module: _Module,
              loading: false,
              error: null,
              retryCount: 0,
              initialDelayComplete: true
            });
          } else {
            // Module not found, check if we should retry
            if (moduleState.retryCount < maxRetries) {
              setModuleState(prev => _objectSpread(_objectSpread({}, prev), {}, {
                retryCount: prev.retryCount + 1
              }));

              // Retry after delay (exponential backoff)
              var delay = retryDelay * Math.pow(1.5, moduleState.retryCount);
              retryTimeout = setTimeout(() => {
                _loadModule();
              }, delay);
            } else {
              // Max retries reached
              setModuleState({
                module: null,
                loading: false,
                error: "Module \"".concat(moduleCode, "\" not found after ").concat(maxRetries, " attempts"),
                retryCount: moduleState.retryCount,
                initialDelayComplete: true
              });
            }
          }
        } catch (error) {
          console.error("Error loading module ".concat(moduleCode, ":"), error);
          setModuleState({
            module: null,
            loading: false,
            error: error.message,
            retryCount: moduleState.retryCount,
            initialDelayComplete: true
          });
        }
      });
      return function loadModule() {
        return _ref2.apply(this, arguments);
      };
    }();

    // Start with initial delay to allow modules to register
    if (!moduleState.initialDelayComplete) {
      initialTimeout = setTimeout(() => {
        setModuleState(prev => _objectSpread(_objectSpread({}, prev), {}, {
          initialDelayComplete: true
        }));
        _loadModule();
      }, initialDelay);
    } else {
      _loadModule();
    }

    // Cleanup timeouts on unmount
    return () => {
      if (retryTimeout) {
        clearTimeout(retryTimeout);
      }
      if (initialTimeout) {
        clearTimeout(initialTimeout);
      }
    };
  }, [moduleCode, moduleState.retryCount, moduleState.initialDelayComplete, maxRetries, retryDelay, initialDelay]);

  // Show loading state
  if (moduleState.loading) {
    var loadingText = !moduleState.initialDelayComplete ? t("CORE_INITIALIZING_MODULE", {
      moduleCode,
      defaultValue: "Initializing {{moduleCode}} module..."
    }) : t("CORE_LOADING_MODULE", {
      moduleCode,
      defaultValue: "Loading {{moduleCode}} module..."
    });
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "module-loading-container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Loader, {
        page: true,
        variant: "PageLoader",
        loaderText: loadingText
      }), moduleState.retryCount > 0 && moduleState.initialDelayComplete && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "retry-info",
        style: {
          textAlign: 'center',
          marginTop: '1rem',
          color: '#666'
        },
        children: t("CORE_MODULE_RETRY_ATTEMPT", {
          retryCount: moduleState.retryCount,
          maxRetries,
          defaultValue: "Retry attempt {{retryCount}}/{{maxRetries}}"
        })
      })]
    });
  }

  // Show error state and redirect
  if (moduleState.error || !moduleState.module) {
    var _window;
    console.warn("Module loading failed for ".concat(moduleCode, ":"), moduleState.error);
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_1__.Navigate, {
      to: "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/employee/user/error?type=notfound&module=").concat(moduleCode, "&reason=").concat(encodeURIComponent(moduleState.error || 'Module not found')),
      replace: true
    });
  }

  // Render the loaded module
  var Module = moduleState.module;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Module, {
    stateCode: stateCode,
    moduleCode: moduleCode,
    userType: userType,
    tenants: tenants
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DynamicModuleLoader);

/***/ }),

/***/ "./src/components/EmployeeSSOLoginOptions.js":
/*!***************************************************!*\
  !*** ./src/components/EmployeeSSOLoginOptions.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");



var EmployeeSSOLoginOptions = _ref => {
  var {
    t,
    props
  } = _ref;
  var {
    ssoConfigs = []
  } = props || {};
  if (!(ssoConfigs !== null && ssoConfigs !== void 0 && ssoConfigs.length)) {
    return null;
  }
  var hasMultipleOptions = ssoConfigs.length > 1;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
    className: "employee-login-sso",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: "employee-login-sso-divider",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
        children: hasMultipleOptions ? t("CORE_COMMON_OR_SIGN_IN_WITH") : t("CORE_COMMON_OR")
      })
    }), hasMultipleOptions ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: "employee-login-sso-icons",
      children: ssoConfigs.map((sso, index) => {
        var _sso$provider;
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
          label: "",
          variation: "secondary",
          size: "large",
          icon: sso.icon,
          className: "employee-login-sso-icon ".concat(((_sso$provider = sso.provider) === null || _sso$provider === void 0 ? void 0 : _sso$provider.toLowerCase()) || "provider", "-login-icon"),
          onClick: () => {
            var _sso$onLogin;
            return (_sso$onLogin = sso.onLogin) === null || _sso$onLogin === void 0 ? void 0 : _sso$onLogin.call(sso, sso);
          },
          title: t(sso.label),
          ariaLabel: t(sso.label),
          style: {
            width: "100%"
          }
        }, sso.id || sso.provider || index);
      })
    }) : ssoConfigs.map((sso, index) => {
      var _sso$provider2;
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
        label: t(sso.label),
        variation: "primary",
        size: "large",
        icon: sso.icon,
        className: "employee-login-sso-button ".concat(((_sso$provider2 = sso.provider) === null || _sso$provider2 === void 0 ? void 0 : _sso$provider2.toLowerCase()) || "provider", "-login-btn"),
        onClick: () => {
          var _sso$onLogin2;
          return (_sso$onLogin2 = sso.onLogin) === null || _sso$onLogin2 === void 0 ? void 0 : _sso$onLogin2.call(sso, sso);
        },
        style: {
          width: "100%"
        }
      }, sso.id || sso.provider || index);
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EmployeeSSOLoginOptions);

/***/ }),

/***/ "./src/components/ErrorBoundaries.js":
/*!*******************************************!*\
  !*** ./src/components/ErrorBoundaries.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _ErrorComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ErrorComponent */ "./src/components/ErrorComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");



var Redircter = () => {
  // Add safety checks for window object
  if (typeof window === 'undefined') {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {});
  }
  try {
    var _window;
    var contextPath = ((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath) || '';
    var userType = Digit.UserService.getType();
    var path = userType === "employee" ? "/".concat(contextPath, "/employee/user/error") : "/".concat(contextPath, "/citizen/error");
    var currentHref = window.location.href;

    // Check if we're already on an error page or in development
    if (currentHref.includes("employee/user/error") || currentHref.includes("citizen/error") || "development" === "development") {
      // Do nothing - already on error page or in development
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {});
    }

    // Safe navigation with error handling
    // removed by dead control flow

  } catch (error) {
    console.error('Error in Redircter component:', error);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {});
};
class ErrorBoundary extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
  constructor(props) {
    super(props);
    this.state = {
      error: null,
      errorStack: null,
      hasError: false,
      module: null,
      action: null,
      info: null
    };
  }
  static getDerivedStateFromError(error) {
    // Update state so the next render will show the fallback UI.
    return {
      error: error === null || error === void 0 ? void 0 : error.message,
      hasError: true,
      errorStack: error === null || error === void 0 ? void 0 : error.stack,
      module: error === null || error === void 0 ? void 0 : error.module,
      action: error === null || error === void 0 ? void 0 : error.action,
      info: error === null || error === void 0 ? void 0 : error.info
    };
  }
  componentDidCatch(error, errorInfo) {
    // Catch errors in any components below and re-render with error message
    this.setState({
      error: error === null || error === void 0 ? void 0 : error.message,
      hasError: true,
      errorStack: error === null || error === void 0 ? void 0 : error.stack,
      module: error === null || error === void 0 ? void 0 : error.module,
      action: error === null || error === void 0 ? void 0 : error.action,
      info: errorInfo
    });

    // Enhanced error logging with safety checks
    try {
      // Log to console in development
      if (true) {
        console.group('🚨 Error Boundary Caught Error');
        console.error('Error:', error);
        console.error('Error Info:', errorInfo);
        console.error('Component Stack:', errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.componentStack);
        console.groupEnd();
      }

      // You can also log error messages to an error reporting service here
      // Example: errorReportingService.captureException(error, { extra: errorInfo });
    } catch (loggingError) {
      console.warn('Failed to log error in ErrorBoundary:', loggingError);
    }
  }
  render() {
    if (this.state.hasError) {
      // ("UI-errorInfo", this.state?.errorStack);
      // ("UI-component-details", this.props);
      // You can render any custom fallback UI
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
        className: "error-boundary",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Redircter, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_ErrorComponent__WEBPACK_IMPORTED_MODULE_1__["default"], {
          initData: this.props.initData,
          errorData: this.state,
          goToHome: () => {
            var _window2, _Digit, _Digit$getType;
            window.location.href = "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/").concat((_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.UserService) === null || _Digit === void 0 || (_Digit$getType = _Digit.getType) === null || _Digit$getType === void 0 ? void 0 : _Digit$getType.call(_Digit)); // Use navigate
          }
        })]
      });
    }
    return this.props.children;
  }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ErrorBoundary);

/***/ }),

/***/ "./src/components/ErrorComponent.js":
/*!******************************************!*\
  !*** ./src/components/ErrorComponent.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _ImageComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var ErrorConfig = {
  error: {
    imgUrl: "https://digit-ui-assets.s3.ap-south-1.amazonaws.com/error-image.png",
    infoMessage: "CORE_SOMETHING_WENT_WRONG",
    buttonInfo: "ACTION_TEST_HOME"
  },
  maintenance: {
    imgUrl: "https://digit-ui-assets.s3.ap-south-1.amazonaws.com/maintainence-image.png",
    infoMessage: "CORE_UNDER_MAINTENANCE",
    buttonInfo: "ACTION_TEST_HOME"
  },
  notfound: {
    imgUrl: "https://digit-ui-assets.s3.ap-south-1.amazonaws.com/PageNotFound.png",
    infoMessage: "MODULE_NOT_FOUND",
    buttonInfo: "ACTION_TEST_HOME"
  }
};
var ModuleBasedErrorConfig = {
  sandbox: {
    imgUrl: "https://digit-ui-assets.s3.ap-south-1.amazonaws.com/error-image.png",
    infoMessage: "WRONG_TENANT_SIGN_UP",
    buttonInfo: "CREATE_TENANT_ERROR_BUTTON"
  }
};
var ErrorComponent = props => {
  var _props$errorData;
  var {
    type = "error"
  } = Digit.Hooks.useQueryParams();
  var module = props === null || props === void 0 || (_props$errorData = props.errorData) === null || _props$errorData === void 0 ? void 0 : _props$errorData.module;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var config = module ? ModuleBasedErrorConfig[module] : ErrorConfig[type];
  var stateInfo = props.stateInfo;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
    className: "error-boundary",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: "error-container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ImageComponent__WEBPACK_IMPORTED_MODULE_2__["default"], {
        src: config.imgUrl,
        alt: "error"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("h1", {
        children: t(config.infoMessage)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("button", {
        onClick: () => {
          var _props$errorData2, _props$goToHome;
          module ? props === null || props === void 0 || (_props$errorData2 = props.errorData) === null || _props$errorData2 === void 0 ? void 0 : _props$errorData2.action() : props === null || props === void 0 || (_props$goToHome = props.goToHome) === null || _props$goToHome === void 0 ? void 0 : _props$goToHome.call(props);
        },
        children: t(config.buttonInfo)
      })]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ErrorComponent);

/***/ }),

/***/ "./src/components/ForgotOrganizationTooltip.js":
/*!*****************************************************!*\
  !*** ./src/components/ForgotOrganizationTooltip.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var ForgotOrganizationTooltip = _ref => {
  var {
    onSelect
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var [showTip, setShowTip] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    var handleClickOutside = event => {
      if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
        setShowTip(false);
      }
    };
    document.addEventListener("mousedown", handleClickOutside);
    return () => {
      document.removeEventListener("mousedown", handleClickOutside);
    };
  }, []);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    ref: wrapperRef,
    className: "loginSignUpSelector",
    style: {
      position: "relative",
      marginTop: "-2rem"
    },
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
      label: t("SB_FORGOTORGANIZATION_TOOLTIP"),
      variation: "link",
      size: "small",
      onClick: () => setShowTip(prev => !prev)
      // isSuffix={true}
      ,
      style: {
        marginBottom: "0.5rem",
        paddingLeft: "0.2rem"
      }
    }), showTip && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      style: {
        position: "absolute",
        bottom: "100%",
        left: "50%",
        transform: "translateY(-4px)",
        backgroundColor: "#0b4b66",
        color: "white",
        padding: "6px 10px",
        borderRadius: "4px",
        whiteSpace: "normal",
        wordBreak: "break-word",
        maxWidth: "20rem",
        zIndex: 1000,
        fontSize: "0.875rem"
      },
      children: t("SB_FORGOTORGANIZATION_TOOLTIP_TEXT")
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ForgotOrganizationTooltip);

/***/ }),

/***/ "./src/components/Header.js":
/*!**********************************!*\
  !*** ./src/components/Header.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _ImageComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");





var Header = _ref => {
  var _window, _stateInfo$code;
  var {
    showTenant = true
  } = _ref;
  var {
    data: storeData,
    isLoading
  } = Digit.Hooks.useStore.getInitData();
  var {
    stateInfo
  } = storeData || {};
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  if (isLoading) return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {});

  //If HEADER_SVG config exists, return the custom block
  var headerSvgSecondaryUrl = (_window = window) === null || _window === void 0 || (_window = _window.globalConfigs) === null || _window === void 0 ? void 0 : _window.getConfig("SVG_HEADER_SECONDARY_LOGO_URL");
  if (headerSvgSecondaryUrl) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "bannerHeader secondaryBannerHeader",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ImageComponent__WEBPACK_IMPORTED_MODULE_3__["default"], {
        className: "bannerLogo",
        src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.logoUrl,
        style: !showTenant ? {
          borderRight: "unset"
        } : {},
        alt: "Digit Banner"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
        style: {
          fontSize: "xx-large"
        },
        children: "|"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ImageComponent__WEBPACK_IMPORTED_MODULE_3__["default"], {
        className: "svgHeaderLogo",
        src: headerSvgSecondaryUrl,
        alt: "DIGIT Logo"
      })]
    });
  }

  // Default logic
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
    className: "bannerHeader",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ImageComponent__WEBPACK_IMPORTED_MODULE_3__["default"], {
      className: "bannerLogo",
      src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.logoUrl,
      style: !showTenant ? {
        borderRight: "unset"
      } : {},
      alt: "Digit Banner"
    }), showTenant && (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.code) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
      children: t("TENANT_TENANTS_".concat(stateInfo === null || stateInfo === void 0 || (_stateInfo$code = stateInfo.code) === null || _stateInfo$code === void 0 ? void 0 : _stateInfo$code.toUpperCase()))
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Header);

/***/ }),

/***/ "./src/components/Home.js":
/*!********************************!*\
  !*** ./src/components/Home.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AppHome: () => (/* binding */ AppHome),
/* harmony export */   processLinkData: () => (/* binding */ processLinkData)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _RoleBasedEmployeeHome__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RoleBasedEmployeeHome */ "./src/components/RoleBasedEmployeeHome.js");
/* harmony import */ var _pages_employee_QuickStart_Config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../pages/employee/QuickStart/Config */ "./src/pages/employee/QuickStart/Config.js");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");







/* 
Feature :: Citizen All service screen cards
*/
var processLinkData = (newData, code, t) => {
  var obj = newData === null || newData === void 0 ? void 0 : newData["".concat(code)];
  if (obj) {
    obj.map(link => {
      if (Digit.Utils.getMultiRootTenant()) {
        link["navigationURL"] = link["navigationURL"].replace("/sandbox-ui/citizen", "/sandbox-ui/".concat(Digit.ULBService.getStateId(), "/citizen"));
      }
      link.link = link["navigationURL"];
      link.i18nKey = t(link["name"]);
    });
  }
  var newObj = {
    links: obj === null || obj === void 0 ? void 0 : obj.reverse(),
    header: Digit.Utils.locale.getTransformedLocale("ACTION_TEST_".concat(code)),
    iconName: "CITIZEN_".concat(code, "_ICON")
  };
  if (code === "FSM") {
    var _window;
    var roleBasedLoginRoutes = [{
      role: "FSM_DSO",
      from: "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/citizen/fsm/dso-dashboard"),
      dashoardLink: "CS_LINK_DSO_DASHBOARD",
      loginLink: "CS_LINK_LOGIN_DSO"
    }];
    //RAIN-7297
    roleBasedLoginRoutes.map(_ref => {
      var _newObj$links, _newObj$links2, _window2;
      var {
        role,
        from,
        loginLink,
        dashoardLink
      } = _ref;
      if (Digit.UserService.hasAccess(role)) newObj === null || newObj === void 0 || (_newObj$links = newObj.links) === null || _newObj$links === void 0 || _newObj$links.push({
        link: from,
        i18nKey: t(dashoardLink)
      });else newObj === null || newObj === void 0 || (_newObj$links2 = newObj.links) === null || _newObj$links2 === void 0 || _newObj$links2.push({
        link: "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/citizen/login"),
        state: {
          role: "FSM_DSO",
          from
        },
        i18nKey: t(loginLink)
      });
    });
  }
  return newObj;
};
var iconSelector = code => {
  switch (code) {
    case "PT":
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.PTIcon, {
        className: "fill-path-primary-main"
      });
    case "WS":
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.WSICon, {
        className: "fill-path-primary-main"
      });
    case "FSM":
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.FSMIcon, {
        className: "fill-path-primary-main"
      });
    case "MCollect":
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.MCollectIcon, {
        className: "fill-path-primary-main"
      });
    case "PGR":
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.PGRIcon, {
        className: "fill-path-primary-main"
      });
    case "TL":
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.TLIcon, {
        className: "fill-path-primary-main"
      });
    case "OBPS":
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.OBPSIcon, {
        className: "fill-path-primary-main"
      });
    case "Bills":
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.BillsIcon, {
        className: "fill-path-primary-main"
      });
    default:
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.PTIcon, {
        className: "fill-path-primary-main"
      });
  }
};


// Inside CitizenHome component

var CitizenHome = _ref2 => {
  var {
    getCitizenMenu,
    fetchedCitizen,
    isLoading
  } = _ref2;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_6__.useNavigate)();
  var isMobile = window.Digit.Utils.browser.isMobile();
  if (isLoading || !fetchedCitizen || !getCitizenMenu) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {});
  }
  var parentModules = Object.keys(getCitizenMenu);
  var handleLinkClick = (e, link) => {
    e.preventDefault();
    navigate(link);
  };
  var handleNavigate = link => {
    var _window3;
    if (!link) return;
    link !== null && link !== void 0 && link.includes("".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/")) ? navigate(link) : window.location.href = link;
  };
  var renderApplyIcon = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.SVG.AddExpense, {
    fill: "#C84C0E",
    width: "1.25rem",
    height: "1.25rem",
    className: "digit-button-customIcon medium teritiary"
  });
  var renderMyAppIcon = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.SVG.ListAlt, {
    fill: "#C84C0E",
    width: "1.25rem",
    height: "1.25rem",
    className: "digit-button-customIcon medium teritiary"
  });
  var isApplyLink = link => {
    var name = (link.name || link.displayName || "").toLowerCase();
    return name.includes("apply") || name.includes("_apply");
  };

  // Desktop: LandingPageWrapper + custom cards with icons (same grid as employee)
  if (!isMobile) {
    var children = parentModules.map(code => {
      var _mdmsDataObj$links, _mdmsDataObj$links2;
      var mdmsDataObj = processLinkData(getCitizenMenu, code, t);
      if (!(mdmsDataObj !== null && mdmsDataObj !== void 0 && (_mdmsDataObj$links = mdmsDataObj.links) !== null && _mdmsDataObj$links !== void 0 && _mdmsDataObj$links.length)) return null;
      var seenLinks = new Set();
      var dedupedLinks = (_mdmsDataObj$links2 = mdmsDataObj.links) === null || _mdmsDataObj$links2 === void 0 || (_mdmsDataObj$links2 = _mdmsDataObj$links2.filter(ele => ele === null || ele === void 0 ? void 0 : ele.link)) === null || _mdmsDataObj$links2 === void 0 ? void 0 : _mdmsDataObj$links2.sort((x, y) => (x === null || x === void 0 ? void 0 : x.orderNumber) - (y === null || y === void 0 ? void 0 : y.orderNumber)).filter(link => {
        var key = link.link;
        if (seenLinks.has(key)) return false;
        seenLinks.add(key);
        return true;
      });
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Card, {
        className: "digit-landing-page-card",
        style: {
          borderRadius: "1rem"
        },
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
          className: "icon-module-header",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
            className: "digit-landingpagecard-icon",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG.Devices, {
              fill: "#C84C0E",
              width: "1rem",
              height: "1rem"
            })
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
            className: "ladingcard-moduleName",
            role: "heading",
            "aria-level": "2",
            children: t(mdmsDataObj === null || mdmsDataObj === void 0 ? void 0 : mdmsDataObj.header)
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Divider, {
          className: "digit-landingpage-divider",
          variant: "small"
        }), dedupedLinks.map((link, i) => {
          var LinkIcon = link.leftIcon && link.leftIcon !== "TLIcon" && _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG[link.leftIcon] ? _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG[link.leftIcon] : null;
          return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("button", {
            className: "digit-button-teritiary medium",
            type: "button",
            style: {
              padding: "0px"
            },
            onClick: () => handleNavigate(link.link),
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              className: "icon-label-container teritiary medium",
              children: [LinkIcon ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(LinkIcon, {
                fill: "#C84C0E",
                width: "1.25rem",
                height: "1.25rem",
                className: "digit-button-customIcon medium teritiary"
              }) : isApplyLink(link) ? renderApplyIcon() : renderMyAppIcon(), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("h2", {
                className: "digit-button-label",
                children: link.i18nKey
              })]
            })
          }, i);
        })]
      }, code);
    }).filter(Boolean);
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "citizen-all-services-wrapper",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
        className: "employee-app-container digit-home-employee-app",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.LandingPageWrapper, {
          children: children
        })
      })
    });
  }

  // Mobile: Original vertical card layout
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
    className: "citizen-all-services-wrapper",
    children: [location.pathname.includes("sanitation-ui/citizen/all-services") || location.pathname.includes("sandbox-ui") && location.pathname.includes("all-services") ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.BackLink, {
      onClick: () => window.history.back()
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "citizenAllServiceGrid",
      children: parentModules.map(code => {
        var _mdmsDataObj$links3;
        var mdmsDataObj = processLinkData(getCitizenMenu, code, t);
        if ((mdmsDataObj === null || mdmsDataObj === void 0 || (_mdmsDataObj$links3 = mdmsDataObj.links) === null || _mdmsDataObj$links3 === void 0 ? void 0 : _mdmsDataObj$links3.length) > 0) {
          var _mdmsDataObj$links4;
          return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
            className: "CitizenHomeCard",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              className: "header",
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("h2", {
                children: t(mdmsDataObj === null || mdmsDataObj === void 0 ? void 0 : mdmsDataObj.header)
              }), iconSelector(code)]
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
              className: "links",
              children: mdmsDataObj === null || mdmsDataObj === void 0 || (_mdmsDataObj$links4 = mdmsDataObj.links) === null || _mdmsDataObj$links4 === void 0 || (_mdmsDataObj$links4 = _mdmsDataObj$links4.filter(ele => ele === null || ele === void 0 ? void 0 : ele.link)) === null || _mdmsDataObj$links4 === void 0 ? void 0 : _mdmsDataObj$links4.sort((x, y) => (x === null || x === void 0 ? void 0 : x.orderNumber) - (y === null || y === void 0 ? void 0 : y.orderNumber)).map((link, i) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
                className: "linksWrapper",
                children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("a", {
                  href: link.link,
                  onClick: e => handleLinkClick(e, link.link),
                  children: link.i18nKey
                })
              }, i))
            })]
          }, code);
        }
        return null;
      })
    })]
  });
};
var EmployeeHome = _ref3 => {
  var {
    modules,
    additionalComponent
  } = _ref3;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "employee-app-container digit-home-employee-app",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.LandingPageWrapper, {
        children: modules === null || modules === void 0 ? void 0 : modules.map((_ref4, index) => {
          var {
            code
          } = _ref4;
          var Card = Digit.ComponentRegistryService.getComponent("".concat(code, "Card")) || (() => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), {}));
          return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Card, {}, index);
        })
      })
    }), additionalComponent && (additionalComponent === null || additionalComponent === void 0 ? void 0 : additionalComponent.length) > 0 && additionalComponent.map(i => {
      var Component = typeof i === "string" ? Digit.ComponentRegistryService.getComponent(i) : null;
      return Component ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
        className: "additional-component-wrapper",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Component, {})
      }) : null;
    })]
  });
};
var AppHome = _ref5 => {
  var {
    userType,
    modules,
    getCitizenMenu,
    fetchedCitizen,
    isLoading,
    additionalComponent
  } = _ref5;
  if (userType === "citizen") {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(CitizenHome, {
      modules: modules,
      getCitizenMenu: getCitizenMenu,
      fetchedCitizen: fetchedCitizen,
      isLoading: isLoading
    });
  }
  var isSuperUserWithMultipleRootTenant = Digit.UserService.hasAccess("SUPERUSER") && Digit.Utils.getMultiRootTenant();
  return Digit.Utils.getRoleBasedHomeCard() ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
    className: isSuperUserWithMultipleRootTenant ? "homeWrapper" : "",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_RoleBasedEmployeeHome__WEBPACK_IMPORTED_MODULE_4__.RoleBasedEmployeeHome, {
      modules: modules,
      additionalComponent: additionalComponent
    }), isSuperUserWithMultipleRootTenant && !window.Digit.Utils.browser.isMobile() ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_pages_employee_QuickStart_Config__WEBPACK_IMPORTED_MODULE_5__["default"], {}) : null]
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(EmployeeHome, {
    modules: modules,
    additionalComponent: additionalComponent
  });
};

/***/ }),

/***/ "./src/components/ImageComponent.js":
/*!******************************************!*\
  !*** ./src/components/ImageComponent.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["src", "alt", "decorative", "ariaLabel", "ariaLabelledby"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }



var ImageComponent = _ref => {
  var {
      src,
      alt = "Image not found",
      decorative = false,
      ariaLabel = "No Image description set",
      ariaLabelledby = "no-image-description"
    } = _ref,
    props = _objectWithoutProperties(_ref, _excluded);
  // Determine the appropriate attributes based on the props
  var accessibilityProps = {};
  if (decorative) {
    // For decorative images
    accessibilityProps.alt = "";
  } else if (alt) {
    // Provide meaningful alt text if available
    accessibilityProps.alt = alt;
  } else if (ariaLabel) {
    // Use aria-label if alt is not provided
    accessibilityProps["aria-label"] = ariaLabel;
  } else if (ariaLabelledby) {
    // Use aria-labelledby for descriptive associations
    accessibilityProps["aria-labelledby"] = ariaLabelledby;
  } else {
    console.warn("AccessibleImage: Missing alt, aria-label, or aria-labelledby for non-decorative image.");
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("img", _objectSpread(_objectSpread(_objectSpread({
    src: src
  }, accessibilityProps), props), {}, {
    tabIndex: 0,
    onKeyDown: e => {
      if (e.key === "Enter" || e.key === " ") {
        var _window, _window$getConfig;
        window.open((_window = window) === null || _window === void 0 || (_window = _window.globalConfigs) === null || _window === void 0 || (_window$getConfig = _window.getConfig) === null || _window$getConfig === void 0 ? void 0 : _window$getConfig.call(_window, "DIGIT_HOME_URL"), "_blank").focus();
      }
    }
  }));
};
ImageComponent.propTypes = {
  src: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  // The source URL for the image
  alt: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  // Alternative text for the image
  decorative: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  // If true, image is decorative
  ariaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  // Custom label for screen readers
  ariaLabelledby: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string) // Association with another descriptive element
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ImageComponent);

/***/ }),

/***/ "./src/components/LoginSignupSelector.js":
/*!***********************************************!*\
  !*** ./src/components/LoginSignupSelector.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["onSelect", "formData", "control", "formState"];
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }




var LoginSignupSelector = _ref => {
  var {
      onSelect,
      formData,
      control,
      formState
    } = _ref,
    props = _objectWithoutProperties(_ref, _excluded);
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var [isChecked, setIsChecked] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onSelect("check", isChecked);
  }, [isChecked]);
  var onButtonClickLogin = () => {
    var _window;
    window.location.replace("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/user/login"));
  };
  var onButtonClickSignUP = () => {
    var _window2;
    window.location.replace("/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/user/sign-up"));
  };
  var isSignupPage = window.location.href.includes("sandbox-ui/user/sign-up");
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "loginSignUpSelector",
      style: {
        marginTop: '-2rem'
      },
      children: isSignupPage ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        label: t("SB_ALREADY_HAVE_ACCOUNT"),
        variation: "link",
        size: "small",
        onClick: onButtonClickLogin
        // isSuffix={true}
        ,
        style: {
          marginBottom: "0.5rem",
          paddingLeft: "0.2rem"
        }
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        label: t("SB_DONT_HAVE_ACCOUNT"),
        variation: "link",
        size: "small",
        onClick: onButtonClickSignUP
        // isSuffix={true}
        ,
        style: {
          marginBottom: "0.5rem",
          paddingLeft: "0.2rem"
        }
      })
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoginSignupSelector);

/***/ }),

/***/ "./src/components/PrivacyComponent.js":
/*!********************************************!*\
  !*** ./src/components/PrivacyComponent.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["onSelect", "formData", "control", "formState"];
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }





var PrivacyComponent = _ref => {
  var {
      onSelect,
      formData,
      control,
      formState
    } = _ref,
    props = _objectWithoutProperties(_ref, _excluded);
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var tenantId = Digit.ULBService.getCurrentTenantId();
  var [isChecked, setIsChecked] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var [showPopUp, setShowPopUp] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var moduleName = Digit.Utils.getConfigModuleName();
  var {
    data: privacy
  } = Digit.Hooks.useCustomMDMS(tenantId, moduleName, [{
    name: "PrivacyPolicy"
  }], {
    select: data => {
      var _data$moduleName;
      var filteredPrivacyPolicy = data === null || data === void 0 || (_data$moduleName = data[moduleName]) === null || _data$moduleName === void 0 || (_data$moduleName = _data$moduleName.PrivacyPolicy) === null || _data$moduleName === void 0 ? void 0 : _data$moduleName.find(policy => {
        var _props$props;
        return policy.module === (props === null || props === void 0 || (_props$props = props.props) === null || _props$props === void 0 ? void 0 : _props$props.module);
      });
      return filteredPrivacyPolicy;
    }
  });
  var handleCheckboxChange = event => {
    setIsChecked(event.target.checked);
  };
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onSelect("check", isChecked);
  }, [isChecked]);
  var onButtonClick = () => {
    setShowPopUp(true);
  };
  var handleScrollToElement = id => {
    var element = document.getElementById(id);
    if (element) {
      element.scrollIntoView({
        behavior: "smooth"
      });
    }
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "digit-privacy-checkbox digit-privacy-checkbox-align",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.CheckBox, {
        label: t("ES_BY_CLICKING"),
        checked: isChecked,
        onChange: handleCheckboxChange,
        id: "privacy-component-check"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        label: t("ES_PRIVACY_POLICY"),
        variation: "link",
        size: "small",
        onClick: onButtonClick
        // isSuffix={true}
        ,
        style: {
          marginBottom: "1rem",
          paddingLeft: "0.2rem"
        }
      })]
    }), showPopUp && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.PopUp, {
      type: "default",
      className: "privacy-popUpClass",
      footerclassName: "popUpFooter",
      heading: t(privacy === null || privacy === void 0 ? void 0 : privacy.header),
      onOverlayClick: () => {
        setShowPopUp(false);
      },
      footerChildren: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        type: "button",
        size: "large",
        variation: "secondary",
        label: t("DIGIT_I_DO_NOT_ACCEPT"),
        onClick: () => {
          setIsChecked(false), setShowPopUp(false);
        }
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        type: "button",
        size: "large",
        variation: "primary",
        label: t("DIGIT_I_ACCEPT"),
        className: "accept-class",
        onClick: () => {
          setIsChecked(true), setShowPopUp(false);
        }
      })],
      sortFooterChildren: true,
      onClose: () => {
        setShowPopUp(false);
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
          className: "privacy-table",
          children: t("DIGIT_TABLE_OF_CONTENTS")
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", {
          children: privacy === null || privacy === void 0 ? void 0 : privacy.contents.map((content, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", {
            style: {
              display: "flex",
              alignItems: "center"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("span", {
              style: {
                marginRight: "0.5rem"
              },
              children: [index + 1, ". "]
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
              label: t(content.header),
              variation: "link",
              size: "medium",
              onClick: e => {
                e.preventDefault();
                handleScrollToElement(content === null || content === void 0 ? void 0 : content.header);
              },
              style: {
                justifyContent: "flex-start"
              }
            })]
          }, index))
        })]
      }), privacy === null || privacy === void 0 ? void 0 : privacy.contents.map((content, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
        id: content === null || content === void 0 ? void 0 : content.header,
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
          style: {
            fontWeight: 'bold',
            paddingLeft: content !== null && content !== void 0 && content.isSpaceRequired ? "1rem" : "0"
          },
          children: t(content.header)
        }), content.descriptions.map((description, subIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
          style: {
            paddingLeft: description.isSpaceRequired ? "1rem" : "0",
            marginBottom: '0.5rem'
          },
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
            style: {
              fontWeight: description !== null && description !== void 0 && description.isBold ? 700 : 400,
              display: "flex",
              alignItems: "center"
            },
            children: [description.type === 'points' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
              style: {
                marginRight: '0.5rem',
                listStyleType: 'disc'
              },
              children: "\u2022"
            }), description.type === 'step' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("span", {
              style: {
                marginRight: '0.5rem',
                listStyleType: 'decimal'
              },
              children: [subIndex + 1, ". "]
            }), t(description.text)]
          }), (description === null || description === void 0 ? void 0 : description.subDescriptions) && (description === null || description === void 0 ? void 0 : description.subDescriptions.length) > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
            className: "policy-subdescription",
            children: description.subDescriptions.map((subDesc, subSubIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
              className: "policy-subdescription-points",
              children: [subDesc.type === 'points' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
                style: {
                  marginRight: '0.5rem',
                  listStyleType: 'disc',
                  paddingLeft: '1rem'
                },
                children: "\u2022"
              }), subDesc.type === 'step' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("span", {
                style: {
                  marginRight: '0.5rem',
                  listStyleType: 'decimal',
                  paddingLeft: '1rem'
                },
                children: [subSubIndex + 1, ". "]
              }), subDesc.type === null && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
                style: {
                  marginRight: '0.5rem',
                  paddingLeft: '1rem'
                },
                children: " "
              }), t(subDesc.text)]
            }, subSubIndex))
          })]
        }, subIndex))]
      }, index))]
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PrivacyComponent);

/***/ }),

/***/ "./src/components/RoleBasedEmployeeHome.js":
/*!*************************************************!*\
  !*** ./src/components/RoleBasedEmployeeHome.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   RoleBasedEmployeeHome: () => (/* binding */ RoleBasedEmployeeHome)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }







var Components = __webpack_require__(/*! @egovernments/digit-ui-svg-components */ "@egovernments/digit-ui-svg-components");
var RoleBasedEmployeeHome = _ref => {
  var _Digit, _Object$keys;
  var {
    modules,
    additionalComponent
  } = _ref;
  var {
    isLoading,
    data
  } = Digit.Hooks.useAccessControl();
  var isMultiRootTenant = Digit.Utils.getMultiRootTenant();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var tenantId = (_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.ULBService) === null || _Digit === void 0 ? void 0 : _Digit.getStateId();
  var sortedConfigEmployeesSidebar = null;
  var [mdmsOrderData, setMdmsOrderData] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([{}]);
  var {
    data: MdmsRes
  } = Digit.Hooks.useCustomMDMS(tenantId, "HomeScreenOrder", [{
    name: "CardsAndLinksOrder"
  }], {
    select: data => {
      var _data$HomeScreenOrder;
      return data === null || data === void 0 || (_data$HomeScreenOrder = data["HomeScreenOrder"]) === null || _data$HomeScreenOrder === void 0 ? void 0 : _data$HomeScreenOrder["CardsAndLinksOrder"];
    }
  });
  var {
    data: moduleConfigData,
    isLoading: isModuleConfigLoading
  } = Digit.Hooks.useCustomMDMS(tenantId, "SandBoxLanding", [{
    name: "AdditionalModuleLinks"
  }], {
    select: data => {
      var _data$SandBoxLanding;
      return data === null || data === void 0 || (_data$SandBoxLanding = data["SandBoxLanding"]) === null || _data$SandBoxLanding === void 0 ? void 0 : _data$SandBoxLanding["AdditionalModuleLinks"];
    }
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    setMdmsOrderData(MdmsRes);
  }, [MdmsRes]);
  var transformURL = function transformURL() {
    var _url, _window;
    var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
    if (url == "/") {
      return;
    }
    if (((_url = url) === null || _url === void 0 ? void 0 : _url.indexOf("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath))) === -1) {
      var updatedUrl = null;
      if (isMultiRootTenant) {
        url = url.replace("/sandbox-ui/employee", "/sandbox-ui/".concat(tenantId, "/employee"));
        updatedUrl = url;
      } else {
        updatedUrl = url;
      }
      return updatedUrl;
    } else {
      return url;
    }
  };
  var getLinkByType = (moduleData, type) => {
    if (!moduleData || !type) return null;
    var moduleConfig = moduleConfigData === null || moduleConfigData === void 0 ? void 0 : moduleConfigData.find(config => config.moduleName === moduleData.module);
    var linkKey = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig[type];
    var links = moduleData === null || moduleData === void 0 ? void 0 : moduleData.links;
    return (links === null || links === void 0 ? void 0 : links.find(item => (item === null || item === void 0 ? void 0 : item.displayName) === linkKey)) || null;
  };

  // Function to filter links dynamically based on module config
  var getFilteredLinks = moduleData => {
    var _moduleData$links;
    var moduleConfig = moduleConfigData === null || moduleConfigData === void 0 ? void 0 : moduleConfigData.find(config => config.moduleName === moduleData.module);
    return moduleData === null || moduleData === void 0 || (_moduleData$links = moduleData.links) === null || _moduleData$links === void 0 ? void 0 : _moduleData$links.filter(item => {
      var displayName = item.displayName;
      var isNotConfigureMaster = displayName !== "Configure_master";
      var isNotHowItWorks = displayName !== (moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.howItWorksLink);
      var isNotUserManual = displayName !== (moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.userManualLink);
      return isNotConfigureMaster && isNotHowItWorks && isNotUserManual;
    });
  };
  var configEmployeeSideBar = data === null || data === void 0 ? void 0 : data.actions.filter(e => e.url === "card" && e.parentModule).reduce((acc, item) => {
    var module = item.parentModule;
    if (!acc[module]) {
      acc[module] = {
        module: module,
        kpis: [],
        icon: item.leftIcon ? Digit.Utils.iconRender({
          iconName: item.leftIcon,
          iconFill: "white",
          CustomSVG: _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CustomSVG,
          Components
        }) : "",
        label: Digit.Utils.locale.getTransformedLocale("".concat(module, "_CARD_HEADER")),
        links: []
      };
    }
    var linkUrl = transformURL(item.navigationURL);
    var queryParamIndex = linkUrl.indexOf("?");
    acc[module].links.push({
      link: linkUrl,
      icon: item.leftIcon,
      queryParams: queryParamIndex === -1 ? null : linkUrl.substring(queryParamIndex),
      label: t(Digit.Utils.locale.getTransformedLocale("".concat(module, "_LINK_").concat(item.displayName))),
      displayName: item.displayName
    });
    return acc;
  }, {});
  if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Loader, {
      page: false,
      variant: "PageLoader"
    });
  }
  if (!configEmployeeSideBar) {
    return "";
  }
  var sortCardAndLink = configEmployeeSideBar => {
    var sortedModules = Object.keys(configEmployeeSideBar).sort((a, b) => {
      var _mdmsOrderData$find, _mdmsOrderData$find2;
      var cardOrderA = (mdmsOrderData === null || mdmsOrderData === void 0 || (_mdmsOrderData$find = mdmsOrderData.find(item => item.moduleType === "card" && item.name === a)) === null || _mdmsOrderData$find === void 0 ? void 0 : _mdmsOrderData$find.order) || null;
      var cardOrderB = (mdmsOrderData === null || mdmsOrderData === void 0 || (_mdmsOrderData$find2 = mdmsOrderData.find(item => item.moduleType === "card" && item.name === b)) === null || _mdmsOrderData$find2 === void 0 ? void 0 : _mdmsOrderData$find2.order) || null;
      return cardOrderA - cardOrderB;
    }).reduce((acc, module) => {
      var _configEmployeeSideBa;
      var sortedLinks = configEmployeeSideBar === null || configEmployeeSideBar === void 0 || (_configEmployeeSideBa = configEmployeeSideBar[module]) === null || _configEmployeeSideBa === void 0 || (_configEmployeeSideBa = _configEmployeeSideBa.links) === null || _configEmployeeSideBa === void 0 ? void 0 : _configEmployeeSideBa.sort((linkA, linkB) => {
        var _mdmsOrderData$find3, _mdmsOrderData$find4;
        var labelA = linkA === null || linkA === void 0 ? void 0 : linkA.displayName;
        var labelB = linkB === null || linkB === void 0 ? void 0 : linkB.displayName;
        var orderA = (mdmsOrderData === null || mdmsOrderData === void 0 || (_mdmsOrderData$find3 = mdmsOrderData.find(item => item.moduleType === "link" && item.name === "".concat(module, ".").concat(labelA.replace(/\s+/g, "_")))) === null || _mdmsOrderData$find3 === void 0 ? void 0 : _mdmsOrderData$find3.order) || null;
        var orderB = (mdmsOrderData === null || mdmsOrderData === void 0 || (_mdmsOrderData$find4 = mdmsOrderData.find(item => item.moduleType === "link" && item.name === "".concat(module, ".").concat(labelB.replace(/\s+/g, "_")))) === null || _mdmsOrderData$find4 === void 0 ? void 0 : _mdmsOrderData$find4.order) || null;
        return orderA - orderB;
      });
      acc[module] = _objectSpread(_objectSpread({}, configEmployeeSideBar[module]), {}, {
        links: sortedLinks
      });
      return acc;
    }, {});
    return sortedModules;
  };
  if (isMultiRootTenant) {
    sortedConfigEmployeesSidebar = sortCardAndLink(configEmployeeSideBar);
  } else {
    sortedConfigEmployeesSidebar = configEmployeeSideBar;
  }
  var children = (_Object$keys = Object.keys(sortedConfigEmployeesSidebar)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map((current, index) => {
    var _sortedConfigEmployee, _moduleData$links2;
    var moduleData = (_sortedConfigEmployee = sortedConfigEmployeesSidebar) === null || _sortedConfigEmployee === void 0 ? void 0 : _sortedConfigEmployee[current];
    var configureData = moduleData === null || moduleData === void 0 || (_moduleData$links2 = moduleData.links) === null || _moduleData$links2 === void 0 ? void 0 : _moduleData$links2.find(item => (item === null || item === void 0 ? void 0 : item.displayName) === "Configure_master");
    var howItWorks = getLinkByType(moduleData, "howItWorksLink");
    var userManual = getLinkByType(moduleData, "userManualLink");
    var propsForModuleCard = {
      icon: "SupervisorAccount",
      moduleName: t(moduleData === null || moduleData === void 0 ? void 0 : moduleData.label),
      metrics: [],
      links: Digit.Utils.getMultiRootTenant() ? getFilteredLinks(moduleData) : moduleData === null || moduleData === void 0 ? void 0 : moduleData.links,
      centreChildren: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        children: t(Digit.Utils.locale.getTransformedLocale("MODULE_CARD_DESC_".concat(current)))
      }), howItWorks && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
        variation: "teritiary",
        label: howItWorks === null || howItWorks === void 0 ? void 0 : howItWorks.label,
        icon: howItWorks === null || howItWorks === void 0 ? void 0 : howItWorks.icon,
        type: "button",
        size: "medium",
        onClick: () => window.open(howItWorks === null || howItWorks === void 0 ? void 0 : howItWorks.link, "_blank"),
        style: {
          padding: "0px"
        }
      })],
      endChildren: Digit.Utils.getMultiRootTenant() ? [configureData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
        variation: "teritiary",
        label: configureData === null || configureData === void 0 ? void 0 : configureData.label,
        icon: configureData === null || configureData === void 0 ? void 0 : configureData.icon,
        type: "button",
        size: "medium",
        onClick: () => navigate(configureData === null || configureData === void 0 ? void 0 : configureData.link),
        style: {
          padding: "0px"
        }
      }), userManual && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
        variation: "teritiary",
        label: userManual === null || userManual === void 0 ? void 0 : userManual.label,
        icon: userManual === null || userManual === void 0 ? void 0 : userManual.icon,
        type: "button",
        size: "medium",
        onClick: () => window.open(userManual === null || userManual === void 0 ? void 0 : userManual.link, "_blank"),
        style: {
          padding: "0px"
        }
      })] : null
    };
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.LandingPageCard, _objectSpread({
      buttonSize: "medium"
    }, propsForModuleCard));
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.LandingPageWrapper, {
      children: react__WEBPACK_IMPORTED_MODULE_0___default().Children.map(children, child => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child))
    })
  });
};

/***/ }),

/***/ "./src/components/Search/MobileSearchApplication.js":
/*!**********************************************************!*\
  !*** ./src/components/Search/MobileSearchApplication.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _SearchFields__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SearchFields */ "./src/components/Search/SearchFields.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
  _excluded2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"];
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }



// import { convertEpochToDateDMY } from "../../utils";

var MobileSearchApplication = _ref => {
  var _data$roles;
  var {
    Controller,
    register,
    control,
    t,
    reset,
    previousPage,
    handleSubmit,
    tenantId,
    data,
    onSubmit: _onSubmit,
    isLoading
  } = _ref;
  function activateModal(state, action) {
    switch (action.type) {
      case "set":
        return action.payload;
      case "remove":
        return false;
      default:
        break;
    }
  }
  var [tabledata, settabledata] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  var DownloadBtn = props => {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      onClick: props.onClick,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.DownloadBtnCommon, {})
    });
  };
  var handleExcelDownload = tabData => {
    if ((tabData === null || tabData === void 0 ? void 0 : tabData[0]) !== undefined) {
      return Digit.Download.Excel(tabData === null || tabData === void 0 ? void 0 : tabData[0], "AuditReport");
    }
  };
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
      settabledata([data === null || data === void 0 ? void 0 : data.map(obj => {
        var returnObject = {};
        returnObject[t("AUDIT_DATE_LABEL")] = convertEpochToDate(obj === null || obj === void 0 ? void 0 : obj.timestamp);
        returnObject[t("AUDIT_TIME_LABEL")] = convertEpochToTimeInHours(obj === null || obj === void 0 ? void 0 : obj.timestamp);
        returnObject[t("AUDIT_DATAVIEWED_LABEL")] = (obj === null || obj === void 0 ? void 0 : obj.dataView[0]) + "," + (obj === null || obj === void 0 ? void 0 : obj.dataView[1]);
        returnObject[t("AUDIT_DATAVIEWED_BY_LABEL")] = obj === null || obj === void 0 ? void 0 : obj.dataViewedBy;
        returnObject[t("AUDIT_ROLE_LABEL")] = obj === null || obj === void 0 ? void 0 : obj.roles.map(obj => obj.name).join(",");
        return _objectSpread({}, returnObject);
      })]);
    }
  }, [data]);
  var convertEpochToDate = dateEpoch => {
    if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") {
      return "NA";
    }
    var dateFromApi = new Date(dateEpoch);
    var month = dateFromApi.getMonth() + 1;
    var day = dateFromApi.getDate();
    var year = dateFromApi.getFullYear();
    month = (month > 9 ? "" : "0") + month;
    day = (day > 9 ? "" : "0") + day;
    return "".concat(day, "/").concat(month, "/").concat(year);
  };
  var convertEpochToTimeInHours = dateEpoch => {
    if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") {
      return "NA";
    }
    var dateFromApi = new Date(dateEpoch);
    var hour = dateFromApi.getHours();
    var min = dateFromApi.getMinutes();
    var period = hour > 12 ? "PM" : "AM";
    hour = hour > 12 ? hour - 12 : hour;
    hour = (hour > 9 ? "" : "0") + hour;
    min = (min > 9 ? "" : "0") + min;
    return "".concat(hour, ":").concat(min, " ").concat(period);
  };
  var [currentlyActiveMobileModal, setActiveMobileModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useReducer)(activateModal, false);
  var closeMobilePopupModal = () => {
    setActiveMobileModal({
      type: "remove"
    });
  };
  var MobilePopUpCloseButton = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
    className: "InboxMobilePopupCloseButtonWrapper",
    onClick: closeMobilePopupModal,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CloseSvg, {})
  });
  var searchFormFieldsComponentProps = {
    Controller,
    register,
    control,
    t,
    reset,
    previousPage
  };
  var MobileComponentDirectory = _ref2 => {
    var {
        currentlyActiveMobileModal,
        searchFormFieldsComponentProps,
        tenantId
      } = _ref2,
      props = _objectWithoutProperties(_ref2, _excluded);
    var {
      closeMobilePopupModal
    } = props;
    switch (currentlyActiveMobileModal) {
      case "SearchFormComponent":
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.SearchForm, _objectSpread(_objectSpread({}, props), {}, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(MobilePopUpCloseButton, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
            className: "MobilePopupHeadingWrapper",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("h2", {
              children: [t("PRIVACY_AUDIT_REPORT"), ":"]
            })
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_SearchFields__WEBPACK_IMPORTED_MODULE_2__["default"], _objectSpread(_objectSpread({}, searchFormFieldsComponentProps), {}, {
            closeMobilePopupModal,
            tenantId,
            t
          }))]
        }));
      default:
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {});
    }
  };
  var CurrentMobileModalComponent = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(_ref3 => {
    var {
        currentlyActiveMobileModal,
        searchFormFieldsComponentProps,
        tenantId
      } = _ref3,
      props = _objectWithoutProperties(_ref3, _excluded2);
    return MobileComponentDirectory(_objectSpread({
      currentlyActiveMobileModal,
      searchFormFieldsComponentProps,
      tenantId
    }, props));
  }, [currentlyActiveMobileModal]);
  var roles = [];
  data === null || data === void 0 || (_data$roles = data.roles) === null || _data$roles === void 0 || _data$roles.forEach(item => {
    roles.push(item === null || item === void 0 ? void 0 : item.name);
  });
  var propsMobileInboxCards = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    if (data !== null && data !== void 0 && data.display) {
      return [];
    }
    if (data === "") {
      return [];
    }
    return data === null || data === void 0 ? void 0 : data.map(data => {
      var _data$roles$slice;
      return {
        [t("AUDIT_DATE_LABEL")]: convertEpochToDate(data.timestamp),
        [t("AUDIT_TIME_LABEL")]: convertEpochToTimeInHours(data.timestamp),
        [t("AUDIT_DATAVIEWED_LABEL")]: data.dataView[0] + "," + data.dataView[1],
        [t("AUDIT_DATAVIEWED_BY_LABEL")]: data.dataViewedBy,
        [t("AUDIT_ROLE_LABEL")]: (_data$roles$slice = data.roles.slice(0, 3)) === null || _data$roles$slice === void 0 ? void 0 : _data$roles$slice.map(e => e.name).join(",")
      };
    });
  }, [data]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackButton, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "sideContent",
      style: {
        marginLeft: "70%",
        marginTop: "-12%"
      },
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(DownloadBtn, {
        className: "mrlg cursorPointer",
        onClick: () => handleExcelDownload(tabledata)
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.HeaderComponent, {
      children: [t("PRIVACY_AUDIT_REPORT"), ":"]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "digit-search-box",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.SearchAction, {
        text: t("ES_COMMON_SEARCH"),
        handleActionClick: () => setActiveMobileModal({
          type: "set",
          payload: "SearchFormComponent"
        }),
        tenantId,
        t
      })
    }), currentlyActiveMobileModal ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.PopUp, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(CurrentMobileModalComponent, {
        onSubmit: data => {
          setActiveMobileModal({
            type: "remove"
          });
          _onSubmit(data);
        },
        handleSubmit: handleSubmit,
        id: "search-form",
        className: "rm-mb form-field-flex-one inboxPopupMobileWrapper",
        searchFormFieldsComponentProps,
        currentlyActiveMobileModal,
        closeMobilePopupModal,
        tenantId
      })
    }) : null, isLoading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.DetailsCard, {
      data: propsMobileInboxCards
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MobileSearchApplication);

/***/ }),

/***/ "./src/components/Search/SearchFields.js":
/*!***********************************************!*\
  !*** ./src/components/Search/SearchFields.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_hook_form__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-hook-form */ "../../../node_modules/react-hook-form/dist/index.esm.mjs");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var SearchFields = _ref => {
  var {
    register,
    control,
    reset,
    tenantId,
    t,
    previousPage,
    formState,
    isLoading
  } = _ref;
  var isMobile = window.Digit.Utils.browser.isMobile();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.SearchField, {
      className: "pt-form-field",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
        children: t("AUDIT_FROM_DATE_LABEL")
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_hook_form__WEBPACK_IMPORTED_MODULE_2__.Controller, {
        render: props => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.DatePicker, {
          date: props.value,
          onChange: props.onChange
        }),
        name: "fromDate",
        control: control
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.SearchField, {
      className: "pt-form-field",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
        children: t("AUDIT_TO_DATE_LABEL")
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_hook_form__WEBPACK_IMPORTED_MODULE_2__.Controller, {
        render: props => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.DatePicker, {
          date: props.value,
          onChange: props.onChange
        }),
        name: "toDate",
        control: control
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.SearchField, {
      className: "pt-search-action-submit",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
        style: {
          marginTop: isMobile ? "510px" : "25px",
          marginLeft: isMobile ? "0" : "-30px",
          maxWidth: isMobile ? "100%" : "240px"
        },
        label: t("ES_COMMON_APPLY"),
        submit: true
      })
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchFields);

/***/ }),

/***/ "./src/components/Search/index.js":
/*!****************************************!*\
  !*** ./src/components/Search/index.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_hook_form__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-hook-form */ "../../../node_modules/react-hook-form/dist/index.esm.mjs");
/* harmony import */ var _MobileSearchApplication__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MobileSearchApplication */ "./src/components/Search/MobileSearchApplication.js");
/* harmony import */ var _SearchFields__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SearchFields */ "./src/components/Search/SearchFields.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }







var SearchApplication = _ref => {
  var {
    tenantId,
    t,
    onSubmit,
    data,
    count
  } = _ref;
  var initialValues = Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL") || {
    offset: 0,
    limit: 5,
    sortOrder: "DESC"
  };
  var {
    register,
    control,
    handleSubmit,
    setValue,
    getValues,
    reset
  } = (0,react_hook_form__WEBPACK_IMPORTED_MODULE_3__.useForm)({
    defaultValues: initialValues
  });
  var convertEpochToDate = dateEpoch => {
    if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") {
      return "NA";
    }
    var dateFromApi = new Date(dateEpoch);
    var month = dateFromApi.getMonth() + 1;
    var day = dateFromApi.getDate();
    var year = dateFromApi.getFullYear();
    month = (month > 9 ? "" : "0") + month;
    day = (day > 9 ? "" : "0") + day;
    return "".concat(day, "/").concat(month, "/").concat(year);
  };
  var convertEpochToTimeInHours = dateEpoch => {
    if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") {
      return "NA";
    }
    var dateFromApi = new Date(dateEpoch);
    var hour = dateFromApi.getHours();
    var min = dateFromApi.getMinutes();
    var period = hour > 12 ? "PM" : "AM";
    hour = hour > 12 ? hour - 12 : hour;
    hour = (hour > 9 ? "" : "0") + hour;
    min = (min > 9 ? "" : "0") + min;
    return "".concat(hour, ":").concat(min, " ").concat(period);
  };
  var [tabledata, settabledata] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]);
  var DownloadBtn = props => {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
      onClick: props.onClick,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.DownloadBtnCommon, {})
    });
  };
  var handleExcelDownload = tabData => {
    if ((tabData === null || tabData === void 0 ? void 0 : tabData[0]) !== undefined) {
      return Digit.Download.Excel(tabData === null || tabData === void 0 ? void 0 : tabData[0], "AuditReport");
    }
  };
  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    register("offset", 0);
    register("limit", 5);
    register("sortOrder", "DESC");
  }, [register]);
  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
      settabledata([data === null || data === void 0 ? void 0 : data.map(obj => {
        var returnObject = {};
        returnObject[t("AUDIT_DATE_LABEL")] = convertEpochToDate(obj === null || obj === void 0 ? void 0 : obj.timestamp);
        returnObject[t("AUDIT_TIME_LABEL")] = convertEpochToTimeInHours(obj === null || obj === void 0 ? void 0 : obj.timestamp);
        returnObject[t("AUDIT_DATAVIEWED_LABEL")] = (obj === null || obj === void 0 ? void 0 : obj.dataView[0]) + "," + (obj === null || obj === void 0 ? void 0 : obj.dataView[1]);
        returnObject[t("AUDIT_DATAVIEWED_BY_LABEL")] = obj === null || obj === void 0 ? void 0 : obj.dataViewedBy;
        returnObject[t("AUDIT_ROLE_LABEL")] = obj === null || obj === void 0 ? void 0 : obj.roles.map(obj => obj.name).join(",");
        return _objectSpread({}, returnObject);
      })]);
    }
  }, [data]);
  var onSort = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(args => {
    if (args.length === 0) return;
    setValue("sortBy", args.id);
    setValue("sortOrder", args.desc ? "DESC" : "ASC");
  }, []);
  function onPageSizeChange(e) {
    setValue("limit", Number(e.target.value));
    handleSubmit(onSubmit)();
  }
  function nextPage() {
    setValue("offset", getValues("offset") + getValues("limit"));
    handleSubmit(onSubmit)();
  }
  function previousPage() {
    setValue("offset", getValues("offset") - getValues("limit"));
    handleSubmit(onSubmit)();
  }
  var isMobile = window.Digit.Utils.browser.isMobile();
  if (isMobile) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_MobileSearchApplication__WEBPACK_IMPORTED_MODULE_4__["default"], {
      Controller: react_hook_form__WEBPACK_IMPORTED_MODULE_3__.Controller,
      register,
      control,
      t,
      reset,
      previousPage,
      handleSubmit,
      tenantId,
      data,
      onSubmit
    });
  }

  //need to get from workflow
  var GetCell = value => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
    className: "cell-text",
    children: value
  });
  var columns = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => [{
    Header: t("AUDIT_DATE_LABEL"),
    disableSortBy: true,
    accessor: row => {
      var timestamp = row.timestamp === "NA" ? t("WS_NA") : convertEpochToDate(row.timestamp);
      return GetCell("".concat(timestamp));
    }
  }, {
    Header: t("AUDIT_TIME_LABEL"),
    disableSortBy: true,
    accessor: row => {
      var timestamp = row.timestamp === "NA" ? t("WS_NA") : convertEpochToTimeInHours(row.timestamp);
      return GetCell("".concat(timestamp));
    }
  }, {
    Header: isMobile ? t("AUDIT_DATAVIEWED_LABEL") : t("AUDIT_DATAVIEWED_PRIVACY"),
    disableSortBy: true,
    accessor: row => {
      return GetCell("".concat(row === null || row === void 0 ? void 0 : row.dataView));
    }
  }, {
    Header: isMobile ? t("AUDIT_DATAVIEWED_BY_LABEL") : t("AUDIT_DATAVIEWED_BY_PRIVACY"),
    disableSortBy: true,
    accessor: row => {
      return GetCell("".concat(row === null || row === void 0 ? void 0 : row.dataViewedBy));
    }
  }, {
    Header: t("AUDIT_ROLE_LABEL"),
    disableSortBy: true,
    accessor: row => {
      var _row$roles$slice;
      return GetCell("".concat(row === null || row === void 0 || (_row$roles$slice = row.roles.slice(0, 3)) === null || _row$roles$slice === void 0 ? void 0 : _row$roles$slice.map(e => e.name)));
    }
  }], []);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      style: {
        marginRight: "-70px"
      },
      children: [" ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.BackButton, {}), " "]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      style: {
        marginTop: "30px",
        marginLeft: "30px"
      },
      children: [" ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.HeaderComponent, {
        children: t("PRIVACY_AUDIT_REPORT")
      }), " "]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.SearchForm, {
      className: "audit-card",
      onSubmit: onSubmit,
      handleSubmit: handleSubmit,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_SearchFields__WEBPACK_IMPORTED_MODULE_5__["default"], {
        register,
        control,
        reset,
        tenantId,
        t,
        previousPage
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
      style: {
        marginTop: "240px",
        marginLeft: "-55%",
        maxWidth: "80%",
        marginRight: "52px"
      },
      children: data !== null && data !== void 0 && data.display ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
        style: {
          marginTop: "20x",
          width: "1025px",
          marginLeft: "25px",
          backgroundColor: "white",
          height: "60px"
        },
        children: t(data.display).split("\\n").map((text, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p", {
          style: {
            textAlign: "center"
          },
          children: text
        }, index))
      }) : data !== "" ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
        style: {
          backgroundColor: "white",
          marginRight: "-30px",
          marginLeft: "30px"
        },
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
          className: "sideContent",
          style: {
            float: "right",
            padding: "10px 30px"
          },
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(DownloadBtn, {
            className: "mrlg cursorPointer",
            onClick: () => handleExcelDownload(tabledata)
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.Table, {
          t: t,
          data: data,
          totalRecords: count,
          columns: columns,
          getCellProps: cellInfo => {
            return {
              style: {
                minWidth: cellInfo.column.Header === t("ES_INBOX_APPLICATION_NO") ? "240px" : "",
                padding: "20px 18px",
                fontSize: "16px"
              }
            };
          },
          onPageSizeChange: onPageSizeChange,
          currentPage: getValues("offset") / getValues("limit"),
          onNextPage: nextPage,
          onPrevPage: previousPage,
          manualPagination: false,
          pageSizeLimit: getValues("limit"),
          onSort: onSort,
          disableSort: false,
          sortParams: [{
            id: getValues("sortBy"),
            desc: getValues("sortOrder") === "DESC" ? true : false
          }]
        })]
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Loader, {})
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchApplication);

/***/ }),

/***/ "./src/components/TopBarSideBar/SideBar/CitizenSideBar.js":
/*!****************************************************************!*\
  !*** ./src/components/TopBarSideBar/SideBar/CitizenSideBar.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CitizenSideBar: () => (/* binding */ CitizenSideBar)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _ChangeCity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ChangeCity */ "./src/components/ChangeCity.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/components/utils.js");
/* harmony import */ var _StaticCitizenSideBar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./StaticCitizenSideBar */ "./src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _ImageComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
// import { NavBar } from "@egovernments/digit-ui-react-components";











var Profile = _ref => {
  var _Digit$ComponentRegis;
  var {
    info,
    stateName,
    t
  } = _ref;
  var [profilePic, setProfilePic] = react__WEBPACK_IMPORTED_MODULE_1___default().useState(null);
  react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(/*#__PURE__*/_asyncToGenerator(function* () {
    var tenant = Digit.ULBService.getCurrentTenantId();
    var uuid = info === null || info === void 0 ? void 0 : info.uuid;
    if (uuid) {
      var _usersResponse$user;
      var usersResponse = yield Digit.UserService.userSearch(tenant, {
        uuid: [uuid]
      }, {});
      if (usersResponse && usersResponse.user && usersResponse !== null && usersResponse !== void 0 && (_usersResponse$user = usersResponse.user) !== null && _usersResponse$user !== void 0 && _usersResponse$user.length) {
        var _userDetails$photo;
        var userDetails = usersResponse.user[0];
        var thumbs = userDetails === null || userDetails === void 0 || (_userDetails$photo = userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
        setProfilePic(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
      }
    }
  }), [profilePic !== null]);
  var CustomEmployeeTopBar = (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("CustomEmployeeTopBar");
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
    className: "profile-section",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "imageloader imageloader-loaded",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ImageComponent__WEBPACK_IMPORTED_MODULE_8__["default"], {
        className: "img-responsive img-circle img-Profile",
        src: profilePic ? profilePic : _utils__WEBPACK_IMPORTED_MODULE_5__.defaultImage,
        style: {
          objectFit: "cover",
          objectPosition: "center"
        },
        alt: "Profile Image"
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      id: "profile-name",
      className: "label-container name-Profile",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
        className: "label-text",
        children: [" ", info === null || info === void 0 ? void 0 : info.name, " "]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      id: "profile-location",
      className: "label-container loc-Profile",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
        className: "label-text",
        children: [" ", info === null || info === void 0 ? void 0 : info.mobileNumber, " "]
      })
    }), (info === null || info === void 0 ? void 0 : info.emailId) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      id: "profile-emailid",
      className: "label-container loc-Profile",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
        className: "label-text",
        children: [" ", info.emailId, " "]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "profile-divider"
    }), window.location.href.includes("/employee") && !window.location.href.includes("/employee/user/login") && !window.location.href.includes("employee/user/language-selection") && !CustomEmployeeTopBar && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ChangeCity__WEBPACK_IMPORTED_MODULE_4__["default"], {
      t: t,
      mobileView: true
    })]
  });
};

/* 
Feature :: Citizen Webview sidebar
*/
var CitizenSideBar = _ref3 => {
  var _menuItems2, _menuItems3, _user$info2, _user$info3, _user$info4;
  var {
    isOpen,
    isMobile = false,
    toggleSidebar,
    onLogout,
    isEmployee = false,
    linkData,
    islinkDataLoading,
    userProfile
  } = _ref3;
  var isMultiRootTenant = Digit.Utils.getMultiRootTenant();
  var {
    data: storeData,
    isFetched
  } = Digit.Hooks.useStore.getInitData();
  var selectedLanguage = Digit.StoreData.getCurrentLanguage();
  var [profilePic, setProfilePic] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  var {
    languages,
    stateInfo
  } = storeData || {};
  var user = Digit.UserService.getUser();
  var [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
  var [dropDownData, setDropDownData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  var [selectCityData, setSelectCityData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  var [selectedCity, setSelectedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); //selectedCities?.[0]?.value
  var [selected, setselected] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(selectedLanguage);
  var selectedCities = [];
  var {
    isLoading,
    data
  } = Digit.Hooks.useAccessControl();
  var tenantId = Digit.ULBService.getCurrentTenantId();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();

  // React Router v6: useNavigate replaces useHistory
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  // React Router v6: useLocation for accessing location object
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  var stringReplaceAll = function stringReplaceAll() {
    var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
    var searcher = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
    var replaceWith = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
    if (searcher == "") return str;
    while ((_str = str) !== null && _str !== void 0 && _str.includes(searcher)) {
      var _str, _str2;
      str = (_str2 = str) === null || _str2 === void 0 ? void 0 : _str2.replace(searcher, replaceWith);
    }
    return str;
  };
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    var _userloggedValues$inf;
    var userloggedValues = Digit.SessionStorage.get("citizen.userRequestObject");
    var teantsArray = [],
      filteredArray = [];
    userloggedValues === null || userloggedValues === void 0 || (_userloggedValues$inf = userloggedValues.info) === null || _userloggedValues$inf === void 0 || (_userloggedValues$inf = _userloggedValues$inf.roles) === null || _userloggedValues$inf === void 0 || _userloggedValues$inf.forEach(role => teantsArray.push(role.tenantId));
    var unique = teantsArray.filter((item, i, ar) => ar.indexOf(item) === i);
    unique === null || unique === void 0 || unique.forEach(uniCode => {
      var _stringReplaceAll;
      filteredArray.push({
        label: t("TENANT_TENANTS_".concat((_stringReplaceAll = stringReplaceAll(uniCode, ".", "_")) === null || _stringReplaceAll === void 0 ? void 0 : _stringReplaceAll.toUpperCase())),
        value: uniCode
      });
    });
    selectedCities = filteredArray === null || filteredArray === void 0 ? void 0 : filteredArray.filter(select => select.value == Digit.SessionStorage.get("Employee.tenantId"));
    setSelectCityData(filteredArray);
  }, [dropDownData]);
  var closeSidebar = () => {
    Digit.clikOusideFired = true;
    toggleSidebar(false);
  };
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    var fetchUserProfile = /*#__PURE__*/function () {
      var _ref4 = _asyncToGenerator(function* () {
        var _user$info;
        var tenant = Digit.ULBService.getCurrentTenantId();
        var uuid = user === null || user === void 0 || (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.uuid;
        if (uuid) {
          var _usersResponse$user2, _usersResponse$user3;
          var usersResponse = yield Digit.UserService.userSearch(tenant, {
            uuid: [uuid]
          }, {});
          var userData = usersResponse === null || usersResponse === void 0 || (_usersResponse$user2 = usersResponse.user) === null || _usersResponse$user2 === void 0 ? void 0 : _usersResponse$user2[0];
          if (userData) {
            var currentUser = Digit.UserService.getUser();
            Digit.UserService.setUser(_objectSpread(_objectSpread({}, currentUser), {}, {
              info: userData
            }));
          }
          if (usersResponse && usersResponse.user && usersResponse !== null && usersResponse !== void 0 && (_usersResponse$user3 = usersResponse.user) !== null && _usersResponse$user3 !== void 0 && _usersResponse$user3.length) {
            var _userDetails$photo2;
            var userDetails = usersResponse.user[0];
            var thumbs = userDetails === null || userDetails === void 0 || (_userDetails$photo2 = userDetails.photo) === null || _userDetails$photo2 === void 0 ? void 0 : _userDetails$photo2.split(",");
            setProfilePic(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
          }
        }
      });
      return function fetchUserProfile() {
        return _ref4.apply(this, arguments);
      };
    }();
    if (!profilePic) {
      fetchUserProfile();
    }
  }, [profilePic]);
  var handleChangeCity = city => {
    var _Digit$SessionStorage, _window$location, _window;
    var loggedInData = Digit.SessionStorage.get("citizen.userRequestObject");
    var filteredRoles = (_Digit$SessionStorage = Digit.SessionStorage.get("citizen.userRequestObject")) === null || _Digit$SessionStorage === void 0 || (_Digit$SessionStorage = _Digit$SessionStorage.info) === null || _Digit$SessionStorage === void 0 || (_Digit$SessionStorage = _Digit$SessionStorage.roles) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.filter(role => role.tenantId === city.value);
    if ((filteredRoles === null || filteredRoles === void 0 ? void 0 : filteredRoles.length) > 0) {
      loggedInData.info.roles = filteredRoles;
      loggedInData.info.tenantId = city === null || city === void 0 ? void 0 : city.value;
    }
    Digit.SessionStorage.set("Employee.tenantId", city === null || city === void 0 ? void 0 : city.value);
    Digit.UserService.setUser(loggedInData);
    setDropDownData(city);
    if (typeof window !== 'undefined' && (_window$location = window.location) !== null && _window$location !== void 0 && (_window$location = _window$location.href) !== null && _window$location !== void 0 && _window$location.includes("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/employee/"))) {
      var _location$state, _window2;
      // React Router v6: navigate with { replace: true } instead of history.replace()
      var redirectPath = ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.from) || "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/employee");
      navigate(redirectPath, {
        replace: true
      });
    }
    // Safe reload with error handling
    try {
      if (typeof window !== 'undefined') {
        window.location.reload();
      }
    } catch (error) {
      console.warn('Failed to reload page:', error);
    }
  };
  var handleChangeLanguage = language => {
    setselected(language.value);
    Digit.LocalizationService.changeLanguage(language.value, stateInfo.code);
  };
  var handleModuleClick = url => {
    var updatedUrl = null;
    if (Digit.Utils.getMultiRootTenant()) {
      updatedUrl = isEmployee ? url.replace("/sandbox-ui/employee", "/sandbox-ui/".concat(tenantId, "/employee")) : url.replace("/sandbox-ui/citizen", "/sandbox-ui/".concat(tenantId, "/citizen"));
      // React Router v6: navigate() instead of history.push()
      navigate(updatedUrl);
      toggleSidebar();
    } else {
      var _window3, _window4;
      url[0] === "/" ? navigate("/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/").concat(isEmployee ? "employee" : "citizen").concat(url)) : navigate("/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/").concat(isEmployee ? "employee" : "citizen", "/").concat(url));
      toggleSidebar();
    }
  };
  var redirectToLoginPage = () => {
    if (isEmployee) {
      var _window5;
      // React Router v6: navigate() instead of history.push()
      navigate("/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.contextPath, "/employee/user/language-selection"));
    } else {
      var _window6;
      navigate("/".concat((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.contextPath, "/citizen/login"));
    }
    closeSidebar();
  };
  if (islinkDataLoading || isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {});
  }
  var menuItems = [{
    id: "login-btn",
    element: "LOGIN",
    text: t("CORE_COMMON_LOGIN"),
    icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_7__.LogoutIcon, {
      className: "icon"
    }),
    populators: {
      onClick: redirectToLoginPage
    }
  }];
  var profileItem;
  if (isFetched && user && user.access_token) {
    profileItem = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Profile, {
      info: user === null || user === void 0 ? void 0 : user.info,
      stateName: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.name,
      t: t
    });
    menuItems = menuItems.filter(item => (item === null || item === void 0 ? void 0 : item.id) !== "login-btn");
  }
  var configEmployeeSideBar = {};
  if (!isEmployee) {
    var _Object$keys;
    (_Object$keys = Object.keys(linkData)) === null || _Object$keys === void 0 || (_Object$keys = _Object$keys.sort((x, y) => y.localeCompare(x))) === null || _Object$keys === void 0 || _Object$keys.map(key => {
      var _linkData$key$, _linkData$key$2, _window7, _linkData$key$3, _linkData$key$4;
      if (((_linkData$key$ = linkData[key][0]) === null || _linkData$key$ === void 0 ? void 0 : _linkData$key$.sidebar) === "digit-ui-links") menuItems.splice(1, 0, {
        type: (_linkData$key$2 = linkData[key][0]) !== null && _linkData$key$2 !== void 0 && (_linkData$key$2 = _linkData$key$2.sidebarURL) !== null && _linkData$key$2 !== void 0 && _linkData$key$2.includes((_window7 = window) === null || _window7 === void 0 ? void 0 : _window7.contextPath) ? "link" : "external-link",
        text: t("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(key))),
        links: linkData[key],
        icon: (_linkData$key$3 = linkData[key][0]) === null || _linkData$key$3 === void 0 ? void 0 : _linkData$key$3.leftIcon,
        link: (_linkData$key$4 = linkData[key][0]) === null || _linkData$key$4 === void 0 ? void 0 : _linkData$key$4.sidebarURL
      });
    });
  } else {
    var _menuItems;
    data === null || data === void 0 || data.actions.filter(e => e.url === "url" && e.displayName !== "Home").forEach(item => {
      var _item$displayName;
      if (search == "" && item.path !== "") {
        var index = item.path.split(".")[0];
        if (index === "TradeLicense") index = "Trade License";
        if (!configEmployeeSideBar[index]) {
          configEmployeeSideBar[index] = [item];
        } else {
          configEmployeeSideBar[index].push(item);
        }
      } else if (item.path !== "" && item !== null && item !== void 0 && (_item$displayName = item.displayName) !== null && _item$displayName !== void 0 && _item$displayName.toLowerCase().includes(search.toLowerCase())) {
        var _index = item.path.split(".")[0];
        if (_index === "TradeLicense") _index = "Trade License";
        if (!configEmployeeSideBar[_index]) {
          configEmployeeSideBar[_index] = [item];
        } else {
          configEmployeeSideBar[_index].push(item);
        }
      }
    });
    var keys = Object.keys(configEmployeeSideBar);
    var _loop = function _loop(i) {
      var _configEmployeeSideBa, _keys$i;
      var getSingleDisplayName = (_configEmployeeSideBa = configEmployeeSideBar[keys[i]][0]) === null || _configEmployeeSideBa === void 0 || (_configEmployeeSideBa = _configEmployeeSideBa.displayName) === null || _configEmployeeSideBa === void 0 || (_configEmployeeSideBa = _configEmployeeSideBa.toUpperCase()) === null || _configEmployeeSideBa === void 0 ? void 0 : _configEmployeeSideBa.replace(/[ -]/g, "_");
      var getParentDisplayName = (_keys$i = keys[i]) === null || _keys$i === void 0 || (_keys$i = _keys$i.toUpperCase()) === null || _keys$i === void 0 ? void 0 : _keys$i.replace(/[ -]/g, "_");
      if (configEmployeeSideBar[keys[i]][0].path.indexOf(".") === -1) {
        var _configEmployeeSideBa2, _configEmployeeSideBa3;
        menuItems.splice(1, 0, {
          type: "link",
          text: t("ACTION_TEST_".concat(getSingleDisplayName)),
          link: (_configEmployeeSideBa2 = configEmployeeSideBar[keys[i]][0]) === null || _configEmployeeSideBa2 === void 0 ? void 0 : _configEmployeeSideBa2.navigationURL,
          icon: (_configEmployeeSideBa3 = configEmployeeSideBar[keys[i]][0]) === null || _configEmployeeSideBa3 === void 0 ? void 0 : _configEmployeeSideBa3.leftIcon,
          populators: {
            onClick: () => {
              var _configEmployeeSideBa4;
              // React Router v6: navigate() instead of history.push()
              navigate((_configEmployeeSideBa4 = configEmployeeSideBar[keys[i]][0]) === null || _configEmployeeSideBa4 === void 0 ? void 0 : _configEmployeeSideBa4.navigationURL);
              closeSidebar();
            }
          }
        });
      } else {
        var _configEmployeeSideBa5, _configEmployeeSideBa6;
        menuItems.splice(1, 0, {
          type: "dynamic",
          moduleName: t("ACTION_TEST_".concat(getParentDisplayName)),
          links: (_configEmployeeSideBa5 = configEmployeeSideBar[keys[i]]) === null || _configEmployeeSideBa5 === void 0 ? void 0 : _configEmployeeSideBa5.map(ob => {
            var _ob$displayName;
            return _objectSpread(_objectSpread({}, ob), {}, {
              displayName: t("ACTION_TEST_".concat(ob === null || ob === void 0 || (_ob$displayName = ob.displayName) === null || _ob$displayName === void 0 || (_ob$displayName = _ob$displayName.toUpperCase()) === null || _ob$displayName === void 0 ? void 0 : _ob$displayName.replace(/[ -]/g, "_")))
            });
          }),
          icon: (_configEmployeeSideBa6 = configEmployeeSideBar[keys[i]][1]) === null || _configEmployeeSideBa6 === void 0 ? void 0 : _configEmployeeSideBa6.leftIcon
        });
      }
    };
    for (var i = 0; i < (keys === null || keys === void 0 ? void 0 : keys.length); i++) {
      _loop(i);
    }
    var indx = menuItems.findIndex(a => a.element === "HOME");
    var home = menuItems.splice(indx, 1);
    var comp = menuItems.findIndex(a => a.element === "LANGUAGE");
    var part = menuItems.splice(comp, ((_menuItems = menuItems) === null || _menuItems === void 0 ? void 0 : _menuItems.length) - comp);
    menuItems.sort((a, b) => {
      var c1 = (a === null || a === void 0 ? void 0 : a.type) === "dynamic" ? a === null || a === void 0 ? void 0 : a.moduleName : a === null || a === void 0 ? void 0 : a.text;
      var c2 = (b === null || b === void 0 ? void 0 : b.type) === "dynamic" ? b === null || b === void 0 ? void 0 : b.moduleName : b === null || b === void 0 ? void 0 : b.text;
      return c1.localeCompare(c2);
    });
    (home === null || home === void 0 ? void 0 : home[0]) && menuItems.splice(0, 0, home[0]);
    menuItems = (part === null || part === void 0 ? void 0 : part.length) > 0 ? menuItems.concat(part) : menuItems;
  }

  /*  URL with openlink wont have sidebar and actions    */
  // React Router v6: location.pathname instead of history.location.pathname
  if (location.pathname.includes("/openlink")) {
    profileItem = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span", {});
    menuItems = menuItems.filter(ele => ele.element === "LANGUAGE");
  }
  menuItems = (_menuItems2 = menuItems) === null || _menuItems2 === void 0 ? void 0 : _menuItems2.map(item => _objectSpread(_objectSpread({}, item), {}, {
    label: (item === null || item === void 0 ? void 0 : item.text) || (item === null || item === void 0 ? void 0 : item.moduleName) || "",
    icon: item !== null && item !== void 0 && item.icon ? item === null || item === void 0 ? void 0 : item.icon : undefined
  }));
  var city = "";
  if (Digit.Utils.getMultiRootTenant()) {
    city = t("TENANT_TENANTS_".concat(tenantId));
  } else {
    var _stringReplaceAll2;
    city = t("TENANT_TENANTS_".concat((_stringReplaceAll2 = stringReplaceAll(Digit.ULBService.getCurrentTenantId(), ".", "_")) === null || _stringReplaceAll2 === void 0 ? void 0 : _stringReplaceAll2.toUpperCase()));
    // city = "TEST";
  }
  var goToHome = () => {
    if (isEmployee) {
      var _window8;
      // React Router v6: navigate() instead of history.push()
      navigate("/".concat((_window8 = window) === null || _window8 === void 0 ? void 0 : _window8.contextPath, "/employee"));
    } else {
      var _window9;
      navigate("/".concat((_window9 = window) === null || _window9 === void 0 ? void 0 : _window9.contextPath, "/citizen"));
    }
  };
  var onItemSelect = _ref5 => {
    var {
      item,
      index,
      parentIndex
    } = _ref5;
    if (item !== null && item !== void 0 && item.navigationURL) {
      handleModuleClick(item === null || item === void 0 ? void 0 : item.navigationURL);
    } else if (item !== null && item !== void 0 && item.link) {
      handleModuleClick(item === null || item === void 0 ? void 0 : item.link);
    } else if ((item === null || item === void 0 ? void 0 : item.type) === "custom") {
      switch (item === null || item === void 0 ? void 0 : item.key) {
        case "home":
          goToHome();
          toggleSidebar();
          break;
        case "editProfile":
          userProfile();
          toggleSidebar();
          break;
        case "language":
          handleChangeLanguage(item);
          toggleSidebar();
          break;
        case "city":
          handleChangeCity(item);
          toggleSidebar();
          break;
      }
    } else {
      return;
    }
  };
  var transformedMenuItems = (_menuItems3 = menuItems) === null || _menuItems3 === void 0 ? void 0 : _menuItems3.map(item => {
    if ((item === null || item === void 0 ? void 0 : item.type) === "dynamic") {
      var _item$links;
      return _objectSpread(_objectSpread({}, item), {}, {
        children: item === null || item === void 0 || (_item$links = item.links) === null || _item$links === void 0 ? void 0 : _item$links.map(link => _objectSpread(_objectSpread({}, link), {}, {
          label: link === null || link === void 0 ? void 0 : link.displayName,
          icon: link === null || link === void 0 ? void 0 : link.leftIcon
        }))
      });
    } else {
      return item;
    }
  });
  var transformedSelectedCityData = selectCityData === null || selectCityData === void 0 ? void 0 : selectCityData.map(city => _objectSpread(_objectSpread({}, city), {}, {
    type: "custom",
    key: "city"
  }));
  var transformedLanguageData = languages === null || languages === void 0 ? void 0 : languages.map(language => _objectSpread(_objectSpread({}, language), {}, {
    type: "custom",
    key: "language",
    icon: "Language"
  }));
  var hamburgerItems = [{
    label: "HOME",
    value: "HOME",
    icon: "Home",
    // children: transformedSelectedCityData?.length>0 ? transformedSelectedCityData : undefined,
    type: "custom",
    key: "home"
  }, {
    label: city,
    value: city,
    children: (transformedSelectedCityData === null || transformedSelectedCityData === void 0 ? void 0 : transformedSelectedCityData.length) > 0 ? transformedSelectedCityData : undefined,
    type: "custom",
    icon: "LocationCity",
    key: "city"
  }, {
    label: t("Language"),
    children: (transformedLanguageData === null || transformedLanguageData === void 0 ? void 0 : transformedLanguageData.length) > 0 ? transformedLanguageData : undefined,
    type: "custom",
    icon: "Language",
    key: "language"
  }, ...(user && user.access_token ? [{
    label: t("EDIT_PROFILE"),
    type: "custom",
    icon: "Edit",
    key: "editProfile"
  }] : []), {
    label: t("Modules"),
    icon: "DriveFileMove",
    children: transformedMenuItems
  }];
  return isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Hamburger, {
    items: hamburgerItems,
    profileName: user === null || user === void 0 || (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.name,
    profileNumber: (user === null || user === void 0 || (_user$info3 = user.info) === null || _user$info3 === void 0 ? void 0 : _user$info3.mobileNumber) || (user === null || user === void 0 || (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.emailId),
    theme: "dark",
    transitionDuration: 0.3,
    styles: {
      marginTop: "64px",
      height: "93%"
    },
    onLogout: onLogout,
    hideUserManuals: true,
    profile: profilePic ? profilePic : undefined,
    isSearchable: true,
    onSelect: _ref6 => {
      var {
        item,
        index,
        parentIndex
      } = _ref6;
      return onItemSelect({
        item,
        index,
        parentIndex
      });
    }
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_StaticCitizenSideBar__WEBPACK_IMPORTED_MODULE_6__["default"], {
    logout: onLogout
  });
};

/***/ }),

/***/ "./src/components/TopBarSideBar/SideBar/CitizenSideNav.js":
/*!****************************************************************!*\
  !*** ./src/components/TopBarSideBar/SideBar/CitizenSideNav.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_responsive__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-responsive */ "./node_modules/react-responsive/dist/esm/index.js");
/* harmony import */ var _Dialog_LogoutDialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Dialog/LogoutDialog */ "./src/components/Dialog/LogoutDialog.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");







var CitizenSideNav = _ref => {
  var _Digit, _user$info, _window6, _window7;
  var {
    linkData,
    islinkDataLoading
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var isMultiRootTenant = Digit.Utils.getMultiRootTenant();
  var tenantId = (_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.ULBService) === null || _Digit === void 0 ? void 0 : _Digit.getStateId();
  var user = Digit.UserService.getUser();
  var isLoggedIn = user && user.access_token && (user === null || user === void 0 || (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.type) === "CITIZEN";
  var [showDialog, setShowDialog] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var handleLogoutSubmit = () => {
    var _window;
    Digit.UserService.logout();
    setShowDialog(false);
    window.location.href = "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/citizen/login");
  };
  var handleLogoutCancel = () => {
    setShowDialog(false);
  };
  var navigateToUrl = url => {
    var _window2;
    if (!url || url === "/") return;
    var isExternal = /^https?:\/\//i.test(url);
    if (isExternal) {
      window.open(url, "_blank", "noopener,noreferrer");
      return;
    }
    if (!url.includes("/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath))) {
      var hostUrl = window.location.origin;
      if (isMultiRootTenant) {
        var _window3;
        var contextPath = ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath) || "sandbox-ui";
        url = url.replace("/".concat(contextPath, "/citizen"), "/".concat(contextPath, "/").concat(tenantId, "/citizen"));
        navigate(url);
      } else {
        var updatedUrl = hostUrl + url;
        try {
          window.location.href = updatedUrl;
        } catch (error) {
          console.warn("Navigation failed, attempting fallback:", error);
          window.location.replace(updatedUrl);
        }
      }
    } else {
      navigate(url);
    }
  };
  var onItemSelect = _ref2 => {
    var {
      item
    } = _ref2;
    if (item !== null && item !== void 0 && item.navigationUrl) {
      navigateToUrl(item.navigationUrl);
    }
  };
  var onBottomItemClick = item => {
    if (item === "Logout") {
      setShowDialog(true);
    }
  };
  var buildItems = () => {
    var _Object$keys;
    var isDigitStudio = window.location.href.includes("digit-studio");
    var items = [];
    var orderCounter = 1;
    if (isLoggedIn) {
      var _window4, _window5;
      items.push({
        label: t("COMMON_BOTTOM_NAVIGATION_HOME"),
        icon: {
          icon: "Home",
          width: "1.5rem",
          height: "1.5rem"
        },
        navigationUrl: "/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/citizen"),
        orderNumber: orderCounter++
      });
      items.push({
        label: t("EDIT_PROFILE"),
        icon: {
          icon: "Edit",
          width: "1.5rem",
          height: "1.5rem"
        },
        navigationUrl: "/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.contextPath, "/citizen/user/profile"),
        orderNumber: orderCounter++
      });
    }
    (_Object$keys = Object.keys(linkData || {})) === null || _Object$keys === void 0 || (_Object$keys = _Object$keys.sort((x, y) => x.localeCompare(y))) === null || _Object$keys === void 0 || _Object$keys.forEach(key => {
      var _moduleEntries$;
      var moduleEntries = linkData[key];
      if (!moduleEntries || moduleEntries.length === 0) return;

      // Check if any entry in this module has a sidebar value ending with "-links"
      var hasSidebarLink = moduleEntries.some(entry => {
        var _entry$sidebar;
        return (_entry$sidebar = entry.sidebar) === null || _entry$sidebar === void 0 ? void 0 : _entry$sidebar.endsWith("-links");
      });
      if (!hasSidebarLink) return;
      var rawIcon = (_moduleEntries$ = moduleEntries[0]) === null || _moduleEntries$ === void 0 ? void 0 : _moduleEntries$.leftIcon;
      var leftIcon = isDigitStudio && (!rawIcon || rawIcon === "TLIcon") ? "Devices" : rawIcon || "ViewModule";

      // Deduplicate entries by name to avoid duplicate children
      var seen = new Set();
      var uniqueEntries = moduleEntries.filter(entry => {
        if (seen.has(entry.name)) return false;
        seen.add(entry.name);
        return true;
      });

      // Build children from all entries (Apply, My Applications, etc.)
      var children = uniqueEntries.map(entry => ({
        label: t(entry.displayName || entry.i18nKey),
        icon: {
          icon: isDigitStudio && (!entry.leftIcon || entry.leftIcon === "TLIcon") ? "Devices" : entry.leftIcon || "ViewModule",
          width: "1.5rem",
          height: "1.5rem"
        },
        navigationUrl: entry.navigationURL || entry.link,
        orderNumber: entry.orderNumber
      }));

      // Sort children by orderNumber
      children.sort((a, b) => {
        var aOrder = a.orderNumber !== undefined ? a.orderNumber : Infinity;
        var bOrder = b.orderNumber !== undefined ? b.orderNumber : Infinity;
        return aOrder - bOrder;
      });
      if (children.length === 1) {
        // Single entry — render as flat item (no parent/child nesting)
        items.push({
          label: t("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(key))),
          icon: {
            icon: leftIcon,
            width: "1.5rem",
            height: "1.5rem"
          },
          navigationUrl: children[0].navigationUrl,
          orderNumber: orderCounter++
        });
      } else {
        // Multiple entries — render as parent with children
        items.push({
          label: t("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(key))),
          icon: {
            icon: leftIcon,
            width: "1.5rem",
            height: "1.5rem"
          },
          children: children,
          orderNumber: orderCounter++
        });
      }
    });
    items.sort((a, b) => {
      var aOrder = a.orderNumber !== undefined ? a.orderNumber : Infinity;
      var bOrder = b.orderNumber !== undefined ? b.orderNumber : Infinity;
      return aOrder - bOrder;
    });
    return items;
  };
  if (islinkDataLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Loader, {});
  }
  var items = buildItems();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_responsive__WEBPACK_IMPORTED_MODULE_4__["default"], {
      minWidth: 768,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.SideNav, {
        items: items,
        hideAccessbilityTools: !isLoggedIn,
        onSelect: onItemSelect,
        theme: ((_window6 = window) === null || _window6 === void 0 || (_window6 = _window6.globalConfigs) === null || _window6 === void 0 ? void 0 : _window6.getConfig("SIDENAV_THEME")) || "light",
        enableSearch: true,
        variant: ((_window7 = window) === null || _window7 === void 0 || (_window7 = _window7.globalConfigs) === null || _window7 === void 0 ? void 0 : _window7.getConfig("SIDENAV_VARIANT")) || "primary",
        transitionDuration: "",
        className: "",
        styles: {
          position: "unset"
        },
        expandedWidth: "",
        collapsedWidth: "",
        onBottomItemClick: onBottomItemClick
      })
    }), showDialog && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Dialog_LogoutDialog__WEBPACK_IMPORTED_MODULE_5__["default"], {
      onSelect: handleLogoutSubmit,
      onCancel: handleLogoutCancel,
      onDismiss: handleLogoutCancel
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CitizenSideNav);

/***/ }),

/***/ "./src/components/TopBarSideBar/SideBar/EmployeeSideBar.js":
/*!*****************************************************************!*\
  !*** ./src/components/TopBarSideBar/SideBar/EmployeeSideBar.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_responsive__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-responsive */ "./node_modules/react-responsive/dist/esm/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");






var EmployeeSideBar = () => {
  var _Digit, _window3, _window4;
  var {
    isLoading,
    data
  } = Digit.Hooks.useAccessControl();
  var isMultiRootTenant = Digit.Utils.getMultiRootTenant();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var tenantId = (_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.ULBService) === null || _Digit === void 0 ? void 0 : _Digit.getStateId();
  function extractLeftIcon() {
    var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    for (var key in data) {
      var item = data[key];
      if (key === "item" && (item === null || item === void 0 ? void 0 : item.leftIcon) !== "") {
        return item === null || item === void 0 ? void 0 : item.leftIcon;
      }
      if (typeof data[key] === "object" && !Array.isArray(data[key])) {
        var subResult = extractLeftIcon(data[key]);
        if (subResult) {
          return subResult;
        }
      }
    }
    return null;
  }
  function mergeObjects(obj1, obj2) {
    for (var key in obj2) {
      if (obj2.hasOwnProperty(key)) {
        if (typeof obj2[key] === "object" && !Array.isArray(obj2[key])) {
          if (!obj1[key]) {
            obj1[key] = {};
          }
          mergeObjects(obj1[key], obj2[key]);
        } else {
          if (!obj1[key]) {
            obj1[key] = obj2[key];
          }
        }
      }
    }
  }
  var configEmployeeSideBar = {};
  data === null || data === void 0 || data.actions.filter(e => e.url === "url").forEach(item => {
    var _item$path;
    var index = (item === null || item === void 0 || (_item$path = item.path) === null || _item$path === void 0 || (_item$path = _item$path.split(".")) === null || _item$path === void 0 ? void 0 : _item$path[0]) || "";
    if ((item === null || item === void 0 ? void 0 : item.path) !== "") {
      var _item$path2;
      var keys = item === null || item === void 0 || (_item$path2 = item.path) === null || _item$path2 === void 0 ? void 0 : _item$path2.split(".");
      var hierarchicalMap = {};
      keys.reduce((acc, key, index) => {
        if (index === keys.length - 1) {
          acc[key] = {
            item
          };
        } else {
          acc[key] = {};
          return acc[key];
        }
      }, hierarchicalMap);
      mergeObjects(configEmployeeSideBar, hierarchicalMap);
    }
  });
  var splitKeyValue = configEmployeeSideBar => {
    var objectArray = Object.entries(configEmployeeSideBar);
    objectArray.sort((a, b) => {
      if (a[0] < b[0]) {
        return -1;
      }
      if (a[0] > b[0]) {
        return 1;
      }
      return 0;
    });
    var sortedObject = Object.fromEntries(objectArray);
    configEmployeeSideBar = sortedObject;
    return configEmployeeSideBar;
  };
  var navigateToRespectiveURL = function navigateToRespectiveURL() {
    var _window;
    var navigate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
    if (!url || url === "/") return;

    //Detect if it's an external link (starts with http or https)
    var isExternal = /^https?:\/\//i.test(url);
    if (isExternal) {
      //Open external links in a new tab
      window.open(url, "_blank", "noopener,noreferrer");
      return;
    }

    //Internal navigation logic
    if (!url.includes("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath))) {
      var hostUrl = window.location.origin;
      var updatedUrl;
      if (isMultiRootTenant) {
        var _window2;
        var contextPath = ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath) || "sandbox-ui";
        url = url.replace("/".concat(contextPath, "/employee"), "/".concat(contextPath, "/").concat(tenantId, "/employee"));
        updatedUrl = url;
        navigate(updatedUrl);
      } else {
        updatedUrl = hostUrl + url;
        try {
          if (typeof window !== 'undefined') {
            window.location.href = updatedUrl;
          }
        } catch (error) {
          console.warn('Navigation failed, attempting fallback:', error);
          try {
            window.location.replace(updatedUrl);
          } catch (fallbackError) {
            console.error('All navigation methods failed:', fallbackError);
          }
        }
      }
    } else {
      navigate(url);
    }
  };
  var onItemSelect = _ref => {
    var {
      item,
      index,
      parentIndex
    } = _ref;
    if (item !== null && item !== void 0 && item.navigationUrl) {
      navigateToRespectiveURL(navigate, item === null || item === void 0 ? void 0 : item.navigationUrl);
    } else {
      return;
    }
  };
  function transformData(data) {
    var transformItem = (key, value) => {
      if (value.item) {
        return {
          label: t(value.item.displayName),
          icon: {
            icon: value.item.leftIcon,
            width: "1.5rem",
            height: "1.5rem"
          },
          navigationUrl: value.item.navigationURL,
          orderNumber: value.item.orderNumber
        };
      }
      var children = Object.keys(value).map(childKey => transformItem(childKey, value[childKey]));
      var iconKey = extractLeftIcon(value);
      return {
        label: t(key),
        icon: {
          icon: iconKey,
          width: "1.5rem",
          height: "1.5rem"
        },
        children: children
      };
    };
    return Object.keys(data).map(key => transformItem(key, data[key]));
  }
  var sortDataByOrderNumber = data => {
    // Sort the current level of data by orderNumber, handling cases where orderNumber might be missing
    data.sort((a, b) => {
      var aOrder = a.orderNumber !== undefined ? a.orderNumber : Infinity; // Use Infinity if orderNumber is missing
      var bOrder = b.orderNumber !== undefined ? b.orderNumber : Infinity; // Use Infinity if orderNumber is missing
      return aOrder - bOrder;
    });

    // Recursively sort the children if they exist
    data.forEach(item => {
      if (item.children && item.children.length > 0) {
        sortDataByOrderNumber(item.children);
      }
    });
    return data;
  };
  var transformedData = transformData(splitKeyValue(configEmployeeSideBar));
  var sortedTransformedData = sortDataByOrderNumber(transformedData);
  if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Loader, {});
  }
  if (!configEmployeeSideBar) {
    return "";
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_responsive__WEBPACK_IMPORTED_MODULE_4__["default"], {
    minWidth: 768,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.SideNav, {
      items: sortedTransformedData,
      hideAccessbilityTools: true,
      onSelect: _ref2 => {
        var {
          item,
          index,
          parentIndex
        } = _ref2;
        return onItemSelect({
          item,
          index,
          parentIndex
        });
      },
      theme: ((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.globalConfigs) === null || _window3 === void 0 ? void 0 : _window3.getConfig("SIDENAV_THEME")) || "dark",
      variant: ((_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.globalConfigs) === null || _window4 === void 0 ? void 0 : _window4.getConfig("SIDENAV_VARIANT")) || "primary",
      transitionDuration: "",
      className: "",
      styles: {},
      expandedWidth: "",
      collapsedWidth: "",
      onBottomItemClick: () => {}
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EmployeeSideBar);

/***/ }),

/***/ "./src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js":
/*!**********************************************************************!*\
  !*** ./src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _config_sidebar_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../config/sidebar-menu */ "./src/config/sidebar-menu.js");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _Dialog_LogoutDialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Dialog/LogoutDialog */ "./src/components/Dialog/LogoutDialog.js");
/* harmony import */ var _ChangeCity__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ChangeCity */ "./src/components/ChangeCity.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ "./src/components/utils.js");
/* harmony import */ var _ImageComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }











/* 
Feature :: Citizen Webview sidebar
*/

var Profile = _ref => {
  var {
    info,
    stateName,
    t
  } = _ref;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
    className: "profile-section",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "imageloader imageloader-loaded",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ImageComponent__WEBPACK_IMPORTED_MODULE_8__["default"], {
        className: "img-responsive img-circle img-Profile",
        src: _utils__WEBPACK_IMPORTED_MODULE_7__.defaultImage,
        alt: "Profile Logo"
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      id: "profile-name",
      className: "label-container name-Profile",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
        className: "label-text",
        children: [" ", info === null || info === void 0 ? void 0 : info.name, " "]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      id: "profile-location",
      className: "label-container loc-Profile",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
        className: "label-text",
        children: [" ", info === null || info === void 0 ? void 0 : info.mobileNumber, " "]
      })
    }), (info === null || info === void 0 ? void 0 : info.emailId) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      id: "profile-emailid",
      className: "label-container loc-Profile",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
        className: "label-text",
        children: [" ", info.emailId, " "]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "profile-divider"
    }), window.location.href.includes("/employee") && !window.location.href.includes("/employee/user/login") && !window.location.href.includes("employee/user/language-selection") && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ChangeCity__WEBPACK_IMPORTED_MODULE_6__["default"], {
      t: t,
      mobileView: true
    })]
  });
};
var IconsObject = {
  CommonPTIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.PTIcon, {
    className: "icon"
  }),
  OBPSIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.OBPSIcon, {
    className: "icon"
  }),
  propertyIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.PropertyHouse, {
    className: "icon"
  }),
  TLIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.CaseIcon, {
    className: "icon"
  }),
  PGRIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.PGRIcon, {
    className: "icon"
  }),
  FSMIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.FSMIcon, {
    className: "icon"
  }),
  WSIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.WSICon, {
    className: "icon"
  }),
  MCollectIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.MCollectIcon, {
    className: "icon"
  }),
  BillsIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.CollectionIcon, {
    className: "icon"
  }),
  BirthIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.BirthIcon, {
    className: "icon"
  }),
  DeathIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.DeathIcon, {
    className: "icon"
  }),
  FirenocIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.FirenocIcon, {
    className: "icon"
  }),
  HomeIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.HomeIcon, {
    className: "icon"
  }),
  EditPencilIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.EditPencilIcon, {
    className: "icon"
  }),
  LogoutIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.LogoutIcon, {
    className: "icon"
  }),
  Phone: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.Phone, {
    className: "icon"
  })
};
var StaticCitizenSideBar = _ref2 => {
  var _user$info, _Object$keys, _menuItems;
  var {
    linkData,
    islinkDataLoading
  } = _ref2;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useNavigate)();
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useLocation)();
  var {
    pathname
  } = location;
  var {
    data: storeData,
    isFetched
  } = Digit.Hooks.useStore.getInitData();
  var {
    stateInfo
  } = storeData || {};
  var user = Digit.UserService.getUser();
  var isMobile = window.Digit.Utils.browser.isMobile();
  var [isEmployee, setisEmployee] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var [isSidebarOpen, toggleSidebar] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var [showDialog, setShowDialog] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var handleLogout = () => {
    toggleSidebar(false);
    setShowDialog(true);
  };
  var handleOnSubmit = () => {
    if (Digit.Utils.getMultiRootTenant()) {
      var _window;
      Digit.UserService.logout();
      setShowDialog(false);
      window.location.href = "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/citizen/login");
    } else {
      Digit.UserService.logout();
      setShowDialog(false);
    }
  };
  var handleOnCancel = () => {
    setShowDialog(false);
  };
  if (islinkDataLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.Loader, {});
  }
  var redirectToLoginPage = () => {
    var _window2;
    navigate("/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/citizen/login"));
  };
  var showProfilePage = () => {
    var _window3;
    navigate("/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/citizen/user/profile"));
  };
  var closeSidebar = () => {
    var _window4;
    navigate("/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/citizen/all-services"));
  };
  var menuItems = [...(0,_config_sidebar_menu__WEBPACK_IMPORTED_MODULE_3__["default"])(t, showProfilePage, redirectToLoginPage, isEmployee)];
  menuItems = menuItems.filter(item => item.element !== "LANGUAGE");
  var tenantId = Digit.ULBService.getCurrentTenantId();
  var MenuItem = _ref3 => {
    var _item$icon;
    var {
      item
    } = _ref3;
    var leftIconArray = (item === null || item === void 0 ? void 0 : item.icon) || ((_item$icon = item.icon) === null || _item$icon === void 0 || (_item$icon = _item$icon.type) === null || _item$icon === void 0 ? void 0 : _item$icon.name);
    var leftIcon = leftIconArray ? IconsObject[leftIconArray] : IconsObject.BillsIcon;
    var itemComponent;
    if (item.type === "component") {
      itemComponent = item.action;
    } else {
      itemComponent = item.text;
    }
    var Item = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("span", _objectSpread(_objectSpread({
      className: "menu-item"
    }, item.populators), {}, {
      children: [leftIcon, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
        className: "menu-label",
        children: itemComponent
      })]
    }));
    if (item.type === "external-link") {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("a", {
        href: item.link,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Item, {})
      });
    }
    if (item.type === "link") {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Link, {
        to: item === null || item === void 0 ? void 0 : item.link,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Item, {})
      });
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Item, {});
  };
  var profileItem;
  if (isFetched && user && user.access_token && (user === null || user === void 0 || (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.type) === "CITIZEN") {
    var _window5, _window6, _storeData$tenants, _storeData$tenants$fi, _storeData$tenants$, _storeData$tenants$fi2, _storeData$tenants$2;
    profileItem = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Profile, {
      info: user === null || user === void 0 ? void 0 : user.info,
      stateName: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.name,
      t: t
    });
    menuItems = menuItems.filter(item => (item === null || item === void 0 ? void 0 : item.id) !== "login-btn");
    menuItems = [...menuItems, {
      type: "link",
      icon: "HomeIcon",
      element: "HOME",
      text: t("COMMON_BOTTOM_NAVIGATION_HOME"),
      link: isEmployee ? "/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.contextPath, "/employee") : "/".concat((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.contextPath, "/citizen"),
      populators: {
        onClick: closeSidebar
      }
    }, {
      text: t("EDIT_PROFILE"),
      element: "PROFILE",
      icon: "EditPencilIcon",
      populators: {
        onClick: showProfilePage
      }
    }, {
      text: t("CORE_COMMON_LOGOUT"),
      element: "LOGOUT",
      icon: "LogoutIcon",
      populators: {
        onClick: handleLogout
      }
    }, {
      text: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
        children: [t("CS_COMMON_HELPLINE"), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
          className: "telephone",
          style: {
            marginTop: "-10%"
          },
          children: (storeData === null || storeData === void 0 || (_storeData$tenants = storeData.tenants) === null || _storeData$tenants === void 0 ? void 0 : _storeData$tenants.length) > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
            className: "link",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("a", {
              href: "tel:".concat(((_storeData$tenants$fi = storeData.tenants.find(tenant => tenant.code === tenantId)) === null || _storeData$tenants$fi === void 0 ? void 0 : _storeData$tenants$fi.contactNumber) || ((_storeData$tenants$ = storeData.tenants[0]) === null || _storeData$tenants$ === void 0 ? void 0 : _storeData$tenants$.contactNumber) || ''),
              children: ((_storeData$tenants$fi2 = storeData.tenants.find(tenant => tenant.code === tenantId)) === null || _storeData$tenants$fi2 === void 0 ? void 0 : _storeData$tenants$fi2.contactNumber) || ((_storeData$tenants$2 = storeData.tenants[0]) === null || _storeData$tenants$2 === void 0 ? void 0 : _storeData$tenants$2.contactNumber) || t("CS_NA")
            })
          })
        })]
      }),
      element: "Helpline",
      icon: "Phone"
    }];
  }
  (_Object$keys = Object.keys(linkData || {})) === null || _Object$keys === void 0 || (_Object$keys = _Object$keys.sort((x, y) => y.localeCompare(x))) === null || _Object$keys === void 0 || _Object$keys.map(key => {
    var _linkData$key$;
    if (((_linkData$key$ = linkData[key][0]) === null || _linkData$key$ === void 0 ? void 0 : _linkData$key$.sidebar) === "".concat(window.contextPath, "-links")) {
      var _linkData$key$2, _window7, _linkData$key$3, _linkData$key$4;
      menuItems.splice(1, 0, {
        type: (_linkData$key$2 = linkData[key][0]) !== null && _linkData$key$2 !== void 0 && (_linkData$key$2 = _linkData$key$2.sidebarURL) !== null && _linkData$key$2 !== void 0 && _linkData$key$2.includes((_window7 = window) === null || _window7 === void 0 ? void 0 : _window7.contextPath) ? "link" : "external-link",
        text: t("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(key))),
        links: linkData[key],
        icon: (_linkData$key$3 = linkData[key][0]) === null || _linkData$key$3 === void 0 ? void 0 : _linkData$key$3.leftIcon,
        link: (_linkData$key$4 = linkData[key][0]) === null || _linkData$key$4 === void 0 ? void 0 : _linkData$key$4.sidebarURL
      });
    }
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
        style: {
          height: "100%",
          width: "100%",
          top: "0px",
          backgroundColor: "rgba(0, 0, 0, 0.54)",
          pointerzevents: "auto"
        }
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
        style: {
          display: "flex",
          flexDirection: "column",
          height: isMobile ? "calc(100vh - 56px)" : "auto",
          zIndex: "99"
        },
        children: [profileItem, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
          className: "drawer-desktop",
          children: (_menuItems = menuItems) === null || _menuItems === void 0 ? void 0 : _menuItems.map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
            className: "sidebar-list ".concat(pathname === (item === null || item === void 0 ? void 0 : item.link) || pathname === (item === null || item === void 0 ? void 0 : item.sidebarURL) ? "active" : ""),
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(MenuItem, {
              item: item
            })
          }, index))
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
        children: showDialog && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_Dialog_LogoutDialog__WEBPACK_IMPORTED_MODULE_5__["default"], {
          onSelect: handleOnSubmit,
          onCancel: handleOnCancel,
          onDismiss: handleOnCancel
        })
      })]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StaticCitizenSideBar);

/***/ }),

/***/ "./src/components/TopBarSideBar/SideBar/index.js":
/*!*******************************************************!*\
  !*** ./src/components/TopBarSideBar/SideBar/index.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _CitizenSideBar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CitizenSideBar */ "./src/components/TopBarSideBar/SideBar/CitizenSideBar.js");
/* harmony import */ var _EmployeeSideBar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EmployeeSideBar */ "./src/components/TopBarSideBar/SideBar/EmployeeSideBar.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var SideBar = _ref => {
  var {
    t,
    CITIZEN,
    isSidebarOpen,
    toggleSidebar,
    handleLogout,
    mobileView,
    userDetails,
    modules,
    linkData,
    islinkDataLoading,
    userProfile
  } = _ref;
  if (CITIZEN) return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_CitizenSideBar__WEBPACK_IMPORTED_MODULE_1__.CitizenSideBar, {
    isOpen: isSidebarOpen,
    isMobile: true,
    toggleSidebar: toggleSidebar,
    onLogout: handleLogout,
    linkData: linkData,
    islinkDataLoading: islinkDataLoading,
    userProfile: userProfile,
    isEmployee: false
  });else {
    return !isSidebarOpen && userDetails !== null && userDetails !== void 0 && userDetails.access_token ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "digit-employeeSidebar",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_EmployeeSideBar__WEBPACK_IMPORTED_MODULE_2__["default"], {
        mobileView,
        userDetails,
        modules
      })
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "digit-citizenSidebar",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_CitizenSideBar__WEBPACK_IMPORTED_MODULE_1__.CitizenSideBar, {
        isOpen: isSidebarOpen,
        isMobile: true,
        toggleSidebar: toggleSidebar,
        onLogout: handleLogout,
        isEmployee: true,
        userProfile: userProfile
      })
    });
  }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SideBar);

/***/ }),

/***/ "./src/components/TopBarSideBar/TopBar.js":
/*!************************************************!*\
  !*** ./src/components/TopBarSideBar/TopBar.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _ChangeCity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ChangeCity */ "./src/components/ChangeCity.js");
/* harmony import */ var _ChangeLanguage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ChangeLanguage */ "./src/components/ChangeLanguage.js");
/* harmony import */ var _ImageComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }









var DEFAULT_EGOV_LOGO = "https://egov-dev-assets.s3.ap-south-1.amazonaws.com/egov-logo-2025.png";
var TopBar = _ref => {
  var _userDetails$info2, _Digit$ComponentRegis, _userDetails$info3, _userDetails$info4, _window4, _cityDetails$city, _cityDetails$city2, _stateInfo$code;
  var {
    t,
    stateInfo,
    toggleSidebar,
    isSidebarOpen,
    handleLogout,
    userDetails,
    CITIZEN,
    cityDetails,
    mobileView,
    userOptions,
    handleUserDropdownSelection,
    logoUrl,
    logoUrlWhite,
    showLanguageChange = true
  } = _ref;
  var [profilePic, setProfilePic] = react__WEBPACK_IMPORTED_MODULE_2___default().useState(null);
  react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
    var app = /*#__PURE__*/function () {
      var _ref2 = _asyncToGenerator(function* () {
        var _userDetails$info;
        var tenant = Digit.Utils.getMultiRootTenant() ? Digit.ULBService.getStateId() : Digit.ULBService.getCurrentTenantId();
        var uuid = userDetails === null || userDetails === void 0 || (_userDetails$info = userDetails.info) === null || _userDetails$info === void 0 ? void 0 : _userDetails$info.uuid;
        if (uuid) {
          var usersResponse = yield Digit.UserService.userSearch(tenant, {
            uuid: [uuid]
          }, {});
          if (usersResponse && usersResponse.user && usersResponse.user.length) {
            var _userDetails$photo;
            var _userDetails = usersResponse.user[0];
            var thumbs = _userDetails === null || _userDetails === void 0 || (_userDetails$photo = _userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
            setProfilePic(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
          }
        }
      });
      return function app() {
        return _ref2.apply(this, arguments);
      };
    }();
    app();
  }, [profilePic !== null, userDetails === null || userDetails === void 0 || (_userDetails$info2 = userDetails.info) === null || _userDetails$info2 === void 0 ? void 0 : _userDetails$info2.uuid]);
  var CitizenHomePageTenantId = Digit.ULBService.getCitizenCurrentTenant(true);
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var {
    pathname
  } = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  var conditionsToDisableNotificationCountTrigger = () => {
    var _Digit$UserService, _Digit$UserService2;
    if (((_Digit$UserService = Digit.UserService) === null || _Digit$UserService === void 0 || (_Digit$UserService = _Digit$UserService.getUser()) === null || _Digit$UserService === void 0 || (_Digit$UserService = _Digit$UserService.info) === null || _Digit$UserService === void 0 ? void 0 : _Digit$UserService.type) === "EMPLOYEE") return false;
    if (((_Digit$UserService2 = Digit.UserService) === null || _Digit$UserService2 === void 0 || (_Digit$UserService2 = _Digit$UserService2.getUser()) === null || _Digit$UserService2 === void 0 || (_Digit$UserService2 = _Digit$UserService2.info) === null || _Digit$UserService2 === void 0 ? void 0 : _Digit$UserService2.type) === "CITIZEN") {
      if (!CitizenHomePageTenantId) return false;else return true;
    }
    return false;
  };
  var {
    data: {
      unreadCount: unreadNotificationCount
    } = {},
    isSuccess: notificationCountLoaded
  } = Digit.Hooks.useNotificationCount({
    tenantId: CitizenHomePageTenantId,
    config: {
      enabled: conditionsToDisableNotificationCountTrigger()
    }
  });
  var updateSidebar = () => {
    if (!Digit.clikOusideFired) {
      toggleSidebar(true);
    } else {
      Digit.clikOusideFired = false;
    }
  };
  function onNotificationIconClick() {
    var _window;
    navigate("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/citizen/engagement/notifications"));
  }
  var urlsToDisableNotificationIcon = pathname => {
    var _Digit$UserService3, _window2, _window3;
    return !!((_Digit$UserService3 = Digit.UserService) !== null && _Digit$UserService3 !== void 0 && (_Digit$UserService3 = _Digit$UserService3.getUser()) !== null && _Digit$UserService3 !== void 0 && _Digit$UserService3.access_token) ? false : ["/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/citizen/select-language"), "/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/citizen/select-location")].includes(pathname);
  };
  if (CITIZEN) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.TopBar, {
        img: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.logoUrlWhite,
        isMobile: true,
        toggleSidebar: updateSidebar,
        logoUrl: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.logoUrlWhite,
        onLogout: handleLogout,
        userDetails: userDetails,
        notificationCount: unreadNotificationCount < 99 ? unreadNotificationCount : 99,
        notificationCountLoaded: notificationCountLoaded,
        cityOfCitizenShownBesideLogo: t(CitizenHomePageTenantId),
        onNotificationIconClick: onNotificationIconClick,
        hideNotificationIconOnSomeUrlsWhenNotLoggedIn: urlsToDisableNotificationIcon(pathname),
        changeLanguage: !mobileView ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ChangeLanguage__WEBPACK_IMPORTED_MODULE_5__["default"], {
          dropdown: true
        }) : null
      })
    });
  }
  var loggedin = userDetails !== null && userDetails !== void 0 && userDetails.access_token ? true : false;

  //checking for custom topbar components
  var CustomEmployeeTopBar = (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("CustomEmployeeTopBar");
  if (CustomEmployeeTopBar) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(CustomEmployeeTopBar, {
      t,
      stateInfo,
      toggleSidebar,
      isSidebarOpen,
      handleLogout,
      userDetails,
      CITIZEN,
      cityDetails,
      mobileView,
      userOptions,
      handleUserDropdownSelection,
      logoUrl,
      showLanguageChange,
      loggedin
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Header, {
    actionFields: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ChangeCity__WEBPACK_IMPORTED_MODULE_4__["default"], {
      dropdown: true,
      t: t
    }), showLanguageChange && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ChangeLanguage__WEBPACK_IMPORTED_MODULE_5__["default"], {
      dropdown: true
    }), (userDetails === null || userDetails === void 0 ? void 0 : userDetails.access_token) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Dropdown, {
      option: userOptions,
      optionKey: "name",
      profilePic: profilePic ? profilePic : (userDetails === null || userDetails === void 0 || (_userDetails$info3 = userDetails.info) === null || _userDetails$info3 === void 0 ? void 0 : _userDetails$info3.name) || (userDetails === null || userDetails === void 0 || (_userDetails$info4 = userDetails.info) === null || _userDetails$info4 === void 0 || (_userDetails$info4 = _userDetails$info4.userInfo) === null || _userDetails$info4 === void 0 ? void 0 : _userDetails$info4.name) || "Employee",
      select: handleUserDropdownSelection,
      showArrow: true,
      menuStyles: {
        marginTop: "1rem"
      },
      theme: "light"
    })],
    onHamburgerClick: () => {
      toggleSidebar();
    },
    className: "digit-employee-header",
    img: logoUrl,
    logoWidth: "64px",
    logoHeight: "48px",
    logo: (loggedin ? cityDetails === null || cityDetails === void 0 ? void 0 : cityDetails.logoId : stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.statelogo) || DEFAULT_EGOV_LOGO,
    onImageClick: () => {},
    onLogoClick: () => {},
    props: {},
    showDeafultImg: true,
    style: {},
    theme: ((_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.globalConfigs) === null || _window4 === void 0 ? void 0 : _window4.getConfig("HEADER_THEME")) || "light",
    ulb: loggedin ? cityDetails !== null && cityDetails !== void 0 && (_cityDetails$city = cityDetails.city) !== null && _cityDetails$city !== void 0 && _cityDetails$city.ulbGrade ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
      children: [t(cityDetails === null || cityDetails === void 0 ? void 0 : cityDetails.i18nKey).toUpperCase(), " ", t("ULBGRADE_".concat(cityDetails === null || cityDetails === void 0 || (_cityDetails$city2 = cityDetails.city) === null || _cityDetails$city2 === void 0 ? void 0 : _cityDetails$city2.ulbGrade.toUpperCase().replace(" ", "_").replace(".", "_"))).toUpperCase()]
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ImageComponent__WEBPACK_IMPORTED_MODULE_6__["default"], {
      className: "state",
      src: logoUrlWhite,
      alt: "State Logo"
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
      children: [t("MYCITY_".concat(stateInfo === null || stateInfo === void 0 || (_stateInfo$code = stateInfo.code) === null || _stateInfo$code === void 0 ? void 0 : _stateInfo$code.toUpperCase(), "_LABEL")), " ", t("MYCITY_STATECODE_LABEL")]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TopBar);

/***/ }),

/***/ "./src/components/TopBarSideBar/index.js":
/*!***********************************************!*\
  !*** ./src/components/TopBarSideBar/index.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _TopBar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopBar */ "./src/components/TopBarSideBar/TopBar.js");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _SideBar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SideBar */ "./src/components/TopBarSideBar/SideBar/index.js");
/* harmony import */ var _Dialog_LogoutDialog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Dialog/LogoutDialog */ "./src/components/Dialog/LogoutDialog.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }






var TopBarSideBar = _ref => {
  var {
    t,
    stateInfo,
    userDetails,
    CITIZEN,
    cityDetails,
    mobileView,
    handleUserDropdownSelection,
    logoUrl,
    logoUrlWhite,
    showSidebar = true,
    showLanguageChange,
    linkData,
    islinkDataLoading
  } = _ref;
  var [isSidebarOpen, toggleSidebar] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useNavigate)();
  var [showDialog, setShowDialog] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var handleLogout = () => {
    toggleSidebar(false);
    setShowDialog(true);
  };
  var clearSSOLogoutMarkers = () => {
    localStorage.removeItem("sso-provider");
    localStorage.removeItem("sso-client-id");
    localStorage.removeItem("sso-tenant-id");
    localStorage.removeItem("sso-authority");
    localStorage.removeItem("sso-logout-url");
    localStorage.removeItem("sso-logout-redirect-param");
  };
  var getSSOPostLogoutRedirectUri = () => {
    var _window;
    return "".concat(window.location.origin, "/").concat(((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath) || "", "/employee");
  };
  var handleSSOLogout = /*#__PURE__*/function () {
    var _ref2 = _asyncToGenerator(function* () {
      var provider = localStorage.getItem("sso-provider");
      var normalizedProvider = provider === null || provider === void 0 ? void 0 : provider.toUpperCase();
      var logoutUrlFromConfig = localStorage.getItem("sso-logout-url");
      var redirectParamName = localStorage.getItem("sso-logout-redirect-param") || "post_logout_redirect_uri";

      // Perform provider-specific cleanup before logout
      if (normalizedProvider === "GOOGLE") {
        var token = localStorage.getItem("google_access_token");
        try {
          var _window$google;
          if ((_window$google = window.google) !== null && _window$google !== void 0 && (_window$google = _window$google.accounts) !== null && _window$google !== void 0 && _window$google.id) {
            window.google.accounts.id.disableAutoSelect();
          }
          if (token) {
            yield fetch("https://oauth2.googleapis.com/revoke?token=".concat(encodeURIComponent(token)), {
              method: "POST",
              headers: {
                "Content-type": "application/x-www-form-urlencoded"
              }
            });
            localStorage.removeItem("google_access_token");
          }
        } catch (error) {
          console.error("Provider cleanup error", error);
        }
      }

      // Generic SSO logout handler
      if (logoutUrlFromConfig) {
        var postLogoutRedirectUri = getSSOPostLogoutRedirectUri();
        clearSSOLogoutMarkers();
        try {
          yield Digit.UserService.logout();
        } finally {
          try {
            var url = new URL(logoutUrlFromConfig);
            url.searchParams.set(redirectParamName, postLogoutRedirectUri);
            window.location.href = url.toString();
          } catch (error) {
            window.location.href = "".concat(logoutUrlFromConfig, "?").concat(redirectParamName, "=").concat(encodeURIComponent(postLogoutRedirectUri));
          }
        }
        return true;
      }
      return false;
    });
    return function handleSSOLogout() {
      return _ref2.apply(this, arguments);
    };
  }();
  var handleOnSubmit = /*#__PURE__*/function () {
    var _ref3 = _asyncToGenerator(function* () {
      var handledBySSO = yield handleSSOLogout();
      if (!handledBySSO) {
        Digit.UserService.logout();
      }
      setShowDialog(false);
    });
    return function handleOnSubmit() {
      return _ref3.apply(this, arguments);
    };
  }();
  var handleOnCancel = () => {
    setShowDialog(false);
  };
  var handleSidebar = () => {
    toggleSidebar(!isSidebarOpen);
  };
  var userProfile = () => {
    var _window2, _window3;
    CITIZEN ? navigate("/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/citizen/user/profile")) : navigate("/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/employee/user/profile"));
  };
  var userOptions = [{
    name: t("EDIT_PROFILE"),
    icon: "Edit",
    func: userProfile
  }, {
    name: t("CORE_COMMON_LOGOUT"),
    icon: "Logout",
    func: handleLogout
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_TopBar__WEBPACK_IMPORTED_MODULE_1__["default"], {
      t: t,
      stateInfo: stateInfo,
      toggleSidebar: handleSidebar,
      isSidebarOpen: isSidebarOpen,
      handleLogout: handleLogout,
      userDetails: userDetails,
      CITIZEN: CITIZEN,
      cityDetails: cityDetails,
      mobileView: mobileView,
      userOptions: userOptions,
      handleUserDropdownSelection: handleUserDropdownSelection,
      logoUrl: logoUrl,
      logoUrlWhite: logoUrlWhite,
      showLanguageChange: showLanguageChange
    }), showDialog && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Dialog_LogoutDialog__WEBPACK_IMPORTED_MODULE_4__["default"], {
      onSelect: handleOnSubmit,
      onCancel: handleOnCancel,
      onDismiss: handleOnCancel
    }), !CITIZEN ? showSidebar && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_SideBar__WEBPACK_IMPORTED_MODULE_3__["default"], {
      t: t,
      CITIZEN: CITIZEN,
      isSidebarOpen: isSidebarOpen,
      toggleSidebar: handleSidebar,
      handleLogout: handleLogout,
      mobileView: mobileView,
      userDetails: userDetails,
      linkData: linkData,
      userProfile: userProfile,
      islinkDataLoading: islinkDataLoading
    }) : CITIZEN ? showSidebar && isSidebarOpen && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_SideBar__WEBPACK_IMPORTED_MODULE_3__["default"], {
      t: t,
      CITIZEN: CITIZEN,
      isSidebarOpen: isSidebarOpen,
      toggleSidebar: handleSidebar,
      handleLogout: handleLogout,
      mobileView: mobileView,
      userDetails: userDetails,
      linkData: linkData,
      userProfile: userProfile,
      islinkDataLoading: islinkDataLoading
    }) : null]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TopBarSideBar);

/***/ }),

/***/ "./src/components/utils.js":
/*!*********************************!*\
  !*** ./src/components/utils.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   defaultImage: () => (/* binding */ defaultImage)
/* harmony export */ });
var defaultImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL" + "/" + "/" + "/" + "/Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf/" + "/a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKs" + "qXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpds" + "Lb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7Xl" + "Xyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37Z" + "B+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl" + "/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje" + "2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAj" + "Y4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegreh" + "A+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6v" + "oO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN" + "2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA" + "3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelv" + "Xntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulq" + "Ue6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7L" + "XZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvn" + "L+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC";

/***/ }),

/***/ "./src/config/sidebar-menu.js":
/*!************************************!*\
  !*** ./src/config/sidebar-menu.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_ChangeLanguage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/ChangeLanguage */ "./src/components/ChangeLanguage.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var SideBarMenu = (t, closeSidebar, redirectToLoginPage, isEmployee) => [{
  type: "component",
  element: "LANGUAGE",
  action: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_components_ChangeLanguage__WEBPACK_IMPORTED_MODULE_2__["default"], {}),
  icon: "LanguageIcon"
}, {
  id: "login-btn",
  element: "LOGIN",
  text: t("CORE_COMMON_LOGIN"),
  icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.LogoutIcon, {
    className: "icon"
  }),
  populators: {
    onClick: redirectToLoginPage
  }
}];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SideBarMenu);

/***/ }),

/***/ "./src/hoc/withAutoFocusMain.js":
/*!**************************************!*\
  !*** ./src/hoc/withAutoFocusMain.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }


var withAutoFocusMain = function withAutoFocusMain(WrappedComponent) {
  var mainSelector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.digit-home-main';
  return function WithAutoFocusWrapper(props) {
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
      var handleFirstTab = e => {
        if (e.key === 'Tab') {
          var main = document.querySelector(mainSelector);
          if (main) {
            main.setAttribute('tabindex', '-1');
            main.style.outline = 'none';
            main.focus();
          }
          window.removeEventListener('keydown', handleFirstTab);
        }
      };
      window.addEventListener('keydown', handleFirstTab);
      return () => window.removeEventListener('keydown', handleFirstTab);
    }, []);
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(WrappedComponent, _objectSpread({}, props));
  };
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (withAutoFocusMain);

/***/ }),

/***/ "./src/hooks/useInterval.js":
/*!**********************************!*\
  !*** ./src/hooks/useInterval.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

function useInterval(callback, delay) {
  var savedCallback = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    savedCallback.current = callback;
  }, [callback]);
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    function tick() {
      savedCallback.current();
    }
    if (delay !== null) {
      var timer = setInterval(tick, delay);
      return () => clearInterval(timer);
    }
  }, [delay]);
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useInterval);

/***/ }),

/***/ "./src/hooks/useLoginConfig.js":
/*!*************************************!*\
  !*** ./src/hooks/useLoginConfig.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useLoginConfig: () => (/* binding */ useLoginConfig)
/* harmony export */ });
var useLoginConfig = stateCode => {
  var moduleName = Digit.Utils.getConfigModuleName();
  return Digit.Hooks.useCommonMDMS(stateCode, moduleName, ["LoginConfig"], {
    select: data => {
      var _data$moduleName;
      return {
        config: data === null || data === void 0 || (_data$moduleName = data[moduleName]) === null || _data$moduleName === void 0 ? void 0 : _data$moduleName.LoginConfig
      };
    },
    retry: false
  });
};

/***/ }),

/***/ "./src/pages/citizen/FAQs/FAQs.js":
/*!****************************************!*\
  !*** ./src/pages/citizen/FAQs/FAQs.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _FaqComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FaqComponent */ "./src/pages/citizen/FAQs/FaqComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");





var FAQsSection = _ref => {
  var _user$info, _data$MdmsRes$common;
  var {
    module
  } = _ref;
  var user = Digit.UserService.getUser();
  var tenantId = (user === null || user === void 0 || (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.tenantId) || Digit.ULBService.getCurrentTenantId();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var SearchImg = () => {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.SearchIconSvg, {
      className: "signature-img"
    });
  };
  var {
    isLoading,
    data
  } = Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId());
  var moduleFaqs = data === null || data === void 0 || (_data$MdmsRes$common = data.MdmsRes["common-masters"]) === null || _data$MdmsRes$common === void 0 || (_data$MdmsRes$common = _data$MdmsRes$common.faqs[0]) === null || _data$MdmsRes$common === void 0 ? void 0 : _data$MdmsRes$common["".concat(module)].faqs;
  if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "faq-page",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackButton, {
        style: {
          marginLeft: "unset"
        }
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        style: {
          marginBottom: "15px"
        },
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.HeaderComponent, {
          styles: {
            marginLeft: "0px",
            paddingTop: "10px",
            fontSize: "32px"
          },
          children: t("FAQ_S")
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "faq-list",
        children: moduleFaqs.map((faq, i) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_FaqComponent__WEBPACK_IMPORTED_MODULE_3__["default"], {
          question: faq.question,
          answer: faq.answer,
          lastIndex: i === (moduleFaqs === null || moduleFaqs === void 0 ? void 0 : moduleFaqs.length) - 1
        }, "faq_" + i))
      })]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FAQsSection);

/***/ }),

/***/ "./src/pages/citizen/FAQs/FaqComponent.js":
/*!************************************************!*\
  !*** ./src/pages/citizen/FAQs/FaqComponent.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-svg-components */ "@egovernments/digit-ui-svg-components");
/* harmony import */ var _egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var FaqComponent = props => {
  var {
    question,
    answer,
    lastIndex
  } = props;
  var [isOpen, toggleOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: "faqs border-none",
    onClick: () => toggleOpen(!isOpen),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: "faq-question",
      style: {
        justifyContent: "space-between",
        display: "flex"
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
        children: t(question)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
        className: isOpen ? "faqicon rotate" : "faqicon",
        style: {
          float: "right"
        },
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_0__.ArrowForward, {})
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "faq-answer",
      style: isOpen ? {
        display: "block"
      } : {
        display: "none"
      },
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
        children: t(answer)
      })
    }), !lastIndex ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "cs-box-border"
    }) : null]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FaqComponent);

/***/ }),

/***/ "./src/pages/citizen/Home/ImageUpload/UploadDrawer.js":
/*!************************************************************!*\
  !*** ./src/pages/citizen/Home/ImageUpload/UploadDrawer.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }




function UploadDrawer(_ref) {
  var {
    setProfilePic,
    closeDrawer,
    userType,
    removeProfilePic,
    showToast
  } = _ref;
  var [uploadedFile, setUploadedFile] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  var [file, setFile] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
  var [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var selectfile = e => setFile(e.target.files[0]);
  var removeimg = () => {
    removeProfilePic();
    closeDrawer();
  };
  var onOverlayBodyClick = () => closeDrawer();
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    _asyncToGenerator(function* () {
      setError(null);
      if (file) {
        if (file.size >= 1000000) {
          showToast("error", t("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
          setError(t("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
        } else {
          try {
            var _response$data;
            var response = yield Digit.UploadServices.Filestorage("".concat(userType, "-profile"), file, Digit.ULBService.getStateId());
            if ((response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.files) === null || _response$data === void 0 ? void 0 : _response$data.length) > 0) {
              var _response$data2;
              var fileStoreId = response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 || (_response$data2 = _response$data2.files[0]) === null || _response$data2 === void 0 ? void 0 : _response$data2.fileStoreId;
              setUploadedFile(fileStoreId);
              setProfilePic(fileStoreId);
            } else {
              showToast("error", t("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"));
              setError(t("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"));
            }
          } catch (err) {
            showToast("error", t("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"));
            // setError(t("PT_FILE_UPLOAD_ERROR"));
          }
        }
      }
    })();
  }, [file]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      style: {
        position: "fixed",
        top: "0",
        left: "0",
        right: "0",
        bottom: "0",
        width: "100%",
        height: "100vh",
        backgroundColor: "rgba(0,0,0,.5)"
        // zIndex: "9998",
      },
      onClick: onOverlayBodyClick
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      style: {
        width: "100%",
        justifyContent: "space-between",
        display: "flex",
        backgroundColor: "white",
        alignItems: "center",
        position: "fixed",
        left: "0",
        right: "0",
        height: "20%",
        bottom: userType === "citizen" ? "2.5rem" : "0",
        zIndex: "1000"
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
        style: {
          display: "flex",
          flex: "1",
          flexDirection: "column",
          width: "100%",
          justifyContent: "center",
          alignItems: "center",
          gap: "8px 0"
        },
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("label", {
          for: "file",
          style: {
            cursor: "pointer"
          },
          children: [" ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.GalleryIcon, {})]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
          style: {
            cursor: "pointer"
          },
          children: " Gallery"
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", {
          type: "file",
          id: "file",
          accept: "image/*, .png, .jpeg, .jpg",
          onChange: selectfile,
          style: {
            display: "none"
          }
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
        style: {
          display: "flex",
          flex: "1",
          width: "100%",
          justifyContent: "center",
          alignItems: "center",
          flexDirection: "column",
          gap: "8px 0"
        },
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("button", {
          onClick: removeimg,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.RemoveIcon, {})
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
          style: {
            cursor: "pointer"
          },
          children: "Remove"
        })]
      })]
    })]
  });
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UploadDrawer);

/***/ }),

/***/ "./src/pages/citizen/Home/IndividualUserProfile.js":
/*!*********************************************************!*\
  !*** ./src/pages/citizen/Home/IndividualUserProfile.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _ImageUpload_UploadDrawer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ImageUpload/UploadDrawer */ "./src/pages/citizen/Home/ImageUpload/UploadDrawer.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _Digit, _Digit$getStateId;
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }








var DEFAULT_TENANT = (_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.ULBService) === null || _Digit === void 0 || (_Digit$getStateId = _Digit.getStateId) === null || _Digit$getStateId === void 0 ? void 0 : _Digit$getStateId.call(_Digit);
var defaultImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL" + "/" + "/" + "/" + "/Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf/" + "/a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKs" + "qXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpds" + "Lb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7Xl" + "Xyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37Z" + "B+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl" + "/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje" + "2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAj" + "Y4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegreh" + "A+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6v" + "oO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN" + "2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA" + "3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelv" + "Xntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulq" + "Ue6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7L" + "XZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvn" + "L+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC";
var defaultValidationConfig = {
  tenantId: "".concat(DEFAULT_TENANT),
  UserProfileValidationConfig: [{
    name: "/^[a-zA-Z ]+$/i",
    mobileNumber: "/^[6-9]{1}[0-9]{9}$/",
    password: "/^([a-zA-Z0-9@#$%]{8,15})$/i"
  }]
};
var IndividualUserProfile = _ref => {
  var _Digit$UserService$ge, _window, _window2, _window3, _window4, _mdmsValidationData$U2, _defaultValidationCon, _errors$userName, _errors$emailAddress, _mdmsValidationData$U3, _defaultValidationCon2, _errors$userName2, _mdmsValidationData$U4, _defaultValidationCon3, _errors$mobileNumber, _errors$emailAddress2, _mdmsValidationData$U5, _defaultValidationCon4, _errors$currentPasswo, _mdmsValidationData$U6, _defaultValidationCon5, _errors$newPassword, _mdmsValidationData$U7, _defaultValidationCon6, _errors$confirmPasswo;
  var {
    stateCode,
    userType,
    cityDetails
  } = _ref;
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useNavigate)();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  var url = window.location.href;
  var stateId = Digit.ULBService.getStateId();
  var tenant = Digit.ULBService.getCurrentTenantId();
  var userInfo = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
  var [userDetails, setUserDetails] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var [name, setName] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userInfo !== null && userInfo !== void 0 && userInfo.name ? userInfo.name : "");
  var [email, setEmail] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userInfo !== null && userInfo !== void 0 && userInfo.emailId ? userInfo.emailId : "");
  var [gender, setGender] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender);
  var [city, setCity] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userInfo !== null && userInfo !== void 0 && userInfo.permanentCity ? userInfo.permanentCity : cityDetails.name);
  var [mobileNumber, setMobileNo] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userInfo !== null && userInfo !== void 0 && userInfo.mobileNumber ? userInfo.mobileNumber : "");
  var [profilePic, setProfilePic] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var [profileImg, setProfileImg] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
  var [openUploadSlide, setOpenUploadSide] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var [changepassword, setChangepassword] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var [currentPassword, setCurrentPassword] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
  var [newPassword, setNewPassword] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
  var [confirmPassword, setConfirmPassword] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
  var [toast, setToast] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var [windowWidth, setWindowWidth] = react__WEBPACK_IMPORTED_MODULE_2___default().useState(window.innerWidth);
  var [errors, setErrors] = react__WEBPACK_IMPORTED_MODULE_2___default().useState({});
  var isMobile = window.Digit.Utils.browser.isMobile();
  var isMultiRootTenant = Digit.Utils.getMultiRootTenant();
  var individualServicePath = (_window = window) === null || _window === void 0 || (_window = _window.globalConfigs) === null || _window === void 0 ? void 0 : _window.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");
  // const useAnIndividual = window?.globalConfigs?.getConfig("USE_INDIVIDUAL_MODEL"); // Handled in parent

  var mapConfigToRegExp = config => {
    var _config$UserProfileVa;
    return (config === null || config === void 0 || (_config$UserProfileVa = config.UserProfileValidationConfig) === null || _config$UserProfileVa === void 0 ? void 0 : _config$UserProfileVa[0]) && Object.entries(config === null || config === void 0 ? void 0 : config.UserProfileValidationConfig[0]).reduce((acc, _ref2) => {
      var [key, value] = _ref2;
      if (typeof value === "string") {
        try {
          // Checking if value looks like a regex (starts with "/" and ends with "/flags")
          if (value.startsWith("/") && value.lastIndexOf("/") > 0) {
            var lastSlashIndex = value.lastIndexOf("/");
            var pattern = value.slice(1, lastSlashIndex); // Extracting regex pattern
            var flags = value.slice(lastSlashIndex + 1); // Extracting regex flags

            acc[key] = new RegExp(pattern, flags); // Converting properly
          } else {
            acc[key] = new RegExp(value); // Treating it as a normal regex pattern (no flags)
          }
        } catch (error) {
          console.error("Error parsing regex for key \"".concat(key, "\":"), error);
          acc[key] = value; // Keeping as string if invalid regex
        }
      } else {
        acc[key] = value; // Keeping non-string values as it is
      }
      return acc;
    }, {});
  };
  var [validationConfig, setValidationConfig] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(mapConfigToRegExp(defaultValidationConfig) || {});
  var {
    data: mdmsValidationData,
    isValidationConfigLoading
  } = Digit.Hooks.useCustomMDMS(stateCode, "commonUiConfig", [{
    name: "UserProfileValidationConfig"
  }], {
    select: data => {
      return data === null || data === void 0 ? void 0 : data.commonUiConfig;
    }
  });
  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    var _mdmsValidationData$U;
    if (mdmsValidationData && mdmsValidationData !== null && mdmsValidationData !== void 0 && (_mdmsValidationData$U = mdmsValidationData.UserProfileValidationConfig) !== null && _mdmsValidationData$U !== void 0 && _mdmsValidationData$U[0]) {
      var updatedValidationConfig = mapConfigToRegExp(mdmsValidationData);
      setValidationConfig(updatedValidationConfig);
    }
  }, [mdmsValidationData]);
  var getUserInfo = /*#__PURE__*/function () {
    var _ref3 = _asyncToGenerator(function* () {
      var uuid = userInfo === null || userInfo === void 0 ? void 0 : userInfo.uuid;
      if (uuid) {
        var _response$Individual;
        // New API using health-individual
        var response = yield Digit.CustomService.getResponse({
          url: "".concat(individualServicePath, "/v1/_search"),
          useCache: false,
          method: "POST",
          userService: true,
          params: {
            limit: 1000,
            offset: 0,
            tenantId: tenant
          },
          body: {
            Individual: {
              userUuid: [uuid],
              tenantId: tenant
            }
          }
        });
        if (response !== null && response !== void 0 && (_response$Individual = response.Individual) !== null && _response$Individual !== void 0 && _response$Individual.length) {
          setUserDetails(response.Individual[0]);
        }
      }
    });
    return function getUserInfo() {
      return _ref3.apply(this, arguments);
    };
  }();
  react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
    window.addEventListener("resize", () => setWindowWidth(window.innerWidth));
    return () => {
      window.removeEventListener("resize", () => setWindowWidth(window.innerWidth));
    };
  });
  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    var _userDetails$photo;
    setLoading(true);
    getUserInfo();
    setGender({
      i18nKey: undefined,
      code: userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender,
      value: userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender
    });
    var thumbs = userDetails === null || userDetails === void 0 || (_userDetails$photo = userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
    setProfileImg(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
    setLoading(false);
  }, [userDetails !== null]);
  var validation = {};
  var editScreen = false; // To-do: Deubug and make me dynamic or remove if not needed
  var onClickAddPic = () => setOpenUploadSide(!openUploadSlide);
  var TogleforPassword = () => setChangepassword(!changepassword);
  var setGenderName = value => setGender(value);
  var closeFileUploadDrawer = () => setOpenUploadSide(false);
  var setUserName = value => {
    var _validationConfig$nam;
    setName(value);
    if (!(validationConfig !== null && validationConfig !== void 0 && (_validationConfig$nam = validationConfig.name) !== null && _validationConfig$nam !== void 0 && _validationConfig$nam.test(value)) || value.length === 0 || value.length > 50) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        userName: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_NAME_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        userName: null
      }));
    }
  };
  var setUserEmailAddress = value => {
    if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.userName) !== value) {
      setEmail(value);
      if (value.length && !(value.includes("@") && value.includes("."))) {
        setErrors(_objectSpread(_objectSpread({}, errors), {}, {
          emailAddress: {
            type: "pattern",
            message: "CORE_COMMON_PROFILE_EMAIL_INVALID"
          }
        }));
      } else {
        setErrors(_objectSpread(_objectSpread({}, errors), {}, {
          emailAddress: null
        }));
      }
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        emailAddress: null
      }));
    }
  };
  var setUserMobileNumber = value => {
    var _validationConfig$mob;
    setMobileNo(value);
    if (userType === "employee" && !(validationConfig !== null && validationConfig !== void 0 && (_validationConfig$mob = validationConfig.mobileNumber) !== null && _validationConfig$mob !== void 0 && _validationConfig$mob.test(value))) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        mobileNumber: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        mobileNumber: null
      }));
    }
  };
  var setUserCurrentPassword = value => {
    if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(value))) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        currentPassword: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        currentPassword: null
      }));
    }
  };
  var setUserNewPassword = value => {
    setNewPassword(value);
    if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(value))) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        newPassword: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        newPassword: null
      }));
    }
  };
  var setUserConfirmPassword = value => {
    setConfirmPassword(value);
    if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(value))) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        confirmPassword: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        confirmPassword: null
      }));
    }
  };
  var removeProfilePic = () => {
    setProfilePic(null);
    setProfileImg(null);
  };
  var showToast = function showToast(type, message) {
    var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5000;
    setToast({
      key: type,
      action: message
    });
    setTimeout(() => {
      setToast(null);
    }, duration);
  };
  var updateProfile = /*#__PURE__*/function () {
    var _ref4 = _asyncToGenerator(function* () {
      setLoading(true);
      try {
        var _userDetails$name, _userDetails$name2, _responseInfo;
        if (name) {
          setName(prev => prev.trim());
        }
        if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.name.test(name)) || name === "" || name.length > 50 || name.length < 1) {
          throw JSON.stringify({
            type: "error",
            message: t("CORE_COMMON_PROFILE_NAME_INVALID")
          });
        }
        if (userType === "employee" && !(validationConfig !== null && validationConfig !== void 0 && validationConfig.mobileNumber.test(mobileNumber))) {
          throw JSON.stringify({
            type: "error",
            message: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")
          });
        }
        if (email.length && !(email.includes("@") && email.includes("."))) {
          throw JSON.stringify({
            type: "error",
            message: t("CORE_COMMON_PROFILE_EMAIL_INVALID")
          });
        }
        var trimmedCurrentPassword = currentPassword.trim();
        var trimmedNewPassword = newPassword.trim();
        var trimmedConfirmPassword = confirmPassword.trim();
        setCurrentPassword(trimmedCurrentPassword);
        setNewPassword(trimmedNewPassword);
        setConfirmPassword(trimmedConfirmPassword);
        if (changepassword && trimmedCurrentPassword && trimmedNewPassword && trimmedConfirmPassword) {
          if (trimmedNewPassword !== trimmedConfirmPassword) {
            throw JSON.stringify({
              type: "error",
              message: t("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")
            });
          }
          if (!(trimmedCurrentPassword.length && trimmedNewPassword.length && trimmedConfirmPassword.length)) {
            throw JSON.stringify({
              type: "error",
              message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID")
            });
          }
          if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(trimmedNewPassword)) && !(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(trimmedConfirmPassword))) {
            throw JSON.stringify({
              type: "error",
              message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID")
            });
          }
        }
        var responseInfo;

        // Build Individual object dynamically
        var individualPayload = _objectSpread(_objectSpread({}, userDetails), {}, {
          tenantId: tenant,
          name: {
            givenName: name.trim(),
            familyName: userDetails === null || userDetails === void 0 || (_userDetails$name = userDetails.name) === null || _userDetails$name === void 0 ? void 0 : _userDetails$name.familyName,
            otherNames: userDetails === null || userDetails === void 0 || (_userDetails$name2 = userDetails.name) === null || _userDetails$name2 === void 0 ? void 0 : _userDetails$name2.otherNames
          },
          mobileNumber: mobileNumber,
          isDeleted: false,
          isSystemUser: true,
          isSystemUserActive: true
        });

        // Only add optional fields if they have values
        if (gender !== null && gender !== void 0 && gender.value) {
          individualPayload.gender = gender.value;
        }
        if (email) {
          individualPayload.email = email;
        }
        if (profilePic) {
          individualPayload.photo = profilePic;
        }
        var response = yield Digit.CustomService.getResponse({
          url: "".concat(individualServicePath, "/v1/_update"),
          useCache: false,
          method: "POST",
          userService: true,
          body: {
            Individual: individualPayload
          }
        });
        responseInfo = response === null || response === void 0 ? void 0 : response.responseInfo;
        if (responseInfo && responseInfo.status === "200") {
          var user = Digit.UserService.getUser();
          if (user) {
            Digit.UserService.setUser(_objectSpread(_objectSpread({}, user), {}, {
              info: _objectSpread(_objectSpread({}, user.info), {}, {
                name,
                mobileNumber,
                emailId: email,
                permanentCity: city
              })
            }));
          }
        }
        if (currentPassword.length && newPassword.length && confirmPassword.length) {
          var requestData = {
            existingPassword: currentPassword,
            newPassword: newPassword,
            tenantId: tenant,
            type: "EMPLOYEE",
            username: userInfo === null || userInfo === void 0 ? void 0 : userInfo.userName,
            confirmPassword: confirmPassword
          };
          if (newPassword === confirmPassword) {
            try {
              var res = yield Digit.UserService.changePassword(requestData, tenant);
              var {
                responseInfo: changePasswordResponseInfo
              } = res;
              if (changePasswordResponseInfo !== null && changePasswordResponseInfo !== void 0 && changePasswordResponseInfo.status && changePasswordResponseInfo.status === "200") {
                showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"), 5000);
                setTimeout(() => Digit.UserService.logout(), 2000);
              } else {
                throw "";
              }
            } catch (error) {
              var _error$Errors;
              throw JSON.stringify({
                type: "error",
                message: (_error$Errors = error.Errors) !== null && _error$Errors !== void 0 && (_error$Errors = _error$Errors.at(0)) !== null && _error$Errors !== void 0 && _error$Errors.description ? error.Errors.at(0).description : "CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"
              });
            }
          } else {
            throw JSON.stringify({
              type: "error",
              message: "CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"
            });
          }
        } else if ((_responseInfo = responseInfo) !== null && _responseInfo !== void 0 && _responseInfo.status && responseInfo.status === "200") {
          showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS"), 5000);
        }
      } catch (error) {
        var errorObj;
        try {
          errorObj = JSON.parse(error);
        } catch (e) {
          var _error$response;
          errorObj = {
            type: "error",
            message: (error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 || (_error$response = _error$response.data) === null || _error$response === void 0 || (_error$response = _error$response.Errors) === null || _error$response === void 0 || (_error$response = _error$response[0]) === null || _error$response === void 0 ? void 0 : _error$response.description) || "CORE_COMMON_PROFILE_UPDATE_ERROR"
          };
        }
        showToast(errorObj.type, t(errorObj.message), 5000);
      }
      setLoading(false);
    });
    return function updateProfile() {
      return _ref4.apply(this, arguments);
    };
  }();
  var menu = [];
  var {
    data: Menu
  } = Digit.Hooks.useGenderMDMS(stateId, "common-masters", "GenderType");
  Menu && Menu.map(genderDetails => {
    menu.push({
      i18nKey: "PT_COMMON_GENDER_".concat(genderDetails.code),
      code: "".concat(genderDetails.code),
      value: "".concat(genderDetails.code)
    });
  });
  var setFileStoreId = /*#__PURE__*/function () {
    var _ref5 = _asyncToGenerator(function* (fileStoreId) {
      setProfilePic(fileStoreId);
      var thumbnails = fileStoreId ? yield getThumbnails([fileStoreId], stateId) : null;
      setProfileImg(thumbnails === null || thumbnails === void 0 ? void 0 : thumbnails.thumbs[0]);
      closeFileUploadDrawer();
    });
    return function setFileStoreId(_x) {
      return _ref5.apply(this, arguments);
    };
  }();
  var getThumbnails = /*#__PURE__*/function () {
    var _ref6 = _asyncToGenerator(function* (ids, tenantId) {
      var res = yield Digit.UploadServices.Filefetch(ids, tenantId);
      if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) {
        return {
          thumbs: res.data.fileStoreIds.map(o => o.url.split(",")[3]),
          images: res.data.fileStoreIds.map(o => Digit.Utils.getFileUrl(o.url))
        };
      } else {
        return null;
      }
    });
    return function getThumbnails(_x2, _x3) {
      return _ref6.apply(this, arguments);
    };
  }();
  if (loading || isValidationConfigLoading) return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {});

  // ... (RENDER JSX FROM NEW FILE) ...
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
    className: "user-profile ".concat(userType === "citizen" ? "citizen" : "employee"),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("section", {
      style: {
        margin: userType === "citizen" || isMobile ? "8px" : "0px"
      },
      children: userType === "citizen" || isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackLink, {
        onClick: () => navigate(-1)
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BreadCrumb, {
        style: {
          marginTop: "0rem",
          marginBottom: "1.5rem"
        },
        crumbs: [{
          internalLink: isMultiRootTenant ? "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/employee/sandbox/landing") : "/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/employee"),
          content: t("ES_COMMON_HOME"),
          show: true
        }, {
          internalLink: "/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/employee/user/profile"),
          content: t("ES_COMMON_PAGE_1"),
          show: url.includes("/user/profile")
        }]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
      style: {
        display: "flex",
        flex: 1,
        flexDirection: windowWidth < 768 || userType === "citizen" ? "column" : "row",
        margin: userType === "citizen" ? "8px" : "0px",
        gap: userType === "citizen" ? "" : "0 24px",
        boxShadow: userType === "citizen" ? "1px 1px 4px 0px rgba(0,0,0,0.2)" : "",
        background: userType === "citizen" ? "white" : "",
        borderRadius: userType === "citizen" ? "4px" : "",
        maxWidth: userType === "citizen" ? "960px" : ""
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("section", {
        style: {
          position: "relative",
          display: "flex",
          flex: userType === "citizen" ? 1 : 2.5,
          justifyContent: "center",
          alignItems: "center",
          maxWidth: "100%",
          // height: "376px",
          borderRadius: "4px",
          boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)",
          border: "".concat(userType === "citizen" ? "8px" : "24px", " solid #fff"),
          background: "#EEEEEE",
          padding: userType === "citizen" ? "8px" : "16px"
        },
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
          style: {
            position: "relative",
            height: userType === "citizen" ? "114px" : "150px",
            width: userType === "citizen" ? "114px" : "150px",
            margin: "16px"
          },
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__["default"], {
            style: {
              margin: "auto",
              borderRadius: "300px",
              justifyContent: "center",
              height: "100%",
              width: "100%"
            },
            src: !profileImg || profileImg === "" ? defaultImage : profileImg,
            alt: "Profile Image"
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("button", {
            style: {
              position: "absolute",
              left: "50%",
              bottom: "-24px",
              transform: "translateX(-50%)"
            },
            onClick: onClickAddPic,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.CameraIcon, {})
          })]
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("section", {
        style: {
          display: "flex",
          flexDirection: "column",
          flex: userType === "citizen" ? 1 : 7.5,
          width: "100%",
          borderRadius: "4px",
          height: "fit-content",
          boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)",
          background: "white",
          padding: userType === "citizen" ? "8px" : "24px",
          paddingBottom: "20px"
        },
        children: userType === "citizen" ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "user-profile",
              style: editScreen ? {
                color: "#B1B4B6"
              } : {},
              children: ["".concat(t("CORE_COMMON_PROFILE_NAME")), "*"]
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              style: {
                width: "100%",
                maxWidth: "960px"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, _objectSpread(_objectSpread({
                t: t,
                style: {
                  width: "100%"
                },
                type: "text",
                isMandatory: false,
                name: "name",
                value: name,
                onChange: e => setUserName(e.target.value)
              }, validation = {
                isRequired: true,
                pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U2 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U2 === void 0 || (_mdmsValidationData$U2 = _mdmsValidationData$U2[0]) === null || _mdmsValidationData$U2 === void 0 ? void 0 : _mdmsValidationData$U2.name) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon === void 0 || (_defaultValidationCon = _defaultValidationCon[0]) === null || _defaultValidationCon === void 0 ? void 0 : _defaultValidationCon.name),
                type: "tel",
                title: t("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")
              }), {}, {
                disable: editScreen
              })), (errors === null || errors === void 0 ? void 0 : errors.userName) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$userName = errors.userName) === null || _errors$userName === void 0 ? void 0 : _errors$userName.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "user-profile",
              style: editScreen ? {
                color: "#B1B4B6"
              } : {},
              children: "".concat(t("CORE_COMMON_PROFILE_GENDER"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Dropdown, {
              style: {
                width: "100%",
                fontSize: "1rem"
              },
              className: "form-field profileDropdown",
              selected: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 ? gender[0] : gender,
              disable: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 || editScreen,
              option: menu,
              select: setGenderName,
              value: gender,
              optionKey: "code",
              t: t,
              name: "gender"
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "user-profile",
              style: editScreen ? {
                color: "#B1B4B6"
              } : {},
              children: "".concat(t("CORE_COMMON_PROFILE_EMAIL"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                t: t,
                style: {
                  width: "100%"
                },
                type: "email",
                isMandatory: false,
                optionKey: "i18nKey",
                name: "email",
                value: email,
                onChange: e => setUserEmailAddress(e.target.value),
                disabled: editScreen
              }), (errors === null || errors === void 0 ? void 0 : errors.emailAddress) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$emailAddress = errors.emailAddress) === null || _errors$emailAddress === void 0 ? void 0 : _errors$emailAddress.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("button", {
            onClick: updateProfile,
            style: {
              marginTop: "24px",
              backgroundColor: "#c84c0e",
              width: "100%",
              height: "40px",
              color: "white",
              maxWidth: isMobile ? "100%" : "240px",
              borderBottom: "1px solid black"
            },
            children: t("CORE_COMMON_SAVE")
          })]
        }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: editScreen ? {
                color: "#B1B4B6",
                width: "300px"
              } : {
                width: "300px"
              },
              children: ["".concat(t("CORE_COMMON_PROFILE_NAME")), "*"]
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, _objectSpread(_objectSpread({
                t: t,
                type: "text",
                isMandatory: false,
                name: "name",
                value: name,
                onChange: e => setUserName(e.target.value),
                placeholder: "Enter Your Name"
              }, validation = {
                isRequired: true,
                pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U3 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U3 === void 0 || (_mdmsValidationData$U3 = _mdmsValidationData$U3[0]) === null || _mdmsValidationData$U3 === void 0 ? void 0 : _mdmsValidationData$U3.name) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon2 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon2 === void 0 || (_defaultValidationCon2 = _defaultValidationCon2[0]) === null || _defaultValidationCon2 === void 0 ? void 0 : _defaultValidationCon2.name),
                type: "text",
                title: t("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")
              }), {}, {
                disabled: editScreen
              })), (errors === null || errors === void 0 ? void 0 : errors.userName) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$userName2 = errors.userName) === null || _errors$userName2 === void 0 ? void 0 : _errors$userName2.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: editScreen ? {
                color: "#B1B4B6",
                width: "300px"
              } : {
                width: "300px"
              },
              children: "".concat(t("CORE_COMMON_PROFILE_GENDER"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
              style: {
                width: "100%"
              },
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Dropdown, {
                className: "profileDropdown",
                selected: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 ? gender[0] : gender,
                disable: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 || editScreen,
                option: menu,
                select: setGenderName,
                value: gender,
                optionKey: "code",
                t: t,
                name: "gender"
              })
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: editScreen ? {
                color: "#B1B4B6",
                width: "300px"
              } : {
                width: "300px"
              },
              children: "".concat(t("CORE_COMMON_PROFILE_CITY"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, _objectSpread(_objectSpread({
                t: t,
                type: "text",
                isMandatory: false,
                name: "city",
                value: t(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_".concat(tenant))),
                onChange: e => setCity(e.target.value),
                placeholder: "Enter Your City Name"
              }, validation = {
                isRequired: true,
                // pattern: "^[a-zA-Z-.`' ]*$",
                type: "text",
                title: t("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")
              }), {}, {
                disabled: true
              })), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {})]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: {
                width: "300px"
              },
              children: "".concat(t("CORE_COMMON_PROFILE_MOBILE_NUMBER"), "*")
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.MobileNumber, {
                value: mobileNumber,
                style: {
                  width: "100%"
                },
                name: "mobileNumber",
                placeholder: "Enter a valid Mobile No.",
                onChange: value => setUserMobileNumber(value),
                disable: Digit.Utils.getMultiRootTenant() ? false : true,
                required: true,
                pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U4 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U4 === void 0 || (_mdmsValidationData$U4 = _mdmsValidationData$U4[0]) === null || _mdmsValidationData$U4 === void 0 ? void 0 : _mdmsValidationData$U4.mobileNumber) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon3 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon3 === void 0 || (_defaultValidationCon3 = _defaultValidationCon3[0]) === null || _defaultValidationCon3 === void 0 ? void 0 : _defaultValidationCon3.mobileNumber),
                type: "tel",
                title: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")
              }), (errors === null || errors === void 0 ? void 0 : errors.mobileNumber) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$mobileNumber = errors.mobileNumber) === null || _errors$mobileNumber === void 0 ? void 0 : _errors$mobileNumber.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: editScreen ? {
                color: "#B1B4B6",
                width: "300px"
              } : {
                width: "300px"
              },
              children: "".concat(t("CORE_COMMON_PROFILE_EMAIL"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                t: t,
                type: "email",
                isMandatory: false,
                placeholder: t("EMAIL_VALIDATION"),
                optionKey: "i18nKey",
                name: "email",
                value: email,
                onChange: e => setUserEmailAddress(e.target.value),
                disabled: Digit.Utils.getMultiRootTenant() ? true : editScreen
              }), (errors === null || errors === void 0 ? void 0 : errors.emailAddress) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$emailAddress2 = errors.emailAddress) === null || _errors$emailAddress2 === void 0 ? void 0 : _errors$emailAddress2.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [changepassword == false && !Digit.Utils.getOTPBasedLogin() ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
                label: t("CORE_COMMON_CHANGE_PASSWORD"),
                variation: "teritiary",
                onClick: TogleforPassword,
                style: {
                  paddingLeft: "20rem"
                }
              }) : null, changepassword ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
                style: {
                  marginTop: "10px"
                },
                children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
                  style: {
                    display: "flex"
                  },
                  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
                    className: "profile-label-margin",
                    style: editScreen ? {
                      color: "#B1B4B6",
                      width: "300px"
                    } : {
                      width: "300px"
                    },
                    children: "".concat(t("CORE_COMMON_PROFILE_CURRENT_PASSWORD"))
                  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
                    style: {
                      width: "100%"
                    },
                    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                      t: t,
                      type: "password",
                      isMandatory: false,
                      name: "name",
                      pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U5 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U5 === void 0 || (_mdmsValidationData$U5 = _mdmsValidationData$U5[0]) === null || _mdmsValidationData$U5 === void 0 ? void 0 : _mdmsValidationData$U5.password) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon4 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon4 === void 0 || (_defaultValidationCon4 = _defaultValidationCon4[0]) === null || _defaultValidationCon4 === void 0 ? void 0 : _defaultValidationCon4.password),
                      onChange: e => {
                        var _e$target;
                        return setUserCurrentPassword(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
                      },
                      disabled: editScreen
                    }), (errors === null || errors === void 0 ? void 0 : errors.currentPassword) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                      message: t(errors === null || errors === void 0 || (_errors$currentPasswo = errors.currentPassword) === null || _errors$currentPasswo === void 0 ? void 0 : _errors$currentPasswo.message),
                      truncateMessage: true,
                      maxLength: 256,
                      className: "",
                      wrapperClassName: "",
                      showIcon: true
                    })]
                  })]
                }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
                  style: {
                    display: "flex"
                  },
                  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
                    className: "profile-label-margin",
                    style: editScreen ? {
                      color: "#B1B4B6",
                      width: "300px"
                    } : {
                      width: "300px"
                    },
                    children: "".concat(t("CORE_COMMON_PROFILE_NEW_PASSWORD"))
                  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
                    style: {
                      width: "100%"
                    },
                    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                      t: t,
                      type: "password",
                      isMandatory: false,
                      name: "name",
                      pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U6 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U6 === void 0 || (_mdmsValidationData$U6 = _mdmsValidationData$U6[0]) === null || _mdmsValidationData$U6 === void 0 ? void 0 : _mdmsValidationData$U6.password) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon5 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon5 === void 0 || (_defaultValidationCon5 = _defaultValidationCon5[0]) === null || _defaultValidationCon5 === void 0 ? void 0 : _defaultValidationCon5.password),
                      onChange: e => {
                        var _e$target2;
                        return setUserNewPassword(e === null || e === void 0 || (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.value);
                      },
                      disabled: editScreen
                    }), (errors === null || errors === void 0 ? void 0 : errors.newPassword) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                      message: t(errors === null || errors === void 0 || (_errors$newPassword = errors.newPassword) === null || _errors$newPassword === void 0 ? void 0 : _errors$newPassword.message),
                      truncateMessage: true,
                      maxLength: 256,
                      className: "",
                      wrapperClassName: "",
                      showIcon: true
                    })]
                  })]
                }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
                  style: {
                    display: "flex"
                  },
                  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
                    className: "profile-label-margin",
                    style: editScreen ? {
                      color: "#B1B4B6",
                      width: "300px"
                    } : {
                      width: "300px"
                    },
                    children: "".concat(t("CORE_COMMON_PROFILE_CONFIRM_PASSWORD"))
                  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
                    style: {
                      width: "100%"
                    },
                    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                      t: t,
                      type: "password",
                      isMandatory: false,
                      name: "name",
                      pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U7 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U7 === void 0 || (_mdmsValidationData$U7 = _mdmsValidationData$U7[0]) === null || _mdmsValidationData$U7 === void 0 ? void 0 : _mdmsValidationData$U7.password) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon6 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon6 === void 0 || (_defaultValidationCon6 = _defaultValidationCon6[0]) === null || _defaultValidationCon6 === void 0 ? void 0 : _defaultValidationCon6.password),
                      onChange: e => {
                        var _e$target3;
                        return setUserConfirmPassword(e === null || e === void 0 || (_e$target3 = e.target) === null || _e$target3 === void 0 ? void 0 : _e$target3.value);
                      },
                      disabled: editScreen
                    }), (errors === null || errors === void 0 ? void 0 : errors.confirmPassword) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                      message: t(errors === null || errors === void 0 || (_errors$confirmPasswo = errors.confirmPassword) === null || _errors$confirmPasswo === void 0 ? void 0 : _errors$confirmPasswo.message),
                      truncateMessage: true,
                      maxLength: 256,
                      className: "",
                      wrapperClassName: "",
                      showIcon: true
                    })]
                  })]
                })]
              }) : ""]
            })
          }), userType === "employee" && isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("button", {
            onClick: updateProfile,
            style: {
              marginTop: "24px",
              backgroundColor: "#c84c0e",
              width: "100%",
              height: "40px",
              color: "white",
              maxWidth: isMobile ? "100%" : "240px",
              borderBottom: "1px solid black",
              fontWeight: "700",
              fontSize: "17px"
            },
            children: t("CORE_COMMON_SAVE")
          }) : null]
        })
      })]
    }), userType === "employee" && !isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Footer, {
      actionFields: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.SubmitBar, {
        t: t,
        label: t("CORE_COMMON_SAVE"),
        onSubmit: updateProfile
      })],
      className: "",
      setactionFieldsToRight: true
    }) : null, toast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Toast, {
      type: toast.key,
      label: t(toast.key === "success" ? "CORE_COMMON_PROFILE_UPDATE_SUCCESS" : toast.action),
      onClose: () => setToast(null),
      style: {
        maxWidth: "670px"
      }
    }), openUploadSlide == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ImageUpload_UploadDrawer__WEBPACK_IMPORTED_MODULE_5__["default"], {
      setProfilePic: setFileStoreId,
      closeDrawer: closeFileUploadDrawer,
      userType: userType,
      removeProfilePic: removeProfilePic,
      showToast: showToast
    }) : ""]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IndividualUserProfile);

/***/ }),

/***/ "./src/pages/citizen/Home/LanguageSelection.js":
/*!*****************************************************!*\
  !*** ./src/pages/citizen/Home/LanguageSelection.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }





var LanguageSelection = () => {
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var {
    data: {
      languages,
      stateInfo
    } = {},
    isLoading
  } = Digit.Hooks.useStore.getInitData();
  var selectedLanguage = Digit.StoreData.getCurrentLanguage();
  var texts = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    header: t("CS_COMMON_CHOOSE_LANGUAGE"),
    submitBarLabel: t("CORE_COMMON_CONTINUE")
  }), [t]);
  var RadioButtonProps = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    options: languages,
    optionsKey: "label",
    additionalWrapperClass: "digit-reverse-radio-selection-wrapper",
    onSelect: language => Digit.LocalizationService.changeLanguage(language.value, stateInfo.code),
    selectedOption: languages === null || languages === void 0 ? void 0 : languages.filter(i => i.value === selectedLanguage)[0]
  }), [selectedLanguage, languages]);
  function onSubmit() {
    var _window;
    navigate("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/citizen/select-location"));
  }
  return isLoading ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
    className: "selection-card-wrapper",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.PageBasedInput, {
      texts: texts,
      onSubmit: onSubmit,
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardHeader, {
        children: t("CS_COMMON_CHOOSE_LANGUAGE")
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.RadioButtons, _objectSpread({}, RadioButtonProps))]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LanguageSelection);

/***/ }),

/***/ "./src/pages/citizen/Home/LocationSelection.js":
/*!*****************************************************!*\
  !*** ./src/pages/citizen/Home/LocationSelection.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }






var LocationSelection = () => {
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useNavigate)();
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useLocation)();
  var {
    data: {
      stateInfo,
      uiHomePage
    } = {},
    isLoading: initisLoading
  } = Digit.Hooks.useStore.getInitData();
  var redirectURL = uiHomePage === null || uiHomePage === void 0 ? void 0 : uiHomePage.redirectURL;
  var {
    data: cities,
    isLoading
  } = Digit.Hooks.useTenants();
  var [selectedCity, setSelectedCity] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(() => ({
    code: Digit.ULBService.getCitizenCurrentTenant(true)
  }));
  var [showError, setShowError] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var texts = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => ({
    header: t("CS_COMMON_CHOOSE_LOCATION"),
    submitBarLabel: t("CORE_COMMON_CONTINUE")
  }), [t]);
  function selectCity(city) {
    setSelectedCity(city);
    setShowError(false);
  }
  var RadioButtonProps = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
    return {
      options: cities,
      optionsKey: "i18nKey",
      additionalWrapperClass: "digit-reverse-radio-selection-wrapper",
      onSelect: selectCity,
      selectedOption: selectedCity
    };
  }, [cities, t, selectedCity]);
  function onSubmit() {
    if (selectedCity) {
      var _location$state;
      Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY", selectedCity);
      var redirectBackTo = (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.redirectBackTo;
      if (redirectURL) {
        var _window;
        navigate("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/citizen/").concat(redirectURL));
      } else {
        var _window2;
        if (redirectBackTo) {
          navigate(redirectBackTo, {
            replace: true
          });
        } else navigate("/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/citizen"));
      }
    } else {
      setShowError(true);
    }
  }
  return isLoading ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("loader", {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackLink, {
      onClick: () => window.history.back()
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.PageBasedInput, {
      texts: texts,
      onSubmit: onSubmit,
      className: "location-selection-container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.CardHeader, {
        children: t("CS_COMMON_CHOOSE_LOCATION")
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.SearchOnRadioButtons, _objectSpread(_objectSpread({}, RadioButtonProps), {}, {
        placeholder: t("COMMON_TABLE_SEARCH")
      })), showError ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.CardLabelError, {
        children: t("CS_COMMON_LOCATION_SELECTION_ERROR")
      }) : null]
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LocationSelection);

/***/ }),

/***/ "./src/pages/citizen/Home/UserProfile.js":
/*!***********************************************!*\
  !*** ./src/pages/citizen/Home/UserProfile.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _ImageUpload_UploadDrawer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ImageUpload/UploadDrawer */ "./src/pages/citizen/Home/ImageUpload/UploadDrawer.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var _IndividualUserProfile__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./IndividualUserProfile */ "./src/pages/citizen/Home/IndividualUserProfile.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _Digit, _Digit$getStateId;
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }









var DEFAULT_TENANT = (_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.ULBService) === null || _Digit === void 0 || (_Digit$getStateId = _Digit.getStateId) === null || _Digit$getStateId === void 0 ? void 0 : _Digit$getStateId.call(_Digit);
var defaultImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL" + "/" + "/" + "/" + "/Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf/" + "/a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKs" + "qXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpds" + "Lb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7Xl" + "Xyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37Z" + "B+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl" + "/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje" + "2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAj" + "Y4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegreh" + "A+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6v" + "oO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN" + "2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA" + "3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelv" + "Xntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulq" + "Ue6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7L" + "XZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvn" + "L+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC";
var defaultValidationConfig = {
  tenantId: "".concat(DEFAULT_TENANT),
  UserProfileValidationConfig: [{
    name: "/^[a-zA-Z ]+$/i",
    mobileNumber: "/^[6-9]{1}[0-9]{9}$/",
    password: "/^([a-zA-Z0-9@#$%]{8,15})$/i"
  }]
};
var UserProfile = _ref => {
  var _window, _window2, _Digit$UserService$ge, _window3, _window4, _window5, _mdmsValidationData$U2, _defaultValidationCon, _errors$userName, _errors$emailAddress, _mdmsValidationData$U3, _defaultValidationCon2, _errors$userName2, _mdmsValidationData$U4, _defaultValidationCon3, _errors$mobileNumber, _errors$emailAddress2, _mdmsValidationData$U5, _defaultValidationCon4, _errors$currentPasswo, _mdmsValidationData$U6, _defaultValidationCon5, _errors$newPassword, _mdmsValidationData$U7, _defaultValidationCon6, _errors$confirmPasswo;
  var {
    stateCode,
    userType,
    cityDetails
  } = _ref;
  // Check if individual should be used for login
  var useAnIndividual = (_window = window) === null || _window === void 0 || (_window = _window.globalConfigs) === null || _window === void 0 ? void 0 : _window.getConfig("USE_INDIVIDUAL_MODEL");
  var individualServicePath = (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.globalConfigs) === null || _window2 === void 0 ? void 0 : _window2.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");

  // If useAnIndividual exists, use IndividualLogin component
  if (useAnIndividual && individualServicePath) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_IndividualUserProfile__WEBPACK_IMPORTED_MODULE_7__["default"], {
      stateCode: stateCode,
      userType: userType,
      cityDetails: cityDetails
    });
  }
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useNavigate)();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  var url = window.location.href;
  var stateId = Digit.ULBService.getStateId();
  var tenant = Digit.ULBService.getCurrentTenantId();
  var userInfo = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
  var [userDetails, setUserDetails] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var [name, setName] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userInfo !== null && userInfo !== void 0 && userInfo.name ? userInfo.name : "");
  var [email, setEmail] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userInfo !== null && userInfo !== void 0 && userInfo.emailId ? userInfo.emailId : "");
  var [gender, setGender] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender);
  var [city, setCity] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userInfo !== null && userInfo !== void 0 && userInfo.permanentCity ? userInfo.permanentCity : cityDetails.name);
  var [mobileNumber, setMobileNo] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(userInfo !== null && userInfo !== void 0 && userInfo.mobileNumber ? userInfo.mobileNumber : "");
  var [profilePic, setProfilePic] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var [profileImg, setProfileImg] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
  var [openUploadSlide, setOpenUploadSide] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var [changepassword, setChangepassword] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var [currentPassword, setCurrentPassword] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
  var [newPassword, setNewPassword] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
  var [confirmPassword, setConfirmPassword] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
  var [toast, setToast] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var [windowWidth, setWindowWidth] = react__WEBPACK_IMPORTED_MODULE_2___default().useState(window.innerWidth);
  var [errors, setErrors] = react__WEBPACK_IMPORTED_MODULE_2___default().useState({});
  var isMobile = window.Digit.Utils.browser.isMobile();
  var isMultiRootTenant = Digit.Utils.getMultiRootTenant();
  var mapConfigToRegExp = config => {
    var _config$UserProfileVa;
    return (config === null || config === void 0 || (_config$UserProfileVa = config.UserProfileValidationConfig) === null || _config$UserProfileVa === void 0 ? void 0 : _config$UserProfileVa[0]) && Object.entries(config === null || config === void 0 ? void 0 : config.UserProfileValidationConfig[0]).reduce((acc, _ref2) => {
      var [key, value] = _ref2;
      if (typeof value === "string") {
        try {
          // Checking if value looks like a regex (starts with "/" and ends with "/flags")
          if (value.startsWith("/") && value.lastIndexOf("/") > 0) {
            var lastSlashIndex = value.lastIndexOf("/");
            var pattern = value.slice(1, lastSlashIndex); // Extracting regex pattern
            var flags = value.slice(lastSlashIndex + 1); // Extracting regex flags

            acc[key] = new RegExp(pattern, flags); // Converting properly
          } else {
            acc[key] = new RegExp(value); // Treating it as a normal regex pattern (no flags)
          }
        } catch (error) {
          console.error("Error parsing regex for key \"".concat(key, "\":"), error);
          acc[key] = value; // Keeping as string if invalid regex
        }
      } else {
        acc[key] = value; // Keeping non-string values as it is
      }
      return acc;
    }, {});
  };
  var [validationConfig, setValidationConfig] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(mapConfigToRegExp(defaultValidationConfig) || {});
  var {
    data: mdmsValidationData,
    isValidationConfigLoading
  } = Digit.Hooks.useCustomMDMS(stateCode, "commonUiConfig", [{
    name: "UserProfileValidationConfig"
  }], {
    select: data => {
      return data === null || data === void 0 ? void 0 : data.commonUiConfig;
    }
  });
  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    var _mdmsValidationData$U;
    if (mdmsValidationData && mdmsValidationData !== null && mdmsValidationData !== void 0 && (_mdmsValidationData$U = mdmsValidationData.UserProfileValidationConfig) !== null && _mdmsValidationData$U !== void 0 && _mdmsValidationData$U[0]) {
      var updatedValidationConfig = mapConfigToRegExp(mdmsValidationData);
      setValidationConfig(updatedValidationConfig);
    }
  }, [mdmsValidationData]);
  var getUserInfo = /*#__PURE__*/function () {
    var _ref3 = _asyncToGenerator(function* () {
      var uuid = userInfo === null || userInfo === void 0 ? void 0 : userInfo.uuid;
      if (uuid) {
        var usersResponse = yield Digit.UserService.userSearch(tenant, {
          uuid: [uuid]
        }, {});
        usersResponse && usersResponse.user && usersResponse.user.length && setUserDetails(usersResponse.user[0]);
      }
    });
    return function getUserInfo() {
      return _ref3.apply(this, arguments);
    };
  }();
  react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
    var handleResize = () => setWindowWidth(window.innerWidth);
    window.addEventListener("resize", handleResize);
    return () => {
      window.removeEventListener("resize", handleResize);
    };
  }, []);
  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    var _userDetails$photo;
    setLoading(true);
    getUserInfo();
    setGender({
      i18nKey: undefined,
      code: userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender,
      value: userDetails === null || userDetails === void 0 ? void 0 : userDetails.gender
    });
    var thumbs = userDetails === null || userDetails === void 0 || (_userDetails$photo = userDetails.photo) === null || _userDetails$photo === void 0 ? void 0 : _userDetails$photo.split(",");
    setProfileImg(thumbs === null || thumbs === void 0 ? void 0 : thumbs.at(0));
    setLoading(false);
  }, [userDetails !== null]);
  var validation = {};
  var editScreen = false; // To-do: Deubug and make me dynamic or remove if not needed
  var onClickAddPic = () => setOpenUploadSide(!openUploadSlide);
  var TogleforPassword = () => setChangepassword(!changepassword);
  var setGenderName = value => setGender(value);
  var closeFileUploadDrawer = () => setOpenUploadSide(false);
  var setUserName = value => {
    var _validationConfig$nam;
    setName(value);
    if (!(validationConfig !== null && validationConfig !== void 0 && (_validationConfig$nam = validationConfig.name) !== null && _validationConfig$nam !== void 0 && _validationConfig$nam.test(value)) || value.length === 0 || value.length > 50) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        userName: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_NAME_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        userName: null
      }));
    }
  };
  var setUserEmailAddress = value => {
    if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.userName) !== value) {
      setEmail(value);
      if (value.length && !(value.includes("@") && value.includes("."))) {
        setErrors(_objectSpread(_objectSpread({}, errors), {}, {
          emailAddress: {
            type: "pattern",
            message: "CORE_COMMON_PROFILE_EMAIL_INVALID"
          }
        }));
      } else {
        setErrors(_objectSpread(_objectSpread({}, errors), {}, {
          emailAddress: null
        }));
      }
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        emailAddress: null
      }));
    }
  };
  var setUserMobileNumber = value => {
    var _validationConfig$mob;
    setMobileNo(value);
    if (userType === "employee" && !(validationConfig !== null && validationConfig !== void 0 && (_validationConfig$mob = validationConfig.mobileNumber) !== null && _validationConfig$mob !== void 0 && _validationConfig$mob.test(value))) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        mobileNumber: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        mobileNumber: null
      }));
    }
  };
  var setUserCurrentPassword = value => {
    if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(value))) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        currentPassword: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        currentPassword: null
      }));
    }
  };
  var setUserNewPassword = value => {
    setNewPassword(value);
    if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(value))) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        newPassword: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        newPassword: null
      }));
    }
  };
  var setUserConfirmPassword = value => {
    setConfirmPassword(value);
    if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(value))) {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        confirmPassword: {
          type: "pattern",
          message: "CORE_COMMON_PROFILE_PASSWORD_INVALID"
        }
      }));
    } else {
      setErrors(_objectSpread(_objectSpread({}, errors), {}, {
        confirmPassword: null
      }));
    }
  };
  var removeProfilePic = () => {
    setProfilePic(null);
    setProfileImg(null);
  };
  var showToast = function showToast(type, message) {
    var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5000;
    setToast({
      key: type,
      action: message
    });
    setTimeout(() => {
      setToast(null);
    }, duration);
  };
  var updateProfile = /*#__PURE__*/function () {
    var _ref4 = _asyncToGenerator(function* () {
      setLoading(true);
      try {
        var requestData = _objectSpread(_objectSpread({}, userInfo), {}, {
          name,
          gender: gender === null || gender === void 0 ? void 0 : gender.value,
          emailId: email,
          photo: profilePic
        });
        if (name) {
          setName(prev => prev.trim());
        }
        if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.name.test(name)) || name === "" || name.length > 50 || name.length < 1) {
          throw JSON.stringify({
            type: "error",
            message: t("CORE_COMMON_PROFILE_NAME_INVALID")
          });
        }
        if (userType === "employee" && !(validationConfig !== null && validationConfig !== void 0 && validationConfig.mobileNumber.test(mobileNumber))) {
          throw JSON.stringify({
            type: "error",
            message: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")
          });
        }
        if (email.length && !(email.includes("@") && email.includes("."))) {
          throw JSON.stringify({
            type: "error",
            message: t("CORE_COMMON_PROFILE_EMAIL_INVALID")
          });
        }
        var trimmedCurrentPassword = currentPassword.trim();
        var trimmedNewPassword = newPassword.trim();
        var trimmedConfirmPassword = confirmPassword.trim();

        // Updating state with trimmed values
        setCurrentPassword(trimmedCurrentPassword);
        setNewPassword(trimmedNewPassword);
        setConfirmPassword(trimmedConfirmPassword);
        if (changepassword && trimmedCurrentPassword && trimmedNewPassword && trimmedConfirmPassword) {
          if (trimmedNewPassword !== trimmedConfirmPassword) {
            throw JSON.stringify({
              type: "error",
              message: t("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")
            });
          }
          if (!(trimmedCurrentPassword.length && trimmedNewPassword.length && trimmedConfirmPassword.length)) {
            throw JSON.stringify({
              type: "error",
              message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID")
            });
          }
          if (!(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(trimmedNewPassword)) && !(validationConfig !== null && validationConfig !== void 0 && validationConfig.password.test(trimmedConfirmPassword))) {
            throw JSON.stringify({
              type: "error",
              message: t("CORE_COMMON_PROFILE_PASSWORD_INVALID")
            });
          }
        }
        var {
          responseInfo,
          user
        } = yield Digit.UserService.updateUser(requestData, stateCode);
        if (responseInfo && responseInfo.status === "200") {
          var _user = Digit.UserService.getUser();
          if (_user) {
            Digit.UserService.setUser(_objectSpread(_objectSpread({}, _user), {}, {
              info: _objectSpread(_objectSpread({}, _user.info), {}, {
                name,
                mobileNumber,
                emailId: email,
                permanentCity: city
              })
            }));
          }
        }
        if (currentPassword.length && newPassword.length && confirmPassword.length) {
          var _requestData = {
            existingPassword: currentPassword,
            newPassword: newPassword,
            tenantId: tenant,
            type: "EMPLOYEE",
            username: userInfo === null || userInfo === void 0 ? void 0 : userInfo.userName,
            confirmPassword: confirmPassword
          };
          if (newPassword === confirmPassword) {
            try {
              var res = yield Digit.UserService.changePassword(_requestData, tenant);
              var {
                responseInfo: changePasswordResponseInfo
              } = res;
              if (changePasswordResponseInfo !== null && changePasswordResponseInfo !== void 0 && changePasswordResponseInfo.status && changePasswordResponseInfo.status === "200") {
                showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"), 5000);
                setTimeout(() => Digit.UserService.logout(), 2000);
              } else {
                throw "";
              }
            } catch (error) {
              var _error$Errors;
              throw JSON.stringify({
                type: "error",
                message: (_error$Errors = error.Errors) !== null && _error$Errors !== void 0 && (_error$Errors = _error$Errors.at(0)) !== null && _error$Errors !== void 0 && _error$Errors.description ? error.Errors.at(0).description : "CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"
              });
            }
          } else {
            throw JSON.stringify({
              type: "error",
              message: "CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"
            });
          }
        } else if (responseInfo !== null && responseInfo !== void 0 && responseInfo.status && responseInfo.status === "200") {
          showToast("success", t("CORE_COMMON_PROFILE_UPDATE_SUCCESS"), 5000);
        }
      } catch (error) {
        var errorObj = JSON.parse(error);
        showToast(errorObj.type, t(errorObj.message), 5000);
      }
      setLoading(false);
    });
    return function updateProfile() {
      return _ref4.apply(this, arguments);
    };
  }();
  var menu = [];
  var {
    data: Menu
  } = Digit.Hooks.useGenderMDMS(stateId, "common-masters", "GenderType");
  Menu && Menu.map(genderDetails => {
    menu.push({
      i18nKey: "PT_COMMON_GENDER_".concat(genderDetails.code),
      code: "".concat(genderDetails.code),
      value: "".concat(genderDetails.code)
    });
  });
  var setFileStoreId = /*#__PURE__*/function () {
    var _ref5 = _asyncToGenerator(function* (fileStoreId) {
      setProfilePic(fileStoreId);
      var thumbnails = fileStoreId ? yield getThumbnails([fileStoreId], stateId) : null;
      setProfileImg(thumbnails === null || thumbnails === void 0 ? void 0 : thumbnails.thumbs[0]);
      closeFileUploadDrawer();
    });
    return function setFileStoreId(_x) {
      return _ref5.apply(this, arguments);
    };
  }();
  var getThumbnails = /*#__PURE__*/function () {
    var _ref6 = _asyncToGenerator(function* (ids, tenantId) {
      var res = yield Digit.UploadServices.Filefetch(ids, tenantId);
      if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) {
        return {
          thumbs: res.data.fileStoreIds.map(o => o.url.split(",")[3]),
          images: res.data.fileStoreIds.map(o => Digit.Utils.getFileUrl(o.url))
        };
      } else {
        return null;
      }
    });
    return function getThumbnails(_x2, _x3) {
      return _ref6.apply(this, arguments);
    };
  }();
  if (loading || isValidationConfigLoading) return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {});
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
    className: "user-profile ".concat(userType === "citizen" ? "citizen" : "employee"),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("section", {
      style: {
        margin: userType === "citizen" || isMobile ? "8px" : "0px"
      },
      children: userType === "citizen" || isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackLink, {
        onClick: () => navigate("/")
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BreadCrumb, {
        style: {
          marginTop: "0rem",
          marginBottom: "1.5rem"
        },
        crumbs: [{
          internalLink: isMultiRootTenant ? "/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/employee/sandbox/landing") : "/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/employee"),
          content: t("ES_COMMON_HOME"),
          show: true
        }, {
          internalLink: "/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.contextPath, "/employee/user/profile"),
          content: t("ES_COMMON_PAGE_1"),
          show: url.includes("/user/profile")
        }]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      style: {
        display: "flex",
        flex: 1,
        flexDirection: windowWidth < 768 || userType === "citizen" ? "column" : "row",
        margin: userType === "citizen" ? "8px" : "0px",
        gap: userType === "citizen" ? "" : "0 24px",
        boxShadow: userType === "citizen" ? "1px 1px 4px 0px rgba(0,0,0,0.2)" : "",
        background: userType === "citizen" ? "white" : "",
        borderRadius: userType === "citizen" ? "4px" : "",
        maxWidth: userType === "citizen" ? "960px" : ""
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("section", {
        style: {
          position: "relative",
          display: "flex",
          flex: userType === "citizen" ? 1 : 2.5,
          justifyContent: "center",
          alignItems: "center",
          maxWidth: "100%",
          // height: "376px",
          borderRadius: "4px",
          boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)",
          border: "".concat(userType === "citizen" ? "8px" : "24px", " solid #fff"),
          background: "#EEEEEE",
          padding: userType === "citizen" ? "8px" : "16px"
        },
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
          style: {
            position: "relative",
            height: userType === "citizen" ? "114px" : "150px",
            width: userType === "citizen" ? "114px" : "150px",
            margin: "16px"
          },
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__["default"], {
            style: {
              margin: "auto",
              borderRadius: "300px",
              justifyContent: "center",
              height: "100%",
              width: "100%"
            },
            src: !profileImg || profileImg === "" ? defaultImage : profileImg,
            alt: "Profile Image"
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("button", {
            style: {
              position: "absolute",
              left: "50%",
              bottom: "-24px",
              transform: "translateX(-50%)"
            },
            onClick: onClickAddPic,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.CameraIcon, {})
          })]
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("section", {
        style: {
          display: "flex",
          flexDirection: "column",
          flex: userType === "citizen" ? 1 : 7.5,
          width: "100%",
          borderRadius: "4px",
          height: "fit-content",
          boxShadow: userType === "citizen" ? "" : "1px 1px 4px 0px rgba(0,0,0,0.2)",
          background: "white",
          padding: userType === "citizen" ? "8px" : "24px",
          paddingBottom: "20px"
        },
        children: userType === "citizen" ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "user-profile",
              style: editScreen ? {
                color: "#B1B4B6"
              } : {},
              children: ["".concat(t("CORE_COMMON_PROFILE_NAME")), "*"]
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
              style: {
                width: "40rem",
                maxWidth: "960px"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, _objectSpread(_objectSpread({
                t: t,
                style: {
                  width: "100%"
                },
                type: "text",
                isMandatory: false,
                name: "name",
                value: name,
                onChange: e => setUserName(e.target.value)
              }, validation = {
                isRequired: true,
                pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U2 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U2 === void 0 || (_mdmsValidationData$U2 = _mdmsValidationData$U2[0]) === null || _mdmsValidationData$U2 === void 0 ? void 0 : _mdmsValidationData$U2.name) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon === void 0 || (_defaultValidationCon = _defaultValidationCon[0]) === null || _defaultValidationCon === void 0 ? void 0 : _defaultValidationCon.name),
                type: "tel",
                title: t("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")
              }), {}, {
                disable: editScreen
              })), (errors === null || errors === void 0 ? void 0 : errors.userName) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$userName = errors.userName) === null || _errors$userName === void 0 ? void 0 : _errors$userName.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "user-profile",
              style: editScreen ? {
                color: "#B1B4B6"
              } : {},
              children: "".concat(t("CORE_COMMON_PROFILE_GENDER"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Dropdown, {
              style: {
                width: "40rem",
                fontSize: "1rem"
              },
              className: "form-field profileDropdown",
              selected: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 ? gender[0] : gender,
              disable: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 || editScreen,
              option: menu,
              select: setGenderName,
              value: gender,
              optionKey: "code",
              t: t,
              name: "gender"
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "user-profile",
              style: editScreen ? {
                color: "#B1B4B6"
              } : {},
              children: "".concat(t("CORE_COMMON_PROFILE_EMAIL"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
              style: {
                width: "40rem"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                t: t,
                style: {
                  width: "100%"
                },
                type: "email",
                isMandatory: false,
                optionKey: "i18nKey",
                name: "email",
                value: email,
                onChange: e => setUserEmailAddress(e.target.value),
                disabled: editScreen
              }), (errors === null || errors === void 0 ? void 0 : errors.emailAddress) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$emailAddress = errors.emailAddress) === null || _errors$emailAddress === void 0 ? void 0 : _errors$emailAddress.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("button", {
            onClick: updateProfile,
            style: {
              marginTop: "24px",
              backgroundColor: "#c84c0e",
              width: "100%",
              height: "40px",
              color: "white",
              maxWidth: isMobile ? "100%" : "240px",
              borderBottom: "1px solid black"
            },
            children: t("CORE_COMMON_SAVE")
          })]
        }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: editScreen ? {
                color: "#B1B4B6",
                width: "300px"
              } : {
                width: "300px"
              },
              children: ["".concat(t("CORE_COMMON_PROFILE_NAME")), "*"]
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, _objectSpread(_objectSpread({
                t: t,
                type: "text",
                isMandatory: false,
                name: "name",
                value: name,
                onChange: e => setUserName(e.target.value),
                placeholder: "Enter Your Name"
              }, validation = {
                isRequired: true,
                pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U3 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U3 === void 0 || (_mdmsValidationData$U3 = _mdmsValidationData$U3[0]) === null || _mdmsValidationData$U3 === void 0 ? void 0 : _mdmsValidationData$U3.name) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon2 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon2 === void 0 || (_defaultValidationCon2 = _defaultValidationCon2[0]) === null || _defaultValidationCon2 === void 0 ? void 0 : _defaultValidationCon2.name),
                type: "text",
                title: t("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")
              }), {}, {
                disabled: editScreen
              })), (errors === null || errors === void 0 ? void 0 : errors.userName) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$userName2 = errors.userName) === null || _errors$userName2 === void 0 ? void 0 : _errors$userName2.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: editScreen ? {
                color: "#B1B4B6",
                width: "300px"
              } : {
                width: "300px"
              },
              children: "".concat(t("CORE_COMMON_PROFILE_GENDER"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
              style: {
                width: "100%"
              },
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Dropdown, {
                className: "profileDropdown",
                selected: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 ? gender[0] : gender,
                disable: (gender === null || gender === void 0 ? void 0 : gender.length) === 1 || editScreen,
                option: menu,
                select: setGenderName,
                value: gender,
                optionKey: "code",
                t: t,
                name: "gender"
              })
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: editScreen ? {
                color: "#B1B4B6",
                width: "300px"
              } : {
                width: "300px"
              },
              children: "".concat(t("CORE_COMMON_PROFILE_CITY"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, _objectSpread(_objectSpread({
                t: t,
                type: "text",
                isMandatory: false,
                name: "city",
                value: t(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_".concat(tenant))),
                onChange: e => setCity(e.target.value),
                placeholder: "Enter Your City Name"
              }, validation = {
                isRequired: true,
                // pattern: "^[a-zA-Z-.`' ]*$",
                type: "text",
                title: t("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")
              }), {}, {
                disabled: true
              })), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {})]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: {
                width: "300px"
              },
              children: "".concat(t("CORE_COMMON_PROFILE_MOBILE_NUMBER"), "*")
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.MobileNumber, {
                value: mobileNumber,
                style: {
                  width: "100%"
                },
                name: "mobileNumber",
                placeholder: "Enter a valid Mobile No.",
                onChange: value => setUserMobileNumber(value),
                disable: Digit.Utils.getMultiRootTenant() ? false : true,
                required: true,
                pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U4 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U4 === void 0 || (_mdmsValidationData$U4 = _mdmsValidationData$U4[0]) === null || _mdmsValidationData$U4 === void 0 ? void 0 : _mdmsValidationData$U4.mobileNumber) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon3 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon3 === void 0 || (_defaultValidationCon3 = _defaultValidationCon3[0]) === null || _defaultValidationCon3 === void 0 ? void 0 : _defaultValidationCon3.mobileNumber),
                type: "tel",
                title: t("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")
              }), (errors === null || errors === void 0 ? void 0 : errors.mobileNumber) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$mobileNumber = errors.mobileNumber) === null || _errors$mobileNumber === void 0 ? void 0 : _errors$mobileNumber.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            style: {
              display: "flex"
            },
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
              className: "profile-label-margin",
              style: editScreen ? {
                color: "#B1B4B6",
                width: "300px"
              } : {
                width: "300px"
              },
              children: "".concat(t("CORE_COMMON_PROFILE_EMAIL"))
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                t: t,
                type: "email",
                isMandatory: false,
                placeholder: t("EMAIL_VALIDATION"),
                optionKey: "i18nKey",
                name: "email",
                value: email,
                onChange: e => setUserEmailAddress(e.target.value),
                disabled: Digit.Utils.getMultiRootTenant() ? true : editScreen
              }), (errors === null || errors === void 0 ? void 0 : errors.emailAddress) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                message: t(errors === null || errors === void 0 || (_errors$emailAddress2 = errors.emailAddress) === null || _errors$emailAddress2 === void 0 ? void 0 : _errors$emailAddress2.message),
                truncateMessage: true,
                maxLength: 256,
                className: "",
                wrapperClassName: "",
                showIcon: true
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
              style: {
                width: "100%"
              },
              children: [changepassword == false && !Digit.Utils.getOTPBasedLogin() ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
                label: t("CORE_COMMON_CHANGE_PASSWORD"),
                variation: "teritiary",
                onClick: TogleforPassword,
                style: {
                  paddingLeft: "0rem"
                }
              }) : null, changepassword ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
                style: {
                  marginTop: "10px"
                },
                children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
                  style: {
                    display: "flex"
                  },
                  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
                    className: "profile-label-margin",
                    style: editScreen ? {
                      color: "#B1B4B6",
                      width: "300px"
                    } : {
                      width: "300px"
                    },
                    children: "".concat(t("CORE_COMMON_PROFILE_CURRENT_PASSWORD"))
                  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
                    style: {
                      width: "100%"
                    },
                    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                      t: t,
                      type: "password",
                      isMandatory: false,
                      name: "name",
                      pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U5 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U5 === void 0 || (_mdmsValidationData$U5 = _mdmsValidationData$U5[0]) === null || _mdmsValidationData$U5 === void 0 ? void 0 : _mdmsValidationData$U5.password) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon4 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon4 === void 0 || (_defaultValidationCon4 = _defaultValidationCon4[0]) === null || _defaultValidationCon4 === void 0 ? void 0 : _defaultValidationCon4.password),
                      onChange: e => {
                        var _e$target;
                        return setUserCurrentPassword(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
                      },
                      disabled: editScreen
                    }), (errors === null || errors === void 0 ? void 0 : errors.currentPassword) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                      message: t(errors === null || errors === void 0 || (_errors$currentPasswo = errors.currentPassword) === null || _errors$currentPasswo === void 0 ? void 0 : _errors$currentPasswo.message),
                      truncateMessage: true,
                      maxLength: 256,
                      className: "",
                      wrapperClassName: "",
                      showIcon: true
                    })]
                  })]
                }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
                  style: {
                    display: "flex"
                  },
                  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
                    className: "profile-label-margin",
                    style: editScreen ? {
                      color: "#B1B4B6",
                      width: "300px"
                    } : {
                      width: "300px"
                    },
                    children: "".concat(t("CORE_COMMON_PROFILE_NEW_PASSWORD"))
                  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
                    style: {
                      width: "100%"
                    },
                    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                      t: t,
                      type: "password",
                      isMandatory: false,
                      name: "name",
                      pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U6 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U6 === void 0 || (_mdmsValidationData$U6 = _mdmsValidationData$U6[0]) === null || _mdmsValidationData$U6 === void 0 ? void 0 : _mdmsValidationData$U6.password) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon5 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon5 === void 0 || (_defaultValidationCon5 = _defaultValidationCon5[0]) === null || _defaultValidationCon5 === void 0 ? void 0 : _defaultValidationCon5.password),
                      onChange: e => {
                        var _e$target2;
                        return setUserNewPassword(e === null || e === void 0 || (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.value);
                      },
                      disabled: editScreen
                    }), (errors === null || errors === void 0 ? void 0 : errors.newPassword) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                      message: t(errors === null || errors === void 0 || (_errors$newPassword = errors.newPassword) === null || _errors$newPassword === void 0 ? void 0 : _errors$newPassword.message),
                      truncateMessage: true,
                      maxLength: 256,
                      className: "",
                      wrapperClassName: "",
                      showIcon: true
                    })]
                  })]
                }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabelFieldPair, {
                  style: {
                    display: "flex"
                  },
                  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabel, {
                    className: "profile-label-margin",
                    style: editScreen ? {
                      color: "#B1B4B6",
                      width: "300px"
                    } : {
                      width: "300px"
                    },
                    children: "".concat(t("CORE_COMMON_PROFILE_CONFIRM_PASSWORD"))
                  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
                    style: {
                      width: "100%"
                    },
                    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TextInput, {
                      t: t,
                      type: "password",
                      isMandatory: false,
                      name: "name",
                      pattern: (mdmsValidationData === null || mdmsValidationData === void 0 || (_mdmsValidationData$U7 = mdmsValidationData.UserProfileValidationConfig) === null || _mdmsValidationData$U7 === void 0 || (_mdmsValidationData$U7 = _mdmsValidationData$U7[0]) === null || _mdmsValidationData$U7 === void 0 ? void 0 : _mdmsValidationData$U7.password) || (defaultValidationConfig === null || defaultValidationConfig === void 0 || (_defaultValidationCon6 = defaultValidationConfig.UserProfileValidationConfig) === null || _defaultValidationCon6 === void 0 || (_defaultValidationCon6 = _defaultValidationCon6[0]) === null || _defaultValidationCon6 === void 0 ? void 0 : _defaultValidationCon6.password),
                      onChange: e => {
                        var _e$target3;
                        return setUserConfirmPassword(e === null || e === void 0 || (_e$target3 = e.target) === null || _e$target3 === void 0 ? void 0 : _e$target3.value);
                      },
                      disabled: editScreen
                    }), (errors === null || errors === void 0 ? void 0 : errors.confirmPassword) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ErrorMessage, {
                      message: t(errors === null || errors === void 0 || (_errors$confirmPasswo = errors.confirmPassword) === null || _errors$confirmPasswo === void 0 ? void 0 : _errors$confirmPasswo.message),
                      truncateMessage: true,
                      maxLength: 256,
                      className: "",
                      wrapperClassName: "",
                      showIcon: true
                    })]
                  })]
                })]
              }) : ""]
            })
          }), userType === "employee" && isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("button", {
            onClick: updateProfile,
            style: {
              marginTop: "24px",
              backgroundColor: "#c84c0e",
              width: "100%",
              height: "40px",
              color: "white",
              maxWidth: isMobile ? "100%" : "240px",
              borderBottom: "1px solid black",
              fontWeight: "700",
              fontSize: "17px"
            },
            children: t("CORE_COMMON_SAVE")
          }) : null]
        })
      })]
    }), userType === "employee" && !isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Footer, {
      actionFields: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.SubmitBar, {
        t: t,
        label: t("CORE_COMMON_SAVE"),
        onSubmit: updateProfile
      })],
      className: "",
      setactionFieldsToRight: true
    }) : null, toast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Toast, {
      type: toast.key,
      label: t(toast.key === "success" ? "CORE_COMMON_PROFILE_UPDATE_SUCCESS" : toast.action),
      onClose: () => setToast(null),
      style: {
        maxWidth: "670px"
      }
    }), openUploadSlide == true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ImageUpload_UploadDrawer__WEBPACK_IMPORTED_MODULE_5__["default"], {
      setProfilePic: setFileStoreId,
      closeDrawer: closeFileUploadDrawer,
      userType: userType,
      removeProfilePic: removeProfilePic,
      showToast: showToast
    }) : ""]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UserProfile);

/***/ }),

/***/ "./src/pages/citizen/Home/index.js":
/*!*****************************************!*\
  !*** ./src/pages/citizen/Home/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }






var Home = () => {
  var _window3, _window3$includes, _window4, _window4$includes, _citizenServicesObj$s, _citizenServicesObj$p, _citizenServicesObj$p3, _citizenServicesObj$p5, _citizenServicesObj$p7, _infoAndUpdatesObj$si, _infoAndUpdatesObj$pr, _infoAndUpdatesObj$pr3, _infoAndUpdatesObj$pr5, _infoAndUpdatesObj$pr7, _whatsNewSectionObj$s2;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var tenantId = Digit.Utils.getMultiRootTenant() ? Digit.ULBService.getStateId() : Digit.ULBService.getCitizenCurrentTenant(true);
  var {
    data: {
      stateInfo,
      uiHomePage
    } = {},
    isLoading
  } = Digit.Hooks.useStore.getInitData();
  var isMobile = window.Digit.Utils.browser.isMobile();
  var conditionsToDisableNotificationCountTrigger = () => {
    var _Digit$UserService, _Digit$UserService2;
    if (((_Digit$UserService = Digit.UserService) === null || _Digit$UserService === void 0 || (_Digit$UserService = _Digit$UserService.getUser()) === null || _Digit$UserService === void 0 || (_Digit$UserService = _Digit$UserService.info) === null || _Digit$UserService === void 0 ? void 0 : _Digit$UserService.type) === "EMPLOYEE") return false;
    if (!((_Digit$UserService2 = Digit.UserService) !== null && _Digit$UserService2 !== void 0 && (_Digit$UserService2 = _Digit$UserService2.getUser()) !== null && _Digit$UserService2 !== void 0 && _Digit$UserService2.access_token)) return false;
    return true;
  };
  var {
    data: EventsData,
    isLoading: EventsDataLoading
  } = Digit.Hooks.useEvents({
    tenantId,
    variant: "whats-new",
    config: {
      enabled: conditionsToDisableNotificationCountTrigger()
    }
  });
  if (!tenantId) {
    var _window;
    navigate("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/citizen/select-language"));
  }
  var appBannerWebObj = uiHomePage === null || uiHomePage === void 0 ? void 0 : uiHomePage.appBannerDesktop;
  var appBannerMobObj = uiHomePage === null || uiHomePage === void 0 ? void 0 : uiHomePage.appBannerMobile;
  var citizenServicesObj = uiHomePage === null || uiHomePage === void 0 ? void 0 : uiHomePage.citizenServicesCard;
  var infoAndUpdatesObj = uiHomePage === null || uiHomePage === void 0 ? void 0 : uiHomePage.informationAndUpdatesCard;
  var whatsAppBannerWebObj = uiHomePage === null || uiHomePage === void 0 ? void 0 : uiHomePage.whatsAppBannerDesktop;
  var whatsAppBannerMobObj = uiHomePage === null || uiHomePage === void 0 ? void 0 : uiHomePage.whatsAppBannerMobile;
  var whatsNewSectionObj = uiHomePage === null || uiHomePage === void 0 ? void 0 : uiHomePage.whatsNewSection;
  var redirectURL = uiHomePage === null || uiHomePage === void 0 ? void 0 : uiHomePage.redirectURL;
  /* configure redirect URL only if it is required to overide the default citizen home screen */
  if (redirectURL) {
    var _window2;
    navigate("/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/citizen/").concat(redirectURL));
  }
  /* fix for sanitation ui & sandbox*/
  if ((_window3 = window) !== null && _window3 !== void 0 && (_window3 = _window3.location) !== null && _window3 !== void 0 && (_window3 = _window3.href) !== null && _window3 !== void 0 && (_window3$includes = _window3.includes) !== null && _window3$includes !== void 0 && _window3$includes.call(_window3, "sanitation-ui") || (_window4 = window) !== null && _window4 !== void 0 && (_window4 = _window4.location) !== null && _window4 !== void 0 && (_window4 = _window4.href) !== null && _window4 !== void 0 && (_window4$includes = _window4.includes) !== null && _window4$includes !== void 0 && _window4$includes.call(_window4, "sandbox-ui")) {
    var _window5;
    navigate("/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.contextPath, "/citizen/all-services"));
  }
  var handleClickOnWhatsAppBanner = obj => {
    window.open(obj === null || obj === void 0 ? void 0 : obj.navigationUrl);
  };
  var allCitizenServicesProps = {
    header: t(citizenServicesObj === null || citizenServicesObj === void 0 ? void 0 : citizenServicesObj.headerLabel),
    sideOption: {
      name: t(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$s = citizenServicesObj.sideOption) === null || _citizenServicesObj$s === void 0 ? void 0 : _citizenServicesObj$s.name),
      onClick: () => {
        var _citizenServicesObj$s2;
        return navigate(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$s2 = citizenServicesObj.sideOption) === null || _citizenServicesObj$s2 === void 0 ? void 0 : _citizenServicesObj$s2.navigationUrl);
      }
    },
    options: [{
      name: t(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$p = citizenServicesObj.props) === null || _citizenServicesObj$p === void 0 || (_citizenServicesObj$p = _citizenServicesObj$p[0]) === null || _citizenServicesObj$p === void 0 ? void 0 : _citizenServicesObj$p.label),
      Icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.ComplaintIcon, {}),
      onClick: () => {
        var _citizenServicesObj$p2;
        return navigate(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$p2 = citizenServicesObj.props) === null || _citizenServicesObj$p2 === void 0 || (_citizenServicesObj$p2 = _citizenServicesObj$p2[0]) === null || _citizenServicesObj$p2 === void 0 ? void 0 : _citizenServicesObj$p2.navigationUrl);
      }
    }, {
      name: t(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$p3 = citizenServicesObj.props) === null || _citizenServicesObj$p3 === void 0 || (_citizenServicesObj$p3 = _citizenServicesObj$p3[1]) === null || _citizenServicesObj$p3 === void 0 ? void 0 : _citizenServicesObj$p3.label),
      Icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.PTIcon, {
        className: "fill-path-primary-main"
      }),
      onClick: () => {
        var _citizenServicesObj$p4;
        return navigate(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$p4 = citizenServicesObj.props) === null || _citizenServicesObj$p4 === void 0 || (_citizenServicesObj$p4 = _citizenServicesObj$p4[1]) === null || _citizenServicesObj$p4 === void 0 ? void 0 : _citizenServicesObj$p4.navigationUrl);
      }
    }, {
      name: t(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$p5 = citizenServicesObj.props) === null || _citizenServicesObj$p5 === void 0 || (_citizenServicesObj$p5 = _citizenServicesObj$p5[2]) === null || _citizenServicesObj$p5 === void 0 ? void 0 : _citizenServicesObj$p5.label),
      Icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.CaseIcon, {
        className: "fill-path-primary-main"
      }),
      onClick: () => {
        var _citizenServicesObj$p6;
        return navigate(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$p6 = citizenServicesObj.props) === null || _citizenServicesObj$p6 === void 0 || (_citizenServicesObj$p6 = _citizenServicesObj$p6[2]) === null || _citizenServicesObj$p6 === void 0 ? void 0 : _citizenServicesObj$p6.navigationUrl);
      }
    },
    // {
    //     name: t("ACTION_TEST_WATER_AND_SEWERAGE"),
    //     Icon: <DropIcon/>,
    //     onClick: () => history.push(`/${window?.contextPath}/citizen`)
    // },
    {
      name: t(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$p7 = citizenServicesObj.props) === null || _citizenServicesObj$p7 === void 0 || (_citizenServicesObj$p7 = _citizenServicesObj$p7[3]) === null || _citizenServicesObj$p7 === void 0 ? void 0 : _citizenServicesObj$p7.label),
      Icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.OBPSIcon, {}),
      onClick: () => {
        var _citizenServicesObj$p8;
        return navigate(citizenServicesObj === null || citizenServicesObj === void 0 || (_citizenServicesObj$p8 = citizenServicesObj.props) === null || _citizenServicesObj$p8 === void 0 || (_citizenServicesObj$p8 = _citizenServicesObj$p8[3]) === null || _citizenServicesObj$p8 === void 0 ? void 0 : _citizenServicesObj$p8.navigationUrl);
      }
    }],
    styles: {
      display: "flex",
      flexWrap: "wrap",
      justifyContent: "flex-start",
      width: "100%"
    }
  };
  var allInfoAndUpdatesProps = {
    header: t(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 ? void 0 : infoAndUpdatesObj.headerLabel),
    sideOption: {
      name: t(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$si = infoAndUpdatesObj.sideOption) === null || _infoAndUpdatesObj$si === void 0 ? void 0 : _infoAndUpdatesObj$si.name),
      onClick: () => {
        var _infoAndUpdatesObj$si2;
        return navigate(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$si2 = infoAndUpdatesObj.sideOption) === null || _infoAndUpdatesObj$si2 === void 0 ? void 0 : _infoAndUpdatesObj$si2.navigationUrl);
      }
    },
    options: [{
      name: t(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$pr = infoAndUpdatesObj.props) === null || _infoAndUpdatesObj$pr === void 0 || (_infoAndUpdatesObj$pr = _infoAndUpdatesObj$pr[0]) === null || _infoAndUpdatesObj$pr === void 0 ? void 0 : _infoAndUpdatesObj$pr.label),
      Icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.HomeIcon, {}),
      onClick: () => {
        var _infoAndUpdatesObj$pr2;
        return navigate(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$pr2 = infoAndUpdatesObj.props) === null || _infoAndUpdatesObj$pr2 === void 0 || (_infoAndUpdatesObj$pr2 = _infoAndUpdatesObj$pr2[0]) === null || _infoAndUpdatesObj$pr2 === void 0 ? void 0 : _infoAndUpdatesObj$pr2.navigationUrl);
      }
    }, {
      name: t(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$pr3 = infoAndUpdatesObj.props) === null || _infoAndUpdatesObj$pr3 === void 0 || (_infoAndUpdatesObj$pr3 = _infoAndUpdatesObj$pr3[1]) === null || _infoAndUpdatesObj$pr3 === void 0 ? void 0 : _infoAndUpdatesObj$pr3.label),
      Icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.Calender, {}),
      onClick: () => {
        var _infoAndUpdatesObj$pr4;
        return navigate(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$pr4 = infoAndUpdatesObj.props) === null || _infoAndUpdatesObj$pr4 === void 0 || (_infoAndUpdatesObj$pr4 = _infoAndUpdatesObj$pr4[1]) === null || _infoAndUpdatesObj$pr4 === void 0 ? void 0 : _infoAndUpdatesObj$pr4.navigationUrl);
      }
    }, {
      name: t(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$pr5 = infoAndUpdatesObj.props) === null || _infoAndUpdatesObj$pr5 === void 0 || (_infoAndUpdatesObj$pr5 = _infoAndUpdatesObj$pr5[2]) === null || _infoAndUpdatesObj$pr5 === void 0 ? void 0 : _infoAndUpdatesObj$pr5.label),
      Icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.DocumentIcon, {}),
      onClick: () => {
        var _infoAndUpdatesObj$pr6;
        return navigate(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$pr6 = infoAndUpdatesObj.props) === null || _infoAndUpdatesObj$pr6 === void 0 || (_infoAndUpdatesObj$pr6 = _infoAndUpdatesObj$pr6[2]) === null || _infoAndUpdatesObj$pr6 === void 0 ? void 0 : _infoAndUpdatesObj$pr6.navigationUrl);
      }
    }, {
      name: t(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$pr7 = infoAndUpdatesObj.props) === null || _infoAndUpdatesObj$pr7 === void 0 || (_infoAndUpdatesObj$pr7 = _infoAndUpdatesObj$pr7[3]) === null || _infoAndUpdatesObj$pr7 === void 0 ? void 0 : _infoAndUpdatesObj$pr7.label),
      Icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.DocumentIcon, {}),
      onClick: () => {
        var _infoAndUpdatesObj$pr8;
        return navigate(infoAndUpdatesObj === null || infoAndUpdatesObj === void 0 || (_infoAndUpdatesObj$pr8 = infoAndUpdatesObj.props) === null || _infoAndUpdatesObj$pr8 === void 0 || (_infoAndUpdatesObj$pr8 = _infoAndUpdatesObj$pr8[3]) === null || _infoAndUpdatesObj$pr8 === void 0 ? void 0 : _infoAndUpdatesObj$pr8.navigationUrl);
      }
    }
    // {
    //     name: t("CS_COMMON_HELP"),
    //     Icon: <HelpIcon/>
    // }
    ],
    styles: {
      display: "flex",
      flexWrap: "wrap",
      justifyContent: "flex-start",
      width: "100%"
    }
  };
  return isLoading ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
    className: "HomePageContainer",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
      className: "HomePageWrapper",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
        className: "BannerWithSearch",
        children: [isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_4__["default"], {
          src: appBannerMobObj === null || appBannerMobObj === void 0 ? void 0 : appBannerMobObj.bannerUrl,
          alt: "Banner Image"
        }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_4__["default"], {
          src: appBannerWebObj === null || appBannerWebObj === void 0 ? void 0 : appBannerWebObj.bannerUrl,
          alt: "Banner Image"
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
          className: "ServicesSection",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.CardBasedOptions, _objectSpread({
            style: {
              marginTop: "-30px"
            }
          }, allCitizenServicesProps)), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.CardBasedOptions, _objectSpread({
            style: isMobile ? {} : {
              marginTop: "-30px"
            }
          }, allInfoAndUpdatesProps))]
        })]
      }), (whatsAppBannerMobObj || whatsAppBannerWebObj) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
        className: "WhatsAppBanner",
        children: isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_4__["default"], {
          src: whatsAppBannerMobObj === null || whatsAppBannerMobObj === void 0 ? void 0 : whatsAppBannerMobObj.bannerUrl,
          onClick: () => handleClickOnWhatsAppBanner(whatsAppBannerMobObj),
          alt: "Whatsapp Banner"
        }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_4__["default"], {
          src: whatsAppBannerWebObj === null || whatsAppBannerWebObj === void 0 ? void 0 : whatsAppBannerWebObj.bannerUrl,
          onClick: () => handleClickOnWhatsAppBanner(whatsAppBannerWebObj),
          alt: "Whatsapp Banner"
        })
      }), conditionsToDisableNotificationCountTrigger() ? EventsDataLoading ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
        className: "WhatsNewSection",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
          className: "headSection",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("h2", {
            children: t(whatsNewSectionObj === null || whatsNewSectionObj === void 0 ? void 0 : whatsNewSectionObj.headerLabel)
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", {
            onClick: () => {
              var _whatsNewSectionObj$s;
              return navigate(whatsNewSectionObj === null || whatsNewSectionObj === void 0 || (_whatsNewSectionObj$s = whatsNewSectionObj.sideOption) === null || _whatsNewSectionObj$s === void 0 ? void 0 : _whatsNewSectionObj$s.navigationUrl);
            },
            children: t(whatsNewSectionObj === null || whatsNewSectionObj === void 0 || (_whatsNewSectionObj$s2 = whatsNewSectionObj.sideOption) === null || _whatsNewSectionObj$s2 === void 0 ? void 0 : _whatsNewSectionObj$s2.name)
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.WhatsNewCard, _objectSpread({}, EventsData === null || EventsData === void 0 ? void 0 : EventsData[0]))]
      }) : null]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Home);

/***/ }),

/***/ "./src/pages/citizen/HowItWorks/howItWorks.js":
/*!****************************************************!*\
  !*** ./src/pages/citizen/HowItWorks/howItWorks.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");





var HowItWorks = _ref => {
  var _user$info, _data$MdmsRes$common;
  var {
    module
  } = _ref;
  var user = Digit.UserService.getUser();
  var tenantId = (user === null || user === void 0 || (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.tenantId) || Digit.ULBService.getCurrentTenantId();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  var storeData = Digit.SessionStorage.get("initData");
  var stateInfo = storeData.stateInfo;
  var selectedLanguage = Digit.StoreData.getCurrentLanguage();
  var [selected, setselected] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(selectedLanguage);
  var handleChangeLanguage = language => {
    setselected(language.value);
    Digit.LocalizationService.changeLanguage(language.value, stateInfo.code);
  };
  var [videoPlay, setVideoPlay] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var [vidSrc, setVidSrc] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
  var ViDSvg = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", {
      d: "M12 24C5.38053 24 0 18.6143 0 12C0 5.38054 5.38053 1.90735e-06 12 1.90735e-06C18.6143 1.90735e-06 24 5.38054 24 12C24 18.6143 18.6143 24 12 24ZM16.3488 10.7852L11.3855 7.25251C11.1263 7.0701 10.8238 6.97889 10.5214 6.97889C10.291 6.97889 10.0557 7.03172 9.83976 7.14202C9.34054 7.40118 9.02857 7.91006 9.02857 8.46694L9.02877 15.5323C9.02877 16.0892 9.34076 16.5979 9.83996 16.8572C10.3344 17.1116 10.9296 17.0732 11.3857 16.7467L16.349 13.214C16.7426 12.9356 16.9778 12.4795 16.9778 11.9996C16.9776 11.5197 16.7426 11.0636 16.3489 10.7852L16.3488 10.7852Z",
      fill: "white"
    })
  });
  var onClickVideo = vidObj => {
    if (selected === "hi_IN") {
      setVidSrc(vidObj["hi_IN"]);
    } else {
      setVidSrc(vidObj["en_IN"]);
    }
    setVideoPlay(true);
  };
  var onClose = () => {
    setVideoPlay(false);
  };
  var {
    isLoading,
    data
  } = Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId());
  var mdmsConfigResult = data === null || data === void 0 || (_data$MdmsRes$common = data.MdmsRes["common-masters"]) === null || _data$MdmsRes$common === void 0 || (_data$MdmsRes$common = _data$MdmsRes$common.howItWorks[0]) === null || _data$MdmsRes$common === void 0 ? void 0 : _data$MdmsRes$common["".concat(module)];
  var languages = [{
    label: "ENGLISH",
    value: "en_IN"
  }, {
    label: "हिंदी",
    value: "hi_IN"
  }];
  if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "how-it-works-page",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackButton, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "how-it-works-page-header",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.HeaderComponent, {
          children: t(mdmsConfigResult.screenHeader ? mdmsConfigResult.screenHeader : "HOW_IT_WORKS")
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "language-selector",
        style: {
          margin: "10px"
        },
        children: languages.map((language, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
          className: "language-button-container",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.CustomButton, {
            selected: language.value === selected,
            text: language.label,
            onClick: () => handleChangeLanguage(language)
          })
        }, index))
      }), mdmsConfigResult.videosJson.map((videos, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
          className: "WhatsNewCard",
          style: {
            float: "left",
            position: "relative",
            width: "100%",
            marginBottom: 10
          },
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
            className: "video-icon",
            onClick: () => onClickVideo(videos),
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
              className: "vid-svg",
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ViDSvg, {})
            })
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
            className: "how-it-works-header-description",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h2", {
              children: t(videos.headerLabel)
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
              children: t(videos.description)
            })]
          })]
        })
      })), mdmsConfigResult.pdfHeader && mdmsConfigResult.pdfDesc && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "WhatsNewCard",
        style: {
          position: "relative",
          width: "100%",
          marginBottom: 10,
          display: "inline-block"
        },
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
          className: "how-it-works-pdf-section",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
            className: "pdf-icon-header-desc",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
              className: "pdf-icon",
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.PDFSvg, {})
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
              className: "pdf-header-desc",
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h2", {
                children: t(mdmsConfigResult.pdfHeader)
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
                children: t(mdmsConfigResult.pdfDesc)
              })]
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
            className: "download-icon",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.DownloadImgIcon, {})
          })]
        })
      }), videoPlay && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
        className: "how-it-works-video-play",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
          className: "close-button",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CloseSvg, {
            onClick: onClose
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("video", {
          width: 500,
          height: 500,
          controls: true,
          autoPlay: true,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("source", {
            src: vidSrc,
            type: "video/mp4"
          })
        })]
      })]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HowItWorks);

/***/ }),

/***/ "./src/pages/citizen/Login/IndividualLogin.js":
/*!****************************************************!*\
  !*** ./src/pages/citizen/Login/IndividualLogin.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ "./src/pages/citizen/Login/config.js");
/* harmony import */ var _SelectMobileNumber__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SelectMobileNumber */ "./src/pages/citizen/Login/SelectMobileNumber.js");
/* harmony import */ var _SelectName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectName */ "./src/pages/citizen/Login/SelectName.js");
/* harmony import */ var _SelectOtp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectOtp */ "./src/pages/citizen/Login/SelectOtp.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["ResponseInfo", "UserRequest"];
var _window, _window2;
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }









var TYPE_REGISTER = {
  type: "register"
};
var TYPE_LOGIN = {
  type: "login"
};
var DEFAULT_USER = "digit-user";
var DEFAULT_REDIRECT_URL = "/".concat(((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.globalConfigs) === null || _window2 === void 0 ? void 0 : _window2.getConfig("CONTEXT_PATH")), "/citizen");

/* set citizen details to enable backward compatible */
var setCitizenDetail = (userObject, token, tenantId) => {
  var _JSON$parse;
  if (Digit.Utils.getMultiRootTenant()) {
    return;
  }
  var locale = (_JSON$parse = JSON.parse(sessionStorage.getItem("Digit.initData"))) === null || _JSON$parse === void 0 || (_JSON$parse = _JSON$parse.value) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.selectedLanguage;
  localStorage.setItem("Citizen.tenant-id", tenantId);
  localStorage.setItem("tenant-id", tenantId);
  localStorage.setItem("citizen.userRequestObject", JSON.stringify(userObject));
  localStorage.setItem("locale", locale);
  localStorage.setItem("Citizen.locale", locale);
  localStorage.setItem("token", token);
  localStorage.setItem("Citizen.token", token);
  localStorage.setItem("user-info", JSON.stringify(userObject));
  localStorage.setItem("Citizen.user-info", JSON.stringify(userObject));
};
var getFromLocation = (state, searchParams) => {
  return (state === null || state === void 0 ? void 0 : state.from) || (searchParams === null || searchParams === void 0 ? void 0 : searchParams.from) || DEFAULT_REDIRECT_URL;
};
var IndividualLogin = _ref => {
  var _location$state, _window3;
  var {
    stateCode,
    isUserRegistered = false
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  var [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  var [isOtpValid, setIsOtpValid] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
  var [params, setParams] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(isUserRegistered ? {} : location === null || location === void 0 || (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.data);
  var [errorTO, setErrorTO] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  var searchParams = Digit.Hooks.useQueryParams();
  var [canSubmitName, setCanSubmitName] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  var [canSubmitOtp, setCanSubmitOtp] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
  var [canSubmitNo, setCanSubmitNo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
  var individualServicePath = (_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.globalConfigs) === null || _window3 === void 0 ? void 0 : _window3.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    var errorTimeout;
    if (error) {
      if (errorTO) {
        clearTimeout(errorTO);
        setErrorTO(null);
      }
      errorTimeout = setTimeout(() => {
        setError("");
      }, 5000);
      setErrorTO(errorTimeout);
    }
    return () => {
      errorTimeout && clearTimeout(errorTimeout);
    };
  }, [error]);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    var _location$state2;
    if (!user) {
      return;
    }
    Digit.SessionStorage.set("citizen.userRequestObject", user);
    Digit.UserService.setUser(user);
    setCitizenDetail(user === null || user === void 0 ? void 0 : user.info, user === null || user === void 0 ? void 0 : user.access_token, stateCode);
    var redirectPath = ((_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.from) || DEFAULT_REDIRECT_URL;
    if (!Digit.ULBService.getCitizenCurrentTenant(true)) {
      var _window4;
      navigate("/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/citizen/select-location"), {
        state: {
          redirectBackTo: redirectPath
        },
        replace: true
      });
    } else {
      navigate(redirectPath, {
        replace: true
      });
    }
  }, [user]);
  var stepItems = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => _config__WEBPACK_IMPORTED_MODULE_4__.loginSteps.map(step => {
    var texts = {};
    for (var key in step.texts) {
      texts[key] = t(step.texts[key]);
    }
    return _objectSpread(_objectSpread({}, step), {}, {
      texts
    });
  }), [_config__WEBPACK_IMPORTED_MODULE_4__.loginSteps]);
  var getUserType = () => "citizen" || 0;
  var handleOtpChange = otp => {
    setParams(_objectSpread(_objectSpread({}, params), {}, {
      otp
    }));
  };
  var handleMobileChange = event => {
    var {
      value
    } = event.target;
    setParams(_objectSpread(_objectSpread({}, params), {}, {
      mobileNumber: value
    }));
  };
  var handleEmailChange = event => {
    var {
      value
    } = event.target;
    setParams(_objectSpread(_objectSpread({}, params), {}, {
      userName: value
    }));
  };
  var selectMobileNumber = /*#__PURE__*/function () {
    var _ref2 = _asyncToGenerator(function* (mobileNumber) {
      setCanSubmitNo(false);
      setParams(_objectSpread(_objectSpread({}, params), mobileNumber));
      var data = _objectSpread(_objectSpread({}, mobileNumber), {}, {
        tenantId: stateCode,
        userType: getUserType()
      });
      var [res, err] = yield sendOtp({
        otp: _objectSpread(_objectSpread({}, data), TYPE_LOGIN)
      });
      if (!err) {
        setCanSubmitNo(true);
        navigate("otp", {
          state: {
            from: getFromLocation(location.state, searchParams)
          },
          replace: true
        });
        return;
      } else {
        setCanSubmitNo(true);
        navigate("name", {
          state: {
            from: getFromLocation(location.state, searchParams),
            data: data
          },
          replace: true
        });
      }
    });
    return function selectMobileNumber(_x) {
      return _ref2.apply(this, arguments);
    };
  }();
  var selectName = /*#__PURE__*/function () {
    var _ref3 = _asyncToGenerator(function* (name) {
      setCanSubmitName(true);
      var userData = _objectSpread(_objectSpread({}, params), name);
      setParams(userData);

      // Call the Individual service registration API
      var registerURL = "".concat(individualServicePath, "/v1/_register");
      var requestData = {
        IndividualRegister: {
          tenantId: stateCode,
          name: userData.name,
          emailId: userData.userName || "",
          mobileNumber: userData.mobileNumber || "",
          requestType: "Register"
        }
      };
      try {
        var registerResponse = yield Digit.CustomService.getResponse({
          url: registerURL,
          body: requestData,
          useCache: false,
          method: "POST",
          userService: false,
          auth: false,
          params: {}
        });
        if (!registerResponse) {
          throw new Error("Registration API failed");
        }
        setCanSubmitName(false);
        // After registration, go to OTP screen
        navigate("otp", {
          state: {
            from: getFromLocation(location.state, searchParams)
          },
          replace: true
        });
      } catch (err) {
        console.error("Registration error:", err);
        setCanSubmitName(false);
        setError(t("REGISTRATION_FAILED") || "Registration failed. Please try again.");
      }
    });
    return function selectName(_x2) {
      return _ref3.apply(this, arguments);
    };
  }();
  var selectOtp = /*#__PURE__*/function () {
    var _ref4 = _asyncToGenerator(function* () {
      try {
        var _window5;
        setIsOtpValid(true);
        setCanSubmitOtp(false);
        var {
          mobileNumber,
          otp,
          userName
        } = params;

        // Authenticate with OTP
        var requestData = {
          username: mobileNumber || userName,
          password: otp,
          tenantId: stateCode,
          userType: getUserType()
        };
        var _yield$Digit$UserServ = yield Digit.UserService.authenticate(requestData),
          {
            ResponseInfo,
            UserRequest: info
          } = _yield$Digit$UserServ,
          tokens = _objectWithoutProperties(_yield$Digit$UserServ, _excluded);
        if ((_window5 = window) !== null && _window5 !== void 0 && (_window5 = _window5.globalConfigs) !== null && _window5 !== void 0 && _window5.getConfig("ENABLE_SINGLEINSTANCE")) {
          info.tenantId = Digit.ULBService.getStateId();
        }
        setUser(_objectSpread({
          info
        }, tokens));
      } catch (err) {
        setCanSubmitOtp(true);
        setIsOtpValid(false);
        setError(t("INVALID_OTP") || "Invalid OTP");
      }
    });
    return function selectOtp() {
      return _ref4.apply(this, arguments);
    };
  }();
  var resendOtp = /*#__PURE__*/function () {
    var _ref5 = _asyncToGenerator(function* () {
      if (!isUserRegistered) {
        // For registration flow, user needs to complete registration first
        setError(t("PLEASE_COMPLETE_REGISTRATION") || "Please enter the OTP sent during registration.");
      } else {
        // For login flow, resend OTP
        var {
          mobileNumber,
          userName
        } = params;
        var data = {
          mobileNumber,
          userName,
          tenantId: stateCode,
          userType: getUserType()
        };
        var [res, err] = yield sendOtp({
          otp: _objectSpread(_objectSpread({}, data), TYPE_LOGIN)
        });
        if (err) {
          setError(t("OTP_RESEND_ERROR") || "Failed to resend OTP");
        }
      }
    });
    return function resendOtp() {
      return _ref5.apply(this, arguments);
    };
  }();
  var sendOtp = /*#__PURE__*/function () {
    var _ref6 = _asyncToGenerator(function* (data) {
      try {
        var res = yield Digit.UserService.sendOtp(data, stateCode);
        return [res, null];
      } catch (err) {
        return [null, err];
      }
    });
    return function sendOtp(_x3) {
      return _ref6.apply(this, arguments);
    };
  }();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
    className: "citizen-form-wrapper citizen-form-center",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.AppContainer, {
      children: [location.pathname.includes("login") ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackLink, {
        onClick: () => window.history.back()
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Routes, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "/",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_SelectMobileNumber__WEBPACK_IMPORTED_MODULE_5__["default"], {
            onSelect: selectMobileNumber,
            config: stepItems[0],
            mobileNumber: params.mobileNumber || "",
            emailId: params.userName || "",
            onMobileChange: handleMobileChange,
            onEmailChange: handleEmailChange,
            canSubmit: canSubmitNo,
            showRegisterLink: isUserRegistered,
            t: t
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "otp",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_SelectOtp__WEBPACK_IMPORTED_MODULE_7__["default"], {
            config: _objectSpread(_objectSpread({}, stepItems[1]), {}, {
              texts: _objectSpread(_objectSpread({}, stepItems[1].texts), {}, {
                cardText: "".concat(stepItems[1].texts.cardText, " ").concat(params.mobileNumber || params.userName || "")
              })
            }),
            onOtpChange: handleOtpChange,
            onResend: resendOtp,
            onSelect: selectOtp,
            otp: params.otp,
            error: isOtpValid,
            canSubmit: canSubmitOtp,
            t: t
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "name",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_SelectName__WEBPACK_IMPORTED_MODULE_6__["default"], {
            config: stepItems[2],
            onSelect: selectName,
            t: t,
            isDisabled: canSubmitName
          })
        })]
      }), error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Toast, {
        type: "error",
        label: error,
        onClose: () => setError(null)
      })]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IndividualLogin);

/***/ }),

/***/ "./src/pages/citizen/Login/SelectMobileNumber.js":
/*!*******************************************************!*\
  !*** ./src/pages/citizen/Login/SelectMobileNumber.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }



var SelectMobileNumber = _ref => {
  var _window;
  var {
    t,
    onSelect,
    mobileNumber,
    emailId,
    onMobileChange,
    onEmailChange,
    config,
    canSubmit
  } = _ref;
  var [isEmail, setIsEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(emailId ? true : false);
  var [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
  var core_mobile_config = ((_window = window) === null || _window === void 0 || (_window = _window.globalConfigs) === null || _window === void 0 ? void 0 : _window.getConfig("CORE_MOBILE_CONFIGS")) || {};
  var EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
  var rawPattern = (core_mobile_config === null || core_mobile_config === void 0 ? void 0 : core_mobile_config.mobileNumberPattern) || "^\\d+$";
  var mobileNumberPattern = new RegExp(rawPattern);
  var isEmailValid = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => EMAIL_REGEX.test(emailId), [emailId]);
  var isMobileValid = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => mobileNumberPattern.test(mobileNumber || ""), [mobileNumber, mobileNumberPattern]);
  var handleSubmit = () => {
    if (isEmail) {
      if (!isEmailValid) {
        setError(t("ERR_INVALID_EMAIL"));
        return;
      }
      onSelect({
        userName: emailId
      });
    } else {
      if (!isMobileValid) {
        setError(t("ERR_INVALID_MOBILE_NUMBER"));
        return;
      }
      onSelect({
        mobileNumber
      });
    }
  };
  var handleChange = e => {
    var value = e.target.value;
    setError("");
    if (isEmail) {
      onEmailChange(e);
      if (value && !EMAIL_REGEX.test(value)) setError(t("ERR_INVALID_EMAIL"));
    } else {
      onMobileChange(e);
      if (value && !mobileNumberPattern.test(value)) setError(t("ERR_INVALID_MOBILE_NUMBER"));
    }
  };
  var switchMode = () => {
    setIsEmail(!isEmail);
    setError("");
    if (isEmail) onEmailChange({
      target: {
        value: ""
      }
    });else onMobileChange({
      target: {
        value: ""
      }
    }); // clear mobile input
  };
  var isDisabled = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    return isEmail ? !(isEmailValid && canSubmit) : !(isMobileValid && canSubmit);
  }, [isEmail, isEmailValid, isMobileValid, canSubmit]);
  var mobileViewStyles = {
    marginLeft: "0px",
    userSelect: "none",
    color: "inherit",
    cursor: "pointer",
    // keeps it clickable
    textDecoration: "underline"
  };

  // Responsive label
  var linkLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    if (window.innerWidth <= 768) {
      return isEmail ? t("LOGIN_WITH_MOBILE") : t("LOGIN_WITH_EMAIL");
    }
    return isEmail ? t("CS_USE_MOBILE_INSTEAD") : t("CS_LOGIN_REGISTER_WITH_EMAIL");
  }, [isEmail, t]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.InputCard, {
    t: t,
    texts: config === null || config === void 0 ? void 0 : config.texts,
    submit: true,
    onNext: handleSubmit,
    isDisable: isDisabled,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.FieldV1, {
        withoutLabel: true,
        charCount: true,
        error: error,
        onChange: handleChange,
        placeholder: isEmail ? t("ENTER_EMAIL_PLACEHOLDER") : t("ENTER_MOBILE_PLACEHOLDER"),
        populators: {
          name: isEmail ? "userName" : "mobileNumber",
          prefix: isEmail ? "" : core_mobile_config === null || core_mobile_config === void 0 ? void 0 : core_mobile_config.mobilePrefix,
          validation: {
            maxlength: isEmail ? 256 : (core_mobile_config === null || core_mobile_config === void 0 ? void 0 : core_mobile_config.mobileNumberLength) || 10,
            pattern: isEmail ? EMAIL_REGEX : mobileNumberPattern
          }
        },
        props: {
          fieldStyle: {
            width: "100%"
          }
        },
        type: "text",
        value: isEmail ? emailId : mobileNumber
      }, isEmail ? "email" : "mobile")
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      style: {
        display: "flex",
        alignItems: "center",
        gap: "1rem",
        marginBottom: "1.5rem",
        marginTop: "-24px"
      },
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.LinkLabel, {
        style: _objectSpread({
          display: "inline"
        }, mobileViewStyles),
        onClick: switchMode,
        children: linkLabel
      })
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SelectMobileNumber);

/***/ }),

/***/ "./src/pages/citizen/Login/SelectName.js":
/*!***********************************************!*\
  !*** ./src/pages/citizen/Login/SelectName.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");



var SelectName = _ref => {
  var {
    config,
    onSelect,
    t,
    isDisabled
  } = _ref;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.FormStep, {
    config: config,
    onSelect: onSelect,
    t: t,
    isDisabled: isDisabled
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SelectName);

/***/ }),

/***/ "./src/pages/citizen/Login/SelectOtp.js":
/*!**********************************************!*\
  !*** ./src/pages/citizen/Login/SelectOtp.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _hooks_useInterval__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../hooks/useInterval */ "./src/hooks/useInterval.js");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");





var SelectOtp = _ref => {
  var {
    config,
    otp,
    onOtpChange,
    onResend,
    onSelect,
    t,
    error,
    userType = "citizen",
    canSubmit
  } = _ref;
  var [timeLeft, setTimeLeft] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(30);
  (0,_hooks_useInterval__WEBPACK_IMPORTED_MODULE_2__["default"])(() => {
    setTimeLeft(timeLeft - 1);
  }, timeLeft > 0 ? 1000 : null);
  var handleResendOtp = () => {
    onResend();
    setTimeLeft(2);
  };
  if (userType === "employee") {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_3__.OTPInput, {
        length: 6,
        onChange: onOtpChange,
        value: otp
      }), timeLeft > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardText, {
        children: "".concat(t("CS_RESEND_ANOTHER_OTP"), " ").concat(timeLeft, " ").concat(t("CS_RESEND_SECONDS"))
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
        className: "card-text-button resend-otp",
        onClick: handleResendOtp,
        children: t("CS_RESEND_OTP")
      }), !error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabelError, {
        children: t("CS_INVALID_OTP")
      })]
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.FormStep, {
    onSelect: onSelect,
    config: config,
    t: t,
    isDisabled: !((otp === null || otp === void 0 ? void 0 : otp.length) === 6 && canSubmit),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_3__.OTPInput, {
      length: 6,
      onChange: onOtpChange,
      value: otp
    }), timeLeft > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardText, {
      children: "".concat(t("CS_RESEND_ANOTHER_OTP"), " ").concat(timeLeft, " ").concat(t("CS_RESEND_SECONDS"))
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
      className: "card-text-button",
      onClick: handleResendOtp,
      children: t("CS_RESEND_OTP")
    }), !error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CardLabelError, {
      children: t("CS_INVALID_OTP")
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SelectOtp);

/***/ }),

/***/ "./src/pages/citizen/Login/config.js":
/*!*******************************************!*\
  !*** ./src/pages/citizen/Login/config.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   loginSteps: () => (/* binding */ loginSteps)
/* harmony export */ });
var loginSteps = [{
  texts: {
    header: "CS_LOGIN_PROVIDE_MOBILE_NUMBER",
    cardText: "CS_LOGIN_TEXT",
    nextText: "CS_COMMONS_NEXT",
    submitBarLabel: "CS_COMMONS_NEXT"
  },
  inputs: [{
    label: "CORE_COMMON_MOBILE_NUMBER",
    type: "text",
    name: "mobileNumber",
    error: "ERR_HRMS_INVALID_MOB_NO",
    validation: {
      required: true,
      minlength: 10,
      maxlength: 10
    }
  }]
}, {
  texts: {
    header: "CS_LOGIN_OTP",
    cardText: "CS_LOGIN_OTP_TEXT",
    nextText: "CS_COMMONS_NEXT",
    submitBarLabel: "CS_COMMONS_NEXT"
  }
}, {
  texts: {
    header: "CS_LOGIN_PROVIDE_NAME",
    cardText: "CS_LOGIN_NAME_TEXT",
    nextText: "CS_COMMONS_NEXT",
    submitBarLabel: "CS_COMMONS_NEXT"
  },
  inputs: [{
    label: "CORE_COMMON_NAME",
    type: "text",
    name: "name",
    error: "CORE_COMMON_NAME_VALIDMSG",
    validation: {
      required: true,
      minlength: 1,
      maxlength: 50,
      // pattern: /^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i,
      // pattern: /^(?!\s)[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}(?!\s)$/i
      pattern: "^[A-Za-z]+( [A-Za-z]+)*$"
    }
  }]
}];

/***/ }),

/***/ "./src/pages/citizen/Login/index.js":
/*!******************************************!*\
  !*** ./src/pages/citizen/Login/index.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ "./src/pages/citizen/Login/config.js");
/* harmony import */ var _SelectMobileNumber__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SelectMobileNumber */ "./src/pages/citizen/Login/SelectMobileNumber.js");
/* harmony import */ var _SelectName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectName */ "./src/pages/citizen/Login/SelectName.js");
/* harmony import */ var _SelectOtp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectOtp */ "./src/pages/citizen/Login/SelectOtp.js");
/* harmony import */ var _IndividualLogin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./IndividualLogin */ "./src/pages/citizen/Login/IndividualLogin.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["ResponseInfo", "UserRequest"],
  _excluded2 = ["ResponseInfo", "UserRequest"];
var _window;
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }










var TYPE_REGISTER = {
  type: "register"
};
var TYPE_LOGIN = {
  type: "login"
};
var DEFAULT_USER = "digit-user";
var DEFAULT_REDIRECT_URL = "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/citizen");

/* set citizen details to enable backward compatible */
var setCitizenDetail = (userObject, token, tenantId) => {
  var _JSON$parse;
  if (Digit.Utils.getMultiRootTenant()) {
    return;
  }
  var locale = (_JSON$parse = JSON.parse(sessionStorage.getItem("Digit.initData"))) === null || _JSON$parse === void 0 || (_JSON$parse = _JSON$parse.value) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.selectedLanguage;
  localStorage.setItem("Citizen.tenant-id", tenantId);
  localStorage.setItem("tenant-id", tenantId);
  localStorage.setItem("citizen.userRequestObject", JSON.stringify(userObject));
  localStorage.setItem("locale", locale);
  localStorage.setItem("Citizen.locale", locale);
  localStorage.setItem("token", token);
  localStorage.setItem("Citizen.token", token);
  localStorage.setItem("user-info", JSON.stringify(userObject));
  localStorage.setItem("Citizen.user-info", JSON.stringify(userObject));
};
var getFromLocation = (state, searchParams) => {
  return (state === null || state === void 0 ? void 0 : state.from) || (searchParams === null || searchParams === void 0 ? void 0 : searchParams.from) || DEFAULT_REDIRECT_URL;
};
var Login = _ref => {
  var _window2, _window3, _location$state, _location$state7;
  var {
    stateCode,
    isUserRegistered = true
  } = _ref;
  // Check if individual should be used for login
  var useAnIndividual = (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.globalConfigs) === null || _window2 === void 0 ? void 0 : _window2.getConfig("USE_INDIVIDUAL_MODEL");
  var individualServicePath = (_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.globalConfigs) === null || _window3 === void 0 ? void 0 : _window3.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");

  // If useAnIndividual exists, use IndividualLogin component
  if (useAnIndividual && individualServicePath) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_IndividualLogin__WEBPACK_IMPORTED_MODULE_8__["default"], {
      stateCode: stateCode,
      isUserRegistered: isUserRegistered
    });
  }

  // Otherwise, continue with standard login flow
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)(); // Replaced useHistory with useNavigate
  // useRouteMatch is removed in v6. Path matching is handled by Routes/Route.
  // `path` and `url` were used for constructing sub-routes. In v6, paths are often relative.
  var [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  var [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  var [isOtpValid, setIsOtpValid] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
  var [params, setParams] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(isUserRegistered ? {} : location === null || location === void 0 || (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.data);
  var [errorTO, setErrorTO] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  var searchParams = Digit.Hooks.useQueryParams();
  var [canSubmitName, setCanSubmitName] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  var [canSubmitOtp, setCanSubmitOtp] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
  var [canSubmitNo, setCanSubmitNo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    var errorTimeout;
    if (error) {
      if (errorTO) {
        clearTimeout(errorTO);
        setErrorTO(null);
      }
      errorTimeout = setTimeout(() => {
        setError("");
      }, 5000);
      setErrorTO(errorTimeout);
    }
    return () => {
      errorTimeout && clearTimeout(errorTimeout);
    };
  }, [error]);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    var _location$state2;
    if (!user) {
      return;
    }
    Digit.SessionStorage.set("citizen.userRequestObject", user);
    Digit.UserService.setUser(user);
    setCitizenDetail(user === null || user === void 0 ? void 0 : user.info, user === null || user === void 0 ? void 0 : user.access_token, stateCode);
    var redirectPath = ((_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.from) || DEFAULT_REDIRECT_URL;
    if (!Digit.ULBService.getCitizenCurrentTenant(true)) {
      var _window4;
      navigate("/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/citizen/select-location"), {
        state: {
          redirectBackTo: redirectPath
        },
        replace: true
      });
    } else {
      navigate(redirectPath, {
        replace: true
      });
    }
  }, [user]);
  var stepItems = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => _config__WEBPACK_IMPORTED_MODULE_4__.loginSteps.map(step => {
    var texts = {};
    for (var key in step.texts) {
      texts[key] = t(step.texts[key]);
    }
    return _objectSpread(_objectSpread({}, step), {}, {
      texts
    });
  }), [_config__WEBPACK_IMPORTED_MODULE_4__.loginSteps]);
  var getUserType = () => "citizen" || 0;
  var handleOtpChange = otp => {
    setParams(_objectSpread(_objectSpread({}, params), {}, {
      otp
    }));
  };
  var handleMobileChange = event => {
    var {
      value
    } = event.target;
    setParams(_objectSpread(_objectSpread({}, params), {}, {
      mobileNumber: value
    }));
  };
  var selectMobileNumber = /*#__PURE__*/function () {
    var _ref2 = _asyncToGenerator(function* (mobileNumber) {
      setCanSubmitNo(false);
      setParams(_objectSpread(_objectSpread({}, params), mobileNumber));
      var data = _objectSpread(_objectSpread({}, mobileNumber), {}, {
        tenantId: stateCode,
        userType: getUserType()
      });
      if (isUserRegistered) {
        var _location$state4;
        var [res, err] = yield sendOtp({
          otp: _objectSpread(_objectSpread({}, data), TYPE_LOGIN)
        });
        if (!err) {
          var _location$state3;
          setCanSubmitNo(true);
          // Use relative path for navigation, `.` means current base path
          navigate("otp", {
            state: {
              from: getFromLocation(location.state, searchParams),
              role: (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.role
            },
            replace: true
          });
          return;
        } else {
          setCanSubmitNo(true);
          if (!(location.state && location.state.role === "FSM_DSO")) {
            var _window5;
            // Use absolute path if navigating outside the current route's scope, or relative if it's a sibling route
            navigate("/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.contextPath, "/citizen/register/name"), {
              state: {
                from: getFromLocation(location.state, searchParams),
                data: data
              }
            });
          }
        }
        if ((_location$state4 = location.state) !== null && _location$state4 !== void 0 && _location$state4.role) {
          var _location$state5;
          setCanSubmitNo(true);
          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.");
        }
      } else {
        var [_res, _err] = yield sendOtp({
          otp: _objectSpread(_objectSpread({}, data), TYPE_REGISTER)
        });
        if (!_err) {
          setCanSubmitNo(true);
          navigate("otp", {
            state: {
              from: getFromLocation(location.state, searchParams)
            },
            replace: true
          });
          return;
        }
        setCanSubmitNo(true);
      }
    });
    return function selectMobileNumber(_x) {
      return _ref2.apply(this, arguments);
    };
  }();
  var selectName = /*#__PURE__*/function () {
    var _ref3 = _asyncToGenerator(function* (name) {
      var data = _objectSpread(_objectSpread({}, params), {}, {
        tenantId: stateCode,
        userType: getUserType()
      }, name);
      setParams(_objectSpread(_objectSpread({}, params), name));
      setCanSubmitName(true);
      var [res, err] = yield sendOtp({
        otp: _objectSpread(_objectSpread({}, data), TYPE_REGISTER)
      });
      if (res) {
        setCanSubmitName(false);
        navigate("otp", {
          state: {
            from: getFromLocation(location.state, searchParams)
          },
          replace: true
        });
      } else {
        setCanSubmitName(false);
      }
    });
    return function selectName(_x2) {
      return _ref3.apply(this, arguments);
    };
  }();
  var selectOtp = /*#__PURE__*/function () {
    var _ref4 = _asyncToGenerator(function* () {
      try {
        setIsOtpValid(true);
        setCanSubmitOtp(false);
        var {
          mobileNumber,
          otp,
          name
        } = params;
        if (isUserRegistered) {
          var _location$state6, _window6;
          var requestData = {
            username: mobileNumber,
            password: otp,
            tenantId: stateCode,
            userType: getUserType()
          };
          var _yield$Digit$UserServ = yield Digit.UserService.authenticate(requestData),
            {
              ResponseInfo,
              UserRequest: info
            } = _yield$Digit$UserServ,
            tokens = _objectWithoutProperties(_yield$Digit$UserServ, _excluded);
          if ((_location$state6 = location.state) !== null && _location$state6 !== void 0 && _location$state6.role) {
            var roleInfo = info.roles.find(userRole => userRole.code === location.state.role);
            if (!roleInfo || !roleInfo.code) {
              setError(t("ES_ERROR_USER_NOT_PERMITTED"));
              // navigate also handles timeouts for redirects
              setTimeout(() => navigate(DEFAULT_REDIRECT_URL, {
                replace: true
              }), 5000);
              return;
            }
          }
          if ((_window6 = window) !== null && _window6 !== void 0 && (_window6 = _window6.globalConfigs) !== null && _window6 !== void 0 && _window6.getConfig("ENABLE_SINGLEINSTANCE")) {
            info.tenantId = Digit.ULBService.getStateId();
          }
          setUser(_objectSpread({
            info
          }, tokens));
        } else if (!isUserRegistered) {
          var _window7;
          var _requestData = {
            name,
            username: mobileNumber,
            otpReference: otp,
            tenantId: stateCode
          };
          var _yield$Digit$UserServ2 = yield Digit.UserService.registerUser(_requestData, stateCode),
            {
              ResponseInfo: _ResponseInfo,
              UserRequest: _info
            } = _yield$Digit$UserServ2,
            tokens = _objectWithoutProperties(_yield$Digit$UserServ2, _excluded2);
          if ((_window7 = window) !== null && _window7 !== void 0 && (_window7 = _window7.globalConfigs) !== null && _window7 !== void 0 && _window7.getConfig("ENABLE_SINGLEINSTANCE")) {
            _info.tenantId = Digit.ULBService.getStateId();
          }
          setUser(_objectSpread({
            info: _info
          }, tokens));
        }
      } catch (err) {
        setCanSubmitOtp(true);
        setIsOtpValid(false);
      }
    });
    return function selectOtp() {
      return _ref4.apply(this, arguments);
    };
  }();
  var resendOtp = /*#__PURE__*/function () {
    var _ref5 = _asyncToGenerator(function* () {
      var {
        mobileNumber
      } = params;
      var data = {
        mobileNumber,
        tenantId: stateCode,
        userType: getUserType()
      };
      if (!isUserRegistered) {
        var [res, err] = yield sendOtp({
          otp: _objectSpread(_objectSpread({}, data), TYPE_REGISTER)
        });
      } else if (isUserRegistered) {
        var [_res2, _err2] = yield sendOtp({
          otp: _objectSpread(_objectSpread({}, data), TYPE_LOGIN)
        });
      }
    });
    return function resendOtp() {
      return _ref5.apply(this, arguments);
    };
  }();
  var sendOtp = /*#__PURE__*/function () {
    var _ref6 = _asyncToGenerator(function* (data) {
      try {
        var res = yield Digit.UserService.sendOtp(data, stateCode);
        return [res, null];
      } catch (err) {
        return [null, err];
      }
    });
    return function sendOtp(_x3) {
      return _ref6.apply(this, arguments);
    };
  }();
  var isCitizenDesktop = window.location.href.includes("citizen") && !window.Digit.Utils.browser.isMobile();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
    className: "citizen-form-wrapper".concat(isCitizenDesktop ? ' citizen-form-center' : ''),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.AppContainer, {
      children: [location.pathname.includes("login") ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackLink, {
        onClick: () => navigate(-1)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Routes, {
        children: [" ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "/" // This will match the base path where this component is rendered (e.g., /citizen/login if mounted there)
          ,
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_SelectMobileNumber__WEBPACK_IMPORTED_MODULE_5__["default"], {
            onSelect: selectMobileNumber,
            config: stepItems[0],
            mobileNumber: params.mobileNumber || "",
            onMobileChange: handleMobileChange,
            canSubmit: canSubmitNo,
            showRegisterLink: isUserRegistered && !((_location$state7 = location.state) !== null && _location$state7 !== void 0 && _location$state7.role),
            t: t
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "otp" // This will match /path/to/current/route/otp
          ,
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_SelectOtp__WEBPACK_IMPORTED_MODULE_7__["default"], {
            config: _objectSpread(_objectSpread({}, stepItems[1]), {}, {
              texts: _objectSpread(_objectSpread({}, stepItems[1].texts), {}, {
                cardText: "".concat(stepItems[1].texts.cardText, " ").concat(params.mobileNumber || "")
              })
            }),
            onOtpChange: handleOtpChange,
            onResend: resendOtp,
            onSelect: selectOtp,
            otp: params.otp,
            error: isOtpValid,
            canSubmit: canSubmitOtp,
            t: t
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "name" // This will match /path/to/current/route/name
          ,
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_SelectName__WEBPACK_IMPORTED_MODULE_6__["default"], {
            config: stepItems[2],
            onSelect: selectName,
            t: t,
            isDisabled: canSubmitName
          })
        }), error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Toast, {
          type: "error",
          label: error,
          onClose: () => setError(null)
        })]
      })]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Login);

/***/ }),

/***/ "./src/pages/citizen/SearchApp.js":
/*!****************************************!*\
  !*** ./src/pages/citizen/SearchApp.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_Search__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../components/Search */ "./src/components/Search/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }




var Search = _ref => {
  var _data$ElasticSearchDa, _data$ElasticSearchDa2;
  var {
    path
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var tenantId = Digit.ULBService.getCitizenCurrentTenant();
  var [payload, setPayload] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
  var convertDateToEpoch = function convertDateToEpoch(dateString) {
    var dayStartOrEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "dayend";
    //example input format : "2018-10-02"
    try {
      var parts = dateString.match(/(\d{4})-(\d{1,2})-(\d{1,2})/);
      var DateObj = new Date(Date.UTC(parts[1], parts[2] - 1, parts[3]));
      DateObj.setMinutes(DateObj.getMinutes() + DateObj.getTimezoneOffset());
      if (dayStartOrEnd === "dayend") {
        DateObj.setHours(DateObj.getHours() + 24);
        DateObj.setSeconds(DateObj.getSeconds() - 1);
      }
      return DateObj.getTime();
    } catch (e) {
      return dateString;
    }
  };
  function onSubmit(_data) {
    Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL", {
      offset: 0,
      limit: 5,
      sortBy: "commencementDate",
      sortOrder: "DESC"
    });
    var data = _objectSpread(_objectSpread({}, _data), {}, {
      fromDate: convertDateToEpoch(_data === null || _data === void 0 ? void 0 : _data.fromDate),
      toDate: convertDateToEpoch(_data === null || _data === void 0 ? void 0 : _data.toDate)
    });
    setPayload(Object.keys(data).filter(k => data[k]).reduce((acc, key) => _objectSpread(_objectSpread({}, acc), {}, {
      [key]: typeof data[key] === "object" ? data[key] : data[key]
    }), {}));
  }
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    var storedPayload = Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL") || {};
    if (storedPayload) {
      var _data2 = _objectSpread({}, storedPayload);
      setPayload(Object.keys(_data2).filter(k => _data2[k]).reduce((acc, key) => _objectSpread(_objectSpread({}, acc), {}, {
        [key]: typeof _data2[key] === "object" ? _data2[key].code : _data2[key]
      }), {}));
    }
  }, []);
  var config = {
    enabled: !!(payload && Object.keys(payload).length > 0)
  };
  var newObj = _objectSpread({}, payload);
  var {
    isLoading,
    data
  } = Digit.Hooks.useAudit({
    tenantId,
    filters: _objectSpread({}, newObj),
    config
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_components_Search__WEBPACK_IMPORTED_MODULE_2__["default"], {
    t: t,
    tenantId: tenantId,
    onSubmit: onSubmit,
    data: !isLoading ? (data === null || data === void 0 || (_data$ElasticSearchDa = data.ElasticSearchData) === null || _data$ElasticSearchDa === void 0 ? void 0 : _data$ElasticSearchDa.length) > 0 ? data === null || data === void 0 ? void 0 : data.ElasticSearchData : {
      display: "ES_COMMON_NO_DATA"
    } : "",
    count: data === null || data === void 0 || (_data$ElasticSearchDa2 = data.ElasticSearchData) === null || _data$ElasticSearchDa2 === void 0 ? void 0 : _data$ElasticSearchDa2.length
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Search);

/***/ }),

/***/ "./src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js":
/*!***********************************************************************!*\
  !*** ./src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var StaticDynamicCard = _ref => {
  var _mdmsData$MdmsRes$com, _mdmsConfigResult$hel, _mdmsConfigResult$hel2, _mdmsConfigResult$hel3, _mdmsConfigResult$hel4, _mdmsConfigResult$hel5, _mdmsConfigResult$hel6, _staticData, _staticData2, _staticData3, _staticData4, _staticData5, _staticContent, _staticContent2, _staticContent3;
  var {
    moduleCode
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var tenantId = Digit.ULBService.getCitizenCurrentTenant();
  var {
    isLoading: isMdmsLoading,
    data: mdmsData
  } = Digit.Hooks.useStaticData(Digit.ULBService.getStateId());
  var {
    isLoading: isSearchLoading,
    error,
    data: dynamicData,
    isSuccess
  } = Digit.Hooks.useDynamicData({
    moduleCode,
    tenantId: tenantId,
    filters: {},
    t
  });
  var handleClickOnWhatsApp = obj => {
    window.open(obj);
  };
  var IconComponent = _ref2 => {
    var {
      module,
      styles
    } = _ref2;
    switch (module) {
      case "TL":
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CaseIcon, {
          className: "fill-path-primary-main",
          styles: styles
        });
      case "PT":
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.PTIcon, {
          className: "fill-path-primary-main",
          styles: styles
        });
      case "MCOLLECT":
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.MCollectIcon, {
          className: "fill-path-primary-main",
          styles: styles
        });
      case "PGR":
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ComplaintIcon, {
          className: "fill-path-primary-main",
          styles: styles
        });
      default:
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CaseIcon, {
          className: "fill-path-primary-main",
          styles: styles
        });
    }
  };
  var mdmsConfigResult = mdmsData === null || mdmsData === void 0 || (_mdmsData$MdmsRes$com = mdmsData.MdmsRes["common-masters"]) === null || _mdmsData$MdmsRes$com === void 0 || (_mdmsData$MdmsRes$com = _mdmsData$MdmsRes$com.StaticData[0]) === null || _mdmsData$MdmsRes$com === void 0 ? void 0 : _mdmsData$MdmsRes$com["".concat(moduleCode)];
  var StaticDataIconComponentOne = _ref3 => {
    var {
      module
    } = _ref3;
    switch (module) {
      case "PT":
      case "WS":
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
          className: "timerIcon",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TimerIcon, {})
        });
      default:
        return null;
    }
  };
  var StaticDataIconComponentTwo = _ref4 => {
    var {
      module
    } = _ref4;
    switch (module) {
      case "PT":
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
          className: "rupeeSymbol",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.RupeeSymbol, {})
        });
      case "WS":
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
          className: "timerIcon",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.TimerIcon, {})
        });
      default:
        return null;
    }
  };
  var staticContent = module => {
    switch (module) {
      case "TL":
      case "PT":
      case "MCOLLECT":
        return {
          staticCommonContent: t("COMMON_VALIDITY"),
          validity: (mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.validity) + ((mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.validity) === "1" ? t("COMMON_DAY") : t("COMMON_DAYS"))
        };
      case "PGR":
        return {
          staticCommonContent: t("ACTION_TEST_COMPLAINT_TYPES")
        };
      case "OBPS":
        return {
          staticCommonContent: t("BUILDING_PLAN_PERMIT_VALIDITY"),
          validity: (mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.validity) + " " + ((mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.validity) === "1" ? t("COMMON_DAY") : t("COMMON_DAYS"))
        };
      default:
        return {
          staticCommonContent: ""
        };
    }
  };
  var staticData = module => {
    switch (module) {
      case "PT":
        return {
          staticDataOne: (mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.staticDataOne) + " " + t("COMMON_DAYS"),
          staticDataOneHeader: t("APPLICATION_PROCESSING_TIME"),
          staticDataTwo: mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.staticDataTwo,
          staticDataTwoHeader: t("APPLICATION_PROCESSING_FEE")
        };
      case "WS":
        return {
          staticDataOne: "",
          staticDataOneHeader: t("PAY_WATER_CHARGES_BY") + " " + (mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.staticDataOne) + " " + t("COMMON_DAYS") + " " + t("OF_BILL_GEN_TO_AVOID_LATE_FEE"),
          staticDataTwo: (mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.staticDataTwo) + " " + t("COMMON_DAYS"),
          staticDataTwoHeader: t("APPLICATION_PROCESSING_TIME")
        };
      default:
        return {};
    }
  };
  if (isMdmsLoading || isSearchLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {});
  }
  return mdmsConfigResult ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), {
    children: [mdmsConfigResult && mdmsConfigResult !== null && mdmsConfigResult !== void 0 && mdmsConfigResult.payViaWhatsApp ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
      style: {
        margin: "16px",
        padding: "16px",
        maxWidth: "unset"
      },
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
        className: "pay-whatsapp-card",
        onClick: () => handleClickOnWhatsApp(mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.payViaWhatsApp),
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "pay-whatsapp-text",
          children: t("PAY_VIA_WHATSAPP")
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "whatsAppIconG",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.WhatsappIconGreen, {})
        })]
      })
    }) : null, mdmsConfigResult && mdmsConfigResult !== null && mdmsConfigResult !== void 0 && mdmsConfigResult.helpline ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
      style: {
        margin: "16px",
        padding: "16px",
        maxWidth: "unset"
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
        className: "static-home-Card",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "static-home-Card-header",
          children: t("CALL_CENTER_HELPLINE")
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "helplineIcon",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.HelpLineIcon, {})
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
        className: "call-center-card-text",
        children: [mdmsConfigResult !== null && mdmsConfigResult !== void 0 && (_mdmsConfigResult$hel = mdmsConfigResult.helpline) !== null && _mdmsConfigResult$hel !== void 0 && _mdmsConfigResult$hel.contactOne ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "call-center-card-content",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("a", {
            href: "tel:".concat(mdmsConfigResult === null || mdmsConfigResult === void 0 || (_mdmsConfigResult$hel2 = mdmsConfigResult.helpline) === null || _mdmsConfigResult$hel2 === void 0 ? void 0 : _mdmsConfigResult$hel2.contactOne),
            children: mdmsConfigResult === null || mdmsConfigResult === void 0 || (_mdmsConfigResult$hel3 = mdmsConfigResult.helpline) === null || _mdmsConfigResult$hel3 === void 0 ? void 0 : _mdmsConfigResult$hel3.contactOne
          })
        }) : null, mdmsConfigResult !== null && mdmsConfigResult !== void 0 && (_mdmsConfigResult$hel4 = mdmsConfigResult.helpline) !== null && _mdmsConfigResult$hel4 !== void 0 && _mdmsConfigResult$hel4.contactTwo ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "call-center-card-content",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("a", {
            href: "tel:".concat(mdmsConfigResult === null || mdmsConfigResult === void 0 || (_mdmsConfigResult$hel5 = mdmsConfigResult.helpline) === null || _mdmsConfigResult$hel5 === void 0 ? void 0 : _mdmsConfigResult$hel5.contactTwo),
            children: mdmsConfigResult === null || mdmsConfigResult === void 0 || (_mdmsConfigResult$hel6 = mdmsConfigResult.helpline) === null || _mdmsConfigResult$hel6 === void 0 ? void 0 : _mdmsConfigResult$hel6.contactTwo
          })
        }) : null]
      })]
    }) : null, mdmsConfigResult && mdmsConfigResult !== null && mdmsConfigResult !== void 0 && mdmsConfigResult.serviceCenter ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
      style: {
        margin: "16px",
        padding: "16px",
        maxWidth: "unset"
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
        className: "static-home-Card",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "static-home-Card-header",
          children: t("CITIZEN_SERVICE_CENTER")
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "serviceCentrIcon",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ServiceCenterIcon, {})
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "service-center-details-card",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "service-center-details-text",
          children: mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.serviceCenter
        })
      }), mdmsConfigResult !== null && mdmsConfigResult !== void 0 && mdmsConfigResult.viewMapLocation ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "link",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("a", {
          href: mdmsConfigResult === null || mdmsConfigResult === void 0 ? void 0 : mdmsConfigResult.viewMapLocation,
          children: t("VIEW_ON_MAP")
        })
      }) : null]
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
      style: {
        margin: "16px",
        padding: "16px",
        maxWidth: "unset"
      },
      children: [error || dynamicData == null || (dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.dynamicDataOne) === null ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "dynamicDataCard",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
          className: "dynamicData",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(IconComponent, {
            module: moduleCode,
            styles: {
              width: "24px",
              height: "24px"
            }
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
            className: "dynamicData-content",
            children: dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.dynamicDataOne
          })]
        })
      }), error || dynamicData == null || (dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.dynamicDataTwo) === null ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "dynamicDataCard",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
          className: "dynamicData",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(IconComponent, {
            module: moduleCode,
            styles: {
              width: "24px",
              height: "24px"
            }
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
            className: "dynamicData-content",
            children: dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.dynamicDataTwo
          })]
        })
      }), mdmsConfigResult && mdmsConfigResult !== null && mdmsConfigResult !== void 0 && mdmsConfigResult.staticDataOne ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "staticDataCard",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
          className: "staticData",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(StaticDataIconComponentOne, {
            module: moduleCode
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
            className: "static-data-content",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
              className: "static-data-content-first",
              style: {
                marginTop: ((_staticData = staticData(moduleCode)) === null || _staticData === void 0 ? void 0 : _staticData.staticDataOne) === "" ? "8px" : "unset"
              },
              children: (_staticData2 = staticData(moduleCode)) === null || _staticData2 === void 0 ? void 0 : _staticData2.staticDataOneHeader
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
              className: "static-data-content-second",
              children: "".concat((_staticData3 = staticData(moduleCode)) === null || _staticData3 === void 0 ? void 0 : _staticData3.staticDataOne)
            })]
          })]
        })
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {}), mdmsConfigResult && mdmsConfigResult !== null && mdmsConfigResult !== void 0 && mdmsConfigResult.staticDataTwo ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "staticDataCard",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
          className: "staticData",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(StaticDataIconComponentTwo, {
            module: moduleCode
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
            className: "static-data-content",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
              className: "static-data-content-first",
              children: (_staticData4 = staticData(moduleCode)) === null || _staticData4 === void 0 ? void 0 : _staticData4.staticDataTwoHeader
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
              className: "static-data-content-second",
              children: (_staticData5 = staticData(moduleCode)) === null || _staticData5 === void 0 ? void 0 : _staticData5.staticDataTwo
            })]
          })]
        })
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {}), mdmsConfigResult && mdmsConfigResult !== null && mdmsConfigResult !== void 0 && mdmsConfigResult.validity ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "staticDataCard",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
          className: "staticData",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
            className: "validityIcon",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ValidityTimeIcon, {})
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
            className: "static-data-content",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
              className: "static-data-content-first",
              children: (_staticContent = staticContent(moduleCode)) === null || _staticContent === void 0 ? void 0 : _staticContent.staticCommonContent
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
              className: "static-data-content-second",
              children: (_staticContent2 = staticContent(moduleCode)) === null || _staticContent2 === void 0 ? void 0 : _staticContent2.validity
            })]
          })]
        })
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {}), error || dynamicData == null || !(dynamicData !== null && dynamicData !== void 0 && dynamicData.staticData) || (dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.staticData) === null ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "staticDataCard",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
          className: "staticData",
          children: [moduleCode === "PGR" ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(IconComponent, {
            module: moduleCode,
            styles: {
              width: "24px",
              height: "24px",
              marginLeft: "13px",
              marginTop: "12px"
            }
          }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
            className: "validityIcon",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.ValidityTimeIcon, {})
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
            className: "static-data-content",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
              className: "static-data-content-first",
              children: (_staticContent3 = staticContent(moduleCode)) === null || _staticContent3 === void 0 ? void 0 : _staticContent3.staticCommonContent
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
              className: "static-data-content-second",
              children: dynamicData === null || dynamicData === void 0 ? void 0 : dynamicData.staticData
            })]
          })]
        })
      })]
    })]
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), {});
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StaticDynamicCard);

/***/ }),

/***/ "./src/pages/citizen/index.js":
/*!************************************!*\
  !*** ./src/pages/citizen/index.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_ErrorBoundaries__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../components/ErrorBoundaries */ "./src/components/ErrorBoundaries.js");
/* harmony import */ var _components_Home__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../components/Home */ "./src/components/Home.js");
/* harmony import */ var _components_TopBarSideBar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../components/TopBarSideBar */ "./src/components/TopBarSideBar/index.js");
/* harmony import */ var _components_TopBarSideBar_SideBar_CitizenSideNav__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/TopBarSideBar/SideBar/CitizenSideNav */ "./src/components/TopBarSideBar/SideBar/CitizenSideNav.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var _components_DynamicModuleLoader__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/DynamicModuleLoader */ "./src/components/DynamicModuleLoader.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _window, _window2, _window3, _window4, _window5;












// Create lazy components with fallbacks using the utility

var ErrorComponent = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ../../components/ErrorComponent */ "./src/components/ErrorComponent.js")), () => (__webpack_require__(/*! ../../components/ErrorComponent */ "./src/components/ErrorComponent.js")["default"]), {
  loaderText: "CORE_LOADING_ERROR_COMPONENT"
});
var FAQsSection = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./FAQs/FAQs */ "./src/pages/citizen/FAQs/FAQs.js")), () => (__webpack_require__(/*! ./FAQs/FAQs */ "./src/pages/citizen/FAQs/FAQs.js")["default"]), {
  loaderText: "CORE_LOADING_FAQS"
});
var CitizenHome = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Home */ "./src/pages/citizen/Home/index.js")), () => (__webpack_require__(/*! ./Home */ "./src/pages/citizen/Home/index.js")["default"]), {
  loaderText: "CORE_LOADING_HOME"
});
var LanguageSelection = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Home/LanguageSelection */ "./src/pages/citizen/Home/LanguageSelection.js")), () => (__webpack_require__(/*! ./Home/LanguageSelection */ "./src/pages/citizen/Home/LanguageSelection.js")["default"]), {
  loaderText: "CORE_LOADING_LANGUAGE_SELECTION"
});
var LocationSelection = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Home/LocationSelection */ "./src/pages/citizen/Home/LocationSelection.js")), () => (__webpack_require__(/*! ./Home/LocationSelection */ "./src/pages/citizen/Home/LocationSelection.js")["default"]), {
  loaderText: "CORE_LOADING_LOCATION_SELECTION"
});
var UserProfile = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Home/UserProfile */ "./src/pages/citizen/Home/UserProfile.js")), () => (__webpack_require__(/*! ./Home/UserProfile */ "./src/pages/citizen/Home/UserProfile.js")["default"]), {
  loaderText: "CORE_LOADING_USER_PROFILE"
});
var HowItWorks = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./HowItWorks/howItWorks */ "./src/pages/citizen/HowItWorks/howItWorks.js")), () => (__webpack_require__(/*! ./HowItWorks/howItWorks */ "./src/pages/citizen/HowItWorks/howItWorks.js")["default"]), {
  loaderText: "CORE_LOADING_HOW_IT_WORKS"
});
var Login = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Login */ "./src/pages/citizen/Login/index.js")), () => (__webpack_require__(/*! ./Login */ "./src/pages/citizen/Login/index.js")["default"]), {
  loaderText: "CORE_LOADING_LOGIN"
});
var Search = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./SearchApp */ "./src/pages/citizen/SearchApp.js")), () => (__webpack_require__(/*! ./SearchApp */ "./src/pages/citizen/SearchApp.js")["default"]), {
  loaderText: "CORE_LOADING_SEARCH"
});
var StaticDynamicCard = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./StaticDynamicComponent/StaticDynamicCard */ "./src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js")), () => (__webpack_require__(/*! ./StaticDynamicComponent/StaticDynamicCard */ "./src/pages/citizen/StaticDynamicComponent/StaticDynamicCard.js")["default"]), {
  loaderText: "CORE_LOADING_DYNAMIC_CONTENT"
});
var sidebarHiddenFor = ["".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/citizen/register/name"), "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/citizen/select-language"), "/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/citizen/select-location"), "/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/citizen/login"), "/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.contextPath, "/citizen/register/otp")];
var getTenants = (codes, tenants) => {
  return tenants.filter(tenant => codes.map(item => item.code).includes(tenant.code));
};
var Home = _ref => {
  var _window7, _window7$getConfig;
  var {
    stateInfo,
    userDetails,
    CITIZEN,
    cityDetails,
    mobileView,
    handleUserDropdownSelection,
    logoUrl,
    DSO,
    stateCode,
    modules,
    appTenants,
    sourceUrl,
    // This prop seems unused, consider removing
    pathname,
    // This prop seems unused, `useLocation().pathname` is used directly
    initData
  } = _ref;
  var {
    isLoading: islinkDataLoading,
    data: linkData,
    isFetched: isLinkDataFetched
  } = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), "ACCESSCONTROL-ACTIONS-TEST", [{
    name: "actions-test",
    filter: "[?(@.url == '".concat(Digit.Utils.getMultiRootTenant() ? window.globalPath : window.contextPath, "-card')]")
  }], {
    select: data => {
      var _data$ACCESSCONTROLA;
      var formattedData = data === null || data === void 0 || (_data$ACCESSCONTROLA = data["ACCESSCONTROL-ACTIONS-TEST"]) === null || _data$ACCESSCONTROLA === void 0 || (_data$ACCESSCONTROLA = _data$ACCESSCONTROLA["actions-test"]) === null || _data$ACCESSCONTROLA === void 0 ? void 0 : _data$ACCESSCONTROLA.filter(el => el.enabled === true).reduce((a, b) => {
        var _a$b$parentModule;
        a[b.parentModule] = ((_a$b$parentModule = a[b.parentModule]) === null || _a$b$parentModule === void 0 ? void 0 : _a$b$parentModule.length) > 0 ? [b, ...a[b.parentModule]] : [b];
        return a;
      }, {});
      return formattedData;
    }
  });
  var classname = Digit.Hooks.useRouteSubscription(pathname);
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  var handleClickOnWhatsApp = obj => {
    window.open(obj);
  };
  var hideSidebar = sidebarHiddenFor.some(e => window.location.href.includes(e));

  // Create app routes with dynamic module loading and loading states for citizen modules
  var appRoutes = modules.map((_ref2, index) => {
    var {
      code,
      tenants
    } = _ref2;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
      path: "".concat(code.toLowerCase(), "/*"),
      element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_DynamicModuleLoader__WEBPACK_IMPORTED_MODULE_9__["default"], {
        moduleCode: code,
        stateCode: stateCode,
        userType: "citizen",
        tenants: getTenants(tenants, appTenants),
        maxRetries: 3,
        retryDelay: 1000,
        initialDelay: 800
      })
    }, index);
  });
  var ModuleLevelLinkHomePages = modules.map((_ref3, index) => {
    var {
      code,
      bannerImage
    } = _ref3;
    var Links = Digit.ComponentRegistryService.getComponent("".concat(code, "Links")) || (() => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), {}));
    var mdmsDataObj = isLinkDataFetched ? (0,_components_Home__WEBPACK_IMPORTED_MODULE_5__.processLinkData)(linkData, code, t) : undefined;
    if ((mdmsDataObj === null || mdmsDataObj === void 0 ? void 0 : mdmsDataObj.header) === "ACTION_TEST_WS") {
      mdmsDataObj === null || mdmsDataObj === void 0 || mdmsDataObj.links.sort((a, b) => {
        return b.orderNumber - a.orderNumber;
      });
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
        path: "".concat(code.toLowerCase(), "-home"),
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
          className: "moduleLinkHomePage",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_8__["default"], {
            src: bannerImage || (stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl),
            alt: "noimagefound"
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackLink, {
            className: "moduleLinkHomePageBackButton",
            onClick: () => navigate(-1)
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("h1", {
            children: t("MODULE_" + code.toUpperCase())
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
            className: "moduleLinkHomePageModuleLinks",
            children: mdmsDataObj && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CitizenHomeCard, {
              header: t(mdmsDataObj === null || mdmsDataObj === void 0 ? void 0 : mdmsDataObj.header),
              links: mdmsDataObj === null || mdmsDataObj === void 0 ? void 0 : mdmsDataObj.links,
              Icon: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {}),
              Info: code === "OBPS" ? () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.CitizenInfoLabel, {
                style: {
                  margin: "0px",
                  padding: "10px"
                },
                info: t("CS_FILE_APPLICATION_INFO_LABEL"),
                text: t("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")
              }) : null,
              isInfo: code === "OBPS" ? true : false
            })
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(StaticDynamicCard, {
            moduleCode: code === null || code === void 0 ? void 0 : code.toUpperCase()
          })]
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
        path: "".concat(code.toLowerCase(), "-faq"),
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(FAQsSection, {
          module: code === null || code === void 0 ? void 0 : code.toUpperCase()
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
        path: "".concat(code.toLowerCase(), "-how-it-works"),
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(HowItWorks, {
          module: code === null || code === void 0 ? void 0 : code.toUpperCase()
        })
      })]
    }, code + "-routes");
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
    className: classname,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_TopBarSideBar__WEBPACK_IMPORTED_MODULE_6__["default"], {
      t: t,
      stateInfo: stateInfo,
      userDetails: userDetails,
      CITIZEN: CITIZEN,
      cityDetails: cityDetails,
      mobileView: mobileView,
      handleUserDropdownSelection: handleUserDropdownSelection,
      logoUrl: logoUrl,
      showSidebar: CITIZEN ? true : false,
      linkData: linkData,
      islinkDataLoading: islinkDataLoading
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "main center-container citizen-home-container mb-25",
      children: [hideSidebar ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_TopBarSideBar_SideBar_CitizenSideNav__WEBPACK_IMPORTED_MODULE_7__["default"], {
          linkData: linkData,
          islinkDataLoading: islinkDataLoading
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Routes, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "/",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(CitizenHome, {})
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "select-language",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(LanguageSelection, {})
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "select-location",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
            className: "citizen-location-selection-wrapper",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(LocationSelection, {})
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "error",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(ErrorComponent, {
            initData: initData,
            goToHome: () => {
              var _window6, _Digit, _Digit$getType;
              navigate("/".concat((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.contextPath, "/").concat((_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.UserService) === null || _Digit === void 0 || (_Digit$getType = _Digit.getType) === null || _Digit$getType === void 0 ? void 0 : _Digit$getType.call(_Digit)));
            }
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "all-services",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_Home__WEBPACK_IMPORTED_MODULE_5__.AppHome, {
            userType: "citizen",
            modules: modules,
            getCitizenMenu: linkData,
            fetchedCitizen: isLinkDataFetched,
            isLoading: islinkDataLoading
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "login/*",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Login, {
            stateCode: stateCode
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "register/*",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Login, {
            stateCode: stateCode,
            isUserRegistered: false
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "user/profile",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
            className: "citizen-user-profile-wrapper",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(UserProfile, {
              stateCode: stateCode,
              userType: "citizen",
              cityDetails: cityDetails
            })
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Route, {
          path: "Audit",
          element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Search, {})
        }), appRoutes, ModuleLevelLinkHomePages]
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
      className: "citizen-home-footer",
      style: window.location.href.includes("citizen/obps") ? {
        zIndex: "-1"
      } : {},
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_8__["default"], {
        alt: "Powered by DIGIT",
        src: (_window7 = window) === null || _window7 === void 0 || (_window7 = _window7.globalConfigs) === null || _window7 === void 0 || (_window7$getConfig = _window7.getConfig) === null || _window7$getConfig === void 0 ? void 0 : _window7$getConfig.call(_window7, "DIGIT_FOOTER"),
        style: {
          height: "1.2em",
          cursor: "pointer"
        },
        onClick: () => {
          var _window8, _window8$getConfig;
          window.open((_window8 = window) === null || _window8 === void 0 || (_window8 = _window8.globalConfigs) === null || _window8 === void 0 || (_window8$getConfig = _window8.getConfig) === null || _window8$getConfig === void 0 ? void 0 : _window8$getConfig.call(_window8, "DIGIT_HOME_URL"), "_blank").focus();
        }
      })
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Home);

/***/ }),

/***/ "./src/pages/employee/ChangePassword/changePassword.js":
/*!*************************************************************!*\
  !*** ./src/pages/employee/ChangePassword/changePassword.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_Background__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../components/Background */ "./src/components/Background.js");
/* harmony import */ var _components_Header__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/Header */ "./src/components/Header.js");
/* harmony import */ var _citizen_Login_SelectOtp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../citizen/Login/SelectOtp */ "./src/pages/citizen/Login/SelectOtp.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }










var ChangePasswordComponent = _ref => {
  var _window3, _window3$getConfig;
  var {
    config: propsConfig,
    t
  } = _ref;
  var [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null);
  var {
    mobile_number: mobileNumber,
    tenantId
  } = Digit.Hooks.useQueryParams();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useNavigate)();
  var [otp, setOtp] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)("");
  var [isOtpValid, setIsOtpValid] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(true);
  var [showToast, setShowToast] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null);
  var getUserType = () => Digit.UserService.getType();
  (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    var _location$state, _window;
    if (!user) {
      Digit.UserService.setType("employee");
      return;
    }
    Digit.UserService.setUser(user);
    var redirectPath = ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.from) || "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/employee");
    navigate(redirectPath, {
      replace: true
    });
  }, [user]);
  var closeToast = () => {
    setShowToast(null);
  };
  var onResendOTP = /*#__PURE__*/function () {
    var _ref2 = _asyncToGenerator(function* () {
      var requestData = {
        otp: {
          mobileNumber,
          userType: getUserType().toUpperCase(),
          type: "passwordreset",
          tenantId
        }
      };
      try {
        yield Digit.UserService.sendOtp(requestData, tenantId);
        setShowToast(t("ES_OTP_RESEND"));
      } catch (err) {
        var _err$response;
        setShowToast((err === null || err === void 0 || (_err$response = err.response) === null || _err$response === void 0 || (_err$response = _err$response.data) === null || _err$response === void 0 ? void 0 : _err$response.error_description) || t("ES_INVALID_LOGIN_CREDENTIALS"));
      }
      setTimeout(closeToast, 5000);
    });
    return function onResendOTP() {
      return _ref2.apply(this, arguments);
    };
  }();
  var onChangePassword = /*#__PURE__*/function () {
    var _ref3 = _asyncToGenerator(function* (data) {
      try {
        if (data.newPassword !== data.confirmPassword) {
          return setShowToast(t("ERR_PASSWORD_DO_NOT_MATCH"));
        }
        var requestData = _objectSpread(_objectSpread({}, data), {}, {
          otpReference: otp,
          tenantId,
          type: getUserType().toUpperCase()
        });
        var response = yield Digit.UserService.changePassword(requestData, tenantId);
        navigateToLogin();
      } catch (err) {
        var _err$response2;
        setShowToast((err === null || err === void 0 || (_err$response2 = err.response) === null || _err$response2 === void 0 || (_err$response2 = _err$response2.data) === null || _err$response2 === void 0 || (_err$response2 = _err$response2.error) === null || _err$response2 === void 0 || (_err$response2 = _err$response2.fields) === null || _err$response2 === void 0 || (_err$response2 = _err$response2[0]) === null || _err$response2 === void 0 ? void 0 : _err$response2.message) || t("ES_SOMETHING_WRONG"));
        setTimeout(closeToast, 5000);
      }
    });
    return function onChangePassword(_x) {
      return _ref3.apply(this, arguments);
    };
  }();
  var navigateToLogin = () => {
    var _window2;
    navigate("/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/employee/user/login"), {
      replace: true
    });
  };
  var [username, password, confirmPassword] = propsConfig.inputs;
  var config = [{
    body: [{
      label: t(username.label),
      type: username.type,
      populators: {
        name: username.name
      },
      isMandatory: true
    }, {
      label: t(password.label),
      type: password.type,
      populators: {
        name: password.name
      },
      isMandatory: true
    }, {
      label: t(confirmPassword.label),
      type: confirmPassword.type,
      populators: {
        name: confirmPassword.name
      },
      isMandatory: true
    }]
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_components_Background__WEBPACK_IMPORTED_MODULE_5__["default"], {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "employeeBackbuttonAlign",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.BackLink, {
        variant: "primary",
        style: {
          borderBottom: "none"
        }
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.FormComposer, {
      onSubmit: onChangePassword,
      noBoxShadow: true,
      inline: true,
      submitInForm: true,
      config: config,
      label: propsConfig.texts.submitButtonLabel,
      cardStyle: {
        maxWidth: "408px",
        margin: "auto"
      },
      className: "employeeChangePassword",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Header__WEBPACK_IMPORTED_MODULE_6__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.CardSubHeader, {
        style: {
          textAlign: "center"
        },
        children: [" ", propsConfig.texts.header, " "]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_0__.CardText, {
        children: ["".concat(t("CS_LOGIN_OTP_TEXT"), " "), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("b", {
          children: [" ", "".concat(t("+ 91 - ")), " ", mobileNumber]
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_citizen_Login_SelectOtp__WEBPACK_IMPORTED_MODULE_7__["default"], {
        t: t,
        userType: "employee",
        otp: otp,
        onOtpChange: setOtp,
        error: isOtpValid,
        onResend: onResendOTP
      })]
    }), showToast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Toast, {
      type: "error",
      label: t(showToast),
      onClose: closeToast
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
      className: "EmployeeLoginFooter",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_8__["default"], {
        alt: "Powered by DIGIT",
        src: (_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.globalConfigs) === null || _window3 === void 0 || (_window3$getConfig = _window3.getConfig) === null || _window3$getConfig === void 0 ? void 0 : _window3$getConfig.call(_window3, "DIGIT_FOOTER_BW"),
        style: {
          cursor: "pointer"
        },
        onClick: () => {
          var _window4, _window4$getConfig;
          window.open((_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.globalConfigs) === null || _window4 === void 0 || (_window4$getConfig = _window4.getConfig) === null || _window4$getConfig === void 0 ? void 0 : _window4$getConfig.call(_window4, "DIGIT_HOME_URL"), "_blank").focus();
        }
      }), " "]
    })]
  });
};
ChangePasswordComponent.propTypes = {
  loginParams: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().any)
};
ChangePasswordComponent.defaultProps = {
  loginParams: null
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChangePasswordComponent);

/***/ }),

/***/ "./src/pages/employee/ChangePassword/config.js":
/*!*****************************************************!*\
  !*** ./src/pages/employee/ChangePassword/config.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   config: () => (/* binding */ config)
/* harmony export */ });
var config = [{
  texts: {
    header: "CORE_COMMON_RESET_PASSWORD_LABEL",
    submitButtonLabel: "CORE_COMMON_CHANGE_PASSWORD"
  },
  inputs: [{
    label: "CORE_LOGIN_USERNAME",
    type: "text",
    name: "userName",
    error: "ERR_HRMS_INVALID_USERNAME"
  }, {
    label: "CORE_LOGIN_NEW_PASSWORD",
    type: "password",
    name: "newPassword",
    error: "CORE_COMMON_REQUIRED_ERRMSG"
  }, {
    label: "CORE_LOGIN_CONFIRM_NEW_PASSWORD",
    type: "password",
    name: "confirmPassword",
    error: "CORE_COMMON_REQUIRED_ERRMSG"
  }]
}];

/***/ }),

/***/ "./src/pages/employee/ChangePassword/index.js":
/*!****************************************************!*\
  !*** ./src/pages/employee/ChangePassword/index.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _changePassword__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./changePassword */ "./src/pages/employee/ChangePassword/changePassword.js");
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ "./src/pages/employee/ChangePassword/config.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }






var EmployeeChangePassword = () => {
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var params = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => _config__WEBPACK_IMPORTED_MODULE_4__.config.map(step => {
    var texts = {};
    for (var key in step.texts) {
      texts[key] = t(step.texts[key]);
    }
    return _objectSpread(_objectSpread({}, step), {}, {
      texts
    });
  }), [_config__WEBPACK_IMPORTED_MODULE_4__.config]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Routes, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
      path: "",
      element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_changePassword__WEBPACK_IMPORTED_MODULE_3__["default"], {
        config: params[0],
        t: t
      })
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EmployeeChangePassword);

/***/ }),

/***/ "./src/pages/employee/ForgotPassword/config.js":
/*!*****************************************************!*\
  !*** ./src/pages/employee/ForgotPassword/config.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   loginConfig: () => (/* binding */ loginConfig)
/* harmony export */ });
var loginConfig = [{
  texts: {
    header: "CORE_COMMON_FORGOT_PASSWORD_LABEL",
    description: "ES_FORGOT_PASSWORD_DESC",
    submitButtonLabel: "CORE_COMMON_CONTINUE"
  },
  inputs: [{
    label: "CORE_COMMON_MOBILE_NUMBER",
    type: "mobileNumber",
    name: "mobileNumber",
    error: "ERR_HRMS_INVALID_MOBILE_NUMBER"
  }, {
    label: "CORE_COMMON_CITY",
    type: "dropdown",
    name: "city",
    error: "ERR_HRMS_INVALID_CITY"
  }]
}];

/***/ }),

/***/ "./src/pages/employee/ForgotPassword/forgotPassword.js":
/*!*************************************************************!*\
  !*** ./src/pages/employee/ForgotPassword/forgotPassword.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_Background__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../components/Background */ "./src/components/Background.js");
/* harmony import */ var _components_Header__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../components/Header */ "./src/components/Header.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var _Login_Carousel_Carousel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Login/Carousel/Carousel */ "./src/pages/employee/Login/Carousel/Carousel.js");
/* harmony import */ var _hooks_useLoginConfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../hooks/useLoginConfig */ "./src/hooks/useLoginConfig.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
// import { FormComposer } from "@egovernments/digit-ui-react-components";










var ForgotPassword = _ref => {
  var _window4, _window4$getConfig, _window6, _window6$getConfig;
  var {
    config: propsConfig,
    t,
    stateCode
  } = _ref;
  var {
    data: cities,
    isLoading
  } = Digit.Hooks.useTenants();
  var [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var [showToast, setShowToast] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var getUserType = () => Digit.UserService.getType();
  var {
    data: mdmsData
  } = (0,_hooks_useLoginConfig__WEBPACK_IMPORTED_MODULE_8__.useLoginConfig)(stateCode);
  if (mdmsData !== null && mdmsData !== void 0 && mdmsData.config) {
    var _mdmsData$config$;
    var bannerImages = mdmsData === null || mdmsData === void 0 || (_mdmsData$config$ = mdmsData.config[0]) === null || _mdmsData$config$ === void 0 ? void 0 : _mdmsData$config$.bannerImages;
    propsConfig.bannerImages = bannerImages;
  }
  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    var _location$state, _window;
    if (!user) {
      Digit.UserService.setType("employee");
      return;
    }
    Digit.UserService.setUser(user);
    var redirectPath = ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.from) || "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/employee");
    navigate(redirectPath, {
      replace: true
    });
  }, [user]);
  var closeToast = () => {
    setShowToast(null);
  };
  var onForgotPassword = /*#__PURE__*/function () {
    var _ref2 = _asyncToGenerator(function* (data) {
      if (!data.city) {
        alert("Please Select City!");
        return;
      }
      var requestData = {
        otp: {
          userName: data.username,
          userType: getUserType().toUpperCase(),
          type: "passwordreset",
          tenantId: data.city.code
        }
      };
      try {
        var _window2;
        yield Digit.UserService.sendOtp(requestData, data.city.code);
        navigate("/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath, "/employee/user/change-password?USERNAME=").concat(data.username, "&tenantId=").concat(data.city.code));
      } catch (err) {
        var _err$response;
        setShowToast((err === null || err === void 0 || (_err$response = err.response) === null || _err$response === void 0 || (_err$response = _err$response.data) === null || _err$response === void 0 || (_err$response = _err$response.error) === null || _err$response === void 0 || (_err$response = _err$response.fields) === null || _err$response === void 0 || (_err$response = _err$response[0]) === null || _err$response === void 0 ? void 0 : _err$response.message) || "Invalid login credentials!");
        setTimeout(closeToast, 5000);
      }
    });
    return function onForgotPassword(_x) {
      return _ref2.apply(this, arguments);
    };
  }();
  var navigateToLogin = () => {
    var _window3;
    navigate("/".concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.contextPath, "/employee/login"));
  };
  var [userId, city] = propsConfig.inputs;
  var config = [{
    body: [{
      label: t("USERNAME"),
      type: "text",
      populators: {
        name: "username"
      },
      isMandatory: true
    }, {
      label: t(city.label),
      type: city.type,
      populators: {
        name: city.name,
        optionsKey: "name",
        required: true,
        options: cities
      },
      isMandatory: true
    }]
  }];
  if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {
      page: true,
      variant: "PageLoader"
    });
  }
  return propsConfig !== null && propsConfig !== void 0 && propsConfig.bannerImages ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
      className: "login-container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_Login_Carousel_Carousel__WEBPACK_IMPORTED_MODULE_7__["default"], {
        bannerImages: propsConfig === null || propsConfig === void 0 ? void 0 : propsConfig.bannerImages
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
        className: "login-form-container",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.FormComposerV2, {
          onSubmit: onForgotPassword,
          noBoxShadow: true,
          inline: true,
          submitInForm: true,
          config: config,
          label: propsConfig.texts.submitButtonLabel,
          secondaryActionLabel: propsConfig.texts.secondaryButtonLabel,
          onSecondayActionClick: navigateToLogin,
          heading: propsConfig.texts.header,
          description: propsConfig.texts.description,
          headingStyle: {
            textAlign: "center",
            fontWeight: "bold",
            color: "#363636"
          },
          descriptionStyles: {
            color: "#787878",
            textAlign: "center"
          },
          cardStyle: {
            maxWidth: "408px",
            margin: "auto"
          },
          className: "employeeForgotPassword",
          secondaryActionId: "employeeForgotPassword",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Header__WEBPACK_IMPORTED_MODULE_5__["default"], {})
        }), showToast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Toast, {
          type: "error",
          label: t(showToast),
          onClose: closeToast
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
          className: "EmployeeLoginFooter",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__["default"], {
            alt: "Powered by DIGIT",
            src: (_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.globalConfigs) === null || _window4 === void 0 || (_window4$getConfig = _window4.getConfig) === null || _window4$getConfig === void 0 ? void 0 : _window4$getConfig.call(_window4, "DIGIT_FOOTER_BW"),
            style: {
              cursor: "pointer"
            },
            onClick: () => {
              var _window5, _window5$getConfig;
              window.open((_window5 = window) === null || _window5 === void 0 || (_window5 = _window5.globalConfigs) === null || _window5 === void 0 || (_window5$getConfig = _window5.getConfig) === null || _window5$getConfig === void 0 ? void 0 : _window5$getConfig.call(_window5, "DIGIT_HOME_URL"), "_blank").focus();
            }
          }), " "]
        })]
      })]
    })
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_components_Background__WEBPACK_IMPORTED_MODULE_4__["default"], {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "employeeBackbuttonAlign",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackLink, {
        onClick: () => window.history.back()
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.FormComposerV2, {
      onSubmit: onForgotPassword,
      noBoxShadow: true,
      inline: true,
      submitInForm: true,
      config: config,
      label: propsConfig.texts.submitButtonLabel,
      secondaryActionLabel: propsConfig.texts.secondaryButtonLabel,
      onSecondayActionClick: navigateToLogin,
      heading: propsConfig.texts.header,
      description: propsConfig.texts.description,
      headingStyle: {
        textAlign: "center",
        fontWeight: "bold",
        color: "#363636"
      },
      descriptionStyles: {
        color: "#787878",
        textAlign: "center"
      },
      cardStyle: {
        maxWidth: "408px",
        margin: "auto"
      },
      className: "employeeForgotPassword",
      secondaryActionId: "employeeForgotPassword",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Header__WEBPACK_IMPORTED_MODULE_5__["default"], {})
    }), showToast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Toast, {
      type: "error",
      label: t(showToast),
      onClose: closeToast
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
      className: "EmployeeLoginFooter",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__["default"], {
        alt: "Powered by DIGIT",
        src: (_window6 = window) === null || _window6 === void 0 || (_window6 = _window6.globalConfigs) === null || _window6 === void 0 || (_window6$getConfig = _window6.getConfig) === null || _window6$getConfig === void 0 ? void 0 : _window6$getConfig.call(_window6, "DIGIT_FOOTER_BW"),
        style: {
          cursor: "pointer"
        },
        onClick: () => {
          var _window7, _window7$getConfig;
          window.open((_window7 = window) === null || _window7 === void 0 || (_window7 = _window7.globalConfigs) === null || _window7 === void 0 || (_window7$getConfig = _window7.getConfig) === null || _window7$getConfig === void 0 ? void 0 : _window7$getConfig.call(_window7, "DIGIT_HOME_URL"), "_blank").focus();
        }
      }), " "]
    })]
  });
};
ForgotPassword.propTypes = {
  loginParams: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().any)
};
ForgotPassword.defaultProps = {
  loginParams: null
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ForgotPassword);

/***/ }),

/***/ "./src/pages/employee/ForgotPassword/index.js":
/*!****************************************************!*\
  !*** ./src/pages/employee/ForgotPassword/index.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ "./src/pages/employee/ForgotPassword/config.js");
/* harmony import */ var _forgotPassword__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./forgotPassword */ "./src/pages/employee/ForgotPassword/forgotPassword.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }






var EmployeeForgotPassword = _ref => {
  var {
    stateCode
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var params = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => _config__WEBPACK_IMPORTED_MODULE_3__.loginConfig.map(step => {
    var texts = {};
    for (var key in step.texts) {
      texts[key] = t(step.texts[key]);
    }
    return _objectSpread(_objectSpread({}, step), {}, {
      texts
    });
  }), [_config__WEBPACK_IMPORTED_MODULE_3__.loginConfig]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Routes, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
      path: "",
      element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_forgotPassword__WEBPACK_IMPORTED_MODULE_4__["default"], {
        config: params[0],
        t: t,
        stateCode: stateCode
      })
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EmployeeForgotPassword);

/***/ }),

/***/ "./src/pages/employee/LanguageSelection/index.js":
/*!*******************************************************!*\
  !*** ./src/pages/employee/LanguageSelection/index.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_Background__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../components/Background */ "./src/components/Background.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _Digit, _Digit$getDefaultLang;








var DEFAULT_LOCALE = (_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.Utils) === null || _Digit === void 0 || (_Digit$getDefaultLang = _Digit.getDefaultLanguage) === null || _Digit$getDefaultLang === void 0 ? void 0 : _Digit$getDefaultLang.call(_Digit);
var defaultLanguage = {
  label: "English",
  value: DEFAULT_LOCALE
};
var LanguageSelection = () => {
  var _defaultLanguages, _stateInfo$code, _window2, _window2$getConfig;
  var {
    data: storeData,
    isLoading
  } = Digit.Hooks.useStore.getInitData();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useNavigate)();
  var {
    languages,
    stateInfo
  } = storeData || {};
  var defaultLanguages = languages;
  if (!defaultLanguages || ((_defaultLanguages = defaultLanguages) === null || _defaultLanguages === void 0 ? void 0 : _defaultLanguages.length) == 0) {
    defaultLanguages = [defaultLanguage];
  }
  var selectedLanguage = Digit.StoreData.getCurrentLanguage();
  var [selected, setselected] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(selectedLanguage);
  var handleChangeLanguage = language => {
    setselected(language.value);
    Digit.LocalizationService.changeLanguage(language.value, stateInfo.code);
  };
  function getContextPath(contextPath) {
    if (!contextPath || typeof contextPath !== "string") return "";
    return contextPath.split("/")[0];
  }
  var hasMultipleLanguages = (languages === null || languages === void 0 ? void 0 : languages.length) > 1;
  var handleSubmit = event => {
    navigate("/".concat(getContextPath(window.contextPath), "/user/login?ts=").concat(Date.now()));
  };
  if (isLoading) return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {});
  if (!hasMultipleLanguages) {
    var _window;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_4__.Navigate, {
      to: "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/employee/user/login"),
      replace: true
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_components_Background__WEBPACK_IMPORTED_MODULE_5__["default"], {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Card, {
      className: "bannerCard removeBottomMargin languageSelection",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
        className: "bannerHeader",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__["default"], {
          className: "bannerLogo",
          src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.logoUrl,
          alt: "Digit Banner Image"
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("p", {
          children: t("TENANT_TENANTS_".concat(stateInfo === null || stateInfo === void 0 || (_stateInfo$code = stateInfo.code) === null || _stateInfo$code === void 0 ? void 0 : _stateInfo$code.toUpperCase()))
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
        className: "language-selector",
        style: {
          justifyContent: "space-around",
          marginBottom: "24px",
          padding: "0 5%"
        },
        children: defaultLanguages.map((language, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
          className: "language-button-container",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_1__.CustomButton, {
            selected: language.value === selected,
            text: t(language.label),
            onClick: () => handleChangeLanguage(language)
          })
        }, index))
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.SubmitBar, {
        style: {
          width: "100%"
        },
        label: t("CORE_COMMON_CONTINUE"),
        onSubmit: handleSubmit
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
      className: "EmployeeLoginFooter",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__["default"], {
        alt: "Powered by DIGIT",
        src: (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.globalConfigs) === null || _window2 === void 0 || (_window2$getConfig = _window2.getConfig) === null || _window2$getConfig === void 0 ? void 0 : _window2$getConfig.call(_window2, "DIGIT_FOOTER_BW"),
        style: {
          cursor: "pointer"
        },
        onClick: () => {
          var _window3, _window3$getConfig;
          window.open((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.globalConfigs) === null || _window3 === void 0 || (_window3$getConfig = _window3.getConfig) === null || _window3$getConfig === void 0 ? void 0 : _window3$getConfig.call(_window3, "DIGIT_HOME_URL"), "_blank").focus();
        }
      }), " "]
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LanguageSelection);

/***/ }),

/***/ "./src/pages/employee/Login/Carousel/Carousel.js":
/*!*******************************************************!*\
  !*** ./src/pages/employee/Login/Carousel/Carousel.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config */ "./src/pages/employee/Login/config.js");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");




var Carousel = _ref => {
  var _loginConfig$;
  var {
    bannerImages = []
  } = _ref;
  var [currentSlide, setCurrentSlide] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var carouselItems = bannerImages || ((_loginConfig$ = _config__WEBPACK_IMPORTED_MODULE_1__.loginConfig[0]) === null || _loginConfig$ === void 0 ? void 0 : _loginConfig$.bannerImages) || [];
  var nextSlide = () => {
    setCurrentSlide(prev => prev === carouselItems.length - 1 ? 0 : prev + 1);
  };
  var prevSlide = () => {
    setCurrentSlide(prev => prev === 0 ? carouselItems.length - 1 : prev - 1);
  };
  var goToSlide = index => {
    setCurrentSlide(index);
  };

  // Auto-rotate carousel every 5 seconds
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    var interval = setInterval(() => {
      nextSlide();
    }, 5000);
    return () => clearInterval(interval);
  }, [carouselItems.length]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: "carousel-container",
      children: [carouselItems.sort((x, y) => (x === null || x === void 0 ? void 0 : x.id) - (y === null || y === void 0 ? void 0 : y.id)).map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "carousel-slide ".concat(index === currentSlide ? 'active' : ''),
        style: {
          backgroundImage: "url(".concat(item.image, ")")
        },
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
          className: "carousel-content",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("h2", {
            children: t(item.title)
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
            children: t(item.description)
          })]
        })
      }, item.id)), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
        className: "carousel-controls",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("button", {
          className: "carousel-nav",
          onClick: prevSlide,
          children: "<"
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
          className: "carousel-indicators",
          children: carouselItems.map((_, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("button", {
            className: "indicator ".concat(index === currentSlide ? 'active' : ''),
            onClick: () => goToSlide(index)
          }, index))
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("button", {
          className: "carousel-nav",
          onClick: nextSlide,
          children: ">"
        })]
      })]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Carousel);

/***/ }),

/***/ "./src/pages/employee/Login/ConfigOtp.js":
/*!***********************************************!*\
  !*** ./src/pages/employee/Login/ConfigOtp.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   LoginOtpConfig: () => (/* binding */ LoginOtpConfig)
/* harmony export */ });
var LoginOtpConfig = [{
  texts: {
    header: "CORE_COMMON_LOGIN",
    submitButtonLabel: "CORE_COMMON_CONTINUE"
  },
  inputs: [{
    label: "CORE_SIGNUP_EMAILID",
    type: "text",
    key: "email",
    isMandatory: true,
    populators: {
      name: "email",
      validation: {
        required: true,
        pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/
      },
      error: "ERR_EMAIL_REQUIRED"
    }
  }, {
    isMandatory: true,
    key: "check",
    type: "component",
    component: "PrivacyComponent",
    withoutLabel: true,
    disable: false,
    customProps: {
      module: "Sandbox"
    },
    populators: {
      name: "check"
    }
  }]
}];

/***/ }),

/***/ "./src/pages/employee/Login/config.js":
/*!********************************************!*\
  !*** ./src/pages/employee/Login/config.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   loginConfig: () => (/* binding */ loginConfig)
/* harmony export */ });
var loginConfig = [{
  texts: {
    header: "CORE_COMMON_LOGIN",
    submitButtonLabel: "CORE_COMMON_LOGIN",
    secondaryButtonLabel: "CORE_COMMON_FORGOT_PASSWORD"
  },
  inputs: [{
    label: "CORE_LOGIN_USERNAME",
    type: "text",
    key: "username",
    isMandatory: true,
    populators: {
      name: "username",
      validation: {
        required: true
      },
      error: "ERR_USERNAME_REQUIRED"
    }
  }, {
    label: "CORE_LOGIN_PASSWORD",
    type: "password",
    key: "password",
    isMandatory: true,
    populators: {
      name: "password",
      validation: {
        required: true
      },
      error: "ERR_PASSWORD_REQUIRED"
    }
  }, {
    isMandatory: true,
    type: "dropdown",
    key: "city",
    label: "CORE_COMMON_CITY",
    disable: false,
    populators: {
      name: "city",
      optionsKey: "name",
      error: "ERR_HRMS_INVALID_CITY",
      mdmsConfig: {
        masterName: "tenants",
        moduleName: "tenant",
        localePrefix: "TENANT_TENANTS",
        select: "(data)=>{ return Array.isArray(data['tenant'].tenants) && Digit.Utils.getUnique(data['tenant'].tenants).map(ele=>({code:ele.code,name:Digit.Utils.locale.getTransformedLocale('TENANT_TENANTS_'+ele.code)}))}"
      }
    }
  }, {
    key: "check",
    type: "component",
    disable: false,
    component: "PrivacyComponent",
    populators: {
      name: "check"
    },
    customProps: {
      module: "HCM"
    },
    isMandatory: false,
    withoutLabel: true
  }, {
    key: "employeeSsoLoginOptions",
    type: "component",
    disable: false,
    component: "EmployeeSSOLoginOptions",
    populators: {
      name: "employeeSsoLoginOptions"
    },
    isMandatory: false,
    withoutLabel: true,
    renderAfterSubmit: true
  }]
}];

/***/ }),

/***/ "./src/pages/employee/Login/index.js":
/*!*******************************************!*\
  !*** ./src/pages/employee/Login/index.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ "./src/pages/employee/Login/config.js");
/* harmony import */ var _ConfigOtp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ConfigOtp */ "./src/pages/employee/Login/ConfigOtp.js");
/* harmony import */ var _login__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./login */ "./src/pages/employee/Login/login.js");
/* harmony import */ var _hooks_useLoginConfig__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../hooks/useLoginConfig */ "./src/hooks/useLoginConfig.js");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }


 // Updated imports for v6






var EmployeeLogin = _ref => {
  var _window;
  var {
    stateCode
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var [loginConfig, setloginConfig] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_config__WEBPACK_IMPORTED_MODULE_3__.loginConfig);
  var [loginOtpConfig, setloginOtpConfig] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_ConfigOtp__WEBPACK_IMPORTED_MODULE_4__.LoginOtpConfig);
  var moduleCode = ["privacy-policy"];
  var language = Digit.StoreData.getCurrentLanguage();
  var modulePrefix = "digit";
  var loginType = ((_window = window) === null || _window === void 0 || (_window = _window.globalConfigs) === null || _window === void 0 ? void 0 : _window.getConfig("OTP_BASED_LOGIN")) || false;
  var {
    data: mdmsData,
    isLoading
  } = (0,_hooks_useLoginConfig__WEBPACK_IMPORTED_MODULE_6__.useLoginConfig)(stateCode);
  var {
    data: store
  } = Digit.Services.useStore({
    stateCode,
    moduleCode,
    language,
    modulePrefix
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!isLoading && mdmsData !== null && mdmsData !== void 0 && mdmsData.config) {
      setloginConfig(mdmsData === null || mdmsData === void 0 ? void 0 : mdmsData.config);
    } else {
      setloginConfig(_config__WEBPACK_IMPORTED_MODULE_3__.loginConfig);
    }
  }, [mdmsData, isLoading]);
  var loginParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => loginConfig.map(step => {
    var texts = {};
    for (var key in step.texts) {
      texts[key] = t(step.texts[key]);
    }
    return _objectSpread(_objectSpread({}, step), {}, {
      texts
    });
  }, [loginConfig]));
  var loginOtpParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => loginOtpConfig.map(step => {
    var texts = {};
    for (var key in step.texts) {
      texts[key] = t(step.texts[key]);
    }
    return _objectSpread(_objectSpread({}, step), {}, {
      texts
    });
  }, [loginOtpConfig]));
  if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_7__.Loader, {
      page: false,
      variant: "PageLoader"
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Routes, {
    children: [" ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
      path: "/",
      element: loginType ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_login__WEBPACK_IMPORTED_MODULE_5__["default"], {
        config: loginOtpParams[0],
        t: t,
        loginOTPBased: loginType
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_login__WEBPACK_IMPORTED_MODULE_5__["default"], {
        config: loginParams[0],
        t: t
      })
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EmployeeLogin);

/***/ }),

/***/ "./src/pages/employee/Login/login.js":
/*!*******************************************!*\
  !*** ./src/pages/employee/Login/login.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_Background__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../components/Background */ "./src/components/Background.js");
/* harmony import */ var _components_Header__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../components/Header */ "./src/components/Header.js");
/* harmony import */ var _Carousel_Carousel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Carousel/Carousel */ "./src/pages/employee/Login/Carousel/Carousel.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var _hoc_withAutoFocusMain__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../hoc/withAutoFocusMain */ "./src/hoc/withAutoFocusMain.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["UserRequest"],
  _excluded2 = ["UserRequest"],
  _excluded3 = ["UserRequest"];
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }








// import SkipToMainContent from "../SkipToMainContent/SkipToMainContent";


var setEmployeeDetail = (userObject, token) => {
  var _JSON$parse;
  if (Digit.Utils.getMultiRootTenant() && "development" !== "development") // removed by dead control flow
{}
  var locale = ((_JSON$parse = JSON.parse(sessionStorage.getItem("Digit.locale"))) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.value) || Digit.Utils.getDefaultLanguage();
  localStorage.setItem("Employee.tenant-id", userObject === null || userObject === void 0 ? void 0 : userObject.tenantId);
  localStorage.setItem("tenant-id", userObject === null || userObject === void 0 ? void 0 : userObject.tenantId);
  localStorage.setItem("citizen.userRequestObject", JSON.stringify(userObject));
  localStorage.setItem("locale", locale);
  localStorage.setItem("Employee.locale", locale);
  localStorage.setItem("token", token);
  localStorage.setItem("Employee.token", token);
  localStorage.setItem("user-info", JSON.stringify(userObject));
  localStorage.setItem("Employee.user-info", JSON.stringify(userObject));
};
var Login = _ref => {
  var _Digit$ComponentRegis, _Digit2, _propsConfig$inputs, _config$, _config$2;
  var {
    config: propsConfig,
    t,
    isDisabled,
    loginOTPBased
  } = _ref;
  var {
    data: cities,
    isLoading
  } = Digit.Hooks.useTenants();
  var {
    data: storeData,
    isLoading: isStoreLoading
  } = Digit.Hooks.useStore.getInitData();
  var {
    data: ssoMDMSData,
    isLoading: isSSOMDMSLoading
  } = Digit.Hooks.useSSOConfig(Digit.ULBService.getStateId(), {
    select: data => {
      var _data$MdmsRes, _data$SSO;
      var config = (data === null || data === void 0 || (_data$MdmsRes = data.MdmsRes) === null || _data$MdmsRes === void 0 || (_data$MdmsRes = _data$MdmsRes["SSO"]) === null || _data$MdmsRes === void 0 ? void 0 : _data$MdmsRes.IdentityProviders) || (data === null || data === void 0 || (_data$SSO = data["SSO"]) === null || _data$SSO === void 0 ? void 0 : _data$SSO.IdentityProviders) || (data === null || data === void 0 ? void 0 : data["IdentityProviders"]) || [];
      return Array.isArray(config) ? config : [];
    }
  });
  var {
    stateInfo
  } = storeData || {};
  var [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var [showToast, setShowToast] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var [disable, setDisable] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var [loginLoader, setLoginLoader] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var DynamicLoginComponent = (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("DynamicLoginComponent");

  /* Generic SSO Callback Handler - runs on mount / when disable/user/stateInfo change */
  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    var hashParams = new URLSearchParams(window.location.hash.slice(1));
    var searchParams = new URLSearchParams(window.location.search);
    var idToken = hashParams.get("id_token") || searchParams.get("id_token");
    var accessToken = hashParams.get("access_token") || searchParams.get("access_token");
    var code = searchParams.get("code");
    var error = searchParams.get("error") || hashParams.get("error");
    var errorDescription = searchParams.get("error_description") || hashParams.get("error_description") || searchParams.get("errorDescription") || hashParams.get("errorDescription");

    // If we are not on an SSO callback URL, never keep the SSO overlay loader.
    // Important: we intentionally don't set the loader before redirecting to the provider,
    // so browser back (including bfcache restores) won't get stuck with a stale loader.
    // Note: do NOT reset `disable` here — it is also used for form-validation gating and
    // resetting it would fight FormComposerV2's onFormValueChange, causing an infinite loop.
    if (!idToken && !code && !error) {
      if (loginLoader) setLoginLoader(false);
      return;
    }
    if (error && !showToast) {
      setShowToast(errorDescription || "SSO Login Failed!");
      setTimeout(closeToast, 5000);
      setLoginLoader(false);
      setDisable(false);
      return;
    }
    if (!(stateInfo !== null && stateInfo !== void 0 && stateInfo.code)) {
      // Tenant/state not ready yet; wait and retry when stateInfo arrives.
      return;
    }
    if ((idToken || code) && !user && !disable) {
      if (idToken) {
        handleDigitLogin(idToken, accessToken);
      } else if (code) {
        setDisable(true);
        setLoginLoader(true);
        Digit.UserService.microsoftAuthenticate({
          code
        }).then(_ref2 => {
          var {
              UserRequest: info
            } = _ref2,
            tokens = _objectWithoutProperties(_ref2, _excluded);
          Digit.SessionStorage.set("Employee.tenantId", info === null || info === void 0 ? void 0 : info.tenantId);
          setUser(_objectSpread({
            info
          }, tokens));
          setDisable(false);
          setLoginLoader(false);
        }).catch(err => {
          var _err$response;
          setShowToast((err === null || err === void 0 || (_err$response = err.response) === null || _err$response === void 0 || (_err$response = _err$response.data) === null || _err$response === void 0 ? void 0 : _err$response.error_description) || "Login Failed!");
          setTimeout(closeToast, 5000);
          setDisable(false);
          setLoginLoader(false);
        });
      }
    }
  }, [user, disable, stateInfo, loginLoader, showToast]);

  /* Post-login redirect and user setup */
  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    var _user$info, _user$info2, _window, _window2, _user$info3, _user$info4, _user$info5, _user$info6;
    if (!user) {
      return;
    }
    Digit.SessionStorage.set("citizen.userRequestObject", user);
    var filteredRoles = user === null || user === void 0 || (_user$info = user.info) === null || _user$info === void 0 || (_user$info = _user$info.roles) === null || _user$info === void 0 ? void 0 : _user$info.filter(role => role.tenantId === Digit.SessionStorage.get("Employee.tenantId"));
    if ((user === null || user === void 0 || (_user$info2 = user.info) === null || _user$info2 === void 0 || (_user$info2 = _user$info2.roles) === null || _user$info2 === void 0 ? void 0 : _user$info2.length) > 0) user.info.roles = filteredRoles;
    Digit.UserService.setUser(user);
    setEmployeeDetail(user === null || user === void 0 ? void 0 : user.info, user === null || user === void 0 ? void 0 : user.access_token);
    var redirectPath = "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/employee");

    /* logic to redirect back to same screen where we left off */
    if ((_window2 = window) !== null && _window2 !== void 0 && (_window2 = _window2.location) !== null && _window2 !== void 0 && (_window2 = _window2.href) !== null && _window2 !== void 0 && _window2.includes("from=")) {
      var _window3, _window4;
      redirectPath = decodeURIComponent((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.location) === null || _window3 === void 0 || (_window3 = _window3.href) === null || _window3 === void 0 || (_window3 = _window3.split("from=")) === null || _window3 === void 0 ? void 0 : _window3[1]) || "/".concat((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.contextPath, "/employee");
    }

    /*  RAIN-6489 Logic to navigate to National DSS home in case user has only one role [NATADMIN]*/
    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 = _user$info4.roles) !== null && _user$info4 !== void 0 && _user$info4.every(e => e.code === "NATADMIN")) {
      var _window5;
      redirectPath = "/".concat((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.contextPath, "/employee/dss/landing/NURT_DASHBOARD");
    }

    /*  RAIN-6489 Logic to navigate to National DSS home incase user has only one role [NATADMIN]*/
    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 = _user$info6.roles) !== null && _user$info6 !== void 0 && _user$info6.every(e => e.code === "STADMIN")) {
      var _window6;
      redirectPath = "/".concat((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.contextPath, "/employee/dss/landing/home");
    }
    navigate(redirectPath, {
      replace: true
    });
  }, [user]);

  /* Generic Token Exchange with DIGIT Backend */
  var handleDigitLogin = /*#__PURE__*/function () {
    var _ref3 = _asyncToGenerator(function* (idToken) {
      var accessToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      setDisable(true);
      setLoginLoader(true);
      try {
        var _window7;
        var response = yield fetch("/user/oauth/token", {
          method: "POST",
          headers: {
            Authorization: "Basic ".concat(((_window7 = window) === null || _window7 === void 0 || (_window7 = _window7.globalConfigs) === null || _window7 === void 0 ? void 0 : _window7.getConfig("JWT_TOKEN")) || "ZWdvdi11c2VyLWNsaWVudDo="),
            "Content-Type": "application/x-www-form-urlencoded"
          },
          body: new URLSearchParams(_objectSpread(_objectSpread({
            grant_type: "jwt_exchange",
            scope: "read",
            userType: "EMPLOYEE",
            assertion: idToken
          }, accessToken && {
            access_token: accessToken
          }), {}, {
            tenantId: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.code
          }))
        });
        if (!response.ok) {
          var _parsed, _parsed2, _parsed3, _parsed4;
          var raw = yield response.text();
          var parsed;
          try {
            parsed = raw ? JSON.parse(raw) : null;
          } catch (e) {
            parsed = null;
          }
          var message = ((_parsed = parsed) === null || _parsed === void 0 ? void 0 : _parsed.error_description) || ((_parsed2 = parsed) === null || _parsed2 === void 0 ? void 0 : _parsed2.errorDescription) || ((_parsed3 = parsed) === null || _parsed3 === void 0 ? void 0 : _parsed3.message) || ((_parsed4 = parsed) === null || _parsed4 === void 0 ? void 0 : _parsed4.error) || raw || "DIGIT Login Failed";
          throw new Error(message);
        }
        var data = yield response.json();
        var {
            UserRequest: info
          } = data,
          tokens = _objectWithoutProperties(data, _excluded2);
        Digit.SessionStorage.set("Employee.tenantId", info === null || info === void 0 ? void 0 : info.tenantId);
        setUser(_objectSpread({
          info
        }, tokens));
      } catch (error) {
        console.error("DIGIT Login Error:", error);
        setShowToast((error === null || error === void 0 ? void 0 : error.message) || "DIGIT Login Failed");
        setTimeout(closeToast, 5000);

        // If token exchange fails, force Microsoft to prompt credentials on next SSO click.
        try {
          window.sessionStorage.setItem("sso.force.prompt.login", "true");
        } catch (e) {
          // no-op
        }

        // Prevent retry loop: clear `id_token`/`code` from URL (stay on same page).
        try {
          window.history.replaceState({}, document.title, window.location.pathname);
        } catch (e) {
          // no-op
        }
      }
      setDisable(false);
      setLoginLoader(false);
    });
    return function handleDigitLogin(_x) {
      return _ref3.apply(this, arguments);
    };
  }();
  var buildOIDCAuthorizeUrl = uiConfig => {
    var _window8;
    var {
      authorizeUrl,
      clientId,
      scopes = ["openid", "profile", "email"],
      responseType = "id_token",
      responseMode = "fragment",
      nonceRequired = true,
      redirectPath = "employee/user/login",
      resource,
      provider,
      prompt
    } = uiConfig || {};
    if (!authorizeUrl || !clientId) {
      throw new Error("Missing authorizeUrl or clientId for OIDC login");
    }
    var nonce = nonceRequired ? Math.random().toString(36).substring(2) : undefined;
    var redirectUri = "".concat(window.location.origin, "/").concat((_window8 = window) === null || _window8 === void 0 ? void 0 : _window8.contextPath, "/").concat(redirectPath);
    var params = new URLSearchParams();
    params.set("client_id", clientId);
    params.set("response_type", responseType);
    params.set("redirect_uri", redirectUri);
    if (nonce) params.set("nonce", nonce);
    if (responseMode) params.set("response_mode", responseMode);
    if (scopes && scopes.length) params.set("scope", scopes.join(" "));
    if (resource) params.set("resource", resource);

    // Handle prompt parameter with priority:
    // 1. Use configured prompt from SSO config (respects admin configuration)
    // 2. Fall back to forced login only if no prompt is configured AND a previous login failed
    try {
      var forcePromptLogin = window.sessionStorage.getItem("sso.force.prompt.login") === "true";
      if (prompt) {
        // Respect configured prompt (e.g., "select_account", "consent")
        params.set("prompt", prompt);
        // Clear the force flag since we're using configured prompt
        if (forcePromptLogin) {
          window.sessionStorage.removeItem("sso.force.prompt.login");
        }
      } else if (forcePromptLogin) {
        // Only force login if no prompt is configured
        params.set("prompt", "login");
        window.sessionStorage.removeItem("sso.force.prompt.login");
      }
    } catch (e) {
      // If prompt is configured, still set it even if sessionStorage fails
      if (prompt) {
        params.set("prompt", prompt);
      }
    }
    return "".concat(authorizeUrl, "?").concat(params.toString());
  };
  var onSSOLogin = /*#__PURE__*/function () {
    var _ref4 = _asyncToGenerator(function* (ssoConfig) {
      // For OIDC-like providers (MICROSOFT, GOOGLE, etc.), use generic OIDC login
      var ui = (ssoConfig === null || ssoConfig === void 0 ? void 0 : ssoConfig.ui) || {};
      var hasOidcConfig = Boolean((ui.authorizeUrl || (ssoConfig === null || ssoConfig === void 0 ? void 0 : ssoConfig.authorizeUrl)) && ui.clientId);
      if (ui.authStrategy === "OIDC_POPUP" || ui.provider === "MICROSOFT" || hasOidcConfig) {
        return onOIDCLogin(ssoConfig);
      }

      // If the config doesn't match any known SSO strategy, don't leave the overlay loader stuck.
      setShowToast("SSO configuration is invalid or unsupported");
      setTimeout(closeToast, 5000);
    });
    return function onSSOLogin(_x2) {
      return _ref4.apply(this, arguments);
    };
  }();
  var onOIDCLogin = /*#__PURE__*/function () {
    var _ref5 = _asyncToGenerator(function* (ssoConfig) {
      try {
        var ui = _objectSpread({}, (ssoConfig === null || ssoConfig === void 0 ? void 0 : ssoConfig.ui) || {});
        // Backward-compatibility for older configs where authorizeUrl/resource
        // might be on the top level instead of inside ui.
        ui.authorizeUrl = ui.authorizeUrl || (ssoConfig === null || ssoConfig === void 0 ? void 0 : ssoConfig.authorizeUrl);
        ui.resource = ui.resource || (ssoConfig === null || ssoConfig === void 0 ? void 0 : ssoConfig.resource);
        // For Microsoft, if resource is not explicitly provided, default it to clientId (v1 behavior).
        if (ui.provider === "MICROSOFT" && !ui.resource) {
          ui.resource = ui.clientId;
        }
        // Persist provider + logout-relevant info for later use during logout
        if (ui.provider) {
          localStorage.setItem("sso-provider", ui.provider);
        }
        if (ui.logoutUrl) {
          localStorage.setItem("sso-logout-url", ui.logoutUrl);
        }
        if (ui.logoutRedirectParam) {
          localStorage.setItem("sso-logout-redirect-param", ui.logoutRedirectParam);
        }
        if (ui.tenantId) {
          localStorage.setItem("sso-tenant-id", ui.tenantId);
        }
        if (ui.authority) {
          localStorage.setItem("sso-authority", ui.authority);
        }
        var url = buildOIDCAuthorizeUrl(ui);
        // Simple implementation: redirect for OIDC if no library is present
        // For a better experience, a popup and message bridge should be used
        window.location.href = url;
      } catch (error) {
        console.error("OIDC Login Error:", error);
        setShowToast(error.message || "OIDC Login Failed");
        setTimeout(closeToast, 5000);
        setLoginLoader(false);
      }
    });
    return function onOIDCLogin(_x3) {
      return _ref5.apply(this, arguments);
    };
  }();
  var onLogin = /*#__PURE__*/function () {
    var _ref6 = _asyncToGenerator(function* (data) {
      var _requestData$city, _Digit;
      // if (!data.city) {
      //   alert("Please Select City!");
      //   return;
      // }
      if (data !== null && data !== void 0 && data.username) {
        data.username = data.username.trim();
      }
      if (data !== null && data !== void 0 && data.password) {
        data.password = data.password.trim();
      }
      setDisable(true);
      setLoginLoader(true);
      var requestData = _objectSpread(_objectSpread(_objectSpread({}, data), defaultValues), {}, {
        userType: "EMPLOYEE"
      });
      requestData.tenantId = (requestData === null || requestData === void 0 || (_requestData$city = requestData.city) === null || _requestData$city === void 0 ? void 0 : _requestData$city.code) || ((_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.ULBService) === null || _Digit === void 0 ? void 0 : _Digit.getStateId());
      delete requestData.city;
      try {
        var _yield$Digit$UserServ = yield Digit.UserService.authenticate(requestData),
          {
            UserRequest: info
          } = _yield$Digit$UserServ,
          tokens = _objectWithoutProperties(_yield$Digit$UserServ, _excluded3);
        Digit.SessionStorage.set("Employee.tenantId", info === null || info === void 0 ? void 0 : info.tenantId);
        setUser(_objectSpread({
          info
        }, tokens));
      } catch (err) {
        var _err$response2;
        setShowToast((err === null || err === void 0 || (_err$response2 = err.response) === null || _err$response2 === void 0 || (_err$response2 = _err$response2.data) === null || _err$response2 === void 0 ? void 0 : _err$response2.error_description) || (err === null || err === void 0 ? void 0 : err.message) == "ES_ERROR_USER_NOT_PERMITTED" && t("ES_ERROR_USER_NOT_PERMITTED") || t("INVALID_LOGIN_CREDENTIALS"));
        setTimeout(closeToast, 5000);
      }
      setDisable(false);
      setLoginLoader(false);
    });
    return function onLogin(_x4) {
      return _ref6.apply(this, arguments);
    };
  }();
  var reqCreate = {
    url: "/user-otp/v1/_send",
    params: {
      tenantId: (_Digit2 = Digit) === null || _Digit2 === void 0 || (_Digit2 = _Digit2.ULBService) === null || _Digit2 === void 0 ? void 0 : _Digit2.getStateId()
    },
    body: {},
    config: {
      enable: false
    }
  };
  var mutation = Digit.Hooks.useCustomAPIMutationHook(reqCreate);
  var onOtpLogin = /*#__PURE__*/function () {
    var _ref7 = _asyncToGenerator(function* (data) {
      var _Digit3;
      var inputEmail = data.email;
      yield mutation.mutate({
        body: {
          otp: {
            userName: data.email,
            type: "login",
            tenantId: (_Digit3 = Digit) === null || _Digit3 === void 0 || (_Digit3 = _Digit3.ULBService) === null || _Digit3 === void 0 ? void 0 : _Digit3.getStateId(),
            userType: "EMPLOYEE"
          }
        },
        config: {
          enable: true
        }
      }, {
        onError: (error, variables) => {
          var _error$response, _error$response2;
          setShowToast(error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && (_error$response = _error$response.data) !== null && _error$response !== void 0 && (_error$response = _error$response.Errors) !== null && _error$response !== void 0 && _error$response[0].code ? "SANDBOX_RESEND_OTP".concat(error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.data) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.Errors) === null || _error$response2 === void 0 || (_error$response2 = _error$response2[0]) === null || _error$response2 === void 0 ? void 0 : _error$response2.code) : "SANDBOX_RESEND_OTP_ERROR");
          setTimeout(closeToast, 5000);
        },
        onSuccess: function () {
          var _onSuccess = _asyncToGenerator(function* (data) {
            var _window9, _Digit4;
            navigate("/".concat((_window9 = window) === null || _window9 === void 0 ? void 0 : _window9.contextPath, "/employee/user/login/otp"), {
              state: {
                email: inputEmail,
                tenant: (_Digit4 = Digit) === null || _Digit4 === void 0 || (_Digit4 = _Digit4.ULBService) === null || _Digit4 === void 0 ? void 0 : _Digit4.getStateId()
              }
            });
          });
          function onSuccess(_x6) {
            return _onSuccess.apply(this, arguments);
          }
          return onSuccess;
        }()
      });
    });
    return function onOtpLogin(_x5) {
      return _ref7.apply(this, arguments);
    };
  }();
  var closeToast = () => {
    setShowToast(null);
  };
  var onForgotPassword = () => {
    var _window0;
    navigate("/".concat((_window0 = window) === null || _window0 === void 0 ? void 0 : _window0.contextPath, "/employee/user/forgot-password"));
  };
  var defaultTenant = Digit.ULBService.getStateId();
  var defaultValue = {
    code: defaultTenant,
    name: Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_".concat(defaultTenant))
  };
  var ssoConfigs = ssoMDMSData === null || ssoMDMSData === void 0 ? void 0 : ssoMDMSData.map(sso => {
    var _sso$ui, _sso$ui2, _sso$ui3, _sso$ui4, _sso$ui5, _sso$ui6;
    return _objectSpread(_objectSpread({}, sso), {}, {
      provider: ((_sso$ui = sso.ui) === null || _sso$ui === void 0 ? void 0 : _sso$ui.provider) || sso.provider || "sso",
      label: t("SSO_PROVIDER_".concat(((_sso$ui2 = sso.ui) === null || _sso$ui2 === void 0 ? void 0 : _sso$ui2.name) || sso.id)),
      icon: (_sso$ui3 = sso.ui) !== null && _sso$ui3 !== void 0 && _sso$ui3.logo ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("img", {
        src: sso.ui.logo,
        alt: (_sso$ui4 = sso.ui) === null || _sso$ui4 === void 0 ? void 0 : _sso$ui4.name,
        className: "employee-login-sso-logo"
      }) : ((_sso$ui5 = sso.ui) === null || _sso$ui5 === void 0 ? void 0 : _sso$ui5.provider) === "MICROSOFT" ? "Microsoft" : (_sso$ui6 = sso.ui) === null || _sso$ui6 === void 0 ? void 0 : _sso$ui6.icon,
      onLogin: ssoConfig => {
        onSSOLogin(ssoConfig);
      }
    });
  });
  var config = [{
    body: propsConfig === null || propsConfig === void 0 || (_propsConfig$inputs = propsConfig.inputs) === null || _propsConfig$inputs === void 0 ? void 0 : _propsConfig$inputs.map(field => (field === null || field === void 0 ? void 0 : field.component) === "EmployeeSSOLoginOptions" ? _objectSpread(_objectSpread({}, field), {}, {
      customProps: _objectSpread(_objectSpread({}, field.customProps), {}, {
        ssoConfigs
      })
    }) : field)
  }];
  var {
    mode
  } = Digit.Hooks.useQueryParams();
  if (mode === "admin" && (config === null || config === void 0 || (_config$ = config[0]) === null || _config$ === void 0 || (_config$ = _config$.body) === null || _config$ === void 0 || (_config$ = _config$[2]) === null || _config$ === void 0 ? void 0 : _config$.disable) == false && (config === null || config === void 0 || (_config$2 = config[0]) === null || _config$2 === void 0 || (_config$2 = _config$2.body) === null || _config$2 === void 0 || (_config$2 = _config$2[2]) === null || _config$2 === void 0 || (_config$2 = _config$2.populators) === null || _config$2 === void 0 ? void 0 : _config$2.defaultValue) == undefined) {
    config[0].body[2].disable = true;
    config[0].body[2].isMandatory = false;
    config[0].body[2].populators.defaultValue = defaultValue;
  }
  var defaultValues = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => Object.fromEntries(config[0].body.filter(field => {
    var _field$populators, _field$populators2;
    return (field === null || field === void 0 || (_field$populators = field.populators) === null || _field$populators === void 0 ? void 0 : _field$populators.defaultValue) && (field === null || field === void 0 || (_field$populators2 = field.populators) === null || _field$populators2 === void 0 ? void 0 : _field$populators2.name);
  }).map(field => [field.populators.name, field.populators.defaultValue])), []);
  var onFormValueChange = (setValue, formData, formState) => {
    // Extract keys from the config    
    var keys = config[0].body.filter(field => field === null || field === void 0 ? void 0 : field.isMandatory).map(field => field === null || field === void 0 ? void 0 : field.key);
    var hasEmptyFields = keys.some(key => {
      var value = formData[key];
      return value == null || value === "" || value === false;
    });
    setDisable(hasEmptyFields);
  };
  var renderLoginForm = function renderLoginForm() {
    var _propsConfig$texts, _propsConfig$texts2, _propsConfig$texts3;
    var extraClasses = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
    var cardClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
    var wrapperClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.FormComposerV2, {
      onSubmit: loginOTPBased ? onOtpLogin : onLogin,
      isDisabled: isDisabled || disable,
      noBoxShadow: true,
      inline: true,
      submitInForm: true,
      config: config,
      label: propsConfig === null || propsConfig === void 0 || (_propsConfig$texts = propsConfig.texts) === null || _propsConfig$texts === void 0 ? void 0 : _propsConfig$texts.submitButtonLabel,
      secondaryActionLabel: (propsConfig === null || propsConfig === void 0 || (_propsConfig$texts2 = propsConfig.texts) === null || _propsConfig$texts2 === void 0 ? void 0 : _propsConfig$texts2.secondaryButtonLabel) + (extraClasses.includes("login-form-container") ? "?" : ""),
      onSecondayActionClick: onForgotPassword,
      onFormValueChange: onFormValueChange,
      heading: propsConfig === null || propsConfig === void 0 || (_propsConfig$texts3 = propsConfig.texts) === null || _propsConfig$texts3 === void 0 ? void 0 : _propsConfig$texts3.header,
      className: "".concat(wrapperClass),
      cardSubHeaderClassName: "loginCardSubHeaderClassName",
      cardClassName: cardClassName,
      buttonClassName: "buttonClassName",
      defaultValues: defaultValues,
      children: stateInfo !== null && stateInfo !== void 0 && stateInfo.code ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Header__WEBPACK_IMPORTED_MODULE_5__["default"], {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_Header__WEBPACK_IMPORTED_MODULE_5__["default"], {
        showTenant: false
      })
    });
  };
  var renderFooter = footerClassName => {
    var _window1, _window1$getConfig;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: footerClassName,
      style: {
        backgroundColor: "unset"
      },
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_7__["default"], {
        alt: "Powered by DIGIT",
        src: (_window1 = window) === null || _window1 === void 0 || (_window1 = _window1.globalConfigs) === null || _window1 === void 0 || (_window1$getConfig = _window1.getConfig) === null || _window1$getConfig === void 0 ? void 0 : _window1$getConfig.call(_window1, "DIGIT_FOOTER_BW"),
        style: {
          cursor: "pointer"
        },
        onClick: () => {
          var _window10, _window10$getConfig;
          window.open((_window10 = window) === null || _window10 === void 0 || (_window10 = _window10.globalConfigs) === null || _window10 === void 0 || (_window10$getConfig = _window10.getConfig) === null || _window10$getConfig === void 0 ? void 0 : _window10$getConfig.call(_window10, "DIGIT_HOME_URL"), "_blank").focus();
        }
      })
    });
  };
  if (isLoading || isStoreLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {
      page: true,
      variant: "PageLoader"
    });
  }
  return propsConfig !== null && propsConfig !== void 0 && propsConfig.bannerImages ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
    className: "login-container",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_Carousel_Carousel__WEBPACK_IMPORTED_MODULE_6__["default"], {
      bannerImages: propsConfig === null || propsConfig === void 0 ? void 0 : propsConfig.bannerImages
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
      className: "login-form-container",
      children: [renderLoginForm("login-form-container", "", loginOTPBased ? "sandbox-onboarding-wrapper" : ""), DynamicLoginComponent && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(DynamicLoginComponent, {}), showToast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Toast, {
        type: "error",
        label: t(showToast),
        onClose: closeToast
      }), renderFooter("EmployeeLoginFooter")]
    })]
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_components_Background__WEBPACK_IMPORTED_MODULE_4__["default"], {
    children: [loginLoader && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      style: {
        position: "fixed",
        top: 0,
        left: 0,
        width: "100vw",
        height: "100vh",
        background: "rgba(0,0,0,0.35)",
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        zIndex: 9999
      },
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {})
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "employeeBackbuttonAlign",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackLink, {
        onClick: () => window.history.back()
      })
    }), renderLoginForm("loginFormStyleEmployee", "loginCardClassName", loginOTPBased ? "sandbox-onboarding-wrapper" : ""), DynamicLoginComponent && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(DynamicLoginComponent, {}), showToast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Toast, {
      type: "error",
      label: t(showToast),
      onClose: closeToast
    }), renderFooter("employee-login-home-footer")]
  });
};
Login.propTypes = {
  loginParams: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().any)
};
Login.defaultProps = {
  loginParams: null
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_hoc_withAutoFocusMain__WEBPACK_IMPORTED_MODULE_8__["default"])(Login, ".login-form-container"));

/***/ }),

/***/ "./src/pages/employee/Otp/OtpCustomComponent.js":
/*!******************************************************!*\
  !*** ./src/pages/employee/Otp/OtpCustomComponent.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _hooks_useInterval__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../hooks/useInterval */ "./src/hooks/useInterval.js");
/* harmony import */ var _components_Background__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/Background */ "./src/components/Background.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["onSelect", "formData", "control", "formState"];
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }









var OtpComponent = _ref => {
  var _props$props, _props$props4;
  var {
      onSelect,
      formData,
      control,
      formState
    } = _ref,
    props = _objectWithoutProperties(_ref, _excluded);
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useLocation)();
  var [showToast, setShowToast] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  var [params, setParams] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
  var [isOtpValid, setIsOtpValid] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
  var [timeLeft, setTimeLeft] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(30);
  var closeToast = () => {
    setShowToast(null);
  };
  (0,_hooks_useInterval__WEBPACK_IMPORTED_MODULE_5__["default"])(() => {
    setTimeLeft(timeLeft - 1);
  }, timeLeft > 0 ? 1000 : null);
  var handleOtpChange = otp => {
    setParams(_objectSpread(_objectSpread({}, params), {}, {
      otp
    }));
  };
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onSelect("OtpComponent", params);
  }, [params]);
  var reqCreate = {
    url: "/user-otp/v1/_send",
    params: {
      tenantId: props === null || props === void 0 || (_props$props = props.props) === null || _props$props === void 0 ? void 0 : _props$props.code
    },
    body: {},
    config: {
      enable: false
    }
  };
  var mutation = Digit.Hooks.useCustomAPIMutationHook(reqCreate);
  var resendOtp = /*#__PURE__*/function () {
    var _ref2 = _asyncToGenerator(function* () {
      var _props$props2, _props$props3;
      setTimeLeft(30);
      yield mutation.mutate({
        body: {
          "otp": {
            "userName": props === null || props === void 0 || (_props$props2 = props.props) === null || _props$props2 === void 0 ? void 0 : _props$props2.email,
            "type": "login",
            "tenantId": props === null || props === void 0 || (_props$props3 = props.props) === null || _props$props3 === void 0 ? void 0 : _props$props3.tenant,
            "userType": "EMPLOYEE"
          }
        },
        config: {
          enable: true
        }
      }, {
        onError: (error, variables) => {
          var _error$response, _error$response2;
          setShowToast({
            key: "error",
            label: error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && (_error$response = _error$response.data) !== null && _error$response !== void 0 && (_error$response = _error$response.Errors) !== null && _error$response !== void 0 && _error$response[0].code ? "SANDBOX_RESEND_OTP".concat(error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.data) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.Errors) === null || _error$response2 === void 0 || (_error$response2 = _error$response2[0]) === null || _error$response2 === void 0 ? void 0 : _error$response2.code) : "SANDBOX_RESEND_OTP_ERROR"
          });
          setTimeout(closeToast, 5000);
        },
        onSuccess: function () {
          var _onSuccess = _asyncToGenerator(function* (data) {
            setShowToast({
              key: "info",
              label: t("OTP_RESNED_SUCCESFULL")
            });
            setTimeout(closeToast, 5000);
          });
          function onSuccess(_x) {
            return _onSuccess.apply(this, arguments);
          }
          return onSuccess;
        }()
      });
    });
    return function resendOtp() {
      return _ref2.apply(this, arguments);
    };
  }();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CardLabel, {
      className: "sandbox-custom-otp-subheader",
      children: t("SANDBOX_ENTER_OTP")
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CardLabel, {
      className: "sandbox-custom-otp-header",
      children: t("CS_OTP_EMAIL")
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CardLabel, {
      className: "sandbox-custom-otp-email",
      style: {
        fontWeight: 'bold'
      },
      children: props === null || props === void 0 || (_props$props4 = props.props) === null || _props$props4 === void 0 ? void 0 : _props$props4.email
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_2__.OTPInput, {
      className: "sandbox-otp-input",
      length: 6,
      onChange: handleOtpChange,
      value: params === null || params === void 0 ? void 0 : params.otp
    }), timeLeft > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CardText, {
      className: "sandbox-resend-otp",
      children: "".concat(t("CS_RESEND_ANOTHER_OTP"), " ").concat(timeLeft, " ").concat(t("CS_RESEND_SECONDS"))
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("p", {
      className: "card-text-button sandbox-otp-input",
      onClick: resendOtp,
      children: t("CS_RESEND_OTP")
    }), !isOtpValid && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CardLabelError, {
      children: t("CS_INVALID_OTP")
    }), showToast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Toast, {
      type: showToast === null || showToast === void 0 ? void 0 : showToast.key,
      label: t(showToast === null || showToast === void 0 ? void 0 : showToast.label),
      onClose: closeToast
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OtpComponent);

/***/ }),

/***/ "./src/pages/employee/Otp/index.js":
/*!*****************************************!*\
  !*** ./src/pages/employee/Otp/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_Background__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../components/Background */ "./src/components/Background.js");
/* harmony import */ var _components_Header__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/Header */ "./src/components/Header.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["UserRequest"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }




 // Updated imports for v6




/* set employee details to enable backward compatible */

var setEmployeeDetail = (userObject, token) => {
  var _JSON$parse;
  if (Digit.Utils.getMultiRootTenant()) {
    return;
  }
  var locale = ((_JSON$parse = JSON.parse(sessionStorage.getItem("Digit.locale"))) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.value) || Digit.Utils.getDefaultLanguage();
  localStorage.setItem("Employee.tenant-id", userObject === null || userObject === void 0 ? void 0 : userObject.tenantId);
  localStorage.setItem("tenant-id", userObject === null || userObject === void 0 ? void 0 : userObject.tenantId);
  localStorage.setItem("citizen.userRequestObject", JSON.stringify(userObject));
  localStorage.setItem("locale", locale);
  localStorage.setItem("Employee.locale", locale);
  localStorage.setItem("token", token);
  localStorage.setItem("Employee.token", token);
  localStorage.setItem("user-info", JSON.stringify(userObject));
  localStorage.setItem("Employee.user-info", JSON.stringify(userObject));
};
var Otp = _ref => {
  var _location$state, _window3, _window3$getConfig;
  var {
    isLogin = false
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)();
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useNavigate)(); // Replaced useHistory with useNavigate
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_4__.useLocation)();
  var [showToast, setShowToast] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  var [isOtpValid, setIsOtpValid] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  var [params, setParams] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((location === null || location === void 0 || (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.data) || {});
  var [ifSuperUserExists, setIfSuperUserExist] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  // In v6, location.state is directly available, no need for destructuring within another object
  var {
    email,
    tenant
  } = location.state || {};
  var {
    data: MdmsRes
  } = Digit.Hooks.useCustomMDMS(tenant, "SandBoxLanding", [{
    name: "LandingPageRoles"
  }], {
    enabled: true,
    staleTime: 0,
    cacheTime: 0,
    select: data => {
      var _data$SandBoxLanding;
      return data === null || data === void 0 || (_data$SandBoxLanding = data["SandBoxLanding"]) === null || _data$SandBoxLanding === void 0 ? void 0 : _data$SandBoxLanding["LandingPageRoles"];
    }
  });
  var RoleLandingUrl = MdmsRes === null || MdmsRes === void 0 ? void 0 : MdmsRes[0].url;
  var config = [{
    body: [{
      type: "component",
      component: "OtpComponent",
      key: "OtpComponent",
      withoutLabel: true,
      isMandatory: false,
      customProps: {
        email: email,
        tenant: tenant
      },
      populators: {
        required: true
      }
    }]
  }];
  var OtpConfig = [{
    texts: {
      // header: t("CORE_COMMON_OTP_LABEL"),
      header: t("SANDBOX_OTP_VERIFICATION"),
      submitButtonLabel: "CORE_COMMON_SUBMIT"
    }
  }];
  var closeToast = () => {
    setShowToast(null);
  };
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    var _user$info, _user$info2, _window;
    if (!user) {
      return;
    }
    Digit.SessionStorage.set("citizen.userRequestObject", user);
    var filteredRoles = user === null || user === void 0 || (_user$info = user.info) === null || _user$info === void 0 || (_user$info = _user$info.roles) === null || _user$info === void 0 ? void 0 : _user$info.filter(role => role.tenantId === Digit.SessionStorage.get("Employee.tenantId"));
    if ((user === null || user === void 0 || (_user$info2 = user.info) === null || _user$info2 === void 0 || (_user$info2 = _user$info2.roles) === null || _user$info2 === void 0 ? void 0 : _user$info2.length) > 0) user.info.roles = filteredRoles;
    Digit.UserService.setUser(user);
    setEmployeeDetail(user === null || user === void 0 ? void 0 : user.info, user === null || user === void 0 ? void 0 : user.access_token);
    var redirectPath = "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.globalPath, "/user/setup");
    var getRedirectPathOtpLogin = (locationPathname, user, MdmsRes, RoleLandingUrl) => {
      var _user$info3, _window2, _MdmsRes$;
      var userRole = user === null || user === void 0 || (_user$info3 = user.info) === null || _user$info3 === void 0 || (_user$info3 = _user$info3.roles) === null || _user$info3 === void 0 || (_user$info3 = _user$info3[0]) === null || _user$info3 === void 0 ? void 0 : _user$info3.code;
      var isSuperUser = userRole === "SUPERUSER";
      var contextPath = (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.contextPath;
      switch (true) {
        case locationPathname === "/sandbox-ui/user/otp" && isSuperUser:
          return "/".concat(contextPath, "/employee/sandbox/landing");
        case isSuperUser && (MdmsRes === null || MdmsRes === void 0 || (_MdmsRes$ = MdmsRes[0]) === null || _MdmsRes$ === void 0 || (_MdmsRes$ = _MdmsRes$.rolesForLandingPage) === null || _MdmsRes$ === void 0 ? void 0 : _MdmsRes$.includes("SUPERUSER")):
          return "/".concat(contextPath).concat(RoleLandingUrl);
        default:
          return "/".concat(contextPath, "/employee");
      }
    };

    // Usage
    var redirectPathOtpLogin = getRedirectPathOtpLogin(location.pathname, user, MdmsRes, RoleLandingUrl);
    if (isLogin) {
      navigate(redirectPathOtpLogin); // Replaced history.push with navigate
      return;
    } else {
      navigate({
        pathname: redirectPath
      }, {
        state: {
          tenant: tenant
        }
      } // Pass state as a separate options object
      );
      return;
    }
  }, [user]);
  var onSubmit = /*#__PURE__*/function () {
    var _ref2 = _asyncToGenerator(function* (formData) {
      var _formData$OtpComponen;
      var requestData = {
        username: email,
        password: formData === null || formData === void 0 || (_formData$OtpComponen = formData.OtpComponent) === null || _formData$OtpComponen === void 0 ? void 0 : _formData$OtpComponen.otp,
        tenantId: tenant,
        userType: "EMPLOYEE"
      };
      try {
        var _yield$Digit$UserServ = yield Digit.UserService.authenticate(requestData),
          {
            UserRequest: info
          } = _yield$Digit$UserServ,
          tokens = _objectWithoutProperties(_yield$Digit$UserServ, _excluded);
        Digit.SessionStorage.set("Employee.tenantId", info === null || info === void 0 ? void 0 : info.tenantId);
        setUser(_objectSpread({
          info
        }, tokens));
      } catch (err) {
        var _err$response;
        setShowToast((err === null || err === void 0 || (_err$response = err.response) === null || _err$response === void 0 || (_err$response = _err$response.data) === null || _err$response === void 0 ? void 0 : _err$response.error_description) || (err === null || err === void 0 ? void 0 : err.message) == "ES_ERROR_USER_NOT_PERMITTED" && t("ES_ERROR_USER_NOT_PERMITTED") || t("INVALID_LOGIN_CREDENTIALS"));
        setTimeout(closeToast, 5000);
      }
    });
    return function onSubmit(_x) {
      return _ref2.apply(this, arguments);
    };
  }();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_components_Background__WEBPACK_IMPORTED_MODULE_5__["default"], {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      className: "employeeBackbuttonAlign",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.BackLink, {
        onClick: () => navigate(-1)
      }), " "]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_2__.FormComposerV2, {
      onSubmit: onSubmit,
      noBoxShadow: true,
      inline: true,
      submitInForm: true,
      onFormValueChange: (setValue, formValue) => {
        var _otpValue$otp;
        var otpValue = formValue["OtpComponent"];
        if ((otpValue === null || otpValue === void 0 || (_otpValue$otp = otpValue.otp) === null || _otpValue$otp === void 0 ? void 0 : _otpValue$otp.length) === 6) {
          setIsOtpValid(true);
        } else {
          setIsOtpValid(false);
        }
      },
      isDisabled: !isOtpValid,
      config: config,
      label: OtpConfig[0].texts.submitButtonLabel,
      heading: OtpConfig[0].texts.header,
      headingStyle: {
        textAlign: "center"
      },
      cardStyle: {
        maxWidth: "408px",
        margin: "auto"
      },
      className: "sandbox-onboarding-wrapper",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_Header__WEBPACK_IMPORTED_MODULE_6__["default"], {
        showTenant: false
      })
    }), showToast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Toast, {
      type: "error",
      label: t(showToast),
      onClose: closeToast
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      className: "EmployeeLoginFooter",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_7__["default"], {
        alt: "Powered by DIGIT",
        src: (_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.globalConfigs) === null || _window3 === void 0 || (_window3$getConfig = _window3.getConfig) === null || _window3$getConfig === void 0 ? void 0 : _window3$getConfig.call(_window3, "DIGIT_FOOTER_BW"),
        style: {
          cursor: "pointer"
        },
        onClick: () => {
          var _window4, _window4$getConfig;
          window.open((_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.globalConfigs) === null || _window4 === void 0 || (_window4$getConfig = _window4.getConfig) === null || _window4$getConfig === void 0 ? void 0 : _window4$getConfig.call(_window4, "DIGIT_HOME_URL"), "_blank").focus();
        }
      }), " "]
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Otp);

/***/ }),

/***/ "./src/pages/employee/QuickStart/Config.js":
/*!*************************************************!*\
  !*** ./src/pages/employee/QuickStart/Config.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! . */ "./src/pages/employee/QuickStart/index.js");
/* harmony import */ var _QuickSetup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./QuickSetup */ "./src/pages/employee/QuickStart/QuickSetup.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
var _excluded = ["onSelect", "formData", "control", "formState"];
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }






var QuickSetupConfigComponent = _ref => {
  var {
      onSelect,
      formData,
      control,
      formState
    } = _ref,
    props = _objectWithoutProperties(_ref, _excluded);
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var {
    isLoading,
    data
  } = Digit.Hooks.useAccessControl();
  var isMultiRootTenant = Digit.Utils.getMultiRootTenant();
  var tenantId = Digit.ULBService.getStateId();

  // const transformURL = (url = "") => {
  //   if (url == "/") {
  //     return;
  //   }
  //   if (Digit.Utils.isContextPathMissing(url)) {
  //     let updatedUrl = null;
  //     if (isMultiRootTenant) {
  //       url = url.replace("/sandbox-ui/employee", `/sandbox-ui/${tenantId}/employee`);
  //       updatedUrl = url;
  //     } else {
  //       updatedUrl = DIGIT_UI_CONTEXTS?.every((e) => url?.indexOf(`/${e}`) === -1) ? "/employee/" + url : url;
  //     }
  //     return updatedUrl;
  //   } else {
  //     return url;
  //   }
  // };

  var configEmployeeSideBar = data === null || data === void 0 ? void 0 : data.actions.filter(e => e.url === "card" && e.parentModule).reduce((acc, item) => {
    var module = item.parentModule;
    if (!acc[module]) {
      acc[module] = {
        module: module,
        label: Digit.Utils.locale.getTransformedLocale("".concat(module, "_CARD_HEADER")),
        links: []
      };
    }
    var linkUrl = Digit.Utils.transformURL(item.navigationURL, tenantId);
    var queryParamIndex = linkUrl.indexOf("?");
    acc[module].links.push({
      link: queryParamIndex === -1 ? linkUrl : linkUrl.substring(0, queryParamIndex),
      label: t(Digit.Utils.locale.getTransformedLocale("".concat(module, "_LINK_").concat(item.displayName))),
      queryParams: queryParamIndex === -1 ? null : linkUrl.substring(queryParamIndex),
      description: t(Digit.Utils.locale.getTransformedLocale("".concat(module, "_LINK_").concat(item.displayName, "_DESCRIPTION")))
    });
    return acc;
  }, {});
  if (!configEmployeeSideBar) {
    return "";
  }
  var QuickSetupConfig = [{
    sectionHeader: "WELCOME_TO_SANDBOX",
    sections: [{
      label: "SANDBOX_DESCRIPTION_1"
    }, {
      label: "SANDBOX_DESCRIPTION_2"
    }, {
      label: "SANDBOX_DESCRIPTION_3"
    }]
  }, {
    sectionHeader: "QUICK_SETUP",
    links: configEmployeeSideBar
  }];
  var cardConfig = [{
    id: 1,
    type: "faqs",
    actions: [{
      question: "SANDBOX_FAQ_QUES_14",
      isLabelLink: true,
      answer: [{
        label: "SANDBOX_FAQ_ANS_14_LABEL_1",
        fulllink: true,
        link: "https://egov-digit.gitbook.io/digit-sandbox/specifications/user-manual/walkthrough-videos"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_1",
      content: "SANDBOX_FAQ_CONTENT_1",
      isLabelLink: true,
      answer: [{
        label: "SANDBOX_FAQ_ANS_1_LABEL_1",
        link: "citizen/login",
        description: "SANDBOX_FAQ_ANS_1_DESCRIPTION_1"
      }, {
        label: "SANDBOX_FAQ_ANS_1_LABEL_2",
        link: "employee/user/login",
        description: "SANDBOX_FAQ_ANS_1_DESCRIPTION_2"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_2",
      content: "SANDBOX_FAQ_CONTENT_2",
      answer: [{
        label: null,
        description: "SANDBOX_FAQ_ANS_2_DESCRIPTION_1"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_2_DESCRIPTION_2"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_2_DESCRIPTION_3"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_2_DESCRIPTION_4"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_3",
      content: "SANDBOX_FAQ_CONTENT_3",
      answer: [{
        label: null,
        description: "SANDBOX_FAQ_ANS_3_DESCRIPTION_1"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_3_DESCRIPTION_2"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_3_DESCRIPTION_3"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_3_DESCRIPTION_4"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_4",
      content: "SANDBOX_FAQ_CONTENT_4",
      answer: [{
        label: null,
        description: "SANDBOX_FAQ_ANS_4_DESCRIPTION_1"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_4_DESCRIPTION_2"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_5",
      content: "SANDBOX_FAQ_CONTENT_5",
      answer: [{
        label: "SANDBOX_FAQ_ANS_5_LABEL_1",
        description: "SANDBOX_FAQ_ANS_5_DESCRIPTION_1"
      }, {
        label: "SANDBOX_FAQ_ANS_5_LABEL_2",
        description: "SANDBOX_FAQ_ANS_5_DESCRIPTION_2"
      }, {
        label: "SANDBOX_FAQ_ANS_5_LABEL_3",
        description: "SANDBOX_FAQ_ANS_5_DESCRIPTION_3"
      }, {
        label: "SANDBOX_FAQ_ANS_5_LABEL_4",
        description: "SANDBOX_FAQ_ANS_5_DESCRIPTION_4"
      }, {
        label: "SANDBOX_FAQ_ANS_5_LABEL_5",
        description: "SANDBOX_FAQ_ANS_5_DESCRIPTION_5"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_6",
      content: "SANDBOX_FAQ_CONTENT_6"
    }, {
      question: "SANDBOX_FAQ_QUES_7",
      content: "SANDBOX_FAQ_CONTENT_7",
      answer: [{
        label: null,
        description: "SANDBOX_FAQ_ANS_7_DESCRIPTION_1"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_7_DESCRIPTION_2"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_8",
      content: "SANDBOX_FAQ_CONTENT_8",
      answer: [{
        label: null,
        description: "SANDBOX_FAQ_ANS_8_DESCRIPTION_1"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_8_DESCRIPTION_2"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_8_DESCRIPTION_3"
      }, {
        label: null,
        description: "SANDBOX_FAQ_ANS_8_DESCRIPTION_4"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_9",
      content: "SANDBOX_FAQ_CONTENT_9",
      answer: [{
        label: "SANDBOX_FAQ_ANS_9_LABEL_1",
        description: "SANDBOX_FAQ_ANS_9_DESCRIPTION_1"
      }, {
        label: "SANDBOX_FAQ_ANS_9_LABEL_2",
        description: "SANDBOX_FAQ_ANS_9_DESCRIPTION_2"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_10",
      content: "SANDBOX_FAQ_CONTENT_10",
      answer: [{
        label: "SANDBOX_FAQ_ANS_10_LABEL_1",
        description: "SANDBOX_FAQ_ANS_10_DESCRIPTION_1"
      }, {
        label: "SANDBOX_FAQ_ANS_10_LABEL_2",
        description: "SANDBOX_FAQ_ANS_10_DESCRIPTION_2"
      }, {
        label: "SANDBOX_FAQ_ANS_10_LABEL_3",
        description: "SANDBOX_FAQ_ANS_10_DESCRIPTION_3"
      }, {
        label: "SANDBOX_FAQ_ANS_10_LABEL_4",
        description: "SANDBOX_FAQ_ANS_10_DESCRIPTION_4"
      }]
    }, {
      question: "SANDBOX_FAQ_QUES_11",
      content: "SANDBOX_FAQ_CONTENT_11"
    }, {
      question: "SANDBOX_FAQ_QUES_12",
      content: "SANDBOX_FAQ_CONTENT_12"
    }, {
      question: "SANDBOX_FAQ_QUES_13",
      content: "SANDBOX_FAQ_CONTENT_13"
    }]
  }];

  // return <QuickSetupComponent config={QuickSetupConfig}></QuickSetupComponent>;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_QuickSetup__WEBPACK_IMPORTED_MODULE_4__["default"], {
    cardConfig: cardConfig
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuickSetupConfigComponent);

/***/ }),

/***/ "./src/pages/employee/QuickStart/QuickSetup.js":
/*!*****************************************************!*\
  !*** ./src/pages/employee/QuickStart/QuickSetup.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @egovernments/digit-ui-svg-components */ "@egovernments/digit-ui-svg-components");
/* harmony import */ var _egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @egovernments/digit-ui-react-components */ "@egovernments/digit-ui-react-components");
/* harmony import */ var _egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");







var FaqComponent = props => {
  var {
    question,
    isLabelLink,
    answer,
    type,
    actions,
    content,
    lastIndex
  } = props;
  var [isOpen, toggleOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var tenantId = Digit.ULBService.getStateId();
  var ListTag = type === "number" ? "ol" : "ul";
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
    className: "faqs border-none",
    onClick: () => toggleOpen(!isOpen),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
      className: "faq-question",
      style: {
        justifyContent: "space-between",
        display: "flex"
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
        children: t(question)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
        className: isOpen ? "faqicon rotate" : "faqicon",
        style: {
          float: "right"
        },
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_svg_components__WEBPACK_IMPORTED_MODULE_3__.ArrowForward, {})
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
      className: "faq-answer",
      style: isOpen ? {
        display: "block"
      } : {
        display: "none"
      },
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_4__.CardSectionSubText, {
        style: {
          marginTop: "1rem"
        },
        children: t(content)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
        style: {
          marginTop: "1rem"
        },
        children: actions && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(ListTag, {
          children: actions.map((action, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("li", {
            style: {
              listStyleType: ListTag === "ul" ? "disc" : "auto",
              margin: "8px 0"
            },
            children: [isLabelLink ? action !== null && action !== void 0 && action.label ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
              variation: "teritiary",
              label: t(action === null || action === void 0 ? void 0 : action.label),
              type: "button",
              size: "medium",
              onClick: () => {
                if (action !== null && action !== void 0 && action.fulllink) {
                  window.open(action === null || action === void 0 ? void 0 : action.link, "_blank");
                } else {
                  var _window;
                  var baseURL = "https://".concat(window.location.hostname, "/").concat((_window = window) === null || _window === void 0 ? void 0 : _window.globalPath, "/").concat(tenantId);
                  window.open("".concat(baseURL, "/").concat(action === null || action === void 0 ? void 0 : action.link), "_blank");
                }
              },
              style: {
                padding: "0px"
              }
            }) : null : action !== null && action !== void 0 && action.label ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("strong", {
              children: [t(action === null || action === void 0 ? void 0 : action.label), ":"]
            }) : null, t(action === null || action === void 0 ? void 0 : action.description)]
          }, index))
        })
      })]
    }), !lastIndex ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
      className: "cs-box-border"
    }) : null]
  });
};
var CardC = _ref => {
  var {
    type,
    title,
    content,
    actions,
    style
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var ListTag = type === "number" ? "ol" : "ul";
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_4__.CardSectionHeader, {
      children: t(title)
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_4__.CardSectionSubText, {
      style: {
        marginTop: "1rem"
      },
      children: t(content)
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
      style: {
        marginTop: "1rem"
      },
      children: actions && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(ListTag, {
        children: actions.map((action, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("li", {
          style: {
            listStyleType: ListTag === "ul" ? "disc" : "auto",
            margin: "8px 0"
          },
          children: [action !== null && action !== void 0 && action.label ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("strong", {
            children: [t(action === null || action === void 0 ? void 0 : action.label), ":"]
          }) : null, " ", t(action === null || action === void 0 ? void 0 : action.description)]
        }, index))
      })
    })]
  });
};
var FAQ = _ref2 => {
  var {
    key,
    title,
    content,
    faqs,
    type
  } = _ref2;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
    style: {
      width: "100%"
    },
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
      style: {
        width: "100%"
      },
      children: faqs.map((faq, i) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(FaqComponent, {
        question: faq.question,
        answer: faq.answer,
        isLabelLink: faq.isLabelLink,
        type: type,
        actions: faq.answer,
        content: faq.content,
        lastIndex: i === (faqs === null || faqs === void 0 ? void 0 : faqs.length) - 1
      }, "faq_" + i))
    })
  });
};
var QuickSetup = _ref3 => {
  var {
    cardConfig
  } = _ref3;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var moduleFaqs = [{
    question: "SANDBOX_FAQ_QUES_ONE",
    answer: "SANDBOX_FAQ_ANS_ONE"
  }, {
    question: "SANDBOX_FAQ_QUES_TWO",
    answer: "SANDBOX_FAQ_ANS_TWO"
  }, {
    question: "SANDBOX_FAQ_QUES_THREE",
    answer: "SANDBOX_FAQ_ANS_THREE"
  }, {
    question: "SANDBOX_FAQ_QUES_FOUR",
    answer: "SANDBOX_FAQ_ANS_FOUR"
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Card, {
    className: "sandbox-guide",
    style: {
      width: "25rem",
      height: "47rem",
      overflowY: "scroll"
    },
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.CardHeader, {
      children: t("GUIDE_TO_SETUP")
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
      style: {
        display: "flex",
        flexWrap: "wrap"
      },
      children: cardConfig.map((config, index) => {
        return (config === null || config === void 0 ? void 0 : config.type) === "faqs" ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(FAQ, {
          title: config.title,
          type: config === null || config === void 0 ? void 0 : config.type,
          content: config.content,
          faqs: config.actions
        }, config.id) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(CardC, {
            type: config === null || config === void 0 ? void 0 : config.type,
            title: config.title,
            content: config.content,
            actions: config.actions,
            style: config.style
          }, config.id), index !== (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.length) - 1 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_egovernments_digit_ui_react_components__WEBPACK_IMPORTED_MODULE_4__.BreakLine, {
            style: {
              width: "100%",
              border: "1px solid #d6d5d4"
            }
          })]
        });
      })
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuickSetup);

/***/ }),

/***/ "./src/pages/employee/QuickStart/index.js":
/*!************************************************!*\
  !*** ./src/pages/employee/QuickStart/index.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");





var QuickSetupComponent = _ref => {
  var {
    config
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.Card, {
    children: config.map((section, sectionIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.CardHeader, {
        children: t(section.sectionHeader)
      }), section.sections && section.sections.map((item, itemIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.CardText, {
        children: t(item.label)
      }, itemIndex)), section.links && Object.values(section.links).map((linkGroup, linkIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.CardText, {
          children: t(linkGroup.description)
        }), linkGroup.links.map((link, linkItemIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.Link, {
            to: {
              pathname: link.link,
              search: link.queryParams
            },
            className: "quickLink",
            children: t(link.label)
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_2__.CardText, {
            children: t(link.description)
          })]
        }, linkItemIndex))]
      }, linkIndex))]
    }, sectionIndex))
  });
};
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (QuickSetupComponent);

/***/ }),

/***/ "./src/pages/employee/SignUp/config.js":
/*!*********************************************!*\
  !*** ./src/pages/employee/SignUp/config.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   SignUpConfig: () => (/* binding */ SignUpConfig)
/* harmony export */ });
var SignUpConfig = [{
  texts: {
    header: "CORE_COMMON_SIGN_UP",
    submitButtonLabel: "CORE_COMMON_SIGN_UP_BUTTON"
  },
  inputs: [{
    label: "CORE_SIGNUP_EMAILID",
    type: "text",
    key: "email",
    isMandatory: true,
    populators: {
      name: "email",
      validation: {
        required: true,
        pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
        maxLength: 64
      },
      error: "ERR_EMAIL_REQUIRED"
    }
  }, {
    label: "CORE_SIGNUP_ACCOUNT_NAME",
    type: "text",
    key: "accountName",
    isMandatory: true,
    populators: {
      name: "accountName",
      validation: {
        required: true,
        pattern: /^[A-Za-z]+( [A-Za-z]+)*$/,
        maxLength: 50
      },
      error: "ERR_ACCOUNT_NAME_REQUIRED"
    },
    infoMessage: "SANDBOX_SIGNUP_ACCOUNT_NAME_TOOLTIP"
  }, {
    isMandatory: false,
    key: "check",
    type: "component",
    component: "PrivacyComponent",
    withoutLabel: true,
    disable: false,
    customProps: {
      module: "SandboxSignUp"
    },
    populators: {
      name: "check"
    }
  }],
  bannerImages: [{
    id: 1,
    image: 'https://images.unsplash.com/photo-1746277121508-f44615ff09bb',
    title: 'A digital partner for frontline workers',
    description: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio nobis temporibus provident expedita consequuntur, repudiandae pariatur! Deleniti molestias vero, cumque vel error labore ipsam totam?"
  }, {
    id: 2,
    image: 'https://images.unsplash.com/photo-1581094271901-8022df4466f9',
    title: 'Feature 2 Title',
    description: "Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."
  }, {
    id: 3,
    image: 'https://images.unsplash.com/photo-1624555130581-1d9cca783bc0',
    title: 'Feature 3 Title',
    description: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate aut autem aperiam et modi saepe obcaecati doloremque voluptatem iusto quidem!"
  }, {
    id: 4,
    image: 'https://images.unsplash.com/photo-1547481887-a26e2cacb5b2',
    title: 'Feature 4 Title',
    description: "Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."
  }, {
    id: 5,
    image: 'https://images.unsplash.com/photo-1536782376847-5c9d14d97cc0',
    title: 'Feature 5 Title',
    description: "Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."
  }, {
    id: 6,
    image: 'https://images.unsplash.com/photo-1490730141103-6cac27aaab94',
    title: 'Feature 6 Title',
    description: "Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."
  }]
}];

/***/ }),

/***/ "./src/pages/employee/SignUp/index.js":
/*!********************************************!*\
  !*** ./src/pages/employee/SignUp/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ "./src/pages/employee/SignUp/config.js");
/* harmony import */ var _signUp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./signUp */ "./src/pages/employee/SignUp/signUp.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }






var SignUp = _ref => {
  var {
    stateCode
  } = _ref;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var [SignUpConfig, setSignUpConfig] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_config__WEBPACK_IMPORTED_MODULE_3__.SignUpConfig);
  var moduleCode = ["privacy-policy"];
  var language = Digit.StoreData.getCurrentLanguage();
  var modulePrefix = "digit";
  var {
    data: store
  } = Digit.Services.useStore({
    stateCode,
    moduleCode,
    language,
    modulePrefix
  });
  var {
    data: mdmsData,
    isLoading
  } = Digit.Hooks.useCommonMDMS(stateCode, "commonUiConfig", ["SignUpConfig"], {
    select: data => {
      var _data$commonUiConfig;
      return {
        config: data === null || data === void 0 || (_data$commonUiConfig = data.commonUiConfig) === null || _data$commonUiConfig === void 0 ? void 0 : _data$commonUiConfig.SignUpConfig
      };
    },
    retry: false
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!isLoading && mdmsData !== null && mdmsData !== void 0 && mdmsData.config) {
      setSignUpConfig(mdmsData.config);
    } else {
      setSignUpConfig(_config__WEBPACK_IMPORTED_MODULE_3__.SignUpConfig);
    }
  }, [mdmsData, isLoading]);
  var SignUpParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => SignUpConfig.map(step => {
    var texts = {};
    for (var key in step.texts) {
      texts[key] = t(step.texts[key]);
    }
    return _objectSpread(_objectSpread({}, step), {}, {
      texts
    });
  }), [SignUpConfig]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Routes, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
      path: "",
      element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_signUp__WEBPACK_IMPORTED_MODULE_4__["default"], {
        config: SignUpParams[0],
        t: t
      })
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SignUp);

/***/ }),

/***/ "./src/pages/employee/SignUp/signUp.js":
/*!*********************************************!*\
  !*** ./src/pages/employee/SignUp/signUp.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_Background__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../components/Background */ "./src/components/Background.js");
/* harmony import */ var _components_Header__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../components/Header */ "./src/components/Header.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }








var Login = _ref => {
  var _config$, _config$2, _propsConfig$texts, _propsConfig$texts2, _propsConfig$texts3, _window2, _window2$getConfig;
  var {
    config: propsConfig,
    t,
    isDisabled
  } = _ref;
  var {
    data: cities,
    isLoading
  } = Digit.Hooks.useTenants();
  var {
    data: storeData,
    isLoading: isStoreLoading
  } = Digit.Hooks.useStore.getInitData();
  var {
    stateInfo
  } = storeData || {};
  var [showToast, setShowToast] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  var [disable, setDisable] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  var reqCreate = {
    url: "/tenant-management/tenant/_create",
    params: {},
    body: {},
    config: {
      enable: false
    }
  };
  var mutation = Digit.Hooks.useCustomAPIMutationHook(reqCreate);
  var onLogin = /*#__PURE__*/function () {
    var _ref2 = _asyncToGenerator(function* (data) {
      yield mutation.mutate({
        body: {
          tenant: {
            name: data.accountName,
            email: data.email
          }
        },
        config: {
          enable: true
        }
      }, {
        onError: (error, variables) => {
          var _error$response, _error$response2;
          setShowToast({
            key: "error",
            label: error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && (_error$response = _error$response.data) !== null && _error$response !== void 0 && (_error$response = _error$response.Errors) !== null && _error$response !== void 0 && (_error$response = _error$response[0]) !== null && _error$response !== void 0 && _error$response.code ? "SANDBOX_SIGNUP_".concat(error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.data) === null || _error$response2 === void 0 || (_error$response2 = _error$response2.Errors) === null || _error$response2 === void 0 || (_error$response2 = _error$response2[0]) === null || _error$response2 === void 0 ? void 0 : _error$response2.code) : "SANDBOX_SIGNUP_ERROR"
          });
        },
        onSuccess: function () {
          var _onSuccess = _asyncToGenerator(function* (data) {
            var _window, _data$Tenants$, _data$Tenants$2;
            navigate({
              pathname: "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.globalPath, "/user/otp"),
              state: {
                email: data === null || data === void 0 || (_data$Tenants$ = data.Tenants[0]) === null || _data$Tenants$ === void 0 ? void 0 : _data$Tenants$.email,
                tenant: data === null || data === void 0 || (_data$Tenants$2 = data.Tenants[0]) === null || _data$Tenants$2 === void 0 ? void 0 : _data$Tenants$2.code
              }
            });
          });
          function onSuccess(_x2) {
            return _onSuccess.apply(this, arguments);
          }
          return onSuccess;
        }()
      });
    });
    return function onLogin(_x) {
      return _ref2.apply(this, arguments);
    };
  }();
  var closeToast = () => {
    setShowToast(null);
  };
  var config = [{
    body: propsConfig === null || propsConfig === void 0 ? void 0 : propsConfig.inputs
  }];
  var {
    mode
  } = Digit.Hooks.useQueryParams();
  if (mode === "admin" && (config === null || config === void 0 || (_config$ = config[0]) === null || _config$ === void 0 || (_config$ = _config$.body) === null || _config$ === void 0 || (_config$ = _config$[2]) === null || _config$ === void 0 ? void 0 : _config$.disable) == false && (config === null || config === void 0 || (_config$2 = config[0]) === null || _config$2 === void 0 || (_config$2 = _config$2.body) === null || _config$2 === void 0 || (_config$2 = _config$2[2]) === null || _config$2 === void 0 || (_config$2 = _config$2.populators) === null || _config$2 === void 0 ? void 0 : _config$2.defaultValue) == undefined) {
    config[0].body[2].disable = true;
    config[0].body[2].isMandatory = false;
    config[0].body[2].populators.defaultValue = defaultValue;
  }
  var onFormValueChange = (setValue, formData, formState) => {
    // Extract keys from the config
    var keys = config[0].body.map(field => field.key);
    var hasEmptyFields = keys.some(key => {
      var value = formData[key];
      return value == null || value === "" || key === "check" && value === false || key === "captcha" && value === false;
    });

    // Set disable based on the check
    setDisable(hasEmptyFields);
  };
  return isLoading || isStoreLoading ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Loader, {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_components_Background__WEBPACK_IMPORTED_MODULE_4__["default"], {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "employeeBackbuttonAlign",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.BackLink, {
        onClick: () => window.history.back()
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.FormComposerV2, {
      onSubmit: onLogin,
      isDisabled: isDisabled || disable,
      noBoxShadow: true,
      inline: true,
      submitInForm: true,
      config: config,
      label: propsConfig === null || propsConfig === void 0 || (_propsConfig$texts = propsConfig.texts) === null || _propsConfig$texts === void 0 ? void 0 : _propsConfig$texts.submitButtonLabel,
      secondaryActionLabel: propsConfig === null || propsConfig === void 0 || (_propsConfig$texts2 = propsConfig.texts) === null || _propsConfig$texts2 === void 0 ? void 0 : _propsConfig$texts2.secondaryButtonLabel,
      onFormValueChange: onFormValueChange,
      heading: propsConfig === null || propsConfig === void 0 || (_propsConfig$texts3 = propsConfig.texts) === null || _propsConfig$texts3 === void 0 ? void 0 : _propsConfig$texts3.header,
      className: "sandbox-signup-form",
      cardSubHeaderClassName: "signupCardSubHeaderClassName",
      cardClassName: "signupCardClassName sandbox-onboarding-wrapper",
      buttonClassName: "buttonClassName",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_Header__WEBPACK_IMPORTED_MODULE_5__["default"], {
        showTenant: false
      })
    }), showToast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_0__.Toast, {
      type: "error",
      label: t(showToast === null || showToast === void 0 ? void 0 : showToast.label),
      onClose: closeToast
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "employee-login-home-footer",
      style: {
        backgroundColor: "unset"
      },
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("img", {
        alt: "Powered by DIGIT",
        src: (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.globalConfigs) === null || _window2 === void 0 || (_window2$getConfig = _window2.getConfig) === null || _window2$getConfig === void 0 ? void 0 : _window2$getConfig.call(_window2, "DIGIT_FOOTER_BW"),
        style: {
          cursor: "pointer"
        },
        onClick: () => {
          var _window3, _window3$getConfig;
          window.open((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.globalConfigs) === null || _window3 === void 0 || (_window3$getConfig = _window3.getConfig) === null || _window3$getConfig === void 0 ? void 0 : _window3$getConfig.call(_window3, "DIGIT_HOME_URL"), "_blank").focus();
        }
      })
    })]
  });
};
Login.propTypes = {
  loginParams: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().any)
};
Login.defaultProps = {
  loginParams: null
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Login);

/***/ }),

/***/ "./src/pages/employee/ViewUrl/index.js":
/*!*********************************************!*\
  !*** ./src/pages/employee/ViewUrl/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_Background__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../components/Background */ "./src/components/Background.js");
/* harmony import */ var _components_Header__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../components/Header */ "./src/components/Header.js");
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");








var ViewUrl = () => {
  var _Digit$SessionStorage, _window3, _window4, _window4$getConfig;
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)();
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  var {
    tenant
  } = location.state || {};
  var ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
  var getUserRoles = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 || (_Digit$SessionStorage = _Digit$SessionStorage.info) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.roles;
  var [buttonDisabled, setButtonDisabled] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
  var {
    data: MdmsRes
  } = Digit.Hooks.useCustomMDMS(tenant, "SandBoxLanding", [{
    name: "LandingPageRoles"
  }], {
    enabled: true,
    staleTime: 0,
    gcTime: 0,
    select: data => {
      var _data$SandBoxLanding;
      return data === null || data === void 0 || (_data$SandBoxLanding = data["SandBoxLanding"]) === null || _data$SandBoxLanding === void 0 ? void 0 : _data$SandBoxLanding["LandingPageRoles"];
    }
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (MdmsRes !== null && MdmsRes !== void 0 && MdmsRes[0].url) {
      setButtonDisabled(false);
    }
  }, [MdmsRes]);
  var RoleLandingUrl = MdmsRes === null || MdmsRes === void 0 ? void 0 : MdmsRes[0].url;
  var roleForLandingPage = (getUserRoles, MdmsRes) => {
    var _getUserRoles$;
    var userRole = getUserRoles === null || getUserRoles === void 0 || (_getUserRoles$ = getUserRoles[0]) === null || _getUserRoles$ === void 0 ? void 0 : _getUserRoles$.code;
    return userRole === "SUPERUSER" && MdmsRes.some(page => page.rolesForLandingPage.includes("SUPERUSER"));
  };
  var onButtonClick = () => {
    if (roleForLandingPage(getUserRoles, MdmsRes)) {
      var _window;
      window.location.href = "/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.globalPath, "/").concat(tenant).concat(RoleLandingUrl);
    } else {
      var _window2;
      window.location.href = "/".concat((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.globalPath, "/").concat(tenant, "/employee");
    }
  };
  var handleCopyUrl = () => {
    navigator.clipboard.writeText(ref.current.value);
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_components_Background__WEBPACK_IMPORTED_MODULE_4__["default"], {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "employeeBackbuttonAlign",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.BackLink, {
        onClick: () => window.history.back()
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Card, {
      className: "card-sandbox",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_Header__WEBPACK_IMPORTED_MODULE_5__["default"], {
        showTenant: false
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
        className: "sandbox-success-signup",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.SVG.TickMark, {
          fill: "#fff",
          height: 30,
          width: 70
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CardHeader, {
        className: "cardHeader-sandbox",
        styles: {
          color: "#00703c"
        },
        children: t("SANDBOX_HEADER")
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CardText, {
        className: "cardText-sandbox",
        children: t("SAMDBOX_URL_SUB")
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.CardLabel, {
        children: [" ", t("SANDBOX_URL"), " "]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
        className: "sandbox-url-wrapper",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.TextInput, {
          inputRef: ref,
          className: "urlInputText",
          onChange: () => {},
          nonEditable: true,
          value: "".concat(window.location.host, "/").concat((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.globalPath, "/").concat(tenant, "/employee")
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
          className: "copyButton",
          variation: "secondary",
          onClick: () => handleCopyUrl(),
          label: t("COPY_URL")
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
        className: "sandbox-url-footer",
        children: t("SANDBOX_URL_FOOT")
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
        isDisabled: buttonDisabled,
        onClick: onButtonClick,
        label: t("SIGN_IN")
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "EmployeeLoginFooter",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_6__["default"], {
        alt: "Powered by DIGIT",
        src: (_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.globalConfigs) === null || _window4 === void 0 || (_window4$getConfig = _window4.getConfig) === null || _window4$getConfig === void 0 ? void 0 : _window4$getConfig.call(_window4, "DIGIT_FOOTER_BW"),
        style: {
          cursor: "pointer"
        },
        onClick: () => {
          var _window5, _window5$getConfig;
          window.open((_window5 = window) === null || _window5 === void 0 || (_window5 = _window5.globalConfigs) === null || _window5 === void 0 || (_window5$getConfig = _window5.getConfig) === null || _window5$getConfig === void 0 ? void 0 : _window5$getConfig.call(_window5, "DIGIT_HOME_URL"), "_blank").focus();
        }
      })
    })]
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewUrl);

/***/ }),

/***/ "./src/pages/employee/index.js":
/*!*************************************!*\
  !*** ./src/pages/employee/index.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "react-i18next");
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "react-router-dom");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_AppModules__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/AppModules */ "./src/components/AppModules.js");
/* harmony import */ var _components_ErrorBoundaries__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../components/ErrorBoundaries */ "./src/components/ErrorBoundaries.js");
/* harmony import */ var _components_TopBarSideBar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../components/TopBarSideBar */ "./src/components/TopBarSideBar/index.js");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @egovernments/digit-ui-components */ "@egovernments/digit-ui-components");
/* harmony import */ var _egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _components_ImageComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/ImageComponent */ "./src/components/ImageComponent.js");
/* harmony import */ var _hoc_withAutoFocusMain__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../hoc/withAutoFocusMain */ "./src/hoc/withAutoFocusMain.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/react/jsx-runtime.js");











// Create lazy components with fallbacks using the utility

var ChangePassword = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./ChangePassword */ "./src/pages/employee/ChangePassword/index.js")), () => (__webpack_require__(/*! ./ChangePassword */ "./src/pages/employee/ChangePassword/index.js")["default"]), {
  loaderText: "CORE_LOADING_CHANGE_PASSWORD"
});
var ForgotPassword = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./ForgotPassword */ "./src/pages/employee/ForgotPassword/index.js")), () => (__webpack_require__(/*! ./ForgotPassword */ "./src/pages/employee/ForgotPassword/index.js")["default"]), {
  loaderText: "CORE_LOADING_FORGOT_PASSWORD"
});
var LanguageSelection = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./LanguageSelection */ "./src/pages/employee/LanguageSelection/index.js")), () => (__webpack_require__(/*! ./LanguageSelection */ "./src/pages/employee/LanguageSelection/index.js")["default"]), {
  loaderText: "CORE_LOADING_LANGUAGE_SELECTION"
});
var EmployeeLogin = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Login */ "./src/pages/employee/Login/index.js")), () => (__webpack_require__(/*! ./Login */ "./src/pages/employee/Login/index.js")["default"]), {
  loaderText: "CORE_LOADING_LOGIN"
});
var Otp = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Otp */ "./src/pages/employee/Otp/index.js")), () => (__webpack_require__(/*! ./Otp */ "./src/pages/employee/Otp/index.js")["default"]), {
  loaderText: "CORE_LOADING_OTP"
});
var UserProfile = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ../citizen/Home/UserProfile */ "./src/pages/citizen/Home/UserProfile.js")), () => (__webpack_require__(/*! ../citizen/Home/UserProfile */ "./src/pages/citizen/Home/UserProfile.js")["default"]), {
  loaderText: "CORE_LOADING_USER_PROFILE"
});
var ErrorComponent = (0,_egovernments_digit_ui_components__WEBPACK_IMPORTED_MODULE_6__.lazyWithFallback)(() => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ../../components/ErrorComponent */ "./src/components/ErrorComponent.js")), () => (__webpack_require__(/*! ../../components/ErrorComponent */ "./src/components/ErrorComponent.js")["default"]), {
  loaderText: "CORE_LOADING_ERROR_COMPONENT"
});
var userScreensExempted = ["user/landing", "user/profile", "user/error", "user/productPage"];
var EmployeeApp = _ref => {
  var _location$pathname, _initData$modules, _window2, _window2$getConfig;
  var {
    stateInfo,
    userDetails,
    CITIZEN,
    cityDetails,
    mobileView,
    handleUserDropdownSelection,
    logoUrl,
    logoUrlWhite,
    stateCode,
    modules,
    appTenants,
    sourceUrl,
    pathname,
    // This prop seems unused, consider removing
    initData,
    noTopBar = false
  } = _ref;
  var navigate = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useNavigate)();
  var {
    t
  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)();
  var location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useLocation)();
  var showLanguageChange = location === null || location === void 0 || (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : _location$pathname.includes("language-selection");
  var isUserProfile = userScreensExempted.some(url => {
    var _location$pathname2;
    return location === null || location === void 0 || (_location$pathname2 = location.pathname) === null || _location$pathname2 === void 0 ? void 0 : _location$pathname2.includes(url);
  });
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    Digit.UserService.setType("employee");
  }, []);
  var additionalComponent = initData === null || initData === void 0 || (_initData$modules = initData.modules) === null || _initData$modules === void 0 || (_initData$modules = _initData$modules.filter(i => i === null || i === void 0 ? void 0 : i.additionalComponent)) === null || _initData$modules === void 0 ? void 0 : _initData$modules.map(i => i === null || i === void 0 ? void 0 : i.additionalComponent);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
    className: "employee",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Routes, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
        path: "user/*",
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
          children: [isUserProfile && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_TopBarSideBar__WEBPACK_IMPORTED_MODULE_5__["default"], {
            t: t,
            stateInfo: stateInfo,
            userDetails: userDetails,
            CITIZEN: CITIZEN,
            cityDetails: cityDetails,
            mobileView: mobileView,
            handleUserDropdownSelection: handleUserDropdownSelection,
            logoUrl: logoUrl,
            logoUrlWhite: logoUrlWhite,
            showSidebar: isUserProfile ? true : false,
            showLanguageChange: !showLanguageChange
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
            className: isUserProfile ? "grounded-container" : "loginContainer",
            style: isUserProfile ? {
              padding: 0,
              paddingTop: "0",
              marginLeft: mobileView ? "0" : "0"
            } : {
              "--banner-url": "url(".concat(stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl, ")"),
              padding: "0px"
            },
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Routes, {
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
                path: "login",
                element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(EmployeeLogin, {
                  stateCode: stateCode
                })
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
                path: "login/otp",
                element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Otp, {
                  isLogin: true
                })
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
                path: "forgot-password",
                element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(ForgotPassword, {
                  stateCode: stateCode
                })
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
                path: "change-password",
                element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(ChangePassword, {})
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
                path: "profile",
                element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(UserProfile, {
                  stateCode: stateCode,
                  userType: "employee",
                  cityDetails: cityDetails
                })
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
                path: "error",
                element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(ErrorComponent, {
                  initData: initData,
                  goToHome: () => {
                    var _window, _Digit, _Digit$getType;
                    navigate("/".concat((_window = window) === null || _window === void 0 ? void 0 : _window.contextPath, "/").concat((_Digit = Digit) === null || _Digit === void 0 || (_Digit = _Digit.UserService) === null || _Digit === void 0 || (_Digit$getType = _Digit.getType) === null || _Digit$getType === void 0 ? void 0 : _Digit$getType.call(_Digit)));
                  }
                })
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
                path: "language-selection",
                element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(LanguageSelection, {})
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
                path: "*",
                element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Navigate, {
                  to: "language-selection",
                  replace: true
                })
              })]
            })
          })]
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
        path: "*",
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
          children: [!noTopBar && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_TopBarSideBar__WEBPACK_IMPORTED_MODULE_5__["default"], {
            t: t,
            stateInfo: stateInfo,
            userDetails: userDetails,
            CITIZEN: CITIZEN,
            cityDetails: cityDetails,
            mobileView: mobileView,
            handleUserDropdownSelection: handleUserDropdownSelection,
            logoUrl: logoUrl,
            logoUrlWhite: logoUrlWhite,
            modules: modules
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
            className: !noTopBar ? "main digit-home-main" : "",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
              className: "employee-app-wrapper digit-home-app-wrapper",
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_ErrorBoundaries__WEBPACK_IMPORTED_MODULE_4__["default"], {
                initData: initData,
                children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_AppModules__WEBPACK_IMPORTED_MODULE_3__.AppModules, {
                  stateCode: stateCode,
                  userType: "employee",
                  modules: modules,
                  appTenants: appTenants,
                  additionalComponent: additionalComponent
                })
              })
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
              className: "employee-home-footer",
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_ImageComponent__WEBPACK_IMPORTED_MODULE_7__["default"], {
                alt: "Powered by DIGIT",
                src: (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.globalConfigs) === null || _window2 === void 0 || (_window2$getConfig = _window2.getConfig) === null || _window2$getConfig === void 0 ? void 0 : _window2$getConfig.call(_window2, "DIGIT_FOOTER"),
                style: {
                  height: "1.1em",
                  cursor: "pointer"
                },
                onClick: () => {
                  var _window3, _window3$getConfig;
                  window.open((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.globalConfigs) === null || _window3 === void 0 || (_window3$getConfig = _window3.getConfig) === null || _window3$getConfig === void 0 ? void 0 : _window3$getConfig.call(_window3, "DIGIT_HOME_URL"), "_blank").focus();
                }
              })
            })]
          })]
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Route, {
        path: "*",
        element: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_2__.Navigate, {
          to: "user/language-selection",
          replace: true
        })
      })]
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_hoc_withAutoFocusMain__WEBPACK_IMPORTED_MODULE_8__["default"])(EmployeeApp, ".digit-home-main"));

/***/ }),

/***/ "./src/redux/reducers/index.js":
/*!*************************************!*\
  !*** ./src/redux/reducers/index.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   commonReducer: () => (/* binding */ commonReducer)
/* harmony export */ });
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var commonReducer = defaultData => function () {
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultData;
  var action = arguments.length > 1 ? arguments[1] : undefined;
  switch (action.type) {
    case "LANGUAGE_SELECT":
      return _objectSpread(_objectSpread({}, state), {}, {
        selectedLanguage: action.payload
      });
    default:
      return state;
  }
};

/***/ }),

/***/ "./src/redux/store.js":
/*!****************************!*\
  !*** ./src/redux/store.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "redux");
/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(redux__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! redux-thunk */ "redux-thunk");
/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(redux_thunk__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _reducers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reducers */ "./src/redux/reducers/index.js");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }



var getRootReducer = (defaultStore, moduleReducers) => (0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(_objectSpread({
  common: (0,_reducers__WEBPACK_IMPORTED_MODULE_2__.commonReducer)(defaultStore)
}, moduleReducers));
var middleware = [(redux_thunk__WEBPACK_IMPORTED_MODULE_1___default())];
var composeEnhancers =  true && typeof window === "object" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : redux__WEBPACK_IMPORTED_MODULE_0__.compose;
var enhancer = composeEnhancers((0,redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware)(...middleware)
// other store enhancers if any
);
var getStore = function getStore(defaultStore) {
  var moduleReducers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(getRootReducer(defaultStore, moduleReducers), enhancer);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getStore);

/***/ }),

/***/ "@egovernments/digit-ui-components":
/*!****************************************************!*\
  !*** external "@egovernments/digit-ui-components" ***!
  \****************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__egovernments_digit_ui_components__;

/***/ }),

/***/ "@egovernments/digit-ui-react-components":
/*!**********************************************************!*\
  !*** external "@egovernments/digit-ui-react-components" ***!
  \**********************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__egovernments_digit_ui_react_components__;

/***/ }),

/***/ "@egovernments/digit-ui-svg-components":
/*!********************************************************!*\
  !*** external "@egovernments/digit-ui-svg-components" ***!
  \********************************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__egovernments_digit_ui_svg_components__;

/***/ }),

/***/ "@tanstack/react-query":
/*!****************************************!*\
  !*** external "@tanstack/react-query" ***!
  \****************************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__tanstack_react_query__;

/***/ }),

/***/ "react":
/*!************************!*\
  !*** external "React" ***!
  \************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_react__;

/***/ }),

/***/ "react-i18next":
/*!********************************!*\
  !*** external "react-i18next" ***!
  \********************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_react_i18next__;

/***/ }),

/***/ "react-redux":
/*!******************************!*\
  !*** external "react-redux" ***!
  \******************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_react_redux__;

/***/ }),

/***/ "react-router-dom":
/*!***********************************!*\
  !*** external "react-router-dom" ***!
  \***********************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_react_router_dom__;

/***/ }),

/***/ "redux":
/*!************************!*\
  !*** external "redux" ***!
  \************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_redux__;

/***/ }),

/***/ "redux-thunk":
/*!******************************!*\
  !*** external "redux-thunk" ***!
  \******************************/
/***/ ((module) => {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE_redux_thunk__;

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			if (cachedModule.error !== undefined) throw cachedModule.error;
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		try {
/******/ 			var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: __webpack_require__ };
/******/ 			__webpack_require__.i.forEach(function(handler) { handler(execOptions); });
/******/ 			module = execOptions.module;
/******/ 			execOptions.factory.call(module.exports, module, module.exports, execOptions.require);
/******/ 		} catch(e) {
/******/ 			module.error = e;
/******/ 			throw e;
/******/ 		}
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = __webpack_modules__;
/******/ 	
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = __webpack_module_cache__;
/******/ 	
/******/ 	// expose the module execution interceptor
/******/ 	__webpack_require__.i = [];
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/get javascript update chunk filename */
/******/ 	(() => {
/******/ 		// This function allow to reference all chunks
/******/ 		__webpack_require__.hu = (chunkId) => {
/******/ 			// return url for filenames based on template
/******/ 			return "" + chunkId + "." + __webpack_require__.h() + ".hot-update.js";
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/get update manifest filename */
/******/ 	(() => {
/******/ 		__webpack_require__.hmrF = () => ("main." + __webpack_require__.h() + ".hot-update.json");
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/getFullHash */
/******/ 	(() => {
/******/ 		__webpack_require__.h = () => ("5a340d1659238e20c0b3")
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/load script */
/******/ 	(() => {
/******/ 		var inProgress = {};
/******/ 		var dataWebpackPrefix = "@egovernments/digit-ui-module-core:";
/******/ 		// loadScript function to load a script via script tag
/******/ 		__webpack_require__.l = (url, done, key, chunkId) => {
/******/ 			if(inProgress[url]) { inProgress[url].push(done); return; }
/******/ 			var script, needAttach;
/******/ 			if(key !== undefined) {
/******/ 				var scripts = document.getElementsByTagName("script");
/******/ 				for(var i = 0; i < scripts.length; i++) {
/******/ 					var s = scripts[i];
/******/ 					if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
/******/ 				}
/******/ 			}
/******/ 			if(!script) {
/******/ 				needAttach = true;
/******/ 				script = document.createElement('script');
/******/ 		
/******/ 				script.charset = 'utf-8';
/******/ 				if (__webpack_require__.nc) {
/******/ 					script.setAttribute("nonce", __webpack_require__.nc);
/******/ 				}
/******/ 				script.setAttribute("data-webpack", dataWebpackPrefix + key);
/******/ 		
/******/ 				script.src = url;
/******/ 			}
/******/ 			inProgress[url] = [done];
/******/ 			var onScriptComplete = (prev, event) => {
/******/ 				// avoid mem leaks in IE.
/******/ 				script.onerror = script.onload = null;
/******/ 				clearTimeout(timeout);
/******/ 				var doneFns = inProgress[url];
/******/ 				delete inProgress[url];
/******/ 				script.parentNode && script.parentNode.removeChild(script);
/******/ 				doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ 				if(prev) return prev(event);
/******/ 			}
/******/ 			var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ 			script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ 			script.onload = onScriptComplete.bind(null, script.onload);
/******/ 			needAttach && document.head.appendChild(script);
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hot module replacement */
/******/ 	(() => {
/******/ 		var currentModuleData = {};
/******/ 		var installedModules = __webpack_require__.c;
/******/ 		
/******/ 		// module and require creation
/******/ 		var currentChildModule;
/******/ 		var currentParents = [];
/******/ 		
/******/ 		// status
/******/ 		var registeredStatusHandlers = [];
/******/ 		var currentStatus = "idle";
/******/ 		
/******/ 		// while downloading
/******/ 		var blockingPromises = 0;
/******/ 		var blockingPromisesWaiting = [];
/******/ 		
/******/ 		// The update info
/******/ 		var currentUpdateApplyHandlers;
/******/ 		var queuedInvalidatedModules;
/******/ 		
/******/ 		__webpack_require__.hmrD = currentModuleData;
/******/ 		
/******/ 		__webpack_require__.i.push(function (options) {
/******/ 			var module = options.module;
/******/ 			var require = createRequire(options.require, options.id);
/******/ 			module.hot = createModuleHotObject(options.id, module);
/******/ 			module.parents = currentParents;
/******/ 			module.children = [];
/******/ 			currentParents = [];
/******/ 			options.require = require;
/******/ 		});
/******/ 		
/******/ 		__webpack_require__.hmrC = {};
/******/ 		__webpack_require__.hmrI = {};
/******/ 		
/******/ 		function createRequire(require, moduleId) {
/******/ 			var me = installedModules[moduleId];
/******/ 			if (!me) return require;
/******/ 			var fn = function (request) {
/******/ 				if (me.hot.active) {
/******/ 					if (installedModules[request]) {
/******/ 						var parents = installedModules[request].parents;
/******/ 						if (parents.indexOf(moduleId) === -1) {
/******/ 							parents.push(moduleId);
/******/ 						}
/******/ 					} else {
/******/ 						currentParents = [moduleId];
/******/ 						currentChildModule = request;
/******/ 					}
/******/ 					if (me.children.indexOf(request) === -1) {
/******/ 						me.children.push(request);
/******/ 					}
/******/ 				} else {
/******/ 					console.warn(
/******/ 						"[HMR] unexpected require(" +
/******/ 							request +
/******/ 							") from disposed module " +
/******/ 							moduleId
/******/ 					);
/******/ 					currentParents = [];
/******/ 				}
/******/ 				return require(request);
/******/ 			};
/******/ 			var createPropertyDescriptor = function (name) {
/******/ 				return {
/******/ 					configurable: true,
/******/ 					enumerable: true,
/******/ 					get: function () {
/******/ 						return require[name];
/******/ 					},
/******/ 					set: function (value) {
/******/ 						require[name] = value;
/******/ 					}
/******/ 				};
/******/ 			};
/******/ 			for (var name in require) {
/******/ 				if (Object.prototype.hasOwnProperty.call(require, name) && name !== "e") {
/******/ 					Object.defineProperty(fn, name, createPropertyDescriptor(name));
/******/ 				}
/******/ 			}
/******/ 			fn.e = function (chunkId, fetchPriority) {
/******/ 				return trackBlockingPromise(require.e(chunkId, fetchPriority));
/******/ 			};
/******/ 			return fn;
/******/ 		}
/******/ 		
/******/ 		function createModuleHotObject(moduleId, me) {
/******/ 			var _main = currentChildModule !== moduleId;
/******/ 			var hot = {
/******/ 				// private stuff
/******/ 				_acceptedDependencies: {},
/******/ 				_acceptedErrorHandlers: {},
/******/ 				_declinedDependencies: {},
/******/ 				_selfAccepted: false,
/******/ 				_selfDeclined: false,
/******/ 				_selfInvalidated: false,
/******/ 				_disposeHandlers: [],
/******/ 				_main: _main,
/******/ 				_requireSelf: function () {
/******/ 					currentParents = me.parents.slice();
/******/ 					currentChildModule = _main ? undefined : moduleId;
/******/ 					__webpack_require__(moduleId);
/******/ 				},
/******/ 		
/******/ 				// Module API
/******/ 				active: true,
/******/ 				accept: function (dep, callback, errorHandler) {
/******/ 					if (dep === undefined) hot._selfAccepted = true;
/******/ 					else if (typeof dep === "function") hot._selfAccepted = dep;
/******/ 					else if (typeof dep === "object" && dep !== null) {
/******/ 						for (var i = 0; i < dep.length; i++) {
/******/ 							hot._acceptedDependencies[dep[i]] = callback || function () {};
/******/ 							hot._acceptedErrorHandlers[dep[i]] = errorHandler;
/******/ 						}
/******/ 					} else {
/******/ 						hot._acceptedDependencies[dep] = callback || function () {};
/******/ 						hot._acceptedErrorHandlers[dep] = errorHandler;
/******/ 					}
/******/ 				},
/******/ 				decline: function (dep) {
/******/ 					if (dep === undefined) hot._selfDeclined = true;
/******/ 					else if (typeof dep === "object" && dep !== null)
/******/ 						for (var i = 0; i < dep.length; i++)
/******/ 							hot._declinedDependencies[dep[i]] = true;
/******/ 					else hot._declinedDependencies[dep] = true;
/******/ 				},
/******/ 				dispose: function (callback) {
/******/ 					hot._disposeHandlers.push(callback);
/******/ 				},
/******/ 				addDisposeHandler: function (callback) {
/******/ 					hot._disposeHandlers.push(callback);
/******/ 				},
/******/ 				removeDisposeHandler: function (callback) {
/******/ 					var idx = hot._disposeHandlers.indexOf(callback);
/******/ 					if (idx >= 0) hot._disposeHandlers.splice(idx, 1);
/******/ 				},
/******/ 				invalidate: function () {
/******/ 					this._selfInvalidated = true;
/******/ 					switch (currentStatus) {
/******/ 						case "idle":
/******/ 							currentUpdateApplyHandlers = [];
/******/ 							Object.keys(__webpack_require__.hmrI).forEach(function (key) {
/******/ 								__webpack_require__.hmrI[key](
/******/ 									moduleId,
/******/ 									currentUpdateApplyHandlers
/******/ 								);
/******/ 							});
/******/ 							setStatus("ready");
/******/ 							break;
/******/ 						case "ready":
/******/ 							Object.keys(__webpack_require__.hmrI).forEach(function (key) {
/******/ 								__webpack_require__.hmrI[key](
/******/ 									moduleId,
/******/ 									currentUpdateApplyHandlers
/******/ 								);
/******/ 							});
/******/ 							break;
/******/ 						case "prepare":
/******/ 						case "check":
/******/ 						case "dispose":
/******/ 						case "apply":
/******/ 							(queuedInvalidatedModules = queuedInvalidatedModules || []).push(
/******/ 								moduleId
/******/ 							);
/******/ 							break;
/******/ 						default:
/******/ 							// ignore requests in error states
/******/ 							break;
/******/ 					}
/******/ 				},
/******/ 		
/******/ 				// Management API
/******/ 				check: hotCheck,
/******/ 				apply: hotApply,
/******/ 				status: function (l) {
/******/ 					if (!l) return currentStatus;
/******/ 					registeredStatusHandlers.push(l);
/******/ 				},
/******/ 				addStatusHandler: function (l) {
/******/ 					registeredStatusHandlers.push(l);
/******/ 				},
/******/ 				removeStatusHandler: function (l) {
/******/ 					var idx = registeredStatusHandlers.indexOf(l);
/******/ 					if (idx >= 0) registeredStatusHandlers.splice(idx, 1);
/******/ 				},
/******/ 		
/******/ 				// inherit from previous dispose call
/******/ 				data: currentModuleData[moduleId]
/******/ 			};
/******/ 			currentChildModule = undefined;
/******/ 			return hot;
/******/ 		}
/******/ 		
/******/ 		function setStatus(newStatus) {
/******/ 			currentStatus = newStatus;
/******/ 			var results = [];
/******/ 		
/******/ 			for (var i = 0; i < registeredStatusHandlers.length; i++)
/******/ 				results[i] = registeredStatusHandlers[i].call(null, newStatus);
/******/ 		
/******/ 			return Promise.all(results).then(function () {});
/******/ 		}
/******/ 		
/******/ 		function unblock() {
/******/ 			if (--blockingPromises === 0) {
/******/ 				setStatus("ready").then(function () {
/******/ 					if (blockingPromises === 0) {
/******/ 						var list = blockingPromisesWaiting;
/******/ 						blockingPromisesWaiting = [];
/******/ 						for (var i = 0; i < list.length; i++) {
/******/ 							list[i]();
/******/ 						}
/******/ 					}
/******/ 				});
/******/ 			}
/******/ 		}
/******/ 		
/******/ 		function trackBlockingPromise(promise) {
/******/ 			switch (currentStatus) {
/******/ 				case "ready":
/******/ 					setStatus("prepare");
/******/ 				/* fallthrough */
/******/ 				case "prepare":
/******/ 					blockingPromises++;
/******/ 					promise.then(unblock, unblock);
/******/ 					return promise;
/******/ 				default:
/******/ 					return promise;
/******/ 			}
/******/ 		}
/******/ 		
/******/ 		function waitForBlockingPromises(fn) {
/******/ 			if (blockingPromises === 0) return fn();
/******/ 			return new Promise(function (resolve) {
/******/ 				blockingPromisesWaiting.push(function () {
/******/ 					resolve(fn());
/******/ 				});
/******/ 			});
/******/ 		}
/******/ 		
/******/ 		function hotCheck(applyOnUpdate) {
/******/ 			if (currentStatus !== "idle") {
/******/ 				throw new Error("check() is only allowed in idle status");
/******/ 			}
/******/ 			return setStatus("check")
/******/ 				.then(__webpack_require__.hmrM)
/******/ 				.then(function (update) {
/******/ 					if (!update) {
/******/ 						return setStatus(applyInvalidatedModules() ? "ready" : "idle").then(
/******/ 							function () {
/******/ 								return null;
/******/ 							}
/******/ 						);
/******/ 					}
/******/ 		
/******/ 					return setStatus("prepare").then(function () {
/******/ 						var updatedModules = [];
/******/ 						currentUpdateApplyHandlers = [];
/******/ 		
/******/ 						return Promise.all(
/******/ 							Object.keys(__webpack_require__.hmrC).reduce(function (
/******/ 								promises,
/******/ 								key
/******/ 							) {
/******/ 								__webpack_require__.hmrC[key](
/******/ 									update.c,
/******/ 									update.r,
/******/ 									update.m,
/******/ 									promises,
/******/ 									currentUpdateApplyHandlers,
/******/ 									updatedModules
/******/ 								);
/******/ 								return promises;
/******/ 							}, [])
/******/ 						).then(function () {
/******/ 							return waitForBlockingPromises(function () {
/******/ 								if (applyOnUpdate) {
/******/ 									return internalApply(applyOnUpdate);
/******/ 								}
/******/ 								return setStatus("ready").then(function () {
/******/ 									return updatedModules;
/******/ 								});
/******/ 							});
/******/ 						});
/******/ 					});
/******/ 				});
/******/ 		}
/******/ 		
/******/ 		function hotApply(options) {
/******/ 			if (currentStatus !== "ready") {
/******/ 				return Promise.resolve().then(function () {
/******/ 					throw new Error(
/******/ 						"apply() is only allowed in ready status (state: " +
/******/ 							currentStatus +
/******/ 							")"
/******/ 					);
/******/ 				});
/******/ 			}
/******/ 			return internalApply(options);
/******/ 		}
/******/ 		
/******/ 		function internalApply(options) {
/******/ 			options = options || {};
/******/ 		
/******/ 			applyInvalidatedModules();
/******/ 		
/******/ 			var results = currentUpdateApplyHandlers.map(function (handler) {
/******/ 				return handler(options);
/******/ 			});
/******/ 			currentUpdateApplyHandlers = undefined;
/******/ 		
/******/ 			var errors = results
/******/ 				.map(function (r) {
/******/ 					return r.error;
/******/ 				})
/******/ 				.filter(Boolean);
/******/ 		
/******/ 			if (errors.length > 0) {
/******/ 				return setStatus("abort").then(function () {
/******/ 					throw errors[0];
/******/ 				});
/******/ 			}
/******/ 		
/******/ 			// Now in "dispose" phase
/******/ 			var disposePromise = setStatus("dispose");
/******/ 		
/******/ 			results.forEach(function (result) {
/******/ 				if (result.dispose) result.dispose();
/******/ 			});
/******/ 		
/******/ 			// Now in "apply" phase
/******/ 			var applyPromise = setStatus("apply");
/******/ 		
/******/ 			var error;
/******/ 			var reportError = function (err) {
/******/ 				if (!error) error = err;
/******/ 			};
/******/ 		
/******/ 			var outdatedModules = [];
/******/ 		
/******/ 			var onAccepted = function () {
/******/ 				return Promise.all([disposePromise, applyPromise]).then(function () {
/******/ 					// handle errors in accept handlers and self accepted module load
/******/ 					if (error) {
/******/ 						return setStatus("fail").then(function () {
/******/ 							throw error;
/******/ 						});
/******/ 					}
/******/ 		
/******/ 					if (queuedInvalidatedModules) {
/******/ 						return internalApply(options).then(function (list) {
/******/ 							outdatedModules.forEach(function (moduleId) {
/******/ 								if (list.indexOf(moduleId) < 0) list.push(moduleId);
/******/ 							});
/******/ 							return list;
/******/ 						});
/******/ 					}
/******/ 		
/******/ 					return setStatus("idle").then(function () {
/******/ 						return outdatedModules;
/******/ 					});
/******/ 				});
/******/ 			};
/******/ 		
/******/ 			return Promise.all(
/******/ 				results
/******/ 					.filter(function (result) {
/******/ 						return result.apply;
/******/ 					})
/******/ 					.map(function (result) {
/******/ 						return result.apply(reportError);
/******/ 					})
/******/ 			)
/******/ 				.then(function (applyResults) {
/******/ 					applyResults.forEach(function (modules) {
/******/ 						if (modules) {
/******/ 							for (var i = 0; i < modules.length; i++) {
/******/ 								outdatedModules.push(modules[i]);
/******/ 							}
/******/ 						}
/******/ 					});
/******/ 				})
/******/ 				.then(onAccepted);
/******/ 		}
/******/ 		
/******/ 		function applyInvalidatedModules() {
/******/ 			if (queuedInvalidatedModules) {
/******/ 				if (!currentUpdateApplyHandlers) currentUpdateApplyHandlers = [];
/******/ 				Object.keys(__webpack_require__.hmrI).forEach(function (key) {
/******/ 					queuedInvalidatedModules.forEach(function (moduleId) {
/******/ 						__webpack_require__.hmrI[key](
/******/ 							moduleId,
/******/ 							currentUpdateApplyHandlers
/******/ 						);
/******/ 					});
/******/ 				});
/******/ 				queuedInvalidatedModules = undefined;
/******/ 				return true;
/******/ 			}
/******/ 		}
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/publicPath */
/******/ 	(() => {
/******/ 		var scriptUrl;
/******/ 		if (globalThis.importScripts) scriptUrl = globalThis.location + "";
/******/ 		var document = globalThis.document;
/******/ 		if (!scriptUrl && document) {
/******/ 			if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
/******/ 				scriptUrl = document.currentScript.src;
/******/ 			if (!scriptUrl) {
/******/ 				var scripts = document.getElementsByTagName("script");
/******/ 				if(scripts.length) {
/******/ 					var i = scripts.length - 1;
/******/ 					while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
/******/ 				}
/******/ 			}
/******/ 		}
/******/ 		// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
/******/ 		// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
/******/ 		if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
/******/ 		scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
/******/ 		__webpack_require__.p = scriptUrl;
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/jsonp chunk loading */
/******/ 	(() => {
/******/ 		// no baseURI
/******/ 		
/******/ 		// object to store loaded and loading chunks
/******/ 		// undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ 		// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ 		var installedChunks = __webpack_require__.hmrS_jsonp = __webpack_require__.hmrS_jsonp || {
/******/ 			"main": 0
/******/ 		};
/******/ 		
/******/ 		// no chunk on demand loading
/******/ 		
/******/ 		// no prefetching
/******/ 		
/******/ 		// no preloaded
/******/ 		
/******/ 		var currentUpdatedModulesList;
/******/ 		var waitingUpdateResolves = {};
/******/ 		function loadUpdateChunk(chunkId, updatedModulesList) {
/******/ 			currentUpdatedModulesList = updatedModulesList;
/******/ 			return new Promise((resolve, reject) => {
/******/ 				waitingUpdateResolves[chunkId] = resolve;
/******/ 				// start update chunk loading
/******/ 				var url = __webpack_require__.p + __webpack_require__.hu(chunkId);
/******/ 				// create error before stack unwound to get useful stacktrace later
/******/ 				var error = new Error();
/******/ 				var loadingEnded = (event) => {
/******/ 					if(waitingUpdateResolves[chunkId]) {
/******/ 						waitingUpdateResolves[chunkId] = undefined
/******/ 						var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ 						var realSrc = event && event.target && event.target.src;
/******/ 						error.message = 'Loading hot update chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ 						error.name = 'ChunkLoadError';
/******/ 						error.type = errorType;
/******/ 						error.request = realSrc;
/******/ 						reject(error);
/******/ 					}
/******/ 				};
/******/ 				__webpack_require__.l(url, loadingEnded);
/******/ 			});
/******/ 		}
/******/ 		
/******/ 		this["webpackHotUpdate_egovernments_digit_ui_module_core"] = (chunkId, moreModules, runtime) => {
/******/ 			for(var moduleId in moreModules) {
/******/ 				if(__webpack_require__.o(moreModules, moduleId)) {
/******/ 					currentUpdate[moduleId] = moreModules[moduleId];
/******/ 					if(currentUpdatedModulesList) currentUpdatedModulesList.push(moduleId);
/******/ 				}
/******/ 			}
/******/ 			if(runtime) currentUpdateRuntime.push(runtime);
/******/ 			if(waitingUpdateResolves[chunkId]) {
/******/ 				waitingUpdateResolves[chunkId]();
/******/ 				waitingUpdateResolves[chunkId] = undefined;
/******/ 			}
/******/ 		};
/******/ 		
/******/ 		var currentUpdateChunks;
/******/ 		var currentUpdate;
/******/ 		var currentUpdateRemovedChunks;
/******/ 		var currentUpdateRuntime;
/******/ 		function applyHandler(options) {
/******/ 			if (__webpack_require__.f) delete __webpack_require__.f.jsonpHmr;
/******/ 			currentUpdateChunks = undefined;
/******/ 			function getAffectedModuleEffects(updateModuleId) {
/******/ 				var outdatedModules = [updateModuleId];
/******/ 				var outdatedDependencies = {};
/******/ 		
/******/ 				var queue = outdatedModules.map(function (id) {
/******/ 					return {
/******/ 						chain: [id],
/******/ 						id: id
/******/ 					};
/******/ 				});
/******/ 				while (queue.length > 0) {
/******/ 					var queueItem = queue.pop();
/******/ 					var moduleId = queueItem.id;
/******/ 					var chain = queueItem.chain;
/******/ 					var module = __webpack_require__.c[moduleId];
/******/ 					if (
/******/ 						!module ||
/******/ 						(module.hot._selfAccepted && !module.hot._selfInvalidated)
/******/ 					)
/******/ 						continue;
/******/ 					if (module.hot._selfDeclined) {
/******/ 						return {
/******/ 							type: "self-declined",
/******/ 							chain: chain,
/******/ 							moduleId: moduleId
/******/ 						};
/******/ 					}
/******/ 					if (module.hot._main) {
/******/ 						return {
/******/ 							type: "unaccepted",
/******/ 							chain: chain,
/******/ 							moduleId: moduleId
/******/ 						};
/******/ 					}
/******/ 					for (var i = 0; i < module.parents.length; i++) {
/******/ 						var parentId = module.parents[i];
/******/ 						var parent = __webpack_require__.c[parentId];
/******/ 						if (!parent) continue;
/******/ 						if (parent.hot._declinedDependencies[moduleId]) {
/******/ 							return {
/******/ 								type: "declined",
/******/ 								chain: chain.concat([parentId]),
/******/ 								moduleId: moduleId,
/******/ 								parentId: parentId
/******/ 							};
/******/ 						}
/******/ 						if (outdatedModules.indexOf(parentId) !== -1) continue;
/******/ 						if (parent.hot._acceptedDependencies[moduleId]) {
/******/ 							if (!outdatedDependencies[parentId])
/******/ 								outdatedDependencies[parentId] = [];
/******/ 							addAllToSet(outdatedDependencies[parentId], [moduleId]);
/******/ 							continue;
/******/ 						}
/******/ 						delete outdatedDependencies[parentId];
/******/ 						outdatedModules.push(parentId);
/******/ 						queue.push({
/******/ 							chain: chain.concat([parentId]),
/******/ 							id: parentId
/******/ 						});
/******/ 					}
/******/ 				}
/******/ 		
/******/ 				return {
/******/ 					type: "accepted",
/******/ 					moduleId: updateModuleId,
/******/ 					outdatedModules: outdatedModules,
/******/ 					outdatedDependencies: outdatedDependencies
/******/ 				};
/******/ 			}
/******/ 		
/******/ 			function addAllToSet(a, b) {
/******/ 				for (var i = 0; i < b.length; i++) {
/******/ 					var item = b[i];
/******/ 					if (a.indexOf(item) === -1) a.push(item);
/******/ 				}
/******/ 			}
/******/ 		
/******/ 			// at begin all updates modules are outdated
/******/ 			// the "outdated" status can propagate to parents if they don't accept the children
/******/ 			var outdatedDependencies = {};
/******/ 			var outdatedModules = [];
/******/ 			var appliedUpdate = {};
/******/ 		
/******/ 			var warnUnexpectedRequire = function warnUnexpectedRequire(module) {
/******/ 				console.warn(
/******/ 					"[HMR] unexpected require(" + module.id + ") to disposed module"
/******/ 				);
/******/ 			};
/******/ 		
/******/ 			for (var moduleId in currentUpdate) {
/******/ 				if (__webpack_require__.o(currentUpdate, moduleId)) {
/******/ 					var newModuleFactory = currentUpdate[moduleId];
/******/ 					var result = newModuleFactory
/******/ 						? getAffectedModuleEffects(moduleId)
/******/ 						: {
/******/ 								type: "disposed",
/******/ 								moduleId: moduleId
/******/ 							};
/******/ 					/** @type {Error|false} */
/******/ 					var abortError = false;
/******/ 					var doApply = false;
/******/ 					var doDispose = false;
/******/ 					var chainInfo = "";
/******/ 					if (result.chain) {
/******/ 						chainInfo = "\nUpdate propagation: " + result.chain.join(" -> ");
/******/ 					}
/******/ 					switch (result.type) {
/******/ 						case "self-declined":
/******/ 							if (options.onDeclined) options.onDeclined(result);
/******/ 							if (!options.ignoreDeclined)
/******/ 								abortError = new Error(
/******/ 									"Aborted because of self decline: " +
/******/ 										result.moduleId +
/******/ 										chainInfo
/******/ 								);
/******/ 							break;
/******/ 						case "declined":
/******/ 							if (options.onDeclined) options.onDeclined(result);
/******/ 							if (!options.ignoreDeclined)
/******/ 								abortError = new Error(
/******/ 									"Aborted because of declined dependency: " +
/******/ 										result.moduleId +
/******/ 										" in " +
/******/ 										result.parentId +
/******/ 										chainInfo
/******/ 								);
/******/ 							break;
/******/ 						case "unaccepted":
/******/ 							if (options.onUnaccepted) options.onUnaccepted(result);
/******/ 							if (!options.ignoreUnaccepted)
/******/ 								abortError = new Error(
/******/ 									"Aborted because " + moduleId + " is not accepted" + chainInfo
/******/ 								);
/******/ 							break;
/******/ 						case "accepted":
/******/ 							if (options.onAccepted) options.onAccepted(result);
/******/ 							doApply = true;
/******/ 							break;
/******/ 						case "disposed":
/******/ 							if (options.onDisposed) options.onDisposed(result);
/******/ 							doDispose = true;
/******/ 							break;
/******/ 						default:
/******/ 							throw new Error("Unexception type " + result.type);
/******/ 					}
/******/ 					if (abortError) {
/******/ 						return {
/******/ 							error: abortError
/******/ 						};
/******/ 					}
/******/ 					if (doApply) {
/******/ 						appliedUpdate[moduleId] = newModuleFactory;
/******/ 						addAllToSet(outdatedModules, result.outdatedModules);
/******/ 						for (moduleId in result.outdatedDependencies) {
/******/ 							if (__webpack_require__.o(result.outdatedDependencies, moduleId)) {
/******/ 								if (!outdatedDependencies[moduleId])
/******/ 									outdatedDependencies[moduleId] = [];
/******/ 								addAllToSet(
/******/ 									outdatedDependencies[moduleId],
/******/ 									result.outdatedDependencies[moduleId]
/******/ 								);
/******/ 							}
/******/ 						}
/******/ 					}
/******/ 					if (doDispose) {
/******/ 						addAllToSet(outdatedModules, [result.moduleId]);
/******/ 						appliedUpdate[moduleId] = warnUnexpectedRequire;
/******/ 					}
/******/ 				}
/******/ 			}
/******/ 			currentUpdate = undefined;
/******/ 		
/******/ 			// Store self accepted outdated modules to require them later by the module system
/******/ 			var outdatedSelfAcceptedModules = [];
/******/ 			for (var j = 0; j < outdatedModules.length; j++) {
/******/ 				var outdatedModuleId = outdatedModules[j];
/******/ 				var module = __webpack_require__.c[outdatedModuleId];
/******/ 				if (
/******/ 					module &&
/******/ 					(module.hot._selfAccepted || module.hot._main) &&
/******/ 					// removed self-accepted modules should not be required
/******/ 					appliedUpdate[outdatedModuleId] !== warnUnexpectedRequire &&
/******/ 					// when called invalidate self-accepting is not possible
/******/ 					!module.hot._selfInvalidated
/******/ 				) {
/******/ 					outdatedSelfAcceptedModules.push({
/******/ 						module: outdatedModuleId,
/******/ 						require: module.hot._requireSelf,
/******/ 						errorHandler: module.hot._selfAccepted
/******/ 					});
/******/ 				}
/******/ 			}
/******/ 		
/******/ 			var moduleOutdatedDependencies;
/******/ 		
/******/ 			return {
/******/ 				dispose: function () {
/******/ 					currentUpdateRemovedChunks.forEach(function (chunkId) {
/******/ 						delete installedChunks[chunkId];
/******/ 					});
/******/ 					currentUpdateRemovedChunks = undefined;
/******/ 		
/******/ 					var idx;
/******/ 					var queue = outdatedModules.slice();
/******/ 					while (queue.length > 0) {
/******/ 						var moduleId = queue.pop();
/******/ 						var module = __webpack_require__.c[moduleId];
/******/ 						if (!module) continue;
/******/ 		
/******/ 						var data = {};
/******/ 		
/******/ 						// Call dispose handlers
/******/ 						var disposeHandlers = module.hot._disposeHandlers;
/******/ 						for (j = 0; j < disposeHandlers.length; j++) {
/******/ 							disposeHandlers[j].call(null, data);
/******/ 						}
/******/ 						__webpack_require__.hmrD[moduleId] = data;
/******/ 		
/******/ 						// disable module (this disables requires from this module)
/******/ 						module.hot.active = false;
/******/ 		
/******/ 						// remove module from cache
/******/ 						delete __webpack_require__.c[moduleId];
/******/ 		
/******/ 						// when disposing there is no need to call dispose handler
/******/ 						delete outdatedDependencies[moduleId];
/******/ 		
/******/ 						// remove "parents" references from all children
/******/ 						for (j = 0; j < module.children.length; j++) {
/******/ 							var child = __webpack_require__.c[module.children[j]];
/******/ 							if (!child) continue;
/******/ 							idx = child.parents.indexOf(moduleId);
/******/ 							if (idx >= 0) {
/******/ 								child.parents.splice(idx, 1);
/******/ 							}
/******/ 						}
/******/ 					}
/******/ 		
/******/ 					// remove outdated dependency from module children
/******/ 					var dependency;
/******/ 					for (var outdatedModuleId in outdatedDependencies) {
/******/ 						if (__webpack_require__.o(outdatedDependencies, outdatedModuleId)) {
/******/ 							module = __webpack_require__.c[outdatedModuleId];
/******/ 							if (module) {
/******/ 								moduleOutdatedDependencies =
/******/ 									outdatedDependencies[outdatedModuleId];
/******/ 								for (j = 0; j < moduleOutdatedDependencies.length; j++) {
/******/ 									dependency = moduleOutdatedDependencies[j];
/******/ 									idx = module.children.indexOf(dependency);
/******/ 									if (idx >= 0) module.children.splice(idx, 1);
/******/ 								}
/******/ 							}
/******/ 						}
/******/ 					}
/******/ 				},
/******/ 				apply: function (reportError) {
/******/ 					var acceptPromises = [];
/******/ 					// insert new code
/******/ 					for (var updateModuleId in appliedUpdate) {
/******/ 						if (__webpack_require__.o(appliedUpdate, updateModuleId)) {
/******/ 							__webpack_require__.m[updateModuleId] = appliedUpdate[updateModuleId];
/******/ 						}
/******/ 					}
/******/ 		
/******/ 					// run new runtime modules
/******/ 					for (var i = 0; i < currentUpdateRuntime.length; i++) {
/******/ 						currentUpdateRuntime[i](__webpack_require__);
/******/ 					}
/******/ 		
/******/ 					// call accept handlers
/******/ 					for (var outdatedModuleId in outdatedDependencies) {
/******/ 						if (__webpack_require__.o(outdatedDependencies, outdatedModuleId)) {
/******/ 							var module = __webpack_require__.c[outdatedModuleId];
/******/ 							if (module) {
/******/ 								moduleOutdatedDependencies =
/******/ 									outdatedDependencies[outdatedModuleId];
/******/ 								var callbacks = [];
/******/ 								var errorHandlers = [];
/******/ 								var dependenciesForCallbacks = [];
/******/ 								for (var j = 0; j < moduleOutdatedDependencies.length; j++) {
/******/ 									var dependency = moduleOutdatedDependencies[j];
/******/ 									var acceptCallback =
/******/ 										module.hot._acceptedDependencies[dependency];
/******/ 									var errorHandler =
/******/ 										module.hot._acceptedErrorHandlers[dependency];
/******/ 									if (acceptCallback) {
/******/ 										if (callbacks.indexOf(acceptCallback) !== -1) continue;
/******/ 										callbacks.push(acceptCallback);
/******/ 										errorHandlers.push(errorHandler);
/******/ 										dependenciesForCallbacks.push(dependency);
/******/ 									}
/******/ 								}
/******/ 								for (var k = 0; k < callbacks.length; k++) {
/******/ 									var result;
/******/ 									try {
/******/ 										result = callbacks[k].call(null, moduleOutdatedDependencies);
/******/ 									} catch (err) {
/******/ 										if (typeof errorHandlers[k] === "function") {
/******/ 											try {
/******/ 												errorHandlers[k](err, {
/******/ 													moduleId: outdatedModuleId,
/******/ 													dependencyId: dependenciesForCallbacks[k]
/******/ 												});
/******/ 											} catch (err2) {
/******/ 												if (options.onErrored) {
/******/ 													options.onErrored({
/******/ 														type: "accept-error-handler-errored",
/******/ 														moduleId: outdatedModuleId,
/******/ 														dependencyId: dependenciesForCallbacks[k],
/******/ 														error: err2,
/******/ 														originalError: err
/******/ 													});
/******/ 												}
/******/ 												if (!options.ignoreErrored) {
/******/ 													reportError(err2);
/******/ 													reportError(err);
/******/ 												}
/******/ 											}
/******/ 										} else {
/******/ 											if (options.onErrored) {
/******/ 												options.onErrored({
/******/ 													type: "accept-errored",
/******/ 													moduleId: outdatedModuleId,
/******/ 													dependencyId: dependenciesForCallbacks[k],
/******/ 													error: err
/******/ 												});
/******/ 											}
/******/ 											if (!options.ignoreErrored) {
/******/ 												reportError(err);
/******/ 											}
/******/ 										}
/******/ 									}
/******/ 									if (result && typeof result.then === "function") {
/******/ 										acceptPromises.push(result);
/******/ 									}
/******/ 								}
/******/ 							}
/******/ 						}
/******/ 					}
/******/ 		
/******/ 					var onAccepted = function () {
/******/ 						// Load self accepted modules
/******/ 						for (var o = 0; o < outdatedSelfAcceptedModules.length; o++) {
/******/ 							var item = outdatedSelfAcceptedModules[o];
/******/ 							var moduleId = item.module;
/******/ 							try {
/******/ 								item.require(moduleId);
/******/ 							} catch (err) {
/******/ 								if (typeof item.errorHandler === "function") {
/******/ 									try {
/******/ 										item.errorHandler(err, {
/******/ 											moduleId: moduleId,
/******/ 											module: __webpack_require__.c[moduleId]
/******/ 										});
/******/ 									} catch (err1) {
/******/ 										if (options.onErrored) {
/******/ 											options.onErrored({
/******/ 												type: "self-accept-error-handler-errored",
/******/ 												moduleId: moduleId,
/******/ 												error: err1,
/******/ 												originalError: err
/******/ 											});
/******/ 										}
/******/ 										if (!options.ignoreErrored) {
/******/ 											reportError(err1);
/******/ 											reportError(err);
/******/ 										}
/******/ 									}
/******/ 								} else {
/******/ 									if (options.onErrored) {
/******/ 										options.onErrored({
/******/ 											type: "self-accept-errored",
/******/ 											moduleId: moduleId,
/******/ 											error: err
/******/ 										});
/******/ 									}
/******/ 									if (!options.ignoreErrored) {
/******/ 										reportError(err);
/******/ 									}
/******/ 								}
/******/ 							}
/******/ 						}
/******/ 					};
/******/ 		
/******/ 					return Promise.all(acceptPromises)
/******/ 						.then(onAccepted)
/******/ 						.then(function () {
/******/ 							return outdatedModules;
/******/ 						});
/******/ 				}
/******/ 			};
/******/ 		}
/******/ 		__webpack_require__.hmrI.jsonp = function (moduleId, applyHandlers) {
/******/ 			if (!currentUpdate) {
/******/ 				currentUpdate = {};
/******/ 				currentUpdateRuntime = [];
/******/ 				currentUpdateRemovedChunks = [];
/******/ 				applyHandlers.push(applyHandler);
/******/ 			}
/******/ 			if (!__webpack_require__.o(currentUpdate, moduleId)) {
/******/ 				currentUpdate[moduleId] = __webpack_require__.m[moduleId];
/******/ 			}
/******/ 		};
/******/ 		__webpack_require__.hmrC.jsonp = function (
/******/ 			chunkIds,
/******/ 			removedChunks,
/******/ 			removedModules,
/******/ 			promises,
/******/ 			applyHandlers,
/******/ 			updatedModulesList
/******/ 		) {
/******/ 			applyHandlers.push(applyHandler);
/******/ 			currentUpdateChunks = {};
/******/ 			currentUpdateRemovedChunks = removedChunks;
/******/ 			currentUpdate = removedModules.reduce(function (obj, key) {
/******/ 				obj[key] = false;
/******/ 				return obj;
/******/ 			}, {});
/******/ 			currentUpdateRuntime = [];
/******/ 			chunkIds.forEach(function (chunkId) {
/******/ 				if (
/******/ 					__webpack_require__.o(installedChunks, chunkId) &&
/******/ 					installedChunks[chunkId] !== undefined
/******/ 				) {
/******/ 					promises.push(loadUpdateChunk(chunkId, updatedModulesList));
/******/ 					currentUpdateChunks[chunkId] = true;
/******/ 				} else {
/******/ 					currentUpdateChunks[chunkId] = false;
/******/ 				}
/******/ 			});
/******/ 			if (__webpack_require__.f) {
/******/ 				__webpack_require__.f.jsonpHmr = function (chunkId, promises) {
/******/ 					if (
/******/ 						currentUpdateChunks &&
/******/ 						__webpack_require__.o(currentUpdateChunks, chunkId) &&
/******/ 						!currentUpdateChunks[chunkId]
/******/ 					) {
/******/ 						promises.push(loadUpdateChunk(chunkId));
/******/ 						currentUpdateChunks[chunkId] = true;
/******/ 					}
/******/ 				};
/******/ 			}
/******/ 		};
/******/ 		
/******/ 		__webpack_require__.hmrM = () => {
/******/ 			if (typeof fetch === "undefined") throw new Error("No browser support: need fetch API");
/******/ 			return fetch(__webpack_require__.p + __webpack_require__.hmrF()).then((response) => {
/******/ 				if(response.status === 404) return; // no update available
/******/ 				if(!response.ok) throw new Error("Failed to fetch update manifest " + response.statusText);
/******/ 				return response.json();
/******/ 			});
/******/ 		};
/******/ 		
/******/ 		// no on chunks loaded
/******/ 		
/******/ 		// no jsonp function
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// module cache are used so entry inlining is disabled
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	var __webpack_exports__ = __webpack_require__("./src/Module.js");
/******/ 	
/******/ 	return __webpack_exports__;
/******/ })()
;
});
//# sourceMappingURL=main.js.map