1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8374],{42493:(e,s,a)=>{a.d(s,{A:()=>r});var t=a(14145),l=a(70341),i=a(19902),n=a(97349);let r=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsxs)(i.bL,{ref:s,className:(0,n.cn)("relative flex w-full touch-none select-none items-center",a),...l,children:[(0,t.jsx)(i.CC,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:(0,t.jsx)(i.Q6,{className:"absolute h-full bg-primary"})}),(0,t.jsx)(i.zi,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]})});r.displayName=i.bL.displayName},48374:(e,s,a)=>{a.d(s,{default:()=>iT});var t=a(14145),l=a(99842),i=a(70341),n=a(80418),r=a(47558),d=a(93625),c=a(56983),o=a(57593),m=a(88594),x=a(48315),u=a(22773),h=a(96476),p=a(7079),g=a(78516),j=a(98637),f=a(60630),v=a(3097),N=a(54901),b=a(97349);a(40930);let y=i.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(v.uB,{ref:s,className:(0,b.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",a),...l})});y.displayName=v.uB.displayName,i.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,t.jsx)(N.A,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,t.jsx)(v.uB.Input,{ref:s,className:(0,b.cn)("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...l})]})}).displayName=v.uB.Input.displayName;let w=i.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(v.uB.List,{ref:s,className:(0,b.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden",a),...l})});w.displayName=v.uB.List.displayName;let S=i.forwardRef((e,s)=>(0,t.jsx)(v.uB.Empty,{ref:s,className:"py-6 text-center text-sm",...e}));S.displayName=v.uB.Empty.displayName;let C=i.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(v.uB.Group,{ref:s,className:(0,b.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",a),...l})});C.displayName=v.uB.Group.displayName,i.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(v.uB.Separator,{ref:s,className:(0,b.cn)("-mx-1 h-px bg-border",a),...l})}).displayName=v.uB.Separator.displayName;let P=i.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(v.uB.Item,{ref:s,className:(0,b.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...l})});P.displayName=v.uB.Item.displayName;var A=a(17509),E=a(97359),R=a(28657);let F=i.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(R.bL,{className:(0,b.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...l,ref:s,children:(0,t.jsx)(R.zi,{className:(0,b.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});F.displayName=R.bL.displayName;var k=a(69560),I=a(20115),U=a(42369),V=a(13527),T=a(30682);let B="sora2_selected_model_id",M="sora2_selected_filter",G="sora2_model_selection_view_mode",D=(0,V.v)()(function(){for(var e=arguments.length,s=Array(e),a=0;a<e;a++)s[a]=arguments[a];return{...(e=>({pendingTab:null,setPendingTab:s=>e({pendingTab:s}),clearPendingTab:()=>e({pendingTab:null})}))(...s),...(e=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e(e=>({isOpen:!e.isOpen}))}))(...s),...((e,s)=>({selectedModel:null,selectedFilterId:null,modelSelectionViewMode:null,setSelectedModel:s=>{localStorage.setItem(B,s),e({selectedModel:s})},setSelectedFilterId:s=>{localStorage.setItem(M,s),e({selectedFilterId:s})},setModelSelectionViewMode:s=>{localStorage.setItem(G,s),e({modelSelectionViewMode:s})},initializeModelSelection:()=>
1{if(null===s().selectedModel){let e=localStorage.getItem(B),a=e&&o.L6.some(s=>s.id===e)?e:"seedream-v5-pro";s().setSelectedModel(a)}if(null===s().selectedFilterId){let e=localStorage.getItem(M),a=e&&o.W7.some(s=>s.id===e)?e:"all";s().setSelectedFilterId(a)}if(null===s().modelSelectionViewMode){let e=localStorage.getItem(G);s().setModelSelectionViewMode("compact"===e||"detailed"===e?e:"detailed")}}}))(...s)}}),O=()=>D((0,T.k)(e=>({pendingTab:e.pendingTab,setPendingTab:e.setPendingTab,clearPendingTab:e.clearPendingTab}))),W=()=>D((0,T.k)(e=>({isOpen:e.isOpen,open:e.open,close:e.close,toggle:e.toggle}))),J=()=>D((0,T.k)(e=>({selectedModel:e.selectedModel,selectedFilterId:e.selectedFilterId,modelSelectionViewMode:e.modelSelectionViewMode,setSelectedModel:e.setSelectedModel,setSelectedFilterId:e.setSelectedFilterId,setModelSelectionViewMode:e.setModelSelectionViewMode,initializeModelSelection:e.initializeModelSelection}))),Z="\uD83C\uDF36",_=e=>{let s=e.find(e=>e.includes(Z));return s?[...s].filter(e=>e===Z).length:0};function L(){let{selectedModel:e,setSelectedModel:s,selectedFilterId:a,setSelectedFilterId:l,modelSelectionViewMode:n,setModelSelectionViewMode:r}=J(),[d,c]=(0,i.useState)(!1),m=function(){let[e,s]=i.useState(void 0);return i.useEffect(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),a=()=>{s(window.innerWidth<768)};return e.addEventListener("change",a),s(window.innerWidth<768),()=>e.removeEventListener("change",a)},[]),e}(),x=(0,i.useCallback)(e=>{e&&d&&e.scrollIntoView({behavior:"instant",block:"center"})},[d]);if(void 0===m||!e||!a||!n)return null;let u=o.L6.find(s=>s.id===e),h=u?_(u.specs):0,g=o.W7.find(e=>e.id===a)||o.W7[0],j=o.L6.filter(g.filterFn),v=(0,t.jsxs)(f.$,{variant:"outline",role:"combobox","aria-expanded":d,className:"w-full justify-between",children:[u?(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"relative h-4 w-4",children:(0,t.jsx)(U.default,{src:u.icon,alt:"",fill:!0,className:"object-contain"})}),(0,t.jsx)("span",{children:u.name}),u.new&&(0,t.jsx)(p.E,{variant:"destructive",className:"ml-2 text-xs",children:"NEW"})]}),(0,t.jsx)("span",{className:"text-xs",children:h>0?Z.repeat(h):"\uD83E\uDD52"})]}):"Select model...",(0,t.jsx)(k.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),N="detailed"===n,R=(0,t.jsx)("div",{className:"flex min-w-[80px] gap-1 overflow-x-auto border-b border-border p-3 md:flex-col md:overflow-x-visible md:border-b-0 md:border-r",children:o.W7.map(e=>(0,t.jsx)(f.$,{variant:a===e.id?"default":"ghost",size:"sm",className:"flex-shrink-0 whitespace-nowrap text-xs md:w-full",onClick:()=>{l(e.id)},children:e.label},e.id))}),V=(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 border-b border-border px-3 py-2",children:[(0,t.jsx)("span",{className:(0,b.cn)("text-xs",N?"text-muted-foreground":"font-medium"),children:"Compact"}),(0,t.jsx)(F,{checked:N,onCheckedChange:e=>r(e?"detailed":"compact"),"aria-label":"Toggle compact / detailed view"}),(0,t.jsx)("span",{className:(0,b.cn)("text-xs",N?"font-medium":"text-muted-foreground"),children:"Detailed"})]}),T=(0,t.jsx)(y,{children:(0,t.jsxs)(w,{className:(0,b.cn)("overflow-y-auto [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:border-[1px] [&::-webkit-scrollbar-thumb]:border-gray-200 [&::-webkit-scrollbar-thumb]:bg-gray-600 [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar]:w-2",m?"max-h-[calc(85vh-9rem)]":"max-h-[540px]"),children:[(0,t.jsx)(S,{children:"No models found."}),(0,t.jsx)(C,{children:j.map(a=>{let l=_(a.specs),i=e===a.id;return(0,t.jsx)(P,{ref:i?x:void 0,value:a.id,onSelect:()=>{s(a.id),c(!1)},className:(0,b.cn)("cursor-pointer",N?"p-4":m?"px-3 py-4":"px-3 py-2.5"),children:(0,t.jsxs)("div",{className:"flex w-full items-start gap-3",children:[(0,t.jsx)("div",{className:"relative mt-0.5 h-5 w-5 flex-shrink-0",children:(0,t.jsx)(U.default,{src:a.icon,alt:"",fill:!0,className:"object-contain"})}),(0,t.jsxs)("div",{className:(0,b.cn)("min-w-0 flex-1",N?"space-y-1":""),children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"break-words font-medium",children:a.name}),a.new&&(0,t.jsx)(p.E,{variant:"destructive",className:"flex-shrink-0 text-xs",children:"NEW"}),!N&&l>0&&(0,t.jsx)("span",{className:"text-sm",children:Z.repeat(l)}
1)]}),N&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"break-words text-sm text-muted-foreground",children:a.description}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.specs.map((e,s)=>(0,t.jsx)(p.E,{variant:"outline",className:"break-words text-xs",children:e},s))})]})]}),(0,t.jsx)(I.A,{className:(0,b.cn)("mt-0.5 h-4 w-4 flex-shrink-0",i?"opacity-100":"opacity-0")})]})},a.id)})})]})});return m?(0,t.jsxs)(E.cj,{open:d,onOpenChange:c,children:[(0,t.jsx)(E.CG,{asChild:!0,children:v}),(0,t.jsxs)(E.h,{side:"bottom",className:"flex h-[85vh] flex-col gap-0 p-0",children:[(0,t.jsx)(E.Fm,{className:"border-b border-border",children:(0,t.jsx)(E.qp,{children:"Select Model"})}),R,V,(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:T})]})]}):(0,t.jsxs)(A.AM,{open:d,onOpenChange:c,modal:!0,children:[(0,t.jsx)(A.Wv,{asChild:!0,children:v}),(0,t.jsx)(A.hl,{className:"w-[600px] max-w-[95vw] p-0",onWheel:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),children:(0,t.jsxs)("div",{className:"flex flex-col md:flex-row",children:[R,(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[V,T]})]})})]})}var q=a(40697),K=a(50525),z=a(70019),Q=a(51554),H=a(39176),$=a(21384),Y=a(80532),X=a(96844),ee=a(86498),es=a(28584);let ea=es.z.string().min(1),et=[1,2,3,4,5,10];es.z.number().int().refine(e=>et.includes(e)).default(1),es.z.string().url();let el=es.z.string().url();es.z.string().regex(/^data:(image|video)\/(png|jpeg|jpg|webp|mp4);base64,/);let ei=(0,i.createContext)(null);function en(){let e=(0,i.useContext)(ei);if(!e)throw Error("useGenerator must be used within GeneratorProvider");return e}function er(e){let{children:s,config:a}=e,{modelIdentifiers:l,useStatusQuery:n,contentLabel:r}=a,[d,c]=(0,i.useState)(null),[o,m]=(0,i.useState)([]),[x,u]=(0,i.useState)(null),[h,p]=(0,i.useState)(""),[g,f]=(0,i.useState)(1),v=(0,i.useMemo)(()=>"Image"===r?[...et]:[1],[r]),{data:N}=(0,X.wV)(),b=j.F.useUtils(),{setShowPricingDialog:y,setShowSignModal:w}=(0,ee.U)(),{data:S}=n({generationId:d},{enabled:!!d,refetchInterval:e=>{let s=e.state.data;return s&&0!==s.length?!s.every(e=>"SUCCEEDED"===e.status||"FAILED"===e.status)&&3e3:3e3},refetchOnWindowFocus:!1,refetchOnReconnect:!1,staleTime:2e3});(0,i.useEffect)(()=>{if(!S||!d)return;let e=S.every(e=>"SUCCEEDED"===e.status||"FAILED"===e.status);if(m(S),e)if(c(null),b.credits.get.invalidate(),S.some(e=>"SUCCEEDED"===e.status))p("".concat(r," generated successfully!")),Q.oR.success("".concat(r," generated successfully!")),b.history.get.invalidate({modelIdentifiers:l});else if(S.length<=1){var s;let e=(null==(s=S[0])?void 0:s.error)||"Generation failed";u(e),p(""),Q.oR.error(e)}else p(""),Q.oR.error("Generation failed")},[S,d,r,l,b]);let C=(0,i.useCallback)(()=>!!N||(w(!0),!1),[N,w]),P=(0,i.useCallback)(e=>{c(e.generationId),u(null),p("".concat(r," generation submitted. Generating...")),Q.oR.success("Generation started!"),D.getState().close(),b.credits.get.invalidate(),b.history.get.invalidate({modelIdentifiers:l})},[r,l,b]),A=(0,i.useCallback)(e=>{var s;if(c(null),u(e.message),p(""),b.credits.get.invalidate(),(null==(s=e.data)?void 0:s.code)==="FORBIDDEN")return void y(!0);Q.oR.error(e.message)},[y,b]),E=(0,i.useCallback)((e,s)=>{c(null!=s?s:null),m(e),u(null),p("")},[]),R=(0,i.useMemo)(()=>({generationId:d,outputs:o,error:x,progress:h,contentLabel:r,modelIdentifiers:l,count:g,setCount:f,batchOptions:v,requireAuth:C,onMutationSuccess:P,onMutationError:A,setError:u,showResult:E}),[d,o,x,h,r,l,g,v,C,P,A,u,E]);return(0,t.jsx)(ei.Provider,{value:R,children:s})}function ed(e){let{onMutationSuccess:s,onMutationError:a,setError:t,count:l}=en(),n=e.useMutation({onMutate:()=>{t(null)},onSuccess:s,onError:a});return(0,i.useMemo)(()=>({...n,mutate:(e,s)=>n.mutate({...e,count:l},s),mutateAsync:(e,s)=>n.mutateAsync({...e,count:l},s)}),[n,l])}var ec=a(43035);function eo(e){var s,a;let{demoImageUrl:l}=e,{open:i}=W(),{outputs:n}=en(),{carouselApi:r,setCarouselApi:d,carouselIndex:c}=(0,Y.O)(n.length);if(0===n.length)return(0,t.jsxs)(h.Zp,{children:[(0,t.jsxs)(h.aR,{children:[(0,t.jsx)(h.ZB,{children:"Preview"}),(0,t.jsx)(h.BT,{children:"Example output from an AI image generation model"})]}),(0,t.jsx)(h.Wu,{children:(0,t.jsx)("div",{className:"flex items-center justify-center min-h-[400px]",children:(0,t.jsx)("img",{src:l,alt:"Demo",className:"max-w-full max-h-[800px] rounded-lg object-contain"})})})]});let o=n.length>1,m=n[c],{succeeded:x,failed:u,pending:p,succeededUrls:g}=(0,ec.c_)(n);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsxs)(h.aR,{children:[(0,t.jsx)(h.ZB,{children:o?"".concat(n.length," Images"):"Image Preview"}),(0,t.jsx)(h.BT,{children:o?"".concat(x," complete").concat(p?" \xb7 ".concat(p," in progress"):"").concat(u?" \xb7 ".concat(u," failed"):""):(null==(s=n[0])?void 0:s.status)==="SUCCEEDED"?"Generation complete":(null==(a=n[0])?void 0:a.status)==="FAILED"?"Generation failed":"Generating..."})]}),(0,t.jsxs)(h.Wu,{children:[o?(0,t.jsxs)(H.FN,{setApi:d,className:"w-full",opts:{loop:!1},children:[(0,t.jsx)(H.Wk,{children:n.map((e,s)=>(0,t.jsx)(H.A7,{className:"flex items-center justify-center min-h-[400px]",children:(0,t.jsx)(ec.fy,{item:e,contentType:"IMAGE"})},s))}),(0,t.jsx)(H.Q8,{className:"left-2"}),(0,t.jsx)(H.Oj,{className:"right-2"})]}):(0,t.jsx)("div",{className:"flex items-center justify-center min-h-[400px]",children:(0,t.jsx)(ec.fy,{item:n[0],contentType:"IMAGE"})}),o&&(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-3 text-xs",children:[(0,t.jsxs)("span",{className:"font-medium tabular-nums",children:[String(c+1).padStart(String(n.length).length,"â"),"/",n.length]}),(0,t.jsx)(ec.xz,{count:g.length,kind:"SUCCEEDED"}),(0,t.jsx)(ec.xz,{count:u,kind:"FAILED"}),(0,t.jsx)(ec.xz,{count:p,kind:"PROCESSING"}),(0,t.jsx)(ec.FD,{outputs:n,activeIndex:c,onSelect:e=>null==r?void 0:r.scrollTo(e)})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col sm:flex-row gap-2",children:[(0,t.jsxs)(f.$,{className:"w-full sm:flex-1",onClick:()=>(null==m?void 0:m.resultUrl)&&(0,$.V)(m.resultUrl),disabled:!(null==m?void 0:m.resultUrl),children:[(0,t.jsx)(q.A,{className:"h-4 w-4 mr-2"}),o?"Download":"Download Image"]}),o&&(0,t.jsxs)(f.$,{variant:"outline",className:"w-full sm:w-auto",onClick:()=>(0,$.T)(g,(e,s)=>Q.oR.info("Downloading ".concat(e,"/").concat(s,"..."))),disabled:0===g.length,children:[(0,t.jsx)(K.A,{className:"h-4 w-4 mr-2"}),"All (",g.length,")"]}),(0,t.jsxs)(f.$,{variant:"outline",className:"w-full sm:w-auto",onClick:i,children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-1"}),"History"]})]})]})]})}var em=a(2522),ex=a(62761),eu=a(23374),eh=a(57316),ep=a(35366);a(56703),a(69845);var eg=a(87472);function ej(e){var s;let{demoVideoUrl:a}=e,[l,n]=(0,i.useState)(null),[r,d]=(0,i.useState)(null),{open:c}=W(),{outputs:o}=en(),m=o[0],x=null!=(s=null==m?void 0:m.resultUrl)?s:null;if((0,i.useEffect)(()=>{n(null),d(null)},[x]),!m)return(0,t.jsx)(eh.DemoVideoPlayer,{className:"aspect-video",videoUrl:a});let u="SUCCEEDED"===m.status?"Generation complete":"FAILED"===m.status?"Generation failed":"Generating...";if("SUCCEEDED"===m.status&&x){let e=(0,b.cn)("relative mx-auto w-full rounded-lg bg-black overflow-hidden flex items-center justify-center",!r&&"portrait"!==l&&"aspect-video","portrait"===l&&"max-w-[420px]");return(0,t.jsxs)(h.Zp,{children:[(0,t.jsxs)(h.aR,{children:[(0,t.jsx)(h.ZB,{children:"Video Preview"}),(0,t.jsx)(h.BT,{children:u})]}),(0,t.jsxs)(h.Wu,{children:[(0,t.jsx)("div",{className:e,style:{aspectRatio:null!=r?r:"portrait"===l?9/16:16/9},children:(0,t.jsx)("video",{src:x,controls:!0,autoPlay:!0,playsInl
1ine:!0,onLoadedMetadata:e=>{let s=e.currentTarget;s.videoWidth&&s.videoHeight&&(n(s.videoHeight>s.videoWidth?"portrait":"landscape"),d(s.videoWidth/s.videoHeight))},className:"h-full w-full object-contain"})}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col sm:flex-row gap-2",children:[(0,t.jsx)(f.$,{className:"w-full sm:flex-1",onClick:()=>(0,$.V)(x),children:"Download Video"}),(0,t.jsxs)(f.$,{variant:"outline",className:"w-full sm:w-auto",onClick:c,children:[(0,t.jsx)(z.A,{className:"h-4 w-4 mr-1"}),"History"]})]})]})]})}return"FAILED"===m.status?(0,t.jsxs)(h.Zp,{children:[(0,t.jsxs)(h.aR,{children:[(0,t.jsx)(h.ZB,{children:"Video Preview"}),(0,t.jsx)(h.BT,{children:u})]}),(0,t.jsx)(h.Wu,{children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 text-center p-8 min-h-[300px] text-destructive",children:[(0,t.jsx)(em.A,{className:"w-8 h-8"}),(0,t.jsx)("p",{className:"text-sm font-medium",children:"Generation failed"}),m.error&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground max-w-md",children:m.error})]})})]}):(0,t.jsxs)(h.Zp,{children:[(0,t.jsxs)(h.aR,{children:[(0,t.jsx)(h.ZB,{children:"Video Preview"}),(0,t.jsx)(h.BT,{children:u})]}),(0,t.jsx)(h.Wu,{children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 text-center p-8 min-h-[300px] text-muted-foreground",children:[(0,t.jsx)(ex.A,{className:"w-8 h-8 animate-spin"}),(0,t.jsx)("p",{className:"text-sm",children:"Generating..."})]})})]})}var ef=a(90390),ev=a(96621),eN=a(6687),eb=a(27888),ey=a(85969),ew=a(80571),eS=a(41415),eC=a(35216),eP=a(11107),eA=a(83680),eE=a(6451);function eR(){let{showResult:e,modelIdentifiers:s}=en(),{isOpen:a,close:l}=W(),{history:n,historyPagination:r,isLoadingHistory:d,isFetchingHistory:c,isError:o,fetchHistory:m,handlePageChange:x}=(0,eC.Y)(s),{page:u,totalPages:g}=r,v=j.F.useUtils(),[N,y]=(0,i.useState)(null),[w,S]=(0,i.useState)(!1),[C,P]=(0,i.useState)(null),A=j.F.history.deleteBatch.useMutation({onSuccess:e=>{Q.oR.success("Deleted ".concat(e.deletedCount," generation(s)")),v.history.get.invalidate({modelIdentifiers:s}),y(null)},onError:e=>{Q.oR.error("Failed to delete: ".concat(e.message))}}),E=j.F.history.deleteByModels.useMutation({onSuccess:e=>{Q.oR.success("Deleted ".concat(e.deletedCount," generation(s)")),v.history.get.invalidate({modelIdentifiers:s}),S(!1)},onError:e=>{Q.oR.error("Failed to delete: ".concat(e.message))}}),R=A.isPending||E.isPending,F={page:u,limit:10,modelIdentifiers:s},k=(e,s)=>{v.history.get.setData(F,a=>a?{...a,data:a.data.map(a=>a.id===e?{...a,isSaved:s}:a)}:a)},U=j.F.prompt.save.useMutation({onSuccess:(e,s)=>{Q.oR.success("Prompt saved to library"),k(s.sourceGenerationId,!0),v.prompt.list.invalidate()},onError:()=>{Q.oR.error("Failed to save prompt")}}),V=j.F.prompt.delete.useMutation({onSuccess:(e,s)=>{Q.oR.success("Prompt removed from library"),k(s.generationId,!1),v.prompt.list.invalidate()},onError:()=>{Q.oR.error("Failed to remove prompt")}});return a?(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Generation History"}),(0,t.jsx)(h.BT,{children:"Your recent generations"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[r.total>0&&(0,t.jsxs)(f.$,{variant:"outline",size:"sm",onClick:()=>{S(!0)},disabled:R,children:[(0,t.jsx)(ef.A,{className:"h-4 w-4 mr-1"}),"Clear All"]}),(0,t.jsx)(f.$,{variant:"ghost",size:"icon",onClick:()=>m(),disabled:c,title:"Refresh history",children:(0,t.jsx)(ev.A,{className:(0,b.cn)("h-4 w-4",c&&"animate-spin")})}),(0,t.jsx)(f.$,{variant:"ghost",size:"icon",onClick:l,title:"Close history",children:(0,t.jsx)(eN.A,{className:"h-4 w-4"})})]})]})}),(0,t.jsxs)(h.Wu,{className:"-mt-6",children:[(0,t.jsx)(eS.p,{className:"mb-4"}),d&&0===n.length?(0,t.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,t.jsx)(ex.A,{className:"h-6 w-6 animate-spin"}),(0,t.jsx)("span",{className:"ml-2",children:"Loading history..."})]}):o?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-destructive",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Failed to load history"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Please try again later"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"space-y-3 max-h-[400px] overflow-y-auto",children:n.length>0?n.map(s=>{var a;return(0,t.jsxs)("div",{className:"p-3 border rounded-lg flex flex-col sm:flex-row sm:items-center justify-between gap-3 sm:gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 w-full sm:w-auto",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsxs)(p.E,{variant:"outline",className:"text-xs font-mono",children:[s.id.substring(0,8),"..."]}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:(0,eP.$L)(s.modelVariantId)})]}),(0,t.jsx)(eA.A,{prompt:s.prompt,variant:"wrap"}),s.outputs.every(e=>"FAILED"===e.status)&&(0,t.jsx)("p",{className:"text-sm text-destructive mt-1",children:(null==(a=s.outputs[0])?void 0:a.error)||"Generation failed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:new Date(s.createdAt).toLocaleStr
1ing()}),(0,t.jsx)(eF,{outputs:s.outputs})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1 w-full sm:w-auto border-t pt-2 mt-1 sm:border-0 sm:pt-0 sm:mt-0",children:[(0,t.jsx)(f.$,{size:"sm",variant:"outline",onClick:()=>{let a=s.outputs.some(e=>"SUCCEEDED"!==e.status&&"FAILED"!==e.status);e(s.outputs,a?s.id:void 0),l()},children:"View"}),(0,t.jsx)(ew.CopyToClipboard,{text:s.prompt,onCopy:()=>{var e;return e=s.id,void(Q.oR.success("Copied to clipboard"),P(e),setTimeout(()=>P(null),2e3))},children:(0,t.jsx)(f.$,{size:"icon",variant:"ghost",title:"Copy prompt",className:"h-8 w-8",children:C===s.id?(0,t.jsx)(I.A,{className:"h-4 w-4 text-green-500"}):(0,t.jsx)(eb.A,{className:"h-4 w-4"})})}),(0,t.jsx)(f.$,{size:"icon",variant:"ghost",onClick:()=>{s.isSaved?V.mutate({generationId:s.id}):U.mutate({promptText:s.prompt,sourceGenerationId:s.id,sourceModel:"unknown"!==s.modelVariantId?s.modelVariantId:void 0})},disabled:U.isPending||V.isPending,title:s.isSaved?"Remove from saved prompts":"Save prompt",className:"h-8 w-8",children:(0,t.jsx)(ey.A,{className:(0,b.cn)("h-4 w-4",s.isSaved&&"fill-yellow-400 text-yellow-400")})}),(0,t.jsx)(f.$,{size:"icon",variant:"ghost",onClick:()=>{y(s.id)},disabled:R||s.outputs.some(e=>"QUEUED"===e.status||"PROCESSING"===e.status),title:s.outputs.some(e=>"QUEUED"===e.status||"PROCESSING"===e.status)?"Cannot delete in-progress generation":"Delete generation",className:"h-8 w-8",children:(0,t.jsx)(ef.A,{className:"h-4 w-4"})})]})]},s.id)}):(0,t.jsx)("p",{className:"text-center text-muted-foreground py-8",children:"No generation history yet"})}),(0,t.jsx)("div",{className:"mt-4 flex justify-center",children:(0,t.jsx)(eg.PaginationNav,{currentPage:u,totalPages:g,onPageChange:x})}),(0,t.jsx)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground min-h-[20px]",children:c&&n.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ex.A,{className:"h-3 w-3 animate-spin"}),(0,t.jsx)("span",{children:"Refreshing..."})]})})]})]}),(0,t.jsx)(eE.P,{open:null!==N,onOpenChange:e=>!e&&y(null),onConfirm:()=>{N&&A.mutate({ids:[N]})},title:"Delete Generation",description:"Are you sure you want to delete this generation? This action cannot be undone.",isLoading:R}),(0,t.jsx)(eE.P,{open:w,onOpenChange:S,onConfirm:()=>{E.mutate({models:s})},title:"Clear All Generations",description:"Are you sure you want to delete all generations for this model? This will permanently delete ".concat(r.total," generation(s). This action cannot be undone."),isLoading:R,requireCountdown:!0})]}):null}function eF(e){let{outputs:s}=e,a=(0,ec.c_)(s),l="PROCESSING"===a.status?"secondary":"FAILED"===a.status?"destructive":"default";return(0,t.jsx)(p.E,{variant:l,className:"mt-1",children:(0,ec.aG)(a)})}function ek(e){let{demoUrl:s,guidelines:a,children:l}=e,{contentLabel:i}=en(),{isOpen:n,close:r}=W();return(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_3fr] gap-8",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(L,{}),l]}),(0,t.jsxs)("div",{className:"space-y-6 min-w-0",children:[n?(0,t.jsx)(eR,{}):"Image"===i?(0,t.jsx)(eo,{demoImageUrl:s}):(0,t.jsx)(ej,{demoVideoUrl:s}),a]})]})}function eI(e){let{config:s,demoUrl:a,guidelines:l,children:i}=e;return(0,t.jsx)(er,{config:s,children:(0,t.jsx)(ek,{demoUrl:a,guidelines:l,children:i})})}var eU=a(99164),eV=a(32510),eT=a(89766);let eB=i.createContext({size:"default",variant:"default"});function eM(e){let{className:s,variant:a,size:l,children:i,...n}=e;return(0,t.jsx)(eV.bL,{"data-slot":"toggle-group","data-variant":a,"data-size":l,className:(0,b.cn)("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",s),...n,children:(0,t.jsx)(eB.Provider,{value:{variant:a,size:l},children:i})})}function eG(e){let{className:s,children:a,variant:l,size:n,...r}=e,d=i.useContext(eB);return(0,t.jsx)(eV.q7,{"data-slot":"toggle-group-item","data-variant":d.variant||l,"data-size":d.size||n,className:(0,b.cn)((0,eT.v)({variant:d.variant||l,size:d.size||n}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",s),...r,children:a})}var eD=a(5636),eO=a(58601),eW=a(40593),eJ=a(59731);
1function eZ(e){let{cost:s,costDescription:a="per generation"}=e,{userCredits:l}=(0,eJ.b)(),{toggle:i}=W();return(0,t.jsx)(g.Fc,{children:(0,t.jsxs)(g.TN,{className:"text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsxs)("span",{className:"font-medium flex items-center gap-1",children:[(0,t.jsx)(eO.A,{className:"h-3 w-3"})," Your Credits:"," ",(0,t.jsxs)("span",{className:"font-extrabold",children:[" ",l," "]})," ",(0,t.jsx)(eW.A,{className:"h-3 w-3"})]}),(0,t.jsxs)(f.$,{variant:"ghost",size:"sm",onClick:i,className:"text-xs h-auto py-1",children:[(0,t.jsx)(z.A,{className:"h-3 w-3 mr-1"}),"History"]})]}),(0,t.jsx)("span",{className:"font-medium",children:"Credits Required:"})," ".concat(s," credits. (").concat(a,")")]})})}var e_=a(57481);function eL(e){let{modelName:s="This model"}=e;return(0,t.jsxs)(g.Fc,{variant:"destructive",className:"border-amber-500/50 bg-amber-500/10",children:[(0,t.jsx)(em.A,{className:"h-4 w-4 text-amber-600"}),(0,t.jsxs)(g.TN,{className:"text-sm text-amber-900 dark:text-amber-100",children:[(0,t.jsxs)("span",{className:"font-semibold",children:[s," has very strong content filters."]})," ","Failed generations won't cost you credits but will cost you time."," ","You may find a model that better fits your needs on our"," ",(0,t.jsx)(e_.RouteProgressLink,{href:"/models",className:"underline font-medium",children:"models page"}),"."]})]})}var eq=a(31563);function eK(e){let{className:s,...a}=e;return(0,t.jsx)("span",{"data-slot":"shimmer-text",className:(0,b.cn)("bg-clip-text text-transparent","bg-[linear-gradient(90deg,rgba(255,255,255,0.55)_0%,rgba(255,255,255,0.55)_40%,rgba(255,255,255,1)_50%,rgba(255,255,255,0.55)_60%,rgba(255,255,255,0.55)_100%)]","bg-[length:200%_100%]","animate-shimmer-text","motion-reduce:animate-none motion-reduce:bg-none motion-reduce:text-current",s),...a})}var ez=a(93431);function eQ(e){let{onClick:s,disabled:a,credits:l,isPending:n}=e,{contentLabel:r,count:d,setCount:c,batchOptions:o}=en(),[m,x]=(0,i.useState)(!1),u=r.toLowerCase(),h=o.length>1,g=n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ex.A,{className:"mr-2 h-4 w-4 animate-spin"}),(0,t.jsx)(eK,{children:"Submitting..."})]}):d>1?"Generate ".concat(d," ").concat(r,"s"):"Generate ".concat(r);return(0,t.jsxs)("div",{className:"pt-4 flex items-stretch gap-2",children:[(0,t.jsx)(ez.Bc,{children:(0,t.jsxs)(A.AM,{open:m,onOpenChange:x,children:[(0,t.jsxs)(ez.m_,{children:[(0,t.jsx)(ez.k$,{asChild:!0,children:(0,t.jsx)(A.Wv,{asChild:!0,children:(0,t.jsxs)(f.$,{variant:"outline",size:"lg",disabled:n,className:"shrink-0 w-12 px-0 relative","aria-label":"Generate ".concat(d," ").concat(u,"(s) per click"),children:[(0,t.jsx)(eq.A,{className:"h-4 w-4"}),(0,t.jsxs)("span",{className:"absolute -bottom-1 -right-1 text-[10px] font-semibold bg-primary text-primary-foreground rounded-full px-1 min-w-[16px] h-4 flex items-center justify-center leading-none tabular-nums",children:["\xd7",d]})]})})}),(0,t.jsx)(ez.ZI,{children:(0,t.jsx)("p",{children:h?"Generate multiple ".concat(u,"s per click"):"Batch generation for ".concat(u," is coming soon")})})]}),(0,t.jsx)(A.hl,{align:"start",className:"w-auto p-2",children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"px-1 pb-2 text-xs text-muted-foreground",children:"Generations per click"}),(0,t.jsx)(eM,{type:"single",value:String(d),onValueChange:e=>{e&&(c(Number(e)),x(!1))},className:"grid grid-cols-3 gap-1",children:o.map(e=>(0,t.jsxs)(eG,{value:String(e),"aria-label":"".concat(e," per click"),className:"h-9 w-12 tabular-nums",children:["\xd7",e]},e))})]}):(0,t.jsxs)("p",{className:"max-w-[12rem] px-1 py-0.5 text-xs text-muted-foreground",children:["Batch generation for ",u," is coming soon."]})})]})}),(0,t.jsxs)(f.$,{className:"flex-1 bg-primary hover:bg-primary/90 text-primary-foreground font-medium py-3 relative",size:"lg",onClick:s,disabled:n||a,children:[g,(0,t.jsxs)(p.E,{className:"absolute -top-2 -right-2",variant:"secondary",children:[l*d," credits"]})]})]})}function eH(){let{error:e,progress:s}=en();return(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsx)(g.Fc,{variant:"destructive",children:(0,t.jsx)(g.TN,{children:e})}),s&&!e&&(0,t.jsx)(g.Fc,{children:(0,t.jsx)(g.TN,{children:s})})]})}function e$(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!1),[o,x]=(0,i.useState)(""),[u,g]=(0,i.useState)("veo3_fast"),[f,v]=(0,i.useState)("16:9"),{data:N,status:b}=(0,X.wV)(),{requireAuth:y,setError:w}=en(),S=ed(j.F.veo3.create),C={veo3_fast:50,veo3:200},P=C[u];(0,i.useEffect)(()=>{"unauthenticated"===b&&x("A cinematic shot of a bustling Tokyo street at night, neon signs reflecting on wet pavement, people walking with umbrellas, cherry blossoms falling gently. Smooth camera movement, vibrant colors, 4K quality.")},[b]);let A=(0,i.useCallback)(()=>
1{if(y()){if(!o.trim())return void w("Please enter a prompt");S.mutate({model:u,prompt:o,aspectRatio:f,firstFrameImage:e||void 0,lastFrameImage:a||void 0})}},[u,f,e,a,o,y,w,S]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Veo 3.1 Video Generator"}),(0,t.jsx)(h.BT,{children:"Create high-quality videos with Google's Veo 3.1 AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(eL,{modelName:"Veo 3.1"}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Quality Mode"})]}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>e&&g(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsxs)(eG,{value:"veo3_fast",className:"flex-1",children:["Fast (",C.veo3_fast," credits)"]}),(0,t.jsxs)(eG,{value:"veo3",className:"flex-1",children:["Quality (",C.veo3," credits)"]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ep.PromptInput,{value:o,onChange:x,placeholder:"Describe the video you want to create in detail..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Provide detailed descriptions for best results"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Frame Images"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground mb-2 block",children:"First Frame (Optional)"}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"First frame",supportedFormats:"PNG, JPG, WEBP",onUrlChange:N?s:void 0,onUploadingChange:r})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground mb-2 block",children:"Last Frame (Optional)"}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Last frame",supportedFormats:"PNG, JPG, WEBP",onUrlChange:N?l:void 0,onUploadingChange:c})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Upload 0-2 images to guide the video generation (first frame and/or last frame)"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"})]}),(0,t.jsxs)(eM,{type:"single",value:f,onValueChange:e=>e&&v(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"16:9",className:"flex-1",children:"16:9 (Landscape)"}),(0,t.jsx)(eG,{value:"9:16",className:"flex-1",children:"9:16 (Portrait)"})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:A,disabled:n||d||!o.trim(),credits:P,isPending:S.isPending}),(0,t.jsx)(eZ,{cost:P,costDescription:" per generation (".concat("veo3_fast"===u?"Fast":"Quality",") ")})]})]})}let eY=eP.LD["veo-3"];var eX=a(1132),e0=a(82640);function e1(e){let{className:s,...a}=e;return(0,t.jsx)(e0.bL,{"data-slot":"tabs",className:(0,b.cn)("flex flex-col gap-2",s),...a})}function e2(e){let{className:s,...a}=e;return(0,t.jsx)(e0.B8,{"data-slot":"tabs-list",className:(0,b.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",s),...a})}function e4(e){let{className:s,...a}=e;return(0,t.jsx)(e0.l9,{"data-slot":"tabs-trigger",className:(0,b.cn)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focu
1s-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...a})}function e3(e){let{className:s,...a}=e;return(0,t.jsx)(e0.UC,{"data-slot":"tabs-content",className:(0,b.cn)("flex-1 outline-none",s),...a})}var e5=a(70407),e6=a(20241),e8=a(70746);let e9=e8.bL,e7=e8.R6,se=i.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(e8.Ke,{ref:s,forceMount:!0,className:(0,b.cn)("data-[state=closed]:hidden",a),...l})});se.displayName=e8.Ke.displayName;let ss={"480p":45,"720p":90};function sa(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("480p"),[n,r]=(0,i.useState)("landscape"),[d,c]=(0,i.useState)(5),[o,m]=(0,i.useState)(""),[x,u]=(0,i.useState)(-1),[g,f]=(0,i.useState)(!1),{status:v}=(0,X.wV)(),{requireAuth:N,setError:b}=en(),y=ed(j.F.wan22.createT2V);(0,i.useEffect)(()=>{"unauthenticated"===v&&s("A cinematic drone shot flying over a misty mountain range at sunrise, revealing a hidden valley with a crystal-clear lake reflecting golden light")},[v]);let w=Math.ceil(d*ss[a]/5),S=(0,i.useCallback)(()=>{if(N()){if(!e.trim())return void b("Please enter a prompt");y.mutate({resolution:a,orientation:n,prompt:e,duration:d,negative_prompt:o||void 0,seed:-1===x?void 0:x})}},[e,a,n,d,o,x,N,b,y]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos from text prompts with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>{("480p"===e||"720p"===e)&&l(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:n,onValueChange:e=>{("landscape"===e||"portrait"===e)&&r(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]})]}),{})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:d.toString(),onValueChange:e=>{let s=parseInt(e);(5===s||8===s)&&c(s)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"8","aria-label":"8 seconds",className:"flex-1",children:"8 seconds"})]})]}),{}),(0,t.jsxs)(e9,{open:g,onOpenChange:f,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(g?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:o,onChange:e=>m(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:x,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)u(-1);else{let e=parseInt(s,10);isNaN(e)||u(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:S,disabled:!e.trim(),credits:w,isPending:y.isPending}),(0,t.jsx)(eZ,{cost:w,costDescription:" ".concat(w," credits (").concat(d,"s video at ").concat(a,") ")})]})]})}let st={"480p":45,"720p":90};function sl(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(!1),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(""),[u,g]=(0,i.useState)("480p"),[f,v]=(0,i.useState)(5),[N,b]=(0,i.useState)(""),[y,w]=(0,i.useState)(-1),[S,C]=(0,i.useState)(!1),{data:P,status:A}=(0,X.wV)(),{requireAuth:E,setError:R}=en(),F=ed(j.F.wan22.createI2V);(0,i.useEffect)(()=>{"unauthenticated"===A&&x("Camera slowly pans around the subject as soft lighting creates a cinematic atmosphere with smooth, professional motion")},[A]);let k=Math.ceil(f*st[u]/5),I=(0,i.useCallback)(()=>
1{if(E()){if(!e)return void R("Please upload the first frame image");if(!m.trim())return void R("Please enter a prompt");F.mutate({resolution:u,first_image:e,last_image:a||void 0,prompt:m,duration:f,negative_prompt:N||void 0,seed:-1===y?void 0:y})}},[e,a,m,u,f,N,y,E,R,F]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate your images with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Frame Images"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground mb-2 block",children:"First Frame (Required)"}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Start frame",supportedFormats:"PNG, JPG, WEBP",onUrlChange:P?s:void 0,onUploadingChange:d,fullWidthPreview:!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground mb-2 block",children:"Last Frame (Optional)"}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"End frame",supportedFormats:"PNG, JPG, WEBP",onUrlChange:P?l:void 0,onUploadingChange:o,fullWidthPreview:!0})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"First frame is required. Optionally add a last frame to control the video's ending state."})]}),(0,t.jsx)(ep.PromptInput,{value:m,onChange:x,placeholder:"Describe the motion and video you want to create..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>{("480p"===e||"720p"===e)&&g(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:f.toString(),onValueChange:e=>{let s=parseInt(e);(5===s||8===s)&&v(s)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"8","aria-label":"8 seconds",className:"flex-1",children:"8 seconds"})]})]}),{}),(0,t.jsxs)(e9,{open:S,onOpenChange:C,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(S?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:N,onChange:e=>b(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:y,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)w(-1);else{let e=parseInt(s,10);isNaN(e)||w(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:I,disabled:r||c||!m.trim(),credits:k,isPending:F.isPending}),(0,t.jsx)(eZ,{cost:k,costDescription:" ".concat(k," credits (").concat(f,"s video at ").concat(u,") ")})]})]})}let si=eP.LD["wan-2.2"];var sn=a(69248);function sr(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("480p"),[o,m]=(0,i.useState)(5),{data:x,status:u}=(0,X.wV)(),{requireAuth:g,setError:f}=en(),v=ed(j.F.wan22Spicy.create),N={"480p":{5:40,8:64},"720p":{5:75,8:120}}[d][o];(0,i.useEffect)(()=>{"unauthenticated"===u&&r("A cinematic scene with dynamic camera movement through a vibrant cityscape at golden hour. High dynamics with smooth motion, capturing the energy of urban life with vivid colors and natural lighting. Professional quality with seamless transitions.")},[u]);let b=(0,i.useCallback)(()=>{if(g()){if(!e)return void f("Please upload an image for video generation");if(!n.trim())return void f("Please enter a prompt");v.mutate({image:e,prompt:n,resolution:d,duration:o})}},[e,n,d,o,g,f,v]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sn.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"flex items-center gap-2",children:"Wan 2.2 Spicy Generator"}),(0,t.jsx)(h.BT,{children:"Affordable Grok alternative - High dynamics & smooth motion"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload an image to transform into dynamic video",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:x?s:void 0,onUploadingChange:l})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe your desired video with detailed specifications for creative results..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Provide detailed prompts for best results with Wan 2.2 Spicy"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>e&&c(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p (Recommended)"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Duration"})]}),(0,t.jsxs)(eM,{type:"single",value:o.toString(),onValueChange:e=>e&&m(Number(e)),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"8",className:"flex-1",children:"8 seconds"})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:b,disabled:a||!n.trim(),credits:N,isPending:v.isPending}),(0,t.jsx)(eZ,{cost:N,costDescription:" per video (".concat(d,", ").concat(o,"s)")})]})]})}let sd=eP.LD["wan-2.2-spicy"];var sc=a(70284);function so(){let e,[s,a]=(0,i.useState)(null),[l,n]=(0,i.useState)(!1),[r,d
1]=(0,i.useState)(""),[c,o]=(0,i.useState)("480p"),[m,x]=(0,i.useState)("landscape"),[u,g]=(0,i.useState)(5),[f,v]=(0,i.useState)(""),[N,b]=(0,i.useState)(!1),[y,w]=(0,i.useState)(-1),[S,C]=(0,i.useState)(!1),{data:P,status:A}=(0,X.wV)(),{requireAuth:E,setError:R}=en(),k=ed(j.F.wan25.create);(0,i.useEffect)(()=>{"unauthenticated"===A&&d("A vibrant young woman in her early 20s runs toward the camera in Times Square at night, ecstatic and wide-eyed, shouting passionately into a black microphone. She wears a neon green windbreaker and black headphones around her neck. She yells: Yo, Wan 2.5 just dropped on our website â sound and texture are next level, try it right now! Wet reflective streets, glowing blue-white-magenta billboards, blurred pedestrians, dynamic handheld follow-shot, sharp face focus, shallow depth of field. 4K UHD, saturated colors, viral UGC style.")},[A]);let I=(e=40,"720p"===c&&(e=80),"1080p"===c&&(e=120),Math.ceil(u*e/3)),U=(e,s)=>{var a;return(null==(a=({"480p":{landscape:"832*480",portrait:"480*832"},"720p":{landscape:"1280*720",portrait:"720*1280"},"1080p":{landscape:"1920*1080",portrait:"1080*1920"}})[e])?void 0:a[s])||"1280*720"},V=(0,i.useCallback)(()=>
1{if(E()){if(!r.trim())return void R("Please enter a prompt");k.mutate({modelType:"wan25/text-to-video",prompt:r,audio:s||void 0,negative_prompt:f||void 0,size:U(c,m),duration:u,enable_prompt_expansion:N,seed:y})}},[s,r,c,m,u,f,N,y,E,R,k]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos from scratch with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe the video you want to create from scratch..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(sc.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Audio Guide"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload audio to guide generation",supportedFormats:"MP3, WAV supported",onUrlChange:P?a:void 0,onUploadingChange:n})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:c,onValueChange:e=>{("480p"===e||"720p"===e||"1080p"===e)&&o(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),{}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:m,onValueChange:e=>{("landscape"===e||"portrait"===e)&&x(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:u.toString(),onValueChange:e=>{let s=parseInt(e);(5===s||10===s)&&g(s)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"10","aria-label":"10 seconds",className:"flex-1",children:"10 seconds"})]})]}),{})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Output: ",U(c,m)]}),(0,t.jsxs)(e9,{open:S,onOpenChange:C,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(S?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:f,onChange:e=>v(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:N,onCheckedChange:b})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:y,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)w(-1);else{let e=parseInt(s,10);isNaN(e)||w(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:V,disabled:l||!r.trim(),credits:I,isPending:k.isPending}),(0,t.jsx)(eZ,{cost:I,costDescription:" ".concat(I," credits (").concat(u,"s video at ").concat(c,") ")})]})]})}var sm=a(42493);let sx=e=>{let{duration:s,onChange:a}=e;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[s,"s"]})]}),(0,t.jsx)(sm.A,{min:3,max:10,step:1,value:[s],onValueChange:e=>a(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"3s"}),(0,t.jsx)("span",{children:"10s"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Longer videos require more credits"})]})};function su(){let e,[s,a]=(0,i.useState)(null),[l,r]=(0,i.useState)(null),[d,c]=(0,i.useState)(!1),[o,m]=(0,i.useState)(!1),[x,u]=(0,i.useState)(""),[g,f]=(0,i.useState)("480p"),[v,N]=(0,i.useState)(3),[b,y]=(0,i.useState)(""),[w,S]=(0,i.useState)(!1),[C,P]=(0,i.useState)(-1),[A,E]=(0,i.useState)(!1),{data:R,status:k}=(0,X.wV)(),{requireAuth:I,setError:U}=en(),V=ed(j.F.wan25.create);(0,i.useEffect)(()=>{"unauthenticated"===k&&u("A vibrant young woman in her early 20s runs toward the camera in Times Square at night, ecstatic and wide-eyed, shouting passionately into a black microphone. She wears a neon green windbreaker and black headphones around her neck. She yells: Yo, Wan 2.5 just dropped on our website â sound and texture are next level, try it right now! Wet reflective streets, glowing blue-white-magenta billboards, blurred pedestrians, dynamic handheld follow-shot, sharp face focus, shallow depth of field. 4K UHD, saturated colors, viral UGC style.")},[k]);let T=(e=40,"720p"===g&&(e=80),"1080p"===g&&(e=120),Math.ceil(v*e/3)),B=(0,i.useCallback)(()=>{if(I()){if(!s)return void U("Please upload an image for image-to-video generation");if(!x.trim())return void U("Please enter a prompt");V.mutate({modelType:"wan25/image-to-video",image:s,prompt:x,audio:l||void 0,negative_prompt:b||void 0,resolution:g,duration:v,enable_prompt_expansion:w,seed:C})}},[s,l,x,g,v,b,w,C,I,U,V]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate your images with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Input Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Click to upload source image",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:R?a:void 0,onUploadingChange:c})]}),(0,t.jsx)(ep.PromptInput,{value:x,onChange:u,placeholder:"Describe how you want the image to animate..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(sc.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Audio Guide"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload audio to guide generation",supportedFormats:"MP3, WAV supported",onUrlChange:R?r:void 0,onUploadingChange:m})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:g,onValueChange:e=>{("480p"===e||"720p"===e||"1080p"===e)&&f(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Higher resolution requires more credits"})]}),{}),(0,t.jsx)(sx,{duration:v,onChange:N}),(0,t.jsxs)(e9,{open:A,onOpenChange:E,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(A?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:b,onChange:e=>y(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:w,onCheckedChange:S})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:C,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)P(-1);else{let e=parseInt(s,10);isNaN(e)||P(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:B,disabled:d||o||!x.trim(),credits:T,isPending:V.isPending}),(0,t.jsx)(eZ,{cost:T,costDescription:" ".concat(T," credits (").concat(v,"s video at ").concat(g,") ")})]})]})}let sh=e=>{let{duration:s,onChange:a}=e;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[s,"s"]})]}),(0,t.jsx)(sm.A,{min:3,max:10,step:1,value:[s],onValueChange:e=>a(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"3s"}),(0,t.jsx)("span",{children:"10s"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Longer videos require more credits"})]})};function sp(){let e,[s,a]=(0,i.useState)(null),[l,n]=(0,i.useState)(null),[r,d]=(0,i.useState)(!1),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(""),[u,g]=(0,i.useState)("480p"),[f,v]=(0,i.useState)(3),[N,b]=(0,i.useState)(""),[y,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(-1),[P,A]=(0,i.useState)(!1),{data:E,status:R}=(0,X.wV)(),{requireAuth:k,setError:I}=en(),U=ed(j.F.wan25.create);(0,i.useEffect)(()=>{"unauthenticated"===R&&x("Extend the video smoothly, maintaining the same style and motion patterns.")},[R]);let V=(e=45,"720p"===u&&(e=90),"1080p"===u&&(e=135),Math.ceil(f*e/3)),T=(0,i.useCallback)(()=>{if(k()){if(!s)return void I("Please upload a video for video-extend generation");if(!m.trim())return void I("Please enter a prompt");U.mutate({modelType:"wan25/video-extend",video:s,prompt:m,audio:l||void 0,negative_prompt:N||void 0,resolution:u,duration:f,enable_prompt_expansion:y,seed:S})}},[s,l,m,u,f,N,y,S,k,I,U]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Extend"}),(0,t.jsx)(h.BT,{children:"Extend your videos with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Input Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Click to upload source video",supportedFormats:"MP4, MOV, WEBM supported",onUrlChange:E?a:void 0,onUploadingChange:d})]}),(0,t.jsx)(ep.PromptInput,{value:m,onChange:x,placeholder:"Describe how you want to extend the video..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(sc.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Audio Guide"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload audio to guide generation",supportedFormats:"MP3, WAV supported",onUrlChange:E?n:void 0,onUploadingChange:o})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>{("480p"===e||"720p"===e||"1080p"===e)&&g(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Higher resolution requires more credits"})]}),{}),(0,t.jsx)(sh,{duration:f,onChange:v}),(0,t.jsxs)(e9,{open:P,onOpenChange:A,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(P?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:N,onChange:e=>b(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:y,onCheckedChange:w})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:S,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)C(-1);else{let e=parseInt(s,10);isNaN(e)||C(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:T,disabled:r||c||!m.trim(),credits:V,isPending:U.isPending}),(0,t.jsx)(eZ,{cost:V,costDescription:" ".concat(V," credits (").concat(f,"s video at ").concat(u,") ")})]})]})}let sg=eP.LD["wan-2.5"];var sj=a(5917),sf=a(4184),sv=a(72314);function sN(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(""),[r,d]=(0,i.useState)("1440*1440"),[c,o]=(0,i.useState)(1440),[m,x]=(0,i.useState)(1440),[u,g]=(0,i.useState)(-1),[f,v]=(0,i.useState)(!1),[N,b]=(0,i.useState)(!1),{status:y}=(0,X.wV)(),{requireAuth:w,setError:S}=en(),C=ed(j.F.wan25Image.create);(0,i.useEffect)(()=>{"unauthenticated"===y&&s("An exhausted ballerina in a haute couture gown, sitting in an empty subway car, her pointe shoes resting on the seat beside her. The city's nightscape rushes by outside the window. The atmosphere is quiet and lonely after a performance. In the style of candid documentary photography, lit by the carriage's fluorescent lights, cool color palette, photorealistic detail, 8K.")},[y]);let P=(0,i.useCallback)(()=>{if(!w())return;if(!e.trim())return void S("Please enter a prompt");let s="custom"===r?"".concat(c,"*").concat(m):r;C.mutate({modelType:"wan25/text-to-image",prompt:e,size:s,negative_prompt:a||void 0,seed:u,enable_prompt_expansion:f})},[e,a,r,c,m,u,f,w,S,C]),A=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:r,onValueChange:e=>{d(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"768\xd7768",value:"768*768"},{label:"1024\xd71024",value:"1024*1024"},{label:"1280\xd71280",value:"1280*1280"},{label:"1440\xd71440 (Recommended)",value:"1440*1440"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"1280\xd7720",value:"1280*720"},{label:"1440\xd7810",value:"1440*810"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"720\xd71280",value:"720*1280"},{label:"810\xd71440",value:"810*1440"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"1024\xd7768",value:"1024*768"},{label:"1152\xd7864",value:"1152*864"},{label:"1280\xd7960",value:"1280*960"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"768\xd71024",value:"768*1024"},{label:"864\xd71152",value:"864*1152"},{label:"960\xd71280",value:"960*1280"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===r&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width"}),(0,t.jsx)(e6.p,{type:"number",min:768,max:1440,value:c,onChange:e=>o(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1440?(o(1440),Q.oR.warning("Width limited to maximum 1440")):s<768&&(o(768),Q.oR.warning("Width must be at least 768"))},className:"mt-1"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height"}),(0,t.jsx)(e6.p,{type:"number",min:768,max:1440,value:m,onChange:e=>x(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1440?(x(1440),Q.oR.warning("Height limited to maximum 1440")):s<768&&(x(768),Q.oR.warning("Height must be at least 768"))},className:"mt-1"})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All resolutions cost 10 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Text to Image"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Wan 2.5 Image"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onCh
1ange:s,placeholder:"Describe the image you want to create..."}),A,(0,t.jsxs)(e9,{open:N,onOpenChange:b,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(N?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(sf.T,{value:a,onChange:e=>l(e.target.value),placeholder:"What you don't want in the image...",rows:3,className:"resize-none"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:f,onCheckedChange:v})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:u,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)g(-1);else{let e=parseInt(s,10);isNaN(e)||g(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:P,disabled:!e.trim(),credits:10,isPending:C.isPending}),(0,t.jsx)(eZ,{cost:10,costDescription:" ".concat(10," credits (fixed price) ")})]})]})}function sb(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)(""),[x,u]=(0,i.useState)(-1),[g,f]=(0,i.useState)(!1),[v,N]=(0,i.useState)(0),[b,y]=(0,i.useState)(0),{data:w,status:S}=(0,X.wV)(),{requireAuth:C,setError:P}=en(),A=ed(j.F.wan25Image.create);(0,i.useEffect)(()=>{"unauthenticated"===S&&d("Transform this image into a vibrant artistic masterpiece with enhanced colors, improved lighting, and professional composition")},[S]);let E=(0,i.useCallback)(e=>{if(!e){N(0),y(0);return}let s=new Image;s.onload=()=>{URL.revokeObjectURL(s.src);let{width:e,height:a}=s;N(e),y(a);let t=Math.max(e/a,a/e);if(t>13){Q.oR.error("First image aspect ratio (".concat(t.toFixed(1),":1) exceeds maximum allowed (13:1). Please use images with more balanced dimensions.")),N(0),y(0);return}Q.oR.success("Input: ".concat(e,"\xd7").concat(a," | Output: Auto"))},s.onerror=()=>{URL.revokeObjectURL(s.src),Q.oR.error("Failed to detect image dimensions."),N(0),y(0)},s.src=URL.createObjectURL(e)},[]),R=(0,i.useCallback)(()=>{if(C()){if(!r.trim())return void P("Please enter a prompt");if(0===e.length)return void P("Please upload 1-2 images");A.mutate({modelType:"wan25/image-edit",prompt:r,images:e,negative_prompt:c.trim()||void 0,seed:x})}},[e,r,c,x,C,P,A]),F=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Output Size"}),(0,t.jsx)(eM,{type:"single",value:"auto",disabled:!0,className:"w-full",children:(0,t.jsxs)(eG,{value:"auto",className:"w-full gap-2",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),"Auto"]})}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,t.jsx)("p",{children:"⢠1 image: Output matches input aspect ratio"}),(0,t.jsx)("p",{children:"⢠2 images: Output fixed at 1280\xd71280"})]})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Image Edit"}),(0,t.jsx)(h.BT,{children:"Transform and enhance images with AI"})]}),(0,t.jsx)(p.E,{variant:"outline",children:" Wan 2.5 Image"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium",children:["Reference Images (Max: 2) ",(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})," "]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-2 images to edit",supportedFormats:"PNG, JPG, WEBP supported (max 10MB each) ⢠Image size should be in [384, 5000]",maxFiles:2,onFirstFileChange:E,onUrlsChange:w?s:void 0,onUploadingChange:l}),v>0&&b>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["First image size: ",v,"\xd7",b]})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to edit or transform the image..."}),F,(0,t.jsxs)(e9,{open:g,onOpenChange:f,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(g?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(sf.T,{id:"negative-prompt",placeholder:"Describe what you don't want in the image...",value:c,onChange:e=>o(e.target.value),className:"min-h-[80px]"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:x,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)u(-1);else{let e=parseInt(s,10);isNaN(e)||u(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:R,disabled:a||!r.trim(),credits:10,isPending:A.isPending}),(0,t.jsx)(eZ,{cost:10,costDescription:" ".concat(10," credits (fixed price) ")})]})]})}let sy=eP.LD["wan-2.5-image"];function sw(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("720p"),[o,m]=(0,i.useState)("landscape"),[x,u]=(0,i.useState)(5),[g,f]=(0,i.useState)("single"),[v,N]=(0,i.useState)(""),[b,y]=(0,i.useState)(!1),[w,S]=(0,i.useState)(-1),[C,P]=(0,i.useState)(!1),{data:A,status:E}=(0,X.wV)(),{requireAuth:R,setError:k}=en(),I=ed(j.F.wan26.create);(0,i.useEffect)(()=>{"unauthenticated"===E&&r("A vibrant young woman in her early 20s runs toward the camera in Times Square at night, ecstatic and wide-eyed, shouting passionately into a black microphone. She wears a neon green windbreaker and black headphones around her neck. She yells: Yo, Wan 2.6 just dropped on our website â sound and texture are next level, try it right now! Wet reflective streets, glowing blue-white-magenta billboards, blurred pedestrians, dynamic handheld follow-shot, sharp face focus, shallow depth of field. 4K UHD, saturated colors, viral UGC style.")},[E]);let U=x*("1080p"===d?45:30),V=(e,s)=>{var a;return(null==(a=({"720p":{landscape:"1280*720",portrait:"720*1280"},"1080p":{landscape:"1920*1080",portrait:"1080*1920"}})[e])?void 0:a[s])||"1280*720"},T=(0,i.useCallback)(()=>{if(R()){if(!n.trim())return void k("Please enter a prompt");I.mutate({modelType:"wan26/text-to-video",prompt:n,audio:e||void 0,negative_prompt:v||void 0,size:V(d,o),duration:x,shot_type:g,enable_prompt_expansion:b,seed:w})}},[e,n,d,o,x,g,v,b,w,R,k,I]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos from scratch with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the video you want to create from scratch..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(sc.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Audio Guide"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload audio to guide generation",supportedFormats:"MP3, WAV supported",onUrlChange:A?s:void 0,onUploadingChange:l})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>{("720p"===e||"1080p"===e)&&c(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),{}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>{("landscape"===e||"portrait"===e)&&m(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:x.toString(),onValueChange:e=>{let s=parseInt(e);(5===s||10===s||15===s)&&u(s)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5s"}),(0,t.jsx)(eG,{value:"10","aria-label":"10 seconds",className:"flex-1",children:"10s"}),(0,t.jsx)(eG,{value:"15","aria-label":"15 seconds",className:"flex-1",children:"15s"})]})]}),{})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Shot Type"}),(0,t.jsxs)(eM,{type:"single",value:g,onValueChange:e=>{("single"===e||"multi"===e)&&f(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"single","aria-label":"Single shot",className:"flex-1",children:"Single Shot"}),(0,t.jsx)(eG,{value:"multi","aria-label":"Multi shot",className:"flex-1",children:"Multi Shot"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Single shot for continuous scenes, multi shot for varied camera angles"})]}),{}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Output: ",V(d,o)]}),(0,t.jsxs)(e9,{open:C,onOpenChange:P,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(C?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:v,onChange:e=>N(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:b,onCheckedChange:y})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:w,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)S(-1);else{let e=parseInt(s,10);isNaN(e)||S(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:T,disabled:a||!n.trim(),credits:U,isPending:I.isPending}),(0,t.jsx)(eZ,{cost:U,costDescription:"".concat(U," credits (").concat(x,"s video at ").concat(d,")")})]})]})}function sS(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(!1),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(""),[u,g]=(0,i.useState)("720p"),[f,v]=(0,i.useState)(5),[N,b]=(0,i.useState)("single"),[y,w]=(0,i.useState)(""),[S,C]=(0,i.useState)(!1),[P,A]=(0,i.useState)(-1),[E,R]=(0,i.useState)(!1),{data:k,status:I}=(0,X.wV)(),{requireAuth:U,setError:V}=en(),T=ed(j.F.wan26.create);(0,i.useEffect)(()=>{"unauthenticated"===I&&x("A vibrant young woman in her early 20s runs toward the camera in Times Square at night, ecstatic and wide-eyed, shouting passionately into a black microphone. She wears a neon green windbreaker and black headphones around her neck. She yells: Yo, Wan 2.6 just dropped on our website â sound and texture are next level, try it right now! Wet reflective streets, glowing blue-white-magenta billboards, blurred pedestrians, dynamic handheld follow-shot, sharp face focus, shallow depth of field. 4K UHD, saturated colors, viral UGC style.")},[I]);let B=f*("1080p"===u?45:30),M=(0,i.useCallback)(()=>{if(U()){if(!e)return void V("Please upload an image for image-to-video generation");if(!m.trim())return void V("Please enter a prompt");T.mutate({modelType:"wan26/image-to-video",image:e,prompt:m,audio:a||void 0,negative_prompt:y||void 0,resolution:u,duration:f,shot_type:N,enable_prompt_expansion:S,seed:P})}},[e,a,m,u,f,N,y,S,P,U,V,T]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate your images with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Input Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Click to upload source image",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:k?s:void 0,onUploadingChange:d})]}),(0,t.jsx)(ep.PromptInput,{value:m,onChange:x,placeholder:"Describe how you want the image to animate..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(sc.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Audio Guide"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload audio to guide generation",supportedFormats:"MP3, WAV supported",onUrlChange:k?l:void 0,onUploadingChange:o})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>{("720p"===e||"1080p"===e)&&g(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Higher resolution requires more credits"})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:f.toString(),onValueChange:e=>{let s=parseInt(e);(5===s||10===s||15===s)&&v(s)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5s"}),(0,t.jsx)(eG,{value:"10","aria-label":"10 seconds",className:"flex-1",children:"10s"}),(0,t.jsx)(eG,{value:"15","aria-label":"15 seconds",className:"flex-1",children:"15s"})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Shot Type"}),(0,t.jsxs)(eM,{type:"single",value:N,onValueChange:e=>{("single"===e||"multi"===e)&&b(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"single","aria-label":"Single shot",className:"flex-1",children:"Single Shot"}),(0,t.jsx)(eG,{value:"multi","aria-label":"Multi shot",className:"flex-1",children:"Multi Shot"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Single shot for continuous scenes, multi shot for varied camera angles"})]}),{}),(0,t.jsxs)(e9,{open:E,onOpenChange:R,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(E?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:y,onChange:e=>w(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:S,onCheckedChange:C})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:P,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)A(-1);else{let e=parseInt(s,10);isNaN(e)||A(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:M,disabled:r||c||!m.trim(),credits:B,isPending:T.isPending}),(0,t.jsx)(eZ,{cost:B,costDescription:"".concat(B," credits (").concat(f,"s video at ").concat(u,")")})]})]})}function sC(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!1),[o,m]=(0,i.useState)(""),[x,u]=(0,i.useState)("720p"),[g,f]=(0,i.useState)("landscape"),[v,N]=(0,i.useState)(5),[b,y]=(0,i.useState)("single"),[w,S]=(0,i.useState)(""),[C,P]=(0,i.useState)(!1),[A,E]=(0,i.useState)(-1),[R,k]=(0,i.useState)(!1),{data:I,status:U}=(0,X.wV)(),{requireAuth:V,setError:T}=en(),B=ed(j.F.wan26.create);(0,i.useEffect)(()=>{"unauthenticated"===U&&m("A vibrant young woman in her early 20s runs toward the camera in Times Square at night, ecstatic and wide-eyed, shouting passionately into a black microphone. She wears a neon green windbreaker and black headphones around her neck. She yells: Yo, Wan 2.6 just dropped on our website â sound and texture are next level, try it right now! Wet reflective streets, glowing blue-white-magenta billboards, blurred pedestrians, dynamic handheld follow-shot, sharp face focus, shallow depth of field. 4K UHD, saturated colors, viral UGC style.")},[U]);let M=v*("1080p"===x?90:60),G="1080p"===x?90:60,D=(e,s)=>{var a;return(null==(a=({"720p":{landscape:"1280*720",portrait:"720*1280"},"1080p":{landscape:"1920*1080",portrait:"1080*1920"}})[e])?void 0:a[s])||"1280*720"},O=(0,i.useCallback)(()=>{if(V()){if(0===e.length)return void T("Please upload at least one reference video");if(!o.trim())return void T("Please enter a prompt");B.mutate({modelType:"wan26/reference-to-video",videos:e,prompt:o,audio:a||void 0,negative_prompt:w||void 0,size:D(x,g),duration:v,shot_type:b,enable_prompt_expansion:C,seed:A})}},[e,a,o,x,g,v,b,w,C,A,V,T,B]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sj.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Reference to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos using reference videos"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Videos"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload reference videos (up to 2)",supportedFormats:"MP4, MOV, WEBM supported",maxFiles:2,onUrlsChange:I?s:void 0,onUploadingChange:r}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Upload 1-2 reference videos to guide generation. Reference mode uses ",G," credits/s."]})]}),(0,t.jsx)(ep.PromptInput,{value:o,onChange:m,placeholder:"Describe the video you want to create using the references..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(sc.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Audio Guide"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload audio to guide generation",supportedFormats:"MP3, WAV supported",onUrlChange:I?l:void 0,onUploadingChange:c})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:x,onValueChange:e=>{("720p"===e||"1080p"===e)&&u(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),{}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:g,onValueChange:e=>{("landscape"===e||"portrait"===e)&&f(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:v.toString(),onValueChange:e=>{let s=parseInt(e);(5===s||10===s)&&N(s)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"10","aria-label":"10 seconds",className:"flex-1",children:"10 seconds"})]})]}),{})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Shot Type"}),(0,t.jsxs)(eM,{type:"single",value:b,onValueChange:e=>{("single"===e||"multi"===e)&&y(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"single","aria-label":"Single shot",className:"flex-1",children:"Single Shot"}),(0,t.jsx)(eG,{value:"multi","aria-label":"Multi shot",className:"flex-1",children:"Multi Shot"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Single shot for continuous scenes, multi shot for varied camera angles"})]}),{}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Output: ",D(x,g)]}),(0,t.jsxs)(e9,{open:R,onOpenChange:k,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(R?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:w,onChange:e=>S(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:C,onCheckedChange:P})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:A,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)E(-1);else{let e=parseInt(s,10);isNaN(e)||E(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:O,disabled:n||d||!o.trim(),credits:M,isPending:B.isPending}),(0,t.jsx)(eZ,{cost:M,costDescription:"".concat(M," credits (").concat(v,"s video, ").concat(G," credits/s)")})]})]})}let sP=eP.LD["wan-2.6"];var sA=a(66467),sE=a(18984);function sR(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("720p"),[o,m]=(0,i.useState)("16:9"),[x,u]=(0,i.useState)(5),[g,f]=(0,i.useState)(""),[v,N]=(0,i.useState)(!1),[b,y]=(0,i.useState)(-1),[w,S]=(0,i.useState)(!1),{data:C,status:P}=(0,X.wV)(),{requireAuth:A,setError:E}=en(),R=ed(j.F.wan27.create);(0,i.useEffect)(()=>{"unauthenticated"===P&&r("A vibrant young woman in her early 20s runs toward the camera in Times Square at night, ecstatic and wide-eyed, shouting passionately into a black microphone. Wet reflective streets, glowing blue-white-magenta billboards, blurred pedestrians, dynamic handheld follow-shot, sharp face focus, shallow depth of field. 4K UHD, saturated colors, viral UGC style.")},[P]);let k=x*("1080p"===d?45:30),I=(0,i.useCallback)(()=>{if(A()){if(!n.trim())return void E("Please enter a prompt");
1R.mutate({modelType:"wan27/text-to-video",prompt:n,audio:e||void 0,negative_prompt:g||void 0,resolution:d,aspect_ratio:o,duration:x,enable_prompt_expansion:v,seed:b})}},[e,n,d,o,x,g,v,b,R]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos from scratch with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the video you want to create from scratch..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>{("720p"===e||"1080p"===e)&&c(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>{["16:9","9:16","1:1","4:3","3:4"].includes(e)&&m(e)},className:"w-full grid grid-cols-5 gap-2",children:[(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16",className:"flex-1",children:"9:16"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1",className:"flex-1",children:"1:1"}),(0,t.jsx)(eG,{value:"4:3","aria-label":"4:3",className:"flex-1",children:"4:3"}),(0,t.jsx)(eG,{value:"3:4","aria-label":"3:4",className:"flex-1",children:"3:4"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[x,"s"]})]}),(0,t.jsx)(sm.A,{min:2,max:15,step:1,value:[x],onValueChange:e=>u(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"2s"}),(0,t.jsx)("span",{children:"15s"})]})]}),(0,t.jsxs)(e9,{open:w,onOpenChange:S,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(w?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(sc.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Audio Guide"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload audio to guide generation",supportedFormats:"MP3, WAV supported",onUrlChange:C?s:void 0,onUploadingChange:l})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:g,onChange:e=>f(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:v,onCheckedChange:N})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:b,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)y(-1);else{let e=parseInt(s,10);isNaN(e)||y(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:I,disabled:a||!n.trim(),credits:k,isPending:R.isPending}),(0,t.jsx)(eZ,{cost:k,costDescription:"".concat(k," credits (").concat(x,"s video at ").concat(d,")")})]})]})}function sF(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(null),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),[u,g]=(0,i.useState)(!1),[f,v]=(0,i.useState)(""),[N,b]=(0,i.useState)("720p"),[y,w]=(0,i.useState)(5),[S,C]=(0,i.useState)(""),[P,A]=(0,i.useState)(!1),[E,R]=(0,i.useState)(-1),[k,I]=(0,i.useState)(!1),{data:U,status:V}=(0,X.wV)(),{requireAuth:T,setError:B}=en(),M=ed(j.F.wan27.create);(0,i.useEffect)(()=>{"unauthenticated"===V&&v("Animate this image with smooth, natural motion while preserving the original style and composition.")},[V]);let G=y*("1080p"===N?45:30),D=(0,i.useCallback)(()=>{if(T()){if(!e)return void B("Please upload an image for image-to-video generation");if(!f.trim())return void B("Please enter a prompt");M.mutate({modelType:"wan27/image-to-video",image:e,last_image:a||void 0,prompt:f,audio:r||void 0,negative_prompt:S||void 0,resolution:N,duration:y,enable_prompt_expansion:P,seed:E})}},[e,a,r,f,N,y,S,P,E,M]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate your images with AI, with optional last frame control"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Upload Images"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"First Frame"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:U?s:void 0,onUploadingChange:o})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Last Frame"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the last frame",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:U?l:void 0,onUploadingChange:x})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3",children:"Upload only the first frame for standard mode. Upload both to control how the video ends."})]}),(0,t.jsx)(ep.PromptInput,{value:f,onChange:v,placeholder:"Describe how you want the image to animate..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:N,onValueChange:e=>{("720p"===e||"1080p"===e)&&b(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[y,"s"]})]}),(0,t.jsx)(sm.A,{min:2,max:15,step:1,value:[y],onValueChange:e=>w(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"2s"}),(0,t.jsx)("span",{children:"15s"})]})]}),(0,t.jsxs)(e9,{open:k,onOpenChange:I,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(k?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(sc.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Audio Guide"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload audio to guide generation",supportedFormats:"MP3, WAV supported",onUrlChange:U?d:void 0,onUploadingChange:g})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:S,onChange:e=>C(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:P,onCheckedChange:A})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:E,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)R(-1);else{let e=parseInt(s,10);isNaN(e)||R(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:D,disabled:c||m||u||!f.trim(),credits:G,isPending:M.isPending}),(0,t.jsx)(eZ,{cost:G,costDescription:"".concat(G," credits (").concat(y,"s video at ").concat(N,")")})]})]})}function sk(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!1),[o,m]=(0,i.useState)(""),[x,u]=(0,i.useState)("720p"),[g,f]=(0,i.useState)(5),[v,N]=(0,i.useState)(""),[b,y]=(0,i.useState)(!1),[w,S]=(0,i.useState)(-1),[C,P]=(0,i.useState)(!1),{data:A,status:E}=(0,X.wV)(),{requireAuth:R,setError:k}=en(),I=ed(j.F.wan27.create);(0,i.useEffect)(()=>{"unauthenticated"===E&&m("Extend the video smoothly, maintaining the same style and motion patterns.")},[E]);let U=g*("1080p"===x?45:30),V=(0,i.useCallback)(()=>{if(R()){if(!e)return void k("Please upload a video for video-extend generation");if(!o.trim())return void k("Please enter a prompt");I.mutate({modelType:"wan27/video-extend",video:e,prompt:o,audio:a||void 0,negative_prompt:v||void 0,resolution:x,duration:g,enable_prompt_expansion:b,seed:w})}},[e,a,o,x,g,v,b,w,I]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Extend"}),(0,t.jsx)(h.BT,{children:"Extend your videos with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Input Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Click to upload source video",supportedFormats:"MP4, MOV, WEBM supported",onUrlChange:A?s:void 0,onUploadingChange:r})]}),(0,t.jsx)(ep.PromptInput,{value:o,onChange:m,placeholder:"Describe how you want to extend the video..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:x,onValueChange:e=>{("720p"===e||"1080p"===e)&&u(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Total Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[g,"s"]})]}),(0,t.jsx)(sm.A,{min:5,max:15,step:1,value:[g],onValueChange:e=>f(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"5s"}),(0,t.jsx)("span",{children:"15s"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Total duration of the final output video"})]}),(0,t.jsxs)(e9,{open:C,onOpenChange:P,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(C?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(sc.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Audio Guide"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload audio to guide generation",supportedFormats:"MP3, WAV supported",onUrlChange:A?l:void 0,onUploadingChange:c})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:v,onChange:e=>N(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:b,onCheckedChange:y})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:w,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)S(-1);else{let e=parseInt(s,10);isNaN(e)||S(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:V,disabled:n||d||!o.trim(),credits:U,isPending:I.isPending}),(0,t.jsx)(eZ,{cost:U,costDescription:"".concat(U," credits (").concat(g,"s video at ").concat(x,")")})]})]})}function sI(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)([]),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!1),[o,m]=(0,i.useState)(""),[x,u]=(0,i.useState)("720p"),[g,f]=(0,i.useState)(0),[v,N]=(0,i.useState)("auto"),[b,y]=(0,i.useState)(""),[w,S]=(0,i.useState)(!1),[C,P]=(0,i.useState)(-1),[A,E]=(0,i.useState)(!1),{data:R,status:k}=(0,X.wV)(),{requireAuth:I,setError:U}=en(),V=ed(j.F.wan27.create);(0,i.useEffect)(()=>{"unauthenticated"===k&&m("Transform the video with a cinematic color grading and smooth transitions.")},[k]);let T=(0===g?5:g)*("1080p"===x?45:30),B=(0,i.useCallback)(()=>{if(I()){if(!e)return void U("Please upload a video for video editing");if(!o.trim())return void U("Please enter a prompt");V.mutate({modelType:"wan27/video-edit",video:e,images:a.length>0?a:void 0,prompt:o,negative_prompt:b||void 0,resolution:x,duration:g,audio_setting:v,enable_prompt_expansion:w,seed:C})}},[e,a,o,x,g,v,b,w,C,V]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sE.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Edit"}),(0,t.jsx)(h.BT,{children:"Edit videos with prompt-driven AI and optional reference images"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Source Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Click to upload source video to edit",supportedFormats:"MP4, MOV, WEBM supported",onUrlChange:R?s:void 0,onUploadingChange:r})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional (0-3)"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Click to upload reference images for editing",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:R?e=>{e&&a.length<3&&l(s=>[...s,e])}:void 0,onUploadingChange:c}),a.length>0&&(0,t.jsx)("div",{className:"mt-2 space-y-1",children:a.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground bg-muted/50 px-2 py-1 rounded",children:[(0,t.jsxs)("span",{children:["Reference image ",s+1]}),(0,t.jsx)("button",{type:"button",className:"text-destructive hover:text-destructive/80",onClick:()=>l(e=>e.filter((e,a)=>a!==s)),children:"Remove"})]},s))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Upload up to 3 reference images to guide the video editing"})]}),(0,t.jsx)(ep.PromptInput,{value:o,onChange:m,placeholder:"Describe how you want to edit the video..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:x,onValueChange:e=>{("720p"===e||"1080p"===e)&&u(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:0===g?"Auto":"".concat(g,"s")})]}),(0,t.jsx)(sm.A,{min:0,max:10,step:1,value:[g],onValueChange:e=>f(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"Auto"}),(0,t.jsx)("span",{children:"10s"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 (Auto) uses input video length (max 10s). Set 2-10 to trim from start."})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Audio Setting"}),(0,t.jsxs)(eM,{type:"single",value:v,onValueChange:e=>{("auto"===e||"origin"===e)&&N(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"auto","aria-label":"Auto audio",className:"flex-1",children:"Auto"}),(0,t.jsx)(eG,{value:"origin","aria-label":"Original audio",className:"flex-1",children:"Keep Original"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Auto lets the model decide based on prompt; Keep Original preserves the source audio"})]}),(0,t.jsxs)(e9,{open:A,onOpenChange:E,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(A?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{placeholder:"What you don't want in the video...",value:b,onChange:e=>y(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let AI optimize your prompt for better results"})]}),(0,t.jsx)(F,{checked:w,onCheckedChange:S})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:C,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)P(-1);else{let e=parseInt(s,10);isNaN(e)||P(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:B,disabled:n||d||!o.trim(),credits:T,isPending:V.isPending}),(0,t.jsx)(eZ,{cost:T,costDescription:"".concat(0===g?"~":"").concat(T," credits (").concat(0===g?"auto":g+"s"," video at ").concat(x,")")})]})]})}let sU=eP.LD["wan-2.7"],sV=["text-to-video","image-to-video","video-extend","video-edit"];var sT=a(13367),sB=a(59999);let sM={standard:9,pro:23},sG={"1:1":[{label:"768x768",value:"768*768"},{label:"1024x1024 (Default)",value:"1024*1024"},{label:"1280x1280",value:"1280*1280"},{label:"2048x2048",value:"2048*2048"}],"16:9":[{label:"1024x576",value:"1024*576"},{label:"1280x720",value:"1280*720"},{label:"1920x1080",value:"1920*1080"}],"9:16":[{label:"576x1024",value:"576*1024"},{label:"720x1280",value:"720*1280"},{label:"1080x1920",value:"1080*1920"}],"4:3":[{label:"1024x768",value:"1024*768"},{label:"1280x960",value:"1280*960"}],"3:4":[{label:"768x1024",value:"768*1024"},{label:"960x1280",value:"960*1280"}]},sD={"1:1":[{label:"1024x1024 (Default)",value:"1024*1024"},{label:"2048x2048",value:"2048*2048"},{label:"4096x4096 (4K)",value:"4096*4096"}],"16:9":[{label:"1280x720",value:"1280*720"},{label:"1920x1080",value:"1920*1080"},{label:"3840x2160 (4K)",value:"3840*2160"}],"9:16":[{label:"720x1280",value:"720*1280"},{label:"1080x1920",value:"1080*1920"},{label:"2160x3840 (4K)",value:"2160*3840"}],"4:3":[{label:"1024x768",value:"1024*768"},{label:"1280x960",value:"1280*960"},{label:"2048x1536",value:"2048*1536"}],"3:4":[{label:"768x1024",value:"768*1024"},{label:"960x1280",value:"960*1280"},{label:"1536x2048",value:"1536*2048"}]};function sO(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("standard"),[r,d]=(0,i.useState)("2048*2048"),[c,o]=(0,i.useState)(2048),[m,x]=(0,i.useState)(2048),[u,f]=(0,i.useState)(!1),[v,N]=(0,i.useState)(-1),[b,y]=(0,i.useState)(!1),{status:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=sM[a],A="pro"===a?sD:sG,E="pro"===a?8192:4096,R=ed(j.F.wan27Image.create);(0,i.useEffect)(()=>{"custom"!==r&&(Object.values(A).flat().map(e=>e.value).includes(r)||d("2048*2048"))},[a,r,A]),(0,i.useEffect)(()=>{"unauthenticated"===w&&s("An exhausted ballerina in a haute couture gown, sitting in an empty subway car, her pointe shoes resting on the seat beside her. The city's nightscape rushes by outside the window. The atmosphere is quiet and lonely after a performance. In the style of candid documentary photography, lit by the carriage's fluorescent lights, cool color palette, photorealistic detail, 8K.")},[w]);let k=(0,i.useCallback)(()=>{if(!S())return;if(!e.trim())return void C("Please enter a prompt");let s="custom"===r?"".concat(c,"*").concat(m):r;R.mutate({modelType:"wan27-image/text-to-image",prompt:e,size:s,thinking_mode:u,seed:v,quality:a})},[e,r,c,m,u,v,a,S,C,R]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Text to Image"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Wan 2.7 Image"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)(g.Fc,{variant:"destructive",className:"border-amber-500/50 bg-amber-500/10",children:[(0,t.jsx)(sT.A,{className:"h-4 w-4 text-amber-600"}),(0,t.jsxs)(g.TN,{className:"text-sm text-amber-900 dark:text-amber-100",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Text-to-Image mode has content filtering."})," ","Sensitive parts of your prompt may be silently ignored or rewritten, causing results to differ from your intent. This does not apply to Image Edit mode."]})]}
1),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the image you want to create..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Quality"}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>{e&&l(e)},className:"w-full",children:[(0,t.jsxs)(eG,{value:"standard",className:"flex-1 gap-2",children:["Standard",(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[sM.standard," credits"]})]}),(0,t.jsxs)(eG,{value:"pro",className:"flex-1 gap-2",children:["Pro",(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[sM.pro," credits"]})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"pro"===a?"Pro: Up to 4K resolution (4096x4096 max)":"Standard: Up to 2K resolution (2048x2048 max)"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:r,onValueChange:e=>{d(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),A["1:1"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),A["16:9"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),A["9:16"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),A["4:3"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),A["3:4"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===r&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width"}),(0,t.jsx)(e6.p,{type:"number",min:512,max:E,value:c,onChange:e=>o(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>E?(o(E),Q.oR.warning("Width limited to maximum ".concat(E))):s<512&&(o(512),Q.oR.warning("Width must be at least ".concat(512)))},className:"mt-1"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height"}),(0,t.jsx)(e6.p,{type:"number",min:512,max:E,value:m,onChange:e=>x(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>E?(x(E),Q.oR.warning("Height limited to maximum ".concat(E))):s<512&&(x(512),Q.oR.warning("Height must be at least ".concat(512)))},className:"mt-1"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(sB.A,{className:"w-4 h-4 text-primary"}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Thinking Mode"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Enhanced reasoning improve image quality, but may result in stricter content filtering."})]})]}),(0,t.jsx)(F,{checked:u,onCheckedChange:f})]}),(0,t.jsxs)(e9,{open:b,onOpenChange:y,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(b?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:v,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)N(-1);else{let e=parseInt(s,10);isNaN(e)||N(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:k,disabled:!e.trim(),credits:P,isPending:R.isPending}),(0,t.jsx)(eZ,{cost:P,costDescription:" ".concat(P," credits (").concat("pro"===a?"Pro":"Standard",") ")})]})]})}let sW={standard:9,pro:23},sJ={"1:1":[{label:"768x768",value:"768*768"},{label:"1024x1024",value:"1024*1024"},{label:"1280x1280",value:"1280*1280"},{label:"2048x2048",value:"2048*2048"}],"16:9":[{label:"1280x720",value:"1280*720"},{label:"1920x1080",value:"1920*1080"}],"9:16":[{label:"720x1280",value:"720*1280"},{label:"1080x1920",value:"1080*1920"}],"4:3":[{label:"1024x768",value:"1024*768"},{label:"1280x960",value:"1280*960"}],"3:4":[{label:"768x1024",value:"768*1024"},{label:"960x1280",value:"960*1280"}]};function sZ(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("standard"),[m,x]=(0,i.useState)("auto"),[u,g]=(0,i.useState)(1024),[f,v]=(0,i.useState)(1024),[N,b]=(0,i.useState)(-1),[y,w]=(0,i.useState)(!1),{data:S,status:C}=(0,X.wV)(),{requireAuth:P,setError:A}=en(),E=sW[c],R=ed(j.F.wan27Image.create);(0,i.useEffect)(()=>{"unauthenticated"===C&&d("Transform this image into a vibrant artistic masterpiece with enhanced colors, improved lighting, and professional composition")},[C]);let F=(0,i.useCallback)(()=>{if(!P())return;if(!r.trim())return void A("Please enter a prompt");if(0===e.length)return void A("Please upload at least 1 image");let s="auto"===m?void 0:"custom"===m?"".concat(u,"*").concat(f):m;R.mutate({modelType:"wan27-image/image-edit",prompt:r,images:e,size:s,seed:N,quality:c})},[e,r,m,u,f,N,c,P,A,R]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Image Edit"}),(0,t.jsx)(h.BT,{children:"Transform and enhance images with AI"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Wan 2.7 Image"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium",children:["Reference Images (Max: ",9,") ",(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-".concat(9," images to edit"),supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:9,onUrlsChange:S?s:void 0,onUploadingChange:l})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to edit or transform the image..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Quality"}),(0,t.jsxs)(eM,{type:"single",value:c,onValueChange:e=>{e&&o(e)},className:"w-full",children:[(0,t.jsxs)(eG,{value:"standard",className:"flex-1 gap-2",children:["Standard",(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[sW.standard," credits"]})]}),(0,t.jsxs)(eG,{value:"pro",className:"flex-1 gap-2",children:["Pro",(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[sW.pro," credits"]})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"pro"===c?"Pro: Higher quality editing with up to 2K output":"Standard: Fast editing with good quality"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Output Size"}),(0,t.jsxs)(sv.l6,{value:m,onValueChange:x,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select output size"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"auto",children:"Auto"}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),Object.entries(sJ).map(e=>{let[s,a]=e;return(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:s}),a.map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]},s)})]})]}),"custom"===m&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width"}),(0,t.jsx)(e6.p,{type:"number",min:512,max:4096,value:u,onChange:e=>g(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>4096?(g(4096),Q.oR.warning("Width limited to maximum ".concat(4096))):s<512&&(g(512),Q.oR.warning("Width must be at least ".concat(512)))},className:"mt-1"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height"}),(0,t.jsx)(e6.p,{type:"number",min:512,max:4096,value:f,onChange:e=>v(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>4096?(v(4096),Q.oR.warning("Height limited to maximum ".concat(4096))):s<512&&(v(512),Q.oR.warning("Height must be at least ".concat(512)))},className:"mt-1"})]})]})]}),(0,t.jsxs)(e9,{open:y,onOpenChange:w,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(y?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:N,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)b(-1);else{let e=parseInt(s,10);isNaN(e)||b(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:F,disabled:a||!r.trim(),credits:E,isPending:R.isPending}),(0,t.jsx)(eZ,{cost:E,costDescription:" ".concat(E," credits (").concat("pro"===c?"Pro":"Standard",") ")})]})]})}let s_=eP.LD["wan-2.7-image"];var sL=a(6758);function sq(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("1024*1024"),[r,d]=(0,i.useState)(1024),[c,o]=(0,i.useState)(1024),[m,x]=(0,i.useState)(-1),[u,g]=(0,i.useState)(!1),{status:f}=(0,X.wV)(),{requireAuth:v,setError:N}=en(),b=ed(j.F.qwenImage.create);(0,i.useEffect)(()=>{"unauthenticated"===f&&s("A serene landscape with mountains at sunset, vibrant colors, photorealistic, 8K quality")},[f]);let y=(0,i.useCallback)(()=>{if(!v())return;if(!e.trim())return void N("Please enter a prompt");let s="custom"===a?"".concat(r,"*").concat(c):a;b.mutate({modelType:"qwen-image/text-to-image",prompt:e,size:s,seed:m})},[e,a,r,c,m,v,N,b]),w=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:a,onValueChange:e=>{l(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"1024\xd71024 (default)",value:"1024*1024"},{label:"1280\xd71280",value:"1280*1280"},{label:"1440\xd71440",value:"1440*1440"},{label:"1536\xd71536",value:"1536*1536"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"1280\xd7720",value:"1280*720"},{label:"1440\xd7810",value:"1440*810"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"720\xd71280",value:"720*1280"},{label:"810\xd71440",value:"810*1440"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"1024\xd7768",value:"1024*768"},{label:"1280\xd7960",value:"1280*960"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"768\xd71024",value:"768*1024"},{label:"960\xd71280",value:"960*1280"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===a&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:r,onChange:e=>d(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?d(1536):s<256&&d(256)}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:c,onChange:e=>o(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?o(1536):s<256&&o(256)}})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All resolutions cost 8 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Text to Image"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Qwen Image"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onCh
1ange:s,placeholder:"Describe the image you want to create..."}),w,(0,t.jsxs)(e9,{open:u,onOpenChange:g,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(u?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:m,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)x(-1);else{let e=parseInt(s,10);isNaN(e)||x(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:y,disabled:!e.trim(),credits:8,isPending:b.isPending}),(0,t.jsx)(eZ,{cost:8,costDescription:" ".concat(8," credits (fixed price) ")})]})]})}function sK(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("1024*1024"),[m,x]=(0,i.useState)(1024),[u,g]=(0,i.useState)(1024),[f,v]=(0,i.useState)(0),[N,b]=(0,i.useState)(0),[y,w]=(0,i.useState)(-1),[S,C]=(0,i.useState)(!1),{data:P,status:A}=(0,X.wV)(),{requireAuth:E,setError:R}=en(),F=ed(j.F.qwenImage.create);(0,i.useEffect)(()=>{"unauthenticated"===A&&d("Transform this image into a vibrant artistic masterpiece with enhanced colors and professional lighting")},[A]);let k=(0,i.useCallback)(function(e,s){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1536;if(e>=a&&e<=t&&s>=a&&s<=t)return{width:e,height:s};let l=e/s,i=e,n=s;return e>t&&(i=t,n=Math.round(t/l)),n>t&&(n=t,i=Math.round(t*l)),i<a&&(i=a,n=Math.round(a/l)),n<a&&(n=a,i=Math.round(a*l)),{width:i,height:n}},[]),I=(0,i.useCallback)(e=>{if(!e){v(0),b(0),o("1024*1024");return}let s=new Image;s.onload=()=>{URL.revokeObjectURL(s.src);let{width:e,height:a}=s;v(e),b(a);let t=k(e,a),l=t.width!==e||t.height!==a;o("custom"),x(t.width),g(t.height),l?Q.oR.success("Original: ".concat(e,"\xd7").concat(a," â Resized: ").concat(t.width,"\xd7").concat(t.height," (kept aspect ratio)")):Q.oR.success("Image size detected: ".concat(e,"\xd7").concat(a," ⢠Output will match input dimensions"))},s.onerror=()=>{URL.revokeObjectURL(s.src),Q.oR.error("Failed to read image dimensions"),v(0),b(0)},s.src=URL.createObjectURL(e)},[k]),U=(0,i.useCallback)(()=>{if(!E())return;if(!r.trim())return void R("Please enter a prompt");if(0===e.length)return void R("Please upload 1-3 images");let s="custom"===c?"".concat(m,"*").concat(u):c;F.mutate({modelType:"qwen-image/edit-plus",prompt:r,images:e,size:s,seed:y})},[e,r,c,m,u,y,E,R,F]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Image Edit"}),(0,t.jsx)(h.BT,{children:"Multi-image editing with advanced ControlNet support"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Qwen Image"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium",children:["Reference Images (1-3) ",(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})," "]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-3 images to edit",supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:3,onFirstFileChange:I,onUrlsChange:P?s:void 0,onUploadingChange:l}),e.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.length," image",e.length>
11?"s":""," selected ⢠Multi-image editing enables style fusion and consistency"]})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to edit or transform the image..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Output Size"}),(0,t.jsxs)(sv.l6,{value:c,onValueChange:e=>{o(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select size"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),(0,t.jsx)(sv.eb,{value:"1024*1024",children:"1024\xd71024 (default)"}),(0,t.jsx)(sv.eb,{value:"1280*1280",children:"1280\xd71280"}),(0,t.jsx)(sv.eb,{value:"1440*1440",children:"1440\xd71440"}),(0,t.jsx)(sv.eb,{value:"1536*1536",children:"1536\xd71536"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),(0,t.jsx)(sv.eb,{value:"1280*720",children:"1280\xd7720"}),(0,t.jsx)(sv.eb,{value:"1440*810",children:"1440\xd7810"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),(0,t.jsx)(sv.eb,{value:"720*1280",children:"720\xd71280"}),(0,t.jsx)(sv.eb,{value:"810*1440",children:"810\xd71440"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),(0,t.jsx)(sv.eb,{value:"1024*768",children:"1024\xd7768"}),(0,t.jsx)(sv.eb,{value:"1280*960",children:"1280\xd7960"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),(0,t.jsx)(sv.eb,{value:"768*1024",children:"768\xd71024"}),(0,t.jsx)(sv.eb,{value:"960*1280",children:"960\xd71280"})]})]})]}),"custom"===c&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:m,onChange:e=>x(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?(x(1536),Q.oR.warning("Width limited to maximum 1536px")):s<256&&(x(256),Q.oR.warning("Width must be at least 256px"))}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:u,onChange:e=>g(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?(g(1536),Q.oR.warning("Height limited to maximum 1536px")):s<256&&(g(256),Q.oR.warning("Height must be at least 256px"))}})]})]}),f>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Input: ",f,"\xd7",N,"custom"===c&&" ⢠Using detected dimensions"]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All sizes cost 8 credits"})]}),(0,t.jsxs)(e9,{open:S,onOpenChange:C,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(S?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:y,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)w(-1);else{let e=parseInt(s,10);isNaN(e)||w(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:U,disabled:a||!r.trim(),credits:8,isPending:F.isPending}),(0,t.jsx)(eZ,{cost:8,costDescription:" ".concat(8," credits (fixed price) ")})]})]})}var sz=a(52100),sQ=a(67310);function sH(e){let{horizontalAngle:s,verticalAngle:a,distance:l}=e,n=(0,i.useMemo)(()=>new sQ.Pq0(0,.75,0),[]),r=(0,i.useMemo)(()=>{let e=s*Math.PI/180,t=a*Math.PI/180,i=1.5+.5*l,r=i*Math.sin(e)*Math.cos(t),d=i*Math.sin(t)+n.y,c=i*Math.cos(e)*Math.cos(t);return new sQ.Pq0(r,d,c)},[s,a,l,n]),d=(0,i.useMemo)(()=>{let e=s*Math.PI/180;return new sQ.Pq0(2.2*Math.sin(e),.05,2.2*Math.cos(e))},[s]),c=(0,i.useMemo)(()=>{let e=a*Math.PI/180;return new sQ.Pq0(-.7,2.2*Math.sin(e)+n.y,2.2*Math.cos(e))},[a,n]),o=(0,i.useMemo)(()=>{let e=[];for(let s=0;s<=64;s++){let a=s/64*Math.PI*2;e.push(new sQ.Pq0(2.2*Math.sin(a),.05,2.2*Math.cos(a)))}return new sQ.B6O(e,!0)},[]),m=(0,i.useMemo)(()=>{let e=[];for(let s=0;s<=32;s++){let a=sQ.cj9.degToRad(-30+90*s/32),t=2.2*Math.sin(a)+n.y,l=2.2*Math.cos(a);e.push(new sQ.Pq0(-.7,t,l))}return new sQ.B6O(e,!1)},[n]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ambientLight",{intensity:.4}),(0,t.jsx)("pointLight",{position:[10,10,10],intensity:.8}),(0,t.jsx)("pointLight",{position:[-10,-10,-10],intensity:.3}),(0,t.jsxs)("mesh",{position:n,children:[(0,t.jsx)("planeGeometry",{args:[.9,1.6]}),(0,t.jsx)("meshStandardMaterial",{color:"#9ca3af",side:sQ.$EB})]}),(0,t.jsxs)("lineSegments",{position:n,children:[(0,t.jsx)("edgesGeometry",{args:[new sQ.bdM(.9,1.6)]}),(0,t.jsx)("lineBasicMaterial",{color:"#374151",linewidth:2})]}),(0,t.jsx)("gridHelper",{args:[6,12,"#4b5563","#374151"],position:[0,0,0]}),(0,t.jsxs)("mesh",{children:[(0,t.jsx)("tubeGeometry",{args:[o,64,.04,8,!0]}),(0,t.jsx)("meshStandardMaterial",{color:"#10b981",emissive:"#10b981",emissiveIntensity:.3,opacity:.7,transparent:!0})]}),(0,t.jsxs)("mesh",{position:d,children:[(0,t.jsx)("sphereGeometry",{args:[.12,16,16]}),(0,t.jsx)("meshStandardMaterial",{color:"#10b981",emissive:"#10b981",emissiveIntensity:.5})]}),(0,t.jsxs)("mesh",{children:[(0,t.jsx)("tubeGeometry",{args:[m,32,.04,8,!1]}),(0,t.jsx)("meshStandardMaterial",{color:"#ec4899",emissive:"#ec4899",emissiveIntensity:.3,opacity:.7,transparent:!0})]}),(0,t.jsxs)("mesh",{position:c,children:[(0,t.jsx)("sphereGeometry",{args:[.12,16,16]}),(0,t.jsx)("meshStandardMaterial",{color:"#ec4899",emissive:"#ec4899",emissiveIntensity:.5})]}),(0,t.jsxs)("mesh",{children:[(0,t.jsx)("tubeGeometry",{args:[new sQ.VnP(n,r),1,.025,8,!1]}),(0,t.jsx)("meshStandardMaterial",{color:"#fbbf24",emissive:"#fbbf24",emissiveIntensity:.3})]}),(0,t.jsxs)("mesh",{position:r,children:[(0,t.jsx)("sphereGeometry",{args:[.15,16,16]}),(0,t.jsx)("meshStandardMaterial",{color:"#06b6d4",emissive:"#06b6d4",emissiveIntensity:.5})]}),(0,t.jsxs)("mesh",{position:r,rotation:[-(Math.PI/180*a),Math.PI/180*s+Math.PI,0],children:[(0,t.jsx)("coneGeometry",{args:[.1,.3,8]}),(0,t.jsx)("meshStandardMaterial",{color:"#06b6d4"})]})]})}function s$(e){let{horizontalAngle:s,verticalAngle:a,distance:l}=e;return(0,t.jsx)("div",{className:"w-full h-64 bg-gray-950 rounded-lg overflow-hidden border border-gray-800",children:(0,t.jsx)(sz.Hl,{camera:{position:[4,3,4],fov:50},gl:{antialias:!0},children:(0,t.jsx)(sH,{horizontalAngle:s,verticalAngle:a,distance:l})})})}function sY(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)(0),[o,x]=(0,i.useState)(0),[u,g]=(0,i.useState)(1),[f,v]=(0,i.useState)("auto"),[N,b]=(0,i.useState)(1024),[y,w]=(0,i.useState)(1024),[S,C]=(0,i.useState)(-1),[P,A]=(0,i.useState)(!1),{data:E}=(0,X.wV)(),{requireAuth:R,setError:F}=en(),k=ed(j.F.qwenImage.createMultiAngle),I=(0,i.useCallback)(()=>
1{if(!R())return;if(0===e.length)return void F("Please upload 1-3 images");let s="custom"===f?"".concat(N,"*").concat(y):"auto"===f?void 0:f;k.mutate({images:e,horizontal_angle:d,vertical_angle:o,distance:u,prompt:n.trim()||void 0,...s&&{size:s},seed:S})},[e,n,d,o,u,f,N,y,S,R,F,k]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sL.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Multi-Angle Edit"}),(0,t.jsx)(h.BT,{children:"Generate multiple camera angles from a single image"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Qwen Image"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium",children:["Reference Images (1-3) ",(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-3 images to edit",supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:3,onUrlsChange:E?s:void 0,onUploadingChange:l}),e.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.length," image",e.length>1?"s":""," selected"]})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Camera Controls"}),(0,t.jsx)(s$,{horizontalAngle:d,verticalAngle:o,distance:u}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground",children:"Horizontal Rotation"}),(0,t.jsxs)("span",{className:"text-xs font-mono",children:[d,"\xb0"]})]}),(0,t.jsx)(sm.A,{value:[d],onValueChange:e=>c(e[0]),min:0,max:359,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Rotate camera horizontally (0-359\xb0)"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground",children:"Vertical Tilt"}),(0,t.jsxs)("span",{className:"text-xs font-mono",children:[o,"\xb0"]})]}),(0,t.jsx)(sm.A,{value:[o],onValueChange:e=>x(e[0]),min:-30,max:60,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Tilt camera vertically (-30 to 60\xb0)"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground",children:"Camera Distance"}),(0,t.jsx)("span",{className:"text-xs font-mono",children:u})]}),(0,t.jsx)(sm.A,{value:[u],onValueChange:e=>g(e[0]),min:0,max:2,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Zoom level: 0 (close) to 2 (far)"})]})]}),(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Optional: Add guidance for the generation...",required:!1}),(0,t.jsxs)(e9,{open:P,onOpenChange:A,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(P?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Output Size"}),(0,t.jsxs)(sv.l6,{value:f,onValueChange:e=>{v(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select size"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Automatic"}),(0,t.jsx)(sv.eb,{value:"auto",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),"Auto (Recommended)"]})})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),(0,t.jsx)(sv.eb,{value:"1024*1024",children:"1024\xd71024"}),(0,t.jsx)(sv.eb,{value:"1280*1280",children:"1280\xd71280"}),(0,t.jsx)(sv.eb,{value:"1440*1440",children:"1440\xd71440"}),(0,t.jsx)(sv.eb,{value:"1536*1536",children:"1536\xd71536"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),(0,t.jsx)(sv.eb,{value:"1280*720",children:"1280\xd7720"}),(0,t.jsx)(sv.eb,{value:"1440*810",children:"1440\xd7810"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),(0,t.jsx)(sv.eb,{value:"720*1280",children:"720\xd71280"}),(0,t.jsx)(sv.eb,{value:"810*1440",children:"810\xd71440"})]})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"auto"===f?"Output size will be automatically determined based on input images":"All sizes cost 10 credits"}),"custom"===f&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:N,onChange:e=>b(Number(e.target.value))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:y,onChange:e=>w(Number(e.target.value))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:S,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)C(-1);else{let e=parseInt(s,10);isNaN(e)||C(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:I,disabled:a,credits:10,isPending:k.isPending}),(0,t.jsx)(eZ,{cost:10,costDescription:" ".concat(10," credits (fixed price) ")})]})]})}let sX=eP.LD["qwen-image"];function s0(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("1024*1024"),[r,d]=(0,i.useState)(1024),[c,o]=(0,i.useState)(1024),[m,x]=(0,i.useState)(-1),[u,g]=(0,i.useState)(!1),{status:f}=(0,X.wV)(),{requireAuth:v,setError:N}=en(),b=ed(j.F.qwenImage2.create);(0,i.useEffect)(()=>{"unauthenticated"===f&&s("A serene landscape with mountains at sunset, vibrant colors, photorealistic, 8K quality")},[f]);let y=(0,i.useCallback)(()=>{if(!v())return;if(!e.trim())return void N("Please enter a prompt");let s="custom"===a?"".concat(r,"*").concat(c):a;b.mutate({modelType:"qwen-image-2/text-to-image",prompt:e,size:s,seed:m})},[e,a,r,c,m,v,N,b]),w=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:a,onValueChange:l,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"1024\xd71024 (default)",value:"1024*1024"},{label:"1280\xd71280",value:"1280*1280"},{label:"1440\xd71440",value:"1440*1440"},{label:"1536\xd71536",value:"1536*1536"},{label:"2048\xd72048",value:"2048*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"1280\xd7720",value:"1280*720"},{label:"1440\xd7810",value:"1440*810"},{label:"2048\xd71152",value:"2048*1152"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"720\xd71280",value:"720*1280"},{label:"810\xd71440",value:"810*1440"},{label:"1152\xd72048",value:"1152*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"1024\xd7768",value:"1024*768"},{label:"1280\xd7960",value:"1280*960"},{label:"2048\xd71536",value:"2048*1536"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"768\xd71024",value:"768*1024"},{label:"960\xd71280",value:"960*1280"},{label:"1536\xd72048",value:"1536*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===a&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:2048,value:r,onChange:e=>d(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>2048?(d(2048),Q.oR.warning("Width limited to maximum 2048px")):s<256&&(d(256),Q.oR.warning("Width must be at least 256px"))}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:2048,value:c,onChange:e=>o(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>2048?(o(2048),Q.oR.warning("Height limited to maximum 2048px")):s<256&&(o(256),Q.oR.warning("Height must be at least 256px"))}})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All resolutions cost 9 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Text to Image"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Qwen Image 2.0"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onCh
1ange:s,placeholder:"Describe the image you want to create..."}),w,(0,t.jsxs)(e9,{open:u,onOpenChange:g,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(u?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:m,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)x(-1);else{let e=parseInt(s,10);isNaN(e)||x(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:y,disabled:!e.trim(),credits:9,isPending:b.isPending}),(0,t.jsx)(eZ,{cost:9,costDescription:" ".concat(9," credits (fixed price) ")})]})]})}function s1(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("auto"),[m,x]=(0,i.useState)(1024),[u,g]=(0,i.useState)(1024),[f,v]=(0,i.useState)(-1),[N,b]=(0,i.useState)(!1),{data:y,status:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=ed(j.F.qwenImage2.create);(0,i.useEffect)(()=>{"unauthenticated"===w&&d("Transform this image into a vibrant artistic masterpiece with enhanced colors and professional lighting")},[w]);let A=(0,i.useCallback)(()=>{if(!S())return;if(!r.trim())return void C("Please enter a prompt");if(0===e.length)return void C("Please upload 1-3 images");let s={modelType:"qwen-image-2/edit",prompt:r,images:e,seed:f};"auto"!==c&&(s.size="custom"===c?"".concat(m,"*").concat(u):c),P.mutate(s)},[e,r,c,m,u,f,S,C,P]),E=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Output Size"}),(0,t.jsxs)(sv.l6,{value:c,onValueChange:o,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select size"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Auto"}),(0,t.jsx)(sv.eb,{value:"auto",children:"Auto (Match Input Image)"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"1024\xd71024 (default)",value:"1024*1024"},{label:"1280\xd71280",value:"1280*1280"},{label:"1440\xd71440",value:"1440*1440"},{label:"1536\xd71536",value:"1536*1536"},{label:"2048\xd72048",value:"2048*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"1280\xd7720",value:"1280*720"},{label:"1440\xd7810",value:"1440*810"},{label:"2048\xd71152",value:"2048*1152"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"720\xd71280",value:"720*1280"},{label:"810\xd71440",value:"810*1440"},{label:"1152\xd72048",value:"1152*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"1024\xd7768",value:"1024*768"},{label:"1280\xd7960",value:"1280*960"},{label:"2048\xd71536",value:"2048*1536"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"768\xd71024",value:"768*1024"},{label:"960\xd71280",value:"960*1280"},{label:"1536\xd72048",value:"1536*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===c&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:2048,value:m,onChange:e=>x(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>2048?(x(2048),Q.oR.warning("Width limited to maximum 2048px")):s<256&&(x(256),Q.oR.warning("Width must be at least 256px"))}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:2048,value:u,onChange:e=>g(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>2048?(g(2048),Q.oR.warning("Height limited to maximum 2048px")):s<256&&(g(256),Q.oR.warning("Height must be at least 256px"))}})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All sizes cost 9 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Image Edit"}),(0,t.jsx)(h.BT,{children:"Multi-image editing with improved quality and instruction understanding"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Qwen Image 2.0"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium",children:["Reference Images (1-3) ",(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-3 images to edit",supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:3,onUrlsChange:y?s:void 0,onUploadingChange:l}),e.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.length," image",e.length>
11?"s":""," selected"]})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to edit or transform the image..."}),E,(0,t.jsxs)(e9,{open:N,onOpenChange:b,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(N?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:f,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)v(-1);else{let e=parseInt(s,10);isNaN(e)||v(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:A,disabled:a||!r.trim(),credits:9,isPending:P.isPending}),(0,t.jsx)(eZ,{cost:9,costDescription:" ".concat(9," credits (fixed price) ")})]})]})}let s2=eP.LD["qwen-image-2"];function s4(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("1024*1024"),[r,d]=(0,i.useState)(1024),[c,o]=(0,i.useState)(1024),[m,x]=(0,i.useState)(-1),[u,g]=(0,i.useState)(!1),{status:f}=(0,X.wV)(),{requireAuth:v,setError:N}=en(),b=ed(j.F.qwenImage2Pro.create);(0,i.useEffect)(()=>{"unauthenticated"===f&&s("A serene landscape with mountains at sunset, vibrant colors, photorealistic, 8K quality")},[f]);let y=(0,i.useCallback)(()=>{if(!v())return;if(!e.trim())return void N("Please enter a prompt");let s="custom"===a?"".concat(r,"*").concat(c):a;b.mutate({modelType:"qwen-image-2-pro/text-to-image",prompt:e,size:s,seed:m})},[e,a,r,c,m,v,N,b]),w=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:a,onValueChange:l,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"1024\xd71024 (default)",value:"1024*1024"},{label:"1280\xd71280",value:"1280*1280"},{label:"1440\xd71440",value:"1440*1440"},{label:"1536\xd71536",value:"1536*1536"},{label:"2048\xd72048",value:"2048*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"1280\xd7720",value:"1280*720"},{label:"1440\xd7810",value:"1440*810"},{label:"2048\xd71152",value:"2048*1152"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"720\xd71280",value:"720*1280"},{label:"810\xd71440",value:"810*1440"},{label:"1152\xd72048",value:"1152*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"1024\xd7768",value:"1024*768"},{label:"1280\xd7960",value:"1280*960"},{label:"2048\xd71536",value:"2048*1536"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"768\xd71024",value:"768*1024"},{label:"960\xd71280",value:"960*1280"},{label:"1536\xd72048",value:"1536*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===a&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:2048,value:r,onChange:e=>d(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>2048?(d(2048),Q.oR.warning("Width limited to maximum 2048px")):s<256&&(d(256),Q.oR.warning("Width must be at least 256px"))}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:2048,value:c,onChange:e=>o(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>2048?(o(2048),Q.oR.warning("Height limited to maximum 2048px")):s<256&&(o(256),Q.oR.warning("Height must be at least 256px"))}})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All resolutions cost 21 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Text to Image"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Qwen Image 2.0 Pro"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onCh
1ange:s,placeholder:"Describe the image you want to create..."}),w,(0,t.jsxs)(e9,{open:u,onOpenChange:g,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(u?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:m,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)x(-1);else{let e=parseInt(s,10);isNaN(e)||x(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:y,disabled:!e.trim(),credits:21,isPending:b.isPending}),(0,t.jsx)(eZ,{cost:21,costDescription:" ".concat(21," credits (fixed price) ")})]})]})}function s3(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("auto"),[m,x]=(0,i.useState)(1024),[u,g]=(0,i.useState)(1024),[f,v]=(0,i.useState)(-1),[N,b]=(0,i.useState)(!1),{data:y,status:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=ed(j.F.qwenImage2Pro.create);(0,i.useEffect)(()=>{"unauthenticated"===w&&d("Transform this image into a vibrant artistic masterpiece with enhanced colors and professional lighting")},[w]);let A=(0,i.useCallback)(()=>{if(!S())return;if(!r.trim())return void C("Please enter a prompt");if(0===e.length)return void C("Please upload 1-3 images");let s={modelType:"qwen-image-2-pro/edit",prompt:r,images:e,seed:f};"auto"!==c&&(s.size="custom"===c?"".concat(m,"*").concat(u):c),P.mutate(s)},[e,r,c,m,u,f,S,C,P]),E=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Output Size"}),(0,t.jsxs)(sv.l6,{value:c,onValueChange:o,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select size"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Auto"}),(0,t.jsx)(sv.eb,{value:"auto",children:"Auto (Match Input Image)"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"1024\xd71024 (default)",value:"1024*1024"},{label:"1280\xd71280",value:"1280*1280"},{label:"1440\xd71440",value:"1440*1440"},{label:"1536\xd71536",value:"1536*1536"},{label:"2048\xd72048",value:"2048*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"1280\xd7720",value:"1280*720"},{label:"1440\xd7810",value:"1440*810"},{label:"2048\xd71152",value:"2048*1152"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"720\xd71280",value:"720*1280"},{label:"810\xd71440",value:"810*1440"},{label:"1152\xd72048",value:"1152*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"1024\xd7768",value:"1024*768"},{label:"1280\xd7960",value:"1280*960"},{label:"2048\xd71536",value:"2048*1536"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"768\xd71024",value:"768*1024"},{label:"960\xd71280",value:"960*1280"},{label:"1536\xd72048",value:"1536*2048"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===c&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:2048,value:m,onChange:e=>x(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>2048?(x(2048),Q.oR.warning("Width limited to maximum 2048px")):s<256&&(x(256),Q.oR.warning("Width must be at least 256px"))}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:2048,value:u,onChange:e=>g(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>2048?(g(2048),Q.oR.warning("Height limited to maximum 2048px")):s<256&&(g(256),Q.oR.warning("Height must be at least 256px"))}})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All sizes cost 21 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Image Edit"}),(0,t.jsx)(h.BT,{children:"Multi-image editing with superior quality and advanced instruction understanding"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Qwen Image 2.0 Pro"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium",children:["Reference Images (1-3) ",(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-3 images to edit",supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:3,onUrlsChange:y?s:void 0,onUploadingChange:l}),e.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.length," image",e.length>
11?"s":""," selected"]})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to edit or transform the image..."}),E,(0,t.jsxs)(e9,{open:N,onOpenChange:b,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(N?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:f,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)v(-1);else{let e=parseInt(s,10);isNaN(e)||v(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:A,disabled:a||!r.trim(),credits:21,isPending:P.isPending}),(0,t.jsx)(eZ,{cost:21,costDescription:" ".concat(21," credits (fixed price) ")})]})]})}let s5=eP.LD["qwen-image-2-pro"],s6={standard:{"1K":7,"2K":7},pro:{"1K":10,"2K":18}},s8=["1K","2K"],s9={standard:"2K",pro:"1K"},s7=["1:1","3:2","4:3","16:9","21:9"],ae={"3:2":"2:3","4:3":"3:4","16:9":"9:16"};function as(e,s){return"portrait"===s&&ae[e]?ae[e]:e}let aa={standard:{text:"qwen-image-3/text-to-image",edit:"qwen-image-3/edit"},pro:{text:"qwen-image-3-pro/text-to-image",edit:"qwen-image-3-pro/edit"}};function at(e){let{tier:s,resolution:a,setResolution:l,aspectShape:i,setAspectShape:n,orientation:r,setOrientation:d,promptExtend:c,setPromptExtend:o,negativePrompt:m,setNegativePrompt:x,seed:u,setSeed:h,isAdvancedOpen:g,setIsAdvancedOpen:j}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsx)(eM,{type:"single",value:a,onValueChange:e=>{s8.includes(e)&&l(e)},className:"w-full grid grid-cols-2 gap-2",children:s8.map(e=>(0,t.jsxs)(eG,{value:e,"aria-label":"".concat(e," resolution"),className:"flex-1",children:[e,(0,t.jsxs)("span",{className:"ml-2 text-xs text-muted-foreground",children:[s6[s][e]," credits"]})]},e))})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsx)(eM,{type:"single",value:i,onValueChange:e=>{s7.includes(e)&&n(e)},className:"w-full grid grid-cols-5 gap-2",children:s7.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":e,className:"flex-1",children:e},e))})]}),i in ae&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:r,onValueChange:e=>{("landscape"===e||"portrait"===e)&&d(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Output ratio: ",as(i,r)]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Rewrite My Prompt"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Expands a short prompt into a more detailed one."," ",(0,t.jsx)("span",{className:"font-semibold text-foreground",children:"May reduce spicy level."})]})]}),(0,t.jsx)(F,{checked:c,onCheckedChange:o})]}),(0,t.jsxs)(e9,{open:g,onOpenChange:j,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(g?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(sf.T,{placeholder:"What you don't want in the image",value:m,onChange:e=>x(e.target.value)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",min:-1,max:0x7fffffff,placeholder:"-1 for random, or any integer for a repeatable image",value:u,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)h(-1);else{let e=parseInt(s,10);isNaN(e)||h(e)}},onBlur:e=>{let s=parseInt(e.target.value,10);isNaN(s)||s<-1?(h(-1),Q.oR.warning("Seed reset to -1 (random)")):s>0x7fffffff&&(h(0x7fffffff),Q.oR.warning("Seed capped at ".concat(0x7fffffff)))}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for a new image every time, or reuse a number to get the same image again."})]})]})]})]})}function al(e){let{tier:s,createProcedure:a}=e,[l,r]=(0,i.useState)(""),[d,c]=(0,i.useState)(s9[s]),[o,m]=(0,i.useState)("1:1"),[x,u]=(0,i.useState)("landscape"),[p,g]=(0,i.useState)(!1),[j,f]=(0,i.useState)(""),[v,N]=(0,i.useState)(-1),[b,y]=(0,i.useState)(!1),{status:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=ed(a);(0,i.useEffect)(()=>{"unauthenticated"===w&&r("A quiet bookshop at dusk, warm lamplight through rain-streaked windows, a cat asleep on the counter")},[w]);let A=s6[s][d]+0,E=(0,i.useCallback)(()=>{if(S()){if(!l.trim())return void C("Please enter a prompt");P.mutate({modelType:aa[s].text,prompt:l,resolution:d,image_size:as(o,x),prompt_extend:p,negative_prompt:j.trim()||void 0,seed:v})}},[S,l,d,o,x,p,j,v,s,C,P]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Image"}),(0,t.jsx)(h.BT,{children:"Generate an image from a prompt, up to 2K"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:l,onChange:r,placeholder:"Describe the subject, style, lighting and composition..."}),(0,t.jsx)(at,{tier:s,resolution:d,setResolution:c,aspectShape:o,setAspectShape:m,orientation:x,setOrientation:u,promptExtend:p,setPromptExtend:g,negativePrompt:j,setNegativePrompt:f,seed:v,setSeed:N,isAdvancedOpen:b,setIsAdvancedOpen:y}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:E,disabled:!l.trim(),credits:A,isPending:P.isPending}),(0,t.jsx)(eZ,{cost:A,costDescription:"".concat(A," credits (").concat(d,")")})]})]})}function ai(e){var s;let{tier:a,createProcedure:l}=e,[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)([]),[o,m]=(0,i.useState)(s9[a]),[x,u]=(0,i.useState)("1:1"),[g,j]=(0,i.useState)("landscape"),[f,v]=(0,i.useState)(!1),[N,b]=(0,i.useState)(""),[y,w]=(0,i.useState)(-1),[S,C]=(0,i.useState)(!1),[P,A]=(0,i.useState)(!1),{data:E,status:R}=(0,X.wV)(),{requireAuth:F,setError:k}=en(),I=ed(l);(0,i.useEffect)(()=>{"unauthenticated"===R&&r("Replace the background with a snowy forest at golden hour, keep the subject unchanged")},[R]);let U=(s=d.length,s6[a][o]+ +s),V=(0,i.useCallback)(()=>{if(F()){if(!n.trim())return void k("Please enter a prompt");if(0===d.length)return void k("Please upload at least 1 image");I.mutate({modelType:aa[a].edit,prompt:n,image_urls:d,resolution:o,image_size:as(x,g),prompt_extend:f,negative_prompt:N.trim()||void 0,seed:y})}},[F,n,d,o,x,g,f,N,y,a,k,I]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sj.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image Edit"}),(0,t.jsxs)(h.BT,{children:["Edit or combine up to ",3," images with a prompt"]})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Input Images"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[d.length," of ",3]})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload up to ".concat(3," images"),supportedFormats:"JPEG, PNG, WEBP",maxFiles:3,onUrlsChange:E?c:void 0,onUploadingChange:A}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"1 credit per input image"})]}),(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the edit you want..."}),(0,t.jsx)(at,{tier:a,resolution:o,setResolution:m,aspectShape:x,setAspectShape:u,orientation:g,setOrientation:j,promptExtend:f,setPromptExtend:v,negativePrompt:N,setNegativePrompt:b,seed:y,setSeed:w,isAdvancedOpen:S,setIsAdvancedOpen:C}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:V,disabled:!n.trim()||P,credits:U,isPending:I.isPending}),(0,t.jsx)(eZ,{cost:U,costDescription:d.length>0?"".concat(U," credits (").concat(o," + ").concat(d.length," input image").concat(d.length>
11?"s":"",")"):"".concat(U," credits (").concat(o,")")})]})]})}function an(e){let{tier:s,modelId:a,createProcedure:l,useStatusQuery:r,demoUrl:d}=e,[c,o]=(0,i.useState)("text"),x="pro"===s?"Qwen Image 3.0 Pro":"Qwen Image 3.0",u=s6[s];return(0,t.jsx)(eI,{config:{modelIdentifiers:eP.LD[a],useStatusQuery:r,contentLabel:"Image"},demoUrl:d,guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsxs)(h.BT,{children:["Key information for using ",x]})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Pricing"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsxs)("li",{children:["1K: ",u["1K"]," credits \xb7 2K: ",u["2K"]," credits"]}),(0,t.jsx)("li",{children:"Image Edit adds 1 credit per input image"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Strong at dense layouts, small text and 12+ languages"}),(0,t.jsx)("li",{children:"Turn on Rewrite My Prompt when your prompt is short and vague"}),(0,t.jsx)("li",{children:"Keep it off â and set a seed â when you want the same image again"}),(0,t.jsx)("li",{children:"Image Edit takes 1-3 images and keeps the subject consistent"})]})]})]})]})]}),children:(0,t.jsxs)(e1,{value:c,onValueChange:e=>o(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Text to Image"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Image Edit"]})]}),(0,t.jsx)(e3,{value:"text",className:"mt-6",children:(0,t.jsx)(al,{tier:s,createProcedure:l})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(ai,{tier:s,createProcedure:l})})]})})}function ar(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!1),[o,m]=(0,i.useState)(null),[x,u]=(0,i.useState)(""),[g,f]=(0,i.useState)("animate"),[v,N]=(0,i.useState)("480p"),[b,y]=(0,i.useState)(0),{data:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=ed(j.F.wan22Animate.create);(0,i.useEffect)(()=>{if(!o)return void y(0);let e=document.createElement("video");return e.preload="metadata",e.onloadedmetadata=()=>{let s=e.duration;if(s>120){Q.oR.error("Video too long. Maximum video length is 120 seconds"),m(null),y(0);return}y(s)},e.onerror=()=>{Q.oR.error("Invalid video file. Please upload a valid video"),m(null),y(0)},e.src=URL.createObjectURL(o),()=>{URL.revokeObjectURL(e.src)}},[o]);let A=(e,s)=>Math.ceil(Math.max(e,5)/5*("480p"===s?60:120)),E=A(b,v),R=(0,i.useCallback)(()=>{if(S()){if(!e||!a)return void C("Please upload both character image and reference video");P.mutate({image:e,video:a,prompt:x||void 0,mode:g,resolution:v,seed:-1})}},[e,a,x,g,v,S,C,P]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eU.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Upload Files"}),(0,t.jsx)(h.BT,{children:"Upload your character image and reference video"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Character Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Click to upload character image",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:w?s:void 0,onUploadingChange:r})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}
1),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Click to upload reference video",supportedFormats:"MP4, MOV, AVI supported (max 120s)",onFirstFileChange:m,onUrlChange:w?l:void 0,onUploadingChange:c}),o&&b>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Video duration: ",Math.round(b),"s ⢠Estimated cost: ",A(b,v)," ","credits"]})]}),(0,t.jsx)(ep.PromptInput,{value:x,onChange:u,required:!1}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:v,onValueChange:e=>{("480p"===e||"720p"===e)&&N(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Mode"}),(0,t.jsxs)(eM,{type:"single",value:g,onValueChange:e=>e&&f(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"animate","aria-label":"Animate mode",className:"flex-1",children:"Animate"}),(0,t.jsx)(eG,{value:"replace","aria-label":"Replace mode",className:"flex-1",children:"Replace"})]})]}),{})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Animate: Apply video motion to the character",(0,t.jsx)("br",{}),"Replace: Swap character in video with image"]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:R,disabled:n||d,credits:E,isPending:P.isPending}),(0,t.jsx)(eZ,{cost:E,costDescription:b>0?" ".concat(E," credits (").concat(Math.round(b),"s video at ").concat(v,")"):"480p"===v?" 60 credits per 5 seconds (480p) ":" 120 credits per 5 seconds (720p) "})]})]})}let ad=eP.LD["wan-2.2-animate"];var ac=a(56649);function ao(e){let{modelName:s="This model"}=e;return(0,t.jsxs)(g.Fc,{className:"border-blue-500/50 bg-blue-500/10",children:[(0,t.jsx)(ac.A,{className:"h-4 w-4 text-blue-600"}),(0,t.jsxs)(g.TN,{className:"text-sm text-blue-900 dark:text-blue-100",children:[(0,t.jsxs)("span",{className:"font-semibold",children:[s," uses prompt-based filtering only."]})," ",(0,t.jsx)("br",{}),"If generation fails, certain keywords may have triggered the filter. Try rephrasing your prompt or removing sensitive terms."]})]})}function am(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("2048*2048"),[r,d]=(0,i.useState)(2048),[c,o]=(0,i.useState)(2048),{status:m}=(0,X.wV)(),{requireAuth:x,setError:u}=en(),g=ed(j.F.seedreamV4.create);(0,i.useEffect)(()=>{"unauthenticated"===m&&s("A serene mountain landscape at sunset, with vibrant orange and purple hues painting the sky, reflecting off a crystal-clear alpine lake surrounded by pine trees")},[m]);let f=(0,i.useCallback)(()=>{if(!x())return;if(!e.trim())return void u("Please enter a prompt");let s="custom"===a?"".concat(r,"*").concat(c):a;g.mutate({modelType:"seedream-v4",prompt:e,size:s})},[e,a,r,c,x,u,g]),v=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:a,onValueChange:e=>{l(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"1024\xd71024",value:"1024*1024"},{label:"1536\xd71536",value:"1536*1536"},{label:"2048\xd72048 (Recommended)",value:"2048*2048"},{label:"2560\xd72560",value:"2560*2560"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"1920\xd71080",value:"1920*1080"},{label:"2560\xd71440",value:"2560*1440"},{label:"3840\xd72160",value:"3840*2160"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"1080\xd71920",value:"1080*1920"},{label:"1440\xd72560",value:"1440*2560"},{label:"2160\xd73840",value:"2160*3840"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"1600\xd71200",value:"1600*1200"},{label:"2048\xd71536",value:"2048*1536"},{label:"2560\xd71920",value:"2560*1920"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"1200\xd71600",value:"1200*1600"},{label:"1536\xd72048",value:"1536*2048"},{label:"1920\xd72560",value:"1920*2560"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===a&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width"}),(0,t.jsx)(e6.p,{type:"number",min:1024,max:4096,value:r,onChange:e=>d(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>4096?(d(4096),Q.oR.warning("Width limited to maximum 4096")):s<1024&&(d(1024),Q.oR.warning("Width must be at least 1024"))},className:"mt-1"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height"}),(0,t.jsx)(e6.p,{type:"number",min:1024,max:4096,value:c,onChange:e=>o(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>4096?(o(4096),Q.oR.warning("Height limited to maximum 4096")):s<1024&&(o(1024),Q.oR.warning("Height must be at least 1024"))},className:"mt-1"})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All resolutions cost 8 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Generate"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Seedream V4"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ao,{modelName:"Seedream V4"}
1),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the image you want to create..."}),v,(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:f,disabled:!e.trim(),credits:8,isPending:g.isPending}),(0,t.jsx)(eZ,{cost:8,costDescription:" ".concat(8," credits (fixed price) ")})]})]})}function ax(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("2048*2048"),[m,x]=(0,i.useState)(2048),[u,g]=(0,i.useState)(2048),[f,v]=(0,i.useState)(0),[N,b]=(0,i.useState)(0),[y,w]=(0,i.useState)(!1),{data:S,status:C}=(0,X.wV)(),{requireAuth:P,setError:A}=en(),E=ed(j.F.seedreamV4.create),R={"1:1":[{label:"1024\xd71024",value:"1024*1024"},{label:"1536\xd71536",value:"1536*1536"},{label:"2048\xd72048 (Recommended)",value:"2048*2048"},{label:"2560\xd72560",value:"2560*2560"}],"16:9":[{label:"1920\xd71080",value:"1920*1080"},{label:"2560\xd71440",value:"2560*1440"},{label:"3840\xd72160",value:"3840*2160"}],"9:16":[{label:"1080\xd71920",value:"1080*1920"},{label:"1440\xd72560",value:"1440*2560"},{label:"2160\xd73840",value:"2160*3840"}],"4:3":[{label:"1600\xd71200",value:"1600*1200"},{label:"2048\xd71536",value:"2048*1536"},{label:"2560\xd71920",value:"2560*1920"}],"3:4":[{label:"1200\xd71600",value:"1200*1600"},{label:"1536\xd72048",value:"1536*2048"},{label:"1920\xd72560",value:"1920*2560"}]},F=(0,i.useCallback)((e,s)=>{let a="".concat(e,"*").concat(s);for(let e of Object.values(R))for(let s of e)if(s.value===a)return a;return null},[]),k=(0,i.useCallback)((e,s)=>{let a=e,t=s,l=!1,i=Math.min(e,s);if(i<1024){let n=1024/i;a=Math.round(e*n),t=Math.round(s*n),l=!0}let n=Math.max(a,t);if(n>4096){let e=4096/n;a=Math.round(a*e),t=Math.round(t*e),l=!0}return{width:a,height:t,scaled:l}},[]);(0,i.useEffect)(()=>{"unauthenticated"===C&&d("Transform this image into a vibrant watercolor painting style with soft, flowing colors and artistic brush strokes")},[C]);let I=(0,i.useCallback)(e=>{if(!e){v(0),b(0),o("2048*2048"),w(!1);return}w(!0);let s=new Image;s.onload=()=>{URL.revokeObjectURL(s.src);let{width:e,height:a}=s;v(e),b(a),w(!1);let t=Math.max(e/a,a/e);if(t>4){Q.oR.error("Image aspect ratio (".concat(t.toFixed(1),":1) exceeds maximum allowed (4:1). Please use an image with more balanced dimensions.")),v(0),b(0);return}let l=F(e,a);if(l)o(l),Q.oR.success("Matched preset resolution: ".concat(e,"\xd7").concat(a));else{let s=k(e,a);s.scaled?(o("custom"),x(s.width),g(s.height),Q.oR.info("Image scaled from ".concat(e,"\xd7").concat(a," to ").concat(s.width,"\xd7").concat(s.height," (required range: 1024-4096px)"))):(o("custom"),x(e),g(a),Q.oR.info("Using original size: ".concat(e,"\xd7").concat(a)))}},s.onerror=()=>{URL.revokeObjectURL(s.src),Q.oR.error("Failed to detect image dimensions."),v(0),b(0),w(!1)},s.src=URL.createObjectURL(e)},[F,k]),U=(0,i.useCallback)(()=>{if(!P())return;if(!r.trim())return void A("Please enter a prompt");if(0===e.length)return void A("Please upload at least one reference image");let s="custom"===c?"".concat(m,"*").concat(u):c;E.mutate({modelType:"seedream-v4/edit",prompt:r,images:e,size:s})},[e,r,c,m,u,P,A,E]),V=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:c,onValueChange:e=>{o(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),R["1:1"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),R["16:9"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),R["9:16"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),R["4:3"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),R["3:4"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===c&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width"}),(0,t.jsx)(e6.p,{type:"number",max:4096,value:m,onChange:e=>x(Number(e.target.value)),onBlur:e=>{Number(e.target.value)>4096&&(x(4096),Q.oR.warning("Width limited to maximum 4096"))},className:"mt-1"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height"}),(0,t.jsx)(e6.p,{type:"number",max:4096,value:u,onChange:e=>g(Number(e.target.value)),onBlur:e=>{Number(e.target.value)>4096&&(g(4096),Q.oR.warning("Height limited to maximum 4096"))},className:"mt-1"})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All resolutions cost 8 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Edit"}),(0,t.jsx)(h.BT,{children:"Transform images with AI guidance"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Seedream V4"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ao,{modelName:"Seedream V4"}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to transform the image..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-".concat(10," images to transform"),supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:10,onFirstFileChange:I,onUrlsChange:S?s:void 0,onUploadingChange:l}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:[e.length>0?"".concat(e.length," image").concat(e.length>
11?"s":""," selected"):"Click or drag images to upload",y&&e.length>0&&(0,t.jsxs)("span",{className:"ml-2 flex items-center gap-1",children:[(0,t.jsx)(ex.A,{className:"h-3 w-3 animate-spin"}),"Detecting image size..."]}),f>0&&N>0&&(0,t.jsxs)("span",{className:"ml-2",children:["⢠First image: ",f,"\xd7",N,"custom"===c&&(m!==f||u!==N)&&(0,t.jsxs)(t.Fragment,{children:[" â Output: ",m,"\xd7",u]})]})]})]}),V,(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:U,disabled:a||!r.trim(),credits:8,isPending:E.isPending}),(0,t.jsx)(eZ,{cost:8,costDescription:" ".concat(8," credits (fixed price) ")})]})]})}let au=eP.LD["seedream-v4"];function ah(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("2048*2048"),[r,d]=(0,i.useState)(2048),[c,o]=(0,i.useState)(2048),{status:m}=(0,X.wV)(),{requireAuth:x,setError:u}=en(),g=ed(j.F.seedreamV45.create);(0,i.useEffect)(()=>{"unauthenticated"===m&&s("A serene mountain landscape at sunset, with vibrant orange and purple hues painting the sky, reflecting off a crystal-clear alpine lake surrounded by pine trees")},[m]);let f=(0,i.useCallback)(()=>{if(!x())return;if(!e.trim())return void u("Please enter a prompt");let s="custom"===a?"".concat(r,"*").concat(c):a;g.mutate({modelType:"seedream-4-5",prompt:e,size:s})},[e,a,r,c,x,u,g]),v=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:a,onValueChange:e=>{l(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"2048\xd72048 (Recommended)",value:"2048*2048"},{label:"3072\xd73072",value:"3072*3072"},{label:"4096\xd74096",value:"4096*4096"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"2560\xd71440",value:"2560*1440"},{label:"3840\xd72160",value:"3840*2160"},{label:"4096\xd72304",value:"4096*2304"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"1440\xd72560",value:"1440*2560"},{label:"2160\xd73840",value:"2160*3840"},{label:"2304\xd74096",value:"2304*4096"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"2560\xd71920",value:"2560*1920"},{label:"3072\xd72304",value:"3072*2304"},{label:"4096\xd73072",value:"4096*3072"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"1920\xd72560",value:"1920*2560"},{label:"2304\xd73072",value:"2304*3072"},{label:"3072\xd74096",value:"3072*4096"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===a&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width"}),(0,t.jsx)(e6.p,{type:"number",min:1920,max:4096,value:r,onChange:e=>d(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>4096?(d(4096),Q.oR.warning("Width limited to maximum 4096")):s<1920&&(d(1920),Q.oR.warning("Width must be at least 1920"))},className:"mt-1"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height"}),(0,t.jsx)(e6.p,{type:"number",min:1920,max:4096,value:c,onChange:e=>o(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>4096?(o(4096),Q.oR.warning("Height limited to maximum 4096")):s<1920&&(o(1920),Q.oR.warning("Height must be at least 1920"))},className:"mt-1"})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All resolutions cost 12 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Generate"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Seedream 4.5"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ao,{modelName:"Seedream 4.5"}
1),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the image you want to create..."}),v,(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:f,disabled:!e.trim(),credits:12,isPending:g.isPending}),(0,t.jsx)(eZ,{cost:12,costDescription:" ".concat(12," credits (fixed price) ")})]})]})}function ap(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("auto"),[m,x]=(0,i.useState)(2048),[u,g]=(0,i.useState)(2048),{data:f,status:v}=(0,X.wV)(),{requireAuth:N,setError:b}=en(),y=ed(j.F.seedreamV45.create);(0,i.useEffect)(()=>{"unauthenticated"===v&&d("Transform this image into a vibrant watercolor painting style with soft, flowing colors and artistic brush strokes")},[v]);let w=(0,i.useCallback)(()=>{if(!N())return;if(!r.trim())return void b("Please enter a prompt");if(0===e.length)return void b("Please upload at least one reference image");let s={modelType:"seedream-4-5/edit",prompt:r,images:e};"auto"!==c&&(s.size="custom"===c?"".concat(m,"*").concat(u):c),y.mutate(s)},[e,r,c,m,u,N,b,y]),S=(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:c,onValueChange:e=>{o(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Auto"}),(0,t.jsx)(sv.eb,{value:"auto",children:"Auto (Match Input Image)"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"2048\xd72048 (Recommended)",value:"2048*2048"},{label:"3072\xd73072",value:"3072*3072"},{label:"4096\xd74096",value:"4096*4096"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"2560\xd71440",value:"2560*1440"},{label:"3840\xd72160",value:"3840*2160"},{label:"4096\xd72304",value:"4096*2304"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"1440\xd72560",value:"1440*2560"},{label:"2160\xd73840",value:"2160*3840"},{label:"2304\xd74096",value:"2304*4096"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"2560\xd71920",value:"2560*1920"},{label:"3072\xd72304",value:"3072*2304"},{label:"4096\xd73072",value:"4096*3072"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"1920\xd72560",value:"1920*2560"},{label:"2304\xd73072",value:"2304*3072"},{label:"3072\xd74096",value:"3072*4096"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===c&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width"}),(0,t.jsx)(e6.p,{type:"number",min:1920,max:4096,value:m,onChange:e=>x(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>4096?(x(4096),Q.oR.warning("Width limited to maximum 4096")):s<1920&&(x(1920),Q.oR.warning("Width must be at least 1920"))},className:"mt-1"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height"}),(0,t.jsx)(e6.p,{type:"number",min:1920,max:4096,value:u,onChange:e=>g(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>4096?(g(4096),Q.oR.warning("Height limited to maximum 4096")):s<1920&&(g(1920),Q.oR.warning("Height must be at least 1920"))},className:"mt-1"})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"All resolutions cost 12 credits"})]});return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Edit"}),(0,t.jsx)(h.BT,{children:"Transform images with AI guidance"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Seedream 4.5"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ao,{modelName:"Seedream 4.5"}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to transform the image..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-".concat(10," images to transform"),supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:10,onUrlsChange:f?s:void 0,onUploadingChange:l}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:e.length>0?"".concat(e.length," image").concat(e.length>
11?"s":""," selected"):"Click or drag images to upload"})]}),S,(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:w,disabled:a||!r.trim(),credits:12,isPending:y.isPending}),(0,t.jsx)(eZ,{cost:12,costDescription:" ".concat(12," credits (fixed price) ")})]})]})}let ag=eP.LD["seedream-4-5"],aj=["1:1","3:2","2:3","3:4","4:3","4:5","5:4","9:16","16:9","21:9"];function af(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("1:1"),[n,r]=(0,i.useState)("png"),{status:d}=(0,X.wV)(),{requireAuth:c,setError:o}=en();(0,i.useEffect)(()=>{"unauthenticated"===d&&s("Photorealistic portrait of a curious capuchin monkey wearing neon sunglasses, studio lighting, 50mm lens, shallow depth of field")},[d]);let x=ed(j.F.nanoBanana.create),u=(0,i.useCallback)(()=>{if(c()){if(!e.trim())return void o("Please enter a prompt");x.mutate({modelType:"nano-banana/text-to-image",prompt:e,aspect_ratio:a,output_format:n})}},[e,a,n,c,o,x]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Generate"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Nano Banana"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(eL,{modelName:"Nano Banana"}),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the image you want to create..."}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Output Format"}),(0,t.jsxs)(eM,{type:"single",value:n,onValueChange:e=>e&&r(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"png",children:"PNG"}),(0,t.jsx)(eG,{value:"jpeg",children:"JPEG"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(sv.l6,{value:a,onValueChange:l,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsx)(sv.gC,{children:aj.map(e=>(0,t.jsx)(sv.eb,{value:e,children:e},e))})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:u,disabled:!e.trim(),credits:10,isPending:x.isPending}),(0,t.jsx)(eZ,{cost:10,costDescription:" ".concat(10," credits (fixed price) ")})]})]})}var av=a(34127);let aN=["1:1","3:2","2:3","3:4","4:3","4:5","5:4","9:16","16:9","21:9"];function ab(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)([]),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)("1:1"),[o,m]=(0,i.useState)("png"),{data:x,status:u}=(0,X.wV)(),{requireAuth:g,setError:f}=en();(0,i.useEffect)(()=>{"unauthenticated"===u&&s("Refine these concept sketches into a polished cyberpunk city scene with vibrant neon lighting and reflective rain-soaked streets")},[u]);let v=ed(j.F.nanoBanana.create),N=(0,i.useCallback)(()=>{if(g()){if(!e.trim())return void f("Please enter a prompt");if(0===a.length)return void f("Please upload at least one reference image");v.mutate({modelType:"nano-banana/edit",prompt:e,images:a,aspect_ratio:d,output_format:o})}},[e,a,d,o,g,f,v]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(av.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Edit"}),(0,t.jsx)(h.BT,{children:"Transform images with AI guidance"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Nano Banana"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(eL,{modelName:"Nano Banana"}),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe how Nano Banana should transform your images..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(av.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Drag and drop images here or click to browse",supportedFormats:"PNG, JPEG, WEBP",maxFiles:10,onUrlsChange:x?l:void 0,onUploadingChange:r})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Output Format"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>e&&m(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"png",children:"PNG"}),(0,t.jsx)(eG,{value:"jpeg",children:"JPEG"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(sv.l6,{value:d,onValueChange:c,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsx)(sv.gC,{children:aN.map(e=>(0,t.jsx)(sv.eb,{value:e,children:e},e))})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:N,disabled:n||!e.trim(),credits:10,isPending:v.isPending}
1),(0,t.jsx)(eZ,{cost:10,costDescription:" ".concat(10," credits (fixed price) ")})]})]})}let ay=eP.LD["nano-banana"],aw={"video-upscaler":{"720p":1,"1080p":2,"2k":3,"4k":4},"video-upscaler-pro":{"720p":4,"1080p":6,"2k":8,"4k":10},flashvsr:{"720p":2,"1080p":4,"2k":6,"4k":8}};function aS(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)("video-upscaler-pro"),[o,m]=(0,i.useState)("1080p"),[x,u]=(0,i.useState)(0),{data:g}=(0,X.wV)(),{requireAuth:f,setError:v}=en(),N=ed(j.F.videoUpscaler.create);(0,i.useEffect)(()=>{if(!e)return void u(0);let a=document.createElement("video");return a.preload="metadata",a.onloadedmetadata=()=>{u(a.duration)},a.onerror=()=>{Q.oR.error("Invalid video file. Please upload a valid video"),s(null),u(0)},a.src=URL.createObjectURL(e),()=>{URL.revokeObjectURL(a.src)}},[e]);let b=(e,s,a)=>Math.ceil(Math.max(5,e)*aw[s][a]),y=b(x,d,o),w=(0,i.useCallback)(()=>{if(f()){if(!a)return void v("Please upload a video");N.mutate({model:d,video:a,target_resolution:o})}},[a,d,o,f,v,N]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eU.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Upload Video"}),(0,t.jsx)(h.BT,{children:"Upload your video to upscale"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Video File"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Click to upload video",supportedFormats:"MP4, MOV, WEBM supported",onFirstFileChange:s,onUrlChange:g?l:void 0,onUploadingChange:r}),e&&x>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Video duration: ",Math.round(x),"s ⢠Estimated cost: ",b(x,d,o)," ","credits"]})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Model"}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>e&&c(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsxs)(eG,{value:"video-upscaler","aria-label":"Upscaler model",className:"flex flex-col gap-1 h-auto py-2",children:[(0,t.jsx)("span",{children:"Upscaler"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[aw["video-upscaler"][o]," credits/s"]})]}),(0,t.jsxs)(eG,{value:"video-upscaler-pro","aria-label":"Upscaler Pro model",className:"flex flex-col gap-1 h-auto py-2",children:[(0,t.jsx)("span",{children:"Upscaler Pro"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[aw["video-upscaler-pro"][o]," credits/s"]})]}),(0,t.jsxs)(eG,{value:"flashvsr","aria-label":"FlashVSR model",className:"flex flex-col gap-1 h-auto py-2",children:[(0,t.jsx)("span",{children:"FlashVSR"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[aw.flashvsr[o]," credits/s"]})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Upscaler: Affordable quality ⢠Upscaler Pro: Best quality ⢠FlashVSR: Balanced speed"})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Target Resolution"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>e&&m(e),className:"w-full grid grid-cols-4 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"}),(0,t.jsx)(eG,{value:"2k","aria-label":"2k resolution",className:"flex-1",children:"2K"}),(0,t.jsx)(eG,{value:"4k","aria-label":"4k resolution",className:"flex-1",children:"4K"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Higher resolution requires more credits"})]}),{}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:w,disabled:n,credits:y,isPending:N.isPending}),(0,t.jsx)(eZ,{cost:y,costDescription:x>0?" ".concat(y," credits (").concat(Math.round(x),"s at ").concat(o," with ").concat("video-upscaler"===d?"Upscaler":"video-upscaler-pro"===d?"Upscaler Pro":"FlashVSR",")"):" Minimum 5s billing ⢠".concat(aw[d][o]," credits/s (").concat("video-upscaler"===d?"Upscaler":"video-upscaler-pro"===d?"Upscaler Pro":"FlashVSR"," at ").concat(o,")")})]})]})}let aC=eP.LD["video-upscaler"],aP=["21:9","16:9","4:3","1:1","3:4","9:16"];function aA(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("flux-kontext-pro"),[o,x]=(0,i.useState)(void 0),[u,g]=(0,i.useState)("jpeg"),{data:f,status:v}=(0,X.wV)(),{requireAuth:N,setError:b}=en(),y=ed(j.F.fluxKontext.create),w={"flux-kontext-pro":8,"flux-kontext-max":15},S=w[d];(0,i.useEffect)(()=>{"unauthenticated"===v&&r("A majestic dragon perched on a cliff overlooking a fantasy landscape, golden hour lighting, cinematic composition, highly detailed scales, ethereal atmosphere, 8k quality")}
1,[v]);let C=(0,i.useCallback)(()=>{if(N()){if(!n.trim())return void b("Please enter a prompt");y.mutate({model:d,prompt:n,aspectRatio:o,outputFormat:u,image:null!=e?e:void 0})}},[d,o,u,e,n,N,b,y]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Flux1-Kontext Generator"}),(0,t.jsx)(h.BT,{children:"Create high-quality images with exceptional prompt understanding"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Model Quality"})]}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>e&&c(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsxs)(eG,{value:"flux-kontext-pro",className:"flex-1",children:["Pro (",w["flux-kontext-pro"]," credits)"]}),(0,t.jsxs)(eG,{value:"flux-kontext-max",className:"flex-1",children:["Max (",w["flux-kontext-max"]," credits)"]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the image you want to create in detail..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Flux1-Kontext excels at understanding complex, detailed prompts"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Image"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload an image to edit (optional)",supp
1ortedFormats:"PNG, JPG, WEBP",onUrlChange:f?s:void 0,onUploadingChange:l}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Upload an image to use editing mode, or leave empty for text-to-image generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Output Format"})]}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>e&&g(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"jpeg",className:"flex-1",children:"JPEG"}),(0,t.jsx)(eG,{value:"png",className:"flex-1",children:"PNG"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"})]}),(0,t.jsxs)(sv.l6,{value:o||"auto",onValueChange:e=>{"auto"===e?x(void 0):x(e)},children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"auto",children:"Auto"}),aP.map(e=>(0,t.jsx)(sv.eb,{value:e,children:e},e))]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:C,disabled:a||!n.trim(),credits:S,isPending:y.isPending}),(0,t.jsx)(eZ,{cost:S,costDescription:" per generation (".concat("flux-kontext-pro"===d?"Pro":"Max",") ")})]})]})}let aE=eP.LD["flux-kontext"],aR={dev:4,pro:9,flex:18,max:9,"klein-4b":3,"klein-9b":3};function aF(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("klein-4b"),[r,d]=(0,i.useState)("1024*1024"),[c,o]=(0,i.useState)(1024),[m,x]=(0,i.useState)(1024),[u,g]=(0,i.useState)(void 0),[f,v]=(0,i.useState)(!1),{status:N}=(0,X.wV)(),{requireAuth:b,setError:y}=en(),w=aR[a],S=ed(j.F.flux2.create);(0,i.useEffect)(()=>{"unauthenticated"===N&&s("A serene landscape with mountains at sunset, vibrant colors, photorealistic, 8K quality")},[N]);let C=(0,i.useCallback)(()=>{if(!b())return;if(!e.trim())return void y("Please enter a prompt");let s="custom"===r?"".concat(c,"*").concat(m):r;S.mutate({modelType:"flux-2/text-to-image",prompt:e,quality:a,size:s,seed:u})},[e,a,r,c,m,u,b,y,S]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Text to Image"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions with Flux-2"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Flux-2"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the image you want to create..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Model Variant"}),(0,t.jsxs)(sv.l6,{value:a,onValueChange:e=>l(e),children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select quality"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"klein-4b",children:"Klein 4B (3 credits)"}),(0,t.jsx)(sv.eb,{value:"klein-9b",children:"Klein 9B (3 credits)"}),(0,t.jsx)(sv.eb,{value:"dev",children:"Dev (4 credits)"}),(0,t.jsx)(sv.eb,{value:"pro",children:"Pro (9 credits)"}),(0,t.jsx)(sv.eb,{value:"flex",children:"Flex (18 credits)"}),(0,t.jsx)(sv.eb,{value:"max",children:"Max (9 credits)"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:r,onValueChange:d,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"1024\xd71024 (default)",value:"1024*1024"},{label:"1280\xd71280",value:"1280*1280"},{label:"1440\xd71440",value:"1440*1440"},{label:"1536\xd71536",value:"1536*1536"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"1280\xd7720",value:"1280*720"},{label:"1440\xd7810",value:"1440*810"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"720\xd71280",value:"720*1280"},{label:"810\xd71440",value:"810*1440"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"1024\xd7768",value:"1024*768"},{label:"1280\xd7960",value:"1280*960"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"768\xd71024",value:"768*1024"},{label:"960\xd71280",value:"960*1280"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===r&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:c,onChange:e=>o(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?(o(1536),Q.oR.warning("Width limited to maximum 1536px")):s<256&&(o(256),Q.oR.warning("Width must be at least 256px"))}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:m,onChange:e=>x(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?(x(1536),Q.oR.warning("Height limited to maximum 1536px")):s<256&&(x(256),Q.oR.warning("Height must be at least 256px"))}})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Size range: 256\xd7256 - 1536\xd71536"})]}),(0,t.jsxs)(e9,{open:f,onOpenChange:v,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(f?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Leave empty for random, or set a specific seed",value:null!=u?u:"",onChange:e=>{let s=e.target.value;if(""===s)g(void 0);else{let e=parseInt(s,10);isNaN(e)||g(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Leave empty for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:C,disabled:!e.trim(),credits:w,isPending:S.isPending}),(0,t.jsx)(eZ,{cost:w,costDescription:" ".concat(w," credits (").concat(a," quality) ")})]})]})}let ak={dev:8,pro:18,flex:36,max:18,"klein-4b":4,"klein-9b":5};function aI(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("klein-4b"),[m,x]=(0,i.useState)("1024*1024"),[u,g]=(0,i.useState)(1024),[f,v]=(0,i.useState)(1024),[N,b]=(0,i.useState)(0),[y,w]=(0,i.useState)(0),[S,C]=(0,i.useState)(void 0),[P,A]=(0,i.useState)(!1),{data:E,status:R}=(0,X.wV)(),{requireAuth:F,setError:k}=en(),I=ak[c],U=ed(j.F.flux2.create);(0,i.useEffect)(()=>{"unauthenticated"===R&&d("Transform this image into a vibrant artistic masterpiece with enhanced colors and professional lighting")},[R]);let V=(0,i.useCallback)((e,s)=>{let a=e,t=s,l=!1,i=Math.min(e,s);if(i<256){let n=256/i;a=Math.round(e*n),t=Math.round(s*n),l=!0}let n=Math.max(a,t);if(n>1536){let e=1536/n;a=Math.round(a*e),t=Math.round(t*e),l=!0}return{width:a,height:t,scaled:l}},[]),T=(0,i.useCallback)(e=>{if(!e){b(0),w(0),x("1024*1024");return}let s=new Image;s.onload=()=>{URL.revokeObjectURL(s.src);let{width:e,height:a}=s;b(e),w(a);let{width:t,height:l,scaled:i}=V(e,a);x("custom"),g(t),v(l),i?Q.oR.info("Image auto-adjusted: ".concat(e,"\xd7").concat(a," â ").concat(t,"\xd7").concat(l)):Q.oR.success("Image size detected: ".concat(e,"\xd7").concat(a," ⢠Output will match input dimensions"))},s.onerror=()=>{URL.revokeObjectURL(s.src),Q.oR.error("Failed to read image dimensions"),b(0),w(0)},s.src=URL.createObjectURL(e)},[V]),B=(0,i.useCallback)(()=>{if(!F())return;if(!r.trim())return void k("Please enter a prompt");if(0===e.length)return void k("Please upload at least one image");let s="custom"===m?"".concat(u,"*").concat(f):m;U.mutate({modelType:"flux-2/edit",prompt:r,images:e,quality:c,size:s,seed:S})},[r,e,c,m,u,f,S,F,k,U]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Image Edit"}),(0,t.jsx)(h.BT,{children:"Edit images using natural language descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Flux-2"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium mb-3 block",children:["Upload Images (1-3) ",(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-".concat(3," images to edit"),supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:3,onFirstFileChange:T,onUrlsChange:E?s:void 0,onUploadingChange:l}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:[e.length>0?"".concat(e.length," image").concat(e.length>1?"s":""," selected"):"Click or drag images to upload",N>0&&y>0&&(0,t.jsxs)("span",{className:"ml-2",children:["⢠Original: ",N,"\xd7",y]})]})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to edit the image..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Model Variant"}),(0,t.jsxs)(sv.l6,{value:c,onValueChange:e=>o(e),children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select quality"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"klein-4b",children:"Klein 4B (4 credits)"}),(0,t.jsx)(sv.eb,{value:"klein-9b",children:"Klein 9B (5 credits)"}),(0,t.jsx)(sv.eb,{value:"dev",children:"Dev (8 credits)"}),(0,t.jsx)(sv.eb,{value:"pro",children:"Pro (18 credits)"}),(0,t.jsx)(sv.eb,{value:"flex",children:"Flex (36 credits)"}),(0,t.jsx)(sv.eb,{value:"max",children:"Max (18 credits)"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Output Size"}),(0,t.jsxs)(sv.l6,{value:m,onValueChange:x,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select resolution"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size (auto-detected)"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),[{label:"1024\xd71024 (default)",value:"1024*1024"},{label:"1280\xd71280",value:"1280*1280"},{label:"1440\xd71440",value:"1440*1440"},{label:"1536\xd71536",value:"1536*1536"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),[{label:"1280\xd7720",value:"1280*720"},{label:"1440\xd7810",value:"1440*810"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),[{label:"720\xd71280",value:"720*1280"},{label:"810\xd71440",value:"810*1440"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (4:3)"}),[{label:"1024\xd7768",value:"1024*768"},{label:"1280\xd7960",value:"1280*960"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Standard (3:4)"}),[{label:"768\xd71024",value:"768*1024"},{label:"960\xd71280",value:"960*1280"}].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===m&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:u,onChange:e=>g(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?(g(1536),Q.oR.warning("Width limited to maximum ".concat(1536,"px"))):s<256&&(g(256),Q.oR.warning("Width must be at least ".concat(256,"px")))}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:f,onChange:e=>v(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?(v(1536),Q.oR.warning("Height limited to maximum ".concat(1536,"px"))):s<256&&(v(256),Q.oR.warning("Height must be at least ".concat(256,"px")))}})]})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Size range: ",256,"\xd7",256," - ",1536,"\xd7",1536]})]}),(0,t.jsxs)(e9,{open:P,onOpenChange:A,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(P?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Leave empty for random, or set a specific seed",value:null!=S?S:"",onChange:e=>{let s=e.target.value;if(""===s)C(void 0);else{let e=parseInt(s,10);isNaN(e)||C(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Leave empty for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:B,disabled:a||!r.trim(),credits:I,isPending:U.isPending}),(0,t.jsx)(eZ,{cost:I,costDescription:" ".concat(I," credits (").concat(c," quality) ")})]})]})}let aU=eP.LD["flux-2"];var aV=a(68702);let aT={"standard-6":90,"standard-10":180,pro:150};function aB(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("standard"),[n,r]=(0,i.useState)(6),[d,c]=(0,i.useState)(!1),[o,x]=(0,i.useState)(!1),{status:u}=(0,X.wV)(),{requireAuth:g,setError:f}=en(),v=ed(j.F.hailuo23.createT2V),N="pro"===a?aT.pro:aT["standard-".concat(n)];(0,i.useEffect)(()=>{"unauthenticated"===u&&s("A cinematic shot of a sleek sports car racing through a neon-lit city at night, camera following from behind")},[u]);let b=(0,i.useCallback)(()=>{if(g()){if(!e.trim())return void f("Please enter a prompt");"standard"===a?v.mutate({model:"standard",prompt:e,duration:n,enable_prompt_expansion:o}):v.mutate({model:"pro",prompt:e,enable_prompt_expansion:o})}},[a,n,e,g,f,v,o]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text-to-Video Generator"}),(0,t.jsx)(h.BT,{children:"Create videos from text descriptions"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Quality & Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>e&&l(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"standard",className:"flex-1",children:"Standard (768P)"}),(0,t.jsx)(eG,{value:"pro",className:"flex-1",children:"Pro (1080P)"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Describe the scene, camera movements, and visual effects you want"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Duration"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs transition-opacity ".concat("pro"===a?"opacity-100":"opacity-0 pointer-events-none"),children:"Fixed 5s"})]}),"standard"===a?(0,t.jsxs)(eM,{type:"single",value:n.toString(),onValueChange:e=>e&&r(Number(e)),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"6",className:"flex-1",children:"6s"}),(0,t.jsx)(eG,{value:"10",className:"flex-1",children:"10s"})]}):(0,t.jsx)(eM,{type:"single",value:"5",disabled:!0,className:"w-full",children:(0,t.jsx)(eG,{value:"5",className:"w-full",disabled:!0,children:"5s (Fixed)"})})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>c(!d),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[d?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),d&&(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsxs)("p",{className:"text-xs",children:[(0,t.jsx)("span",{className:"text-destructive font-medium",children:"(This WILL activate safety checker)"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:" Automatically optimize prompts to enhance output quality"})]})]}),(0,t.jsx)(F,{id:"prompt-expansion",checked:o,onCheckedChange:x})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:b,disabled:!e.trim(),credits:N,isPending:v.isPending}),(0,t.jsx)(eZ,{cost:N,costDescription:" per generation (".concat("standard"===a?"Standard 768P, ".concat(n,"s"):"Pro 1080P, 5s",") ")})]})]})}let aM={"standard-6":90,"standard-10":180,pro:150};function aG(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("standard"),[o,x]=(0,i.useState)(6),[u,g]=(0,i.useState)(!1),[f,v]=(0,i.useState)(!1),{data:N,status:b}=(0,X.wV)(),{requireAuth:y,setError:w}=en(),S=ed(j.F.hailuo23.createI2V),C="pro"===d?aM.pro:aM["standard-".concat(o)];(0,i.useEffect)(()=>{"unauthenticated"===b&&r("Camera slowly zooms in as the subject looks up with a gentle smile, soft wind blowing through their hair, natural lighting, cinematic motion")},[b]);let P=(0,i.useCallback)(()=>{if(y()){if(!e)return void w("Please upload a reference image");"standard"===d?S.mutate({model:"standard",prompt:n.trim()||void 0,image:e,duration:o,enable_prompt_expansion:f}):S.mutate({model:"pro",prompt:n.trim()||void 0,image:e,enable_prompt_expansion:f})}},[d,o,e,n,y,w,S,f]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image-to-Video Generator"}),(0,t.jsx)(h.BT,{children:"Transform images into dynamic videos with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Quality & Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>e&&c(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"standard",className:"flex-1",children:"Standard (768P)"}),(0,t.jsx)(eG,{value:"pro",className:"flex-1",children:"Pro (1080P)"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload an image to animate",supportedFormats:"PNG, JPG, WEBP (max 10MB)",onUrlChange:N?s:void 0,onUploadingChange:l}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Upload a reference image that will be animated based on your prompt"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the motion and transformation you want... (optional)"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Describe camera movements, subject actions, and desired effects"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Duration"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs transition-opacity ".concat("pro"===d?"opacity-100":"opacity-0 pointer-events-none"),children:"Fixed 5s"})]}),"standard"===d?(0,t.jsxs)(eM,{type:"single",value:o.toString(),onValueChange:e=>e&&x(Number(e)),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"6",className:"flex-1",children:"6s"}),(0,t.jsx)(eG,{value:"10",className:"flex-1",children:"10s"})]}):(0,t.jsx)(eM,{type:"single",value:"5",disabled:!0,className:"w-full",children:(0,t.jsx)(eG,{value:"5",className:"w-full",disabled:!0,children:"5s (Fixed)"})})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>g(!u),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[u?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),u&&(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Enable Prompt Expansion"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsxs)("p",{className:"text-xs",children:[(0,t.jsx)("span",{className:"text-destructive font-medium",children:"(This WILL activate safety checker)"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:" Automatically optimize prompts to enhance output quality"})]})]}),(0,t.jsx)(F,{id:"prompt-expansion",checked:f,onCheckedChange:v})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:P,disabled:a,credits:C,isPending:S.isPending}),(0,t.jsx)(eZ,{cost:C,costDescription:" per generation (".concat("standard"===d?"Standard 768P, ".concat(o,"s"):"Pro 1080P, 5s",") ")})]})]})}let aD=eP.LD["hailuo-2.3"],aO={"480p":12,"768p":24},aW={"480p":15,"768p":30},aJ=["16:9","21:9","4:3","1:1"],aZ={"16:9":"9:16","21:9":"9:21","4:3":"3:4"};function a_(e,s){return"1:1"===e?"1:1":"portrait"===s?aZ[e]:e}function aL(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("480p"),[n,r]=(0,i.useState)("16:9"),[d,c]=(0,i.useState)("landscape"),[o,m]=(0,i.useState)(5),[x,u]=(0,i.useState)(-1),[g,f]=(0,i.useState)(!1),{status:v}=(0,X.wV)(),{requireAuth:N,setError:b}=en(),y=ed(j.F.minimaxH3.create);(0,i.useEffect)(()=>{"unauthenticated"===v&&s("An epic space-opera trailer: a lone woman captain stands before a vast observation window as the last fleet gathers and jumps away. Blinding light flares, the bridge shudders, and she is left behind. Swelling orchestral score with deep bass rumbles.")},[v]);let w=o*aO[a],S=(0,i.useCallback)(()=>{if(N()){if(!e.trim())return void b("Please enter a prompt");y.mutate({modelType:"minimax-h3/text-to-video",prompt:e,aspect_ratio:a_(n,d),resolution:a,duration:o,seed:x})}},[N,e,n,d,a,o,x,b,y]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate video with native stereo audio from a prompt"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the scene, action, camera movement, and the soundtrack you want..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>{("480p"===e||"768p"===e)&&l(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"768p","aria-label":"768p resolution",className:"flex-1",children:"768p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsx)(eM,{type:"single",value:n,onValueChange:e=>{aJ.includes(e)&&r(e)},className:"w-full grid grid-cols-4 gap-2",children:aJ.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":e,className:"flex-1",children:e},e))})]}),"1:1"!==n&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>{("landscape"===e||"portrait"===e)&&c(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Output ratio: ",a_(n,d)]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[o,"s"]})]}),(0,t.jsx)(sm.A,{min:5,max:15,step:1,value:[o],onValueChange:e=>m(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"5s"}),(0,t.jsx)("span",{children:"15s"})]})]}),(0,t.jsxs)(e9,{open:g,onOpenChange:f,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(g?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:x,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)u(-1);else{let e=parseInt(s,10);isNaN(e)||u(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:S,disabled:!e.trim(),credits:w,isPending:y.isPending}),(0,t.jsx)(eZ,{cost:w,costDescription:"".concat(w," credits (").concat(aO[a],"/s \xd7 ").concat(o,"s at ").concat(a,")")})]})]})}function aq(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(null),[c,o]=(0,i.useState)("480p"),[m,x]=(0,i.useState)(5),[u,g]=(0,i.useState)(-1),[f,v]=(0,i.useState)(!1),[N,b]=(0,i.useState)(!1),[y,w]=(0,i.useState)(!1),{data:S,status:C}=(0,X.wV)(),{requireAuth:P,setError:A}=en(),E=ed(j.F.minimaxH3.create);(0,i.useEffect)(()=>{"unauthenticated"===C&&s("The camera slowly pushes in as wind lifts her hair and the light shifts from cold blue to warm gold. Distant hum of engines, soft ambient score.")},[C]);let R=m*aO[c],F=(0,i.useCallback)(()=>{if(P()){if(!e.trim())return void A("Please enter a prompt");if(!a)return void A("Please upload a first frame image");E.mutate({modelType:"minimax-h3/image-to-video",prompt:e,image:a,last_image:r||void 0,resolution:c,duration:m,seed:u})}},[P,e,a,r,c,m,u,A,E]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate a first frame, optionally guided by a last frame"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"First Frame"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:S?l:void 0,onUploadingChange:b})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Last Frame"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the last frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:S?d:void 0,onUploadingChange:w})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground -mt-3",children:"The output canvas follows the first frame's aspect ratio."}),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the motion, scene, and the soundtrack you want..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:c,onValueChange:e=>{("480p"===e||"768p"===e)&&o(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"768p","aria-label":"768p resolution",className:"flex-1",children:"768p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[m,"s"]})]}),(0,t.jsx)(sm.A,{min:5,max:15,step:1,value:[m],onValueChange:e=>x(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"5s"}),(0,t.jsx)("span",{children:"15s"})]})]}),(0,t.jsxs)(e9,{open:f,onOpenChange:v,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(f?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:u,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)g(-1);else{let e=parseInt(s,10);isNaN(e)||g(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:F,disabled:N||y||!e.trim(),credits:R,isPending:E.isPending}),(0,t.jsx)(eZ,{cost:R,costDescription:"".concat(R," credits (").concat(aO[c],"/s \xd7 ").concat(m,"s at ").concat(c,")")})]})]})}var aK=a(16727);function az(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)([]),[r,d]=(0,i.useState)([]),[c,o]=(0,i.useState)([]),[m,x]=(0,i.useState)([]),[u,g]=(0,i.useState)(0),[f,v]=(0,i.useState)(null),[N,b]=(0,i.useState)("480p"),[y,w]=(0,i.useState)("16:9"),[S,C]=(0,i.useState)("landscape"),[P,A]=(0,i.useState)(5),[E,R]=(0,i.useState)(-1),[F,k]=(0,i.useState)(!1),[I,U]=(0,i.useState)(!1),[V,T]=(0,i.useState)(!1),[B,M]=(0,i.useState)(!1),{data:G,status:D}=(0,X.wV)(),{requireAuth:O,setError:W}=en(),J=ed(j.F.minimaxH3.create);(0,i.useEffect)(()=>{"unauthenticated"===D&&s("<Picture 1> walks through the neon-lit alley in the style of <Picture 2>, rain glistening on the pavement. Ambient city hum with a low synth pulse.")},[D]);let Z=r.length>0;(0,i.useEffect)(()=>{Z&&"768p"===N&&(b("480p"),Q.oR.info("Switched to 480p â reference videos are only supported at 480p output."))},[Z,N]),(0,i.useEffect)(()=>{if(0===m.length){g(0),v(null);return}let e=!1,s=[];return Promise.all(m.map(e=>new Promise((a,t)=>{let l=document.createElement("video"),i=URL.createObjectURL(e);s.push(i),l.preload="metadata",l.onloadedmetadata=()=>a(l.duration),l.onerror=()=>t(Error("Invalid video file")),l.src=i}))).then(s=>{if(e)return;let a=s.reduce((e,s)=>e+s,0);if(g(a),a>15){let e="Reference videos are too long. Maximum total reference video length is ".concat(15," seconds.");v(e),Q.oR.error(e)}else v(null)}).catch(()=>{if(e)return;let s="Invalid video file. Please upload a valid video.";g(0),v(s),Q.oR.error(s)}),()=>{e=!0,s.forEach(e=>URL.revokeObjectURL(e))}},[m]);let _=Z?u:0,L=Math.ceil(P*aW[N]+6*a.length+6*c.length+15*_),q=a.length>0||r.length>0,K=(0,i.useCallback)(()=>{if(O()){if(!e.trim())return void W("Please enter a prompt");if(!q)return void W("Please upload at least one reference image or video. Audio alone is not accepted.");if(f||u>15)return void W(f||"Reference videos are too long. Maximum total reference video length is ".concat(15," seconds."));J.mutate({modelType:"minimax-h3/reference-to-video",prompt:e,reference_images:a.length>0?a:void 0,reference_videos:r.length>0?r:void 0,reference_audios:c.length>0?c:void 0,aspect_ratio:a_(y,S),resolution:N,duration:P,seed:E})}},[O,e,q,a,r,c,y,S,N,P,E,u,f,W,J]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eq.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Reference to Video"}),(0,t.jsx)(h.BT,{children:"Guide generation with up to 9 images, 3 videos and 3 audio clips"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video. Cite references as <Picture 1>, <Video 1>, <Audio 1>..."}),(0,t.jsxs)("div",{className:"rounded-lg border p-4 space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eq.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Visual Reference"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"}),q&&(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:"Added"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"At least one image or video. Audio alone is not accepted."}),c.length>0&&!q&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:"Audio alone isn't enough. Add an image or video."})]}),(0,t.jsxs)(e9,{defaultOpen:!0,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Images"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[a.length," of ",9]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload up to ".concat(9," reference images"),supportedFormats:"JPEG, PNG, WEBP",maxFiles:9,onUrlsChange:G?l:void 0,onUploadingChange:U}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:[6," credits each"]})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(eX.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Videos"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[r.length," of ",3]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"video",de
1scription:"Upload up to ".concat(3," reference videos"),supportedFormats:"MP4, MOV, MKV",maxFiles:3,onFilesChange:x,onUrlsChange:G?d:void 0,onUploadingChange:T}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:[15," credits per second, shared 15s budget",_>0&&" â using ".concat(_.toFixed(1),"s of ").concat(15,"s"),". Forces 480p output, and their soundtracks are used automatically."]}),f&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:f})]})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(sc.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Audio"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),c.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[c.length," of ",3]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload up to ".concat(3," audio clips (each trimmed to 15s)"),supportedFormats:"MP3, WAV supported",maxFiles:3,onUrlsChange:G?o:void 0,onUploadingChange:M}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:[6," credits each",Z&&". Your reference videos already contribute their soundtracks"]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:N,onValueChange:e=>{("480p"===e||"768p"===e)&&b(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"768p","aria-label":"768p resolution",className:"flex-1",disabled:Z,children:"768p"})]}),Z&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"768p is unavailable while reference videos are attached."})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsx)(eM,{type:"single",value:y,onValueChange:e=>{aJ.includes(e)&&w(e)},className:"w-full grid grid-cols-4 gap-2",children:aJ.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":e,className:"flex-1",children:e},e))})]}),"1:1"!==y&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:S,onValueChange:e=>{("landscape"===e||"portrait"===e)&&C(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Output ratio: ",a_(y,S)]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[P,"s"]})]}),(0,t.jsx)(sm.A,{min:5,max:15,step:1,value:[P],onValueChange:e=>A(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"5s"}),(0,t.jsx)("span",{children:"15s"})]})]}),(0,t.jsxs)(e9,{open:F,onOpenChange:k,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(F?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:E,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)R(-1);else{let e=parseInt(s,10);isNaN(e)||R(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:K,disabled:I||V||B||!e.trim(),credits:L,isPending:J.isPending}),(0,t.jsx)(eZ,{cost:L,costDescription:["".concat(aW[N],"/s \xd7 ").concat(P,"s"),a.length>0?"".concat(a.length," img \xd7 ").concat(6):null,c.length>0?"".concat(c.length," audio \xd7 ").concat(6):null,_>0?"".concat(15,"/s \xd7 ").concat(_.toFixed(1),"s ref video"):null].filter(Boolean).join(" + ")+" = ".concat(L," credits")})]})]})}let aQ=eP.LD["minimax-h3"],aH=["text-to-video","image-to-video","reference-to-video"],a$=["480p","720p","1080p"],aY={normal:{"480p":15,"720p":30,"1080p":60},prime:{"480p":18.75,"720p":37.5,"1080p":75}},aX={normal:{"480p":15,"720p":30,"1080p":60},prime:{"480p":22.5,"720p":45,"1080p":90}};function a0(e,s){return Math.ceil(e*s)}function a1(e){return"reference"===e?"+50% credits":"+25% credits"}function a2(e){let{value:s,onChange:a,mode:l}=e;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Speed"}),(0,t.jsxs)(eM,{type:"single",value:s,onValueChange:e=>{("normal"===e||"prime"===e)&&a(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"normal","aria-label":"Normal speed",className:"flex-1",children:"Normal"}),(0,t.jsx)(eG,{value:"prime","aria-label":"Prime speed",className:"flex-1",children:"Prime"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"prime"===s?"Prime is the faster channel â same output quality and options, ".concat(a1(l),"."):"Normal is the standard channel. Prime generates faster for ".concat(a1(l),".")})]})}let a4=["16:9","4:3","1:1"],a3={"16:9":"9:16","4:3":"3:4"};function a5(e,s){return"1:1"===e?"1:1":"portrait"===s?a3[e]:e}function a6(e){return"1:1"!==e}function a8(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("normal"),[n,r]=(0,i.useState)("480p"),[d,c]=(0,i.useState)("16:9"),[o,m]=(0,i.useState)("landscape"),[x,u]=(0,i.useState)(5),[g,f]=(0,i.useState)(!1),[v,N]=(0,i.useState)(!0),[b,y]=(0,i.useState)(-1),[w,S]=(0,i.useState)(!1),{status:C}=(0,X.wV)(),{requireAuth:P,setError:A}=en(),E=ed(j.F.wan3.create);(0,i.useEffect)(()=>{"unauthenticated"===C&&s("A lone lighthouse on a storm-battered cliff at dawn: waves explode against black rock, the beam sweeps through driving rain, gulls scatter. Low brass swells under the roar of the surf.")},[C]);let R=aY[a][n],k=a0(x,R),I=(0,i.useCallback)(()=>{if(P()){if(!e.trim())return void A("Please enter a prompt");E.mutate({modelType:"wan3/text-to-video",speed:a,prompt:e,aspect_ratio:a5(d,o),resolution:n,duration:x,thinking_mode:g,enable_audio:v,seed:b})}},[P,e,a,d,o,n,x,g,v,b,A,E]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate up to 30 seconds of cinematic video with native audio from a prompt"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the scene, action, camera movement, lighting, and the soundtrack you want..."}),(0,t.jsx)(a2,{value:a,onChange:l,mode:"standard"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsx)(eM,{type:"single",value:n,onValueChange:e=>{a$.includes(e)&&r(e)},className:"w-full grid grid-cols-3 gap-2",children:a$.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":"".concat(e," resolution"),className:"flex-1",children:e},e))})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsx)(eM,{type:"single",value:d,onValueChange:e=>{a4.includes(e)&&c(e)},className:"w-full grid grid-cols-3 gap-2",children:a4.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":e,className:"flex-1",children:e},e))})]}),a6(d)&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>{("landscape"===e||"portrait"===e)&&m(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"
1currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Output ratio: ",a5(d,o)]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[x,"s"]})]}),(0,t.jsx)(sm.A,{min:2,max:30,step:1,value:[x],onValueChange:e=>u(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"2s"}),(0,t.jsx)("span",{children:"30s"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Generate Audio"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Soundtrack and effects are generated from your prompt in the same pass"})]}),(0,t.jsx)(F,{checked:v,onCheckedChange:N})]}),(0,t.jsxs)(e9,{open:w,onOpenChange:S,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(w?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Thinking Mode"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Slower, but interprets complex prompts and scene relationships more carefully"})]}),(0,t.jsx)(F,{checked:g,onCheckedChange:f})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:b,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)y(-1);else{let e=parseInt(s,10);isNaN(e)||y(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:I,disabled:!e.trim(),credits:k,isPending:E.isPending}),(0,t.jsx)(eZ,{cost:k,costDescription:"".concat(k," credits (").concat(R,"/s \xd7 ").concat(x,"s at ").concat(n,", ").concat(a,")")})]})]})}function a9(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(null),[c,o]=(0,i.useState)("normal"),[m,x]=(0,i.useState)("480p"),[u,g]=(0,i.useState)("auto"),[f,v]=(0,i.useState)("landscape"),[N,b]=(0,i.useState)(5),[y,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!0),[P,A]=(0,i.useState)(-1),[E,R]=(0,i.useState)(!1),[k,I]=(0,i.useState)(!1),[U,V]=(0,i.useState)(!1),{data:T,status:B}=(0,X.wV)(),{requireAuth:M,setError:G}=en(),D=ed(j.F.wan3.create);(0,i.useEffect)(()=>{"unauthenticated"===B&&s("The camera slowly pushes in as wind lifts her hair and the light shifts from cold blue to warm gold. Distant hum of engines, soft ambient score.")},[B]);let O=aY[c][m],W=a0(N,O),J=(0,i.useCallback)(()=>{if(M()){if(!e.trim())return void G("Please enter a prompt");if(!a)return void G("Please upload a first frame image");D.mutate({modelType:"wan3/image-to-video",speed:c,prompt:e,image:a,last_image:r||void 0,aspect_ratio:"auto"===u?void 0:a5(u,f),resolution:m,duration:N,thinking_mode:y,enable_audio:S,seed:P})}},[M,e,a,r,c,u,f,m,N,y,S,P,G,D]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate a first frame, optionally guided by a last frame"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"First Frame"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:T?l:void 0,onUploadingChange:I})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Last Frame"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the last frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:T?d:void 0,onUploadingChange:V})]})]}),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the motion, camera movement, lighting, and the soundtrack you want..."}),(0,t.jsx)(a2,{value:c,onChange:o,mode:"standard"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsx)(eM,{type:"single",value:m,onValueChange:e=>{a$.includes(e)&&x(e)},className:"w-full grid grid-cols-3 gap-2",children:a$.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":"".concat(e," resolution"),className:"flex-1",children:e},e))})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>{("auto"===e||a4.includes(e))&&g(e)},className:"w-full grid grid-cols-4 gap-2",children:[(0,t.jsx)(eG,{value:"auto","aria-label":"Match the first frame",className:"flex-1",children:"Auto"}),a4.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":e,className:"flex-1",children:e},e))]}),"auto"===u&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Output follows the aspect ratio of your first frame"})]}),"auto"!==u&&a6(u)&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:f,onValueChange:e=>{("landscape"===e||"portrait"===e)&&v(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"
1currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Output ratio: ",a5(u,f)]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[N,"s"]})]}),(0,t.jsx)(sm.A,{min:2,max:30,step:1,value:[N],onValueChange:e=>b(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"2s"}),(0,t.jsx)("span",{children:"30s"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Generate Audio"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Soundtrack and effects are generated from your prompt in the same pass"})]}),(0,t.jsx)(F,{checked:S,onCheckedChange:C})]}),(0,t.jsxs)(e9,{open:E,onOpenChange:R,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(E?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Thinking Mode"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Slower, but interprets complex prompts and scene relationships more carefully"})]}),(0,t.jsx)(F,{checked:y,onCheckedChange:w})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:P,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)A(-1);else{let e=parseInt(s,10);isNaN(e)||A(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:J,disabled:!e.trim()||k||U,credits:W,isPending:D.isPending}),(0,t.jsx)(eZ,{cost:W,costDescription:"".concat(W," credits (").concat(O,"/s \xd7 ").concat(N,"s at ").concat(m,", ").concat(c,")")})]})]})}function a7(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)([]),[r,d]=(0,i.useState)([]),[c,o]=(0,i.useState)([]),[m,x]=(0,i.useState)([]),[u,g]=(0,i.useState)(0),[f,v]=(0,i.useState)(null),[N,b]=(0,i.useState)("normal"),[y,w]=(0,i.useState)("480p"),[S,C]=(0,i.useState)("16:9"),[P,A]=(0,i.useState)("landscape"),[E,R]=(0,i.useState)(5),[k,I]=(0,i.useState)(!1),[U,V]=(0,i.useState)(!0),[T,B]=(0,i.useState)(-1),[M,G]=(0,i.useState)(!1),[D,O]=(0,i.useState)(!1),[W,J]=(0,i.useState)(!1),[Z,_]=(0,i.useState)(!1),{data:L,status:q}=(0,X.wV)(),{requireAuth:K,setError:z}=en(),H=ed(j.F.wan3.create);(0,i.useEffect)(()=>{"unauthenticated"===q&&s("Image 1 walks through the neon-lit alley from Image 2, pausing to look up as rain glistens on the pavement. Ambient city hum with a low synth pulse.")},[q]);let $=r.length>0;(0,i.useEffect)(()=>{if(0===m.length){g(0),v(null);return}let e=!1,s=[];return Promise.all(m.map(e=>new Promise((a,t)=>{let l=document.createElement("video"),i=URL.createObjectURL(e);s.push(i),l.preload="metadata",l.onloadedmetadata=()=>a(l.duration),l.onerror=()=>t(Error("Invalid video file")),l.src=i}))).then(s=>{if(e)return;let a=s.reduce((e,s)=>e+s,0);if(g(a),a>15){let e="Reference videos are too long. Maximum total reference video length is ".concat(15," seconds.");v(e),Q.oR.error(e)}else v(null)}).catch(()=>{if(e)return;let s="Invalid video file. Please upload a valid video.";g(0),v(s),Q.oR.error(s)}),()=>{e=!0,s.forEach(e=>URL.revokeObjectURL(e))}},[m]);let Y=$?u<=0?0:Math.min(Math.ceil(u),15):0,ee=aX[N][y],es=Y+E,ea=a0(es,ee),et=a.length>0||r.length>0||c.length>0,el=Y+E>30,ei=(0,i.useCallback)(()=>{if(K()){if(!e.trim())return void z("Please enter a prompt");if(!et)return void z("Please upload at least one reference image, video, or audio file.");if(f||u>15)return void z(f||"Reference videos are too long. Maximum total reference video length is ".concat(15," seconds."));if(el)return void z("Reference video length plus output duration must not exceed ".concat(30," seconds. Shorten the references or reduce the duration."));H.mutate({modelType:"wan3/reference-to-video",speed:N,prompt:e,reference_images:a.length>0?a:void 0,reference_videos:r.length>0?r:void 0,reference_audios:c.length>0?c:void 0,aspect_ratio:a5(S,P),resolution:y,duration:E,thinking_mode:k,enable_audio:U,seed:T})}},[K,e,et,a,r,c,N,S,P,y,E,k,U,T,u,f,el,z,H]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eq.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Reference to Video"}),(0,t.jsxs)(h.BT,{children:["Guide generation with up to ",10," images, ",5," videos and ",5," audio clips"]})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video, referring to your uploads as Image 1, Video 1, Audio 1..."}),(0,t.jsxs)("div",{className:"rounded-lg border p-4 space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eq.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"}),et&&(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:"Added"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"At least one image, video, or audio file."})]}),(0,t.jsxs)(e9,{defaultOpen:!0,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Images"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[a.length," of ",10]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload up to ".concat(10," reference images"),supportedFormats:"JPEG, PNG, WEBP",maxFiles:10,onUrlsChange:L?l:void 0,onUploadingChange:O}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Free â reference images don't add to the credit cost"})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(eX.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Videos"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[r.length," of ",5]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"video",de
1scription:"Upload up to ".concat(5," reference videos"),supportedFormats:"MP4, MOV",maxFiles:5,onFilesChange:x,onUrlsChange:L?d:void 0,onUploadingChange:J}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Billed as extra seconds at the same rate, shared ",15,"s budget",Y>0&&" â using ".concat(Y,"s of ").concat(15,"s"),". Each clip must be 1â15s, MP4 or MOV, under 100 MB."]}),f&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:f}),el&&(0,t.jsxs)("p",{className:"text-xs text-destructive mt-2",children:["Reference video length plus output duration must not exceed ",30,"s. Shorten the references or reduce the duration."]})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(sc.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Audio"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[c.length," of ",5]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload up to ".concat(5," reference audio files"),supportedFormats:"MP3, WAV, M4A",maxFiles:5,onUrlsChange:L?o:void 0,onUploadingChange:_}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Free â 15s total across all files"})]})]})]}),(0,t.jsx)(a2,{value:N,onChange:b,mode:"reference"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsx)(eM,{type:"single",value:y,onValueChange:e=>{a$.includes(e)&&w(e)},className:"w-full grid grid-cols-3 gap-2",children:a$.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":"".concat(e," resolution"),className:"flex-1",children:e},e))})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsx)(eM,{type:"single",value:S,onValueChange:e=>{a4.includes(e)&&C(e)},className:"w-full grid grid-cols-3 gap-2",children:a4.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":e,className:"flex-1",children:e},e))})]}),a6(S)&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:P,onValueChange:e=>{("landscape"===e||"portrait"===e)&&A(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Output ratio: ",a5(S,P)]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[E,"s"]})]}),(0,t.jsx)(sm.A,{min:2,max:30,step:1,value:[E],onValueChange:e=>R(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"2s"}),(0,t.jsx)("span",{children:"30s"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Generate Audio"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Soundtrack and effects are generated in the same pass"})]}),(0,t.jsx)(F,{checked:U,onCheckedChange:V})]}),(0,t.jsxs)(e9,{open:M,onOpenChange:G,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(M?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Thinking Mode"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Slower, but interprets complex prompts and scene relationships more carefully"})]}),(0,t.jsx)(F,{checked:k,onCheckedChange:I})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:T,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)B(-1);else{let e=parseInt(s,10);isNaN(e)||B(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:ei,disabled:!e.trim()||D||W||Z,credits:ea,isPending:H.isPending}),(0,t.jsx)(eZ,{cost:ea,costDescription:Y>0?"".concat(ea," credits (").concat(ee,"/s \xd7 ").concat(es,"s = ").concat(E,"s output + ").concat(Y,"s reference, at ").concat(y,", ").concat(N,")"):"".concat(ea," credits (").concat(ee,"/s \xd7 ").concat(E,"s at ").concat(y,", ").concat(N,")")})]})]})}let te=eP.LD["wan-3.0"],ts=["text-to-video","image-to-video","reference-to-video"];var ta=a(74983);let tt=["480p","720p","1080p","4k"],tl=["720p","1080p"],ti={"480p":45,"720p":90,"1080p":225,"4k":450},tn={"480p":28,"720p":55,"1080p":138,"4k":275},tr={"720p":50,"1080p":53},td={"720p":95,"1080p":98},tc={"720p":33,"1080p":35},to=(e,s,a)=>Math.min(a,Math.max(s,e));function tm(e){let{value:s,onChange:a,options:l}=e;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsx)(eM,{type:"single",value:s,onValueChange:e=>{l.includes(e)&&a(e)},className:"w-full grid gap-2 ".concat(2===l.length?"grid-cols-2":"grid-cols-4"),children:l.map(e=>(0,t.jsx)(eG,{value:e,"aria-label":"".concat(e," resolution"),className:"flex-1",children:e},e))})]})}function tx(e){let{ratio:s}=e,[a,l]=s.split(":").map(Number),i=a/l,n=i>=1?18:Math.max(18*i,5),r=i>=1?Math.max(18/i,5):18;return(0,t.jsx)("span",{className:"flex h-[18px] w-[18px] items-center justify-center",children:(0,t.jsx)("span",{className:"rounded-[2px] border-[1.5px] border-current",style:{width:n,height:r}})})}function tu(e){let{value:s,onChange:a}=e;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1.5",children:["16:9","4:3","1:1","9:16","3:4","21:9"].map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>a(e),"aria-pressed":s===e,className:(0,b.cn)("flex min-h-[52px] flex-col items-center justify-center gap-1 rounded-md border text-xs transition-colors",s===e?"border-primary bg-primary/10 text-primary":"border-input text-muted-foreground hover:border-muted-foreground/50 hover:text-foreground"),children:[(0,t.jsx)(tx,{ratio:e}),e]},e))})]})}function th(e){let{value:s,onChange:a,label:l="Duration"}=e;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:l}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:[s,"s"]})]}),(0,t.jsx)(sm.A,{min:4,max:30,step:1,value:[s],onValueChange:e=>a(e[0]),className:"w-full"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[4,"s"]}),(0,t.jsxs)("span",{children:[30,"s"]})]})]})}function tp(e){let{checked:s,onChange:a,note:l}=e;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Generate Audio"}),(0,t.jsx)(F,{checked:s,onCheckedChange:a})]}),l&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:l})]})}function tg(e){let[s,a]=(0,i.useState)(0),[t,l]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(0===e.length){a(0),l(null);return}let s=!1,t=[];return Promise.all(e.map(e=>new Promise((s,a)=>{let l=document.createElement("video"),i=URL.createObjectURL(e);t.push(i),l.preload="metadata",l.onloadedmetadata=()=>s(l.duration),l.onerror=()=>a(Error("Invalid video file")),l.src=i}))).then(e=>{s||(a(e.reduce((e,s)=>e+s,0)),l(null))}).catch(()=>{s||(a(0),l("Invalid video file. Please upload a valid video."))}),()=>
1{s=!0,t.forEach(e=>URL.revokeObjectURL(e))}},[e]),{duration:s,error:t}}function tj(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)([]),[r,d]=(0,i.useState)([]),[c,o]=(0,i.useState)([]),[m,x]=(0,i.useState)([]),[u,g]=(0,i.useState)("720p"),[f,v]=(0,i.useState)("16:9"),[N,b]=(0,i.useState)(5),[y,w]=(0,i.useState)(!0),[S,C]=(0,i.useState)(!1),[P,A]=(0,i.useState)(!1),[E,R]=(0,i.useState)(!1),{data:F,status:k}=(0,X.wV)(),{requireAuth:I,setError:U}=en(),V=ed(j.F.seedance25.create);(0,i.useEffect)(()=>{"unauthenticated"===k&&s("A slow dolly-in on an old lighthouse keeper lighting the lamp at dusk, storm clouds racing over the sea behind him. Rain streaks the glass; the beam cuts through the mist. Orchestral swell with crashing waves and a distant foghorn.")},[k]);let T=r.length>0,{duration:B,error:M}=tg(m),G=T?B:0,D=T?Math.ceil(tn[u]*(G+N)):ti[u]*N,O=B>30,W=(0,i.useCallback)(()=>{if(I()){if(!e.trim())return void U("Please enter a prompt");if(T&&(M||O))return void U(M||"Reference videos are too long. Maximum total reference video length is ".concat(30," seconds."));
1V.mutate({modelType:"seedance-2.5/text-to-video",prompt:e,reference_images:a.length>0?a:void 0,reference_videos:r.length>0?r:void 0,reference_audios:c.length>0?c:void 0,aspect_ratio:f,resolution:u,duration:N,generate_audio:y})}},[I,e,a,r,c,T,M,O,f,u,N,y,U,V]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Generate Video"}),(0,t.jsx)(h.BT,{children:"Generate from a prompt â optionally add image, video and audio references"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the scene, action, camera, lighting and soundtrack. Cite references as @image1, @video1, @audio1..."}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),a.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[a.length," of ",30]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload up to ".concat(30," reference images"),supportedFormats:"JPEG, PNG, WEBP",maxFiles:30,onUrlsChange:F?l:void 0,onUploadingChange:C}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Guide style, characters or composition. No extra charge."})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(eX.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Videos"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),r.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[r.length," of ",10]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload up to ".concat(10," reference videos (").concat(30,"s total)"),supportedFormats:"MP4, MOV, MKV",maxFiles:10,onFilesChange:x,onUrlsChange:F?d:void 0,onUploadingChange:A}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Guide motion, pacing or camera behavior. Switches billing to"," ",tn[u]," credits/s on reference + output seconds combined",G>0&&" â using ".concat(G.toFixed(1),"s of ").concat(30,"s"),"."]}),(M||O)&&m.length>0&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:M||"Reference videos are too long. Maximum total reference video length is ".concat(30," seconds.")})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(sc.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Audio"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),c.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[c.length," of ",10]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload up to ".concat(10," audio clips (30s total)"),supportedFormats:"MP3, WAV supported",maxFiles:10,onUrlsChange:F?o:void 0,onUploadingChange:R}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Guide soundtrack, ambience or audio style. No extra charge."})]})]}),(0,t.jsx)(tm,{value:u,onChange:g,options:tt}),(0,t.jsx)(tu,{value:f,onChange:v}),(0,t.jsx)(th,{value:N,onChange:b}),(0,t.jsx)(tp,{checked:y,onChange:w,note:"Native audio is synchronized with the video in a single pass."}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:W,disabled:S||P||E||!e.trim(),credits:D,isPending:V.isPending}),(0,t.jsx)(eZ,{cost:D,costDescription:T?"".concat(tn[u],"/s \xd7 (").concat(G.toFixed(1),"s ref + ").concat(N,"s output) = ").concat(D," credits"):"".concat(ti[u],"/s \xd7 ").concat(N,"s at ").concat(u," = ").concat(D," credits")})]})]})}var tf=a(65340);function tv(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(!1),[r,d
1]=(0,i.useState)(null),[c,o]=(0,i.useState)(null),[m,x]=(0,i.useState)("720p"),[u,g]=(0,i.useState)(5),[f,v]=(0,i.useState)(!0),[N,b]=(0,i.useState)(!1),[y,w]=(0,i.useState)(!1),{data:S,status:C}=(0,X.wV)(),{requireAuth:P,setError:A}=en(),E=ed(j.F.seedance25.create);(0,i.useEffect)(()=>{"unauthenticated"===C&&s("The camera pulls back slowly as dawn light spreads across the valley. Mist rises from the river; birdsong builds into a gentle acoustic theme.")},[C]);let R=ti[m]*u,k=(0,i.useCallback)(()=>{if(P()){if(!e.trim())return void A("Please enter a prompt");if(!r)return void A("Please upload a start frame");a?E.mutate({modelType:"seedance-2.5/image-to-video-spicy",image:r,prompt:e,last_image:c||void 0,resolution:m,duration:u,generate_audio:f}):E.mutate({modelType:"seedance-2.5/image-to-video",prompt:e,image:r,last_image:c||void 0,resolution:m,duration:u,generate_audio:f})}},[P,a,e,r,c,m,u,f,A,E]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Start & End Frame"}),(0,t.jsx)(h.BT,{children:"Animate a start frame, optionally guided by an end frame"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Start Frame"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the start frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:S?d:void 0,onUploadingChange:b})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"End Frame"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the end frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:S?o:void 0,onUploadingChange:w})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground -mt-3",children:"The output canvas follows the start frame's aspect ratio."}),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the motion, scene and the soundtrack you want..."}),(0,t.jsx)(tm,{value:m,onChange:x,options:tt}),(0,t.jsx)(th,{value:u,onChange:g}),(0,t.jsx)(tp,{checked:f,onChange:v,note:"Native audio is synchronized with the video in a single pass."}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(tf.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Spicy Prompt Enhancer"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Experimental"})]}),(0,t.jsx)(F,{checked:a,onCheckedChange:l})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:k,disabled:N||y||!e.trim(),credits:R,isPending:E.isPending}),(0,t.jsx)(eZ,{cost:R,costDescription:"".concat(ti[m],"/s \xd7 ").concat(u,"s at ").concat(m," = ").concat(R," credits")})]})]})}function tN(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)([]),[c,o]=(0,i.useState)([]),[m,x]=(0,i.useState)([]),[u,g]=(0,i.useState)("720p"),[f,v]=(0,i.useState)(!0),[N,b]=(0,i.useState)(!1),[y,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),{data:P,status:A}=(0,X.wV)(),{requireAuth:E,setError:R}=en(),F=ed(j.F.seedance25.create);(0,i.useEffect)(()=>{"unauthenticated"===A&&s("Turn the scene into a snowy winter evening. Keep the people and their movements, add falling snow, frosted windows and warm lamplight.")},[A]);let{duration:k,error:I}=tg(r),U=a&&k>0?to(k,4,30):0,V=Math.ceil(tn[u]*U*2),T=(0,i.useCallback)(()=>
1{if(E()){if(!e.trim())return void R("Please enter a prompt describing the edit");if(!a)return void R("Please upload a video to edit");if(I)return void R(I);F.mutate({modelType:"seedance-2.5/video-edit",prompt:e,video:a,reference_images:c.length>0?c:void 0,reference_audios:m.length>0?m:void 0,resolution:u,generate_audio:f})}},[E,e,a,I,c,m,u,f,R,F]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sj.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Edit"}),(0,t.jsx)(h.BT,{children:"Rewrite lighting, style, weather or elements while keeping subjects and motion"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Input Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload the video to edit",supportedFormats:"MP4, MOV, MKV",onFilesChange:d,onUrlChange:P?l:void 0,onUploadingChange:b}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Videos longer than ",30,"s are trimmed; shorter than"," ",4,"s are padded. The output keeps the input's length",k>0&&" â detected ".concat(k.toFixed(1),"s"),"."]}),I&&r.length>0&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:I})]}),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the edit â e.g. change the weather, restyle the scene, swap an element..."}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),c.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[c.length," of ",30]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload up to ".concat(30," reference images"),supportedFormats:"JPEG, PNG, WEBP",maxFiles:30,onUrlsChange:P?o:void 0,onUploadingChange:w}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Guide subject identity or target style for the edit."})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(sc.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Audio"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),m.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[m.length," of ",10]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload up to ".concat(10," audio clips"),supportedFormats:"MP3, WAV supported",maxFiles:10,onUrlsChange:P?x:void 0,onUploadingChange:C}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Guide the audio generated for the edited output."})]})]}),(0,t.jsx)(tm,{value:u,onChange:g,options:tt}),(0,t.jsx)(tp,{checked:f,onChange:v,note:"Off preserves the input video's original audio track on the output."}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:T,disabled:N||y||S||!e.trim(),credits:V,isPending:F.isPending}),(0,t.jsx)(eZ,{cost:V,costDescription:U>0?"".concat(tn[u],"/s \xd7 ").concat(U.toFixed(1),"s input \xd7 2 (input + output) = ").concat(V," credits"):"".concat(tn[u],"/s on input + output seconds â upload a video for the estimate")})]})]})}function tb(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)([]),[d,c]=(0,i.useState)("720p"),[o,m]=(0,i.useState)(5),[x,u]=(0,i.useState)(!0),[g,f]=(0,i.useState)(!1),{data:v,status:N}=(0,X.wV)(),{requireAuth:b,setError:y}=en(),w=ed(j.F.seedance25.create);(0,i.useEffect)(()=>{"unauthenticated"===N&&s("The chase continues onto the rooftop: she vaults the gap between buildings as the drone swings around for a
1wide reveal of the city at sunset. Driving percussion builds to a horn stab.")},[N]);let{duration:S,error:C}=tg(n),P=!!a,A=P&&S>0?to(S,2,30):0,E=Math.ceil(tn[d]*(A+(P?o:0))),R=(0,i.useCallback)(()=>{if(b()){if(!e.trim())return void y("Please enter a prompt describing the continuation");if(!a)return void y("Please upload a video to extend");if(C)return void y(C);w.mutate({modelType:"seedance-2.5/video-extend",prompt:e,video:a,resolution:d,duration:o,generate_audio:x})}},[b,e,a,C,d,o,x,y,w]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(ta.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Extend"}),(0,t.jsx)(h.BT,{children:"Continue a video seamlessly from its ending"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Input Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload the video to extend",supportedFormats:"MP4, MOV, MKV",onFilesChange:r,onUrlChange:v?l:void 0,onUploadingChange:f}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["The last ",30,"s are used as context and count toward the cost",S>0&&" â detected ".concat(S.toFixed(1),"s"),"."]}),C&&n.length>0&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:C})]}),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe how the video should continue â action, camera, mood, sound..."}),(0,t.jsx)(tm,{value:d,onChange:c,options:tt}),(0,t.jsx)(th,{value:o,onChange:m,label:"New Segment Duration"}),(0,t.jsx)(tp,{checked:x,onChange:u,note:"Native audio is synchronized with the new segment."}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:R,disabled:g||!e.trim(),credits:E,isPending:w.isPending}),(0,t.jsx)(eZ,{cost:E,costDescription:A>0?"".concat(tn[d],"/s \xd7 (").concat(A.toFixed(1),"s context + ").concat(o,"s new) = ").concat(E," credits"):"".concat(tn[d],"/s on context + new seconds â upload a video for the estimate")})]})]})}let ty=eP.LD["seedance-2.5"],tw=["text-to-video","image-to-video","video-edit","video-extend"];var tS=a(99108);function tC(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)([]),[r,d]=(0,i.useState)([]),[c,o]=(0,i.useState)([]),[m,x]=(0,i.useState)([]),[u,g]=(0,i.useState)("720p"),[f,v]=(0,i.useState)("16:9"),[N,b]=(0,i.useState)(5),[y,w]=(0,i.useState)(!0),[S,C]=(0,i.useState)(!1),[P,A]=(0,i.useState)(!1),[E,R]=(0,i.useState)(!1),{data:F,status:k}=(0,X.wV)(),{requireAuth:I,setError:U}=en(),V=ed(j.F.seedance25Turbo.create);(0,i.useEffect)(()=>{"unauthenticated"===k&&s("A parkour runner races across sunlit rooftops, the camera tracking alongside then swinging overhead as she leaps between buildings. Energetic drum-and-bass with footfalls and wind.")},[k]);let T=r.length>0,{duration:B,error:M}=tg(m),G=B>30,D=T?td[u]:tr[u],O=D*N,W=(0,i.useCallback)(()=>{if(I()){if(!e.trim())return void U("Please enter a prompt");if(T&&(M||G))return void U(M||"Reference videos are too long. Maximum total reference video length is ".concat(30," seconds."));
1V.mutate({modelType:"seedance-2.5-turbo/text-to-video",prompt:e,reference_images:a.length>0?a:void 0,reference_videos:r.length>0?r:void 0,reference_audios:c.length>0?c:void 0,aspect_ratio:f,resolution:u,duration:N,generate_audio:y})}},[I,e,a,r,c,T,M,G,f,u,N,y,U,V]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Generate Video"}),(0,t.jsx)(h.BT,{children:"Faster, cheaper 720P/1080P generation with native audio"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the scene, action, camera, lighting and soundtrack. Cite references as @image1, @video1, @audio1..."}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),a.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[a.length," of ",30]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload up to ".concat(30," reference images"),supportedFormats:"JPEG, PNG, WEBP",maxFiles:30,onUrlsChange:F?l:void 0,onUploadingChange:C}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Guide style, characters or composition. No extra charge."})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(eX.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Videos"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),r.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[r.length," of ",10]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload up to ".concat(10," reference videos (").concat(30,"s total)"),supportedFormats:"MP4, MOV, MKV",maxFiles:10,onFilesChange:x,onUrlsChange:F?d:void 0,onUploadingChange:A}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Guide motion, pacing or camera behavior. Raises the rate to"," ",td[u]," credits/s of output",B>0&&T&&" â ".concat(B.toFixed(1),"s of ").concat(30,"s used"),"."]}),(M||G)&&m.length>0&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:M||"Reference videos are too long. Maximum total reference video length is ".concat(30," seconds.")})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(sc.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Audio"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),c.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[c.length," of ",10]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload up to ".concat(10," audio clips (30s total)"),supportedFormats:"MP3, WAV supported",maxFiles:10,onUrlsChange:F?o:void 0,onUploadingChange:R}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Guide soundtrack, ambience or audio style. No extra charge."})]})]}),(0,t.jsx)(tm,{value:u,onChange:g,options:tl}),(0,t.jsx)(tu,{value:f,onChange:v}),(0,t.jsx)(th,{value:N,onChange:b}),(0,t.jsx)(tp,{checked:y,onChange:w,note:"Native audio is synchronized with the video in a single pass."}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:W,disabled:S||P||E||!e.trim(),credits:O,isPending:V.isPending}),(0,t.jsx)(eZ,{cost:O,costDescription:"".concat(D,"/s \xd7 ").concat(N,"s at ").concat(u).
1concat(T?" (with video refs)":""," = ").concat(O," credits")})]})]})}function tP(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(null),[c,o]=(0,i.useState)("720p"),[m,x]=(0,i.useState)(5),[u,g]=(0,i.useState)(!0),[f,v]=(0,i.useState)(!1),[N,b]=(0,i.useState)(!1),{data:y,status:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=ed(j.F.seedance25Turbo.create);(0,i.useEffect)(()=>{"unauthenticated"===w&&s("She turns from the window as rain starts to fall, neon reflections sliding across the glass. Soft synth pads with distant thunder.")},[w]);let A=tr[c]*m,E=(0,i.useCallback)(()=>{if(S()){if(!e.trim())return void C("Please enter a prompt");if(!a)return void C("Please upload a start frame");P.mutate({modelType:"seedance-2.5-turbo/image-to-video",prompt:e,image:a,last_image:r||void 0,resolution:c,duration:m,generate_audio:u})}},[S,e,a,r,c,m,u,C,P]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Start & End Frame"}),(0,t.jsx)(h.BT,{children:"Animate a start frame, optionally guided by an end frame"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Start Frame"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the start frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:y?l:void 0,onUploadingChange:v})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"End Frame"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the end frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:y?d:void 0,onUploadingChange:b})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground -mt-3",children:"The output canvas follows the start frame's aspect ratio."}),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the motion, scene and the soundtrack you want..."}),(0,t.jsx)(tm,{value:c,onChange:o,options:tl}),(0,t.jsx)(th,{value:m,onChange:x}),(0,t.jsx)(tp,{checked:u,onChange:g,note:"Native audio is synchronized with the video in a single pass."}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:E,disabled:f||N||!e.trim(),credits:A,isPending:P.isPending}),(0,t.jsx)(eZ,{cost:A,costDescription:"".concat(tr[c],"/s \xd7 ").concat(m,"s at ").concat(c," = ").concat(A," credits")})]})]})}function tA(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)([]),[c,o]=(0,i.useState)([]),[m,x]=(0,i.useState)([]),[u,g]=(0,i.useState)("720p"),[f,v]=(0,i.useState)(!0),[N,b]=(0,i.useState)(!1),[y,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),{data:P,status:A}=(0,X.wV)(),{requireAuth:E,setError:R}=en(),F=ed(j.F.seedance25Turbo.create);(0,i.useEffect)(()=>{"unauthenticated"===A&&s("Restyle the scene as golden-hour autumn: warm low sun, drifting leaves, long shadows. Keep the people and their movements unchanged.")},[A]);let{duration:k,error:I}=tg(r),U=a&&k>0?to(k,4,30):0,V=Math.ceil(tc[u]*U*2),T=(0,i.useCallback)(()=>
1{if(E()){if(!e.trim())return void R("Please enter a prompt describing the edit");if(!a)return void R("Please upload a video to edit");if(I)return void R(I);F.mutate({modelType:"seedance-2.5-turbo/video-edit",prompt:e,video:a,reference_images:c.length>0?c:void 0,reference_audios:m.length>0?m:void 0,resolution:u,generate_audio:f})}},[E,e,a,I,c,m,u,f,R,F]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sj.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Edit"}),(0,t.jsx)(h.BT,{children:"Turbo-tier editing â rewrite style or elements while keeping motion"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Input Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload the video to edit",supportedFormats:"MP4, MOV, MKV",onFilesChange:d,onUrlChange:P?l:void 0,onUploadingChange:b}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Videos longer than ",30,"s are trimmed. The output keeps the input's length",k>0&&" â detected ".concat(k.toFixed(1),"s"),"."]}),I&&r.length>0&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:I})]}),(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the edit â e.g. change the weather, restyle the scene, swap an element..."}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),c.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[c.length," of ",30]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload up to ".concat(30," reference images"),supportedFormats:"JPEG, PNG, WEBP",maxFiles:30,onUrlsChange:P?o:void 0,onUploadingChange:w}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Guide subject identity or target style for the edit."})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(sc.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Audio"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),m.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[m.length," of ",10]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload up to ".concat(10," audio clips"),supportedFormats:"MP3, WAV supported",maxFiles:10,onUrlsChange:P?x:void 0,onUploadingChange:C}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Guide the audio generated for the edited output."})]})]}),(0,t.jsx)(tm,{value:u,onChange:g,options:tl}),(0,t.jsx)(tp,{checked:f,onChange:v,note:"Off preserves the input video's original audio track on the output."}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:T,disabled:N||y||S||!e.trim(),credits:V,isPending:F.isPending}),(0,t.jsx)(eZ,{cost:V,costDescription:U>0?"".concat(tc[u],"/s \xd7 ").concat(U.toFixed(1),"s input \xd7 2 (input + output) = ").concat(V," credits"):"".concat(tc[u],"/s on input + output seconds â upload a video for the estimate")})]})]})}let tE=eP.LD["seedance-2.5-turbo"],tR=["text-to-video","image-to-vi
1deo","video-edit"],tF={"480p":3,"720p":5};function tk(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("2:3"),[n,r]=(0,i.useState)("normal"),[d,c]=(0,i.useState)(6),[o,m]=(0,i.useState)("480p"),x=Math.ceil(tF[o]*d),{status:u}=(0,X.wV)(),{requireAuth:p,setError:g}=en(),f=ed(j.F.grokImagine.createT2V);(0,i.useEffect)(()=>{"unauthenticated"===u&&s("A couple of doors open to the right one by one randomly and stay open, to show the inside, each is either a living room, or a kitchen, or a bedroom or an office, with little people living inside.")},[u]);let v=(0,i.useCallback)(()=>{if(p()){if(!e.trim())return void g("Please enter a prompt");f.mutate({prompt:e,aspect_ratio:a,mode:n,duration:d,resolution:o})}},[e,a,n,d,o,p,g,f]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos from text prompts with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>{("2:3"===e||"3:2"===e||"1:1"===e||"9:16"===e||"16:9"===e)&&l(e)},className:"w-full grid grid-cols-5 gap-2",children:[(0,t.jsx)(eG,{value:"2:3","aria-label":"2:3",className:"flex-1",children:"2:3"}),(0,t.jsx)(eG,{value:"3:2","aria-label":"3:2",className:"flex-1",children:"3:2"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1",className:"flex-1",children:"1:1"}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16",className:"flex-1",children:"9:16"}),(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9",className:"flex-1",children:"16:9"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Choose video dimensions"})]}),{}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium",children:["Duration: ",d,"s"]}),(0,t.jsx)(sm.A,{value:[d],onValueChange:e=>{let[s]=e;return c(s)},min:6,max:30,step:1,className:"w-full"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Range: ",6,"-",30," seconds"]})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>{("480p"===e||"720p"===e)&&m(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p",className:"flex-1",children:"720p"})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Generation Mode"}),(0,t.jsxs)(eM,{type:"single",value:n,onValueChange:e=>{("fun"===e||"normal"===e||"spicy"===e)&&r(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"fun","aria-label":"Fun mode",className:"flex-1",children:"Fun"}),(0,t.jsx)(eG,{value:"normal","aria-label":"Normal mode",className:"flex-1",children:"Normal"}),(0,t.jsx)(eG,{value:"spicy","aria-label":"Spicy mode",className:"flex-1",children:"Spicy"})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["fun"===n&&"Playful and lighthearted generation","normal"===n&&"Balanced and standard generation","spicy"===n&&"Bold and dynamic generation"]})]}),{}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:v,disabled:!e.trim(),credits:x,isPending:f.isPending}),(0,t.jsx)(eZ,{cost:x,costDescription:"".concat(x," credits (").concat(d,"s at ").concat(o,")")})]})]})}let tI={"480p":3,"720p":5};function tU(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("normal"),[m,x]=(0,i.useState)(6),[u,g]=(0,i.useState)("480p"),f=Math.ceil(tI[u]*m),{data:v,status:N}=(0,X.wV)(),{requireAuth:b,setError:y}=en(),w=ed(j.F.grokImagine.createI2V);(0,i.useEffect)(()=>{"unauthenticated"===N&&d('POV hand comes into frame handing the girl a cup of take away coffee, the girl steps out of the screen looking tired, then takes it and she says happily: "thanks! Back to work" she exits the frame and walks right to a different part of the office.')},[N]);let S=(0,i.useCallback)(()=>
1{if(b()){if(!e)return void y("Please upload an image for image-to-video generation");w.mutate({image:e,prompt:r||void 0,mode:c,duration:m,resolution:u})}},[e,r,c,m,u,b,y,w]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate your images with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Input Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Click to upload source image",supportedFormats:"PNG, JPG, WEBP supported (max 10MB)",onUrlChange:v?s:void 0,onUploadingChange:l})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want the image to animate... (optional)",required:!1}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium",children:["Duration: ",m,"s"]}),(0,t.jsx)(sm.A,{value:[m],onValueChange:e=>{let[s]=e;return x(s)},min:6,max:30,step:1,className:"w-full"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Range: ",6,"-",30," seconds"]})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>{("480p"===e||"720p"===e)&&g(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p",className:"flex-1",children:"720p"})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Generation Mode"}),(0,t.jsxs)(eM,{type:"single",value:c,onValueChange:e=>{("fun"===e||"normal"===e||"spicy"===e)&&o(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"fun","aria-label":"Fun mode",className:"flex-1",children:"Fun"}),(0,t.jsx)(eG,{value:"normal","aria-label":"Normal mode",className:"flex-1",children:"Normal"}),(0,t.jsx)(eG,{value:"spicy","aria-label":"Spicy mode",className:"flex-1",children:"Spicy"})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["fun"===c&&"Playful and lighthearted animation","normal"===c&&"Balanced and standard animation","spicy"===c&&"Bold and dynamic animation"]})]}),{}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:S,disabled:a,credits:f,isPending:w.isPending}),(0,t.jsx)(eZ,{cost:f,costDescription:"".concat(f," credits (").concat(m,"s at ").concat(u,")")})]})]})}let tV=eP.LD["grok-imagine"],tT=eP.LD["grok-imagine-1.5"],tB={"480p":3,"720p":5},tM={"16:9":"9:16","4:3":"3:4","3:2":"2:3"};function tG(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("auto"),[m,x]=(0,i.useState)("landscape"),[u,g]=(0,i.useState)("480p"),[f,v]=(0,i.useState)(8),N=Math.ceil(tB[u]*f),b="auto"!==c&&"1:1"!==c,{data:y,status:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=ed(j.F.grokImagine15.create);(0,i.useEffect)(()=>{"unauthenticated"===w&&d("She slowly turns toward the camera and smiles, hair gently moving in the wind, cinematic lighting.")},[w]);let A=(0,i.useCallback)(()=>{if(S()){if(!e)return void C("Please upload an image for image-to-video generation");P.mutate({image:e,prompt:r||void 0,aspect_ratio:"auto"===c||"1:1"===c?c:"portrait"===m?tM[c]:c,resolution:u,duration:f})}},[e,r,c,m,u,f,S,C,P]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate your image with Grok Imagine 1.5"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Input Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Click to upload source image",supportedFormats:"PNG, JPG, WEBP supported (max 10MB)",onUrlChange:y?s:void 0,onUploadingChange:l})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want the image to animate... (optional)",required:!1}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:c,onValueChange:e=>{("auto"===e||"1:1"===e||"16:9"===e||"4:3"===e||"3:2"===e)&&o(e)}
1,className:"w-full grid grid-cols-5 gap-2",children:[(0,t.jsx)(eG,{value:"auto","aria-label":"Auto",className:"flex-1",children:"Auto"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1",className:"flex-1",children:"1:1"}),(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"4:3","aria-label":"4:3",className:"flex-1",children:"4:3"}),(0,t.jsx)(eG,{value:"3:2","aria-label":"3:2",className:"flex-1",children:"3:2"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Auto follows the uploaded image's dimensions."})]}),b&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:m,onValueChange:e=>{("landscape"===e||"portrait"===e)&&x(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"landscape","aria-label":"Landscape",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"Landscape"]})}),(0,t.jsx)(eG,{value:"portrait","aria-label":"Portrait",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"Portrait"]})})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>{("480p"===e||"720p"===e)&&g(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p",className:"flex-1",children:"720p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)(eD.J,{className:"text-sm font-medium",children:["Duration: ",f,"s"]}),(0,t.jsx)(sm.A,{value:[f],onValueChange:e=>{let[s]=e;return v(s)},min:1,max:15,step:1,className:"w-full"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Range: ",1,"-",15," seconds"]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:A,disabled:a,credits:N,isPending:P.isPending}),(0,t.jsx)(eZ,{cost:N,costDescription:"".concat(N," credits (").concat(f,"s at ").concat(u,")")})]})]})}let tD={5:60,10:120};function tO(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("5"),[n,r]=(0,i.useState)("16:9"),[d,c]=(0,i.useState)(.5),[o,m]=(0,i.useState)(""),[x,u]=(0,i.useState)(!1),{status:g}=(0,X.wV)(),{requireAuth:f,setError:v}=en(),N=ed(j.F.kling25Turbo.createT2V);(0,i.useEffect)(()=>{"unauthenticated"===g&&s("A majestic lion walking through tall golden grass at sunset, cinematic lighting, 4K quality")},[g]);let b=tD[a],y=(0,i.useCallback)(()=>{if(f()){if(!e.trim())return void v("Please enter a prompt");N.mutate({prompt:e,duration:a,aspect_ratio:n,cfg_scale:d,negative_prompt:o.trim()||void 0})}},[e,a,n,d,o,f,v,N]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos from text prompts with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>{("5"===e||"10"===e)&&l(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"10","aria-label":"10 seconds",className:"flex-1",children:"10 seconds"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Longer videos require more credits"})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:n,onValueChange:e=>{("16:9"===e||"9:16"===e||"1:1"===e)&&r(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9 aspect ratio",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16 aspect ratio",className:"flex-1",children:"9:16"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1 aspect ratio",className:"flex-1",children:"1:1"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Choose video dimensions"})]}),{}),(0,t.jsxs)(e9,{open:x,onOpenChange:u,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(x?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"CFG Scale"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(sm.A,{value:[d],onValueChange:e=>c(e[0]),min:0,max:1,step:.1,className:"flex-1"}),(0,t.jsx)("span",{className:"text-sm font-mono text-muted-foreground min-w-[3ch] text-right",children:d.toFixed(1)})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Controls the strength of generation. Higher values follow prompt more strictly. Default: 0.5"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(sf.T,{placeholder:"blur, distort, and low quality",value:o,onChange:e=>m(e.target.value),maxLength:2500,rows:3}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:'Specify elements to exclude from generation. Default: "blur, distort, and low quality"'})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:y,disabled:!e.trim(),credits:b,isPending:N.isPending}),(0,t.jsx)(eZ,{cost:b,costDescription:"".concat(b," credits per generation (").concat(a,"s)")})]})]})}let tW={5:60,10:120};function tJ(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(!1),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(""),[u,g]=(0,i.useState)("5"),[f,v]=(0,i.useState)(.5),[N,b]=(0,i.useState)(""),[y,w]=(0,i.useState)(!1),{data:S,status:C}=(0,X.wV)(),{requireAuth:P,setError:A}=en(),E=ed(j.F.kling25Turbo.createI2V);(0,i.useEffect)(()=>{"unauthenticated"===C&&x("The image comes to life with smooth motion and cinematic quality")},[C]);let R=tW[u],F=(0,i.useCallback)(()=>{if(P()){if(!e)return void A("Please upload an image");if(!m.trim())return void A("Please enter a prompt");E.mutate({prompt:m,image:e,tail_image:a||void 0,duration:u,cfg_scale:f,negative_prompt:N.trim()||void 0})}},[e,a,m,u,f,N,P,A,E]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate your images with AI motion"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Frame Images"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground mb-2 block",children:"First Frame (Required)"}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Start frame",supportedFormats:"PNG, JPG, WEBP",onUrlChange:S?s:void 0,onUploadingChange:d,fullWidthPreview:!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground mb-2 block",children:"Tail Frame (Optional)"}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"End frame",supportedFormats:"PNG, JPG, WEBP",onUrlChange:S?l:void 0,onUploadingChange:o,fullWidthPreview:!0})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"First frame is required. Optionally add a tail frame to control the video's ending state."})]}),(0,t.jsx)(ep.PromptInput,{value:m,onChange:x,placeholder:"Describe how you want the image to move..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>{("5"===e||"10"===e)&&g(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"10","aria-label":"10 seconds",className:"flex-1",children:"10 seconds"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Longer videos require more credits"})]}),{}),(0,t.jsxs)(e9,{open:y,onOpenChange:w,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(y?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"CFG Scale"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(sm.A,{value:[f],onValueChange:e=>v(e[0]),min:0,max:1,step:.1,className:"flex-1"}),(0,t.jsx)("span",{className:"text-sm font-mono text-muted-foreground min-w-[3ch] text-right",children:f.toFixed(1)})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Controls the strength of generation. Higher values follow prompt more strictly. Default: 0.5"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(sf.T,{placeholder:"blur, distort, and low quality",value:N,onChange:e=>b(e.target.value),maxLength:2496,rows:3}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:'Specify elements to exclude from generation. Default: "blur, distort, and low quality"'})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:F,disabled:r||c||!m.trim(),credits:R,isPending:E.isPending}),(0,t.jsx)(eZ,{cost:R,costDescription:"".concat(R," credits per generation (").concat(u,"s)")})]})]})}let tZ=eP.LD["kling-2.5-turbo"];var t_=a(71236);let tL={5:{base:105,withAudio:210},10:{base:210,withAudio:420}};function tq(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(5),[n,r]=(0,i.useState)("16:9"),[d,c]=(0,i.useState)(!1),[o,m]=(0,i.useState)(.5),[x,u]=(0,i.useState)(""),[g,f]=(0,i.useState)(!1),{data:v,status:N}=(0,X.wV)(),{requireAuth:b,setError:y}=en(),w=ed(j.F.kling26Pro.create);(0,i.useEffect)(()=>{"unauthenticated"===N&&s("A cinematic shot of a city skyline at golden hour, glowing reflections on the river, smooth drone camera movement, ultra-detailed")},[N]);let S=d?tL[a].withAudio:tL[a].base,C=(0,i.useCallback)(()=>{if(b()){if(!e.trim())return void y("Please enter a prompt");
1w.mutate({modelType:"kling26-pro/text-to-video",prompt:e.trim(),duration:a,aspect_ratio:n,sound:d,cfg_scale:o,negative_prompt:x.trim()||void 0})}},[e,a,n,d,o,x,w]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos from text prompts with optional audio"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:a.toString(),onValueChange:e=>{("5"===e||"10"===e)&&l(Number(e))},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"10","aria-label":"10 seconds",className:"flex-1",children:"10 seconds"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Longer videos require more credits"})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:n,onValueChange:e=>{("16:9"===e||"9:16"===e||"1:1"===e)&&r(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9 aspect ratio",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16 aspect ratio",className:"flex-1",children:"9:16"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1 aspect ratio",className:"flex-1",children:"1:1"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Choose video dimensions"})]}),{}),(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t_.A,{className:"w-4 h-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{htmlFor:"kling26-t2v-audio",children:"Generate Audio"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Audio generation doubles credit cost"})]}),(0,t.jsx)(F,{id:"kling26-t2v-audio",checked:d,onCheckedChange:c})]}),(0,t.jsxs)(e9,{open:g,onOpenChange:f,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(g?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"CFG Scale"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(sm.A,{value:[o],onValueChange:e=>{var s;return m(null!=(s=e[0])?s:.5)},min:0,max:1,step:.1,className:"flex-1"}),(0,t.jsx)("span",{className:"text-sm font-mono text-muted-foreground min-w-[3ch] text-right",children:o.toFixed(1)})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Controls the strength of generation. Higher values follow prompt more strictly."})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(sf.T,{placeholder:"blur, distort, and low quality",value:x,onChange:e=>u(e.target.value),maxLength:2500,rows:3}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation."})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:C,disabled:!e.trim(),credits:S,isPending:w.isPending}),(0,t.jsx)(eZ,{cost:S,costDescription:"".concat(S," credits per generation (").concat(a,"s").concat(d?", with audio":"",")")})]})]})}let tK={5:{base:105,withAudio:210},10:{base:210,withAudio:420}};function tz(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(!1),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(""),[u,g]=(0,i.useState)(5),[f,v]=(0,i.useState)(!1),[N,b]=(0,i.useState)(.5),[y,w]=(0,i.useState)(""),[S,C]=(0,i.useState)(!1),{data:P,status:A}=(0,X.wV)(),{requireAuth:E,setError:R}=en(),k=ed(j.F.kling26Pro.create);(0,i.useEffect)(()=>{"unauthenticated"===A&&x("The image comes to life with smooth motion and cinematic lighting, gentle camera movement, high detail")},[A]);let I=f?tK[u].withAudio:tK[u].base,U=(0,i.useCallback)(()=>
1{if(E()){if(!e)return void R("Please upload an image");if(!m.trim())return void R("Please enter a prompt");k.mutate({modelType:"kling26-pro/image-to-video",prompt:m.trim(),image:e,end_image:a||void 0,duration:u,sound:f,cfg_scale:N,negative_prompt:y.trim()||void 0})}},[e,a,m,u,f,N,y,k]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate your images with AI motion and optional audio"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Frame Images"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground mb-2 block",children:"First Frame (Required)"}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Start frame",supportedFormats:"PNG, JPG, WEBP",onUrlChange:P?s:void 0,onUploadingChange:d,fullWidthPreview:!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs text-muted-foreground mb-2 block",children:"End Frame (Optional)"}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"End frame",supportedFormats:"PNG, JPG, WEBP",onUrlChange:P?l:void 0,onUploadingChange:o,fullWidthPreview:!0})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Provide a start frame and an optional end frame to guide motion."})]}),(0,t.jsx)(ep.PromptInput,{value:m,onChange:x,placeholder:"Describe how you want the image to move..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:u.toString(),onValueChange:e=>{("5"===e||"10"===e)&&g(Number(e))},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"10","aria-label":"10 seconds",className:"flex-1",children:"10 seconds"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Longer videos require more credits"})]}),{}),(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t_.A,{className:"w-4 h-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{htmlFor:"kling26-i2v-audio",children:"Generate Audio"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Audio generation doubles credit cost"})]}),(0,t.jsx)(F,{id:"kling26-i2v-audio",checked:f,onCheckedChange:v})]}),(0,t.jsxs)(e9,{open:S,onOpenChange:C,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(S?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"CFG Scale"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(sm.A,{value:[N],onValueChange:e=>{var s;return b(null!=(s=e[0])?s:.5)},min:0,max:1,step:.1,className:"flex-1"}),(0,t.jsx)("span",{className:"text-sm font-mono text-muted-foreground min-w-[3ch] text-right",children:N.toFixed(1)})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Controls the strength of generation. Higher values follow prompt more strictly."})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(sf.T,{placeholder:"blur, distort, and low quality",value:y,onChange:e=>w(e.target.value),maxLength:2500,rows:3}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation."})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:U,disabled:r||c||!m.trim(),credits:I,isPending:k.isPending}),(0,t.jsx)(eZ,{cost:I,costDescription:"".concat(I," credits per generation (").concat(u,"s").concat(f?", with audio":"",")")})]})]})}function tQ(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(null),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),[u,g]=(0,i.useState)(""),[f,v]=(0,i.useState)("image"),[N,b]=(0,i.useState)(!0),[y,w]=(0,i.useState)(""),[S,C]=(0,i.useState)(!1),[P,A]=(0,i.useState)(0),{data:E}=(0,X.wV)(),{requireAuth:R,setError:k}=en(),I=ed(j.F.kling26Pro.createMotionControl);(0,i.useEffect)(()=>{if(!r)return void A(0);let e=document.createElement("video");return e.preload="metadata",e.onloadedmetadata=()=>{let s=e.duration;if(s>120){Q.oR.error("Video too long. Maximum video length is 120 seconds"),d(null),A(0);return}A(s)},e.onerror=()=>{Q.oR.error("Invalid video file. Please upload a valid video"),d(null),A(0)},e.src=URL.createObjectURL(r),()=>{URL.revokeObjectURL(e.src)}},[r]);let U=P>0?Math.ceil(32*Math.max(P,1)):0,V=(0,i.useCallback)(()=>{if(R()){if(!e||!a)return void k("Please upload both character image and motion video");I.mutate({modelType:"kling26-pro/motion-control",image:e,video:a,character_orientation:f,keep_original_sound:N,prompt:u.trim()||void 0,negative_prompt:y.trim()||void 0})}},[e,a,f,N,u,y,I]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sj.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Motion Control"}),(0,t.jsx)(h.BT,{children:"Transfer motion from a reference video onto your character image"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Character Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload character image",supportedFormats:"PNG, JPG, WEBP",onUrlChange:E?s:void 0,onUploadingChange:o,fullWidthPreview:!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Motion Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload motion reference video",supportedFormats:"MP4, MOV",onFirstFileChange:d,onUrlChange:E?l:void 0,onUploadingChange:x,fullWidthPreview:!0}),P>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Video duration: ",Math.round(P),"s ⢠Estimated"]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Character Orientation"}),(0,t.jsxs)(eM,{type:"single",value:f,onValueChange:e=>{("image"===e||"video"===e)&&v(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"image",className:"flex-1",children:"Image"}),(0,t.jsx)(eG,{value:"video",className:"flex-1",children:"Video"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Image: character stays in the image scene. Video: character appears in the video scene."})]}),(0,t.jsx)(ep.PromptInput,{value:u,onChange:g,placeholder:"Optional prompt to guide the motion..."}),(0,t.jsxs)(e9,{open:S,onOpenChange:C,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(S?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsxs)(se,{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Negative Prompt"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(sf.T,{placeholder:"blur, distort, and low quality",value:y,onChange:e=>w(e.target.value),maxLength:2500,rows:3}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Specify elements to exclude from generation."})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(eD.J,{htmlFor:"kling26-motion-sound",children:"Keep Original Sound"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Preserve audio from the motion video"})]}),(0,t.jsx)(F,{id:"kling26-motion-sound",checked:N,onCheckedChange:b})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:V,disabled:c||m,credits:U,isPending:I.isPending}),(0,t.jsx)(eZ,{cost:U,costDescription:P>0?"".concat(U," credits (estimated ").concat(Math.round(P),"s, ").concat(32," credits/s)"):"Upload a motion video to estimate credits"})]})]})}let tH=eP.LD["kling-2.6-pro"],t$=["text-to-video","image-to-video","motion-control"];var tY=a(32565);function tX(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("16:9"),[n,r]=(0,i.useState)(5),{data:d,status:c}=(0,X.wV)(),{requireAuth:o,setError:m}=en(),x=ed(j.F.KlingO1.create),u=Math.ceil(33*n),p=(0,i.useCallback)(()=>{if(o()){if(!e.trim())return void m("Please enter a prompt");
1x.mutate({modelType:"kling-o1/text-to-video",prompt:e,aspect_ratio:a,duration:n})}},[e,a,n,x]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos from text prompts with Kling O1"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>{("16:9"===e||"9:16"===e||"1:1"===e)&&l(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9 aspect ratio",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16 aspect ratio",className:"flex-1",children:"9:16"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1 aspect ratio",className:"flex-1",children:"1:1"})]})]}),{}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(eM,{type:"single",value:n.toString(),onValueChange:e=>{let s=parseInt(e);(5===s||10===s)&&r(s)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"5","aria-label":"5 seconds",className:"flex-1",children:"5 seconds"}),(0,t.jsx)(eG,{value:"10","aria-label":"10 seconds",className:"flex-1",children:"10 seconds"})]})]}),{}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:p,disabled:!e.trim(),credits:u,isPending:x.isPending}),(0,t.jsx)(eZ,{cost:u,costDescription:"".concat(u," credits (").concat(n,"s video)")})]})]})}function t0(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)(null),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),[u,g]=(0,i.useState)(5),{data:f}=(0,X.wV)(),{requireAuth:v,setError:N}=en(),b=ed(j.F.KlingO1.create);(0,i.useEffect)(()=>{r||5===u||10===u||g(u<=7?5:10)},[r]);let y=Math.ceil(33*u),w=(0,i.useCallback)(()=>{if(v()){if(!e.trim())return void N("Please enter a prompt");if(!a)return void N("Please upload a first frame image");b.mutate({modelType:"kling-o1/image-to-video",prompt:e,image:a,last_image:r||void 0,duration:u})}},[e,a,r,u,v,N,b]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Transform static images into dynamic videos"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe how the image should animate..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"First Frame Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame image",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:f?l:void 0,onUploadingChange:o})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Last Frame Image"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the last frame image (optional)",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:f?d:void 0,onUploadingChange:x})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",children:[u,"s"]})]}),(0,t.jsx)(sm.A,{min:r?3:5,max:10,step:r?1:5,value:[u],onValueChange:e=>g(e[0])}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r?"With last frame: 3-10 seconds":"Without last frame: 5 or 10 seconds"})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:w,disabled:c||m||!e.trim(),credits:y,isPending:b.isPending}),(0,t.jsx)(eZ,{cost:y,costDescription:"".concat(y," credits (").concat(u,"s video)")})]})]})}function t1(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)([]),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),[u,g]=(0,i.useState)(!0),[f,v]=(0,i.useState)("16:9"),[N,b]=(0,i.useState)(5),{data:y,status:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=ed(j.F.KlingO1.create),A=Math.ceil(N*(a?50:33)),E=a?50:33,R=(0,i.useCallback)(()=>{if(S()){if(!e.trim())return void C("Please enter a prompt");P.mutate({modelType:"kling-o1/reference-to-video",prompt:e,video:a||void 0,images:r.length>0?r:void 0,keep_original_sound:u,aspect_ratio:f,duration:N})}},[e,a,r,u,f,N,S,C,P]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sj.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Reference to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos using reference materials"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create using the references..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Video"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload a reference video (optional)",supportedFormats:"MP4, MOV, WEBM supported",onUrlChange:y?l:void 0,onUploadingChange:o}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Adding a reference video increases credit usage to 50 credits/s. Without a reference video, this mode uses 33 credits/s."})]}),a&&(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Keep Original Sound"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Preserve audio from the reference video"})]}),(0,t.jsx)(F,{checked:u,onCheckedChange:g})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images (up to 7)",supportedFormats:"PNG, JPG, WEBP supported",maxFiles:7,onUrlsChange:y?d:void 0,onUploadingChange:x})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:f,onValueChange:e=>{("16:9"===e||"9:16"===e||"1:1"===e)&&v(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9 aspect ratio",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16 aspect ratio",className:"flex-1",children:"9:16"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1 aspect ratio",className:"flex-1",children:"1:1"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)(p.E,{variant:"secondary",children:[N,"s"]})]}),(0,t.jsx)(sm.A,{min:3,max:10,step:1,value:[N],onValueChange:e=>b(e[0])}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Select video duration: 3-10 seconds"})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:R,disabled:c||m||!e.trim(),credits:A,isPending:P.isPending}),(0,t.jsx)(eZ,{cost:A,costDescription:"".concat(A," credits (").concat(N,"s video, ").concat(E," credits/s)")})]})]})}function t2(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)(null),[r,d]=(0,i.useState)([]),[c,o]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),[u,g]=(0,i.useState)("standard"),[f,v]=(0,i.useState)(!0),[N,b]=(0,i.useState)("original"),[y,w]=(0,i.useState)(null),[S,C]=(0,i.useState)(0),{data:P,status:A}=(0,X.wV)(),{requireAuth:E,setError:R}=en(),k=ed(j.F.KlingO1.create),I=(0,i.useCallback)(e=>{if(R(null),w(null),C(0),!e)return;let s=document.createElement("video");s.preload="metadata",s.onloadedmetadata=()=>{URL.revokeObjectURL(s.src);let e=s.duration;w(e),C(Math.ceil(("standard"===u?Math.max(3,Math.min(10,e)):Math.max(6,Math.min(20,e)))*("standard"===u?50:25)))},s.onerror=()=>{URL.revokeObjectURL(s.src),Q.oR.error("Invalid video file. Please upload a valid video"),w(null),C(0)},s.src=URL.createObjectURL(e)},[u]);(0,i.useEffect)(()=>{if(null===y)return void C(0);C(Math.ceil(("standard"===u?Math.max(3,Math.min(10,y)):Math.max(6,Math.min(20,y)))*("standard"===u?50:25)))},[u,y]);let U=(0,i.useCallback)(()=>
1{if(E()){if(!e.trim())return void R("Please enter a prompt");if(!a)return void R("Please upload a source video");"standard"===u?k.mutate({modelType:"kling-o1/video-edit",prompt:e,video:a,images:r.length>0?r:void 0,keep_original_sound:f}):k.mutate({modelType:"kling-o1/video-edit-fast",prompt:e,video:a,images:r.length>0?r:void 0,keep_original_sound:f,aspect_ratio:"original"===N?void 0:N})}},[e,a,r,u,f,N,E,R,k]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(tY.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Edit"}),(0,t.jsx)(h.BT,{children:"Edit videos using natural language instructions"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe how you want to edit the video..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(tY.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Source Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload the video you want to edit",supportedFormats:"MP4, MOV, WEBM supported",onFirstFileChange:I,onUrlChange:P?l:void 0,onUploadingChange:o}),null!==y&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Video duration: ",y.toFixed(2),"s"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images (up to 4)",supportedFormats:"PNG, JPG, WEBP supported",maxFiles:4,onUrlsChange:P?d:void 0,onUploadingChange:x})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Edit Mode"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>{("standard"===e||"fast"===e)&&g(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"standard","aria-label":"Standard mode",className:"flex-1",children:"Standard (3-10s)"}),(0,t.jsx)(eG,{value:"fast","aria-label":"Fast mode",className:"flex-1",children:"Fast (6-20s)"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"standard"===u?"Standard mode: 50 credits/s, duration clamped to 3-10s":"Fast mode: 25 credits/s, duration clamped to 6-20s"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Keep Original Sound"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Preserve audio from the source video"})]}),(0,t.jsx)(F,{checked:f,onCheckedChange:v})]}),"fast"===u&&(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsxs)(eM,{type:"single",value:N,onValueChange:e=>{("original"===e||"16:9"===e||"9:16"===e||"1:1"===e)&&b(e)},className:"w-full grid grid-cols-4 gap-2",children:[(0,t.jsx)(eG,{value:"original","aria-label":"Keep original aspect ratio",className:"flex-1",children:"Original"}),(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9 aspect ratio",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16 aspect ratio",className:"flex-1",children:"9:16"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1 aspect ratio",className:"flex-1",children:"1:1"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:'Select "Original" to keep the source video\'s aspect ratio'})]}),{}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:U,disabled:c||m||!e.trim(),credits:S,isPending:k.isPending}),(0,t.jsx)(eZ,{cost:S,costDescription:null!==y?"".concat(S," credits (").concat(u," mode, ").concat(y.toFixed(1),"s video)"):"Upload video to see cost"})]})]})}let t4=eP.LD["kling-o1"];var t3=a(12094);let t5={"720p":27,"1080p":34};function t6(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)([]),[r,d]=(0,i.useState)("720p"),[c,o]=(0,i.useState)("16:9"),[x,u]=(0,i.useState)(5),[g,f]=(0,i.useState)(!1),{data:v,status:N}=(0,X.wV)(),{requireAuth:b,setError:y}=en(),w=ed(j.F.klingV3Turbo.create);(0,i.useEffect)(()=>{"unauthenticated"===N&&s("A cinematic drone shot glides over a neon-lit city at dusk, revealing towering skyscrapers and glowing streets below, with warm orange and blue light reflecting off glass surfaces.")},[N]);let S=a.length>0,C=t5[r],P=Math.ceil(C*x),A=(0,i.useCallback)(()=>{if(!b())return;if(!e.trim())return void y("Please enter a prompt.");let s={prompt:e.trim(),duration:x,resolution:r,aspect_ratio:c};a.length>0&&(s.image_urls=a),w.mutate(s)},[b,e,a,r,c,x,y,w]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Kling V3 Turbo"}),(0,t.jsx)(h.BT,{children:"Generate videos from text, or upload an image to animate it"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the scene, action, camera movement, and mood..."}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Reference Image"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),S&&(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:"Image-to-Video"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload an image to animate it (image-to-video). Leave empty for text-to-video.",supportedFormats:"JPEG, PNG",maxFiles:4,onUrlsChange:v?l:void 0,onUploadingChange:f})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:r,onValueChange:e=>{e&&d(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p",className:"flex-1",children:"1080p"})]})]}),!S&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(sv.l6,{value:c,onValueChange:e=>o(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[x,"s"]})]}),(0,t.jsx)(sm.A,{min:3,max:15,step:1,value:[x],onValueChange:e=>{let[s]=e;return u(s)}}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"3s"}),(0,t.jsx)("span",{children:"15s"})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:A,disabled:g,credits:P,isPending:w.isPending}),(0,t.jsx)(eZ,{cost:P,costDescription:"".concat(P," credits (").concat(C,"/s \xd7 ").concat(x,"s)")})]})]})}let t8=eP.LD["kling-v3-turbo"],t9=e=>"4K"===e?24:12;function t7(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("1:1"),[o,x]=(0,i.useState)("1K"),[u,g]=(0,i.useState)("png"),{data:f,status:v}=(0,X.wV)(),{requireAuth:N,setError:b}=en(),y=ed(j.F.gemini3ProImage.create);(0,i.useEffect)(()=>{"unauthenticated"===v&&r("A serene 16:9 landscape of a sunset over mountains, vivid colors, HD quality, professional photography")},[v]);let w=(0,i.useCallback)(()=>
1{if(N()){if(!n.trim())return void b("Please enter a prompt");y.mutate({prompt:n.trim(),image_input:e.length>0?e:void 0,aspect_ratio:d,resolution:o,output_format:u})}},[e,n,d,o,u,N,b,y]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Nano Banana Pro"}),(0,t.jsx)(h.BT,{children:"Advanced AI image generation with flexible aspect ratios"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)("div",{children:(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the image you want to create or how to edit/combine reference images..."})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional ⢠Max 8"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images (optional, up to 8)",supportedFormats:"PNG, JPG, WEBP",maxFiles:8,onUrlsChange:f?s:void 0,onUploadingChange:l})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{htmlFor:"aspect-ratio",children:"Aspect Ratio"}),(0,t.jsxs)(sv.l6,{value:d,onValueChange:e=>c(e),children:[(0,t.jsx)(sv.bq,{id:"aspect-ratio",children:(0,t.jsx)(sv.yv,{})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Auto"}),(0,t.jsx)(sv.eb,{value:"auto",children:"Auto"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait"}),(0,t.jsx)(sv.eb,{value:"2:3",children:"2:3"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4"}),(0,t.jsx)(sv.eb,{value:"4:5",children:"4:5"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape"}),(0,t.jsx)(sv.eb,{value:"3:2",children:"3:2"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3"}),(0,t.jsx)(sv.eb,{value:"5:4",children:"5:4"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9"}),(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"})]})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>e&&x(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"1K",className:"flex-1",children:"1K"}),(0,t.jsx)(eG,{value:"2K",className:"flex-1",children:"2K"}),(0,t.jsx)(eG,{value:"4K",className:"flex-1",children:"4K"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{children:"Output Format"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>e&&g(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"png",className:"flex-1",children:"PNG"}),(0,t.jsx)(eG,{value:"jpg",className:"flex-1",children:"JPG"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:w,disabled:a||!n.trim(),credits:t9(o),isPending:y.isPending}),(0,t.jsx)(eZ,{cost:t9(o),costDescription:"".concat(t9(o)," credits (").concat(o,")")})]})]})}let le=eP.LD["gemini3-pro-image"],ls={"1K":8,"2K":12,"4K":18};function la(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("1:1"),[o,x]=(0,i.useState)("1K"),[u,g]=(0,i.useState)("jpg"),[f,v]=(0,i.useState)(!1),{data:N,status:b}=(0,X.wV)(),{requireAuth:y,setError:w}=en(),S=ed(j.F.nanoBanana2.create);(0,i.useEffect)(()=>{"unauthenticated"===b&&r("A vibrant cityscape at night with neon lights reflecting on wet streets, ultra-detailed, 4K photography")},[b]);let C=(0,i.useCallback)(()=>{if(y()){if(!n.trim())return void w("Please enter a prompt");S.mutate({prompt:n.trim(),image_input:e.length>0?e:void 0,aspect_ratio:d,resolution:o,output_format:u,google_search:f})}},[e,n,d,o,u,f,y,w,S]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Nano Banana 2"}),(0,t.jsx)(h.BT,{children:"Fast & high quality, and multilingual support"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(eL,{modelName:"Nano Banana 2"}),(0,t.jsx)("div",{children:(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the image you want to generate, or how to transform your reference images..."})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional ⢠Max 14"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images (optional, up to 14)",supportedFormats:"PNG, JPG, WEBP",maxFiles:14,onUrlsChange:N?s:void 0,onUploadingChange:l})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{htmlFor:"aspect-ratio",children:"Aspect Ratio"}),(0,t.jsxs)(sv.l6,{value:d,onValueChange:e=>c(e),children:[(0,t.jsx)(sv.bq,{id:"aspect-ratio",children:(0,t.jsx)(sv.yv,{})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Auto"}),(0,t.jsx)(sv.eb,{value:"auto",children:"Auto"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait"}),(0,t.jsx)(sv.eb,{value:"2:3",children:"2:3"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4"}),(0,t.jsx)(sv.eb,{value:"4:5",children:"4:5"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16"}),(0,t.jsx)(sv.eb,{value:"1:4",children:"1:4"}),(0,t.jsx)(sv.eb,{value:"1:8",children:"1:8"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape"}),(0,t.jsx)(sv.eb,{value:"3:2",children:"3:2"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3"}),(0,t.jsx)(sv.eb,{value:"5:4",children:"5:4"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9"}),(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"4:1",children:"4:1"}),(0,t.jsx)(sv.eb,{value:"8:1",children:"8:1"})]})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>e&&x(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"1K",className:"flex-1",children:"1K"}),(0,t.jsx)(eG,{value:"2K",className:"flex-1",children:"2K"}),(0,t.jsx)(eG,{value:"4K",className:"flex-1",children:"4K"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{children:"Output Format"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>e&&g(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"jpg",className:"flex-1",children:"JPG"}),(0,t.jsx)(eG,{value:"png",className:"flex-1",children:"PNG"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(eD.J,{htmlFor:"google-search",children:"Google Search Grounding"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Use real-time web info to enhance generation"})]}),(0,t.jsx)(F,{id:"google-search",checked:f,onCheckedChange:v})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:C,disabled:a||!n.trim(),credits:ls[o],isPending:S.isPending}),(0,t.jsx)(eZ,{cost:ls[o],costDescription:"".concat(ls[o]," credits (").concat(o,")")})]})]})}let lt=eP.LD["nano-banana-2"],ll={low:{"1024*1024":3,"1024*1536":4,"1536*1024":4}
1,medium:{"1024*1024":10,"1024*1536":15,"1536*1024":15},high:{"1024*1024":40,"1024*1536":60,"1536*1024":60}};function li(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("1024*1024"),[o,x]=(0,i.useState)("low"),[u,g]=(0,i.useState)("jpeg"),{data:f,status:v}=(0,X.wV)(),{requireAuth:N,setError:b}=en(),y=ed(j.F.gptImage15.create);(0,i.useEffect)(()=>{"unauthenticated"===v&&r("A beautiful sunset over the ocean with vibrant orange and purple colors, HD quality, professional photography")},[v]);let w=(0,i.useCallback)(()=>{if(N()){if(!n.trim())return void b("Please enter a prompt");e.length>0?y.mutate({mode:"edit",prompt:n.trim(),images:e,size:d,quality:o,output_format:u}):y.mutate({mode:"text-to-image",prompt:n.trim(),size:d,quality:o,output_format:u})}},[e,n,d,o,u,N,b,y]),S=ll[o][d];return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"GPT Image 1.5"}),(0,t.jsx)(h.BT,{children:"Multimodal image generator and editor"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(eL,{modelName:"GPT Image 1.5"}),(0,t.jsx)("div",{children:(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the image you want to create or how to edit reference images..."})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional ⢠Max 10"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images for editing (optional, up to 10)",supportedFormats:"PNG, JPG, WEBP",maxFiles:10,onUrlsChange:f?s:void 0,onUploadingChange:l})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{children:"Size"}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>e&&c(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"1024*1024",className:"flex-1",children:"1024\xd71024"}),(0,t.jsx)(eG,{value:"1024*1536",className:"flex-1",children:"1024\xd71536"}),(0,t.jsx)(eG,{value:"1536*1024",className:"flex-1",children:"1536\xd71024"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{children:"Quality"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>e&&x(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"low",className:"flex-1",children:"Low"}),(0,t.jsx)(eG,{value:"medium",className:"flex-1",children:"Medium"}),(0,t.jsx)(eG,{value:"high",className:"flex-1",children:"High"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{children:"Output Format"}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>{("jpeg"===e||"png"===e)&&g(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"jpeg",className:"flex-1",children:"JPEG"}),(0,t.jsx)(eG,{value:"png",className:"flex-1",children:"PNG"})]})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:w,disabled:a||!n.trim(),credits:S,isPending:y.isPending}),(0,t.jsx)(eZ,{cost:S,costDescription:"".concat(S," credits (").concat(o," quality, ").concat(d.replace("*","\xd7"),")")})]})]})}let ln=eP.LD["gpt-image-1.5"];var lr=a(11425),ld=a.n(lr);let lc={"1K":5,"2K":8,"4K":12},lo=["5:4","4:5","3:1","1:3","9:21"];function lm(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("auto"),[o,x]=(0,i.useState)("1K"),{data:u,status:g}=(0,X.wV)(),{requireAuth:f,setError:v}=en(),N=ed(j.F.gptImage2.create),b=lo.includes(d),y=b?"".concat(d," aspect ratio only supports 1K"):null,w=(0,i.useCallback)(e=>{c(e),lo.includes(e)&&x("1K")},[]);(0,i.useEffect)(()=>{"unauthenticated"===g&&r("A realistic split-screen TikTok livestream battle poster: Sam Altman and Dario Amodei face off promoting ChatGPT and Claude separately.")},[g]);let S=(0,i.useCallback)(()=>
1{if(f()){if(!n.trim())return void v("Please enter a prompt");N.mutate({prompt:n.trim(),image_input:e.length>0?e:void 0,aspect_ratio:d,resolution:o})}},[e,n,d,o,f,v,N]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"GPT Image 2"}),(0,t.jsx)(h.BT,{children:"OpenAI's next-gen image model with strong prompt adherence"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(eL,{modelName:"GPT Image 2"}),(0,t.jsx)("div",{children:(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the image you want to generate, or how to transform your reference images..."})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:["Optional ⢠Max ",16]})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images (optional, up to ".concat(16,")"),supportedFormats:"PNG, JPG, WEBP",maxFiles:16,onUrlsChange:u?s:void 0,onUploadingChange:l})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{htmlFor:"aspect-ratio",children:"Aspect Ratio"}),(0,t.jsxs)(sv.l6,{value:d,onValueChange:e=>w(e),children:[(0,t.jsx)(sv.bq,{id:"aspect-ratio",children:(0,t.jsx)(sv.yv,{})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Auto"}),(0,t.jsx)(sv.eb,{value:"auto",children:"Auto"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait"}),(0,t.jsx)(sv.eb,{value:"2:3",children:"2:3"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4"}),(0,t.jsx)(sv.eb,{value:"4:5",children:"4:5 (1K only)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16"}),(0,t.jsx)(sv.eb,{value:"1:2",children:"1:2"}),(0,t.jsx)(sv.eb,{value:"9:21",children:"9:21 (1K only)"}),(0,t.jsx)(sv.eb,{value:"1:3",children:"1:3 (1K only)"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape"}),(0,t.jsx)(sv.eb,{value:"3:2",children:"3:2"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3"}),(0,t.jsx)(sv.eb,{value:"5:4",children:"5:4 (1K only)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9"}),(0,t.jsx)(sv.eb,{value:"2:1",children:"2:1"}),(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"3:1",children:"3:1 (1K only)"})]})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{children:"Resolution"}),y&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:y})]}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>e&&x(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"1K",className:"flex-1",children:"1K"}),(0,t.jsx)(eG,{value:"2K",className:"flex-1",disabled:b,children:"2K"}),(0,t.jsx)(eG,{value:"4K",className:"flex-1",disabled:b,children:"4K"})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:S,disabled:a||!n.trim(),credits:lc[o],isPending:N.isPending}),(0,t.jsx)(eZ,{cost:lc[o],costDescription:"".concat(lc[o]," credits (").concat(o,")")})]})]})}let lx=eP.LD["gpt-image-2"],lu=["27:16","16:27","9:8","8:9"];es.z.object({prompt:ea.max(2e4),input_urls:es.z.array(el).max(16).optional(),tier:es.z.enum(["flare","sunburst"]),aspect_ratio:es.z.enum(["auto","1:1","3:2","2:3","4:3","3:4","16:9","9:16","21:9","27:16","16:27","9:8","8:9"]),resolution:es.z.enum
1(["1K","2K","4K"]),background:es.z.enum(["auto","transparent","opaque"])}).superRefine((e,s)=>{lu.includes(e.aspect_ratio)&&"1K"!==e.resolution&&s.addIssue({code:es.z.ZodIssueCode.custom,path:["resolution"],message:"".concat(e.aspect_ratio," aspect ratio only supports 1K.")})}),es.z.object({taskId:es.z.string(),state:es.z.enum(["waiting","generating","success","fail"]),resultJson:es.z.string().nullable(),failCode:es.z.string().nullable(),failMsg:es.z.string().nullable()});let lh={"1K":5,"2K":15,"4K":24};function lp(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("flare"),[o,x]=(0,i.useState)("auto"),[u,g]=(0,i.useState)("1K"),[f,v]=(0,i.useState)("auto"),{data:N,status:b}=(0,X.wV)(),{requireAuth:y,setError:w}=en(),S=ed(j.F.gptImage25.create),C=lu.includes(o),P=C?"".concat(o," aspect ratio only supports 1K"):null,A=(0,i.useCallback)(e=>{x(e),lu.includes(e)&&g("1K")},[]);(0,i.useEffect)(()=>{"unauthenticated"===b&&r("A rain-soaked Tokyo alley at night, neon kanji signs reflected in puddles, a lone figure with a translucent umbrella, cinematic 35mm.")},[b]);let E=(0,i.useCallback)(()=>{if(y()){if(!n.trim())return void w("Please enter a prompt");S.mutate({prompt:n.trim(),input_urls:e.length>0?e:void 0,tier:d,aspect_ratio:o,resolution:u,background:f})}},[e,n,d,o,u,f,y,w,S]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"GPT Image 2.5"}),(0,t.jsx)(h.BT,{children:"OpenAI's latest image model â readable in-image text and consistent subjects"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(eL,{modelName:"GPT Image 2.5"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{children:"Model"}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>e&&c(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"flare",className:"flex-1",children:"Flare"}),(0,t.jsx)(eG,{value:"sunburst",className:"flex-1",children:"Sunburst"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"flare"===d?"Fast everyday generation. Same price as Sunburst.":"Spends longer per image for finer detail and tighter edit control."})]}),(0,t.jsx)("div",{children:(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the image you want to generate, or how to transform your reference images..."})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:["Optional ⢠Max ",16]})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images (optional, up to ".concat(16,")"),supportedFormats:"PNG, JPG, WEBP",maxFiles:16,onUrlsChange:N?s:void 0,onUploadingChange:l})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{htmlFor:"aspect-ratio",children:"Aspect Ratio"}),(0,t.jsxs)(sv.l6,{value:o,onValueChange:e=>A(e),children:[(0,t.jsx)(sv.bq,{id:"aspect-ratio",children:(0,t.jsx)(sv.yv,{})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Auto"}),(0,t.jsx)(sv.eb,{value:"auto",children:"Auto"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait"}),(0,t.jsx)(sv.eb,{value:"2:3",children:"2:3"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16"}),(0,t.jsx)(sv.eb,{value:"8:9",children:"8:9 (1K only)"}),(0,t.jsx)(sv.eb,{value:"16:27",children:"16:27 (1K only)"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape"}),(0,t.jsx)(sv.eb,{value:"3:2",children:"3:2"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9"}),(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"9:8",children:"9:8 (1K only)"}),(0,t.jsx)(sv.eb,{value:"27:16",children:"27:16 (1K only)"})]})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{children:"Resolution"}),P&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:P})]}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>e&&g(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"1K",className:"flex-1",children:"1K"}),(0,t.jsx)(eG,{value:"2K",className:"flex-1",disabled:C,children:"2K"}),(0,t.jsx)(eG,{value:"4K",className:"flex-1",disabled:C,children:"4K"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{children:"Backgroun
1d"}),(0,t.jsxs)(eM,{type:"single",value:f,onValueChange:e=>e&&v(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"auto",className:"flex-1",children:"Auto"}),(0,t.jsx)(eG,{value:"transparent",className:"flex-1",children:"Transparent"}),(0,t.jsx)(eG,{value:"opaque",className:"flex-1",children:"Opaque"})]})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:E,disabled:a||!n.trim(),credits:lh[u],isPending:S.isPending}),(0,t.jsx)(eZ,{cost:lh[u],costDescription:"".concat(lh[u]," credits (").concat(u,")")})]})]})}let lg=eP.LD["gpt-image-2-5"];es.z.object({prompt:ea.max(8e3),image_urls:es.z.array(el).max(6).optional(),aspect_ratio:es.z.enum(["auto","1:1","3:2","2:3","16:9","9:16"])}).superRefine((e,s)=>{var a,t;let l=(null!=(t=null==(a=e.image_urls)?void 0:a.length)?t:0)>0;"auto"!==e.aspect_ratio||l||s.addIssue({code:es.z.ZodIssueCode.custom,path:["aspect_ratio"],message:"Auto aspect ratio requires at least one reference image."})}),es.z.object({taskId:es.z.string(),state:es.z.enum(["waiting","generating","success","fail"]),resultJson:es.z.string().nullable(),failCode:es.z.string().nullable(),failMsg:es.z.string().nullable()});let lj=[["16:9","9:16"],["3:2","2:3"]],lf=lj.map(e=>e[0]),lv=lj.map(e=>e[1]);function lN(e){let{ratio:s}=e,[a,l]=s.split(":").map(Number),i=a/l,n=i>=1?18:Math.max(18*i,5),r=i>=1?Math.max(18/i,5):18;return(0,t.jsx)("span",{className:"flex h-[18px] w-[18px] items-center justify-center",children:(0,t.jsx)("span",{className:"rounded-[2px] border-[1.5px] border-current",style:{width:n,height:r}})})}function lb(e){let{value:s,onChange:a,autoEnabled:l}=e,i=e=>(0,b.cn)("flex min-h-[48px] flex-col items-center justify-center gap-1 rounded-md border text-xs transition-colors",e?"border-primary bg-primary/10 text-primary":"border-input text-muted-foreground hover:border-muted-foreground/50 hover:text-foreground"),n=e=>(0,t.jsxs)("button",{type:"button",onClick:()=>a(e),"aria-pressed":s===e,className:i(s===e),children:[(0,t.jsx)(lN,{ratio:e}),e]},e),r=(0,t.jsxs)("button",{type:"button",onClick:()=>a("auto"),disabled:!l,"aria-pressed":"auto"===s,className:(0,b.cn)(i("auto"===s),"w-full","auto"!==s&&"border-dashed",!l&&"cursor-not-allowed opacity-40 hover:border-input hover:text-muted-foreground"),children:[(0,t.jsx)("span",{className:"text-sm leading-none",children:"â¨"}),"Auto"]}),d=(0,t.jsxs)("button",{type:"button",onClick:()=>a("1:1"),"aria-pressed":"1:1"===s,className:(0,b.cn)(i("1:1"===s),"w-full"),children:[(0,t.jsx)(lN,{ratio:"1:1"}),"1:1"]});return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)("div",{className:"hidden sm:grid grid-cols-4 grid-rows-2 gap-1.5",children:[(0,t.jsx)("div",{className:"row-span-2 flex items-center",children:r}),(0,t.jsx)("div",{className:"row-span-2 flex items-center",children:d}),lf.map(n),lv.map(n)]}),(0,t.jsxs)("div",{className:"space-y-2 sm:hidden",children:[(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-1.5",children:[r,d]}),(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Landscape"}),(0,t.jsx)("div",{className:"grid grid-cols-4 gap-1.5",children:lf.map(n)}),(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Portrait"}),(0,t.jsx)("div",{className:"grid grid-cols-4 gap-1.5",children:lv.map(n)})]}),!l&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Auto needs a reference image."})]})}function ly(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("1:1"),{data:o,status:x}=(0,X.wV)(),{requireAuth:u,setError:g}=en(),f=ed(j.F.grokImage2.create),v=e.length>0;(0,i.useEffect)(()=>{c(e=>v?"auto":"auto"===e?"1:1":e)},[v]),(0,i.useEffect)(()=>{"unauthenticated"===x&&r("Editorial portrait of a young European woman with auburn hair and freckles, soft natural window light, wearing a cream knit sweater, calm confident expression, shallow depth of field, warm neutral background, photorealistic, fine skin texture, high-end fashion photography")},[x]);let N=(0,i.useCallback)(()=>
1{if(u()){if(!n.trim())return void g("Please enter a prompt");f.mutate({prompt:n.trim(),image_urls:v?e:void 0,aspect_ratio:d})}},[e,v,n,d,u,g,f]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Grok Imagine Image 2.0"}),(0,t.jsx)(h.BT,{children:"xAI's image model â generate from a prompt, or attach images to edit"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)("div",{children:(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the image you want to generate, or how to transform your reference images..."})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs",children:["Optional ⢠Max ",6]})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images to edit instead of generating from scratch (up to ".concat(6,")"),supportedFormats:"PNG, JPG, WEBP",maxFiles:6,onUrlsChange:o?s:void 0,onUploadingChange:l})]}),(0,t.jsx)(lb,{value:d,onChange:c,autoEnabled:v}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:N,disabled:a||!n.trim(),credits:6,isPending:f.isPending}),(0,t.jsx)(eZ,{cost:6,costDescription:"".concat(6," credits per image")})]})]})}let lw=eP.LD["grok-imagine-image-2"],lS={"480p":9,"720p":18,"1080p":36};function lC(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("720p"),[n,r]=(0,i.useState)(5),[d,c]=(0,i.useState)("16:9"),[o,x]=(0,i.useState)(!1),[u,g]=(0,i.useState)(""),[f,v]=(0,i.useState)(!1),{status:N}=(0,X.wV)(),{requireAuth:b,setError:y}=en(),w=ed(j.F.seedanceV1Pro.create),S=n*lS[a];(0,i.useEffect)(()=>{"unauthenticated"===N&&s("A cinematic aerial shot of a futuristic city at sunset, with flying cars and towering skyscrapers reflecting the golden light")},[N]);let C=(0,i.useCallback)(()=>{if(!b())return;if(!e.trim())return void y("Please enter a prompt");let s=u.trim()?parseInt(u,10):void 0;
1w.mutate({modelType:"seedance-v1-pro/text-to-video",prompt:e,resolution:a,duration:n,camera_fixed:o,...d&&{aspect_ratio:d},...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,a,n,d,o,u,b,y,w]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text-to-Video"}),(0,t.jsx)(h.BT,{children:"Create videos from text descriptions"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Describe the scene, camera movements, and visual effects you want"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>e&&l(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption: 480p (9 credits/s), 720p (18 credits/s), 1080p (36 credits/s)"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",n,"s"]})}),(0,t.jsx)(sm.A,{value:[n],onValueChange:e=>{let[s]=e;return r(s)},min:2,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose video duration from 2 to 12 seconds"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsxs)(sv.l6,{value:d,onValueChange:e=>c(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:o,onCheckedChange:x})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>v(!f),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[f?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),f&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:u,onChange:e=>g(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:C,disabled:!e.trim(),credits:S,isPending:w.isPending}),(0,t.jsx)(eZ,{cost:S,costDescription:" per generation (".concat(a,", ").concat(n,"s
1) ")})]})]})}let lP={"480p":9,"720p":18,"1080p":36};function lA(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!1),[o,x]=(0,i.useState)(""),[u,g]=(0,i.useState)("720p"),[f,v]=(0,i.useState)(5),[N,b]=(0,i.useState)("16:9"),[y,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(""),[P,A]=(0,i.useState)(!1),{data:E,status:R}=(0,X.wV)(),{requireAuth:k,setError:I}=en(),U=ed(j.F.seedanceV1Pro.create),V=f*lP[u];(0,i.useEffect)(()=>{"unauthenticated"===R&&x("Camera slowly zooms in as the subject looks up with a gentle smile, soft wind blowing through their hair, natural lighting, cinematic motion")},[R]);let T=(0,i.useCallback)(()=>{if(!k())return;if(!e)return void I("Please upload a first frame image");let s=S.trim()?parseInt(S,10):void 0;U.mutate({modelType:"seedance-v1-pro/image-to-video",image:e,resolution:u,duration:f,camera_fixed:y,...a&&{last_image:a},...o.trim()&&{prompt:o.trim()},...N&&{aspect_ratio:N},...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,a,o,u,f,N,y,S,k,I,U]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image-to-Video"}),(0,t.jsx)(h.BT,{children:"Transform images into dynamic videos with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Upload Images"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"First Frame"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame",supportedFormats:"PNG, JPG, WEBP (max 10MB)",onUrlChange:E?s:void 0,onUploadingChange:r})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Last Frame"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the last frame",supportedFormats:"PNG, JPG, WEBP (max 10MB)",onUrlChange:E?l:void 0,onUploadingChange:c})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3",children:"Upload only the first frame for standard image-to-video mode. Upload both first and last frames to use first-last frame mode for precise motion control."})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>e&&g(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption: 480p (9 credits/s), 720p (18 credits/s), 1080p (36 credits/s)"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",f,"s"]})}),(0,t.jsx)(sm.A,{value:[f],onValueChange:e=>{let[s]=e;return v(s)},min:2,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose video duration from 2 to 12 seconds"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ep.PromptInput,{value:o,onChange:x,placeholder:"Describe the motion and transformation you want... (optional)"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Optionally describe camera movements, subject actions, and desired effects"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsxs)(sv.l6,{value:N,onValueChange:e=>b(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:y,onCheckedChange:w})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>A(!P),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[P?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),P&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:S,onChange:e=>C(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:T,disabled:n||d,credits:V,isPending:U.isPending}),(0,t.jsx)(eZ,{cost:V,costDescription:" per generation (".concat(u,", ").concat(f,"s").concat(a?", First-Last Frame":"",") ")})]})]})}let lE=eP.LD["seedance-v1-pro"],lR={"480p":4,"720p":8,"1080p":16};function lF(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("720p"),[n,r]=(0,i.useState)(5),[d,c]=(0,i.useState)("16:9"),[o,x]=(0,i.useState)(!1),[u,g]=(0,i.useState)(""),[f,v]=(0,i.useState)(!1),{status:N}=(0,X.wV)(),{requireAuth:b,setError:y}=en(),w=ed(j.F.seedanceV1ProFast.create),S=n*lR[a];(0,i.useEffect)(()=>{"unauthenticated"===N&&s("A cinematic aerial shot of a futuristic city at sunset, with flying cars and towering skyscrapers reflecting the golden light")},[N]);let C=(0,i.useCallback)(()=>
1{if(!b())return;if(!e.trim())return void y("Please enter a prompt");let s=u.trim()?parseInt(u,10):void 0;w.mutate({modelType:"seedance-v1-pro-fast/text-to-video",prompt:e,resolution:a,duration:n,camera_fixed:o,...d&&{aspect_ratio:d},...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,a,n,d,o,u,b,y,w]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text-to-Video"}),(0,t.jsx)(h.BT,{children:"Create videos from text descriptions"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Describe the scene, camera movements, and visual effects you want"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>e&&l(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption: 480p (4 credits/s), 720p (8 credits/s), 1080p (16 credits/s)"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",n,"s"]})}),(0,t.jsx)(sm.A,{value:[n],onValueChange:e=>{let[s]=e;return r(s)},min:2,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose video duration from 2 to 12 seconds"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsxs)(sv.l6,{value:d,onValueChange:e=>c(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:o,onCheckedChange:x})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>v(!f),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[f?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),f&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:u,onChange:e=>g(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:C,disabled:!e.trim(),credits:S,isPending:w.isPending}),(0,t.jsx)(eZ,{cost:S,costDescription:" per generation (".concat(a,", ").concat(n,"s
1) ")})]})]})}let lk={"480p":4,"720p":8,"1080p":16};function lI(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("720p"),[o,x]=(0,i.useState)(5),[u,g]=(0,i.useState)("16:9"),[f,v]=(0,i.useState)(!1),[N,b]=(0,i.useState)(""),[y,w]=(0,i.useState)(!1),{data:S,status:C}=(0,X.wV)(),{requireAuth:P,setError:A}=en(),E=ed(j.F.seedanceV1ProFast.create),R=o*lk[d];(0,i.useEffect)(()=>{"unauthenticated"===C&&r("Camera slowly zooms in as the subject looks up with a gentle smile, soft wind blowing through their hair, natural lighting, cinematic motion")},[C]);let k=(0,i.useCallback)(()=>{if(!P())return;if(!e)return void A("Please upload a first frame image");let s=N.trim()?parseInt(N,10):void 0;E.mutate({modelType:"seedance-v1-pro-fast/image-to-video",image:e,prompt:n.trim(),resolution:d,duration:o,camera_fixed:f,...u&&{aspect_ratio:u},...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,n,d,o,u,f,N,P,A,E]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image-to-Video"}),(0,t.jsx)(h.BT,{children:"Transform images into dynamic videos with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Upload Image"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"First Frame"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame",supportedFormats:"PNG, JPG, WEBP (max 10MB)",onUrlChange:S?s:void 0,onUploadingChange:l})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3",children:"Upload an image to transform into a video. The AI will animate it based on your prompt."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the motion and transformation you want...",required:!0}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Describe camera movements, subject actions, and desired effects for better motion control"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>e&&c(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption: 480p (4 credits/s), 720p (8 credits/s), 1080p (16 credits/s)"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",o,"s"]})}),(0,t.jsx)(sm.A,{value:[o],onValueChange:e=>{let[s]=e;return x(s)},min:2,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose video duration from 2 to 12 seconds"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsxs)(sv.l6,{value:u,onValueChange:e=>g(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:f,onCheckedChange:v})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>w(!y),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[y?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),y&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:N,onChange:e=>b(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:k,disabled:a||!n.trim(),credits:R,isPending:E.isPending}),(0,t.jsx)(eZ,{cost:R,costDescription:" per generation (".concat(d,", ").concat(o,"s) ")})]})]})}
1let lU=eP.LD["seedance-v1-pro-fast"],lV={"480p":{base:4,withAudio:8},"720p":{base:8,withAudio:16},"1080p":{base:16,withAudio:32}};function lT(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("480p"),[n,r]=(0,i.useState)(5),[d,c]=(0,i.useState)("16:9"),[o,x]=(0,i.useState)(!1),[u,g]=(0,i.useState)(!1),[f,v]=(0,i.useState)(""),[N,b]=(0,i.useState)(!1),{data:y,status:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=ed(j.F.seedanceV15Pro.create),A=n*(o?lV[a].withAudio:lV[a].base);(0,i.useEffect)(()=>{"unauthenticated"===w&&s("A cinematic shot of a person walking through a sunlit forest, golden hour lighting filtering through the trees, peaceful atmosphere, smooth camera movement")},[w]);let E=(0,i.useCallback)(()=>{if(!S())return;if(!e.trim())return void C("Please enter a prompt");let s=f.trim()?parseInt(f,10):void 0;P.mutate({modelType:"seedance-1-5-pro/text-to-video",prompt:e.trim(),resolution:a,duration:n,generate_audio:o,camera_fixed:u,...d&&{aspect_ratio:d},...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,a,n,d,o,u,f,P]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text-to-Video"}),(0,t.jsx)(h.BT,{children:"Generate cinematic videos from text prompts"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>e&&l(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption varies by resolution and audio generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",n,"s"]})}),(0,t.jsx)(sm.A,{value:[n],onValueChange:e=>{let[s]=e;return r(s)},min:4,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose video duration from 4 to 12 seconds"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsxs)(sv.l6,{value:d,onValueChange:e=>c(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t_.A,{className:"w-4 h-4"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Generate Audio"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"AI-generated audio doubles the credit cost"})]}),(0,t.jsx)(F,{id:"generate-audio",checked:o,onCheckedChange:x})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:u,onCheckedChange:g})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>b(!N),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[N?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),N&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:f,onChange:e=>v(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:E,disabled:!e.trim(),credits:A,isPending:P.isPending}),(0,t.jsx)(eZ,{cost:A,costDescription:" per generation (".concat(a,", ").concat(n,"s").concat(o?", with audio":"",") ")})]})]})}
1let lB={"480p":{base:4,withAudio:8},"720p":{base:8,withAudio:16},"1080p":{base:16,withAudio:32}};function lM(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!1),[o,x]=(0,i.useState)(""),[u,g]=(0,i.useState)("480p"),[f,v]=(0,i.useState)(5),[N,b]=(0,i.useState)("16:9"),[y,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),[P,A]=(0,i.useState)(""),[E,R]=(0,i.useState)(!1),{data:k,status:I}=(0,X.wV)(),{requireAuth:U,setError:V}=en(),T=ed(j.F.seedanceV15Pro.create),B=f*(y?lB[u].withAudio:lB[u].base);(0,i.useEffect)(()=>{"unauthenticated"===I&&x("Camera slowly zooms in as the subject looks up with a gentle smile, soft wind blowing through their hair, natural lighting, cinematic motion")},[I]);let M=(0,i.useCallback)(()=>{if(!U())return;if(!e)return void V("Please upload a first frame image");if(!o.trim())return void V("Please enter a prompt");let s=P.trim()?parseInt(P,10):void 0;T.mutate({modelType:"seedance-1-5-pro/image-to-video",image:e,prompt:o.trim(),resolution:u,duration:f,generate_audio:y,camera_fixed:S,...a&&{last_image:a},...N&&{aspect_ratio:N},...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,a,o,u,f,N,y,S,P,T]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image-to-Video"}),(0,t.jsx)(h.BT,{children:"Transform images into dynamic videos with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Upload Images"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"First Frame"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame",supportedFormats:"PNG, JPG, WEBP (max 10MB)",onUrlChange:k?s:void 0,onUploadingChange:r})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Last Frame"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the last frame",supportedFormats:"PNG, JPG, WEBP (max 10MB)",onUrlChange:k?l:void 0,onUploadingChange:c})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3",children:"Upload only the first frame for standard image-to-video mode. Upload both first and last frames to use first-last frame mode for precise motion control."})]}),(0,t.jsx)(ep.PromptInput,{value:o,onChange:x,placeholder:"Describe the motion and transformation you want..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>e&&g(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption varies by resolution and audio generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",f,"s"]})}),(0,t.jsx)(sm.A,{value:[f],onValueChange:e=>{let[s]=e;return v(s)},min:4,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose video duration from 4 to 12 seconds"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsxs)(sv.l6,{value:N,onValueChange:e=>b(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t_.A,{className:"w-4 h-4"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Generate Audio"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"AI-generated audio doubles the credit cost"})]}),(0,t.jsx)(F,{id:"generate-audio",checked:y,onCheckedChange:w})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:S,onCheckedChange:C})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>R(!E),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[E?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),E&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:P,onChange:e=>A(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:M,disabled:n||d||!o.trim(),credits:B,isPending:T.isPending}),(0,t.jsx)(eZ,{cost:B,costDescription:" per generation (".concat(u,", ").concat(f,"s").concat(a?", First-Last Frame":"").concat(y?", with audio":"",") ")})]})]})}
1let lG={"480p":{base:4,withAudio:8},"720p":{base:8,withAudio:16},"1080p":{base:16,withAudio:32}};function lD(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("480p"),[o,x]=(0,i.useState)(5),[u,g]=(0,i.useState)(!1),[f,v]=(0,i.useState)(!1),[N,b]=(0,i.useState)(""),[y,w]=(0,i.useState)(!1),{data:S,status:C}=(0,X.wV)(),{requireAuth:P,setError:A}=en(),E=ed(j.F.seedanceV15Pro.create),R=o*(u?lG[d].withAudio:lG[d].base);(0,i.useEffect)(()=>{"unauthenticated"===C&&r("Extend the video smoothly, maintaining the same visual style and motion patterns, cinematic continuation")},[C]);let k=(0,i.useCallback)(()=>{if(!P())return;if(!e)return void A("Please upload a video");if(!n.trim())return void A("Please enter a prompt");let s=N.trim()?parseInt(N,10):void 0;E.mutate({modelType:"seedance-1-5-pro/video-extend",video:e,prompt:n.trim(),resolution:d,duration:o,generate_audio:u,camera_fixed:f,...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,n,d,o,u,f,N,E]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Extend"}),(0,t.jsx)(h.BT,{children:"Extend your videos with AI-generated continuation"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Input Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload the video to extend",supportedFormats:"MP4, MOV, WEBM (max 50MB)",onUrlChange:S?s:void 0,onUploadingChange:l}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3",children:"The AI will analyze your video and generate a seamless continuation."})]}),(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe how you want to extend the video..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>e&&c(e),className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption varies by resolution and audio generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",o,"s"]})}),(0,t.jsx)(sm.A,{value:[o],onValueChange:e=>{let[s]=e;return x(s)},min:4,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose extension duration from 4 to 12 seconds"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t_.A,{className:"w-4 h-4"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Generate Audio"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"AI-generated audio doubles the credit cost"})]}),(0,t.jsx)(F,{id:"generate-audio",checked:u,onCheckedChange:g})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:f,onCheckedChange:v})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>w(!y),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[y?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),y&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:N,onChange:e=>b(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:k,disabled:a||!n.trim(),credits:R,isPending:E.isPending}),(0,t.jsx)(eZ,{cost:R,costDescription:" per generation (".concat(d,", ").concat(o,"s").concat(u?", with audio":"",") ")})]})]})}
1let lO=eP.LD["seedance-1-5-pro"],lW={"720p":{base:6,withAudio:12},"1080p":{base:9,withAudio:18}};function lJ(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("720p"),[n,r]=(0,i.useState)(5),[d,c]=(0,i.useState)("16:9"),[o,x]=(0,i.useState)(!1),[u,g]=(0,i.useState)(!1),[f,v]=(0,i.useState)(""),[N,b]=(0,i.useState)(!1),{data:y,status:w}=(0,X.wV)(),{requireAuth:S,setError:C}=en(),P=ed(j.F.seedanceV15ProFast.create),A=n*(o?lW[a].withAudio:lW[a].base);(0,i.useEffect)(()=>{"unauthenticated"===w&&s("A cinematic shot of a person walking through a sunlit forest, golden hour lighting filtering through the trees, peaceful atmosphere, smooth camera movement")},[w]);let E=(0,i.useCallback)(()=>{if(!S())return;if(!e.trim())return void C("Please enter a prompt");let s=f.trim()?parseInt(f,10):void 0;P.mutate({modelType:"seedance-1-5-pro-fast/text-to-video",prompt:e.trim(),resolution:a,duration:n,generate_audio:o,camera_fixed:u,...d&&{aspect_ratio:d},...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,a,n,d,o,u,f,P]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text-to-Video (Fast)"}),(0,t.jsx)(h.BT,{children:"Generate cinematic videos from text prompts"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>e&&l(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption varies by resolution and audio generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",n,"s"]})}),(0,t.jsx)(sm.A,{value:[n],onValueChange:e=>{let[s]=e;return r(s)},min:4,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose video duration from 4 to 12 seconds"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsxs)(sv.l6,{value:d,onValueChange:e=>c(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t_.A,{className:"w-4 h-4"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Generate Audio"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"AI-generated audio doubles the credit cost"})]}),(0,t.jsx)(F,{id:"generate-audio",checked:o,onCheckedChange:x})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:u,onCheckedChange:g})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>b(!N),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[N?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),N&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:f,onChange:e=>v(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:E,disabled:!e.trim(),credits:A,isPending:P.isPending}),(0,t.jsx)(eZ,{cost:A,costDescription:" per generation (".concat(a,", ").concat(n,"s").concat(o?", with audio":"",") ")})]})]})}
1let lZ={"720p":{base:6,withAudio:12},"1080p":{base:9,withAudio:18}};function l_(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!1),[o,x]=(0,i.useState)(""),[u,g]=(0,i.useState)("720p"),[f,v]=(0,i.useState)(5),[N,b]=(0,i.useState)("16:9"),[y,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),[P,A]=(0,i.useState)(""),[E,R]=(0,i.useState)(!1),{data:k,status:I}=(0,X.wV)(),{requireAuth:U,setError:V}=en(),T=ed(j.F.seedanceV15ProFast.create),B=f*(y?lZ[u].withAudio:lZ[u].base);(0,i.useEffect)(()=>{"unauthenticated"===I&&x("Camera slowly zooms in as the subject looks up with a gentle smile, soft wind blowing through their hair, natural lighting, cinematic motion")},[I]);let M=(0,i.useCallback)(()=>{if(!U())return;if(!e)return void V("Please upload a first frame image");if(!o.trim())return void V("Please enter a prompt");let s=P.trim()?parseInt(P,10):void 0;T.mutate({modelType:"seedance-1-5-pro-fast/image-to-video",image:e,prompt:o.trim(),resolution:u,duration:f,generate_audio:y,camera_fixed:S,...a&&{last_image:a},...N&&{aspect_ratio:N},...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,a,o,u,f,N,y,S,P,T]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image-to-Video (Fast)"}),(0,t.jsx)(h.BT,{children:"Transform images into dynamic videos with AI"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eU.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Upload Images"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"First Frame"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame",supportedFormats:"PNG, JPG, WEBP (max 10MB)",onUrlChange:k?s:void 0,onUploadingChange:r})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Last Frame"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the last frame",supportedFormats:"PNG, JPG, WEBP (max 10MB)",onUrlChange:k?l:void 0,onUploadingChange:c})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3",children:"Upload only the first frame for standard image-to-video mode. Upload both first and last frames to use first-last frame mode for precise motion control."})]}),(0,t.jsx)(ep.PromptInput,{value:o,onChange:x,placeholder:"Describe the motion and transformation you want..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:u,onValueChange:e=>e&&g(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption varies by resolution and audio generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",f,"s"]})}),(0,t.jsx)(sm.A,{value:[f],onValueChange:e=>{let[s]=e;return v(s)},min:4,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose video duration from 4 to 12 seconds"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Aspect Ratio"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsxs)(sv.l6,{value:N,onValueChange:e=>b(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t_.A,{className:"w-4 h-4"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Generate Audio"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"AI-generated audio doubles the credit cost"})]}),(0,t.jsx)(F,{id:"generate-audio",checked:y,onCheckedChange:w})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:S,onCheckedChange:C})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>R(!E),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[E?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),E&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:P,onChange:e=>A(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:M,disabled:n||d||!o.trim(),credits:B,isPending:T.isPending}),(0,t.jsx)(eZ,{cost:B,costDescription:" per generation (".concat(u,", ").concat(f,"s").concat(a?", First-Last Frame":"").concat(y?", with audio":"",") ")})]})]})}
1let lL={"720p":{base:6,withAudio:12},"1080p":{base:9,withAudio:18}};function lq(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("720p"),[o,x]=(0,i.useState)(5),[u,g]=(0,i.useState)(!1),[f,v]=(0,i.useState)(!1),[N,b]=(0,i.useState)(""),[y,w]=(0,i.useState)(!1),{data:S,status:C}=(0,X.wV)(),{requireAuth:P,setError:A}=en(),E=ed(j.F.seedanceV15ProFast.create),R=o*(u?lL[d].withAudio:lL[d].base);(0,i.useEffect)(()=>{"unauthenticated"===C&&r("Extend the video smoothly, maintaining the same visual style and motion patterns, cinematic continuation")},[C]);let k=(0,i.useCallback)(()=>{if(!P())return;if(!e)return void A("Please upload a video");if(!n.trim())return void A("Please enter a prompt");let s=N.trim()?parseInt(N,10):void 0;E.mutate({modelType:"seedance-1-5-pro-fast/video-extend",video:e,prompt:n.trim(),resolution:d,duration:o,generate_audio:u,camera_fixed:f,...void 0!==s&&!isNaN(s)&&{seed:s}})},[e,n,d,o,u,f,N,E]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Extend (Fast)"}),(0,t.jsx)(h.BT,{children:"Extend your videos with AI-generated continuation"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Input Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Upload the video to extend",supportedFormats:"MP4, MOV, WEBM (max 50MB)",onUrlChange:S?s:void 0,onUploadingChange:l}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3",children:"The AI will analyze your video and generate a seamless continuation."})]}),(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe how you want to extend the video..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Resolution"})]}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>e&&c(e),className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p",className:"flex-1",children:"1080p"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Credit consumption varies by resolution and audio generation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",o,"s"]})}),(0,t.jsx)(sm.A,{value:[o],onValueChange:e=>{let[s]=e;return x(s)},min:4,max:12,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Choose extension duration from 4 to 12 seconds"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t_.A,{className:"w-4 h-4"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Generate Audio"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"AI-generated audio doubles the credit cost"})]}),(0,t.jsx)(F,{id:"generate-audio",checked:u,onCheckedChange:g})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Camera Fixed"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prevent unwanted camera movements"})]}),(0,t.jsx)(F,{id:"camera-fixed",checked:f,onCheckedChange:v})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>w(!y),className:"flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary transition-colors",children:[y?(0,t.jsx)(aV.A,{className:"w-4 h-4"}):(0,t.jsx)(e5.A,{className:"w-4 h-4"}),"Advanced Options"]}),y&&(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Random seed (leave empty for random)",value:N,onChange:e=>b(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Set a specific seed for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:k,disabled:a||!n.trim(),credits:R,isPending:E.isPending}),(0,t.jsx)(eZ,{cost:R,costDescription:" per generation (".concat(d,", ").concat(o,"s").concat(u?", with audio":"",") ")})]})]})}let lK=eP.LD["seedance-1-5-pro-fast"],lz={"1:1":[{label:"Square 1:1 (1024\xd71024)",value:"1024*1024"},{label:"Square 1:1 (1280\xd71280)",value:"1280*1280"},{label:"Square 1:1 (1536\xd71536)",value:"1536*1536"}],"16:9":[{label:"Landscape 16:9 (1280\xd7720)",value:"1280*720"},{label:"Landscape 16:9 (1440\xd7810)",value:"1440*810"}],"9:16":[{label:"Portrait 9:16 (720\xd71280)",value:"720*1280"},{label:"Portrait 9:16 (810\xd71440)",value:"810*1440"}]};function lQ(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("1024*1024"),[n,r]=(0,i.useState)(1024),[d,c]=(0,i.useState)(1024),[o,x]=(0,i.useState)(null),[u,g]=(0,i.useState)(!1),{status:f}=(0,X.wV)(),{requireAuth:v,setError:N}=en(),b=ed(j.F.zImage.create);(0,i.useEffect)(()=>{"unauthenticated"===f&&s("A serene landscape with mountains at sunset, vibrant colors, photorealistic, 8K quality")}
1,[f]);let y=(0,i.useCallback)(()=>{if(!v())return;if(!e.trim())return void N("Please enter a prompt");let s="custom"===a?"".concat(n,"*").concat(d):a;b.mutate({modelType:"z-image/turbo",prompt:e.trim(),size:s||void 0,seed:null!=o?o:-1})},[e,a,n,d,o,v,N,b]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Generate Image"}),(0,t.jsx)(h.BT,{children:"Create images from text with Z-Image Turbo"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Z-Image"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the image you want to create..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Image Size"}),(0,t.jsxs)(sv.l6,{value:a,onValueChange:l,children:[(0,t.jsx)(sv.bq,{children:(0,t.jsx)(sv.yv,{placeholder:"Select size"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Custom"}),(0,t.jsx)(sv.eb,{value:"custom",children:"Custom Size"})]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Square (1:1)"}),lz["1:1"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Landscape (16:9)"}),lz["16:9"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]}),(0,t.jsxs)(sv.s3,{children:[(0,t.jsx)(sv.TR,{children:"Portrait (9:16)"}),lz["9:16"].map(e=>(0,t.jsx)(sv.eb,{value:e.value,children:e.label},e.value))]})]})]}),"custom"===a&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Width (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:n,onChange:e=>r(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?(r(1536),Q.oR.warning("Width limited to maximum 1536px")):s<256&&(r(256),Q.oR.warning("Width must be at least 256px"))}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eD.J,{className:"text-xs",children:"Height (px)"}),(0,t.jsx)(e6.p,{type:"number",min:256,max:1536,value:d,onChange:e=>c(Number(e.target.value)),onBlur:e=>{let s=Number(e.target.value);s>1536?(c(1536),Q.oR.warning("Height limited to maximum 1536px")):s<256&&(c(256),Q.oR.warning("Height must be at least 256px"))}})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Size range: 256\xd7256 - 1536\xd71536"})]}),(0,t.jsxs)(e9,{open:u,onOpenChange:g,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(u?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Leave empty for random, or set a specific seed",value:null!=o?o:"",onChange:e=>{let s=e.target.value;if(""===s)x(null);else{let e=parseInt(s,10);isNaN(e)||x(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Leave empty for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:y,disabled:!e.trim(),credits:4,isPending:b.isPending}),(0,t.jsx)(eZ,{cost:4,costDescription:" ".concat(4," credits (fixed price) ")})]})]})}let lH=eP.LD["z-image"];function l$(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("480p"),[n,r]=(0,i.useState)("16:9"),[d,c]=(0,i.useState)(5),[o,m]=(0,i.useState)(-1),[x,u]=(0,i.useState)(!1),{status:g}=(0,X.wV)(),{requireAuth:f,setError:v}=en(),N=ed(j.F.ltx2.create);(0,i.useEffect)(()=>{"unauthenticated"===g&&s("A cinematic drone shot flies over a futuristic city at sunset, revealing gleaming skyscrapers and hovering vehicles, with warm golden light reflecting off glass surfaces.")},[g]);let b={"480p":4,"720p":6,"1080p":8}[a]*d,y=(0,i.useCallback)(()=>{if(f()){if(!e.trim())return void v("Please enter a prompt");N.mutate({modelType:"ltx-2-19b/text-to-video",prompt:e,resolution:a,aspect_ratio:n,duration:d,seed:-1===o?void 0:o})}},[e,a,n,d,o,f,v,N]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Text to Video"}),(0,t.jsx)(h.BT,{children:"Generate videos from text with LTX-2 19B"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the video you want to create..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:a,onValueChange:e=>{("480p"===e||"720p"===e||"1080p"===e)&&l(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),{}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:n,onValueChange:e=>{("16:9"===e||"9:16"===e)&&r(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-3",viewBox:"0 0 16 12",fill:"currentColor",children:(0,t.jsx)("rect",{width:"16",height:"12",rx:"1"})}),"16:9"]})}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16",className:"flex-1",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3 h-4",viewBox:"0 0 12 16",fill:"currentColor",children:(0,t.jsx)("rect",{width:"12",height:"16",rx:"1"})}),"9:16"]})})]})]}),{})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",d,"s"]})}),(0,t.jsx)(sm.A,{value:[d],onValueChange:e=>{let[s]=e;return c(s)},min:5,max:20,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Range: 5-20 seconds"})]}),(0,t.jsxs)(e9,{open:x,onOpenChange:u,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(x?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:o,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)m(-1);else{let e=parseInt(s,10);isNaN(e)||m(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:y,disabled:!e.trim(),credits:b,isPending:N.isPending}),(0,t.jsx)(eZ,{cost:b,costDescription:" ".concat(b," credits (").concat(d,"s video at ").concat(a,") ")})]})]})}function lY(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("480p"),[m,x]=(0,i.useState)(5),[u,g]=(0,i.useState)(-1),[f,v]=(0,i.useState)(!1),{data:N,status:b}=(0,X.wV)(),{requireAuth:y,setError:w}=en(),S=ed(j.F.ltx2.create);(0,i.useEffect)(()=>{"unauthenticated"===b&&d("Transform this image into a dynamic video with smooth camera movement and natural motion.")},[b]);let C={"480p":4,"720p":6,"1080p":8}[c]*m,P=(0,i.useCallback)(()=>{if(y()){if(!e)return void w("Please upload an image for image-to-video generation");if(!r.trim())return void w("Please enter a prompt");S.mutate({modelType:"ltx-2-19b/image-to-video",image:e,prompt:r,resolution:c,duration:m,seed:-1===u?void 0:u})}},[e,r,c,m,u,y,w,S]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Image to Video"}),(0,t.jsx)(h.BT,{children:"Animate your images with LTX-2 19B"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Source Image"}),(0,t.jsx)(p.E,{className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload an image to animate",supportedFormats:"PNG, JPG, WEBP supported",onUrlChange:N?s:void 0,onUploadingChange:l})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to animate the image..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:c,onValueChange:e=>{("480p"===e||"720p"===e||"1080p"===e)&&o(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p resolution",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),{}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",m,"s"]})}),(0,t.jsx)(sm.A,{value:[m],onValueChange:e=>{let[s]=e;return x(s)},min:5,max:20,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Range: 5-20 seconds"})]}),(0,t.jsxs)(e9,{open:f,onOpenChange:v,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(f?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"-1 for random, or any integer for fixed generation",value:u,onChange:e=>{let s=e.target.value;if(""===s||"-"===s)g(-1);else{let e=parseInt(s,10);isNaN(e)||g(e)}}}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Use -1 for random generation, or set a specific number for reproducible results"})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:P,disabled:a||!r.trim(),credits:C,isPending:S.isPending}),(0,t.jsx)(eZ,{cost:C,costDescription:" ".concat(C," credits (").concat(m,"s video at ").concat(c,") ")})]})]})}let lX=eP.LD["ltx-2"],l0={"720p":40,"1080p":80};function l1(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("720p"),[x,u]=(0,i.useState)("16:9"),[g,f]=(0,i.useState)(5),[v,N]=(0,i.useState)(""),[b,y]=(0,i.useState)(!1),{data:w,status:S}=(0,X.wV)(),{requireAuth:C,setError:P}=en(),A=ed(j.F.happyhorse1.create),E=!!e;(0,i.useEffect)(()=>{"unauthenticated"===S&&d("A cinematic drone shot flies over a futuristic city at sunset, revealing gleaming skyscrapers and hovering vehicles, with warm golden light reflecting off glass surfaces.")},[S]);let R=l0[c]*g,F=(0,i.useCallback)(()=>{let s;if(!C())return;if(!r.trim())return void P("Please enter a prompt");let a=v.trim();if(""!==a){let e=Number.parseInt(a,10);if(Number.isNaN(e)||e<0||e>0x7fffffff)return void P("Seed must be an integer between 0 and 2147483647");s=e}E&&e?A.mutate({modelType:"happyhorse-1/image-to-video",image:e,prompt:r,resolution:c,duration:g,...void 0!==s&&{seed:s}}
1):A.mutate({modelType:"happyhorse-1/text-to-video",prompt:r,resolution:c,aspect_ratio:x,duration:g,...void 0!==s&&{seed:s}})},[E,e,r,c,x,g,v,A]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(eX.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Happyhorse 1.0"}),(0,t.jsx)(h.BT,{children:"Generate videos from text. Optionally upload a first frame to switch into image-to-video."})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"First Frame Image"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload an image to use as the first frame",supportedFormats:"JPEG, PNG, BMP, WEBP \xb7 Min 300px \xb7 Max 10MB",onUrlChange:w?s:void 0,onUploadingChange:l}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Upload an image to use as the first frame (switches to image-to-video)."})]}),(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe the video you want to create..."}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:c,onValueChange:e=>{("720p"===e||"1080p"===e)&&o(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),{}),(0,t.jsx)(()=>E?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsx)("div",{className:"w-full grid grid-cols-1 gap-2",children:(0,t.jsxs)("div",{className:"flex items-center justify-center h-9 rounded-md border border-dashed border-border bg-muted/40 text-sm text-muted-foreground",children:[(0,t.jsx)(m.A,{className:"w-3.5 h-3.5 mr-2"}),"Auto"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Aspect ratio follows your first frame image."})]}):(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:x,onValueChange:e=>{("16:9"===e||"9:16"===e||"1:1"===e||"4:3"===e||"3:4"===e)&&u(e)},className:"w-full grid grid-cols-5 gap-2",children:[(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16",className:"flex-1",children:"9:16"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1",className:"flex-1",children:"1:1"}),(0,t.jsx)(eG,{value:"4:3","aria-label":"4:3",className:"flex-1",children:"4:3"}),(0,t.jsx)(eG,{value:"3:4","aria-label":"3:4",className:"flex-1",children:"3:4"})]})]}),{}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",g,"s"]})}),(0,t.jsx)(sm.A,{value:[g],onValueChange:e=>{let[s]=e;return f(s)},min:3,max:15,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Range: 3-15 seconds"})]}),(0,t.jsxs)(e9,{open:b,onOpenChange:y,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(b?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Leave empty for random",value:v,min:0,max:0x7fffffff,onChange:e=>N(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Leave empty for random; or set a specific number (0â2147483647) for reproducible results."})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:F,disabled:a||!r.trim(),credits:R,isPending:A.isPending}),(0,t.jsx)(eZ,{cost:R,costDescription:" ".concat(R," credits (").concat(g,"s ").concat(E?"image-to-video":"text-to-video"," at ").concat(c,") ")})]})]})}let l2={"720p":40,"1080p":80};function l4(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("720p"),[o,m]=(0,i.useState)(5),[x,u]=(0,i.useState)(""),[g,f]=(0,i.useState)(!1),{data:v,status:N}=(0,X.wV)(),{requireAuth:b,setError:y}=en(),w=ed(j.F.happyhorse1.create);(0,i.useEffect)(()=>{"unauthenticated"===N&&r("Continue the scene seamlessly with smooth motion and consistent lighting.")},[N]);let S=l2[d]*o,C=(0,i.useCallback)(()=>{let s;if(!b())return;if(!e)return void y("Please upload a source video to extend");if(!n.trim())return void y("Please enter a prompt");let a=x.trim();if(""!==a){let e=Number.parseInt(a,10);if(Number.isNaN(e)||e<0||e>0x7fffffff)return void y("Seed must be an integer between 0 and 2147483647");s=e}w.mutate({modelType:"happyhorse-1/video-extend",video:e,prompt:n,resolution:d,duration:o,...void 0!==s&&{seed:s}})},[e,n,d,o,x,w]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sA.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Extend"}),(0,t.jsx)(h.BT,{children:"Extend an existing video with seamless AI-generated continuation."})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Source Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Click to upload a video to extend",supportedFormats:"MP4, MOV, WEBM supported",onUrlChange:v?s:void 0,onUploadingChange:l})]}),(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe how the video should continue..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>{("720p"===e||"1080p"===e)&&c(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Total Output Duration: ",o,"s"]})}),(0,t.jsx)(sm.A,{value:[o],onValueChange:e=>{let[s]=e;return m(s)},min:3,max:15,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Total length of the final output (3-15 seconds), including the source video."})]}),(0,t.jsxs)(e9,{open:g,onOpenChange:f,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(g?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Leave empty for random",value:x,min:0,max:0x7fffffff,onChange:e=>u(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Leave empty for random; or set a specific number (0â2147483647) for reproducible results."})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:C,disabled:a||!n.trim(),credits:S,isPending:w.isPending}),(0,t.jsx)(eZ,{cost:S,costDescription:" ".concat(S," credits (").concat(o,"s extend at ").concat(d,") ")})]})]})}let l3={"720p":40,"1080p":80};function l5(){let[e,s]=(0,i.useState)(null),[a,l]=(0,i.useState)(null),[n,r]=(0,i.useState)(0),[d,c]=(0,i.useState)([]),[o,m]=(0,i.useState)(!1),[x,u]=(0,i.useState)(!1),[g,f]=(0,i.useState)(""),[v,N]=(0,i.useState)("720p"),[b,y]=(0,i.useState)(""),[w,S]=(0,i.useState)(!1),{data:C,status:P}=(0,X.wV)(),{requireAuth:A,setError:E}=en(),R=ed(j.F.happyhorse1.create);(0,i.useEffect)(()=>{"unauthenticated"===P&&f("Re-style the scene with rich cinematic color grading and softer light.")},[P]),(0,i.useEffect)(()=>{if(!e)return void r(0);let s=document.createElement("video");return s.preload="metadata",s.onloadedmetadata=()=>{r(s.duration)},s.onerror=()=>{Q.oR.error("Invalid video file. Please upload a valid video"),r(0)},s.src=URL.createObjectURL(e),()=>{URL.revokeObjectURL(s.src)}},[e]);let F=Math.ceil((n>0?Math.max(n,3):0)*l3[v]),k=(0,i.useCallback)(()=>{let e;if(!A())return;if(!a)return void E("Please upload a source video to edit");if(!g.trim())return void E("Please enter a prompt");let s=b.trim();if(""!==s){let a=Number.parseInt(s,10);if(Number.isNaN(a)||a<0||a>0x7fffffff)return void E("Seed must be an integer between 0 and 2147483647");e=a}R.mutate({modelType:"happyhorse-1/video-edit",video:a,...d.length>0&&{images:d},prompt:g,resolution:v,...void 0!==e&&{seed:e}})},[a,d,g,v,b,R]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sE.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Video Edit"}),(0,t.jsx)(h.BT,{children:"Prompt-driven video editing with optional reference images. Output length follows the input video."})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Source Video"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"video",description:"Click to upload source video to edit",supportedFormats:"MP4, MOV, WEBM supported",onFirstFileChange:s,onUrlChange:C?l:void 0,onUploadingChange:m}),e&&n>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Video duration: ",Math.round(n),"s \xb7 Estimated cost: ~",F," credits"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images (up to ".concat(9,")"),supportedFormats:"PNG, JPG, WEBP supported",maxFiles:9,onUrlsChange:C?c:void 0,onUploadingChange:u}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Reference images help guide the edit toward a specific look or character."})]}),(0,t.jsx)(ep.PromptInput,{value:g,onChange:f,placeholder:"Describe how to edit the video..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:v,onValueChange:e=>{("720p"===e||"1080p"===e)&&N(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),(0,t.jsxs)(e9,{open:w,onOpenChange:S,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(w?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Leave empty for random",value:b,min:0,max:0x7fffffff,onChange:e=>y(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Leave empty for random; or set a specific number (0â2147483647) for reproducible results."})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:k,disabled:o||x||!g.trim(),credits:F,isPending:R.isPending}),(0,t.jsx)(eZ,{cost:F,costDescription:n>0?"~".concat(F," credits (").concat(Math.round(n),"s edit at ").concat(v,"; final cost based on server-verified duration)"):"Upload a video to estimate cost"})]})]})}let l6={"720p":40,"1080p":80};function l8(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[n,r]=(0,i.useState)(""),[d,c]=(0,i.useState)("720p"),[o,m]=(0,i.useState)("16:9"),[x,u]=(0,i.useState)(5),[g,f]=(0,i.useState)(""),[v,N]=(0,i.useState)(!1),{data:b,status:y}=(0,X.wV)(),{requireAuth:w,setError:S}=en(),C=ed(j.F.happyhorse1.create);(0,i.useEffect)(()=>{"unauthenticated"===y&&r("A cinematic shot featuring the reference characters, with consistent style, lighting, and dynamic camera motion.")},[y]);let P=l6[d]*x,A=(0,i.useCallback)(()=>{let s;if(!w())return;if(0===e.length)return void S("Please upload at least one reference image");if(!n.trim())return void S("Please enter a prompt");let a=g.trim();if(""!==a){let e=Number.parseInt(a,10);if(Number.isNaN(e)||e<0||e>0x7fffffff)return void S("Seed must be an integer between 0 and 2147483647");s=e}C.mutate({modelType:"happyhorse-1/reference-to-video",images:e,prompt:n,resolution:d,aspect_ratio:o,duration:x,...void 0!==s&&{seed:s}})},[e,n,d,o,x,g,C]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sj.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Reference to Video"}),(0,t.jsx)(h.BT,{children:"Generate new scenes guided by reference images, preserving character and style."})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images (1-".concat(9,")"),supportedFormats:"PNG, JPG, WEBP supported",maxFiles:9,onUrlsChange:b?s:void 0,onUploadingChange:l}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Characters, style, and identity from your references will be preserved."})]}),(0,t.jsx)(ep.PromptInput,{value:n,onChange:r,placeholder:"Describe the scene you want to create..."}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:d,onValueChange:e=>{("720p"===e||"1080p"===e)&&c(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"720p","aria-label":"720p resolution",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p resolution",className:"flex-1",children:"1080p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:o,onValueChange:e=>{("16:9"===e||"9:16"===e||"1:1"===e||"4:3"===e||"3:4"===e)&&m(e)},className:"w-full grid grid-cols-5 gap-2",children:[(0,t.jsx)(eG,{value:"16:9","aria-label":"16:9",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"9:16","aria-label":"9:16",className:"flex-1",children:"9:16"}),(0,t.jsx)(eG,{value:"1:1","aria-label":"1:1",className:"flex-1",children:"1:1"}),(0,t.jsx)(eG,{value:"4:3","aria-label":"4:3",className:"flex-1",children:"4:3"}),(0,t.jsx)(eG,{value:"3:4","aria-label":"3:4",className:"flex-1",children:"3:4"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,t.jsxs)(eD.J,{className:"text-sm font-medium text-foreground",children:["Duration: ",x,"s"]})}),(0,t.jsx)(sm.A,{value:[x],onValueChange:e=>{let[s]=e;return u(s)},min:3,max:15,step:1,className:"w-full"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Range: 3-15 seconds"})]}),(0,t.jsxs)(e9,{open:v,onOpenChange:N,children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[(0,t.jsx)(e5.A,{className:"h-4 w-4 transition-transform ".concat(v?"rotate-180":"")}),"Advanced Settings"]}),(0,t.jsx)(se,{className:"space-y-4 pt-4",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Seed"}),(0,t.jsx)(p.E,{variant:"secondary",className:"text-xs bg-foreground
1/40",children:"Optional"})]}),(0,t.jsx)(e6.p,{type:"number",placeholder:"Leave empty for random",value:g,min:0,max:0x7fffffff,onChange:e=>f(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Leave empty for random; or set a specific number (0â2147483647) for reproducible results."})]})})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:A,disabled:a||!n.trim(),credits:P,isPending:C.isPending}),(0,t.jsx)(eZ,{cost:P,costDescription:" ".concat(P," credits (").concat(x,"s reference-to-video at ").concat(d,") ")})]})]})}let l9=eP.LD["happyhorse-1"],l7={"1:1":{w:1,h:1},"4:3":{w:4,h:3},"16:9":{w:16,h:9},"3:2":{w:3,h:2},"21:9":{w:21,h:9}},ie={"1:1":{"2K":{w:2048,h:2048},"3K":{w:3072,h:3072}},"4:3":{"2K":{w:2312,h:1734},"3K":{w:3456,h:2592}},"16:9":{"2K":{w:2848,h:1600},"3K":{w:4096,h:2304}},"3:2":{"2K":{w:2496,h:1664},"3K":{w:3744,h:2496}},"21:9":{"2K":{w:3136,h:1344},"3K":{w:4704,h:2016}}},is=Math.ceil(Math.sqrt(25e4));function ia(e,s){let{w:a,h:t}=ie[e][s];return a*t}function it(e,s){let a=e*s;if(a>=4e6&&a<=0x9ec290)return{width:e,height:s};let t=Math.sqrt((a<4e6?4e6:0x9ec290)/a),l=Math.round(e*t),i=Math.round(s*t);return l*i>0x9ec290?(l=Math.floor(e*t),i=Math.floor(s*t)):l*i<4e6&&(l=Math.ceil(e*t),i=Math.ceil(s*t)),{width:l,height:i}}function il(e){let{resolutionTier:s,orientation:a,aspectRatio:l,width:n,height:r,onResolutionTierChange:d,onOrientationChange:c,onAspectRatioChange:o,onWidthChange:m,onHeightChange:x}=e,u=n*r,h=u>=4e6&&u<=0x9ec290,[p,g]=(0,i.useState)(String(n)),[j,f]=(0,i.useState)(String(r)),[v,N]=(0,i.useState)(!1),[b,y]=(0,i.useState)(!1);(0,i.useEffect)(()=>{v||g(String(n))},[n,v]),(0,i.useEffect)(()=>{b||f(String(r))},[r,b]);let w=()=>{let e=parseInt(p,10);isNaN(e)?g(String(n)):m(Math.max(is,Math.min(5120,e))),N(!1)},S=()=>{let e=parseInt(j,10);isNaN(e)?f(String(r)):x(Math.max(is,Math.min(5120,e))),y(!1)},C=(e,s,a)=>{let t=ie[e][s];"portrait"===a&&"1:1"!==e?(m(t.h),x(t.w)):(m(t.w),x(t.h))};return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:s,onValueChange:e=>{e&&(d(e),C(l,e,a))},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"2K",className:"flex-1",children:"2K"}),(0,t.jsx)(eG,{value:"3K",className:"flex-1",children:"3K"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Orientation"}),(0,t.jsxs)(eM,{type:"single",value:"1:1"===l?"landscape":a,onValueChange:e=>{e&&(c(e),m(r),x(n))},className:"w-full grid grid-cols-2 gap-2",disabled:"1:1"===l,children:[(0,t.jsx)(eG,{value:"landscape",className:"flex-1",children:"Landscape"}),(0,t.jsx)(eG,{value:"portrait",className:"flex-1",children:"Portrait"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(eM,{type:"single",value:l,onValueChange:e=>{if(!e)return;o(e);let t="1:1"===e?"landscape":a;"1:1"===e&&c("landscape"),C(e,s,t)},className:"w-full grid grid-cols-5 gap-2",children:[(0,t.jsx)(eG,{value:"1:1",className:"flex-1",children:"1:1"}),(0,t.jsx)(eG,{value:"4:3",className:"flex-1",children:"4:3"}),(0,t.jsx)(eG,{value:"16:9",className:"flex-1",children:"16:9"}),(0,t.jsx)(eG,{value:"3:2",className:"flex-1",children:"3:2"}),(0,t.jsx)(eG,{value:"21:9",className:"flex-1",children:"21:9"})]})]}),(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium shrink-0",children:"W"}),(0,t.jsx)(sm.A,{value:[n],onValueChange:e=>{let[s]=e;return m(s)},min:is,max:5120,step:1,className:"flex-1"}),(0,t.jsx)(e6.p,{type:"number",value:p,onChange:e=>g(e.target.value),onFocus:()=>N(!0),onBlur:w,onKeyDown:e=>{"Enter"===e.key&&w()},className:"w-20 h-7 text-xs text-center tabular-nums"})]})}),(0,t.jsx)("div",{className:"space-y-1.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium shrink-0",children:"H"}),(0,t.jsx)(sm.A,{value:[r],onValueChange:e=>{let[s]=e;return x(s)},min:is,max:5120,step:1,className:"flex-1"}),(0,t.jsx)(e6.p,{type:"number",value:j,onChange:e=>f(e.target.value),onFocus:()=>y(!0),onBlur:S,onKeyDown:e=>{"Enter"===e.key&&S()},className:"w-20 h-7 text-xs text-center tabular-nums"})]})}),(0,t.jsxs)("p",{className:"text-xs ".concat(h?"text-muted-foreground":"text-destructive"),children:[n," \xd7 ",r," \xb7 ",(u/1e6).toFixed(1)," MP",!h&&(u<4e6?" â Below minimum (4.0 MP)":" â Exceeds maximum (10.4 MP)"),h&&" \xb7 11 credits"]})]})}function ii(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("2K"),[r,d]=(0,i.useState)("landscape"),[c,o]=(0,i.useState)("1:1"),[m,x]=(0,i.useState)(2048),[u,g]=(0,i.useState)(2048),{status:f}=(0,X.wV)(),{requireAuth:v,setError:N}=en(),b=ed(j.F.seedreamV5Lite.create);(0,i.useEffect)(()=>{"unauthenticated"===f&&s("A serene mountain landscape at sunset, with vibrant orange and purple hues painting the sky, reflecting off a crystal-clear alpine lake surrounded by pine trees")},[f]);let y=(0,i.useCallback)(()=>
1{if(!v())return;if(!e.trim())return void N("Please enter a prompt");let s=it(m,u);b.mutate({modelType:"seedream-v5-lite",prompt:e,size:"".concat(s.width,"*").concat(s.height)})},[e,m,u,v,N,b]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Generate"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Seedream V5 Lite"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the image you want to create..."}),(0,t.jsx)(il,{resolutionTier:a,orientation:r,aspectRatio:c,width:m,height:u,onResolutionTierChange:l,onOrientationChange:d,onAspectRatioChange:o,onWidthChange:x,onHeightChange:g}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:y,disabled:!e.trim(),credits:11,isPending:b.isPending}),(0,t.jsx)(eZ,{cost:11,costDescription:" ".concat(11," credits (fixed price) ")})]})]})}function ir(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("2K"),[m,x]=(0,i.useState)("landscape"),[u,g]=(0,i.useState)("1:1"),[f,v]=(0,i.useState)(2048),[N,b]=(0,i.useState)(2048),[y,w]=(0,i.useState)(0),[S,C]=(0,i.useState)(0),[P,A]=(0,i.useState)(!1),{data:E,status:R}=(0,X.wV)(),{requireAuth:F,setError:k}=en(),I=ed(j.F.seedreamV5Lite.create);(0,i.useEffect)(()=>{"unauthenticated"===R&&d("Transform this image into a vibrant watercolor painting style with soft, flowing colors and artistic brush strokes")},[R]);let U=(0,i.useCallback)(e=>{if(!e){w(0),C(0),o("2K"),x("landscape"),g("1:1"),v(2048),b(2048),A(!1);return}A(!0);let s=new Image;s.onload=()=>{var e,a;URL.revokeObjectURL(s.src);let{width:t,height:l}=s;w(t),C(l),A(!1);let i=Math.max(t/l,l/t);if(i>16){Q.oR.error("Image aspect ratio (".concat(i.toFixed(1),":1) exceeds maximum allowed (16:1). Please use an image with more balanced dimensions.")),w(0),C(0);return}let{ratio:n,orientation:r}=function(e,s){let a=s>e,t=a?s/e:e/s,l="1:1",i=1/0;for(let[e,{w:s,h:a}]of Object.entries(l7)){let n=Math.abs(t-s/a);n<i&&(i=n,l=e)}return{ratio:l,orientation:a?"portrait":"landscape"}}(t,l),d=it(t,l),c=(e=n,Math.abs((a=d.width*d.height)-ia(e,"2K"))<=Math.abs(a-ia(e,"3K"))?"2K":"3K");g(n),x(r),v(d.width),b(d.height),o(c);let m=t*l;m<4e6||m>0x9ec290?Q.oR.info("Image ".concat(t,"\xd7").concat(l," adjusted to ").concat(d.width,"\xd7").concat(d.height," (pixel range constraint)")):Q.oR.success("Detected: ".concat(t,"\xd7").concat(l," â ").concat(n," ").concat(r))},s.onerror=()=>{URL.revokeObjectURL(s.src),Q.oR.error("Failed to detect image dimensions."),w(0),C(0),A(!1)},s.src=URL.createObjectURL(e)},[]),V=(0,i.useCallback)(()=>{if(!F())return;if(!r.trim())return void k("Please enter a prompt");if(0===e.length)return void k("Please upload at least one reference image");let s=it(f,N);I.mutate({modelType:"seedream-v5-lite/edit",prompt:r,images:e,size:"".concat(s.width,"*").concat(s.height)})},[e,r,f,N,F,k,I]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Edit"}),(0,t.jsx)(h.BT,{children:"Transform images with AI guidance"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Seedream V5 Lite"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to transform the image..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Image"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-".concat(10," images to transform"),supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:10,onFirstFileChange:U,onUrlsChange:E?s:void 0,onUploadingChange:l}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:[e.length>0?"".concat(e.length," image").concat(e.length>
11?"s":""," selected"):"Click or drag images to upload",P&&e.length>0&&(0,t.jsxs)("span",{className:"ml-2 flex items-center gap-1",children:[(0,t.jsx)(ex.A,{className:"h-3 w-3 animate-spin"}),"Detecting image size..."]}),y>0&&S>0&&(0,t.jsxs)("span",{className:"ml-2",children:["⢠Source: ",y,"\xd7",S]})]})]}),(0,t.jsx)(il,{resolutionTier:c,orientation:m,aspectRatio:u,width:f,height:N,onResolutionTierChange:o,onOrientationChange:x,onAspectRatioChange:g,onWidthChange:v,onHeightChange:b}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:V,disabled:a||!r.trim(),credits:11,isPending:I.isPending}),(0,t.jsx)(eZ,{cost:11,costDescription:" ".concat(11," credits (fixed price) ")})]})]})}let id=eP.LD["seedream-v5-lite"],ic=["generate","edit"],io={"1k":14,"2k":27};function im(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=Math.max(s-1,0);return io[e]+ +a}let ix=[{value:"1k",label:"1K",hint:"Fast \xb7 social ready"},{value:"2k",label:"2K",hint:"High detail \xb7 print"}];function iu(e){let{value:s,onChange:a}=e;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsx)(eM,{type:"single",value:s,onValueChange:e=>{("1k"===e||"2k"===e)&&a(e)},className:"w-full grid grid-cols-2 gap-2",children:ix.map(e=>(0,t.jsxs)(eG,{value:e.value,"aria-label":"".concat(e.label," â ").concat(io[e.value]," credits"),className:"flex h-auto flex-col items-center gap-0.5 rounded-md border border-input py-2.5 data-[state=on]:border-primary",children:[(0,t.jsxs)("span",{className:"text-sm font-semibold",children:[e.label,(0,t.jsxs)("span",{className:"ml-2 font-normal text-muted-foreground",children:[io[e.value]," credits"]})]}),(0,t.jsx)("span",{className:"text-[11px] leading-tight text-muted-foreground",children:e.hint})]},e.value))})]})}let ih=[["16:9","9:16"],["4:3","3:4"],["3:2","2:3"],["5:4","4:5"],["2:1","1:2"],["21:9","9:21"],["3:1","1:3"]],ip=ih.map(e=>e[0]),ig=ih.map(e=>e[1]);function ij(e){let{ratio:s}=e,[a,l]=s.split(":").map(Number),i=a/l,n=i>=1?18:Math.max(18*i,5),r=i>=1?Math.max(18/i,5):18;return(0,t.jsx)("span",{className:"flex h-[18px] w-[18px] items-center justify-center",children:(0,t.jsx)("span",{className:"rounded-[2px] border-[1.5px] border-current",style:{width:n,height:r}})})}function iv(e){let{value:s,onChange:a,allowAuto:l}=e,i=e=>(0,b.cn)("flex min-h-[48px] flex-col items-center justify-center gap-1 rounded-md border text-xs transition-colors",e?"border-primary bg-primary/10 text-primary":"border-input text-muted-foreground hover:border-muted-foreground/50 hover:text-foreground"),n=e=>(0,t.jsxs)("button",{type:"button",onClick:()=>a(e),"aria-pressed":s===e,className:i(s===e),children:[(0,t.jsx)(ij,{ratio:e}),e]},e),r=l&&(0,t.jsxs)("button",{type:"button",onClick:()=>a("auto"),"aria-pressed":"auto"===s,className:(0,b.cn)(i("auto"===s),"w-full","auto"!==s&&"border-dashed"),children:[(0,t.jsx)("span",{className:"text-sm leading-none",children:"â¨"}),"Auto"]}),d=(0,t.jsxs)("button",{type:"button",onClick:()=>a("1:1"),"aria-pressed":"1:1"===s,className:(0,b.cn)(i("1:1"===s),"w-full"),children:[(0,t.jsx)(ij,{ratio:"1:1"}),"1:1"]});return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)("div",{className:(0,b.cn)("hidden sm:grid grid-rows-2 gap-1.5",l?"grid-cols-9":"grid-cols-8"),children:[l&&(0,t.jsx)("div",{className:"row-span-2 flex items-center",children:r}),(0,t.jsx)("div",{className:"row-span-2 flex items-center",children:d}),ip.map(n),ig.map(n)]}),(0,t.jsxs)("div",{className:"space-y-2 sm:hidden",children:[(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-1.5",children:[l&&r,d]}),(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Landscape"}),(0,t.jsx)("div",{className:"grid grid-cols-4 gap-1.5",children:ip.map(n)}),(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Portrait"}),(0,t.jsx)("div",{className:"grid grid-cols-4 gap-1.5",children:ig.map(n)})]}),l&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Auto matches the shape of your first reference image."})]})}function iN(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)("1:1"),[r,d]=(0,i.useState)("1k"),{status:c}
1=(0,X.wV)(),{requireAuth:o,setError:m}=en(),x=im(r),u=ed(j.F.seedreamV5Pro.create);(0,i.useEffect)(()=>{"unauthenticated"===c&&s("A serene mountain landscape at sunset, with vibrant orange and purple hues painting the sky, reflecting off a crystal-clear alpine lake surrounded by pine trees")},[c]);let g=(0,i.useCallback)(()=>{if(o()){if(!e.trim())return void m("Please enter a prompt");u.mutate({modelType:"seedream-v5-pro",prompt:e,aspect_ratio:"auto"===a?void 0:a,resolution:r})}},[e,a,r,o,m,u]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Generate"}),(0,t.jsx)(h.BT,{children:"Create images from text descriptions"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Seedream V5 Pro"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the image you want to create..."}),(0,t.jsx)(iv,{value:a,onChange:l}),(0,t.jsx)(iu,{value:r,onChange:d}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:g,disabled:!e.trim(),credits:x,isPending:u.isPending}),(0,t.jsx)(eZ,{cost:x,costDescription:" ".concat(x," credits (").concat(r.toUpperCase(),") ")})]})]})}function ib(){let[e,s]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(""),[c,o]=(0,i.useState)("auto"),[m,x]=(0,i.useState)("1k"),{data:u,status:g}=(0,X.wV)(),{requireAuth:f,setError:v}=en(),N=im(m,e.length),b=ed(j.F.seedreamV5Pro.create);(0,i.useEffect)(()=>{"unauthenticated"===g&&d("Transform this image into a vibrant watercolor painting style with soft, flowing colors and artistic brush strokes")},[g]);let y=(0,i.useCallback)(()=>{if(f()){if(!r.trim())return void v("Please enter a prompt");if(0===e.length)return void v("Please upload at least one reference image");b.mutate({modelType:"seedream-v5-pro/edit",prompt:r,images:e,aspect_ratio:"auto"===c?void 0:c,resolution:m})}},[e,r,c,m,f,v,b]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(n.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(h.ZB,{children:"Edit"}),(0,t.jsx)(h.BT,{children:"Edit with up to 10 reference images"})]}),(0,t.jsx)(p.E,{variant:"outline",children:"Seedream V5 Pro"})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:r,onChange:d,placeholder:"Describe how you want to transform the image..."}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"default",className:"text-xs",children:"Required"})]}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload 1-".concat(10," reference images"),supportedFormats:"PNG, JPG, WEBP supported (max 10MB each)",maxFiles:10,onUrlsChange:u?s:void 0,onUploadingChange:l}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:[e.length>0?"".concat(e.length," image").concat(e.length>1?"s":""," selected"):"Click or drag images to upload",e.length>1&&(0,t.jsx)("span",{className:"ml-2",children:"⢠Extra references add 1 credit each"})]})]}),(0,t.jsx)(iv,{value:c,onChange:o,allowAuto:!0}),(0,t.jsx)(iu,{value:m,onChange:x}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:y,disabled:a||!r.trim(),credits:N,isPending:b.isPending}),(0,t.jsx)(eZ,{cost:N,costDescription:" ".concat(N," credits (").concat(m.toUpperCase()).concat(e.length>1?", ".concat(e.length," refs"):"",") ")})]})]})}let iy=eP.LD["seedream-v5-pro"],iw=["generate","edit"],iS={"480p":{base:24,withVideo:15},"720p":{base:52,withVideo:31},"1080p":{base:130,withVideo:78}};function iC(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)([]),[r,d]=(0,i.useState)(null),[c,o]=(0,i.useState)(null),[x,u]=(0,i.useState)([]),[g,f]=(0,i.useState)([]),[v,N]=(0,i.useState)([]),[b,y]=(0,i.useState)(0),[w,S]=(0,i.useState)(null),[C,P]=(0,i.useState)("720p"),[A,E]=(0,i.useState)("16:9"),[R,k]=(0,i.useState)(5),[I,U]=(0,i.useState)(!0),[V,T]=(0,i.useState)(!1),[B,M]=(0,i.useState)(!1),[G,D]=(0,i.useState)(!1),[O,W]=(0,i.useState)(!1),[J,Z]=(0,i.useState)(!1),[_,L]=(0,i.useState)(!1),{data:q,status:K}=(0,X.wV)(),{requireAuth:z,setError:H}=en(),$=ed(j.F.seedance2.create);(0,i.useEffect)(()=>{"unauthenticated"===K&&s("A cinematic drone shot glides over a neon-lit city at dusk, revealing towering skyscrapers and glowing streets below, with warm orange and blue light reflecting off glass surfaces.")},[K]),(0,i.useEffect)(()=>
1{if(0===v.length){y(0),S(null);return}let e=!1,s=[];return Promise.all(v.map(e=>new Promise((a,t)=>{let l=document.createElement("video"),i=URL.createObjectURL(e);s.push(i),l.preload="metadata",l.onloadedmetadata=()=>a(l.duration),l.onerror=()=>t(Error("Invalid video file")),l.src=i}))).then(s=>{if(e)return;let a=s.reduce((e,s)=>e+s,0);if(y(a),a>15){let e="Reference videos are too long. Maximum total reference video length is ".concat(15," seconds.");S(e),Q.oR.error(e)}else S(null)}).catch(()=>{if(e)return;let s="Invalid video file. Please upload a valid video.";y(0),S(s),Q.oR.error(s)}),()=>{e=!0,s.forEach(e=>URL.revokeObjectURL(e))}},[v]);let Y=x.length>0,ee=Number(!!r)+Number(!!c),es=iS[C],ea=Y?Math.ceil(es.withVideo*(b+R)):Math.ceil(es.base*R),et=(0,i.useCallback)(()=>{if(!z())return;if(!e.trim()&&0===a.length&&!r&&!c&&0===x.length&&0===g.length)return void H("Please enter a prompt or upload at least one reference file.");if(c&&!r)return void H("Please upload a first frame before using a last frame.");if(w||b>15)return void H(w||"Reference videos are too long. Maximum total reference video length is ".concat(15," seconds."));let s={resolution:C,aspect_ratio:A,duration:R,generate_audio:I,web_search:V};e.trim()&&(s.prompt=e.trim()),a.length>0&&(s.reference_image_urls=a),r&&(s.first_frame_url=r),c&&(s.last_frame_url=c),x.length>0&&(s.reference_video_urls=x),g.length>0&&(s.reference_audio_urls=g),$.mutate(s)},[z,e,a,r,c,x,g,C,A,R,I,V,b,w,H,$]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Seedance 2.0"}),(0,t.jsx)(h.BT,{children:"Generate cinematic videos with text, images, video, and audio references"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the scene, action, camera movement, and mood..."}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),a.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[a.length," uploaded"]})]}),(0,t.jsx)(se,{className:"pt-3",children:(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images to guide generation",supportedFormats:"JPEG, PNG, WEBP",maxFiles:9,onUrlsChange:q?l:void 0,onUploadingChange:M})})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Frame Images"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),ee>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[ee," uploaded"]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"First Frame"})}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:q?d:void 0,onUploadingChange:D})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Last Frame"})}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the last frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:q?o:void 0,onUploadingChange:W})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3",children:"Last frame requires a first frame."})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(eX.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Video"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),x.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[x.length," uploaded"]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"video",de
1scription:"Upload reference video (max 15s total)",supportedFormats:"MP4, MOV, MKV",maxFiles:3,onFilesChange:N,onUrlsChange:q?u:void 0,onUploadingChange:Z}),v.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Total reference video length: ",b.toFixed(1),"s / ",15,"s"]}),w&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:w})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(sc.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Audio"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),g.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[g.length," uploaded"]})]}),(0,t.jsx)(se,{className:"pt-3",children:(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload reference audio",supportedFormats:"MP3, WAV, AAC, OGG",maxFiles:3,onUrlsChange:q?f:void 0,onUploadingChange:L})})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:C,onValueChange:e=>{e&&P(e)},className:"w-full grid grid-cols-3 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p",className:"flex-1",children:"720p"}),(0,t.jsx)(eG,{value:"1080p","aria-label":"1080p",className:"flex-1",children:"1080p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(sv.l6,{value:A,onValueChange:e=>E(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[R,"s"]})]}),(0,t.jsx)(sm.A,{min:4,max:15,step:1,value:[R],onValueChange:e=>{let[s]=e;return k(s)}}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"4s"}),(0,t.jsx)("span",{children:"15s"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{htmlFor:"generate-audio",className:"text-sm font-medium",children:"Generate Audio"}),(0,t.jsx)(F,{id:"generate-audio",checked:I,onCheckedChange:U})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(eD.J,{htmlFor:"web-search",className:"text-sm font-medium",children:"Web Search"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Use online search to enhance generation"})]}),(0,t.jsx)(F,{id:"web-search",checked:V,onCheckedChange:T})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:et,disabled:B||G||O||J||_,credits:ea,isPending:$.isPending}),(0,t.jsx)(eZ,{cost:ea,costDescription:Y?"".concat(ea," credits (").concat(es.withVideo,"/s \xd7 ").concat(Math.ceil(b),"s input + ").concat(R,"s output)"):"".concat(ea," credits (").concat(es.base,"/s \xd7 ").concat(R,"s)")})]})]})}let iP=eP.LD["seedance-2"],iA={"480p":{base:19,withVideo:11},"720p":{base:41,withVideo:25}};function iE(){let[e,s]=(0,i.useState)(""),[a,l]=(0,i.useState)([]),[r,d]=(0,i.useState)(null),[c,o]=(0,i.useState)(null),[x,u]=(0,i.useState)([]),[g,f]=(0,i.useState)([]),[v,N]=(0,i.useState)([]),[b,y]=(0,i.useState)(0),[w,S]=(0,i.useState)(null),[C,P]=(0,i.useState)("720p"),[A,E]=(0,i.useState)("16:9"),[R,k]=(0,i.useState)(5),[I,U]=(0,i.useState)(!0),[V,T]=(0,i.useState)(!1),[B,M]=(0,i.useState)(!1),[G,D]=(0,i.useState)(!1),[O,W]=(0,i.useState)(!1),[J,Z]=(0,i.useState)(!1),[_,L]=(0,i.useState)(!1),{data:q,status:K}=(0,X.wV)(),{requireAuth:z,setError:H}=en(),$=ed(j.F.seedance2Fast.create);(0,i.useEffect)(()=>{"unauthenticated"===K&&s("A cinematic drone shot glides over a neon-lit city at dusk, revealing towering skyscrapers and glowing streets below, with warm orange and blue light reflecting off glass surfaces.")},[K]),(0,i.useEffect)(()=>
1{if(0===v.length){y(0),S(null);return}let e=!1,s=[];return Promise.all(v.map(e=>new Promise((a,t)=>{let l=document.createElement("video"),i=URL.createObjectURL(e);s.push(i),l.preload="metadata",l.onloadedmetadata=()=>a(l.duration),l.onerror=()=>t(Error("Invalid video file")),l.src=i}))).then(s=>{if(e)return;let a=s.reduce((e,s)=>e+s,0);if(y(a),a>15){let e="Reference videos are too long. Maximum total reference video length is ".concat(15," seconds.");S(e),Q.oR.error(e)}else S(null)}).catch(()=>{if(e)return;let s="Invalid video file. Please upload a valid video.";y(0),S(s),Q.oR.error(s)}),()=>{e=!0,s.forEach(e=>URL.revokeObjectURL(e))}},[v]);let Y=x.length>0,ee=Number(!!r)+Number(!!c),es=iA[C],ea=Y?Math.ceil(es.withVideo*(b+R)):Math.ceil(es.base*R),et=(0,i.useCallback)(()=>{if(!z())return;if(!e.trim()&&0===a.length&&!r&&!c&&0===x.length&&0===g.length)return void H("Please enter a prompt or upload at least one reference file.");if(c&&!r)return void H("Please upload a first frame before using a last frame.");if(w||b>15)return void H(w||"Reference videos are too long. Maximum total reference video length is ".concat(15," seconds."));let s={resolution:C,aspect_ratio:A,duration:R,generate_audio:I,web_search:V};e.trim()&&(s.prompt=e.trim()),a.length>0&&(s.reference_image_urls=a),r&&(s.first_frame_url=r),c&&(s.last_frame_url=c),x.length>0&&(s.reference_video_urls=x),g.length>0&&(s.reference_audio_urls=g),$.mutate(s)},[z,e,a,r,c,x,g,C,A,R,I,V,b,w,H,$]);return(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Seedance 2.0 Fast"}),(0,t.jsx)(h.BT,{children:"Generate fast cinematic videos with text, images, video, and audio references"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-6",children:[(0,t.jsx)(ep.PromptInput,{value:e,onChange:s,placeholder:"Describe the scene, action, camera movement, and mood..."}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Images"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),a.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[a.length," uploaded"]})]}),(0,t.jsx)(se,{className:"pt-3",children:(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload reference images to guide generation",supportedFormats:"JPEG, PNG, WEBP",maxFiles:9,onUrlsChange:q?l:void 0,onUploadingChange:M})})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Frame Images"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),ee>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[ee," uploaded"]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"First Frame"})}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the first frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:q?d:void 0,onUploadingChange:D})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,t.jsx)(eD.J,{className:"text-xs font-medium text-foreground",children:"Last Frame"})}),(0,t.jsx)(eu.FileUploadZone,{type:"image",description:"Upload the last frame",supportedFormats:"JPEG, PNG, WEBP",onUrlChange:q?o:void 0,onUploadingChange:W})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-3",children:"Last frame requires a first frame."})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(eX.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Video"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),x.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[x.length," uploaded"]})]}),(0,t.jsxs)(se,{className:"pt-3",children:[(0,t.jsx)(eu.FileUploadZone,{type:"video",de
1scription:"Upload reference video (max 15s total)",supportedFormats:"MP4, MOV, MKV",maxFiles:3,onFilesChange:N,onUrlsChange:q?u:void 0,onUploadingChange:Z}),v.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Total reference video length: ",b.toFixed(1),"s / ",15,"s"]}),w&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:w})]})]}),(0,t.jsxs)(e9,{children:[(0,t.jsxs)(e7,{className:"flex items-center gap-2 w-full group",children:[(0,t.jsx)(aK.A,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),(0,t.jsx)(sc.A,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(eD.J,{className:"text-sm font-medium cursor-pointer",children:"Reference Audio"}),(0,t.jsx)(p.E,{variant:"outline",className:"text-xs",children:"Optional"}),g.length>0&&(0,t.jsxs)(p.E,{variant:"secondary",className:"text-xs ml-auto",children:[g.length," uploaded"]})]}),(0,t.jsx)(se,{className:"pt-3",children:(0,t.jsx)(eu.FileUploadZone,{type:"audio",description:"Upload reference audio",supportedFormats:"MP3, WAV, AAC, OGG",maxFiles:3,onUrlsChange:q?f:void 0,onUploadingChange:L})})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Resolution"}),(0,t.jsxs)(eM,{type:"single",value:C,onValueChange:e=>{e&&P(e)},className:"w-full grid grid-cols-2 gap-2",children:[(0,t.jsx)(eG,{value:"480p","aria-label":"480p",className:"flex-1",children:"480p"}),(0,t.jsx)(eG,{value:"720p","aria-label":"720p",className:"flex-1",children:"720p"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Aspect Ratio"}),(0,t.jsxs)(sv.l6,{value:A,onValueChange:e=>E(e),children:[(0,t.jsx)(sv.bq,{className:"w-full",children:(0,t.jsx)(sv.yv,{placeholder:"Select aspect ratio"})}),(0,t.jsxs)(sv.gC,{children:[(0,t.jsx)(sv.eb,{value:"21:9",children:"21:9 (Ultra Wide)"}),(0,t.jsx)(sv.eb,{value:"16:9",children:"16:9 (Standard)"}),(0,t.jsx)(sv.eb,{value:"4:3",children:"4:3 (Classic)"}),(0,t.jsx)(sv.eb,{value:"1:1",children:"1:1 (Square)"}),(0,t.jsx)(sv.eb,{value:"3:4",children:"3:4 (Portrait)"}),(0,t.jsx)(sv.eb,{value:"9:16",children:"9:16 (Mobile)"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{className:"text-sm font-medium",children:"Duration"}),(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[R,"s"]})]}),(0,t.jsx)(sm.A,{min:4,max:15,step:1,value:[R],onValueChange:e=>{let[s]=e;return k(s)}}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:"4s"}),(0,t.jsx)("span",{children:"15s"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(eD.J,{htmlFor:"generate-audio",className:"text-sm font-medium",children:"Generate Audio"}),(0,t.jsx)(F,{id:"generate-audio",checked:I,onCheckedChange:U})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(eD.J,{htmlFor:"web-search",className:"text-sm font-medium",children:"Web Search"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Use online search to enhance generation"})]}),(0,t.jsx)(F,{id:"web-search",checked:V,onCheckedChange:T})]}),(0,t.jsx)(eH,{}),(0,t.jsx)(eQ,{onClick:et,disabled:B||G||O||J||_,credits:ea,isPending:$.isPending}),(0,t.jsx)(eZ,{cost:ea,costDescription:Y?"".concat(ea," credits (").concat(es.withVideo,"/s \xd7 ").concat(Math.ceil(b),"s input + ").concat(R,"s output)"):"".concat(ea," credits (").concat(es.base,"/s \xd7 ").concat(R,"s)")})]})]})}let iR=eP.LD["seedance-2-fast"],iF={[eP.$g.VEO3]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:eY,useStatusQuery:j.F.veo3.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/veo3-demo-video.mp4",guidelines:(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Production Guidelines"}),(0,t.jsx)(h.BT,{children:"Essential information for using Veo 3.1"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsxs)(g.Fc,{className:"border-blue-500/50 bg-blue-500/10",children:[(0,t.jsx)(x.A,{className:"h-4 w-4 text-blue-600"}),(0,t.jsxs)(g.TN,{className:"text-sm text-blue-900 dark:text-blue-100",children:[(0,t.jsx)("span",{className:"font-semibold",children:"New to Veo 3.1?"})," ","Check out the"," ",(0,t.jsxs)("a",{href:"https://deepmind.google/models/veo/prompt-guide/",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium hover:text-blue-950 dar
1k:hover:text-blue-50 inline-flex items-center gap-1",children:["official prompting guide",(0,t.jsx)(u.A,{className:"h-3 w-3"})]})," ","for tips and best practices."]})]}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Quality Modes"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Choose between Fast mode (50 credits) for quick results or Quality mode (200 credits) for enhanced video quality. Both modes support text-to-video and image-to-video generation."})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Frame Image Guidance"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Optionally upload 1-2 images to guide generation. Use the first frame to set the opening scene, the last frame to define the ending, or both for complete control over the video's visual journey."})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Content Moderation Notice"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsx)("p",{children:"Veo 3.1 has content filters that may reject certain prompts. Failed generations don't cost credits but take time."})})]})]})}),(0,t.jsx)("div",{className:"pt-2 border-t",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCA1 ",(0,t.jsx)("span",{className:"font-medium",children:"Pro tip:"})," For best results, provide detailed prompts describing camera movements, lighting, style, and mood. Combine with frame images for precise creative control."]})})]})]}),children:(0,t.jsx)(e$,{})})},[eP.$g.WAN22]:function(){let[e,s]=(0,i.useState)("text-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:si,useStatusQuery:j.F.wan22.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/wan22/demo-video.mp4",children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(sa,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(sl,{})})]})})},[eP.$g.WAN22_SPICY]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:sd,useStatusQuery:j.F.wan22Spicy.get
1Status.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/wan22-spicy/demo-video.mp4",guidelines:(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(sn.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Why Choose Wan 2.2 Spicy Over Grok Imagine?"}),(0,t.jsx)(h.BT,{children:"Flexible AI video generation"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Affordable Grok Alternative"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"font-medium text-green-600 dark:text-green-400",children:"Lower Costs:"})," Wan 2.2 Spicy offers a cost-effective solution, costing only for the credits spent for the content you create. You only pay for what you need."]})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"High Dynamics & Smooth Motion"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"font-medium",children:"Features:"})," Enhanced for vivid, dynamic video generation with smooth camera movements and high-energy motion."]})})]})]})}),(0,t.jsx)("div",{className:"pt-2 border-t",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCA1 ",(0,t.jsx)("span",{className:"font-medium",children:"Pro tip:"})," Provide detailed prompts with scene descriptions, and lighting specifications for optimal high dynamics and smooth motion results. Wan 2.2 Spicy excels at transforming static images into vivid, cinematic videos."]})})]})]}),children:(0,t.jsx)(sr,{})})},[eP.$g.WAN25]:function(){let[e,s]=(0,i.useState)("text-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:sg,useStatusQuery:j.F.wan25.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/wan25-demo-video.mp4",children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsxs)(e4,{value:"video-extend",className:"flex items-center gap-2 w-full rounded-t-none",children:[(0,t.jsx)(d.A,{className:"w-4 h-4"}),"Video Extend"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(so,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(su,{})}),(0,t.jsx)(e3,{value:"video-extend",className:"mt-6",children:(0,t.jsx)(sp,{})})]})})},[eP.$g.WAN25_IMAGE]:function(){let[e,s]=(0,i.useState)("text");return(0,t.jsx)(eI,{config:{modelIdentifiers:sy,useStatusQuery:j.F.wan25Image.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/wan2-5-image-demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Wan 2.5 Image effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Professional image generation by Alibaba Cloud"}),(0,t.jsx)("li",{children:"Text to Image: 768-1440px resolution, customizable"}),(0,t.jsx)("li",{children:"Image Edit: Auto-sized output (1 image: matches input ratio; 2 images: 1280\xd71280)"}),(0,t.jsx)("li",{children:"Fixed 10 credits for both modes"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:"Include details about style, lighting, and mood"}),(0,t.jsx)("li",{children:"For Edit mode, use high-quality reference images"}),(0,t.jsx)("li",{children:"Use negative prompts to avoid unwanted elements"}),(0,t.jsx)("li",{children:"Generation typically takes 30-90 seconds"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Text to Image"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image Edit"]})]}),(0,t.jsx)(e3,{value:"text",className:"mt-6",children:(0,t.jsx)(sN,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(sb,{})})]})})}
1,[eP.$g.WAN26]:function(){let[e,s]=(0,i.useState)("text-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:sP,useStatusQuery:j.F.wan26.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/wan26-demo-video.mp4",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Wan 2.6"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsx)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("li",{children:"Support 720P/1080P"})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsxs)("li",{children:["Official prompt guide: ",(0,t.jsx)("a",{href:"https://alidocs.dingtalk.com/i/nodes/EpGBa2Lm8aZxe5myC99MelA2WgN7R35y",target:"_blank",className:"text-primary underline",children:" click here "})]}),(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:"Include details about style, lighting, and mood"}),(0,t.jsx)("li",{children:"Use negative prompts to avoid unwanted elements"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsxs)(e4,{value:"reference-to-video",className:"flex items-center gap-2 w-full rounded-t-none",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Reference to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(sw,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(sS,{})}),(0,t.jsx)(e3,{value:"reference-to-video",className:"mt-6",children:(0,t.jsx)(sC,{})})]})})},[eP.$g.WAN27]:function(){let[e,s]=(0,i.useState)("text-to-video"),{pendingTab:a,clearPendingTab:l}=O();return(0,i.useEffect)(()=>{a&&sV.includes(a)&&(s(a),l())},[a,l]),(0,t.jsx)(eI,{config:{modelIdentifiers:sU,useStatusQuery:j.F.wan27.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/wan-27-demo-video.webm",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Wan 2.7"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Support 720P/1080P"}),(0,t.jsx)("li",{children:"Text-to-Video with 5 aspect ratios"}),(0,t.jsx)("li",{children:"Image-to-Video with first/last frame c
1ontrol"}),(0,t.jsx)("li",{children:"Video Extend (5-15s output)"}),(0,t.jsx)("li",{children:"Video Edit with reference images"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:"Include details about style, lighting, and mood"}),(0,t.jsx)("li",{children:"Use negative prompts to avoid unwanted elements"}),(0,t.jsx)("li",{children:"For Video Edit, upload reference images to guide style"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"video-extend",className:"flex items-center gap-2 w-full rounded-t-none rounded-br-none",children:[(0,t.jsx)(sA.A,{className:"w-4 h-4"}),"Video Extend"]}),(0,t.jsxs)(e4,{value:"video-edit",className:"flex items-center gap-2 w-full rounded-t-none rounded-bl-none",children:[(0,t.jsx)(sE.A,{className:"w-4 h-4"}),"Video Edit"]})]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(sR,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(sF,{})}),(0,t.jsx)(e3,{value:"video-extend",className:"mt-6",children:(0,t.jsx)(sk,{})}),(0,t.jsx)(e3,{value:"video-edit",className:"mt-6",children:(0,t.jsx)(sI,{})})]})})},[eP.$g.WAN27_IMAGE]:function(){let[e,s]=(0,i.useState)("text");return(0,t.jsx)(eI,{config:{modelIdentifiers:s_,useStatusQuery:j.F.wan27Image.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/wan-27-image-demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Wan 2.7 Image effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Latest Wan AI image model by Alibaba Cloud"}),(0,t.jsx)("li",{children:"Thinking Mode for enhanced reasoning and quality"}),(0,t.jsx)("li",{children:"Standard (9 credits): fast generation, up to 2K resolution"}),(0,t.jsx)("li",{children:"Pro (23 credits): best quality, up to 4K resolution"}),(0,t.jsx)("li",{children:"Image Edit: supports up to 9 reference images"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Turn on Thinking Mode for better quality. But may result in stricter content filtering."}),(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:"Use Pro quality for high-resolution outputs"}),(0,t.jsx)("li",{children:"For Image Edit, use high-quality reference images"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Text to Image"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image Edit"]})]}),(0,t.jsx)(e3,{value:"text",className:"mt-6",children:(0,t.jsx)(sO,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(sZ,{})})]})})},[eP.$g.QWEN_IMAGE]:function(){let[e,s]=(0,i.useState)("multi-angle");return(0,t.jsx)(eI,{config:{modelIdentifiers:sX,useStatusQuery:j.F.qwenImage.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/qwen-image-demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Qwen Image effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Text to Image: High-quality generation with 1K resolution (8 credits)"}),(0,t.jsx)("li",{children:"Edit Plus: Multi-image editing supporting 1-3 images (8 credits)"}),(0,t.jsx)("li",{children:"Multi-Angle: Generate camera angles from 1-3 images (10 credits)"}),(0,t.jsx)("li",{children:"Generation typically takes 30-90 seconds"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:'Try adding "Ultra Detailed, Realistic lighting, 4K UHD" to obtain better image quality'}),(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:"Include details about style, lighting, and mood"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Text to Image"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image Edit"]})]}),(0,t.jsxs)(e4,{value:"multi-angle",className:"flex items-center gap-2 w-full rounded-t-none",children:[(0,t.jsx)(sL.A,{className:"w-4 h-4"}),"Multi-Angle"]})]}),(0,t.jsx)(e3,{value:"text",className:"mt-6",children:(0,t.jsx)(sq,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(sK,{})}),(0,t.jsx)(e3,{value:"multi-angle",className:"mt-6",children:(0,t.jsx)(sY,{})})]})})},[eP.$g.QWEN_IMAGE_2]:function(){let[e,s]=(0,i.useState)("text");return(0,t.jsx)(eI,{config:{modelIdentifiers:s2,useStatusQuery:j.F.qwenImage2.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/qwen-image-2-example.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Qwen Image 2.0 effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Text to Image: Enhanced quality generation up to 2K resolution (9 credits)"}),(0,t.jsx)("li",{children:"Image Edit: Multi-image editing supporting 1-3 images (9 credits)"}),(0,t.jsx)("li",{children:"Generation typically takes 30-90 seconds"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:'Try adding "Ultra Detailed, Realistic lighting, 4K UHD" to obtain better image quality'}),(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:"Include details about style, lighting, and mood"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsx)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Text to Image"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image Edit"]})]})}),(0,t.jsx)(e3,{value:"text",className:"mt-6",children:(0,t.jsx)(s0,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(s1,{})})]})})},[eP.$g.QWEN_IMAGE_2_PRO]:function(){let[e,s]=(0,i.useState)("text");return(0,t.jsx)(eI,{config:{modelIdentifiers:s5,useStatusQuery:j.F.qwenImage2Pro.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/qwen-image-2-example.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Qwen Image 2.0 Pro effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Text to Image: Superior quality generation up to 2K resolution (21 credits)"}),(0,t.jsx)("li",{children:"Image Edit: Multi-image editing supporting 1-3 images (21 credits)"}),(0,t.jsx)("li",{children:"Generation typically takes 30-90 seconds"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:'Try adding "Ultra Detailed, Realistic lighting, 4K UHD" to obtain better image quality'}),(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:"Include details about style, lighting, and mood"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsx)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Text to Image"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image Edit"]})]})}),(0,t.jsx)(e3,{value:"text",className:"mt-6",children:(0,t.jsx)(s4,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(s3,{})})]})})},[eP.$g.QWEN_IMAGE_3]:function(){return(0,t.jsx)(an,{tier:"standard",modelId:eP.$g.QWEN_IMAGE_3,createProcedure:j.F.qwenImage3.create,useStatusQuery:j.F.qwenImage3.getStatus.useQuery,demoUrl:"https://assets.sora2.center/sora-model-intro/qwen-image-3-demo.webp"})},[eP.$g.QWEN_IMAGE_3_PRO]:function(){return(0,t.jsx)(an,{tier:"pro",modelId:eP.$g.QWEN_IMAGE_3_PRO,createProcedure:j.F.qwenImage3Pro.create,useStatusQuery:j.F.qwenImage3Pro.getStatus.useQuery,demoUrl:"https://assets.sora2.center/sora-model-intro/qwen-image-3-demo.webp"})},[eP.$g.WAN22_ANIMATE]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:ad,use
1StatusQuery:j.F.wan22Animate.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/wan-animate-demo-video.mp4",children:(0,t.jsx)(ar,{})})},[eP.$g.SEEDREAM_V4]:function(){let[e,s]=(0,i.useState)("generate");return(0,t.jsx)(eI,{config:{modelIdentifiers:au,useStatusQuery:j.F.seedreamV4.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedream-v4-demo.png",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Seedream-v4 effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"State-of-art image generation by ByteDance"}),(0,t.jsx)("li",{children:"Support up to 4K resolution (4096\xd74096)"}),(0,t.jsx)("li",{children:"Fixed 8 credits for any resolution"}),(0,t.jsx)("li",{children:"Both Generate and Edit modes"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:"Include details about style, lighting, and composition"}),(0,t.jsx)("li",{children:"For Edit mode, use high-quality reference images"}),(0,t.jsx)("li",{children:"Generation typically takes 30-60 seconds"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"generate",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Generate"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Edit"]})]}),(0,t.jsx)(e3,{value:"generate",className:"mt-6",children:(0,t.jsx)(am,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(ax,{})})]})})},[eP.$g.SEEDREAM_V45]:function(){let[e,s]=(0,i.useState)("edit");return(0,t.jsx)(eI,{config:{modelIdentifiers:ag,useStatusQuery:j.F.seedreamV45.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedream-4-5-demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Seedream 4.5 effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"ByteDance's latest image generation model"}),(0,t.jsx)("li",{children:"Typography optimized with clear text rendering"}),(0,t.jsx)("li",{children:"Support up to 4K resolution (4096\xd74096)"}),(0,t.jsx)("li",{children:"Fixed 12 credits for any resolution"}),(0,t.jsx)("li",{children:"Both Generate and Edit modes"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:"Include details about style, lighting, and composition"}),(0,t.jsx)("li",{children:"For Edit mode, use high-quality reference images"}),(0,t.jsx)("li",{children:"Ideal for posters, brand visuals, and e-commerce"}),(0,t.jsx)("li",{children:"Generation typically takes 30-60 seconds"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"generate",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Generate"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Edit"]})]}),(0,t.jsx)(e3,{value:"generate",className:"mt-6",children:(0,t.jsx)(ah,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(ap,{})})]})})},[eP.$g.NANO_BANANA]:function(){let[e,s]=(0,i.useState)("text");return(0,t.jsx)(eI,{config:{modelIdentifiers:ay,useStatusQuery:j.F.nanoBanana.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/nano-banana-demo.jpg",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Nano Banana effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Highlights"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsx)("p",{children:"Gemini 2.5 Flash Image (Nano Banana) provides fast responding image generation and editing capabilities. Editing mode support up to 10 reference images. Multiple aspect ratios are supported to fit various use cases."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Effective Prompts"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Include subject, environment, lighting, and style cues"}),(0,t.jsx)("li",{children:"For edits, describe the desired transformation clearly"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Notice of Content Filter"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsx)("p",{children:"Nano Banana has a content filter embedded inside. Please ensure your prompts comply with Google's Safety Guidelines. If an error occurs, review your prompt for restricted content, adjust it, and try again."})})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Generate"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Edit"]})]}),(0,t.jsx)(e3,{value:"text",className:"mt-6",children:(0,t.jsx)(af,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(ab,{})})]})})},[eP.$g.VIDEO_UPSCALER]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:aC,useStatusQuery:j.F.videoUpscaler.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/video-upscaler-demo.mp4",children:(0,t.jsx)(aS,{})})},[eP.$g.FLUX_KONTEXT]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:aE,useStatusQuery:j.F.fluxKontext.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/flux-kontext-demo.jpg",guidelines:(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Production Guidelines"}),(0,t.jsx)(h.BT,{children:"Essential information for using Flux1-Kontext"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Options"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Choose between Pro mode (8 credits) for standard quality or Max mode (15 credits) for maximum quality and detail. Both modes support text-to-image and image editing. Optionally upload an image to use editing mode."})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Aspect Ratio Options"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Select from various aspect ratios (21:9, 16:9, 4:3, 1:1, 3:4, 9:16) to fit your creative needs, from ultra-wide cinematic shots to portrait-oriented images."})]})]})}),(0,t.jsx)("div",{className:"pt-2 border-t",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCA1 ",(0,t.jsx)("span",{className:"font-medium",children:"Pro tip:"})," Flux1-Kontext excels at understanding complex, detailed prompts. Be specific about style, lighting, composition, and subject details for best results."]})})]})]}),children:(0,t.jsx)(aA,{})})},[eP.$g.FLUX_2]:function(){let[e,s]=(0,i.useState)("text");return(0,t.jsx)(eI,{config:{modelIdentifiers:aU,useStatusQuery:j.F.flux2.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/flux-2-demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Flux-2 effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Quality Levels"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Klein 4B: Fast, 3/4 credits (text/edit)"}),(0,t.jsx)("li",{children:"Klein 9B: Balanced, 3/5 credits (text/edit)"}),(0,t.jsx)("li",{children:"Dev: Fast generation, 4/8 credits (text/edit)"}),(0,t.jsx)("li",{children:"Pro: Balanced quality, 9/18 credits (text/edit)"}),(0,t.jsx)("li",{children:"Flex: Best quality, 18/36 credits (text/edit)"}),(0,t.jsx)("li",{children:"Max: Premium quality, 9/18 credits (text/edit)"}),(0,t.jsx)("li",{children:"Support 256\xd7256 to 1536\xd71536 resolution"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Edit Mode Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Support
11-3 reference images for editing"}),(0,t.jsx)("li",{children:"Auto-adjust image size to 256-1536 range"}),(0,t.jsx)("li",{children:"Precise control with natural language prompts"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Be specific and descriptive in your prompts"}),(0,t.jsx)("li",{children:'Use quality keywords like "detailed", "realistic", "4K"'}),(0,t.jsx)("li",{children:"For edit mode, provide clear editing instructions"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Text to Image"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image Edit"]})]}),(0,t.jsx)(e3,{value:"text",className:"mt-6",children:(0,t.jsx)(aF,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(aI,{})})]})})},[eP.$g.HAILUO23]:function(){let[e,s]=(0,i.useState)("image-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:aD,useStatusQuery:j.F.hailuo23.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/hailuo2-3-benefit-1.mp4",guidelines:(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Production Guidelines"}),(0,t.jsx)(h.BT,{children:"Essential information for using Hailuo 2.3"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Mode Selection"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Choose Text-to-Video to generate videos from descriptions, or Image-to-Video to animate still images with AI-powered motion."})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Quality & Resolution"}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Standard (768P):"})," Cost-effective option with 6s or 10s duration support."]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Pro (1080P):"})," Enhanced quality with fixed 5s duration for ultra-clear output and realistic physics."]})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Advanced Options"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Enable Prompt Expansion to automatically optimize your prompts for better results. Note that this also activates the safety checker."})]})]})}),(0,t.jsx)("div",{className:"pt-2 border-t",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCA1 ",(0,t.jsx)("span",{className:"font-medium",children:"Pro tip:"})," For Image-to-Video mode, use clear, high-quality images and provide detailed motion descriptions. For Text-to-Video, specify camera movements and visual effects for best results."]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),className:"w-full",children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text-to-vi
1deo",className:"flex items-center gap-2",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(aB,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(aG,{})})]})})},[eP.$g.MINIMAX_H3]:function(){let[e,s]=(0,i.useState)("text-to-video"),{pendingTab:a,clearPendingTab:l}=O();return(0,i.useEffect)(()=>{a&&aH.includes(a)&&(s(a),l())},[a,l]),(0,t.jsx)(eI,{config:{modelIdentifiers:aQ,useStatusQuery:j.F.minimaxH3.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/minimax-h3-demo-video.mp4",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using MiniMax H3"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Native stereo audio generated together with the video"}),(0,t.jsx)("li",{children:"480P / 768P output, 5-15 seconds"}),(0,t.jsx)("li",{children:"Text to Video with 7 aspect ratios"}),(0,t.jsx)("li",{children:"Image to Video with first/last frame control"}),(0,t.jsx)("li",{children:"Reference to Video with images, videos and audio"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Describe the soundtrack in your prompt â audio is generated from it"}),(0,t.jsx)("li",{children:"Include camera movement, lighting and mood"}),(0,t.jsx)("li",{children:"In Reference mode, cite inputs as <Picture 1>, <Video 1>, <Audio 1>"}),(0,t.jsx)("li",{children:"Reference videos require 480P output"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsxs)(e4,{value:"reference-to-video",className:"flex items-center gap-2 w-full rounded-t-none",children:[(0,t.jsx)(eq.A,{className:"w-4 h-4"}),"Reference to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(aL,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(aq,{})}),(0,t.jsx)(e3,{value:"reference-to-video",className:"mt-6",children:(0,t.jsx)(az,{})})]})})},[eP.$g.WAN3]:function(){let[e,s]=(0,i.useState)("text-to-video"),{pendingTab:a,clearPendingTab:l}=O();return(0,i.useEffect)(()=>{a&&ts.includes(a)&&(s(a),l())},[a,l]),(0,t.jsx)(eI,{config:{modelIdentifiers:te,useStatusQuery:j.F.wan3.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/wan-3-0-demo-vi
1deo.webm",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Wan 3.0"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Native audio generated together with the video"}),(0,t.jsx)("li",{children:"480p / 720p / 1080p output, 2-30 seconds in one shot"}),(0,t.jsx)("li",{children:"Text to Video with 5 aspect ratios"}),(0,t.jsx)("li",{children:"Image to Video with first/last frame control"}),(0,t.jsx)("li",{children:"Reference to Video with images, videos and audio"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Normal vs Prime"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Prime is the faster channel, with the same options and output quality"}),(0,t.jsx)("li",{children:"Prime costs 25% more on Text and Image modes, 50% more on Reference"}),(0,t.jsx)("li",{children:"Pick Normal unless turnaround time matters to you"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Describe the soundtrack in your prompt â audio is generated from it"}),(0,t.jsx)("li",{children:"Include camera movement, lighting and mood"}),(0,t.jsx)("li",{children:"In Reference mode, name uploads as Image 1, Video 1, Audio 1 â numbered by their order in each list"}),(0,t.jsx)("li",{children:'Assign roles between them: "Image 1 sits on the chair in Image 2"'}),(0,t.jsx)("li",{children:"Reference videos add their length to the billed duration"}),(0,t.jsx)("li",{children:"Thinking Mode helps on complex, multi-element prompts"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsxs)(e4,{value:"reference-to-video",className:"flex items-center gap-2 w-full rounded-t-none",children:[(0,t.jsx)(eq.A,{className:"w-4 h-4"}),"Reference to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(a8,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(a9,{})}),(0,t.jsx)(e3,{value:"reference-to-video",className:"mt-6",children:(0,t.jsx)(a7,{})})]})})},[eP.$g.GROK_IMAGINE]:function(){let[e,s]=(0,i.useState)("text-to-vi
1deo");return(0,t.jsx)(eI,{config:{modelIdentifiers:tV,useStatusQuery:j.F.grokImagine.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/grok-imagine-demo.mp4",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Production Guidelines"}),(0,t.jsx)(h.BT,{children:"Essential information for using Grok Imagine"})]})]})}),(0,t.jsx)(h.Wu,{className:"space-y-4",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Content Moderation Policy"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Grok Imagine now uses quite strict content moderation. Failed generations don't cost credits."})]})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Spicy Mode in Image-to-Video"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:["In Image-to-Video mode, ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:"if you upload your own image, spicy mode will be automatically disabled and switched to normal mode"}),"."]})]})]})]})})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(tk,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(tU,{})})]})})},[eP.$g.GROK_IMAGINE_1_5]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:tT,useStatusQuery:j.F.grokImagine15.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/grok-imagine-1-5-demo.mp4",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Production Guidelines"}),(0,t.jsx)(h.BT,{children:"Essential information for using Grok Imagine 1.5"})]})]})}),(0,t.jsx)(h.Wu,{className:"space-y-4",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Image Required"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Grok Imagine 1.5 is image-to-video only â upload a source image to animate. The prompt is optional guidance."})]})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Content Moderation Policy"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Grok Imagine uses strict content moderation. Failed generations don't cost credits."})]})]})]})})]}),children:(0,t.jsx)(tG,{})})},[eP.$g.KLING25_TURBO]:function(){let[e,s]=(0,i.useState)("text-to-vi
1deo");return(0,t.jsx)(eI,{config:{modelIdentifiers:tZ,useStatusQuery:j.F.kling25Turbo.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/kling25-turbo-demo.mp4",children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(tO,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(tJ,{})})]})})},[eP.$g.KLING26_PRO]:function(){let[e,s]=(0,i.useState)("text-to-video"),{pendingTab:a,clearPendingTab:l}=O();return(0,i.useEffect)(()=>{a&&t$.includes(a)&&(s(a),l())},[a,l]),(0,t.jsx)(eI,{config:{modelIdentifiers:tH,useStatusQuery:j.F.kling26Pro.get
1Status.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/kling25-turbo-demo.mp4",children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsxs)(e4,{value:"motion-control",className:"flex items-center gap-2 w-full rounded-t-none",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Motion Control"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(tq,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(tz,{})}),(0,t.jsx)(e3,{value:"motion-control",className:"mt-6",children:(0,t.jsx)(tQ,{})})]})})},[eP.$g.KLING_O1]:function(){let[e,s]=(0,i.useState)("text-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:t4,useStatusQuery:j.F.KlingO1.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/kling-o1-demo-video.mp4",children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"reference-to-video",className:"flex items-center gap-2 rounded-t-none rounded-br-none",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Reference to Video"]}),(0,t.jsxs)(e4,{value:"video-edit",className:"flex items-center gap-2 rounded-t-none rounded-bl-none",children:[(0,t.jsx)(tY.A,{className:"w-4 h-4"}),"Video Edit"]})]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(tX,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(t0,{})}),(0,t.jsx)(e3,{value:"reference-to-video",className:"mt-6",children:(0,t.jsx)(t1,{})}),(0,t.jsx)(e3,{value:"video-edit",className:"mt-6",children:(0,t.jsx)(t2,{})})]})})},[eP.$g.KLING_V3_TURBO]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:t8,useStatusQuery:j.F.klingV3Turbo.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/kling-v3-turbo-demo-video.webm",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Features and pricing for Kling V3 Turbo"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-5",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"One page, two modes: add an image for image-to-video, or leave it empty for text-to-video."}),(0,t.jsx)("li",{children:"Fast turbo generation, 3sâ15s duration."}),(0,t.jsx)("li",{children:"720p / 1080p output."})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Pricing for Kling V3 Turbo"}),(0,t.jsx)("div",{className:"hidden md:block",children:(0,t.jsxs)(t3.Table,{children:[(0,t.jsx)(t3.TableHeader,{children:(0,t.jsxs)(t3.TableRow,{children:[(0,t.jsx)(t3.TableHead,{children:"Resolution"}),(0,t.jsx)(t3.TableHead,{children:"Rate"}),(0,t.jsx)(t3.TableHead,{children:"Billing formula"})]})}),(0,t.jsxs)(t3.TableBody,{children:[(0,t.jsxs)(t3.TableRow,{children:[(0,t.jsx)(t3.TableCell,{children:"720p"}),(0,t.jsx)(t3.TableCell,{children:"27 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"rate * output duration"})]}),(0,t.jsxs)(t3.TableRow,{children:[(0,t.jsx)(t3.TableCell,{children:"1080p"}),(0,t.jsx)(t3.TableCell,{children:"34 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"rate * output duration"})]})]})]})}),(0,t.jsx)("div",{className:"grid gap-3 md:hidden",children:(0,t.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)("div",{children:"720p: 27 credits/s"}),(0,t.jsx)("div",{children:"1080p: 34 credits/s"})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Formula: rate * output duration."})]})}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[(0,t.jsx)("p",{children:"Pricing depends on resolution and output duration. The mode (text-to-vi
1deo or image-to-video) and aspect ratio do not change the rate."}),(0,t.jsx)("p",{className:"font-medium text-foreground",children:"Examples:"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,t.jsx)("li",{children:"720p, 5s: 27 * 5 = 135 credits."}),(0,t.jsx)("li",{children:"1080p, 10s: 34 * 10 = 340 credits."})]})]})]})]})})]})]}),children:(0,t.jsx)(t6,{})})},[eP.$g.GEMINI3_PRO_IMAGE]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:le,useStatusQuery:j.F.gemini3ProImage.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/gemini3-pro-image-demo.png",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Tips for using Nano Banana Pro effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Most Powerful Reasoning Model"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsx)("p",{children:"Google's most powerful and versatile image generation model. Brings reasoning capabilities to image generation, resulting in enhanced quality and accuracy through thoughtful composition."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Enhanced Image Quality"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsx)("p",{children:"Reasoning through thoughts before generating results in superior image quality with better composition, lighting, and detail rendering. Excels at complex scenes and artistic styles."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Long Text & Multilingual Support"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsx)("p",{children:"Excels at rendering long text passages in many languages. Better text integration and improved factuality in generated images ensure accurate representation of your prompts."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"4"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Flexible Aspect Ratios & Editing"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsx)("p",{children:"Supports flexible aspect ratios via the aspect ratio selector. Upload an image for intelligent editing with natural language instructions."})})]})]})}),(0,t.jsx)("div",{className:"pt-2 border-t",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCA1 ",(0,t.jsx)("span",{className:"font-medium",children:"Pro tip:"})," Nano Banana Pro excels at complex image generation tasks. Be detailed in your prompts about composition, style, and text content for best results."]})})]})]}),children:(0,t.jsx)(t7,{})})},[eP.$g.NANO_BANANA_2]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:lt,useStatusQuery:j.F.nanoBanana2.getStatus.useQuery,contentLabel:"Image"},demoUrl:"/imgs/nano-banana-2/demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Tips for using Nano Banana 2 effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Fast & Cost-Effective"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"Built on Gemini 3.1 Flash â significantly faster and cheaper than Nano Banana Pro, while delivering near-identical image quality for most use cases."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Text & Image Input"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"Generate from a text prompt alone, or upload up to 14 reference images for guided editing and style transfer. Both modes use the same model and endpoint."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Google Search Grounding"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"Enable Google Search to ground generation in real-time information â useful for images that reference current events, products, or locations."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"4"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Resolution & Format Control"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"Choose 1K, 2K, or 4K output resolution and PNG or JPG format. For most tasks, 1K delivers excellent quality at the lowest cost."})})]})]})}),(0,t.jsx)("div",{className:"pt-2 border-t",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCA1 ",(0,t.jsx)("span",{className:"font-medium",children:"Pro tip:"})," For most tasks, Nano Banana 2 matches Pro quality at lower cost. Only upgrade to Pro if you need its deeper reasoning capabilities."]})})]})]}),children:(0,t.jsx)(la,{})})},[eP.$g.GPT_IMAGE_1_5]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:ln,useStatusQuery:j.F.gptImage15.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/gpt-image-1-5-demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Tips for using GPT Image 1.5 effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Pricing by Quality"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-1",children:(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,t.jsx)("li",{children:"Low: 3-4 credits (1024\xd71024: 3, others: 4)"}
1),(0,t.jsx)("li",{children:"Medium: 10-15 credits (1024\xd71024: 10, others: 15)"}),(0,t.jsx)("li",{children:"High: 40-60 credits (1024\xd71024: 40, others: 60)"})]})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Mode"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium",children:"Image Editing:"})," ","Upload up to 10 reference images for editing. The model will intelligently combine and modify them based on your prompt."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium",children:"Text To Image:"})," ","Leave image upload empty to generate from text prompt only. Describe your desired image in detail for best results."]})]})})]})]})}),(0,t.jsx)("div",{className:"pt-2 border-t",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium",children:"Pro tip:"})," GPT Image 1.5 excels at natural language understanding. Be specific about style, composition, and details in your prompts."]})})]})]}),children:(0,t.jsx)(li,{})})},[eP.$g.GPT_IMAGE_2]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:lx,useStatusQuery:j.F.gptImage2.getStatus.useQuery,contentLabel:"Image"},demoUrl:"/imgs/gpt-image-2/demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Tips for using GPT Image 2 effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Resolution-Tiered Pricing"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"5 credits for 1K, 8 for 2K, 12 for 4K. The 5:4, 4:5, 3:1, 1:3, and 9:21 aspect ratios are 1K only."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Copyright Restrictions"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsxs)("p",{children:["GPT Image 2 refuses prompts that reference copyrighted characters, public figures, or branded content. If yours gets blocked, try"," ",(0,t.jsx)(ld(),{href:"/?model=seedream-v5-pro",className:"text-primary underline underline-offset-2 hover:text-primary/80",children:"Seedream V5 Pro"})," ","â it tends to be more permissive."]})})]})]})})]})]}),children:(0,t.jsx)(lm,{})})},[eP.$g.GPT_IMAGE_2_5]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:lg,useStatusQuery:j.F.gptImage25.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/gpt-image-2-5-demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Tips for using GPT Image 2.5 effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Flare or Sunburst"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"Both cost the same. Flare is the faster everyday choice;
1 Sunburst spends longer per image for finer detail and holds a subject steadier across repeated edits."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Resolution-Tiered Pricing"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"5 credits for 1K, 15 for 2K, 24 for 4K. The 27:16, 16:27, 9:8, and 8:9 aspect ratios are 1K only."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Copyright Restrictions"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsxs)("p",{children:["GPT Image 2.5 refuses prompts that reference copyrighted characters, public figures, or branded content. If yours gets blocked, try"," ",(0,t.jsx)(ld(),{href:"/?model=seedream-v5-pro",className:"text-primary underline underline-offset-2 hover:text-primary/80",children:"Seedream V5 Pro"})," ","â it tends to be more permissive."]})})]})]})})]})]}),children:(0,t.jsx)(lp,{})})},[eP.$g.GROK_IMAGINE_IMAGE_2]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:lw,useStatusQuery:j.F.grokImage2.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/grok-imagine-image-2-preview.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Tips for using Grok Imagine Image 2.0 effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"One Form, Two Modes"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"Leave the upload empty to generate from a prompt. Attach images and the same prompt becomes an edit instruction, with several references combined into one result."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Auto Keeps Your Framing"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"When you attach a reference, the aspect ratio switches to Auto so the edit keeps the original framing. Pick a fixed ratio to reshape it instead."})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Flat Pricing"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed",children:(0,t.jsx)("p",{children:"6 credits per image, whether you generate or edit. No resolution tiers to pick between."})})]})]})})]})]}),children:(0,t.jsx)(ly,{})})},[eP.$g.SEEDANCE_V1_PRO]:function(){let[e,s]=(0,i.useState)("text-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:lE,useStatusQuery:j.F.seedanceV1Pro.get
1Status.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedance-v1-pro-demo.mp4",guidelines:(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Production Guidelines"}),(0,t.jsx)(h.BT,{children:"Essential information for using Seedance v1 Pro"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Multi-Resolution Support"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Choose from 480p (9 credits/s), 720p (18 credits/s), or 1080p (36 credits/s) to balance quality and cost."})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"First-Last Frame Mode"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"In Image-to-Video mode, upload both a First Frame and Last Frame to create precise motion sequences with defined start and end points."})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Duration Control"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Generate videos from 2 to 12 seconds in length. Longer durations provide more complex narratives but cost proportionally more credits."})]})]})}),(0,t.jsx)("div",{className:"pt-2 border-t",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCA1 ",(0,t.jsx)("span",{className:"font-medium",children:"Pro tip:"})," Use Camera Fixed mode to prevent unwanted camera movements in your videos. Combine with aspect ratio selection for optimal composition."]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),className:"w-full",children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(lC,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(lA,{})})]})})},[eP.$g.SEEDANCE_V1_PRO_FAST]:function(){let[e,s]=(0,i.useState)("text-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:lU,useStatusQuery:j.F.seedanceV1ProFast.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedance-v1-pro-demo.mp4",guidelines:(0,t.jsxs)(h.Zp,{children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{children:"Production Guidelines"}),(0,t.jsx)(h.BT,{children:"Essential information for using Seedance v1 Pro Fast"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Multi-Resolution Support"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Choose from 480p (4 credits/s), 720p (8 credits/s), or 1080p (16 credits/s) to balance quality and cost."})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"I2V Prompt Required"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Fast version requires a prompt for image-to-vi
1deo mode to ensure better motion control and consistency."})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Duration Control"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Generate videos from 2 to 12 seconds in length. Longer durations provide more complex narratives but cost proportionally more credits."})]})]})}),(0,t.jsx)("div",{className:"pt-2 border-t",children:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCA1 ",(0,t.jsx)("span",{className:"font-medium",children:"Pro tip:"})," Use Camera Fixed mode to prevent unwanted camera movements in your videos. Combine with aspect ratio selection for optimal composition."]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),className:"w-full",children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(lF,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(lI,{})})]})})},[eP.$g.SEEDANCE_V1_5_PRO]:function(){let[e,s]=(0,i.useState)("text-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:lO,useStatusQuery:j.F.seedanceV15Pro.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedance-v1-pro-demo.mp4",children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsxs)(e4,{value:"video-extend",className:"flex items-center gap-2 w-full rounded-t-none",children:[(0,t.jsx)(d.A,{className:"w-4 h-4"}),"Video Extend"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(lT,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(lM,{})}),(0,t.jsx)(e3,{value:"video-extend",className:"mt-6",children:(0,t.jsx)(lD,{})})]})})},[eP.$g.SEEDANCE_V1_5_PRO_FAST]:function(){let[e,s]=(0,i.useState)("text-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:lK,useStatusQuery:j.F.seedanceV15ProFast.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedance-v1-pro-demo.mp4",children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsxs)(e4,{value:"video-extend",className:"flex items-center gap-2 w-full rounded-t-none",children:[(0,t.jsx)(d.A,{className:"w-4 h-4"}),"Video Extend"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(lJ,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(l_,{})}),(0,t.jsx)(e3,{value:"video-extend",className:"mt-6",children:(0,t.jsx)(lq,{})})]})})},[eP.$g.Z_IMAGE]:function(){let[e,s]=(0,i.useState)("text");return(0,t.jsx)(eI,{config:{modelIdentifiers:lH,useStatusQuery:j.F.zImage.getStatus.useQuery,contentLabel:"Image"},demoUrl:"https://assets.sora2.center/sora-model-intro/z-image-demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Z-Image effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Highlights"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,t.jsx)("li",{children:"Fast generation speed, typically under 10 seconds"}),(0,t.jsx)("li",{children:"But still capable of generating high-quality images"}),(0,t.jsx)("li",{children:"Supports custom seed for reproducible results"})]})})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Size Recommendations"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Square (1:1): Recommended for portraits, product photos, avatars"}),(0,t.jsx)("li",{children:"Landscape (16:9): Best for scenes, landscapes, wide compositions"}),(0,t.jsx)("li",{children:"Portrait (9:16): Ideal for mobile wallpapers, vertical content"}),(0,t.jsx)("li",{children:"Custom sizes: Support range from 256\xd7256 to 1536\xd71536 pixels"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"text",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Generate"]}),(0,t.jsxs)(e4,{value:"edit",disabled:!0,className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Edit (Coming Soon)"]})]}),(0,t.jsx)(e3,{value:"text",className:"mt-6",children:(0,t.jsx)(lQ,{})})]})})}
1,[eP.$g.LTX2]:function(){let[e,s]=(0,i.useState)("text-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:lX,useStatusQuery:j.F.ltx2.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/ltx-2-demo-video.webm",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using LTX-2"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Performance"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"This model has more flexible content policies, but actual performance may not match Wan 3.0"}),(0,t.jsxs)("li",{children:["We recommend trying multiple generations. If results are unsatisfactory, consider switching to ",(0,t.jsx)("a",{href:"/?model=wan-3.0",className:"text-primary underline",children:"Wan 3.0"})]})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Prompt Writing Guide"}),(0,t.jsx)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:(0,t.jsxs)("li",{children:["For detailed prompt writing techniques, refer to the ",(0,t.jsx)("a",{href:"https://ltx.io/model/model-blog/prompting-guide-for-ltx-2",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"official prompt guide"})]})})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full grid grid-cols-2 p-0",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-r-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Text to Video"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-l-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Image to Video"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(l$,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(lY,{})})]})})},[eP.$g.HAPPYHORSE_1]:function(){let[e,s]=(0,i.useState)("reference-to-video");return(0,t.jsx)(eI,{config:{modelIdentifiers:l9,useStatusQuery:j.F.happyhorse1.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/happyhorse-1-demo.webm",children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"normal",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(m.A,{className:"w-4 h-4"}),"Normal"]}),(0,t.jsxs)(e4,{value:"reference-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Reference to Video"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"video-edit",className:"flex items-center gap-2 rounded-t-none rounded-br-none",children:[(0,t.jsx)(sE.A,{className:"w-4 h-4"}),"Video Edit"]}),(0,t.jsxs)(e4,{value:"video-extend",className:"flex items-center gap-2 rounded-t-none rounded-bl-none",children:[(0,t.jsx)(sA.A,{className:"w-4 h-4"}),"Video Extend"]})]})]}),(0,t.jsx)(e3,{value:"normal",className:"mt-6",children:(0,t.jsx)(l1,{})}),(0,t.jsx)(e3,{value:"reference-to-video",className:"mt-6",children:(0,t.jsx)(l8,{})}),(0,t.jsx)(e3,{value:"video-edit",className:"mt-6",children:(0,t.jsx)(l5,{})}),(0,t.jsx)(e3,{value:"video-extend",className:"mt-6",children:(0,t.jsx)(l4,{})})]})})},[eP.$g.SEEDREAM_V5_LITE]:function(){let[e,s]=(0,i.useState)("edit"),{pendingTab:a,clearPendingTab:l}=O();return(0,i.useEffect)(()=>{a&&ic.includes(a)&&(s(a),l())},[a,l]),(0,t.jsx)(eI,{config:{modelIdentifiers:id,useStatusQuery:j.F.seedreamV5Lite.getStatus.useQuery,contentLabel:"Image"},demoUrl:"/imgs/seedream-5/demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Seedream V5.0 Lite effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"First image model with built-in web search for real-time topics"}),(0,t.jsx)("li",{children:"Intelligent multi-step reasoning for accurate compositions"}),(0,t.jsx)("li",{children:"Supports multiple resolution tiers and aspect ratios"}),(0,t.jsx)("li",{children:"Fixed 11 credits \xb7 Generate and Edit modes"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Mention real-world topics or people to trigger web search"}),(0,t.jsx)("li",{children:"Use detailed prompts with style, lighting, and composition"}),(0,t.jsxs)("li",{children:["Keep prompts under ",(0,t.jsx)("strong",{className:"text-foreground",children:"600 words"})," for best results"]}),(0,t.jsx)("li",{children:'Edit mode supports fuzzy instructions (e.g. "make it warmer")'})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"generate",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Generate"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Edit"]})]}),(0,t.jsx)(e3,{value:"generate",className:"mt-6",children:(0,t.jsx)(ii,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(ir,{})})]})})},[eP.$g.SEEDREAM_V5_PRO]:function(){let[e,s]=(0,i.useState)("generate"),{pendingTab:a,clearPendingTab:l}=O();return(0,i.useEffect)(()=>{a&&iw.includes(a)&&(s(a),l())},[a,l]),(0,t.jsx)(eI,{config:{modelIdentifiers:iy,useStatusQuery:j.F.seedreamV5Pro.getStatus.useQuery,contentLabel:"Image"},demoUrl:"/imgs/seedream-5-pro/demo.webp",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Seedream V5.0 Pro effectively"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"ByteDance's flagship image model with pro-grade qual
1ity"}),(0,t.jsx)("li",{children:"1K and 2K output tiers, 15 aspect ratios"}),(0,t.jsx)("li",{children:"Edit mode blends up to 10 reference images"}),(0,t.jsx)("li",{children:"14 credits (1K) / 27 credits (2K) per image"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Use detailed prompts with style, lighting, and composition"}),(0,t.jsx)("li",{children:"In Edit mode, leave aspect ratio on Auto to follow your first image"}),(0,t.jsx)("li",{children:"Each reference image beyond the first adds 1 credit"}),(0,t.jsx)("li",{children:"Choose 2K for print or hero assets; 1K is great for social"})]})]})]})})]})]}),children:(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(e4,{value:"generate",className:"flex items-center gap-2",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Generate"]}),(0,t.jsxs)(e4,{value:"edit",className:"flex items-center gap-2",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Edit"]})]}),(0,t.jsx)(e3,{value:"generate",className:"mt-6",children:(0,t.jsx)(iN,{})}),(0,t.jsx)(e3,{value:"edit",className:"mt-6",children:(0,t.jsx)(ib,{})})]})})},[eP.$g.SEEDANCE_2]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:iP,useStatusQuery:j.F.seedance2.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedance-2-demo-video.webm",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Features and pricing for Seedance 2.0"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-5",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Supports realistic human reference images and videos."}),(0,t.jsx)("li",{children:"No queue, fast generation."}),(0,t.jsx)("li",{children:"Multi-shot creation, audio generation, web search, and more."})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Pricing for Seedance 2.0"}),(0,t.jsx)("div",{className:"hidden md:block",children:(0,t.jsxs)(t3.Table,{children:[(0,t.jsx)(t3.TableHeader,{children:(0,t.jsxs)(t3.TableRow,{children:[(0,t.jsx)(t3.TableHead,{children:"Input type"}),(0,t.jsx)(t3.TableHead,{children:"480p"}),(0,t.jsx)(t3.TableHead,{children:"720p"}),(0,t.jsx)(t3.TableHead,{children:"Billing formula"})]})}),(0,t.jsxs)(t3.TableBody,{children:[(0,t.jsxs)(t3.TableRow,{children:[(0,t.jsx)(t3.TableCell,{children:"Without video input"}),(0,t.jsx)(t3.TableCell,{children:"24 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"52 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"rate * output duration"})]}),(0,t.jsxs)(t3.TableRow,{children:[(0,t.jsx)(t3.TableCell,{children:"With video input"}),(0,t.jsx)(t3.TableCell,{children:"15 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"31 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"rate * (reference video duration + output duration)"})]})]})]})}),(0,t.jsxs)("div",{className:"grid gap-3 md:hidden",children:[(0,t.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Without video input"}),(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)("div",{children:"480p: 24 credits/s"}),(0,t.jsx)("div",{children:"720p: 52 credits/s"})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Formula: rate * output duration."})]}),(0,t.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"With video input"}),(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)("div",{children:"480p: 15 credits/s"}),(0,t.jsx)("div",{children:"720p: 31 credits/s"})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Formula: rate * (reference video duration + output duration)."})]})]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[(0,t.jsx)("p",{children:"Pricing depends on resolution, whether a reference video is uploaded, total reference video duration, and output duration."}),(0,t.jsx)("p",{children:"Prompt text, reference images, first/last frames, audio references, audio generation, and web search do not change the rate."}),(0,t.jsx)("p",{className:"font-medium text-foreground",children:"Examples:"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,t.jsx)("li",{children:"720p, 8s, no video input: 52 * 8 = 416 credits."}),(0,t.jsx)("li",{children:"480p, 4s video input + 6s output: 15 * (4 + 6) = 150 credits."})]})]})]})]})})]})]}),children:(0,t.jsx)(iC,{})})},[eP.$g.SEEDANCE_2_FAST]:function(){return(0,t.jsx)(eI,{config:{modelIdentifiers:iR,useStatusQuery:j.F.seedance2Fast.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedance-2-demo-video.webm",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Features and pricing for Seedance 2.0 Fast"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-5",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Supports realistic human reference images and videos."}),(0,t.jsx)("li",{children:"No queue, fast generation."}),(0,t.jsx)("li",{children:"Multi-shot creation, audio generation, web search, and more."})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Pricing for Seedance 2.0 Fast"}),(0,t.jsx)("div",{className:"hidden md:block",children:(0,t.jsxs)(t3.Table,{children:[(0,t.jsx)(t3.TableHeader,{children:(0,t.jsxs)(t3.TableRow,{children:[(0,t.jsx)(t3.TableHead,{children:"Input type"}),(0,t.jsx)(t3.TableHead,{children:"480p"}),(0,t.jsx)(t3.TableHead,{children:"720p"}),(0,t.jsx)(t3.TableHead,{children:"Billing formula"})]})}),(0,t.jsxs)(t3.TableBody,{children:[(0,t.jsxs)(t3.TableRow,{children:[(0,t.jsx)(t3.TableCell,{children:"Without video input"}),(0,t.jsx)(t3.TableCell,{children:"19 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"41 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"rate * output duration"})]}),(0,t.jsxs)(t3.TableRow,{children:[(0,t.jsx)(t3.TableCell,{children:"With video input"}),(0,t.jsx)(t3.TableCell,{children:"11 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"25 credits/s"}),(0,t.jsx)(t3.TableCell,{children:"rate * (reference video duration + output duration)"})]})]})]})}),(0,t.jsxs)("div",{className:"grid gap-3 md:hidden",children:[(0,t.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Without video input"}),(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)("div",{children:"480p: 19 credits/s"}),(0,t.jsx)("div",{children:"720p: 41 credits/s"})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Formula: rate * output duration."})]}),(0,t.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"With video input"}),(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)("div",{children:"480p: 11 credits/s"}),(0,t.jsx)("div",{children:"720p: 25 credits/s"})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Formula: rate * (reference video duration + output duration)."})]})]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[(0,t.jsx)("p",{children:"Pricing depends on resolution, whether a reference video is uploaded, total reference video duration, and output duration."}),(0,t.jsx)("p",{children:"Prompt text, reference images, first/last frames, audio references, audio generation, and web search do not change the rate."}),(0,t.jsx)("p",{className:"font-medium text-foreground",children:"Examples:"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,t.jsx)("li",{children:"720p, 8s, no video input: 41 * 8 = 328 credits."}),(0,t.jsx)("li",{children:"480p, 4s video input + 6s output: 11 * (4 + 6) = 110 credits."})]})]})]})]})})]})]}),children:(0,t.jsx)(iE,{})})},[eP.$g.SEEDANCE_2_5]:function(){let[e,s]=(0,i.useState)("text-to-vi
1deo"),{pendingTab:a,clearPendingTab:l}=O();return(0,i.useEffect)(()=>{a&&tw.includes(a)&&(s(a),l())},[a,l]),(0,t.jsxs)(eI,{config:{modelIdentifiers:ty,useStatusQuery:j.F.seedance25.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedance-2-demo-video.webm",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Seedance 2.5"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Pricing"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Generate & Start/End Frame: 45 / 90 / 225 / 450 credits per second at 480P / 720P / 1080P / 4K"}),(0,t.jsx)("li",{children:"With reference videos: 28 / 55 / 138 / 275 credits per second, counting reference + output seconds"}),(0,t.jsx)("li",{children:"Video Edit: same rates \xd7 (input + output seconds); Video Extend: \xd7 (context + new seconds)"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Native synchronized audio, 4-30 seconds, up to 4K"}),(0,t.jsx)("li",{children:"Generate accepts up to 30 image, 10 video and 10 audio references"}),(0,t.jsx)("li",{children:"Experimental Spicy Prompt Enhancer on Start & End Frame"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Write like a director: subject, action, camera, lighting, mood"}),(0,t.jsx)("li",{children:"Cite references as @image1, @video1, @audio1 in the prompt"}),(0,t.jsx)("li",{children:"Start short to test a prompt, then increase the duration"})]})]})]})})]})]}),children:[(0,t.jsxs)(g.Fc,{className:"mb-4 border-primary/50 bg-primary/10",children:[(0,t.jsx)(sn.A,{className:"h-4 w-4 text-primary"}),(0,t.jsxs)(g.TN,{className:"text-sm",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Seedance 2.5 Turbo"})," runs the same model with quicker turnaround at about half the price â from 50 credits/s."," ",(0,t.jsx)(e_.RouteProgressLink,{href:"/?model=seedance-2.5-turbo",className:"underline font-medium",children:"Try Turbo"})]})]}),(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Generate"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Start & End Frame"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"video-edit",className:"flex items-center gap-2 rounded-t-none rounded-br-none",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}
1),"Video Edit"]}),(0,t.jsxs)(e4,{value:"video-extend",className:"flex items-center gap-2 rounded-t-none rounded-bl-none",children:[(0,t.jsx)(ta.A,{className:"w-4 h-4"}),"Video Extend"]})]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(tj,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(tv,{})}),(0,t.jsx)(e3,{value:"video-edit",className:"mt-6",children:(0,t.jsx)(tN,{})}),(0,t.jsx)(e3,{value:"video-extend",className:"mt-6",children:(0,t.jsx)(tb,{})})]})]})},[eP.$g.SEEDANCE_2_5_TURBO]:function(){let[e,s]=(0,i.useState)("text-to-video"),{pendingTab:a,clearPendingTab:l}=O();return(0,i.useEffect)(()=>{a&&tR.includes(a)&&(s(a),l())},[a,l]),(0,t.jsxs)(eI,{config:{modelIdentifiers:tE,useStatusQuery:j.F.seedance25Turbo.getStatus.useQuery,contentLabel:"Video"},demoUrl:"https://assets.sora2.center/sora-model-intro/seedance-2-demo-video.webm",guidelines:(0,t.jsxs)(h.Zp,{className:"mt-4",children:[(0,t.jsx)(h.aR,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg",children:(0,t.jsx)(m.A,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(h.ZB,{className:"text-lg",children:"Guidelines"}),(0,t.jsx)(h.BT,{children:"Key information for using Seedance 2.5 Turbo"})]})]})}),(0,t.jsxs)(h.Wu,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"1"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Pricing"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Generate & Start/End Frame: 50 / 53 credits per second at 720P / 1080P"}),(0,t.jsx)("li",{children:"With reference videos: 95 / 98 credits per second of output"}),(0,t.jsx)("li",{children:"Video Edit: 33 / 35 credits per second, counting input + output seconds"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Model Features"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Roughly half the price of flagship Seedance 2.5"}),(0,t.jsx)("li",{children:"Native synchronized audio, 4-30 seconds"}),(0,t.jsx)("li",{children:"Same references as flagship: 30 images, 10 videos, 10 audio clips"})]})]})]})}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(p.E,{variant:"outline",className:"mt-0.5",children:"3"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Tips for Best Results"}),(0,t.jsxs)("ul",{className:"list-disc list-inside space-y-1 text-xs text-muted-foreground leading-relaxed",children:[(0,t.jsx)("li",{children:"Write like a director: subject, action, camera, lighting, mood"}),(0,t.jsx)("li",{children:"Cite references as @image1, @video1, @audio1 in the prompt"}),(0,t.jsx)("li",{children:"Need 480P or 4K, the Spicy Prompt Enhancer, or Video Extend? Use flagship Seedance 2.5"})]})]})]})})]})]}),children:[(0,t.jsxs)(g.Fc,{className:"mb-4 border-primary/50 bg-primary/10",children:[(0,t.jsx)(tS.A,{className:"h-4 w-4 text-primary"}),(0,t.jsxs)(g.TN,{className:"text-sm",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Seedance 2.5"})," is the top-quality flagship of this model â smoother motion and richer cinematic detail."," ",(0,t.jsx)(e_.RouteProgressLink,{href:"/?model=seedance-2.5",className:"underline font-medium",children:"Switch to flagship"})]})]}),(0,t.jsxs)(e1,{value:e,onValueChange:e=>s(e),children:[(0,t.jsxs)(e2,{className:"h-auto w-full flex-col gap-0 p-0",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 w-full",children:[(0,t.jsxs)(e4,{value:"text-to-vi
1deo",className:"flex items-center gap-2 rounded-b-none rounded-tr-none",children:[(0,t.jsx)(eX.A,{className:"w-4 h-4"}),"Generate"]}),(0,t.jsxs)(e4,{value:"image-to-video",className:"flex items-center gap-2 rounded-b-none rounded-tl-none",children:[(0,t.jsx)(n.A,{className:"w-4 h-4"}),"Start & End Frame"]})]}),(0,t.jsxs)(e4,{value:"video-edit",className:"flex items-center gap-2 w-full rounded-t-none",children:[(0,t.jsx)(sj.A,{className:"w-4 h-4"}),"Video Edit"]})]}),(0,t.jsx)(e3,{value:"text-to-video",className:"mt-6",children:(0,t.jsx)(tC,{})}),(0,t.jsx)(e3,{value:"image-to-video",className:"mt-6",children:(0,t.jsx)(tP,{})}),(0,t.jsx)(e3,{value:"video-edit",className:"mt-6",children:(0,t.jsx)(tA,{})})]})]})}},ik=[{id:"i2i",label:"Image Edit",icon:n.A,modelId:eP.$g.SEEDREAM_V5_PRO,tab:"edit"},{id:"i2v",label:"Image to Video",icon:r.A,modelId:eP.$g.SEEDANCE_2_5,tab:"text-to-video"},{id:"video-extend",label:"Video Extend",icon:d.A,modelId:eP.$g.SEEDANCE_2_5,tab:"video-extend"},{id:"char-swap",label:"Character Swap",icon:c.A,modelId:eP.$g.SEEDANCE_2_5,tab:"video-edit"}],iI=[{gradient:"linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%)",shadow:"0 0 30px rgba(6, 182, 212, 0.5), 0 0 60px rgba(59, 130, 246, 0.3)",border:"#06b6d4",iconAnim:"animate-icon-wiggle"},{gradient:"linear-gradient(135deg, #10b981 0%, #06b6d4 100%)",shadow:"0 0 30px rgba(16, 185, 129, 0.5), 0 0 60px rgba(6, 182, 212, 0.3)",border:"#10b981",iconAnim:"animate-icon-flip"},{gradient:"linear-gradient(135deg, #f97316 0%, #ef4444 100%)",shadow:"0 0 30px rgba(249, 115, 22, 0.5), 0 0 60px rgba(239, 68, 68, 0.3)",border:"#f97316",iconAnim:"animate-icon-pulse"},{gradient:"linear-gradient(135deg, #ec4899 0%, #a855f7 100%)",shadow:"0 0 30px rgba(236, 72, 153, 0.5), 0 0 60px rgba(168, 85, 247, 0.3)",border:"#ec4899",iconAnim:"animate-icon-sway"}];function iU(){let{setSelectedModel:e}=J(),{setPendingTab:s}=O(),a=e=>{let s=e.currentTarget;s.dataset.tap="true",setTimeout(()=>{delete s.dataset.tap},500)};return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 mb-4",children:[(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-gradient-to-r from-purple-500/20 via-pink-500/20 to-purple-500/20 border border-purple-500/30 shadow-lg shadow-purple-500/20 animate-badge-glow",children:[(0,t.jsx)("span",{className:"text-yellow-400 text-sm animate-spark-twinkle",children:"â¦"}),(0,t.jsx)("span",{className:"text-sm font-semibold bg-gradient-to-r from-purple-400 to-pink-400 bg-clip-text text-transparent",children:"Top Picks"})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Hand-selected models for the best results"})]}),(0,t.jsx)("div",{className:"grid gap-3 grid-cols-2 md:grid-cols-4",children:ik.map((l,i)=>{let n=l.icon,r=iI[i];return(0,t.jsxs)("button",{className:"group relative overflow-hidden px-4 py-3 sm:px-3 sm:py-2.5 rounded-lg border border-border bg-card transition-all duration-300 cursor-pointer outline-none active:scale-95 hover:translate-y-[-2px] hover:border-transparent","data-mode-index":i,onClick:()=>{var a,t;return a=l.modelId,void((t=l.tab)&&s(t),e(a))},onPointerDown:a,style:{"--glow-gradient":r.gradient,"--glow-shadow":r.shadow,"--glow-border":r.border},children:[(0,t.jsx)("div",{className:"absolute inset-0 opacity-0 rounded-lg blur-xl transition-opacity duration-300 group-hover:opacity-100",style:{background:r.gradient}}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-center gap-2 transition-transform duration-300 group-hover:scale-105",children:[(0,t.jsx)(n,{className:"w-5 h-5 sm:w-4 sm:h-4 transition-all duration-300 group-hover:drop-shadow-lg","data-icon-anim":i}),(0,t.jsx)("span",{className:"text-sm sm:text-xs font-medium",children:l.label})]}),(0,t.jsx)("div",{className:"absolute inset-0 opacity-0 bg-gradient-to-r from-transparent via-white/20 to-transparent transition-opacity duration-300 translate-x-[-100%] group-hover:animate-shimmer"})]},l.id)})})]})}function iV(e){let{defaultModel:s}=e,a=(0,l.useSearchParams)().get("model"),{selectedModel:n,setSelectedModel:r,initializeModelSelection:d}=J();if((0,i.useEffect)(()=>{a&&o.L6.some(e=>e.id===a)?r(a):s&&o.L6.some(e=>e.id===s)&&r(s),d()},[a,s,r,d]),!n)return(0,t.jsx)("div",{className:"bg-background text-foreground py-16 px-6",children:(0,t.jsx)("div",{className:"max-w-7xl mx-auto flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-muted-foreground",children:"Loading..."})})});let c=iF[n]||null;return c?(0,t.jsx)("div",{className:"bg-background text-foreground py-16 px-6",children:(0,t.jsxs)("div",{className:"max-w-7xl mx-auto
1space-y-6",children:[(0,t.jsx)(iU,{}),(0,t.jsx)(c,{},n)]})}):(0,t.jsx)("div",{className:"bg-background text-foreground py-16 px-6",children:(0,t.jsx)("div",{className:"max-w-7xl mx-auto flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-destructive",children:['Model "',n,'" not found']})})})}function iT(e){return(0,t.jsx)(i.Suspense,{fallback:(0,t.jsx)("div",{className:"bg-background text-foreground py-16 px-6",children:(0,t.jsx)("div",{className:"max-w-7xl mx-auto flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-muted-foreground",children:"Loading..."})})}),children:(0,t.jsx)(iV,{...e})})}},59731:(e,s,a)=>{a.d(s,{b:()=>i});var t=a(98637),l=a(96844);function i(){var e,s;let{data:a}=(0,l.wV)(),{data:i}=t.F.credits.get.useQuery(void 0,{enabled:!!(null==a||null==(e=a.user)?void 0:e.email),staleTime:3e4,refetchOnWindowFocus:!0,refetchOnReconnect:!0});return{userCredits:null!=(s=null==i?void 0:i.left_credits)?s:0}}}}]);
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.