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