1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7910],{21641:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(10453).A)("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]])},40874:(e,t,r)=>{r.d(t,{T:()=>s});var a=r(24535),l=r(37631),o=r(34199);let s=l.forwardRef((e,t)=>{let{className:r,...l}=e;return(0,a.jsx)("textarea",{className:(0,o.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t,...l})});s.displayName="Textarea"},52726:(e,t,r)=>{r.d(t,{A7:()=>x,FN:()=>m,Oj:()=>f,Q8:()=>h,Wk:()=>p});var a=r(24535),l=r(37631),o=r(42721),s=r(29070),d=r(40503),i=r(34199),n=r(55960);let c=l.createContext(null);function u(){let e=l.useContext(c);if(!e)throw Error("useCarousel must be used within a <Carousel />");return e}let m=l.forwardRef((e,t)=>{let{orientation:r="horizontal",opts:s,setApi:d,plugins:n,className:u,children:m,...p}=e,[x,h]=(0,o.A)({...s,axis:"horizontal"===r?"x":"y"},n),[f,g]=l.useState(!1),[b,v]=l.useState(!1),w=l.useCallback(e=>{e&&(g(e.canScrollPrev()),v(e.canScrollNext()))},[]),_=l.useCallback(()=>{null==h||h.scrollPrev()},[h]),j=l.useCallback(()=>{null==h||h.scrollNext()},[h]),N=l.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),_()):"ArrowRight"===e.key&&(e.preventDefault(),j())},[_,j]);return l.useEffect(()=>{h&&d&&d(h)},[h,d]),l.useEffect(()=>{if(h)return w(h),h.on("reInit",w),h.on("select",w),()=>{null==h||h.off("select",w)}},[h,w]),(0,a.jsx)(c.Provider,{value:{carouselRef:x,api:h,opts:s,orientation:r||((null==s?void 0:s.axis)==="y"?"vertical":"horizontal"),scrollPrev:_,scrollNext:j,canScrollPrev:f,canScrollNext:b},children:(0,a.jsx)("div",{ref:t,onKeyDownCapture:N,className:(0,i.cn)("relative",u),role:"region","aria-roledescription":"carousel",...p,children:m})})});m.displayName="Carousel";let p=l.forwardRef((e,t)=>{let{className:r,...l}=e,{carouselRef:o,orientation:s}=u();return(0,a.jsx)("div",{ref:o,className:"overflow-hidden",children:(0,a.jsx)("div",{ref:t,className:(0,i.cn)("flex","horizontal"===s?"-ml-4":"-mt-4 flex-col",r),...l})})});p.displayName="CarouselContent";let x=l.forwardRef((e,t)=>{let{className:r,...l}=e,{orientation:o}=u();return(0,a.jsx)("div",{ref:t,role:"group","aria-roledescription":"slide",className:(0,i.cn)("min-w-0 shrink-0 grow-0 basis-full","horizontal"===o?"pl-4":"pt-4",r),...l})});x.displayName="CarouselItem";let h=l.forwardRef((e,t)=>{let{className:r,variant:l="outline",size:o="icon",...d}=e,{orientation:c,scrollPrev:m,canScrollPrev:p}=u();return(0,a.jsxs)(n.$,{ref:t,variant:l,size:o,className:(0,i.cn)("absolute h-8 w-8 rounded-full","horizontal"===c?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",r),disabled:!p,onClick:m,...d,children:[(0,a.jsx)(s.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Previous slide"})]})});h.displayName="CarouselPrevious";let f=l.forwardRef((e,t)=>{let{className:r,variant:l="outline",size:o="icon",...s}=e,{orientation:c,scrollNext:m,canScrollNext:p}=u();return(0,a.jsxs)(n.$,{ref:t,variant:l,size:o,className:(0,i.cn)("absolute h-8 w-8 rounded-full","horizontal"===c?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",r),disabled:!p,onClick:m,...s,children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Next slide"})]})});f.displayName="CarouselNext"},60284:(e,t,r)=>{r.d(t,{Xi:()=>n,j7:()=>i,tU:()=>d});var a=r(24535),l=r(37631),o=r(55712),s=r(34199);let d=o.bL,i=l.forwardRef((e,t)=>{let{className:r,...l}=e;return(0,a.jsx)(o.B8,{ref:t,className:(0,s.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",r),...l})});i.displayName=o.B8.displayName;let n=l.forwardRef((e,t)=>
1{let{className:r,...l}=e;return(0,a.jsx)(o.l9,{ref:t,className:(0,s.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",r),...l})});n.displayName=o.l9.displayName,l.forwardRef((e,t)=>{let{className:r,...l}=e;return(0,a.jsx)(o.UC,{ref:t,className:(0,s.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...l})}).displayName=o.UC.displayName},97910:(e,t,r)=>{r.d(t,{default:()=>z});var a=r(24535),l=r(9544),o=r(37631),s=r(21641),d=r(40503),i=r(73574),n=r(58177),c=r(85967),u=r(4712);let m=(0,r(10453).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);var p=r(1838),x=r(72610),h=r(23924),f=r(76331),g=r(15141),b=r(24587),v=r(61967),w=r(55960),_=r(63146),j=r(40874),N=r(60284),y=r(84212),k=r(73700),R=r(67556),C=r(34199),D=r(26711),A=r(52726);function S(e){let{videos:t}=e,[r,l]=(0,o.useState)(),[s,d]=(0,o.useState)(0),i=(0,o.useRef)([]);(0,o.useEffect)(()=>{r&&(d(r.selectedScrollSnap()),r.on("select",()=>{let e=r.selectedScrollSnap();d(e),i.current.forEach(e=>{e&&e.pause()});let t=i.current[e];t&&t.play().catch(e=>{console.log("Video autoplay failed:",e)})}))},[r]),(0,o.useEffect)(()=>{let e=i.current[0];e&&e.play().catch(e=>{console.log("Video autoplay failed:",e)})},[]);let n=e=>{if(!r)return;let a=(e+1)%t.length;r.scrollTo(a)};return t&&0!==t.length?(0,a.jsxs)("div",{className:"relative w-full",children:[(0,a.jsxs)(A.FN,{setApi:l,className:"w-full",children:[(0,a.jsx)(A.Wk,{children:t.map((e,t)=>(0,a.jsx)(A.A7,{children:(0,a.jsx)("div",{className:"relative w-full",children:(0,a.jsx)("video",{ref:e=>{i.current[t]=e},src:e,controls:!0,muted:!0,autoPlay:!0,className:"w-full rounded-xl",playsInline:!0,onEnded:()=>n(t)})})},t))}),t.length>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(A.Q8,{className:"left-2"}),(0,a.jsx)(A.Oj,{className:"right-2"})]})]}),t.length>1&&(0,a.jsx)("div",{className:"mt-4 flex justify-center gap-2",children:t.map((e,t)=>(0,a.jsx)("button",{onClick:()=>null==r?void 0:r.scrollTo(t),className:"h-2 rounded-full transition-all ".concat(s===t?"w-8 bg-primary":"w-2 bg-muted-foreground/50"),"aria-label":"Go to slide ".concat(t+1)},t))})]}):null}let B={"veo-3":"/video/upload/veo3/nano-banana-veo31-demo1.mp4","sora-2":"/video/upload/sora2/sora-2-demo1.mp4","wan-2-5":"/video/upload/wan2-5/nano-banana-wan-2-5-demo1.mp4",hailuo3:"/video/upload/seedance/example15.mp4"},E=["/video/upload/home/seedance2-video1.mp4","/video/upload/home/seedance2-video2.mp4","/video/upload/home/seedance2-video3.mp4"];function z(){var e,t,r;let A=(0,h.c3)(),{ref:z,isVisible:T}=((0,f.Ym)(),(0,y.r)()),{data:F}=(0,x.wV)(),{setShowSignModal:P,setShowPricingModal:U,user:q}=(0,R.U)();null==q||null===(e=q.credits)||void 0===e||e.is_pro;let I=!!(null==q?void 0:null===(t=q.credits)||void 0===t?void 0:t.is_recharged),M=(0,g.usePathname)(),L=(0,g.useSearchParams)(),V=(0,D.al)(),W=(0,o.useRef)(null),[O,$]=(0,o.useState)("t2i"),[Q,X]=(0,o.useState)([]),[G,H]=(0,o.useState)([]),[J,K]=(0,o.useState)(""),[Y,Z]=(0,o.useState)("16:9"),[ee,et]=(0,o.useState)("1080p"),[er,ea]=(0,o.useState)("5s"),[el,eo]=(0,o.useState)(!1),[es,ed]=(0,o.useState)(!1),[ei,en]=(0,o.useState)(""),[ec,eu]=(0,o.useState)(0),[em,ep]=(0,o.useState)(null),[ex,eh]=(0,o.useState)(null),[ef,eg]=(0,o.useState)(!1),eb=(0,o.useRef)([]),ev=(0,o.useRef)(!1),ew=(0,o.useRef)(null),e_=A("upload.title_line1"),ej=A("upload.title_line2");(0,o.useEffect)(()=>{el&&V&&W.current&&requestAnimationFrame(()=>{setTimeout(()=>{var e;null===(e=W.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},300)})},[el,V]);let eN=e=>{try{return decodeURIComponent(e)}catch(t){return e}};(0,o.useEffect)(()=>{let e=(null==L?void 0:L.get("image"))||new URLSearchParams(window.location.search).get("image");if(e)try{let t=eN(e),r=eN(t);r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?G.includes(r)||(H([r]),console.log("â
[Video] Image loaded from URL parameter:",r)):(console.warn("â ï¸ [Video] Invalid image URL format:",r),b.oR.error(A("upload.image_load_failed")||"Invalid image URL format"))}catch(e){console.error("â [Video] Error loading image from URL:",e),b.oR.error(A("upload.image_load_failed")||"Failed to load image")}},[L,A,G]);let ey=()=>
1{eb.current.forEach(e=>clearTimeout(e)),eb.current=[]},ek=e=>{let t=Array.from(e),r=[];for(let e of t){if(!e.type.startsWith("image/")){b.oR.error(A("upload.file_type_error"));continue}if(e.size>524288e3){b.oR.error(A("upload.file_size_error"));continue}if(Q.length+r.length>=12){b.oR.error(A("upload.max_images"));break}r.push(e);let t=new FileReader;t.onload=e=>{var t;let r=null===(t=e.target)||void 0===t?void 0:t.result;H(e=>[...e,r])},t.readAsDataURL(e)}r.length&&(X(e=>[...e,...r]),b.oR.success(A("upload.upload_success")))},eR=async e=>{let t=Date.now(),r=new FormData;r.append("file",e);let a=await fetch("/api/upload-image",{method:"POST",body:r}),l=Date.now()-t;if(!a.ok){let e="Upload failed (".concat(a.status,")");try{let t=await a.json();e=t.error||t.details||e}catch(e){}throw console.error("[è§é¢åèä¸ä¼ ] â 失败 (".concat(l,"ms):"),e),Error(e)}let o=await a.json();if(!(null==o?void 0:o.success)||!(null==o?void 0:o.url))throw console.error("[è§é¢åèä¸ä¼ ] â ååºæ ¼å¼é误 (".concat(l,"ms):"),o),Error("upload_failed");return console.log("[è§é¢åèä¸ä¼ ] â
æå (".concat(l,"ms): ").concat(o.url)),o.url},eC=e=>{e.target.files&&ek(e.target.files)},eD=e=>{X(t=>t.filter((t,r)=>r!==e)),H(t=>t.filter((t,r)=>r!==e))},eA=async e=>{let t=0,r=async()=>{eu(Math.min(5+(t+=1)/300*85,90)),t<10?en(A("upload.progress_start")):t<25?en(A("upload.progress_analyzing")):t<60?en(A("upload.progress_creating")):t<120?en(A("upload.progress_almost")):en(A("upload.generating_magic"));try{let a=new AbortController,l=setTimeout(()=>a.abort(),5e3),o=await fetch("/api/generate-video?taskId=".concat(e),{signal:a.signal});clearTimeout(l);let s=await o.json();if(s.success&&s.data){let{status:e,generated_video_url:t,output_video_url:r,error_message:a}=s.data;if("completed"===e){let e=t||r||null;eu(100),en(A("upload.progress_complete")),ey(),setTimeout(()=>{ep(e),eh(null),e?b.oR.success(A("upload.generation_success")):b.oR.error(A("upload.generation_failed_retry")),eo(!1),ev.current=!1},400);return}if("failed"===e){ey(),b.oR.error(a||A("upload.generation_failed_retry")),eo(!1),ev.current=!1,eu(0),en("");return}}t<300?eb.current.push(window.setTimeout(r,2e3)):(ey(),b.oR.error(A("upload.generation_timeout")),eo(!1),ev.current=!1,eu(0),en(""))}catch(e){if(e instanceof Error&&"AbortError"===e.name){t<300?eb.current.push(window.setTimeout(r,2e3)):(ey(),b.oR.error(A("upload.generation_timeout")),eo(!1),ev.current=!1,eu(0),en(""));return}t<300?eb.current.push(window.setTimeout(r,2e3)):(ey(),b.oR.error(A("upload.generation_timeout")),eo(!1),ev.current=!1,eu(0),en(""))}};eo(!0),ev.current=!0,eu(0),en(A("upload.progress_start")),r()},eS=async()=>{let e=(e,t)=>{if(ev.current)return;ey(),eo(!0),ev.current=!0,eu(0),en(A("upload.progress_start"));let r=Date.now(),a=()=>{let l=Date.now()-r;eu(Math.min(90,Math.floor(l/3e4*90))),l<3e4?ew.current=window.setTimeout(a,800):(eu(100),en(e),b.oR.error(e),eo(!1),ev.current=!1,t&&setTimeout(t,600))};a()};if(!(null==F?void 0:F.user)){e("".concat(A("upload.generation_failed_retry")," ").concat(A("upload.login_required")).trim(),()=>{P(!0)});return}if("t2i"===O){if(!J.trim()){b.oR.error(A("upload.enter_prompt_error"));return}}else if(!J.trim()&&0===G.length){b.oR.error(A("upload.enter_prompt_error"));return}ey(),ep(null),eh(null);try{var t,r;let a=G.length>0,l="edit"===O&&a?"edit":"t2i",o=a?"image_to_video":"text_to_video",s="standard";eg(!0);let d=await fetch("/api/credit-rules?type=video_generation&generation_type=".concat(o,"&resolution=").concat(ee,"&duration=").concat(er,"&quality=").concat(s));if(eg(!1),!d.ok)throw Error("rule_query_failed");let i=await d.json(),n=Array.isArray(i)&&i.length>0?i[0]:null;if(!(null==n?void 0:n.model_type))throw Error("rule_not_found");let c=n.model_type,u=n.credits_consumed,m=null!==(r=null==q?void 0:null===(t=q.credits)||void 0===t?void 0:t.left_credits)&&void 0!==r?r:0;if(I||(b.oR.info(A("upload.paywall_title")),U(!0)),m<u){e(A("upload.generation_failed_insufficient_credits"),()=>U(!0));return}ey(),eo(!0),ev.current=!0,eu(5),en(A("upload.progress_creating"));let p={prompt:J,mode:l,generationType:o,resolution:ee,duration:er,quality:s,modelType:c,requiredCredits:u,aspect_ratio:Y,video_quality:ee,video_duration:er};if(a){let e=[];
1if(Q.length>0&&(en(A("upload.uploading_images")||"Uploading images..."),eu(8),(await Promise.all(Q.map(async(e,t)=>{let r=Date.now();try{let a=await eR(e);return console.log("[è§é¢åèä¸ä¼ ] [".concat(t+1,"/").concat(Q.length,"] -> ").concat(a," (").concat(Date.now()-r,"ms)")),{success:!0,url:a}}catch(e){return console.error("[è§é¢åèä¸ä¼ ] â 第 ".concat(t+1," å¼ å¤±è´¥"),e),{success:!1}}}))).forEach(t=>{t.success&&t.url&&e.push(t.url)}),0===e.length)){b.oR.error(A("upload.upload_failed")),eo(!1),ev.current=!1,eu(0),en("");return}G.forEach(t=>{(t.startsWith("http://")||t.startsWith("https://"))&&!e.includes(t)&&e.push(t)}),e.length>0&&(p.imageUrls=e)}p.provider="replicate";let x=await fetch("/api/generate-video",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}),h=await x.json();if(h.success){let e=h.taskId||h.generation_id;if(e)eA(e);else{let e=h.video||h.generated_video_url||h.generated_image_url||null;e?(ep(e),eh(h.poster||h.generated_image_url||null),b.oR.success(A("upload.generation_success"))):(ey(),b.oR.error(A("upload.generation_failed_retry"))),eo(!1),ev.current=!1}}else{let e=h.error||"generation_failed_retry",t="string"==typeof e?e.toLowerCase():e;"insufficient_credits"===t?(b.oR.error(A("upload.paywall_title")),U(!0)):b.oR.error(A("upload.api_errors.".concat(t))),eo(!1),ev.current=!1,eu(0),en("")}}catch(e){eg(!1),console.error("Error generating video:",e),e instanceof Error&&"rule_not_found"===e.message?b.oR.error(A("upload.generation_rule_missing")||"æªæ¾å°å¹é
ç积åè§å"):e instanceof Error&&"rule_query_failed"===e.message?b.oR.error(A("upload.generation_rule_failed")||"积åè§åæ¥è¯¢å¤±è´¥"):b.oR.error(A("upload.generation_failed_retry")),ey(),eo(!1),ev.current=!1,eu(0),en("")}},eB=async()=>{var e;if(!em)return;if(!(null==q?void 0:null===(e=q.credits)||void 0===e?void 0:e.is_recharged)){b.oR.info(A("upload.paywall_title")||"åçº§å° Pro çæ¬ä»¥è§£éä¸è½½åè½"),U(!0);return}let t=b.oR.loading(A("upload.download_preparing",{defaultMessage:"Preparing download..."}));ed(!0);try{await (0,k.A)(em,"wan-video-".concat(Date.now(),".mp4")),b.oR.success(A("upload.download_success",{defaultMessage:"Download completed"}),{id:t})}catch(e){console.error("download video error:",e),b.oR.error(A("upload.download_failed",{defaultMessage:"Download failed"}),{id:t})}finally{ed(!1)}};(0,o.useEffect)(()=>()=>{ey(),ew.current&&clearTimeout(ew.current)},[]),(0,o.useEffect)(()=>{"t2i"===O&&(X([]),H([]))},[O]),(null===(r=Object.entries(B).find(e=>{let[t]=e;return M.includes(t)}))||void 0===r?void 0:r[1])||B["veo-3"];let eE=(0,h.c3)("banner");return(0,a.jsxs)("section",{ref:z,id:"upload-section",className:"py-12 md:py-20 relative overflow-hidden transition-all duration-1000 bg-background ".concat(T?"opacity-100 translate-y-0":"opacity-0 translate-y-20"),children:[(0,a.jsx)("div",{className:"absolute inset-0 ".concat(l.oQ," opacity-90")}),(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-white/8 via-transparent to-white/8"}),(0,a.jsx)("div",{className:"pointer-events-none absolute inset-3 rounded-3xl border border-border/60"}),(0,a.jsxs)("div",{className:"mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 2xl:px-16 relative z-10",children:[!(null==F?void 0:F.user)&&(0,a.jsx)("div",{className:"mb-5 flex justify-center",children:(0,a.jsxs)("button",{type:"button",onClick:()=>P(!0),className:"group inline-flex max-w-full items-center justify-center gap-3 overflow-hidden rounded-full border border-white/15 bg-black/35 px-4 py-2.5 text-left backdrop-blur-md shadow-sm transition-all duration-300 hover:border-white/25 hover:bg-black/45 hover:shadow",children:[(0,a.jsx)("span",{className:"flex h-6 w-6 flex-none items-center justify-center rounded-md bg-emerald-500/80 shadow-sm md:h-7 md:w-7",children:(0,a.jsx)(s.A,{className:"h-3 w-3 text-white md:h-3.5 md:w-3.5"})}),(0,a.jsx)("span",{className:"max-w-[70vw] truncate text-xs font-medium text-white/90 md:max-w-[560px] md:text-sm",children:eE("new_user_cta")}),(0,a.jsx)(d.A,{className:"h-4 w-4 flex-none text-white/70 transition-transform group-hover:translate-x-0.5"})]})}),(0,a.jsxs)("div",{className:"text-center mb-10 md:mb-14",children:[(0,a.jsx)("h1",{className:"text-4xl md:text-6xl font-bold drop-shadow-sm leading-tight",children:(0,a.jsx)("span",{className:"block text-white",children:A("hero.title_line1")})}),(0,a.jsx)("h2",{className:"mt-2 text-4xl md:text-6xl font-bold leading-tight text-white drop-shadow-[0_0_25px_rgba(255,255,255,0.85)]",children:A("hero.title_line2")}),(0,a.jsx)("p",{className:"mt-4 text-base md:text-lg text-muted-foreground max-w-3xl mx-auto",children:A("hero.subtitle")})]}),(0,a.jsxs)(_.Zp,{className:"p-4 sm:p-6 md:p-10 bg-card/90 backdrop-blur-xl border border-border shadow-2xl rounded-3xl",children:[(0,a.jsx)(N.tU,{value:O,onValueChange:e=>$(e),children:(0,a.jsxs)(N.j7,{className:"mx-auto w-full sm:w-auto grid grid-cols-2 sm:inline-flex items-center justify-center rounded-2xl bg-card/80 backdrop-blur-md p-2 shadow-md h-14 gap-2 mb-8",children:[(0,a.jsx)(N.Xi,{value:"t2i",className:(0,C.cn)("text-base md:text-lg px-6 py-3 rounded-xl transition-all","data-[state=active]:text-zinc-950 data-[state=active]:shadow-lg","data-[state=active]:[background:linear-gradient(90deg,#10B981_0%,#2DD4BF_50%,#06B6D4_100%)]"),children:A("upload.tab_t2i")}),(0,a.jsx)(N.Xi,{value:"edit",className:(0,C.cn)("text-base md:text-lg px-6 py-3 rounded-xl transition-all","data-[state=active]:text-zinc-950 data-[state=active]:shadow-lg","data-[state=active]:[background:linear-gradient(90deg,#10B981_0%,#2DD4BF_50%,#06B6D4_100%)]"),children:A("upload.tab_edit")})]})}),(0,a.jsxs)("div",{className:"grid lg:grid-cols-12 gap-8 md:gap-12 items-start",children:[(0,a.jsxs)("div",{className:"space-y-6 lg:col-span-4 xl:col-span-4",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("p",{className:"text-base md:text-lg font-semibold drop-shadow-sm mb-3",children:[(0,a.jsx)("span",{className:"block text-white/90",children:e_}),(0,a.jsx)("span",{className:"block text-white drop-shadow-[0_0_18px_rgba(255,255,255,0.9)]",children:ej})]})}),"edit"===O&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("label",{className:"block text-sm font-semibold text-foreground mb-2",children:A("upload.upload_image_label")}),0===G.length?(0,a.jsxs)("div",{className:(0,C.cn)("border-2 border-dashed rounded-lg p-6 text-center transition-colors cursor-pointer bg-card/70","hover:border-emerald-500/40 border-border"),onClick:()=>{var e;return null===(e=document.getElementById("video-reference-upload"))||void 0===e?void 0:e.click()},onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),e.dataTransfer.files&&ek(e.dataTransfer.files)},children:[(0,a.jsx)(i.A,{className:"w-8 h-8 mx-auto mb-3 text-muted-foreground"}),(0,a.jsx)("p",{className:"text-sm text-foreground mb-2",children:A("upload.upload_image_click_text")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:A("upload.upload_image_formats")}),(0,a.jsx)("input",{type:"file",id:"video-reference-upload",multiple:!0,accept:"image/*",onChange:eC,className:"hidden"})]}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:[G.map((e,t)=>(0,a.jsxs)("div",{className:"relative w-full h-32 rounded-lg overflow-hidden border border-border bg-card",children:[(0,a.jsx)(v.p,{src:e,alt:A("upload.upload_image_alt"),className:"w-full h-full object-cover",loadingText:A("upload.image_loading_message")}),(0,a.jsx)("button",{onClick:()=>eD(t),className:"absolute top-2 right-2 p-1 bg-red-500 text-white rounded-full hover:bg-red-600 transition-colors z-10",title:A("upload.remove_image"),children:(0,a.jsx)(n.A,{className:"w-4 h-4"})})]},t)),G.length<12&&(0,a.jsxs)("div",{className:"border-2 border-dashed border-border rounded-lg p-6 text-center hover:border-emerald-500/40 transition-colors cursor-pointer bg-card/60",onClick:()=>{var e;return null===(e=document.getElementById("video-reference-upload"))||void 0===e?void 0:e.click()},children:[(0,a.jsx)(i.A,{className:"w-8 h-8 mx-auto mb-3 text-muted-foreground"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:A("upload.add_image_progress",{count:G.length})})]})]}),(0,a.jsx)("input",{type:"file",id:"video-reference-upload",multiple:!0,accept:"image/*",onChange:eC,className:"hidden"})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("p",{className:"text-sm font-semibold text-foreground",children:[A("upload.prompt_label"),(0,a.jsxs)("span",{className:"ml-1 text-xs text-muted-foreground",children:["(",A("upload.prompt_required_label",{defaultMessage:"Required"}),")"]})]})}),(0,a.jsx)(j.T,{value:J,onChange:e=>K(e.target.value),placeholder:A("upload.prompt_placeholder"),className:"min-h-[120px] gradient-card border-0 text-foreground placeholder:text-muted-foreground rounded-lg backdrop-blur-md resize-none",maxLength:800}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,a.jsxs)("span",{children:[J.length,"/800"]}),(0,a.jsx)("span",{children:A("upload.smart_expansion")})]})]}),(0,a.jsx)("div",{className:"space-y-6",children:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"block text-sm font-semibold text-foreground mb-3",children:A("upload.aspect_ratio_label")}),(0,a.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:[{ratio:"16:9",width:28,height:16},{ratio:"9:16",width:16,height:28},{ratio:"4:3",width:20,height:15},{ratio:"3:4",width:15,height:20},{ratio:"21:9",width:35,height:15},{ratio:"1:1",width:20,height:20}].map(e=>{let{ratio:t,width:r,height:l}=e;return(0,a.jsxs)("button",{type:"button",onClick:()=>Z(t),className:(0,C.cn)("flex flex-col items-center gap-2 px-2 py-3 rounded-xl border transition-all",Y===t?"border-emerald-400/70 bg-gradient-to-br from-[#10B981] to-[#2DD4BF] text-zinc-950 shadow-[0_0_20px_rgba(16,185,129,0.25)]":"bg-card text-foreground border-border hover:border-emerald-500/40"),children:[(0,a.jsx)("div",{className:(0,C.cn)("rounded transition-all",Y===t?"bg-zinc-950":"bg-muted-foreground
1/60"),style:{width:"".concat(r,"px"),height:"".concat(l,"px")}}),(0,a.jsx)("span",{className:"text-xs font-medium whitespace-nowrap",children:t})]},t)})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"block text-sm font-semibold text-foreground mb-2",children:A("upload.video_quality_label")}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:["720p","1080p"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>et(e),className:(0,C.cn)("rounded-xl border px-4 py-3 text-center text-sm font-semibold transition-all",ee===e?"border-emerald-400/70 bg-gradient-to-br from-[#10B981] to-[#2DD4BF] text-zinc-950 shadow-[0_0_20px_rgba(16,185,129,0.25)]":"bg-card text-foreground border-border hover:border-emerald-500/40"),children:A("upload.video_quality_options.".concat(e))},e))})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"block text-sm font-semibold text-foreground mb-2",children:A("upload.video_duration_label")}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:["5s","10s"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>ea(e),className:(0,C.cn)("rounded-xl border px-4 py-3 text-center text-sm font-semibold transition-all",er===e?"border-emerald-400/70 bg-gradient-to-br from-[#10B981] to-[#2DD4BF] text-zinc-950 shadow-[0_0_20px_rgba(16,185,129,0.25)]":"bg-card text-foreground border-border hover:border-emerald-500/40"),children:A("upload.video_duration_options.".concat(e))},e))})]})]})}),(0,a.jsx)(w.$,{onClick:eS,className:"w-full h-12 bg-gradient-to-r from-[#10B981] via-[#2DD4BF] to-[#10B981] text-zinc-950 font-bold rounded-full shadow-lg shadow-emerald-500/20 hover:shadow-emerald-500/30 transition-all duration-300 disabled:opacity-50 border-0",disabled:el,children:el?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{className:"w-4 h-4 mr-2 animate-spin"}),(0,a.jsx)("span",{children:ei||A("upload.generating_text")})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.A,{className:"w-4 h-4 mr-2"}),(0,a.jsx)("span",{children:A("upload.generate_with_ai_editor")})]})}),el&&(0,a.jsxs)("div",{ref:W,className:"space-y-3",children:[(0,a.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,a.jsx)("div",{className:"bg-gradient-to-r from-[#10B981] via-[#2DD4BF] to-[#10B981] h-2 rounded-full transition-all duration-500",style:{width:"".concat(ec,"%")}})}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground text-center",children:ei||A("upload.progress_creating")})]})]}),(0,a.jsxs)("div",{className:"relative lg:col-span-8 xl:col-span-8",children:[em?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"bg-card/60 rounded-lg p-4 border border-border",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-2",children:A("upload.generated_video_title")}),(0,a.jsx)("video",{src:em,poster:ex||void 0,controls:!0,className:"w-full rounded-xl shadow-2xl"})]}),(0,a.jsxs)(w.$,{onClick:eB,className:"w-full h-12 bg-gradient-to-r from-[#10B981] via-[#2DD4BF] to-[#10B981] text-zinc-950 font-bold rounded-lg shadow-lg shadow-emerald-500/20 hover:shadow-xl transition-all duration-300",children:[(0,a.jsx)(m,{className:"w-4 h-4 mr-2"}),es?A("upload.download_video_in_progress",{defaultMessage:"Downloading video..."}):A("upload.download_video",{defaultMessage:"Download Video"})]})]}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"mb-1",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-foreground",children:A("upload.sample_title")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:A("upload.sample_desc")})]}),(0,a.jsx)("div",{className:"rounded-xl border border-border overflow-hidden bg-card",children:(0,a.jsx)(S,{videos:E})}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:A("upload.sample_tip")})]}),el&&(0,a.jsxs)("div",{className:"absolute inset-0 rounded-xl bg-white/85 backdrop-blur-md border border-emerald-200 flex flex-col items-center justify-center p-6 z-10 shadow-lg",children:[(0,a.jsxs)("div",{className:"relative mb-4",children:[(0,a.jsx)("div",{className:"w-14 h-14 roun
1ded-full border-2 border-emerald-200"}),(0,a.jsx)(c.A,{className:"absolute inset-0 m-auto w-10 h-10 text-emerald-500 animate-spin"})]}),(0,a.jsx)("h4",{className:"text-base font-semibold text-black mb-1",children:A("upload.preview_processing_title")}),(0,a.jsx)("p",{className:"text-sm text-black text-center mb-4 max-w-sm",children:ei||A("upload.preview_processing_desc")}),(0,a.jsx)("div",{className:"w-full bg-muted rounded-full h-2 overflow-hidden",children:(0,a.jsx)("div",{className:"h-2 bg-gradient-to-r from-[#10B981] via-[#2DD4BF] to-[#10B981] rounded-full transition-all duration-1000",style:{width:"".concat(ec,"%")}})}),(0,a.jsx)("p",{className:"mt-2 text-xs text-black text-center",children:A("upload.preview_processing_tip")}),!I&&(0,a.jsxs)("div",{className:"mt-3 flex w-full flex-col items-center justify-center gap-2 rounded-lg border border-emerald-200/80 bg-emerald-50/90 px-3 py-2 sm:flex-row sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs sm:text-sm text-emerald-900 text-center sm:text-left",children:[(0,a.jsx)(p.A,{className:"h-4 w-4 text-emerald-500"}),(0,a.jsx)("span",{children:A("upload.skip_queue_hint")})]}),(0,a.jsx)(w.$,{type:"button",size:"sm",variant:"outline",className:"border-emerald-400 bg-white text-emerald-900 hover:bg-emerald-100",onClick:()=>U(!0),children:A("upload.skip_queue_cta")})]})]})]})]})]})]})]})}}}]);
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.