@egovernments/digit-ui-module-core 2.0.0-dev-16 → 2.0.0-dev-17

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/main.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see main.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@egovernments/digit-ui-components"),require("React"),require("react-i18next"),require("@tanstack/react-query"),require("react-redux"),require("react-router-dom"),require("@egovernments/digit-ui-svg-components"),require("@egovernments/digit-ui-react-components"),require("redux"),require("redux-thunk")):"function"==typeof define&&define.amd?define(["@egovernments/digit-ui-components","React","react-i18next","@tanstack/react-query","react-redux","react-router-dom","@egovernments/digit-ui-svg-components","@egovernments/digit-ui-react-components","redux","redux-thunk"],t):"object"==typeof exports?exports["@egovernments/digit-ui-module-core"]=t(require("@egovernments/digit-ui-components"),require("React"),require("react-i18next"),require("@tanstack/react-query"),require("react-redux"),require("react-router-dom"),require("@egovernments/digit-ui-svg-components"),require("@egovernments/digit-ui-react-components"),require("redux"),require("redux-thunk")):e["@egovernments/digit-ui-module-core"]=t(e["@egovernments/digit-ui-components"],e.React,e["react-i18next"],e["@tanstack/react-query"],e["react-redux"],e["react-router-dom"],e["@egovernments/digit-ui-svg-components"],e["@egovernments/digit-ui-react-components"],e.redux,e["redux-thunk"])}(this,(e,t,n,i,o,r,l,a,s,d)=>(()=>{var u={5697(e,t,n){"use strict";n.d(t,{A:()=>o}),n(4883);var i=n(6870);const o=e=>{var{children:t}=e;return(0,i.jsx)("div",{className:"banner banner-container",children:t})}},358(e,t,n){"use strict";n.d(t,{A:()=>s});var i=n(6243),o=n(4883),r=n(4442),l=n(6870),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(""==t)return e;for(;null!==(i=e)&&void 0!==i&&i.includes(t);){var i,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e};const s=e=>{var t,n,[s,d]=(0,o.useState)(null),[u,c]=(0,o.useState)([]),[v,m]=(0,o.useState)([]),p=(0,r.useNavigate)(),g=(e.dropdown,Digit.Utils.getMultiRootTenant());return(0,o.useEffect)(()=>{var e,t=Digit.SessionStorage.get("citizen.userRequestObject"),n=[],i=[];null==t||null===(e=t.info)||void 0===e||null===(e=e.roles)||void 0===e||e.forEach(e=>n.push(e.tenantId));var o=n.filter((e,t,n)=>n.indexOf(e)===t);null==o||o.forEach(e=>{var t;i.push({label:"TENANT_TENANTS_".concat(null===(t=a(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),null==i||i.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),c(i)},[s]),(0,l.jsx)("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{},children:g&&1==u.length?(0,l.jsx)(i.CardText,{style:{color:"#363636"},children:null==u||null===(t=u[0])||void 0===t?void 0:t.value}):(0,l.jsx)(i.Dropdown,{t:null==e?void 0:e.t,option:u,selected:u.find(e=>e.value===(null==s?void 0:s.value)),optionKey:"label",select:e=>{var t,n,i,o=Digit.SessionStorage.get("citizen.userRequestObject"),r=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(t=t.info)||void 0===t||null===(t=t.roles)||void 0===t?void 0:t.filter(t=>t.tenantId===e.value);if((null==r?void 0:r.length)>0&&(o.info.roles=r,o.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(o),d(e),"undefined"!=typeof window&&null!==(n=window.location)&&void 0!==n&&null!==(n=n.href)&&void 0!==n&&n.includes("/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/employee/"))){var l,a,s=(null===(l=location.state)||void 0===l?void 0:l.from)||"/".concat(null===(a=window)||void 0===a?void 0:a.contextPath,"/employee");p(s,{replace:!0})}try{"undefined"!=typeof window&&window.location.reload()}catch(e){console.warn("Failed to reload page:",e)}},freeze:!0,customSelector:(0,l.jsx)("label",{className:"cp",children:null==e?void 0:e.t("TENANT_TENANTS_".concat(null===(n=a(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===n?void 0:n.toUpperCase()))})})})}},3015(e,t,n){"use strict";n.d(t,{A:()=>s});var i=n(6243),o=n(4883),r=n.n(o),l=n(5953),a=n(6870);const s=e=>{var t,n=e.dropdown||!1,{data:s,isLoading:d}=Digit.Hooks.useStore.getInitData(),{languages:u,stateInfo:c}=s||{},{t:v}=(0,l.useTranslation)(),m=Digit.StoreData.getCurrentLanguage(),[p,g]=(0,o.useState)(m),f=e=>{g(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)};return d?null:n?(0,a.jsx)("div",{children:(0,a.jsx)(i.Dropdown,{className:"language-dropdown",option:u,selected:null==u?void 0:u.find(e=>(null==e?void 0:e.value)===m),optionKey:"label",select:f,freeze:!0,customSelector:(0,a.jsx)("label",{className:"cp",children:v(null==u||null===(t=u.find(e=>(null==e?void 0:e.value)===p))||void 0===t?void 0:t.label)})})}):(0,a.jsxs)(r().Fragment,{children:[(0,a.jsx)("div",{style:{marginBottom:"5px"},children:"Language"}),(0,a.jsx)("div",{className:"language-selector",children:u.map((e,t)=>(0,a.jsx)("div",{className:"language-button-container",children:(0,a.jsx)(i.Button,{label:e.label,onClick:()=>f(e),variation:e.value===p?"primary":""})},t))})]})}},883(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d}),n(4883);var i=n(5953),o=n(4442),r=n(5697),l=n(6243),a=n(5660),s=n(6870);const d=e=>{var{state:t={}}=(0,o.useLocation)(),{t:n}=(0,i.useTranslation)(),d=(e.stateInfo,(0,o.useNavigate)()),u={imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoHeader:"WRONG_TENANT_SIGN_UP",infoMessage:"WRONG_TENANT_SIGN_UP_MESSAGE",buttonInfo:"WRONG_TENANT_SIGN_UP_BUTTON",action:()=>{d("/".concat(window.globalPath,"/"))}};return(0,s.jsx)(r.A,{children:(0,s.jsxs)(l.Card,{className:"digit-employee-card customError",children:[(0,s.jsx)(a.A,{showTenant:!1}),(0,s.jsx)(l.CardHeader,{className:"center",children:n(u.infoHeader)}),(0,s.jsx)(l.CardText,{className:"center",children:n(u.infoMessage)}),(0,s.jsx)(l.Button,{className:"customErrorButton",label:n(null==u?void 0:u.buttonInfo),variation:"primary",isSuffix:!0,onClick:e=>{e.preventDefault(),null==u||u.action()}})]})})}},6810(e,t,n){"use strict";n.d(t,{A:()=>l});var i=n(6243),o=(n(4883),n(5953)),r=n(6870);const l=e=>{var{onSelect:t,onCancel:n,onDismiss:l,PopupStyles:a,isDisabled:s,hideSubmit:d}=e,{t:u}=(0,o.useTranslation)(),c=[(0,r.jsx)("div",{children:(0,r.jsxs)(i.CardText,{children:[u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",(0,r.jsx)("strong",{children:u("CORE_LOGOUT_MESSAGE")})]})})],v=[(0,r.jsx)(i.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:n}),(0,r.jsx)(i.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:t,isDisabled:s})],m=[(0,r.jsx)(i.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:n})];return(0,r.jsx)(i.PopUp,{type:"default",children:c,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:d?m:v,sortFooterButtons:!0,onClose:l,className:"digit-logout-popup-wrapper",onOverlayClick:l,equalWidthButtons:!0,style:a})}},9546(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>s});var i=n(4883),o=n(338),r=n(4442),l=n(5953),a=n(6870);const s=()=>{var e,[t,n]=(0,i.useState)(0),s=(0,r.useNavigate)(),d=(0,r.useLocation)(),{t:u}=(0,l.useTranslation)(),{tenant:c}=d.state||{},v=["SANDBOX_GUIDE_SETUP_ACCOUNT","SANDBOX_GUIDE_DEFAULT_MASTER_DATA","SANDBOX_GUIDE_CONFIGURING_COMPLAINTS","SANDBOX_GUIDE_CONFIGURING_EMPLOYEE_MANAGEMENT","SANDBOX_GUIDE_SETTING_UP_CITIZEN_PORTAL","SANDBOX_GUIDE_SETTING_UP_EMPLOYEE_PORTAL","SANDBOX_GUIDE_LOADING_CONFIGURATION_INTERFACE","SANDBOX_GUIDE_CREATING_DASHBOARD","SANDBOX_GUIDE_ALL_SETUP_DONE"];(0,i.useEffect)(()=>{var e=setInterval(()=>{t<v.length&&n(e=>e+1)},2e3);if(t===v.length){var i;clearInterval(e),"undefined"!=typeof window&&(null===(i=window)||void 0===i||i.globalPath);var o=setTimeout(()=>{var e,t;y(m,f)?s({pathname:"/".concat(null===(e=window)||void 0===e?void 0:e.globalPath,"/").concat(c).concat(h),state:{tenant:c}}):s({pathname:"/".concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/").concat(c,"/employee"),state:{tenant:c}})},1e3);return()=>clearTimeout(o)}return()=>{clearInterval(e)}},[t]),(0,i.useRef)(null);var m=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(e=e.info)||void 0===e?void 0:e.roles,[p,g]=(0,i.useState)(!0),{data:f}=Digit.Hooks.useCustomMDMS(c,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}});(0,i.useEffect)(()=>{null!=f&&f[0].url&&g(!1)},[f]);var h=null==f?void 0:f[0].url,y=(e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))};return(0,a.jsxs)("div",{className:"sandbox-loader-screen",children:[(0,a.jsx)("div",{className:"sandbox-loader"}),(0,a.jsx)("ul",{className:"sandbox-installation-steps",children:v.map((e,n)=>(0,a.jsxs)("li",{className:"sandbox-step ".concat(n<t?"sandbox-visible":""),children:[(0,a.jsx)("span",{className:"sandbox-step-text",children:u(e)}),n<t&&(0,a.jsx)(o.CheckCircle,{fill:"#00703C"})]},n))})]})}},1603(e,t,n){"use strict";n.d(t,{A:()=>v});var i=n(4883),o=n(4442),r=n(6243),l=n(5953),a=n(6870);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}const v=e=>{var t,{moduleCode:n,stateCode:s,userType:u,tenants:v,maxRetries:m=5,retryDelay:p=1500,initialDelay:g=100}=e,[f,h]=(0,i.useState)({module:null,loading:!0,error:null,retryCount:0,initialDelayComplete:!1}),{t:y}=(0,l.useTranslation)();if((0,i.useEffect)(()=>{var e,t,i=function(){var t,o=(t=function*(){try{var t=Digit.ComponentRegistryService.getComponent("".concat(n,"Module"));if(t)h({module:t,loading:!1,error:null,retryCount:0,initialDelayComplete:!0});else if(f.retryCount<m){h(e=>d(d({},e),{},{retryCount:e.retryCount+1}));var o=p*Math.pow(1.5,f.retryCount);e=setTimeout(()=>{i()},o)}else h({module:null,loading:!1,error:'Module "'.concat(n,'" not found after ').concat(m," attempts"),retryCount:f.retryCount,initialDelayComplete:!0})}catch(e){console.error("Error loading module ".concat(n,":"),e),h({module:null,loading:!1,error:e.message,retryCount:f.retryCount,initialDelayComplete:!0})}},function(){var e=this,n=arguments;return new Promise(function(i,o){var r=t.apply(e,n);function l(e){c(r,i,o,l,a,"next",e)}function a(e){c(r,i,o,l,a,"throw",e)}l(void 0)})});return function(){return o.apply(this,arguments)}}();return f.initialDelayComplete?i():t=setTimeout(()=>{h(e=>d(d({},e),{},{initialDelayComplete:!0})),i()},g),()=>{e&&clearTimeout(e),t&&clearTimeout(t)}},[n,f.retryCount,f.initialDelayComplete,m,p,g]),f.loading){var b=f.initialDelayComplete?y("CORE_LOADING_MODULE",{moduleCode:n,defaultValue:"Loading {{moduleCode}} module..."}):y("CORE_INITIALIZING_MODULE",{moduleCode:n,defaultValue:"Initializing {{moduleCode}} module..."});return(0,a.jsxs)("div",{className:"module-loading-container",children:[(0,a.jsx)(r.Loader,{page:!0,variant:"PageLoader",loaderText:b}),f.retryCount>0&&f.initialDelayComplete&&(0,a.jsx)("div",{className:"retry-info",style:{textAlign:"center",marginTop:"1rem",color:"#666"},children:y("CORE_MODULE_RETRY_ATTEMPT",{retryCount:f.retryCount,maxRetries:m,defaultValue:"Retry attempt {{retryCount}}/{{maxRetries}}"})})]})}if(f.error||!f.module)return console.warn("Module loading failed for ".concat(n,":"),f.error),(0,a.jsx)(o.Navigate,{to:"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee/user/error?type=notfound&module=").concat(n,"&reason=").concat(encodeURIComponent(f.error||"Module not found")),replace:!0});var O=f.module;return(0,a.jsx)(O,{stateCode:s,moduleCode:n,userType:u,tenants:v})}},4217(e,t,n){"use strict";n.d(t,{A:()=>d});var i=n(4883),o=n.n(i),r=n(6340),l=n(6870),a=()=>{if("undefined"==typeof window)return(0,l.jsx)("span",{});try{var e,t=(null===(e=window)||void 0===e?void 0:e.contextPath)||"",n=Digit.UserService.getType(),i="/".concat(t,"employee"===n?"/employee/user/error":"/citizen/error"),o=window.location.href;if(o.includes("employee/user/error")||o.includes("citizen/error"))return(0,l.jsx)("span",{});try{window.location.href=i}catch(e){console.warn("Navigation failed in error boundary:",e);try{window.location.replace(i)}catch(e){console.error("Both href and replace failed:",e)}}}catch(e){console.error("Error in Redircter component:",e)}return(0,l.jsx)("span",{})};class s extends o().Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1,module:null,action:null,info:null}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack,module:null==e?void 0:e.module,action:null==e?void 0:e.action,info:null==e?void 0:e.info}}componentDidCatch(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack,module:null==e?void 0:e.module,action:null==e?void 0:e.action,info:t})}render(){return this.state.hasError?(0,l.jsxs)("div",{className:"error-boundary",children:[(0,l.jsx)(a,{}),(0,l.jsx)(r.default,{initData:this.props.initData,errorData:this.state,goToHome:()=>{var e,t,n;window.location.href="/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/").concat(null===(t=Digit)||void 0===t||null===(t=t.UserService)||void 0===t||null===(n=t.getType)||void 0===n?void 0:n.call(t))}})]}):this.props.children}}const d=s},6340(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>s}),n(4883);var i=n(5953),o=n(6177),r=n(6870),l={error:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/PageNotFound.png",infoMessage:"MODULE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},a={sandbox:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/error-image.png",infoMessage:"WRONG_TENANT_SIGN_UP",buttonInfo:"CREATE_TENANT_ERROR_BUTTON"}};const s=e=>{var t,{type:n="error"}=Digit.Hooks.useQueryParams(),s=null==e||null===(t=e.errorData)||void 0===t?void 0:t.module,{t:d}=(0,i.useTranslation)(),u=s?a[s]:l[n];return e.stateInfo,(0,r.jsx)("div",{className:"error-boundary",children:(0,r.jsxs)("div",{className:"error-container",children:[(0,r.jsx)(o.A,{src:u.imgUrl,alt:"error"}),(0,r.jsx)("h1",{children:d(u.infoMessage)}),(0,r.jsx)("button",{onClick:()=>{var t,n;s?null==e||null===(t=e.errorData)||void 0===t||t.action():null==e||null===(n=e.goToHome)||void 0===n||n.call(e)},children:d(u.buttonInfo)})]})})}},5660(e,t,n){"use strict";n.d(t,{A:()=>a});var i=n(6243),o=(n(4883),n(5953)),r=n(6177),l=n(6870);const a=e=>{var t,n,{showTenant:a=!0}=e,{data:s,isLoading:d}=Digit.Hooks.useStore.getInitData(),{stateInfo:u}=s||{},{t:c}=(0,o.useTranslation)();if(d)return(0,l.jsx)(i.Loader,{});var v=null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("SVG_HEADER_SECONDARY_LOGO_URL");return v?(0,l.jsxs)("div",{className:"bannerHeader secondaryBannerHeader",children:[(0,l.jsx)(r.A,{className:"bannerLogo",src:null==u?void 0:u.logoUrl,style:a?{}:{borderRight:"unset"},alt:"Digit Banner"}),(0,l.jsx)("span",{style:{fontSize:"xx-large"},children:"|"}),(0,l.jsx)(r.A,{className:"svgHeaderLogo",src:v,alt:"DIGIT Logo"})]}):(0,l.jsxs)("div",{className:"bannerHeader",children:[(0,l.jsx)(r.A,{className:"bannerLogo",src:null==u?void 0:u.logoUrl,style:a?{}:{borderRight:"unset"},alt:"Digit Banner"}),a&&(null==u?void 0:u.code)&&(0,l.jsx)("p",{children:c("TENANT_TENANTS_".concat(null==u||null===(n=u.code)||void 0===n?void 0:n.toUpperCase()))})]})}},1234(e,t,n){"use strict";n.d(t,{AppHome:()=>w,q:()=>S});var i=n(5053),o=n(6243),r=n(4883),l=n.n(r),a=n(5953),s=n(4442),d=n(6870);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){v(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=n(338),p=e=>{var t,n,i,{modules:u,additionalComponent:v}=e,{isLoading:p,data:g}=Digit.Hooks.useAccessControl(),f=Digit.Utils.getMultiRootTenant(),{t:h}=(0,a.useTranslation)(),y=(0,s.useNavigate)(),b=null===(t=Digit)||void 0===t||null===(t=t.ULBService)||void 0===t?void 0:t.getStateId(),[O,x]=(0,r.useState)([{}]),{data:S}=Digit.Hooks.useCustomMDMS(b,"HomeScreenOrder",[{name:"CardsAndLinksOrder"}],{select:e=>{var t;return null==e||null===(t=e.HomeScreenOrder)||void 0===t?void 0:t.CardsAndLinksOrder}}),{data:_,isLoading:j}=Digit.Hooks.useCustomMDMS(b,"SandBoxLanding",[{name:"AdditionalModuleLinks"}],{select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.AdditionalModuleLinks}});(0,r.useEffect)(()=>{x(S)},[S]);var C=(e,t)=>{if(!e||!t)return null;var n=null==_?void 0:_.find(t=>t.moduleName===e.module),i=null==n?void 0:n[t],o=null==e?void 0:e.links;return(null==o?void 0:o.find(e=>(null==e?void 0:e.displayName)===i))||null},w=e=>{var t,n=null==_?void 0:_.find(t=>t.moduleName===e.module);return null==e||null===(t=e.links)||void 0===t?void 0:t.filter(e=>{var t=e.displayName,i="Configure_master"!==t,o=t!==(null==n?void 0:n.howItWorksLink),r=t!==(null==n?void 0:n.userManualLink);return i&&o&&r})},N=null==g?void 0:g.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,t)=>{var n=t.parentModule;e[n]||(e[n]={module:n,kpis:[],icon:t.leftIcon?Digit.Utils.iconRender({iconName:t.leftIcon,iconFill:"white",CustomSVG:o.CustomSVG,Components:m}):"",label:Digit.Utils.locale.getTransformedLocale("".concat(n,"_CARD_HEADER")),links:[]});var i=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("/"!=n)return-1===(null===(e=n)||void 0===e?void 0:e.indexOf("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath)))&&f?n=n.replace("/sandbox-ui/employee","/sandbox-ui/".concat(b,"/employee")):n}(t.navigationURL),r=i.indexOf("?");return e[n].links.push({link:i,icon:t.leftIcon,queryParams:-1===r?null:i.substring(r),label:h(Digit.Utils.locale.getTransformedLocale("".concat(n,"_LINK_").concat(t.displayName))),displayName:t.displayName}),e},{});if(p)return(0,d.jsx)(o.Loader,{page:!1,variant:"PageLoader"});if(!N)return"";i=f?(e=>Object.keys(e).sort((e,t)=>{var n,i;return((null==O||null===(n=O.find(t=>"card"===t.moduleType&&t.name===e))||void 0===n?void 0:n.order)||null)-((null==O||null===(i=O.find(e=>"card"===e.moduleType&&e.name===t))||void 0===i?void 0:i.order)||null)}).reduce((t,n)=>{var i,o=null==e||null===(i=e[n])||void 0===i||null===(i=i.links)||void 0===i?void 0:i.sort((e,t)=>{var i,o,r=null==e?void 0:e.displayName,l=null==t?void 0:t.displayName;return((null==O||null===(i=O.find(e=>"link"===e.moduleType&&e.name==="".concat(n,".").concat(r.replace(/\s+/g,"_"))))||void 0===i?void 0:i.order)||null)-((null==O||null===(o=O.find(e=>"link"===e.moduleType&&e.name==="".concat(n,".").concat(l.replace(/\s+/g,"_"))))||void 0===o?void 0:o.order)||null)});return t[n]=c(c({},e[n]),{},{links:o}),t},{}))(N):N;var E=null===(n=Object.keys(i))||void 0===n?void 0:n.map((e,t)=>{var n,r,l=null===(n=i)||void 0===n?void 0:n[e],a=null==l||null===(r=l.links)||void 0===r?void 0:r.find(e=>"Configure_master"===(null==e?void 0:e.displayName)),s=C(l,"howItWorksLink"),u=C(l,"userManualLink"),v={icon:"SupervisorAccount",moduleName:h(null==l?void 0:l.label),metrics:[],links:Digit.Utils.getMultiRootTenant()?w(l):null==l?void 0:l.links,centreChildren:[(0,d.jsx)("div",{children:h(Digit.Utils.locale.getTransformedLocale("MODULE_CARD_DESC_".concat(e)))}),s&&(0,d.jsx)(o.Button,{variation:"teritiary",label:null==s?void 0:s.label,icon:null==s?void 0:s.icon,type:"button",size:"medium",onClick:()=>window.open(null==s?void 0:s.link,"_blank"),style:{padding:"0px"}})],endChildren:Digit.Utils.getMultiRootTenant()?[a&&(0,d.jsx)(o.Button,{variation:"teritiary",label:null==a?void 0:a.label,icon:null==a?void 0:a.icon,type:"button",size:"medium",onClick:()=>y(null==a?void 0:a.link),style:{padding:"0px"}}),u&&(0,d.jsx)(o.Button,{variation:"teritiary",label:null==u?void 0:u.label,icon:null==u?void 0:u.icon,type:"button",size:"medium",onClick:()=>window.open(null==u?void 0:u.link,"_blank"),style:{padding:"0px"}})]:null};return(0,d.jsx)(o.LandingPageCard,c({buttonSize:"medium"},v))});return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(o.LandingPageWrapper,{children:l().Children.map(E,e=>l().cloneElement(e))})})},g=n(338),f=e=>{var{question:t,isLabelLink:n,answer:l,type:s,actions:u,content:c,lastIndex:v}=e,[m,p]=(0,r.useState)(!1),{t:f}=(0,a.useTranslation)(),h=Digit.ULBService.getStateId(),y="number"===s?"ol":"ul";return(0,d.jsxs)("div",{className:"faqs border-none",onClick:()=>p(!m),children:[(0,d.jsxs)("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"},children:[(0,d.jsx)("span",{children:f(t)}),(0,d.jsx)("span",{className:m?"faqicon rotate":"faqicon",style:{float:"right"},children:(0,d.jsx)(g.ArrowForward,{})})]}),(0,d.jsxs)("div",{className:"faq-answer",style:m?{display:"block"}:{display:"none"},children:[(0,d.jsx)(i.CardSectionSubText,{style:{marginTop:"1rem"},children:f(c)}),(0,d.jsx)("div",{style:{marginTop:"1rem"},children:u&&(0,d.jsx)(y,{children:u.map((e,t)=>(0,d.jsxs)("li",{style:{listStyleType:"ul"===y?"disc":"auto",margin:"8px 0"},children:[n?null!=e&&e.label?(0,d.jsx)(o.Button,{variation:"teritiary",label:f(null==e?void 0:e.label),type:"button",size:"medium",onClick:()=>{if(null!=e&&e.fulllink)window.open(null==e?void 0:e.link,"_blank");else{var t,n="https://".concat(window.location.hostname,"/").concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/").concat(h);window.open("".concat(n,"/").concat(null==e?void 0:e.link),"_blank")}},style:{padding:"0px"}}):null:null!=e&&e.label?(0,d.jsxs)("strong",{children:[f(null==e?void 0:e.label),":"]}):null,f(null==e?void 0:e.description)]},t))})})]}),v?null:(0,d.jsx)("div",{className:"cs-box-border"})]})},h=e=>{var{type:t,title:n,content:o,actions:r,style:l}=e,{t:s}=(0,a.useTranslation)(),u="number"===t?"ol":"ul";return(0,d.jsxs)("div",{children:[(0,d.jsx)(i.CardSectionHeader,{children:s(n)}),(0,d.jsx)(i.CardSectionSubText,{style:{marginTop:"1rem"},children:s(o)}),(0,d.jsx)("div",{style:{marginTop:"1rem"},children:r&&(0,d.jsx)(u,{children:r.map((e,t)=>(0,d.jsxs)("li",{style:{listStyleType:"ul"===u?"disc":"auto",margin:"8px 0"},children:[null!=e&&e.label?(0,d.jsxs)("strong",{children:[s(null==e?void 0:e.label),":"]}):null," ",s(null==e?void 0:e.description)]},t))})})]})},y=e=>{var{key:t,title:n,content:i,faqs:o,type:r}=e,{t:l}=(0,a.useTranslation)();return(0,d.jsx)("div",{style:{width:"100%"},children:(0,d.jsx)("div",{style:{width:"100%"},children:o.map((e,t)=>(0,d.jsx)(f,{question:e.question,answer:e.answer,isLabelLink:e.isLabelLink,type:r,actions:e.answer,content:e.content,lastIndex:t===(null==o?void 0:o.length)-1},"faq_"+t))})})};const b=e=>{var{cardConfig:t}=e,{t:n}=(0,a.useTranslation)();return(0,d.jsxs)(o.Card,{className:"sandbox-guide",style:{width:"25rem",height:"47rem",overflowY:"scroll"},children:[(0,d.jsx)(o.CardHeader,{children:n("GUIDE_TO_SETUP")}),(0,d.jsx)("div",{style:{display:"flex",flexWrap:"wrap"},children:t.map((e,n)=>"faqs"===(null==e?void 0:e.type)?(0,d.jsx)(y,{title:e.title,type:null==e?void 0:e.type,content:e.content,faqs:e.actions},e.id):(0,d.jsxs)(l().Fragment,{children:[(0,d.jsx)(h,{type:null==e?void 0:e.type,title:e.title,content:e.content,actions:e.actions,style:e.style},e.id),n!==(null==t?void 0:t.length)-1&&(0,d.jsx)(i.BreakLine,{style:{width:"100%",border:"1px solid #d6d5d4"}})]}))})]})};var O=["onSelect","formData","control","formState"];const x=e=>{var{onSelect:t,formData:n,control:i,formState:o}=e,{t:r}=(function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}(e,O),(0,a.useTranslation)()),{isLoading:l,data:s}=Digit.Hooks.useAccessControl(),u=(Digit.Utils.getMultiRootTenant(),Digit.ULBService.getStateId());return(null==s?void 0:s.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,t)=>{var n=t.parentModule;e[n]||(e[n]={module:n,label:Digit.Utils.locale.getTransformedLocale("".concat(n,"_CARD_HEADER")),links:[]});var i=Digit.Utils.transformURL(t.navigationURL,u),o=i.indexOf("?");return e[n].links.push({link:-1===o?i:i.substring(0,o),label:r(Digit.Utils.locale.getTransformedLocale("".concat(n,"_LINK_").concat(t.displayName))),queryParams:-1===o?null:i.substring(o),description:r(Digit.Utils.locale.getTransformedLocale("".concat(n,"_LINK_").concat(t.displayName,"_DESCRIPTION")))}),e},{}))?(0,d.jsx)(b,{cardConfig:[{id:1,type:"faqs",actions:[{question:"SANDBOX_FAQ_QUES_14",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_14_LABEL_1",fulllink:!0,link:"https://egov-digit.gitbook.io/digit-sandbox/specifications/user-manual/walkthrough-videos"}]},{question:"SANDBOX_FAQ_QUES_1",content:"SANDBOX_FAQ_CONTENT_1",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_1_LABEL_1",link:"citizen/login",description:"SANDBOX_FAQ_ANS_1_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_1_LABEL_2",link:"employee/user/login",description:"SANDBOX_FAQ_ANS_1_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_2",content:"SANDBOX_FAQ_CONTENT_2",answer:[{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_3",content:"SANDBOX_FAQ_CONTENT_3",answer:[{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_4",content:"SANDBOX_FAQ_CONTENT_4",answer:[{label:null,description:"SANDBOX_FAQ_ANS_4_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_4_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_5",content:"SANDBOX_FAQ_CONTENT_5",answer:[{label:"SANDBOX_FAQ_ANS_5_LABEL_1",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_5_LABEL_2",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_2"},{label:"SANDBOX_FAQ_ANS_5_LABEL_3",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_3"},{label:"SANDBOX_FAQ_ANS_5_LABEL_4",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_4"},{label:"SANDBOX_FAQ_ANS_5_LABEL_5",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_5"}]},{question:"SANDBOX_FAQ_QUES_6",content:"SANDBOX_FAQ_CONTENT_6"},{question:"SANDBOX_FAQ_QUES_7",content:"SANDBOX_FAQ_CONTENT_7",answer:[{label:null,description:"SANDBOX_FAQ_ANS_7_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_7_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_8",content:"SANDBOX_FAQ_CONTENT_8",answer:[{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_9",content:"SANDBOX_FAQ_CONTENT_9",answer:[{label:"SANDBOX_FAQ_ANS_9_LABEL_1",description:"SANDBOX_FAQ_ANS_9_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_9_LABEL_2",description:"SANDBOX_FAQ_ANS_9_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_10",content:"SANDBOX_FAQ_CONTENT_10",answer:[{label:"SANDBOX_FAQ_ANS_10_LABEL_1",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_10_LABEL_2",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_2"},{label:"SANDBOX_FAQ_ANS_10_LABEL_3",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_3"},{label:"SANDBOX_FAQ_ANS_10_LABEL_4",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_11",content:"SANDBOX_FAQ_CONTENT_11"},{question:"SANDBOX_FAQ_QUES_12",content:"SANDBOX_FAQ_CONTENT_12"},{question:"SANDBOX_FAQ_QUES_13",content:"SANDBOX_FAQ_CONTENT_13"}]}]}):""};var S=(e,t,n)=>{var i=null==e?void 0:e["".concat(t)];i&&i.map(e=>{Digit.Utils.getMultiRootTenant()&&(e.navigationURL=e.navigationURL.replace("/sandbox-ui/citizen","/sandbox-ui/".concat(Digit.ULBService.getStateId(),"/citizen"))),e.link=e.navigationURL,e.i18nKey=n(e.name)});var o,r={links:null==i?void 0:i.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_".concat(t)),iconName:"CITIZEN_".concat(t,"_ICON")};return"FSM"===t&&[{role:"FSM_DSO",from:"/".concat(null===(o=window)||void 0===o?void 0:o.contextPath,"/citizen/fsm/dso-dashboard"),dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,i,o,{role:l,from:a,loginLink:s,dashoardLink:d}=e;Digit.UserService.hasAccess(l)?null==r||null===(t=r.links)||void 0===t||t.push({link:a,i18nKey:n(d)}):null==r||null===(i=r.links)||void 0===i||i.push({link:"/".concat(null===(o=window)||void 0===o?void 0:o.contextPath,"/citizen/login"),state:{role:"FSM_DSO",from:a},i18nKey:n(s)})}),r},_=e=>{switch(e){case"PT":default:return(0,d.jsx)(o.CustomSVG.PTIcon,{className:"fill-path-primary-main"});case"WS":return(0,d.jsx)(o.CustomSVG.WSICon,{className:"fill-path-primary-main"});case"FSM":return(0,d.jsx)(o.CustomSVG.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return(0,d.jsx)(o.CustomSVG.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return(0,d.jsx)(o.CustomSVG.PGRIcon,{className:"fill-path-primary-main"});case"TL":return(0,d.jsx)(o.CustomSVG.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return(0,d.jsx)(o.CustomSVG.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return(0,d.jsx)(o.CustomSVG.BillsIcon,{className:"fill-path-primary-main"})}},j=e=>{var{getCitizenMenu:t,fetchedCitizen:n,isLoading:r}=e,{t:l}=(0,a.useTranslation)(),u=(0,s.useNavigate)(),c=window.Digit.Utils.browser.isMobile();if(r||!n||!t)return(0,d.jsx)(i.Loader,{});var v=Object.keys(t),m=e=>{var t=(e.name||e.displayName||"").toLowerCase();return t.includes("apply")||t.includes("_apply")};if(!c){var p=v.map(e=>{var n,i,r=S(t,e,l);if(null==r||null===(n=r.links)||void 0===n||!n.length)return null;var a=new Set,s=null===(i=r.links)||void 0===i||null===(i=i.filter(e=>null==e?void 0:e.link))||void 0===i?void 0:i.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)).filter(e=>{var t=e.link;return!a.has(t)&&(a.add(t),!0)});return(0,d.jsxs)(o.Card,{className:"digit-landing-page-card",style:{borderRadius:"1rem"},children:[(0,d.jsxs)("div",{className:"icon-module-header",children:[(0,d.jsx)("div",{className:"digit-landingpagecard-icon",children:(0,d.jsx)(o.CustomSVG.Devices,{fill:"#C84C0E",width:"1rem",height:"1rem"})}),(0,d.jsx)("div",{className:"ladingcard-moduleName",role:"heading","aria-level":"2",children:l(null==r?void 0:r.header)})]}),(0,d.jsx)(o.Divider,{className:"digit-landingpage-divider",variant:"small"}),s.map((e,t)=>{var n=e.leftIcon&&"TLIcon"!==e.leftIcon&&o.CustomSVG[e.leftIcon]?o.CustomSVG[e.leftIcon]:null;return(0,d.jsx)("button",{className:"digit-button-teritiary medium",type:"button",style:{padding:"0px"},onClick:()=>(e=>{var t;e&&(null!=e&&e.includes("".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/"))?u(e):window.location.href=e)})(e.link),children:(0,d.jsxs)("div",{className:"icon-label-container teritiary medium",children:[n?(0,d.jsx)(n,{fill:"#C84C0E",width:"1.25rem",height:"1.25rem",className:"digit-button-customIcon medium teritiary"}):m(e)?(0,d.jsx)(o.SVG.AddExpense,{fill:"#C84C0E",width:"1.25rem",height:"1.25rem",className:"digit-button-customIcon medium teritiary"}):(0,d.jsx)(o.SVG.ListAlt,{fill:"#C84C0E",width:"1.25rem",height:"1.25rem",className:"digit-button-customIcon medium teritiary"}),(0,d.jsx)("h2",{className:"digit-button-label",children:e.i18nKey})]})},t)})]},e)}).filter(Boolean);return(0,d.jsx)("div",{className:"citizen-all-services-wrapper",children:(0,d.jsx)("div",{className:"employee-app-container digit-home-employee-app",children:(0,d.jsx)(o.LandingPageWrapper,{children:p})})})}return(0,d.jsxs)("div",{className:"citizen-all-services-wrapper",children:[location.pathname.includes("sanitation-ui/citizen/all-services")||location.pathname.includes("sandbox-ui")&&location.pathname.includes("all-services")?null:(0,d.jsx)(o.BackLink,{onClick:()=>window.history.back()}),(0,d.jsx)("div",{className:"citizenAllServiceGrid",children:v.map(e=>{var n,i,o=S(t,e,l);return(null==o||null===(n=o.links)||void 0===n?void 0:n.length)>0?(0,d.jsxs)("div",{className:"CitizenHomeCard",children:[(0,d.jsxs)("div",{className:"header",children:[(0,d.jsx)("h2",{children:l(null==o?void 0:o.header)}),_(e)]}),(0,d.jsx)("div",{className:"links",children:null==o||null===(i=o.links)||void 0===i||null===(i=i.filter(e=>null==e?void 0:e.link))||void 0===i?void 0:i.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)).map((e,t)=>(0,d.jsx)("div",{className:"linksWrapper",children:(0,d.jsx)("a",{href:e.link,onClick:t=>((e,t)=>{e.preventDefault(),u(t)})(t,e.link),children:e.i18nKey})},t))})]},e):null})})]})},C=e=>{var{modules:t,additionalComponent:n}=e;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"employee-app-container digit-home-employee-app",children:(0,d.jsx)(o.LandingPageWrapper,{children:null==t?void 0:t.map((e,t)=>{var{code:n}=e,i=Digit.ComponentRegistryService.getComponent("".concat(n,"Card"))||(()=>(0,d.jsx)(l().Fragment,{}));return(0,d.jsx)(i,{},t)})})}),n&&(null==n?void 0:n.length)>0&&n.map(e=>{var t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?(0,d.jsx)("div",{className:"additional-component-wrapper",children:(0,d.jsx)(t,{})}):null})]})},w=e=>{var{userType:t,modules:n,getCitizenMenu:i,fetchedCitizen:o,isLoading:r,additionalComponent:l}=e;if("citizen"===t)return(0,d.jsx)(j,{modules:n,getCitizenMenu:i,fetchedCitizen:o,isLoading:r});var a=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return Digit.Utils.getRoleBasedHomeCard()?(0,d.jsxs)("div",{className:a?"homeWrapper":"",children:[(0,d.jsx)(p,{modules:n,additionalComponent:l}),a&&!window.Digit.Utils.browser.isMobile()?(0,d.jsx)(x,{}):null]}):(0,d.jsx)(C,{modules:n,additionalComponent:l})}},6177(e,t,n){"use strict";n.d(t,{A:()=>c}),n(4883);var i=n(7598),o=n.n(i),r=n(6870),l=["src","alt","decorative","ariaLabel","ariaLabelledby"];function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=e=>{var{src:t,alt:n="Image not found",decorative:i=!1,ariaLabel:o="No Image description set",ariaLabelledby:a="no-image-description"}=e,d=function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,l),u={};return i?u.alt="":n?u.alt=n:o?u["aria-label"]=o:a?u["aria-labelledby"]=a:console.warn("AccessibleImage: Missing alt, aria-label, or aria-labelledby for non-decorative image."),(0,r.jsx)("img",s(s(s({src:t},u),d),{},{tabIndex:0,onKeyDown:e=>{var t,n;"Enter"!==e.key&&" "!==e.key||window.open(null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}}))};u.propTypes={src:o().string.isRequired,alt:o().string,decorative:o().bool,ariaLabel:o().string,ariaLabelledby:o().string};const c=u},9536(e,t,n){"use strict";n.d(t,{A:()=>T});var i=n(4883),o=n.n(i),r=n(5053),l=n(6243),a=n(4442),s=n(358),d=n(3015),u=n(6177),c=n(6870);function v(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}const m=e=>{var t,n,i,m,p,g,f,h,{t:y,stateInfo:b,toggleSidebar:O,isSidebarOpen:x,handleLogout:S,userDetails:_,CITIZEN:j,cityDetails:C,mobileView:w,userOptions:N,handleUserDropdownSelection:E,logoUrl:D,logoUrlWhite:I,showLanguageChange:P=!0}=e,[A,T]=o().useState(null);o().useEffect(()=>{var e=function(){var e,t=(e=function*(){var e,t=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCurrentTenantId(),n=null==_||null===(e=_.info)||void 0===e?void 0:e.uuid;if(n){var i=yield Digit.UserService.userSearch(t,{uuid:[n]},{});if(i&&i.user&&i.user.length){var o,r=i.user[0],l=null==r||null===(o=r.photo)||void 0===o?void 0:o.split(",");T(null==l?void 0:l.at(0))}}},function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){v(r,i,o,l,a,"next",e)}function a(e){v(r,i,o,l,a,"throw",e)}l(void 0)})});return function(){return t.apply(this,arguments)}}();e()},[null!==A,null==_||null===(t=_.info)||void 0===t?void 0:t.uuid]);var L,R,M=Digit.ULBService.getCitizenCurrentTenant(!0),U=(0,a.useNavigate)(),{pathname:k}=(0,a.useLocation)(),{data:{unreadCount:B}={},isSuccess:F}=Digit.Hooks.useNotificationCount({tenantId:M,config:{enabled:"EMPLOYEE"!==(null===(L=Digit.UserService)||void 0===L||null===(L=L.getUser())||void 0===L||null===(L=L.info)||void 0===L?void 0:L.type)&&"CITIZEN"===(null===(R=Digit.UserService)||void 0===R||null===(R=R.getUser())||void 0===R||null===(R=R.info)||void 0===R?void 0:R.type)&&!!M}});if(j)return(0,c.jsx)("div",{children:(0,c.jsx)(r.TopBar,{img:null==b?void 0:b.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:O(!0)},logoUrl:null==b?void 0:b.logoUrlWhite,onLogout:S,userDetails:_,notificationCount:B<99?B:99,notificationCountLoaded:F,cityOfCitizenShownBesideLogo:y(M),onNotificationIconClick:function(){var e;U("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/engagement/notifications"))},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,i;return(null===(t=Digit.UserService)||void 0===t||null===(t=t.getUser())||void 0===t||!t.access_token)&&["/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/citizen/select-language"),"/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/citizen/select-location")].includes(e)})(k),changeLanguage:w?null:(0,c.jsx)(d.A,{dropdown:!0})})});var V=!(null==_||!_.access_token),G=null===(n=Digit.ComponentRegistryService)||void 0===n?void 0:n.getComponent("CustomEmployeeTopBar");return G?(0,c.jsx)(G,{t:y,stateInfo:b,toggleSidebar:O,isSidebarOpen:x,handleLogout:S,userDetails:_,CITIZEN:j,cityDetails:C,mobileView:w,userOptions:N,handleUserDropdownSelection:E,logoUrl:D,showLanguageChange:P,loggedin:V}):(0,c.jsx)(l.Header,{actionFields:[(0,c.jsx)(s.A,{dropdown:!0,t:y}),P&&(0,c.jsx)(d.A,{dropdown:!0}),(null==_?void 0:_.access_token)&&(0,c.jsx)(l.Dropdown,{option:N,optionKey:"name",profilePic:A||(null==_||null===(i=_.info)||void 0===i?void 0:i.name)||(null==_||null===(m=_.info)||void 0===m||null===(m=m.userInfo)||void 0===m?void 0:m.name)||"Employee",select:E,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{O()},className:"digit-employee-header",img:D,logoWidth:"64px",logoHeight:"48px",logo:(V?null==C?void 0:C.logoId:null==b?void 0:b.statelogo)||"https://egov-dev-assets.s3.ap-south-1.amazonaws.com/egov-logo-2025.png",onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:(null===(p=window)||void 0===p||null===(p=p.globalConfigs)||void 0===p?void 0:p.getConfig("HEADER_THEME"))||"light",ulb:V?null!=C&&null!==(g=C.city)&&void 0!==g&&g.ulbGrade?(0,c.jsxs)(c.Fragment,{children:[y(null==C?void 0:C.i18nKey).toUpperCase()," ",y("ULBGRADE_".concat(null==C||null===(f=C.city)||void 0===f?void 0:f.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()]}):(0,c.jsx)(u.A,{className:"state",src:I,alt:"State Logo"}):(0,c.jsxs)(c.Fragment,{children:[y("MYCITY_".concat(null==b||null===(h=b.code)||void 0===h?void 0:h.toUpperCase(),"_LABEL"))," ",y("MYCITY_STATECODE_LABEL")]})})};var p=n(5953),g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC";const f=(e,t,n,i)=>[{type:"component",element:"LANGUAGE",action:(0,c.jsx)(d.A,{}),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:(0,c.jsx)(r.LogoutIcon,{className:"icon"}),populators:{onClick:n}}];var h=n(6810);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){O(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=e=>{var{info:t,stateName:n,t:i}=e;return(0,c.jsxs)("div",{className:"profile-section",children:[(0,c.jsx)("div",{className:"imageloader imageloader-loaded",children:(0,c.jsx)(u.A,{className:"img-responsive img-circle img-Profile",src:g,alt:"Profile Logo"})}),(0,c.jsx)("div",{id:"profile-name",className:"label-container name-Profile",children:(0,c.jsxs)("div",{className:"label-text",children:[" ",null==t?void 0:t.name," "]})}),(0,c.jsx)("div",{id:"profile-location",className:"label-container loc-Profile",children:(0,c.jsxs)("div",{className:"label-text",children:[" ",null==t?void 0:t.mobileNumber," "]})}),(null==t?void 0:t.emailId)&&(0,c.jsx)("div",{id:"profile-emailid",className:"label-container loc-Profile",children:(0,c.jsxs)("div",{className:"label-text",children:[" ",t.emailId," "]})}),(0,c.jsx)("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&(0,c.jsx)(s.A,{t:i,mobileView:!0})]})},S={CommonPTIcon:(0,c.jsx)(r.PTIcon,{className:"icon"}),OBPSIcon:(0,c.jsx)(r.OBPSIcon,{className:"icon"}),propertyIcon:(0,c.jsx)(r.PropertyHouse,{className:"icon"}),TLIcon:(0,c.jsx)(r.CaseIcon,{className:"icon"}),PGRIcon:(0,c.jsx)(r.PGRIcon,{className:"icon"}),FSMIcon:(0,c.jsx)(r.FSMIcon,{className:"icon"}),WSIcon:(0,c.jsx)(r.WSICon,{className:"icon"}),MCollectIcon:(0,c.jsx)(r.MCollectIcon,{className:"icon"}),BillsIcon:(0,c.jsx)(r.CollectionIcon,{className:"icon"}),BirthIcon:(0,c.jsx)(r.BirthIcon,{className:"icon"}),DeathIcon:(0,c.jsx)(r.DeathIcon,{className:"icon"}),FirenocIcon:(0,c.jsx)(r.FirenocIcon,{className:"icon"}),HomeIcon:(0,c.jsx)(r.HomeIcon,{className:"icon"}),EditPencilIcon:(0,c.jsx)(r.EditPencilIcon,{className:"icon"}),LogoutIcon:(0,c.jsx)(r.LogoutIcon,{className:"icon"}),Phone:(0,c.jsx)(r.Phone,{className:"icon"})};const _=e=>{var t,n,l,{linkData:s,islinkDataLoading:d}=e,{t:u}=(0,p.useTranslation)(),v=(0,a.useNavigate)(),m=(0,a.useLocation)(),{pathname:g}=m,{data:y,isFetched:O}=Digit.Hooks.useStore.getInitData(),{stateInfo:_}=y||{},j=Digit.UserService.getUser(),C=window.Digit.Utils.browser.isMobile(),[w,N]=(0,i.useState)(!1),[E,D]=(0,i.useState)(!1),[I,P]=(0,i.useState)(!1),A=()=>{P(!1)};if(d)return(0,c.jsx)(r.Loader,{});var T=()=>{var e;v("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/user/profile"))},L=[...f(u,0,()=>{var e;v("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/login"))})];L=L.filter(e=>"LANGUAGE"!==e.element);var R,M,U,k,B,F,V,G,z=Digit.ULBService.getCurrentTenantId(),W=e=>{var t,n,{item:i}=e,o=(null==i?void 0:i.icon)||(null===(t=i.icon)||void 0===t||null===(t=t.type)||void 0===t?void 0:t.name),r=o?S[o]:S.BillsIcon;n="component"===i.type?i.action:i.text;var l=()=>(0,c.jsxs)("span",b(b({className:"menu-item"},i.populators),{},{children:[r,(0,c.jsx)("div",{className:"menu-label",children:n})]}));return"external-link"===i.type?(0,c.jsx)("a",{href:i.link,children:(0,c.jsx)(l,{})}):"link"===i.type?(0,c.jsx)(a.Link,{to:null==i?void 0:i.link,children:(0,c.jsx)(l,{})}):(0,c.jsx)(l,{})};return O&&j&&j.access_token&&"CITIZEN"===(null==j||null===(t=j.info)||void 0===t?void 0:t.type)&&(R=(0,c.jsx)(x,{info:null==j?void 0:j.info,stateName:null==_?void 0:_.name,t:u}),L=L.filter(e=>"login-btn"!==(null==e?void 0:e.id)),L=[...L,{type:"link",icon:"HomeIcon",element:"HOME",text:u("COMMON_BOTTOM_NAVIGATION_HOME"),link:w?"/".concat(null===(M=window)||void 0===M?void 0:M.contextPath,"/employee"):"/".concat(null===(U=window)||void 0===U?void 0:U.contextPath,"/citizen"),populators:{onClick:()=>{var e;v("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/all-services"))}}},{text:u("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:T}},{text:u("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{D(!1),P(!0)}}},{text:(0,c.jsxs)(o().Fragment,{children:[u("CS_COMMON_HELPLINE"),(0,c.jsx)("div",{className:"telephone",style:{marginTop:"-10%"},children:(null==y||null===(k=y.tenants)||void 0===k?void 0:k.length)>0&&(0,c.jsx)("div",{className:"link",children:(0,c.jsx)("a",{href:"tel:".concat((null===(B=y.tenants.find(e=>e.code===z))||void 0===B?void 0:B.contactNumber)||(null===(F=y.tenants[0])||void 0===F?void 0:F.contactNumber)||""),children:(null===(V=y.tenants.find(e=>e.code===z))||void 0===V?void 0:V.contactNumber)||(null===(G=y.tenants[0])||void 0===G?void 0:G.contactNumber)||u("CS_NA")})})})]}),element:"Helpline",icon:"Phone"}]),null===(n=Object.keys(s||{}))||void 0===n||null===(n=n.sort((e,t)=>t.localeCompare(e)))||void 0===n||n.map(e=>{var t,n,i,o,r;(null===(t=s[e][0])||void 0===t?void 0:t.sidebar)==="".concat(window.contextPath,"-links")&&L.splice(1,0,{type:null!==(n=s[e][0])&&void 0!==n&&null!==(n=n.sidebarURL)&&void 0!==n&&n.includes(null===(i=window)||void 0===i?void 0:i.contextPath)?"link":"external-link",text:u("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(e))),links:s[e],icon:null===(o=s[e][0])||void 0===o?void 0:o.leftIcon,link:null===(r=s[e][0])||void 0===r?void 0:r.sidebarURL})}),(0,c.jsx)(o().Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:C?"calc(100vh - 56px)":"auto",zIndex:"99"},children:[R,(0,c.jsx)("div",{className:"drawer-desktop",children:null===(l=L)||void 0===l?void 0:l.map((e,t)=>(0,c.jsx)("div",{className:"sidebar-list ".concat(g===(null==e?void 0:e.link)||g===(null==e?void 0:e.sidebarURL)?"active":""),children:(0,c.jsx)(W,{item:e})},t))})]}),(0,c.jsx)("div",{children:I&&(0,c.jsx)(h.A,{onSelect:()=>{var e;Digit.Utils.getMultiRootTenant()?(Digit.UserService.logout(),P(!1),window.location.href="/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/login")):(Digit.UserService.logout(),P(!1))},onCancel:A,onDismiss:A})})]})})};function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach(function(t){w(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}function E(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){N(r,i,o,l,a,"next",e)}function a(e){N(r,i,o,l,a,"throw",e)}l(void 0)})}}var D=e=>{var t,n,o,s,d,{isOpen:u,isMobile:v=!1,toggleSidebar:m,onLogout:g,isEmployee:f=!1,linkData:h,islinkDataLoading:y,userProfile:b}=e,{data:O,isFetched:x}=(Digit.Utils.getMultiRootTenant(),Digit.Hooks.useStore.getInitData()),S=Digit.StoreData.getCurrentLanguage(),[j,w]=(0,i.useState)(null),{languages:N,stateInfo:D}=O||{},I=Digit.UserService.getUser(),[P,A]=(0,i.useState)(""),[T,L]=(0,i.useState)(null),[R,M]=(0,i.useState)([]),[U,k]=(0,i.useState)([]),[B,F]=(0,i.useState)(S),{isLoading:V,data:G}=Digit.Hooks.useAccessControl(),z=Digit.ULBService.getCurrentTenantId(),{t:W}=(0,p.useTranslation)(),H=(0,a.useNavigate)(),q=(0,a.useLocation)(),X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(""==t)return e;for(;null!==(i=e)&&void 0!==i&&i.includes(t);){var i,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e};(0,i.useEffect)(()=>{var e,t=Digit.SessionStorage.get("citizen.userRequestObject"),n=[],i=[];null==t||null===(e=t.info)||void 0===e||null===(e=e.roles)||void 0===e||e.forEach(e=>n.push(e.tenantId));var o=n.filter((e,t,n)=>n.indexOf(e)===t);null==o||o.forEach(e=>{var t;i.push({label:W("TENANT_TENANTS_".concat(null===(t=X(e,".","_"))||void 0===t?void 0:t.toUpperCase())),value:e})}),null==i||i.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),M(i)},[T]);var Q=()=>{Digit.clikOusideFired=!0,m(!1)};(0,i.useEffect)(()=>{var e=function(){var e=E(function*(){var e,t=Digit.ULBService.getCurrentTenantId(),n=null==I||null===(e=I.info)||void 0===e?void 0:e.uuid;if(n){var i,o,r=yield Digit.UserService.userSearch(t,{uuid:[n]},{}),l=null==r||null===(i=r.user)||void 0===i?void 0:i[0];if(l){var a=Digit.UserService.getUser();Digit.UserService.setUser(C(C({},a),{},{info:l}))}if(r&&r.user&&null!=r&&null!==(o=r.user)&&void 0!==o&&o.length){var s,d=r.user[0],u=null==d||null===(s=d.photo)||void 0===s?void 0:s.split(",");w(null==u?void 0:u.at(0))}}});return function(){return e.apply(this,arguments)}}();j||e()},[j]);var Z=e=>{var t,n,i=null;Digit.Utils.getMultiRootTenant()?(i=f?e.replace("/sandbox-ui/employee","/sandbox-ui/".concat(z,"/employee")):e.replace("/sandbox-ui/citizen","/sandbox-ui/".concat(z,"/citizen")),H(i),m()):("/"===e[0]?H("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/").concat(f?"employee":"citizen").concat(e)):H("/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/").concat(f?"employee":"citizen","/").concat(e)),m())};if(y||V)return(0,c.jsx)(l.Loader,{});var Y=[{id:"login-btn",element:"LOGIN",text:W("CORE_COMMON_LOGIN"),icon:(0,c.jsx)(r.LogoutIcon,{className:"icon"}),populators:{onClick:()=>{var e,t;H(f?"/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/employee/user/language-selection"):"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/citizen/login")),Q()}}}];x&&I&&I.access_token&&(null==I||I.info,null==D||D.name,Y=Y.filter(e=>"login-btn"!==(null==e?void 0:e.id)));var K={};if(f){var J;null==G||G.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==P&&""!==e.path){var n=e.path.split(".")[0];"TradeLicense"===n&&(n="Trade License"),K[n]?K[n].push(e):K[n]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(P.toLowerCase())){var i=e.path.split(".")[0];"TradeLicense"===i&&(i="Trade License"),K[i]?K[i].push(e):K[i]=[e]}});for(var $=Object.keys(K),ee=function(e){var t,n,i,o,r,l,a=null===(t=K[$[e]][0])||void 0===t||null===(t=t.displayName)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.replace(/[ -]/g,"_"),s=null===(n=$[e])||void 0===n||null===(n=n.toUpperCase())||void 0===n?void 0:n.replace(/[ -]/g,"_");-1===K[$[e]][0].path.indexOf(".")?Y.splice(1,0,{type:"link",text:W("ACTION_TEST_".concat(a)),link:null===(i=K[$[e]][0])||void 0===i?void 0:i.navigationURL,icon:null===(o=K[$[e]][0])||void 0===o?void 0:o.leftIcon,populators:{onClick:()=>{var t;H(null===(t=K[$[e]][0])||void 0===t?void 0:t.navigationURL),Q()}}}):Y.splice(1,0,{type:"dynamic",moduleName:W("ACTION_TEST_".concat(s)),links:null===(r=K[$[e]])||void 0===r?void 0:r.map(e=>{var t;return C(C({},e),{},{displayName:W("ACTION_TEST_".concat(null==e||null===(t=e.displayName)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.replace(/[ -]/g,"_")))})}),icon:null===(l=K[$[e]][1])||void 0===l?void 0:l.leftIcon})},te=0;te<(null==$?void 0:$.length);te++)ee(te);var ne=Y.findIndex(e=>"HOME"===e.element),ie=Y.splice(ne,1),oe=Y.findIndex(e=>"LANGUAGE"===e.element),re=Y.splice(oe,(null===(J=Y)||void 0===J?void 0:J.length)-oe);Y.sort((e,t)=>{var n="dynamic"===(null==e?void 0:e.type)?null==e?void 0:e.moduleName:null==e?void 0:e.text,i="dynamic"===(null==t?void 0:t.type)?null==t?void 0:t.moduleName:null==t?void 0:t.text;return n.localeCompare(i)}),(null==ie?void 0:ie[0])&&Y.splice(0,0,ie[0]),Y=(null==re?void 0:re.length)>0?Y.concat(re):Y}else{var le;null===(le=Object.keys(h))||void 0===le||null===(le=le.sort((e,t)=>t.localeCompare(e)))||void 0===le||le.map(e=>{var t,n,i,o,r;"digit-ui-links"===(null===(t=h[e][0])||void 0===t?void 0:t.sidebar)&&Y.splice(1,0,{type:null!==(n=h[e][0])&&void 0!==n&&null!==(n=n.sidebarURL)&&void 0!==n&&n.includes(null===(i=window)||void 0===i?void 0:i.contextPath)?"link":"external-link",text:W("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(e))),links:h[e],icon:null===(o=h[e][0])||void 0===o?void 0:o.leftIcon,link:null===(r=h[e][0])||void 0===r?void 0:r.sidebarURL})})}q.pathname.includes("/openlink")&&(Y=Y.filter(e=>"LANGUAGE"===e.element)),Y=null===(t=Y)||void 0===t?void 0:t.map(e=>C(C({},e),{},{label:(null==e?void 0:e.text)||(null==e?void 0:e.moduleName)||"",icon:null!=e&&e.icon?null==e?void 0:e.icon:void 0}));var ae,se="";se=Digit.Utils.getMultiRootTenant()?W("TENANT_TENANTS_".concat(z)):W("TENANT_TENANTS_".concat(null===(ae=X(Digit.ULBService.getCurrentTenantId(),".","_"))||void 0===ae?void 0:ae.toUpperCase()));var de=null===(n=Y)||void 0===n?void 0:n.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?C(C({},e),{},{children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>C(C({},e),{},{label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}):e}),ue=null==R?void 0:R.map(e=>C(C({},e),{},{type:"custom",key:"city"})),ce=null==N?void 0:N.map(e=>C(C({},e),{},{type:"custom",key:"language",icon:"Language"})),ve=[{label:"HOME",value:"HOME",icon:"Home",type:"custom",key:"home"},{label:se,value:se,children:(null==ue?void 0:ue.length)>0?ue:void 0,type:"custom",icon:"LocationCity",key:"city"},{label:W("Language"),children:(null==ce?void 0:ce.length)>0?ce:void 0,type:"custom",icon:"Language",key:"language"},...I&&I.access_token?[{label:W("EDIT_PROFILE"),type:"custom",icon:"Edit",key:"editProfile"}]:[],{label:W("Modules"),icon:"DriveFileMove",children:de}];return v?(0,c.jsx)(l.Hamburger,{items:ve,profileName:null==I||null===(o=I.info)||void 0===o?void 0:o.name,profileNumber:(null==I||null===(s=I.info)||void 0===s?void 0:s.mobileNumber)||(null==I||null===(d=I.info)||void 0===d?void 0:d.emailId),theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:g,hideUserManuals:!0,profile:j||void 0,isSearchable:!0,onSelect:e=>{var{item:t,index:n,parentIndex:i}=e;return(e=>{var t,n,i,{item:o,index:r,parentIndex:l}=e;if(null!=o&&o.navigationURL)Z(null==o?void 0:o.navigationURL);else if(null!=o&&o.link)Z(null==o?void 0:o.link);else{if("custom"!==(null==o?void 0:o.type))return;switch(null==o?void 0:o.key){case"home":H(f?"/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/employee"):"/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/citizen")),m();break;case"editProfile":b(),m();break;case"language":F((t=o).value),Digit.LocalizationService.changeLanguage(t.value,D.code),m();break;case"city":(e=>{var t,n,i,o=Digit.SessionStorage.get("citizen.userRequestObject"),r=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(t=t.info)||void 0===t||null===(t=t.roles)||void 0===t?void 0:t.filter(t=>t.tenantId===e.value);if((null==r?void 0:r.length)>0&&(o.info.roles=r,o.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(o),L(e),"undefined"!=typeof window&&null!==(n=window.location)&&void 0!==n&&null!==(n=n.href)&&void 0!==n&&n.includes("/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/employee/"))){var l,a,s=(null===(l=q.state)||void 0===l?void 0:l.from)||"/".concat(null===(a=window)||void 0===a?void 0:a.contextPath,"/employee");H(s,{replace:!0})}try{"undefined"!=typeof window&&window.location.reload()}catch(e){console.warn("Failed to reload page:",e)}})(o),m()}}})({item:t,index:n,parentIndex:i})}}):(0,c.jsx)(_,{logout:g})},I=n(8854);const P=()=>{var e,t,n,{isLoading:i,data:o}=Digit.Hooks.useAccessControl(),r=Digit.Utils.getMultiRootTenant(),{t:s}=(0,p.useTranslation)(),d=(0,a.useNavigate)(),u=null===(e=Digit)||void 0===e||null===(e=e.ULBService)||void 0===e?void 0:e.getStateId();function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in e){var n=e[t];if("item"===t&&""!==(null==n?void 0:n.leftIcon))return null==n?void 0:n.leftIcon;if("object"==typeof e[t]&&!Array.isArray(e[t])){var i=v(e[t]);if(i)return i}}return null}function m(e,t){for(var n in t)t.hasOwnProperty(n)&&("object"!=typeof t[n]||Array.isArray(t[n])?e[n]||(e[n]=t[n]):(e[n]||(e[n]={}),m(e[n],t[n])))}var g={};null==o||o.actions.filter(e=>"url"===e.url).forEach(e=>{var t;if(null==e||null===(t=e.path)||void 0===t||null===(t=t.split("."))||void 0===t||t[0],""!==(null==e?void 0:e.path)){var n,i=null==e||null===(n=e.path)||void 0===n?void 0:n.split("."),o={};i.reduce((t,n,o)=>{if(o!==i.length-1)return t[n]={},t[n];t[n]={item:e}},o),m(g,o)}});var f=e=>(e.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:1/0)-(void 0!==t.orderNumber?t.orderNumber:1/0)),e.forEach(e=>{e.children&&e.children.length>0&&f(e.children)}),e),h=function(e){var t=(e,n)=>{if(n.item)return{label:s(n.item.displayName),icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL,orderNumber:n.item.orderNumber};var i=Object.keys(n).map(e=>t(e,n[e])),o=v(n);return{label:s(e),icon:{icon:o,width:"1.5rem",height:"1.5rem"},children:i}};return Object.keys(e).map(n=>t(n,e[n]))}((e=>{var t=Object.entries(e);return t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0),Object.fromEntries(t)})(g)),y=f(h);return i?(0,c.jsx)(l.Loader,{}):g?(0,c.jsx)(I.Ay,{minWidth:768,children:(0,c.jsx)(l.SideNav,{items:y,hideAccessbilityTools:!0,onSelect:e=>{var{item:t,index:n,parentIndex:i}=e;return(e=>{var{item:t,index:n,parentIndex:i}=e;null!=t&&t.navigationUrl&&function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(n&&"/"!==n)if(/^https?:\/\//i.test(n))window.open(n,"_blank","noopener,noreferrer");else if(n.includes("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath)))t(n);else{var i,o=window.location.origin;if(r){var l,a=(null===(l=window)||void 0===l?void 0:l.contextPath)||"sandbox-ui";t(i=n=n.replace("/".concat(a,"/employee"),"/".concat(a,"/").concat(u,"/employee")))}else{i=o+n;try{"undefined"!=typeof window&&(window.location.href=i)}catch(e){console.warn("Navigation failed, attempting fallback:",e);try{window.location.replace(i)}catch(e){console.error("All navigation methods failed:",e)}}}}}(d,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:i})},theme:(null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("SIDENAV_THEME"))||"dark",variant:(null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("SIDENAV_VARIANT"))||"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}})}):""},A=e=>{var{t,CITIZEN:n,isSidebarOpen:i,toggleSidebar:o,handleLogout:r,mobileView:l,userDetails:a,modules:s,linkData:d,islinkDataLoading:u,userProfile:v}=e;return n?(0,c.jsx)(D,{isOpen:i,isMobile:!0,toggleSidebar:o,onLogout:r,linkData:d,islinkDataLoading:u,userProfile:v,isEmployee:!1}):!i&&null!=a&&a.access_token?(0,c.jsx)("div",{className:"digit-employeeSidebar",children:(0,c.jsx)(P,{mobileView:l,userDetails:a,modules:s})}):(0,c.jsx)("div",{className:"digit-citizenSidebar",children:(0,c.jsx)(D,{isOpen:i,isMobile:!0,toggleSidebar:o,onLogout:r,isEmployee:!0,userProfile:v})})},T=e=>{var{t,stateInfo:n,userDetails:r,CITIZEN:l,cityDetails:s,mobileView:d,handleUserDropdownSelection:u,logoUrl:v,logoUrlWhite:p,showSidebar:g=!0,showLanguageChange:f,linkData:y,islinkDataLoading:b}=e,[O,x]=(0,i.useState)(!1),S=(0,a.useNavigate)(),[_,j]=(0,i.useState)(!1),C=()=>{x(!1),j(!0)},w=()=>{j(!1)},N=()=>{x(!O)},E=()=>{var e,t;S(l?"/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/user/profile"):"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee/user/profile"))},D=[{name:t("EDIT_PROFILE"),icon:"Edit",func:E},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:C}];return(0,c.jsxs)(o().Fragment,{children:[(0,c.jsx)(m,{t,stateInfo:n,toggleSidebar:N,isSidebarOpen:O,handleLogout:C,userDetails:r,CITIZEN:l,cityDetails:s,mobileView:d,userOptions:D,handleUserDropdownSelection:u,logoUrl:v,logoUrlWhite:p,showLanguageChange:f}),_&&(0,c.jsx)(h.A,{onSelect:()=>{Digit.UserService.logout(),j(!1)},onCancel:w,onDismiss:w}),l?l?g&&O&&(0,c.jsx)(A,{t,CITIZEN:l,isSidebarOpen:O,toggleSidebar:N,handleLogout:C,mobileView:d,userDetails:r,linkData:y,userProfile:E,islinkDataLoading:b}):null:g&&(0,c.jsx)(A,{t,CITIZEN:l,isSidebarOpen:O,toggleSidebar:N,handleLogout:C,mobileView:d,userDetails:r,linkData:y,userProfile:E,islinkDataLoading:b})]})}},5181(e,t,n){"use strict";n.d(t,{A:()=>a});var i=n(4883),o=n(6870);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function l(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".digit-home-main";return function(n){return(0,i.useEffect)(()=>{var e=n=>{if("Tab"===n.key){var i=document.querySelector(t);i&&(i.setAttribute("tabindex","-1"),i.style.outline="none",i.focus()),window.removeEventListener("keydown",e)}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,o.jsx)(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n))}}},4989(e,t,n){"use strict";n.d(t,{A:()=>o});var i=n(4883);const o=function(e,t){var n=(0,i.useRef)();(0,i.useEffect)(()=>{n.current=e},[e]),(0,i.useEffect)(()=>{if(null!==t){var e=setInterval(function(){n.current()},t);return()=>clearInterval(e)}},[t])}},1065(e,t,n){"use strict";n.d(t,{P:()=>i});var i=e=>{var t=Digit.Utils.getConfigModuleName();return Digit.Hooks.useCommonMDMS(e,t,["LoginConfig"],{select:e=>{var n;return{config:null==e||null===(n=e[t])||void 0===n?void 0:n.LoginConfig}},retry:!1})}},7973(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});var i=n(6243),o=n(4883),r=n(5953),l=n(338),a=n(6870);const s=e=>{var{question:t,answer:n,lastIndex:i}=e,[s,d]=(0,o.useState)(!1),{t:u}=(0,r.useTranslation)();return(0,a.jsxs)("div",{className:"faqs border-none",onClick:()=>d(!s),children:[(0,a.jsxs)("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"},children:[(0,a.jsx)("span",{children:u(t)}),(0,a.jsx)("span",{className:s?"faqicon rotate":"faqicon",style:{float:"right"},children:(0,a.jsx)(l.ArrowForward,{})})]}),(0,a.jsx)("div",{className:"faq-answer",style:s?{display:"block"}:{display:"none"},children:(0,a.jsx)("span",{children:u(n)})}),i?null:(0,a.jsx)("div",{className:"cs-box-border"})]})},d=e=>{var t,n,{module:l}=e,d=Digit.UserService.getUser(),{t:u}=((null==d||null===(t=d.info)||void 0===t?void 0:t.tenantId)||Digit.ULBService.getCurrentTenantId(),(0,r.useTranslation)()),{isLoading:c,data:v}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),m=null==v||null===(n=v.MdmsRes["common-masters"])||void 0===n||null===(n=n.faqs[0])||void 0===n?void 0:n["".concat(l)].faqs;return c?(0,a.jsx)(i.Loader,{}):(0,a.jsx)(o.Fragment,{children:(0,a.jsxs)("div",{className:"faq-page",children:[(0,a.jsx)(i.BackButton,{style:{marginLeft:"unset"}}),(0,a.jsx)("div",{style:{marginBottom:"15px"},children:(0,a.jsx)(i.HeaderComponent,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"},children:u("FAQ_S")})}),(0,a.jsx)("div",{className:"faq-list",children:m.map((e,t)=>(0,a.jsx)(s,{question:e.question,answer:e.answer,lastIndex:t===(null==m?void 0:m.length)-1},"faq_"+t))})]})})}},9466(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});var i=n(6243),o=n(4883),r=n(5953),l=n(4442),a=n(6870);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c=()=>{var{t:e}=(0,r.useTranslation)(),t=(0,l.useNavigate)(),{data:{languages:n,stateInfo:s}={},isLoading:u}=Digit.Hooks.useStore.getInitData(),c=Digit.StoreData.getCurrentLanguage(),v=(0,o.useMemo)(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),m=(0,o.useMemo)(()=>({options:n,optionsKey:"label",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,s.code),selectedOption:null==n?void 0:n.filter(e=>e.value===c)[0]}),[c,n]);return u?(0,a.jsx)(i.Loader,{}):(0,a.jsx)("div",{className:"selection-card-wrapper",children:(0,a.jsxs)(i.PageBasedInput,{texts:v,onSubmit:function(){var e;t("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/select-location"))},children:[(0,a.jsx)(i.CardHeader,{children:e("CS_COMMON_CHOOSE_LANGUAGE")}),(0,a.jsx)(i.RadioButtons,d({},m))]})})}},6945(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>v});var i=n(6243),o=n(5053),r=n(4883),l=n(5953),a=n(4442),s=n(6870);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const v=()=>{var{t:e}=(0,l.useTranslation)(),t=(0,a.useNavigate)(),n=(0,a.useLocation)(),{data:{stateInfo:d,uiHomePage:c}={},isLoading:v}=Digit.Hooks.useStore.getInitData(),m=null==c?void 0:c.redirectURL,{data:p,isLoading:g}=Digit.Hooks.useTenants(),[f,h]=(0,r.useState)(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[y,b]=(0,r.useState)(!1),O=(0,r.useMemo)(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function x(e){h(e),b(!1)}var S=(0,r.useMemo)(()=>({options:p,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:x,selectedOption:f}),[p,e,f]);return g?(0,s.jsx)("loader",{}):(0,s.jsxs)("div",{children:[(0,s.jsx)(i.BackLink,{onClick:()=>window.history.back()}),(0,s.jsxs)(o.PageBasedInput,{texts:O,onSubmit:function(){if(f){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",f);var i,o,r=null===(e=n.state)||void 0===e?void 0:e.redirectBackTo;m?t("/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/citizen/").concat(m)):r?t(r,{replace:!0}):t("/".concat(null===(o=window)||void 0===o?void 0:o.contextPath,"/citizen"))}else b(!0)},className:"location-selection-container",children:[(0,s.jsx)(o.CardHeader,{children:e("CS_COMMON_CHOOSE_LOCATION")}),(0,s.jsx)(o.SearchOnRadioButtons,u(u({},S),{},{placeholder:e("COMMON_TABLE_SEARCH")})),y?(0,s.jsx)(o.CardLabelError,{children:e("CS_COMMON_LOCATION_SELECTION_ERROR")}):null]})]})}},855(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>A});var i=n(6243),o=n(5053),r=n(4883),l=n.n(r),a=n(5953),s=n(4442),d=n(6870);function u(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}const c=function(e){var{setProfilePic:t,closeDrawer:n,userType:i,removeProfilePic:s,showToast:c}=e,[v,m]=(0,r.useState)(null),[p,g]=(0,r.useState)(""),[f,h]=(0,r.useState)(null),{t:y}=(0,a.useTranslation)();return(0,r.useEffect)(()=>{var e;(e=function*(){if(h(null),p)if(p.size>=1e6)c("error",y("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),h(y("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else try{var e,n=yield Digit.UploadServices.Filestorage("".concat(i,"-profile"),p,Digit.ULBService.getStateId());if((null==n||null===(e=n.data)||void 0===e||null===(e=e.files)||void 0===e?void 0:e.length)>0){var o,r=null==n||null===(o=n.data)||void 0===o||null===(o=o.files[0])||void 0===o?void 0:o.fileStoreId;m(r),t(r)}else c("error",y("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),h(y("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))}catch(e){c("error",y("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))}},function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){u(r,i,o,l,a,"next",e)}function a(e){u(r,i,o,l,a,"throw",e)}l(void 0)})})()},[p]),(0,d.jsxs)(l().Fragment,{children:[(0,d.jsx)("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>n()}),(0,d.jsxs)("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===i?"2.5rem":"0",zIndex:"1000"},children:[(0,d.jsxs)("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"},children:[(0,d.jsxs)("label",{for:"file",style:{cursor:"pointer"},children:[" ",(0,d.jsx)(o.GalleryIcon,{})]}),(0,d.jsx)("label",{style:{cursor:"pointer"},children:" Gallery"}),(0,d.jsx)("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>g(e.target.files[0]),style:{display:"none"}})]}),(0,d.jsxs)("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"},children:[(0,d.jsx)("button",{onClick:()=>{s(),n()},children:(0,d.jsx)(o.RemoveIcon,{})}),(0,d.jsx)("label",{style:{cursor:"pointer"},children:"Remove"})]})]})]})};var v,m,p=n(6177);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){y(r,i,o,l,a,"next",e)}function a(e){y(r,i,o,l,a,"throw",e)}l(void 0)})}}var O=null===(v=Digit)||void 0===v||null===(v=v.ULBService)||void 0===v||null===(m=v.getStateId)||void 0===m?void 0:m.call(v),x={tenantId:"".concat(O),UserProfileValidationConfig:[{name:"/^[a-zA-Z ]+$/i",mobileNumber:"/^[6-9]{1}[0-9]{9}$/",password:"/^([a-zA-Z0-9@#$%]{8,15})$/i"}]};const S=e=>{var t,n,u,v,m,g,h,y,O,S,_,j,C,w,N,E,D,I,P,A,T,L,R,M,U,{stateCode:k,userType:B,cityDetails:F}=e,V=(0,s.useNavigate)(),{t:G}=(0,a.useTranslation)(),z=window.location.href,W=Digit.ULBService.getStateId(),H=Digit.ULBService.getCurrentTenantId(),q=(null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info)||{},[X,Q]=(0,r.useState)(null),[Z,Y]=(0,r.useState)(null!=q&&q.name?q.name:""),[K,J]=(0,r.useState)(null!=q&&q.emailId?q.emailId:""),[$,ee]=(0,r.useState)(null==X?void 0:X.gender),[te,ne]=(0,r.useState)(null!=q&&q.permanentCity?q.permanentCity:F.name),[ie,oe]=(0,r.useState)(null!=q&&q.mobileNumber?q.mobileNumber:""),[re,le]=(0,r.useState)(null),[ae,se]=(0,r.useState)(""),[de,ue]=(0,r.useState)(!1),[ce,ve]=(0,r.useState)(!1),[me,pe]=(0,r.useState)(""),[ge,fe]=(0,r.useState)(""),[he,ye]=(0,r.useState)(""),[be,Oe]=(0,r.useState)(null),[xe,Se]=(0,r.useState)(!1),[_e,je]=l().useState(window.innerWidth),[Ce,we]=l().useState({}),Ne=window.Digit.Utils.browser.isMobile(),Ee=Digit.Utils.getMultiRootTenant(),De=null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH"),Ie=e=>{var t;return(null==e||null===(t=e.UserProfileValidationConfig)||void 0===t?void 0:t[0])&&Object.entries(null==e?void 0:e.UserProfileValidationConfig[0]).reduce((e,t)=>{var[n,i]=t;if("string"==typeof i)try{if(i.startsWith("/")&&i.lastIndexOf("/")>0){var o=i.lastIndexOf("/"),r=i.slice(1,o),l=i.slice(o+1);e[n]=new RegExp(r,l)}else e[n]=new RegExp(i)}catch(t){console.error('Error parsing regex for key "'.concat(n,'":'),t),e[n]=i}else e[n]=i;return e},{})},[Pe,Ae]=(0,r.useState)(Ie(x)||{}),{data:Te,isValidationConfigLoading:Le}=Digit.Hooks.useCustomMDMS(k,"commonUiConfig",[{name:"UserProfileValidationConfig"}],{select:e=>null==e?void 0:e.commonUiConfig});(0,r.useEffect)(()=>{var e;if(Te&&null!=Te&&null!==(e=Te.UserProfileValidationConfig)&&void 0!==e&&e[0]){var t=Ie(Te);Ae(t)}},[Te]);var Re=function(){var e=b(function*(){var e=null==q?void 0:q.uuid;if(e){var t,n=yield Digit.CustomService.getResponse({url:"".concat(De,"/v1/_search"),useCache:!1,method:"POST",userService:!0,params:{limit:1e3,offset:0,tenantId:H},body:{Individual:{userUuid:[e],tenantId:H}}});null!=n&&null!==(t=n.Individual)&&void 0!==t&&t.length&&Q(n.Individual[0])}});return function(){return e.apply(this,arguments)}}();l().useEffect(()=>(window.addEventListener("resize",()=>je(window.innerWidth)),()=>{window.removeEventListener("resize",()=>je(window.innerWidth))})),(0,r.useEffect)(()=>{var e;Se(!0),Re(),ee({i18nKey:void 0,code:null==X?void 0:X.gender,value:null==X?void 0:X.gender});var t=null==X||null===(e=X.photo)||void 0===e?void 0:e.split(",");se(null==t?void 0:t.at(0)),Se(!1)},[null!==X]);var Me=!1,Ue=e=>ee(e),ke=()=>ue(!1),Be=e=>{var t;Y(e),null==Pe||null===(t=Pe.name)||void 0===t||!t.test(e)||0===e.length||e.length>50?we(f(f({},Ce),{},{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):we(f(f({},Ce),{},{userName:null}))},Fe=e=>{(null==q?void 0:q.userName)!==e?(J(e),!e.length||e.includes("@")&&e.includes(".")?we(f(f({},Ce),{},{emailAddress:null})):we(f(f({},Ce),{},{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))):we(f(f({},Ce),{},{emailAddress:null}))},Ve=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;Oe({key:e,action:t}),setTimeout(()=>{Oe(null)},n)},Ge=function(){var e=b(function*(){Se(!0);try{var e,t,n;if(Z&&Y(e=>e.trim()),null==Pe||!Pe.name.test(Z)||""===Z||Z.length>50||Z.length<1)throw JSON.stringify({type:"error",message:G("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===B&&(null==Pe||!Pe.mobileNumber.test(ie)))throw JSON.stringify({type:"error",message:G("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(K.length&&(!K.includes("@")||!K.includes(".")))throw JSON.stringify({type:"error",message:G("CORE_COMMON_PROFILE_EMAIL_INVALID")});var i,o=me.trim(),r=ge.trim(),l=he.trim();if(pe(o),fe(r),ye(l),ce&&o&&r&&l){if(r!==l)throw JSON.stringify({type:"error",message:G("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(o.length&&r.length&&l.length))throw JSON.stringify({type:"error",message:G("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!(null!=Pe&&Pe.password.test(r)||null!=Pe&&Pe.password.test(l)))throw JSON.stringify({type:"error",message:G("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}var a=f(f({},X),{},{tenantId:H,name:{givenName:Z.trim(),familyName:null==X||null===(e=X.name)||void 0===e?void 0:e.familyName,otherNames:null==X||null===(t=X.name)||void 0===t?void 0:t.otherNames},mobileNumber:ie,isDeleted:!1,isSystemUser:!0,isSystemUserActive:!0});null!=$&&$.value&&(a.gender=$.value),K&&(a.email=K),re&&(a.photo=re);var s=yield Digit.CustomService.getResponse({url:"".concat(De,"/v1/_update"),useCache:!1,method:"POST",userService:!0,body:{Individual:a}});if((i=null==s?void 0:s.responseInfo)&&"200"===i.status){var d=Digit.UserService.getUser();d&&Digit.UserService.setUser(f(f({},d),{},{info:f(f({},d.info),{},{name:Z,mobileNumber:ie,emailId:K,permanentCity:te})}))}if(me.length&&ge.length&&he.length){var u={existingPassword:me,newPassword:ge,tenantId:H,type:"EMPLOYEE",username:null==q?void 0:q.userName,confirmPassword:he};if(ge!==he)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"});try{var c=yield Digit.UserService.changePassword(u,H),{responseInfo:v}=c;if(null==v||!v.status||"200"!==v.status)throw"";Ve("success",G("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)}catch(e){var m;throw JSON.stringify({type:"error",message:null!==(m=e.Errors)&&void 0!==m&&null!==(m=m.at(0))&&void 0!==m&&m.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})}}else null!==(n=i)&&void 0!==n&&n.status&&"200"===i.status&&Ve("success",G("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}catch(e){var p;try{p=JSON.parse(e)}catch(t){var g;p={type:"error",message:(null==e||null===(g=e.response)||void 0===g||null===(g=g.data)||void 0===g||null===(g=g.Errors)||void 0===g||null===(g=g[0])||void 0===g?void 0:g.description)||"CORE_COMMON_PROFILE_UPDATE_ERROR"}}Ve(p.type,G(p.message),5e3)}Se(!1)});return function(){return e.apply(this,arguments)}}(),ze=[],{data:We}=Digit.Hooks.useGenderMDMS(W,"common-masters","GenderType");We&&We.map(e=>{ze.push({i18nKey:"PT_COMMON_GENDER_".concat(e.code),code:"".concat(e.code),value:"".concat(e.code)})});var He=function(){var e=b(function*(e){le(e);var t=e?yield qe([e],W):null;se(null==t?void 0:t.thumbs[0]),ke()});return function(t){return e.apply(this,arguments)}}(),qe=function(){var e=b(function*(e,t){var n=yield Digit.UploadServices.Filefetch(e,t);return n.data.fileStoreIds&&0!==n.data.fileStoreIds.length?{thumbs:n.data.fileStoreIds.map(e=>e.url.split(",")[3]),images:n.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null});return function(t,n){return e.apply(this,arguments)}}();return xe||Le?(0,d.jsx)(i.Loader,{}):(0,d.jsxs)("div",{className:"user-profile ".concat("citizen"===B?"citizen":"employee"),children:[(0,d.jsx)("section",{style:{margin:"citizen"===B||Ne?"8px":"0px"},children:"citizen"===B||Ne?(0,d.jsx)(i.BackLink,{onClick:()=>V(-1)}):(0,d.jsx)(i.BreadCrumb,{style:{marginTop:"0rem",marginBottom:"1.5rem"},crumbs:[{internalLink:Ee?"/".concat(null===(u=window)||void 0===u?void 0:u.contextPath,"/employee/sandbox/landing"):"/".concat(null===(v=window)||void 0===v?void 0:v.contextPath,"/employee"),content:G("ES_COMMON_HOME"),show:!0},{internalLink:"/".concat(null===(m=window)||void 0===m?void 0:m.contextPath,"/employee/user/profile"),content:G("ES_COMMON_PAGE_1"),show:z.includes("/user/profile")}]})}),(0,d.jsxs)("div",{style:{display:"flex",flex:1,flexDirection:_e<768||"citizen"===B?"column":"row",margin:"citizen"===B?"8px":"0px",gap:"citizen"===B?"":"0 24px",boxShadow:"citizen"===B?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===B?"white":"",borderRadius:"citizen"===B?"4px":"",maxWidth:"citizen"===B?"960px":""},children:[(0,d.jsx)("section",{style:{position:"relative",display:"flex",flex:"citizen"===B?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===B?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:"".concat("citizen"===B?"8px":"24px"," solid #fff"),background:"#EEEEEE",padding:"citizen"===B?"8px":"16px"},children:(0,d.jsxs)("div",{style:{position:"relative",height:"citizen"===B?"114px":"150px",width:"citizen"===B?"114px":"150px",margin:"16px"},children:[(0,d.jsx)(p.A,{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:ae&&""!==ae?ae:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC",alt:"Profile Image"}),(0,d.jsx)("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>ue(!de),children:(0,d.jsx)(o.CameraIcon,{})})]})}),(0,d.jsx)("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===B?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===B?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===B?"8px":"24px",paddingBottom:"20px"},children:"citizen"===B?(0,d.jsxs)(l().Fragment,{children:[(0,d.jsxs)(i.LabelFieldPair,{children:[(0,d.jsxs)(i.CardLabel,{className:"user-profile",style:{},children:["".concat(G("CORE_COMMON_PROFILE_NAME")),"*"]}),(0,d.jsxs)("div",{style:{width:"100%",maxWidth:"960px"},children:[(0,d.jsx)(i.TextInput,f(f({t:G,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:Z,onChange:e=>Be(e.target.value)},{isRequired:!0,pattern:(null==Te||null===(g=Te.UserProfileValidationConfig)||void 0===g||null===(g=g[0])||void 0===g?void 0:g.name)||(null==x||null===(h=x.UserProfileValidationConfig)||void 0===h||null===(h=h[0])||void 0===h?void 0:h.name),type:"tel",title:G("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")}),{},{disable:Me})),(null==Ce?void 0:Ce.userName)&&(0,d.jsx)(i.ErrorMessage,{message:G(null==Ce||null===(y=Ce.userName)||void 0===y?void 0:y.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{children:[(0,d.jsx)(i.CardLabel,{className:"user-profile",style:{},children:"".concat(G("CORE_COMMON_PROFILE_GENDER"))}),(0,d.jsx)(i.Dropdown,{style:{width:"100%",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==$?void 0:$.length)?$[0]:$,disable:1===(null==$?void 0:$.length)||Me,option:ze,select:Ue,value:$,optionKey:"code",t:G,name:"gender"})]}),(0,d.jsxs)(i.LabelFieldPair,{children:[(0,d.jsx)(i.CardLabel,{className:"user-profile",style:{},children:"".concat(G("CORE_COMMON_PROFILE_EMAIL"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,{t:G,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:K,onChange:e=>Fe(e.target.value),disabled:Me}),(null==Ce?void 0:Ce.emailAddress)&&(0,d.jsx)(i.ErrorMessage,{message:G(null==Ce||null===(O=Ce.emailAddress)||void 0===O?void 0:O.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsx)("button",{onClick:Ge,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Ne?"100%":"240px",borderBottom:"1px solid black"},children:G("CORE_COMMON_SAVE")})]}):(0,d.jsxs)(l().Fragment,{children:[(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsxs)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:["".concat(G("CORE_COMMON_PROFILE_NAME")),"*"]}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,f(f({t:G,type:"text",isMandatory:!1,name:"name",value:Z,onChange:e=>Be(e.target.value),placeholder:"Enter Your Name"},{isRequired:!0,pattern:(null==Te||null===(S=Te.UserProfileValidationConfig)||void 0===S||null===(S=S[0])||void 0===S?void 0:S.name)||(null==x||null===(_=x.UserProfileValidationConfig)||void 0===_||null===(_=_[0])||void 0===_?void 0:_.name),type:"text",title:G("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")}),{},{disabled:Me})),(null==Ce?void 0:Ce.userName)&&(0,d.jsx)(i.ErrorMessage,{message:G(null==Ce||null===(j=Ce.userName)||void 0===j?void 0:j.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(G("CORE_COMMON_PROFILE_GENDER"))}),(0,d.jsx)("div",{style:{width:"100%"},children:(0,d.jsx)(i.Dropdown,{className:"profileDropdown",selected:1===(null==$?void 0:$.length)?$[0]:$,disable:1===(null==$?void 0:$.length)||Me,option:ze,select:Ue,value:$,optionKey:"code",t:G,name:"gender"})})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(G("CORE_COMMON_PROFILE_CITY"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,f(f({t:G,type:"text",isMandatory:!1,name:"city",value:G(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_".concat(H))),onChange:e=>ne(e.target.value),placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:G("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")}),{},{disabled:!0})),(0,d.jsx)(i.ErrorMessage,{})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(G("CORE_COMMON_PROFILE_MOBILE_NUMBER"),"*")}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.MobileNumber,{value:ie,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{var t;oe(e),"employee"!==B||null!=Pe&&null!==(t=Pe.mobileNumber)&&void 0!==t&&t.test(e)?we(f(f({},Ce),{},{mobileNumber:null})):we(f(f({},Ce),{},{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))})(e),disable:!Digit.Utils.getMultiRootTenant(),required:!0,pattern:(null==Te||null===(C=Te.UserProfileValidationConfig)||void 0===C||null===(C=C[0])||void 0===C?void 0:C.mobileNumber)||(null==x||null===(w=x.UserProfileValidationConfig)||void 0===w||null===(w=w[0])||void 0===w?void 0:w.mobileNumber),type:"tel",title:G("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==Ce?void 0:Ce.mobileNumber)&&(0,d.jsx)(i.ErrorMessage,{message:G(null==Ce||null===(N=Ce.mobileNumber)||void 0===N?void 0:N.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(G("CORE_COMMON_PROFILE_EMAIL"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,{t:G,type:"email",isMandatory:!1,placeholder:G("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:K,onChange:e=>Fe(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()||Me}),(null==Ce?void 0:Ce.emailAddress)&&(0,d.jsx)(i.ErrorMessage,{message:G(null==Ce||null===(E=Ce.emailAddress)||void 0===E?void 0:E.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsx)(i.LabelFieldPair,{children:(0,d.jsxs)("div",{style:{width:"100%"},children:[0!=ce||Digit.Utils.getOTPBasedLogin()?null:(0,d.jsx)(i.Button,{label:G("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>ve(!ce),style:{paddingLeft:"20rem"}}),ce?(0,d.jsxs)("div",{style:{marginTop:"10px"},children:[(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(G("CORE_COMMON_PROFILE_CURRENT_PASSWORD"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,{t:G,type:"password",isMandatory:!1,name:"name",pattern:(null==Te||null===(D=Te.UserProfileValidationConfig)||void 0===D||null===(D=D[0])||void 0===D?void 0:D.password)||(null==x||null===(I=x.UserProfileValidationConfig)||void 0===I||null===(I=I[0])||void 0===I?void 0:I.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,void(null!=Pe&&Pe.password.test(n)?we(f(f({},Ce),{},{currentPassword:null})):we(f(f({},Ce),{},{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:Me}),(null==Ce?void 0:Ce.currentPassword)&&(0,d.jsx)(i.ErrorMessage,{message:G(null==Ce||null===(P=Ce.currentPassword)||void 0===P?void 0:P.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(G("CORE_COMMON_PROFILE_NEW_PASSWORD"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,{t:G,type:"password",isMandatory:!1,name:"name",pattern:(null==Te||null===(A=Te.UserProfileValidationConfig)||void 0===A||null===(A=A[0])||void 0===A?void 0:A.password)||(null==x||null===(T=x.UserProfileValidationConfig)||void 0===T||null===(T=T[0])||void 0===T?void 0:T.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,fe(n),void(null!=Pe&&Pe.password.test(n)?we(f(f({},Ce),{},{newPassword:null})):we(f(f({},Ce),{},{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:Me}),(null==Ce?void 0:Ce.newPassword)&&(0,d.jsx)(i.ErrorMessage,{message:G(null==Ce||null===(L=Ce.newPassword)||void 0===L?void 0:L.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(G("CORE_COMMON_PROFILE_CONFIRM_PASSWORD"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,{t:G,type:"password",isMandatory:!1,name:"name",pattern:(null==Te||null===(R=Te.UserProfileValidationConfig)||void 0===R||null===(R=R[0])||void 0===R?void 0:R.password)||(null==x||null===(M=x.UserProfileValidationConfig)||void 0===M||null===(M=M[0])||void 0===M?void 0:M.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,ye(n),void(null!=Pe&&Pe.password.test(n)?we(f(f({},Ce),{},{confirmPassword:null})):we(f(f({},Ce),{},{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:Me}),(null==Ce?void 0:Ce.confirmPassword)&&(0,d.jsx)(i.ErrorMessage,{message:G(null==Ce||null===(U=Ce.confirmPassword)||void 0===U?void 0:U.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]})]}):""]})}),"employee"===B&&Ne?(0,d.jsx)("button",{onClick:Ge,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Ne?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"},children:G("CORE_COMMON_SAVE")}):null]})})]}),"employee"!==B||Ne?null:(0,d.jsx)(i.Footer,{actionFields:[(0,d.jsx)(i.SubmitBar,{t:G,label:G("CORE_COMMON_SAVE"),onSubmit:Ge})],className:"",setactionFieldsToRight:!0}),be&&(0,d.jsx)(i.Toast,{type:be.key,label:G("success"===be.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":be.action),onClose:()=>Oe(null),style:{maxWidth:"670px"}}),1==de?(0,d.jsx)(c,{setProfilePic:He,closeDrawer:ke,userType:B,removeProfilePic:()=>{le(null),se(null)},showToast:Ve}):""]})};var _,j;function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach(function(t){N(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}function D(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){E(r,i,o,l,a,"next",e)}function a(e){E(r,i,o,l,a,"throw",e)}l(void 0)})}}var I=null===(_=Digit)||void 0===_||null===(_=_.ULBService)||void 0===_||null===(j=_.getStateId)||void 0===j?void 0:j.call(_),P={tenantId:"".concat(I),UserProfileValidationConfig:[{name:"/^[a-zA-Z ]+$/i",mobileNumber:"/^[6-9]{1}[0-9]{9}$/",password:"/^([a-zA-Z0-9@#$%]{8,15})$/i"}]};const A=e=>{var t,n,u,v,m,g,f,h,y,b,O,x,_,j,C,N,E,I,A,T,L,R,M,U,k,B,{stateCode:F,userType:V,cityDetails:G}=e,z=null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("USE_INDIVIDUAL_MODEL"),W=null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");if(z&&W)return(0,d.jsx)(S,{stateCode:F,userType:V,cityDetails:G});var H=(0,s.useNavigate)(),{t:q}=(0,a.useTranslation)(),X=window.location.href,Q=Digit.ULBService.getStateId(),Z=Digit.ULBService.getCurrentTenantId(),Y=(null===(u=Digit.UserService.getUser())||void 0===u?void 0:u.info)||{},[K,J]=(0,r.useState)(null),[$,ee]=(0,r.useState)(null!=Y&&Y.name?Y.name:""),[te,ne]=(0,r.useState)(null!=Y&&Y.emailId?Y.emailId:""),[ie,oe]=(0,r.useState)(null==K?void 0:K.gender),[re,le]=(0,r.useState)(null!=Y&&Y.permanentCity?Y.permanentCity:G.name),[ae,se]=(0,r.useState)(null!=Y&&Y.mobileNumber?Y.mobileNumber:""),[de,ue]=(0,r.useState)(null),[ce,ve]=(0,r.useState)(""),[me,pe]=(0,r.useState)(!1),[ge,fe]=(0,r.useState)(!1),[he,ye]=(0,r.useState)(""),[be,Oe]=(0,r.useState)(""),[xe,Se]=(0,r.useState)(""),[_e,je]=(0,r.useState)(null),[Ce,we]=(0,r.useState)(!1),[Ne,Ee]=l().useState(window.innerWidth),[De,Ie]=l().useState({}),Pe=window.Digit.Utils.browser.isMobile(),Ae=Digit.Utils.getMultiRootTenant(),Te=e=>{var t;return(null==e||null===(t=e.UserProfileValidationConfig)||void 0===t?void 0:t[0])&&Object.entries(null==e?void 0:e.UserProfileValidationConfig[0]).reduce((e,t)=>{var[n,i]=t;if("string"==typeof i)try{if(i.startsWith("/")&&i.lastIndexOf("/")>0){var o=i.lastIndexOf("/"),r=i.slice(1,o),l=i.slice(o+1);e[n]=new RegExp(r,l)}else e[n]=new RegExp(i)}catch(t){console.error('Error parsing regex for key "'.concat(n,'":'),t),e[n]=i}else e[n]=i;return e},{})},[Le,Re]=(0,r.useState)(Te(P)||{}),{data:Me,isValidationConfigLoading:Ue}=Digit.Hooks.useCustomMDMS(F,"commonUiConfig",[{name:"UserProfileValidationConfig"}],{select:e=>null==e?void 0:e.commonUiConfig});(0,r.useEffect)(()=>{var e;if(Me&&null!=Me&&null!==(e=Me.UserProfileValidationConfig)&&void 0!==e&&e[0]){var t=Te(Me);Re(t)}},[Me]);var ke=function(){var e=D(function*(){var e=null==Y?void 0:Y.uuid;if(e){var t=yield Digit.UserService.userSearch(Z,{uuid:[e]},{});t&&t.user&&t.user.length&&J(t.user[0])}});return function(){return e.apply(this,arguments)}}();l().useEffect(()=>{var e=()=>Ee(window.innerWidth);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,r.useEffect)(()=>{var e;we(!0),ke(),oe({i18nKey:void 0,code:null==K?void 0:K.gender,value:null==K?void 0:K.gender});var t=null==K||null===(e=K.photo)||void 0===e?void 0:e.split(",");ve(null==t?void 0:t.at(0)),we(!1)},[null!==K]);var Be=!1,Fe=e=>oe(e),Ve=()=>pe(!1),Ge=e=>{var t;ee(e),null==Le||null===(t=Le.name)||void 0===t||!t.test(e)||0===e.length||e.length>50?Ie(w(w({},De),{},{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):Ie(w(w({},De),{},{userName:null}))},ze=e=>{(null==Y?void 0:Y.userName)!==e?(ne(e),!e.length||e.includes("@")&&e.includes(".")?Ie(w(w({},De),{},{emailAddress:null})):Ie(w(w({},De),{},{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))):Ie(w(w({},De),{},{emailAddress:null}))},We=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;je({key:e,action:t}),setTimeout(()=>{je(null)},n)},He=function(){var e=D(function*(){we(!0);try{var e=w(w({},Y),{},{name:$,gender:null==ie?void 0:ie.value,emailId:te,photo:de});if($&&ee(e=>e.trim()),null==Le||!Le.name.test($)||""===$||$.length>50||$.length<1)throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===V&&(null==Le||!Le.mobileNumber.test(ae)))throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(te.length&&(!te.includes("@")||!te.includes(".")))throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_EMAIL_INVALID")});var t=he.trim(),n=be.trim(),i=xe.trim();if(ye(t),Oe(n),Se(i),ge&&t&&n&&i){if(n!==i)throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(t.length&&n.length&&i.length))throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!(null!=Le&&Le.password.test(n)||null!=Le&&Le.password.test(i)))throw JSON.stringify({type:"error",message:q("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}var{responseInfo:o,user:r}=yield Digit.UserService.updateUser(e,F);if(o&&"200"===o.status){var l=Digit.UserService.getUser();l&&Digit.UserService.setUser(w(w({},l),{},{info:w(w({},l.info),{},{name:$,mobileNumber:ae,emailId:te,permanentCity:re})}))}if(he.length&&be.length&&xe.length){var a={existingPassword:he,newPassword:be,tenantId:Z,type:"EMPLOYEE",username:null==Y?void 0:Y.userName,confirmPassword:xe};if(be!==xe)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"});try{var s=yield Digit.UserService.changePassword(a,Z),{responseInfo:d}=s;if(null==d||!d.status||"200"!==d.status)throw"";We("success",q("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)}catch(e){var u;throw JSON.stringify({type:"error",message:null!==(u=e.Errors)&&void 0!==u&&null!==(u=u.at(0))&&void 0!==u&&u.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})}}else null!=o&&o.status&&"200"===o.status&&We("success",q("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}catch(e){var c=JSON.parse(e);We(c.type,q(c.message),5e3)}we(!1)});return function(){return e.apply(this,arguments)}}(),qe=[],{data:Xe}=Digit.Hooks.useGenderMDMS(Q,"common-masters","GenderType");Xe&&Xe.map(e=>{qe.push({i18nKey:"PT_COMMON_GENDER_".concat(e.code),code:"".concat(e.code),value:"".concat(e.code)})});var Qe=function(){var e=D(function*(e){ue(e);var t=e?yield Ze([e],Q):null;ve(null==t?void 0:t.thumbs[0]),Ve()});return function(t){return e.apply(this,arguments)}}(),Ze=function(){var e=D(function*(e,t){var n=yield Digit.UploadServices.Filefetch(e,t);return n.data.fileStoreIds&&0!==n.data.fileStoreIds.length?{thumbs:n.data.fileStoreIds.map(e=>e.url.split(",")[3]),images:n.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null});return function(t,n){return e.apply(this,arguments)}}();return Ce||Ue?(0,d.jsx)(i.Loader,{}):(0,d.jsxs)("div",{className:"user-profile ".concat("citizen"===V?"citizen":"employee"),children:[(0,d.jsx)("section",{style:{margin:"citizen"===V||Pe?"8px":"0px"},children:"citizen"===V||Pe?(0,d.jsx)(i.BackLink,{onClick:()=>H("/")}):(0,d.jsx)(i.BreadCrumb,{style:{marginTop:"0rem",marginBottom:"1.5rem"},crumbs:[{internalLink:Ae?"/".concat(null===(v=window)||void 0===v?void 0:v.contextPath,"/employee/sandbox/landing"):"/".concat(null===(m=window)||void 0===m?void 0:m.contextPath,"/employee"),content:q("ES_COMMON_HOME"),show:!0},{internalLink:"/".concat(null===(g=window)||void 0===g?void 0:g.contextPath,"/employee/user/profile"),content:q("ES_COMMON_PAGE_1"),show:X.includes("/user/profile")}]})}),(0,d.jsxs)("div",{style:{display:"flex",flex:1,flexDirection:Ne<768||"citizen"===V?"column":"row",margin:"citizen"===V?"8px":"0px",gap:"citizen"===V?"":"0 24px",boxShadow:"citizen"===V?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===V?"white":"",borderRadius:"citizen"===V?"4px":"",maxWidth:"citizen"===V?"960px":""},children:[(0,d.jsx)("section",{style:{position:"relative",display:"flex",flex:"citizen"===V?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===V?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:"".concat("citizen"===V?"8px":"24px"," solid #fff"),background:"#EEEEEE",padding:"citizen"===V?"8px":"16px"},children:(0,d.jsxs)("div",{style:{position:"relative",height:"citizen"===V?"114px":"150px",width:"citizen"===V?"114px":"150px",margin:"16px"},children:[(0,d.jsx)(p.A,{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:ce&&""!==ce?ce:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC",alt:"Profile Image"}),(0,d.jsx)("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>pe(!me),children:(0,d.jsx)(o.CameraIcon,{})})]})}),(0,d.jsx)("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===V?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===V?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===V?"8px":"24px",paddingBottom:"20px"},children:"citizen"===V?(0,d.jsxs)(l().Fragment,{children:[(0,d.jsxs)(i.LabelFieldPair,{children:[(0,d.jsxs)(i.CardLabel,{className:"user-profile",style:{},children:["".concat(q("CORE_COMMON_PROFILE_NAME")),"*"]}),(0,d.jsxs)("div",{style:{width:"40rem",maxWidth:"960px"},children:[(0,d.jsx)(i.TextInput,w(w({t:q,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:$,onChange:e=>Ge(e.target.value)},{isRequired:!0,pattern:(null==Me||null===(f=Me.UserProfileValidationConfig)||void 0===f||null===(f=f[0])||void 0===f?void 0:f.name)||(null==P||null===(h=P.UserProfileValidationConfig)||void 0===h||null===(h=h[0])||void 0===h?void 0:h.name),type:"tel",title:q("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")}),{},{disable:Be})),(null==De?void 0:De.userName)&&(0,d.jsx)(i.ErrorMessage,{message:q(null==De||null===(y=De.userName)||void 0===y?void 0:y.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{children:[(0,d.jsx)(i.CardLabel,{className:"user-profile",style:{},children:"".concat(q("CORE_COMMON_PROFILE_GENDER"))}),(0,d.jsx)(i.Dropdown,{style:{width:"40rem",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==ie?void 0:ie.length)?ie[0]:ie,disable:1===(null==ie?void 0:ie.length)||Be,option:qe,select:Fe,value:ie,optionKey:"code",t:q,name:"gender"})]}),(0,d.jsxs)(i.LabelFieldPair,{children:[(0,d.jsx)(i.CardLabel,{className:"user-profile",style:{},children:"".concat(q("CORE_COMMON_PROFILE_EMAIL"))}),(0,d.jsxs)("div",{style:{width:"40rem"},children:[(0,d.jsx)(i.TextInput,{t:q,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:te,onChange:e=>ze(e.target.value),disabled:Be}),(null==De?void 0:De.emailAddress)&&(0,d.jsx)(i.ErrorMessage,{message:q(null==De||null===(b=De.emailAddress)||void 0===b?void 0:b.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsx)("button",{onClick:He,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Pe?"100%":"240px",borderBottom:"1px solid black"},children:q("CORE_COMMON_SAVE")})]}):(0,d.jsxs)(l().Fragment,{children:[(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsxs)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:["".concat(q("CORE_COMMON_PROFILE_NAME")),"*"]}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,w(w({t:q,type:"text",isMandatory:!1,name:"name",value:$,onChange:e=>Ge(e.target.value),placeholder:"Enter Your Name"},{isRequired:!0,pattern:(null==Me||null===(O=Me.UserProfileValidationConfig)||void 0===O||null===(O=O[0])||void 0===O?void 0:O.name)||(null==P||null===(x=P.UserProfileValidationConfig)||void 0===x||null===(x=x[0])||void 0===x?void 0:x.name),type:"text",title:q("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")}),{},{disabled:Be})),(null==De?void 0:De.userName)&&(0,d.jsx)(i.ErrorMessage,{message:q(null==De||null===(_=De.userName)||void 0===_?void 0:_.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(q("CORE_COMMON_PROFILE_GENDER"))}),(0,d.jsx)("div",{style:{width:"100%"},children:(0,d.jsx)(i.Dropdown,{className:"profileDropdown",selected:1===(null==ie?void 0:ie.length)?ie[0]:ie,disable:1===(null==ie?void 0:ie.length)||Be,option:qe,select:Fe,value:ie,optionKey:"code",t:q,name:"gender"})})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(q("CORE_COMMON_PROFILE_CITY"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,w(w({t:q,type:"text",isMandatory:!1,name:"city",value:q(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_".concat(Z))),onChange:e=>le(e.target.value),placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:q("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")}),{},{disabled:!0})),(0,d.jsx)(i.ErrorMessage,{})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(q("CORE_COMMON_PROFILE_MOBILE_NUMBER"),"*")}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.MobileNumber,{value:ae,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{var t;se(e),"employee"!==V||null!=Le&&null!==(t=Le.mobileNumber)&&void 0!==t&&t.test(e)?Ie(w(w({},De),{},{mobileNumber:null})):Ie(w(w({},De),{},{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))})(e),disable:!Digit.Utils.getMultiRootTenant(),required:!0,pattern:(null==Me||null===(j=Me.UserProfileValidationConfig)||void 0===j||null===(j=j[0])||void 0===j?void 0:j.mobileNumber)||(null==P||null===(C=P.UserProfileValidationConfig)||void 0===C||null===(C=C[0])||void 0===C?void 0:C.mobileNumber),type:"tel",title:q("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==De?void 0:De.mobileNumber)&&(0,d.jsx)(i.ErrorMessage,{message:q(null==De||null===(N=De.mobileNumber)||void 0===N?void 0:N.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(q("CORE_COMMON_PROFILE_EMAIL"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,{t:q,type:"email",isMandatory:!1,placeholder:q("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:te,onChange:e=>ze(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()||Be}),(null==De?void 0:De.emailAddress)&&(0,d.jsx)(i.ErrorMessage,{message:q(null==De||null===(E=De.emailAddress)||void 0===E?void 0:E.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsx)(i.LabelFieldPair,{children:(0,d.jsxs)("div",{style:{width:"100%"},children:[0!=ge||Digit.Utils.getOTPBasedLogin()?null:(0,d.jsx)(i.Button,{label:q("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>fe(!ge),style:{paddingLeft:"0rem"}}),ge?(0,d.jsxs)("div",{style:{marginTop:"10px"},children:[(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(q("CORE_COMMON_PROFILE_CURRENT_PASSWORD"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,{t:q,type:"password",isMandatory:!1,name:"name",pattern:(null==Me||null===(I=Me.UserProfileValidationConfig)||void 0===I||null===(I=I[0])||void 0===I?void 0:I.password)||(null==P||null===(A=P.UserProfileValidationConfig)||void 0===A||null===(A=A[0])||void 0===A?void 0:A.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,void(null!=Le&&Le.password.test(n)?Ie(w(w({},De),{},{currentPassword:null})):Ie(w(w({},De),{},{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:Be}),(null==De?void 0:De.currentPassword)&&(0,d.jsx)(i.ErrorMessage,{message:q(null==De||null===(T=De.currentPassword)||void 0===T?void 0:T.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(q("CORE_COMMON_PROFILE_NEW_PASSWORD"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,{t:q,type:"password",isMandatory:!1,name:"name",pattern:(null==Me||null===(L=Me.UserProfileValidationConfig)||void 0===L||null===(L=L[0])||void 0===L?void 0:L.password)||(null==P||null===(R=P.UserProfileValidationConfig)||void 0===R||null===(R=R[0])||void 0===R?void 0:R.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Oe(n),void(null!=Le&&Le.password.test(n)?Ie(w(w({},De),{},{newPassword:null})):Ie(w(w({},De),{},{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:Be}),(null==De?void 0:De.newPassword)&&(0,d.jsx)(i.ErrorMessage,{message:q(null==De||null===(M=De.newPassword)||void 0===M?void 0:M.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,d.jsxs)(i.LabelFieldPair,{style:{display:"flex"},children:[(0,d.jsx)(i.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(q("CORE_COMMON_PROFILE_CONFIRM_PASSWORD"))}),(0,d.jsxs)("div",{style:{width:"100%"},children:[(0,d.jsx)(i.TextInput,{t:q,type:"password",isMandatory:!1,name:"name",pattern:(null==Me||null===(U=Me.UserProfileValidationConfig)||void 0===U||null===(U=U[0])||void 0===U?void 0:U.password)||(null==P||null===(k=P.UserProfileValidationConfig)||void 0===k||null===(k=k[0])||void 0===k?void 0:k.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Se(n),void(null!=Le&&Le.password.test(n)?Ie(w(w({},De),{},{confirmPassword:null})):Ie(w(w({},De),{},{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:Be}),(null==De?void 0:De.confirmPassword)&&(0,d.jsx)(i.ErrorMessage,{message:q(null==De||null===(B=De.confirmPassword)||void 0===B?void 0:B.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]})]}):""]})}),"employee"===V&&Pe?(0,d.jsx)("button",{onClick:He,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Pe?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"},children:q("CORE_COMMON_SAVE")}):null]})})]}),"employee"!==V||Pe?null:(0,d.jsx)(i.Footer,{actionFields:[(0,d.jsx)(i.SubmitBar,{t:q,label:q("CORE_COMMON_SAVE"),onSubmit:He})],className:"",setactionFieldsToRight:!0}),_e&&(0,d.jsx)(i.Toast,{type:_e.key,label:q("success"===_e.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":_e.action),onClose:()=>je(null),style:{maxWidth:"670px"}}),1==me?(0,d.jsx)(c,{setProfilePic:Qe,closeDrawer:Ve,userType:V,removeProfilePic:()=>{ue(null),ve(null)},showToast:We}):""]})}},6614(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});var i=n(5053),o=(n(4883),n(5953)),r=n(4442),l=n(6177),a=n(6870);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c=()=>{var e,t,n,s,u,c,v,m,p,g,f,h,y,b,O,x,{t:S}=(0,o.useTranslation)(),_=(0,r.useNavigate)(),j=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCitizenCurrentTenant(!0),{data:{stateInfo:C,uiHomePage:w}={},isLoading:N}=Digit.Hooks.useStore.getInitData(),E=window.Digit.Utils.browser.isMobile(),D=()=>{var e,t;return"EMPLOYEE"!==(null===(e=Digit.UserService)||void 0===e||null===(e=e.getUser())||void 0===e||null===(e=e.info)||void 0===e?void 0:e.type)&&!(null===(t=Digit.UserService)||void 0===t||null===(t=t.getUser())||void 0===t||!t.access_token)},{data:I,isLoading:P}=Digit.Hooks.useEvents({tenantId:j,variant:"whats-new",config:{enabled:D()}});j||_("/".concat(null===(x=window)||void 0===x?void 0:x.contextPath,"/citizen/select-language"));var A,T,L=null==w?void 0:w.appBannerDesktop,R=null==w?void 0:w.appBannerMobile,M=null==w?void 0:w.citizenServicesCard,U=null==w?void 0:w.informationAndUpdatesCard,k=null==w?void 0:w.whatsAppBannerDesktop,B=null==w?void 0:w.whatsAppBannerMobile,F=null==w?void 0:w.whatsNewSection,V=null==w?void 0:w.redirectURL;V&&_("/".concat(null===(A=window)||void 0===A?void 0:A.contextPath,"/citizen/").concat(V)),(null!==(e=window)&&void 0!==e&&null!==(e=e.location)&&void 0!==e&&null!==(e=e.href)&&void 0!==e&&null!==(t=e.includes)&&void 0!==t&&t.call(e,"sanitation-ui")||null!==(n=window)&&void 0!==n&&null!==(n=n.location)&&void 0!==n&&null!==(n=n.href)&&void 0!==n&&null!==(s=n.includes)&&void 0!==s&&s.call(n,"sandbox-ui"))&&_("/".concat(null===(T=window)||void 0===T?void 0:T.contextPath,"/citizen/all-services"));var G=e=>{window.open(null==e?void 0:e.navigationUrl)},z={header:S(null==M?void 0:M.headerLabel),sideOption:{name:S(null==M||null===(u=M.sideOption)||void 0===u?void 0:u.name),onClick:()=>{var e;return _(null==M||null===(e=M.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:S(null==M||null===(c=M.props)||void 0===c||null===(c=c[0])||void 0===c?void 0:c.label),Icon:(0,a.jsx)(i.ComplaintIcon,{}),onClick:()=>{var e;return _(null==M||null===(e=M.props)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==M||null===(v=M.props)||void 0===v||null===(v=v[1])||void 0===v?void 0:v.label),Icon:(0,a.jsx)(i.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e;return _(null==M||null===(e=M.props)||void 0===e||null===(e=e[1])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==M||null===(m=M.props)||void 0===m||null===(m=m[2])||void 0===m?void 0:m.label),Icon:(0,a.jsx)(i.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e;return _(null==M||null===(e=M.props)||void 0===e||null===(e=e[2])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==M||null===(p=M.props)||void 0===p||null===(p=p[3])||void 0===p?void 0:p.label),Icon:(0,a.jsx)(i.OBPSIcon,{}),onClick:()=>{var e;return _(null==M||null===(e=M.props)||void 0===e||null===(e=e[3])||void 0===e?void 0:e.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}},W={header:S(null==U?void 0:U.headerLabel),sideOption:{name:S(null==U||null===(g=U.sideOption)||void 0===g?void 0:g.name),onClick:()=>{var e;return _(null==U||null===(e=U.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:S(null==U||null===(f=U.props)||void 0===f||null===(f=f[0])||void 0===f?void 0:f.label),Icon:(0,a.jsx)(i.HomeIcon,{}),onClick:()=>{var e;return _(null==U||null===(e=U.props)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==U||null===(h=U.props)||void 0===h||null===(h=h[1])||void 0===h?void 0:h.label),Icon:(0,a.jsx)(i.Calender,{}),onClick:()=>{var e;return _(null==U||null===(e=U.props)||void 0===e||null===(e=e[1])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==U||null===(y=U.props)||void 0===y||null===(y=y[2])||void 0===y?void 0:y.label),Icon:(0,a.jsx)(i.DocumentIcon,{}),onClick:()=>{var e;return _(null==U||null===(e=U.props)||void 0===e||null===(e=e[2])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==U||null===(b=U.props)||void 0===b||null===(b=b[3])||void 0===b?void 0:b.label),Icon:(0,a.jsx)(i.DocumentIcon,{}),onClick:()=>{var e;return _(null==U||null===(e=U.props)||void 0===e||null===(e=e[3])||void 0===e?void 0:e.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}};return N?(0,a.jsx)(i.Loader,{}):(0,a.jsx)("div",{className:"HomePageContainer",children:(0,a.jsxs)("div",{className:"HomePageWrapper",children:[(0,a.jsxs)("div",{className:"BannerWithSearch",children:[E?(0,a.jsx)(l.A,{src:null==R?void 0:R.bannerUrl,alt:"Banner Image"}):(0,a.jsx)(l.A,{src:null==L?void 0:L.bannerUrl,alt:"Banner Image"}),(0,a.jsxs)("div",{className:"ServicesSection",children:[(0,a.jsx)(i.CardBasedOptions,d({style:{marginTop:"-30px"}},z)),(0,a.jsx)(i.CardBasedOptions,d({style:E?{}:{marginTop:"-30px"}},W))]})]}),(B||k)&&(0,a.jsx)("div",{className:"WhatsAppBanner",children:E?(0,a.jsx)(l.A,{src:null==B?void 0:B.bannerUrl,onClick:()=>G(B),alt:"Whatsapp Banner"}):(0,a.jsx)(l.A,{src:null==k?void 0:k.bannerUrl,onClick:()=>G(k),alt:"Whatsapp Banner"})}),D()?P?(0,a.jsx)(i.Loader,{}):(0,a.jsxs)("div",{className:"WhatsNewSection",children:[(0,a.jsxs)("div",{className:"headSection",children:[(0,a.jsx)("h2",{children:S(null==F?void 0:F.headerLabel)}),(0,a.jsx)("p",{onClick:()=>{var e;return _(null==F||null===(e=F.sideOption)||void 0===e?void 0:e.navigationUrl)},children:S(null==F||null===(O=F.sideOption)||void 0===O?void 0:O.name)})]}),(0,a.jsx)(i.WhatsNewCard,d({},null==I?void 0:I[0]))]}):null]})})}},2339(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>s});var i=n(6243),o=n(5053),r=n(4883),l=n(5953),a=n(6870);const s=e=>{var t,n,{module:s}=e,d=Digit.UserService.getUser(),{t:u}=((null==d||null===(t=d.info)||void 0===t?void 0:t.tenantId)||Digit.ULBService.getCurrentTenantId(),(0,l.useTranslation)()),c=Digit.SessionStorage.get("initData").stateInfo,v=Digit.StoreData.getCurrentLanguage(),[m,p]=(0,r.useState)(v),[g,f]=(0,r.useState)(!1),[h,y]=(0,r.useState)(""),b=()=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M12 24C5.38053 24 0 18.6143 0 12C0 5.38054 5.38053 1.90735e-06 12 1.90735e-06C18.6143 1.90735e-06 24 5.38054 24 12C24 18.6143 18.6143 24 12 24ZM16.3488 10.7852L11.3855 7.25251C11.1263 7.0701 10.8238 6.97889 10.5214 6.97889C10.291 6.97889 10.0557 7.03172 9.83976 7.14202C9.34054 7.40118 9.02857 7.91006 9.02857 8.46694L9.02877 15.5323C9.02877 16.0892 9.34076 16.5979 9.83996 16.8572C10.3344 17.1116 10.9296 17.0732 11.3857 16.7467L16.349 13.214C16.7426 12.9356 16.9778 12.4795 16.9778 11.9996C16.9776 11.5197 16.7426 11.0636 16.3489 10.7852L16.3488 10.7852Z",fill:"white"})}),{isLoading:O,data:x}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),S=null==x||null===(n=x.MdmsRes["common-masters"])||void 0===n||null===(n=n.howItWorks[0])||void 0===n?void 0:n["".concat(s)];return O?(0,a.jsx)(i.Loader,{}):(0,a.jsx)(r.Fragment,{children:(0,a.jsxs)("div",{className:"how-it-works-page",children:[(0,a.jsx)(i.BackButton,{}),(0,a.jsx)("div",{className:"how-it-works-page-header",children:(0,a.jsx)(i.HeaderComponent,{children:u(S.screenHeader?S.screenHeader:"HOW_IT_WORKS")})}),(0,a.jsx)("div",{className:"language-selector",style:{margin:"10px"},children:[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>(0,a.jsx)("div",{className:"language-button-container",children:(0,a.jsx)(o.CustomButton,{selected:e.value===m,text:e.label,onClick:()=>(e=>{p(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)})(e)})},t))}),S.videosJson.map((e,t)=>(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10},children:[(0,a.jsx)("div",{className:"video-icon",onClick:()=>{return t=e,y("hi_IN"===m?t.hi_IN:t.en_IN),void f(!0);var t},children:(0,a.jsx)("div",{className:"vid-svg",children:(0,a.jsx)(b,{})})}),(0,a.jsxs)("div",{className:"how-it-works-header-description",children:[(0,a.jsx)("h2",{children:u(e.headerLabel)}),(0,a.jsx)("p",{children:u(e.description)})]})]})})),S.pdfHeader&&S.pdfDesc&&(0,a.jsx)("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"},children:(0,a.jsxs)("div",{className:"how-it-works-pdf-section",children:[(0,a.jsxs)("div",{className:"pdf-icon-header-desc",children:[(0,a.jsx)("div",{className:"pdf-icon",children:(0,a.jsx)(i.PDFSvg,{})}),(0,a.jsxs)("div",{className:"pdf-header-desc",children:[(0,a.jsx)("h2",{children:u(S.pdfHeader)}),(0,a.jsx)("p",{children:u(S.pdfDesc)})]})]}),(0,a.jsx)("div",{className:"download-icon",children:(0,a.jsx)(i.DownloadImgIcon,{})})]})}),g&&(0,a.jsxs)("div",{className:"how-it-works-video-play",children:[(0,a.jsx)("div",{className:"close-button",children:(0,a.jsx)(i.CloseSvg,{onClick:()=>{f(!1)}})}),(0,a.jsx)("video",{width:500,height:500,controls:!0,autoPlay:!0,children:(0,a.jsx)("source",{src:h,type:"video/mp4"})})]})]})})}},743(e,t,n){"use strict";n.d(t,{A:()=>s});var i=n(6243),o=n(4883),r=n(4989),l=n(5053),a=n(6870);const s=e=>{var{config:t,otp:n,onOtpChange:s,onResend:d,onSelect:u,t:c,error:v,userType:m="citizen",canSubmit:p}=e,[g,f]=(0,o.useState)(30);(0,r.A)(()=>{f(g-1)},g>0?1e3:null);var h=()=>{d(),f(2)};return"employee"===m?(0,a.jsxs)(o.Fragment,{children:[(0,a.jsx)(l.OTPInput,{length:6,onChange:s,value:n}),g>0?(0,a.jsx)(i.CardText,{children:"".concat(c("CS_RESEND_ANOTHER_OTP")," ").concat(g," ").concat(c("CS_RESEND_SECONDS"))}):(0,a.jsx)("p",{className:"card-text-button resend-otp",onClick:h,children:c("CS_RESEND_OTP")}),!v&&(0,a.jsx)(i.CardLabelError,{children:c("CS_INVALID_OTP")})]}):(0,a.jsxs)(i.FormStep,{onSelect:u,config:t,t:c,isDisabled:!(6===(null==n?void 0:n.length)&&p),children:[(0,a.jsx)(l.OTPInput,{length:6,onChange:s,value:n}),g>0?(0,a.jsx)(i.CardText,{children:"".concat(c("CS_RESEND_ANOTHER_OTP")," ").concat(g," ").concat(c("CS_RESEND_SECONDS"))}):(0,a.jsx)("p",{className:"card-text-button",onClick:h,children:c("CS_RESEND_OTP")}),!v&&(0,a.jsx)(i.CardLabelError,{children:c("CS_INVALID_OTP")})]})}},1022(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>F});var i=n(6243),o=n(4883),r=n(5953),l=n(4442),a=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minlength:10,maxlength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minlength:1,maxlength:50,pattern:"^[A-Za-z]+( [A-Za-z]+)*$"}}]}],s=n(6870);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const v=e=>{var t,{t:n,onSelect:r,mobileNumber:l,emailId:a,onMobileChange:d,onEmailChange:c,config:v,canSubmit:m}=e,[p,g]=(0,o.useState)(!!a),[f,h]=(0,o.useState)(""),y=(null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("CORE_MOBILE_CONFIGS"))||{},b=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,O=(null==y?void 0:y.mobileNumberPattern)||"^\\d+$",x=new RegExp(O),S=(0,o.useMemo)(()=>b.test(a),[a]),_=(0,o.useMemo)(()=>x.test(l||""),[l,x]),j=(0,o.useMemo)(()=>p?!(S&&m):!(_&&m),[p,S,_,m]),C=(0,o.useMemo)(()=>window.innerWidth<=768?n(p?"LOGIN_WITH_MOBILE":"LOGIN_WITH_EMAIL"):n(p?"CS_USE_MOBILE_INSTEAD":"CS_LOGIN_REGISTER_WITH_EMAIL"),[p,n]);return(0,s.jsxs)(i.InputCard,{t:n,texts:null==v?void 0:v.texts,submit:!0,onNext:()=>{if(p){if(!S)return void h(n("ERR_INVALID_EMAIL"));r({userName:a})}else{if(!_)return void h(n("ERR_INVALID_MOBILE_NUMBER"));r({mobileNumber:l})}},isDisable:j,children:[(0,s.jsx)("div",{children:(0,s.jsx)(i.FieldV1,{withoutLabel:!0,charCount:!0,error:f,onChange:e=>{var t=e.target.value;h(""),p?(c(e),t&&!b.test(t)&&h(n("ERR_INVALID_EMAIL"))):(d(e),t&&!x.test(t)&&h(n("ERR_INVALID_MOBILE_NUMBER")))},placeholder:n(p?"ENTER_EMAIL_PLACEHOLDER":"ENTER_MOBILE_PLACEHOLDER"),populators:{name:p?"userName":"mobileNumber",prefix:p?"":null==y?void 0:y.mobilePrefix,validation:{maxlength:p?256:(null==y?void 0:y.mobileNumberLength)||10,pattern:p?b:x}},props:{fieldStyle:{width:"100%"}},type:"text",value:p?a:l},p?"email":"mobile")}),(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"1.5rem",marginTop:"-24px"},children:(0,s.jsx)(i.LinkLabel,{style:u({display:"inline"},{marginLeft:"0px",userSelect:"none",color:"inherit",cursor:"pointer",textDecoration:"underline"}),onClick:()=>{g(!p),h(""),p?c({target:{value:""}}):d({target:{value:""}})},children:C})})]})},m=e=>{var{config:t,onSelect:n,t:o,isDisabled:r}=e;return(0,s.jsx)(i.FormStep,{config:t,onSelect:n,t:o,isDisabled:r})};var p,g,f=n(743),h=["ResponseInfo","UserRequest"];function y(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){y(r,i,o,l,a,"next",e)}function a(e){y(r,i,o,l,a,"throw",e)}l(void 0)})}}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach(function(t){S(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _={type:"login"},j="/".concat((null===(p=window)||void 0===p?void 0:p.contextPath)||(null===(g=window)||void 0===g||null===(g=g.globalConfigs)||void 0===g?void 0:g.getConfig("CONTEXT_PATH")),"/citizen"),C=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||j;const w=e=>{var t,n,{stateCode:d,isUserRegistered:u=!1}=e,{t:c}=(0,r.useTranslation)(),p=(0,l.useLocation)(),g=(0,l.useNavigate)(),[y,O]=(0,o.useState)(null),[S,w]=(0,o.useState)(null),[N,E]=(0,o.useState)(!0),[D,I]=(0,o.useState)(u?{}:null==p||null===(t=p.state)||void 0===t?void 0:t.data),[P,A]=(0,o.useState)(null),T=Digit.Hooks.useQueryParams(),[L,R]=(0,o.useState)(!1),[M,U]=(0,o.useState)(!0),[k,B]=(0,o.useState)(!0),F=null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");(0,o.useEffect)(()=>{var e;return S&&(P&&(clearTimeout(P),A(null)),e=setTimeout(()=>{w("")},5e3),A(e)),()=>{e&&clearTimeout(e)}},[S]),(0,o.useEffect)(()=>{var e;if(y){Digit.SessionStorage.set("citizen.userRequestObject",y),Digit.UserService.setUser(y),((e,t,n)=>{var i;if(!Digit.Utils.getMultiRootTenant()){var o=null===(i=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===i||null===(i=i.value)||void 0===i?void 0:i.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Citizen.locale",o),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))}})(null==y?void 0:y.info,null==y?void 0:y.access_token,d);var t,n=(null===(e=p.state)||void 0===e?void 0:e.from)||j;Digit.ULBService.getCitizenCurrentTenant(!0)?g(n,{replace:!0}):g("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/citizen/select-location"),{state:{redirectBackTo:n},replace:!0})}},[y]);var V=(0,o.useMemo)(()=>a.map(e=>{var t={};for(var n in e.texts)t[n]=c(e.texts[n]);return x(x({},e),{},{texts:t})}),[a]),G=function(){var e=b(function*(e){B(!1),I(x(x({},D),e));var t=x(x({},e),{},{tenantId:d,userType:"citizen"}),[n,i]=yield q({otp:x(x({},t),_)});if(!i)return B(!0),void g("otp",{state:{from:C(p.state,T)},replace:!0});B(!0),g("name",{state:{from:C(p.state,T),data:t},replace:!0})});return function(t){return e.apply(this,arguments)}}(),z=function(){var e=b(function*(e){R(!0);var t=x(x({},D),e);I(t);var n="".concat(F,"/v1/_register"),i={IndividualRegister:{tenantId:d,name:t.name,emailId:t.userName||"",mobileNumber:t.mobileNumber||"",requestType:"Register"}};try{if(!(yield Digit.CustomService.getResponse({url:n,body:i,useCache:!1,method:"POST",userService:!1,auth:!1,params:{}})))throw new Error("Registration API failed");R(!1),g("otp",{state:{from:C(p.state,T)},replace:!0})}catch(e){console.error("Registration error:",e),R(!1),w(c("REGISTRATION_FAILED")||"Registration failed. Please try again.")}});return function(t){return e.apply(this,arguments)}}(),W=function(){var e=b(function*(){try{var e;E(!0),U(!1);var{mobileNumber:t,otp:n,userName:i}=D,o={username:t||i,password:n,tenantId:d,userType:"citizen"},r=yield Digit.UserService.authenticate(o),{ResponseInfo:l,UserRequest:a}=r,s=function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,h);null!==(e=window)&&void 0!==e&&null!==(e=e.globalConfigs)&&void 0!==e&&e.getConfig("ENABLE_SINGLEINSTANCE")&&(a.tenantId=Digit.ULBService.getStateId()),O(x({info:a},s))}catch(e){U(!0),E(!1),w(c("INVALID_OTP")||"Invalid OTP")}});return function(){return e.apply(this,arguments)}}(),H=function(){var e=b(function*(){if(u){var{mobileNumber:e,userName:t}=D,n={mobileNumber:e,userName:t,tenantId:d,userType:"citizen"},[i,o]=yield q({otp:x(x({},n),_)});o&&w(c("OTP_RESEND_ERROR")||"Failed to resend OTP")}else w(c("PLEASE_COMPLETE_REGISTRATION")||"Please enter the OTP sent during registration.")});return function(){return e.apply(this,arguments)}}(),q=function(){var e=b(function*(e){try{return[yield Digit.UserService.sendOtp(e,d),null]}catch(e){return[null,e]}});return function(t){return e.apply(this,arguments)}}();return(0,s.jsx)("div",{className:"citizen-form-wrapper citizen-form-center",children:(0,s.jsxs)(i.AppContainer,{children:[p.pathname.includes("login")?null:(0,s.jsx)(i.BackLink,{onClick:()=>window.history.back()}),(0,s.jsxs)(l.Routes,{children:[(0,s.jsx)(l.Route,{path:"/",element:(0,s.jsx)(v,{onSelect:G,config:V[0],mobileNumber:D.mobileNumber||"",emailId:D.userName||"",onMobileChange:e=>{var{value:t}=e.target;I(x(x({},D),{},{mobileNumber:t}))},onEmailChange:e=>{var{value:t}=e.target;I(x(x({},D),{},{userName:t}))},canSubmit:k,showRegisterLink:u,t:c})}),(0,s.jsx)(l.Route,{path:"otp",element:(0,s.jsx)(f.A,{config:x(x({},V[1]),{},{texts:x(x({},V[1].texts),{},{cardText:"".concat(V[1].texts.cardText," ").concat(D.mobileNumber||D.userName||"")})}),onOtpChange:e=>{I(x(x({},D),{},{otp:e}))},onResend:H,onSelect:W,otp:D.otp,error:N,canSubmit:M,t:c})}),(0,s.jsx)(l.Route,{path:"name",element:(0,s.jsx)(m,{config:V[2],onSelect:z,t:c,isDisabled:L})})]}),S&&(0,s.jsx)(i.Toast,{type:"error",label:S,onClose:()=>w(null)})]})})};var N,E=["ResponseInfo","UserRequest"],D=["ResponseInfo","UserRequest"];function I(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}function A(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){P(r,i,o,l,a,"next",e)}function a(e){P(r,i,o,l,a,"throw",e)}l(void 0)})}}function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach(function(t){R(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M={type:"register"},U={type:"login"},k="/".concat(null===(N=window)||void 0===N?void 0:N.contextPath,"/citizen"),B=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||k;const F=e=>{var t,n,d,u,{stateCode:c,isUserRegistered:p=!0}=e,g=null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("USE_INDIVIDUAL_MODEL"),h=null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");if(g&&h)return(0,s.jsx)(w,{stateCode:c,isUserRegistered:p});var{t:y}=(0,r.useTranslation)(),b=(0,l.useLocation)(),O=(0,l.useNavigate)(),[x,S]=(0,o.useState)(null),[_,j]=(0,o.useState)(null),[C,N]=(0,o.useState)(!0),[P,T]=(0,o.useState)(p?{}:null==b||null===(d=b.state)||void 0===d?void 0:d.data),[R,F]=(0,o.useState)(null),V=Digit.Hooks.useQueryParams(),[G,z]=(0,o.useState)(!1),[W,H]=(0,o.useState)(!0),[q,X]=(0,o.useState)(!0);(0,o.useEffect)(()=>{var e;return _&&(R&&(clearTimeout(R),F(null)),e=setTimeout(()=>{j("")},5e3),F(e)),()=>{e&&clearTimeout(e)}},[_]),(0,o.useEffect)(()=>{var e;if(x){Digit.SessionStorage.set("citizen.userRequestObject",x),Digit.UserService.setUser(x),((e,t,n)=>{var i;if(!Digit.Utils.getMultiRootTenant()){var o=null===(i=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===i||null===(i=i.value)||void 0===i?void 0:i.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Citizen.locale",o),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))}})(null==x?void 0:x.info,null==x?void 0:x.access_token,c);var t,n=(null===(e=b.state)||void 0===e?void 0:e.from)||k;Digit.ULBService.getCitizenCurrentTenant(!0)?O(n,{replace:!0}):O("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/citizen/select-location"),{state:{redirectBackTo:n},replace:!0})}},[x]);var Q=(0,o.useMemo)(()=>a.map(e=>{var t={};for(var n in e.texts)t[n]=y(e.texts[n]);return L(L({},e),{},{texts:t})}),[a]),Z=function(){var e=A(function*(e){X(!1),T(L(L({},P),e));var t=L(L({},e),{},{tenantId:c,userType:"citizen"});if(p){var n,i,o,r,[l,a]=yield $({otp:L(L({},t),U)});if(!a)return X(!0),void O("otp",{state:{from:B(b.state,V),role:null===(i=b.state)||void 0===i?void 0:i.role},replace:!0});X(!0),b.state&&"FSM_DSO"===b.state.role||O("/".concat(null===(o=window)||void 0===o?void 0:o.contextPath,"/citizen/register/name"),{state:{from:B(b.state,V),data:t}}),null!==(n=b.state)&&void 0!==n&&n.role&&(X(!0),j("FSM_DSO"===(null===(r=b.state)||void 0===r?void 0:r.role)?y("ES_ERROR_DSO_LOGIN"):"User not registered."))}else{var[s,d]=yield $({otp:L(L({},t),M)});if(!d)return X(!0),void O("otp",{state:{from:B(b.state,V)},replace:!0});X(!0)}});return function(t){return e.apply(this,arguments)}}(),Y=function(){var e=A(function*(e){var t=L(L({},P),{},{tenantId:c,userType:"citizen"},e);T(L(L({},P),e)),z(!0);var[n,i]=yield $({otp:L(L({},t),M)});n?(z(!1),O("otp",{state:{from:B(b.state,V)},replace:!0})):z(!1)});return function(t){return e.apply(this,arguments)}}(),K=function(){var e=A(function*(){try{N(!0),H(!1);var{mobileNumber:e,otp:t,name:n}=P;if(p){var i,o,r={username:e,password:t,tenantId:c,userType:"citizen"},l=yield Digit.UserService.authenticate(r),{ResponseInfo:a,UserRequest:s}=l,d=I(l,E);if(null!==(i=b.state)&&void 0!==i&&i.role){var u=s.roles.find(e=>e.code===b.state.role);if(!u||!u.code)return j(y("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>O(k,{replace:!0}),5e3)}null!==(o=window)&&void 0!==o&&null!==(o=o.globalConfigs)&&void 0!==o&&o.getConfig("ENABLE_SINGLEINSTANCE")&&(s.tenantId=Digit.ULBService.getStateId()),S(L({info:s},d))}else if(!p){var v,m={name:n,username:e,otpReference:t,tenantId:c},g=yield Digit.UserService.registerUser(m,c),{ResponseInfo:f,UserRequest:h}=g;d=I(g,D),null!==(v=window)&&void 0!==v&&null!==(v=v.globalConfigs)&&void 0!==v&&v.getConfig("ENABLE_SINGLEINSTANCE")&&(h.tenantId=Digit.ULBService.getStateId()),S(L({info:h},d))}}catch(e){H(!0),N(!1)}});return function(){return e.apply(this,arguments)}}(),J=function(){var e=A(function*(){var{mobileNumber:e}=P,t={mobileNumber:e,tenantId:c,userType:"citizen"};if(p){if(p)var[n,i]=yield $({otp:L(L({},t),U)})}else var[o,r]=yield $({otp:L(L({},t),M)})});return function(){return e.apply(this,arguments)}}(),$=function(){var e=A(function*(e){try{return[yield Digit.UserService.sendOtp(e,c),null]}catch(e){return[null,e]}});return function(t){return e.apply(this,arguments)}}(),ee=window.location.href.includes("citizen")&&!window.Digit.Utils.browser.isMobile();return(0,s.jsx)("div",{className:"citizen-form-wrapper".concat(ee?" citizen-form-center":""),children:(0,s.jsxs)(i.AppContainer,{children:[b.pathname.includes("login")?null:(0,s.jsx)(i.BackLink,{onClick:()=>O(-1)}),(0,s.jsxs)(l.Routes,{children:[" ",(0,s.jsx)(l.Route,{path:"/",element:(0,s.jsx)(v,{onSelect:Z,config:Q[0],mobileNumber:P.mobileNumber||"",onMobileChange:e=>{var{value:t}=e.target;T(L(L({},P),{},{mobileNumber:t}))},canSubmit:q,showRegisterLink:p&&!(null!==(u=b.state)&&void 0!==u&&u.role),t:y})}),(0,s.jsx)(l.Route,{path:"otp",element:(0,s.jsx)(f.A,{config:L(L({},Q[1]),{},{texts:L(L({},Q[1].texts),{},{cardText:"".concat(Q[1].texts.cardText," ").concat(P.mobileNumber||"")})}),onOtpChange:e=>{T(L(L({},P),{},{otp:e}))},onResend:J,onSelect:K,otp:P.otp,error:C,canSubmit:W,t:y})}),(0,s.jsx)(l.Route,{path:"name",element:(0,s.jsx)(m,{config:Q[2],onSelect:Y,t:y,isDisabled:G})}),_&&(0,s.jsx)(i.Toast,{type:"error",label:_,onClose:()=>j(null)})]})]})})}},1737(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>Ue});var i=n(4883),o=n.n(i),r=n(5953),l=n(5053),a=n(6243),s=e=>"checkbox"===e.type,d=e=>e instanceof Date,u=e=>null==e;const c=e=>"object"==typeof e;var v=e=>!u(e)&&!Array.isArray(e)&&c(e)&&!d(e),m=e=>v(e)&&e.target?s(e.target)?e.target.checked:e.target.value:e,p=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),g="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function f(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(g&&(e instanceof Blob||e instanceof FileList)||!n&&!v(e))return e;if(t=n?[]:{},n||(e=>{const t=e.constructor&&e.constructor.prototype;return v(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=f(e[n]));else t=e}return t}var h=e=>Array.isArray(e)?e.filter(Boolean):[],y=e=>void 0===e,b=(e,t,n)=>{if(!t||!v(e))return n;const i=h(t.split(/[,[\].]+?/)).reduce((e,t)=>u(e)?e:e[t],e);return y(i)||i===e?y(e[t])?n:e[t]:i},O=e=>"boolean"==typeof e,x=e=>/^\w*$/.test(e),S=e=>h(e.replace(/["|']|\]/g,"").split(/\.|\[/)),_=(e,t,n)=>{let i=-1;const o=x(t)?[t]:S(t),r=o.length,l=r-1;for(;++i<r;){const t=o[i];let r=n;if(i!==l){const n=e[t];r=v(n)||Array.isArray(n)?n:isNaN(+o[i+1])?{}:[]}if("__proto__"===t)return;e[t]=r,e=e[t]}return e};const j="blur",C="onChange",w="onSubmit",N="all",E="pattern",D="required",I=i.createContext(null),P=()=>i.useContext(I);var A=(e,t,n,i=!0)=>{const o={defaultValues:t._defaultValues};for(const r in e)Object.defineProperty(o,r,{get:()=>{const o=r;return t._proxyFormState[o]!==N&&(t._proxyFormState[o]=!i||N),n&&(n[o]=!0),e[o]}});return o},T=e=>v(e)&&!Object.keys(e).length,L=(e,t,n,i)=>{n(e);const{name:o,...r}=e;return T(r)||Object.keys(r).length>=Object.keys(t).length||Object.keys(r).find(e=>t[e]===(!i||N))},R=e=>Array.isArray(e)?e:[e],M=(e,t,n)=>!e||!t||e===t||R(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e)));function U(e){const t=i.useRef(e);t.current=e,i.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var k=e=>"string"==typeof e,B=(e,t,n,i,o)=>k(e)?(i&&t.watch.add(e),b(n,e,o)):Array.isArray(e)?e.map(e=>(i&&t.watch.add(e),b(n,e))):(i&&(t.watchAll=!0),n);const F=e=>e.render(function(e){const t=P(),{name:n,disabled:o,control:r=t.control,shouldUnregister:l}=e,a=p(r._names.array,n),s=function(e){const t=P(),{control:n=t.control,name:o,defaultValue:r,disabled:l,exact:a}=e||{},s=i.useRef(o);s.current=o,U({disabled:l,subject:n._subjects.values,next:e=>{M(s.current,e.name,a)&&u(f(B(s.current,n._names,e.values||n._formValues,!1,r)))}});const[d,u]=i.useState(n._getWatch(o,r));return i.useEffect(()=>n._removeUnmounted()),d}({control:r,name:n,defaultValue:b(r._formValues,n,b(r._defaultValues,n,e.defaultValue)),exact:!0}),d=function(e){const t=P(),{control:n=t.control,disabled:o,name:r,exact:l}=e||{},[a,s]=i.useState(n._formState),d=i.useRef(!0),u=i.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=i.useRef(r);return c.current=r,U({disabled:o,next:e=>d.current&&M(c.current,e.name,l)&&L(e,u.current,n._updateFormState)&&s({...n._formState,...e}),subject:n._subjects.state}),i.useEffect(()=>(d.current=!0,u.current.isValid&&n._updateValid(!0),()=>{d.current=!1}),[n]),A(a,n,u.current,!1)}({control:r,name:n,exact:!0}),u=i.useRef(r.register(n,{...e.rules,value:s,...O(e.disabled)?{disabled:e.disabled}:{}}));return i.useEffect(()=>{const e=r._options.shouldUnregister||l,t=(e,t)=>{const n=b(r._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){const e=f(b(r._options.defaultValues,n));_(r._defaultValues,n,e),y(b(r._formValues,n))&&_(r._formValues,n,e)}return()=>{(a?e&&!r._state.action:e)?r.unregister(n):t(n,!1)}},[n,r,a,l]),i.useEffect(()=>{b(r._fields,n)&&r._updateDisabledField({disabled:o,fields:r._fields,name:n,value:b(r._fields,n)._f.value})},[o,n,r]),{field:{name:n,value:s,...O(o)||d.disabled?{disabled:d.disabled||o}:{},onChange:i.useCallback(e=>u.current.onChange({target:{value:m(e),name:n},type:"change"}),[n]),onBlur:i.useCallback(()=>u.current.onBlur({target:{value:b(r._formValues,n),name:n},type:j}),[n,r]),ref:i.useCallback(e=>{const t=b(r._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[r._fields,n])},formState:d,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!b(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!b(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!b(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!b(d.validatingFields,n)},error:{enumerable:!0,get:()=>b(d.errors,n)}})}}(e));var V=(e,t,n,i,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[i]:o||!0}}:{},G=e=>({isOnSubmit:!e||e===w,isOnBlur:"onBlur"===e,isOnChange:e===C,isOnAll:e===N,isOnTouch:"onTouched"===e}),z=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const W=(e,t,n,i)=>{for(const o of n||Object.keys(e)){const n=b(e,o);if(n){const{_f:e,...r}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!i)break;if(e.ref&&t(e.ref,e.name)&&!i)break;W(r,t)}else v(r)&&W(r,t)}}};var H=(e,t,n)=>{const i=R(b(e,n));return _(i,"root",t[n]),_(e,n,i),e},q=e=>"file"===e.type,X=e=>"function"==typeof e,Q=e=>{if(!g)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Z=e=>k(e),Y=e=>"radio"===e.type,K=e=>e instanceof RegExp;const J={value:!1,isValid:!1},$={value:!0,isValid:!0};var ee=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!y(e[0].attributes.value)?y(e[0].value)||""===e[0].value?$:{value:e[0].value,isValid:!0}:$:J}return J};const te={isValid:!1,value:null};var ne=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,te):te;function ie(e,t,n="validate"){if(Z(e)||Array.isArray(e)&&e.every(Z)||O(e)&&!e)return{type:n,message:Z(e)?e:"",ref:t}}var oe=e=>v(e)&&!K(e)?e:{value:e,message:""},re=async(e,t,n,i,o)=>{const{ref:r,refs:l,required:a,maxLength:d,minLength:c,min:m,max:p,pattern:g,validate:f,name:h,valueAsNumber:x,mount:S,disabled:_}=e._f,j=b(t,h);if(!S||_)return{};const C=l?l[0]:r,w=e=>{i&&C.reportValidity&&(C.setCustomValidity(O(e)?"":e||""),C.reportValidity())},N={},I=Y(r),P=s(r),A=I||P,L=(x||q(r))&&y(r.value)&&y(j)||Q(r)&&""===r.value||""===j||Array.isArray(j)&&!j.length,R=V.bind(null,h,n,N),M=(e,t,n,i="maxLength",o="minLength")=>{const l=e?t:n;N[h]={type:e?i:o,message:l,ref:r,...R(e?i:o,l)}};if(o?!Array.isArray(j)||!j.length:a&&(!A&&(L||u(j))||O(j)&&!j||P&&!ee(l).isValid||I&&!ne(l).isValid)){const{value:e,message:t}=Z(a)?{value:!!a,message:a}:oe(a);if(e&&(N[h]={type:D,message:t,ref:C,...R(D,t)},!n))return w(t),N}if(!(L||u(m)&&u(p))){let e,t;const i=oe(p),o=oe(m);if(u(j)||isNaN(j)){const n=r.valueAsDate||new Date(j),l=e=>new Date((new Date).toDateString()+" "+e),a="time"==r.type,s="week"==r.type;k(i.value)&&j&&(e=a?l(j)>l(i.value):s?j>i.value:n>new Date(i.value)),k(o.value)&&j&&(t=a?l(j)<l(o.value):s?j<o.value:n<new Date(o.value))}else{const n=r.valueAsNumber||(j?+j:j);u(i.value)||(e=n>i.value),u(o.value)||(t=n<o.value)}if((e||t)&&(M(!!e,i.message,o.message,"max","min"),!n))return w(N[h].message),N}if((d||c)&&!L&&(k(j)||o&&Array.isArray(j))){const e=oe(d),t=oe(c),i=!u(e.value)&&j.length>+e.value,o=!u(t.value)&&j.length<+t.value;if((i||o)&&(M(i,e.message,t.message),!n))return w(N[h].message),N}if(g&&!L&&k(j)){const{value:e,message:t}=oe(g);if(K(e)&&!j.match(e)&&(N[h]={type:E,message:t,ref:r,...R(E,t)},!n))return w(t),N}if(f)if(X(f)){const e=ie(await f(j,t),C);if(e&&(N[h]={...e,...R("validate",e.message)},!n))return w(e.message),N}else if(v(f)){let e={};for(const i in f){if(!T(e)&&!n)break;const o=ie(await f[i](j,t),C,i);o&&(e={...o,...R(i,o.message)},w(o.message),n&&(N[h]=e))}if(!T(e)&&(N[h]={ref:C,...e},!n))return N}return w(!0),N};function le(e,t){const n=Array.isArray(t)?t:x(t)?[t]:S(t),i=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let i=0;for(;i<n;)e=y(e)?i++:e[t[i++]];return e}(e,n),o=n.length-1,r=n[o];return i&&delete i[r],0!==o&&(v(i)&&T(i)||Array.isArray(i)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!y(e[t]))return!1;return!0}(i))&&le(e,n.slice(0,-1)),e}var ae=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},se=e=>u(e)||!c(e);function de(e,t){if(se(e)||se(t))return e===t;if(d(e)&&d(t))return e.getTime()===t.getTime();const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const o of n){const n=e[o];if(!i.includes(o))return!1;if("ref"!==o){const e=t[o];if(d(n)&&d(e)||v(n)&&v(e)||Array.isArray(n)&&Array.isArray(e)?!de(n,e):n!==e)return!1}}return!0}var ue=e=>"select-multiple"===e.type,ce=e=>Q(e)&&e.isConnected,ve=e=>{for(const t in e)if(X(e[t]))return!0;return!1};function me(e,t={}){const n=Array.isArray(e);if(v(e)||n)for(const n in e)Array.isArray(e[n])||v(e[n])&&!ve(e[n])?(t[n]=Array.isArray(e[n])?[]:{},me(e[n],t[n])):u(e[n])||(t[n]=!0);return t}function pe(e,t,n){const i=Array.isArray(e);if(v(e)||i)for(const i in e)Array.isArray(e[i])||v(e[i])&&!ve(e[i])?y(t)||se(n[i])?n[i]=Array.isArray(e[i])?me(e[i],[]):{...me(e[i])}:pe(e[i],u(t)?{}:t[i],n[i]):n[i]=!de(e[i],t[i]);return n}var ge=(e,t)=>pe(e,t,me(t)),fe=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:i})=>y(e)?e:t?""===e?NaN:e?+e:e:n&&k(e)?new Date(e):i?i(e):e;function he(e){const t=e.ref;if(!(e.refs?e.refs.every(e=>e.disabled):t.disabled))return q(t)?t.files:Y(t)?ne(e.refs).value:ue(t)?[...t.selectedOptions].map(({value:e})=>e):s(t)?ee(e.refs).value:fe(y(t.value)?e.ref.value:t.value,e)}var ye=e=>y(e)?e:K(e)?e.source:v(e)?K(e.value)?e.value.source:e.value:e;function be(e,t,n){const i=b(e,n);if(i||x(n))return{error:i,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),r=b(t,i),l=b(e,i);if(r&&!Array.isArray(r)&&n!==i)return{name:n};if(l&&l.type)return{name:i,error:l};o.pop()}return{name:n}}const Oe={mode:w,reValidateMode:C,shouldFocusError:!0};function xe(e={}){let t,n={...Oe,...e},i={submitCount:0,isDirty:!1,isLoading:X(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},o={},r=(v(n.defaultValues)||v(n.values))&&f(n.defaultValues||n.values)||{},l=n.shouldUnregister?{}:f(r),a={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},x=0;const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},C={values:ae(),array:ae(),state:ae()},w=G(n.mode),E=G(n.reValidateMode),D=n.criteriaMode===N,I=async e=>{if(S.isValid||e){const e=n.resolver?T((await M()).errors):await U(o,!0);e!==i.isValid&&C.state.next({isValid:e})}},P=(e,t)=>{(S.isValidating||S.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?_(i.validatingFields,e,t):le(i.validatingFields,e))}),C.state.next({validatingFields:i.validatingFields,isValidating:!T(i.validatingFields)}))},A=(e,t,n,i)=>{const s=b(o,e);if(s){const o=b(l,e,y(n)?b(r,e):n);y(o)||i&&i.defaultChecked||t?_(l,e,t?o:he(s._f)):Z(e,o),a.mount&&I()}},L=(e,t,n,l,a)=>{let s=!1,d=!1;const u={name:e},c=!!(b(o,e)&&b(o,e)._f&&b(o,e)._f.disabled);if(!n||l){S.isDirty&&(d=i.isDirty,i.isDirty=u.isDirty=F(),s=d!==u.isDirty);const n=c||de(b(r,e),t);d=!(c||!b(i.dirtyFields,e)),n||c?le(i.dirtyFields,e):_(i.dirtyFields,e,!0),u.dirtyFields=i.dirtyFields,s=s||S.dirtyFields&&d!==!n}if(n){const t=b(i.touchedFields,e);t||(_(i.touchedFields,e,n),u.touchedFields=i.touchedFields,s=s||S.touchedFields&&t!==n)}return s&&a&&C.state.next(u),s?u:{}},M=async e=>{P(e,!0);const t=await n.resolver(l,n.context,((e,t,n,i)=>{const o={};for(const n of e){const e=b(t,n);e&&_(o,n,e._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:i}})(e||c.mount,o,n.criteriaMode,n.shouldUseNativeValidation));return P(e),t},U=async(e,t,o={valid:!0})=>{for(const r in e){const a=e[r];if(a){const{_f:e,...s}=a;if(e){const s=c.array.has(e.name);P([r],!0);const d=await re(a,l,D,n.shouldUseNativeValidation&&!t,s);if(P([r]),d[e.name]&&(o.valid=!1,t))break;!t&&(b(d,e.name)?s?H(i.errors,d,e.name):_(i.errors,e.name,d[e.name]):le(i.errors,e.name))}!T(s)&&await U(s,t,o)}}return o.valid},F=(e,t)=>(e&&t&&_(l,e,t),!de(ne(),r)),V=(e,t,n)=>B(e,c,{...a.mount?l:y(t)?r:k(e)?{[e]:t}:t},n,t),Z=(e,t,n={})=>{const i=b(o,e);let r=t;if(i){const n=i._f;n&&(!n.disabled&&_(l,e,fe(t,n)),r=Q(n.ref)&&u(t)?"":t,ue(n.ref)?[...n.ref.options].forEach(e=>e.selected=r.includes(e.value)):n.refs?s(n.ref)?n.refs.length>1?n.refs.forEach(e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(r)?!!r.find(t=>t===e.value):r===e.value)):n.refs[0]&&(n.refs[0].checked=!!r):n.refs.forEach(e=>e.checked=e.value===r):q(n.ref)?n.ref.value="":(n.ref.value=r,n.ref.type||C.values.next({name:e,values:{...l}})))}(n.shouldDirty||n.shouldTouch)&&L(e,r,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&te(e)},K=(e,t,n)=>{for(const i in t){const r=t[i],l=`${e}.${i}`,a=b(o,l);!c.array.has(e)&&se(r)&&(!a||a._f)||d(r)?Z(l,r,n):K(l,r,n)}},J=(e,t,n={})=>{const s=b(o,e),d=c.array.has(e),v=f(t);_(l,e,v),d?(C.array.next({name:e,values:{...l}}),(S.isDirty||S.dirtyFields)&&n.shouldDirty&&C.state.next({name:e,dirtyFields:ge(r,l),isDirty:F(e,v)})):!s||s._f||u(v)?Z(e,v,n):K(e,v,n),z(e,c)&&C.state.next({...i}),C.values.next({name:a.mount?e:void 0,values:{...l}})},$=async r=>{a.mount=!0;const s=r.target;let d=s.name,u=!0;const v=b(o,d),p=e=>{u=Number.isNaN(e)||e===b(l,d,e)};if(v){let a,f;const h=s.type?he(v._f):m(r),y=r.type===j||"focusout"===r.type,N=!((g=v._f).mount&&(g.required||g.min||g.max||g.maxLength||g.minLength||g.pattern||g.validate)||n.resolver||b(i.errors,d)||v._f.deps)||((e,t,n,i,o)=>!o.isOnAll&&(!n&&o.isOnTouch?!(t||e):(n?i.isOnBlur:o.isOnBlur)?!e:!(n?i.isOnChange:o.isOnChange)||e))(y,b(i.touchedFields,d),i.isSubmitted,E,w),A=z(d,c,y);_(l,d,h),y?(v._f.onBlur&&v._f.onBlur(r),t&&t(0)):v._f.onChange&&v._f.onChange(r);const R=L(d,h,y,!1),k=!T(R)||A;if(!y&&C.values.next({name:d,type:r.type,values:{...l}}),N)return S.isValid&&I(),k&&C.state.next({name:d,...A?{}:R});if(!y&&A&&C.state.next({...i}),n.resolver){const{errors:e}=await M([d]);if(p(h),u){const t=be(i.errors,o,d),n=be(e,o,t.name||d);a=n.error,d=n.name,f=T(e)}}else P([d],!0),a=(await re(v,l,D,n.shouldUseNativeValidation))[d],P([d]),p(h),u&&(a?f=!1:S.isValid&&(f=await U(o,!0)));u&&(v._f.deps&&te(v._f.deps),((n,o,r,l)=>{const a=b(i.errors,n),s=S.isValid&&O(o)&&i.isValid!==o;var d;if(e.delayError&&r?(d=()=>((e,t)=>{_(i.errors,e,t),C.state.next({errors:i.errors})})(n,r),t=e=>{clearTimeout(x),x=setTimeout(d,e)},t(e.delayError)):(clearTimeout(x),t=null,r?_(i.errors,n,r):le(i.errors,n)),(r?!de(a,r):a)||!T(l)||s){const e={...l,...s&&O(o)?{isValid:o}:{},errors:i.errors,name:n};i={...i,...e},C.state.next(e)}})(d,f,a,R))}var g},ee=(e,t)=>{if(b(i.errors,t)&&e.focus)return e.focus(),1},te=async(e,t={})=>{let r,l;const a=R(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await M(e);if(e)for(const n of e){const e=b(t,n);e?_(i.errors,n,e):le(i.errors,n)}else i.errors=t;return t})(y(e)?e:a);r=T(t),l=e?!a.some(e=>b(t,e)):r}else e?(l=(await Promise.all(a.map(async e=>{const t=b(o,e);return await U(t&&t._f?{[e]:t}:t)}))).every(Boolean),(l||i.isValid)&&I()):l=r=await U(o);return C.state.next({...!k(e)||S.isValid&&r!==i.isValid?{}:{name:e},...n.resolver||!e?{isValid:r}:{},errors:i.errors}),t.shouldFocus&&!l&&W(o,ee,e?a:c.mount),l},ne=e=>{const t={...a.mount?l:r};return y(e)?t:k(e)?b(t,e):e.map(e=>b(t,e))},ie=(e,t)=>({invalid:!!b((t||i).errors,e),isDirty:!!b((t||i).dirtyFields,e),error:b((t||i).errors,e),isValidating:!!b(i.validatingFields,e),isTouched:!!b((t||i).touchedFields,e)}),oe=(e,t,n)=>{const r=(b(o,e,{_f:{}})._f||{}).ref,l=b(i.errors,e)||{},{ref:a,message:s,type:d,...u}=l;_(i.errors,e,{...u,...t,ref:r}),C.state.next({name:e,errors:i.errors,isValid:!1}),n&&n.shouldFocus&&r&&r.focus&&r.focus()},ve=(e,t={})=>{for(const a of e?R(e):c.mount)c.mount.delete(a),c.array.delete(a),t.keepValue||(le(o,a),le(l,a)),!t.keepError&&le(i.errors,a),!t.keepDirty&&le(i.dirtyFields,a),!t.keepTouched&&le(i.touchedFields,a),!t.keepIsValidating&&le(i.validatingFields,a),!n.shouldUnregister&&!t.keepDefaultValue&&le(r,a);C.values.next({values:{...l}}),C.state.next({...i,...t.keepDirty?{isDirty:F()}:{}}),!t.keepIsValid&&I()},me=({disabled:e,name:t,field:n,fields:i,value:o})=>{if(O(e)&&a.mount||e){const r=e?void 0:y(o)?he(n?n._f:b(i,t)._f):o;_(l,t,r),L(t,r,!1,!1,!0)}},pe=(e,t={})=>{let i=b(o,e);const l=O(t.disabled);return _(o,e,{...i||{},_f:{...i&&i._f?i._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),i?me({field:i,disabled:t.disabled,name:e,value:t.value}):A(e,!0,t.value),{...l?{disabled:t.disabled}:{},...n.progressive?{required:!!t.required,min:ye(t.min),max:ye(t.max),minLength:ye(t.minLength),maxLength:ye(t.maxLength),pattern:ye(t.pattern)}:{},name:e,onChange:$,onBlur:$,ref:l=>{if(l){pe(e,t),i=b(o,e);const n=y(l.value)&&l.querySelectorAll&&l.querySelectorAll("input,select,textarea")[0]||l,a=(e=>Y(e)||s(e))(n),d=i._f.refs||[];if(a?d.find(e=>e===n):n===i._f.ref)return;_(o,e,{_f:{...i._f,...a?{refs:[...d.filter(ce),n,...Array.isArray(b(r,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),A(e,!1,void 0,n)}else i=b(o,e,{}),i._f&&(i._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!p(c.array,e)||!a.action)&&c.unMount.add(e)}}},xe=()=>n.shouldFocusError&&W(o,ee,c.mount),Se=(e,t)=>async r=>{let a;r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let s=f(l);if(C.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await M();i.errors=e,s=t}else await U(o);if(le(i.errors,"root"),T(i.errors)){C.state.next({errors:{}});try{await e(s,r)}catch(e){a=e}}else t&&await t({...i.errors},r),xe(),setTimeout(xe);if(C.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:T(i.errors)&&!a,submitCount:i.submitCount+1,errors:i.errors}),a)throw a},_e=(t,n={})=>{const s=t?f(t):r,d=f(s),u=T(t),v=u?r:d;if(n.keepDefaultValues||(r=s),!n.keepValues){if(n.keepDirtyValues)for(const e of c.mount)b(i.dirtyFields,e)?_(v,e,b(l,e)):J(e,b(v,e));else{if(g&&y(t))for(const e of c.mount){const t=b(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Q(e)){const t=e.closest("form");if(t){t.reset();break}}}}o={}}l=e.shouldUnregister?n.keepDefaultValues?f(r):{}:f(v),C.array.next({values:{...v}}),C.values.next({values:{...v}})}c={mount:n.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!S.isValid||!!n.keepIsValid||!!n.keepDirtyValues,a.watch=!!e.shouldUnregister,C.state.next({submitCount:n.keepSubmitCount?i.submitCount:0,isDirty:!u&&(n.keepDirty?i.isDirty:!(!n.keepDefaultValues||de(t,r))),isSubmitted:!!n.keepIsSubmitted&&i.isSubmitted,dirtyFields:u?{}:n.keepDirtyValues?n.keepDefaultValues&&l?ge(r,l):i.dirtyFields:n.keepDefaultValues&&t?ge(r,t):n.keepDirty?i.dirtyFields:{},touchedFields:n.keepTouched?i.touchedFields:{},errors:n.keepErrors?i.errors:{},isSubmitSuccessful:!!n.keepIsSubmitSuccessful&&i.isSubmitSuccessful,isSubmitting:!1})},je=(e,t)=>_e(X(e)?e(l):e,t);return{control:{register:pe,unregister:ve,getFieldState:ie,handleSubmit:Se,setError:oe,_executeSchema:M,_getWatch:V,_getDirty:F,_updateValid:I,_removeUnmounted:()=>{for(const e of c.unMount){const t=b(o,e);t&&(t._f.refs?t._f.refs.every(e=>!ce(e)):!ce(t._f.ref))&&ve(e)}c.unMount=new Set},_updateFieldArray:(e,t=[],n,s,d=!0,u=!0)=>{if(s&&n){if(a.action=!0,u&&Array.isArray(b(o,e))){const t=n(b(o,e),s.argA,s.argB);d&&_(o,e,t)}if(u&&Array.isArray(b(i.errors,e))){const t=n(b(i.errors,e),s.argA,s.argB);d&&_(i.errors,e,t),((e,t)=>{!h(b(e,t)).length&&le(e,t)})(i.errors,e)}if(S.touchedFields&&u&&Array.isArray(b(i.touchedFields,e))){const t=n(b(i.touchedFields,e),s.argA,s.argB);d&&_(i.touchedFields,e,t)}S.dirtyFields&&(i.dirtyFields=ge(r,l)),C.state.next({name:e,isDirty:F(e,t),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else _(l,e,t)},_updateDisabledField:me,_getFieldArray:t=>h(b(a.mount?l:r,t,e.shouldUnregister?b(r,t,[]):[])),_reset:_e,_resetDefaultValues:()=>X(n.defaultValues)&&n.defaultValues().then(e=>{je(e,n.resetOptions),C.state.next({isLoading:!1})}),_updateFormState:e=>{i={...i,...e}},_disableForm:e=>{O(e)&&(C.state.next({disabled:e}),W(o,(t,n)=>{const i=b(o,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},_subjects:C,_proxyFormState:S,_setErrors:e=>{i.errors=e,C.state.next({errors:i.errors,isValid:!1})},get _fields(){return o},get _formValues(){return l},get _state(){return a},set _state(e){a=e},get _defaultValues(){return r},get _names(){return c},set _names(e){c=e},get _formState(){return i},set _formState(e){i=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:te,register:pe,handleSubmit:Se,watch:(e,t)=>X(e)?C.values.subscribe({next:n=>e(V(void 0,t),n)}):V(e,t,!0),setValue:J,getValues:ne,reset:je,resetField:(e,t={})=>{b(o,e)&&(y(t.defaultValue)?J(e,f(b(r,e))):(J(e,t.defaultValue),_(r,e,f(t.defaultValue))),t.keepTouched||le(i.touchedFields,e),t.keepDirty||(le(i.dirtyFields,e),i.isDirty=t.defaultValue?F(e,f(b(r,e))):F()),t.keepError||(le(i.errors,e),S.isValid&&I()),C.state.next({...i}))},clearErrors:e=>{e&&R(e).forEach(e=>le(i.errors,e)),C.state.next({errors:e?i.errors:{}})},unregister:ve,setError:oe,setFocus:(e,t={})=>{const n=b(o,e),i=n&&n._f;if(i){const e=i.refs?i.refs[0]:i.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:ie}}var Se=n(6870);const _e=e=>{var{register:t,control:n,reset:i,tenantId:o,t:r,previousPage:l,formState:s,isLoading:d}=e,u=window.Digit.Utils.browser.isMobile();return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsxs)(a.SearchField,{className:"pt-form-field",children:[(0,Se.jsx)("label",{children:r("AUDIT_FROM_DATE_LABEL")}),(0,Se.jsx)(F,{render:e=>(0,Se.jsx)(a.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})]}),(0,Se.jsxs)(a.SearchField,{className:"pt-form-field",children:[(0,Se.jsx)("label",{children:r("AUDIT_TO_DATE_LABEL")}),(0,Se.jsx)(F,{render:e=>(0,Se.jsx)(a.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})]}),(0,Se.jsx)(a.SearchField,{className:"pt-search-action-submit",children:(0,Se.jsx)(a.Button,{style:{marginTop:u?"510px":"25px",marginLeft:u?"0":"-30px",maxWidth:u?"100%":"240px"},label:r("ES_COMMON_APPLY"),submit:!0})})]})};var je=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Ce=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"];function we(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach(function(t){De(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function De(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ie=e=>{var t,{Controller:n,register:r,control:l,t:s,reset:d,previousPage:u,handleSubmit:c,tenantId:v,data:m,onSubmit:p,isLoading:g}=e,[f,h]=(0,i.useState)([]),y=e=>(0,Se.jsx)("div",{onClick:e.onClick,children:(0,Se.jsx)(a.DownloadBtnCommon,{})});(0,i.useEffect)(()=>{(null==m?void 0:m.length)>0&&h([null==m?void 0:m.map(e=>{var t={};return t[s("AUDIT_DATE_LABEL")]=b(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=O(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),Ee({},t)})])},[m]);var b=e=>{if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,i=t.getDate(),o=t.getFullYear();return n=(n>9?"":"0")+n,"".concat(i=(i>9?"":"0")+i,"/").concat(n,"/").concat(o)},O=e=>{if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),i=t.getMinutes(),o=n>12?"PM":"AM";return i=(i>9?"":"0")+i,"".concat(n=((n=n>12?n-12:n)>9?"":"0")+n,":").concat(i," ").concat(o)},[x,S]=(0,i.useReducer)(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),_=()=>{S({type:"remove"})},j=()=>(0,Se.jsx)("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:_,children:(0,Se.jsx)(a.CloseSvg,{})}),C={Controller:n,register:r,control:l,t:s,reset:d,previousPage:u},w=(0,i.useCallback)(e=>{var{currentlyActiveMobileModal:t,searchFormFieldsComponentProps:n,tenantId:i}=e;return(e=>{var{currentlyActiveMobileModal:t,searchFormFieldsComponentProps:n,tenantId:i}=e,o=we(e,je),{closeMobilePopupModal:r}=o;return"SearchFormComponent"===t?(0,Se.jsxs)(a.SearchForm,Ee(Ee({},o),{},{children:[(0,Se.jsx)(j,{}),(0,Se.jsx)("div",{className:"MobilePopupHeadingWrapper",children:(0,Se.jsxs)("h2",{children:[s("PRIVACY_AUDIT_REPORT"),":"]})}),(0,Se.jsx)(_e,Ee(Ee({},n),{},{closeMobilePopupModal:r,tenantId:i,t:s}))]})):(0,Se.jsx)("span",{})})(Ee({currentlyActiveMobileModal:t,searchFormFieldsComponentProps:n,tenantId:i},we(e,Ce)))},[x]),N=[];null==m||null===(t=m.roles)||void 0===t||t.forEach(e=>{N.push(null==e?void 0:e.name)});var E=(0,i.useMemo)(()=>null!=m&&m.display||""===m?[]:null==m?void 0:m.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:b(e.timestamp),[s("AUDIT_TIME_LABEL")]:O(e.timestamp),[s("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[s("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[s("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[m]);return(0,Se.jsxs)(o().Fragment,{children:[(0,Se.jsx)(a.BackButton,{}),(0,Se.jsx)("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"},children:(0,Se.jsx)(y,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(f)})}),(0,Se.jsxs)(a.HeaderComponent,{children:[s("PRIVACY_AUDIT_REPORT"),":"]}),(0,Se.jsx)("div",{className:"digit-search-box",children:(0,Se.jsx)(a.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>S({type:"set",payload:"SearchFormComponent"}),tenantId:v,t:s})}),x?(0,Se.jsx)(a.PopUp,{children:(0,Se.jsx)(w,{onSubmit:e=>{S({type:"remove"}),p(e)},handleSubmit:c,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:C,currentlyActiveMobileModal:x,closeMobilePopupModal:_,tenantId:v})}):null,g&&(0,Se.jsx)(a.Loader,{}),(0,Se.jsx)(a.DetailsCard,{data:E})]})};function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Ae(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Te=e=>{var{tenantId:t,t:n,onSubmit:r,data:s,count:d}=e,u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:c,control:v,handleSubmit:m,setValue:p,getValues:g,reset:f}=function(e={}){const t=i.useRef(),n=i.useRef(),[o,r]=i.useState({isDirty:!1,isValidating:!1,isLoading:X(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:X(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...xe(e),formState:o});const l=t.current.control;return l._options=e,U({subject:l._subjects.state,next:e=>{L(e,l._proxyFormState,l._updateFormState,!0)&&r({...l._formState})}}),i.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),i.useEffect(()=>{if(l._proxyFormState.isDirty){const e=l._getDirty();e!==o.isDirty&&l._subjects.state.next({isDirty:e})}},[l,o.isDirty]),i.useEffect(()=>{e.values&&!de(e.values,n.current)?(l._reset(e.values,l._options.resetOptions),n.current=e.values,r(e=>({...e}))):l._resetDefaultValues()},[e.values,l]),i.useEffect(()=>{e.errors&&l._setErrors(e.errors)},[e.errors,l]),i.useEffect(()=>{l._state.mount||(l._updateValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),i.useEffect(()=>{e.shouldUnregister&&l._subjects.values.next({values:l._getWatch()})},[e.shouldUnregister,l]),t.current.formState=A(o,l),t.current}({defaultValues:u}),h=e=>{if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,i=t.getDate(),o=t.getFullYear();return n=(n>9?"":"0")+n,"".concat(i=(i>9?"":"0")+i,"/").concat(n,"/").concat(o)},y=e=>{if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),i=t.getMinutes(),o=n>12?"PM":"AM";return i=(i>9?"":"0")+i,"".concat(n=((n=n>12?n-12:n)>9?"":"0")+n,":").concat(i," ").concat(o)},[b,O]=(0,i.useState)([]),x=e=>(0,Se.jsx)("div",{onClick:e.onClick,children:(0,Se.jsx)(l.DownloadBtnCommon,{})});(0,i.useEffect)(()=>{c("offset",0),c("limit",5),c("sortOrder","DESC")},[c]),(0,i.useEffect)(()=>{(null==s?void 0:s.length)>0&&O([null==s?void 0:s.map(e=>{var t={};return t[n("AUDIT_DATE_LABEL")]=h(null==e?void 0:e.timestamp),t[n("AUDIT_TIME_LABEL")]=y(null==e?void 0:e.timestamp),t[n("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[n("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[n("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach(function(t){Ae(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},t)})])},[s]);var S=(0,i.useCallback)(e=>{0!==e.length&&(p("sortBy",e.id),p("sortOrder",e.desc?"DESC":"ASC"))},[]);function _(){p("offset",g("offset")-g("limit")),m(r)()}var j=window.Digit.Utils.browser.isMobile();if(j)return(0,Se.jsx)(Ie,{Controller:F,register:c,control:v,t:n,reset:f,previousPage:_,handleSubmit:m,tenantId:t,data:s,onSubmit:r});var C=e=>(0,Se.jsx)("span",{className:"cell-text",children:e}),w=(0,i.useMemo)(()=>[{Header:n("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var t="NA"===e.timestamp?n("WS_NA"):h(e.timestamp);return C("".concat(t))}},{Header:n("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{var t="NA"===e.timestamp?n("WS_NA"):y(e.timestamp);return C("".concat(t))}},{Header:n(j?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>C("".concat(null==e?void 0:e.dataView))},{Header:n(j?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>C("".concat(null==e?void 0:e.dataViewedBy))},{Header:n("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return C("".concat(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return(0,Se.jsxs)(o().Fragment,{children:[(0,Se.jsxs)("div",{style:{marginRight:"-70px"},children:[" ",(0,Se.jsx)(a.BackButton,{})," "]}),(0,Se.jsxs)("div",{style:{marginTop:"30px",marginLeft:"30px"},children:[" ",(0,Se.jsx)(a.HeaderComponent,{children:n("PRIVACY_AUDIT_REPORT")})," "]}),(0,Se.jsx)(a.SearchForm,{className:"audit-card",onSubmit:r,handleSubmit:m,children:(0,Se.jsx)(_e,{register:c,control:v,reset:f,tenantId:t,t:n,previousPage:_})}),(0,Se.jsx)("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"},children:null!=s&&s.display?(0,Se.jsx)("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"},children:n(s.display).split("\\n").map((e,t)=>(0,Se.jsx)("p",{style:{textAlign:"center"},children:e},t))}):""!==s?(0,Se.jsxs)("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"},children:[(0,Se.jsx)("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"},children:(0,Se.jsx)(x,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(b)})}),(0,Se.jsx)(l.Table,{t:n,data:s,totalRecords:d,columns:w,getCellProps:e=>({style:{minWidth:e.column.Header===n("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){p("limit",Number(e.target.value)),m(r)()},currentPage:g("offset")/g("limit"),onNextPage:function(){p("offset",g("offset")+g("limit")),m(r)()},onPrevPage:_,manualPagination:!1,pageSizeLimit:g("limit"),onSort:S,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})]}):(0,Se.jsx)(a.Loader,{})})]})};function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach(function(t){Me(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Me(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ue=e=>{var t,n,{path:o}=e,{t:l}=(0,r.useTranslation)(),a=Digit.ULBService.getCitizenCurrentTenant(),[s,d]=(0,i.useState)({}),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dayend";try{var n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),i=new Date(Date.UTC(n[1],n[2]-1,n[3]));return i.setMinutes(i.getMinutes()+i.getTimezoneOffset()),"dayend"===t&&(i.setHours(i.getHours()+24),i.setSeconds(i.getSeconds()-1)),i.getTime()}catch(t){return e}};(0,i.useEffect)(()=>{var e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){var t=Re({},e);d(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>Re(Re({},e),{},{[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);var c={enabled:!!(s&&Object.keys(s).length>0)},v=Re({},s),{isLoading:m,data:p}=Digit.Hooks.useAudit({tenantId:a,filters:Re({},v),config:c});return(0,Se.jsx)(Te,{t:l,tenantId:a,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});var t=Re(Re({},e),{},{fromDate:u(null==e?void 0:e.fromDate),toDate:u(null==e?void 0:e.toDate)});d(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>Re(Re({},e),{},{[n]:(t[n],t[n])}),{}))},data:m?"":(null==p||null===(t=p.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==p?void 0:p.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==p||null===(n=p.ElasticSearchData)||void 0===n?void 0:n.length})}},2346(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>s});var i=n(6243),o=n(4883),r=n.n(o),l=n(5953),a=n(6870);const s=e=>{var t,n,o,s,d,u,c,v,m,p,g,f,h,y,b,{moduleCode:O}=e,{t:x}=(0,l.useTranslation)(),S=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:_,data:j}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:C,error:w,data:N,isSuccess:E}=Digit.Hooks.useDynamicData({moduleCode:O,tenantId:S,filters:{},t:x}),D=e=>{var{module:t,styles:n}=e;switch(t){case"TL":default:return(0,a.jsx)(i.CaseIcon,{className:"fill-path-primary-main",styles:n});case"PT":return(0,a.jsx)(i.PTIcon,{className:"fill-path-primary-main",styles:n});case"MCOLLECT":return(0,a.jsx)(i.MCollectIcon,{className:"fill-path-primary-main",styles:n});case"PGR":return(0,a.jsx)(i.ComplaintIcon,{className:"fill-path-primary-main",styles:n})}},I=null==j||null===(t=j.MdmsRes["common-masters"])||void 0===t||null===(t=t.StaticData[0])||void 0===t?void 0:t["".concat(O)],P=e=>{var{module:t}=e;switch(t){case"PT":case"WS":return(0,a.jsx)("span",{className:"timerIcon",children:(0,a.jsx)(i.TimerIcon,{})});default:return null}},A=e=>{var{module:t}=e;switch(t){case"PT":return(0,a.jsx)("span",{className:"rupeeSymbol",children:(0,a.jsx)(i.RupeeSymbol,{})});case"WS":return(0,a.jsx)("span",{className:"timerIcon",children:(0,a.jsx)(i.TimerIcon,{})});default:return null}},T=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:x("COMMON_VALIDITY"),validity:(null==I?void 0:I.validity)+("1"===(null==I?void 0:I.validity)?x("COMMON_DAY"):x("COMMON_DAYS"))};case"PGR":return{staticCommonContent:x("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:x("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==I?void 0:I.validity)+" "+("1"===(null==I?void 0:I.validity)?x("COMMON_DAY"):x("COMMON_DAYS"))};default:return{staticCommonContent:""}}},L=e=>{switch(e){case"PT":return{staticDataOne:(null==I?void 0:I.staticDataOne)+" "+x("COMMON_DAYS"),staticDataOneHeader:x("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==I?void 0:I.staticDataTwo,staticDataTwoHeader:x("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:x("PAY_WATER_CHARGES_BY")+" "+(null==I?void 0:I.staticDataOne)+" "+x("COMMON_DAYS")+" "+x("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==I?void 0:I.staticDataTwo)+" "+x("COMMON_DAYS"),staticDataTwoHeader:x("APPLICATION_PROCESSING_TIME")};default:return{}}};return _||C?(0,a.jsx)(i.Loader,{}):I?(0,a.jsxs)(r().Fragment,{children:[I&&null!=I&&I.payViaWhatsApp?(0,a.jsx)(i.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"},children:(0,a.jsxs)("div",{className:"pay-whatsapp-card",onClick:()=>{return e=null==I?void 0:I.payViaWhatsApp,void window.open(e);var e},children:[(0,a.jsx)("div",{className:"pay-whatsapp-text",children:x("PAY_VIA_WHATSAPP")}),(0,a.jsx)("div",{className:"whatsAppIconG",children:(0,a.jsx)(i.WhatsappIconGreen,{})})]})}):null,I&&null!=I&&I.helpline?(0,a.jsxs)(i.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"},children:[(0,a.jsxs)("div",{className:"static-home-Card",children:[(0,a.jsx)("div",{className:"static-home-Card-header",children:x("CALL_CENTER_HELPLINE")}),(0,a.jsx)("div",{className:"helplineIcon",children:(0,a.jsx)(i.HelpLineIcon,{})})]}),(0,a.jsxs)("div",{className:"call-center-card-text",children:[null!=I&&null!==(n=I.helpline)&&void 0!==n&&n.contactOne?(0,a.jsx)("div",{className:"call-center-card-content",children:(0,a.jsx)("a",{href:"tel:".concat(null==I||null===(o=I.helpline)||void 0===o?void 0:o.contactOne),children:null==I||null===(s=I.helpline)||void 0===s?void 0:s.contactOne})}):null,null!=I&&null!==(d=I.helpline)&&void 0!==d&&d.contactTwo?(0,a.jsx)("div",{className:"call-center-card-content",children:(0,a.jsx)("a",{href:"tel:".concat(null==I||null===(u=I.helpline)||void 0===u?void 0:u.contactTwo),children:null==I||null===(c=I.helpline)||void 0===c?void 0:c.contactTwo})}):null]})]}):null,I&&null!=I&&I.serviceCenter?(0,a.jsxs)(i.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"},children:[(0,a.jsxs)("div",{className:"static-home-Card",children:[(0,a.jsx)("div",{className:"static-home-Card-header",children:x("CITIZEN_SERVICE_CENTER")}),(0,a.jsx)("div",{className:"serviceCentrIcon",children:(0,a.jsx)(i.ServiceCenterIcon,{})})]}),(0,a.jsx)("div",{className:"service-center-details-card",children:(0,a.jsx)("div",{className:"service-center-details-text",children:null==I?void 0:I.serviceCenter})}),null!=I&&I.viewMapLocation?(0,a.jsx)("div",{className:"link",children:(0,a.jsx)("a",{href:null==I?void 0:I.viewMapLocation,children:x("VIEW_ON_MAP")})}):null]}):(0,a.jsx)("div",{}),(0,a.jsxs)(i.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"},children:[w||null==N||null===(null==N?void 0:N.dynamicDataOne)?(0,a.jsx)("div",{}):(0,a.jsx)("div",{className:"dynamicDataCard",children:(0,a.jsxs)("div",{className:"dynamicData",children:[(0,a.jsx)(D,{module:O,styles:{width:"24px",height:"24px"}}),(0,a.jsx)("span",{className:"dynamicData-content",children:null==N?void 0:N.dynamicDataOne})]})}),w||null==N||null===(null==N?void 0:N.dynamicDataTwo)?(0,a.jsx)("div",{}):(0,a.jsx)("div",{className:"dynamicDataCard",children:(0,a.jsxs)("div",{className:"dynamicData",children:[(0,a.jsx)(D,{module:O,styles:{width:"24px",height:"24px"}}),(0,a.jsx)("span",{className:"dynamicData-content",children:null==N?void 0:N.dynamicDataTwo})]})}),I&&null!=I&&I.staticDataOne?(0,a.jsx)("div",{className:"staticDataCard",children:(0,a.jsxs)("div",{className:"staticData",children:[(0,a.jsx)(P,{module:O}),(0,a.jsxs)("span",{className:"static-data-content",children:[(0,a.jsx)("span",{className:"static-data-content-first",style:{marginTop:""===(null===(v=L(O))||void 0===v?void 0:v.staticDataOne)?"8px":"unset"},children:null===(m=L(O))||void 0===m?void 0:m.staticDataOneHeader}),(0,a.jsx)("span",{className:"static-data-content-second",children:"".concat(null===(p=L(O))||void 0===p?void 0:p.staticDataOne)})]})]})}):(0,a.jsx)("div",{}),I&&null!=I&&I.staticDataTwo?(0,a.jsx)("div",{className:"staticDataCard",children:(0,a.jsxs)("div",{className:"staticData",children:[(0,a.jsx)(A,{module:O}),(0,a.jsxs)("span",{className:"static-data-content",children:[(0,a.jsx)("span",{className:"static-data-content-first",children:null===(g=L(O))||void 0===g?void 0:g.staticDataTwoHeader}),(0,a.jsx)("span",{className:"static-data-content-second",children:null===(f=L(O))||void 0===f?void 0:f.staticDataTwo})]})]})}):(0,a.jsx)("div",{}),I&&null!=I&&I.validity?(0,a.jsx)("div",{className:"staticDataCard",children:(0,a.jsxs)("div",{className:"staticData",children:[(0,a.jsx)("span",{className:"validityIcon",children:(0,a.jsx)(i.ValidityTimeIcon,{})}),(0,a.jsxs)("span",{className:"static-data-content",children:[(0,a.jsx)("span",{className:"static-data-content-first",children:null===(h=T(O))||void 0===h?void 0:h.staticCommonContent}),(0,a.jsx)("span",{className:"static-data-content-second",children:null===(y=T(O))||void 0===y?void 0:y.validity})]})]})}):(0,a.jsx)("div",{}),w||null==N||null==N||!N.staticData||null===(null==N?void 0:N.staticData)?(0,a.jsx)("div",{}):(0,a.jsx)("div",{className:"staticDataCard",children:(0,a.jsxs)("div",{className:"staticData",children:["PGR"===O?(0,a.jsx)(D,{module:O,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):(0,a.jsx)("span",{className:"validityIcon",children:(0,a.jsx)(i.ValidityTimeIcon,{})}),(0,a.jsxs)("span",{className:"static-data-content",children:[(0,a.jsx)("span",{className:"static-data-content-first",children:null===(b=T(O))||void 0===b?void 0:b.staticCommonContent}),(0,a.jsx)("span",{className:"static-data-content-second",children:null==N?void 0:N.staticData})]})]})})]})]}):(0,a.jsx)(r().Fragment,{})}},7155(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>T});var i=n(6243),o=n(4883),r=n.n(o),l=n(5953),a=n(4442),s=(n(4217),n(1234)),d=n(9536),u=n(8854),c=n(6810),v=n(6870);const m=e=>{var t,n,s,d,{linkData:m,islinkDataLoading:p}=e,{t:g}=(0,l.useTranslation)(),f=(0,a.useNavigate)(),h=Digit.Utils.getMultiRootTenant(),y=null===(t=Digit)||void 0===t||null===(t=t.ULBService)||void 0===t?void 0:t.getStateId(),b=Digit.UserService.getUser(),O=b&&b.access_token&&"CITIZEN"===(null==b||null===(n=b.info)||void 0===n?void 0:n.type),[x,S]=(0,o.useState)(!1),_=()=>{S(!1)};if(p)return(0,v.jsx)(i.Loader,{});var j=(()=>{var e,t,n,i=window.location.href.includes("digit-studio"),o=[],r=1;return O&&(o.push({label:g("COMMON_BOTTOM_NAVIGATION_HOME"),icon:{icon:"Home",width:"1.5rem",height:"1.5rem"},navigationUrl:"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/citizen"),orderNumber:r++}),o.push({label:g("EDIT_PROFILE"),icon:{icon:"Edit",width:"1.5rem",height:"1.5rem"},navigationUrl:"/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/citizen/user/profile"),orderNumber:r++})),null===(e=Object.keys(m||{}))||void 0===e||null===(e=e.sort((e,t)=>e.localeCompare(t)))||void 0===e||e.forEach(e=>{var t,n=m[e];if(n&&0!==n.length&&n.some(e=>{var t;return null===(t=e.sidebar)||void 0===t?void 0:t.endsWith("-links")})){var l=null===(t=n[0])||void 0===t?void 0:t.leftIcon,a=!i||l&&"TLIcon"!==l?l||"ViewModule":"Devices",s=new Set,d=n.filter(e=>!s.has(e.name)&&(s.add(e.name),!0)).map(e=>({label:g(e.displayName||e.i18nKey),icon:{icon:!i||e.leftIcon&&"TLIcon"!==e.leftIcon?e.leftIcon||"ViewModule":"Devices",width:"1.5rem",height:"1.5rem"},navigationUrl:e.navigationURL||e.link,orderNumber:e.orderNumber}));d.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:1/0)-(void 0!==t.orderNumber?t.orderNumber:1/0)),1===d.length?o.push({label:g("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(e))),icon:{icon:a,width:"1.5rem",height:"1.5rem"},navigationUrl:d[0].navigationUrl,orderNumber:r++}):o.push({label:g("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(e))),icon:{icon:a,width:"1.5rem",height:"1.5rem"},children:d,orderNumber:r++})}}),o.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:1/0)-(void 0!==t.orderNumber?t.orderNumber:1/0)),o})();return(0,v.jsxs)(r().Fragment,{children:[(0,v.jsx)(u.Ay,{minWidth:768,children:(0,v.jsx)(i.SideNav,{items:j,hideAccessbilityTools:!O,onSelect:e=>{var{item:t}=e;null!=t&&t.navigationUrl&&(e=>{var t;if(e&&"/"!==e)if(/^https?:\/\//i.test(e))window.open(e,"_blank","noopener,noreferrer");else if(e.includes("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath)))f(e);else{var n=window.location.origin;if(h){var i,o=(null===(i=window)||void 0===i?void 0:i.contextPath)||"sandbox-ui";e=e.replace("/".concat(o,"/citizen"),"/".concat(o,"/").concat(y,"/citizen")),f(e)}else{var r=n+e;try{window.location.href=r}catch(e){console.warn("Navigation failed, attempting fallback:",e),window.location.replace(r)}}}})(t.navigationUrl)},theme:(null===(s=window)||void 0===s||null===(s=s.globalConfigs)||void 0===s?void 0:s.getConfig("SIDENAV_THEME"))||"light",enableSearch:!0,variant:(null===(d=window)||void 0===d||null===(d=d.globalConfigs)||void 0===d?void 0:d.getConfig("SIDENAV_VARIANT"))||"primary",transitionDuration:"",className:"",styles:{position:"unset"},expandedWidth:"",collapsedWidth:"",onBottomItemClick:e=>{"Logout"===e&&S(!0)}})}),x&&(0,v.jsx)(c.A,{onSelect:()=>{var e;Digit.UserService.logout(),S(!1),window.location.href="/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/login")},onCancel:_,onDismiss:_})]})};var p,g,f,h,y,b=n(6177),O=n(1603),x=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,6340)),()=>n(6340).default,{loaderText:"CORE_LOADING_ERROR_COMPONENT"}),S=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,7973)),()=>n(7973).default,{loaderText:"CORE_LOADING_FAQS"}),_=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,6614)),()=>n(6614).default,{loaderText:"CORE_LOADING_HOME"}),j=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,9466)),()=>n(9466).default,{loaderText:"CORE_LOADING_LANGUAGE_SELECTION"}),C=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,6945)),()=>n(6945).default,{loaderText:"CORE_LOADING_LOCATION_SELECTION"}),w=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,855)),()=>n(855).default,{loaderText:"CORE_LOADING_USER_PROFILE"}),N=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,2339)),()=>n(2339).default,{loaderText:"CORE_LOADING_HOW_IT_WORKS"}),E=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,1022)),()=>n(1022).default,{loaderText:"CORE_LOADING_LOGIN"}),D=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,1737)),()=>n(1737).default,{loaderText:"CORE_LOADING_SEARCH"}),I=(0,i.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,2346)),()=>n(2346).default,{loaderText:"CORE_LOADING_DYNAMIC_CONTENT"}),P=["".concat(null===(p=window)||void 0===p?void 0:p.contextPath,"/citizen/register/name"),"/".concat(null===(g=window)||void 0===g?void 0:g.contextPath,"/citizen/select-language"),"/".concat(null===(f=window)||void 0===f?void 0:f.contextPath,"/citizen/select-location"),"/".concat(null===(h=window)||void 0===h?void 0:h.contextPath,"/citizen/login"),"/".concat(null===(y=window)||void 0===y?void 0:y.contextPath,"/citizen/register/otp")],A=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code));const T=e=>{var t,n,{stateInfo:o,userDetails:u,CITIZEN:c,cityDetails:p,mobileView:g,handleUserDropdownSelection:f,logoUrl:h,DSO:y,stateCode:T,modules:L,appTenants:R,sourceUrl:M,pathname:U,initData:k}=e,{isLoading:B,data:F,isFetched:V}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:"[?(@.url == '".concat(Digit.Utils.getMultiRootTenant()?window.globalPath:window.contextPath,"-card')]")}],{select:e=>{var t;return null==e||null===(t=e["ACCESSCONTROL-ACTIONS-TEST"])||void 0===t||null===(t=t["actions-test"])||void 0===t?void 0:t.filter(e=>!0===e.enabled).reduce((e,t)=>{var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t,...e[t.parentModule]]:[t],e},{})}}),G=Digit.Hooks.useRouteSubscription(U),{t:z}=(0,l.useTranslation)(),W=(0,a.useNavigate)(),H=((0,a.useLocation)(),P.some(e=>window.location.href.includes(e))),q=L.map((e,t)=>{var{code:n,tenants:i}=e;return(0,v.jsx)(a.Route,{path:"".concat(n.toLowerCase(),"/*"),element:(0,v.jsx)(O.A,{moduleCode:n,stateCode:T,userType:"citizen",tenants:A(i,R),maxRetries:3,retryDelay:1e3,initialDelay:800})},t)}),X=L.map((e,t)=>{var{code:n,bannerImage:l}=e,d=(Digit.ComponentRegistryService.getComponent("".concat(n,"Links")),V?(0,s.q)(F,n,z):void 0);return"ACTION_TEST_WS"===(null==d?void 0:d.header)&&(null==d||d.links.sort((e,t)=>t.orderNumber-e.orderNumber)),(0,v.jsxs)(r().Fragment,{children:[(0,v.jsx)(a.Route,{path:"".concat(n.toLowerCase(),"-home"),element:(0,v.jsxs)("div",{className:"moduleLinkHomePage",children:[(0,v.jsx)(b.A,{src:l||(null==o?void 0:o.bannerUrl),alt:"noimagefound"}),(0,v.jsx)(i.BackLink,{className:"moduleLinkHomePageBackButton",onClick:()=>W(-1)}),(0,v.jsx)("h1",{children:z("MODULE_"+n.toUpperCase())}),(0,v.jsx)("div",{className:"moduleLinkHomePageModuleLinks",children:d&&(0,v.jsx)(i.CitizenHomeCard,{header:z(null==d?void 0:d.header),links:null==d?void 0:d.links,Icon:()=>(0,v.jsx)("span",{}),Info:"OBPS"===n?()=>(0,v.jsx)(i.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:z("CS_FILE_APPLICATION_INFO_LABEL"),text:z("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===n})}),(0,v.jsx)(I,{moduleCode:null==n?void 0:n.toUpperCase()})]})}),(0,v.jsx)(a.Route,{path:"".concat(n.toLowerCase(),"-faq"),element:(0,v.jsx)(S,{module:null==n?void 0:n.toUpperCase()})}),(0,v.jsx)(a.Route,{path:"".concat(n.toLowerCase(),"-how-it-works"),element:(0,v.jsx)(N,{module:null==n?void 0:n.toUpperCase()})})]},n+"-routes")});return(0,v.jsxs)("div",{className:G,children:[(0,v.jsx)(d.A,{t:z,stateInfo:o,userDetails:u,CITIZEN:c,cityDetails:p,mobileView:g,handleUserDropdownSelection:f,logoUrl:h,showSidebar:!!c,linkData:F,islinkDataLoading:B}),(0,v.jsxs)("div",{className:"main center-container citizen-home-container mb-25",children:[H?null:(0,v.jsx)("div",{children:(0,v.jsx)(m,{linkData:F,islinkDataLoading:B})}),(0,v.jsxs)(a.Routes,{children:[(0,v.jsx)(a.Route,{path:"/",element:(0,v.jsx)(_,{})}),(0,v.jsx)(a.Route,{path:"select-language",element:(0,v.jsx)(j,{})}),(0,v.jsx)(a.Route,{path:"select-location",element:(0,v.jsx)("div",{className:"citizen-location-selection-wrapper",children:(0,v.jsx)(C,{})})}),(0,v.jsx)(a.Route,{path:"error",element:(0,v.jsx)(x,{initData:k,goToHome:()=>{var e,t,n;W("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/").concat(null===(t=Digit)||void 0===t||null===(t=t.UserService)||void 0===t||null===(n=t.getType)||void 0===n?void 0:n.call(t)))}})}),(0,v.jsx)(a.Route,{path:"all-services",element:(0,v.jsx)(s.AppHome,{userType:"citizen",modules:L,getCitizenMenu:F,fetchedCitizen:V,isLoading:B})}),(0,v.jsx)(a.Route,{path:"login/*",element:(0,v.jsx)(E,{stateCode:T})}),(0,v.jsx)(a.Route,{path:"register/*",element:(0,v.jsx)(E,{stateCode:T,isUserRegistered:!1})}),(0,v.jsx)(a.Route,{path:"user/profile",element:(0,v.jsx)("div",{className:"citizen-user-profile-wrapper",children:(0,v.jsx)(w,{stateCode:T,userType:"citizen",cityDetails:p})})}),(0,v.jsx)(a.Route,{path:"Audit",element:(0,v.jsx)(D,{})}),q,X]})]}),(0,v.jsx)("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{},children:(0,v.jsx)(b.A,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})]})}},158(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>w});var i=n(4883),o=n(5953),r=n(4442),l=n(5053),a=n(6243),s=n(7598),d=n.n(s),u=n(5697),c=n(5660),v=n(743),m=n(6177),p=n(6870);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){y(r,i,o,l,a,"next",e)}function a(e){y(r,i,o,l,a,"throw",e)}l(void 0)})}}var O=e=>{var t,n,{config:o,t:s}=e,[d,g]=(0,i.useState)(null),{mobile_number:h,tenantId:y}=Digit.Hooks.useQueryParams(),O=(0,r.useNavigate)(),[x,S]=(0,i.useState)(""),[_,j]=(0,i.useState)(!0),[C,w]=(0,i.useState)(null),N=()=>Digit.UserService.getType();(0,i.useEffect)(()=>{var e,t;if(d){Digit.UserService.setUser(d);var n=(null===(e=location.state)||void 0===e?void 0:e.from)||"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee");O(n,{replace:!0})}else Digit.UserService.setType("employee")},[d]);var E=()=>{w(null)},D=function(){var e=b(function*(){var e={otp:{mobileNumber:h,userType:N().toUpperCase(),type:"passwordreset",tenantId:y}};try{yield Digit.UserService.sendOtp(e,y),w(s("ES_OTP_RESEND"))}catch(e){var t;w((null==e||null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.error_description)||s("ES_INVALID_LOGIN_CREDENTIALS"))}setTimeout(E,5e3)});return function(){return e.apply(this,arguments)}}(),I=function(){var e=b(function*(e){try{if(e.newPassword!==e.confirmPassword)return w(s("ERR_PASSWORD_DO_NOT_MATCH"));var t=f(f({},e),{},{otpReference:x,tenantId:y,type:N().toUpperCase()});yield Digit.UserService.changePassword(t,y),P()}catch(e){var n;w((null==e||null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n||null===(n=n.error)||void 0===n||null===(n=n.fields)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.message)||s("ES_SOMETHING_WRONG")),setTimeout(E,5e3)}});return function(t){return e.apply(this,arguments)}}(),P=()=>{var e;O("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/employee/user/login"),{replace:!0})},[A,T,L]=o.inputs,R=[{body:[{label:s(A.label),type:A.type,populators:{name:A.name},isMandatory:!0},{label:s(T.label),type:T.type,populators:{name:T.name},isMandatory:!0},{label:s(L.label),type:L.type,populators:{name:L.name},isMandatory:!0}]}];return(0,p.jsxs)(u.A,{children:[(0,p.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,p.jsx)(a.BackLink,{variant:"primary",style:{borderBottom:"none"}})}),(0,p.jsxs)(l.FormComposer,{onSubmit:I,noBoxShadow:!0,inline:!0,submitInForm:!0,config:R,label:o.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword",children:[(0,p.jsx)(c.A,{}),(0,p.jsxs)(l.CardSubHeader,{style:{textAlign:"center"},children:[" ",o.texts.header," "]}),(0,p.jsxs)(l.CardText,{children:["".concat(s("CS_LOGIN_OTP_TEXT")," "),(0,p.jsxs)("b",{children:[" ","".concat(s("+ 91 - "))," ",h]})]}),(0,p.jsx)(v.A,{t:s,userType:"employee",otp:x,onOtpChange:S,error:_,onResend:D})]}),C&&(0,p.jsx)(a.Toast,{type:"error",label:s(C),onClose:E}),(0,p.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,p.jsx)(m.A,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]})};O.propTypes={loginParams:d().any},O.defaultProps={loginParams:null};const x=O;var S=[{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"}]}];function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){C(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const w=()=>{var{t:e}=(0,o.useTranslation)(),t=(0,i.useMemo)(()=>S.map(t=>{var n={};for(var i in t.texts)n[i]=e(t.texts[i]);return j(j({},t),{},{texts:n})}),[S]);return(0,p.jsx)(r.Routes,{children:(0,p.jsx)(r.Route,{path:"",element:(0,p.jsx)(x,{config:t[0],t:e})})})}},9458(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>_});var i=n(4883),o=n.n(i),r=n(5953),l=n(4442),a=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"mobileNumber",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"dropdown",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],s=n(6243),d=n(7598),u=n.n(d),c=n(5697),v=n(5660),m=n(6177),p=n(5419),g=n(1065),f=n(6870);function h(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}var y=e=>{var t,n,r,a,{config:d,t:u,stateCode:y}=e,{data:b,isLoading:O}=Digit.Hooks.useTenants(),[x,S]=(0,i.useState)(null),_=(0,l.useNavigate)(),[j,C]=(0,i.useState)(null),{data:w}=(0,g.P)(y);if(null!=w&&w.config){var N,E=null==w||null===(N=w.config[0])||void 0===N?void 0:N.bannerImages;d.bannerImages=E}(0,i.useEffect)(()=>{var e,t;if(x){Digit.UserService.setUser(x);var n=(null===(e=location.state)||void 0===e?void 0:e.from)||"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee");_(n,{replace:!0})}else Digit.UserService.setType("employee")},[x]);var D=()=>{C(null)},I=function(){var e,t=(e=function*(e){if(e.city){var t={otp:{userName:e.username,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}};try{var n;yield Digit.UserService.sendOtp(t,e.city.code),_("/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/employee/user/change-password?USERNAME=").concat(e.username,"&tenantId=").concat(e.city.code))}catch(e){var i;C((null==e||null===(i=e.response)||void 0===i||null===(i=i.data)||void 0===i||null===(i=i.error)||void 0===i||null===(i=i.fields)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.message)||"Invalid login credentials!"),setTimeout(D,5e3)}}else alert("Please Select City!")},function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){h(r,i,o,l,a,"next",e)}function a(e){h(r,i,o,l,a,"throw",e)}l(void 0)})});return function(e){return t.apply(this,arguments)}}(),P=()=>{var e;_("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/employee/login"))},[A,T]=d.inputs,L=[{body:[{label:u("USERNAME"),type:"text",populators:{name:"username"},isMandatory:!0},{label:u(T.label),type:T.type,populators:{name:T.name,optionsKey:"name",required:!0,options:b},isMandatory:!0}]}];return O?(0,f.jsx)(s.Loader,{page:!0,variant:"PageLoader"}):null!=d&&d.bannerImages?(0,f.jsx)(o().Fragment,{children:(0,f.jsxs)("div",{className:"login-container",children:[(0,f.jsx)(p.A,{bannerImages:null==d?void 0:d.bannerImages}),(0,f.jsxs)("div",{className:"login-form-container",children:[(0,f.jsx)(s.FormComposerV2,{onSubmit:I,noBoxShadow:!0,inline:!0,submitInForm:!0,config:L,label:d.texts.submitButtonLabel,secondaryActionLabel:d.texts.secondaryButtonLabel,onSecondayActionClick:P,heading:d.texts.header,description:d.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword",secondaryActionId:"employeeForgotPassword",children:(0,f.jsx)(v.A,{})}),j&&(0,f.jsx)(s.Toast,{type:"error",label:u(j),onClose:D}),(0,f.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,f.jsx)(m.A,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]})]})}):(0,f.jsxs)(c.A,{children:[(0,f.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,f.jsx)(s.BackLink,{onClick:()=>window.history.back()})}),(0,f.jsx)(s.FormComposerV2,{onSubmit:I,noBoxShadow:!0,inline:!0,submitInForm:!0,config:L,label:d.texts.submitButtonLabel,secondaryActionLabel:d.texts.secondaryButtonLabel,onSecondayActionClick:P,heading:d.texts.header,description:d.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword",secondaryActionId:"employeeForgotPassword",children:(0,f.jsx)(v.A,{})}),j&&(0,f.jsx)(s.Toast,{type:"error",label:u(j),onClose:D}),(0,f.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,f.jsx)(m.A,{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(r=r.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]})};y.propTypes={loginParams:u().any},y.defaultProps={loginParams:null};const b=y;function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach(function(t){S(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _=e=>{var{stateCode:t}=e,{t:n}=(0,r.useTranslation)(),o=(0,i.useMemo)(()=>a.map(e=>{var t={};for(var i in e.texts)t[i]=n(e.texts[i]);return x(x({},e),{},{texts:t})}),[a]);return(0,f.jsx)(l.Routes,{children:(0,f.jsx)(l.Route,{path:"",element:(0,f.jsx)(b,{config:o[0],t:n,stateCode:t})})})}},5383(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>p});var i,o,r=n(6243),l=n(5053),a=n(4883),s=n(5953),d=n(4442),u=n(5697),c=n(6177),v=n(6870),m={label:"English",value:null===(i=Digit)||void 0===i||null===(i=i.Utils)||void 0===i||null===(o=i.getDefaultLanguage)||void 0===o?void 0:o.call(i)};const p=()=>{var e,t,n,i,{data:o,isLoading:p}=Digit.Hooks.useStore.getInitData(),{t:g}=(0,s.useTranslation)(),f=(0,d.useNavigate)(),{languages:h,stateInfo:y}=o||{},b=h;b&&0!=(null===(e=b)||void 0===e?void 0:e.length)||(b=[m]);var O,x=Digit.StoreData.getCurrentLanguage(),[S,_]=(0,a.useState)(x),j=(null==h?void 0:h.length)>1;return p?(0,v.jsx)(r.Loader,{}):j?(0,v.jsxs)(u.A,{children:[(0,v.jsxs)(r.Card,{className:"bannerCard removeBottomMargin languageSelection",children:[(0,v.jsxs)("div",{className:"bannerHeader",children:[(0,v.jsx)(c.A,{className:"bannerLogo",src:null==y?void 0:y.logoUrl,alt:"Digit Banner Image"}),(0,v.jsx)("p",{children:g("TENANT_TENANTS_".concat(null==y||null===(t=y.code)||void 0===t?void 0:t.toUpperCase()))})]}),(0,v.jsx)("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"},children:b.map((e,t)=>(0,v.jsx)("div",{className:"language-button-container",children:(0,v.jsx)(l.CustomButton,{selected:e.value===S,text:g(e.label),onClick:()=>(e=>{_(e.value),Digit.LocalizationService.changeLanguage(e.value,y.code)})(e)})},t))}),(0,v.jsx)(r.SubmitBar,{style:{width:"100%"},label:g("CORE_COMMON_CONTINUE"),onSubmit:e=>{var t;f("/".concat((t=window.contextPath,t&&"string"==typeof t?t.split("/")[0]:""),"/user/login?ts=").concat(Date.now()))}})]}),(0,v.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,v.jsx)(c.A,{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n||null===(i=n.getConfig)||void 0===i?void 0:i.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]}):(0,v.jsx)(d.Navigate,{to:"/".concat(null===(O=window)||void 0===O?void 0:O.contextPath,"/employee/user/login"),replace:!0})}},5419(e,t,n){"use strict";n.d(t,{A:()=>a});var i=n(4883),o=n(4650),r=n(5953),l=n(6870);const a=e=>{var t,{bannerImages:n=[]}=e,[a,s]=(0,i.useState)(0),{t:d}=(0,r.useTranslation)(),u=n||(null===(t=o.m[0])||void 0===t?void 0:t.bannerImages)||[],c=()=>{s(e=>e===u.length-1?0:e+1)};return(0,i.useEffect)(()=>{var e=setInterval(()=>{c()},5e3);return()=>clearInterval(e)},[u.length]),(0,l.jsx)(i.Fragment,{children:(0,l.jsxs)("div",{className:"carousel-container",children:[u.sort((e,t)=>(null==e?void 0:e.id)-(null==t?void 0:t.id)).map((e,t)=>(0,l.jsx)("div",{className:"carousel-slide ".concat(t===a?"active":""),style:{backgroundImage:"url(".concat(e.image,")")},children:(0,l.jsxs)("div",{className:"carousel-content",children:[(0,l.jsx)("h2",{children:d(e.title)}),(0,l.jsx)("p",{children:d(e.description)})]})},e.id)),(0,l.jsxs)("div",{className:"carousel-controls",children:[(0,l.jsx)("button",{className:"carousel-nav",onClick:()=>{s(e=>0===e?u.length-1:e-1)},children:"<"}),(0,l.jsx)("div",{className:"carousel-indicators",children:u.map((e,t)=>(0,l.jsx)("button",{className:"indicator ".concat(t===a?"active":""),onClick:()=>(e=>{s(e)})(t)},t))}),(0,l.jsx)("button",{className:"carousel-nav",onClick:c,children:">"})]})]})})}},4650(e,t,n){"use strict";n.d(t,{m:()=>i});var i=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_LOGIN",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",key:"username",isMandatory:!0,populators:{name:"username",validation:{required:!0},error:"ERR_USERNAME_REQUIRED"}},{label:"CORE_LOGIN_PASSWORD",type:"password",key:"password",isMandatory:!0,populators:{name:"password",validation:{required:!0},error:"ERR_PASSWORD_REQUIRED"}},{isMandatory:!0,type:"dropdown",key:"city",label:"CORE_COMMON_CITY",disable:!1,populators:{name:"city",optionsKey:"name",error:"ERR_HRMS_INVALID_CITY",mdmsConfig:{masterName:"tenants",moduleName:"tenant",localePrefix:"TENANT_TENANTS",select:"(data)=>{ return Array.isArray(data['tenant'].tenants) && Digit.Utils.getUnique(data['tenant'].tenants).map(ele=>({code:ele.code,name:Digit.Utils.locale.getTransformedLocale('TENANT_TENANTS_'+ele.code)}))}"}}},{key:"check",type:"component",disable:!1,component:"PrivacyComponent",populators:{name:"check"},customProps:{module:"HCM"},isMandatory:!1,withoutLabel:!0}]}]},3934(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>D});var i=n(4883),o=n(5953),r=n(4442),l=n(4650),a=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!0,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],s=n(6243),d=n(7598),u=n.n(d),c=n(5697),v=n(5660),m=n(5419),p=n(6177),g=n(5181),f=n(6870),h=["UserRequest"];function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){O(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}function S(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){x(r,i,o,l,a,"next",e)}function a(e){x(r,i,o,l,a,"throw",e)}l(void 0)})}}var _=e=>{var t,n,o,l,{config:a,t:d,isDisabled:u,loginOTPBased:g}=e,{data:y,isLoading:O}=Digit.Hooks.useTenants(),{data:x,isLoading:_}=Digit.Hooks.useStore.getInitData(),{stateInfo:j}=x||{},[C,w]=(0,i.useState)(null),[N,E]=(0,i.useState)(null),[D,I]=(0,i.useState)(!1),P=(0,r.useNavigate)(),A=null===(t=Digit.ComponentRegistryService)||void 0===t?void 0:t.getComponent("DynamicLoginComponent");(0,i.useEffect)(()=>{var e,t,n,i,o,r,l,a,s,d;if(C){Digit.SessionStorage.set("citizen.userRequestObject",C);var u=null==C||null===(e=C.info)||void 0===e||null===(e=e.roles)||void 0===e?void 0:e.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==C||null===(t=C.info)||void 0===t||null===(t=t.roles)||void 0===t?void 0:t.length)>0&&(C.info.roles=u),Digit.UserService.setUser(C),((e,t)=>{var n;if(!Digit.Utils.getMultiRootTenant()){var i=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",i),localStorage.setItem("Employee.locale",i),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))}})(null==C?void 0:C.info,null==C?void 0:C.access_token);var c,v,m,p,g="/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/employee");null!==(i=window)&&void 0!==i&&null!==(i=i.location)&&void 0!==i&&null!==(i=i.href)&&void 0!==i&&i.includes("from=")&&(g=decodeURIComponent(null===(c=window)||void 0===c||null===(c=c.location)||void 0===c||null===(c=c.href)||void 0===c||null===(c=c.split("from="))||void 0===c?void 0:c[1])||"/".concat(null===(v=window)||void 0===v?void 0:v.contextPath,"/employee")),null!=C&&null!==(o=C.info)&&void 0!==o&&o.roles&&(null==C||null===(r=C.info)||void 0===r||null===(r=r.roles)||void 0===r?void 0:r.length)>0&&null!=C&&null!==(l=C.info)&&void 0!==l&&null!==(l=l.roles)&&void 0!==l&&l.every(e=>"NATADMIN"===e.code)&&(g="/".concat(null===(m=window)||void 0===m?void 0:m.contextPath,"/employee/dss/landing/NURT_DASHBOARD")),null!=C&&null!==(a=C.info)&&void 0!==a&&a.roles&&(null==C||null===(s=C.info)||void 0===s||null===(s=s.roles)||void 0===s?void 0:s.length)>0&&null!=C&&null!==(d=C.info)&&void 0!==d&&null!==(d=d.roles)&&void 0!==d&&d.every(e=>"STADMIN"===e.code)&&(g="/".concat(null===(p=window)||void 0===p?void 0:p.contextPath,"/employee/dss/landing/home")),P(g,{replace:!0})}},[C]);var T=function(){var e=S(function*(e){var t,n;null!=e&&e.username&&(e.username=e.username.trim()),null!=e&&e.password&&(e.password=e.password.trim()),I(!0);var i=b(b(b({},e),z),{},{userType:"EMPLOYEE"});i.tenantId=(null==i||null===(t=i.city)||void 0===t?void 0:t.code)||(null===(n=Digit)||void 0===n||null===(n=n.ULBService)||void 0===n?void 0:n.getStateId()),delete i.city;try{var o=yield Digit.UserService.authenticate(i),{UserRequest:r}=o,l=function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(o,h);Digit.SessionStorage.set("Employee.tenantId",null==r?void 0:r.tenantId),w(b({info:r},l))}catch(e){var a;E((null==e||null===(a=e.response)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&d("ES_ERROR_USER_NOT_PERMITTED")||d("INVALID_LOGIN_CREDENTIALS")),setTimeout(U,5e3)}I(!1)});return function(t){return e.apply(this,arguments)}}(),L={url:"/user-otp/v1/_send",params:{tenantId:null===(n=Digit)||void 0===n||null===(n=n.ULBService)||void 0===n?void 0:n.getStateId()},body:{},config:{enable:!1}},R=Digit.Hooks.useCustomAPIMutationHook(L),M=function(){var e=S(function*(e){var t,n,i=e.email;yield R.mutate({body:{otp:{userName:e.email,type:"login",tenantId:null===(t=Digit)||void 0===t||null===(t=t.ULBService)||void 0===t?void 0:t.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,i;E(null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&null!==(n=n.Errors)&&void 0!==n&&n[0].code?"SANDBOX_RESEND_OTP".concat(null==e||null===(i=e.response)||void 0===i||null===(i=i.data)||void 0===i||null===(i=i.Errors)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.code):"SANDBOX_RESEND_OTP_ERROR"),setTimeout(U,5e3)},onSuccess:(n=S(function*(e){var t,n;P("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee/user/login/otp"),{state:{email:i,tenant:null===(n=Digit)||void 0===n||null===(n=n.ULBService)||void 0===n?void 0:n.getStateId()}})}),function(e){return n.apply(this,arguments)})})});return function(t){return e.apply(this,arguments)}}(),U=()=>{E(null)},k=()=>{var e;P("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/employee/user/forgot-password"))},B=Digit.ULBService.getStateId(),F={code:B,name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_".concat(B))},V=[{body:null==a?void 0:a.inputs}],{mode:G}=Digit.Hooks.useQueryParams();"admin"===G&&0==(null==V||null===(o=V[0])||void 0===o||null===(o=o.body)||void 0===o||null===(o=o[2])||void 0===o?void 0:o.disable)&&null==(null==V||null===(l=V[0])||void 0===l||null===(l=l.body)||void 0===l||null===(l=l[2])||void 0===l||null===(l=l.populators)||void 0===l?void 0:l.defaultValue)&&(V[0].body[2].disable=!0,V[0].body[2].isMandatory=!1,V[0].body[2].populators.defaultValue=F);var z=(0,i.useMemo)(()=>Object.fromEntries(V[0].body.filter(e=>{var t,n;return(null==e||null===(t=e.populators)||void 0===t?void 0:t.defaultValue)&&(null==e||null===(n=e.populators)||void 0===n?void 0:n.name)}).map(e=>[e.populators.name,e.populators.defaultValue])),[]),W=(e,t,n)=>{var i=V[0].body.filter(e=>null==e?void 0:e.isMandatory).map(e=>null==e?void 0:e.key).some(e=>{var n=t[e];return null==n||""===n||!1===n});I(i)},H=function(){var e,t,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(0,f.jsx)(s.FormComposerV2,{onSubmit:g?M:T,isDisabled:u||D,noBoxShadow:!0,inline:!0,submitInForm:!0,config:V,label:null==a||null===(e=a.texts)||void 0===e?void 0:e.submitButtonLabel,secondaryActionLabel:(null==a||null===(t=a.texts)||void 0===t?void 0:t.secondaryButtonLabel)+(i.includes("login-form-container")?"?":""),onSecondayActionClick:k,onFormValueChange:W,heading:null==a||null===(n=a.texts)||void 0===n?void 0:n.header,className:"".concat(r),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:o,buttonClassName:"buttonClassName",defaultValues:z,children:null!=j&&j.code?(0,f.jsx)(v.A,{}):(0,f.jsx)(v.A,{showTenant:!1})})},q=e=>{var t,n;return(0,f.jsx)("div",{className:e,style:{backgroundColor:"unset"},children:(0,f.jsx)(p.A,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})};return O||_?(0,f.jsx)(s.Loader,{page:!0,variant:"PageLoader"}):null!=a&&a.bannerImages?(0,f.jsxs)("div",{className:"login-container",children:[(0,f.jsx)(m.A,{bannerImages:null==a?void 0:a.bannerImages}),(0,f.jsxs)("div",{className:"login-form-container",children:[H("login-form-container","",g?"sandbox-onboarding-wrapper":""),A&&(0,f.jsx)(A,{}),N&&(0,f.jsx)(s.Toast,{type:"error",label:d(N),onClose:U}),q("EmployeeLoginFooter")]})]}):(0,f.jsxs)(c.A,{children:[(0,f.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,f.jsx)(s.BackLink,{onClick:()=>window.history.back()})}),H("loginFormStyleEmployee","loginCardClassName",g?"sandbox-onboarding-wrapper":""),A&&(0,f.jsx)(A,{}),N&&(0,f.jsx)(s.Toast,{type:"error",label:d(N),onClose:U}),q("employee-login-home-footer")]})};_.propTypes={loginParams:u().any},_.defaultProps={loginParams:null};const j=(0,g.A)(_,".login-form-container");var C=n(1065);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach(function(t){E(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function E(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const D=e=>{var t,{stateCode:n}=e,{t:d}=(0,o.useTranslation)(),[u,c]=(0,i.useState)(l.m),[v,m]=(0,i.useState)(a),p=Digit.StoreData.getCurrentLanguage(),g=(null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("OTP_BASED_LOGIN"))||!1,{data:h,isLoading:y}=(0,C.P)(n),{data:b}=Digit.Services.useStore({stateCode:n,moduleCode:["privacy-policy"],language:p,modulePrefix:"digit"});(0,i.useEffect)(()=>{!y&&null!=h&&h.config?c(null==h?void 0:h.config):c(l.m)},[h,y]);var O=(0,i.useMemo)(()=>u.map(e=>{var t={};for(var n in e.texts)t[n]=d(e.texts[n]);return N(N({},e),{},{texts:t})},[u])),x=(0,i.useMemo)(()=>v.map(e=>{var t={};for(var n in e.texts)t[n]=d(e.texts[n]);return N(N({},e),{},{texts:t})},[v]));return y?(0,f.jsx)(s.Loader,{page:!1,variant:"PageLoader"}):(0,f.jsxs)(r.Routes,{children:[" ",(0,f.jsx)(r.Route,{path:"/",element:g?(0,f.jsx)(j,{config:x[0],t:d,loginOTPBased:g}):(0,f.jsx)(j,{config:O[0],t:d})})]})}},1626(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>f});var i=n(4883),o=n(6243),r=n(5053),l=n(5953),a=n(4442),s=n(5697),d=n(5660),u=n(6177),c=n(6870),v=["UserRequest"];function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function p(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}const f=e=>{var t,n,f,{isLogin:h=!1}=e,{t:y}=(0,l.useTranslation)(),b=(0,a.useNavigate)(),O=(0,a.useLocation)(),[x,S]=(0,i.useState)(null),[_,j]=(0,i.useState)(!1),[C,w]=(0,i.useState)(null),[N,E]=(0,i.useState)((null==O||null===(t=O.state)||void 0===t?void 0:t.data)||{}),[D,I]=(0,i.useState)(!1),{email:P,tenant:A}=O.state||{},{data:T}=Digit.Hooks.useCustomMDMS(A,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}}),L=null==T?void 0:T[0].url,R=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:P,tenant:A},populators:{required:!0}}]}],M=[{texts:{header:y("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],U=()=>{S(null)};(0,i.useEffect)(()=>{var e,t,n;if(C){Digit.SessionStorage.set("citizen.userRequestObject",C);var i=null==C||null===(e=C.info)||void 0===e||null===(e=e.roles)||void 0===e?void 0:e.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==C||null===(t=C.info)||void 0===t||null===(t=t.roles)||void 0===t?void 0:t.length)>0&&(C.info.roles=i),Digit.UserService.setUser(C),((e,t)=>{var n;if(!Digit.Utils.getMultiRootTenant()){var i=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",i),localStorage.setItem("Employee.locale",i),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))}})(null==C?void 0:C.info,null==C?void 0:C.access_token);var o="/".concat(null===(n=window)||void 0===n?void 0:n.globalPath,"/user/setup"),r=((e,t,n,i)=>{var o,r,l,a="SUPERUSER"===(null==t||null===(o=t.info)||void 0===o||null===(o=o.roles)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.code),s=null===(r=window)||void 0===r?void 0:r.contextPath;switch(!0){case"/sandbox-ui/user/otp"===e&&a:return"/".concat(s,"/employee/sandbox/landing");case a&&(null==n||null===(l=n[0])||void 0===l||null===(l=l.rolesForLandingPage)||void 0===l?void 0:l.includes("SUPERUSER")):return"/".concat(s).concat(i);default:return"/".concat(s,"/employee")}})(O.pathname,C,T,L);return h?void b(r):void b({pathname:o},{state:{tenant:A}})}},[C]);var k=function(){var e,t=(e=function*(e){var t,n={username:P,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:A,userType:"EMPLOYEE"};try{var i=yield Digit.UserService.authenticate(n),{UserRequest:o}=i,r=function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(i,v);Digit.SessionStorage.set("Employee.tenantId",null==o?void 0:o.tenantId),w(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({info:o},r))}catch(e){var l;S((null==e||null===(l=e.response)||void 0===l||null===(l=l.data)||void 0===l?void 0:l.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&y("ES_ERROR_USER_NOT_PERMITTED")||y("INVALID_LOGIN_CREDENTIALS")),setTimeout(U,5e3)}},function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){g(r,i,o,l,a,"next",e)}function a(e){g(r,i,o,l,a,"throw",e)}l(void 0)})});return function(e){return t.apply(this,arguments)}}();return(0,c.jsxs)(s.A,{children:[(0,c.jsxs)("div",{className:"employeeBackbuttonAlign",children:[(0,c.jsx)(o.BackLink,{onClick:()=>b(-1)})," "]}),(0,c.jsx)(r.FormComposerV2,{onSubmit:k,noBoxShadow:!0,inline:!0,submitInForm:!0,onFormValueChange:(e,t)=>{var n,i=t.OtpComponent;6===(null==i||null===(n=i.otp)||void 0===n?void 0:n.length)?j(!0):j(!1)},isDisabled:!_,config:R,label:M[0].texts.submitButtonLabel,heading:M[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper",children:(0,c.jsx)(d.A,{showTenant:!1})}),x&&(0,c.jsx)(o.Toast,{type:"error",label:y(x),onClose:U}),(0,c.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,c.jsx)(u.A,{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n||null===(f=n.getConfig)||void 0===f?void 0:f.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]})}},8259(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>O});var i=n(4883),o=n(5953),r=n(4442),l=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,maxLength:64},error:"ERR_EMAIL_REQUIRED"}},{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/,maxLength:50},error:"ERR_ACCOUNT_NAME_REQUIRED"},infoMessage:"SANDBOX_SIGNUP_ACCOUNT_NAME_TOOLTIP"},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"A digital partner for frontline workers",description:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio nobis temporibus provident expedita consequuntur, repudiandae pariatur! Deleniti molestias vero, cumque vel error labore ipsam totam?"},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Feature 2 Title",description:"Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."},{id:3,image:"https://images.unsplash.com/photo-1624555130581-1d9cca783bc0",title:"Feature 3 Title",description:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate aut autem aperiam et modi saepe obcaecati doloremque voluptatem iusto quidem!"},{id:4,image:"https://images.unsplash.com/photo-1547481887-a26e2cacb5b2",title:"Feature 4 Title",description:"Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."},{id:5,image:"https://images.unsplash.com/photo-1536782376847-5c9d14d97cc0",title:"Feature 5 Title",description:"Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."},{id:6,image:"https://images.unsplash.com/photo-1490730141103-6cac27aaab94",title:"Feature 6 Title",description:"Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."}]}],a=n(6243),s=n(7598),d=n.n(s),u=n(5697),c=n(5660),v=(n(6177),n(6870));function m(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){m(r,i,o,l,a,"next",e)}function a(e){m(r,i,o,l,a,"throw",e)}l(void 0)})}}var g=e=>{var t,n,o,l,s,d,m,{config:g,t:f,isDisabled:h}=e,{data:y,isLoading:b}=Digit.Hooks.useTenants(),{data:O,isLoading:x}=Digit.Hooks.useStore.getInitData(),{stateInfo:S}=O||{},[_,j]=(0,i.useState)(null),[C,w]=(0,i.useState)(!1),N=(0,r.useNavigate)(),E=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}}),D=function(){var e=p(function*(e){var t;yield E.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,i;j({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&null!==(n=n.Errors)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.code?"SANDBOX_SIGNUP_".concat(null==e||null===(i=e.response)||void 0===i||null===(i=i.data)||void 0===i||null===(i=i.Errors)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.code):"SANDBOX_SIGNUP_ERROR"})},onSuccess:(t=p(function*(e){var t,n,i;N({pathname:"/".concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/user/otp"),state:{email:null==e||null===(n=e.Tenants[0])||void 0===n?void 0:n.email,tenant:null==e||null===(i=e.Tenants[0])||void 0===i?void 0:i.code}})}),function(e){return t.apply(this,arguments)})})});return function(t){return e.apply(this,arguments)}}(),I=[{body:null==g?void 0:g.inputs}],{mode:P}=Digit.Hooks.useQueryParams();return"admin"===P&&0==(null==I||null===(t=I[0])||void 0===t||null===(t=t.body)||void 0===t||null===(t=t[2])||void 0===t?void 0:t.disable)&&null==(null==I||null===(n=I[0])||void 0===n||null===(n=n.body)||void 0===n||null===(n=n[2])||void 0===n||null===(n=n.populators)||void 0===n?void 0:n.defaultValue)&&(I[0].body[2].disable=!0,I[0].body[2].isMandatory=!1,I[0].body[2].populators.defaultValue=defaultValue),b||x?(0,v.jsx)(a.Loader,{}):(0,v.jsxs)(u.A,{children:[(0,v.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,v.jsx)(a.BackLink,{onClick:()=>window.history.back()})}),(0,v.jsx)(a.FormComposerV2,{onSubmit:D,isDisabled:h||C,noBoxShadow:!0,inline:!0,submitInForm:!0,config:I,label:null==g||null===(o=g.texts)||void 0===o?void 0:o.submitButtonLabel,secondaryActionLabel:null==g||null===(l=g.texts)||void 0===l?void 0:l.secondaryButtonLabel,onFormValueChange:(e,t,n)=>{var i=I[0].body.map(e=>e.key).some(e=>{var n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});w(i)},heading:null==g||null===(s=g.texts)||void 0===s?void 0:s.header,className:"sandbox-signup-form",cardSubHeaderClassName:"signupCardSubHeaderClassName",cardClassName:"signupCardClassName sandbox-onboarding-wrapper",buttonClassName:"buttonClassName",children:(0,v.jsx)(c.A,{showTenant:!1})}),_&&(0,v.jsx)(a.Toast,{type:"error",label:f(null==_?void 0:_.label),onClose:()=>{j(null)}}),(0,v.jsx)("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"},children:(0,v.jsx)("img",{alt:"Powered by DIGIT",src:null===(d=window)||void 0===d||null===(d=d.globalConfigs)||void 0===d||null===(m=d.getConfig)||void 0===m?void 0:m.call(d,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})]})};g.propTypes={loginParams:d().any},g.defaultProps={loginParams:null};const f=g;function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const O=e=>{var{stateCode:t}=e,{t:n}=(0,o.useTranslation)(),[a,s]=(0,i.useState)(l),d=Digit.StoreData.getCurrentLanguage(),{data:u}=Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:d,modulePrefix:"digit"}),{data:c,isLoading:m}=Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1});(0,i.useEffect)(()=>{!m&&null!=c&&c.config?s(c.config):s(l)},[c,m]);var p=(0,i.useMemo)(()=>a.map(e=>{var t={};for(var i in e.texts)t[i]=n(e.texts[i]);return y(y({},e),{},{texts:t})}),[a]);return(0,v.jsx)(r.Routes,{children:(0,v.jsx)(r.Route,{path:"",element:(0,v.jsx)(f,{config:p[0],t:n})})})}},3333(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});var i=n(4883),o=n(6243),r=n(5953),l=n(4442),a=n(5697),s=n(5660),d=n(6177),u=n(6870);const c=()=>{var e,t,n,c,{t:v}=(0,r.useTranslation)(),m=(0,l.useLocation)(),{tenant:p}=m.state||{},g=(0,i.useRef)(null),f=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(e=e.info)||void 0===e?void 0:e.roles,[h,y]=(0,i.useState)(!0),{data:b}=Digit.Hooks.useCustomMDMS(p,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,gcTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}});(0,i.useEffect)(()=>{null!=b&&b[0].url&&y(!1)},[b]);var O=null==b?void 0:b[0].url;return(0,u.jsxs)(a.A,{children:[(0,u.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,u.jsx)(o.BackLink,{onClick:()=>window.history.back()})}),(0,u.jsxs)(o.Card,{className:"card-sandbox",children:[(0,u.jsx)(s.A,{showTenant:!1}),(0,u.jsx)("div",{className:"sandbox-success-signup",children:(0,u.jsx)(o.SVG.TickMark,{fill:"#fff",height:30,width:70})}),(0,u.jsx)(o.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"},children:v("SANDBOX_HEADER")}),(0,u.jsx)(o.CardText,{className:"cardText-sandbox",children:v("SAMDBOX_URL_SUB")}),(0,u.jsxs)(o.CardLabel,{children:[" ",v("SANDBOX_URL")," "]}),(0,u.jsxs)("div",{className:"sandbox-url-wrapper",children:[(0,u.jsx)(o.TextInput,{inputRef:g,className:"urlInputText",onChange:()=>{},nonEditable:!0,value:"".concat(window.location.host,"/").concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/").concat(p,"/employee")}),(0,u.jsx)(o.Button,{className:"copyButton",variation:"secondary",onClick:()=>{navigator.clipboard.writeText(g.current.value)},label:v("COPY_URL")})]}),(0,u.jsx)("div",{className:"sandbox-url-footer",children:v("SANDBOX_URL_FOOT")}),(0,u.jsx)(o.Button,{isDisabled:h,onClick:()=>{var e,t;((e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))})(f,b)?window.location.href="/".concat(null===(e=window)||void 0===e?void 0:e.globalPath,"/").concat(p).concat(O):window.location.href="/".concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/").concat(p,"/employee")},label:v("SIGN_IN")})]}),(0,u.jsx)("div",{className:"EmployeeLoginFooter",children:(0,u.jsx)(d.A,{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n||null===(c=n.getConfig)||void 0===c?void 0:c.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})]})}},296(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>w});var i=n(4883),o=n(5953),r=n(4442),l=n(6243),a=n(1603),s=n(6870),d=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,158)),()=>n(158).default,{loaderText:"CORE_LOADING_CHANGE_PASSWORD"}),u=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,9458)),()=>n(9458).default,{loaderText:"CORE_LOADING_FORGOT_PASSWORD"}),c=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,1234)).then(e=>({default:e.AppHome})),()=>n(1234).AppHome,{loaderText:"CORE_LOADING_HOME"}),v=(e,t)=>t.filter(t=>{var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,e=>e.code).includes(t.code)}),m=e=>{var t,n,{stateCode:i,userType:o,modules:l,appTenants:m,additionalComponent:p}=e,g=(0,r.useLocation)(),f=Digit.UserService.getUser();if(!f||null==f||!f.access_token||null==f||!f.info)return(0,s.jsx)(r.Navigate,{to:{pathname:"/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/").concat(o,"/user/login"),state:{from:g.pathname+g.search}},replace:!0});var h=null==l?void 0:l.map((e,t)=>{var{code:n,tenants:l}=e;return(0,s.jsx)(r.Route,{path:"".concat(n.toLowerCase(),"/*"),element:(0,s.jsx)(a.A,{moduleCode:n,stateCode:i,userType:o,tenants:v(l,m),maxRetries:3,retryDelay:1e3,initialDelay:800})},t)});return(0,s.jsx)("div",{className:"ground-container digit-home-ground",children:(0,s.jsxs)(r.Routes,{children:[h,(0,s.jsx)(r.Route,{path:"login",element:(0,s.jsx)(r.Navigate,{to:{pathname:"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/").concat(o,"/user/login"),state:{from:g.pathname+g.search}},replace:!0})}),(0,s.jsx)(r.Route,{path:"forgot-password",element:(0,s.jsx)(u,{})}),(0,s.jsx)(r.Route,{path:"change-password",element:(0,s.jsx)(d,{})}),(0,s.jsx)(r.Route,{path:"*",element:(0,s.jsx)(c,{userType:o,modules:l,additionalComponent:p})})]})})},p=n(4217),g=n(9536),f=n(6177),h=n(5181),y=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,158)),()=>n(158).default,{loaderText:"CORE_LOADING_CHANGE_PASSWORD"}),b=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,9458)),()=>n(9458).default,{loaderText:"CORE_LOADING_FORGOT_PASSWORD"}),O=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,5383)),()=>n(5383).default,{loaderText:"CORE_LOADING_LANGUAGE_SELECTION"}),x=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,3934)),()=>n(3934).default,{loaderText:"CORE_LOADING_LOGIN"}),S=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,1626)),()=>n(1626).default,{loaderText:"CORE_LOADING_OTP"}),_=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,855)),()=>n(855).default,{loaderText:"CORE_LOADING_USER_PROFILE"}),j=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,6340)),()=>n(6340).default,{loaderText:"CORE_LOADING_ERROR_COMPONENT"}),C=["user/landing","user/profile","user/error","user/productPage"];const w=(0,h.A)(e=>{var t,n,l,a,{stateInfo:d,userDetails:u,CITIZEN:c,cityDetails:v,mobileView:h,handleUserDropdownSelection:w,logoUrl:N,logoUrlWhite:E,stateCode:D,modules:I,appTenants:P,sourceUrl:A,pathname:T,initData:L,noTopBar:R=!1}=e,M=(0,r.useNavigate)(),{t:U}=(0,o.useTranslation)(),k=(0,r.useLocation)(),B=null==k||null===(t=k.pathname)||void 0===t?void 0:t.includes("language-selection"),F=C.some(e=>{var t;return null==k||null===(t=k.pathname)||void 0===t?void 0:t.includes(e)});(0,i.useEffect)(()=>{Digit.UserService.setType("employee")},[]);var V=null==L||null===(n=L.modules)||void 0===n||null===(n=n.filter(e=>null==e?void 0:e.additionalComponent))||void 0===n?void 0:n.map(e=>null==e?void 0:e.additionalComponent);return(0,s.jsx)("div",{className:"employee",children:(0,s.jsxs)(r.Routes,{children:[(0,s.jsx)(r.Route,{path:"user/*",element:(0,s.jsxs)(s.Fragment,{children:[F&&(0,s.jsx)(g.A,{t:U,stateInfo:d,userDetails:u,CITIZEN:c,cityDetails:v,mobileView:h,handleUserDropdownSelection:w,logoUrl:N,logoUrlWhite:E,showSidebar:!!F,showLanguageChange:!B}),(0,s.jsx)("div",{className:F?"grounded-container":"loginContainer",style:F?{padding:0,paddingTop:"0",marginLeft:"0"}:{"--banner-url":"url(".concat(null==d?void 0:d.bannerUrl,")"),padding:"0px"},children:(0,s.jsxs)(r.Routes,{children:[(0,s.jsx)(r.Route,{path:"login",element:(0,s.jsx)(x,{stateCode:D})}),(0,s.jsx)(r.Route,{path:"login/otp",element:(0,s.jsx)(S,{isLogin:!0})}),(0,s.jsx)(r.Route,{path:"forgot-password",element:(0,s.jsx)(b,{stateCode:D})}),(0,s.jsx)(r.Route,{path:"change-password",element:(0,s.jsx)(y,{})}),(0,s.jsx)(r.Route,{path:"profile",element:(0,s.jsx)(_,{stateCode:D,userType:"employee",cityDetails:v})}),(0,s.jsx)(r.Route,{path:"error",element:(0,s.jsx)(j,{initData:L,goToHome:()=>{var e,t,n;M("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/").concat(null===(t=Digit)||void 0===t||null===(t=t.UserService)||void 0===t||null===(n=t.getType)||void 0===n?void 0:n.call(t)))}})}),(0,s.jsx)(r.Route,{path:"language-selection",element:(0,s.jsx)(O,{})}),(0,s.jsx)(r.Route,{path:"*",element:(0,s.jsx)(r.Navigate,{to:"language-selection",replace:!0})})]})})]})}),(0,s.jsx)(r.Route,{path:"*",element:(0,s.jsxs)(s.Fragment,{children:[!R&&(0,s.jsx)(g.A,{t:U,stateInfo:d,userDetails:u,CITIZEN:c,cityDetails:v,mobileView:h,handleUserDropdownSelection:w,logoUrl:N,logoUrlWhite:E,modules:I}),(0,s.jsxs)("div",{className:R?"":"main digit-home-main",children:[(0,s.jsx)("div",{className:"employee-app-wrapper digit-home-app-wrapper",children:(0,s.jsx)(p.A,{initData:L,children:(0,s.jsx)(m,{stateCode:D,userType:"employee",modules:I,appTenants:P,additionalComponent:V})})}),(0,s.jsx)("div",{className:"employee-home-footer",children:(0,s.jsx)(f.A,{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(l=l.globalConfigs)||void 0===l||null===(a=l.getConfig)||void 0===a?void 0:a.call(l,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})]})]})}),(0,s.jsx)(r.Route,{path:"*",element:(0,s.jsx)(r.Navigate,{to:"user/language-selection",replace:!0})})]})})},".digit-home-main")},2161(e,t){"use strict";t.Y=function(e,t){return function(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),r=t[1],l=t[2],a=t[3]||"",s={};return s.inverse=!!r&&"not"===r.toLowerCase(),s.type=l?l.toLowerCase():"all",a=a.match(/\([^\)]+\)/g)||[],s.expressions=a.map(function(e){var t=e.match(i),n=t[1].toLowerCase().match(o);return{modifier:n[1],feature:n[2],value:t[2]}}),s})}(e).some(function(e){var n=e.inverse,i="all"===e.type||t.type===e.type;if(i&&n||!i&&!n)return!1;var o=e.expressions.every(function(e){var n=e.feature,i=e.modifier,o=e.value,r=t[n];if(!r)return!1;switch(n){case"orientation":case"scan":return r.toLowerCase()===o.toLowerCase();case"width":case"height":case"device-width":case"device-height":o=d(o),r=d(r);break;case"resolution":o=s(o),r=s(r);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":o=a(o),r=a(r);break;case"grid":case"color":case"color-index":case"monochrome":o=parseInt(o,10)||1,r=parseInt(r,10)||0}switch(i){case"min":return r>=o;case"max":return r<=o;default:return r===o}});return o&&!n||!o&&n})};var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,i=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,o=/^(?:(min|max)-)?(.+)/,r=/(em|rem|px|cm|mm|in|pt|pc)?$/,l=/(dpi|dpcm|dppx)?$/;function a(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function s(e){var t=parseFloat(e);switch(String(e).match(l)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function d(e){var t=parseFloat(e);switch(String(e).match(r)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},8320(e,t,n){"use strict";var i=n(2161).Y,o="undefined"!=typeof window?window.matchMedia:null;function r(e,t,n){var r,l=this;function a(e){l.matches=e.matches,l.media=e.media}o&&!n&&(r=o.call(window,e)),r?(this.matches=r.matches,this.media=r.media,r.addListener(a)):(this.matches=i(e,t),this.media=e),this.addListener=function(e){r&&r.addListener(e)},this.removeListener=function(e){r&&r.removeListener(e)},this.dispose=function(){r&&r.removeListener(a)}}e.exports=function(e,t,n){return new r(e,t,n)}},856(e,t,n){"use strict";var i=n(7183);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,l){if(l!==i){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:r,resetWarningCache:o};return n.PropTypes=n,n}},7598(e,t,n){e.exports=n(856)()},7183(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8854(e,t,n){"use strict";n.d(t,{Ay:()=>C});var i=n(4883),o=n(8320),r=n.n(o),l=/[A-Z]/g,a=/^ms-/,s={};function d(e){return"-"+e.toLowerCase()}const u=function(e){if(s.hasOwnProperty(e))return s[e];var t=e.replace(l,d);return s[e]=a.test(t)?"-"+t:t};var c=n(7598),v=n.n(c);const m=v().oneOfType([v().string,v().number]),p={all:v().bool,grid:v().bool,aural:v().bool,braille:v().bool,handheld:v().bool,print:v().bool,projection:v().bool,screen:v().bool,tty:v().bool,tv:v().bool,embossed:v().bool},g={orientation:v().oneOf(["portrait","landscape"]),scan:v().oneOf(["progressive","interlace"]),aspectRatio:v().string,deviceAspectRatio:v().string,height:m,deviceHeight:m,width:m,deviceWidth:m,color:v().bool,colorIndex:v().bool,monochrome:v().bool,resolution:m,type:Object.keys(p)},{type:f,...h}=g,y={minAspectRatio:v().string,maxAspectRatio:v().string,minDeviceAspectRatio:v().string,maxDeviceAspectRatio:v().string,minHeight:m,maxHeight:m,minDeviceHeight:m,maxDeviceHeight:m,minWidth:m,maxWidth:m,minDeviceWidth:m,maxDeviceWidth:m,minColor:v().number,maxColor:v().number,minColorIndex:v().number,maxColorIndex:v().number,minMonochrome:v().number,maxMonochrome:v().number,minResolution:m,maxResolution:m,...h};var b={all:{...p,...y},types:p,matchers:g,features:y};const O=(0,i.createContext)(void 0),x=e=>{if(e)return Object.keys(e).reduce((t,n)=>(t[u(n)]=e[n],t),{})},S=()=>{const e=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{e.current=!0},[]),e.current},_=e=>{const t=()=>(e=>e.query||(e=>{const t=[];return Object.keys(b.all).forEach(n=>{const i=e[n];null!=i&&t.push(((e,t)=>{const n=u(e);return"number"==typeof t&&(t=`${t}px`),!0===t?n:!1===t?`not ${n}`:`(${n}: ${t})`})(n,i))}),t.join(" and ")})(e))(e),[n,o]=(0,i.useState)(t);return(0,i.useEffect)(()=>{const e=t();n!==e&&o(e)},[e]),n},j=(e,t,n)=>{const o=(e=>{const t=(0,i.useContext)(O),n=()=>x(e)||x(t),[o,r]=(0,i.useState)(n);return(0,i.useEffect)(()=>{const e=n();(function(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),i=Object.keys(t),o=n.length;if(i.length!==o)return!1;for(let i=0;i<o;i++){const o=n[i];if(e[o]!==t[o]||!Object.prototype.hasOwnProperty.call(t,o))return!1}return!0})(o,e)||r(e)},[e,t]),o})(t),l=_(e);if(!l)throw new Error("Invalid or missing MediaQuery!");const a=((e,t)=>{const n=()=>r()(e,t||{},!!t),[o,l]=(0,i.useState)(n),a=S();return(0,i.useEffect)(()=>{if(a){const e=n();return l(e),()=>{e&&e.dispose()}}},[e,t]),o})(l,o),s=(e=>{const[t,n]=(0,i.useState)(e.matches);return(0,i.useEffect)(()=>{const t=e=>{n(e.matches)};return e.addListener(t),n(e.matches),()=>{e.removeListener(t)}},[e]),t})(a),d=S();return(0,i.useEffect)(()=>{d&&n&&n(s)},[s]),(0,i.useEffect)(()=>()=>{a&&a.dispose()},[]),s},C=({children:e,device:t,onChange:n,...i})=>{const o=j(i,t,n);return"function"==typeof e?e(o):o?e:null}},3060(e,t){"use strict";var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function o(e,t,i){var o=null;if(void 0!==i&&(o=""+i),void 0!==t.key&&(o=""+t.key),"key"in t)for(var r in i={},t)"key"!==r&&(i[r]=t[r]);else i=t;return t=i.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:i}}t.Fragment=i,t.jsx=o,t.jsxs=o},6870(e,t,n){"use strict";e.exports=n(3060)},6243(t){"use strict";t.exports=e},5053(e){"use strict";e.exports=a},338(e){"use strict";e.exports=l},4456(e){"use strict";e.exports=i},4883(e){"use strict";e.exports=t},5953(e){"use strict";e.exports=n},2148(e){"use strict";e.exports=o},4442(e){"use strict";e.exports=r},1954(e){"use strict";e.exports=s},2247(e){"use strict";e.exports=d}},c={};function v(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return u[e](n,n.exports,v),n.exports}v.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return v.d(t,{a:t}),t},v.d=(e,t)=>{for(var n in t)v.o(t,n)&&!v.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},v.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),v.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var m={};return(()=>{"use strict";v.r(m),v.d(m,{DigitUI:()=>K,initCoreComponents:()=>$});var e=v(6243),t=v(4883),n=v.n(t),i=v(5953),o=v(4456),r=v(2148),l=v(4442),a=v(6870);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,7155)),()=>v(7155).default,{loaderText:"CORE_LOADING_CITIZEN_APP"}),p=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,296)),()=>v(296).default,{loaderText:"CORE_LOADING_EMPLOYEE_APP"}),g=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,8259)),()=>v(8259).default,{loaderText:"CORE_LOADING_SIGN_UP"}),f=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,1626)),()=>v(1626).default,{loaderText:"CORE_LOADING_OTP"}),h=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,3333)),()=>v(3333).default,{loaderText:"CORE_LOADING_VIEW_URL"}),y=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,883)),()=>v(883).default,{loaderText:"CORE_LOADING_ERROR_COMPONENT"}),b=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,9546)),()=>v(9546).default,{loaderText:"CORE_LOADING"}),O=e=>{var t,n,i,o,r,{stateCode:s,modules:u,appTenants:v,logoUrl:m,logoUrlWhite:g,initData:f,defaultLanding:h="citizen",allowedUserTypes:y=["citizen","employee"]}=e,{pathname:b}=((0,l.useNavigate)(),(0,l.useLocation)()),O=window.innerWidth,x=Digit.ULBService.getCurrentUlb(),S=Digit.UserService.getUser(),{data:_}=Digit.Hooks.useStore.getInitData(),{stateInfo:j}=_||{},C=Digit.UserService.hasAccess(["FSM_DSO"]),w="CITIZEN"===(null==S||null===(t=S.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(w=!1);var N={stateInfo:j,userDetails:S,CITIZEN:w,cityDetails:x,mobileView:O<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:m,logoUrlWhite:g,DSO:C,stateCode:s,modules:u,appTenants:v,sourceUrl:"".concat(window.location.origin,"/citizen"),pathname:b,initData:f};return(0,a.jsxs)(l.Routes,{children:[(null==y?void 0:y.includes("employee"))&&(0,a.jsx)(l.Route,{path:"/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/employee/*"),element:(0,a.jsx)(p,d({},N))}),(null==y?void 0:y.includes("citizen"))&&(0,a.jsx)(l.Route,{path:"/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/citizen/*"),element:(0,a.jsx)(c,d({},N))}),(null==y?void 0:y.includes("employee"))&&(0,a.jsx)(l.Route,{path:"/".concat(null===(o=window)||void 0===o?void 0:o.contextPath,"/no-top-bar/employee"),element:(0,a.jsx)(p,d(d({},N),{},{noTopBar:!0}))}),(0,a.jsx)(l.Route,{path:"*",element:(0,a.jsx)(l.Navigate,{to:"/".concat(null===(r=window)||void 0===r?void 0:r.contextPath,"/").concat(h)})})]})},x=e=>{var t,n,i,o,r,s,d,u,c,v,{stateCode:m,modules:p,appTenants:x,logoUrl:S,logoUrlWhite:_,initData:j,defaultLanding:C="citizen",allowedUserTypes:w}=e,{data:N}=Digit.Hooks.useStore.getInitData(),{stateInfo:E}=N||{},D=["user/error"].some(e=>{var t;return null===(t=location)||void 0===t||null===(t=t.pathname)||void 0===t?void 0:t.includes(e)}),I=Digit.UserService.getUser(),P="CITIZEN"===(null==I||null===(t=I.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee"),A=window.innerWidth<=640;return(0,a.jsx)("div",{className:D?"grounded-container":"loginContainer",style:D?{padding:0,paddingTop:P?"0":A&&!P?"3rem":"80px",marginLeft:P||A?"0":"40px"}:{"--banner-url":"url(".concat(null==E?void 0:E.bannerUrl,")"),padding:"0px"},children:(0,a.jsxs)(l.Routes,{children:[(0,a.jsx)(l.Route,{path:"/".concat(null===(n=window)||void 0===n?void 0:n.globalPath,"/user/invalid-url"),element:(0,a.jsx)(y,{})}),(0,a.jsx)(l.Route,{path:"/".concat(null===(i=window)||void 0===i?void 0:i.globalPath,"/user/sign-up"),element:(0,a.jsx)(g,{stateCode:m})}),(0,a.jsx)(l.Route,{path:"/".concat(null===(o=window)||void 0===o?void 0:o.globalPath,"/user/otp"),element:(0,a.jsx)(f,{})}),(0,a.jsx)(l.Route,{path:"/".concat(null===(r=window)||void 0===r?void 0:r.globalPath,"/user/setup"),element:(0,a.jsx)(b,{})}),(0,a.jsx)(l.Route,{path:"/".concat(null===(s=window)||void 0===s?void 0:s.globalPath,"/user/url"),element:(0,a.jsx)(h,{})}),(null===(d=window)||void 0===d?void 0:d.globalPath)!==(null===(u=window)||void 0===u?void 0:u.contextPath)&&(0,a.jsx)(l.Route,{path:"/".concat(null===(c=window)||void 0===c?void 0:c.contextPath,"/*"),element:(0,a.jsx)(O,{stateCode:m,modules:p,appTenants:x,logoUrl:S,logoUrlWhite:_,initData:j,defaultLanding:C,allowedUserTypes:w})}),(0,a.jsx)(l.Route,{path:"*",element:(0,a.jsx)(l.Navigate,{to:"/".concat(null===(v=window)||void 0===v?void 0:v.globalPath,"/user/sign-up")})})]})})},S=v(743),_=v(358),j=v(3015),C=v(4217),w=v(1954),N=v(2247);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function I(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function A(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=[v.n(N)()],L=(0,w.compose)((0,w.applyMiddleware)(...T));const R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,w.createStore)(((e,t)=>{return(0,w.combineReducers)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach(function(t){A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({common:(n=e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=arguments.length>1?arguments[1]:void 0;return"LANGUAGE_SELECT"===t.type?D(D({},e),{},{selectedLanguage:t.payload}):e})},t));var n})(e,t),L)};var M=v(5053),U=["onSelect","formData","control","formState"];const k=o=>{var{onSelect:r,formData:l,control:s,formState:d}=o,u=function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(o,U),{t:c}=(0,i.useTranslation)(),v=Digit.ULBService.getCurrentTenantId(),[m,p]=(0,t.useState)(!1),[g,f]=(0,t.useState)(!1),h=Digit.Utils.getConfigModuleName(),{data:y}=Digit.Hooks.useCustomMDMS(v,h,[{name:"PrivacyPolicy"}],{select:e=>{var t;return null==e||null===(t=e[h])||void 0===t||null===(t=t.PrivacyPolicy)||void 0===t?void 0:t.find(e=>{var t;return e.module===(null==u||null===(t=u.props)||void 0===t?void 0:t.module)})}});return(0,t.useEffect)(()=>{r("check",m)},[m]),(0,a.jsxs)(n().Fragment,{children:[(0,a.jsxs)("div",{className:"digit-privacy-checkbox digit-privacy-checkbox-align",children:[(0,a.jsx)(e.CheckBox,{label:c("ES_BY_CLICKING"),checked:m,onChange:e=>{p(e.target.checked)},id:"privacy-component-check"}),(0,a.jsx)(e.Button,{label:c("ES_PRIVACY_POLICY"),variation:"link",size:"small",onClick:()=>{f(!0)},style:{marginBottom:"1rem",paddingLeft:"0.2rem"}})]}),g&&(0,a.jsxs)(e.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:c(null==y?void 0:y.header),onOverlayClick:()=>{f(!1)},footerChildren:[(0,a.jsx)(e.Button,{type:"button",size:"large",variation:"secondary",label:c("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{p(!1),f(!1)}}),(0,a.jsx)(e.Button,{type:"button",size:"large",variation:"primary",label:c("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{p(!0),f(!1)}})],sortFooterChildren:!0,onClose:()=>{f(!1)},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"privacy-table",children:c("DIGIT_TABLE_OF_CONTENTS")}),(0,a.jsx)("ul",{children:null==y?void 0:y.contents.map((t,n)=>(0,a.jsxs)("li",{style:{display:"flex",alignItems:"center"},children:[(0,a.jsxs)("span",{style:{marginRight:"0.5rem"},children:[n+1,". "]}),(0,a.jsx)(e.Button,{label:c(t.header),variation:"link",size:"medium",onClick:e=>{var n,i;e.preventDefault(),n=null==t?void 0:t.header,(i=document.getElementById(n))&&i.scrollIntoView({behavior:"smooth"})},style:{justifyContent:"flex-start"}})]},n))})]}),null==y?void 0:y.contents.map((e,t)=>(0,a.jsxs)("div",{id:null==e?void 0:e.header,children:[(0,a.jsx)("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"},children:c(e.header)}),e.descriptions.map((e,t)=>(0,a.jsxs)("div",{style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"},children:[(0,a.jsxs)("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"},children:["points"===e.type&&(0,a.jsx)("span",{style:{marginRight:"0.5rem",listStyleType:"disc"},children:"•"}),"step"===e.type&&(0,a.jsxs)("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"},children:[t+1,". "]}),c(e.text)]}),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&(0,a.jsx)("div",{className:"policy-subdescription",children:e.subDescriptions.map((e,t)=>(0,a.jsxs)("div",{className:"policy-subdescription-points",children:["points"===e.type&&(0,a.jsx)("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"},children:"•"}),"step"===e.type&&(0,a.jsxs)("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"},children:[t+1,". "]}),null===e.type&&(0,a.jsx)("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"},children:" "}),c(e.text)]},t))})]},t))]},t))]})]})};var B=v(4989),F=(v(5697),["onSelect","formData","control","formState"]);function V(e,t,n,i,o,r,l){try{var a=e[r](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(i,o)}function G(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function l(e){V(r,i,o,l,a,"next",e)}function a(e){V(r,i,o,l,a,"throw",e)}l(void 0)})}}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){H(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function H(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var q=["onSelect","formData","control","formState"];function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Z(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Y=t=>{var n,o,s,{stateCode:d,enabledModules:u,defaultLanding:c,allowedUserTypes:v}=t,{isLoading:m,data:p={}}=Digit.Hooks.useInitStore(d,u);if(m)return(0,a.jsx)(e.Loader,{page:!0,variant:"PageLoader"});var g=R(p)||{};return(0,i.getI18n)(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",k),(0,a.jsx)(r.Provider,{store:g,children:(0,a.jsx)(l.BrowserRouter,{children:(0,a.jsx)(e.BodyContainer,{children:Digit.Utils.getMultiRootTenant()?(0,a.jsx)(x,{initData:p,stateCode:d,modules:null==p?void 0:p.modules,appTenants:p.tenants,logoUrl:null==p||null===(n=p.stateInfo)||void 0===n?void 0:n.logoUrl,logoUrlWhite:null==p||null===(o=p.stateInfo)||void 0===o?void 0:o.logoUrlWhite,defaultLanding:c,allowedUserTypes:v}):(0,a.jsx)(O,{initData:p,stateCode:d,modules:null==p?void 0:p.modules,appTenants:p.tenants,logoUrl:null==p||null===(s=p.stateInfo)||void 0===s?void 0:s.logoUrl,defaultLanding:c,allowedUserTypes:v})})})})},K=e=>{var{stateCode:n,registry:i,enabledModules:r,defaultLanding:l,allowedUserTypes:s}=e,d=(0,t.useMemo)(()=>Digit.Utils.getPrivacyObject()||{},[]),[u,c]=(0,t.useState)(d),v=(Digit.UserService.getType(),(0,t.useMemo)(()=>new o.QueryClient({defaultOptions:{queries:{staleTime:9e5,gcTime:3e6,retry:!1,retryDelay:e=>1/0}}}),[])),m=Digit.Contexts.ComponentProvider,p=Digit.Contexts.PrivacyProvider,g=(Digit.UserService.hasAccess(["FSM_DSO"]),(0,t.useCallback)(e=>{Digit.Utils.setPrivacyObject({}),c({})},[])),f=(0,t.useCallback)(()=>{var e=Digit.Utils.getPrivacyObject();return c(e),e},[]),h=(0,t.useCallback)(e=>{var t=Digit.Utils.getAllPrivacyObject(),n="undefined"!=typeof window?window.location.pathname:"",i=Q(Q({},t),{},{[n]:e});Digit.Utils.setPrivacyObject(Q({},i)),c((null==t?void 0:t[n])||{})},[]),y=(0,t.useCallback)((e,t)=>{c(Digit.Utils.updatePrivacy(e,t)||{})},[]),b=(0,t.useMemo)(()=>({privacy:"undefined"!=typeof window?null==u?void 0:u[window.location.pathname]:u,resetPrivacy:g,getPrivacy:f,updatePrivacyDescoped:h,updatePrivacy:y}),[u,g,f,h,y]);return(0,a.jsx)("div",{children:(0,a.jsx)(C.A,{children:(0,a.jsx)(o.QueryClientProvider,{client:v,children:(0,a.jsx)(m.Provider,{value:i,children:(0,a.jsx)(p.Provider,{value:b,children:(0,a.jsx)(Y,{stateCode:n,enabledModules:r,defaultLanding:l,allowedUserTypes:s})})})})})})},J={SelectOtp:S.A,ChangeCity:_.A,ChangeLanguage:j.A,PrivacyComponent:k,OtpComponent:n=>{var o,r,{onSelect:s,formData:d,control:u,formState:c}=n,v=function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,F),{t:m}=(0,i.useTranslation)(),[p,g]=((0,l.useLocation)(),(0,t.useState)(null)),[f,h]=(0,t.useState)({}),[y,b]=(0,t.useState)(!0),[O,x]=(0,t.useState)(30),S=()=>{g(null)};(0,B.A)(()=>{x(O-1)},O>0?1e3:null),(0,t.useEffect)(()=>{s("OtpComponent",f)},[f]);var _={url:"/user-otp/v1/_send",params:{tenantId:null==v||null===(o=v.props)||void 0===o?void 0:o.code},body:{},config:{enable:!1}},j=Digit.Hooks.useCustomAPIMutationHook(_),C=function(){var e=G(function*(){var e,t,n;x(30),yield j.mutate({body:{otp:{userName:null==v||null===(e=v.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==v||null===(t=v.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,i;g({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&null!==(n=n.Errors)&&void 0!==n&&n[0].code?"SANDBOX_RESEND_OTP".concat(null==e||null===(i=e.response)||void 0===i||null===(i=i.data)||void 0===i||null===(i=i.Errors)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(S,5e3)},onSuccess:(n=G(function*(e){g({key:"info",label:m("OTP_RESNED_SUCCESFULL")}),setTimeout(S,5e3)}),function(e){return n.apply(this,arguments)})})});return function(){return e.apply(this,arguments)}}();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(e.CardLabel,{className:"sandbox-custom-otp-subheader",children:m("SANDBOX_ENTER_OTP")}),(0,a.jsx)(e.CardLabel,{className:"sandbox-custom-otp-header",children:m("CS_OTP_EMAIL")}),(0,a.jsx)(e.CardLabel,{className:"sandbox-custom-otp-email",style:{fontWeight:"bold"},children:null==v||null===(r=v.props)||void 0===r?void 0:r.email}),(0,a.jsx)(M.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{h(W(W({},f),{},{otp:e}))},value:null==f?void 0:f.otp}),O>0?(0,a.jsx)(e.CardText,{className:"sandbox-resend-otp",children:"".concat(m("CS_RESEND_ANOTHER_OTP")," ").concat(O," ").concat(m("CS_RESEND_SECONDS"))}):(0,a.jsx)("p",{className:"card-text-button sandbox-otp-input",onClick:C,children:m("CS_RESEND_OTP")}),!y&&(0,a.jsx)(e.CardLabelError,{children:m("CS_INVALID_OTP")}),p&&(0,a.jsx)(e.Toast,{type:null==p?void 0:p.key,label:m(null==p?void 0:p.label),onClose:S})]})},ForgotOrganizationTooltip:n=>{var{onSelect:o}=n,{t:r}=(0,i.useTranslation)(),[l,s]=(0,t.useState)(!1),d=(0,t.useRef)(null);return(0,t.useEffect)(()=>{var e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,a.jsxs)("div",{ref:d,className:"loginSignUpSelector",style:{position:"relative",marginTop:"-2rem"},children:[(0,a.jsx)(e.Button,{label:r("SB_FORGOTORGANIZATION_TOOLTIP"),variation:"link",size:"small",onClick:()=>s(e=>!e),style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}),l&&(0,a.jsx)("div",{style:{position:"absolute",bottom:"100%",left:"50%",transform:"translateY(-4px)",backgroundColor:"#0b4b66",color:"white",padding:"6px 10px",borderRadius:"4px",whiteSpace:"normal",wordBreak:"break-word",maxWidth:"20rem",zIndex:1e3,fontSize:"0.875rem"},children:r("SB_FORGOTORGANIZATION_TOOLTIP_TEXT")})]})},LoginSignupSelector:o=>{var{onSelect:r,formData:l,control:s,formState:d}=o,{t:u}=(function(e,t){if(null==e)return{};var n,i,o=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}(o,q),(0,i.useTranslation)()),[c,v]=(0,t.useState)(!0);(0,t.useEffect)(()=>{r("check",c)},[c]);var m=window.location.href.includes("sandbox-ui/user/sign-up");return(0,a.jsx)(n().Fragment,{children:(0,a.jsx)("div",{className:"loginSignUpSelector",style:{marginTop:"-2rem"},children:m?(0,a.jsx)(e.Button,{label:u("SB_ALREADY_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/user/login"))},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}):(0,a.jsx)(e.Button,{label:u("SB_DONT_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/user/sign-up"))},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}})})})}},$=()=>{Object.entries(J).forEach(e=>{var[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})}})(),m})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@egovernments/digit-ui-components"),require("React"),require("react-i18next"),require("@tanstack/react-query"),require("react-redux"),require("react-router-dom"),require("@egovernments/digit-ui-svg-components"),require("@egovernments/digit-ui-react-components"),require("redux"),require("redux-thunk")):"function"==typeof define&&define.amd?define(["@egovernments/digit-ui-components","React","react-i18next","@tanstack/react-query","react-redux","react-router-dom","@egovernments/digit-ui-svg-components","@egovernments/digit-ui-react-components","redux","redux-thunk"],t):"object"==typeof exports?exports["@egovernments/digit-ui-module-core"]=t(require("@egovernments/digit-ui-components"),require("React"),require("react-i18next"),require("@tanstack/react-query"),require("react-redux"),require("react-router-dom"),require("@egovernments/digit-ui-svg-components"),require("@egovernments/digit-ui-react-components"),require("redux"),require("redux-thunk")):e["@egovernments/digit-ui-module-core"]=t(e["@egovernments/digit-ui-components"],e.React,e["react-i18next"],e["@tanstack/react-query"],e["react-redux"],e["react-router-dom"],e["@egovernments/digit-ui-svg-components"],e["@egovernments/digit-ui-react-components"],e.redux,e["redux-thunk"])}(this,(e,t,n,r,i,o,l,a,s,u)=>(()=>{var c={5697(e,t,n){"use strict";n.d(t,{A:()=>i}),n(4883);var r=n(6870);const i=e=>{var t=e.children;return(0,r.jsx)("div",{className:"banner banner-container",children:t})}},358(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(6243),i=n(4883),o=n(4442),l=n(6870);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.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)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(""==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};const c=e=>{var t,n,s=a((0,i.useState)(null),2),c=s[0],d=s[1],v=a((0,i.useState)([]),2),m=v[0],f=v[1],p=a((0,i.useState)([]),2),g=(p[0],p[1],(0,o.useNavigate)()),y=(e.dropdown,Digit.Utils.getMultiRootTenant());return(0,i.useEffect)(()=>{var e,t=Digit.SessionStorage.get("citizen.userRequestObject"),n=[],r=[];null==t||null===(e=t.info)||void 0===e||null===(e=e.roles)||void 0===e||e.forEach(e=>n.push(e.tenantId));var i=n.filter((e,t,n)=>n.indexOf(e)===t);null==i||i.forEach(e=>{var t;r.push({label:"TENANT_TENANTS_".concat(null===(t=u(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),null==r||r.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),f(r)},[c]),(0,l.jsx)("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{},children:y&&1==m.length?(0,l.jsx)(r.CardText,{style:{color:"#363636"},children:null==m||null===(t=m[0])||void 0===t?void 0:t.value}):(0,l.jsx)(r.Dropdown,{t:null==e?void 0:e.t,option:m,selected:m.find(e=>e.value===(null==c?void 0:c.value)),optionKey:"label",select:e=>{var t,n,r,i=Digit.SessionStorage.get("citizen.userRequestObject"),o=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(t=t.info)||void 0===t||null===(t=t.roles)||void 0===t?void 0:t.filter(t=>t.tenantId===e.value);if((null==o?void 0:o.length)>0&&(i.info.roles=o,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),d(e),"undefined"!=typeof window&&null!==(n=window.location)&&void 0!==n&&null!==(n=n.href)&&void 0!==n&&n.includes("/".concat(null===(r=window)||void 0===r?void 0:r.contextPath,"/employee/"))){var l,a,s=(null===(l=location.state)||void 0===l?void 0:l.from)||"/".concat(null===(a=window)||void 0===a?void 0:a.contextPath,"/employee");g(s,{replace:!0})}try{"undefined"!=typeof window&&window.location.reload()}catch(e){console.warn("Failed to reload page:",e)}},freeze:!0,customSelector:(0,l.jsx)("label",{className:"cp",children:null==e?void 0:e.t("TENANT_TENANTS_".concat(null===(n=u(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===n?void 0:n.toUpperCase()))})})})}},3015(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(6243),i=n(4883),o=n.n(i),l=n(5953),a=n(6870);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const u=e=>{var t,n,u,c=e.dropdown||!1,d=Digit.Hooks.useStore.getInitData(),v=d.data,m=d.isLoading,f=v||{},p=f.languages,g=f.stateInfo,y=(0,l.useTranslation)().t,h=Digit.StoreData.getCurrentLanguage(),b=(n=(0,i.useState)(h),u=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(n,u)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.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)?s(e,t):void 0}}(n,u)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),O=b[0],x=b[1],S=e=>{x(e.value),Digit.LocalizationService.changeLanguage(e.value,g.code)};return m?null:c?(0,a.jsx)("div",{children:(0,a.jsx)(r.Dropdown,{className:"language-dropdown",option:p,selected:null==p?void 0:p.find(e=>(null==e?void 0:e.value)===h),optionKey:"label",select:S,freeze:!0,customSelector:(0,a.jsx)("label",{className:"cp",children:y(null==p||null===(t=p.find(e=>(null==e?void 0:e.value)===O))||void 0===t?void 0:t.label)})})}):(0,a.jsxs)(o().Fragment,{children:[(0,a.jsx)("div",{style:{marginBottom:"5px"},children:"Language"}),(0,a.jsx)("div",{className:"language-selector",children:p.map((e,t)=>(0,a.jsx)("div",{className:"language-button-container",children:(0,a.jsx)(r.Button,{label:e.label,onClick:()=>S(e),variation:e.value===O?"primary":""})},t))})]})}},883(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>u}),n(4883);var r=n(5953),i=n(4442),o=n(5697),l=n(6243),a=n(5660),s=n(6870);const u=e=>{(0,i.useLocation)().state;var t=(0,r.useTranslation)().t,n=(e.stateInfo,(0,i.useNavigate)()),u={imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoHeader:"WRONG_TENANT_SIGN_UP",infoMessage:"WRONG_TENANT_SIGN_UP_MESSAGE",buttonInfo:"WRONG_TENANT_SIGN_UP_BUTTON",action:()=>{n("/".concat(window.globalPath,"/"))}};return(0,s.jsx)(o.A,{children:(0,s.jsxs)(l.Card,{className:"digit-employee-card customError",children:[(0,s.jsx)(a.A,{showTenant:!1}),(0,s.jsx)(l.CardHeader,{className:"center",children:t(u.infoHeader)}),(0,s.jsx)(l.CardText,{className:"center",children:t(u.infoMessage)}),(0,s.jsx)(l.Button,{className:"customErrorButton",label:t(null==u?void 0:u.buttonInfo),variation:"primary",isSuffix:!0,onClick:e=>{e.preventDefault(),null==u||u.action()}})]})})}},6810(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(6243),i=(n(4883),n(5953)),o=n(6870);const l=e=>{var t=e.onSelect,n=e.onCancel,l=e.onDismiss,a=e.PopupStyles,s=e.isDisabled,u=e.hideSubmit,c=(0,i.useTranslation)().t,d=[(0,o.jsx)("div",{children:(0,o.jsxs)(r.CardText,{children:[c("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",(0,o.jsx)("strong",{children:c("CORE_LOGOUT_MESSAGE")})]})})],v=[(0,o.jsx)(r.Button,{type:"button",size:"large",variation:"secondary",label:c("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:n}),(0,o.jsx)(r.Button,{type:"button",size:"large",variation:"primary",label:c("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:t,isDisabled:s})],m=[(0,o.jsx)(r.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:c("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:n})];return(0,o.jsx)(r.PopUp,{type:"default",children:d,heading:c("CORE_LOGOUT_WEB_HEADER"),footerChildren:u?m:v,sortFooterButtons:!0,onClose:l,className:"digit-logout-popup-wrapper",onOverlayClick:l,equalWidthButtons:!0,style:a})}},9546(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(4883),i=n(338),o=n(4442),l=n(5953),a=n(6870);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.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)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const c=()=>{var e,t=s((0,r.useState)(0),2),n=t[0],u=t[1],c=(0,o.useNavigate)(),d=(0,o.useLocation)(),v=(0,l.useTranslation)().t,m=(d.state||{}).tenant,f=["SANDBOX_GUIDE_SETUP_ACCOUNT","SANDBOX_GUIDE_DEFAULT_MASTER_DATA","SANDBOX_GUIDE_CONFIGURING_COMPLAINTS","SANDBOX_GUIDE_CONFIGURING_EMPLOYEE_MANAGEMENT","SANDBOX_GUIDE_SETTING_UP_CITIZEN_PORTAL","SANDBOX_GUIDE_SETTING_UP_EMPLOYEE_PORTAL","SANDBOX_GUIDE_LOADING_CONFIGURATION_INTERFACE","SANDBOX_GUIDE_CREATING_DASHBOARD","SANDBOX_GUIDE_ALL_SETUP_DONE"];(0,r.useEffect)(()=>{var e=setInterval(()=>{n<f.length&&u(e=>e+1)},2e3);if(n===f.length){var t;clearInterval(e),"undefined"!=typeof window&&(null===(t=window)||void 0===t||t.globalPath);var r=setTimeout(()=>{var e,t;O(p,h)?c({pathname:"/".concat(null===(e=window)||void 0===e?void 0:e.globalPath,"/").concat(m).concat(b),state:{tenant:m}}):c({pathname:"/".concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/").concat(m,"/employee"),state:{tenant:m}})},1e3);return()=>clearTimeout(r)}return()=>{clearInterval(e)}},[n]),(0,r.useRef)(null);var p=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(e=e.info)||void 0===e?void 0:e.roles,g=s((0,r.useState)(!0),2),y=(g[0],g[1]),h=Digit.Hooks.useCustomMDMS(m,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}}).data;(0,r.useEffect)(()=>{null!=h&&h[0].url&&y(!1)},[h]);var b=null==h?void 0:h[0].url,O=(e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))};return(0,a.jsxs)("div",{className:"sandbox-loader-screen",children:[(0,a.jsx)("div",{className:"sandbox-loader"}),(0,a.jsx)("ul",{className:"sandbox-installation-steps",children:f.map((e,t)=>(0,a.jsxs)("li",{className:"sandbox-step ".concat(t<n?"sandbox-visible":""),children:[(0,a.jsx)("span",{className:"sandbox-step-text",children:v(e)}),t<n&&(0,a.jsx)(i.CheckCircle,{fill:"#00703C"})]},t))})]})}},1603(e,t,n){"use strict";n.d(t,{A:()=>m});var r=n(4883),i=n(4442),o=n(6243),l=n(5953),a=n(6870);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const m=e=>{var t,n,s,c=e.moduleCode,m=e.stateCode,f=e.userType,p=e.tenants,g=e.maxRetries,y=void 0===g?5:g,h=e.retryDelay,b=void 0===h?1500:h,O=e.initialDelay,x=void 0===O?100:O,S=(n=(0,r.useState)({module:null,loading:!0,error:null,retryCount:0,initialDelayComplete:!1}),s=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(n,s)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.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,t):void 0}}(n,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=S[0],j=S[1],_=(0,l.useTranslation)().t;if((0,r.useEffect)(()=>{var e,t,n=function(){var t,r=(t=function*(){try{var t=Digit.ComponentRegistryService.getComponent("".concat(c,"Module"));if(t)j({module:t,loading:!1,error:null,retryCount:0,initialDelayComplete:!0});else if(w.retryCount<y){j(e=>u(u({},e),{},{retryCount:e.retryCount+1}));var r=b*Math.pow(1.5,w.retryCount);e=setTimeout(()=>{n()},r)}else j({module:null,loading:!1,error:'Module "'.concat(c,'" not found after ').concat(y," attempts"),retryCount:w.retryCount,initialDelayComplete:!0})}catch(e){console.error("Error loading module ".concat(c,":"),e),j({module:null,loading:!1,error:e.message,retryCount:w.retryCount,initialDelayComplete:!0})}},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function l(e){d(o,r,i,l,a,"next",e)}function a(e){d(o,r,i,l,a,"throw",e)}l(void 0)})});return function(){return r.apply(this,arguments)}}();return w.initialDelayComplete?n():t=setTimeout(()=>{j(e=>u(u({},e),{},{initialDelayComplete:!0})),n()},x),()=>{e&&clearTimeout(e),t&&clearTimeout(t)}},[c,w.retryCount,w.initialDelayComplete,y,b,x]),w.loading){var C=w.initialDelayComplete?_("CORE_LOADING_MODULE",{moduleCode:c,defaultValue:"Loading {{moduleCode}} module..."}):_("CORE_INITIALIZING_MODULE",{moduleCode:c,defaultValue:"Initializing {{moduleCode}} module..."});return(0,a.jsxs)("div",{className:"module-loading-container",children:[(0,a.jsx)(o.Loader,{page:!0,variant:"PageLoader",loaderText:C}),w.retryCount>0&&w.initialDelayComplete&&(0,a.jsx)("div",{className:"retry-info",style:{textAlign:"center",marginTop:"1rem",color:"#666"},children:_("CORE_MODULE_RETRY_ATTEMPT",{retryCount:w.retryCount,maxRetries:y,defaultValue:"Retry attempt {{retryCount}}/{{maxRetries}}"})})]})}if(w.error||!w.module)return console.warn("Module loading failed for ".concat(c,":"),w.error),(0,a.jsx)(i.Navigate,{to:"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee/user/error?type=notfound&module=").concat(c,"&reason=").concat(encodeURIComponent(w.error||"Module not found")),replace:!0});var N=w.module;return(0,a.jsx)(N,{stateCode:m,moduleCode:c,userType:f,tenants:p})}},4217(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(4883),i=n.n(r),o=n(6340),l=n(6870),a=()=>{if("undefined"==typeof window)return(0,l.jsx)("span",{});try{var e,t=(null===(e=window)||void 0===e?void 0:e.contextPath)||"",n=Digit.UserService.getType(),r="/".concat(t,"employee"===n?"/employee/user/error":"/citizen/error"),i=window.location.href;if(i.includes("employee/user/error")||i.includes("citizen/error"))return(0,l.jsx)("span",{});try{window.location.href=r}catch(e){console.warn("Navigation failed in error boundary:",e);try{window.location.replace(r)}catch(e){console.error("Both href and replace failed:",e)}}}catch(e){console.error("Error in Redircter component:",e)}return(0,l.jsx)("span",{})};class s extends i().Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1,module:null,action:null,info:null}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack,module:null==e?void 0:e.module,action:null==e?void 0:e.action,info:null==e?void 0:e.info}}componentDidCatch(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack,module:null==e?void 0:e.module,action:null==e?void 0:e.action,info:t})}render(){return this.state.hasError?(0,l.jsxs)("div",{className:"error-boundary",children:[(0,l.jsx)(a,{}),(0,l.jsx)(o.default,{initData:this.props.initData,errorData:this.state,goToHome:()=>{var e,t,n;window.location.href="/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/").concat(null===(t=Digit)||void 0===t||null===(t=t.UserService)||void 0===t||null===(n=t.getType)||void 0===n?void 0:n.call(t))}})]}):this.props.children}}const u=s},6340(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>s}),n(4883);var r=n(5953),i=n(6177),o=n(6870),l={error:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/PageNotFound.png",infoMessage:"MODULE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},a={sandbox:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/error-image.png",infoMessage:"WRONG_TENANT_SIGN_UP",buttonInfo:"CREATE_TENANT_ERROR_BUTTON"}};const s=e=>{var t,n=Digit.Hooks.useQueryParams().type,s=void 0===n?"error":n,u=null==e||null===(t=e.errorData)||void 0===t?void 0:t.module,c=(0,r.useTranslation)().t,d=u?a[u]:l[s];return e.stateInfo,(0,o.jsx)("div",{className:"error-boundary",children:(0,o.jsxs)("div",{className:"error-container",children:[(0,o.jsx)(i.A,{src:d.imgUrl,alt:"error"}),(0,o.jsx)("h1",{children:c(d.infoMessage)}),(0,o.jsx)("button",{onClick:()=>{var t,n;u?null==e||null===(t=e.errorData)||void 0===t||t.action():null==e||null===(n=e.goToHome)||void 0===n||n.call(e)},children:c(d.buttonInfo)})]})})}},5660(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(6243),i=(n(4883),n(5953)),o=n(6177),l=n(6870);const a=e=>{var t,n,a=e.showTenant,s=void 0===a||a,u=Digit.Hooks.useStore.getInitData(),c=u.data,d=u.isLoading,v=(c||{}).stateInfo,m=(0,i.useTranslation)().t;if(d)return(0,l.jsx)(r.Loader,{});var f=null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("SVG_HEADER_SECONDARY_LOGO_URL");return f?(0,l.jsxs)("div",{className:"bannerHeader secondaryBannerHeader",children:[(0,l.jsx)(o.A,{className:"bannerLogo",src:null==v?void 0:v.logoUrl,style:s?{}:{borderRight:"unset"},alt:"Digit Banner"}),(0,l.jsx)("span",{style:{fontSize:"xx-large"},children:"|"}),(0,l.jsx)(o.A,{className:"svgHeaderLogo",src:f,alt:"DIGIT Logo"})]}):(0,l.jsxs)("div",{className:"bannerHeader",children:[(0,l.jsx)(o.A,{className:"bannerLogo",src:null==v?void 0:v.logoUrl,style:s?{}:{borderRight:"unset"},alt:"Digit Banner"}),s&&(null==v?void 0:v.code)&&(0,l.jsx)("p",{children:m("TENANT_TENANTS_".concat(null==v||null===(n=v.code)||void 0===n?void 0:n.toUpperCase()))})]})}},1234(e,t,n){"use strict";n.d(t,{AppHome:()=>E,q:()=>j});var r=n(5053),i=n(6243),o=n(4883),l=n.n(o),a=n(5953),s=n(4442),u=n(6870);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){v(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f=n(338),p=e=>{e.modules,e.additionalComponent;var t,n,r,c,v,p=Digit.Hooks.useAccessControl(),g=p.isLoading,y=p.data,h=Digit.Utils.getMultiRootTenant(),b=(0,a.useTranslation)().t,O=(0,s.useNavigate)(),x=null===(t=Digit)||void 0===t||null===(t=t.ULBService)||void 0===t?void 0:t.getStateId(),S=(c=(0,o.useState)([{}]),v=2,function(e){if(Array.isArray(e))return e}(c)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(c,v)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.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)?m(e,t):void 0}}(c,v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=S[0],j=S[1],_=Digit.Hooks.useCustomMDMS(x,"HomeScreenOrder",[{name:"CardsAndLinksOrder"}],{select:e=>{var t;return null==e||null===(t=e.HomeScreenOrder)||void 0===t?void 0:t.CardsAndLinksOrder}}),C=_.data,N=Digit.Hooks.useCustomMDMS(x,"SandBoxLanding",[{name:"AdditionalModuleLinks"}],{select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.AdditionalModuleLinks}}),E=N.data;N.isLoading,(0,o.useEffect)(()=>{j(C)},[C]);var I=(e,t)=>{if(!e||!t)return null;var n=null==E?void 0:E.find(t=>t.moduleName===e.module),r=null==n?void 0:n[t],i=null==e?void 0:e.links;return(null==i?void 0:i.find(e=>(null==e?void 0:e.displayName)===r))||null},A=e=>{var t,n=null==E?void 0:E.find(t=>t.moduleName===e.module);return null==e||null===(t=e.links)||void 0===t?void 0:t.filter(e=>{var t=e.displayName,r="Configure_master"!==t,i=t!==(null==n?void 0:n.howItWorksLink),o=t!==(null==n?void 0:n.userManualLink);return r&&i&&o})},D=null==y?void 0:y.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,t)=>{var n=t.parentModule;e[n]||(e[n]={module:n,kpis:[],icon:t.leftIcon?Digit.Utils.iconRender({iconName:t.leftIcon,iconFill:"white",CustomSVG:i.CustomSVG,Components:f}):"",label:Digit.Utils.locale.getTransformedLocale("".concat(n,"_CARD_HEADER")),links:[]});var r=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("/"!=n)return-1===(null===(e=n)||void 0===e?void 0:e.indexOf("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath)))&&h?n=n.replace("/sandbox-ui/employee","/sandbox-ui/".concat(x,"/employee")):n}(t.navigationURL),o=r.indexOf("?");return e[n].links.push({link:r,icon:t.leftIcon,queryParams:-1===o?null:r.substring(o),label:b(Digit.Utils.locale.getTransformedLocale("".concat(n,"_LINK_").concat(t.displayName))),displayName:t.displayName}),e},{});if(g)return(0,u.jsx)(i.Loader,{page:!1,variant:"PageLoader"});if(!D)return"";r=h?(e=>Object.keys(e).sort((e,t)=>{var n,r;return((null==w||null===(n=w.find(t=>"card"===t.moduleType&&t.name===e))||void 0===n?void 0:n.order)||null)-((null==w||null===(r=w.find(e=>"card"===e.moduleType&&e.name===t))||void 0===r?void 0:r.order)||null)}).reduce((t,n)=>{var r,i=null==e||null===(r=e[n])||void 0===r||null===(r=r.links)||void 0===r?void 0:r.sort((e,t)=>{var r,i,o=null==e?void 0:e.displayName,l=null==t?void 0:t.displayName;return((null==w||null===(r=w.find(e=>"link"===e.moduleType&&e.name==="".concat(n,".").concat(o.replace(/\s+/g,"_"))))||void 0===r?void 0:r.order)||null)-((null==w||null===(i=w.find(e=>"link"===e.moduleType&&e.name==="".concat(n,".").concat(l.replace(/\s+/g,"_"))))||void 0===i?void 0:i.order)||null)});return t[n]=d(d({},e[n]),{},{links:i}),t},{}))(D):D;var P=null===(n=Object.keys(r))||void 0===n?void 0:n.map((e,t)=>{var n,o,l=null===(n=r)||void 0===n?void 0:n[e],a=null==l||null===(o=l.links)||void 0===o?void 0:o.find(e=>"Configure_master"===(null==e?void 0:e.displayName)),s=I(l,"howItWorksLink"),c=I(l,"userManualLink"),v={icon:"SupervisorAccount",moduleName:b(null==l?void 0:l.label),metrics:[],links:Digit.Utils.getMultiRootTenant()?A(l):null==l?void 0:l.links,centreChildren:[(0,u.jsx)("div",{children:b(Digit.Utils.locale.getTransformedLocale("MODULE_CARD_DESC_".concat(e)))}),s&&(0,u.jsx)(i.Button,{variation:"teritiary",label:null==s?void 0:s.label,icon:null==s?void 0:s.icon,type:"button",size:"medium",onClick:()=>window.open(null==s?void 0:s.link,"_blank"),style:{padding:"0px"}})],endChildren:Digit.Utils.getMultiRootTenant()?[a&&(0,u.jsx)(i.Button,{variation:"teritiary",label:null==a?void 0:a.label,icon:null==a?void 0:a.icon,type:"button",size:"medium",onClick:()=>O(null==a?void 0:a.link),style:{padding:"0px"}}),c&&(0,u.jsx)(i.Button,{variation:"teritiary",label:null==c?void 0:c.label,icon:null==c?void 0:c.icon,type:"button",size:"medium",onClick:()=>window.open(null==c?void 0:c.link,"_blank"),style:{padding:"0px"}})]:null};return(0,u.jsx)(i.LandingPageCard,d({buttonSize:"medium"},v))});return(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(i.LandingPageWrapper,{children:l().Children.map(P,e=>l().cloneElement(e))})})},g=n(338);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var h=e=>{var t,n,l=e.question,s=e.isLabelLink,c=(e.answer,e.type),d=e.actions,v=e.content,m=e.lastIndex,f=(t=(0,o.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.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)?y(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=f[0],h=f[1],b=(0,a.useTranslation)().t,O=Digit.ULBService.getStateId(),x="number"===c?"ol":"ul";return(0,u.jsxs)("div",{className:"faqs border-none",onClick:()=>h(!p),children:[(0,u.jsxs)("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"},children:[(0,u.jsx)("span",{children:b(l)}),(0,u.jsx)("span",{className:p?"faqicon rotate":"faqicon",style:{float:"right"},children:(0,u.jsx)(g.ArrowForward,{})})]}),(0,u.jsxs)("div",{className:"faq-answer",style:p?{display:"block"}:{display:"none"},children:[(0,u.jsx)(r.CardSectionSubText,{style:{marginTop:"1rem"},children:b(v)}),(0,u.jsx)("div",{style:{marginTop:"1rem"},children:d&&(0,u.jsx)(x,{children:d.map((e,t)=>(0,u.jsxs)("li",{style:{listStyleType:"ul"===x?"disc":"auto",margin:"8px 0"},children:[s?null!=e&&e.label?(0,u.jsx)(i.Button,{variation:"teritiary",label:b(null==e?void 0:e.label),type:"button",size:"medium",onClick:()=>{if(null!=e&&e.fulllink)window.open(null==e?void 0:e.link,"_blank");else{var t,n="https://".concat(window.location.hostname,"/").concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/").concat(O);window.open("".concat(n,"/").concat(null==e?void 0:e.link),"_blank")}},style:{padding:"0px"}}):null:null!=e&&e.label?(0,u.jsxs)("strong",{children:[b(null==e?void 0:e.label),":"]}):null,b(null==e?void 0:e.description)]},t))})})]}),m?null:(0,u.jsx)("div",{className:"cs-box-border"})]})},b=e=>{var t=e.type,n=e.title,i=e.content,o=e.actions,l=(e.style,(0,a.useTranslation)().t),s="number"===t?"ol":"ul";return(0,u.jsxs)("div",{children:[(0,u.jsx)(r.CardSectionHeader,{children:l(n)}),(0,u.jsx)(r.CardSectionSubText,{style:{marginTop:"1rem"},children:l(i)}),(0,u.jsx)("div",{style:{marginTop:"1rem"},children:o&&(0,u.jsx)(s,{children:o.map((e,t)=>(0,u.jsxs)("li",{style:{listStyleType:"ul"===s?"disc":"auto",margin:"8px 0"},children:[null!=e&&e.label?(0,u.jsxs)("strong",{children:[l(null==e?void 0:e.label),":"]}):null," ",l(null==e?void 0:e.description)]},t))})})]})},O=e=>{e.key,e.title,e.content;var t=e.faqs,n=e.type;return(0,a.useTranslation)().t,(0,u.jsx)("div",{style:{width:"100%"},children:(0,u.jsx)("div",{style:{width:"100%"},children:t.map((e,r)=>(0,u.jsx)(h,{question:e.question,answer:e.answer,isLabelLink:e.isLabelLink,type:n,actions:e.answer,content:e.content,lastIndex:r===(null==t?void 0:t.length)-1},"faq_"+r))})})};const x=e=>{var t=e.cardConfig,n=(0,a.useTranslation)().t;return(0,u.jsxs)(i.Card,{className:"sandbox-guide",style:{width:"25rem",height:"47rem",overflowY:"scroll"},children:[(0,u.jsx)(i.CardHeader,{children:n("GUIDE_TO_SETUP")}),(0,u.jsx)("div",{style:{display:"flex",flexWrap:"wrap"},children:t.map((e,n)=>"faqs"===(null==e?void 0:e.type)?(0,u.jsx)(O,{title:e.title,type:null==e?void 0:e.type,content:e.content,faqs:e.actions},e.id):(0,u.jsxs)(l().Fragment,{children:[(0,u.jsx)(b,{type:null==e?void 0:e.type,title:e.title,content:e.content,actions:e.actions,style:e.style},e.id),n!==(null==t?void 0:t.length)-1&&(0,u.jsx)(r.BreakLine,{style:{width:"100%",border:"1px solid #d6d5d4"}})]}))})]})};var S=["onSelect","formData","control","formState"];const w=e=>{e.onSelect,e.formData,e.control,e.formState,function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}}(e,S);var t=(0,a.useTranslation)().t,n=Digit.Hooks.useAccessControl(),r=(n.isLoading,n.data),i=(Digit.Utils.getMultiRootTenant(),Digit.ULBService.getStateId());return(null==r?void 0:r.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,n)=>{var r=n.parentModule;e[r]||(e[r]={module:r,label:Digit.Utils.locale.getTransformedLocale("".concat(r,"_CARD_HEADER")),links:[]});var o=Digit.Utils.transformURL(n.navigationURL,i),l=o.indexOf("?");return e[r].links.push({link:-1===l?o:o.substring(0,l),label:t(Digit.Utils.locale.getTransformedLocale("".concat(r,"_LINK_").concat(n.displayName))),queryParams:-1===l?null:o.substring(l),description:t(Digit.Utils.locale.getTransformedLocale("".concat(r,"_LINK_").concat(n.displayName,"_DESCRIPTION")))}),e},{}))?(0,u.jsx)(x,{cardConfig:[{id:1,type:"faqs",actions:[{question:"SANDBOX_FAQ_QUES_14",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_14_LABEL_1",fulllink:!0,link:"https://egov-digit.gitbook.io/digit-sandbox/specifications/user-manual/walkthrough-videos"}]},{question:"SANDBOX_FAQ_QUES_1",content:"SANDBOX_FAQ_CONTENT_1",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_1_LABEL_1",link:"citizen/login",description:"SANDBOX_FAQ_ANS_1_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_1_LABEL_2",link:"employee/user/login",description:"SANDBOX_FAQ_ANS_1_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_2",content:"SANDBOX_FAQ_CONTENT_2",answer:[{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_3",content:"SANDBOX_FAQ_CONTENT_3",answer:[{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_4",content:"SANDBOX_FAQ_CONTENT_4",answer:[{label:null,description:"SANDBOX_FAQ_ANS_4_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_4_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_5",content:"SANDBOX_FAQ_CONTENT_5",answer:[{label:"SANDBOX_FAQ_ANS_5_LABEL_1",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_5_LABEL_2",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_2"},{label:"SANDBOX_FAQ_ANS_5_LABEL_3",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_3"},{label:"SANDBOX_FAQ_ANS_5_LABEL_4",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_4"},{label:"SANDBOX_FAQ_ANS_5_LABEL_5",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_5"}]},{question:"SANDBOX_FAQ_QUES_6",content:"SANDBOX_FAQ_CONTENT_6"},{question:"SANDBOX_FAQ_QUES_7",content:"SANDBOX_FAQ_CONTENT_7",answer:[{label:null,description:"SANDBOX_FAQ_ANS_7_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_7_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_8",content:"SANDBOX_FAQ_CONTENT_8",answer:[{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_9",content:"SANDBOX_FAQ_CONTENT_9",answer:[{label:"SANDBOX_FAQ_ANS_9_LABEL_1",description:"SANDBOX_FAQ_ANS_9_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_9_LABEL_2",description:"SANDBOX_FAQ_ANS_9_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_10",content:"SANDBOX_FAQ_CONTENT_10",answer:[{label:"SANDBOX_FAQ_ANS_10_LABEL_1",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_10_LABEL_2",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_2"},{label:"SANDBOX_FAQ_ANS_10_LABEL_3",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_3"},{label:"SANDBOX_FAQ_ANS_10_LABEL_4",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_11",content:"SANDBOX_FAQ_CONTENT_11"},{question:"SANDBOX_FAQ_QUES_12",content:"SANDBOX_FAQ_CONTENT_12"},{question:"SANDBOX_FAQ_QUES_13",content:"SANDBOX_FAQ_CONTENT_13"}]}]}):""};var j=(e,t,n)=>{var r=null==e?void 0:e["".concat(t)];r&&r.map(e=>{Digit.Utils.getMultiRootTenant()&&(e.navigationURL=e.navigationURL.replace("/sandbox-ui/citizen","/sandbox-ui/".concat(Digit.ULBService.getStateId(),"/citizen"))),e.link=e.navigationURL,e.i18nKey=n(e.name)});var i,o={links:null==r?void 0:r.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_".concat(t)),iconName:"CITIZEN_".concat(t,"_ICON")};return"FSM"===t&&[{role:"FSM_DSO",from:"/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/citizen/fsm/dso-dashboard"),dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,r,i,l=e.role,a=e.from,s=e.loginLink,u=e.dashoardLink;Digit.UserService.hasAccess(l)?null==o||null===(t=o.links)||void 0===t||t.push({link:a,i18nKey:n(u)}):null==o||null===(r=o.links)||void 0===r||r.push({link:"/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/citizen/login"),state:{role:"FSM_DSO",from:a},i18nKey:n(s)})}),o},_=e=>{switch(e){case"PT":default:return(0,u.jsx)(i.CustomSVG.PTIcon,{className:"fill-path-primary-main"});case"WS":return(0,u.jsx)(i.CustomSVG.WSICon,{className:"fill-path-primary-main"});case"FSM":return(0,u.jsx)(i.CustomSVG.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return(0,u.jsx)(i.CustomSVG.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return(0,u.jsx)(i.CustomSVG.PGRIcon,{className:"fill-path-primary-main"});case"TL":return(0,u.jsx)(i.CustomSVG.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return(0,u.jsx)(i.CustomSVG.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return(0,u.jsx)(i.CustomSVG.BillsIcon,{className:"fill-path-primary-main"})}},C=e=>{var t=e.getCitizenMenu,n=e.fetchedCitizen,o=e.isLoading,l=(0,a.useTranslation)().t,c=(0,s.useNavigate)(),d=window.Digit.Utils.browser.isMobile();if(o||!n||!t)return(0,u.jsx)(r.Loader,{});var v=Object.keys(t),m=e=>{var t=(e.name||e.displayName||"").toLowerCase();return t.includes("apply")||t.includes("_apply")};if(!d){var f=v.map(e=>{var n,r,o=j(t,e,l);if(null==o||null===(n=o.links)||void 0===n||!n.length)return null;var a=new Set,s=null===(r=o.links)||void 0===r||null===(r=r.filter(e=>null==e?void 0:e.link))||void 0===r?void 0:r.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)).filter(e=>{var t=e.link;return!a.has(t)&&(a.add(t),!0)});return(0,u.jsxs)(i.Card,{className:"digit-landing-page-card",style:{borderRadius:"1rem"},children:[(0,u.jsxs)("div",{className:"icon-module-header",children:[(0,u.jsx)("div",{className:"digit-landingpagecard-icon",children:(0,u.jsx)(i.CustomSVG.Devices,{fill:"#C84C0E",width:"1rem",height:"1rem"})}),(0,u.jsx)("div",{className:"ladingcard-moduleName",role:"heading","aria-level":"2",children:l(null==o?void 0:o.header)})]}),(0,u.jsx)(i.Divider,{className:"digit-landingpage-divider",variant:"small"}),s.map((e,t)=>{var n=e.leftIcon&&"TLIcon"!==e.leftIcon&&i.CustomSVG[e.leftIcon]?i.CustomSVG[e.leftIcon]:null;return(0,u.jsx)("button",{className:"digit-button-teritiary medium",type:"button",style:{padding:"0px"},onClick:()=>(e=>{var t;e&&(null!=e&&e.includes("".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/"))?c(e):window.location.href=e)})(e.link),children:(0,u.jsxs)("div",{className:"icon-label-container teritiary medium",children:[n?(0,u.jsx)(n,{fill:"#C84C0E",width:"1.25rem",height:"1.25rem",className:"digit-button-customIcon medium teritiary"}):m(e)?(0,u.jsx)(i.SVG.AddExpense,{fill:"#C84C0E",width:"1.25rem",height:"1.25rem",className:"digit-button-customIcon medium teritiary"}):(0,u.jsx)(i.SVG.ListAlt,{fill:"#C84C0E",width:"1.25rem",height:"1.25rem",className:"digit-button-customIcon medium teritiary"}),(0,u.jsx)("h2",{className:"digit-button-label",children:e.i18nKey})]})},t)})]},e)}).filter(Boolean);return(0,u.jsx)("div",{className:"citizen-all-services-wrapper",children:(0,u.jsx)("div",{className:"employee-app-container digit-home-employee-app",children:(0,u.jsx)(i.LandingPageWrapper,{children:f})})})}return(0,u.jsxs)("div",{className:"citizen-all-services-wrapper",children:[location.pathname.includes("sanitation-ui/citizen/all-services")||location.pathname.includes("sandbox-ui")&&location.pathname.includes("all-services")?null:(0,u.jsx)(i.BackLink,{onClick:()=>window.history.back()}),(0,u.jsx)("div",{className:"citizenAllServiceGrid",children:v.map(e=>{var n,r,i=j(t,e,l);return(null==i||null===(n=i.links)||void 0===n?void 0:n.length)>0?(0,u.jsxs)("div",{className:"CitizenHomeCard",children:[(0,u.jsxs)("div",{className:"header",children:[(0,u.jsx)("h2",{children:l(null==i?void 0:i.header)}),_(e)]}),(0,u.jsx)("div",{className:"links",children:null==i||null===(r=i.links)||void 0===r||null===(r=r.filter(e=>null==e?void 0:e.link))||void 0===r?void 0:r.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)).map((e,t)=>(0,u.jsx)("div",{className:"linksWrapper",children:(0,u.jsx)("a",{href:e.link,onClick:t=>((e,t)=>{e.preventDefault(),c(t)})(t,e.link),children:e.i18nKey})},t))})]},e):null})})]})},N=e=>{var t=e.modules,n=e.additionalComponent;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"employee-app-container digit-home-employee-app",children:(0,u.jsx)(i.LandingPageWrapper,{children:null==t?void 0:t.map((e,t)=>{var n=e.code,r=Digit.ComponentRegistryService.getComponent("".concat(n,"Card"))||(()=>(0,u.jsx)(l().Fragment,{}));return(0,u.jsx)(r,{},t)})})}),n&&(null==n?void 0:n.length)>0&&n.map(e=>{var t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?(0,u.jsx)("div",{className:"additional-component-wrapper",children:(0,u.jsx)(t,{})}):null})]})},E=e=>{var t=e.userType,n=e.modules,r=e.getCitizenMenu,i=e.fetchedCitizen,o=e.isLoading,l=e.additionalComponent;if("citizen"===t)return(0,u.jsx)(C,{modules:n,getCitizenMenu:r,fetchedCitizen:i,isLoading:o});var a=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return Digit.Utils.getRoleBasedHomeCard()?(0,u.jsxs)("div",{className:a?"homeWrapper":"",children:[(0,u.jsx)(p,{modules:n,additionalComponent:l}),a&&!window.Digit.Utils.browser.isMobile()?(0,u.jsx)(w,{}):null]}):(0,u.jsx)(N,{modules:n,additionalComponent:l})}},6177(e,t,n){"use strict";n.d(t,{A:()=>d}),n(4883);var r=n(7598),i=n.n(r),o=n(6870),l=["src","alt","decorative","ariaLabel","ariaLabelledby"];function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=e=>{var t=e.src,n=e.alt,r=void 0===n?"Image not found":n,i=e.decorative,a=void 0!==i&&i,u=e.ariaLabel,c=void 0===u?"No Image description set":u,d=e.ariaLabelledby,v=void 0===d?"no-image-description":d,m=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,l),f={};return a?f.alt="":r?f.alt=r:c?f["aria-label"]=c:v?f["aria-labelledby"]=v:console.warn("AccessibleImage: Missing alt, aria-label, or aria-labelledby for non-decorative image."),(0,o.jsx)("img",s(s(s({src:t},f),m),{},{tabIndex:0,onKeyDown:e=>{var t,n;"Enter"!==e.key&&" "!==e.key||window.open(null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}}))};c.propTypes={src:i().string.isRequired,alt:i().string,decorative:i().bool,ariaLabel:i().string,ariaLabelledby:i().string};const d=c},9536(e,t,n){"use strict";n.d(t,{A:()=>G});var r=n(4883),i=n.n(r),o=n(5053),l=n(6243),a=n(4442),s=n(358),u=n(3015),c=n(6177),d=n(6870);function v(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const f=e=>{var t,n,r,f,p,g,y,h,b,O,x=e.t,S=e.stateInfo,w=e.toggleSidebar,j=e.isSidebarOpen,_=e.handleLogout,C=e.userDetails,N=e.CITIZEN,E=e.cityDetails,I=e.mobileView,A=e.userOptions,D=e.handleUserDropdownSelection,P=e.logoUrl,T=e.logoUrlWhite,L=e.showLanguageChange,R=void 0===L||L,M=(b=i().useState(null),O=2,function(e){if(Array.isArray(e))return e}(b)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(b,O)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.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)?m(e,t):void 0}}(b,O)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),U=M[0],k=M[1];i().useEffect(()=>{var e=function(){var e,t=(e=function*(){var e,t=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCurrentTenantId(),n=null==C||null===(e=C.info)||void 0===e?void 0:e.uuid;if(n){var r=yield Digit.UserService.userSearch(t,{uuid:[n]},{});if(r&&r.user&&r.user.length){var i,o=r.user[0],l=null==o||null===(i=o.photo)||void 0===i?void 0:i.split(",");k(null==l?void 0:l.at(0))}}},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){v(o,r,i,l,a,"next",e)}function a(e){v(o,r,i,l,a,"throw",e)}l(void 0)})});return function(){return t.apply(this,arguments)}}();e()},[null!==U,null==C||null===(t=C.info)||void 0===t?void 0:t.uuid]);var B,F,V=Digit.ULBService.getCitizenCurrentTenant(!0),G=(0,a.useNavigate)(),z=(0,a.useLocation)().pathname,W=Digit.Hooks.useNotificationCount({tenantId:V,config:{enabled:"EMPLOYEE"!==(null===(B=Digit.UserService)||void 0===B||null===(B=B.getUser())||void 0===B||null===(B=B.info)||void 0===B?void 0:B.type)&&"CITIZEN"===(null===(F=Digit.UserService)||void 0===F||null===(F=F.getUser())||void 0===F||null===(F=F.info)||void 0===F?void 0:F.type)&&!!V}}),H=W.data,q=(void 0===H?{}:H).unreadCount,X=W.isSuccess;if(N)return(0,d.jsx)("div",{children:(0,d.jsx)(o.TopBar,{img:null==S?void 0:S.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:w(!0)},logoUrl:null==S?void 0:S.logoUrlWhite,onLogout:_,userDetails:C,notificationCount:q<99?q:99,notificationCountLoaded:X,cityOfCitizenShownBesideLogo:x(V),onNotificationIconClick:function(){var e;G("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/engagement/notifications"))},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,r;return(null===(t=Digit.UserService)||void 0===t||null===(t=t.getUser())||void 0===t||!t.access_token)&&["/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/citizen/select-language"),"/".concat(null===(r=window)||void 0===r?void 0:r.contextPath,"/citizen/select-location")].includes(e)})(z),changeLanguage:I?null:(0,d.jsx)(u.A,{dropdown:!0})})});var Q=!(null==C||!C.access_token),Z=null===(n=Digit.ComponentRegistryService)||void 0===n?void 0:n.getComponent("CustomEmployeeTopBar");return Z?(0,d.jsx)(Z,{t:x,stateInfo:S,toggleSidebar:w,isSidebarOpen:j,handleLogout:_,userDetails:C,CITIZEN:N,cityDetails:E,mobileView:I,userOptions:A,handleUserDropdownSelection:D,logoUrl:P,showLanguageChange:R,loggedin:Q}):(0,d.jsx)(l.Header,{actionFields:[(0,d.jsx)(s.A,{dropdown:!0,t:x}),R&&(0,d.jsx)(u.A,{dropdown:!0}),(null==C?void 0:C.access_token)&&(0,d.jsx)(l.Dropdown,{option:A,optionKey:"name",profilePic:U||(null==C||null===(r=C.info)||void 0===r?void 0:r.name)||(null==C||null===(f=C.info)||void 0===f||null===(f=f.userInfo)||void 0===f?void 0:f.name)||"Employee",select:D,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{w()},className:"digit-employee-header",img:P,logoWidth:"64px",logoHeight:"48px",logo:(Q?null==E?void 0:E.logoId:null==S?void 0:S.statelogo)||"https://egov-dev-assets.s3.ap-south-1.amazonaws.com/egov-logo-2025.png",onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:(null===(p=window)||void 0===p||null===(p=p.globalConfigs)||void 0===p?void 0:p.getConfig("HEADER_THEME"))||"light",ulb:Q?null!=E&&null!==(g=E.city)&&void 0!==g&&g.ulbGrade?(0,d.jsxs)(d.Fragment,{children:[x(null==E?void 0:E.i18nKey).toUpperCase()," ",x("ULBGRADE_".concat(null==E||null===(y=E.city)||void 0===y?void 0:y.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()]}):(0,d.jsx)(c.A,{className:"state",src:T,alt:"State Logo"}):(0,d.jsxs)(d.Fragment,{children:[x("MYCITY_".concat(null==S||null===(h=S.code)||void 0===h?void 0:h.toUpperCase(),"_LABEL"))," ",x("MYCITY_STATECODE_LABEL")]})})};var p=n(5953),g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC";const y=(e,t,n,r)=>[{type:"component",element:"LANGUAGE",action:(0,d.jsx)(u.A,{}),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:(0,d.jsx)(o.LogoutIcon,{className:"icon"}),populators:{onClick:n}}];var h=n(6810);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach(function(t){x(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n={}.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)?w(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var j=e=>{var t=e.info,n=(e.stateName,e.t);return(0,d.jsxs)("div",{className:"profile-section",children:[(0,d.jsx)("div",{className:"imageloader imageloader-loaded",children:(0,d.jsx)(c.A,{className:"img-responsive img-circle img-Profile",src:g,alt:"Profile Logo"})}),(0,d.jsx)("div",{id:"profile-name",className:"label-container name-Profile",children:(0,d.jsxs)("div",{className:"label-text",children:[" ",null==t?void 0:t.name," "]})}),(0,d.jsx)("div",{id:"profile-location",className:"label-container loc-Profile",children:(0,d.jsxs)("div",{className:"label-text",children:[" ",null==t?void 0:t.mobileNumber," "]})}),(null==t?void 0:t.emailId)&&(0,d.jsx)("div",{id:"profile-emailid",className:"label-container loc-Profile",children:(0,d.jsxs)("div",{className:"label-text",children:[" ",t.emailId," "]})}),(0,d.jsx)("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&(0,d.jsx)(s.A,{t:n,mobileView:!0})]})},_={CommonPTIcon:(0,d.jsx)(o.PTIcon,{className:"icon"}),OBPSIcon:(0,d.jsx)(o.OBPSIcon,{className:"icon"}),propertyIcon:(0,d.jsx)(o.PropertyHouse,{className:"icon"}),TLIcon:(0,d.jsx)(o.CaseIcon,{className:"icon"}),PGRIcon:(0,d.jsx)(o.PGRIcon,{className:"icon"}),FSMIcon:(0,d.jsx)(o.FSMIcon,{className:"icon"}),WSIcon:(0,d.jsx)(o.WSICon,{className:"icon"}),MCollectIcon:(0,d.jsx)(o.MCollectIcon,{className:"icon"}),BillsIcon:(0,d.jsx)(o.CollectionIcon,{className:"icon"}),BirthIcon:(0,d.jsx)(o.BirthIcon,{className:"icon"}),DeathIcon:(0,d.jsx)(o.DeathIcon,{className:"icon"}),FirenocIcon:(0,d.jsx)(o.FirenocIcon,{className:"icon"}),HomeIcon:(0,d.jsx)(o.HomeIcon,{className:"icon"}),EditPencilIcon:(0,d.jsx)(o.EditPencilIcon,{className:"icon"}),LogoutIcon:(0,d.jsx)(o.LogoutIcon,{className:"icon"}),Phone:(0,d.jsx)(o.Phone,{className:"icon"})};const C=e=>{var t,n,l,s=e.linkData,u=e.islinkDataLoading,c=(0,p.useTranslation)().t,v=(0,a.useNavigate)(),m=(0,a.useLocation)().pathname,f=Digit.Hooks.useStore.getInitData(),g=f.data,b=f.isFetched,x=(g||{}).stateInfo,w=Digit.UserService.getUser(),C=window.Digit.Utils.browser.isMobile(),N=S((0,r.useState)(!1),2),E=N[0],I=(N[1],S((0,r.useState)(!1),2)),A=(I[0],I[1]),D=S((0,r.useState)(!1),2),P=D[0],T=D[1],L=()=>{T(!1)};if(u)return(0,d.jsx)(o.Loader,{});var R=()=>{var e;v("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/user/profile"))},M=[...y(c,0,()=>{var e;v("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/login"))})];M=M.filter(e=>"LANGUAGE"!==e.element);var U,k,B,F,V,G,z,W,H=Digit.ULBService.getCurrentTenantId(),q=e=>{var t,n,r=e.item,i=(null==r?void 0:r.icon)||(null===(t=r.icon)||void 0===t||null===(t=t.type)||void 0===t?void 0:t.name),o=i?_[i]:_.BillsIcon;n="component"===r.type?r.action:r.text;var l=()=>(0,d.jsxs)("span",O(O({className:"menu-item"},r.populators),{},{children:[o,(0,d.jsx)("div",{className:"menu-label",children:n})]}));return"external-link"===r.type?(0,d.jsx)("a",{href:r.link,children:(0,d.jsx)(l,{})}):"link"===r.type?(0,d.jsx)(a.Link,{to:null==r?void 0:r.link,children:(0,d.jsx)(l,{})}):(0,d.jsx)(l,{})};return b&&w&&w.access_token&&"CITIZEN"===(null==w||null===(t=w.info)||void 0===t?void 0:t.type)&&(U=(0,d.jsx)(j,{info:null==w?void 0:w.info,stateName:null==x?void 0:x.name,t:c}),M=M.filter(e=>"login-btn"!==(null==e?void 0:e.id)),M=[...M,{type:"link",icon:"HomeIcon",element:"HOME",text:c("COMMON_BOTTOM_NAVIGATION_HOME"),link:E?"/".concat(null===(k=window)||void 0===k?void 0:k.contextPath,"/employee"):"/".concat(null===(B=window)||void 0===B?void 0:B.contextPath,"/citizen"),populators:{onClick:()=>{var e;v("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/all-services"))}}},{text:c("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:R}},{text:c("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{A(!1),T(!0)}}},{text:(0,d.jsxs)(i().Fragment,{children:[c("CS_COMMON_HELPLINE"),(0,d.jsx)("div",{className:"telephone",style:{marginTop:"-10%"},children:(null==g||null===(F=g.tenants)||void 0===F?void 0:F.length)>0&&(0,d.jsx)("div",{className:"link",children:(0,d.jsx)("a",{href:"tel:".concat((null===(V=g.tenants.find(e=>e.code===H))||void 0===V?void 0:V.contactNumber)||(null===(G=g.tenants[0])||void 0===G?void 0:G.contactNumber)||""),children:(null===(z=g.tenants.find(e=>e.code===H))||void 0===z?void 0:z.contactNumber)||(null===(W=g.tenants[0])||void 0===W?void 0:W.contactNumber)||c("CS_NA")})})})]}),element:"Helpline",icon:"Phone"}]),null===(n=Object.keys(s||{}))||void 0===n||null===(n=n.sort((e,t)=>t.localeCompare(e)))||void 0===n||n.map(e=>{var t,n,r,i,o;(null===(t=s[e][0])||void 0===t?void 0:t.sidebar)==="".concat(window.contextPath,"-links")&&M.splice(1,0,{type:null!==(n=s[e][0])&&void 0!==n&&null!==(n=n.sidebarURL)&&void 0!==n&&n.includes(null===(r=window)||void 0===r?void 0:r.contextPath)?"link":"external-link",text:c("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(e))),links:s[e],icon:null===(i=s[e][0])||void 0===i?void 0:i.leftIcon,link:null===(o=s[e][0])||void 0===o?void 0:o.sidebarURL})}),(0,d.jsx)(i().Fragment,{children:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:C?"calc(100vh - 56px)":"auto",zIndex:"99"},children:[U,(0,d.jsx)("div",{className:"drawer-desktop",children:null===(l=M)||void 0===l?void 0:l.map((e,t)=>(0,d.jsx)("div",{className:"sidebar-list ".concat(m===(null==e?void 0:e.link)||m===(null==e?void 0:e.sidebarURL)?"active":""),children:(0,d.jsx)(q,{item:e})},t))})]}),(0,d.jsx)("div",{children:P&&(0,d.jsx)(h.A,{onSelect:()=>{var e;Digit.Utils.getMultiRootTenant()?(Digit.UserService.logout(),T(!1),window.location.href="/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/login")):(Digit.UserService.logout(),T(!1))},onCancel:L,onDismiss:L})})]})})};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function I(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function D(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){A(o,r,i,l,a,"next",e)}function a(e){A(o,r,i,l,a,"throw",e)}l(void 0)})}}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var n={}.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)?T(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var L=e=>{e.isOpen;var t,n,i,s,u,c=e.isMobile,v=void 0!==c&&c,m=e.toggleSidebar,f=e.onLogout,g=e.isEmployee,y=void 0!==g&&g,h=e.linkData,b=e.islinkDataLoading,O=e.userProfile,x=(Digit.Utils.getMultiRootTenant(),Digit.Hooks.useStore.getInitData()),S=x.data,w=x.isFetched,j=Digit.StoreData.getCurrentLanguage(),_=P((0,r.useState)(null),2),N=_[0],I=_[1],A=S||{},T=A.languages,L=A.stateInfo,R=Digit.UserService.getUser(),M=P((0,r.useState)(""),2),U=M[0],k=(M[1],P((0,r.useState)(null),2)),B=k[0],F=k[1],V=P((0,r.useState)([]),2),G=V[0],z=V[1],W=P((0,r.useState)([]),2),H=(W[0],W[1],P((0,r.useState)(j),2)),q=(H[0],H[1]),X=Digit.Hooks.useAccessControl(),Q=X.isLoading,Z=X.data,Y=Digit.ULBService.getCurrentTenantId(),K=(0,p.useTranslation)().t,J=(0,a.useNavigate)(),$=(0,a.useLocation)(),ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(""==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};(0,r.useEffect)(()=>{var e,t=Digit.SessionStorage.get("citizen.userRequestObject"),n=[],r=[];null==t||null===(e=t.info)||void 0===e||null===(e=e.roles)||void 0===e||e.forEach(e=>n.push(e.tenantId));var i=n.filter((e,t,n)=>n.indexOf(e)===t);null==i||i.forEach(e=>{var t;r.push({label:K("TENANT_TENANTS_".concat(null===(t=ee(e,".","_"))||void 0===t?void 0:t.toUpperCase())),value:e})}),null==r||r.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),z(r)},[B]);var te=()=>{Digit.clikOusideFired=!0,m(!1)};(0,r.useEffect)(()=>{var e=function(){var e=D(function*(){var e,t=Digit.ULBService.getCurrentTenantId(),n=null==R||null===(e=R.info)||void 0===e?void 0:e.uuid;if(n){var r,i,o=yield Digit.UserService.userSearch(t,{uuid:[n]},{}),l=null==o||null===(r=o.user)||void 0===r?void 0:r[0];if(l){var a=Digit.UserService.getUser();Digit.UserService.setUser(E(E({},a),{},{info:l}))}if(o&&o.user&&null!=o&&null!==(i=o.user)&&void 0!==i&&i.length){var s,u=o.user[0],c=null==u||null===(s=u.photo)||void 0===s?void 0:s.split(",");I(null==c?void 0:c.at(0))}}});return function(){return e.apply(this,arguments)}}();N||e()},[N]);var ne=e=>{var t,n,r=null;Digit.Utils.getMultiRootTenant()?(r=y?e.replace("/sandbox-ui/employee","/sandbox-ui/".concat(Y,"/employee")):e.replace("/sandbox-ui/citizen","/sandbox-ui/".concat(Y,"/citizen")),J(r),m()):("/"===e[0]?J("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/").concat(y?"employee":"citizen").concat(e)):J("/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/").concat(y?"employee":"citizen","/").concat(e)),m())};if(b||Q)return(0,d.jsx)(l.Loader,{});var re=[{id:"login-btn",element:"LOGIN",text:K("CORE_COMMON_LOGIN"),icon:(0,d.jsx)(o.LogoutIcon,{className:"icon"}),populators:{onClick:()=>{var e,t;J(y?"/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/employee/user/language-selection"):"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/citizen/login")),te()}}}];w&&R&&R.access_token&&(null==R||R.info,null==L||L.name,re=re.filter(e=>"login-btn"!==(null==e?void 0:e.id)));var ie={};if(y){var oe;null==Z||Z.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==U&&""!==e.path){var n=e.path.split(".")[0];"TradeLicense"===n&&(n="Trade License"),ie[n]?ie[n].push(e):ie[n]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(U.toLowerCase())){var r=e.path.split(".")[0];"TradeLicense"===r&&(r="Trade License"),ie[r]?ie[r].push(e):ie[r]=[e]}});for(var le=Object.keys(ie),ae=function(e){var t,n,r,i,o,l,a=null===(t=ie[le[e]][0])||void 0===t||null===(t=t.displayName)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.replace(/[ -]/g,"_"),s=null===(n=le[e])||void 0===n||null===(n=n.toUpperCase())||void 0===n?void 0:n.replace(/[ -]/g,"_");-1===ie[le[e]][0].path.indexOf(".")?re.splice(1,0,{type:"link",text:K("ACTION_TEST_".concat(a)),link:null===(r=ie[le[e]][0])||void 0===r?void 0:r.navigationURL,icon:null===(i=ie[le[e]][0])||void 0===i?void 0:i.leftIcon,populators:{onClick:()=>{var t;J(null===(t=ie[le[e]][0])||void 0===t?void 0:t.navigationURL),te()}}}):re.splice(1,0,{type:"dynamic",moduleName:K("ACTION_TEST_".concat(s)),links:null===(o=ie[le[e]])||void 0===o?void 0:o.map(e=>{var t;return E(E({},e),{},{displayName:K("ACTION_TEST_".concat(null==e||null===(t=e.displayName)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.replace(/[ -]/g,"_")))})}),icon:null===(l=ie[le[e]][1])||void 0===l?void 0:l.leftIcon})},se=0;se<(null==le?void 0:le.length);se++)ae(se);var ue=re.findIndex(e=>"HOME"===e.element),ce=re.splice(ue,1),de=re.findIndex(e=>"LANGUAGE"===e.element),ve=re.splice(de,(null===(oe=re)||void 0===oe?void 0:oe.length)-de);re.sort((e,t)=>{var n="dynamic"===(null==e?void 0:e.type)?null==e?void 0:e.moduleName:null==e?void 0:e.text,r="dynamic"===(null==t?void 0:t.type)?null==t?void 0:t.moduleName:null==t?void 0:t.text;return n.localeCompare(r)}),(null==ce?void 0:ce[0])&&re.splice(0,0,ce[0]),re=(null==ve?void 0:ve.length)>0?re.concat(ve):re}else{var me;null===(me=Object.keys(h))||void 0===me||null===(me=me.sort((e,t)=>t.localeCompare(e)))||void 0===me||me.map(e=>{var t,n,r,i,o;"digit-ui-links"===(null===(t=h[e][0])||void 0===t?void 0:t.sidebar)&&re.splice(1,0,{type:null!==(n=h[e][0])&&void 0!==n&&null!==(n=n.sidebarURL)&&void 0!==n&&n.includes(null===(r=window)||void 0===r?void 0:r.contextPath)?"link":"external-link",text:K("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(e))),links:h[e],icon:null===(i=h[e][0])||void 0===i?void 0:i.leftIcon,link:null===(o=h[e][0])||void 0===o?void 0:o.sidebarURL})})}$.pathname.includes("/openlink")&&(re=re.filter(e=>"LANGUAGE"===e.element)),re=null===(t=re)||void 0===t?void 0:t.map(e=>E(E({},e),{},{label:(null==e?void 0:e.text)||(null==e?void 0:e.moduleName)||"",icon:null!=e&&e.icon?null==e?void 0:e.icon:void 0}));var fe,pe="";pe=Digit.Utils.getMultiRootTenant()?K("TENANT_TENANTS_".concat(Y)):K("TENANT_TENANTS_".concat(null===(fe=ee(Digit.ULBService.getCurrentTenantId(),".","_"))||void 0===fe?void 0:fe.toUpperCase()));var ge=null===(n=re)||void 0===n?void 0:n.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?E(E({},e),{},{children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>E(E({},e),{},{label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}):e}),ye=null==G?void 0:G.map(e=>E(E({},e),{},{type:"custom",key:"city"})),he=null==T?void 0:T.map(e=>E(E({},e),{},{type:"custom",key:"language",icon:"Language"})),be=[{label:"HOME",value:"HOME",icon:"Home",type:"custom",key:"home"},{label:pe,value:pe,children:(null==ye?void 0:ye.length)>0?ye:void 0,type:"custom",icon:"LocationCity",key:"city"},{label:K("Language"),children:(null==he?void 0:he.length)>0?he:void 0,type:"custom",icon:"Language",key:"language"},...R&&R.access_token?[{label:K("EDIT_PROFILE"),type:"custom",icon:"Edit",key:"editProfile"}]:[],{label:K("Modules"),icon:"DriveFileMove",children:ge}];return v?(0,d.jsx)(l.Hamburger,{items:be,profileName:null==R||null===(i=R.info)||void 0===i?void 0:i.name,profileNumber:(null==R||null===(s=R.info)||void 0===s?void 0:s.mobileNumber)||(null==R||null===(u=R.info)||void 0===u?void 0:u.emailId),theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:f,hideUserManuals:!0,profile:N||void 0,isSearchable:!0,onSelect:e=>(e=>{var t,n,r,i=e.item;if(e.index,e.parentIndex,null!=i&&i.navigationURL)ne(null==i?void 0:i.navigationURL);else if(null!=i&&i.link)ne(null==i?void 0:i.link);else{if("custom"!==(null==i?void 0:i.type))return;switch(null==i?void 0:i.key){case"home":J(y?"/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/employee"):"/".concat(null===(r=window)||void 0===r?void 0:r.contextPath,"/citizen")),m();break;case"editProfile":O(),m();break;case"language":q((t=i).value),Digit.LocalizationService.changeLanguage(t.value,L.code),m();break;case"city":(e=>{var t,n,r,i=Digit.SessionStorage.get("citizen.userRequestObject"),o=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(t=t.info)||void 0===t||null===(t=t.roles)||void 0===t?void 0:t.filter(t=>t.tenantId===e.value);if((null==o?void 0:o.length)>0&&(i.info.roles=o,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),F(e),"undefined"!=typeof window&&null!==(n=window.location)&&void 0!==n&&null!==(n=n.href)&&void 0!==n&&n.includes("/".concat(null===(r=window)||void 0===r?void 0:r.contextPath,"/employee/"))){var l,a,s=(null===(l=$.state)||void 0===l?void 0:l.from)||"/".concat(null===(a=window)||void 0===a?void 0:a.contextPath,"/employee");J(s,{replace:!0})}try{"undefined"!=typeof window&&window.location.reload()}catch(e){console.warn("Failed to reload page:",e)}})(i),m()}}})({item:e.item,index:e.index,parentIndex:e.parentIndex})}):(0,d.jsx)(C,{logout:f})},R=n(8854);const M=()=>{var e,t,n,r=Digit.Hooks.useAccessControl(),i=r.isLoading,o=r.data,s=Digit.Utils.getMultiRootTenant(),u=(0,p.useTranslation)().t,c=(0,a.useNavigate)(),v=null===(e=Digit)||void 0===e||null===(e=e.ULBService)||void 0===e?void 0:e.getStateId();function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in e){var n=e[t];if("item"===t&&""!==(null==n?void 0:n.leftIcon))return null==n?void 0:n.leftIcon;if("object"==typeof e[t]&&!Array.isArray(e[t])){var r=m(e[t]);if(r)return r}}return null}function f(e,t){for(var n in t)t.hasOwnProperty(n)&&("object"!=typeof t[n]||Array.isArray(t[n])?e[n]||(e[n]=t[n]):(e[n]||(e[n]={}),f(e[n],t[n])))}var g={};null==o||o.actions.filter(e=>"url"===e.url).forEach(e=>{var t;if(null==e||null===(t=e.path)||void 0===t||null===(t=t.split("."))||void 0===t||t[0],""!==(null==e?void 0:e.path)){var n,r=null==e||null===(n=e.path)||void 0===n?void 0:n.split("."),i={};r.reduce((t,n,i)=>{if(i!==r.length-1)return t[n]={},t[n];t[n]={item:e}},i),f(g,i)}});var y=e=>(e.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:1/0)-(void 0!==t.orderNumber?t.orderNumber:1/0)),e.forEach(e=>{e.children&&e.children.length>0&&y(e.children)}),e),h=function(e){var t=(e,n)=>{if(n.item)return{label:u(n.item.displayName),icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL,orderNumber:n.item.orderNumber};var r=Object.keys(n).map(e=>t(e,n[e])),i=m(n);return{label:u(e),icon:{icon:i,width:"1.5rem",height:"1.5rem"},children:r}};return Object.keys(e).map(n=>t(n,e[n]))}((e=>{var t=Object.entries(e);return t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0),Object.fromEntries(t)})(g)),b=y(h);return i?(0,d.jsx)(l.Loader,{}):g?(0,d.jsx)(R.Ay,{minWidth:768,children:(0,d.jsx)(l.SideNav,{items:b,hideAccessbilityTools:!0,onSelect:e=>(e=>{var t=e.item;e.index,e.parentIndex,null!=t&&t.navigationUrl&&function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(n&&"/"!==n)if(/^https?:\/\//i.test(n))window.open(n,"_blank","noopener,noreferrer");else if(n.includes("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath)))t(n);else{var r,i=window.location.origin;if(s){var o,l=(null===(o=window)||void 0===o?void 0:o.contextPath)||"sandbox-ui";t(r=n=n.replace("/".concat(l,"/employee"),"/".concat(l,"/").concat(v,"/employee")))}else{r=i+n;try{"undefined"!=typeof window&&(window.location.href=r)}catch(e){console.warn("Navigation failed, attempting fallback:",e);try{window.location.replace(r)}catch(e){console.error("All navigation methods failed:",e)}}}}}(c,null==t?void 0:t.navigationUrl)})({item:e.item,index:e.index,parentIndex:e.parentIndex}),theme:(null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("SIDENAV_THEME"))||"dark",variant:(null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("SIDENAV_VARIANT"))||"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}})}):""},U=e=>{e.t;var t=e.CITIZEN,n=e.isSidebarOpen,r=e.toggleSidebar,i=e.handleLogout,o=e.mobileView,l=e.userDetails,a=e.modules,s=e.linkData,u=e.islinkDataLoading,c=e.userProfile;return t?(0,d.jsx)(L,{isOpen:n,isMobile:!0,toggleSidebar:r,onLogout:i,linkData:s,islinkDataLoading:u,userProfile:c,isEmployee:!1}):!n&&null!=l&&l.access_token?(0,d.jsx)("div",{className:"digit-employeeSidebar",children:(0,d.jsx)(M,{mobileView:o,userDetails:l,modules:a})}):(0,d.jsx)("div",{className:"digit-citizenSidebar",children:(0,d.jsx)(L,{isOpen:n,isMobile:!0,toggleSidebar:r,onLogout:i,isEmployee:!0,userProfile:c})})};function k(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function B(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){k(o,r,i,l,a,"next",e)}function a(e){k(o,r,i,l,a,"throw",e)}l(void 0)})}}function F(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var n={}.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,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const G=e=>{var t=e.t,n=e.stateInfo,o=e.userDetails,l=e.CITIZEN,s=e.cityDetails,u=e.mobileView,c=e.handleUserDropdownSelection,v=e.logoUrl,m=e.logoUrlWhite,p=e.showSidebar,g=void 0===p||p,y=e.showLanguageChange,b=e.linkData,O=e.islinkDataLoading,x=F((0,r.useState)(!1),2),S=x[0],w=x[1],j=(0,a.useNavigate)(),_=F((0,r.useState)(!1),2),C=_[0],N=_[1],E=()=>{w(!1),N(!0)},I=()=>{localStorage.removeItem("sso-provider"),localStorage.removeItem("sso-client-id"),localStorage.removeItem("sso-tenant-id"),localStorage.removeItem("sso-authority"),localStorage.removeItem("sso-logout-url")},A=()=>{var e;return"".concat(window.location.origin,"/").concat((null===(e=window)||void 0===e?void 0:e.contextPath)||"","/employee")},D=function(){var e=B(function*(){var e=localStorage.getItem("sso-provider"),t=null==e?void 0:e.toUpperCase(),n=localStorage.getItem("sso-logout-url");if(n){var r=A();I();try{yield Digit.UserService.logout()}finally{try{var i=new URL(n);i.searchParams.set("post_logout_redirect_uri",r),window.location.href=i.toString()}catch(e){window.location.href="".concat(n,"?post_logout_redirect_uri=").concat(encodeURIComponent(r))}}return!0}if("GOOGLE"===t){var o=A(),l=localStorage.getItem("google_access_token");I();try{var a;null!==(a=window.google)&&void 0!==a&&null!==(a=a.accounts)&&void 0!==a&&a.id&&window.google.accounts.id.disableAutoSelect(),l&&(yield fetch("https://oauth2.googleapis.com/revoke?token=".concat(encodeURIComponent(l)),{method:"POST",headers:{"Content-type":"application/x-www-form-urlencoded"}}),localStorage.removeItem("google_access_token")),yield Digit.UserService.logout()}catch(e){console.error("Google logout error",e),yield Digit.UserService.logout()}finally{window.location.href=o}return!0}if("MICROSOFT"===t){var s=localStorage.getItem("sso-tenant-id"),u=localStorage.getItem("sso-authority")||"https://login.microsoftonline.com",c=A();I();try{yield Digit.UserService.logout()}finally{if(s){var d="".concat(u.replace(/\/+$/,""),"/").concat(s,"/oauth2/logout");window.location.href="".concat(d,"?post_logout_redirect_uri=").concat(encodeURIComponent(c))}}return!0}return!1});return function(){return e.apply(this,arguments)}}(),P=function(){var e=B(function*(){(yield D())||Digit.UserService.logout(),N(!1)});return function(){return e.apply(this,arguments)}}(),T=()=>{N(!1)},L=()=>{w(!S)},R=()=>{var e,t;j(l?"/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/user/profile"):"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee/user/profile"))},M=[{name:t("EDIT_PROFILE"),icon:"Edit",func:R},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:E}];return(0,d.jsxs)(i().Fragment,{children:[(0,d.jsx)(f,{t,stateInfo:n,toggleSidebar:L,isSidebarOpen:S,handleLogout:E,userDetails:o,CITIZEN:l,cityDetails:s,mobileView:u,userOptions:M,handleUserDropdownSelection:c,logoUrl:v,logoUrlWhite:m,showLanguageChange:y}),C&&(0,d.jsx)(h.A,{onSelect:P,onCancel:T,onDismiss:T}),l?l?g&&S&&(0,d.jsx)(U,{t,CITIZEN:l,isSidebarOpen:S,toggleSidebar:L,handleLogout:E,mobileView:u,userDetails:o,linkData:b,userProfile:R,islinkDataLoading:O}):null:g&&(0,d.jsx)(U,{t,CITIZEN:l,isSidebarOpen:S,toggleSidebar:L,handleLogout:E,mobileView:u,userDetails:o,linkData:b,userProfile:R,islinkDataLoading:O})]})}},5181(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(4883),i=n(6870);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".digit-home-main";return function(n){return(0,r.useEffect)(()=>{var e=n=>{if("Tab"===n.key){var r=document.querySelector(t);r&&(r.setAttribute("tabindex","-1"),r.style.outline="none",r.focus()),window.removeEventListener("keydown",e)}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,i.jsx)(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n))}}},4989(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(4883);const i=function(e,t){var n=(0,r.useRef)();(0,r.useEffect)(()=>{n.current=e},[e]),(0,r.useEffect)(()=>{if(null!==t){var e=setInterval(function(){n.current()},t);return()=>clearInterval(e)}},[t])}},1065(e,t,n){"use strict";n.d(t,{P:()=>r});var r=e=>{var t=Digit.Utils.getConfigModuleName();return Digit.Hooks.useCommonMDMS(e,t,["LoginConfig"],{select:e=>{var n;return{config:null==e||null===(n=e[t])||void 0===n?void 0:n.LoginConfig}},retry:!1})}},7973(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(6243),i=n(4883),o=n(5953),l=n(338),a=n(6870);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const u=e=>{var t,n,r=e.question,u=e.answer,c=e.lastIndex,d=(t=(0,i.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.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)?s(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),v=d[0],m=d[1],f=(0,o.useTranslation)().t;return(0,a.jsxs)("div",{className:"faqs border-none",onClick:()=>m(!v),children:[(0,a.jsxs)("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"},children:[(0,a.jsx)("span",{children:f(r)}),(0,a.jsx)("span",{className:v?"faqicon rotate":"faqicon",style:{float:"right"},children:(0,a.jsx)(l.ArrowForward,{})})]}),(0,a.jsx)("div",{className:"faq-answer",style:v?{display:"block"}:{display:"none"},children:(0,a.jsx)("span",{children:f(u)})}),c?null:(0,a.jsx)("div",{className:"cs-box-border"})]})},c=e=>{var t,n,l=e.module,s=Digit.UserService.getUser(),c=((null==s||null===(t=s.info)||void 0===t?void 0:t.tenantId)||Digit.ULBService.getCurrentTenantId(),(0,o.useTranslation)().t),d=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),v=d.isLoading,m=d.data,f=null==m||null===(n=m.MdmsRes["common-masters"])||void 0===n||null===(n=n.faqs[0])||void 0===n?void 0:n["".concat(l)].faqs;return v?(0,a.jsx)(r.Loader,{}):(0,a.jsx)(i.Fragment,{children:(0,a.jsxs)("div",{className:"faq-page",children:[(0,a.jsx)(r.BackButton,{style:{marginLeft:"unset"}}),(0,a.jsx)("div",{style:{marginBottom:"15px"},children:(0,a.jsx)(r.HeaderComponent,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"},children:c("FAQ_S")})}),(0,a.jsx)("div",{className:"faq-list",children:f.map((e,t)=>(0,a.jsx)(u,{question:e.question,answer:e.answer,lastIndex:t===(null==f?void 0:f.length)-1},"faq_"+t))})]})})}},9466(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(6243),i=n(4883),o=n(5953),l=n(4442),a=n(6870);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=()=>{var e=(0,o.useTranslation)().t,t=(0,l.useNavigate)(),n=Digit.Hooks.useStore.getInitData(),s=n.data,c=void 0===s?{}:s,d=c.languages,v=c.stateInfo,m=n.isLoading,f=Digit.StoreData.getCurrentLanguage(),p=(0,i.useMemo)(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),g=(0,i.useMemo)(()=>({options:d,optionsKey:"label",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,v.code),selectedOption:null==d?void 0:d.filter(e=>e.value===f)[0]}),[f,d]);return m?(0,a.jsx)(r.Loader,{}):(0,a.jsx)("div",{className:"selection-card-wrapper",children:(0,a.jsxs)(r.PageBasedInput,{texts:p,onSubmit:function(){var e;t("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/select-location"))},children:[(0,a.jsx)(r.CardHeader,{children:e("CS_COMMON_CHOOSE_LANGUAGE")}),(0,a.jsx)(r.RadioButtons,u({},g))]})})}},6945(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>f});var r=n(6243),i=n(5053),o=n(4883),l=n(5953),a=n(4442),s=n(6870);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.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)?m(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const f=()=>{var e=(0,l.useTranslation)().t,t=(0,a.useNavigate)(),n=(0,a.useLocation)(),u=Digit.Hooks.useStore.getInitData(),d=u.data,m=void 0===d?{}:d,f=(m.stateInfo,m.uiHomePage),p=(u.isLoading,null==f?void 0:f.redirectURL),g=Digit.Hooks.useTenants(),y=g.data,h=g.isLoading,b=v((0,o.useState)(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),2),O=b[0],x=b[1],S=v((0,o.useState)(!1),2),w=S[0],j=S[1],_=(0,o.useMemo)(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function C(e){x(e),j(!1)}var N=(0,o.useMemo)(()=>({options:y,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:C,selectedOption:O}),[y,e,O]);return h?(0,s.jsx)("loader",{}):(0,s.jsxs)("div",{children:[(0,s.jsx)(r.BackLink,{onClick:()=>window.history.back()}),(0,s.jsxs)(i.PageBasedInput,{texts:_,onSubmit:function(){if(O){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",O);var r,i,o=null===(e=n.state)||void 0===e?void 0:e.redirectBackTo;p?t("/".concat(null===(r=window)||void 0===r?void 0:r.contextPath,"/citizen/").concat(p)):o?t(o,{replace:!0}):t("/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/citizen"))}else j(!0)},className:"location-selection-container",children:[(0,s.jsx)(i.CardHeader,{children:e("CS_COMMON_CHOOSE_LOCATION")}),(0,s.jsx)(i.SearchOnRadioButtons,c(c({},N),{},{placeholder:e("COMMON_TABLE_SEARCH")})),w?(0,s.jsx)(i.CardLabelError,{children:e("CS_COMMON_LOCATION_SELECTION_ERROR")}):null]})]})}},855(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>k});var r=n(6243),i=n(5053),o=n(4883),l=n.n(o),a=n(5953),s=n(4442),u=n(6870);function c(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.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,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const m=function(e){var t=e.setProfilePic,n=e.closeDrawer,r=e.userType,s=e.removeProfilePic,v=e.showToast,m=d((0,o.useState)(null),2),f=(m[0],m[1]),p=d((0,o.useState)(""),2),g=p[0],y=p[1],h=d((0,o.useState)(null),2),b=(h[0],h[1]),O=(0,a.useTranslation)().t;return(0,o.useEffect)(()=>{var e;(e=function*(){if(b(null),g)if(g.size>=1e6)v("error",O("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),b(O("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else try{var e,n=yield Digit.UploadServices.Filestorage("".concat(r,"-profile"),g,Digit.ULBService.getStateId());if((null==n||null===(e=n.data)||void 0===e||null===(e=e.files)||void 0===e?void 0:e.length)>0){var i,o=null==n||null===(i=n.data)||void 0===i||null===(i=i.files[0])||void 0===i?void 0:i.fileStoreId;f(o),t(o)}else v("error",O("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),b(O("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))}catch(e){v("error",O("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))}},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){c(o,r,i,l,a,"next",e)}function a(e){c(o,r,i,l,a,"throw",e)}l(void 0)})})()},[g]),(0,u.jsxs)(l().Fragment,{children:[(0,u.jsx)("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>n()}),(0,u.jsxs)("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===r?"2.5rem":"0",zIndex:"1000"},children:[(0,u.jsxs)("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"},children:[(0,u.jsxs)("label",{for:"file",style:{cursor:"pointer"},children:[" ",(0,u.jsx)(i.GalleryIcon,{})]}),(0,u.jsx)("label",{style:{cursor:"pointer"},children:" Gallery"}),(0,u.jsx)("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>y(e.target.files[0]),style:{display:"none"}})]}),(0,u.jsxs)("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"},children:[(0,u.jsx)("button",{onClick:()=>{s(),n()},children:(0,u.jsx)(i.RemoveIcon,{})}),(0,u.jsx)("label",{style:{cursor:"pointer"},children:"Remove"})]})]})]})};var f,p,g=n(6177);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function x(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){O(o,r,i,l,a,"next",e)}function a(e){O(o,r,i,l,a,"throw",e)}l(void 0)})}}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n={}.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)?w(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var j=null===(f=Digit)||void 0===f||null===(f=f.ULBService)||void 0===f||null===(p=f.getStateId)||void 0===p?void 0:p.call(f),_={tenantId:"".concat(j),UserProfileValidationConfig:[{name:"/^[a-zA-Z ]+$/i",mobileNumber:"/^[6-9]{1}[0-9]{9}$/",password:"/^([a-zA-Z0-9@#$%]{8,15})$/i"}]};const C=e=>{var t,n,c,d,v,f,p,y,b,O,w,j,C,N,E,I,A,D,P,T,L,R,M,U,k,B=e.stateCode,F=e.userType,V=e.cityDetails,G=(0,s.useNavigate)(),z=(0,a.useTranslation)().t,W=window.location.href,H=Digit.ULBService.getStateId(),q=Digit.ULBService.getCurrentTenantId(),X=(null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info)||{},Q=S((0,o.useState)(null),2),Z=Q[0],Y=Q[1],K=S((0,o.useState)(null!=X&&X.name?X.name:""),2),J=K[0],$=K[1],ee=S((0,o.useState)(null!=X&&X.emailId?X.emailId:""),2),te=ee[0],ne=ee[1],re=S((0,o.useState)(null==Z?void 0:Z.gender),2),ie=re[0],oe=re[1],le=S((0,o.useState)(null!=X&&X.permanentCity?X.permanentCity:V.name),2),ae=le[0],se=le[1],ue=S((0,o.useState)(null!=X&&X.mobileNumber?X.mobileNumber:""),2),ce=ue[0],de=ue[1],ve=S((0,o.useState)(null),2),me=ve[0],fe=ve[1],pe=S((0,o.useState)(""),2),ge=pe[0],ye=pe[1],he=S((0,o.useState)(!1),2),be=he[0],Oe=he[1],xe=S((0,o.useState)(!1),2),Se=xe[0],we=xe[1],je=S((0,o.useState)(""),2),_e=je[0],Ce=je[1],Ne=S((0,o.useState)(""),2),Ee=Ne[0],Ie=Ne[1],Ae=S((0,o.useState)(""),2),De=Ae[0],Pe=Ae[1],Te=S((0,o.useState)(null),2),Le=Te[0],Re=Te[1],Me=S((0,o.useState)(!1),2),Ue=Me[0],ke=Me[1],Be=S(l().useState(window.innerWidth),2),Fe=Be[0],Ve=Be[1],Ge=S(l().useState({}),2),ze=Ge[0],We=Ge[1],He=window.Digit.Utils.browser.isMobile(),qe=Digit.Utils.getMultiRootTenant(),Xe=null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH"),Qe=e=>{var t;return(null==e||null===(t=e.UserProfileValidationConfig)||void 0===t?void 0:t[0])&&Object.entries(null==e?void 0:e.UserProfileValidationConfig[0]).reduce((e,t)=>{var n=S(t,2),r=n[0],i=n[1];if("string"==typeof i)try{if(i.startsWith("/")&&i.lastIndexOf("/")>0){var o=i.lastIndexOf("/"),l=i.slice(1,o),a=i.slice(o+1);e[r]=new RegExp(l,a)}else e[r]=new RegExp(i)}catch(t){console.error('Error parsing regex for key "'.concat(r,'":'),t),e[r]=i}else e[r]=i;return e},{})},Ze=S((0,o.useState)(Qe(_)||{}),2),Ye=Ze[0],Ke=Ze[1],Je=Digit.Hooks.useCustomMDMS(B,"commonUiConfig",[{name:"UserProfileValidationConfig"}],{select:e=>null==e?void 0:e.commonUiConfig}),$e=Je.data,et=Je.isValidationConfigLoading;(0,o.useEffect)(()=>{var e;if($e&&null!=$e&&null!==(e=$e.UserProfileValidationConfig)&&void 0!==e&&e[0]){var t=Qe($e);Ke(t)}},[$e]);var tt=function(){var e=x(function*(){var e=null==X?void 0:X.uuid;if(e){var t,n=yield Digit.CustomService.getResponse({url:"".concat(Xe,"/v1/_search"),useCache:!1,method:"POST",userService:!0,params:{limit:1e3,offset:0,tenantId:q},body:{Individual:{userUuid:[e],tenantId:q}}});null!=n&&null!==(t=n.Individual)&&void 0!==t&&t.length&&Y(n.Individual[0])}});return function(){return e.apply(this,arguments)}}();l().useEffect(()=>(window.addEventListener("resize",()=>Ve(window.innerWidth)),()=>{window.removeEventListener("resize",()=>Ve(window.innerWidth))})),(0,o.useEffect)(()=>{var e;ke(!0),tt(),oe({i18nKey:void 0,code:null==Z?void 0:Z.gender,value:null==Z?void 0:Z.gender});var t=null==Z||null===(e=Z.photo)||void 0===e?void 0:e.split(",");ye(null==t?void 0:t.at(0)),ke(!1)},[null!==Z]);var nt=!1,rt=e=>oe(e),it=()=>Oe(!1),ot=e=>{var t;$(e),null==Ye||null===(t=Ye.name)||void 0===t||!t.test(e)||0===e.length||e.length>50?We(h(h({},ze),{},{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):We(h(h({},ze),{},{userName:null}))},lt=e=>{(null==X?void 0:X.userName)!==e?(ne(e),!e.length||e.includes("@")&&e.includes(".")?We(h(h({},ze),{},{emailAddress:null})):We(h(h({},ze),{},{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))):We(h(h({},ze),{},{emailAddress:null}))},at=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;Re({key:e,action:t}),setTimeout(()=>{Re(null)},n)},st=function(){var e=x(function*(){ke(!0);try{var e,t,n;if(J&&$(e=>e.trim()),null==Ye||!Ye.name.test(J)||""===J||J.length>50||J.length<1)throw JSON.stringify({type:"error",message:z("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===F&&(null==Ye||!Ye.mobileNumber.test(ce)))throw JSON.stringify({type:"error",message:z("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(te.length&&(!te.includes("@")||!te.includes(".")))throw JSON.stringify({type:"error",message:z("CORE_COMMON_PROFILE_EMAIL_INVALID")});var r,i=_e.trim(),o=Ee.trim(),l=De.trim();if(Ce(i),Ie(o),Pe(l),Se&&i&&o&&l){if(o!==l)throw JSON.stringify({type:"error",message:z("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(i.length&&o.length&&l.length))throw JSON.stringify({type:"error",message:z("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!(null!=Ye&&Ye.password.test(o)||null!=Ye&&Ye.password.test(l)))throw JSON.stringify({type:"error",message:z("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}var a=h(h({},Z),{},{tenantId:q,name:{givenName:J.trim(),familyName:null==Z||null===(e=Z.name)||void 0===e?void 0:e.familyName,otherNames:null==Z||null===(t=Z.name)||void 0===t?void 0:t.otherNames},mobileNumber:ce,isDeleted:!1,isSystemUser:!0,isSystemUserActive:!0});null!=ie&&ie.value&&(a.gender=ie.value),te&&(a.email=te),me&&(a.photo=me);var s=yield Digit.CustomService.getResponse({url:"".concat(Xe,"/v1/_update"),useCache:!1,method:"POST",userService:!0,body:{Individual:a}});if((r=null==s?void 0:s.responseInfo)&&"200"===r.status){var u=Digit.UserService.getUser();u&&Digit.UserService.setUser(h(h({},u),{},{info:h(h({},u.info),{},{name:J,mobileNumber:ce,emailId:te,permanentCity:ae})}))}if(_e.length&&Ee.length&&De.length){var c={existingPassword:_e,newPassword:Ee,tenantId:q,type:"EMPLOYEE",username:null==X?void 0:X.userName,confirmPassword:De};if(Ee!==De)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"});try{var d=(yield Digit.UserService.changePassword(c,q)).responseInfo;if(null==d||!d.status||"200"!==d.status)throw"";at("success",z("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)}catch(e){var v;throw JSON.stringify({type:"error",message:null!==(v=e.Errors)&&void 0!==v&&null!==(v=v.at(0))&&void 0!==v&&v.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})}}else null!==(n=r)&&void 0!==n&&n.status&&"200"===r.status&&at("success",z("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}catch(e){var m;try{m=JSON.parse(e)}catch(t){var f;m={type:"error",message:(null==e||null===(f=e.response)||void 0===f||null===(f=f.data)||void 0===f||null===(f=f.Errors)||void 0===f||null===(f=f[0])||void 0===f?void 0:f.description)||"CORE_COMMON_PROFILE_UPDATE_ERROR"}}at(m.type,z(m.message),5e3)}ke(!1)});return function(){return e.apply(this,arguments)}}(),ut=[],ct=Digit.Hooks.useGenderMDMS(H,"common-masters","GenderType").data;ct&&ct.map(e=>{ut.push({i18nKey:"PT_COMMON_GENDER_".concat(e.code),code:"".concat(e.code),value:"".concat(e.code)})});var dt=function(){var e=x(function*(e){fe(e);var t=e?yield vt([e],H):null;ye(null==t?void 0:t.thumbs[0]),it()});return function(t){return e.apply(this,arguments)}}(),vt=function(){var e=x(function*(e,t){var n=yield Digit.UploadServices.Filefetch(e,t);return n.data.fileStoreIds&&0!==n.data.fileStoreIds.length?{thumbs:n.data.fileStoreIds.map(e=>e.url.split(",")[3]),images:n.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null});return function(t,n){return e.apply(this,arguments)}}();return Ue||et?(0,u.jsx)(r.Loader,{}):(0,u.jsxs)("div",{className:"user-profile ".concat("citizen"===F?"citizen":"employee"),children:[(0,u.jsx)("section",{style:{margin:"citizen"===F||He?"8px":"0px"},children:"citizen"===F||He?(0,u.jsx)(r.BackLink,{onClick:()=>G(-1)}):(0,u.jsx)(r.BreadCrumb,{style:{marginTop:"0rem",marginBottom:"1.5rem"},crumbs:[{internalLink:qe?"/".concat(null===(c=window)||void 0===c?void 0:c.contextPath,"/employee/sandbox/landing"):"/".concat(null===(d=window)||void 0===d?void 0:d.contextPath,"/employee"),content:z("ES_COMMON_HOME"),show:!0},{internalLink:"/".concat(null===(v=window)||void 0===v?void 0:v.contextPath,"/employee/user/profile"),content:z("ES_COMMON_PAGE_1"),show:W.includes("/user/profile")}]})}),(0,u.jsxs)("div",{style:{display:"flex",flex:1,flexDirection:Fe<768||"citizen"===F?"column":"row",margin:"citizen"===F?"8px":"0px",gap:"citizen"===F?"":"0 24px",boxShadow:"citizen"===F?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===F?"white":"",borderRadius:"citizen"===F?"4px":"",maxWidth:"citizen"===F?"960px":""},children:[(0,u.jsx)("section",{style:{position:"relative",display:"flex",flex:"citizen"===F?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===F?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:"".concat("citizen"===F?"8px":"24px"," solid #fff"),background:"#EEEEEE",padding:"citizen"===F?"8px":"16px"},children:(0,u.jsxs)("div",{style:{position:"relative",height:"citizen"===F?"114px":"150px",width:"citizen"===F?"114px":"150px",margin:"16px"},children:[(0,u.jsx)(g.A,{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:ge&&""!==ge?ge:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC",alt:"Profile Image"}),(0,u.jsx)("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>Oe(!be),children:(0,u.jsx)(i.CameraIcon,{})})]})}),(0,u.jsx)("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===F?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===F?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===F?"8px":"24px",paddingBottom:"20px"},children:"citizen"===F?(0,u.jsxs)(l().Fragment,{children:[(0,u.jsxs)(r.LabelFieldPair,{children:[(0,u.jsxs)(r.CardLabel,{className:"user-profile",style:{},children:["".concat(z("CORE_COMMON_PROFILE_NAME")),"*"]}),(0,u.jsxs)("div",{style:{width:"100%",maxWidth:"960px"},children:[(0,u.jsx)(r.TextInput,h(h({t:z,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:J,onChange:e=>ot(e.target.value)},{isRequired:!0,pattern:(null==$e||null===(f=$e.UserProfileValidationConfig)||void 0===f||null===(f=f[0])||void 0===f?void 0:f.name)||(null==_||null===(p=_.UserProfileValidationConfig)||void 0===p||null===(p=p[0])||void 0===p?void 0:p.name),type:"tel",title:z("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")}),{},{disable:nt})),(null==ze?void 0:ze.userName)&&(0,u.jsx)(r.ErrorMessage,{message:z(null==ze||null===(y=ze.userName)||void 0===y?void 0:y.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{children:[(0,u.jsx)(r.CardLabel,{className:"user-profile",style:{},children:"".concat(z("CORE_COMMON_PROFILE_GENDER"))}),(0,u.jsx)(r.Dropdown,{style:{width:"100%",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==ie?void 0:ie.length)?ie[0]:ie,disable:1===(null==ie?void 0:ie.length)||nt,option:ut,select:rt,value:ie,optionKey:"code",t:z,name:"gender"})]}),(0,u.jsxs)(r.LabelFieldPair,{children:[(0,u.jsx)(r.CardLabel,{className:"user-profile",style:{},children:"".concat(z("CORE_COMMON_PROFILE_EMAIL"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,{t:z,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:te,onChange:e=>lt(e.target.value),disabled:nt}),(null==ze?void 0:ze.emailAddress)&&(0,u.jsx)(r.ErrorMessage,{message:z(null==ze||null===(b=ze.emailAddress)||void 0===b?void 0:b.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsx)("button",{onClick:st,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:He?"100%":"240px",borderBottom:"1px solid black"},children:z("CORE_COMMON_SAVE")})]}):(0,u.jsxs)(l().Fragment,{children:[(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsxs)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:["".concat(z("CORE_COMMON_PROFILE_NAME")),"*"]}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,h(h({t:z,type:"text",isMandatory:!1,name:"name",value:J,onChange:e=>ot(e.target.value),placeholder:"Enter Your Name"},{isRequired:!0,pattern:(null==$e||null===(O=$e.UserProfileValidationConfig)||void 0===O||null===(O=O[0])||void 0===O?void 0:O.name)||(null==_||null===(w=_.UserProfileValidationConfig)||void 0===w||null===(w=w[0])||void 0===w?void 0:w.name),type:"text",title:z("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")}),{},{disabled:nt})),(null==ze?void 0:ze.userName)&&(0,u.jsx)(r.ErrorMessage,{message:z(null==ze||null===(j=ze.userName)||void 0===j?void 0:j.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(z("CORE_COMMON_PROFILE_GENDER"))}),(0,u.jsx)("div",{style:{width:"100%"},children:(0,u.jsx)(r.Dropdown,{className:"profileDropdown",selected:1===(null==ie?void 0:ie.length)?ie[0]:ie,disable:1===(null==ie?void 0:ie.length)||nt,option:ut,select:rt,value:ie,optionKey:"code",t:z,name:"gender"})})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(z("CORE_COMMON_PROFILE_CITY"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,h(h({t:z,type:"text",isMandatory:!1,name:"city",value:z(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_".concat(q))),onChange:e=>se(e.target.value),placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:z("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")}),{},{disabled:!0})),(0,u.jsx)(r.ErrorMessage,{})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(z("CORE_COMMON_PROFILE_MOBILE_NUMBER"),"*")}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.MobileNumber,{value:ce,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{var t;de(e),"employee"!==F||null!=Ye&&null!==(t=Ye.mobileNumber)&&void 0!==t&&t.test(e)?We(h(h({},ze),{},{mobileNumber:null})):We(h(h({},ze),{},{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))})(e),disable:!Digit.Utils.getMultiRootTenant(),required:!0,pattern:(null==$e||null===(C=$e.UserProfileValidationConfig)||void 0===C||null===(C=C[0])||void 0===C?void 0:C.mobileNumber)||(null==_||null===(N=_.UserProfileValidationConfig)||void 0===N||null===(N=N[0])||void 0===N?void 0:N.mobileNumber),type:"tel",title:z("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==ze?void 0:ze.mobileNumber)&&(0,u.jsx)(r.ErrorMessage,{message:z(null==ze||null===(E=ze.mobileNumber)||void 0===E?void 0:E.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(z("CORE_COMMON_PROFILE_EMAIL"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,{t:z,type:"email",isMandatory:!1,placeholder:z("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:te,onChange:e=>lt(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()||nt}),(null==ze?void 0:ze.emailAddress)&&(0,u.jsx)(r.ErrorMessage,{message:z(null==ze||null===(I=ze.emailAddress)||void 0===I?void 0:I.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsx)(r.LabelFieldPair,{children:(0,u.jsxs)("div",{style:{width:"100%"},children:[0!=Se||Digit.Utils.getOTPBasedLogin()?null:(0,u.jsx)(r.Button,{label:z("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>we(!Se),style:{paddingLeft:"20rem"}}),Se?(0,u.jsxs)("div",{style:{marginTop:"10px"},children:[(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(z("CORE_COMMON_PROFILE_CURRENT_PASSWORD"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,{t:z,type:"password",isMandatory:!1,name:"name",pattern:(null==$e||null===(A=$e.UserProfileValidationConfig)||void 0===A||null===(A=A[0])||void 0===A?void 0:A.password)||(null==_||null===(D=_.UserProfileValidationConfig)||void 0===D||null===(D=D[0])||void 0===D?void 0:D.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,void(null!=Ye&&Ye.password.test(n)?We(h(h({},ze),{},{currentPassword:null})):We(h(h({},ze),{},{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:nt}),(null==ze?void 0:ze.currentPassword)&&(0,u.jsx)(r.ErrorMessage,{message:z(null==ze||null===(P=ze.currentPassword)||void 0===P?void 0:P.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(z("CORE_COMMON_PROFILE_NEW_PASSWORD"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,{t:z,type:"password",isMandatory:!1,name:"name",pattern:(null==$e||null===(T=$e.UserProfileValidationConfig)||void 0===T||null===(T=T[0])||void 0===T?void 0:T.password)||(null==_||null===(L=_.UserProfileValidationConfig)||void 0===L||null===(L=L[0])||void 0===L?void 0:L.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Ie(n),void(null!=Ye&&Ye.password.test(n)?We(h(h({},ze),{},{newPassword:null})):We(h(h({},ze),{},{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:nt}),(null==ze?void 0:ze.newPassword)&&(0,u.jsx)(r.ErrorMessage,{message:z(null==ze||null===(R=ze.newPassword)||void 0===R?void 0:R.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(z("CORE_COMMON_PROFILE_CONFIRM_PASSWORD"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,{t:z,type:"password",isMandatory:!1,name:"name",pattern:(null==$e||null===(M=$e.UserProfileValidationConfig)||void 0===M||null===(M=M[0])||void 0===M?void 0:M.password)||(null==_||null===(U=_.UserProfileValidationConfig)||void 0===U||null===(U=U[0])||void 0===U?void 0:U.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Pe(n),void(null!=Ye&&Ye.password.test(n)?We(h(h({},ze),{},{confirmPassword:null})):We(h(h({},ze),{},{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:nt}),(null==ze?void 0:ze.confirmPassword)&&(0,u.jsx)(r.ErrorMessage,{message:z(null==ze||null===(k=ze.confirmPassword)||void 0===k?void 0:k.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]})]}):""]})}),"employee"===F&&He?(0,u.jsx)("button",{onClick:st,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:He?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"},children:z("CORE_COMMON_SAVE")}):null]})})]}),"employee"!==F||He?null:(0,u.jsx)(r.Footer,{actionFields:[(0,u.jsx)(r.SubmitBar,{t:z,label:z("CORE_COMMON_SAVE"),onSubmit:st})],className:"",setactionFieldsToRight:!0}),Le&&(0,u.jsx)(r.Toast,{type:Le.key,label:z("success"===Le.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":Le.action),onClose:()=>Re(null),style:{maxWidth:"670px"}}),1==be?(0,u.jsx)(m,{setProfilePic:dt,closeDrawer:it,userType:F,removeProfilePic:()=>{fe(null),ye(null)},showToast:at}):""]})};var N,E;function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function T(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){P(o,r,i,l,a,"next",e)}function a(e){P(o,r,i,l,a,"throw",e)}l(void 0)})}}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n={}.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)?R(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var M=null===(N=Digit)||void 0===N||null===(N=N.ULBService)||void 0===N||null===(E=N.getStateId)||void 0===E?void 0:E.call(N),U={tenantId:"".concat(M),UserProfileValidationConfig:[{name:"/^[a-zA-Z ]+$/i",mobileNumber:"/^[6-9]{1}[0-9]{9}$/",password:"/^([a-zA-Z0-9@#$%]{8,15})$/i"}]};const k=e=>{var t,n,c,d,v,f,p,y,h,b,O,x,S,w,j,_,N,E,I,D,P,R,M,k,B,F,V=e.stateCode,G=e.userType,z=e.cityDetails,W=null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("USE_INDIVIDUAL_MODEL"),H=null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");if(W&&H)return(0,u.jsx)(C,{stateCode:V,userType:G,cityDetails:z});var q=(0,s.useNavigate)(),X=(0,a.useTranslation)().t,Q=window.location.href,Z=Digit.ULBService.getStateId(),Y=Digit.ULBService.getCurrentTenantId(),K=(null===(c=Digit.UserService.getUser())||void 0===c?void 0:c.info)||{},J=L((0,o.useState)(null),2),$=J[0],ee=J[1],te=L((0,o.useState)(null!=K&&K.name?K.name:""),2),ne=te[0],re=te[1],ie=L((0,o.useState)(null!=K&&K.emailId?K.emailId:""),2),oe=ie[0],le=ie[1],ae=L((0,o.useState)(null==$?void 0:$.gender),2),se=ae[0],ue=ae[1],ce=L((0,o.useState)(null!=K&&K.permanentCity?K.permanentCity:z.name),2),de=ce[0],ve=ce[1],me=L((0,o.useState)(null!=K&&K.mobileNumber?K.mobileNumber:""),2),fe=me[0],pe=me[1],ge=L((0,o.useState)(null),2),ye=ge[0],he=ge[1],be=L((0,o.useState)(""),2),Oe=be[0],xe=be[1],Se=L((0,o.useState)(!1),2),we=Se[0],je=Se[1],_e=L((0,o.useState)(!1),2),Ce=_e[0],Ne=_e[1],Ee=L((0,o.useState)(""),2),Ie=Ee[0],Ae=Ee[1],De=L((0,o.useState)(""),2),Pe=De[0],Te=De[1],Le=L((0,o.useState)(""),2),Re=Le[0],Me=Le[1],Ue=L((0,o.useState)(null),2),ke=Ue[0],Be=Ue[1],Fe=L((0,o.useState)(!1),2),Ve=Fe[0],Ge=Fe[1],ze=L(l().useState(window.innerWidth),2),We=ze[0],He=ze[1],qe=L(l().useState({}),2),Xe=qe[0],Qe=qe[1],Ze=window.Digit.Utils.browser.isMobile(),Ye=Digit.Utils.getMultiRootTenant(),Ke=e=>{var t;return(null==e||null===(t=e.UserProfileValidationConfig)||void 0===t?void 0:t[0])&&Object.entries(null==e?void 0:e.UserProfileValidationConfig[0]).reduce((e,t)=>{var n=L(t,2),r=n[0],i=n[1];if("string"==typeof i)try{if(i.startsWith("/")&&i.lastIndexOf("/")>0){var o=i.lastIndexOf("/"),l=i.slice(1,o),a=i.slice(o+1);e[r]=new RegExp(l,a)}else e[r]=new RegExp(i)}catch(t){console.error('Error parsing regex for key "'.concat(r,'":'),t),e[r]=i}else e[r]=i;return e},{})},Je=L((0,o.useState)(Ke(U)||{}),2),$e=Je[0],et=Je[1],tt=Digit.Hooks.useCustomMDMS(V,"commonUiConfig",[{name:"UserProfileValidationConfig"}],{select:e=>null==e?void 0:e.commonUiConfig}),nt=tt.data,rt=tt.isValidationConfigLoading;(0,o.useEffect)(()=>{var e;if(nt&&null!=nt&&null!==(e=nt.UserProfileValidationConfig)&&void 0!==e&&e[0]){var t=Ke(nt);et(t)}},[nt]);var it=function(){var e=T(function*(){var e=null==K?void 0:K.uuid;if(e){var t=yield Digit.UserService.userSearch(Y,{uuid:[e]},{});t&&t.user&&t.user.length&&ee(t.user[0])}});return function(){return e.apply(this,arguments)}}();l().useEffect(()=>{var e=()=>He(window.innerWidth);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,o.useEffect)(()=>{var e;Ge(!0),it(),ue({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(",");xe(null==t?void 0:t.at(0)),Ge(!1)},[null!==$]);var ot=!1,lt=e=>ue(e),at=()=>je(!1),st=e=>{var t;re(e),null==$e||null===(t=$e.name)||void 0===t||!t.test(e)||0===e.length||e.length>50?Qe(A(A({},Xe),{},{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):Qe(A(A({},Xe),{},{userName:null}))},ut=e=>{(null==K?void 0:K.userName)!==e?(le(e),!e.length||e.includes("@")&&e.includes(".")?Qe(A(A({},Xe),{},{emailAddress:null})):Qe(A(A({},Xe),{},{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))):Qe(A(A({},Xe),{},{emailAddress:null}))},ct=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;Be({key:e,action:t}),setTimeout(()=>{Be(null)},n)},dt=function(){var e=T(function*(){Ge(!0);try{var e=A(A({},K),{},{name:ne,gender:null==se?void 0:se.value,emailId:oe,photo:ye});if(ne&&re(e=>e.trim()),null==$e||!$e.name.test(ne)||""===ne||ne.length>50||ne.length<1)throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===G&&(null==$e||!$e.mobileNumber.test(fe)))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(oe.length&&(!oe.includes("@")||!oe.includes(".")))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_EMAIL_INVALID")});var t=Ie.trim(),n=Pe.trim(),r=Re.trim();if(Ae(t),Te(n),Me(r),Ce&&t&&n&&r){if(n!==r)throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(t.length&&n.length&&r.length))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!(null!=$e&&$e.password.test(n)||null!=$e&&$e.password.test(r)))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}var i=yield Digit.UserService.updateUser(e,V),o=i.responseInfo;if(i.user,o&&"200"===o.status){var l=Digit.UserService.getUser();l&&Digit.UserService.setUser(A(A({},l),{},{info:A(A({},l.info),{},{name:ne,mobileNumber:fe,emailId:oe,permanentCity:de})}))}if(Ie.length&&Pe.length&&Re.length){var a={existingPassword:Ie,newPassword:Pe,tenantId:Y,type:"EMPLOYEE",username:null==K?void 0:K.userName,confirmPassword:Re};if(Pe!==Re)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"});try{var s=(yield Digit.UserService.changePassword(a,Y)).responseInfo;if(null==s||!s.status||"200"!==s.status)throw"";ct("success",X("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)}catch(e){var u;throw JSON.stringify({type:"error",message:null!==(u=e.Errors)&&void 0!==u&&null!==(u=u.at(0))&&void 0!==u&&u.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})}}else null!=o&&o.status&&"200"===o.status&&ct("success",X("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}catch(e){var c=JSON.parse(e);ct(c.type,X(c.message),5e3)}Ge(!1)});return function(){return e.apply(this,arguments)}}(),vt=[],mt=Digit.Hooks.useGenderMDMS(Z,"common-masters","GenderType").data;mt&&mt.map(e=>{vt.push({i18nKey:"PT_COMMON_GENDER_".concat(e.code),code:"".concat(e.code),value:"".concat(e.code)})});var ft=function(){var e=T(function*(e){he(e);var t=e?yield pt([e],Z):null;xe(null==t?void 0:t.thumbs[0]),at()});return function(t){return e.apply(this,arguments)}}(),pt=function(){var e=T(function*(e,t){var n=yield Digit.UploadServices.Filefetch(e,t);return n.data.fileStoreIds&&0!==n.data.fileStoreIds.length?{thumbs:n.data.fileStoreIds.map(e=>e.url.split(",")[3]),images:n.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null});return function(t,n){return e.apply(this,arguments)}}();return Ve||rt?(0,u.jsx)(r.Loader,{}):(0,u.jsxs)("div",{className:"user-profile ".concat("citizen"===G?"citizen":"employee"),children:[(0,u.jsx)("section",{style:{margin:"citizen"===G||Ze?"8px":"0px"},children:"citizen"===G||Ze?(0,u.jsx)(r.BackLink,{onClick:()=>q("/")}):(0,u.jsx)(r.BreadCrumb,{style:{marginTop:"0rem",marginBottom:"1.5rem"},crumbs:[{internalLink:Ye?"/".concat(null===(d=window)||void 0===d?void 0:d.contextPath,"/employee/sandbox/landing"):"/".concat(null===(v=window)||void 0===v?void 0:v.contextPath,"/employee"),content:X("ES_COMMON_HOME"),show:!0},{internalLink:"/".concat(null===(f=window)||void 0===f?void 0:f.contextPath,"/employee/user/profile"),content:X("ES_COMMON_PAGE_1"),show:Q.includes("/user/profile")}]})}),(0,u.jsxs)("div",{style:{display:"flex",flex:1,flexDirection:We<768||"citizen"===G?"column":"row",margin:"citizen"===G?"8px":"0px",gap:"citizen"===G?"":"0 24px",boxShadow:"citizen"===G?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===G?"white":"",borderRadius:"citizen"===G?"4px":"",maxWidth:"citizen"===G?"960px":""},children:[(0,u.jsx)("section",{style:{position:"relative",display:"flex",flex:"citizen"===G?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===G?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:"".concat("citizen"===G?"8px":"24px"," solid #fff"),background:"#EEEEEE",padding:"citizen"===G?"8px":"16px"},children:(0,u.jsxs)("div",{style:{position:"relative",height:"citizen"===G?"114px":"150px",width:"citizen"===G?"114px":"150px",margin:"16px"},children:[(0,u.jsx)(g.A,{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:Oe&&""!==Oe?Oe:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC",alt:"Profile Image"}),(0,u.jsx)("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>je(!we),children:(0,u.jsx)(i.CameraIcon,{})})]})}),(0,u.jsx)("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===G?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===G?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===G?"8px":"24px",paddingBottom:"20px"},children:"citizen"===G?(0,u.jsxs)(l().Fragment,{children:[(0,u.jsxs)(r.LabelFieldPair,{children:[(0,u.jsxs)(r.CardLabel,{className:"user-profile",style:{},children:["".concat(X("CORE_COMMON_PROFILE_NAME")),"*"]}),(0,u.jsxs)("div",{style:{width:"40rem",maxWidth:"960px"},children:[(0,u.jsx)(r.TextInput,A(A({t:X,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:ne,onChange:e=>st(e.target.value)},{isRequired:!0,pattern:(null==nt||null===(p=nt.UserProfileValidationConfig)||void 0===p||null===(p=p[0])||void 0===p?void 0:p.name)||(null==U||null===(y=U.UserProfileValidationConfig)||void 0===y||null===(y=y[0])||void 0===y?void 0:y.name),type:"tel",title:X("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")}),{},{disable:ot})),(null==Xe?void 0:Xe.userName)&&(0,u.jsx)(r.ErrorMessage,{message:X(null==Xe||null===(h=Xe.userName)||void 0===h?void 0:h.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{children:[(0,u.jsx)(r.CardLabel,{className:"user-profile",style:{},children:"".concat(X("CORE_COMMON_PROFILE_GENDER"))}),(0,u.jsx)(r.Dropdown,{style:{width:"40rem",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==se?void 0:se.length)?se[0]:se,disable:1===(null==se?void 0:se.length)||ot,option:vt,select:lt,value:se,optionKey:"code",t:X,name:"gender"})]}),(0,u.jsxs)(r.LabelFieldPair,{children:[(0,u.jsx)(r.CardLabel,{className:"user-profile",style:{},children:"".concat(X("CORE_COMMON_PROFILE_EMAIL"))}),(0,u.jsxs)("div",{style:{width:"40rem"},children:[(0,u.jsx)(r.TextInput,{t:X,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:oe,onChange:e=>ut(e.target.value),disabled:ot}),(null==Xe?void 0:Xe.emailAddress)&&(0,u.jsx)(r.ErrorMessage,{message:X(null==Xe||null===(b=Xe.emailAddress)||void 0===b?void 0:b.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsx)("button",{onClick:dt,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Ze?"100%":"240px",borderBottom:"1px solid black"},children:X("CORE_COMMON_SAVE")})]}):(0,u.jsxs)(l().Fragment,{children:[(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsxs)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:["".concat(X("CORE_COMMON_PROFILE_NAME")),"*"]}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,A(A({t:X,type:"text",isMandatory:!1,name:"name",value:ne,onChange:e=>st(e.target.value),placeholder:"Enter Your Name"},{isRequired:!0,pattern:(null==nt||null===(O=nt.UserProfileValidationConfig)||void 0===O||null===(O=O[0])||void 0===O?void 0:O.name)||(null==U||null===(x=U.UserProfileValidationConfig)||void 0===x||null===(x=x[0])||void 0===x?void 0:x.name),type:"text",title:X("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")}),{},{disabled:ot})),(null==Xe?void 0:Xe.userName)&&(0,u.jsx)(r.ErrorMessage,{message:X(null==Xe||null===(S=Xe.userName)||void 0===S?void 0:S.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(X("CORE_COMMON_PROFILE_GENDER"))}),(0,u.jsx)("div",{style:{width:"100%"},children:(0,u.jsx)(r.Dropdown,{className:"profileDropdown",selected:1===(null==se?void 0:se.length)?se[0]:se,disable:1===(null==se?void 0:se.length)||ot,option:vt,select:lt,value:se,optionKey:"code",t:X,name:"gender"})})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(X("CORE_COMMON_PROFILE_CITY"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,A(A({t:X,type:"text",isMandatory:!1,name:"city",value:X(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_".concat(Y))),onChange:e=>ve(e.target.value),placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:X("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")}),{},{disabled:!0})),(0,u.jsx)(r.ErrorMessage,{})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(X("CORE_COMMON_PROFILE_MOBILE_NUMBER"),"*")}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.MobileNumber,{value:fe,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{var t;pe(e),"employee"!==G||null!=$e&&null!==(t=$e.mobileNumber)&&void 0!==t&&t.test(e)?Qe(A(A({},Xe),{},{mobileNumber:null})):Qe(A(A({},Xe),{},{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))})(e),disable:!Digit.Utils.getMultiRootTenant(),required:!0,pattern:(null==nt||null===(w=nt.UserProfileValidationConfig)||void 0===w||null===(w=w[0])||void 0===w?void 0:w.mobileNumber)||(null==U||null===(j=U.UserProfileValidationConfig)||void 0===j||null===(j=j[0])||void 0===j?void 0:j.mobileNumber),type:"tel",title:X("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==Xe?void 0:Xe.mobileNumber)&&(0,u.jsx)(r.ErrorMessage,{message:X(null==Xe||null===(_=Xe.mobileNumber)||void 0===_?void 0:_.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(X("CORE_COMMON_PROFILE_EMAIL"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,{t:X,type:"email",isMandatory:!1,placeholder:X("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:oe,onChange:e=>ut(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()||ot}),(null==Xe?void 0:Xe.emailAddress)&&(0,u.jsx)(r.ErrorMessage,{message:X(null==Xe||null===(N=Xe.emailAddress)||void 0===N?void 0:N.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsx)(r.LabelFieldPair,{children:(0,u.jsxs)("div",{style:{width:"100%"},children:[0!=Ce||Digit.Utils.getOTPBasedLogin()?null:(0,u.jsx)(r.Button,{label:X("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>Ne(!Ce),style:{paddingLeft:"0rem"}}),Ce?(0,u.jsxs)("div",{style:{marginTop:"10px"},children:[(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(X("CORE_COMMON_PROFILE_CURRENT_PASSWORD"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,{t:X,type:"password",isMandatory:!1,name:"name",pattern:(null==nt||null===(E=nt.UserProfileValidationConfig)||void 0===E||null===(E=E[0])||void 0===E?void 0:E.password)||(null==U||null===(I=U.UserProfileValidationConfig)||void 0===I||null===(I=I[0])||void 0===I?void 0:I.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,void(null!=$e&&$e.password.test(n)?Qe(A(A({},Xe),{},{currentPassword:null})):Qe(A(A({},Xe),{},{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:ot}),(null==Xe?void 0:Xe.currentPassword)&&(0,u.jsx)(r.ErrorMessage,{message:X(null==Xe||null===(D=Xe.currentPassword)||void 0===D?void 0:D.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(X("CORE_COMMON_PROFILE_NEW_PASSWORD"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,{t:X,type:"password",isMandatory:!1,name:"name",pattern:(null==nt||null===(P=nt.UserProfileValidationConfig)||void 0===P||null===(P=P[0])||void 0===P?void 0:P.password)||(null==U||null===(R=U.UserProfileValidationConfig)||void 0===R||null===(R=R[0])||void 0===R?void 0:R.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Te(n),void(null!=$e&&$e.password.test(n)?Qe(A(A({},Xe),{},{newPassword:null})):Qe(A(A({},Xe),{},{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:ot}),(null==Xe?void 0:Xe.newPassword)&&(0,u.jsx)(r.ErrorMessage,{message:X(null==Xe||null===(M=Xe.newPassword)||void 0===M?void 0:M.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]}),(0,u.jsxs)(r.LabelFieldPair,{style:{display:"flex"},children:[(0,u.jsx)(r.CardLabel,{className:"profile-label-margin",style:{width:"300px"},children:"".concat(X("CORE_COMMON_PROFILE_CONFIRM_PASSWORD"))}),(0,u.jsxs)("div",{style:{width:"100%"},children:[(0,u.jsx)(r.TextInput,{t:X,type:"password",isMandatory:!1,name:"name",pattern:(null==nt||null===(k=nt.UserProfileValidationConfig)||void 0===k||null===(k=k[0])||void 0===k?void 0:k.password)||(null==U||null===(B=U.UserProfileValidationConfig)||void 0===B||null===(B=B[0])||void 0===B?void 0:B.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Me(n),void(null!=$e&&$e.password.test(n)?Qe(A(A({},Xe),{},{confirmPassword:null})):Qe(A(A({},Xe),{},{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:ot}),(null==Xe?void 0:Xe.confirmPassword)&&(0,u.jsx)(r.ErrorMessage,{message:X(null==Xe||null===(F=Xe.confirmPassword)||void 0===F?void 0:F.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})]})]})]}):""]})}),"employee"===G&&Ze?(0,u.jsx)("button",{onClick:dt,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Ze?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"},children:X("CORE_COMMON_SAVE")}):null]})})]}),"employee"!==G||Ze?null:(0,u.jsx)(r.Footer,{actionFields:[(0,u.jsx)(r.SubmitBar,{t:X,label:X("CORE_COMMON_SAVE"),onSubmit:dt})],className:"",setactionFieldsToRight:!0}),ke&&(0,u.jsx)(r.Toast,{type:ke.key,label:X("success"===ke.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":ke.action),onClose:()=>Be(null),style:{maxWidth:"670px"}}),1==we?(0,u.jsx)(m,{setProfilePic:ft,closeDrawer:at,userType:G,removeProfilePic:()=>{he(null),xe(null)},showToast:ct}):""]})}},6614(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(5053),i=(n(4883),n(5953)),o=n(4442),l=n(6177),a=n(6870);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=()=>{var e,t,n,s,c,d,v,m,f,p,g,y,h,b,O,x,S=(0,i.useTranslation)().t,w=(0,o.useNavigate)(),j=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCitizenCurrentTenant(!0),_=Digit.Hooks.useStore.getInitData(),C=_.data,N=void 0===C?{}:C,E=(N.stateInfo,N.uiHomePage),I=_.isLoading,A=window.Digit.Utils.browser.isMobile(),D=()=>{var e,t;return"EMPLOYEE"!==(null===(e=Digit.UserService)||void 0===e||null===(e=e.getUser())||void 0===e||null===(e=e.info)||void 0===e?void 0:e.type)&&!(null===(t=Digit.UserService)||void 0===t||null===(t=t.getUser())||void 0===t||!t.access_token)},P=Digit.Hooks.useEvents({tenantId:j,variant:"whats-new",config:{enabled:D()}}),T=P.data,L=P.isLoading;j||w("/".concat(null===(x=window)||void 0===x?void 0:x.contextPath,"/citizen/select-language"));var R,M,U=null==E?void 0:E.appBannerDesktop,k=null==E?void 0:E.appBannerMobile,B=null==E?void 0:E.citizenServicesCard,F=null==E?void 0:E.informationAndUpdatesCard,V=null==E?void 0:E.whatsAppBannerDesktop,G=null==E?void 0:E.whatsAppBannerMobile,z=null==E?void 0:E.whatsNewSection,W=null==E?void 0:E.redirectURL;W&&w("/".concat(null===(R=window)||void 0===R?void 0:R.contextPath,"/citizen/").concat(W)),(null!==(e=window)&&void 0!==e&&null!==(e=e.location)&&void 0!==e&&null!==(e=e.href)&&void 0!==e&&null!==(t=e.includes)&&void 0!==t&&t.call(e,"sanitation-ui")||null!==(n=window)&&void 0!==n&&null!==(n=n.location)&&void 0!==n&&null!==(n=n.href)&&void 0!==n&&null!==(s=n.includes)&&void 0!==s&&s.call(n,"sandbox-ui"))&&w("/".concat(null===(M=window)||void 0===M?void 0:M.contextPath,"/citizen/all-services"));var H=e=>{window.open(null==e?void 0:e.navigationUrl)},q={header:S(null==B?void 0:B.headerLabel),sideOption:{name:S(null==B||null===(c=B.sideOption)||void 0===c?void 0:c.name),onClick:()=>{var e;return w(null==B||null===(e=B.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:S(null==B||null===(d=B.props)||void 0===d||null===(d=d[0])||void 0===d?void 0:d.label),Icon:(0,a.jsx)(r.ComplaintIcon,{}),onClick:()=>{var e;return w(null==B||null===(e=B.props)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==B||null===(v=B.props)||void 0===v||null===(v=v[1])||void 0===v?void 0:v.label),Icon:(0,a.jsx)(r.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e;return w(null==B||null===(e=B.props)||void 0===e||null===(e=e[1])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==B||null===(m=B.props)||void 0===m||null===(m=m[2])||void 0===m?void 0:m.label),Icon:(0,a.jsx)(r.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e;return w(null==B||null===(e=B.props)||void 0===e||null===(e=e[2])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==B||null===(f=B.props)||void 0===f||null===(f=f[3])||void 0===f?void 0:f.label),Icon:(0,a.jsx)(r.OBPSIcon,{}),onClick:()=>{var e;return w(null==B||null===(e=B.props)||void 0===e||null===(e=e[3])||void 0===e?void 0:e.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}},X={header:S(null==F?void 0:F.headerLabel),sideOption:{name:S(null==F||null===(p=F.sideOption)||void 0===p?void 0:p.name),onClick:()=>{var e;return w(null==F||null===(e=F.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:S(null==F||null===(g=F.props)||void 0===g||null===(g=g[0])||void 0===g?void 0:g.label),Icon:(0,a.jsx)(r.HomeIcon,{}),onClick:()=>{var e;return w(null==F||null===(e=F.props)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==F||null===(y=F.props)||void 0===y||null===(y=y[1])||void 0===y?void 0:y.label),Icon:(0,a.jsx)(r.Calender,{}),onClick:()=>{var e;return w(null==F||null===(e=F.props)||void 0===e||null===(e=e[1])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==F||null===(h=F.props)||void 0===h||null===(h=h[2])||void 0===h?void 0:h.label),Icon:(0,a.jsx)(r.DocumentIcon,{}),onClick:()=>{var e;return w(null==F||null===(e=F.props)||void 0===e||null===(e=e[2])||void 0===e?void 0:e.navigationUrl)}},{name:S(null==F||null===(b=F.props)||void 0===b||null===(b=b[3])||void 0===b?void 0:b.label),Icon:(0,a.jsx)(r.DocumentIcon,{}),onClick:()=>{var e;return w(null==F||null===(e=F.props)||void 0===e||null===(e=e[3])||void 0===e?void 0:e.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}};return I?(0,a.jsx)(r.Loader,{}):(0,a.jsx)("div",{className:"HomePageContainer",children:(0,a.jsxs)("div",{className:"HomePageWrapper",children:[(0,a.jsxs)("div",{className:"BannerWithSearch",children:[A?(0,a.jsx)(l.A,{src:null==k?void 0:k.bannerUrl,alt:"Banner Image"}):(0,a.jsx)(l.A,{src:null==U?void 0:U.bannerUrl,alt:"Banner Image"}),(0,a.jsxs)("div",{className:"ServicesSection",children:[(0,a.jsx)(r.CardBasedOptions,u({style:{marginTop:"-30px"}},q)),(0,a.jsx)(r.CardBasedOptions,u({style:A?{}:{marginTop:"-30px"}},X))]})]}),(G||V)&&(0,a.jsx)("div",{className:"WhatsAppBanner",children:A?(0,a.jsx)(l.A,{src:null==G?void 0:G.bannerUrl,onClick:()=>H(G),alt:"Whatsapp Banner"}):(0,a.jsx)(l.A,{src:null==V?void 0:V.bannerUrl,onClick:()=>H(V),alt:"Whatsapp Banner"})}),D()?L?(0,a.jsx)(r.Loader,{}):(0,a.jsxs)("div",{className:"WhatsNewSection",children:[(0,a.jsxs)("div",{className:"headSection",children:[(0,a.jsx)("h2",{children:S(null==z?void 0:z.headerLabel)}),(0,a.jsx)("p",{onClick:()=>{var e;return w(null==z||null===(e=z.sideOption)||void 0===e?void 0:e.navigationUrl)},children:S(null==z||null===(O=z.sideOption)||void 0===O?void 0:O.name)})]}),(0,a.jsx)(r.WhatsNewCard,u({},null==T?void 0:T[0]))]}):null]})})}},2339(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(6243),i=n(5053),o=n(4883),l=n(5953),a=n(6870);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.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)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const c=e=>{var t,n,u=e.module,c=Digit.UserService.getUser(),d=((null==c||null===(t=c.info)||void 0===t?void 0:t.tenantId)||Digit.ULBService.getCurrentTenantId(),(0,l.useTranslation)().t),v=Digit.SessionStorage.get("initData").stateInfo,m=Digit.StoreData.getCurrentLanguage(),f=s((0,o.useState)(m),2),p=f[0],g=f[1],y=s((0,o.useState)(!1),2),h=y[0],b=y[1],O=s((0,o.useState)(""),2),x=O[0],S=O[1],w=()=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M12 24C5.38053 24 0 18.6143 0 12C0 5.38054 5.38053 1.90735e-06 12 1.90735e-06C18.6143 1.90735e-06 24 5.38054 24 12C24 18.6143 18.6143 24 12 24ZM16.3488 10.7852L11.3855 7.25251C11.1263 7.0701 10.8238 6.97889 10.5214 6.97889C10.291 6.97889 10.0557 7.03172 9.83976 7.14202C9.34054 7.40118 9.02857 7.91006 9.02857 8.46694L9.02877 15.5323C9.02877 16.0892 9.34076 16.5979 9.83996 16.8572C10.3344 17.1116 10.9296 17.0732 11.3857 16.7467L16.349 13.214C16.7426 12.9356 16.9778 12.4795 16.9778 11.9996C16.9776 11.5197 16.7426 11.0636 16.3489 10.7852L16.3488 10.7852Z",fill:"white"})}),j=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),_=j.isLoading,C=j.data,N=null==C||null===(n=C.MdmsRes["common-masters"])||void 0===n||null===(n=n.howItWorks[0])||void 0===n?void 0:n["".concat(u)];return _?(0,a.jsx)(r.Loader,{}):(0,a.jsx)(o.Fragment,{children:(0,a.jsxs)("div",{className:"how-it-works-page",children:[(0,a.jsx)(r.BackButton,{}),(0,a.jsx)("div",{className:"how-it-works-page-header",children:(0,a.jsx)(r.HeaderComponent,{children:d(N.screenHeader?N.screenHeader:"HOW_IT_WORKS")})}),(0,a.jsx)("div",{className:"language-selector",style:{margin:"10px"},children:[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>(0,a.jsx)("div",{className:"language-button-container",children:(0,a.jsx)(i.CustomButton,{selected:e.value===p,text:e.label,onClick:()=>(e=>{g(e.value),Digit.LocalizationService.changeLanguage(e.value,v.code)})(e)})},t))}),N.videosJson.map((e,t)=>(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10},children:[(0,a.jsx)("div",{className:"video-icon",onClick:()=>{return t=e,S("hi_IN"===p?t.hi_IN:t.en_IN),void b(!0);var t},children:(0,a.jsx)("div",{className:"vid-svg",children:(0,a.jsx)(w,{})})}),(0,a.jsxs)("div",{className:"how-it-works-header-description",children:[(0,a.jsx)("h2",{children:d(e.headerLabel)}),(0,a.jsx)("p",{children:d(e.description)})]})]})})),N.pdfHeader&&N.pdfDesc&&(0,a.jsx)("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"},children:(0,a.jsxs)("div",{className:"how-it-works-pdf-section",children:[(0,a.jsxs)("div",{className:"pdf-icon-header-desc",children:[(0,a.jsx)("div",{className:"pdf-icon",children:(0,a.jsx)(r.PDFSvg,{})}),(0,a.jsxs)("div",{className:"pdf-header-desc",children:[(0,a.jsx)("h2",{children:d(N.pdfHeader)}),(0,a.jsx)("p",{children:d(N.pdfDesc)})]})]}),(0,a.jsx)("div",{className:"download-icon",children:(0,a.jsx)(r.DownloadImgIcon,{})})]})}),h&&(0,a.jsxs)("div",{className:"how-it-works-video-play",children:[(0,a.jsx)("div",{className:"close-button",children:(0,a.jsx)(r.CloseSvg,{onClick:()=>{b(!1)}})}),(0,a.jsx)("video",{width:500,height:500,controls:!0,autoPlay:!0,children:(0,a.jsx)("source",{src:x,type:"video/mp4"})})]})]})})}},743(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(6243),i=n(4883),o=n(4989),l=n(5053),a=n(6870);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const u=e=>{var t,n,u=e.config,c=e.otp,d=e.onOtpChange,v=e.onResend,m=e.onSelect,f=e.t,p=e.error,g=e.userType,y=void 0===g?"citizen":g,h=e.canSubmit,b=(t=(0,i.useState)(30),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.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)?s(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),O=b[0],x=b[1];(0,o.A)(()=>{x(O-1)},O>0?1e3:null);var S=()=>{v(),x(2)};return"employee"===y?(0,a.jsxs)(i.Fragment,{children:[(0,a.jsx)(l.OTPInput,{length:6,onChange:d,value:c}),O>0?(0,a.jsx)(r.CardText,{children:"".concat(f("CS_RESEND_ANOTHER_OTP")," ").concat(O," ").concat(f("CS_RESEND_SECONDS"))}):(0,a.jsx)("p",{className:"card-text-button resend-otp",onClick:S,children:f("CS_RESEND_OTP")}),!p&&(0,a.jsx)(r.CardLabelError,{children:f("CS_INVALID_OTP")})]}):(0,a.jsxs)(r.FormStep,{onSelect:m,config:u,t:f,isDisabled:!(6===(null==c?void 0:c.length)&&h),children:[(0,a.jsx)(l.OTPInput,{length:6,onChange:d,value:c}),O>0?(0,a.jsx)(r.CardText,{children:"".concat(f("CS_RESEND_ANOTHER_OTP")," ").concat(O," ").concat(f("CS_RESEND_SECONDS"))}):(0,a.jsx)("p",{className:"card-text-button",onClick:S,children:f("CS_RESEND_OTP")}),!p&&(0,a.jsx)(r.CardLabelError,{children:f("CS_INVALID_OTP")})]})}},1022(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>q});var r=n(6243),i=n(4883),o=n(5953),l=n(4442),a=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minlength:10,maxlength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minlength:1,maxlength:50,pattern:"^[A-Za-z]+( [A-Za-z]+)*$"}}]}],s=n(6870);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.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)?m(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const f=e=>{var t,n=e.t,o=e.onSelect,l=e.mobileNumber,a=e.emailId,u=e.onMobileChange,d=e.onEmailChange,m=e.config,f=e.canSubmit,p=v((0,i.useState)(!!a),2),g=p[0],y=p[1],h=v((0,i.useState)(""),2),b=h[0],O=h[1],x=(null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("CORE_MOBILE_CONFIGS"))||{},S=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,w=(null==x?void 0:x.mobileNumberPattern)||"^\\d+$",j=new RegExp(w),_=(0,i.useMemo)(()=>S.test(a),[a]),C=(0,i.useMemo)(()=>j.test(l||""),[l,j]),N=(0,i.useMemo)(()=>g?!(_&&f):!(C&&f),[g,_,C,f]),E=(0,i.useMemo)(()=>window.innerWidth<=768?n(g?"LOGIN_WITH_MOBILE":"LOGIN_WITH_EMAIL"):n(g?"CS_USE_MOBILE_INSTEAD":"CS_LOGIN_REGISTER_WITH_EMAIL"),[g,n]);return(0,s.jsxs)(r.InputCard,{t:n,texts:null==m?void 0:m.texts,submit:!0,onNext:()=>{if(g){if(!_)return void O(n("ERR_INVALID_EMAIL"));o({userName:a})}else{if(!C)return void O(n("ERR_INVALID_MOBILE_NUMBER"));o({mobileNumber:l})}},isDisable:N,children:[(0,s.jsx)("div",{children:(0,s.jsx)(r.FieldV1,{withoutLabel:!0,charCount:!0,error:b,onChange:e=>{var t=e.target.value;O(""),g?(d(e),t&&!S.test(t)&&O(n("ERR_INVALID_EMAIL"))):(u(e),t&&!j.test(t)&&O(n("ERR_INVALID_MOBILE_NUMBER")))},placeholder:n(g?"ENTER_EMAIL_PLACEHOLDER":"ENTER_MOBILE_PLACEHOLDER"),populators:{name:g?"userName":"mobileNumber",prefix:g?"":null==x?void 0:x.mobilePrefix,validation:{maxlength:g?256:(null==x?void 0:x.mobileNumberLength)||10,pattern:g?S:j}},props:{fieldStyle:{width:"100%"}},type:"text",value:g?a:l},g?"email":"mobile")}),(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"1.5rem",marginTop:"-24px"},children:(0,s.jsx)(r.LinkLabel,{style:c({display:"inline"},{marginLeft:"0px",userSelect:"none",color:"inherit",cursor:"pointer",textDecoration:"underline"}),onClick:()=>{y(!g),O(""),g?d({target:{value:""}}):u({target:{value:""}})},children:E})})]})},p=e=>{var t=e.config,n=e.onSelect,i=e.t,o=e.isDisabled;return(0,s.jsx)(r.FormStep,{config:t,onSelect:n,t:i,isDisabled:o})};var g,y,h=n(743),b=["ResponseInfo","UserRequest"];function O(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function x(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){O(o,r,i,l,a,"next",e)}function a(e){O(o,r,i,l,a,"throw",e)}l(void 0)})}}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){j(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n={}.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)?C(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var N={type:"login"},E="/".concat((null===(g=window)||void 0===g?void 0:g.contextPath)||(null===(y=window)||void 0===y||null===(y=y.globalConfigs)||void 0===y?void 0:y.getConfig("CONTEXT_PATH")),"/citizen"),I=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||E;const A=e=>{var t,n,u=e.stateCode,c=e.isUserRegistered,d=void 0!==c&&c,v=(0,o.useTranslation)().t,m=(0,l.useLocation)(),g=(0,l.useNavigate)(),y=_((0,i.useState)(null),2),O=y[0],S=y[1],j=_((0,i.useState)(null),2),C=j[0],A=j[1],D=_((0,i.useState)(!0),2),P=D[0],T=D[1],L=_((0,i.useState)(d?{}:null==m||null===(t=m.state)||void 0===t?void 0:t.data),2),R=L[0],M=L[1],U=_((0,i.useState)(null),2),k=U[0],B=U[1],F=Digit.Hooks.useQueryParams(),V=_((0,i.useState)(!1),2),G=V[0],z=V[1],W=_((0,i.useState)(!0),2),H=W[0],q=W[1],X=_((0,i.useState)(!0),2),Q=X[0],Z=X[1],Y=null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");(0,i.useEffect)(()=>{var e;return C&&(k&&(clearTimeout(k),B(null)),e=setTimeout(()=>{A("")},5e3),B(e)),()=>{e&&clearTimeout(e)}},[C]),(0,i.useEffect)(()=>{var e;if(O){Digit.SessionStorage.set("citizen.userRequestObject",O),Digit.UserService.setUser(O),((e,t,n)=>{var r;if(!Digit.Utils.getMultiRootTenant()){var i=null===(r=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===r||null===(r=r.value)||void 0===r?void 0:r.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",i),localStorage.setItem("Citizen.locale",i),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))}})(null==O?void 0:O.info,null==O?void 0:O.access_token,u);var t,n=(null===(e=m.state)||void 0===e?void 0:e.from)||E;Digit.ULBService.getCitizenCurrentTenant(!0)?g(n,{replace:!0}):g("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/citizen/select-location"),{state:{redirectBackTo:n},replace:!0})}},[O]);var K=(0,i.useMemo)(()=>a.map(e=>{var t={};for(var n in e.texts)t[n]=v(e.texts[n]);return w(w({},e),{},{texts:t})}),[a]),J=function(){var e=x(function*(e){Z(!1),M(w(w({},R),e));var t=w(w({},e),{},{tenantId:u,userType:"citizen"}),n=_(yield ne({otp:w(w({},t),N)}),2);if(n[0],!n[1])return Z(!0),void g("otp",{state:{from:I(m.state,F)},replace:!0});Z(!0),g("name",{state:{from:I(m.state,F),data:t},replace:!0})});return function(t){return e.apply(this,arguments)}}(),$=function(){var e=x(function*(e){z(!0);var t=w(w({},R),e);M(t);var n="".concat(Y,"/v1/_register"),r={IndividualRegister:{tenantId:u,name:t.name,emailId:t.userName||"",mobileNumber:t.mobileNumber||"",requestType:"Register"}};try{if(!(yield Digit.CustomService.getResponse({url:n,body:r,useCache:!1,method:"POST",userService:!1,auth:!1,params:{}})))throw new Error("Registration API failed");z(!1),g("otp",{state:{from:I(m.state,F)},replace:!0})}catch(e){console.error("Registration error:",e),z(!1),A(v("REGISTRATION_FAILED")||"Registration failed. Please try again.")}});return function(t){return e.apply(this,arguments)}}(),ee=function(){var e=x(function*(){try{var e;T(!0),q(!1);var t=R.mobileNumber,n=R.otp,r=R.userName,i={username:t||r,password:n,tenantId:u,userType:"citizen"},o=yield Digit.UserService.authenticate(i),l=(o.ResponseInfo,o.UserRequest),a=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(o,b);null!==(e=window)&&void 0!==e&&null!==(e=e.globalConfigs)&&void 0!==e&&e.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),S(w({info:l},a))}catch(e){q(!0),T(!1),A(v("INVALID_OTP")||"Invalid OTP")}});return function(){return e.apply(this,arguments)}}(),te=function(){var e=x(function*(){if(d){var e={mobileNumber:R.mobileNumber,userName:R.userName,tenantId:u,userType:"citizen"},t=_(yield ne({otp:w(w({},e),N)}),2);t[0],t[1]&&A(v("OTP_RESEND_ERROR")||"Failed to resend OTP")}else A(v("PLEASE_COMPLETE_REGISTRATION")||"Please enter the OTP sent during registration.")});return function(){return e.apply(this,arguments)}}(),ne=function(){var e=x(function*(e){try{return[yield Digit.UserService.sendOtp(e,u),null]}catch(e){return[null,e]}});return function(t){return e.apply(this,arguments)}}();return(0,s.jsx)("div",{className:"citizen-form-wrapper citizen-form-center",children:(0,s.jsxs)(r.AppContainer,{children:[m.pathname.includes("login")?null:(0,s.jsx)(r.BackLink,{onClick:()=>window.history.back()}),(0,s.jsxs)(l.Routes,{children:[(0,s.jsx)(l.Route,{path:"/",element:(0,s.jsx)(f,{onSelect:J,config:K[0],mobileNumber:R.mobileNumber||"",emailId:R.userName||"",onMobileChange:e=>{var t=e.target.value;M(w(w({},R),{},{mobileNumber:t}))},onEmailChange:e=>{var t=e.target.value;M(w(w({},R),{},{userName:t}))},canSubmit:Q,showRegisterLink:d,t:v})}),(0,s.jsx)(l.Route,{path:"otp",element:(0,s.jsx)(h.A,{config:w(w({},K[1]),{},{texts:w(w({},K[1].texts),{},{cardText:"".concat(K[1].texts.cardText," ").concat(R.mobileNumber||R.userName||"")})}),onOtpChange:e=>{M(w(w({},R),{},{otp:e}))},onResend:te,onSelect:ee,otp:R.otp,error:P,canSubmit:H,t:v})}),(0,s.jsx)(l.Route,{path:"name",element:(0,s.jsx)(p,{config:K[2],onSelect:$,t:v,isDisabled:G})})]}),C&&(0,s.jsx)(r.Toast,{type:"error",label:C,onClose:()=>A(null)})]})})};var D,P=["ResponseInfo","UserRequest"],T=["ResponseInfo","UserRequest"];function L(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function R(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function M(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){R(o,r,i,l,a,"next",e)}function a(e){R(o,r,i,l,a,"throw",e)}l(void 0)})}}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach(function(t){B(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function B(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var n={}.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,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var G={type:"register"},z={type:"login"},W="/".concat(null===(D=window)||void 0===D?void 0:D.contextPath,"/citizen"),H=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||W;const q=e=>{var t,n,u,c,d=e.stateCode,v=e.isUserRegistered,m=void 0===v||v,g=null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("USE_INDIVIDUAL_MODEL"),y=null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");if(g&&y)return(0,s.jsx)(A,{stateCode:d,isUserRegistered:m});var b=(0,o.useTranslation)().t,O=(0,l.useLocation)(),x=(0,l.useNavigate)(),S=F((0,i.useState)(null),2),w=S[0],j=S[1],_=F((0,i.useState)(null),2),C=_[0],N=_[1],E=F((0,i.useState)(!0),2),I=E[0],D=E[1],R=F((0,i.useState)(m?{}:null==O||null===(u=O.state)||void 0===u?void 0:u.data),2),U=R[0],B=R[1],V=F((0,i.useState)(null),2),q=V[0],X=V[1],Q=Digit.Hooks.useQueryParams(),Z=F((0,i.useState)(!1),2),Y=Z[0],K=Z[1],J=F((0,i.useState)(!0),2),$=J[0],ee=J[1],te=F((0,i.useState)(!0),2),ne=te[0],re=te[1];(0,i.useEffect)(()=>{var e;return C&&(q&&(clearTimeout(q),X(null)),e=setTimeout(()=>{N("")},5e3),X(e)),()=>{e&&clearTimeout(e)}},[C]),(0,i.useEffect)(()=>{var e;if(w){Digit.SessionStorage.set("citizen.userRequestObject",w),Digit.UserService.setUser(w),((e,t,n)=>{var r;if(!Digit.Utils.getMultiRootTenant()){var i=null===(r=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===r||null===(r=r.value)||void 0===r?void 0:r.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",i),localStorage.setItem("Citizen.locale",i),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))}})(null==w?void 0:w.info,null==w?void 0:w.access_token,d);var t,n=(null===(e=O.state)||void 0===e?void 0:e.from)||W;Digit.ULBService.getCitizenCurrentTenant(!0)?x(n,{replace:!0}):x("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/citizen/select-location"),{state:{redirectBackTo:n},replace:!0})}},[w]);var ie=(0,i.useMemo)(()=>a.map(e=>{var t={};for(var n in e.texts)t[n]=b(e.texts[n]);return k(k({},e),{},{texts:t})}),[a]),oe=function(){var e=M(function*(e){re(!1),B(k(k({},U),e));var t=k(k({},e),{},{tenantId:d,userType:"citizen"});if(m){var n,r,i,o,l=F(yield ue({otp:k(k({},t),z)}),2);if(l[0],!l[1])return re(!0),void x("otp",{state:{from:H(O.state,Q),role:null===(r=O.state)||void 0===r?void 0:r.role},replace:!0});re(!0),O.state&&"FSM_DSO"===O.state.role||x("/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/citizen/register/name"),{state:{from:H(O.state,Q),data:t}}),null!==(n=O.state)&&void 0!==n&&n.role&&(re(!0),N("FSM_DSO"===(null===(o=O.state)||void 0===o?void 0:o.role)?b("ES_ERROR_DSO_LOGIN"):"User not registered."))}else{var a=F(yield ue({otp:k(k({},t),G)}),2);if(a[0],!a[1])return re(!0),void x("otp",{state:{from:H(O.state,Q)},replace:!0});re(!0)}});return function(t){return e.apply(this,arguments)}}(),le=function(){var e=M(function*(e){var t=k(k({},U),{},{tenantId:d,userType:"citizen"},e);B(k(k({},U),e)),K(!0);var n=F(yield ue({otp:k(k({},t),G)}),2),r=n[0];n[1],r?(K(!1),x("otp",{state:{from:H(O.state,Q)},replace:!0})):K(!1)});return function(t){return e.apply(this,arguments)}}(),ae=function(){var e=M(function*(){try{D(!0),ee(!1);var e=U.mobileNumber,t=U.otp,n=U.name;if(m){var r,i,o={username:e,password:t,tenantId:d,userType:"citizen"},l=yield Digit.UserService.authenticate(o),a=(l.ResponseInfo,l.UserRequest),s=L(l,P);if(null!==(r=O.state)&&void 0!==r&&r.role){var u=a.roles.find(e=>e.code===O.state.role);if(!u||!u.code)return N(b("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>x(W,{replace:!0}),5e3)}null!==(i=window)&&void 0!==i&&null!==(i=i.globalConfigs)&&void 0!==i&&i.getConfig("ENABLE_SINGLEINSTANCE")&&(a.tenantId=Digit.ULBService.getStateId()),j(k({info:a},s))}else if(!m){var c,v={name:n,username:e,otpReference:t,tenantId:d},f=yield Digit.UserService.registerUser(v,d),p=(f.ResponseInfo,f.UserRequest),g=L(f,T);null!==(c=window)&&void 0!==c&&null!==(c=c.globalConfigs)&&void 0!==c&&c.getConfig("ENABLE_SINGLEINSTANCE")&&(p.tenantId=Digit.ULBService.getStateId()),j(k({info:p},g))}}catch(e){ee(!0),D(!1)}});return function(){return e.apply(this,arguments)}}(),se=function(){var e=M(function*(){var e={mobileNumber:U.mobileNumber,tenantId:d,userType:"citizen"};if(m){if(m){var t=F(yield ue({otp:k(k({},e),z)}),2);t[0],t[1]}}else{var n=F(yield ue({otp:k(k({},e),G)}),2);n[0],n[1]}});return function(){return e.apply(this,arguments)}}(),ue=function(){var e=M(function*(e){try{return[yield Digit.UserService.sendOtp(e,d),null]}catch(e){return[null,e]}});return function(t){return e.apply(this,arguments)}}(),ce=window.location.href.includes("citizen")&&!window.Digit.Utils.browser.isMobile();return(0,s.jsx)("div",{className:"citizen-form-wrapper".concat(ce?" citizen-form-center":""),children:(0,s.jsxs)(r.AppContainer,{children:[O.pathname.includes("login")?null:(0,s.jsx)(r.BackLink,{onClick:()=>x(-1)}),(0,s.jsxs)(l.Routes,{children:[" ",(0,s.jsx)(l.Route,{path:"/",element:(0,s.jsx)(f,{onSelect:oe,config:ie[0],mobileNumber:U.mobileNumber||"",onMobileChange:e=>{var t=e.target.value;B(k(k({},U),{},{mobileNumber:t}))},canSubmit:ne,showRegisterLink:m&&!(null!==(c=O.state)&&void 0!==c&&c.role),t:b})}),(0,s.jsx)(l.Route,{path:"otp",element:(0,s.jsx)(h.A,{config:k(k({},ie[1]),{},{texts:k(k({},ie[1].texts),{},{cardText:"".concat(ie[1].texts.cardText," ").concat(U.mobileNumber||"")})}),onOtpChange:e=>{B(k(k({},U),{},{otp:e}))},onResend:se,onSelect:ae,otp:U.otp,error:I,canSubmit:$,t:b})}),(0,s.jsx)(l.Route,{path:"name",element:(0,s.jsx)(p,{config:ie[2],onSelect:le,t:b,isDisabled:Y})}),C&&(0,s.jsx)(r.Toast,{type:"error",label:C,onClose:()=>N(null)})]})]})})}},1737(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>Ve});var r=n(4883),i=n.n(r),o=n(5953),l=n(5053),a=n(6243),s=e=>"checkbox"===e.type,u=e=>e instanceof Date,c=e=>null==e;const d=e=>"object"==typeof e;var v=e=>!c(e)&&!Array.isArray(e)&&d(e)&&!u(e),m=e=>v(e)&&e.target?s(e.target)?e.target.checked:e.target.value:e,f=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),p="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function g(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(p&&(e instanceof Blob||e instanceof FileList)||!n&&!v(e))return e;if(t=n?[]:{},n||(e=>{const t=e.constructor&&e.constructor.prototype;return v(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=g(e[n]));else t=e}return t}var y=e=>Array.isArray(e)?e.filter(Boolean):[],h=e=>void 0===e,b=(e,t,n)=>{if(!t||!v(e))return n;const r=y(t.split(/[,[\].]+?/)).reduce((e,t)=>c(e)?e:e[t],e);return h(r)||r===e?h(e[t])?n:e[t]:r},O=e=>"boolean"==typeof e,x=e=>/^\w*$/.test(e),S=e=>y(e.replace(/["|']|\]/g,"").split(/\.|\[/)),w=(e,t,n)=>{let r=-1;const i=x(t)?[t]:S(t),o=i.length,l=o-1;for(;++r<o;){const t=i[r];let o=n;if(r!==l){const n=e[t];o=v(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if("__proto__"===t)return;e[t]=o,e=e[t]}return e};const j="blur",_="onChange",C="onSubmit",N="all",E="pattern",I="required",A=r.createContext(null),D=()=>r.useContext(A);var P=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return t._proxyFormState[i]!==N&&(t._proxyFormState[i]=!r||N),n&&(n[i]=!0),e[i]}});return i},T=e=>v(e)&&!Object.keys(e).length,L=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return T(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!r||N))},R=e=>Array.isArray(e)?e:[e],M=(e,t,n)=>!e||!t||e===t||R(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e)));function U(e){const t=r.useRef(e);t.current=e,r.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var k=e=>"string"==typeof e,B=(e,t,n,r,i)=>k(e)?(r&&t.watch.add(e),b(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),b(n,e))):(r&&(t.watchAll=!0),n);const F=e=>e.render(function(e){const t=D(),{name:n,disabled:i,control:o=t.control,shouldUnregister:l}=e,a=f(o._names.array,n),s=function(e){const t=D(),{control:n=t.control,name:i,defaultValue:o,disabled:l,exact:a}=e||{},s=r.useRef(i);s.current=i,U({disabled:l,subject:n._subjects.values,next:e=>{M(s.current,e.name,a)&&c(g(B(s.current,n._names,e.values||n._formValues,!1,o)))}});const[u,c]=r.useState(n._getWatch(i,o));return r.useEffect(()=>n._removeUnmounted()),u}({control:o,name:n,defaultValue:b(o._formValues,n,b(o._defaultValues,n,e.defaultValue)),exact:!0}),u=function(e){const t=D(),{control:n=t.control,disabled:i,name:o,exact:l}=e||{},[a,s]=r.useState(n._formState),u=r.useRef(!0),c=r.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=r.useRef(o);return d.current=o,U({disabled:i,next:e=>u.current&&M(d.current,e.name,l)&&L(e,c.current,n._updateFormState)&&s({...n._formState,...e}),subject:n._subjects.state}),r.useEffect(()=>(u.current=!0,c.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),P(a,n,c.current,!1)}({control:o,name:n,exact:!0}),c=r.useRef(o.register(n,{...e.rules,value:s,...O(e.disabled)?{disabled:e.disabled}:{}}));return r.useEffect(()=>{const e=o._options.shouldUnregister||l,t=(e,t)=>{const n=b(o._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){const e=g(b(o._options.defaultValues,n));w(o._defaultValues,n,e),h(b(o._formValues,n))&&w(o._formValues,n,e)}return()=>{(a?e&&!o._state.action:e)?o.unregister(n):t(n,!1)}},[n,o,a,l]),r.useEffect(()=>{b(o._fields,n)&&o._updateDisabledField({disabled:i,fields:o._fields,name:n,value:b(o._fields,n)._f.value})},[i,n,o]),{field:{name:n,value:s,...O(i)||u.disabled?{disabled:u.disabled||i}:{},onChange:r.useCallback(e=>c.current.onChange({target:{value:m(e),name:n},type:"change"}),[n]),onBlur:r.useCallback(()=>c.current.onBlur({target:{value:b(o._formValues,n),name:n},type:j}),[n,o]),ref:r.useCallback(e=>{const t=b(o._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,n])},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!b(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!b(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!b(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!b(u.validatingFields,n)},error:{enumerable:!0,get:()=>b(u.errors,n)}})}}(e));var V=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},G=e=>({isOnSubmit:!e||e===C,isOnBlur:"onBlur"===e,isOnChange:e===_,isOnAll:e===N,isOnTouch:"onTouched"===e}),z=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const W=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const n=b(e,i);if(n){const{_f:e,...o}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r)break;if(e.ref&&t(e.ref,e.name)&&!r)break;W(o,t)}else v(o)&&W(o,t)}}};var H=(e,t,n)=>{const r=R(b(e,n));return w(r,"root",t[n]),w(e,n,r),e},q=e=>"file"===e.type,X=e=>"function"==typeof e,Q=e=>{if(!p)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Z=e=>k(e),Y=e=>"radio"===e.type,K=e=>e instanceof RegExp;const J={value:!1,isValid:!1},$={value:!0,isValid:!0};var ee=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!h(e[0].attributes.value)?h(e[0].value)||""===e[0].value?$:{value:e[0].value,isValid:!0}:$:J}return J};const te={isValid:!1,value:null};var ne=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,te):te;function re(e,t,n="validate"){if(Z(e)||Array.isArray(e)&&e.every(Z)||O(e)&&!e)return{type:n,message:Z(e)?e:"",ref:t}}var ie=e=>v(e)&&!K(e)?e:{value:e,message:""},oe=async(e,t,n,r,i)=>{const{ref:o,refs:l,required:a,maxLength:u,minLength:d,min:m,max:f,pattern:p,validate:g,name:y,valueAsNumber:x,mount:S,disabled:w}=e._f,j=b(t,y);if(!S||w)return{};const _=l?l[0]:o,C=e=>{r&&_.reportValidity&&(_.setCustomValidity(O(e)?"":e||""),_.reportValidity())},N={},A=Y(o),D=s(o),P=A||D,L=(x||q(o))&&h(o.value)&&h(j)||Q(o)&&""===o.value||""===j||Array.isArray(j)&&!j.length,R=V.bind(null,y,n,N),M=(e,t,n,r="maxLength",i="minLength")=>{const l=e?t:n;N[y]={type:e?r:i,message:l,ref:o,...R(e?r:i,l)}};if(i?!Array.isArray(j)||!j.length:a&&(!P&&(L||c(j))||O(j)&&!j||D&&!ee(l).isValid||A&&!ne(l).isValid)){const{value:e,message:t}=Z(a)?{value:!!a,message:a}:ie(a);if(e&&(N[y]={type:I,message:t,ref:_,...R(I,t)},!n))return C(t),N}if(!(L||c(m)&&c(f))){let e,t;const r=ie(f),i=ie(m);if(c(j)||isNaN(j)){const n=o.valueAsDate||new Date(j),l=e=>new Date((new Date).toDateString()+" "+e),a="time"==o.type,s="week"==o.type;k(r.value)&&j&&(e=a?l(j)>l(r.value):s?j>r.value:n>new Date(r.value)),k(i.value)&&j&&(t=a?l(j)<l(i.value):s?j<i.value:n<new Date(i.value))}else{const n=o.valueAsNumber||(j?+j:j);c(r.value)||(e=n>r.value),c(i.value)||(t=n<i.value)}if((e||t)&&(M(!!e,r.message,i.message,"max","min"),!n))return C(N[y].message),N}if((u||d)&&!L&&(k(j)||i&&Array.isArray(j))){const e=ie(u),t=ie(d),r=!c(e.value)&&j.length>+e.value,i=!c(t.value)&&j.length<+t.value;if((r||i)&&(M(r,e.message,t.message),!n))return C(N[y].message),N}if(p&&!L&&k(j)){const{value:e,message:t}=ie(p);if(K(e)&&!j.match(e)&&(N[y]={type:E,message:t,ref:o,...R(E,t)},!n))return C(t),N}if(g)if(X(g)){const e=re(await g(j,t),_);if(e&&(N[y]={...e,...R("validate",e.message)},!n))return C(e.message),N}else if(v(g)){let e={};for(const r in g){if(!T(e)&&!n)break;const i=re(await g[r](j,t),_,r);i&&(e={...i,...R(r,i.message)},C(i.message),n&&(N[y]=e))}if(!T(e)&&(N[y]={ref:_,...e},!n))return N}return C(!0),N};function le(e,t){const n=Array.isArray(t)?t:x(t)?[t]:S(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=h(e)?r++:e[t[r++]];return e}(e,n),i=n.length-1,o=n[i];return r&&delete r[o],0!==i&&(v(r)&&T(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!h(e[t]))return!1;return!0}(r))&&le(e,n.slice(0,-1)),e}var ae=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},se=e=>c(e)||!d(e);function ue(e,t){if(se(e)||se(t))return e===t;if(u(e)&&u(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const n=e[i];if(!r.includes(i))return!1;if("ref"!==i){const e=t[i];if(u(n)&&u(e)||v(n)&&v(e)||Array.isArray(n)&&Array.isArray(e)?!ue(n,e):n!==e)return!1}}return!0}var ce=e=>"select-multiple"===e.type,de=e=>Q(e)&&e.isConnected,ve=e=>{for(const t in e)if(X(e[t]))return!0;return!1};function me(e,t={}){const n=Array.isArray(e);if(v(e)||n)for(const n in e)Array.isArray(e[n])||v(e[n])&&!ve(e[n])?(t[n]=Array.isArray(e[n])?[]:{},me(e[n],t[n])):c(e[n])||(t[n]=!0);return t}function fe(e,t,n){const r=Array.isArray(e);if(v(e)||r)for(const r in e)Array.isArray(e[r])||v(e[r])&&!ve(e[r])?h(t)||se(n[r])?n[r]=Array.isArray(e[r])?me(e[r],[]):{...me(e[r])}:fe(e[r],c(t)?{}:t[r],n[r]):n[r]=!ue(e[r],t[r]);return n}var pe=(e,t)=>fe(e,t,me(t)),ge=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>h(e)?e:t?""===e?NaN:e?+e:e:n&&k(e)?new Date(e):r?r(e):e;function ye(e){const t=e.ref;if(!(e.refs?e.refs.every(e=>e.disabled):t.disabled))return q(t)?t.files:Y(t)?ne(e.refs).value:ce(t)?[...t.selectedOptions].map(({value:e})=>e):s(t)?ee(e.refs).value:ge(h(t.value)?e.ref.value:t.value,e)}var he=e=>h(e)?e:K(e)?e.source:v(e)?K(e.value)?e.value.source:e.value:e;function be(e,t,n){const r=b(e,n);if(r||x(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const r=i.join("."),o=b(t,r),l=b(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(l&&l.type)return{name:r,error:l};i.pop()}return{name:n}}const Oe={mode:C,reValidateMode:_,shouldFocusError:!0};function xe(e={}){let t,n={...Oe,...e},r={submitCount:0,isDirty:!1,isLoading:X(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},i={},o=(v(n.defaultValues)||v(n.values))&&g(n.defaultValues||n.values)||{},l=n.shouldUnregister?{}:g(o),a={action:!1,mount:!1,watch:!1},d={mount:new Set,unMount:new Set,array:new Set,watch:new Set},x=0;const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},_={values:ae(),array:ae(),state:ae()},C=G(n.mode),E=G(n.reValidateMode),I=n.criteriaMode===N,A=async e=>{if(S.isValid||e){const e=n.resolver?T((await M()).errors):await U(i,!0);e!==r.isValid&&_.state.next({isValid:e})}},D=(e,t)=>{(S.isValidating||S.validatingFields)&&((e||Array.from(d.mount)).forEach(e=>{e&&(t?w(r.validatingFields,e,t):le(r.validatingFields,e))}),_.state.next({validatingFields:r.validatingFields,isValidating:!T(r.validatingFields)}))},P=(e,t,n,r)=>{const s=b(i,e);if(s){const i=b(l,e,h(n)?b(o,e):n);h(i)||r&&r.defaultChecked||t?w(l,e,t?i:ye(s._f)):Z(e,i),a.mount&&A()}},L=(e,t,n,l,a)=>{let s=!1,u=!1;const c={name:e},d=!!(b(i,e)&&b(i,e)._f&&b(i,e)._f.disabled);if(!n||l){S.isDirty&&(u=r.isDirty,r.isDirty=c.isDirty=F(),s=u!==c.isDirty);const n=d||ue(b(o,e),t);u=!(d||!b(r.dirtyFields,e)),n||d?le(r.dirtyFields,e):w(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,s=s||S.dirtyFields&&u!==!n}if(n){const t=b(r.touchedFields,e);t||(w(r.touchedFields,e,n),c.touchedFields=r.touchedFields,s=s||S.touchedFields&&t!==n)}return s&&a&&_.state.next(c),s?c:{}},M=async e=>{D(e,!0);const t=await n.resolver(l,n.context,((e,t,n,r)=>{const i={};for(const n of e){const e=b(t,n);e&&w(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}})(e||d.mount,i,n.criteriaMode,n.shouldUseNativeValidation));return D(e),t},U=async(e,t,i={valid:!0})=>{for(const o in e){const a=e[o];if(a){const{_f:e,...s}=a;if(e){const s=d.array.has(e.name);D([o],!0);const u=await oe(a,l,I,n.shouldUseNativeValidation&&!t,s);if(D([o]),u[e.name]&&(i.valid=!1,t))break;!t&&(b(u,e.name)?s?H(r.errors,u,e.name):w(r.errors,e.name,u[e.name]):le(r.errors,e.name))}!T(s)&&await U(s,t,i)}}return i.valid},F=(e,t)=>(e&&t&&w(l,e,t),!ue(ne(),o)),V=(e,t,n)=>B(e,d,{...a.mount?l:h(t)?o:k(e)?{[e]:t}:t},n,t),Z=(e,t,n={})=>{const r=b(i,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&w(l,e,ge(t,n)),o=Q(n.ref)&&c(t)?"":t,ce(n.ref)?[...n.ref.options].forEach(e=>e.selected=o.includes(e.value)):n.refs?s(n.ref)?n.refs.length>1?n.refs.forEach(e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find(t=>t===e.value):o===e.value)):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach(e=>e.checked=e.value===o):q(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||_.values.next({name:e,values:{...l}})))}(n.shouldDirty||n.shouldTouch)&&L(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&te(e)},K=(e,t,n)=>{for(const r in t){const o=t[r],l=`${e}.${r}`,a=b(i,l);!d.array.has(e)&&se(o)&&(!a||a._f)||u(o)?Z(l,o,n):K(l,o,n)}},J=(e,t,n={})=>{const s=b(i,e),u=d.array.has(e),v=g(t);w(l,e,v),u?(_.array.next({name:e,values:{...l}}),(S.isDirty||S.dirtyFields)&&n.shouldDirty&&_.state.next({name:e,dirtyFields:pe(o,l),isDirty:F(e,v)})):!s||s._f||c(v)?Z(e,v,n):K(e,v,n),z(e,d)&&_.state.next({...r}),_.values.next({name:a.mount?e:void 0,values:{...l}})},$=async o=>{a.mount=!0;const s=o.target;let u=s.name,c=!0;const v=b(i,u),f=e=>{c=Number.isNaN(e)||e===b(l,u,e)};if(v){let a,g;const y=s.type?ye(v._f):m(o),h=o.type===j||"focusout"===o.type,N=!((p=v._f).mount&&(p.required||p.min||p.max||p.maxLength||p.minLength||p.pattern||p.validate)||n.resolver||b(r.errors,u)||v._f.deps)||((e,t,n,r,i)=>!i.isOnAll&&(!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e))(h,b(r.touchedFields,u),r.isSubmitted,E,C),P=z(u,d,h);w(l,u,y),h?(v._f.onBlur&&v._f.onBlur(o),t&&t(0)):v._f.onChange&&v._f.onChange(o);const R=L(u,y,h,!1),k=!T(R)||P;if(!h&&_.values.next({name:u,type:o.type,values:{...l}}),N)return S.isValid&&A(),k&&_.state.next({name:u,...P?{}:R});if(!h&&P&&_.state.next({...r}),n.resolver){const{errors:e}=await M([u]);if(f(y),c){const t=be(r.errors,i,u),n=be(e,i,t.name||u);a=n.error,u=n.name,g=T(e)}}else D([u],!0),a=(await oe(v,l,I,n.shouldUseNativeValidation))[u],D([u]),f(y),c&&(a?g=!1:S.isValid&&(g=await U(i,!0)));c&&(v._f.deps&&te(v._f.deps),((n,i,o,l)=>{const a=b(r.errors,n),s=S.isValid&&O(i)&&r.isValid!==i;var u;if(e.delayError&&o?(u=()=>((e,t)=>{w(r.errors,e,t),_.state.next({errors:r.errors})})(n,o),t=e=>{clearTimeout(x),x=setTimeout(u,e)},t(e.delayError)):(clearTimeout(x),t=null,o?w(r.errors,n,o):le(r.errors,n)),(o?!ue(a,o):a)||!T(l)||s){const e={...l,...s&&O(i)?{isValid:i}:{},errors:r.errors,name:n};r={...r,...e},_.state.next(e)}})(u,g,a,R))}var p},ee=(e,t)=>{if(b(r.errors,t)&&e.focus)return e.focus(),1},te=async(e,t={})=>{let o,l;const a=R(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await M(e);if(e)for(const n of e){const e=b(t,n);e?w(r.errors,n,e):le(r.errors,n)}else r.errors=t;return t})(h(e)?e:a);o=T(t),l=e?!a.some(e=>b(t,e)):o}else e?(l=(await Promise.all(a.map(async e=>{const t=b(i,e);return await U(t&&t._f?{[e]:t}:t)}))).every(Boolean),(l||r.isValid)&&A()):l=o=await U(i);return _.state.next({...!k(e)||S.isValid&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors}),t.shouldFocus&&!l&&W(i,ee,e?a:d.mount),l},ne=e=>{const t={...a.mount?l:o};return h(e)?t:k(e)?b(t,e):e.map(e=>b(t,e))},re=(e,t)=>({invalid:!!b((t||r).errors,e),isDirty:!!b((t||r).dirtyFields,e),error:b((t||r).errors,e),isValidating:!!b(r.validatingFields,e),isTouched:!!b((t||r).touchedFields,e)}),ie=(e,t,n)=>{const o=(b(i,e,{_f:{}})._f||{}).ref,l=b(r.errors,e)||{},{ref:a,message:s,type:u,...c}=l;w(r.errors,e,{...c,...t,ref:o}),_.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},ve=(e,t={})=>{for(const a of e?R(e):d.mount)d.mount.delete(a),d.array.delete(a),t.keepValue||(le(i,a),le(l,a)),!t.keepError&&le(r.errors,a),!t.keepDirty&&le(r.dirtyFields,a),!t.keepTouched&&le(r.touchedFields,a),!t.keepIsValidating&&le(r.validatingFields,a),!n.shouldUnregister&&!t.keepDefaultValue&&le(o,a);_.values.next({values:{...l}}),_.state.next({...r,...t.keepDirty?{isDirty:F()}:{}}),!t.keepIsValid&&A()},me=({disabled:e,name:t,field:n,fields:r,value:i})=>{if(O(e)&&a.mount||e){const o=e?void 0:h(i)?ye(n?n._f:b(r,t)._f):i;w(l,t,o),L(t,o,!1,!1,!0)}},fe=(e,t={})=>{let r=b(i,e);const l=O(t.disabled);return w(i,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),d.mount.add(e),r?me({field:r,disabled:t.disabled,name:e,value:t.value}):P(e,!0,t.value),{...l?{disabled:t.disabled}:{},...n.progressive?{required:!!t.required,min:he(t.min),max:he(t.max),minLength:he(t.minLength),maxLength:he(t.maxLength),pattern:he(t.pattern)}:{},name:e,onChange:$,onBlur:$,ref:l=>{if(l){fe(e,t),r=b(i,e);const n=h(l.value)&&l.querySelectorAll&&l.querySelectorAll("input,select,textarea")[0]||l,a=(e=>Y(e)||s(e))(n),u=r._f.refs||[];if(a?u.find(e=>e===n):n===r._f.ref)return;w(i,e,{_f:{...r._f,...a?{refs:[...u.filter(de),n,...Array.isArray(b(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),P(e,!1,void 0,n)}else r=b(i,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!f(d.array,e)||!a.action)&&d.unMount.add(e)}}},xe=()=>n.shouldFocusError&&W(i,ee,d.mount),Se=(e,t)=>async o=>{let a;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let s=g(l);if(_.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await M();r.errors=e,s=t}else await U(i);if(le(r.errors,"root"),T(r.errors)){_.state.next({errors:{}});try{await e(s,o)}catch(e){a=e}}else t&&await t({...r.errors},o),xe(),setTimeout(xe);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:T(r.errors)&&!a,submitCount:r.submitCount+1,errors:r.errors}),a)throw a},we=(t,n={})=>{const s=t?g(t):o,u=g(s),c=T(t),v=c?o:u;if(n.keepDefaultValues||(o=s),!n.keepValues){if(n.keepDirtyValues)for(const e of d.mount)b(r.dirtyFields,e)?w(v,e,b(l,e)):J(e,b(v,e));else{if(p&&h(t))for(const e of d.mount){const t=b(i,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Q(e)){const t=e.closest("form");if(t){t.reset();break}}}}i={}}l=e.shouldUnregister?n.keepDefaultValues?g(o):{}:g(v),_.array.next({values:{...v}}),_.values.next({values:{...v}})}d={mount:n.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!S.isValid||!!n.keepIsValid||!!n.keepDirtyValues,a.watch=!!e.shouldUnregister,_.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:!c&&(n.keepDirty?r.isDirty:!(!n.keepDefaultValues||ue(t,o))),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:c?{}:n.keepDirtyValues?n.keepDefaultValues&&l?pe(o,l):r.dirtyFields:n.keepDefaultValues&&t?pe(o,t):n.keepDirty?r.dirtyFields:{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitSuccessful:!!n.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1})},je=(e,t)=>we(X(e)?e(l):e,t);return{control:{register:fe,unregister:ve,getFieldState:re,handleSubmit:Se,setError:ie,_executeSchema:M,_getWatch:V,_getDirty:F,_updateValid:A,_removeUnmounted:()=>{for(const e of d.unMount){const t=b(i,e);t&&(t._f.refs?t._f.refs.every(e=>!de(e)):!de(t._f.ref))&&ve(e)}d.unMount=new Set},_updateFieldArray:(e,t=[],n,s,u=!0,c=!0)=>{if(s&&n){if(a.action=!0,c&&Array.isArray(b(i,e))){const t=n(b(i,e),s.argA,s.argB);u&&w(i,e,t)}if(c&&Array.isArray(b(r.errors,e))){const t=n(b(r.errors,e),s.argA,s.argB);u&&w(r.errors,e,t),((e,t)=>{!y(b(e,t)).length&&le(e,t)})(r.errors,e)}if(S.touchedFields&&c&&Array.isArray(b(r.touchedFields,e))){const t=n(b(r.touchedFields,e),s.argA,s.argB);u&&w(r.touchedFields,e,t)}S.dirtyFields&&(r.dirtyFields=pe(o,l)),_.state.next({name:e,isDirty:F(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else w(l,e,t)},_updateDisabledField:me,_getFieldArray:t=>y(b(a.mount?l:o,t,e.shouldUnregister?b(o,t,[]):[])),_reset:we,_resetDefaultValues:()=>X(n.defaultValues)&&n.defaultValues().then(e=>{je(e,n.resetOptions),_.state.next({isLoading:!1})}),_updateFormState:e=>{r={...r,...e}},_disableForm:e=>{O(e)&&(_.state.next({disabled:e}),W(i,(t,n)=>{const r=b(i,n);r&&(t.disabled=r._f.disabled||e,Array.isArray(r._f.refs)&&r._f.refs.forEach(t=>{t.disabled=r._f.disabled||e}))},0,!1))},_subjects:_,_proxyFormState:S,_setErrors:e=>{r.errors=e,_.state.next({errors:r.errors,isValid:!1})},get _fields(){return i},get _formValues(){return l},get _state(){return a},set _state(e){a=e},get _defaultValues(){return o},get _names(){return d},set _names(e){d=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:te,register:fe,handleSubmit:Se,watch:(e,t)=>X(e)?_.values.subscribe({next:n=>e(V(void 0,t),n)}):V(e,t,!0),setValue:J,getValues:ne,reset:je,resetField:(e,t={})=>{b(i,e)&&(h(t.defaultValue)?J(e,g(b(o,e))):(J(e,t.defaultValue),w(o,e,g(t.defaultValue))),t.keepTouched||le(r.touchedFields,e),t.keepDirty||(le(r.dirtyFields,e),r.isDirty=t.defaultValue?F(e,g(b(o,e))):F()),t.keepError||(le(r.errors,e),S.isValid&&A()),_.state.next({...r}))},clearErrors:e=>{e&&R(e).forEach(e=>le(r.errors,e)),_.state.next({errors:e?r.errors:{}})},unregister:ve,setError:ie,setFocus:(e,t={})=>{const n=b(i,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:re}}var Se=n(6870);const we=e=>{e.register;var t=e.control,n=(e.reset,e.tenantId,e.t),r=(e.previousPage,e.formState,e.isLoading,window.Digit.Utils.browser.isMobile());return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsxs)(a.SearchField,{className:"pt-form-field",children:[(0,Se.jsx)("label",{children:n("AUDIT_FROM_DATE_LABEL")}),(0,Se.jsx)(F,{render:e=>(0,Se.jsx)(a.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:t})]}),(0,Se.jsxs)(a.SearchField,{className:"pt-form-field",children:[(0,Se.jsx)("label",{children:n("AUDIT_TO_DATE_LABEL")}),(0,Se.jsx)(F,{render:e=>(0,Se.jsx)(a.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:t})]}),(0,Se.jsx)(a.SearchField,{className:"pt-search-action-submit",children:(0,Se.jsx)(a.Button,{style:{marginTop:r?"510px":"25px",marginLeft:r?"0":"-30px",maxWidth:r?"100%":"240px"},label:n("ES_COMMON_APPLY"),submit:!0})})]})};var je=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],_e=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"];function Ce(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach(function(t){Ie(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ie(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ae(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return De(e,t);var n={}.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)?De(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function De(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const Pe=e=>{var t,n=e.Controller,o=e.register,l=e.control,s=e.t,u=e.reset,c=e.previousPage,d=e.handleSubmit,v=e.tenantId,m=e.data,f=e.onSubmit,p=e.isLoading,g=Ae((0,r.useState)([]),2),y=g[0],h=g[1],b=e=>(0,Se.jsx)("div",{onClick:e.onClick,children:(0,Se.jsx)(a.DownloadBtnCommon,{})});(0,r.useEffect)(()=>{(null==m?void 0:m.length)>0&&h([null==m?void 0:m.map(e=>{var t={};return t[s("AUDIT_DATE_LABEL")]=O(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=x(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),Ee({},t)})])},[m]);var O=e=>{if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate(),i=t.getFullYear();return n=(n>9?"":"0")+n,"".concat(r=(r>9?"":"0")+r,"/").concat(n,"/").concat(i)},x=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 r=(r>9?"":"0")+r,"".concat(n=((n=n>12?n-12:n)>9?"":"0")+n,":").concat(r," ").concat(i)},S=Ae((0,r.useReducer)(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),2),w=S[0],j=S[1],_=()=>{j({type:"remove"})},C=()=>(0,Se.jsx)("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:_,children:(0,Se.jsx)(a.CloseSvg,{})}),N={Controller:n,register:o,control:l,t:s,reset:u,previousPage:c},E=(0,r.useCallback)(e=>(e=>{var t=e.currentlyActiveMobileModal,n=e.searchFormFieldsComponentProps,r=e.tenantId,i=Ce(e,je),o=i.closeMobilePopupModal;return"SearchFormComponent"===t?(0,Se.jsxs)(a.SearchForm,Ee(Ee({},i),{},{children:[(0,Se.jsx)(C,{}),(0,Se.jsx)("div",{className:"MobilePopupHeadingWrapper",children:(0,Se.jsxs)("h2",{children:[s("PRIVACY_AUDIT_REPORT"),":"]})}),(0,Se.jsx)(we,Ee(Ee({},n),{},{closeMobilePopupModal:o,tenantId:r,t:s}))]})):(0,Se.jsx)("span",{})})(Ee({currentlyActiveMobileModal:e.currentlyActiveMobileModal,searchFormFieldsComponentProps:e.searchFormFieldsComponentProps,tenantId:e.tenantId},Ce(e,_e))),[w]),I=[];null==m||null===(t=m.roles)||void 0===t||t.forEach(e=>{I.push(null==e?void 0:e.name)});var A=(0,r.useMemo)(()=>null!=m&&m.display||""===m?[]:null==m?void 0:m.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:O(e.timestamp),[s("AUDIT_TIME_LABEL")]:x(e.timestamp),[s("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[s("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[s("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[m]);return(0,Se.jsxs)(i().Fragment,{children:[(0,Se.jsx)(a.BackButton,{}),(0,Se.jsx)("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"},children:(0,Se.jsx)(b,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(y)})}),(0,Se.jsxs)(a.HeaderComponent,{children:[s("PRIVACY_AUDIT_REPORT"),":"]}),(0,Se.jsx)("div",{className:"digit-search-box",children:(0,Se.jsx)(a.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>j({type:"set",payload:"SearchFormComponent"}),tenantId:v,t:s})}),w?(0,Se.jsx)(a.PopUp,{children:(0,Se.jsx)(E,{onSubmit:e=>{j({type:"remove"}),f(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:N,currentlyActiveMobileModal:w,closeMobilePopupModal:_,tenantId:v})}):null,p&&(0,Se.jsx)(a.Loader,{}),(0,Se.jsx)(a.DetailsCard,{data:A})]})};function Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Le(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const Me=e=>{var t,n,o=e.tenantId,s=e.t,u=e.onSubmit,c=e.data,d=e.count,v=function(e={}){const t=r.useRef(),n=r.useRef(),[i,o]=r.useState({isDirty:!1,isValidating:!1,isLoading:X(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:X(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...xe(e),formState:i});const l=t.current.control;return l._options=e,U({subject:l._subjects.state,next:e=>{L(e,l._proxyFormState,l._updateFormState,!0)&&o({...l._formState})}}),r.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),r.useEffect(()=>{if(l._proxyFormState.isDirty){const e=l._getDirty();e!==i.isDirty&&l._subjects.state.next({isDirty:e})}},[l,i.isDirty]),r.useEffect(()=>{e.values&&!ue(e.values,n.current)?(l._reset(e.values,l._options.resetOptions),n.current=e.values,o(e=>({...e}))):l._resetDefaultValues()},[e.values,l]),r.useEffect(()=>{e.errors&&l._setErrors(e.errors)},[e.errors,l]),r.useEffect(()=>{l._state.mount||(l._updateValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),r.useEffect(()=>{e.shouldUnregister&&l._subjects.values.next({values:l._getWatch()})},[e.shouldUnregister,l]),t.current.formState=P(i,l),t.current}({defaultValues:Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"}}),m=v.register,f=v.control,p=v.handleSubmit,g=v.setValue,y=v.getValues,h=v.reset,b=e=>{if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate(),i=t.getFullYear();return n=(n>9?"":"0")+n,"".concat(r=(r>9?"":"0")+r,"/").concat(n,"/").concat(i)},O=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 r=(r>9?"":"0")+r,"".concat(n=((n=n>12?n-12:n)>9?"":"0")+n,":").concat(r," ").concat(i)},x=(t=(0,r.useState)([]),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Re(e,t);var n={}.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)?Re(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),S=x[0],w=x[1],j=e=>(0,Se.jsx)("div",{onClick:e.onClick,children:(0,Se.jsx)(l.DownloadBtnCommon,{})});(0,r.useEffect)(()=>{m("offset",0),m("limit",5),m("sortOrder","DESC")},[m]),(0,r.useEffect)(()=>{(null==c?void 0:c.length)>0&&w([null==c?void 0:c.map(e=>{var t={};return t[s("AUDIT_DATE_LABEL")]=b(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=O(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(n),!0).forEach(function(t){Le(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},t)})])},[c]);var _=(0,r.useCallback)(e=>{0!==e.length&&(g("sortBy",e.id),g("sortOrder",e.desc?"DESC":"ASC"))},[]);function C(){g("offset",y("offset")-y("limit")),p(u)()}var N=window.Digit.Utils.browser.isMobile();if(N)return(0,Se.jsx)(Pe,{Controller:F,register:m,control:f,t:s,reset:h,previousPage:C,handleSubmit:p,tenantId:o,data:c,onSubmit:u});var E=e=>(0,Se.jsx)("span",{className:"cell-text",children:e}),I=(0,r.useMemo)(()=>[{Header:s("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var t="NA"===e.timestamp?s("WS_NA"):b(e.timestamp);return E("".concat(t))}},{Header:s("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{var t="NA"===e.timestamp?s("WS_NA"):O(e.timestamp);return E("".concat(t))}},{Header:s(N?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>E("".concat(null==e?void 0:e.dataView))},{Header:s(N?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>E("".concat(null==e?void 0:e.dataViewedBy))},{Header:s("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return E("".concat(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return(0,Se.jsxs)(i().Fragment,{children:[(0,Se.jsxs)("div",{style:{marginRight:"-70px"},children:[" ",(0,Se.jsx)(a.BackButton,{})," "]}),(0,Se.jsxs)("div",{style:{marginTop:"30px",marginLeft:"30px"},children:[" ",(0,Se.jsx)(a.HeaderComponent,{children:s("PRIVACY_AUDIT_REPORT")})," "]}),(0,Se.jsx)(a.SearchForm,{className:"audit-card",onSubmit:u,handleSubmit:p,children:(0,Se.jsx)(we,{register:m,control:f,reset:h,tenantId:o,t:s,previousPage:C})}),(0,Se.jsx)("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"},children:null!=c&&c.display?(0,Se.jsx)("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"},children:s(c.display).split("\\n").map((e,t)=>(0,Se.jsx)("p",{style:{textAlign:"center"},children:e},t))}):""!==c?(0,Se.jsxs)("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"},children:[(0,Se.jsx)("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"},children:(0,Se.jsx)(j,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(S)})}),(0,Se.jsx)(l.Table,{t:s,data:c,totalRecords:d,columns:I,getCellProps:e=>({style:{minWidth:e.column.Header===s("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){g("limit",Number(e.target.value)),p(u)()},currentPage:y("offset")/y("limit"),onNextPage:function(){g("offset",y("offset")+y("limit")),p(u)()},onPrevPage:C,manualPagination:!1,pageSizeLimit:y("limit"),onSort:_,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})]}):(0,Se.jsx)(a.Loader,{})})]})};function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(n),!0).forEach(function(t){Be(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Be(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const Ve=e=>{e.path;var t,n,i,l,a=(0,o.useTranslation)().t,s=Digit.ULBService.getCitizenCurrentTenant(),u=(i=(0,r.useState)({}),l=2,function(e){if(Array.isArray(e))return e}(i)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(i,l)||function(e,t){if(e){if("string"==typeof e)return Fe(e,t);var n={}.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)?Fe(e,t):void 0}}(i,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=u[0],d=u[1],v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"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)),r.getTime()}catch(t){return e}};(0,r.useEffect)(()=>{var e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){var t=ke({},e);d(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>ke(ke({},e),{},{[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);var m={enabled:!!(c&&Object.keys(c).length>0)},f=ke({},c),p=Digit.Hooks.useAudit({tenantId:s,filters:ke({},f),config:m}),g=p.isLoading,y=p.data;return(0,Se.jsx)(Me,{t:a,tenantId:s,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});var t=ke(ke({},e),{},{fromDate:v(null==e?void 0:e.fromDate),toDate:v(null==e?void 0:e.toDate)});d(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>ke(ke({},e),{},{[n]:(t[n],t[n])}),{}))},data:g?"":(null==y||null===(t=y.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==y?void 0:y.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==y||null===(n=y.ElasticSearchData)||void 0===n?void 0:n.length})}},2346(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(6243),i=n(4883),o=n.n(i),l=n(5953),a=n(6870);const s=e=>{var t,n,i,s,u,c,d,v,m,f,p,g,y,h,b,O=e.moduleCode,x=(0,l.useTranslation)().t,S=Digit.ULBService.getCitizenCurrentTenant(),w=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),j=w.isLoading,_=w.data,C=Digit.Hooks.useDynamicData({moduleCode:O,tenantId:S,filters:{},t:x}),N=C.isLoading,E=C.error,I=C.data,A=(C.isSuccess,e=>{var t=e.module,n=e.styles;switch(t){case"TL":default:return(0,a.jsx)(r.CaseIcon,{className:"fill-path-primary-main",styles:n});case"PT":return(0,a.jsx)(r.PTIcon,{className:"fill-path-primary-main",styles:n});case"MCOLLECT":return(0,a.jsx)(r.MCollectIcon,{className:"fill-path-primary-main",styles:n});case"PGR":return(0,a.jsx)(r.ComplaintIcon,{className:"fill-path-primary-main",styles:n})}}),D=null==_||null===(t=_.MdmsRes["common-masters"])||void 0===t||null===(t=t.StaticData[0])||void 0===t?void 0:t["".concat(O)],P=e=>{switch(e.module){case"PT":case"WS":return(0,a.jsx)("span",{className:"timerIcon",children:(0,a.jsx)(r.TimerIcon,{})});default:return null}},T=e=>{switch(e.module){case"PT":return(0,a.jsx)("span",{className:"rupeeSymbol",children:(0,a.jsx)(r.RupeeSymbol,{})});case"WS":return(0,a.jsx)("span",{className:"timerIcon",children:(0,a.jsx)(r.TimerIcon,{})});default:return null}},L=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:x("COMMON_VALIDITY"),validity:(null==D?void 0:D.validity)+("1"===(null==D?void 0:D.validity)?x("COMMON_DAY"):x("COMMON_DAYS"))};case"PGR":return{staticCommonContent:x("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:x("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==D?void 0:D.validity)+" "+("1"===(null==D?void 0:D.validity)?x("COMMON_DAY"):x("COMMON_DAYS"))};default:return{staticCommonContent:""}}},R=e=>{switch(e){case"PT":return{staticDataOne:(null==D?void 0:D.staticDataOne)+" "+x("COMMON_DAYS"),staticDataOneHeader:x("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==D?void 0:D.staticDataTwo,staticDataTwoHeader:x("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:x("PAY_WATER_CHARGES_BY")+" "+(null==D?void 0:D.staticDataOne)+" "+x("COMMON_DAYS")+" "+x("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==D?void 0:D.staticDataTwo)+" "+x("COMMON_DAYS"),staticDataTwoHeader:x("APPLICATION_PROCESSING_TIME")};default:return{}}};return j||N?(0,a.jsx)(r.Loader,{}):D?(0,a.jsxs)(o().Fragment,{children:[D&&null!=D&&D.payViaWhatsApp?(0,a.jsx)(r.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"},children:(0,a.jsxs)("div",{className:"pay-whatsapp-card",onClick:()=>{return e=null==D?void 0:D.payViaWhatsApp,void window.open(e);var e},children:[(0,a.jsx)("div",{className:"pay-whatsapp-text",children:x("PAY_VIA_WHATSAPP")}),(0,a.jsx)("div",{className:"whatsAppIconG",children:(0,a.jsx)(r.WhatsappIconGreen,{})})]})}):null,D&&null!=D&&D.helpline?(0,a.jsxs)(r.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"},children:[(0,a.jsxs)("div",{className:"static-home-Card",children:[(0,a.jsx)("div",{className:"static-home-Card-header",children:x("CALL_CENTER_HELPLINE")}),(0,a.jsx)("div",{className:"helplineIcon",children:(0,a.jsx)(r.HelpLineIcon,{})})]}),(0,a.jsxs)("div",{className:"call-center-card-text",children:[null!=D&&null!==(n=D.helpline)&&void 0!==n&&n.contactOne?(0,a.jsx)("div",{className:"call-center-card-content",children:(0,a.jsx)("a",{href:"tel:".concat(null==D||null===(i=D.helpline)||void 0===i?void 0:i.contactOne),children:null==D||null===(s=D.helpline)||void 0===s?void 0:s.contactOne})}):null,null!=D&&null!==(u=D.helpline)&&void 0!==u&&u.contactTwo?(0,a.jsx)("div",{className:"call-center-card-content",children:(0,a.jsx)("a",{href:"tel:".concat(null==D||null===(c=D.helpline)||void 0===c?void 0:c.contactTwo),children:null==D||null===(d=D.helpline)||void 0===d?void 0:d.contactTwo})}):null]})]}):null,D&&null!=D&&D.serviceCenter?(0,a.jsxs)(r.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"},children:[(0,a.jsxs)("div",{className:"static-home-Card",children:[(0,a.jsx)("div",{className:"static-home-Card-header",children:x("CITIZEN_SERVICE_CENTER")}),(0,a.jsx)("div",{className:"serviceCentrIcon",children:(0,a.jsx)(r.ServiceCenterIcon,{})})]}),(0,a.jsx)("div",{className:"service-center-details-card",children:(0,a.jsx)("div",{className:"service-center-details-text",children:null==D?void 0:D.serviceCenter})}),null!=D&&D.viewMapLocation?(0,a.jsx)("div",{className:"link",children:(0,a.jsx)("a",{href:null==D?void 0:D.viewMapLocation,children:x("VIEW_ON_MAP")})}):null]}):(0,a.jsx)("div",{}),(0,a.jsxs)(r.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"},children:[E||null==I||null===(null==I?void 0:I.dynamicDataOne)?(0,a.jsx)("div",{}):(0,a.jsx)("div",{className:"dynamicDataCard",children:(0,a.jsxs)("div",{className:"dynamicData",children:[(0,a.jsx)(A,{module:O,styles:{width:"24px",height:"24px"}}),(0,a.jsx)("span",{className:"dynamicData-content",children:null==I?void 0:I.dynamicDataOne})]})}),E||null==I||null===(null==I?void 0:I.dynamicDataTwo)?(0,a.jsx)("div",{}):(0,a.jsx)("div",{className:"dynamicDataCard",children:(0,a.jsxs)("div",{className:"dynamicData",children:[(0,a.jsx)(A,{module:O,styles:{width:"24px",height:"24px"}}),(0,a.jsx)("span",{className:"dynamicData-content",children:null==I?void 0:I.dynamicDataTwo})]})}),D&&null!=D&&D.staticDataOne?(0,a.jsx)("div",{className:"staticDataCard",children:(0,a.jsxs)("div",{className:"staticData",children:[(0,a.jsx)(P,{module:O}),(0,a.jsxs)("span",{className:"static-data-content",children:[(0,a.jsx)("span",{className:"static-data-content-first",style:{marginTop:""===(null===(v=R(O))||void 0===v?void 0:v.staticDataOne)?"8px":"unset"},children:null===(m=R(O))||void 0===m?void 0:m.staticDataOneHeader}),(0,a.jsx)("span",{className:"static-data-content-second",children:"".concat(null===(f=R(O))||void 0===f?void 0:f.staticDataOne)})]})]})}):(0,a.jsx)("div",{}),D&&null!=D&&D.staticDataTwo?(0,a.jsx)("div",{className:"staticDataCard",children:(0,a.jsxs)("div",{className:"staticData",children:[(0,a.jsx)(T,{module:O}),(0,a.jsxs)("span",{className:"static-data-content",children:[(0,a.jsx)("span",{className:"static-data-content-first",children:null===(p=R(O))||void 0===p?void 0:p.staticDataTwoHeader}),(0,a.jsx)("span",{className:"static-data-content-second",children:null===(g=R(O))||void 0===g?void 0:g.staticDataTwo})]})]})}):(0,a.jsx)("div",{}),D&&null!=D&&D.validity?(0,a.jsx)("div",{className:"staticDataCard",children:(0,a.jsxs)("div",{className:"staticData",children:[(0,a.jsx)("span",{className:"validityIcon",children:(0,a.jsx)(r.ValidityTimeIcon,{})}),(0,a.jsxs)("span",{className:"static-data-content",children:[(0,a.jsx)("span",{className:"static-data-content-first",children:null===(y=L(O))||void 0===y?void 0:y.staticCommonContent}),(0,a.jsx)("span",{className:"static-data-content-second",children:null===(h=L(O))||void 0===h?void 0:h.validity})]})]})}):(0,a.jsx)("div",{}),E||null==I||null==I||!I.staticData||null===(null==I?void 0:I.staticData)?(0,a.jsx)("div",{}):(0,a.jsx)("div",{className:"staticDataCard",children:(0,a.jsxs)("div",{className:"staticData",children:["PGR"===O?(0,a.jsx)(A,{module:O,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):(0,a.jsx)("span",{className:"validityIcon",children:(0,a.jsx)(r.ValidityTimeIcon,{})}),(0,a.jsxs)("span",{className:"static-data-content",children:[(0,a.jsx)("span",{className:"static-data-content-first",children:null===(b=L(O))||void 0===b?void 0:b.staticCommonContent}),(0,a.jsx)("span",{className:"static-data-content-second",children:null==I?void 0:I.staticData})]})]})})]})]}):(0,a.jsx)(o().Fragment,{})}},7155(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>L});var r=n(6243),i=n(4883),o=n.n(i),l=n(5953),a=n(4442),s=(n(4217),n(1234)),u=n(9536),c=n(8854),d=n(6810),v=n(6870);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const f=e=>{var t,n,s,u,f,p,g=e.linkData,y=e.islinkDataLoading,h=(0,l.useTranslation)().t,b=(0,a.useNavigate)(),O=Digit.Utils.getMultiRootTenant(),x=null===(t=Digit)||void 0===t||null===(t=t.ULBService)||void 0===t?void 0:t.getStateId(),S=Digit.UserService.getUser(),w=S&&S.access_token&&"CITIZEN"===(null==S||null===(n=S.info)||void 0===n?void 0:n.type),j=(f=(0,i.useState)(!1),p=2,function(e){if(Array.isArray(e))return e}(f)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(f,p)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.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)?m(e,t):void 0}}(f,p)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),_=j[0],C=j[1],N=()=>{C(!1)};if(y)return(0,v.jsx)(r.Loader,{});var E=(()=>{var e,t,n,r=window.location.href.includes("digit-studio"),i=[],o=1;return w&&(i.push({label:h("COMMON_BOTTOM_NAVIGATION_HOME"),icon:{icon:"Home",width:"1.5rem",height:"1.5rem"},navigationUrl:"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/citizen"),orderNumber:o++}),i.push({label:h("EDIT_PROFILE"),icon:{icon:"Edit",width:"1.5rem",height:"1.5rem"},navigationUrl:"/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/citizen/user/profile"),orderNumber:o++})),null===(e=Object.keys(g||{}))||void 0===e||null===(e=e.sort((e,t)=>e.localeCompare(t)))||void 0===e||e.forEach(e=>{var t,n=g[e];if(n&&0!==n.length&&n.some(e=>{var t;return null===(t=e.sidebar)||void 0===t?void 0:t.endsWith("-links")})){var l=null===(t=n[0])||void 0===t?void 0:t.leftIcon,a=!r||l&&"TLIcon"!==l?l||"ViewModule":"Devices",s=new Set,u=n.filter(e=>!s.has(e.name)&&(s.add(e.name),!0)).map(e=>({label:h(e.displayName||e.i18nKey),icon:{icon:!r||e.leftIcon&&"TLIcon"!==e.leftIcon?e.leftIcon||"ViewModule":"Devices",width:"1.5rem",height:"1.5rem"},navigationUrl:e.navigationURL||e.link,orderNumber:e.orderNumber}));u.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:1/0)-(void 0!==t.orderNumber?t.orderNumber:1/0)),1===u.length?i.push({label:h("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(e))),icon:{icon:a,width:"1.5rem",height:"1.5rem"},navigationUrl:u[0].navigationUrl,orderNumber:o++}):i.push({label:h("ACTION_TEST_".concat(Digit.Utils.locale.getTransformedLocale(e))),icon:{icon:a,width:"1.5rem",height:"1.5rem"},children:u,orderNumber:o++})}}),i.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:1/0)-(void 0!==t.orderNumber?t.orderNumber:1/0)),i})();return(0,v.jsxs)(o().Fragment,{children:[(0,v.jsx)(c.Ay,{minWidth:768,children:(0,v.jsx)(r.SideNav,{items:E,hideAccessbilityTools:!w,onSelect:e=>{var t=e.item;null!=t&&t.navigationUrl&&(e=>{var t;if(e&&"/"!==e)if(/^https?:\/\//i.test(e))window.open(e,"_blank","noopener,noreferrer");else if(e.includes("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath)))b(e);else{var n=window.location.origin;if(O){var r,i=(null===(r=window)||void 0===r?void 0:r.contextPath)||"sandbox-ui";e=e.replace("/".concat(i,"/citizen"),"/".concat(i,"/").concat(x,"/citizen")),b(e)}else{var o=n+e;try{window.location.href=o}catch(e){console.warn("Navigation failed, attempting fallback:",e),window.location.replace(o)}}}})(t.navigationUrl)},theme:(null===(s=window)||void 0===s||null===(s=s.globalConfigs)||void 0===s?void 0:s.getConfig("SIDENAV_THEME"))||"light",enableSearch:!0,variant:(null===(u=window)||void 0===u||null===(u=u.globalConfigs)||void 0===u?void 0:u.getConfig("SIDENAV_VARIANT"))||"primary",transitionDuration:"",className:"",styles:{position:"unset"},expandedWidth:"",collapsedWidth:"",onBottomItemClick:e=>{"Logout"===e&&C(!0)}})}),_&&(0,v.jsx)(d.A,{onSelect:()=>{var e;Digit.UserService.logout(),C(!1),window.location.href="/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/citizen/login")},onCancel:N,onDismiss:N})]})};var p,g,y,h,b,O=n(6177),x=n(1603),S=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,6340)),()=>n(6340).default,{loaderText:"CORE_LOADING_ERROR_COMPONENT"}),w=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,7973)),()=>n(7973).default,{loaderText:"CORE_LOADING_FAQS"}),j=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,6614)),()=>n(6614).default,{loaderText:"CORE_LOADING_HOME"}),_=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,9466)),()=>n(9466).default,{loaderText:"CORE_LOADING_LANGUAGE_SELECTION"}),C=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,6945)),()=>n(6945).default,{loaderText:"CORE_LOADING_LOCATION_SELECTION"}),N=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,855)),()=>n(855).default,{loaderText:"CORE_LOADING_USER_PROFILE"}),E=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,2339)),()=>n(2339).default,{loaderText:"CORE_LOADING_HOW_IT_WORKS"}),I=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,1022)),()=>n(1022).default,{loaderText:"CORE_LOADING_LOGIN"}),A=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,1737)),()=>n(1737).default,{loaderText:"CORE_LOADING_SEARCH"}),D=(0,r.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,2346)),()=>n(2346).default,{loaderText:"CORE_LOADING_DYNAMIC_CONTENT"}),P=["".concat(null===(p=window)||void 0===p?void 0:p.contextPath,"/citizen/register/name"),"/".concat(null===(g=window)||void 0===g?void 0:g.contextPath,"/citizen/select-language"),"/".concat(null===(y=window)||void 0===y?void 0:y.contextPath,"/citizen/select-location"),"/".concat(null===(h=window)||void 0===h?void 0:h.contextPath,"/citizen/login"),"/".concat(null===(b=window)||void 0===b?void 0:b.contextPath,"/citizen/register/otp")],T=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code));const L=e=>{var t,n,i=e.stateInfo,c=e.userDetails,d=e.CITIZEN,m=e.cityDetails,p=e.mobileView,g=e.handleUserDropdownSelection,y=e.logoUrl,h=(e.DSO,e.stateCode),b=e.modules,L=e.appTenants,R=(e.sourceUrl,e.pathname),M=e.initData,U=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:"[?(@.url == '".concat(Digit.Utils.getMultiRootTenant()?window.globalPath:window.contextPath,"-card')]")}],{select:e=>{var t;return null==e||null===(t=e["ACCESSCONTROL-ACTIONS-TEST"])||void 0===t||null===(t=t["actions-test"])||void 0===t?void 0:t.filter(e=>!0===e.enabled).reduce((e,t)=>{var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t,...e[t.parentModule]]:[t],e},{})}}),k=U.isLoading,B=U.data,F=U.isFetched,V=Digit.Hooks.useRouteSubscription(R),G=(0,l.useTranslation)().t,z=(0,a.useNavigate)(),W=((0,a.useLocation)(),P.some(e=>window.location.href.includes(e))),H=b.map((e,t)=>{var n=e.code,r=e.tenants;return(0,v.jsx)(a.Route,{path:"".concat(n.toLowerCase(),"/*"),element:(0,v.jsx)(x.A,{moduleCode:n,stateCode:h,userType:"citizen",tenants:T(r,L),maxRetries:3,retryDelay:1e3,initialDelay:800})},t)}),q=b.map((e,t)=>{var n=e.code,l=e.bannerImage,u=(Digit.ComponentRegistryService.getComponent("".concat(n,"Links")),F?(0,s.q)(B,n,G):void 0);return"ACTION_TEST_WS"===(null==u?void 0:u.header)&&(null==u||u.links.sort((e,t)=>t.orderNumber-e.orderNumber)),(0,v.jsxs)(o().Fragment,{children:[(0,v.jsx)(a.Route,{path:"".concat(n.toLowerCase(),"-home"),element:(0,v.jsxs)("div",{className:"moduleLinkHomePage",children:[(0,v.jsx)(O.A,{src:l||(null==i?void 0:i.bannerUrl),alt:"noimagefound"}),(0,v.jsx)(r.BackLink,{className:"moduleLinkHomePageBackButton",onClick:()=>z(-1)}),(0,v.jsx)("h1",{children:G("MODULE_"+n.toUpperCase())}),(0,v.jsx)("div",{className:"moduleLinkHomePageModuleLinks",children:u&&(0,v.jsx)(r.CitizenHomeCard,{header:G(null==u?void 0:u.header),links:null==u?void 0:u.links,Icon:()=>(0,v.jsx)("span",{}),Info:"OBPS"===n?()=>(0,v.jsx)(r.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:G("CS_FILE_APPLICATION_INFO_LABEL"),text:G("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===n})}),(0,v.jsx)(D,{moduleCode:null==n?void 0:n.toUpperCase()})]})}),(0,v.jsx)(a.Route,{path:"".concat(n.toLowerCase(),"-faq"),element:(0,v.jsx)(w,{module:null==n?void 0:n.toUpperCase()})}),(0,v.jsx)(a.Route,{path:"".concat(n.toLowerCase(),"-how-it-works"),element:(0,v.jsx)(E,{module:null==n?void 0:n.toUpperCase()})})]},n+"-routes")});return(0,v.jsxs)("div",{className:V,children:[(0,v.jsx)(u.A,{t:G,stateInfo:i,userDetails:c,CITIZEN:d,cityDetails:m,mobileView:p,handleUserDropdownSelection:g,logoUrl:y,showSidebar:!!d,linkData:B,islinkDataLoading:k}),(0,v.jsxs)("div",{className:"main center-container citizen-home-container mb-25",children:[W?null:(0,v.jsx)("div",{children:(0,v.jsx)(f,{linkData:B,islinkDataLoading:k})}),(0,v.jsxs)(a.Routes,{children:[(0,v.jsx)(a.Route,{path:"/",element:(0,v.jsx)(j,{})}),(0,v.jsx)(a.Route,{path:"select-language",element:(0,v.jsx)(_,{})}),(0,v.jsx)(a.Route,{path:"select-location",element:(0,v.jsx)("div",{className:"citizen-location-selection-wrapper",children:(0,v.jsx)(C,{})})}),(0,v.jsx)(a.Route,{path:"error",element:(0,v.jsx)(S,{initData:M,goToHome:()=>{var e,t,n;z("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/").concat(null===(t=Digit)||void 0===t||null===(t=t.UserService)||void 0===t||null===(n=t.getType)||void 0===n?void 0:n.call(t)))}})}),(0,v.jsx)(a.Route,{path:"all-services",element:(0,v.jsx)(s.AppHome,{userType:"citizen",modules:b,getCitizenMenu:B,fetchedCitizen:F,isLoading:k})}),(0,v.jsx)(a.Route,{path:"login/*",element:(0,v.jsx)(I,{stateCode:h})}),(0,v.jsx)(a.Route,{path:"register/*",element:(0,v.jsx)(I,{stateCode:h,isUserRegistered:!1})}),(0,v.jsx)(a.Route,{path:"user/profile",element:(0,v.jsx)("div",{className:"citizen-user-profile-wrapper",children:(0,v.jsx)(N,{stateCode:h,userType:"citizen",cityDetails:m})})}),(0,v.jsx)(a.Route,{path:"Audit",element:(0,v.jsx)(A,{})}),H,q]})]}),(0,v.jsx)("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{},children:(0,v.jsx)(O.A,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})]})}},158(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>E});var r=n(4883),i=n(5953),o=n(4442),l=n(5053),a=n(6243),s=n(7598),u=n.n(s),c=n(5697),d=n(5660),v=n(743),m=n(6177),f=n(6870);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){h(o,r,i,l,a,"next",e)}function a(e){h(o,r,i,l,a,"throw",e)}l(void 0)})}}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n={}.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)?x(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var S=e=>{var t,n,i=e.config,s=e.t,u=O((0,r.useState)(null),2),p=u[0],y=(u[1],Digit.Hooks.useQueryParams()),h=y.mobile_number,x=y.tenantId,S=(0,o.useNavigate)(),w=O((0,r.useState)(""),2),j=w[0],_=w[1],C=O((0,r.useState)(!0),2),N=C[0],E=(C[1],O((0,r.useState)(null),2)),I=E[0],A=E[1],D=()=>Digit.UserService.getType();(0,r.useEffect)(()=>{var e,t;if(p){Digit.UserService.setUser(p);var n=(null===(e=location.state)||void 0===e?void 0:e.from)||"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee");S(n,{replace:!0})}else Digit.UserService.setType("employee")},[p]);var P=()=>{A(null)},T=function(){var e=b(function*(){var e={otp:{mobileNumber:h,userType:D().toUpperCase(),type:"passwordreset",tenantId:x}};try{yield Digit.UserService.sendOtp(e,x),A(s("ES_OTP_RESEND"))}catch(e){var t;A((null==e||null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.error_description)||s("ES_INVALID_LOGIN_CREDENTIALS"))}setTimeout(P,5e3)});return function(){return e.apply(this,arguments)}}(),L=function(){var e=b(function*(e){try{if(e.newPassword!==e.confirmPassword)return A(s("ERR_PASSWORD_DO_NOT_MATCH"));var t=g(g({},e),{},{otpReference:j,tenantId:x,type:D().toUpperCase()});yield Digit.UserService.changePassword(t,x),R()}catch(e){var n;A((null==e||null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n||null===(n=n.error)||void 0===n||null===(n=n.fields)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.message)||s("ES_SOMETHING_WRONG")),setTimeout(P,5e3)}});return function(t){return e.apply(this,arguments)}}(),R=()=>{var e;S("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/employee/user/login"),{replace:!0})},M=O(i.inputs,3),U=M[0],k=M[1],B=M[2],F=[{body:[{label:s(U.label),type:U.type,populators:{name:U.name},isMandatory:!0},{label:s(k.label),type:k.type,populators:{name:k.name},isMandatory:!0},{label:s(B.label),type:B.type,populators:{name:B.name},isMandatory:!0}]}];return(0,f.jsxs)(c.A,{children:[(0,f.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,f.jsx)(a.BackLink,{variant:"primary",style:{borderBottom:"none"}})}),(0,f.jsxs)(l.FormComposer,{onSubmit:L,noBoxShadow:!0,inline:!0,submitInForm:!0,config:F,label:i.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword",children:[(0,f.jsx)(d.A,{}),(0,f.jsxs)(l.CardSubHeader,{style:{textAlign:"center"},children:[" ",i.texts.header," "]}),(0,f.jsxs)(l.CardText,{children:["".concat(s("CS_LOGIN_OTP_TEXT")," "),(0,f.jsxs)("b",{children:[" ","".concat(s("+ 91 - "))," ",h]})]}),(0,f.jsx)(v.A,{t:s,userType:"employee",otp:j,onOtpChange:_,error:N,onResend:T})]}),I&&(0,f.jsx)(a.Toast,{type:"error",label:s(I),onClose:P}),(0,f.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,f.jsx)(m.A,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]})};S.propTypes={loginParams:u().any},S.defaultProps={loginParams:null};const w=S;var j=[{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"}]}];function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){N(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const E=()=>{var e=(0,i.useTranslation)().t,t=(0,r.useMemo)(()=>j.map(t=>{var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return C(C({},t),{},{texts:n})}),[j]);return(0,f.jsx)(o.Routes,{children:(0,f.jsx)(o.Route,{path:"",element:(0,f.jsx)(w,{config:t[0],t:e})})})}},9458(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>_});var r=n(4883),i=n.n(r),o=n(5953),l=n(4442),a=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"mobileNumber",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"dropdown",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],s=n(6243),u=n(7598),c=n.n(u),d=n(5697),v=n(5660),m=n(6177),f=n(5419),p=n(1065),g=n(6870);function y(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.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)?b(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var O=e=>{var t,n,o,a,u=e.config,c=e.t,b=e.stateCode,O=Digit.Hooks.useTenants(),x=O.data,S=O.isLoading,w=h((0,r.useState)(null),2),j=w[0],_=(w[1],(0,l.useNavigate)()),C=h((0,r.useState)(null),2),N=C[0],E=C[1],I=(0,p.P)(b).data;if(null!=I&&I.config){var A,D=null==I||null===(A=I.config[0])||void 0===A?void 0:A.bannerImages;u.bannerImages=D}(0,r.useEffect)(()=>{var e,t;if(j){Digit.UserService.setUser(j);var n=(null===(e=location.state)||void 0===e?void 0:e.from)||"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee");_(n,{replace:!0})}else Digit.UserService.setType("employee")},[j]);var P=()=>{E(null)},T=function(){var e,t=(e=function*(e){if(e.city){var t={otp:{userName:e.username,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}};try{var n;yield Digit.UserService.sendOtp(t,e.city.code),_("/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/employee/user/change-password?USERNAME=").concat(e.username,"&tenantId=").concat(e.city.code))}catch(e){var r;E((null==e||null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.error)||void 0===r||null===(r=r.fields)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.message)||"Invalid login credentials!"),setTimeout(P,5e3)}}else alert("Please Select City!")},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){y(o,r,i,l,a,"next",e)}function a(e){y(o,r,i,l,a,"throw",e)}l(void 0)})});return function(e){return t.apply(this,arguments)}}(),L=()=>{var e;_("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/employee/login"))},R=h(u.inputs,2),M=(R[0],R[1]),U=[{body:[{label:c("USERNAME"),type:"text",populators:{name:"username"},isMandatory:!0},{label:c(M.label),type:M.type,populators:{name:M.name,optionsKey:"name",required:!0,options:x},isMandatory:!0}]}];return S?(0,g.jsx)(s.Loader,{page:!0,variant:"PageLoader"}):null!=u&&u.bannerImages?(0,g.jsx)(i().Fragment,{children:(0,g.jsxs)("div",{className:"login-container",children:[(0,g.jsx)(f.A,{bannerImages:null==u?void 0:u.bannerImages}),(0,g.jsxs)("div",{className:"login-form-container",children:[(0,g.jsx)(s.FormComposerV2,{onSubmit:T,noBoxShadow:!0,inline:!0,submitInForm:!0,config:U,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:L,heading:u.texts.header,description:u.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword",secondaryActionId:"employeeForgotPassword",children:(0,g.jsx)(v.A,{})}),N&&(0,g.jsx)(s.Toast,{type:"error",label:c(N),onClose:P}),(0,g.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,g.jsx)(m.A,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]})]})}):(0,g.jsxs)(d.A,{children:[(0,g.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,g.jsx)(s.BackLink,{onClick:()=>window.history.back()})}),(0,g.jsx)(s.FormComposerV2,{onSubmit:T,noBoxShadow:!0,inline:!0,submitInForm:!0,config:U,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:L,heading:u.texts.header,description:u.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword",secondaryActionId:"employeeForgotPassword",children:(0,g.jsx)(v.A,{})}),N&&(0,g.jsx)(s.Toast,{type:"error",label:c(N),onClose:P}),(0,g.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,g.jsx)(m.A,{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(o=o.globalConfigs)||void 0===o||null===(a=o.getConfig)||void 0===a?void 0:a.call(o,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]})};O.propTypes={loginParams:c().any},O.defaultProps={loginParams:null};const x=O;function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){j(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _=e=>{var t=e.stateCode,n=(0,o.useTranslation)().t,i=(0,r.useMemo)(()=>a.map(e=>{var t={};for(var r in e.texts)t[r]=n(e.texts[r]);return w(w({},e),{},{texts:t})}),[a]);return(0,g.jsx)(l.Routes,{children:(0,g.jsx)(l.Route,{path:"",element:(0,g.jsx)(x,{config:i[0],t:n,stateCode:t})})})}},5383(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>p});var r,i,o=n(6243),l=n(5053),a=n(4883),s=n(5953),u=n(4442),c=n(5697),d=n(6177),v=n(6870);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f={label:"English",value:null===(r=Digit)||void 0===r||null===(r=r.Utils)||void 0===r||null===(i=r.getDefaultLanguage)||void 0===i?void 0:i.call(r)};const p=()=>{var e,t,n,r,i=Digit.Hooks.useStore.getInitData(),p=i.data,g=i.isLoading,y=(0,s.useTranslation)().t,h=(0,u.useNavigate)(),b=p||{},O=b.languages,x=b.stateInfo,S=O;S&&0!=(null===(e=S)||void 0===e?void 0:e.length)||(S=[f]);var w,j,_,C=Digit.StoreData.getCurrentLanguage(),N=(w=(0,a.useState)(C),j=2,function(e){if(Array.isArray(e))return e}(w)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(w,j)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.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)?m(e,t):void 0}}(w,j)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),E=N[0],I=N[1],A=(null==O?void 0:O.length)>1;return g?(0,v.jsx)(o.Loader,{}):A?(0,v.jsxs)(c.A,{children:[(0,v.jsxs)(o.Card,{className:"bannerCard removeBottomMargin languageSelection",children:[(0,v.jsxs)("div",{className:"bannerHeader",children:[(0,v.jsx)(d.A,{className:"bannerLogo",src:null==x?void 0:x.logoUrl,alt:"Digit Banner Image"}),(0,v.jsx)("p",{children:y("TENANT_TENANTS_".concat(null==x||null===(t=x.code)||void 0===t?void 0:t.toUpperCase()))})]}),(0,v.jsx)("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"},children:S.map((e,t)=>(0,v.jsx)("div",{className:"language-button-container",children:(0,v.jsx)(l.CustomButton,{selected:e.value===E,text:y(e.label),onClick:()=>(e=>{I(e.value),Digit.LocalizationService.changeLanguage(e.value,x.code)})(e)})},t))}),(0,v.jsx)(o.SubmitBar,{style:{width:"100%"},label:y("CORE_COMMON_CONTINUE"),onSubmit:e=>{var t;h("/".concat((t=window.contextPath,t&&"string"==typeof t?t.split("/")[0]:""),"/user/login?ts=").concat(Date.now()))}})]}),(0,v.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,v.jsx)(d.A,{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n||null===(r=n.getConfig)||void 0===r?void 0:r.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]}):(0,v.jsx)(u.Navigate,{to:"/".concat(null===(_=window)||void 0===_?void 0:_.contextPath,"/employee/user/login"),replace:!0})}},5419(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(4883),i=n(4650),o=n(5953),l=n(6870);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const s=e=>{var t,n,s,u=e.bannerImages,c=void 0===u?[]:u,d=(n=(0,r.useState)(0),s=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(n,s)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.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)?a(e,t):void 0}}(n,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),v=d[0],m=d[1],f=(0,o.useTranslation)().t,p=c||(null===(t=i.m[0])||void 0===t?void 0:t.bannerImages)||[],g=()=>{m(e=>e===p.length-1?0:e+1)};return(0,r.useEffect)(()=>{var e=setInterval(()=>{g()},5e3);return()=>clearInterval(e)},[p.length]),(0,l.jsx)(r.Fragment,{children:(0,l.jsxs)("div",{className:"carousel-container",children:[p.sort((e,t)=>(null==e?void 0:e.id)-(null==t?void 0:t.id)).map((e,t)=>(0,l.jsx)("div",{className:"carousel-slide ".concat(t===v?"active":""),style:{backgroundImage:"url(".concat(e.image,")")},children:(0,l.jsxs)("div",{className:"carousel-content",children:[(0,l.jsx)("h2",{children:f(e.title)}),(0,l.jsx)("p",{children:f(e.description)})]})},e.id)),(0,l.jsxs)("div",{className:"carousel-controls",children:[(0,l.jsx)("button",{className:"carousel-nav",onClick:()=>{m(e=>0===e?p.length-1:e-1)},children:"<"}),(0,l.jsx)("div",{className:"carousel-indicators",children:p.map((e,t)=>(0,l.jsx)("button",{className:"indicator ".concat(t===v?"active":""),onClick:()=>(e=>{m(e)})(t)},t))}),(0,l.jsx)("button",{className:"carousel-nav",onClick:g,children:">"})]})]})})}},4650(e,t,n){"use strict";n.d(t,{m:()=>r});var r=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_LOGIN",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",key:"username",isMandatory:!0,populators:{name:"username",validation:{required:!0},error:"ERR_USERNAME_REQUIRED"}},{label:"CORE_LOGIN_PASSWORD",type:"password",key:"password",isMandatory:!0,populators:{name:"password",validation:{required:!0},error:"ERR_PASSWORD_REQUIRED"}},{isMandatory:!0,type:"dropdown",key:"city",label:"CORE_COMMON_CITY",disable:!1,populators:{name:"city",optionsKey:"name",error:"ERR_HRMS_INVALID_CITY",mdmsConfig:{masterName:"tenants",moduleName:"tenant",localePrefix:"TENANT_TENANTS",select:"(data)=>{ return Array.isArray(data['tenant'].tenants) && Digit.Utils.getUnique(data['tenant'].tenants).map(ele=>({code:ele.code,name:Digit.Utils.locale.getTransformedLocale('TENANT_TENANTS_'+ele.code)}))}"}}},{key:"check",type:"component",disable:!1,component:"PrivacyComponent",populators:{name:"check"},customProps:{module:"HCM"},isMandatory:!1,withoutLabel:!0},{key:"employeeSsoLoginOptions",type:"component",disable:!1,component:"EmployeeSSOLoginOptions",populators:{name:"employeeSsoLoginOptions"},isMandatory:!1,withoutLabel:!0}]}]},3934(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>M});var r=n(4883),i=n(5953),o=n(4442),l=n(4650),a=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!0,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],s=n(6243),u=n(7598),c=n.n(u),d=n(5697),v=n(5660),m=n(5419),f=n(6177),p=n(5181),g=n(6870),y=["UserRequest"],h=["UserRequest"],b=["UserRequest"];function O(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function x(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){O(o,r,i,l,a,"next",e)}function a(e){O(o,r,i,l,a,"throw",e)}l(void 0)})}}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){j(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var n={}.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)?N(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var E=e=>{var t,n,i,l,a,u=e.config,c=e.t,p=e.isDisabled,O=e.loginOTPBased,S=Digit.Hooks.useTenants(),j=(S.data,S.isLoading),N=Digit.Hooks.useStore.getInitData(),E=N.data,I=N.isLoading,A=Digit.Hooks.useSSOConfig(Digit.ULBService.getStateId(),{select:e=>{var t,n,r=(null==e||null===(t=e.MdmsRes)||void 0===t||null===(t=t.SSO)||void 0===t?void 0:t.IdentityProviders)||(null==e||null===(n=e.SSO)||void 0===n?void 0:n.IdentityProviders)||(null==e?void 0:e.IdentityProviders)||[];return Array.isArray(r)?r:[]}}),D=A.data,P=(A.isLoading,(E||{}).stateInfo),T=C((0,r.useState)(null),2),L=T[0],R=T[1],M=C((0,r.useState)(null),2),U=M[0],k=M[1],B=C((0,r.useState)(!1),2),F=B[0],V=B[1],G=C((0,r.useState)(!1),2),z=G[0],W=G[1],H=(0,o.useNavigate)(),q=null===(t=Digit.ComponentRegistryService)||void 0===t?void 0:t.getComponent("DynamicLoginComponent");(0,r.useEffect)(()=>{var e=new URLSearchParams(window.location.hash.slice(1)),t=new URLSearchParams(window.location.search),n=e.get("id_token")||t.get("id_token"),r=e.get("access_token")||t.get("access_token"),i=t.get("code"),o=t.get("error")||e.get("error"),l=t.get("error_description")||e.get("error_description")||t.get("errorDescription")||e.get("errorDescription");if(n||i||o)return o&&!U?(k(l||"SSO Login Failed!"),setTimeout(ee,5e3),W(!1),void V(!1)):void(null!=P&&P.code&&(!n&&!i||L||F||(n?X(n,r):i&&(V(!0),W(!0),Digit.UserService.microsoftAuthenticate({code:i}).then(e=>{var t=e.UserRequest,n=_(e,y);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),R(w({info:t},n)),V(!1),W(!1)}).catch(e=>{var t;k((null==e||null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.error_description)||"Login Failed!"),setTimeout(ee,5e3),V(!1),W(!1)})))));z&&W(!1)},[L,F,P,z,U]),(0,r.useEffect)(()=>{var e,t,n,r,i,o,l,a;if(L){Digit.SessionStorage.set("citizen.userRequestObject",L);var s=null==L||null===(e=L.info)||void 0===e||null===(e=e.roles)||void 0===e?void 0:e.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==L||null===(t=L.info)||void 0===t||null===(t=t.roles)||void 0===t?void 0:t.length)>0&&(L.info.roles=s),Digit.UserService.setUser(L),((e,t)=>{var n;if(!Digit.Utils.getMultiRootTenant()){var r=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",r),localStorage.setItem("Employee.locale",r),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))}})(null==L?void 0:L.info,null==L?void 0:L.access_token);var u,c,d,v,m="/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/employee");null!==(r=window)&&void 0!==r&&null!==(r=r.location)&&void 0!==r&&null!==(r=r.href)&&void 0!==r&&r.includes("from=")&&(m=decodeURIComponent(null===(u=window)||void 0===u||null===(u=u.location)||void 0===u||null===(u=u.href)||void 0===u||null===(u=u.split("from="))||void 0===u?void 0:u[1])||"/".concat(null===(c=window)||void 0===c?void 0:c.contextPath,"/employee")),null!=L&&null!==(i=L.info)&&void 0!==i&&i.roles&&null!=L&&null!==(o=L.info)&&void 0!==o&&null!==(o=o.roles)&&void 0!==o&&o.every(e=>"NATADMIN"===e.code)&&(m="/".concat(null===(d=window)||void 0===d?void 0:d.contextPath,"/employee/dss/landing/NURT_DASHBOARD")),null!=L&&null!==(l=L.info)&&void 0!==l&&l.roles&&null!=L&&null!==(a=L.info)&&void 0!==a&&null!==(a=a.roles)&&void 0!==a&&a.every(e=>"STADMIN"===e.code)&&(m="/".concat(null===(v=window)||void 0===v?void 0:v.contextPath,"/employee/dss/landing/home")),H(m,{replace:!0})}},[L]);var X=function(){var e=x(function*(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;V(!0),W(!0);try{var n,r=yield fetch("/user/oauth/token",{method:"POST",headers:{Authorization:"Basic ".concat((null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n?void 0:n.getConfig("JWT_TOKEN"))||"ZWdvdi11c2VyLWNsaWVudDo="),"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(w(w({grant_type:"jwt_exchange",scope:"read",userType:"EMPLOYEE",assertion:e},t&&{access_token:t}),{},{tenantId:null==P?void 0:P.code}))});if(!r.ok){var i,o,l,a,s,u=yield r.text();try{s=u?JSON.parse(u):null}catch(e){s=null}var c=(null===(i=s)||void 0===i?void 0:i.error_description)||(null===(o=s)||void 0===o?void 0:o.errorDescription)||(null===(l=s)||void 0===l?void 0:l.message)||(null===(a=s)||void 0===a?void 0:a.error)||u||"DIGIT Login Failed";throw new Error(c)}var d=yield r.json(),v=d.UserRequest,m=_(d,h);Digit.SessionStorage.set("Employee.tenantId",null==v?void 0:v.tenantId),R(w({info:v},m))}catch(e){console.error("DIGIT Login Error:",e),k((null==e?void 0:e.message)||"DIGIT Login Failed"),setTimeout(ee,5e3);try{window.sessionStorage.setItem("sso.force.prompt.login","true")}catch(e){}try{window.history.replaceState({},document.title,window.location.pathname)}catch(e){}}V(!1),W(!1)});return function(t){return e.apply(this,arguments)}}(),Q=function(){var e=x(function*(e){var t=(null==e?void 0:e.ui)||{},n=Boolean((t.authorizeUrl||(null==e?void 0:e.authorizeUrl))&&t.clientId);if("OIDC_POPUP"===t.authStrategy||"MICROSOFT"===t.provider||n)return Z(e);k("SSO configuration is invalid or unsupported"),setTimeout(ee,5e3)});return function(t){return e.apply(this,arguments)}}(),Z=function(){var e=x(function*(e){try{var t=w({},(null==e?void 0:e.ui)||{});t.authorizeUrl=t.authorizeUrl||(null==e?void 0:e.authorizeUrl),t.resource=t.resource||(null==e?void 0:e.resource),"MICROSOFT"!==t.provider||t.resource||(t.resource=t.clientId),t.provider&&localStorage.setItem("sso-provider",t.provider),t.logoutUrl&&localStorage.setItem("sso-logout-url",t.logoutUrl),t.tenantId&&localStorage.setItem("sso-tenant-id",t.tenantId),t.authority&&localStorage.setItem("sso-authority",t.authority);var n=(e=>{var t,n=e||{},r=n.authorizeUrl,i=n.clientId,o=n.scopes,l=void 0===o?["openid","profile","email"]:o,a=n.responseType,s=void 0===a?"id_token":a,u=n.responseMode,c=void 0===u?"fragment":u,d=n.nonceRequired,v=void 0===d||d,m=n.redirectPath,f=void 0===m?"employee/user/login":m,p=n.resource,g=n.provider;if(!r||!i)throw new Error("Missing authorizeUrl or clientId for OIDC login");var y=v?Math.random().toString(36).substring(2):void 0,h="".concat(window.location.origin,"/").concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/").concat(f),b=new URLSearchParams;b.set("client_id",i),b.set("response_type",s),b.set("redirect_uri",h),y&&b.set("nonce",y),c&&b.set("response_mode",c),l&&l.length&&b.set("scope",l.join(" ")),p&&b.set("resource",p);try{"true"===window.sessionStorage.getItem("sso.force.prompt.login")&&"MICROSOFT"===g&&(b.set("prompt","login"),window.sessionStorage.removeItem("sso.force.prompt.login"))}catch(e){}return"".concat(r,"?").concat(b.toString())})(t);window.location.href=n}catch(e){console.error("OIDC Login Error:",e),k(e.message||"OIDC Login Failed"),setTimeout(ee,5e3),W(!1)}});return function(t){return e.apply(this,arguments)}}(),Y=function(){var e=x(function*(e){var t,n;null!=e&&e.username&&(e.username=e.username.trim()),null!=e&&e.password&&(e.password=e.password.trim()),V(!0),W(!0);var r=w(w(w({},e),le),{},{userType:"EMPLOYEE"});r.tenantId=(null==r||null===(t=r.city)||void 0===t?void 0:t.code)||(null===(n=Digit)||void 0===n||null===(n=n.ULBService)||void 0===n?void 0:n.getStateId()),delete r.city;try{var i=yield Digit.UserService.authenticate(r),o=i.UserRequest,l=_(i,b);Digit.SessionStorage.set("Employee.tenantId",null==o?void 0:o.tenantId),R(w({info:o},l))}catch(e){var a;k((null==e||null===(a=e.response)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&c("ES_ERROR_USER_NOT_PERMITTED")||c("INVALID_LOGIN_CREDENTIALS")),setTimeout(ee,5e3)}V(!1),W(!1)});return function(t){return e.apply(this,arguments)}}(),K={url:"/user-otp/v1/_send",params:{tenantId:null===(n=Digit)||void 0===n||null===(n=n.ULBService)||void 0===n?void 0:n.getStateId()},body:{},config:{enable:!1}},J=Digit.Hooks.useCustomAPIMutationHook(K),$=function(){var e=x(function*(e){var t,n,r=e.email;yield J.mutate({body:{otp:{userName:e.email,type:"login",tenantId:null===(t=Digit)||void 0===t||null===(t=t.ULBService)||void 0===t?void 0:t.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,r;k(null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&null!==(n=n.Errors)&&void 0!==n&&n[0].code?"SANDBOX_RESEND_OTP".concat(null==e||null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.Errors)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.code):"SANDBOX_RESEND_OTP_ERROR"),setTimeout(ee,5e3)},onSuccess:(n=x(function*(e){var t,n;H("/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/employee/user/login/otp"),{state:{email:r,tenant:null===(n=Digit)||void 0===n||null===(n=n.ULBService)||void 0===n?void 0:n.getStateId()}})}),function(e){return n.apply(this,arguments)})})});return function(t){return e.apply(this,arguments)}}(),ee=()=>{k(null)},te=()=>{var e;H("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/employee/user/forgot-password"))},ne=Digit.ULBService.getStateId(),re={code:ne,name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_".concat(ne))},ie=null==D?void 0:D.map(e=>{var t,n,r,i,o,l;return w(w({},e),{},{provider:(null===(t=e.ui)||void 0===t?void 0:t.provider)||e.provider||"sso",label:c("SSO_PROVIDER_".concat((null===(n=e.ui)||void 0===n?void 0:n.name)||e.id)),icon:null!==(r=e.ui)&&void 0!==r&&r.logo?(0,g.jsx)("img",{src:e.ui.logo,alt:null===(i=e.ui)||void 0===i?void 0:i.name,className:"employee-login-sso-logo"}):"MICROSOFT"===(null===(o=e.ui)||void 0===o?void 0:o.provider)?"Microsoft":null===(l=e.ui)||void 0===l?void 0:l.icon,onLogin:e=>{Q(e)}})}),oe=[{body:null==u||null===(i=u.inputs)||void 0===i?void 0:i.map(e=>"EmployeeSSOLoginOptions"===(null==e?void 0:e.component)?w(w({},e),{},{customProps:w(w({},e.customProps),{},{ssoConfigs:ie})}):e)}];"admin"===Digit.Hooks.useQueryParams().mode&&0==(null==oe||null===(l=oe[0])||void 0===l||null===(l=l.body)||void 0===l||null===(l=l[2])||void 0===l?void 0:l.disable)&&null==(null==oe||null===(a=oe[0])||void 0===a||null===(a=a.body)||void 0===a||null===(a=a[2])||void 0===a||null===(a=a.populators)||void 0===a?void 0:a.defaultValue)&&(oe[0].body[2].disable=!0,oe[0].body[2].isMandatory=!1,oe[0].body[2].populators.defaultValue=re);var le=(0,r.useMemo)(()=>Object.fromEntries(oe[0].body.filter(e=>{var t,n;return(null==e||null===(t=e.populators)||void 0===t?void 0:t.defaultValue)&&(null==e||null===(n=e.populators)||void 0===n?void 0:n.name)}).map(e=>[e.populators.name,e.populators.defaultValue])),[]),ae=(e,t,n)=>{var r=oe[0].body.filter(e=>null==e?void 0:e.isMandatory).map(e=>null==e?void 0:e.key).some(e=>{var n=t[e];return null==n||""===n||!1===n});V(r)},se=function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(0,g.jsx)(s.FormComposerV2,{onSubmit:O?$:Y,isDisabled:p||F,noBoxShadow:!0,inline:!0,submitInForm:!0,config:oe,label:null==u||null===(e=u.texts)||void 0===e?void 0:e.submitButtonLabel,secondaryActionLabel:(null==u||null===(t=u.texts)||void 0===t?void 0:t.secondaryButtonLabel)+(r.includes("login-form-container")?"?":""),onSecondayActionClick:te,onFormValueChange:ae,heading:null==u||null===(n=u.texts)||void 0===n?void 0:n.header,className:"".concat(o),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:i,buttonClassName:"buttonClassName",defaultValues:le,children:null!=P&&P.code?(0,g.jsx)(v.A,{}):(0,g.jsx)(v.A,{showTenant:!1})})},ue=e=>{var t,n;return(0,g.jsx)("div",{className:e,style:{backgroundColor:"unset"},children:(0,g.jsx)(f.A,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})};return j||I?(0,g.jsx)(s.Loader,{page:!0,variant:"PageLoader"}):null!=u&&u.bannerImages?(0,g.jsxs)("div",{className:"login-container",children:[(0,g.jsx)(m.A,{bannerImages:null==u?void 0:u.bannerImages}),(0,g.jsxs)("div",{className:"login-form-container",children:[se("login-form-container","",O?"sandbox-onboarding-wrapper":""),q&&(0,g.jsx)(q,{}),U&&(0,g.jsx)(s.Toast,{type:"error",label:c(U),onClose:ee}),ue("EmployeeLoginFooter")]})]}):(0,g.jsxs)(d.A,{children:[z&&(0,g.jsx)("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(0,0,0,0.35)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:(0,g.jsx)(s.Loader,{})}),(0,g.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,g.jsx)(s.BackLink,{onClick:()=>window.history.back()})}),se("loginFormStyleEmployee","loginCardClassName",O?"sandbox-onboarding-wrapper":""),q&&(0,g.jsx)(q,{}),U&&(0,g.jsx)(s.Toast,{type:"error",label:c(U),onClose:ee}),ue("employee-login-home-footer")]})};E.propTypes={loginParams:c().any},E.defaultProps={loginParams:null};const I=(0,p.A)(E,".login-form-container");var A=n(1065);function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){T(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n={}.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)?R(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const M=e=>{var t,n=e.stateCode,u=(0,i.useTranslation)().t,c=L((0,r.useState)(l.m),2),d=c[0],v=c[1],m=L((0,r.useState)(a),2),f=m[0],p=(m[1],Digit.StoreData.getCurrentLanguage()),y=(null===(t=window)||void 0===t||null===(t=t.globalConfigs)||void 0===t?void 0:t.getConfig("OTP_BASED_LOGIN"))||!1,h=(0,A.P)(n),b=h.data,O=h.isLoading;Digit.Services.useStore({stateCode:n,moduleCode:["privacy-policy"],language:p,modulePrefix:"digit"}).data,(0,r.useEffect)(()=>{!O&&null!=b&&b.config?v(null==b?void 0:b.config):v(l.m)},[b,O]);var x=(0,r.useMemo)(()=>d.map(e=>{var t={};for(var n in e.texts)t[n]=u(e.texts[n]);return P(P({},e),{},{texts:t})},[d])),S=(0,r.useMemo)(()=>f.map(e=>{var t={};for(var n in e.texts)t[n]=u(e.texts[n]);return P(P({},e),{},{texts:t})},[f]));return O?(0,g.jsx)(s.Loader,{page:!1,variant:"PageLoader"}):(0,g.jsxs)(o.Routes,{children:[" ",(0,g.jsx)(o.Route,{path:"/",element:y?(0,g.jsx)(I,{config:S[0],t:u,loginOTPBased:y}):(0,g.jsx)(I,{config:x[0],t:u})})]})}},1626(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(4883),i=n(6243),o=n(5053),l=n(5953),a=n(4442),s=n(5697),u=n(5660),c=n(6177),d=n(6870),v=["UserRequest"];function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.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)?y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const h=e=>{var t,n,y,h=e.isLogin,b=void 0!==h&&h,O=(0,l.useTranslation)().t,x=(0,a.useNavigate)(),S=(0,a.useLocation)(),w=g((0,r.useState)(null),2),j=w[0],_=w[1],C=g((0,r.useState)(!1),2),N=C[0],E=C[1],I=g((0,r.useState)(null),2),A=I[0],D=I[1],P=g((0,r.useState)((null==S||null===(t=S.state)||void 0===t?void 0:t.data)||{}),2),T=(P[0],P[1],g((0,r.useState)(!1),2)),L=(T[0],T[1],S.state||{}),R=L.email,M=L.tenant,U=Digit.Hooks.useCustomMDMS(M,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}}).data,k=null==U?void 0:U[0].url,B=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:R,tenant:M},populators:{required:!0}}]}],F=[{texts:{header:O("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],V=()=>{_(null)};(0,r.useEffect)(()=>{var e,t,n;if(A){Digit.SessionStorage.set("citizen.userRequestObject",A);var r=null==A||null===(e=A.info)||void 0===e||null===(e=e.roles)||void 0===e?void 0:e.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==A||null===(t=A.info)||void 0===t||null===(t=t.roles)||void 0===t?void 0:t.length)>0&&(A.info.roles=r),Digit.UserService.setUser(A),((e,t)=>{var n;if(!Digit.Utils.getMultiRootTenant()){var r=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",r),localStorage.setItem("Employee.locale",r),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))}})(null==A?void 0:A.info,null==A?void 0:A.access_token);var i="/".concat(null===(n=window)||void 0===n?void 0:n.globalPath,"/user/setup"),o=((e,t,n,r)=>{var i,o,l,a="SUPERUSER"===(null==t||null===(i=t.info)||void 0===i||null===(i=i.roles)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.code),s=null===(o=window)||void 0===o?void 0:o.contextPath;switch(!0){case"/sandbox-ui/user/otp"===e&&a:return"/".concat(s,"/employee/sandbox/landing");case a&&(null==n||null===(l=n[0])||void 0===l||null===(l=l.rolesForLandingPage)||void 0===l?void 0:l.includes("SUPERUSER")):return"/".concat(s).concat(r);default:return"/".concat(s,"/employee")}})(S.pathname,A,U,k);return b?void x(o):void x({pathname:i},{state:{tenant:M}})}},[A]);var G=function(){var e,t=(e=function*(e){var t,n={username:R,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:M,userType:"EMPLOYEE"};try{var r=yield Digit.UserService.authenticate(n),i=r.UserRequest,o=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(r,v);Digit.SessionStorage.set("Employee.tenantId",null==i?void 0:i.tenantId),D(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({info:i},o))}catch(e){var l;_((null==e||null===(l=e.response)||void 0===l||null===(l=l.data)||void 0===l?void 0:l.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&O("ES_ERROR_USER_NOT_PERMITTED")||O("INVALID_LOGIN_CREDENTIALS")),setTimeout(V,5e3)}},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){p(o,r,i,l,a,"next",e)}function a(e){p(o,r,i,l,a,"throw",e)}l(void 0)})});return function(e){return t.apply(this,arguments)}}();return(0,d.jsxs)(s.A,{children:[(0,d.jsxs)("div",{className:"employeeBackbuttonAlign",children:[(0,d.jsx)(i.BackLink,{onClick:()=>x(-1)})," "]}),(0,d.jsx)(o.FormComposerV2,{onSubmit:G,noBoxShadow:!0,inline:!0,submitInForm:!0,onFormValueChange:(e,t)=>{var n,r=t.OtpComponent;6===(null==r||null===(n=r.otp)||void 0===n?void 0:n.length)?E(!0):E(!1)},isDisabled:!N,config:B,label:F[0].texts.submitButtonLabel,heading:F[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper",children:(0,d.jsx)(u.A,{showTenant:!1})}),j&&(0,d.jsx)(i.Toast,{type:"error",label:O(j),onClose:V}),(0,d.jsxs)("div",{className:"EmployeeLoginFooter",children:[(0,d.jsx)(c.A,{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n||null===(y=n.getConfig)||void 0===y?void 0:y.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})," "]})]})}},8259(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>w});var r=n(4883),i=n(5953),o=n(4442),l=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,maxLength:64},error:"ERR_EMAIL_REQUIRED"}},{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/,maxLength:50},error:"ERR_ACCOUNT_NAME_REQUIRED"},infoMessage:"SANDBOX_SIGNUP_ACCOUNT_NAME_TOOLTIP"},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"A digital partner for frontline workers",description:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio nobis temporibus provident expedita consequuntur, repudiandae pariatur! Deleniti molestias vero, cumque vel error labore ipsam totam?"},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Feature 2 Title",description:"Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."},{id:3,image:"https://images.unsplash.com/photo-1624555130581-1d9cca783bc0",title:"Feature 3 Title",description:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate aut autem aperiam et modi saepe obcaecati doloremque voluptatem iusto quidem!"},{id:4,image:"https://images.unsplash.com/photo-1547481887-a26e2cacb5b2",title:"Feature 4 Title",description:"Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."},{id:5,image:"https://images.unsplash.com/photo-1536782376847-5c9d14d97cc0",title:"Feature 5 Title",description:"Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."},{id:6,image:"https://images.unsplash.com/photo-1490730141103-6cac27aaab94",title:"Feature 6 Title",description:"Lorem, ipsum dolor sit amet consectetur adipisicing elit. Exercitationem esse doloribus molestiae fugiat eos adipisci sequi cumque sit, laboriosam dolores blanditiis nobis assumenda quasi nemo consectetur. Officia nesciunt quibusdam molestiae."}]}],a=n(6243),s=n(7598),u=n.n(s),c=n(5697),d=n(5660),v=(n(6177),n(6870));function m(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function f(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){m(o,r,i,l,a,"next",e)}function a(e){m(o,r,i,l,a,"throw",e)}l(void 0)})}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n={}.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)?g(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var y=e=>{var t,n,i,l,s,u,m,g=e.config,y=e.t,h=e.isDisabled,b=Digit.Hooks.useTenants(),O=(b.data,b.isLoading),x=Digit.Hooks.useStore.getInitData(),S=x.data,w=x.isLoading,j=((S||{}).stateInfo,p((0,r.useState)(null),2)),_=j[0],C=j[1],N=p((0,r.useState)(!1),2),E=N[0],I=N[1],A=(0,o.useNavigate)(),D=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}}),P=function(){var e=f(function*(e){var t;yield D.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,r;C({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&null!==(n=n.Errors)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.code?"SANDBOX_SIGNUP_".concat(null==e||null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.Errors)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.code):"SANDBOX_SIGNUP_ERROR"})},onSuccess:(t=f(function*(e){var t,n,r;A({pathname:"/".concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/user/otp"),state:{email:null==e||null===(n=e.Tenants[0])||void 0===n?void 0:n.email,tenant:null==e||null===(r=e.Tenants[0])||void 0===r?void 0:r.code}})}),function(e){return t.apply(this,arguments)})})});return function(t){return e.apply(this,arguments)}}(),T=[{body:null==g?void 0:g.inputs}];return"admin"===Digit.Hooks.useQueryParams().mode&&0==(null==T||null===(t=T[0])||void 0===t||null===(t=t.body)||void 0===t||null===(t=t[2])||void 0===t?void 0:t.disable)&&null==(null==T||null===(n=T[0])||void 0===n||null===(n=n.body)||void 0===n||null===(n=n[2])||void 0===n||null===(n=n.populators)||void 0===n?void 0:n.defaultValue)&&(T[0].body[2].disable=!0,T[0].body[2].isMandatory=!1,T[0].body[2].populators.defaultValue=defaultValue),O||w?(0,v.jsx)(a.Loader,{}):(0,v.jsxs)(c.A,{children:[(0,v.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,v.jsx)(a.BackLink,{onClick:()=>window.history.back()})}),(0,v.jsx)(a.FormComposerV2,{onSubmit:P,isDisabled:h||E,noBoxShadow:!0,inline:!0,submitInForm:!0,config:T,label:null==g||null===(i=g.texts)||void 0===i?void 0:i.submitButtonLabel,secondaryActionLabel:null==g||null===(l=g.texts)||void 0===l?void 0:l.secondaryButtonLabel,onFormValueChange:(e,t,n)=>{var r=T[0].body.map(e=>e.key).some(e=>{var n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});I(r)},heading:null==g||null===(s=g.texts)||void 0===s?void 0:s.header,className:"sandbox-signup-form",cardSubHeaderClassName:"signupCardSubHeaderClassName",cardClassName:"signupCardClassName sandbox-onboarding-wrapper",buttonClassName:"buttonClassName",children:(0,v.jsx)(d.A,{showTenant:!1})}),_&&(0,v.jsx)(a.Toast,{type:"error",label:y(null==_?void 0:_.label),onClose:()=>{C(null)}}),(0,v.jsx)("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"},children:(0,v.jsx)("img",{alt:"Powered by DIGIT",src:null===(u=window)||void 0===u||null===(u=u.globalConfigs)||void 0===u||null===(m=u.getConfig)||void 0===m?void 0:m.call(u,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})]})};y.propTypes={loginParams:u().any},y.defaultProps={loginParams:null};const h=y;function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach(function(t){x(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const w=e=>{var t,n,a=e.stateCode,s=(0,i.useTranslation)().t,u=(t=(0,r.useState)(l),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n={}.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)?S(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=u[0],d=u[1],m=Digit.StoreData.getCurrentLanguage(),f=(Digit.Services.useStore({stateCode:a,moduleCode:["privacy-policy"],language:m,modulePrefix:"digit"}).data,Digit.Hooks.useCommonMDMS(a,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1})),p=f.data,g=f.isLoading;(0,r.useEffect)(()=>{!g&&null!=p&&p.config?d(p.config):d(l)},[p,g]);var y=(0,r.useMemo)(()=>c.map(e=>{var t={};for(var n in e.texts)t[n]=s(e.texts[n]);return O(O({},e),{},{texts:t})}),[c]);return(0,v.jsx)(o.Routes,{children:(0,v.jsx)(o.Route,{path:"",element:(0,v.jsx)(h,{config:y[0],t:s})})})}},3333(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>v});var r=n(4883),i=n(6243),o=n(5953),l=n(4442),a=n(5697),s=n(5660),u=n(6177),c=n(6870);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const v=()=>{var e,t,n,v,m,f,p=(0,o.useTranslation)().t,g=((0,l.useLocation)().state||{}).tenant,y=(0,r.useRef)(null),h=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(e=e.info)||void 0===e?void 0:e.roles,b=(m=(0,r.useState)(!0),f=2,function(e){if(Array.isArray(e))return e}(m)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(m,f)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.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)?d(e,t):void 0}}(m,f)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),O=b[0],x=b[1],S=Digit.Hooks.useCustomMDMS(g,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,gcTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}}).data;(0,r.useEffect)(()=>{null!=S&&S[0].url&&x(!1)},[S]);var w=null==S?void 0:S[0].url;return(0,c.jsxs)(a.A,{children:[(0,c.jsx)("div",{className:"employeeBackbuttonAlign",children:(0,c.jsx)(i.BackLink,{onClick:()=>window.history.back()})}),(0,c.jsxs)(i.Card,{className:"card-sandbox",children:[(0,c.jsx)(s.A,{showTenant:!1}),(0,c.jsx)("div",{className:"sandbox-success-signup",children:(0,c.jsx)(i.SVG.TickMark,{fill:"#fff",height:30,width:70})}),(0,c.jsx)(i.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"},children:p("SANDBOX_HEADER")}),(0,c.jsx)(i.CardText,{className:"cardText-sandbox",children:p("SAMDBOX_URL_SUB")}),(0,c.jsxs)(i.CardLabel,{children:[" ",p("SANDBOX_URL")," "]}),(0,c.jsxs)("div",{className:"sandbox-url-wrapper",children:[(0,c.jsx)(i.TextInput,{inputRef:y,className:"urlInputText",onChange:()=>{},nonEditable:!0,value:"".concat(window.location.host,"/").concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/").concat(g,"/employee")}),(0,c.jsx)(i.Button,{className:"copyButton",variation:"secondary",onClick:()=>{navigator.clipboard.writeText(y.current.value)},label:p("COPY_URL")})]}),(0,c.jsx)("div",{className:"sandbox-url-footer",children:p("SANDBOX_URL_FOOT")}),(0,c.jsx)(i.Button,{isDisabled:O,onClick:()=>{var e,t;((e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))})(h,S)?window.location.href="/".concat(null===(e=window)||void 0===e?void 0:e.globalPath,"/").concat(g).concat(w):window.location.href="/".concat(null===(t=window)||void 0===t?void 0:t.globalPath,"/").concat(g,"/employee")},label:p("SIGN_IN")})]}),(0,c.jsx)("div",{className:"EmployeeLoginFooter",children:(0,c.jsx)(u.A,{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(n=n.globalConfigs)||void 0===n||null===(v=n.getConfig)||void 0===v?void 0:v.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})]})}},296(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>C});var r=n(4883),i=n(5953),o=n(4442),l=n(6243),a=n(1603),s=n(6870),u=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,158)),()=>n(158).default,{loaderText:"CORE_LOADING_CHANGE_PASSWORD"}),c=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,9458)),()=>n(9458).default,{loaderText:"CORE_LOADING_FORGOT_PASSWORD"}),d=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,1234)).then(e=>({default:e.AppHome})),()=>n(1234).AppHome,{loaderText:"CORE_LOADING_HOME"}),v=(e,t)=>t.filter(t=>{var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,e=>e.code).includes(t.code)}),m=e=>{var t,n,r=e.stateCode,i=e.userType,l=e.modules,m=e.appTenants,f=e.additionalComponent,p=(0,o.useLocation)(),g=Digit.UserService.getUser();if(!g||null==g||!g.access_token||null==g||!g.info)return(0,s.jsx)(o.Navigate,{to:{pathname:"/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/").concat(i,"/user/login"),state:{from:p.pathname+p.search}},replace:!0});var y=null==l?void 0:l.map((e,t)=>{var n=e.code,l=e.tenants;return(0,s.jsx)(o.Route,{path:"".concat(n.toLowerCase(),"/*"),element:(0,s.jsx)(a.A,{moduleCode:n,stateCode:r,userType:i,tenants:v(l,m),maxRetries:3,retryDelay:1e3,initialDelay:800})},t)});return(0,s.jsx)("div",{className:"ground-container digit-home-ground",children:(0,s.jsxs)(o.Routes,{children:[y,(0,s.jsx)(o.Route,{path:"login",element:(0,s.jsx)(o.Navigate,{to:{pathname:"/".concat(null===(t=window)||void 0===t?void 0:t.contextPath,"/").concat(i,"/user/login"),state:{from:p.pathname+p.search}},replace:!0})}),(0,s.jsx)(o.Route,{path:"forgot-password",element:(0,s.jsx)(c,{})}),(0,s.jsx)(o.Route,{path:"change-password",element:(0,s.jsx)(u,{})}),(0,s.jsx)(o.Route,{path:"*",element:(0,s.jsx)(d,{userType:i,modules:l,additionalComponent:f})})]})})},f=n(4217),p=n(9536),g=n(6177),y=n(5181),h=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,158)),()=>n(158).default,{loaderText:"CORE_LOADING_CHANGE_PASSWORD"}),b=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,9458)),()=>n(9458).default,{loaderText:"CORE_LOADING_FORGOT_PASSWORD"}),O=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,5383)),()=>n(5383).default,{loaderText:"CORE_LOADING_LANGUAGE_SELECTION"}),x=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,3934)),()=>n(3934).default,{loaderText:"CORE_LOADING_LOGIN"}),S=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,1626)),()=>n(1626).default,{loaderText:"CORE_LOADING_OTP"}),w=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,855)),()=>n(855).default,{loaderText:"CORE_LOADING_USER_PROFILE"}),j=(0,l.lazyWithFallback)(()=>Promise.resolve().then(n.bind(n,6340)),()=>n(6340).default,{loaderText:"CORE_LOADING_ERROR_COMPONENT"}),_=["user/landing","user/profile","user/error","user/productPage"];const C=(0,y.A)(e=>{var t,n,l,a,u=e.stateInfo,c=e.userDetails,d=e.CITIZEN,v=e.cityDetails,y=e.mobileView,C=e.handleUserDropdownSelection,N=e.logoUrl,E=e.logoUrlWhite,I=e.stateCode,A=e.modules,D=e.appTenants,P=(e.sourceUrl,e.pathname,e.initData),T=e.noTopBar,L=void 0!==T&&T,R=(0,o.useNavigate)(),M=(0,i.useTranslation)().t,U=(0,o.useLocation)(),k=null==U||null===(t=U.pathname)||void 0===t?void 0:t.includes("language-selection"),B=_.some(e=>{var t;return null==U||null===(t=U.pathname)||void 0===t?void 0:t.includes(e)});(0,r.useEffect)(()=>{Digit.UserService.setType("employee")},[]);var F=null==P||null===(n=P.modules)||void 0===n||null===(n=n.filter(e=>null==e?void 0:e.additionalComponent))||void 0===n?void 0:n.map(e=>null==e?void 0:e.additionalComponent);return(0,s.jsx)("div",{className:"employee",children:(0,s.jsxs)(o.Routes,{children:[(0,s.jsx)(o.Route,{path:"user/*",element:(0,s.jsxs)(s.Fragment,{children:[B&&(0,s.jsx)(p.A,{t:M,stateInfo:u,userDetails:c,CITIZEN:d,cityDetails:v,mobileView:y,handleUserDropdownSelection:C,logoUrl:N,logoUrlWhite:E,showSidebar:!!B,showLanguageChange:!k}),(0,s.jsx)("div",{className:B?"grounded-container":"loginContainer",style:B?{padding:0,paddingTop:"0",marginLeft:"0"}:{"--banner-url":"url(".concat(null==u?void 0:u.bannerUrl,")"),padding:"0px"},children:(0,s.jsxs)(o.Routes,{children:[(0,s.jsx)(o.Route,{path:"login",element:(0,s.jsx)(x,{stateCode:I})}),(0,s.jsx)(o.Route,{path:"login/otp",element:(0,s.jsx)(S,{isLogin:!0})}),(0,s.jsx)(o.Route,{path:"forgot-password",element:(0,s.jsx)(b,{stateCode:I})}),(0,s.jsx)(o.Route,{path:"change-password",element:(0,s.jsx)(h,{})}),(0,s.jsx)(o.Route,{path:"profile",element:(0,s.jsx)(w,{stateCode:I,userType:"employee",cityDetails:v})}),(0,s.jsx)(o.Route,{path:"error",element:(0,s.jsx)(j,{initData:P,goToHome:()=>{var e,t,n;R("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/").concat(null===(t=Digit)||void 0===t||null===(t=t.UserService)||void 0===t||null===(n=t.getType)||void 0===n?void 0:n.call(t)))}})}),(0,s.jsx)(o.Route,{path:"language-selection",element:(0,s.jsx)(O,{})}),(0,s.jsx)(o.Route,{path:"*",element:(0,s.jsx)(o.Navigate,{to:"language-selection",replace:!0})})]})})]})}),(0,s.jsx)(o.Route,{path:"*",element:(0,s.jsxs)(s.Fragment,{children:[!L&&(0,s.jsx)(p.A,{t:M,stateInfo:u,userDetails:c,CITIZEN:d,cityDetails:v,mobileView:y,handleUserDropdownSelection:C,logoUrl:N,logoUrlWhite:E,modules:A}),(0,s.jsxs)("div",{className:L?"":"main digit-home-main",children:[(0,s.jsx)("div",{className:"employee-app-wrapper digit-home-app-wrapper",children:(0,s.jsx)(f.A,{initData:P,children:(0,s.jsx)(m,{stateCode:I,userType:"employee",modules:A,appTenants:D,additionalComponent:F})})}),(0,s.jsx)("div",{className:"employee-home-footer",children:(0,s.jsx)(g.A,{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(l=l.globalConfigs)||void 0===l||null===(a=l.getConfig)||void 0===a?void 0:a.call(l,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:()=>{var e,t;window.open(null===(e=window)||void 0===e||null===(e=e.globalConfigs)||void 0===e||null===(t=e.getConfig)||void 0===t?void 0:t.call(e,"DIGIT_HOME_URL"),"_blank").focus()}})})]})]})}),(0,s.jsx)(o.Route,{path:"*",element:(0,s.jsx)(o.Navigate,{to:"user/language-selection",replace:!0})})]})})},".digit-home-main")},2161(e,t){"use strict";t.Y=function(e,t){return function(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),o=t[1],l=t[2],a=t[3]||"",s={};return s.inverse=!!o&&"not"===o.toLowerCase(),s.type=l?l.toLowerCase():"all",a=a.match(/\([^\)]+\)/g)||[],s.expressions=a.map(function(e){var t=e.match(r),n=t[1].toLowerCase().match(i);return{modifier:n[1],feature:n[2],value:t[2]}}),s})}(e).some(function(e){var n=e.inverse,r="all"===e.type||t.type===e.type;if(r&&n||!r&&!n)return!1;var i=e.expressions.every(function(e){var n=e.feature,r=e.modifier,i=e.value,o=t[n];if(!o)return!1;switch(n){case"orientation":case"scan":return o.toLowerCase()===i.toLowerCase();case"width":case"height":case"device-width":case"device-height":i=u(i),o=u(o);break;case"resolution":i=s(i),o=s(o);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":i=a(i),o=a(o);break;case"grid":case"color":case"color-index":case"monochrome":i=parseInt(i,10)||1,o=parseInt(o,10)||0}switch(r){case"min":return o>=i;case"max":return o<=i;default:return o===i}});return i&&!n||!i&&n})};var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,r=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,i=/^(?:(min|max)-)?(.+)/,o=/(em|rem|px|cm|mm|in|pt|pc)?$/,l=/(dpi|dpcm|dppx)?$/;function a(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function s(e){var t=parseFloat(e);switch(String(e).match(l)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function u(e){var t=parseFloat(e);switch(String(e).match(o)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},8320(e,t,n){"use strict";var r=n(2161).Y,i="undefined"!=typeof window?window.matchMedia:null;function o(e,t,n){var o,l=this;function a(e){l.matches=e.matches,l.media=e.media}i&&!n&&(o=i.call(window,e)),o?(this.matches=o.matches,this.media=o.media,o.addListener(a)):(this.matches=r(e,t),this.media=e),this.addListener=function(e){o&&o.addListener(e)},this.removeListener=function(e){o&&o.removeListener(e)},this.dispose=function(){o&&o.removeListener(a)}}e.exports=function(e,t,n){return new o(e,t,n)}},856(e,t,n){"use strict";var r=n(7183);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,l){if(l!==r){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:o,resetWarningCache:i};return n.PropTypes=n,n}},7598(e,t,n){e.exports=n(856)()},7183(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8854(e,t,n){"use strict";n.d(t,{Ay:()=>_});var r=n(4883),i=n(8320),o=n.n(i),l=/[A-Z]/g,a=/^ms-/,s={};function u(e){return"-"+e.toLowerCase()}const c=function(e){if(s.hasOwnProperty(e))return s[e];var t=e.replace(l,u);return s[e]=a.test(t)?"-"+t:t};var d=n(7598),v=n.n(d);const m=v().oneOfType([v().string,v().number]),f={all:v().bool,grid:v().bool,aural:v().bool,braille:v().bool,handheld:v().bool,print:v().bool,projection:v().bool,screen:v().bool,tty:v().bool,tv:v().bool,embossed:v().bool},p={orientation:v().oneOf(["portrait","landscape"]),scan:v().oneOf(["progressive","interlace"]),aspectRatio:v().string,deviceAspectRatio:v().string,height:m,deviceHeight:m,width:m,deviceWidth:m,color:v().bool,colorIndex:v().bool,monochrome:v().bool,resolution:m,type:Object.keys(f)},{type:g,...y}=p,h={minAspectRatio:v().string,maxAspectRatio:v().string,minDeviceAspectRatio:v().string,maxDeviceAspectRatio:v().string,minHeight:m,maxHeight:m,minDeviceHeight:m,maxDeviceHeight:m,minWidth:m,maxWidth:m,minDeviceWidth:m,maxDeviceWidth:m,minColor:v().number,maxColor:v().number,minColorIndex:v().number,maxColorIndex:v().number,minMonochrome:v().number,maxMonochrome:v().number,minResolution:m,maxResolution:m,...y};var b={all:{...f,...h},types:f,matchers:p,features:h};const O=(0,r.createContext)(void 0),x=e=>{if(e)return Object.keys(e).reduce((t,n)=>(t[c(n)]=e[n],t),{})},S=()=>{const e=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{e.current=!0},[]),e.current},w=e=>{const t=()=>(e=>e.query||(e=>{const t=[];return Object.keys(b.all).forEach(n=>{const r=e[n];null!=r&&t.push(((e,t)=>{const n=c(e);return"number"==typeof t&&(t=`${t}px`),!0===t?n:!1===t?`not ${n}`:`(${n}: ${t})`})(n,r))}),t.join(" and ")})(e))(e),[n,i]=(0,r.useState)(t);return(0,r.useEffect)(()=>{const e=t();n!==e&&i(e)},[e]),n},j=(e,t,n)=>{const i=(e=>{const t=(0,r.useContext)(O),n=()=>x(e)||x(t),[i,o]=(0,r.useState)(n);return(0,r.useEffect)(()=>{const e=n();(function(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(let r=0;r<i;r++){const i=n[r];if(e[i]!==t[i]||!Object.prototype.hasOwnProperty.call(t,i))return!1}return!0})(i,e)||o(e)},[e,t]),i})(t),l=w(e);if(!l)throw new Error("Invalid or missing MediaQuery!");const a=((e,t)=>{const n=()=>o()(e,t||{},!!t),[i,l]=(0,r.useState)(n),a=S();return(0,r.useEffect)(()=>{if(a){const e=n();return l(e),()=>{e&&e.dispose()}}},[e,t]),i})(l,i),s=(e=>{const[t,n]=(0,r.useState)(e.matches);return(0,r.useEffect)(()=>{const t=e=>{n(e.matches)};return e.addListener(t),n(e.matches),()=>{e.removeListener(t)}},[e]),t})(a),u=S();return(0,r.useEffect)(()=>{u&&n&&n(s)},[s]),(0,r.useEffect)(()=>()=>{a&&a.dispose()},[]),s},_=({children:e,device:t,onChange:n,...r})=>{const i=j(r,t,n);return"function"==typeof e?e(i):i?e:null}},3060(e,t){"use strict";var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(e,t,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==t.key&&(i=""+t.key),"key"in t)for(var o in r={},t)"key"!==o&&(r[o]=t[o]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:i,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=i,t.jsxs=i},6870(e,t,n){"use strict";e.exports=n(3060)},6243(t){"use strict";t.exports=e},5053(e){"use strict";e.exports=a},338(e){"use strict";e.exports=l},4456(e){"use strict";e.exports=r},4883(e){"use strict";e.exports=t},5953(e){"use strict";e.exports=n},2148(e){"use strict";e.exports=i},4442(e){"use strict";e.exports=o},1954(e){"use strict";e.exports=s},2247(e){"use strict";e.exports=u}},d={};function v(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}};return c[e](n,n.exports,v),n.exports}v.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return v.d(t,{a:t}),t},v.d=(e,t)=>{for(var n in t)v.o(t,n)&&!v.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},v.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),v.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var m={};return(()=>{"use strict";v.r(m),v.d(m,{DigitUI:()=>le,initCoreComponents:()=>se});var e=v(6243),t=v(4883),n=v.n(t),r=v(5953),i=v(4456),o=v(2148),l=v(4442),a=v(6870);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,7155)),()=>v(7155).default,{loaderText:"CORE_LOADING_CITIZEN_APP"}),f=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,296)),()=>v(296).default,{loaderText:"CORE_LOADING_EMPLOYEE_APP"}),p=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,8259)),()=>v(8259).default,{loaderText:"CORE_LOADING_SIGN_UP"}),g=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,1626)),()=>v(1626).default,{loaderText:"CORE_LOADING_OTP"}),y=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,3333)),()=>v(3333).default,{loaderText:"CORE_LOADING_VIEW_URL"}),h=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,883)),()=>v(883).default,{loaderText:"CORE_LOADING_ERROR_COMPONENT"}),b=(0,e.lazyWithFallback)(()=>Promise.resolve().then(v.bind(v,9546)),()=>v(9546).default,{loaderText:"CORE_LOADING"}),O=e=>{var t,n,r,i,o,s=e.stateCode,c=e.modules,v=e.appTenants,m=e.logoUrl,p=e.logoUrlWhite,g=e.initData,y=e.defaultLanding,h=void 0===y?"citizen":y,b=e.allowedUserTypes,O=void 0===b?["citizen","employee"]:b,x=((0,l.useNavigate)(),(0,l.useLocation)().pathname),S=window.innerWidth,w=Digit.ULBService.getCurrentUlb(),j=Digit.UserService.getUser(),_=(Digit.Hooks.useStore.getInitData().data||{}).stateInfo,C=Digit.UserService.hasAccess(["FSM_DSO"]),N="CITIZEN"===(null==j||null===(t=j.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(N=!1);var E={stateInfo:_,userDetails:j,CITIZEN:N,cityDetails:w,mobileView:S<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:m,logoUrlWhite:p,DSO:C,stateCode:s,modules:c,appTenants:v,sourceUrl:"".concat(window.location.origin,"/citizen"),pathname:x,initData:g};return(0,a.jsxs)(l.Routes,{children:[(null==O?void 0:O.includes("employee"))&&(0,a.jsx)(l.Route,{path:"/".concat(null===(n=window)||void 0===n?void 0:n.contextPath,"/employee/*"),element:(0,a.jsx)(f,u({},E))}),(null==O?void 0:O.includes("citizen"))&&(0,a.jsx)(l.Route,{path:"/".concat(null===(r=window)||void 0===r?void 0:r.contextPath,"/citizen/*"),element:(0,a.jsx)(d,u({},E))}),(null==O?void 0:O.includes("employee"))&&(0,a.jsx)(l.Route,{path:"/".concat(null===(i=window)||void 0===i?void 0:i.contextPath,"/no-top-bar/employee"),element:(0,a.jsx)(f,u(u({},E),{},{noTopBar:!0}))}),(0,a.jsx)(l.Route,{path:"*",element:(0,a.jsx)(l.Navigate,{to:"/".concat(null===(o=window)||void 0===o?void 0:o.contextPath,"/").concat(h)})})]})},x=e=>{var t,n,r,i,o,s,u,c,d,v,m=e.stateCode,f=e.modules,x=e.appTenants,S=e.logoUrl,w=e.logoUrlWhite,j=e.initData,_=e.defaultLanding,C=void 0===_?"citizen":_,N=e.allowedUserTypes,E=(Digit.Hooks.useStore.getInitData().data||{}).stateInfo,I=["user/error"].some(e=>{var t;return null===(t=location)||void 0===t||null===(t=t.pathname)||void 0===t?void 0:t.includes(e)}),A=Digit.UserService.getUser(),D="CITIZEN"===(null==A||null===(t=A.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee"),P=window.innerWidth<=640;return(0,a.jsx)("div",{className:I?"grounded-container":"loginContainer",style:I?{padding:0,paddingTop:D?"0":P&&!D?"3rem":"80px",marginLeft:D||P?"0":"40px"}:{"--banner-url":"url(".concat(null==E?void 0:E.bannerUrl,")"),padding:"0px"},children:(0,a.jsxs)(l.Routes,{children:[(0,a.jsx)(l.Route,{path:"/".concat(null===(n=window)||void 0===n?void 0:n.globalPath,"/user/invalid-url"),element:(0,a.jsx)(h,{})}),(0,a.jsx)(l.Route,{path:"/".concat(null===(r=window)||void 0===r?void 0:r.globalPath,"/user/sign-up"),element:(0,a.jsx)(p,{stateCode:m})}),(0,a.jsx)(l.Route,{path:"/".concat(null===(i=window)||void 0===i?void 0:i.globalPath,"/user/otp"),element:(0,a.jsx)(g,{})}),(0,a.jsx)(l.Route,{path:"/".concat(null===(o=window)||void 0===o?void 0:o.globalPath,"/user/setup"),element:(0,a.jsx)(b,{})}),(0,a.jsx)(l.Route,{path:"/".concat(null===(s=window)||void 0===s?void 0:s.globalPath,"/user/url"),element:(0,a.jsx)(y,{})}),(null===(u=window)||void 0===u?void 0:u.globalPath)!==(null===(c=window)||void 0===c?void 0:c.contextPath)&&(0,a.jsx)(l.Route,{path:"/".concat(null===(d=window)||void 0===d?void 0:d.contextPath,"/*"),element:(0,a.jsx)(O,{stateCode:m,modules:f,appTenants:x,logoUrl:S,logoUrlWhite:w,initData:j,defaultLanding:C,allowedUserTypes:N})}),(0,a.jsx)(l.Route,{path:"*",element:(0,a.jsx)(l.Navigate,{to:"/".concat(null===(v=window)||void 0===v?void 0:v.globalPath,"/user/sign-up")})})]})})},S=v(743),w=v(358),j=v(3015),_=v(4217),C=v(1954),N=v(2247);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach(function(t){A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=[v.n(N)()],L=(0,C.compose)((0,C.applyMiddleware)(...T));const R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,C.createStore)(((e,t)=>{return(0,C.combineReducers)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){P(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({common:(n=e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=arguments.length>1?arguments[1]:void 0;return"LANGUAGE_SELECT"===t.type?I(I({},e),{},{selectedLanguage:t.payload}):e})},t));var n})(e,t),L)};var M=v(5053),U=["onSelect","formData","control","formState"];function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return B(e,t);var n={}.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)?B(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const F=i=>{var o=i.onSelect,l=(i.formData,i.control,i.formState,function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(i,U)),s=(0,r.useTranslation)().t,u=Digit.ULBService.getCurrentTenantId(),c=k((0,t.useState)(!1),2),d=c[0],v=c[1],m=k((0,t.useState)(!1),2),f=m[0],p=m[1],g=Digit.Utils.getConfigModuleName(),y=Digit.Hooks.useCustomMDMS(u,g,[{name:"PrivacyPolicy"}],{select:e=>{var t;return null==e||null===(t=e[g])||void 0===t||null===(t=t.PrivacyPolicy)||void 0===t?void 0:t.find(e=>{var t;return e.module===(null==l||null===(t=l.props)||void 0===t?void 0:t.module)})}}).data;return(0,t.useEffect)(()=>{o("check",d)},[d]),(0,a.jsxs)(n().Fragment,{children:[(0,a.jsxs)("div",{className:"digit-privacy-checkbox digit-privacy-checkbox-align",children:[(0,a.jsx)(e.CheckBox,{label:s("ES_BY_CLICKING"),checked:d,onChange:e=>{v(e.target.checked)},id:"privacy-component-check"}),(0,a.jsx)(e.Button,{label:s("ES_PRIVACY_POLICY"),variation:"link",size:"small",onClick:()=>{p(!0)},style:{marginBottom:"1rem",paddingLeft:"0.2rem"}})]}),f&&(0,a.jsxs)(e.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:s(null==y?void 0:y.header),onOverlayClick:()=>{p(!1)},footerChildren:[(0,a.jsx)(e.Button,{type:"button",size:"large",variation:"secondary",label:s("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{v(!1),p(!1)}}),(0,a.jsx)(e.Button,{type:"button",size:"large",variation:"primary",label:s("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{v(!0),p(!1)}})],sortFooterChildren:!0,onClose:()=>{p(!1)},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"privacy-table",children:s("DIGIT_TABLE_OF_CONTENTS")}),(0,a.jsx)("ul",{children:null==y?void 0:y.contents.map((t,n)=>(0,a.jsxs)("li",{style:{display:"flex",alignItems:"center"},children:[(0,a.jsxs)("span",{style:{marginRight:"0.5rem"},children:[n+1,". "]}),(0,a.jsx)(e.Button,{label:s(t.header),variation:"link",size:"medium",onClick:e=>{var n,r;e.preventDefault(),n=null==t?void 0:t.header,(r=document.getElementById(n))&&r.scrollIntoView({behavior:"smooth"})},style:{justifyContent:"flex-start"}})]},n))})]}),null==y?void 0:y.contents.map((e,t)=>(0,a.jsxs)("div",{id:null==e?void 0:e.header,children:[(0,a.jsx)("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"},children:s(e.header)}),e.descriptions.map((e,t)=>(0,a.jsxs)("div",{style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"},children:[(0,a.jsxs)("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"},children:["points"===e.type&&(0,a.jsx)("span",{style:{marginRight:"0.5rem",listStyleType:"disc"},children:"•"}),"step"===e.type&&(0,a.jsxs)("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"},children:[t+1,". "]}),s(e.text)]}),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&(0,a.jsx)("div",{className:"policy-subdescription",children:e.subDescriptions.map((e,t)=>(0,a.jsxs)("div",{className:"policy-subdescription-points",children:["points"===e.type&&(0,a.jsx)("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"},children:"•"}),"step"===e.type&&(0,a.jsxs)("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"},children:[t+1,". "]}),null===e.type&&(0,a.jsx)("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"},children:" "}),s(e.text)]},t))})]},t))]},t))]})]})};var V=v(4989),G=(v(5697),["onSelect","formData","control","formState"]);function z(e,t,n,r,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,i)}function W(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){z(o,r,i,l,a,"next",e)}function a(e){z(o,r,i,l,a,"throw",e)}l(void 0)})}}function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach(function(t){X(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function X(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Z(e,t);var n={}.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)?Z(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Y=["onSelect","formData","control","formState"];function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const $=t=>{var n=t.t,r=(t.props||{}).ssoConfigs,i=void 0===r?[]:r;if(null==i||!i.length)return null;var o=i.length>1;return(0,a.jsxs)("div",{className:"employee-login-sso",children:[(0,a.jsx)("div",{className:"employee-login-sso-divider",children:(0,a.jsx)("span",{children:n(o?"CORE_COMMON_OR_SIGN_IN_WITH":"CORE_COMMON_OR")})}),o?(0,a.jsx)("div",{className:"employee-login-sso-icons",children:i.map((t,r)=>{var i;return(0,a.jsx)(e.Button,{label:"",variation:"secondary",size:"large",icon:t.icon,className:"employee-login-sso-icon ".concat((null===(i=t.provider)||void 0===i?void 0:i.toLowerCase())||"provider","-login-icon"),onClick:()=>{var e;return null===(e=t.onLogin)||void 0===e?void 0:e.call(t,t)},title:n(t.label),ariaLabel:n(t.label),style:{width:"100%"}},t.id||t.provider||r)})}):i.map((t,r)=>{var i;return(0,a.jsx)(e.Button,{label:n(t.label),variation:"primary",size:"large",icon:t.icon,className:"employee-login-sso-button ".concat((null===(i=t.provider)||void 0===i?void 0:i.toLowerCase())||"provider","-login-btn"),onClick:()=>{var e;return null===(e=t.onLogin)||void 0===e?void 0:e.call(t,t)},style:{width:"100%"}},t.id||t.provider||r)})]})};function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(n),!0).forEach(function(t){ne(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ne(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ie(e,t);var n={}.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)?ie(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var oe=t=>{var n,i,s,u=t.stateCode,c=t.enabledModules,d=t.defaultLanding,v=t.allowedUserTypes,m=Digit.Hooks.useInitStore(u,c),f=m.isLoading,p=m.data,g=void 0===p?{}:p;if(f)return(0,a.jsx)(e.Loader,{page:!0,variant:"PageLoader"});var y=R(g)||{};return(0,r.getI18n)(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",F),Digit.ComponentRegistryService.getComponent("EmployeeSSOLoginOptions")||Digit.ComponentRegistryService.setComponent("EmployeeSSOLoginOptions",$),(0,a.jsx)(o.Provider,{store:y,children:(0,a.jsx)(l.BrowserRouter,{children:(0,a.jsx)(e.BodyContainer,{children:Digit.Utils.getMultiRootTenant()?(0,a.jsx)(x,{initData:g,stateCode:u,modules:null==g?void 0:g.modules,appTenants:g.tenants,logoUrl:null==g||null===(n=g.stateInfo)||void 0===n?void 0:n.logoUrl,logoUrlWhite:null==g||null===(i=g.stateInfo)||void 0===i?void 0:i.logoUrlWhite,defaultLanding:d,allowedUserTypes:v}):(0,a.jsx)(O,{initData:g,stateCode:u,modules:null==g?void 0:g.modules,appTenants:g.tenants,logoUrl:null==g||null===(s=g.stateInfo)||void 0===s?void 0:s.logoUrl,defaultLanding:d,allowedUserTypes:v})})})})},le=e=>{var n=e.stateCode,r=e.registry,o=e.enabledModules,l=e.defaultLanding,s=e.allowedUserTypes,u=(0,t.useMemo)(()=>Digit.Utils.getPrivacyObject()||{},[]),c=re((0,t.useState)(u),2),d=c[0],v=c[1],m=(Digit.UserService.getType(),(0,t.useMemo)(()=>new i.QueryClient({defaultOptions:{queries:{staleTime:9e5,gcTime:3e6,retry:!1,retryDelay:e=>1/0}}}),[])),f=Digit.Contexts.ComponentProvider,p=Digit.Contexts.PrivacyProvider,g=(Digit.UserService.hasAccess(["FSM_DSO"]),(0,t.useCallback)(e=>{Digit.Utils.setPrivacyObject({}),v({})},[])),y=(0,t.useCallback)(()=>{var e=Digit.Utils.getPrivacyObject();return v(e),e},[]),h=(0,t.useCallback)(e=>{var t=Digit.Utils.getAllPrivacyObject(),n="undefined"!=typeof window?window.location.pathname:"",r=te(te({},t),{},{[n]:e});Digit.Utils.setPrivacyObject(te({},r)),v((null==t?void 0:t[n])||{})},[]),b=(0,t.useCallback)((e,t)=>{v(Digit.Utils.updatePrivacy(e,t)||{})},[]),O=(0,t.useMemo)(()=>({privacy:"undefined"!=typeof window?null==d?void 0:d[window.location.pathname]:d,resetPrivacy:g,getPrivacy:y,updatePrivacyDescoped:h,updatePrivacy:b}),[d,g,y,h,b]);return(0,a.jsx)("div",{children:(0,a.jsx)(_.A,{children:(0,a.jsx)(i.QueryClientProvider,{client:m,children:(0,a.jsx)(f.Provider,{value:r,children:(0,a.jsx)(p.Provider,{value:O,children:(0,a.jsx)(oe,{stateCode:n,enabledModules:o,defaultLanding:l,allowedUserTypes:s})})})})})})},ae={SelectOtp:S.A,ChangeCity:w.A,ChangeLanguage:j.A,PrivacyComponent:F,OtpComponent:n=>{var i,o,s=n.onSelect,u=(n.formData,n.control,n.formState,function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,G)),c=(0,r.useTranslation)().t,d=((0,l.useLocation)(),Q((0,t.useState)(null),2)),v=d[0],m=d[1],f=Q((0,t.useState)({}),2),p=f[0],g=f[1],y=Q((0,t.useState)(!0),2),h=y[0],b=(y[1],Q((0,t.useState)(30),2)),O=b[0],x=b[1],S=()=>{m(null)};(0,V.A)(()=>{x(O-1)},O>0?1e3:null),(0,t.useEffect)(()=>{s("OtpComponent",p)},[p]);var w={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(i=u.props)||void 0===i?void 0:i.code},body:{},config:{enable:!1}},j=Digit.Hooks.useCustomAPIMutationHook(w),_=function(){var e=W(function*(){var e,t,n;x(30),yield j.mutate({body:{otp:{userName:null==u||null===(e=u.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==u||null===(t=u.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,r;m({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&null!==(n=n.Errors)&&void 0!==n&&n[0].code?"SANDBOX_RESEND_OTP".concat(null==e||null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.Errors)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(S,5e3)},onSuccess:(n=W(function*(e){m({key:"info",label:c("OTP_RESNED_SUCCESFULL")}),setTimeout(S,5e3)}),function(e){return n.apply(this,arguments)})})});return function(){return e.apply(this,arguments)}}();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(e.CardLabel,{className:"sandbox-custom-otp-subheader",children:c("SANDBOX_ENTER_OTP")}),(0,a.jsx)(e.CardLabel,{className:"sandbox-custom-otp-header",children:c("CS_OTP_EMAIL")}),(0,a.jsx)(e.CardLabel,{className:"sandbox-custom-otp-email",style:{fontWeight:"bold"},children:null==u||null===(o=u.props)||void 0===o?void 0:o.email}),(0,a.jsx)(M.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{g(q(q({},p),{},{otp:e}))},value:null==p?void 0:p.otp}),O>0?(0,a.jsx)(e.CardText,{className:"sandbox-resend-otp",children:"".concat(c("CS_RESEND_ANOTHER_OTP")," ").concat(O," ").concat(c("CS_RESEND_SECONDS"))}):(0,a.jsx)("p",{className:"card-text-button sandbox-otp-input",onClick:_,children:c("CS_RESEND_OTP")}),!h&&(0,a.jsx)(e.CardLabelError,{children:c("CS_INVALID_OTP")}),v&&(0,a.jsx)(e.Toast,{type:null==v?void 0:v.key,label:c(null==v?void 0:v.label),onClose:S})]})},ForgotOrganizationTooltip:n=>{n.onSelect;var i,o,l=(0,r.useTranslation)().t,s=(i=(0,t.useState)(!1),o=2,function(e){if(Array.isArray(e))return e}(i)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(i,o)||function(e,t){if(e){if("string"==typeof e)return J(e,t);var n={}.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)?J(e,t):void 0}}(i,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],c=s[1],d=(0,t.useRef)(null);return(0,t.useEffect)(()=>{var e=e=>{d.current&&!d.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,a.jsxs)("div",{ref:d,className:"loginSignUpSelector",style:{position:"relative",marginTop:"-2rem"},children:[(0,a.jsx)(e.Button,{label:l("SB_FORGOTORGANIZATION_TOOLTIP"),variation:"link",size:"small",onClick:()=>c(e=>!e),style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}),u&&(0,a.jsx)("div",{style:{position:"absolute",bottom:"100%",left:"50%",transform:"translateY(-4px)",backgroundColor:"#0b4b66",color:"white",padding:"6px 10px",borderRadius:"4px",whiteSpace:"normal",wordBreak:"break-word",maxWidth:"20rem",zIndex:1e3,fontSize:"0.875rem"},children:l("SB_FORGOTORGANIZATION_TOOLTIP_TEXT")})]})},LoginSignupSelector:i=>{var o,l,s=i.onSelect,u=(i.formData,i.control,i.formState,function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}}(i,Y),(0,r.useTranslation)().t),c=(o=(0,t.useState)(!0),l=2,function(e){if(Array.isArray(e))return e}(o)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,l,a=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return a}}(o,l)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var n={}.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)?K(e,t):void 0}}(o,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=c[0];c[1],(0,t.useEffect)(()=>{s("check",d)},[d]);var v=window.location.href.includes("sandbox-ui/user/sign-up");return(0,a.jsx)(n().Fragment,{children:(0,a.jsx)("div",{className:"loginSignUpSelector",style:{marginTop:"-2rem"},children:v?(0,a.jsx)(e.Button,{label:u("SB_ALREADY_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/user/login"))},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}):(0,a.jsx)(e.Button,{label:u("SB_DONT_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace("/".concat(null===(e=window)||void 0===e?void 0:e.contextPath,"/user/sign-up"))},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}})})})},EmployeeSSOLoginOptions:$},se=()=>{Object.entries(ae).forEach(e=>{var t=re(e,2),n=t[0],r=t[1];Digit.ComponentRegistryService.setComponent(n,r)})}})(),m})());