import{_ as m,u as _,H as b,a as p,S as g}from"./StreamlitVue.CglRiHNi.js";import{d as f,r as y,o as d,c as k,a as v,m as C,e as B,b as S}from"./runtime-dom.esm-bundler.CLhb1nSG.js";/* empty css                               */const h=f({__name:"DsfrButtonGroup",props:{args:{},width:{},disabled:{type:Boolean},theme:{}},setup(r,{expose:a}){a(),_();const t=r,e=y(Array(t.args.buttons?.length??0).fill(!1));async function i(u){let o=u.target;for(;o&&!o.classList.contains("fr-btn");)o=o.parentElement;if(!o){console.error("Button not found for click event:",u);return}const c=Array.from(o.parentElement?.parentElement?.children??[]).indexOf(o.parentElement),s=t.args.buttons?.[c];s&&(s.link?window.open(s.link,"_blank")?.focus():s.copy&&navigator.clipboard.writeText(s.copy).catch(n=>{console.error("Failed to copy:",n)})),e.value.some(n=>n)&&(e.value=Array(t.args.buttons?.length??0).fill(!1),p.setComponentValue([...e.value]),await new Promise(n=>setTimeout(n,50))),e.value[c]=!0,p.setComponentValue([...e.value]),await new Promise(n=>setTimeout(n,50)),e.value[c]=!1,p.setComponentValue([...e.value])}const l={props:t,clicked:e,onClick:i,get DsfrButtonGroup(){return b}};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}});function w(r,a,t,e,i,l){return d(),k("div",{class:"component",style:B(r.style)},[v(e.DsfrButtonGroup,C(e.props.args,{disabled:e.props.disabled||e.props.args.disabled,onClick:e.onClick}),null,16,["disabled"])],4)}const x=m(h,[["render",w]]),D=f({__name:"DsfrButtonGroup",setup(r,{expose:a}){a();const t={StreamlitComponent:g,Component:x};return Object.defineProperty(t,"__isScriptSetup",{enumerable:!1,value:!0}),t}});function E(r,a,t,e,i,l){return d(),S(e.StreamlitComponent,{component:e.Component,"client:load":""})}const V=m(D,[["render",E]]);export{V as default};
