import{C as e,D as t,F as n,Q as r,X as i,Y as a,b as o}from"./app-lC2oAIsL.js";import{t as s}from"./i18n-1u_ZOjdz.js";var c={key:0,class:`animate-spin`,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.4`,"stroke-linecap":`round`},l={key:1,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},u=[`accept`],d=t({__name:`UploadButton`,props:{label:{},accept:{},uploading:{type:Boolean}},emits:[`file`],setup(t,{emit:d}){let f=d;function p(e){let t=e.target,n=t.files?.[0];n&&f(`file`,n),t.value=``}return(d,f)=>(n(),e(`label`,{class:i([`inline-flex cursor-pointer items-center gap-2 rounded-lg border border-line bg-surface-2 px-3.5 py-2 text-sm font-semibold text-ink-2 transition hover:border-primary/50 hover:bg-appbg hover:text-ink`,t.uploading?`pointer-events-none opacity-70`:``])},[t.uploading?(n(),e(`svg`,c,[...f[0]||=[o(`path`,{d:`M21 12a9 9 0 1 1-6.2-8.5`},null,-1)]])):(n(),e(`svg`,l,[...f[1]||=[o(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12`},null,-1)]])),o(`span`,null,r(t.uploading?a(s)(`Uploading…`):t.label||a(s)(`Choose image`)),1),o(`input`,{type:`file`,accept:t.accept||`image/png,image/jpeg,image/webp`,class:`sr-only`,onChange:p},null,40,u)],2))}});export{d as t};