import{_ as u,u as _,a as t,A as f,S as m}from"./StreamlitVue.ZFQEvSxb.js";import{d as p,r as i,e as v,f as b,o as d,c as B,a as E,m as g,h as k,b as C}from"./runtime-dom.esm-bundler.xzzcc6UT.js";/* empty css                               */const S=p({__name:"DsfrButton",props:{args:{},width:{},disabled:{type:Boolean},theme:{}},setup(r,{expose:s}){s(),_();const o=r,e=i(!1),n=i(!1),a=c=>{!n.value&&e.value&&(e.value=!1,t.setComponentValue(e.value))};v(()=>{t.events.addEventListener(t.RENDER_EVENT,a)}),b(()=>{t.events.removeEventListener(t.RENDER_EVENT,a)});const l={props:o,clicked:e,isFocused:n,onRenderEvent:a,onClick:()=>{o.args.link?window.open(o.args.link,"_blank")?.focus():o.args.copy&&navigator.clipboard.writeText(o.args.copy).catch(c=>{console.error("Failed to copy:",c)}),e.value||(e.value=!0,t.setComponentValue(e.value))},onFocus:()=>{n.value=!0},onBlur:()=>{n.value=!1},get DsfrButton(){return f}};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}});function y(r,s,o,e,n,a){return d(),B("div",{class:"component",style:k(r.style)},[E(e.DsfrButton,g(e.props.args,{label:e.props.args.label||"Button",disabled:e.props.disabled||e.props.args.disabled,onClick:e.onClick,onFocus:e.onFocus,onBlur:e.onBlur}),null,16,["label","disabled"])],4)}const D=u(S,[["render",y]]),h=p({__name:"DsfrButton",setup(r,{expose:s}){s();const o={StreamlitComponent:m,Component:D};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}});function x(r,s,o,e,n,a){return d(),C(e.StreamlitComponent,{component:e.Component,"client:load":""})}const T=u(h,[["render",x]]);export{T as default};
