import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import"./i18n-CyvX8KmK.js";import{G as B}from"./utils.svelte-Ceck75cM.js";import"./svelte/svelte_internal_flags_legacy.js";import{createEventDispatcher as y}from"./svelte/svelte_svelte.js";import"./index-Dw8Uzof1.js";import{B as C}from"./Button-CJbn8n9a.js";import"./svelte/svelte_store.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./Image-Bdf4wQSw.js";import"./ImagePreview-CBoeGuoF.js";import"./IconButtonWrapper-D4LMIc_2.js";import"./MarkdownCode-C7jLnxqj.js";import"./prism-python-B1e-54E9.js";import"./ShareButton-DGzDjeX1.js";import"./FullscreenButton-CdZP1GYm.js";var D=e.from_html('<img class="button-icon svelte-4ac0fl"/>'),E=e.from_html("<!> <!>",1);function G(p,i){e.push(i,!1);let a=e.prop(i,"elem_id",12,""),r=e.prop(i,"elem_classes",28,()=>[]),n=e.prop(i,"visible",12,!0),o=e.prop(i,"variant",12,"secondary"),m=e.prop(i,"size",12,"lg"),l=e.prop(i,"value",12),u=e.prop(i,"icon",12),c=e.prop(i,"disabled",12,!1),f=e.prop(i,"scale",12,null),_=e.prop(i,"min_width",12,void 0);const b=y();function w(){if(b("click"),!l()?.url)return;let t;if(!l().orig_name&&l().url){const d=l().url.split("/");t=d[d.length-1],t=t.split("?")[0].split("#")[0]}else t=l().orig_name;const s=document.createElement("a");s.href=l().url,s.download=t||"file",document.body.appendChild(s),s.click(),document.body.removeChild(s)}var x={get elem_id(){return a()},set elem_id(t){a(t),e.flush()},get elem_classes(){return r()},set elem_classes(t){r(t),e.flush()},get visible(){return n()},set visible(t){n(t),e.flush()},get variant(){return o()},set variant(t){o(t),e.flush()},get size(){return m()},set size(t){m(t),e.flush()},get value(){return l()},set value(t){l(t),e.flush()},get icon(){return u()},set icon(t){u(t),e.flush()},get disabled(){return c()},set disabled(t){c(t),e.flush()},get scale(){return f()},set scale(t){f(t),e.flush()},get min_width(){return _()},set min_width(t){_(t),e.flush()}};return e.init(),C(p,{get size(){return m()},get variant(){return o()},get elem_id(){return a()},get elem_classes(){return r()},get visible(){return n()},get scale(){return f()},get min_width(){return _()},get disabled(){return c()},$$events:{click:w},children:(t,s)=>{var d=E(),v=e.first_child(d);{var z=g=>{var h=D();e.template_effect(()=>{e.set_attribute(h,"src",(e.deep_read_state(u()),e.untrack(()=>u().url))),e.set_attribute(h,"alt",`${l()} icon`)}),e.append(g,h)};e.if(v,g=>{u()&&g(z)})}var k=e.sibling(v,2);e.slot(k,i,"default",{},null),e.append(t,d)},$$slots:{default:!0}}),e.pop(x)}function ie(p,i){e.push(i,!0);const a=e.rest_props(i,["$$slots","$$events","$$legacy"]),r=new B(a);{let n=e.derived(()=>!r.shared.interactive);G(p,{get value(){return r.props.value},get variant(){return r.props.variant},get elem_id(){return r.shared.elem_id},get elem_classes(){return r.shared.elem_classes},get size(){return r.props.size},get scale(){return r.shared.scale},get icon(){return r.props.icon},get min_width(){return r.shared.min_width},get visible(){return r.shared.visible},get disabled(){return e.get(n)},$$events:{click:()=>r.dispatch("click")},children:(o,m)=>{e.next();var l=e.text();e.template_effect(()=>e.set_text(l,r.shared.label??"")),e.append(o,l)},$$slots:{default:!0}})}e.pop()}export{G as BaseButton,ie as default};
