PageSourceSearch

https://cowsoncloud.com/assets/index-Cwpf83LW.js

js cowsoncloud.com collected 2026-10-02 16:11:52 UTC 6,680 bytes, 1 lines download raw bytes

1import{r as a,o as e,av as g,a1 as t,a7 as N,a8 as F,aa as v,a9 as b,au as y,N as k,a3 as w,a4 as f}from"./index-D5LH9V-O.js";import{E as D}from"./index-CVbuN5Vv.js";import{u as z}from"./file-uploader-BxEs43Gh.js";import{X as u,a2 as $,j as C}from"./App-D_6QYQZ-.js";import{D as R}from"./download-cloud-HwoTOFrG.js";import"./tslib.es6-b-w_IMDR.js";const U=()=>{const[r,i]=a.useState([]),{getRootProps:c,getInputProps:o}=z({multiple:!1,onDrop:s=>{i([...r,...s.map(n=>Object.assign(n))])}}),d=s=>s.type.startsWith("image")?e.jsx("img",{className:"rounded",alt:s.name,src:URL.createObjectURL(s),height:"28",width:"28"}):e.jsx($,{size:"28"}),m=s=>{const j=r.filter(p=>p.name!==s.name);i([...j])},h=s=>Math.round(s/100)/10>1e3?`${(Math.round(s/100)/1e4).toFixed(1)} mb`:`${(Math.round(s/100)/10).toFixed(1)} kb`,x=r.map((s,n)=>e.jsxs(g,{className:"d-flex align-items-center justify-content-between",children:[e.jsxs("div",{className:"file-details d-flex align-items-center",children:[e.jsx("div",{className:"file-preview me-1",children:d(s)}),e.jsxs("div",{children:[e.jsx("p",{className:"file-name mb-0",children:s.name}),e.jsx("p",{className:"file-size mb-0",children:h(s.size)})]})]}),e.jsx(t,{color:"danger",outline:!0,size:"sm",className:"btn-icon",onClick:()=>m(s),children:e.jsx(u,{size:14})})]},`${s.name}-${n}`)),l=()=>{i([])};return e.jsxs(N,{children:[e.jsx(F,{children:e.jsx(v,{tag:"h4",children:"Single"})}),e.jsxs(b,{children:[e.jsxs("div",{...c({className:"dropzone"}),children:[e.jsx("input",{...o()}),e.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column",children:[e.jsx(R,{size:64}),e.jsx("h5",{children:"Drop Files here or click to upload"}),e.jsxs("p",{className:"text-secondary",children:["Drop files here or click"," ",e.jsx("a",{href:"/",onClick:s=>s.preventDefault(),children:"browse"})," ","thorough your machine"]})]})]}),r.length?e.jsxs(a.Fragment,{children:[e.jsx(y,{className:"my-2",children:x}),e.jsxs("div",{className:"d-flex justify-content-end",children:[e.jsx(t,{className:"me-1",color:"danger",outline:!0,onClick:l,children:"Remove All"}),e.jsx(t,{color:"primary",children:"Upload Files"})]})]}):null]})]})},L=()=>{const[r,i]=a.useState([]),{getRootProps:c,getInputProps:o}=z({onDrop:s=>{i([...r,...s.map(n=>Object.assign(n))])}}),d=s=>s.type.startsWith("image")?e.jsx("img",{className:"rounded",alt:s.name,src:URL.createObjectURL(s),height:"28",width:"28"}):e.jsx($,{size:"28"}),m=s=>{const j=r.filter(p=>p.name!==s.name);i([...j])},h=s=>Math.round(s/100)/10>1e3?`${(Math.round(s/100)/1e4).toFixed(1)} mb`:`${(Math.round(s/100)/10).toFixed(1)} kb`,x=r.map((s,n)=>e.jsxs(g,{className:"d-flex align-items-center justify-content-between",children:[e.jsxs("div",{className:"file-details d-flex align-items-center",children:[e.jsx("div",{className:"file-preview me-1",children:d(s)}),e.jsxs("div",{children:[e.jsx("p",{className:"file-name mb-0",children:s.name}),e.jsx("p",{className:"file-size mb-0",children:h(s.size)})]})]}),e.jsx(t,{color:"danger",outline:!0,size:"sm",className:"btn-icon",onClick:()=>m(s),children:e.jsx(u,{size:14})})]},`${s.name}-${n}`)),l=()=>{i([])};return e.jsxs(N,{children:[e.jsx(F,{children:e.jsx(v,{tag:"h4",children:"Multiple"})}),e.jsxs(b,{children:[e.jsxs("div",{...c({className:"dropzone"}),children:[e.jsx("input",{...o()}),e.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column",children:[e.jsx(R,{size:64}),e.jsx("h5",{children:"Drop Files here or click to upload"}),e.jsxs("p",{className:"text-secondary",children:["Drop files here or click"," ",e.jsx("a",{href:"/",onClick:s=>s.preventDefault(),children:"browse"})," ","thorough your machine"]})]})]}),r.length?e.jsxs(a.Fragment,{children:[e.jsx(y,{className:"my-2",children:x}),e.jsxs("div",{className:"d-flex justify-content-end",children:[e.jsx(t,{className:"me-1",color:"danger",outline:!0,onClick:l,children:"Remove All"}),e.jsx(t,{color:"primary",children:"Upload Files"})]})]}):null]})]})},M=()=>e.jsxs(a.Fragment,{children:[e.jsxs("div",{className:"toastify-header",children:[e.jsxs("div",{className:"title-wrapper",children:[e.jsx(C,{size:"sm",color:"danger",icon:e.jsx(u,{size:12})}),e.jsx("h6",{className:"toast-title",children:"Error!"})]}),e.jsx("small",{className:"text-muted",children:"a second ago"})]}),e.jsx("div",{className:"toastify-body",children:e.jsx("span",{role:"img","aria-label":"toast-text",children:"👋 You can only upload image Files!."})})]}),P=()=>{const[r,i]=a.useState([]),{getRootProps:c,getInputProps:o}=z({multiple:!1,accept:"image/*",onDrop:(l,s)=>{s.length?k.error(e.jsx(M,{}),{icon:!1,hideProgressBar:!0}):i([...r,...l.map(n=>Object.assign(n))])}}),d=l=>{const n=r.filter(j=>j.name!==l.name);i([...n])},m=l=>Math.round(l/100)/10>1e3?`${(Math.round(l/100)/1e4).toFixed(1)} mb`:`${(Math.round(l/100)/10).toFixed(1)} kb`,h=r.map((l,s)=>e.jsxs(g,{className:"d-flex align-items-center justify-content-between",children:[e.jsxs("div",{className:"file-details d-flex align-items-center",children:[e.jsx("div",{className:"file-preview me-1",children:e.jsx("img",{className:"rounded",alt:l.name,src:URL.createObjectURL(l),height:"28",width:"28"})}),e.jsxs("div",{children:[e.jsx("p",{className:"file-name mb-0",children:l.name}),e.jsx("p",{className:"file-size mb-0",children:m(l.size)})]})]}),e.jsx(t,{color:"danger",outline:!0,size:"sm",className:"btn-icon",onClick:()=>d(l),children:e.jsx(u,{size:14})})]},`${l.name}-${s}`)),x=()=>{i([])};return e.jsxs(N,{children:[e.jsx(F,{children:e.jsx(v,{tag:"h4",children:"Restrictions"})}),e.jsxs(b,{children:[e.jsxs("div",{...c({className:"dropzone"}),children:[e.jsx("input",{...o()}),e.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column",children:[e.jsx(R,{size:64}),e.jsx("h5",{children:"Drop Files here or click to upload"}),e.jsxs("p",{className:"text-secondary",children:["Drop files here or click"," ",e.jsx("a",{href:"/",onClick:l=>l.preventDefault(),children:"browse"})," ","thorough your machine"]})]})]}),r.length?e.jsxs(a.Fragment,{children:[e.jsx(y,{className:"my-2",children:h}),e.jsxs("div",{className:"d-flex justify-content-end",children:[e.jsx(t,{className:"me-1",color:"danger",outline:!0,onClick:x,children:"Remove All"}),e.jsx(t,{color:"primary",children:"Upload Files"})]})]}):null]})]})},B=()=>e.jsxs(a.Fragment,{children:[e.jsx(D,{title:"React Dropzone",link:"https://github.com/react-dropzone/react-dropzone",subTitle:"Simple React hook to create a HTML5-compliant drag'n'drop zone for files."}),e.jsxs(w,{children:[e.jsx(f,{sm:"12",children:e.jsx(L,{})}),e.jsx(f,{sm:"12",children:e.jsx(U,{})}),e.jsx(f,{sm:"12",children:e.jsx(P,{})})]})]});
1export{B as default};

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.