{"version":3,"file":"static/chunks/pages/index-c757c81fddfb5aa4.js","mappings":"kJAEMA,EAAS,CACbC,MAAO,CACLC,QAAS,CACPC,UAAW,uBACXC,gBAAiB,0CACnB,EACAC,WAAY,CACVF,UAAW,gCACXC,gBACE,4DACJ,EACAE,QAAS,CACPH,UAAW,gBACXC,gBACE,yDACJ,CACF,EACAG,YAAa,CAEXC,aAAc,CACZL,UAAW,2CACXC,gBAAiB,sDACnB,EACAK,SAAU,CACRN,UAAW,sCACXC,gBAAiB,sDACnB,EACAM,SAAU,CACRP,UAAW,sCACXC,gBAAiB,sDACnB,EACAO,eAAgB,CACdR,UAAW,6CACXC,gBAAiB,sDACnB,EACAE,QAAS,CACPH,UAAW,qCACXC,gBAAiB,4CACnB,CACF,EACAQ,YAAa,CACXJ,aAAc,CACZL,UAAW,2CACXC,gBAAiB,sDACnB,EACAK,SAAU,CACRN,UAAW,sCACXC,gBAAiB,sDACnB,EACAM,SAAU,CACRP,UAAW,sCACXC,gBAAiB,sDACnB,EACAO,eAAgB,CACdR,UAAW,6CACXC,gBAAiB,sDACnB,EACAE,QAAS,CACPH,UAAW,qCACXC,gBAAiB,4CACnB,CACF,EACAS,aAAc,CACZX,QAAS,CACPC,UAAW,4BACXC,gBACE,8DACFU,QAAO,GAAAC,MAAA,CAAKC,yDAA0CD,MAAA,CAAGE,EAAAA,EAAe,CAACC,KAAK,CAChF,CACF,EACAC,cAAe,CACbjB,QAAS,CACPC,UAAW,6BACXC,gBACE,+DACFU,QAAO,GAAAC,MAAA,CAAKC,yDAA0CD,MAAA,CAAGE,EAAAA,EAAe,CAACC,KAAK,CAChF,CACF,EACAE,UAAW,CACTC,MAAO,CACLlB,UAAW,sCACXC,gBACE,4DACJ,EACAkB,cAAe,CACbC,gBAAiB,mBACjBC,eAAgB,kBAChBC,qBAAsB,uBACxB,CACF,EACAC,UAAW,CACTC,WAAY,CACVxB,UAAW,aACXC,gBAAiB,gCACnB,CACF,EACAwB,OAAQ,CAENC,YAAa,8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AAA,EACR,CAEA,OAAA4B,EAAAwC,CAAA,CAAAxC,EAAA,CAAAwC,EACA,EAMA3E,OAAA,SAAAmC,CAAA,CAAAyB,CAAA,EACA9G,EACAqF,EACA,GACAc,EAAA,GAAmBW,EAAA,CACnB5G,QAAA,EACA,GAEA,EACAiI,eAAA,SAAArB,CAAA,EACA,OAAAJ,EAAA,KAAAC,SAAA,CAAAR,EAAA,GAA6C,KAAAW,UAAA,CAAAA,GAC7C,EACAsB,cAAA,SAAAzB,CAAA,EACA,OAAAD,EAAAP,EAAA,GAA6B,KAAAQ,SAAA,CAAAA,GAAA,KAAAG,UAAA,CAC7B,CACA,EACA,CACAA,WAAA,CAAoBD,MAAAa,OAAAW,MAAA,CAAAzB,EAAA,EACpBD,UAAA,CAAmBE,MAAAa,OAAAW,MAAA,CAAA1B,EAAA,CACnB,EAEA,EAlHA,CACAuB,KAAA,SAAArB,CAAA,EAIA,MAHA,MAAAA,CAAA,KACAA,CAAAA,EAAAA,EAAAkB,KAAA,QAEAlB,EAAAM,OAAA,oBAAsClE,mBACtC,EACAwE,MAAA,SAAAZ,CAAA,EACA,OAAA5G,mBAAA4G,GAAAM,OAAA,CACA,2CACAlE,mBAEA,CACA,EAuGA,CAAmC9C,KAAA","sources":["webpack://_N_E/./data/constants/labels.js","webpack://_N_E/./pages/index.js","webpack://_N_E/","webpack://_N_E/./node_modules/js-cookie/dist/js.cookie.mjs"],"sourcesContent":["import { BlobAssestsKeys } from \"./keys\";\n\nconst labels = {\n Quote: {\n Landing: {\n PageTitle: \"Homeowners - Landing\",\n PageDescription: \"Page captures details about the Address.\",\n },\n QuickQuote: {\n PageTitle: \"Homeowners - Quote Indication\",\n PageDescription:\n \"Page captures details about applicant and basic coverages.\",\n },\n Summary: {\n PageTitle: \"Quote Summary\",\n PageDescription:\n \"Page shows details about applicant and basic coverages.\",\n },\n },\n Application: {\n // discuss\n PolicyHolder: {\n PageTitle: \"Homeowners - Application - Policy Holder\",\n PageDescription: \"Page captures and validates risks for qualification.\",\n },\n Coverage: {\n PageTitle: \"Homeowners - Application - Coverage\",\n PageDescription: \"Page captures and validates risks for qualification.\",\n },\n Property: {\n PageTitle: \"Homeowners - Application - Property\",\n PageDescription: \"Page captures and validates risks for qualification.\",\n },\n RiskQualifiers: {\n PageTitle: \"Homeowners - Application - Risk Qualifiers\",\n PageDescription: \"Page captures and validates risks for qualification.\",\n },\n Summary: {\n PageTitle: \"Homeowners - Application - Summary\",\n PageDescription: \"Page displays information captures so far.\",\n },\n },\n Endorsement: {\n PolicyHolder: {\n PageTitle: \"Homeowners - Endorsement - Policy Holder\",\n PageDescription: \"Page captures and validates risks for qualification.\",\n },\n Coverage: {\n PageTitle: \"Homeowners - Endorsement - Coverage\",\n PageDescription: \"Page captures and validates risks for qualification.\",\n },\n Property: {\n PageTitle: \"Homeowners - Endorsement - Property\",\n PageDescription: \"Page captures and validates risks for qualification.\",\n },\n RiskQualifiers: {\n PageTitle: \"Homeowners - Endorsement - Risk Qualifiers\",\n PageDescription: \"Page captures and validates risks for qualification.\",\n },\n Summary: {\n PageTitle: \"Homeowners - Endorsement - Summary\",\n PageDescription: \"Page displays information captures so far.\",\n },\n },\n Cancellation: {\n Landing: {\n PageTitle: \"Homeowners - Cancellation\",\n PageDescription:\n \"Page captures details about cancellation of an application.\",\n favicon: `${process.env.NEXT_PUBLIC_BLOB_WEB_FILE_PATH}${BlobAssestsKeys.Login}`,\n },\n },\n Reinstatement: {\n Landing: {\n PageTitle: \"Homeowners - Reinstatement\",\n PageDescription:\n \"Page captures details about reinstatement of an application.\",\n favicon: `${process.env.NEXT_PUBLIC_BLOB_WEB_FILE_PATH}${BlobAssestsKeys.Login}`,\n },\n },\n Analytics: {\n Index: {\n PageTitle: \"Commercial Auto - Analytics Landing\",\n PageDescription:\n \"Page displays in depth analytics across various segments..\",\n },\n AnalyticsTabs: {\n PolicyAnalytics: \"Policy Analytics\",\n QuoteAnalytics: \"Quote Analytics\",\n UnderwriterAnalytics: \"Underwriter Analytics\",\n },\n },\n Dashboard: {\n AccountHub: {\n PageTitle: \"AccountHub\",\n PageDescription: \"Page displays list of policies\",\n },\n },\n Shared: {\n // ReviewForUW: \"Risk will be submitted to Underwriter for further review and your Underwriter will contact you shortly. Do you want to proceed ?\",\n ReviewForUW: \"UNDERWRITING RULES VIOLATED\",\n MatchingRules: \"Matching rules\",\n Login: {\n PageTitle: `Cogitate || Login`,\n PageDescription: \"Application login page.\",\n },\n },\n MyCommunicationHub: {\n MyCommunicationHub: {\n PageTitle: \"My Communication Hub\",\n PageDescription: \"Page displays various threads of the Logged in user.\",\n },\n },\n Renewal: {\n BusinessInfo: {\n PageTitle: \"Commercial Auto - Business Information\",\n PageDescription: \"Page captures basic information about business.\",\n },\n BusinessLocation: {\n PageTitle: \"Commercial Auto - Business Locations\",\n PageDescription:\n \"Page captures basic information about business locations.\",\n },\n Summary: {\n PageTitle: \"Commercial Auto - Application Summary\",\n PageDescription: \"Page displays information captures so far.\",\n },\n },\n};\n\nexport { labels };\n","import Head from \"next/head\";\nimport { useRouter } from \"next/router\";\nimport { useState } from \"react\";\nimport { toast } from \"react-toastify\";\nimport { routeKeys, buttonRouteKeys, BlobAssestsKeys, commonKeys, tabKeys} from \"ui/data/constants/keys\";\nimport { storeKeys, flowKeys, PolicyLogHeader } from \"ui/data/constants/keys\";\nimport { labels } from \"ui/data/constants/labels\";\nimport { alertMsgs } from \"ui/data/constants/messages\";\nimport { fetchQueriesAndFragements, setPolicy, setData } from \"@cogitate/ui-utils-core-test\";\nimport { AuthProvider } from '@cogitate/diep2-components-core';\nimport { fetchActionConfig, fetchRoleAuthorization, fetchUISchema, fetchvalidation } from \"@cogitate/ui-utils-core-test/dist/utilities/shared/schemafromblob\";\nimport { getInitialState } from \"ui/components/initialData.js\";\nimport { staticItems } from \"ui/data/constants/static\";\nimport { loadMastersByContainer } from \"@cogitate/ui-utils-core-test/dist/utilities/shared/masters\";\nimport { fetchDDMAgentUserInformationDetails, fetchDDMUWUserInformationDetails, LoadPolicyByQuoteNumberAndVersion } from \"ui/utilities/helper\";\nimport { getStoreState, setStoreState } from \"@cogitate/ui-utils-core-test/dist/utilities/pages/shared\";\nimport { getLoginUserName, getLoginUserRole } from \"ui/redux/actions/modal/common/shared\";\nimport Cookies from 'js-cookie';\nimport { LoadDetails } from \"@cogitate/ui-utils-core-test/dist/utilities/pages/dashboard\";\n\nexport default function Login() {\n const router = useRouter();\n const [loggedInUser, setLoggendInUser] = useState(getStoreState(storeKeys.LoggedInUserReducer));\n\n const jsonString = JSON.stringify(router.query);\n if(!(jsonString == '{}'|| jsonString.includes(\"token\") || jsonString.includes(\"logout\"))){\n Cookies.set('queryParams', encodeURIComponent(jsonString), { expires: 1, path: '/' });\n }\n\n const afterUserValidate = async () => {\n try {\n \n await setData({ buttonRouteKeys, routeKeys, staticItems , PolicyLogHeader });\n await loadMastersByContainer();\n await setPolicy(getInitialState());\n await fetchQueriesAndFragements();\n await fetchRoleAuthorization();\n await fetchActionConfig();\n await fetchvalidation();\n await fetchUISchema(\n process.env.NEXT_PUBLIC_CLIENT,\n process.env.NEXT_PUBLIC_DEFAULT_LINE,\n process.env.NEXT_PUBLIC_LINE_OF_BUSINESS,\n process.env.NEXT_PUBLIC_DEFAULT_STATE.toLowerCase(),\n process.env.NEXT_PUBLIC_DEFAULT_CARRIER.toLowerCase(),\n [\n flowKeys.Quote.toLowerCase(),\n flowKeys.Application.toLowerCase(),\n flowKeys.Endorsement.toLowerCase(),\n flowKeys.Modals.toLowerCase(),\n flowKeys.AccountHub.toLowerCase(),\n ],\n process.env.NEXT_PUBLIC_DEFAULT_VERSION.toLowerCase()\n );\n \n setStoreState(storeKeys.VersionReducer, {});\n const currentLoginUserName = getLoginUserName();\n const currentLoginUserRole = getLoginUserRole(false)\n const dataReducer = getStoreState(storeKeys.DataReducer)\n if (currentLoginUserRole.toLowerCase() === commonKeys.RoleAgent.toLowerCase()) {\n await fetchDDMAgentUserInformationDetails(currentLoginUserName, dataReducer, currentLoginUserRole); \n }\n await fetchDDMUWUserInformationDetails();\n const cookieValue = Cookies.get('queryParams');\n let route = routeKeys.DashboardAccountHub;\n if(cookieValue){\n const input = JSON.parse(decodeURIComponent(cookieValue));\n Cookies.remove('queryParams', { path: '/' });\n const resp = await LoadPolicyByQuoteNumberAndVersion(input);\n if(resp){\n await LoadDetails([resp], \"view\");\n if(resp.PolicyNumber == ''){\n const masterQuoteNumber = resp.ExternalRefrences.find(e=>e.ReferenceTarget == \"Master_Policy_Ref\")\n let MasterPolicy = await LoadPolicyByQuoteNumberAndVersion({QuoteNumber:masterQuoteNumber});\n if(MasterPolicy){\n setStoreState(storeKeys.VersionReducer, MasterPolicy);\n }\n }\n route = routeKeys.ValidateDocuments;\n }\n }\n if(route == routeKeys.DashboardAccountHub){\n const policyData = getInitialState();\n setStoreState(storeKeys.PolicyReducer, policyData);\n }\n \n router.push(route.toLowerCase()); //change\n } catch (error) {\n Cookies.remove('queryParams', { path: '/' });\n }\n }\n\n const onSuccess = async (userObj, resolvedurl, error) => {\n setStoreState(storeKeys.LoggedInUserReducer, userObj);\n if (!error) {\n await afterUserValidate();\n } else {\n toast.error(alertMsgs.Login.LoginFailed);\n router.push(routeKeys.Root);\n }\n }\n\n return (\n <>\n
\n