@egovernments/digit-ui-module-core 1.9.21-cms → 1.9.23-cms

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@egovernments/digit-ui-components"),n=require("react"),o=e(n),l=require("react-i18next"),i=require("react-query"),r=require("react-redux"),a=require("react-router-dom"),s=require("@egovernments/digit-ui-react-components"),c=require("@egovernments/digit-ui-svg-components"),u=require("redux"),d=e(require("redux-thunk"));function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}function p(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var v="function"==typeof Symbol&&Symbol.for,g=v?Symbol.for("react.element"):60103,f=v?Symbol.for("react.portal"):60106,E=v?Symbol.for("react.fragment"):60107,h=v?Symbol.for("react.strict_mode"):60108,y=v?Symbol.for("react.profiler"):60114,b=v?Symbol.for("react.provider"):60109,S=v?Symbol.for("react.context"):60110,C=v?Symbol.for("react.async_mode"):60111,N=v?Symbol.for("react.concurrent_mode"):60111,O=v?Symbol.for("react.forward_ref"):60112,I=v?Symbol.for("react.suspense"):60113,w=v?Symbol.for("react.suspense_list"):60120,_=v?Symbol.for("react.memo"):60115,D=v?Symbol.for("react.lazy"):60116,T=v?Symbol.for("react.block"):60121,A=v?Symbol.for("react.fundamental"):60117,R=v?Symbol.for("react.responder"):60118,L=v?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case g:switch(e=e.type){case C:case N:case E:case y:case h:case I:return e;default:switch(e=e&&e.$$typeof){case S:case O:case D:case _:case b:return e;default:return t}}case f:return t}}}function P(e){return x(e)===N}var M={AsyncMode:C,ConcurrentMode:N,ContextConsumer:S,ContextProvider:b,Element:g,ForwardRef:O,Fragment:E,Lazy:D,Memo:_,Portal:f,Profiler:y,StrictMode:h,Suspense:I,isAsyncMode:function(e){return P(e)||x(e)===C},isConcurrentMode:P,isContextConsumer:function(e){return x(e)===S},isContextProvider:function(e){return x(e)===b},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===g},isForwardRef:function(e){return x(e)===O},isFragment:function(e){return x(e)===E},isLazy:function(e){return x(e)===D},isMemo:function(e){return x(e)===_},isPortal:function(e){return x(e)===f},isProfiler:function(e){return x(e)===y},isStrictMode:function(e){return x(e)===h},isSuspense:function(e){return x(e)===I},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===E||e===N||e===y||e===h||e===I||e===w||"object"==typeof e&&null!==e&&(e.$$typeof===D||e.$$typeof===_||e.$$typeof===b||e.$$typeof===S||e.$$typeof===O||e.$$typeof===A||e.$$typeof===R||e.$$typeof===L||e.$$typeof===T)},typeOf:x},k=p(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case c:case u:case l:case r:case i:case m:return p;default:var f=p&&p.$$typeof;switch(f){case s:case d:case g:case v:case a:return f;default:return t}}case o:return t}}}var S=u,C=s,N=a,O=n,I=d,w=l,_=g,D=v,T=o,A=r,R=i,L=m,x=!1;function P(e){return b(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=C,t.ContextProvider=N,t.Element=O,t.ForwardRef=I,t.Fragment=w,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=A,t.StrictMode=R,t.Suspense=L,t.isAsyncMode=function(e){return x||(x=!0,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.")),P(e)||b(e)===c},t.isConcurrentMode=P,t.isContextConsumer=function(e){return b(e)===s},t.isContextProvider=function(e){return b(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===l},t.isLazy=function(e){return b(e)===g},t.isMemo=function(e){return b(e)===v},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===r},t.isStrictMode=function(e){return b(e)===i},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===r||e===i||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===h||e.$$typeof===y||e.$$typeof===f)},t.typeOf=b}()}),U=p(function(e){e.exports="production"===process.env.NODE_ENV?M:k}),B=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;function H(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var z=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,l=H(e),i=1;i<arguments.length;i++){for(var r in n=Object(arguments[i]))F.call(n,r)&&(l[r]=n[r]);if(B){o=B(n);for(var a=0;a<o.length;a++)j.call(n,o[a])&&(l[o[a]]=n[o[a]])}}return l},G="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",V=Function.call.bind(Object.prototype.hasOwnProperty),W=function(){};if("production"!==process.env.NODE_ENV){var Q=G,X={},q=V;W=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function Z(e,t,n,o,l){if("production"!==process.env.NODE_ENV)for(var i in e)if(q(e,i)){var r;try{if("function"!=typeof e[i]){var a=Error((o||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}r=e[i](t,i,o,n,null,Q)}catch(e){r=e}if(!r||r instanceof Error||W((o||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof r+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),r instanceof Error&&!(r.message in X)){X[r.message]=!0;var s=l?l():"";W("Failed "+n+" type: "+r.message+(null!=s?s:""))}}}Z.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(X={})};var Y=Z,$=function(){};function J(){return null}function K(){}function ee(){}"production"!==process.env.NODE_ENV&&($=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),ee.resetWarningCache=K;var te=p(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,o={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:r(J),arrayOf:function(e){return r(function(t,n,o,l,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new i("Invalid "+l+" `"+r+"` of type `"+u(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,o,l,r+"["+s+"]",G);if(c instanceof Error)return c}return null})},element:r(function(t,n,o,l,r){var a=t[n];return e(a)?null:new i("Invalid "+l+" `"+r+"` of type `"+u(a)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:r(function(e,t,n,o,l){var r=e[t];return U.isValidElementType(r)?null:new i("Invalid "+o+" `"+l+"` of type `"+u(r)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return r(function(t,n,o,l,r){var a;return t[n]instanceof e?null:new i("Invalid "+l+" `"+r+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:r(function(e,t,n,o,l){return c(e[t])?null:new i("Invalid "+o+" `"+l+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return r(function(t,n,o,l,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var a=t[n],s=u(a);if("object"!==s)return new i("Invalid "+l+" `"+r+"` of type `"+s+"` supplied to `"+o+"`, expected an object.");for(var c in a)if(V(a,c)){var d=e(a,c,o,l,r+"."+c,G);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&$(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),J;function t(t,n,o,r,a){for(var s=t[n],c=0;c<e.length;c++)if(l(s,e[c]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new i("Invalid "+r+" `"+a+"` of value `"+String(s)+"` supplied to `"+o+"`, expected one of "+u+".")}return r(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&$("Invalid argument supplied to oneOfType, expected an instance of array."),J;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return $("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),J}return r(function(t,n,o,l,r){for(var a=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,o,l,r,G);if(null==c)return null;c.data&&V(c.data,"expectedType")&&a.push(c.data.expectedType)}return new i("Invalid "+l+" `"+r+"` supplied to `"+o+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return r(function(t,n,o,l,r){var a=t[n],c=u(a);if("object"!==c)return new i("Invalid "+l+" `"+r+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(o,l,r,m,d(p));var v=p(a,m,o,l,r+"."+m,G);if(v)return v}return null})},exact:function(e){return r(function(t,n,o,l,r){var a=t[n],c=u(a);if("object"!==c)return new i("Invalid "+l+" `"+r+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");var m=z({},t[n],e);for(var p in m){var v=e[p];if(V(e,p)&&"function"!=typeof v)return s(o,l,r,p,d(v));if(!v)return new i("Invalid "+l+" `"+r+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=v(a,p,o,l,r+"."+p,G);if(g)return g}return null})}};function l(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function r(e){function t(t,n,o,l,r,a,s){if(l=l||"<<anonymous>>",a=a||o,s!==G){var c=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");throw c.name="Invariant Violation",c}return null==n[o]?t?new i(null===n[o]?"The "+r+" `"+a+"` is marked as required in `"+l+"`, but its value is `null`.":"The "+r+" `"+a+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(n,o,l,r,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return r(function(t,n,o,l,r,a){var s=t[n];return u(s)!==e?new i("Invalid "+l+" `"+r+"` of type `"+d(s)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,o,l){return new i((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+l+"`.")}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var l,i=o.call(t);if(o!==t.entries){for(;!(l=i.next()).done;)if(!c(l.value))return!1}else for(;!(l=i.next()).done;){var r=l.value;if(r&&!c(r[1]))return!1}return!0;default:return!1}}function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=u(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function m(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,o.checkPropTypes=Y,o.resetWarningCache=Y.resetWarningCache,o.PropTypes=o,o}(U.isElement):function(){function e(e,t,n,o,l,i){if(i!==G){var r=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");throw r.name="Invariant Violation",r}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ee,resetWarningCache:K};return n.PropTypes=n,n}()});const ne=e=>{let{src:t,alt:n="Image not found",decorative:l=!1,ariaLabel:i="No Image description set",ariaLabelledby:r="no-image-description",...a}=e;const s={};return l?s.alt="":n?s.alt=n:i?s["aria-label"]=i:r?s["aria-labelledby"]=r:console.warn("AccessibleImage: Missing alt, aria-label, or aria-labelledby for non-decorative image."),o.createElement("img",m({src:t},s,a))};ne.propTypes={src:te.string.isRequired,alt:te.string,decorative:te.bool,ariaLabel:te.string,ariaLabelledby:te.string};const oe={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"}},le={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"}},ie=e=>{var t;const{type:n="error"}=Digit.Hooks.useQueryParams(),i=null==e||null===(t=e.errorData)||void 0===t?void 0:t.module,{t:r}=l.useTranslation(),a=i?le[i]:oe[n];return o.createElement("div",{className:"error-boundary"},o.createElement("div",{className:"error-container"},o.createElement(ne,{src:a.imgUrl,alt:"error"}),o.createElement("h1",null,r(a.infoMessage)),o.createElement("button",{onClick:()=>{var t;i?null==e||null===(t=e.errorData)||void 0===t||t.action():e.goToHome()}},r(a.buttonInfo))))},re=()=>{var e,t;const n="employee"===Digit.UserService.getType()?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/error`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/error`;return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=n),o.createElement("span",null)};class ae extends o.Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1,module:null,action:null,info:null}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack,module:null==e?void 0:e.module,action:null==e?void 0:e.action,info:null==e?void 0:e.info}}componentDidCatch(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})}render(){return this.state.hasError?o.createElement("div",{className:"error-boundary"},o.createElement(re,null),o.createElement(ie,{initData:this.props.initData,errorData:this.state})):this.props.children}}const se=require("@egovernments/digit-ui-svg-components"),ce=e=>{var i;const{isLoading:r,data:s}=Digit.Hooks.useAccessControl(),c=Digit.Utils.getMultiRootTenant(),{t:u}=l.useTranslation(),d=a.useHistory(),p=Digit.ULBService.getStateId();let v=null;const[g,f]=n.useState([{}]),{data:E}=Digit.Hooks.useCustomMDMS(p,"HomeScreenOrder",[{name:"CardsAndLinksOrder"}],{select:e=>{var t;return null==e||null===(t=e.HomeScreenOrder)||void 0===t?void 0:t.CardsAndLinksOrder}}),{data:h}=Digit.Hooks.useCustomMDMS(p,"SandBoxLanding",[{name:"AdditionalModuleLinks"}],{select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.AdditionalModuleLinks}});n.useEffect(()=>{f(E)},[E]);const y=(e,t)=>{if(!e||!t)return null;const n=null==h?void 0:h.find(t=>t.moduleName===e.module),o=null==n?void 0:n[t],l=null==e?void 0:e.links;return(null==l?void 0:l.find(e=>(null==e?void 0:e.displayName)===o))||null},b=e=>{var t;const n=null==h?void 0:h.find(t=>t.moduleName===e.module);return null==e||null===(t=e.links)||void 0===t?void 0:t.filter(e=>{const t=e.displayName;return"Configure_master"!==t&&t!==(null==n?void 0:n.howItWorksLink)&&t!==(null==n?void 0:n.userManualLink)})},S=null==s?void 0:s.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,n)=>{const o=n.parentModule;e[o]||(e[o]={module:o,kpis:[],icon:n.leftIcon?Digit.Utils.iconRender({iconName:n.leftIcon,iconFill:"white",CustomSVG:t.CustomSVG,Components:se}):"",label:Digit.Utils.locale.getTransformedLocale(o+"_CARD_HEADER"),links:[]});const l=function(e){var t,n;if(void 0===e&&(e=""),"/"!=e){if(-1===(null===(t=e)||void 0===t?void 0:t.indexOf("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)))){let t=null;return t=c?e=e.replace("/sandbox-ui/employee",`/sandbox-ui/${p}/employee`):e,t}return e}}(n.navigationURL),i=l.indexOf("?");return e[o].links.push({link:l,icon:n.leftIcon,queryParams:-1===i?null:l.substring(i),label:u(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}`)),displayName:n.displayName}),e},{});if(r)return o.createElement(t.Loader,{page:!1,variant:"PageLoader"});if(!S)return"";v=c?(e=>Object.keys(e).sort((e,t)=>{var n,o;return((null==g||null===(n=g.find(t=>"card"===t.moduleType&&t.name===e))||void 0===n?void 0:n.order)||null)-((null==g||null===(o=g.find(e=>"card"===e.moduleType&&e.name===t))||void 0===o?void 0:o.order)||null)}).reduce((t,n)=>{var o,l;const i=null==e||null===(o=e[n])||void 0===o||null===(l=o.links)||void 0===l?void 0:l.sort((e,t)=>{var o,l;const i=null==e?void 0:e.displayName,r=null==t?void 0:t.displayName;return((null==g||null===(o=g.find(e=>"link"===e.moduleType&&e.name===`${n}.${i.replace(/\s+/g,"_")}`))||void 0===o?void 0:o.order)||null)-((null==g||null===(l=g.find(e=>"link"===e.moduleType&&e.name===`${n}.${r.replace(/\s+/g,"_")}`))||void 0===l?void 0:l.order)||null)});return t[n]={...e[n],links:i},t},{}))(S):S;const C=null===(i=Object.keys(v))||void 0===i?void 0:i.map((e,n)=>{var l,i;const r=null===(l=v)||void 0===l?void 0:l[e],a=null==r||null===(i=r.links)||void 0===i?void 0:i.find(e=>"Configure_master"===(null==e?void 0:e.displayName)),s=y(r,"howItWorksLink"),c=y(r,"userManualLink"),p={icon:"SupervisorAccount",moduleName:u(null==r?void 0:r.label),metrics:[],links:Digit.Utils.getMultiRootTenant()?b(r):null==r?void 0:r.links,centreChildren:[o.createElement("div",null,u(Digit.Utils.locale.getTransformedLocale("MODULE_CARD_DESC_"+e))),s&&o.createElement(t.Button,{variation:"teritiary",label:null==s?void 0:s.label,icon:null==s?void 0:s.icon,type:"button",size:"medium",onClick:()=>window.open(null==s?void 0:s.link,"_blank"),style:{padding:"0px"}})],endChildren:Digit.Utils.getMultiRootTenant()?[a&&o.createElement(t.Button,{variation:"teritiary",label:null==a?void 0:a.label,icon:null==a?void 0:a.icon,type:"button",size:"medium",onClick:()=>null==d?void 0:d.push(null==a?void 0:a.link),style:{padding:"0px"}}),c&&o.createElement(t.Button,{variation:"teritiary",label:null==c?void 0:c.label,icon:null==c?void 0:c.icon,type:"button",size:"medium",onClick:()=>window.open(null==c?void 0:c.link,"_blank"),style:{padding:"0px"}})]:null};return o.createElement(t.LandingPageCard,m({buttonSize:"medium"},p))});return o.createElement(n.Fragment,null,o.createElement(t.LandingPageWrapper,null,o.Children.map(C,e=>o.cloneElement(e))))},ue=e=>{const{question:i,isLabelLink:r,type:a,actions:u,content:d,lastIndex:m}=e,[p,v]=n.useState(!1),{t:g}=l.useTranslation(),f=Digit.ULBService.getStateId(),E="number"===a?"ol":"ul";return o.createElement("div",{className:"faqs border-none",onClick:()=>v(!p)},o.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},o.createElement("span",null,g(i)),o.createElement("span",{className:p?"faqicon rotate":"faqicon",style:{float:"right"}},o.createElement(c.ArrowForward,null))),o.createElement("div",{className:"faq-answer",style:p?{display:"block"}:{display:"none"}},o.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},g(d)),o.createElement("div",{style:{marginTop:"1rem"}},u&&o.createElement(E,null,u.map((e,n)=>o.createElement("li",{key:n,style:{listStyleType:"ul"===E?"disc":"auto",margin:"8px 0"}},r?null!=e&&e.label?o.createElement(t.Button,{variation:"teritiary",label:g(null==e?void 0:e.label),type:"button",size:"medium",onClick:()=>{if(null!=e&&e.fulllink)window.open(null==e?void 0:e.link,"_blank");else{var t;const n=`https://${window.location.hostname}/${null===(t=window)||void 0===t?void 0:t.globalPath}/${f}`;window.open(`${n}/${null==e?void 0:e.link}`,"_blank")}},style:{padding:"0px"}}):null:null!=e&&e.label?o.createElement("strong",null,g(null==e?void 0:e.label),":"):null,g(null==e?void 0:e.description)))))),m?null:o.createElement("div",{className:"cs-box-border"}))},de=e=>{let{type:t,title:n,content:i,actions:r}=e;const{t:a}=l.useTranslation(),c="number"===t?"ol":"ul";return o.createElement("div",null,o.createElement(s.CardSectionHeader,null,a(n)),o.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},a(i)),o.createElement("div",{style:{marginTop:"1rem"}},r&&o.createElement(c,null,r.map((e,t)=>o.createElement("li",{key:t,style:{listStyleType:"ul"===c?"disc":"auto",margin:"8px 0"}},null!=e&&e.label?o.createElement("strong",null,a(null==e?void 0:e.label),":"):null," ",a(null==e?void 0:e.description))))))},me=e=>{let{faqs:t,type:n}=e;return l.useTranslation(),o.createElement("div",{style:{width:"100%"}},o.createElement("div",{style:{width:"100%"}},t.map((e,l)=>o.createElement(ue,{key:"faq_"+l,question:e.question,answer:e.answer,isLabelLink:e.isLabelLink,type:n,actions:e.answer,content:e.content,lastIndex:l===(null==t?void 0:t.length)-1}))))},pe=e=>{let{cardConfig:n}=e;const{t:i}=l.useTranslation();return o.createElement(t.Card,{className:"sandbox-guide",style:{width:"25rem",height:"47rem",overflowY:"scroll"}},o.createElement(t.CardHeader,null,i("GUIDE_TO_SETUP")),o.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},n.map((e,t)=>"faqs"===(null==e?void 0:e.type)?o.createElement(me,{key:e.id,title:e.title,type:null==e?void 0:e.type,content:e.content,faqs:e.actions}):o.createElement(o.Fragment,null,o.createElement(de,{type:null==e?void 0:e.type,key:e.id,title:e.title,content:e.content,actions:e.actions,style:e.style}),t!==(null==n?void 0:n.length)-1&&o.createElement(s.BreakLine,{style:{width:"100%",border:"1px solid #d6d5d4"}})))))},ve=e=>{const{t:t}=l.useTranslation(),{data:n}=Digit.Hooks.useAccessControl(),i=(Digit.Utils.getMultiRootTenant(),Digit.ULBService.getStateId());return(null==n?void 0:n.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,n)=>{const o=n.parentModule;e[o]||(e[o]={module:o,label:Digit.Utils.locale.getTransformedLocale(o+"_CARD_HEADER"),links:[]});const l=Digit.Utils.transformURL(n.navigationURL,i),r=l.indexOf("?");return e[o].links.push({link:-1===r?l:l.substring(0,r),label:t(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}`)),queryParams:-1===r?null:l.substring(r),description:t(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}_DESCRIPTION`))}),e},{}))?o.createElement(pe,{cardConfig:[{id:1,type:"faqs",actions:[{question:"SANDBOX_FAQ_QUES_14",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_14_LABEL_1",fulllink:!0,link:"https://egov-digit.gitbook.io/digit-sandbox/specifications/user-manual/walkthrough-videos"}]},{question:"SANDBOX_FAQ_QUES_1",content:"SANDBOX_FAQ_CONTENT_1",isLabelLink:!0,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"}]}]}):""},ge=(e,t,n)=>{const o=null==e?void 0:e[""+t];o&&o.map(e=>{Digit.Utils.getMultiRootTenant()&&(e.navigationURL=e.navigationURL.replace("/sandbox-ui/citizen",`/sandbox-ui/${Digit.ULBService.getStateId()}/citizen`)),e.link=e.navigationURL,e.i18nKey=n(e.name)});const l={links:null==o?void 0:o.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:`CITIZEN_${t}_ICON`};var i;return"FSM"===t&&[{role:"FSM_DSO",from:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/fsm/dso-dashboard`,dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,o,i;let{role:r,from:a,loginLink:s,dashoardLink:c}=e;Digit.UserService.hasAccess(r)?null==l||null===(t=l.links)||void 0===t||t.push({link:a,i18nKey:n(c)}):null==l||null===(o=l.links)||void 0===o||o.push({link:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/login`,state:{role:"FSM_DSO",from:a},i18nKey:n(s)})}),l},fe=e=>{let{getCitizenMenu:n,isLoading:i}=e;const{t:r}=l.useTranslation();if(i)return o.createElement(s.Loader,null);const a=Object.keys(n||{});return o.createElement("div",{className:"citizen-all-services-wrapper"},location.pathname.includes("sanitation-ui/citizen/all-services")||location.pathname.includes("sandbox-ui")&&location.pathname.includes("all-services")||location.pathname.includes("digit-studio")&&location.pathname.includes("all-services")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement("div",{className:"citizenAllServiceGrid"},a.map(e=>{var l;const i=ge(n,e,r);var a,c;return(null==i||null===(l=i.links)||void 0===l?void 0:l.length)>0?o.createElement(s.CitizenHomeCard,{key:e,header:r(null==i?void 0:i.header),links:null==i||null===(a=i.links)||void 0===a||null===(c=a.filter(e=>null==e?void 0:e.link))||void 0===c?void 0:c.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)),Icon:()=>(e=>{switch(e){case"PT":return o.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"});case"WS":return o.createElement(t.CustomSVG.WSICon,{className:"fill-path-primary-main"});case"FSM":return o.createElement(t.CustomSVG.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return o.createElement(t.CustomSVG.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return o.createElement(t.CustomSVG.PGRIcon,{className:"fill-path-primary-main"});case"TL":return o.createElement(t.CustomSVG.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return o.createElement(t.CustomSVG.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return o.createElement(t.CustomSVG.BillsIcon,{className:"fill-path-primary-main"});default:return o.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"})}})(e),Info:null,isInfo:!1}):null})))},Ee=e=>{let{modules:l,additionalComponent:i}=e;return o.createElement(n.Fragment,null,o.createElement("div",{className:"employee-app-container digit-home-employee-app"},o.createElement(t.LandingPageWrapper,null,null==l?void 0:l.map((e,t)=>{let{code:n}=e;const l=Digit.ComponentRegistryService.getComponent(n+"Card")||(()=>o.createElement(o.Fragment,null));return o.createElement(l,{key:t})}))),i&&(null==i?void 0:i.length)>0&&i.map(e=>{const t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?o.createElement("div",{className:"additional-component-wrapper"},o.createElement(t,null)):null}))},he=e=>{let{userType:t,modules:n,getCitizenMenu:l,fetchedCitizen:i,isLoading:r,additionalComponent:a}=e;if("citizen"===t)return o.createElement(fe,{modules:n,getCitizenMenu:l,fetchedCitizen:i,isLoading:r});const s=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return Digit.Utils.getRoleBasedHomeCard()?o.createElement("div",{className:s?"homeWrapper":""},o.createElement(ce,{modules:n,additionalComponent:a}),s&&!window.Digit.Utils.browser.isMobile()?o.createElement(ve,null):null):o.createElement(Ee,{modules:n,additionalComponent:a})},ye=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(o=e)&&void 0!==o&&o.includes(t);){var o,l;e=null===(l=e)||void 0===l?void 0:l.replace(t,n)}return e},be=e=>{var l,i;const[r,s]=n.useState(null),[c,u]=n.useState([]),[d,m]=n.useState([]),p=a.useHistory();let v=[];const g=Digit.Utils.getMultiRootTenant();return n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let o=[],l=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>o.push(e.tenantId));let i=o.filter((e,t,n)=>n.indexOf(e)===t);null==i||i.forEach(e=>{var t;l.push({label:"TENANT_TENANTS_"+(null===(t=ye(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),v=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),u(l)},[r]),o.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},g&&1==c.length?o.createElement(t.CardText,{style:{color:"#363636"}},null==c||null===(l=c[0])||void 0===l?void 0:l.value):o.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:c,selected:c.find(e=>e.value===(null==r?void 0:r.value)),optionKey:"label",select:e=>{var t,n,o,l;const i=Digit.SessionStorage.get("citizen.userRequestObject"),r=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.filter(t=>t.tenantId===e.value);if((null==r?void 0:r.length)>0&&(i.info.roles=r,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),s(e),window.location.href.includes(`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee/`)){var a,c;const e=(null===(a=location.state)||void 0===a?void 0:a.from)||`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee`;p.replace(e)}window.location.reload()},freeze:!0,customSelector:o.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(i=ye(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===i?void 0:i.toUpperCase())))}))},Se=e=>{const i=e.dropdown||!1,{data:r,isLoading:a}=Digit.Hooks.useStore.getInitData(),{languages:s,stateInfo:c}=r||{},{t:u}=l.useTranslation(),d=Digit.StoreData.getCurrentLanguage(),[m,p]=n.useState(d),v=e=>{p(e.value),sessionStorage.setItem("Citizen.locale.changed","true"),Digit.LocalizationService.changeLanguage(e.value,c.code)};return a?null:i?o.createElement("div",null,o.createElement(t.Dropdown,{className:"language-dropdown",option:s,selected:null==s?void 0:s.find(e=>(null==e?void 0:e.value)===d),optionKey:"label",select:v,freeze:!0,customSelector:o.createElement("label",{className:"cp"},u(null==s||null===(g=s.find(e=>(null==e?void 0:e.value)===m))||void 0===g?void 0:g.label))})):o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:"5px"}},"Language"),o.createElement("div",{className:"language-selector"},s.map((e,n)=>o.createElement("div",{className:"language-button-container",key:n},o.createElement(t.Button,{label:e.label,onClick:()=>v(e),variation:e.value===m?"primary":""})))));var g},Ce=e=>{var l,i,r,c,u,d,m,p;let{t:v,stateInfo:g,toggleSidebar:f,isSidebarOpen:E,handleLogout:h,userDetails:y,CITIZEN:b,cityDetails:S,mobileView:C,userOptions:N,handleUserDropdownSelection:O,logoUrl:I,logoUrlWhite:w,showLanguageChange:_=!0}=e;const[D,T]=o.useState(null);o.useEffect(function(){try{var e;const t=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCurrentTenantId(),n=null==y||null===(e=y.info)||void 0===e?void 0:e.uuid,o=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t;const n=e.user[0],o=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");T(null==o?void 0:o.at(0))}})}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==D,null==y||null===(l=y.info)||void 0===l?void 0:l.uuid]);const A=Digit.ULBService.getCitizenCurrentTenant(!0);let R=a.useHistory();const{pathname:L}=a.useLocation(),{data:{unreadCount:x}={},isSuccess:P}=Digit.Hooks.useNotificationCount({tenantId:A,config:{enabled:"EMPLOYEE"!==(null===(M=Digit.UserService)||void 0===M||null===(k=M.getUser())||void 0===k||null===(U=k.info)||void 0===U?void 0:U.type)&&"CITIZEN"===(null===(B=Digit.UserService)||void 0===B||null===(F=B.getUser())||void 0===F||null===(j=F.info)||void 0===j?void 0:j.type)&&!!A}});var M,k,U,B,F,j;if(b)return o.createElement("div",null,o.createElement(s.TopBar,{img:null==g?void 0:g.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:f(!0)},logoUrl:null==g?void 0:g.logoUrlWhite,onLogout:h,userDetails:y,notificationCount:x<99?x:99,notificationCountLoaded:P,cityOfCitizenShownBesideLogo:v(A),onNotificationIconClick:function(){var e;R.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/engagement/notifications`)},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,o,l;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&[`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/select-language`,`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/select-location`].includes(e)})(L),changeLanguage:C?null:o.createElement(Se,{dropdown:!0})}));const H=!(null==y||!y.access_token),z=null===(i=Digit.ComponentRegistryService)||void 0===i?void 0:i.getComponent("CustomEmployeeTopBar");return z?o.createElement(z,{t:v,stateInfo:g,toggleSidebar:f,isSidebarOpen:E,handleLogout:h,userDetails:y,CITIZEN:b,cityDetails:S,mobileView:C,userOptions:N,handleUserDropdownSelection:O,logoUrl:I,showLanguageChange:_,loggedin:H}):o.createElement(t.Header,{actionFields:[o.createElement(be,{dropdown:!0,t:v}),_&&o.createElement(Se,{dropdown:!0}),(null==y?void 0:y.access_token)&&o.createElement(t.Dropdown,{option:N,optionKey:"name",profilePic:D||(null==y||null===(r=y.info)||void 0===r?void 0:r.name)||(null==y||null===(c=y.info)||void 0===c||null===(u=c.userInfo)||void 0===u?void 0:u.name)||"Employee",select:O,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{f()},className:"digit-employee-header",img:I,logoWidth:"64px",logoHeight:"48px",logo:(H?null==S?void 0:S.logoId:null==g?void 0:g.statelogo)||"https://egov-dev-assets.s3.ap-south-1.amazonaws.com/egov-logo-2025.png",onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:H?null!=S&&null!==(d=S.city)&&void 0!==d&&d.ulbGrade?o.createElement(n.Fragment,null,v(null==S?void 0:S.i18nKey).toUpperCase()," ",v("ULBGRADE_"+(null==S||null===(m=S.city)||void 0===m?void 0:m.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):o.createElement(ne,{className:"state",src:w,alt:"State Logo"}):o.createElement(n.Fragment,null,v(`MYCITY_${null==g||null===(p=g.code)||void 0===p?void 0:p.toUpperCase()}_LABEL`)," ",v("MYCITY_STATECODE_LABEL"))})},Ne=(e,t,n,l)=>[{type:"component",element:"LANGUAGE",action:o.createElement(Se,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}],Oe=e=>{let{onSelect:n,onCancel:i,onDismiss:r,PopupStyles:a,isDisabled:s,hideSubmit:c}=e;const{t:u}=l.useTranslation(),d=[o.createElement("div",null,o.createElement(t.CardText,null,u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",o.createElement("strong",null,u("CORE_LOGOUT_MESSAGE"))))],m=[o.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:i}),o.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:s})],p=[o.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:i})];return o.createElement(t.PopUp,{type:"default",children:d,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:c?p:m,sortFooterButtons:!0,onClose:r,className:"digit-logout-popup-wrapper",onOverlayClick:r,equalWidthButtons:!0,style:a})},Ie=e=>{let{info:t,t:n}=e;return o.createElement("div",{className:"profile-section"},o.createElement("div",{className:"imageloader imageloader-loaded"},o.createElement(ne,{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,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",alt:"Profile Logo"})),o.createElement("div",{id:"profile-name",className:"label-container name-Profile"},o.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),o.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},o.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&o.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},o.createElement("div",{className:"label-text"}," ",t.emailId," ")),o.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&o.createElement(be,{t:n,mobileView:!0}))},we={CommonPTIcon:o.createElement(s.PTIcon,{className:"icon"}),OBPSIcon:o.createElement(s.OBPSIcon,{className:"icon"}),propertyIcon:o.createElement(s.PropertyHouse,{className:"icon"}),TLIcon:o.createElement(s.CaseIcon,{className:"icon"}),PGRIcon:o.createElement(s.PGRIcon,{className:"icon"}),FSMIcon:o.createElement(s.FSMIcon,{className:"icon"}),WSIcon:o.createElement(s.WSICon,{className:"icon"}),MCollectIcon:o.createElement(s.MCollectIcon,{className:"icon"}),BillsIcon:o.createElement(s.CollectionIcon,{className:"icon"}),BirthIcon:o.createElement(s.BirthIcon,{className:"icon"}),DeathIcon:o.createElement(s.DeathIcon,{className:"icon"}),FirenocIcon:o.createElement(s.FirenocIcon,{className:"icon"}),HomeIcon:o.createElement(s.HomeIcon,{className:"icon"}),EditPencilIcon:o.createElement(s.EditPencilIcon,{className:"icon"}),LogoutIcon:o.createElement(s.LogoutIcon,{className:"icon"}),Phone:o.createElement(s.Phone,{className:"icon"})},_e=e=>{var t,i,r,c;let{linkData:u,islinkDataLoading:d}=e;const{t:p}=l.useTranslation(),v=a.useHistory(),g=a.useLocation(),{pathname:f}=g,{data:E,isFetched:h}=Digit.Hooks.useStore.getInitData(),{stateInfo:y}=E||{},b=Digit.UserService.getUser();let S=window.Digit.Utils.browser.isMobile();const[C,N]=n.useState(!1),[O,I]=n.useState(!1),[w,_]=n.useState(!1),D=()=>{_(!1)};if(d)return o.createElement(s.Loader,null);let T=[...Ne(p,0,()=>{var e;v.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)})];T=T.filter(e=>"LANGUAGE"!==e.element),Digit.ULBService.getCurrentTenantId();const A=e=>{var t,n;let{item:l}=e;const i=(null==l?void 0:l.icon)||(null===(t=l.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),r=i?we[i]:we.BillsIcon;let s;s="component"===l.type?l.action:l.text;const c=()=>o.createElement("span",m({className:"menu-item"},l.populators),r,o.createElement("div",{className:"menu-label"},s));return"external-link"===l.type?o.createElement("a",{href:l.link},o.createElement(c,null)):"link"===l.type?o.createElement(a.Link,{to:null==l?void 0:l.link},o.createElement(c,null)):o.createElement(c,null)};let R;var L,x,P,M,k;return h&&b&&b.access_token&&"CITIZEN"===(null==b||null===(t=b.info)||void 0===t?void 0:t.type)&&(R=o.createElement(Ie,{info:null==b?void 0:b.info,stateName:null==y?void 0:y.name,t:p}),T=T.filter(e=>"login-btn"!==(null==e?void 0:e.id)),T=[...T,{type:"link",icon:"HomeIcon",element:"HOME",text:p("COMMON_BOTTOM_NAVIGATION_HOME"),link:C?`/${null===(L=window)||void 0===L?void 0:L.contextPath}/employee`:`/${null===(x=window)||void 0===x?void 0:x.contextPath}/citizen`,populators:{onClick:()=>{var e;v.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/all-services`)}}},{text:p("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:()=>{var e;v.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`)}}},{text:p("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{I(!1),_(!0)}}},{text:o.createElement(o.Fragment,null,p("CS_COMMON_HELPLINE"),o.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==E||null===(P=E.tenants)||void 0===P?void 0:P.map(e=>{}),o.createElement("div",{className:"link"},o.createElement("a",{href:"tel:"+(null==E||null===(M=E.tenants)||void 0===M?void 0:M[0].contactNumber)},null==E||null===(k=E.tenants)||void 0===k?void 0:k[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(i=Object.keys(u))||void 0===i||null===(r=i.sort((e,t)=>t.localeCompare(e)))||void 0===r||r.map(e=>{var t,n,o,l,i,r;(null===(t=u[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&T.splice(1,0,{type:null!==(n=u[e][0])&&void 0!==n&&null!==(o=n.sidebarURL)&&void 0!==o&&o.includes(null===(l=window)||void 0===l?void 0:l.contextPath)?"link":"external-link",text:p("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:u[e],icon:null===(i=u[e][0])||void 0===i?void 0:i.leftIcon,link:null===(r=u[e][0])||void 0===r?void 0:r.sidebarURL})}),o.createElement(o.Fragment,null,o.createElement("div",null,o.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),o.createElement("div",{style:{display:"flex",flexDirection:"column",height:S?"calc(100vh - 56px)":"auto",zIndex:"99"}},R,o.createElement("div",{className:"drawer-desktop"},null===(c=T)||void 0===c?void 0:c.map((e,t)=>o.createElement("div",{className:"sidebar-list "+(f===(null==e?void 0:e.link)||f===(null==e?void 0:e.sidebarURL)?"active":""),key:t},o.createElement(A,{item:e}))))),o.createElement("div",null,w&&o.createElement(Oe,{onSelect:()=>{if(Digit.Utils.getMultiRootTenant()){var e;Digit.UserService.logout(),_(!1),window.location.href=`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`}else{var t,n;const e="CITIZEN"===(null===(t=Digit.UserService.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.type);var o;Digit.UserService.logout(),_(!1),e&&(window.location.href=`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/login`)}},onCancel:D,onDismiss:D}))))},De=e=>{var i,r,c,u,d;let{isMobile:m=!1,toggleSidebar:p,onLogout:v,isEmployee:g=!1,linkData:f,islinkDataLoading:E,userProfile:h}=e;Digit.Utils.getMultiRootTenant();const{data:y,isFetched:b}=Digit.Hooks.useStore.getInitData(),S=Digit.StoreData.getCurrentLanguage(),[C,N]=n.useState(null),{languages:O,stateInfo:I}=y||{},w=Digit.UserService.getUser(),[_,D]=n.useState(""),[T,A]=n.useState(null),[R,L]=n.useState([]),[x,P]=n.useState([]),[M,k]=n.useState(S);let U=[];const{isLoading:B,data:F}=Digit.Hooks.useAccessControl(),j=Digit.ULBService.getCurrentTenantId(),{t:H}=l.useTranslation(),z=a.useHistory(),G=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(o=e)&&void 0!==o&&o.includes(t);){var o,l;e=null===(l=e)||void 0===l?void 0:l.replace(t,n)}return e};n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let o=[],l=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>o.push(e.tenantId));let i=o.filter((e,t,n)=>n.indexOf(e)===t);null==i||i.forEach(e=>{var t;l.push({label:H("TENANT_TENANTS_"+(null===(t=G(e,".","_"))||void 0===t?void 0:t.toUpperCase())),value:e})}),U=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),L(l)},[T]);const V=()=>{Digit.clikOusideFired=!0,p(!1)};n.useEffect(()=>{C||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==w||null===(e=w.info)||void 0===e?void 0:e.uuid,o=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){var t,n;const o=null==e||null===(t=e.user)||void 0===t?void 0:t[0];if(o){const e=Digit.UserService.getUser();Digit.UserService.setUser({...e,info:o})}if(e&&e.user&&null!=e&&null!==(n=e.user)&&void 0!==n&&n.length){var l;const t=e.user[0],n=null==t||null===(l=t.photo)||void 0===l?void 0:l.split(",");N(null==n?void 0:n.at(0))}})}();Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[C]);const W=e=>{let t=null;var n,o;Digit.Utils.getMultiRootTenant()?(t=g?e.replace("/sandbox-ui/employee",`/sandbox-ui/${j}/employee`):e.replace("/sandbox-ui/citizen",`/sandbox-ui/${j}/citizen`),z.push(t),p()):(z.push("/"===e[0]?`/${null===(n=window)||void 0===n?void 0:n.contextPath}/${g?"employee":"citizen"}${e}`:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/${g?"employee":"citizen"}/${e}`),p())};if(E||B)return o.createElement(t.Loader,null);let Q=[{id:"login-btn",element:"LOGIN",text:H("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:()=>{var e,t;z.push(g?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/language-selection`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/login`),V()}}}];b&&w&&w.access_token&&(Q=Q.filter(e=>"login-btn"!==(null==e?void 0:e.id)));let X={};if(g){var q;null==F||F.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==_&&""!==e.path){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),X[t]?X[t].push(e):X[t]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(_.toLowerCase())){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),X[t]?X[t].push(e):X[t]=[e]}});const e=Object.keys(X);for(let t=0;t<(null==e?void 0:e.length);t++){var Z,Y,$,J,K;const n=null===(Z=X[e[t]][0])||void 0===Z||null===(Y=Z.displayName)||void 0===Y||null===($=Y.toUpperCase())||void 0===$?void 0:$.replace(/[ -]/g,"_"),o=null===(J=e[t])||void 0===J||null===(K=J.toUpperCase())||void 0===K?void 0:K.replace(/[ -]/g,"_");var ee,te,ne,oe;-1===X[e[t]][0].path.indexOf(".")?Q.splice(1,0,{type:"link",text:H("ACTION_TEST_"+n),link:null===(ee=X[e[t]][0])||void 0===ee?void 0:ee.navigationURL,icon:null===(te=X[e[t]][0])||void 0===te?void 0:te.leftIcon,populators:{onClick:()=>{var n;z.push(null===(n=X[e[t]][0])||void 0===n?void 0:n.navigationURL),V()}}}):Q.splice(1,0,{type:"dynamic",moduleName:H("ACTION_TEST_"+o),links:null===(ne=X[e[t]])||void 0===ne?void 0:ne.map(e=>{var t,n;return{...e,displayName:H("ACTION_TEST_"+(null==e||null===(t=e.displayName)||void 0===t||null===(n=t.toUpperCase())||void 0===n?void 0:n.replace(/[ -]/g,"_")))}}),icon:null===(oe=X[e[t]][1])||void 0===oe?void 0:oe.leftIcon})}const t=Q.findIndex(e=>"HOME"===e.element),n=Q.splice(t,1),o=Q.findIndex(e=>"LANGUAGE"===e.element),l=Q.splice(o,(null===(q=Q)||void 0===q?void 0:q.length)-o);Q.sort((e,t)=>("dynamic"===(null==e?void 0:e.type)?null==e?void 0:e.moduleName:null==e?void 0:e.text).localeCompare("dynamic"===(null==t?void 0:t.type)?null==t?void 0:t.moduleName:null==t?void 0:t.text)),(null==n?void 0:n[0])&&Q.splice(0,0,n[0]),Q=(null==l?void 0:l.length)>0?Q.concat(l):Q}else{var le,ie;null===(le=Object.keys(f))||void 0===le||null===(ie=le.sort((e,t)=>t.localeCompare(e)))||void 0===ie||ie.map(e=>{var t,n,o,l,i,r;"digit-ui-links"===(null===(t=f[e][0])||void 0===t?void 0:t.sidebar)&&Q.splice(1,0,{type:null!==(n=f[e][0])&&void 0!==n&&null!==(o=n.sidebarURL)&&void 0!==o&&o.includes(null===(l=window)||void 0===l?void 0:l.contextPath)?"link":"external-link",text:H("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:f[e],icon:null===(i=f[e][0])||void 0===i?void 0:i.leftIcon,link:null===(r=f[e][0])||void 0===r?void 0:r.sidebarURL})})}z.location.pathname.includes("/openlink")&&(Q=Q.filter(e=>"LANGUAGE"===e.element)),Q=null===(i=Q)||void 0===i?void 0:i.map(e=>({...e,label:(null==e?void 0:e.text)||(null==e?void 0:e.moduleName)||"",icon:null!=e&&e.icon?null==e?void 0:e.icon:void 0}));let re="";var ae;re=Digit.Utils.getMultiRootTenant()?H("TENANT_TENANTS_"+j):H("TENANT_TENANTS_"+(null===(ae=G(Digit.ULBService.getCurrentTenantId(),".","_"))||void 0===ae?void 0:ae.toUpperCase()));const se=null===(r=Q)||void 0===r?void 0:r.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?{...e,children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>({...e,label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}:e}),ce=null==R?void 0:R.map(e=>({...e,type:"custom",key:"city"})),ue=null==O?void 0:O.map(e=>({...e,type:"custom",key:"language",icon:"Language"})),de=[{label:"HOME",value:"HOME",icon:"Home",type:"custom",key:"home"},{label:re,value:re,children:(null==ce?void 0:ce.length)>0?ce:void 0,type:"custom",icon:"LocationCity",key:"city"},{label:H("Language"),children:(null==ue?void 0:ue.length)>0?ue:void 0,type:"custom",icon:"Language",key:"language"},...w&&w.access_token?[{label:H("EDIT_PROFILE"),type:"custom",icon:"Edit",key:"editProfile"}]:[],{label:H("Modules"),icon:"DriveFileMove",children:se}];return m?o.createElement(t.Hamburger,{items:de,profileName:null==w||null===(c=w.info)||void 0===c?void 0:c.name,profileNumber:(null==w||null===(u=w.info)||void 0===u?void 0:u.mobileNumber)||(null==w||null===(d=w.info)||void 0===d?void 0:d.emailId),theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:v,hideUserManuals:!0,profile:C||void 0,isSearchable:!0,onSelect:e=>{let{item:t,index:n,parentIndex:o}=e;return(e=>{let{item:t}=e;if(null!=t&&t.navigationURL)W(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)W(null==t?void 0:t.link);else{if("custom"!==(null==t?void 0:t.type))return;switch(null==t?void 0:t.key){case"home":z.push(g?`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen`),p();break;case"editProfile":h(),p();break;case"language":k((n=t).value),sessionStorage.setItem("Citizen.locale.changed","true"),Digit.LocalizationService.changeLanguage(n.value,I.code),p();break;case"city":(e=>{var t,n,o,l;const i=Digit.SessionStorage.get("citizen.userRequestObject"),r=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.filter(t=>t.tenantId===e.value);if((null==r?void 0:r.length)>0&&(i.info.roles=r,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),A(e),window.location.href.includes(`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee/`)){var a,s;const e=(null===(a=location.state)||void 0===a?void 0:a.from)||`/${null===(s=window)||void 0===s?void 0:s.contextPath}/employee`;z.replace(e)}window.location.reload()})(t),p()}}var n,o,l})({item:t,index:n,parentIndex:o})}}):o.createElement(_e,{logout:v})};var Te=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(p(function(e,t){var n;n=e=>(()=>{var t={"./node_modules/css-mediaquery/index.js":(e,t)=>{t.match=function(e,t){return a(e).some(function(e){var n=e.inverse,o="all"===e.type||t.type===e.type;if(o&&n||!o&&!n)return!1;var l=e.expressions.every(function(e){var n=e.feature,o=e.modifier,l=e.value,i=t[n];if(!i)return!1;switch(n){case"orientation":case"scan":return i.toLowerCase()===l.toLowerCase();case"width":case"height":case"device-width":case"device-height":l=u(l),i=u(i);break;case"resolution":l=c(l),i=c(i);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":l=s(l),i=s(i);break;case"grid":case"color":case"color-index":case"monochrome":l=parseInt(l,10)||1,i=parseInt(i,10)||0}switch(o){case"min":return i>=l;case"max":return i<=l;default:return i===l}});return l&&!n||!l&&n})},t.parse=a;var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,o=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,l=/^(?:(min|max)-)?(.+)/,i=/(em|rem|px|cm|mm|in|pt|pc)?$/,r=/(dpi|dpcm|dppx)?$/;function a(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),i=t[1],r=t[2],a=t[3]||"",s={};return s.inverse=!!i&&"not"===i.toLowerCase(),s.type=r?r.toLowerCase():"all",a=a.match(/\([^\)]+\)/g)||[],s.expressions=a.map(function(e){var t=e.match(o),n=t[1].toLowerCase().match(l);return{modifier:n[1],feature:n[2],value:t[2]}}),s})}function s(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function c(e){var t=parseFloat(e);switch(String(e).match(r)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function u(e){var t=parseFloat(e);switch(String(e).match(i)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},"./node_modules/hyphenate-style-name/index.js":(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});var o=/[A-Z]/g,l=/^ms-/,i={};function r(e){return"-"+e.toLowerCase()}const a=function(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(o,r);return i[e]=l.test(t)?"-"+t:t}},"./node_modules/matchmediaquery/index.js":(e,t,n)=>{var o=n("./node_modules/css-mediaquery/index.js").match,l="undefined"!=typeof window?window.matchMedia:null;function i(e,t,n){var i=this;if(l&&!n){var r=l.call(window,e);this.matches=r.matches,this.media=r.media,r.addListener(a)}else this.matches=o(e,t),this.media=e;function a(e){i.matches=e.matches,i.media=e.media}this.addListener=function(e){r&&r.addListener(e)},this.removeListener=function(e){r&&r.removeListener(e)},this.dispose=function(){r&&r.removeListener(a)}}e.exports=function(e,t,n){return new i(e,t,n)}},"./node_modules/object-assign/index.js":e=>{var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function l(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var r,a,s=l(e),c=1;c<arguments.length;c++){for(var u in r=Object(arguments[c]))n.call(r,u)&&(s[u]=r[u]);if(t){a=t(r);for(var d=0;d<a.length;d++)o.call(r,a[d])&&(s[a[d]]=r[a[d]])}}return s}},"./node_modules/prop-types/checkPropTypes.js":(e,t,n)=>{var o,l=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),i={},r=n("./node_modules/prop-types/lib/has.js");function a(e,t,n,a,s){for(var c in e)if(r(e,c)){var u;try{if("function"!=typeof e[c]){var d=Error((a||"React class")+": "+n+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=e[c](t,c,a,n,null,l)}catch(e){u=e}if(!u||u instanceof Error||o((a||"React class")+": type specification of "+n+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in i)){i[u.message]=!0;var m=s?s():"";o("Failed "+n+" type: "+u.message+(null!=m?m:""))}}}o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},a.resetWarningCache=function(){i={}},e.exports=a},"./node_modules/prop-types/factoryWithTypeCheckers.js":(e,t,n)=>{var o,l=n("./node_modules/react-is/index.js"),i=n("./node_modules/object-assign/index.js"),r=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),a=n("./node_modules/prop-types/lib/has.js"),s=n("./node_modules/prop-types/checkPropTypes.js");function c(){return null}o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,u={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(c),arrayOf:function(e){return p(function(t,n,o,l,i){if("function"!=typeof e)return new m("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new m("Invalid "+l+" `"+i+"` of type `"+E(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,o,l,i+"["+s+"]",r);if(c instanceof Error)return c}return null})},element:p(function(t,n,o,l,i){var r=t[n];return e(r)?null:new m("Invalid "+l+" `"+i+"` of type `"+E(r)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:p(function(e,t,n,o,i){var r=e[t];return l.isValidElementType(r)?null:new m("Invalid "+o+" `"+i+"` of type `"+E(r)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return p(function(t,n,o,l,i){var r;return t[n]instanceof e?null:new m("Invalid "+l+" `"+i+"` of type `"+((r=t[n]).constructor&&r.constructor.name?r.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:p(function(e,t,n,o,l){return f(e[t])?null:new m("Invalid "+o+" `"+l+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return p(function(t,n,o,l,i){if("function"!=typeof e)return new m("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[n],c=E(s);if("object"!==c)return new m("Invalid "+l+" `"+i+"` of type `"+c+"` supplied to `"+o+"`, expected an object.");for(var u in s)if(a(s,u)){var d=e(s,u,o,l,i+"."+u,r);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return o(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),c;function t(t,n,o,l,i){for(var r=t[n],a=0;a<e.length;a++)if(d(r,e[a]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===h(t)?String(t):t});return new m("Invalid "+l+" `"+i+"` of value `"+String(r)+"` supplied to `"+o+"`, expected one of "+s+".")}return p(t)},oneOfType:function(e){if(!Array.isArray(e))return o("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+y(n)+" at index "+t+"."),c}return p(function(t,n,o,l,i){for(var s=[],c=0;c<e.length;c++){var u=(0,e[c])(t,n,o,l,i,r);if(null==u)return null;u.data&&a(u.data,"expectedType")&&s.push(u.data.expectedType)}return new m("Invalid "+l+" `"+i+"` supplied to `"+o+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return p(function(t,n,o,l,i){var a=t[n],s=E(a);if("object"!==s)return new m("Invalid "+l+" `"+i+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return g(o,l,i,c,h(u));var d=u(a,c,o,l,i+"."+c,r);if(d)return d}return null})},exact:function(e){return p(function(t,n,o,l,s){var c=t[n],u=E(c);if("object"!==u)return new m("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");var d=i({},t[n],e);for(var p in d){var v=e[p];if(a(e,p)&&"function"!=typeof v)return g(o,l,s,p,h(v));if(!v)return new m("Invalid "+l+" `"+s+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=v(c,p,o,l,s+"."+p,r);if(f)return f}return null})}};function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){var n={},l=0;function i(i,a,s,c,u,d,p){if(c=c||"<<anonymous>>",d=d||s,p!==r){if(t){var v=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");throw v.name="Invariant Violation",v}if("undefined"!=typeof console){var g=c+":"+s;!n[g]&&l<3&&(o("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+c+"`. 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."),n[g]=!0,l++)}}return null==a[s]?i?new m(null===a[s]?"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,s,c,u,d)}var a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function v(e){return p(function(t,n,o,l,i,r){var a=t[n];return E(a)!==e?new m("Invalid "+l+" `"+i+"` of type `"+h(a)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function g(e,t,n,o,l){return new m((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+l+"`.")}function f(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(f);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var l,i=o.call(t);if(o!==t.entries){for(;!(l=i.next()).done;)if(!f(l.value))return!1}else for(;!(l=i.next()).done;){var r=l.value;if(r&&!f(r[1]))return!1}return!0;default:return!1}}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function h(e){if(null==e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){var t=h(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return m.prototype=Error.prototype,u.checkPropTypes=s,u.resetWarningCache=s.resetWarningCache,u.PropTypes=u,u}},"./node_modules/prop-types/index.js":(e,t,n)=>{var o=n("./node_modules/react-is/index.js");e.exports=n("./node_modules/prop-types/factoryWithTypeCheckers.js")(o.isElement,!0)},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":e=>{e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},"./node_modules/prop-types/lib/has.js":e=>{e.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":(e,t)=>{!function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case c:case u:case l:case r:case i:case m:return p;default:var f=p&&p.$$typeof;switch(f){case s:case d:case g:case v:case a:return f;default:return t}}case o:return t}}}var S=u,C=s,N=a,O=n,I=d,w=l,_=g,D=v,T=o,A=r,R=i,L=m,x=!1;function P(e){return b(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=C,t.ContextProvider=N,t.Element=O,t.ForwardRef=I,t.Fragment=w,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=A,t.StrictMode=R,t.Suspense=L,t.isAsyncMode=function(e){return x||(x=!0,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.")),P(e)||b(e)===c},t.isConcurrentMode=P,t.isContextConsumer=function(e){return b(e)===s},t.isContextProvider=function(e){return b(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===l},t.isLazy=function(e){return b(e)===g},t.isMemo=function(e){return b(e)===v},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===r},t.isStrictMode=function(e){return b(e)===i},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===r||e===i||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===h||e.$$typeof===y||e.$$typeof===f)},t.typeOf=b}()},"./node_modules/react-is/index.js":(e,t,n)=>{e.exports=n("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(e,t,n)=>{function o(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),o=Object.keys(t),l=n.length;if(o.length!==l)return!1;for(var i=0;i<l;i++){var r=n[i];if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))return!1}return!0}function l(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}n.r(t),n.d(t,{shallowEqualArrays:()=>l,shallowEqualObjects:()=>o})},"./src/Component.ts":function(e,t,n){var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=l(n("./src/useMediaQuery.ts"));t.default=function(e){var t=e.children,n=e.device,l=e.onChange,r=o(e,["children","device","onChange"]),a=(0,i.default)(r,n,l);return"function"==typeof t?t(a):a?t:null}},"./src/Context.ts":(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var o=(0,n("react").createContext)(void 0);t.default=o},"./src/index.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.toQuery=t.useMediaQuery=t.default=void 0;var l=o(n("./src/useMediaQuery.ts"));t.useMediaQuery=l.default;var i=o(n("./src/Component.ts"));t.default=i.default;var r=o(n("./src/toQuery.ts"));t.toQuery=r.default;var a=o(n("./src/Context.ts"));t.Context=a.default},"./src/mediaQuery.ts":function(e,t,n){var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)},l=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=i(n("./node_modules/prop-types/index.js")),a=r.default.oneOfType([r.default.string,r.default.number]),s={all:r.default.bool,grid:r.default.bool,aural:r.default.bool,braille:r.default.bool,handheld:r.default.bool,print:r.default.bool,projection:r.default.bool,screen:r.default.bool,tty:r.default.bool,tv:r.default.bool,embossed:r.default.bool},c={orientation:r.default.oneOf(["portrait","landscape"]),scan:r.default.oneOf(["progressive","interlace"]),aspectRatio:r.default.string,deviceAspectRatio:r.default.string,height:a,deviceHeight:a,width:a,deviceWidth:a,color:r.default.bool,colorIndex:r.default.bool,monochrome:r.default.bool,resolution:a,type:Object.keys(s)},u=l(c,["type"]),d=o({minAspectRatio:r.default.string,maxAspectRatio:r.default.string,minDeviceAspectRatio:r.default.string,maxDeviceAspectRatio:r.default.string,minHeight:a,maxHeight:a,minDeviceHeight:a,maxDeviceHeight:a,minWidth:a,maxWidth:a,minDeviceWidth:a,maxDeviceWidth:a,minColor:r.default.number,maxColor:r.default.number,minColorIndex:r.default.number,maxColorIndex:r.default.number,minMonochrome:r.default.number,maxMonochrome:r.default.number,minResolution:a,maxResolution:a},u),m=o(o({},s),d);t.default={all:m,types:s,matchers:c,features:d}},"./src/toQuery.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=o(n("./node_modules/hyphenate-style-name/index.js")),i=o(n("./src/mediaQuery.ts"));t.default=function(e){var t=[];return Object.keys(i.default.all).forEach(function(n){var o=e[n];null!=o&&t.push(function(e,t){var n=(0,l.default)(e);return"number"==typeof t&&(t="".concat(t,"px")),!0===t?n:!1===t?"not ".concat(n):"(".concat(n,": ").concat(t,")")}(n,o))}),t.join(" and ")}},"./src/useMediaQuery.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=n("react"),i=o(n("./node_modules/matchmediaquery/index.js")),r=o(n("./node_modules/hyphenate-style-name/index.js")),a=n("./node_modules/shallow-equal/dist/index.esm.js"),s=o(n("./src/toQuery.ts")),c=o(n("./src/Context.ts")),u=function(e){if(e)return Object.keys(e).reduce(function(t,n){return t[(0,r.default)(n)]=e[n],t},{})},d=function(){var e=(0,l.useRef)(!1);return(0,l.useEffect)(function(){e.current=!0},[]),e.current};t.default=function(e,t,n){var o=function(e){var t=(0,l.useContext)(c.default),n=function(){return u(e)||u(t)},o=(0,l.useState)(n),i=o[0],r=o[1];return(0,l.useEffect)(function(){var e=n();(0,a.shallowEqualObjects)(i,e)||r(e)},[e,t]),i}(t),r=function(e){var t=function(){return function(e){return e.query||(0,s.default)(e)}(e)},n=(0,l.useState)(t),o=n[0],i=n[1];return(0,l.useEffect)(function(){var e=t();o!==e&&i(e)},[e]),o}(e);if(!r)throw new Error("Invalid or missing MediaQuery!");var m=function(e,t){var n=function(){return(0,i.default)(e,t||{},!!t)},o=(0,l.useState)(n),r=o[0],a=o[1],s=d();return(0,l.useEffect)(function(){if(s){var e=n();return a(e),function(){e&&e.dispose()}}},[e,t]),r}(r,o),p=function(e){var t=(0,l.useState)(e.matches),n=t[0],o=t[1];return(0,l.useEffect)(function(){var t=function(e){o(e.matches)};return e.addListener(t),o(e.matches),function(){e.removeListener(t)}},[e]),n}(m),v=d();return(0,l.useEffect)(function(){v&&n&&n(p)},[p]),(0,l.useEffect)(function(){return function(){m&&m.dispose()}},[]),p}},react:t=>{t.exports=e}},n={};function o(e){var l=n[e];if(void 0!==l)return l.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,o),i.exports}return o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o("./src/index.ts")})(),e.exports=n(o)}));const Ae=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),i=Digit.Utils.getMultiRootTenant(),{t:r}=l.useTranslation(),s=a.useHistory(),c=Digit.ULBService.getStateId(),u={};null==n||n.actions.filter(e=>"url"===e.url).forEach(e=>{var t;if(null==e||null===(t=e.path)||void 0===t||t.split("."),""!==(null==e?void 0:e.path)){var n;const t=null==e||null===(n=e.path)||void 0===n?void 0:n.split(".");let o={};t.reduce((n,o,l)=>{if(l!==t.length-1)return n[o]={},n[o];n[o]={item:e}},o),function e(t,n){for(const o in n)n.hasOwnProperty(o)&&("object"!=typeof n[o]||Array.isArray(n[o])?t[o]||(t[o]=n[o]):(t[o]||(t[o]={}),e(t[o],n[o])))}(u,o)}});const d=e=>(e.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:Infinity)-(void 0!==t.orderNumber?t.orderNumber:Infinity)),e.forEach(e=>{e.children&&e.children.length>0&&d(e.children)}),e),m=function(e){const t=(e,n)=>{if(n.item)return{label:r(n.item.displayName),icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL,orderNumber:n.item.orderNumber};const o=Object.keys(n).map(e=>t(e,n[e])),l=function e(t){void 0===t&&(t={});for(const n in t){const o=t[n];if("item"===n&&""!==(null==o?void 0:o.leftIcon))return null==o?void 0:o.leftIcon;if("object"==typeof t[n]&&!Array.isArray(t[n])){const o=e(t[n]);if(o)return o}}return null}(n);return{label:r(e),icon:{icon:l,width:"1.5rem",height:"1.5rem"},children:o}};return Object.keys(e).map(n=>t(n,e[n]))}((e=>{const t=Object.entries(e);return t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0),Object.fromEntries(t)})(u)),p=d(m);return e?o.createElement(t.Loader,null):u?o.createElement(Te,{minWidth:768},o.createElement(t.SideNav,{items:p,hideAccessbilityTools:!0,onSelect:e=>{let{item:t,index:n,parentIndex:o}=e;return(e=>{let{item:t}=e;null!=t&&t.navigationUrl&&function(e,t){var n;if(void 0===e&&(e={}),void 0===t&&(t=""),t&&"/"!==t)if(/^https?:\/\//i.test(t))window.open(t,"_blank","noopener,noreferrer");else if(t.includes("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)))e.push(t);else{const n=window.location.origin;let l;if(i){var o;const n=(null===(o=window)||void 0===o?void 0:o.contextPath)||"sandbox-ui";l=t=t.replace(`/${n}/employee`,`/${n}/${c}/employee`),e.push(l)}else l=n+t,window.location.href=l}}(s,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:o})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}})):""},Re=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:l,handleLogout:i,mobileView:r,userDetails:a,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?o.createElement(De,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:i,linkData:c,islinkDataLoading:u,userProfile:d,isEmployee:!1}):!n&&null!=a&&a.access_token?o.createElement("div",{className:"digit-employeeSidebar"},o.createElement(Ae,{mobileView:r,userDetails:a,modules:s})):o.createElement("div",{className:"digit-citizenSidebar"},o.createElement(De,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:i,isEmployee:!0,userProfile:d}))},Le=e=>{let{t:t,stateInfo:l,userDetails:i,CITIZEN:r,cityDetails:s,mobileView:c,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showSidebar:p=!0,showLanguageChange:v,linkData:g,islinkDataLoading:f}=e;const[E,h]=n.useState(!1),y=a.useHistory(),[b,S]=n.useState(!1),C=()=>{h(!1),S(!0)},N=()=>{S(!1)},O=()=>{h(!E)},I=()=>{var e,t;y.push(r?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/profile`)},w=[{name:t("EDIT_PROFILE"),icon:"Edit",func:I},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:C}];return o.createElement(o.Fragment,null,o.createElement(Ce,{t:t,stateInfo:l,toggleSidebar:O,isSidebarOpen:E,handleLogout:C,userDetails:i,CITIZEN:r,cityDetails:s,mobileView:c,userOptions:w,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showLanguageChange:v}),b&&o.createElement(Oe,{onSelect:()=>{var e,t;const n="CITIZEN"===(null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.type);var o;Digit.UserService.logout(),S(!1),n&&(window.location.href=`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/login`)},onCancel:N,onDismiss:N}),r?r?p&&E&&o.createElement(Re,{t:t,CITIZEN:r,isSidebarOpen:E,toggleSidebar:O,handleLogout:C,mobileView:c,userDetails:i,linkData:g,userProfile:I,islinkDataLoading:f}):null:p&&o.createElement(Re,{t:t,CITIZEN:r,isSidebarOpen:E,toggleSidebar:O,handleLogout:C,mobileView:c,userDetails:i,linkData:g,userProfile:I,islinkDataLoading:f}))},xe=e=>{const{question:t,answer:i,lastIndex:r}=e,[a,s]=n.useState(!1),{t:u}=l.useTranslation();return o.createElement("div",{className:"faqs border-none",onClick:()=>s(!a)},o.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},o.createElement("span",null,u(t)),o.createElement("span",{className:a?"faqicon rotate":"faqicon",style:{float:"right"}},o.createElement(c.ArrowForward,null))),o.createElement("div",{className:"faq-answer",style:a?{display:"block"}:{display:"none"}},o.createElement("span",null,u(i))),r?null:o.createElement("div",{className:"cs-box-border"}))},Pe=e=>{var i,r,a;let{module:s}=e;const c=Digit.UserService.getUser(),{t:u}=((null==c||null===(i=c.info)||void 0===i?void 0:i.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation()),{isLoading:d,data:m}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),p=null==m||null===(r=m.MdmsRes["common-masters"])||void 0===r||null===(a=r.faqs[0])||void 0===a?void 0:a[""+s].faqs;return d?o.createElement(t.Loader,null):o.createElement(n.Fragment,null,o.createElement("div",{className:"faq-page"},o.createElement(t.BackButton,{style:{marginLeft:"unset"}}),o.createElement("div",{style:{marginBottom:"15px"}},o.createElement(t.HeaderComponent,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),o.createElement("div",{className:"faq-list"},p.map((e,t)=>o.createElement(xe,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},Me=()=>{var e,t,n,i,r,c,u,d,p,v,g,f,E,h,y,b,S,C,N,O,I,w,_,D,T,A,R;const{t:L}=l.useTranslation(),x=a.useHistory(),P=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCitizenCurrentTenant(!0),{data:{uiHomePage:M}={},isLoading:k}=Digit.Hooks.useStore.getInitData();let U=window.Digit.Utils.browser.isMobile();const B=()=>{var e,t,n,o,l;return"EMPLOYEE"!==(null===(e=Digit.UserService)||void 0===e||null===(t=e.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.type)&&!(null===(o=Digit.UserService)||void 0===o||null===(l=o.getUser())||void 0===l||!l.access_token)},{data:F,isLoading:j}=Digit.Hooks.useEvents({tenantId:P,variant:"whats-new",config:{enabled:B()}});var H;P||x.push(`/${null===(H=window)||void 0===H?void 0:H.contextPath}/citizen/select-language`);const z=null==M?void 0:M.appBannerDesktop,G=null==M?void 0:M.appBannerMobile,V=null==M?void 0:M.citizenServicesCard,W=null==M?void 0:M.informationAndUpdatesCard,Q=null==M?void 0:M.whatsAppBannerDesktop,X=null==M?void 0:M.whatsAppBannerMobile,q=null==M?void 0:M.whatsNewSection,Z=null==M?void 0:M.redirectURL;var Y,$;Z&&x.push(`/${null===(Y=window)||void 0===Y?void 0:Y.contextPath}/citizen/${Z}`),(null!==(e=window)&&void 0!==e&&null!==(t=e.location)&&void 0!==t&&null!==(n=t.href)&&void 0!==n&&null!==(i=n.includes)&&void 0!==i&&i.call(n,"sanitation-ui")||null!==(r=window)&&void 0!==r&&null!==(c=r.location)&&void 0!==c&&null!==(u=c.href)&&void 0!==u&&null!==(d=u.includes)&&void 0!==d&&d.call(u,"sandbox-ui"))&&x.push(`/${null===($=window)||void 0===$?void 0:$.contextPath}/citizen/all-services`);const J=e=>{window.open(null==e?void 0:e.navigationUrl)},K={header:L(null==V?void 0:V.headerLabel),sideOption:{name:L(null==V||null===(p=V.sideOption)||void 0===p?void 0:p.name),onClick:()=>{var e;return x.push(null==V||null===(e=V.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:L(null==V||null===(v=V.props)||void 0===v||null===(g=v[0])||void 0===g?void 0:g.label),Icon:o.createElement(s.ComplaintIcon,null),onClick:()=>{var e,t;return x.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==V||null===(f=V.props)||void 0===f||null===(E=f[1])||void 0===E?void 0:E.label),Icon:o.createElement(s.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return x.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==V||null===(h=V.props)||void 0===h||null===(y=h[2])||void 0===y?void 0:y.label),Icon:o.createElement(s.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return x.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==V||null===(b=V.props)||void 0===b||null===(S=b[3])||void 0===S?void 0:S.label),Icon:o.createElement(s.OBPSIcon,null),onClick:()=>{var e,t;return x.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}},ee={header:L(null==W?void 0:W.headerLabel),sideOption:{name:L(null==W||null===(C=W.sideOption)||void 0===C?void 0:C.name),onClick:()=>{var e;return x.push(null==W||null===(e=W.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:L(null==W||null===(N=W.props)||void 0===N||null===(O=N[0])||void 0===O?void 0:O.label),Icon:o.createElement(s.HomeIcon,null),onClick:()=>{var e,t;return x.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==W||null===(I=W.props)||void 0===I||null===(w=I[1])||void 0===w?void 0:w.label),Icon:o.createElement(s.Calender,null),onClick:()=>{var e,t;return x.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==W||null===(_=W.props)||void 0===_||null===(D=_[2])||void 0===D?void 0:D.label),Icon:o.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return x.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==W||null===(T=W.props)||void 0===T||null===(A=T[3])||void 0===A?void 0:A.label),Icon:o.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return x.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}};return k?o.createElement(s.Loader,null):o.createElement("div",{className:"HomePageContainer"},o.createElement("div",{className:"HomePageWrapper"},o.createElement("div",{className:"BannerWithSearch"},o.createElement(ne,U?{src:null==G?void 0:G.bannerUrl,alt:"Banner Image"}:{src:null==z?void 0:z.bannerUrl,alt:"Banner Image"}),o.createElement("div",{className:"ServicesSection"},o.createElement(s.CardBasedOptions,m({style:{marginTop:"-30px"}},K)),o.createElement(s.CardBasedOptions,m({style:U?{}:{marginTop:"-30px"}},ee)))),(X||Q)&&o.createElement("div",{className:"WhatsAppBanner"},o.createElement(ne,U?{src:null==X?void 0:X.bannerUrl,onClick:()=>J(X),alt:"Whatsapp Banner"}:{src:null==Q?void 0:Q.bannerUrl,onClick:()=>J(Q),alt:"Whatsapp Banner"})),B()?j?o.createElement(s.Loader,null):o.createElement("div",{className:"WhatsNewSection"},o.createElement("div",{className:"headSection"},o.createElement("h2",null,L(null==q?void 0:q.headerLabel)),o.createElement("p",{onClick:()=>{var e;return x.push(null==q||null===(e=q.sideOption)||void 0===e?void 0:e.navigationUrl)}},L(null==q||null===(R=q.sideOption)||void 0===R?void 0:R.name))),o.createElement(s.WhatsNewCard,null==F?void 0:F[0])):null))},ke=()=>{const{t:e}=l.useTranslation(),t=a.useHistory(),{data:{languages:i,stateInfo:r}={},isLoading:c}=Digit.Hooks.useStore.getInitData(),u=Digit.StoreData.getCurrentLanguage(),d=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),m=n.useMemo(()=>({options:i,optionsKey:"label",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:e=>{sessionStorage.setItem("Citizen.locale.changed","true"),Digit.LocalizationService.changeLanguage(e.value,r.code)},selectedOption:null==i?void 0:i.filter(e=>e.value===u)[0]}),[u,i]);return c?o.createElement(s.Loader,null):o.createElement("div",{className:"selection-card-wrapper"},o.createElement(s.PageBasedInput,{texts:d,onSubmit:function(){var e;t.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)}},o.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),o.createElement(s.RadioButtons,m)))},Ue=()=>{const{t:e}=l.useTranslation(),i=a.useHistory(),r=a.useLocation(),{data:{uiHomePage:c}={}}=Digit.Hooks.useStore.getInitData(),u=null==c?void 0:c.redirectURL,{data:d,isLoading:p}=Digit.Hooks.useTenants(),[v,g]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[f,E]=n.useState(!1),h=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function y(e){g(e),E(!1)}const b=n.useMemo(()=>({options:d,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:y,selectedOption:v}),[d,e,v]);return p?o.createElement("loader",null):o.createElement("div",{className:"selection-card-wrapper"},o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement(s.PageBasedInput,{texts:h,onSubmit:function(){if(v){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",v);const o=null===(e=r.state)||void 0===e?void 0:e.redirectBackTo;var t,n;u?i.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/${u}`):o?i.replace(o):i.push(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen`)}else E(!0)},className:"location-selection-container"},o.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),o.createElement(s.SearchOnRadioButtons,m({},b,{placeholder:e("COMMON_TABLE_SEARCH")})),f?o.createElement(s.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},Be=function(){function e(){}return e.prototype.then=function(t,n){const o=new e,l=this.s;if(l){const e=1&l?t:n;if(e){try{Fe(o,1,e(this.v))}catch(e){Fe(o,2,e)}return o}return this}return this.o=function(e){try{const l=e.v;1&e.s?Fe(o,1,t?t(l):l):n?Fe(o,1,n(l)):Fe(o,2,l)}catch(e){Fe(o,2,e)}},o},e}();function Fe(e,t,n){if(!e.s){if(n instanceof Be){if(!n.s)return void(n.o=Fe.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Fe.bind(null,e,t),Fe.bind(null,e,2));e.s=t,e.v=n;const o=e.o;o&&o(e)}}function je(e){return e instanceof Be&&1&e.s}const He="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function ze(e,t,n){if("function"==typeof e[He]){var o,l,i,r=e[He]();if(function e(a){try{for(;!((o=r.next()).done||n&&n());)if((a=t(o.value))&&a.then){if(!je(a))return void a.then(e,i||(i=Fe.bind(null,l=new Be,2)));a=a.v}l?Fe(l,1,a):l=a}catch(e){Fe(l||(l=new Be),2,e)}}(),r.return){var a=function(e){try{o.done||r.return()}catch(e){}return e};if(l&&l.then)return l.then(a,function(e){throw a(e)});a()}return l}if(!("length"in e))throw new TypeError("Object is not iterable");for(var s=[],c=0;c<e.length;c++)s.push(e[c]);return function(e,t,n){var o,l,i=-1;return function r(a){try{for(;++i<e.length&&(!n||!n());)if((a=t(i))&&a.then){if(!je(a))return void a.then(r,l||(l=Fe.bind(null,o=new Be,2)));a=a.v}o?Fe(o,1,a):o=a}catch(e){Fe(o||(o=new Be),2,e)}}(),o}(s,function(e){return t(s[e])},n)}function Ge(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function Ve(e){let{setProfilePic:t,closeDrawer:i,userType:r,removeProfilePic:a,showToast:c}=e;const[u,d]=n.useState(null),[m,p]=n.useState(""),[v,g]=n.useState(null),{t:f}=l.useTranslation();return n.useEffect(()=>{!function(){try{g(null);const e=function(){if(m){const e=function(){if(m.size>=1e6)c("error",f("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),g(f("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ge(function(){return Promise.resolve(Digit.UploadServices.Filestorage(r+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var n,o;if((null==e||null===(n=e.data)||void 0===n||null===(o=n.files)||void 0===o?void 0:o.length)>0){var l,i;const n=null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId;d(n),t(n)}else c("error",f("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),g(f("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",f("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),o.createElement(o.Fragment,null,o.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>i()}),o.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===r?"2.5rem":"0",zIndex:"1000"}},o.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},o.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",o.createElement(s.GalleryIcon,null)),o.createElement("label",{style:{cursor:"pointer"}}," Gallery"),o.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>p(e.target.files[0]),style:{display:"none"}})),o.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},o.createElement("button",{onClick:()=>{a(),i()}},o.createElement(s.RemoveIcon,null)),o.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}var We,Qe,Xe;"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const qe={tenantId:""+(null===(We=Digit)||void 0===We||null===(Qe=We.ULBService)||void 0===Qe||null===(Xe=Qe.getStateId)||void 0===Xe?void 0:Xe.call(Qe)),UserProfileValidationConfig:[{name:"/^[a-zA-Z ]+$/i",mobileNumber:"/^[6-9]{1}[0-9]{9}$/",password:"/^([a-zA-Z0-9@#$%]{8,15})$/i"}]},Ze=e=>{var i,r,c,u,d,p,v,g,f,E,h,y,b,S,C,N,O,I,w,_,D,T,A,R,L,x,P,M,k,U,B,F,j,H,z,G,V,W;let{stateCode:Q,userType:X,cityDetails:q}=e;a.useHistory();const{t:Z}=l.useTranslation(),Y=window.location.href,$=Digit.ULBService.getStateId(),J=Digit.ULBService.getCurrentTenantId(),K=(null===(i=Digit.UserService.getUser())||void 0===i?void 0:i.info)||{},[ee,te]=n.useState(null),[oe,le]=n.useState(null!=K&&K.name?K.name:""),[ie,re]=n.useState(null!=K&&K.emailId?K.emailId:""),[ae,se]=n.useState(null==ee?void 0:ee.gender),[ce,ue]=n.useState(null!=K&&K.permanentCity?K.permanentCity:q.name),[de,me]=n.useState(null!=K&&K.mobileNumber?K.mobileNumber:""),[pe,ve]=n.useState(null),[ge,fe]=n.useState(""),[Ee,he]=n.useState(!1),[ye,be]=n.useState(!1),[Se,Ce]=n.useState(""),[Ne,Oe]=n.useState(""),[Ie,we]=n.useState(""),[_e,De]=n.useState(null),[Te,Ae]=n.useState(!1),[Re,Le]=o.useState(window.innerWidth),[xe,Pe]=o.useState({}),Me=window.Digit.Utils.browser.isMobile(),ke=Digit.Utils.getMultiRootTenant(),[Ue,Be]=n.useState({SMS:{scope:"GLOBAL",status:"REVOKED"},EMAIL:{scope:"GLOBAL",status:"REVOKED"},WHATSAPP:{scope:"GLOBAL",status:"REVOKED"}}),[Fe,je]=n.useState(Digit.StoreData.getCurrentLanguage()||"en_IN"),He=null===(r=Digit.SessionStorage.get("initData"))||void 0===r?void 0:r.languages,ze=e=>{var t;return(null==e||null===(t=e.UserProfileValidationConfig)||void 0===t?void 0:t[0])&&Object.entries(null==e?void 0:e.UserProfileValidationConfig[0]).reduce((e,t)=>{let[n,o]=t;if("string"==typeof o)try{if(o.startsWith("/")&&o.lastIndexOf("/")>0){const t=o.lastIndexOf("/"),l=o.slice(1,t),i=o.slice(t+1);e[n]=new RegExp(l,i)}else e[n]=new RegExp(o)}catch(t){console.error(`Error parsing regex for key "${n}":`,t),e[n]=o}else e[n]=o;return e},{})},[We,Qe]=n.useState(ze(qe)||{}),Xe=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getCurrentTenantId():null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u?void 0:u.getConfig("STATE_LEVEL_TENANT_ID"),Ze=(null===(d=Digit)||void 0===d||null===(p=d.Utils)||void 0===p||null===(v=p.getConfigModuleName)||void 0===v?void 0:v.call(p))||"commonUiConfig",{data:Ye}=Digit.Hooks.useCustomMDMS(Xe,"commonUiConfig",[{name:"UserPreferencesConfig"}],{select:e=>{var t,n,o;return null==e||null===(t=e.commonUiConfig)||void 0===t||null===(n=t.UserPreferencesConfig)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.enableUserPreferences}},{schemaCode:"commonUiConfig.UserPreferencesConfig"}),{data:$e}=Digit.Hooks.useCustomAPIHook({url:"/user-preference/v1/_search",body:{criteria:{userId:null==K?void 0:K.uuid,tenantId:J,preferenceCode:"USER_NOTIFICATION_PREFERENCES"}},changeQueryName:"user_preference_search",config:{enabled:!(null==K||!K.uuid)&&("citizen"===X||ke)&&!!Ye,select:e=>{var t;return null==e||null===(t=e.preferences)||void 0===t?void 0:t[0]},cacheTime:0,staleTime:0}}),Je=Digit.Hooks.useCustomAPIMutationHook({url:"/user-preference/v1/_upsert"});n.useEffect(()=>{if(null!=$e&&$e.payload){const e=$e.payload.consent||{};Be(t=>({SMS:e.SMS||t.SMS,EMAIL:e.EMAIL||t.EMAIL,WHATSAPP:e.WHATSAPP||t.WHATSAPP})),$e.payload.preferredLanguage&&je($e.payload.preferredLanguage)}},[$e]);const{data:Ke}=Digit.Hooks.useCustomAPIHook({url:"/config-service/config/v1/_search",body:{criteria:{schemaCode:"NotificationChannel",tenantId:J}},changeQueryName:"config_service_search",config:{enabled:!!Ye&&!!J,select:e=>{var t;const n={};return null==e||null===(t=e.configData)||void 0===t||t.forEach(e=>{var t;n[e.uniqueIdentifier]=!0===(null===(t=e.data)||void 0===t?void 0:t.enabled)}),n}}}),{data:et,isValidationConfigLoading:tt}=Digit.Hooks.useCustomMDMS(Xe,Ze,[{name:"UserValidation"}],{select:e=>{var t;const n=((null==e||null===(t=e[Ze])||void 0===t?void 0:t.UserValidation)||[]).filter(e=>"mobile"===e.fieldType).map(e=>{var t,n,o,l,i;return{prefix:null==e||null===(t=e.attributes)||void 0===t?void 0:t.prefix,pattern:null==e||null===(n=e.rules)||void 0===n?void 0:n.pattern,maxLength:null==e||null===(o=e.rules)||void 0===o?void 0:o.maxLength,minLength:null==e||null===(l=e.rules)||void 0===l?void 0:l.minLength,errorMessage:null==e||null===(i=e.rules)||void 0===i?void 0:i.errorMessage,isDefault:!0===(null==e?void 0:e.default)}}),o=n.find(e=>e.isDefault)||n[0];return{mobileConfigs:n,defaultConfig:o,UserProfileValidationConfig:[{mobileNumber:null==o?void 0:o.pattern}],prefix:(null==o?void 0:o.prefix)||"+91"}},enabled:!!Xe});n.useEffect(()=>{var e;if(et&&null!=et&&null!==(e=et.UserProfileValidationConfig)&&void 0!==e&&e[0]){const e=ze(et);null!=et&&et.prefix&&(e.prefix=et.prefix),Qe(t=>({...t,...e}))}},[et]);const nt=(null==et?void 0:et.mobileConfigs)||[],ot=(null==et?void 0:et.defaultConfig)||{},[lt,it]=n.useState(ot);n.useEffect(()=>{null==et||!et.defaultConfig||null!=lt&&lt.prefix||it(et.defaultConfig)},[null==et?void 0:et.defaultConfig]);const rt=(null==lt?void 0:lt.pattern)||"^[6-9][0-9]{9}$",at=n.useMemo(()=>new RegExp(rt),[rt]),st=(null==lt?void 0:lt.maxLength)||10,ct=(null==lt?void 0:lt.prefix)||"+91",ut=(null==lt?void 0:lt.errorMessage)||"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID";o.useEffect(()=>(window.addEventListener("resize",()=>Le(window.innerWidth)),()=>{window.removeEventListener("resize",()=>Le(window.innerWidth))})),n.useEffect(()=>{var e;Ae(!0),function(){try{var e,t;const n=null==K?void 0:K.uuid,o=null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t?void 0:t.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH"),l=function(){if(n){const e=o?Promise.resolve(Digit.CustomService.getResponse({url:o+"/v1/_search",useCache:!1,method:"POST",userService:!0,params:{limit:1e3,offset:0,tenantId:J},body:{Individual:{userUuid:[n],tenantId:J}}})).then(function(e){var t;null!=e&&null!==(t=e.Individual)&&void 0!==t&&t.length&&te(e.Individual[0])}):Promise.resolve(Digit.UserService.userSearch(J,{uuid:[n]},{})).then(function(e){var t;null!=e&&null!==(t=e.user)&&void 0!==t&&t.length&&te(e.user[0])});if(e&&e.then)return e.then(function(){})}}();Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),se({i18nKey:void 0,code:null==ee?void 0:ee.gender,value:null==ee?void 0:ee.gender});const t=null==ee||null===(e=ee.photo)||void 0===e?void 0:e.split(",");fe(null==t?void 0:t.at(0)),Ae(!1)},[null!==ee]);let dt={};const mt=e=>se(e),pt=()=>he(!1),vt=e=>{var t;le(e),null==We||null===(t=We.name)||void 0===t||!t.test(e)||0===e.length||e.length>50?Pe({...xe,userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}}):Pe({...xe,userName:null})},gt=e=>{(null==K?void 0:K.userName)!==e?(re(e),!e.length||e.includes("@")&&e.includes(".")?Pe({...xe,emailAddress:null}):Pe({...xe,emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}})):Pe({...xe,emailAddress:null})},ft=function(e,t,n){void 0===n&&(n=5e3),De({key:e,action:t}),setTimeout(()=>{De(null)},n)},Et=function(){try{let t=!1;function e(e){if(t)return e;Ae(!1)}Ae(!0);const n=Ge(function(){var e,t;function n(){if(r&&"200"===r.status){const e=Digit.UserService.getUser();e&&Digit.UserService.setUser({...e,info:{...e.info,name:oe,mobileNumber:de,emailId:ie,permanentCity:ce}})}return function(){if(Se.length&&Ne.length&&Ie.length){const e={existingPassword:Se,newPassword:Ne,tenantId:J,type:"EMPLOYEE",username:null==K?void 0:K.userName,confirmPassword:Ie};return function(){if(Ne===Ie)return Ge(function(){return Promise.resolve(Digit.UserService.changePassword(e,J)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";ft("success",Z("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)})},function(e){var t,n;throw JSON.stringify({type:"error",message:null!==(t=e.Errors)&&void 0!==t&&null!==(n=t.at(0))&&void 0!==n&&n.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})});throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"})}()}{const e=function(e){if(null!==(e=r)&&void 0!==e&&e.status&&"200"===r.status){function t(){ft("success",Z("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}const e=function(){if(("citizen"===X||Digit.Utils.getMultiRootTenant())&&Ye)return Promise.resolve(function(){try{return Promise.resolve(Ge(function(){return Promise.resolve(Je.mutateAsync({body:{preference:{userId:null==K?void 0:K.uuid,tenantId:J,preferenceCode:"USER_NOTIFICATION_PREFERENCES",payload:{consent:Ue,preferredLanguage:Fe}}}})).then(function(){})},function(e){var t,n,o,l;throw JSON.stringify({type:"error",message:(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.Errors)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.description)||"CORE_COMMON_PROFILE_PREFERENCE_UPDATE_ERROR"})}))}catch(e){return Promise.reject(e)}}()).then(function(){})}();return e&&e.then?e.then(t):t()}}();if(e&&e.then)return e.then(function(){})}}()}if(oe&&le(e=>e.trim()),null==We||!We.name.test(oe)||""===oe||oe.length>50||oe.length<1)throw JSON.stringify({type:"error",message:Z("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===X&&!at.test(de))throw JSON.stringify({type:"error",message:Z(ut)});if(ie.length&&(!ie.includes("@")||!ie.includes(".")))throw JSON.stringify({type:"error",message:Z("CORE_COMMON_PROFILE_EMAIL_INVALID")});const o=Se.trim(),l=Ne.trim(),i=Ie.trim();if(Ce(o),Oe(l),we(i),ye&&o&&l&&i){if(l!==i)throw JSON.stringify({type:"error",message:Z("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(o.length&&l.length&&i.length))throw JSON.stringify({type:"error",message:Z("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!(null!=We&&We.password.test(l)||null!=We&&We.password.test(i)))throw JSON.stringify({type:"error",message:Z("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}let r;const a=null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t?void 0:t.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH"),s=function(){if(a){var e,t;const n={...ee,tenantId:J,name:{givenName:oe.trim(),familyName:null==ee||null===(e=ee.name)||void 0===e?void 0:e.familyName,otherNames:null==ee||null===(t=ee.name)||void 0===t?void 0:t.otherNames},mobileNumber:de,countryCode:ct,isDeleted:!1,isSystemUser:!0,isSystemUserActive:!0};return null!=ae&&ae.value&&(n.gender=ae.value),ie&&(n.email=ie),pe&&(n.photo=pe),Promise.resolve(Digit.CustomService.getResponse({url:a+"/v1/_update",useCache:!1,method:"POST",userService:!0,body:{Individual:n}})).then(function(e){r=null==e?void 0:e.responseInfo})}{const e={...K,name:oe,countryCode:ct,gender:null==ae?void 0:ae.value,emailId:ie,photo:pe};return Promise.resolve(Digit.UserService.updateUser(e,Q)).then(function(e){r=null==e?void 0:e.responseInfo})}}();return s&&s.then?s.then(n):n()},function(e){let t;try{t=JSON.parse(e)}catch(r){var n,o,l,i;t={type:"error",message:(null==e||null===(n=e.response)||void 0===n||null===(o=n.data)||void 0===o||null===(l=o.Errors)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.description)||"CORE_COMMON_PROFILE_UPDATE_ERROR"}}ft(t.type,Z(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let ht=[];const{data:yt}=Digit.Hooks.useGenderMDMS($,"common-masters","GenderType");return yt&&yt.map(e=>{ht.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),Te||tt?o.createElement(t.Loader,null):o.createElement("div",{className:"user-profile "+("citizen"===X?"citizen":"employee")},o.createElement("section",{style:{margin:"citizen"===X||Me?"8px":"0px"}},"citizen"===X||Me?o.createElement(t.BackLink,{onClick:()=>window.history.back()}):o.createElement(t.BreadCrumb,{style:{marginTop:"0rem",marginBottom:"1.5rem"},crumbs:[{internalLink:ke?`/${null===(g=window)||void 0===g?void 0:g.contextPath}/employee/sandbox/landing`:`/${null===(f=window)||void 0===f?void 0:f.contextPath}/employee`,content:Z("ES_COMMON_HOME"),show:!0},{internalLink:`/${null===(E=window)||void 0===E?void 0:E.contextPath}/employee/user/profile`,content:Z("ES_COMMON_PAGE_1"),show:Y.includes("/user/profile")}]})),o.createElement("div",{style:{display:"flex",flex:1,flexDirection:Re<768||"citizen"===X?"column":"row",margin:"citizen"===X?"8px":"0px",gap:"citizen"===X?"":"0 24px",boxShadow:"citizen"===X?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===X?"white":"",borderRadius:"citizen"===X?"4px":"",maxWidth:"citizen"===X?"960px":""}},o.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===X?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===X?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===X?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===X?"8px":"16px"}},o.createElement("div",{style:{position:"relative",height:"citizen"===X?"114px":"150px",width:"citizen"===X?"114px":"150px",margin:"16px"}},o.createElement(ne,{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:ge&&""!==ge?ge:"data:image/png;base64,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",alt:"Profile Image"}),o.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>he(!Ee)},o.createElement(s.CameraIcon,null)))),o.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===X?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===X?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===X?"8px":"24px",paddingBottom:"20px"}},"citizen"===X?o.createElement(o.Fragment,null,o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+Z("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"100%",maxWidth:"960px"}},o.createElement(t.TextInput,m({t:Z,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:oe,onChange:e=>vt(e.target.value)},dt={isRequired:!0,pattern:(null==et||null===(h=et.UserProfileValidationConfig)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.name)||(null==qe||null===(b=qe.UserProfileValidationConfig)||void 0===b||null===(S=b[0])||void 0===S?void 0:S.name),type:"tel",title:Z("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==xe?void 0:xe.userName)&&o.createElement(t.ErrorMessage,{message:Z(null==xe||null===(C=xe.userName)||void 0===C?void 0:C.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+Z("CORE_COMMON_PROFILE_GENDER")),o.createElement(t.Dropdown,{style:{width:"100%",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==ae?void 0:ae.length)?ae[0]:ae,disable:1===(null==ae?void 0:ae.length)||!1,option:ht,select:mt,value:ae,optionKey:"code",t:Z,name:"gender"})),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+Z("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:Z,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:ie,onChange:e=>gt(e.target.value),disabled:!1}),(null==xe?void 0:xe.emailAddress)&&o.createElement(t.ErrorMessage,{message:Z(null==xe||null===(N=xe.emailAddress)||void 0===N?void 0:N.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),Ye&&(null==He?void 0:He.length)>=1?o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile"},Z("CORE_COMMON_PREFERRED_LANGUAGE")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.Dropdown,{option:He,optionKey:"label",selected:null==He?void 0:He.find(e=>e.value===Fe),select:e=>je(e.value),t:Z}))):null,Ye?[{key:"SMS",label:Z("CORE_COMMON_SMS_NOTIFICATIONS")},{key:"EMAIL",label:Z("CORE_COMMON_EMAIL_NOTIFICATIONS")},{key:"WHATSAPP",label:Z("CORE_COMMON_WHATSAPP_NOTIFICATIONS")}].map(e=>{const n=!0===(null==Ke?void 0:Ke[e.key]);return o.createElement(t.LabelFieldPair,{key:e.key},o.createElement(t.CardLabel,{className:"user-profile",style:{width:"30%",minWidth:"150px",...n?{}:{color:"#B1B4B6"}}},e.label),o.createElement("div",{style:{display:"flex",alignItems:"flex-end",gap:"10px"}},o.createElement(s.ToggleSwitch,{value:"GRANTED"===Ue[e.key].status,onChange:()=>(e=>{Be(t=>({...t,[e]:{...t[e],status:"GRANTED"===t[e].status?"REVOKED":"GRANTED"}}))})(e.key),disabled:!n,name:"notification-"+e.key,style:{margin:"0px",opacity:n?1:.4}}),o.createElement("span",{style:{fontSize:"14px",marginBottom:"2px",color:n?"#505A5F":"#B1B4B6"}},Z(n&&"GRANTED"===Ue[e.key].status?"CORE_COMMON_ENABLED":"CORE_COMMON_DISABLED"))))}):null,o.createElement("button",{onClick:Et,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Me?"100%":"240px",borderBottom:"1px solid black"}},Z("CORE_COMMON_SAVE"))):o.createElement(o.Fragment,null,o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+Z("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,m({t:Z,type:"text",isMandatory:!1,name:"name",value:oe,onChange:e=>vt(e.target.value),placeholder:"Enter Your Name"},dt={isRequired:!0,pattern:(null==et||null===(O=et.UserProfileValidationConfig)||void 0===O||null===(I=O[0])||void 0===I?void 0:I.name)||(null==qe||null===(w=qe.UserProfileValidationConfig)||void 0===w||null===(_=w[0])||void 0===_?void 0:_.name),type:"text",title:Z("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==xe?void 0:xe.userName)&&o.createElement(t.ErrorMessage,{message:Z(null==xe||null===(D=xe.userName)||void 0===D?void 0:D.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+Z("CORE_COMMON_PROFILE_GENDER")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.Dropdown,{className:"profileDropdown",selected:1===(null==ae?void 0:ae.length)?ae[0]:ae,disable:1===(null==ae?void 0:ae.length)||!1,option:ht,select:mt,value:ae,optionKey:"code",t:Z,name:"gender"}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+Z("CORE_COMMON_PROFILE_CITY")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,m({t:Z,type:"text",isMandatory:!1,name:"city",value:Z(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+J)),onChange:e=>ue(e.target.value),placeholder:"Enter Your City Name"},dt={isRequired:!0,type:"text",title:Z("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),o.createElement(t.ErrorMessage,null))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},Z("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),o.createElement("div",{style:{width:"100%"}},o.createElement("div",{style:{display:"flex",alignItems:"center",border:null!=xe&&xe.mobileNumber?"2px solid #d4351c":"1px solid #464646",overflow:"hidden",backgroundColor:"#FFFFFF",boxSizing:"border-box",height:"2.5rem",width:"100%",maxWidth:"100%"}},nt.length>1?o.createElement("select",{value:ct,onChange:e=>{const t=nt.find(t=>t.prefix===e.target.value)||ot;it(t),me(""),Pe({...xe,mobileNumber:null})},disabled:!Digit.Utils.getMultiRootTenant(),style:{border:"none",borderRight:null!=xe&&xe.mobileNumber?"2px solid #d4351c":"1px solid #464646",padding:"0 8px",fontSize:"16px",backgroundColor:"#EEEEEE",cursor:Digit.Utils.getMultiRootTenant()?"pointer":"not-allowed",outline:"none",color:"#0B0C0C",fontWeight:"500",minWidth:"75px",height:"100%",appearance:"auto"}},nt.map(e=>o.createElement("option",{key:e.prefix,value:e.prefix},e.prefix))):o.createElement("span",{style:{padding:"0 10px",fontSize:"16px",fontWeight:"500",color:"#0B0C0C",borderRight:null!=xe&&xe.mobileNumber?"2px solid #d4351c":"1px solid #464646",height:"100%",display:"flex",alignItems:"center",backgroundColor:"#EEEEEE"}},ct),o.createElement("input",{type:"text",inputMode:"numeric",value:de||"",onChange:e=>(e=>{const t=e.replace(/\D/g,"");t.length>st||(me(t),"employee"!==X||at.test(t)?Pe({...xe,mobileNumber:null}):Pe({...xe,mobileNumber:{type:"pattern",message:ut}}))})(e.target.value),placeholder:"Enter a valid Mobile No.",maxLength:st,disabled:!Digit.Utils.getMultiRootTenant(),style:{flex:1,border:"none",padding:"0 12px",fontSize:"16px",outline:"none",color:"#0B0C0C",backgroundColor:"transparent",height:"100%",width:"100%",minWidth:"0",cursor:Digit.Utils.getMultiRootTenant()?"text":"not-allowed"}}),o.createElement("span",{style:{padding:"0 8px",fontSize:"12px",color:"#6f777b",whiteSpace:"nowrap"}},(de||"").length,"/",st)),(null==xe?void 0:xe.mobileNumber)&&o.createElement(t.ErrorMessage,{message:Z(null==xe||null===(T=xe.mobileNumber)||void 0===T?void 0:T.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+Z("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:Z,type:"email",isMandatory:!1,placeholder:Z("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:ie,onChange:e=>gt(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()}),(null==xe?void 0:xe.emailAddress)&&o.createElement(t.ErrorMessage,{message:Z(null==xe||null===(A=xe.emailAddress)||void 0===A?void 0:A.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement("div",{style:{width:"100%"}},0!=ye||Digit.Utils.getOTPBasedLogin()?null:o.createElement(t.Button,{label:Z("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>be(!ye),style:{paddingLeft:"20rem"}}),ye?o.createElement("div",{style:{marginTop:"10px"}},o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+Z("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:Z,type:"password",isMandatory:!1,name:"name",pattern:(null==et||null===(R=et.UserProfileValidationConfig)||void 0===R||null===(L=R[0])||void 0===L?void 0:L.password)||(null==qe||null===(x=qe.UserProfileValidationConfig)||void 0===x||null===(P=x[0])||void 0===P?void 0:P.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,void(null!=We&&We.password.test(n)?Pe({...xe,currentPassword:null}):Pe({...xe,currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}))},disabled:!1}),(null==xe?void 0:xe.currentPassword)&&o.createElement(t.ErrorMessage,{message:Z(null==xe||null===(M=xe.currentPassword)||void 0===M?void 0:M.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+Z("CORE_COMMON_PROFILE_NEW_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:Z,type:"password",isMandatory:!1,name:"name",pattern:(null==et||null===(k=et.UserProfileValidationConfig)||void 0===k||null===(U=k[0])||void 0===U?void 0:U.password)||(null==qe||null===(B=qe.UserProfileValidationConfig)||void 0===B||null===(F=B[0])||void 0===F?void 0:F.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Oe(n),void(null!=We&&We.password.test(n)?Pe({...xe,newPassword:null}):Pe({...xe,newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}))},disabled:!1}),(null==xe?void 0:xe.newPassword)&&o.createElement(t.ErrorMessage,{message:Z(null==xe||null===(j=xe.newPassword)||void 0===j?void 0:j.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+Z("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:Z,type:"password",isMandatory:!1,name:"name",pattern:(null==et||null===(H=et.UserProfileValidationConfig)||void 0===H||null===(z=H[0])||void 0===z?void 0:z.password)||(null==qe||null===(G=qe.UserProfileValidationConfig)||void 0===G||null===(V=G[0])||void 0===V?void 0:V.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,we(n),void(null!=We&&We.password.test(n)?Pe({...xe,confirmPassword:null}):Pe({...xe,confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}))},disabled:!1}),(null==xe?void 0:xe.confirmPassword)&&o.createElement(t.ErrorMessage,{message:Z(null==xe||null===(W=xe.confirmPassword)||void 0===W?void 0:W.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===X&&Me?o.createElement("button",{onClick:Et,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Me?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},Z("CORE_COMMON_SAVE")):null))),"employee"!==X||Me?null:o.createElement(t.Footer,{actionFields:[o.createElement(t.SubmitBar,{t:Z,label:Z("CORE_COMMON_SAVE"),onSubmit:Et})],className:"",setactionFieldsToRight:!0}),_e&&o.createElement(t.Toast,{type:_e.key,label:Z("success"===_e.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":_e.action),onClose:()=>De(null),style:{maxWidth:"670px"}}),1==Ee?o.createElement(Ve,{setProfilePic:function(e){try{function t(e){fe(null==e?void 0:e.thumbs[0]),pt()}return ve(e),Promise.resolve(e?Promise.resolve(function(e,t){try{return Promise.resolve(Digit.UploadServices.Filefetch(e,t)).then(function(e){return e.data.fileStoreIds&&0!==e.data.fileStoreIds.length?{thumbs:e.data.fileStoreIds.map(e=>e.url.split(",")[3]),images:e.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null})}catch(e){return Promise.reject(e)}}([e],$)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:pt,userType:X,removeProfilePic:()=>{ve(null),fe(null)},showToast:ft}):"")},Ye=e=>{var i,r,a;let{module:c}=e;const u=Digit.UserService.getUser(),{t:d}=((null==u||null===(i=u.info)||void 0===i?void 0:i.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation()),m=Digit.SessionStorage.get("initData").stateInfo,p=Digit.StoreData.getCurrentLanguage(),[v,g]=n.useState(p),[f,E]=n.useState(!1),[h,y]=n.useState(""),b=()=>o.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("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"})),{isLoading:S,data:C}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),N=null==C||null===(r=C.MdmsRes["common-masters"])||void 0===r||null===(a=r.howItWorks[0])||void 0===a?void 0:a[""+c];return S?o.createElement(t.Loader,null):o.createElement(n.Fragment,null,o.createElement("div",{className:"how-it-works-page"},o.createElement(t.BackButton,null),o.createElement("div",{className:"how-it-works-page-header"},o.createElement(t.HeaderComponent,null,d(N.screenHeader?N.screenHeader:"HOW_IT_WORKS"))),o.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>o.createElement("div",{className:"language-button-container",key:t},o.createElement(s.CustomButton,{selected:e.value===v,text:e.label,onClick:()=>(e=>{g(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)})(e)})))),N.videosJson.map((e,t)=>o.createElement("div",null,o.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},o.createElement("div",{className:"video-icon",onClick:()=>{return t=e,y("hi_IN"===v?t.hi_IN:t.en_IN),void E(!0);var t}},o.createElement("div",{className:"vid-svg"},o.createElement(b,null))),o.createElement("div",{className:"how-it-works-header-description"},o.createElement("h2",null,d(e.headerLabel)),o.createElement("p",null,d(e.description)))))),N.pdfHeader&&N.pdfDesc&&o.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},o.createElement("div",{className:"how-it-works-pdf-section"},o.createElement("div",{className:"pdf-icon-header-desc"},o.createElement("div",{className:"pdf-icon"},o.createElement(t.PDFSvg,null)),o.createElement("div",{className:"pdf-header-desc"},o.createElement("h2",null,d(N.pdfHeader)),o.createElement("p",null,d(N.pdfDesc)))),o.createElement("div",{className:"download-icon"},o.createElement(t.DownloadImgIcon,null)))),f&&o.createElement("div",{className:"how-it-works-video-play"},o.createElement("div",{className:"close-button"},o.createElement(t.CloseSvg,{onClick:()=>{E(!1)}})),o.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},o.createElement("source",{src:h,type:"video/mp4"})))))},$e=[{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:!0,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:!0,minlength:1,maxlength:50,pattern:"^[A-Za-z]+( [A-Za-z]+)*$"}}]}],Je=e=>{let{t:l,onSelect:i,mobileNumber:r,emailId:a,onMobileChange:c,onEmailChange:u,config:d,canSubmit:m,validationConfig:p,allValidationConfigs:v,onConsentChange:g,enableUserPreferences:f}=e;const[E,h]=n.useState(!!a),[y,b]=n.useState(""),[S,C]=n.useState(!1),N=f,O=n.useMemo(()=>(Array.isArray(v)?v:[]).filter(e=>"mobile"===e.fieldType),[v]),I=n.useMemo(()=>O.find(e=>e.isDefault)||O[0]||p||{},[O,p]),[w,_]=n.useState(I);n.useEffect(()=>{!I||!I.prefix||null!=w&&w.prefix||_(I)},[I]);const D=w||p||{},T=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,A=(null==D?void 0:D.pattern)||"^[6-9][0-9]{9}$",R=n.useMemo(()=>new RegExp(A),[A]),L=(null==D?void 0:D.maxLength)||10,x=(null==D?void 0:D.prefix)||"+91",P=(null==D?void 0:D.errorMessage)||"ERR_INVALID_MOBILE_NUMBER",M=n.useMemo(()=>T.test(a),[a]),k=n.useMemo(()=>R.test(r||""),[r,R]),U=n.useMemo(()=>E?!(M&&m):!(k&&m),[E,M,k,m]),B=n.useMemo(()=>window.innerWidth<=768?l(E?"LOGIN_WITH_MOBILE":"LOGIN_WITH_EMAIL"):l(E?"CS_USE_MOBILE_INSTEAD":"CS_LOGIN_REGISTER_WITH_EMAIL"),[E,l]),F=!E&&O.length>1;return o.createElement(t.InputCard,{t:l,texts:null==d?void 0:d.texts,submit:!0,onNext:()=>{if(E){if(!M)return void b(l("ERR_INVALID_EMAIL"));i({userName:a,whatsappConsent:S})}else{if(!k)return void b(l(P));i({mobileNumber:r,countryCode:(null==w?void 0:w.prefix)||x,whatsappConsent:S})}},isDisable:U},o.createElement("div",{className:"input-field-wrapper",style:{marginBottom:"0"}},E?o.createElement(t.FieldV1,{key:"email",withoutLabel:!0,charCount:!0,error:y,onChange:e=>{const t=e.target.value;b(""),u(e),t&&!T.test(t)&&b(l("ERR_INVALID_EMAIL"))},placeholder:l("ENTER_EMAIL_PLACEHOLDER"),populators:{name:"userName",prefix:"",validation:{maxlength:256,pattern:T}},props:{fieldStyle:{width:"100%"}},type:"text",value:a}):o.createElement(n.Fragment,null,o.createElement("div",{style:{display:"flex",alignItems:"center",border:y?"2px solid #d4351c":"1px solid #464646",overflow:"hidden",backgroundColor:"#FFFFFF",boxSizing:"border-box",height:"2.5rem",width:"100%"}},F?o.createElement("select",{value:(null==w?void 0:w.prefix)||x,onChange:e=>{const t=O.find(t=>t.prefix===e.target.value)||w;_(t),b(""),c({target:{value:""}})},style:{border:"none",borderRight:y?"2px solid #d4351c":"1px solid #464646",padding:"0 8px",fontSize:"16px",backgroundColor:"#EEEEEE",cursor:"pointer",outline:"none",color:"#0B0C0C",fontWeight:"500",minWidth:"75px",height:"100%",appearance:"auto"}},O.map(e=>o.createElement("option",{key:e.prefix,value:e.prefix},e.prefix))):o.createElement("span",{style:{padding:"0 10px",fontSize:"16px",fontWeight:"500",color:"#0B0C0C",borderRight:y?"2px solid #d4351c":"1px solid #464646",height:"100%",display:"flex",alignItems:"center",backgroundColor:"#EEEEEE",whiteSpace:"nowrap"}},x),o.createElement("input",{type:"text",inputMode:"numeric",value:r,onChange:e=>{const t=e.target.value.replace(/\D/g,"");t.length>L||(b(""),c({target:{value:t}}),t&&!R.test(t)&&b(l(P)))},placeholder:l("ENTER_MOBILE_PLACEHOLDER"),maxLength:L,style:{flex:1,border:"none",padding:"0 12px",fontSize:"16px",outline:"none",color:"#0B0C0C",backgroundColor:"transparent",height:"100%",minWidth:"0"}}),o.createElement("span",{style:{padding:"0 8px",fontSize:"12px",color:"#6f777b",whiteSpace:"nowrap"}},(r||"").length,"/",L)),y&&o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",color:"#d4351c",fontSize:"14px"}},o.createElement("span",null,"⚠"),o.createElement("span",null,y)))),o.createElement("div",{style:{marginTop:E?"-3rem":"0.5rem"}},N&&o.createElement(s.CheckBox,{onChange:()=>{const e=!S;C(e),g&&g(e)},checked:S,label:l("CORE_COMMON_WHATSAPP_NOTIFICATIONS"),styles:{display:"flex",alignItems:"center",textTransform:"capitalize"}}),o.createElement(t.LinkLabel,{style:{display:"inline",marginLeft:"0px",userSelect:"none",color:"inherit",cursor:"pointer",textDecoration:"underline"},onClick:()=>{h(!E),b(""),E?u({target:{value:""}}):c({target:{value:""}})}},B)))},Ke=e=>{let{config:n,onSelect:l,t:i,isDisabled:r}=e;return o.createElement(t.FormStep,{config:n,onSelect:l,t:i,isDisabled:r})};function et(e,t){const o=n.useRef();n.useEffect(()=>{o.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){o.current()},t);return()=>clearInterval(e)}},[t])}const tt=e=>{let{config:l,otp:i,onOtpChange:r,onResend:a,onSelect:c,t:u,error:d,userType:m="citizen",canSubmit:p}=e;const[v,g]=n.useState(30);et(()=>{g(v-1)},v>0?1e3:null);const f=()=>{a(),g(2)};return"employee"===m?o.createElement(n.Fragment,null,o.createElement(s.OTPInput,{length:6,onChange:r,value:i}),v>0?o.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button resend-otp",onClick:f},u("CS_RESEND_OTP")),!d&&o.createElement(t.CardLabelError,null,u("CS_INVALID_OTP"))):o.createElement(t.FormStep,{onSelect:c,config:l,t:u,isDisabled:!(6===(null==i?void 0:i.length)&&p)},o.createElement(s.OTPInput,{length:6,onChange:r,value:i}),v>0?o.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button",onClick:f},u("CS_RESEND_OTP")),!d&&o.createElement(t.CardLabelError,null,u("CS_INVALID_OTP")))};var nt,ot,lt;const it={type:"register"},rt={type:"login"};let at=`/${(null===(nt=window)||void 0===nt?void 0:nt.contextPath)||(null===(ot=window)||void 0===ot||null===(lt=ot.globalConfigs)||void 0===lt?void 0:lt.getConfig("CONTEXT_PATH"))}/citizen`;const st=(e,t,n)=>{var o,l;if(Digit.Utils.getMultiRootTenant())return;let i=null===(o=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===o||null===(l=o.value)||void 0===l?void 0:l.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",i),localStorage.setItem("Citizen.locale",i),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))},ct=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||at,ut=e=>{var i,r,s,c,u,d,m,p,v,g,f,E;let{stateCode:h,isUserRegistered:y=!0}=e;const{t:b}=l.useTranslation(),S=a.useLocation(),{path:C}=a.useRouteMatch(),N=a.useHistory(),[O,I]=n.useState(null),[w,_]=n.useState(null),[D,T]=n.useState(!0),[A,R]=n.useState(null),[L,x]=n.useState(y?{}:null==S||null===(i=S.state)||void 0===i?void 0:i.data),[P,M]=n.useState(null),k=Digit.Hooks.useQueryParams(),[U,B]=n.useState(!1),[F,j]=n.useState(!0),[H,z]=n.useState(!0),[G,V]=n.useState(!1),W=null===(r=window)||void 0===r||null===(s=r.globalConfigs)||void 0===s?void 0:s.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH"),Q=Digit.Utils.getMultiRootTenant(),X=null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u?void 0:u.getConfig("STATE_LEVEL_TENANT_ID"),q=Q?(null===(d=Digit)||void 0===d||null===(m=d.Utils)||void 0===m||null===(p=m.getConfigModuleName)||void 0===p?void 0:p.call(m))||"commonUiConfig":"common-masters";console.log(q,"moduleName");const{data:Z}=Digit.Hooks.useCustomMDMS(X,q,[{name:"UserValidation"}],{select:e=>{var t;const n=(null==e||null===(t=e[q])||void 0===t?void 0:t.UserValidation)||[],o=n.find(e=>!0===e.default)||n[0],l=e=>{var t,n,o,l,i,r;return{prefix:null==e||null===(t=e.attributes)||void 0===t?void 0:t.prefix,pattern:null==e||null===(n=e.rules)||void 0===n?void 0:n.pattern,maxLength:null==e||null===(o=e.rules)||void 0===o?void 0:o.maxLength,minLength:null==e||null===(l=e.rules)||void 0===l?void 0:l.minLength,errorMessage:null==e||null===(i=e.rules)||void 0===i?void 0:i.errorMessage,allowedStartingCharacters:null==e||null===(r=e.rules)||void 0===r?void 0:r.allowedStartingCharacters,fieldType:null==e?void 0:e.fieldType,isDefault:!0===(null==e?void 0:e.default)}};return{allConfigs:n.map(l),defaultConfig:l(o)}},staleTime:3e5,enabled:!!X}),Y=null==Z?void 0:Z.defaultConfig,$=(null==Z?void 0:Z.allConfigs)||[],J=Q&&(null===(v=Digit)||void 0===v||null===(g=v.Utils)||void 0===g||null===(f=g.getConfigModuleName)||void 0===f?void 0:f.call(g))||"commonUiConfig",{data:K}=Digit.Hooks.useCustomMDMS(X,J,[{name:"UserPreferencesConfig"}],{select:e=>{var t,n,o;return null==e||null===(t=e[J])||void 0===t||null===(n=t.UserPreferencesConfig)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.enableUserPreferences}},{schemaCode:J+".UserPreferencesConfig"});n.useEffect(()=>{let e;return w&&(P&&(clearTimeout(P),M(null)),e=setTimeout(()=>{_("")},5e3),M(e)),()=>{e&&clearTimeout(e)}},[w]),n.useEffect(()=>{var e;if(!O)return;Digit.SessionStorage.set("citizen.userRequestObject",O),Digit.UserService.setUser(O),st(null==O?void 0:O.info,null==O?void 0:O.access_token,h);const t=(null===(e=S.state)||void 0===e?void 0:e.from)||at;var n;Digit.ULBService.getCitizenCurrentTenant()?N.replace(t):N.replace(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen/select-location`,{redirectBackTo:t})},[O]);const ee=n.useMemo(()=>$e.map(e=>{const t={};for(const n in e.texts)t[n]=b(e.texts[n]);return{...e,texts:t}},[$e])),te=function(e,t){try{return Promise.resolve(K?Ge(function(){var n;return Promise.resolve(Digit.CustomService.getResponse({url:"/config-service/config/v1/_search",body:{criteria:{schemaCode:"NotificationChannel",tenantId:h}},headers:{"auth-token":null===(n=Digit.UserService.getUser())||void 0===n?void 0:n.access_token},useCache:!1,method:"POST",userService:!1})).then(function(n){var o,l,i,r;function a(){var n;return Promise.resolve(Digit.CustomService.getResponse({url:"/user-preference/v1/_upsert",body:{preference:{userId:null==e?void 0:e.uuid,tenantId:t,preferenceCode:"USER_NOTIFICATION_PREFERENCES",payload:{consent:{SMS:{scope:"GLOBAL",status:"REVOKED"},EMAIL:{scope:"GLOBAL",status:"REVOKED"},WHATSAPP:{scope:"GLOBAL",status:G?"GRANTED":"REVOKED"}},preferredLanguage:d}}},headers:{"auth-token":null===(n=Digit.UserService.getUser())||void 0===n?void 0:n.access_token},useCache:!1,method:"POST",userService:!1})).then(function(e){return sessionStorage.removeItem("Citizen.locale.changed"),e})}const s=null==n||null===(o=n.configData)||void 0===o?void 0:o.find(e=>"WHATSAPP"===e.uniqueIdentifier);if(!0!==(null==s||null===(l=s.data)||void 0===l?void 0:l.enabled))return null;const c=Digit.StoreData.getCurrentLanguage()||localStorage.getItem("locale")||localStorage.getItem("Citizen.locale")||(null===(i=JSON.parse(sessionStorage.getItem("Digit.initData")||"{}"))||void 0===i||null===(r=i.value)||void 0===r?void 0:r.selectedLanguage),u="true"===sessionStorage.getItem("Citizen.locale.changed");let d=c||"en_IN";const m=Ge(function(){var n;return Promise.resolve(Digit.CustomService.getResponse({url:"/user-preference/v1/_search",body:{criteria:{userId:null==e?void 0:e.uuid,tenantId:t,preferenceCode:"USER_NOTIFICATION_PREFERENCES"}},headers:{"auth-token":null===(n=Digit.UserService.getUser())||void 0===n?void 0:n.access_token},useCache:!1,method:"POST",userService:!0})).then(function(e){var t;if((null==e||null===(t=e.preferences)||void 0===t?void 0:t.length)>0){var n;const t=e.preferences[0];u&&c?d=c:null!=t&&null!==(n=t.payload)&&void 0!==n&&n.preferredLanguage&&(d=t.payload.preferredLanguage)}})},function(e){var t;console.error("Error fetching existing user preferences API details:",(null==e||null===(t=e.response)||void 0===t?void 0:t.data)||e)});return m&&m.then?m.then(a):a()})},function(e){return console.error("Error saving user preferences:",e),null}):null)}catch(e){return Promise.reject(e)}},ne=function(e){return Promise.resolve(Ge(function(){return Promise.resolve(Digit.UserService.sendOtp(e,h)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return o.createElement("div",{className:"citizen-form-wrapper"},o.createElement(a.Switch,null,o.createElement(t.AppContainer,null,S.pathname.includes("login")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement(a.Route,{path:""+C,exact:!0},o.createElement(Je,{onSelect:function(e){try{z(!1);const{whatsappConsent:t,...n}=e;void 0!==t&&V(t),x({...L,...n});const o={...n,tenantId:h,userType:"citizen"};return Promise.resolve(y?Promise.resolve(ne({otp:{...o,...rt}})).then(function(e){var t;let[n,l]=e;var i,r,a;if(!l)return z(!0),void N.replace(C+"/otp",{from:ct(S.state,k),role:null===(i=S.state)||void 0===i?void 0:i.role});z(!0),S.state&&"FSM_DSO"===S.state.role||N.push(`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/register/name`,{from:ct(S.state,k),data:o}),null!==(t=S.state)&&void 0!==t&&t.role&&(z(!0),_("FSM_DSO"===(null===(a=S.state)||void 0===a?void 0:a.role)?b("ES_ERROR_DSO_LOGIN"):"User not registered."))}):function(){if(!W)return Promise.resolve(ne({otp:{...o,...it}})).then(function(e){let[t,n]=e;if(!n)return z(!0),void N.replace(C+"/otp",{from:ct(S.state,k)});z(!0)});z(!0),N.replace(C+"/name",{from:ct(S.state,k),data:o})}())}catch(e){return Promise.reject(e)}},config:ee[0],mobileNumber:L.mobileNumber||"",emailId:L.userName||"",onMobileChange:e=>{const{value:t}=e.target;x({...L,mobileNumber:t})},onEmailChange:e=>{const{value:t}=e.target;x({...L,userName:t})},onConsentChange:e=>{V(e)},canSubmit:H,showRegisterLink:y&&!(null!==(E=S.state)&&void 0!==E&&E.role),t:b,validationConfig:Y,allValidationConfigs:$,enableUserPreferences:K})),o.createElement(a.Route,{path:C+"/otp"},o.createElement(tt,{config:{...ee[1],texts:{...ee[1].texts,cardText:`${ee[1].texts.cardText} ${L.mobileNumber||L.userName||""}`}},onOtpChange:e=>{x({...L,otp:e})},onResend:function(){try{const{mobileNumber:e,userName:t}=L,n={mobileNumber:e,userName:t,tenantId:h,userType:"citizen"},o=function(){if(!y&&W)_(b("PLEASE_COMPLETE_REGISTRATION")||"Please enter the OTP sent during registration.");else{const e=y?Promise.resolve(ne({otp:{...n,...rt}})).then(function(e){let[t,n]=e;n&&_(b("OTP_RESEND_ERROR")||"Failed to resend OTP")}):Promise.resolve(ne({otp:{...n,...it}})).then(function(e){let[t,n]=e;n&&_(b("OTP_RESEND_ERROR")||"Failed to resend OTP")});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(Ge(function(){T(!0),j(!1);const{mobileNumber:e,otp:t,name:n,userName:o}=L;return y||W?Promise.resolve(Digit.UserService.authenticate({username:e||o,password:t,tenantId:h,userType:"citizen"})).then(function(e){var t,n,o;let{UserRequest:l,...i}=e;if(null!==(t=S.state)&&void 0!==t&&t.role){const e=l.roles.find(e=>e.code===S.state.role);if(!e||!e.code)return _(b("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>N.replace(at),5e3)}return null!==(n=window)&&void 0!==n&&null!==(o=n.globalConfigs)&&void 0!==o&&o.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),Digit.UserService.setUser({info:l,...i}),st(l,null==i?void 0:i.access_token,h),Promise.resolve(new Promise(e=>setTimeout(e,300))).then(function(){return Promise.resolve(te(l,h)).then(function(){I({info:l,...i})})})}):Promise.resolve(Digit.UserService.registerUser({name:n,username:e||o,otpReference:t,tenantId:h},h)).then(function(e){var t,n;let{UserRequest:o,...l}=e;return null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),Digit.UserService.setUser({info:o,...l}),st(o,null==l?void 0:l.access_token,h),Promise.resolve(new Promise(e=>setTimeout(e,300))).then(function(){return Promise.resolve(te(o,h)).then(function(){I({info:o,...l})})})})},function(){j(!0),T(!1),_(b("INVALID_OTP")||"Invalid OTP")}))}catch(e){return Promise.reject(e)}},otp:L.otp,error:D,canSubmit:F,t:b})),o.createElement(a.Route,{path:C+"/name"},o.createElement(Ke,{config:ee[2],onSelect:function(e){try{B(!0);const t={...L,...e};return x(t),Promise.resolve(function(){if(!y&&W){const e=W+"/v1/_register",n={IndividualRegister:{tenantId:h,name:t.name,emailId:t.userName||"",mobileNumber:t.mobileNumber||"",requestType:"Register"}};return Ge(function(){return Promise.resolve(Digit.CustomService.getResponse({url:e,body:n,useCache:!1,method:"POST",userService:!1,auth:!1,params:{}})).then(function(e){if(!e)throw new Error("Registration API failed");B(!1),N.replace(C+"/otp",{from:ct(S.state,k)})})},function(e){console.error("Registration error:",e),B(!1),_(b("REGISTRATION_FAILED")||"Registration failed. Please try again.")})}{const t={...L,tenantId:h,userType:"citizen",...e};return Promise.resolve(ne({otp:{...t,...it}})).then(function(e){let[t,n]=e;t?(B(!1),N.replace(C+"/otp",{from:ct(S.state,k)})):B(!1)})}}())}catch(e){return Promise.reject(e)}},t:b,isDisabled:U})),w&&o.createElement(t.Toast,{type:"error",label:w,onClose:()=>_(null)}))))};var dt=e=>e instanceof HTMLElement;const mt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var pt=e=>null==e;const vt=e=>"object"==typeof e;var gt=e=>!pt(e)&&!Array.isArray(e)&&vt(e)&&!(e instanceof Date),ft=e=>/^\w*$/.test(e),Et=e=>e.filter(Boolean),ht=e=>Et(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function yt(e,t,n){let o=-1;const l=ft(t)?[t]:ht(t),i=l.length,r=i-1;for(;++o<i;){const t=l[o];let i=n;if(o!==r){const n=e[t];i=gt(n)||Array.isArray(n)?n:isNaN(+l[o+1])?{}:[]}e[t]=i,e=e[t]}return e}var bt=function(e,t){void 0===t&&(t={});for(const n in e)ft(n)?t[n]=e[n]:yt(t,n,e[n]);return t},St=e=>void 0===e,Ct=function(e,t,n){void 0===e&&(e={});const o=Et(t.split(/[,[\].]+?/)).reduce((e,t)=>pt(e)?e:e[t],e);return St(o)||o===e?St(e[t])?n:e[t]:o},Nt=(e,t)=>{dt(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const Ot={isValid:!1,value:null};var It=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,Ot):Ot,wt=e=>"radio"===e.type,_t=e=>"file"===e.type,Dt=e=>"checkbox"===e.type,Tt=e=>"select-multiple"===e.type;const At={value:!1,isValid:!1},Rt={value:!0,isValid:!0};var Lt=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.ref.checked).map(e=>{let{ref:{value:t}}=e;return t});return{value:t,isValid:!!t.length}}const{checked:t,value:n,attributes:o}=e[0].ref;return t?o&&!St(o.value)?St(n)||""===n?Rt:{value:n,isValid:!0}:Rt:At}return At};function xt(e,t,n,o,l){const i=e.current[t];if(i){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:a,valueAsDate:s,setValueAs:c}=i;if(t&&o)return;return _t(n)?n.files:wt(n)?It(i.options).value:Tt(n)?(r=n.options,[...r].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):Dt(n)?Lt(i.options).value:l?e:a?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var r;if(n)return Ct(n.current,t)}function Pt(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Pt(e.parentNode)}var Mt=e=>gt(e)&&!Object.keys(e).length,kt=e=>"boolean"==typeof e;function Ut(e,t){const n=ft(t)?[t]:ht(t),o=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=St(e)?o++:e[t[o++]];return e}(e,n);let l;o&&delete o[n[n.length-1]];for(let t=0;t<n.slice(0,-1).length;t++){let o,i=-1;const r=n.slice(0,-(t+1)),a=r.length-1;for(t>0&&(l=e);++i<r.length;){const t=r[i];o=o?o[t]:e[t],a===i&&(gt(o)&&Mt(o)||Array.isArray(o)&&!o.filter(e=>gt(e)&&!Mt(e)||kt(e)).length)&&(l?delete l[t]:delete e[t]),l=o}}return e}const Bt=(e,t)=>e&&e.ref===t;var Ft=e=>pt(e)||!vt(e);function jt(e,t){if(Ft(e)||Ft(t))return t;for(const n in t){const o=e[n],l=t[n];try{e[n]=gt(o)&&gt(l)||Array.isArray(o)&&Array.isArray(l)?jt(o,l):l}catch(e){}}return e}function Ht(e,t,o){if(Ft(e)||Ft(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){const n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(const l of n){const n=e[l];if(!o||"ref"!==l){const e=t[l];if((gt(n)||Array.isArray(n))&&(gt(e)||Array.isArray(e))?!Ht(n,e,o):n!==e)return!1}}}return!0}function zt(e,t,n,o,l){let i=-1;for(;++i<e.length;){for(const o in e[i])Array.isArray(e[i][o])?(!n[i]&&(n[i]={}),n[i][o]=[],zt(e[i][o],Ct(t[i]||{},o,[]),n[i][o],n[i],o)):Ht(Ct(t[i]||{},o),e[i][o])?yt(n[i]||{},o):n[i]=Object.assign(Object.assign({},n[i]),{[o]:!0});o&&!n.length&&delete o[l]}return n}var Gt=e=>"string"==typeof e,Vt=(e,t,n,o,l)=>{const i={};for(const t in e.current)(St(l)||(Gt(l)?t.startsWith(l):Array.isArray(l)&&l.find(e=>t.startsWith(e))))&&(i[t]=xt(e,t,void 0,o));return n?bt(i):jt(t,bt(i))},Wt=e=>e instanceof RegExp,Qt=e=>gt(e)&&!Wt(e)?e:{value:e,message:""},Xt=e=>"function"==typeof e,qt=e=>Gt(e)||n.isValidElement(e);function Zt(e,t,n){if(void 0===n&&(n="validate"),qt(e)||kt(e)&&!e)return{type:n,message:qt(e)?e:"",ref:t}}var Yt=(e,t,n,o,l)=>t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),{[o]:l||!0})}):{},$t=function(e,t,n,o){let{ref:l,ref:{value:i},options:r,required:a,maxLength:s,minLength:c,min:u,max:d,pattern:m,validate:p}=n;try{let n=!1;const v=l.name,g={},f=wt(l),E=Dt(l),h=f||E,y=""===i,b=Yt.bind(null,v,t,g),S=function(e,t,n,o,i){void 0===o&&(o="maxLength"),void 0===i&&(i="minLength");const r=e?t:n;g[v]=Object.assign({type:e?o:i,message:r,ref:l},b(e?o:i,r))};if(a&&(!f&&!E&&(y||pt(i))||kt(i)&&!i||E&&!Lt(r).isValid||f&&!It(r).isValid)){const{value:n,message:o}=qt(a)?{value:!!a,message:a}:Qt(a);if(n&&(g[v]=Object.assign({type:"required",message:o,ref:h?((e.current[v].options||[])[0]||{}).ref:l},b("required",o)),!t))return Promise.resolve(g)}if(!(pt(u)&&pt(d)||""===i)){let e,n;const o=Qt(d),r=Qt(u);if(isNaN(i)){const t=l.valueAsDate||new Date(i);Gt(o.value)&&(e=t>new Date(o.value)),Gt(r.value)&&(n=t<new Date(r.value))}else{const t=l.valueAsNumber||parseFloat(i);pt(o.value)||(e=t>o.value),pt(r.value)||(n=t<r.value)}if((e||n)&&(S(!!e,o.message,r.message,"max","min"),!t))return Promise.resolve(g)}if(Gt(i)&&!y&&(s||c)){const e=Qt(s),n=Qt(c),o=!pt(e.value)&&i.length>e.value,l=!pt(n.value)&&i.length<n.value;if((o||l)&&(S(o,e.message,n.message),!t))return Promise.resolve(g)}if(Gt(i)&&m&&!y){const{value:e,message:n}=Qt(m);if(Wt(e)&&!e.test(i)&&(g[v]=Object.assign({type:"pattern",message:n,ref:l},b("pattern",n)),!t))return Promise.resolve(g)}const C=function(){if(p){const i=xt(e,v,o,!1,!0),a=h&&r?r[0].ref:l;return Xt(p)?Promise.resolve(p(i)).then(function(e){const o=Zt(e,a);if(o&&(g[v]=Object.assign(Object.assign({},o),b("validate",o.message)),!t))return n=!0,g}):function(){if(gt(p)){let o=!1;function e(){if(!Mt(l)&&(g[v]=Object.assign({ref:a},l),!t))return n=!0,g}let l={};const r=ze(Object.entries(p),function(e){let[n,r]=e;if(Mt(l)||t)return Promise.resolve(r(i)).then(function(e){const o=Zt(e,a,n);o&&(l=Object.assign(Object.assign({},o),b(n,o.message)),t&&(g[v]=l))});o=!0},function(){return o});return r&&r.then?r.then(e):e()}}()}}();return Promise.resolve(C&&C.then?C.then(function(e){return n?e:g}):n?C:g)}catch(e){return Promise.reject(e)}};const Jt=function(e,t,n){void 0===n&&(n=[]);for(const o in t){const l=e+(gt(t)?"."+o:`[${o}]`);Ft(t[o])?n.push(l):Jt(l,t[o],n)}return n};var Kt=(e,t,n,o,l)=>{let i=void 0;return n.add(t),Mt(e)||(i=Ct(e,t),(gt(i)||Array.isArray(i))&&Jt(t,i).forEach(e=>n.add(e))),St(i)?l?o:Ct(o,t):i},en=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:o,isTouched:l,isReValidateOnBlur:i,isReValidateOnChange:r,isBlurEvent:a,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&o?!(l||a):(s?i:t)?!a:!(s?r:n)||a)},tn=e=>e.substring(0,e.indexOf("[")),nn=(e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),on="undefined"!=typeof window&&"undefined"!=typeof document;function ln(e){var t;let n;if(Ft(e)||on&&(e instanceof File||dt(e)))return e;if(!["Set","Map","Object","Date","Array"].includes(null===(t=e.constructor)||void 0===t?void 0:t.name))return e;if(e instanceof Date)return n=new Date(e.getTime()),n;if(e instanceof Set){n=new Set;for(const t of e)n.add(t);return n}if(e instanceof Map){n=new Map;for(const t of e.keys())n.set(t,ln(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=ln(e[t]);return n}var rn=e=>({isOnSubmit:!e||e===mt.onSubmit,isOnBlur:e===mt.onBlur,isOnChange:e===mt.onChange,isOnAll:e===mt.all,isOnTouch:e===mt.onTouched}),an=e=>wt(e)||Dt(e);const sn="undefined"==typeof window,cn=on?"Proxy"in window:"undefined"!=typeof Proxy,un=n.createContext(null);un.displayName="RHFContext";const dn=e=>{const{as:t,render:o}=e,l=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:i,meta:r}=function(e){let{name:t,rules:o,defaultValue:l,control:i,onFocus:r}=e;const a=n.useContext(un);if("production"!==process.env.NODE_ENV&&!i&&!a)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:u,unregister:d,trigger:m,mode:p,reValidateMode:{isReValidateOnBlur:v,isReValidateOnChange:g},formState:f,formStateRef:{current:{isSubmitted:E,touched:h,errors:y}},updateFormState:b,readFormStateRef:S,fieldsRef:C,fieldArrayNamesRef:N,shallowFieldsStateRef:O}=i||a.control,I=!nn(N.current,t),w=()=>!St(Ct(O.current,t))&&I?Ct(O.current,t):St(l)?Ct(s.current,t):l,[_,D]=n.useState(w()),T=n.useRef(_),A=n.useRef({focus:()=>null}),R=n.useRef(r||(()=>{Xt(A.current.focus)&&A.current.focus(),"production"!==process.env.NODE_ENV&&(Xt(A.current.focus)||console.warn("📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method"))})),L=n.useCallback(e=>!en(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:g,isSubmitted:E,isTouched:!!Ct(h,t)},p)),[v,g,E,h,t,p]),x=n.useCallback(e=>{let[t]=e;const n=(e=>Ft(e)||!gt(e.target)||gt(e.target)&&!e.type?e:St(e.target.value)?e.target.checked:e.target.value)(t);return D(n),T.current=n,n},[]),P=n.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!t)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");C.current[t]?C.current[t]=Object.assign({ref:C.current[t].ref},o):(u(Object.defineProperties({name:t,focus:R.current},{value:{set(e){D(e),T.current=e},get:()=>T.current}}),o),e=St(Ct(s.current,t))),e&&I&&D(w())},[o,t,u]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(St(_)&&console.warn(`📋 ${t} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`),!I&&St(l)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),P()},[P]),n.useEffect(()=>{!C.current[t]&&P(!0)});const M=n.useCallback(()=>{S.current.touched&&!Ct(h,t)&&(yt(h,t,!0),b({touched:h})),L(!0)&&m(t)},[t,b,L,m,S]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return c(t,x(n),{shouldValidate:L(),shouldDirty:!0})},[c,t,L]),onBlur:M,name:t,value:_,ref:A},meta:Object.defineProperties({invalid:!!Ct(y,t)},{isDirty:{get:()=>!!Ct(f.dirtyFields,t)},isTouched:{get:()=>!!Ct(f.touched,t)}})}}(e),a=Object.assign(Object.assign({},l),i);return t?n.isValidElement(t)?n.cloneElement(t,a):n.createElement(t,a):o?o(i,r):null},mn=e=>{let{control:n,t:l}=e;const i=window.Digit.Utils.browser.isMobile();return o.createElement(Fragment,null,o.createElement(t.SearchField,{className:"pt-form-field"},o.createElement("label",null,l("AUDIT_FROM_DATE_LABEL")),o.createElement(dn,{render:e=>o.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})),o.createElement(t.SearchField,{className:"pt-form-field"},o.createElement("label",null,l("AUDIT_TO_DATE_LABEL")),o.createElement(dn,{render:e=>o.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})),o.createElement(t.SearchField,{className:"pt-search-action-submit"},o.createElement(t.Button,{style:{marginTop:i?"510px":"25px",marginLeft:i?"0":"-30px",maxWidth:i?"100%":"240px"},label:l("ES_COMMON_APPLY"),submit:!0})))},pn=e=>{var l;let{Controller:i,register:r,control:a,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:p,data:v,onSubmit:g,isLoading:f}=e;const[E,h]=n.useState([]),y=e=>o.createElement("div",{onClick:e.onClick},o.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==v?void 0:v.length)>0&&h([null==v?void 0:v.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=b(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[v]);const b=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,o=t.getDate();return n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${o}/${n}/${t.getFullYear()}`},S=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),o=t.getMinutes(),l=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${n}:${o} ${l}`},[C,N]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),O=()=>{N({type:"remove"})},I=()=>o.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:O},o.createElement(t.CloseSvg,null)),w={Controller:i,register:r,control:a,t:s,reset:c,previousPage:u},_=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:i,...r}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:i,...r}=e;const{closeMobilePopupModal:a}=r;switch(n){case"SearchFormComponent":return o.createElement(t.SearchForm,r,o.createElement(I,null),o.createElement("div",{className:"MobilePopupHeadingWrapper"},o.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),o.createElement(mn,m({},l,{closeMobilePopupModal:a,tenantId:i,t:s})));default:return o.createElement("span",null)}})({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:i,...r})},[C]);null==v||null===(l=v.roles)||void 0===l||l.forEach(e=>{});const D=n.useMemo(()=>null!=v&&v.display||""===v?[]:null==v?void 0:v.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:b(e.timestamp),[s("AUDIT_TIME_LABEL")]:S(e.timestamp),[s("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[s("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[s("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[v]);return o.createElement(o.Fragment,null,o.createElement(t.BackButton,null),o.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},o.createElement(y,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(E)})),o.createElement(t.HeaderComponent,null,s("PRIVACY_AUDIT_REPORT"),":"),o.createElement("div",{className:"digit-search-box"},o.createElement(t.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>N({type:"set",payload:"SearchFormComponent"}),tenantId:p,t:s})),C?o.createElement(t.PopUp,null,o.createElement(_,{onSubmit:e=>{N({type:"remove"}),g(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:w,currentlyActiveMobileModal:C,closeMobilePopupModal:O,tenantId:p})):null,f&&o.createElement(t.Loader,null),o.createElement(t.DetailsCard,{data:D}))},vn=e=>{let{tenantId:l,t:i,onSubmit:r,data:a,count:c}=e;const u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:m,handleSubmit:p,setValue:v,getValues:g,reset:f}=function(e){let{mode:t=mt.onSubmit,reValidateMode:o=mt.onChange,resolver:l,context:i,defaultValues:r={},shouldFocusError:a=!0,shouldUnregister:s=!0,criteriaMode:c}=void 0===e?{}:e;const u=n.useRef({}),d=n.useRef({}),m=n.useRef({}),p=n.useRef(new Set),v=n.useRef({}),g=n.useRef({}),f=n.useRef({}),E=n.useRef({}),h=n.useRef(r),y=n.useRef(!1),b=n.useRef(!1),S=n.useRef(),C=n.useRef({}),N=n.useRef({}),O=n.useRef(i),I=n.useRef(l),w=n.useRef(new Set),_=n.useRef(rn(t)),{isOnSubmit:D,isOnTouch:T}=_.current,A=c===mt.all,[R,L]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!D,errors:{}}),x=n.useRef({isDirty:!cn,dirtyFields:!cn,touched:!cn||T,isValidating:!cn,isSubmitting:!cn,isValid:!cn}),P=n.useRef(R),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(rn(o)).current;O.current=i,I.current=l,P.current=R,C.current=s?{}:Mt(C.current)?ln(r):C.current;const B=n.useCallback(function(e){void 0===e&&(e={}),y.current||(P.current=Object.assign(Object.assign({},P.current),e),L(P.current))},[]),F=()=>x.current.isValidating&&B({isValidating:!0}),j=n.useCallback(function(e,t,n,o,l){void 0===n&&(n=!1),void 0===o&&(o={});let i=n||(e=>{let{errors:t,name:n,error:o,validFields:l,fieldsWithValidation:i}=e;const r=St(o),a=Ct(t,n);return r&&!!a||!r&&!Ht(a,o,!0)||r&&Ct(i,n)&&!Ct(l,n)})({errors:P.current.errors,error:t,name:e,validFields:E.current,fieldsWithValidation:f.current});const r=Ct(P.current.errors,e);t?(Ut(E.current,e),i=i||!r||!Ht(r,t,!0),yt(P.current.errors,e,t)):((Ct(f.current,e)||I.current)&&(yt(E.current,e,!0),i=i||r),Ut(P.current.errors,e)),(i&&!pt(n)||!Mt(o)||x.current.isValidating)&&B(Object.assign(Object.assign(Object.assign({},o),I.current?{isValid:!!l}:{}),{isValidating:!1}))},[]),H=n.useCallback((e,t)=>{const{ref:n,options:o}=u.current[e],l=on&&dt(n)&&pt(t)?"":t;wt(n)?(o||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===l}):_t(n)&&!Gt(l)?n.files=l:Tt(n)?[...n.options].forEach(e=>e.selected=l.includes(e.value)):Dt(n)&&o?o.length>1?o.forEach(e=>{let{ref:t}=e;return t.checked=Array.isArray(l)?!!l.find(e=>e===t.value):l===t.value}):o[0].ref.checked=!!l:n.value=l},[]),z=n.useCallback((e,t)=>{if(x.current.isDirty){const n=J();return e&&t&&yt(n,e,t),!Ht(n,h.current)}return!1},[]),G=n.useCallback(function(e,t){if(void 0===t&&(t=!0),x.current.isDirty||x.current.dirtyFields){const n=!Ht(Ct(h.current,e),xt(u,e,C)),o=Ct(P.current.dirtyFields,e),l=P.current.isDirty;n?yt(P.current.dirtyFields,e,!0):Ut(P.current.dirtyFields,e);const i={isDirty:z(),dirtyFields:P.current.dirtyFields},r=x.current.isDirty&&l!==i.isDirty||x.current.dirtyFields&&o!==Ct(P.current.dirtyFields,e);return r&&t&&B(i),r?i:{}}return{}},[]),V=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||u.current[e]?Promise.resolve($t(u,A,u.current[e],C)).then(function(n){const o=n[e];return j(e,o,t),St(o)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[j,A]),W=n.useCallback(function(e){try{return Promise.resolve(I.current(J(),O.current,A)).then(function(t){let{errors:n}=t;const o=P.current.isValid;if(Array.isArray(e)){const t=e.map(e=>{const t=Ct(n,e);return t?yt(P.current.errors,e,t):Ut(P.current.errors,e),!t}).every(Boolean);return B({isValid:Mt(n),isValidating:!1}),t}{const t=Ct(n,e);return j(e,t,o!==Mt(n),{},Mt(n)),!t}})}catch(e){return Promise.reject(e)}},[j,A]),Q=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve(V(o))}const o=e||Object.keys(u.current);if(F(),I.current)return Promise.resolve(W(o));const l=function(){if(Array.isArray(o))return!e&&(P.current.errors={}),Promise.resolve(Promise.all(o.map(function(e){try{return Promise.resolve(V(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){B({isValidating:!1});const t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(l&&l.then?l.then(t):t(l))}catch(e){return Promise.reject(e)}},[W,V]),X=n.useCallback((e,t,n)=>{let{shouldDirty:o,shouldValidate:l}=n;const i={};yt(i,e,t);for(const n of Jt(e,t))u.current[n]&&(H(n,Ct(i,n)),o&&G(n),l&&Q(n))},[Q,H,G]),q=n.useCallback((e,t,n)=>{if(!s&&!Ft(t)&&yt(C.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),u.current[e])H(e,t),n.shouldDirty&&G(e),n.shouldValidate&&Q(e);else if(!Ft(t)&&(X(e,t,n),w.current.has(e))){const o=tn(e)||e;yt(d.current,e,t),N.current[o]({[o]:Ct(d.current,o)}),(x.current.isDirty||x.current.dirtyFields)&&n.shouldDirty&&(yt(P.current.dirtyFields,e,((e,t,n)=>jt(zt(e,t,n.slice(0,e.length)),zt(t,e,n.slice(0,e.length))))(t,Ct(h.current,e,[]),Ct(P.current.dirtyFields,e,[]))),B({isDirty:!Ht(Object.assign(Object.assign({},J()),{[e]:t}),h.current)}))}!s&&yt(C.current,e,t)},[G,H,X]),Z=e=>b.current||p.current.has(e)||p.current.has((e.match(/\w+/)||[])[0]),Y=e=>{let t=!0;if(!Mt(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(tn(e))||(g.current[n](),t=!1);return t};function $(e){if(!s){let t=ln(e);for(const e of w.current)ft(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function J(e){if(Gt(e))return xt(u,e,C);if(Array.isArray(e)){const t={};for(const n of e)yt(t,n,xt(u,n,C));return t}return $(Vt(u,ln(C.current),s))}S.current=S.current?S.current:function(e){let{type:t,target:n}=e;try{let e=n.name;const o=u.current[e];let l,i;return Promise.resolve(function(){if(o){function r(){!a&&Y(e),j(e,l,m,d,i)}const a="blur"===t,c=en(Object.assign({isBlurEvent:a,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!Ct(P.current.touched,e),isSubmitted:P.current.isSubmitted},_.current));let d=G(e,!1),m=!Mt(d)||!a&&Z(e);if(a&&!Ct(P.current.touched,e)&&x.current.touched&&(yt(P.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:P.current.touched})),!s&&Dt(n)&&yt(C.current,e,xt(u,e)),c)return!a&&Y(e),(!Mt(d)||m&&Mt(d))&&B(d);F();const p=I.current?Promise.resolve(I.current(J(),O.current,A)).then(function(t){let{errors:o}=t;const r=P.current.isValid;if(l=Ct(o,e),Dt(n)&&!l&&I.current){const t=tn(e),n=Ct(o,t,{});n.type&&n.message&&(l=n),t&&(n||Ct(P.current.errors,t))&&(e=t)}i=Mt(o),r!==i&&(m=!0)}):Promise.resolve($t(u,A,o,C)).then(function(t){l=t[e]});return p&&p.then?p.then(r):r()}}())}catch(e){return Promise.reject(e)}};const K=n.useCallback(function(e){void 0===e&&(e={});try{const t=Mt(u.current)?h.current:{};return Promise.resolve(I.current(Object.assign(Object.assign(Object.assign({},t),J()),e),O.current,A)).then(function(e){let{errors:t}=e;const n=Mt(t);P.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[A]),ee=n.useCallback((e,t)=>{!function(e,t,n,o,l,i){const{ref:r,ref:{name:a}}=n,s=e.current[a];if(!l){const t=xt(e,a,o);!St(t)&&yt(o.current,a,t)}r.type&&s?wt(r)||Dt(r)?Array.isArray(s.options)&&s.options.length?(Et(s.options).forEach(function(e,n){void 0===e&&(e={}),(Pt(e.ref)&&Bt(e,e.ref)||i)&&(Nt(e.ref,t),Ut(s.options,`[${n}]`))}),s.options&&!Et(s.options).length&&delete e.current[a]):delete e.current[a]:(Pt(r)&&Bt(s,r)||i)&&(Nt(r,t),delete e.current[a]):delete e.current[a]}(u,S.current,e,C,s,t),s&&(Ut(E.current,e.ref.name),Ut(f.current,e.ref.name))},[s]),te=n.useCallback(e=>{if(b.current)B();else{for(const t of p.current)if(t.startsWith(e)){B();break}Y(e)}},[]),ne=n.useCallback((e,t)=>{e&&(ee(e,t),s&&!Et(e.options||[]).length&&(Ut(P.current.errors,e.ref.name),yt(P.current.dirtyFields,e.ref.name,!0),B({isDirty:z()}),x.current.isValid&&I.current&&K(),te(e.ref.name)))},[K,ee]),oe=n.useCallback((e,t,n)=>{const o=n?v.current[n]:p.current;let l=Vt(u,ln(C.current),s,!1,e);if(Gt(e)){const n=tn(e)||e;return w.current.has(n)&&(l=Object.assign(Object.assign({},m.current),l)),Kt(l,e,o,St(Ct(h.current,e))?t:Ct(h.current,e),!0)}const i=St(t)?h.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:Kt(l,t,o,i)}),{}):(b.current=St(n),bt(!Mt(l)&&l||i))},[]);function le(e,t){if(void 0===t&&(t={}),"production"!==process.env.NODE_ENV){if(!e.name)return console.warn("📋 Field is missing `name` attribute",e,"https://react-hook-form.com/api#useForm");if(w.current.has(e.name.split(/\[\d+\]$/)[0])&&!RegExp(`^${e.name.split(/\[\d+\]$/)[0]}[\\d+].\\w+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',e,"https://react-hook-form.com/api#useFieldArray")}const{name:n,type:o,value:l}=e,i=Object.assign({ref:e},t),r=u.current,a=an(e),c=nn(w.current,n),d=t=>on&&(!dt(e)||t===e);let m,p=r[n],v=!0;if(p&&(a?Array.isArray(p.options)&&Et(p.options).find(e=>l===e.ref.value&&d(e.ref)):d(p.ref)))return void(r[n]=Object.assign(Object.assign({},p),t));p=o?a?Object.assign({options:[...Et(p&&p.options||[]),{ref:e}],ref:{type:o,name:n}},t):Object.assign({},i):i,r[n]=p;const g=St(Ct(C.current,n));Mt(h.current)&&g||(m=Ct(g?h.current:C.current,n),v=St(m),v||c||H(n,m)),Mt(t)||(yt(f.current,n,!0),!D&&x.current.isValid&&$t(u,A,p,C).then(e=>{const t=P.current.isValid;Mt(e)?yt(E.current,n,!0):Ut(E.current,n),t!==Mt(e)&&B()})),!s||c&&v||!c&&Ut(P.current.dirtyFields,n),o&&function(e,t,n){let{ref:o}=e;dt(o)&&n&&(o.addEventListener(t?"change":"input",n),o.addEventListener("blur",n))}(a&&p.options?p.options[p.options.length-1]:p,a||"select-one"===e.type,S.current)}const ie=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let o={},l=$(Vt(u,ln(C.current),s,!0));return x.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(i,r){try{var s=function(){function i(){const i=function(){if(Mt(o)&&Object.keys(P.current.errors).every(e=>e in u.current))return B({errors:{},isSubmitting:!0}),Promise.resolve(e(l,n)).then(function(){});{function i(e){a&&((e,t)=>{for(const n in e)if(Ct(t,n)){const t=e[n];if(t){if(t.ref.focus&&St(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(u.current,P.current.errors)}return P.current.errors=Object.assign(Object.assign({},P.current.errors),o),t?Promise.resolve(t(P.current.errors,n)).then(i):i()}}();if(i&&i.then)return i.then(function(){})}const r=I.current?Promise.resolve(I.current(l,O.current,A)).then(function(e){let{errors:t,values:n}=e;P.current.errors=o=t,l=n}):ze(Object.values(u.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve($t(u,A,e,C)).then(function(e){e[t]?(yt(o,t,e[t]),Ut(E.current,t)):Ct(f.current,t)&&(Ut(P.current.errors,t),yt(E.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return r&&r.then?r.then(i):i()}()}catch(e){return r(!0,e)}return s&&s.then?s.then(r.bind(null,!1),r.bind(null,!0)):r(!1,s)}(0,function(e,t){if(P.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Mt(P.current.errors),submitCount:P.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[a,A]);n.useEffect(()=>{l&&x.current.isValid&&K(),M.current=M.current||!on?M.current:function(e,t){const n=new MutationObserver(()=>{for(const n of Object.values(e.current))if(n&&n.options)for(const e of n.options)e&&e.ref&&Pt(e.ref)&&t(n);else n&&Pt(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(u,ne)},[ne,h.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),y.current=!0,"production"===process.env.NODE_ENV&&Object.values(u.current).forEach(e=>ne(e,!0))},[]),!l&&x.current.isValid&&(R.isValid=Ht(E.current,f.current)&&Mt(P.current.errors));const re={trigger:Q,setValue:n.useCallback(function(e,t,n){q(e,t,n||{}),Z(e)&&B(),Y(e)},[q,Q]),getValues:n.useCallback(J,[]),register:n.useCallback(function(e,t){if(!sn)if(Gt(e))le({name:e},t);else{if(!gt(e)||!("name"in e))return t=>t&&le(t,e);le(e,t)}},[h.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])ne(u.current[t],!0)},[]),formState:cn?new Proxy(R,{get:(e,t)=>{if("production"!==process.env.NODE_ENV&&"isValid"===t&&D&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return x.current[t]=!0,e[t]}}):R},ae=n.useMemo(()=>Object.assign({isFormDirty:z,updateWatchedValue:te,shouldUnregister:s,updateFormState:B,removeFieldEventListener:ee,watchInternal:oe,mode:_.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:l?K:void 0,fieldsRef:u,resetFieldArrayFunctionRef:N,useWatchFieldsRef:v,useWatchRenderFunctionsRef:g,fieldArrayDefaultValuesRef:d,validFieldsRef:E,fieldsWithValidationRef:f,fieldArrayNamesRef:w,readFormStateRef:x,formStateRef:P,defaultValuesRef:h,shallowFieldsStateRef:C,fieldArrayValuesRef:m},re),[h.current,te,s,ee,oe]);return Object.assign({watch:function(e,t){return oe(e,t)},control:ae,handleSubmit:ie,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),on)for(const e of Object.values(u.current))if(e){const{ref:t,options:n}=e,o=an(t)&&Array.isArray(n)?n[0].ref:t;if(dt(o))try{o.closest("form").reset();break}catch(e){}}u.current={},h.current=Object.assign({},e||h.current),e&&Y(""),Object.values(N.current).forEach(e=>Xt(e)&&e()),C.current=s?{}:ln(e||h.current),(e=>{let{errors:t,isDirty:n,isSubmitted:o,touched:l,isValid:i,submitCount:r,dirtyFields:a}=e;i||(E.current={},f.current={}),d.current={},p.current=new Set,b.current=!1,B({submitCount:r?P.current.submitCount:0,isDirty:!!n&&P.current.isDirty,isSubmitted:!!o&&P.current.isSubmitted,isValid:!!i&&P.current.isValid,dirtyFields:a?P.current.dirtyFields:{},touched:l?P.current.touched:{},errors:t?P.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>u.current[e]&&ft(e)?delete P.current.errors[e]:Ut(P.current.errors,e)),B({errors:e?P.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(u.current[e]||{}).ref;yt(P.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:R.errors},re)}({defaultValues:u}),E=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,o=t.getDate();return n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${o}/${n}/${t.getFullYear()}`},h=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),o=t.getMinutes(),l=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${n}:${o} ${l}`},[y,b]=n.useState([]),S=e=>o.createElement("div",{onClick:e.onClick},o.createElement(s.DownloadBtnCommon,null));n.useEffect(()=>{d("offset",0),d("limit",5),d("sortOrder","DESC")},[d]),n.useEffect(()=>{(null==a?void 0:a.length)>0&&b([null==a?void 0:a.map(e=>{let t={};return t[i("AUDIT_DATE_LABEL")]=E(null==e?void 0:e.timestamp),t[i("AUDIT_TIME_LABEL")]=h(null==e?void 0:e.timestamp),t[i("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[i("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[i("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[a]);const C=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function N(){v("offset",g("offset")-g("limit")),p(r)()}const O=window.Digit.Utils.browser.isMobile();if(O)return o.createElement(pn,{Controller:dn,register:d,control:m,t:i,reset:f,previousPage:N,handleSubmit:p,tenantId:l,data:a,onSubmit:r});const I=e=>o.createElement("span",{className:"cell-text"},e),w=n.useMemo(()=>[{Header:i("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?i("WS_NA"):E(e.timestamp);return I(""+t)}},{Header:i("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?i("WS_NA"):h(e.timestamp);return I(""+t)}},{Header:i(O?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataView))},{Header:i(O?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataViewedBy))},{Header:i("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return I(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return o.createElement(o.Fragment,null,o.createElement("div",{style:{marginRight:"-70px"}}," ",o.createElement(t.BackButton,null)," "),o.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",o.createElement(t.HeaderComponent,null,i("PRIVACY_AUDIT_REPORT"))," "),o.createElement(t.SearchForm,{className:"audit-card",onSubmit:r,handleSubmit:p},o.createElement(mn,{register:d,control:m,reset:f,tenantId:l,t:i,previousPage:N})),o.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=a&&a.display?o.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},i(a.display).split("\\n").map((e,t)=>o.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==a?o.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},o.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},o.createElement(S,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(y)})),o.createElement(s.Table,{t:i,data:a,totalRecords:c,columns:w,getCellProps:e=>({style:{minWidth:e.column.Header===i("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){v("limit",Number(e.target.value)),p(r)()},currentPage:g("offset")/g("limit"),onNextPage:function(){v("offset",g("offset")+g("limit")),p(r)()},onPrevPage:N,manualPagination:!1,pageSizeLimit:g("limit"),onSort:C,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})):o.createElement(t.Loader,null)))},gn=e=>{var t,i;const{t:r}=l.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(),[s,c]=n.useState({}),u=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),o=new Date(Date.UTC(n[1],n[2]-1,n[3]));return o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),"dayend"===t&&(o.setHours(o.getHours()+24),o.setSeconds(o.getSeconds()-1)),o.getTime()}catch(t){return e}};n.useEffect(()=>{const e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){const t={...e};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(s&&Object.keys(s).length>0)},m={...s},{isLoading:p,data:v}=Digit.Hooks.useAudit({tenantId:a,filters:{...m},config:d});return o.createElement(vn,{t:r,tenantId:a,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t={...e,fromDate:u(null==e?void 0:e.fromDate),toDate:u(null==e?void 0:e.toDate)};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:t[n]}),{}))},data:p?"":(null==v||null===(t=v.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==v?void 0:v.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==v||null===(i=v.ElasticSearchData)||void 0===i?void 0:i.length})},fn=e=>{var n,i,r,a,s,c,u,d,m,p,v,g,f,E,h,y;let{moduleCode:b}=e;const{t:S}=l.useTranslation(),C=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:N,data:O}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:I,error:w,data:_}=Digit.Hooks.useDynamicData({moduleCode:b,tenantId:C,filters:{},t:S}),D=e=>{let{module:n,styles:l}=e;switch(n){case"TL":return o.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:l});case"PT":return o.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:l});case"MCOLLECT":return o.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:l});case"PGR":return o.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:l});default:return o.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:l})}},T=null==O||null===(n=O.MdmsRes["common-masters"])||void 0===n||null===(i=n.StaticData[0])||void 0===i?void 0:i[""+b],A=e=>{let{module:n}=e;switch(n){case"PT":case"WS":return o.createElement("span",{className:"timerIcon"},o.createElement(t.TimerIcon,null));default:return null}},R=e=>{let{module:n}=e;switch(n){case"PT":return o.createElement("span",{className:"rupeeSymbol"},o.createElement(t.RupeeSymbol,null));case"WS":return o.createElement("span",{className:"timerIcon"},o.createElement(t.TimerIcon,null));default:return null}},L=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:S("COMMON_VALIDITY"),validity:(null==T?void 0:T.validity)+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:S("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:S("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==T?void 0:T.validity)+" "+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},x=e=>{switch(e){case"PT":return{staticDataOne:(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS"),staticDataOneHeader:S("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==T?void 0:T.staticDataTwo,staticDataTwoHeader:S("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:S("PAY_WATER_CHARGES_BY")+" "+(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS")+" "+S("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==T?void 0:T.staticDataTwo)+" "+S("COMMON_DAYS"),staticDataTwoHeader:S("APPLICATION_PROCESSING_TIME")};default:return{}}};return N||I?o.createElement(t.Loader,null):T?o.createElement(o.Fragment,null,T&&null!=T&&T.payViaWhatsApp?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"pay-whatsapp-card",onClick:()=>{window.open(null==T?void 0:T.payViaWhatsApp)}},o.createElement("div",{className:"pay-whatsapp-text"},S("PAY_VIA_WHATSAPP")),o.createElement("div",{className:"whatsAppIconG"},o.createElement(t.WhatsappIconGreen,null)))):null,T&&null!=T&&T.helpline?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"static-home-Card"},o.createElement("div",{className:"static-home-Card-header"},S("CALL_CENTER_HELPLINE")),o.createElement("div",{className:"helplineIcon"},o.createElement(t.HelpLineIcon,null))),o.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(r=T.helpline)&&void 0!==r&&r.contactOne?o.createElement("div",{className:"call-center-card-content"},o.createElement("a",{href:"tel:"+(null==T||null===(a=T.helpline)||void 0===a?void 0:a.contactOne)},null==T||null===(s=T.helpline)||void 0===s?void 0:s.contactOne)):null,null!=T&&null!==(c=T.helpline)&&void 0!==c&&c.contactTwo?o.createElement("div",{className:"call-center-card-content"},o.createElement("a",{href:"tel:"+(null==T||null===(u=T.helpline)||void 0===u?void 0:u.contactTwo)},null==T||null===(d=T.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,T&&null!=T&&T.serviceCenter?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"static-home-Card"},o.createElement("div",{className:"static-home-Card-header"},S("CITIZEN_SERVICE_CENTER")),o.createElement("div",{className:"serviceCentrIcon"},o.createElement(t.ServiceCenterIcon,null))),o.createElement("div",{className:"service-center-details-card"},o.createElement("div",{className:"service-center-details-text"},null==T?void 0:T.serviceCenter)),null!=T&&T.viewMapLocation?o.createElement("div",{className:"link"},o.createElement("a",{href:null==T?void 0:T.viewMapLocation},S("VIEW_ON_MAP"))):null):o.createElement("div",null),o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},w||null==_||null===(null==_?void 0:_.dynamicDataOne)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(D,{module:b,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataOne))),w||null==_||null===(null==_?void 0:_.dynamicDataTwo)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(D,{module:b,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement(A,{module:b}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=x(b))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(p=x(b))||void 0===p?void 0:p.staticDataOneHeader),o.createElement("span",{className:"static-data-content-second"},""+(null===(v=x(b))||void 0===v?void 0:v.staticDataOne))))):o.createElement("div",null),T&&null!=T&&T.staticDataTwo?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement(R,{module:b}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(g=x(b))||void 0===g?void 0:g.staticDataTwoHeader),o.createElement("span",{className:"static-data-content-second"},null===(f=x(b))||void 0===f?void 0:f.staticDataTwo)))):o.createElement("div",null),T&&null!=T&&T.validity?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement("span",{className:"validityIcon"},o.createElement(t.ValidityTimeIcon,null)),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(E=L(b))||void 0===E?void 0:E.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null===(h=L(b))||void 0===h?void 0:h.validity)))):o.createElement("div",null),w||null==_||null==_||!_.staticData||null===(null==_?void 0:_.staticData)?o.createElement("div",null):o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},"PGR"===b?o.createElement(D,{module:b,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):o.createElement("span",{className:"validityIcon"},o.createElement(t.ValidityTimeIcon,null)),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(y=L(b))||void 0===y?void 0:y.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null==_?void 0:_.staticData)))))):o.createElement(o.Fragment,null)};var En,hn,yn,bn,Sn;const Cn=[(null===(En=window)||void 0===En?void 0:En.contextPath)+"/citizen/register/name",`/${null===(hn=window)||void 0===hn?void 0:hn.contextPath}/citizen/select-language`,`/${null===(yn=window)||void 0===yn?void 0:yn.contextPath}/citizen/select-location`,`/${null===(bn=window)||void 0===bn?void 0:bn.contextPath}/citizen/login`,`/${null===(Sn=window)||void 0===Sn?void 0:Sn.contextPath}/citizen/register/otp`],Nn=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),On=e=>{var n,i,r;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:v,stateCode:g,modules:f,appTenants:E,pathname:h,initData:y}=e;const{isLoading:b,data:S,isFetched:C}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:`[?(@.url == '${Digit.Utils.getMultiRootTenant()?window.globalPath:window.contextPath}-card')]`}],{select:e=>{var t,n;return null==e||null===(t=e["ACCESSCONTROL-ACTIONS-TEST"])||void 0===t||null===(n=t["actions-test"])||void 0===n?void 0:n.filter(e=>!0===e.enabled).reduce((e,t)=>{var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t,...e[t.parentModule]]:[t],e},{})}}),N=Digit.Hooks.useRouteSubscription(h),{t:O}=l.useTranslation(),{path:I}=a.useRouteMatch(),w=a.useHistory(),_=Cn.some(e=>window.location.href.includes(e)),D=f.map((e,t)=>{let{code:n,tenants:l}=e;const i=Digit.ComponentRegistryService.getComponent(n+"Module");return i?o.createElement(a.Route,{key:t,path:`${I}/${n.toLowerCase()}`},o.createElement(i,{stateCode:g,moduleCode:n,userType:"citizen",tenants:Nn(l,E)})):null}),T=f.map((e,n)=>{let{code:l,bannerImage:i}=e,r=(Digit.ComponentRegistryService.getComponent(l+"Links"),C?ge(S,l,O):void 0);return"ACTION_TEST_WS"===(null==r?void 0:r.header)&&(null==r||r.links.sort((e,t)=>t.orderNumber-e.orderNumber)),o.createElement(o.Fragment,null,o.createElement(a.Route,{key:n,path:`${I}/${l.toLowerCase()}-home`},o.createElement("div",{className:"moduleLinkHomePage"},o.createElement(ne,{src:i||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),o.createElement(t.BackLink,{className:"moduleLinkHomePageBackButton",onClick:()=>window.history.back()}),o.createElement("h1",null,O("MODULE_"+l.toUpperCase())),o.createElement("div",{className:"moduleLinkHomePageModuleLinks"},r&&o.createElement(t.CitizenHomeCard,{header:O(null==r?void 0:r.header),links:null==r?void 0:r.links,Icon:()=>o.createElement("span",null),Info:"OBPS"===l?()=>o.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:O("CS_FILE_APPLICATION_INFO_LABEL"),text:O("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===l})),o.createElement(fn,{moduleCode:null==l?void 0:l.toUpperCase()}))),o.createElement(a.Route,{key:"faq"+n,path:`${I}/${l.toLowerCase()}-faq`},o.createElement(Pe,{module:null==l?void 0:l.toUpperCase()})),o.createElement(a.Route,{key:"hiw"+n,path:`${I}/${l.toLowerCase()}-how-it-works`},o.createElement(Ye,{module:null==l?void 0:l.toUpperCase()})))});return o.createElement("div",{className:N},o.createElement(Le,{t:O,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:v,logoUrlWhite:null==s?void 0:s.logoUrlWhite,showSidebar:!!u,linkData:S,islinkDataLoading:b}),o.createElement("div",{className:"main center-container citizen-home-container mb-25"},_?null:o.createElement("div",{className:"SideBarStatic"},o.createElement(_e,{linkData:S,islinkDataLoading:b})),o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:I},o.createElement(Me,null)),o.createElement(a.Route,{exact:!0,path:I+"/select-language"},o.createElement(ke,null)),o.createElement(a.Route,{exact:!0,path:I+"/select-location"},o.createElement(Ue,null)),o.createElement(a.Route,{path:I+"/error"},o.createElement(ie,{initData:y,goToHome:()=>{var e,t,n,o;w.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(o=n.getType)||void 0===o?void 0:o.call(n)}`)}})),o.createElement(a.Route,{path:I+"/all-services"},o.createElement(he,{userType:"citizen",modules:f,getCitizenMenu:S,fetchedCitizen:C,isLoading:b})),o.createElement(a.Route,{path:I+"/login"},o.createElement(ut,{stateCode:g})),o.createElement(a.Route,{path:I+"/register"},o.createElement(ut,{stateCode:g,isUserRegistered:!1})),o.createElement(a.Route,{path:I+"/user/profile"},o.createElement(Ze,{stateCode:g,userType:"citizen",cityDetails:d})),o.createElement(a.Route,{path:I+"/Audit"},o.createElement(gn,null)),o.createElement(ae,{initData:y},D,T))),o.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},o.createElement(ne,{alt:"Powered by DIGIT",style:{height:"1.2em",cursor:"pointer"},src:null===(n=window)||void 0===n||null===(i=n.globalConfigs)||void 0===i||null===(r=i.getConfig)||void 0===r?void 0:r.call(i,"DIGIT_FOOTER"),onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))},In=e=>{let{children:t}=e;return o.createElement("div",{className:"banner banner-container"},t)},wn=e=>{var n,i,r;let{showTenant:a=!0}=e;const{data:s,isLoading:c}=Digit.Hooks.useStore.getInitData(),{stateInfo:u}=s||{},{t:d}=l.useTranslation();if(c)return o.createElement(t.Loader,null);const m=null===(n=window)||void 0===n||null===(i=n.globalConfigs)||void 0===i?void 0:i.getConfig("SVG_HEADER_SECONDARY_LOGO_URL");return m?o.createElement("div",{className:"bannerHeader secondaryBannerHeader"},o.createElement(ne,{className:"bannerLogo",src:null==u?void 0:u.logoUrl,style:a?{}:{borderRight:"unset"},alt:"Digit Banner"}),o.createElement("span",{style:{fontSize:"xx-large"}},"|"),o.createElement(ne,{className:"svgHeaderLogo",src:m,alt:"DIGIT Logo"})):o.createElement("div",{className:"bannerHeader"},o.createElement(ne,{className:"bannerLogo",src:null==u?void 0:u.logoUrl,style:a?{}:{borderRight:"unset"},alt:"Digit Banner"}),a&&(null==u?void 0:u.code)&&o.createElement("p",null,d("TENANT_TENANTS_"+(null==u||null===(r=u.code)||void 0===r?void 0:r.toUpperCase()))))},_n=e=>{var l,i,r;let{config:c,t:u}=e;const[d,m]=n.useState(null),{mobile_number:p,tenantId:v}=Digit.Hooks.useQueryParams(),g=a.useHistory(),[f,E]=n.useState(""),[h,y]=n.useState(!0),[b,S]=n.useState(null),C=()=>Digit.UserService.getType();n.useEffect(()=>{var e,t;if(!d)return void Digit.UserService.setType("employee");Digit.UserService.setUser(d);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;g.replace(n)},[d]);const N=()=>{S(null)},[O,I,w]=c.inputs,_=[{body:[{label:u(O.label),type:O.type,populators:{name:O.name},isMandatory:!0},{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0},{label:u(w.label),type:w.type,populators:{name:w.name},isMandatory:!0}]}];return o.createElement(In,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{variant:"primary",style:{borderBottom:"none"}})),o.createElement(s.FormComposer,{onSubmit:function(e){try{return Promise.resolve(Ge(function(){if(e.newPassword!==e.confirmPassword)return S(u("ERR_PASSWORD_DO_NOT_MATCH"));const t={...e,otpReference:f,tenantId:v,type:C().toUpperCase()};return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){(()=>{var e;g.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/login`)})()})},function(e){var t,n,o,l,i;S((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.error)||void 0===o||null===(l=o.fields)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.message)||u("ES_SOMETHING_WRONG")),setTimeout(N,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},o.createElement(wn,null),o.createElement(s.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),o.createElement(s.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",o.createElement("b",null," ",""+u("+ 91 - ")," ",p)),o.createElement(tt,{t:u,userType:"employee",otp:f,onOtpChange:E,error:h,onResend:function(){try{function e(){setTimeout(N,5e3)}const t={otp:{mobileNumber:p,userType:C().toUpperCase(),type:"passwordreset",tenantId:v}},n=Ge(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){S(u("ES_OTP_RESEND"))})},function(e){var t,n;S((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||u("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),b&&o.createElement(t.Toast,{type:"error",label:u(b),onClose:N}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(i=l.globalConfigs)||void 0===i||null===(r=i.getConfig)||void 0===r?void 0:r.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};_n.propTypes={loginParams:te.any},_n.defaultProps={loginParams:null};const Dn=[{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"}]}],Tn=()=>{const{t:e}=l.useTranslation(),{path:t}=a.useRouteMatch(),i=n.useMemo(()=>Dn.map(t=>{const n={};for(const o in t.texts)n[o]=e(t.texts[o]);return{...t,texts:n}},[Dn]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+t,exact:!0},o.createElement(_n,{config:i[0],t:e})))},An=[{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"}]}],Rn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_LOGIN",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",key:"username",isMandatory:!0,populators:{name:"username",validation:{required:!0},error:"ERR_USERNAME_REQUIRED"}},{label:"CORE_LOGIN_PASSWORD",type:"password",key:"password",isMandatory:!0,populators:{name:"password",validation:{required:!0},error:"ERR_PASSWORD_REQUIRED"}},{isMandatory:!0,type:"dropdown",key:"city",label:"CORE_COMMON_CITY",disable:!1,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:!1,component:"PrivacyComponent",populators:{name:"check"},customProps:{module:"HCM"},isMandatory:!1,withoutLabel:!0}]}],Ln=e=>{var t;let{bannerImages:i=[]}=e;const[r,a]=n.useState(0),{t:s}=l.useTranslation(),c=i||(null===(t=Rn[0])||void 0===t?void 0:t.bannerImages)||[],u=()=>{a(e=>e===c.length-1?0:e+1)};return n.useEffect(()=>{const e=setInterval(()=>{u()},5e3);return()=>clearInterval(e)},[c.length]),o.createElement(n.Fragment,null,o.createElement("div",{className:"carousel-container"},c.sort((e,t)=>(null==e?void 0:e.id)-(null==t?void 0:t.id)).map((e,t)=>o.createElement("div",{key:e.id,className:"carousel-slide "+(t===r?"active":""),style:{backgroundImage:`url(${e.image})`}},o.createElement("div",{className:"carousel-content"},o.createElement("h2",null,s(e.title)),o.createElement("p",null,s(e.description))))),o.createElement("div",{className:"carousel-controls"},o.createElement("button",{className:"carousel-nav",onClick:()=>{a(e=>0===e?c.length-1:e-1)}},"<"),o.createElement("div",{className:"carousel-indicators"},c.map((e,t)=>o.createElement("button",{key:t,className:"indicator "+(t===r?"active":""),onClick:()=>(e=>{a(e)})(t)}))),o.createElement("button",{className:"carousel-nav",onClick:u},">"))))},xn=e=>{const t=Digit.Utils.getConfigModuleName();return Digit.Hooks.useCommonMDMS(e,t,["LoginConfig"],{select:e=>{var n;return{config:null==e||null===(n=e[t])||void 0===n?void 0:n.LoginConfig}},retry:!1})},Pn=e=>{var l,i,r,s,c,u;let{config:d,t:m,stateCode:p}=e;const{data:v,isLoading:g}=Digit.Hooks.useTenants(),[f,E]=n.useState(null),h=a.useHistory(),[y,b]=n.useState(null),{data:S}=xn(p);if(null!=S&&S.config){var C;const e=null==S||null===(C=S.config[0])||void 0===C?void 0:C.bannerImages;d.bannerImages=e}n.useEffect(()=>{var e,t;if(!f)return void Digit.UserService.setType("employee");Digit.UserService.setUser(f);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;h.replace(n)},[f]);const N=()=>{b(null)},O=function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();const t={otp:{userName:e.username,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=Ge(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;h.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/change-password?USERNAME=${e.username}&tenantId=${e.city.code}`)})},function(e){var t,n,o,l,i;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.error)||void 0===o||null===(l=o.fields)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.message)||"Invalid login credentials!"),setTimeout(N,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},I=()=>{var e;h.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/login`)},[w,_]=d.inputs,D=[{body:[{label:m("USERNAME"),type:"text",populators:{name:"username"},isMandatory:!0},{label:m(_.label),type:_.type,populators:{name:_.name,optionsKey:"name",required:!0,options:v},isMandatory:!0}]}];return g?o.createElement(t.Loader,{page:!0,variant:"PageLoader"}):null!=d&&d.bannerImages?o.createElement(o.Fragment,null,o.createElement("div",{className:"login-container"},o.createElement(Ln,{bannerImages:null==d?void 0:d.bannerImages}),o.createElement("div",{className:"login-form-container"},o.createElement(t.FormComposerV2,{onSubmit:O,noBoxShadow:!0,inline:!0,submitInForm:!0,config:D,label:d.texts.submitButtonLabel,secondaryActionLabel:d.texts.secondaryButtonLabel,onSecondayActionClick:I,heading:d.texts.header,description:d.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},o.createElement(wn,null)),y&&o.createElement(t.Toast,{type:"error",label:m(y),onClose:N}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(i=l.globalConfigs)||void 0===i||null===(r=i.getConfig)||void 0===r?void 0:r.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," ")))):o.createElement(In,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:O,noBoxShadow:!0,inline:!0,submitInForm:!0,config:D,label:d.texts.submitButtonLabel,secondaryActionLabel:d.texts.secondaryButtonLabel,onSecondayActionClick:I,heading:d.texts.header,description:d.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},o.createElement(wn,null)),y&&o.createElement(t.Toast,{type:"error",label:m(y),onClose:N}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(s=window)||void 0===s||null===(c=s.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Pn.propTypes={loginParams:te.any},Pn.defaultProps={loginParams:null};const Mn=e=>{let{stateCode:t}=e;const{t:i}=l.useTranslation(),{path:r}=a.useRouteMatch(),s=n.useMemo(()=>An.map(e=>{const t={};for(const n in e.texts)t[n]=i(e.texts[n]);return{...e,texts:t}},[An]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+r,exact:!0},o.createElement(Pn,{config:s[0],t:i,stateCode:t})))},kn=(e,t)=>t.filter(t=>{var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,e=>e.code).includes(t.code)}),Un=e=>{var t;let{stateCode:n,userType:l,modules:i,appTenants:r,additionalComponent:s}=e;Digit;const{path:c}=a.useRouteMatch(),u=a.useLocation(),d=Digit.UserService.getUser();var m;if(!d||null==d||!d.access_token||null==d||!d.info)return o.createElement(a.Redirect,{to:{pathname:`/${null===(m=window)||void 0===m?void 0:m.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}});const p=null==i?void 0:i.map((e,t)=>{var i;let{code:s,tenants:u}=e;const d=Digit.ComponentRegistryService.getComponent(s+"Module");return o.createElement(a.Route,{key:t,path:`${c}/${s.toLowerCase()}`},d?o.createElement(d,{stateCode:n,moduleCode:s,userType:l,tenants:kn(u,r)}):o.createElement(a.Redirect,{to:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/employee/user/error?type=notfound&module=${s}`}))}),v=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return u.pathname.includes(c+"/productDetailsPage/"),o.createElement("div",{className:v?"":"ground-container digit-home-ground"},o.createElement(a.Switch,null,p,o.createElement(a.Route,{path:c+"/login"},o.createElement(a.Redirect,{to:{pathname:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}})),o.createElement(a.Route,{path:c+"/forgot-password"},o.createElement(Mn,null)),o.createElement(a.Route,{path:c+"/change-password"},o.createElement(Tn,null)),o.createElement(a.Route,null,o.createElement(he,{userType:l,modules:i,additionalComponent:s}))))};var Bn,Fn,jn;const Hn={label:"English",value:null===(Bn=Digit)||void 0===Bn||null===(Fn=Bn.Utils)||void 0===Fn||null===(jn=Fn.getDefaultLanguage)||void 0===jn?void 0:jn.call(Fn)},zn=()=>{var e,i,r,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=l.useTranslation(),v=a.useHistory(),{languages:g,stateInfo:f}=d||{};let E=g;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[Hn]);const h=Digit.StoreData.getCurrentLanguage(),[y,b]=n.useState(h),S=(null==g?void 0:g.length)>1;return m?o.createElement(t.Loader,null):S?o.createElement(In,null,o.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},o.createElement("div",{className:"bannerHeader"},o.createElement(ne,{className:"bannerLogo",src:null==f?void 0:f.logoUrl,alt:"Digit Banner Image"}),o.createElement("p",null,p("TENANT_TENANTS_"+(null==f||null===(i=f.code)||void 0===i?void 0:i.toUpperCase())))),o.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},E.map((e,t)=>o.createElement("div",{className:"language-button-container",key:t},o.createElement(s.CustomButton,{selected:e.value===y,text:p(e.label),onClick:()=>(e=>{b(e.value),Digit.LocalizationService.changeLanguage(e.value,f.code)})(e)})))),o.createElement(t.SubmitBar,{style:{width:"100%"},label:p("CORE_COMMON_CONTINUE"),onSubmit:e=>{var t;v.push(`/${t=window.contextPath,t&&"string"==typeof t?t.split("/")[0]:""}/user/login?ts=${Date.now()}`)}})),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(c=r.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," ")):o.createElement(a.Redirect,{to:`/${null===(C=window)||void 0===C?void 0:C.contextPath}/employee/user/login`});var C},Gn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!0,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],Vn=e=>{var l,i,r,s,c,u,d,m,p,v;let{config:g,t:f,isDisabled:E,loginOTPBased:h}=e;const{isLoading:y}=Digit.Hooks.useTenants(),{data:b,isLoading:S}=Digit.Hooks.useStore.getInitData(),{stateInfo:C}=b||{},[N,O]=n.useState(null),[I,w]=n.useState(null),[_,D]=n.useState(!1),T=null===(l=Digit.ComponentRegistryService)||void 0===l?void 0:l.getComponent("DynamicLoginComponent"),A=a.useHistory();n.useEffect(()=>{var e,t,n,o,l,i,r,a,s,c,u,d,m,p,v,g,f,E;if(!N)return;Digit.SessionStorage.set("citizen.userRequestObject",N);const h=null==N||null===(e=N.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==N||null===(n=N.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(N.info.roles=h),Digit.UserService.setUser(N),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant()&&"development"!==process.env.NODE_ENV)return;let o=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Employee.locale",o),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==N?void 0:N.info,null==N?void 0:N.access_token);let y=`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`;var b,S,C,O,I,w,_;null!==(i=window)&&void 0!==i&&null!==(r=i.location)&&void 0!==r&&null!==(a=r.href)&&void 0!==a&&a.includes("from=")&&(y=decodeURIComponent(null===(b=window)||void 0===b||null===(S=b.location)||void 0===S||null===(C=S.href)||void 0===C||null===(O=C.split("from="))||void 0===O?void 0:O[1])||`/${null===(I=window)||void 0===I?void 0:I.contextPath}/employee`),null!=N&&null!==(s=N.info)&&void 0!==s&&s.roles&&(null==N||null===(c=N.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=N&&null!==(d=N.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(e=>"NATADMIN"===e.code)&&(y=`/${null===(w=window)||void 0===w?void 0:w.contextPath}/employee/dss/landing/NURT_DASHBOARD`),null!=N&&null!==(p=N.info)&&void 0!==p&&p.roles&&(null==N||null===(v=N.info)||void 0===v||null===(g=v.roles)||void 0===g?void 0:g.length)>0&&null!=N&&null!==(f=N.info)&&void 0!==f&&null!==(E=f.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(y=`/${null===(_=window)||void 0===_?void 0:_.contextPath}/employee/dss/landing/home`),A.replace(y)},[N]);const R=function(e){try{var t,n,o;function l(){D(!1)}null!=e&&e.username&&(e.username=e.username.trim()),null!=e&&e.password&&(e.password=e.password.trim()),D(!0);const i={...e,...H,userType:"EMPLOYEE"};i.tenantId=(null==i||null===(t=i.city)||void 0===t?void 0:t.code)||(null===(n=Digit)||void 0===n||null===(o=n.ULBService)||void 0===o?void 0:o.getStateId()),delete i.city;const r=Ge(function(){return Promise.resolve(Digit.UserService.authenticate(i)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),O({info:t,...n})})},function(e){var t,n;w((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&f("ES_ERROR_USER_NOT_PERMITTED")||f("INVALID_LOGIN_CREDENTIALS")),setTimeout(M,5e3)});return Promise.resolve(r&&r.then?r.then(l):l())}catch(e){return Promise.reject(e)}},L={url:"/user-otp/v1/_send",params:{tenantId:null===(i=Digit)||void 0===i||null===(r=i.ULBService)||void 0===r?void 0:r.getStateId()},body:{},config:{enable:!1}},x=Digit.Hooks.useCustomAPIMutationHook(L),P=function(e){try{var t,n;const o=e.email;return Promise.resolve(x.mutate({body:{otp:{userName:e.email,type:"login",tenantId:null===(t=Digit)||void 0===t||null===(n=t.ULBService)||void 0===n?void 0:n.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,i,r,a,s;w(null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&l[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r||null===(a=r.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"),setTimeout(M,5e3)},onSuccess:function(e){try{var t,n,l;return A.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login/otp`,{state:{email:o,tenant:null===(n=Digit)||void 0===n||null===(l=n.ULBService)||void 0===l?void 0:l.getStateId()}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},M=()=>{w(null)},k=()=>{var e;A.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/forgot-password`)},U=Digit.ULBService.getStateId(),B={code:U,name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+U)};let F=[{body:null==g?void 0:g.inputs}];const{mode:j}=Digit.Hooks.useQueryParams();"admin"===j&&!1===(null==F||null===(s=F[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u?void 0:u.disable)&&null==(null==F||null===(d=F[0])||void 0===d||null===(m=d.body)||void 0===m||null===(p=m[2])||void 0===p||null===(v=p.populators)||void 0===v?void 0:v.defaultValue)&&(F[0].body[2].disable=!0,F[0].body[2].isMandatory=!1,F[0].body[2].populators.defaultValue=B);const H=n.useMemo(()=>Object.fromEntries(F[0].body.filter(e=>{var t,n;return(null==e||null===(t=e.populators)||void 0===t?void 0:t.defaultValue)&&(null==e||null===(n=e.populators)||void 0===n?void 0:n.name)}).map(e=>[e.populators.name,e.populators.defaultValue])),[]),z=(e,t,n)=>{const o=F[0].body.filter(e=>null==e?void 0:e.isMandatory).map(e=>null==e?void 0:e.key).some(e=>{const n=t[e];return null==n||""===n||!1===n});D(o)},G=F.map(e=>({...e,body:e.body.map(e=>"check"===e.key?{...e,isMandatory:!0}:e)})),V=function(e,n,l){var i,r,a;return void 0===e&&(e=""),void 0===n&&(n=""),void 0===l&&(l=""),o.createElement(t.FormComposerV2,{onSubmit:h?P:R,isDisabled:E||_,noBoxShadow:!0,inline:!0,submitInForm:!0,config:G,label:null==g||null===(i=g.texts)||void 0===i?void 0:i.submitButtonLabel,secondaryActionLabel:(null==g||null===(r=g.texts)||void 0===r?void 0:r.secondaryButtonLabel)+(e.includes("login-form-container")?"?":""),onSecondayActionClick:k,onFormValueChange:z,heading:null==g||null===(a=g.texts)||void 0===a?void 0:a.header,className:""+l,cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:n,buttonClassName:"buttonClassName",defaultValues:H},o.createElement(wn,null!=C&&C.code?null:{showTenant:!1}))},W=e=>{var t,n,l;return o.createElement("div",{className:e,style:{backgroundColor:"unset"}},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(n=t.globalConfigs)||void 0===n||null===(l=n.getConfig)||void 0===l?void 0:l.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}}))};return y||S?o.createElement(t.Loader,{page:!0,variant:"PageLoader"}):null!=g&&g.bannerImages?o.createElement("div",{className:"login-container"},o.createElement(Ln,{bannerImages:null==g?void 0:g.bannerImages}),o.createElement("div",{className:"login-form-container"},V("login-form-container","",h?"sandbox-onboarding-wrapper":""),T&&o.createElement(T,null),I&&o.createElement(t.Toast,{type:"error",label:f(I),onClose:M}),W("EmployeeLoginFooter"))):o.createElement(In,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),V("loginFormStyleEmployee","loginCardClassName",h?"sandbox-onboarding-wrapper":""),T&&o.createElement(T,null),I&&o.createElement(t.Toast,{type:"error",label:f(I),onClose:M}),W("employee-login-home-footer"))};Vn.propTypes={loginParams:te.any},Vn.defaultProps={loginParams:null};const Wn=e=>{var i,r;let{stateCode:s}=e;const{t:c}=l.useTranslation(),{path:u}=a.useRouteMatch(),[d,m]=n.useState(Rn),[p,v]=n.useState(Gn),g=Digit.StoreData.getCurrentLanguage(),f=(null===(i=window)||void 0===i||null===(r=i.globalConfigs)||void 0===r?void 0:r.getConfig("OTP_BASED_LOGIN"))||!1,{data:E,isLoading:h}=xn(s),y=a.useHistory(),b=a.useLocation();n.useEffect(()=>{if(!new URLSearchParams(b.search).get("ts")){const e=Date.now();y.replace({pathname:b.pathname,search:"?ts="+e})}},[b,y]),Digit.Services.useStore({stateCode:s,moduleCode:["privacy-policy"],language:g,modulePrefix:"digit"}),n.useEffect(()=>{m(0==h&&null!=E&&E.config?null==E?void 0:E.config:Rn)},[E,h]);const S=n.useMemo(()=>d.map(e=>{const t={};for(const n in e.texts)t[n]=c(e.texts[n]);return{...e,texts:t}},[d])),C=n.useMemo(()=>p.map(e=>{const t={};for(const n in e.texts)t[n]=c(e.texts[n]);return{...e,texts:t}},[p]));return h?o.createElement(t.Loader,{page:!1,variant:"PageLoader"}):o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+u,exact:!0},o.createElement(Vn,f?{config:C[0],t:c,loginOTPBased:f}:{config:S[0],t:c})))};var Qn,Xn,qn,Zn;function Yn(){return(Yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}function $n(e){return n.createElement("svg",Yn({width:319,height:48,fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Qn||(Qn=n.createElement("path",{fill:"url(#SandboxHeader_svg__pattern0_27111_38436)",d:"M0 0h138v48H0z"})),Xn||(Xn=n.createElement("path",{stroke:"#000",d:"M152.5 7v34"})),qn||(qn=n.createElement("path",{d:"M184.62 15.34c-.16.28-.333.487-.52.62-.173.12-.393.18-.66.18-.28 0-.587-.1-.92-.3a17.66 17.66 0 00-1.16-.7 9.019 9.019 0 00-1.6-.68c-.6-.213-1.313-.32-2.14-.32-.747 0-1.4.093-1.96.28-.56.173-1.033.42-1.42.74a3.03 3.03 0 00-.84 1.16c-.187.44-.28.927-.28 1.46 0 .68.187 1.247.56 1.7.387.453.893.84 1.52 1.16.627.32 1.34.607 2.14.86s1.62.527 2.46.82c.84.28 1.66.613 2.46 1 .8.373 1.513.853 2.14 1.44a6.286 6.286 0 011.5 2.12c.387.84.58 1.86.58 3.06a9.924 9.924 0 01-.68 3.68 8.4 8.4 0 01-1.96 2.98c-.853.84-1.9 1.507-3.14 2-1.24.48-2.66.72-4.26.72-.92 0-1.827-.093-2.72-.28a14.04 14.04 0 01-2.58-.76 13.939 13.939 0 01-2.3-1.2 11.14 11.14 0 01-1.92-1.56l1.58-2.58a1.58 1.58 0 01.52-.46c.213-.133.44-.2.68-.2.333 0 .693.14 1.08.42.387.267.847.567 1.38.9.533.333 1.153.64 1.86.92.72.267 1.58.4 2.58.4 1.533 0 2.72-.36 3.56-1.08.84-.733 1.26-1.78 1.26-3.14 0-.76-.193-1.38-.58-1.86-.373-.48-.873-.88-1.5-1.2a10.859 10.859 0 00-2.14-.84c-.8-.227-1.613-.473-2.44-.74a21.03 21.03 0 01-2.44-.96 7.909 7.909 0 01-2.14-1.46c-.627-.6-1.133-1.347-1.52-2.24-.373-.907-.56-2.02-.56-3.34 0-1.053.207-2.08.62-3.08.427-1 1.04-1.887 1.84-2.66.8-.773 1.787-1.393 2.96-1.86 1.173-.467 2.52-.7 4.04-.7 1.707 0 3.28.267 4.72.8s2.667 1.28 3.68 2.24l-1.34 2.54zm16.34 14.9c-1.427.067-2.627.193-3.6.38-.974.173-1.754.4-2.34.68-.587.28-1.007.607-1.26.98-.254.373-.38.78-.38 1.22 0 .867.253 1.487.76 1.86.52.373 1.193.56 2.02.56 1.013 0 1.886-.18 2.62-.54.746-.373 1.473-.933 2.18-1.68v-3.46zm-11.32-8.9c2.36-2.16 5.2-3.24 8.52-3.24 1.2 0 2.273.2 3.22.6a6.645 6.645 0 012.4 1.64c.653.693 1.146 1.527 1.48 2.5.346.973.52 2.04.52 3.2V39h-2.24c-.467 0-.827-.067-1.08-.2-.254-.147-.454-.433-.6-.86l-.44-1.48c-.52.467-1.027.88-1.52 1.24a9.384 9.384 0 01-1.54.88c-.534.24-1.107.42-1.72.54-.6.133-1.267.2-2 .2a8.09 8.09 0 01-2.4-.34 5.385 5.385 0 01-1.9-1.06 4.703 4.703 0 01-1.24-1.74c-.294-.693-.44-1.5-.44-2.42 0-.52.086-1.033.26-1.54.173-.52.453-1.013.84-1.48.4-.467.913-.907 1.54-1.32.626-.413 1.393-.773 2.3-1.08.92-.307 1.986-.553 3.2-.74 1.213-.2 2.6-.32 4.16-.36v-1.2c0-1.373-.294-2.387-.88-3.04-.587-.667-1.434-1-2.54-1-.8 0-1.467.093-2 .28-.52.187-.98.4-1.38.64-.4.227-.767.433-1.1.62-.32.187-.68.28-1.08.28-.347 0-.64-.087-.88-.26-.24-.187-.434-.4-.58-.64l-.88-1.58zm25.412-.34c.414-.413.847-.793 1.3-1.14.467-.36.954-.66 1.46-.9a7.656 7.656 0 011.66-.58 7.909 7.909 0 011.92-.22c1.12 0 2.114.193 2.98.58a5.654 5.654 0 012.16 1.6c.587.68 1.027 1.5 1.32 2.46.307.947.46 1.993.46 3.14V39h-4.94V25.94c0-1.253-.286-2.22-.86-2.9-.573-.693-1.446-1.04-2.62-1.04-.853 0-1.653.193-2.4.58a8.62 8.62 0 00-2.12 1.58V39h-4.94V18.48h3.02c.64 0 1.06.3 1.26.9l.34 1.62zm30.838 2.72c-.56-.68-1.173-1.16-1.84-1.44a5.323 5.323 0 00-2.12-.42c-.746 0-1.42.14-2.02.42-.6.28-1.113.707-1.54 1.28-.426.56-.753 1.28-.98 2.16-.226.867-.34 1.893-.34 3.08 0 1.2.094 2.22.28 3.06.2.827.48 1.507.84 2.04.36.52.8.9 1.32 1.14.52.227 1.1.34 1.74.34 1.027 0 1.9-.213 2.62-.64.72-.427 1.4-1.033 2.04-1.82v-9.2zm4.94-14.44V39h-3.02c-.653 0-1.066-.3-1.24-.9l-.42-1.98a10.293 10.293 0 01-2.86 2.3c-1.066.587-2.313.88-3.74.88-1.12 0-2.146-.233-3.08-.7-.933-.467-1.74-1.14-2.42-2.02-.666-.893-1.186-1.993-1.56-3.3-.36-1.307-.54-2.8-.54-4.48 0-1.52.207-2.933.62-4.24.414-1.307 1.007-2.44 1.78-3.4a8.202 8.202 0 012.78-2.24c1.08-.547 2.294-.82 3.64-.82 1.147 0 2.127.18 2.94.54.814.36 1.54.847 2.18 1.46V9.28h4.94zm9.816 24.4c.56.68 1.166 1.16 1.82 1.44.666.28 1.366.42 2.1.42.76 0 1.44-.133 2.04-.4a4.001 4.001 0 001.56-1.28c.426-.587.753-1.327.98-2.22.226-.907.34-1.987.34-3.24 0-2.253-.374-3.88-1.12-4.88-.747-1.013-1.82-1.52-3.22-1.52-.947 0-1.774.22-2.48.66-.707.427-1.38 1.033-2.02 1.82v9.2zm0-12.68a10.055 10.055 0 012.74-2.06c1.013-.52 2.166-.78 3.46-.78 1.186 0 2.253.233 3.2.7a6.715 6.715 0 012.44 2.02c.68.867 1.2 1.92 1.56 3.16.36 1.24.54 2.633.54 4.18 0 1.667-.207 3.18-.62 4.54-.414 1.36-1.007 2.527-1.78 3.5a8.002 8.002 0 01-2.76 2.24c-1.08.533-2.28.8-3.6.8-.64 0-1.22-.067-1.74-.2a6.148 6.148 0 01-2.66-1.34c-.36-.333-.707-.7-1.04-1.1l-.22 1.38c-.08.347-.22.593-.42.74-.187.147-.447.22-.78.22h-3.26V9.28h4.94V21zm26.835-2.84c1.52 0 2.9.247 4.14.74 1.253.493 2.32 1.193 3.2 2.1.893.907 1.58 2.013 2.06 3.32s.72 2.767.72 4.38c0 1.627-.24 3.093-.72 4.4-.48 1.307-1.167 2.42-2.06 3.34-.88.92-1.947 1.627-3.2 2.12-1.24.493-2.62.74-4.14.74-1.533 0-2.927-.247-4.18-.74a9.04 9.04 0 01-3.22-2.12c-.88-.92-1.567-2.033-2.06-3.34-.48-1.307-.72-2.773-.72-4.4 0-1.613.24-3.073.72-4.38.493-1.307 1.18-2.413 2.06-3.32.893-.907 1.967-1.607 3.22-2.1 1.253-.493 2.647-.74 4.18-.74zm0 17.34c1.707 0 2.967-.573 3.78-1.72.827-1.147 1.24-2.827 1.24-5.04s-.413-3.9-1.24-5.06c-.813-1.16-2.073-1.74-3.78-1.74-1.733 0-3.02.587-3.86 1.76-.827 1.16-1.24 2.84-1.24 5.04s.413 3.88 1.24 5.04c.84 1.147 2.127 1.72 3.86 1.72zm31.271 3.5h-4.76c-.36 0-.653-.093-.88-.28a2.772 2.772 0 01-.54-.64l-4.34-7.14c-.066.227-.146.44-.24.64-.08.2-.173.387-.28.56l-3.84 5.94a3.39 3.39 0 01-.54.64c-.213.187-.48.28-.8.28h-4.42l7.04-10.58-6.76-9.94h4.76c.36 0 .627.053.8.16.174.093.327.253.46.48l4.3 6.84c.147-.453.354-.9.62-1.34l3.46-5.4c.294-.493.674-.74 1.14-.74h4.54l-6.74 9.72 7.02 10.8z",fill:"#4F5052"})),Zn||(Zn=n.createElement("defs",null,n.createElement("pattern",{id:"SandboxHeader_svg__pattern0_27111_38436",patternContentUnits:"objectBoundingBox",width:1,height:1},n.createElement("use",{xlinkHref:"#SandboxHeader_svg__image0_27111_38436",transform:"scale(.00229 .00658)"})),n.createElement("image",{id:"SandboxHeader_svg__image0_27111_38436",width:437,height:152,preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbUAAACYCAYAAABj73eBAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDIzLTA2LTE2VDEyOjI1OjU2KzA1OjMwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyMy0wNi0xNlQxMjoyNzowNSswNTozMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAyMy0wNi0xNlQxMjoyNzowNSswNTozMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHBob3Rvc2hvcDpJQ0NQcm9maWxlPSJzUkdCIElFQzYxOTY2LTIuMSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0MjIxNmQ5Ni02YWMw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"}))))}const Jn=e=>{var n;let{showTenant:i=!0}=e;const{data:r,isLoading:a}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=r||{},{t:c}=l.useTranslation();return a?o.createElement(t.Loader,null):o.createElement("div",{className:"bannerHeader"},o.createElement("div",{className:"SandboxLogoAlignCenter"},o.createElement($n,null)),i&&(null==s?void 0:s.code)&&o.createElement("p",null,c("TENANT_TENANTS_"+(null==s||null===(n=s.code)||void 0===n?void 0:n.toUpperCase()))))},Kn=e=>{let{bannerImages:t}=e;const[l,i]=n.useState(0),[r,a]=n.useState(!1);if(n.useEffect(()=>{const e=setInterval(()=>{a(!0),setTimeout(()=>{i(e=>(e+1)%t.length),a(!1)},200)},5e3);return()=>clearInterval(e)},[t.length]),!t||0===t.length)return o.createElement("div",null,"No images available");const{image:s,title:c,description:u}=t[l];return o.createElement("div",{className:"carousel-container",style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},o.createElement("div",{style:{position:"relative",width:"100%",height:"100%",transition:"opacity 0.4s ease-in-out, transform 0.4s ease-in-out",opacity:r?.7:1,transform:r?"scale(1.02)":"scale(1)"}},o.createElement("img",{className:"carousel-img",src:s,alt:c,style:{width:"100%",height:"100%",objectFit:"cover",display:"block",transition:"filter 0.4s ease-in-out",filter:r?"blur(1px)":"blur(0px)"}})),o.createElement("div",{style:{position:"absolute",left:0,bottom:0,width:"100%",height:"60%",background:"linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 100%)",zIndex:1,pointerEvents:"none"}}),o.createElement("div",{className:"carousel-overlay",style:{position:"absolute",bottom:"10rem",left:"2rem",maxWidth:"70%",color:"#fff",zIndex:2,transition:"opacity 0.4s ease-in-out, transform 0.4s ease-in-out",opacity:r?.6:1,transform:r?"translateY(10px)":"translateY(0px)"}},o.createElement("h2",{style:{margin:"0 0 1rem",fontSize:"2.5rem",fontWeight:"bold",textShadow:"2px 2px 4px rgba(0, 0, 0, 0.8)",lineHeight:1.2,transition:"all 0.4s ease-in-out"}},c),o.createElement("p",{style:{margin:0,fontSize:"1.1rem",lineHeight:1.6,textShadow:"1px 1px 2px rgba(0, 0, 0, 0.8)",opacity:.95,transition:"all 0.4s ease-in-out"}},u)),o.createElement("div",{style:{position:"absolute",bottom:"3.5rem",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:3,gap:"1rem"}},o.createElement("button",{onClick:()=>{a(!0),setTimeout(()=>{i(e=>(e-1+t.length)%t.length),a(!1)},200)},style:{backgroundColor:"transparent",border:"none",color:"white",fontSize:"1.5rem",cursor:"pointer",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}},"‹"),o.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.75rem"}},t.map((e,t)=>o.createElement("button",{key:t,onClick:()=>(e=>{e!==l&&(a(!0),setTimeout(()=>{i(e),a(!1)},200))})(t),style:{width:"10px",height:"10px",borderRadius:"50%",border:t===l?"1px solid rgba(255, 255, 255, 0.8)":"1px solid rgba(255, 255, 255, 0.3)",padding:0,background:t===l?"white":"rgba(255, 255, 255, 0.4)",cursor:"pointer",transition:"all 0.3s ease",transform:t===l?"scale(1.4)":"scale(1)",boxShadow:t===l?"0 0 8px rgba(255, 255, 255, 0.5)":"none"},onMouseEnter:e=>{t!==l&&(e.target.style.background="rgba(255, 255, 255, 0.7)",e.target.style.transform="scale(1.2)")},onMouseLeave:e=>{t!==l&&(e.target.style.background="rgba(255, 255, 255, 0.4)",e.target.style.transform="scale(1)")}}))),o.createElement("button",{onClick:()=>{a(!0),setTimeout(()=>{i(e=>(e+1)%t.length),a(!1)},200)},style:{backgroundColor:"transparent",border:"none",color:"white",fontSize:"1.5rem",cursor:"pointer",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}},"›")))},eo=e=>{var i,r,c;let{isLogin:u=!1}=e;const{t:d}=l.useTranslation(),m=(a.useRouteMatch(),a.useHistory()),p=a.useLocation(),[v,g]=n.useState(null),[f,E]=n.useState(!1),[h,y]=n.useState(null),b=(null==p||null===(i=p.state)||void 0===i?void 0:i.email)||sessionStorage.getItem("otpEmail")||"",S=(null==p||null===(r=p.state)||void 0===r?void 0:r.tenant)||sessionStorage.getItem("otpTenant")||"",{data:C}=Digit.Hooks.useCustomMDMS(S,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}}),N=null==C||null===(c=C[0])||void 0===c?void 0:c.url,O=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:b,tenant:S},populators:{required:!0}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Digital Headquarters for National Health Agencies",description:"Access real-time data dashboards and manage complaints."}]}],I=()=>g(null);n.useEffect(()=>{var e,t,n,o,l;if(!h)return;Digit.SessionStorage.set("citizen.userRequestObject",h);const i=null==h||null===(e=h.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==h||null===(n=h.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(h.info.roles=i),Digit.UserService.setUser(h),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant())return;let o=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Employee.locale",o),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==h?void 0:h.info,null==h?void 0:h.access_token);const r=((e,t,n,o)=>{var l,i,r,a,s,c;const u="SUPERUSER"===(null==t||null===(l=t.info)||void 0===l||null===(i=l.roles)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.code),d=null===(a=window)||void 0===a?void 0:a.contextPath;switch(!0){case"/sandbox-ui/user/otp"===e&&u:return`/${d}/employee/sandbox/landing`;case u&&(null==n||null===(s=n[0])||void 0===s||null===(c=s.rolesForLandingPage)||void 0===c?void 0:c.includes("SUPERUSER")):return`/${d}${o}`;default:return`/${d}/employee`}})(p.pathname,h,C,N);m.push(u?r:{pathname:`/${null===(l=window)||void 0===l?void 0:l.globalPath}/user/setup`,state:{tenant:S}})},[h]);const w=function(e){try{var t;const n={username:b,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:S,userType:"EMPLOYEE"},o=Ge(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),y({info:t,...n})})},function(e){var t,n;g((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"===(null==e?void 0:e.message)&&d("ES_ERROR_USER_NOT_PERMITTED")||d("INVALID_LOGIN_CREDENTIALS")),setTimeout(I,5e3)});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_=window.innerWidth<=768,D=()=>{var e,n,l;return o.createElement("div",{style:{padding:_?"1rem":"2rem",width:_?"100%":"30%",backgroundColor:"#fff",overflowY:"auto",justifyContent:"center",display:"flex",alignItems:"center",flexDirection:"column",height:_?"100vh":"auto"}},o.createElement("div",{className:"employeeBackbuttonAlign",style:{alignSelf:"flex-start",marginBottom:"1rem"}},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(s.FormComposerV2,{onSubmit:w,noBoxShadow:!0,inline:!0,submitInForm:!0,config:O,label:d("CORE_COMMON_SUBMIT"),headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper",buttonClassName:"sandbox-otp-submit-button",buttonStyle:{width:"100%",maxWidth:"408px",backgroundColor:"#F47738",borderColor:"#F47738",color:"#fff",fontWeight:"500",padding:"12px 24px",borderRadius:"4px",fontSize:"16px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center"},onFormValueChange:(e,t)=>{var n,o;return E(6===(null==t||null===(n=t.OtpComponent)||void 0===n||null===(o=n.otp)||void 0===o?void 0:o.length))},isDisabled:!f},o.createElement(Jn,{showTenant:!1})),v&&o.createElement(t.Toast,{type:"error",label:d(v),onClose:I}),o.createElement("div",{className:"EmployeeLoginFooter",style:{marginTop:"auto"}},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(n=e.globalConfigs)||void 0===n||null===(l=n.getConfig)||void 0===l?void 0:l.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;return window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};return _?D():o.createElement("div",{style:{display:"flex",height:"100vh"}},o.createElement("div",{style:{width:"70%",position:"relative"}},o.createElement(Kn,{bannerImages:O[0].bannerImages})),D())},to=["user/landing","user/profile","user/error","user/productPage"],no=e=>{var i,r,s,c,u,d;let{stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:g,mobileView:f,handleUserDropdownSelection:E,logoUrl:h,logoUrlWhite:y,DSO:b,stateCode:S,modules:C,appTenants:N,initData:O,noTopBar:I=!1}=e;const w=a.useHistory(),{t:_}=l.useTranslation(),{path:D}=a.useRouteMatch(),T=a.useLocation(),A=null==T||null===(i=T.pathname)||void 0===i?void 0:i.includes("language-selection"),R=to.some(e=>{var t;return null==T||null===(t=T.pathname)||void 0===t?void 0:t.includes(e)});n.useEffect(()=>{Digit.UserService.setType("employee")},[]);const L=null==O||null===(r=O.modules)||void 0===r||null===(s=r.filter(e=>null==e?void 0:e.additionalComponent))||void 0===s?void 0:s.map(e=>null==e?void 0:e.additionalComponent),x=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant(),P=T.pathname.includes("employee/sandbox/productDetailsPage/");return n.useEffect(()=>{const e=T.pathname===D||T.pathname===D+"/",t="sandbox"===new URLSearchParams(T.search).get("from");x&&e&&!t&&w.replace(D+"/sandbox/productPage")},[T.pathname,T.search,D,w,x]),o.createElement("div",{className:"employee"},o.createElement(a.Switch,null,o.createElement(a.Route,{path:D+"/user"},R&&o.createElement(Le,{t:_,stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:g,mobileView:f,handleUserDropdownSelection:E,logoUrl:h,logoUrlWhite:y,showSidebar:!!R,showLanguageChange:!A}),o.createElement("div",{className:R?"grounded-container":"loginContainer",style:R?{padding:0,paddingTop:"0",marginLeft:"0"}:{"--banner-url":`url(${null==m?void 0:m.bannerUrl})`,padding:"0px"}},o.createElement(a.Switch,null,!Digit.Utils.getMultiRootTenant()&&o.createElement(a.Route,{exact:!0,path:D+"/user/login"},o.createElement(Wn,{stateCode:S})),o.createElement(a.Route,{exact:!0,path:D+"/user/login/otp"},o.createElement(eo,{isLogin:!0})),o.createElement(a.Route,{path:D+"/user/forgot-password"},o.createElement(Mn,{stateCode:S})),o.createElement(a.Route,{path:D+"/user/change-password"},o.createElement(Tn,null)),o.createElement(t.PrivateRoute,{path:D+"/user/profile",component:()=>o.createElement(Ze,{stateCode:S,userType:"employee",cityDetails:g})}),o.createElement(a.Route,{path:D+"/user/error"},o.createElement(ie,{initData:O,goToHome:()=>{var e,t,n,o;w.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(o=n.getType)||void 0===o?void 0:o.call(n)}`)}})),o.createElement(a.Route,{path:D+"/user/language-selection"},o.createElement(zn,null)),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:D+"/user/language-selection"}))))),o.createElement(a.Route,null,!I&&o.createElement(Le,{t:_,stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:g,mobileView:f,handleUserDropdownSelection:E,logoUrl:h,logoUrlWhite:y,modules:C}),o.createElement("div",{className:I?"":`${x?"":"main"} ${b?"m-auto":""} digit-home-main`},o.createElement("div",{className:I?"":(x&&P?"":"employee-app-wrapper")+" digit-home-app-wrapper"},o.createElement(ae,{initData:O},o.createElement(Un,{stateCode:S,userType:"employee",modules:C,appTenants:N,additionalComponent:L}))),o.createElement("div",{className:"employee-home-footer"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u||null===(d=u.getConfig)||void 0===d?void 0:d.call(u,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:D+"/user/language-selection"}))))},oo=()=>{var e,i,r,s,c,u;const{t:d}=l.useTranslation(),m=a.useLocation(),{tenant:p}=m.state||{},v=(a.useHistory(),n.useRef(null)),g=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(i=e.info)||void 0===i?void 0:i.roles,[f,E]=n.useState(!0),{data:h}=Digit.Hooks.useCustomMDMS(p,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}});n.useEffect(()=>{null!=h&&h[0].url&&E(!1)},[h]);const y=null==h?void 0:h[0].url;return o.createElement(In,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.Card,{className:"card-sandbox"},o.createElement(wn,{showTenant:!1}),o.createElement("div",{className:"sandbox-success-signup"},o.createElement(t.SVG.TickMark,{fill:"#fff",height:30,width:70})),o.createElement(t.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"}},d("SANDBOX_HEADER")),o.createElement(t.CardText,{className:"cardText-sandbox"},d("SAMDBOX_URL_SUB")),o.createElement(t.CardLabel,null," ",d("SANDBOX_URL")," "),o.createElement("div",{className:"sandbox-url-wrapper"},o.createElement(t.TextInput,{inputRef:v,className:"urlInputText",onChange:()=>{},nonEditable:!0,value:`${window.location.host}/${null===(r=window)||void 0===r?void 0:r.globalPath}/${p}/employee`}),o.createElement(t.Button,{className:"copyButton",variation:"secondary",onClick:()=>{navigator.clipboard.writeText(v.current.value)},label:d("COPY_URL")})),o.createElement("div",{className:"sandbox-url-footer"},d("SANDBOX_URL_FOOT")),o.createElement(t.Button,{isDisabled:f,onClick:()=>{var e,t;((e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))})(g,h)?window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${p}${y}`:window.location.href=`/${null===(t=window)||void 0===t?void 0:t.globalPath}/${p}/employee`},label:d("SIGN_IN")})),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(s=window)||void 0===s||null===(c=s.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))},lo=e=>{const{state:n={}}=a.useLocation(),{t:i}=l.useTranslation(),r=a.useHistory(),s={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:()=>{r.push(`/${window.globalPath}/`)}};return o.createElement(In,null,o.createElement(t.Card,{className:"digit-employee-card customError"},o.createElement(wn,{showTenant:!1}),o.createElement(t.CardHeader,{className:"center"},i(s.infoHeader)),o.createElement(t.CardText,{className:"center"},i(s.infoMessage)),o.createElement(t.Button,{className:"customErrorButton",label:i(null==s?void 0:s.buttonInfo),variation:"primary",isSuffix:!0,onClick:e=>{e.preventDefault(),null==s||s.action()}})))},io=()=>{var e,t;const[i,r]=n.useState(0),s=(a.useHistory(),a.useLocation()),{t:u}=l.useTranslation(),{tenant:d}=s.state||{},m=["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"];n.useEffect(()=>{const e=setInterval(()=>{i<m.length&&r(e=>e+1)},2e3);if(i===m.length){clearInterval(e);const t=setTimeout(()=>{var e,t;h(p,f)?window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${d}${E}`:window.location.href=`/${null===(t=window)||void 0===t?void 0:t.globalPath}/${d}/employee`},1e3);return()=>clearTimeout(t)}return()=>{clearInterval(e)}},[i]),n.useRef(null);const p=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(t=e.info)||void 0===t?void 0:t.roles,[v,g]=n.useState(!0),{data:f}=Digit.Hooks.useCustomMDMS(d,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}});n.useEffect(()=>{null!=f&&f[0].url&&g(!1)},[f]);const E=null==f?void 0:f[0].url,h=(e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))};return o.createElement("div",{className:"sandbox-loader-screen"},o.createElement("div",{className:"sandbox-loader"}),o.createElement("ul",{className:"sandbox-installation-steps"},m.map((e,t)=>o.createElement("li",{key:t,className:"sandbox-step "+(t<i?"sandbox-visible":"")},o.createElement("span",{className:"sandbox-step-text"},u(e)),t<i&&o.createElement(c.CheckCircle,{fill:"#00703C"})))))},ro=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/,maxLength:50},error:"ERR_ACCOUNT_NAME_REQUIRED"},infoMessage:"SANDBOX_SIGNUP_ACCOUNT_NAME_TOOLTIP"},{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,maxLength:64},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"PrivacyComponent",key:"check",type:"component",component:"LoginSignupSelector",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{required:!1,name:"check"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,required:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check",required:!1}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:3,image:"https://images.unsplash.com/photo-1624555130581-1d9cca783bc0",title:"Digital Headquarters for National Health Agencies",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:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:5,image:"https://images.unsplash.com/photo-1536782376847-5c9d14d97cc0",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:6,image:"https://images.unsplash.com/photo-1490730141103-6cac27aaab94",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."}]}],ao=e=>{var l,i,r,s,c,u,d;let{config:m,t:p,isDisabled:v}=e;const{isLoading:g}=Digit.Hooks.useTenants(),{isLoading:f}=Digit.Hooks.useStore.getInitData(),[E,h]=n.useState(null),[y,b]=n.useState(!1),S=a.useHistory(),C=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}}),N=function(e){try{return Promise.resolve(C.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,i,r,a,s,c;h({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&null!==(i=l[0])&&void 0!==i&&i.code?"SANDBOX_SIGNUP_"+(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(s=a.Errors)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.code):"SANDBOX_SIGNUP_ERROR"})},onSuccess:function(e){try{var t,n,o;return S.push({pathname:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/otp`,state:{email:null==e||null===(n=e.Tenants[0])||void 0===n?void 0:n.email,tenant:null==e||null===(o=e.Tenants[0])||void 0===o?void 0:o.code}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},O=()=>{h(null)};let I=[{body:null==m?void 0:m.inputs}];const{mode:w}=Digit.Hooks.useQueryParams();"admin"===w&&!1===(null==I||null===(l=I[0])||void 0===l||null===(i=l.body)||void 0===i||null===(r=i[2])||void 0===r?void 0:r.disable)&&void 0===(null==I||null===(s=I[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(I[0].body[2].disable=!0,I[0].body[2].isMandatory=!1,I[0].body[2].populators.defaultValue=defaultValue);const _=(e,t,n)=>{const o=I[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});b(o)},D=window.innerWidth<=768,T=()=>{var e,n,l,i,r,a;return o.createElement("div",{style:{padding:D?"1rem":"2rem",width:D?"100%":"30%",backgroundColor:"#fff",overflowY:"auto",justifyContent:"center",display:"flex",alignItems:"center",flexDirection:"column"}},o.createElement("div",{className:"employeeBackbuttonAlign",style:{alignSelf:"flex-start",marginBottom:"1rem"}},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:N,isDisabled:v||y,noBoxShadow:!0,inline:!0,submitInForm:!0,config:I,label:null==m||null===(e=m.texts)||void 0===e?void 0:e.submitButtonLabel,secondaryActionLabel:null==m||null===(n=m.texts)||void 0===n?void 0:n.secondaryButtonLabel,onFormValueChange:_,heading:null==m||null===(l=m.texts)||void 0===l?void 0:l.header,className:"sandbox-signup-form",cardClassName:"sandbox-onboarding-wrapper"},o.createElement(Jn,{showTenant:!1})),E&&o.createElement(t.Toast,{type:"error",label:p(null==E?void 0:E.label),onClose:O}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset",marginTop:"auto"}},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(r=i.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};return g||f?o.createElement(t.Loader,null):D?T():o.createElement("div",{style:{display:"flex",height:"100vh"}},o.createElement("div",{style:{width:"70%",position:"relative"}},o.createElement(Kn,{bannerImages:m.bannerImages})),T())};ao.propTypes={loginParams:te.any},ao.defaultProps={loginParams:null};const so=e=>{let{stateCode:t}=e;const{t:i}=l.useTranslation(),{path:r}=a.useRouteMatch(),[s,c]=n.useState(ro),u=Digit.StoreData.getCurrentLanguage(),d=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),a.useHistory()),m=a.useLocation();n.useEffect(()=>{if(!new URLSearchParams(m.search).get("ts")){const e=Date.now();d.replace({pathname:m.pathname,search:"?ts="+e})}},[m,d]);const{data:p,isLoading:v}=Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1});n.useEffect(()=>{c(0==v&&null!=p&&p.config?null==p?void 0:p.config:ro)},[p,v]);const g=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=i(e.texts[n]);return{...e,texts:t}},[s]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+r,exact:!0},o.createElement(ao,{config:g[0],t:i})))},co=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/,maxLength:50},error:"ERR_ACCOUNT_NAME_REQUIRED"}},{isMandatory:!1,key:"PrivacyComponent",key:"check",type:"component",component:"ForgotOrganizationTooltip",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{required:!1,name:"check"}},{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,maxLength:64},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"PrivacyComponent",key:"check",type:"component",component:"LoginSignupSelector",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{required:!1,name:"check"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:3,image:"https://images.unsplash.com/photo-1624555130581-1d9cca783bc0",title:"Digital Headquarters for National Health Agencies",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:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:5,image:"https://images.unsplash.com/photo-1536782376847-5c9d14d97cc0",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:6,image:"https://images.unsplash.com/photo-1490730141103-6cac27aaab94",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."}]}],uo=e=>{var l,i,r,s,c,u,d,m,p;let{config:v,t:g,isDisabled:f}=e;const{isLoading:E}=Digit.Hooks.useTenants(),{isLoading:h}=Digit.Hooks.useStore.getInitData(),[y,b]=n.useState(null),[S,C]=n.useState(!1);a.useHistory();const N={url:"/user-otp/v1/_send",params:{tenantId:null===(l=Digit)||void 0===l||null===(i=l.ULBService)||void 0===i?void 0:i.getStateId()},body:{},config:{enable:!1}},O=Digit.Hooks.useCustomAPIMutationHook(N),I=function(e){try{const t=e.email,n=e.accountName;return Promise.resolve(O.mutate({params:{tenantId:n},body:{otp:{userName:e.email,type:"login",tenantId:n,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l;b({key:"error",label:null==e||null===(n=e.response)||void 0===n||null===(o=n.data)||void 0===o||null===(l=o.error)||void 0===l?void 0:l.message}),setTimeout(w,5e3)},onSuccess:function(e){try{var o;sessionStorage.setItem("otpEmail",t),sessionStorage.setItem("otpTenant",n);const e=function(e,t){const n=(e||"").split("/").filter(Boolean).join("/");return n.includes("/")?`/${n}/employee/user/login/otp`:`/${n}/${t}/employee/user/login/otp`}(null===(o=window)||void 0===o?void 0:o.contextPath,n);return window.location.replace(e),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},w=()=>{b(null)};let _=[{body:null==v?void 0:v.inputs}];const{mode:D}=Digit.Hooks.useQueryParams();"admin"===D&&0==(null==_||null===(r=_[0])||void 0===r||null===(s=r.body)||void 0===s||null===(c=s[2])||void 0===c?void 0:c.disable)&&null==(null==_||null===(u=_[0])||void 0===u||null===(d=u.body)||void 0===d||null===(m=d[2])||void 0===m||null===(p=m.populators)||void 0===p?void 0:p.defaultValue)&&(_[0].body[2].disable=!0,_[0].body[2].isMandatory=!1,_[0].body[2].populators.defaultValue=defaultValue);const T=(e,t,n)=>{const o=_[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});C(o)},A=window.innerWidth<=768,R=()=>{var e,n,l,i,r,a;return o.createElement("div",{style:{padding:A?"1rem":"2rem",width:A?"100%":"30%",backgroundColor:"#fff",overflowY:"auto",justifyContent:"center",display:"flex",alignItems:"center",flexDirection:"column"}},o.createElement("div",{className:"employeeBackbuttonAlign",style:{alignSelf:"flex-start",marginBottom:"1rem"}},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:I,isDisabled:f||S,noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:null==v||null===(e=v.texts)||void 0===e?void 0:e.submitButtonLabel,secondaryActionLabel:null==v||null===(n=v.texts)||void 0===n?void 0:n.secondaryButtonLabel,onFormValueChange:T,heading:null==v||null===(l=v.texts)||void 0===l?void 0:l.header,className:"sandbox-signup-form",cardClassName:"sandbox-onboarding-wrapper"},o.createElement(Jn,{showTenant:!1})),y&&o.createElement(t.Toast,{type:"error",label:g(null==y?void 0:y.label),onClose:w}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset",marginTop:"auto"}},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(r=i.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};return E||h?o.createElement(t.Loader,null):A?R():o.createElement("div",{style:{display:"flex",height:"100vh"}},o.createElement("div",{style:{width:"70%",position:"relative"}},o.createElement(Kn,{bannerImages:v.bannerImages})),R())};uo.propTypes={loginParams:te.any},uo.defaultProps={loginParams:null};const mo=e=>{let{stateCode:t}=e;const{t:i}=l.useTranslation(),{path:r}=a.useRouteMatch(),[s,c]=n.useState(co),u=Digit.StoreData.getCurrentLanguage(),d=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),a.useHistory()),m=a.useLocation();n.useEffect(()=>{if(!new URLSearchParams(m.search).get("ts")){const e=Date.now();d.replace({pathname:m.pathname,search:"?ts="+e})}},[m,d]);const{data:p,isLoading:v}=Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1});n.useEffect(()=>{c(0==v&&null!=p&&p.config?null==p?void 0:p.config:co)},[p,v]);const g=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=i(e.texts[n]);return{...e,texts:t}},[s]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+r,exact:!0},o.createElement(uo,{config:g[0],t:i})))},po=e=>{var t,l,i,r,s;let{stateCode:c,modules:u,appTenants:d,logoUrl:p,logoUrlWhite:v,initData:g,defaultLanding:f="citizen",allowedUserTypes:E=["citizen","employee"]}=e;const h=a.useHistory(),{pathname:y}=a.useLocation(),b=window.innerWidth,S=Digit.ULBService.getCurrentUlb(),C=Digit.UserService.getUser(),{data:N}=Digit.Hooks.useStore.getInitData(),{stateInfo:O}=N||{},I=Digit.UserService.hasAccess(["FSM_DSO"]);let w="CITIZEN"===(null==C||null===(t=C.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(w=!1),n.useEffect(()=>{var e,t,n;null!=y&&y.includes("application-details")||(null!=y&&y.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=y&&y.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=y&&y.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==y?void 0:y.toString())===`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee`&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),(null==y?void 0:y.toString())!==`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`&&(null==y?void 0:y.toString())!==`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`||Digit.SessionStorage.del("WS_DISCONNECTION")},[y]),h.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const _={stateInfo:O,userDetails:C,CITIZEN:w,cityDetails:S,mobileView:b<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:p,logoUrlWhite:v,DSO:I,stateCode:c,modules:u,appTenants:d,sourceUrl:window.location.origin+"/citizen",pathname:y,initData:g};return o.createElement(a.Switch,null,(null==E?void 0:E.some(e=>"employee"==e))&&o.createElement(a.Route,{path:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`},o.createElement(no,_)),(null==E?void 0:E.some(e=>"citizen"==e))&&o.createElement(a.Route,{path:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen`},o.createElement(On,_)),(null==E?void 0:E.some(e=>"employee"==e))&&o.createElement(a.Route,{path:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/no-top-bar/employee`},o.createElement(no,m({},_,{noTopBar:!0}))),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:`/${null===(s=window)||void 0===s?void 0:s.contextPath}/${f}`})))},vo=e=>{var t,n,l,i,r,s,c,u,d,m,p;let{stateCode:v,modules:g,appTenants:f,logoUrl:E,logoUrlWhite:h,initData:y,defaultLanding:b="citizen",allowedUserTypes:S}=e;const{data:C}=Digit.Hooks.useStore.getInitData(),{stateInfo:N}=C||{},O=["user/error"].some(e=>{var t,n;return null===(t=location)||void 0===t||null===(n=t.pathname)||void 0===n?void 0:n.includes(e)}),I=Digit.UserService.getUser();let w="CITIZEN"===(null==I||null===(t=I.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");const _=window.innerWidth<=640;return o.createElement("div",{className:O?"grounded-container":"loginContainer",style:O?{padding:0,paddingTop:w?"0":_&&!w?"3rem":"80px",marginLeft:w||_?"0":"40px"}:{"--banner-url":`url(${null==N?void 0:N.bannerUrl})`,padding:"0px"}},o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:`/${null===(n=window)||void 0===n?void 0:n.globalPath}/user/invalid-url`},o.createElement(lo,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(l=window)||void 0===l?void 0:l.globalPath}/user/sign-up`},o.createElement(so,{stateCode:v})),o.createElement(a.Route,{exact:!0,path:`/${null===(i=window)||void 0===i?void 0:i.globalPath}/user/login`},o.createElement(mo,{stateCode:v})),o.createElement(a.Route,{exact:!0,path:`/${null===(r=window)||void 0===r?void 0:r.globalPath}/user/otp`},o.createElement(eo,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(s=window)||void 0===s?void 0:s.globalPath}/user/setup`},o.createElement(io,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(c=window)||void 0===c?void 0:c.globalPath}/user/url`},o.createElement(oo,null)),(null===(u=window)||void 0===u?void 0:u.globalPath)!==(null===(d=window)||void 0===d?void 0:d.contextPath)&&o.createElement(a.Route,{path:"/"+(null===(m=window)||void 0===m?void 0:m.contextPath)},o.createElement(po,{stateCode:v,modules:g,appTenants:f,logoUrl:E,logoUrlWhite:h,initData:y,defaultLanding:b,allowedUserTypes:S})),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:`/${null===(p=window)||void 0===p?void 0:p.globalPath}/user/sign-up`}))))},go=[d],fo=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):u.compose)(u.applyMiddleware(...go)),Eo=e=>{let{onSelect:i,...r}=e;const{t:a}=l.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,u]=n.useState(!1),[d,m]=n.useState(!1),p=Digit.Utils.getConfigModuleName(),{data:v}=Digit.Hooks.useCustomMDMS(s,p,[{name:"PrivacyPolicy"}],{select:e=>{var t,n;return null==e||null===(t=e[p])||void 0===t||null===(n=t.PrivacyPolicy)||void 0===n?void 0:n.find(e=>{var t;return e.module===(null==r||null===(t=r.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{i("check",c)},[c]),o.createElement(o.Fragment,null,o.createElement("div",{className:"digit-privacy-checkbox digit-privacy-checkbox-align"},o.createElement(t.CheckBox,{label:a("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)},id:"privacy-component-check"}),o.createElement(t.Button,{label:a("ES_PRIVACY_POLICY"),variation:"link",size:"small",onClick:()=>{m(!0)},style:{marginBottom:"1rem",paddingLeft:"0.2rem"}})),d&&o.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:a(null==v?void 0:v.header),onOverlayClick:()=>{m(!1)},footerChildren:[o.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:a("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),o.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:a("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{u(!0),m(!1)}})],sortFooterChildren:!0,onClose:()=>{m(!1)}},o.createElement("div",null,o.createElement("div",{className:"privacy-table"},a("DIGIT_TABLE_OF_CONTENTS")),o.createElement("ul",null,null==v?void 0:v.contents.map((e,n)=>o.createElement("li",{key:n,style:{display:"flex",alignItems:"center"}},o.createElement("span",{style:{marginRight:"0.5rem"}},n+1,". "),o.createElement(t.Button,{label:a(e.header),variation:"link",size:"medium",onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})})(null==e?void 0:e.header)},style:{justifyContent:"flex-start"}}))))),null==v?void 0:v.contents.map((e,t)=>o.createElement("div",{key:t,id:null==e?void 0:e.header},o.createElement("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"}},a(e.header)),e.descriptions.map((e,t)=>o.createElement("div",{key:t,style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"}},o.createElement("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"}},"points"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc"}},"•"),"step"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"}},t+1,". "),a(e.text)),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&o.createElement("div",{className:"policy-subdescription"},e.subDescriptions.map((e,t)=>o.createElement("div",{key:t,className:"policy-subdescription-points"},"points"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"}},"•"),"step"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"}},t+1,". "),null===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"}}," "),a(e.text))))))))))},ho=e=>{var n,i,s;let{stateCode:c,enabledModules:d,moduleReducers:m,defaultLanding:p,allowedUserTypes:v}=e;const{isLoading:g,data:f={}}=Digit.Hooks.useInitStore(c,d);if(g)return o.createElement(t.Loader,{page:!0,variant:"PageLoader"});const E=function(e,t){return void 0===t&&(t={}),u.createStore(((e,t)=>{return u.combineReducers({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return{...e,selectedLanguage:t.payload};default:return e}}),...t});var n})(e,t),fo)}(f,m(f))||{};return l.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",Eo),o.createElement(r.Provider,{store:E},o.createElement(a.BrowserRouter,null,o.createElement(t.BodyContainer,null,Digit.Utils.getMultiRootTenant()?o.createElement(vo,{initData:f,stateCode:c,modules:null==f?void 0:f.modules,appTenants:f.tenants,logoUrl:null==f||null===(n=f.stateInfo)||void 0===n?void 0:n.logoUrl,logoUrlWhite:null==f||null===(i=f.stateInfo)||void 0===i?void 0:i.logoUrlWhite,defaultLanding:p,allowedUserTypes:v}):o.createElement(po,{initData:f,stateCode:c,modules:null==f?void 0:f.modules,appTenants:f.tenants,logoUrl:null==f||null===(s=f.stateInfo)||void 0===s?void 0:s.logoUrl,defaultLanding:p,allowedUserTypes:v}))))},yo={SelectOtp:tt,ChangeCity:be,ChangeLanguage:Se,LoginSignupSelector:e=>{let{onSelect:i,...r}=e;const{t:a}=l.useTranslation(),[s,c]=n.useState(!0);n.useEffect(()=>{i("check",s)},[s]);const u=window.location.href.includes("sandbox-ui/user/sign-up");return o.createElement(o.Fragment,null,o.createElement("div",{className:"loginSignUpSelector",style:{marginTop:"-2rem"}},o.createElement(t.Button,u?{label:a("SB_ALREADY_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/user/login`)},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}:{label:a("SB_DONT_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/user/sign-up`)},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}})))},ForgotOrganizationTooltip:e=>{const{t:i}=l.useTranslation(),[r,a]=n.useState(!1),s=n.useRef(null);return n.useEffect(()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&a(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),o.createElement("div",{ref:s,className:"loginSignUpSelector",style:{position:"relative",marginTop:"-2rem"}},o.createElement(t.Button,{label:i("SB_FORGOTORGANIZATION_TOOLTIP"),variation:"link",size:"small",onClick:()=>a(e=>!e),style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}),r&&o.createElement("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:1e3,fontSize:"0.875rem"}},i("SB_FORGOTORGANIZATION_TOOLTIP_TEXT")))},OtpComponent:e=>{var i,r;let{onSelect:c,...u}=e;const{t:d}=l.useTranslation(),[m,p]=(a.useLocation(),n.useState(null)),[v,g]=n.useState({}),[f,E]=n.useState(!0),[h,y]=n.useState(30),b=()=>{p(null)};et(()=>{y(h-1)},h>0?1e3:null),n.useEffect(()=>{c("OtpComponent",v)},[v]);const S={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(i=u.props)||void 0===i?void 0:i.code},body:{},config:{enable:!1}},C=Digit.Hooks.useCustomAPIMutationHook(S);return o.createElement(n.Fragment,null,o.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-email",style:{fontWeight:"bold"}},null==u||null===(r=u.props)||void 0===r?void 0:r.email),o.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{g({...v,otp:e})},value:null==v?void 0:v.otp}),h>0?o.createElement(t.CardText,{className:"sandbox-resend-otp"},`${d("CS_RESEND_ANOTHER_OTP")} ${h} ${d("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return y(30),Promise.resolve(C.mutate({body:{otp:{userName:null==u||null===(e=u.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==u||null===(t=u.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,i,r,a,s;p({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&l[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r||null===(a=r.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(b,5e3)},onSuccess:function(e){try{return p({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(b,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!f&&o.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),m&&o.createElement(t.Toast,{type:null==m?void 0:m.key,label:d(null==m?void 0:m.label),onClose:b}))},PrivacyComponent:Eo};exports.DigitUI=e=>{let{stateCode:t,registry:l,enabledModules:r,moduleReducers:a,defaultLanding:s,allowedUserTypes:c}=e;const[u,d]=n.useState(Digit.Utils.getPrivacyObject()||{}),m=(Digit.UserService.getType(),new i.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),p=Digit.Contexts.ComponentProvider,v=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),o.createElement("div",null,o.createElement(ae,null,o.createElement(i.QueryClientProvider,{client:m},o.createElement(p.Provider,{value:l},o.createElement(v.Provider,{value:{privacy:null==u?void 0:u[window.location.pathname],resetPrivacy:e=>{Digit.Utils.setPrivacyObject({}),d({})},getPrivacy:()=>{const e=Digit.Utils.getPrivacyObject();return d(e),e},updatePrivacyDescoped:e=>{const t=Digit.Utils.getAllPrivacyObject(),n={...t,[window.location.pathname]:e};Digit.Utils.setPrivacyObject({...n}),d((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{d(Digit.Utils.updatePrivacy(e,t)||{})}}},o.createElement(ho,{stateCode:t,enabledModules:r,moduleReducers:a,defaultLanding:s,allowedUserTypes:c}))))))},exports.initCoreComponents=()=>{Object.entries(yo).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@egovernments/digit-ui-components"),n=require("react"),o=e(n),l=require("react-i18next"),i=require("react-query"),r=require("react-redux"),a=require("react-router-dom"),s=require("@egovernments/digit-ui-react-components"),c=require("@egovernments/digit-ui-svg-components"),u=require("redux"),d=e(require("redux-thunk"));function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}function p(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var v="function"==typeof Symbol&&Symbol.for,f=v?Symbol.for("react.element"):60103,g=v?Symbol.for("react.portal"):60106,E=v?Symbol.for("react.fragment"):60107,h=v?Symbol.for("react.strict_mode"):60108,y=v?Symbol.for("react.profiler"):60114,b=v?Symbol.for("react.provider"):60109,S=v?Symbol.for("react.context"):60110,C=v?Symbol.for("react.async_mode"):60111,N=v?Symbol.for("react.concurrent_mode"):60111,O=v?Symbol.for("react.forward_ref"):60112,I=v?Symbol.for("react.suspense"):60113,w=v?Symbol.for("react.suspense_list"):60120,_=v?Symbol.for("react.memo"):60115,D=v?Symbol.for("react.lazy"):60116,T=v?Symbol.for("react.block"):60121,A=v?Symbol.for("react.fundamental"):60117,L=v?Symbol.for("react.responder"):60118,R=v?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case f:switch(e=e.type){case C:case N:case E:case y:case h:case I:return e;default:switch(e=e&&e.$$typeof){case S:case O:case D:case _:case b:return e;default:return t}}case g:return t}}}function P(e){return x(e)===N}var M={AsyncMode:C,ConcurrentMode:N,ContextConsumer:S,ContextProvider:b,Element:f,ForwardRef:O,Fragment:E,Lazy:D,Memo:_,Portal:g,Profiler:y,StrictMode:h,Suspense:I,isAsyncMode:function(e){return P(e)||x(e)===C},isConcurrentMode:P,isContextConsumer:function(e){return x(e)===S},isContextProvider:function(e){return x(e)===b},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===f},isForwardRef:function(e){return x(e)===O},isFragment:function(e){return x(e)===E},isLazy:function(e){return x(e)===D},isMemo:function(e){return x(e)===_},isPortal:function(e){return x(e)===g},isProfiler:function(e){return x(e)===y},isStrictMode:function(e){return x(e)===h},isSuspense:function(e){return x(e)===I},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===E||e===N||e===y||e===h||e===I||e===w||"object"==typeof e&&null!==e&&(e.$$typeof===D||e.$$typeof===_||e.$$typeof===b||e.$$typeof===S||e.$$typeof===O||e.$$typeof===A||e.$$typeof===L||e.$$typeof===R||e.$$typeof===T)},typeOf:x},k=p(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case c:case u:case l:case r:case i:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case a:return g;default:return t}}case o:return t}}}var S=u,C=s,N=a,O=n,I=d,w=l,_=f,D=v,T=o,A=r,L=i,R=m,x=!1;function P(e){return b(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=C,t.ContextProvider=N,t.Element=O,t.ForwardRef=I,t.Fragment=w,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=A,t.StrictMode=L,t.Suspense=R,t.isAsyncMode=function(e){return x||(x=!0,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.")),P(e)||b(e)===c},t.isConcurrentMode=P,t.isContextConsumer=function(e){return b(e)===s},t.isContextProvider=function(e){return b(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===l},t.isLazy=function(e){return b(e)===f},t.isMemo=function(e){return b(e)===v},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===r},t.isStrictMode=function(e){return b(e)===i},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===r||e===i||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===h||e.$$typeof===y||e.$$typeof===g)},t.typeOf=b}()}),U=p(function(e){e.exports="production"===process.env.NODE_ENV?M:k}),B=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;function H(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var z=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,l=H(e),i=1;i<arguments.length;i++){for(var r in n=Object(arguments[i]))F.call(n,r)&&(l[r]=n[r]);if(B){o=B(n);for(var a=0;a<o.length;a++)j.call(n,o[a])&&(l[o[a]]=n[o[a]])}}return l},G="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",V=Function.call.bind(Object.prototype.hasOwnProperty),W=function(){};if("production"!==process.env.NODE_ENV){var Q=G,X={},q=V;W=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function Z(e,t,n,o,l){if("production"!==process.env.NODE_ENV)for(var i in e)if(q(e,i)){var r;try{if("function"!=typeof e[i]){var a=Error((o||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}r=e[i](t,i,o,n,null,Q)}catch(e){r=e}if(!r||r instanceof Error||W((o||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof r+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),r instanceof Error&&!(r.message in X)){X[r.message]=!0;var s=l?l():"";W("Failed "+n+" type: "+r.message+(null!=s?s:""))}}}Z.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(X={})};var Y=Z,$=function(){};function J(){return null}function K(){}function ee(){}"production"!==process.env.NODE_ENV&&($=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),ee.resetWarningCache=K;var te=p(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,o={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:r(J),arrayOf:function(e){return r(function(t,n,o,l,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new i("Invalid "+l+" `"+r+"` of type `"+u(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,o,l,r+"["+s+"]",G);if(c instanceof Error)return c}return null})},element:r(function(t,n,o,l,r){var a=t[n];return e(a)?null:new i("Invalid "+l+" `"+r+"` of type `"+u(a)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:r(function(e,t,n,o,l){var r=e[t];return U.isValidElementType(r)?null:new i("Invalid "+o+" `"+l+"` of type `"+u(r)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return r(function(t,n,o,l,r){var a;return t[n]instanceof e?null:new i("Invalid "+l+" `"+r+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:r(function(e,t,n,o,l){return c(e[t])?null:new i("Invalid "+o+" `"+l+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return r(function(t,n,o,l,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var a=t[n],s=u(a);if("object"!==s)return new i("Invalid "+l+" `"+r+"` of type `"+s+"` supplied to `"+o+"`, expected an object.");for(var c in a)if(V(a,c)){var d=e(a,c,o,l,r+"."+c,G);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&$(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),J;function t(t,n,o,r,a){for(var s=t[n],c=0;c<e.length;c++)if(l(s,e[c]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new i("Invalid "+r+" `"+a+"` of value `"+String(s)+"` supplied to `"+o+"`, expected one of "+u+".")}return r(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&$("Invalid argument supplied to oneOfType, expected an instance of array."),J;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return $("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),J}return r(function(t,n,o,l,r){for(var a=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,o,l,r,G);if(null==c)return null;c.data&&V(c.data,"expectedType")&&a.push(c.data.expectedType)}return new i("Invalid "+l+" `"+r+"` supplied to `"+o+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return r(function(t,n,o,l,r){var a=t[n],c=u(a);if("object"!==c)return new i("Invalid "+l+" `"+r+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(o,l,r,m,d(p));var v=p(a,m,o,l,r+"."+m,G);if(v)return v}return null})},exact:function(e){return r(function(t,n,o,l,r){var a=t[n],c=u(a);if("object"!==c)return new i("Invalid "+l+" `"+r+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");var m=z({},t[n],e);for(var p in m){var v=e[p];if(V(e,p)&&"function"!=typeof v)return s(o,l,r,p,d(v));if(!v)return new i("Invalid "+l+" `"+r+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=v(a,p,o,l,r+"."+p,G);if(f)return f}return null})}};function l(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function r(e){function t(t,n,o,l,r,a,s){if(l=l||"<<anonymous>>",a=a||o,s!==G){var c=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");throw c.name="Invariant Violation",c}return null==n[o]?t?new i(null===n[o]?"The "+r+" `"+a+"` is marked as required in `"+l+"`, but its value is `null`.":"The "+r+" `"+a+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(n,o,l,r,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return r(function(t,n,o,l,r,a){var s=t[n];return u(s)!==e?new i("Invalid "+l+" `"+r+"` of type `"+d(s)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,o,l){return new i((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+l+"`.")}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var l,i=o.call(t);if(o!==t.entries){for(;!(l=i.next()).done;)if(!c(l.value))return!1}else for(;!(l=i.next()).done;){var r=l.value;if(r&&!c(r[1]))return!1}return!0;default:return!1}}function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=u(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function m(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,o.checkPropTypes=Y,o.resetWarningCache=Y.resetWarningCache,o.PropTypes=o,o}(U.isElement):function(){function e(e,t,n,o,l,i){if(i!==G){var r=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");throw r.name="Invariant Violation",r}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ee,resetWarningCache:K};return n.PropTypes=n,n}()});const ne=e=>{let{src:t,alt:n="Image not found",decorative:l=!1,ariaLabel:i="No Image description set",ariaLabelledby:r="no-image-description",...a}=e;const s={};return l?s.alt="":n?s.alt=n:i?s["aria-label"]=i:r?s["aria-labelledby"]=r:console.warn("AccessibleImage: Missing alt, aria-label, or aria-labelledby for non-decorative image."),o.createElement("img",m({src:t},s,a))};ne.propTypes={src:te.string.isRequired,alt:te.string,decorative:te.bool,ariaLabel:te.string,ariaLabelledby:te.string};const oe={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"}},le={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"}},ie=e=>{var t;const{type:n="error"}=Digit.Hooks.useQueryParams(),i=null==e||null===(t=e.errorData)||void 0===t?void 0:t.module,{t:r}=l.useTranslation(),a=i?le[i]:oe[n];return o.createElement("div",{className:"error-boundary"},o.createElement("div",{className:"error-container"},o.createElement(ne,{src:a.imgUrl,alt:"error"}),o.createElement("h1",null,r(a.infoMessage)),o.createElement("button",{onClick:()=>{var t;i?null==e||null===(t=e.errorData)||void 0===t||t.action():e.goToHome()}},r(a.buttonInfo))))},re=()=>{var e,t;const n="employee"===Digit.UserService.getType()?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/error`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/error`;return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=n),o.createElement("span",null)};class ae extends o.Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1,module:null,action:null,info:null}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack,module:null==e?void 0:e.module,action:null==e?void 0:e.action,info:null==e?void 0:e.info}}componentDidCatch(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})}render(){return this.state.hasError?o.createElement("div",{className:"error-boundary"},o.createElement(re,null),o.createElement(ie,{initData:this.props.initData,errorData:this.state})):this.props.children}}const se=require("@egovernments/digit-ui-svg-components"),ce=e=>{var i;const{isLoading:r,data:s}=Digit.Hooks.useAccessControl(),c=Digit.Utils.getMultiRootTenant(),{t:u}=l.useTranslation(),d=a.useHistory(),p=Digit.ULBService.getStateId();let v=null;const[f,g]=n.useState([{}]),{data:E}=Digit.Hooks.useCustomMDMS(p,"HomeScreenOrder",[{name:"CardsAndLinksOrder"}],{select:e=>{var t;return null==e||null===(t=e.HomeScreenOrder)||void 0===t?void 0:t.CardsAndLinksOrder}}),{data:h}=Digit.Hooks.useCustomMDMS(p,"SandBoxLanding",[{name:"AdditionalModuleLinks"}],{select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.AdditionalModuleLinks}});n.useEffect(()=>{g(E)},[E]);const y=(e,t)=>{if(!e||!t)return null;const n=null==h?void 0:h.find(t=>t.moduleName===e.module),o=null==n?void 0:n[t],l=null==e?void 0:e.links;return(null==l?void 0:l.find(e=>(null==e?void 0:e.displayName)===o))||null},b=e=>{var t;const n=null==h?void 0:h.find(t=>t.moduleName===e.module);return null==e||null===(t=e.links)||void 0===t?void 0:t.filter(e=>{const t=e.displayName;return"Configure_master"!==t&&t!==(null==n?void 0:n.howItWorksLink)&&t!==(null==n?void 0:n.userManualLink)})},S=null==s?void 0:s.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,n)=>{const o=n.parentModule;e[o]||(e[o]={module:o,kpis:[],icon:n.leftIcon?Digit.Utils.iconRender({iconName:n.leftIcon,iconFill:"white",CustomSVG:t.CustomSVG,Components:se}):"",label:Digit.Utils.locale.getTransformedLocale(o+"_CARD_HEADER"),links:[]});const l=function(e){var t,n;if(void 0===e&&(e=""),"/"!=e){if(-1===(null===(t=e)||void 0===t?void 0:t.indexOf("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)))){let t=null;return t=c?e=e.replace("/sandbox-ui/employee",`/sandbox-ui/${p}/employee`):e,t}return e}}(n.navigationURL),i=l.indexOf("?");return e[o].links.push({link:l,icon:n.leftIcon,queryParams:-1===i?null:l.substring(i),label:u(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}`)),displayName:n.displayName}),e},{});if(r)return o.createElement(t.Loader,{page:!1,variant:"PageLoader"});if(!S)return"";v=c?(e=>Object.keys(e).sort((e,t)=>{var n,o;return((null==f||null===(n=f.find(t=>"card"===t.moduleType&&t.name===e))||void 0===n?void 0:n.order)||null)-((null==f||null===(o=f.find(e=>"card"===e.moduleType&&e.name===t))||void 0===o?void 0:o.order)||null)}).reduce((t,n)=>{var o,l;const i=null==e||null===(o=e[n])||void 0===o||null===(l=o.links)||void 0===l?void 0:l.sort((e,t)=>{var o,l;const i=null==e?void 0:e.displayName,r=null==t?void 0:t.displayName;return((null==f||null===(o=f.find(e=>"link"===e.moduleType&&e.name===`${n}.${i.replace(/\s+/g,"_")}`))||void 0===o?void 0:o.order)||null)-((null==f||null===(l=f.find(e=>"link"===e.moduleType&&e.name===`${n}.${r.replace(/\s+/g,"_")}`))||void 0===l?void 0:l.order)||null)});return t[n]={...e[n],links:i},t},{}))(S):S;const C=null===(i=Object.keys(v))||void 0===i?void 0:i.map((e,n)=>{var l,i;const r=null===(l=v)||void 0===l?void 0:l[e],a=null==r||null===(i=r.links)||void 0===i?void 0:i.find(e=>"Configure_master"===(null==e?void 0:e.displayName)),s=y(r,"howItWorksLink"),c=y(r,"userManualLink"),p={icon:"SupervisorAccount",moduleName:u(null==r?void 0:r.label),metrics:[],links:Digit.Utils.getMultiRootTenant()?b(r):null==r?void 0:r.links,centreChildren:[o.createElement("div",null,u(Digit.Utils.locale.getTransformedLocale("MODULE_CARD_DESC_"+e))),s&&o.createElement(t.Button,{variation:"teritiary",label:null==s?void 0:s.label,icon:null==s?void 0:s.icon,type:"button",size:"medium",onClick:()=>window.open(null==s?void 0:s.link,"_blank"),style:{padding:"0px"}})],endChildren:Digit.Utils.getMultiRootTenant()?[a&&o.createElement(t.Button,{variation:"teritiary",label:null==a?void 0:a.label,icon:null==a?void 0:a.icon,type:"button",size:"medium",onClick:()=>null==d?void 0:d.push(null==a?void 0:a.link),style:{padding:"0px"}}),c&&o.createElement(t.Button,{variation:"teritiary",label:null==c?void 0:c.label,icon:null==c?void 0:c.icon,type:"button",size:"medium",onClick:()=>window.open(null==c?void 0:c.link,"_blank"),style:{padding:"0px"}})]:null};return o.createElement(t.LandingPageCard,m({buttonSize:"medium"},p))});return o.createElement(n.Fragment,null,o.createElement(t.LandingPageWrapper,null,o.Children.map(C,e=>o.cloneElement(e))))},ue=e=>{const{question:i,isLabelLink:r,type:a,actions:u,content:d,lastIndex:m}=e,[p,v]=n.useState(!1),{t:f}=l.useTranslation(),g=Digit.ULBService.getStateId(),E="number"===a?"ol":"ul";return o.createElement("div",{className:"faqs border-none",onClick:()=>v(!p)},o.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},o.createElement("span",null,f(i)),o.createElement("span",{className:p?"faqicon rotate":"faqicon",style:{float:"right"}},o.createElement(c.ArrowForward,null))),o.createElement("div",{className:"faq-answer",style:p?{display:"block"}:{display:"none"}},o.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},f(d)),o.createElement("div",{style:{marginTop:"1rem"}},u&&o.createElement(E,null,u.map((e,n)=>o.createElement("li",{key:n,style:{listStyleType:"ul"===E?"disc":"auto",margin:"8px 0"}},r?null!=e&&e.label?o.createElement(t.Button,{variation:"teritiary",label:f(null==e?void 0:e.label),type:"button",size:"medium",onClick:()=>{if(null!=e&&e.fulllink)window.open(null==e?void 0:e.link,"_blank");else{var t;const n=`https://${window.location.hostname}/${null===(t=window)||void 0===t?void 0:t.globalPath}/${g}`;window.open(`${n}/${null==e?void 0:e.link}`,"_blank")}},style:{padding:"0px"}}):null:null!=e&&e.label?o.createElement("strong",null,f(null==e?void 0:e.label),":"):null,f(null==e?void 0:e.description)))))),m?null:o.createElement("div",{className:"cs-box-border"}))},de=e=>{let{type:t,title:n,content:i,actions:r}=e;const{t:a}=l.useTranslation(),c="number"===t?"ol":"ul";return o.createElement("div",null,o.createElement(s.CardSectionHeader,null,a(n)),o.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},a(i)),o.createElement("div",{style:{marginTop:"1rem"}},r&&o.createElement(c,null,r.map((e,t)=>o.createElement("li",{key:t,style:{listStyleType:"ul"===c?"disc":"auto",margin:"8px 0"}},null!=e&&e.label?o.createElement("strong",null,a(null==e?void 0:e.label),":"):null," ",a(null==e?void 0:e.description))))))},me=e=>{let{faqs:t,type:n}=e;return l.useTranslation(),o.createElement("div",{style:{width:"100%"}},o.createElement("div",{style:{width:"100%"}},t.map((e,l)=>o.createElement(ue,{key:"faq_"+l,question:e.question,answer:e.answer,isLabelLink:e.isLabelLink,type:n,actions:e.answer,content:e.content,lastIndex:l===(null==t?void 0:t.length)-1}))))},pe=e=>{let{cardConfig:n}=e;const{t:i}=l.useTranslation();return o.createElement(t.Card,{className:"sandbox-guide",style:{width:"25rem",height:"47rem",overflowY:"scroll"}},o.createElement(t.CardHeader,null,i("GUIDE_TO_SETUP")),o.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},n.map((e,t)=>"faqs"===(null==e?void 0:e.type)?o.createElement(me,{key:e.id,title:e.title,type:null==e?void 0:e.type,content:e.content,faqs:e.actions}):o.createElement(o.Fragment,null,o.createElement(de,{type:null==e?void 0:e.type,key:e.id,title:e.title,content:e.content,actions:e.actions,style:e.style}),t!==(null==n?void 0:n.length)-1&&o.createElement(s.BreakLine,{style:{width:"100%",border:"1px solid #d6d5d4"}})))))},ve=e=>{const{t:t}=l.useTranslation(),{data:n}=Digit.Hooks.useAccessControl(),i=(Digit.Utils.getMultiRootTenant(),Digit.ULBService.getStateId());return(null==n?void 0:n.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,n)=>{const o=n.parentModule;e[o]||(e[o]={module:o,label:Digit.Utils.locale.getTransformedLocale(o+"_CARD_HEADER"),links:[]});const l=Digit.Utils.transformURL(n.navigationURL,i),r=l.indexOf("?");return e[o].links.push({link:-1===r?l:l.substring(0,r),label:t(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}`)),queryParams:-1===r?null:l.substring(r),description:t(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}_DESCRIPTION`))}),e},{}))?o.createElement(pe,{cardConfig:[{id:1,type:"faqs",actions:[{question:"SANDBOX_FAQ_QUES_14",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_14_LABEL_1",fulllink:!0,link:"https://egov-digit.gitbook.io/digit-sandbox/specifications/user-manual/walkthrough-videos"}]},{question:"SANDBOX_FAQ_QUES_1",content:"SANDBOX_FAQ_CONTENT_1",isLabelLink:!0,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"}]}]}):""},fe=(e,t,n)=>{const o=null==e?void 0:e[""+t];o&&o.map(e=>{Digit.Utils.getMultiRootTenant()&&(e.navigationURL=e.navigationURL.replace("/sandbox-ui/citizen",`/sandbox-ui/${Digit.ULBService.getStateId()}/citizen`)),e.link=e.navigationURL,e.i18nKey=n(e.name)});const l={links:null==o?void 0:o.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:`CITIZEN_${t}_ICON`};var i;return"FSM"===t&&[{role:"FSM_DSO",from:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/fsm/dso-dashboard`,dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,o,i;let{role:r,from:a,loginLink:s,dashoardLink:c}=e;Digit.UserService.hasAccess(r)?null==l||null===(t=l.links)||void 0===t||t.push({link:a,i18nKey:n(c)}):null==l||null===(o=l.links)||void 0===o||o.push({link:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/login`,state:{role:"FSM_DSO",from:a},i18nKey:n(s)})}),l},ge=e=>{let{getCitizenMenu:n,isLoading:i}=e;const{t:r}=l.useTranslation();if(i)return o.createElement(s.Loader,null);const a=Object.keys(n||{});return o.createElement("div",{className:"citizen-all-services-wrapper"},location.pathname.includes("sanitation-ui/citizen/all-services")||location.pathname.includes("sandbox-ui")&&location.pathname.includes("all-services")||location.pathname.includes("digit-studio")&&location.pathname.includes("all-services")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement("div",{className:"citizenAllServiceGrid"},a.map(e=>{var l;const i=fe(n,e,r);var a,c;return(null==i||null===(l=i.links)||void 0===l?void 0:l.length)>0?o.createElement(s.CitizenHomeCard,{key:e,header:r(null==i?void 0:i.header),links:null==i||null===(a=i.links)||void 0===a||null===(c=a.filter(e=>null==e?void 0:e.link))||void 0===c?void 0:c.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)),Icon:()=>(e=>{switch(e){case"PT":return o.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"});case"WS":return o.createElement(t.CustomSVG.WSICon,{className:"fill-path-primary-main"});case"FSM":return o.createElement(t.CustomSVG.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return o.createElement(t.CustomSVG.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return o.createElement(t.CustomSVG.PGRIcon,{className:"fill-path-primary-main"});case"TL":return o.createElement(t.CustomSVG.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return o.createElement(t.CustomSVG.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return o.createElement(t.CustomSVG.BillsIcon,{className:"fill-path-primary-main"});default:return o.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"})}})(e),Info:null,isInfo:!1}):null})))},Ee=e=>{let{modules:l,additionalComponent:i}=e;return o.createElement(n.Fragment,null,o.createElement("div",{className:"employee-app-container digit-home-employee-app"},o.createElement(t.LandingPageWrapper,null,null==l?void 0:l.map((e,t)=>{let{code:n}=e;const l=Digit.ComponentRegistryService.getComponent(n+"Card")||(()=>o.createElement(o.Fragment,null));return o.createElement(l,{key:t})}))),i&&(null==i?void 0:i.length)>0&&i.map(e=>{const t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?o.createElement("div",{className:"additional-component-wrapper"},o.createElement(t,null)):null}))},he=e=>{let{userType:t,modules:n,getCitizenMenu:l,fetchedCitizen:i,isLoading:r,additionalComponent:a}=e;if("citizen"===t)return o.createElement(ge,{modules:n,getCitizenMenu:l,fetchedCitizen:i,isLoading:r});const s=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return Digit.Utils.getRoleBasedHomeCard()?o.createElement("div",{className:s?"homeWrapper":""},o.createElement(ce,{modules:n,additionalComponent:a}),s&&!window.Digit.Utils.browser.isMobile()?o.createElement(ve,null):null):o.createElement(Ee,{modules:n,additionalComponent:a})},ye=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(o=e)&&void 0!==o&&o.includes(t);){var o,l;e=null===(l=e)||void 0===l?void 0:l.replace(t,n)}return e},be=e=>{var l,i;const[r,s]=n.useState(null),[c,u]=n.useState([]),[d,m]=n.useState([]),p=a.useHistory();let v=[];const f=Digit.Utils.getMultiRootTenant();return n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let o=[],l=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>o.push(e.tenantId));let i=o.filter((e,t,n)=>n.indexOf(e)===t);null==i||i.forEach(e=>{var t;l.push({label:"TENANT_TENANTS_"+(null===(t=ye(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),v=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),u(l)},[r]),o.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},f&&1==c.length?o.createElement(t.CardText,{style:{color:"#363636"}},null==c||null===(l=c[0])||void 0===l?void 0:l.value):o.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:c,selected:c.find(e=>e.value===(null==r?void 0:r.value)),optionKey:"label",select:e=>{var t,n,o,l;const i=Digit.SessionStorage.get("citizen.userRequestObject"),r=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.filter(t=>t.tenantId===e.value);if((null==r?void 0:r.length)>0&&(i.info.roles=r,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),s(e),window.location.href.includes(`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee/`)){var a,c;const e=(null===(a=location.state)||void 0===a?void 0:a.from)||`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee`;p.replace(e)}window.location.reload()},freeze:!0,customSelector:o.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(i=ye(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===i?void 0:i.toUpperCase())))}))},Se=e=>{const i=e.dropdown||!1,{data:r,isLoading:a}=Digit.Hooks.useStore.getInitData(),{languages:s,stateInfo:c}=r||{},{t:u}=l.useTranslation(),d=Digit.StoreData.getCurrentLanguage(),[m,p]=n.useState(d),v=e=>{p(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)};return a?null:i?o.createElement("div",null,o.createElement(t.Dropdown,{className:"language-dropdown",option:s,selected:null==s?void 0:s.find(e=>(null==e?void 0:e.value)===d),optionKey:"label",select:v,freeze:!0,customSelector:o.createElement("label",{className:"cp"},u(null==s||null===(f=s.find(e=>(null==e?void 0:e.value)===m))||void 0===f?void 0:f.label))})):o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:"5px"}},"Language"),o.createElement("div",{className:"language-selector"},s.map((e,n)=>o.createElement("div",{className:"language-button-container",key:n},o.createElement(t.Button,{label:e.label,onClick:()=>v(e),variation:e.value===m?"primary":""})))));var f},Ce=e=>{var l,i,r,c,u,d,m,p;let{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:h,userDetails:y,CITIZEN:b,cityDetails:S,mobileView:C,userOptions:N,handleUserDropdownSelection:O,logoUrl:I,logoUrlWhite:w,showLanguageChange:_=!0}=e;const[D,T]=o.useState(null);o.useEffect(function(){try{var e;const t=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCurrentTenantId(),n=null==y||null===(e=y.info)||void 0===e?void 0:e.uuid,o=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t;const n=e.user[0],o=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");T(null==o?void 0:o.at(0))}})}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==D,null==y||null===(l=y.info)||void 0===l?void 0:l.uuid]);const A=Digit.ULBService.getCitizenCurrentTenant(!0);let L=a.useHistory();const{pathname:R}=a.useLocation(),{data:{unreadCount:x}={},isSuccess:P}=Digit.Hooks.useNotificationCount({tenantId:A,config:{enabled:"EMPLOYEE"!==(null===(M=Digit.UserService)||void 0===M||null===(k=M.getUser())||void 0===k||null===(U=k.info)||void 0===U?void 0:U.type)&&"CITIZEN"===(null===(B=Digit.UserService)||void 0===B||null===(F=B.getUser())||void 0===F||null===(j=F.info)||void 0===j?void 0:j.type)&&!!A}});var M,k,U,B,F,j;if(b)return o.createElement("div",null,o.createElement(s.TopBar,{img:null==f?void 0:f.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:g(!0)},logoUrl:null==f?void 0:f.logoUrlWhite,onLogout:h,userDetails:y,notificationCount:x<99?x:99,notificationCountLoaded:P,cityOfCitizenShownBesideLogo:v(A),onNotificationIconClick:function(){var e;L.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/engagement/notifications`)},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,o,l;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&[`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/select-language`,`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/select-location`].includes(e)})(R),changeLanguage:C?null:o.createElement(Se,{dropdown:!0})}));const H=!(null==y||!y.access_token),z=null===(i=Digit.ComponentRegistryService)||void 0===i?void 0:i.getComponent("CustomEmployeeTopBar");return z?o.createElement(z,{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:h,userDetails:y,CITIZEN:b,cityDetails:S,mobileView:C,userOptions:N,handleUserDropdownSelection:O,logoUrl:I,showLanguageChange:_,loggedin:H}):o.createElement(t.Header,{actionFields:[o.createElement(be,{dropdown:!0,t:v}),_&&o.createElement(Se,{dropdown:!0}),(null==y?void 0:y.access_token)&&o.createElement(t.Dropdown,{option:N,optionKey:"name",profilePic:D||(null==y||null===(r=y.info)||void 0===r?void 0:r.name)||(null==y||null===(c=y.info)||void 0===c||null===(u=c.userInfo)||void 0===u?void 0:u.name)||"Employee",select:O,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{g()},className:"digit-employee-header",img:I,logoWidth:"64px",logoHeight:"48px",logo:(H?null==S?void 0:S.logoId:null==f?void 0:f.statelogo)||"https://egov-dev-assets.s3.ap-south-1.amazonaws.com/egov-logo-2025.png",onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:H?null!=S&&null!==(d=S.city)&&void 0!==d&&d.ulbGrade?o.createElement(n.Fragment,null,v(null==S?void 0:S.i18nKey).toUpperCase()," ",v("ULBGRADE_"+(null==S||null===(m=S.city)||void 0===m?void 0:m.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):o.createElement(ne,{className:"state",src:w,alt:"State Logo"}):o.createElement(n.Fragment,null,v(`MYCITY_${null==f||null===(p=f.code)||void 0===p?void 0:p.toUpperCase()}_LABEL`)," ",v("MYCITY_STATECODE_LABEL"))})},Ne=(e,t,n,l)=>[{type:"component",element:"LANGUAGE",action:o.createElement(Se,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}],Oe=e=>{let{onSelect:n,onCancel:i,onDismiss:r,PopupStyles:a,isDisabled:s,hideSubmit:c}=e;const{t:u}=l.useTranslation(),d=[o.createElement("div",null,o.createElement(t.CardText,null,u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",o.createElement("strong",null,u("CORE_LOGOUT_MESSAGE"))))],m=[o.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:i}),o.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:s})],p=[o.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:i})];return o.createElement(t.PopUp,{type:"default",children:d,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:c?p:m,sortFooterButtons:!0,onClose:r,className:"digit-logout-popup-wrapper",onOverlayClick:r,equalWidthButtons:!0,style:a})},Ie=e=>{let{info:t,t:n,countryCode:l}=e;return o.createElement("div",{className:"profile-section"},o.createElement("div",{className:"imageloader imageloader-loaded"},o.createElement(ne,{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,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",alt:"Profile Logo"})),o.createElement("div",{id:"profile-name",className:"label-container name-Profile"},o.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),o.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},o.createElement("div",{className:"label-text"}," ",l?`${l} ${null==t?void 0:t.mobileNumber}`:null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&o.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},o.createElement("div",{className:"label-text"}," ",t.emailId," ")),o.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&o.createElement(be,{t:n,mobileView:!0}))},we={CommonPTIcon:o.createElement(s.PTIcon,{className:"icon"}),OBPSIcon:o.createElement(s.OBPSIcon,{className:"icon"}),propertyIcon:o.createElement(s.PropertyHouse,{className:"icon"}),TLIcon:o.createElement(s.CaseIcon,{className:"icon"}),PGRIcon:o.createElement(s.PGRIcon,{className:"icon"}),FSMIcon:o.createElement(s.FSMIcon,{className:"icon"}),WSIcon:o.createElement(s.WSICon,{className:"icon"}),MCollectIcon:o.createElement(s.MCollectIcon,{className:"icon"}),BillsIcon:o.createElement(s.CollectionIcon,{className:"icon"}),BirthIcon:o.createElement(s.BirthIcon,{className:"icon"}),DeathIcon:o.createElement(s.DeathIcon,{className:"icon"}),FirenocIcon:o.createElement(s.FirenocIcon,{className:"icon"}),HomeIcon:o.createElement(s.HomeIcon,{className:"icon"}),EditPencilIcon:o.createElement(s.EditPencilIcon,{className:"icon"}),LogoutIcon:o.createElement(s.LogoutIcon,{className:"icon"}),Phone:o.createElement(s.Phone,{className:"icon"})},_e=e=>{var t,i,r,c,u;let{linkData:d,islinkDataLoading:p}=e;const{t:v}=l.useTranslation(),f=a.useHistory(),g=a.useLocation(),{pathname:E}=g,{data:h,isFetched:y}=Digit.Hooks.useStore.getInitData(),{stateInfo:b}=h||{},S=Digit.UserService.getUser();let C=window.Digit.Utils.browser.isMobile();const[N,O]=n.useState(!1),[I,w]=n.useState(!1),[_,D]=n.useState(!1),[T,A]=n.useState(null);n.useEffect(()=>{!function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==S||null===(e=S.info)||void 0===e?void 0:e.uuid,o=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){var t,n;null!=e&&null!==(t=e.user)&&void 0!==t&&t.length&&A((null===(n=e.user[0])||void 0===n?void 0:n.countryCode)||null)})}();Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[null==S||null===(t=S.info)||void 0===t?void 0:t.uuid]);const L=()=>{D(!1)};if(p)return o.createElement(s.Loader,null);let R=[...Ne(v,0,()=>{var e;f.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)})];R=R.filter(e=>"LANGUAGE"!==e.element),Digit.ULBService.getCurrentTenantId();const x=e=>{var t,n;let{item:l}=e;const i=(null==l?void 0:l.icon)||(null===(t=l.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),r=i?we[i]:we.BillsIcon;let s;s="component"===l.type?l.action:l.text;const c=()=>o.createElement("span",m({className:"menu-item"},l.populators),r,o.createElement("div",{className:"menu-label"},s));return"external-link"===l.type?o.createElement("a",{href:l.link},o.createElement(c,null)):"link"===l.type?o.createElement(a.Link,{to:null==l?void 0:l.link},o.createElement(c,null)):o.createElement(c,null)};let P;var M,k,U,B,F;return y&&S&&S.access_token&&"CITIZEN"===(null==S||null===(i=S.info)||void 0===i?void 0:i.type)&&(P=o.createElement(Ie,{info:null==S?void 0:S.info,stateName:null==b?void 0:b.name,t:v,countryCode:T}),R=R.filter(e=>"login-btn"!==(null==e?void 0:e.id)),R=[...R,{type:"link",icon:"HomeIcon",element:"HOME",text:v("COMMON_BOTTOM_NAVIGATION_HOME"),link:N?`/${null===(M=window)||void 0===M?void 0:M.contextPath}/employee`:`/${null===(k=window)||void 0===k?void 0:k.contextPath}/citizen`,populators:{onClick:()=>{var e;f.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/all-services`)}}},{text:v("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:()=>{var e;f.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`)}}},{text:v("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{w(!1),D(!0)}}},{text:o.createElement(o.Fragment,null,v("CS_COMMON_HELPLINE"),o.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==h||null===(U=h.tenants)||void 0===U?void 0:U.map(e=>{}),o.createElement("div",{className:"link"},o.createElement("a",{href:"tel:"+(null==h||null===(B=h.tenants)||void 0===B?void 0:B[0].contactNumber)},null==h||null===(F=h.tenants)||void 0===F?void 0:F[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(r=Object.keys(d))||void 0===r||null===(c=r.sort((e,t)=>t.localeCompare(e)))||void 0===c||c.map(e=>{var t,n,o,l,i,r;(null===(t=d[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&R.splice(1,0,{type:null!==(n=d[e][0])&&void 0!==n&&null!==(o=n.sidebarURL)&&void 0!==o&&o.includes(null===(l=window)||void 0===l?void 0:l.contextPath)?"link":"external-link",text:v("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:d[e],icon:null===(i=d[e][0])||void 0===i?void 0:i.leftIcon,link:null===(r=d[e][0])||void 0===r?void 0:r.sidebarURL})}),o.createElement(o.Fragment,null,o.createElement("div",null,o.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),o.createElement("div",{style:{display:"flex",flexDirection:"column",height:C?"calc(100vh - 56px)":"auto",zIndex:"99"}},P,o.createElement("div",{className:"drawer-desktop"},null===(u=R)||void 0===u?void 0:u.map((e,t)=>o.createElement("div",{className:"sidebar-list "+(E===(null==e?void 0:e.link)||E===(null==e?void 0:e.sidebarURL)?"active":""),key:t},o.createElement(x,{item:e}))))),o.createElement("div",null,_&&o.createElement(Oe,{onSelect:()=>{if(Digit.Utils.getMultiRootTenant()){var e;Digit.UserService.logout(),D(!1),window.location.href=`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`}else{var t,n;const e="CITIZEN"===(null===(t=Digit.UserService.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.type);var o;Digit.UserService.logout(),D(!1),e&&(window.location.href=`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/login`)}},onCancel:L,onDismiss:L}))))},De=e=>{var i,r,c,u,d;let{isMobile:m=!1,toggleSidebar:p,onLogout:v,isEmployee:f=!1,linkData:g,islinkDataLoading:E,userProfile:h}=e;Digit.Utils.getMultiRootTenant();const{data:y,isFetched:b}=Digit.Hooks.useStore.getInitData(),S=Digit.StoreData.getCurrentLanguage(),[C,N]=n.useState(null),{languages:O,stateInfo:I}=y||{},w=Digit.UserService.getUser(),[_,D]=n.useState(""),[T,A]=n.useState(null),[L,R]=n.useState([]),[x,P]=n.useState([]),[M,k]=n.useState(S);let U=[];const{isLoading:B,data:F}=Digit.Hooks.useAccessControl(),j=Digit.ULBService.getCurrentTenantId(),{t:H}=l.useTranslation(),z=a.useHistory(),G=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(o=e)&&void 0!==o&&o.includes(t);){var o,l;e=null===(l=e)||void 0===l?void 0:l.replace(t,n)}return e};n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let o=[],l=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>o.push(e.tenantId));let i=o.filter((e,t,n)=>n.indexOf(e)===t);null==i||i.forEach(e=>{var t;l.push({label:H("TENANT_TENANTS_"+(null===(t=G(e,".","_"))||void 0===t?void 0:t.toUpperCase())),value:e})}),U=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),R(l)},[T]);const V=()=>{Digit.clikOusideFired=!0,p(!1)};n.useEffect(()=>{C||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==w||null===(e=w.info)||void 0===e?void 0:e.uuid,o=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){var t,n;const o=null==e||null===(t=e.user)||void 0===t?void 0:t[0];if(o){const e=Digit.UserService.getUser();Digit.UserService.setUser({...e,info:o})}if(e&&e.user&&null!=e&&null!==(n=e.user)&&void 0!==n&&n.length){var l;const t=e.user[0],n=null==t||null===(l=t.photo)||void 0===l?void 0:l.split(",");N(null==n?void 0:n.at(0))}})}();Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[C]);const W=e=>{let t=null;var n,o;Digit.Utils.getMultiRootTenant()?(t=f?e.replace("/sandbox-ui/employee",`/sandbox-ui/${j}/employee`):e.replace("/sandbox-ui/citizen",`/sandbox-ui/${j}/citizen`),z.push(t),p()):(z.push("/"===e[0]?`/${null===(n=window)||void 0===n?void 0:n.contextPath}/${f?"employee":"citizen"}${e}`:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/${f?"employee":"citizen"}/${e}`),p())};if(E||B)return o.createElement(t.Loader,null);let Q=[{id:"login-btn",element:"LOGIN",text:H("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:()=>{var e,t;z.push(f?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/language-selection`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/login`),V()}}}];b&&w&&w.access_token&&(Q=Q.filter(e=>"login-btn"!==(null==e?void 0:e.id)));let X={};if(f){var q;null==F||F.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==_&&""!==e.path){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),X[t]?X[t].push(e):X[t]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(_.toLowerCase())){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),X[t]?X[t].push(e):X[t]=[e]}});const e=Object.keys(X);for(let t=0;t<(null==e?void 0:e.length);t++){var Z,Y,$,J,K;const n=null===(Z=X[e[t]][0])||void 0===Z||null===(Y=Z.displayName)||void 0===Y||null===($=Y.toUpperCase())||void 0===$?void 0:$.replace(/[ -]/g,"_"),o=null===(J=e[t])||void 0===J||null===(K=J.toUpperCase())||void 0===K?void 0:K.replace(/[ -]/g,"_");var ee,te,ne,oe;-1===X[e[t]][0].path.indexOf(".")?Q.splice(1,0,{type:"link",text:H("ACTION_TEST_"+n),link:null===(ee=X[e[t]][0])||void 0===ee?void 0:ee.navigationURL,icon:null===(te=X[e[t]][0])||void 0===te?void 0:te.leftIcon,populators:{onClick:()=>{var n;z.push(null===(n=X[e[t]][0])||void 0===n?void 0:n.navigationURL),V()}}}):Q.splice(1,0,{type:"dynamic",moduleName:H("ACTION_TEST_"+o),links:null===(ne=X[e[t]])||void 0===ne?void 0:ne.map(e=>{var t,n;return{...e,displayName:H("ACTION_TEST_"+(null==e||null===(t=e.displayName)||void 0===t||null===(n=t.toUpperCase())||void 0===n?void 0:n.replace(/[ -]/g,"_")))}}),icon:null===(oe=X[e[t]][1])||void 0===oe?void 0:oe.leftIcon})}const t=Q.findIndex(e=>"HOME"===e.element),n=Q.splice(t,1),o=Q.findIndex(e=>"LANGUAGE"===e.element),l=Q.splice(o,(null===(q=Q)||void 0===q?void 0:q.length)-o);Q.sort((e,t)=>("dynamic"===(null==e?void 0:e.type)?null==e?void 0:e.moduleName:null==e?void 0:e.text).localeCompare("dynamic"===(null==t?void 0:t.type)?null==t?void 0:t.moduleName:null==t?void 0:t.text)),(null==n?void 0:n[0])&&Q.splice(0,0,n[0]),Q=(null==l?void 0:l.length)>0?Q.concat(l):Q}else{var le,ie;null===(le=Object.keys(g))||void 0===le||null===(ie=le.sort((e,t)=>t.localeCompare(e)))||void 0===ie||ie.map(e=>{var t,n,o,l,i,r;"digit-ui-links"===(null===(t=g[e][0])||void 0===t?void 0:t.sidebar)&&Q.splice(1,0,{type:null!==(n=g[e][0])&&void 0!==n&&null!==(o=n.sidebarURL)&&void 0!==o&&o.includes(null===(l=window)||void 0===l?void 0:l.contextPath)?"link":"external-link",text:H("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:g[e],icon:null===(i=g[e][0])||void 0===i?void 0:i.leftIcon,link:null===(r=g[e][0])||void 0===r?void 0:r.sidebarURL})})}z.location.pathname.includes("/openlink")&&(Q=Q.filter(e=>"LANGUAGE"===e.element)),Q=null===(i=Q)||void 0===i?void 0:i.map(e=>({...e,label:(null==e?void 0:e.text)||(null==e?void 0:e.moduleName)||"",icon:null!=e&&e.icon?null==e?void 0:e.icon:void 0}));let re="";var ae;re=Digit.Utils.getMultiRootTenant()?H("TENANT_TENANTS_"+j):H("TENANT_TENANTS_"+(null===(ae=G(Digit.ULBService.getCurrentTenantId(),".","_"))||void 0===ae?void 0:ae.toUpperCase()));const se=null===(r=Q)||void 0===r?void 0:r.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?{...e,children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>({...e,label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}:e}),ce=null==L?void 0:L.map(e=>({...e,type:"custom",key:"city"})),ue=null==O?void 0:O.map(e=>({...e,type:"custom",key:"language",icon:"Language"})),de=[{label:"HOME",value:"HOME",icon:"Home",type:"custom",key:"home"},{label:re,value:re,children:(null==ce?void 0:ce.length)>0?ce:void 0,type:"custom",icon:"LocationCity",key:"city"},{label:H("Language"),children:(null==ue?void 0:ue.length)>0?ue:void 0,type:"custom",icon:"Language",key:"language"},...w&&w.access_token?[{label:H("EDIT_PROFILE"),type:"custom",icon:"Edit",key:"editProfile"}]:[],{label:H("Modules"),icon:"DriveFileMove",children:se}];return m?o.createElement(t.Hamburger,{items:de,profileName:null==w||null===(c=w.info)||void 0===c?void 0:c.name,profileNumber:null!=w&&null!==(u=w.info)&&void 0!==u&&u.countryCode?`${w.info.countryCode} ${w.info.mobileNumber}`:null==w||null===(d=w.info)||void 0===d?void 0:d.mobileNumber,theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:v,hideUserManuals:!0,profile:C||void 0,isSearchable:!0,onSelect:e=>{let{item:t,index:n,parentIndex:o}=e;return(e=>{let{item:t}=e;if(null!=t&&t.navigationURL)W(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)W(null==t?void 0:t.link);else{if("custom"!==(null==t?void 0:t.type))return;switch(null==t?void 0:t.key){case"home":z.push(f?`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen`),p();break;case"editProfile":h(),p();break;case"language":k((n=t).value),sessionStorage.setItem("Citizen.locale.changed","true"),Digit.LocalizationService.changeLanguage(n.value,I.code),p();break;case"city":(e=>{var t,n,o,l;const i=Digit.SessionStorage.get("citizen.userRequestObject"),r=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.filter(t=>t.tenantId===e.value);if((null==r?void 0:r.length)>0&&(i.info.roles=r,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),A(e),window.location.href.includes(`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee/`)){var a,s;const e=(null===(a=location.state)||void 0===a?void 0:a.from)||`/${null===(s=window)||void 0===s?void 0:s.contextPath}/employee`;z.replace(e)}window.location.reload()})(t),p()}}var n,o,l})({item:t,index:n,parentIndex:o})}}):o.createElement(_e,{logout:v})};var Te=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(p(function(e,t){var n;n=e=>(()=>{var t={"./node_modules/css-mediaquery/index.js":(e,t)=>{t.match=function(e,t){return a(e).some(function(e){var n=e.inverse,o="all"===e.type||t.type===e.type;if(o&&n||!o&&!n)return!1;var l=e.expressions.every(function(e){var n=e.feature,o=e.modifier,l=e.value,i=t[n];if(!i)return!1;switch(n){case"orientation":case"scan":return i.toLowerCase()===l.toLowerCase();case"width":case"height":case"device-width":case"device-height":l=u(l),i=u(i);break;case"resolution":l=c(l),i=c(i);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":l=s(l),i=s(i);break;case"grid":case"color":case"color-index":case"monochrome":l=parseInt(l,10)||1,i=parseInt(i,10)||0}switch(o){case"min":return i>=l;case"max":return i<=l;default:return i===l}});return l&&!n||!l&&n})},t.parse=a;var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,o=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,l=/^(?:(min|max)-)?(.+)/,i=/(em|rem|px|cm|mm|in|pt|pc)?$/,r=/(dpi|dpcm|dppx)?$/;function a(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),i=t[1],r=t[2],a=t[3]||"",s={};return s.inverse=!!i&&"not"===i.toLowerCase(),s.type=r?r.toLowerCase():"all",a=a.match(/\([^\)]+\)/g)||[],s.expressions=a.map(function(e){var t=e.match(o),n=t[1].toLowerCase().match(l);return{modifier:n[1],feature:n[2],value:t[2]}}),s})}function s(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function c(e){var t=parseFloat(e);switch(String(e).match(r)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function u(e){var t=parseFloat(e);switch(String(e).match(i)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},"./node_modules/hyphenate-style-name/index.js":(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});var o=/[A-Z]/g,l=/^ms-/,i={};function r(e){return"-"+e.toLowerCase()}const a=function(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(o,r);return i[e]=l.test(t)?"-"+t:t}},"./node_modules/matchmediaquery/index.js":(e,t,n)=>{var o=n("./node_modules/css-mediaquery/index.js").match,l="undefined"!=typeof window?window.matchMedia:null;function i(e,t,n){var i=this;if(l&&!n){var r=l.call(window,e);this.matches=r.matches,this.media=r.media,r.addListener(a)}else this.matches=o(e,t),this.media=e;function a(e){i.matches=e.matches,i.media=e.media}this.addListener=function(e){r&&r.addListener(e)},this.removeListener=function(e){r&&r.removeListener(e)},this.dispose=function(){r&&r.removeListener(a)}}e.exports=function(e,t,n){return new i(e,t,n)}},"./node_modules/object-assign/index.js":e=>{var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function l(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var r,a,s=l(e),c=1;c<arguments.length;c++){for(var u in r=Object(arguments[c]))n.call(r,u)&&(s[u]=r[u]);if(t){a=t(r);for(var d=0;d<a.length;d++)o.call(r,a[d])&&(s[a[d]]=r[a[d]])}}return s}},"./node_modules/prop-types/checkPropTypes.js":(e,t,n)=>{var o,l=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),i={},r=n("./node_modules/prop-types/lib/has.js");function a(e,t,n,a,s){for(var c in e)if(r(e,c)){var u;try{if("function"!=typeof e[c]){var d=Error((a||"React class")+": "+n+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=e[c](t,c,a,n,null,l)}catch(e){u=e}if(!u||u instanceof Error||o((a||"React class")+": type specification of "+n+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in i)){i[u.message]=!0;var m=s?s():"";o("Failed "+n+" type: "+u.message+(null!=m?m:""))}}}o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},a.resetWarningCache=function(){i={}},e.exports=a},"./node_modules/prop-types/factoryWithTypeCheckers.js":(e,t,n)=>{var o,l=n("./node_modules/react-is/index.js"),i=n("./node_modules/object-assign/index.js"),r=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),a=n("./node_modules/prop-types/lib/has.js"),s=n("./node_modules/prop-types/checkPropTypes.js");function c(){return null}o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,u={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(c),arrayOf:function(e){return p(function(t,n,o,l,i){if("function"!=typeof e)return new m("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new m("Invalid "+l+" `"+i+"` of type `"+E(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,o,l,i+"["+s+"]",r);if(c instanceof Error)return c}return null})},element:p(function(t,n,o,l,i){var r=t[n];return e(r)?null:new m("Invalid "+l+" `"+i+"` of type `"+E(r)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:p(function(e,t,n,o,i){var r=e[t];return l.isValidElementType(r)?null:new m("Invalid "+o+" `"+i+"` of type `"+E(r)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return p(function(t,n,o,l,i){var r;return t[n]instanceof e?null:new m("Invalid "+l+" `"+i+"` of type `"+((r=t[n]).constructor&&r.constructor.name?r.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:p(function(e,t,n,o,l){return g(e[t])?null:new m("Invalid "+o+" `"+l+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return p(function(t,n,o,l,i){if("function"!=typeof e)return new m("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[n],c=E(s);if("object"!==c)return new m("Invalid "+l+" `"+i+"` of type `"+c+"` supplied to `"+o+"`, expected an object.");for(var u in s)if(a(s,u)){var d=e(s,u,o,l,i+"."+u,r);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return o(arguments.length>1?"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]).":"Invalid argument supplied to oneOf, expected an array."),c;function t(t,n,o,l,i){for(var r=t[n],a=0;a<e.length;a++)if(d(r,e[a]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===h(t)?String(t):t});return new m("Invalid "+l+" `"+i+"` of value `"+String(r)+"` supplied to `"+o+"`, expected one of "+s+".")}return p(t)},oneOfType:function(e){if(!Array.isArray(e))return o("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+y(n)+" at index "+t+"."),c}return p(function(t,n,o,l,i){for(var s=[],c=0;c<e.length;c++){var u=(0,e[c])(t,n,o,l,i,r);if(null==u)return null;u.data&&a(u.data,"expectedType")&&s.push(u.data.expectedType)}return new m("Invalid "+l+" `"+i+"` supplied to `"+o+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return p(function(t,n,o,l,i){var a=t[n],s=E(a);if("object"!==s)return new m("Invalid "+l+" `"+i+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return f(o,l,i,c,h(u));var d=u(a,c,o,l,i+"."+c,r);if(d)return d}return null})},exact:function(e){return p(function(t,n,o,l,s){var c=t[n],u=E(c);if("object"!==u)return new m("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");var d=i({},t[n],e);for(var p in d){var v=e[p];if(a(e,p)&&"function"!=typeof v)return f(o,l,s,p,h(v));if(!v)return new m("Invalid "+l+" `"+s+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=v(c,p,o,l,s+"."+p,r);if(g)return g}return null})}};function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){var n={},l=0;function i(i,a,s,c,u,d,p){if(c=c||"<<anonymous>>",d=d||s,p!==r){if(t){var v=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");throw v.name="Invariant Violation",v}if("undefined"!=typeof console){var f=c+":"+s;!n[f]&&l<3&&(o("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+c+"`. 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."),n[f]=!0,l++)}}return null==a[s]?i?new m(null===a[s]?"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,s,c,u,d)}var a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function v(e){return p(function(t,n,o,l,i,r){var a=t[n];return E(a)!==e?new m("Invalid "+l+" `"+i+"` of type `"+h(a)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function f(e,t,n,o,l){return new m((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+l+"`.")}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var l,i=o.call(t);if(o!==t.entries){for(;!(l=i.next()).done;)if(!g(l.value))return!1}else for(;!(l=i.next()).done;){var r=l.value;if(r&&!g(r[1]))return!1}return!0;default:return!1}}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function h(e){if(null==e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){var t=h(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return m.prototype=Error.prototype,u.checkPropTypes=s,u.resetWarningCache=s.resetWarningCache,u.PropTypes=u,u}},"./node_modules/prop-types/index.js":(e,t,n)=>{var o=n("./node_modules/react-is/index.js");e.exports=n("./node_modules/prop-types/factoryWithTypeCheckers.js")(o.isElement,!0)},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":e=>{e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},"./node_modules/prop-types/lib/has.js":e=>{e.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":(e,t)=>{!function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case c:case u:case l:case r:case i:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case a:return g;default:return t}}case o:return t}}}var S=u,C=s,N=a,O=n,I=d,w=l,_=f,D=v,T=o,A=r,L=i,R=m,x=!1;function P(e){return b(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=C,t.ContextProvider=N,t.Element=O,t.ForwardRef=I,t.Fragment=w,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=A,t.StrictMode=L,t.Suspense=R,t.isAsyncMode=function(e){return x||(x=!0,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.")),P(e)||b(e)===c},t.isConcurrentMode=P,t.isContextConsumer=function(e){return b(e)===s},t.isContextProvider=function(e){return b(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===l},t.isLazy=function(e){return b(e)===f},t.isMemo=function(e){return b(e)===v},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===r},t.isStrictMode=function(e){return b(e)===i},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===r||e===i||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===h||e.$$typeof===y||e.$$typeof===g)},t.typeOf=b}()},"./node_modules/react-is/index.js":(e,t,n)=>{e.exports=n("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(e,t,n)=>{function o(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),o=Object.keys(t),l=n.length;if(o.length!==l)return!1;for(var i=0;i<l;i++){var r=n[i];if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))return!1}return!0}function l(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}n.r(t),n.d(t,{shallowEqualArrays:()=>l,shallowEqualObjects:()=>o})},"./src/Component.ts":function(e,t,n){var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=l(n("./src/useMediaQuery.ts"));t.default=function(e){var t=e.children,n=e.device,l=e.onChange,r=o(e,["children","device","onChange"]),a=(0,i.default)(r,n,l);return"function"==typeof t?t(a):a?t:null}},"./src/Context.ts":(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var o=(0,n("react").createContext)(void 0);t.default=o},"./src/index.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.toQuery=t.useMediaQuery=t.default=void 0;var l=o(n("./src/useMediaQuery.ts"));t.useMediaQuery=l.default;var i=o(n("./src/Component.ts"));t.default=i.default;var r=o(n("./src/toQuery.ts"));t.toQuery=r.default;var a=o(n("./src/Context.ts"));t.Context=a.default},"./src/mediaQuery.ts":function(e,t,n){var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)},l=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=i(n("./node_modules/prop-types/index.js")),a=r.default.oneOfType([r.default.string,r.default.number]),s={all:r.default.bool,grid:r.default.bool,aural:r.default.bool,braille:r.default.bool,handheld:r.default.bool,print:r.default.bool,projection:r.default.bool,screen:r.default.bool,tty:r.default.bool,tv:r.default.bool,embossed:r.default.bool},c={orientation:r.default.oneOf(["portrait","landscape"]),scan:r.default.oneOf(["progressive","interlace"]),aspectRatio:r.default.string,deviceAspectRatio:r.default.string,height:a,deviceHeight:a,width:a,deviceWidth:a,color:r.default.bool,colorIndex:r.default.bool,monochrome:r.default.bool,resolution:a,type:Object.keys(s)},u=l(c,["type"]),d=o({minAspectRatio:r.default.string,maxAspectRatio:r.default.string,minDeviceAspectRatio:r.default.string,maxDeviceAspectRatio:r.default.string,minHeight:a,maxHeight:a,minDeviceHeight:a,maxDeviceHeight:a,minWidth:a,maxWidth:a,minDeviceWidth:a,maxDeviceWidth:a,minColor:r.default.number,maxColor:r.default.number,minColorIndex:r.default.number,maxColorIndex:r.default.number,minMonochrome:r.default.number,maxMonochrome:r.default.number,minResolution:a,maxResolution:a},u),m=o(o({},s),d);t.default={all:m,types:s,matchers:c,features:d}},"./src/toQuery.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=o(n("./node_modules/hyphenate-style-name/index.js")),i=o(n("./src/mediaQuery.ts"));t.default=function(e){var t=[];return Object.keys(i.default.all).forEach(function(n){var o=e[n];null!=o&&t.push(function(e,t){var n=(0,l.default)(e);return"number"==typeof t&&(t="".concat(t,"px")),!0===t?n:!1===t?"not ".concat(n):"(".concat(n,": ").concat(t,")")}(n,o))}),t.join(" and ")}},"./src/useMediaQuery.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=n("react"),i=o(n("./node_modules/matchmediaquery/index.js")),r=o(n("./node_modules/hyphenate-style-name/index.js")),a=n("./node_modules/shallow-equal/dist/index.esm.js"),s=o(n("./src/toQuery.ts")),c=o(n("./src/Context.ts")),u=function(e){if(e)return Object.keys(e).reduce(function(t,n){return t[(0,r.default)(n)]=e[n],t},{})},d=function(){var e=(0,l.useRef)(!1);return(0,l.useEffect)(function(){e.current=!0},[]),e.current};t.default=function(e,t,n){var o=function(e){var t=(0,l.useContext)(c.default),n=function(){return u(e)||u(t)},o=(0,l.useState)(n),i=o[0],r=o[1];return(0,l.useEffect)(function(){var e=n();(0,a.shallowEqualObjects)(i,e)||r(e)},[e,t]),i}(t),r=function(e){var t=function(){return function(e){return e.query||(0,s.default)(e)}(e)},n=(0,l.useState)(t),o=n[0],i=n[1];return(0,l.useEffect)(function(){var e=t();o!==e&&i(e)},[e]),o}(e);if(!r)throw new Error("Invalid or missing MediaQuery!");var m=function(e,t){var n=function(){return(0,i.default)(e,t||{},!!t)},o=(0,l.useState)(n),r=o[0],a=o[1],s=d();return(0,l.useEffect)(function(){if(s){var e=n();return a(e),function(){e&&e.dispose()}}},[e,t]),r}(r,o),p=function(e){var t=(0,l.useState)(e.matches),n=t[0],o=t[1];return(0,l.useEffect)(function(){var t=function(e){o(e.matches)};return e.addListener(t),o(e.matches),function(){e.removeListener(t)}},[e]),n}(m),v=d();return(0,l.useEffect)(function(){v&&n&&n(p)},[p]),(0,l.useEffect)(function(){return function(){m&&m.dispose()}},[]),p}},react:t=>{t.exports=e}},n={};function o(e){var l=n[e];if(void 0!==l)return l.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,o),i.exports}return o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o("./src/index.ts")})(),e.exports=n(o)}));const Ae=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),i=Digit.Utils.getMultiRootTenant(),{t:r}=l.useTranslation(),s=a.useHistory(),c=Digit.ULBService.getStateId(),u={};null==n||n.actions.filter(e=>"url"===e.url).forEach(e=>{var t;if(null==e||null===(t=e.path)||void 0===t||t.split("."),""!==(null==e?void 0:e.path)){var n;const t=null==e||null===(n=e.path)||void 0===n?void 0:n.split(".");let o={};t.reduce((n,o,l)=>{if(l!==t.length-1)return n[o]={},n[o];n[o]={item:e}},o),function e(t,n){for(const o in n)n.hasOwnProperty(o)&&("object"!=typeof n[o]||Array.isArray(n[o])?t[o]||(t[o]=n[o]):(t[o]||(t[o]={}),e(t[o],n[o])))}(u,o)}});const d=e=>(e.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:Infinity)-(void 0!==t.orderNumber?t.orderNumber:Infinity)),e.forEach(e=>{e.children&&e.children.length>0&&d(e.children)}),e),m=function(e){const t=(e,n)=>{if(n.item)return{label:r(n.item.displayName),icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL,orderNumber:n.item.orderNumber};const o=Object.keys(n).map(e=>t(e,n[e])),l=function e(t){void 0===t&&(t={});for(const n in t){const o=t[n];if("item"===n&&""!==(null==o?void 0:o.leftIcon))return null==o?void 0:o.leftIcon;if("object"==typeof t[n]&&!Array.isArray(t[n])){const o=e(t[n]);if(o)return o}}return null}(n);return{label:r(e),icon:{icon:l,width:"1.5rem",height:"1.5rem"},children:o}};return Object.keys(e).map(n=>t(n,e[n]))}((e=>{const t=Object.entries(e);return t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0),Object.fromEntries(t)})(u)),p=d(m);return e?o.createElement(t.Loader,null):u?o.createElement(Te,{minWidth:768},o.createElement(t.SideNav,{items:p,hideAccessbilityTools:!0,onSelect:e=>{let{item:t,index:n,parentIndex:o}=e;return(e=>{let{item:t}=e;null!=t&&t.navigationUrl&&function(e,t){var n;if(void 0===e&&(e={}),void 0===t&&(t=""),t&&"/"!==t)if(/^https?:\/\//i.test(t))window.open(t,"_blank","noopener,noreferrer");else if(t.includes("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)))e.push(t);else{const n=window.location.origin;let l;if(i){var o;const n=(null===(o=window)||void 0===o?void 0:o.contextPath)||"sandbox-ui";l=t=t.replace(`/${n}/employee`,`/${n}/${c}/employee`),e.push(l)}else l=n+t,window.location.href=l}}(s,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:o})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}})):""},Le=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:l,handleLogout:i,mobileView:r,userDetails:a,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?o.createElement(De,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:i,linkData:c,islinkDataLoading:u,userProfile:d,isEmployee:!1}):!n&&null!=a&&a.access_token?o.createElement("div",{className:"digit-employeeSidebar"},o.createElement(Ae,{mobileView:r,userDetails:a,modules:s})):o.createElement("div",{className:"digit-citizenSidebar"},o.createElement(De,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:i,isEmployee:!0,userProfile:d}))},Re=e=>{let{t:t,stateInfo:l,userDetails:i,CITIZEN:r,cityDetails:s,mobileView:c,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showSidebar:p=!0,showLanguageChange:v,linkData:f,islinkDataLoading:g}=e;const[E,h]=n.useState(!1),y=a.useHistory(),[b,S]=n.useState(!1),C=()=>{h(!1),S(!0)},N=()=>{S(!1)},O=()=>{h(!E)},I=()=>{var e,t;y.push(r?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/profile`)},w=[{name:t("EDIT_PROFILE"),icon:"Edit",func:I},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:C}];return o.createElement(o.Fragment,null,o.createElement(Ce,{t:t,stateInfo:l,toggleSidebar:O,isSidebarOpen:E,handleLogout:C,userDetails:i,CITIZEN:r,cityDetails:s,mobileView:c,userOptions:w,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showLanguageChange:v}),b&&o.createElement(Oe,{onSelect:()=>{var e,t;const n="CITIZEN"===(null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.type);var o;Digit.UserService.logout(),S(!1),n&&(window.location.href=`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/login`)},onCancel:N,onDismiss:N}),r?r?p&&E&&o.createElement(Le,{t:t,CITIZEN:r,isSidebarOpen:E,toggleSidebar:O,handleLogout:C,mobileView:c,userDetails:i,linkData:f,userProfile:I,islinkDataLoading:g}):null:p&&o.createElement(Le,{t:t,CITIZEN:r,isSidebarOpen:E,toggleSidebar:O,handleLogout:C,mobileView:c,userDetails:i,linkData:f,userProfile:I,islinkDataLoading:g}))},xe=e=>{const{question:t,answer:i,lastIndex:r}=e,[a,s]=n.useState(!1),{t:u}=l.useTranslation();return o.createElement("div",{className:"faqs border-none",onClick:()=>s(!a)},o.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},o.createElement("span",null,u(t)),o.createElement("span",{className:a?"faqicon rotate":"faqicon",style:{float:"right"}},o.createElement(c.ArrowForward,null))),o.createElement("div",{className:"faq-answer",style:a?{display:"block"}:{display:"none"}},o.createElement("span",null,u(i))),r?null:o.createElement("div",{className:"cs-box-border"}))},Pe=e=>{var i,r,a;let{module:s}=e;const c=Digit.UserService.getUser(),{t:u}=((null==c||null===(i=c.info)||void 0===i?void 0:i.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation()),{isLoading:d,data:m}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),p=null==m||null===(r=m.MdmsRes["common-masters"])||void 0===r||null===(a=r.faqs[0])||void 0===a?void 0:a[""+s].faqs;return d?o.createElement(t.Loader,null):o.createElement(n.Fragment,null,o.createElement("div",{className:"faq-page"},o.createElement(t.BackButton,{style:{marginLeft:"unset"}}),o.createElement("div",{style:{marginBottom:"15px"}},o.createElement(t.HeaderComponent,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),o.createElement("div",{className:"faq-list"},p.map((e,t)=>o.createElement(xe,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},Me=()=>{var e,t,n,i,r,c,u,d,p,v,f,g,E,h,y,b,S,C,N,O,I,w,_,D,T,A,L;const{t:R}=l.useTranslation(),x=a.useHistory(),P=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCitizenCurrentTenant(!0),{data:{uiHomePage:M}={},isLoading:k}=Digit.Hooks.useStore.getInitData();let U=window.Digit.Utils.browser.isMobile();const B=()=>{var e,t,n,o,l;return"EMPLOYEE"!==(null===(e=Digit.UserService)||void 0===e||null===(t=e.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.type)&&!(null===(o=Digit.UserService)||void 0===o||null===(l=o.getUser())||void 0===l||!l.access_token)},{data:F,isLoading:j}=Digit.Hooks.useEvents({tenantId:P,variant:"whats-new",config:{enabled:B()}});var H;P||x.push(`/${null===(H=window)||void 0===H?void 0:H.contextPath}/citizen/select-language`);const z=null==M?void 0:M.appBannerDesktop,G=null==M?void 0:M.appBannerMobile,V=null==M?void 0:M.citizenServicesCard,W=null==M?void 0:M.informationAndUpdatesCard,Q=null==M?void 0:M.whatsAppBannerDesktop,X=null==M?void 0:M.whatsAppBannerMobile,q=null==M?void 0:M.whatsNewSection,Z=null==M?void 0:M.redirectURL;var Y,$;Z&&x.push(`/${null===(Y=window)||void 0===Y?void 0:Y.contextPath}/citizen/${Z}`),(null!==(e=window)&&void 0!==e&&null!==(t=e.location)&&void 0!==t&&null!==(n=t.href)&&void 0!==n&&null!==(i=n.includes)&&void 0!==i&&i.call(n,"sanitation-ui")||null!==(r=window)&&void 0!==r&&null!==(c=r.location)&&void 0!==c&&null!==(u=c.href)&&void 0!==u&&null!==(d=u.includes)&&void 0!==d&&d.call(u,"sandbox-ui"))&&x.push(`/${null===($=window)||void 0===$?void 0:$.contextPath}/citizen/all-services`);const J=e=>{window.open(null==e?void 0:e.navigationUrl)},K={header:R(null==V?void 0:V.headerLabel),sideOption:{name:R(null==V||null===(p=V.sideOption)||void 0===p?void 0:p.name),onClick:()=>{var e;return x.push(null==V||null===(e=V.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:R(null==V||null===(v=V.props)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.label),Icon:o.createElement(s.ComplaintIcon,null),onClick:()=>{var e,t;return x.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==V||null===(g=V.props)||void 0===g||null===(E=g[1])||void 0===E?void 0:E.label),Icon:o.createElement(s.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return x.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==V||null===(h=V.props)||void 0===h||null===(y=h[2])||void 0===y?void 0:y.label),Icon:o.createElement(s.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return x.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==V||null===(b=V.props)||void 0===b||null===(S=b[3])||void 0===S?void 0:S.label),Icon:o.createElement(s.OBPSIcon,null),onClick:()=>{var e,t;return x.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}},ee={header:R(null==W?void 0:W.headerLabel),sideOption:{name:R(null==W||null===(C=W.sideOption)||void 0===C?void 0:C.name),onClick:()=>{var e;return x.push(null==W||null===(e=W.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:R(null==W||null===(N=W.props)||void 0===N||null===(O=N[0])||void 0===O?void 0:O.label),Icon:o.createElement(s.HomeIcon,null),onClick:()=>{var e,t;return x.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==W||null===(I=W.props)||void 0===I||null===(w=I[1])||void 0===w?void 0:w.label),Icon:o.createElement(s.Calender,null),onClick:()=>{var e,t;return x.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==W||null===(_=W.props)||void 0===_||null===(D=_[2])||void 0===D?void 0:D.label),Icon:o.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return x.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==W||null===(T=W.props)||void 0===T||null===(A=T[3])||void 0===A?void 0:A.label),Icon:o.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return x.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}};return k?o.createElement(s.Loader,null):o.createElement("div",{className:"HomePageContainer"},o.createElement("div",{className:"HomePageWrapper"},o.createElement("div",{className:"BannerWithSearch"},o.createElement(ne,U?{src:null==G?void 0:G.bannerUrl,alt:"Banner Image"}:{src:null==z?void 0:z.bannerUrl,alt:"Banner Image"}),o.createElement("div",{className:"ServicesSection"},o.createElement(s.CardBasedOptions,m({style:{marginTop:"-30px"}},K)),o.createElement(s.CardBasedOptions,m({style:U?{}:{marginTop:"-30px"}},ee)))),(X||Q)&&o.createElement("div",{className:"WhatsAppBanner"},o.createElement(ne,U?{src:null==X?void 0:X.bannerUrl,onClick:()=>J(X),alt:"Whatsapp Banner"}:{src:null==Q?void 0:Q.bannerUrl,onClick:()=>J(Q),alt:"Whatsapp Banner"})),B()?j?o.createElement(s.Loader,null):o.createElement("div",{className:"WhatsNewSection"},o.createElement("div",{className:"headSection"},o.createElement("h2",null,R(null==q?void 0:q.headerLabel)),o.createElement("p",{onClick:()=>{var e;return x.push(null==q||null===(e=q.sideOption)||void 0===e?void 0:e.navigationUrl)}},R(null==q||null===(L=q.sideOption)||void 0===L?void 0:L.name))),o.createElement(s.WhatsNewCard,null==F?void 0:F[0])):null))},ke=()=>{const{t:e}=l.useTranslation(),t=a.useHistory(),{data:{languages:i,stateInfo:r}={},isLoading:c}=Digit.Hooks.useStore.getInitData(),u=Digit.StoreData.getCurrentLanguage(),d=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),m=n.useMemo(()=>({options:i,optionsKey:"label",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:e=>{Digit.LocalizationService.changeLanguage(e.value,r.code)},selectedOption:null==i?void 0:i.filter(e=>e.value===u)[0]}),[u,i]);return c?o.createElement(s.Loader,null):o.createElement("div",{className:"selection-card-wrapper"},o.createElement(s.PageBasedInput,{texts:d,onSubmit:function(){var e;t.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)}},o.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),o.createElement(s.RadioButtons,m)))},Ue=()=>{const{t:e}=l.useTranslation(),i=a.useHistory(),r=a.useLocation(),{data:{uiHomePage:c}={}}=Digit.Hooks.useStore.getInitData(),u=null==c?void 0:c.redirectURL,{data:d,isLoading:p}=Digit.Hooks.useTenants(),[v,f]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[g,E]=n.useState(!1),h=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function y(e){f(e),E(!1)}const b=n.useMemo(()=>({options:d,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:y,selectedOption:v}),[d,e,v]);return p?o.createElement("loader",null):o.createElement("div",{className:"selection-card-wrapper"},o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement(s.PageBasedInput,{texts:h,onSubmit:function(){if(v){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",v);const o=null===(e=r.state)||void 0===e?void 0:e.redirectBackTo;var t,n;u?i.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/${u}`):o?i.replace(o):i.push(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen`)}else E(!0)},className:"location-selection-container"},o.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),o.createElement(s.SearchOnRadioButtons,m({},b,{placeholder:e("COMMON_TABLE_SEARCH")})),g?o.createElement(s.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},Be=function(){function e(){}return e.prototype.then=function(t,n){const o=new e,l=this.s;if(l){const e=1&l?t:n;if(e){try{Fe(o,1,e(this.v))}catch(e){Fe(o,2,e)}return o}return this}return this.o=function(e){try{const l=e.v;1&e.s?Fe(o,1,t?t(l):l):n?Fe(o,1,n(l)):Fe(o,2,l)}catch(e){Fe(o,2,e)}},o},e}();function Fe(e,t,n){if(!e.s){if(n instanceof Be){if(!n.s)return void(n.o=Fe.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Fe.bind(null,e,t),Fe.bind(null,e,2));e.s=t,e.v=n;const o=e.o;o&&o(e)}}function je(e){return e instanceof Be&&1&e.s}const He="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function ze(e,t,n){if("function"==typeof e[He]){var o,l,i,r=e[He]();if(function e(a){try{for(;!((o=r.next()).done||n&&n());)if((a=t(o.value))&&a.then){if(!je(a))return void a.then(e,i||(i=Fe.bind(null,l=new Be,2)));a=a.v}l?Fe(l,1,a):l=a}catch(e){Fe(l||(l=new Be),2,e)}}(),r.return){var a=function(e){try{o.done||r.return()}catch(e){}return e};if(l&&l.then)return l.then(a,function(e){throw a(e)});a()}return l}if(!("length"in e))throw new TypeError("Object is not iterable");for(var s=[],c=0;c<e.length;c++)s.push(e[c]);return function(e,t,n){var o,l,i=-1;return function r(a){try{for(;++i<e.length&&(!n||!n());)if((a=t(i))&&a.then){if(!je(a))return void a.then(r,l||(l=Fe.bind(null,o=new Be,2)));a=a.v}o?Fe(o,1,a):o=a}catch(e){Fe(o||(o=new Be),2,e)}}(),o}(s,function(e){return t(s[e])},n)}function Ge(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function Ve(e){let{setProfilePic:t,closeDrawer:i,userType:r,removeProfilePic:a,showToast:c}=e;const[u,d]=n.useState(null),[m,p]=n.useState(""),[v,f]=n.useState(null),{t:g}=l.useTranslation();return n.useEffect(()=>{!function(){try{f(null);const e=function(){if(m){const e=function(){if(m.size>=1e6)c("error",g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),f(g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ge(function(){return Promise.resolve(Digit.UploadServices.Filestorage(r+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var n,o;if((null==e||null===(n=e.data)||void 0===n||null===(o=n.files)||void 0===o?void 0:o.length)>0){var l,i;const n=null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId;d(n),t(n)}else c("error",g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),f(g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",g("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),o.createElement(o.Fragment,null,o.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>i()}),o.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===r?"2.5rem":"0",zIndex:"1000"}},o.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},o.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",o.createElement(s.GalleryIcon,null)),o.createElement("label",{style:{cursor:"pointer"}}," Gallery"),o.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>p(e.target.files[0]),style:{display:"none"}})),o.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},o.createElement("button",{onClick:()=>{a(),i()}},o.createElement(s.RemoveIcon,null)),o.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}var We,Qe,Xe;"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const qe={tenantId:""+(null===(We=Digit)||void 0===We||null===(Qe=We.ULBService)||void 0===Qe||null===(Xe=Qe.getStateId)||void 0===Xe?void 0:Xe.call(Qe)),UserProfileValidationConfig:[{name:"/^[a-zA-Z ]+$/i",mobileNumber:"/^[6-9]{1}[0-9]{9}$/",password:"/^([a-zA-Z0-9@#$%]{8,15})$/i"}]},Ze=e=>{var i,r,c,u,d,p,v,f,g,E,h,y,b,S,C,N,O,I,w,_,D,T,A,L,R,x,P,M,k,U,B,F,j,H,z,G,V,W;let{userType:Q,cityDetails:X}=e;a.useHistory();const{t:q}=l.useTranslation(),Z=window.location.href,Y=Digit.ULBService.getStateId(),$=Digit.ULBService.getCurrentTenantId(),J=(null===(i=Digit.UserService.getUser())||void 0===i?void 0:i.info)||{},[K,ee]=n.useState(null),[te,oe]=n.useState(null!=J&&J.name?J.name:""),[le,ie]=n.useState(null!=J&&J.emailId?J.emailId:""),[re,ae]=n.useState(null==K?void 0:K.gender),[se,ce]=n.useState(null!=J&&J.permanentCity?J.permanentCity:X.name),[ue,de]=n.useState(null!=J&&J.mobileNumber?J.mobileNumber:""),[me,pe]=n.useState(null),[ve,fe]=n.useState(""),[ge,Ee]=n.useState(!1),[he,ye]=n.useState(!1),[be,Se]=n.useState(""),[Ce,Ne]=n.useState(""),[Oe,Ie]=n.useState(""),[we,_e]=n.useState(null),[De,Te]=n.useState(!1),[Ae,Le]=o.useState(window.innerWidth),[Re,xe]=o.useState({}),Pe=window.Digit.Utils.browser.isMobile(),Me=Digit.Utils.getMultiRootTenant(),[ke,Ue]=n.useState({SMS:{scope:"GLOBAL",status:"REVOKED"},EMAIL:{scope:"GLOBAL",status:"REVOKED"},WHATSAPP:{scope:"GLOBAL",status:"REVOKED"}}),[Be,Fe]=n.useState(Digit.StoreData.getCurrentLanguage()||"en_IN"),je=null===(r=Digit.SessionStorage.get("initData"))||void 0===r?void 0:r.languages,He=e=>{var t;return(null==e||null===(t=e.UserProfileValidationConfig)||void 0===t?void 0:t[0])&&Object.entries(null==e?void 0:e.UserProfileValidationConfig[0]).reduce((e,t)=>{let[n,o]=t;if("string"==typeof o)try{if(o.startsWith("/")&&o.lastIndexOf("/")>0){const t=o.lastIndexOf("/"),l=o.slice(1,t),i=o.slice(t+1);e[n]=new RegExp(l,i)}else e[n]=new RegExp(o)}catch(t){console.error(`Error parsing regex for key "${n}":`,t),e[n]=o}else e[n]=o;return e},{})},[ze,We]=n.useState(He(qe)||{}),Qe=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getCurrentTenantId():null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u?void 0:u.getConfig("STATE_LEVEL_TENANT_ID"),Xe=(null===(d=Digit)||void 0===d||null===(p=d.Utils)||void 0===p||null===(v=p.getConfigModuleName)||void 0===v?void 0:v.call(p))||"commonUiConfig",{data:Ze}=Digit.Hooks.useCustomMDMS(Qe,"commonUiConfig",[{name:"UserPreferencesConfig"}],{select:e=>{var t,n,o;return null==e||null===(t=e.commonUiConfig)||void 0===t||null===(n=t.UserPreferencesConfig)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.enableUserPreferences}},{schemaCode:"commonUiConfig.UserPreferencesConfig"}),{data:Ye}=Digit.Hooks.useCustomAPIHook({url:"/user-preference/v1/_search",body:{criteria:{userId:null==J?void 0:J.uuid,tenantId:$,preferenceCode:"USER_NOTIFICATION_PREFERENCES"}},changeQueryName:"user_preference_search",config:{enabled:!(null==J||!J.uuid)&&("citizen"===Q||Me)&&!!Ze,select:e=>{var t;return null==e||null===(t=e.preferences)||void 0===t?void 0:t[0]},cacheTime:0,staleTime:0}}),$e=Digit.Hooks.useCustomAPIMutationHook({url:"/user-preference/v1/_upsert"});n.useEffect(()=>{if(null!=Ye&&Ye.payload){const e=Ye.payload.consent||{};Ue(t=>({SMS:e.SMS||t.SMS,EMAIL:e.EMAIL||t.EMAIL,WHATSAPP:e.WHATSAPP||t.WHATSAPP})),Ye.payload.preferredLanguage&&Fe(Ye.payload.preferredLanguage)}},[Ye]);const{data:Je}=Digit.Hooks.useCustomAPIHook({url:"/config-service/config/v1/_search",body:{criteria:{schemaCode:"NotificationChannel",tenantId:$}},changeQueryName:"config_service_search",config:{enabled:!!Ze&&!!$,select:e=>{var t;const n={};return null==e||null===(t=e.configData)||void 0===t||t.forEach(e=>{var t;n[e.uniqueIdentifier]=!0===(null===(t=e.data)||void 0===t?void 0:t.enabled)}),n}}}),{data:Ke,isValidationConfigLoading:et}=Digit.Hooks.useCustomMDMS(Qe,Xe,[{name:"UserValidation"}],{select:e=>{var t;const n=((null==e||null===(t=e[Xe])||void 0===t?void 0:t.UserValidation)||[]).filter(e=>"mobile"===e.fieldType).map(e=>{var t,n,o,l,i;return{prefix:null==e||null===(t=e.attributes)||void 0===t?void 0:t.prefix,pattern:null==e||null===(n=e.rules)||void 0===n?void 0:n.pattern,maxLength:null==e||null===(o=e.rules)||void 0===o?void 0:o.maxLength,minLength:null==e||null===(l=e.rules)||void 0===l?void 0:l.minLength,errorMessage:null==e||null===(i=e.rules)||void 0===i?void 0:i.errorMessage,isDefault:!0===(null==e?void 0:e.default)}}),o=n.find(e=>e.isDefault)||n[0];return{mobileConfigs:n,defaultConfig:o,UserProfileValidationConfig:[{mobileNumber:null==o?void 0:o.pattern}],prefix:(null==o?void 0:o.prefix)||"+91"}},enabled:!!Qe});n.useEffect(()=>{var e;if(Ke&&null!=Ke&&null!==(e=Ke.UserProfileValidationConfig)&&void 0!==e&&e[0]){const e=He(Ke);null!=Ke&&Ke.prefix&&(e.prefix=Ke.prefix);const t=Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return null!=t}));We(e=>({...e,...t}))}},[Ke]);const tt=(null==Ke?void 0:Ke.mobileConfigs)||[],nt=(null==Ke?void 0:Ke.defaultConfig)||{},[ot,lt]=n.useState(nt);n.useEffect(()=>{null==Ke||!Ke.defaultConfig||null!=ot&&ot.prefix||lt(Ke.defaultConfig)},[null==Ke?void 0:Ke.defaultConfig]);const it=(null==ot?void 0:ot.pattern)||"^[6-9][0-9]{9}$",rt=n.useMemo(()=>new RegExp(it),[it]),at=(null==ot?void 0:ot.maxLength)||10,st=(null==K?void 0:K.countryCode)||(null==J?void 0:J.countryCode)||(null==ze?void 0:ze.prefix)||"+91",ct=(null==ot?void 0:ot.errorMessage)||"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID";o.useEffect(()=>(window.addEventListener("resize",()=>Le(window.innerWidth)),()=>{window.removeEventListener("resize",()=>Le(window.innerWidth))})),n.useEffect(()=>{var e;Te(!0),function(){try{var e,t;const n=null==J?void 0:J.uuid,o=null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t?void 0:t.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH"),l=function(){if(n){const e=o?Promise.resolve(Digit.CustomService.getResponse({url:o+"/v1/_search",useCache:!1,method:"POST",userService:!0,params:{limit:1e3,offset:0,tenantId:$},body:{Individual:{userUuid:[n],tenantId:$}}})).then(function(e){const t=function(t){if(null==e||null===(t=e.Individual)||void 0===t||!t.length)return Promise.resolve(Digit.UserService.userSearch($,{uuid:[n]},{})).then(function(e){var t;null!=e&&null!==(t=e.user)&&void 0!==t&&t.length&&ee(e.user[0])});ee(e.Individual[0])}();if(t&&t.then)return t.then(function(){})}):Promise.resolve(Digit.UserService.userSearch($,{uuid:[n]},{})).then(function(e){var t;null!=e&&null!==(t=e.user)&&void 0!==t&&t.length&&ee(e.user[0])});if(e&&e.then)return e.then(function(){})}}();Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),ae({i18nKey:void 0,code:null==K?void 0:K.gender,value:null==K?void 0:K.gender}),null!=K&&K.mobileNumber&&de(K.mobileNumber);const t=null==K||null===(e=K.photo)||void 0===e?void 0:e.split(",");fe(null==t?void 0:t.at(0)),Te(!1)},[null!==K]);let ut={};const dt=e=>ae(e),mt=()=>Ee(!1),pt=e=>{var t;oe(e),null==ze||null===(t=ze.name)||void 0===t||!t.test(e)||0===e.length||e.length>50?xe({...Re,userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}}):xe({...Re,userName:null})},vt=e=>{(null==J?void 0:J.userName)!==e?(ie(e),!e.length||e.includes("@")&&e.includes(".")?xe({...Re,emailAddress:null}):xe({...Re,emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}})):xe({...Re,emailAddress:null})},ft=function(e,t,n){void 0===n&&(n=5e3),_e({key:e,action:t}),setTimeout(()=>{_e(null)},n)},gt=function(){try{let t=!1;function e(e){if(t)return e;Te(!1)}Te(!0);const n=Ge(function(){var e,t;function n(){if(r&&"200"===r.status){const e=Digit.UserService.getUser();e&&Digit.UserService.setUser({...e,info:{...e.info,name:te,mobileNumber:ue,emailId:le,permanentCity:se}})}return function(){if(be.length&&Ce.length&&Oe.length){const e={existingPassword:be,newPassword:Ce,tenantId:$,type:"EMPLOYEE",username:null==J?void 0:J.userName,confirmPassword:Oe};return function(){if(Ce===Oe)return Ge(function(){return Promise.resolve(Digit.UserService.changePassword(e,$)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";ft("success",q("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)})},function(e){var t,n;throw JSON.stringify({type:"error",message:null!==(t=e.Errors)&&void 0!==t&&null!==(n=t.at(0))&&void 0!==n&&n.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})});throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"})}()}{const e=function(e){if(null!==(e=r)&&void 0!==e&&e.status&&"200"===r.status){function t(){ft("success",q("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}const e=function(){if(("citizen"===Q||Digit.Utils.getMultiRootTenant())&&Ze)return Promise.resolve(function(){try{return Promise.resolve(Ge(function(){return Promise.resolve($e.mutateAsync({body:{preference:{userId:null==J?void 0:J.uuid,tenantId:$,preferenceCode:"USER_NOTIFICATION_PREFERENCES",payload:{consent:ke,preferredLanguage:Be}}}})).then(function(){})},function(e){var t,n,o,l;throw JSON.stringify({type:"error",message:(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.Errors)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.description)||"CORE_COMMON_PROFILE_PREFERENCE_UPDATE_ERROR"})}))}catch(e){return Promise.reject(e)}}()).then(function(){})}();return e&&e.then?e.then(t):t()}}();if(e&&e.then)return e.then(function(){})}}()}if(te&&oe(e=>e.trim()),null==ze||!ze.name.test(te)||""===te||te.length>50||te.length<1)throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===Q&&null!=ze&&ze.mobileNumber&&!ze.mobileNumber.test(ue))throw JSON.stringify({type:"error",message:q(ct)});if(le.length&&(!le.includes("@")||!le.includes(".")))throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_EMAIL_INVALID")});const o=be.trim(),l=Ce.trim(),i=Oe.trim();if(Se(o),Ne(l),Ie(i),he&&o&&l&&i){if(l!==i)throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(o.length&&l.length&&i.length))throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!(null!=ze&&ze.password.test(l)||null!=ze&&ze.password.test(i)))throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}let r;const a=null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t?void 0:t.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH"),s=function(){if(a&&null!=K&&K.individualId){var e,t;const n={...K,tenantId:$,name:{givenName:te.trim(),familyName:null==K||null===(e=K.name)||void 0===e?void 0:e.familyName,otherNames:null==K||null===(t=K.name)||void 0===t?void 0:t.otherNames},mobileNumber:ue,countryCode:st,isDeleted:!1,isSystemUser:!0,isSystemUserActive:!0};return null!=re&&re.value&&(n.gender=re.value),le&&(n.email=le),me&&(n.photo=me),Promise.resolve(Digit.CustomService.getResponse({url:a+"/v1/_update",useCache:!1,method:"POST",userService:!0,body:{Individual:n}})).then(function(e){r=null==e?void 0:e.responseInfo})}{const e={...J,name:te,mobileNumber:ue,countryCode:st,gender:null==re?void 0:re.value,emailId:le,photo:me};return Promise.resolve(Digit.UserService.updateUser(e,$)).then(function(e){r=null==e?void 0:e.responseInfo})}}();return s&&s.then?s.then(n):n()},function(e){let t;try{t=JSON.parse(e)}catch(r){var n,o,l,i;t={type:"error",message:(null==e||null===(n=e.response)||void 0===n||null===(o=n.data)||void 0===o||null===(l=o.Errors)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.description)||"CORE_COMMON_PROFILE_UPDATE_ERROR"}}ft(t.type,q(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let Et=[];const{data:ht}=Digit.Hooks.useGenderMDMS(Y,"common-masters","GenderType");return ht&&ht.map(e=>{Et.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),De||et?o.createElement(t.Loader,null):o.createElement("div",{className:"user-profile "+("citizen"===Q?"citizen":"employee")},o.createElement("section",{style:{margin:"citizen"===Q||Pe?"8px":"0px"}},"citizen"===Q||Pe?o.createElement(t.BackLink,{onClick:()=>window.history.back()}):o.createElement(t.BreadCrumb,{style:{marginTop:"0rem",marginBottom:"1.5rem"},crumbs:[{internalLink:Me?`/${null===(f=window)||void 0===f?void 0:f.contextPath}/employee/sandbox/landing`:`/${null===(g=window)||void 0===g?void 0:g.contextPath}/employee`,content:q("ES_COMMON_HOME"),show:!0},{internalLink:`/${null===(E=window)||void 0===E?void 0:E.contextPath}/employee/user/profile`,content:q("ES_COMMON_PAGE_1"),show:Z.includes("/user/profile")}]})),o.createElement("div",{style:{display:"flex",flex:1,flexDirection:Ae<768||"citizen"===Q?"column":"row",margin:"citizen"===Q?"8px":"0px",gap:"citizen"===Q?"":"0 24px",boxShadow:"citizen"===Q?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===Q?"white":"",borderRadius:"citizen"===Q?"4px":"",maxWidth:"citizen"===Q?"960px":""}},o.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===Q?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===Q?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===Q?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===Q?"8px":"16px"}},o.createElement("div",{style:{position:"relative",height:"citizen"===Q?"114px":"150px",width:"citizen"===Q?"114px":"150px",margin:"16px"}},o.createElement(ne,{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:ve&&""!==ve?ve:"data:image/png;base64,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",alt:"Profile Image"}),o.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>Ee(!ge)},o.createElement(s.CameraIcon,null)))),o.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===Q?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===Q?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===Q?"8px":"24px",paddingBottom:"20px"}},"citizen"===Q?o.createElement(o.Fragment,null,o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+q("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"100%",maxWidth:"960px"}},o.createElement(t.TextInput,m({t:q,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:te,onChange:e=>pt(e.target.value)},ut={isRequired:!0,pattern:(null==Ke||null===(h=Ke.UserProfileValidationConfig)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.name)||(null==qe||null===(b=qe.UserProfileValidationConfig)||void 0===b||null===(S=b[0])||void 0===S?void 0:S.name),type:"tel",title:q("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==Re?void 0:Re.userName)&&o.createElement(t.ErrorMessage,{message:q(null==Re||null===(C=Re.userName)||void 0===C?void 0:C.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+q("CORE_COMMON_PROFILE_GENDER")),o.createElement(t.Dropdown,{style:{width:"100%",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==re?void 0:re.length)?re[0]:re,disable:1===(null==re?void 0:re.length)||!1,option:Et,select:dt,value:re,optionKey:"code",t:q,name:"gender"})),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+q("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:q,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:le,onChange:e=>vt(e.target.value),disabled:!1}),(null==Re?void 0:Re.emailAddress)&&o.createElement(t.ErrorMessage,{message:q(null==Re||null===(N=Re.emailAddress)||void 0===N?void 0:N.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),Ze&&(null==je?void 0:je.length)>=1?o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile"},q("CORE_COMMON_PREFERRED_LANGUAGE")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.Dropdown,{option:je,optionKey:"label",selected:null==je?void 0:je.find(e=>e.value===Be),select:e=>Fe(e.value),t:q}))):null,Ze?[{key:"SMS",label:q("CORE_COMMON_SMS_NOTIFICATIONS")},{key:"EMAIL",label:q("CORE_COMMON_EMAIL_NOTIFICATIONS")},{key:"WHATSAPP",label:q("CORE_COMMON_WHATSAPP_NOTIFICATIONS")}].map(e=>{const n=!0===(null==Je?void 0:Je[e.key]);return o.createElement(t.LabelFieldPair,{key:e.key},o.createElement(t.CardLabel,{className:"user-profile",style:{width:"30%",minWidth:"150px",...n?{}:{color:"#B1B4B6"}}},e.label),o.createElement("div",{style:{display:"flex",alignItems:"flex-end",gap:"10px"}},o.createElement(s.ToggleSwitch,{value:"GRANTED"===ke[e.key].status,onChange:()=>(e=>{Ue(t=>({...t,[e]:{...t[e],status:"GRANTED"===t[e].status?"REVOKED":"GRANTED"}}))})(e.key),disabled:!n,name:"notification-"+e.key,style:{margin:"0px",opacity:n?1:.4}}),o.createElement("span",{style:{fontSize:"14px",marginBottom:"2px",color:n?"#505A5F":"#B1B4B6"}},q(n&&"GRANTED"===ke[e.key].status?"CORE_COMMON_ENABLED":"CORE_COMMON_DISABLED"))))}):null,o.createElement("button",{onClick:gt,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Pe?"100%":"240px",borderBottom:"1px solid black"}},q("CORE_COMMON_SAVE"))):o.createElement(o.Fragment,null,o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+q("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,m({t:q,type:"text",isMandatory:!1,name:"name",value:te,onChange:e=>pt(e.target.value),placeholder:"Enter Your Name"},ut={isRequired:!0,pattern:(null==Ke||null===(O=Ke.UserProfileValidationConfig)||void 0===O||null===(I=O[0])||void 0===I?void 0:I.name)||(null==qe||null===(w=qe.UserProfileValidationConfig)||void 0===w||null===(_=w[0])||void 0===_?void 0:_.name),type:"text",title:q("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==Re?void 0:Re.userName)&&o.createElement(t.ErrorMessage,{message:q(null==Re||null===(D=Re.userName)||void 0===D?void 0:D.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+q("CORE_COMMON_PROFILE_GENDER")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.Dropdown,{className:"profileDropdown",selected:1===(null==re?void 0:re.length)?re[0]:re,disable:1===(null==re?void 0:re.length)||!1,option:Et,select:dt,value:re,optionKey:"code",t:q,name:"gender"}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+q("CORE_COMMON_PROFILE_CITY")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,m({t:q,type:"text",isMandatory:!1,name:"city",value:q(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+$)),onChange:e=>ce(e.target.value),placeholder:"Enter Your City Name"},ut={isRequired:!0,type:"text",title:q("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),o.createElement(t.ErrorMessage,null))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},q("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),o.createElement("div",{style:{width:"100%"}},o.createElement("div",{style:{display:"flex",alignItems:"center",border:null!=Re&&Re.mobileNumber?"2px solid #d4351c":"1px solid #464646",overflow:"hidden",backgroundColor:"#FFFFFF",boxSizing:"border-box",height:"2.5rem",width:"100%",maxWidth:"100%"}},tt.length>1?o.createElement("select",{value:st,onChange:e=>{const t=tt.find(t=>t.prefix===e.target.value)||nt;lt(t),de(""),xe({...Re,mobileNumber:null})},disabled:!Digit.Utils.getMultiRootTenant(),style:{border:"none",borderRight:null!=Re&&Re.mobileNumber?"2px solid #d4351c":"1px solid #464646",padding:"0 8px",fontSize:"16px",backgroundColor:"#EEEEEE",cursor:Digit.Utils.getMultiRootTenant()?"pointer":"not-allowed",outline:"none",color:"#0B0C0C",fontWeight:"500",minWidth:"75px",height:"100%",appearance:"auto"}},tt.map(e=>o.createElement("option",{key:e.prefix,value:e.prefix},e.prefix))):o.createElement("span",{style:{padding:"0 10px",fontSize:"16px",fontWeight:"500",color:"#0B0C0C",borderRight:null!=Re&&Re.mobileNumber?"2px solid #d4351c":"1px solid #464646",height:"100%",display:"flex",alignItems:"center",backgroundColor:"#EEEEEE"}},st),o.createElement("input",{type:"text",inputMode:"numeric",value:ue||"",onChange:e=>(e=>{const t=e.replace(/\D/g,"");t.length>at||(de(t),"employee"!==Q||rt.test(t)?xe({...Re,mobileNumber:null}):xe({...Re,mobileNumber:{type:"pattern",message:ct}}))})(e.target.value),placeholder:"Enter a valid Mobile No.",maxLength:at,disabled:!Digit.Utils.getMultiRootTenant(),style:{flex:1,border:"none",padding:"0 12px",fontSize:"16px",outline:"none",color:"#0B0C0C",backgroundColor:"transparent",height:"100%",width:"100%",minWidth:"0",cursor:Digit.Utils.getMultiRootTenant()?"text":"not-allowed"}}),o.createElement("span",{style:{padding:"0 8px",fontSize:"12px",color:"#6f777b",whiteSpace:"nowrap"}},(ue||"").length,"/",at)),(null==Re?void 0:Re.mobileNumber)&&o.createElement(t.ErrorMessage,{message:q(null==Re||null===(T=Re.mobileNumber)||void 0===T?void 0:T.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+q("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:q,type:"email",isMandatory:!1,placeholder:q("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:le,onChange:e=>vt(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()}),(null==Re?void 0:Re.emailAddress)&&o.createElement(t.ErrorMessage,{message:q(null==Re||null===(A=Re.emailAddress)||void 0===A?void 0:A.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement("div",{style:{width:"100%"}},0!=he||Digit.Utils.getOTPBasedLogin()?null:o.createElement(t.Button,{label:q("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>ye(!he),style:{paddingLeft:"20rem"}}),he?o.createElement("div",{style:{marginTop:"10px"}},o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+q("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:q,type:"password",isMandatory:!1,name:"name",pattern:(null==Ke||null===(L=Ke.UserProfileValidationConfig)||void 0===L||null===(R=L[0])||void 0===R?void 0:R.password)||(null==qe||null===(x=qe.UserProfileValidationConfig)||void 0===x||null===(P=x[0])||void 0===P?void 0:P.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,void(null!=ze&&ze.password.test(n)?xe({...Re,currentPassword:null}):xe({...Re,currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}))},disabled:!1}),(null==Re?void 0:Re.currentPassword)&&o.createElement(t.ErrorMessage,{message:q(null==Re||null===(M=Re.currentPassword)||void 0===M?void 0:M.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+q("CORE_COMMON_PROFILE_NEW_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:q,type:"password",isMandatory:!1,name:"name",pattern:(null==Ke||null===(k=Ke.UserProfileValidationConfig)||void 0===k||null===(U=k[0])||void 0===U?void 0:U.password)||(null==qe||null===(B=qe.UserProfileValidationConfig)||void 0===B||null===(F=B[0])||void 0===F?void 0:F.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Ne(n),void(null!=ze&&ze.password.test(n)?xe({...Re,newPassword:null}):xe({...Re,newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}))},disabled:!1}),(null==Re?void 0:Re.newPassword)&&o.createElement(t.ErrorMessage,{message:q(null==Re||null===(j=Re.newPassword)||void 0===j?void 0:j.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+q("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:q,type:"password",isMandatory:!1,name:"name",pattern:(null==Ke||null===(H=Ke.UserProfileValidationConfig)||void 0===H||null===(z=H[0])||void 0===z?void 0:z.password)||(null==qe||null===(G=qe.UserProfileValidationConfig)||void 0===G||null===(V=G[0])||void 0===V?void 0:V.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Ie(n),void(null!=ze&&ze.password.test(n)?xe({...Re,confirmPassword:null}):xe({...Re,confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}))},disabled:!1}),(null==Re?void 0:Re.confirmPassword)&&o.createElement(t.ErrorMessage,{message:q(null==Re||null===(W=Re.confirmPassword)||void 0===W?void 0:W.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===Q&&Pe?o.createElement("button",{onClick:gt,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Pe?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},q("CORE_COMMON_SAVE")):null))),"employee"!==Q||Pe?null:o.createElement(t.Footer,{actionFields:[o.createElement(t.SubmitBar,{t:q,label:q("CORE_COMMON_SAVE"),onSubmit:gt})],className:"",setactionFieldsToRight:!0}),we&&o.createElement(t.Toast,{type:we.key,label:q("success"===we.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":we.action),onClose:()=>_e(null),style:{maxWidth:"670px"}}),1==ge?o.createElement(Ve,{setProfilePic:function(e){try{function t(e){fe(null==e?void 0:e.thumbs[0]),mt()}return pe(e),Promise.resolve(e?Promise.resolve(function(e,t){try{return Promise.resolve(Digit.UploadServices.Filefetch(e,t)).then(function(e){return e.data.fileStoreIds&&0!==e.data.fileStoreIds.length?{thumbs:e.data.fileStoreIds.map(e=>e.url.split(",")[3]),images:e.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null})}catch(e){return Promise.reject(e)}}([e],Y)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:mt,userType:Q,removeProfilePic:()=>{pe(null),fe(null)},showToast:ft}):"")},Ye=e=>{var i,r,a;let{module:c}=e;const u=Digit.UserService.getUser(),{t:d}=((null==u||null===(i=u.info)||void 0===i?void 0:i.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation()),m=Digit.SessionStorage.get("initData").stateInfo,p=Digit.StoreData.getCurrentLanguage(),[v,f]=n.useState(p),[g,E]=n.useState(!1),[h,y]=n.useState(""),b=()=>o.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("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"})),{isLoading:S,data:C}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),N=null==C||null===(r=C.MdmsRes["common-masters"])||void 0===r||null===(a=r.howItWorks[0])||void 0===a?void 0:a[""+c];return S?o.createElement(t.Loader,null):o.createElement(n.Fragment,null,o.createElement("div",{className:"how-it-works-page"},o.createElement(t.BackButton,null),o.createElement("div",{className:"how-it-works-page-header"},o.createElement(t.HeaderComponent,null,d(N.screenHeader?N.screenHeader:"HOW_IT_WORKS"))),o.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>o.createElement("div",{className:"language-button-container",key:t},o.createElement(s.CustomButton,{selected:e.value===v,text:e.label,onClick:()=>(e=>{f(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)})(e)})))),N.videosJson.map((e,t)=>o.createElement("div",null,o.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},o.createElement("div",{className:"video-icon",onClick:()=>{return t=e,y("hi_IN"===v?t.hi_IN:t.en_IN),void E(!0);var t}},o.createElement("div",{className:"vid-svg"},o.createElement(b,null))),o.createElement("div",{className:"how-it-works-header-description"},o.createElement("h2",null,d(e.headerLabel)),o.createElement("p",null,d(e.description)))))),N.pdfHeader&&N.pdfDesc&&o.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},o.createElement("div",{className:"how-it-works-pdf-section"},o.createElement("div",{className:"pdf-icon-header-desc"},o.createElement("div",{className:"pdf-icon"},o.createElement(t.PDFSvg,null)),o.createElement("div",{className:"pdf-header-desc"},o.createElement("h2",null,d(N.pdfHeader)),o.createElement("p",null,d(N.pdfDesc)))),o.createElement("div",{className:"download-icon"},o.createElement(t.DownloadImgIcon,null)))),g&&o.createElement("div",{className:"how-it-works-video-play"},o.createElement("div",{className:"close-button"},o.createElement(t.CloseSvg,{onClick:()=>{E(!1)}})),o.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},o.createElement("source",{src:h,type:"video/mp4"})))))},$e=[{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:!0,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:!0,minlength:1,maxlength:50,pattern:"^[A-Za-z]+( [A-Za-z]+)*$"}}]}],Je=e=>{let{t:l,onSelect:i,mobileNumber:r,emailId:a,onMobileChange:c,onEmailChange:u,config:d,canSubmit:m,validationConfig:p,allValidationConfigs:v,onConsentChange:f,enableUserPreferences:g,countryCode:E}=e;const[h,y]=n.useState(!!a),[b,S]=n.useState(""),[C,N]=n.useState(!1),O=g,I=n.useMemo(()=>(Array.isArray(v)?v:[]).filter(e=>"mobile"===e.fieldType),[v]),w=n.useMemo(()=>I.find(e=>e.isDefault)||I[0]||p||{},[I,p]),[_,D]=n.useState(()=>{if(E){const e=I.find(e=>e.prefix===E);if(e)return e}return w});n.useEffect(()=>{if(!E||null!=_&&_.prefix)!w||!w.prefix||null!=_&&_.prefix||E||D(w);else{const e=I.find(e=>e.prefix===E);e&&D(e)}},[w,E,I]),n.useEffect(()=>{c({target:{value:""}})},[]);const T=_||p||{},A=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,L=(null==T?void 0:T.pattern)||"^[6-9][0-9]{9}$",R=n.useMemo(()=>new RegExp(L),[L]),x=(null==T?void 0:T.maxLength)||10,P=(null==T?void 0:T.prefix)||"+91",M=(null==T?void 0:T.errorMessage)||"ERR_INVALID_MOBILE_NUMBER",k=n.useMemo(()=>A.test(a),[a]),U=n.useMemo(()=>R.test(r||""),[r,R]),B=n.useMemo(()=>h?!(k&&m):!(U&&m),[h,k,U,m]),F=n.useMemo(()=>window.innerWidth<=768?l(h?"LOGIN_WITH_MOBILE":"LOGIN_WITH_EMAIL"):l(h?"CS_USE_MOBILE_INSTEAD":"CS_LOGIN_REGISTER_WITH_EMAIL"),[h,l]),j=!h&&I.length>1;return o.createElement(t.InputCard,{t:l,texts:null==d?void 0:d.texts,submit:!0,onNext:()=>{if(h){if(!k)return void S(l("ERR_INVALID_EMAIL"));i({userName:a,whatsappConsent:C})}else{if(!U)return void S(l(M));i({mobileNumber:r,countryCode:(null==_?void 0:_.prefix)||P,whatsappConsent:C})}},isDisable:B},o.createElement("div",{className:"input-field-wrapper",style:{marginBottom:"0"}},h?o.createElement(t.FieldV1,{key:"email",withoutLabel:!0,charCount:!0,error:b,onChange:e=>{const t=e.target.value;S(""),u(e),t&&!A.test(t)&&S(l("ERR_INVALID_EMAIL"))},placeholder:l("ENTER_EMAIL_PLACEHOLDER"),populators:{name:"userName",prefix:"",validation:{maxlength:256,pattern:A}},props:{fieldStyle:{width:"100%"}},type:"text",value:a}):o.createElement(n.Fragment,null,o.createElement("div",{style:{display:"flex",alignItems:"center",border:b?"2px solid #d4351c":"1px solid #464646",overflow:"hidden",backgroundColor:"#FFFFFF",boxSizing:"border-box",height:"2.5rem",width:"100%"}},j?o.createElement("select",{value:(null==_?void 0:_.prefix)||P,onChange:e=>{const t=I.find(t=>t.prefix===e.target.value)||_;D(t),S(""),c({target:{value:""}})},style:{border:"none",borderRight:b?"2px solid #d4351c":"1px solid #464646",padding:"0 8px",fontSize:"16px",backgroundColor:"#EEEEEE",cursor:"pointer",outline:"none",color:"#0B0C0C",fontWeight:"500",minWidth:"75px",height:"100%",appearance:"auto"}},I.map(e=>o.createElement("option",{key:e.prefix,value:e.prefix},e.prefix))):o.createElement("span",{style:{padding:"0 10px",fontSize:"16px",fontWeight:"500",color:"#0B0C0C",borderRight:b?"2px solid #d4351c":"1px solid #464646",height:"100%",display:"flex",alignItems:"center",backgroundColor:"#EEEEEE",whiteSpace:"nowrap"}},P),o.createElement("input",{type:"text",inputMode:"numeric",value:r,onChange:e=>{const t=e.target.value.replace(/\D/g,"");t.length>x||(S(""),c({target:{value:t}}),t&&!R.test(t)&&S(l(M)))},placeholder:l("ENTER_MOBILE_PLACEHOLDER"),maxLength:x,style:{flex:1,border:"none",padding:"0 12px",fontSize:"16px",outline:"none",color:"#0B0C0C",backgroundColor:"transparent",height:"100%",minWidth:"0"}}),o.createElement("span",{style:{padding:"0 8px",fontSize:"12px",color:"#6f777b",whiteSpace:"nowrap"}},(r||"").length,"/",x)),b&&o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",color:"#d4351c",fontSize:"14px"}},o.createElement("span",null,"⚠"),o.createElement("span",null,b)))),o.createElement("div",{style:{marginTop:h?"-3rem":"0.5rem"}},O&&o.createElement(s.CheckBox,{onChange:()=>{const e=!C;N(e),f&&f(e)},checked:C,label:l("CORE_COMMON_WHATSAPP_NOTIFICATIONS"),styles:{display:"flex",alignItems:"center",textTransform:"capitalize"}}),o.createElement(t.LinkLabel,{style:{display:"inline",marginLeft:"0px",userSelect:"none",color:"inherit",cursor:"pointer",textDecoration:"underline"},onClick:()=>{y(!h),S(""),h?u({target:{value:""}}):c({target:{value:""}})}},F)))},Ke=e=>{let{config:n,onSelect:l,t:i,isDisabled:r}=e;return o.createElement(t.FormStep,{config:n,onSelect:l,t:i,isDisabled:r})};function et(e,t){const o=n.useRef();n.useEffect(()=>{o.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){o.current()},t);return()=>clearInterval(e)}},[t])}const tt=e=>{let{config:l,otp:i,onOtpChange:r,onResend:a,onSelect:c,t:u,error:d,userType:m="citizen",canSubmit:p}=e;const[v,f]=n.useState(30);et(()=>{f(v-1)},v>0?1e3:null);const g=()=>{a(),f(2)};return"employee"===m?o.createElement(n.Fragment,null,o.createElement(s.OTPInput,{length:6,onChange:r,value:i}),v>0?o.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button resend-otp",onClick:g},u("CS_RESEND_OTP")),!d&&o.createElement(t.CardLabelError,null,u("CS_INVALID_OTP"))):o.createElement(t.FormStep,{onSelect:c,config:l,t:u,isDisabled:!(6===(null==i?void 0:i.length)&&p)},o.createElement(s.OTPInput,{length:6,onChange:r,value:i}),v>0?o.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button",onClick:g},u("CS_RESEND_OTP")),!d&&o.createElement(t.CardLabelError,null,u("CS_INVALID_OTP")))};var nt,ot,lt;const it={type:"register"},rt={type:"login"};let at=`/${(null===(nt=window)||void 0===nt?void 0:nt.contextPath)||(null===(ot=window)||void 0===ot||null===(lt=ot.globalConfigs)||void 0===lt?void 0:lt.getConfig("CONTEXT_PATH"))}/citizen`;const st=(e,t,n)=>{var o,l;if(Digit.Utils.getMultiRootTenant())return;let i=null===(o=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===o||null===(l=o.value)||void 0===l?void 0:l.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",i),localStorage.setItem("Citizen.locale",i),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))},ct=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||at,ut=e=>{var i,r,s,c,u,d,m,p,v,f,g,E;let{stateCode:h,isUserRegistered:y=!0}=e;const{t:b}=l.useTranslation(),S=a.useLocation(),{path:C}=a.useRouteMatch(),N=a.useHistory(),[O,I]=n.useState(null),[w,_]=n.useState(null),[D,T]=n.useState(!0),[A,L]=n.useState(null),[R,x]=n.useState(y?{}:null==S||null===(i=S.state)||void 0===i?void 0:i.data),[P,M]=n.useState(null),k=Digit.Hooks.useQueryParams(),[U,B]=n.useState(!1),[F,j]=n.useState(!0),[H,z]=n.useState(!0),[G,V]=n.useState(!1),W=null===(r=window)||void 0===r||null===(s=r.globalConfigs)||void 0===s?void 0:s.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH"),Q=Digit.Utils.getMultiRootTenant(),X=null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u?void 0:u.getConfig("STATE_LEVEL_TENANT_ID"),q=Q?(null===(d=Digit)||void 0===d||null===(m=d.Utils)||void 0===m||null===(p=m.getConfigModuleName)||void 0===p?void 0:p.call(m))||"commonUiConfig":"common-masters",{data:Z}=Digit.Hooks.useCustomMDMS(X,q,[{name:"UserValidation"}],{select:e=>{var t;const n=(null==e||null===(t=e[q])||void 0===t?void 0:t.UserValidation)||[],o=n.find(e=>!0===e.default)||n[0],l=e=>{var t,n,o,l,i,r;return{prefix:null==e||null===(t=e.attributes)||void 0===t?void 0:t.prefix,pattern:null==e||null===(n=e.rules)||void 0===n?void 0:n.pattern,maxLength:null==e||null===(o=e.rules)||void 0===o?void 0:o.maxLength,minLength:null==e||null===(l=e.rules)||void 0===l?void 0:l.minLength,errorMessage:null==e||null===(i=e.rules)||void 0===i?void 0:i.errorMessage,allowedStartingCharacters:null==e||null===(r=e.rules)||void 0===r?void 0:r.allowedStartingCharacters,fieldType:null==e?void 0:e.fieldType,isDefault:!0===(null==e?void 0:e.default)}};return{allConfigs:n.map(l),defaultConfig:l(o)}},staleTime:3e5,enabled:!!X}),Y=null==Z?void 0:Z.defaultConfig,$=(null==Z?void 0:Z.allConfigs)||[],J=Q&&(null===(v=Digit)||void 0===v||null===(f=v.Utils)||void 0===f||null===(g=f.getConfigModuleName)||void 0===g?void 0:g.call(f))||"commonUiConfig",{data:K}=Digit.Hooks.useCustomMDMS(X,J,[{name:"UserPreferencesConfig"}],{select:e=>{var t,n,o;return null==e||null===(t=e[J])||void 0===t||null===(n=t.UserPreferencesConfig)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.enableUserPreferences}},{schemaCode:J+".UserPreferencesConfig"});n.useEffect(()=>{let e;return w&&(P&&(clearTimeout(P),M(null)),e=setTimeout(()=>{_("")},5e3),M(e)),()=>{e&&clearTimeout(e)}},[w]),n.useEffect(()=>{var e;if(!O)return;Digit.SessionStorage.set("citizen.userRequestObject",O),Digit.UserService.setUser(O),st(null==O?void 0:O.info,null==O?void 0:O.access_token,h);const t=(null===(e=S.state)||void 0===e?void 0:e.from)||at;var n;Digit.ULBService.getCitizenCurrentTenant()?N.replace(t):N.replace(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen/select-location`,{redirectBackTo:t})},[O]);const ee=n.useMemo(()=>$e.map(e=>{const t={};for(const n in e.texts)t[n]=b(e.texts[n]);return{...e,texts:t}},[$e])),te=function(e,t){try{return Promise.resolve(K?Ge(function(){return Promise.resolve(Digit.CustomService.getResponse({url:"/config-service/config/v1/_search",body:{criteria:{schemaCode:"NotificationChannel",tenantId:h}},useCache:!1,method:"POST",userService:!1})).then(function(n){var o,l;const i=null==n||null===(o=n.configData)||void 0===o?void 0:o.find(e=>"WHATSAPP"===e.uniqueIdentifier);if(!0!==(null==i||null===(l=i.data)||void 0===l?void 0:l.enabled))return null;const r=Digit.StoreData.getCurrentLanguage()||localStorage.getItem("locale")||localStorage.getItem("Citizen.locale")||"en_IN";return Promise.resolve(Digit.CustomService.getResponse({url:"/user-preference/v1/_upsert",body:{preference:{userId:null==e?void 0:e.uuid,tenantId:t,preferenceCode:"USER_NOTIFICATION_PREFERENCES",payload:{consent:{SMS:{scope:"GLOBAL",status:"REVOKED"},EMAIL:{scope:"GLOBAL",status:"REVOKED"},WHATSAPP:{scope:"GLOBAL",status:G?"GRANTED":"REVOKED"}},preferredLanguage:r}}},useCache:!1,method:"POST",userService:!1}))})},function(e){return console.error("Error saving user preferences:",e),null}):null)}catch(e){return Promise.reject(e)}},ne=function(e){return Promise.resolve(Ge(function(){return Promise.resolve(Digit.UserService.sendOtp(e,h)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return o.createElement("div",{className:"citizen-form-wrapper"},o.createElement(a.Switch,null,o.createElement(t.AppContainer,null,S.pathname.includes("login")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement(a.Route,{path:""+C,exact:!0},o.createElement(Je,{onSelect:function(e){try{z(!1);const{whatsappConsent:t,...n}=e;void 0!==t&&V(t),x({...R,...n});const o={...n,tenantId:h,userType:"citizen"};return Promise.resolve(y?Promise.resolve(ne({otp:{...o,...rt}})).then(function(e){var t;let[n,l]=e;var i,r,a;if(!l)return z(!0),void N.replace(C+"/otp",{from:ct(S.state,k),role:null===(i=S.state)||void 0===i?void 0:i.role});z(!0),S.state&&"FSM_DSO"===S.state.role||N.push(`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/register/name`,{from:ct(S.state,k),data:o}),null!==(t=S.state)&&void 0!==t&&t.role&&(z(!0),_("FSM_DSO"===(null===(a=S.state)||void 0===a?void 0:a.role)?b("ES_ERROR_DSO_LOGIN"):"User not registered."))}):function(){if(!W)return Promise.resolve(ne({otp:{...o,...it}})).then(function(e){let[t,n]=e;if(!n)return z(!0),void N.replace(C+"/otp",{from:ct(S.state,k)});z(!0)});z(!0),N.replace(C+"/name",{from:ct(S.state,k),data:o})}())}catch(e){return Promise.reject(e)}},config:ee[0],mobileNumber:R.mobileNumber||"",emailId:R.userName||"",onMobileChange:e=>{const{value:t}=e.target;x({...R,mobileNumber:t})},onEmailChange:e=>{const{value:t}=e.target;x({...R,userName:t})},onConsentChange:e=>{V(e)},canSubmit:H,showRegisterLink:y&&!(null!==(E=S.state)&&void 0!==E&&E.role),t:b,validationConfig:Y,allValidationConfigs:$,enableUserPreferences:K,countryCode:R.countryCode||""})),o.createElement(a.Route,{path:C+"/otp"},o.createElement(tt,{config:{...ee[1],texts:{...ee[1].texts,cardText:`${ee[1].texts.cardText} ${R.mobileNumber||R.userName||""}`}},onOtpChange:e=>{x({...R,otp:e})},onResend:function(){try{const{mobileNumber:e,userName:t}=R,n={mobileNumber:e,userName:t,tenantId:h,userType:"citizen"},o=function(){if(!y&&W)_(b("PLEASE_COMPLETE_REGISTRATION")||"Please enter the OTP sent during registration.");else{const e=y?Promise.resolve(ne({otp:{...n,...rt}})).then(function(e){let[t,n]=e;n&&_(b("OTP_RESEND_ERROR")||"Failed to resend OTP")}):Promise.resolve(ne({otp:{...n,...it}})).then(function(e){let[t,n]=e;n&&_(b("OTP_RESEND_ERROR")||"Failed to resend OTP")});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(Ge(function(){T(!0),j(!1);const{mobileNumber:e,otp:t,name:n,userName:o}=R;return y||W?Promise.resolve(Digit.UserService.authenticate({username:e||o,password:t,tenantId:h,userType:"citizen"})).then(function(e){var t,n,o;let{UserRequest:l,...i}=e;if(null!==(t=S.state)&&void 0!==t&&t.role){const e=l.roles.find(e=>e.code===S.state.role);if(!e||!e.code)return _(b("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>N.replace(at),5e3)}return null!==(n=window)&&void 0!==n&&null!==(o=n.globalConfigs)&&void 0!==o&&o.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),Digit.UserService.setUser({info:l,...i}),st(l,null==i?void 0:i.access_token,h),Promise.resolve(new Promise(e=>setTimeout(e,300))).then(function(){return Promise.resolve(te(l,h)).then(function(){I({info:l,...i})})})}):Promise.resolve(Digit.UserService.registerUser({name:n,username:e||o,otpReference:t,tenantId:h},h)).then(function(e){var t,n;let{UserRequest:o,...l}=e;return null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),Digit.UserService.setUser({info:o,...l}),st(o,null==l?void 0:l.access_token,h),Promise.resolve(new Promise(e=>setTimeout(e,300))).then(function(){return Promise.resolve(te(o,h)).then(function(){I({info:o,...l})})})})},function(){j(!0),T(!1),_(b("INVALID_OTP")||"Invalid OTP")}))}catch(e){return Promise.reject(e)}},otp:R.otp,error:D,canSubmit:F,t:b})),o.createElement(a.Route,{path:C+"/name"},o.createElement(Ke,{config:ee[2],onSelect:function(e){try{B(!0);const t={...R,...e};return x(t),Promise.resolve(function(){if(!y&&W){const e=W+"/v1/_register",n={IndividualRegister:{tenantId:h,name:t.name,emailId:t.userName||"",mobileNumber:t.mobileNumber||"",requestType:"Register"}};return Ge(function(){return Promise.resolve(Digit.CustomService.getResponse({url:e,body:n,useCache:!1,method:"POST",userService:!1,auth:!1,params:{}})).then(function(e){if(!e)throw new Error("Registration API failed");B(!1),N.replace(C+"/otp",{from:ct(S.state,k)})})},function(e){console.error("Registration error:",e),B(!1),_(b("REGISTRATION_FAILED")||"Registration failed. Please try again.")})}{const t={...R,tenantId:h,userType:"citizen",...e};return Promise.resolve(ne({otp:{...t,...it}})).then(function(e){let[t,n]=e;t?(B(!1),N.replace(C+"/otp",{from:ct(S.state,k)})):B(!1)})}}())}catch(e){return Promise.reject(e)}},t:b,isDisabled:U})),w&&o.createElement(t.Toast,{type:"error",label:w,onClose:()=>_(null)}))))};var dt=e=>e instanceof HTMLElement;const mt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var pt=e=>null==e;const vt=e=>"object"==typeof e;var ft=e=>!pt(e)&&!Array.isArray(e)&&vt(e)&&!(e instanceof Date),gt=e=>/^\w*$/.test(e),Et=e=>e.filter(Boolean),ht=e=>Et(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function yt(e,t,n){let o=-1;const l=gt(t)?[t]:ht(t),i=l.length,r=i-1;for(;++o<i;){const t=l[o];let i=n;if(o!==r){const n=e[t];i=ft(n)||Array.isArray(n)?n:isNaN(+l[o+1])?{}:[]}e[t]=i,e=e[t]}return e}var bt=function(e,t){void 0===t&&(t={});for(const n in e)gt(n)?t[n]=e[n]:yt(t,n,e[n]);return t},St=e=>void 0===e,Ct=function(e,t,n){void 0===e&&(e={});const o=Et(t.split(/[,[\].]+?/)).reduce((e,t)=>pt(e)?e:e[t],e);return St(o)||o===e?St(e[t])?n:e[t]:o},Nt=(e,t)=>{dt(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const Ot={isValid:!1,value:null};var It=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,Ot):Ot,wt=e=>"radio"===e.type,_t=e=>"file"===e.type,Dt=e=>"checkbox"===e.type,Tt=e=>"select-multiple"===e.type;const At={value:!1,isValid:!1},Lt={value:!0,isValid:!0};var Rt=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.ref.checked).map(e=>{let{ref:{value:t}}=e;return t});return{value:t,isValid:!!t.length}}const{checked:t,value:n,attributes:o}=e[0].ref;return t?o&&!St(o.value)?St(n)||""===n?Lt:{value:n,isValid:!0}:Lt:At}return At};function xt(e,t,n,o,l){const i=e.current[t];if(i){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:a,valueAsDate:s,setValueAs:c}=i;if(t&&o)return;return _t(n)?n.files:wt(n)?It(i.options).value:Tt(n)?(r=n.options,[...r].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):Dt(n)?Rt(i.options).value:l?e:a?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var r;if(n)return Ct(n.current,t)}function Pt(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Pt(e.parentNode)}var Mt=e=>ft(e)&&!Object.keys(e).length,kt=e=>"boolean"==typeof e;function Ut(e,t){const n=gt(t)?[t]:ht(t),o=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=St(e)?o++:e[t[o++]];return e}(e,n);let l;o&&delete o[n[n.length-1]];for(let t=0;t<n.slice(0,-1).length;t++){let o,i=-1;const r=n.slice(0,-(t+1)),a=r.length-1;for(t>0&&(l=e);++i<r.length;){const t=r[i];o=o?o[t]:e[t],a===i&&(ft(o)&&Mt(o)||Array.isArray(o)&&!o.filter(e=>ft(e)&&!Mt(e)||kt(e)).length)&&(l?delete l[t]:delete e[t]),l=o}}return e}const Bt=(e,t)=>e&&e.ref===t;var Ft=e=>pt(e)||!vt(e);function jt(e,t){if(Ft(e)||Ft(t))return t;for(const n in t){const o=e[n],l=t[n];try{e[n]=ft(o)&&ft(l)||Array.isArray(o)&&Array.isArray(l)?jt(o,l):l}catch(e){}}return e}function Ht(e,t,o){if(Ft(e)||Ft(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){const n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(const l of n){const n=e[l];if(!o||"ref"!==l){const e=t[l];if((ft(n)||Array.isArray(n))&&(ft(e)||Array.isArray(e))?!Ht(n,e,o):n!==e)return!1}}}return!0}function zt(e,t,n,o,l){let i=-1;for(;++i<e.length;){for(const o in e[i])Array.isArray(e[i][o])?(!n[i]&&(n[i]={}),n[i][o]=[],zt(e[i][o],Ct(t[i]||{},o,[]),n[i][o],n[i],o)):Ht(Ct(t[i]||{},o),e[i][o])?yt(n[i]||{},o):n[i]=Object.assign(Object.assign({},n[i]),{[o]:!0});o&&!n.length&&delete o[l]}return n}var Gt=e=>"string"==typeof e,Vt=(e,t,n,o,l)=>{const i={};for(const t in e.current)(St(l)||(Gt(l)?t.startsWith(l):Array.isArray(l)&&l.find(e=>t.startsWith(e))))&&(i[t]=xt(e,t,void 0,o));return n?bt(i):jt(t,bt(i))},Wt=e=>e instanceof RegExp,Qt=e=>ft(e)&&!Wt(e)?e:{value:e,message:""},Xt=e=>"function"==typeof e,qt=e=>Gt(e)||n.isValidElement(e);function Zt(e,t,n){if(void 0===n&&(n="validate"),qt(e)||kt(e)&&!e)return{type:n,message:qt(e)?e:"",ref:t}}var Yt=(e,t,n,o,l)=>t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),{[o]:l||!0})}):{},$t=function(e,t,n,o){let{ref:l,ref:{value:i},options:r,required:a,maxLength:s,minLength:c,min:u,max:d,pattern:m,validate:p}=n;try{let n=!1;const v=l.name,f={},g=wt(l),E=Dt(l),h=g||E,y=""===i,b=Yt.bind(null,v,t,f),S=function(e,t,n,o,i){void 0===o&&(o="maxLength"),void 0===i&&(i="minLength");const r=e?t:n;f[v]=Object.assign({type:e?o:i,message:r,ref:l},b(e?o:i,r))};if(a&&(!g&&!E&&(y||pt(i))||kt(i)&&!i||E&&!Rt(r).isValid||g&&!It(r).isValid)){const{value:n,message:o}=qt(a)?{value:!!a,message:a}:Qt(a);if(n&&(f[v]=Object.assign({type:"required",message:o,ref:h?((e.current[v].options||[])[0]||{}).ref:l},b("required",o)),!t))return Promise.resolve(f)}if(!(pt(u)&&pt(d)||""===i)){let e,n;const o=Qt(d),r=Qt(u);if(isNaN(i)){const t=l.valueAsDate||new Date(i);Gt(o.value)&&(e=t>new Date(o.value)),Gt(r.value)&&(n=t<new Date(r.value))}else{const t=l.valueAsNumber||parseFloat(i);pt(o.value)||(e=t>o.value),pt(r.value)||(n=t<r.value)}if((e||n)&&(S(!!e,o.message,r.message,"max","min"),!t))return Promise.resolve(f)}if(Gt(i)&&!y&&(s||c)){const e=Qt(s),n=Qt(c),o=!pt(e.value)&&i.length>e.value,l=!pt(n.value)&&i.length<n.value;if((o||l)&&(S(o,e.message,n.message),!t))return Promise.resolve(f)}if(Gt(i)&&m&&!y){const{value:e,message:n}=Qt(m);if(Wt(e)&&!e.test(i)&&(f[v]=Object.assign({type:"pattern",message:n,ref:l},b("pattern",n)),!t))return Promise.resolve(f)}const C=function(){if(p){const i=xt(e,v,o,!1,!0),a=h&&r?r[0].ref:l;return Xt(p)?Promise.resolve(p(i)).then(function(e){const o=Zt(e,a);if(o&&(f[v]=Object.assign(Object.assign({},o),b("validate",o.message)),!t))return n=!0,f}):function(){if(ft(p)){let o=!1;function e(){if(!Mt(l)&&(f[v]=Object.assign({ref:a},l),!t))return n=!0,f}let l={};const r=ze(Object.entries(p),function(e){let[n,r]=e;if(Mt(l)||t)return Promise.resolve(r(i)).then(function(e){const o=Zt(e,a,n);o&&(l=Object.assign(Object.assign({},o),b(n,o.message)),t&&(f[v]=l))});o=!0},function(){return o});return r&&r.then?r.then(e):e()}}()}}();return Promise.resolve(C&&C.then?C.then(function(e){return n?e:f}):n?C:f)}catch(e){return Promise.reject(e)}};const Jt=function(e,t,n){void 0===n&&(n=[]);for(const o in t){const l=e+(ft(t)?"."+o:`[${o}]`);Ft(t[o])?n.push(l):Jt(l,t[o],n)}return n};var Kt=(e,t,n,o,l)=>{let i=void 0;return n.add(t),Mt(e)||(i=Ct(e,t),(ft(i)||Array.isArray(i))&&Jt(t,i).forEach(e=>n.add(e))),St(i)?l?o:Ct(o,t):i},en=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:o,isTouched:l,isReValidateOnBlur:i,isReValidateOnChange:r,isBlurEvent:a,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&o?!(l||a):(s?i:t)?!a:!(s?r:n)||a)},tn=e=>e.substring(0,e.indexOf("[")),nn=(e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),on="undefined"!=typeof window&&"undefined"!=typeof document;function ln(e){var t;let n;if(Ft(e)||on&&(e instanceof File||dt(e)))return e;if(!["Set","Map","Object","Date","Array"].includes(null===(t=e.constructor)||void 0===t?void 0:t.name))return e;if(e instanceof Date)return n=new Date(e.getTime()),n;if(e instanceof Set){n=new Set;for(const t of e)n.add(t);return n}if(e instanceof Map){n=new Map;for(const t of e.keys())n.set(t,ln(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=ln(e[t]);return n}var rn=e=>({isOnSubmit:!e||e===mt.onSubmit,isOnBlur:e===mt.onBlur,isOnChange:e===mt.onChange,isOnAll:e===mt.all,isOnTouch:e===mt.onTouched}),an=e=>wt(e)||Dt(e);const sn="undefined"==typeof window,cn=on?"Proxy"in window:"undefined"!=typeof Proxy,un=n.createContext(null);un.displayName="RHFContext";const dn=e=>{const{as:t,render:o}=e,l=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:i,meta:r}=function(e){let{name:t,rules:o,defaultValue:l,control:i,onFocus:r}=e;const a=n.useContext(un);if("production"!==process.env.NODE_ENV&&!i&&!a)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:u,unregister:d,trigger:m,mode:p,reValidateMode:{isReValidateOnBlur:v,isReValidateOnChange:f},formState:g,formStateRef:{current:{isSubmitted:E,touched:h,errors:y}},updateFormState:b,readFormStateRef:S,fieldsRef:C,fieldArrayNamesRef:N,shallowFieldsStateRef:O}=i||a.control,I=!nn(N.current,t),w=()=>!St(Ct(O.current,t))&&I?Ct(O.current,t):St(l)?Ct(s.current,t):l,[_,D]=n.useState(w()),T=n.useRef(_),A=n.useRef({focus:()=>null}),L=n.useRef(r||(()=>{Xt(A.current.focus)&&A.current.focus(),"production"!==process.env.NODE_ENV&&(Xt(A.current.focus)||console.warn("📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method"))})),R=n.useCallback(e=>!en(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:f,isSubmitted:E,isTouched:!!Ct(h,t)},p)),[v,f,E,h,t,p]),x=n.useCallback(e=>{let[t]=e;const n=(e=>Ft(e)||!ft(e.target)||ft(e.target)&&!e.type?e:St(e.target.value)?e.target.checked:e.target.value)(t);return D(n),T.current=n,n},[]),P=n.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!t)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");C.current[t]?C.current[t]=Object.assign({ref:C.current[t].ref},o):(u(Object.defineProperties({name:t,focus:L.current},{value:{set(e){D(e),T.current=e},get:()=>T.current}}),o),e=St(Ct(s.current,t))),e&&I&&D(w())},[o,t,u]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(St(_)&&console.warn(`📋 ${t} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`),!I&&St(l)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),P()},[P]),n.useEffect(()=>{!C.current[t]&&P(!0)});const M=n.useCallback(()=>{S.current.touched&&!Ct(h,t)&&(yt(h,t,!0),b({touched:h})),R(!0)&&m(t)},[t,b,R,m,S]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return c(t,x(n),{shouldValidate:R(),shouldDirty:!0})},[c,t,R]),onBlur:M,name:t,value:_,ref:A},meta:Object.defineProperties({invalid:!!Ct(y,t)},{isDirty:{get:()=>!!Ct(g.dirtyFields,t)},isTouched:{get:()=>!!Ct(g.touched,t)}})}}(e),a=Object.assign(Object.assign({},l),i);return t?n.isValidElement(t)?n.cloneElement(t,a):n.createElement(t,a):o?o(i,r):null},mn=e=>{let{control:n,t:l}=e;const i=window.Digit.Utils.browser.isMobile();return o.createElement(Fragment,null,o.createElement(t.SearchField,{className:"pt-form-field"},o.createElement("label",null,l("AUDIT_FROM_DATE_LABEL")),o.createElement(dn,{render:e=>o.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})),o.createElement(t.SearchField,{className:"pt-form-field"},o.createElement("label",null,l("AUDIT_TO_DATE_LABEL")),o.createElement(dn,{render:e=>o.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})),o.createElement(t.SearchField,{className:"pt-search-action-submit"},o.createElement(t.Button,{style:{marginTop:i?"510px":"25px",marginLeft:i?"0":"-30px",maxWidth:i?"100%":"240px"},label:l("ES_COMMON_APPLY"),submit:!0})))},pn=e=>{var l;let{Controller:i,register:r,control:a,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:p,data:v,onSubmit:f,isLoading:g}=e;const[E,h]=n.useState([]),y=e=>o.createElement("div",{onClick:e.onClick},o.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==v?void 0:v.length)>0&&h([null==v?void 0:v.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=b(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[v]);const b=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,o=t.getDate();return n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${o}/${n}/${t.getFullYear()}`},S=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),o=t.getMinutes(),l=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${n}:${o} ${l}`},[C,N]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),O=()=>{N({type:"remove"})},I=()=>o.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:O},o.createElement(t.CloseSvg,null)),w={Controller:i,register:r,control:a,t:s,reset:c,previousPage:u},_=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:i,...r}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:i,...r}=e;const{closeMobilePopupModal:a}=r;switch(n){case"SearchFormComponent":return o.createElement(t.SearchForm,r,o.createElement(I,null),o.createElement("div",{className:"MobilePopupHeadingWrapper"},o.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),o.createElement(mn,m({},l,{closeMobilePopupModal:a,tenantId:i,t:s})));default:return o.createElement("span",null)}})({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:i,...r})},[C]);null==v||null===(l=v.roles)||void 0===l||l.forEach(e=>{});const D=n.useMemo(()=>null!=v&&v.display||""===v?[]:null==v?void 0:v.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:b(e.timestamp),[s("AUDIT_TIME_LABEL")]:S(e.timestamp),[s("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[s("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[s("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[v]);return o.createElement(o.Fragment,null,o.createElement(t.BackButton,null),o.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},o.createElement(y,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(E)})),o.createElement(t.HeaderComponent,null,s("PRIVACY_AUDIT_REPORT"),":"),o.createElement("div",{className:"digit-search-box"},o.createElement(t.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>N({type:"set",payload:"SearchFormComponent"}),tenantId:p,t:s})),C?o.createElement(t.PopUp,null,o.createElement(_,{onSubmit:e=>{N({type:"remove"}),f(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:w,currentlyActiveMobileModal:C,closeMobilePopupModal:O,tenantId:p})):null,g&&o.createElement(t.Loader,null),o.createElement(t.DetailsCard,{data:D}))},vn=e=>{let{tenantId:l,t:i,onSubmit:r,data:a,count:c}=e;const u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:m,handleSubmit:p,setValue:v,getValues:f,reset:g}=function(e){let{mode:t=mt.onSubmit,reValidateMode:o=mt.onChange,resolver:l,context:i,defaultValues:r={},shouldFocusError:a=!0,shouldUnregister:s=!0,criteriaMode:c}=void 0===e?{}:e;const u=n.useRef({}),d=n.useRef({}),m=n.useRef({}),p=n.useRef(new Set),v=n.useRef({}),f=n.useRef({}),g=n.useRef({}),E=n.useRef({}),h=n.useRef(r),y=n.useRef(!1),b=n.useRef(!1),S=n.useRef(),C=n.useRef({}),N=n.useRef({}),O=n.useRef(i),I=n.useRef(l),w=n.useRef(new Set),_=n.useRef(rn(t)),{isOnSubmit:D,isOnTouch:T}=_.current,A=c===mt.all,[L,R]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!D,errors:{}}),x=n.useRef({isDirty:!cn,dirtyFields:!cn,touched:!cn||T,isValidating:!cn,isSubmitting:!cn,isValid:!cn}),P=n.useRef(L),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(rn(o)).current;O.current=i,I.current=l,P.current=L,C.current=s?{}:Mt(C.current)?ln(r):C.current;const B=n.useCallback(function(e){void 0===e&&(e={}),y.current||(P.current=Object.assign(Object.assign({},P.current),e),R(P.current))},[]),F=()=>x.current.isValidating&&B({isValidating:!0}),j=n.useCallback(function(e,t,n,o,l){void 0===n&&(n=!1),void 0===o&&(o={});let i=n||(e=>{let{errors:t,name:n,error:o,validFields:l,fieldsWithValidation:i}=e;const r=St(o),a=Ct(t,n);return r&&!!a||!r&&!Ht(a,o,!0)||r&&Ct(i,n)&&!Ct(l,n)})({errors:P.current.errors,error:t,name:e,validFields:E.current,fieldsWithValidation:g.current});const r=Ct(P.current.errors,e);t?(Ut(E.current,e),i=i||!r||!Ht(r,t,!0),yt(P.current.errors,e,t)):((Ct(g.current,e)||I.current)&&(yt(E.current,e,!0),i=i||r),Ut(P.current.errors,e)),(i&&!pt(n)||!Mt(o)||x.current.isValidating)&&B(Object.assign(Object.assign(Object.assign({},o),I.current?{isValid:!!l}:{}),{isValidating:!1}))},[]),H=n.useCallback((e,t)=>{const{ref:n,options:o}=u.current[e],l=on&&dt(n)&&pt(t)?"":t;wt(n)?(o||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===l}):_t(n)&&!Gt(l)?n.files=l:Tt(n)?[...n.options].forEach(e=>e.selected=l.includes(e.value)):Dt(n)&&o?o.length>1?o.forEach(e=>{let{ref:t}=e;return t.checked=Array.isArray(l)?!!l.find(e=>e===t.value):l===t.value}):o[0].ref.checked=!!l:n.value=l},[]),z=n.useCallback((e,t)=>{if(x.current.isDirty){const n=J();return e&&t&&yt(n,e,t),!Ht(n,h.current)}return!1},[]),G=n.useCallback(function(e,t){if(void 0===t&&(t=!0),x.current.isDirty||x.current.dirtyFields){const n=!Ht(Ct(h.current,e),xt(u,e,C)),o=Ct(P.current.dirtyFields,e),l=P.current.isDirty;n?yt(P.current.dirtyFields,e,!0):Ut(P.current.dirtyFields,e);const i={isDirty:z(),dirtyFields:P.current.dirtyFields},r=x.current.isDirty&&l!==i.isDirty||x.current.dirtyFields&&o!==Ct(P.current.dirtyFields,e);return r&&t&&B(i),r?i:{}}return{}},[]),V=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||u.current[e]?Promise.resolve($t(u,A,u.current[e],C)).then(function(n){const o=n[e];return j(e,o,t),St(o)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[j,A]),W=n.useCallback(function(e){try{return Promise.resolve(I.current(J(),O.current,A)).then(function(t){let{errors:n}=t;const o=P.current.isValid;if(Array.isArray(e)){const t=e.map(e=>{const t=Ct(n,e);return t?yt(P.current.errors,e,t):Ut(P.current.errors,e),!t}).every(Boolean);return B({isValid:Mt(n),isValidating:!1}),t}{const t=Ct(n,e);return j(e,t,o!==Mt(n),{},Mt(n)),!t}})}catch(e){return Promise.reject(e)}},[j,A]),Q=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve(V(o))}const o=e||Object.keys(u.current);if(F(),I.current)return Promise.resolve(W(o));const l=function(){if(Array.isArray(o))return!e&&(P.current.errors={}),Promise.resolve(Promise.all(o.map(function(e){try{return Promise.resolve(V(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){B({isValidating:!1});const t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(l&&l.then?l.then(t):t(l))}catch(e){return Promise.reject(e)}},[W,V]),X=n.useCallback((e,t,n)=>{let{shouldDirty:o,shouldValidate:l}=n;const i={};yt(i,e,t);for(const n of Jt(e,t))u.current[n]&&(H(n,Ct(i,n)),o&&G(n),l&&Q(n))},[Q,H,G]),q=n.useCallback((e,t,n)=>{if(!s&&!Ft(t)&&yt(C.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),u.current[e])H(e,t),n.shouldDirty&&G(e),n.shouldValidate&&Q(e);else if(!Ft(t)&&(X(e,t,n),w.current.has(e))){const o=tn(e)||e;yt(d.current,e,t),N.current[o]({[o]:Ct(d.current,o)}),(x.current.isDirty||x.current.dirtyFields)&&n.shouldDirty&&(yt(P.current.dirtyFields,e,((e,t,n)=>jt(zt(e,t,n.slice(0,e.length)),zt(t,e,n.slice(0,e.length))))(t,Ct(h.current,e,[]),Ct(P.current.dirtyFields,e,[]))),B({isDirty:!Ht(Object.assign(Object.assign({},J()),{[e]:t}),h.current)}))}!s&&yt(C.current,e,t)},[G,H,X]),Z=e=>b.current||p.current.has(e)||p.current.has((e.match(/\w+/)||[])[0]),Y=e=>{let t=!0;if(!Mt(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(tn(e))||(f.current[n](),t=!1);return t};function $(e){if(!s){let t=ln(e);for(const e of w.current)gt(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function J(e){if(Gt(e))return xt(u,e,C);if(Array.isArray(e)){const t={};for(const n of e)yt(t,n,xt(u,n,C));return t}return $(Vt(u,ln(C.current),s))}S.current=S.current?S.current:function(e){let{type:t,target:n}=e;try{let e=n.name;const o=u.current[e];let l,i;return Promise.resolve(function(){if(o){function r(){!a&&Y(e),j(e,l,m,d,i)}const a="blur"===t,c=en(Object.assign({isBlurEvent:a,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!Ct(P.current.touched,e),isSubmitted:P.current.isSubmitted},_.current));let d=G(e,!1),m=!Mt(d)||!a&&Z(e);if(a&&!Ct(P.current.touched,e)&&x.current.touched&&(yt(P.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:P.current.touched})),!s&&Dt(n)&&yt(C.current,e,xt(u,e)),c)return!a&&Y(e),(!Mt(d)||m&&Mt(d))&&B(d);F();const p=I.current?Promise.resolve(I.current(J(),O.current,A)).then(function(t){let{errors:o}=t;const r=P.current.isValid;if(l=Ct(o,e),Dt(n)&&!l&&I.current){const t=tn(e),n=Ct(o,t,{});n.type&&n.message&&(l=n),t&&(n||Ct(P.current.errors,t))&&(e=t)}i=Mt(o),r!==i&&(m=!0)}):Promise.resolve($t(u,A,o,C)).then(function(t){l=t[e]});return p&&p.then?p.then(r):r()}}())}catch(e){return Promise.reject(e)}};const K=n.useCallback(function(e){void 0===e&&(e={});try{const t=Mt(u.current)?h.current:{};return Promise.resolve(I.current(Object.assign(Object.assign(Object.assign({},t),J()),e),O.current,A)).then(function(e){let{errors:t}=e;const n=Mt(t);P.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[A]),ee=n.useCallback((e,t)=>{!function(e,t,n,o,l,i){const{ref:r,ref:{name:a}}=n,s=e.current[a];if(!l){const t=xt(e,a,o);!St(t)&&yt(o.current,a,t)}r.type&&s?wt(r)||Dt(r)?Array.isArray(s.options)&&s.options.length?(Et(s.options).forEach(function(e,n){void 0===e&&(e={}),(Pt(e.ref)&&Bt(e,e.ref)||i)&&(Nt(e.ref,t),Ut(s.options,`[${n}]`))}),s.options&&!Et(s.options).length&&delete e.current[a]):delete e.current[a]:(Pt(r)&&Bt(s,r)||i)&&(Nt(r,t),delete e.current[a]):delete e.current[a]}(u,S.current,e,C,s,t),s&&(Ut(E.current,e.ref.name),Ut(g.current,e.ref.name))},[s]),te=n.useCallback(e=>{if(b.current)B();else{for(const t of p.current)if(t.startsWith(e)){B();break}Y(e)}},[]),ne=n.useCallback((e,t)=>{e&&(ee(e,t),s&&!Et(e.options||[]).length&&(Ut(P.current.errors,e.ref.name),yt(P.current.dirtyFields,e.ref.name,!0),B({isDirty:z()}),x.current.isValid&&I.current&&K(),te(e.ref.name)))},[K,ee]),oe=n.useCallback((e,t,n)=>{const o=n?v.current[n]:p.current;let l=Vt(u,ln(C.current),s,!1,e);if(Gt(e)){const n=tn(e)||e;return w.current.has(n)&&(l=Object.assign(Object.assign({},m.current),l)),Kt(l,e,o,St(Ct(h.current,e))?t:Ct(h.current,e),!0)}const i=St(t)?h.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:Kt(l,t,o,i)}),{}):(b.current=St(n),bt(!Mt(l)&&l||i))},[]);function le(e,t){if(void 0===t&&(t={}),"production"!==process.env.NODE_ENV){if(!e.name)return console.warn("📋 Field is missing `name` attribute",e,"https://react-hook-form.com/api#useForm");if(w.current.has(e.name.split(/\[\d+\]$/)[0])&&!RegExp(`^${e.name.split(/\[\d+\]$/)[0]}[\\d+].\\w+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',e,"https://react-hook-form.com/api#useFieldArray")}const{name:n,type:o,value:l}=e,i=Object.assign({ref:e},t),r=u.current,a=an(e),c=nn(w.current,n),d=t=>on&&(!dt(e)||t===e);let m,p=r[n],v=!0;if(p&&(a?Array.isArray(p.options)&&Et(p.options).find(e=>l===e.ref.value&&d(e.ref)):d(p.ref)))return void(r[n]=Object.assign(Object.assign({},p),t));p=o?a?Object.assign({options:[...Et(p&&p.options||[]),{ref:e}],ref:{type:o,name:n}},t):Object.assign({},i):i,r[n]=p;const f=St(Ct(C.current,n));Mt(h.current)&&f||(m=Ct(f?h.current:C.current,n),v=St(m),v||c||H(n,m)),Mt(t)||(yt(g.current,n,!0),!D&&x.current.isValid&&$t(u,A,p,C).then(e=>{const t=P.current.isValid;Mt(e)?yt(E.current,n,!0):Ut(E.current,n),t!==Mt(e)&&B()})),!s||c&&v||!c&&Ut(P.current.dirtyFields,n),o&&function(e,t,n){let{ref:o}=e;dt(o)&&n&&(o.addEventListener(t?"change":"input",n),o.addEventListener("blur",n))}(a&&p.options?p.options[p.options.length-1]:p,a||"select-one"===e.type,S.current)}const ie=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let o={},l=$(Vt(u,ln(C.current),s,!0));return x.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(i,r){try{var s=function(){function i(){const i=function(){if(Mt(o)&&Object.keys(P.current.errors).every(e=>e in u.current))return B({errors:{},isSubmitting:!0}),Promise.resolve(e(l,n)).then(function(){});{function i(e){a&&((e,t)=>{for(const n in e)if(Ct(t,n)){const t=e[n];if(t){if(t.ref.focus&&St(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(u.current,P.current.errors)}return P.current.errors=Object.assign(Object.assign({},P.current.errors),o),t?Promise.resolve(t(P.current.errors,n)).then(i):i()}}();if(i&&i.then)return i.then(function(){})}const r=I.current?Promise.resolve(I.current(l,O.current,A)).then(function(e){let{errors:t,values:n}=e;P.current.errors=o=t,l=n}):ze(Object.values(u.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve($t(u,A,e,C)).then(function(e){e[t]?(yt(o,t,e[t]),Ut(E.current,t)):Ct(g.current,t)&&(Ut(P.current.errors,t),yt(E.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return r&&r.then?r.then(i):i()}()}catch(e){return r(!0,e)}return s&&s.then?s.then(r.bind(null,!1),r.bind(null,!0)):r(!1,s)}(0,function(e,t){if(P.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Mt(P.current.errors),submitCount:P.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[a,A]);n.useEffect(()=>{l&&x.current.isValid&&K(),M.current=M.current||!on?M.current:function(e,t){const n=new MutationObserver(()=>{for(const n of Object.values(e.current))if(n&&n.options)for(const e of n.options)e&&e.ref&&Pt(e.ref)&&t(n);else n&&Pt(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(u,ne)},[ne,h.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),y.current=!0,"production"===process.env.NODE_ENV&&Object.values(u.current).forEach(e=>ne(e,!0))},[]),!l&&x.current.isValid&&(L.isValid=Ht(E.current,g.current)&&Mt(P.current.errors));const re={trigger:Q,setValue:n.useCallback(function(e,t,n){q(e,t,n||{}),Z(e)&&B(),Y(e)},[q,Q]),getValues:n.useCallback(J,[]),register:n.useCallback(function(e,t){if(!sn)if(Gt(e))le({name:e},t);else{if(!ft(e)||!("name"in e))return t=>t&&le(t,e);le(e,t)}},[h.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])ne(u.current[t],!0)},[]),formState:cn?new Proxy(L,{get:(e,t)=>{if("production"!==process.env.NODE_ENV&&"isValid"===t&&D&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return x.current[t]=!0,e[t]}}):L},ae=n.useMemo(()=>Object.assign({isFormDirty:z,updateWatchedValue:te,shouldUnregister:s,updateFormState:B,removeFieldEventListener:ee,watchInternal:oe,mode:_.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:l?K:void 0,fieldsRef:u,resetFieldArrayFunctionRef:N,useWatchFieldsRef:v,useWatchRenderFunctionsRef:f,fieldArrayDefaultValuesRef:d,validFieldsRef:E,fieldsWithValidationRef:g,fieldArrayNamesRef:w,readFormStateRef:x,formStateRef:P,defaultValuesRef:h,shallowFieldsStateRef:C,fieldArrayValuesRef:m},re),[h.current,te,s,ee,oe]);return Object.assign({watch:function(e,t){return oe(e,t)},control:ae,handleSubmit:ie,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),on)for(const e of Object.values(u.current))if(e){const{ref:t,options:n}=e,o=an(t)&&Array.isArray(n)?n[0].ref:t;if(dt(o))try{o.closest("form").reset();break}catch(e){}}u.current={},h.current=Object.assign({},e||h.current),e&&Y(""),Object.values(N.current).forEach(e=>Xt(e)&&e()),C.current=s?{}:ln(e||h.current),(e=>{let{errors:t,isDirty:n,isSubmitted:o,touched:l,isValid:i,submitCount:r,dirtyFields:a}=e;i||(E.current={},g.current={}),d.current={},p.current=new Set,b.current=!1,B({submitCount:r?P.current.submitCount:0,isDirty:!!n&&P.current.isDirty,isSubmitted:!!o&&P.current.isSubmitted,isValid:!!i&&P.current.isValid,dirtyFields:a?P.current.dirtyFields:{},touched:l?P.current.touched:{},errors:t?P.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>u.current[e]&&gt(e)?delete P.current.errors[e]:Ut(P.current.errors,e)),B({errors:e?P.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(u.current[e]||{}).ref;yt(P.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:L.errors},re)}({defaultValues:u}),E=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,o=t.getDate();return n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${o}/${n}/${t.getFullYear()}`},h=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),o=t.getMinutes(),l=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${n}:${o} ${l}`},[y,b]=n.useState([]),S=e=>o.createElement("div",{onClick:e.onClick},o.createElement(s.DownloadBtnCommon,null));n.useEffect(()=>{d("offset",0),d("limit",5),d("sortOrder","DESC")},[d]),n.useEffect(()=>{(null==a?void 0:a.length)>0&&b([null==a?void 0:a.map(e=>{let t={};return t[i("AUDIT_DATE_LABEL")]=E(null==e?void 0:e.timestamp),t[i("AUDIT_TIME_LABEL")]=h(null==e?void 0:e.timestamp),t[i("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[i("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[i("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[a]);const C=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function N(){v("offset",f("offset")-f("limit")),p(r)()}const O=window.Digit.Utils.browser.isMobile();if(O)return o.createElement(pn,{Controller:dn,register:d,control:m,t:i,reset:g,previousPage:N,handleSubmit:p,tenantId:l,data:a,onSubmit:r});const I=e=>o.createElement("span",{className:"cell-text"},e),w=n.useMemo(()=>[{Header:i("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?i("WS_NA"):E(e.timestamp);return I(""+t)}},{Header:i("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?i("WS_NA"):h(e.timestamp);return I(""+t)}},{Header:i(O?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataView))},{Header:i(O?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataViewedBy))},{Header:i("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return I(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return o.createElement(o.Fragment,null,o.createElement("div",{style:{marginRight:"-70px"}}," ",o.createElement(t.BackButton,null)," "),o.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",o.createElement(t.HeaderComponent,null,i("PRIVACY_AUDIT_REPORT"))," "),o.createElement(t.SearchForm,{className:"audit-card",onSubmit:r,handleSubmit:p},o.createElement(mn,{register:d,control:m,reset:g,tenantId:l,t:i,previousPage:N})),o.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=a&&a.display?o.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},i(a.display).split("\\n").map((e,t)=>o.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==a?o.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},o.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},o.createElement(S,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(y)})),o.createElement(s.Table,{t:i,data:a,totalRecords:c,columns:w,getCellProps:e=>({style:{minWidth:e.column.Header===i("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){v("limit",Number(e.target.value)),p(r)()},currentPage:f("offset")/f("limit"),onNextPage:function(){v("offset",f("offset")+f("limit")),p(r)()},onPrevPage:N,manualPagination:!1,pageSizeLimit:f("limit"),onSort:C,disableSort:!1,sortParams:[{id:f("sortBy"),desc:"DESC"===f("sortOrder")}]})):o.createElement(t.Loader,null)))},fn=e=>{var t,i;const{t:r}=l.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(),[s,c]=n.useState({}),u=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),o=new Date(Date.UTC(n[1],n[2]-1,n[3]));return o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),"dayend"===t&&(o.setHours(o.getHours()+24),o.setSeconds(o.getSeconds()-1)),o.getTime()}catch(t){return e}};n.useEffect(()=>{const e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){const t={...e};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(s&&Object.keys(s).length>0)},m={...s},{isLoading:p,data:v}=Digit.Hooks.useAudit({tenantId:a,filters:{...m},config:d});return o.createElement(vn,{t:r,tenantId:a,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t={...e,fromDate:u(null==e?void 0:e.fromDate),toDate:u(null==e?void 0:e.toDate)};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:t[n]}),{}))},data:p?"":(null==v||null===(t=v.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==v?void 0:v.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==v||null===(i=v.ElasticSearchData)||void 0===i?void 0:i.length})},gn=e=>{var n,i,r,a,s,c,u,d,m,p,v,f,g,E,h,y;let{moduleCode:b}=e;const{t:S}=l.useTranslation(),C=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:N,data:O}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:I,error:w,data:_}=Digit.Hooks.useDynamicData({moduleCode:b,tenantId:C,filters:{},t:S}),D=e=>{let{module:n,styles:l}=e;switch(n){case"TL":return o.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:l});case"PT":return o.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:l});case"MCOLLECT":return o.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:l});case"PGR":return o.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:l});default:return o.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:l})}},T=null==O||null===(n=O.MdmsRes["common-masters"])||void 0===n||null===(i=n.StaticData[0])||void 0===i?void 0:i[""+b],A=e=>{let{module:n}=e;switch(n){case"PT":case"WS":return o.createElement("span",{className:"timerIcon"},o.createElement(t.TimerIcon,null));default:return null}},L=e=>{let{module:n}=e;switch(n){case"PT":return o.createElement("span",{className:"rupeeSymbol"},o.createElement(t.RupeeSymbol,null));case"WS":return o.createElement("span",{className:"timerIcon"},o.createElement(t.TimerIcon,null));default:return null}},R=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:S("COMMON_VALIDITY"),validity:(null==T?void 0:T.validity)+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:S("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:S("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==T?void 0:T.validity)+" "+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},x=e=>{switch(e){case"PT":return{staticDataOne:(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS"),staticDataOneHeader:S("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==T?void 0:T.staticDataTwo,staticDataTwoHeader:S("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:S("PAY_WATER_CHARGES_BY")+" "+(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS")+" "+S("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==T?void 0:T.staticDataTwo)+" "+S("COMMON_DAYS"),staticDataTwoHeader:S("APPLICATION_PROCESSING_TIME")};default:return{}}};return N||I?o.createElement(t.Loader,null):T?o.createElement(o.Fragment,null,T&&null!=T&&T.payViaWhatsApp?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"pay-whatsapp-card",onClick:()=>{window.open(null==T?void 0:T.payViaWhatsApp)}},o.createElement("div",{className:"pay-whatsapp-text"},S("PAY_VIA_WHATSAPP")),o.createElement("div",{className:"whatsAppIconG"},o.createElement(t.WhatsappIconGreen,null)))):null,T&&null!=T&&T.helpline?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"static-home-Card"},o.createElement("div",{className:"static-home-Card-header"},S("CALL_CENTER_HELPLINE")),o.createElement("div",{className:"helplineIcon"},o.createElement(t.HelpLineIcon,null))),o.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(r=T.helpline)&&void 0!==r&&r.contactOne?o.createElement("div",{className:"call-center-card-content"},o.createElement("a",{href:"tel:"+(null==T||null===(a=T.helpline)||void 0===a?void 0:a.contactOne)},null==T||null===(s=T.helpline)||void 0===s?void 0:s.contactOne)):null,null!=T&&null!==(c=T.helpline)&&void 0!==c&&c.contactTwo?o.createElement("div",{className:"call-center-card-content"},o.createElement("a",{href:"tel:"+(null==T||null===(u=T.helpline)||void 0===u?void 0:u.contactTwo)},null==T||null===(d=T.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,T&&null!=T&&T.serviceCenter?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"static-home-Card"},o.createElement("div",{className:"static-home-Card-header"},S("CITIZEN_SERVICE_CENTER")),o.createElement("div",{className:"serviceCentrIcon"},o.createElement(t.ServiceCenterIcon,null))),o.createElement("div",{className:"service-center-details-card"},o.createElement("div",{className:"service-center-details-text"},null==T?void 0:T.serviceCenter)),null!=T&&T.viewMapLocation?o.createElement("div",{className:"link"},o.createElement("a",{href:null==T?void 0:T.viewMapLocation},S("VIEW_ON_MAP"))):null):o.createElement("div",null),o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},w||null==_||null===(null==_?void 0:_.dynamicDataOne)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(D,{module:b,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataOne))),w||null==_||null===(null==_?void 0:_.dynamicDataTwo)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(D,{module:b,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement(A,{module:b}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=x(b))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(p=x(b))||void 0===p?void 0:p.staticDataOneHeader),o.createElement("span",{className:"static-data-content-second"},""+(null===(v=x(b))||void 0===v?void 0:v.staticDataOne))))):o.createElement("div",null),T&&null!=T&&T.staticDataTwo?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement(L,{module:b}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(f=x(b))||void 0===f?void 0:f.staticDataTwoHeader),o.createElement("span",{className:"static-data-content-second"},null===(g=x(b))||void 0===g?void 0:g.staticDataTwo)))):o.createElement("div",null),T&&null!=T&&T.validity?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement("span",{className:"validityIcon"},o.createElement(t.ValidityTimeIcon,null)),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(E=R(b))||void 0===E?void 0:E.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null===(h=R(b))||void 0===h?void 0:h.validity)))):o.createElement("div",null),w||null==_||null==_||!_.staticData||null===(null==_?void 0:_.staticData)?o.createElement("div",null):o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},"PGR"===b?o.createElement(D,{module:b,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):o.createElement("span",{className:"validityIcon"},o.createElement(t.ValidityTimeIcon,null)),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(y=R(b))||void 0===y?void 0:y.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null==_?void 0:_.staticData)))))):o.createElement(o.Fragment,null)};var En,hn,yn,bn,Sn;const Cn=[(null===(En=window)||void 0===En?void 0:En.contextPath)+"/citizen/register/name",`/${null===(hn=window)||void 0===hn?void 0:hn.contextPath}/citizen/select-language`,`/${null===(yn=window)||void 0===yn?void 0:yn.contextPath}/citizen/select-location`,`/${null===(bn=window)||void 0===bn?void 0:bn.contextPath}/citizen/login`,`/${null===(Sn=window)||void 0===Sn?void 0:Sn.contextPath}/citizen/register/otp`],Nn=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),On=e=>{var n,i,r;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:v,stateCode:f,modules:g,appTenants:E,pathname:h,initData:y}=e;const{isLoading:b,data:S,isFetched:C}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:`[?(@.url == '${Digit.Utils.getMultiRootTenant()?window.globalPath:window.contextPath}-card')]`}],{select:e=>{var t,n;return null==e||null===(t=e["ACCESSCONTROL-ACTIONS-TEST"])||void 0===t||null===(n=t["actions-test"])||void 0===n?void 0:n.filter(e=>!0===e.enabled).reduce((e,t)=>{var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t,...e[t.parentModule]]:[t],e},{})}}),N=Digit.Hooks.useRouteSubscription(h),{t:O}=l.useTranslation(),{path:I}=a.useRouteMatch(),w=a.useHistory(),_=Cn.some(e=>window.location.href.includes(e)),D=g.map((e,t)=>{let{code:n,tenants:l}=e;const i=Digit.ComponentRegistryService.getComponent(n+"Module");return i?o.createElement(a.Route,{key:t,path:`${I}/${n.toLowerCase()}`},o.createElement(i,{stateCode:f,moduleCode:n,userType:"citizen",tenants:Nn(l,E)})):null}),T=g.map((e,n)=>{let{code:l,bannerImage:i}=e,r=(Digit.ComponentRegistryService.getComponent(l+"Links"),C?fe(S,l,O):void 0);return"ACTION_TEST_WS"===(null==r?void 0:r.header)&&(null==r||r.links.sort((e,t)=>t.orderNumber-e.orderNumber)),o.createElement(o.Fragment,null,o.createElement(a.Route,{key:n,path:`${I}/${l.toLowerCase()}-home`},o.createElement("div",{className:"moduleLinkHomePage"},o.createElement(ne,{src:i||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),o.createElement(t.BackLink,{className:"moduleLinkHomePageBackButton",onClick:()=>window.history.back()}),o.createElement("h1",null,O("MODULE_"+l.toUpperCase())),o.createElement("div",{className:"moduleLinkHomePageModuleLinks"},r&&o.createElement(t.CitizenHomeCard,{header:O(null==r?void 0:r.header),links:null==r?void 0:r.links,Icon:()=>o.createElement("span",null),Info:"OBPS"===l?()=>o.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:O("CS_FILE_APPLICATION_INFO_LABEL"),text:O("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===l})),o.createElement(gn,{moduleCode:null==l?void 0:l.toUpperCase()}))),o.createElement(a.Route,{key:"faq"+n,path:`${I}/${l.toLowerCase()}-faq`},o.createElement(Pe,{module:null==l?void 0:l.toUpperCase()})),o.createElement(a.Route,{key:"hiw"+n,path:`${I}/${l.toLowerCase()}-how-it-works`},o.createElement(Ye,{module:null==l?void 0:l.toUpperCase()})))});return o.createElement("div",{className:N},o.createElement(Re,{t:O,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:v,logoUrlWhite:null==s?void 0:s.logoUrlWhite,showSidebar:!!u,linkData:S,islinkDataLoading:b}),o.createElement("div",{className:"main center-container citizen-home-container mb-25"},_?null:o.createElement("div",{className:"SideBarStatic"},o.createElement(_e,{linkData:S,islinkDataLoading:b})),o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:I},o.createElement(Me,null)),o.createElement(a.Route,{exact:!0,path:I+"/select-language"},o.createElement(ke,null)),o.createElement(a.Route,{exact:!0,path:I+"/select-location"},o.createElement(Ue,null)),o.createElement(a.Route,{path:I+"/error"},o.createElement(ie,{initData:y,goToHome:()=>{var e,t,n,o;w.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(o=n.getType)||void 0===o?void 0:o.call(n)}`)}})),o.createElement(a.Route,{path:I+"/all-services"},o.createElement(he,{userType:"citizen",modules:g,getCitizenMenu:S,fetchedCitizen:C,isLoading:b})),o.createElement(a.Route,{path:I+"/login"},o.createElement(ut,{stateCode:f})),o.createElement(a.Route,{path:I+"/register"},o.createElement(ut,{stateCode:f,isUserRegistered:!1})),o.createElement(a.Route,{path:I+"/user/profile"},o.createElement(Ze,{stateCode:f,userType:"citizen",cityDetails:d})),o.createElement(a.Route,{path:I+"/Audit"},o.createElement(fn,null)),o.createElement(ae,{initData:y},D,T))),o.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},o.createElement(ne,{alt:"Powered by DIGIT",style:{height:"1.2em",cursor:"pointer"},src:null===(n=window)||void 0===n||null===(i=n.globalConfigs)||void 0===i||null===(r=i.getConfig)||void 0===r?void 0:r.call(i,"DIGIT_FOOTER"),onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))},In=e=>{let{children:t}=e;return o.createElement("div",{className:"banner banner-container"},t)},wn=e=>{var n,i,r;let{showTenant:a=!0}=e;const{data:s,isLoading:c}=Digit.Hooks.useStore.getInitData(),{stateInfo:u}=s||{},{t:d}=l.useTranslation();if(c)return o.createElement(t.Loader,null);const m=null===(n=window)||void 0===n||null===(i=n.globalConfigs)||void 0===i?void 0:i.getConfig("SVG_HEADER_SECONDARY_LOGO_URL");return m?o.createElement("div",{className:"bannerHeader secondaryBannerHeader"},o.createElement(ne,{className:"bannerLogo",src:null==u?void 0:u.logoUrl,style:a?{}:{borderRight:"unset"},alt:"Digit Banner"}),o.createElement("span",{style:{fontSize:"xx-large"}},"|"),o.createElement(ne,{className:"svgHeaderLogo",src:m,alt:"DIGIT Logo"})):o.createElement("div",{className:"bannerHeader"},o.createElement(ne,{className:"bannerLogo",src:null==u?void 0:u.logoUrl,style:a?{}:{borderRight:"unset"},alt:"Digit Banner"}),a&&(null==u?void 0:u.code)&&o.createElement("p",null,d("TENANT_TENANTS_"+(null==u||null===(r=u.code)||void 0===r?void 0:r.toUpperCase()))))},_n=e=>{var l,i,r;let{config:c,t:u}=e;const[d,m]=n.useState(null),{mobile_number:p,tenantId:v}=Digit.Hooks.useQueryParams(),f=a.useHistory(),[g,E]=n.useState(""),[h,y]=n.useState(!0),[b,S]=n.useState(null),C=()=>Digit.UserService.getType();n.useEffect(()=>{var e,t;if(!d)return void Digit.UserService.setType("employee");Digit.UserService.setUser(d);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;f.replace(n)},[d]);const N=()=>{S(null)},[O,I,w]=c.inputs,_=[{body:[{label:u(O.label),type:O.type,populators:{name:O.name},isMandatory:!0},{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0},{label:u(w.label),type:w.type,populators:{name:w.name},isMandatory:!0}]}];return o.createElement(In,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{variant:"primary",style:{borderBottom:"none"}})),o.createElement(s.FormComposer,{onSubmit:function(e){try{return Promise.resolve(Ge(function(){if(e.newPassword!==e.confirmPassword)return S(u("ERR_PASSWORD_DO_NOT_MATCH"));const t={...e,otpReference:g,tenantId:v,type:C().toUpperCase()};return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){(()=>{var e;f.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/login`)})()})},function(e){var t,n,o,l,i;S((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.error)||void 0===o||null===(l=o.fields)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.message)||u("ES_SOMETHING_WRONG")),setTimeout(N,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},o.createElement(wn,null),o.createElement(s.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),o.createElement(s.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",o.createElement("b",null," ",""+u("+ 91 - ")," ",p)),o.createElement(tt,{t:u,userType:"employee",otp:g,onOtpChange:E,error:h,onResend:function(){try{function e(){setTimeout(N,5e3)}const t={otp:{mobileNumber:p,userType:C().toUpperCase(),type:"passwordreset",tenantId:v}},n=Ge(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){S(u("ES_OTP_RESEND"))})},function(e){var t,n;S((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||u("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),b&&o.createElement(t.Toast,{type:"error",label:u(b),onClose:N}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(i=l.globalConfigs)||void 0===i||null===(r=i.getConfig)||void 0===r?void 0:r.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};_n.propTypes={loginParams:te.any},_n.defaultProps={loginParams:null};const Dn=[{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"}]}],Tn=()=>{const{t:e}=l.useTranslation(),{path:t}=a.useRouteMatch(),i=n.useMemo(()=>Dn.map(t=>{const n={};for(const o in t.texts)n[o]=e(t.texts[o]);return{...t,texts:n}},[Dn]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+t,exact:!0},o.createElement(_n,{config:i[0],t:e})))},An=[{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"}]}],Ln=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_LOGIN",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",key:"username",isMandatory:!0,populators:{name:"username",validation:{required:!0},error:"ERR_USERNAME_REQUIRED"}},{label:"CORE_LOGIN_PASSWORD",type:"password",key:"password",isMandatory:!0,populators:{name:"password",validation:{required:!0},error:"ERR_PASSWORD_REQUIRED"}},{isMandatory:!0,type:"dropdown",key:"city",label:"CORE_COMMON_CITY",disable:!1,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:!1,component:"PrivacyComponent",populators:{name:"check"},customProps:{module:"HCM"},isMandatory:!1,withoutLabel:!0}]}],Rn=e=>{var t;let{bannerImages:i=[]}=e;const[r,a]=n.useState(0),{t:s}=l.useTranslation(),c=i||(null===(t=Ln[0])||void 0===t?void 0:t.bannerImages)||[],u=()=>{a(e=>e===c.length-1?0:e+1)};return n.useEffect(()=>{const e=setInterval(()=>{u()},5e3);return()=>clearInterval(e)},[c.length]),o.createElement(n.Fragment,null,o.createElement("div",{className:"carousel-container"},c.sort((e,t)=>(null==e?void 0:e.id)-(null==t?void 0:t.id)).map((e,t)=>o.createElement("div",{key:e.id,className:"carousel-slide "+(t===r?"active":""),style:{backgroundImage:`url(${e.image})`}},o.createElement("div",{className:"carousel-content"},o.createElement("h2",null,s(e.title)),o.createElement("p",null,s(e.description))))),o.createElement("div",{className:"carousel-controls"},o.createElement("button",{className:"carousel-nav",onClick:()=>{a(e=>0===e?c.length-1:e-1)}},"<"),o.createElement("div",{className:"carousel-indicators"},c.map((e,t)=>o.createElement("button",{key:t,className:"indicator "+(t===r?"active":""),onClick:()=>(e=>{a(e)})(t)}))),o.createElement("button",{className:"carousel-nav",onClick:u},">"))))},xn=e=>{const t=Digit.Utils.getConfigModuleName();return Digit.Hooks.useCommonMDMS(e,t,["LoginConfig"],{select:e=>{var n;return{config:null==e||null===(n=e[t])||void 0===n?void 0:n.LoginConfig}},retry:!1})},Pn=e=>{var l,i,r,s,c,u;let{config:d,t:m,stateCode:p}=e;const{data:v,isLoading:f}=Digit.Hooks.useTenants(),[g,E]=n.useState(null),h=a.useHistory(),[y,b]=n.useState(null),{data:S}=xn(p);if(null!=S&&S.config){var C;const e=null==S||null===(C=S.config[0])||void 0===C?void 0:C.bannerImages;d.bannerImages=e}n.useEffect(()=>{var e,t;if(!g)return void Digit.UserService.setType("employee");Digit.UserService.setUser(g);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;h.replace(n)},[g]);const N=()=>{b(null)},O=function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();const t={otp:{userName:e.username,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=Ge(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;h.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/change-password?USERNAME=${e.username}&tenantId=${e.city.code}`)})},function(e){var t,n,o,l,i;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.error)||void 0===o||null===(l=o.fields)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.message)||"Invalid login credentials!"),setTimeout(N,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},I=()=>{var e;h.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/login`)},[w,_]=d.inputs,D=[{body:[{label:m("USERNAME"),type:"text",populators:{name:"username"},isMandatory:!0},{label:m(_.label),type:_.type,populators:{name:_.name,optionsKey:"name",required:!0,options:v},isMandatory:!0}]}];return f?o.createElement(t.Loader,{page:!0,variant:"PageLoader"}):null!=d&&d.bannerImages?o.createElement(o.Fragment,null,o.createElement("div",{className:"login-container"},o.createElement(Rn,{bannerImages:null==d?void 0:d.bannerImages}),o.createElement("div",{className:"login-form-container"},o.createElement(t.FormComposerV2,{onSubmit:O,noBoxShadow:!0,inline:!0,submitInForm:!0,config:D,label:d.texts.submitButtonLabel,secondaryActionLabel:d.texts.secondaryButtonLabel,onSecondayActionClick:I,heading:d.texts.header,description:d.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},o.createElement(wn,null)),y&&o.createElement(t.Toast,{type:"error",label:m(y),onClose:N}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(i=l.globalConfigs)||void 0===i||null===(r=i.getConfig)||void 0===r?void 0:r.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," ")))):o.createElement(In,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:O,noBoxShadow:!0,inline:!0,submitInForm:!0,config:D,label:d.texts.submitButtonLabel,secondaryActionLabel:d.texts.secondaryButtonLabel,onSecondayActionClick:I,heading:d.texts.header,description:d.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},o.createElement(wn,null)),y&&o.createElement(t.Toast,{type:"error",label:m(y),onClose:N}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(s=window)||void 0===s||null===(c=s.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Pn.propTypes={loginParams:te.any},Pn.defaultProps={loginParams:null};const Mn=e=>{let{stateCode:t}=e;const{t:i}=l.useTranslation(),{path:r}=a.useRouteMatch(),s=n.useMemo(()=>An.map(e=>{const t={};for(const n in e.texts)t[n]=i(e.texts[n]);return{...e,texts:t}},[An]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+r,exact:!0},o.createElement(Pn,{config:s[0],t:i,stateCode:t})))},kn=(e,t)=>t.filter(t=>{var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,e=>e.code).includes(t.code)}),Un=e=>{var t;let{stateCode:n,userType:l,modules:i,appTenants:r,additionalComponent:s}=e;Digit;const{path:c}=a.useRouteMatch(),u=a.useLocation(),d=Digit.UserService.getUser();var m;if(!d||null==d||!d.access_token||null==d||!d.info)return o.createElement(a.Redirect,{to:{pathname:`/${null===(m=window)||void 0===m?void 0:m.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}});const p=null==i?void 0:i.map((e,t)=>{var i;let{code:s,tenants:u}=e;const d=Digit.ComponentRegistryService.getComponent(s+"Module");return o.createElement(a.Route,{key:t,path:`${c}/${s.toLowerCase()}`},d?o.createElement(d,{stateCode:n,moduleCode:s,userType:l,tenants:kn(u,r)}):o.createElement(a.Redirect,{to:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/employee/user/error?type=notfound&module=${s}`}))}),v=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return u.pathname.includes(c+"/productDetailsPage/"),o.createElement("div",{className:v?"":"ground-container digit-home-ground"},o.createElement(a.Switch,null,p,o.createElement(a.Route,{path:c+"/login"},o.createElement(a.Redirect,{to:{pathname:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}})),o.createElement(a.Route,{path:c+"/forgot-password"},o.createElement(Mn,null)),o.createElement(a.Route,{path:c+"/change-password"},o.createElement(Tn,null)),o.createElement(a.Route,null,o.createElement(he,{userType:l,modules:i,additionalComponent:s}))))};var Bn,Fn,jn;const Hn={label:"English",value:null===(Bn=Digit)||void 0===Bn||null===(Fn=Bn.Utils)||void 0===Fn||null===(jn=Fn.getDefaultLanguage)||void 0===jn?void 0:jn.call(Fn)},zn=()=>{var e,i,r,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=l.useTranslation(),v=a.useHistory(),{languages:f,stateInfo:g}=d||{};let E=f;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[Hn]);const h=Digit.StoreData.getCurrentLanguage(),[y,b]=n.useState(h),S=(null==f?void 0:f.length)>1;return m?o.createElement(t.Loader,null):S?o.createElement(In,null,o.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},o.createElement("div",{className:"bannerHeader"},o.createElement(ne,{className:"bannerLogo",src:null==g?void 0:g.logoUrl,alt:"Digit Banner Image"}),o.createElement("p",null,p("TENANT_TENANTS_"+(null==g||null===(i=g.code)||void 0===i?void 0:i.toUpperCase())))),o.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},E.map((e,t)=>o.createElement("div",{className:"language-button-container",key:t},o.createElement(s.CustomButton,{selected:e.value===y,text:p(e.label),onClick:()=>(e=>{b(e.value),Digit.LocalizationService.changeLanguage(e.value,g.code)})(e)})))),o.createElement(t.SubmitBar,{style:{width:"100%"},label:p("CORE_COMMON_CONTINUE"),onSubmit:e=>{var t;v.push(`/${t=window.contextPath,t&&"string"==typeof t?t.split("/")[0]:""}/user/login?ts=${Date.now()}`)}})),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(c=r.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," ")):o.createElement(a.Redirect,{to:`/${null===(C=window)||void 0===C?void 0:C.contextPath}/employee/user/login`});var C},Gn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!0,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],Vn=e=>{var l,i,r,s,c,u,d,m,p,v;let{config:f,t:g,isDisabled:E,loginOTPBased:h}=e;const{isLoading:y}=Digit.Hooks.useTenants(),{data:b,isLoading:S}=Digit.Hooks.useStore.getInitData(),{stateInfo:C}=b||{},[N,O]=n.useState(null),[I,w]=n.useState(null),[_,D]=n.useState(!1),T=null===(l=Digit.ComponentRegistryService)||void 0===l?void 0:l.getComponent("DynamicLoginComponent"),A=a.useHistory();n.useEffect(()=>{var e,t,n,o,l,i,r,a,s,c,u,d,m,p,v,f,g,E;if(!N)return;Digit.SessionStorage.set("citizen.userRequestObject",N);const h=null==N||null===(e=N.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==N||null===(n=N.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(N.info.roles=h),Digit.UserService.setUser(N),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant()&&"development"!==process.env.NODE_ENV)return;let o=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Employee.locale",o),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==N?void 0:N.info,null==N?void 0:N.access_token);let y=`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`;var b,S,C,O,I,w,_;null!==(i=window)&&void 0!==i&&null!==(r=i.location)&&void 0!==r&&null!==(a=r.href)&&void 0!==a&&a.includes("from=")&&(y=decodeURIComponent(null===(b=window)||void 0===b||null===(S=b.location)||void 0===S||null===(C=S.href)||void 0===C||null===(O=C.split("from="))||void 0===O?void 0:O[1])||`/${null===(I=window)||void 0===I?void 0:I.contextPath}/employee`),null!=N&&null!==(s=N.info)&&void 0!==s&&s.roles&&(null==N||null===(c=N.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=N&&null!==(d=N.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(e=>"NATADMIN"===e.code)&&(y=`/${null===(w=window)||void 0===w?void 0:w.contextPath}/employee/dss/landing/NURT_DASHBOARD`),null!=N&&null!==(p=N.info)&&void 0!==p&&p.roles&&(null==N||null===(v=N.info)||void 0===v||null===(f=v.roles)||void 0===f?void 0:f.length)>0&&null!=N&&null!==(g=N.info)&&void 0!==g&&null!==(E=g.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(y=`/${null===(_=window)||void 0===_?void 0:_.contextPath}/employee/dss/landing/home`),A.replace(y)},[N]);const L=function(e){try{var t,n,o;function l(){D(!1)}null!=e&&e.username&&(e.username=e.username.trim()),null!=e&&e.password&&(e.password=e.password.trim()),D(!0);const i={...e,...H,userType:"EMPLOYEE"};i.tenantId=(null==i||null===(t=i.city)||void 0===t?void 0:t.code)||(null===(n=Digit)||void 0===n||null===(o=n.ULBService)||void 0===o?void 0:o.getStateId()),delete i.city;const r=Ge(function(){return Promise.resolve(Digit.UserService.authenticate(i)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),O({info:t,...n})})},function(e){var t,n;w((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&g("ES_ERROR_USER_NOT_PERMITTED")||g("INVALID_LOGIN_CREDENTIALS")),setTimeout(M,5e3)});return Promise.resolve(r&&r.then?r.then(l):l())}catch(e){return Promise.reject(e)}},R={url:"/user-otp/v1/_send",params:{tenantId:null===(i=Digit)||void 0===i||null===(r=i.ULBService)||void 0===r?void 0:r.getStateId()},body:{},config:{enable:!1}},x=Digit.Hooks.useCustomAPIMutationHook(R),P=function(e){try{var t,n;const o=e.email;return Promise.resolve(x.mutate({body:{otp:{userName:e.email,type:"login",tenantId:null===(t=Digit)||void 0===t||null===(n=t.ULBService)||void 0===n?void 0:n.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,i,r,a,s;w(null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&l[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r||null===(a=r.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"),setTimeout(M,5e3)},onSuccess:function(e){try{var t,n,l;return A.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login/otp`,{state:{email:o,tenant:null===(n=Digit)||void 0===n||null===(l=n.ULBService)||void 0===l?void 0:l.getStateId()}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},M=()=>{w(null)},k=()=>{var e;A.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/forgot-password`)},U=Digit.ULBService.getStateId(),B={code:U,name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+U)};let F=[{body:null==f?void 0:f.inputs}];const{mode:j}=Digit.Hooks.useQueryParams();"admin"===j&&!1===(null==F||null===(s=F[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u?void 0:u.disable)&&null==(null==F||null===(d=F[0])||void 0===d||null===(m=d.body)||void 0===m||null===(p=m[2])||void 0===p||null===(v=p.populators)||void 0===v?void 0:v.defaultValue)&&(F[0].body[2].disable=!0,F[0].body[2].isMandatory=!1,F[0].body[2].populators.defaultValue=B);const H=n.useMemo(()=>Object.fromEntries(F[0].body.filter(e=>{var t,n;return(null==e||null===(t=e.populators)||void 0===t?void 0:t.defaultValue)&&(null==e||null===(n=e.populators)||void 0===n?void 0:n.name)}).map(e=>[e.populators.name,e.populators.defaultValue])),[]),z=(e,t,n)=>{const o=F[0].body.filter(e=>null==e?void 0:e.isMandatory).map(e=>null==e?void 0:e.key).some(e=>{const n=t[e];return null==n||""===n||!1===n});D(o)},G=F.map(e=>({...e,body:e.body.map(e=>"check"===e.key?{...e,isMandatory:!0}:e)})),V=function(e,n,l){var i,r,a;return void 0===e&&(e=""),void 0===n&&(n=""),void 0===l&&(l=""),o.createElement(t.FormComposerV2,{onSubmit:h?P:L,isDisabled:E||_,noBoxShadow:!0,inline:!0,submitInForm:!0,config:G,label:null==f||null===(i=f.texts)||void 0===i?void 0:i.submitButtonLabel,secondaryActionLabel:(null==f||null===(r=f.texts)||void 0===r?void 0:r.secondaryButtonLabel)+(e.includes("login-form-container")?"?":""),onSecondayActionClick:k,onFormValueChange:z,heading:null==f||null===(a=f.texts)||void 0===a?void 0:a.header,className:""+l,cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:n,buttonClassName:"buttonClassName",defaultValues:H},o.createElement(wn,null!=C&&C.code?null:{showTenant:!1}))},W=e=>{var t,n,l;return o.createElement("div",{className:e,style:{backgroundColor:"unset"}},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(n=t.globalConfigs)||void 0===n||null===(l=n.getConfig)||void 0===l?void 0:l.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}}))};return y||S?o.createElement(t.Loader,{page:!0,variant:"PageLoader"}):null!=f&&f.bannerImages?o.createElement("div",{className:"login-container"},o.createElement(Rn,{bannerImages:null==f?void 0:f.bannerImages}),o.createElement("div",{className:"login-form-container"},V("login-form-container","",h?"sandbox-onboarding-wrapper":""),T&&o.createElement(T,null),I&&o.createElement(t.Toast,{type:"error",label:g(I),onClose:M}),W("EmployeeLoginFooter"))):o.createElement(In,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),V("loginFormStyleEmployee","loginCardClassName",h?"sandbox-onboarding-wrapper":""),T&&o.createElement(T,null),I&&o.createElement(t.Toast,{type:"error",label:g(I),onClose:M}),W("employee-login-home-footer"))};Vn.propTypes={loginParams:te.any},Vn.defaultProps={loginParams:null};const Wn=e=>{var i,r;let{stateCode:s}=e;const{t:c}=l.useTranslation(),{path:u}=a.useRouteMatch(),[d,m]=n.useState(Ln),[p,v]=n.useState(Gn),f=Digit.StoreData.getCurrentLanguage(),g=(null===(i=window)||void 0===i||null===(r=i.globalConfigs)||void 0===r?void 0:r.getConfig("OTP_BASED_LOGIN"))||!1,{data:E,isLoading:h}=xn(s),y=a.useHistory(),b=a.useLocation();n.useEffect(()=>{if(!new URLSearchParams(b.search).get("ts")){const e=Date.now();y.replace({pathname:b.pathname,search:"?ts="+e})}},[b,y]),Digit.Services.useStore({stateCode:s,moduleCode:["privacy-policy"],language:f,modulePrefix:"digit"}),n.useEffect(()=>{m(0==h&&null!=E&&E.config?null==E?void 0:E.config:Ln)},[E,h]);const S=n.useMemo(()=>d.map(e=>{const t={};for(const n in e.texts)t[n]=c(e.texts[n]);return{...e,texts:t}},[d])),C=n.useMemo(()=>p.map(e=>{const t={};for(const n in e.texts)t[n]=c(e.texts[n]);return{...e,texts:t}},[p]));return h?o.createElement(t.Loader,{page:!1,variant:"PageLoader"}):o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+u,exact:!0},o.createElement(Vn,g?{config:C[0],t:c,loginOTPBased:g}:{config:S[0],t:c})))};var Qn,Xn,qn,Zn;function Yn(){return(Yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}function $n(e){return n.createElement("svg",Yn({width:319,height:48,fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Qn||(Qn=n.createElement("path",{fill:"url(#SandboxHeader_svg__pattern0_27111_38436)",d:"M0 0h138v48H0z"})),Xn||(Xn=n.createElement("path",{stroke:"#000",d:"M152.5 7v34"})),qn||(qn=n.createElement("path",{d:"M184.62 15.34c-.16.28-.333.487-.52.62-.173.12-.393.18-.66.18-.28 0-.587-.1-.92-.3a17.66 17.66 0 00-1.16-.7 9.019 9.019 0 00-1.6-.68c-.6-.213-1.313-.32-2.14-.32-.747 0-1.4.093-1.96.28-.56.173-1.033.42-1.42.74a3.03 3.03 0 00-.84 1.16c-.187.44-.28.927-.28 1.46 0 .68.187 1.247.56 1.7.387.453.893.84 1.52 1.16.627.32 1.34.607 2.14.86s1.62.527 2.46.82c.84.28 1.66.613 2.46 1 .8.373 1.513.853 2.14 1.44a6.286 6.286 0 011.5 2.12c.387.84.58 1.86.58 3.06a9.924 9.924 0 01-.68 3.68 8.4 8.4 0 01-1.96 2.98c-.853.84-1.9 1.507-3.14 2-1.24.48-2.66.72-4.26.72-.92 0-1.827-.093-2.72-.28a14.04 14.04 0 01-2.58-.76 13.939 13.939 0 01-2.3-1.2 11.14 11.14 0 01-1.92-1.56l1.58-2.58a1.58 1.58 0 01.52-.46c.213-.133.44-.2.68-.2.333 0 .693.14 1.08.42.387.267.847.567 1.38.9.533.333 1.153.64 1.86.92.72.267 1.58.4 2.58.4 1.533 0 2.72-.36 3.56-1.08.84-.733 1.26-1.78 1.26-3.14 0-.76-.193-1.38-.58-1.86-.373-.48-.873-.88-1.5-1.2a10.859 10.859 0 00-2.14-.84c-.8-.227-1.613-.473-2.44-.74a21.03 21.03 0 01-2.44-.96 7.909 7.909 0 01-2.14-1.46c-.627-.6-1.133-1.347-1.52-2.24-.373-.907-.56-2.02-.56-3.34 0-1.053.207-2.08.62-3.08.427-1 1.04-1.887 1.84-2.66.8-.773 1.787-1.393 2.96-1.86 1.173-.467 2.52-.7 4.04-.7 1.707 0 3.28.267 4.72.8s2.667 1.28 3.68 2.24l-1.34 2.54zm16.34 14.9c-1.427.067-2.627.193-3.6.38-.974.173-1.754.4-2.34.68-.587.28-1.007.607-1.26.98-.254.373-.38.78-.38 1.22 0 .867.253 1.487.76 1.86.52.373 1.193.56 2.02.56 1.013 0 1.886-.18 2.62-.54.746-.373 1.473-.933 2.18-1.68v-3.46zm-11.32-8.9c2.36-2.16 5.2-3.24 8.52-3.24 1.2 0 2.273.2 3.22.6a6.645 6.645 0 012.4 1.64c.653.693 1.146 1.527 1.48 2.5.346.973.52 2.04.52 3.2V39h-2.24c-.467 0-.827-.067-1.08-.2-.254-.147-.454-.433-.6-.86l-.44-1.48c-.52.467-1.027.88-1.52 1.24a9.384 9.384 0 01-1.54.88c-.534.24-1.107.42-1.72.54-.6.133-1.267.2-2 .2a8.09 8.09 0 01-2.4-.34 5.385 5.385 0 01-1.9-1.06 4.703 4.703 0 01-1.24-1.74c-.294-.693-.44-1.5-.44-2.42 0-.52.086-1.033.26-1.54.173-.52.453-1.013.84-1.48.4-.467.913-.907 1.54-1.32.626-.413 1.393-.773 2.3-1.08.92-.307 1.986-.553 3.2-.74 1.213-.2 2.6-.32 4.16-.36v-1.2c0-1.373-.294-2.387-.88-3.04-.587-.667-1.434-1-2.54-1-.8 0-1.467.093-2 .28-.52.187-.98.4-1.38.64-.4.227-.767.433-1.1.62-.32.187-.68.28-1.08.28-.347 0-.64-.087-.88-.26-.24-.187-.434-.4-.58-.64l-.88-1.58zm25.412-.34c.414-.413.847-.793 1.3-1.14.467-.36.954-.66 1.46-.9a7.656 7.656 0 011.66-.58 7.909 7.909 0 011.92-.22c1.12 0 2.114.193 2.98.58a5.654 5.654 0 012.16 1.6c.587.68 1.027 1.5 1.32 2.46.307.947.46 1.993.46 3.14V39h-4.94V25.94c0-1.253-.286-2.22-.86-2.9-.573-.693-1.446-1.04-2.62-1.04-.853 0-1.653.193-2.4.58a8.62 8.62 0 00-2.12 1.58V39h-4.94V18.48h3.02c.64 0 1.06.3 1.26.9l.34 1.62zm30.838 2.72c-.56-.68-1.173-1.16-1.84-1.44a5.323 5.323 0 00-2.12-.42c-.746 0-1.42.14-2.02.42-.6.28-1.113.707-1.54 1.28-.426.56-.753 1.28-.98 2.16-.226.867-.34 1.893-.34 3.08 0 1.2.094 2.22.28 3.06.2.827.48 1.507.84 2.04.36.52.8.9 1.32 1.14.52.227 1.1.34 1.74.34 1.027 0 1.9-.213 2.62-.64.72-.427 1.4-1.033 2.04-1.82v-9.2zm4.94-14.44V39h-3.02c-.653 0-1.066-.3-1.24-.9l-.42-1.98a10.293 10.293 0 01-2.86 2.3c-1.066.587-2.313.88-3.74.88-1.12 0-2.146-.233-3.08-.7-.933-.467-1.74-1.14-2.42-2.02-.666-.893-1.186-1.993-1.56-3.3-.36-1.307-.54-2.8-.54-4.48 0-1.52.207-2.933.62-4.24.414-1.307 1.007-2.44 1.78-3.4a8.202 8.202 0 012.78-2.24c1.08-.547 2.294-.82 3.64-.82 1.147 0 2.127.18 2.94.54.814.36 1.54.847 2.18 1.46V9.28h4.94zm9.816 24.4c.56.68 1.166 1.16 1.82 1.44.666.28 1.366.42 2.1.42.76 0 1.44-.133 2.04-.4a4.001 4.001 0 001.56-1.28c.426-.587.753-1.327.98-2.22.226-.907.34-1.987.34-3.24 0-2.253-.374-3.88-1.12-4.88-.747-1.013-1.82-1.52-3.22-1.52-.947 0-1.774.22-2.48.66-.707.427-1.38 1.033-2.02 1.82v9.2zm0-12.68a10.055 10.055 0 012.74-2.06c1.013-.52 2.166-.78 3.46-.78 1.186 0 2.253.233 3.2.7a6.715 6.715 0 012.44 2.02c.68.867 1.2 1.92 1.56 3.16.36 1.24.54 2.633.54 4.18 0 1.667-.207 3.18-.62 4.54-.414 1.36-1.007 2.527-1.78 3.5a8.002 8.002 0 01-2.76 2.24c-1.08.533-2.28.8-3.6.8-.64 0-1.22-.067-1.74-.2a6.148 6.148 0 01-2.66-1.34c-.36-.333-.707-.7-1.04-1.1l-.22 1.38c-.08.347-.22.593-.42.74-.187.147-.447.22-.78.22h-3.26V9.28h4.94V21zm26.835-2.84c1.52 0 2.9.247 4.14.74 1.253.493 2.32 1.193 3.2 2.1.893.907 1.58 2.013 2.06 3.32s.72 2.767.72 4.38c0 1.627-.24 3.093-.72 4.4-.48 1.307-1.167 2.42-2.06 3.34-.88.92-1.947 1.627-3.2 2.12-1.24.493-2.62.74-4.14.74-1.533 0-2.927-.247-4.18-.74a9.04 9.04 0 01-3.22-2.12c-.88-.92-1.567-2.033-2.06-3.34-.48-1.307-.72-2.773-.72-4.4 0-1.613.24-3.073.72-4.38.493-1.307 1.18-2.413 2.06-3.32.893-.907 1.967-1.607 3.22-2.1 1.253-.493 2.647-.74 4.18-.74zm0 17.34c1.707 0 2.967-.573 3.78-1.72.827-1.147 1.24-2.827 1.24-5.04s-.413-3.9-1.24-5.06c-.813-1.16-2.073-1.74-3.78-1.74-1.733 0-3.02.587-3.86 1.76-.827 1.16-1.24 2.84-1.24 5.04s.413 3.88 1.24 5.04c.84 1.147 2.127 1.72 3.86 1.72zm31.271 3.5h-4.76c-.36 0-.653-.093-.88-.28a2.772 2.772 0 01-.54-.64l-4.34-7.14c-.066.227-.146.44-.24.64-.08.2-.173.387-.28.56l-3.84 5.94a3.39 3.39 0 01-.54.64c-.213.187-.48.28-.8.28h-4.42l7.04-10.58-6.76-9.94h4.76c.36 0 .627.053.8.16.174.093.327.253.46.48l4.3 6.84c.147-.453.354-.9.62-1.34l3.46-5.4c.294-.493.674-.74 1.14-.74h4.54l-6.74 9.72 7.02 10.8z",fill:"#4F5052"})),Zn||(Zn=n.createElement("defs",null,n.createElement("pattern",{id:"SandboxHeader_svg__pattern0_27111_38436",patternContentUnits:"objectBoundingBox",width:1,height:1},n.createElement("use",{xlinkHref:"#SandboxHeader_svg__image0_27111_38436",transform:"scale(.00229 .00658)"})),n.createElement("image",{id:"SandboxHeader_svg__image0_27111_38436",width:437,height:152,preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbUAAACYCAYAAABj73eBAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDIzLTA2LTE2VDEyOjI1OjU2KzA1OjMwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyMy0wNi0xNlQxMjoyNzowNSswNTozMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAyMy0wNi0xNlQxMjoyNzowNSswNTozMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHBob3Rvc2hvcDpJQ0NQcm9maWxlPSJzUkdCIElFQzYxOTY2LTIuMSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0MjIxNmQ5Ni02YWMw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"}))))}const Jn=e=>{var n;let{showTenant:i=!0}=e;const{data:r,isLoading:a}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=r||{},{t:c}=l.useTranslation();return a?o.createElement(t.Loader,null):o.createElement("div",{className:"bannerHeader"},o.createElement("div",{className:"SandboxLogoAlignCenter"},o.createElement($n,null)),i&&(null==s?void 0:s.code)&&o.createElement("p",null,c("TENANT_TENANTS_"+(null==s||null===(n=s.code)||void 0===n?void 0:n.toUpperCase()))))},Kn=e=>{let{bannerImages:t}=e;const[l,i]=n.useState(0),[r,a]=n.useState(!1);if(n.useEffect(()=>{const e=setInterval(()=>{a(!0),setTimeout(()=>{i(e=>(e+1)%t.length),a(!1)},200)},5e3);return()=>clearInterval(e)},[t.length]),!t||0===t.length)return o.createElement("div",null,"No images available");const{image:s,title:c,description:u}=t[l];return o.createElement("div",{className:"carousel-container",style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},o.createElement("div",{style:{position:"relative",width:"100%",height:"100%",transition:"opacity 0.4s ease-in-out, transform 0.4s ease-in-out",opacity:r?.7:1,transform:r?"scale(1.02)":"scale(1)"}},o.createElement("img",{className:"carousel-img",src:s,alt:c,style:{width:"100%",height:"100%",objectFit:"cover",display:"block",transition:"filter 0.4s ease-in-out",filter:r?"blur(1px)":"blur(0px)"}})),o.createElement("div",{style:{position:"absolute",left:0,bottom:0,width:"100%",height:"60%",background:"linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 100%)",zIndex:1,pointerEvents:"none"}}),o.createElement("div",{className:"carousel-overlay",style:{position:"absolute",bottom:"10rem",left:"2rem",maxWidth:"70%",color:"#fff",zIndex:2,transition:"opacity 0.4s ease-in-out, transform 0.4s ease-in-out",opacity:r?.6:1,transform:r?"translateY(10px)":"translateY(0px)"}},o.createElement("h2",{style:{margin:"0 0 1rem",fontSize:"2.5rem",fontWeight:"bold",textShadow:"2px 2px 4px rgba(0, 0, 0, 0.8)",lineHeight:1.2,transition:"all 0.4s ease-in-out"}},c),o.createElement("p",{style:{margin:0,fontSize:"1.1rem",lineHeight:1.6,textShadow:"1px 1px 2px rgba(0, 0, 0, 0.8)",opacity:.95,transition:"all 0.4s ease-in-out"}},u)),o.createElement("div",{style:{position:"absolute",bottom:"3.5rem",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:3,gap:"1rem"}},o.createElement("button",{onClick:()=>{a(!0),setTimeout(()=>{i(e=>(e-1+t.length)%t.length),a(!1)},200)},style:{backgroundColor:"transparent",border:"none",color:"white",fontSize:"1.5rem",cursor:"pointer",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}},"‹"),o.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.75rem"}},t.map((e,t)=>o.createElement("button",{key:t,onClick:()=>(e=>{e!==l&&(a(!0),setTimeout(()=>{i(e),a(!1)},200))})(t),style:{width:"10px",height:"10px",borderRadius:"50%",border:t===l?"1px solid rgba(255, 255, 255, 0.8)":"1px solid rgba(255, 255, 255, 0.3)",padding:0,background:t===l?"white":"rgba(255, 255, 255, 0.4)",cursor:"pointer",transition:"all 0.3s ease",transform:t===l?"scale(1.4)":"scale(1)",boxShadow:t===l?"0 0 8px rgba(255, 255, 255, 0.5)":"none"},onMouseEnter:e=>{t!==l&&(e.target.style.background="rgba(255, 255, 255, 0.7)",e.target.style.transform="scale(1.2)")},onMouseLeave:e=>{t!==l&&(e.target.style.background="rgba(255, 255, 255, 0.4)",e.target.style.transform="scale(1)")}}))),o.createElement("button",{onClick:()=>{a(!0),setTimeout(()=>{i(e=>(e+1)%t.length),a(!1)},200)},style:{backgroundColor:"transparent",border:"none",color:"white",fontSize:"1.5rem",cursor:"pointer",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}},"›")))},eo=e=>{var i,r,c;let{isLogin:u=!1}=e;const{t:d}=l.useTranslation(),m=(a.useRouteMatch(),a.useHistory()),p=a.useLocation(),[v,f]=n.useState(null),[g,E]=n.useState(!1),[h,y]=n.useState(null),b=(null==p||null===(i=p.state)||void 0===i?void 0:i.email)||sessionStorage.getItem("otpEmail")||"",S=(null==p||null===(r=p.state)||void 0===r?void 0:r.tenant)||sessionStorage.getItem("otpTenant")||"",{data:C}=Digit.Hooks.useCustomMDMS(S,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}}),N=null==C||null===(c=C[0])||void 0===c?void 0:c.url,O=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:b,tenant:S},populators:{required:!0}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Digital Headquarters for National Health Agencies",description:"Access real-time data dashboards and manage complaints."}]}],I=()=>f(null);n.useEffect(()=>{var e,t,n,o,l;if(!h)return;Digit.SessionStorage.set("citizen.userRequestObject",h);const i=null==h||null===(e=h.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==h||null===(n=h.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(h.info.roles=i),Digit.UserService.setUser(h),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant())return;let o=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Employee.locale",o),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==h?void 0:h.info,null==h?void 0:h.access_token);const r=((e,t,n,o)=>{var l,i,r,a,s,c;const u="SUPERUSER"===(null==t||null===(l=t.info)||void 0===l||null===(i=l.roles)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.code),d=null===(a=window)||void 0===a?void 0:a.contextPath;switch(!0){case"/sandbox-ui/user/otp"===e&&u:return`/${d}/employee/sandbox/landing`;case u&&(null==n||null===(s=n[0])||void 0===s||null===(c=s.rolesForLandingPage)||void 0===c?void 0:c.includes("SUPERUSER")):return`/${d}${o}`;default:return`/${d}/employee`}})(p.pathname,h,C,N);m.push(u?r:{pathname:`/${null===(l=window)||void 0===l?void 0:l.globalPath}/user/setup`,state:{tenant:S}})},[h]);const w=function(e){try{var t;const n={username:b,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:S,userType:"EMPLOYEE"},o=Ge(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),y({info:t,...n})})},function(e){var t,n;f((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"===(null==e?void 0:e.message)&&d("ES_ERROR_USER_NOT_PERMITTED")||d("INVALID_LOGIN_CREDENTIALS")),setTimeout(I,5e3)});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},_=window.innerWidth<=768,D=()=>{var e,n,l;return o.createElement("div",{style:{padding:_?"1rem":"2rem",width:_?"100%":"30%",backgroundColor:"#fff",overflowY:"auto",justifyContent:"center",display:"flex",alignItems:"center",flexDirection:"column",height:_?"100vh":"auto"}},o.createElement("div",{className:"employeeBackbuttonAlign",style:{alignSelf:"flex-start",marginBottom:"1rem"}},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(s.FormComposerV2,{onSubmit:w,noBoxShadow:!0,inline:!0,submitInForm:!0,config:O,label:d("CORE_COMMON_SUBMIT"),headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper",buttonClassName:"sandbox-otp-submit-button",buttonStyle:{width:"100%",maxWidth:"408px",backgroundColor:"#F47738",borderColor:"#F47738",color:"#fff",fontWeight:"500",padding:"12px 24px",borderRadius:"4px",fontSize:"16px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center"},onFormValueChange:(e,t)=>{var n,o;return E(6===(null==t||null===(n=t.OtpComponent)||void 0===n||null===(o=n.otp)||void 0===o?void 0:o.length))},isDisabled:!g},o.createElement(Jn,{showTenant:!1})),v&&o.createElement(t.Toast,{type:"error",label:d(v),onClose:I}),o.createElement("div",{className:"EmployeeLoginFooter",style:{marginTop:"auto"}},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(n=e.globalConfigs)||void 0===n||null===(l=n.getConfig)||void 0===l?void 0:l.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;return window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};return _?D():o.createElement("div",{style:{display:"flex",height:"100vh"}},o.createElement("div",{style:{width:"70%",position:"relative"}},o.createElement(Kn,{bannerImages:O[0].bannerImages})),D())},to=["user/landing","user/profile","user/error","user/productPage"],no=e=>{var i,r,s,c,u,d;let{stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:f,mobileView:g,handleUserDropdownSelection:E,logoUrl:h,logoUrlWhite:y,DSO:b,stateCode:S,modules:C,appTenants:N,initData:O,noTopBar:I=!1}=e;const w=a.useHistory(),{t:_}=l.useTranslation(),{path:D}=a.useRouteMatch(),T=a.useLocation(),A=null==T||null===(i=T.pathname)||void 0===i?void 0:i.includes("language-selection"),L=to.some(e=>{var t;return null==T||null===(t=T.pathname)||void 0===t?void 0:t.includes(e)});n.useEffect(()=>{Digit.UserService.setType("employee")},[]);const R=null==O||null===(r=O.modules)||void 0===r||null===(s=r.filter(e=>null==e?void 0:e.additionalComponent))||void 0===s?void 0:s.map(e=>null==e?void 0:e.additionalComponent),x=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant(),P=T.pathname.includes("employee/sandbox/productDetailsPage/");return n.useEffect(()=>{const e=T.pathname===D||T.pathname===D+"/",t="sandbox"===new URLSearchParams(T.search).get("from");x&&e&&!t&&w.replace(D+"/sandbox/productPage")},[T.pathname,T.search,D,w,x]),o.createElement("div",{className:"employee"},o.createElement(a.Switch,null,o.createElement(a.Route,{path:D+"/user"},L&&o.createElement(Re,{t:_,stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:f,mobileView:g,handleUserDropdownSelection:E,logoUrl:h,logoUrlWhite:y,showSidebar:!!L,showLanguageChange:!A}),o.createElement("div",{className:L?"grounded-container":"loginContainer",style:L?{padding:0,paddingTop:"0",marginLeft:"0"}:{"--banner-url":`url(${null==m?void 0:m.bannerUrl})`,padding:"0px"}},o.createElement(a.Switch,null,!Digit.Utils.getMultiRootTenant()&&o.createElement(a.Route,{exact:!0,path:D+"/user/login"},o.createElement(Wn,{stateCode:S})),o.createElement(a.Route,{exact:!0,path:D+"/user/login/otp"},o.createElement(eo,{isLogin:!0})),o.createElement(a.Route,{path:D+"/user/forgot-password"},o.createElement(Mn,{stateCode:S})),o.createElement(a.Route,{path:D+"/user/change-password"},o.createElement(Tn,null)),o.createElement(t.PrivateRoute,{path:D+"/user/profile",component:()=>o.createElement(Ze,{stateCode:S,userType:"employee",cityDetails:f})}),o.createElement(a.Route,{path:D+"/user/error"},o.createElement(ie,{initData:O,goToHome:()=>{var e,t,n,o;w.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(o=n.getType)||void 0===o?void 0:o.call(n)}`)}})),o.createElement(a.Route,{path:D+"/user/language-selection"},o.createElement(zn,null)),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:D+"/user/language-selection"}))))),o.createElement(a.Route,null,!I&&o.createElement(Re,{t:_,stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:f,mobileView:g,handleUserDropdownSelection:E,logoUrl:h,logoUrlWhite:y,modules:C}),o.createElement("div",{className:I?"":`${x?"":"main"} ${b?"m-auto":""} digit-home-main`},o.createElement("div",{className:I?"":(x&&P?"":"employee-app-wrapper")+" digit-home-app-wrapper"},o.createElement(ae,{initData:O},o.createElement(Un,{stateCode:S,userType:"employee",modules:C,appTenants:N,additionalComponent:R}))),o.createElement("div",{className:"employee-home-footer"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u||null===(d=u.getConfig)||void 0===d?void 0:d.call(u,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:D+"/user/language-selection"}))))},oo=()=>{var e,i,r,s,c,u;const{t:d}=l.useTranslation(),m=a.useLocation(),{tenant:p}=m.state||{},v=(a.useHistory(),n.useRef(null)),f=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(i=e.info)||void 0===i?void 0:i.roles,[g,E]=n.useState(!0),{data:h}=Digit.Hooks.useCustomMDMS(p,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}});n.useEffect(()=>{null!=h&&h[0].url&&E(!1)},[h]);const y=null==h?void 0:h[0].url;return o.createElement(In,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.Card,{className:"card-sandbox"},o.createElement(wn,{showTenant:!1}),o.createElement("div",{className:"sandbox-success-signup"},o.createElement(t.SVG.TickMark,{fill:"#fff",height:30,width:70})),o.createElement(t.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"}},d("SANDBOX_HEADER")),o.createElement(t.CardText,{className:"cardText-sandbox"},d("SAMDBOX_URL_SUB")),o.createElement(t.CardLabel,null," ",d("SANDBOX_URL")," "),o.createElement("div",{className:"sandbox-url-wrapper"},o.createElement(t.TextInput,{inputRef:v,className:"urlInputText",onChange:()=>{},nonEditable:!0,value:`${window.location.host}/${null===(r=window)||void 0===r?void 0:r.globalPath}/${p}/employee`}),o.createElement(t.Button,{className:"copyButton",variation:"secondary",onClick:()=>{navigator.clipboard.writeText(v.current.value)},label:d("COPY_URL")})),o.createElement("div",{className:"sandbox-url-footer"},d("SANDBOX_URL_FOOT")),o.createElement(t.Button,{isDisabled:g,onClick:()=>{var e,t;((e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))})(f,h)?window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${p}${y}`:window.location.href=`/${null===(t=window)||void 0===t?void 0:t.globalPath}/${p}/employee`},label:d("SIGN_IN")})),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(s=window)||void 0===s||null===(c=s.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))},lo=e=>{const{state:n={}}=a.useLocation(),{t:i}=l.useTranslation(),r=a.useHistory(),s={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:()=>{r.push(`/${window.globalPath}/`)}};return o.createElement(In,null,o.createElement(t.Card,{className:"digit-employee-card customError"},o.createElement(wn,{showTenant:!1}),o.createElement(t.CardHeader,{className:"center"},i(s.infoHeader)),o.createElement(t.CardText,{className:"center"},i(s.infoMessage)),o.createElement(t.Button,{className:"customErrorButton",label:i(null==s?void 0:s.buttonInfo),variation:"primary",isSuffix:!0,onClick:e=>{e.preventDefault(),null==s||s.action()}})))},io=()=>{var e,t;const[i,r]=n.useState(0),s=(a.useHistory(),a.useLocation()),{t:u}=l.useTranslation(),{tenant:d}=s.state||{},m=["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"];n.useEffect(()=>{const e=setInterval(()=>{i<m.length&&r(e=>e+1)},2e3);if(i===m.length){clearInterval(e);const t=setTimeout(()=>{var e,t;h(p,g)?window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${d}${E}`:window.location.href=`/${null===(t=window)||void 0===t?void 0:t.globalPath}/${d}/employee`},1e3);return()=>clearTimeout(t)}return()=>{clearInterval(e)}},[i]),n.useRef(null);const p=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(t=e.info)||void 0===t?void 0:t.roles,[v,f]=n.useState(!0),{data:g}=Digit.Hooks.useCustomMDMS(d,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}});n.useEffect(()=>{null!=g&&g[0].url&&f(!1)},[g]);const E=null==g?void 0:g[0].url,h=(e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))};return o.createElement("div",{className:"sandbox-loader-screen"},o.createElement("div",{className:"sandbox-loader"}),o.createElement("ul",{className:"sandbox-installation-steps"},m.map((e,t)=>o.createElement("li",{key:t,className:"sandbox-step "+(t<i?"sandbox-visible":"")},o.createElement("span",{className:"sandbox-step-text"},u(e)),t<i&&o.createElement(c.CheckCircle,{fill:"#00703C"})))))},ro=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/,maxLength:50},error:"ERR_ACCOUNT_NAME_REQUIRED"},infoMessage:"SANDBOX_SIGNUP_ACCOUNT_NAME_TOOLTIP"},{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,maxLength:64},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"PrivacyComponent",key:"check",type:"component",component:"LoginSignupSelector",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{required:!1,name:"check"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,required:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check",required:!1}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:3,image:"https://images.unsplash.com/photo-1624555130581-1d9cca783bc0",title:"Digital Headquarters for National Health Agencies",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:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:5,image:"https://images.unsplash.com/photo-1536782376847-5c9d14d97cc0",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:6,image:"https://images.unsplash.com/photo-1490730141103-6cac27aaab94",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."}]}],ao=e=>{var l,i,r,s,c,u,d;let{config:m,t:p,isDisabled:v}=e;const{isLoading:f}=Digit.Hooks.useTenants(),{isLoading:g}=Digit.Hooks.useStore.getInitData(),[E,h]=n.useState(null),[y,b]=n.useState(!1),S=a.useHistory(),C=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}}),N=function(e){try{return Promise.resolve(C.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,i,r,a,s,c;h({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&null!==(i=l[0])&&void 0!==i&&i.code?"SANDBOX_SIGNUP_"+(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(s=a.Errors)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.code):"SANDBOX_SIGNUP_ERROR"})},onSuccess:function(e){try{var t,n,o;return S.push({pathname:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/otp`,state:{email:null==e||null===(n=e.Tenants[0])||void 0===n?void 0:n.email,tenant:null==e||null===(o=e.Tenants[0])||void 0===o?void 0:o.code}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},O=()=>{h(null)};let I=[{body:null==m?void 0:m.inputs}];const{mode:w}=Digit.Hooks.useQueryParams();"admin"===w&&!1===(null==I||null===(l=I[0])||void 0===l||null===(i=l.body)||void 0===i||null===(r=i[2])||void 0===r?void 0:r.disable)&&void 0===(null==I||null===(s=I[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(I[0].body[2].disable=!0,I[0].body[2].isMandatory=!1,I[0].body[2].populators.defaultValue=defaultValue);const _=(e,t,n)=>{const o=I[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});b(o)},D=window.innerWidth<=768,T=()=>{var e,n,l,i,r,a;return o.createElement("div",{style:{padding:D?"1rem":"2rem",width:D?"100%":"30%",backgroundColor:"#fff",overflowY:"auto",justifyContent:"center",display:"flex",alignItems:"center",flexDirection:"column"}},o.createElement("div",{className:"employeeBackbuttonAlign",style:{alignSelf:"flex-start",marginBottom:"1rem"}},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:N,isDisabled:v||y,noBoxShadow:!0,inline:!0,submitInForm:!0,config:I,label:null==m||null===(e=m.texts)||void 0===e?void 0:e.submitButtonLabel,secondaryActionLabel:null==m||null===(n=m.texts)||void 0===n?void 0:n.secondaryButtonLabel,onFormValueChange:_,heading:null==m||null===(l=m.texts)||void 0===l?void 0:l.header,className:"sandbox-signup-form",cardClassName:"sandbox-onboarding-wrapper"},o.createElement(Jn,{showTenant:!1})),E&&o.createElement(t.Toast,{type:"error",label:p(null==E?void 0:E.label),onClose:O}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset",marginTop:"auto"}},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(r=i.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};return f||g?o.createElement(t.Loader,null):D?T():o.createElement("div",{style:{display:"flex",height:"100vh"}},o.createElement("div",{style:{width:"70%",position:"relative"}},o.createElement(Kn,{bannerImages:m.bannerImages})),T())};ao.propTypes={loginParams:te.any},ao.defaultProps={loginParams:null};const so=e=>{let{stateCode:t}=e;const{t:i}=l.useTranslation(),{path:r}=a.useRouteMatch(),[s,c]=n.useState(ro),u=Digit.StoreData.getCurrentLanguage(),d=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),a.useHistory()),m=a.useLocation();n.useEffect(()=>{if(!new URLSearchParams(m.search).get("ts")){const e=Date.now();d.replace({pathname:m.pathname,search:"?ts="+e})}},[m,d]);const{data:p,isLoading:v}=Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1});n.useEffect(()=>{c(0==v&&null!=p&&p.config?null==p?void 0:p.config:ro)},[p,v]);const f=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=i(e.texts[n]);return{...e,texts:t}},[s]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+r,exact:!0},o.createElement(ao,{config:f[0],t:i})))},co=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/,maxLength:50},error:"ERR_ACCOUNT_NAME_REQUIRED"}},{isMandatory:!1,key:"PrivacyComponent",key:"check",type:"component",component:"ForgotOrganizationTooltip",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{required:!1,name:"check"}},{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,maxLength:64},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"PrivacyComponent",key:"check",type:"component",component:"LoginSignupSelector",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{required:!1,name:"check"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:3,image:"https://images.unsplash.com/photo-1624555130581-1d9cca783bc0",title:"Digital Headquarters for National Health Agencies",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:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:5,image:"https://images.unsplash.com/photo-1536782376847-5c9d14d97cc0",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:6,image:"https://images.unsplash.com/photo-1490730141103-6cac27aaab94",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."}]}],uo=e=>{var l,i,r,s,c,u,d,m,p;let{config:v,t:f,isDisabled:g}=e;const{isLoading:E}=Digit.Hooks.useTenants(),{isLoading:h}=Digit.Hooks.useStore.getInitData(),[y,b]=n.useState(null),[S,C]=n.useState(!1);a.useHistory();const N={url:"/user-otp/v1/_send",params:{tenantId:null===(l=Digit)||void 0===l||null===(i=l.ULBService)||void 0===i?void 0:i.getStateId()},body:{},config:{enable:!1}},O=Digit.Hooks.useCustomAPIMutationHook(N),I=function(e){try{const t=e.email,n=e.accountName;return Promise.resolve(O.mutate({params:{tenantId:n},body:{otp:{userName:e.email,type:"login",tenantId:n,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l;b({key:"error",label:null==e||null===(n=e.response)||void 0===n||null===(o=n.data)||void 0===o||null===(l=o.error)||void 0===l?void 0:l.message}),setTimeout(w,5e3)},onSuccess:function(e){try{var o;sessionStorage.setItem("otpEmail",t),sessionStorage.setItem("otpTenant",n);const e=function(e,t){const n=(e||"").split("/").filter(Boolean).join("/");return n.includes("/")?`/${n}/employee/user/login/otp`:`/${n}/${t}/employee/user/login/otp`}(null===(o=window)||void 0===o?void 0:o.contextPath,n);return window.location.replace(e),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},w=()=>{b(null)};let _=[{body:null==v?void 0:v.inputs}];const{mode:D}=Digit.Hooks.useQueryParams();"admin"===D&&0==(null==_||null===(r=_[0])||void 0===r||null===(s=r.body)||void 0===s||null===(c=s[2])||void 0===c?void 0:c.disable)&&null==(null==_||null===(u=_[0])||void 0===u||null===(d=u.body)||void 0===d||null===(m=d[2])||void 0===m||null===(p=m.populators)||void 0===p?void 0:p.defaultValue)&&(_[0].body[2].disable=!0,_[0].body[2].isMandatory=!1,_[0].body[2].populators.defaultValue=defaultValue);const T=(e,t,n)=>{const o=_[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});C(o)},A=window.innerWidth<=768,L=()=>{var e,n,l,i,r,a;return o.createElement("div",{style:{padding:A?"1rem":"2rem",width:A?"100%":"30%",backgroundColor:"#fff",overflowY:"auto",justifyContent:"center",display:"flex",alignItems:"center",flexDirection:"column"}},o.createElement("div",{className:"employeeBackbuttonAlign",style:{alignSelf:"flex-start",marginBottom:"1rem"}},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:I,isDisabled:g||S,noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:null==v||null===(e=v.texts)||void 0===e?void 0:e.submitButtonLabel,secondaryActionLabel:null==v||null===(n=v.texts)||void 0===n?void 0:n.secondaryButtonLabel,onFormValueChange:T,heading:null==v||null===(l=v.texts)||void 0===l?void 0:l.header,className:"sandbox-signup-form",cardClassName:"sandbox-onboarding-wrapper"},o.createElement(Jn,{showTenant:!1})),y&&o.createElement(t.Toast,{type:"error",label:f(null==y?void 0:y.label),onClose:w}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset",marginTop:"auto"}},o.createElement(ne,{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(r=i.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};return E||h?o.createElement(t.Loader,null):A?L():o.createElement("div",{style:{display:"flex",height:"100vh"}},o.createElement("div",{style:{width:"70%",position:"relative"}},o.createElement(Kn,{bannerImages:v.bannerImages})),L())};uo.propTypes={loginParams:te.any},uo.defaultProps={loginParams:null};const mo=e=>{let{stateCode:t}=e;const{t:i}=l.useTranslation(),{path:r}=a.useRouteMatch(),[s,c]=n.useState(co),u=Digit.StoreData.getCurrentLanguage(),d=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),a.useHistory()),m=a.useLocation();n.useEffect(()=>{if(!new URLSearchParams(m.search).get("ts")){const e=Date.now();d.replace({pathname:m.pathname,search:"?ts="+e})}},[m,d]);const{data:p,isLoading:v}=Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1});n.useEffect(()=>{c(0==v&&null!=p&&p.config?null==p?void 0:p.config:co)},[p,v]);const f=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=i(e.texts[n]);return{...e,texts:t}},[s]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+r,exact:!0},o.createElement(uo,{config:f[0],t:i})))},po=e=>{var t,l,i,r,s;let{stateCode:c,modules:u,appTenants:d,logoUrl:p,logoUrlWhite:v,initData:f,defaultLanding:g="citizen",allowedUserTypes:E=["citizen","employee"]}=e;const h=a.useHistory(),{pathname:y}=a.useLocation(),b=window.innerWidth,S=Digit.ULBService.getCurrentUlb(),C=Digit.UserService.getUser(),{data:N}=Digit.Hooks.useStore.getInitData(),{stateInfo:O}=N||{},I=Digit.UserService.hasAccess(["FSM_DSO"]);let w="CITIZEN"===(null==C||null===(t=C.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(w=!1),n.useEffect(()=>{var e,t,n;null!=y&&y.includes("application-details")||(null!=y&&y.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=y&&y.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=y&&y.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==y?void 0:y.toString())===`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee`&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),(null==y?void 0:y.toString())!==`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`&&(null==y?void 0:y.toString())!==`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`||Digit.SessionStorage.del("WS_DISCONNECTION")},[y]),h.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const _={stateInfo:O,userDetails:C,CITIZEN:w,cityDetails:S,mobileView:b<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:p,logoUrlWhite:v,DSO:I,stateCode:c,modules:u,appTenants:d,sourceUrl:window.location.origin+"/citizen",pathname:y,initData:f};return o.createElement(a.Switch,null,(null==E?void 0:E.some(e=>"employee"==e))&&o.createElement(a.Route,{path:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`},o.createElement(no,_)),(null==E?void 0:E.some(e=>"citizen"==e))&&o.createElement(a.Route,{path:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen`},o.createElement(On,_)),(null==E?void 0:E.some(e=>"employee"==e))&&o.createElement(a.Route,{path:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/no-top-bar/employee`},o.createElement(no,m({},_,{noTopBar:!0}))),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:`/${null===(s=window)||void 0===s?void 0:s.contextPath}/${g}`})))},vo=e=>{var t,n,l,i,r,s,c,u,d,m,p;let{stateCode:v,modules:f,appTenants:g,logoUrl:E,logoUrlWhite:h,initData:y,defaultLanding:b="citizen",allowedUserTypes:S}=e;const{data:C}=Digit.Hooks.useStore.getInitData(),{stateInfo:N}=C||{},O=["user/error"].some(e=>{var t,n;return null===(t=location)||void 0===t||null===(n=t.pathname)||void 0===n?void 0:n.includes(e)}),I=Digit.UserService.getUser();let w="CITIZEN"===(null==I||null===(t=I.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");const _=window.innerWidth<=640;return o.createElement("div",{className:O?"grounded-container":"loginContainer",style:O?{padding:0,paddingTop:w?"0":_&&!w?"3rem":"80px",marginLeft:w||_?"0":"40px"}:{"--banner-url":`url(${null==N?void 0:N.bannerUrl})`,padding:"0px"}},o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:`/${null===(n=window)||void 0===n?void 0:n.globalPath}/user/invalid-url`},o.createElement(lo,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(l=window)||void 0===l?void 0:l.globalPath}/user/sign-up`},o.createElement(so,{stateCode:v})),o.createElement(a.Route,{exact:!0,path:`/${null===(i=window)||void 0===i?void 0:i.globalPath}/user/login`},o.createElement(mo,{stateCode:v})),o.createElement(a.Route,{exact:!0,path:`/${null===(r=window)||void 0===r?void 0:r.globalPath}/user/otp`},o.createElement(eo,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(s=window)||void 0===s?void 0:s.globalPath}/user/setup`},o.createElement(io,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(c=window)||void 0===c?void 0:c.globalPath}/user/url`},o.createElement(oo,null)),(null===(u=window)||void 0===u?void 0:u.globalPath)!==(null===(d=window)||void 0===d?void 0:d.contextPath)&&o.createElement(a.Route,{path:"/"+(null===(m=window)||void 0===m?void 0:m.contextPath)},o.createElement(po,{stateCode:v,modules:f,appTenants:g,logoUrl:E,logoUrlWhite:h,initData:y,defaultLanding:b,allowedUserTypes:S})),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:`/${null===(p=window)||void 0===p?void 0:p.globalPath}/user/sign-up`}))))},fo=[d],go=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):u.compose)(u.applyMiddleware(...fo)),Eo=e=>{let{onSelect:i,...r}=e;const{t:a}=l.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,u]=n.useState(!1),[d,m]=n.useState(!1),p=Digit.Utils.getConfigModuleName(),{data:v}=Digit.Hooks.useCustomMDMS(s,p,[{name:"PrivacyPolicy"}],{select:e=>{var t,n;return null==e||null===(t=e[p])||void 0===t||null===(n=t.PrivacyPolicy)||void 0===n?void 0:n.find(e=>{var t;return e.module===(null==r||null===(t=r.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{i("check",c)},[c]),o.createElement(o.Fragment,null,o.createElement("div",{className:"digit-privacy-checkbox digit-privacy-checkbox-align"},o.createElement(t.CheckBox,{label:a("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)},id:"privacy-component-check"}),o.createElement(t.Button,{label:a("ES_PRIVACY_POLICY"),variation:"link",size:"small",onClick:()=>{m(!0)},style:{marginBottom:"1rem",paddingLeft:"0.2rem"}})),d&&o.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:a(null==v?void 0:v.header),onOverlayClick:()=>{m(!1)},footerChildren:[o.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:a("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),o.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:a("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{u(!0),m(!1)}})],sortFooterChildren:!0,onClose:()=>{m(!1)}},o.createElement("div",null,o.createElement("div",{className:"privacy-table"},a("DIGIT_TABLE_OF_CONTENTS")),o.createElement("ul",null,null==v?void 0:v.contents.map((e,n)=>o.createElement("li",{key:n,style:{display:"flex",alignItems:"center"}},o.createElement("span",{style:{marginRight:"0.5rem"}},n+1,". "),o.createElement(t.Button,{label:a(e.header),variation:"link",size:"medium",onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})})(null==e?void 0:e.header)},style:{justifyContent:"flex-start"}}))))),null==v?void 0:v.contents.map((e,t)=>o.createElement("div",{key:t,id:null==e?void 0:e.header},o.createElement("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"}},a(e.header)),e.descriptions.map((e,t)=>o.createElement("div",{key:t,style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"}},o.createElement("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"}},"points"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc"}},"•"),"step"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"}},t+1,". "),a(e.text)),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&o.createElement("div",{className:"policy-subdescription"},e.subDescriptions.map((e,t)=>o.createElement("div",{key:t,className:"policy-subdescription-points"},"points"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"}},"•"),"step"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"}},t+1,". "),null===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"}}," "),a(e.text))))))))))},ho=e=>{var n,i,s;let{stateCode:c,enabledModules:d,moduleReducers:m,defaultLanding:p,allowedUserTypes:v}=e;const{isLoading:f,data:g={}}=Digit.Hooks.useInitStore(c,d);if(f)return o.createElement(t.Loader,{page:!0,variant:"PageLoader"});const E=function(e,t){return void 0===t&&(t={}),u.createStore(((e,t)=>{return u.combineReducers({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return{...e,selectedLanguage:t.payload};default:return e}}),...t});var n})(e,t),go)}(g,m(g))||{};return l.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",Eo),o.createElement(r.Provider,{store:E},o.createElement(a.BrowserRouter,null,o.createElement(t.BodyContainer,null,Digit.Utils.getMultiRootTenant()?o.createElement(vo,{initData:g,stateCode:c,modules:null==g?void 0:g.modules,appTenants:g.tenants,logoUrl:null==g||null===(n=g.stateInfo)||void 0===n?void 0:n.logoUrl,logoUrlWhite:null==g||null===(i=g.stateInfo)||void 0===i?void 0:i.logoUrlWhite,defaultLanding:p,allowedUserTypes:v}):o.createElement(po,{initData:g,stateCode:c,modules:null==g?void 0:g.modules,appTenants:g.tenants,logoUrl:null==g||null===(s=g.stateInfo)||void 0===s?void 0:s.logoUrl,defaultLanding:p,allowedUserTypes:v}))))},yo={SelectOtp:tt,ChangeCity:be,ChangeLanguage:Se,LoginSignupSelector:e=>{let{onSelect:i,...r}=e;const{t:a}=l.useTranslation(),[s,c]=n.useState(!0);n.useEffect(()=>{i("check",s)},[s]);const u=window.location.href.includes("sandbox-ui/user/sign-up");return o.createElement(o.Fragment,null,o.createElement("div",{className:"loginSignUpSelector",style:{marginTop:"-2rem"}},o.createElement(t.Button,u?{label:a("SB_ALREADY_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/user/login`)},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}:{label:a("SB_DONT_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/user/sign-up`)},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}})))},ForgotOrganizationTooltip:e=>{const{t:i}=l.useTranslation(),[r,a]=n.useState(!1),s=n.useRef(null);return n.useEffect(()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&a(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),o.createElement("div",{ref:s,className:"loginSignUpSelector",style:{position:"relative",marginTop:"-2rem"}},o.createElement(t.Button,{label:i("SB_FORGOTORGANIZATION_TOOLTIP"),variation:"link",size:"small",onClick:()=>a(e=>!e),style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}),r&&o.createElement("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:1e3,fontSize:"0.875rem"}},i("SB_FORGOTORGANIZATION_TOOLTIP_TEXT")))},OtpComponent:e=>{var i,r;let{onSelect:c,...u}=e;const{t:d}=l.useTranslation(),[m,p]=(a.useLocation(),n.useState(null)),[v,f]=n.useState({}),[g,E]=n.useState(!0),[h,y]=n.useState(30),b=()=>{p(null)};et(()=>{y(h-1)},h>0?1e3:null),n.useEffect(()=>{c("OtpComponent",v)},[v]);const S={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(i=u.props)||void 0===i?void 0:i.code},body:{},config:{enable:!1}},C=Digit.Hooks.useCustomAPIMutationHook(S);return o.createElement(n.Fragment,null,o.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-email",style:{fontWeight:"bold"}},null==u||null===(r=u.props)||void 0===r?void 0:r.email),o.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{f({...v,otp:e})},value:null==v?void 0:v.otp}),h>0?o.createElement(t.CardText,{className:"sandbox-resend-otp"},`${d("CS_RESEND_ANOTHER_OTP")} ${h} ${d("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return y(30),Promise.resolve(C.mutate({body:{otp:{userName:null==u||null===(e=u.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==u||null===(t=u.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,i,r,a,s;p({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&l[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(i=e.response)||void 0===i||null===(r=i.data)||void 0===r||null===(a=r.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(b,5e3)},onSuccess:function(e){try{return p({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(b,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!g&&o.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),m&&o.createElement(t.Toast,{type:null==m?void 0:m.key,label:d(null==m?void 0:m.label),onClose:b}))},PrivacyComponent:Eo};exports.DigitUI=e=>{let{stateCode:t,registry:l,enabledModules:r,moduleReducers:a,defaultLanding:s,allowedUserTypes:c}=e;const[u,d]=n.useState(Digit.Utils.getPrivacyObject()||{}),m=(Digit.UserService.getType(),new i.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),p=Digit.Contexts.ComponentProvider,v=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),o.createElement("div",null,o.createElement(ae,null,o.createElement(i.QueryClientProvider,{client:m},o.createElement(p.Provider,{value:l},o.createElement(v.Provider,{value:{privacy:null==u?void 0:u[window.location.pathname],resetPrivacy:e=>{Digit.Utils.setPrivacyObject({}),d({})},getPrivacy:()=>{const e=Digit.Utils.getPrivacyObject();return d(e),e},updatePrivacyDescoped:e=>{const t=Digit.Utils.getAllPrivacyObject(),n={...t,[window.location.pathname]:e};Digit.Utils.setPrivacyObject({...n}),d((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{d(Digit.Utils.updatePrivacy(e,t)||{})}}},o.createElement(ho,{stateCode:t,enabledModules:r,moduleReducers:a,defaultLanding:s,allowedUserTypes:c}))))))},exports.initCoreComponents=()=>{Object.entries(yo).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};