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