import{S as R,i as j,s as q,M as W,e as F,m as E,a as f,b as A,g as y,c,N as _,p as h,O as X,P as Y,Q as Z,x,y as $,j as B,r as ee,C as te,G as b,E as ae,f as le,I as z,h as ne,q as D}from"./index.bbdd6a1e.js";function ie(a){let e,l,n,r,s,u;const o=a[13].default,d=W(o,a,a[12],null);return{c(){e=F("div"),d&&d.c(),l=E(),n=F("input"),f(n,"class","hidden-upload hidden"),f(n,"type","file"),f(n,"accept",a[0]),n.multiple=a[3]==="multiple"||void 0,f(n,"webkitdirectory",a[3]==="directory"||void 0),f(n,"mozdirectory",a[3]==="directory"||void 0),f(e,"class","w-full cursor-pointer h-full flex items-center justify-center text-center text-gray-400 md:text-xl max-h-[15rem] xl:max-h-[18rem] 2xl:max-h-[20rem] min-h-[10rem] md:min-h-[15rem]"),f(e,"theme",a[1])},m(i,g){A(i,e,g),d&&d.m(e,null),y(e,l),y(e,n),a[21](n),r=!0,s||(u=[c(n,"change",a[6]),c(e,"drag",_(h(a[14]))),c(e,"dragstart",_(h(a[15]))),c(e,"dragend",_(h(a[16]))),c(e,"dragover",_(h(a[17]))),c(e,"dragenter",_(h(a[18]))),c(e,"dragleave",_(h(a[19]))),c(e,"drop",_(h(a[20]))),c(e,"click",a[5]),c(e,"drop",a[7]),c(e,"dragenter",a[4]),c(e,"dragleave",a[4])],s=!0)},p(i,[g]){d&&d.p&&(!r||g&4096)&&X(d,o,i,i[12],r?Z(o,i[12],g,null):Y(i[12]),null),(!r||g&1)&&f(n,"accept",i[0]),(!r||g&2)&&f(e,"theme",i[1])},i(i){r||(x(d,i),r=!0)},o(i){$(d,i),r=!1},d(i){i&&B(e),d&&d.d(i),a[21](null),s=!1,ee(u)}}}function re(a,e,l){let{$$slots:n={},$$scope:r}=e,{filetype:s=void 0}=e,{theme:u="default"}=e,{single_file:o=!0}=e,{include_file_metadata:d=!0}=e,{dragging:i=!1}=e,{style:g=""}=e,p,C;const L=te(),O=()=>{l(8,i=!i)},S=()=>{p.click()},U=t=>{let m=Array.from(t);if(!(!t.length||!window.FileReader)){var w=[];m.forEach((k,V)=>{let v=new FileReader;v.readAsDataURL(k),v.onloadend=function(){w[V]=d?{name:k.name,size:k.size,data:this.result}:this.result,w.length===t.length&&L("load",o?w[0]:w)}})}},T=t=>{const m=t.target;!m.files||U(m.files)},G=t=>{var m;l(8,i=!1),(m=t.dataTransfer)!=null&&m.files&&U(t.dataTransfer.files)};function I(t){b.call(this,a,t)}function M(t){b.call(this,a,t)}function N(t){b.call(this,a,t)}function P(t){b.call(this,a,t)}function Q(t){b.call(this,a,t)}function H(t){b.call(this,a,t)}function J(t){b.call(this,a,t)}function K(t){ae[t?"unshift":"push"](()=>{p=t,l(2,p)})}return a.$$set=t=>{"filetype"in t&&l(0,s=t.filetype),"theme"in t&&l(1,u=t.theme),"single_file"in t&&l(9,o=t.single_file),"include_file_metadata"in t&&l(10,d=t.include_file_metadata),"dragging"in t&&l(8,i=t.dragging),"style"in t&&l(11,g=t.style),"$$scope"in t&&l(12,r=t.$$scope)},[s,u,p,C,O,S,T,G,i,o,d,g,r,n,I,M,N,P,Q,H,J,K]}class ue extends R{constructor(e){super(),j(this,e,re,ie,q,{filetype:0,theme:1,single_file:9,include_file_metadata:10,dragging:8,style:11})}}function se(a){let e,l,n,r,s;return{c(){e=F("div"),l=F("img"),r=E(),s=le(a[0]),z(l.src,n=a[1])||f(l,"src",n),f(l,"alt",""),f(l,"class","mr-2 h-[12px] w-[12px] opacity-50"),f(e,"class","absolute left-0 top-0 py-1 px-2 rounded-br-lg shadow-sm text-xs text-gray-500 flex items-center pointer-events-none bg-white z-20 border-b border-r border-gray-100")},m(u,o){A(u,e,o),y(e,l),y(e,r),y(e,s)},p(u,[o]){o&2&&!z(l.src,n=u[1])&&f(l,"src",n),o&1&&ne(s,u[0])},i:D,o:D,d(u){u&&B(e)}}}function de(a,e,l){let{label:n=null}=e,{image:r=void 0}=e;return a.$$set=s=>{"label"in s&&l(0,n=s.label),"image"in s&&l(1,r=s.image)},[n,r]}class oe extends R{constructor(e){super(),j(this,e,de,se,q,{label:0,image:1})}}export{oe as B,ue as U};
