import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$2}from"./va-icon2.js";const vaDetailsCss=":host .usa-input--2xs{max-width:5ex}:host .usa-input--xs{max-width:9ex}:host .usa-input--sm{max-width:13ex}:host .usa-input--small{max-width:13ex}:host .usa-input--md{max-width:20ex}:host .usa-input--medium{max-width:20ex}:host .usa-input--lg{max-width:30ex}:host .usa-input--xl{max-width:40ex}:host .usa-input--2xl{max-width:50ex}:host .va-select__sort-container--md{max-width:100%}@media (min-width: 640px){:host .va-select__sort-container--md{max-width:none;-ms-flex-preferred-size:20ex;flex-basis:20ex}}:host .va-select__sort-container--medium{max-width:100%}@media (min-width: 640px){:host .va-select__sort-container--medium{max-width:none;-ms-flex-preferred-size:20ex;flex-basis:20ex}}:host .va-select__sort-container--lg{max-width:100%}@media (min-width: 640px){:host .va-select__sort-container--lg{max-width:none;-ms-flex-preferred-size:30ex;flex-basis:30ex}}:host .va-select__sort-container--xl{max-width:100%}@media (min-width: 640px){:host .va-select__sort-container--xl{max-width:none;-ms-flex-preferred-size:40ex;flex-basis:40ex}}:host{font-size:var(--vads-font-size-source-sans-normalized)}:host details.va-details{width:100%;border:1px solid var(--vads-color-gray-medium);border-radius:var(--units-0p5)}:host details.va-details summary.va-details__summary{display:-ms-flexbox;display:flex;gap:var(--units-0p5);padding:0.125rem var(--units-0p5);font-weight:var(--font-weight-bold);line-height:1.25rem}:host details.va-details summary.va-details__summary::marker{content:none;}:host details.va-details summary.va-details__summary:hover{cursor:pointer;background-color:rgba(0, 0, 0, 0.05)}:host details.va-details summary.va-details__summary:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:-0.125rem}:host details.va-details summary.va-details__summary va-icon.va-details__icon{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;margin-top:0.094rem;-webkit-transform:rotate(90deg);transform:rotate(90deg);-webkit-transition:-webkit-transform 0.15s linear;transition:-webkit-transform 0.15s linear;transition:transform 0.15s linear;transition:transform 0.15s linear, -webkit-transform 0.15s linear}:host details.va-details[open] summary.va-details__summary va-icon.va-details__icon{-webkit-transform:rotate(270deg);transform:rotate(270deg)}:host details.va-details div.va-details__content{padding:0 var(--units-0p5) var(--units-0p5) var(--units-3)}:host details.va-details div.va-details__content.va-details__content--element-child{padding-top:var(--units-0p5)}:host ::slotted(*:first-child){margin-top:0 !important;padding-top:0 !important}:host ::slotted(*:last-child){margin-bottom:0 !important;padding-bottom:0 !important}",VaDetailsStyle0=vaDetailsCss,VaDetails$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleToggle=t=>{t.preventDefault(),setTimeout(()=>{this.isOpen=!this.isOpen},100)},this.handleKeyDown=t=>{"Enter"!==t.key&&" "!==t.key||this.handleToggle(t)},this.label=void 0,this.width=void 0,this.isOpen=!1,this.firstNodeIsElement=!1}inspectSlot(){const t=this.el.shadowRoot.querySelector("slot"),e=((null==t?void 0:t.assignedNodes({flatten:!0}))||[]).find(t=>{var e;return t.nodeType!==Node.TEXT_NODE||(null===(e=t.textContent)||void 0===e?void 0:e.trim())});this.firstNodeIsElement=(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE}render(){const{label:t,width:e}=this;if(!t)return null;const s=["xl","2xl"].includes(e)?e:void 0,i=classnames({"va-details":!0,[`usa-input--${s}`]:s}),a=classnames({"va-details__content":!0,"va-details__content--element-child":this.firstNodeIsElement});return h(Host,null,h("details",{class:i,open:this.isOpen},h("summary",{class:"va-details__summary",onClick:this.handleToggle,onKeyDown:this.handleKeyDown},h("va-icon",{class:"va-details__icon",icon:"chevron_right"}),t),h("div",{class:a},h("slot",{onSlotchange:()=>this.inspectSlot()}))))}get el(){return this}static get style(){return VaDetailsStyle0}},[1,"va-details",{label:[1],width:[1],isOpen:[32],firstNodeIsElement:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-details","va-icon"].forEach(t=>{switch(t){case"va-details":customElements.get(t)||customElements.define(t,VaDetails$1);break;case"va-icon":customElements.get(t)||defineCustomElement$2()}})}const VaDetails=VaDetails$1,defineCustomElement=defineCustomElement$1;export{VaDetails,defineCustomElement};