PageSourceSearch

https://undress.zone/_next/static/chunks/81326.260de6a2a30f24cb.js

js undress.zone collected 2026-10-06 07:36:26 UTC 83,763 bytes, 2 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0baf993b-1b1a-4188-99ad-13715d532a92",e._sentryDebugIdIdentifier="sentry-dbid-0baf993b-1b1a-4188-99ad-13715d532a92")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[81326],{33217:(e,t,a)=>{a.d(t,{a:()=>s});var i=a(12115),l=a(37489);let s=()=>{let[e,t]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=()=>{t((0,l.O7)())};return e(),window.addEventListener("popstate",e),window.addEventListener("focus",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("focus",e)}},[]),e}},76009:(e,t,a)=>{a.d(t,{Ey:()=>i,Gh:()=>d,Hl:()=>f,I$:()=>l,Rg:()=>m,cx:()=>x,ep:()=>u,j:()=>h,kz:()=>c,nB:()=>n,uX:()=>p,ug:()=>g});let i="false"!==a(41463).env.NEXT_PUBLIC_MOBILE_PERF_V2,l={mobileBreakpointPx:640,tabletBreakpointPx:1024,heroObserverThreshold:.6,heroAttachTimeoutMs:3200,heroAttachIdleMs:1200,preview:{defaultTier:"240w",mobileAutoLoadCount:1,sizes:"(max-width: 640px) 48vw, (max-width: 1024px) 33vw, 240px"},autoplay:{unlockEvents:["pointerdown","touchstart","keydown","wheel","scroll"]},imageQualityPolicy:{avifQuality:24,webpQuality:38,lcpWebpQuality:45}},s=new Set(["slow-2g","2g","3g"]),r=null,o=e=>{let[t,a=""]=e.split("?");return{pathname:t,query:a?`?${a}`:""}},n=(e,t,a="mp4")=>{let{pathname:i,query:l}=o(e),s=i.replace(/-(low|p240|p360|p480)\.(mp4|webm)$/i,".mp4").replace(/\.(mp4|webm)$/i,"");return`${s}-${t}.${a}${l}`},d=e=>{let{pathname:t,query:a}=o(e);return`${t.replace(/\.mp4$/i,".webm")}${a}`},u=()=>!("u"<typeof document)&&(null!==r?r:r=!!document.createElement("video").canPlayType('video/webm; codecs="vp9"')),c=()=>{let{saveData:e,effectiveType:t}=(()=>
1{if("u"<typeof navigator)return{saveData:!1,effectiveType:"unknown"};let e=navigator;return{saveData:!!e.connection?.saveData,effectiveType:e.connection?.effectiveType??"unknown"}})(),a=(()=>{if("u"<typeof navigator)return!1;let e=/Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent),t=window.matchMedia("(max-width: 1024px)").matches,a=window.matchMedia("(pointer: coarse)").matches;return e||t||a})(),i=s.has(t);return{isMobile:a,saveData:e,effectiveType:t,shouldForceLow:a||e||i,allowHeroUpgrade:a&&!e&&!i,devicePixelRatio:window.devicePixelRatio||1}},m=(e,t)=>e.saveData||s.has(e.effectiveType)?"p240":e.isMobile?t?.forFeed?"4g"===e.effectiveType&&e.devicePixelRatio>=2&&!e.saveData?"p360":"p240":e.devicePixelRatio>=2&&"4g"===e.effectiveType?"p480":"p360":"p480",h=e=>e.saveData||s.has(e.effectiveType)?"160w":e.isMobile?"4g"===e.effectiveType&&e.devicePixelRatio>=2?"320w":"240w":"320w",p=e=>{let{id:t,srcWebp:a,tier:i,w:l=320,h:s=320,lqip:r,srcAvif:o=null}=e;return{id:t,w:l,h:s,srcAvif:o,srcWebp:a,lqip:r??a,tier:i}},g=(e=!1)=>({priority:e,fetchPriority:e?"high":"low",loading:e?"eager":"lazy",decoding:"async"}),x=(e,t=2e3)=>{let a=!1,i=window;if("function"==typeof i.requestIdleCallback){let l=i.requestIdleCallback(()=>{a||e()},{timeout:t});return()=>{a=!0,"function"==typeof i.cancelIdleCallback&&i.cancelIdleCallback(l)}}let l=window.setTimeout(()=>{a||e()},t);return()=>{a=!0,window.clearTimeout(l)}},f=(e,t=5e3)=>{let a=!1,i=[],l=()=>{a||(a=!0,e(),i.forEach(e=>e()))};["pointerdown","touchstart","keydown","wheel","scroll"].forEach(e=>{let t=()=>l();window.addEventListener(e,t,{once:!0,passive:!0}),i.push(()=>window.removeEventListener(e,t))});let s=x(l,t),r=window.setTimeout(l,t);return()=>{a=!0,s(),window.clearTimeout(r),i.forEach(e=>e())}}},81326:(e,t,a)=>{a.r(t),a.d(t,{FormTemplate:()=>tc,MODE_SETTINGS_MAP:()=>tu});var i=a(95155),l=a(83241),s=a(12115),r=a(99003),o=a(78340);let n=(0,o.A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var d=a(94514),u=a(66088),c=a(94432),m=a(1997),h=a(40980);function p(e){let t=e.includes("?")?"&":"?";return e+t+"v=20260820-model-fix"}function g({open:e,selectedId:t,catalog:a,loading:l,error:r,onClose:o,onRetry:u,onSelect:x}){let{checkIsAllowed:f,openNotAllowedModal:b}=(0,m.G)(),[v,w]=(0,s.useState)("all"),y=(0,s.useMemo)(()=>[{id:"all",label:"All"},...new Map((a?.categories??[]).filter(e=>"all"!==e.id).map(e=>[e.id,e])).values()],[a]),N=(0,s.useMemo)(()=>[...new Map((a?.presets??[]).filter(e=>"all"===v||e.category===v).map(e=>[e.id,e])).values()],[a,v]);return(0,i.jsx)(c.lG,{open:e,onOpenChange:e=>!e&&o(),children:(0,i.jsxs)(c.Cf,{hasVisibleTitle:!0,title:"Select Pose",className:(0,h.cn)("top-[max(0.5rem,env(safe-area-inset-top))] translate-y-0 md:top-[50%] md:translate-y-[-50%]","flex max-h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] max-w-none flex-col gap-0 overflow-hidden rounded-2xl md:max-h-[90vh] md:w-[min(1200px,calc(100vw-1rem))]","border-[#1e2228] bg-[#131518] p-0"),children:[(0,i.jsxs)("div",{className:"shrink-0 px-4 pb-3 pt-4 md:px-6 md:pb-4 md:pt-6",children:[(0,i.jsx)(c.L3,{className:"text-base font-semibold text-white md:text-lg",children:"Select preset"}),(0,i.jsx)("div",{className:"mt-4 flex gap-2 overflow-x-auto pr-12 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",role:"tablist","aria-label":"Preset category",children:y.map(e=>(0,i.jsx)("button",{type:"button",role:"tab","aria-selected":v===e.id,onClick:()=>w(e.id),className:(0,h.cn)("shrink-0 rounded-full px-3.5 py-1.5 text-xs font-semibold transition-colors md:text-sm",v===e.id?"bg-pM text-black":"bg-white/[0.07] text-white/70 hover:bg-white/10 hover:text-white"),children:e.label},e.id))})]}),(0,i.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-4 [scrollbar-color:rgb(255_255_255/0.1)_transparent] md:px-5 md:pb-6",children:l?(0,i.jsx)("div",{className:"grid grid-cols-3 gap-2 md:grid-cols-4 lg:grid-cols-5",children:Array.from({length:15}).map((e,t)=>(0,i.jsx)("div",{className:"aspect-[2/3] animate-pulse rounded-xl bg-white/[0.07]"},t))}):r?(0,i.jsxs)("div",{className:"flex min-h-56 flex-col items-center justify-center gap-3 text-center",children:[(0,i.jsx)("p",{className:"text-sm text-white/50",children:r}),(0,i.jsx)("button",{type:"button",onClick:u,className:"text-sm font-semibold text-pM underline",children:"Try again"})]}):0===N.length?(0,i.jsx)("div",{className:"flex min-h-56 items-center justify-center text-sm text-white/50",children:"No presets in this category."}):(0,i.jsx)("div",{className:"grid grid-cols-3 gap-2 md:grid-cols-4 lg:grid-cols-5",children:N.map(e=>{let a=e.id===t,l=!e.available||!f(e.accessWeight??0);return(0,i.jsx)("button",{type:"button",onClick:()=>{l?b(e.accessWeight??3,"This preset"):x(e)},className:(0,h.cn)("group relative cursor-pointer overflow-hidden rounded-xl text-left transition-all duration-200 ring-inset",a?"ring-2 ring-pM shadow-[0_0_20px_-4px] shadow-pM/30":"ring-1 ring-white/[0.06] hover:ring-white/20"),children:(0,i.jsxs)("div",{className:"relative aspect-[2/3] w-full bg-[#0a0b0d]",children:[(0,i.jsx)("img",{src:p(e.previewUrl),alt:e.label,loading:"lazy",decoding:"async",fetchPriority:a?"high":"low",className:"absolute inset-0 h-full w-full object-cover"}),(0,i.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent px-2 pb-2 pt-8",children:(0,i.jsx)("p",{className:"truncate text-[12px] font-semibold leading-tight text-white md:text-[13px]",children:e.label})}),l&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",children:(0,i.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-white/[0.08]",children:(0,i.jsx)(n,{className:"h-4 w-4 text-pM"})})}),a&&(0,i.jsx)("span",{className:"absolute right-2 top-2 flex h-5 w-5 items-center justify-center rounded-full bg-pM shadow-lg shadow-pM/30",children:(0,i.jsx)(d.A,{className:"h-3 w-3 stroke-[3.5] text-black"})})]})},e.id)})})})]})})}function x({fieldName:e,modeCode:t,label:a="Type",placeholder:l,loadError:o}){let{register:n,setValue:d}=(0,r.xW)(),c=(0,r.FH)({name:e}
1),[m,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(null),[v,w]=(0,s.useState)(!1),[y,N]=(0,s.useState)(""),S=(0,s.useCallback)(()=>{w(!0),N(""),fetch(`${String("https://api.undress.zone").replace(/\/$/,"")}/generation/modes/${t}/presets`,{credentials:"include"}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(b).catch(()=>N(o)).finally(()=>w(!1))},[o,t]);(0,s.useEffect)(()=>{!m||f||v||S()},[f,S,v,m]);let E=f?.presets.find(e=>e.id===c);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("input",{type:"hidden",...n(e)}),(0,i.jsxs)("div",{className:"flex w-full flex-col items-start gap-2",children:[(0,i.jsx)("span",{className:"text-st ml-4",children:a}),(0,i.jsxs)("button",{type:"button",onClick:()=>p(!0),className:"flex h-[45px] w-full cursor-pointer items-center justify-between rounded-[100px] bg-g4 px-4 py-2 text-sm font-medium leading-5 text-white",children:[(0,i.jsx)("span",{className:(0,h.cn)("min-w-0 flex-1 truncate text-left",!E&&"text-white/50"),children:E?.label??l}),(0,i.jsx)(u.A,{className:"h-4 w-4 shrink-0 opacity-50"})]})]}),(0,i.jsx)(g,{open:m,selectedId:c,catalog:f,loading:v,error:y,onClose:()=>p(!1),onRetry:S,onSelect:t=>{d(e,t.id,{shouldDirty:!0,shouldValidate:!0}),p(!1)}})]})}function f({label:e="Type",placeholder:t="Select pose"}={}){return(0,i.jsx)(x,{fieldName:"posePresetId",modeCode:"img12",label:e,placeholder:t,loadError:"Could not load pose presets. Please try again."})}let b=[{mode:"poseImage",modeCode:"img12",fieldName:"posePresetId",sectionLabel:"Poses"},{mode:"extremeImage",modeCode:"img15",fieldName:"extremePresetId",sectionLabel:"More poses"}],v=e=>"extreme"===e.trim().toLowerCase()?"More":e;function w(){let{register:e,setValue:t}=(0,r.xW)(),a=(0,r.FH)({name:"mode"}),l=(0,r.FH)({name:"posePresetId"}),o=(0,r.FH)({name:"extremePresetId"}),{checkIsAllowed:g,openNotAllowedModal:x}=(0,m.G)(),[f,w]=(0,s.useState)(!1),[y,N]=(0,s.useState)("all"),[S,E]=(0,s.useState)({}),[j,_]=(0,s.useState)(!1),[k,M]=(0,s.useState)(""),I=(0,s.useCallback)(()=>{_(!0),M(""),Promise.all(b.map(async e=>{let t,a=await fetch((t=e.modeCode,`${String("https://api.undress.zone").replace(/\/$/,"")}/generation/modes/${t}/presets`),{credentials:"include"});if(!a.ok)throw Error(`HTTP ${a.status}`);return[e.modeCode,await a.json()]})).then(e=>E(Object.fromEntries(e))).catch(()=>M("Could not load poses. Please try again.")).finally(()=>_(!1))},[]);(0,s.useEffect)(()=>{f&&0===Object.keys(S).length&&!j&&I()},[S,I,j,f]);let T=(0,s.useMemo)(()=>b.map(e=>({...e,presets:(S[e.modeCode]?.presets??[]).map(t=>({...t,...e}))})),[S]),D=(0,s.useMemo)(()=>{let e=new Map;for(let t of b)for(let a of S[t.modeCode]?.categories??[])"all"!==a.id&&e.set(a.id,{id:a.id,label:v(a.label)});return[{id:"all",label:"All"},...e.values()]},[S]),C="extremeImage"===a?o:l,P=T.flatMap(e=>e.presets).find(e=>e.mode===a&&e.id===C);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("input",{type:"hidden",...e("posePresetId")}),(0,i.jsx)("input",{type:"hidden",...e("extremePresetId")}),(0,i.jsxs)("div",{className:"flex w-full flex-col items-start gap-2",children:[(0,i.jsx)("span",{className:"text-st ml-4",children:"Type"}),(0,i.jsxs)("button",{type:"button",onClick:()=>w(!0),className:"flex h-[45px] w-full cursor-pointer items-center justify-between rounded-[100px] bg-g4 px-4 py-2 text-sm font-medium leading-5 text-white",children:[(0,i.jsx)("span",{className:(0,h.cn)("min-w-0 flex-1 truncate text-left",!P&&"text-white/50"),children:P?.label??"Select pose"}),(0,i.jsx)(u.A,{className:"h-4 w-4 shrink-0 opacity-50"})]})]}),(0,i.jsx)(c.lG,{open:f,onOpenChange:e=>!e&&w(!1),children:(0,i.jsxs)(c.Cf,{hasVisibleTitle:!0,title:"Select Pose",className:(0,h.cn)("top-[max(0.5rem,env(safe-area-inset-top))] translate-y-0 md:top-[50%] md:translate-y-[-50%]","flex max-h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] max-w-none flex-col gap-0 overflow-hidden rounded-2xl md:max-h-[90vh] md:w-[min(1200px,calc(100vw-1rem))]","border-[#1e2228] bg-[#131518] p-0"),children:[(0,i.jsxs)("div",{className:"shrink-0 px-4 pb-3 pt-4 md:px-6 md:pb-4 md:pt-6",children:[(0,i.jsx)(c.L3,{className:"text-base font-semibold text-white md:text-lg",children:"Select pose"}),(0,i.jsx)("div",{className:"mt-4 flex gap-2 overflow-x-auto pr-12 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",role:"tablist","aria-label":"Pose category",children:D.map(e=>(0,i.jsx)("button",{type:"button",role:"tab","aria-selected":y===e.id,onClick:()=>N(e.id),className:(0,h.cn)("shrink-0 rounded-full px-3.5 py-1.5 text-xs font-semibold transition-colors md:text-sm",y===e.id?"bg-pM text-black":"bg-white/[0.07] text-white/70 hover:bg-white/10 hover:text-white"),children:e.label},e.id))})]}),(0,i.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-4 [scrollbar-color:rgb(255_255_255/0.1)_transparent] md:px-5 md:pb-6",children:j?(0,i.jsx)("div",{className:"grid grid-cols-3 gap-2 md:grid-cols-4 lg:grid-cols-5",children:Array.from({length:15}).map((e,t)=>(0,i.jsx)("div",{className:"aspect-[2/3] animate-pulse rounded-xl bg-white/[0.07]"},t))}):k?(0,i.jsxs)("div",{className:"flex min-h-56 flex-col items-center justify-center gap-3 text-center",children:[(0,i.jsx)("p",{className:"text-sm text-white/50",children:k}),(0,i.jsx)("button",{type:"button",onClick:I,className:"text-sm font-semibold text-pM underline",children:"Try again"})]}):(0,i.jsx)("div",{className:"flex flex-col gap-8",children:T.map(e=>{let l=e.presets.filter(e=>"all"===y||e.category===y);return 0===l.length?null:(0,i.jsxs)("section",{children:[(0,i.jsx)("h3",{className:"mb-3 text-sm font-semibold text-white/70 md:text-base",children:e.sectionLabel}),(0,i.jsx)("div",{className:"grid grid-cols-3 gap-2 md:grid-cols-4 lg:grid-cols-5",children:l.map(e=>{let l=e.mode===a&&e.id===C,s=!e.available||!g(e.accessWeight??3);return(0,i.jsx)("button",{type:"button",onClick:()=>{s?x(e.accessWeight??3,"This pose"):(t("mode",e.mode,{shouldDirty:!0,shouldValidate:!0}),t(e.fieldName,e.id,{shouldDirty:!0,shouldValidate:!0}),t("posePresetId"===e.fieldName?"extremePresetId":"posePresetId","",{shouldDirty:!0,shouldValidate:!1}),w(!1))},className:(0,h.cn)("group relative cursor-pointer overflow-hidden rounded-xl text-left transition-all duration-200 ring-inset",l?"ring-2 ring-pM shadow-[0_0_20px_-4px] shadow-pM/30":"ring-1 ring-white/[0.06] hover:ring-white/20"),children:(0,i.jsxs)("div",{className:"relative aspect-[2/3] w-full bg-[#0a0b0d]",children:[(0,i.jsx)("img",{src:p(e.previewUrl),alt:e.label,loading:"lazy",decoding:"async",fetchPriority:l?"high":"low",className:"absolute inset-0 h-full w-full object-cover"}),(0,i.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent px-2 pb-2 pt-8",children:(0,i.jsx)("p",{className:"truncate text-[12px] font-semibold leading-tight text-white md:text-[13px]",children:e.label})}),s?(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",children:(0,i.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-white/[0.08]",children:(0,i.jsx)(n,{className:"h-4 w-4 text-pM"})})}):null,l?(0,i.jsx)("span",{className:"absolute right-2 top-2 flex h-5 w-5 items-center justify-center rounded-full bg-pM shadow-lg shadow-pM/30",children:(0,i.jsx)(d.A,{className:"h-3 w-3 stroke-[3.5] text-black"})}):null]})},`${e.modeCode}:${e.id}`)})})]},e.modeCode)})})})]})})]})}
1let y="flex min-h-0 w-full flex-col gap-6 md:min-h-[260px]";function N({label:e,value:t,onClick:a,disabled:l=!1}){return(0,i.jsxs)("div",{className:`flex w-full flex-col items-start gap-2 ${l?"opacity-50":""}`,children:[(0,i.jsx)(c.JU,{className:"ml-4 text-st",children:e}),(0,i.jsxs)("button",{type:"button",disabled:l,onClick:a,className:"flex h-[45px] w-full cursor-pointer items-center justify-between gap-2 rounded-[100px] bg-g4 px-4 py-2 text-sm font-medium leading-5 text-white ring-offset-background focus:outline-none focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:t}),(0,i.jsx)(u.A,{className:"h-4 w-4 shrink-0 opacity-50"})]})]})}function S({name:e,placeholder:t,disabled:a=!1,maxLength:l=500,rules:s,label:o="Prompt"}){let{clearErrors:n}=(0,r.xW)(),{field:d,fieldState:{error:u}}=(0,r.as)({name:e,defaultValue:"",rules:s}),m=String(d.value??"");return(0,i.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,i.jsx)(c.JU,{htmlFor:`${e}-textarea`,className:"ml-4 text-st",children:o}),(0,i.jsx)(c.TM,{id:`${e}-textarea`,name:d.name,ref:d.ref,value:m,onBlur:d.onBlur,onChange:t=>{u&&n(e),d.onChange(t.target.value.slice(0,l))},disabled:a,maxLength:l,rows:4,placeholder:t,"aria-invalid":!!u||void 0,className:u?"h-[108px] resize-none border-red-500 ring-1 ring-red-500 focus-visible:ring-red-500":"h-[108px] resize-none"}),(0,i.jsxs)("div",{className:"flex min-h-4 items-start justify-between px-4 text-xs",children:[(0,i.jsx)("span",{className:"text-red-400",role:u?"alert":void 0,children:u?.message?String(u.message):""}),(0,i.jsxs)("span",{className:"ml-auto text-white/40",children:[m.length,"/",l]})]})]})}var E=a(17998);let j=[8,13,20,25],_=[2,3,4],k={enabled:!1,engines:{cinematic:{durations:[3,4,5,6,7,8],qualities:["normal","hd"]},turbo:{durations:[3],qualities:["normal","hd"]},long:{durations:[...j],qualities:["normal"]}}},M=(e,t)=>e.engines?.[t],I=e=>{let t=M(e,"long")?.durations??[];return j.filter(e=>t.includes(e))},T=(e,t)=>{let a=I(e),i=a.length?a:[...j],l=Number(t);return i.includes(l)?l:i[0]},D=(e,t,a)=>{let i=e.engines[t].durations,l=Number(a);return i.includes(l)?l:i[0]??3},C=(e,t)=>{if(!t.enabled)return"Custom video is temporarily unavailable.";if(!e.imageUrl.trim())return"Choose an image first.";if("long"===e.engine){if(!e.presetId?.trim())return"Choose a starting pose."}else if(!e.prompt?.trim())return"Describe the scene you want to direct.";let a=t.engines[e.engine];return a?a.durations.includes(e.duration)?a.qualities.includes(e.qualityTier)?null:"Choose a supported quality.":"Choose a duration supported by this engine.":"Choose a supported video engine."},P=({capabilities:e,engine:t="cinematic"})=>{let{setValue:a,watch:l}=(0,r.xW)(),o="long"===t,n=o?T(e,l("videoDirectorDuration")):D(e,t,l("videoDirectorDuration")),d=M(e,t)??k.engines[t];(0,s.useEffect)(()=>{a("videoDirectorEngine",t,{shouldDirty:!1}),a("videoDirectorDuration",String(n),{shouldDirty:!1}),o&&a("videoDirectorQuality","normal",{shouldDirty:!1})},[n,t,o,a]);let u=(o?I(e):d.durations).map(e=>({value:String(e),label:`${e} seconds`,weight:o?0:e>=8?4:2*(e>=6)})),c=o?[]:d.qualities.map(e=>({value:e,label:"hd"===e?"HD \xb7 more detail":"Normal \xb7 faster",weight:4*("hd"===e)}));return(0,i.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"video-director-controls",children:[!e.enabled&&(0,i.jsx)("p",{className:"rounded-xl border border-amber-400/30 bg-amber-400/10 p-3 text-sm text-amber-200",children:o?"Long video is temporarily unavailable.":"Custom video is temporarily unavailable."}),(0,i.jsx)(E.Yq,{name:"videoDirectorDuration",items:u,label:"Duration"}),o&&(0,i.jsx)(f,{label:"Starting pose",placeholder:"Choose a starting pose"}),c.length>1&&(0,i.jsx)(E.Yq,{name:"videoDirectorQuality",items:c,label:"Quality"}),!o&&(0,i.jsx)(S,{name:"prompt",placeholder:"Describe what should happen in the video…",rules:{required:"Describe what should happen in the video.",validate:e=>String(e??"").trim().length>0||"Describe what should happen in the video."}})]})};var K=a(92732),A=a(63334),O=a(4512);let V=new Set(["COMPLETED","FAILED","CANCELLED"]);var R=a(97769),F=a(9308),G=a(47423),U=a(62725),L=a(65281);let q=(0,o.A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
1y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);a(98500);var $=a(33217);let Y=()=>(0,$.a)()?(0,i.jsxs)("div",{"data-porndude-policy":"true",className:"flex items-center justify-center gap-2 text-sm font-medium text-white/70",children:[(0,i.jsx)(q,{className:"h-4 w-4 text-pM","aria-hidden":"true"}),(0,i.jsx)("span",{children:"AI Safety Scan Active"})]}):null;var Q=a(14481),z=a(89319),W=a(37489),H=a(95727),B=a(98607);let X=()=>B.D.request({path:"/api/generate/video/extend/capability",method:"GET"}),Z=e=>B.D.request({path:"/api/generate/video/extend",method:"POST",data:e});var J=a(48934),ee=a(16136),et=a(43631);let ea=["generation","extend"];var ei=a(23373),el=a(19756),es=a(46634),er=a(1889);let eo=(0,a(41535).v)(e=>({shareReferenceSample:!1,setShareReferenceSample:t=>e({shareReferenceSample:t}),resetShareReferenceSample:()=>e({shareReferenceSample:!1})}));var en=a(32902),ed=a(92650),eu=a(58278);let ec=[{value:"auto",label:"Auto",weight:0},{value:"slim",label:"Slim",weight:1},{value:"athletic",label:"Athletic",weight:1},{value:"skinny",label:"Skinny",weight:2},{value:"muscular",label:"Muscular",weight:2},{value:"fat",label:"Fat",weight:3}],em=[{value:"auto",label:"Auto",weight:0},{value:"medium",label:"Medium",weight:1},{value:"small",label:"Small",weight:2},{value:"big",label:"Big",weight:2},{value:"huge",label:"Huge",weight:3}],eh=[{value:"nude",label:"Nude",weight:0},{value:"bikini",label:"Bikini",weight:1},{value:"lingerie",label:"Lingerie",weight:2},{value:"bdsm",label:"BDSM",weight:3}],ep=[{value:"draft",label:"Draft",weight:0},{value:"standard",label:"Standard",weight:1},{value:"high",label:"High",weight:3},{value:"ultra",label:"Ultra",weight:4}],eg=[{value:"oneToOne_realisticPorno",label:"1:1",weight:3},{value:"threeToFour_realisticPorno",label:"3:4",weight:4},{value:"twoToThree_realisticPorno",label:"2:3",weight:4},{value:"nineToSixteen_realisticPorno",label:"9:16",weight:4},{value:"fourToThree_realisticPorno",label:"4:3",weight:4},{value:"threeToTwo_realisticPorno",label:"3:2",weight:4},{value:"sixteenToNine_realisticPorno",label:"16:9",weight:4}],ex=({disabled:e})=>(0,i.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,i.jsx)(E.Yq,{name:"ratio",items:eg,label:"Aspect ratio",defaultValue:"threeToFour_realisticPorno",disabled:e}),(0,i.jsx)(E.ML,{label:"Prompt",placeholder:"Describe what you want to generate",required:!0,"aria-required":"true",maxLength:2e3,name:"prompt",weight:0,disabled:e})]});var ef=a(39074),eb=a(4109),ev=a(96450),ew=a(5697),ey=a(873),eN=a(31936),eS=a(22122);let eE=new Set([F.KN.IMAGE_TO_VIDEO]),ej=e=>"COMPLETED"===e.status&&"string"==typeof e.resultUrl&&e.resultUrl.length>0&&(0,eN._)(e.resultUrl,e.createdAt)&&!eE.has(e.mode)&&!e.videoFormat,e_=({isOpen:e,onClose:t,onSelect:a,selectedImageUrl:l,context:r="video"})=>{let{data:o,isLoading:n,isError:d,refetch:u,isFetching:m}=(0,eb.I)({queryKey:[...U.queryKeys.generations.history,"source-picker"],queryFn:ef.fetchGenerationPickerHistory,enabled:e,staleTime:3e4,retry:1}),p=(0,eS.eS)(),g=(0,s.useMemo)(()=>(o?.items??[]).filter(ej).slice(0,60),[o]);return(0,i.jsx)(c.lG,{open:e,onOpenChange:e=>!e&&t(),children:(0,i.jsxs)(c.Cf,{hasVisibleTitle:!0,className:(0,h.cn)("top-[max(0.5rem,env(safe-area-inset-top))] translate-y-0","md:top-[50%] md:translate-y-[-50%]","flex max-w-none w-[calc(100vw-1rem)] md:w-[min(1200px,calc(100vw-1rem))] max-h-[calc(100dvh-1rem)] md:max-h-[90vh]","flex-col gap-0 overflow-hidden rounded-2xl","border-[#1e2228] bg-[#131518] p-0"),children:[(0,i.jsxs)("div",{className:"shrink-0 px-4 pt-4 pb-2 md:px-6 md:pt-6 md:pb-4",children:[(0,i.jsx)(c.L3,{className:"text-base font-semibold text-white md:text-lg",children:"video"===r?"Animate a generated image":"Your generated images"}),(0,i.jsx)("p",{className:"mt-1 text-sm text-white/50",children:"video"===r?"Pick one of your recent generated images to turn into a video.":"Pick one of your generated images, or upload your own."})]}),(0,i.jsxs)("div",{className:(0,h.cn)("min-h-0 flex-1 overflow-y-auto px-3 pb-4 md:px-5 md:pb-6","[&::-webkit-scrollbar]:w-1.5","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-white/10","[&::-webkit-scrollbar-thumb:hover]:bg-white/20"),children:[n?(0,i.jsx)("div",{className:"flex min-h-[200px] items-center justify-center",children:(0,i.jsx)(ew.O,{})}):d?(0,i.jsxs)("div",{className:"flex min-h-[200px] flex-col items-center justify-center gap-3 text-center",children:[(0,i.jsx)("p",{className:"text-sm text-white/50",children:"Could not load your generated images."}),(0,i.jsx)("button",{type:"button",onClick:()=>u(),className:"text-sm font-medium text-pM underline",children:"Try again"})]}):0!==g.length||ey.c?(0,i.jsxs)(i.Fragment,{children:[0===g.length&&(0,i.jsx)("p",{className:"mb-3 text-sm text-white/50",children:"No generated images yet — generate an image first, or use your own photo:"}),(0,i.jsxs)("div",{className:"grid grid-cols-3 gap-2 md:grid-cols-4 lg:grid-cols-5",children:[(0,i.jsx)(ey.a,{variant:"tile"}),g.map(e=>{let s=e.resultUrl,r=l===s;return(0,i.jsx)("button",{type:"button",onClick:()=>{a(s),t()},className:(0,h.cn)("group relative cursor-pointer overflow-hidden rounded-xl text-left transition-all duration-200 ring-inset",r?"ring-2 ring-pM shadow-[0_0_20px_-4px] shadow-pM/30":"ring-1 ring-white/[0.06] hover:ring-white/20"),children:(0,i.jsxs)("div",{className:"relative aspect-[3/4] w-full bg-[#0a0b0d]",children:[(0,i.jsx)(ev.Kr,{src:s,alt:"Generated image",loading:"lazy",loader
1Size:"compact",wrapperClassName:"absolute inset-0",className:"h-full w-full object-contain",draggable:p.draggable??!0,onContextMenu:p.onContextMenu,onDragStart:p.onDragStart,style:p.style}),(0,i.jsx)("span",{className:"pointer-events-none absolute inset-0 bg-black/0 transition-colors group-hover:bg-black/20"}),r&&(0,i.jsx)("div",{className:"absolute right-2 top-2",children:(0,i.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-pM shadow-lg shadow-pM/30",children:(0,i.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-black",children:(0,i.jsx)("polyline",{points:"20 6 9 17 4 12"})})})})]})},e.id)})]})]}):(0,i.jsxs)("div",{className:"flex min-h-[200px] flex-col items-center justify-center gap-2 px-6 text-center",children:[(0,i.jsx)("div",{"aria-hidden":"true",className:"mb-2 flex h-14 w-14 items-center justify-center rounded-full bg-white/[0.06] text-2xl",children:"✨"}),(0,i.jsx)("p",{className:"text-base font-semibold text-white",children:"No generated images yet"}),(0,i.jsx)("p",{className:"text-sm text-white/50",children:"Generate an image first, then come back to animate it."})]}),m&&!n&&(0,i.jsx)("div",{className:"mt-3 text-center text-xs text-white/40",children:"Refreshing…"})]})]})})};function ek({ariaLabel:e,value:t,items:a,onChange:l,className:s,fixedColumns:r}){return(0,i.jsx)("div",{className:(0,h.cn)("h-12 w-full rounded-full bg-g4 p-1",r?"grid":"flex",s),style:r?{gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`}:void 0,role:"tablist","aria-label":e,children:a.map(e=>{let a=t===e.value;return(0,i.jsx)("button",{type:"button",role:"tab","aria-selected":a,"aria-disabled":e.disabled||void 0,disabled:e.disabled,onClick:()=>l(e.value),style:r&&e.column?{gridColumnStart:e.column}:void 0,className:(0,h.cn)("flex min-w-0 flex-1 items-center justify-center rounded-full text-center font-semibold leading-tight transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-pM/60",r&&r>=4?"w-full whitespace-nowrap px-0.5 text-xs":"px-2 text-sm",a?"bg-pM text-black":"text-white/60 hover:text-white",e.disabled&&!a&&"cursor-not-allowed text-white/35 hover:text-white/35"),children:e.label},e.value)})})}function eM({value:e,onChange:t}){return(0,i.jsx)(ek,{ariaLabel:"Image tool",value:e,items:[{value:"generate",label:"Generate"},{value:"poses",label:"Poses"}],onChange:t})}var eI=a(5772),eT=a(80712),eD=a(14515),eC=a(83212);let eP={[F.KN.UNDRESS_UPPER]:{text:"Undress",weight:Q.$K},[F.KN.UNDRESS_FULL]:{text:"Undress",weight:Q.$K},[F.KN.UNDRESS_PRO]:{text:"Undress",weight:Q.$K},[F.KN.MODIFY_PRO]:{text:"Generate",weight:Q.ry},[F.KN.MODIFY_FAITHFUL]:{text:"Generate",weight:Q.ry},[F.KN.FACE_SWAP]:{text:"Swap",weight:3},[F.KN.SWAP_BODY]:{text:"Swap",weight:4},[F.KN.DEEP_FAKE]:{text:"Generate",weight:Q.Gf},[F.KN.GENERATE]:{text:"Generate",weight:Q.$K},[F.KN.MODIFY]:{text:"Generate",weight:Q.$K},[F.KN.IMAGE_TO_VIDEO]:{text:"Generate",weight:Q.lY},[F.KN.DEEP_FAKE_VIDEO]:{text:"Animate",weight:Q.St},[F.KN.TEXT_TO_VIDEO]:{text:"Generate",weight:Q.lY},[F.KN.ANIMATE_IMAGE]:{text:"Animate",weight:Q.St}},eK=(e,t)=>{let a=e.find(e=>String(e.value)===String(t));return a?.weight??null},eA=e=>{let t=Number(e);return Number.isFinite(t)?t:0},eO=({isSubmittingOverride:e=!1})=>{let t=(0,G.Of)(e=>e.currentMode),a=(0,G.Of)(e=>e.socketState),{user:l}=(0,U.usePrivateSession)(),s=(0,et.n)(e=>e.showToast),o=(0,et.n)(e=>e.openNoCreditsModal),{data:n}=(0,U.useWsCreditsQuery)(!!l),d=(0,$.a)(),u=(0,U.useIsGenerationStarting)(),p=(0,ee.l)({mutationKey:ea})>0,g=function({isComposingNew:e,isGenerationStarting:t,isExtendStarting:a,isSubmittingOverride:i=!1}){return!e&&(t||a||i)}({isComposingNew:(0,A.useGenerationQueueStore)(e=>e.isComposingNew),isGenerationStarting:u,isExtendStarting:p,isSubmittingOverride:e}),x=l?.subscriptionType?(0,eD.rL)((0,eD.li)(l.subscriptionType)):void 0,f=x?.maxQueueSlots??1,b=(0,A.useGenerationQueueStore)(e=>e.tasks.filter(e=>("queued"===e.status||"accepted"===e.status||"processing"===e.status)&&Date.now()-(e.lastProgressAt??e.startedAt)<=A.ACTIVE_SIGNAL_TIMEOUT_MS).length>
1=f),v=(0,r.xW)(),w=v?.watch?.("outputType"),y=v?.watch?.("generationTab"),N=v?.watch?.("videoMode"),S=v?.watch?.("videoStyle"),E=v?.watch?.("videoDuration"),j=v?.watch?.("videoSize"),_=v?.watch?.("extendDuration"),k=v?.watch?.("extendQualityTier"),M=v?.watch?.("videoDirectorDuration"),I=v?.watch?.("videoDirectorQuality"),T="video"===w&&"video"===y&&"extend"===N,D="video"===w&&"video"===y&&"custom"===N,C="video"===w&&"video"===y&&"long"===N,P=D||C,O=P?M:T?_:E,V=P?"hd"===I?"512x768":"448x672":T?"hd"===k?"512x768":"448x672":j,R=eP[t]??{text:"Submit",weight:0},L=R.text,q=(0,Q.iQ)(t,R.weight);if("video"===w){let e=eP[F.KN.IMAGE_TO_VIDEO];L=e?.text??"Generate",q=e?.weight??Q.lY}let Y=t===F.KN.ANIMATE_IMAGE;if("deepfake"===w&&!Y){let e=eP[F.KN.DEEP_FAKE_VIDEO];L=e?.text??"Animate",q=e?.weight??Q.St}d&&("video"===w?L="Create AI Video":(t===F.KN.UNDRESS_UPPER||t===F.KN.UNDRESS_FULL)&&(L="AI Modify")),T&&(L="Extend video");let{checkIsAllowed:W,openNotAllowedModal:H,hasVideoRewardPass:B}=(0,m.G)(),X="video"===w&&"video"===y&&!T&&!P&&B,Z=e=>null==e||W(e)||X&&e<=Q.lY,J=W(q)||X,ei="control"===y&&!W(Q.$K),el=T||P?null:(0,z.RF)(S)?.weight??null,es=eK(z.Yd,O),er=eK(z.sO,E),eo=(0,eC.K)({hasPass:X,isBaseVideo:"video"===w&&!T&&!P,duration:O,style:S,styleWeight:el,size:V}),en=X&&!W(Q.lY),ed=!0;"video"===w&&(ed=Z(el)&&Z(es)&&(!en||eo)&&(!P||"hd"!==I||W(4))),"deepfake"!==w||Y||(ed=null==er||W(er));let eu=J&&!ei&&ed,ec=(0,z.rd)({duration:Number(O)||3,size:String(V||"448x672")}),em=z.sO.find(e=>String(e.value)===String(E))?.credits??40,eh="video"===w?ec:"deepfake"!==w||Y?Q.wK.get(t)?.cost??10:em,ep=n??null,eg=!!ep,ex=!!ep&&(eA(ep.instantPeriodCredits??ep.instantCredits)>=1e9||eA(ep.instantCreditsTotal)>=1e9),ef=ep?eA(ep.instantPeriodCredits??ep.instantCredits)+eA(ep.dailyCredits)+eA(ep.subscriptionBonusCredits)+eA(ep.bonusCredits):0,eb=!eo&&eg&&!ex&&ef<eh,ev="connected"===a,ew=J?ei?Q.$K:"video"!==w||null==el||W(el)?"video"!==w||null==es||W(es)?"deepfake"!==w||Y||null==er||W(er)?q:er:es:el:q,ey="video"===w?"Video generation":"deepfake"===w?d?"AI video":Y?"Animate Image":"Animate video":ei?"Control mode":L,eN=g?"generation_starting":eu?eb?"insufficient_credits":b?"active_queue_limit":ev?null:"socket_not_ready":"plan_locked";return(0,i.jsxs)(c.$n,{type:eN?"button":"submit",onClick:()=>{if((0,K.Dt)("generate_clicked",{flow_name:"undress_generation",flow_step:"submit_click",flow_status:eN?"blocked":"ready",generation_mode:t,output_type:w??"image",generation_tab:y??null,blocked_reason:eN,socket_state:a,active_queue_limit:b,max_queue_slots:f,required_credits:eh,total_credits:ef,credits_known:eg,is_unlimited_credits:ex}),eN){if((0,K.Dt)("generate_blocked",{flow_name:"undress_generation",flow_step:"submit_click",flow_status:"blocked",generation_mode:t,output_type:w??"image",generation_tab:y??null,blocked_reason:eN,socket_state:a,max_queue_slots:f,required_credits:eh,total_credits:ef,credits_known:eg,is_unlimited_credits:ex}),"insufficient_credits"===eN)return void o({requiredCredits:eh,availableCredits:ef});if("plan_locked"===eN)return void H(ew,ey);if("socket_not_ready"===eN)return void s("Connecting to the generation server. Try again in a moment.");if("active_queue_limit"===eN)return void s(`You already have ${f} active generation${1===f?"":"s"}.`);"generation_starting"===eN&&s("Generation is already starting.")}},"aria-busy":g||void 0,className:(0,h.cn)("w-full",{"opacity-60":eN&&"plan_locked"!==eN}),"data-breadcrumb":`submit.${t}.${w??"image"}`,"data-ph-capture-attribute":`submit.${t}.${w??"image"}.${eN??"ready"}`,children:[b?`Limit reached (${f})`:g?(0,i.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,i.jsxs)("svg",{className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,i.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,i.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Sending..."]}):L,!eu&&!b&&!g&&(0,i.jsx)(eI.default,{src:eT.i$,alt:""})]})},eV=["She spreads her legs","She keeps her legs wide open","She keeps her knees apart","She arches her back","She deepens her back arch","She raises her hands above her head","She puts her hands behind her back","She puts her hands on her hips","She puts her hands on her thighs","She grabs her thighs","She touches her breasts","She covers her nipples","She runs fingers through her hair","She pulls her hair","She thrusts her hi
1ps forward","She sways her hips","She lifts her ass up","She bends over","She leans forward","She leans back","She gets on her knees","She kneels","She gets on all fours","She sits with legs spread","She squats low","She stands with legs apart","She turns sideways with hip out","She shows her back","She faces forward","She frames a close-up body shot","She shows her full body","She focuses on her upper body","She presses her breasts together","She shows her small breasts","She lets her breasts hang naturally","She lifts her chest forward","She pushes her ass back","She shakes her ass","She sways her curvy hips","She twists her slim waist","She tightens her stomach","She flexes her abs","She parts her thick thighs","She stretches her long legs","She spreads her shaved pussy","She spreads her trimmed pussy","She pushes up her cleavage","She shows hard nipples","Her skin looks wet","Her skin looks sweaty","She parts her glossy lips","She opens her mouth","She sticks out her tongue","She bites her lip","She breathes heavily","She gives bedroom eyes","She gives a lustful gaze","She makes a seductive expression","She makes an ahegao expression","She gives a teasing smile","She gives a soft smile","She makes a playful expression","She makes a dominant expression","She makes a submissive expression","She makes an innocent expression","She makes a shy expression","She blushes","She holds intense eye contact","She looks at the camera","She tilts her head","She closes her eyes","She keeps her eyes half-closed","She rolls her eyes back","She makes a moaning face","She makes a confident expression","She holds a sensual pose"],eR=["Natural studio lighting","Warm cinematic lighting","Soft skin detail","Confident eye contact","Subtle seductive expression","Full body composition","Close-up portrait crop","Slim waist","Curvier hips","Longer legs","Wet skin effect","Messy wet hair","Luxury bedroom background","Minimal studio background","Keep face and identity unchanged"];Q.lY;let eF=new Set(["she","her","his","a","an","the","to","of","with","on","at","for"]),eG=e=>e.charAt(0).toUpperCase()+e.slice(1),eU=({disabled:e})=>{let{setValue:t,getValues:a}=(0,r.xW)(),l=(0,r.FH)({name:"outputType"}),o=(0,r.FH)({name:"mode"}),n=(0,r.FH)({name:"videoStyle"}),d=(0,r.FH)({name:"videoDuration"}),u=(0,z.gw)(n??""),c="video"===l,h=o===F.KN.UNDRESS_UPPER||o===F.KN.UNDRESS_FULL||o===F.KN.UNDRESS_PRO,{checkIsAllowed:p}=(0,m.G)(),g=p(Q.ry),x=(o===F.KN.MODIFY||o===F.KN.MODIFY_PRO||o===F.KN.MODIFY_FAITHFUL)&&g,[f,b]=(0,s.useState)(eV.slice(0,3));(0,s.useEffect)(()=>{if(!c)return;(0,z.R)(n)||t("videoStyle",z.K4[0]?.value);let e=Number(d);!u||e&&u.includes(e)||t("videoDuration",u[0].toString())},[u,c,d,n,t]),(0,s.useEffect)(()=>{b((e=>{let t=[...e];for(let e=t.length-1;e>0;e-=1){let a=Math.floor(Math.random()*(e+1));[t[e],t[a]]=[t[a],t[e]]}return t.slice(0,Math.min(3,t.length))})(x?eR:eV))},[x]),(0,s.useEffect)(()=>{h?(t("negativePrompt",""),t("rewriteMode",F.KN.UNDRESS_FULL)):t("rewriteMode",void 0)},[h,t]);let v=z.K4.map(e=>{let t=e.label.match(/^(.+?)\s*\((\d+)\s*credits?\)$/),a=t?t[1]:e.label;return{value:e.value,label:a,weight:e.weight||0,disabled:!p(e.weight||0)}}),w=(u?z.Yd.filter(e=>u.includes(e.value)):z.Yd).map(e=>{let t=e.label.match(/^(.+?)\s*\(([^)]+)\)$/),a=t?t[1]:e.label,l=t?t[2]:"";return{value:e.value.toString(),label:(0,i.jsxs)("span",{className:"flex items-center gap-1.5",children:[a,l&&(0,i.jsxs)("span",{className:"text-xs text-gray-400",children:["(",l,")"]})]}),weight:e.weight||0,disabled:!p(e.weight||0)}});return(0,i.jsx)(i.Fragment,{children:c?(0,i.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,i.jsx)(E.Yq,{name:"videoStyle",items:v,label:"Type",disabled:e}),(0,i.jsx)(E.Yq,{name:"videoDuration",items:w,label:"Duration",disabled:e})]}):x?(0,i.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,i.jsx)(E.ML,{placeholder:"Describe your edits",name:"prompt",weight:0,disabled:e}),(0,i.jsx)("div",{className:"flex w-full flex-wrap gap-2","aria-label":"Edit ideas",children:f.map(l=>{let s;return(0,i.jsx)("button",{type:"button",className:"rounded-full border border-white/20 px-3 py-1.5 text-xs text-white transition hover:border-pM hover:text-pM disabled:opacity-50",onClick:()=>(i=>{if(e)return;let l=String(a("prompt")??"").trim(),s=l.toLowerCase(),r=i.toLowerCase();s.includes(r)||t("prompt",l?`${l}, ${i}`:i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})})(l),disabled:e,"data-breadcrumb":`prompt-pill.${l}`,children:(s=l.toLowerCase().replace(/[^a-z0-9\s']/g," ").split(/\s+/).filter(
1Boolean).filter(e=>!eF.has(e))).length?s.slice(-2).map(eG).join(" "):l},l)})})]}):h?null:(0,i.jsxs)("div",{className:"flex w-full flex-col gap-6",children:[(0,i.jsx)(E.CH,{name:"clothes",items:eh,label:"Undress Type",className:"w-full [&_div]:!w-full [&_.inline-flex]:!w-full [&_button]:flex-1",disabled:e}),(0,i.jsxs)("div",{className:"flex w-full gap-6 flex-col sm:flex-row",children:[(0,i.jsx)(E.Yq,{name:"body",items:ec,label:"Body Type",disabled:e}),(0,i.jsx)(E.Yq,{name:"boobs",items:em,label:"Boobs",disabled:e})]}),(0,i.jsx)(E.Yq,{name:"quality",items:ep,label:"Quality",disabled:e}),(0,i.jsx)(E.ML,{placeholder:"Enter own prompt (optional)",name:"prompt",weight:1,disabled:e})]})})},eL=async()=>{var e;return Array.isArray(e=await B.D.request({path:"/modes",method:"GET"}))?e:e&&"object"==typeof e&&Array.isArray(e.data)?e.data:[]};var eq=a(263),e$=a(483),eY=a(80100);let eQ=new Set(["3","4","5","6","7","8"]),ez=({disabled:e=!1,durations:t,qualityTiers:a})=>{let{setValue:l}=(0,r.xW)(),o=(0,r.FH)({name:"extendDuration"}),n=(0,r.FH)({name:"extendQualityTier"}),d=(0,s.useMemo)(()=>t.map(e=>String(e).replace(/sec$/,"")).filter(e=>eQ.has(e)),[t]),u=(0,s.useMemo)(()=>a.filter(e=>"normal"===e||"hd"===e),[a]);return(0,s.useEffect)(()=>{d.length&&!d.includes(String(o??""))&&l("extendDuration",d[0],{shouldDirty:!1}),u.length&&!u.includes(n)&&l("extendQualityTier",u[0],{shouldDirty:!1})},[o,d,n,u,l]),(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,i.jsx)(E.Yq,{name:"extendDuration",label:"Duration",disabled:e,items:d.map(e=>({value:e,label:`${e} seconds`}))}),u.length>1&&(0,i.jsx)(E.Yq,{name:"extendQualityTier",label:"Quality",disabled:e,items:u.map(e=>({value:e,label:"hd"===e?"HD \xb7 more detail":"Normal \xb7 faster"}))}),(0,i.jsx)(S,{name:"extendPrompt",placeholder:"Describe only what should happen next…",disabled:e})]})},eW=(0,o.A)("ticket-check",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),eH=({count:e})=>(0,i.jsxs)("div",{role:"status","aria-live":"polite",className:"flex items-center justify-between gap-3 rounded-xl border border-lime-300/25 bg-lime-300/[0.07] px-3.5 py-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("span",{className:"grid size-9 shrink-0 place-items-center rounded-full bg-lime-300/15 text-lime-300",children:(0,i.jsx)(eW,{"aria-hidden":"true",className:"size-[18px]"})}),(0,i.jsxs)("span",{className:"min-w-0",children:[(0,i.jsx)("span",{className:"block text-sm font-semibold text-white",children:"Free video pass"}),(0,i.jsx)("span",{className:"block text-xs text-white/55",children:"1 pass will be used \xb7 3 sec \xb7 Normal"})]})]}),(0,i.jsxs)("span",{className:"shrink-0 rounded-full bg-lime-300 px-2.5 py-1 text-xs font-bold text-black",children:[e," available"]})]});var eB=a(50429);let eX={status:"ok",enabled:!1,styles:[]},eZ=e=>"string"==typeof e&&e.trim()?e.trim():void 0,eJ=(e,t)=>{let a=eZ(e);return a&&a.length<=t?a:void 0},e0=e=>"number"==typeof e&&Number.isFinite(e)&&e>0?e:void 0,e1=e=>{if(!e||"object"!=typeof e)return;let t=eZ(e.value);if(!t||!(0,eq.q3)(t))return;let a=eZ(e.key)??(0,eq.pi)(t);if(!a)return;let i=(0,eq.tJ)(e.code)?e.code:(0,eq.tJ)(e.family)?e.family:(0,eq.g)(a);if(!i)return;let l=eJ(e.title,200)??eJ(e.label,200)??(0,eq.cn)(a),s={value:t,label:l,weight:eq.bz,badge:eJ(e.badge,200)??eq.dl[i],key:a,version:eZ(e.version)??(0,eq.CV)(t)??"",code:i,family:i,title:l},r=(e=>{if(!Array.isArray(e))return;let t=[],a=new Set;for(let i of e){let e=eJ(i,64)?.toLowerCase();if(!(!e||a.has(e))&&(a.add(e),t.push(e),t.length>=32))break}return t.length?t:void 0})(e.tags),o=e0(e.durationSec),n=eJ(e.priceTier,200),d=e0(e.medianTotalMs),u=e0(e.etaSec)??e0(e.expectedSec)??(void 0!==d?d/1e3:void 0),c=(e=>{let t=eJ(e,2048);if(t)try{let e=new URL(t);if("https:"!==e.protocol||e.username||e.password)return;return e.toString()}catch{return}})(e.previewUrl),m=eJ(e.visibility,200);return r&&(s.tags=r),void 0!==o&&(s.durationSec=o),n&&(s.priceTier=n),void 0!==u&&(s.etaSec=u),void 0!==d&&(s.medianTotalMs=d),c&&(s.previewUrl=c),m&&(s.visibility=m),s},e2=async({signal:e}={})=>{let t=await fetch(`${String("https://api.undress.zone").replace(/\/$/,"")}/api/generate/video/profile-styles`,{credentials:"include",headers:{Accept:"application/json"},signal:e});if(404===t.status)return{status:"unavailable"};if(401===t.status||403===t.status)return eX;if(!t.ok)throw Error(`Profile video styles request failed (${t.status})`);let a=await t.json();if(!a||"object"!=typeof a)throw Error("Profile video styles response is not an object");let{enabled:i,styles:l}=a;if(!0!==i)return eX;if(!Array.isArray(l))throw Error("Profile video styles response has no styles array");let s=new Set,r=[];for(let e of l){let t=e1(e);!t||s.has(t.value)||(s.add(t.value),r.push(t))}return{status:"ok",enabled:!0,styles:r}},e4="undress.zone",e3=()=>()=>{},e5=()=>{let e;return(e=window.location.hostname)===e4||e.endsWith(`.${e4}`)||"localhost"===e},e6=()=>!1,e8={enabled:!1,styles:[]};var e7=a(76009),e9=a(96782);let te=new Set(["blink_pov_doggy","ass_spread","undressed_by_another","pov_insertion","pov_body_cumshot_pullout","slow_twerk","cowgirl_normal_reverse","t
1werk_v3","side_missionary","kneeling_bj","doggy_pov","all_in_one","smoothmix"]),tt={isMobile:!1,saveData:!1,effectiveType:"unknown",shouldForceLow:!1,allowHeroUpgrade:!1,devicePixelRatio:1},ta=({previewClip:e,posterImage:t,styleLabel:a,isModalOpen:l,active:r,modalRoot:o,connectionProfile:n})=>{let d,u,c,m=(0,s.useRef)(null),h=(0,s.useRef)(null),[p,g]=(0,s.useState)(0),[x,f]=(0,s.useState)(!1),[b,v]=(0,s.useState)(!1),[w,y]=(0,s.useState)(!1),[N,S]=(0,s.useState)(null),E=t&&t!==N?t:void 0,j=e?(d=(0,e7.Rg)(n,{forFeed:!0}),u=[],n.isMobile||n.saveData||"p240"===d?u.push((0,e7.nB)(e,"p240","mp4")):u.push((0,e7.nB)(e,"p360","mp4"),(0,e7.nB)(e,"p240","mp4")),u.push(e),c=u.filter((e,t,a)=>!!e&&a.indexOf(e)===t),(0,e7.ep)()?c.flatMap(e=>[(0,e7.Gh)(e),e]):c):[],_=j.join("|"),k=j[p],M=l&&b&&!!k&&!x;return((0,s.useEffect)(()=>{g(0),f(!1)},[_]),(0,s.useEffect)(()=>{if(!l||!e){v(!1),y(!1);return}let t=m.current;if(!t)return;let a=h.current,i=new IntersectionObserver(([e])=>{v(e.isIntersecting),y(e.intersectionRatio>=.35),e.isIntersecting||h.current?.pause()},{root:o,rootMargin:n.isMobile?"120px 0px":"220px 0px",threshold:[0,.35,.75]});return i.observe(t),()=>{i.disconnect(),a?.pause()}},[n.isMobile,l,o,e]),(0,s.useEffect)(()=>{let e=h.current;if(e){if(M&&w)return void e.play().catch(()=>{});e.pause()}},[k,w,M]),M)?(0,i.jsx)("div",{ref:m,className:"absolute inset-0",children:(0,i.jsx)("video",{ref:h,src:k,poster:E,autoPlay:w,muted:!0,loop:!0,playsInline:!0,preload:"metadata",className:"absolute inset-0 h-full w-full object-cover",onError:()=>{p<j.length-1?g(e=>e+1):f(!0)},onLoadedData:()=>{let e=h.current;e&&w&&e.play().catch(()=>{})}},k)}):E?(0,i.jsx)("div",{ref:m,className:"absolute inset-0",children:(0,i.jsx)("img",{src:E,alt:a,loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",fetchPriority:r?"high":"low",className:"absolute inset-0 h-full w-full object-cover",onError:()=>S(E)},E)}):(0,i.jsx)("div",{ref:m,className:"absolute inset-0",children:(0,i.jsx)("div",{className:"flex h-full w-full items-center justify-center bg-gradient-to-br from-[#1a1d24] to-[#0d0e11] px-2 text-center text-[11px] font-medium text-white/40",children:a})})},ti=e=>(0,eq.q3)(e.value)?e.label:(0,z.HE)(e.value),tl=({isOpen:e,selectedStyle:t,onClose:a,onSelect:l})=>{let{checkIsAllowed:r,openNotAllowedModal:o}=(0,m.G)(),n=(0,s.useRef)(null),[d,u]=(0,s.useState)(""),[p,g]=(0,s.useState)(null),[x,f]=(0,s.useState)(tt),{styles:b}=(()=>{let{user:e,isAuthorized:t}=(0,U.usePrivateSession)(),a=(0,s.useSyncExternalStore)(e3,e5,e6)&&t,{data:i}=(0,eb.I)({queryKey:U.queryKeys.generations.profileVideoStyles(e?.id??null),queryFn:async({signal:e})=>{let t=await e2({signal:e});return"ok"===t.status&&(0,eB.b)(t.styles),t},enabled:a,staleTime:6e4,retry:1});return(0,s.useEffect)(()=>{i?.status==="ok"&&(0,eB.b)(i.styles)},[i]),(0,s.useMemo)(()=>a&&i?.status==="ok"&&i.enabled?{enabled:!0,styles:i.styles}:e8,[a,i])})(),v=(0,s.useMemo)(()=>[...z.K4.filter(e=>!te.has(e.value)),...b],[b]),w=(0,s.useMemo)(()=>new Map(b.map(e=>[e.value,e])),[b]),y=(0,s.useMemo)(()=>new Map(v.map(e=>{let t;return[e.value,(t=w.get(e.value),[ti(e),e.badge??"",t?.key??"",t?.title??"",t?.family??"",...t?.tags??[]].join(" ").toLowerCase())]})),[v,w]),N=(0,s.useMemo)(()=>{let e=new Map;for(let t of b)e.set(t.family,(e.get(t.family)??0)+1);return eq.p6.filter(t=>e.has(t)).map(t=>({code:t,label:eq.dl[t],count:e.get(t)??0}))},[b]),S=p&&N.some(e=>e.code===p)?p:null,E=d.trim().toLowerCase().split(/\s+/).filter(Boolean),j=v.filter(e=>{if(S&&w.get(e.value)?.family!==S)return!1;if(0===E.length)return!0;let t=y.get(e.value)??"";return E.every(e=>t.includes(e))}),_=E.length>0||null!==S;return(0,s.useEffect)(()=>{if(!e)return;let t=()=>{f((0,e7.kz)())};t(),window.addEventListener("resize",t);let a=navigator;return a.connection?.addEventListener?.("change",t),()=>{window.removeEventListener("resize",t),a.connection?.removeEventListener?.("change",t)}},[e]),(0,i.jsx)(c.lG,{open:e,onOpenChange:e=>!e&&a(),children:(0,i.jsxs)(c.Cf,{hasVisibleTitle:!0,className:(0,h.cn)("top-[max(0.5rem,env(safe-area-inset-top))] translate-y-0","md:top-[50%] md:translate-y-[-50%]","flex max-w-none w-[calc(100vw-1rem)] md:w-[min(1200px,calc(100vw-1rem))] max-h-[calc(100dvh-1rem)] md:max-h-[90vh]","flex-col gap-0 overflow-hidden rounded-2xl","border-[#1e2228] bg-[#131518] p-0"),children:[(0,i.jsxs)("div",{className:"shrink-0 px-4 pt-4 pb-3 md:px-6 md:pt-6 md:pb-4",children:[(0,i.jsx)(c.L3,{className:"text-base font-semibold text-white md:text-lg",children:"Select Video Style"}),(0,i.jsxs)("label",{className:"relative mt-3 block",children:[(0,i.jsx)("span",{className:"sr-only",children:"Search video styles by name or tag"}),(0,i.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-white/40",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,i.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,i.jsx)("path",{d:"m20 20-4-4"})]}),(0,i.jsx)("input",{value:d,onChange:e=>u(e.target.value),placeholder:b.length>0?"Search video styles or tags":"Search video styles",autoComplete:"off",spellCheck:!1,className:"h-11 w-full rounded-xl border border-white/10 bg-white/[0.04] pl-10 pr-10 text-sm text-white outline-none placeholder:text-white/35 focus:border-pM"}),d?(0,i.jsx)("button",{type:"button",onClick:()=>u(""),"aria-label":"Clear search",className:"absolute right-2 top-1/2 grid h-7 w-7 -translate-y-1/2 place-items-center rounded-full text-white/50 hover:bg-white/10 hover:text-white",children:"\xd7"}):null]}),N.length>0?(0,i.jsxs)("div",{role:"group","aria-label":"Filter by style family",className:"mt-3 flex flex-wrap gap-1.5",children:[(0,i.jsx)("button",{type:"button",onClick:()=>g(null),"aria-pressed":null===S,className:(0,h.cn)("h-7 rounded-full border px-3 text-[11px] font-semibold transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-pM",null===S?"border-pM/60 bg-pM/15 text-white":"border-white/10 bg-white/[0.04] text-white/70 hover:border-white/25 hover:text-white"),children:"All"}),N.map(e=>{let t=S===e.code;return(0,i.jsxs)("button",{type:"button",onClick:()=>g(t?null:e.code),"aria-pressed":t,title:e.code,className:(0,h.cn)("h-7 rounded-full border px-3 text-[11px] font-semibold transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-pM",t?"border-pM/60 bg-pM/15 text-white":"border-white/10 bg-white/[0.04] text-white/70 hover:border-white/25 hover:text-white"),children:[e.label,(0,i.jsx)("span",{className:"ml-1 font-normal text-white/45",children:e.count})]},e.code)})]}):null,(0,i.jsx)("p",{role:"status","aria-live":"polite",className:"sr-only",children:1===j.length?"1 video style":`${j.length} video styles`})]}),(0,i.jsxs)("div",{ref:n,className:(0,h.cn)("min-h-0 flex-1 overflow-y-auto px-3 pb-4 md:px-5 md:pb-6","[&::-webkit-scrollbar]:w-1.5","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-white/10","[&::-webkit-scrollbar-thumb:hover]:bg-white/20"),children:[(0,i.jsx)("div",{className:"grid grid-cols-3 gap-2 md:grid-cols-4 lg:grid-cols-5",children:j.map(s=>{let d,u,c=w.get(s.value),m=z.Er[s.value],p=z.HI[s.value]??c?.previewUrl,g=ti(s),f=!r(s.weight??0),b=t===s.value,v="number"==typeof(d=c?.durationSec)&&Number.isFinite(d)&&d>0?`${Number.isInteger(d)?d:d.toFixed(1)} s`:null,y=(0,e9.Nt)(c?.etaSec),N=c&&"number"==typeof(u=z.Sb)&&Number.isFinite(u)&&u>=0?`${Math.round(u)} ${1===Math.round(u)?"credit":"credits"}`:null,S=!!(v||y||N),E=c?.tags?.length?`${g}
2${c.tags.join(", ")}`:void 0;return(0,i.jsx)("button",{type:"button","aria-pressed":b,title:E,onClick:()=>{var e,t;return e=s.value,void(!r(t=s.weight??0)?o(t,"This video style"):(l(e),a()))},className:(0,h.cn)("group relative cursor-pointer overflow-hidden rounded-xl text-left transition-all duration-200 ring-inset","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-pM",b?"ring-2 ring-pM shadow-[0_0_20px_-4px] shadow-pM/30":"ring-1 ring-white/[0.06] hover:ring-white/20"),children:(0,i.jsxs)("div",{style:{aspectRatio:"2 / 3"},className:"relative w-full bg-[#0a0b0d]",children:[(0,i.jsx)(ta,{previewClip:m,posterImage:p,styleLabel:g,isModalOpen:e,active:b,modalRoot:n.current,connectionProfile:x}),(0,i.jsxs)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent px-2 pb-2 pt-8",children:[(0,i.jsx)("p",{className:"truncate text-[12px] font-semibold leading-tight text-white md:text-[13px]",children:g}),S?(0,i.jsxs)("p",{className:"mt-0.5 flex flex-wrap gap-x-1.5 gap-y-0 text-[9px] font-medium leading-tight text-white/65 md:text-[10px]",children:[v?(0,i.jsx)("span",{title:"Clip length",children:v}):null,y?(0,i.jsx)("span",{title:"Expected render time",children:y}):null,N?(0,i.jsx)("span",{title:"Credits per video",children:N}):null]}):null]}),s.badge?(0,i.jsx)("span",{className:"pointer-events-none absolute left-2 top-2 rounded-full bg-white/[0.12] px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-white/80 backdrop-blur-[2px]",children:s.badge}):null,f&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",children:(0,i.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-white/[0.08]",children:(0,i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-pM",children:[(0,i.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),(0,i.jsx)("path",{d:"M7 11V7a5 5 0 0110 0v4"})]})})}),b&&(0,i.jsx)("div",{className:"absolute right-2 top-2",children:(0,i.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-pM shadow-lg shadow-pM/30",children:(0,i.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-black",children:(0,i.jsx)("polyline",{points:"20 6 9 17 4 12"})})})})]})},s.value)})}),0===j.length?(0,i.jsxs)("div",{className:"flex flex-col items-center gap-3 py-12 text-center",children:[(0,i.jsx)("p",{className:"text-sm text-white/45",children:"No video styles found"}),_?(0,i.jsx)("button",{type:"button",onClick:()=>{u(""),g(null)},className:"h-8 rounded-full border border-white/10 px-3 text-xs font-semibold text-white/70 hover:border-white/25 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-pM",children:"Clear search and filters"}):null]}):null]})]})})},ts=({disabled:e=!1,typeOnly:t=!1,advancedOnly:a=!1,showModeTabs:o=!0,isDeepFakeMode:n=!1,showCustom:d=!1,canCustom:u=!1,customCapabilityPending:c=!1,customControls:h=null,
2showLong:p=!1,canLong:g=!1,longControls:x=null})=>{let f=(0,eb.I)({queryKey:["video","extend","capability"],queryFn:X,staleTime:3e4,retry:!1}),b=(0,eb.I)({queryKey:["generation","modes"],queryFn:eL,staleTime:3e4,retry:!1}),v=b.data?.find(e=>e.code===(n?"vid07":"vid06")),w=v?.options?.durationsSec,S=v?.options?.qualityProfiles?Object.keys(v.options.qualityProfiles):void 0,j=v?.options?.qualityProfiles?Object.values(v.options.qualityProfiles).map(e=>e?.renderSize).filter(e=>!!e):void 0,_=z.NL.filter(e=>!S||S.includes(e.value)).map(e=>({...e,weight:0})),k=f.data?.enabled===!0&&f.data.durations?.some(e=>["3","4","5","6","7","8"].includes(String(e).replace(/sec$/,"")))&&f.data.qualityTiers?.some(e=>"normal"===e||"hd"===e),{field:M}=(0,r.as)({name:"videoMode",defaultValue:"create"}),{field:I}=(0,r.as)({name:"extendSourceType",defaultValue:"upload"}),{field:T}=(0,r.as)({name:"extendSourceVideoUrl",defaultValue:""}),{field:D}=(0,r.as)({name:"extendSourceGenerationId",defaultValue:""}),C=l.V9&&!!k&&!n,P=l.V9&&!n,K=((e,t,a,i=!1)=>"custom"===e&&l.qK&&t?"custom":"long"===e&&i?"long":"extend"===e&&l.V9&&a?"extend":"create")(M.value,d,P,p),A=(0,eu.S)(e=>e.setActive),O=(0,eu.S)(e=>e.source),V=(0,eu.S)(e=>e.setUploadEnabled),R=(0,eu.S)(e=>e.openRequest),F=(0,eu.S)(e=>e.consumePrefill);(0,s.useEffect)(()=>{C&&R&&(M.onChange("extend"),F())},[C,F,R,M]),(0,s.useEffect)(()=>{let e=O?.sourceVideoUrl??"",t=O?.sourceGenerationId??"",a=t?"prefill":"upload";String(T.value??"")!==e&&T.onChange(e),String(D.value??"")!==t&&D.onChange(t),I.value!==a&&I.onChange(a)},[D,O,I,T]),(0,s.useEffect)(()=>(A("extend"===K),()=>A(!1)),[A,K]),(0,s.useEffect)(()=>(V(f.data?.uploadEnabled===!0),()=>V(!1)),[f.data?.uploadEnabled,V]);let[U,L]=(0,s.useState)(!1),{checkIsAllowed:q,hasVideoRewardPass:$,videoRewardPassCount:Y}=(0,m.G)(),{setSize:Q}=(0,e$.K)(),W=!n&&"create"===K&&$,H=W&&!q(2),B=(0,s.useCallback)((e=0)=>q(e)||W&&e<=2,[q,W]),{field:{value:Z,onChange:J}}=(0,r.as)({name:"videoStyle",defaultValue:z.K4[0]?.value??"allposes:ultimate_list__cums"}),{field:{value:ee,onChange:et}}=(0,r.as)({name:"videoDuration"}),ea=(0,G.Of)(e=>e.uploadedFaceImage),{clearPersistentError:ei}=(0,G.lK)(),[el,es]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!n||!ea)return void es(null);let e=!1;return es(null),(0,eY.z)(ea).then(t=>{e||es(Math.max(3,Math.floor(t+.1)))}).catch(()=>{e||es(null)}),()=>{e=!0}},[n,ea]);let{field:{value:er,onChange:eo}}=(0,r.as)({name:"animateQuality",defaultValue:"normal"});(0,s.useEffect)(()=>{n&&S?.length&&!S.includes("hd"===er?"hd":"normal")&&eo(S[0])},[er,S,n,eo]);let{field:{value:en,onChange:ed}}=(0,r.as)({name:"videoSize"});(0,s.useEffect)(()=>{Q("512x768"===en?"512x768":"448x672")},[Q,en]);let ec=B(4);(0,s.useEffect)(()=>{ec||"512x768"!==en||ed("448x672")},[ec,ed,en]);let em="string"==typeof Z&&Z?Z:z.K4[0]?.value??"allposes:ultimate_list__cums";(0,s.useEffect)(()=>{H&&(String(ee??"")!==String(eC.W.duration)&&et(String(eC.W.duration)),em!==eC.W.style&&J(eC.W.style))},[H,em,et,J,ee]);let eh=(0,z.RF)(em)?.weight??null,ep=!n&&(0,eq.q3)(em),eg=(0,eC.K)({hasPass:W,isBaseVideo:!n&&"create"===K,duration:ee,style:em,styleWeight:eh,size:en}),ex=n?0:(0,z.ic)(em),ef=n?void 0:(0,z.gw)(em),ev=(n?z.sO:z.Yd).filter(e=>(!ef||ef.includes(e.value))&&(ep||!w||w.includes(e.value))&&(!n||null===el||e.value<=el)).map(e=>{let t=e.weight||0,a=ex>0&&e.value<ex,l=!!(ef&&!ef.includes(e.value)),s=n?e.credits:(0,z.rd)({duration:e.value,size:String(en||"448x672")});return{value:e.value.toString(),label:(0,i.jsxs)("span",{className:"flex w-full min-w-0 items-center gap-1",children:[(0,i.jsx)("span",{className:"shrink-0 whitespace-nowrap",children:e.label.replace(/\s*\([^)]*\)\s*$/,"")}),(0,i.jsx)("span",{className:"min-w-0 truncate text-xs text-gray-400",children:eg&&3===e.value?"(Free with pass)":`(${s} credits)`}),a&&(0,i.jsxs)("span",{className:"shrink-0 whitespace-nowrap text-xs text-yellow-500",children:["(min ",ex,"s)"]}),l&&!a&&(0,i.jsx)("span",{className:"shrink-0 whitespace-nowrap text-xs text-yellow-500",children:"(4s–10s)"})]}),weight:t,disabled:a||l||H&&3!==e.value||!B(t)}}),ew=Number(ee)||3,ey=z.jj.filter(e=>!j||j.includes(e.value)).map(e=>({value:e.value,label:(0,i.jsxs)("span",{className:"flex w-full min-w-0 items-center gap-1.5",children:[(0,i.jsx)("span",{children:e.label}),(0,i.jsx)("span",{className:"text-xs font-normal text-gray-400",children:e.description}),(0,i.jsx)("span",{className:"ml-auto text-xs font-normal text-gray-400",children:eg&&"512x768"!==e.value?"(Free with pass)":`(${
2(0,z.rd)({duration:ew,size:e.value})} credits)`})]}),weight:e.weight,disabled:!B(e.weight)}));(0,s.useEffect)(()=>{let e=Number(ee);if(n&&null!==el&&e>el){et(String(z.sO.filter(e=>e.value<=el&&(!w||w.includes(e.value))).at(-1)?.value??3)),ei();return}n&&!z.sO.some(t=>t.value===e)?et(String(z.sO[0].value)):!ef||e&&ef.includes(e)?ex>0&&e&&e<ex&&et(ex.toString()):et(ef[0].toString())},[ef,w,ei,n,el,ex,ee,et]),(0,s.useEffect)(()=>{if(n)return void L(!1);let e=(0,z.RF)(em);if(e&&B(e.weight||0))return;let t=z.K4.find(e=>B(e.weight||0));t&&t.value!==em&&J(t.value)},[B,n,em,J]);let eN=(({showCustom:e,showExtend:t,customAvailable:a,customPending:i,extendAvailable:s,extendPending:r,showLong:o=!1,longAvailable:n=!1})=>[{value:"create",label:"Create video"},...l.qK&&e?[{value:"custom",label:"Custom video",disabled:i||!a}]:[],...o?[{value:"long",label:"Long video",disabled:!n}]:[],...l.V9&&t?[{value:"extend",label:"Extend video",disabled:r||!s}]:[]])({showCustom:d,showExtend:P,customAvailable:u,customPending:c,extendAvailable:C,extendPending:f.isPending,showLong:p,longAvailable:g}),eS=o&&(P||d||p)?(0,i.jsx)(ek,{ariaLabel:"Video mode",value:K,items:eN,onChange:M.onChange}):null;return"extend"===K?(0,i.jsxs)("div",{className:y,"data-video-mode":"extend",children:[eS,!t&&f.isPending?(0,i.jsx)("p",{className:"rounded-xl border border-white/10 bg-white/5 p-3 text-sm text-white/60",children:"Checking Extend Video availability…"}):t||C?t?null:(0,i.jsx)(ez,{disabled:e,durations:(f.data?.durations??[]).filter(e=>{let t=Number(String(e).replace(/sec$/,"")),a=z.Yd.find(e=>e.value===t);return!!(a&&q(a.weight))}),qualityTiers:(f.data?.qualityTiers??[]).filter(e=>"hd"!==e||q(4))}):(0,i.jsx)("p",{className:"rounded-xl border border-amber-400/30 bg-amber-400/10 p-3 text-sm text-amber-200",children:"Extend Video is temporarily unavailable."})]}):"custom"===K?(0,i.jsxs)("div",{className:y,"data-video-mode":"custom",children:[eS,!t&&c?(0,i.jsx)("p",{className:"rounded-xl border border-white/10 bg-white/5 p-3 text-sm text-white/60",children:"Checking Custom Video availability…"}):t||u?t?null:h:(0,i.jsx)("p",{className:"rounded-xl border border-amber-400/30 bg-amber-400/10 p-3 text-sm text-amber-200",children:"Custom Video is temporarily unavailable."})]}):"long"===K?(0,i.jsxs)("div",{className:y,"data-video-mode":"long",children:[eS,t||g?t?null:x:(0,i.jsx)("p",{className:"rounded-xl border border-amber-400/30 bg-amber-400/10 p-3 text-sm text-amber-200",children:"Long Video is temporarily unavailable."})]}):(0,i.jsxs)("div",{className:y,"data-video-mode":"create",children:[eS,eg&&(0,i.jsx)(eH,{count:Y}),!a&&!n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(N,{label:"Type",value:(0,z.HE)(em),disabled:e,onClick:()=>L(!0)}),(0,i.jsx)(tl,{isOpen:U,selectedStyle:em,onClose:()=>L(!1),onSelect:J})]}),!t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(E.Yq,{name:"videoDuration",items:ev,label:"Duration",disabled:e}),n&&_.length>1&&(0,i.jsx)(E.Yq,{name:"animateQuality",items:_,label:"Quality",disabled:e})]}),!t&&!n&&ey.length>1&&(0,i.jsx)(E.Yq,{name:"videoSize",items:ey,label:"Quality",disabled:e})]})},tr=e=>"video"===e||"director"===e?"video":"image",to=new Set([F.KN.UNDRESS_UPPER,...Q.cZ?[]:[F.KN.ANIMATE_IMAGE],...Q.r?[]:[F.KN.VIDEO_DIRECTOR]]),tn=new Set(Q.Zx.map(({value:e})=>String(e))),td=new Set(Q.FR.map(({value:e})=>String(e))),tu=new Map([[F.KN.UNDRESS_UPPER,{defaultValues:{prompt:"",negativePrompt:"",outputType:"image"},uploadError:!0}],[F.KN.UNDRESS_FULL,{defaultValues:{prompt:"",negativePrompt:"",outputType:"image"},uploadError:!0}],[F.KN.UNDRESS_PRO,{defaultValues:{prompt:"",negativePrompt:"",outputType:"image"},uploadError:!0}],[F.KN.POSE_IMAGE,{defaultValues:{outputType:"image"},uploadError:!0}],[F.KN.EXTREME_IMAGE,{defaultValues:{outputType:"image"},uploadError:!0}],[F.KN.MODIFY_PRO,{defaultValues:{prompt:"",negativePrompt:"",outputType:"image"},uploadError:!0}],[F.KN.MODIFY_FAITHFUL,{defaultValues:{prompt:"",outputType:"image"},uploadError:!0}],[F.KN.FACE_SWAP,{defaultValues:{outputType:"image"},uploadError:!0,faceUploadError:!0}],[F.KN.SWAP_BODY,{defaultValues:{prompt:"",clothes:"nude",body:"auto",boobs:"auto",quality:"draft",outputType:"image"},uploadError:!0}],[F.KN.DEEP_FAKE,{defaultValues:{prompt:"",clothes:"nude",body:"auto",boobs:"auto",quality:"draft",outputType:"image"},uploadError:!0}],[F.KN.GENERATE,{defaultValues:{prompt:"",body:"auto",boobs:"auto",model:"epic",ratio:"threeToFour_realisticPorno",outputType:"image"},uploadError:!1}],[F.KN.IMAGE_TO_VIDEO,{defaultValues:{outputType:"video",videoStyle:"allposes:ultimate_list__cums",videoDuration:"3",videoSize:"448x672"},uploadError:!0}],[F.KN.VIDEO_DIRECTOR,{defaultValues:{outputType:"video",videoDirectorEngine:"cinematic",videoDirectorQuality:"normal",videoDirectorDuration:"3"},uploadError:!0}],[F.KN.DEEP_FAKE_VIDEO,{defaultValues:{outputType:"deepfake",videoStyle:"allposes:ultimate_list__cums",videoDuration:"5",animateQuality:"normal",videoSize:"512x512"},uploadError:!0,faceUploadError:!0}],[F.KN.ANIMATE_IMAGE,{defaultValues:{outputType:"deepfake"},uploadError:!0,faceUploadError:!0}]]),tc=()=>{var e,t;let a,o,n,d,u=(0,G.Of)(e=>e.uploadedImage),c=(0,G.Of)(e=>e.videoCrop),h=(0,G.Of)(e=>e.uploadedFaceImage),p=(0,G.Of)(e=>e.faceSelections),{setUploadImageError:g,setUploadSlotError:x,clearUploadSlotErrors:f,resetImage:b,resetFaceImage:v,setMode:y,setOutputType:N,setVideoCrop:S}=(0,G.lK)(),{mutate:j}=(0,U.useStartGenerationMutation)(),{mutate:M}=(a=(0,A.useGenerationQueueStore)(e=>e.addTask),o=(0,et.n)(e=>e.showToast),(0,J.n)({mutationKey:ea,mutationFn:Z,onMutate:e=>
2{let t=`extend-video-pending-${crypto.randomUUID()}`;return a({id:t,jobType:"VIDEO",sourceImageUrl:null,style:"extend-prompt",styleLabel:"Extend video",duration:Number(e.duration.replace("sec","")),startedAt:Date.now()}),A.useGenerationQueueStore.getState().selectTask(t),{optimisticId:t,navigationRevision:A.useGenerationQueueStore.getState().navigationRevision}},onSuccess:(e,t,i)=>{A.useGenerationQueueStore.getState().removeTask(i.optimisticId),a({id:e.requestId,jobType:"VIDEO",sourceImageUrl:null,style:"extend-prompt",styleLabel:"Extend video",duration:Number(t.duration.replace("sec","")),startedAt:Date.now()},{autoSelectIfNavigationRevision:i.navigationRevision})},onError:(e,t,a)=>{a&&A.useGenerationQueueStore.getState().updateTask(a.optimisticId,{status:"failed",error:e.message||"Could not start video extension.",completedAt:Date.now()}),o(e.message||"Could not start video extension.")}})),q=(0,et.n)(e=>e.showToast),B=(0,$.a)(),X=(()=>{let[e,t]=(0,s.useState)(k),[a,i]=(0,s.useState)(!0),[l,r]=(0,s.useState)(null),[o,n]=(0,s.useState)(null),[d,u]=(0,s.useState)(!1),[c,m]=(0,s.useState)(null),h=(0,A.useGenerationQueueStore)(e=>e.addTask),p=(0,A.useGenerationQueueStore)(e=>e.updateTask);(0,s.useEffect)(()=>{let e=!0;return(0,O.Wi)().then(a=>e&&t(a)).catch(()=>{}).finally(()=>e&&i(!1)),()=>{e=!1}},[]),(0,s.useEffect)(()=>{if(!o||l&&V.has(l.status))return;let e=window.setInterval(()=>{(0,O.EB)(o).then(e=>{r(e),((e,t)=>{let a,i=A.useGenerationQueueStore.getState(),l=(t?i.findTask(t):void 0)??(e.requestId?i.findTask(e.requestId):void 0);if(!l)return;let s="QUEUED"===(a=e.status)?"queued":"PROCESSING"===a?"processing":"COMPLETED"===a?"completed":"FAILED"===a?"failed":"cancelled",r=e.resultUrl||e.result?.videoUrl||e.result?.resultUrl,o=e.requestId&&e.requestId!==l.id?e.requestId:l.serverRequestId,n=r?{requestId:l.id,externalRequestId:o,videoUrl:r,resultUrl:r,mediaType:"VIDEO",generatedAt:new Date().toISOString(),format:"mp4",duration:l.duration,aspectRatio:"9:16"}:void 0;i.updateTask(l.id,{status:s,progress:"queued"===s?null:"completed"===s?100:Math.round(e.progress??0),queuePosition:e.queuePosition??null,canCancel:"queued"===s||"processing"===s,estimatedSecondsRemaining:e.estimatedSecondsRemaining??null,serverRequestId:o,...n?{result:n}:{},..."completed"===s?{seen:i.selectedTaskId===l.id}:{},..."failed"===s?{error:e.errorMessage||"Generation failed"}:{},...["completed","failed","cancelled"].includes(s)?{completedAt:Date.now()}:{}})})(e,o),V.has(e.status)&&(0,K.Dt)("video_director_completed",{flow_name:"video_director",request_id:o,status:e.status.toLowerCase()})}).catch(e=>m(String(e?.message??e)))},2e3);return()=>window.clearInterval(e)},[o,l]);let g=(0,s.useCallback)(async e=>{u(!0),m(null);let t="long"===e.engine?"Long video":"Custom video",a=`video-director-pending-${crypto.randomUUID()}`;h({id:a,jobType:"VIDEO",sourceImageUrl:e.imageUrl,style:"video-director",styleLabel:t,duration:e.duration,startedAt:Date.now()}),A.useGenerationQueueStore.getState().selectTask(a);let i=A.useGenerationQueueStore.getState().navigationRevision;(0,K.Dt)("video_director_submitted",{flow_name:"video_director",engine:e.engine,quality_tier:e.qualityTier,duration:e.duration});try{let l=await (0,O.QE)(e);n(l.requestId),A.useGenerationQueueStore.getState().removeTask(a),h({id:l.requestId,jobType:"VIDEO",sourceImageUrl:e.imageUrl,style:"video-director",styleLabel:t,duration:e.duration,startedAt:Date.now()},{autoSelectIfNavigationRevision:i});let s={requestId:l.requestId,status:l.status,progress:0};return r(s),A.useGenerationQueueStore.getState().updateTask(l.requestId,{status:"QUEUED"===l.status?"queued":"accepted",canCancel:!0}),l}catch(t){let e=String(t?.message??t);throw m(e),A.useGenerationQueueStore.getState().updateTask(a,{status:"failed",error:e,completedAt:Date.now()}),t}finally{u(!1)}},[h]),x=(0,s.useCallback)(async()=>{o&&(await (0,O.y4)(o),p(o,{status:"cancelled",canCancel:!1,completedAt:Date.now()}),r(e=>({...e??{requestId:o},status:"CANCELLED"})))},[o,p]);return{capabilities:e,isCapabilitiesPending:a,status:l,requestId:o,isSubmitting:d,error:c,submit:g,cancel:x}})(),ee=er.persistenceService.loadFormSettings(),ec=(0,R.RD)({generationTab:ee?.generationTab,mode:ee?.mode,outputType:ee?.outputType}),em=(e=ee?.generationTab,t=ec.generationTab,Q.r&&"director"===e?"video":"director"===t?"image":t),eh="poses"===em?"image":em,ep={image:F.KN.UNDRESS_FULL,poses:F.KN.POSE_IMAGE,control:F.KN.UNDRESS_FULL,video:F.KN.IMAGE_TO_VIDEO,deepfake:F.KN.DEEP_FAKE_VIDEO,director:F.KN.VIDEO_DIRECTOR},eg=ec.mode,ef=eg&&!to.has(eg)?eg:ep[eh],eb={generationTab:eh,mode:ef,outputType:tr(eh),prompt:ee?.prompt||"",negativePrompt:ee?.negativePrompt||"",clothes:ee?.clothes||"nude",body:ee?.body||"auto",boobs:ee?.boobs||"auto",quality:ee?.quality||"draft",model:ee?.model||"epic",ratio:ee?.ratio||"threeToFour_realisticPorno",generationMethod:ee?.generationMethod||"auto1",videoStyle:(0,z.ok)(ee?.videoStyle),videoDuration:ee?.videoDuration||"3",animateQuality:ee?.animateQuality==="hd"?"hd":"normal",deepFakeMode:ee?.deepFakeMode||"face_only",videoSize:ee?.videoSize==="512x768"?"512x768":"448x672",videoCrop:ee?.videoCrop||null,policyConfirmed:!0,videoMode:l.qK&&(ee?.generationTab==="director"||ee?.videoMode==="custom")?"custom"
2:ee?.videoMode==="long"?"long":l.V9&&ee?.videoMode==="extend"?"extend":"create",extendSourceType:"upload",extendSourceGenerationId:"",extendSourceVideoUrl:"",extendDuration:"3",extendQualityTier:"normal",extendPrompt:"",videoDirectorEngine:ee?.videoDirectorEngine==="turbo"?"turbo":ee?.videoDirectorEngine==="long"?"long":"cinematic",videoDirectorQuality:ee?.videoDirectorQuality==="hd"?"hd":"normal",videoDirectorDuration:String(ee?.videoDirectorDuration||"3"),videoDirectorPoseCount:String([..._].includes(n=Number(ee?.videoDirectorPoseCount))?n:3)},ev=(0,r.mN)({defaultValues:eb}),{field:ew}=(0,r.as)({control:ev.control,name:"mode"}),[ey,eN]=(0,s.useState)(ec.mode===F.KN.POSE_IMAGE||ec.mode===F.KN.EXTREME_IMAGE||"poses"===em?"poses":"generate"),eS=(0,s.useRef)(ec.mode===F.KN.POSE_IMAGE||ec.mode===F.KN.EXTREME_IMAGE?F.KN.GENERATE:ec.mode),eE=(0,eu.S)(e=>e.openRequest),ej=(0,ed.U)(e=>e.openRequest),ek=(0,ed.U)(e=>e.consumePrefill);(0,s.useEffect)(()=>{l.V9&&eE&&(ev.setValue("generationTab","video"),ev.setValue("mode",F.KN.IMAGE_TO_VIDEO),ev.setValue("outputType","video"),ev.setValue("videoMode","extend"))},[eE,ev]),(0,s.useEffect)(()=>{if(!ej)return;let{sourceImageUrl:e}=ej;if(B)en.a.getState().setGalleryImageUrl(e);else{let t=(0,es.getAiRuntimeStore)();t.uploadedImage=e,t.currentImage=e,t.undressedImage=null,(0,es.getVideoRuntimeStore)().setGeneratedImageSource(e)}ev.setValue("generationTab","video"),ev.setValue("mode",F.KN.IMAGE_TO_VIDEO),ev.setValue("outputType","video"),ev.setValue("videoMode","create"),ek()},[ek,ej,ev,B]),(0,s.useEffect)(()=>{(0,H.fZ)()&&(ev.setValue("generationTab","video"),ev.setValue("mode",F.KN.IMAGE_TO_VIDEO),ev.setValue("outputType","video"),ev.setValue("videoDuration","3"),ev.setValue("videoStyle",(0,z.ok)(void 0)))},[ev]);let eI=ev.watch("generationTab"),eT=ev.watch("videoMode")??"create",eD=ew.value,eC=eD===F.KN.GENERATE,eP=B&&"video"===eI&&(eD===F.KN.IMAGE_TO_VIDEO||eD===F.KN.VIDEO_DIRECTOR),eK=B&&("image"===eI&&eD===F.KN.POSE_IMAGE||"image"===eI&&eD===F.KN.MODIFY),eA=ev.watch("outputType")||"image",eV="video"===eI||"director"===eI,eR="video"===eI&&"custom"===eT,eF=!0===(d=X.capabilities).enabled&&I(d).length>0,eG="video"===eI&&"long"===eT,eL=eR||eG,eq="control"===eI,e$=(0,en.a)(e=>e.isPickerOpen),eY=(0,en.a)(e=>e.closePicker);(0,en.a)(e=>e.openPicker);let eQ=(0,en.a)(e=>e.galleryImageUrl),ez=(0,en.a)(e=>e.setGalleryImageUrl),eW=ev.watch("galleryImageUrl");(0,s.useEffect)(()=>{ev.setValue("galleryImageUrl",eQ??void 0,{shouldDirty:!0})},[eQ,ev]),(0,s.useEffect)(()=>{let e=ev.getValues("mode");if("poses"===eI){ev.setValue("generationTab","image"),ev.setValue("outputType","image"),ev.setValue("mode",F.KN.POSE_IMAGE);return}if("image"===eI){ev.setValue("outputType","image"),Q.FR.some(t=>t.value===e)||Q.Zx.some(t=>t.value===e)||e===F.KN.GENERATE||e===F.KN.MODIFY||ev.setValue("mode",F.KN.UNDRESS_FULL);return}"video"===eI?(ev.setValue("outputType","video"),ev.setValue("mode",("custom"===eT||"long"===eT)&&Q.r?F.KN.VIDEO_DIRECTOR:F.KN.IMAGE_TO_VIDEO)):"director"===eI?(ev.setValue("outputType","video"),ev.setValue("mode",F.KN.VIDEO_DIRECTOR)):"deepfake"===eI&&(ev.setValue("outputType","deepfake"),e===F.KN.DEEP_FAKE_VIDEO||Q.cZ&&e===F.KN.ANIMATE_IMAGE||ev.setValue("mode",F.KN.DEEP_FAKE_VIDEO))},[eI,eT,ev,B,eW]),(0,s.useEffect)(()=>{"long"!==eT||X.isCapabilitiesPending||eF||ev.setValue("videoMode","create")},[ev,eF,X.isCapabilitiesPending,eT]);let eH=(0,A.useGenerationQueueStore)(e=>e.composeNonce),eB=(0,s.useRef)(eH);(0,s.useEffect)(()=>{eB.current!==eH&&(ev.setValue("prompt","",{shouldDirty:!0}),ev.clearErrors("prompt")),eB.current=eH},[eH,ev]);let eX=(0,s.useRef)(!1);(0,s.useEffect)(()=>{eX.current||B&&"image"===eI&&(eX.current=!0,ev.setValue("mode",Q.Uq?F.KN.MODIFY:F.KN.GENERATE))},[B,eI,ev]);let eZ=(0,s.useRef)(!1);(0,s.useEffect)(()=>{eZ.current||B&&"video"===eI&&(eZ.current=!0,ev.setValue("mode",F.KN.IMAGE_TO_VIDEO))},[B,eI,ev]),(0,s.useEffect)(()=>y(eD),[eD,y]),(0,s.useEffect)(()=>N(eA),[eA,N]),(0,s.useEffect)(()=>{if(c)return;let e=eb.videoCrop??null;e&&S(e)},[eb.videoCrop,S,c]),(0,s.useEffect)(()=>{ev.setValue("videoCrop",c??null,{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1})},[ev,c]),(0,s.useEffect)(()=>{let e=ev.watch(e=>{er.persistenceService.saveFormSettings(e)});return()=>e.unsubscribe()},[ev]);let eJ=(0,s.useMemo)(()=>(0,Q.Mk)(B),[B]),e0=(0,s.useMemo)(()=>eJ.find(({value:e})=>e===F.KN.POSE_IMAGE),[eJ]),e1=(0,s.useMemo)(()=>eJ.filter(({value:e})=>e!==F.KN.POSE_IMAGE&&e!==F.KN.EXTREME_IMAGE),[eJ]),e2="poses"===ey,e4=eD===F.KN.EXTREME_IMAGE,{weight:e3}=Q.wK.get(eD)??{weight:0},e5=e4?Q.KU:eL?Q.iN:e2?3:eV?Q.lY:e3,{notAllowed:e6,checkIsAllowed:e8,hasVideoRewardPass:e7,openNotAllowedModal:e9}=(0,m.G)(e5),te="video"===eI&&!eL&&e7;(0,s.useEffect)(()=>
2{if("image"===eI){if(eD===F.KN.POSE_IMAGE||eD===F.KN.EXTREME_IMAGE)return void eN(e=>"poses"===e?e:"poses");eS.current=eD,eN(e=>"generate"===e?e:"generate")}},[eI,eD]),(0,s.useEffect)(()=>{if(eV)return;let e=eJ.find(({value:e})=>e===eD);if(e&&e8(e.weight))return;let t=eJ.find(({weight:e})=>e8(e));t&&t.value!==eD&&ev.setValue("mode",t.value)},[e8,ev,eI,eV,eD,eJ]);let{uploadError:tt,faceUploadError:ta}=tu.get(eD)??{},ti=(e=!1)=>{if(e)return void en.a.getState().openPicker();let t=document.querySelector("[data-source-canvas]");t?.scrollIntoView({behavior:"smooth",block:"center"}),t?.click()};return(0,i.jsx)(E.MG,{formContext:ev,onSuccess:e=>{var t;let a,i,s;if(!l.V9&&"extend"===e.videoMode||!l.qK&&("custom"===e.videoMode||"director"===e.generationTab)||!(()=>{if(eq&&!e8(Q.$K))return e9(Q.$K,"Control mode"),!1;if(e6&&!te)return e9(e5,String(eG?"Long video":eR?"Custom video":eV?"Video generation":eJ.find(({value:e})=>e===eD)?.label??"This mode")),!1;if("video"===eI&&"extend"===ev.getValues("videoMode")){try{(0,ei.P)(ev.getValues())}catch(e){return q(e instanceof Error?e.message:"Complete the Extend video settings."),!1}return!0}if(eL){if(eG){if(!ev.getValues("posePresetId"))return q("Please choose a starting pose."),!1}else if(!String(ev.getValues("prompt")??"").trim())return ev.setError("prompt",{type:"required",message:"Describe what should happen in the video."}),!1;return(B?!!ev.getValues("galleryImageUrl"):!!u)||(q(B?"Please choose a generated image first.":"Please upload an image first."),ti(B),!1)}let e=ev.getValues("mode"),t=String(ev.getValues("prompt")??"");if(t.length>2e3)return ev.setError("prompt",{type:"maxLength",message:"Prompt must be 2000 characters or fewer."}),!1;if(e===F.KN.GENERATE&&!t.trim())return ev.setError("prompt",{type:"required",message:"Please enter a prompt first."}),!1;if("image"===eI&&e===F.KN.POSE_IMAGE&&!ev.getValues("posePresetId")||"image"===eI&&e===F.KN.EXTREME_IMAGE&&!ev.getValues("extremePresetId"))return q("Please choose a pose first."),!1;if((e===F.KN.MODIFY_PRO||e===F.KN.MODIFY_FAITHFUL||e===F.KN.MODIFY)&&!t.trim())return ev.setError("prompt",{type:"required",message:"Please describe your edits first."}),!1;if(eP)return!!ev.getValues("galleryImageUrl")||(q("Please choose a generated image to animate."),ti(!0),!1);if(eK)return!!ev.getValues("galleryImageUrl")||(q("Please choose an image to modify."),ti(!0),!1);if("deepfake"===eI){var a;let e,t=(e=(a={mode:String(ev.getValues("mode")??""),hasCharacterImage:!!u,hasReferenceUpload:!!h}).mode===F.KN.ANIMATE_IMAGE,{character:a.hasCharacterImage?null:"Add a character photo — the person who will be animated.",reference:a.hasReferenceUpload?null:e?"Add a pose reference image — the pose to copy.":"Add a motion video — the movement to copy (MP4, WebM or MOV, up to 100MB)."});if(t.character||t.reference)return x("character",t.character),x("reference",t.reference),g(!0),ti(!1),!1;f()}let i=Q.eX&&eD===F.KN.FACE_SWAP&&(0,el.yf)(p).length>0;if(eD===F.KN.FACE_SWAP){let e=!u,t=!h&&!i;if(x("character",e?"Choose a target image first.":null),x("reference",t?"Choose a source face first.":null),e||t)return g(!0),q(e&&t?"Choose a target image and a source face first.":e?"Choose a target image first.":"Choose a source face first."),!1}return!ta||h||i?!tt||u||eD===F.KN.POSE_IMAGE&&eQ?!(0,W.O7)()||!!eC||!0===ev.getValues("policyConfirmed")||(q("Please confirm the upload policy before generating."),!1):(g(!0),ti(!1),!1):(g(!0),!1)})())return;if("video"===e.generationTab&&"extend"===e.videoMode){try{M((0,ei.P)(e))}catch(e){q(e instanceof Error?e.message:"Complete the Extend video settings.")}return}if("video"===e.generationTab&&"custom"===e.videoMode){let t="cinematic",a="hd"===e.videoDirectorQuality?"hd":"normal",i={imageUrl:String(B?e.galleryImageUrl??"":u??""),prompt:String(e.prompt??"").trim(),engine:t,qualityTier:a,duration:D(X.capabilities,t,e.videoDirectorDuration)},l=C(i,X.capabilities);return l?void q(l):void X.submit(i).catch(e=>{q(String(e?.message??"Could not start custom video."))})}if("video"===e.generationTab&&"long"===e.videoMode){let t={imageUrl:String(B?e.galleryImageUrl??"":u??""),presetId:String(e.posePresetId??"").trim(),engine:"long",qualityTier:"normal",duration:T(X.capabilities,e.videoDirectorDuration)},a=C(t,X.capabilities);return a?void q(a):void X.submit(t).catch(e=>{q(String(e?.message??"Could not start long video."))})}let r=(a="string"==typeof(t=e).rewriteMode?t.rewriteMode:void 0,i="string"==typeof t.mode?t.mode:void 0,s=a??i,"video"===t.generationTab&&("custom"===t.videoMode||"long"===t.videoMode)&&Q.r?F.KN.VIDEO_DIRECTOR:"video"===t.generationTab?F.KN.IMAGE_TO_VIDEO:"director"===t.generationTab?F.KN.VIDEO_DIRECTOR:"deepfake"===t.generationTab?Q.cZ&&i===F.KN.ANIMATE_IMAGE?F.KN.ANIMATE_IMAGE:F.KN.DEEP_FAKE_VIDEO:i===F.KN.UNDRESS_PRO?F.KN.UNDRESS_FULL:i===F.KN.MODIFY_PRO||i===F.KN.MODIFY_FAITHFUL||i===F.KN.POSE_IMAGE||i===F.KN.EXTREME_IMAGE?F.KN.MODIFY:i===F.KN.GENERATE||i===F.KN.MODIFY?F.KN.GENERATE:s&&tn.has(String(s))||s===F.KN.UNDRESS_FULL||s===F.KN.GENERATE||s&&td.has(String(s))?s:F.KN.UNDRESS_FULL),o=tr(e.generationTab),n="video"===e.generationTab||e.mode===F.KN.MODIFY||"image"===e.generationTab&&e.mode===F.KN.POSE_IMAGE,d=e.mode===F.KN.UNDRESS_PRO||e.mode===F.KN.MODIFY_PRO||e.mode===F.KN.MODIFY_FAITHFUL,m=e.mode===F.KN.MODIFY_PRO?Q.Wn:e.mode===F.KN.MODIFY_FAITHFUL?Q.ZR:Q.Fi,b="image"===e.generationTab&&e.mode===F.KN.POSE_IMAGE,v=e.mode===F.KN.EXTREME_IMAGE,w="video"===e.generationTab?(0,z.Hm)(e.videoStyle):void 0;
2j({...e,shareReferenceSample:eo.getState().shareReferenceSample,outputType:o,mode:r,...n?{}:{galleryImageUrl:void 0},...d?{workflow:m}:{},...b?{workflow:"img12",workflowKey:"img12",posePresetId:e.posePresetId,seed:Math.floor(0x100000000*Math.random())}:{},...v?{workflow:"img15",workflowKey:"img15",extremePresetId:e.extremePresetId,extremeSeed:Math.floor(0x100000000*Math.random())}:{},...w?{workflowKey:w}:{},..."video"===e.generationTab?{videoCrop:e.videoCrop??c??null}:{}}),eo.getState().resetShareReferenceSample()},children:(0,i.jsxs)("div",{className:"flex flex-col gap-6 relative justify-center max-w-screen w-full",children:[(0,i.jsx)("p",{className:"text-h4 hidden md:flex",children:"Settings"}),(0,i.jsx)(E.CH,{name:"generationTab",allowSelectionWhenLocked:!0,showLocks:!1,items:[{value:"image",label:"Image",weight:0},{value:"video",label:"Video",weight:Q.lY},...Q.Eg?[{value:"deepfake",label:"Animate",weight:Q.St}]:[]],className:"w-full [&_div]:!w-full [&_.inline-flex]:!h-[48px] [&_.inline-flex]:!w-full [&_button]:flex-1 [&_button]:!rounded-full [&_button]:focus-visible:ring-pM/60 [&_button]:focus-visible:ring-offset-0 [&_button[data-state=active]]:bg-pM [&_button[data-state=active]]:text-black",disabled:!1}),"image"===eI&&e0&&(0,i.jsx)(eM,{value:ey,onChange:e=>{let t="generate"===e&&eD===F.KN.FACE_SWAP,a="poses"===e?eD===F.KN.EXTREME_IMAGE?F.KN.EXTREME_IMAGE:F.KN.POSE_IMAGE:t?F.KN.UNDRESS_PRO:eS.current;"poses"===e&&e0&&!e8(e0.weight)?e9(e0.weight,"Poses"):(A.useGenerationQueueStore.getState().markNavigationIntent(),t&&(b(),v(),f(),eS.current=F.KN.UNDRESS_PRO),eN(e),ev.setValue("generationTab","image",{shouldDirty:!0}),ew.onChange(a),ev.clearErrors("mode"),y(a))}}),"image"===eI&&!e2&&(0,i.jsx)(L.j,{name:"mode",items:e1,label:"Mode",disabled:!1}),"image"===eI&&e2&&(0,i.jsx)(w,{}),"deepfake"===eI&&Q.cZ&&(0,i.jsx)(L.j,{name:"mode",items:Q.rB,label:"Mode",disabled:!1}),"image"===eI&&eD!==F.KN.FACE_SWAP&&!e2&&!e4&&(eD===F.KN.GENERATE||eD===F.KN.MODIFY?(0,i.jsx)(ex,{disabled:!1}):(0,i.jsx)(eU,{disabled:!1})),"video"===eI&&"create"===eT&&B&&(0,i.jsx)("div",{children:(0,i.jsx)(E.ML,{name:"prompt",placeholder:"Describe what to generate (optional)",weight:0,disabled:!1})}),("video"===eI||"deepfake"===eI)&&eD!==F.KN.ANIMATE_IMAGE&&(0,i.jsx)(ts,{disabled:!1,isDeepFakeMode:"deepfake"===eI,showCustom:"video"===eI&&Q.r,canCustom:"video"===eI&&Q.r&&X.capabilities.enabled,customCapabilityPending:X.isCapabilitiesPending,customControls:"video"===eI?(0,i.jsx)(P,{capabilities:X.capabilities}):null,showLong:"video"===eI&&eF,canLong:"video"===eI&&eF,longControls:"video"===eI?(0,i.jsx)(P,{capabilities:X.capabilities,engine:"long"}):null}),(0,i.jsx)(eO,{isSubmittingOverride:X.isSubmitting}),(0,i.jsx)(Y,{}),(B||eD===F.KN.POSE_IMAGE)&&(0,i.jsx)(e_,{isOpen:e$,onClose:eY,selectedImageUrl:eQ,context:"video"===eI?"video":"image",onSelect:e=>{ez(e),eY()}})]})})}},95727:(e,t,a)=>{a.d(t,{eC:()=>l,fZ:()=>s});let i="daily-wheel:use-video-pass",l=()=>{window.sessionStorage.setItem(i,"1")},s=()=>{let e="1"===window.sessionStorage.getItem(i);return e&&window.sessionStorage.removeItem(i),e}}}]);

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.