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+Z,EAAiB,qBAAsBE,EAAsB,wBAAyBD,EAAyB,uBAAwBE,EAAwB,gBAAiB0Y,EAAsB,aAAc/vB,EAAc,cAAeP,EAAe,4BAA6B,CAACmwB,EAAe,SAAU,CAACj2B,MAAK+1B,GAAe,CAAE,QAASI,CAAwB,GAAGj0B,EAAM,SAAU,CAAC+zB,GAAiBj2B,MAAKu2B,GAAa,CAAE,aAAclwB,EAAc,cAAeP,EAAe,SAAUhU,CAAQ,CAAE,CAAC,EAAG,CACz8B,EACe0kC,GAAAtG,GAAkB8F,EAAQ","names":["pushToDataLayer","payload","trackSearch","phrase","type","resultsCount","trackTool","name","labels","action","trackProsesshjelp","trackPageview","hasContent","trackError","level","details","trackNavigation","label","pageSection","track404","trackLanguage","language","isAuthorized","_b","_a","LOGGED_IN_COOKIE_NAME","SESSION_ID_COOKIE_NAME","hasCookie","cookieName","value","cookie","e","getSuffix","suffix","hasCookieWithSuffix","hasLoggedInCookie","getCookieValue","cookieWithSuffix","getHostnameWithoutSubdomain","IdentityProvider","parseParams","params","queryString","key","x","createBaseHeaders","checkStatus","response","contentType","correlationId","getCorrelationIdFromResponse","error","HelsenorgeHttpError","decycle","object","objects","paths","derez","path","nu","LogLevel","unwrapError","potentialError","HelsenorgeProxyError","innerError","generateEntry","message","optionalParams","fullMessage","previous","current","postLogEntry","logEntry","getTjenesterUrl","logToServer","logLevel","getServerLogLevel","exportFunctions","debug","allowConsoleOutput","info","trace","warn","assert","test","clear","count","countTitle","dir","dirxml","group","groupTitle","groupCollapsed","groupEnd","log","profile","reportName","profileEnd","table","data","time","timerName","timeEnd","isProxyErrorResponse","isPascalCaseProxyErrorResponse","mapPascalCaseErrorToCamelCase","saveCorrelationId","getCorrelationIdList","statusCode","_c","getTjenesterApiUrl","proxyName","endpoint","apiUrl","getRequestHeaders","headers","createHeaders","getHelsenorgeUrl","createQueryString","handleError","baseCrud","method","baseUrl","requestBody","get","endPoint","LanguageLocales","decapitalize","s","DateFormat","loadLocale","setDefaultOptions","nb","nn","enGB","se","safeParseJSON","date","_date","parseJSONDF","toCentralEuropeanTime","cetDate","formatCET","formatStr","options","formatDF","safeFormatCET","__cookieOptions__","getCookieDomainAndPath","setSharedCookie","maxAgeInDays","maxAgeInSeconds","HeaderFooterEvents","CmsBlocksEvents","CommonEvents","WebComponents","StepEvents","SamtykkeType","SamtykkeLevel","FullmaktType","SamtykkeStatusType","RepresentasjonforholdType","StatusKodeType","SessionTimeoutAction","PersonverninnstillingKategori","TjenesteTilgangStatus","Personverninnstilling","CmsContentApiVersions","getVisPersonvelger","getErRepresentasjon","setAllowNavigation","getHarAktivtForeldreSamtykke","getPersonverninnstillinger","hasPersonverninnstilling","guid","useEffect","dispatchCustomEvent","selector","eventType","detail","element","HNeventShowAppInvitation","onAppOpen","onWebLogin","onClose","HNeventSetRedirectTo","redirectTo","HNeventSetRedirectToUrlAfterLogin","redirectToUrlAfterLogin","HNeventSetHiddenPromopanel","isHidden","HNaddEventListener","event","handler","passive","LANGUAGE_COOKIE_NAME","LANGUAGE_COOKIE_EXPIRES_IN_DAYS","getUserLanguage","setUserLanguage","useSetUserLanguageEvent","callback","getIsoLanguageName","setDocumentLanguage","isoLanguage","selectCurrentLanguage","state","selectLanguages","languageChanged","createAction","allowedLanguagesReplaced","safeLoadLocale","createLanguageReducer","allowedLanguages","userLanguage","initialCurrentLanguage","initialState","createReducer","builder","_defaultLanguageReducer","getDefaultLanguageReducer","defaultLanguageReducer","_","prop","isDebug","getResourceKey","project","getResourcesFromState","getResourceWithId","json","getModifiedResourcesForTest","resourceText","shouldFetchResources","resource","fetchResources","createAsyncThunk","getResources","rejectWithValue","getState","resourcesSlice","createSlice","resources$2","useResources","dispatch","useDispatch","resources","useSelector","SideSomIkkeFinnesSvg","_jsx","_jsxs","__glob","map","fn","globImport_json","__vitePreload","Projects","getResourceItem","projectName","frameworkNbNo","contentNbNo","PageNotFound","forsideUrl","Title","styles","Button","Loader","getPath","getAssetsUrl","getSidetittelId","isCustomElementRegistered","isTemplateRenderedServerSide","templateElement","createMicrowebTemplate","templateName","isWebpackAssetsJson","getHelsenorgeCssUrl","elementList","linkElement","blockUntilEvent","target","resolve","fetchWebComp","props","domain","entryName","componentName","includeHelsenorgeCss","microwebTemplate","assetsUrl","assets","appendStylesheet","href","cssElement","appendScript","src","scriptElement","helsenorgeCssUrl","asset","_d","React","WebCompConsumer","webCompFromMicroFrontend","envSafeUrl","url","getFeatureToggle","featureName","getFeatureToggles","_e","DOMPurify","TRUSTED_TYPES_FEATURE_NAME","hasDefaultTrustedTypesPolicy","isTrustedTypesEnabled","DefaultSanitizeConfig","sanitize","html","parseHtml","SafeHTML","tagName","testId","className","rest","parsedHtml","CustomTag","classNames","designsystemtypography","Markdown","AnchorLink","List","getContentApiUrl","getContentApiPreviewUrl","enableContentApiPreview","version","preview","hostName","credentials","languageCode","restParams","post","patch","selectCmsTjenesteTekster","getTjenesteTeksterKey","selectCmsTjenesteTekstForHjelpetekstId","hjelpetekstId","t","_h","_g","_f","selectFeedbackResources","getCanShowHjelpetekstInPageHeader","tjenesteNavn","spesifikkHjelpeTekst","tjenesteTekster","shouldFetchTjenesteTekster","cmsTjenesteTekster","fetchTjenesteTekster","cmsTjenesteTeksterSlice","aria","domEl","siblings","i","sibling","child","keyCode","getEventTarget","getDocumentActiveElement","logCallback","domNode","root","TrapFocus","isTriggerWithinTrappedArea","activeElement","tabbable","itemWithFocus","currentFocusIndex","previousElement","previousFocusIndex","nextElement","nextFocusIndex","item","radioGrouItems","selectedItems","EkspanderendeTekstBlock","title","mainContent","Expander","PortableText","EkspanderendeBlock","EkspanderendeBlockComponent","PromoBlockType","PromoBlockColors","ImageType","WindowActionEnum","Size","VideoType","CardsPerRow","VideoTheme","Image","imageUrl","caption","copyright","size","alternativeText","figureClass","imageClass","captionClass","typography","cmsstyles","ImageBlock","ImageBlockComponent","Link","children","CmsLinkList","color","links","LinkList","text","iconName","index","LazyIcon","LinkListBlock","titleHtmlMarkup","additionalLinkList","useGridLayout","contentClassName","cn","useContext","backgroundColor","PortableTextContext","LinkListBlockComponent","handleIOSSafariUA","ua","iOS","isAppleMobileDevice","webkit","isAndroid","getAppUrl","LoginButton","htmlMarkup","icon","rightSideIcon","appUrl","setAppUrl","buttonRef","triggerOriginalBehaviour","useAppUrl","mobileOnClick","Icon","getIconColor","theme","bindClassNames","Panel","emphasize","linkTitle","intro","colorName","linkTarget","large","hoverRef","isHovered","useHover","iconComponent","_Fragment","IconSize","iconOrEmphasisComponent","spacingClassNames","titleComponent","ArrowRight","renderSection","linkClassNames","LoginBlock","authenticatedTitle","authenticatedIntro","hideIfAuthenticated","buttonText","showOnlyButton","isAuthenticated","setIsAuthenticated","useState","getColorName","contextColor","blockColor","LoginBlockComponent","TextBlockComponent","titleAppearance","mainIntro","mainBody","fontStyles","TextBlock","RichTextTitle","htmlMarkupAppearanceMap","VimeoSubtitleLanguageCodes","useRef","YouTubeTermsOfService","handleAccept","checkboxRef","Checkbox","YOUTUBE_TOS_COOKIE_NAME","YOUTUBE_EVENT_NAME","YOUTUBE_COOKIE_AGE_DAYS","VideoSpiller","description","videoId","videoType","altText","showTextContent","subtitleLanguageCode","tosAccepted","setTosAccepted","remember","handleAcceptEvent","getVideoUrl","getAllowAttribute","videoUrl","allowAttribute","showTermsOfService","renderTextContent","VideoBlock","VideoSpillerComponent","Spacer","AnalyticsId","VideoKort","onClick","wrapperClassName","selected","hasFullWidth","cardsPerRow","playVideoLabel","uuid","useUuid","buttonId","titleId","descriptionId","wrapperClasses","videoCardClasses","imageClasses","buttonAriaLabelledBy","buttonAriaDescribedBy","playLabelClasses","titleClasses","designTheme","Play","VideoMatrise","videoCards","currentIndex","setIndex","matriseRef","card","VideoMatriseBlock","VideoMatriseComponent","isVideoThemeColor","globalComponents","createContext","components","PortableTextReact","Seksjon","id","seksjon","expanded","errorMessage","seksjonComponent","loader","NotificationPanel","sectionClasses","ChevronUp","ChevronDown","Collapse","HjelpeskuffComponent","isVisible","defaultSeksjon","seksjoner","breakpoint","useBreakpoint","disableTransition","setDisableTransition","helpTitleRef","helpDrawerRef","helpContentsRef","prevAriaHiddens","setPrevAriaHiddens","trapFocus","setTrapFocus","prevFocus","setPrevFocus","useFocusToggle","trackToggleOpen","activeSeksjonId","isOpen","activeSeksjon","enableTrapFocus","toggleFocus","node","releaseFocus","handleToggleClick","elementIsInHelpDrawer","eventTarget","elementIsInHjelpetrigger","isMobile","Breakpoint","isOpenInHistoryState","removePreventscroll","isLightboxOpen","setScroll","open","close","disableTransitionToPreventDoubleAnimation","popStateListener","helpDrawerOpen","clickListener","eventPath","removeSeksjon","triggerId","helpDrawerClasses","defaultSeksjonComponent","seksjonerComponent","style","ariaLabelTitleText","HelpSign","ChevronRight","ChevronLeft","X","TOGGLE_SHOW","TOGGLE_SHOW_HELPITEM","SET_ACTIVE_HELPBUBBLE","HIDE","SHOW","REMOVE_SEKSJON","TOGGLE_EXPANDED","ADD_HJELPETRIGGER","REMOVE_HJELPETRIGGER","POPULATE_SKUFF","collapseAll","isDefaultTrigger","processToggleShowHelp","activeTriggerComponentId","sameTriggerId","sameTriggerComponentId","getBlankSeksjonIdIfActiv","removeSection","reducer","toggleShowHjelpeskuff","toggleShowHelpItem","triggerComponentId","removeSeksjonTekst","toggleExpanded","hideHjelpeskuff","showHjelpeskuff","addHjelpetrigger","removeHjelpetrigger","setActiveBubble","populateSkuff","getTriggerData","triggerData","sporsmaalTekst","hjelpeboble","hjelpetekst","overskrift","getActiveBubble","getDefaultTekst","spesifikkHjelpetekst","tjenesteTeksterDetails","getSeksjonTekst","hjelpeteksterForTjeneste","ht","TriggerHelpItemEvent","AddHjelpetrigger","RemoveHjelpetrigger","HjelpeskuffContainer","triggerComponentIds","mount","other","mapStateToProps","mapDispatchToProps","connect","HjelpetriggerComponent","sporsmalstekst","classes","helpBubbleIsExpanded","stopPropagation","useCustomEvent","ref","handleHelpClick","helpElement","triggerHelpItemEvent","trigger","HelpQuestion","Trigger","HjelpebobleComponent","onChange","onShowMoreClick","visible","bubbleText","moreHelpText","hjelpetriggerRef","showMoreButton","renderBubbleContent","showMoreClickHandler","renderBubble","HelpBubble","HjelpetriggerContainer","addHjelpetriggerEvent","getResourcesEvent","GetResourcesEvent","removeHjelpetriggerEvent","isDefault","Hjelpetrigger","overrideHelpetekstId","overrideTjenesteNavn","activeBubble","extraProps","helpTriggerItem","SharingStatus","selectedStatusType","sharingStatus","FrankensteinSharingStatus","Eye","NoEye","PageHeader","subtitle","delAvForeldresamtykke","headerClassName","headerSubtitleClassName","headerTitleClassName","headerIngressClassName","showHjelpetrigger","hasHjelpetrigger","renderHjelpetrigger","frameworkstyles","pageHeaderClasses","ErrorMessage","labelId","isEmpty","obj","PageLoader","warning","spinning","ariaAttributes","renderSuggestion","suggestion","getSuggestionValue","Autosuggest","inputId","errorTextUuid","inputProps","getAriaDescribedBy","ErrorWrapper","renderLabel","FormOnColor","ReactAutosuggest","SubContent","countShowing","showMorePageSize","showMoreButtonClasses","showMoreButtonText","updateCountShowing","subContentClasses","classnames","reverseSortDirection","sortDir","SortDirection","columns","colSortDirs","onHeaderClickSortChange","initialSortColumnKey","sortDisabled","sortColumnKey","expandableRow","isTwoDimensional","sortedData","TableHeadCell","column","altTitle","headerkey","sortDirection","Cell","highlight","highlightStartIndex","highlightEndIndex","textStart","textHighlight","textEnd","highlightText","childProps","highlightedChildren","columnKey","content","TableCell","Row","expandableRowKey","rowKey","toggle","rowData","tableId","showDetailsText","hideDetailsText","newColumns","expandableRowId","TableExpanderCell","processedJsonObjectName","rowValue","processedColName","rowClasses","cells","TableRow","sortIndexes","useNumericSort","customSetSortValue","a","b","valueA","valueB","processedColNameValue","tempA","tempB","columnValue","compareOptions","sortVal","isTableTwoDimensional","createLevel2Rows","isExpanded","rows","childRows","j","childRowKey","createRows","toggleExpandRow","getOrCreateRowRef","rowKeyColumnKey","emptyContentText","emptyContentElement","expandedRows","isExpandableRow","level2Rows","isColumn","checkChildren","updateColumns","DataTable","_prevProps","prevState","isClicked","newCountShowing","initialSortDirIsAsc","disableTwoDimensional","childrenProps","nextProps","updatedState","nextSortColumnKey","nextSortColumDir","newData","currentColumnCount","nextColumnCount","wrapperClassNames","tableClassNames","breakpointConfig","noAnchorLinkWrapper","rowClassNames","mode","tableClasses","captionId","Table","TableHead","HeaderCategory","TableBody","Column","ExpandableRow","colspan","childrenElement","TableExpandedRow","defaultResources","ResourcesContext","useResourcesContext","ResourcesContextProvider","NoScroll","OffCanvas","isOpened","setIsVisible","wrapperRef","handleTransitionEnd","useFocusTrap","useKeyboardEvent","KeyboardEventKey","contentClasses","NoFilter","FilterGroup","placeholder","showMobileFilterState","setShowMobileFilterState","handleToggleMobileFilterState","offCanvasHeader","FormGroup","Dropdown","DesktopSort","maxLabelLength","setMaxLabelLength","isFluid","handleSort","newMaxLabelLength","Select","useStateValue","stateValue","setStateValue","MobileSort","setIsOpen","sortKey","setSortKey","resetSortKey","handleOpen","handleClose","cb","handleShowResults","RadioButton","FilterSortWrapper","FilterSort","Status","isSortFilterOption","option","moveSortLast","aIsSort","bIsSort","Filter","afterHeadingChildren","afterActiveFiltersChildren","activeFilters","extraFilterOptions","showFilters","filterOptions","footerContent","isAlwaysOpen","isDisabled","allowMobileView","numResults","status","statusText","onFilterOpen","onSubmit","onResetActiveFilters","searchBelowFilter","searchFilter","isMobileUA","prevActiveFilters","setPrevActiveFilters","showFiltersState","setShowFiltersState","isLoading","isSlowSearch","toggleShowMainFilter","onSubmitHandler","isFilterResultSubmitted","resetActiveFilters","af","activeFilterTag","renderActiveFilters","renderTags","renderChips","TagList","Tag","onActiveFilterClicked","activeFilter","Chip","renderFilterOptions","isInsideFilter","sortedFilterOptions","renderChildren","isComponent","fo","renderSlowSearchSubmitButton","renderFilter","renderDesktopFilter","renderAfterHeadingChildren","noBottomPaddingClass","ExpanderSize","counter","FilterSearch","disabled","defaultValue","refObject","usePseudoClasses","isMutableRefObject","mergedRefs","mergeRefs","containerClassNames","clearSearchText","handleKeydown","Input","Close","useFilters","filters","setFilters","delayedFilters","setDelayedFilters","searchQuery","setSearchQuery","setFilter","setDelayedFilter","updateFilters","removeFilterFromState","Samtykke","getSamtykke","hasSamtykke","Breadcrumb","homeLabel","homeUrl","link","ariaLabel","innerContent","handleLinkClick","currentConfiguration","originalKey","getCurrentConfiguration","getRedirectToUrlAfterLogin","configuration","getDelAvForeldresamtykke","getBreadcrumbLink","contentResources","pageConfiguration","helsenorgeUrlPlaceholder","pageBreadcrumbLinks","getCmsBreadcrumbLink","BreadcrumbComponent","withErrorBoundary","COMPONENT","GuardedComponent","logError","ErrorPanel","ErrorBoundary","getIcon","EmoticonDelighted","EmoticonHappy","EmoticonMeh","EmoticonDisappointed","EmoticonAnnoyed","ScoreInput","scoreValueList","trackScore","score","trackComment","sanitizeValue","string","createFeedback","body","updateFeedback","sanitized","CHARACTER_LIMIT","TEXTAREA_ID","DESCRIPTION_ID","FeedbackForm","pageTitle","register","handleSubmit","watch","setError","errors","isSubmitting","isSubmitSuccessful","useForm","setId","showComment","handleUpdate","debouncedUpdate","teardown","debounce","createFeedbackResponse","api.createFeedback","api.updateFeedback","getButtonAriaLabel","Validation","TextArea","Label","Sublabel","Feedback","useAppDispatch","useAppSelector","FeedbackContainer","feedbackResources","useLanguageEvent","currentLanguage","supportedLanguages","newLanguage","LanguageNames","BokmaalLanguageName","getLanguageName","languages","LanguagePicker","onLanguageChange","selectedLanguage","handleLanguageChange","languageChangedMessage","Globe","LanguagePickerOriginName","LanguagePickerWrapper","Personvelger","webcompIsReady","setWebcompIsReady","location","useLocation","Master","mainAriaLabelledby","visPersonvelger","breadcrumbLink","hasFullwidth","noBreadcrumb","noDriftspanel","noLanguagePicker","showFeedbackForm","hasPageHeader","showHjelpeskuffInPageHeader","canShowHjelpetekstInPageHeader","showHjelpeskuffInPageHeaderState","getTitleId","useTrackPageView","enabled","previousPathname","TrackPageView","PageRoot","noHjelpeskuff","pageDescription","enablePageviewTracking","visPersonvelgerState","setVisPersonvelgerState","handleVisPersonvelgerUpdate","Hjelpeskuff","PageRoot$1"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],"sources":["../../../node_modules/@helsenorge/framework-utils/adobe-analytics.js","../../../node_modules/@helsenorge/framework-utils/hn-authorize.js","../../../node_modules/@helsenorge/framework-utils/cookie.js","../../../node_modules/@helsenorge/framework-utils/hn-service.js","../../../node_modules/@helsenorge/framework-utils/cycle.js","../../../node_modules/@helsenorge/framework-utils/logger.js","../../../node_modules/@helsenorge/framework-utils/hn-proxy-service.js","../../../node_modules/@helsenorge/core-utils/constants/languages.js","../../../node_modules/@helsenorge/core-utils/string-utils.js","../../../node_modules/@helsenorge/core-utils/date-fns-utils.js","../../../node_modules/@helsenorge/framework-utils/shared-cookies.js","../../../node_modules/@helsenorge/framework-utils/web-component/constants.js","../../../node_modules/@helsenorge/framework-utils/types/entities.js","../../../node_modules/@helsenorge/framework-utils/hn-user.js","../../../node_modules/@helsenorge/framework-utils/web-component/events.js","../../../node_modules/@helsenorge/framework-utils/hn-language.js","../../../node_modules/@helsenorge/framework-utils/language/index.js","../../../node_modules/@helsenorge/framework-utils/hn-debug.js","../../../node_modules/@helsenorge/framework-utils/resources/index.js","../../../node_modules/@helsenorge/framework-utils/resources/useResources.js","../../../node_modules/@helsenorge/core-framework/page-not-found/side-som-ikke-finnes-svg.js","../../../node_modules/@helsenorge/core-framework/resources/index.js","../../../node_modules/@helsenorge/core-framework/page-not-found/index.js","../../../node_modules/@helsenorge/framework-utils/hn-page.js","../../../node_modules/@helsenorge/framework-utils/web-component/register.js","../../../node_modules/@helsenorge/framework-utils/web-component/fetcher.js","../../../node_modules/@helsenorge/framework-utils/web-component/consumer.js","../../../node_modules/@helsenorge/framework-utils/components/safe-html/safe-html.js","../../../node_modules/@helsenorge/framework-utils/hn-feature-toggle.js","../../../node_modules/@helsenorge/framework-utils/trusted-types.js","../../../node_modules/@helsenorge/framework-utils/components/safe-html/index.js","../../../node_modules/@helsenorge/framework-utils/cms-content-api-service.js","../../../node_modules/@helsenorge/framework-utils/cms-tjeneste-tekster/index.js","../../../node_modules/@helsenorge/core-utils/aria-hidden.js","../../../node_modules/@helsenorge/core-utils/constants/key-code.js","../../../node_modules/@helsenorge/core-utils/events.js","../../../node_modules/@helsenorge/core-utils/focus-utils.js","../../../node_modules/@helsenorge/core-utils/trapfocus.js","../../../node_modules/@helsenorge/core-cms/behandlingsvalg/ekspanderendeblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/ekspanderendeblock/index.js","../../../node_modules/@helsenorge/core-cms/types/entities.js","../../../node_modules/@helsenorge/core-cms/image/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/imageblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/link/index.js","../../../node_modules/@helsenorge/core-cms/linklistblock/linklist/index.js","../../../node_modules/@helsenorge/core-cms/linklistblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/linklistblock/index.js","../../../node_modules/@helsenorge/core-utils/user-agents-utils.js","../../../node_modules/@helsenorge/framework-utils/url.js","../../../node_modules/@helsenorge/core-cms/loginblock/LoginButton.js","../../../node_modules/@helsenorge/core-cms/shared/getIconColor.js","../../../node_modules/@helsenorge/core-cms/panel/index.js","../../../node_modules/@helsenorge/core-cms/loginblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/loginblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/textblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/title/index.js","../../../node_modules/@helsenorge/core-cms/videospiller/constants.js","../../../node_modules/@helsenorge/core-cms/videospiller/youtube-terms-of-service.js","../../../node_modules/@helsenorge/core-cms/videospiller/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/videoblock/index.js","../../../node_modules/@helsenorge/core-cms/shared/analytics.js","../../../node_modules/@helsenorge/core-cms/videokort/index.js","../../../node_modules/@helsenorge/core-cms/videomatrise/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/videomatriseblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/portable-text-utils.js","../../../node_modules/@helsenorge/core-cms/richtext/index.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpeskuff/seksjon.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpeskuff/hjelpeskuff-component.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpeskuff/hjelpeskuff-state.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpeskuff/index.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpetrigger/hjelpetrigger-component.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpetrigger/hjelpeboble-component.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpetrigger/hjelpetrigger-container.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpetrigger/index.js","../../../node_modules/@helsenorge/core-framework/sharing-status/index.js","../../../node_modules/@helsenorge/core-framework/page-header/index.js","../../../node_modules/@helsenorge/core-framework/error-message/index.js","../../../node_modules/@helsenorge/core-framework/page-loader/page-loader.js","../../../node_modules/@helsenorge/autosuggest/components/autosuggest/index.js","../../../node_modules/@helsenorge/data-table/components/table/sub-content.js","../../../node_modules/@helsenorge/data-table/components/table/table-head-helper.js","../../../node_modules/@helsenorge/data-table/components/table/cell.js","../../../node_modules/@helsenorge/data-table/components/table/row.js","../../../node_modules/@helsenorge/data-table/components/table/table-helper.js","../../../node_modules/@helsenorge/data-table/components/table/table.js","../../../node_modules/@helsenorge/data-table/components/table/column.js","../../../node_modules/@helsenorge/data-table/components/table/expandable-row.js","../../../node_modules/@helsenorge/filter/components/filter/resources.js","../../../node_modules/@helsenorge/filter/components/offcanvas/index.js","../../../node_modules/@helsenorge/filter/components/filter/filter-group.js","../../../node_modules/@helsenorge/filter/components/filter/desktop-sort.js","../../../node_modules/@helsenorge/filter/components/filter/useStateValue.js","../../../node_modules/@helsenorge/filter/components/filter/mobile-sort.js","../../../node_modules/@helsenorge/filter/components/filter/filter-sort.js","../../../node_modules/@helsenorge/filter/components/filter/index.js","../../../node_modules/@helsenorge/filter/components/filter/filter-search.js","../../../node_modules/@helsenorge/filter/components/filter/useFilters.js","../../../node_modules/@helsenorge/framework-utils/samtykke-utils.js","../../../node_modules/@helsenorge/core-cms/breadcrumb/index.js","../../../node_modules/@helsenorge/core-framework/common/configuration.js","../../../node_modules/@helsenorge/core-framework/breadcrumb/index.js","../../../node_modules/@helsenorge/core-framework/error-boundary/with-error-boundary.js","../../../node_modules/@helsenorge/core-framework/error-boundary/index.js","../../../node_modules/@helsenorge/core-framework/feedback/score-input/utils.js","../../../node_modules/@helsenorge/core-framework/feedback/score-input/index.js","../../../node_modules/@helsenorge/core-framework/feedback/utils/entities.js","../../../node_modules/@helsenorge/core-framework/feedback/utils/analytics.js","../../../node_modules/@helsenorge/core-cms/userfeedback/utils/string.js","../../../node_modules/@helsenorge/core-framework/feedback/utils/api.js","../../../node_modules/@helsenorge/core-framework/feedback/index.js","../../../node_modules/@helsenorge/core-framework/store/hooks.js","../../../node_modules/@helsenorge/core-framework/feedback/container/index.js","../../../node_modules/@helsenorge/framework-utils/language/useLanguageEvent.js","../../../node_modules/@helsenorge/core-framework/language-picker-wrapper/resources.js","../../../node_modules/@helsenorge/core-framework/language-picker/index.js","../../../node_modules/@helsenorge/core-framework/language-picker-wrapper/index.js","../../../node_modules/@helsenorge/core-framework/personvelger/index.js","../../../node_modules/@helsenorge/core-framework/pageroot/master.js","../../../node_modules/@helsenorge/core-framework/track-pageview/useTrackPageView.js","../../../node_modules/@helsenorge/core-framework/track-pageview/index.js","../../../node_modules/@helsenorge/core-framework/pageroot/index.js"],"sourcesContent":["/**\n * Send data til Adobe Analytics via adobeDataLayer\n *\n * @param payload Data som skal spores\n */\nexport const pushToDataLayer = (payload) => {\n window.adobeDataLayer = window.adobeDataLayer || [];\n window.adobeDataLayer.push(payload);\n};\n/**\n * Spor handling i tjeneste\n * @param trackAction type handling som skal spores\n * @param serviceName navnet pÃ¥ tjenesten, f.eks. \"pasientreiser\"\n * @param action spesifiserer hvilken handling man utfører, f.eks. \"send søknad\"\n * @param flow type prosess\n */\nexport const trackSelfService = (trackAction, serviceName, action, flow) => {\n const payload = {\n event: `self service ${trackAction}`,\n selfService: {\n name: `${serviceName}: ${action}`,\n flow,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor bruk av samtykkeflyt\n * @param action definerer consentStart, consentFunnel eller consentComplete videre\n * @param stepName definerer consentFunnelStep pÃ¥ ConsentSelfService\n * @param stepNumber definerer selfServiceFunnelStepNumber pÃ¥ ConsentSelfService\n * @param type definerer consentType pÃ¥ ConsentSelfService\n */\nexport const trackConsent = (action, stepName, stepNumber, type) => {\n const payload = {\n event: `consent ${action}`,\n consent: {\n stepName,\n stepNumber,\n type,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor bruk av filterkomponent\n * @param name definerer navnet fil Filter\n * @param action definerer type tracking: 'usage' | 'expand' | 'search' | 'group expand'\n */\nexport const trackFilters = (name, action) => {\n const payload = {\n event: `filter ${action}`,\n filter: {\n name,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor partner - setter informasjon om tjenesteeier\n * @param partner definerer partner\n */\nexport const updatePagePartner = (partner) => {\n const payload = {\n page: {\n partner,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Setter informasjon om innlogget status i window.adobeDataLayer\n * @param loggedIn Om bruker er logget inn eller ikke\n */\nexport const updateLoginStatus = (loggedIn) => {\n const payload = {\n user: {\n loggedIn,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor uleste varslinger\n * @param unreadAlerts Antall uleste varslinger\n */\nexport const trackUnreadAlert = (unreadAlerts) => {\n const payload = {\n event: 'unread alerts',\n notifications: {\n unreadAlerts,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor uleste meldinger\n * @param unreadMessages Antall uleste meldinger\n */\nexport const trackUnreadMessage = (unreadMessages) => {\n const payload = {\n event: 'unread messages',\n notifications: {\n unreadMessages,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor leste meldinger med type.\n * @param type Meldingstype\n */\nexport const trackReadMessageType = (type) => {\n const payload = {\n event: 'message read',\n message: {\n type,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor internsøk\n * @param phrase nøkkelord som settes pÃ¥ search searchTerm\n * @param type type som settes pÃ¥ search searchType\n * @param resultsCount antall søkeresultater som settes pÃ¥ search resultsCount\n */\nexport const trackSearch = (phrase, type, resultsCount) => {\n const payload = {\n event: 'internal search',\n search: {\n phrase,\n type,\n resultsCount,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor klikk pÃ¥ internsøkeresultater\n * @param searchPosition position til søkeresultatet som lagres pÃ¥ search searchposition\n */\nexport const trackSearchThrough = (searchPosition) => {\n const payload = {\n event: 'search click through',\n search: {\n searchPosition,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor endring av profilinnstillinger\n * @param interactionName navn som lagres pÃ¥ user profileInteractionName\n */\nexport const trackProfileInteraction = (interactionName) => {\n const payload = {\n event: 'profile interaction',\n profile: {\n interactionName,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * spor handlinger med kun ett steg, e.g.\n * trackTool('kontaktskjema', 'hjelp', 'bytte fastlege', 'send')\n * @param name navn som lagres pÃ¥ tool toolName\n * @param type type som lagres pÃ¥ tool toolType\n * @param labels label som lagres pÃ¥ tool toolLabels\n * @param action handlingen som utføres\n */\nexport const trackTool = (name, type, labels, action) => {\n const payload = {\n event: 'use tool',\n tool: {\n name,\n type,\n labels,\n action,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor Ã¥pning/lukking av hjelpeskuff\n * @param name navn som lagres pÃ¥ tool.name\n * @param type type som lagres pÃ¥ tool.type\n * @param labels labels som lagres pÃ¥ tool.labels\n * @param action 'Close' | 'Open'\n */\nexport const trackProsesshjelp = (name, type, labels, action) => {\n trackTool(name, type, labels, action);\n};\n/**\n * Oppdater data om brukeren, f.eks.\n * updateUserAttributes({ userStatus: \"something\" })\n * @param userAttributes objekt med verdier som enten legges til eller oppdaterer eksisterende data om brukeren\n */\nexport const updateUserAttributes = (userAttributes) => {\n const payload = {\n user: userAttributes,\n };\n pushToDataLayer(payload);\n};\n/**\n * spor sidevisninger, e.g.\n * trackPageview()\n * @param hasContent (valgfri) om siden har innhold\n */\nexport const trackPageview = (hasContent) => {\n const payload = {\n event: 'pageview',\n page: {\n hasContent: !!hasContent,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor om en tjeneste har innhold eller ikke\n * @param hasContent Boolean som sier om det er innhold i tjenesten eller ikke\n */\nexport const trackHasContent = (hasContent) => {\n trackPageview(hasContent);\n};\n/**\n * Spor feil, f.eks.\n * trackError(\"level1\", \"Beskrivelse av feilen\")\n * @param level Alvorlighetsgrad (level1, level2, level3 eller level4)\n * @param details Tekst som beskriver feilen\n */\nexport const trackError = (level, details) => {\n const payload = {\n event: 'site error',\n error: {\n level,\n details,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor klikk i toppmenyen\n * @param name string\n * @param label navigationLabel\n * @param pageSection navigationPageSection\n */\nexport const trackNavigation = (name, label, pageSection) => {\n const payload = {\n event: 'navigation',\n navigation: {\n name,\n label,\n pageSection,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor tilbakemelding i invitasjon til spørreundersøkelse\n * @param name string\n * @param label string\n */\nexport const trackFeedback = (name, label) => {\n const payload = {\n event: 'feedback',\n feedback: {\n name,\n label,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor 404-feil\n */\nexport const track404 = () => {\n const payload = {\n event: '404 not found',\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor at bruker bytter sprÃ¥k.\n * trackLanguage('English')\n * @param language SprÃ¥ket bruker valgte.\n */\nexport const trackLanguage = (language) => {\n const payload = {\n event: 'change language',\n page: {\n language,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor endring i hvem brukeren representerer\n * @param onBehalfOf Hvilken type representasjon er det\n * @param role Hvilken rolle har bruker i representasjonen\n */\nexport const trackRepresentation = (onBehalfOf, role) => {\n const payload = {\n user: {\n representation: {\n onBehalfOf,\n role,\n },\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor visning av informasjon\n * @param type Hvilken type informasjon som vises\n * @param name Navn pÃ¥ informasjonen\n */\nexport const trackInfoShown = (type, name) => {\n const payload = {\n event: 'info shown',\n info: {\n type,\n name,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor klikk pÃ¥ informasjon\n * @param type Hvilken type informasjon som vises\n * @param name Navn pÃ¥ informasjonen\n * @param option Navn pÃ¥ informasjonen\n */\nexport const trackInfoClick = (type, name, option) => {\n const payload = {\n event: 'info click',\n info: {\n type,\n name,\n option,\n },\n };\n pushToDataLayer(payload);\n};\n","/**\n * Returnerer Authorized fra HN.rest objektet\n */\nexport const isAuthorized = () => {\n if (typeof document === 'undefined') {\n return false;\n }\n return !!window.HN?.Rest?.Authorized;\n};\n/**\n * Returnerer HashIsAuthorized fra HN.rest objektet\n */\nexport const hashIsAuthorized = () => {\n return window.HN?.Rest?.HashIsAuthorized ?? false;\n};\n","/** Cookie-navn for om man er logget inn */\nexport const LOGGED_IN_COOKIE_NAME = 'MH_LoggedIn';\n/** Cookie-navn for sesjons-ID */\nexport const SESSION_ID_COOKIE_NAME = 'MH_SessionId';\n/** Cookie-navn for mÃ¥ten man har logget inn pÃ¥ */\nexport const IDENTITY_PROVIDER_COOKIE_NAME = 'MH_Idp';\n/** Cookie-navn for versjon av appen */\nexport const APP_VERSION_COOKIE_NAME = 'MH_App_Version';\n/**\n * Sjekker om cookie finnes og om den har verdi\n * @param cookieName navn pÃ¥ cookie\n * @param value cookie verdi\n */\nexport const hasCookie = (cookieName, value) => {\n if (typeof document === 'undefined') {\n return false;\n }\n const cookie = document.cookie;\n if (cookie === undefined) {\n return false;\n }\n if (value === undefined) {\n return cookie.split('; ').find(e => e.split('=')[0] === cookieName) !== undefined;\n }\n const cookieValue = '; '.concat(document.cookie);\n const parts = cookieValue.split('; '.concat(cookieName).concat('='));\n if (parts.length === 2) {\n const lastPart = parts.pop();\n return lastPart ? lastPart.split(';').shift() === value.toString() : false;\n }\n return false;\n};\n/**\n * Henter cookienavn inkludert eventuelt suffix for Ã¥ støtte ulike domener.\n * @param cookieName navn pÃ¥ cookie\n */\nexport const getSuffix = (cookieName) => {\n let suffix = '';\n if (window.HN?.Rest?.Environment) {\n suffix = '_' + window.HN.Rest.Environment;\n }\n return cookieName + suffix;\n};\n/**\n * Sjekker om cookie finnes og om den har verdi\n * @param cookieName navn pÃ¥ cookie\n */\nexport const hasCookieWithSuffix = (cookieName) => {\n return hasCookie(getSuffix(cookieName));\n};\n/**\n * Sjekker om bruker er logget inn basert pÃ¥ cookie\n */\nexport const hasLoggedInCookie = () => {\n return hasCookieWithSuffix(LOGGED_IN_COOKIE_NAME) || hasCookieWithSuffix(SESSION_ID_COOKIE_NAME);\n};\n/**\n * Setter en cookie med van + verdi\n * @param cookieName navn pÃ¥ cookie\n * @param value cookie verdi\n */\nexport const setCookie = (name, value = '') => {\n document.cookie = `${name}=${value};path=/;`;\n};\n/**\n * Sletter en cookie basert pÃ¥ navnet\n * @param cookieName navn pÃ¥ cookie\n */\nexport const deleteCookie = (name) => {\n document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n};\n/**\n * Henter verdien til en cookie basert pÃ¥ navnet\n * @param cookieName navn pÃ¥ cookie\n */\nexport const getCookieValue = (name) => {\n const cookie = hasCookie(name);\n const cookieWithSuffix = hasCookieWithSuffix(name);\n if (!cookie && !cookieWithSuffix) {\n return undefined;\n }\n const cookieName = cookieWithSuffix ? getSuffix(name) : name;\n return document.cookie\n .split('; ')\n .find(e => e.split('=')[0] === cookieName)\n ?.split('=')[1];\n};\n/**\n * Returnerer domenenavnet uten subdomene, f.eks. \"helsenorge.no\" dersom domenet er \"www.helsenorge.no\" eller \"tjenester.helsenorge.no\"\n * @returns domenenavn for bruk i cookie\n */\nexport const getHostnameWithoutSubdomain = () => {\n if (['127.0.0.1', 'localhost'].includes(window.location.hostname)) {\n return window.location.hostname;\n }\n return window.location.hostname.substring(window.location.hostname.indexOf('.') + 1);\n};\nexport var IdentityProvider;\n(function (IdentityProvider) {\n IdentityProvider[\"HnApp\"] = \"hnapp\";\n IdentityProvider[\"HnAppUngdom\"] = \"idportenlevel3\";\n IdentityProvider[\"IdPorten\"] = \"idporten\";\n IdentityProvider[\"IdPortenLevel4\"] = \"idportenlevel4\";\n})(IdentityProvider || (IdentityProvider = {}));\n/**\n * Henter mÃ¥ten bruker har logget inn pÃ¥\n * @returns IdentityProvider\n */\nexport const getIdentityProvider = () => getCookieValue(IDENTITY_PROVIDER_COOKIE_NAME);\n/**\n * Parse en string til et objekt med minor/minor/patch-versjon\n * @param input Versjon pÃ¥ semver-format 25.01.00\n * @returns Version-objekt eller undefined dersom versjonen ikke kan parses\n */\nexport const parseVersion = (input) => {\n if (!/^\\d+\\.\\d+\\.\\d+$/.test(input))\n return undefined;\n const [major, minor, patch] = input.split('.').map(Number);\n return { major, minor, patch };\n};\n/**\n * Sjekk om en versjon er lik eller høyere enn pÃ¥krevd versjon\n * @param compare Versjon Ã¥ sammenlikne med\n * @param required PÃ¥krevd versjon\n * @returns true dersom input er lik eller høyere enn base\n */\nexport const isVersionEqualOrHigher = (compare, required) => {\n if (compare.major > required.major)\n return true;\n if (compare.major < required.major)\n return false;\n if (compare.minor > required.minor)\n return true;\n if (compare.minor < required.minor)\n return false;\n return compare.patch >= required.patch;\n};\n/**\n * Les app-versjon fra cookie\n * @returns Versjons-info om appen dersom cookie finnes og inneholder gyldig versjonsinfo\n */\nexport const getAppVersion = () => {\n const value = getCookieValue(APP_VERSION_COOKIE_NAME);\n if (value) {\n return parseVersion(value);\n }\n};\n/**\n * Sjekk om innlogget bruker har tilstrekkelig ny versjon av appen\n * @param required Versjon Ã¥ sammenlikne med, pÃ¥ formatet 25.01.00\n * @returns true dersom appen har høyere eller lik versjon som input\n */\nexport const hasAppVersionOrHigher = (required) => {\n const appVersion = getAppVersion();\n const requiredVersion = parseVersion(required);\n if (appVersion && requiredVersion) {\n return isVersionEqualOrHigher(appVersion, requiredVersion);\n }\n return false;\n};\n","import { HelsenorgeHttpError, getCorrelationIdFromResponse } from './hn-proxy-service';\n/**\n * Returnerer en url-friendly string fra et objekt, f.eks. ?a=b&x=y\n * @param params Objekt med parametere som skal gjøres om til en string { a : 'b', x: 'y' }\n */\nexport const parseParams = (params) => {\n if (params) {\n const queryString = Object.keys(params)\n .map(key => {\n if (Object.prototype.hasOwnProperty.call(params, key) && typeof params[key] !== 'undefined') {\n return `${key}=${params[key]}`;\n }\n })\n .filter(x => !!x)\n .join('&');\n if (queryString) {\n return `?${queryString}`;\n }\n }\n return '';\n};\n/**\n * Oppretter nytt Header-objekt med Accept og Content-type\n * @param type application/json er default\n */\nexport const createBaseHeaders = (type = 'application/json') => new Headers({\n Accept: type,\n 'Content-Type': type,\n});\n/**\n * Sjekker status pÃ¥ en Response og returnerer en Promise avhengig av status\n * @param response Response objektet fra HTTP request\n * @throws {HelsenorgeHttpError} Dersom APIet svarer med en feil som ikke er i standard-format\n * @throws {Error} Dersom det skjer andre feil\n */\nexport const checkStatus = (response) => {\n const contentType = response.headers.get('content-type');\n const correlationId = getCorrelationIdFromResponse(response);\n if (contentType?.indexOf('application/json') !== -1) {\n if (response.status === 204) {\n return Promise.resolve(null);\n }\n if (response.ok) {\n return response.json();\n }\n return response\n .json()\n .then(error => {\n // HÃ¥ndtering av feil der serveren har respondert med gyldig JSON\n throw new HelsenorgeHttpError(response.status, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId, error);\n })\n .catch(error => {\n if (error instanceof HelsenorgeHttpError) {\n throw error;\n }\n // HÃ¥ndtering av feil der serveren har respondert med ugyldig JSON\n throw new HelsenorgeHttpError(response.status, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId);\n });\n }\n throw new Error('Det har skjedd en teknisk feil. Prøv igjen senere.');\n};\n","/*\n cycle.js\n 2013-02-19\n\n Public Domain.\n\n NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n This code should be minified before deployment.\n See http://javascript.crockford.com/jsmin.html\n\n USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n NOT CONTROL.\n*/\nexport const decycle = (object) => {\n // Make a deep copy of an object or array, assuring that there is at most\n // one instance of each object or array in the resulting structure. The\n // duplicate references (which might be forming cycles) are replaced with\n // an object of the form\n // {$ref: PATH}\n // where the PATH is a JSONPath string that locates the first occurance.\n // So,\n // var a = [];\n // a[0] = a;\n // return JSON.stringify(JSON.decycle(a));\n // produces the string '[{\"$ref\":\"$\"}]'.\n // JSONPath is used to locate the unique object. $ indicates the top level of\n // the object or array. [NUMBER] or [STRING] indicates a child member or\n // property.\n const objects = [], // Keep a reference to each unique object or array\n paths = []; // Keep the path to each unique object or array\n return (function derez(value, path) {\n // The derez recurses through the object, producing the deep copy.\n let i, // The loop counter\n name, // Property name\n nu; // The new object or array\n // typeof null === 'object', so go on if this value is really an object but not\n // one of the weird builtin objects.\n if (typeof value === 'object' &&\n value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n // If the value is an object or array, look to see if we have already\n // encountered it. If so, return a $ref/path object. This is a hard way,\n // linear search that will get slower as the number of unique objects grows.\n for (i = 0; i < objects.length; i += 1) {\n if (objects[i] === value) {\n return { $ref: paths[i] };\n }\n }\n // Otherwise, accumulate the unique value and its path.\n objects.push(value);\n paths.push(path);\n // If it is an array, replicate the array.\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n nu = [];\n for (i = 0; i < value.length; i += 1) {\n nu[i] = derez(value[i], path + '[' + i + ']');\n }\n }\n else {\n // If it is an object, replicate the object.\n nu = {};\n for (name in value) {\n if (Object.prototype.hasOwnProperty.call(value, name)) {\n nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']');\n }\n }\n }\n return nu;\n }\n return value;\n })(object, '$');\n};\n","/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport { decycle } from './cycle';\nimport { getServerLogLevel, getTjenesterUrl, HelsenorgeHttpError, HelsenorgeProxyError } from './hn-proxy-service';\nimport { createBaseHeaders } from './hn-service';\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"Trace\"] = 0] = \"Trace\";\n LogLevel[LogLevel[\"Debug\"] = 1] = \"Debug\";\n LogLevel[LogLevel[\"Info\"] = 2] = \"Info\";\n LogLevel[LogLevel[\"Warn\"] = 3] = \"Warn\";\n LogLevel[LogLevel[\"Error\"] = 4] = \"Error\";\n LogLevel[LogLevel[\"Fatal\"] = 5] = \"Fatal\";\n LogLevel[LogLevel[\"Off\"] = 6] = \"Off\";\n})(LogLevel || (LogLevel = {}));\nconst unwrapError = (potentialError) => {\n if (potentialError instanceof HelsenorgeProxyError) {\n return `${potentialError.message} Status code: ${potentialError.statusCode} CorrelationId: ${potentialError.correlationId} Stack: ${potentialError.stack}`;\n }\n else if (potentialError instanceof HelsenorgeHttpError) {\n return `${potentialError.message} Status code: ${potentialError.statusCode} Stack: ${potentialError.stack}`;\n }\n else if (potentialError instanceof Error) {\n return `${potentialError.message} Stack: ${potentialError.stack}`;\n }\n else if (typeof potentialError === 'string' || potentialError instanceof String) {\n return potentialError;\n }\n else if (potentialError.length > 0) {\n const innerError = potentialError[0];\n return unwrapError(innerError);\n }\n else {\n return JSON.stringify(decycle(potentialError));\n }\n};\nconst generateEntry = (level, message, ...optionalParams) => {\n let fullMessage = message;\n fullMessage = optionalParams.reduce((previous, current) => {\n return previous + ' ' + unwrapError(current);\n }, fullMessage ?? '');\n return {\n Level: level,\n Message: fullMessage,\n Url: window.location.href,\n };\n};\nconst postLogEntry = (logEntry) => {\n fetch(getTjenesterUrl() + '/api/v1/Frontend/Log', {\n method: 'post',\n headers: createBaseHeaders(),\n credentials: 'include',\n body: JSON.stringify(logEntry),\n }).catch();\n};\n/**\n * Logger error til serveren\n */\nexport const logToServer = (level, message, ...optionalParams) => {\n const logLevel = getServerLogLevel();\n if (logLevel !== null && level >= logLevel) {\n exportFunctions.postLogEntry(generateEntry(level, message, optionalParams));\n }\n};\n/**\n * Lager en event listener pÃ¥ errors og logger error til serveren\n */\nexport const captureErrors = () => {\n window.addEventListener('error', function (e) {\n let message = e.message;\n const error = e.error;\n if (error) {\n message = error;\n const stack = error.stack;\n if (stack) {\n message = stack;\n }\n }\n else {\n message = message + '. Access to error information is restricted on this domain!';\n if (e.filename) {\n message = message + ' Filename:' + e.filename;\n }\n }\n exportFunctions.logToServer(LogLevel.Error, message);\n });\n};\n/**\n * Lager en console.debug og logger til serveren\n * @param message - string som sendes i console.debug og logges til serveren\n * @param optionalParams params som sendes til console.debug og logges til serveren\n */\nexport const debug = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.debug(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Debug, message, optionalParams);\n};\n/**\n * Lager en console.error og logger til serveren\n * @param message - string som sendes i console.error og logges til serveren\n * @param optionalParams params som sendes til console.error og logges til serveren\n */\nexport const error = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.error(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Error, message, optionalParams);\n};\n/**\n * Lager en console.info og logger til serveren\n * @param message - string som sendes i console.info og logges til serveren\n * @param optionalParams params som sendes til console.info og logges til serveren\n */\nexport const info = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.info(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Info, message, optionalParams);\n};\n/**\n * Lager en console.trace og logger til serveren\n * @param message - string som sendes i console.trace og til serveren\n * @param optionalParams params som sendes til console.trace og til serveren\n */\nexport const trace = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.trace(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Trace, message, optionalParams);\n};\n/**\n * Lager en console.warn og logger til serveren\n * @param message - string som sendes i console.warn og til serveren\n * @param optionalParams params som sendes til console.warn og til serveren\n */\nexport const warn = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.warn(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Warn, message, optionalParams);\n};\nexport const allowConsoleOutput = () => !['production', 'test'].includes(process.env.NODE_ENV ?? '');\n/**\n * Lager en console.assert\n * @param test - test som sendes til console assert\n * @param message - message som sendes til console assert\n * @param optionalParams params som sendes til console assert\n */\nexport const assert = (test, message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.assert(test, message, optionalParams);\n }\n};\n/**\n * Lager en console.clear\n */\nexport const clear = () => {\n if (allowConsoleOutput()) {\n console.clear();\n }\n};\n/**\n * Lager en console.count\n * @param countTitle - string som sendes i console.count\n */\nexport const count = (countTitle) => {\n if (allowConsoleOutput()) {\n console.count(countTitle);\n }\n};\n/**\n * Lager en console.dir\n * @param value - string som sendes i console.dir og logges til serveren\n * @param optionalParams params som sendes til console.dir og logges til serveren\n */\nexport const dir = (value, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.dir(value, optionalParams);\n }\n};\n/**\n * Lager en console.dirxml\n * @param value - string som sendes i console.dirxml og logges til serveren\n */\nexport const dirxml = (value) => {\n if (allowConsoleOutput()) {\n console.dirxml(value);\n }\n};\n/**\n * Lager en console.group\n * @param groupTitle - string som sendes i console.group\n */\nexport const group = (groupTitle) => {\n if (allowConsoleOutput()) {\n console.group(groupTitle);\n }\n};\n/**\n * Lager en console.groupCollapsed\n * @param groupTitle - string som sendes i console.groupCollapsed\n */\nexport const groupCollapsed = (groupTitle) => {\n if (allowConsoleOutput()) {\n console.groupCollapsed(groupTitle);\n }\n};\n/**\n * Lager en console.groupEnd\n */\nexport const groupEnd = () => {\n if (allowConsoleOutput()) {\n console.groupEnd();\n }\n};\n/**\n * Lager en console.log\n * @param message - string som sendes i console.log\n * @param optionalParams params som sendes til console.log\n */\nexport const log = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n if (optionalParams && optionalParams.length > 0) {\n console.log(message, optionalParams);\n }\n else {\n console.log(message);\n }\n }\n};\n/**\n * Lager en console.profile\n * @param reportName - string som sendes i console.groupCollapsed\n */\nexport const profile = (reportName) => {\n if (allowConsoleOutput()) {\n console.profile(reportName);\n }\n};\n/**\n * Lager en console.profileEnd\n */\nexport const profileEnd = () => {\n if (allowConsoleOutput()) {\n console.profileEnd();\n }\n};\n/**\n * Lager en console.table\n * @param data - array av ukjent data som sendes videre til console.table\n */\nexport const table = (...data) => {\n if (allowConsoleOutput()) {\n console.table(data);\n }\n};\n/**\n * Lager en console.time\n * @param timerName - string som sendes videre til console.time\n */\nexport const time = (timerName) => {\n if (allowConsoleOutput()) {\n console.time(timerName);\n }\n};\n/**\n * Lager en console.timeEnd\n * @param timerName - string som sendes videre til console.timeEnd\n */\nexport const timeEnd = (timerName) => {\n if (allowConsoleOutput()) {\n console.timeEnd(timerName);\n }\n};\n// This wrapping is necessary for being able to Mock function in vi-tests\nconst exportFunctions = {\n postLogEntry,\n logToServer,\n debug,\n error,\n info,\n trace,\n warn,\n assert,\n clear,\n count,\n dir,\n dirxml,\n group,\n groupCollapsed,\n groupEnd,\n log,\n profile,\n profileEnd,\n table,\n time,\n timeEnd,\n};\nexport default exportFunctions;\n","import { format } from 'date-fns';\nimport { trackError } from './adobe-analytics';\nimport { getCookieValue } from './cookie';\nimport { parseParams } from './hn-service';\nimport { warn, error as logError } from './logger';\nconst isProxyErrorResponse = (response) => {\n return (typeof response === 'object' &&\n response !== null &&\n response.code !== undefined &&\n response.errorCategory !== undefined &&\n response.message !== undefined);\n};\nconst isPascalCaseProxyErrorResponse = (response) => {\n return (typeof response === 'object' &&\n response !== null &&\n response.Code !== undefined &&\n response.ErrorCategory !== undefined &&\n response.Message !== undefined);\n};\nconst mapPascalCaseErrorToCamelCase = (response) => ({\n code: response.Code,\n errorCategory: response.ErrorCategory,\n message: response.Message,\n});\nconst saveCorrelationId = (correlationId) => {\n window.HN = window.HN || {};\n window.HN.CorrelationIdList = window.HN.CorrelationIdList || [];\n window.HN.CorrelationIdList.push(correlationId);\n};\n/**\n * Hent correlationId fra API-respons\n * @param response Response fra APIet\n * @returns correlationId som guid\n */\nexport const getCorrelationIdFromResponse = (response) => {\n const correlationId = response.headers.get('CorrelationId');\n if (correlationId) {\n saveCorrelationId(correlationId);\n }\n return correlationId;\n};\nexport const getCorrelationIdList = () => window.HN?.CorrelationIdList;\n/**\n * Custom error i tilfelle APIet returnerer en 4XX- eller 5XX-feil, og en standard\n * Helsenorge-feilrespons med code, errorCategory og message.\n *\n * Eksempel pÃ¥ bruk med get():\n *\n * try {\n * await get('koronasertifikat', 'v1/CoronaCertificate');\n * } catch (error) {\n * if (error instanceof HelsenorgeProxyError && error.response.code === \"HFU-100400\") {\n * // I tilfelle backend svarer med en spesiell feilkode\n * }\n * // Gjør noe annet for andre feil\n * }\n */\nexport class HelsenorgeProxyError extends Error {\n constructor(statusCode, message, correlationId, response, ...params) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(...params);\n Object.defineProperty(this, \"statusCode\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"correlationId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"response\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HelsenorgeProxyError);\n }\n this.name = 'HelsenorgeProxyError';\n // Custom debugging information\n this.statusCode = statusCode;\n this.message = message;\n this.correlationId = correlationId;\n this.response = response;\n }\n}\n/**\n * Custom error i tilfelle APIet returnerer en 4XX- eller 5XX-feil, men der responsen\n * ikke er i henhold til standard.\n */\nexport class HelsenorgeHttpError extends Error {\n constructor(statusCode, message, correlationId, response, ...params) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(...params);\n Object.defineProperty(this, \"statusCode\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"correlationId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"response\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HelsenorgeHttpError);\n }\n this.name = 'HelsenorgeHttpError';\n // Custom debugging information\n this.statusCode = statusCode;\n this.message = message;\n this.correlationId = correlationId;\n this.response = response;\n }\n}\n/**\n * Returnerer baseUrl til Tjenester basert pÃ¥ HN Rest objektet\n */\nexport const getTjenesterUrl = () => {\n return window.HN?.Rest?.TjenesterUrl ?? '';\n};\n/**\n * Returnerer true nÃ¥r window urlen er lik tjenester baseUrl\n */\nexport const erTjenester = () => {\n if (window && window.location) {\n return window.location.origin === getTjenesterUrl();\n }\n return false;\n};\n/**\n * Returnerer proxy url med MinHelse baseUrl og proxynavnet\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n */\nexport const getTjenesterApiUrl = (proxyName, endpoint) => {\n const apiUrl = window.HN?.Rest?.TjenesterApiUrl ?? '';\n return `${apiUrl}/proxy/${proxyName}/${endpoint}`;\n};\nexport function getServerLogLevel() {\n return window.HN?.Rest?.LogLevel ?? null;\n}\n/**\n * Returnerer default params som trengs i en vanlig request\n * @returns Objekt med headers\n */\nconst getRequestHeaders = () => {\n const headers = {};\n if (window.HN?.Rest?.HendelseLoggType) {\n headers['X-hn-hendelselogg'] = window.HN.Rest.HendelseLoggType;\n }\n if (getCookieValue('HN_CSRF_Token')) {\n headers['X-HN-CSRF-Token'] = getCookieValue('HN_CSRF_Token');\n }\n return headers;\n};\n/**\n * Returnerer true nÃ¥r window urlen er lik Helsenorge baseUrl\n */\nexport const erHelsenorge = () => {\n return window.location.origin === getHelsenorgeUrl();\n};\n/**\n * Returnerer Headers som trengs i en vanlig request\n * @param type optional content-type - default er json\n */\nexport const createHeaders = (type = 'application/json') => {\n const headers = new Headers(getRequestHeaders());\n headers.append('Accept', type);\n headers.append('Content-Type', type);\n return headers;\n};\n/**\n * Returnerer filnavn fra et Response-objekt ved nedlasting av filer\n * @param response Responsen fra et fetch-kall\n * @returns filnavn fra Content-Disposition-header, eller en fallback dersom headeren ikke finnes\n */\nexport const getFilenameFromResponse = (response) => {\n let filename = 'nedlasting-' + format(new Date(), 'yyyy-M-d') + '-helseNorge';\n const contentDisposition = response.headers.get('content-disposition');\n if (contentDisposition) {\n const utf8Regex = /filename\\*=utf-8''(.+)/i;\n const asciiRegex = /filename=\"(.+)\"/i;\n const asciiRegexWithoutQuotes = /filename=(.+)/i;\n const match = contentDisposition.match(utf8Regex) ??\n contentDisposition.match(asciiRegex) ??\n contentDisposition.match(asciiRegexWithoutQuotes) ??\n false;\n if (match) {\n try {\n filename = decodeURI(match[1]);\n }\n catch (e) {\n logError(`Responsen fra ${response.url} inneholder ugyldige tegn i filnavnet i Content-Disposition-headeren: ${contentDisposition}`);\n }\n }\n }\n return filename;\n};\n/**\n * Returnerer JSON error objekt - f.eks '{ \"Code\":\"EHAPI-100000\", \"Message\":\"Teknisk feil\", \"ErrorCategory\": 0}'\n * @param html ErrorMsg i html\n */\nexport const getErrorFromHTML = (html) => {\n const first = html.indexOf('{');\n const last = html.lastIndexOf('}');\n const everything = html.substring(first, last + 1);\n if (everything === '') {\n return null;\n }\n return JSON.parse(everything);\n};\n/**\n * Returnerer url basert pÃ¥ HN Rest objektet\n */\nexport function getHelsenorgeUrl() {\n return window.HN?.Rest?.HelseNorgeUrl ?? '';\n}\n/**\n * Returnerer full query string basert pÃ¥ parametrene sendt som argument '?param1=value¶m2=value'\n * @param params opjekt med parametrene\n */\nconst createQueryString = (params) => {\n return ('?' +\n Object.keys(params)\n .map((key) => {\n return Array.isArray(params[key])\n ? params[key].map((x) => `${key}=${x}`).join('&')\n : `${key}=${params[key]}`;\n })\n .join('&'));\n};\n/**\n * Sjekker status pÃ¥ en Response og returnerer en Promise avhengig av status\n * @param response Response objektet fra HTTP request\n * @throws {HelsenorgeProxyError} Dersom APIet svarer med en feil etter Helsenorge-standard\n * @throws {HelsenorgeHttpError} Dersom APIet svarer med en feil som ikke er i standard-format\n * @throws {Error} Dersom det skjer andre feil\n */\nexport const checkStatus = (response) => {\n const contentType = response.headers.get('content-type');\n const correlationId = getCorrelationIdFromResponse(response);\n if (contentType?.indexOf('application/json') !== -1) {\n if (response.status === 204) {\n return Promise.resolve(null);\n }\n if (response.status === 429) {\n throw new HelsenorgeHttpError(429, 'Denne tjenesten er ikke tilgjengelig for øyeblikket. Det er for mange som ønsker Ã¥ bruke tjenesten samtidig.', correlationId);\n }\n if (response.ok) {\n return response.json();\n }\n return response.json().then(error => {\n if (isProxyErrorResponse(error) &&\n (error.code === 'SEC-110000' || error.code === 'EHSEC-110000') &&\n document.location?.href.indexOf('autosignout=1') === -1) {\n // redirect dersom token er utgÃ¥tt eller ugyldig\n window.location.href = `${getTjenesterUrl()}/auth/autosignout`;\n }\n if (isProxyErrorResponse(error)) {\n throw new HelsenorgeProxyError(response.status, error.message, correlationId, error);\n }\n if (isPascalCaseProxyErrorResponse(error)) {\n throw new HelsenorgeProxyError(response.status, error.Message, correlationId, mapPascalCaseErrorToCamelCase(error));\n }\n throw new HelsenorgeHttpError(response.status, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId, error);\n });\n }\n throw new Error('Det har skjedd en teknisk feil. Prøv igjen senere.');\n};\nconst handleError = (error, apiUrl) => {\n trackError('level1', 'Feil ved henting av data fra proxy');\n if (error instanceof TypeError && error.message === 'Failed to fetch') {\n warn(`Kall til følgende URL feilet: ${apiUrl}. Mottok ingen respons fra tjenesten.`);\n throw new Error('Det har skjedd en teknisk feil. Prøv igjen senere.');\n }\n throw error;\n};\n/**\n * baseCrud som brukes for Ã¥ fetche. Logger eventuelle nettverksfeil med warn().\n * @param method\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n * @throws {Error} Dersom det skjedde en feil under fetch-kallet\n */\nconst baseCrud = (method, proxyName, endpoint, params, data) => {\n const queryString = params && Object.keys(params).length > 0 ? createQueryString(params) : '';\n const baseUrl = getTjenesterApiUrl(proxyName, endpoint);\n const requestBody = data ? { body: JSON.stringify(data) } : {};\n const apiUrl = baseUrl + queryString;\n return fetch(apiUrl, {\n ...requestBody,\n method,\n credentials: 'include',\n headers: createHeaders(),\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * get method\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n */\nexport const get = (proxyName, endPoint, params) => {\n return baseCrud('get', proxyName, endPoint, params);\n};\n/**\n * Hjelpemetode for Ã¥ sende get-requester til proxy-API sammen med createApi fra RTK\n * @param args\n * @returns\n */\nexport const getBaseQuery = async (args) => {\n try {\n const response = await get(...args);\n return { data: response };\n }\n catch (error) {\n return { error: error instanceof Error ? error.message : 'Teknisk feil' };\n }\n};\n/**\n * post method\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n */\nexport const post = (proxyName, endPoint, data, params) => {\n return baseCrud('post', proxyName, endPoint, params, data);\n};\n/**\n * put method\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n */\nexport const put = (proxyName, endpoint, data, params) => {\n return baseCrud('put', proxyName, endpoint, params, data);\n};\n/**\n * patch method\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n */\nexport const patch = (proxyName, endpoint, data, params) => {\n return baseCrud('patch', proxyName, endpoint, params, data);\n};\n/**\n * remove method\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n */\nexport const remove = (proxyName, endpoint, data, params) => {\n return baseCrud('delete', proxyName, endpoint, params, data);\n};\n/**\n * Konkatenerer url-lenke basert pÃ¥ environment, proxy, url, request params og custom params\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n */\nexport const link = (proxyName, endpoint, params) => {\n return getTjenesterApiUrl(proxyName, endpoint) + (params ? createQueryString(params) : '');\n};\n/**\n * Las ned en fil/Blob i nettleseren\n * @param download Info om fil som skal lastes ned\n */\nconst downloadFileInBrowser = async (download) => {\n const blob = await download.blob;\n const a = document.createElement('a');\n document.body.appendChild(a);\n const url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = download.fileName;\n a.click();\n window.URL.revokeObjectURL(url);\n};\n/**\n * Sjekker status pÃ¥ en Response og returnerer info om fil som skal nedlastes\n * @param response Response objektet fra HTTP request\n * @throws {HelsenorgeProxyError} Dersom APIet svarer med en feil etter Helsenorge-standard\n * @throws {HelsenorgeHttpError} Dersom APIet svarer med en feil som ikke er i standard-format\n */\nconst handleDownloadResponse = async (response) => {\n if (!response.ok) {\n const error = await response.text();\n const correlationId = getCorrelationIdFromResponse(response);\n if (error === '401') {\n window.location.reload();\n throw new HelsenorgeHttpError(401, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId, error);\n }\n else {\n logError('responseHtml', error);\n const errorResponse = getErrorFromHTML(error);\n if (isProxyErrorResponse(errorResponse)) {\n throw new HelsenorgeProxyError(response.status, errorResponse.message, correlationId, errorResponse);\n }\n else if (isPascalCaseProxyErrorResponse(errorResponse)) {\n throw new HelsenorgeProxyError(response.status, errorResponse.Message, correlationId, mapPascalCaseErrorToCamelCase(errorResponse));\n }\n throw new HelsenorgeHttpError(response.status, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId, error);\n }\n }\n const fileName = getFilenameFromResponse(response);\n const blob = response.blob();\n return { blob, fileName };\n};\n/**\n * Fetch for nedlasting av filer\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param method HTTP-metode: get eller post\n * @param data Data som som sendes som body med fetch\n */\nexport const download = (proxyName, endpoint, params, method = 'get', data) => {\n const queryString = method === 'get' ? parseParams(params) : '';\n const baseUrl = getTjenesterApiUrl(proxyName, endpoint);\n const requestBody = data ? { body: JSON.stringify(data) } : {};\n const apiUrl = baseUrl + queryString;\n const headers = createHeaders();\n if (method === 'get') {\n headers.set('Content-Type', 'multipart/form-data');\n }\n return new Promise((resolve, reject) => {\n fetch(apiUrl, {\n ...requestBody,\n method,\n credentials: 'include',\n headers,\n })\n .then(handleDownloadResponse)\n .then(downloadFileInBrowser)\n .then(() => resolve())\n .catch(error => {\n trackError('level1', 'Feil ved nedlasting av fil');\n if (error instanceof TypeError && error.message === 'Failed to fetch') {\n reject(new Error('Det har skjedd en teknisk feil. Prøv igjen senere.'));\n }\n reject(error);\n });\n });\n};\n/**\n * Last opp fil\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param formData Fil som skal lastes opp\n * @param params parametere som sendes med som query string\n * @throws {Error} Dersom det skjedde en feil under fetch-kallet\n */\nexport const upload = (proxyName, endpoint, formData, params) => {\n const baseUrl = getTjenesterApiUrl(proxyName, endpoint);\n const queryString = params && Object.keys(params).length > 0 ? createQueryString(params) : '';\n const apiUrl = baseUrl + queryString;\n return fetch(apiUrl, {\n body: formData,\n method: 'POST',\n credentials: 'include',\n headers: new Headers(getRequestHeaders()),\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * Hent XML fra proxy\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @returns XML som string\n */\nexport const getXml = (proxyName, endpoint, params) => {\n const baseUrl = getTjenesterApiUrl(proxyName, endpoint);\n const apiUrl = baseUrl + parseParams(params);\n const headers = createHeaders('application/xml');\n const checkStatus = (response) => {\n const contentType = response.headers.get('content-type');\n if (contentType?.indexOf('application/xml') !== -1 && response.ok) {\n return response.text();\n }\n return response.text().then(error => {\n const correlationId = getCorrelationIdFromResponse(response);\n throw new HelsenorgeHttpError(response.status, 'Teknisk feil', correlationId, error);\n });\n };\n return fetch(apiUrl, {\n credentials: 'include',\n headers,\n })\n .then(checkStatus)\n .catch(error => handleError(error, apiUrl));\n};\n","export var LanguageLocales;\n(function (LanguageLocales) {\n LanguageLocales[\"NORWEGIAN\"] = \"nb-NO\";\n LanguageLocales[\"NORWEGIAN_NYNORSK\"] = \"nn-NO\";\n LanguageLocales[\"ENGLISH\"] = \"en-GB\";\n LanguageLocales[\"LITHUANIAN\"] = \"lt-LT\";\n LanguageLocales[\"POLISH\"] = \"pl-PL\";\n LanguageLocales[\"RUSSIAN\"] = \"ru-RU\";\n LanguageLocales[\"ROMANIAN\"] = \"ro-RO\";\n LanguageLocales[\"SAMI_NORTHERN\"] = \"se-NO\";\n})(LanguageLocales || (LanguageLocales = {}));\nexport default LanguageLocales;\n","import { unescapeHexEntities, unescapeHtmlEntities } from './html-entities';\n/**\n * Returnerer true nÃ¥r en streng er null, undefined eller tom\n * @param s - streng som skal sjekkes\n */\nexport const isEmpty = (string) => {\n if (string && string.trim)\n string = string.trim();\n return string === '' || string === null || string === undefined;\n};\n/**\n * Returnerer true nÃ¥r strengen inneholder følgende symboler: \"!#¤%=?`´^¨~*:;£${[\\]}|§€><\\|\n * @param s - streng som skal sjekkes\n */\nexport const hasInvalidCharacters = (s) => {\n return /[\"\"!#¤%=?`´^¨~*:;£${[\\]}|§€><\\|]/.test(s);\n};\n/**\n * Returnerer en streng med uppercase pÃ¥ første bokstav\n * @param s - streng Ã¥ konvertere\n */\nexport const capitalize = (s) => {\n const capitalized = s.charAt(0).toUpperCase() + s.substring(1);\n return capitalized;\n};\n/**\n * Returnerer en streng uten uppercase pÃ¥ første bokstav\n * @param s - streng Ã¥ konvertere\n */\nexport const decapitalize = (s) => {\n const decapitalized = s.charAt(0).toLowerCase() + s.substring(1);\n return decapitalized;\n};\n/**\n * Returns true if the input corresponds with a norwegian phone number format\n * @param phoneNumber - string or number of the phone number\n */\nexport const isNorwegianPhoneNumber = (phoneNumber) => {\n const regexString = '^(0047|[+]47)?[4|9][0-9]{7,7}$';\n return new RegExp(regexString, 'i').test(phoneNumber.toString().replace(new RegExp(' ', 'g'), ''));\n};\n/**\n * Returns a new string where plaeholders {number} have been replaced by items\n * ex: 'my string {0} ' where 0 will be replaced by the first element in args array\n * Note: The order of elements in string decide what order it should be replaced, not number!\n * @param s - string to format\n * @param args is a array in order you want them replaced ex: ['foo', 'bar']\n * @param allowEmptyStrings if '' is allowed or not\n */\nexport const format = (s, args, allowEmptyStrings) => {\n return s.replace(/{(\\d+)}/g, function replace(match, number) {\n if (allowEmptyStrings) {\n return args[number];\n }\n return args[number] ? args[number] : match;\n });\n};\nconst regexEmoticonsRule = /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\u0023-\\u0039]\\ufe0f?\\u20e3|\\u3299|\\u3297|\\u303d|\\u3030|\\u24c2|\\ud83c[\\udd70-\\udd71]|\\ud83c[\\udd7e-\\udd7f]|\\ud83c\\udd8e|\\ud83c[\\udd91-\\udd9a]|\\ud83c[\\udde6-\\uddff]|\\ud83c[\\ude01-\\ude02]|\\ud83c\\ude1a|\\ud83c\\ude2f|\\ud83c[\\ude32-\\ude3a]|\\ud83c[\\ude50-\\ude51]|\\u203c|\\u2049|[\\u25aa-\\u25ab]|\\u25b6|\\u25c0|[\\u25fb-\\u25fe]|\\u00a9|\\u00ae|\\u2122|\\u2139|\\ud83c\\udc04|[\\u2600-\\u26FF]|\\u2b05|\\u2b06|\\u2b07|\\u2b1b|\\u2b1c|\\u2b50|\\u2b55|\\u231a|\\u231b|\\u2328|\\u23cf|[\\u23e9-\\u23f3]|[\\u23f8-\\u23fa]|\\ud83c\\udccf|\\u2934|\\u2935|[\\u2190-\\u21ff])/g;\n/**\n * Returns en Array med alle html tags som er funnet i en string <...></...>\n * @param s - string som skal sjekkes\n */\nexport const invalidNodes = (s) => {\n const tagsMatches = unescapeHtmlEntities(unescapeHexEntities(s)).match(/<.*?>/g);\n const tags = tagsMatches ? tagsMatches.map(i => i.toString()) : [];\n const emoticonsMatches = s.match(regexEmoticonsRule);\n const emoticons = emoticonsMatches ? emoticonsMatches.map(i => i.toString()) : [];\n return tags.concat(emoticons);\n};\n/**\n * Returns true nÃ¥r strengen ikke inneholder emoticon og tags\n * @param s - string som skal sjekkes\n */\nexport const isValid = (s) => {\n return (!/<.*?>/g.test(s) &&\n !regexEmoticonsRule.test(s) &&\n !/<.*?>/g.test(unescapeHtmlEntities(s)) &&\n !/<.*?>/g.test(unescapeHtmlEntities(unescapeHexEntities(s))));\n};\n","import { setDefaultOptions, format as formatDF, isEqual as isEqualDF, isSameDay as isSameDayDF, parseJSON as parseJSONDF, isBefore as isBeforeDF, isAfter as isAfterDF, startOfDay as startOfDayDF, isSameMonth as isSameMonthDF, } from 'date-fns';\nimport { enGB } from 'date-fns/locale/en-GB';\nimport { nb } from 'date-fns/locale/nb';\nimport { nn } from 'date-fns/locale/nn';\nimport { se } from 'date-fns/locale/se';\nimport LanguageLocales from './constants/languages';\nimport { capitalize as ucfirst } from './string-utils';\n/**\n * Vanlige datoformater brukt pÃ¥ helsenorge.no\n *\n * Eksemplene viser formattert dato med norsk bokmÃ¥l (nb) locale\n */\nexport var DateFormat;\n(function (DateFormat) {\n /** 02:08 */\n DateFormat[\"Time\"] = \"p\";\n /** 09.02.2023 */\n DateFormat[\"ShortDate\"] = \"P\";\n /** 09.02.2023 02:08 */\n DateFormat[\"ShortDateTime\"] = \"Pp\";\n /** 9. feb. 2023 */\n DateFormat[\"MediumDate\"] = \"PP\";\n /** 9. feb. 2023 02:08 */\n DateFormat[\"MediumDateTime\"] = \"PPp\";\n /** 9. februar 2023 */\n DateFormat[\"LongDate\"] = \"PPP\";\n /** 9. februar 2023 kl. 02:08 */\n DateFormat[\"LongDateTime\"] = \"PPPp\";\n /** torsdag 9. februar 2023 kl. 02:08 */\n DateFormat[\"LongDateWeekdayTime\"] = \"PPPPp\";\n /** feb. 2023 */\n DateFormat[\"ShortMonthYear\"] = \"MMM yyyy\";\n /** februar 2023 */\n DateFormat[\"MonthYear\"] = \"MMMM yyyy\";\n})(DateFormat || (DateFormat = {}));\n/**\n * Laster date-fns locale for et begrenset utvalg sprÃ¥k.\n */\nexport const loadLocale = (language) => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n setDefaultOptions({ locale: nb });\n break;\n case LanguageLocales.NORWEGIAN_NYNORSK:\n setDefaultOptions({ locale: nn });\n break;\n case LanguageLocales.ENGLISH:\n setDefaultOptions({ locale: enGB });\n break;\n case LanguageLocales.SAMI_NORTHERN:\n setDefaultOptions({ locale: se });\n break;\n }\n};\n/**\n * Returnerer date-fns locale for et begrenset utvalg sprÃ¥k.\n */\nexport const getLocale = (language) => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n return nb;\n case LanguageLocales.NORWEGIAN_NYNORSK:\n return nn;\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.SAMI_NORTHERN:\n return se;\n default:\n return nb;\n }\n};\n/**\n * Parser en dato-streng til en gyldig Date.\n *\n * @param date Dato som skal parses\n * @returns En gyldig Date, eller undefined hvis dato ikke kan parses\n */\nexport const safeParseJSON = (date) => {\n if (!date) {\n return;\n }\n if (date instanceof Date && isNaN(date.getTime())) {\n return;\n }\n if (date instanceof Date) {\n return date;\n }\n const _date = parseJSONDF(date);\n if (isNaN(_date.getTime())) {\n return;\n }\n return _date;\n};\n/**\n * Konverterer en Date til Central European Time (tidssonen i Norge).\n * Merk at datoer i JS ikke inneholder informasjon om tidssone.\n * Denne funksjonen endrer datoen slik at den vises som norsk tid selv\n * om brukerens datamaskin er stilt inn pÃ¥ en annen tidssone.\n *\n * @param date Dato som skal konverteres til CET\n * @returns Dato justert slik at den vises som norsk tid selv om brukerens\n * datamaskin er stilt inn pÃ¥ en annen tidssone.\n */\nexport const toCentralEuropeanTime = (date) => {\n const cetDate = new Date(date.toLocaleString('en-US', {\n timeZone: 'CET',\n }));\n return isNaN(cetDate.getTime()) ? date : cetDate;\n};\n/**\n * Konverterer dato til CET og formatterer den\n *\n * @param date Dato\n * @param formatStr Format\n * @param options Innstillinger for formattering\n * @returns Formattert dato\n */\nexport const formatCET = (date, formatStr, options) => formatDF(toCentralEuropeanTime(date), formatStr, options);\n/**\n * Parser en dato med safeParseJSON og formatterer datoen dersom den er gyldig.\n * Dersom datoen ikke er gyldig, returneres tom streng.\n *\n * @param date Dato som skal parses\n * @param formatStr Datoformat\n * @returns Formattert dato, eller tom streng\n */\nexport const safeFormatCET = (date, formatStr) => {\n const _date = safeParseJSON(date);\n if (!_date) {\n return '';\n }\n return formatCET(_date, formatStr);\n};\n/**\n * Formatterer dato som:\n * 22. mai 2020 kl. 09:05\n *\n * @param a - Dato som skal formatteres\n */\nexport const longDateTime = (date) => formatDF(date, DateFormat.LongDateTime);\n/**\n * Formatterer dato som:\n * 22. mai 2020 eller 22. mai 2020 kl. 09:05\n *\n * @param a - Dato som skal formatteres\n */\nexport const longDate = (date) => {\n const startOfDay = startOfDayDF(date);\n return isEqualDF(date, startOfDay) ? formatDF(date, DateFormat.LongDate) : formatDF(date, DateFormat.LongDateTime);\n};\n/**\n * Formatterer dato som:\n * fredag 22. mai 2020 kl. 09:05\n *\n * @param date Dato som skal formatteres\n */\nexport const longDateNumbersClock = (date) => formatDF(date, DateFormat.LongDateWeekdayTime);\n/**\n * Formatterer dato som:\n * 22. mai 2020 09:05\n *\n * @param date Dato som skal formatteres\n */\nexport const mediumDate = (date) => formatDF(date, DateFormat.MediumDateTime);\n/**\n * Formatterer dato som:\n * 22.05.2020 09:05\n *\n * @param date Dato som skal formatteres\n */\nexport const mediumDateNumbers = (date) => formatDF(date, DateFormat.ShortDateTime);\n/**\n * Formatterer dato som:\n * 5. nov. 2020\n *\n * @param date Dato som skal formatteres\n */\nexport const shortDate = (date) => formatDF(date, DateFormat.MediumDate);\n/**\n * Formatterer dato som:\n * 5. november 2020\n *\n * @param date Dato som skal formatteres\n */\nexport const shortDateFullMonth = (date) => formatDF(date, DateFormat.LongDate);\n/**\n * Formatterer dato som:\n * 05.11.2020\n *\n * @param date Dato som skal formatteres\n */\nexport const shortDateNumbers = (date) => formatDF(date, DateFormat.ShortDate);\n/**\n * Formatterer tidspunkt som tom streng hvis tiden er midnatt, eller som:\n * 09:08\n *\n * @param date Dato som skal sjekkes\n * @param prefix - Tekst før formattert dato\n */\nexport const timeOfDay = (start, prefix = '') => {\n let value = '';\n const startOfDay = startOfDayDF(start);\n if (!isEqualDF(start, startOfDay)) {\n value = prefix + formatDF(start, DateFormat.Time);\n }\n return value;\n};\n/**\n * Formatterer dato som:\n * November 2020\n *\n * @param date Dato som skal formatteres\n */\nexport const monthYear = (date) => ucfirst(formatDF(date, DateFormat.MonthYear));\n/**\n * Formatterer dato som:\n * Nov 2020\n *\n * @param date Dato som skal formatteres\n */\nexport const shortMonthYear = (date) => ucfirst(formatDF(date, DateFormat.ShortMonthYear).replace('.', ''));\n/**\n * Formatterer to datoer som:\n * Mai 2020 – August 2020\n *\n * @param start Startdato\n * @param end Sluttdato\n */\nexport const monthRange = (start, end) => {\n let range;\n if (isSameMonthDF(start, end)) {\n range = ucfirst(formatDF(start, DateFormat.MonthYear));\n }\n else {\n range =\n ucfirst(formatDF(start, DateFormat.MonthYear)) +\n String.fromCharCode(160) +\n String.fromCharCode(8211) +\n String.fromCharCode(160) +\n ucfirst(formatDF(end, DateFormat.MonthYear));\n }\n return range;\n};\n/**\n * Formatterer to datoer som:\n * 22. mai 2020, mellom kl. 08:32 og 12:54\n * Forutsetter at begge tidspunktene er pÃ¥ samme dag\n *\n * @param start Startdato\n * @param end Sluttdato\n * @param betweenText \", mellom kl. \"\n * @param andText \"og\"\n */\nexport const timeRangeBetween = (start, end, between = ', mellom kl. ', andText = ' og ') => {\n let range;\n if (isEqualDF(start, end)) {\n range = formatDF(start, DateFormat.LongDateTime);\n }\n else {\n range = formatDF(start, DateFormat.MediumDate) + between + formatDF(start, DateFormat.Time) + andText + formatDF(end, DateFormat.Time);\n }\n return range;\n};\n/**\n * Formatterer to datoer som:\n * 22. mai 2020 kl. 08:32 - 12:54\n * Forutsetter at begge tidspunktene er pÃ¥ samme dag\n *\n * @param start Startdato\n * @param end Sluttdato\n */\nexport const timeRange = (start, end) => {\n let range;\n if (isEqualDF(start, end)) {\n range = formatDF(start, DateFormat.LongDateTime);\n }\n else {\n range = formatDF(start, DateFormat.LongDateTime) + ' - ' + formatDF(end, DateFormat.Time);\n }\n return range;\n};\n/**\n * Formatterer to datoer som:\n * Fredag 22. mai 2020 kl. 08:32 - 12:54\n * Forutsetter at begge tidspunktene er pÃ¥ samme dag\n *\n * @param start Startdato\n * @param end Sluttdato\n */\nexport const longTimeRange = (start, end) => {\n let range = formatDF(start, DateFormat.LongDateWeekdayTime);\n if (end) {\n range = range + ' - ' + formatDF(end, DateFormat.Time);\n }\n return ucfirst(range);\n};\n/**\n * Returnerer true hvis dato a er før dato b\n * @param a Dato som skal sammenlignes\n * @param b Dato som skal sammenlignes\n */\nexport const isBeforeDay = (a, b) => isBeforeDF(a.setHours(0, 0, 0, 0), b.setHours(0, 0, 0, 0));\n/**\n * Returnerer true hvis dato a er etter dato b\n * @param a Dato som skal sammenlignes\n * @param b Dato som skal sammenlignes\n */\nexport const isAfterDay = (a, b) => isAfterDF(a.setHours(0, 0, 0, 0), b.setHours(0, 0, 0, 0));\n/**\n * Returnerer true hvis dato a er pÃ¥ samme dag eller etter dato b\n * @param a Dato som skal sammenlignes\n * @param b Dato som skal sammenlignes\n */\nexport const isInclusivelyAfterDay = (a, b) => isSameDayDF(a, b) || isAfterDay(a, b);\n/**\n * Returnerer true hvis input (inkludert minutter) er etter nÃ¥tid\n * @param date Dato som skal sammenlignes\n */\nexport const isAfter = (date) => isAfterDF(date, new Date());\n/**\n * Returnerer true hvis input er etter dagens dato\n * Forskjell med 'isAfter' er at denne tar utgangspunkt i dager\n * @param date Dato som skal sammenlignes\n */\nexport const isAfterToday = (date) => isAfterDF(date.setHours(0, 0, 0, 0), new Date().setHours(0, 0, 0, 0));\n/**\n * Sammenligner to datoer og returnerer true hvis den første datoen er etter den andre (fungerer ogsÃ¥ med tid)\n * @param a - Date\n * @param max - maksimum dato grense\n */\nexport const isAfterMaxDate = (a, b) => !!b && isAfterDF(a, b);\n/**\n * Returnerer true hvis dato a er pÃ¥ samme dag eller før dato b\n * @param a Dato som skal sammenlignes\n * @param b Dato som skal sammenlignes\n */\nexport const isInclusivelyBeforeDay = (a, b) => isSameDayDF(a, b) || isBeforeDay(a, b);\n/**\n * Returnerer true hvis input (inkludert minutter) er før nÃ¥tid\n * @param date Dato som skal sammenlignes\n */\nexport const isBefore = (date) => isBeforeDF(date, new Date());\n/**\n * Returnerer true hvis input er før dagens dato\n * Forskjell med 'isBefore' er at denne tar utgangspunkt i dager\n * @param date Dato som skal sammenlignes\n */\nexport const isBeforeToday = (date) => isBeforeDF(date.setHours(0, 0, 0, 0), new Date().setHours(0, 0, 0, 0));\n/**\n * Sammenligner to datoer og returnerer true hvis den første datoen er før den andre (fungerer ogsÃ¥ med tid)\n * @param date - Date\n * @param min - minimum dato grense\n */\nexport const isBeforeMinDate = (a, b) => !!b && isBeforeDF(a, b);\n/**\n * Returnerer true hvis input er dagens dato og tid er tidligere enn nÃ¥tid\n * @param date Dato som skal sammenlignes\n */\nexport const isEarlierToday = (date) => {\n const now = new Date();\n return isSameDayDF(date, now) && isBeforeDF(date, now);\n};\n/**\n * Returnerer true hvis input er lik 0001-01-01T00:00:00\n * @param date Dato som skal sammenlignes\n */\nexport const isDotNetMinDate = (date) => isEqualDF(date, new Date('0001-01-01T00:00:00'));\n","import { getHostnameWithoutSubdomain } from './cookie';\nexport const __cookieOptions__ = { secure: 'secure' };\n/**\n * Returnerer domene og path for bruk i cookie som skal gjelde pÃ¥ tvers av Ã¥pne sider og tjenester\n * @returns domain og path for bruk i cookie\n */\nexport const getCookieDomainAndPath = () => `domain=${getHostnameWithoutSubdomain()}; path=/;`;\n/**\n * Lagrer cookie pÃ¥ tvers av Ã¥pne sider og tjenester\n * @param name navn pÃ¥ cookie\n * @param value verdi pÃ¥ cookie\n * @param maxAgeInDays levetid pÃ¥ cookie i dager\n */\nexport const setSharedCookie = (name, value, maxAgeInDays = 365) => {\n const maxAgeInSeconds = maxAgeInDays * 24 * 60 * 60;\n document.cookie = `${name}=${value}; ${getCookieDomainAndPath()} max-age=${maxAgeInSeconds}; ${__cookieOptions__.secure}`;\n};\n/**\n * Sletter cookie pÃ¥ tvers av Ã¥pne sider og tjenester\n * @param name navn pÃ¥ cookie\n */\nexport const deleteSharedCookie = (name) => {\n document.cookie = `${name}=; ${getCookieDomainAndPath()} expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n};\n","export var HeaderFooterEvents;\n(function (HeaderFooterEvents) {\n HeaderFooterEvents[\"setlistenerready\"] = \"hn-webcomp-header-footer-event-setlistenerready\";\n HeaderFooterEvents[\"setfirsttimelogin\"] = \"hn-webcomp-header-footer-event-setfirsttimelogin\";\n HeaderFooterEvents[\"setanonymousheader\"] = \"hn-webcomp-header-footer-event-setanonymousheader\";\n HeaderFooterEvents[\"sethiddenheader\"] = \"hn-webcomp-header-footer-event-sethiddenheader\";\n HeaderFooterEvents[\"setdriftsmeldingpath\"] = \"hn-webcomp-header-footer-event-setdriftsmeldingpath\";\n HeaderFooterEvents[\"sethiddenfooter\"] = \"hn-webcomp-header-footer-event-sethiddenfooter\";\n HeaderFooterEvents[\"setnomarginfooter\"] = \"hn-webcomp-header-footer-event-setnomarginfooter\";\n HeaderFooterEvents[\"setvarslinger\"] = \"hn-webcomp-header-footer-event-setvarslinger\";\n HeaderFooterEvents[\"refreshvarslinger\"] = \"hn-webcomp-header-footer-event-refreshvarslinger\";\n HeaderFooterEvents[\"setonshowsignoutbox\"] = \"hn-webcomp-header-footer-event-setonshowsignoutbox\";\n HeaderFooterEvents[\"setredirectto\"] = \"hn-webcomp-header-footer-event-setredirectto\";\n HeaderFooterEvents[\"setredirecttourlafterlogin\"] = \"hn-webcomp-header-footer-event-setredirecttourlafterlogin\";\n HeaderFooterEvents[\"setloginredirecturl\"] = \"hn-webcomp-header-footer-event-setloginredirecturl\";\n HeaderFooterEvents[\"setpersonvelgerredirecturl\"] = \"hn-webcomp-header-footer-event-setpersonvelgerredirecturl\";\n HeaderFooterEvents[\"setnavigate\"] = \"hn-webcomp-header-footer-event-setnavigate\";\n HeaderFooterEvents[\"setlocation\"] = \"hn-webcomp-header-footer-event-setlocation\";\n HeaderFooterEvents[\"setuserloading\"] = \"hn-webcomp-header-footer-event-setuserloading\";\n HeaderFooterEvents[\"setvispersonvelger\"] = \"hn-webcomp-header-footer-event-setvispersonvelger\";\n HeaderFooterEvents[\"setsurveys\"] = \"hn-webcomp-header-footer-event-setsurveys\";\n HeaderFooterEvents[\"setfooterdata\"] = \"hn-webcomp-header-footer-event-setfooterdata\";\n HeaderFooterEvents[\"soonautosignout\"] = \"hn-webcomp-header-footer-event-soonautosignout\";\n HeaderFooterEvents[\"showappinvitation\"] = \"hn-webcomp-header-footer-event-showappinvitation\";\n})(HeaderFooterEvents || (HeaderFooterEvents = {}));\nexport var CmsBlocksEvents;\n(function (CmsBlocksEvents) {\n CmsBlocksEvents[\"setHiddenPromopanel\"] = \"hn-webcomp-cms-blocks-event-sethiddenpromopanel\";\n})(CmsBlocksEvents || (CmsBlocksEvents = {}));\nexport var CommonEvents;\n(function (CommonEvents) {\n CommonEvents[\"isMounted\"] = \"hn-webcomp-common-ismounted\";\n CommonEvents[\"setLanguage\"] = \"hn-language-event-set-language\";\n CommonEvents[\"attemptNavigation\"] = \"hn-pending-changes-attempt-navigation\";\n})(CommonEvents || (CommonEvents = {}));\nexport var WebComponents;\n(function (WebComponents) {\n WebComponents[\"Promopanel\"] = \"hn-webcomp-cms-block-promopanel\";\n})(WebComponents || (WebComponents = {}));\nexport var StepEvents;\n(function (StepEvents) {\n StepEvents[\"Navigate\"] = \"hn-step-navigate\";\n StepEvents[\"SendFromWebComponent\"] = \"hn-step-send-from-web-component\";\n})(StepEvents || (StepEvents = {}));\n","/* FULLMAKT OG SAMTYKKE */\nexport var SamtykkeType;\n(function (SamtykkeType) {\n SamtykkeType[SamtykkeType[\"None\"] = 0] = \"None\";\n SamtykkeType[SamtykkeType[\"Pha\"] = 1] = \"Pha\";\n SamtykkeType[SamtykkeType[\"Bruksvilkar\"] = 2] = \"Bruksvilkar\";\n SamtykkeType[SamtykkeType[\"RefusjonPasientreiser\"] = 3] = \"RefusjonPasientreiser\";\n SamtykkeType[SamtykkeType[\"UngdomsLosning\"] = 4] = \"UngdomsLosning\";\n})(SamtykkeType || (SamtykkeType = {}));\nexport var SamtykkeLevel;\n(function (SamtykkeLevel) {\n SamtykkeLevel[SamtykkeLevel[\"None\"] = 0] = \"None\";\n SamtykkeLevel[SamtykkeLevel[\"Registerinnsyn\"] = 1] = \"Registerinnsyn\";\n SamtykkeLevel[SamtykkeLevel[\"Journalinnsyn\"] = 2] = \"Journalinnsyn\";\n SamtykkeLevel[SamtykkeLevel[\"Helsetjeneste\"] = 3] = \"Helsetjeneste\";\n})(SamtykkeLevel || (SamtykkeLevel = {}));\nexport var FullmaktType;\n(function (FullmaktType) {\n FullmaktType[FullmaktType[\"OrdinaerFullmakt\"] = 3] = \"OrdinaerFullmakt\";\n FullmaktType[FullmaktType[\"BekreftetFullmakt\"] = 4] = \"BekreftetFullmakt\";\n FullmaktType[FullmaktType[\"UtenSamtykkekompenanseOver12\"] = 7] = \"UtenSamtykkekompenanseOver12\";\n})(FullmaktType || (FullmaktType = {}));\nexport var SamtykkeStatusType;\n(function (SamtykkeStatusType) {\n SamtykkeStatusType[SamtykkeStatusType[\"Samtykket\"] = 0] = \"Samtykket\";\n SamtykkeStatusType[SamtykkeStatusType[\"Trukket\"] = 1] = \"Trukket\";\n SamtykkeStatusType[SamtykkeStatusType[\"Utsatt\"] = 2] = \"Utsatt\";\n})(SamtykkeStatusType || (SamtykkeStatusType = {}));\n/**\n * Representasjoner, samtykke og personverninnstillinger\n */\nexport var RepresentasjonforholdType;\n(function (RepresentasjonforholdType) {\n RepresentasjonforholdType[RepresentasjonforholdType[\"InnloggetBruker\"] = 0] = \"InnloggetBruker\";\n RepresentasjonforholdType[RepresentasjonforholdType[\"Fullmakt\"] = 1] = \"Fullmakt\";\n RepresentasjonforholdType[RepresentasjonforholdType[\"Foreldrerepresentasjon\"] = 2] = \"Foreldrerepresentasjon\";\n RepresentasjonforholdType[RepresentasjonforholdType[\"Saksbehandler\"] = 3] = \"Saksbehandler\";\n RepresentasjonforholdType[RepresentasjonforholdType[\"SaksbehandlerFullmakt\"] = 4] = \"SaksbehandlerFullmakt\";\n})(RepresentasjonforholdType || (RepresentasjonforholdType = {}));\nexport var StatusKodeType;\n(function (StatusKodeType) {\n StatusKodeType[StatusKodeType[\"Reservert\"] = 1] = \"Reservert\";\n StatusKodeType[StatusKodeType[\"IkkeReservert\"] = 2] = \"IkkeReservert\";\n StatusKodeType[StatusKodeType[\"Samtykket\"] = 3] = \"Samtykket\";\n StatusKodeType[StatusKodeType[\"IkkeSamtykket\"] = 4] = \"IkkeSamtykket\";\n StatusKodeType[StatusKodeType[\"TilgangsbegrensningOpprettet\"] = 5] = \"TilgangsbegrensningOpprettet\";\n StatusKodeType[StatusKodeType[\"TilgangsbegrensningFjernet\"] = 6] = \"TilgangsbegrensningFjernet\";\n StatusKodeType[StatusKodeType[\"AnmodningTilbakeTrekkingSamtykke\"] = 7] = \"AnmodningTilbakeTrekkingSamtykke\";\n})(StatusKodeType || (StatusKodeType = {}));\nexport var SessionTimeoutAction;\n(function (SessionTimeoutAction) {\n SessionTimeoutAction[SessionTimeoutAction[\"Default\"] = 0] = \"Default\";\n SessionTimeoutAction[SessionTimeoutAction[\"RequestExtension\"] = 1] = \"RequestExtension\";\n SessionTimeoutAction[SessionTimeoutAction[\"RequestLogout\"] = 2] = \"RequestLogout\";\n})(SessionTimeoutAction || (SessionTimeoutAction = {}));\nexport var PersonverninnstillingKategori;\n(function (PersonverninnstillingKategori) {\n PersonverninnstillingKategori[PersonverninnstillingKategori[\"Samtykke\"] = 1] = \"Samtykke\";\n PersonverninnstillingKategori[PersonverninnstillingKategori[\"Reservasjon\"] = 2] = \"Reservasjon\";\n PersonverninnstillingKategori[PersonverninnstillingKategori[\"Tilgangsbegrensning\"] = 3] = \"Tilgangsbegrensning\";\n})(PersonverninnstillingKategori || (PersonverninnstillingKategori = {}));\nexport var TjenesteTilgangStatus;\n(function (TjenesteTilgangStatus) {\n TjenesteTilgangStatus[TjenesteTilgangStatus[\"None\"] = 0] = \"None\";\n TjenesteTilgangStatus[TjenesteTilgangStatus[\"Ja\"] = 1] = \"Ja\";\n TjenesteTilgangStatus[TjenesteTilgangStatus[\"Nei\"] = 2] = \"Nei\";\n TjenesteTilgangStatus[TjenesteTilgangStatus[\"VetIkke\"] = 3] = \"VetIkke\";\n})(TjenesteTilgangStatus || (TjenesteTilgangStatus = {}));\nexport var Personverninnstilling;\n(function (Personverninnstilling) {\n Personverninnstilling[\"SamtykkeDigitalHelsetjeneste\"] = \"fb640456-ae6f-4664-92c8-c6739d76caec\";\n Personverninnstilling[\"SamtykkeJournalinnsyn\"] = \"dc5b5d14-deed-48e5-bf6d-99ed77f08a09\";\n Personverninnstilling[\"SamtykkeRegisterinnsyn\"] = \"6ea1aa04-fad7-48c8-8432-1acb3fbf6d7b\";\n})(Personverninnstilling || (Personverninnstilling = {}));\nexport class TjenesteType {\n}\nObject.defineProperty(TjenesteType, \"TekniskTjeneste\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -1\n});\nObject.defineProperty(TjenesteType, \"IkkeInnloggetTjeneste\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 0\n});\nObject.defineProperty(TjenesteType, \"Timeavtaler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 1\n});\nObject.defineProperty(TjenesteType, \"Fastlegetjenester\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 6\n});\nObject.defineProperty(TjenesteType, \"Legemidler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 7\n});\nObject.defineProperty(TjenesteType, \"PersonligHelsearkiv\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 8\n});\nObject.defineProperty(TjenesteType, \"Fastlegevisning\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 9\n});\nObject.defineProperty(TjenesteType, \"InnsynPasientjournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 10\n});\nObject.defineProperty(TjenesteType, \"InnsynKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 11\n});\nObject.defineProperty(TjenesteType, \"Egenandeler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 12\n});\nObject.defineProperty(TjenesteType, \"Profil\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 13\n});\nObject.defineProperty(TjenesteType, \"MinHelseForside\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 15\n});\nObject.defineProperty(TjenesteType, \"EksterneTjenester\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 16\n});\nObject.defineProperty(TjenesteType, \"Henvisninger\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 17\n});\nObject.defineProperty(TjenesteType, \"Pasientreiser\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 18\n});\nObject.defineProperty(TjenesteType, \"Forlopskoordinator\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 19\n});\nObject.defineProperty(TjenesteType, \"Meldinger\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 20\n});\nObject.defineProperty(TjenesteType, \"ByttFastlege\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 21\n});\nObject.defineProperty(TjenesteType, \"DialogForlop\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 22\n});\nObject.defineProperty(TjenesteType, \"DialogHelsehjelp\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 23\n});\nObject.defineProperty(TjenesteType, \"Fullmaktsadministrasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 24\n});\nObject.defineProperty(TjenesteType, \"Helsekontakter\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 25\n});\nObject.defineProperty(TjenesteType, \"DialogOkonomi\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 26\n});\nObject.defineProperty(TjenesteType, \"Beslutningsstotte\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 27\n});\nObject.defineProperty(TjenesteType, \"DialogInnsyn\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 28\n});\nObject.defineProperty(TjenesteType, \"DialogPersonvern\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 29\n});\nObject.defineProperty(TjenesteType, \"Helseregistre\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 30\n});\nObject.defineProperty(TjenesteType, \"LoggOverBrukAvResepter\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 31\n});\nObject.defineProperty(TjenesteType, \"SykdomOgKritiskInformasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 32\n});\nObject.defineProperty(TjenesteType, \"Forskning\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 33\n});\nObject.defineProperty(TjenesteType, \"MinHelse\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 34\n});\nObject.defineProperty(TjenesteType, \"Timeadministrasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 35\n});\nObject.defineProperty(TjenesteType, \"Foreldresamtykke\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 36\n});\nObject.defineProperty(TjenesteType, \"DialogEgenHelseUngdom\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 37\n});\nObject.defineProperty(TjenesteType, \"KprTjenester\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 38\n});\nObject.defineProperty(TjenesteType, \"Vaksiner\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 39\n});\nObject.defineProperty(TjenesteType, \"LegemidlerLiB\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 40\n});\nObject.defineProperty(TjenesteType, \"InnsynRegisterinnhold\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 41\n});\nObject.defineProperty(TjenesteType, \"InnsynRegisterbruk\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 42\n});\nObject.defineProperty(TjenesteType, \"EKonsultasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 43\n});\nObject.defineProperty(TjenesteType, \"Reseptfornyelse\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 44\n});\nObject.defineProperty(TjenesteType, \"EKontakt\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 45\n});\nObject.defineProperty(TjenesteType, \"Timebestilling\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 46\n});\nObject.defineProperty(TjenesteType, \"KritiskInfo\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 47\n});\nObject.defineProperty(TjenesteType, \"AapneKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 48\n});\nObject.defineProperty(TjenesteType, \"ProfildataOgKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 49\n});\nObject.defineProperty(TjenesteType, \"HelsekontakterIKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 50\n});\nObject.defineProperty(TjenesteType, \"LegemidlerFraKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 51\n});\nObject.defineProperty(TjenesteType, \"ProfildataOgKjernejournalReservasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 52\n});\nObject.defineProperty(TjenesteType, \"PersonopplysningerFraKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 53\n});\nObject.defineProperty(TjenesteType, \"Donorkort\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 54\n});\nObject.defineProperty(TjenesteType, \"Samtykkeforesporsel\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 55\n});\nObject.defineProperty(TjenesteType, \"DialogForlopInformasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 56\n});\nObject.defineProperty(TjenesteType, \"Pasientreiseradministrasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 57\n});\nObject.defineProperty(TjenesteType, \"NyttHelsenorgeSamtykke\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 58\n});\nObject.defineProperty(TjenesteType, \"InngripendeForPersonvern\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 59\n});\nObject.defineProperty(TjenesteType, \"Skjemautfyller\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 60\n});\nObject.defineProperty(TjenesteType, \"SamvalgUtenLagring\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 61\n});\nObject.defineProperty(TjenesteType, \"MeldeFeilIBesokshistorikkKj\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 62\n});\nObject.defineProperty(TjenesteType, \"Verktoy\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 63\n});\nObject.defineProperty(TjenesteType, \"VerktoyUtforelse\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 64\n});\nObject.defineProperty(TjenesteType, \"InnsynRegisterinnholdReseptformidler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 65\n});\nObject.defineProperty(TjenesteType, \"DialogSkjemaRegisterinnsyn\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 66\n});\nObject.defineProperty(TjenesteType, \"DialogSkjemaJournalinnsyn\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 67\n});\nObject.defineProperty(TjenesteType, \"DialogSkjemaHelsetjeneste\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 68\n});\nObject.defineProperty(TjenesteType, \"DialogSkjemaHelsetjenesteStreng\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 69\n});\nObject.defineProperty(TjenesteType, \"RegisterinnsynNasjonaleKvalitetsregister\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 70\n});\nObject.defineProperty(TjenesteType, \"ReiserMedRekvisisjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 71\n});\n/* CMS-CONTENT-API-SERVICE */\nexport var CmsContentApiVersions;\n(function (CmsContentApiVersions) {\n CmsContentApiVersions[\"V1\"] = \"v1/\";\n CmsContentApiVersions[\"V2\"] = \"v2/\";\n})(CmsContentApiVersions || (CmsContentApiVersions = {}));\n","import { getIdentityProvider, IdentityProvider } from './cookie';\nimport { FullmaktType } from './types/entities';\n/**\n * Returnerer verdien satt pÃ¥ HN User LastLogOn\n */\nexport const getSistPalogget = () => {\n return window.HN?.User?.SistPalogget;\n};\n/**\n * Returnerer verdien satt pÃ¥ HN User Name\n */\nexport const getInnloggetFulltNavn = () => {\n return window.HN?.User?.InnloggetFulltNavn;\n};\n/**\n * Returnerer verdien satt pÃ¥ HN User FirstName\n */\nexport const getInnloggetFornavn = () => {\n return window.HN?.User?.InnloggetFornavn;\n};\n/**\n * Returnerer verdien satt pÃ¥ HN User RepresentertBruker\n */\nexport const getRepresentertBruker = () => {\n return window.HN?.User?.RepresentertBruker;\n};\n/**\n * Returnerer verdien satt pÃ¥ HN User HasRepresentation\n */\nexport const getHarRepresentasjon = () => {\n return window.HN?.User?.HarRepresentasjon;\n};\n/**\n * Returnerer verdien satt pÃ¥ HN User VisPersonvelger\n */\nexport const getVisPersonvelger = () => {\n return window.HN?.User?.VisPersonvelger;\n};\n/**\n * Setter verdien til HN User VisPersonvelger\n */\nexport const setVisPersonvelger = (visPersonvelger) => {\n window.HN = window.HN || {};\n window.HN.User = window.HN.User || {};\n window.HN.User.VisPersonvelger = visPersonvelger;\n};\n/**\n * Returnerer verdien satt pÃ¥ HN User ErRepresentasjon\n */\nexport const getErRepresentasjon = () => {\n return window.HN?.User?.ErRepresentasjon;\n};\n/**\n * Returnerer true nÃ¥r innnbygger representerer en annen via fullmakt\n */\nexport const getErRepresentasjonViaFullmakt = () => getErRepresentasjon() === true && window.HN?.User?.FullmaktEgenskaper !== null;\n/**\n * Returnerer true nÃ¥r innnbygger representerer en annen de har foreldreansvar for\n */\nexport const getErRepresentasjonMedForeldreansvar = () => getErRepresentasjon() === true && window.HN?.User?.ForeldreansvarEgenskaper !== null;\n/**\n * Returnerer verdien satt pÃ¥ HN User SamtykkekonverteringInformert\n */\nexport const getSamtykkekonverteringInformert = () => {\n return window.HN?.User?.SamtykkekonverteringInformert;\n};\n/**\n * Returnerer verdien satt pÃ¥ HN User ErMellom12Og16\n */\nexport const getErMellom12Og16 = () => {\n return window.HN?.User?.ErMellom12Og16;\n};\n/**\n * Returnerer verdien satt pÃ¥ HN User RequiredSamtykkeLevel\n */\nexport const getRequiredSamtykkeLevel = () => {\n return window.HN?.User?.RequiredSamtykkeLevel;\n};\n/**\n * Bestemmer om bruker kan navigere vekk fra siden, uten Ã¥ mÃ¥tte bekrefte først\n */\nexport const getAllowNavigation = () => {\n return window.HN?.User?.AllowNavigation ?? false;\n};\n/**\n * Bestemmer om bruker kan navigere vekk fra siden, uten Ã¥ mÃ¥tte bekrefte først\n * @param value true dersom navigasjon skal være lov, false dersom bruker mÃ¥ bekrefte eventuelle endringer først\n */\nexport const setAllowNavigation = (value) => {\n window.HN = window.HN || {};\n window.HN.User = window.HN.User || {};\n window.HN.User.AllowNavigation = value;\n};\n/**\n * Returnerer true nÃ¥r FullmaktEgenskaper er analog og ordinær\n */\nexport const getErOrdinaerAnalogFullmakt = () => window.HN?.User?.FullmaktEgenskaper?.FullmaktType === FullmaktType.OrdinaerFullmakt;\n/**\n * Returnerer true nÃ¥r FullmaktEgenskaper er analog og UtenSamtykkekompenanseOver12\n */\nexport const getErIkkeSamtykkeKompetentFullmakt = () => !!window.HN?.User?.FullmaktEgenskaper?.Analog &&\n window.HN?.User?.FullmaktEgenskaper?.FullmaktType === FullmaktType.UtenSamtykkekompenanseOver12;\n/**\n * Returnerer true nÃ¥r bruker er logget inn via helsenorge-app\n */\nexport const getErInnloggetViaHnApp = () => getIdentityProvider() === IdentityProvider.HnApp;\n/**\n * Returnerer true nÃ¥r bruker er logget inn via helsenorge-app for ungdom\n */\nexport const getErInnloggetViaHnAppUngdom = () => getIdentityProvider() === IdentityProvider.HnAppUngdom;\n/**\n * Hent brukerens scopes\n * @returns Liste med scopes fra HN.User.Scopes, eller tom liste\n */\nexport const getScopes = () => {\n return window.HN?.User?.Scopes ?? [];\n};\n/**\n * Sjekk om bruker har scope\n * @param scope Navn pÃ¥ scope i HN.User.Scopes\n * @returns true dersom bruker har scope\n */\nexport const hasScope = (scope) => {\n return getScopes().includes(scope) ?? false;\n};\n/**\n * Sjekk om bruker har innsynssperre\n * @returns true dersom bruker har innsynssperre\n */\nexport const getHarInnsynssperre = () => {\n return window.HN?.User?.HarInnsynssperre;\n};\n/**\n * Sjekk om bruker har reservasjon mot egen bruk av Helsenorge\n * @returns true dersom bruker har reservasjon mot egen bruk av Helsenorge\n */\nexport const getHarReservasjonAktivPaaHelsenorge = () => {\n return window.HN?.User?.HarReservasjonAktivPaaHelsenorge;\n};\n/**\n * Sjekk om bruker har aktivt foreldresamtykke.\n * Denne brukes nÃ¥r en foreldre har samtykket pÃ¥ vegne av barnet at de kan bruke helsenorge selv,\n * og da tilgjengeliggjøres et sett med forhÃ¥ndsdefinerte tjenester.\n * @returns true dersom bruker har foreldresamtykke\n */\nexport const getHarAktivtForeldreSamtykke = () => {\n return window.HN?.User?.HarAktivtForeldreSamtykke;\n};\n/**\n * Hent innbyggers personverninnstillinger\n * @returns Liste med guids fra HN.User.AktiveUtvalgtePersonverninnstillinger, eller tom liste\n */\nexport const getPersonverninnstillinger = () => {\n return window.HN?.User?.AktiveUtvalgtePersonverninnstillinger ?? [];\n};\n/**\n * Sjekk om bruker har personverninnstilling\n * @param guid Guid i HN.User.AktiveUtvalgtePersonverninnstillinger\n * @returns true dersom bruker har personverninnstilling\n */\nexport const hasPersonverninnstilling = (guid) => {\n return getPersonverninnstillinger().includes(guid) ?? false;\n};\n","import { useEffect } from 'react';\nimport { HeaderFooterEvents, CmsBlocksEvents, CommonEvents, WebComponents, StepEvents } from './constants';\nimport { setAllowNavigation, setVisPersonvelger } from '../hn-user';\nconst dispatchCustomEvent = (selector, eventType, detail) => {\n const element = document.querySelector(selector);\n if (element?.dispatchEvent) {\n element.dispatchEvent(new CustomEvent(eventType, {\n cancelable: true,\n detail,\n }));\n }\n};\nexport const HNeventSetFirstTimeLogin = (isFirstTime = true) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setfirsttimelogin, { firstTimeLogin: isFirstTime });\nexport const HNeventSetAnonymousHeader = (isAnonymous = true) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setanonymousheader, { anonymousHeader: isAnonymous });\nexport const HNeventSetHiddenHeader = (isHidden = true) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.sethiddenheader, { hiddenHeader: isHidden });\nexport const HNeventSetHiddenFooter = (isHidden = true) => dispatchCustomEvent('hn-webcomp-footer', HeaderFooterEvents.sethiddenfooter, {\n hiddenFooter: isHidden,\n});\nexport const HNeventSetNoMarginFooter = (noMargin = true) => dispatchCustomEvent('hn-webcomp-footer', HeaderFooterEvents.setnomarginfooter, {\n noMarginFooter: noMargin,\n});\nexport const HNeventRefreshVarslinger = () => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.refreshvarslinger, {});\nexport const HNeventSetDriftsmeldingPath = (path) => dispatchCustomEvent('hn-webcomp-driftspanel', HeaderFooterEvents.setdriftsmeldingpath, { path });\nexport const HNeventSetOnShowSignoutbox = (fn) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setonshowsignoutbox, { onShowSignOutBox: fn });\nexport const HNeventSetUserLoading = (userLoading) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setuserloading, { userLoading });\nexport const HNeventSoonAutoSignOut = () => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.soonautosignout, {});\nexport const HNeventShowAppInvitation = (onAppOpen, onWebLogin, onClose) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.showappinvitation, { onAppOpen, onWebLogin, onClose });\nexport const HNeventSetRedirectTo = (redirectTo) => dispatchCustomEvent('hn-webcomp-personvelger', HeaderFooterEvents.setredirectto, { redirectTo });\nexport const HNeventSetRedirectToUrlAfterLogin = (redirectToUrlAfterLogin) => dispatchCustomEvent('hn-webcomp-personvelger', HeaderFooterEvents.setredirecttourlafterlogin, {\n redirectToUrlAfterLogin,\n});\n/**\n * Bestemmer hvilken URL man skal redirecte til etter Ã¥ klikket pÃ¥ Logg inn-knappen i header\n *\n * @param redirectUrl URL som skal redirectes til\n */\nexport const HNeventSetLoginRedirectUrl = (redirectUrl) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setloginredirecturl, { redirectUrl });\n/**\n * Bestemmer hvilken URL man skal redirecte til etter Ã¥ byttet representasjon via personvelgeren i header\n *\n * @param redirectUrl URL som skal redirectes til\n */\nexport const HNeventSetPersonvelgerRedirectUrl = (redirectUrl) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setpersonvelgerredirecturl, { redirectUrl });\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const HNeventSetSurveys = (surveys) => dispatchCustomEvent('hn-webcomp-footer', HeaderFooterEvents.setsurveys, { surveys });\nexport const HNeventSetFooterData = (data) => dispatchCustomEvent('hn-webcomp-footer', HeaderFooterEvents.setfooterdata, data);\nexport const HNeventSetVisPersonvelger = (visPersonvelger) => {\n setVisPersonvelger(visPersonvelger);\n window.dispatchEvent(new CustomEvent(HeaderFooterEvents.setvispersonvelger, {\n detail: { visPersonvelger },\n }));\n};\n/**\n * Dispatcher event før forsøk pÃ¥ Ã¥ navigasjon vekk fra siden. Brukes i av webkomponenter (f.eks. header-footer),\n * slik at de kan trigge advarsel i PendingChanges om at navigasjon er i ferd med Ã¥ skje.\n *\n * @returns true dersom bruker godtar navigasjon bort fra siden\n */\nexport const HNeventAttemptNavigation = () => {\n return window.dispatchEvent(new CustomEvent(CommonEvents.attemptNavigation, {\n cancelable: true,\n }));\n};\n/**\n * Lytter etter forsøk pÃ¥ navigasjon vekk fra siden, og viser dialog med advarsel før man eventuelt fÃ¥r gÃ¥ videre.\n *\n * @param message Beskjed til brukeren\n * @param hasChanges Returnerer true dersom navigasjon skal blokkeres\n */\nexport const useAttemptNavigationEvent = (message, hasChanges) => HNaddEventListener(CommonEvents.attemptNavigation, window, (event) => {\n if (hasChanges()) {\n const confirmLeave = window.confirm(message);\n if (!confirmLeave) {\n event.preventDefault();\n return;\n }\n else {\n setAllowNavigation(true);\n }\n }\n});\nexport const HNeventSetHiddenPromopanel = (isHidden) => dispatchCustomEvent(WebComponents.Promopanel, CmsBlocksEvents.setHiddenPromopanel, { hiddenPromopanel: isHidden });\nexport const HNeventIsMicroFrontendMounted = (webcomponentName) => {\n const webcomponent = document.querySelector(webcomponentName);\n if (webcomponent?.dispatchEvent) {\n webcomponent.dispatchEvent(new CustomEvent(CommonEvents.isMounted));\n }\n};\nexport const HNaddEventListener = (event, element, handler, passive = false) => {\n useEffect(() => {\n if (element)\n element.addEventListener(event, handler, passive);\n return function cleanup() {\n if (element)\n element.removeEventListener(event, handler);\n };\n });\n};\nexport const HNeventNavigateStep = (stepId, detail) => dispatchCustomEvent(`#${stepId}`, StepEvents.Navigate, detail);\nexport const HNeventSendFromWebComponent = (stepId, detail) => dispatchCustomEvent(`#${stepId}`, StepEvents.SendFromWebComponent, detail);\n","import LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { getCookieValue } from './cookie';\nimport { setSharedCookie } from './shared-cookies';\nimport { CommonEvents } from './web-component/constants';\nimport { HNaddEventListener } from './web-component/events';\n/**\n * Navn pÃ¥ cookie som brukes til Ã¥ lagre brukerens sprÃ¥k\n */\nconst LANGUAGE_COOKIE_NAME = 'hn-language';\n/**\n * Hvor lang tid cookien varer\n */\nconst LANGUAGE_COOKIE_EXPIRES_IN_DAYS = 1;\n/**\n * Hent brukerens sprÃ¥k fra cookie\n * @returns Valgt sprÃ¥k\n */\nexport const getUserLanguage = () => {\n const language = getCookieValue(LANGUAGE_COOKIE_NAME);\n if (typeof language === 'string' && Object.values(LanguageLocales).includes(language)) {\n return language;\n }\n};\n/**\n * Lagre brukerens sprÃ¥k i cookie og dispatch event for bytte av sprÃ¥k\n * @param language Valgt sprÃ¥k\n */\nexport const setUserLanguage = (language, options) => {\n setSharedCookie(LANGUAGE_COOKIE_NAME, language, LANGUAGE_COOKIE_EXPIRES_IN_DAYS);\n document.dispatchEvent(new CustomEvent(CommonEvents.setLanguage, { detail: { language, options } }));\n};\n/**\n * Lytt pÃ¥ endringer i brukerens sprÃ¥k\n * @param callback Funksjon som kalles nÃ¥r brukeren endrer sprÃ¥k\n */\nexport const useSetUserLanguageEvent = (callback) => HNaddEventListener(CommonEvents.setLanguage, document, event => callback(event.detail.language, event.detail.options));\n/**\n * Hent riktig sprÃ¥kkode for bruk i <html lang=\"xx\">-atributtet\n * @param language Valgt sprÃ¥k\n * @returns ISO 639-1 sprÃ¥kkode https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\n */\nexport const getIsoLanguageName = (language) => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n return 'no';\n case LanguageLocales.NORWEGIAN_NYNORSK:\n return 'nn';\n case LanguageLocales.ENGLISH:\n return 'en';\n case LanguageLocales.LITHUANIAN:\n return 'lt';\n case LanguageLocales.POLISH:\n return 'pl';\n case LanguageLocales.RUSSIAN:\n return 'ru';\n case LanguageLocales.ROMANIAN:\n return 'ro';\n case LanguageLocales.SAMI_NORTHERN:\n return 'se';\n default:\n return undefined;\n }\n};\n/**\n * Oppdater <html lang=\"xx\">-atributtet med valgt sprÃ¥k ihht ISO 639-1-standard. Brukes pÃ¥ tjenester, pÃ¥ Ã¥pne sider settes dette av backend.\n * @param language Valgt sprÃ¥k\n */\nexport const setDocumentLanguage = (language) => {\n const isoLanguage = getIsoLanguageName(language);\n if (isoLanguage) {\n document.documentElement.lang = isoLanguage;\n }\n};\n","import { createAction, createReducer } from '@reduxjs/toolkit';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { loadLocale } from '@helsenorge/core-utils/date-fns-utils';\nimport { getUserLanguage, setDocumentLanguage } from '../hn-language';\nimport { debug, warn } from '../logger';\nexport const selectCurrentLanguage = (state) => state.currentLanguage;\nexport const selectLanguages = (state) => state.allowedLanguages;\nexport const languageChanged = createAction('language/languageChanged');\nexport const allowedLanguagesReplaced = createAction('language/allowedLanguagesReplaced');\n/**\n * Load date-fns locale for the most commonly used languages\n * @param language Language to load date-fns locale for\n\n */\nexport const safeLoadLocale = (language) => {\n if (language === LanguageLocales.NORWEGIAN ||\n language === LanguageLocales.NORWEGIAN_NYNORSK ||\n language === LanguageLocales.ENGLISH ||\n language === LanguageLocales.SAMI_NORTHERN) {\n loadLocale(language);\n }\n else {\n debug(`Language changed to ${language}. You need to load the correct date-fns locale yourself and call setDefaultOptions.`);\n }\n};\nexport const createLanguageReducer = (allowedLanguages = [LanguageLocales.NORWEGIAN]) => {\n const userLanguage = getUserLanguage();\n const initialCurrentLanguage = userLanguage && allowedLanguages.includes(userLanguage) ? userLanguage : allowedLanguages[0];\n const initialState = {\n allowedLanguages,\n currentLanguage: initialCurrentLanguage,\n };\n safeLoadLocale(initialCurrentLanguage);\n setDocumentLanguage(initialCurrentLanguage);\n return createReducer(initialState, builder => {\n builder.addCase(languageChanged, (state, action) => {\n if (state.allowedLanguages.includes(action.payload)) {\n state.currentLanguage = action.payload;\n safeLoadLocale(action.payload);\n setDocumentLanguage(action.payload);\n }\n else {\n warn(`${action.payload} is not a valid language for this service`);\n }\n });\n builder.addCase(allowedLanguagesReplaced, (state, action) => {\n state.allowedLanguages = action.payload;\n if (!action.payload.includes(state.currentLanguage)) {\n state.currentLanguage = action.payload[0];\n }\n });\n });\n};\n/**\n * En intern referanse til standard sprÃ¥k-reducer.\n * Initialiseres først nÃ¥r den faktisk brukes.\n *\n * @todo I V35 kan koden fjernes, og alle vertikalene mÃ¥ kalle createLanguageReducer() selv for Ã¥ forenkle denne koden. Proxy er laget for bakoverkompabilitet i V34.\n */\nlet _defaultLanguageReducer = null;\n/**\n * Henter standard sprÃ¥k-reduceren, og oppretter den hvis den ikke finnes.\n *\n * @returns Reducer for sprÃ¥kstate\n */\nconst getDefaultLanguageReducer = () => {\n if (!_defaultLanguageReducer) {\n _defaultLanguageReducer = createLanguageReducer();\n }\n return _defaultLanguageReducer;\n};\n/**\n * Standard sprÃ¥k-reducer som venter med Ã¥ opprette reduceren til den faktisk brukes.\n *\n * Bruker en Proxy for Ã¥ sikre at reduceren kan brukes som en funksjon.\n * Kaller getDefaultLanguageReducer for Ã¥ hente den faktiske reduceren.\n */\nconst defaultLanguageReducer = new Proxy(function (state, action) {\n return getDefaultLanguageReducer()(state, action);\n}, {\n get: (_, prop) => {\n const reducer = getDefaultLanguageReducer();\n return reducer[prop];\n },\n});\nexport default defaultLanguageReducer;\n","/**\n * Returnerer Debug fra HN objektet\n * @returns true dersom window.HN.Debug er satt\n */\nexport const isDebug = () => {\n return !!window?.HN?.Debug;\n};\n","import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';\nimport { isDebug } from '../hn-debug';\nexport const getResourceKey = (project, language) => JSON.stringify({ project, language });\n/**\n * Returnerer ResourceItem fra resourcesState basert pÃ¥ project og language\n * @param resourcesState - incoming ResourcesState\n * @param project - project string\n * @param language - language string\n */\nexport const getResources = (resourcesState, project, language) => {\n const key = getResourceKey(project, language);\n return key in resourcesState ? resourcesState[key].items : {};\n};\n/**\n * Returnerer ResourceItem fra global Staten basert pÃ¥ project\n * @param state - incoming GlobalStateWithResources\n * @param project - project string\n */\nexport const getResourcesFromState = (state, project) => {\n const key = getResourceKey(project, state.language.currentLanguage);\n const value = state.resources[key];\n return value && value.status === 'succeeded' ? value.items : null;\n};\n/**\n * Returnerer Resource fra global Staten basert pÃ¥ project og language\n * Returnerer ny Resource med default status hvis den ikke finnes\n * @param state - incoming GlobalStateWithResources\n * @param project - project string\n */\nexport const getResourcesObjectFromState = (state, project) => {\n const key = getResourceKey(project, state.language.currentLanguage);\n return key in state.resources ? state.resources[key] : { items: {} };\n};\nexport const getResourceWithId = (json) => {\n return Object.keys(json).reduce((previous, key) => {\n if (typeof json[key] === 'string') {\n previous[key] = json[key] + ' [' + key + ']';\n }\n return previous;\n }, {});\n};\nexport function getModifiedResourcesForTest(resourceText) {\n if (isDebug() && window.document.URL.includes('hjelpetekst=true')) {\n return getResourceWithId(resourceText);\n }\n if (process.env.NODE_ENV === 'test') {\n return Object.keys(resourceText).reduce((previous, key) => {\n previous[key] = key;\n return previous;\n }, {});\n }\n return resourceText;\n}\n/**\n * Returnerer false om resources allerede ligger i staten eller er i ferd med Ã¥ lastes\n * @param state - incoming GlobalStateWithResources\n * @param project - project string\n * @param language - language LanguageLocales\n */\nexport const shouldFetchResources = (state, project, language) => {\n const key = getResourceKey(project, language);\n const resource = state.resources[key];\n return resource?.status !== 'loading' && resource?.status !== 'succeeded';\n};\n/**\n * Hent nye resources basert pÃ¥ project name og language\n */\nexport const fetchResources = createAsyncThunk('resources/fetchResources', async ({ project, language, getResources }, { rejectWithValue }) => {\n try {\n const data = await getResources(project, language);\n return getModifiedResourcesForTest(data);\n }\n catch {\n return rejectWithValue(`Kunne ikke hente resources for ${project} pÃ¥ ${language}`);\n }\n}, {\n condition: ({ project, language }, { getState }) => {\n return shouldFetchResources(getState(), project, language);\n },\n});\nconst initialState = {};\nconst resourcesSlice = createSlice({\n name: 'resources',\n initialState,\n reducers: {},\n extraReducers: builder => {\n builder\n .addCase(fetchResources.pending, (state, action) => {\n const key = getResourceKey(action.meta.arg.project, action.meta.arg.language);\n state[key] = {\n status: 'loading',\n items: null,\n };\n })\n .addCase(fetchResources.fulfilled, (state, action) => {\n const key = getResourceKey(action.meta.arg.project, action.meta.arg.language);\n state[key] = {\n status: 'succeeded',\n items: action.payload,\n };\n })\n .addCase(fetchResources.rejected, (state, action) => {\n const key = getResourceKey(action.meta.arg.project, action.meta.arg.language);\n state[key] = {\n status: 'failed',\n items: null,\n };\n });\n },\n});\nexport default resourcesSlice.reducer;\n","import { useEffect } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { selectCurrentLanguage } from '../language';\nimport { getResourcesFromState, fetchResources } from '.';\n/**\n * Get resources from state or retrieve resources as needed\n * @param project Project name\n * @param getResources Utility for reading resources from file\n * @returns Resource object\n */\nconst useResources = (project, getResources) => {\n const dispatch = useDispatch();\n const resources = useSelector(state => getResourcesFromState(state, project));\n const language = useSelector(state => selectCurrentLanguage(state.language));\n useEffect(() => {\n dispatch(fetchResources({ project, language, getResources }));\n }, [dispatch, project, language]);\n return resources;\n};\nexport default useResources;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst SideSomIkkeFinnesSvg = () => {\n return (_jsx(\"svg\", { \"aria-hidden\": true, role: \"img\", tabIndex: -1, color: \"inherit\", viewBox: \"0 0 544 544\", children: _jsxs(\"g\", { \"data-name\": \"Layer 1\", children: [_jsx(\"path\", { fill: \"#fff\", d: \"M246.79 339.47l23.88 4.5 24.19 10.93 25.44-14.69v36.37l-24.87-13.91-21.69 9.25-26.62 5.83-.33-38.28zM207.77 343.69c-13.18 3-32.46 15.26-32.46 15.26s20.28 12.5 27.78 14.9c8.26 2.64 34.42 4.41 34.42 4.41v-39.1s-22.4 2.84-29.74 4.53z\" }), _jsx(\"path\", { fill: \"#42adc5\", d: \"M365.59 283.77a23.75 23.75 0 1023.76 23.76 23.76 23.76 0 00-23.76-23.76zm.72 36l-13.24-13.23 13.24-13.24 13.23 13.24zM47.43 329.07s26.91 8.53 47.47 25.05 38.84 46 38.84 46v32.34l-19-1-27.87-22.39-21.33-23.21L53 360.47 49.19 346zM363.74 459.58h134.05l-.95 41.78H363.99l-.25-41.78zM96.39 212.49h36.82v17.4H96.39zM143.77 212.49v17.4h17.25l-.47-17.4h-16.78zM170.67 211.98v17.91h36.87v-17.4l-36.87-.51zM218.08 212.49v17.4l19.54-.72v-17.19l-19.54.51zM247.56 212.49v16.31H448.88v-16.31H247.56zM392.85 92.56l-1.68 7.85-8.85 11.83-10.98 4.58h-12.91l-13.18-8.7L340 92.56l2.05-10.53 4.34-8.69 12.04-7.78 11.53-1.18 11.22 4.38 7.32 6.87 3.89 8.46.46 8.47z\" }), _jsx(\"circle\", { fill: \"#1d1d1b\", cx: \"332.41\", cy: \"405.05\", r: \"10.4\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M136.34 176.33h-.14a31.71 31.71 0 01-24.32-15.09 27.43 27.43 0 01-15 4.39c-10.37 0-19.56-5.5-23.87-14.14a20.92 20.92 0 01-9.16 2.1c-10.94 0-19.83-8.27-19.83-18.43s8.89-18.43 19.83-18.43a21.05 21.05 0 014.8.56c3.25-11.89 14.86-20.36 28.23-20.36A30.81 30.81 0 01110.3 100c4.16-8.86 13.64-14.7 24.14-14.7a26.8 26.8 0 0121.5 10.35 27.16 27.16 0 0117.94-6.57c12.7 0 23.51 8.41 25.86 19.82a28.41 28.41 0 016-.65A26.65 26.65 0 01228.29 120a1.5 1.5 0 11-2.5 1.65 23.7 23.7 0 00-20-10.4 25.41 25.41 0 00-6.83.94 1.48 1.48 0 01-1.23-.19 1.47 1.47 0 01-.66-1.06c-1.41-10.75-11.37-18.86-23.17-18.86A24.07 24.07 0 00156.76 99a1.49 1.49 0 01-2.31-.24 23.67 23.67 0 00-20-10.44c-9.86 0-18.7 5.75-22 14.32a1.49 1.49 0 01-2.12.77 27.77 27.77 0 00-13.49-3.48c-12.53 0-23.32 8.21-25.66 19.52a1.53 1.53 0 01-.71 1 1.56 1.56 0 01-1.21.14 17.87 17.87 0 00-5.45-.85c-9.28 0-16.83 6.92-16.83 15.43s7.55 15.43 16.83 15.43a17.8 17.8 0 009.09-2.47 1.5 1.5 0 012.15.72c3.44 8.25 12.2 13.79 21.79 13.79a24.35 24.35 0 0014.67-4.78 1.49 1.49 0 012.23.53c4.19 8.28 12.91 14 22.76 15a1.5 1.5 0 01-.15 3z\" }), _jsx(\"path\", { fill: \"#42adc5\", d: \"M449.24 413.89A27.62 27.62 0 00472.93 398a22.92 22.92 0 0035.78-9.64 16.94 16.94 0 103.65-30.27A25.48 25.48 0 00474.17 341a22.94 22.94 0 00-24.93-15M133.74 432.43h9.63V480s.07 6.75-4.91 7-4.72-7-4.72-7zM161 432.43h9.09V480s-.13 6.79-4.83 7-4.26-7-4.26-7zM208.13 432.43h9.36V480c0 .15 0 6.5-4.38 6.73-5.84.29-5-6.73-5-6.73zM238 432.43h8.76c0 28.46-.07 47.56-.07 47.56s-.54 6.2-3.92 6c-4.88-.28-4.77-6-4.77-6zM296.52 101.08c-6.77-6.23-13.8-31.74-31.39-4.09s-18.95 81-18.41 88.79c.1 1.36.16 11.07.2 26.2H238v-8.44s1.22-14.18-8.91-14.18-11.63 15.45-11.63 15.45V212h-9.36v-6.86s.46-12.63-15-12.22-23 9.68-23 13.9V212H161v-4.86s-.47-9.67-9.16-9.18-8.49 9.45-8.49 9.45V212h-9.63v-4.31s-.06-41.11 12.84-53.13c20.11-18.72 68.57-2.75 76.37-21.53s21.76-66.32 60-72.26c8-1.24 23.56 6.5 30 27.07s-9.64 19.47-16.41 13.24z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M95.47 283.49A160.37 160.37 0 0043.57 302L9.45 282.27v49.19l34.06-19.66a141.64 141.64 0 0051.72 18.89M277.79 213.48h-30.23a1.5 1.5 0 010-3h30.23a1.5 1.5 0 010 3zM237.62 213.48h-19.54a1.5 1.5 0 010-3h19.54a1.5 1.5 0 010 3zM207.55 213.48h-36.28a1.5 1.5 0 010-3h36.28a1.5 1.5 0 010 3zM159.88 213.48h-15.54a1.5 1.5 0 010-3h15.54a1.5 1.5 0 010 3z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M96 355.62a1.5 1.5 0 01-1.5-1.5V212a1.5 1.5 0 011.5-1.5h37.24a1.5 1.5 0 010 3H97.47v140.62a1.5 1.5 0 01-1.47 1.5zM133.74 433.93H96a1.5 1.5 0 01-1.5-1.5v-14.22a1.5 1.5 0 013 0v12.72h36.27a1.5 1.5 0 110 3zM160.52 433.93H144a1.5 1.5 0 110-3h16.56a1.5 1.5 0 110 3zM207.53 433.93h-37a1.5 1.5 0 010-3h37a1.5 1.5 0 110 3zM237.67 433.93H218a1.5 1.5 0 110-3h19.69a1.5 1.5 0 110 3zM449.24 433.93H247.12a1.5 1.5 0 110-3h200.62V213.48h-137a1.5 1.5 0 010-3h138.5a1.5 1.5 0 011.5 1.5v220.45a1.5 1.5 0 01-1.5 1.5z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M449.24 231.39H306.85a1.5 1.5 0 010-3h142.39a1.5 1.5 0 010 3zM296.58 231.39h-49a1.5 1.5 0 010-3h49a1.5 1.5 0 110 3zM237.62 231.39h-19.54a1.5 1.5 0 010-3h19.54a1.5 1.5 0 010 3zM207.55 231.39h-36.88a1.5 1.5 0 110-3h36.88a1.5 1.5 0 010 3zM160.55 231.39h-16.78a1.5 1.5 0 110-3h16.78a1.5 1.5 0 010 3zM133.52 231.39H96a1.5 1.5 0 010-3h37.55a1.5 1.5 0 010 3z\" }), _jsx(\"circle\", { fill: \"#1d1d1b\", cx: \"107.55\", cy: \"221.3\", r: \"2.71\" }), _jsx(\"circle\", { fill: \"#1d1d1b\", cx: \"121.45\", cy: \"221.3\", r: \"2.71\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M435.78 217.7h6.14v6.14h-6.14zM236.59 379.76a106.75 106.75 0 01-19-1.7 1.5 1.5 0 11.54-2.95 103.51 103.51 0 0019.38 1.65 1.5 1.5 0 010 3z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M217.85 378.08h-.19C199.48 375.71 186 368 174.1 360a1.53 1.53 0 01-.66-1.22 1.51 1.51 0 01.63-1.24 119.65 119.65 0 0143.49-17.71 1.5 1.5 0 01.58 3 121.4 121.4 0 00-40.49 16c11.12 7.35 23.77 14.23 40.39 16.39a1.5 1.5 0 01-.19 3z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M217.85 342.75a1.5 1.5 0 01-.29-3 114 114 0 0119.93-2.12 1.5 1.5 0 010 3 110.71 110.71 0 00-19.39 2.07 1.46 1.46 0 01-.25.05zM247.12 379.25a1.5 1.5 0 01-.15-3 121.25 121.25 0 0047.1-15.07 1.5 1.5 0 011.49 0l24.06 13.89v-32.73l-24 13.86a1.53 1.53 0 01-1.52 0 106.79 106.79 0 00-46.71-15.2 1.51 1.51 0 01-1.38-1.61 1.48 1.48 0 011.62-1.38 109.7 109.7 0 0147.24 15.18l25.5-14.72a1.49 1.49 0 011.5 0 1.51 1.51 0 01.75 1.3v37.93a1.51 1.51 0 01-.75 1.3 1.49 1.49 0 01-1.5 0l-25.57-14.79a124.44 124.44 0 01-47.53 15zM464.3 283.09c-13.88 0-29.64-3.68-45.85-14.62a1.49 1.49 0 010-2.45 85.84 85.84 0 0127.06-11.9 80.13 80.13 0 0161.35 8.6l18.4-10.63a1.5 1.5 0 012.25 1.3v27.68a1.5 1.5 0 01-2.25 1.3l-18.46-10.65c-8.3 4.6-23.67 11.37-42.5 11.37zM422 267.23c36.75 23.54 70.88 8.94 84 1.46a1.47 1.47 0 011.49 0l17 9.79V256l-16.91 9.76a1.48 1.48 0 01-1.52 0c-39.13-23.36-75.54-3.76-84.06 1.47zM415.4 301.28a1.52 1.52 0 01-.83-.25c-28-18.58-52.92-17.6-68.92-13.51a78.59 78.59 0 00-28.23 13.41 1.5 1.5 0 11-1.92-2.3c.46-.38 11.43-9.41 29.41-14 16.58-4.24 42.42-5.27 71.32 13.92a1.5 1.5 0 01-.83 2.75z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M365.72 332.78a25.38 25.38 0 1125.37-25.38 25.4 25.4 0 01-25.37 25.38zm0-47.75a22.38 22.38 0 1022.37 22.37 22.4 22.4 0 00-22.37-22.4z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M365.93 321.69a1.5 1.5 0 01-1.06-.44l-12.79-12.79a1.49 1.49 0 01-.43-1.06 1.51 1.51 0 01.43-1.06l12.79-12.78a1.49 1.49 0 012.12 0l12.79 12.78a1.52 1.52 0 01.44 1.06 1.5 1.5 0 01-.44 1.06L367 321.25a1.5 1.5 0 01-1.07.44zm-10.66-14.29l10.66 10.67 10.66-10.67-10.66-10.66zM447.91 415.42a29.24 29.24 0 01-22.4-10.52 24.29 24.29 0 01-15.87 5.86 24.59 24.59 0 01-22.39-14.67h-.56a24.45 24.45 0 110-48.9 23.88 23.88 0 015.46.62 24.41 24.41 0 0140.54-13.32 24.36 24.36 0 0115.95-9.94 1.5 1.5 0 11.48 3 21.39 21.39 0 00-14.9 10.12 1.53 1.53 0 01-1.13.71 1.49 1.49 0 01-1.26-.47 21.42 21.42 0 00-37 12 1.47 1.47 0 01-.67 1.08 1.53 1.53 0 01-1.25.18 21.45 21.45 0 10-6.25 42c.39 0 .77 0 1.15-.06h.29a1.51 1.51 0 011.5 1 21.56 21.56 0 0020 13.77 21.31 21.31 0 0015-6.13 1.51 1.51 0 012.26.18 26.21 26.21 0 0021 10.61h.84a1.5 1.5 0 01.09 3zM305.88 240.87l-48.96-44.57L320 176.19l-14.12 64.68zM366.45 118.84a28 28 0 1128-28 28 28 0 01-28 28zm0-53a25 25 0 1025 25 25 25 0 00-25-25.02zM497.78 502.81h-134a1.5 1.5 0 01-1.5-1.5V460a1.5 1.5 0 011.5-1.5h134a1.5 1.5 0 011.5 1.5v41.33a1.5 1.5 0 01-1.5 1.48zm-132.54-3h131v-38.33h-131zM302.89 472.84h-30.28a1.5 1.5 0 01-1.5-1.5v-66.29a1.5 1.5 0 011.5-1.5h30.28a1.5 1.5 0 011.5 1.5v66.29a1.5 1.5 0 01-1.5 1.5zm-28.78-3h27.28v-63.29h-27.28zM293 293.43h-29.1a1.5 1.5 0 01-1.5-1.5V262.8a1.5 1.5 0 011.5-1.5H293a1.5 1.5 0 011.5 1.5v29.13a1.5 1.5 0 01-1.5 1.5zm-27.63-3h26.13V264.3h-26.1zM116.33 433.93a1.49 1.49 0 01-.78-.22 197.4 197.4 0 01-35.5-29.36C63.93 387.43 45 360.62 46.22 329a1.49 1.49 0 011.93-1.38c.65.2 66 20.41 86.46 75.54a1.5 1.5 0 11-2.81 1.05c-18-48.53-71.87-69.36-82.64-73.1-.67 57.56 67.26 99.6 68 100a1.5 1.5 0 01-.78 2.78z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M125.23 423.87a1.5 1.5 0 01-1.29-.73c-26.84-44.91-63.33-77.07-63.69-77.39a1.5 1.5 0 012-2.26c.37.33 37.22 32.8 64.3 78.11a1.5 1.5 0 01-.52 2 1.46 1.46 0 01-.8.27z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M89.87 375.57a1.49 1.49 0 01-1.47-1.21l-5.28-27.19a1.5 1.5 0 112.94-.57l5.28 27.19a1.49 1.49 0 01-1.19 1.75 1.33 1.33 0 01-.28.03zM114 406.55a1.51 1.51 0 01-1.41-1.58l1.83-31a1.5 1.5 0 013 .18l-1.82 31a1.5 1.5 0 01-1.6 1.4zM81.53 366.29h-.22L52.77 362a1.5 1.5 0 01.44-3l28.55 4.31a1.5 1.5 0 01-.23 3zM104.34 393.27h-.09l-34.95-2.21a1.5 1.5 0 01.19-3l35 2.21a1.5 1.5 0 01-.1 3zM58.83 258.93a34.58 34.58 0 110-69.16 1.5 1.5 0 01.79 2.78c-.14.08-14.15 9.2-14.23 31.81-.09 22.23 14.11 31.72 14.25 31.81a1.5 1.5 0 01-.81 2.76zm-4.55-65.83a31.58 31.58 0 00.07 62.51c-4.64-4.59-12-14.54-12-31.26.1-16.91 7.32-26.71 11.93-31.25zM332.41 417a11.9 11.9 0 1111.9-11.9 11.91 11.91 0 01-11.9 11.9zm0-20.8a8.9 8.9 0 108.9 8.9 8.91 8.91 0 00-8.9-8.95zM383.88 112.3h-.27a1.5 1.5 0 01-1.21-1.75c.52-2.88-3.33-4.85-8.82-7.32-5-2.25-10.21-4.59-10.21-9 0-6.18 3.63-7.6 6.54-8.75 2.75-1.08 4.73-1.86 4.91-6 .32-7.49-10.57-13.69-10.68-13.76a1.5 1.5 0 111.46-2.61c.52.28 12.62 7.16 12.22 16.5-.26 6.12-3.89 7.55-6.81 8.7s-4.64 1.82-4.64 6c0 2.46 4.29 4.39 8.44 6.26 5.4 2.42 11.52 5.17 10.54 10.59a1.5 1.5 0 01-1.47 1.14z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M366.45 108.38a1.54 1.54 0 01-.46-.08c-.6-.19-14.67-4.83-15.23-13.81-.39-6.28 3.7-9.66 7-12.37 2.07-1.7 3.85-3.17 3.87-4.81.06-5.27-11.18-6.07-11.3-6.07a1.51 1.51 0 01-1.41-1.59 1.53 1.53 0 011.59-1.41c.58 0 14.22.92 14.12 9.11 0 3-2.43 5-5 7.08-3 2.52-6.19 5.12-5.9 9.87.36 5.78 9.63 10 13.16 11.15a1.5 1.5 0 01-.46 2.93zM389.14 106a1.5 1.5 0 01-1.48-1.24c-.64-3.76-3.6-4.87-7-6.15-.84-.31-1.71-.63-2.55-1a1.5 1.5 0 011.21-2.75c.76.34 1.55.63 2.39.94 3.75 1.4 8 3 8.94 8.45a1.5 1.5 0 01-1.25 1.75 1.18 1.18 0 01-.26 0zM143.37 433.93h-9.63a1.5 1.5 0 01-1.5-1.5V212a1.5 1.5 0 011.5-1.5h9.63a1.5 1.5 0 011.5 1.5v220.43a1.5 1.5 0 01-1.5 1.5zm-8.13-3h6.63V213.48h-6.63zM170.11 433.93H161a1.5 1.5 0 01-1.5-1.5V212a1.5 1.5 0 011.5-1.5h9.09a1.5 1.5 0 011.5 1.5v220.43a1.5 1.5 0 01-1.48 1.5zm-7.59-3h6.09V213.48h-6.09zM217.49 433.93h-9.36a1.5 1.5 0 01-1.5-1.5v-57.08a1.5 1.5 0 013 0v55.58H216v-54.35a1.5 1.5 0 113 0v55.85a1.5 1.5 0 01-1.51 1.5zM208.13 344.38a1.51 1.51 0 01-1.5-1.5V212a1.5 1.5 0 011.5-1.5h9.36A1.5 1.5 0 01219 212v129.25a1.5 1.5 0 01-3 0V213.48h-6.36v129.4a1.5 1.5 0 01-1.51 1.5zM246.79 433.93H238a1.5 1.5 0 01-1.5-1.5V212a1.5 1.5 0 011.5-1.5h8.88a1.51 1.51 0 011.5 1.49c.16 58.36-.07 193.89-.12 220.46a1.5 1.5 0 01-1.47 1.48zm-7.26-3h5.77c0-29.55.27-159.36.11-217.45h-5.88zM405.53 213.08a1.47 1.47 0 01-1.22-.64 1.5 1.5 0 01.35-2.09 72.4 72.4 0 0016.39-15.75l-21.27 3a1.5 1.5 0 01-1.09-2.7c19.09-13.78 29.5-26.59 33.27-31.74l-18.29.63a1.5 1.5 0 01-1.14-2.52 224.77 224.77 0 0032.34-43.92c-19.48 5.58-40.16 27.56-40.38 27.79a1.49 1.49 0 01-2.51-1.5l6.42-19c-15.19 11.12-33.6 40.31-33.8 40.62a1.5 1.5 0 01-2.74-1.12l5.27-23.63c-17.73 18-29.21 57.4-29.33 57.82a1.5 1.5 0 01-2.93-.24l-2.4-20.33c-4.74 7.8-7.74 19.06-8.93 33.54a1.5 1.5 0 11-3-.25c1.42-17.2 5.37-30.11 11.75-38.35a1.51 1.51 0 012.68.74l2.03 17.41c1.55-4.6 3.92-11.15 7-18.22 7.78-18 16.08-30.62 24.67-37.61a1.5 1.5 0 012.41 1.49l-4.52 20.31c7.25-10.62 21.86-30.48 33.91-37.09a1.49 1.49 0 012.14 1.79l-5.75 17c7.9-7.5 24.69-21.83 40.57-24.88a1.49 1.49 0 011.64 2.12c-.1.21-10.12 20.83-31.93 44.9l17.69-.61a1.49 1.49 0 011.33 2.28c-.39.64-9.31 14.82-31 31.49l18.84-2.65a1.49 1.49 0 011.45.65 1.52 1.52 0 01.06 1.59c-.24.4-5.92 10.08-19.09 19.39a1.5 1.5 0 01-.89.28z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M361.83 213.08a1.47 1.47 0 01-.73-.19 1.51 1.51 0 01-.59-2c15.28-27.66 30.5-47.66 45.22-59.46a1.5 1.5 0 011.88 2.34c-14.42 11.55-29.38 31.26-44.47 58.57a1.49 1.49 0 01-1.31.74z\" }), _jsx(\"path\", { fill: \"#1d1d1b\", d: \"M360.61 212.46h-.13a1.51 1.51 0 01-1.36-1.63l3.38-39.05a1.5 1.5 0 113 .26l-3.37 39.05a1.51 1.51 0 01-1.52 1.37zM378.2 186.38a1.5 1.5 0 01-.51-2.92l30.87-10.94a1.5 1.5 0 111 2.83l-30.86 10.94a1.51 1.51 0 01-.5.09z\" })] }) }));\n};\nexport default SideSomIkkeFinnesSvg;\n","var __glob = (map) => (path) => {\n var fn = map[path];\n if (fn) return fn();\n throw new Error(\"Module not found in bundle: \" + path);\n};\n\n// src/resources/index.ts\nimport LanguageLocales from \"@helsenorge/core-utils/constants/languages\";\nimport { getModifiedResourcesForTest } from \"@helsenorge/framework-utils/resources\";\nimport frameworkNbNo from \"./HN.Core.Framework.NPM.JS.nb-NO.json\";\nimport contentNbNo from \"./HN.Tjenester.Content.nb-NO.json\";\n\n// import(\"./**/*.*.json\") in src/resources/index.ts\nvar globImport_json = __glob({\n \"./HN.Core.Framework.NPM.JS.en-GB.json\": () => import(\"./HN.Core.Framework.NPM.JS.en-GB.json\"),\n \"./HN.Core.Framework.NPM.JS.lt-LT.json\": () => import(\"./HN.Core.Framework.NPM.JS.lt-LT.json\"),\n \"./HN.Core.Framework.NPM.JS.nb-NO.json\": () => import(\"./HN.Core.Framework.NPM.JS.nb-NO.json\"),\n \"./HN.Core.Framework.NPM.JS.nn-NO.json\": () => import(\"./HN.Core.Framework.NPM.JS.nn-NO.json\"),\n \"./HN.Core.Framework.NPM.JS.pl-PL.json\": () => import(\"./HN.Core.Framework.NPM.JS.pl-PL.json\"),\n \"./HN.Core.Framework.NPM.JS.ro-RO.json\": () => import(\"./HN.Core.Framework.NPM.JS.ro-RO.json\"),\n \"./HN.Core.Framework.NPM.JS.ru-RU.json\": () => import(\"./HN.Core.Framework.NPM.JS.ru-RU.json\"),\n \"./HN.Core.Framework.NPM.JS.se-NO.json\": () => import(\"./HN.Core.Framework.NPM.JS.se-NO.json\"),\n \"./HN.Tjenester.Content.en-GB.json\": () => import(\"./HN.Tjenester.Content.en-GB.json\"),\n \"./HN.Tjenester.Content.nb-NO.json\": () => import(\"./HN.Tjenester.Content.nb-NO.json\"),\n \"./HN.Tjenester.Content.nn-NO.json\": () => import(\"./HN.Tjenester.Content.nn-NO.json\"),\n \"./HN.Tjenester.Content.se-NO.json\": () => import(\"./HN.Tjenester.Content.se-NO.json\")\n});\n\n// src/resources/index.ts\nvar Projects = {\n FRAMEWORK: \"HN.Core.Framework.NPM.JS\",\n CONTENT: \"HN.Tjenester.Content\"\n};\nvar getResourceItem = (projectName, language) => {\n if (projectName === Projects.FRAMEWORK && language === LanguageLocales.NORWEGIAN) {\n return frameworkNbNo;\n }\n if (projectName === Projects.CONTENT && language === LanguageLocales.NORWEGIAN) {\n return contentNbNo;\n }\n};\nvar getResources = async (projectName, language) => {\n const resources = getResourceItem(projectName, language);\n if (resources) {\n return Promise.resolve(resources);\n }\n try {\n const resources2 = await globImport_json(`./${projectName}.${language}.json`);\n return resources2.default;\n } catch (error) {\n throw new Error(`Failed to load resources for ${projectName} in ${language}: ${error}`);\n }\n};\nvar getResourcesTestHelper = async (projectName, language) => {\n const resources = await getResources(projectName, language);\n if (resources) {\n return getModifiedResourcesForTest(resources);\n }\n throw new Error(`Mangler ressurs ${projectName}.${language}`);\n};\nexport {\n Projects,\n getResources,\n getResourcesTestHelper\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useEffect } from 'react';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Loader from '@helsenorge/designsystem-react/components/Loader';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport { track404 } from '@helsenorge/framework-utils/adobe-analytics';\nimport { isAuthorized } from '@helsenorge/framework-utils/hn-authorize';\nimport { getTjenesterUrl, getHelsenorgeUrl } from '@helsenorge/framework-utils/hn-proxy-service';\nimport useResources from '@helsenorge/framework-utils/resources/useResources';\nimport SideSomIkkeFinnesSvg from './side-som-ikke-finnes-svg';\nimport { getResources, Projects } from '../resources';\nimport styles from './styles.module.scss';\nconst PageNotFound = () => {\n const resources = useResources(Projects.FRAMEWORK, getResources);\n const forsideUrl = isAuthorized() ? getTjenesterUrl() : getHelsenorgeUrl();\n useEffect(() => {\n track404();\n }, []);\n if (!resources) {\n return _jsx(Loader, { overlay: \"screen\", size: 'medium' });\n }\n return (!!resources && (_jsxs(\"div\", { className: \"container mb-6 mb-lg-7\", children: [_jsx(\"div\", { className: \"row\", children: _jsxs(\"div\", { className: \"col-md-10 offset-md-1 col-lg-8 offset-lg-2\", children: [_jsx(Title, { htmlMarkup: \"h2\", appearance: \"title1\", children: resources.pageNotFoundHeader }), _jsx(\"p\", { className: styles['page-not-found__preamble'], children: resources.pageNotFoundDescription }), _jsx(Button, { htmlMarkup: \"a\", href: forsideUrl, children: resources.pageNotFoundToStart })] }) }), _jsx(\"div\", { className: \"row\", children: _jsx(\"div\", { className: \"col-md-10 offset-md-1 col-lg-8 offset-lg-2\", children: _jsx(\"div\", { className: \"mt-7\", children: _jsx(SideSomIkkeFinnesSvg, {}) }) }) })] })));\n};\nexport default PageNotFound;\n","/**\n * Returnerer Path fra HN.Page objektet - eller tom string hvis den ikke finnes\n */\nexport const getPath = () => {\n return window.HN?.Page?.Path ?? '';\n};\n/**\n * Returnerer Version fra HN.Page objektet\n */\nexport const getVersion = () => {\n return window.HN?.Page?.Version;\n};\n/**\n * Returnerer Assets fra HN.Page objektet\n */\nexport const getAssets = () => {\n return window.HN?.Page?.Assets;\n};\n/**\n * Returnerer Assets fra HN.Page objektet - eller tom string hvis den ikke finnes\n */\nexport const getAssetsUrl = () => {\n return window.HN?.Page?.Assets ?? '';\n};\n/**\n * Returnerer VerticalAssetsPath fra HN.Page objektet - eller tom string hvis den ikke finnes\n */\nexport const getVerticalAssetsPath = () => {\n return window.HN?.Page?.VerticalAssetsPath ?? '';\n};\n/**\n * Oppdaterer Path key pÃ¥ HN.Page objektet\n * @param newPath verdien som settes i Path\n */\nexport const setPath = (newPath) => {\n window.HN = window.HN || {};\n window.HN.Page = window.HN.Page || {};\n window.HN.Page.Path = newPath;\n};\n/**\n * Hent ID som skal brukes pÃ¥ h1-elementet pÃ¥ siden\n * @returns ID\n */\nexport const getSidetittelId = () => 'sidetittel';\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport ReactDOM, { render } from 'react-dom';\nimport { error } from './../logger';\nimport { RegisterWebCompSetup } from './helpers';\nexport const isCustomElementRegistered = (name) => {\n return !!window.customElements.get(name);\n};\nexport function registerWebComp(ChildComponent, name, config, templateName) {\n class WebComponent extends HTMLElement {\n constructor() {\n super();\n Object.defineProperty(this, \"mountPoint\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"props\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"observer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"eventDispatcher\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (event) => {\n this.dispatchEvent(event);\n }\n });\n // Listen to Events from outside\n Object.defineProperty(this, \"subscribeDispatcher\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (eventname, callback) => {\n this.addEventListener(eventname, e => {\n return callback(e);\n });\n }\n });\n }\n connectedCallback() {\n this.mountReactComponent();\n this.observer = new MutationObserver(mutations => {\n let shouldRerender = false;\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes' &&\n mutation.attributeName &&\n mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName)) {\n shouldRerender = true;\n }\n });\n if (shouldRerender) {\n this.renderReactComponent();\n }\n });\n this.observer.observe(this, { attributes: true });\n }\n disconnectedCallback() {\n if (this.mountPoint) {\n ReactDOM.unmountComponentAtNode(this.mountPoint);\n }\n this.observer?.disconnect();\n }\n get value() {\n return Array.from(this.attributes).reduce((p, c) => {\n p[c.name] = c.value;\n return p;\n }, {});\n }\n mountReactComponent() {\n this.mountPoint = document.createElement('div');\n if (!templateName) {\n error('Registrering av webcomp feiler: finner ikke template name');\n return;\n }\n // TEMPLATE\n // Her settes id til templatet\n const tmpl = document.getElementById(templateName);\n if (!tmpl) {\n error(`Kunne ikke finne html <template> med id: ${templateName} sjekk i index-html at <template> er oppgitt med riktig id`);\n return;\n }\n // SHADOW-DOM\n // Create an attach to the shadowDOM's root. This is necessary before querying the DOM\n const shadowRoot = this.attachShadow({ mode: 'open' });\n // TEMPLATE + SHADOW-DOM\n // Select the template content and append it to the shadowDOM\n shadowRoot.appendChild(tmpl.content.cloneNode(true));\n shadowRoot.appendChild(this.mountPoint);\n this.renderReactComponent();\n }\n renderReactComponent() {\n this.props = this.value;\n // @todo Fjern assertion etter overgang til React 18 render\n render((_jsx(RegisterWebCompSetup, { config: config, eventDispatcher: this.eventDispatcher, subscribeDispatcher: this.subscribeDispatcher, children: _jsx(ChildComponent, { ...this.props }) })), this.mountPoint);\n }\n }\n //her settes navnet til web component elementet\n if (!isCustomElementRegistered(name)) {\n window.customElements.define(name, WebComponent);\n }\n}\nexport default registerWebComp;\n","import { isCustomElementRegistered } from './register';\nimport { getAssetsUrl } from '../hn-page';\nimport { error } from '../logger';\nconst isTemplateRenderedServerSide = (templateElement) => {\n if (templateElement && templateElement.content.children.length > 0) {\n return true;\n }\n return false;\n};\nconst createMicrowebTemplate = (templateName) => {\n const templateElement = document.createElement('template');\n templateElement.setAttribute('id', templateName);\n document.head.appendChild(templateElement);\n return templateElement;\n};\nconst isWebpackAssetsJson = (json) => json.entrypoints !== undefined;\n/**\n * Finn det første link-elementet i document.head som inneholder helsenorge.css\n * @returns URL til helsenorge.css i document.head, med hash i URLen\n */\nconst getHelsenorgeCssUrl = () => {\n const elementList = document.head.querySelectorAll(`link[href^=\"${getAssetsUrl()}/core/static/css/helsenorge.\"]`);\n const linkElement = Array.from(elementList)[0];\n return linkElement?.href;\n};\nconst blockUntilEvent = (target, event) => {\n return new Promise(resolve => target.addEventListener(event, resolve, { passive: true, once: true }));\n};\nexport const fetchWebComp = async (props) => {\n // Venter med Ã¥ sjekke om template er allerede lagt til server-side inntil HTML-en er innlastet.\n // Dette for Ã¥ unngÃ¥ undøvendig fetch av assets.json pga. race condition.\n if (document.readyState === 'loading') {\n await blockUntilEvent(document, 'DOMContentLoaded');\n }\n const { domain, entryName, componentName, includeHelsenorgeCss, templateName } = props;\n const microwebTemplate = document.getElementById(templateName || `${componentName}-template`);\n if (!isCustomElementRegistered(componentName) && !isTemplateRenderedServerSide(microwebTemplate)) {\n const assetsUrl = `${domain}/assets.json`;\n // Sørg for Ã¥ alltid hente nyeste assets.json\n // https://developer.mozilla.org/en-US/docs/Web/API/Request/cache\n return fetch(assetsUrl, { cache: 'no-cache' })\n .then(response => {\n if (response.status === 200) {\n const resp = response.json();\n return resp;\n }\n return Promise.reject(Error(`Error while fetching asset-manifest.json from ${domain}/assets.json`));\n })\n .then((assets) => {\n const templateElement = microwebTemplate ?? createMicrowebTemplate(templateName || `${componentName}-template`);\n const appendStylesheet = (href) => {\n const cssElement = document.createElement('link');\n cssElement.setAttribute('href', href);\n cssElement.rel = 'stylesheet';\n if (templateElement)\n templateElement.content.appendChild(cssElement);\n };\n const appendScript = (src, type) => {\n const scriptElement = document.createElement('script');\n scriptElement.setAttribute('src', src);\n type && scriptElement.setAttribute('type', type);\n document.head.appendChild(scriptElement);\n };\n if (includeHelsenorgeCss) {\n const helsenorgeCssUrl = getHelsenorgeCssUrl();\n appendStylesheet(helsenorgeCssUrl || `${getAssetsUrl()}/core/static/css/helsenorge/helsenorge.css`);\n }\n if (isWebpackAssetsJson(assets)) {\n assets.entrypoints[entryName]\n ?.filter(x => !x.endsWith('.map'))\n .map((asset) => {\n if (asset.endsWith('.css')) {\n appendStylesheet(`${domain}/${asset}`);\n }\n else {\n appendScript(`${domain}/${asset}`);\n }\n });\n }\n else {\n // assets.json is in Vite format\n assets[entryName]?.css?.map(asset => {\n appendStylesheet(`${domain}/${asset}`);\n });\n assets[entryName] && appendScript(`${domain}/${assets[entryName]?.file}`, 'module');\n }\n })\n .catch(e => {\n error(e, assetsUrl);\n });\n }\n return Promise.resolve();\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { useEffect } from 'react';\nimport { fetchWebComp } from './fetcher';\nconst WebCompConsumer = props => {\n useEffect(() => {\n fetchWebComp(props);\n }, []);\n const webCompFromMicroFrontend = React.createElement(props.componentName, props.componentProps, props.children);\n return _jsx(React.Fragment, { children: webCompFromMicroFrontend });\n};\nexport default WebCompConsumer;\n","import { getHelsenorgeUrl, getTjenesterUrl } from '../../hn-proxy-service';\n/**\n * Replaces \"{tjenesterUrl}\" and \"{helsenorgeUrl}\" with url according to environment.\n * @param url text that may include {tjenesterUrl} or {helsenorgeUrl}.\n */\nexport const envSafeUrl = (url) => {\n return url\n .replace(/{tjenesterUrl}/g, getTjenesterUrl())\n .replace(/{helsenorgeUrl}/g, getHelsenorgeUrl())\n .replace(/tjenesterUrl/g, getTjenesterUrl())\n .replace(/helsenorgeUrl/g, getHelsenorgeUrl());\n};\n","/**\n * Get feature-toggle from window.HN.\n * @param featureName name of feature\n */\nexport default function getFeatureToggle(featureName) {\n const getFeatureToggles = window.HN?.PortalCommands?.GetFeatureToggles || window.HN?.Commands?.GetFeatureToggles;\n return !!getFeatureToggles?.FeatureToggles?.[featureName];\n}\n","import DOMPurify from 'dompurify';\nimport getFeatureToggle from './hn-feature-toggle';\nexport const TRUSTED_TYPES_FEATURE_NAME = 'TrustedTypes';\nconst hasDefaultTrustedTypesPolicy = () => !!window.trustedTypes?.defaultPolicy;\n/**\n * Sjekk om det finnes en default policy for trusted types og om Trusted Types er togglet pÃ¥.\n *\n * @returns true dersom Trusted Types skal enables\n */\nexport const isTrustedTypesEnabled = () => hasDefaultTrustedTypesPolicy() && getFeatureToggle(TRUSTED_TYPES_FEATURE_NAME);\nconst DefaultSanitizeConfig = {\n ADD_ATTR: ['target'],\n};\n/**\n * Sanitize html før den vises til bruker. Returnerer Trusted Types dersom dette er i bruk.\n *\n * @param html string med HTML som skal sanitizes\n * @returns sanitized HTML\n */\nexport const sanitize = (html) => {\n if (DOMPurify && typeof DOMPurify.sanitize === 'function') {\n return DOMPurify.sanitize(html ?? '', { ...DefaultSanitizeConfig, RETURN_TRUSTED_TYPE: isTrustedTypesEnabled() });\n }\n return '';\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport classNames from 'classnames';\nimport Markdown from 'markdown-to-jsx';\nimport AnchorLink from '@helsenorge/designsystem-react/components/AnchorLink';\nimport List from '@helsenorge/designsystem-react/components/List';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport { envSafeUrl } from './safe-html';\nimport { sanitize } from '../../trusted-types';\nimport styles from './styles.module.scss';\nconst parseHtml = (html, type) => {\n if (typeof html === 'string' && type === 'markdown') {\n return {\n type: 'markdown',\n value: html,\n };\n }\n else if (typeof html === 'string') {\n return html;\n }\n if (html?.value) {\n return html;\n }\n return null;\n};\nconst SafeHTML = ({ html, tagName, type, testId, className, ...rest }) => {\n const parsedHtml = parseHtml(html, type);\n if (!parsedHtml) {\n return null;\n }\n if (typeof parsedHtml === 'string') {\n const CustomTag = tagName || 'span';\n return (_jsx(CustomTag, { className: classNames(designsystemtypography['anchorlink-wrapper'], styles['safe-html'], className), \"data-testid\": testId, dangerouslySetInnerHTML: { __html: sanitize(envSafeUrl(parsedHtml)) }, ...rest }));\n }\n else {\n if (!parsedHtml?.value) {\n return null;\n }\n const CustomTag = tagName || 'div';\n return (_jsx(CustomTag, { className: classNames(styles['safe-html'], className), \"data-testid\": testId, children: _jsx(Markdown, { options: {\n wrapper: React.Fragment,\n overrides: {\n h2: {\n component: Title,\n props: {\n htmlMarkup: 'h2',\n appearance: 'title2',\n },\n },\n h3: {\n component: Title,\n props: {\n htmlMarkup: 'h3',\n appearance: 'title3',\n },\n },\n h4: {\n component: Title,\n props: {\n htmlMarkup: 'h4',\n appearance: 'title4',\n },\n },\n h5: {\n component: Title,\n props: {\n htmlMarkup: 'h5',\n appearance: 'title5',\n },\n },\n a: {\n component: AnchorLink,\n },\n ul: {\n component: List,\n props: {\n variant: 'bullet',\n },\n },\n ol: {\n component: List,\n props: {\n variant: 'numbered',\n },\n },\n li: {\n component: List.Item,\n },\n },\n }, children: envSafeUrl(parsedHtml.value) }) }));\n }\n};\nexport default SafeHTML;\n","import { trackError } from './adobe-analytics';\nimport { getUserLanguage } from './hn-language';\nimport { getHelsenorgeUrl } from './hn-proxy-service';\nimport { checkStatus, createBaseHeaders, parseParams } from './hn-service';\nimport { warn } from './logger';\nimport { CmsContentApiVersions } from './types/entities';\n/**\n * Returnerer CmsContentApiUrl fra window.HN.Rest\n */\nexport const getContentApiUrl = () => {\n return !!window.HN && !!window.HN.Rest && !!window.HN.Rest.CmsContentApiUrl ? window.HN.Rest.CmsContentApiUrl : '';\n};\n/**\n * Returnerer CmsContentApiPreviewUrl fra window.HN.Rest\n */\nexport const getContentApiPreviewUrl = () => {\n return !!window.HN && !!window.HN.Rest && !!window.HN.Rest.CmsContentApiPreviewUrl ? window.HN.Rest.CmsContentApiPreviewUrl : '';\n};\n/**\n * Returnerer true dersom URLen man stÃ¥r pÃ¥ inneholder content-api-preview=true\n */\nexport const enableContentApiPreview = () => {\n return !!window && window.location.href.indexOf('content-api-preview=true') !== -1;\n};\nconst handleError = (error, apiUrl) => {\n trackError('level1', 'Feil ved henting av data fra CMS');\n if (error instanceof TypeError && error.message === 'Failed to fetch') {\n warn(`Kall til content-apiet feilet: ${apiUrl}. Mottok ingen respons fra tjenesten.`);\n }\n else if (error instanceof Error) {\n warn(`Kall til content-apiet feilet: ${apiUrl}`, error);\n }\n throw error;\n};\n/**\n * Henter JSON fra content-apiet med fetch(). Returnerer et Promise.\n * Logger eventuelle feil med warn().\n * @param endpoint command strengen som sendes mot content-apiet\n * @param params object med parameters { param1 : 'myparam1', param2: 'myparam2'}\n * @param version setter hvilken versjon av conetnapi som skal kalles (v1/, v2/)\n * @throws {Error} Dersom det skjedde en feil under henting av data fra content-apiet.\n */\nexport const get = (endpoint, params = {}, version = CmsContentApiVersions.V1) => {\n const preview = enableContentApiPreview();\n const hostName = preview ? getContentApiPreviewUrl() : getContentApiUrl();\n const credentials = preview ? 'include' : 'omit'; // MÃ¥ settes til omit for Ã¥ kunne bruke wildcard for domener i CORS\n const headers = createBaseHeaders();\n if (preview) {\n headers.append('X-Preview', 'true');\n }\n const { languageCode = getUserLanguage(), ...restParams } = params;\n const apiUrl = `${hostName}/contentapi/internal/${version}${endpoint}${parseParams({ languageCode, ...restParams })}`;\n return fetch(apiUrl, {\n method: 'get',\n credentials,\n headers: headers,\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * Hjelpemetode for Ã¥ sende get-requester til content-API sammen med createApi fra RTK\n * @param args\n * @returns\n */\nexport const getBaseQuery = async (args) => {\n try {\n const response = await get(...args);\n return { data: response };\n }\n catch (error) {\n return { error: error instanceof Error ? error.message : 'Teknisk feil' };\n }\n};\n/**\n * Send JSON til CMS-apiet med fetch() som POST-request. Returnerer et Promise.\n * Logger eventuelle feil med warn().\n * @param endpoint command strengen som sendes mot apiet\n * @param data object med data { param1 : 'myparam1', param2: 'myparam2'}\n * @param params object med parameters { param1 : 'myparam1', param2: 'myparam2'}\n * @throws {Error} Dersom det skjedde en feil under henting av data fra content-apiet.\n */\nexport const post = (endpoint, data, params = {}) => {\n const hostName = getContentApiUrl();\n const headers = createBaseHeaders();\n const apiUrl = `${hostName}/api/${endpoint}${parseParams(params)}`;\n return fetch(apiUrl, {\n method: 'POST',\n headers: headers,\n body: JSON.stringify(data),\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * Send JSON til CMS-apiet med fetch() som PATCH-request. Returnerer et Promise.\n * Logger eventuelle feil med warn().\n * @param endpoint command strengen som sendes mot apiet\n * @param data object med data { param1 : 'myparam1', param2: 'myparam2'}\n * @param params object med parameters { param1 : 'myparam1', param2: 'myparam2'}\n * @throws {Error} Dersom det skjedde en feil under henting av data fra content-apiet.\n */\nexport const patch = (endpoint, data, params = {}) => {\n const hostName = getContentApiUrl();\n const headers = createBaseHeaders();\n const apiUrl = `${hostName}/api/${endpoint}${parseParams(params)}`;\n return fetch(apiUrl, {\n method: 'PATCH',\n headers: headers,\n body: JSON.stringify(data),\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * Henter JSON fra Helsenorge-proxy (samme domene som content-apiet) med fetch().\n * Skal kun benyttes for Ã¥pne api-kall til tjenester der det er satt opp proxy (SOT).\n * Returnerer et Promise.\n * Logger eventuelle feil med warn().\n * @param proxyName navn pÃ¥ api-et/løsningsomrÃ¥det. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params object med parameters { param1 : 'myparam1', param2: 'myparam2'}\n * @throws {Error} Dersom det skjedde en feil under henting av data fra content-apiet.\n */\nexport const getHelsenorgeProxy = (proxyName, endpoint, params) => {\n const apiUrl = getHelsenorgeUrl() + '/proxy/' + proxyName + '/' + endpoint + parseParams(params);\n return fetch(apiUrl, {\n method: 'get',\n credentials: 'omit', // MÃ¥ settes til omit for Ã¥ kunne bruke wildcard for domener i CORS\n headers: createBaseHeaders(),\n })\n .then(response => checkStatus(response))\n .catch(error => {\n if (error == 'TypeError: Failed to fetch') {\n warn(`Kall til helsenorge proxy: ${apiUrl}. Mottok ingen respons fra tjenesten.`);\n }\n else {\n warn(`Kall til helsenorge proxy feilet: ${apiUrl}. Feilmelding: ${JSON.stringify(error)}`);\n }\n throw error;\n });\n};\n","import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';\nimport { get } from '../cms-content-api-service';\nexport const selectCmsTjenesteTekster = (state, name) => state.cmsTjenesteTekster[getTjenesteTeksterKey(name, state.language.currentLanguage)];\nexport const selectCmsTjenesteTekstForHjelpetekstId = (state, name, hjelpetekstId) => {\n if (typeof hjelpetekstId === 'string') {\n return selectCmsTjenesteTekster(state, name)?.data?.hjelpetekster?.spesifikkeHjelpetekster?.find(t => t.id?.toLowerCase() === hjelpetekstId?.toLowerCase());\n }\n return selectCmsTjenesteTekster(state, name)?.data?.hjelpetekster?.spesifikkeHjelpetekster?.find(t => hjelpetekstId.map(h => h.toLowerCase()).includes(t.id?.toLowerCase()));\n};\nexport const selectFeedbackResources = (state, name) => selectCmsTjenesteTekster(state, name)?.data?.feedback;\nexport const selectCmsTjenesteContent = (state, name) => selectCmsTjenesteTekster(state, name)?.data?.tjenesteContent;\nexport const selectWordExplanation = (state, name, word) => selectCmsTjenesteTekster(state, name)?.data?.oppslagsverk?.ordforklaringer?.find(o => {\n const wordTrimmed = word.trim().toLowerCase();\n const synonymList = o.synonyms?.split(';').map(s => s.trim().toLowerCase());\n return wordTrimmed === o.title?.trim().toLowerCase() || synonymList?.includes(wordTrimmed);\n});\nexport const getCanShowHjelpetekstInPageHeader = (state, tjenesteNavn, hjelpetekstId) => {\n const spesifikkHjelpeTekst = hjelpetekstId ? selectCmsTjenesteTekstForHjelpetekstId(state, tjenesteNavn, hjelpetekstId) : undefined;\n const tjenesteTekster = selectCmsTjenesteTekster(state, tjenesteNavn);\n return !!spesifikkHjelpeTekst?.hjelpetekst || (tjenesteTekster?.data?.hjelpetekster?.hjelpetekst?.length ?? 0) > 0;\n};\nconst shouldFetchTjenesteTekster = (state, name, language) => {\n const key = getTjenesteTeksterKey(name, language);\n const cmsTjenesteTekster = state.cmsTjenesteTekster[key];\n return cmsTjenesteTekster?.status !== 'loading' && cmsTjenesteTekster?.status !== 'succeeded';\n};\n/**\n * Hent nye tjenestetekster basert pÃ¥ tjenestenavn og language\n */\nexport const fetchTjenesteTekster = createAsyncThunk('cmsTjenesteTekster/fetchTjenesteTekster', async ({ name, language }, { rejectWithValue }) => {\n try {\n const tjenesteTekster = await get('tjeneste', {\n navn: name,\n languageCode: language,\n });\n if (tjenesteTekster) {\n return tjenesteTekster;\n }\n throw new Error(`Kunne ikke hente tjenestetekster for ${name} pÃ¥ ${language}`);\n }\n catch {\n return rejectWithValue(`Kunne ikke hente tjenestetekster for ${name} pÃ¥ ${language}`);\n }\n}, {\n condition: ({ name, language }, { getState }) => {\n return shouldFetchTjenesteTekster(getState(), name, language);\n },\n});\nexport const getTjenesteTeksterKey = (name, languageCode) => `${name}.${languageCode}`;\nconst initialState = {};\nconst cmsTjenesteTeksterSlice = createSlice({\n name: 'cmsTjenesteTekster',\n initialState,\n reducers: {\n addSpesifikkeHjelpetekster(state, action) {\n const key = getTjenesteTeksterKey(action.payload.name, action.payload.language);\n state[key] = {\n status: 'succeeded',\n data: {\n ...state[key]?.data,\n hjelpetekster: {\n ...state[key]?.data?.hjelpetekster,\n spesifikkeHjelpetekster: [\n ...(state[key]?.data?.hjelpetekster?.spesifikkeHjelpetekster ?? []),\n ...action.payload.spesifikkeHjelpetekster,\n ],\n },\n },\n };\n },\n setDefaultHjelpetekst(state, action) {\n const key = getTjenesteTeksterKey(action.payload.name, action.payload.language);\n state[key] = {\n status: 'succeeded',\n data: {\n ...state[key]?.data,\n hjelpetekster: {\n ...state[key]?.data?.hjelpetekster,\n overskift: action.payload.overskift,\n hjelpetekst: action.payload.hjelpetekst,\n },\n },\n };\n },\n },\n extraReducers: builder => {\n builder\n .addCase(fetchTjenesteTekster.pending, (state, action) => {\n const key = getTjenesteTeksterKey(action.meta.arg.name, action.meta.arg.language);\n state[key] = {\n status: 'loading',\n data: null,\n };\n })\n .addCase(fetchTjenesteTekster.fulfilled, (state, action) => {\n const key = getTjenesteTeksterKey(action.meta.arg.name, action.meta.arg.language);\n state[key] = {\n status: 'succeeded',\n data: action.payload,\n };\n })\n .addCase(fetchTjenesteTekster.rejected, (state, action) => {\n const key = getTjenesteTeksterKey(action.meta.arg.name, action.meta.arg.language);\n state[key] = {\n status: 'failed',\n data: null,\n };\n });\n },\n});\nexport const { addSpesifikkeHjelpetekster, setDefaultHjelpetekst } = cmsTjenesteTeksterSlice.actions;\nexport default cmsTjenesteTeksterSlice.reducer;\n","/*\n * aria hidden\n * ----------------\n * Traverse dom upwards and set aria-hidden on all siblings.\n * Used on modals to hide all other content from screen readers when modal\n * is placed within wrappers in dom, and we are unable to set aria-hidden on the rest\n * of the page.\n *\n * Example:\n * <article>\n * <div>\n * <h1>Page title</h1>\n * </div>\n * <div role=\"dialog\" id=\"modal\">\n *\n * </div>\n * </article>\n *\n * Here we are unable to set aria-hidden on article as it would also hide the modal.\n * The script then traverses the dom upwards and set aria-hidden on all siblings of parent element\n * until it reaches the body element.\n *\n */\nexport default {\n setAriaHidden(domEl) {\n // Set aria hidden on siblings\n const siblings = this._getSiblings(domEl);\n for (let i = 0; i < siblings.allSiblings.length; i++) {\n siblings.allSiblings[i].setAttribute('aria-hidden', 'true');\n }\n // Return siblings so aria-hiddens can be restored later\n return siblings;\n },\n resetAriaHidden(siblings) {\n if (siblings) {\n siblings.allSiblings.forEach(sibling => {\n sibling.removeAttribute('aria-hidden');\n });\n siblings.ariaHiddens.forEach(sibling => {\n siblings.allSiblings[sibling.elIndex].setAttribute('aria-hidden', sibling.val);\n });\n return siblings;\n }\n },\n _getSiblings(domEl) {\n // Get siblings\n const siblings = { allSiblings: [], ariaHiddens: [] };\n let x = 0;\n while (domEl && domEl !== document.body) {\n if (domEl.parentElement) {\n for (let i = 0; i < domEl.parentElement.children.length; i++) {\n const child = domEl.parentElement.children[i];\n if (child.nodeType === 1 && child !== domEl) {\n // If element already has aria set, store it for later\n if (child.hasAttribute('aria-hidden')) {\n const value = child.getAttribute('aria-hidden');\n if (value) {\n siblings.ariaHiddens.push({ elIndex: x, val: value.toString() });\n }\n }\n siblings.allSiblings.push(child);\n x++;\n }\n }\n }\n domEl = domEl.parentElement;\n }\n return siblings;\n },\n};\n","export default {\n DOWN: 40,\n ESC: 27,\n ENTER: 13,\n LEFT: 37,\n RIGHT: 39,\n SPACE: 32,\n TAB: 9,\n UP: 38,\n};\n","/* This is a util to get the event target, wether it comes from the lightDOM or shadowDOM - this requires the Shadow DOM to be of type 'open' */\nexport const getEventTarget = (e) => e.composedPath()[0];\n","const allowConsoleOutput = () => !['production', 'test'].includes(process.env.NODE_ENV ?? '');\nconst log = (message, ...optionalParams) => {\n if (!allowConsoleOutput())\n return;\n // eslint-disable-next-line no-console\n console.log(message, optionalParams);\n};\n/**\n * Returnerer document.activeElement (element in focus), uavhengig av om den er i document-dom rllrt shadow-dom\n * @param element HtmlElement som den skal søke i\n * @param logCallback Funksjon som om det oppstÃ¥r en feil. Brukes for Ã¥ logge til server.\n */\nexport const getDocumentActiveElement = (element, logCallback) => {\n try {\n const domNode = typeof element === 'string' ? document.querySelector(element) : element;\n const root = domNode?.getRootNode();\n return root?.activeElement;\n }\n catch (e) {\n const logger = logCallback ?? log;\n logger('Feil ved Ã¥ ta tak i active element basert pÃ¥ angitt node: ', element, e);\n return null;\n }\n};\n","import { tabbable } from 'tabbable';\nimport keyCode from './constants/key-code';\nimport { getEventTarget } from './events';\nimport { getDocumentActiveElement } from './focus-utils';\n/**\n * Class som ved init lÃ¥ser fokuset inne i én DOMElement. BruksomrÃ¥der er f.eks Modalvinduer.\n * Tar imot en DomNode (HTMLElement eller string) som fokuset skal lÃ¥ses i.\n * @deprecated Bruk useFocusTrap-hook fra @helsenorge/designsystem-react i stedet\n */\nexport class TrapFocus {\n constructor(domNode, isTriggerWithinTrappedArea = false) {\n Object.defineProperty(this, \"domNode\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"previouslyFocusedItem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"focusableItems\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.focusableItems = [];\n this.domNode = typeof domNode === 'string' ? document.querySelector(domNode) : domNode;\n const activeElement = getDocumentActiveElement(domNode);\n this.previouslyFocusedItem = activeElement ? activeElement : document.activeElement;\n // Get focusable elements\n this.updateFocusableItems();\n // Set focus to element to be able to listen for keypress\n if (!isTriggerWithinTrappedArea && this.focusableItems.length) {\n this.focusableItems[0].focus();\n }\n window.addEventListener('keydown', this, false);\n }\n deactivate() {\n window.removeEventListener('keydown', this, false);\n this.focusableItems = [];\n this.domNode = null;\n if (this.previouslyFocusedItem && this.previouslyFocusedItem.focus) {\n this.previouslyFocusedItem.focus();\n }\n }\n handleEvent(e) {\n if (e.keyCode !== keyCode.TAB) {\n return null;\n }\n e.stopPropagation();\n e.preventDefault();\n const target = getEventTarget(e);\n this.updateFocusableItems();\n const currentFocusIndex = this.getItemIndex(target);\n // When the element focused is not in list, sets focus on the first focusable element of the list\n if (currentFocusIndex === -1) {\n if (this.focusableItems.length > 0 && this.focusableItems[0]) {\n this.focusableItems[0].focus();\n }\n return null;\n }\n if (e.shiftKey) {\n this.previousFocusableItem(target).focus();\n }\n else {\n this.nextFocusableItem(target).focus();\n }\n return null;\n }\n updateFocusableItems() {\n if (this.domNode) {\n this.focusableItems = tabbable(this.domNode);\n }\n }\n previousFocusableRadioButton(itemWithFocus) {\n const currentFocusIndex = this.getItemIndex(itemWithFocus);\n // Previous focusable item should not be a radio button in same group\n for (let i = currentFocusIndex; i >= 0; i--) {\n const previousElement = this.focusableItems[i];\n if (!this.isRadioButton(previousElement)) {\n return previousElement;\n }\n // Element is a radio button, but not in same group\n if (previousElement.name !== itemWithFocus.name) {\n return this.getSelectedRadioInGroup(previousElement);\n }\n }\n // All the previous items are in the same radio group, start from end\n for (let i = this.focusableItems.length - 1; i > currentFocusIndex; i--) {\n const previousElement = this.focusableItems[i];\n if (!this.isRadioButton(previousElement)) {\n return previousElement;\n }\n // Element is a radio button, but not in same group\n if (previousElement.name !== itemWithFocus.name) {\n return this.getSelectedRadioInGroup(previousElement);\n }\n }\n // Still no element found: we have only radio buttons in the same group\n return this.getSelectedRadioInGroup(itemWithFocus);\n }\n previousFocusableItem(itemWithFocus) {\n const currentFocusIndex = this.getItemIndex(itemWithFocus);\n if (!this.isRadioButton(itemWithFocus)) {\n let previousFocusIndex = currentFocusIndex - 1;\n // Wrap around\n if (previousFocusIndex < 0) {\n previousFocusIndex = this.focusableItems.length - 1;\n }\n return this.getSelectedRadioInGroup(this.focusableItems[previousFocusIndex]);\n }\n return this.previousFocusableRadioButton(itemWithFocus);\n }\n nextFocusableRadioButton(itemWithFocus) {\n const currentFocusIndex = this.getItemIndex(itemWithFocus);\n // Next focusable item should not be a radio button in same group\n for (let i = currentFocusIndex + 1; i < this.focusableItems.length; i++) {\n const nextElement = this.focusableItems[i];\n if (!this.isRadioButton(nextElement)) {\n return nextElement;\n }\n // Element is a radio button, but not in same group\n if (nextElement.name !== itemWithFocus.name) {\n return this.getSelectedRadioInGroup(nextElement);\n }\n }\n // All the next items are in the same radio group, start from beginning\n for (let i = 0; i < currentFocusIndex; i++) {\n const nextElement = this.focusableItems[i];\n if (!this.isRadioButton(nextElement)) {\n return nextElement;\n }\n // Element is a radio button, but not in same group\n if (nextElement.name !== itemWithFocus.name) {\n return this.getSelectedRadioInGroup(nextElement);\n }\n }\n // Still no element found: we have only radio buttons in the same group\n return this.getSelectedRadioInGroup(itemWithFocus);\n }\n nextFocusableItem(itemWithFocus) {\n const currentFocusIndex = this.getItemIndex(itemWithFocus);\n if (!this.isRadioButton(itemWithFocus)) {\n let nextFocusIndex = currentFocusIndex + 1;\n // Wrap around\n if (nextFocusIndex > this.focusableItems.length - 1) {\n nextFocusIndex = 0;\n }\n return this.getSelectedRadioInGroup(this.focusableItems[nextFocusIndex]);\n }\n return this.nextFocusableRadioButton(itemWithFocus);\n }\n // If user tabbed into a radio group, we need to focus the selected radio button in the group\n getSelectedRadioInGroup(item) {\n if (!this.isRadioButton(item)) {\n return item;\n }\n const currentFocusIndex = this.getItemIndex(item);\n const radioGrouItems = [];\n let i;\n for (i = currentFocusIndex; i < this.focusableItems.length; i++) {\n if (this.focusableItems[i].name === item.name) {\n radioGrouItems.push(this.focusableItems[i]);\n }\n else {\n break; // Element is not in radio group, no need to continue loop\n }\n }\n for (i = currentFocusIndex - 1; i >= 0; i--) {\n if (this.focusableItems[i].name === item.name) {\n radioGrouItems.push(this.focusableItems[i]);\n }\n else {\n break; // Element is not in radio group, no need to continue loop\n }\n }\n const selectedItems = radioGrouItems.filter(i => i.checked);\n if (selectedItems.length === 0) {\n return item; // No element in this group is selected\n }\n return selectedItems[0];\n }\n getItemIndex(item) {\n return this.focusableItems.indexOf(item);\n }\n isRadioButton(element) {\n return element.type === 'radio';\n }\n}\nexport default TrapFocus;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport Expander from '@helsenorge/designsystem-react/components/Expander';\nimport { PortableText } from '../../richtext';\nconst EkspanderendeTekstBlock = ({ title, mainContent, }) => {\n if (title.length === 0 || mainContent.length === 0) {\n return null;\n }\n return (_jsx(Expander, { title: title, noNestedLine: true, renderChildrenWhenClosed: true, children: _jsx(PortableText, { value: mainContent }) }));\n};\nexport default EkspanderendeTekstBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport EkspanderendeBlockComponent from '../../../behandlingsvalg/ekspanderendeblock';\nconst EkspanderendeBlock = ({ value }) => (_jsx(EkspanderendeBlockComponent, { title: value.title, mainContent: value.mainContent }));\nexport default EkspanderendeBlock;\n","export var PromoBlockType;\n(function (PromoBlockType) {\n PromoBlockType[\"promoboard\"] = \"promoboard\";\n PromoBlockType[\"diveboard\"] = \"diveboard\";\n})(PromoBlockType || (PromoBlockType = {}));\nexport var PromoBlockColors;\n(function (PromoBlockColors) {\n PromoBlockColors[\"blueberry50\"] = \"blueberry50\";\n PromoBlockColors[\"blueberry500\"] = \"blueberry500\";\n PromoBlockColors[\"cherry50\"] = \"cherry50\";\n PromoBlockColors[\"cherry500\"] = \"cherry500\";\n PromoBlockColors[\"neutral50\"] = \"neutral50\";\n PromoBlockColors[\"neutral700\"] = \"neutral700\";\n})(PromoBlockColors || (PromoBlockColors = {}));\nexport var ImageType;\n(function (ImageType) {\n ImageType[\"illustration\"] = \"illustration\";\n ImageType[\"photo\"] = \"photo\";\n})(ImageType || (ImageType = {}));\n// search\nexport var WindowActionEnum;\n(function (WindowActionEnum) {\n WindowActionEnum[WindowActionEnum[\"None\"] = 0] = \"None\";\n WindowActionEnum[WindowActionEnum[\"RefreshPage\"] = 1] = \"RefreshPage\";\n})(WindowActionEnum || (WindowActionEnum = {}));\nexport var Size;\n(function (Size) {\n Size[\"Small\"] = \"Small\";\n Size[\"Medium\"] = \"Medium\";\n Size[\"Large\"] = \"Large\";\n})(Size || (Size = {}));\nexport var VideoType;\n(function (VideoType) {\n VideoType[VideoType[\"notSupported\"] = 0] = \"notSupported\";\n VideoType[VideoType[\"youtube\"] = 1] = \"youtube\";\n VideoType[VideoType[\"vimeo\"] = 2] = \"vimeo\";\n VideoType[VideoType[\"vimeoShowcase\"] = 3] = \"vimeoShowcase\";\n})(VideoType || (VideoType = {}));\n// Setter antall cards per bootstrap rad (eks: four = 12/4)\nexport var CardsPerRow;\n(function (CardsPerRow) {\n CardsPerRow[CardsPerRow[\"four\"] = 3] = \"four\";\n CardsPerRow[CardsPerRow[\"three\"] = 4] = \"three\";\n CardsPerRow[CardsPerRow[\"two\"] = 6] = \"two\";\n CardsPerRow[CardsPerRow[\"one\"] = 12] = \"one\";\n})(CardsPerRow || (CardsPerRow = {}));\n// Setter fargetema for videokort\nexport var VideoTheme;\n(function (VideoTheme) {\n VideoTheme[\"neutral\"] = \"neutral\";\n VideoTheme[\"cherry\"] = \"cherry\";\n VideoTheme[\"blueberry\"] = \"blueberry\";\n})(VideoTheme || (VideoTheme = {}));\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport classNames from 'classnames';\nimport { Size } from '../types/entities';\nimport typography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport cmsstyles from './styles.module.scss';\nconst Image = ({ imageUrl, caption, copyright, size = Size.Large, alternativeText, }) => {\n const figureClass = 'row no-gutters';\n let imageClass = 'col-12 align-self-start';\n let captionClass = 'col-12';\n if (size === Size.Small) {\n imageClass = 'col-12 col-md-10 offset-md-1 col-lg-5 offset-lg-2 align-self-start';\n captionClass = classNames(typography['image-caption'], 'col-12 col-md-10 offset-md-1 col-lg-3 offset-lg-0 pl-lg-4');\n }\n else if (size === Size.Large) {\n captionClass = classNames(typography['image-caption'], 'col-12 col-lg-8');\n }\n else if (size === Size.Medium) {\n imageClass = 'col-12 col-md-10 offset-md-1 col-lg-8 offset-lg-2';\n captionClass = classNames(typography['image-caption'], 'col-12 col-md-10 offset-md-1 col-lg-8 offset-lg-2 ');\n }\n return (_jsxs(\"figure\", { className: figureClass, children: [_jsx(\"img\", { src: imageUrl, alt: alternativeText, className: imageClass }), _jsxs(\"figcaption\", { className: captionClass, children: [_jsx(\"p\", { className: classNames(cmsstyles.image, size === Size.Small && cmsstyles['image--small']), children: caption }), _jsx(\"p\", { className: classNames(typography['image-credit'], cmsstyles['image__copyright']), children: copyright })] })] }));\n};\nexport default Image;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport ImageBlockComponent from '../../../image';\nconst ImageBlock = ({ value }) => (_jsx(ImageBlockComponent, { imageUrl: value.imageUrl, caption: value.caption, copyright: value.copyright, size: value.size, alternativeText: value.alternativeText }));\nexport default ImageBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport AnchorLink from '@helsenorge/designsystem-react/components/AnchorLink';\nconst Link = ({ value, children }) => value ? (_jsx(AnchorLink, { href: value.href, target: value.target, children: children })) : null;\nexport default Link;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport LazyIcon from '@helsenorge/designsystem-react/components/LazyIcon';\nimport LinkList from '@helsenorge/designsystem-react/components/LinkList';\nconst CmsLinkList = ({ color, links, size, className }) => (_jsx(LinkList, { color: color, chevron: true, size: size, className: className, children: links.map(({ href, text, iconName, target, title }, index) => (_jsx(LinkList.Link, { href: href, icon: iconName ? _jsx(LazyIcon, { iconName: iconName }) : undefined, target: target ? target : undefined, title: title ? title : undefined, children: text }, index))) }));\nexport default CmsLinkList;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport cn from 'classnames';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport LinkList from './linklist';\nimport styles from './styles.module.scss';\nconst LinkListBlock = ({ links, title, titleHtmlMarkup = 'h2', additionalLinkList, color = 'neutral', useGridLayout = false, children, }) => {\n const contentClassName = cn(styles['linklistblock__content'], {\n [styles['linklistblock__content--neutral']]: color === 'neutral',\n [styles['linklistblock__content--cherry']]: color === 'cherry',\n [styles['linklistblock__content--blueberry']]: color === 'blueberry',\n [styles['linklistblock__content--grid']]: useGridLayout,\n });\n return (_jsx(\"div\", { className: styles['linklistblock'], children: _jsxs(\"div\", { className: contentClassName, children: [title && (_jsx(Title, { htmlMarkup: titleHtmlMarkup, appearance: \"title3\", margin: { marginTop: 0, marginBottom: 1 }, children: title })), children, _jsx(LinkList, { color: color, links: links }), additionalLinkList && (_jsx(LinkList, { links: additionalLinkList, color: color, size: \"small\", className: styles['linklistblock__additional-link-list'] }))] }) }));\n};\nexport default LinkListBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\n/* eslint-disable react/prop-types */\nimport { useContext } from 'react';\nimport { PortableTextContext } from '../..';\nimport LinkListBlockComponent from '../../../linklistblock';\nconst LinkListBlock = ({ value }) => {\n const backgroundColor = useContext(PortableTextContext)?.backgroundColor;\n return (_jsx(LinkListBlockComponent, { links: value.links, title: value.title, titleHtmlMarkup: value.titleHtmlMarkup, additionalLinkList: value.additionalLinkList, color: backgroundColor ? backgroundColor : value.color, useGridLayout: value.useGridLayout }));\n};\nexport default LinkListBlock;\n","/**\n * Returns true nÃ¥r brukeren er pÃ¥ mobil (native check on user agent)\n */\nexport const isMobileUA = () => {\n let check = false;\n (function (a) {\n const regexString = '(android|bbd+|meego).+mobile|avantgo|bada/|blackberry\\\n |blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|\\\n midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|\\\n pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows ce|xda|\\\n xiino';\n const regexString2 = '1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|\\\n ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|\\\n avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell|\\\n chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|\\\n el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|\\\n gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|\\\n hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|/)|ibro|idea|\\\n ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |/)|klon|kpt |\\\n kwc-|kyo(c|k)|le(no|xi)|lg( g|/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50/|\\\n ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |\\\n o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|\\\n ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|\\\n pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|\\\n qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55/|sa(ge|ma|\\\n mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|\\\n sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|\\\n t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|\\\n m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|\\\n vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|\\\n whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-';\n const regex = new RegExp(regexString, 'i');\n const regex2 = new RegExp(regexString2, 'i');\n if (regex.test(a) || regex2.test(a.substr(0, 4))) {\n check = true;\n }\n })(navigator.userAgent || navigator.vendor || window.opera);\n return check;\n};\n/**\n * Legger til 'ios-safari' className pÃ¥ body nÃ¥r nettleseren er safari (native check on user agent)\n */\nexport const handleIOSSafariUA = () => {\n if (!document.body.classList.contains('ios-safari')) {\n const ua = window.navigator.userAgent;\n const iOS = isAppleMobileDevice();\n const webkit = !!ua.match(/WebKit/i);\n const iOSSafari = iOS && webkit && !ua.match(/CriOS/i) && !ua.match(/OPiOS/i);\n if (iOSSafari) {\n document.body.classList.add('ios-safari');\n }\n }\n};\nexport const isAndroid = () => {\n return navigator.userAgent.toLowerCase().indexOf('android') > -1;\n};\nexport const isAppleMobileDevice = () => {\n const ua = navigator.userAgent;\n return !!ua.match(/iPad/i) || !!ua.match(/iPhone/i);\n};\n","import { getUrlHostname } from '@helsenorge/core-utils/url';\nimport { isAndroid, isAppleMobileDevice } from '@helsenorge/core-utils/user-agents-utils';\nimport { getAssetsUrl } from './hn-page';\nimport { getTjenesterUrl } from './hn-proxy-service';\n/**\n * Sjekk om URL peker til et helsenorge-domene\n * @param url En gyldig URL, f.eks. https://www.helsenorge.no/sykdom/\n * @returns returnerer true dersom domene er tjenester.helsenorge.no eller www.helsenorge.no\n */\nexport const isHelsenorgeUrl = (url) => {\n const hostname = getUrlHostname(url);\n return !!hostname && ['tjenester.helsenorge.no', 'www.helsenorge.no'].includes(hostname);\n};\nexport const getAppUrl = () => {\n if (isAndroid()) {\n return getAssetsUrl() + '/core/app-login/android.html';\n }\n else if (isAppleMobileDevice()) {\n return getAssetsUrl() + '/core/app-login/apple.html';\n }\n else {\n return undefined;\n }\n};\nexport const getSigninAppUrl = () => {\n const appUrl = getAppUrl();\n if (appUrl) {\n const urlSearch = new URL(window.location.href).search;\n return `${getAppUrl()}${urlSearch}`;\n }\n return undefined;\n};\nexport const getSigninTjenesteUrl = () => {\n const currentUrl = new URL(window.location.href);\n const tjenesteParam = currentUrl.searchParams.get('tjeneste') || '';\n const sourceUrl = `${getTjenesterUrl()}/${tjenesteParam}`;\n const signinUrl = new URL(`${getTjenesterUrl()}/auth/signin`);\n signinUrl.searchParams.set('Source', sourceUrl);\n return signinUrl.toString();\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React from 'react';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport LazyIcon from '@helsenorge/designsystem-react/components/LazyIcon';\nimport { getAppUrl } from '@helsenorge/framework-utils/url';\nimport { HNeventShowAppInvitation } from '@helsenorge/framework-utils/web-component/events';\nconst LoginButton = ({ htmlMarkup, href, icon, rightSideIcon, children, ...rest }) => {\n const [appUrl, setAppUrl] = React.useState(undefined);\n const buttonRef = React.useRef(null);\n React.useEffect(() => {\n setAppUrl(getAppUrl());\n }, []);\n const triggerOriginalBehaviour = (e) => {\n rest.onClick && rest.onClick(e);\n if (href)\n window.location.href = href;\n };\n const useAppUrl = (appUrl) => {\n const url = new URL(href ? href : '');\n window.location.href = `${appUrl}?tjeneste=${url.pathname}${url.search}`;\n };\n const mobileOnClick = (e) => {\n if (appUrl) {\n e?.preventDefault();\n HNeventShowAppInvitation(() => {\n useAppUrl(appUrl);\n }, () => {\n triggerOriginalBehaviour();\n }, () => {\n buttonRef.current?.focus();\n });\n }\n };\n return (_jsxs(Button, { ...rest, href: appUrl ? undefined : href, onClick: appUrl ? mobileOnClick : rest.onClick, htmlMarkup: appUrl ? 'button' : htmlMarkup, ref: buttonRef, children: [!!icon && _jsx(LazyIcon, { iconName: icon }), children, !!rightSideIcon && _jsx(Icon, { svgIcon: rightSideIcon })] }));\n};\nLoginButton.defaultProps = {\n size: 'medium',\n concept: 'normal',\n href: '#',\n htmlMarkup: 'button',\n fluid: false,\n};\nexport default LoginButton;\n","import { theme } from '@helsenorge/designsystem-react';\nexport const getIconColor = (name) => {\n if (name === 'black') {\n return theme.palette.black;\n }\n else if (name === 'white') {\n return theme.palette.white;\n }\n else if (name === 'plum') {\n return theme.palette.plum600;\n }\n else if (name === 'neutral') {\n return theme.palette.neutral600;\n }\n else if (name === 'kiwi') {\n return theme.palette.kiwi600;\n }\n else if (name === 'cherry') {\n return theme.palette.cherry600;\n }\n else if (name === 'blueberry') {\n return theme.palette.blueberry600;\n }\n else if (name === 'banana') {\n return theme.palette.banana600;\n }\n return theme.palette.black;\n};\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport bindClassNames from 'classnames/bind';\nimport Icon, { IconSize } from '@helsenorge/designsystem-react/components/Icon';\nimport ArrowRight from '@helsenorge/designsystem-react/components/Icons/ArrowRight';\nimport LazyIcon from '@helsenorge/designsystem-react/components/LazyIcon';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport { useHover } from '@helsenorge/designsystem-react';\nimport { getIconColor } from '../shared/getIconColor';\nimport styles from './styles.module.scss';\nconst classNames = bindClassNames.bind(styles);\nconst Panel = ({ url, icon, emphasize, title, linkTitle, intro, colorName = 'neutral', children, linkTarget = '_self', className, large, }) => {\n const { hoverRef, isHovered } = useHover();\n const iconComponent = icon &&\n (large ? (_jsxs(_Fragment, { children: [_jsx(LazyIcon, { iconName: icon, size: IconSize.Medium, isHovered: isHovered, className: \"d-lg-none\" }), _jsx(LazyIcon, { iconName: icon, size: IconSize.Large, isHovered: isHovered, className: \"d-none d-lg-inline\" })] })) : (_jsx(LazyIcon, { iconName: icon, size: IconSize.Medium, isHovered: isHovered })));\n const iconOrEmphasisComponent = (icon || emphasize) && (_jsx(\"span\", { className: classNames('col-6', 'col-md-2', {\n 'pl-lg-7': icon && large && !emphasize,\n 'panel__emphasize pr-md-3': !icon && emphasize,\n }), children: icon ? iconComponent : emphasize }));\n const spacingClassNames = classNames(className, 'px-5', 'pt-5', 'pt-md-6', 'pb-7', 'pb-md-8', 'my-7', 'my-lg-8', `panel--${colorName}`, {\n 'pt-lg-5': large && iconOrEmphasisComponent,\n });\n const titleComponent = (_jsxs(Title, { htmlMarkup: \"h2\", appearance: \"title3\", className: classNames('my-0', 'row', 'no-gutters', 'align-items-center', {\n 'align-items-md-baseline': !icon && emphasize,\n }), children: [iconOrEmphasisComponent, url && (_jsx(\"span\", { className: classNames(styles.panel__arrow, 'align-self-md-baseline', {\n 'col-6 col-md-2 order-md-3': iconOrEmphasisComponent,\n 'col-2 order-3': !iconOrEmphasisComponent,\n }), children: _jsx(Icon, { size: IconSize.XSmall, svgIcon: ArrowRight, color: getIconColor('blueberry'), isHovered: isHovered }) })), _jsx(\"span\", { className: classNames({\n 'col-md-8 mt-5 mt-md-0': iconOrEmphasisComponent,\n 'col-10': !iconOrEmphasisComponent,\n }), children: title })] }));\n const renderSection = (_jsxs(\"div\", { className: classNames({\n [spacingClassNames]: !url,\n }), children: [title && titleComponent, (intro || children) && (_jsx(\"div\", { className: \"row no-gutters\", children: _jsxs(\"div\", { className: classNames('mt-3', 'mt-md-5', 'mb-0', {\n 'col-md-8 offset-md-2': icon || emphasize,\n 'col-md-10': !icon && !emphasize,\n }), children: [intro, children] }) }))] }));\n if (!url) {\n return renderSection;\n }\n const linkClassNames = classNames(styles.panel__link, `panel__link--${colorName}`);\n return (_jsx(\"a\", { href: url, className: classNames('d-block', linkClassNames, spacingClassNames), title: linkTitle ? linkTitle : title, ref: hoverRef, target: linkTarget, rel: linkTarget && linkTarget === '_blank' ? 'noopener noreferrer' : undefined, children: renderSection }));\n};\nexport default Panel;\n","import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useEffect, useState } from 'react';\nimport ArrowRight from '@helsenorge/designsystem-react/components/Icons/ArrowRight';\nimport { hasLoggedInCookie } from '@helsenorge/framework-utils/cookie';\nimport LoginButton from './LoginButton';\nimport Panel from '../panel';\nconst LoginBlock = ({ title, intro, authenticatedTitle, authenticatedIntro, hideIfAuthenticated = false, url, iconName, buttonText, colorName, showOnlyButton, }) => {\n const [isAuthenticated, setIsAuthenticated] = useState(false);\n useEffect(() => {\n const isAuthorized = hasLoggedInCookie();\n setIsAuthenticated(isAuthorized);\n }, []);\n if (isAuthenticated && hideIfAuthenticated) {\n return null;\n }\n return (_jsx(_Fragment, { children: showOnlyButton && !isAuthenticated ? (_jsx(LoginButton, { icon: iconName, concept: \"normal\", fluid: true, htmlMarkup: \"a\", rightSideIcon: ArrowRight, size: \"large\", href: url, children: buttonText })) : (_jsx(Panel, { icon: iconName, title: isAuthenticated && authenticatedTitle ? authenticatedTitle : title, intro: isAuthenticated && authenticatedIntro ? authenticatedIntro : intro, url: isAuthenticated ? url : '', colorName: colorName, children: !isAuthenticated && (_jsx(\"div\", { className: \"mt-5\", children: _jsx(LoginButton, { htmlMarkup: \"a\", href: url, children: buttonText }) })) })) }));\n};\nexport default LoginBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\n/* eslint-disable react/prop-types */\nimport { useContext } from 'react';\nimport { PortableTextContext } from '../..';\nimport LoginBlockComponent from '../../../loginblock';\nconst getColorName = (contextColor, blockColor) => {\n // NÃ¥r farge pÃ¥ blokken er \"Ingen\", bruk farge hentet fra parent-komponent\n if (contextColor && blockColor === 'none') {\n return contextColor;\n }\n // Ellers, bruk farge fra blokken\n if (blockColor !== 'none') {\n return blockColor;\n }\n};\nconst LoginBlock = ({ value }) => {\n const backgroundColor = useContext(PortableTextContext)?.backgroundColor;\n const colorName = getColorName(backgroundColor, value.colorName);\n return (_jsx(LoginBlockComponent, { title: value.title, intro: value.intro, authenticatedTitle: value.authenticatedTitle, authenticatedIntro: value.authenticatedIntro, hideIfAuthenticated: value.hideIfAuthenticated, url: value.url, iconName: value.iconName, buttonText: value.buttonText, colorName: colorName, showOnlyButton: value.showOnlyButton }));\n};\nexport default LoginBlock;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport fontStyles from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport PortableText from '../..';\nconst TextBlockComponent = ({ title, titleHtmlMarkup = 'h2', titleAppearance = 'title2', mainIntro, mainBody, }) => (_jsxs(\"div\", { children: [_jsx(Title, { htmlMarkup: titleHtmlMarkup, appearance: titleAppearance, children: title }), mainIntro && _jsx(\"p\", { className: fontStyles.preamble, children: mainIntro }), _jsx(PortableText, { value: mainBody })] }));\nconst TextBlock = ({ value }) => (_jsx(TextBlockComponent, { title: value.title, titleHtmlMarkup: value.titleHtmlMarkup, titleAppearance: value.titleAppearance, mainIntro: value.mainIntro, mainBody: value.mainBody, removePadding: value.removePadding }));\nexport default TextBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport cmsstyles from './styles.module.scss';\nconst RichTextTitle = ({ htmlMarkup, children }) => {\n const htmlMarkupAppearanceMap = {\n h1: 'title1',\n h2: 'title2',\n h3: 'title3',\n h4: 'title4',\n h5: 'title5',\n h6: 'title6',\n span: 'title5',\n };\n return (_jsx(Title, { className: cmsstyles.richtext, htmlMarkup: htmlMarkup, appearance: htmlMarkupAppearanceMap[htmlMarkup], children: children }));\n};\nexport default RichTextTitle;\n","export var VimeoSubtitleLanguageCodes;\n(function (VimeoSubtitleLanguageCodes) {\n VimeoSubtitleLanguageCodes[\"NORWEGIAN\"] = \"nb\";\n VimeoSubtitleLanguageCodes[\"NORWEGIAN_NYNORSK\"] = \"nn\";\n VimeoSubtitleLanguageCodes[\"ENGLISH\"] = \"en-GB\";\n VimeoSubtitleLanguageCodes[\"LITHUANIAN\"] = \"lt\";\n VimeoSubtitleLanguageCodes[\"POLISH\"] = \"pl\";\n VimeoSubtitleLanguageCodes[\"RUSSIAN\"] = \"ru\";\n VimeoSubtitleLanguageCodes[\"ROMANIAN\"] = \"ro\";\n VimeoSubtitleLanguageCodes[\"SAMI_NORTHERN\"] = \"se\";\n})(VimeoSubtitleLanguageCodes || (VimeoSubtitleLanguageCodes = {}));\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useRef } from 'react';\nimport classNames from 'classnames';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Checkbox from '@helsenorge/designsystem-react/components/Checkbox';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport cmsstyles from './styles.module.scss';\nconst YouTubeTermsOfService = ({ title, imageUrl, resources, handleAccept, }) => {\n const checkboxRef = useRef(null);\n return (_jsxs(\"div\", { className: cmsstyles['tos-overlay'], style: {\n backgroundImage: imageUrl ? `linear-gradient(rgba(0, 0, 0, 0.60), rgba(0, 0, 0, 0.60)), url(${imageUrl})` : undefined,\n }, children: [title && (_jsx(Title, { className: cmsstyles['tos-overlay__title'], htmlMarkup: \"h2\", appearance: \"title3\", children: title })), _jsxs(\"div\", { className: cmsstyles['tos'], children: [_jsxs(\"p\", { className: classNames(cmsstyles['tos__text'], designsystemtypography['anchorlink-wrapper']), children: [resources.youtubeTosText, ' ', _jsx(\"a\", { href: resources.youtubeTosLinkHref ?? 'https://www.youtube.com/t/terms', target: \"_blank\", rel: \"noopener noreferrer\", children: resources.youtubeTosLinkText }), ' ', resources.youtubeTosTextSuffix] }), _jsx(\"div\", { className: cmsstyles['tos__remember'], children: _jsx(Checkbox, { label: resources.tosRememberLabel, ref: checkboxRef }) }), _jsx(Button, { onClick: () => handleAccept(checkboxRef.current?.checked ?? false), children: resources.tosButtonText })] })] }));\n};\nexport default YouTubeTermsOfService;\n","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useState, useEffect } from 'react';\nimport classNames from 'classnames';\nimport { VideoType } from '../types/entities';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport { hasCookie } from '@helsenorge/framework-utils/cookie';\nimport { setSharedCookie } from '@helsenorge/framework-utils/shared-cookies';\nimport { VimeoSubtitleLanguageCodes } from './constants';\nimport YouTubeTermsOfService from './youtube-terms-of-service';\nimport cmsstyles from './styles.module.scss';\n/**\n * Navn pÃ¥ cookien som brukes til Ã¥ huske at brukeren har akseptert YouTubes vilkÃ¥r\n */\nconst YOUTUBE_TOS_COOKIE_NAME = 'hn-youtube-tos-accepted';\n/**\n * Navn pÃ¥ event som brukes til Ã¥ skjule vilkÃ¥r fra alle YouTube-videoer samtidig.\n */\nconst YOUTUBE_EVENT_NAME = 'hn-youtube-settosaccepted';\n/**\n * Hvor mange dager før brukeren pÃ¥ nytt mÃ¥ ta stilling til YouTubes vilkÃ¥r\n */\nconst YOUTUBE_COOKIE_AGE_DAYS = 365;\nconst VideoSpiller = props => {\n const { title, description, videoId, videoType, imageUrl, altText, showTextContent = false, resources, subtitleLanguageCode = VimeoSubtitleLanguageCodes.NORWEGIAN, className, } = props;\n const [tosAccepted, setTosAccepted] = useState(false);\n const handleAccept = (remember) => {\n setTosAccepted(true);\n document.dispatchEvent(new CustomEvent(YOUTUBE_EVENT_NAME));\n if (remember) {\n setSharedCookie(YOUTUBE_TOS_COOKIE_NAME, '1', YOUTUBE_COOKIE_AGE_DAYS);\n }\n };\n const handleAcceptEvent = () => {\n setTosAccepted(true);\n };\n useEffect(() => {\n setTosAccepted(hasCookie(YOUTUBE_TOS_COOKIE_NAME));\n document.addEventListener(YOUTUBE_EVENT_NAME, handleAcceptEvent);\n return () => {\n document.removeEventListener(YOUTUBE_EVENT_NAME, handleAcceptEvent);\n };\n }, []);\n const getVideoUrl = () => {\n if (videoType === VideoType.youtube) {\n return `https://www.youtube-nocookie.com/embed/${videoId}?&rel=0`;\n }\n else if (videoType === VideoType.vimeo) {\n return `https://player.vimeo.com/video/${videoId}?texttrack=${subtitleLanguageCode}`;\n }\n else if (videoType === VideoType.vimeoShowcase) {\n return `https://vimeo.com/showcase/${videoId}/embed?texttrack=${subtitleLanguageCode}`;\n }\n return '';\n };\n const getAllowAttribute = () => {\n if (videoType === VideoType.youtube) {\n return 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture';\n }\n else if (videoType === VideoType.vimeo) {\n return 'fullscreen;';\n }\n else if (videoType === VideoType.vimeoShowcase) {\n return 'fullscreen;';\n }\n return '';\n };\n const videoUrl = getVideoUrl();\n const allowAttribute = getAllowAttribute();\n const showTermsOfService = videoType === VideoType.youtube && !tosAccepted && resources;\n if (!allowAttribute || !videoUrl) {\n return null;\n }\n const renderTextContent = () => (_jsxs(\"div\", { className: cmsstyles.videobeskrivelse, children: [title && _jsx(\"h3\", { className: classNames(designsystemtypography.title3, cmsstyles.videobeskrivelse__title), children: title }), description && _jsx(\"p\", { className: cmsstyles.videobeskrivelse__description, children: description })] }));\n return (_jsxs(_Fragment, { children: [_jsxs(\"div\", { className: classNames(cmsstyles.videospiller, cmsstyles['videospiller--16by9'], className), children: [showTermsOfService && (_jsx(YouTubeTermsOfService, { title: title || altText, imageUrl: imageUrl, resources: resources, handleAccept: handleAccept })), _jsx(\"iframe\", { src: showTermsOfService ? '' : videoUrl, className: cmsstyles.videospiller__iframe, allow: allowAttribute, title: altText || title })] }), showTextContent && renderTextContent()] }));\n};\nVideoSpiller.displayName = 'VideoSpiller';\nexport default VideoSpiller;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport VideoSpillerComponent from '../../../videospiller';\nconst VideoBlock = ({ value }) => (_jsxs(_Fragment, { children: [_jsx(VideoSpillerComponent, { title: value.title, description: value.description, videoId: value.videoId, videoType: value.videoType, altText: value.altText, imageUrl: value.imageUrl, resources: value.resources, showTextContent: true }), _jsx(Spacer, { size: \"m\" })] }));\nexport default VideoBlock;\n","export var AnalyticsId;\n(function (AnalyticsId) {\n AnalyticsId[\"Videokort\"] = \"videokort\";\n})(AnalyticsId || (AnalyticsId = {}));\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport classNames from 'classnames';\nimport { CardsPerRow, VideoTheme } from '../types/entities';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport Play from '@helsenorge/designsystem-react/components/Icons/Play';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport { theme as designTheme, useHover, useUuid } from '@helsenorge/designsystem-react';\nimport { AnalyticsId } from '../shared/analytics';\nimport cmsstyles from './styles.module.scss';\nconst VideoKort = ({ title, description, imageUrl, onClick, wrapperClassName, selected, theme = VideoTheme.cherry, hasFullWidth, cardsPerRow, testId, playVideoLabel = 'Spill av video', }) => {\n const uuid = useUuid();\n const buttonId = `videocard-button-${uuid}`;\n const titleId = `videocard-title-${uuid}`;\n const descriptionId = `videocard-description-${uuid}`;\n const { hoverRef, isHovered } = useHover();\n const wrapperClasses = classNames(wrapperClassName, cmsstyles['videocard-wrapper']);\n const videoCardClasses = classNames(cmsstyles.videocard, cmsstyles[`videocard--${theme}`], selected && cmsstyles['videocard--selected']);\n const imageClasses = classNames(cmsstyles.videocard__image, cardsPerRow == CardsPerRow.two && !hasFullWidth ? cmsstyles['videocard__image--medium-height'] : '', cardsPerRow == CardsPerRow.two && hasFullWidth ? cmsstyles['videocard__image--tall-height'] : '', cardsPerRow == CardsPerRow.four && hasFullWidth ? cmsstyles['videocard__image--tall-height-tablet'] : '', cardsPerRow == CardsPerRow.one ? cmsstyles['videocard__image--max-height'] : '');\n const buttonAriaLabelledBy = title ? `${buttonId} ${titleId}` : buttonId;\n const buttonAriaDescribedBy = description ? descriptionId : undefined;\n if (imageUrl?.length === 0) {\n return null;\n }\n const playLabelClasses = classNames(designsystemtypography.title3, cmsstyles.playbutton__label, {\n [cmsstyles['playbutton__label--active']]: isHovered || selected,\n });\n const titleClasses = classNames(designsystemtypography.title3, cmsstyles.videocard__title);\n return (_jsx(\"div\", { className: wrapperClasses, ref: hoverRef, children: _jsxs(\"div\", { className: videoCardClasses, \"data-analyticsid\": AnalyticsId.Videokort, \"data-testid\": testId, children: [_jsx(\"div\", { className: cmsstyles['videocard__image-wrapper'], children: _jsx(\"img\", { className: imageClasses, alt: \"\", src: imageUrl }) }), _jsxs(\"div\", { className: cmsstyles.videocard__content, children: [_jsxs(\"button\", { className: cmsstyles.playbutton, \"aria-labelledby\": buttonAriaLabelledBy, \"aria-describedby\": buttonAriaDescribedBy, \"aria-expanded\": selected, onClick: onClick, children: [_jsx(Icon, { size: 36, color: isHovered ? designTheme.palette.blueberry800 : designTheme.palette.blueberry700, svgIcon: Play, isHovered: isHovered }), _jsx(\"span\", { id: buttonId, className: playLabelClasses, children: playVideoLabel })] }), title && (_jsx(\"h3\", { id: titleId, className: titleClasses, children: title })), description && (_jsx(\"p\", { className: cmsstyles.videocard__description, id: buttonAriaDescribedBy, children: description }))] })] }) }));\n};\nexport default VideoKort;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { useRef } from 'react';\nimport classNames from 'classnames';\nimport { CardsPerRow, VideoTheme } from '../types/entities';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport VideoKort from '../videokort';\nimport VideoSpiller from './../videospiller';\nimport { VimeoSubtitleLanguageCodes } from '../videospiller/constants';\nimport styles from './styles.module.scss';\nconst VideoMatrise = ({ title, videoCards, cardsPerRow = CardsPerRow.four, theme = VideoTheme.cherry, hasFullWidth = false, resources, subtitleLanguageCode = VimeoSubtitleLanguageCodes.NORWEGIAN, }) => {\n const [currentIndex, setIndex] = React.useState();\n const matriseRef = useRef(null);\n React.useEffect(() => {\n const scrollToVideo = () => {\n if (typeof currentIndex !== 'undefined' && matriseRef.current) {\n matriseRef.current.scrollIntoView();\n }\n };\n scrollToVideo();\n }, [currentIndex]);\n if (videoCards.length === 0) {\n return null;\n }\n return (_jsxs(\"div\", { ref: matriseRef, children: [title && (_jsx(Title, { margin: 1.5, htmlMarkup: \"h2\", appearance: \"title3\", children: title })), _jsx(\"div\", { className: \"row\", children: videoCards.map((card, index) => {\n const wrapperClasses = classNames('col-12 col-md-6', {\n ['col-lg-3']: cardsPerRow === CardsPerRow.four,\n ['col-lg-4']: cardsPerRow === CardsPerRow.three,\n ['col-lg-6']: cardsPerRow === CardsPerRow.two,\n ['col-lg-12']: cardsPerRow === CardsPerRow.one,\n });\n return (_jsxs(React.Fragment, { children: [_jsx(VideoKort, { title: card.title, description: card.description, imageUrl: card.imageUrl, onClick: () => setIndex(index), wrapperClassName: wrapperClasses, cardsPerRow: cardsPerRow, selected: currentIndex === index, theme: theme, hasFullWidth: hasFullWidth, playVideoLabel: resources?.playVideo, testId: 'videoKort' }), currentIndex === index && (_jsx(VideoSpiller, { videoId: card.videoId, videoType: card.videoType, imageUrl: card.imageUrl, title: card.title, altText: card.altText, resources: resources, className: styles['videospiller--matrise'], subtitleLanguageCode: subtitleLanguageCode }))] }, index));\n }) })] }));\n};\nexport default VideoMatrise;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\n/* eslint-disable react/prop-types */\nimport { useContext } from 'react';\nimport { VideoTheme } from '../../../types/entities';\nimport { PortableTextContext } from '../..';\nimport VideoMatriseComponent from '../../../videomatrise';\nconst VideoMatriseBlock = ({ value }) => {\n const backgroundColor = useContext(PortableTextContext)?.backgroundColor;\n return (_jsx(VideoMatriseComponent, { title: value.title, videoCards: value.videoCards, cardsPerRow: value.cardsPerRow, theme: backgroundColor && isVideoThemeColor(backgroundColor) ? backgroundColor : value.theme, resources: value.resources }));\n};\nfunction isVideoThemeColor(value) {\n return Object.values(VideoTheme).includes(value);\n}\nexport default VideoMatriseBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport EkspanderendeBlock from './components/ekspanderendeblock';\nimport ImageBlock from './components/imageblock';\nimport Link from './components/link';\nimport LinkListBlock from './components/linklistblock';\nimport LoginBlock from './components/loginblock';\nimport TextBlock from './components/textblock';\nimport RichTextTitle from './components/title';\nimport VideoBlock from './components/videoblock';\nimport VideoMatriseBlock from './components/videomatriseblock';\nexport const globalComponents = {\n types: {\n EkspanderendeBlock,\n ImageBlock,\n LinkListBlock,\n TextBlock,\n VideoBlock,\n VideoMatriseBlock,\n LoginBlock,\n },\n block: {\n h1: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h1\", children: children }),\n h2: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h2\", children: children }),\n h3: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h3\", children: children }),\n h4: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h4\", children: children }),\n h5: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h5\", children: children }),\n },\n marks: {\n link: Link,\n superscript: ({ children }) => _jsx(\"sup\", { children: children }),\n subscript: ({ children }) => _jsx(\"sub\", { children: children }),\n },\n};\nexport const isBlockModelList = (list) => Array.isArray(list) && list.length > 0 && list.every(item => '_type' in item);\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createContext } from 'react';\nimport { PortableText as PortableTextReact } from '@portabletext/react';\nimport { globalComponents } from './portable-text-utils';\nexport const PortableTextContext = createContext(undefined);\nexport const PortableText = ({ components, value, className, backgroundColor, ...rest }) => {\n if (!value) {\n return null;\n }\n return (_jsx(PortableTextContext.Provider, { value: { backgroundColor: backgroundColor }, children: _jsx(\"div\", { className: className, children: _jsx(PortableTextReact, { components: { ...globalComponents, ...components }, value: value, ...rest }) }) }));\n};\nexport default PortableText;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/* eslint-disable jsx-a11y/interactive-supports-focus */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { Collapse } from 'react-collapse';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronDown from '@helsenorge/designsystem-react/components/Icons/ChevronDown';\nimport ChevronUp from '@helsenorge/designsystem-react/components/Icons/ChevronUp';\nimport Loader from '@helsenorge/designsystem-react/components/Loader';\nimport NotificationPanel from '@helsenorge/designsystem-react/components/NotificationPanel';\nimport PortableText from '@helsenorge/core-cms/richtext';\nimport { theme } from '@helsenorge/designsystem-react';\nimport { trackProsesshjelp } from '@helsenorge/framework-utils/adobe-analytics';\nexport class Seksjon extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n expanded: this.props.expanded,\n };\n this.toggleExpanded = this.toggleExpanded.bind(this);\n this.removeSeksjonClick = this.removeSeksjonClick.bind(this);\n }\n toggleExpanded() {\n if (this.props.toggleExpanded && this.props.seksjon) {\n if (this.props.seksjon.overskrift) {\n trackProsesshjelp('Prosesshjelp', 'Hjelp', this.props.seksjon.overskrift, !this.props.expanded ? 'Open' : 'Close');\n }\n this.props.toggleExpanded(this.props.seksjon.hjelpetekstId, this.props.seksjon.tjenesteNavn);\n }\n }\n removeSeksjonClick(event) {\n if (event !== undefined) {\n event.preventDefault();\n event.stopPropagation();\n }\n if (this.props.removeSeksjon && this.props.seksjon && this.props.seksjon.hjelpetekstId && this.props.seksjon.tjenesteNavn) {\n this.props.removeSeksjon(this.props.seksjon.hjelpetekstId, this.props.seksjon.tjenesteNavn);\n }\n }\n render() {\n const { resources, id, seksjon, expanded } = this.props;\n if (!seksjon || !resources) {\n return null;\n }\n let errorMessage;\n let seksjonComponent;\n const loader = seksjon.loading ? _jsx(Loader, { center: true, size: 'medium' }) : undefined;\n if (seksjon.error) {\n errorMessage = (_jsx(NotificationPanel, { label: resources.prosessHjelpError, variant: 'error', children: _jsx(\"p\", { children: resources.prosessHjelpErrorDescription }) }));\n }\n else {\n const sectionClasses = classNames('step', { open: expanded });\n seksjonComponent = (_jsxs(\"section\", { className: sectionClasses, children: [_jsx(\"div\", { className: \"org_helpdrawer__draweraccordionstepheader\", children: _jsx(\"h2\", { children: _jsxs(\"button\", { type: \"button\", onClick: this.toggleExpanded, className: \"org_helpdrawer__draweraccordionsteptitle\", \"aria-expanded\": expanded, \"aria-controls\": id, children: [_jsx(Icon, { svgIcon: expanded ? ChevronUp : ChevronDown, color: theme.palette.blueberry700 }), this.props.seksjon ? this.props.seksjon.overskrift : ''] }) }) }), _jsx(\"div\", { id: id, children: _jsx(Collapse, { isOpened: !!expanded, children: _jsx(\"div\", { children: _jsx(\"div\", { className: \"org_helpdrawer__draweraccordionstepcontents\", children: seksjon.brodtekst?.length && _jsx(PortableText, { value: seksjon.brodtekst }) }) }) }) })] }));\n }\n return (_jsxs(\"div\", { className: \"org_helpdrawer__draweraccordion\", children: [errorMessage, seksjonComponent, loader] }));\n }\n}\nObject.defineProperty(Seksjon, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n resources: undefined,\n }\n});\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n// Løses i forbindelse med #282399\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/* eslint-disable jsx-a11y/role-has-required-aria-props */\nimport { useEffect, useState, useRef } from 'react';\nimport classNames from 'classnames';\nimport { Icon, IconSize } from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport ChevronRight from '@helsenorge/designsystem-react/components/Icons/ChevronRight';\nimport HelpSign from '@helsenorge/designsystem-react/components/Icons/HelpSign';\nimport X from '@helsenorge/designsystem-react/components/Icons/X';\nimport aria from '@helsenorge/core-utils/aria-hidden';\nimport TrapFocus from '@helsenorge/core-utils/trapfocus';\nimport { Breakpoint, theme, useBreakpoint, useFocusToggle, useHover } from '@helsenorge/designsystem-react';\nimport { trackProsesshjelp } from '@helsenorge/framework-utils/adobe-analytics';\nimport { setAllowNavigation } from '@helsenorge/framework-utils/hn-user';\nimport { Seksjon } from './seksjon';\nimport styles from './styles.module.scss';\nimport './styles.scss';\nexport const HjelpeskuffComponent = props => {\n const { isVisible = true, defaultSeksjon, resources, seksjoner } = props;\n const breakpoint = useBreakpoint();\n const [disableTransition, setDisableTransition] = useState(false);\n const { hoverRef, isHovered } = useHover();\n const helpTitleRef = useRef(null);\n const helpDrawerRef = useRef(null);\n const helpContentsRef = useRef(null);\n const [prevAriaHiddens, setPrevAriaHiddens] = useState();\n const [trapFocus, setTrapFocus] = useState();\n const [prevFocus, setPrevFocus] = useState();\n useFocusToggle(helpContentsRef, props.isOpen);\n const trackToggleOpen = (activeSeksjonId, isOpen) => {\n let activeSeksjon;\n if (activeSeksjonId && seksjoner) {\n activeSeksjon = seksjoner.find((seksjon) => {\n return activeSeksjonId === seksjon.hjelpetekstId;\n });\n }\n else {\n activeSeksjon = props.defaultSeksjon;\n }\n if (activeSeksjon && activeSeksjon.overskrift) {\n trackProsesshjelp('Prosesshjelp', 'Hjelp', activeSeksjon.overskrift, isOpen ? 'Open' : 'Close');\n }\n };\n const enableTrapFocus = () => {\n if (trapFocus) {\n return; // Focus already trapped\n }\n setPrevFocus(document.activeElement);\n setTrapFocus(new TrapFocus(helpDrawerRef.current));\n };\n const toggleFocus = () => {\n if (props.isOpen && isVisible) {\n enableTrapFocus();\n const node = helpDrawerRef.current;\n if (node instanceof Element) {\n setPrevAriaHiddens(aria.setAriaHidden(node));\n if (helpTitleRef.current) {\n helpTitleRef.current.focus();\n }\n }\n }\n };\n const releaseFocus = () => {\n if (prevAriaHiddens) {\n aria.resetAriaHidden(prevAriaHiddens);\n }\n if (trapFocus) {\n trapFocus.deactivate();\n setTrapFocus(undefined);\n if (prevFocus) {\n prevFocus.focus();\n }\n setPrevFocus(undefined);\n }\n };\n const handleToggleClick = () => {\n if (props.toggleShowHjelpeskuff) {\n props.toggleShowHjelpeskuff();\n }\n };\n const elementIsInHelpDrawer = (eventTarget) => {\n for (const target of eventTarget) {\n if (target?.classList?.contains('org_helpdrawer')) {\n return true;\n }\n }\n return false;\n };\n const elementIsInHjelpetrigger = (eventTarget) => {\n for (const target of eventTarget) {\n if (target?.classList?.contains('js-prosesshjelp')) {\n return true;\n }\n }\n return false;\n };\n const isMobile = () => {\n return breakpoint <= Breakpoint.sm;\n };\n const isOpenInHistoryState = () => {\n return window.history.state && window.history.state.helpDrawerOpen;\n };\n const removePreventscroll = () => {\n document.documentElement.classList.remove('preventscroll');\n };\n const isLightboxOpen = () => {\n return document.querySelectorAll('.toolkit-lightbox').length > 0;\n };\n const setScroll = () => {\n if (document.documentElement.classList.contains('preventscroll') && !props.isOpen && !isLightboxOpen()) {\n removePreventscroll();\n }\n else {\n document.documentElement.classList.add('preventscroll');\n }\n };\n const open = () => {\n // Only push state to enable back/forward browser navigation if help drawer use the full width (mobile)\n if (isMobile() && !isOpenInHistoryState()) {\n window.history.pushState(Object.assign({}, window.history.state, { helpDrawerOpen: true }), '', window.location.href);\n }\n setScroll();\n };\n const close = () => {\n if (isMobile() && isOpenInHistoryState()) {\n setAllowNavigation(true);\n window.history.back();\n }\n if (!isLightboxOpen()) {\n removePreventscroll();\n }\n };\n const disableTransitionToPreventDoubleAnimation = (callback) => {\n setDisableTransition(true);\n callback();\n window.setTimeout(() => {\n setDisableTransition(false);\n }, 500);\n };\n const popStateListener = () => {\n setAllowNavigation(false);\n const helpDrawerOpen = window.history.state && window.history.state.helpDrawerOpen;\n if (helpDrawerOpen && !props.isOpen && props.showHjelpeskuff) {\n disableTransitionToPreventDoubleAnimation(props.showHjelpeskuff);\n }\n else if (!helpDrawerOpen && props.isOpen && props.hideHjelpeskuff) {\n disableTransitionToPreventDoubleAnimation(props.hideHjelpeskuff);\n }\n };\n const clickListener = (e) => {\n if (isVisible && props.isOpen) {\n const eventPath = e.composedPath();\n if (!elementIsInHelpDrawer(eventPath) && !elementIsInHjelpetrigger(eventPath) && props.hideHjelpeskuff) {\n props.hideHjelpeskuff();\n }\n }\n };\n const removeSeksjon = (triggerId, tjenesteNavn) => {\n toggleFocus();\n if (props.removeSeksjon) {\n props.removeSeksjon(triggerId, tjenesteNavn);\n }\n };\n useEffect(() => {\n toggleFocus();\n }, []);\n useEffect(() => {\n if (props.isOpen) {\n window.addEventListener('popstate', popStateListener);\n window.addEventListener('click', clickListener);\n toggleFocus();\n open();\n trackToggleOpen(props.activeSeksjonId, props.isOpen);\n }\n else {\n releaseFocus();\n close();\n }\n return () => {\n releaseFocus();\n window.removeEventListener('popstate', popStateListener);\n window.removeEventListener('click', clickListener);\n };\n }, [props.isOpen]);\n if (!isVisible || !resources) {\n return null;\n }\n const helpDrawerClasses = classNames({\n org_helpdrawer: true,\n open: props.isOpen,\n });\n let defaultSeksjonComponent;\n let seksjonerComponent;\n if (defaultSeksjon != null) {\n defaultSeksjonComponent = (_jsx(Seksjon, { id: \"default\", seksjon: defaultSeksjon, expanded: !!defaultSeksjon.expanded, resources: resources, toggleExpanded: props.toggleExpanded }));\n }\n if (seksjoner != null) {\n seksjonerComponent = (_jsx(\"div\", { children: seksjoner.map((seksjon, index) => (_jsx(Seksjon, { id: index.toString(), seksjon: seksjon, expanded: !!seksjon.expanded, resources: resources, removeSeksjon: removeSeksjon, toggleExpanded: props.toggleExpanded }, index.toString()))) }));\n }\n let style = {};\n if (disableTransition) {\n style = { transitionDuration: '0s' };\n }\n const ariaLabelTitleText = defaultSeksjon && defaultSeksjon.overskrift\n ? defaultSeksjon.overskrift\n : seksjoner && seksjoner.length && seksjoner[0].overskrift\n ? seksjoner[0].overskrift\n : '';\n return (_jsxs(\"div\", { ref: helpDrawerRef, className: helpDrawerClasses, style: style, children: [_jsx(\"span\", { className: \"org_helpdrawer__control\", children: _jsxs(\"button\", { className: \"org_helpdrawer__controlbutton\", type: \"button\", onClick: handleToggleClick, tabIndex: 0, \"aria-label\": props.isOpen ? resources.helpDrawerCloseHelpButton : resources.helpDrawerToggleHelpButton, \"data-testid\": 'helpdrawer', children: [_jsx(Icon, { svgIcon: HelpSign, color: theme.palette.white, className: 'org_helpdrawer__icon' }), props.isOpen ? (_jsx(Icon, { svgIcon: ChevronRight, color: theme.palette.white })) : (_jsx(Icon, { svgIcon: ChevronLeft, color: theme.palette.white }))] }) }), _jsxs(\"div\", { className: \"org_helpdrawer__contents\", \"aria-hidden\": !props.isOpen, ref: helpContentsRef, children: [_jsxs(\"div\", { className: \"org_helpdrawer__drawerheader\", children: [_jsxs(\"div\", { className: \"helptitle-wrap\", role: \"heading\", tabIndex: 0, \"aria-label\": `${resources.helpDrawerHelpIconLabel} ${ariaLabelTitleText}`, ref: helpTitleRef, children: [_jsx(Icon, { svgIcon: HelpSign, color: theme.palette.white, className: 'org_helpdrawer__icon' }), _jsx(\"h1\", { className: \"helptitle\", children: resources.helpDrawerTitle })] }), _jsxs(\"button\", { ref: hoverRef, className: styles['close-button'], onClick: props.hideHjelpeskuff, type: \"button\", children: [_jsx(Icon, { size: IconSize.XSmall, svgIcon: X, color: theme.palette.white, isHovered: isHovered }), _jsx(\"span\", { className: styles['close-button__screen-reader-text'], children: resources.helpDrawerCloseHelpButton })] })] }), _jsxs(\"div\", { children: [defaultSeksjonComponent, seksjonerComponent] })] })] }));\n};\nexport default HjelpeskuffComponent;\n","import { selectCmsTjenesteTekster, selectCmsTjenesteTekstForHjelpetekstId } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nconst TOGGLE_SHOW = 'hjelpeskuff/TOGGLE_SHOW';\nconst TOGGLE_SHOW_HELPITEM = 'hjelpeskuff/TOGGLE_SHOW_HELPITEM';\nconst SET_ACTIVE_HELPBUBBLE = 'hjelpeskuff/SET_ACTIVE_HELPBUBBLE';\nconst HIDE = 'hjelpeskuff/HIDE';\nconst SHOW = 'hjelpeskuff/SHOW';\nconst REMOVE_SEKSJON = 'hjelpeskuff/REMOVE_SEKSJON';\nconst TOGGLE_EXPANDED = 'hjelpeskuff/TOGGLE_EXPANDED';\nconst ADD_HJELPETRIGGER = 'hjelpeskuff/ADD_HJELPETRIGGER';\nconst REMOVE_HJELPETRIGGER = 'hjelpeskuff/ADD_HJELPETRIGGER';\nconst POPULATE_SKUFF = 'hjelpeskuff/POPULATE_SKUFF';\nconst initialState = {\n isOpen: false,\n activeBubble: undefined,\n activeSeksjonId: undefined,\n activeTriggerComponentId: undefined,\n seksjoner: [],\n defaultIsExpanded: undefined,\n triggerComponentIds: [],\n};\nfunction collapseAll(seksjoner) {\n return seksjoner.map((seksjon) => {\n if (seksjon.expanded) {\n return Object.assign({}, seksjon, {\n expanded: false,\n });\n }\n return seksjon;\n });\n}\nfunction isDefaultTrigger(action) {\n return action.hjelpetekstId === undefined;\n}\nexport function processToggleShowHelp(state = initialState, action) {\n const { activeSeksjonId, activeTriggerComponentId } = state;\n let seksjoner = state.seksjoner;\n const sameTriggerId = activeSeksjonId === action.hjelpetekstId;\n const sameTriggerComponentId = activeTriggerComponentId ? activeTriggerComponentId === action.triggerComponentId : false;\n if (!isDefaultTrigger(action)) {\n if (seksjoner && !seksjoner.some(s => s.hjelpetekstId === action.hjelpetekstId)) {\n seksjoner = collapseAll(seksjoner).concat({\n hjelpetekstId: action.hjelpetekstId,\n tjenesteNavn: action.tjenesteNavn,\n expanded: true,\n });\n }\n else {\n seksjoner =\n state.seksjoner &&\n state.seksjoner.map((seksjon) => {\n if (seksjon.hjelpetekstId === action.hjelpetekstId && seksjon.tjenesteNavn === action.tjenesteNavn) {\n return Object.assign({}, seksjon, { expanded: true });\n }\n if (seksjon.expanded) {\n return Object.assign({}, seksjon, { expanded: false });\n }\n return seksjon;\n });\n }\n }\n else if (seksjoner) {\n seksjoner = collapseAll(seksjoner);\n }\n if (!sameTriggerId || !state.isOpen) {\n // Add new helpsection to state\n return Object.assign({}, state, {\n isOpen: true,\n activeSeksjonId: action.hjelpetekstId,\n activeTriggerComponentId: action.triggerComponentId,\n tjenesteNavn: action.tjenesteNavn,\n activeBubble: undefined,\n seksjoner,\n defaultIsExpanded: isDefaultTrigger(action),\n });\n }\n else if (sameTriggerId && state.isOpen) {\n return Object.assign({}, state, {\n isOpen: false,\n activeSeksjonId: undefined,\n activeTriggerComponentId: undefined,\n activeBubble: undefined,\n });\n }\n else if (!sameTriggerComponentId) {\n // Add new active trigger id\n return Object.assign({}, state, {\n activeTriggerComponentId: action.triggerComponentId,\n });\n }\n // Same trigger clicked as last time, close drawer\n return Object.assign({}, state, {\n isOpen: false,\n activeSeksjonId: undefined,\n activeTriggerComponentId: undefined,\n activeBubble: undefined,\n });\n}\nfunction getBlankSeksjonIdIfActiv(action, state) {\n if (state.activeSeksjonId === action.hjelpetekstId) {\n return '';\n }\n return state.activeSeksjonId ? state.activeSeksjonId : '';\n}\nfunction removeSection(seksjoner, triggerId, tjenesteNavn) {\n if (triggerId != null && triggerId !== '' && seksjoner != null) {\n if (seksjoner.some(s => s.hjelpetekstId === triggerId)) {\n return seksjoner.filter(item => !(item.hjelpetekstId === triggerId && item.tjenesteNavn === tjenesteNavn));\n }\n }\n return seksjoner;\n}\nexport default function reducer(state = initialState, action) {\n switch (action.type) {\n case TOGGLE_SHOW:\n return Object.assign({}, state, {\n isOpen: !state.isOpen,\n activeBubble: undefined,\n activeTriggerComponentId: undefined,\n defaultIsExpanded: state.defaultIsExpanded === undefined ? true : state.defaultIsExpanded,\n });\n case TOGGLE_SHOW_HELPITEM:\n return processToggleShowHelp(state, action);\n case SET_ACTIVE_HELPBUBBLE:\n return Object.assign({}, state, {\n isOpen: false,\n activeBubble: action.triggerComponentId,\n activeSeksjonId: undefined,\n });\n case HIDE:\n return Object.assign({}, state, {\n isOpen: false,\n activeTriggerComponentId: undefined,\n });\n case SHOW:\n return Object.assign({}, state, {\n isOpen: true,\n defaultIsExpanded: state.defaultIsExpanded === undefined ? true : state.defaultIsExpanded,\n });\n case REMOVE_SEKSJON:\n return Object.assign({}, state, {\n activeSeksjonId: getBlankSeksjonIdIfActiv(action, state),\n seksjoner: removeSection(state.seksjoner ? state.seksjoner : [], action.hjelpetekstId ? action.hjelpetekstId : '', action.tjenesteNavn ? action.tjenesteNavn : ''),\n });\n case TOGGLE_EXPANDED:\n if (isDefaultTrigger(action)) {\n return Object.assign({}, state, { defaultIsExpanded: !state.defaultIsExpanded });\n }\n return Object.assign({}, state, {\n seksjoner: state.seksjoner\n ? state.seksjoner.map((seksjon) => {\n if (seksjon.hjelpetekstId === action.hjelpetekstId && seksjon.tjenesteNavn === action.tjenesteNavn) {\n return Object.assign({}, seksjon, {\n expanded: !seksjon.expanded,\n });\n }\n return seksjon;\n })\n : [],\n });\n case ADD_HJELPETRIGGER:\n return Object.assign({}, state, {\n triggerComponentIds: state.triggerComponentIds\n ? [...state.triggerComponentIds, action.triggerComponentId]\n : [action.triggerComponentId],\n });\n case REMOVE_HJELPETRIGGER:\n return Object.assign({}, state, {\n triggerComponentIds: state.triggerComponentIds ? state.triggerComponentIds.filter(id => id !== action.triggerComponentId) : [],\n });\n case POPULATE_SKUFF:\n return Object.assign({}, state, {\n seksjoner: state.seksjoner\n ? state.seksjoner.concat({\n hjelpetekstId: action.hjelpetekstId,\n tjenesteNavn: action.tjenesteNavn,\n expanded: true,\n })\n : [],\n });\n default:\n return state;\n }\n}\nexport function toggleShowHjelpeskuff() {\n return {\n type: TOGGLE_SHOW,\n };\n}\nexport function toggleShowHelpItem(triggerComponentId, hjelpetekstId, tjenesteNavn) {\n return {\n type: TOGGLE_SHOW_HELPITEM,\n triggerComponentId,\n hjelpetekstId,\n tjenesteNavn,\n };\n}\nexport function removeSeksjonTekst(hjelpetekstId, tjenesteNavn) {\n return {\n type: REMOVE_SEKSJON,\n hjelpetekstId,\n tjenesteNavn,\n };\n}\nexport function toggleExpanded(hjelpetekstId, tjenesteNavn) {\n return {\n type: TOGGLE_EXPANDED,\n hjelpetekstId,\n tjenesteNavn,\n };\n}\nexport function hideHjelpeskuff() {\n return {\n type: HIDE,\n };\n}\nexport function showHjelpeskuff() {\n return {\n type: SHOW,\n };\n}\nexport function addHjelpetrigger(triggerComponentId) {\n return {\n type: ADD_HJELPETRIGGER,\n triggerComponentId: triggerComponentId,\n };\n}\nexport function removeHjelpetrigger(triggerComponentId) {\n return {\n type: REMOVE_HJELPETRIGGER,\n triggerComponentId: triggerComponentId,\n };\n}\nexport function setActiveBubble(triggerComponentId) {\n return {\n type: SET_ACTIVE_HELPBUBBLE,\n triggerComponentId: triggerComponentId,\n };\n}\nexport function populateSkuff(hjelpetekstId, tjenesteNavn) {\n return {\n type: POPULATE_SKUFF,\n hjelpetekstId,\n tjenesteNavn,\n };\n}\nexport function getTriggerData(state, hjelpetekstId, tjenesteNavn) {\n const triggerData = selectCmsTjenesteTekstForHjelpetekstId(state, tjenesteNavn, hjelpetekstId);\n if (triggerData != null) {\n const { sporsmaalTekst, hjelpeboble, hjelpetekst, overskrift } = triggerData;\n return {\n sporsmalstekst: sporsmaalTekst,\n bobletekst: hjelpeboble,\n hasSeksjonText: !!hjelpetekst?.length && !!overskrift,\n };\n }\n return undefined;\n}\nexport function getActiveBubble(state) {\n const skuff = state.hjelpeskuff;\n return skuff.activeBubble ?? '';\n}\nexport function getDefaultTekst(state, tjenesteNavn, hjelpetekstId) {\n const getDefaultTjenesteTekst = () => {\n const tjenesteTeksterDetails = selectCmsTjenesteTekster(state, tjenesteNavn);\n return {\n overskrift: tjenesteTeksterDetails?.data?.hjelpetekster?.overskift,\n brodtekst: tjenesteTeksterDetails?.data?.hjelpetekster?.hjelpetekst,\n };\n };\n const getSpesifikkHjelpetekst = () => {\n const spesifikkHjelpetekst = hjelpetekstId ? selectCmsTjenesteTekstForHjelpetekstId(state, tjenesteNavn, hjelpetekstId) : undefined;\n return {\n overskrift: spesifikkHjelpetekst?.overskrift,\n brodtekst: spesifikkHjelpetekst?.hjelpetekst,\n };\n };\n const shouldUseSpesifikkHjelpetekst = !!hjelpetekstId;\n const hjelpetekst = shouldUseSpesifikkHjelpetekst ? getSpesifikkHjelpetekst() : getDefaultTjenesteTekst();\n if (hjelpetekst.brodtekst && hjelpetekst.overskrift) {\n return {\n overskrift: hjelpetekst?.overskrift,\n brodtekst: hjelpetekst?.brodtekst,\n loading: false,\n error: false,\n expanded: state.hjelpeskuff.defaultIsExpanded,\n };\n }\n return null;\n}\nexport function getSeksjonTekst(state, seksjon) {\n if (!seksjon.tjenesteNavn)\n return null;\n const hjelpeteksterForTjeneste = selectCmsTjenesteTekster(state, seksjon.tjenesteNavn);\n const hjelpetekst = hjelpeteksterForTjeneste?.data?.hjelpetekster?.spesifikkeHjelpetekster?.find(ht => ht.id === seksjon.hjelpetekstId);\n if (hjelpetekst) {\n return {\n overskrift: hjelpetekst.overskrift,\n brodtekst: hjelpetekst.hjelpetekst,\n hjelpetekstId: seksjon.hjelpetekstId,\n tjenesteNavn: seksjon.tjenesteNavn,\n loading: false,\n error: false,\n expanded: seksjon.expanded,\n };\n }\n return null;\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { fetchTjenesteTekster } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport { getPath } from '@helsenorge/framework-utils/hn-page';\nimport { fetchResources, getResourcesFromState } from '@helsenorge/framework-utils/resources';\nimport HjelpeskuffComponent from './hjelpeskuff-component';\nimport { toggleShowHjelpeskuff, hideHjelpeskuff, showHjelpeskuff, getDefaultTekst, getSeksjonTekst, removeSeksjonTekst, toggleExpanded, toggleShowHelpItem, addHjelpetrigger, removeHjelpetrigger, } from './hjelpeskuff-state';\nimport { getResources, Projects } from '../../resources';\nexport const TriggerHelpItemEvent = 'HN-trigger-help-item';\nexport const AddHjelpetrigger = 'HN-add-hjelpetrigger';\nexport const RemoveHjelpetrigger = 'HN-remove-hjelpetrigger';\nclass HjelpeskuffContainer extends React.Component {\n constructor(props) {\n super(props);\n this.handleAddHjelpetriggerEvent = this.handleAddHjelpetriggerEvent.bind(this);\n this.handleRemoveHjelpetriggerEvent = this.handleRemoveHjelpetriggerEvent.bind(this);\n this.handleTriggerHelpEvent = this.handleTriggerHelpEvent.bind(this);\n }\n componentDidMount() {\n if (this.props.mount) {\n this.props.mount();\n }\n window.addEventListener(AddHjelpetrigger, this.handleAddHjelpetriggerEvent);\n window.addEventListener(RemoveHjelpetrigger, this.handleRemoveHjelpetriggerEvent);\n window.addEventListener(TriggerHelpItemEvent, this.handleTriggerHelpEvent);\n }\n componentWillUnmount() {\n window.removeEventListener(AddHjelpetrigger, this.handleAddHjelpetriggerEvent, false);\n window.removeEventListener(RemoveHjelpetrigger, this.handleRemoveHjelpetriggerEvent, false);\n window.removeEventListener(TriggerHelpItemEvent, this.handleTriggerHelpEvent, false);\n }\n handleAddHjelpetriggerEvent(event) {\n if (event.detail && this.props.addHjelpetrigger) {\n const triggerComponentId = event.detail.triggerComponentId;\n this.props.addHjelpetrigger(triggerComponentId);\n }\n }\n handleRemoveHjelpetriggerEvent(event) {\n if (event.detail && this.props.removeHjelpetrigger) {\n const triggerComponentId = event.detail.triggerComponentId;\n this.props.removeHjelpetrigger(triggerComponentId);\n }\n }\n handleTriggerHelpEvent(event) {\n if (event.detail && this.props.triggerHelpItem) {\n const hjelpetekstId = event.detail.hjelpetekstId;\n const tjenesteNavn = event.detail.tjenesteNavn;\n const triggerComponentId = event.detail.triggerComponentId;\n this.props.triggerHelpItem(hjelpetekstId, tjenesteNavn, triggerComponentId);\n }\n }\n render() {\n const { triggerComponentIds, mount, ...other } = this.props;\n if (!this.props.resources || (!this.props.defaultSeksjon && this.props.seksjoner && this.props.seksjoner.length === 0)) {\n return null;\n }\n return (_jsx(\"div\", { children: _jsx(HjelpeskuffComponent, { ...other }) }));\n }\n}\nfunction mapStateToProps(state, props) {\n const tjenesteNavn = props.tjenesteNavn ?? getPath();\n const defaultSeksjon = getDefaultTekst(state, tjenesteNavn, props.hjelpetekstId);\n const seksjoner = (state.hjelpeskuff.seksjoner?.map(seksjon => getSeksjonTekst(state, seksjon))?.filter(s => s != null) ??\n []);\n return {\n activeSeksjonId: state.hjelpeskuff.activeSeksjonId,\n seksjoner,\n defaultSeksjon,\n isOpen: state.hjelpeskuff.isOpen,\n triggerComponentIds: state.hjelpeskuff.triggerComponentIds,\n resources: getResourcesFromState(state, Projects.FRAMEWORK),\n };\n}\nfunction mapDispatchToProps(dispatch, props) {\n return {\n mount: () => {\n dispatch(fetchResources({ project: Projects.FRAMEWORK, language: props.language, getResources }));\n dispatch(fetchTjenesteTekster({ name: props.tjenesteNavn ?? getPath(), language: props.language }));\n },\n toggleExpanded: (hjelpetekstId, tjenesteNavn) => {\n dispatch(toggleExpanded(hjelpetekstId, tjenesteNavn));\n },\n toggleShowHjelpeskuff: () => {\n dispatch(toggleShowHjelpeskuff());\n },\n hideHjelpeskuff: () => {\n dispatch(hideHjelpeskuff());\n },\n showHjelpeskuff: () => {\n dispatch(showHjelpeskuff());\n },\n removeSeksjon: (hjelpetekstId, tjenesteNavn) => {\n dispatch(removeSeksjonTekst(hjelpetekstId, tjenesteNavn));\n },\n triggerHelpItem: (hjelpetekstId, tjenesteNavn, triggerComponentId) => {\n dispatch(toggleShowHelpItem(triggerComponentId ? triggerComponentId : '', hjelpetekstId, tjenesteNavn ?? ''));\n },\n addHjelpetrigger: (triggerComponentId) => {\n dispatch(addHjelpetrigger(triggerComponentId ? triggerComponentId : ''));\n },\n removeHjelpetrigger: (triggerComponentId) => {\n dispatch(removeHjelpetrigger(triggerComponentId ? triggerComponentId : ''));\n },\n language: props.language,\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(HjelpeskuffContainer);\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport HelpQuestion from '@helsenorge/designsystem-react/components/HelpQuestion';\nimport Trigger from '@helsenorge/designsystem-react/components/Trigger';\nimport { TriggerHelpItemEvent } from '../hjelpeskuff';\nconst HjelpetriggerComponent = React.forwardRef(({ resources, sporsmalstekst, classes, tjenesteNavn, hjelpetekstId, helpBubbleIsExpanded, size, stopPropagation, useCustomEvent, onClick, }, ref) => {\n if (!resources) {\n return null;\n }\n const handleHelpClick = (event) => {\n if (stopPropagation && event) {\n event.stopPropagation();\n }\n if (useCustomEvent) {\n const helpElement = {\n hjelpetekstId: hjelpetekstId,\n tjenesteNavn,\n triggerComponentId: hjelpetekstId, // denne skal egentlig være unik\n };\n const triggerHelpItemEvent = new CustomEvent(TriggerHelpItemEvent, {\n detail: helpElement,\n });\n window.dispatchEvent(triggerHelpItemEvent);\n }\n if (onClick) {\n onClick();\n }\n };\n let trigger;\n if (sporsmalstekst) {\n trigger = (_jsx(HelpQuestion, { className: classes, onClick: handleHelpClick, ref: ref, children: sporsmalstekst }));\n }\n else {\n trigger = (_jsx(Trigger, { className: classes, onClick: handleHelpClick, ariaLabel: resources.helpTriggerLabel, selected: helpBubbleIsExpanded, size: size, ref: ref }));\n }\n return _jsx(\"span\", { className: \"js-prosesshjelp\", children: trigger });\n});\nHjelpetriggerComponent.displayName = 'HjelpetriggerComponent';\nexport default HjelpetriggerComponent;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React from 'react';\nimport HelpBubble from '@helsenorge/designsystem-react/components/HelpBubble';\nimport SafeHTML from '@helsenorge/framework-utils/components/safe-html';\nimport HjelpetriggerComponent from './hjelpetrigger-component';\nexport const HjelpebobleComponent = ({ hjelpetekstId, resources, onChange, onShowMoreClick, visible, triggerData, tjenesteNavn, bubbleText, moreHelpText, }) => {\n const hjelpetriggerRef = React.useRef(null);\n const showMoreButton = triggerData ? triggerData.hasSeksjonText : false;\n const renderBubbleContent = () => {\n return bubbleText ? _jsx(SafeHTML, { html: bubbleText }) : _jsx(\"span\", { children: triggerData?.bobletekst ?? '' });\n };\n const showMoreClickHandler = (event) => {\n event?.stopPropagation();\n if (onShowMoreClick) {\n onShowMoreClick(hjelpetekstId, tjenesteNavn);\n }\n };\n const renderBubble = () => {\n return (_jsx(HelpBubble, { controllerRef: hjelpetriggerRef, linkText: moreHelpText ? moreHelpText : resources?.moreHelp, onLinkClick: showMoreButton ? showMoreClickHandler : undefined, showBubble: visible, closeAriaLabel: resources?.helpBubbleClose, onClose: () => {\n onChange && onChange();\n }, children: renderBubbleContent() }));\n };\n if (!triggerData || !resources) {\n return _jsx(\"div\", {});\n }\n return (_jsxs(\"span\", { children: [_jsx(HjelpetriggerComponent, { ref: hjelpetriggerRef, hjelpetekstId: hjelpetekstId, resources: resources, sporsmalstekst: triggerData.sporsmalstekst, tjenesteNavn: tjenesteNavn, onClick: onChange, helpBubbleIsExpanded: visible }), renderBubble()] }));\n};\nexport default HjelpebobleComponent;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { fetchTjenesteTekster } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport { fetchResources, getResourcesFromState } from '@helsenorge/framework-utils/resources';\nimport { GetResourcesEvent } from './../hjelpetrigger';\nimport HjelpetriggerComponent from './hjelpetrigger-component';\nimport { getResources, Projects } from '../../resources';\nimport { AddHjelpetrigger, RemoveHjelpetrigger } from '../hjelpeskuff';\nexport class HjelpetriggerContainer extends React.Component {\n componentDidMount() {\n if (this.props.useCustomEvent) {\n const helpElement = {\n triggerComponentId: this.props.triggerComponentId, // denne skal egentlig være unik. this.createUniqueId() benyttes i container\n tjenesteNavn: this.props.tjenesteNavn,\n hjelpetekstId: this.props.hjelpetekstId,\n language: this.props.language,\n };\n const addHjelpetriggerEvent = new CustomEvent(AddHjelpetrigger, {\n detail: helpElement,\n });\n window.dispatchEvent(addHjelpetriggerEvent);\n const getResourcesEvent = new CustomEvent(GetResourcesEvent, {\n detail: helpElement,\n });\n window.dispatchEvent(getResourcesEvent);\n }\n }\n componentWillUnmount() {\n if (this.props.useCustomEvent) {\n const helpElement = {\n triggerComponentId: this.props.triggerComponentId, // denne skal egentlig være unik. this.createUniqueId() benyttes i container\n };\n const removeHjelpetriggerEvent = new CustomEvent(RemoveHjelpetrigger, {\n detail: helpElement,\n });\n window.dispatchEvent(removeHjelpetriggerEvent);\n }\n }\n render() {\n const { resources, sporsmalstekst, classes, hjelpetekstId, isDefault, size, tjenesteNavn, onClick, helpBubbleIsExpanded, stopPropagation, useCustomEvent, } = this.props;\n return (_jsx(HjelpetriggerComponent, { hjelpetekstId: hjelpetekstId, isDefault: isDefault, resources: resources, classes: classes, size: size, sporsmalstekst: sporsmalstekst, tjenesteNavn: tjenesteNavn, onClick: onClick, helpBubbleIsExpanded: helpBubbleIsExpanded, stopPropagation: stopPropagation, useCustomEvent: useCustomEvent }));\n }\n}\nfunction mapStateToProps(state, props) {\n return {\n ...props,\n resources: getResourcesFromState(state, Projects.FRAMEWORK),\n };\n}\nfunction mapDispatchToProps(dispatch, props) {\n const language = props.language ?? LanguageLocales.NORWEGIAN;\n return {\n ...props,\n mount: () => {\n dispatch(fetchResources({ project: Projects.FRAMEWORK, language: language, getResources }));\n if (props.tjenesteNavn) {\n dispatch(fetchTjenesteTekster({ name: props.tjenesteNavn, language: language }));\n }\n },\n dispatch,\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(HjelpetriggerContainer);\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { uuid } from '@helsenorge/designsystem-react';\nimport { fetchTjenesteTekster } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport { getPath } from '@helsenorge/framework-utils/hn-page';\nimport { fetchResources, getResourcesFromState } from '@helsenorge/framework-utils/resources';\nimport HjelpebobleComponent from './hjelpeboble-component';\nimport HjelpetriggerContainer from './hjelpetrigger-container';\nimport { getResources, Projects } from '../../resources';\nimport { addHjelpetrigger, removeHjelpetrigger, populateSkuff, getTriggerData, getActiveBubble, setActiveBubble, toggleShowHelpItem, } from '../hjelpeskuff/hjelpeskuff-state';\nexport const GetResourcesEvent = 'HN-Get-Resources';\nclass Hjelpetrigger extends React.Component {\n constructor(props) {\n super(props);\n this.validateProps(props);\n this.handleBubbleClick = this.handleBubbleClick.bind(this);\n this.handleTriggerClick = this.handleTriggerClick.bind(this);\n this.getResourcesEvent = this.getResourcesEvent.bind(this);\n this.state = {\n triggerComponentId: this.createUniqueId(),\n };\n }\n componentDidMount() {\n if (this.props.mount) {\n this.props.mount();\n }\n const { dispatch } = this.props;\n if (!this.props.isDefault && dispatch && this.state.triggerComponentId) {\n dispatch(addHjelpetrigger(this.state.triggerComponentId));\n }\n if (this.props.populateSkuff && dispatch && this.props.hjelpetekstId && this.props.tjenesteNavn) {\n dispatch(populateSkuff(this.props.hjelpetekstId, this.props.tjenesteNavn));\n }\n window.addEventListener(GetResourcesEvent, this.getResourcesEvent);\n }\n componentWillUnmount() {\n const { dispatch } = this.props;\n if (!this.props.isDefault && dispatch && this.state.triggerComponentId) {\n dispatch(removeHjelpetrigger(this.state.triggerComponentId));\n }\n window.removeEventListener(GetResourcesEvent, this.getResourcesEvent);\n }\n getResourcesEvent(event) {\n if (event.detail && event.detail.tjenesteNavn && this.props.dispatch) {\n this.props.dispatch(fetchResources({ project: Projects.FRAMEWORK, language: event.detail.language, getResources }));\n this.props.dispatch(fetchTjenesteTekster({ name: event.detail.tjenesteNavn, language: event.detail.language }));\n }\n }\n createUniqueId() {\n return uuid();\n }\n validateProps(props) {\n if (props.isDefault) {\n this.validateDefaultProps(props);\n }\n else if (!props.hjelpetekstId) {\n throw new Error('HjelpetekstId mÃ¥ angis for helpTrigger');\n }\n }\n validateDefaultProps(props) {\n if (!props.isDefault) {\n return;\n }\n if (props.hjelpetekstId) {\n throw new Error('Default helptrigger kan ikke ha en hjelpetekstId...');\n }\n }\n handleBubbleClick() {\n const { dispatch } = this.props;\n const { triggerComponentId } = this.state;\n if (dispatch) {\n if (this.isBubbleVisible()) {\n dispatch(setActiveBubble(''));\n }\n else if (triggerComponentId) {\n dispatch(setActiveBubble(triggerComponentId));\n }\n }\n }\n handleTriggerClick(overrideHelpetekstId, overrideTjenesteNavn) {\n const { dispatch, hjelpetekstId, tjenesteNavn } = this.props;\n const { triggerComponentId } = this.state;\n const newHjelpetekstId = overrideHelpetekstId || hjelpetekstId;\n const newTjenesteNavn = overrideTjenesteNavn || tjenesteNavn;\n if (dispatch) {\n dispatch(toggleShowHelpItem(triggerComponentId ? triggerComponentId : '', newHjelpetekstId, newTjenesteNavn || ''));\n }\n }\n isBubbleVisible() {\n const { activeBubble } = this.props;\n const { triggerComponentId } = this.state;\n return activeBubble === triggerComponentId;\n }\n renderHjelpetrigger() {\n const { isDefault, triggerData, stopPropagation, ...other } = this.props;\n const extraProps = {\n triggerComponentId: this.state.triggerComponentId,\n };\n if (!isDefault && triggerData) {\n extraProps.sporsmalstekst = triggerData.sporsmalstekst;\n }\n return (_jsx(HjelpetriggerContainer, { size: this.props.size, ...other, ...extraProps, onClick: this.handleTriggerClick, stopPropagation: stopPropagation }));\n }\n render() {\n const { resources, triggerData, hjelpetekstId, tjenesteNavn, isDefault, bubbleText, moreHelpText } = this.props;\n if (!resources) {\n return null;\n }\n let helpTriggerItem;\n if (bubbleText || (triggerData && triggerData.bobletekst)) {\n helpTriggerItem = (_jsx(HjelpebobleComponent, { hjelpetekstId: hjelpetekstId, resources: resources, onChange: this.handleBubbleClick, onShowMoreClick: this.handleTriggerClick, visible: this.isBubbleVisible(), triggerData: triggerData, tjenesteNavn: tjenesteNavn, bubbleText: bubbleText, moreHelpText: moreHelpText }));\n }\n else if (isDefault || triggerData) {\n helpTriggerItem = this.renderHjelpetrigger();\n }\n return _jsx(\"span\", { children: helpTriggerItem });\n }\n}\nfunction mapStateToProps(state, props) {\n return {\n resources: getResourcesFromState(state, Projects.FRAMEWORK),\n tjenesteNavn: props.tjenesteNavn || getPath(),\n triggerData: props.isDefault ? undefined : getTriggerData(state, props.hjelpetekstId || '', props.tjenesteNavn || getPath() || ''),\n activeBubble: getActiveBubble(state),\n };\n}\nfunction mapDispatchToProps(dispatch, props) {\n return {\n mount: () => {\n dispatch(fetchResources({ project: Projects.FRAMEWORK, language: props.language ?? LanguageLocales.NORWEGIAN, getResources }));\n const tjenesteNavn = props.tjenesteNavn ?? getPath();\n if (tjenesteNavn) {\n dispatch(fetchTjenesteTekster({ name: tjenesteNavn, language: props.language ?? LanguageLocales.NORWEGIAN }));\n }\n },\n dispatch,\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(Hjelpetrigger);\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport Eye from '@helsenorge/designsystem-react/components/Icons/Eye';\nimport NoEye from '@helsenorge/designsystem-react/components/Icons/NoEye';\nimport FrankensteinSharingStatus from '@helsenorge/designsystem-react/components/SharingStatus';\nimport useResources from '@helsenorge/framework-utils/resources/useResources';\nimport { getResources, Projects } from '../resources';\nimport styles from './styles.module.scss';\nconst SharingStatus = ({ classNames, selectedStatusType }) => {\n const resources = useResources(Projects.FRAMEWORK, getResources);\n if (!resources) {\n return null;\n }\n let sharingStatus = null;\n if (selectedStatusType === 'deltMedBarnet') {\n sharingStatus = (_jsx(FrankensteinSharingStatus, { icon: Eye, color: 'kiwi', className: styles['sharing-status-label'], children: resources.sharing_Status_Delt_Med_Barnet }));\n }\n if (selectedStatusType === 'bareSynligForDeg') {\n sharingStatus = (_jsx(FrankensteinSharingStatus, { icon: NoEye, color: 'cherry', className: styles['sharing-status-label'], children: resources.sharing_Status_Bare_Synlig_For_Deg }));\n }\n return _jsx(\"div\", { className: classNames, children: sharingStatus });\n};\nexport default SharingStatus;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport classNames from 'classnames';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport SafeHTML from '@helsenorge/framework-utils/components/safe-html';\nimport { getSidetittelId } from '@helsenorge/framework-utils/hn-page';\nimport { getErRepresentasjon, getHarAktivtForeldreSamtykke } from '@helsenorge/framework-utils/hn-user';\nimport { Hjelpetrigger } from '../prosesshjelp/index';\nimport SharingStatus from '../sharing-status';\nimport frameworkstyles from './styles.module.scss';\nconst PageHeader = ({ title, titleId = getSidetittelId(), subtitle, description, tjenesteNavn, hjelpetekstId, delAvForeldresamtykke, headerClassName, headerSubtitleClassName, headerTitleClassName, headerIngressClassName, showHjelpetrigger, language = LanguageLocales.NORWEGIAN, }) => {\n const hasHjelpetrigger = tjenesteNavn && showHjelpetrigger;\n const renderHjelpetrigger = () => (_jsx(\"span\", { className: frameworkstyles.pageheader__hjelpetrigger, children: _jsx(Hjelpetrigger, { size: 'large', isDefault: hjelpetekstId === undefined, tjenesteNavn: tjenesteNavn, hjelpetekstId: hjelpetekstId, language: language }) }));\n if (!title && !description) {\n return null;\n }\n const pageHeaderClasses = classNames('col-12', 'col-lg-10', frameworkstyles.pageheader, headerClassName);\n const titleClasses = classNames(frameworkstyles.pageheader__title, hasHjelpetrigger && frameworkstyles['pageheader__title--trigger'], headerTitleClassName);\n return (_jsx(\"div\", { className: \"row\", children: _jsxs(\"div\", { className: pageHeaderClasses, children: [subtitle && _jsx(\"div\", { className: classNames(frameworkstyles['pageheader__subtitle'], headerSubtitleClassName), children: subtitle }), _jsx(Title, { id: titleId, htmlMarkup: 'h1', appearance: 'title1', margin: 0, className: titleClasses, children: title }), hasHjelpetrigger && renderHjelpetrigger(), _jsx(\"hn-webcomp-infopanel\", {}), description && (_jsx(SafeHTML, { html: description, tagName: \"p\", className: classNames(designsystemtypography['anchorlink-wrapper'], frameworkstyles.pageheader__ingress, headerIngressClassName) })), getHarAktivtForeldreSamtykke() && getErRepresentasjon() && delAvForeldresamtykke && (_jsx(SharingStatus, { classNames: frameworkstyles['pageheader__sharing-status'], selectedStatusType: 'deltMedBarnet' }))] }) }));\n};\nexport default PageHeader;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport NotificationPanel from '@helsenorge/designsystem-react/components/NotificationPanel';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport styles from './styles.module.scss';\nconst ErrorMessage = ({ label, labelId, description, correlationId }) => {\n return (_jsxs(NotificationPanel, { role: \"alert\", variant: 'error', label: label, labelId: labelId, children: [description && _jsx(\"p\", { children: description }), correlationId && (_jsxs(_Fragment, { children: [_jsx(Spacer, { size: \"s\" }), _jsx(\"p\", { className: styles.errormessage__correlationid, children: `Id: ${correlationId}` })] }))] }));\n};\nexport default ErrorMessage;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport Loader from '@helsenorge/designsystem-react/components/Loader';\nimport NotificationPanel from '@helsenorge/designsystem-react/components/NotificationPanel';\nimport { getCorrelationIdList } from '@helsenorge/framework-utils/hn-proxy-service';\nimport ErrorMessage from '../error-message';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isEmpty(obj) {\n return !obj || Object.keys(obj).length === 0;\n}\nconst PageLoader = props => {\n let data;\n let error = null;\n let warning = null;\n let info = null;\n const spinning = (!props.ignoreResources && isEmpty(props.resources)) || props.loading;\n if (spinning) {\n data = _jsx(Loader, { center: true, ...props.loaderProps });\n }\n else {\n if (props.info) {\n info = (_jsx(NotificationPanel, { variant: 'info', label: props.info, labelId: props.labelId, children: _jsx(\"p\", { children: props.infoDescription }) }, \"info\"));\n }\n if (props.warning) {\n warning = (_jsxs(NotificationPanel, { variant: 'warn', label: props.warning, labelId: !props.info ? props.labelId : undefined, children: [_jsx(\"p\", { children: props.warningDescription }), _jsx(\"p\", { children: props.warningContent })] }, \"warning\"));\n }\n if (props.error) {\n const correlationId = getCorrelationIdList()?.join(', ');\n error = (_jsx(ErrorMessage, { label: props.error, labelId: !props.info && !props.warning ? props.labelId : undefined, description: props.errorDescription, correlationId: correlationId }));\n if (props.showChildrenOnError) {\n data = props.children;\n }\n }\n else {\n data = props.children;\n }\n }\n const ariaAttributes = props.live\n ? {\n 'aria-busy': spinning,\n 'aria-live': 'polite',\n }\n : undefined;\n return (_jsxs(\"div\", { ...ariaAttributes, \"data-testid\": props.testId, children: [info, warning, error, data] }));\n};\nexport default PageLoader;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport ReactAutosuggest from 'react-autosuggest';\nimport ErrorWrapper from '@helsenorge/designsystem-react/components/ErrorWrapper';\nimport { renderLabel } from '@helsenorge/designsystem-react/components/Label';\nimport { FormOnColor } from '@helsenorge/designsystem-react/constants';\nimport { useUuid } from '@helsenorge/designsystem-react/hooks/useUuid';\nimport { getAriaDescribedBy } from '@helsenorge/designsystem-react/utils/accessibility';\nimport styles from './styles.module.scss';\nconst renderSuggestion = (suggestion) => (_jsxs(\"span\", { children: [suggestion.label, suggestion.optionalLabel && (_jsxs(_Fragment, { children: [' ', _jsx(\"em\", { children: suggestion.optionalLabel })] }))] }));\nconst getSuggestionValue = (suggestion) => (suggestion.label ? suggestion.label : '');\nconst Autosuggest = props => {\n const inputId = useUuid(props.inputProps.id);\n const errorTextUuid = useUuid(props.errorTextId);\n const inputProps = {\n ...props.inputProps,\n id: inputId,\n 'aria-invalid': props.error,\n 'aria-describedby': getAriaDescribedBy({ ...props.inputProps, ...props }, errorTextUuid),\n };\n return (_jsx(ErrorWrapper, { errorText: props.errorText, errorTextId: errorTextUuid, className: props.errorWrapperClassName, children: _jsxs(\"div\", { className: props.className, children: [renderLabel(props.label, inputId, props.error ? FormOnColor.oninvalid : FormOnColor.onwhite), _jsx(ReactAutosuggest, { theme: styles, suggestions: props.suggestions, inputProps: inputProps, onSuggestionsFetchRequested: props.onSuggestionsFetchRequested, onSuggestionsClearRequested: props.onSuggestionsClearRequested, onSuggestionSelected: props.onSuggestionSelected, getSuggestionValue: getSuggestionValue, renderSuggestion: props.renderSuggestion ? props.renderSuggestion : renderSuggestion, focusInputOnSuggestionClick: props.focusInputOnSuggestionClick || false })] }) }));\n};\nexport default Autosuggest;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport classnames from 'classnames';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport styles from './styles.module.scss';\nconst SubContent = ({ countShowing, error, data, showMorePageSize, showMoreButtonClasses, showMoreButtonText, updateCountShowing, }) => {\n const subContentClasses = classnames({\n [styles['table__sub-content']]: true,\n [styles['table__sub-content--has-error']]: !!error,\n });\n return (_jsxs(_Fragment, { children: [_jsx(\"div\", { className: subContentClasses, children: !!error && _jsx(\"p\", { children: `Temporary error msg: ${error.Title} ${error.Body}` }) }), showMorePageSize && countShowing && data && countShowing < data.length ? (_jsx(Button, { wrapperClassName: showMoreButtonClasses, onClick: updateCountShowing, children: showMoreButtonText })) : null] }));\n};\nexport default SubContent;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { TableHeadCell, SortDirection } from '@helsenorge/designsystem-react/components/Table';\nfunction reverseSortDirection(sortDir) {\n return sortDir === SortDirection.desc ? SortDirection.asc : SortDirection.desc;\n}\nexport const createHeaders = (columns, colSortDirs, onHeaderClickSortChange, initialSortColumnKey, sortDisabled, sortColumnKey, expandableRow, isTwoDimensional, sortedData) => {\n const headers = [];\n if ((expandableRow || isTwoDimensional) && sortedData && sortedData.length > 0) {\n headers.push(_jsx(TableHeadCell, {}, \"expandableHeader\"));\n }\n for (let i = 0; i < columns.length; ++i) {\n const column = columns[i];\n const title = column.props.title;\n const altTitle = (_jsxs(_Fragment, { children: [column.props.altTitle, _jsx(\"br\", {})] }));\n const name = column.props.name;\n const headerkey = `header${i}`;\n const sortDirection = colSortDirs[name];\n if (initialSortColumnKey && sortDisabled) {\n headers.push(_jsxs(TableHeadCell, { sortable: false, children: [altTitle, title] }));\n }\n else if (column.props.sortable && sortedData && sortedData.length > 0) {\n headers.push(_jsxs(TableHeadCell, { sortable: true, sortDir: sortDirection, onClick: () => {\n onHeaderClickSortChange(name, sortDirection ? reverseSortDirection(sortDirection) : 'asc');\n }, children: [altTitle, title] }, name));\n }\n else if (name === sortColumnKey && sortedData && sortedData.length > 0) {\n headers.push(_jsxs(TableHeadCell, { sortable: false, sortDir: sortDirection, children: [altTitle, title] }, name));\n }\n else {\n headers.push(_jsxs(TableHeadCell, { children: [altTitle, title] }, headerkey));\n }\n }\n return headers;\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport { TableCell } from '@helsenorge/designsystem-react/components/Table';\nimport styles from '../table/styles.module.scss';\nexport class Cell extends React.Component {\n highlightText(text, highlight) {\n const highlightStartIndex = text.toLowerCase().indexOf(highlight.toLowerCase());\n if (highlightStartIndex >= 0) {\n const highlightEndIndex = highlightStartIndex + highlight.length;\n const textStart = text.substr(0, highlightStartIndex);\n const textHighlight = text.substr(highlightStartIndex, highlight.length);\n const textEnd = text.substr(highlightEndIndex);\n return (_jsxs(\"span\", { children: [textStart, _jsx(\"span\", { className: styles['table__highlight-text'], children: textHighlight }), textEnd] }));\n }\n return text;\n }\n highlightContent(children, highlightText) {\n const highlightedContent = React.Children.map(children, (child) => {\n if (typeof child === 'string') {\n return this.highlightText(child.toString(), highlightText);\n }\n if (child) {\n const childProps = child.props;\n if (childProps && childProps.children) {\n const highlightedChildren = this.highlightContent(childProps.children, highlightText);\n return Object.assign({}, child, { props: Object.assign({}, childProps, { children: highlightedChildren }) });\n }\n }\n return child;\n });\n return highlightedContent;\n }\n render() {\n const { children, highlightText, columnKey } = this.props;\n const content = highlightText ? this.highlightContent(children, highlightText) : children;\n return (_jsx(TableCell, { dataLabel: columnKey || '', textAlign: this.props.textAlign, children: content }));\n }\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport { TableExpanderCell, TableRow } from '@helsenorge/designsystem-react/components/Table';\nimport { Cell } from './cell';\nexport class Row extends React.PureComponent {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"triggerRef\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"toggleClick\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n const { expandableRowKey, rowKey, toggle } = this.props;\n if (toggle && expandableRowKey) {\n toggle(expandableRowKey, rowKey);\n }\n }\n });\n Object.defineProperty(this, \"focusOnTrigger\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (this.triggerRef.current) {\n this.triggerRef.current.focus();\n }\n }\n });\n this.triggerRef = React.createRef();\n }\n createRow(columns, rowData, expandableRow, expanded) {\n const { tableId, expandableRowKey, isTwoDimensional, showDetailsText = 'Vis', hideDetailsText = 'Skjul', highlightText } = this.props;\n const newColumns = [];\n const expandableRowId = !isTwoDimensional ? `${tableId}-${expandableRowKey}` : '';\n if (expandableRow) {\n // Expand trigger column. Hidden on smaller screens.\n newColumns.push(_jsx(TableExpanderCell, { expanded: expanded, hideDetailsText: hideDetailsText, showDetailsText: showDetailsText, expandableRowId: expandableRowId }));\n }\n for (let i = 0; i < columns.length; ++i) {\n const column = columns[i];\n const element = column.props.cell;\n if (React.isValidElement(element)) {\n const props = {\n columnKey: `${column.props.altTitle ? `${column.props.altTitle} / ` : ``}${column.props.title}`,\n rowData,\n key: column.props.name,\n highlightText: highlightText,\n altTitle: column.props.altTitle,\n };\n if (column.props.cell) {\n newColumns.push(React.cloneElement(element, Object.assign({}, column.props.cell.props, props)));\n }\n }\n else {\n let processedJsonObjectName;\n let rowValue;\n const processedColName = column.props.name.split('.');\n if (processedColName.length > 1) {\n const temp = rowData[processedColName[0]];\n rowValue = temp[processedColName[1]];\n }\n else {\n processedJsonObjectName = processedColName[0];\n rowValue = rowData[processedJsonObjectName];\n }\n newColumns.push(_jsx(Cell, { columnKey: column.props.title, rowData: rowData, highlightText: highlightText, children: rowValue }, column.props.name));\n }\n }\n return newColumns;\n }\n render() {\n const { rowData, columns, rowClasses, expandableRow, expanded } = this.props;\n let cells = null;\n if (columns) {\n cells = this.createRow(columns, rowData, !!expandableRow, expanded);\n }\n return (_jsx(TableRow, { className: rowClasses, onClick: this.toggleClick, expandable: expandableRow, expanded: expanded, hideDetailsText: this.props.hideDetailsText, showDetailsText: this.props.showDetailsText, children: cells }, this.props.rowKey));\n }\n}\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport { SortDirection } from '@helsenorge/designsystem-react/components/Table';\nimport { Row } from './row';\nexport const sortIndexes = (columnKey, sortDir, data, useNumericSort, customSetSortValue) => {\n const sortIndexes = data.slice();\n sortIndexes.sort((a, b) => {\n let valueA;\n let valueB;\n const processedColNameValue = columnKey.split('.');\n if (processedColNameValue.length > 1) {\n const tempA = a[processedColNameValue[0]];\n const tempB = b[processedColNameValue[0]];\n valueA = tempA[processedColNameValue[1]];\n valueB = tempB[processedColNameValue[1]];\n }\n else {\n const columnValue = processedColNameValue[0];\n valueA = a[columnValue];\n valueB = b[columnValue];\n }\n if (!valueA) {\n valueA = '';\n }\n if (!valueB) {\n valueB = '';\n }\n if (customSetSortValue) {\n valueA = customSetSortValue(a, valueA, columnKey);\n valueB = customSetSortValue(b, valueB, columnKey);\n }\n const compareOptions = useNumericSort ? { numeric: true, sensitivity: 'base' } : {};\n let sortVal = 0;\n sortVal = valueA.localeCompare(valueB, 'nb', compareOptions);\n if (sortVal !== 0 && sortDir === SortDirection.desc) {\n sortVal = sortVal * -1;\n }\n return sortVal;\n });\n return sortIndexes;\n};\nexport const isTableTwoDimensional = (data, columns) => {\n for (const rowData of data) {\n for (const column of columns) {\n if (Array.isArray(rowData[column.props.name])) {\n return true;\n }\n }\n }\n return false;\n};\nexport const createLevel2Rows = (rowData, isExpanded, rowKey, columns) => {\n const rows = [];\n if (columns) {\n for (const column of columns) {\n if (!Array.isArray(rowData[column.props.name])) {\n continue;\n }\n if (!column.props.level2Cells) {\n continue;\n }\n const childRows = rowData[column.props.name];\n for (let j = 0; j < childRows.length; j++) {\n const childRowKey = `${rowKey}_${column.props.name}_${j}`;\n rows.push(React.cloneElement(column.props.level2Cells, {\n key: childRowKey,\n columns: columns,\n rowData: childRows[j],\n expandableRow: true,\n expanded: isExpanded,\n index: j,\n total: childRows.length,\n }));\n }\n }\n }\n return rows;\n};\nexport const createRows = (tableId, data, toggleExpandRow, getOrCreateRowRef, rowKeyColumnKey, highlightText, emptyContentText, emptyContentElement, columns, isTwoDimensional, expandableRow, expandedRows, className) => {\n const showDetailsText = 'Vis detaljer'; // TODO: Replace with resource values\n const hideDetailsText = 'Skjul detaljer'; // TODO: Replace with resource values\n const rows = [];\n for (let index = 0; index < data.length; ++index) {\n let rowKey = `row${index}`;\n const expandableRowKey = `expandableRow${index}`;\n const rowData = data[index];\n if (rowKeyColumnKey && rowData[rowKeyColumnKey]) {\n rowKey = rowData[rowKeyColumnKey];\n }\n const isExpanded = expandedRows ? !!expandedRows[expandableRowKey] : false;\n const isExpandableRow = expandableRow !== null || !!isTwoDimensional;\n rows.push(_jsx(Row, { tableId: tableId, ref: getOrCreateRowRef(rowKey), rowData: rowData, columns: columns, rowClasses: className, expandableRow: isExpandableRow, expanded: isExpanded, toggle: toggleExpandRow, highlightText: highlightText, showDetailsText: showDetailsText, hideDetailsText: hideDetailsText, rowKey: rowKey, expandableRowKey: expandableRowKey, isTwoDimensional: !!isTwoDimensional }, rowKey));\n const level2Rows = createLevel2Rows(rowData, isExpanded, rowKey, columns);\n rows.push(...level2Rows);\n if (expandableRow && React.isValidElement(expandableRow)) {\n const props = {\n colspan: columns ? columns.length + 1 : 0,\n rowData,\n key: expandableRowKey,\n open: isExpanded,\n toggle: toggleExpandRow,\n hideDetailsText: hideDetailsText,\n expandableRowKey,\n tableId: tableId,\n };\n rows.push(React.cloneElement(expandableRow, props));\n }\n }\n if (rows.length === 0) {\n // TODO: Replace fallback text with resource values\n const label = columns && columns[0] ? columns[0].props.title : '';\n rows.push(_jsx(\"tr\", { children: _jsxs(\"td\", { \"data-label\": label, colSpan: columns ? columns.length : 0, children: [_jsx(\"em\", { children: emptyContentText }), emptyContentElement ? emptyContentElement : null] }) }, 'noContentRow'));\n }\n return rows;\n};\nconst isColumn = (child) => child['type'].isExpandableRow || child['type'].isColumn;\nexport const checkChildren = (props) => {\n const columns = [];\n let expandableRow = null;\n React.Children.forEach(props.children, child => {\n if (child === null) {\n return;\n }\n if (isColumn(child)) {\n if (child['type'].isExpandableRow) {\n expandableRow = child;\n }\n if (child['type'].isColumn) {\n columns.push(child);\n }\n }\n });\n return { columns, expandableRow };\n};\nexport const updateColumns = (props) => {\n const childrenProps = checkChildren(props);\n return childrenProps.columns;\n};\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport classnames from 'classnames';\nimport Table, { TableBody, TableHead, HeaderCategory, SortDirection, TableRow, } from '@helsenorge/designsystem-react/components/Table';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport SubContent from './sub-content';\nimport { createHeaders } from './table-head-helper';\nimport { sortIndexes, isTableTwoDimensional, createRows, checkChildren, updateColumns } from './table-helper';\nimport styles from './styles.module.scss';\nexport class DataTable extends React.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"rowRefs\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"componentDidUpdate\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (_prevProps, prevState) => {\n // Fokus pÃ¥ siste rad idet Hent flere-knapp ikke vises lenger\n if (this.props.data?.length &&\n this.props.showMoreButtonText &&\n prevState.countShowing !== this.state.countShowing &&\n this.state.countShowing === this.props.data.length) {\n const rowKey = `row${this.props.data.length - 1}`;\n if (Object.prototype.hasOwnProperty.call(this.rowRefs, rowKey)) {\n this.rowRefs[rowKey].current?.focusOnTrigger();\n }\n }\n }\n });\n Object.defineProperty(this, \"getOrCreateRowRef\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (rowKey) => {\n if (!Object.prototype.hasOwnProperty.call(this.rowRefs, rowKey)) {\n this.rowRefs[rowKey] = React.createRef();\n }\n return this.rowRefs[rowKey];\n }\n });\n Object.defineProperty(this, \"onHeaderClickSortChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (columnKey, sortDir) => {\n if (this.props.sortDisabled) {\n this.setState({\n currentSortDir: sortDir,\n currentSortKey: columnKey,\n });\n if (this.props.onSortColumn) {\n this.props.onSortColumn(columnKey, sortDir === SortDirection.asc, true, true);\n }\n }\n else {\n this.onSortChange(columnKey, sortDir, this.state.sortedData ? this.state.sortedData : [], true);\n }\n }\n });\n Object.defineProperty(this, \"onSortChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (columnKey, sortDir, data, isClicked) => {\n const sortedData = sortIndexes(columnKey, sortDir, data, this.props.useNumericSort, this.props.customSetSortValue);\n this.setState({\n sortedData: sortedData,\n colSortDirs: {\n [columnKey]: sortDir,\n },\n currentSortDir: sortDir,\n currentSortKey: columnKey,\n sortedByUserClick: isClicked ? isClicked : false,\n expandedRows: {},\n }, this.sortStateChanged);\n }\n });\n Object.defineProperty(this, \"sortStateChanged\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (this.props.onSortColumn) {\n this.props.onSortColumn(this.state.currentSortKey ? this.state.currentSortKey : '', this.state.currentSortDir === SortDirection.asc, this.state.sortedByUserClick, this.props.sortDisabled);\n }\n }\n });\n Object.defineProperty(this, \"toggleExpandRow\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (expandableRowKey) => {\n const expanded = !!this.state.expandedRows && this.state.expandedRows[expandableRowKey];\n this.setState({ expandedRows: Object.assign({}, this.state.expandedRows, { [expandableRowKey]: !expanded }) });\n }\n });\n Object.defineProperty(this, \"updateCountShowing\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (event) => {\n if (event) {\n event.preventDefault();\n }\n if (this.props.data && this.props.showMorePageSize && this.state.countShowing) {\n const newCountShowing = this.state.countShowing + this.props.showMorePageSize;\n if (newCountShowing <= this.props.data.length) {\n this.setState({\n countShowing: newCountShowing,\n });\n }\n else if (this.state.countShowing < this.props.data.length) {\n this.setState({\n countShowing: this.props.data.length,\n });\n }\n }\n }\n });\n const { initialSortColumnKey, initialSortDirIsAsc, data, disableTwoDimensional, showMorePageSize } = props;\n const childrenProps = checkChildren(props);\n const colSortDirs = {};\n if (initialSortColumnKey) {\n colSortDirs[initialSortColumnKey] = initialSortDirIsAsc ? SortDirection.asc : SortDirection.desc;\n }\n this.rowRefs = {};\n this.state = {\n unsortedData: data ? data : [],\n sortedData: data ? data : [],\n colSortDirs,\n columns: childrenProps.columns,\n expandableRow: childrenProps.expandableRow,\n sortable: false,\n currentSortDir: undefined,\n currentSortKey: '',\n prevSortDir: undefined,\n prevSortKey: '',\n sortedByUserClick: false,\n expandedRows: {},\n isTwoDimensional: data && !disableTwoDimensional ? isTableTwoDimensional(data, childrenProps.columns) : false,\n countShowing: showMorePageSize,\n };\n }\n componentDidMount() {\n this.setState({ unsortedData: this.props.data });\n if (this.props.initialSortColumnKey && (!this.props.sortDisabled || this.props.doInitialSort) && this.props.data) {\n this.onSortChange(this.props.initialSortColumnKey, this.props.initialSortDirIsAsc ? SortDirection.asc : SortDirection.desc, this.props.data);\n }\n }\n static getDerivedStateFromProps(nextProps, prevState) {\n const updatedState = { ...prevState };\n if (nextProps.data !== prevState.unsortedData) {\n updatedState.unsortedData = nextProps.data ? nextProps.data : [];\n }\n if (nextProps.sortDisabled !== !!prevState.sortable) {\n updatedState.sortable = !nextProps.sortDisabled;\n }\n const nextSortColumnKey = nextProps.sortColumnKey ? nextProps.sortColumnKey : prevState.prevSortKey;\n const nextSortColumDir = nextProps.sortDirIsAsc !== null && typeof nextProps.sortDirIsAsc !== 'undefined'\n ? nextProps.sortDirIsAsc\n ? SortDirection.asc\n : SortDirection.desc\n : prevState.prevSortDir;\n // Sammenlikner sortprops med sortstates for Ã¥ se om det har kommet nye oppdateringer utenfor klassen\n if (!nextProps.sortDisabled &&\n nextSortColumnKey &&\n nextProps.data &&\n nextSortColumDir &&\n (nextSortColumnKey !== prevState.prevSortKey ||\n nextSortColumDir !== prevState.prevSortDir ||\n nextProps.data !== prevState.unsortedData)) {\n // I stor grad samme hÃ¥ndtering som gjøres i onSortChange(), mÃ¥ kopieres nÃ¥ som vi ikke har \"this\" her.\n updatedState.sortedData = sortIndexes(nextSortColumnKey, nextSortColumDir, nextProps.data ?? [], nextProps.useNumericSort, nextProps.customSetSortValue);\n updatedState.colSortDirs = {\n [nextSortColumnKey]: nextSortColumDir,\n };\n updatedState.currentSortDir = nextSortColumDir;\n updatedState.currentSortKey = nextSortColumnKey;\n updatedState.prevSortDir = nextSortColumDir;\n updatedState.prevSortKey = nextSortColumnKey;\n updatedState.expandedRows = {};\n if (nextProps.onSortColumn) {\n nextProps.onSortColumn(nextSortColumnKey, nextSortColumDir === SortDirection.asc, true, nextProps.sortDisabled);\n }\n }\n // Hvis vi har ny data, men ikke pga. ny sortering\n else {\n if (nextProps.data !== prevState.unsortedData) {\n const newData = nextProps.data ? nextProps.data : [];\n updatedState.unsortedData = newData;\n updatedState.sortedData = newData;\n }\n }\n const currentColumnCount = prevState.columns ? prevState.columns.length : 0;\n const nextColumnCount = checkChildren(nextProps).columns.length;\n if (currentColumnCount !== nextColumnCount) {\n updatedState.columns = updateColumns(nextProps);\n }\n if (updatedState !== prevState) {\n return updatedState;\n }\n else {\n return null;\n }\n }\n render() {\n const { sortedData, columns, isTwoDimensional, countShowing, colSortDirs, expandableRow, expandedRows } = this.state;\n const { id, caption, error, data, showMorePageSize, showMoreButtonClasses, showMoreButtonText, wrapperClassNames, tableClassNames, breakpointConfig, initialSortColumnKey, sortDisabled, sortColumnKey, rowKeyColumnKey, highlightText, emptyContentText, emptyContentElement, noAnchorLinkWrapper, rowClassNames, mode, } = this.props;\n const rows = sortedData\n ? createRows(id, countShowing ? sortedData.slice(0, countShowing) : sortedData, this.toggleExpandRow, this.getOrCreateRowRef, rowKeyColumnKey, highlightText, emptyContentText, emptyContentElement, columns, isTwoDimensional, expandableRow, expandedRows, rowClassNames)\n : [];\n const wrapperClasses = classnames({\n [`${styles['table']}`]: true,\n }, wrapperClassNames);\n const headers = createHeaders(columns ? columns : [], colSortDirs ? colSortDirs : {}, this.onHeaderClickSortChange, initialSortColumnKey, sortDisabled, sortColumnKey, expandableRow, isTwoDimensional, sortedData);\n const tableClasses = classnames({\n [`${designsystemtypography['anchorlink-wrapper']}`]: !noAnchorLinkWrapper,\n }, tableClassNames);\n const captionId = `${id}-caption`;\n return (_jsxs(\"div\", { className: wrapperClasses, children: [_jsxs(Table, { className: tableClasses, id: id, breakpointConfig: breakpointConfig, mode: mode, scrollAriaLabelledById: captionId, children: [_jsx(\"caption\", { className: `${styles.table__caption}`, id: captionId, children: caption }), _jsx(TableHead, { category: !sortDisabled ? HeaderCategory.sortable : this.props.transparentHeader ? HeaderCategory.transparent : HeaderCategory.normal, children: _jsx(TableRow, { children: headers }, \"head\") }), !error ? _jsx(TableBody, { children: rows }) : _jsx(_Fragment, {})] }), _jsx(SubContent, { countShowing: countShowing, error: error, data: data, showMorePageSize: showMorePageSize, showMoreButtonText: showMoreButtonText, showMoreButtonClasses: showMoreButtonClasses, updateCountShowing: this.updateCountShowing })] }));\n }\n}\nObject.defineProperty(DataTable, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n sortDisabled: false,\n caption: 'Dette er en tabell',\n id: 'Table1',\n }\n});\n","import * as React from 'react';\nexport class Column extends React.Component {\n render() {\n return null;\n }\n}\nObject.defineProperty(Column, \"isColumn\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n});\n","import { Fragment as _Fragment, jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport { TableExpandedRow } from '@helsenorge/designsystem-react/components/Table';\nexport class ExpandableRow extends React.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"rowRef\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"toggleClick\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (this.props.expandableRowKey && this.props.toggle) {\n this.props.toggle(this.props.expandableRowKey);\n }\n }\n });\n this.rowRef = React.createRef();\n }\n render() {\n const { className, children, rowData, open, colspan, hideDetailsText, tableId, expandableRowKey } = this.props;\n let childrenElement;\n if (children) {\n if (React.isValidElement(children)) {\n const props = {\n rowData: rowData,\n expanded: open,\n };\n childrenElement = React.cloneElement(children, props);\n }\n else {\n childrenElement = children;\n }\n }\n return (_jsx(TableExpandedRow, { expanded: !!open, numberOfColumns: colspan || 1, hideDetailsText: hideDetailsText || '', toggleClick: this.toggleClick, id: `${tableId}-${expandableRowKey}`, className: className, children: _jsx(_Fragment, { children: childrenElement }) }, `${tableId}-${expandableRowKey}`));\n }\n}\nObject.defineProperty(ExpandableRow, \"isExpandableRow\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n});\n","import { createContext, useContext } from 'react';\nimport resources from '../../resources/HN.Core.Filter.NPM.JS.nb-NO.json';\nexport const defaultResources = resources;\nconst ResourcesContext = createContext(defaultResources);\nexport const useResourcesContext = () => useContext(ResourcesContext);\nexport const ResourcesContextProvider = ResourcesContext.Provider;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport NoFilter from '@helsenorge/designsystem-react/components/Icons/NoFilter';\nimport { KeyboardEventKey, useFocusToggle, useFocusTrap, useKeyboardEvent } from '@helsenorge/designsystem-react';\nimport styles from './styles.module.scss';\nconst NoScroll = () => (_jsx(\"style\", { children: `body {\n overflow: hidden;\n width: 100vw;\n min-width: 100%;\n}` }));\nconst OffCanvas = props => {\n const { isOpened } = props;\n const [isVisible, setIsVisible] = React.useState(isOpened);\n const wrapperRef = React.useRef(null);\n React.useEffect(() => {\n if (isOpened) {\n setIsVisible(true);\n }\n }, [isOpened]);\n const handleTransitionEnd = () => {\n if (!isOpened) {\n setIsVisible(false);\n }\n };\n useFocusTrap(wrapperRef, isOpened);\n useFocusToggle(wrapperRef, isOpened);\n const handleKeyboardEvent = (e) => {\n e.stopPropagation();\n e.preventDefault();\n props.onClose();\n };\n useKeyboardEvent(wrapperRef, handleKeyboardEvent, [KeyboardEventKey.Escape]);\n const wrapperClasses = classNames(styles.offcanvas, { [styles['offcanvas--open']]: isOpened, [styles['offcanvas--not-visible']]: !isVisible }, props.className);\n const contentClasses = classNames(styles.offcanvas__content, { [styles['offcanvas__content--is-loading']]: props.isLoading });\n return (_jsxs(\"div\", { ref: wrapperRef, className: wrapperClasses, onTransitionEnd: handleTransitionEnd, children: [isOpened && _jsx(NoScroll, {}), _jsx(\"div\", { className: styles.offcanvas__header, children: props.header }), _jsxs(\"div\", { className: contentClasses, children: [props.children, props.resetActiveFilters && (_jsxs(Button, { onClick: props.resetActiveFilters, variant: 'borderless', children: [_jsx(Icon, { svgIcon: NoFilter }), 'Nullstill filter'] }))] }), props.afterContent] }));\n};\nexport default OffCanvas;\n","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React from 'react';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Dropdown from '@helsenorge/designsystem-react/components/Dropdown';\nimport FormGroup from '@helsenorge/designsystem-react/components/FormGroup';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport { useResourcesContext } from './resources';\nimport OffCanvas from '../offcanvas';\nimport styles from './styles.module.scss';\nconst FilterGroup = (props) => {\n const { isMobile, label, placeholder, children, onClose } = props;\n const [showMobileFilterState, setShowMobileFilterState] = React.useState(false);\n const resources = useResourcesContext();\n const handleToggleMobileFilterState = () => {\n setShowMobileFilterState(!showMobileFilterState);\n };\n const offCanvasHeader = (_jsx(_Fragment, { children: _jsxs(Button, { variant: 'borderless', onClick: handleToggleMobileFilterState, children: [_jsx(Icon, { svgIcon: ChevronLeft }), resources.mobileBackToFilters] }) }));\n return (_jsx(\"div\", { children: isMobile ? (_jsxs(_Fragment, { children: [_jsx(Button, { className: styles['filter-options__mobile-button'], \"aria-expanded\": showMobileFilterState, onClick: handleToggleMobileFilterState, arrow: \"icon\", fluid: true, variant: 'outline', children: label || resources.filterGroupLabel }), _jsxs(OffCanvas, { header: offCanvasHeader, isOpened: showMobileFilterState, onClose: () => {\n onClose && onClose();\n handleToggleMobileFilterState();\n }, children: [_jsx(FormGroup, { legend: label, name: label, children: children }), _jsx(Spacer, { size: 'xs' }), _jsx(Button, { onClick: () => {\n onClose && onClose();\n handleToggleMobileFilterState();\n }, className: \"right\", children: resources.mobileApplyFilter })] })] })) : (_jsx(\"div\", { className: styles['filter-options__dropdown'], children: _jsx(Dropdown, { onToggle: isOpened => {\n !isOpened && onClose && onClose();\n }, placeholder: placeholder || resources.filterGroupPlaceholder, label: label || resources.filterGroupLabel, closeText: resources.filterGroupClose, children: children }) })) }));\n};\nFilterGroup.displayName = 'FilterGroup';\nexport default FilterGroup;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport Select from '@helsenorge/designsystem-react/components/Select';\nimport { Breakpoint, useBreakpoint } from '@helsenorge/designsystem-react/hooks/useBreakpoint';\nconst DesktopSort = React.forwardRef((props, ref) => {\n const [maxLabelLength, setMaxLabelLength] = React.useState(10);\n const breakpoint = useBreakpoint();\n const isFluid = breakpoint === Breakpoint.xxs && props.fluidMobile;\n const handleSort = event => {\n props.onSort && props.onSort(event.target.value);\n };\n React.useEffect(() => {\n if (props.children.length > 0) {\n const newMaxLabelLength = Math.max(10, ...props.children.map(child => (child.label ? child.label.length : child.value?.length || 10)));\n setMaxLabelLength(newMaxLabelLength);\n }\n }, [props.children]);\n return (_jsx(Select, { label: props.label, width: isFluid ? undefined : maxLabelLength, disabled: props.disabled, onChange: handleSort, ref: ref, defaultValue: props.sortKey, wrapperClassName: props.selectClasses, children: props.children.map(child => (_jsx(\"option\", { value: child.value, children: child.label || child.value }, child.key || child.label || child.value))) }));\n});\nDesktopSort.displayName = 'DesktopSort';\nexport default DesktopSort;\n","import { useEffect, useState } from 'react';\nexport const useStateValue = (value) => {\n const [stateValue, setStateValue] = useState(value);\n useEffect(() => {\n setStateValue(value);\n }, [value]);\n const resetStateValue = () => setStateValue(value);\n return [stateValue, setStateValue, resetStateValue];\n};\n","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport FormGroup from '@helsenorge/designsystem-react/components/FormGroup';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport RadioButton from '@helsenorge/designsystem-react/components/RadioButton';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport { useResourcesContext } from './resources';\nimport { useStateValue } from './useStateValue';\nimport OffCanvas from '../offcanvas';\nconst MobileSort = props => {\n const [isOpen, setIsOpen] = React.useState(false);\n const [sortKey, setSortKey, resetSortKey] = useStateValue(props.sortKey);\n const resources = useResourcesContext();\n const handleOpen = () => {\n setIsOpen(true);\n };\n const handleClose = (cb) => {\n setIsOpen(false);\n resetSortKey();\n if (cb) {\n cb(false);\n }\n };\n const handleShowResults = () => {\n props.onSort && sortKey && props.onSort(sortKey);\n handleClose(props.toggleShowFilters);\n };\n const handleSort = event => {\n setSortKey(event.target.value);\n };\n const offCanvasHeader = (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: 'borderless', onClick: () => handleClose(), children: [_jsx(Icon, { svgIcon: ChevronLeft }), resources.mobileBackToFilters] }), _jsx(Spacer, { size: 'xs' }), _jsx(Button, { onClick: handleShowResults, className: \"right\", children: resources.mobileShowResults })] }));\n return (_jsxs(_Fragment, { children: [_jsx(Button, { \"aria-expanded\": isOpen, onClick: handleOpen, arrow: \"icon\", fluid: true, variant: 'outline', children: resources.mobileSortOn }), _jsx(OffCanvas, { header: offCanvasHeader, isOpened: isOpen, onClose: handleClose, children: _jsx(FormGroup, { legend: props.label, name: props.label, children: props.children.map(child => (_jsx(RadioButton, { disabled: props.disabled, defaultChecked: sortKey === child.value, label: child.label || child.value, value: child.value, ref: child.ref, onChange: handleSort }, child.key || child.label || child.value))) }) })] }));\n};\nexport default MobileSort;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport DesktopSort from './desktop-sort';\nimport MobileSort from './mobile-sort';\nimport styles from './styles.module.scss';\nconst FilterSortWrapper = ({ children }) => (_jsx(\"div\", { className: styles['filter-sort-wrapper'], children: children }));\nconst FilterSort = React.forwardRef((props, ref) => {\n if (props.isMobile) {\n return (_jsx(FilterSortWrapper, { children: _jsx(MobileSort, { sortKey: props.sortKey, disabled: props.disabled, label: props.label, onSort: props.onSort, toggleShowFilters: props.toggleShowFilters, children: props.children }) }));\n }\n return (_jsx(FilterSortWrapper, { children: _jsx(DesktopSort, { fluidMobile: props.responsiveSelect, selectClasses: props.selectClasses, sortKey: props.sortKey, disabled: props.disabled, label: props.label, onSort: props.onSort, ref: ref, children: props.children }) }));\n});\nFilterSort.displayName = 'FilterSort';\nexport default FilterSort;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Checkbox from '@helsenorge/designsystem-react/components/Checkbox';\nimport Chip from '@helsenorge/designsystem-react/components/Chip';\nimport Expander, { ExpanderSize } from '@helsenorge/designsystem-react/components/Expander';\nimport FormGroup from '@helsenorge/designsystem-react/components/FormGroup';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport NoFilter from '@helsenorge/designsystem-react/components/Icons/NoFilter';\nimport Loader from '@helsenorge/designsystem-react/components/Loader';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport Tag from '@helsenorge/designsystem-react/components/Tag';\nimport TagList from '@helsenorge/designsystem-react/components/TagList';\nimport { isComponent } from '@helsenorge/designsystem-react/utils/component';\nimport { isMobileUA } from '@helsenorge/designsystem-react/utils/mobile';\nimport uuid from '@helsenorge/designsystem-react/utils/uuid';\nimport { DateFormat, safeFormatCET } from '@helsenorge/core-utils/date-fns-utils';\nimport FilterGroup from './filter-group';\nimport FilterSort from './filter-sort';\nimport { ResourcesContextProvider, defaultResources } from './resources';\nimport OffCanvas from '../offcanvas';\nimport styles from './styles.module.scss';\nexport var Status;\n(function (Status) {\n Status[\"Ready\"] = \"ready\";\n Status[\"LoadingResults\"] = \"loading-results\";\n})(Status || (Status = {}));\nconst isSortFilterOption = (option) => {\n return option.type === 'sort' || option.type === 'sort-select' || option.type === 'sort-select-responsive';\n};\nconst moveSortLast = (a, b) => {\n const aIsSort = isSortFilterOption(a);\n const bIsSort = isSortFilterOption(b);\n if (aIsSort && !bIsSort) {\n return 1; // Move filter-sort towards the end\n }\n else if (!aIsSort && bIsSort) {\n return -1; // Keep other types towards the beginning\n }\n return 0; // Keep original order if same type\n};\nexport const Filter = props => {\n const { afterHeadingChildren, afterActiveFiltersChildren, activeFilters, extraFilterOptions, showFilters = false, filterOptions, footerContent, isAlwaysOpen, isDisabled, allowMobileView = true, numResults, status, statusText, onFilterOpen, onSubmit, onResetActiveFilters, searchBelowFilter, searchFilter, } = props;\n const resources = { ...defaultResources, ...props.resources };\n const isMobile = allowMobileView && isMobileUA();\n const [prevActiveFilters, setPrevActiveFilters] = React.useState(activeFilters);\n const [showFiltersState, setShowFiltersState] = React.useState(!isMobile && showFilters);\n const isLoading = status === Status.LoadingResults;\n const isSlowSearch = typeof onSubmit !== 'undefined';\n React.useEffect(() => {\n if (!isMobile && typeof showFilters !== 'undefined') {\n setShowFiltersState(showFilters);\n }\n }, [showFilters]);\n React.useEffect(() => {\n if (onFilterOpen) {\n onFilterOpen(showFiltersState);\n }\n }, [showFiltersState]);\n const toggleShowMainFilter = () => {\n if (!isDisabled) {\n setShowFiltersState(!showFiltersState);\n }\n };\n const onSubmitHandler = () => {\n setPrevActiveFilters(activeFilters ?? []);\n if (onSubmit) {\n onSubmit();\n }\n if (isMobile) {\n toggleShowMainFilter();\n }\n };\n const isFilterResultSubmitted = () => {\n return JSON.stringify(prevActiveFilters) === JSON.stringify(activeFilters);\n };\n const resetActiveFilters = () => {\n if (!activeFilters)\n return;\n Promise.all(activeFilters.map(af => {\n af.handleRemove();\n })).then(() => {\n if (onResetActiveFilters) {\n onResetActiveFilters();\n }\n });\n };\n const activeFilterTag = (af) => {\n if (af.value instanceof Date) {\n return safeFormatCET(af.value, DateFormat.ShortDate);\n }\n else if (typeof af.value === 'object') {\n return af.value?.displayText ?? af.value?.value;\n }\n else if (af.value !== undefined) {\n return af.value;\n }\n else {\n return '';\n }\n };\n const renderActiveFilters = () => activeFilters &&\n activeFilters.length > 0 && (_jsx(\"div\", { className: classNames(styles['active-filters'], {\n [styles['active-filters--desktop']]: !isMobile,\n [styles['active-filters--no-bottom-spacing']]: (!isMobile && searchBelowFilter && showFiltersState) || afterActiveFiltersChildren,\n }), children: !isLoading && (_jsxs(_Fragment, { children: [_jsx(\"span\", { className: styles['active-filters__label'], children: resources.selectedFilters }), _jsx(\"div\", { className: styles['active-filters__tags-container'], children: isSlowSearch ? renderTags(activeFilters) : renderChips(activeFilters) })] })) }));\n const renderTags = (activeFilters) => {\n return (_jsx(TagList, { children: activeFilters.map(af => (_jsx(\"span\", { className: styles['active-filters__tag'], children: _jsx(Tag, { color: \"blueberry\", size: \"medium\", variant: \"normal\", children: activeFilterTag(af) }) }, af.name))) }));\n };\n const onActiveFilterClicked = (activeFilter) => {\n activeFilter.handleRemove().then(() => {\n if (onResetActiveFilters) {\n onResetActiveFilters(activeFilter);\n }\n });\n };\n const renderChips = (activeFilters) => {\n return (_jsxs(TagList, { children: [activeFilters.map(af => (_jsx(\"span\", { className: styles['active-filters__tag'], children: _jsx(Chip, { action: \"remove\", color: \"blueberry\", onClick: () => onActiveFilterClicked(af), size: \"medium\", variant: \"normal\", children: activeFilterTag(af) }) }, af.name))), activeFilters.length > 1 && (_jsxs(Button, { onClick: resetActiveFilters, variant: 'borderless', children: [_jsx(Icon, { svgIcon: NoFilter }), 'Nullstill filter'] }))] }));\n };\n const renderFilterOptions = (filterOptions, isInsideFilter) => {\n const sortedFilterOptions = isMobile ? [...filterOptions].sort(moveSortLast) : filterOptions;\n const renderChildren = (children) => {\n return React.Children.map(children, (child, index) => {\n if (isComponent(child, Checkbox)) {\n return (_jsx(\"div\", { className: styles['filter-options__checkbox'], children: child }, child.key || index + uuid()));\n }\n if (isComponent(child, React.Fragment)) {\n return React.Children.map(child.props.children, (child) => {\n return renderChildren(child);\n });\n }\n return _jsx(\"div\", { className: styles['filter-options__item'], children: child });\n });\n };\n return sortedFilterOptions.map((fo, index) => {\n switch (fo.type) {\n case 'inline':\n return renderChildren(fo.children);\n case 'sort':\n case 'sort-select':\n case 'sort-select-responsive': {\n return (_jsx(FilterSort, { selectClasses: classNames({ [styles['filter-sort-wrapper--right']]: !isMobile && !isInsideFilter }), sortKey: fo.defaultValue, isMobile: fo.type === 'sort' && isMobile, responsiveSelect: fo.type === 'sort-select-responsive', onSort: fo.onSort, label: fo.label, toggleShowFilters: !onSubmit && isInsideFilter ? toggleShowMainFilter : undefined, children: fo.children }, index + uuid()));\n }\n case 'dropdown': {\n return (_jsx(FilterGroup, { onClose: fo.onClose, isMobile: isMobile, label: fo.label, placeholder: fo.placeholder, children: fo.children }));\n }\n }\n });\n };\n const renderSlowSearchSubmitButton = () => {\n return isSlowSearch ? (_jsx(Button, { onClick: onSubmitHandler, disabled: isFilterResultSubmitted(), wrapperClassName: classNames(!isMobile && styles['filter-options__submit-button-desktop']), children: isFilterResultSubmitted() ? resources.updateFilterButtonDisabledText : resources.updateFilterButtonText })) : isMobile ? (_jsx(Button, { onClick: toggleShowMainFilter, children: resources.showResults })) : null;\n };\n const renderFilter = isLoading ? (_jsx(Loader, { center: true, size: 'small', ariaLabel: resources.loadingResults })) : (_jsxs(\"div\", { className: styles['filters-content'], children: [searchFilter && !searchBelowFilter && _jsx(\"div\", { children: searchFilter }), filterOptions && (_jsxs(FormGroup, { htmlMarkup: 'div', fieldsetClassName: styles['filter-options'], renderError: false, children: [renderFilterOptions(filterOptions, true), !isMobile && renderSlowSearchSubmitButton()] })), extraFilterOptions && (_jsx(Expander, { title: resources.showSecondaryFilters, children: _jsx(FormGroup, { htmlMarkup: 'div', fieldsetClassName: classNames(styles['filter-options'], styles['filter-options--extra']), renderError: false, children: renderFilterOptions(extraFilterOptions, true) }) }))] }));\n const offCanvasHeader = (_jsxs(_Fragment, { children: [isSlowSearch && (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: 'borderless', onClick: () => {\n toggleShowMainFilter();\n }, children: [_jsx(Icon, { svgIcon: ChevronLeft }), resources.cancel] }), _jsx(Spacer, { size: '2xs' })] })), renderSlowSearchSubmitButton()] }));\n const renderDesktopFilter = (children) => {\n const renderAfterHeadingChildren = afterHeadingChildren && (_jsx(\"div\", { className: classNames(styles['after-heading'], { [styles['after-heading--search-below-filter']]: searchBelowFilter }), children: afterHeadingChildren }));\n const noBottomPaddingClass = classNames({\n [styles['filter-desktop--no-bottom-spacing']]: searchBelowFilter || (activeFilters && activeFilters.length > 0),\n });\n return isAlwaysOpen ? (_jsxs(\"div\", { className: classNames(styles['filter-desktop'], noBottomPaddingClass), children: [_jsxs(\"div\", { className: styles['title-container'], children: [_jsx(\"span\", { className: styles['title'], children: resources.filterTitle }), renderAfterHeadingChildren] }), children] })) : (_jsxs(Expander, { renderChildrenWhenClosed: true, size: ExpanderSize.large, onExpand: (expanded) => setShowFiltersState(expanded), expanded: showFiltersState, noNestedLine: true, title: resources.filterTitle, contentClassNames: noBottomPaddingClass, children: [renderAfterHeadingChildren, children] }));\n };\n const counter = !isLoading ? _jsx(\"span\", { className: styles['numresults'], children: numResults }) : null;\n return (_jsxs(ResourcesContextProvider, { value: resources, children: [isMobile ? (_jsxs(_Fragment, { children: [_jsx(Button, { \"aria-expanded\": showFiltersState, onClick: toggleShowMainFilter, arrow: \"icon\", fluid: true, variant: 'outline', children: resources.toggleFilterAndSort }), _jsxs(OffCanvas, { header: offCanvasHeader, isLoading: isLoading, isOpened: showFiltersState, onClose: toggleShowMainFilter, resetActiveFilters: activeFilters && activeFilters?.length > 0 ? resetActiveFilters : undefined, children: [_jsxs(\"div\", { className: styles['title-container'], children: [_jsx(\"span\", { className: styles['title'], children: resources.filterHeading }), afterHeadingChildren && (_jsx(\"div\", { className: classNames(styles['after-heading'], { [styles['after-heading--mobile']]: isMobile }), children: afterHeadingChildren })), _jsxs(\"span\", { \"aria-live\": \"polite\", \"aria-atomic\": \"true\", children: [_jsxs(\"span\", { className: styles['numresults--hidden'], children: [resources.numResults, \" \"] }), counter] })] }), renderFilter] })] })) : (_jsx(\"div\", { className: styles['filters-wrapper'], children: renderDesktopFilter(renderFilter) })), renderActiveFilters(), afterActiveFiltersChildren && (_jsx(\"div\", { className: classNames(styles['after-active-filters'], {\n [styles['after-active-filters--desktop']]: !isMobile,\n }), children: afterActiveFiltersChildren })), searchFilter && searchBelowFilter && !isLoading && (showFiltersState || isMobile) && (_jsx(\"div\", { className: classNames(styles['filter-search-below-filter-wrapper'], {\n [styles['filter-search-below-filter-wrapper--mobile']]: isMobile,\n }), children: searchFilter })), _jsxs(\"div\", { className: classNames(styles['filter-footer'], { [styles['filter-footer--is-mobile']]: isMobile }), children: [statusText && (_jsx(\"span\", { className: styles['filter-footer__numresults'], \"aria-live\": \"polite\", \"aria-atomic\": \"true\", role: \"status\", children: isLoading ? (_jsx(Loader, { inline: true, size: 'tiny', ariaLabel: resources.loadingResults })) : (_jsxs(_Fragment, { children: [_jsx(\"span\", { className: styles['filter-footer__numresults--hidden'], children: resources.numResults }), ` ${statusText}`] })) })), footerContent && (_jsx(FormGroup, { className: styles['filter-options-wrapper'], htmlMarkup: 'div', fieldsetClassName: styles['filter-options'], renderError: false, children: renderFilterOptions(footerContent, false) }))] })] }));\n};\nexport default Filter;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React from 'react';\nimport cn from 'classnames';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Close from '@helsenorge/designsystem-react/components/Close';\nimport Input from '@helsenorge/designsystem-react/components/Input';\nimport { usePseudoClasses } from '@helsenorge/designsystem-react/hooks/usePseudoClasses';\nimport { isMutableRefObject, mergeRefs } from '@helsenorge/designsystem-react/utils/refs';\nimport { useResourcesContext } from './resources';\nimport styles from './styles.module.scss';\nconst FilterSearch = React.forwardRef((props, ref) => {\n const { classNames, disabled, onChange, defaultValue } = props;\n const resources = useResourcesContext();\n const { refObject } = usePseudoClasses(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n const containerClassNames = cn(styles['filter-sok-container'], classNames);\n const clearSearchText = () => {\n if (refObject && refObject.current) {\n refObject.current.value = '';\n onChange?.({ target: { value: '' } });\n }\n };\n const handleKeydown = event => {\n if (event.key === 'Enter' && props.onSearch) {\n props.onSearch();\n }\n };\n return (_jsxs(\"div\", { className: containerClassNames, children: [_jsx(\"div\", { className: styles['filter-sok-container__input'], children: _jsx(Input, { label: resources.searchLabel, disabled: disabled, onChange: onChange, onKeyDown: handleKeydown, ref: mergedRefs, defaultValue: defaultValue, rightOfInput: refObject?.current?.value && (_jsx(\"div\", { className: styles['filter-sok-container__clear-button'], children: _jsx(Close, { small: true, ariaLabel: resources.resetSearchInputAriaLabel, onClick: clearSearchText }) })) }) }), props.onSearch && (_jsx(Button, { disabled: disabled, wrapperClassName: styles['filter-sok-container__button'], onClick: props.onSearch, children: resources.searchButtonText }))] }));\n});\nFilterSearch.displayName = 'FilterSearch';\nexport default FilterSearch;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useState } from 'react';\nexport const useFilters = (props) => {\n const [filters, setFilters] = useState(props?.defaultValues);\n const [delayedFilters, setDelayedFilters] = useState();\n const [searchQuery, setSearchQuery] = useState(props?.searchQuery);\n const [sortKey, setSortKey] = useState(props?.sortKey);\n const setFilter = (name, value) => setFilters(prevState => {\n return { ...prevState, [name]: value }; /** @todo fjern denne assertionen */\n });\n const setDelayedFilter = (name, value) => setDelayedFilters(prevState => {\n return { ...prevState, [name]: value }; /** @todo fjern denne assertionen */\n });\n const updateFilters = () => {\n setFilters(Object.assign({}, filters, delayedFilters));\n };\n const removeFilterFromState = (name, prevState) => {\n if (prevState) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [name]: _, ...rest } = prevState;\n return rest /** @todo fjern denne assertionen */;\n }\n };\n const activeFilters = filters &&\n Object.keys(filters)\n .filter(x => !!filters[x] &&\n filters[x] !== undefined &&\n filters[x] !== '' &&\n (typeof filters[x] !== 'object' || filters[x]?.value !== ''))\n .map(name => ({\n name,\n value: filters[name],\n handleRemove: async () => {\n setFilters(prevState => removeFilterFromState(name, prevState));\n setDelayedFilters(prevState => removeFilterFromState(name, prevState));\n },\n }));\n return {\n filters,\n setFilter,\n setDelayedFilter,\n activeFilters,\n searchQuery,\n setSearchQuery,\n sortKey,\n setSortKey,\n updateFilters,\n };\n};\n","import { hasPersonverninnstilling } from './hn-user';\nimport { Personverninnstilling } from './types/entities';\nexport var Samtykke;\n(function (Samtykke) {\n /** Bruker har ikke samtykket til Helsenorge */\n Samtykke[Samtykke[\"Ingen\"] = 0] = \"Ingen\";\n /** Bruker har basis-samtykke */\n Samtykke[Samtykke[\"Basis\"] = 1] = \"Basis\";\n /** Bruker har Basis+-samtykke */\n Samtykke[Samtykke[\"BasisPluss\"] = 2] = \"BasisPluss\";\n /** Bruker har fullt samtykke */\n Samtykke[Samtykke[\"Full\"] = 3] = \"Full\";\n})(Samtykke || (Samtykke = {}));\n/**\n * Sjekker hvilket nivÃ¥ av bruk av helsenorge innbygger har samtykket til.\n * @returns Full, BasisPluss, Basis eller Ingen\n */\nexport const getSamtykke = () => {\n if (hasPersonverninnstilling(Personverninnstilling.SamtykkeDigitalHelsetjeneste)) {\n return Samtykke.Full;\n }\n if (hasPersonverninnstilling(Personverninnstilling.SamtykkeJournalinnsyn)) {\n return Samtykke.BasisPluss;\n }\n if (hasPersonverninnstilling(Personverninnstilling.SamtykkeRegisterinnsyn)) {\n return Samtykke.Basis;\n }\n return Samtykke.Ingen;\n};\n/**\n * Sjekk om bruker har samtykket til bruk av Helsenorge\n * @returns true dersom bruker har samtykket\n */\nexport const hasSamtykke = () => getSamtykke() !== Samtykke.Ingen;\n/**\n * Sjekker etter om bruker har fullt samtykke\n * @returns true dersom bruker har fullt samtykke\n */\nexport const hasFulltSamtykke = () => getSamtykke() == Samtykke.Full;\n/**\n * Sjekker etter om bruker har samtykket til bare basis eller basis+\n * @returns true dersom bruker har samtykket til bare basis eller basis+\n */\nexport const hasBasisOrBasisPlussSamtykke = () => getSamtykke() == Samtykke.Basis || getSamtykke() == Samtykke.BasisPluss;\n/**\n * Sjekk om bruker ikke har samtykket til bruk av Helsenorge\n * @returns true dersom bruker ikke har samtykket\n */\nexport const doesNotHaveSamtykke = () => !hasSamtykke();\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Link } from 'react-router-dom';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport { useHover } from '@helsenorge/designsystem-react';\nimport { trackNavigation } from '@helsenorge/framework-utils/adobe-analytics';\nimport styles from './styles.module.scss';\nconst Breadcrumb = ({ homeLabel, homeUrl, link, ariaLabel = 'Brødsmulesti' }) => {\n const { hoverRef, isHovered } = useHover();\n if (!homeLabel || !homeUrl) {\n return null;\n }\n const innerContent = (_jsxs(_Fragment, { children: [_jsx(Icon, { svgIcon: ChevronLeft, isHovered: isHovered }), _jsx(\"span\", { className: styles.breadcrumb__label, children: link ? link.name : homeLabel })] }));\n const handleLinkClick = () => trackNavigation('brødsmulesti', link ? link.name : homeLabel, 'brødsmulesti');\n return (_jsxs(_Fragment, { children: [_jsx(\"div\", { className: styles.border }), _jsx(\"div\", { className: 'container', children: _jsx(\"div\", { className: 'row', children: _jsx(\"div\", { className: 'col', children: _jsx(\"nav\", { className: styles.breadcrumb__content, \"aria-label\": ariaLabel, children: link?.renderAsRouterLink ? (_jsx(Link, { ref: hoverRef, className: styles.breadcrumb__link, to: link.url, onClick: handleLinkClick, children: innerContent })) : (_jsx(\"a\", { ref: hoverRef, className: styles.breadcrumb__link, href: link?.url ?? homeUrl, onClick: handleLinkClick, children: innerContent })) }) }) }) }), _jsx(\"div\", { className: styles.border })] }));\n};\nexport default Breadcrumb;\n","/// <reference types=\"@helsenorge/framework-utils/types/hn\"/>\nimport { decapitalize } from '@helsenorge/core-utils/string-utils';\nimport { error } from '@helsenorge/framework-utils/logger';\nexport function currentConfiguration() {\n return (window.HN?.Page ?? {});\n}\nexport function resolve(originalKey, resources) {\n const key = decapitalize(originalKey);\n if (Object.prototype.hasOwnProperty.call(resources, key)) {\n return resources[key];\n }\n error(`The key ${key} is missing in HNTjenesterContent`);\n return undefined;\n}\nexport function getCurrentConfiguration() {\n return (window.HN?.Page ?? {});\n}\nexport function getService(resources) {\n const configuration = getCurrentConfiguration();\n if (resources && configuration && configuration.Tjenestemeny) {\n return resolve(configuration.Tjenestemeny, resources);\n }\n return undefined;\n}\nexport function getRedirectToUrlAfterLogin() {\n const configuration = getCurrentConfiguration();\n if (configuration && configuration.RedirectToUrlAfterLogin) {\n return configuration.RedirectToUrlAfterLogin;\n }\n return;\n}\nexport function getDelAvForeldresamtykke() {\n const configuration = getCurrentConfiguration();\n if (configuration && configuration.DelAvForeldresamtykke) {\n return configuration.DelAvForeldresamtykke;\n }\n return undefined;\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport BreadcrumbComponent from '@helsenorge/core-cms/breadcrumb';\nimport { getTjenesterUrl, getHelsenorgeUrl } from '@helsenorge/framework-utils/hn-proxy-service';\nimport useResources from '@helsenorge/framework-utils/resources/useResources';\nimport { currentConfiguration, resolve } from '../common/configuration';\nimport { getResources, Projects } from '../resources';\nimport styles from './styles.module.scss';\nconst getBreadcrumbLink = (contentResources, pageConfiguration) => {\n if (contentResources && pageConfiguration?.NavigateBackLinkTitle && pageConfiguration.NavigateBackLinkURL) {\n const name = resolve(pageConfiguration.NavigateBackLinkTitle, contentResources);\n let url = resolve(pageConfiguration.NavigateBackLinkURL, contentResources);\n if (name && url) {\n const helsenorgeUrlPlaceholder = '{HelsenorgeUrl}'; // TODO: Bør kanskje flyttes til utils-funksjon\n if (url.includes(helsenorgeUrlPlaceholder)) {\n url = url.replace(helsenorgeUrlPlaceholder, getHelsenorgeUrl());\n }\n return {\n name: name,\n url: url,\n };\n }\n else {\n return undefined;\n }\n }\n else {\n return undefined;\n }\n};\nconst Breadcrumb = props => {\n const resources = useResources(Projects.FRAMEWORK, getResources);\n const contentResources = useResources(Projects.CONTENT, getResources);\n const pageConfiguration = currentConfiguration();\n const pageBreadcrumbLinks = getBreadcrumbLink(contentResources, pageConfiguration);\n const homeLabel = resources?.breadCrumb_Forsiden;\n const getCmsBreadcrumbLink = (link) => {\n let name = undefined;\n if (link && link.resourceId && contentResources) {\n name = contentResources[link.resourceId];\n }\n else if (link && link.name) {\n name = link.name;\n }\n return !name\n ? undefined\n : {\n name: name,\n url: link ? link.url : '',\n renderAsRouterLink: link?.renderAsRouterLink,\n };\n };\n return (_jsx(\"div\", { className: styles.breadcrumb, children: _jsx(BreadcrumbComponent, { homeLabel: homeLabel, homeUrl: getTjenesterUrl(), link: getCmsBreadcrumbLink(props.link || pageBreadcrumbLinks) }) }));\n};\nexport default Breadcrumb;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { trackError } from '@helsenorge/framework-utils/adobe-analytics';\nimport { isDebug } from '@helsenorge/framework-utils/hn-debug';\nimport { HelsenorgeProxyError } from '@helsenorge/framework-utils/hn-proxy-service';\nimport { error as logError } from '@helsenorge/framework-utils/logger';\nimport ErrorMessage from '../error-message';\nexport default function withErrorBoundary(COMPONENT) {\n class GuardedComponent extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n error: false,\n };\n }\n componentDidCatch(error) {\n trackError('level3', 'UhÃ¥ndtert teknisk feil');\n this.setState({ error: true });\n if (error instanceof HelsenorgeProxyError) {\n this.setState({ correlationId: error.correlationId });\n }\n if (isDebug() || process.env.NODE_ENV !== 'production') {\n this.setState({ name: `${error.name} ${error.message}`, message: error.stack });\n }\n logError('Error in ' + COMPONENT.name + ' component or a child component', error);\n }\n render() {\n if (this.state.error) {\n return (_jsx(ErrorMessage, { label: this.state.name || (this.props.resources && this.props.resources.unknownError), description: this.state.message || (this.props.resources && this.props.resources.unknownErrorAction), correlationId: this.state.correlationId }));\n }\n return _jsx(COMPONENT, { ...this.props });\n }\n }\n return GuardedComponent;\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport withErrorBoundary from './with-error-boundary';\nclass ErrorPanel extends React.Component {\n render() {\n return _jsx(\"div\", { children: this.props.children });\n }\n}\nexport default withErrorBoundary(ErrorPanel);\n","import EmoticonAnnoyed from '@helsenorge/designsystem-react/components/Icons/EmoticonAnnoyed';\nimport EmoticonDelighted from '@helsenorge/designsystem-react/components/Icons/EmoticonDelighted';\nimport EmoticonDisappointed from '@helsenorge/designsystem-react/components/Icons/EmoticonDisappointed';\nimport EmoticonHappy from '@helsenorge/designsystem-react/components/Icons/EmoticonHappy';\nimport EmoticonMeh from '@helsenorge/designsystem-react/components/Icons/EmoticonMeh';\nexport const getIcon = (value) => {\n switch (value) {\n case '5':\n return EmoticonDelighted;\n case '4':\n return EmoticonHappy;\n case '3':\n return EmoticonMeh;\n case '2':\n return EmoticonDisappointed;\n case '1':\n return EmoticonAnnoyed;\n }\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React from 'react';\nimport classNames from 'classnames';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport { theme, useHover } from '@helsenorge/designsystem-react';\nimport { getIcon } from './utils';\nimport styles from './styles.module.scss';\nconst ScoreInput = React.forwardRef(({ label, value, disabled, selected, expanded, onChange, ...rest }, ref) => {\n const { hoverRef, isHovered } = useHover();\n const id = `feedback-score-${value}`;\n return (_jsxs(\"label\", { htmlFor: id, className: classNames(styles.scoreinput, selected && styles['scoreinput--selected']), ref: hoverRef, children: [_jsx(\"input\", { type: \"radio\", value: value, disabled: disabled, \"aria-expanded\": expanded, className: styles.scoreinput__radio, id: id, ref: ref, onChange: onChange, ...rest }), _jsx(Icon, { svgIcon: getIcon(value), color: selected ? theme.palette.white : theme.palette.black, isHovered: isHovered }), _jsx(\"span\", { className: styles.scoreinput__text, children: label })] }));\n});\nScoreInput.displayName = 'ScoreInput';\nexport default ScoreInput;\n","export const scoreValueList = ['1', '2', '3', '4', '5'];\n","import { pushToDataLayer } from '@helsenorge/framework-utils/adobe-analytics';\nexport const trackScore = (score) => {\n const testData = {\n event: 'feedback',\n feedback: {\n name: 'brukertilfredshet: score',\n score: score,\n label: score,\n },\n };\n pushToDataLayer(testData);\n};\nexport const trackComment = () => {\n const testData = {\n event: 'feedback',\n feedback: {\n name: 'brukertilfredshet: tilbakemelding',\n },\n };\n pushToDataLayer(testData);\n};\n","// Removes specific characters from string\nexport const sanitizeValue = (string) => {\n return string\n .replace(/</g, '') // <\n .replace(/script>/g, '') // script>\n .replace(/(\\\\|\\/)/, ''); // / or \\\n};\n// Remove email address from string\nexport const removeEmail = (string) => {\n return string.replace(/([^.@\\s]+)(\\.[^.@\\s]+)*@([^.@\\s]+\\.)+([^.@\\s]+)/, '*epost*');\n};\n","import { sanitizeValue } from '@helsenorge/core-cms/userfeedback/utils/string';\nimport { post, patch } from '@helsenorge/framework-utils/cms-content-api-service';\nexport const createFeedback = async (body) => {\n return post(`usertjenestefeedback`, body);\n};\nexport const updateFeedback = async (body) => {\n const sanitized = { id: body.id, score: body.score, comment: body.comment && sanitizeValue(body.comment) };\n return patch(`usertjenestefeedback`, sanitized);\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useEffect, useState } from 'react';\nimport { useForm } from 'react-hook-form';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport FormGroup from '@helsenorge/designsystem-react/components/FormGroup';\nimport Label, { Sublabel } from '@helsenorge/designsystem-react/components/Label';\nimport NotificationPanel from '@helsenorge/designsystem-react/components/NotificationPanel';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport TextArea from '@helsenorge/designsystem-react/components/Textarea';\nimport Validation from '@helsenorge/designsystem-react/components/Validation';\nimport { debounce } from '@helsenorge/designsystem-react/utils/debounce';\nimport { error as logError } from '@helsenorge/framework-utils/logger';\nimport ScoreInput from './score-input';\nimport { scoreValueList } from './utils/entities';\nimport { trackComment, trackScore } from '../feedback/utils/analytics';\nimport * as api from '../feedback/utils/api';\nimport styles from './styles.module.scss';\nexport const CHARACTER_LIMIT = 250;\nexport const TEXTAREA_ID = 'textarea-description';\nexport const DESCRIPTION_ID = 'feedback-description';\nconst FeedbackForm = ({ url, pageTitle, resources }) => {\n const { register, handleSubmit, watch, setError, formState: { errors, isSubmitting, isSubmitSuccessful }, } = useForm();\n const [id, setId] = useState();\n const score = watch('score');\n const showComment = id !== undefined;\n useEffect(() => {\n if (!score) {\n return;\n }\n const handleUpdate = async () => {\n if (id) {\n updateFeedback({ id, score });\n trackScore(score);\n }\n };\n const [debouncedUpdate, teardown] = debounce(handleUpdate, 1000);\n if (id) {\n debouncedUpdate();\n }\n else {\n createFeedback({ score, url: url, pageTitle: pageTitle });\n }\n return () => {\n teardown();\n };\n }, [score]);\n const createFeedback = async (data) => {\n try {\n const createFeedbackResponse = await api.createFeedback(data);\n setId(createFeedbackResponse?.id);\n trackScore(data.score);\n }\n catch {\n setError('root', { message: resources.serverErrorMessage });\n }\n };\n const updateFeedback = async (data) => {\n try {\n if (id) {\n await api.updateFeedback(data);\n if (data.comment) {\n trackComment();\n }\n }\n }\n catch (e) {\n setError('root', { message: resources.serverErrorMessage });\n throw e;\n }\n };\n if (isSubmitSuccessful) {\n return _jsx(NotificationPanel, { role: \"alert\", label: resources.successMessage, variant: \"success\", compactVariant: \"basic\", size: \"medium\" });\n }\n if (errors.root) {\n return _jsx(NotificationPanel, { label: resources.serverErrorMessage, variant: \"error\", compactVariant: \"basic\", size: \"medium\" });\n }\n const getButtonAriaLabel = (value) => {\n switch (value) {\n case '5':\n return resources.veryPleasedText;\n case '4':\n return resources.slightlyPleasedText;\n case '3':\n return resources.neutralText;\n case '2':\n return resources.slightlyDispleasedText;\n case '1':\n return resources.displeasedText;\n }\n };\n const onSubmit = async (data) => {\n if (!id || id === undefined) {\n logError('Skjema for tilbakemelding fra bruker ble forsøkt sendt inn uten id.');\n setError('root', { message: resources.serverErrorMessage });\n }\n try {\n await api.updateFeedback({\n id: id,\n score: data.score,\n comment: data.comment,\n });\n if (data.comment) {\n trackComment();\n }\n }\n catch {\n setError('root', { message: resources.serverErrorMessage });\n }\n };\n return (_jsx(Validation, { errorTitle: resources.serverErrorMessage, children: _jsxs(\"form\", { onSubmit: handleSubmit(onSubmit), children: [_jsx(FormGroup, { legend: resources.questionText, fieldsetClassName: styles.feedbackform__questionwrapper, children: _jsx(\"div\", { className: styles.feedbackform__scores, children: scoreValueList.map(value => (_jsx(ScoreInput, { label: getButtonAriaLabel(value), value: value, selected: score === value, disabled: isSubmitting, expanded: showComment, ...register('score') }, value))) }) }), showComment && (_jsx(FormGroup, { error: errors?.comment ? errors?.comment.message : undefined, children: _jsx(TextArea, { label: _jsx(Label, { htmlFor: TEXTAREA_ID, className: styles.feedbackform__commentlabel, labelTexts: [{ text: resources.commentLabel }, { text: resources.commentSubLabel }], sublabel: _jsx(Sublabel, { id: DESCRIPTION_ID, sublabelTexts: [{ text: resources.commentDescription, type: 'subdued' }] }) }), textareaId: TEXTAREA_ID, \"aria-describedby\": DESCRIPTION_ID, maxCharacters: CHARACTER_LIMIT, maxText: resources.maxText, width: 48, disabled: isSubmitting, ...register('comment', { maxLength: { value: CHARACTER_LIMIT, message: resources.commentTooLongErrorMessage } }) }) })), _jsx(Spacer, { size: \"m\" }), _jsx(Button, { type: \"submit\", disabled: isSubmitting, className: styles.feedbackform__button, children: resources.submitButtonText })] }) }));\n};\nconst Feedback = ({ ...props }) => (_jsx(\"div\", { className: styles.feedbackform, children: _jsx(FeedbackForm, { ...props }) }));\nexport default Feedback;\n","import { useDispatch, useSelector } from 'react-redux';\nexport const useAppDispatch = useDispatch.withTypes();\nexport const useAppSelector = useSelector.withTypes();\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect } from 'react';\nimport { fetchTjenesteTekster, selectFeedbackResources } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport { getPath } from '@helsenorge/framework-utils/hn-page';\nimport { selectCurrentLanguage } from '@helsenorge/framework-utils/language';\nimport FeedbackForm from '..';\nimport { useAppDispatch, useAppSelector } from '../../store/hooks';\nconst FeedbackContainer = ({ url, pageTitle, tjenesteNavn = getPath() }) => {\n const dispatch = useAppDispatch();\n const feedbackResources = useAppSelector(state => selectFeedbackResources(state, tjenesteNavn));\n const language = useAppSelector(state => selectCurrentLanguage(state.language));\n useEffect(() => {\n dispatch(fetchTjenesteTekster({ name: tjenesteNavn, language }));\n }, [tjenesteNavn, language]);\n if (!feedbackResources) {\n return null;\n }\n return _jsx(FeedbackForm, { url: url, pageTitle: pageTitle, resources: feedbackResources });\n};\nexport default FeedbackContainer;\n","import { useDispatch, useSelector } from 'react-redux';\nimport { setDocumentLanguage, useSetUserLanguageEvent } from '../hn-language';\nimport { languageChanged, selectCurrentLanguage, selectLanguages } from '.';\n/**\n * useLanguageEvent lytter pÃ¥ global sprÃ¥kbytte-event og oppdater document language og global state\n * @param callback Optional callback som mÃ¥ returnere true for at hooken skal oppdatere sprÃ¥ket. Brukes for Ã¥ unngÃ¥ at store oppdateres unødvendig mange ganger.\n */\nconst useLanguageEvent = (callback) => {\n const dispatch = useDispatch();\n const currentLanguage = useSelector(state => selectCurrentLanguage(state.language));\n const supportedLanguages = useSelector(state => selectLanguages(state.language));\n useSetUserLanguageEvent((newLanguage, options) => {\n if (callback && !callback(options)) {\n return;\n }\n if (newLanguage === currentLanguage) {\n return;\n }\n if (!supportedLanguages.includes(newLanguage)) {\n return;\n }\n // @todo: Fjern kallet til setDocumentLanguage i v35, dette hÃ¥ndteres nÃ¥ i reduceren\n setDocumentLanguage(newLanguage);\n dispatch(languageChanged(newLanguage));\n });\n};\nexport default useLanguageEvent;\n","import LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport resources from '../resources/HN.Core.Framework.NPM.JS.nb-NO.json';\nconst LanguageNames = {\n [LanguageLocales.NORWEGIAN]: resources.language_norwegian,\n [LanguageLocales.ENGLISH]: resources.language_english,\n [LanguageLocales.SAMI_NORTHERN]: resources.language_sami,\n [LanguageLocales.NORWEGIAN_NYNORSK]: resources.language_nynorsk,\n [LanguageLocales.LITHUANIAN]: resources.language_lithuanian,\n [LanguageLocales.POLISH]: resources.language_polish,\n [LanguageLocales.RUSSIAN]: resources.language_russian,\n [LanguageLocales.ROMANIAN]: resources.language_romanian,\n};\n/**\n * Used to handle a situation where both bokmÃ¥l and nynorsk are available, in which\n * BokmÃ¥l and Nynorsk should appear in the languagepicker, and not Norsk and Nynorsk.\n */\nexport const BokmaalLanguageName = resources.language_bokmaal;\nexport default LanguageNames;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport classNames from 'classnames';\nimport Icon, { IconSize } from '@helsenorge/designsystem-react/components/Icon';\nimport Globe from '@helsenorge/designsystem-react/components/Icons/Globe';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { theme } from '@helsenorge/designsystem-react';\nimport { trackLanguage } from '@helsenorge/framework-utils/adobe-analytics';\nimport { selectCurrentLanguage } from '@helsenorge/framework-utils/language';\nimport useResources from '@helsenorge/framework-utils/resources/useResources';\nimport LanguageNames, { BokmaalLanguageName } from '../language-picker-wrapper/resources';\nimport { getResources, Projects } from '../resources';\nimport { useAppSelector } from '../store/hooks';\nimport styles from './styles.module.scss';\nconst getLanguageName = (language, languages) => {\n if (language == LanguageLocales.NORWEGIAN && languages.includes(LanguageLocales.NORWEGIAN_NYNORSK)) {\n return BokmaalLanguageName;\n }\n return LanguageNames[language];\n};\nexport const LanguagePicker = ({ languages, onLanguageChange, className, testId }) => {\n const selectedLanguage = useAppSelector(state => selectCurrentLanguage(state.language));\n const resources = useResources(Projects.FRAMEWORK, getResources);\n const handleLanguageChange = async (newLanguage) => {\n trackLanguage(newLanguage);\n onLanguageChange(newLanguage);\n };\n const languageChangedMessage = resources?.languageChanged ?? `Language changed to ${LanguageNames[selectedLanguage]}`;\n return (_jsxs(\"nav\", { className: classNames(styles['language-picker'], className), \"aria-label\": resources?.language_picker_label ?? 'SprÃ¥kvalg', children: [_jsx(Icon, { className: styles['language-picker__icon'], size: IconSize.XSmall, svgIcon: Globe, color: theme.palette.blueberry700 }), _jsx(\"span\", { className: styles['language-picker__message'], \"aria-live\": \"polite\", children: languageChangedMessage }), _jsx(\"ul\", { className: styles['language-picker__list'], children: languages.map(language => (_jsx(\"li\", { className: styles['language-picker__item'], \"data-testid\": testId && `${testId}-${language}`, children: language === selectedLanguage ? (getLanguageName(language, languages)) : (_jsx(\"button\", { className: styles['language-picker__button'], type: \"button\", value: language, onClick: () => handleLanguageChange(language), children: getLanguageName(language, languages) })) }, language))) })] }));\n};\nexport default LanguagePicker;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { setDocumentLanguage, setUserLanguage } from '@helsenorge/framework-utils/hn-language';\nimport { languageChanged, selectLanguages } from '@helsenorge/framework-utils/language';\nimport useLanguageEvent from '@helsenorge/framework-utils/language/useLanguageEvent';\nimport LanguagePicker from '../language-picker';\nimport { useAppDispatch, useAppSelector } from '../store/hooks';\nimport styles from './styles.module.scss';\nconst LanguagePickerOriginName = 'LanguagePicker';\nexport const LanguagePickerWrapper = () => {\n const dispatch = useAppDispatch();\n const languages = useAppSelector(state => selectLanguages(state.language));\n const handleLanguageChange = (newLanguage) => {\n setDocumentLanguage(newLanguage);\n setUserLanguage(newLanguage, { origin: LanguagePickerOriginName });\n dispatch(languageChanged(newLanguage));\n };\n useLanguageEvent(options => options?.origin !== LanguagePickerOriginName);\n if (languages.length <= 1) {\n return null;\n }\n return (_jsx(\"div\", { className: styles['language-picker-wrapper'], children: _jsx(\"div\", { className: \"container\", children: _jsx(\"div\", { className: \"row\", children: _jsx(\"div\", { className: \"col-12 col-lg-10\", children: _jsx(LanguagePicker, { languages: languages, onLanguageChange: handleLanguageChange }) }) }) }) }));\n};\nexport default LanguagePickerWrapper;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { HNeventSetRedirectTo, HNeventSetRedirectToUrlAfterLogin } from '@helsenorge/framework-utils/web-component/events';\nconst Personvelger = ({ redirectTo, redirectToUrlAfterLogin }) => {\n const [webcompIsReady, setWebcompIsReady] = useState(false);\n const location = useLocation();\n useEffect(() => {\n setWebcompIsReady(true);\n }, []);\n useEffect(() => {\n if (webcompIsReady) {\n if (redirectTo) {\n HNeventSetRedirectTo(redirectTo);\n }\n if (redirectToUrlAfterLogin) {\n HNeventSetRedirectToUrlAfterLogin(redirectToUrlAfterLogin);\n }\n }\n }, [redirectTo, redirectToUrlAfterLogin, history, location, webcompIsReady]);\n return _jsx(\"hn-webcomp-personvelger\", {});\n};\nexport default Personvelger;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useEffect } from 'react';\nimport { handleIOSSafariUA } from '@helsenorge/core-utils/user-agents-utils';\nimport { getCanShowHjelpetekstInPageHeader } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport { getPath, getSidetittelId } from '@helsenorge/framework-utils/hn-page';\nimport { getVisPersonvelger } from '@helsenorge/framework-utils/hn-user';\nimport useResources from '@helsenorge/framework-utils/resources/useResources';\nimport { hasSamtykke } from '@helsenorge/framework-utils/samtykke-utils';\nimport Breadcrumb from '../breadcrumb';\nimport { getRedirectToUrlAfterLogin, getDelAvForeldresamtykke } from '../common/configuration';\nimport ErrorBoundary from '../error-boundary';\nimport FeedbackContainer from '../feedback/container';\nimport LanguagePickerWrapper from '../language-picker-wrapper';\nimport PageHeader from '../page-header';\nimport Personvelger from '../personvelger';\nimport { getResources, Projects } from '../resources';\nimport { useAppSelector } from '../store/hooks';\nimport './styles.scss';\nconst Master = props => {\n const { title, description, mainAriaLabelledby, tjenesteNavn = getPath(), className, visPersonvelger = getVisPersonvelger(), breadcrumbLink, redirectTo, hasFullwidth, noBreadcrumb = false, noDriftspanel, noLanguagePicker, showFeedbackForm, hasPageHeader = true, headerClassName, headerSubtitleClassName, headerTitleClassName, headerIngressClassName, subtitle, hjelpetekstId, showHjelpeskuffInPageHeader, } = props;\n const resources = useResources(Projects.FRAMEWORK, getResources);\n const redirectToUrlAfterLogin = getRedirectToUrlAfterLogin();\n const canShowHjelpetekstInPageHeader = useAppSelector(state => getCanShowHjelpetekstInPageHeader(state, tjenesteNavn, hjelpetekstId));\n const showHjelpeskuffInPageHeaderState = !!showHjelpeskuffInPageHeader && canShowHjelpetekstInPageHeader;\n useEffect(() => {\n handleIOSSafariUA();\n if (props.mount) {\n props.mount();\n }\n }, []);\n const getTitleId = () => {\n if (mainAriaLabelledby) {\n return mainAriaLabelledby;\n }\n if (title && hasPageHeader) {\n return getSidetittelId();\n }\n };\n if (visPersonvelger && hasSamtykke()) {\n return _jsx(Personvelger, { redirectTo: redirectTo, redirectToUrlAfterLogin: redirectToUrlAfterLogin });\n }\n return (_jsxs(\"div\", { className: className, children: [!noDriftspanel && _jsx(\"hn-webcomp-driftspanel\", {}), !noBreadcrumb && _jsx(Breadcrumb, { link: breadcrumbLink }), !noLanguagePicker && _jsx(LanguagePickerWrapper, {}), _jsxs(\"main\", { className: !hasFullwidth ? 'container' : '', \"aria-labelledby\": getTitleId(), children: [hasPageHeader && (_jsx(PageHeader, { title: title, titleId: getTitleId(), subtitle: subtitle, showHjelpetrigger: showHjelpeskuffInPageHeaderState, delAvForeldresamtykke: getDelAvForeldresamtykke(), description: description, tjenesteNavn: tjenesteNavn, headerClassName: headerClassName, headerSubtitleClassName: headerSubtitleClassName, headerTitleClassName: headerTitleClassName, headerIngressClassName: headerIngressClassName })), resources && (_jsxs(ErrorBoundary, { resources: resources, children: [props.children, showFeedbackForm && _jsx(FeedbackContainer, { url: getPath(), pageTitle: title ?? 'Uten tittel', tjenesteNavn: tjenesteNavn })] }))] })] }));\n};\nexport default Master;\n","import { useEffect, useRef } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { trackPageview } from '@helsenorge/framework-utils/adobe-analytics';\nconst useTrackPageView = (enabled = true) => {\n const location = useLocation();\n const previousPathname = useRef();\n useEffect(() => {\n if (enabled && previousPathname.current !== location.pathname) {\n trackPageview();\n previousPathname.current = location.pathname;\n }\n }, [location, enabled]);\n};\nexport default useTrackPageView;\n","import useTrackPageView from './useTrackPageView';\nconst TrackPageView = (props) => {\n useTrackPageView(props.enabled);\n return null;\n};\nexport default TrackPageView;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useEffect, useState } from 'react';\nimport getFeatureToggle from '@helsenorge/framework-utils/hn-feature-toggle';\nimport { getVisPersonvelger } from '@helsenorge/framework-utils/hn-user';\nimport { selectCurrentLanguage } from '@helsenorge/framework-utils/language';\nimport { HeaderFooterEvents } from '@helsenorge/framework-utils/web-component/constants';\nimport Master from './master';\nimport withErrorBoundary from '../error-boundary/with-error-boundary';\nimport { Hjelpeskuff } from '../prosesshjelp/index';\nimport { useAppSelector } from '../store/hooks';\nimport TrackPageView from '../track-pageview';\nconst PageRoot = props => {\n const { subtitle, breadcrumbLink, className, redirectTo, hasFullwidth, hasPageHeader, noBreadcrumb, noDriftspanel, noLanguagePicker, showFeedbackForm = false, noHjelpeskuff, pageTitle, pageDescription, mainAriaLabelledby, headerClassName, headerSubtitleClassName, headerTitleClassName, headerIngressClassName, tjenesteNavn, visPersonvelger = getVisPersonvelger() || window.location.pathname.endsWith('/velg-person'), hjelpetekstId, enablePageviewTracking = true, } = props;\n const language = useAppSelector(state => selectCurrentLanguage(state.language));\n const [visPersonvelgerState, setVisPersonvelgerState] = useState(visPersonvelger);\n const handleVisPersonvelgerUpdate = (event) => {\n setVisPersonvelgerState(event.detail.visPersonvelger);\n };\n useEffect(() => {\n window.addEventListener(HeaderFooterEvents.setvispersonvelger, handleVisPersonvelgerUpdate);\n return () => {\n window.removeEventListener(HeaderFooterEvents.setvispersonvelger, handleVisPersonvelgerUpdate);\n };\n }, []);\n return (_jsxs(Master, { title: pageTitle, subtitle: subtitle, description: pageDescription, mainAriaLabelledby: mainAriaLabelledby, className: className, breadcrumbLink: breadcrumbLink, redirectTo: redirectTo, hasFullwidth: hasFullwidth, hasPageHeader: hasPageHeader, noBreadcrumb: noBreadcrumb, noDriftspanel: noDriftspanel, noLanguagePicker: noLanguagePicker, showFeedbackForm: showFeedbackForm && !getFeatureToggle('DisableFeedbackForm'), headerClassName: headerClassName, headerTitleClassName: headerTitleClassName, headerSubtitleClassName: headerSubtitleClassName, headerIngressClassName: headerIngressClassName, visPersonvelger: visPersonvelgerState, tjenesteNavn: tjenesteNavn, hjelpetekstId: hjelpetekstId, showHjelpeskuffInPageHeader: !noHjelpeskuff, children: [_jsx(TrackPageView, { enabled: enablePageviewTracking }), props.children, !noHjelpeskuff && _jsx(Hjelpeskuff, { tjenesteNavn: tjenesteNavn, hjelpetekstId: hjelpetekstId, language: language })] }));\n};\nexport default withErrorBoundary(PageRoot);\n"],"file":"static/js/core-packages.BD9xgcS9.js"}