{"version":3,"mappings":"gGAAA,MAAeA,EAAA,CACb,QAAS,8BACT,cAAe,mCACjB,k9MCMaC,GAAkB,CAC7BC,EACAC,IAC0E,CAC1E,GAAID,IAAgBF,EAAS,eAAiBG,IAAaC,EAAgB,UAClE,OAAAC,EAGT,GAAIH,IAAgBF,EAAS,SAAWG,IAAaC,EAAgB,UAC5D,OAAAE,EAEX,EAEaC,GAAe,MAA+BL,EAAqBC,IAA0C,CAClH,MAAAK,EAAYP,GAAgBC,EAAaC,CAAQ,EAEvD,GAAIK,EACK,eAAQ,QAAQA,CAAyB,EAG9C,IAGF,OAFkC,MAAMC,GAAA,oEAAAC,EAAA,6IAAAA,EAAA,+BAAAC,EAAA,+EAAAD,EAAA,4RAAAA,EAAA,uIAAAA,EAAA,iIAAAA,EAAA,+BAAAE,EAAA,yEAAAF,EAAA,gGAAAR,EAAA,YAAAC,EAAA,aAEvB,cACVU,EAAO,CACR,UAAI,MAAM,gCAAgC,OAAAX,EAAW,QAAO,OAAAC,EAAQ,MAAK,OAAAU,EAAO,EAE1F","names":["Projects","getResourceItem","projectName","language","LanguageLocales","appResources","defaultResources","getResources","resources","__variableDynamicImportRuntimeHelper","__vitePreload","HN_CoreFrontend_Web_AppInvitation_nbNO","HN_CoreFrontend_Web_Forside_nbNO","error"],"ignoreList":[],"sources":["../../../src/constants/projects.ts","../../../src/resources/index.ts"],"sourcesContent":["export default {\n Forside: 'HN.CoreFrontend.Web.Forside',\n AppInvitation: 'HN.CoreFrontend.Web.AppInvitation',\n};\n","import { HNCoreFrontendWebAppInvitation, HNCoreFrontendWebForside } from '../types/Resources';\n\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { getModifiedResourcesForTest, ResourceItem } from '@helsenorge/framework-utils/resources';\n\nimport appResources from './HN.CoreFrontend.Web.AppInvitation.nb-NO.json';\nimport defaultResources from './HN.CoreFrontend.Web.Forside.nb-NO.json';\nimport Projects from '../constants/projects';\n\nexport const getResourceItem = (\n projectName: string,\n language: LanguageLocales\n): HNCoreFrontendWebAppInvitation | HNCoreFrontendWebForside | undefined => {\n if (projectName === Projects.AppInvitation && language === LanguageLocales.NORWEGIAN) {\n return appResources satisfies HNCoreFrontendWebAppInvitation;\n }\n\n if (projectName === Projects.Forside && language === LanguageLocales.NORWEGIAN) {\n return defaultResources satisfies HNCoreFrontendWebForside;\n }\n};\n\nexport const getResources = async (projectName: string, language: LanguageLocales): Promise => {\n const resources = getResourceItem(projectName, language);\n\n if (resources) {\n return Promise.resolve(resources as unknown as T);\n }\n\n try {\n const resources: { default: T } = await import(`./${projectName}.${language}.json`);\n\n return resources.default;\n } catch (error) {\n throw new Error(`Failed to load resources for ${projectName} in ${language}: ${error}`);\n }\n};\n\nexport const getResourcesTestHelper = () => getModifiedResourcesForTest(defaultResources);\n"],"file":"static/js/index.FCTx6o6j.js"}