import{r as t,c as s,h as i,H as o,g as e}from"./p-ClISz4NF.js";import{g as a,a as n}from"./p-CoD1xawt.js";import{F as r}from"./p-5itQzbON.js";import{v as h}from"./p-NOJjz9dT.js";import{C as c}from"./p-U40vKHrs.js";import{p as l}from"./p-CQvUntGY.js";import{A as d,a as b}from"./p-Bz_RzYFb.js";import{i as f}from"./p-CzXeijOj.js";import"./p-CgDnDrq5.js";const p=l(c,["PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var v;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(v||(v={}));const m={root:"gov-infobar",section:"gov-infobar__section",content:"gov-infobar__content",headline:"gov-infobar__headline",close:"gov-infobar__close"};const g=class{constructor(i){t(this,i);this.govClose=s(this,"gov-close");this.hydrated=false;this.color="primary";this.type="bold";this.role=undefined;this.accessibleCloseLabel="Zavřít informační lištu";this.accessibleToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.inheritedAttributes={};this.h=a(this.host)}validateColor(t){h(p,t,m.root)}componentDidLoad(){this.attributeObserver=new d(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.validateColor(this.color);this.inheritedAttributes=f(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}connectedCallback(){this.hydrated=true}render(){const t=i("gov-button",{key:"aaaf43a5b48ccded5f30061b7b6dfd09da11e970",size:"s","aria-label":this.accessibleCloseLabel,type:"base",color:this.isBold?this.color:"neutral","on-gov-click":this.onCloseHandler.bind(this),class:m.close},i("gov-icon",{key:"3f4f5c3b15842ff258035badfbf9286dacdba8b5",name:"x-lg",type:"components"}));return i(o,{key:"7d52bcf1a541c5c536755a16e13dd66209d7ba98",class:this.h.classes(m.root),color:this.color,type:this.type,hydrated:this.hydrated},i("section",Object.assign({key:"e52815b07de6e3fae05bb4429ab925300fde0a50",class:m.section},this.inheritedAttributes,{role:this.role}),this.h.hasSlot("icon")&&i("span",{key:"d1424933f1f122693d45803eb500aff8c7b45dd7"},i("slot",{key:"94ab048d5e2e506773402a55d399f3c315307153",name:"icon"})),i("div",{key:"b59bbe4b7516d0b4e96e19618613d9e82551cd39",class:m.content},this.h.hasSlot("headline")?i(r,null,i("div",{class:m.headline},i("slot",{name:"headline"}),i("gov-button",{size:"s",type:"base",color:this.isBold?this.color:"neutral","aria-label":this.accessibleToggleLabel,"on-gov-click":()=>this.toggleContent=!this.toggleContent},i("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down",type:"components"}))),i("div",{hidden:!this.toggleContent,"aria-hidden":n(this.toggleContent)},i("slot",null))):i("slot",null)),this.closable&&t))}onCloseHandler(t){this.govClose.emit({component:m.root,ref:this.host,originalEvent:t})}get isBold(){return this.type==="bold"}get host(){return e(this)}static get watchers(){return{color:["validateColor"]}}};export{g as gov_infobar};
//# sourceMappingURL=p-8655fd24.entry.js.map