import{S as p,i as w,s as z,b as d,g as f,B as _,a as g,h as b,u as y,C as m,k,d as E,w as h,H as A}from"./vendor.906e418a.js";import"./ModifyUpload.svelte_svelte_type_style_lang.b37768c1.js";var C="./assets/edit.82f21b4b.svg",D="./assets/clear.bf0a458a.svg";function v(s){let e,t,l,i,u;return{c(){e=d("button"),t=d("img"),f(t,"class","h-4 filter dark:invert svelte-xtzy12"),_(t.src,l=C)||f(t,"src",l),f(t,"alt","Edit"),f(e,"class","edit bg-opacity-30 hover:bg-opacity-100 transition p-1 svelte-xtzy12")},m(o,n){g(o,e,n),b(e,t),i||(u=y(e,"click",s[5]),i=!0)},p:m,d(o){o&&k(e),i=!1,u()}}}function q(s){let e,t,l,i,u,o,n,a=s[0]&&v(s);return{c(){e=d("div"),a&&a.c(),t=E(),l=d("button"),i=d("img"),f(i,"class","h-4 filter dark:invert svelte-xtzy12"),_(i.src,u=D)||f(i,"src",u),f(i,"alt","Clear"),f(l,"class","clear bg-opacity-30 hover:bg-opacity-100 transition p-1 svelte-xtzy12"),f(e,"class","modify-upload z-10 top-0 right-0 flex justify-end svelte-xtzy12"),f(e,"theme",s[1]),h(e,"absolute",s[2])},m(c,r){g(c,e,r),a&&a.m(e,null),b(e,t),b(e,l),b(l,i),o||(n=y(l,"click",s[6]),o=!0)},p(c,[r]){c[0]?a?a.p(c,r):(a=v(c),a.c(),a.m(e,t)):a&&(a.d(1),a=null),r&2&&f(e,"theme",c[1]),r&4&&h(e,"absolute",c[2])},i:m,o:m,d(c){c&&k(e),a&&a.d(),o=!1,n()}}}function F(s,e,t){let{editable:l=!1}=e,{theme:i}=e,{style:u}=e,{absolute:o=!0}=e;const n=A(),a=()=>n("edit"),c=()=>n("clear");return s.$$set=r=>{"editable"in r&&t(0,l=r.editable),"theme"in r&&t(1,i=r.theme),"style"in r&&t(4,u=r.style),"absolute"in r&&t(2,o=r.absolute)},[l,i,o,n,u,a,c]}class M extends p{constructor(e){super();w(this,e,F,q,z,{editable:0,theme:1,style:4,absolute:2})}}const P=async(s,e)=>({name:s,data:e+s,is_example:!0}),R=async(s,e)=>{let t=e+s,l=await fetch(t);if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);let i=await l.blob();return new Promise((u,o)=>{var n=new FileReader;n.addEventListener("load",function(){u(n.result)},!1),n.onerror=()=>o(),n.readAsDataURL(i)})};export{M,R as a,P as l};
