import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import"./index-Ds2meNS5.js";import{I as h}from"./Image-Bdf4wQSw.js";import"./ImagePreview-Cx854cRW.js";import"./svelte/svelte_svelte.js";var x=e.from_html("<a><!> <!></a>"),y=e.from_html("<button><!> <!></button>");function P(b,t){e.push(t,!0);let v=e.prop(t,"elem_classes",19,()=>[]),g=e.prop(t,"onclick",3,()=>{});var u=e.comment(),o=e.first_child(u);{var k=a=>{var l=x();let d,c;var r=e.child(l);{var s=i=>{{let n=e.derived(()=>({alt:`${t.value} icon`,class:"button-icon"}));h(i,{get src(){return t.icon.url},get restProps(){return e.get(n)}})}};e.if(r,i=>{t.icon&&i(s)})}var m=e.sibling(r,2);{var f=i=>{var n=e.comment(),_=e.first_child(n);e.snippet(_,()=>t.children),e.append(i,n)};e.if(m,i=>{t.children&&i(f)})}e.reset(l),e.template_effect(i=>{e.set_attribute(l,"href",t.link),e.set_attribute(l,"target",t.link_target),e.set_attribute(l,"rel",t.link_target==="_blank"?"noopener noreferrer":void 0),e.set_attribute(l,"aria-disabled",t.disabled),d=e.set_class(l,1,`${t.size??""} ${t.variant??""} ${i??""}`,"svelte-xzq5jh",d,{hidden:t.visible===!1||t.visible==="hidden",disabled:t.disabled}),e.set_attribute(l,"id",t.elem_id),c=e.set_style(l,"",c,{"flex-grow":t.scale,"pointer-events":t.disabled?"none":null,width:t.scale===0?"fit-content":null,"min-width":typeof t.min_width=="number"?`calc(min(${t.min_width}px, 100%))`:null})},[()=>v().join(" ")]),e.append(a,l)},w=a=>{var l=y();l.__click=function(...i){g()?.apply(this,i)};let d,c;var r=e.child(l);{var s=i=>{{let n=e.derived(()=>({alt:`${t.value} icon`})),_=e.derived(()=>[`button-icon ${t.value?"right-padded":""}`]);h(i,{get restProps(){return e.get(n)},get class_names(){return e.get(_)},get src(){return t.icon.url}})}};e.if(r,i=>{t.icon&&i(s)})}var m=e.sibling(r,2);{var f=i=>{var n=e.comment(),_=e.first_child(n);e.snippet(_,()=>t.children),e.append(i,n)};e.if(m,i=>{t.children&&i(f)})}e.reset(l),e.template_effect(i=>{d=e.set_class(l,1,`${t.size??""} ${t.variant??""} ${i??""}`,"svelte-xzq5jh",d,{hidden:t.visible===!1||t.visible==="hidden"}),e.set_attribute(l,"id",t.elem_id),l.disabled=t.disabled,c=e.set_style(l,"",c,{"flex-grow":t.scale,width:t.scale===0?"fit-content":null,"min-width":typeof t.min_width=="number"?`calc(min(${t.min_width}px, 100%))`:null})},[()=>v().join(" ")]),e.append(a,l)};e.if(o,a=>{t.link&&t.link.length>0?a(k):a(w,!1)})}e.append(b,u),e.pop()}e.delegate(["click"]);export{P as B};
