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