import{r as s,h as t,H as e,g as i}from"./p-ClISz4NF.js";import{g as o,b as r}from"./p-B6CqPcY_.js";import{g as a}from"./p-CoD1xawt.js";import{s as f}from"./p-vN03FcXN.js";import{i as c}from"./p-DNztiAH0.js";import"./p-BcQO4NH2.js";import"./p-CQvUntGY.js";import"./p-EeKNA85D.js";import"./p-U40vKHrs.js";import"./p-DYcNEwSZ.js";import"./p-DBXGhafv.js";const b=class{constructor(t){s(this,t);this.invalid=false;this.disabled=false;this.success=false;this.fieldset=false;this.size="m";this.h=a(this.host);this.f=o(this.h)}componentDidRender(){this.syncControlMessages();this.formElementDescriptionControl()}disconnectedCallback(){var s;(s=this.observer)===null||s===void 0?void 0:s.disconnect()}formElementDescriptionControl(){const s=this.host.querySelector("."+r.bottom);if(!s)return;this.observer=new MutationObserver(function(){this.syncControlMessages()}.bind(this));this.observer.observe(s,{childList:true})}syncControlMessages(){Promise.all(this.f.messageElements.map((s=>s.identifier()))).then((s=>{this.f.mainElementsInControl.forEach((t=>{const e=f(t.getAttribute("aria-describedby"));t.removeAttribute("aria-describedby");if(Array.isArray(e)){e.forEach((t=>c(t)&&t.indexOf("GovFormMessage")===-1?s.push(t):null))}if(s.length){t.setAttribute("aria-describedby",s.join(" "))}}))}))}render(){const s=this.fieldset?"fieldset":"div";return t(e,{key:"04e4ab3533f5d22939573fa20a354a0b76319986",size:this.size,class:this.h.classes(r.root)},t(s,{key:"9851627baf138775fe24a673d6a095fc8980b6e9",class:r.holder},this.h.hasSlot("top")&&t("slot",{key:"beffe147db943648861b9775dee76ef6b20dffa3",name:"top"}),t("slot",{key:"6667b41d2720045a93b10a92ef300e2842ff57b4"}),this.h.hasSlot("bottom")&&t("div",{key:"fe117fdc7d64b3c2b4e18e95d1f213c8a8fe3766",class:r.bottom},t("slot",{key:"07eabb48c2849d624bed7f59ba14811ed35732fb",name:"bottom"}))))}get host(){return i(this)}};export{b as gov_form_control};
//# sourceMappingURL=p-b3b517f0.entry.js.map