PageSourceSearch

https://endlss.co/assets/UploadPage-CTvXaEkH.js

js endlss.co collected 2026-10-02 00:17:46 UTC 19,453 bytes, 6 lines download raw bytes

1import{j as e}from"./vendor-query-Djn3zCOG.js";import{r}from"./vendor-i18n-ntbemEJ0.js";import{u as Re,L as De}from"./vendor-react-Bgz2IndK.js";import{c as Be,u as Ve,bZ as We,a2 as ze,l as Ge,bF as Ye,bG as Xe,v as be,bo as qe,b_ as He,L as ge,bi as je,a as p,at as Ke,X as Ze}from"./App-BVJXXxyg.js";import{c as Je}from"./userAuthoredFields-HHSfjoUi.js";import{L as Qe}from"./layers-CxapKFVi.js";import{L as et}from"./lock-BBz-Tmbq.js";import"./index-jZNj51is.js";import"./vendor-motion-Dmd1kv-T.js";/**
2 * @license lucide-react v0.577.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const tt=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],W=Be("image-plus",tt),F={batchStatus:null,uploadError:null,pendingModeration:!1},Ne=[".jpg",".jpeg",".png",".webp",".gif",".heic",".heif"],st=[".mp4",".webm",".mov",".avi",".mkv"],at="image/jpeg,image/png,image/webp,image/gif,image/heic,image/heif,video/mp4,video/webm,video/quicktime,video/x-msvideo,video/x-matroska",nt=10*1024*1024,rt=250,it=[{value:1,label:"Mild",description:"Suggestive content only"}
6,{value:2,label:"Moderate",description:"Partial nudity, moderate themes"},{value:3,label:"Explicit",description:"All NSFW content"}];function ye(i){const l=i.lastIndexOf(".");return l>=0?i.slice(l).toLowerCase():""}function ve(i){return Ne.includes(ye(i))}function V(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(0)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function lt({file:i,previewUrl:l,onRemove:P}){const x=i.type.startsWith("video/");return e.jsxs("div",{className:"group relative aspect-square overflow-hidden rounded-lg bg-surface-3",children:[l?x?e.jsx("video",{src:l,className:"h-full w-full object-cover",muted:!0,playsInline:!0}):e.jsx("img",{src:l,alt:i.name,className:"h-full w-full object-cover"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center text-ink-faint",children:e.jsx(W,{className:"h-5 w-5"})}),e.jsx("button",{type:"button",onClick:P,"aria-label":`Remove ${i.name}`,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded-full bg-black/70 text-white transition-colors hover:bg-red-500/90",children:e.jsx(Ze,{className:"h-3.5 w-3.5"})}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/80 to-transparent px-1.5 py-1 text-[10px] text-white/90",children:i.name})]})}function bt(){var de,me,ue,xe,he;const i=Re(),l=Ve(),{upload:P,isUploading:x,batchStatus:v,pendingModeration:N,uploadError:y,dismiss:I}=We(),{data:c}=ze(!!l.data),ke=((de=c==null?void 0:c.data)==null?void 0:de.isTrusted)??!1,we=((me=c==null?void 0:c.data)==null?void 0:me.canMultiUpload)??!1,{data:f}=Ge(),z=((ue=f==null?void 0:f.data)==null?void 0:ue.multipleUploadsEnabled)??!1,k=((xe=f==null?void 0:f.data)==null?void 0:xe.maxVideoUploadMb)??rt,G=k*1024*1024,[T,w]=r.useState(F);r.useEffect(()=>{!v&&!y&&!N||w(t=>({batchStatus:v??t.batchStatus,uploadError:y??t.uploadError,pendingModeration:N||t.pendingModeration}))},[v,y,N]);const[s,g]=r.useState([]),[Y,X]=r.useState(""),[q,H]=r.useState(""),[K,Z]=r.useState(""),[Se,J]=r.useState(!1),[Me,Q]=r.useState(!1),[b,ee]=r.useState(!1),[S,te]=r.useState(1),[M,se]=r.useState(!1),[ae,O]=r.useState(""),[E,U]=r.useState(""),[A,j]=r.useState(null),[$,ne]=r.useState([]),re=r.useRef(null);r.useEffect(()=>{if(s.length===0){ne([]);return}const t=s.map(a=>a.type.startsWith("image/")||a.type.startsWith("video/")?URL.createObjectURL(a):"");return ne(t),()=>{for(const a of t)a&&URL.revokeObjectURL(a)}},[s]);const d=c==null?void 0:c.data,ie=Ye(d),le=Xe(d),_=be.isNative();r.useEffect(()=>{var a,o,u,pe,fe;if(!_||s.length===0||E.trim().length>0)return;const t=(d==null?void 0:d.displayName)||(d==null?void 0:d.username)||((o=(a=l.data)==null?void 0:a.user)==null?void 0:o.name)||((fe=(pe=(u=l.data)==null?void 0:u.user)==null?void 0:pe.email)==null?void 0:fe.split("@")[0])||"";t&&U(t)},[_,s.length,d,l.data,E]);const oe=r.useCallback(t=>{if(t.length===0)return null;if(t.length>5)return"Maximum 5 files allowed";for(const a of t){const o=ye(a.name);if(![...Ne,...st].includes(o))return`${a.name}: unsupported file type`;const u=ve(a.name)?nt:G;if(a.size>u)return`${a.name} is too large (${V(a.size)}). Max ${ve(a.name)?"10MB":`${k}MB`}`}return null},[G,k]),Ee=t=>{const a=Array.from(t.target.files??[]),o=s.length===0?a:[...s,...a],u=oe(o);j(u),u||g(o),t.target.value=""},Ue=t=>{g(a=>a.filter((o,u)=>u!==t)),j(null)},Ae=()=>{g(t=>t.length>0?[t[0]]:t),j(null)},R=()=>{var t;(t=re.current)==null||t.click()},Ce=t=>{t.preventDefault();const a=Array.from(t.dataTransfer.files),o=oe(a);j(o),o||g(a)},Le=()=>{s.length===0||x||(I(),w(F),P({files:s,title:Y.trim()||void 0,prompt:q.trim()||void 0,description:K.trim()||void 0,userAuthoredFields:Je({title:Se,description:Me}).join(","),nsfw:b||void 0,nsfwLevel:b?S:void 0,aiGenerated:M||void 0,sourceUrl:ae.trim()||void 0,originalAuthor:E.trim()||void 0}))},ce=s.length>1,D=z&&we,B=ce&&!D,Fe=B?z?"notEligible":"flagOff":null,Pe=ce&&D,Ie=(he=s[0])==null?void 0:he.type.startsWith("video/"),n=T.batchStatus??v,C=T.uploadError??y,L=T.pendingModeration||N,h=!!C||!!(n!=null&&n.completedAt)&&n.summary.errors>0,m=!!(n!=null&&n.completedAt)&&!h,Te=n&&n.summary.total>0?Math.round(n.summary.done/n.summary.total*100):0,Oe=x||!!n||!!C,$e=()=>{I(),w(F),i("/my-stuff")},_e=()=>{I(),w(F),g([]),X(""),H(""),Z(""),J(!1),Q(!1),ee(!1),te(1),se(!1),O(""),U(""),j(null)};return Oe?e.jsxs("div",{className:"mx-auto max-w-xl px-4 pt-8 pb-[calc(theme(sp
6acing.8)+var(--bottom-bar-h,0px))]",children:[e.jsx("div",{className:"mb-6",children:e.jsx("h1",{className:"font-display text-2xl font-semibold text-ink",children:m?L?"Submitted for moderation":"Upload complete":h?"Upload failed":"Uploading..."})}),e.jsxs("div",{className:"rounded-xl border border-surface/30 bg-surface-3/40 p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[m?e.jsx(qe,{className:"h-6 w-6 text-accent"}):h?e.jsx(He,{className:"h-6 w-6 text-red-400"}):e.jsx(ge,{className:"h-6 w-6 animate-spin text-accent"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-ink",children:x&&!n?`Sending ${s.length} file${s.length>1?"s":""} to the server...`:n?m?L?"Your upload is awaiting moderation.":"All files processed.":h?"Some files could not be processed.":`Processing ${n.summary.done} of ${n.summary.total}...`:"Preparing upload..."}),n&&!m&&!h&&e.jsx("p",{className:"mt-0.5 text-xs text-ink-faint",children:"Please keep this page open until processing completes."})]})]}),n&&!m&&e.jsx("div",{className:"mb-4 h-2 overflow-hidden rounded-full bg-surface/40",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Te}%`}})}),m&&L&&e.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3",children:[e.jsx(je,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-300"}),e.jsxs("p",{className:"text-xs text-amber-100",children:["A moderator will review your upload shortly. Once approved it will appear in the public feed. You can see it in your"," ",e.jsx(De,{to:"/my-stuff",className:"underline",children:"My Stuff"})," ","in the meantime."]})]}),m&&!L&&e.jsx("p",{className:"mb-4 text-xs text-ink-muted",children:"Your upload is published and live."}),h&&e.jsxs("div",{className:"mb-4 space-y-2",children:[C&&e.jsx("p",{className:"text-xs text-red-300",children:C}),n==null?void 0:n.files.filter(t=>t.status==="error").map(t=>e.jsxs("p",{className:"truncate text-xs text-red-300",title:t.error,children:[t.originalName,": ",t.error??"failed"]},t.originalName))]}),e.jsxs("div",{className:"flex gap-2",children:[m&&e.jsx("button",{onClick:$e,className:"flex-1 rounded-xl bg-accent px-4 py-2.5 font-display text-sm font-medium text-surface transition-opacity hover:opacity-90",children:"Go to My Stuff"}),(m||h)&&e.jsx("button",{onClick:_e,className:"flex-1 rounded-xl border border-surface/40 bg-surface-3/40 px-4 py-2.5 font-display text-sm font-medium text-ink transition-colors hover:bg-surface-3",children:"Upload more"})]})]})]}):e.jsxs("div",{className:"mx-auto max-w-xl px-4 pt-8 pb-[calc(theme(spacing.8)+var(--bottom-bar-h,0px))]",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-ink",children:"Upload something new"}),!be.isNative()&&e.jsx("p",{className:"mt-2 text-sm text-ink-muted",children:"We prefer you upload via our browser extensions because then images and videos can be credited properly. If you can, please use our extensions instead."}),!ke&&e.jsxs("div",{className:"mt-4 flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3",children:[e.jsx(je,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-300"}),e.jsx("p",{className:"text-xs text-amber-100",children:"Your uploads will be reviewed by a moderator before they appear in the public feed."})]})]}),e.jsxs("div",{onDragOver:t=>t.preventDefault(),onDrop:Ce,onClick:s.length<=1?R:void 0,className:p("relative mb-4 flex flex-col overflow-hidden rounded-xl border-2 border-dashed transition-colors",s.length===0?"cursor-pointer items-center justify-center":"",s.length>0?"border-accent/40 bg-accent/5":"border-surface/40 bg-surface-3/50 hover:border-ink-faint/40",A&&"border-red-400/40"),style:{minHeight:s.length>0?"200px":"160px"},children:[s.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-2 py-8",children:[e.jsx(W,{className:"h-8 w-8 text-ink-faint"}),e.jsx("p",{className:"text-sm text-ink-muted",children:"Tap or drop files here"}),e.jsxs("p",{className:"text-xs text-ink-faint",children:["Images up to 10MB, videos up to ",k,"MB",D?" — up to 5 files at once":""]})]}):s.length===1?e.jsxs("div",{className:"relative h-48 w-full cursor-pointer",onClick:R,children:[Ie?e.jsx("video",{src:$[0],className:"h-full w-full object-contain",muted:!0}
6):e.jsx("img",{src:$[0],alt:"",className:"h-full w-full object-contain"}),e.jsx("div",{className:"absolute inset-0 flex items-end justify-center bg-gradient-to-t from-black/50 to-transparent pb-2",children:e.jsxs("p",{className:"text-xs text-white/80",children:[s[0].name," (",V(s[0].size),")"]})})]}):e.jsxs("div",{className:"flex flex-col gap-3 p-3",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:[s.map((t,a)=>e.jsx(lt,{file:t,previewUrl:$[a],onRemove:()=>Ue(a)},`${t.name}-${a}`)),s.length<5&&e.jsxs("button",{type:"button",onClick:R,"aria-label":"Add more files",className:"flex aspect-square flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed border-surface/40 text-ink-faint transition-colors hover:border-accent/40 hover:text-accent",children:[e.jsx(W,{className:"h-5 w-5"}),e.jsx("span",{className:"text-[10px]",children:"Add more"})]})]}),e.jsxs("p",{className:"text-xs text-ink-faint text-center",children:[s.length," file",s.length===1?"":"s"," selected (",V(s.reduce((t,a)=>t+a.size,0)),")"]})]}),e.jsx("input",{ref:re,type:"file",accept:at,multiple:!0,onChange:Ee,className:"hidden"})]}),A&&e.jsx("p",{className:"mb-3 text-xs text-red-400",children:A}),Pe&&e.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-accent/30 bg-accent/10 p-3",children:[e.jsx(Qe,{className:"mt-0.5 h-4 w-4 shrink-0 text-accent"}),e.jsxs("div",{className:"text-xs text-ink",children:[e.jsx("p",{className:"font-medium",children:"Batch mode"}),e.jsxs("p",{className:"mt-0.5 text-ink-muted",children:["The source, author, NSFW level and AI flag below apply to all"," ",s.length," files. Title and prompt apply identically if you fill them in."]})]})]}),B&&e.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3",children:[e.jsx(et,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-300"}),e.jsxs("div",{className:"flex-1 text-xs text-amber-100",children:[e.jsx("p",{className:"font-medium",children:"Multi-file upload not available"}),e.jsx("p",{className:"mt-0.5",children:Fe==="flagOff"?"Multi-file uploads are currently disabled site-wide.":"Multi-file uploads unlock once you have 10 approved contributions."}),e.jsx("button",{type:"button",onClick:Ae,className:"mt-2 rounded-md bg-amber-500/20 px-2.5 py-1 font-medium text-amber-100 transition-colors hover:bg-amber-500/30",children:"Upload just the first file"})]})]}),!_&&e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-muted",children:"Source URL"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",value:ae,onChange:t=>O(t.target.value),placeholder:"Where was this content found?",className:"w-full rounded-lg border border-white/5 bg-[#131316] py-2 pl-3 pr-14 shadow-inner font-body text-sm text-ink placeholder:text-ink-faint focus:border-accent/40 focus:outline-none"}),le&&e.jsx("button",{type:"button",onClick:()=>O(le),title:"Use my profile as the source",className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded-md bg-white/5 px-2 py-1 text-xs font-medium text-ink-muted transition-colors hover:bg-accent/20 hover:text-accent",children:"me"})]})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-muted",children:"Original Author"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",value:E,onChange:t=>U(t.target.value),placeholder:"Original creator, if known",className:"w-full rounded-lg border border-white/5 bg-[#131316] py-2 pl-3 pr-14 shadow-inner font-body text-sm text-ink placeholder:text-ink-faint focus:border-accent/40 focus:outline-none"}),ie&&e.jsx("button",{type:"button",onClick:()=>U(ie),title:"Set myself as the original author",className:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded-md bg-white/5 px-2 py-1 text-xs font-medium text-ink-muted transition-colors hover:bg-accent/20 hover:text-accent",children:"me"})]})]}),e.jsxs("div",{className:"mb-3",children:[e.jsxs("label",{className:"mb-1 block text-xs font-medium text-ink-muted",children:["Title ",e.jsx("span",{className:"text-ink-faint",children:"(optional)"})]}),e.jsx("input",{type:"text",value:Y,onChange:t=>{X(t.target.value),J(!0)},placeholder:"Give it a name",maxLength:200,className:"w-full rounded-lg border border-white/5 bg-[#131316] px-3 py-2 shadow-inner font-body text-sm text-ink placeholder:text-ink-faint focus:border-accent/40 focus:outline-none"})]}),e.jsxs("div",{className:"mb-3",children:[e.jsxs("label",{className:"mb-1 block text-xs font-medium text-ink-muted",children:["Prompt ",e.jsx("span",{className:"text-ink-faint",children:"(optional)"})]}),e.jsx("textarea",{value:q,onChange:t=>H(t.target.value),placeholder:"AI generation prompt, if applicable",maxLength:2e3,rows:2,className:"w-full resize-none rounded-lg border border-white/5 bg-[#131316] px-3 py-2 shadow-inner font-body text-sm text-ink placeholder:text-ink-faint focus:border-accent/40 focus:outline-none"})]}),e.jsxs("div",{className:"mb-3",children:[e.jsxs("label",{className:"mb-1 block text-xs font-medium text-ink-muted",children:["Description ",e.jsx("span",{className:"text-ink-faint",children:"(optional)"})]}),e.jsx("textarea",{value:K,onChange:t=>{Z(t.target.value),Q(!0)},placeholder:"Describe this media",maxLength:2e3,rows:2,className:"w-full resize-none rounded-lg border border-white/5 bg-[#131316] px-3 py-2 shadow-inner font-body text-sm text-ink placeholder:text-ink-faint focus:border-accent/40 focus:outline-none"})]}),e.jsx("div",{className:"mb-3 rounded-xl border border-surface/30 p-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-ink",children:"AI Generated"}),e.jsx("p",{className:"text-xs text-ink-faint",children:"This content was created by AI"})]}),e.jsx("button",{role:"switch","aria-checked":M,onClick:()=>se(t=>!t),className:p("relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full transition-colors duration-200",M?"bg-accent":"bg-surface-3"),children:e.jsx("span",{className:p("pointer-events-none inline-block h-5 w-5 translate-y-0.5 rounded-full bg-white shadow-sm transition-transform duration-200",M?"translate-x-[22px]":"translate-x-0.5")})})]})}),e.jsxs("div",{className:"mb-6 rounded-xl border border-surface/30 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-ink",children:"NSFW"}),e.jsx("p",{className:"text-xs text-ink-faint",children:"Mark as not safe for work"})]}),e.jsx("button",{role:"switch","aria-checked":b,onClick:()=>ee(t=>!t),className:p("relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full transition-colors duration-200",b?"bg-accent":"bg-surface-3"),children:e.jsx("span",{className:p("pointer-events-none inline-block h-5 w-5 translate-y-0.5 rounded-full bg-white shadow-sm transition-transform duration-200",b?"translate-x-[22px]":"translate-x-0.5")})})]}),b&&e.jsx("div",{className:"mt-3 space-y-1.5 border-t border-surface/20 pt-3",children:it.map(t=>e.jsxs("button",{onClick:()=>te(t.value),className:p("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-colors",S===t.value?"bg-accent/15 ring-1 ring-accent/40":"bg-surface-3/50 hover:bg-surface-3"),children:[e.jsx("div",{className:p("flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors",S===t.value?"border-accent bg-accent":"border-ink-faint"),children:S===t.value&&e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-white"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-ink",children:t.label}),e.jsx("p",{className:"text-xs text-ink-faint",children:t.description})]})]},t.value))})]}),e.jsxs("div",{className:"mb-6 rounded-xl border border-surface/30 p-4",children:[e.jsxs("div",{className:"max-h-32 overflow-y-auto text-xs text-ink-faint",children:[e.jsx("p",{className:"mb-2 font-medium text-ink-muted",children:"Terms and Conditions"}),e.jsxs("p",{children:["By uploading content to Endlss, you confirm that you have the right to share this content and that it does not infringe on any third-party rights. You are responsible for all c
6ontent you upload. Uploaded content may be removed if it violates our community guidelines. Your use of this service is subject to our terms of service and privacy policy. If you aren't sure that your content complies with these terms, ",e.jsx("strong",{children:"do not post it."})]})]}),e.jsx("p",{className:"mt-3 text-sm text-ink-muted",children:"By clicking Upload you agree to the Terms and Conditions."})]}),e.jsx("button",{onClick:Le,disabled:s.length===0||x||!!A||B,className:"flex w-full items-center justify-center gap-2 rounded-xl bg-accent px-4 py-3 font-display text-sm font-medium text-surface transition-opacity hover:opacity-90 disabled:opacity-40",children:x?e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"h-4 w-4 animate-spin"}),"Uploading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ke,{className:"h-4 w-4"}),"Upload"," ",s.length>0?`(${s.length} file${s.length>1?"s":""})`:""]})})]})}export{bt as UploadPage};

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.