PageSourceSearch

https://zopia.ai/_next/static/chunks/9404-a0f100ca9a54d547.js

js zopia.ai collected 2026-10-05 13:21:14 UTC 31,351 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8fcf376d-b683-4399-bfb7-f493615d3acd",e._sentryDebugIdIdentifier="sentry-dbid-8fcf376d-b683-4399-bfb7-f493615d3acd")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9404],{19404:function(e,t,r){r.d(t,{Z:function(){return z}});var a=r(85893),i=r(67294),s=r(9008),o=r.n(s),n=r(98826),l=r(7210),c=r(11163),d=r(33299),u=r(37871),p=r(64712),m=r(79821),h=r(4844),x=r(36316),g=r(57854),b=r(31784),f=r(58058),v=r(15319),F=r(10176),w=r(57216),j=r(58918),y=r(7770),N=r(20062),C=r(22271),k=r(81110),_=r(8396),S=r(32502),T=r(99288),I=r(47276),M=r(86504),A=r(37252),L=r(62755),E=r(24344),O=r(82166),P=r(20060);function q(e){var t,r;let{example:s,ns:o,t:n,locale:l,modelName:c,onSelectMedia:d,onUsePrompt:u}=e,p=(0,i.useRef)(null),m=(null===(t=s.thumbnail)||void 0===t?void 0:t.type)==="video",x=(0,L.N)(s.prompt,l),g="".concat(c," example: ").concat(x.slice(0,100));return(0,a.jsxs)(f.Zb,{className:"group h-full overflow-hidden rounded-none border border-white/[0.06] bg-gradient-to-br from-white/[0.08] via-white/[0.03] to-transparent backdrop-blur-sm transition-all duration-500 hover:border-[#FFFF9C]/30 hover:shadow-[0_0_40px_-10px_rgba(255,255,156,0.15)] hover:-translate-y-1.5 flex flex-col",children:[(0,a.jsxs)("div",{className:"relative aspect-video w-full overflow-hidden cursor-pointer flex-shrink-0",onMouseEnter:()=>{var e;return m&&(null===(e=p.current)||void 0===e?void 0:e.play())},onMouseLeave:()=>{if(m){var e;null===(e=p.current)||void 0===e||e.pause(),p.current&&(p.current.currentTime=0)}},onClick:e=>{var t;e.stopPropagation(),d((null===(t=s.thumbnail)||void 0===t?void 0:t.url)||null)},children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/40 via-transparent to-transparent z-10 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),(null===(r=s.thumbnail)||void 0===r?void 0:r.url)?m?(0,a.jsx)("video",{ref:p,src:s.thumbnail.url,"aria-label":g,className:"h-full w-full object-cover transition-transform duration-700 group-hover:scale-105",muted:!0,playsInline:!0,loop:!0,preload:"metadata"}):(0,a.jsx)("img",{src:s.thumbnail.url,alt:g,className:"h-full w-full object-cover transition-transform duration-700 group-hover:scale-105"}):(0,a.jsx)("div",{className:"flex h-full w-full items-center justify-center bg-gradient-to-br from-white/[0.03] to-transparent",children:(0,a.jsx)("div",{className:"w-12 h-12 border border-white/10 flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-0 h-0 border-t-[5px] border-t-transparent border-l-[8px] border-l-white/30 border-b-[5px] border-b-transparent ml-0.5"})})}),(0,a.jsx)("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-[#FFFF9C]/30 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"})]}),(0,a.jsxs)(f.aY,{className:"p-5 flex flex-col flex-grow",children:[(0,a.jsxs)("p",{className:"text-base leading-relaxed text-white/80 line-clamp-3 group-hover:text-white transition-colors",children:[(0,a.jsxs)("span",{className:"text-white/50",children:[n("".concat(o,":card.prompt")),": "]}),(0,L.N)(s.prompt,l)]}),(0,a.jsx)("div",{className:"flex-grow min-h-4"}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[s.original_url&&(0,a.jsx)("a",{href:s.original_url,target:"_blank",rel:"noopener noreferrer",className:"group/source flex items-center justify-center w-7 h-7 border border-white/[0.08] bg-white/[0.03] text-white/70 transition-all duration-200 hover:bg-[#FFFF9C]/10 hover:border-[#FFFF9C]/30 hover:text-[#FFFF9C]",onClick:e=>e.stopPropagation(),title:n("".concat(o,":card.viewSource")),children:(0,a.jsx)(h.Z,{className:"w-3.5 h-3.5"})}),(0,a.jsx)(w.k,{prompt:s.prompt,locale:l})]}),(0,a.jsxs)("button",{className:"group/btn flex items-center gap-1.5 border border-white/[0.08] bg-white/[0.03] px-3 py-1.5 text-[11px] font-medium text-white/70 transition-all duration-200 hover:bg-[#FFFF9C]/10 hover:border-[#FFFF9C]/30 hover:text-[#FFFF9C]",onClick:e=>{e.stopPropagation(),u(s,l)},children:[(0,a.jsx)("span",{children:n("".concat(o,":card.usePrompt"))}),(0,a.jsx)("svg",{className:"w-3 h-3 transition-transform duration-200 group-hover/btn:translate-x-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})}function R(e){var t,r,s;
1let{item:o,ns:n,mediaType:l,t:c,onUsePrompt:d,onDelete:u,onToggleFavorite:p,onSelectMedia:h}=e,[g,b]=(0,i.useState)(!1),v=(0,i.useRef)(null),w=((e,t)=>{switch(e){case"pending":return{label:c("".concat(n,":history.status.pending")),className:"bg-white/[0.08] text-white/60 border-white/[0.1]"};case"queued":return{label:c("".concat(n,":history.status.queued"),{position:t||1}),className:"bg-[#FFFF9C]/10 text-[#FFFF9C] border-[#FFFF9C]/30"};case"generating":return{label:c("".concat(n,":history.status.generating")),className:"bg-[#FFFF9C]/20 text-[#FFFF9C] border-[#FFFF9C]/40"};case"completed":return{label:c("".concat(n,":history.status.completed")),className:"bg-[#FFFF9C]/15 text-[#FFFF9C] border-[#FFFF9C]/30"};case"failed":return{label:c("".concat(n,":history.status.failed")),className:"bg-white/[0.08] text-white/50 border-white/[0.1]"};default:return{label:c("".concat(n,":history.status.unknown")),className:"bg-white/[0.08] text-white/50 border-white/[0.1]"}}})(o.status,o.queuePosition),j="completed"===o.status&&o.resultUrl,y=(null===(t=T.bg[o.videoModel])||void 0===t?void 0:t.label)||"AI";return(0,a.jsxs)(f.Zb,{className:"group h-full overflow-hidden rounded-none border border-white/[0.06] bg-gradient-to-br from-white/[0.08] via-white/[0.03] to-transparent backdrop-blur-sm transition-all duration-500 hover:border-[#FFFF9C]/30 hover:shadow-[0_0_40px_-10px_rgba(255,255,156,0.15)] hover:-translate-y-1.5 flex flex-col",children:[(0,a.jsxs)("div",{className:"relative aspect-video w-full overflow-hidden flex-shrink-0 bg-gradient-to-br from-white/[0.03] to-transparent ".concat(j?"cursor-pointer":""),onMouseEnter:()=>{var e;return"video"===l&&j&&(null===(e=v.current)||void 0===e?void 0:e.play())},onMouseLeave:()=>{"video"===l&&j&&v.current&&(v.current.pause(),v.current.currentTime=0)},onClick:e=>{j&&(e.stopPropagation(),h(o.resultUrl||null,l))},children:[j?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/40 via-transparent to-transparent z-10 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),"video"===l?(0,a.jsx)("video",{ref:v,src:o.resultUrl,"aria-label":(null===(r=o.prompt)||void 0===r?void 0:r.slice(0,100))||"Generated video",className:"h-full w-full object-cover transition-transform duration-700 group-hover:scale-105",muted:!0,playsInline:!0,loop:!0,preload:"metadata"}):(0,a.jsx)("img",{src:o.resultUrl,alt:(null===(s=o.prompt)||void 0===s?void 0:s.slice(0,100))||"Generated image",className:"h-full w-full object-cover transition-transform duration-700 group-hover:scale-105"})]}):"failed"===o.status?(0,a.jsx)(m.Z,{error:o.error}):(0,a.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-black/20 gap-2",children:["queued"===o.status&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[#FFFF9C] animate-pulse"}),(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[#FFFF9C] animate-pulse [animation-delay:0.2s]"}),(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[#FFFF9C] animate-pulse [animation-delay:0.4s]"})]}),"generating"===o.status&&(0,a.jsx)(x.Z,{className:"w-6 h-6 text-[#FFFF9C] animate-spin"}),(0,a.jsx)("span",{className:"text-xs text-[#FFFF9C]/80",children:w.label})]}),(0,a.jsx)("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-[#FFFF9C]/30 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"})]}),(0,a.jsxs)(f.aY,{className:"p-5 flex flex-col flex-grow",children:[(0,a.jsxs)("p",{className:"text-base leading-relaxed text-white/80 line-clamp-3 group-hover:text-white transition-colors",children:[(0,a.jsxs)("span",{className:"text-white/50",children:[c("".concat(n,":card.prompt")),": "]}),o.prompt]}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,a.jsx)("span",{className:"text-[10px] text-white/40 px-2 py-0.5 bg-white/[0.05] border border-white/[0.08]",children:y}),o.aspectRatio&&(0,a.jsx)("span",{className:"text-[10px] text-white/40 px-2 py-0.5 bg-white/[0.05] border border-white/[0.08]",children:o.aspectRatio}),"video"===l&&o.duration?(0,a.jsxs)("span",{className:"text-[10px] text-white/40 px-2 py-0.5 bg-white/[0.05] border border-white/[0.08]",children:[o.duration,"s"]}):null,o.resolution&&(0,a.jsx)("span",{className:"text-[10px] text-white/40 px-2 py-0.5 bg-white/[0.05] border border-white/[0.08]",children:o.resolution})]}),(0,a.jsx)("div",{className:"flex-grow min-h-4"}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{className:"p-1.5 transition-all duration-200 border ".concat(o.isFavorite?"bg-[#FFFF9C]/20 border-[#FFFF9C]/50 text-[#FFFF9C]":"bg-white/[0.03] border-white/[0.08] text-white/40 hover:text-[#FFFF9C] hover:border-[#FFFF9C]/30"),onClick:e=>{e.stopPropagation(),p(o.id)},title:o.isFavorite?c("".concat(n,":history.unfavorite")):c("".concat(n,":history.favorite")),children:(0,a.jsx)("svg",{className:"w-3.5 h-3.5",fill:o.isFavorite?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})})}),(0,a.jsxs)(F.J2,{open:g,onOpenChange:b,children:[(0,a.jsx)(F.xo,{asChild:!0,children:(0,a.jsx)("button",{className:"p-1.5 bg-white/[0.03] border border-white/[0.08] text-white/40 transition-all duration-200 hover:text-white/70 hover:border-white/20",onClick:e=>e.stopPropagation(),title:c("".concat(n,":history.delete")),children:(0,a.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})}),(0,a.jsxs)(F.yk,{className:"w-56 p-3 bg-[#1f1f1f] border border-white/[0.08] rounded-lg shadow-xl",side:"top",align:"center",sideOffset:8,onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("p",{className:"text-[12px] text-white/70 mb-3",children:c("".concat(n,":history.deleteConfirm"))}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)("button",{onClick:()=>b(!1),className:"px-3 py-1.5 text-[11px] font-medium text-white/50 hover:text-white/70 hover:bg-white/[0.06] rounded transition-all duration-200",children:c("".concat(n,":common.cancel"))}),(0,a.jsx)("button",{onClick:()=>{u(o.id),b(!1)},className:"px-3 py-1.5 text-[11px] font-medium bg-red-500/90 text-white hover:bg-red-500 rounded transition-all duration-200",children:c("".concat(n,":common.confirm"))})]})]})]})]}),(0,a.jsxs)("button",{className:"group/btn flex items-center gap-1.5 border border-white/[0.08] bg-white/[0.03] px-3 py-1.5 text-[11px] font-medium text-white/70 transition-all duration-200 hover:bg-[#FFFF9C]/10 hover:border-[#FFFF9C]/30 hover:text-[#FFFF9C]",onClick:e=>{e.stopPropagation(),d(o.prompt,o.mediaItems,o)},children:[(0,a.jsx)("span",{children:c("".concat(n,":history.usePrompt"))}),(0,a.jsx)("svg",{className:"w-3 h-3 transition-transform duration-200 group-hover/btn:translate-x-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})}function Z(e){let{ns:t,mediaType:r,refreshKey:s,t:o,onUsePrompt:n,onSelectMedia:l}=e,[c,d]=(0,i.useState)([]),[u,m]=(0,i.useState)(!0),[h,x]=(0,i.useState)(!1);(0,i.useEffect)(()=>{d((0,P.rt)())},[s]);let g=e=>{(0,P.sl)(e),d((0,P.rt)())},b=e=>{(0,P.mN)(e),d(t=>t.map(t=>
1t.id===e?{...t,isFavorite:!t.isFavorite}:t))},f=[...c].sort((e,t)=>e.isFavorite&&!t.isFavorite?-1:!e.isFavorite&&t.isFavorite?1:new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());return 0===c.length?null:(0,a.jsxs)("section",{className:"relative mx-auto max-w-6xl px-6 pb-10",children:[(0,a.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"h-px w-8 bg-gradient-to-r from-[#FFFF9C]/50 to-transparent"}),(0,a.jsx)("span",{className:"text-xs font-medium tracking-widest text-white/40 uppercase",children:o("".concat(t,":history.title"))}),(0,a.jsx)("span",{className:"px-2 py-0.5 text-[10px] bg-[#FFFF9C]/10 text-[#FFFF9C] border border-[#FFFF9C]/30",children:c.length})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("button",{onClick:()=>x(!0),className:"text-[11px] text-white/40 hover:text-white/70 transition-colors flex items-center gap-1",children:[(0,a.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),o("".concat(t,":history.clear"))]}),(0,a.jsx)("button",{onClick:()=>m(!u),className:"p-1.5 border border-white/[0.08] bg-white/[0.03] text-white/50 hover:text-white/80 hover:border-[#FFFF9C]/30 transition-all duration-200",children:(0,a.jsx)("svg",{className:"w-4 h-4 transition-transform duration-300 ".concat(u?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]})]}),(0,a.jsx)("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3 overflow-hidden transition-all duration-500 ".concat(u?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"),children:f.map(e=>(0,a.jsx)(R,{item:e,ns:t,mediaType:r,t:o,onUsePrompt:n,onDelete:g,onToggleFavorite:b,onSelectMedia:l},e.id))}),(0,a.jsx)(v.Vq,{open:h,onOpenChange:x,children:(0,a.jsxs)(v.cZ,{className:"max-w-md bg-[#1f1f1f] border border-white/[0.08] rounded-xl p-0 overflow-hidden shadow-2xl",children:[(0,a.jsxs)("div",{className:"p-5 pb-3",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-red-500/15 flex items-center justify-center",children:(0,a.jsx)("svg",{className:"w-4 h-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)("h3",{className:"text-[15px] font-medium text-white/90",children:o("".concat(t,":history.clearConfirmTitle"))})})]}),(0,a.jsx)("p",{className:"mt-3 text-[13px] text-white/50 leading-relaxed",children:o("".concat(t,":history.clearConfirmMessage"))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2 px-5 py-4 bg-white/[0.02]",children:[(0,a.jsx)("button",{onClick:()=>x(!1),className:"px-4 py-2 text-[13px] font-medium text-white/60 hover:text-white/80 hover:bg-white/[0.06] rounded-lg transition-all duration-200",children:o("".concat(t,":common.cancel"))}),(0,a.jsx)("button",{onClick:()=>{(0,P.lJ)(),d([]),x(!1),p.Am.success(o("".concat(t,":history.clearSuccess")))},className:"px-4 py-2 text-[13px] font-medium bg-red-500/90 text-white hover:bg-red-500 rounded-lg transition-all duration-200 shadow-lg shadow-red-500/20",children:o("".concat(t,":common.confirm"))})]})]})})]})}function z(e){let{config:t,examples:r}=e,{i18nNamespace:s,slug:m,defaultModelId:h,modelName:x,creator:f,canonicalPath:F,baseId:w,mediaType:R,showHistory:z=!0}=t,{t:B,i18n:U}=(0,u.$G)(),V=(0,c.useRouter)(),{status:W}=(0,d.useSession)(),D=U.language||V.locale||"en",{setBaseInfo:G}=(0,M.E)();(0,i.useEffect)(()=>{G(w,x,I.Bm.PRIVATE,!0,!1)},[G,w,x]);let[H,J]=(0,i.useState)(null),Y=(0,i.useMemo)(()=>{var e,t;let r=T.bg[h],a=null==r?void 0:r.options;return{model_id:h,aspect_ratio:(null==a?void 0:null===(e=a.aspectRatio)||void 0===e?void 0:e[0])||"16:9",duration:(null==a?void 0:a.defaultDuration)?String(a.defaultDuration):"5",resolution:(null==a?void 0:a.defaultResolution)||(null==a?void 0:null===(t=a.resolution)||void 0===t?void 0:t[0])||"720p",prompt:"",generate_audio:!0}},[h]),[$,Q]=(0,i.useState)(Y),K=(0,i.useRef)(null),X=(0,i.useRef)(0),ee=(0,i.useRef)(null),[et,er]=(0,i.useState)(0);(0,i.useEffect)(()=>{let e=async()=>{let e=(0,P.rt)(),t=e.filter(e=>"pending"===e.status||"queued"===e.status||"generating"===e.status);if(0===t.length)return;let r=!1;await Promise.all(t.map(async e=>{if(e.taskId)try{var t,a;let i=new URL("/api/base/task/status",window.location.origin);i.searchParams.append("task_id",e.taskId);let s=await fetch(i.toString());if(!s.ok)return;let o=await s.json(),n=e.status;if("succeeded"===o.status?n="completed":"failed"===o.status?n="failed":(null===(t=o.queue_info)||void 0===t?void 0:t.position)?n="queued":"processing"===o.status&&(n="generating"),n!==e.status&&(r=!0,(0,P.Yr)(e.id,n,(null===(a=o.queue_info)||void 0===a?void 0:a.position)||void 0,o.error)),"completed"===n&&o.result_url&&!e.resultUrl){r=!0;let t=(0,P.rt)().map(t=>
1t.id===e.id?{...t,resultUrl:o.result_url,updatedAt:new Date().toISOString()}:t);localStorage.setItem("seedance_video_history",JSON.stringify(t))}}catch(e){console.error("Poll task status error:",e)}})),r&&er(e=>e+1)};e();let t=setInterval(e,3e3);return()=>clearInterval(t)},[et]);let ea=(0,i.useCallback)(async e=>{let t=Date.now();if(t-X.current<3e3){p.Am.error(B("base:generation.rateLimitTooFrequent"));return}let r=JSON.stringify(e);if(ee.current===r){let e=window.confirm(B("base:generation.sameParamsConfirm"));if(!e)return}X.current=t,ee.current=r,Q(e);let a="authenticated"===W;if(!a){p.Am.error(B("".concat(s,":auth.loginRequired"))),(0,d.signIn)();return}try{var i,o,n,l,c,u;let t;let r=T.bg[e.model_id],a=null!==(c=e.ref_assets)&&void 0!==c?c:[],d=null===(i=r.options)||void 0===i?void 0:i.inputFileFormat,m=null!==(u=null===(o=r.options)||void 0===o?void 0:o.supportImageInput)&&void 0!==u?u:0,h=a.filter(e=>{if(!d||0===d.length)return"image"===e.type&&m>0;let t=d.find(t=>"image"===e.type?t.startsWith("image/"):"video"===e.type?t.includes(".mp4")||t.includes(".mov"):"audio"===e.type&&(t.includes(".wav")||t.includes(".mp3")));return!!t}),x={...e,ref_assets:h.length>0?h:void 0,input_images:h.filter(e=>"image"===e.type).map(e=>e.url)},g=await fetch("/api/base/task",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({generation_params:x,from:"seo"})});if(!g.ok){let e=await g.json();throw Error(e.error||B("".concat(s,":errors.submitFailed")))}let b=await g.json(),f="pending";b.queue_info&&(b.queue_info.position?(f="queued",t=b.queue_info.position):"processing"===b.queue_info.status&&(f="generating")),(0,P.SH)({prompt:(null===(n=e.prompt)||void 0===n?void 0:n.trim())||"",status:f,aspectRatio:e.aspect_ratio||"16:9",duration:parseInt(e.duration||"5"),resolution:e.resolution||"720p",videoModel:e.model_id,queuePosition:t,taskId:b.task_id,mediaItems:h.map(e=>({url:e.url,name:e.name,type:e.type}))}),p.Am.success(B("".concat(s,":success.taskSubmitted"))),null===(l=K.current)||void 0===l||l.setPrompt("")}catch(e){console.error("Generate error:",e),p.Am.error(e instanceof Error?e.message:B("".concat(s,":errors.submitFailed")))}},[W,B,s]),ei=B("".concat(s,":faqSection.items"),{returnObjects:!0})||[],es=(0,i.useMemo)(()=>{let e=B("".concat(s,":hero.subtitleParts"),{returnObjects:!0});return Array.isArray(e)?e:[]},[B,s,D]),eo=(0,i.useMemo)(()=>{if("video"!==R)return null;let e=(r||[]).map(e=>({example:e,media:(0,O.f)(e)})).filter(e=>!!e.media).slice(0,6);return 0===e.length?null:{"@context":"https://schema.org","@graph":e.map(e=>{let{example:t,media:r}=e,a=(0,L.N)(t.prompt,D),i="".concat(x," example: ").concat(a.slice(0,80));return{"@type":"VideoObject",name:i,description:a,...r}})}},[r,D,R,x]),en=B("".concat(s,":comparison.rows"),{returnObjects:!0,defaultValue:[]})||[],el=Array.isArray(en)&&en.length>0,ec=B("".concat(s,":specs.rows"),{returnObjects:!0,defaultValue:[]})||[],ed=Array.isArray(ec)&&ec.length>0,eu=B("".concat(s,":relatedModels.title"),{defaultValue:""}),ep=["en","zh","ja"].includes(D),em=ep?D:"en",eh="".concat(b._O).concat((0,E.Vz)(
1F,em));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o(),{children:[(0,n.$)({title:(0,b.r7)(B("".concat(s,":title")),50),description:(0,b.r7)(B("".concat(s,":description")),155),canonical:eh,openGraph:{url:eh,title:(0,b.r7)(B("".concat(s,":title")),50),description:(0,b.r7)(B("".concat(s,":description")),155),images:[{url:b.R9,width:b.oL,height:b.V5,alt:"".concat(x," - AI Generator")}]}}),(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"SoftwareApplication",name:x,applicationCategory:"MultimediaApplication",operatingSystem:"Web",description:B("".concat(s,":description")),url:eh,offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},creator:{"@type":"Organization",name:f},isPartOf:{"@type":"WebSite",name:"Zopia",url:b._O}})}},"".concat(w,"-software-jsonld")),Array.isArray(ei)&&ei.length>0&&(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:ei.map(e=>({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))})}},"".concat(w,"-faq-jsonld")),eo&&(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(eo)}},"".concat(w,"-video-jsonld"))]}),(0,a.jsx)(l.gR,{items:[{name:B("blog:home"),item:b._O},{name:x,item:eh}]}),(0,a.jsx)(j.Z,{variant:"authenticated"===W?"default":"landing"}),(0,a.jsx)(y.Z,{}),(0,a.jsxs)("main",{className:(0,g.cn)("relative min-h-[calc(100vh-64px)] text-white overflow-hidden","authenticated"!==W&&"pt-4"),style:{background:"radial-gradient(ellipse 120% 80% at 50% -10%, #16111f 0%, #0d0a13 38%, #07070a 78%)"},children:[(0,a.jsxs)("div",{className:"absolute inset-0 pointer-events-none",children:[(0,a.jsx)("div",{className:"absolute -top-[15%] -right-[10%] w-[55%] h-[55%] bg-gradient-radial from-[#FFFF9C]/20 via-[#FFFF9C]/5 to-transparent blur-3xl"}),(0,a.jsx)("div",{className:"absolute top-[18%] -left-[15%] w-[50%] h-[60%] bg-gradient-radial from-[#A78BFA]/16 via-[#7C3AED]/4 to-transparent blur-3xl"}),(0,a.jsx)("div",{className:"absolute -bottom-[20%] -right-[15%] w-[55%] h-[55%] bg-gradient-radial from-[#F472B6]/12 via-[#EC4899]/3 to-transparent blur-3xl"}),(0,a.jsx)("div",{className:"absolute -bottom-[30%] -left-[15%] w-[45%] h-[50%] bg-gradient-radial from-[#67E8F9]/8 via-[#06B6D4]/2 to-transparent blur-3xl"}),(0,a.jsx)("div",{className:"absolute top-[5%] left-1/2 -translate-x-1/2 w-[80%] h-[35%] bg-gradient-to-b from-white/[0.04] to-transparent blur-2xl"})]}),(0,a.jsx)("div",{className:"absolute inset-0 pointer-events-none opacity-[0.015]",style:{backgroundImage:"url(\"data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E\")"}}),(0,a.jsxs)("section",{className:"relative mx-auto max-w-6xl px-6 pt-16 pb-12",children:[(0,a.jsxs)("div",{className:"text-center space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center gap-4 mb-8",children:[(0,a.jsx)("div",{className:"h-px w-16 bg-gradient-to-r from-transparent via-[#FFFF9C]/50 to-[#FFFF9C]"}),(0,a.jsx)("div",{className:"w-2 h-2 rotate-45 bg-[#FFFF9C]/80"}),(0,a.jsx)("div",{className:"h-px w-16 bg-gradient-to-l from-transparent via-[#FFFF9C]/50 to-[#FFFF9C]"})]}),(0,a.jsx)("h1",{className:"cursor-default",style:{fontFamily:"var(--zp-font-display)",fontWeight:600,fontSize:"clamp(26px, 3.4vw, 42px)",letterSpacing:"-0.025em",lineHeight:1.12},children:(0,a.jsx)("span",{className:"relative inline-block text-[#FFFF9C]/85",onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),r=e.clientX-t.left,a=e.clientY-t.top;e.currentTarget.style.backgroundImage="radial-gradient(circle 100px at ".concat(r,"px ").concat(a,"px, #FFFFCC, #FFFF9C 40%, rgba(255, 255, 156, 0.8))"),e.currentTarget.style.webkitBackgroundClip="text",e.currentTarget.style.backgroundClip="text",e.currentTarget.style.color="transparent"},onMouseLeave:e=>{e.currentTarget.style.backgroundImage="none",e.currentTarget.style.webkitBackgroun
1dClip="initial",e.currentTarget.style.backgroundClip="initial",e.currentTarget.style.color=""},children:B("".concat(s,":hero.title"))})}),es.length>0?(0,a.jsx)("div",{className:"mx-auto flex flex-wrap items-center justify-center gap-x-3 gap-y-2",style:{fontFamily:"var(--zp-font-heading)",fontWeight:400,fontSize:"clamp(14px, 1.05vw, 17px)",lineHeight:1.5,color:"var(--zp-fg-2)",maxWidth:760},children:es.map((e,t)=>(0,a.jsxs)(i.Fragment,{children:[(0,a.jsx)("span",{children:e}),t<es.length-1&&(0,a.jsx)("span",{"aria-hidden":"true",style:{color:"#FFFF9C",opacity:.55,fontFamily:"var(--zp-font-mono)"},children:"\xb7"})]},t))}):(0,a.jsx)("p",{className:"mx-auto",style:{fontFamily:"var(--zp-font-heading)",fontWeight:300,fontSize:"clamp(13px, 1vw, 15px)",lineHeight:1.65,color:"var(--zp-fg-3)",maxWidth:760},children:B("".concat(s,":hero.subtitle"))})]}),(0,a.jsxs)("div",{id:"generator",className:"mt-10 relative scroll-mt-24",children:[(0,a.jsx)("div",{className:"absolute -inset-1 bg-gradient-to-r from-[#FFFF9C]/10 via-white/5 to-[#FFFF9C]/10 rounded-2xl blur-xl opacity-40"}),(0,a.jsx)("div",{className:"relative rounded-2xl p-[1px]",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.05) 45%, rgba(255,255,255,0.18) 100%)",boxShadow:"0 12px 40px -16px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02)"},children:(0,a.jsx)("div",{className:"rounded-2xl overflow-hidden [&_.bg-secondary]:!bg-transparent [&_.bg-secondary]:backdrop-blur-xl [&_.bg-secondary]:!border-0",style:{background:"linear-gradient(140deg, rgba(36,36,42,0.92) 0%, rgba(20,20,24,0.92) 55%, rgba(30,30,36,0.92) 100%)"},children:(0,a.jsx)(N.Z,{ref:K,handleGenerate:ea,generationParams:$,setGenerationParams:Q,previewType:R})})})]})]}),z&&(0,a.jsx)(Z,{ns:s,mediaType:R,refreshKey:et,t:B,onUsePrompt:(e,t,r)=>{var a;let i={model_id:(null==r?void 0:r.videoModel)||h,prompt:e,aspect_ratio:(null==r?void 0:r.aspectRatio)||Y.aspect_ratio,duration:(null==r?void 0:null===(a=r.duration)||void 0===a?void 0:a.toString())||Y.duration,resolution:(null==r?void 0:r.resolution)||Y.resolution,generate_audio:!0,ref_assets:null==t?void 0:t.map(e=>({url:e.url,name:e.name||"",type:e.type,ref_type:A.Zr.GENERAL_REF}))};Q(i)},onSelectMedia:(e,t)=>e?J({url:e,type:t}):J(null)}),(0,a.jsxs)("section",{className:"relative mx-auto max-w-6xl px-6 pb-20",children:[(0,a.jsx)("div",{className:"mb-8 flex items-center justify-between",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"h-px w-8 bg-gradient-to-r from-[#FFFF9C]/50 to-transparent"}),(0,a.jsx)("span",{className:"text-xs font-medium tracking-widest text-white/40 uppercase",children:B("".concat(s,":gallery.title"))})]})}),(0,a.jsx)("div",{className:"mt-10 grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:r.map(e=>(0,a.jsx)(q,{example:e,ns:s,t:B,locale:D,modelName:x,defaultModelId:h,onSelectMedia:t=>{var r;if(!t){J(null);return}let a=(null===(r=e.thumbnail)||void 0===r?void 0:r.type)==="image"?"image":"video";J({url:t,type:a})},onUsePrompt:(e,t)=>{let r=(0,L.N)(e.prompt,t),a=e.media_items||[],i={model_id:e.model||h,prompt:r,aspect_ratio:Y.aspect_ratio,duration:Y.duration,resolution:Y.resolution,generate_audio:!0,ref_assets:a.map(e=>({url:e.url,name:e.name||"",type:e.type,ref_type:A.Zr.GENERAL_REF}))};Q(i),setTimeout(()=>{var e;null===(e=K.current)||void 0===e||e.setPrompt(r)},150)}},e.id))})]})]}),el&&(0,a.jsx)(k.Z,{title:B("".concat(s,":comparison.title")),subtitle:B("".concat(s,":comparison.subtitle"),{defaultValue:""}),ourLabel:B("".concat(s,":comparison.ourLabel"),{defaultValue:x}),rows:en}),(0,a.jsx)(C.Z,{whatIs:{title:B("".concat(s,":whatIs.title")),body:B("".concat(s,":whatIs.body"))},features:{title:B("".concat(s,":features.title")),subtitle:B("".concat(s,":features.subtitle")),items:B("".concat(s,":features.items"),{returnObjects:!0})||[]},howToUse:{title:B("".concat(s,":howToUse.title")),subtitle:B("".concat(s,":howToUse.subtitle")),steps:B("".concat(s,":howToUse.steps"),{returnObjects:!0})||[]},capabilities:{title:B("".concat(s,":capabilities.title")),items:B("".concat(s,":capabilities.items"),{returnObjects:!0})||[]},promptTips:{title:B("".concat(s,":promptTips.title")),body:B("".concat(s,":promptTips.body"))},faq:{title:B("".concat(s,":faqSection.title")),items:B("".concat(s,":faqSection.items"),{returnObjects:!0})||[]},finalCta:{title:B("".concat(s,":finalCta.title")),subtitle:B("".concat(s,":finalCta.subtitle")),button:B("".concat(s,":finalCta.button")),href:"#generator"}}),ed&&(0,a.jsx)(_.Z,{title:B("".concat(s,":specs.title")),subtitle:B("".concat(s,":specs.subtitle"),{defaultValue:""}),rows:ec}),!!eu&&(0,a.jsx)(S.Z,{currentSlug:m,title:eu,subtitle:B("".concat(s,":relatedModels.subtitle"),{defaultValue:""})}),(0,a.jsx)(v.Vq,{open:!!H,onOpenChange:()=>J(null),children:(0,a.jsxs)(v.cZ,{className:"max-w-5xl w-[90vw] p-0 bg-[#0a0a0a]/98 border border-white/[0.08] rounded-2xl overflow-hidden shadow-2xl",children:[(0,a.jsx)(v.$N,{className:"sr-only",children:B("".concat(s,":modal.preview"))}),(0,a.jsx)("div",{className:"absolute -inset-px bg-gradient-to-r from-[#FFFF9C]/10 via-trans
1parent to-[#FFFF9C]/10 rounded-2xl pointer-events-none"}),(0,a.jsx)("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-[#FFFF9C]/30 to-transparent"}),(0,a.jsx)("div",{className:"relative",children:(null==H?void 0:H.type)==="video"?(0,a.jsx)("video",{src:H.url,"aria-label":"".concat(x," preview"),className:"w-full max-h-[80vh] object-contain",controls:!0,autoPlay:!0,playsInline:!0}):(null==H?void 0:H.url)?(0,a.jsx)("img",{src:H.url,alt:"".concat(x," preview"),className:"w-full max-h-[80vh] object-contain"}):null})]})})]})}}}]);

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.