import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import{I as c,C as p}from"./IconButtonWrapper-Cljb5D-5.js";import{createEventDispatcher as g}from"./svelte/svelte_svelte.js";import"./i18n-BldJSFLV.js";import{S as h}from"./utils.svelte-Ceck75cM.js";function b(u,a){e.push(a,!1);const l=g();let n=e.prop(a,"formatter",12),s=e.prop(a,"value",12),o=e.prop(a,"i18n",12),i=e.mutable_source(!1);var m={get formatter(){return n()},set formatter(t){n(t),e.flush()},get value(){return s()},set value(t){s(t),e.flush()},get i18n(){return o()},set i18n(t){o(t),e.flush()}};e.init();{let t=e.derived_safe_equal(()=>(e.deep_read_state(o()),e.untrack(()=>o()("common.share"))));c(u,{get Icon(){return p},get label(){return e.get(t)},get pending(){return e.get(i)},$$events:{click:async()=>{try{e.set(i,!0);const r=await n()(s());l("share",{description:r})}catch(r){console.error(r);let f=r instanceof h?r.message:"Share failed.";l("error",f)}finally{e.set(i,!1)}}}})}return e.pop(m)}export{b as S};
