1import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{ht as t,n,zt as r}from"./dist-CMd3SAB-.js";import{t as i}from"./jsx-runtime-CFwixLRt.js";import{Kt as a,To as o,Vt as s,gn as c}from"./ui-BtwYdgt-.js";var l=e(r());n();function u(e,t){let n=(e.type||``).toLowerCase();return t===`any`?!0:t===`image`?n.startsWith(`image/`):t===`video`?n.startsWith(`video/`):n.startsWith(`image/`)||n.startsWith(`video/`)}function d(e,t){if(!e)return[];let n=t?.accept??`image`,r=t?.maxCount??20;return Array.from(e).filter(e=>u(e,n)).slice(0,r).map(e=>({uri:URL.createObjectURL(e),mimeType:e.type||(e.name.match(/\.mp4$/i)?`video/mp4`:`image/jpeg`),fileName:e.name,file:e}))}function f(e,t){return e?.files?.length?d(e.files,t):[]}function p(e){return e?e.types?.includes?.(`Files`)?!0:(e.files?.length??0)>0:!1}function m({disabled:e=!1,accept:n=`image`,maxCount:r=1,multiple:i=!1,onDrop:a}){let[o,s]=(0,l.useState)(!1),c=(0,l.useRef)(0),u=(0,l.useCallback)(()=>{c.current=0,s(!1)},[]),d=(0,l.useCallback)(n=>{t.OS!==`web`||e||(n.preventDefault?.(),n.stopPropagation?.(),p(n.dataTransfer??null)&&(c.current+=1,s(!0)))},[e]),m=(0,l.useCallback)(n=>{t.OS!==`web`||e||(n.preventDefault?.(),n.stopPropagation?.(),n.dataTransfer&&(n.dataTransfer.dropEffect=`copy`))},[e]),h=(0,l.useCallback)(n=>{t.OS!==`web`||e||(n.preventDefault?.(),n.stopPropagation?.(),c.current=Math.max(0,c.current-1),c.current===0&&s(!1))},[e]),g=(0,l.useCallback)(o=>{if(t.OS!==`web`||e)return;o.preventDefault?.(),o.stopPropagation?.(),u();let s=i?r:1,c=f(o.dataTransfer??null,{accept:n,maxCount:s});c.length&&a(c)},[n,e,r,i,a,u]);return t.OS===`web`?{isDragging:o,supported:!0,dropHandlers:{onDragEnter:d,onDragOver:m,onDragLeave:h,onDrop:g}}:{isDragging:!1,dropHandlers:{},supported:!1}}n();var h=i();function g({children:e,onDrop:n,disabled:r=!1,accept:i=`image`,maxCount:l=1,multiple:u=!1,label:d,fill:f=!0,minHeight:p,borderRadius:g=12}){let _=a(),{isDragging:v,dropHandlers:y,supported:b}=m({disabled:r,accept:i,maxCount:l,multiple:u,onDrop:n}),x=d??(i===`video`?`Drop video here`:i===`media`?`Drop photos or videos here`:i===`any`?`Drop files here`:`Drop photos here`);return b?(0,h.jsxs)(o,{position:`relative`,width:f?`100%`:void 0,minHeight:p,borderRadius:g,...y,style:t.OS===`web`?{outline:v?`2px dashed ${_.brand}`:void 0,outlineOffset:v?2:void 0,backgroundColor:v?`${String(_.brand)}14`:void 0,transition:`background-color 120ms ease, outline 120ms ease`}:void 0,children:[e,v?(0,h.jsxs)(o,{position:`absolute`,top:0,right:0,bottom:0,left:0,zIndex:20,alignItems:`center`,justifyContent:`center`,gap:8,borderRadius:g,backgroundColor:`rgba(10, 102, 194, 0.12)`,borderWidth:2,borderStyle:`dashed`,borderColor:_.brand,pointerEvents:`none`,children:[(0,h.jsx)(c,{size:28,color:_.brand}),(0,h.jsx)(s,{fontSize:14,fontWeight:`700`,color:_.brand,textAlign:`center`,children:x})]}):null]}):(0,h.jsx)(h.Fragment,{children:e})}function _({progress:e,label:t,compact:n}){let r=a(),i=Math.max(0,Math.min(100,Math.round(e)));return i<=0?null:(0,h.jsxs)(o,{gap:n?4:6,width:`100%`,children:[t?(0,h.jsx)(s,{fontSize:n?11:12,color:r.textMuted,fontWeight:`500`,children:t}):null,(0,h.jsx)(o,{height:n?3:4,borderRadius:999,backgroundColor:r.surfaceMuted,overflow:`hidden`,width:`100%`,children:(0,h.jsx)(o,{height:`100%`,width:`${i}%`,backgroundColor:r.brand,borderRadius:999})}),n?null:(0,h.jsxs)(s,{fontSize:11,color:r.textMuted,children:[i,`%`]})]})}export{g as n,_ as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.