/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const index=require("./index-b4950b0c.js"),validation=require("./validation-cd978d87.js"),prop_validators=require("./prop.validators-888c8338.js"),label=require("./label-477be19d.js");require("./index-38f5f0b2.js"),require("./dev.utils-58fde089.js");const headingVariantPropTypeOptions=["h1","h2","h3","h4","h5","h6","strong"],validateHeadingVariant=(e,a)=>{prop_validators.watchValidator(e,"_variant",(e=>"string"==typeof e&&headingVariantPropTypeOptions.includes(e)),new Set([`KoliBriHeadingVariant {${headingVariantPropTypeOptions.join(", ")}`]),a)},KolHeadingWc=class{constructor(e){index.registerInstance(this,e),this.renderHeadline=(e,a)=>{const i="number"==typeof a&&a>0&&a<=6?`h${a}`:"strong",t=this._variant||i;return index.h(i,{class:{headline:!0,[`headline-${t}`]:!0}},e,index.h("slot",{name:"expert"}))},this.renderSecondaryHeadline=(e,a)=>{switch(a){case 1:return index.h("span",{class:"secondary-headline"},e);case 2:return index.h("h2",{class:"secondary-headline"},e);case 3:return index.h("h3",{class:"secondary-headline"},e);case 4:return index.h("h4",{class:"secondary-headline"},e);case 5:return index.h("h5",{class:"secondary-headline"},e);case 6:return index.h("h6",{class:"secondary-headline"},e);default:return index.h("strong",{class:"secondary-headline"},e)}},this._label=void 0,this._level=1,this._secondaryHeadline=void 0,this._variant=void 0,this.state={_label:"",_level:1}}validateLabel(e){label.validateLabelWithExpertSlot(this,e)}validateLevel(e){validation.watchHeadingLevel(this,e)}validateSecondaryHeadline(e){prop_validators.watchString(this,"_secondaryHeadline",e)}validateVariant(e){validateHeadingVariant(this,e)}componentWillLoad(){this.validateLabel(this._label),this.validateLevel(this._level),this.validateSecondaryHeadline(this._secondaryHeadline),this.validateVariant(this._variant)}render(){return index.h(index.Host,{key:"e7bbeab369d3089ea0c1e7ca52e8bb97720ec061",class:"kol-heading-wc"},"string"==typeof this.state._secondaryHeadline&&this.state._secondaryHeadline.length>0?index.h("hgroup",null,this.renderHeadline(this.state._label,this.state._level),this.state._secondaryHeadline&&this.renderSecondaryHeadline(this.state._secondaryHeadline,this.state._level+1)):this.renderHeadline(this.state._label,this.state._level))}static get watchers(){return{_label:["validateLabel"],_level:["validateLevel"],_secondaryHeadline:["validateSecondaryHeadline"],_variant:["validateVariant"]}}};exports.kol_heading_wc=KolHeadingWc;