1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="4d9b6dc6-2513-5eec-b58b-5093677f791b")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58273,333797,e=>{"use strict";var t=e.i(809123);e.s(["Maximize2Icon",()=>t.default],58273);var s=e.i(456420);let a={name:"smartphone",size:24,node:[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]};a.node;let o=(0,s.default)(a);e.s(["SmartphoneIcon",0,o],333797)},24118,e=>{"use strict";var t=e.i(843476),s=e.i(88653),a=e.i(846932),o=e.i(931250),l=e.i(217255),r=e.i(522016),i=e.i(618566),n=e.i(271645),u=e.i(955130),c=e.i(486854),d=e.i(519455),m=e.i(327966),p=e.i(306419),x=e.i(758973),g=e.i(975157),h=e.i(769841),f=e.i(924645),j=e.i(438704),y=e.i(754491);let v={free:[`Start with ${h.signupCredits} free credits`,"Higher resolution outputs","Skip the queue when busy","Never lose your work","Advanced controls & features"],creator:[`${(12*p.creatorMonthlyFrames).toLocaleString()} credits per year`,`${p.creatorMaxLength}px exports`,"No watermark, commercial use","Priority queue + support"],pro:[`${(12*p.proMonthlyFrames).toLocaleString()} credits per year`,`${p.proMaxLength}px exports`,"No watermark, commercial use","Priority queue + support"],business:[`${(12*p.businessMonthlyFrames).toLocaleString()} credits per year`,`${p.businessMaxLength}px exports`,"No watermark, commercial use","Priority queue + support"]},N=["free","creator","pro","business"];function b(e,t){var s;let{data:a,status:o}=(0,l.useSession)(),r=(0,n.useContext)(c.PageToggleContext),i=(0,x.useSessionStorage)(),d=(s=t??null)?s.startsWith("/products/ai-voice-generator")?"/products/ai-voice-generator":s:null,m=a?.user.subscriptionTier,p=a?N.indexOf(m):-1,g=N[p+1],h=g?v[g]:null,[f,j]=(0,n.useState)(!1);(0,n.useEffect)(()=>{d&&"1"===i.getItem(`free-tool-cta:${d}`)&&j(!0)},[d,i]);let y=u.freeToolStatuses.isInProgress(e)&&(!a||"free"===m),[b,w]=(0,n.useState)(!1);y&&!b&&w(!0),(0,n.useEffect)(()=>{(e===u.freeToolStatuses.success||e===u.freeToolStatuses.outOfCredit)&&(j(!0),d&&i.setItem(`free-tool-cta:${d}`,"1"),r?.markGenerated())},[e,r,d,i]);let T=f||(r?.hasGeneratedAnything??!1);return{shouldShow:"loading"!==o&&!!(h&&g)&&(T||b),nextBenefit:g,benefitToShow:h}}e.s(["FreeToolCta",0,function({className:e,toolStatus:l}){let{open:n}=(0,f.useSignUpModal)(),u=(0,i.usePathname)(),{shouldShow:c,nextBenefit:p,benefitToShow:x}=b(l,u),h=c&&!!p&&!!x;if(!h)return null;let v="free"===p;return(0,t.jsx)(s.AnimatePresence,{children:h&&(0,t.jsx)(a.motion.div,{initial:{scale:.7,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.7,opacity:0},transition:{type:"spring",stiffness:150,damping:10},className:(0,g.cn)("relative block w-full max-w-2xl lg:max-w-72 lg:self-stretch",e),style:{minHeight:352},children:(0,t.jsxs)("div",{className:(0,g.cn)("h-full w-full self-stretch"),children:[(0,t.jsx)(y.VideoComponent,{preload:"none",assetPath:"products/get-full-access-cta-bg",muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 h-full w-full rounded-3xl object-cover opacity-70"}),(0,t.jsx)("div",{className:"bg-secondary absolute inset-0 rounded-3xl opacity-70"}),(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col justify-between p-4.5 lg:p-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)(m.TypographyH5,{weight:"semibold",className:`flex items-center gap-2 ${"business"===p?"text-lg lg:text-lg":""}`,children:[(0,t.jsx)(j.BoltIcon,{className:"text-foreground size-5"}),v?"Get Full Access":`Upgrade to ${p.charAt(0).toUpperCase()+p.slice(1)}`]}),(0,t.jsxs)(m.TypographyBody,{weight:"medium",children:[v?"Sign up":"Upgrade"," to gain full access to the tool and other benefits."]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:x.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.CircleCheckIcon,{className:"text-background/80 fill-secondary-foreground size-4"}),(0,t.jsx)(m.TypographyBody,{className:"text-secondary-foreground",children:e})]},e))})]}),v?(0,t.jsxs)(d.Button,{className:"from-secondary-foreground to-tertiary-foreground flex items-center justify-center gap-2 rounded-full bg-linear-to-r p-6 hover:opacity-85",onClick:()=>n({callbackUrl:u?.startsWith("/tools/")?u:void 0}),children:[(0,t.jsx)(j.BoltIcon,{className:"text-foreground size-4"}),(0,t.jsx)(m.TypographyBody,{weight:"semibold",children:"Sign Up for Free"})]}):(0,t.jsx)(d.Button,{asChild:!0,className:"from-secondary-foreground to-tertiary-foreground flex items-center justify-center rounded-full bg-linear-to-r p-6 hover:opacity-85",children:(0,t.jsxs)(r.default,{href:"/pricing",className:"flex items-center justify-center gap-2",children:[(0,t.jsx)(j.BoltIcon,{className:"text-foreground size-4"}),(0,t.jsx)(m.TypographyBody,{weight:"semibold",children:"Upgrade Now"})]})})]})]})},"cta")})},"useShouldShowCta",0,b])},539323,e=>{"use strict";var t=e.i(843476),s=e.i(975157);e.s(["ProductGlowWrapper",0,function({children:e,className:a}){return(0,t.jsxs)("div",{className:(0,s.cn)("relative w-full",a),children:[(0,t.jsx)("div",{className:"absolute -inset-2 -z-20 h-full rounded-4xl opacity-70 blur-2xl saturate-50",style:{backgroundImage:"linear-gradient(to right, var(--primary) 0%, var(--primary) 20%, var(--tertiary-foreground) 100%)"}}),(0,t.jsx)("div",{className:"bg-muted relative rounded-4xl",children:e})]})}])},758161,e=>{"use strict";var t=e.i(843476),s=e.i(784593),a=e.i(846932),o=e.i(39884),l=e.i(422411),r=e.i(422768),i=e.i(134623),n=e.i(762368),u=e.i(923388),c=e.i(386247),d=e.i(959482),m=e.i(675276),p=e.i(58273),x=e.i(411117),g=e.i(741120),h=e.i(333797),f=e.i(294735),j=e.i(263676),y=e.i(217255),v=e.i(522016),N=e.i(271645),b=e.i(653145),w=e.i(519455),T=e.i(323211),P=e.i(542450),S=e.i(737398),C=e.i(302747),F=e.i(987968),I=e.i(327966),z=e.i(542523),k=e.i(955130),B=e.i(451628),U=e.i(24118),M=e.i(777920),A=e.i(225282),$=e.i(717981),D=e.i(486854),R=e.i(539323),E=e.i(11378),V=e.i(488136),O=e.i(595527),G=e.i(34569),H=e.i(414877),q=e.i(550881),W=e.i(975157),L=e.i(134568),Y=e.i(215929),Q=e.i(367652),K=e.i(834118),X=e.i(438704),Z=e.i(754491);let J={image:"Image",video:"Video",audio:"Audio",gif:"GIF"},_=(0,N.createContext)(null);function ee(){let e=(0,N.useContext)(_);if(!e)throw Error("useProductPageFormTool must be used within ProductPageFormToolProvider");return e}function et(){let{viewMode:e}=ee();return"generating"!==e?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eu,{}),(0,t.jsx)(ec,{}),(0,t.jsx)(em,{}),(0,t.jsx)(ep,{}),(0,t.jsx)(ex,{})]})}function es(){let{viewMode:e,handleModeChange:s,outputUrls:a,outputAssetType:o}=ee();if(0===a.length)return null;let r=new Map;for(let e of a){let t=e.split("?")[0];if(!t)continue;let s=t.split("/").at(-2)??e;r.has(s)||r.set(s,e)}let i=Array.from(r.values()),n=32+(i.length-1)*8;return"audio"===o?(0,t.jsx)(w.Button,{variant:"outputs"===e?"contrast":"outline",type:"button",onClick:()=>s("upload"===e?"outputs":"upload"),className:"h-auto rounded-lg border-none p-1",children:(0,t.jsx)(l.AudioLines,{className:"size-4"})}):(0,t.jsx)(w.Button,{variant:"outputs"===e?"contrast":"outline",type:"button",className:"h-auto rounded-lg border-none p-1",onClick:()=>s("upload"===e?"outputs":"upload"),children:(0,t.jsx)("div",{className:"relative",style:{width:`${n}px`,height:"32px"},children:i.map((s,a)=>(0,t.jsx)("div",{className:(0,W.cn)("absolute top-0 left-0 aspect-square size-8 overflow-hidden rounded-md border","outputs"===e?"border-foreground":"border-transparent"),style:{zIndex:i.length-a,transform:a>0?`translateX(${8*a}px)`:void 0},children:"video"===o?(0,t.jsx)(Z.DirectVideo,{src:`${s}
1#t=0.001`,preload:"metadata",muted:!0,playsInline:!0,className:"size-full object-cover","aria-label":`Generated ${o} output ${a+1}`}):(0,t.jsx)("img",{src:s,alt:`Generated ${o} output ${a+1}`,className:"size-full object-cover"})},s))})})}function ea({prepareHandoff:e,toolName:s,toolPath:a,displayUnit:o,isToolAvailable:l=!0,className:r}){let{tool:i,outputAssetType:n,viewMode:u}=ee(),c=(0,H.useIsMobile)();return(0,t.jsxs)("div",{className:"relative inline-flex shrink-0",children:[(0,t.jsx)(E.ToolLimitProgress,{limit:i.limit,remaining:i.remaining,unit:o??n,className:(0,W.cn)(r,"outputs"===u&&(c?"h-12 w-full justify-between rounded-xl px-3":"h-10")),fitToSpace:!0,showChevron:"outputs"===u}),(0,t.jsx)(eo,{prepareHandoff:e,toolName:s,toolPath:a,isToolAvailable:l})]})}function eo({prepareHandoff:e,toolName:s,toolPath:o,isToolAvailable:l=!0}){let[r,i]=(0,N.useState)(!0),{tool:n}=ee(),{data:u}=(0,y.useSession)(),c=!!u?.user;return void 0!==n.remaining&&0===n.remaining&&r?(0,t.jsxs)(a.motion.div,{initial:{opacity:0,y:-16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.25},className:"bg-primary absolute bottom-12 left-0 z-10 flex w-80 flex-col gap-2 rounded-2xl p-6 shadow-xl sm:bottom-10 sm:left-1/3",children:[(0,t.jsx)(w.Button,{variant:"ghost",type:"button",className:"absolute top-2 right-2 h-max p-1! hover:opacity-80",onClick:()=>{i(!1)},"aria-label":"Close",children:(0,t.jsx)(j.X,{className:"text-foreground size-5"})}),(0,t.jsxs)(I.TypographyBody,{weight:"medium",className:"text-foreground",children:["You've reached your daily limit for the ",s," free tool."," ",c?"Switch to the full version in your dashboard to continue creating with your credits.":"Sign up to choose a plan and unlock full access."]}),(0,t.jsx)(w.Button,{variant:"contrast",asChild:!0,className:"w-full",children:(0,t.jsxs)(v.default,{className:"flex items-center justify-center gap-2",href:l?o:"/create",onNavigate:async t=>{if(e&&l){t.preventDefault();try{await e()}catch{}window.location.assign(o)}},children:[(0,t.jsx)(X.BoltIcon,{className:"text-background size-5"}),(0,t.jsx)(I.TypographyBody,{weight:"semibold",children:c?`Go to ${s}`:"Get Access"})]})}),(0,t.jsx)("div",{className:"bg-primary absolute -bottom-1.5 left-3.5 -z-5 size-4 rotate-45"})]}):null}function el({variant:e="contrast",className:s}){let{viewMode:a,handleModeChange:o,outputAssetType:l}=ee();if("outputs"!==a)return null;let r=J[l];return(0,t.jsxs)(w.Button,{type:"button",variant:e,"aria-label":`Create New ${r}`,onClick:()=>o("upload"),className:s,children:[(0,t.jsx)(i.CirclePlus,{className:"size-5"}),(0,t.jsx)("span",{className:"sm:hidden",children:"Create New"}),(0,t.jsxs)("span",{className:"hidden sm:inline",children:["Create New ",r]})]})}let er=[{value:"9:16",ratio:9/16,icon:h.SmartphoneIcon},{value:"1:1",ratio:1,icon:f.SquareIcon},{value:"16:9",ratio:16/9,icon:x.RectangleHorizontalIcon}];function ei(){let{viewMode:e,outputAssetType:s,outputUrls:a}=ee(),[o,l]=(0,N.useState)(null),r=a.at(-1);if("outputs"!==e||"video"!==s||!r)return null;let i=null===o?null:er.reduce((e,t)=>Math.abs(t.ratio-o)<Math.abs(e.ratio-o)?t:e);return(0,t.jsxs)("div",{className:"text-muted-foreground border-border flex h-10 shrink-0 items-center gap-1.5 rounded-xl border px-2.5 text-sm",children:[(0,t.jsx)(Z.DirectVideo,{src:`${r}#t=0.001`,preload:"metadata",muted:!0,className:"hidden",onLoadedMetadata:e=>{let t=e.currentTarget;t.videoHeight>0&&l(t.videoWidth/t.videoHeight)}}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.icon,{className:"size-4"}),(0,t.jsx)("span",{className:"text-foreground",children:i.value})]})]})}function en({children:e,className:s,footer:a}){let{mediaHeight:o}=ee(),l=void 0!==o?o-32*!!a:void 0;return(0,t.jsx)(C.Skeleton,{className:(0,W.cn)("bg-muted w-full rounded-4xl",a?"h-72":"h-80",s),style:void 0!==l?{height:l}:void 0,children:(0,t.jsxs)("div",{className:"flex size-full flex-col transition-all duration-300",children:[(0,t.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2",children:e}),a]})})}function eu(){let{tool:e}=ee();if(e.status!==k.freeToolStatuses.uploading)return null;let s=e.uploadingFile?.name??"your file",a=e.uploadingFile?.size??0,o=e.uploadedBytes??0,l=e.uploadSpeed??0,r=Math.round(o/a*100),i=e.uploadRetryReason;return(0,t.jsxs)(en,{className:"text-warning",children:[(0,t.jsx)(F.Spinner,{className:"size-10"}),(0,t.jsx)(I.TypographyBodyDashboard,{children:"Uploading"}),(0,t.jsx)("div",{className:"space-y-1 text-center",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(I.TypographyCaption,{children:[i," â retrying upload of ",s]}),(0,t.jsx)(I.TypographyCaption,{children:"We'll keep retrying automatically. Check your connection."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(I.TypographyCaption,{className:"",children:["Uploading ",s]}),(0,t.jsxs)(I.TypographyCaption,{className:"",children:[r,"% (",(0,G.formatBytes)(o,0
1),"/",(0,G.formatBytes)(a,0),")"," ",`${(0,G.formatBytes)(l,0)}/s`]})]})})]})}function ec(){let{tool:e,outputAssetType:s}=ee();if((0,N.useEffect)(()=>{if(e.status!==k.freeToolStatuses.queued)return;let t=setTimeout(()=>{(0,L.trackEvent)({eventName:"freeToolsStuckAtQueued",action:"view"})},1e4);return()=>clearTimeout(t)},[e.status]),e.status!==k.freeToolStatuses.queued)return null;let a=e.startTaskRetryReason;return(0,t.jsxs)(en,{className:"text-warning",footer:a?void 0:(0,t.jsx)(K.QueueUpsellRow,{hideForPaidTier:!0,withSeparator:!0}),children:[(0,t.jsx)(F.Spinner,{className:"size-10"}),(0,t.jsx)(I.TypographyBodyDashboard,{children:a?"Retrying your generation":"Adding to Queue"}),(0,t.jsx)("div",{className:"space-y-1 text-center",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(I.TypographyCaption,{children:[a,". We'll keep trying automatically."]}),(0,t.jsx)(I.TypographyCaption,{children:"Your inputs are kept."})]}):(0,t.jsxs)(I.TypographyCaption,{className:"",children:["Your ",s," is being added to the queue."]})})]})}function ed(e,s,a){if(0===e)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{children:"You're up next! ð"}),(0,t.jsxs)("p",{children:["Get ready â your ",s," will start generating soon."]})]});let o=e?e*a:null,l=null;if(o){var r;let e,t=Math.floor(o/3600),s=Math.floor(o%3600/60);r=o%60,e=[],t>0&&e.push(`${t}h`),s>0&&e.push(`${s}m`),r>0&&e.push(`${r}s`),l=e.join(" ")}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{children:["There ",1===e?"is":"are"," ",e," ",1===e?"person":"people"," ahead of you."]}),l&&(0,t.jsxs)("p",{children:["Your estimated wait time is ",l,"."]})]})}function em(){let{tool:e,outputAssetType:s,generationEtaSeconds:a}=ee(),{position:o}=e;if(e.status!==k.freeToolStatuses.pending)return null;let l=ed(o,s,a);return(0,t.jsxs)(en,{className:"text-warning",footer:(0,t.jsx)(K.QueueUpsellRow,{hideForPaidTier:!0,withSeparator:!0}),children:[(0,t.jsx)(F.Spinner,{className:"size-10"}),(0,t.jsx)(I.TypographyBodyDashboard,{children:"Queued"}),(0,t.jsx)("div",{className:"space-y-1 text-center",children:(0,t.jsx)(I.TypographyCaption,{className:"",children:l})})]})}function ep(){let{tool:e,outputAssetType:s,generationEtaSeconds:a}=ee();return e.status!==k.freeToolStatuses.starting?null:(0,t.jsxs)(en,{className:"text-secondary-foreground",footer:(0,t.jsx)(K.QueueUpsellRow,{hideForPaidTier:!0,withSeparator:!0}),children:[(0,t.jsx)(F.Spinner,{className:"size-10"}),(0,t.jsx)(I.TypographyBodyDashboard,{children:"Rendering"}),(0,t.jsxs)("div",{className:"space-y-1 text-center",children:[(0,t.jsxs)(I.TypographyCaption,{className:"",children:["Your ",s," is generating."]}),(0,t.jsxs)(I.TypographyCaption,{className:"",children:["This should take about ",a,"s"]})]})]})}function ex(){let{tool:e,handleModeChange:s,mediaHeight:a}=ee();return!1===k.freeToolStatuses.isError(e.status)?null:(0,t.jsxs)("div",{className:(0,W.cn)("bg-muted relative flex h-80 w-full flex-col items-center justify-center rounded-4xl p-5"),style:a?{height:a}:void 0,children:[(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3",children:[(0,t.jsx)(r.CircleAlert,{size:32,className:"text-destructive"}),(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,t.jsx)(I.TypographyBodyDashboard,{className:"text-destructive",children:"Error"}),(0,t.jsx)(I.TypographyCaption,{className:"text-destructive",children:e.error??"An unknown error occurred. Please try again."})]})]}),(0,t.jsxs)(w.Button,{onClick:()=>{s("upload"),e.reset()},variant:"ghost",className:"dark:hover:bg-accent absolute bottom-2 flex items-center justify-center gap-2 p-5 transition-colors",size:"sm",children:[(0,t.jsx)(g.RefreshCw,{className:"text-background bg-foreground size-6 rounded-full p-1"}),(0,t.jsx)(I.TypographyBody,{weight:"semibold",children:"Try Again"})]})]})}e.s(["ProductPageFormContent",0,function({children:e,className:s,style:a,disableInProgressScroll:o=!1,disableGlow:l=!1,...r}){let i=(0,H.useIsMobile)(),n=(0,N.useRef)(null),{tool:u}=ee(),c=u.status===k.freeToolStatuses.queued||u.status===k.freeToolStatuses.pending||u.status===k.freeToolStatuses.starting,d=a&&c?{...a,minHeight:void 0}:a;return(0,N.useEffect)(()=>
1{if(i&&!o&&k.freeToolStatuses.isInProgress(u.status)){let e=D.pageToggleRef.current??n.current;e?.scrollIntoView({behavior:"smooth",block:"start"})}},[u.status,i,o]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{...r,className:"flex w-full flex-1 flex-col-reverse items-center justify-center gap-6 lg:flex-row",children:[(0,t.jsx)(U.FreeToolCta,{toolStatus:u.status}),(0,t.jsx)("div",{ref:n,style:d,className:(0,W.cn)("bg-muted flex w-full min-w-0 flex-col items-start justify-center gap-4 rounded-xl p-4 sm:w-md md:w-2xl",s),children:l?(0,t.jsxs)(t.Fragment,{children:[e,(0,t.jsx)(et,{})]}):(0,t.jsxs)(R.ProductGlowWrapper,{children:[e,(0,t.jsx)(et,{})]})})]}),(0,t.jsx)(O.HideIntercomUntilScroll,{})]})},"ProductPageFormCreateAnotherButton",0,el,"ProductPageFormGeneratingView",0,et,"ProductPageFormMenuBar",0,function({className:e,alwaysShowMenu:s=!1,...a}){let{viewMode:o}=ee();return"generating"!==o||s?(0,t.jsx)("div",{className:(0,W.cn)("bg-card flex h-full w-full flex-col rounded-lg p-3",e),...a}):null},"ProductPageFormMenuBarBottomBar",0,function({prepareHandoff:e,className:s,children:a,toolName:o,toolPath:l,displayUnit:r,alwaysShowSeparator:i=!1,isToolAvailable:u=!0,hideViewModeToggle:c=!1,hideToolLimit:d=!1,toolLimitClassName:m,...p}){let{viewMode:x,outputUrls:g,outputAssetType:h}=ee(),f=(0,H.useIsMobile)();return(0,t.jsxs)("div",{"data-tool-limit-row":!0,className:(0,W.cn)("flex w-full min-w-0 flex-wrap items-center gap-2","outputs"===x&&f&&"flex-col items-stretch",s),...p,children:[(0,t.jsxs)("div",{className:(0,W.cn)("flex h-full flex-wrap items-center gap-2","outputs"===x&&f&&"w-full flex-col items-stretch gap-3"),children:[!d&&(0,t.jsx)(ea,{prepareHandoff:e,toolName:o,toolPath:l,displayUnit:r,isToolAvailable:u,className:m}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!c&&(0,t.jsx)(es,{}),(0,t.jsx)(ei,{})]})]}),i&&!f&&(0,t.jsx)("div",{className:"bg-border my-auto h-4 w-0.5 rounded-full"}),"outputs"===x&&g.length>1&&(0,t.jsxs)(t.Fragment,{children:[!i&&(0,t.jsx)("div",{className:"bg-border my-auto h-4 w-0.5 rounded-full"}),(0,t.jsxs)(w.Button,{variant:"outline",type:"button",className:"hidden h-auto border-none md:flex",onClick:()=>{(0,B.downloadFilesAsZip)(g,h,o)},children:[(0,t.jsx)(n.Download,{className:"size-4"}),"Download All"]})]}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1",children:a})]})},"ProductPageFormMenuBarSubmit",0,function({className:e,children:s,hideCreateAnother:a=!1,createAnotherClassName:o,...l}){return(0,t.jsxs)("div",{className:(0,W.cn)("ml-auto flex h-full items-end",e),...l,children:[s,!a&&(0,t.jsx)(el,{className:o})]})},"ProductPageFormMenuBarToolLimit",0,ea,"ProductPageFormOutOfCreditModal",0,function({emptyAssetTitle:e,toolName:s,signUpBenefits:a,signedInToolPath:o,prepareHandoff:l}){let{tool:r,outputAssetType:i,outputAssets:n}=ee(),u=n.at(-1),c=u?.assetType??i;return"video-to-audio"===s&&(c="video"),(0,t.jsx)($.OutOfCreditModalV2,{status:r.status,handleClose:()=>{r.reset()},toolName:s,assetUrls:u?[u.url]:(r.files?.map(e=>e.url)??[]).slice(-1),emptyAssetTitle:e,assetType:c,signUpBenefits:a,remaining:r.remaining,secondsToReset:r.secondsToReset,signedInToolPath:o,prepareHandoff:l})},"ProductPageFormOutputView",0,function({children:e}){let{viewMode:s}=ee();return"outputs"!==s?null:(0,t.jsx)(t.Fragment,{children:e})},"ProductPageFormOutputs",0,function({downloadEventName:e,variant:a="compact"}){let{outputUrls:l,viewMode:r,outputAssetType:i,tool:n,mediaHeight:x,handleModeChange:g}=ee(),h=(0,H.useIsMobile)()&&"video"===i,{open:f}=(0,Q.useFullscreenImageModal)(),[j,y]=(0,N.useState)();if("outputs"!==r||0===l.length)return null;let v=[...l].reverse(),b=()=>{(0,L.trackEvent)({eventName:e,action:"click"})};return(0,t.jsx)("div",{className:"flex h-full w-full items-center",children:(0,t.jsxs)(T.Carousel,{setApi:y,opts:{align:"center",loop:!1,dragFree:!0},className:"w-full",plugins:[(0,s.WheelGesturesPlugin)()],children:[(0,t.jsx)(T.CarouselContent,{className:"items-center",children:v.map((s,l)=>(0,t.jsx)(T.CarouselItem,{children:(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:(0,W.cn)("bg-background relative flex h-80 items-center justify-center overflow-hidden rounded-md",h&&"h-auto"),style:x&&!h?{height:x}:void 0,children:[(0,t.jsxs)("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:[("image"===i||"gif"===i)&&(0,t.jsx)(Q.FullscreenImageTrigger,{className:"bg-accent/50! size-8 rounded-full backdrop-blur-lg",urls:v,toolName:n?.name,selectedIdx:l,onNavigate:e=>j?.scrollTo(e),onDownload:b,isFreeToolOutput:!0}),"image"!==i&&"video"!==i&&(0,t.jsx)(w.Button,{variant:"outline",size:"icon",type:"button",className:"bg-accent/50! rounded-full border-none backdrop-blur-lg","aria-label":"Download",onClick:()=>{b(),(0,B.downloadFile)({freeToolDownloadUrl:s,toolName:n?.name})},children:(0,t.jsx)(u.DownloadIcon,{className:"size-4"})})]}),"video"===i&&(0,t.jsx)(Z.DirectVideo,{preload:"metadata",src:`${s}#t=0.001`,controls:!0,className:(0,W.cn)("size-full object-contain",h&&"h-auto"),style:h?{maxHeight:"70vh"}:void 0}),"audio"===i&&(0,t.jsx)(Y.AudioPlayer,{audioFile:s,isOutput:!0,trackDownloadEvent:()=>{b(),(0,B.downloadFile)({freeToolDownloadUrl:s,toolName:n?.name})}}),("image"===i||"gif"===i)&&(0,t.jsx)("img",{src:s,alt:`Generated ${i} output`,className:"size-full cursor-pointer object-contain",onClick:()=>f({urls:v,toolName:n?.name,selectedIdx:l,onNavigate:e=>j?.scrollTo(e),onDownload:b,isFreeToolOutput:!0})})]}),"video"===i&&(0,t.jsx)(V.VideoChainingActions,{videoUrl:s,onDownload:()=>{(0,L.trackEvent)({eventName:e,action:"click"}),(0,B.downloadFile)({freeToolDownloadUrl:s,toolName:n?.name})},onCreateNew:()=>g("upload")}),"image"===i&&"compact"===a&&(0,t.jsxs)("div",{className:"mb-2 flex w-full items-center gap-3 px-3 md:gap-4",children:[(0,t.jsxs)(w.Button,{size:"sm",type:"button",onClick:()=>{b(),(0,B.downloadFile)({freeToolDownloadUrl:s,toolName:n?.name})},children:[(0,t.jsx)(u.DownloadIcon,{className:"size-4"}),"Download"]}),(0,t.jsx)(A.UpscaleButton,{variant:"link",className:"text-foreground h-fit p-0!",size:"sm",imageUrl:s,icon:(0,t.jsx)(p.Maximize2Icon,{strokeWidth:3,className:"size-4"})}),(0,t.jsx)(A.EditImageButton,{variant:"link",className:"text-foreground h-fit p-0!",size:"sm",imageUrl:s,icon:(0,t.jsx)(m.ImageUp
1Icon,{strokeWidth:3,className:"size-4"})}),(0,t.jsx)(A.ImageToVideoButton,{variant:"link",className:"text-foreground hidden h-fit p-0! sm:flex",size:"sm",imageUrl:s,icon:(0,t.jsx)(d.ImagePlayIcon,{className:"size-4"})}),(0,t.jsxs)(S.Popover,{children:[(0,t.jsx)(S.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(w.Button,{variant:"ghost",type:"button",className:"text-foreground h-fit p-0! sm:hidden",children:(0,t.jsx)(c.Ellipsis,{className:"size-5"})})}),(0,t.jsx)(S.PopoverContent,{className:"z-10 w-48 p-2",align:"start",children:(0,t.jsx)(A.ImageToVideoButton,{variant:"link",className:"text-foreground h-fit p-0!",size:"sm",imageUrl:s,icon:(0,t.jsx)(d.ImagePlayIcon,{className:"size-4"})})})]})]}),"image"===i&&"prominent"===a&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 pb-2",children:[(0,t.jsxs)(w.Button,{size:"lg",type:"button",className:"w-full text-sm",onClick:()=>{b(),(0,B.downloadFile)({freeToolDownloadUrl:s,toolName:n?.name})},children:[(0,t.jsx)("span",{className:"bg-foreground rounded-full p-0.5",children:(0,t.jsx)(o.ArrowDownIcon,{strokeWidth:3,className:"text-background size-3"})}),"Download"]}),(0,t.jsxs)("div",{className:"flex w-full gap-1 md:gap-2",children:[(0,t.jsx)(A.UpscaleButton,{size:"lg",className:"bg-muted hover:bg-accent flex-1 border px-2! text-xs md:text-sm",imageUrl:s,icon:(0,t.jsx)(p.Maximize2Icon,{className:"size-4"})}),(0,t.jsx)(A.EditImageButton,{size:"lg",className:"bg-muted hover:bg-accent flex-1 border px-2! text-xs md:text-sm",imageUrl:s,icon:(0,t.jsx)(m.ImageUpIcon,{className:"size-4"})}),(0,t.jsx)(A.ImageToVideoButton,{size:"lg",className:"bg-muted hover:bg-accent flex-1 border px-2! text-xs md:text-sm",imageUrl:s,icon:(0,t.jsx)(d.ImagePlayIcon,{className:"size-4"}),label:"Animate Image"})]})]})]})},s))}),(0,t.jsx)(T.CarouselPrevious,{hideUnavailable:!0,className:"left-4 z-20"}),(0,t.jsx)(T.CarouselNext,{hideUnavailable:!0,className:"right-4 z-20"})]})})},"ProductPageFormPromptInput",0,function({name:e="prompt",disabled:s,fieldClassName:a,className:o,alwaysShowInput:l=!1,...r}){let{form:i}=ee(),n=s??i.formState.isSubmitting,{viewMode:u}=ee(),c=(0,N.useRef)(null),d=(0,H.useIsMobile)(),{errors:m}=(0,b.useFormState)({control:i.control,name:e}),p=m[e];return"upload"===u||l?(0,t.jsxs)(P.Field,{ref:c,className:a,children:[(0,t.jsx)(z.PromptInput,{...i.register(e),shouldValidate:!0,"aria-invalid":!!p,className:(0,W.cn)("h-24 border-none bg-transparent p-0.5",o),disabled:n,onFocus:()=>{d&&c.current&&requestAnimationFrame(()=>{c.current?.scrollIntoView({behavior:"smooth",block:"center"})})},...r}),(0,t.jsx)(P.FieldError,{errors:[p]})]}):null},"ProductPageFormProviderV2",0,function({children:e,tool:s,form:a,outputAssetType:o,generationEtaSeconds:l,mediaHeight:r,scrollOnClick:i=!0,className:n}){let u=(0,M.useFreeToolState)(s.name,s.toolKey);(0,M.usePreserveState)(s.name,a,o,s,s.toolKey);let[c,d]=(0,N.useState)("upload"),[m,p]=(0,N.useState)(u.outputs??[]),x=(0,N.useMemo)(()=>m.map(e=>e.url),[m]),[g,h]=(0,N.useState)(s.status),[f,j]=(0,N.useState)(m.length>0||void 0!==s.status),[y,v]=(0,N.useState)(k.freeToolStatuses.isInProgress(s.status)?null:x.at(-1)??null),b=(0,H.useIsMobile)();if((0,q.useScrollToFirstFieldError)(a),g!==s.status){if(!f&&s.status&&j(!0),s.status===k.freeToolStatuses.success&&s.files){let e=s.files.map(e=>e.url),t=e.length>0?e:s.outputPath??[];p(e=>{let s=t.filter(t=>!e.some(e=>e.url===t)),a=s.at(-1);return a&&v(a),s.length>0?[...e,...s.map(e=>({url:e,assetType:o}))]:e}),d("outputs")}y&&k.freeToolStatuses.isInProgress(s.status)&&!k.freeToolStatuses.isInProgress(g)&&v(null),h(s.status)}let w=k.freeToolStatuses.isInProgress(s.status),T=k.freeToolStatuses.isError(s.status);return(0,t.jsx)(_.Provider,{value:{viewMode:w||T?"generating":c,tool:s,form:a,handleModeChange:function(e){d(e)},outputUrls:x,outputAssets:m,addOutputUrl:function(e){p(t=>[...t,{url:e,assetType:o}])},replaceOutputUrl:function(e){p(e?[{url:e,assetType:o}]:[]),v(e??null)},outputAssetType:o,generationEtaSeconds:l,hasGenerated:f,selectedSrc:y,setSelectedSrc:v,mediaHeight:r},children:(0,t.jsx)("div",{className:(0,W.cn)("flex flex-1 scroll-mt-16 flex-col items-center justify-center gap-6",n),onClick:()=>{i&&b&&0===window.scrollY&&setTimeout(()=>{(0,D.scrollToAndPinToggle)()},200)},children:(0,t.jsx)(Q.FullscreenImageModalProvider,{children:e})})})},"ProductPageFormSubmitButton",0,function({children:e,...s}){let{viewMode:a,form:o,tool:l}=ee(),r=o.formState.isSubmitting||0===l.remaining;return"upload"!==a?null:(0,t.jsx)(w.Button,{type:"submit",disabled:r,...s,children:e})},"ProductPageFormUploadOnly",0,function({children:e}){let{viewMode:s}=ee();return"upload"!==s?null:(0,t.jsx)(t.Fragment,{children:e})},"ProductPageFormUploadView",0,function({children:e}){let{viewMode:s}=ee();return"upload"!==s?null:(0,t.jsx)(t.Fragment,{children:e})},"getStatusMessage",0,ed,"useProductPageFormTool",0,ee])}]); 2 3//# chunkId=4d9b6dc6-2513-5eec-b58b-5093677f791b
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.