1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,928106,e=>{"use strict";let t="generator:use-prompt";e.s(["dispatchGeneratorPrompt",0,function(e){window.dispatchEvent(new CustomEvent(t,{detail:e}))},"generatorPromptEvent",0,t])},319341,e=>{"use strict";e.i(612902);var t=e.i(504556),a=e.i(928106),i=e.i(975157),r=e.i(255734);let o=(0,e.i(767507).default)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);var s=e.i(720517),n=e.i(739699),l=e.i(72459),d=e.i(487486),c=e.i(519455),m=e.i(750813),u=e.i(251763),p=e.i(424806),p=p,x=e.i(760345),g=e.i(678094),h=e.i(119221),f=e.i(469784);function v({selected:e,onClose:r}){let b=(0,s.useTranslations)("Common"),w=(0,s.useTranslations)("HomePage.examples"),y=(0,s.useTranslations)("Generator.tabs"),[j,k]=(0,l.useState)(!1);if(!e)return null;let{example:N,type:_}=e,C=async()=>{try{await navigator.clipboard.writeText(N.prompt),f.toast.success(w("promptCopied"))}catch(e){console.error("Copy failed:",e),f.toast.error(w("copyFailed"))}};return(0,t.jsx)(m.ResponsiveModal,{open:!0,onOpenChange:r,children:(0,t.jsxs)(m.ResponsiveModalContent,{className:"max-w-[95vw] w-[95vw] lg:max-w-[90vw] lg:w-[90vw] xl:max-w-[1200px] h-[85dvh] p-0 gap-0 overflow-hidden grid-rows-[minmax(0,1fr)]",mobileClassName:"p-0",children:[(0,t.jsx)(m.ResponsiveModalTitle,{className:"sr-only",children:w("modalTitle")}),(0,t.jsxs)("div",{className:"flex flex-1 min-h-0 flex-col overflow-y-auto lg:grid lg:grid-cols-[minmax(0,1fr)_minmax(300px,28%)] lg:h-full lg:overflow-hidden",children:[(0,t.jsxs)("div",{className:"relative h-[50dvh] shrink-0 lg:h-full lg:shrink lg:min-h-0 bg-black/5 dark:bg-black/20 p-4 lg:p-6 flex items-center justify-center lg:overflow-hidden",children:[(0,t.jsx)(m.ResponsiveModalClose,{asChild:!0,children:(0,t.jsx)(c.Button,{type:"button",size:"icon",variant:"secondary",className:"absolute top-3 end-3 z-10 size-9 rounded-full opacity-90 shadow-sm md:hidden","aria-label":w("modalTitle"),children:(0,t.jsx)(h.X,{className:"size-5"})})}),"video"===_?(0,t.jsx)("div",{"data-vaul-no-drag":!0,className:"relative w-full h-full bg-black rounded-lg overflow-hidden",children:(0,t.jsx)("video",{src:N.src,controls:!0,autoPlay:!0,playsInline:!0,"data-vaul-no-drag":!0,className:"absolute inset-0 w-full h-full object-contain",children:(0,t.jsx)("track",{kind:"captions",src:"/captions/empty.vtt",srcLang:"en",label:b("noCaptions")})})}):(0,t.jsx)("div",{className:"relative w-full h-full",children:(0,t.jsx)(n.default,{src:N.src,alt:N.prompt,fill:!0,className:"object-contain rounded-lg",sizes:"(max-width: 1024px) 100vw, 60vw",priority:!0})})]}),(0,t.jsx)("div",{className:"lg:min-h-0 border-t lg:border-t-0 lg:border-s lg:overflow-y-auto",children:(0,t.jsxs)("div",{className:"p-4 lg:p-6 space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:w("promptLabel")}),(0,t.jsxs)("div",{className:"overflow-hidden rounded-md bg-muted/50",children:[(0,t.jsx)("div",{className:(0,i.cn)("overflow-y-auto p-3",j?"max-h-none":"max-h-[240px]"),children:(0,t.jsx)("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:N.prompt})}),N.prompt.length>300&&(0,t.jsx)("button",{type:"button",onClick:()=>k(e=>!e),className:"flex w-full cursor-pointer items-center justify-center gap-1 border-t border-border/60 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.default,{className:"size-3.5"}),w("collapsePrompt")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.ChevronDown,{className:"size-3.5"}),w("expandPrompt")]})})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(d.Badge,{variant:"outline",children:y("video"===_?"video":"image")}),N.model&&(0,t.jsxs)(d.Badge,{variant:"outline",children:[(0,t.jsx)(g.Sparkles,{className:"size-3 me-1"}),N.model]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 pt-2",children:[(0,t.jsxs)(c.Button,{onClick:()=>{r(),window.setTimeout(()=>{(0,a.dispatchGeneratorPrompt)({prompt:N.prompt,type:_}),document.getElementById("generator")?.scrollIntoView({behavior:"smooth"})},300)},variant:"default",children:[(0,t.jsx)(o,{className:"size-4 me-2"}),w("tryPrompt")]}),(0,t.jsxs)(c.Button,{onClick:C,variant:"outline",children:[(0,t.jsx)(x.Copy,{className:"size-4 me-2"}),w("copyPrompt")]})]})]})})]})]})})}let b="image";function w({example:e,type:a,onSelect:i,onTry:r}){let l=(0,s.useTranslations)("HomePage.examples"),d=e.prompt.replace(/\s+/g," ").slice(0,80);return(0,t.jsxs)("article",{className:"group relative mb-4 block w-full break-inside-avoid overflow-hidden rounded-2xl border border-border/60 bg-muted/30 shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:border-primary/30 hover:shadow-lg focus-within:border-primary/40 focu
1s-within:ring-2 focus-within:ring-ring motion-reduce:transition-none motion-reduce:hover:translate-y-0",style:{aspectRatio:e.aspectRatio},children:[(0,t.jsxs)("button",{type:"button",onClick:i,className:"group/media absolute inset-0 block size-full cursor-pointer focus-visible:outline-none","aria-label":`${l("modalTitle")}: ${d}`,children:["image"===a?(0,t.jsx)(n.default,{src:e.src,alt:e.prompt.slice(0,80),fill:!0,sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw",className:"object-cover transition-transform duration-300 group-hover/media:scale-105"}):(0,t.jsx)(y,{src:e.src,poster:e.poster,alt:e.prompt.slice(0,80)}),(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-t from-black/75 via-black/5 to-black/10"})]}),(0,t.jsxs)("button",{type:"button",onClick:r,"aria-label":`${l("tryPrompt")}: ${d}`,className:"absolute end-3 bottom-3 z-10 flex h-11 max-w-[calc(100%-1.5rem)] cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-full border border-white/15 bg-black/70 px-4 text-sm font-semibold text-white shadow-[0_10px_30px_-12px_rgba(0,0,0,0.75)] backdrop-blur-md transition-[opacity,transform,background-color] duration-200 hover:bg-black/85 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-black motion-reduce:transition-none [@media(hover:hover)]:pointer-events-none [@media(hover:hover)]:h-10 [@media(hover:hover)]:translate-y-2 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-focus-within:pointer-events-auto [@media(hover:hover)]:group-focus-within:translate-y-0 [@media(hover:hover)]:group-focus-within:opacity-100 [@media(hover:hover)]:group-hover:pointer-events-auto [@media(hover:hover)]:group-hover:translate-y-0 [@media(hover:hover)]:group-hover:opacity-100",children:[(0,t.jsx)(o,{className:"size-4 text-primary","aria-hidden":"true"}),l("tryPrompt")]})]})}function y({src:e,poster:a,alt:i}){let o=(0,s.useTranslations)("Common"),[d,c]=(0,l.useState)(!1);return(0,t.jsxs)("div",{className:"absolute inset-0",onMouseEnter:()=>{window.matchMedia("(prefers-reduced-motion: reduce)").matches||c(!0)},onMouseLeave:()=>c(!1),children:[a?(0,t.jsx)(n.default,{src:a,alt:i,fill:!0,sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw",className:"object-cover"}):(0,t.jsx)("div",{className:"absolute inset-0 bg-muted"}),d&&(0,t.jsx)("video",{src:e,preload:"none",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 h-full w-full object-cover",children:(0,t.jsx)("track",{kind:"captions",src:"/captions/empty.vtt",srcLang:"en",label:o("noCaptions")})}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center transition-opacity duration-300 group-hover/media:opacity-0",children:(0,t.jsx)("div",{className:"flex size-14 items-center justify-center rounded-full bg-black/40 backdrop-blur-sm",children:(0,t.jsx)(r.Play,{className:"ms-1 size-7 text-white",fill:"currentColor"})})})]})}e.s(["ExamplesGallery",0,function({images:e,videos:r}){let o=(0,s.useTranslations)("HomePage.examples"),n=["image","video"].filter(t=>("image"===t?e:r).length>0),[d,c]=(0,l.useState)(()=>n.includes(b)?b:n[0]??b),[m,u]=(0,l.useState)(null),p="image"===d?e:r;return(0,t.jsxs)("div",{children:[n.length>1&&(0,t.jsx)("div",{className:"mb-8 flex items-center justify-center gap-2",children:n.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>c(e),className:(0,i.cn)("cursor-pointer rounded-full border px-5 py-2 text-sm font-medium transition-colors",d===e?"border-primary bg-primary text-primary-foreground":"border-border bg-background text-muted-foreground hover:bg-accent hover:text-foreground"),children:"image"===e?o("tabImages"):o("tabVideos")},e))}),(0,t.jsx)("div",{className:"columns-1 gap-4 sm:columns-2 lg:columns-3",children:p.map(e=>(0,t.jsx)(w,{example:e,type:d,onSelect:()=>u({example:e,type:d}),onTry:()=>{(0,a.dispatchGeneratorPrompt)({prompt:e.prompt,type:d}),document.getElementById("generator")?.scrollIntoView({behavior:"smooth"})}},e.id))}),(0,t.jsx)(v,{selected:m,onClose:()=>u(null)},m?.example.id??"closed")]})}],319341)},26345,e=>{"use strict";var t=e.i(504556),a=e.i(975157);function i({id:e,title:r,titleAs:o="h2",titleClassName:s,subtitle:n,subtitleAs:l="p",subtitleClassName:d,description:c,descriptionAs:m="p",descriptionClassName:u,className:p,children:x}){return(0,t.jsxs)("div",{id:e,className:(0,a.cn)("flex flex-col items-center text-center gap-4",p),children:[r?(0,t.jsx)(o,{className:(0,a.cn)("uppercase tracking-wider text-gradient_indigo-purple font-semibold font-mono",s),children:r}):null,n?(0,t.jsx)(l,{className:(0,a.cn)("text-balance text-2xl text-foreground",d),children:n}):null,c?(0,t.jsx)(m,{className:(0,a.cn)("text-balance text-lg text-muted-foreground",u),children:c}):null,x]})}var r=e.i(273443),o=e.i(514520),s=e.i(720517);e.s(["default",0,function(){(0,o.useLocale)();let e=(0,s.useTranslations)("HomePage.faqs"),a=[{id:"item-1",icon:"sparkles",question:e("items.item-1.question"),answer:e("items.item-1.answer")},{id:"item-2",icon:"layers",question:e("items.item-2.question"),answer:e("items.item-2.answer")},{id:"item-3",icon:"scale",question:e("items.item-3.question"),answer:e("items.item-3.answer")},{id:"item-4",icon:"languages",question:e("items.item-4.question"),answer:e("items.item-4.answer")},{id:"item-5",icon:"image",question:e("items.item-5.question"),answer:e("items.item-5.answer")},{id:"item-6",icon:"shield-check",question:e("items.item-6.question"),answer:e("items.item-6.answer")},{id:"item-7",icon:"zap",question:e("items.item-7.question"),answer:e("items.item-7.answer")},{id:"item-8",icon:"key",question:e("items.item-8.question"),answer:e("items.item-8.answer")},{id:"item-9",icon:"wallet",question:e("items.item-9.question"),answer:e("items.item-9.answer")},{id:"item-10",icon:"rocket",question:e("items.item-10.question"),answer:e("items.item-10.answer")}];return(0,t.jsx)("section",{id:"faqs",className:"px-4 py-16",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,t.jsx)(i,{title:e("title"),titleAs:"h2",subt
1itle:e("subtitle"),subtitleAs:"p"}),(0,t.jsx)("div",{className:"mx-auto max-w-4xl mt-12",children:(0,t.jsx)(r.Accordion,{type:"single",collapsible:!0,className:"ring-muted w-full rounded-2xl border px-8 py-3 shadow-sm ring-4 dark:ring-0",children:a.map(e=>(0,t.jsxs)(r.AccordionItem,{value:e.id,className:"border-dashed",children:[(0,t.jsx)(r.AccordionTrigger,{className:"cursor-pointer text-base hover:no-underline",children:e.question}),(0,t.jsx)(r.AccordionContent,{children:(0,t.jsx)("p",{className:"text-base text-muted-foreground",children:e.answer})})]},e.id))})})]})})}],26345)},997167,e=>{e.v({grid2Columns:"tweet-media-module__7ceLga__grid2Columns",grid2x2:"tweet-media-module__7ceLga__grid2x2",grid3:"tweet-media-module__7ceLga__grid3",image:"tweet-media-module__7ceLga__image",mediaContainer:"tweet-media-module__7ceLga__mediaContainer",mediaLink:"tweet-media-module__7ceLga__mediaLink",mediaWrapper:"tweet-media-module__7ceLga__mediaWrapper",root:"tweet-media-module__7ceLga__root",rounded:"tweet-media-module__7ceLga__rounded",skeleton:"tweet-media-module__7ceLga__skeleton"})},516956,e=>{e.v({anchor:"tweet-media-video-module__wQX1Ra__anchor",videoButton:"tweet-media-video-module__wQX1Ra__videoButton",videoButtonIcon:"tweet-media-video-module__wQX1Ra__videoButtonIcon",viewReplies:"tweet-media-video-module__wQX1Ra__viewReplies",watchOnTwitter:"tweet-media-video-module__wQX1Ra__watchOnTwitter"})},153278,e=>{"use strict";var t=e.i(504556),a=e.i(72459),i=e.i(7284),r=e.i(997167),o=e.i(516956);e.s(["TweetMediaVideo",0,({tweet:e,media:s})=>{let n,l,d,[c,m]=(0,a.useState)(!0),[u,p]=(0,a.useState)(!1),[x,g]=(0,a.useState)(!1),h=(n=(e=>{let{variants:t}=e.video_info;return t.filter(e=>"video/mp4"===e.content_type).sort((e,t)=>{var a,i;return(null!=(a=t.bitrate)?a:0)-(null!=(i=e.bitrate)?i:0)})})(s)).length>1?n[1]:n[0],f=0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("video",{className:r.default.image,poster:(d=(l=new URL(s.media_url_https)).pathname.split(".").pop())?(l.pathname=l.pathname.replace(`.${d}`,""),l.searchParams.set("format",d),l.searchParams.set("name","small"),l.toString()):s.media_url_https,controls:!c,playsInline:!0,preload:"none",tabIndex:c?-1:0,onPlay:()=>{f&&window.clearTimeout(f),u||p(!0),x&&g(!1)},onPause:()=>{f&&window.clearTimeout(f),f=window.setTimeout(()=>{u&&p(!1),f=0},100)},onEnded:()=>{g(!0)},children:(0,t.jsx)("source",{src:h.url,type:h.content_type})}),c&&(0,t.jsx)("button",{type:"button",className:o.default.videoButton,"aria-label":"View video on X",onClick:e=>{let t=e.currentTarget.previousSibling;e.preventDefault(),m(!1),t.load(),t.play().then(()=>{p(!0),t.focus()}).catch(e=>{console.error("Error playing video:",e),m(!0),p(!1)})},children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:o.default.videoButtonIcon,"aria-hidden":"true",children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M21 12L4 2v20l17-10z"})})})}),!u&&!x&&(0,t.jsx)("div",{className:o.default.watchOnTwitter,children:(0,t.jsx)("a",{href:e.url,className:o.default.anchor,target:"_blank",rel:"noopener noreferrer",children:c?"Watch on X":"Continue watching on X"})}),x&&(0,t.jsx)("a",{href:e.url,className:(0,i.default)(o.default.anchor,o.default.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})}],153278)},769652,e=>{e.v({actions:"tweet-actions-module__6zcDNW__actions",copy:"tweet-actions-module__6zcDNW__copy",copyIcon:"tweet-actions-module__6zcDNW__copyIcon",copyIconWrapper:"tweet-actions-module__6zcDNW__copyIconWrapper",copyText:"tweet-actions-module__6zcDNW__copyText",like:"tweet-actions-module__6zcDNW__like",likeCount:"tweet-actions-module__6zcDNW__likeCount",likeIcon:"tweet-actions-module__6zcDNW__likeIcon",likeIconWrapper:"tweet-actions-module__6zcDNW__likeIconWrapper",reply:"tweet-actions-module__6zcDNW__reply",replyIcon:"tweet-actions-module__6zcDNW__replyIcon",replyIconWrapper:"tweet-actions-module__6zcDNW__replyIconWrapper",replyText:"tweet-actions-module__6zcDNW__replyText"})},7724,e=>{"use strict";var t=e.i(504556),a=e.i(72459),i=e.i(769652);e.s(["TweetActionsCopy",0,({tweet:e})=>{let[r,o]=(0,a.useState)(!1);return(0,a.useEffect)(()=>
1{if(r){let e=setTimeout(()=>{o(!1)},6e3);return()=>clearTimeout(e)}},[r]),(0,t.jsxs)("button",{type:"button",className:i.default.copy,"aria-label":"Copy link",onClick:()=>{navigator.clipboard.writeText(e.url),o(!0)},children:[(0,t.jsx)("div",{className:i.default.copyIconWrapper,children:r?(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:i.default.copyIcon,"aria-hidden":"true",children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:i.default.copyIcon,"aria-hidden":"true",children:(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),(0,t.jsx)("span",{className:i.default.copyText,children:r?"Copied!":"Copy link"})]})}])},412149,e=>{e.v({article:"quoted-tweet-container-module__FeoKrW__article",root:"quoted-tweet-container-module__FeoKrW__root"})},612183,e=>{"use strict";var t=e.i(504556),a=e.i(412149);e.s(["QuotedTweetContainer",0,({tweet:e,children:i})=>(0,t.jsx)("div",{className:a.default.root,onClick:t=>{t.preventDefault(),window.open(e.url,"_blank")},children:(0,t.jsx)("article",{className:a.default.article,children:i})})])},18502,e=>{"use strict";var t=e.i(504556),a=e.i(496995),i=e.i(413266),r=e.i(920932),o=e.i(515288),s=e.i(776639),n=e.i(755146),l=e.i(650535),d=e.i(337822),c=e.i(772436),m=e.i(699375),u=e.i(677572),p=e.i(624687),x=e.i(671775),g=e.i(72459);let h={image:3e3,video:5e3};var f=e.i(133713),v=e.i(520133),b=e.i(396164),w=e.i(880068),y=e.i(342244),j=e.i(310200),k=e.i(320755),N=e.i(928106),_=e.i(929244),C=e.i(970843),S=e.i(975157),z=e.i(414336),I=e.i(77607),M=e.i(243658),T=e.i(776808),L=e.i(251763),R=e.i(289341),P=e.i(881434),E=e.i(860071),D=e.i(180226),F=e.i(255734),A=e.i(724961),q=e.i(374340),V=e.i(767507);let U=(0,V.default)("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);var B=e.i(678094),W=e.i(119221),O=e.i(720517),$=e.i(739699),G=e.i(337178),Q=e.i(469784),H=e.i(242126),K=e.i(984746),X=e.i(841259),J=e.i(519455),Y=e.i(443682),Z=e.i(596932);let ee=(0,V.default)("Expand",[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16.2V21h-4.8",key:"1hrera"}],["path",{d:"M21 7.8V3h-4.8",key:"ul1q53"}],["path",{d:"M3 16.2V21h4.8",key:"1x04uo"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 7.8V3h4.8",key:"1ijppm"}],["path",{d:"M9 9 3 3",key:"v551iv"}]]);var et=e.i(356781),ea=e.i(45277),ei=e.i(915651);function er({task:e,creation:a,onOpenModal:i,onRetry:r,onDismiss:s}){let n=(0,O.useTranslations)("Generator.preview"),l=(0,x.useAiErrorMessage)(),d=(0,ei.useDurationText)(),[c,m]=(0,g.useState)(!1),u=(0,g.useRef)(null);(0,g.useEffect)(()=>{u.current?.scrollIntoView({block:"nearest",behavior:"smooth"})},[]);let p=a?.status??"running",h="failed"===p,f="success"===p&&!!a?.resultUrl,{w:v,h:b}=function(e,t){let a=/^(\d+):(\d+)$/.exec(e.trim());if(!a)return t;let i=Number(a[1]),r=Number(a[2]);return i&&r?{w:i,h:r}:t}(e.aspectRatio,"image"===e.type?{w:1,h:1}:{w:16,h:9}),w=a?.generationElapsedMs?d(a.generationElapsedMs/1e3):null,y=async()=>{if(c)return;m(!0);let t=(0,Y.downloadViaProxy)({taskId:e.taskId},`${e.type}-${e.taskId}.${(0,Y.resolveExtension)(e.type)}`);Q.toast.promise(t,{loading:n("downloading"),success:n("downloadStarted"),error:n("downloadFailed")});try{await t}catch(e){console.error("Download failed:",e)}finally{m(!1)}};return(0,t.jsxs)(o.Card,{ref:u,className:(0,S.cn)("relative overflow-hidden rounded-3xl border border-border/60 p-4 sm:p-5","bg-gradient-to-b from-background/70 to-background/40 backdrop-blur-md","shadow-[0_8px_40px_-12px_rgba(0,0,0,0.12)]","dark:from-card/40 dark:to-card/10 dark:border-border/30"),children:[(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":n("dismiss"),className:"absolute top-3 end-3 z-10 flex size-8 cursor-pointer items-center justify-center rounded-full bg-background/70 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-accent hover:text-foreground",children:(0,t.jsx)(W.X,{className:"size-4"})}),(0,t.jsx)("div",{className:(0,S.cn)("relative mx-auto w-full overflow-hidden rounded-2xl",f&&"video"===e.type?"bg-black":"bg-muted/40"),style:{aspectRatio:`${v} / ${b}`,maxWidth:`min(100%, calc(min(60vh, 480px) * ${v/b}))`},children:f&&a?.resultUrl?"video"===e.type?(0,t.jsx)("video",{src:a.resultUrl,controls:!0,autoPlay:!0,muted:!0,playsInl
1ine:!0,className:"absolute inset-0 size-full object-contain"}):(0,t.jsx)($.default,{src:a.resultUrl,alt:e.prompt,fill:!0,className:"object-contain",sizes:"(max-width: 768px) 100vw, 768px"}):h?(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 p-4 text-center",children:[(0,t.jsx)(ea.XCircle,{className:"size-8 text-destructive"}),(0,t.jsx)("p",{className:"text-sm font-medium",children:n("failedTitle")}),(0,t.jsx)("p",{className:"max-w-md text-xs text-muted-foreground",children:l(a?.errorCode)})]}):(0,t.jsx)(ei.GenerationProgress,{type:e.type,startedAt:e.startedAt,estimatedSeconds:e.estimatedSeconds,className:"absolute inset-0"})}),f&&a&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-center gap-2",children:[(0,t.jsxs)(J.Button,{type:"button",variant:"default",size:"sm",onClick:()=>i(a),children:[(0,t.jsx)(ee,{className:"size-4"}),n("view")]}),(0,t.jsxs)(J.Button,{type:"button",variant:"outline",size:"sm",onClick:y,disabled:c,children:[c?(0,t.jsx)(D.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(Z.Download,{className:"size-4"}),n("download")]}),w&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:n("doneIn",{time:w})})]}),h&&(0,t.jsx)("div",{className:"mt-3 flex justify-center",children:(0,t.jsxs)(J.Button,{type:"button",variant:"outline",size:"sm",onClick:r,children:[(0,t.jsx)(et.RotateCcw,{className:"size-4"}),n("tryAgain")]})})]})}let eo={"1:1":"w-5 h-5","4:3":"w-5 h-4","3:4":"w-4 h-5","16:9":"w-6 h-3.5","9:16":"w-3.5 h-6","3:2":"w-6 h-4","2:3":"w-4 h-6","5:4":"w-5 h-4","4:5":"w-4 h-5","21:9":"w-7 h-3","1:4":"w-1.5 h-6","1:8":"w-1 h-7","4:1":"w-6 h-1.5","8:1":"w-7 h-1",auto:"w-5 h-5 border-dashed"};function es(e,t){let a=(0,j.getModelConfig)(t,e);return{imageSize:a?.limits.allowedImageSizes?.[0]??"1:1",resolution:a?.limits.allowedResolutions?.[0]??"1K",outputFormat:a?.limits.allowedOutputFormats?.[0]??"png",imageQuality:a?.limits.allowedImageQualities?.[0]??"basic"}}var en=e.i(194158),el=e.i(643262),ed=e.i(471150),ec=e.i(9494),em=e.i(910306),eu=e.i(209440),ep=e.i(972888),ex=e.i(588764);let eg="hero-generator-prompt",eh="hero-generator:pending-generate";function ef(){try{sessionStorage.removeItem(eh)}catch{}}let ev=(0,S.cn)("inline-flex items-center gap-2 h-10 rounded-full px-5 font-semibold text-sm","text-primary-foreground cursor-pointer","bg-gradient-to-r from-primary via-amber-400 to-rose-400","bg-[length:200%_100%] [animation:gradient_8s_linear_infinite]","shadow-[0_4px_24px_-6px_oklch(0.72_0.16_55/0.5)]","hover:shadow-[0_6px_28px_-4px_oklch(0.72_0.16_55/0.65)]","transition-shadow","disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none");function eb({value:e,icon:a,children:i}){return(0,t.jsxs)(u.TabsTrigger,{value:e,className:(0,S.cn)("group h-8 cursor-pointer gap-2 rounded-full border border-transparent px-4 text-muted-foreground","transition-all","data-[state=active]:bg-gradient-to-r data-[state=active]:from-primary/20 data-[state=active]:to-primary/5","data-[state=active]:border-primary/50 data-[state=active]:text-primary","data-[state=active]:shadow-[inset_0_0_20px_-8px_oklch(0.72_0.16_55/0.5),0_0_24px_-8px_oklch(0.72_0.16_55/0.4)]"),children:[a,(0,t.jsx)("span",{className:"font-medium",children:i})]})}function ew({trigger:e,disabled:a,children:i}){return(0,t.jsxs)(n.DropdownMenu,{children:[(0,t.jsx)(n.DropdownMenuTrigger,{asChild:!0,disabled:a,children:(0,t.jsxs)("button",{type:"button",className:ey,children:[e,(0,t.jsx)(L.ChevronDown,{className:"size-3.5 text-muted-foreground"})]})}),(0,t.jsx)(n.DropdownMenuContent,{className:"min-w-[180px]",align:"start",children:i})]})}let ey=(0,S.cn)("inline-flex items-center gap-1.5 h-9 rounded-full px-3 text-sm cursor-pointer","border border-border/60 bg-background/70 backdrop-blur-sm","transition-colors hover:bg-background hover:border-border","dark:bg-white/5 dark:hover:bg-white/10 dark:border-border/30","disabled:opacity-50 disabled:cursor-not-allowed");function ej({active:e,disabled:a,onSelect:i,icon:r,children:o,rich:s}){return(0,t.jsxs)(n.DropdownMenuItem,{disabled:a,onSelect:()=>i(),className:(0,S.cn)("cursor-pointer",e&&"bg-accent/50",s&&"items-start py-2"),children:[r&&(0,t.jsx)("span",{className:"me-1.5",children:r}),o]})}function ek({values:e,maxFrames:a,required:i,uploading:r,disabled:o,label:s,slotLabels:n,onPick:l,onPickAssets:d,assetsLabel:c,onRemove:m,onPreview:u}){let p=(0,O.useTranslations)("Common"),x=(0,O.useTranslations)("Generator.hero"),g=e.length<a&&a>0,h=0===e.length,f=a>1;return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[e.map((e,a)=>(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,t.jsxs)("div",{className:"relative group size-12 sm:size-14 shrink-0 overflow-hidden rounded-lg border border-border/50 bg-muted",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u(e),className:"absolute inset-0 z-0 cursor-zoom-in transition-transform hover:scale-[1.04]","aria-label":x("previewItem",{label:s,n:a+1}),children:(0,t.jsx)($.default,{src:e,alt:`${s} ${a+1}`,fill:!0,className:"object-cover pointer-events-none",sizes:"56px"})}),!o&&(0,t.jsx)("button",{type:"button",onClick:e=>
1{e.stopPropagation(),m(a)},className:"absolute -end-1 -top-1 z-10 inline-flex size-4 cursor-pointer items-center justify-center rounded-full bg-foreground text-background shadow opacity-0 transition-opacity group-hover:opacity-100","aria-label":p("remove"),children:(0,t.jsx)(W.X,{className:"size-2.5"})})]}),n?.[a]&&(0,t.jsx)("span",{className:"text-[10px] leading-none text-muted-foreground",children:n[a]})]},`${e}-${a}`)),g&&(0,t.jsx)("button",{type:"button",onClick:l,disabled:o||r,className:(0,S.cn)("shrink-0 inline-flex cursor-pointer items-center justify-center size-12 sm:size-14 rounded-lg border border-dashed text-muted-foreground transition-colors","hover:border-primary/60 hover:text-primary hover:bg-accent/40",h&&i&&"border-primary/50 text-primary",(o||r)&&"cursor-not-allowed opacity-60","dark:bg-white/5"),"aria-label":s,title:s,children:r?(0,t.jsx)(D.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(A.Plus,{className:"size-4"})}),g&&d&&(0,t.jsxs)("button",{type:"button",onClick:d,disabled:o||r,className:(0,S.cn)("shrink-0 inline-flex cursor-pointer flex-col items-center justify-center gap-0.5 size-12 sm:size-14 rounded-lg border border-dashed text-muted-foreground transition-colors","hover:border-primary/60 hover:text-primary hover:bg-accent/40",(o||r)&&"cursor-not-allowed opacity-60","dark:bg-white/5"),"aria-label":c,title:c,children:[(0,t.jsx)(P.FolderOpen,{className:"size-4"}),(0,t.jsx)("span",{className:"text-[10px] leading-none",children:c})]}),g&&n?.[e.length]&&(0,t.jsx)("span",{className:"-ms-1 text-[10px] leading-none text-muted-foreground",children:n[e.length]}),f&&(0,t.jsxs)("span",{className:(0,S.cn)("ms-1 text-xs tabular-nums text-muted-foreground",e.length>=a&&"text-primary"),title:x("maxImagesHint",{max:a}),children:[e.length," / ",a]})]})}function eN({label:e,disabled:a,isImageTab:i,schema:r,getVideoBinding:o,getImageBinding:s,blockedValues:n,t:l}){let c=(0,O.useTranslations)("Common");return(0,t.jsxs)(d.Popover,{children:[(0,t.jsx)(d.PopoverTrigger,{asChild:!0,disabled:a,children:(0,t.jsxs)("button",{type:"button",className:ey,"aria-label":c("settings"),children:[(0,t.jsx)(U,{className:"size-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex items-center gap-2 text-foreground/90",children:e.map((e,a)=>(0,t.jsxs)(g.Fragment,{children:[a>0&&(0,t.jsx)("span",{"aria-hidden":!0,className:"h-3 w-px bg-border dark:bg-white/15"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[e.ratio&&(0,t.jsx)(eI,{value:e.ratio}),e.text]})]},`${a}-${e.text}`))}),(0,t.jsx)(L.ChevronDown,{className:"size-3.5 text-muted-foreground"})]})}),(0,t.jsxs)(d.PopoverContent,{className:"w-[340px] max-w-[calc(100vw-1.5rem)] p-4 space-y-4",align:"start",children:[0===r.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:l("hero.noQuickParams")}),r.map(e=>{let a=l(e.labelKey);if("static"===e.type)return(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-xl bg-muted/50 px-3 py-2.5 dark:bg-white/[0.04]",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,t.jsx)("span",{className:"text-sm font-medium tabular-nums text-foreground/80",children:e.staticValue})]},e.key);let[r,d]=i?s(e.key):o(e.key),c=e.options??[];if("slider"===e.type&&e.slider){let i=n?.[e.key],o=!!i&&!!e.slider.values?.length&&e.slider.values.every(e=>i.has(String(e)));return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,t.jsx)(ed.RangeSlider,{id:`hero-${e.key}`,value:Number(r),onChange:d,min:e.slider.min,max:e.slider.max,step:e.slider.step,values:e.slider.values,unit:e.slider.unit,disabled:o,className:"rounded-xl bg-muted/50 px-3 py-2.5 dark:bg-white/[0.04]"})]},e.key)}return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,t.jsx)("div",{className:(0,S.cn)("grid gap-1 rounded-xl bg-muted/50 p-1.5 dark:bg-white/[0.04]","button-group-string"===e.type?2===c.length?"grid-cols-2":"grid-cols-3":"grid-cols-5"),children:c.map(a=>{let o=a.value,s=String(r)===String(o),c=n?.[e.key]?.has(String(o))??!1;return(0,t.jsxs)("button",{type:"button",disabled:c,onClick:()=>{c||(i?d(String(o)):"button-group-number"===e.type?d(Number(o)):d(String(o)))},className:(0,S.cn)("flex cursor-pointer flex-col items-center justify-center gap-1 rounded-lg px-2 py-2 text-xs font-medium transition-all",!s&&"text-muted-foreground hover:bg-background/70 hover:text-foreground",s&&"bg-primary/10 text-primary shadow-sm ring-1 ring-primary/50",c&&"cursor-not-allowed opacity-40 hover:bg-transparent hover:text-muted-foreground"),title:c?l("hero.blockedByAspectRatio"):void 0,children:["icon"in a&&a.icon&&(0,t.jsx)("div",{className:"flex h-5 items-center justify-center",children:(0,t.jsx)("div",{className:(0,S.cn)(a.icon,"border-2 border-current roun
1ded-sm")})}),(0,t.jsx)("span",{children:(0,H.isAutoAspectRatio)(String(a.value))?l("common.auto"):a.label})]},String(o))})})]},e.key)})]})]})}function e_({disabled:e,empty:a,isImageTab:i,schema:r,getVideoSwitchBinding:o,getImageBinding:s,t:n,tHero:l}){return(0,t.jsxs)(d.Popover,{children:[(0,t.jsx)(d.PopoverTrigger,{asChild:!0,disabled:e,children:(0,t.jsx)("button",{type:"button",className:(0,S.cn)(ey,"px-2.5"),"aria-label":l("advancedLabel"),children:(0,t.jsx)(q.Settings2,{className:"size-4 text-muted-foreground"})})}),(0,t.jsx)(d.PopoverContent,{className:"w-[280px] p-4 space-y-4",align:"end",children:a||0===r.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:l("advancedEmpty")}):r.map(e=>{let a=n(e.labelKey);if("switch"===e.type){let[i,r]=o(e.key);return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:a}),(0,t.jsx)(m.Switch,{checked:i,onCheckedChange:r})]},e.key)}if(!i)return null;let[r,l]=s(e.key);return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground",children:a}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 rounded-xl bg-muted/50 p-1.5 dark:bg-white/[0.04]",children:(e.options??[]).map(e=>{let a=e.value,i=String(r)===String(a);return(0,t.jsx)("button",{type:"button",onClick:()=>l(a),className:(0,S.cn)("cursor-pointer rounded-lg px-3 py-1.5 text-xs font-medium transition-all",!i&&"text-muted-foreground hover:bg-background/70 hover:text-foreground",i&&"bg-primary/10 text-primary shadow-sm ring-1 ring-primary/50"),children:"labelKey"in e&&e.labelKey?n(e.labelKey):e.label},a)})})]},e.key)})})]})}function eC({onClick:e,disabled:a,isGenerating:i,isProcessing:r,credits:o,creditsUnit:s,label:n,generatingLabel:l,processingLabel:d}){return(0,t.jsx)("button",{type:"button",onClick:e,disabled:a,className:ev,children:i||r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"size-4 animate-spin"}),(0,t.jsx)("span",{children:i?l:d})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Sparkles,{className:"size-4"}),(0,t.jsx)("span",{children:n}),(0,t.jsxs)("span",{className:"text-xs opacity-80",children:["· ",o," ",s]})]})})}function eS({items:e,labelRecent:a,labelSeeAll:i,labelFailed:r,onPreview:o}){return(0,t.jsxs)("div",{className:"px-1",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:a}),(0,t.jsxs)(G.default,{href:"/assets",className:"text-xs text-primary hover:underline",children:[i," â"]})]}),(0,t.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1",children:e.slice(0,8).map(e=>(0,t.jsx)(ez,{creation:e,labelFailed:r,onPreview:()=>o(e)},e.id))})]})}function ez({creation:e,labelFailed:a,onPreview:i}){let r=(0,O.useTranslations)("Generator.hero"),o=(0,x.useAiErrorMessage)(),s=e.resultUrl??"",n="failed"===e.status;return"running"===e.status||"pending"===e.status?(0,t.jsx)("div",{className:"shrink-0 size-16 sm:size-20 rounded-lg border border-border/60 bg-muted/40 flex items-center justify-center",title:e.prompt,children:(0,t.jsx)(D.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):n||!s?(0,t.jsx)("div",{className:"shrink-0 size-16 sm:size-20 rounded-lg border border-destructive/30 bg-destructive/5 flex items-center justify-center text-[10px] font-medium text-destructive",title:o(e.errorCode),children:a}):(0,t.jsx)("button",{type:"button",onClick:i,className:"group relative shrink-0 size-16 sm:size-20 cursor-zoom-in overflow-hidden rounded-lg border border-border/50 bg-muted transition-transform hover:scale-[1.04]",title:e.prompt,"aria-label":r("previewCreation"),children:"video"===e.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("video",{src:s,className:"absolute inset-0 size-full object-cover pointer-events-none",muted:!0,playsInline:!0,preload:"metadata"}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(F.Play,{className:"size-5 text-white drop-shadow"})})]}):(0,t.jsx)($.default,{src:s,alt:e.prompt,fill:!0,className:"object-cover pointer-events-none",sizes:"80px",unoptimized:!0})})}function eI({value:e}){let a=/^(\d+):(\d+)$/.exec(e.trim()),i=11,r=11;if(a){let e=Number(a[1]),t=Number(a[2]);e>=t?(i=12,r=Math.max(4,Math.round(12*t/e))):(r=12,i=Math.max(4,Math.round(12*e/t)))}
1return(0,t.jsx)("span",{"aria-hidden":!0,className:(0,S.cn)("inline-block shrink-0 rounded-[2px] border-[1.5px] border-current",!a&&"border-dashed"),style:{width:`${i}px`,height:`${r}px`}})}e.s(["HeroGeneratorForm",0,function({videoT2vModels:e,videoI2vModels:n,videoRefModels:d,videoEditModels:m,imageT2iModels:L,imageI2iModels:P,videoHints:D,imageHints:F}){let A=(0,O.useTranslations)("Generator"),q=(0,O.useTranslations)("Generator.hero"),V=(0,O.useTranslations)("Common"),U=(0,v.useLocaleRouter)(),B=(0,x.useAiErrorMessage)(),{user:W,isPending:G}=(0,f.useCurrentUser)(),{hasEnoughCredits:J,refreshCredits:Y}=(0,z.useCredits)(),{openPricingModal:Z}=(0,T.usePricingModalStore)(),[ee,et]=(0,g.useState)("video"),[ea,ei]=(0,g.useState)("text-to-video"),[ed,ev]=(0,g.useState)("text-to-image"),[ey,ez]=(0,g.useState)(""),[eI,eM]=(0,g.useState)([]),[eT,eL]=(0,g.useState)([]),[eR,eP]=(0,g.useState)([]),[eE,eD]=(0,g.useState)(null),eF=(0,g.useMemo)(()=>eT.map(e=>e.url),[eT]),eA=eT.reduce((e,t)=>e+t.durationSec,0),[eq,eV]=(0,g.useState)(!1),eU=(0,g.useRef)(null);(0,g.useEffect)(()=>{let e=e=>{let t=e.detail;t?.prompt&&(ez(t.prompt),"video"===t.type?(et("video"),ei("text-to-video")):(et("image"),ev("text-to-image")),window.requestAnimationFrame(()=>{document.getElementById(eg)?.focus()}))};return window.addEventListener(N.generatorPromptEvent,e),()=>window.removeEventListener(N.generatorPromptEvent,e)},[]);let[eB,eW]=(0,g.useState)(j.DEFAULT_VIDEO_MODEL),[eO,e$]=(0,g.useState)(5),[eG,eQ]=(0,g.useState)("480p"),[eH,eK]=(0,g.useState)("16:9"),[eX,eJ]=(0,g.useState)(!0),[eY,eZ]=(0,g.useState)(!1),[e0,e1]=(0,g.useState)(j.DEFAULT_IMAGE_MODEL),[e2,e4]=(0,g.useState)("png"),[e5,e6]=(0,g.useState)("1:1"),[e7,e3]=(0,g.useState)("1K"),[e8,e9]=(0,g.useState)("basic"),[te,tt]=(0,g.useState)(!1),[ta,ti]=(0,g.useState)(null),[tr,to]=(0,g.useState)(!1),ts=(0,g.useRef)(!1),[tn,tl]=(0,g.useState)(null),[td,tc]=(0,g.useState)(null),[tm,tu]=(0,g.useState)([]),tp="image"===ee,tx=tp?ed:ea,tg="reference-to-video"===tx||"video-edit"===tx||"image-to-image"===tx,th="reference-to-video"===tx||"video-edit"===tx,tf="video-edit"===tx,tv="image-to-video"===tx||"image-to-image"===tx||th,tb="image-to-video"===tx||"image-to-image"===tx,tw="text-to-video"===ea?e:"image-to-video"===ea?n:"video-edit"===ea?m:d,ty="text-to-image"===ed?L:P,tj=tp?ty:tw,tk=tp?e0:eB,tN="normal"===eB||"seedance2mini"===eB||"seedance25"===eB||"wan3"===eB||"open"===eB||"omniflash"===eB||"grok15"===eB,t_=(0,k.getReferenceMediaLimits)(eB),tC=th?(0,em.getReferenceSlotOverflow)(t_,eI.length,eT.length):null,tS=tC?A("validation.referenceSlotsExceeded",{...tC}):void 0,tz="omniflash"===eB&&th&&eT.length>0,tI=(0,g.useMemo)(()=>tj.find(e=>e.id===tk)??tj[0],[tj,tk]),tM=t_.videoSlotCost??1,tT=tI?.limits.maxImages??1,tL=tv?"reference-to-video"===tx&&t_.imageSlots?Math.max(0,Math.min(tT,t_.imageSlots-eT.length*tM)):tT:0,tR=tf?1:t_.maxVideos,tP=t_.imageSlots&&!tf?Math.max(0,Math.min(tR,Math.floor((t_.imageSlots-eI.length)/tM))):tR,tE="image-to-video"===tx&&2===tL,tD=async e=>{let t=[...eT];for(let a of e)if(!t.some(e=>e.url===a))try{let e=await (0,ec.readMediaMetaFromUrl)(a,"video"),i=[...t,{...e,url:a,name:a.split("/").pop()??"video"}],r=(0,k.validateReferenceMedia)({videos:i},eB);if(r){Q.toast.error(B("INVALID_INPUT",r));break}t=i}catch{Q.toast.error(A("assetPicker.readFailed"))}eL(t)},tF=(0,ep.getUploadLimits)(tI?.limits),tA="image/*"===tF.accept?null:tF.accept.split(","),tq=(0,g.useCallback)(async()=>{if(!W)return void tu([]);try{let e=await (0,i.getUserCreations)(8,0,tp?"image":"video");e.success&&tu(e.creations)}catch(e){console.error("Failed to fetch recents:",e)}},[W,tp]);(0,g.useEffect)(()=>{let e=tp?ty:tw,t=tp?e0:eB;!e.find(e=>e.id===t)&&e[0]&&(tp?e1(e[0].id):eW(e[0].id))},[tp,ty,tw,e0,eB]),(0,g.useEffect)(()=>{if(!tp)return;let e=es(e0,ed);e6(e.imageSize),e3(e.resolution),e4(e.outputFormat),e9(e.imageQuality)},[e0,ed,tp]),(0,g.useEffect)(()=>{if(!tp)return;let e=(0,j.getModelConfig)(ed,e0),t=e?.limits.allowedResolutions??[];if(!t.length)return;let a=(0,y.getBlockedResolutions)(e5,e?.limits.resolutionConstraints);if(a.includes(e7)){let e=t.find(e=>!a.includes(e));e&&e3(e)}},[e5,e7,tp,ed,e0]),(0,g.useEffect)(()=>{!tv&&eI.length>0&&eM([]),th||(eL([]),eP([])),tf&&(eP([]),eL(e=>e.length>1?e.slice(0,1):e))},[tv,tx]),(0,g.useEffect)(()=>
1{if(tp||!tI)return;let{allowedDurations:e,allowedResolutions:t,allowedRatios:a}=tI.limits;e?.length&&e$(t=>e.includes(t)?t:(0,j.pickDefaultDuration)(e)),t?.length&&eQ(e=>t.includes(e)?e:t[0]),a?.length&&eK(e=>a.includes(e)?e:a[0]);let i=(0,k.getReferenceMediaLimits)(tI.id);eL(e=>e.length>i.maxVideos?e.slice(0,i.maxVideos):e),eP(e=>e.length>i.maxAudios?e.slice(0,i.maxAudios):e)},[tp,tI]),(0,g.useEffect)(()=>{tv&&eI.length>tL&&eM(e=>e.slice(0,tL))},[tL,tv]),(0,g.useEffect)(()=>{tq()},[tq]);let{creation:tV}=function({taskId:e,intervalMs:t=h.image,onSettled:a}){let[i,r]=(0,g.useState)(null),o=(0,g.useRef)(a);return o.current=a,(0,g.useEffect)(()=>{if(r(null),!e)return;let a=!1,i=!1,s=setInterval(()=>{n()},t);async function n(){if(!i&&!a){i=!0;try{let t=await fetch(`/api/creations/${e}`);if(!t.ok)return;let i=await t.json();if(a||!i.success||!i.creation)return;let n=i.creation;r(n),("success"===n.status||"failed"===n.status)&&(a=!0,clearInterval(s),o.current?.(n))}catch(e){console.error("Failed to poll creation status:",e)}finally{i=!1}}}return n(),()=>{a=!0,clearInterval(s)}},[e,t]),{creation:i}}({taskId:ta?.taskId??null,intervalMs:ta?h[ta.type]:void 0,onSettled:e=>{tq(),"success"===e.status?Q.toast.success("image"===e.type?A("image.generationSuccess"):A("video.generationSuccess")):(Q.toast.error(B(e.errorCode)),Y(!0))}}),tU=!!ta&&tV?.status!=="success"&&tV?.status!=="failed",tB=tp?"ultra"===e0?(0,b.computeUltraImageCredits)(e7):"gptimage2"===e0||"gptimage2pro"===e0?(0,b.computeGptImage2Credits)(e7):"seedream5pro"===e0?(0,b.computeSeedream5ProCredits)(e7):"nanobanana2"===e0?(0,b.computeNanoBanana2ImageCredits)(e7):tI?.credits??10:th?(0,b.calculateCredits)({mode:"reference-to-video",model:eB,prompt:"",imageUrls:eI,duration:eO,quality:eG,ratio:eH},{referenceVideoSeconds:eA,referenceVideoCount:eT.length}):(0,b.calculateCredits)({mode:"image-to-video"===ea?"image-to-video":"text-to-video",model:eB,prompt:"",duration:tN?eO:void 0,quality:tN?eG:void 0,ratio:tN?eH:void 0,soundEffect:tN?eX:void 0,cameraFixed:"normal"===eB?eY:void 0}),tW=()=>{try{sessionStorage.setItem(eh,JSON.stringify({...{tab:ee,videoMode:ea,imageMode:ed,prompt:ey,uploadedImages:eI,videoModel:eB,imageModel:e0,duration:eO,quality:eG,ratio:eH,soundEffect:eX,cameraFixed:eY,imageSize:e5,resolution:e7,outputFormat:e2,imageQuality:e8},savedAt:Date.now()}))}catch{}to(!0)},tO=async e=>{if(!G&&!W)return void tW();let t=Array.from(e);if(!t.length)return;let a=Math.max(0,tL-eI.length);if(a<=0)return void Q.toast.error(A("upload.maxFrames"));let i=t.slice(0,a);eV(!0);try{let e=(await Promise.all(i.map(async e=>e.type.startsWith("image/")&&(!tA||tA.includes(e.type))?e.size>1024*Math.min(tF.maxSizeMb,100)*1024?(Q.toast.error(A("upload.tooLarge",{name:e.name,max:Math.min(tF.maxSizeMb,100)})),null):(await (0,M.uploadFileFromBrowser)(e,"uploads/images")).url:(Q.toast.error(A("upload.unsupportedFormat",{name:e.name})),null)))).filter(e=>!!e);e.length&&eM(t=>[...t,...e])}catch(e){console.error("Upload failed:",e),Q.toast.error(A("upload.failed"))}finally{eV(!1)}},t$=tS??(tf&&0===eT.length?ey.trim()?A("validation.uploadVideo"):A("validation.uploadVideoAndPrompt"):ey.trim()?tb&&0===eI.length?A("validation.uploadImage"):void 0:tb&&0===eI.length?A("validation.uploadAndPrompt"):A("validation.enterPrompt")),tG=async()=>{if(!te&&!tU){if(t$)return void Q.toast.error(t$);if(!G&&!W)return void tW();if(tg&&(0,_.hasDanglingMentions)(ey,eI.length,eT.length)&&Q.toast.warning(A("mention.dangling")),!J(tB))return void Z();tt(!0);try{let e,t=tL>0?eI.slice(0,tL):[];if(tp){let a=!!tI?.limits.allowedResolutions,i="open"===e0;e=await (0,w.generate)("text-to-image"===ed?{mode:"text-to-image",model:e0,prompt:ey,outputFormat:e2,imageSize:e5,resolution:a?e7:void 0,imageQuality:i?e8:void 0}:{mode:"image-to-image",model:e0,prompt:ey,imageUrls:t,outputFormat:e2,imageSize:e5,resolution:a?e7:void 0,imageQuality:i?e8:void 0})}else{let a=()=>tN?eO:void 0;e=await (0,w.generate)("video-edit"===ea?{mode:"video-edit",model:eB,prompt:ey,imageUrls:t,videoUrls:eT.map(e=>e.url),duration:eO,quality:eG,ratio:eH,soundEffect:eX}:"reference-to-video"===ea?{mode:"reference-to-video",model:eB,prompt:e
1y,imageUrls:t,videoUrls:eT.map(e=>e.url),audioUrls:eR.map(e=>e.url),duration:eO,quality:eG,ratio:eH,soundEffect:eX}:"text-to-video"===ea?{mode:"text-to-video",model:eB,prompt:ey,duration:a(),quality:tN?eG:void 0,ratio:tN?eH:void 0,soundEffect:tN?eX:void 0,cameraFixed:"normal"===eB?eY:void 0}:{mode:"image-to-video",model:eB,prompt:ey,imageUrls:t,duration:a(),quality:tN?eG:void 0,ratio:tN?eH:void 0,soundEffect:tN?eX:void 0,cameraFixed:"normal"===eB?eY:void 0})}if(!e.success||!e.taskId)return void(e.error?.includes("Insufficient credits")?Z():Q.toast.error(B(e.errorCode,e.errorDetail)));ti({taskId:e.taskId,type:tp?"image":"video",prompt:ey,aspectRatio:tp?e5:eH,startedAt:Date.now(),estimatedSeconds:(0,j.getEstimatedSeconds)(tp?"image":"video",tI)})}catch(e){console.error("Generation failed:",e),Q.toast.error(B(void 0))}finally{tt(!1),Y(!0)}}};(0,g.useEffect)(()=>{if(ts.current||!W)return;let e=function(){try{let e=sessionStorage.getItem(eh);if(!e)return null;let t=JSON.parse(e);if(Date.now()-t.savedAt>18e4)return sessionStorage.removeItem(eh),null;return t}catch{return null}}();if(!e)return;ts.current=!0;let t=(0,C.resolveRecreateModel)(e.imageMode,e.imageModel),a=(0,C.resolveRecreateModel)(e.videoMode,e.videoModel),i=t?.modelId??j.DEFAULT_IMAGE_MODEL,r=a?.modelId??j.DEFAULT_VIDEO_MODEL,o=t?.fallback?es(i,e.imageMode):e,s=(0,j.getModelConfig)(e.videoMode,r)?.limits;et(e.tab),ei(e.videoMode),ev(e.imageMode),ez(e.prompt),eM(e.uploadedImages),eW(r),e1(i),e$(s?.allowedDurations?.includes(e.duration)?e.duration:(0,j.pickDefaultDuration)(s?.allowedDurations??[5])),eQ(s?.allowedResolutions?.includes(e.quality)?e.quality:s?.allowedResolutions?.[0]??"480p"),eK(s?.allowedRatios?.includes(e.ratio)?e.ratio:s?.allowedRatios?.[0]??"16:9"),eJ(e.soundEffect),eZ(e.cameraFixed),e6(o.imageSize),e3(o.resolution),e4(o.outputFormat),e9(o.imageQuality);let n="image"===e.tab?t:a;n?.fallback&&Q.toast.warning(A("recreate.modelUnavailable",{model:n.original??"",fallback:(0,j.getModelConfig)("image"===e.tab?e.imageMode:e.videoMode,n.modelId)?.name??n.modelId})),ef()},[W,A]);let tQ=(0,g.useCallback)(()=>window.location.pathname+window.location.search,[]),tH=te||tU,tK=tp?F:D,tX=(0,g.useMemo)(()=>{if(!tp)return new Set;let e=(0,j.getModelConfig)(ed,e0);return new Set((0,y.getBlockedResolutions)(e5,e?.limits.resolutionConstraints))},[tp,ed,e0,e5]),tJ=tp?{resolution:tX}:tz?{duration:new Set(["4","6","8","10"])}:{},tY=tp?[{id:"text-to-image",label:q("modeTextToImage")},{id:"image-to-image",label:q("modeImageToImage")}]:[{id:"text-to-video",label:q("modeTextToVideo")},{id:"image-to-video",label:q("modeImageToVideo")},{id:"reference-to-video",label:q("modeReferenceToVideo")},{id:"video-edit",label:q("modeVideoEditing")}],tZ=tp?ed:ea,t0=tY.find(e=>e.id===tZ)?.label??"",t1=(0,ex.getVideoSchema)(eB,ea),t2=t1.filter(e=>"switch"!==e.type),t4=t1.filter(e=>"switch"===e.type),t5=function(e,t){let a=(0,j.getModelConfig)(t,e);if(!a)return{quick:[],advanced:[]};let i=[],r=[];return a.limits.allowedImageSizes?.length&&i.push({key:"imageSize",type:"aspect-ratio",labelKey:"image.imageSize",options:(0,H.sortAspectRatioOptions)(a.limits.allowedImageSizes.map(e=>({value:e,label:e,icon:eo[e]??"w-5 h-5"})))}),a.limits.allowedResolutions?.length&&i.push({key:"resolution",type:"button-group-string",labelKey:"image.resolution",options:a.limits.allowedResolutions.map(e=>({value:e,label:e,minWidth:60}))}),a.limits.allowedOutputFormats?.length&&r.push({key:"outputFormat",type:"button-group-string",labelKey:"image.outputFormat",options:a.limits.allowedOutputFormats.map(e=>({value:e,label:e.toUpperCase(),minWidth:60}))}),a.limits.allowedImageQualities?.length&&r.push({key:"imageQuality",type:"button-group-string",labelKey:"image.qualityLabel",options:a.limits.allowedImageQualities.map(e=>({value:e,label:e,labelKey:"basic"===e?"image.qualityBasic":"image.qualityHigh",minWidth:80}))}),{quick:i,advanced:r}}(e0,ed),t6=tp?t5.quick:t2,t7=tp?t5.advanced:t4,t3=t7.length>0,t8=function(e){let{labels:t,isImageTab:a,videoModel:i,duration:r,quality:o,ratio:s,imageSize:n,resolution:l,hasImageResolution:d}=e;return a?[{text:(0,H.formatAspectRatioLabel)(n,t.auto),ratio:n},...d?[{text:l}]:[]]:"normal"===i||"seedance2mini"===i||"seedance25"===i||"wan3"===i||"open"===i||"omniflash"===i||"grok15"===i?[{text:t.seconds(r)},{text:(0,H.formatAspectRatioLabel)(s,t.auto),ratio:s},{text:o}]:[{text:t.settings}]}({labels:{auto:A("common.auto"),settings:V("settings"),seconds:e=>A("preview.durationSeconds",{s:e})},isImageTab:tp,videoModel:eB,videoMode:ea,duration:eO,quality:eG,ratio:eH,imageSize:e5,resolution:e7,hasImageResolution:!!tI?.limits.allowedResolutions?.length}),t9=e=>{switch(e){case"imageSize":return[e5,e=>e6(e)];case"resolution":return[e7,e=>e3(e)];case"outputFormat":return[e2,e=>e4(e)];case"imageQuality":return[e8,e=>e9(e)];default:return["",()=>{}]}};return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-3xl space-y-3 lg:max-w-4xl",children:[(0,t.jsx)(u.Tabs,{value:ee,onValueChange:e=>et(e),className:"items-center",children:(0,t.jsxs)(u.TabsList,{className:"mx-auto h-10 gap-1 rounded-full border border-border/60 bg-card/60 p-1 backdrop-blur-md dark:border-border/40 dark:bg-card/30",children:[(0,t.jsx)(eb,{value:"video",icon:(0,t.jsx)(R.Clapperboard,{className:"size-4"}),children:q("tabVideo")}),(0,t.jsx)(eb,{value:"image",icon:(0,t.jsx)(E.ImageIcon,{className:"size-4"}),children:q("tabImage")})]})}),(0,t.jsxs)(o.Card,{className:(0,S.cn)("generator-cinematic-card gap-0 overflow-hidden rounded-3xl border border-border/70 py-0","bg-gradient-to-b from-card via-card to-muted/55","dark:border-white/[0.11] dark:from-[#121318] dark:via-[#0d0e12] dark:to-[#090a0d]"),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 sm:p-5",children:[tv&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ek,{values:eI,maxFrames:tL,required:tb,uploading:eq,disabled:tH,label:q("frameLabel"),slotLabels:tE?[q("slotFirstFrame"),q("slotLastFrame")]:void 0,onPick:()=>{G||W?eU.current?.click():tW()},onPickAssets:()=>{G||W?eD("image"):tW()},assetsLabel:A("common.assets"),onRemove:e=>{var t;return t=eI.filter((t,a)=>a!==e),void(ez(e=>(0,_.remapMentions)(e,"image",eI,t)),eM(t))},onPreview:e=>tl(e)}),(tE||th)&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:tE?A("video.firstLastFrameHint"):q("referenceHint",{max:tL})}),th&&tP>0&&(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(eu.SectionLabel,{title:tf?A("video.sourceVideo"):A("video.referenceVideos"),hint:tf?A("video.sourceVideoHint"):A("video.referenceVideosHint"),required:tf,count:eT.length,max:tP,children:(0,t.jsx)(X.AssetsButton,{onClick:()=>{G||W?eD("video"):tW()},disabled:tH||eT.length>=tP})}),(0,t.jsx)(ec.ReferenceMediaUpload,{kind:"video",value:eT,onChange:e=>{ez(t=>(0,_.remapMentions)(t,"video",eT.map(e=>e.url),e.map(e=>e.url))),eL(e)},max:tP,model:eB,disabled:tH,onRequireLogin:tW}),eA>0&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:A("video.referenceVideoSecondsNote",{seconds:(0,b.billableReferenceSeconds)(eA)})})]}),!tf&&t_.maxAudios>0&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(eu.SectionLabel,{title:A("video.referenceAudios"),hint:A("video.referenceAudiosHint"),count:eR.length,max:t_.maxAudios}),(0,t.jsx)(ec.ReferenceMediaUpload,{kind:"audio",value:eR,onChange:eP,max:t_.maxAudios,model:eB,disabled:tH,onRequireLogin:tW})]})]}),(0,t.jsx)("input",{ref:eU,type:"file",accept:tF.accept,multiple:tL>1,className:"hidden",onChange:e=>{e.target.files?.length&&tO(e.target.files),e.target.value=""},disabled:tH})]}),tg?(0,t.jsx)(en.MentionPromptInput,{id:eg,value:ey,onChange:ez,images:eI,videos:eF,"aria-label":tp?A("mention.placeholderImageEdit"):tf?A("mention.placeholderVideoEdit"):A("mention.placeholderReference"),placeholder:tp?A("mention.placeholderImageEdit"):tf?A("mention.placeholderVideoEdit"):A("mention.placeholderReference"),placeholderClassName:"start-1 top-0 text-muted-foreground
1/70 sm:text-base",disabled:tH,className:"min-h-[80px] w-full rounded-none border-0 bg-transparent px-1 py-0 text-sm shadow-none focus-visible:ring-0 dark:bg-transparent sm:min-h-[88px] sm:text-base",maxLength:tI?.limits.maxPromptLength??2e3}):(0,t.jsx)(p.Textarea,{id:eg,value:ey,onChange:e=>ez(e.target.value),"aria-label":q(tp?"promptPlaceholderImage":"promptPlaceholderVideo"),placeholder:q(tp?"promptPlaceholderImage":"promptPlaceholderVideo"),rows:4,disabled:tH,className:"min-h-[80px] w-full resize-none rounded-none border-0 bg-transparent px-1 py-0 text-sm shadow-none placeholder:text-muted-foreground/70 focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent sm:min-h-[88px] sm:text-base",maxLength:tI?.limits.maxPromptLength??2e3})]}),(0,t.jsx)(c.Separator,{className:"bg-border/50 dark:bg-white/[0.08]"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 bg-muted/65 p-3 dark:bg-black/30",children:[(0,t.jsx)(ew,{disabled:tH,trigger:(0,t.jsx)("span",{className:"text-foreground/90",children:t0}),children:tY.map(e=>(0,t.jsx)(ej,{active:tZ===e.id,onSelect:()=>{tp?ev(e.id):ei(e.id)},children:e.label},e.id))}),(0,t.jsx)(el.ModelPicker,{variant:"chip",models:tj,value:tk,disabled:tH,onChange:e=>{tp?e1(e.id):eW(e.id)}}),(0,t.jsx)(eN,{label:t8,disabled:tH,isImageTab:tp,schema:t6,getVideoBinding:e=>{switch(e){case"duration":return[eO,e=>e$(e)];case"quality":return[eG,e=>eQ(e)];case"ratio":return[eH,e=>eK(e)];default:return["",()=>{}]}},getImageBinding:t9,blockedValues:tJ,t:A}),(0,t.jsx)(e_,{disabled:tH||!t3,schema:t7,isImageTab:tp,getVideoSwitchBinding:e=>"soundEffect"===e?[eX,eJ]:"cameraFixed"===e?[eY,eZ]:[!1,()=>{}],getImageBinding:t9,t:A,tHero:q,empty:!t3}),(0,t.jsx)("div",{className:"grow"}),(0,t.jsx)(eC,{onClick:tG,disabled:tH,isGenerating:te,isProcessing:tU,credits:tB,creditsUnit:A("common.credits"),label:q("generateShort"),generatingLabel:A("common.generating"),processingLabel:A("common.processing")})]})]}),(0,t.jsx)(K.AssetPickerDialog,{open:null!==eE,onOpenChange:e=>!e&&eD(null),kind:eE??"image",max:"video"===eE?tP-eT.length:Math.max(1,tL-eI.length),onPick:e=>{if("video"===eE)tD(e);else eM(t=>[...t,...e.filter(e=>!t.includes(e))].slice(0,tL))}}),ta&&(0,t.jsx)(er,{task:ta,creation:tV,onOpenModal:e=>tc(e),onRetry:()=>{ti(null),tG()},onDismiss:()=>ti(null)}),(0,t.jsx)(r.LoginWrapper,{mode:"modal",open:tr,onOpenChange:e=>{to(e),e||W||(ef(),ts.current=!1)},callbackUrl:tQ()}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 px-1",children:[(0,t.jsxs)("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:[q("hintsLabel"),":"]}),tK.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{ez(e.prompt),setTimeout(()=>{document.getElementById(eg)?.focus()},0)},className:"cursor-pointer rounded-full border border-border/60 bg-background/60 px-3 py-1 text-xs font-medium text-foreground/80 transition-all hover:border-primary/60 hover:bg-accent/40 hover:text-foreground hover:shadow-[0_0_12px_-4px_oklch(0.72_0.16_55/0.45)] dark:bg-white/5 dark:hover:bg-white/10",title:e.prompt,children:e.label},e.label))]}),W&&tm.length>0&&(0,t.jsx)(eS,{items:tm,isImageTab:tp,labelRecent:q("recentLabel"),labelSeeAll:q("seeAll"),labelFailed:q("creationFailed"),onPreview:e=>{e.resultUrl&&tc(e)}}),(0,t.jsx)(s.Dialog,{open:null!==tn,onOpenChange:e=>!e&&tl(null),children:(0,t.jsxs)(s.DialogContent,{className:"!max-w-4xl w-[min(92vw,1024px)] p-0 overflow-hidden bg-background/95 backdrop-blur-md sm:!max-w-4xl",children:[(0,t.jsx)(s.DialogTitle,{className:"sr-only",children:q("frameLabel")}),tn&&(0,t.jsx)("div",{className:"relative w-full h-[min(80vh,720px)] bg-black",children:(0,t.jsx)($.default,{src:tn,alt:q("frameLabel"),fill:!0,className:"object-contain",sizes:"(max-width: 1024px) 92vw, 1024px",unoptimized:!0})})]})}),(0,t.jsx)(l.MediaModal,{isOpen:null!==td,onClose:()=>tc(null),creation:td,autoPlayVideo:!0,onRecreate:e=>{let t=(0,C.draftFromCreation)(e);t&&(tc(null),(0,C.saveRecreateDraft)(t),U.push(I.modeRoutes[t.mode]))},onDelete:async e=>{try{(await (0,a.deleteUserCreation)(e.id)).success?(tu(t=>t.filter(t=>t.id!==e.id)),tV?.id===e.id&&ti(null)):Q.toast.error(A("errors.deleteFailed"))}catch(e){console.error("Delete creation failed:",e),Q.toast.error(A("errors.deleteFailed"))}}})]})}],18502)}]);
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.