import{h as e}from"./p-083180bf.js";import{i as a}from"./p-f8a09b0f.js";import{j as l,a as o}from"./p-cef45012.js";l.setup(o());const r=l.createStyleSheet({ErrorStyle:{"&::part(control)":{borderColor:"var(--sl-color-danger-500)",outline:"var(--sl-color-danger-500)"},"&:host":{"--focus-ring":"0 0 0 var(--sl-focus-ring-width) red !important"}},ErrorMessageStyle:{margin:0,marginTop:"5px",color:"var(--sl-color-danger-500)",fontSize:"var(--sl-input-help-text-font-size-medium)",fontFamily:"var(--sl-font-sans)",fontWeight:"var(--sl-font-weight-normal)"},FieldContainer:{"margin-bottom":"var(--sl-spacing-large)"}}),n=r.toString();function t(l){var o,t,s,i,c;const{states:d,content:b}=l,p=null===(o=null==d?void 0:d.leadFormState)||void 0===o?void 0:o.validationErrors,v=({checkboxLabel:e})=>a.formatMessage({id:`requiredFieldErrorMessage-${e}`,defaultMessage:b.errorMessage},{checkboxLabel:e});return e("div",{class:r.classes.FieldContainer,part:"sqm-base"},e("style",{type:"text/css"},"\n:host {\n  margin: 0 auto;\n  width: 100%;\n  display: block;\n}\nsl-checkbox::part(label){\n  font-size: var(--sl-input-label-font-size-small);\n  font-weight: var(--sl-font-weight-normal);\n  line-height: 20px;\n}\nsl-checkbox::part(base){\n  align-items: start;\n}\n",n),e("sl-checkbox",Object.assign({exportparts:"label: input-label, base: input-base",name:`/${b.checkboxName}`,"onSl-change":e=>{e.target.value=e.target.checked}},b.checkboxOptional?[]:{required:!1},{disabled:(null===(t=d.leadFormState)||void 0===t?void 0:t.loading)||(null===(s=d.leadFormState)||void 0===s?void 0:s.disabled),validationError:({value:e})=>{if(!e&&!b.checkboxOptional)return v({checkboxLabel:b.checkboxLabel})}},(null===(c=null===(i=d.leadFormState)||void 0===i?void 0:i.validationErrors)||void 0===c?void 0:c[b.checkboxName])?{class:r.classes.ErrorStyle}:[]),a.formatMessage({id:b.checkboxName+"-message",defaultMessage:b.checkboxLabel},{labelLink:e("a",{href:b.checkboxLabelLink,target:"_blank"},b.checkboxLabelLinkText||b.checkboxLabelLink)})),(null==p?void 0:p[b.checkboxName])&&e("p",{class:r.classes.ErrorMessageStyle},v({checkboxLabel:b.checkboxLabel})))}export{t as L}