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