1import{j as e}from"./vendor-react-DA8Lujin.js";import{u as y}from"./index.esm-D6JLymnB.js";import{F as D}from"./index-D-_kbSqC.js";import{c}from"./cn-DyVGX7hK.js";import{u as C}from"./index-TGCGu9AG.js";import{u as L}from"./useDragAndDrop-LyLhVln5.js";try{let r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1276c070-399f-4c39-9dd7-68bbbf09d5eb",r._sentryDebugIdIdentifier="sentry-dbid-1276c070-399f-4c39-9dd7-68bbbf09d5eb")}catch{}function B({label:r,name:t,rows:x,placeholder:p,className:f,compact:l,optional:s,textAreaClassName:n,labelClassName:h,fieldRef:m,...u}){const{error:o,getInputProps:d}=y(t);return e.jsxs("div",{className:c("relative pt-4 mb-4",f),children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex",children:e.jsx("textarea",{placeholder:p||r,"aria-invalid":!!o,"aria-describedby":`${t}-error`,rows:x||4,ref:m,...d({...u,id:t}),className:c("bg-transparent rounded-md text-sm block w-full border-blue focus:ring-blue text-blue",o&&"border-red-600",n)})}),r&&e.jsxs("label",{htmlFor:t,className:c("flex w-full items-center justify-between text-blue pointer-events-none",l?"absolute left-3 top-3 text-xs block peer-placeholder-shown:top-4 peer-placeholder-shown:left-3.5 peer-placeholder-shown:text-sm peer-placeholder-shown:text-gray-400 transition-all peer-focus:-translate-y-1/4 peer-focus:text-gray-700 peer-focus:text-xs peer-focus:left-3":"absolute left-0.5 -top-5 text-sm",h),children:[r,s&&e.jsx("span",{className:"text-xs mx-2 text-grey/80",children:"(optional)"})]}),!!o&&e.jsx("div",{className:"absolute pt-3 top-0 right-0 pr-3 flex pointer-events-none",children:e.jsx(D,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),o&&e.jsx("span",{id:`${t}-error`,className:"text-xs text-red-600",children:o})]})}function H({label:r,labelClassName:t,outsideForm:x,className:p,typeText:f,name:l,...s}){const{inputRef:n,dragOver:h,dropRef:m}=L(),{error:u,getInputProps:o}=x?C(l||""):y(l||"",{validationBehavior:{initial:"onChange"}});return e.jsx(e.Fragment,{children:e.jsxs("div",{ref:m,children:[r&&e.jsx("label",{className:c("block text-xs font-medium text-gray-700 ml-0.5 mb-1",t),children:r}),e.jsxs("button",{type:"button",onClick:()=>{n.current&&(n.current.value="",n.current.click())},className:c("group flex justify-center items-center border-2 border-gray-300 border-dashed rounded-lg",p),children:[e.jsxs("div",{className:"transition space-y-1 group-hover:scale-105 text-center",children:[e.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",stroke:"currentColor",fill:"none",viewBox:"0 0 48 48","aria-hidden":"true",children:e.jsx("path",{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("label",{className:"relative cursor-pointer rounded-md font-medium text-gray-500 hover:text-gray-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-brand-500",children:h?e.jsxs("span",{children:["Drop ",f||"File"]}):e.jsxs("span",{children:["Upload or drop a ",f||"File"]})})]}),e.jsx("input",{ref:n,...o(s),onChange:d=>{var v;const b=d.target.files,g=s.accept;if(!b||!g)return;const N=g.split(",").map(i=>i.trim().toLowerCase()),F=i=>{var w;const j=i.type.toLowerCase(),k="."+((w=i.name.split(".").pop())==null?void 0:w.toLowerCase());return!!i.size&&N.some(a=>a==="*"||j===a||a.endsWith("/*")&&j.startsWith(a.split("/")[0]+"/")||a.startsWith(".")&&k===a)};if(Array.from(b).filter(i=>!F(i)).length>0){alert("Please only upload valid files"),d.target.value="";return}(v=s.onChange)==null||v.call(s,d)},type:"file",className:"hidden"})]}),!!u&&e.jsx("span",{id:`${l}-error`,className:"text-xs text-red-500",children:u})]})})}export{H as D,B as T}; 2//# sourceMappingURL=DragAndDropArea-BZZ3Oq3q.js.map
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.