"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7079],{3393:(e,t,s)=>{s.d(t,{y:()=>r});var i=s(9696),n=s(79365),l=s(81365);const r=(...e)=>(0,i.Zz)(n.XX,n._$,n.yF,n.jd)((0,l.q)(...e))},51298:(e,t,s)=>{s.d(t,{m:()=>r}),s(25964);var i=s(3393),n=s(97810),l=s(13011);const r=e=>{class t extends((0,i.y)({componentName:e,baseSelector:"slot"})){constructor(){super(),this.innerHTML='\n    <slot part="wrapper"></slot>\n      '}dispatchChange=l.r.bind(this,"change");get items(){return this.querySelector("slot").assignedElements()}get isReadonly(){return"true"===this.getAttribute("readonly")}get size(){return this.getAttribute("size")||"md"}get value(){console.warn("get value","is not implemented")}set value(e){console.warn("set value","is not implemented")}onSizeChange(){this.items.forEach(e=>{e.setAttribute("size",this.size)})}onReadOnlyChange(){this.querySelector("slot").toggleAttribute("inert",this.isReadonly)}getValidity(){console.warn("getValidity","is not implemented")}onObservedAttributeChange(e){e.forEach(e=>{switch(e){case"size":this.onSizeChange();break;case"readonly":this.onReadOnlyChange()}})}init(){this.addEventListener("focus",e=>{e.isTrusted&&this.items[0]?.focus()}),super.init?.(),(0,n.mx)(this,this.onObservedAttributeChange.bind(this),{includeAttrs:["size","readonly"]})}}return t}},72415:(e,t,s)=>{s.r(t),s.d(t,{ButtonSelectionGroupInternalClass:()=>i.n});var i=s(92491);customElements.define(i.T,i.n)},92491:(e,t,s)=>{s.d(t,{T:()=>l,n:()=>r});var i=s(97810),n=s(51298);const l=(0,i.xE)("button-selection-group-internal");class r extends((0,n.m)(l)){getSelectedNode(){return this.items.find(e=>e.hasAttribute("selected"))}get allowDeselect(){return"true"===this.getAttribute("allow-deselect")}removeSelected(){this.getSelectedNode()?.removeAttribute("selected")}onClick(e){e.target!==e.currentTarget&&(e.target===this.getSelectedNode()&&this.allowDeselect?this.removeSelected():this.setSelected(e.target),this.dispatchChange())}setSelected(e){e!==this.getSelectedNode()&&(this.removeSelected(),e?.setAttribute("selected","true"))}get defaultValue(){return this.getAttribute("default-value")}setDefaultValue(){setTimeout(()=>{this.defaultValue&&(this.value=this.defaultValue,this.setCustomValidity())})}get value(){return this.getSelectedNode()?.value||""}set value(e){const t=this.items.find(t=>t.value===e);this.setSelected(t)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}init(){super.init(),this.setDefaultValue(),this.querySelector("slot").addEventListener("click",this.onClick.bind(this))}}}}]);
//# sourceMappingURL=button-selection-group-fields-descope-button-selection-group-internal-index-js.js.map