"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("../../features/icons/NoShieldSecondaryIcon.cjs"),u=require("../../features/icons/ShieldPrimaryIcon.cjs"),g=require("../../features/icons/ShieldSecondaryIcon.cjs"),a=require("@chakra-ui/react"),c=require("react"),l=require("react-i18next");require("../Typography.cjs");const d=require("./context.cjs"),n=require("../typography.generated.cjs"),x=({...s})=>{const o=d.usePasswordStrengthIndicatorContext(),{t}=l.useTranslation(),e=c.useMemo(()=>o===null?null:o<3?{bgColor:"surface-danger-default",textColor:"text-danger",label:t("passwordStrengthIndicator.tooWeak"),icon:r.jsx(i,{w:4,h:4})}:o===3?{bgColor:"surface-success-default",textColor:"text-success",label:t("passwordStrengthIndicator.good"),icon:r.jsx(g,{w:4,h:4})}:{bgColor:"surface-success-default",textColor:"text-success",label:t("passwordStrengthIndicator.excellent"),icon:r.jsx(u,{w:4,h:4})},[o,t]);return e?r.jsxs(a.Flex,{px:2,py:1,bg:e.bgColor,color:e.textColor,rounded:"md",width:"fit-content",alignItems:"center",...s,children:[e.icon,r.jsx(n.L1Bold,{ml:1,children:e.label})]}):null},h=({...s})=>{const o=d.usePasswordStrengthIndicatorContext(),{t}=l.useTranslation(),e=c.useMemo(()=>{if(o===null)return{label:t("passwordStrengthIndicator.passwordMustContainAtLeast8Characters"),bgColor:"surface-transparent",textColor:"text-secondary"};if(o<3)return{label:t("passwordStrengthIndicator.thisIsAWweakPasswordTryAStrongerOne"),bgColor:"surface-danger-default",textColor:"text-danger-accessible"};if(o===3)return{label:t("passwordStrengthIndicator.makeYourPasswordStrongerWithAFewMoreCharacters"),bgColor:"surface-transparent",textColor:"text-secondary"}},[o,t]);return r.jsx(r.Fragment,{children:e&&r.jsx(n.L2Bold,{bg:e.bgColor,color:e.textColor,px:4,py:3,rounded:"md",...s,children:e.label})})},C=({...s})=>{const o=d.usePasswordStrengthIndicatorContext(),{t}=l.useTranslation(),e=c.useMemo(()=>o===null?{comment:t("passwordStrengthIndicator.passwordMustContainAtLeast8Characters"),bgColor:"surface-transparent",textColor:"text-secondary"}:o<3?{bgColor:"surface-danger-default",labelTextColor:"text-danger",label:t("passwordStrengthIndicator.tooWeak"),commentTextColor:"text-danger-accessible",comment:t("passwordStrengthIndicator.thisIsAWweakPasswordTryAStrongerOne"),icon:r.jsx(i,{w:4,h:4,color:"icon-danger"})}:o===3?{bgColor:"surface-success-default",labelTextColor:"text-success",label:t("passwordStrengthIndicator.good"),comment:t("passwordStrengthIndicator.makeYourPasswordStrongerWithAFewMoreCharacters"),commentTextColor:"text-success-accessible",icon:r.jsx(g,{w:4,h:4})}:{bgColor:"surface-success-default",textColor:"text-success",label:t("passwordStrengthIndicator.excellent"),gap:1,icon:r.jsx(u,{w:4,h:4,color:"icon-success"})},[o,t]);return e?r.jsxs(a.Flex,{px:4,py:3,gap:e.gap??3,bg:e.bgColor,rounded:"md",width:"fit-content",alignItems:"center",...s,children:[e.icon,r.jsxs(a.Flex,{flexDirection:"column",children:[r.jsx(n.L1Bold,{color:e.textColor??e.labelTextColor,children:e.label}),r.jsx(n.L2Bold,{bg:e.bgColor,color:e.textColor??e.commentTextColor,rounded:"md",...s,children:e.comment})]})]}):null};exports.PasswordStrengthIndicatorComment=h;exports.PasswordStrengthIndicatorLabel=x;exports.PasswordStrengthIndicatorLabelAndComment=C;
