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