PageSourceSearch

https://app.lewdly.ai/assets/AP_create-BQWoZo5Q.js

js lewdly.ai collected 2026-10-05 12:21:16 UTC 15,148 bytes, 1 lines download raw bytes

1import{B as e}from"./ui-BIhQ6TkU.js";import{f as V,e as a,k as ue}from"./router-DSedz3Dy.js";import{l as de,s as me,n as he,p as pe,m as ge,aZ as xe,N as O,aJ as L,aL as K,b0 as fe,J as C,aS as be,a8 as we,W as ve,M as ye}from"./index-GdV_XFao.js";import{u as je,A as Se,S as Ne,P as ke,a as _e,b as Ce,c as Le,d as Me}from"./SessionStrip-bcJo5pQo.js";import{a as Ee}from"./useImageGeneration-DQhGkpEt.js";import{G as Pe,R as Ie,P as Ae}from"./ResultActions-CapM37pS.js";import{U as Q}from"./AP_upgrade_modal-D4fqJsWk.js";import{u as Te,c as Ge}from"./useCanUpload-BIFcuzFq.js";import{g as De,a as Oe,N as Re}from"./nsfwRealms-BtbMV-aL.js";import"./charts-CiG4r8Bk.js";import"./lucide-Db6pIQfl.js";import"./usePremiumCatalog-DrtxogCd.js";import"./AP_achievement_pending_counter-CtEq9x3m.js";import"./realmAssets-CWEC99Vq.js";function Je({className:s}){return e.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:s,"aria-hidden":"true",children:[e.jsx("path",{d:"M12 2.5l1.9 4.8 4.8 1.9-4.8 1.9L12 15.9l-1.9-4.8-4.8-1.9 4.8-1.9L12 2.5z"}),e.jsx("path",{d:"M18.5 13.5l.9 2.3 2.3.9-2.3.9-.9 2.3-.9-2.3-2.3-.9 2.3-.9.9-2.3z",opacity:"0.85"}),e.jsx("path",{d:"M5.5 14l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8L3 16.5l1.8-.7.7-1.8z",opacity:"0.7"})]})}const Be={new:"bg-lime-400 text-black",top:"bg-white text-black",pro:"bg-purple-500 text-white"};function Ue({items:s,onPick:o,title:c,subtitle:u}){return e.jsxs("div",{className:"w-full h-full flex flex-col gap-5",children:[(c||u)&&e.jsx("div",{className:"flex items-end justify-between gap-4",children:e.jsxs("div",{children:[c&&e.jsx("h2",{className:"text-2xl md:text-3xl font-semibold text-white",children:c}),u&&e.jsx("p",{className:"text-white/55 text-sm mt-1",children:u})]})}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 md:gap-4",children:s.map(r=>e.jsxs("button",{type:"button",onClick:()=>o(r),"aria-label":`Preset: ${r.label}`,className:"group relative aspect-[4/5] rounded-2xl overflow-hidden bg-white/5 hover:bg-white/10 transition-all hover:scale-[1.02] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime-400/50",children:[r.thumbnail?e.jsx("img",{src:r.thumbnail,alt:"",loading:"lazy",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):r.accent?e.jsxs("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-fuchsia-500 via-purple-600 to-indigo-800",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-transparent to-white/20 mix-blend-overlay"}),e.jsx(Je,{className:"relative h-11 w-11 text-white drop-shadow-[0_2px_8px_rgba(0,0,0,0.35)] transition-transform duration-500 group-hover:scale-110 group-hover:rotate-6"})]}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-white/10 to-white/[0.02]"}),r.badge&&e.jsx("span",{className:`absolute top-2.5 left-2.5 px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wide ${Be[r.badge]}`,children:r.badge}),e.jsxs("div",{className:"absolute inset-x-0 bottom-0 p-3 bg-gradient-to-t from-black via-black/70 to-transparent",children:[e.jsx("p",{className:"text-sm font-semibold text-white text-left leading-tight",children:r.label}),r.description&&e.jsx("p",{className:"text-[11px] text-white/65 text-left mt-1 line-clamp-2",children:r.description})]})]},r.id))})]})}function $e({options:s,selected:o,max:c=3,onToggle:u}){const r=o.length>=c;return e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("button",{type:"button","aria-label":`Extensions ${o.length}/${c}`,className:"flex min-h-10 shrink-0 items-center gap-2 rounded-xl border border-white/10 bg-white/5 px-3 text-xs text-white transition-colors hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime-400/50",children:[e.jsx("span",{className:"text-white/55",children:"Extensions"}),e.jsxs("span",{className:"font-medium text-white",children:[o.length,"/",c]}),e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/45","aria-hidden":"true",children:e.jsx("path",{d:"M6 9 L12 15 L18 9"})})]})}),e.jsxs(he,{align:"start",className:"min-w-[13rem] border border-white/10 bg-[#171717] p-1.5 text-white",children:[e.jsxs(pe,{className:"px-2 py-2 text-xs font-medium text-white/50",children:["Choose up to ",c]}),s.map(i=>{const p=o.includes(i.key);return e.jsx(ge,{checked:p,disabled:!p&&r,onCheckedChange:()=>u(i.key),onSelect:d=>d.preventDefault(),className:"cursor-pointer rounded-lg py-2.5 focus:bg-white/10 focus:text-white",children:i.label},i.key)})]})]})}
1const H=["Aria","Luna","Mia","Sofia","Ivy","Nova","Elena","Zoe","Ruby","Jade","Vera","Lola","Nina","Skye","Cleo","Isla","Maya","Ada","Rae","Vivi"];function Z(){return H[Math.floor(Math.random()*H.length)]}function Fe({imageUrl:s}){const o=V(),c=xe(),[u,r]=a.useState(!1),[i,p]=a.useState(""),[d,m]=a.useState(!1),w=()=>{p(Z()),r(!0)},f=async()=>{if(d)return;const l=i.trim()||Z();m(!0);try{const b=(await O.getGeneratedImages({page_size:1})).results?.[0];if(!b?.id)throw new Error("no recent image");const y=await O.createSoul({name:l,generated_image_id:b.id});c.invalidateQueries({queryKey:["souls"]}),L.success(`${l} is yours now`),o("/souls",{state:{soul:y,mode:"chat"}})}catch{L.error("Could not create her right now. Try again."),m(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:w,className:"mx-auto flex items-center gap-2 rounded-2xl bg-lime-400 px-6 py-3 text-sm font-semibold text-black shadow-lg shadow-lime-400/20 transition-transform hover:scale-[1.03] active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime-400/60",children:[e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3 L14.2 8.6 L20 9.2 L15.6 13.2 L16.8 19 L12 16 L7.2 19 L8.4 13.2 L4 9.2 L9.8 8.6 Z"})}),"Make her a character"]}),u&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:()=>!d&&r(!1),children:e.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/10 p-6 text-center",style:{backgroundColor:"#000000"},onClick:l=>l.stopPropagation(),children:[e.jsx("img",{"data-ph-block":"private-media",src:s,alt:"",className:"mx-auto mb-4 h-32 w-28 rounded-2xl object-cover shadow-lg"}),e.jsx("h3",{className:"mb-1 text-lg font-semibold text-white",children:"Name your character"}),e.jsx("p",{className:"mb-4 text-xs text-white/50",children:"She's yours to keep. Start chatting in a tap."}),e.jsx("input",{value:i,onChange:l=>p(l.target.value),onKeyDown:l=>l.key==="Enter"&&f(),maxLength:40,autoFocus:!0,placeholder:"Her name",className:"mb-4 w-full rounded-full bg-white/5 px-4 py-2.5 text-center text-sm text-white placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-lime-400/50"}),e.jsx("button",{type:"button",onClick:f,disabled:d,className:"w-full rounded-2xl bg-lime-400 px-6 py-3 text-sm font-semibold text-black transition-colors hover:bg-lime-300 disabled:opacity-50",children:d?"Creating…":`Create ${i.trim()||"her"}`}),e.jsx("button",{type:"button",onClick:()=>r(!1),disabled:d,className:"mt-2 w-full rounded-2xl px-6 py-2 text-sm text-white/50 transition-colors hover:text-white/80",children:"Not now"})]})})]})}function We({visible:s=!1}){const{user:o,isAuthenticated:c,subscription:u}=K(),{offer:r,isLoading:i,isActive:p,isDismissed:d,dismiss:m}=fe(),[w,f]=a.useState(!1),l=a.useRef(!1),v=u?.status==="active"||u?.status==="trialing",b=o?.onboarding_variant==="onboarding";return a.useEffect(()=>{if(!(l.current||!s||!c||!o||v)&&sessionStorage.getItem(C)==="1"){if(b){l.current=!0,sessionStorage.removeItem(C);return}if(!i){if(!r||!p||d){l.current=!0,sessionStorage.removeItem(C);return}l.current=!0,sessionStorage.removeItem(C),f(!0),m()}}},[b,m,r,p,c,d,i,v,o,s]),e.jsx(Q,{isOpen:w,onClose:()=>f(!1),trigger:"premium_feature",title:"Your free image is ready",description:"Choose the plan that fits how often you create. Every plan includes uncensored images, video, and unlimited Soul chat.",analyticsSurface:"free_generation"})}const ze=/\b(girl|woman|women|man|men|guy|boy|lady|babe|model|person|people|she|her|hers|him|his|body|face|portrait|selfie|boyfriend|girlfriend|waifu|goddess|milf|teen|blonde|brunette|redhead|nude|naked|topless|lingerie|bikini|character|companion|wife|husband|hair|eyes|lips|skin|breasts|curves|figure|thighs|abs|pose|posing)\b/i;function qe(s){if(s.fromRealm||s.isNsfw)return!0;const o=(s.prompt||"").trim();return o?ze.test(o):!1}const D=[{id:"surprise",label:"Surprise me",prompt:"",accent:!0},...Oe.map(s=>({id:s.id,label:s.name,prompt:s.prompt,thumbnail:s.cover,badge:Re.has(s.id)?"new":void 0}))],He=["1:1","3:4","4:3","9:16","16:9"],Ze={"1:1":"square_hd","3:4":"portrait_4_3","4:3":"landscape_4_3","9:16":"portrait_16_9","16:9":"landscape_16_9"};function ct(){const{state:s,generate:o}=Ee(),{getDefaultModelForModality:c,getModelBySlug:u}=be(),r=je(),[i]=ue(),p=V(),[d,m]=a.useState(""),[w,f]=a.useState("1:1"),[l,v]=a.useState(1),[b,y]=a.useState(!1),[Y,R]=a.use
1State(!1),J=Te(),B=Ge(),{creditBalance:U}=K(),X=a.useMemo(()=>c("text_to_image"),[c]),M=u("lewdly-fast"),E=u("lewdly-classic")??u("apatero-18-pro")??u("lewdly-18-pro"),P=a.useMemo(()=>[M?{model:M,label:"Pro V2",badge:"Best quality"}:null,E?{model:E,label:"Classic"}:null].filter(Boolean),[M,E]),[$,ee]=a.useState("lewdly-fast"),h=$&&u($)||X,I=h?.input_schema?.optional?.extensions,N=a.useMemo(()=>(I?.options??[]).map(t=>({key:t.key,label:t.label})),[I]),F=I?.maxItems??3,[A,W]=a.useState([]),k=!!h?.supports_user_lora,[j,z]=a.useState([]),[te,se]=a.useState(()=>i.get("lora"));a.useEffect(()=>{if(!k)return;let t=!1;return O.listUserLoras().then(n=>{t||z(n.filter(g=>g.status==="ready"))}).catch(()=>{t||z([])}),()=>{t=!0}},[k]);const S=k?j.find(t=>t.id===te)??null:null,re=t=>{W(n=>n.includes(t)?n.filter(g=>g!==t):n.length>=F?n:[...n,t])};a.useEffect(()=>{W([])},[h?.slug]),a.useEffect(()=>{const t=i.get("preset");if(!t)return;const n=De(t);if(n){m(n.prompt);return}const g=D.find(G=>G.id===t);if(g){m(g.prompt);return}m(`Inspired by ${t}: `)},[i]),a.useEffect(()=>{const t=i.get("prompt");t&&m(t)},[i]),a.useEffect(()=>{const t=s.currentJob;if(!t||t.status!=="COMPLETED")return;const n=t.image_url??t.video_url??"";n&&r.add({id:String(t.id),kind:t.video_url?"video":"image",thumbnail:n,prompt:t.prompt??""})},[s.currentJob?.id,s.currentJob?.status]);const q=async()=>{if(!d.trim()||!h)return;const t={model:h.slug,prompt:d,image_size:Ze[w],num_images:l,...N.length>0&&A.length>0?{extensions:A}:{},...S?{user_lora:S.id}:{}};try{S&&ye.track("generation_with_user_lora",{lora_id:S.id,model:h.slug}),await o(t)}catch{L.error("Generation failed. Try again.")}},ae=[...k?[{key:"character",label:"Character",value:S?.name??(j.length===0?"Train one":"None"),options:j.length===0?[{value:"Train one"}]:[{value:"None"},...j.map(t=>({value:t.name}))],onSelect:t=>{if(t==="Train one"){p("/train");return}const n=j.find(g=>g.name===t);se(n?n.id:null)}}]:[],{key:"aspect",label:"Aspect",value:w,options:He.map(t=>({value:t})),onSelect:t=>f(t)},{key:"count",label:"Count",value:String(l),options:[1,2,4].map(t=>({value:String(t)})),onSelect:t=>v(Number(t))}],ne=t=>{if(t.id==="surprise"){const n=D.filter(G=>G.id!=="surprise"),g=n[Math.floor(Math.random()*n.length)];m(g.prompt)}else m(t.prompt)},_=r.focused,x=_?.kind==="image"?_.thumbnail:s.currentJob?.status==="COMPLETED"&&s.currentJob.image_url?s.currentJob.image_url:void 0,oe=(_?.kind==="image"?_.prompt:s.currentJob?.prompt)||d,ie=!B&&!!x&&qe({prompt:oe}),le=s.isGenerating?{status:"generating",progress:s.progress,modelName:h?.name}:s.error?{status:"error",message:s.error}:x?{status:"success",imageUrl:x}:{status:"idle"},T=h?h.credit_cost*l:null,ce=T==null||U==null||U.current_credits>=T;return e.jsxs("div",{className:"h-full w-full flex flex-col gap-3 md:gap-4 px-4 md:px-6 lg:px-8 py-4 md:py-6",children:[e.jsx(Se,{active:"create"}),e.jsx(Pe,{state:le,idleSlot:e.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-4 text-center",children:[e.jsx("h2",{className:"text-2xl md:text-3xl font-semibold text-white",children:"What do you want to create?"}),e.jsx("p",{className:"text-white/55 text-sm max-w-md",children:"Type a prompt below, or pick a starting style to fill it for you."}),e.jsxs("button",{type:"button",onClick:()=>y(!0),className:"mt-2 px-5 py-2.5 rounded-full bg-white/5 hover:bg-white/10 text-white text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime-400/50 flex items-center gap-2",children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"8",height:"8",rx:"1"}),e.jsx("rect",{x:"13",y:"3",width:"8",height:"8",rx:"1"}),e.jsx("rect",{x:"3",y:"13",width:"8",height:"8",rx:"1"}),e.jsx("rect",{x:"13",y:"13",width:"8",height:"8",rx:"1"})]}),"Browse styles"]})]}),actionsSlot:x?e.jsx(Ie,{kind:"image",imageUrl:x,onDownload:()=>we(x,`${ve.slug}-create`),onRegenerate:q,onShare:()=>L("Share coming soon")}):void 0}),ie&&x&&e.jsx("div",{className:"flex justify-center",children:e.jsx(Fe,{imageUrl:x})}),e.jsx(We,{visible:!B&&s.currentJob?.status==="COMPLETED"&&!!s.currentJob.image_url}),e.jsx(Ne,{items:r.items,focusedId:r.focused?.id??null,onFocus:r.focus}),e.jsx(Ae,{prompt:d,onPromptChange:m,leadingControls:P.length>1||N.length>0?e.jsxs("div",{className:"contents",children:[P.length>1&&e.jsx("div",{className:"inline-flex shrink-0 gap-1 rounded-xl border border-white/10 bg-white/5 p-1",children:P.map(t=>{const n=h?.slug===t.model.slug;return e.jsxs("button",{type:"button","aria-label":t.label,onClick:()=>ee(t.model.slug),className:`inline-flex min-h-8 items-center gap-1.5 rounded-lg px-3 text-xs font-medium transition-colors ${n?"bg-lime-400 text-black":"text-white/60 hover:text-white"}`,children:[t.label,t.badge&&e.jsx("span",{className:`rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${n?"bg-black/15 text-black/75":"bg-lime-400/15 text-lime-300"}`,children:t.badge})]},t.model.slug)})}),N.length>0&&e.jsx($e,{options:N,selected:A,max:F,onToggle:re})]}):void 0,paramsStrip:e.jsx(ke,{pills:ae}),submitLabel:"Create",onSubmit:q,isSubmitting:s.isGenerating,canSubmit:d.trim().length>0&&!!h&&ce,placeholder:J?"Describe what you want to create...":"Subscribe to start creating...",creditCost:T,gateInteraction:J?void 0:()=>R(!0)}),e.jsx(Q,{isOpen:Y,onClose:()=>R(!1),trigger:"premium_feature"}),e.jsx(_e,{open:b,onOpenChange:y,children:e.jsxs(Ce,{side:"right",className:"w-full sm:max-w-2xl bg-[#0a0a0a] border-l border-white/10 overflow-y-auto",children:[e.jsx(Le,{children:e.jsx(Me,{className:"text-white",children:"Browse styles"})}),e.jsx("div",{className:"mt-6",children:e.jsx(Ue,{items:D,onPick:t=>{ne(t),y(!1)}})})]})})]})}export{ct 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.