@egovernments/digit-ui-module-core 1.6.0-alpha.4 → 1.6.0
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 +1 -1
- package/package.json +3 -2
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("react"),n=e(t),r=require("react-query"),i=require("react-redux"),a=require("react-router-dom"),l=require("react-i18next"),o=require("@egovernments/digit-ui-react-components"),u=e(require("react-tooltip")),c=require("redux"),s=e(require("redux-thunk"));function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g=function(e,t,n){var r=null==e?void 0:e[""+t];r&&r.map(function(e){e.link=e.navigationURL,e.i18nKey=n(e.name)});var i={links:null==r?void 0:r.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:"CITIZEN_"+t+"_ICON"};return"FSM"===t&&[{role:"FSM_DSO",from:"/digit-ui/citizen/fsm/dso-dashboard",dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(function(e){var t,r,a=e.from,l=e.loginLink,o=e.dashoardLink;Digit.UserService.hasAccess(e.role)?null==i||null===(t=i.links)||void 0===t||t.push({link:a,i18nKey:n(o)}):null==i||null===(r=i.links)||void 0===r||r.push({link:"/digit-ui/citizen/login",state:{role:"FSM_DSO",from:a},i18nKey:n(l)})}),i},E=function(e){var t=e.modules,r=e.getCitizenMenu,i=e.fetchedCitizen,a=e.isLoading,u=t.filter(function(e){return"Payment"===e.code})[0],c=t.filter(function(e){return"Payment"!==e.code}),s=[u].concat(c),d=l.useTranslation().t;return a?n.createElement(o.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"citizen-all-services-wrapper"},n.createElement(o.BackButton,null),n.createElement("div",{className:"citizenAllServiceGrid"},s.filter(function(e){return e}).map(function(e,t){var a,l,u,c,s,m,f,v=e.code;return i&&(u=i?g(r,v,d):void 0),(null===(a=u)||void 0===a||null===(l=a.links)||void 0===l?void 0:l.length)>0?n.createElement(o.CitizenHomeCard,{header:d(null===(c=u)||void 0===c?void 0:c.header),links:null===(s=u)||void 0===s||null===(m=s.links)||void 0===m||null===(f=m.filter(function(e){return null==e?void 0:e.link}))||void 0===f?void 0:f.sort(function(e,t){return(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)}),Icon:function(){return function(e){switch(e){case"PT":return n.createElement(o.PTIcon,{className:"fill-path-primary-main"});case"WS":return n.createElement(o.WSICon,{className:"fill-path-primary-main"});case"FSM":return n.createElement(o.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return n.createElement(o.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return n.createElement(o.PGRIcon,{className:"fill-path-primary-main"});case"TL":return n.createElement(o.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return n.createElement(o.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return n.createElement(o.BillsIcon,{className:"fill-path-primary-main"});default:return n.createElement(o.PTIcon,{className:"fill-path-primary-main"})}}(v)},Info:"OBPS"===v?function(){return n.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===v}):n.createElement(n.Fragment,null)}))))},y=function(e){return n.createElement("div",{className:"employee-app-container"},n.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper"},e.modules.map(function(e,t){var r=Digit.ComponentRegistryService.getComponent(e.code+"Card")||function(){return n.createElement(n.Fragment,null)};return n.createElement(r,{key:t})})))},h=function(e){var t=e.modules;return"citizen"===e.userType?n.createElement(E,{modules:t,getCitizenMenu:e.getCitizenMenu,fetchedCitizen:e.fetchedCitizen,isLoading:e.isLoading}):n.createElement(y,{modules:t})},C=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{b(r,1,a(this.v))}catch(e){b(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?b(r,1,t?t(i):i):n?b(r,1,n(i)):b(r,2,i)}catch(e){b(r,2,e)}},r},e}();function b(e,t,n){if(!e.s){if(n instanceof C){if(!n.s)return void(n.o=b.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(b.bind(null,e,t),b.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}function O(e){return e instanceof C&&1&e.s}var S="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function N(e,t,n){if("function"==typeof e[S]){var r,i,a,l=e[S]();if(function e(o){try{for(;!((r=l.next()).done||n&&n());)if((o=t(r.value))&&o.then){if(!O(o))return void o.then(e,a||(a=b.bind(null,i=new C,2)));o=o.v}i?b(i,1,o):i=o}catch(e){b(i||(i=new C),2,e)}}(),l.return){var o=function(e){try{r.done||l.return()}catch(e){}return e};if(i&&i.then)return i.then(o,function(e){throw o(e)});o()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var u=[],c=0;c<e.length;c++)u.push(e[c]);return function(e,t,n){var r,i,a=-1;return function l(o){try{for(;++a<e.length&&(!n||!n());)if((o=t(a))&&o.then){if(!O(o))return void o.then(l,i||(i=b.bind(null,r=new C,2)));o=o.v}r?b(r,1,o):r=o}catch(e){b(r||(r=new C),2,e)}}(),r}(u,function(e){return t(u[e])},n)}function I(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var _=[{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,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],D=function(e){var t=e.mobileNumber;return n.createElement(o.FormStep,{isDisabled:!(10===t.length&&e.canSubmit),onSelect:e.onSelect,config:e.config,t:e.t,componentInFront:"+91",onChange:e.onMobileChange,value:t})},w=function(e){var r,i,a,l=e.config,u=e.otp,c=e.onOtpChange,s=e.onResend,d=e.onSelect,m=e.t,f=e.error,v=e.userType,p=void 0===v?"citizen":v,g=e.canSubmit,E=t.useState(30),y=E[0],h=E[1];r=function(){h(y-1)},i=y>0?1e3:null,a=t.useRef(),t.useEffect(function(){a.current=r},[r]),t.useEffect(function(){if(null!==i){var e=setInterval(function(){a.current()},i);return function(){return clearInterval(e)}}},[i]);var C=function(){s(),h(2)};return"employee"===p?n.createElement(t.Fragment,null,n.createElement(o.OTPInput,{length:6,onChange:c,value:u}),y>0?n.createElement(o.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):n.createElement("p",{className:"card-text-button",onClick:C},m("CS_RESEND_OTP")),!f&&n.createElement(o.CardLabelError,null,m("CS_INVALID_OTP"))):n.createElement(o.FormStep,{onSelect:d,config:l,t:m,isDisabled:!(6===(null==u?void 0:u.length)&&g)},n.createElement(o.OTPInput,{length:6,onChange:c,value:u}),y>0?n.createElement(o.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):n.createElement("p",{className:"card-text-button",onClick:C},m("CS_RESEND_OTP")),!f&&n.createElement(o.CardLabelError,null,m("CS_INVALID_OTP")))},T=function(e){return n.createElement(o.FormStep,{config:e.config,onSelect:e.onSelect,t:e.t,isDisabled:e.isDisabled})},L=["ResponseInfo","UserRequest"],A=["ResponseInfo","UserRequest"],R={type:"register"},M={type:"login"},P=function(e,t){return(null==e?void 0:e.from)||(null==t?void 0:t.from)||"/digit-ui/citizen"},x=function(e){var r,i,u=e.stateCode,c=e.isUserRegistered,s=void 0===c||c,m=l.useTranslation().t,v=a.useLocation(),p=a.useRouteMatch().path,g=a.useHistory(),E=t.useState(null),y=E[0],h=E[1],C=t.useState(null),b=C[0],O=C[1],S=t.useState(!0),N=S[0],x=S[1],k=(t.useState(null),t.useState(s?{}:null==v||null===(r=v.state)||void 0===r?void 0:r.data)),U=k[0],B=k[1],F=t.useState(null),j=F[0],V=F[1],H=Digit.Hooks.useQueryParams(),G=t.useState(!1),z=G[0],W=G[1],q=t.useState(!0),X=q[0],Z=q[1],Y=t.useState(!0),K=Y[0],J=Y[1];t.useEffect(function(){var e;return b&&(j&&(clearTimeout(j),V(null)),e=setTimeout(function(){O("")},5e3),V(e)),function(){e&&clearTimeout(e)}},[b]),t.useEffect(function(){var e;if(y){var t,n,r,i,a,l;Digit.SessionStorage.set("citizen.userRequestObject",y),Digit.UserService.setUser(y),t=null==y?void 0:y.info,n=null==y?void 0:y.access_token,r=u,l=null===(i=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.selectedLanguage,localStorage.setItem("Citizen.tenant-id",r),localStorage.setItem("tenant-id",r),localStorage.setItem("citizen.userRequestObject",JSON.stringify(t)),localStorage.setItem("locale",l),localStorage.setItem("Citizen.locale",l),localStorage.setItem("token",n),localStorage.setItem("Citizen.token",n),localStorage.setItem("user-info",JSON.stringify(t)),localStorage.setItem("Citizen.user-info",JSON.stringify(t));var o=(null===(e=v.state)||void 0===e?void 0:e.from)||"/digit-ui/citizen";Digit.ULBService.getCitizenCurrentTenant(!0)?g.replace(o):g.replace("/digit-ui/citizen/select-location",{redirectBackTo:o})}},[y]);var Q=t.useMemo(function(){return _.map(function(e){var t={};for(var n in e.texts)t[n]=m(e.texts[n]);return d({},e,{texts:t})},[_])}),$=function(){return Digit.UserService.getType()},ee=function(e){return Promise.resolve(I(function(){return Promise.resolve(Digit.UserService.sendOtp(e,u)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return n.createElement("div",{className:"citizen-form-wrapper"},n.createElement(a.Switch,null,n.createElement(o.AppContainer,null,n.createElement(o.BackButton,null),n.createElement(a.Route,{path:""+p,exact:!0},n.createElement(D,{onSelect:function(e){try{J(!1),B(d({},U,e));var t=d({},e,{tenantId:u,userType:$()});return Promise.resolve(s?Promise.resolve(ee({otp:d({},t,M)})).then(function(e){var n,r,i;if(!e[1])return J(!0),void g.replace(p+"/otp",{from:P(v.state,H),role:null===(r=v.state)||void 0===r?void 0:r.role});J(!0),v.state&&"FSM_DSO"===v.state.role||g.push("/digit-ui/citizen/register/name",{from:P(v.state,H),data:t}),null!==(n=v.state)&&void 0!==n&&n.role&&(J(!0),O("FSM_DSO"===(null===(i=v.state)||void 0===i?void 0:i.role)?m("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(ee({otp:d({},t,R)})).then(function(e){if(!e[1])return J(!0),void g.replace(p+"/otp",{from:P(v.state,H)});J(!0)}))}catch(e){return Promise.reject(e)}},config:Q[0],mobileNumber:U.mobileNumber||"",onMobileChange:function(e){B(d({},U,{mobileNumber:e.target.value}))},canSubmit:K,showRegisterLink:s&&!(null!==(i=v.state)&&void 0!==i&&i.role),t:m})),n.createElement(a.Route,{path:p+"/otp"},n.createElement(w,{config:d({},Q[1],{texts:d({},Q[1].texts,{cardText:Q[1].texts.cardText+" "+(U.mobileNumber||"")})}),onOtpChange:function(e){B(d({},U,{otp:e}))},onResend:function(){try{var e={mobileNumber:U.mobileNumber,tenantId:u,userType:$()},t=function(){if(!s)return Promise.resolve(ee({otp:d({},e,R)})).then(function(){});var t=function(){if(s)return Promise.resolve(ee({otp:d({},e,M)})).then(function(){})}();return t&&t.then?t.then(function(){}):void 0}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(I(function(){x(!0),Z(!1);var e=U.mobileNumber,t=U.otp,n=U.name;return function(){if(s){var r={username:e,password:t,tenantId:u,userType:$()};return Promise.resolve(Digit.UserService.authenticate(r)).then(function(e){var t,n,r,i=e.UserRequest,a=f(e,L);if(null!==(t=v.state)&&void 0!==t&&t.role){var l=i.roles.find(function(e){return e.code===v.state.role});if(!l||!l.code)return O(m("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(function(){return g.replace("/digit-ui/citizen")},5e3)}null!==(n=window)&&void 0!==n&&null!==(r=n.globalConfigs)&&void 0!==r&&r.getConfig("ENABLE_SINGLEINSTANCE")&&(i.tenantId=Digit.ULBService.getStateId()),h(d({info:i},a))})}var i=function(){if(!s)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:u},u)).then(function(e){var t,n,r=e.UserRequest,i=f(e,A);null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(r.tenantId=Digit.ULBService.getStateId()),h(d({info:r},i))})}();if(i&&i.then)return i.then(function(){})}()},function(){Z(!0),x(!1)}))}catch(e){return Promise.reject(e)}},otp:U.otp,error:N,canSubmit:X,t:m})),n.createElement(a.Route,{path:p+"/name"},n.createElement(T,{config:Q[2],onSelect:function(e){try{var t=d({},U,{tenantId:u,userType:$()},e);return B(d({},U,e)),W(!0),Promise.resolve(ee({otp:d({},t,R)})).then(function(e){e[0]?(W(!1),g.replace(p+"/otp",{from:P(v.state,H)})):W(!1)})}catch(e){return Promise.reject(e)}},t:m,isDisabled:z})),b&&n.createElement(o.Toast,{error:!0,label:b,onClose:function(){return O(null)}}))))},k=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"username",error:"ERR_HRMS_INVALID_USER_ID"},{label:"CORE_LOGIN_PASSWORD",type:"password",name:"password",error:"ERR_HRMS_WRONG_PASSWORD"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}];function U(e,t){return e(t={exports:{}},t.exports),t.exports}var B="function"==typeof Symbol&&Symbol.for,F=B?Symbol.for("react.element"):60103,j=B?Symbol.for("react.portal"):60106,V=B?Symbol.for("react.fragment"):60107,H=B?Symbol.for("react.strict_mode"):60108,G=B?Symbol.for("react.profiler"):60114,z=B?Symbol.for("react.provider"):60109,W=B?Symbol.for("react.context"):60110,q=B?Symbol.for("react.async_mode"):60111,X=B?Symbol.for("react.concurrent_mode"):60111,Z=B?Symbol.for("react.forward_ref"):60112,Y=B?Symbol.for("react.suspense"):60113,K=B?Symbol.for("react.suspense_list"):60120,J=B?Symbol.for("react.memo"):60115,Q=B?Symbol.for("react.lazy"):60116,$=B?Symbol.for("react.block"):60121,ee=B?Symbol.for("react.fundamental"):60117,te=B?Symbol.for("react.responder"):60118,ne=B?Symbol.for("react.scope"):60119;function re(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case F:switch(e=e.type){case q:case X:case V:case G:case H:case Y:return e;default:switch(e=e&&e.$$typeof){case W:case Z:case Q:case J:case z:return e;default:return t}}case j:return t}}}function ie(e){return re(e)===X}var ae={AsyncMode:q,ConcurrentMode:X,ContextConsumer:W,ContextProvider:z,Element:F,ForwardRef:Z,Fragment:V,Lazy:Q,Memo:J,Portal:j,Profiler:G,StrictMode:H,Suspense:Y,isAsyncMode:function(e){return ie(e)||re(e)===q},isConcurrentMode:ie,isContextConsumer:function(e){return re(e)===W},isContextProvider:function(e){return re(e)===z},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===F},isForwardRef:function(e){return re(e)===Z},isFragment:function(e){return re(e)===V},isLazy:function(e){return re(e)===Q},isMemo:function(e){return re(e)===J},isPortal:function(e){return re(e)===j},isProfiler:function(e){return re(e)===G},isStrictMode:function(e){return re(e)===H},isSuspense:function(e){return re(e)===Y},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===V||e===X||e===G||e===H||e===Y||e===K||"object"==typeof e&&null!==e&&(e.$$typeof===Q||e.$$typeof===J||e.$$typeof===z||e.$$typeof===W||e.$$typeof===Z||e.$$typeof===ee||e.$$typeof===te||e.$$typeof===ne||e.$$typeof===$)},typeOf:re},le=U(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,l=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var f=e.type;switch(f){case c:case s:case i:case l:case a:case m:return f;default:var g=f&&f.$$typeof;switch(g){case u:case d:case p:case v:case o:return g;default:return t}}case r:return t}}}var b=s,O=u,S=o,N=n,I=d,_=i,D=p,w=v,T=r,L=l,A=a,R=m,M=!1;function P(e){return C(e)===s}t.AsyncMode=c,t.ConcurrentMode=b,t.ContextConsumer=O,t.ContextProvider=S,t.Element=N,t.ForwardRef=I,t.Fragment=_,t.Lazy=D,t.Memo=w,t.Portal=T,t.Profiler=L,t.StrictMode=A,t.Suspense=R,t.isAsyncMode=function(e){return M||(M=!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)||C(e)===c},t.isConcurrentMode=P,t.isContextConsumer=function(e){return C(e)===u},t.isContextProvider=function(e){return C(e)===o},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return C(e)===d},t.isFragment=function(e){return C(e)===i},t.isLazy=function(e){return C(e)===p},t.isMemo=function(e){return C(e)===v},t.isPortal=function(e){return C(e)===r},t.isProfiler=function(e){return C(e)===l},t.isStrictMode=function(e){return C(e)===a},t.isSuspense=function(e){return C(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===l||e===a||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===v||e.$$typeof===o||e.$$typeof===u||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=C}()}),oe=U(function(e){e.exports="production"===process.env.NODE_ENV?ae:le}),ue=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;function de(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var me=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 r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=de(e),a=1;a<arguments.length;a++){for(var l in n=Object(arguments[a]))ce.call(n,l)&&(i[l]=n[l]);if(ue){r=ue(n);for(var o=0;o<r.length;o++)se.call(n,r[o])&&(i[r[o]]=n[r[o]])}}return i},fe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ve=Function.call.bind(Object.prototype.hasOwnProperty),pe=function(){};if("production"!==process.env.NODE_ENV){var ge=fe,Ee={},ye=ve;pe=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function he(e,t,n,r,i){if("production"!==process.env.NODE_ENV)for(var a in e)if(ye(e,a)){var l;try{if("function"!=typeof e[a]){var o=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw o.name="Invariant Violation",o}l=e[a](t,a,r,n,null,ge)}catch(e){l=e}if(!l||l instanceof Error||pe((r||"React class")+": type specification of "+n+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in Ee)){Ee[l.message]=!0;var u=i?i():"";pe("Failed "+n+" type: "+l.message+(null!=u?u:""))}}}he.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Ee={})};var Ce=he,be=function(){};function Oe(){return null}function Se(){}function Ne(){}"production"!==process.env.NODE_ENV&&(be=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Ne.resetWarningCache=Se;var Ie=U(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:o("array"),bigint:o("bigint"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),symbol:o("symbol"),any:l(Oe),arrayOf:function(e){return l(function(t,n,r,i,l){if("function"!=typeof e)return new a("Property `"+l+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var o=t[n];if(!Array.isArray(o))return new a("Invalid "+i+" `"+l+"` of type `"+s(o)+"` supplied to `"+r+"`, expected an array.");for(var u=0;u<o.length;u++){var c=e(o,u,r,i,l+"["+u+"]",fe);if(c instanceof Error)return c}return null})},element:l(function(t,n,r,i,l){var o=t[n];return e(o)?null:new a("Invalid "+i+" `"+l+"` of type `"+s(o)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:l(function(e,t,n,r,i){var l=e[t];return oe.isValidElementType(l)?null:new a("Invalid "+r+" `"+i+"` of type `"+s(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return l(function(t,n,r,i,l){var o;return t[n]instanceof e?null:new a("Invalid "+i+" `"+l+"` of type `"+((o=t[n]).constructor&&o.constructor.name?o.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:l(function(e,t,n,r,i){return c(e[t])?null:new a("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return l(function(t,n,r,i,l){if("function"!=typeof e)return new a("Property `"+l+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var o=t[n],u=s(o);if("object"!==u)return new a("Invalid "+i+" `"+l+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var c in o)if(ve(o,c)){var d=e(o,c,r,i,l+"."+c,fe);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&be(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."),Oe;function t(t,n,r,l,o){for(var u=t[n],c=0;c<e.length;c++)if(i(u,e[c]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new a("Invalid "+l+" `"+o+"` of value `"+String(u)+"` supplied to `"+r+"`, expected one of "+s+".")}return l(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&be("Invalid argument supplied to oneOfType, expected an instance of array."),Oe;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return be("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),Oe}return l(function(t,n,r,i,l){for(var o=[],u=0;u<e.length;u++){var c=(0,e[u])(t,n,r,i,l,fe);if(null==c)return null;c.data&&ve(c.data,"expectedType")&&o.push(c.data.expectedType)}return new a("Invalid "+i+" `"+l+"` supplied to `"+r+"`"+(o.length>0?", expected one of type ["+o.join(", ")+"]":"")+".")})},shape:function(e){return l(function(t,n,r,i,l){var o=t[n],c=s(o);if("object"!==c)return new a("Invalid "+i+" `"+l+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var m in e){var f=e[m];if("function"!=typeof f)return u(r,i,l,m,d(f));var v=f(o,m,r,i,l+"."+m,fe);if(v)return v}return null})},exact:function(e){return l(function(t,n,r,i,l){var o=t[n],c=s(o);if("object"!==c)return new a("Invalid "+i+" `"+l+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var m=me({},t[n],e);for(var f in m){var v=e[f];if(ve(e,f)&&"function"!=typeof v)return u(r,i,l,f,d(v));if(!v)return new a("Invalid "+i+" `"+l+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=v(o,f,r,i,l+"."+f,fe);if(p)return p}return null})}};function i(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function a(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function l(e){function t(t,n,r,i,l,o,u){if(i=i||"<<anonymous>>",o=o||r,u!==fe){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[r]?t?new a(null===n[r]?"The "+l+" `"+o+"` is marked as required in `"+i+"`, but its value is `null`.":"The "+l+" `"+o+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(n,r,i,l,o)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e){return l(function(t,n,r,i,l,o){var u=t[n];return s(u)!==e?new a("Invalid "+i+" `"+l+"` of type `"+d(u)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,r,i){return new a((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}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 r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var i,a=r.call(t);if(r!==t.entries){for(;!(i=a.next()).done;)if(!c(i.value))return!1}else for(;!(i=a.next()).done;){var l=i.value;if(l&&!c(l[1]))return!1}return!0;default:return!1}}function s(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=s(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 a.prototype=Error.prototype,r.checkPropTypes=Ce,r.resetWarningCache=Ce.resetWarningCache,r.PropTypes=r,r}(oe.isElement):function(){function e(e,t,n,r,i,a){if(a!==fe){var l=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 l.name="Invariant Violation",l}}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:Ne,resetWarningCache:Se};return n.PropTypes=n,n}()}),_e=function(e){return n.createElement("div",{className:"banner banner-container"},e.children)},De=function(){var e=Digit.Hooks.useStore.getInitData(),t=e.isLoading,r=(e.data||{}).stateInfo,i=l.useTranslation().t;return t?n.createElement(o.Loader,null):n.createElement("div",{className:"bannerHeader"},n.createElement("img",{className:"bannerLogo",src:null==r?void 0:r.logoUrl}),n.createElement("p",null,i("TENANT_TENANTS_"+(null==r?void 0:r.code.toUpperCase()))))},we=["UserRequest"],Te=function(e){var r,i,l,u=e.config,c=e.t,s=e.isDisabled,m=Digit.Hooks.useTenants(),v=m.data,p=m.isLoading,g=Digit.Hooks.useStore.getInitData().isLoading,E=t.useState(null),y=E[0],h=E[1],C=t.useState(null),b=C[0],O=C[1],S=t.useState(!1),N=S[0],_=S[1],D=a.useHistory();t.useEffect(function(){var e,t,n,r,i,a,l,o,u,c,s,d,m;if(y){Digit.SessionStorage.set("citizen.userRequestObject",y);var f,v,p,g,E=null==y||null===(e=y.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(function(e){return e.tenantId===Digit.SessionStorage.get("Employee.tenantId")});(null==y||null===(n=y.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.length)>0&&(y.info.roles=E),Digit.UserService.setUser(y),f=null==y?void 0:y.info,v=null==y?void 0:y.access_token,g=(null===(p=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===p?void 0:p.value)||"en_IN",localStorage.setItem("Employee.tenant-id",null==f?void 0:f.tenantId),localStorage.setItem("tenant-id",null==f?void 0:f.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(f)),localStorage.setItem("locale",g),localStorage.setItem("Employee.locale",g),localStorage.setItem("token",v),localStorage.setItem("Employee.token",v),localStorage.setItem("user-info",JSON.stringify(f)),localStorage.setItem("Employee.user-info",JSON.stringify(f));var h,C,b,O,S="/digit-ui/employee";null!==(i=window)&&void 0!==i&&null!==(a=i.location)&&void 0!==a&&null!==(l=a.href)&&void 0!==l&&l.includes("from=")&&(S=decodeURIComponent(null===(h=window)||void 0===h||null===(C=h.location)||void 0===C||null===(b=C.href)||void 0===b||null===(O=b.split("from="))||void 0===O?void 0:O[1])||"/digit-ui/employee"),null!=y&&null!==(o=y.info)&&void 0!==o&&o.roles&&null!=y&&null!==(u=y.info)&&void 0!==u&&null!==(c=u.roles)&&void 0!==c&&c.every(function(e){return"NATADMIN"===e.code})&&(S="/digit-ui/employee/dss/landing/NURT_DASHBOARD"),null!=y&&null!==(s=y.info)&&void 0!==s&&s.roles&&null!=y&&null!==(d=y.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(function(e){return"STADMIN"===e.code})&&(S="/digit-ui/employee/dss/landing/home"),D.replace(S)}},[y]);var w=function(){O(null)},T=u.inputs,L=T[0],A=T[1],R=T[2],M=[{body:[{label:c(L.label),type:L.type,populators:{name:L.name},isMandatory:!0},{label:c(A.label),type:A.type,populators:{name:A.name},isMandatory:!0},{label:c(R.label),type:R.type,populators:{name:R.name,customProps:{},component:function(e,t){return n.createElement(o.Dropdown,d({option:v,className:"login-city-dd",optionKey:"i18nKey",select:function(t){e.onChange(t)},t:c},t))}},isMandatory:!0}]}];return p||g?n.createElement(o.Loader,null):n.createElement(_e,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(o.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(o.FormComposer,{onSubmit:function(e){try{var t=function(){_(!1)};if(!e.city)return alert("Please Select City!"),Promise.resolve();_(!0);var n=d({},e,{userType:"EMPLOYEE"});n.tenantId=e.city.code,delete n.city;var r=I(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t=e.UserRequest,n=f(e,we);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),h(d({info:t},n))})},function(e){var t,n;O((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"Invalid login credentials!"),setTimeout(w,5e3)});return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},isDisabled:s||N,noBoxShadow:!0,inline:!0,submitInForm:!0,config:M,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:function(){D.push("/digit-ui/employee/user/forgot-password")},heading:u.texts.header,headingStyle:{textAlign:"center"},cardStyle:{margin:"auto",minWidth:"408px"},className:"loginFormStyleEmployee",buttonStyle:{maxWidth:"100%",width:"100%"}},n.createElement(De,null)),b&&n.createElement(o.Toast,{error:!0,label:c(b),onClose:w}),n.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};Te.propTypes={loginParams:Ie.any},Te.defaultProps={loginParams:null};var Le=function(){var e=l.useTranslation().t,r=a.useRouteMatch().path,i=t.useMemo(function(){return k.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[k])});return n.createElement(a.Switch,null,n.createElement(a.Route,{path:""+r,exact:!0},n.createElement(Te,{config:i[0],t:e})))},Ae=[{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"}]}],Re=function(e){var r,i,l,u=e.config,c=e.t,s=t.useState(null)[0],m=Digit.Hooks.useQueryParams(),f=m.mobile_number,v=m.tenantId,p=a.useHistory(),g=t.useState(""),E=g[0],y=g[1],h=t.useState(!0)[0],C=t.useState(null),b=C[0],O=C[1],S=function(){return Digit.UserService.getType()};t.useEffect(function(){var e;if(s){Digit.UserService.setUser(s);var t=(null===(e=location.state)||void 0===e?void 0:e.from)||"/digit-ui/employee";p.replace(t)}else Digit.UserService.setType("employee")},[s]);var N=function(){O(null)},_=u.inputs,D=_[0],T=_[1],L=_[2],A=[{body:[{label:c(D.label),type:D.type,populators:{name:D.name},isMandatory:!0},{label:c(T.label),type:T.type,populators:{name:T.name},isMandatory:!0},{label:c(L.label),type:L.type,populators:{name:L.name},isMandatory:!0}]}];return n.createElement(_e,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(o.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(o.FormComposer,{onSubmit:function(e){try{return Promise.resolve(I(function(){if(e.newPassword!==e.confirmPassword)return O(c("ERR_PASSWORD_DO_NOT_MATCH"));var t=d({},e,{otpReference:E,tenantId:v,type:S().toUpperCase()});return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){p.replace("/digit-ui/employee/user/login")})},function(e){var t,n,r,i,a;O((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.message)||c("ES_SOMETHING_WRONG")),setTimeout(N,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:A,label:u.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},n.createElement(De,null),n.createElement(o.CardSubHeader,{style:{textAlign:"center"}}," ",u.texts.header," "),n.createElement(o.CardText,null,c("CS_LOGIN_OTP_TEXT")+" ",n.createElement("b",null," ",""+c("+ 91 - ")," ",f)),n.createElement(w,{t:c,userType:"employee",otp:E,onOtpChange:y,error:h,onResend:function(){try{var e=function(){setTimeout(N,5e3)},t={otp:{mobileNumber:f,userType:S().toUpperCase(),type:"passwordreset",tenantId:v}},n=I(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){O(c("ES_OTP_RESEND"))})},function(e){var t,n;O((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||c("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),b&&n.createElement(o.Toast,{error:!0,label:c(b),onClose:N}),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};Re.propTypes={loginParams:Ie.any},Re.defaultProps={loginParams:null};var Me=function(){var e=l.useTranslation().t,r=a.useRouteMatch().path,i=t.useMemo(function(){return Ae.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Ae])});return n.createElement(a.Switch,null,n.createElement(a.Route,{path:""+r,exact:!0},n.createElement(Re,{config:i[0],t:e})))},Pe=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],xe=function(e){var r,i,l,u=e.config,c=e.t,s=Digit.Hooks.useTenants(),m=s.data,f=s.isLoading,v=t.useState(null)[0],p=a.useHistory(),g=t.useState(null),E=g[0],y=g[1];t.useEffect(function(){var e;if(v){Digit.UserService.setUser(v);var t=(null===(e=location.state)||void 0===e?void 0:e.from)||"/digit-ui/employee";p.replace(t)}else Digit.UserService.setType("employee")},[v]);var h=function(){y(null)},C=u.inputs,b=C[0],O=C[1],S=[{body:[{label:c(b.label),type:b.type,populators:{name:b.name,componentInFront:"+91"},isMandatory:!0},{label:c(O.label),type:O.type,populators:{name:O.name,customProps:{},component:function(e,t){return n.createElement(o.Dropdown,d({option:m,optionKey:"name",id:O.name,className:"login-city-dd",select:function(t){e.onChange(t)}},t))}},isMandatory:!0}]}];return f?n.createElement(o.Loader,null):n.createElement(_e,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(o.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(o.FormComposer,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();var t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=I(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){p.push("/digit-ui/employee/user/change-password?mobile_number="+e.mobileNumber+"&tenantId="+e.city.code)})},function(e){var t,n,r,i,a;y((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.message)||"Invalid login credentials!"),setTimeout(h,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:S,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:function(){p.replace("/digit-ui/employee/login")},heading:u.texts.header,description:u.texts.description,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},n.createElement(De,null)),E&&n.createElement(o.Toast,{error:!0,label:c(E),onClose:h}),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};xe.propTypes={loginParams:Ie.any},xe.defaultProps={loginParams:null};var ke=function(){var e=l.useTranslation().t,r=a.useRouteMatch().path,i=t.useMemo(function(){return Pe.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Pe])});return n.createElement(a.Switch,null,n.createElement(a.Route,{path:""+r,exact:!0},n.createElement(xe,{config:i[0],t:e})))},Ue=function(){var e,r,i,u=Digit.Hooks.useStore.getInitData(),c=u.data,s=u.isLoading,d=l.useTranslation().t,m=a.useHistory(),f=c||{},v=f.languages,p=f.stateInfo,g=Digit.StoreData.getCurrentLanguage(),E=t.useState(g),y=E[0],h=E[1];return s?null:n.createElement(_e,null,n.createElement(o.Card,{className:"bannerCard removeBottomMargin"},n.createElement("div",{className:"bannerHeader"},n.createElement("img",{className:"bannerLogo",src:null==p?void 0:p.logoUrl,alt:"Digit"}),n.createElement("p",null,d("TENANT_TENANTS_"+(null==p?void 0:p.code.toUpperCase())))),n.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},v.map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(o.CustomButton,{selected:e.value===y,text:e.label,onClick:function(){return function(e){h(e.value),Digit.LocalizationService.changeLanguage(e.value,p.code)}(e)}}))})),n.createElement(o.SubmitBar,{style:{width:"100%"},label:d("CORE_COMMON_CONTINUE"),onSubmit:function(e){m.push("/digit-ui/employee/user/login")}})),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(r=e.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))},Be=function(e,t){return t.filter(function(t){var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,function(e){return e.code}).includes(t.code)})},Fe=function(e){var t=e.stateCode,r=e.userType,i=e.modules,l=e.appTenants,o=(Digit,a.useRouteMatch().path),u=a.useLocation(),c=Digit.UserService.getUser();if(!c||null==c||!c.access_token||null==c||!c.info)return n.createElement(a.Redirect,{to:{pathname:"/digit-ui/employee/user/login",state:{from:u.pathname+u.search}}});var s=i.map(function(e,i){var c=e.code,s=e.tenants,d=Digit.ComponentRegistryService.getComponent(c+"Module");return n.createElement(a.Route,{key:i,path:o+"/"+c.toLowerCase()},d?n.createElement(d,{stateCode:t,moduleCode:c,userType:r,tenants:Be(s,l)}):n.createElement(a.Redirect,{to:{pathname:"/digit-ui/employee/user/error?type=notfound",state:{from:u.pathname+u.search}}}))});return n.createElement("div",{className:"ground-container"},n.createElement(a.Switch,null,s,n.createElement(a.Route,{path:o+"/login"},n.createElement(a.Redirect,{to:{pathname:"/digit-ui/employee/user/login",state:{from:u.pathname+u.search}}})),n.createElement(a.Route,{path:o+"/forgot-password"},n.createElement(ke,null)),n.createElement(a.Route,{path:o+"/change-password"},n.createElement(Me,null)),n.createElement(a.Route,null,n.createElement(h,{userType:r,modules:i}))))},je={error:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/PageNotFound.png",infoMessage:"CORE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},Ve=function(e){var t=Digit.Hooks.useQueryParams().type,r=je[void 0===t?"error":t],i=l.useTranslation().t;return n.createElement("div",{className:"error-boundary"},n.createElement("div",{className:"error-container"},n.createElement("img",{src:r.imgUrl,alt:"error"}),n.createElement("h1",null,i(r.infoMessage)),n.createElement("button",{onClick:function(){e.goToHome()}},i(r.buttonInfo))))},He=function(){var e="employee"===Digit.UserService.getType()?"/digit-ui/employee/user/error":"/digit-ui/citizen/error";return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=e),n.createElement("span",null)},Ge=function(e){var t,r;function i(t){var n;return(n=e.call(this,t)||this).state={error:null,errorStack:null,hasError:!1},n}r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,m(t,r),i.getDerivedStateFromError=function(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack}};var a=i.prototype;return a.componentDidCatch=function(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})},a.render=function(){return this.state.hasError?n.createElement("div",{className:"error-boundary"},n.createElement(He,null),n.createElement(Ve,{initData:this.props.initData})):this.props.children},i}(n.Component),ze=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(r=e)&&void 0!==r&&r.includes(t);){var r,i;e=null===(i=e)||void 0===i?void 0:i.replace(t,n)}return e},We=function(e){var r,i=t.useState(null),l=i[0],u=i[1],c=t.useState([]),s=c[0],d=c[1],m=(t.useState([]),a.useHistory());return t.useEffect(function(){var t,n,r=Digit.SessionStorage.get("citizen.userRequestObject"),i=[],a=[];null==r||null===(t=r.info)||void 0===t||null===(n=t.roles)||void 0===n||n.forEach(function(e){return i.push(e.tenantId)});var l=i.filter(function(e,t,n){return n.indexOf(e)===t});null==l||l.forEach(function(t){var n;a.push({label:null==e?void 0:e.t("TENANT_TENANTS_"+(null===(n=ze(t,".","_"))||void 0===n?void 0:n.toUpperCase())),value:t})}),null==a||a.filter(function(e){return e.value==Digit.SessionStorage.get("Employee.tenantId")}),d(a)},[l]),n.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},n.createElement(o.Dropdown,{option:s,selected:s.find(function(e){return e.value===(null==l?void 0:l.value)}),optionKey:"label",select:function(e){var t,n,r,i=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.filter(function(t){return t.tenantId===e.value});if((null==a?void 0:a.length)>0&&(i.info.roles=a,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),u(e),window.location.href.includes("/digit-ui/employee/")){var l,o=(null===(l=location.state)||void 0===l?void 0:l.from)||"/digit-ui/employee";m.replace(o)}window.location.reload()},freeze:!0,customSelector:n.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(r=ze(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===r?void 0:r.toUpperCase())))}))},qe=function(e){var r=e.dropdown||!1,i=Digit.Hooks.useStore.getInitData(),a=i.isLoading,l=i.data||{},u=l.languages,c=l.stateInfo,s=Digit.StoreData.getCurrentLanguage(),d=t.useState(s),m=d[0],f=d[1],v=function(e){f(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)};return a?null:r?n.createElement("div",null,n.createElement(o.Dropdown,{option:u,selected:u.find(function(e){return e.value===s}),optionKey:"label",select:v,freeze:!0,customSelector:n.createElement("label",{className:"cp"},u.find(function(e){return e.value===m}).label)})):n.createElement(n.Fragment,null,n.createElement("div",{style:{marginBottom:"5px"}},"Language"),n.createElement("div",{className:"language-selector"},u.map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(o.CustomButton,{selected:e.value===m,text:e.label,onClick:function(){return v(e)}}))})))},Xe=function(e){var t,r;return n.createElement("span",{className:"user-img-txt",onClick:e.toggleMenu,title:e.name},null==e||null===(t=e.name)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.toUpperCase())},Ze=function(e){var t,r,i,l,u,c,s,d=e.t,m=e.stateInfo,f=e.toggleSidebar,v=e.handleLogout,p=e.userDetails,g=e.CITIZEN,E=e.cityDetails,y=e.mobileView,h=e.userOptions,C=e.handleUserDropdownSelection,b=e.logoUrl,O=e.showLanguageChange,S=void 0===O||O,N=n.useState(null),I=N[0],_=N[1];n.useEffect(function(){try{var e,t=Digit.ULBService.getCurrentTenantId(),n=null==p||null===(e=p.info)||void 0===e?void 0:e.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");_(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==I,null==p||null===(t=p.info)||void 0===t?void 0:t.uuid]);var D,w,T,L,A,R,M=Digit.ULBService.getCitizenCurrentTenant(!0),P=a.useHistory(),x=a.useLocation().pathname,k=Digit.Hooks.useNotificationCount({tenantId:M,config:{enabled:"EMPLOYEE"!==(null===(D=Digit.UserService)||void 0===D||null===(w=D.getUser())||void 0===w||null===(T=w.info)||void 0===T?void 0:T.type)&&"CITIZEN"===(null===(L=Digit.UserService)||void 0===L||null===(A=L.getUser())||void 0===A||null===(R=A.info)||void 0===R?void 0:R.type)&&!!M}}),U=k.data,B=(U=void 0===U?{}:U).unreadCount;if(g)return n.createElement("div",null,n.createElement(o.TopBar,{img:null==m?void 0:m.logoUrlWhite,isMobile:!0,toggleSidebar:function(){Digit.clikOusideFired?Digit.clikOusideFired=!1:f(!0)},logoUrl:null==m?void 0:m.logoUrlWhite,onLogout:v,userDetails:p,notificationCount:B<99?B:99,notificationCountLoaded:k.isSuccess,cityOfCitizenShownBesideLogo:d(M),onNotificationIconClick:function(){P.push("/digit-ui/citizen/engagement/notifications")},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:function(e){var t,n;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&["/digit-ui/citizen/select-language","/digit-ui/citizen/select-location"].includes(e)}(x),changeLanguage:y?null:n.createElement(qe,{dropdown:!0})}));var F=!(null==p||!p.access_token);return n.createElement("div",{className:"topbar"},y?n.createElement(o.Hamburger,{handleClick:f,color:"#9E9E9E"}):null,n.createElement("img",{className:"city",src:F?null==E?void 0:E.logoId:null==m?void 0:m.statelogo}),n.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},F&&(null!=E&&null!==(r=E.city)&&void 0!==r&&r.ulbGrade?n.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d(null==E?void 0:E.i18nKey).toUpperCase()," ",d("ULBGRADE_"+(null==E||null===(i=E.city)||void 0===i?void 0:i.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):n.createElement("img",{className:"state",src:b})),!F&&n.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d("MYCITY_"+(null==m||null===(l=m.code)||void 0===l?void 0:l.toUpperCase())+"_LABEL")," ",d("MYCITY_STATECODE_LABEL")),!y&&n.createElement("div",{className:y?"right":"flex-right right w-80 column-gap-15",style:F?{}:{width:"80%"}},n.createElement("div",{className:"left"},!window.location.href.includes("employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&n.createElement(We,{dropdown:!0,t:d})),n.createElement("div",{className:"left"},S&&n.createElement(qe,{dropdown:!0})),(null==p?void 0:p.access_token)&&n.createElement("div",{className:"left"},n.createElement(o.Dropdown,{option:h,optionKey:"name",select:C,showArrow:!0,freeze:!0,style:y?{right:0}:{},optionCardStyles:{overflow:"revert"},customSelector:null==I?n.createElement(Xe,{name:(null==p||null===(u=p.info)||void 0===u?void 0:u.name)||(null==p||null===(c=p.info)||void 0===c||null===(s=c.userInfo)||void 0===s?void 0:s.name)||"Employee"}):n.createElement("img",{src:I,style:{height:"48px",width:"48px",borderRadius:"50%"}})})),n.createElement("img",{className:"state",src:b}))))},Ye=function(e,t,r,i,a,l){var o,u,c=(null==a||null===(o=a.tenants.filter(function(e){return e.code===l})[0])||void 0===o?void 0:o.contactNumber)||(null==a||null===(u=a.tenants[0])||void 0===u?void 0:u.contactNumber);return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:i?"/digit-ui/employee":"/digit-ui/citizen",icon:"HomeIcon",populators:{onClick:t}},{type:"component",element:"LANGUAGE",action:n.createElement(qe,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:"LoginIcon",populators:{onClick:r}},{id:"help-line",text:n.createElement(n.Fragment,null,e("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+c},c)))),element:"Helpline",icon:"Phone"}]},Ke=function(e){return n.createElement("h1",{className:"heading-m"},e.label)},Je=function(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))},Qe=function(e){return n.createElement("div",{onClick:null==e?void 0:e.onClick,style:null!=e&&e.isMobileView?{padding:5}:null},null!=e&&e.isMobileView?n.createElement(o.CloseSvg,null):n.createElement("div",{className:"icon-bg-secondary",style:{backgroundColor:"#505A5F"}}," ",n.createElement(Je,null)," "))},$e=function(e){var t=e.onSelect,r=e.onCancel,i=e.onDismiss,a=l.useTranslation().t,u=n.useState(window.innerWidth<=780),c=u[0],s=u[1],d=function(){window.innerWidth<=780?c||s(!0):c&&s(!1)};return n.useEffect(function(){return window.addEventListener("resize",function(){d()}),function(){window.addEventListener("resize",function(){d()})}}),c?n.createElement(o.Modal,{popupStyles:{height:"174px",maxHeight:"174px",width:"324px",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},popupModuleActionBarStyles:{display:"flex",flex:1,justifyContent:"flex-start",width:"100%",position:"absolute",left:0,bottom:0,padding:"18px"},style:{flex:1},popupModuleMianStyles:{padding:"18px"},headerBarMain:n.createElement(Ke,{label:a("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:n.createElement(Qe,{onClick:i,isMobileView:c}),actionCancelLabel:a("TL_COMMON_NO"),actionCancelOnSubmit:r,actionSaveLabel:a("TL_COMMON_YES"),actionSaveOnSubmit:t,formId:"modal-action"},n.createElement("div",null,n.createElement(o.CardText,{style:{margin:0}},a("CORE_LOGOUT_MOBILE_CONFIRMATION_MESSAGE")+" "))):n.createElement(o.Modal,{popupModuleMianStyles:{paddingTop:"30px"},headerBarMain:n.createElement(Ke,{label:a("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:n.createElement(Qe,{onClick:i,isMobileView:!1}),actionCancelLabel:a("CORE_LOGOUT_CANCEL"),actionCancelOnSubmit:r,actionSaveLabel:a("CORE_LOGOUT_WEB_YES"),actionSaveOnSubmit:t,formId:"modal-action"},n.createElement("div",null,n.createElement(o.CardText,{style:{marginBottom:"54px",marginLeft:"8px",marginRight:"8px"}},a("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",n.createElement("strong",null,a("CORE_LOGOUT_MESSAGE"),"?"))))},et=function(e){var t=e.info,r=e.t;return n.createElement("div",{className:"profile-section"},n.createElement("div",{className:"imageloader imageloader-loaded"},n.createElement("img",{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,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"})),n.createElement("div",{id:"profile-name",className:"label-container name-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),n.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&n.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",t.emailId," ")),n.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")&&n.createElement(We,{t:r,mobileView:!0}))},tt={CommonPTIcon:n.createElement(o.PTIcon,{className:"icon"}),OBPSIcon:n.createElement(o.OBPSIcon,{className:"icon"}),propertyIcon:n.createElement(o.PropertyHouse,{className:"icon"}),TLIcon:n.createElement(o.CaseIcon,{className:"icon"}),PGRIcon:n.createElement(o.PGRIcon,{className:"icon"}),FSMIcon:n.createElement(o.FSMIcon,{className:"icon"}),WSIcon:n.createElement(o.WSICon,{className:"icon"}),MCollectIcon:n.createElement(o.MCollectIcon,{className:"icon"}),BillsIcon:n.createElement(o.CollectionIcon,{className:"icon"}),BirthIcon:n.createElement(o.BirthIcon,{className:"icon"}),DeathIcon:n.createElement(o.DeathIcon,{className:"icon"}),FirenocIcon:n.createElement(o.FirenocIcon,{className:"icon"}),HomeIcon:n.createElement(o.HomeIcon,{className:"icon"}),EditPencilIcon:n.createElement(o.EditPencilIcon,{className:"icon"}),LogoutIcon:n.createElement(o.LogoutIcon,{className:"icon"}),Phone:n.createElement(o.Phone,{className:"icon"}),LoginIcon:n.createElement(o.LoginIcon,{className:"icon"})},nt=function(e){var r,i,u,c,s,m=e.linkData,f=e.islinkDataLoading,v=l.useTranslation().t,p=a.useHistory(),g=a.useLocation().pathname,E=Digit.Hooks.useStore.getInitData(),y=E.data,h=E.isFetched,C=(y||{}).stateInfo,b=Digit.UserService.getUser(),O=window.Digit.Utils.browser.isMobile(),S=t.useState(!1)[0],N=t.useState(!1)[1],I=t.useState(!1),_=I[0],D=I[1],w=function(){D(!1)};if(f||!h)return n.createElement(o.Loader,null);var T=function(){p.push("/digit-ui/citizen/user/profile")},L=Digit.ULBService.getCitizenCurrentTenant(),A=(null==y||null===(r=y.tenants.filter(function(e){return e.code===L})[0])||void 0===r?void 0:r.contactNumber)||(null==y||null===(i=y.tenants[0])||void 0===i?void 0:i.contactNumber),R=[].concat(Ye(v,T,function(){p.push("/digit-ui/citizen/login")},S,y,L));R=R.filter(function(e){return"LANGUAGE"!==e.element});var M,P=function(e){var t,r,i,l=e.item,o=(null==l?void 0:l.icon)||(null===(t=l.icon)||void 0===t||null===(r=t.type)||void 0===r?void 0:r.name),u=o?tt[o]:tt.BillsIcon;i="component"===l.type?l.action:l.text;var c=function(){return n.createElement("span",d({className:"menu-item"},l.populators),u,n.createElement("div",{className:"menu-label"},i))};return"external-link"===l.type?n.createElement("a",{href:l.link},n.createElement(c,null)):"link"===l.type?n.createElement(a.Link,{to:null==l?void 0:l.link},n.createElement(c,null)):n.createElement(c,null)};return h&&b&&b.access_token&&(M=n.createElement(et,{info:null==b?void 0:b.info,stateName:null==C?void 0:C.name,t:v}),R=R.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)&&"help-line"!==(null==e?void 0:e.id)}),R=[].concat(R,[{text:v("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:T}},{text:v("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:function(){N(!1),D(!0)}}},{text:n.createElement(n.Fragment,null,v("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+A},A)))),element:"Helpline",icon:"Phone"}])),null===(u=Object.keys(m))||void 0===u||null===(c=u.sort(function(e,t){return t.localeCompare(e)}))||void 0===c||c.map(function(e){var t,n,r,i,a;"digit-ui-links"===(null===(t=m[e][0])||void 0===t?void 0:t.sidebar)&&R.splice(1,0,{type:null!==(n=m[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes("digit-ui")?"link":"external-link",text:v("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:m[e],icon:null===(i=m[e][0])||void 0===i?void 0:i.leftIcon,link:null===(a=m[e][0])||void 0===a?void 0:a.sidebarURL})}),n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),n.createElement("div",{style:{display:"flex",flexDirection:"column",height:O?"calc(100vh - 56px)":"auto",zIndex:"99"}},M,n.createElement("div",{className:"drawer-desktop"},null===(s=R)||void 0===s?void 0:s.map(function(e,t){return n.createElement("div",{className:"sidebar-list "+(g===(null==e?void 0:e.link)||g===(null==e?void 0:e.sidebarURL)?"active":""),key:t},n.createElement(P,{item:e}))}))),n.createElement("div",null,_&&n.createElement($e,{onSelect:function(){Digit.UserService.logout(),D(!1)},onCancel:w,onDismiss:w}))))},rt=function(e){var t=e.info,r=e.t,i=n.useState(null),a=i[0],l=i[1];return n.useEffect(function(){try{var e=Digit.ULBService.getCurrentTenantId(),n=null==t?void 0:t.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(e,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");l(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==a]),n.createElement("div",{className:"profile-section"},n.createElement("div",{className:"imageloader imageloader-loaded"},n.createElement("img",{className:"img-responsive img-circle img-Profile",src:a||"data:image/png;base64,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",style:{objectFit:"cover",objectPosition:"center"}})),n.createElement("div",{id:"profile-name",className:"label-container name-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),n.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&n.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",t.emailId," ")),n.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")&&n.createElement(We,{t:r,mobileView:!0}))},it=function(){var e,t,r;return n.createElement("div",{className:"digit-footer",style:{marginBottom:0}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(r=t.getConfig)||void 0===r?void 0:r.call(t,"DIGIT_FOOTER"),style:{cursor:"pointer"},onClick:function(){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()}})," ")},at=function(e){var r,i,u=e.isOpen,c=e.isMobile,s=void 0!==c&&c,m=e.toggleSidebar,f=e.onLogout,v=e.isEmployee,p=void 0!==v&&v,g=e.linkData,E=e.islinkDataLoading,y=Digit.Hooks.useStore.getInitData(),h=y.data,C=y.isFetched,b=(h||{}).stateInfo,O=Digit.UserService.getUser(),S=t.useState(""),N=S[0],I=S[1],_=l.useTranslation().t,D=a.useHistory(),w=function(){Digit.clikOusideFired=!0,m(!1)},T=Digit.Hooks.useAccessControl(),L=T.isLoading,A=T.data,R=Digit.ULBService.getCitizenCurrentTenant();if(E||L||!C)return n.createElement(o.Loader,null);var M,P=(null==h||null===(r=h.tenants.filter(function(e){return e.code===R})[0])||void 0===r?void 0:r.contactNumber)||(null==h||null===(i=h.tenants[0])||void 0===i?void 0:i.contactNumber),x=[].concat(Ye(_,w,function(){D.push("/digit-ui/citizen/login"),w()},p,h,R));C&&O&&O.access_token&&(M=n.createElement(rt,{info:null==O?void 0:O.info,stateName:null==b?void 0:b.name,t:_}),x=x.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)&&"help-line"!==(null==e?void 0:e.id)}),x=[].concat(x,[{text:_("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:function(){D.push(p?"/digit-ui/employee/user/profile":"/digit-ui/citizen/user/profile"),w()}}},{text:_("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:f}},{text:n.createElement(n.Fragment,null,_("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+P},P)))),element:"Helpline",icon:"Phone"}]));var k,U,B={};return p?function(){var e;null==A||A.actions.filter(function(e){return"url"===e.url&&"Home"!==e.displayName}).forEach(function(e){var t;if(""==N&&""!==e.path){var n=e.path.split(".")[0];"TradeLicense"===n&&(n="Trade License"),B[n]?B[n].push(e):B[n]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(N.toLowerCase())){var r=e.path.split(".")[0];"TradeLicense"===r&&(r="Trade License"),B[r]?B[r].push(e):B[r]=[e]}});for(var t=Object.keys(B),n=function(e){var n,r,i,a,l,o,u,c,s,m,f,v=null===(n=B[t[e]][0])||void 0===n||null===(r=n.displayName)||void 0===r||null===(i=r.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"),p=null===(a=t[e])||void 0===a||null===(l=a.toUpperCase())||void 0===l?void 0:l.replace(/[ -]/g,"_");-1===B[t[e]][0].path.indexOf(".")?x.splice(1,0,{type:"link",text:_("ACTION_TEST_"+v),link:null===(o=B[t[e]][0])||void 0===o?void 0:o.navigationURL,icon:null===(u=B[t[e]][0])||void 0===u||null===(c=u.leftIcon)||void 0===c||null===(s=c.split)||void 0===s?void 0:s.call(c,":")[1],populators:{onClick:function(){var n;D.push(null===(n=B[t[e]][0])||void 0===n?void 0:n.navigationURL),w()}}}):x.splice(1,0,{type:"dynamic",moduleName:_("ACTION_TEST_"+p),links:null===(m=B[t[e]])||void 0===m?void 0:m.map(function(e){var t,n;return d({},e,{displayName:_("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===(f=B[t[e]][1])||void 0===f?void 0:f.leftIcon})},r=0;r<t.length;r++)n(r);var i=x.findIndex(function(e){return"HOME"===e.element}),a=x.splice(i,1),l=x.findIndex(function(e){return"LANGUAGE"===e.element}),o=x.splice(l,(null===(e=x)||void 0===e?void 0:e.length)-l);x.sort(function(e,t){return("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==a?void 0:a[0])&&x.splice(0,0,a[0]),x=(null==o?void 0:o.length)>0?x.concat(o):x}():null===(k=Object.keys(g))||void 0===k||null===(U=k.sort(function(e,t){return t.localeCompare(e)}))||void 0===U||U.map(function(e){var t,n,r,i,a;"digit-ui-links"===(null===(t=g[e][0])||void 0===t?void 0:t.sidebar)&&x.splice(1,0,{type:null!==(n=g[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes("digit-ui")?"link":"external-link",text:_("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===(a=g[e][0])||void 0===a?void 0:a.sidebarURL})}),D.location.pathname.includes("/openlink")&&(M=n.createElement("span",null),x=x.filter(function(e){return"LANGUAGE"===e.element})),s?n.createElement(o.NavBar,{open:u,toggleSidebar:m,profileItem:M,onClose:w,menuItems:x,Footer:n.createElement(it,null),isEmployee:p,search:N,setSearch:I}):n.createElement(nt,{logout:f})},lt=function(e){var r,i,c,s,d,m,f,v=e.item,p=t.useState(!1),g=p[0],E=p[1],y=a.useLocation().pathname,h=l.useTranslation().t,C={home:n.createElement(o.HomeIcon,null),announcement:n.createElement(o.ComplaintIcon,null),business:n.createElement(o.BPAHomeIcon,null),store:n.createElement(o.PropertyHouse,null),assignment:n.createElement(o.CaseIcon,null),receipt:n.createElement(o.ReceiptIcon,null),"business-center":n.createElement(o.PersonIcon,null),description:n.createElement(o.DocumentIconSolid,null),"water-tap":n.createElement(o.DropIcon,null),"collections-bookmark":n.createElement(o.CollectionsBookmarIcons,null),"insert-chart":n.createElement(o.FinanceChartIcon,null),edcr:n.createElement(o.CollectionIcon,null),collections:n.createElement(o.CollectionIcon,null)},b=C[(null==v||null===(r=v.icon)||void 0===r||null===(i=r.leftIcon)||void 0===i||null===(c=i.split)||void 0===c||null===(s=c.call(i,":"))||void 0===s?void 0:s[1])||(null==v||null===(d=v.leftIcon)||void 0===d||null===(m=d.split)||void 0===m?void 0:m.call(d,":")[1])]||C.collections,O=null==v||null===(f=v.moduleName)||void 0===f?void 0:f.replace(/[ -]/g,"_"),S=h("ACTION_TEST_"+O),N=h((null==S?void 0:S.length)>20?S.substring(0,20)+"...":S);if("single"===v.type){var I,_=window.location.origin;return n.createElement("div",{className:"submenu-container"},n.createElement("div",{className:"sidebar-link "+(y===(null==v?void 0:v.navigationURL)?"active":"")},n.createElement("div",{className:"actions"},b,-1===(null===(I=v.navigationURL)||void 0===I?void 0:I.indexOf("/digit-ui"))?n.createElement("a",{"data-tip":"React-tooltip","data-for":"jk-side-"+O,className:"custom-link",href:_+"/employee/"+v.navigationURL},n.createElement("span",null," ",N," "),(null==N?void 0:N.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+O},h("ACTION_TEST_"+O))):n.createElement(a.Link,{className:"custom-link",to:v.navigationURL},n.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+O},n.createElement("span",null," ",N," "),(null==N?void 0:N.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+O},h("ACTION_TEST_"+O)))))))}return n.createElement(n.Fragment,null,n.createElement("div",{className:"submenu-container"},n.createElement("div",{onClick:v.links&&function(){return E(!g)},className:"sidebar-link"},n.createElement("div",{className:"actions"},b,n.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+O},n.createElement("span",null," ",N," "),(null==N?void 0:N.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+O},h("ACTION_TEST_"+O)))),n.createElement("div",null," ",v.links&&g?n.createElement(o.ArrowVectorDown,null):v.links?n.createElement(o.ArrowForward,null):null," "))),g&&v.links.sort(function(e,t){return e.orderNumber-t.orderNumber}).filter(function(e){return"url"===e.url||""!==e.url}).map(function(e,t){var r,i,l=null==e||null===(r=e.displayName)||void 0===r||null===(i=r.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"),o=h("ACTION_TEST_"+l),c=h((null==o?void 0:o.length)>20?o.substring(0,20)+"...":o);if(-1===e.navigationURL.indexOf("/digit-ui")){var s=window.location.origin;return n.createElement("a",{key:t,className:"dropdown-link "+(y===e.link?"active":""),href:s+"/employee/"+e.navigationURL},n.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},n.createElement("span",null," ",c," "),(null==c?void 0:c.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},h("ACTION_TEST_"+l))))}return n.createElement(a.Link,{to:(null==e?void 0:e.link)||e.navigationURL,key:t,className:"dropdown-link "+(y===(null==e?void 0:e.link)||y===(null==e?void 0:e.navigationURL)?"active":"")},n.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},n.createElement("span",null," ",c," "),(null==c?void 0:c.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},h("ACTION_TEST_"+l))))}))},ot=function(){var e=t.useRef(null),r=Digit.Hooks.useAccessControl(),i=r.isLoading,a=r.data,u=t.useState(""),c=u[0],s=u[1],d=l.useTranslation().t;t.useEffect(function(){if(i)return n.createElement(o.Loader,null);e.current.style.cursor="pointer",m()},[i]);var m=function(){e.current.style.width="55px",e.current.style.overflow="hidden",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="none"}),e.current.querySelectorAll(".actions").forEach(function(e){e.style.padding="0"})},f={};null==a||a.actions.filter(function(e){return"url"===e.url}).forEach(function(e){var t,n,r,i=e.path.split(".")[0];(""==c&&""!==e.path||""!==e.path&&null!==(t=d("ACTION_TEST_"+(null===(n=i)||void 0===n||null===(r=n.toUpperCase())||void 0===r?void 0:r.replace(/[ -]/g,"_"))))&&void 0!==t&&t.toLowerCase().includes(c.toLowerCase()))&&("TradeLicense"===(i=e.path.split(".")[0])&&(i="Trade License"),f[i]?f[i].push(e):f[i]=[e])});var v=[];return i?n.createElement(o.Loader,null):v?n.createElement("div",{className:"sidebar",ref:e,onMouseOver:function(){e.current.style.width="260px",e.current.style.overflow="auto",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="flex"})},onMouseLeave:m},n.createElement("div",{className:"submenu-container"},n.createElement("div",{className:"sidebar-link"},n.createElement("div",{className:"actions search-icon-wrapper"},n.createElement(o.SearchIcon,{className:"search-icon"}),n.createElement("input",{className:"employee-search-input",type:"text",placeholder:d("ACTION_TEST_SEARCH"),name:"search",value:c,onChange:function(e){return s(e.target.value)}})))),function(){var e=Object.keys(f);e.sort(function(e,t){return e.orderNumber-t.orderNumber});for(var t=0;t<e.length;t++)if(-1===f[e[t]][0].path.indexOf("."))if("Home"===f[e[t]][0].displayName)v.unshift({moduleName:e[t].toUpperCase(),icon:f[e[t]][0],navigationURL:"/digit-ui/employee",type:"single"});else{var r;v.push({moduleName:null===(r=f[e[t]][0])||void 0===r?void 0:r.displayName.toUpperCase(),type:"single",icon:f[e[t]][0],navigationURL:f[e[t]][0].navigationURL})}else v.push({moduleName:e[t].toUpperCase(),links:f[e[t]],icon:f[e[t]][0],orderNumber:f[e[t]][0].orderNumber});if(v.find(function(e){return"HOME"===e.moduleName})){v.splice(0,1);var i=v.findIndex(function(e){return"HOME"===e.moduleName}),a=v.splice(i,1);v.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)}),(null==a?void 0:a[0])&&v.splice(0,0,a[0])}else v.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)});return v.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)}).map(function(e,t){return n.createElement(lt,{item:e,key:t+1})})}()):""},ut=function(e){var t=e.isSidebarOpen,r=e.toggleSidebar,i=e.handleLogout,a=e.mobileView,l=e.userDetails,o=e.modules;return e.CITIZEN?n.createElement(at,{isOpen:t,isMobile:!0,toggleSidebar:r,onLogout:i,linkData:e.linkData,islinkDataLoading:e.islinkDataLoading}):!a&&null!=l&&l.access_token?n.createElement(ot,{mobileView:a,userDetails:l,modules:o}):n.createElement(at,{isOpen:t,isMobile:!0,toggleSidebar:r,onLogout:i,isEmployee:!0})},ct=function(e){var r=e.t,i=e.stateInfo,l=e.userDetails,u=e.CITIZEN,c=e.cityDetails,s=e.mobileView,d=e.handleUserDropdownSelection,m=e.logoUrl,f=e.showSidebar,v=void 0===f||f,p=e.showLanguageChange,g=e.linkData,E=e.islinkDataLoading,y=t.useState(!1),h=y[0],C=y[1],b=a.useHistory(),O=t.useState(!1),S=O[0],N=O[1],I=function(){C(!1),N(!0)},_=function(){N(!1)},D=[{name:r("EDIT_PROFILE"),icon:n.createElement(o.EditPencilIcon,{className:"icon"}),func:function(){b.push("/digit-ui/employee/user/profile")}},{name:r("CORE_COMMON_LOGOUT"),icon:n.createElement(o.LogoutIcon,{className:"icon"}),func:I}];return n.createElement(n.Fragment,null,n.createElement(Ze,{t:r,stateInfo:i,toggleSidebar:C,isSidebarOpen:h,handleLogout:I,userDetails:l,CITIZEN:u,cityDetails:c,mobileView:s,userOptions:D,handleUserDropdownSelection:d,logoUrl:m,showLanguageChange:p}),S&&n.createElement($e,{onSelect:function(){Digit.UserService.logout(),N(!1)},onCancel:_,onDismiss:_}),v&&n.createElement(ut,{t:r,CITIZEN:u,isSidebarOpen:h,toggleSidebar:C,handleLogout:I,mobileView:s,userDetails:l,linkData:g,islinkDataLoading:E}))};function st(e){var r=e.setProfilePic,i=e.closeDrawer,a=e.userType,u=e.removeProfilePic,c=e.showToast,s=t.useState(null)[1],d=t.useState(""),m=d[0],f=d[1],v=t.useState(null)[1],p=l.useTranslation().t;return t.useEffect(function(){!function(){try{v(null);var e=function(){if(m){var e=function(){if(m.size>=1e6)c("error",p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),v(p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{var e=I(function(){return Promise.resolve(Digit.UploadServices.Filestorage(a+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var t,n;if((null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var i,a,l=null==e||null===(i=e.data)||void 0===i||null===(a=i.files[0])||void 0===a?void 0:a.fileStoreId;s(l),r(l)}else c("error",p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),v(p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",p("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]),n.createElement(n.Fragment,null,n.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:function(){return i()}}),n.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===a?"2.5rem":"0",zIndex:"2"}},n.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},n.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",n.createElement(o.GalleryIcon,null)),n.createElement("label",{style:{cursor:"pointer"}}," Gallery"),n.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:function(e){return f(e.target.files[0])},style:{display:"none"}})),n.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},n.createElement("button",{onClick:function(){u(),i()}},n.createElement(o.RemoveIcon,null)),n.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}var dt=function(e){var r,i,u,c,s,m,f,v,p,g,E=e.stateCode,y=e.userType,h=e.cityDetails,C=(a.useHistory(),l.useTranslation().t),b=window.location.href,O=Digit.ULBService.getStateId(),S=Digit.ULBService.getCurrentTenantId(),N=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},_=t.useState(null),D=_[0],w=_[1],T=t.useState(null!=N&&N.name?N.name:""),L=T[0],A=T[1],R=t.useState(null!=N&&N.emailId?N.emailId:""),M=R[0],P=R[1],x=t.useState(null==D?void 0:D.gender),k=x[0],U=x[1],B=t.useState(null!=N&&N.permanentCity?N.permanentCity:h.name),F=B[0],j=B[1],V=t.useState(null!=N&&N.mobileNumber?N.mobileNumber:""),H=V[0],G=V[1],z=t.useState(null),W=z[0],q=z[1],X=t.useState(""),Z=X[0],Y=X[1],K=t.useState(!1),J=K[0],Q=K[1],$=t.useState(!1),ee=$[0],te=$[1],ne=t.useState(""),re=ne[0],ie=ne[1],ae=t.useState(""),le=ae[0],oe=ae[1],ue=t.useState(""),ce=ue[0],se=ue[1],de=t.useState(null),me=de[0],fe=de[1],ve=t.useState(!1),pe=ve[0],ge=ve[1],Ee=n.useState(window.innerWidth),ye=Ee[0],he=Ee[1],Ce=n.useState({}),be=Ce[0],Oe=Ce[1],Se=window.Digit.Utils.browser.isMobile();n.useEffect(function(){return window.addEventListener("resize",function(){return he(window.innerWidth)}),function(){window.removeEventListener("resize",function(){return he(window.innerWidth)})}}),t.useEffect(function(){var e;ge(!0),function(){try{var e=null==N?void 0:N.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(S,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&w(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),U({i18nKey:void 0,code:null==D?void 0:D.gender,value:null==D?void 0:D.gender});var t=null==D||null===(e=D.photo)||void 0===e?void 0:e.split(",");Y(null==t?void 0:t.at(0)),ge(!1)},[null!==D]);var Ne=function(e){return U(e)},Ie=function(){return Q(!1)},_e=function(e){A(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?Oe(d({},be,{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):Oe(d({},be,{userName:null}))},De=function(e){P(e),!e.length||e.includes("@")&&e.includes(".")?Oe(d({},be,{emailAddress:null})):Oe(d({},be,{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))},we=function(e,t,n){void 0===n&&(n=5e3),fe({key:e,action:t}),setTimeout(function(){fe(null)},n)},Te=function(){try{var e=function(e){if(t)return e;ge(!1)},t=!1;ge(!0);var n=I(function(){var e=d({},N,{name:L,gender:null==k?void 0:k.value,emailId:M,photo:W});if(!new RegExp(/^([a-zA-Z ])*$/).test(L)||""===L||L.length>50||L.length<1)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_NAME_INVALID"});if("employee"===y&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(H))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"});if(M.length&&(!M.includes("@")||!M.includes(".")))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"});if(re.length||le.length||ce.length){if(le!==ce)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_MISMATCH"});if(!(re.length&&le.length&&ce.length))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(le)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(ce))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"})}return e.locale=Digit.StoreData.getCurrentLanguage(),Promise.resolve(Digit.UserService.updateUser(e,E)).then(function(e){var t=e.responseInfo;if(t&&"200"===t.status){var n=Digit.UserService.getUser();n&&Digit.UserService.setUser(d({},n,{info:d({},n.info,{name:L,mobileNumber:H,emailId:M,permanentCity:F})}))}return function(){if(re.length&&le.length&&ce.length){var e={existingPassword:re,newPassword:le,tenantId:S,type:"EMPLOYEE",username:null==N?void 0:N.userName,confirmPassword:ce};return function(){if(le===ce)return I(function(){return Promise.resolve(Digit.UserService.changePassword(e,S)).then(function(e){var t=e.responseInfo;if(null==t||!t.status||"200"!==t.status)throw"";we("success",C("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3)})},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"})}()}null!=t&&t.status&&"200"===t.status&&we("success",C("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){var t=JSON.parse(e);we(t.type,C(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}},Le=[],Ae=Digit.Hooks.pt.useGenderMDMS(O,"common-masters","GenderType").data;return Ae&&Ae.map(function(e){Le.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),pe?n.createElement(o.Loader,null):n.createElement("div",{className:"user-profile"},n.createElement("section",{style:{margin:"citizen"===y?"8px":"24px"}},"citizen"===y?n.createElement(o.BackButton,null):n.createElement(o.BreadCrumb,{crumbs:[{path:"/digit-ui/employee",content:C("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/user/profile",content:C("ES_COMMON_PAGE_1"),show:b.includes("/user/profile")}]})),n.createElement("div",{style:{display:"flex",flex:1,flexDirection:ye<768||"citizen"===y?"column":"row",margin:"citizen"===y?"8px":"16px",gap:"citizen"===y?"":"0 24px",boxShadow:"citizen"===y?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===y?"white":"",borderRadius:"citizen"===y?"4px":"",maxWidth:"citizen"===y?"960px":""}},n.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===y?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",height:"376px",borderRadius:"4px",boxShadow:"citizen"===y?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===y?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===y?"8px":"16px"}},n.createElement("div",{style:{position:"relative",height:"citizen"===y?"114px":"150px",width:"citizen"===y?"114px":"150px",margin:"16px"}},n.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:Z&&""!==Z?Z:"data:image/png;base64,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"}),n.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:function(){return Q(!J)}},n.createElement(o.CameraIcon,null)))),n.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===y?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===y?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===y?"8px":"24px",paddingBottom:"20px"}},"citizen"===y?n.createElement(n.Fragment,null,n.createElement(o.LabelFieldPair,null,n.createElement(o.CardLabel,{style:{}},""+C("CORE_COMMON_PROFILE_NAME"),"*"),n.createElement("div",{style:{width:"100%",maxWidth:"960px"}},n.createElement(o.TextInput,d({t:C,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:L,onChange:function(e){return _e(e.target.value)}},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:C("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==be?void 0:be.userName)&&n.createElement(o.CardLabelError,null," ",null==be||null===(i=be.userName)||void 0===i?void 0:i.message," "))),n.createElement(o.LabelFieldPair,null,n.createElement(o.CardLabel,{style:{}},""+C("CORE_COMMON_PROFILE_GENDER")),n.createElement(o.Dropdown,{style:{width:"100%"},className:"form-field",selected:1===(null==k?void 0:k.length)?k[0]:k,disable:1===(null==k?void 0:k.length)||!1,option:Le,select:Ne,value:k,optionKey:"code",t:C,name:"gender"})),n.createElement(o.LabelFieldPair,null,n.createElement(o.CardLabel,{style:{}},""+C("CORE_COMMON_PROFILE_EMAIL")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:M,onChange:function(e){return De(e.target.value)},disable:!1}),(null==be?void 0:be.emailAddress)&&n.createElement(o.CardLabelError,null," ",null==be||null===(u=be.emailAddress)||void 0===u?void 0:u.message," "))),n.createElement("button",{onClick:Te,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:Se?"100%":"240px",borderBottom:"1px solid black"}},C("CORE_COMMON_SAVE"))):n.createElement(n.Fragment,null,n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_NAME"),"*"),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,d({t:C,type:"text",isMandatory:!1,name:"name",value:L,onChange:function(e){return _e(e.target.value)},placeholder:"Enter Your Name"},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:C("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==be?void 0:be.userName)&&n.createElement(o.CardLabelError,{style:{margin:0,padding:0}}," ",null==be||null===(c=be.userName)||void 0===c?void 0:c.message," "))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_GENDER")),n.createElement(o.Dropdown,{style:{width:"100%"},selected:1===(null==k?void 0:k.length)?k[0]:k,disable:1===(null==k?void 0:k.length)||!1,option:Le,select:Ne,value:k,optionKey:"code",t:C,name:"gender"})),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CITY")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,d({t:C,type:"text",isMandatory:!1,name:"city",value:C(F),onChange:function(e){return j(e.target.value)},placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:C("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disable:!0})),n.createElement(o.CardLabelError,null))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},C("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),n.createElement("div",{style:{width:"100%"}},n.createElement(o.MobileNumber,{value:H,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:function(e){return function(e){G(e),"employee"!==y||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?Oe(d({},be,{mobileNumber:null})):Oe(d({},be,{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))}(e)},disable:!0,required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:C("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==be?void 0:be.mobileNumber)&&n.createElement(o.CardLabelError,{style:{margin:0,padding:0}}," ",null==be||null===(s=be.mobileNumber)||void 0===s?void 0:s.message," "))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_EMAIL")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"email",isMandatory:!1,placeholder:"Enter a valid Email",optionKey:"i18nKey",name:"email",value:M,onChange:function(e){return De(e.target.value)},disable:!1}),(null==be?void 0:be.emailAddress)&&n.createElement(o.CardLabelError,null," ",null==be||null===(m=be.emailAddress)||void 0===m?void 0:m.message," "))),n.createElement(o.LabelFieldPair,null,n.createElement("div",null,n.createElement("a",{style:(f={color:"orange",cursor:"default",marginBottom:"5"},f.cursor="pointer",f),onClick:function(){return te(!ee)}},C("CORE_COMMON_CHANGE_PASSWORD")),ee?n.createElement("div",{style:{marginTop:"10px"}},n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return ie(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Oe(d({},be,{currentPassword:null})):Oe(d({},be,{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==be?void 0:be.currentPassword)&&n.createElement(o.CardLabelError,null,null==be||null===(v=be.currentPassword)||void 0===v?void 0:v.message))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_NEW_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return oe(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Oe(d({},be,{newPassword:null})):Oe(d({},be,{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==be?void 0:be.newPassword)&&n.createElement(o.CardLabelError,null,null==be||null===(p=be.newPassword)||void 0===p?void 0:p.message))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return se(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Oe(d({},be,{confirmPassword:null})):Oe(d({},be,{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==be?void 0:be.confirmPassword)&&n.createElement(o.CardLabelError,null,null==be||null===(g=be.confirmPassword)||void 0===g?void 0:g.message)))):""))))),"employee"===y?n.createElement("div",{style:{height:"88px",backgroundColor:"#FFFFFF",display:"flex",justifyContent:"flex-end",marginTop:"64px",alignItems:"center"}},n.createElement("button",{onClick:Te,style:{marginTop:"24px",backgroundColor:"#F47738",width:ye<768?"100%":"248px",height:"40px",float:"right",margin:ye<768?"0 16px":"",marginRight:ye<768?"16px":"31px",color:"white",borderBottom:"1px solid black"}},C("CORE_COMMON_SAVE"))):"",me&&n.createElement(o.Toast,{error:"error"===me.key,label:C("success"===me.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":me.action),onClose:function(){return fe(null)},style:{maxWidth:"670px"}}),1==J?n.createElement(st,{setProfilePic:function(e){try{var t=function(e){Y(null==e?void 0:e.thumbs[0]),Ie()};return q(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(function(e){return e.url.split(",")[3]}),images:e.data.fileStoreIds.map(function(e){return Digit.Utils.getFileUrl(e.url)})}:null})}catch(e){return Promise.reject(e)}}([e],O)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:Ie,userType:y,removeProfilePic:function(){q(null),Y(null)},showToast:we}):"")},mt=["user/profile","user/error"],ft=function(e){var r,i,o,u,c=e.stateInfo,s=e.userDetails,d=e.CITIZEN,m=e.cityDetails,f=e.mobileView,v=e.handleUserDropdownSelection,p=e.logoUrl,g=e.DSO,E=e.stateCode,y=e.modules,h=e.appTenants,C=e.initData,b=a.useHistory(),O=l.useTranslation().t,S=a.useRouteMatch().path,N=a.useLocation(),I=null==N||null===(r=N.pathname)||void 0===r?void 0:r.includes("language-selection"),_=mt.some(function(e){var t;return null==N||null===(t=N.pathname)||void 0===t?void 0:t.includes(e)});return t.useEffect(function(){Digit.UserService.setType("employee")},[]),n.createElement("div",{className:"employee"},n.createElement(a.Switch,null,n.createElement(a.Route,{path:S+"/user"},_&&n.createElement(ct,{t:O,stateInfo:c,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,showSidebar:!!_,showLanguageChange:!I}),n.createElement("div",{className:_?"grounded-container":"loginContainer",style:_?{padding:0,paddingTop:"80px",marginLeft:f?"":"64px"}:{"--banner-url":"url("+(null==c?void 0:c.bannerUrl)+")",padding:"0px"}},n.createElement(a.Switch,null,n.createElement(a.Route,{path:S+"/user/login"},n.createElement(Le,null)),n.createElement(a.Route,{path:S+"/user/forgot-password"},n.createElement(ke,null)),n.createElement(a.Route,{path:S+"/user/change-password"},n.createElement(Me,null)),n.createElement(a.Route,{path:S+"/user/profile"},n.createElement(dt,{stateCode:E,userType:"employee",cityDetails:m})),n.createElement(a.Route,{path:S+"/user/error"},n.createElement(Ve,{initData:C,goToHome:function(){b.push("/digit-ui/employee")}})),n.createElement(a.Route,{path:S+"/user/language-selection"},n.createElement(Ue,null)),n.createElement(a.Route,null,n.createElement(a.Redirect,{to:S+"/user/language-selection"}))))),n.createElement(a.Route,null,n.createElement(ct,{t:O,stateInfo:c,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,modules:y}),n.createElement("div",{className:"main "+(g?"m-auto":"")},n.createElement("div",{className:"employee-app-wrapper"},n.createElement(Ge,{initData:C},n.createElement(Fe,{stateCode:E,userType:"employee",modules:y,appTenants:h}))),n.createElement("div",{className:"employee-home-footer"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(o=i.globalConfigs)||void 0===o||null===(u=o.getConfig)||void 0===u?void 0:u.call(o,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:function(){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.createElement(a.Route,null,n.createElement(a.Redirect,{to:S+"/user/language-selection"}))))},vt=function(){var e,t,r,i,u,c,s,m,f,v,p,g,E,y,h,C,b,O,S,N=l.useTranslation().t,I=a.useHistory(),_=Digit.ULBService.getCitizenCurrentTenant(!0),D=Digit.Hooks.useStore.getInitData(),w=D.data,T=(w=void 0===w?{}:w).uiHomePage,L=D.isLoading,A=window.Digit.Utils.browser.isMobile(),R=function(){var e,t,n,r,i;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===(r=Digit.UserService)||void 0===r||null===(i=r.getUser())||void 0===i||!i.access_token)},M=Digit.Hooks.useEvents({tenantId:_,variant:"whats-new",config:{enabled:R()}}),P=M.data,x=M.isLoading;_||(null===Digit.SessionStorage.get("locale")?I.push("/digit-ui/citizen/select-language"):I.push("/digit-ui/citizen/select-location"));var k=null==T?void 0:T.appBannerDesktop,U=null==T?void 0:T.appBannerMobile,B=null==T?void 0:T.citizenServicesCard,F=null==T?void 0:T.informationAndUpdatesCard,j=null==T?void 0:T.whatsAppBannerDesktop,V=null==T?void 0:T.whatsAppBannerMobile,H=null==T?void 0:T.whatsNewSection,G=function(e){window.open(null==e?void 0:e.navigationUrl)},z={header:N(null==B?void 0:B.headerLabel),sideOption:{name:N(null==B||null===(e=B.sideOption)||void 0===e?void 0:e.name),onClick:function(){var e;return I.push(null==B||null===(e=B.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:N(null==B||null===(t=B.props)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),Icon:n.createElement(o.ComplaintIcon,null),onClick:function(){var e,t;return I.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==B||null===(i=B.props)||void 0===i||null===(u=i[1])||void 0===u?void 0:u.label),Icon:n.createElement(o.PTIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return I.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==B||null===(c=B.props)||void 0===c||null===(s=c[2])||void 0===s?void 0:s.label),Icon:n.createElement(o.CaseIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return I.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==B||null===(m=B.props)||void 0===m||null===(f=m[3])||void 0===f?void 0:f.label),Icon:n.createElement(o.WSICon,null),onClick:function(){var e,t;return I.push(null==B||null===(e=B.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%"}},W={header:N(null==F?void 0:F.headerLabel),sideOption:{name:N(null==F||null===(v=F.sideOption)||void 0===v?void 0:v.name),onClick:function(){var e;return I.push(null==F||null===(e=F.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:N(null==F||null===(p=F.props)||void 0===p||null===(g=p[0])||void 0===g?void 0:g.label),Icon:n.createElement(o.HomeIcon,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==F||null===(E=F.props)||void 0===E||null===(y=E[1])||void 0===y?void 0:y.label),Icon:n.createElement(o.Calender,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==F||null===(h=F.props)||void 0===h||null===(C=h[2])||void 0===C?void 0:C.label),Icon:n.createElement(o.DocumentIcon,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==F||null===(b=F.props)||void 0===b||null===(O=b[3])||void 0===O?void 0:O.label),Icon:n.createElement(o.DocumentIcon,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.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 L?n.createElement(o.Loader,null):n.createElement("div",{className:"HomePageContainer"},n.createElement("div",{className:"HomePageWrapper"},n.createElement("div",{className:"BannerWithSearch"},n.createElement("img",A?{src:null==U?void 0:U.bannerUrl}:{src:null==k?void 0:k.bannerUrl}),n.createElement("div",{className:"ServicesSection"},n.createElement(o.CardBasedOptions,d({style:{marginTop:"-30px"}},z)),n.createElement(o.CardBasedOptions,d({style:A?{}:{marginTop:"-30px"}},W)))),(V||j)&&n.createElement("div",{className:"WhatsAppBanner"},n.createElement("img",A?{src:null==V?void 0:V.bannerUrl,onClick:function(){return G(V)}}:{src:null==j?void 0:j.bannerUrl,onClick:function(){return G(j)}})),R()?x?n.createElement(o.Loader,null):n.createElement("div",{className:"WhatsNewSection"},n.createElement("div",{className:"headSection"},n.createElement("h2",null,N(null==H?void 0:H.headerLabel)),n.createElement("p",{onClick:function(){var e;return I.push(null==H||null===(e=H.sideOption)||void 0===e?void 0:e.navigationUrl)}},N(null==H||null===(S=H.sideOption)||void 0===S?void 0:S.name))),n.createElement(o.WhatsNewCard,null==P?void 0:P[0])):null))},pt=function(){var e=l.useTranslation().t,r=a.useHistory(),i=Digit.Hooks.useStore.getInitData(),u=i.data,c=(u=void 0===u?{}:u).languages,s=u.stateInfo,d=i.isLoading,m=Digit.StoreData.getCurrentLanguage(),f=t.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]),v=t.useMemo(function(){return{options:c,optionsKey:"label",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:function(e){return Digit.LocalizationService.changeLanguage(e.value,s.code)},selectedOption:null==c?void 0:c.filter(function(e){return e.value===m})[0]}},[m,c]);return d?n.createElement(o.Loader,null):n.createElement("div",{className:"selection-card-wrapper"},n.createElement(o.PageBasedInput,{texts:f,onSubmit:function(){r.push("/digit-ui/citizen/select-location")}},n.createElement(o.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),n.createElement(o.RadioButtons,v)))},gt=function(){var e=l.useTranslation().t,r=a.useHistory(),i=a.useLocation(),u=Digit.Hooks.useTenants(),c=u.data,s=u.isLoading,m=t.useState(function(){return{code:Digit.ULBService.getCitizenCurrentTenant(!0)}}),f=m[0],v=m[1],p=t.useState(!1),g=p[0],E=p[1],y=t.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]);function h(e){v(e),E(!1)}var C=t.useMemo(function(){return{options:c,optionsKey:"i18nKey",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:h,selectedOption:f}},[c,e,f]);return s?n.createElement("loader",null):n.createElement("div",{className:"selection-card-wrapper"},n.createElement(o.BackButton,null),n.createElement(o.PageBasedInput,{texts:y,onSubmit:function(){if(f){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",f);var t=null===(e=i.state)||void 0===e?void 0:e.redirectBackTo;t?r.replace(t):r.push("/digit-ui/citizen")}else E(!0)},className:"location-selection-container"},n.createElement(o.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),n.createElement(o.SearchOnRadioButtons,d({},C,{placeholder:e("COMMON_TABLE_SEARCH")})),g?n.createElement(o.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},Et=function(e){var r=e.question,i=e.answer,a=e.subAnswer,u=e.lastIndex,c=t.useState(!1),s=c[0],d=c[1],m=l.useTranslation().t;return n.createElement("div",{className:"faqs border-none",onClick:function(){return d(!s)}},n.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:Digit.Utils.browser.isMobile()&&m(r).length>42&&s?"block":"flex"}},n.createElement("span",null,m(r)),n.createElement("span",{className:s?"faqicon rotate":"faqicon",style:{float:"right"}},n.createElement(o.ArrowForward,null))),n.createElement("div",{className:"faq-answer",style:s?{display:"block"}:{display:"none"}},n.createElement("span",null,m(i)+m(a))),u?null:n.createElement("div",{className:"cs-box-border"}))},yt=function(e){var r,i,a,u=e.module,c=Digit.UserService.getUser(),s=((null==c||null===(r=c.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation().t),d=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),m=d.data,f=null==m||null===(i=m.MdmsRes["common-masters"])||void 0===i||null===(a=i.faqs[0])||void 0===a?void 0:a[""+u].faqs;return d.isLoading?n.createElement(o.Loader,null):n.createElement(t.Fragment,null,n.createElement("div",{className:"faq-page"},n.createElement(o.BackButton,{style:{marginLeft:"unset"}}),n.createElement("div",{style:{marginBottom:"15px"}},n.createElement(o.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},s("FAQ_S"))),n.createElement("div",{className:"faq-list"},f.map(function(e,t){return n.createElement(Et,{key:"faq_"+t,question:e.question,answer:e.answer,subAnswer:e.subAnswer?e.subAnswer:"",lastIndex:t===(null==f?void 0:f.length)-1})}))))},ht=function(e){var r,i,a,u=e.module,c=window.Digit.Utils.browser.isMobile(),s=Digit.UserService.getUser(),d=((null==s||null===(r=s.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation().t),m=Digit.SessionStorage.get("initData").stateInfo,f=Digit.StoreData.getCurrentLanguage(),v=t.useState(f),p=v[0],g=v[1],E=t.useState(!1),y=E[0],h=E[1],C=t.useState(""),b=C[0],O=C[1],S=function(){return n.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.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"}))},N=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),I=N.data,_=null==I||null===(i=I.MdmsRes["common-masters"])||void 0===i||null===(a=i.howItWorks[0])||void 0===a?void 0:a[""+u];return N.isLoading?n.createElement(o.Loader,null):n.createElement(t.Fragment,null,n.createElement("div",{className:"how-it-works-page"},n.createElement("div",{style:{marginLeft:"-10px"}},n.createElement(o.BackButton,null)),n.createElement("div",{className:"how-it-works-page-header"},n.createElement("div",{style:{marginLeft:c?"-15px":""}},n.createElement(o.Header,null,d("HOW_IT_WORKS")))),n.createElement("div",{className:"language-selector",style:{marginBottom:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(o.CustomButton,{selected:e.value===p,text:e.label,onClick:function(){return function(e){g(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)}(e)}}))})),_.videosJson.map(function(e,t){return n.createElement("div",null,n.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},n.createElement("div",{className:"video-icon",onClick:function(){return t=e,O("hi_IN"===p?t.hi_IN:t.en_IN),void h(!0);var t}},n.createElement("div",{className:"vid-svg"},n.createElement(S,null))),n.createElement("div",{className:"how-it-works-header-description"},n.createElement("h2",null,d(e.headerLabel)),n.createElement("p",null,d(e.description)))))}),n.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},n.createElement("div",{className:"how-it-works-pdf-section"},n.createElement("div",{className:"pdf-icon-header-desc"},n.createElement("div",{className:"pdf-icon"},n.createElement(o.PDFSvg,null)),n.createElement("div",{className:"pdf-header-desc"},n.createElement("h2",null,d(_.pdfHeader)),n.createElement("p",null,d(_.pdfDesc)))),n.createElement("div",{className:"download-icon"},n.createElement(o.DownloadImgIcon,null)))),y&&n.createElement("div",{className:"how-it-works-video-play"},n.createElement("div",{className:"close-button",style:{position:"absolute",right:"0",top:"10%",zIndex:"1"}},n.createElement(o.CloseSvg,{onClick:function(){h(!1)}})),n.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0,style:{position:"fixed",top:"0",left:"0",minWidth:"100%",minHeight:"100%",backgroundColor:"rgba(0,0,0,0.5)"}},n.createElement("source",{src:b,type:"video/mp4"})))))},Ct=function(e){var t,r,i,a,u,c,s,d,m,f,v,p,g,E,y,h,C=e.moduleCode,b=l.useTranslation().t,O=Digit.ULBService.getCitizenCurrentTenant(),S=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),N=S.isLoading,I=S.data,_=Digit.Hooks.useDynamicData({moduleCode:C,tenantId:O,filters:{},t:b}),D=_.error,w=_.data,T=function(e){var t=e.styles;switch(e.module){case"TL":return n.createElement(o.CaseIcon,{className:"fill-path-primary-main",styles:t});case"PT":return n.createElement(o.PTIcon,{className:"fill-path-primary-main",styles:t});case"MCOLLECT":return n.createElement(o.MCollectIcon,{className:"fill-path-primary-main",styles:t});case"PGR":return n.createElement(o.PTIcon,{className:"fill-path-primary-main",styles:t});case"WS":return n.createElement(o.WSICon,{className:"fill-path-primary-main",styles:t});case"OBPS":return n.createElement(o.BPAHomeIcon,{className:"fill-path-primary-main",styles:t});default:return n.createElement(o.CaseIcon,{className:"fill-path-primary-main",styles:t})}},L=null==I||null===(t=I.MdmsRes["common-masters"])||void 0===t||null===(r=t.StaticData[0])||void 0===r?void 0:r[""+C],A=function(e){switch(e.module){case"PT":case"WS":return n.createElement("span",{className:"timerIcon"},n.createElement(o.TimerIcon,null));default:return null}},R=function(e){switch(e.module){case"PT":return n.createElement("span",{className:"rupeeSymbol"},n.createElement(o.RupeeSymbol,null));case"WS":return n.createElement("span",{className:"timerIcon"},n.createElement(o.TimerIcon,null));default:return null}},M=function(e){switch(e){case"TL":return{staticCommonContent:b("TL_VALIDITY")};case"MCOLLECT":return{staticCommonContent:b("CHALLAN_VALIDITY")};case"PGR":return{staticCommonContent:b("CATEGORIES_OF_COMPLAINT_TYPES_CAN_BE_SUBMITTED_ON_GRIEVANCE_PORTAL")};case"OBPS":return{staticCommonContent:b("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==L?void 0:L.validity)+" "+b("1"===(null==L?void 0:L.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},P=function(e){switch(e){case"PT":return{staticDataOne:(null==L?void 0:L.staticDataOne)+" "+b("COMMON_DAYS"),staticDataOneHeader:b("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==L?void 0:L.staticDataTwo,staticDataTwoHeader:b("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:b("PAY_WATER_CHARGES_BY")+" "+(null==L?void 0:L.staticDataOne)+" "+b("COMMON_DAYS")+" "+b("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==L?void 0:L.staticDataTwo)+" "+b("COMMON_DAYS"),staticDataTwoHeader:b("APPLICATION_PROCESSING_TIME")};default:return{}}};return N||_.isLoading?n.createElement(o.Loader,null):L?n.createElement(n.Fragment,null,L&&null!=L&&L.payViaWhatsApp?n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"pay-whatsapp-card",onClick:function(){window.open(null==L?void 0:L.payViaWhatsApp)}},n.createElement("div",{className:"pay-whatsapp-text"},b("PAY_VIA_WHATSAPP")),n.createElement("div",{className:"whatsAppIconG"},n.createElement(o.WhatsappIconGreen,null)))):null,L&&null!=L&&L.helpline?n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"static-home-Card"},n.createElement("div",{className:"static-home-Card-header"},b("CALL_CENTER_HELPLINE")),n.createElement("div",{className:"helplineIcon"},n.createElement(o.HelpLineIcon,null))),n.createElement("div",{className:"call-center-card-text"},null!=L&&null!==(i=L.helpline)&&void 0!==i&&i.contactOne?n.createElement("div",{className:"call-center-card-content"},n.createElement("a",{href:"tel:"+(null==L||null===(a=L.helpline)||void 0===a?void 0:a.contactOne)},null==L||null===(u=L.helpline)||void 0===u?void 0:u.contactOne)):null,null!=L&&null!==(c=L.helpline)&&void 0!==c&&c.contactTwo?n.createElement("div",{className:"call-center-card-content"},n.createElement("a",{href:"tel:"+(null==L||null===(s=L.helpline)||void 0===s?void 0:s.contactTwo)},null==L||null===(d=L.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,L&&null!=L&&L.serviceCenter?n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"static-home-Card"},n.createElement("div",{className:"static-home-Card-header"},b("CITIZEN_SERVICE_CENTER")),n.createElement("div",{className:"serviceCentrIcon"},n.createElement(o.ServiceCenterIcon,null))),n.createElement("div",{className:"service-center-details-card"},n.createElement("div",{className:"service-center-details-text"},null==L?void 0:L.serviceCenter)),null!=L&&L.viewMapLocation?n.createElement("div",{className:"link"},n.createElement("a",{href:null==L?void 0:L.viewMapLocation},b("VIEW_ON_MAP"))):null):n.createElement("div",null),n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},D||null==w||null===(null==w?void 0:w.dynamicDataOne)?n.createElement("div",null):n.createElement("div",{className:"dynamicDataCard"},n.createElement("div",{className:"dynamicData"},n.createElement("span",{style:{paddingTop:"2px"}},n.createElement(T,{module:C,styles:{width:"18px",height:"24px"}})),n.createElement("span",{className:"dynamicData-content"},null==w?void 0:w.dynamicDataOne))),D||null==w||null===(null==w?void 0:w.dynamicDataTwo)?n.createElement("div",null):n.createElement("div",{className:"dynamicDataCard"},n.createElement("div",{className:"dynamicData"},n.createElement("span",{style:{paddingTop:"2px"}},n.createElement(T,{module:C,styles:{width:"18px",height:"24px"}})),n.createElement("span",{className:"dynamicData-content"},null==w?void 0:w.dynamicDataTwo))),L&&null!=L&&L.staticDataOne?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement(A,{module:C}),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=P(C))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(f=P(C))||void 0===f?void 0:f.staticDataOneHeader),n.createElement("span",{className:"static-data-content-second"},""+(null===(v=P(C))||void 0===v?void 0:v.staticDataOne))))):n.createElement("div",null),L&&null!=L&&L.staticDataTwo?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement(R,{module:C}),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(p=P(C))||void 0===p?void 0:p.staticDataTwoHeader),n.createElement("span",{className:"static-data-content-second"},null===(g=P(C))||void 0===g?void 0:g.staticDataTwo)))):n.createElement("div",null),L&&null!=L&&L.validity?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement("span",{className:"validityIcon"},n.createElement(o.ValidityTimeIcon,null)),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(E=M(C))||void 0===E?void 0:E.staticCommonContent),n.createElement("span",{className:"static-data-content-second"},null===(y=M(C))||void 0===y?void 0:y.validity)))):n.createElement("div",null),D||null==w||null==w||!w.staticData||null===(null==w?void 0:w.staticData)?n.createElement("div",null):n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},"PGR"===C?n.createElement("span",{style:{paddingTop:"15px"}},n.createElement(o.TimerIcon,{module:C,styles:{width:"18px",height:"24px",marginLeft:"13px"}})):n.createElement("span",{className:"validityIcon"},n.createElement(o.ValidityTimeIcon,null)),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(h=M(C))||void 0===h?void 0:h.staticCommonContent),n.createElement("span",{className:"static-data-content-second"},null==w?void 0:w.staticData)))))):n.createElement(n.Fragment,null)},bt=function(e){return e instanceof HTMLElement},Ot=function(e){return null==e},St=function(e){return"object"==typeof e},Nt=function(e){return!Ot(e)&&!Array.isArray(e)&&St(e)&&!(e instanceof Date)},It=function(e){return/^\w*$/.test(e)},_t=function(e){return e.filter(Boolean)},Dt=function(e){return _t(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function wt(e,t,n){for(var r=-1,i=It(t)?[t]:Dt(t),a=i.length,l=a-1;++r<a;){var o=i[r],u=n;if(r!==l){var c=e[o];u=Nt(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}e[o]=u,e=e[o]}return e}var Tt=function(e,t){for(var n in void 0===t&&(t={}),e)It(n)?t[n]=e[n]:wt(t,n,e[n]);return t},Lt=function(e){return void 0===e},At=function(e,t,n){void 0===e&&(e={});var r=_t(t.split(/[,[\].]+?/)).reduce(function(e,t){return Ot(e)?e:e[t]},e);return Lt(r)||r===e?Lt(e[t])?n:e[t]:r},Rt=function(e,t){bt(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))},Mt={isValid:!1,value:null},Pt=function(e){return Array.isArray(e)?e.reduce(function(e,t){return t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e},Mt):Mt},xt=function(e){return"radio"===e.type},kt=function(e){return"file"===e.type},Ut=function(e){return"checkbox"===e.type},Bt=function(e){return"select-multiple"===e.type},Ft={value:!1,isValid:!1},jt={value:!0,isValid:!0},Vt=function(e){if(Array.isArray(e)){if(e.length>1){var t=e.filter(function(e){return e&&e.ref.checked}).map(function(e){return e.ref.value});return{value:t,isValid:!!t.length}}var n=e[0].ref,r=n.value,i=n.attributes;return n.checked?i&&!Lt(i.value)?Lt(r)||""===r?jt:{value:r,isValid:!0}:jt:Ft}return Ft};function Ht(e,t,n,r,i){var a=e.current[t];if(a){var l=a.ref,o=l.value,u=a.ref,c=a.valueAsNumber,s=a.valueAsDate,d=a.setValueAs;if(l.disabled&&r)return;return kt(u)?u.files:xt(u)?Pt(a.options).value:Bt(u)?[].concat(u.options).filter(function(e){return e.selected}).map(function(e){return e.value}):Ut(u)?Vt(a.options).value:i?o:c?""===o?NaN:+o:s?u.valueAsDate:d?d(o):o}if(n)return At(n.current,t)}function Gt(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Gt(e.parentNode)}var zt=function(e){return Nt(e)&&!Object.keys(e).length},Wt=function(e){return"boolean"==typeof e};function qt(e,t){var n,r=It(t)?[t]:Dt(t),i=1==r.length?e:function(e,t){for(var n=t.slice(0,-1).length,r=0;r<n;)e=Lt(e)?r++:e[t[r++]];return e}(e,r);i&&delete i[r[r.length-1]];for(var a=0;a<r.slice(0,-1).length;a++){var l=-1,o=void 0,u=r.slice(0,-(a+1)),c=u.length-1;for(a>0&&(n=e);++l<u.length;){var s=u[l];o=o?o[s]:e[s],c===l&&(Nt(o)&&zt(o)||Array.isArray(o)&&!o.filter(function(e){return Nt(e)&&!zt(e)||Wt(e)}).length)&&(n?delete n[s]:delete e[s]),n=o}}return e}var Xt=function(e,t){return e&&e.ref===t},Zt=function(e){return Ot(e)||!St(e)};function Yt(e,t){if(Zt(e)||Zt(t))return t;for(var n in t){var r=e[n],i=t[n];try{e[n]=Nt(r)&&Nt(i)||Array.isArray(r)&&Array.isArray(i)?Yt(r,i):i}catch(e){}}return e}function Kt(e,n,r){if(Zt(e)||Zt(n)||e instanceof Date||n instanceof Date)return e===n;if(!t.isValidElement(e)){var i=Object.keys(e),a=Object.keys(n);if(i.length!==a.length)return!1;for(var l=0,o=i;l<o.length;l++){var u=o[l],c=e[u];if(!r||"ref"!==u){var s=n[u];if((Nt(c)||Array.isArray(c))&&(Nt(s)||Array.isArray(s))?!Kt(c,s,r):c!==s)return!1}}}return!0}function Jt(e,t,n,r,i){for(var a=-1;++a<e.length;){for(var l in e[a]){var o;Array.isArray(e[a][l])?(!n[a]&&(n[a]={}),n[a][l]=[],Jt(e[a][l],At(t[a]||{},l,[]),n[a][l],n[a],l)):Kt(At(t[a]||{},l),e[a][l])?wt(n[a]||{},l):n[a]=Object.assign(Object.assign({},n[a]),((o={})[l]=!0,o))}r&&!n.length&&delete r[i]}return n}var Qt=function(e){return"string"==typeof e},$t=function(e,t,n,r,i){var a={},l=function(t){(Lt(i)||(Qt(i)?t.startsWith(i):Array.isArray(i)&&i.find(function(e){return t.startsWith(e)})))&&(a[t]=Ht(e,t,void 0,r))};for(var o in e.current)l(o);return n?Tt(a):Yt(t,Tt(a))},en=function(e){return e instanceof RegExp},tn=function(e){return Nt(e)&&!en(e)?e:{value:e,message:""}},nn=function(e){return"function"==typeof e},rn=function(e){return Qt(e)||t.isValidElement(e)};function an(e,t,n){if(void 0===n&&(n="validate"),rn(e)||Wt(e)&&!e)return{type:n,message:rn(e)?e:"",ref:t}}var ln=function(e,t,n,r,i){var a;return t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),(a={},a[r]=i||!0,a))}):{}},on=function(e,t,n,r){var i=n.ref,a=n.ref.value,l=n.options,o=n.required,u=n.maxLength,c=n.minLength,s=n.min,d=n.max,m=n.pattern,f=n.validate;try{var v=!1,p=i.name,g={},E=xt(i),y=Ut(i),h=E||y,C=""===a,b=ln.bind(null,p,t,g),O=function(e,t,n,r,a){void 0===r&&(r="maxLength"),void 0===a&&(a="minLength");var l=e?t:n;g[p]=Object.assign({type:e?r:a,message:l,ref:i},b(e?r:a,l))};if(o&&(!E&&!y&&(C||Ot(a))||Wt(a)&&!a||y&&!Vt(l).isValid||E&&!Pt(l).isValid)){var S=rn(o)?{value:!!o,message:o}:tn(o),I=S.message;if(S.value&&(g[p]=Object.assign({type:"required",message:I,ref:h?((e.current[p].options||[])[0]||{}).ref:i},b("required",I)),!t))return Promise.resolve(g)}if(!(Ot(s)&&Ot(d)||""===a)){var _,D,w=tn(d),T=tn(s);if(isNaN(a)){var L=i.valueAsDate||new Date(a);Qt(w.value)&&(_=L>new Date(w.value)),Qt(T.value)&&(D=L<new Date(T.value))}else{var A=i.valueAsNumber||parseFloat(a);Ot(w.value)||(_=A>w.value),Ot(T.value)||(D=A<T.value)}if((_||D)&&(O(!!_,w.message,T.message,"max","min"),!t))return Promise.resolve(g)}if(Qt(a)&&!C&&(u||c)){var R=tn(u),M=tn(c),P=!Ot(R.value)&&a.length>R.value,x=!Ot(M.value)&&a.length<M.value;if((P||x)&&(O(P,R.message,M.message),!t))return Promise.resolve(g)}if(Qt(a)&&m&&!C){var k=tn(m),U=k.value,B=k.message;if(en(U)&&!U.test(a)&&(g[p]=Object.assign({type:"pattern",message:B,ref:i},b("pattern",B)),!t))return Promise.resolve(g)}var F=function(){if(f){var n=Ht(e,p,r,!1,!0),a=h&&l?l[0].ref:i;return nn(f)?Promise.resolve(f(n)).then(function(e){var n=an(e,a);if(n&&(g[p]=Object.assign(Object.assign({},n),b("validate",n.message)),!t))return v=!0,g}):function(){if(Nt(f)){var e=function(){if(!zt(i)&&(g[p]=Object.assign({ref:a},i),!t))return v=!0,g},r=!1,i={},l=N(Object.entries(f),function(e){var l=e[0],o=e[1];if(zt(i)||t)return Promise.resolve(o(n)).then(function(e){var n=an(e,a,l);n&&(i=Object.assign(Object.assign({},n),b(l,n.message)),t&&(g[p]=i))});r=!0},function(){return r});return l&&l.then?l.then(e):e()}}()}}();return Promise.resolve(F&&F.then?F.then(function(e){return v?e:g}):v?F:g)}catch(e){return Promise.reject(e)}},un=function e(t,n,r){for(var i in void 0===r&&(r=[]),n){var a=t+(Nt(n)?"."+i:"["+i+"]");Zt(n[i])?r.push(a):e(a,n[i],r)}return r},cn=function(e,t,n,r,i){var a=void 0;return n.add(t),zt(e)||(a=At(e,t),(Nt(a)||Array.isArray(a))&&un(t,a).forEach(function(e){return n.add(e)})),Lt(a)?i?r:At(r,t):a},sn=function(e){var t=e.isBlurEvent,n=e.isSubmitted;return!e.isOnAll&&(!n&&e.isOnTouch?!(e.isTouched||t):(n?e.isReValidateOnBlur:e.isOnBlur)?!t:!(n?e.isReValidateOnChange:e.isOnChange)||t)},dn=function(e){return e.substring(0,e.indexOf("["))},mn=function(e,t){return[].concat(e).some(function(e){return function(e,t){return RegExp(("^"+t+"([|.)\\d+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e)}(t,e)})},fn="undefined"!=typeof window&&"undefined"!=typeof document;function vn(e){var t,n;if(Zt(e)||fn&&(e instanceof File||bt(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 new Date(e.getTime());if(e instanceof Set){n=new Set;for(var r,i=p(e);!(r=i()).done;)n.add(r.value);return n}if(e instanceof Map){n=new Map;for(var a,l=p(e.keys());!(a=l()).done;){var o=a.value;n.set(o,vn(e.get(o)))}return n}for(var u in n=Array.isArray(e)?[]:{},e)n[u]=vn(e[u]);return n}var pn=function(e){return{isOnSubmit:!e||"onSubmit"===e,isOnBlur:"onBlur"===e,isOnChange:"onChange"===e,isOnAll:"all"===e,isOnTouch:"onTouched"===e}},gn=function(e){return xt(e)||Ut(e)},En="undefined"==typeof window,yn=fn?"Proxy"in window:"undefined"!=typeof Proxy,hn=t.createContext(null);hn.displayName="RHFContext";var Cn=function(e){var n=e.as,r=e.render,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),a=function(e){var n=e.name,r=e.rules,i=e.defaultValue,a=e.control,l=e.onFocus,o=t.useContext(hn);if("production"!==process.env.NODE_ENV&&!a&&!o)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");var u=a||o.control,c=u.defaultValuesRef,s=u.setValue,d=u.register,m=u.unregister,f=u.trigger,v=u.mode,p=u.reValidateMode,g=p.isReValidateOnBlur,E=p.isReValidateOnChange,y=u.formState,h=u.formStateRef.current,C=h.isSubmitted,b=h.touched,O=h.errors,S=u.updateFormState,N=u.readFormStateRef,I=u.fieldsRef,_=u.shallowFieldsStateRef,D=!mn(u.fieldArrayNamesRef.current,n),w=function(){return!Lt(At(_.current,n))&&D?At(_.current,n):Lt(i)?At(c.current,n):i},T=t.useState(w()),L=T[0],A=T[1],R=t.useRef(L),M=t.useRef({focus:function(){return null}}),P=t.useRef(l||function(){nn(M.current.focus)&&M.current.focus(),"production"!==process.env.NODE_ENV&&(nn(M.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"))}),x=t.useCallback(function(e){return!sn(Object.assign({isBlurEvent:e,isReValidateOnBlur:g,isReValidateOnChange:E,isSubmitted:C,isTouched:!!At(b,n)},v))},[g,E,C,b,n,v]),k=t.useCallback(function(e){var t,n=Zt(t=e[0])||!Nt(t.target)||Nt(t.target)&&!t.type?t:Lt(t.target.value)?t.target.checked:t.target.value;return A(n),R.current=n,n},[]),U=t.useCallback(function(e){if("production"!==process.env.NODE_ENV&&!n)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");I.current[n]?I.current[n]=Object.assign({ref:I.current[n].ref},r):(d(Object.defineProperties({name:n,focus:P.current},{value:{set:function(e){A(e),R.current=e},get:function(){return R.current}}}),r),e=Lt(At(c.current,n))),e&&D&&A(w())},[r,n,d]);t.useEffect(function(){return function(){return m(n)}},[n]),t.useEffect(function(){"production"!==process.env.NODE_ENV&&(Lt(L)&&console.warn("📋 "+n+" 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)"),!D&&Lt(i)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),U()},[U]),t.useEffect(function(){!I.current[n]&&U(!0)});var B=t.useCallback(function(){N.current.touched&&!At(b,n)&&(wt(b,n,!0),S({touched:b})),x(!0)&&f(n)},[n,S,x,f,N]);return{field:{onChange:t.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s(n,k(t),{shouldValidate:x(),shouldDirty:!0})},[s,n,x]),onBlur:B,name:n,value:L,ref:M},meta:Object.defineProperties({invalid:!!At(O,n)},{isDirty:{get:function(){return!!At(y.dirtyFields,n)}},isTouched:{get:function(){return!!At(y.touched,n)}}})}}(e),l=a.field,o=a.meta,u=Object.assign(Object.assign({},i),l);return n?t.isValidElement(n)?t.cloneElement(n,u):t.createElement(n,u):r?r(l,o):null},bn=function(e){var r=e.control,i=e.t,a=window.Digit.Utils.browser.isMobile();return n.createElement(t.Fragment,null,n.createElement(o.SearchField,{className:"pt-form-field"},n.createElement("label",null,i("AUDIT_FROM_DATE_LABEL")),n.createElement(Cn,{render:function(e){return n.createElement(o.DatePicker,{date:e.value,onChange:e.onChange})},name:"fromDate",control:r})),n.createElement(o.SearchField,{className:"pt-form-field"},n.createElement("label",null,i("AUDIT_TO_DATE_LABEL")),n.createElement(Cn,{render:function(e){return n.createElement(o.DatePicker,{date:e.value,onChange:e.onChange})},name:"toDate",control:r})),n.createElement(o.SearchField,{className:"pt-search-action-submit"},n.createElement(o.SubmitBar,{style:{marginTop:a?"510px":"25px",marginLeft:a?"0":"-30px",maxWidth:a?"100%":"240px"},label:i("ES_COMMON_APPLY"),submit:!0})))},On=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Sn=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Nn=function(e){var r,i=e.Controller,a=e.register,l=e.control,u=e.t,c=e.reset,s=e.previousPage,m=e.handleSubmit,v=e.tenantId,p=e.data,g=e.onSubmit,E=e.isLoading,y=t.useState([]),h=y[0],C=y[1],b=function(e){return n.createElement("div",{onClick:e.onClick},n.createElement(o.DownloadBtnCommon,null))};t.useEffect(function(){(null==p?void 0:p.length)>0&&C([null==p?void 0:p.map(function(e){var t,n,r={};return r[u("AUDIT_DATE_LABEL")]=O(null==e?void 0:e.timestamp)||"-",r[u("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp)||"-",r[u("AUDIT_DATAVIEWED_LABEL")]=(null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",r[u("AUDIT_DATAVIEWED_BY_LABEL")]=(null==e?void 0:e.dataViewedBy)||"-",r[u("AUDIT_ROLE_LABEL")]=(null==e||null===(n=e.roles)||void 0===n?void 0:n.map(function(e){return e.name}).join(", "))||"-",d({},r)})])},[p]);var O=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},S=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},N=t.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),I=N[0],_=N[1],D=function(){_({type:"remove"})},w=function(){return n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:D},n.createElement(o.CloseSvg,null))},T={Controller:i,register:a,control:l,t:u,reset:c,previousPage:s},L=t.useCallback(function(e){return function(e){var t=e.currentlyActiveMobileModal,r=e.searchFormFieldsComponentProps,i=e.tenantId,a=f(e,On),l=a.closeMobilePopupModal;switch(t){case"SearchFormComponent":return n.createElement(o.SearchForm,a,n.createElement(w,null),n.createElement("div",{className:"MobilePopupHeadingWrapper"},n.createElement("h2",null,u("PRIVACY_AUDIT_REPORT"),":")),n.createElement(bn,d({},r,{closeMobilePopupModal:l,tenantId:i,t:u})));default:return n.createElement("span",null)}}(d({currentlyActiveMobileModal:e.currentlyActiveMobileModal,searchFormFieldsComponentProps:e.searchFormFieldsComponentProps,tenantId:e.tenantId},f(e,Sn)))},[I]);null==p||null===(r=p.roles)||void 0===r||r.forEach(function(e){});var A=t.useMemo(function(){return null!=p&&p.display||""===p?[]:null==p?void 0:p.map(function(e){var t,n,r,i;return(i={})[u("AUDIT_DATE_LABEL")]=O(e.timestamp)||"-",i[u("AUDIT_TIME_LABEL")]=S(e.timestamp)||"-",i[u("AUDIT_DATAVIEWED_LABEL")]=(null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",i[u("AUDIT_DATAVIEWED_BY_LABEL")]=e.dataViewedBy||"-",i[u("AUDIT_ROLE_LABEL")]=(null===(n=e.roles)||void 0===n||null===(r=n.slice(0,3))||void 0===r?void 0:r.map(function(e){return e.name}).join(", "))||"-",i})},[p]);return n.createElement(n.Fragment,null,n.createElement(o.BackButton,null),n.createElement("div",{className:"sideContent",style:{marginLeft:"65%",marginTop:"-12%"}},n.createElement(b,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(h)}})),n.createElement(o.Header,null,u("PRIVACY_AUDIT_REPORT"),":"),n.createElement("div",{className:"searchBox"},n.createElement(o.SearchAction,{text:u("ES_COMMON_SEARCH"),handleActionClick:function(){return _({type:"set",payload:"SearchFormComponent"})},tenantId:v,t:u})),I?n.createElement(o.PopUp,null,n.createElement(L,{onSubmit:function(e){_({type:"remove"}),g(e)},handleSubmit:m,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:T,currentlyActiveMobileModal:I,closeMobilePopupModal:D,tenantId:v})):null,E&&n.createElement(o.Loader,null),n.createElement(o.DetailsCard,{data:A}))},In=function(e){var r=e.showLoader,i=e.isLoading,a=e.tenantId,l=e.t,u=e.onSubmit,c=e.data,s=e.count,m=function(e){var n=void 0===e?{}:e,r=n.mode,i=void 0===r?"onSubmit":r,a=n.reValidateMode,l=void 0===a?"onChange":a,o=n.resolver,u=n.context,c=n.defaultValues,s=void 0===c?{}:c,d=n.shouldFocusError,m=void 0===d||d,f=n.shouldUnregister,v=void 0===f||f,g=n.criteriaMode,E=t.useRef({}),y=t.useRef({}),h=t.useRef({}),C=t.useRef(new Set),b=t.useRef({}),O=t.useRef({}),S=t.useRef({}),I=t.useRef({}),_=t.useRef(s),D=t.useRef(!1),w=t.useRef(!1),T=t.useRef(),L=t.useRef({}),A=t.useRef({}),R=t.useRef(u),M=t.useRef(o),P=t.useRef(new Set),x=t.useRef(pn(i)),k=x.current,U=k.isOnSubmit,B=k.isOnTouch,F="all"===g,j=t.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!U,errors:{}}),V=j[0],H=j[1],G=t.useRef({isDirty:!yn,dirtyFields:!yn,touched:!yn||B,isValidating:!yn,isSubmitting:!yn,isValid:!yn}),z=t.useRef(V),W=t.useRef(),q=t.useRef(pn(l)).current,X=q.isOnBlur,Z=q.isOnChange;R.current=u,M.current=o,z.current=V,L.current=v?{}:zt(L.current)?vn(s):L.current;var Y=t.useCallback(function(e){void 0===e&&(e={}),D.current||(z.current=Object.assign(Object.assign({},z.current),e),H(z.current))},[]),K=function(){return G.current.isValidating&&Y({isValidating:!0})},J=t.useCallback(function(e,t,n,r,i){void 0===n&&(n=!1),void 0===r&&(r={});var a=n||function(e){var t=e.errors,n=e.name,r=e.error,i=e.validFields,a=e.fieldsWithValidation,l=Lt(r),o=At(t,n);return l&&!!o||!l&&!Kt(o,r,!0)||l&&At(a,n)&&!At(i,n)}({errors:z.current.errors,error:t,name:e,validFields:I.current,fieldsWithValidation:S.current}),l=At(z.current.errors,e);t?(qt(I.current,e),a=a||!l||!Kt(l,t,!0),wt(z.current.errors,e,t)):((At(S.current,e)||M.current)&&(wt(I.current,e,!0),a=a||l),qt(z.current.errors,e)),(a&&!Ot(n)||!zt(r)||G.current.isValidating)&&Y(Object.assign(Object.assign(Object.assign({},r),M.current?{isValid:!!i}:{}),{isValidating:!1}))},[]),Q=t.useCallback(function(e,t){var n=E.current[e],r=n.ref,i=n.options,a=fn&&bt(r)&&Ot(t)?"":t;xt(r)?(i||[]).forEach(function(e){var t=e.ref;return t.checked=t.value===a}):kt(r)&&!Qt(a)?r.files=a:Bt(r)?[].concat(r.options).forEach(function(e){return e.selected=a.includes(e.value)}):Ut(r)&&i?i.length>1?i.forEach(function(e){var t=e.ref;return t.checked=Array.isArray(a)?!!a.find(function(e){return e===t.value}):a===t.value}):i[0].ref.checked=!!a:r.value=a},[]),$=t.useCallback(function(e,t){if(G.current.isDirty){var n=ce();return e&&t&&wt(n,e,t),!Kt(n,_.current)}return!1},[]),ee=t.useCallback(function(e,t){if(void 0===t&&(t=!0),G.current.isDirty||G.current.dirtyFields){var n=!Kt(At(_.current,e),Ht(E,e,L)),r=At(z.current.dirtyFields,e),i=z.current.isDirty;n?wt(z.current.dirtyFields,e,!0):qt(z.current.dirtyFields,e);var a={isDirty:$(),dirtyFields:z.current.dirtyFields},l=G.current.isDirty&&i!==a.isDirty||G.current.dirtyFields&&r!==At(z.current.dirtyFields,e);return l&&t&&Y(a),l?a:{}}return{}},[]),te=t.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||E.current[e]?Promise.resolve(on(E,F,E.current[e],L)).then(function(n){var r=n[e];return J(e,r,t),Lt(r)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[J,F]),ne=t.useCallback(function(e){try{return Promise.resolve(M.current(ce(),R.current,F)).then(function(t){var n=t.errors,r=z.current.isValid;if(Array.isArray(e)){var i=e.map(function(e){var t=At(n,e);return t?wt(z.current.errors,e,t):qt(z.current.errors,e),!t}).every(Boolean);return Y({isValid:zt(n),isValidating:!1}),i}var a=At(n,e);return J(e,a,r!==zt(n),{},zt(n)),!a})}catch(e){return Promise.reject(e)}},[J,F]),re=t.useCallback(function(e){try{var t=function(e){return n?e:Promise.resolve(te(r))},n=!1,r=e||Object.keys(E.current);if(K(),M.current)return Promise.resolve(ne(r));var i=function(){if(Array.isArray(r))return!e&&(z.current.errors={}),Promise.resolve(Promise.all(r.map(function(e){try{return Promise.resolve(te(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){Y({isValidating:!1});var t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(i&&i.then?i.then(t):t(i))}catch(e){return Promise.reject(e)}},[ne,te]),ie=t.useCallback(function(e,t,n){var r=n.shouldDirty,i=n.shouldValidate,a={};wt(a,e,t);for(var l,o=p(un(e,t));!(l=o()).done;){var u=l.value;E.current[u]&&(Q(u,At(a,u)),r&&ee(u),i&&re(u))}},[re,Q,ee]),ae=t.useCallback(function(e,t,n){if(!v&&!Zt(t)&&wt(L.current,e,Array.isArray(t)?[].concat(t):Object.assign({},t)),E.current[e])Q(e,t),n.shouldDirty&&ee(e),n.shouldValidate&&re(e);else if(!Zt(t)&&(ie(e,t,n),P.current.has(e))){var r,i,a=dn(e)||e;wt(y.current,e,t),A.current[a](((r={})[a]=At(y.current,a),r)),(G.current.isDirty||G.current.dirtyFields)&&n.shouldDirty&&(wt(z.current.dirtyFields,e,function(e,t,n){return Yt(Jt(e,t,n.slice(0,e.length)),Jt(t,e,n.slice(0,e.length)))}(t,At(_.current,e,[]),At(z.current.dirtyFields,e,[]))),Y({isDirty:!Kt(Object.assign(Object.assign({},ce()),(i={},i[e]=t,i)),_.current)}))}!v&&wt(L.current,e,t)},[ee,Q,ie]),le=function(e){return w.current||C.current.has(e)||C.current.has((e.match(/\w+/)||[])[0])},oe=function(e){var t=!0;if(!zt(b.current))for(var n in b.current)e&&b.current[n].size&&!b.current[n].has(e)&&!b.current[n].has(dn(e))||(O.current[n](),t=!1);return t};function ue(e){if(!v){for(var t,n=vn(e),r=p(P.current);!(t=r()).done;){var i,a=t.value;It(a)&&!n[a]&&(n=Object.assign(Object.assign({},n),((i={})[a]=[],i)))}return n}return e}function ce(e){if(Qt(e))return Ht(E,e,L);if(Array.isArray(e)){for(var t,n={},r=p(e);!(t=r()).done;){var i=t.value;wt(n,i,Ht(E,i,L))}return n}return ue($t(E,vn(L.current),v))}T.current=T.current?T.current:function(e){var t=e.type,n=e.target;try{var r,i,a=n.name,l=E.current[a];return Promise.resolve(function(){if(l){var e=function(){!o&&oe(a),J(a,r,s,c,i)},o="blur"===t,u=sn(Object.assign({isBlurEvent:o,isReValidateOnChange:Z,isReValidateOnBlur:X,isTouched:!!At(z.current.touched,a),isSubmitted:z.current.isSubmitted},x.current)),c=ee(a,!1),s=!zt(c)||!o&&le(a);if(o&&!At(z.current.touched,a)&&G.current.touched&&(wt(z.current.touched,a,!0),c=Object.assign(Object.assign({},c),{touched:z.current.touched})),!v&&Ut(n)&&wt(L.current,a,Ht(E,a)),u)return!o&&oe(a),(!zt(c)||s&&zt(c))&&Y(c);K();var d=M.current?Promise.resolve(M.current(ce(),R.current,F)).then(function(e){var t=e.errors,l=z.current.isValid;if(r=At(t,a),Ut(n)&&!r&&M.current){var o=dn(a),u=At(t,o,{});u.type&&u.message&&(r=u),o&&(u||At(z.current.errors,o))&&(a=o)}l!==(i=zt(t))&&(s=!0)}):Promise.resolve(on(E,F,l,L)).then(function(e){r=e[a]});return d&&d.then?d.then(e):e()}}())}catch(e){return Promise.reject(e)}};var se=t.useCallback(function(e){void 0===e&&(e={});try{var t=zt(E.current)?_.current:{};return Promise.resolve(M.current(Object.assign(Object.assign(Object.assign({},t),ce()),e),R.current,F)).then(function(e){var t=zt(e.errors);z.current.isValid!==t&&Y({isValid:t})})}catch(e){return Promise.reject(e)}},[F]),de=t.useCallback(function(e,t){!function(e,t,n,r,i,a){var l=n.ref,o=n.ref.name,u=e.current[o];if(!i){var c=Ht(e,o,r);!Lt(c)&&wt(r.current,o,c)}l.type&&u?xt(l)||Ut(l)?Array.isArray(u.options)&&u.options.length?(_t(u.options).forEach(function(e,n){void 0===e&&(e={}),(Gt(e.ref)&&Xt(e,e.ref)||a)&&(Rt(e.ref,t),qt(u.options,"["+n+"]"))}),u.options&&!_t(u.options).length&&delete e.current[o]):delete e.current[o]:(Gt(l)&&Xt(u,l)||a)&&(Rt(l,t),delete e.current[o]):delete e.current[o]}(E,T.current,e,L,v,t),v&&(qt(I.current,e.ref.name),qt(S.current,e.ref.name))},[v]),me=t.useCallback(function(e){if(w.current)Y();else{for(var t,n=p(C.current);!(t=n()).done;)if(t.value.startsWith(e)){Y();break}oe(e)}},[]),fe=t.useCallback(function(e,t){e&&(de(e,t),v&&!_t(e.options||[]).length&&(qt(z.current.errors,e.ref.name),wt(z.current.dirtyFields,e.ref.name,!0),Y({isDirty:$()}),G.current.isValid&&M.current&&se(),me(e.ref.name)))},[se,de]),ve=t.useCallback(function(e,t,n){var r=n?b.current[n]:C.current,i=$t(E,vn(L.current),v,!1,e);if(Qt(e)){var a=dn(e)||e;return P.current.has(a)&&(i=Object.assign(Object.assign({},h.current),i)),cn(i,e,r,Lt(At(_.current,e))?t:At(_.current,e),!0)}var l=Lt(t)?_.current:t;return Array.isArray(e)?e.reduce(function(e,t){var n;return Object.assign(Object.assign({},e),((n={})[t]=cn(i,t,r,l),n))},{}):(w.current=Lt(n),Tt(!zt(i)&&i||l))},[]);function pe(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(P.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")}var n,r=e.name,i=e.type,a=e.value,l=Object.assign({ref:e},t),o=E.current,u=gn(e),c=mn(P.current,r),s=function(t){return fn&&(!bt(e)||t===e)},d=o[r],m=!0;if(d&&(u?Array.isArray(d.options)&&_t(d.options).find(function(e){return a===e.ref.value&&s(e.ref)}):s(d.ref)))o[r]=Object.assign(Object.assign({},d),t);else{d=i?u?Object.assign({options:[].concat(_t(d&&d.options||[]),[{ref:e}]),ref:{type:i,name:r}},t):Object.assign({},l):l,o[r]=d;var f=Lt(At(L.current,r));zt(_.current)&&f||(n=At(f?_.current:L.current,r),(m=Lt(n))||c||Q(r,n)),zt(t)||(wt(S.current,r,!0),!U&&G.current.isValid&&on(E,F,d,L).then(function(e){var t=z.current.isValid;zt(e)?wt(I.current,r,!0):qt(I.current,r),t!==zt(e)&&Y()})),!v||c&&m||!c&&qt(z.current.dirtyFields,r),i&&function(e,t,n){var r=e.ref;bt(r)&&n&&(r.addEventListener(t?"change":"input",n),r.addEventListener("blur",n))}(u&&d.options?d.options[d.options.length-1]:d,u||"select-one"===e.type,T.current)}}var ge=t.useCallback(function(e,t){return function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());var r={},i=ue($t(E,vn(L.current),v,!0));return G.current.isSubmitting&&Y({isSubmitting:!0}),Promise.resolve(function(a,l){try{var o=function(){function a(){var a=function(){if(zt(r)&&Object.keys(z.current.errors).every(function(e){return e in E.current}))return Y({errors:{},isSubmitting:!0}),Promise.resolve(e(i,n)).then(function(){});var a=function(e){m&&function(e,t){for(var n in e)if(At(t,n)){var r=e[n];if(r){if(r.ref.focus&&Lt(r.ref.focus()))break;if(r.options){r.options[0].ref.focus();break}}}}(E.current,z.current.errors)};return z.current.errors=Object.assign(Object.assign({},z.current.errors),r),t?Promise.resolve(t(z.current.errors,n)).then(a):a()}();if(a&&a.then)return a.then(function(){})}var l=M.current?Promise.resolve(M.current(i,R.current,F)).then(function(e){var t=e.values;z.current.errors=r=e.errors,i=t}):N(Object.values(E.current),function(e){var t=function(){if(e){var t=e.ref.name;return Promise.resolve(on(E,F,e,L)).then(function(e){e[t]?(wt(r,t,e[t]),qt(I.current,t)):At(S.current,t)&&(qt(z.current.errors,t),wt(I.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return l&&l.then?l.then(a):a()}()}catch(e){return l(!0,e)}return o&&o.then?o.then(l.bind(null,!1),l.bind(null,!0)):l(!1,o)}(0,function(e,t){if(z.current.isSubmitting=!1,Y({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:zt(z.current.errors),submitCount:z.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}}},[m,F]);t.useEffect(function(){o&&G.current.isValid&&se(),W.current=W.current||!fn?W.current:function(e,t){var n=new MutationObserver(function(){for(var n=0,r=Object.values(e.current);n<r.length;n++){var i=r[n];if(i&&i.options)for(var a,l=p(i.options);!(a=l()).done;){var o=a.value;o&&o.ref&&Gt(o.ref)&&t(i)}else i&&Gt(i.ref)&&t(i)}});return n.observe(window.document,{childList:!0,subtree:!0}),n}(E,fe)},[fe,_.current]),t.useEffect(function(){return function(){W.current&&W.current.disconnect(),D.current=!0,"production"===process.env.NODE_ENV&&Object.values(E.current).forEach(function(e){return fe(e,!0)})}},[]),!o&&G.current.isValid&&(V.isValid=Kt(I.current,S.current)&&zt(z.current.errors));var Ee={trigger:re,setValue:t.useCallback(function(e,t,n){ae(e,t,n||{}),le(e)&&Y(),oe(e)},[ae,re]),getValues:t.useCallback(ce,[]),register:t.useCallback(function(e,t){if(!En)if(Qt(e))pe({name:e},t);else{if(!Nt(e)||!("name"in e))return function(t){return t&&pe(t,e)};pe(e,t)}},[_.current]),unregister:t.useCallback(function(e){for(var t,n=p(Array.isArray(e)?e:[e]);!(t=n()).done;)fe(E.current[t.value],!0)},[]),formState:yn?new Proxy(V,{get:function(e,t){if("production"!==process.env.NODE_ENV&&"isValid"===t&&U&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return G.current[t]=!0,e[t]}}):V},ye=t.useMemo(function(){return Object.assign({isFormDirty:$,updateWatchedValue:me,shouldUnregister:v,updateFormState:Y,removeFieldEventListener:de,watchInternal:ve,mode:x.current,reValidateMode:{isReValidateOnBlur:X,isReValidateOnChange:Z},validateResolver:o?se:void 0,fieldsRef:E,resetFieldArrayFunctionRef:A,useWatchFieldsRef:b,useWatchRenderFunctionsRef:O,fieldArrayDefaultValuesRef:y,validFieldsRef:I,fieldsWithValidationRef:S,fieldArrayNamesRef:P,readFormStateRef:G,formStateRef:z,defaultValuesRef:_,shallowFieldsStateRef:L,fieldArrayValuesRef:h},Ee)},[_.current,me,v,de,ve]);return Object.assign({watch:function(e,t){return ve(e,t)},control:ye,handleSubmit:ge,reset:t.useCallback(function(e,t){if(void 0===t&&(t={}),fn)for(var n=0,r=Object.values(E.current);n<r.length;n++){var i=r[n];if(i){var a=i.ref,l=i.options,o=gn(a)&&Array.isArray(l)?l[0].ref:a;if(bt(o))try{o.closest("form").reset();break}catch(e){}}}var u,c,s,d,m,f,p,g;E.current={},_.current=Object.assign({},e||_.current),e&&oe(""),Object.values(A.current).forEach(function(e){return nn(e)&&e()}),L.current=v?{}:vn(e||_.current),c=(u=t).errors,s=u.isDirty,d=u.isSubmitted,m=u.touched,p=u.submitCount,g=u.dirtyFields,(f=u.isValid)||(I.current={},S.current={}),y.current={},C.current=new Set,w.current=!1,Y({submitCount:p?z.current.submitCount:0,isDirty:!!s&&z.current.isDirty,isSubmitted:!!d&&z.current.isSubmitted,isValid:!!f&&z.current.isValid,dirtyFields:g?z.current.dirtyFields:{},touched:m?z.current.touched:{},errors:c?z.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},[]),clearErrors:t.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(function(e){return E.current[e]&&It(e)?delete z.current.errors[e]:qt(z.current.errors,e)}),Y({errors:e?z.current.errors:{}})},[]),setError:t.useCallback(function(e,t){var n=(E.current[e]||{}).ref;wt(z.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),Y({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:V.errors},Ee)}({defaultValues:Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:10,sortOrder:"ASC"}}),f=m.register,v=m.control,g=m.handleSubmit,E=m.setValue,y=m.getValues,h=m.reset,C=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},b=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},O=t.useState([]),S=O[0],I=O[1],_=function(e){return n.createElement("div",{onClick:e.onClick},n.createElement(o.DownloadBtnCommon,null))};t.useEffect(function(){f("offset",0),f("limit",10)},[f]),t.useEffect(function(){(null==c?void 0:c.length)>0&&I([null==c?void 0:c.map(function(e){var t,n,r={};return r[l("AUDIT_DATE_LABEL")]=C(null==e?void 0:e.timestamp)||"-",r[l("AUDIT_TIME_LABEL")]=b(null==e?void 0:e.timestamp)||"-",r[l("AUDIT_DATAVIEWED_LABEL")]=(null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",r[l("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,r[l("AUDIT_ROLE_LABEL")]=(null==e||null===(n=e.roles)||void 0===n?void 0:n.map(function(e){return e.name}).join(", "))||"-",d({},r)})])},[c]);var D=t.useCallback(function(e){0!==e.length&&(E("sortBy",e.id),E("sortOrder",e.desc?"DESC":"ASC"))},[]);function w(){E("offset",y("offset")-y("limit")),g(u)()}var T=window.Digit.Utils.browser.isMobile();if(T)return n.createElement(Nn,{Controller:Cn,isLoading:i,showLoader:r,register:f,control:v,t:l,reset:h,previousPage:w,handleSubmit:g,tenantId:a,data:c,onSubmit:u});var L=function(e){return n.createElement("span",{className:"cell-text"},e)},A=t.useMemo(function(){return[{Header:l("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?l("WS_NA"):C(e.timestamp);return L(""+(t||"-"))}},{Header:l("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?l("WS_NA"):b(e.timestamp);return L(""+(t||"-"))}},{Header:l(T?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:function(e){var t;return L(""+((null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-"))}},{Header:l(T?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:function(e){return L(""+((null==e?void 0:e.dataViewedBy)||"-"))}},{Header:l("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:function(e){var t,n,r;return L(""+((null==e||null===(t=e.roles)||void 0===t||null===(n=t.slice(0,3))||void 0===n||null===(r=n.map(function(e){return e.name}))||void 0===r?void 0:r.join(", "))||"-"))}}]},[]);return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginRight:"-70px"}}," ",n.createElement(o.BackButton,null)," "),n.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",n.createElement(o.Header,null,l("PRIVACY_AUDIT_REPORT"))," "),n.createElement(o.SearchForm,{className:"audit-card",onSubmit:u,handleSubmit:g},n.createElement(bn,{register:f,control:v,reset:h,tenantId:a,t:l,previousPage:w})),n.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",width:"80%"}},null!=c&&c.display?n.createElement("div",{style:{marginTop:"20x",maxWidth:"680%",marginLeft:"60px",backgroundColor:"white",height:"60px"}},l(c.display).split("\\n").map(function(e,t){return n.createElement("p",{key:t,style:{textAlign:"center",paddingTop:"12px"}},e)})):""!==c?n.createElement("div",{style:{backgroundColor:"white",marginRight:"200px",marginLeft:"2.5%",width:"100%"}},n.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},n.createElement(_,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(S)}})),n.createElement(o.Table,{t:l,data:c.sort(function(e,t){return e.timestamp-t.timestamp}),totalRecords:s,columns:A,getCellProps:function(e){return{style:{minWidth:e.column.Header===l("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}},onPageSizeChange:function(e){E("limit",Number(e.target.value)),g(u)()},currentPage:y("offset")/y("limit"),onNextPage:function(){E("offset",y("offset")+y("limit")),g(u)()},onPrevPage:w,pageSizeLimit:y("limit"),onSort:D,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})):n.createElement(o.Loader,null)))},_n=function(e){var r,i,o,u,c,s,m,f,v,p,g=l.useTranslation().t,E=Digit.ULBService.getCitizenCurrentTenant(),y=t.useState({}),h=y[0],C=y[1],b=window.Digit.Utils.browser.isMobile(),O=function(e,t){void 0===t&&(t="dayend");try{var n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),r=new Date(Date.UTC(n[1],n[2]-1,n[3]));return r.setMinutes(r.getMinutes()+r.getTimezoneOffset()),"dayend"===t&&(r.setHours(r.getHours()+24),r.setSeconds(r.getSeconds()-1)),"daystart"===t&&(r.setHours(r.getHours()),r.setSeconds(r.getSeconds()+1)),r.getTime()}catch(t){return e}};t.useEffect(function(){var e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){var t=d({},e);C(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]="object"==typeof t[n]?t[n].code:t[n],r))},{}))}},[]);var S,N,I={enabled:!!(h&&Object.keys(h).length>0)},_=window.location.href.split("/").pop();isNaN(parseInt(_))?S=10:(N=_,S=parseInt(_)+10);var D=b?d({},h,{offset:isNaN(parseInt(_))?0:parseInt(N)}):d({},h),w=Digit.Hooks.useAudit({tenantId:E,filters:d({},D),config:I}),T=w.isLoading,L=w.data;return n.createElement(n.Fragment,null,n.createElement(In,{t:g,tenantId:E,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:10});var t=d({},e,{fromDate:O(null==e?void 0:e.fromDate,(null==e?void 0:e.fromDate)==(null==e?void 0:e.toDate)?"daystart":""),toDate:O(null==e?void 0:e.toDate,(null==e?void 0:e.fromDate)==(null==e?void 0:e.toDate)?"dayend":"")});C(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]=t[n],r))},{}))},data:T?"":(null==L||null===(r=L.ElasticSearchData)||void 0===r||null===(i=r.filter(function(e){return!e.total}))||void 0===i?void 0:i.length)>0?null==L||null===(o=L.ElasticSearchData)||void 0===o?void 0:o.filter(function(e){return!e.total}):{display:"ES_COMMON_NO_DATA"},count:null==L||null===(u=L.ElasticSearchData)||void 0===u||null===(c=u.filter(function(e){return e.total}))||void 0===c||null===(s=c[0])||void 0===s?void 0:s.total,isLoading:T}),b&&(null==L||null===(m=L.ElasticSearchData)||void 0===m||null===(f=m.filter(function(e){return!e.total}))||void 0===f?void 0:f.length)&&0!==(null==L||null===(v=L.ElasticSearchData)||void 0===v||null===(p=v.filter(function(e){return!e.total}))||void 0===p?void 0:p.length)&&n.createElement("div",null,n.createElement("p",{style:{marginLeft:"16px",marginBottom:"40px"}},n.createElement("span",{className:"link"},n.createElement(a.Link,{to:"/digit-ui/citizen/Audit/"+S},g("PT_LOAD_MORE_MSG"))))))},Dn=["digit-ui/citizen/register/name","/digit-ui/citizen/select-language","/digit-ui/citizen/select-location","/digit-ui/citizen/login","/digit-ui/citizen/register/otp"],wn=function(e,t){return t.filter(function(t){return e.map(function(e){return e.code}).includes(t.code)})},Tn=function(e){var t,r,i,u=e.stateInfo,c=e.userDetails,s=e.CITIZEN,d=e.cityDetails,m=e.mobileView,f=e.handleUserDropdownSelection,v=e.logoUrl,p=e.stateCode,E=e.modules,y=e.appTenants,C=e.pathname,b=e.initData,O=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:"[?(@.url == 'digit-ui-card')]"}],{select:function(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(function(e){return!0===e.enabled}).reduce(function(e,t){var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t].concat(e[t.parentModule]):[t],e},{})}}),S=O.isLoading,N=O.data,I=O.isFetched,_=Digit.Hooks.fsm.useRouteSubscription(C),D=l.useTranslation().t,w=a.useRouteMatch().path,T=a.useHistory(),L=Dn.some(function(e){return window.location.href.includes(e)}),A=E.map(function(e,t){var r=e.code,i=e.tenants,l=Digit.ComponentRegistryService.getComponent(r+"Module");return l?n.createElement(a.Route,{key:t,path:w+"/"+r.toLowerCase()},n.createElement(l,{stateCode:p,moduleCode:r,userType:"citizen",tenants:wn(i,y)})):null}),R=E.map(function(e,t){var r=e.code,i=e.bannerImage,l=(Digit.ComponentRegistryService.getComponent(r+"Links"),I?g(N,r,D):void 0);return"ACTION_TEST_WS"===(null==l?void 0:l.header)&&(null==l||l.links.sort(function(e,t){return t.orderNumber-e.orderNumber})),n.createElement(n.Fragment,null,n.createElement(a.Route,{key:t,path:w+"/"+r.toLowerCase()+"-home"},n.createElement("div",{className:"moduleLinkHomePage"},n.createElement("img",{src:i||(null==u?void 0:u.bannerUrl),alt:"noimagefound"}),n.createElement(o.BackButton,{className:"moduleLinkHomePageBackButton"}),n.createElement("h1",null,D("MODULE_"+r.toUpperCase())),n.createElement("div",{className:"moduleLinkHomePageModuleLinks"},l&&n.createElement(o.CitizenHomeCard,{header:D(null==l?void 0:l.header),links:null==l?void 0:l.links,Icon:function(){return n.createElement("span",null)},Info:"OBPS"===r?function(){return n.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:D("CS_FILE_APPLICATION_INFO_LABEL"),text:D("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===r})),n.createElement(Ct,{moduleCode:null==r?void 0:r.toUpperCase()}))),n.createElement(a.Route,{key:"faq"+t,path:w+"/"+r.toLowerCase()+"-faq"},n.createElement(yt,{module:null==r?void 0:r.toUpperCase()})),n.createElement(a.Route,{key:"hiw"+t,path:w+"/"+r.toLowerCase()+"-how-it-works"},n.createElement(ht,{module:null==r?void 0:r.toUpperCase()})))});return n.createElement("div",{className:_},n.createElement(ct,{t:D,stateInfo:u,userDetails:c,CITIZEN:s,cityDetails:d,mobileView:m,handleUserDropdownSelection:f,logoUrl:v,showSidebar:!0,linkData:N,islinkDataLoading:S}),n.createElement("div",{className:"main center-container citizen-home-container mb-25"},L?null:n.createElement("div",{className:"SideBarStatic"},n.createElement(nt,{linkData:N,islinkDataLoading:S})),n.createElement(a.Switch,null,n.createElement(a.Route,{exact:!0,path:w},n.createElement(vt,null)),n.createElement(a.Route,{exact:!0,path:w+"/select-language"},n.createElement(pt,null)),n.createElement(a.Route,{exact:!0,path:w+"/select-location"},n.createElement(gt,null)),n.createElement(a.Route,{path:w+"/error"},n.createElement(Ve,{initData:b,goToHome:function(){T.push("/digit-ui/citizen")}})),n.createElement(a.Route,{path:w+"/all-services"},n.createElement(h,{userType:"citizen",modules:E,getCitizenMenu:N,fetchedCitizen:I,isLoading:S})),n.createElement(a.Route,{path:w+"/login"},n.createElement(x,{stateCode:p})),n.createElement(a.Route,{path:w+"/register"},n.createElement(x,{stateCode:p,isUserRegistered:!1})),n.createElement(a.Route,{path:w+"/user/profile"},n.createElement(dt,{stateCode:p,userType:"citizen",cityDetails:d})),n.createElement(a.Route,{path:w+"/Audit"},n.createElement(_n,null)),n.createElement(Ge,{initData:b},A,R))),n.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:function(){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()}})))},Ln=function(e){var r,i=e.stateCode,l=e.modules,o=e.appTenants,u=e.logoUrl,c=e.initData,s=a.useHistory(),d=a.useLocation().pathname,m=window.innerWidth,f=Digit.ULBService.getCurrentUlb(),v=Digit.UserService.getUser(),p=(Digit.Hooks.useStore.getInitData().data||{}).stateInfo,g=Digit.UserService.hasAccess(["FSM_DSO"]),E="CITIZEN"===(null==v||null===(r=v.info)||void 0===r?void 0:r.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(E=!1),t.useEffect(function(){null!=d&&d.includes("application-details")||(null!=d&&d.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=d&&d.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=d&&d.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),"/digit-ui/employee"===(null==d?void 0:d.toString())&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),"/digit-ui/citizen"!==(null==d?void 0:d.toString())&&"/digit-ui/employee"!==(null==d?void 0:d.toString())||Digit.SessionStorage.del("WS_DISCONNECTION")},[d]),s.listen(function(){var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});var y={stateInfo:p,userDetails:v,CITIZEN:E,cityDetails:f,mobileView:m<=640,handleUserDropdownSelection:function(e){e.func()},logoUrl:u,DSO:g,stateCode:i,modules:l,appTenants:o,sourceUrl:window.location.origin+"/citizen",pathname:d,initData:c};return n.createElement(a.Switch,null,n.createElement(a.Route,{path:"/digit-ui/employee"},n.createElement(ft,y)),n.createElement(a.Route,{path:"/digit-ui/citizen"},n.createElement(Tn,y)),n.createElement(a.Route,null,n.createElement(a.Redirect,{to:"/digit-ui/citizen"})))},An=[s],Rn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):c.compose)(c.applyMiddleware.apply(void 0,An)),Mn=function(e,t){return void 0===t&&(t={}),c.createStore(function(e,t){return c.combineReducers(d({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return d({},e,{selectedLanguage:t.payload});default:return e}})},t));var n}(e,t),Rn)},Pn=function(e){var t,r=e.stateCode,u=e.moduleReducers,c=Digit.Hooks.useInitStore(r,e.enabledModules),s=c.data;return c.isLoading?n.createElement(o.Loader,{page:!0}):(l.getI18n(),n.createElement(i.Provider,{store:Mn(s,u(s))},n.createElement(a.BrowserRouter,null,n.createElement(o.Body,null,n.createElement(Ln,{initData:s,stateCode:r,modules:null==s?void 0:s.modules,appTenants:s.tenants,logoUrl:null==s||null===(t=s.stateInfo)||void 0===t?void 0:t.logoUrl})))))},xn={SelectOtp:w};exports.DigitUI=function(e){var i=e.stateCode,a=e.registry,l=e.enabledModules,o=e.moduleReducers,u=t.useState(Digit.Utils.getPrivacyObject()||{}),c=u[0],s=u[1],m=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retryDelay:function(e){return Infinity},retry:!1}}})),f=Digit.Contexts.ComponentProvider,v=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),n.createElement("div",null,n.createElement(Ge,null,n.createElement(r.QueryClientProvider,{client:m},n.createElement(f.Provider,{value:a},n.createElement(v.Provider,{value:{privacy:null==c?void 0:c[window.location.pathname],resetPrivacy:function(e){Digit.Utils.setPrivacyObject({}),s({})},getPrivacy:function(){var e=Digit.Utils.getPrivacyObject();return s(e),e},updatePrivacyDescoped:function(e){var t,n=Digit.Utils.getAllPrivacyObject(),r=d({},n,((t={})[window.location.pathname]=e,t));Digit.Utils.setPrivacyObject(d({},r)),s((null==n?void 0:n[window.location.pathname])||{})},updatePrivacy:function(e,t){s(Digit.Utils.updatePrivacy(e,t)||{})}}},n.createElement(Pn,{stateCode:i,enabledModules:l,moduleReducers:o}))))))},exports.initCoreComponents=function(){Object.entries(xn).forEach(function(e){Digit.ComponentRegistryService.setComponent(e[0],e[1])})};
|
|
1
|
+
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),r=require("react-query"),i=require("react-redux"),l=require("react-router-dom"),a=require("react-i18next"),o=require("@egovernments/digit-ui-react-components"),u=e(require("react-tooltip")),c=require("redux"),s=e(require("redux-thunk"));function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(null==e)return{};var n,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)t.indexOf(n=l[r])>=0||(i[n]=e[n]);return i}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g=function(e,t,n){var r=null==e?void 0:e[""+t];r&&r.map(function(e){e.link=e.navigationURL,e.i18nKey=n(e.name)});var i={links:null==r?void 0:r.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:"CITIZEN_"+t+"_ICON"};return"FSM"===t&&[{role:"FSM_DSO",from:"/digit-ui/citizen/fsm/dso-dashboard",dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(function(e){var t,r,l=e.from,a=e.loginLink,o=e.dashoardLink;Digit.UserService.hasAccess(e.role)?null==i||null===(t=i.links)||void 0===t||t.push({link:l,i18nKey:n(o)}):null==i||null===(r=i.links)||void 0===r||r.push({link:"/digit-ui/citizen/login",state:{role:"FSM_DSO",from:l},i18nKey:n(a)})}),i},E=function(e){var t=e.modules,r=e.getCitizenMenu,i=e.fetchedCitizen,l=e.isLoading,u=t.filter(function(e){return"Payment"===e.code})[0],c=t.filter(function(e){return"Payment"!==e.code}),s=[u].concat(c),d=a.useTranslation().t;return l?n.createElement(o.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"citizen-all-services-wrapper"},n.createElement(o.BackButton,null),n.createElement("div",{className:"citizenAllServiceGrid"},s.filter(function(e){return e}).map(function(e,t){var l,a,u,c,s,m,f,v=e.code;return i&&(u=i?g(r,v,d):void 0),(null===(l=u)||void 0===l||null===(a=l.links)||void 0===a?void 0:a.length)>0?n.createElement(o.CitizenHomeCard,{header:d(null===(c=u)||void 0===c?void 0:c.header),links:null===(s=u)||void 0===s||null===(m=s.links)||void 0===m||null===(f=m.filter(function(e){return null==e?void 0:e.link}))||void 0===f?void 0:f.sort(function(e,t){return(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)}),Icon:function(){return function(e){switch(e){case"PT":return n.createElement(o.PTIcon,{className:"fill-path-primary-main"});case"WS":return n.createElement(o.WSICon,{className:"fill-path-primary-main"});case"FSM":return n.createElement(o.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return n.createElement(o.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return n.createElement(o.PGRIcon,{className:"fill-path-primary-main"});case"TL":return n.createElement(o.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return n.createElement(o.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return n.createElement(o.BillsIcon,{className:"fill-path-primary-main"});default:return n.createElement(o.PTIcon,{className:"fill-path-primary-main"})}}(v)},Info:"OBPS"===v?function(){return n.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===v}):n.createElement(n.Fragment,null)}))))},y=function(e){var t=e.modules;return window.Digit.SessionStorage.get("PT_CREATE_EMP_TRADE_NEW_FORM")&&window.Digit.SessionStorage.set("PT_CREATE_EMP_TRADE_NEW_FORM",{}),n.createElement("div",{className:"employee-app-container"},n.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper"},t.map(function(e,t){var r=Digit.ComponentRegistryService.getComponent(e.code+"Card")||function(){return n.createElement(n.Fragment,null)};return n.createElement(r,{key:t})})))},h=function(e){var t=e.modules;return"citizen"===e.userType?n.createElement(E,{modules:t,getCitizenMenu:e.getCitizenMenu,fetchedCitizen:e.fetchedCitizen,isLoading:e.isLoading}):n.createElement(y,{modules:t})},C=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var l=1&i?t:n;if(l){try{b(r,1,l(this.v))}catch(e){b(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?b(r,1,t?t(i):i):n?b(r,1,n(i)):b(r,2,i)}catch(e){b(r,2,e)}},r},e}();function b(e,t,n){if(!e.s){if(n instanceof C){if(!n.s)return void(n.o=b.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(b.bind(null,e,t),b.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}function O(e){return e instanceof C&&1&e.s}var S="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function N(e,t,n){if("function"==typeof e[S]){var r,i,l,a=e[S]();if(function e(o){try{for(;!((r=a.next()).done||n&&n());)if((o=t(r.value))&&o.then){if(!O(o))return void o.then(e,l||(l=b.bind(null,i=new C,2)));o=o.v}i?b(i,1,o):i=o}catch(e){b(i||(i=new C),2,e)}}(),a.return){var o=function(e){try{r.done||a.return()}catch(e){}return e};if(i&&i.then)return i.then(o,function(e){throw o(e)});o()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var u=[],c=0;c<e.length;c++)u.push(e[c]);return function(e,t,n){var r,i,l=-1;return function a(o){try{for(;++l<e.length&&(!n||!n());)if((o=t(l))&&o.then){if(!O(o))return void o.then(a,i||(i=b.bind(null,r=new C,2)));o=o.v}r?b(r,1,o):r=o}catch(e){b(r||(r=new C),2,e)}}(),r}(u,function(e){return t(u[e])},n)}function I(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var w=[{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,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],_=function(e){var t=e.mobileNumber;return n.createElement(o.FormStep,{isDisabled:!(10===t.length&&e.canSubmit),onSelect:e.onSelect,config:e.config,t:e.t,componentInFront:"+91",onChange:e.onMobileChange,value:t})},D=function(e){var r,i,l,a=e.config,u=e.otp,c=e.onOtpChange,s=e.onResend,d=e.onSelect,m=e.t,f=e.error,v=e.userType,p=void 0===v?"citizen":v,g=e.canSubmit,E=t.useState(30),y=E[0],h=E[1];r=function(){h(y-1)},i=y>0?1e3:null,l=t.useRef(),t.useEffect(function(){l.current=r},[r]),t.useEffect(function(){if(null!==i){var e=setInterval(function(){l.current()},i);return function(){return clearInterval(e)}}},[i]);var C=function(){s(),h(2)};return"employee"===p?n.createElement(t.Fragment,null,n.createElement(o.OTPInput,{length:6,onChange:c,value:u}),y>0?n.createElement(o.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):n.createElement("p",{className:"card-text-button",onClick:C},m("CS_RESEND_OTP")),!f&&n.createElement(o.CardLabelError,null,m("CS_INVALID_OTP"))):n.createElement(o.FormStep,{onSelect:d,config:a,t:m,isDisabled:!(6===(null==u?void 0:u.length)&&g)},n.createElement(o.OTPInput,{length:6,onChange:c,value:u}),y>0?n.createElement(o.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):n.createElement("p",{className:"card-text-button",onClick:C},m("CS_RESEND_OTP")),!f&&n.createElement(o.CardLabelError,null,m("CS_INVALID_OTP")))},T=function(e){return n.createElement(o.FormStep,{config:e.config,onSelect:e.onSelect,t:e.t,isDisabled:e.isDisabled})},L=["ResponseInfo","UserRequest"],R=["ResponseInfo","UserRequest"],A={type:"register"},M={type:"login"},P=function(e,t){return(null==e?void 0:e.from)||(null==t?void 0:t.from)||"/digit-ui/citizen"},x=function(e){var r,i,u=e.stateCode,c=e.isUserRegistered,s=void 0===c||c,m=a.useTranslation().t,v=l.useLocation(),p=l.useRouteMatch().path,g=l.useHistory(),E=t.useState(null),y=E[0],h=E[1],C=t.useState(null),b=C[0],O=C[1],S=t.useState(!0),N=S[0],x=S[1],k=(t.useState(null),t.useState(s?{}:null==v||null===(r=v.state)||void 0===r?void 0:r.data)),U=k[0],B=k[1],F=t.useState(null),j=F[0],V=F[1],H=Digit.Hooks.useQueryParams(),G=t.useState(!1),z=G[0],W=G[1],q=t.useState(!0),X=q[0],Z=q[1],Y=t.useState(!0),K=Y[0],J=Y[1];t.useEffect(function(){var e;return b&&(j&&(clearTimeout(j),V(null)),e=setTimeout(function(){O("")},5e3),V(e)),function(){e&&clearTimeout(e)}},[b]),t.useEffect(function(){var e;if(y){var t,n,r,i,l,a;Digit.SessionStorage.set("citizen.userRequestObject",y),Digit.UserService.setUser(y),t=null==y?void 0:y.info,n=null==y?void 0:y.access_token,r=u,a=null===(i=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===i||null===(l=i.value)||void 0===l?void 0:l.selectedLanguage,localStorage.setItem("Citizen.tenant-id",r),localStorage.setItem("tenant-id",r),localStorage.setItem("citizen.userRequestObject",JSON.stringify(t)),localStorage.setItem("locale",a),localStorage.setItem("Citizen.locale",a),localStorage.setItem("token",n),localStorage.setItem("Citizen.token",n),localStorage.setItem("user-info",JSON.stringify(t)),localStorage.setItem("Citizen.user-info",JSON.stringify(t));var o=(null===(e=v.state)||void 0===e?void 0:e.from)||"/digit-ui/citizen";Digit.ULBService.getCitizenCurrentTenant(!0)?g.replace(o):g.replace("/digit-ui/citizen/select-location",{redirectBackTo:o})}},[y]);var Q=t.useMemo(function(){return w.map(function(e){var t={};for(var n in e.texts)t[n]=m(e.texts[n]);return d({},e,{texts:t})},[w])}),$=function(){return Digit.UserService.getType()},ee=function(e){return Promise.resolve(I(function(){return Promise.resolve(Digit.UserService.sendOtp(e,u)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return n.createElement("div",{className:"citizen-form-wrapper"},n.createElement(l.Switch,null,n.createElement(o.AppContainer,null,n.createElement(o.BackButton,null),n.createElement(l.Route,{path:""+p,exact:!0},n.createElement(_,{onSelect:function(e){try{J(!1),B(d({},U,e));var t=d({},e,{tenantId:u,userType:$()});return Promise.resolve(s?Promise.resolve(ee({otp:d({},t,M)})).then(function(e){var n,r,i;if(!e[1])return J(!0),void g.replace(p+"/otp",{from:P(v.state,H),role:null===(r=v.state)||void 0===r?void 0:r.role});J(!0),v.state&&"FSM_DSO"===v.state.role||g.push("/digit-ui/citizen/register/name",{from:P(v.state,H),data:t}),null!==(n=v.state)&&void 0!==n&&n.role&&(J(!0),O("FSM_DSO"===(null===(i=v.state)||void 0===i?void 0:i.role)?m("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(ee({otp:d({},t,A)})).then(function(e){if(!e[1])return J(!0),void g.replace(p+"/otp",{from:P(v.state,H)});J(!0)}))}catch(e){return Promise.reject(e)}},config:Q[0],mobileNumber:U.mobileNumber||"",onMobileChange:function(e){B(d({},U,{mobileNumber:e.target.value}))},canSubmit:K,showRegisterLink:s&&!(null!==(i=v.state)&&void 0!==i&&i.role),t:m})),n.createElement(l.Route,{path:p+"/otp"},n.createElement(D,{config:d({},Q[1],{texts:d({},Q[1].texts,{cardText:Q[1].texts.cardText+" "+(U.mobileNumber||"")})}),onOtpChange:function(e){B(d({},U,{otp:e}))},onResend:function(){try{var e={mobileNumber:U.mobileNumber,tenantId:u,userType:$()},t=function(){if(!s)return Promise.resolve(ee({otp:d({},e,A)})).then(function(){});var t=function(){if(s)return Promise.resolve(ee({otp:d({},e,M)})).then(function(){})}();return t&&t.then?t.then(function(){}):void 0}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(I(function(){x(!0),Z(!1);var e=U.mobileNumber,t=U.otp,n=U.name;return function(){if(s){var r={username:e,password:t,tenantId:u,userType:$()};return Promise.resolve(Digit.UserService.authenticate(r)).then(function(e){var t,n,r,i=e.UserRequest,l=f(e,L);if(null!==(t=v.state)&&void 0!==t&&t.role){var a=i.roles.find(function(e){return e.code===v.state.role});if(!a||!a.code)return O(m("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(function(){return g.replace("/digit-ui/citizen")},5e3)}null!==(n=window)&&void 0!==n&&null!==(r=n.globalConfigs)&&void 0!==r&&r.getConfig("ENABLE_SINGLEINSTANCE")&&(i.tenantId=Digit.ULBService.getStateId()),h(d({info:i},l))})}var i=function(){if(!s)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:u},u)).then(function(e){var t,n,r=e.UserRequest,i=f(e,R);null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(r.tenantId=Digit.ULBService.getStateId()),h(d({info:r},i))})}();if(i&&i.then)return i.then(function(){})}()},function(){Z(!0),x(!1)}))}catch(e){return Promise.reject(e)}},otp:U.otp,error:N,canSubmit:X,t:m})),n.createElement(l.Route,{path:p+"/name"},n.createElement(T,{config:Q[2],onSelect:function(e){try{var t=d({},U,{tenantId:u,userType:$()},e);return B(d({},U,e)),W(!0),Promise.resolve(ee({otp:d({},t,A)})).then(function(e){e[0]?(W(!1),g.replace(p+"/otp",{from:P(v.state,H)})):W(!1)})}catch(e){return Promise.reject(e)}},t:m,isDisabled:z})),b&&n.createElement(o.Toast,{error:!0,label:b,onClose:function(){return O(null)}}))))},k=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"username",error:"ERR_HRMS_INVALID_USER_ID"},{label:"CORE_LOGIN_PASSWORD",type:"password",name:"password",error:"ERR_HRMS_WRONG_PASSWORD"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}];function U(e,t){return e(t={exports:{}},t.exports),t.exports}var B="function"==typeof Symbol&&Symbol.for,F=B?Symbol.for("react.element"):60103,j=B?Symbol.for("react.portal"):60106,V=B?Symbol.for("react.fragment"):60107,H=B?Symbol.for("react.strict_mode"):60108,G=B?Symbol.for("react.profiler"):60114,z=B?Symbol.for("react.provider"):60109,W=B?Symbol.for("react.context"):60110,q=B?Symbol.for("react.async_mode"):60111,X=B?Symbol.for("react.concurrent_mode"):60111,Z=B?Symbol.for("react.forward_ref"):60112,Y=B?Symbol.for("react.suspense"):60113,K=B?Symbol.for("react.suspense_list"):60120,J=B?Symbol.for("react.memo"):60115,Q=B?Symbol.for("react.lazy"):60116,$=B?Symbol.for("react.block"):60121,ee=B?Symbol.for("react.fundamental"):60117,te=B?Symbol.for("react.responder"):60118,ne=B?Symbol.for("react.scope"):60119;function re(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case F:switch(e=e.type){case q:case X:case V:case G:case H:case Y:return e;default:switch(e=e&&e.$$typeof){case W:case Z:case Q:case J:case z:return e;default:return t}}case j:return t}}}function ie(e){return re(e)===X}var le={AsyncMode:q,ConcurrentMode:X,ContextConsumer:W,ContextProvider:z,Element:F,ForwardRef:Z,Fragment:V,Lazy:Q,Memo:J,Portal:j,Profiler:G,StrictMode:H,Suspense:Y,isAsyncMode:function(e){return ie(e)||re(e)===q},isConcurrentMode:ie,isContextConsumer:function(e){return re(e)===W},isContextProvider:function(e){return re(e)===z},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===F},isForwardRef:function(e){return re(e)===Z},isFragment:function(e){return re(e)===V},isLazy:function(e){return re(e)===Q},isMemo:function(e){return re(e)===J},isPortal:function(e){return re(e)===j},isProfiler:function(e){return re(e)===G},isStrictMode:function(e){return re(e)===H},isSuspense:function(e){return re(e)===Y},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===V||e===X||e===G||e===H||e===Y||e===K||"object"==typeof e&&null!==e&&(e.$$typeof===Q||e.$$typeof===J||e.$$typeof===z||e.$$typeof===W||e.$$typeof===Z||e.$$typeof===ee||e.$$typeof===te||e.$$typeof===ne||e.$$typeof===$)},typeOf:re},ae=U(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,l=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var f=e.type;switch(f){case c:case s:case i:case a:case l:case m:return f;default:var g=f&&f.$$typeof;switch(g){case u:case d:case p:case v:case o:return g;default:return t}}case r:return t}}}var b=s,O=u,S=o,N=n,I=d,w=i,_=p,D=v,T=r,L=a,R=l,A=m,M=!1;function P(e){return C(e)===s}t.AsyncMode=c,t.ConcurrentMode=b,t.ContextConsumer=O,t.ContextProvider=S,t.Element=N,t.ForwardRef=I,t.Fragment=w,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=L,t.StrictMode=R,t.Suspense=A,t.isAsyncMode=function(e){return M||(M=!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)||C(e)===c},t.isConcurrentMode=P,t.isContextConsumer=function(e){return C(e)===u},t.isContextProvider=function(e){return C(e)===o},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return C(e)===d},t.isFragment=function(e){return C(e)===i},t.isLazy=function(e){return C(e)===p},t.isMemo=function(e){return C(e)===v},t.isPortal=function(e){return C(e)===r},t.isProfiler=function(e){return C(e)===a},t.isStrictMode=function(e){return C(e)===l},t.isSuspense=function(e){return C(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===l||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===v||e.$$typeof===o||e.$$typeof===u||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=C}()}),oe=U(function(e){e.exports="production"===process.env.NODE_ENV?le:ae}),ue=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;function de(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var me=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 r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=de(e),l=1;l<arguments.length;l++){for(var a in n=Object(arguments[l]))ce.call(n,a)&&(i[a]=n[a]);if(ue){r=ue(n);for(var o=0;o<r.length;o++)se.call(n,r[o])&&(i[r[o]]=n[r[o]])}}return i},fe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ve=Function.call.bind(Object.prototype.hasOwnProperty),pe=function(){};if("production"!==process.env.NODE_ENV){var ge=fe,Ee={},ye=ve;pe=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function he(e,t,n,r,i){if("production"!==process.env.NODE_ENV)for(var l in e)if(ye(e,l)){var a;try{if("function"!=typeof e[l]){var o=Error((r||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw o.name="Invariant Violation",o}a=e[l](t,l,r,n,null,ge)}catch(e){a=e}if(!a||a instanceof Error||pe((r||"React class")+": type specification of "+n+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in Ee)){Ee[a.message]=!0;var u=i?i():"";pe("Failed "+n+" type: "+a.message+(null!=u?u:""))}}}he.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Ee={})};var Ce=he,be=function(){};function Oe(){return null}function Se(){}function Ne(){}"production"!==process.env.NODE_ENV&&(be=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Ne.resetWarningCache=Se;var Ie=U(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:o("array"),bigint:o("bigint"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),symbol:o("symbol"),any:a(Oe),arrayOf:function(e){return a(function(t,n,r,i,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var o=t[n];if(!Array.isArray(o))return new l("Invalid "+i+" `"+a+"` of type `"+s(o)+"` supplied to `"+r+"`, expected an array.");for(var u=0;u<o.length;u++){var c=e(o,u,r,i,a+"["+u+"]",fe);if(c instanceof Error)return c}return null})},element:a(function(t,n,r,i,a){var o=t[n];return e(o)?null:new l("Invalid "+i+" `"+a+"` of type `"+s(o)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,r,i){var a=e[t];return oe.isValidElementType(a)?null:new l("Invalid "+r+" `"+i+"` of type `"+s(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,r,i,a){var o;return t[n]instanceof e?null:new l("Invalid "+i+" `"+a+"` of type `"+((o=t[n]).constructor&&o.constructor.name?o.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,r,i){return c(e[t])?null:new l("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,r,i,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var o=t[n],u=s(o);if("object"!==u)return new l("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var c in o)if(ve(o,c)){var d=e(o,c,r,i,a+"."+c,fe);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&be(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."),Oe;function t(t,n,r,a,o){for(var u=t[n],c=0;c<e.length;c++)if(i(u,e[c]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new l("Invalid "+a+" `"+o+"` of value `"+String(u)+"` supplied to `"+r+"`, expected one of "+s+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&be("Invalid argument supplied to oneOfType, expected an instance of array."),Oe;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return be("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),Oe}return a(function(t,n,r,i,a){for(var o=[],u=0;u<e.length;u++){var c=(0,e[u])(t,n,r,i,a,fe);if(null==c)return null;c.data&&ve(c.data,"expectedType")&&o.push(c.data.expectedType)}return new l("Invalid "+i+" `"+a+"` supplied to `"+r+"`"+(o.length>0?", expected one of type ["+o.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,r,i,a){var o=t[n],c=s(o);if("object"!==c)return new l("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var m in e){var f=e[m];if("function"!=typeof f)return u(r,i,a,m,d(f));var v=f(o,m,r,i,a+"."+m,fe);if(v)return v}return null})},exact:function(e){return a(function(t,n,r,i,a){var o=t[n],c=s(o);if("object"!==c)return new l("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var m=me({},t[n],e);for(var f in m){var v=e[f];if(ve(e,f)&&"function"!=typeof v)return u(r,i,a,f,d(v));if(!v)return new l("Invalid "+i+" `"+a+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=v(o,f,r,i,a+"."+f,fe);if(p)return p}return null})}};function i(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function l(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,r,i,a,o,u){if(i=i||"<<anonymous>>",o=o||r,u!==fe){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[r]?t?new l(null===n[r]?"The "+a+" `"+o+"` is marked as required in `"+i+"`, but its value is `null`.":"The "+a+" `"+o+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(n,r,i,a,o)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e){return a(function(t,n,r,i,a,o){var u=t[n];return s(u)!==e?new l("Invalid "+i+" `"+a+"` of type `"+d(u)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,r,i){return new l((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}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 r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var i,l=r.call(t);if(r!==t.entries){for(;!(i=l.next()).done;)if(!c(i.value))return!1}else for(;!(i=l.next()).done;){var a=i.value;if(a&&!c(a[1]))return!1}return!0;default:return!1}}function s(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=s(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 l.prototype=Error.prototype,r.checkPropTypes=Ce,r.resetWarningCache=Ce.resetWarningCache,r.PropTypes=r,r}(oe.isElement):function(){function e(e,t,n,r,i,l){if(l!==fe){var a=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 a.name="Invariant Violation",a}}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:Ne,resetWarningCache:Se};return n.PropTypes=n,n}()}),we=function(e){return n.createElement("div",{className:"banner banner-container"},e.children)},_e=function(){var e=Digit.Hooks.useStore.getInitData(),t=e.isLoading,r=(e.data||{}).stateInfo,i=a.useTranslation().t;return t?n.createElement(o.Loader,null):n.createElement("div",{className:"bannerHeader"},n.createElement("img",{className:"bannerLogo",src:null==r?void 0:r.logoUrl}),n.createElement("p",null,i("TENANT_TENANTS_"+(null==r?void 0:r.code.toUpperCase()))))},De=["UserRequest"],Te=function(e){var r,i,a,u=e.config,c=e.t,s=e.isDisabled,m=Digit.Hooks.useTenants(),v=m.data,p=m.isLoading,g=Digit.Hooks.useStore.getInitData().isLoading,E=t.useState(null),y=E[0],h=E[1],C=t.useState(null),b=C[0],O=C[1],S=t.useState(!1),N=S[0],w=S[1],_=l.useHistory();t.useEffect(function(){var e,t,n,r,i,l,a,o,u,c,s,d,m,f,v,p,g;if(y){Digit.SessionStorage.set("citizen.userRequestObject",y);var E,h,C,b,O=null==y||null===(e=y.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(function(e){return e.tenantId===Digit.SessionStorage.get("Employee.tenantId")});(null==y||null===(n=y.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.length)>0&&(y.info.roles=O),Digit.UserService.setUser(y),E=null==y?void 0:y.info,h=null==y?void 0:y.access_token,b=(null===(C=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===C?void 0:C.value)||"en_IN",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",b),localStorage.setItem("Employee.locale",b),localStorage.setItem("token",h),localStorage.setItem("Employee.token",h),localStorage.setItem("user-info",JSON.stringify(E)),localStorage.setItem("Employee.user-info",JSON.stringify(E));var S,N,I,w,D="/digit-ui/employee";null!==(i=window)&&void 0!==i&&null!==(l=i.location)&&void 0!==l&&null!==(a=l.href)&&void 0!==a&&a.includes("from=")&&(D=decodeURIComponent(null===(S=window)||void 0===S||null===(N=S.location)||void 0===N||null===(I=N.href)||void 0===I||null===(w=I.split("from="))||void 0===w?void 0:w[1])||"/digit-ui/employee"),null!=y&&null!==(o=y.info)&&void 0!==o&&o.roles&&(null==y||null===(u=y.info)||void 0===u||null===(c=u.roles)||void 0===c?void 0:c.length)>0&&null!=y&&null!==(s=y.info)&&void 0!==s&&null!==(d=s.roles)&&void 0!==d&&d.every(function(e){return"NATADMIN"===e.code})&&(D="/digit-ui/employee/dss/landing/NURT_DASHBOARD"),null!=y&&null!==(m=y.info)&&void 0!==m&&m.roles&&(null==y||null===(f=y.info)||void 0===f||null===(v=f.roles)||void 0===v?void 0:v.length)>0&&null!=y&&null!==(p=y.info)&&void 0!==p&&null!==(g=p.roles)&&void 0!==g&&g.every(function(e){return"STADMIN"===e.code})&&(D="/digit-ui/employee/dss/landing/home"),_.replace(D)}},[y]);var D=function(){O(null)},T=u.inputs,L=T[0],R=T[1],A=T[2],M=[{body:[{label:c(L.label),type:L.type,populators:{name:L.name},isMandatory:!0},{label:c(R.label),type:R.type,populators:{name:R.name},isMandatory:!0},{label:c(A.label),type:A.type,populators:{name:A.name,customProps:{},component:function(e,t){return n.createElement(o.Dropdown,d({option:v,className:"login-city-dd",optionKey:"i18nKey",select:function(t){e.onChange(t)},t:c},t))}},isMandatory:!0}]}];return p||g?n.createElement(o.Loader,null):n.createElement(we,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(o.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(o.FormComposer,{onSubmit:function(e){try{var t=function(){w(!1)};if(!e.city)return alert("Please Select City!"),Promise.resolve();w(!0);var n=d({},e,{userType:"EMPLOYEE"});n.tenantId=e.city.code,delete n.city;var r=I(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t=e.UserRequest,n=f(e,De);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),h(d({info:t},n))})},function(e){var t,n;O((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"Invalid login credentials!"),setTimeout(D,5e3)});return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},isDisabled:s||N,noBoxShadow:!0,inline:!0,submitInForm:!0,config:M,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:function(){_.push("/digit-ui/employee/user/forgot-password")},heading:u.texts.header,headingStyle:{textAlign:"center"},cardStyle:{margin:"auto",minWidth:"408px"},className:"loginFormStyleEmployee",buttonStyle:{maxWidth:"100%",width:"100%"}},n.createElement(_e,null)),b&&n.createElement(o.Toast,{error:!0,label:c(b),onClose:D}),n.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(a=i.getConfig)||void 0===a?void 0:a.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};Te.propTypes={loginParams:Ie.any},Te.defaultProps={loginParams:null};var Le=function(){var e=a.useTranslation().t,r=l.useRouteMatch().path,i=t.useMemo(function(){return k.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[k])});return n.createElement(l.Switch,null,n.createElement(l.Route,{path:""+r,exact:!0},n.createElement(Te,{config:i[0],t:e})))},Re=[{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"}]}],Ae=function(e){var r,i,a,u=e.config,c=e.t,s=t.useState(null)[0],m=Digit.Hooks.useQueryParams(),f=m.mobile_number,v=m.tenantId,p=l.useHistory(),g=t.useState(""),E=g[0],y=g[1],h=t.useState(!0)[0],C=t.useState(null),b=C[0],O=C[1],S=function(){return Digit.UserService.getType()};t.useEffect(function(){var e;if(s){Digit.UserService.setUser(s);var t=(null===(e=location.state)||void 0===e?void 0:e.from)||"/digit-ui/employee";p.replace(t)}else Digit.UserService.setType("employee")},[s]);var N=function(){O(null)},w=u.inputs,_=w[0],T=w[1],L=w[2],R=[{body:[{label:c(_.label),type:_.type,populators:{name:_.name},isMandatory:!0},{label:c(T.label),type:T.type,populators:{name:T.name},isMandatory:!0},{label:c(L.label),type:L.type,populators:{name:L.name},isMandatory:!0}]}];return n.createElement(we,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(o.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(o.FormComposer,{onSubmit:function(e){try{return Promise.resolve(I(function(){if(e.newPassword!==e.confirmPassword)return O(c("ERR_PASSWORD_DO_NOT_MATCH"));var t=d({},e,{otpReference:E,tenantId:v,type:S().toUpperCase()});return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){p.replace("/digit-ui/employee/user/login")})},function(e){var t,n,r,i,l;O((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(l=i[0])||void 0===l?void 0:l.message)||c("ES_SOMETHING_WRONG")),setTimeout(N,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:R,label:u.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},n.createElement(_e,null),n.createElement(o.CardSubHeader,{style:{textAlign:"center"}}," ",u.texts.header," "),n.createElement(o.CardText,null,c("CS_LOGIN_OTP_TEXT")+" ",n.createElement("b",null," ",""+c("+ 91 - ")," ",f)),n.createElement(D,{t:c,userType:"employee",otp:E,onOtpChange:y,error:h,onResend:function(){try{var e=function(){setTimeout(N,5e3)},t={otp:{mobileNumber:f,userType:S().toUpperCase(),type:"passwordreset",tenantId:v}},n=I(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){O(c("ES_OTP_RESEND"))})},function(e){var t,n;O((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||c("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),b&&n.createElement(o.Toast,{error:!0,label:c(b),onClose:N}),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(a=i.getConfig)||void 0===a?void 0:a.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};Ae.propTypes={loginParams:Ie.any},Ae.defaultProps={loginParams:null};var Me=function(){var e=a.useTranslation().t,r=l.useRouteMatch().path,i=t.useMemo(function(){return Re.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Re])});return n.createElement(l.Switch,null,n.createElement(l.Route,{path:""+r,exact:!0},n.createElement(Ae,{config:i[0],t:e})))},Pe=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],xe=function(e){var r,i,a,u=e.config,c=e.t,s=Digit.Hooks.useTenants(),m=s.data,f=s.isLoading,v=t.useState(null)[0],p=l.useHistory(),g=t.useState(null),E=g[0],y=g[1];t.useEffect(function(){var e;if(v){Digit.UserService.setUser(v);var t=(null===(e=location.state)||void 0===e?void 0:e.from)||"/digit-ui/employee";p.replace(t)}else Digit.UserService.setType("employee")},[v]);var h=function(){y(null)},C=u.inputs,b=C[0],O=C[1],S=[{body:[{label:c(b.label),type:b.type,populators:{name:b.name,componentInFront:"+91"},isMandatory:!0},{label:c(O.label),type:O.type,populators:{name:O.name,customProps:{},component:function(e,t){return n.createElement(o.Dropdown,d({option:m,optionKey:"name",id:O.name,className:"login-city-dd",select:function(t){e.onChange(t)}},t))}},isMandatory:!0}]}];return f?n.createElement(o.Loader,null):n.createElement(we,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(o.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(o.FormComposer,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();var t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=I(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){p.push("/digit-ui/employee/user/change-password?mobile_number="+e.mobileNumber+"&tenantId="+e.city.code)})},function(e){var t,n,r,i,l;y((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(l=i[0])||void 0===l?void 0:l.message)||"Invalid login credentials!"),setTimeout(h,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:S,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:function(){p.replace("/digit-ui/employee/login")},heading:u.texts.header,description:u.texts.description,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},n.createElement(_e,null)),E&&n.createElement(o.Toast,{error:!0,label:c(E),onClose:h}),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(a=i.getConfig)||void 0===a?void 0:a.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};xe.propTypes={loginParams:Ie.any},xe.defaultProps={loginParams:null};var ke=function(){var e=a.useTranslation().t,r=l.useRouteMatch().path,i=t.useMemo(function(){return Pe.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Pe])});return n.createElement(l.Switch,null,n.createElement(l.Route,{path:""+r,exact:!0},n.createElement(xe,{config:i[0],t:e})))},Ue=function(){var e,r,i,u=Digit.Hooks.useStore.getInitData(),c=u.data,s=u.isLoading,d=a.useTranslation().t,m=l.useHistory(),f=c||{},v=f.languages,p=f.stateInfo,g=Digit.StoreData.getCurrentLanguage(),E=t.useState(g),y=E[0],h=E[1];return s?null:n.createElement(we,null,n.createElement(o.Card,{className:"bannerCard removeBottomMargin"},n.createElement("div",{className:"bannerHeader"},n.createElement("img",{className:"bannerLogo",src:null==p?void 0:p.logoUrl,alt:"Digit"}),n.createElement("p",null,d("TENANT_TENANTS_"+(null==p?void 0:p.code.toUpperCase())))),n.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},v.map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(o.CustomButton,{selected:e.value===y,text:e.label,onClick:function(){return function(e){h(e.value),Digit.LocalizationService.changeLanguage(e.value,p.code)}(e)}}))})),n.createElement(o.SubmitBar,{style:{width:"100%"},label:d("CORE_COMMON_CONTINUE"),onSubmit:function(e){m.push("/digit-ui/employee/user/login")}})),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(r=e.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))},Be=function(e,t){return t.filter(function(t){var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,function(e){return e.code}).includes(t.code)})},Fe=function(e){var t=e.stateCode,r=e.userType,i=e.modules,a=e.appTenants,o=(Digit,l.useRouteMatch().path),u=l.useLocation(),c=Digit.UserService.getUser();if(!c||null==c||!c.access_token||null==c||!c.info)return n.createElement(l.Redirect,{to:{pathname:"/digit-ui/employee/user/login",state:{from:u.pathname+u.search}}});var s=i.map(function(e,i){var c=e.code,s=e.tenants,d=Digit.ComponentRegistryService.getComponent(c+"Module");return n.createElement(l.Route,{key:i,path:o+"/"+c.toLowerCase()},d?n.createElement(d,{stateCode:t,moduleCode:c,userType:r,tenants:Be(s,a)}):n.createElement(l.Redirect,{to:{pathname:"/digit-ui/employee/user/error?type=notfound",state:{from:u.pathname+u.search}}}))});return n.createElement("div",{className:"ground-container"},n.createElement(l.Switch,null,s,n.createElement(l.Route,{path:o+"/login"},n.createElement(l.Redirect,{to:{pathname:"/digit-ui/employee/user/login",state:{from:u.pathname+u.search}}})),n.createElement(l.Route,{path:o+"/forgot-password"},n.createElement(ke,null)),n.createElement(l.Route,{path:o+"/change-password"},n.createElement(Me,null)),n.createElement(l.Route,null,n.createElement(h,{userType:r,modules:i}))))},je={error:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/PageNotFound.png",infoMessage:"CORE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},Ve=function(e){var t=Digit.Hooks.useQueryParams().type,r=je[void 0===t?"error":t],i=a.useTranslation().t;return n.createElement("div",{className:"error-boundary"},n.createElement("div",{className:"error-container"},n.createElement("img",{src:r.imgUrl,alt:"error"}),n.createElement("h1",null,i(r.infoMessage)),n.createElement("button",{onClick:function(){e.goToHome()}},i(r.buttonInfo))))},He=function(){var e="employee"===Digit.UserService.getType()?"/digit-ui/employee/user/error":"/digit-ui/citizen/error";return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=e),n.createElement("span",null)},Ge=function(e){var t,r;function i(t){var n;return(n=e.call(this,t)||this).state={error:null,errorStack:null,hasError:!1},n}r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,m(t,r),i.getDerivedStateFromError=function(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack}};var l=i.prototype;return l.componentDidCatch=function(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})},l.render=function(){return this.state.hasError?n.createElement("div",{className:"error-boundary"},n.createElement(He,null),n.createElement(Ve,{initData:this.props.initData})):this.props.children},i}(n.Component),ze=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(r=e)&&void 0!==r&&r.includes(t);){var r,i;e=null===(i=e)||void 0===i?void 0:i.replace(t,n)}return e},We=function(e){var r,i=t.useState(null),a=i[0],u=i[1],c=t.useState([]),s=c[0],d=c[1],m=(t.useState([]),l.useHistory());return t.useEffect(function(){var t,n,r=Digit.SessionStorage.get("citizen.userRequestObject"),i=[],l=[];null==r||null===(t=r.info)||void 0===t||null===(n=t.roles)||void 0===n||n.forEach(function(e){return i.push(e.tenantId)});var a=i.filter(function(e,t,n){return n.indexOf(e)===t});null==a||a.forEach(function(t){var n;l.push({label:null==e?void 0:e.t("TENANT_TENANTS_"+(null===(n=ze(t,".","_"))||void 0===n?void 0:n.toUpperCase())),value:t})}),null==l||l.filter(function(e){return e.value==Digit.SessionStorage.get("Employee.tenantId")}),d(l)},[a]),n.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},n.createElement(o.Dropdown,{option:s,selected:s.find(function(e){return e.value===(null==a?void 0:a.value)}),optionKey:"label",select:function(e){var t,n,r,i=Digit.SessionStorage.get("citizen.userRequestObject"),l=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.filter(function(t){return t.tenantId===e.value});if((null==l?void 0:l.length)>0&&(i.info.roles=l,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),u(e),window.location.href.includes("/digit-ui/employee/")){var a,o=(null===(a=location.state)||void 0===a?void 0:a.from)||"/digit-ui/employee";m.replace(o)}window.location.reload()},freeze:!0,customSelector:n.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(r=ze(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===r?void 0:r.toUpperCase())))}))},qe=function(e){var r=e.dropdown||!1,i=Digit.Hooks.useStore.getInitData(),l=i.isLoading,a=i.data||{},u=a.languages,c=a.stateInfo,s=Digit.StoreData.getCurrentLanguage(),d=t.useState(s),m=d[0],f=d[1],v=function(e){f(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)};return l?null:r?n.createElement("div",null,n.createElement(o.Dropdown,{option:u,selected:u.find(function(e){return e.value===s}),optionKey:"label",select:v,freeze:!0,customSelector:n.createElement("label",{className:"cp"},u.find(function(e){return e.value===m}).label)})):n.createElement(n.Fragment,null,n.createElement("div",{style:{marginBottom:"5px"}},"Language"),n.createElement("div",{className:"language-selector"},u.map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(o.CustomButton,{selected:e.value===m,text:e.label,onClick:function(){return v(e)}}))})))},Xe=function(e){var t,r;return n.createElement("span",{className:"user-img-txt",onClick:e.toggleMenu,title:e.name},null==e||null===(t=e.name)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.toUpperCase())},Ze=function(e){var t,r,i,a,u,c,s,d=e.t,m=e.stateInfo,f=e.toggleSidebar,v=e.handleLogout,p=e.userDetails,g=e.CITIZEN,E=e.cityDetails,y=e.mobileView,h=e.userOptions,C=e.handleUserDropdownSelection,b=e.logoUrl,O=e.showLanguageChange,S=void 0===O||O,N=e.setSideBarScrollTop,I=n.useState(null),w=I[0],_=I[1];n.useEffect(function(){try{var e,t=Digit.ULBService.getCurrentTenantId(),n=null==p||null===(e=p.info)||void 0===e?void 0:e.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");_(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==w,null==p||null===(t=p.info)||void 0===t?void 0:t.uuid]);var D,T,L,R,A,M,P=Digit.ULBService.getCitizenCurrentTenant(!0),x=l.useHistory(),k=l.useLocation().pathname,U=Digit.Hooks.useNotificationCount({tenantId:P,config:{enabled:"EMPLOYEE"!==(null===(D=Digit.UserService)||void 0===D||null===(T=D.getUser())||void 0===T||null===(L=T.info)||void 0===L?void 0:L.type)&&"CITIZEN"===(null===(R=Digit.UserService)||void 0===R||null===(A=R.getUser())||void 0===A||null===(M=A.info)||void 0===M?void 0:M.type)&&!!P}}),B=U.data,F=(void 0===B?{}:B).unreadCount;if(g)return n.createElement("div",null,n.createElement(o.TopBar,{img:null==m?void 0:m.logoUrlWhite,isMobile:!0,toggleSidebar:function(){Digit.clikOusideFired?Digit.clikOusideFired=!1:(f(!0),N(!0))},logoUrl:null==m?void 0:m.logoUrlWhite,onLogout:v,userDetails:p,notificationCount:F<99?F:99,notificationCountLoaded:U.isSuccess,cityOfCitizenShownBesideLogo:d(P),onNotificationIconClick:function(){x.push("/digit-ui/citizen/engagement/notifications")},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:function(e){var t,n;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&["/digit-ui/citizen/select-language","/digit-ui/citizen/select-location"].includes(e)}(k),changeLanguage:y?null:n.createElement(qe,{dropdown:!0})}));var j=!(null==p||!p.access_token);return n.createElement("div",{className:"topbar"},y?n.createElement(o.Hamburger,{handleClick:f,color:"#9E9E9E"}):null,n.createElement("img",{className:"city",src:j?null==E?void 0:E.logoId:null==m?void 0:m.statelogo}),n.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},j&&(null!=E&&null!==(r=E.city)&&void 0!==r&&r.ulbGrade?n.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d(null==E?void 0:E.i18nKey).toUpperCase()," ",d("ULBGRADE_"+(null==E||null===(i=E.city)||void 0===i?void 0:i.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):n.createElement("img",{className:"state",src:b})),!j&&n.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d("MYCITY_"+(null==m||null===(a=m.code)||void 0===a?void 0:a.toUpperCase())+"_LABEL")," ",d("MYCITY_STATECODE_LABEL")),!y&&n.createElement("div",{className:y?"right":"flex-right right w-80 column-gap-15",style:j?{}:{width:"80%"}},n.createElement("div",{className:"left"},!window.location.href.includes("employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&n.createElement(We,{dropdown:!0,t:d})),n.createElement("div",{className:"left"},S&&n.createElement(qe,{dropdown:!0})),(null==p?void 0:p.access_token)&&n.createElement("div",{className:"left"},n.createElement(o.Dropdown,{option:h,optionKey:"name",select:C,showArrow:!0,freeze:!0,style:y?{right:0}:{},optionCardStyles:{overflow:"revert"},customSelector:null==w?n.createElement(Xe,{name:(null==p||null===(u=p.info)||void 0===u?void 0:u.name)||(null==p||null===(c=p.info)||void 0===c||null===(s=c.userInfo)||void 0===s?void 0:s.name)||"Employee"}):n.createElement("img",{src:w,style:{height:"48px",width:"48px",borderRadius:"50%"}})})),n.createElement("img",{className:"state",src:b}))))},Ye=function(e,t,r,i,l,a){var o,u,c=(null==l||null===(o=l.tenants.filter(function(e){return e.code===a})[0])||void 0===o?void 0:o.contactNumber)||(null==l||null===(u=l.tenants[0])||void 0===u?void 0:u.contactNumber);return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:i?"/digit-ui/employee":"/digit-ui/citizen",icon:"HomeIcon",populators:{onClick:t}},{type:"component",element:"LANGUAGE",action:n.createElement(qe,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:"LoginIcon",populators:{onClick:r}},{id:"help-line",text:n.createElement(n.Fragment,null,e("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+c},c)))),element:"Helpline",icon:"Phone"}]},Ke=function(e){return n.createElement("h1",{className:"heading-m"},e.label)},Je=function(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))},Qe=function(e){return n.createElement("div",{onClick:null==e?void 0:e.onClick,style:null!=e&&e.isMobileView?{padding:5}:null},null!=e&&e.isMobileView?n.createElement(o.CloseSvg,null):n.createElement("div",{className:"icon-bg-secondary",style:{backgroundColor:"#505A5F"}}," ",n.createElement(Je,null)," "))},$e=function(e){var t=e.onSelect,r=e.onCancel,i=e.onDismiss,l=a.useTranslation().t,u=n.useState(window.innerWidth<=780),c=u[0],s=u[1],d=function(){window.innerWidth<=780?c||s(!0):c&&s(!1)};return n.useEffect(function(){return window.addEventListener("resize",function(){d()}),function(){window.addEventListener("resize",function(){d()})}}),c?n.createElement(o.Modal,{popupStyles:{height:"174px",maxHeight:"174px",width:"324px",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},popupModuleActionBarStyles:{display:"flex",flex:1,justifyContent:"flex-start",width:"100%",position:"absolute",left:0,bottom:0,padding:"18px"},style:{flex:1},popupModuleMianStyles:{padding:"18px"},headerBarMain:n.createElement(Ke,{label:l("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:n.createElement(Qe,{onClick:i,isMobileView:c}),actionCancelLabel:l("TL_COMMON_NO"),actionCancelOnSubmit:r,actionSaveLabel:l("TL_COMMON_YES"),actionSaveOnSubmit:t,formId:"modal-action"},n.createElement("div",null,n.createElement(o.CardText,{style:{margin:0}},l("CORE_LOGOUT_MOBILE_CONFIRMATION_MESSAGE")+" "))):n.createElement(o.Modal,{popupModuleMianStyles:{paddingTop:"30px"},headerBarMain:n.createElement(Ke,{label:l("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:n.createElement(Qe,{onClick:i,isMobileView:!1}),actionCancelLabel:l("CORE_LOGOUT_CANCEL"),actionCancelOnSubmit:r,actionSaveLabel:l("CORE_LOGOUT_WEB_YES"),actionSaveOnSubmit:t,formId:"modal-action"},n.createElement("div",null,n.createElement(o.CardText,{style:{marginBottom:"54px",marginLeft:"8px",marginRight:"8px"}},l("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",n.createElement("strong",null,l("CORE_LOGOUT_MESSAGE"),"?"))))},et=function(e){var t=e.info,r=e.t;return n.createElement("div",{className:"profile-section"},n.createElement("div",{className:"imageloader imageloader-loaded"},n.createElement("img",{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,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"})),n.createElement("div",{id:"profile-name",className:"label-container name-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),n.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&n.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",t.emailId," ")),n.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")&&n.createElement(We,{t:r,mobileView:!0}))},tt={CommonPTIcon:n.createElement(o.PTIcon,{className:"icon"}),OBPSIcon:n.createElement(o.OBPSIcon,{className:"icon"}),propertyIcon:n.createElement(o.PropertyHouse,{className:"icon"}),TLIcon:n.createElement(o.CaseIcon,{className:"icon"}),PGRIcon:n.createElement(o.PGRIcon,{className:"icon"}),FSMIcon:n.createElement(o.FSMIcon,{className:"icon"}),WSIcon:n.createElement(o.WSICon,{className:"icon"}),MCollectIcon:n.createElement(o.MCollectIcon,{className:"icon"}),BillsIcon:n.createElement(o.CollectionIcon,{className:"icon"}),BirthIcon:n.createElement(o.BirthIcon,{className:"icon"}),DeathIcon:n.createElement(o.DeathIcon,{className:"icon"}),FirenocIcon:n.createElement(o.FirenocIcon,{className:"icon"}),HomeIcon:n.createElement(o.HomeIcon,{className:"icon"}),EditPencilIcon:n.createElement(o.EditPencilIcon,{className:"icon"}),LogoutIcon:n.createElement(o.LogoutIcon,{className:"icon"}),Phone:n.createElement(o.Phone,{className:"icon"}),LoginIcon:n.createElement(o.LoginIcon,{className:"icon"})},nt=function(e){var r,i,u,c,s,m=e.linkData,f=e.islinkDataLoading,v=a.useTranslation().t,p=l.useHistory(),g=l.useLocation().pathname,E=Digit.Hooks.useStore.getInitData(),y=E.data,h=E.isFetched,C=(y||{}).stateInfo,b=Digit.UserService.getUser(),O=window.Digit.Utils.browser.isMobile(),S=t.useState(!1)[0],N=t.useState(!1)[1],I=t.useState(!1),w=I[0],_=I[1],D=function(){_(!1)};if(f||!h)return n.createElement(o.Loader,null);var T=function(){p.push("/digit-ui/citizen/user/profile")},L=Digit.ULBService.getCitizenCurrentTenant(),R=(null==y||null===(r=y.tenants.filter(function(e){return e.code===L})[0])||void 0===r?void 0:r.contactNumber)||(null==y||null===(i=y.tenants[0])||void 0===i?void 0:i.contactNumber),A=[].concat(Ye(v,T,function(){p.push("/digit-ui/citizen/login")},S,y,L));A=A.filter(function(e){return"LANGUAGE"!==e.element});var M,P=function(e){var t,r,i,a=e.item,o=(null==a?void 0:a.icon)||(null===(t=a.icon)||void 0===t||null===(r=t.type)||void 0===r?void 0:r.name),u=o?tt[o]:tt.BillsIcon;i="component"===a.type?a.action:a.text;var c=function(){return n.createElement("span",d({className:"menu-item"},a.populators),u,n.createElement("div",{className:"menu-label"},i))};return"external-link"===a.type?n.createElement("a",{href:a.link},n.createElement(c,null)):"link"===a.type?n.createElement(l.Link,{to:null==a?void 0:a.link},n.createElement(c,null)):n.createElement(c,null)};return h&&b&&b.access_token&&(M=n.createElement(et,{info:null==b?void 0:b.info,stateName:null==C?void 0:C.name,t:v}),A=A.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)&&"help-line"!==(null==e?void 0:e.id)}),A=[].concat(A,[{text:v("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:T}},{text:v("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:function(){N(!1),_(!0)}}},{text:n.createElement(n.Fragment,null,v("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+R},R)))),element:"Helpline",icon:"Phone"}])),null===(u=Object.keys(m))||void 0===u||null===(c=u.sort(function(e,t){return t.localeCompare(e)}))||void 0===c||c.map(function(e){var t,n,r,i,l;"digit-ui-links"===(null===(t=m[e][0])||void 0===t?void 0:t.sidebar)&&A.splice(1,0,{type:null!==(n=m[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes("digit-ui")?"link":"external-link",text:v("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:m[e],icon:null===(i=m[e][0])||void 0===i?void 0:i.leftIcon,link:null===(l=m[e][0])||void 0===l?void 0:l.sidebarURL})}),n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),n.createElement("div",{style:{display:"flex",flexDirection:"column",height:O?"calc(100vh - 56px)":"auto",zIndex:"99"}},M,n.createElement("div",{className:"drawer-desktop"},null===(s=A)||void 0===s?void 0:s.map(function(e,t){return n.createElement("div",{className:"sidebar-list "+(g===(null==e?void 0:e.link)||g===(null==e?void 0:e.sidebarURL)?"active":""),key:t},n.createElement(P,{item:e}))}))),n.createElement("div",null,w&&n.createElement($e,{onSelect:function(){Digit.UserService.logout(),_(!1)},onCancel:D,onDismiss:D}))))},rt=function(e){var t=e.info,r=e.t,i=n.useState(null),l=i[0],a=i[1];return n.useEffect(function(){try{var e=Digit.ULBService.getCurrentTenantId(),n=null==t?void 0:t.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(e,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");a(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==l]),n.createElement("div",{className:"profile-section"},n.createElement("div",{className:"imageloader imageloader-loaded"},n.createElement("img",{className:"img-responsive img-circle img-Profile",src:l||"data:image/png;base64,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",style:{objectFit:"cover",objectPosition:"center"}})),n.createElement("div",{id:"profile-name",className:"label-container name-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),n.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&n.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",t.emailId," ")),n.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")&&n.createElement(We,{t:r,mobileView:!0}))},it=function(){var e,t,r;return n.createElement("div",{className:"digit-footer",style:{marginBottom:0}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(r=t.getConfig)||void 0===r?void 0:r.call(t,"DIGIT_FOOTER"),style:{cursor:"pointer"},onClick:function(){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()}})," ")},lt=function(e){var r,i,u=e.isOpen,c=e.isMobile,s=void 0!==c&&c,m=e.toggleSidebar,f=e.onLogout,v=e.isEmployee,p=void 0!==v&&v,g=e.linkData,E=e.islinkDataLoading,y=e.isSideBarScroll,h=Digit.Hooks.useStore.getInitData(),C=h.data,b=h.isFetched,O=(C||{}).stateInfo,S=Digit.UserService.getUser(),N=t.useState(""),I=N[0],w=N[1],_=a.useTranslation().t,D=l.useHistory(),T=function(){Digit.clikOusideFired=!0,m(!1)},L=Digit.Hooks.useAccessControl(),R=L.isLoading,A=L.data,M=Digit.ULBService.getCitizenCurrentTenant();if(E||R||!b)return n.createElement(o.Loader,null);var P,x=(null==C||null===(r=C.tenants.filter(function(e){return e.code===M})[0])||void 0===r?void 0:r.contactNumber)||(null==C||null===(i=C.tenants[0])||void 0===i?void 0:i.contactNumber),k=[].concat(Ye(_,T,function(){D.push("/digit-ui/citizen/login"),T()},p,C,M));b&&S&&S.access_token&&(P=n.createElement(rt,{info:null==S?void 0:S.info,stateName:null==O?void 0:O.name,t:_}),k=k.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)&&"help-line"!==(null==e?void 0:e.id)}),k=[].concat(k,[{text:_("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:function(){D.push(p?"/digit-ui/employee/user/profile":"/digit-ui/citizen/user/profile"),T()}}},{text:_("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:f}},{text:n.createElement(n.Fragment,null,_("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+x},x)))),element:"Helpline",icon:"Phone"}]));var U={};if(p){var B;null==A||A.actions.filter(function(e){return"url"===e.url&&"Home"!==e.displayName}).forEach(function(e){var t;if(""==I&&""!==e.path){var n=e.path.split(".")[0];"TradeLicense"===n&&(n="Trade License"),U[n]?U[n].push(e):U[n]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(I.toLowerCase())){var r=e.path.split(".")[0];"TradeLicense"===r&&(r="Trade License"),U[r]?U[r].push(e):U[r]=[e]}});for(var F=Object.keys(U),j=function(e){var t,n,r,i,l,a,o,u,c,s,m,f=null===(t=U[F[e]][0])||void 0===t||null===(n=t.displayName)||void 0===n||null===(r=n.toUpperCase())||void 0===r?void 0:r.replace(/[ -]/g,"_"),v=null===(i=F[e])||void 0===i||null===(l=i.toUpperCase())||void 0===l?void 0:l.replace(/[ -]/g,"_");-1===U[F[e]][0].path.indexOf(".")?k.splice(1,0,{type:"link",text:_("ACTION_TEST_"+f),link:null===(a=U[F[e]][0])||void 0===a?void 0:a.navigationURL,icon:null===(o=U[F[e]][0])||void 0===o||null===(u=o.leftIcon)||void 0===u||null===(c=u.split)||void 0===c?void 0:c.call(u,":")[1],populators:{onClick:function(){var t;D.push(null===(t=U[F[e]][0])||void 0===t?void 0:t.navigationURL),T()}}}):k.splice(1,0,{type:"dynamic",moduleName:_("ACTION_TEST_"+v),links:null===(s=U[F[e]])||void 0===s?void 0:s.map(function(e){var t,n;return d({},e,{displayName:_("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===(m=U[F[e]][1])||void 0===m?void 0:m.leftIcon})},V=0;V<F.length;V++)j(V);var H=k.findIndex(function(e){return"HOME"===e.element}),G=k.splice(H,1),z=k.findIndex(function(e){return"LANGUAGE"===e.element}),W=k.splice(z,(null===(B=k)||void 0===B?void 0:B.length)-z);k.sort(function(e,t){return("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==G?void 0:G[0])&&k.splice(0,0,G[0]),k=(null==W?void 0:W.length)>0?k.concat(W):k}else{var q,X;null===(q=Object.keys(g))||void 0===q||null===(X=q.sort(function(e,t){return t.localeCompare(e)}))||void 0===X||X.map(function(e){var t,n,r,i,l;"digit-ui-links"===(null===(t=g[e][0])||void 0===t?void 0:t.sidebar)&&k.splice(1,0,{type:null!==(n=g[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes("digit-ui")?"link":"external-link",text:_("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===(l=g[e][0])||void 0===l?void 0:l.sidebarURL})})}return D.location.pathname.includes("/openlink")&&(P=n.createElement("span",null),k=k.filter(function(e){return"LANGUAGE"===e.element})),s?n.createElement(o.NavBar,{open:u,toggleSidebar:m,profileItem:P,onClose:T,isSideBarScroll:y,menuItems:k,Footer:n.createElement(it,null),isEmployee:p,search:I,setSearch:w}):n.createElement(nt,{logout:f})},at=function(e){var r,i,c,s,d,m,f,v=e.item,p=t.useState(!1),g=p[0],E=p[1],y=l.useLocation().pathname,h=a.useTranslation().t,C={home:n.createElement(o.HomeIcon,null),announcement:n.createElement(o.ComplaintIcon,null),business:n.createElement(o.BPAHomeIcon,null),store:n.createElement(o.PropertyHouse,null),assignment:n.createElement(o.CaseIcon,null),receipt:n.createElement(o.ReceiptIcon,null),"business-center":n.createElement(o.PersonIcon,null),description:n.createElement(o.DocumentIconSolid,null),"water-tap":n.createElement(o.DropIcon,null),"collections-bookmark":n.createElement(o.CollectionsBookmarIcons,null),"insert-chart":n.createElement(o.FinanceChartIcon,null),edcr:n.createElement(o.CollectionIcon,null),collections:n.createElement(o.CollectionIcon,null)},b=C[(null==v||null===(r=v.icon)||void 0===r||null===(i=r.leftIcon)||void 0===i||null===(c=i.split)||void 0===c||null===(s=c.call(i,":"))||void 0===s?void 0:s[1])||(null==v||null===(d=v.leftIcon)||void 0===d||null===(m=d.split)||void 0===m?void 0:m.call(d,":")[1])]||C.collections,O=null==v||null===(f=v.moduleName)||void 0===f?void 0:f.replace(/[ -]/g,"_"),S=h("ACTION_TEST_"+O),N=h((null==S?void 0:S.length)>20?S.substring(0,20)+"...":S);if("single"===v.type){var I,w=window.location.origin;return n.createElement("div",{className:"submenu-container"},n.createElement("div",{className:"sidebar-link "+(y===(null==v?void 0:v.navigationURL)?"active":"")},n.createElement("div",{className:"actions"},b,-1===(null===(I=v.navigationURL)||void 0===I?void 0:I.indexOf("/digit-ui"))?n.createElement("a",{"data-tip":"React-tooltip","data-for":"jk-side-"+O,className:"custom-link",href:w+"/employee/"+v.navigationURL},n.createElement("span",null," ",N," "),(null==N?void 0:N.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+O},h("ACTION_TEST_"+O))):n.createElement(l.Link,{className:"custom-link",to:v.navigationURL},n.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+O},n.createElement("span",null," ",N," "),(null==N?void 0:N.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+O},h("ACTION_TEST_"+O)))))))}return n.createElement(n.Fragment,null,n.createElement("div",{className:"submenu-container"},n.createElement("div",{onClick:v.links&&function(){return E(!g)},className:"sidebar-link"},n.createElement("div",{className:"actions"},b,n.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+O},n.createElement("span",null," ",N," "),(null==N?void 0:N.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+O},h("ACTION_TEST_"+O)))),n.createElement("div",null," ",v.links&&g?n.createElement(o.ArrowVectorDown,null):v.links?n.createElement(o.ArrowForward,null):null," "))),g&&v.links.sort(function(e,t){return e.orderNumber-t.orderNumber}).filter(function(e){return"url"===e.url||""!==e.url}).map(function(e,t){var r,i,a=null==e||null===(r=e.displayName)||void 0===r||null===(i=r.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"),o=h("ACTION_TEST_"+a),c=h((null==o?void 0:o.length)>20?o.substring(0,20)+"...":o);if(-1===e.navigationURL.indexOf("/digit-ui")){var s=window.location.origin;return n.createElement("a",{key:t,className:"dropdown-link "+(y===e.link?"active":""),href:s+"/employee/"+e.navigationURL},n.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},n.createElement("span",null," ",c," "),(null==c?void 0:c.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},h("ACTION_TEST_"+a))))}return n.createElement(l.Link,{to:(null==e?void 0:e.link)||e.navigationURL,key:t,className:"dropdown-link "+(y===(null==e?void 0:e.link)||y===(null==e?void 0:e.navigationURL)?"active":"")},n.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},n.createElement("span",null," ",c," "),(null==c?void 0:c.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},h("ACTION_TEST_"+a))))}))},ot=function(){var e=t.useRef(null),r=Digit.Hooks.useAccessControl(),i=r.isLoading,l=r.data,u=t.useState(""),c=u[0],s=u[1],d=a.useTranslation().t;t.useEffect(function(){if(i)return n.createElement(o.Loader,null);e.current.style.cursor="pointer",m()},[i]);var m=function(){e.current.style.width="55px",e.current.style.overflow="hidden",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="none"}),e.current.querySelectorAll(".actions").forEach(function(e){e.style.padding="0"})},f={};null==l||l.actions.filter(function(e){return"url"===e.url}).forEach(function(e){var t,n,r,i=e.path.split(".")[0];(""==c&&""!==e.path||""!==e.path&&null!==(t=d("ACTION_TEST_"+(null===(n=i)||void 0===n||null===(r=n.toUpperCase())||void 0===r?void 0:r.replace(/[ -]/g,"_"))))&&void 0!==t&&t.toLowerCase().includes(c.toLowerCase()))&&("TradeLicense"===(i=e.path.split(".")[0])&&(i="Trade License"),f[i]?f[i].push(e):f[i]=[e])});var v=[];return i?n.createElement(o.Loader,null):v?n.createElement("div",{className:"sidebar",ref:e,onMouseOver:function(){e.current.style.width="260px",e.current.style.overflow="auto",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="flex"})},onMouseLeave:m},n.createElement("div",{className:"submenu-container"},n.createElement("div",{className:"sidebar-link"},n.createElement("div",{className:"actions search-icon-wrapper"},n.createElement(o.SearchIcon,{className:"search-icon"}),n.createElement("input",{className:"employee-search-input",type:"text",placeholder:d("ACTION_TEST_SEARCH"),name:"search",value:c,onChange:function(e){return s(e.target.value)}})))),function(){var e,t=Object.keys(f);t.sort(function(e,t){return e.orderNumber-t.orderNumber});for(var r=0;r<t.length;r++)if(-1===f[t[r]][0].path.indexOf("."))if("Home"===f[t[r]][0].displayName)v.unshift({moduleName:t[r].toUpperCase(),icon:f[t[r]][0],navigationURL:"/digit-ui/employee",type:"single"});else{var i;v.push({moduleName:null===(i=f[t[r]][0])||void 0===i?void 0:i.displayName.toUpperCase(),type:"single",icon:f[t[r]][0],navigationURL:f[t[r]][0].navigationURL})}else v.push({moduleName:t[r].toUpperCase(),links:f[t[r]],icon:f[t[r]][0],orderNumber:f[t[r]][0].orderNumber});if(v.find(function(e){return"HOME"===e.moduleName})){v.findIndex(function(e){return"HOME"===e.moduleName});var l,a,o=null===(l=v)||void 0===l?void 0:l.filter(function(e){return"HOME"===(null==e?void 0:e.moduleName)}),u=null===(a=v)||void 0===a?void 0:a.filter(function(e){return"HOME"!==(null==e?void 0:e.moduleName)});v=u.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)}),(null==o?void 0:o[0])&&v.unshift(o[0])}else v.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)});return null===(e=v)||void 0===e?void 0:e.map(function(e,t){return n.createElement(at,{item:e,key:t+1})})}()):""},ut=function(e){var t=e.isSidebarOpen,r=e.toggleSidebar,i=e.handleLogout,l=e.mobileView,a=e.userDetails,o=e.modules;return e.CITIZEN?n.createElement(lt,{isOpen:t,isSideBarScroll:e.isSideBarScroll,setSideBarScrollTop:e.setSideBarScrollTop,isMobile:!0,toggleSidebar:r,onLogout:i,linkData:e.linkData,islinkDataLoading:e.islinkDataLoading}):!l&&null!=a&&a.access_token?n.createElement(ot,{mobileView:l,userDetails:a,modules:o}):n.createElement(lt,{isOpen:t,isMobile:!0,toggleSidebar:r,onLogout:i,isEmployee:!0})},ct=function(e){var r=e.t,i=e.stateInfo,a=e.userDetails,u=e.CITIZEN,c=e.cityDetails,s=e.mobileView,d=e.handleUserDropdownSelection,m=e.logoUrl,f=e.showSidebar,v=void 0===f||f,p=e.showLanguageChange,g=e.linkData,E=e.islinkDataLoading,y=t.useState(!1),h=y[0],C=y[1],b=t.useState(!1),O=b[0],S=b[1],N=l.useHistory(),I=t.useState(!1),w=I[0],_=I[1],D=function(){C(!1),_(!0)},T=function(){_(!1)},L=[{name:r("EDIT_PROFILE"),icon:n.createElement(o.EditPencilIcon,{className:"icon"}),func:function(){N.push("/digit-ui/employee/user/profile")}},{name:r("CORE_COMMON_LOGOUT"),icon:n.createElement(o.LogoutIcon,{className:"icon"}),func:D}];return n.createElement(n.Fragment,null,n.createElement(Ze,{t:r,stateInfo:i,toggleSidebar:C,setSideBarScrollTop:S,isSidebarOpen:h,isSideBarScroll:O,handleLogout:D,userDetails:a,CITIZEN:u,cityDetails:c,mobileView:s,userOptions:L,handleUserDropdownSelection:d,logoUrl:m,showLanguageChange:p}),w&&n.createElement($e,{onSelect:function(){Digit.UserService.logout(),_(!1)},onCancel:T,onDismiss:T}),v&&n.createElement(ut,{t:r,CITIZEN:u,isSidebarOpen:h,toggleSidebar:C,isSideBarScroll:O,setSideBarScrollTop:S,handleLogout:D,mobileView:s,userDetails:a,linkData:g,islinkDataLoading:E}))};function st(e){var r=e.setProfilePic,i=e.closeDrawer,l=e.userType,u=e.removeProfilePic,c=e.showToast,s=t.useState(null)[1],d=t.useState(""),m=d[0],f=d[1],v=t.useState(null)[1],p=a.useTranslation().t;return t.useEffect(function(){!function(){try{v(null);var e=function(){if(m){var e=function(){if(m.size>=1e6)c("error",p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),v(p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{var e=I(function(){return Promise.resolve(Digit.UploadServices.Filestorage(l+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var t,n;if((null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var i,l,a=null==e||null===(i=e.data)||void 0===i||null===(l=i.files[0])||void 0===l?void 0:l.fileStoreId;s(a),r(a)}else c("error",p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),v(p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",p("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]),n.createElement(n.Fragment,null,n.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:function(){return i()}}),n.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===l?"2.5rem":"0",zIndex:"2"}},n.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},n.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",n.createElement(o.GalleryIcon,null)),n.createElement("label",{style:{cursor:"pointer"}}," Gallery"),n.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:function(e){return f(e.target.files[0])},style:{display:"none"}})),n.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},n.createElement("button",{onClick:function(){u(),i()}},n.createElement(o.RemoveIcon,null)),n.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}var dt=function(e){var r,i,u,c,s,m,f,v,p,g,E=e.stateCode,y=e.userType,h=e.cityDetails,C=(l.useHistory(),a.useTranslation().t),b=window.location.href,O=Digit.ULBService.getStateId(),S=Digit.ULBService.getCurrentTenantId(),N=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},w=t.useState(null),_=w[0],D=w[1],T=t.useState(null!=N&&N.name?N.name:""),L=T[0],R=T[1],A=t.useState(null!=N&&N.emailId?N.emailId:""),M=A[0],P=A[1],x=t.useState(null==_?void 0:_.gender),k=x[0],U=x[1],B=t.useState(null!=N&&N.permanentCity?N.permanentCity:h.name),F=B[0],j=B[1],V=t.useState(null!=N&&N.mobileNumber?N.mobileNumber:""),H=V[0],G=V[1],z=t.useState(null),W=z[0],q=z[1],X=t.useState(""),Z=X[0],Y=X[1],K=t.useState(!1),J=K[0],Q=K[1],$=t.useState(!1),ee=$[0],te=$[1],ne=t.useState(""),re=ne[0],ie=ne[1],le=t.useState(""),ae=le[0],oe=le[1],ue=t.useState(""),ce=ue[0],se=ue[1],de=t.useState(null),me=de[0],fe=de[1],ve=t.useState(!1),pe=ve[0],ge=ve[1],Ee=n.useState(window.innerWidth),ye=Ee[0],he=Ee[1],Ce=n.useState({}),be=Ce[0],Oe=Ce[1],Se=window.Digit.Utils.browser.isMobile();n.useEffect(function(){return window.addEventListener("resize",function(){return he(window.innerWidth)}),function(){window.removeEventListener("resize",function(){return he(window.innerWidth)})}}),t.useEffect(function(){var e;ge(!0),function(){try{var e=null==N?void 0:N.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(S,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&D(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),U({i18nKey:void 0,code:null==_?void 0:_.gender,value:null==_?void 0:_.gender});var t=null==_||null===(e=_.photo)||void 0===e?void 0:e.split(",");Y(null==t?void 0:t.at(0)),ge(!1)},[null!==_]);var Ne=function(e){return U(e)},Ie=function(){return Q(!1)},we=function(e){R(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?Oe(d({},be,{userName:{type:"pattern",message:C("CORE_COMMON_PROFILE_NAME_INVALID")}})):Oe(d({},be,{userName:null}))},_e=function(e){P(e),e.length&&!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)?Oe(d({},be,{emailAddress:{type:"pattern",message:C("CORE_COMMON_PROFILE_EMAIL_INVALID")}})):Oe(d({},be,{emailAddress:null}))},De=function(e,t,n){void 0===n&&(n=5e3),fe({key:e,action:t}),setTimeout(function(){fe(null)},n)},Te=function(){try{var e=function(e){if(t)return e;ge(!1)},t=!1;ge(!0);var n=I(function(){var e=d({},N,{name:L,gender:null==k?void 0:k.value,emailId:M,photo:W});if(!new RegExp(/^([a-zA-Z ])*$/).test(L)||""===L||L.length>50||L.length<1)throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===y&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(H))throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(M.length&&!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(M))throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(re.length||ae.length||ce.length){if(ae!==ce)throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(re.length&&ae.length&&ce.length))throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(ae)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(ce))throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return e.locale=Digit.StoreData.getCurrentLanguage(),Promise.resolve(Digit.UserService.updateUser(e,E)).then(function(e){var t=e.responseInfo;if(t&&"200"===t.status){var n=Digit.UserService.getUser();n&&Digit.UserService.setUser(d({},n,{info:d({},n.info,{name:L,mobileNumber:H,emailId:M,permanentCity:F})}))}return function(){if(re.length&&ae.length&&ce.length){var e={existingPassword:re,newPassword:ae,tenantId:S,type:"EMPLOYEE",username:null==N?void 0:N.userName,confirmPassword:ce};return function(){if(ae===ce)return I(function(){return Promise.resolve(Digit.UserService.changePassword(e,S)).then(function(e){var t=e.responseInfo;if(null==t||!t.status||"200"!==t.status)throw"";De("success",C("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3)})},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:C("CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD")})});throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH")})}()}null!=t&&t.status&&"200"===t.status&&De("success",C("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){var t=JSON.parse(e);De(t.type,C(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}},Le=[],Re=Digit.Hooks.pt.useGenderMDMS(O,"common-masters","GenderType").data;return Re&&Re.map(function(e){Le.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),pe?n.createElement(o.Loader,null):n.createElement("div",{className:"user-profile"},n.createElement("section",{style:{margin:"citizen"===y?"8px":"24px"}},"citizen"===y?n.createElement(o.BackButton,null):n.createElement(o.BreadCrumb,{crumbs:[{path:"/digit-ui/employee",content:C("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/user/profile",content:C("ES_COMMON_PAGE_1"),show:b.includes("/user/profile")}]})),n.createElement("div",{style:{display:"flex",flex:1,flexDirection:ye<768||"citizen"===y?"column":"row",margin:"citizen"===y?"8px":"16px",gap:"citizen"===y?"":"0 24px",boxShadow:"citizen"===y?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===y?"white":"",borderRadius:"citizen"===y?"4px":"",maxWidth:"citizen"===y?"960px":""}},n.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===y?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",height:"376px",borderRadius:"4px",boxShadow:"citizen"===y?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===y?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===y?"8px":"16px"}},n.createElement("div",{style:{position:"relative",height:"citizen"===y?"114px":"150px",width:"citizen"===y?"114px":"150px",margin:"16px"}},n.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:Z&&""!==Z?Z:"data:image/png;base64,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"}),n.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:function(){return Q(!J)}},n.createElement(o.CameraIcon,null)))),n.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===y?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===y?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===y?"8px":"24px",paddingBottom:"20px"}},"citizen"===y?n.createElement(n.Fragment,null,n.createElement(o.LabelFieldPair,null,n.createElement(o.CardLabel,{style:{}},""+C("CORE_COMMON_PROFILE_NAME"),"*"),n.createElement("div",{style:{width:"100%",maxWidth:"960px"}},n.createElement(o.TextInput,d({t:C,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:L,onChange:function(e){return we(e.target.value)}},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:C("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==be?void 0:be.userName)&&n.createElement(o.CardLabelError,null," ",null==be||null===(i=be.userName)||void 0===i?void 0:i.message," "))),n.createElement(o.LabelFieldPair,null,n.createElement(o.CardLabel,{style:{}},""+C("CORE_COMMON_PROFILE_GENDER")),n.createElement(o.Dropdown,{style:{width:"100%"},className:"form-field",selected:1===(null==k?void 0:k.length)?k[0]:k,disable:1===(null==k?void 0:k.length)||!1,option:Le,select:Ne,value:k,optionKey:"code",t:C,name:"gender"})),n.createElement(o.LabelFieldPair,null,n.createElement(o.CardLabel,{style:{}},""+C("CORE_COMMON_PROFILE_EMAIL")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:M,onChange:function(e){return _e(e.target.value)},disable:!1}),(null==be?void 0:be.emailAddress)&&n.createElement(o.CardLabelError,null," ",null==be||null===(u=be.emailAddress)||void 0===u?void 0:u.message," "))),n.createElement("button",{onClick:Te,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:Se?"100%":"240px",borderBottom:"1px solid black"}},C("CORE_COMMON_SAVE"))):n.createElement(n.Fragment,null,n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_NAME"),"*"),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,d({t:C,type:"text",isMandatory:!1,name:"name",value:L,onChange:function(e){return we(e.target.value)},placeholder:"Enter Your Name"},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:C("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==be?void 0:be.userName)&&n.createElement(o.CardLabelError,{style:{margin:0,padding:0}}," ",null==be||null===(c=be.userName)||void 0===c?void 0:c.message," "))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_GENDER")),n.createElement(o.Dropdown,{style:{width:"100%"},selected:1===(null==k?void 0:k.length)?k[0]:k,disable:1===(null==k?void 0:k.length)||!1,option:Le,select:Ne,value:k,optionKey:"code",t:C,name:"gender"})),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CITY")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,d({t:C,type:"text",isMandatory:!1,name:"city",value:C(F),onChange:function(e){return j(e.target.value)},placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:C("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disable:!0})),n.createElement(o.CardLabelError,null))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},C("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),n.createElement("div",{style:{width:"100%"}},n.createElement(o.MobileNumber,{value:H,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:function(e){return function(e){G(e),"employee"!==y||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?Oe(d({},be,{mobileNumber:null})):Oe(d({},be,{mobileNumber:{type:"pattern",message:C("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}}))}(e)},disable:!0,required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:C("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==be?void 0:be.mobileNumber)&&n.createElement(o.CardLabelError,{style:{margin:0,padding:0}}," ",null==be||null===(s=be.mobileNumber)||void 0===s?void 0:s.message," "))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_EMAIL")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"email",isMandatory:!1,placeholder:"Enter a valid Email",optionKey:"i18nKey",name:"email",value:M,onChange:function(e){return _e(e.target.value)},disable:!1}),(null==be?void 0:be.emailAddress)&&n.createElement(o.CardLabelError,null," ",null==be||null===(m=be.emailAddress)||void 0===m?void 0:m.message," "))),n.createElement(o.LabelFieldPair,null,n.createElement("div",null,n.createElement("a",{style:(f={color:"orange",cursor:"default",marginBottom:"5"},f.cursor="pointer",f),onClick:function(){return te(!ee)}},C("CORE_COMMON_CHANGE_PASSWORD")),ee?n.createElement("div",{style:{marginTop:"10px"}},n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return ie(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Oe(d({},be,{currentPassword:null})):Oe(d({},be,{currentPassword:{type:"pattern",message:C("CORE_COMMON_PROFILE_PASSWORD_INVALID")}})));var t},disable:!1}),(null==be?void 0:be.currentPassword)&&n.createElement(o.CardLabelError,null,null==be||null===(v=be.currentPassword)||void 0===v?void 0:v.message))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_NEW_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return oe(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Oe(d({},be,{newPassword:null})):Oe(d({},be,{newPassword:{type:"pattern",message:C("CORE_COMMON_PROFILE_PASSWORD_INVALID")}})));var t},disable:!1}),(null==be?void 0:be.newPassword)&&n.createElement(o.CardLabelError,null,null==be||null===(p=be.newPassword)||void 0===p?void 0:p.message))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return se(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Oe(d({},be,{confirmPassword:null})):Oe(d({},be,{confirmPassword:{type:"pattern",message:C("CORE_COMMON_PROFILE_PASSWORD_INVALID")}})));var t},disable:!1}),(null==be?void 0:be.confirmPassword)&&n.createElement(o.CardLabelError,null,null==be||null===(g=be.confirmPassword)||void 0===g?void 0:g.message)))):""))))),"employee"===y?n.createElement("div",{style:{height:"88px",backgroundColor:"#FFFFFF",display:"flex",justifyContent:"flex-end",marginTop:"64px",alignItems:"center"}},n.createElement("button",{onClick:Te,style:{marginTop:"24px",backgroundColor:"#F47738",width:ye<768?"100%":"248px",height:"40px",float:"right",margin:ye<768?"0 16px":"",marginRight:ye<768?"16px":"31px",color:"white",borderBottom:"1px solid black"}},C("CORE_COMMON_SAVE"))):"",me&&n.createElement(o.Toast,{error:"error"===me.key,label:C("success"===me.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":me.action),onClose:function(){return fe(null)},style:{maxWidth:"670px"}}),1==J?n.createElement(st,{setProfilePic:function(e){try{var t=function(e){Y(null==e?void 0:e.thumbs[0]),Ie()};return q(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(function(e){return e.url.split(",")[3]}),images:e.data.fileStoreIds.map(function(e){return Digit.Utils.getFileUrl(e.url)})}:null})}catch(e){return Promise.reject(e)}}([e],O)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:Ie,userType:y,removeProfilePic:function(){q(null),Y(null)},showToast:De}):"")},mt=["user/profile","user/error"],ft=function(e){var r,i,o,u,c=e.stateInfo,s=e.userDetails,d=e.CITIZEN,m=e.cityDetails,f=e.mobileView,v=e.handleUserDropdownSelection,p=e.logoUrl,g=e.DSO,E=e.stateCode,y=e.modules,h=e.appTenants,C=e.initData,b=l.useHistory(),O=a.useTranslation().t,S=l.useRouteMatch().path,N=l.useLocation(),I=null==N||null===(r=N.pathname)||void 0===r?void 0:r.includes("language-selection"),w=mt.some(function(e){var t;return null==N||null===(t=N.pathname)||void 0===t?void 0:t.includes(e)});return t.useEffect(function(){Digit.UserService.setType("employee")},[]),n.createElement("div",{className:"employee"},n.createElement(l.Switch,null,n.createElement(l.Route,{path:S+"/user"},w&&n.createElement(ct,{t:O,stateInfo:c,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,showSidebar:!!w,showLanguageChange:!I}),n.createElement("div",{className:w?"grounded-container":"loginContainer",style:w?{padding:0,paddingTop:"80px",marginLeft:f?"":"64px"}:{"--banner-url":"url("+(null==c?void 0:c.bannerUrl)+")",padding:"0px"}},n.createElement(l.Switch,null,n.createElement(l.Route,{path:S+"/user/login"},n.createElement(Le,null)),n.createElement(l.Route,{path:S+"/user/forgot-password"},n.createElement(ke,null)),n.createElement(l.Route,{path:S+"/user/change-password"},n.createElement(Me,null)),n.createElement(l.Route,{path:S+"/user/profile"},n.createElement(dt,{stateCode:E,userType:"employee",cityDetails:m})),n.createElement(l.Route,{path:S+"/user/error"},n.createElement(Ve,{initData:C,goToHome:function(){b.push("/digit-ui/employee")}})),n.createElement(l.Route,{path:S+"/user/language-selection"},n.createElement(Ue,null)),n.createElement(l.Route,null,n.createElement(l.Redirect,{to:S+"/user/language-selection"}))))),n.createElement(l.Route,null,n.createElement(ct,{t:O,stateInfo:c,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,modules:y}),n.createElement("div",{className:"main "+(g?"m-auto":"")},n.createElement("div",{className:"employee-app-wrapper"},n.createElement(Ge,{initData:C},n.createElement(Fe,{stateCode:E,userType:"employee",modules:y,appTenants:h}))),n.createElement("div",{className:"employee-home-footer"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(o=i.globalConfigs)||void 0===o||null===(u=o.getConfig)||void 0===u?void 0:u.call(o,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:function(){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.createElement(l.Route,null,n.createElement(l.Redirect,{to:S+"/user/language-selection"}))))},vt=function(){var e,t,r,i,u,c,s,m,f,v,p,g,E,y,h,C,b,O,S,N=a.useTranslation().t,I=l.useHistory(),w=Digit.ULBService.getCitizenCurrentTenant(!0),_=Digit.Hooks.useStore.getInitData(),D=_.data,T=(void 0===D?{}:D).uiHomePage,L=_.isLoading,R=window.Digit.Utils.browser.isMobile();window.Digit.SessionStorage.get("TL_CREATE_TRADE")&&window.Digit.SessionStorage.set("TL_CREATE_TRADE",{});var A=function(){var e,t,n,r,i;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===(r=Digit.UserService)||void 0===r||null===(i=r.getUser())||void 0===i||!i.access_token)},M=Digit.Hooks.useEvents({tenantId:w,variant:"whats-new",config:{enabled:A()}}),P=M.data,x=M.isLoading;w||(null===Digit.SessionStorage.get("locale")?I.push("/digit-ui/citizen/select-language"):I.push("/digit-ui/citizen/select-location"));var k=null==T?void 0:T.appBannerDesktop,U=null==T?void 0:T.appBannerMobile,B=null==T?void 0:T.citizenServicesCard,F=null==T?void 0:T.informationAndUpdatesCard,j=null==T?void 0:T.whatsAppBannerDesktop,V=null==T?void 0:T.whatsAppBannerMobile,H=null==T?void 0:T.whatsNewSection,G=function(e){window.open(null==e?void 0:e.navigationUrl)},z={header:N(null==B?void 0:B.headerLabel),sideOption:{name:N(null==B||null===(e=B.sideOption)||void 0===e?void 0:e.name),onClick:function(){var e;return I.push(null==B||null===(e=B.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:N(null==B||null===(t=B.props)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),Icon:n.createElement(o.ComplaintIcon,null),onClick:function(){var e,t;return I.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==B||null===(i=B.props)||void 0===i||null===(u=i[1])||void 0===u?void 0:u.label),Icon:n.createElement(o.PTIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return I.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==B||null===(c=B.props)||void 0===c||null===(s=c[2])||void 0===s?void 0:s.label),Icon:n.createElement(o.CaseIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return I.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==B||null===(m=B.props)||void 0===m||null===(f=m[3])||void 0===f?void 0:f.label),Icon:n.createElement(o.WSICon,null),onClick:function(){var e,t;return I.push(null==B||null===(e=B.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%"}},W={header:N(null==F?void 0:F.headerLabel),sideOption:{name:N(null==F||null===(v=F.sideOption)||void 0===v?void 0:v.name),onClick:function(){var e;return I.push(null==F||null===(e=F.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:N(null==F||null===(p=F.props)||void 0===p||null===(g=p[0])||void 0===g?void 0:g.label),Icon:n.createElement(o.HomeIcon,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==F||null===(E=F.props)||void 0===E||null===(y=E[1])||void 0===y?void 0:y.label),Icon:n.createElement(o.Calender,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==F||null===(h=F.props)||void 0===h||null===(C=h[2])||void 0===C?void 0:C.label),Icon:n.createElement(o.DocumentIcon,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==F||null===(b=F.props)||void 0===b||null===(O=b[3])||void 0===O?void 0:O.label),Icon:n.createElement(o.DocumentIcon,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.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 L?n.createElement(o.Loader,null):n.createElement("div",{className:"HomePageContainer"},n.createElement("div",{className:"HomePageWrapper"},n.createElement("div",{className:"BannerWithSearch"},n.createElement("img",R?{src:null==U?void 0:U.bannerUrl}:{src:null==k?void 0:k.bannerUrl}),n.createElement("div",{className:"ServicesSection"},n.createElement(o.CardBasedOptions,d({style:{marginTop:"-30px"}},z)),n.createElement(o.CardBasedOptions,d({style:R?{}:{marginTop:"-30px"}},W)))),(V||j)&&n.createElement("div",{className:"WhatsAppBanner"},n.createElement("img",R?{src:null==V?void 0:V.bannerUrl,onClick:function(){return G(V)}}:{src:null==j?void 0:j.bannerUrl,onClick:function(){return G(j)}})),A()?x?n.createElement(o.Loader,null):n.createElement("div",{className:"WhatsNewSection"},n.createElement("div",{className:"headSection"},n.createElement("h2",null,N(null==H?void 0:H.headerLabel)),n.createElement("p",{onClick:function(){var e;return I.push(null==H||null===(e=H.sideOption)||void 0===e?void 0:e.navigationUrl)}},N(null==H||null===(S=H.sideOption)||void 0===S?void 0:S.name))),n.createElement(o.WhatsNewCard,null==P?void 0:P[0])):null))},pt=function(){var e=a.useTranslation().t,r=l.useHistory(),i=Digit.Hooks.useStore.getInitData(),u=i.data,c=void 0===u?{}:u,s=c.languages,d=c.stateInfo,m=i.isLoading,f=Digit.StoreData.getCurrentLanguage(),v=t.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]),p=t.useMemo(function(){return{options:s,optionsKey:"label",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:function(e){return Digit.LocalizationService.changeLanguage(e.value,d.code)},selectedOption:null==s?void 0:s.filter(function(e){return e.value===f})[0]}},[f,s]);return m?n.createElement(o.Loader,null):n.createElement("div",{className:"selection-card-wrapper"},n.createElement(o.PageBasedInput,{texts:v,onSubmit:function(){r.push("/digit-ui/citizen/select-location")}},n.createElement(o.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),n.createElement(o.RadioButtons,p)))},gt=function(){var e=a.useTranslation().t,r=l.useHistory(),i=l.useLocation(),u=Digit.Hooks.useTenants(),c=u.data,s=u.isLoading,m=t.useState(function(){return{code:Digit.ULBService.getCitizenCurrentTenant(!0)}}),f=m[0],v=m[1],p=t.useState(!1),g=p[0],E=p[1],y=t.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]);function h(e){v(e),E(!1)}var C=t.useMemo(function(){return{options:c,optionsKey:"i18nKey",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:h,selectedOption:f}},[c,e,f]);return s?n.createElement("loader",null):n.createElement("div",{className:"selection-card-wrapper"},n.createElement(o.BackButton,null),n.createElement(o.PageBasedInput,{texts:y,onSubmit:function(){if(f){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",f);var t=null===(e=i.state)||void 0===e?void 0:e.redirectBackTo;t?r.replace(t):r.push("/digit-ui/citizen")}else E(!0)},className:"location-selection-container"},n.createElement(o.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),n.createElement(o.SearchOnRadioButtons,d({},C,{placeholder:e("COMMON_TABLE_SEARCH")})),g?n.createElement(o.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},Et=function(e){var r=e.question,i=e.answer,l=e.subAnswer,u=e.lastIndex,c=t.useState(!1),s=c[0],d=c[1],m=a.useTranslation().t;return window.Digit.Utils.browser.isMobile(),n.createElement("div",{className:"faqs border-none",onClick:function(){return d(!s)}},n.createElement("div",{className:"faq-question",style:{justifyContent:m(r).length>30&&s?"revert":"space-between",display:Digit.Utils.browser.isMobile()&&m(r).length>30&&s?"block":"flex"}},n.createElement("span",null,m(r)),n.createElement("span",{className:s?"faqicon rotate":"faqicon",style:{float:"right"}},n.createElement(o.ArrowForward,null))),n.createElement("div",{className:"faq-answer",style:s?{display:"block"}:{display:"none"}},n.createElement("span",null,m(i)+m(l))),u?null:n.createElement("div",{className:"cs-box-border"}))},yt=function(e){var r,i,l,u=e.module,c=Digit.UserService.getUser(),s=((null==c||null===(r=c.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),a.useTranslation().t),d=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),m=d.data,f=null==m||null===(i=m.MdmsRes["common-masters"])||void 0===i||null===(l=i.faqs[0])||void 0===l?void 0:l[""+u].faqs;return d.isLoading?n.createElement(o.Loader,null):n.createElement(t.Fragment,null,n.createElement("div",{className:"faq-page"},n.createElement(o.BackButton,{style:{marginLeft:"unset"}}),n.createElement("div",{style:{marginBottom:"15px"}},n.createElement(o.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},s("FAQ_S"))),n.createElement("div",{className:"faq-list"},f.map(function(e,t){return n.createElement(Et,{key:"faq_"+t,question:e.question,answer:e.answer,subAnswer:e.subAnswer?e.subAnswer:"",lastIndex:t===(null==f?void 0:f.length)-1})}))))},ht=function(e){var r,i,l,u=e.module,c=window.Digit.Utils.browser.isMobile(),s=Digit.UserService.getUser(),d=((null==s||null===(r=s.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),a.useTranslation().t),m=Digit.SessionStorage.get("initData").stateInfo,f=Digit.StoreData.getCurrentLanguage(),v=t.useState(f),p=v[0],g=v[1],E=t.useState(!1),y=E[0],h=E[1],C=t.useState(""),b=C[0],O=C[1],S=function(){return n.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.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"}))};function N(e){return n.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:e.onClick},n.createElement("path",{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z",fill:"white"}))}var I=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),w=I.data,_=null==w||null===(i=w.MdmsRes["common-masters"])||void 0===i||null===(l=i.howItWorks[0])||void 0===l?void 0:l[""+u];return I.isLoading?n.createElement(o.Loader,null):n.createElement(t.Fragment,null,n.createElement("div",{className:"how-it-works-page"},n.createElement("div",{style:{marginLeft:"-10px"}},n.createElement(o.BackButton,null)),n.createElement("div",{className:"how-it-works-page-header"},n.createElement("div",{style:{marginLeft:c?"-15px":""}},n.createElement(o.Header,null,d("HOW_IT_WORKS")))),n.createElement("div",{className:"language-selector",style:{marginBottom:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(o.CustomButton,{selected:e.value===p,text:e.label,onClick:function(){return function(e){g(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)}(e)}}))})),_.videosJson.map(function(e,t){return n.createElement("div",null,n.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},n.createElement("div",{className:"video-icon",onClick:function(){return t=e,O("hi_IN"===p?t.hi_IN:t.en_IN),void h(!0);var t}},n.createElement("div",{className:"vid-svg"},n.createElement(S,null))),n.createElement("div",{className:"how-it-works-header-description"},n.createElement("h2",null,d(e.headerLabel)),n.createElement("p",null,d(e.description)))))}),n.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},n.createElement("div",{className:"how-it-works-pdf-section"},n.createElement("div",{className:"pdf-icon-header-desc"},n.createElement("div",{className:"pdf-icon"},n.createElement(o.PDFSvg,null)),n.createElement("div",{className:"pdf-header-desc"},n.createElement("h2",null,d(_.pdfHeader)),n.createElement("p",null,d(_.pdfDesc)))),n.createElement("div",{className:"download-icon"},n.createElement(o.DownloadImgIcon,null)))),y&&n.createElement("div",{className:"how-it-works-video-play"},n.createElement("div",{className:"close-button",style:{position:"absolute",right:"15px",top:"10%",zIndex:"1"}},n.createElement(N,{onClick:function(){h(!1)}})),n.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0,muted:!0,style:{position:"fixed",top:"0",left:"0",minWidth:"100%",minHeight:"100%",backgroundColor:"rgba(0,0,0,0.5)"}},n.createElement("source",{src:b,type:"video/mp4"})))))},Ct=function(e){var t,r,i,l,u,c,s,d,m,f,v,p,g,E,y,h,C=e.moduleCode,b=a.useTranslation().t,O=Digit.ULBService.getCitizenCurrentTenant(),S=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),N=S.isLoading,I=S.data,w=Digit.Hooks.useDynamicData({moduleCode:C,tenantId:O,filters:{},t:b}),_=w.isLoading,D=w.error,T=w.data,L=window.Digit.Utils.browser.isMobile();window.location.href.includes("tl")&&window.Digit.SessionStorage.get("TL_CREATE_TRADE")&&window.Digit.SessionStorage.set("TL_CREATE_TRADE",{});var R=function(e){var t=e.styles;switch(e.module){case"TL":return n.createElement(o.CaseIcon,{className:"fill-path-primary-main",styles:t});case"PT":return n.createElement(o.PTIcon,{className:"fill-path-primary-main",styles:t});case"MCOLLECT":return n.createElement(o.MCollectIcon,{className:"fill-path-primary-main",styles:t});case"PGR":return n.createElement(o.PTIcon,{className:"fill-path-primary-main",styles:t});case"WS":return n.createElement(o.WSICon,{className:"fill-path-primary-main",styles:t});case"OBPS":return n.createElement(o.BPAHomeIcon,{className:"fill-path-primary-main",styles:t});default:return n.createElement(o.CaseIcon,{className:"fill-path-primary-main",styles:t})}},A=null==I||null===(t=I.MdmsRes["common-masters"])||void 0===t||null===(r=t.StaticData[0])||void 0===r?void 0:r[""+C],M=function(e){switch(e.module){case"PT":case"WS":return n.createElement("span",{className:"timerIcon"},n.createElement(o.TimerIcon,null));default:return null}},P=function(e){switch(e.module){case"PT":return n.createElement("span",{className:"rupeeSymbol"},n.createElement(o.RupeeSymbol,null));case"WS":return n.createElement("span",{className:"timerIcon"},n.createElement(o.TimerIcon,null));default:return null}},x=function(e){switch(e){case"TL":return{staticCommonContent:b("TL_VALIDITY")};case"MCOLLECT":return{staticCommonContent:b("CHALLAN_VALIDITY")};case"PGR":return{staticCommonContent:b("CATEGORIES_OF_COMPLAINT_TYPES_CAN_BE_SUBMITTED_ON_GRIEVANCE_PORTAL")};case"OBPS":return{staticCommonContent:b("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==A?void 0:A.validity)+" "+b("1"===(null==A?void 0:A.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},k=function(e){switch(e){case"PT":return{staticDataOne:(null==A?void 0:A.staticDataOne)+" "+b("COMMON_DAYS"),staticDataOneHeader:b("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==A?void 0:A.staticDataTwo,staticDataTwoHeader:b("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:b("PAY_WATER_CHARGES_BY")+" "+(null==A?void 0:A.staticDataOne)+" "+b("COMMON_DAYS")+" "+b("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==A?void 0:A.staticDataTwo)+" "+b("COMMON_DAYS"),staticDataTwoHeader:b("APPLICATION_PROCESSING_TIME")};default:return{}}};return N||_?n.createElement(o.Loader,null):A?n.createElement(n.Fragment,null,A&&null!=A&&A.payViaWhatsApp?n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"pay-whatsapp-card",onClick:function(){window.open(null==A?void 0:A.payViaWhatsApp)}},n.createElement("div",{className:"pay-whatsapp-text"},b("PAY_VIA_WHATSAPP")),n.createElement("div",{className:"whatsAppIconG"},n.createElement(o.WhatsappIconGreen,null)))):null,A&&null!=A&&A.helpline?n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"static-home-Card"},n.createElement("div",{className:"static-home-Card-header"},b("CALL_CENTER_HELPLINE")),n.createElement("div",{className:"helplineIcon"},n.createElement(o.HelpLineIcon,null))),n.createElement("div",{className:"call-center-card-text"},null!=A&&null!==(i=A.helpline)&&void 0!==i&&i.contactOne?n.createElement("div",{className:"call-center-card-content"},n.createElement("a",{href:"tel:"+(null==A||null===(l=A.helpline)||void 0===l?void 0:l.contactOne)},null==A||null===(u=A.helpline)||void 0===u?void 0:u.contactOne)):null,null!=A&&null!==(c=A.helpline)&&void 0!==c&&c.contactTwo?n.createElement("div",{className:"call-center-card-content"},n.createElement("a",{href:"tel:"+(null==A||null===(s=A.helpline)||void 0===s?void 0:s.contactTwo)},null==A||null===(d=A.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,A&&null!=A&&A.serviceCenter?n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"static-home-Card"},n.createElement("div",{className:"static-home-Card-header"},b("CITIZEN_SERVICE_CENTER")),n.createElement("div",{className:"serviceCentrIcon"},n.createElement(o.ServiceCenterIcon,null))),n.createElement("div",{className:"service-center-details-card"},n.createElement("div",{className:"service-center-details-text"},null==A?void 0:A.serviceCenter)),null!=A&&A.viewMapLocation?n.createElement("div",{className:"link"},n.createElement("a",{href:null==A?void 0:A.viewMapLocation},b("VIEW_ON_MAP"))):null):n.createElement("div",null),n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},D||null==T||null===(null==T?void 0:T.dynamicDataOne)?n.createElement("div",null):n.createElement("div",{className:"dynamicDataCard",style:L?{maxHeight:"fit-content"}:{}},n.createElement("div",{className:"dynamicData"},n.createElement("span",{style:{paddingTop:"2px"}},n.createElement(R,{module:C,styles:{width:"18px",height:"24px"}})),n.createElement("span",{className:"dynamicData-content"},null==T?void 0:T.dynamicDataOne))),D||null==T||null===(null==T?void 0:T.dynamicDataTwo)?n.createElement("div",null):n.createElement("div",{className:"dynamicDataCard",style:L?{maxHeight:"fit-content"}:{}},n.createElement("div",{className:"dynamicData"},n.createElement("span",{style:{paddingTop:"2px"}},n.createElement(R,{module:C,styles:{width:"18px",height:"24px"}})),n.createElement("span",{className:"dynamicData-content"},null==T?void 0:T.dynamicDataTwo))),A&&null!=A&&A.staticDataOne?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement(M,{module:C}),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=k(C))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(f=k(C))||void 0===f?void 0:f.staticDataOneHeader),n.createElement("span",{className:"static-data-content-second"},""+(null===(v=k(C))||void 0===v?void 0:v.staticDataOne))))):n.createElement("div",null),A&&null!=A&&A.staticDataTwo?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement(P,{module:C}),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(p=k(C))||void 0===p?void 0:p.staticDataTwoHeader),n.createElement("span",{className:"static-data-content-second"},null===(g=k(C))||void 0===g?void 0:g.staticDataTwo)))):n.createElement("div",null),A&&null!=A&&A.validity?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement("span",{className:"validityIcon"},n.createElement(o.ValidityTimeIcon,null)),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(E=x(C))||void 0===E?void 0:E.staticCommonContent),n.createElement("span",{className:"static-data-content-second"},null===(y=x(C))||void 0===y?void 0:y.validity)))):n.createElement("div",null),D||null==T||null==T||!T.staticData||null===(null==T?void 0:T.staticData)?n.createElement("div",null):n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},"PGR"===C?n.createElement("span",{style:{paddingTop:"15px"}},n.createElement(o.TimerIcon,{module:C,styles:{width:"18px",height:"24px",marginLeft:"13px"}})):n.createElement("span",{className:"validityIcon"},n.createElement(o.ValidityTimeIcon,null)),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(h=x(C))||void 0===h?void 0:h.staticCommonContent),n.createElement("span",{className:"static-data-content-second"},null==T?void 0:T.staticData)))))):n.createElement(n.Fragment,null)},bt=function(e){return e instanceof HTMLElement},Ot=function(e){return null==e},St=function(e){return"object"==typeof e},Nt=function(e){return!Ot(e)&&!Array.isArray(e)&&St(e)&&!(e instanceof Date)},It=function(e){return/^\w*$/.test(e)},wt=function(e){return e.filter(Boolean)},_t=function(e){return wt(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function Dt(e,t,n){for(var r=-1,i=It(t)?[t]:_t(t),l=i.length,a=l-1;++r<l;){var o=i[r],u=n;if(r!==a){var c=e[o];u=Nt(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}e[o]=u,e=e[o]}return e}var Tt=function(e,t){for(var n in void 0===t&&(t={}),e)It(n)?t[n]=e[n]:Dt(t,n,e[n]);return t},Lt=function(e){return void 0===e},Rt=function(e,t,n){void 0===e&&(e={});var r=wt(t.split(/[,[\].]+?/)).reduce(function(e,t){return Ot(e)?e:e[t]},e);return Lt(r)||r===e?Lt(e[t])?n:e[t]:r},At=function(e,t){bt(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))},Mt={isValid:!1,value:null},Pt=function(e){return Array.isArray(e)?e.reduce(function(e,t){return t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e},Mt):Mt},xt=function(e){return"radio"===e.type},kt=function(e){return"file"===e.type},Ut=function(e){return"checkbox"===e.type},Bt=function(e){return"select-multiple"===e.type},Ft={value:!1,isValid:!1},jt={value:!0,isValid:!0},Vt=function(e){if(Array.isArray(e)){if(e.length>1){var t=e.filter(function(e){return e&&e.ref.checked}).map(function(e){return e.ref.value});return{value:t,isValid:!!t.length}}var n=e[0].ref,r=n.value,i=n.attributes;return n.checked?i&&!Lt(i.value)?Lt(r)||""===r?jt:{value:r,isValid:!0}:jt:Ft}return Ft};function Ht(e,t,n,r,i){var l=e.current[t];if(l){var a=l.ref,o=a.value,u=l.ref,c=l.valueAsNumber,s=l.valueAsDate,d=l.setValueAs;if(a.disabled&&r)return;return kt(u)?u.files:xt(u)?Pt(l.options).value:Bt(u)?[].concat(u.options).filter(function(e){return e.selected}).map(function(e){return e.value}):Ut(u)?Vt(l.options).value:i?o:c?""===o?NaN:+o:s?u.valueAsDate:d?d(o):o}if(n)return Rt(n.current,t)}function Gt(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Gt(e.parentNode)}var zt=function(e){return Nt(e)&&!Object.keys(e).length},Wt=function(e){return"boolean"==typeof e};function qt(e,t){var n,r=It(t)?[t]:_t(t),i=1==r.length?e:function(e,t){for(var n=t.slice(0,-1).length,r=0;r<n;)e=Lt(e)?r++:e[t[r++]];return e}(e,r);i&&delete i[r[r.length-1]];for(var l=0;l<r.slice(0,-1).length;l++){var a=-1,o=void 0,u=r.slice(0,-(l+1)),c=u.length-1;for(l>0&&(n=e);++a<u.length;){var s=u[a];o=o?o[s]:e[s],c===a&&(Nt(o)&&zt(o)||Array.isArray(o)&&!o.filter(function(e){return Nt(e)&&!zt(e)||Wt(e)}).length)&&(n?delete n[s]:delete e[s]),n=o}}return e}var Xt=function(e,t){return e&&e.ref===t},Zt=function(e){return Ot(e)||!St(e)};function Yt(e,t){if(Zt(e)||Zt(t))return t;for(var n in t){var r=e[n],i=t[n];try{e[n]=Nt(r)&&Nt(i)||Array.isArray(r)&&Array.isArray(i)?Yt(r,i):i}catch(e){}}return e}function Kt(e,n,r){if(Zt(e)||Zt(n)||e instanceof Date||n instanceof Date)return e===n;if(!t.isValidElement(e)){var i=Object.keys(e),l=Object.keys(n);if(i.length!==l.length)return!1;for(var a=0,o=i;a<o.length;a++){var u=o[a],c=e[u];if(!r||"ref"!==u){var s=n[u];if((Nt(c)||Array.isArray(c))&&(Nt(s)||Array.isArray(s))?!Kt(c,s,r):c!==s)return!1}}}return!0}function Jt(e,t,n,r,i){for(var l=-1;++l<e.length;){for(var a in e[l]){var o;Array.isArray(e[l][a])?(!n[l]&&(n[l]={}),n[l][a]=[],Jt(e[l][a],Rt(t[l]||{},a,[]),n[l][a],n[l],a)):Kt(Rt(t[l]||{},a),e[l][a])?Dt(n[l]||{},a):n[l]=Object.assign(Object.assign({},n[l]),((o={})[a]=!0,o))}r&&!n.length&&delete r[i]}return n}var Qt=function(e){return"string"==typeof e},$t=function(e,t,n,r,i){var l={},a=function(t){(Lt(i)||(Qt(i)?t.startsWith(i):Array.isArray(i)&&i.find(function(e){return t.startsWith(e)})))&&(l[t]=Ht(e,t,void 0,r))};for(var o in e.current)a(o);return n?Tt(l):Yt(t,Tt(l))},en=function(e){return e instanceof RegExp},tn=function(e){return Nt(e)&&!en(e)?e:{value:e,message:""}},nn=function(e){return"function"==typeof e},rn=function(e){return Qt(e)||t.isValidElement(e)};function ln(e,t,n){if(void 0===n&&(n="validate"),rn(e)||Wt(e)&&!e)return{type:n,message:rn(e)?e:"",ref:t}}var an=function(e,t,n,r,i){var l;return t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),(l={},l[r]=i||!0,l))}):{}},on=function(e,t,n,r){var i=n.ref,l=n.ref.value,a=n.options,o=n.required,u=n.maxLength,c=n.minLength,s=n.min,d=n.max,m=n.pattern,f=n.validate;try{var v=!1,p=i.name,g={},E=xt(i),y=Ut(i),h=E||y,C=""===l,b=an.bind(null,p,t,g),O=function(e,t,n,r,l){void 0===r&&(r="maxLength"),void 0===l&&(l="minLength");var a=e?t:n;g[p]=Object.assign({type:e?r:l,message:a,ref:i},b(e?r:l,a))};if(o&&(!E&&!y&&(C||Ot(l))||Wt(l)&&!l||y&&!Vt(a).isValid||E&&!Pt(a).isValid)){var S=rn(o)?{value:!!o,message:o}:tn(o),I=S.message;if(S.value&&(g[p]=Object.assign({type:"required",message:I,ref:h?((e.current[p].options||[])[0]||{}).ref:i},b("required",I)),!t))return Promise.resolve(g)}if(!(Ot(s)&&Ot(d)||""===l)){var w,_,D=tn(d),T=tn(s);if(isNaN(l)){var L=i.valueAsDate||new Date(l);Qt(D.value)&&(w=L>new Date(D.value)),Qt(T.value)&&(_=L<new Date(T.value))}else{var R=i.valueAsNumber||parseFloat(l);Ot(D.value)||(w=R>D.value),Ot(T.value)||(_=R<T.value)}if((w||_)&&(O(!!w,D.message,T.message,"max","min"),!t))return Promise.resolve(g)}if(Qt(l)&&!C&&(u||c)){var A=tn(u),M=tn(c),P=!Ot(A.value)&&l.length>A.value,x=!Ot(M.value)&&l.length<M.value;if((P||x)&&(O(P,A.message,M.message),!t))return Promise.resolve(g)}if(Qt(l)&&m&&!C){var k=tn(m),U=k.value,B=k.message;if(en(U)&&!U.test(l)&&(g[p]=Object.assign({type:"pattern",message:B,ref:i},b("pattern",B)),!t))return Promise.resolve(g)}var F=function(){if(f){var n=Ht(e,p,r,!1,!0),l=h&&a?a[0].ref:i;return nn(f)?Promise.resolve(f(n)).then(function(e){var n=ln(e,l);if(n&&(g[p]=Object.assign(Object.assign({},n),b("validate",n.message)),!t))return v=!0,g}):function(){if(Nt(f)){var e=function(){if(!zt(i)&&(g[p]=Object.assign({ref:l},i),!t))return v=!0,g},r=!1,i={},a=N(Object.entries(f),function(e){var a=e[0],o=e[1];if(zt(i)||t)return Promise.resolve(o(n)).then(function(e){var n=ln(e,l,a);n&&(i=Object.assign(Object.assign({},n),b(a,n.message)),t&&(g[p]=i))});r=!0},function(){return r});return a&&a.then?a.then(e):e()}}()}}();return Promise.resolve(F&&F.then?F.then(function(e){return v?e:g}):v?F:g)}catch(e){return Promise.reject(e)}},un=function e(t,n,r){for(var i in void 0===r&&(r=[]),n){var l=t+(Nt(n)?"."+i:"["+i+"]");Zt(n[i])?r.push(l):e(l,n[i],r)}return r},cn=function(e,t,n,r,i){var l=void 0;return n.add(t),zt(e)||(l=Rt(e,t),(Nt(l)||Array.isArray(l))&&un(t,l).forEach(function(e){return n.add(e)})),Lt(l)?i?r:Rt(r,t):l},sn=function(e){var t=e.isBlurEvent,n=e.isSubmitted;return!e.isOnAll&&(!n&&e.isOnTouch?!(e.isTouched||t):(n?e.isReValidateOnBlur:e.isOnBlur)?!t:!(n?e.isReValidateOnChange:e.isOnChange)||t)},dn=function(e){return e.substring(0,e.indexOf("["))},mn=function(e,t){return[].concat(e).some(function(e){return function(e,t){return RegExp(("^"+t+"([|.)\\d+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e)}(t,e)})},fn="undefined"!=typeof window&&"undefined"!=typeof document;function vn(e){var t,n;if(Zt(e)||fn&&(e instanceof File||bt(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 new Date(e.getTime());if(e instanceof Set){n=new Set;for(var r,i=p(e);!(r=i()).done;)n.add(r.value);return n}if(e instanceof Map){n=new Map;for(var l,a=p(e.keys());!(l=a()).done;){var o=l.value;n.set(o,vn(e.get(o)))}return n}for(var u in n=Array.isArray(e)?[]:{},e)n[u]=vn(e[u]);return n}var pn=function(e){return{isOnSubmit:!e||"onSubmit"===e,isOnBlur:"onBlur"===e,isOnChange:"onChange"===e,isOnAll:"all"===e,isOnTouch:"onTouched"===e}},gn=function(e){return xt(e)||Ut(e)},En="undefined"==typeof window,yn=fn?"Proxy"in window:"undefined"!=typeof Proxy,hn=t.createContext(null);hn.displayName="RHFContext";var Cn=function(e){var n=e.as,r=e.render,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),l=function(e){var n=e.name,r=e.rules,i=e.defaultValue,l=e.control,a=e.onFocus,o=t.useContext(hn);if("production"!==process.env.NODE_ENV&&!l&&!o)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");var u=l||o.control,c=u.defaultValuesRef,s=u.setValue,d=u.register,m=u.unregister,f=u.trigger,v=u.mode,p=u.reValidateMode,g=p.isReValidateOnBlur,E=p.isReValidateOnChange,y=u.formState,h=u.formStateRef.current,C=h.isSubmitted,b=h.touched,O=h.errors,S=u.updateFormState,N=u.readFormStateRef,I=u.fieldsRef,w=u.shallowFieldsStateRef,_=!mn(u.fieldArrayNamesRef.current,n),D=function(){return!Lt(Rt(w.current,n))&&_?Rt(w.current,n):Lt(i)?Rt(c.current,n):i},T=t.useState(D()),L=T[0],R=T[1],A=t.useRef(L),M=t.useRef({focus:function(){return null}}),P=t.useRef(a||function(){nn(M.current.focus)&&M.current.focus(),"production"!==process.env.NODE_ENV&&(nn(M.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"))}),x=t.useCallback(function(e){return!sn(Object.assign({isBlurEvent:e,isReValidateOnBlur:g,isReValidateOnChange:E,isSubmitted:C,isTouched:!!Rt(b,n)},v))},[g,E,C,b,n,v]),k=t.useCallback(function(e){var t,n=Zt(t=e[0])||!Nt(t.target)||Nt(t.target)&&!t.type?t:Lt(t.target.value)?t.target.checked:t.target.value;return R(n),A.current=n,n},[]),U=t.useCallback(function(e){if("production"!==process.env.NODE_ENV&&!n)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");I.current[n]?I.current[n]=Object.assign({ref:I.current[n].ref},r):(d(Object.defineProperties({name:n,focus:P.current},{value:{set:function(e){R(e),A.current=e},get:function(){return A.current}}}),r),e=Lt(Rt(c.current,n))),e&&_&&R(D())},[r,n,d]);t.useEffect(function(){return function(){return m(n)}},[n]),t.useEffect(function(){"production"!==process.env.NODE_ENV&&(Lt(L)&&console.warn("📋 "+n+" 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)"),!_&&Lt(i)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),U()},[U]),t.useEffect(function(){!I.current[n]&&U(!0)});var B=t.useCallback(function(){N.current.touched&&!Rt(b,n)&&(Dt(b,n,!0),S({touched:b})),x(!0)&&f(n)},[n,S,x,f,N]);return{field:{onChange:t.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s(n,k(t),{shouldValidate:x(),shouldDirty:!0})},[s,n,x]),onBlur:B,name:n,value:L,ref:M},meta:Object.defineProperties({invalid:!!Rt(O,n)},{isDirty:{get:function(){return!!Rt(y.dirtyFields,n)}},isTouched:{get:function(){return!!Rt(y.touched,n)}}})}}(e),a=l.field,o=l.meta,u=Object.assign(Object.assign({},i),a);return n?t.isValidElement(n)?t.cloneElement(n,u):t.createElement(n,u):r?r(a,o):null},bn=function(e){var r=e.control,i=e.t,l=window.Digit.Utils.browser.isMobile();return n.createElement(t.Fragment,null,n.createElement(o.SearchField,{className:"pt-form-field"},n.createElement("label",null,i("AUDIT_FROM_DATE_LABEL")),n.createElement(Cn,{render:function(e){return n.createElement(o.DatePicker,{date:e.value,onChange:e.onChange})},name:"fromDate",control:r})),n.createElement(o.SearchField,{className:"pt-form-field"},n.createElement("label",null,i("AUDIT_TO_DATE_LABEL")),n.createElement(Cn,{render:function(e){return n.createElement(o.DatePicker,{date:e.value,onChange:e.onChange})},name:"toDate",control:r})),n.createElement(o.SearchField,{className:"pt-search-action-submit"},n.createElement(o.SubmitBar,{style:{marginTop:l?"510px":"25px",marginLeft:l?"0":"-30px",maxWidth:l?"100%":"240px"},label:i("ES_COMMON_APPLY"),submit:!0})))},On=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Sn=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Nn=function(e){var r,i=e.Controller,l=e.register,a=e.control,u=e.t,c=e.reset,s=e.previousPage,m=e.handleSubmit,v=e.tenantId,p=e.data,g=e.onSubmit,E=e.isLoading,y=t.useState([]),h=y[0],C=y[1],b=function(e){return n.createElement("div",{onClick:e.onClick},n.createElement(o.DownloadBtnCommon,null))};t.useEffect(function(){(null==p?void 0:p.length)>0&&C([null==p?void 0:p.map(function(e){var t,n,r={};return r[u("AUDIT_DATE_LABEL")]=O(null==e?void 0:e.timestamp)||"-",r[u("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp)||"-",r[u("AUDIT_DATAVIEWED_LABEL")]=(null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",r[u("AUDIT_DATAVIEWED_BY_LABEL")]=(null==e?void 0:e.dataViewedBy)||"-",r[u("AUDIT_ROLE_LABEL")]=(null==e||null===(n=e.roles)||void 0===n?void 0:n.map(function(e){return e.name}).join(", "))||"-",d({},r)})])},[p]);var O=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},S=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},N=t.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),I=N[0],w=N[1],_=function(){w({type:"remove"})},D=function(){return n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:_},n.createElement(o.CloseSvg,null))},T={Controller:i,register:l,control:a,t:u,reset:c,previousPage:s},L=t.useCallback(function(e){return function(e){var t=e.currentlyActiveMobileModal,r=e.searchFormFieldsComponentProps,i=e.tenantId,l=f(e,On),a=l.closeMobilePopupModal;switch(t){case"SearchFormComponent":return n.createElement(o.SearchForm,l,n.createElement(D,null),n.createElement("div",{className:"MobilePopupHeadingWrapper"},n.createElement("h2",null,u("PRIVACY_AUDIT_REPORT"),":")),n.createElement(bn,d({},r,{closeMobilePopupModal:a,tenantId:i,t:u})));default:return n.createElement("span",null)}}(d({currentlyActiveMobileModal:e.currentlyActiveMobileModal,searchFormFieldsComponentProps:e.searchFormFieldsComponentProps,tenantId:e.tenantId},f(e,Sn)))},[I]);null==p||null===(r=p.roles)||void 0===r||r.forEach(function(e){});var R=t.useMemo(function(){return null!=p&&p.display||""===p?[]:null==p?void 0:p.map(function(e){var t,n,r,i;return(i={})[u("AUDIT_DATE_LABEL")]=O(e.timestamp)||"-",i[u("AUDIT_TIME_LABEL")]=S(e.timestamp)||"-",i[u("AUDIT_DATAVIEWED_LABEL")]=(null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",i[u("AUDIT_DATAVIEWED_BY_LABEL")]=e.dataViewedBy||"-",i[u("AUDIT_ROLE_LABEL")]=(null===(n=e.roles)||void 0===n||null===(r=n.slice(0,3))||void 0===r?void 0:r.map(function(e){return e.name}).join(", "))||"-",i})},[p]);return n.createElement(n.Fragment,null,n.createElement(o.BackButton,null),n.createElement("div",{className:"sideContent",style:{marginLeft:"65%",marginTop:"-12%"}},n.createElement(b,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(h)}})),n.createElement(o.Header,null,u("PRIVACY_AUDIT_REPORT"),":"),n.createElement("div",{className:"searchBox"},n.createElement(o.SearchAction,{text:u("ES_COMMON_SEARCH"),handleActionClick:function(){return w({type:"set",payload:"SearchFormComponent"})},tenantId:v,t:u})),I?n.createElement(o.PopUp,null,n.createElement(L,{onSubmit:function(e){w({type:"remove"}),g(e)},handleSubmit:m,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:T,currentlyActiveMobileModal:I,closeMobilePopupModal:_,tenantId:v})):null,E&&n.createElement(o.Loader,null),n.createElement(o.DetailsCard,{data:R}))},In=function(e){var r=e.showLoader,i=e.isLoading,l=e.tenantId,a=e.t,u=e.onSubmit,c=e.data,s=e.count,m=function(e){var n=void 0===e?{}:e,r=n.mode,i=void 0===r?"onSubmit":r,l=n.reValidateMode,a=void 0===l?"onChange":l,o=n.resolver,u=n.context,c=n.defaultValues,s=void 0===c?{}:c,d=n.shouldFocusError,m=void 0===d||d,f=n.shouldUnregister,v=void 0===f||f,g=n.criteriaMode,E=t.useRef({}),y=t.useRef({}),h=t.useRef({}),C=t.useRef(new Set),b=t.useRef({}),O=t.useRef({}),S=t.useRef({}),I=t.useRef({}),w=t.useRef(s),_=t.useRef(!1),D=t.useRef(!1),T=t.useRef(),L=t.useRef({}),R=t.useRef({}),A=t.useRef(u),M=t.useRef(o),P=t.useRef(new Set),x=t.useRef(pn(i)),k=x.current,U=k.isOnSubmit,B=k.isOnTouch,F="all"===g,j=t.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!U,errors:{}}),V=j[0],H=j[1],G=t.useRef({isDirty:!yn,dirtyFields:!yn,touched:!yn||B,isValidating:!yn,isSubmitting:!yn,isValid:!yn}),z=t.useRef(V),W=t.useRef(),q=t.useRef(pn(a)).current,X=q.isOnBlur,Z=q.isOnChange;A.current=u,M.current=o,z.current=V,L.current=v?{}:zt(L.current)?vn(s):L.current;var Y=t.useCallback(function(e){void 0===e&&(e={}),_.current||(z.current=Object.assign(Object.assign({},z.current),e),H(z.current))},[]),K=function(){return G.current.isValidating&&Y({isValidating:!0})},J=t.useCallback(function(e,t,n,r,i){void 0===n&&(n=!1),void 0===r&&(r={});var l=n||function(e){var t=e.errors,n=e.name,r=e.error,i=e.validFields,l=e.fieldsWithValidation,a=Lt(r),o=Rt(t,n);return a&&!!o||!a&&!Kt(o,r,!0)||a&&Rt(l,n)&&!Rt(i,n)}({errors:z.current.errors,error:t,name:e,validFields:I.current,fieldsWithValidation:S.current}),a=Rt(z.current.errors,e);t?(qt(I.current,e),l=l||!a||!Kt(a,t,!0),Dt(z.current.errors,e,t)):((Rt(S.current,e)||M.current)&&(Dt(I.current,e,!0),l=l||a),qt(z.current.errors,e)),(l&&!Ot(n)||!zt(r)||G.current.isValidating)&&Y(Object.assign(Object.assign(Object.assign({},r),M.current?{isValid:!!i}:{}),{isValidating:!1}))},[]),Q=t.useCallback(function(e,t){var n=E.current[e],r=n.ref,i=n.options,l=fn&&bt(r)&&Ot(t)?"":t;xt(r)?(i||[]).forEach(function(e){var t=e.ref;return t.checked=t.value===l}):kt(r)&&!Qt(l)?r.files=l:Bt(r)?[].concat(r.options).forEach(function(e){return e.selected=l.includes(e.value)}):Ut(r)&&i?i.length>1?i.forEach(function(e){var t=e.ref;return t.checked=Array.isArray(l)?!!l.find(function(e){return e===t.value}):l===t.value}):i[0].ref.checked=!!l:r.value=l},[]),$=t.useCallback(function(e,t){if(G.current.isDirty){var n=ce();return e&&t&&Dt(n,e,t),!Kt(n,w.current)}return!1},[]),ee=t.useCallback(function(e,t){if(void 0===t&&(t=!0),G.current.isDirty||G.current.dirtyFields){var n=!Kt(Rt(w.current,e),Ht(E,e,L)),r=Rt(z.current.dirtyFields,e),i=z.current.isDirty;n?Dt(z.current.dirtyFields,e,!0):qt(z.current.dirtyFields,e);var l={isDirty:$(),dirtyFields:z.current.dirtyFields},a=G.current.isDirty&&i!==l.isDirty||G.current.dirtyFields&&r!==Rt(z.current.dirtyFields,e);return a&&t&&Y(l),a?l:{}}return{}},[]),te=t.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||E.current[e]?Promise.resolve(on(E,F,E.current[e],L)).then(function(n){var r=n[e];return J(e,r,t),Lt(r)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[J,F]),ne=t.useCallback(function(e){try{return Promise.resolve(M.current(ce(),A.current,F)).then(function(t){var n=t.errors,r=z.current.isValid;if(Array.isArray(e)){var i=e.map(function(e){var t=Rt(n,e);return t?Dt(z.current.errors,e,t):qt(z.current.errors,e),!t}).every(Boolean);return Y({isValid:zt(n),isValidating:!1}),i}var l=Rt(n,e);return J(e,l,r!==zt(n),{},zt(n)),!l})}catch(e){return Promise.reject(e)}},[J,F]),re=t.useCallback(function(e){try{var t=function(e){return n?e:Promise.resolve(te(r))},n=!1,r=e||Object.keys(E.current);if(K(),M.current)return Promise.resolve(ne(r));var i=function(){if(Array.isArray(r))return!e&&(z.current.errors={}),Promise.resolve(Promise.all(r.map(function(e){try{return Promise.resolve(te(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){Y({isValidating:!1});var t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(i&&i.then?i.then(t):t(i))}catch(e){return Promise.reject(e)}},[ne,te]),ie=t.useCallback(function(e,t,n){var r=n.shouldDirty,i=n.shouldValidate,l={};Dt(l,e,t);for(var a,o=p(un(e,t));!(a=o()).done;){var u=a.value;E.current[u]&&(Q(u,Rt(l,u)),r&&ee(u),i&&re(u))}},[re,Q,ee]),le=t.useCallback(function(e,t,n){if(!v&&!Zt(t)&&Dt(L.current,e,Array.isArray(t)?[].concat(t):Object.assign({},t)),E.current[e])Q(e,t),n.shouldDirty&&ee(e),n.shouldValidate&&re(e);else if(!Zt(t)&&(ie(e,t,n),P.current.has(e))){var r,i,l=dn(e)||e;Dt(y.current,e,t),R.current[l](((r={})[l]=Rt(y.current,l),r)),(G.current.isDirty||G.current.dirtyFields)&&n.shouldDirty&&(Dt(z.current.dirtyFields,e,function(e,t,n){return Yt(Jt(e,t,n.slice(0,e.length)),Jt(t,e,n.slice(0,e.length)))}(t,Rt(w.current,e,[]),Rt(z.current.dirtyFields,e,[]))),Y({isDirty:!Kt(Object.assign(Object.assign({},ce()),(i={},i[e]=t,i)),w.current)}))}!v&&Dt(L.current,e,t)},[ee,Q,ie]),ae=function(e){return D.current||C.current.has(e)||C.current.has((e.match(/\w+/)||[])[0])},oe=function(e){var t=!0;if(!zt(b.current))for(var n in b.current)e&&b.current[n].size&&!b.current[n].has(e)&&!b.current[n].has(dn(e))||(O.current[n](),t=!1);return t};function ue(e){if(!v){for(var t,n=vn(e),r=p(P.current);!(t=r()).done;){var i,l=t.value;It(l)&&!n[l]&&(n=Object.assign(Object.assign({},n),((i={})[l]=[],i)))}return n}return e}function ce(e){if(Qt(e))return Ht(E,e,L);if(Array.isArray(e)){for(var t,n={},r=p(e);!(t=r()).done;){var i=t.value;Dt(n,i,Ht(E,i,L))}return n}return ue($t(E,vn(L.current),v))}T.current=T.current?T.current:function(e){var t=e.type,n=e.target;try{var r,i,l=n.name,a=E.current[l];return Promise.resolve(function(){if(a){var e=function(){!o&&oe(l),J(l,r,s,c,i)},o="blur"===t,u=sn(Object.assign({isBlurEvent:o,isReValidateOnChange:Z,isReValidateOnBlur:X,isTouched:!!Rt(z.current.touched,l),isSubmitted:z.current.isSubmitted},x.current)),c=ee(l,!1),s=!zt(c)||!o&&ae(l);if(o&&!Rt(z.current.touched,l)&&G.current.touched&&(Dt(z.current.touched,l,!0),c=Object.assign(Object.assign({},c),{touched:z.current.touched})),!v&&Ut(n)&&Dt(L.current,l,Ht(E,l)),u)return!o&&oe(l),(!zt(c)||s&&zt(c))&&Y(c);K();var d=M.current?Promise.resolve(M.current(ce(),A.current,F)).then(function(e){var t=e.errors,a=z.current.isValid;if(r=Rt(t,l),Ut(n)&&!r&&M.current){var o=dn(l),u=Rt(t,o,{});u.type&&u.message&&(r=u),o&&(u||Rt(z.current.errors,o))&&(l=o)}a!==(i=zt(t))&&(s=!0)}):Promise.resolve(on(E,F,a,L)).then(function(e){r=e[l]});return d&&d.then?d.then(e):e()}}())}catch(e){return Promise.reject(e)}};var se=t.useCallback(function(e){void 0===e&&(e={});try{var t=zt(E.current)?w.current:{};return Promise.resolve(M.current(Object.assign(Object.assign(Object.assign({},t),ce()),e),A.current,F)).then(function(e){var t=zt(e.errors);z.current.isValid!==t&&Y({isValid:t})})}catch(e){return Promise.reject(e)}},[F]),de=t.useCallback(function(e,t){!function(e,t,n,r,i,l){var a=n.ref,o=n.ref.name,u=e.current[o];if(!i){var c=Ht(e,o,r);!Lt(c)&&Dt(r.current,o,c)}a.type&&u?xt(a)||Ut(a)?Array.isArray(u.options)&&u.options.length?(wt(u.options).forEach(function(e,n){void 0===e&&(e={}),(Gt(e.ref)&&Xt(e,e.ref)||l)&&(At(e.ref,t),qt(u.options,"["+n+"]"))}),u.options&&!wt(u.options).length&&delete e.current[o]):delete e.current[o]:(Gt(a)&&Xt(u,a)||l)&&(At(a,t),delete e.current[o]):delete e.current[o]}(E,T.current,e,L,v,t),v&&(qt(I.current,e.ref.name),qt(S.current,e.ref.name))},[v]),me=t.useCallback(function(e){if(D.current)Y();else{for(var t,n=p(C.current);!(t=n()).done;)if(t.value.startsWith(e)){Y();break}oe(e)}},[]),fe=t.useCallback(function(e,t){e&&(de(e,t),v&&!wt(e.options||[]).length&&(qt(z.current.errors,e.ref.name),Dt(z.current.dirtyFields,e.ref.name,!0),Y({isDirty:$()}),G.current.isValid&&M.current&&se(),me(e.ref.name)))},[se,de]),ve=t.useCallback(function(e,t,n){var r=n?b.current[n]:C.current,i=$t(E,vn(L.current),v,!1,e);if(Qt(e)){var l=dn(e)||e;return P.current.has(l)&&(i=Object.assign(Object.assign({},h.current),i)),cn(i,e,r,Lt(Rt(w.current,e))?t:Rt(w.current,e),!0)}var a=Lt(t)?w.current:t;return Array.isArray(e)?e.reduce(function(e,t){var n;return Object.assign(Object.assign({},e),((n={})[t]=cn(i,t,r,a),n))},{}):(D.current=Lt(n),Tt(!zt(i)&&i||a))},[]);function pe(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(P.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")}var n,r=e.name,i=e.type,l=e.value,a=Object.assign({ref:e},t),o=E.current,u=gn(e),c=mn(P.current,r),s=function(t){return fn&&(!bt(e)||t===e)},d=o[r],m=!0;if(d&&(u?Array.isArray(d.options)&&wt(d.options).find(function(e){return l===e.ref.value&&s(e.ref)}):s(d.ref)))o[r]=Object.assign(Object.assign({},d),t);else{d=i?u?Object.assign({options:[].concat(wt(d&&d.options||[]),[{ref:e}]),ref:{type:i,name:r}},t):Object.assign({},a):a,o[r]=d;var f=Lt(Rt(L.current,r));zt(w.current)&&f||(n=Rt(f?w.current:L.current,r),(m=Lt(n))||c||Q(r,n)),zt(t)||(Dt(S.current,r,!0),!U&&G.current.isValid&&on(E,F,d,L).then(function(e){var t=z.current.isValid;zt(e)?Dt(I.current,r,!0):qt(I.current,r),t!==zt(e)&&Y()})),!v||c&&m||!c&&qt(z.current.dirtyFields,r),i&&function(e,t,n){var r=e.ref;bt(r)&&n&&(r.addEventListener(t?"change":"input",n),r.addEventListener("blur",n))}(u&&d.options?d.options[d.options.length-1]:d,u||"select-one"===e.type,T.current)}}var ge=t.useCallback(function(e,t){return function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());var r={},i=ue($t(E,vn(L.current),v,!0));return G.current.isSubmitting&&Y({isSubmitting:!0}),Promise.resolve(function(l,a){try{var o=function(){function l(){var l=function(){if(zt(r)&&Object.keys(z.current.errors).every(function(e){return e in E.current}))return Y({errors:{},isSubmitting:!0}),Promise.resolve(e(i,n)).then(function(){});var l=function(e){m&&function(e,t){for(var n in e)if(Rt(t,n)){var r=e[n];if(r){if(r.ref.focus&&Lt(r.ref.focus()))break;if(r.options){r.options[0].ref.focus();break}}}}(E.current,z.current.errors)};return z.current.errors=Object.assign(Object.assign({},z.current.errors),r),t?Promise.resolve(t(z.current.errors,n)).then(l):l()}();if(l&&l.then)return l.then(function(){})}var a=M.current?Promise.resolve(M.current(i,A.current,F)).then(function(e){var t=e.values;z.current.errors=r=e.errors,i=t}):N(Object.values(E.current),function(e){var t=function(){if(e){var t=e.ref.name;return Promise.resolve(on(E,F,e,L)).then(function(e){e[t]?(Dt(r,t,e[t]),qt(I.current,t)):Rt(S.current,t)&&(qt(z.current.errors,t),Dt(I.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return a&&a.then?a.then(l):l()}()}catch(e){return a(!0,e)}return o&&o.then?o.then(a.bind(null,!1),a.bind(null,!0)):a(!1,o)}(0,function(e,t){if(z.current.isSubmitting=!1,Y({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:zt(z.current.errors),submitCount:z.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}}},[m,F]);t.useEffect(function(){o&&G.current.isValid&&se(),W.current=W.current||!fn?W.current:function(e,t){var n=new MutationObserver(function(){for(var n=0,r=Object.values(e.current);n<r.length;n++){var i=r[n];if(i&&i.options)for(var l,a=p(i.options);!(l=a()).done;){var o=l.value;o&&o.ref&&Gt(o.ref)&&t(i)}else i&&Gt(i.ref)&&t(i)}});return n.observe(window.document,{childList:!0,subtree:!0}),n}(E,fe)},[fe,w.current]),t.useEffect(function(){return function(){W.current&&W.current.disconnect(),_.current=!0,"production"===process.env.NODE_ENV&&Object.values(E.current).forEach(function(e){return fe(e,!0)})}},[]),!o&&G.current.isValid&&(V.isValid=Kt(I.current,S.current)&&zt(z.current.errors));var Ee={trigger:re,setValue:t.useCallback(function(e,t,n){le(e,t,n||{}),ae(e)&&Y(),oe(e)},[le,re]),getValues:t.useCallback(ce,[]),register:t.useCallback(function(e,t){if(!En)if(Qt(e))pe({name:e},t);else{if(!Nt(e)||!("name"in e))return function(t){return t&&pe(t,e)};pe(e,t)}},[w.current]),unregister:t.useCallback(function(e){for(var t,n=p(Array.isArray(e)?e:[e]);!(t=n()).done;)fe(E.current[t.value],!0)},[]),formState:yn?new Proxy(V,{get:function(e,t){if("production"!==process.env.NODE_ENV&&"isValid"===t&&U&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return G.current[t]=!0,e[t]}}):V},ye=t.useMemo(function(){return Object.assign({isFormDirty:$,updateWatchedValue:me,shouldUnregister:v,updateFormState:Y,removeFieldEventListener:de,watchInternal:ve,mode:x.current,reValidateMode:{isReValidateOnBlur:X,isReValidateOnChange:Z},validateResolver:o?se:void 0,fieldsRef:E,resetFieldArrayFunctionRef:R,useWatchFieldsRef:b,useWatchRenderFunctionsRef:O,fieldArrayDefaultValuesRef:y,validFieldsRef:I,fieldsWithValidationRef:S,fieldArrayNamesRef:P,readFormStateRef:G,formStateRef:z,defaultValuesRef:w,shallowFieldsStateRef:L,fieldArrayValuesRef:h},Ee)},[w.current,me,v,de,ve]);return Object.assign({watch:function(e,t){return ve(e,t)},control:ye,handleSubmit:ge,reset:t.useCallback(function(e,t){if(void 0===t&&(t={}),fn)for(var n=0,r=Object.values(E.current);n<r.length;n++){var i=r[n];if(i){var l=i.ref,a=i.options,o=gn(l)&&Array.isArray(a)?a[0].ref:l;if(bt(o))try{o.closest("form").reset();break}catch(e){}}}var u,c,s,d,m,f,p,g;E.current={},w.current=Object.assign({},e||w.current),e&&oe(""),Object.values(R.current).forEach(function(e){return nn(e)&&e()}),L.current=v?{}:vn(e||w.current),c=(u=t).errors,s=u.isDirty,d=u.isSubmitted,m=u.touched,p=u.submitCount,g=u.dirtyFields,(f=u.isValid)||(I.current={},S.current={}),y.current={},C.current=new Set,D.current=!1,Y({submitCount:p?z.current.submitCount:0,isDirty:!!s&&z.current.isDirty,isSubmitted:!!d&&z.current.isSubmitted,isValid:!!f&&z.current.isValid,dirtyFields:g?z.current.dirtyFields:{},touched:m?z.current.touched:{},errors:c?z.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},[]),clearErrors:t.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(function(e){return E.current[e]&&It(e)?delete z.current.errors[e]:qt(z.current.errors,e)}),Y({errors:e?z.current.errors:{}})},[]),setError:t.useCallback(function(e,t){var n=(E.current[e]||{}).ref;Dt(z.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),Y({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:V.errors},Ee)}({defaultValues:Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:10,sortOrder:"ASC"}}),f=m.register,v=m.control,g=m.handleSubmit,E=m.setValue,y=m.getValues,h=m.reset,C=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},b=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},O=t.useState([]),S=O[0],I=O[1],w=function(e){return n.createElement("div",{onClick:e.onClick},n.createElement(o.DownloadBtnCommon,null))};t.useEffect(function(){f("offset",0),f("limit",10)},[f]),t.useEffect(function(){(null==c?void 0:c.length)>0&&I([null==c?void 0:c.map(function(e){var t,n,r={};return r[a("AUDIT_DATE_LABEL")]=C(null==e?void 0:e.timestamp)||"-",r[a("AUDIT_TIME_LABEL")]=b(null==e?void 0:e.timestamp)||"-",r[a("AUDIT_DATAVIEWED_LABEL")]=(null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",r[a("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,r[a("AUDIT_ROLE_LABEL")]=(null==e||null===(n=e.roles)||void 0===n?void 0:n.map(function(e){return e.name}).join(", "))||"-",d({},r)})])},[c]);var _=t.useCallback(function(e){0!==e.length&&(E("sortBy",e.id),E("sortOrder",e.desc?"DESC":"ASC"))},[]);function D(){E("offset",y("offset")-y("limit")),g(u)()}var T=window.Digit.Utils.browser.isMobile();if(T)return n.createElement(Nn,{Controller:Cn,isLoading:i,showLoader:r,register:f,control:v,t:a,reset:h,previousPage:D,handleSubmit:g,tenantId:l,data:c,onSubmit:u});var L=function(e){return n.createElement("span",{className:"cell-text"},e)},R=t.useMemo(function(){return[{Header:a("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?a("WS_NA"):C(e.timestamp);return L(""+(t||"-"))}},{Header:a("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?a("WS_NA"):b(e.timestamp);return L(""+(t||"-"))}},{Header:a(T?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:function(e){var t;return L(""+((null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-"))}},{Header:a(T?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:function(e){return L(""+((null==e?void 0:e.dataViewedBy)||"-"))}},{Header:a("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:function(e){var t,n,r;return L(""+((null==e||null===(t=e.roles)||void 0===t||null===(n=t.slice(0,3))||void 0===n||null===(r=n.map(function(e){return e.name}))||void 0===r?void 0:r.join(", "))||"-"))}}]},[]);return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginRight:"-70px"}}," ",n.createElement(o.BackButton,null)," "),n.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",n.createElement(o.Header,null,a("PRIVACY_AUDIT_REPORT"))," "),n.createElement(o.SearchForm,{className:"audit-card",onSubmit:u,handleSubmit:g},n.createElement(bn,{register:f,control:v,reset:h,tenantId:l,t:a,previousPage:D})),n.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",width:"80%"}},null!=c&&c.display?n.createElement("div",{style:{marginTop:"20x",maxWidth:"680%",marginLeft:"60px",backgroundColor:"white",height:"60px"}},a(c.display).split("\\n").map(function(e,t){return n.createElement("p",{key:t,style:{textAlign:"center",paddingTop:"12px"}},e)})):""!==c?n.createElement("div",{style:{backgroundColor:"white",marginRight:"200px",marginLeft:"2.5%",width:"100%"}},n.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},n.createElement(w,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(S)}})),n.createElement(o.Table,{t:a,data:c.sort(function(e,t){return e.timestamp-t.timestamp}),totalRecords:s,columns:R,getCellProps:function(e){return{style:{minWidth:e.column.Header===a("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}},onPageSizeChange:function(e){E("limit",Number(e.target.value)),g(u)()},currentPage:y("offset")/y("limit"),onNextPage:function(){E("offset",y("offset")+y("limit")),g(u)()},onPrevPage:D,pageSizeLimit:y("limit"),onSort:_,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})):n.createElement(o.Loader,null)))},wn=function(e){var r,i,o,u,c,s,m,f,v,p,g=a.useTranslation().t,E=Digit.ULBService.getCitizenCurrentTenant(),y=t.useState({}),h=y[0],C=y[1],b=window.Digit.Utils.browser.isMobile(),O=function(e,t){void 0===t&&(t="dayend");try{var n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),r=new Date(Date.UTC(n[1],n[2]-1,n[3]));return r.setMinutes(r.getMinutes()+r.getTimezoneOffset()),"dayend"===t&&(r.setHours(r.getHours()+24),r.setSeconds(r.getSeconds()-1)),"daystart"===t&&(r.setHours(r.getHours()),r.setSeconds(r.getSeconds()+1)),r.getTime()}catch(t){return e}};t.useEffect(function(){var e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){var t=d({},e);C(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]="object"==typeof t[n]?t[n].code:t[n],r))},{}))}},[]);var S,N,I={enabled:!!(h&&Object.keys(h).length>0)},w=window.location.href.split("/").pop();isNaN(parseInt(w))?S=10:(N=w,S=parseInt(w)+10);var _=b?d({},h,{offset:isNaN(parseInt(w))?0:parseInt(N)}):d({},h),D=Digit.Hooks.useAudit({tenantId:E,filters:d({},_),config:I}),T=D.isLoading,L=D.data;return n.createElement(n.Fragment,null,n.createElement(In,{t:g,tenantId:E,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:10});var t=d({},e,{fromDate:O(null==e?void 0:e.fromDate,(null==e?void 0:e.fromDate)==(null==e?void 0:e.toDate)?"daystart":""),toDate:O(null==e?void 0:e.toDate,(null==e?void 0:e.fromDate)==(null==e?void 0:e.toDate)?"dayend":"")});C(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]=t[n],r))},{}))},data:T?"":(null==L||null===(r=L.ElasticSearchData)||void 0===r||null===(i=r.filter(function(e){return!e.total}))||void 0===i?void 0:i.length)>0?null==L||null===(o=L.ElasticSearchData)||void 0===o?void 0:o.filter(function(e){return!e.total}):{display:"ES_COMMON_NO_DATA"},count:null==L||null===(u=L.ElasticSearchData)||void 0===u||null===(c=u.filter(function(e){return e.total}))||void 0===c||null===(s=c[0])||void 0===s?void 0:s.total,isLoading:T}),b&&(null==L||null===(m=L.ElasticSearchData)||void 0===m||null===(f=m.filter(function(e){return!e.total}))||void 0===f?void 0:f.length)&&0!==(null==L||null===(v=L.ElasticSearchData)||void 0===v||null===(p=v.filter(function(e){return!e.total}))||void 0===p?void 0:p.length)&&n.createElement("div",null,n.createElement("p",{style:{marginLeft:"16px",marginBottom:"40px"}},n.createElement("span",{className:"link"},n.createElement(l.Link,{to:"/digit-ui/citizen/Audit/"+S},g("PT_LOAD_MORE_MSG"))))))},_n=["digit-ui/citizen/register/name","/digit-ui/citizen/select-language","/digit-ui/citizen/select-location","/digit-ui/citizen/login","/digit-ui/citizen/register/otp"],Dn=function(e,t){return t.filter(function(t){return e.map(function(e){return e.code}).includes(t.code)})},Tn=function(e){var t,r,i,u=e.stateInfo,c=e.userDetails,s=e.CITIZEN,d=e.cityDetails,m=e.mobileView,f=e.handleUserDropdownSelection,v=e.logoUrl,p=e.stateCode,E=e.modules,y=e.appTenants,C=e.pathname,b=e.initData,O=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:"[?(@.url == 'digit-ui-card')]"}],{select:function(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(function(e){return!0===e.enabled}).reduce(function(e,t){var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t].concat(e[t.parentModule]):[t],e},{})}}),S=O.isLoading,N=O.data,I=O.isFetched,w=Digit.Hooks.fsm.useRouteSubscription(C),_=a.useTranslation().t,D=l.useRouteMatch().path,T=l.useHistory(),L=_n.some(function(e){return window.location.href.includes(e)}),R=E.map(function(e,t){var r=e.code,i=e.tenants,a=Digit.ComponentRegistryService.getComponent(r+"Module");return a?n.createElement(l.Route,{key:t,path:D+"/"+r.toLowerCase()},n.createElement(a,{stateCode:p,moduleCode:r,userType:"citizen",tenants:Dn(i,y)})):null}),A=E.map(function(e,t){var r=e.code,i=e.bannerImage,a=(Digit.ComponentRegistryService.getComponent(r+"Links"),I?g(N,r,_):void 0);return(null==a?void 0:a.links)&&(null==a||a.links.sort(function(e,t){return e.orderNumber-t.orderNumber})),n.createElement(n.Fragment,null,n.createElement(l.Route,{key:t,path:D+"/"+r.toLowerCase()+"-home"},n.createElement("div",{className:"moduleLinkHomePage"},n.createElement("img",{src:i||(null==u?void 0:u.bannerUrl),alt:"noimagefound"}),n.createElement(o.BackButton,{className:"moduleLinkHomePageBackButton"}),n.createElement("h1",null,_("MODULE_"+r.toUpperCase())),n.createElement("div",{className:"moduleLinkHomePageModuleLinks"},a&&n.createElement(o.CitizenHomeCard,{header:_(null==a?void 0:a.header),links:null==a?void 0:a.links,Icon:function(){return n.createElement("span",null)},Info:"OBPS"===r?function(){return n.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:_("CS_FILE_APPLICATION_INFO_LABEL"),text:_("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===r})),n.createElement(Ct,{moduleCode:null==r?void 0:r.toUpperCase()}))),n.createElement(l.Route,{key:"faq"+t,path:D+"/"+r.toLowerCase()+"-faq"},n.createElement(yt,{module:null==r?void 0:r.toUpperCase()})),n.createElement(l.Route,{key:"hiw"+t,path:D+"/"+r.toLowerCase()+"-how-it-works"},n.createElement(ht,{module:null==r?void 0:r.toUpperCase()})))});return n.createElement("div",{className:w},n.createElement(ct,{t:_,stateInfo:u,userDetails:c,CITIZEN:s,cityDetails:d,mobileView:m,handleUserDropdownSelection:f,logoUrl:v,showSidebar:!0,linkData:N,islinkDataLoading:S}),n.createElement("div",{className:"main center-container citizen-home-container mb-25"},L?null:n.createElement("div",{className:"SideBarStatic"},n.createElement(nt,{linkData:N,islinkDataLoading:S})),n.createElement(l.Switch,null,n.createElement(l.Route,{exact:!0,path:D},n.createElement(vt,null)),n.createElement(l.Route,{exact:!0,path:D+"/select-language"},n.createElement(pt,null)),n.createElement(l.Route,{exact:!0,path:D+"/select-location"},n.createElement(gt,null)),n.createElement(l.Route,{path:D+"/error"},n.createElement(Ve,{initData:b,goToHome:function(){T.push("/digit-ui/citizen")}})),n.createElement(l.Route,{path:D+"/all-services"},n.createElement(h,{userType:"citizen",modules:E,getCitizenMenu:N,fetchedCitizen:I,isLoading:S})),n.createElement(l.Route,{path:D+"/login"},n.createElement(x,{stateCode:p})),n.createElement(l.Route,{path:D+"/register"},n.createElement(x,{stateCode:p,isUserRegistered:!1})),n.createElement(l.Route,{path:D+"/user/profile"},n.createElement(dt,{stateCode:p,userType:"citizen",cityDetails:d})),n.createElement(l.Route,{path:D+"/Audit"},n.createElement(wn,null)),n.createElement(Ge,{initData:b},R,A))),n.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:function(){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()}})))},Ln=function(e){var r,i=e.stateCode,a=e.modules,o=e.appTenants,u=e.logoUrl,c=e.initData,s=l.useHistory(),d=l.useLocation().pathname,m=window.innerWidth,f=Digit.ULBService.getCurrentUlb(),v=Digit.UserService.getUser(),p=(Digit.Hooks.useStore.getInitData().data||{}).stateInfo,g=Digit.UserService.hasAccess(["FSM_DSO"]),E="CITIZEN"===(null==v||null===(r=v.info)||void 0===r?void 0:r.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(E=!1),t.useEffect(function(){null!=d&&d.includes("application-details")||(null!=d&&d.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=d&&d.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=d&&d.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),"/digit-ui/employee"===(null==d?void 0:d.toString())&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),"/digit-ui/citizen"!==(null==d?void 0:d.toString())&&"/digit-ui/employee"!==(null==d?void 0:d.toString())||Digit.SessionStorage.del("WS_DISCONNECTION")},[d]),s.listen(function(){var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});var y={stateInfo:p,userDetails:v,CITIZEN:E,cityDetails:f,mobileView:m<=640,handleUserDropdownSelection:function(e){e.func()},logoUrl:u,DSO:g,stateCode:i,modules:a,appTenants:o,sourceUrl:window.location.origin+"/citizen",pathname:d,initData:c};return n.createElement(l.Switch,null,n.createElement(l.Route,{path:"/digit-ui/employee"},n.createElement(ft,y)),n.createElement(l.Route,{path:"/digit-ui/citizen"},n.createElement(Tn,y)),n.createElement(l.Route,null,n.createElement(l.Redirect,{to:"/digit-ui/citizen"})))},Rn=[s],An=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):c.compose)(c.applyMiddleware.apply(void 0,Rn)),Mn=function(e,t){return void 0===t&&(t={}),c.createStore(function(e,t){return c.combineReducers(d({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return d({},e,{selectedLanguage:t.payload});default:return e}})},t));var n}(e,t),An)},Pn=function(e){var t,r=e.stateCode,u=e.moduleReducers,c=Digit.Hooks.useInitStore(r,e.enabledModules),s=c.data;return c.isLoading?n.createElement(o.Loader,{page:!0}):(a.getI18n(),n.createElement(i.Provider,{store:Mn(s,u(s))},n.createElement(l.BrowserRouter,null,n.createElement(o.Body,null,n.createElement(Ln,{initData:s,stateCode:r,modules:null==s?void 0:s.modules,appTenants:s.tenants,logoUrl:null==s||null===(t=s.stateInfo)||void 0===t?void 0:t.logoUrl})))))},xn={SelectOtp:D};exports.DigitUI=function(e){var i=e.stateCode,l=e.registry,a=e.enabledModules,o=e.moduleReducers,u=t.useState(Digit.Utils.getPrivacyObject()||{}),c=u[0],s=u[1],m=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retryDelay:function(e){return Infinity},retry:!1}}})),f=Digit.Contexts.ComponentProvider,v=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),n.createElement("div",null,n.createElement(Ge,null,n.createElement(r.QueryClientProvider,{client:m},n.createElement(f.Provider,{value:l},n.createElement(v.Provider,{value:{privacy:null==c?void 0:c[window.location.pathname],resetPrivacy:function(e){Digit.Utils.setPrivacyObject({}),s({})},getPrivacy:function(){var e=Digit.Utils.getPrivacyObject();return s(e),e},updatePrivacyDescoped:function(e){var t,n=Digit.Utils.getAllPrivacyObject(),r=d({},n,((t={})[window.location.pathname]=e,t));Digit.Utils.setPrivacyObject(d({},r)),s((null==n?void 0:n[window.location.pathname])||{})},updatePrivacy:function(e,t){s(Digit.Utils.updatePrivacy(e,t)||{})}}},n.createElement(Pn,{stateCode:i,enabledModules:a,moduleReducers:o}))))))},exports.initCoreComponents=function(){Object.entries(xn).forEach(function(e){Digit.ComponentRegistryService.setComponent(e[0],e[1])})};
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egovernments/digit-ui-module-core",
|
|
3
|
-
"version": "1.6.0
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"description": "Digit App Core Module contains all core components",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"module": "dist/index.modern.js",
|
|
7
8
|
"source": "src/Module.js",
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
"prepublish": "yarn build"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
|
-
"@egovernments/digit-ui-react-components": "1.6.0
|
|
18
|
+
"@egovernments/digit-ui-react-components": "1.6.0",
|
|
18
19
|
"react": "17.0.2",
|
|
19
20
|
"react-dom": "17.0.2",
|
|
20
21
|
"react-i18next": "11.16.2",
|