import { n as AnalyticsId, s as LanguageLocales } from "./constants2.js";
import { n as useLanguage } from "./useLanguage.js";
import classNames from "classnames";
import { jsx } from "react/jsx-runtime";
import styles from "./components/FormFieldTag/styles.module.scss";
var HN_Designsystem_FormFieldTag_en_GB_default = {
	allRequired: "All fields must be filled out",
	requiredField: "Required",
	optional: "Optional",
	allOptional: "All fields are optional",
	requiredRadiobuttonList: "Select one",
	requiredCheckboxList: "Select one or more",
	requiredSingleCheckbox: "Must be selected"
};
var HN_Designsystem_FormFieldTag_nb_NO_default = {
	allRequired: "Alle felt må fylles ut",
	requiredField: "Må fylles ut",
	optional: "Valgfritt",
	allOptional: "Alle felt er valgfrie",
	requiredRadiobuttonList: "Velg én",
	requiredCheckboxList: "Velg én eller flere",
	requiredSingleCheckbox: "Må velges"
};
var HN_Designsystem_FormFieldTag_nn_NO_default = {
	allRequired: "Alle felt må fyllast ut",
	requiredField: "Må fyllast ut",
	optional: "Valfritt",
	allOptional: "Alle felt er valfrie",
	requiredRadiobuttonList: "Vel éin",
	requiredCheckboxList: "Vel éin eller fleire",
	requiredSingleCheckbox: "Må veljast"
};
var HN_Designsystem_FormFieldTag_se_NO_default = {
	allRequired: "Buot sajiid ferte deavdit",
	requiredField: "Ferte devdojuvvot",
	optional: "Válljenláhkái",
	allOptional: "Buot sajit eat válljenláhkái",
	requiredRadiobuttonList: "Vállje ovtta",
	requiredCheckboxList: "Vállje ovtta dahje máŋga",
	requiredSingleCheckbox: "Ferte válljejuvvot"
};
const getResources = (language) => {
	switch (language) {
		case LanguageLocales.ENGLISH: return HN_Designsystem_FormFieldTag_en_GB_default;
		case LanguageLocales.NORWEGIAN_NYNORSK: return HN_Designsystem_FormFieldTag_nn_NO_default;
		case LanguageLocales.SAMI_NORTHERN: return HN_Designsystem_FormFieldTag_se_NO_default;
		case LanguageLocales.NORWEGIAN:
		default: return HN_Designsystem_FormFieldTag_nb_NO_default;
	}
};
var FormFieldTag = (props) => {
	const { id, level, resources, testId } = props;
	const isOptional = level === "optional" || level === "all-optional";
	const { language } = useLanguage(LanguageLocales.NORWEGIAN);
	const mergedResources = {
		...getResources(language),
		...resources
	};
	const textMap = {
		"all-required": mergedResources.allRequired,
		"required-field": mergedResources.requiredField,
		optional: mergedResources.optional,
		"all-optional": mergedResources.allOptional,
		"required-radiobutton-list": mergedResources.requiredRadiobuttonList,
		"required-checkbox-list": mergedResources.requiredCheckboxList,
		"required-single-checkbox": mergedResources.requiredSingleCheckbox
	};
	return /* @__PURE__ */ jsx("span", {
		id,
		"data-testid": testId,
		"data-analyticsid": AnalyticsId.FormFieldTag,
		className: classNames(styles["form-field-tag"], { [styles["form-field-tag--optional"]]: isOptional }),
		children: textMap[level]
	});
};
var FormFieldTag_default$1 = FormFieldTag;
export { FormFieldTag_default$1 as t };

//# sourceMappingURL=FormFieldTag.js.map