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