1import{i as E}from"./rolldown-runtime-6KndmJbk.js";import{p as T}from"./vendor-DkAMgJIR.js";import{ft as M,gt as _}from"./ui-C7uiwNfC.js";import{t as k}from"./chart-no-axes-column-Ci_s0B-J.js";import{t as I}from"./AppSidebar-cdSGmeA_.js";import{t as V}from"./video-DwKfNxnb.js";import{N as W,Zt as Q,on as L,x as F}from"./index-CYQ22DbO.js";import{i as P,r as z,t as O}from"./tabs-sU1rIvzZ.js";import{t as H}from"./useCredits-BjfWhNKn.js";import{b as w,c as q,o as B,v as y,x as R}from"./atlascloud-Dl2HjAPX.js";import{t as U}from"./ModelPlayground-DI6dMCp9.js";var i=E(_(),1),e=M();function G(t){const s=parseInt(t,10);return isNaN(s)?0:100-s}function D(t){switch(t.toUpperCase()){case"NEW":return"bg-green-500 text-white";case"HOT":return"bg-red-500 text-white";case"PRO":return"bg-purple-500 text-white";case"FAST":return"bg-blue-500 text-white";default:return"bg-muted text-muted-foreground"}}function Z(t){return t==="Image"?(0,e.jsx)(L,{className:"h-3 w-3"}):(0,e.jsx)(V,{className:"h-3 w-3"})}function J(t){return t==="Image"?"bg-purple-500/10 text-purple-400 border border-purple-500/30":"bg-green-500/10 text-green-400 border border-green-500/30"}function K(t){return`${t.model} ${t.displayName} ${t.organization??""}`.toLowerCase().includes("wan")?"WAN":"QWEN"}var N=t=>t.filter(s=>s.type==="Image"||s.type==="Video").filter(s=>{const o=`${s.model} ${s.displayName} ${s.profile} ${s.organization??""} ${s.tags.join(" ")}`.toLowerCase();return o.includes("qwen")||o.includes("wan")}).sort((s,o)=>(o.priority??0)-(s.priority??0));function X(t){return t==="WAN"?"bg-gradient-to-r from-amber-500 to-orange-500 text-white":"bg-gradient-to-r from-blue-500 to-cyan-500 text-white"}var Y=["NEW","HOT","PRO","FAST"],ee="20260507";function d(t){return`/assets/google-ai-models/${t}.jpg?v=${ee}`}function te(t){const s=`${t.model} ${t.displayName} ${t.profile} ${t.tags.join(" ")} ${t.organization??""}`.toLowerCase();return s.includes("wan")&&(s.includes("text-to-video")||s.includes("t2v"))?d("wan-text-to-video"):s.includes("wan")?d("wan-image-to-video"):t.type==="Image"?d("gemini-image"):t.type==="Video"?d("wan-image-to-video"):d("gemini-reasoning")}var A=["WAN 3.0","WAN 2.7","WAN 2.6","WAN 2.5","WAN 2.2","WAN 2.1","Qwen Image","HappyHorse","Vidu"],se=t=>{const s=`${t.model} ${t.displayName} ${t.familyName||""} ${t.familyDisplayName||""} ${t.organization??""}`.toLowerCase();if(s.includes("vidu"))return"Vidu";if(s.includes("happyhorse")||s.includes("happy horse"))return"HappyHorse";if(s.includes("wan")){if(s.includes("3.0")||s.includes("wan-3"))return"WAN 3.0";if(s.includes("2.7"))return"WAN 2.7";if(s.includes("2.6"))return"WAN 2.6";if(s.includes("2.5"))return"WAN 2.5";if(s.includes("2.2"))return"WAN 2.2";if(s.includes("2.1"))return"WAN 2.1"}return s.includes("qwen")?"Qwen Image":null};function re(){return(0,e.jsxs)("div",{className:"animate-pulse overflow-hidden rounded-2xl border border-border/50 bg-card",children:[(0,e.jsx)("div",{className:"aspect-[16/10] bg-muted"}),(0,e.jsxs)("div",{className:"space-y-2 p-4",children:[(0,e.jsx)("div",{className:"h-4 w-3/4 rounded bg-muted"}),(0,e.jsx)("div",{className:"h-3 w-full rounded bg-muted"}),(0,e.jsx)("div",{className:"h-3 w-5/6 rounded bg-muted"}),(0,e.jsx)("div",{className:"mt-3 h-8 rounded bg-muted"})]})]})}function ae({m:t,onTryIt:s}){const o=B(),p=t.tags.filter(a=>Y.includes(a.toUpperCase())),c=y(t.price,"actual",t.type),l=y(t.price,"origin",t.type),m=G(t.price?.discount??"100"),u=K(t);return(0,e.jsxs)("div",{className:"group flex flex-col overflow-hidden rounded-2xl border border-border/50 bg-card transition-all duration-200 hover:border-primary/40 hover:shadow-lg",children:[(0,e.jsxs)("div",{className:"relative aspect-[16/10] overflow-hidden bg-muted",children:[(0,e.jsx)("img",{src:te(t),alt:t.displayName,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105",loading:"lazy",onError:a=>{a.currentTarget.src=d("gemini-reasoning")}}),(0,e.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/45 via-black/5 to-black/25"}),(0,e.jsx)("div",{className:"absolute left-2 top-2 flex flex-wrap gap-1",children:p.map(a=>(0,e.jsx)("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-bold ${D(a)}`,children:a},a))}),(0,e.jsx)("div",{className:"absolute right-2 top-2",children:(0,e.jsx)("div",{className:"rounded bg-black/50 p-1",children:(0,e.jsx)(k,{className:"h-3.5 w-3.5 text-white/80"})})}),(0,e.jsxs)("div",{className:"absolute bottom-2 left-2 flex gap-1.5",children:[(0,e.jsx)("span",{className:`rounded px-2 py-0.5 text-[10px] font-bold ${X(u)}`,children:u}),(0,e.jsxs)("span",{className:`flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-medium ${J(t.type)}`,children:[Z(t.type)," ",t.type]})]})]}),(0,e.jsxs)("div",{className:"flex flex-1 flex-col gap-2 p-4",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold leading-tight",children:t.displayName}),(0,e.jsx)("p",{className:"line-clamp-3 flex-1 text-xs text-muted-foreground",children:t.profile}),c>0&&(0,e.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"flex-1",children:[l>0&&l!==c&&(0,e.jsxs)("p",{className:"text-[10px] text-muted-foreground line-through",children:["From $",l.toFixed(4),t.type==="Video"?"/SEC":""]}),(0,e.jsxs)("p",{className:"text-sm font-bold",children:["$",c.toFixed(4),(0,e.jsxs)("span",{className:"text-xs font-normal text-muted-foreground",children:[t.type==="Video"?"/SEC":"",o?" (raw)":""]})]})]}),m>0&&(0,e.jsxs)("span",{className:"rounded bg-orange-500 px-1.5 py-0.5 text-[11px] font-bold text-white",children:["-",m,"%"]})]}),(0,e.jsx)(W,{size:"sm",className:"mt-1 w-full bg-violet-600 text-white hover:bg-violet-700",onClick:()=>s(t),children:"Try it"})]})]})}var fe=()=>{const t=T(),{user:s,loading:o,handleLogout:p}=F(),{credits:c,isAdmin:l}=H(),[m,u]=(0,i.useState)(null),[a,b]=(0,i.useState)(()=>N(w())),[g,C]=(0,i.useState)(!1),[x,f]=(0,i.useState)(null),[v,$]=(0,i.useState)("WAN 3.0"),h=(0,i.useMemo)(()=>{const r=Object.fromEntries(A.map(n=>[n,[]]));for(const n of a){const j=se(n);j&&r[j].push(n)}return r},[a]),S=h[v];return(0,i.useEffect)(()=>
1{if(o){u(null);return}u(R())},[o,s?.uid]),(0,i.useEffect)(()=>{q().then(r=>{b(N(r))}).catch(()=>{b(N(w()))}).finally(()=>{C(!1)})},[]),(0,e.jsxs)("div",{className:"flex min-h-screen w-full bg-background",children:[(0,e.jsx)(I,{user:s,onLogout:p}),(0,e.jsx)("main",{className:"flex-1 overflow-auto",children:(0,e.jsxs)("div",{className:"mx-auto max-w-7xl px-4 py-5 md:px-6 md:py-6 lg:px-8",children:[!x&&(0,e.jsxs)("div",{className:"mb-6 flex flex-col gap-4 border-b border-border/60 pb-5 md:flex-row md:items-end md:justify-between",children:[(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-widest text-muted-foreground",children:[(0,e.jsx)("span",{children:"QWEN + WAN Studio"}),l&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"h-1 w-1 rounded-full bg-border"}),(0,e.jsx)("span",{children:"Model Catalog"})]})]}),(0,e.jsx)("h1",{className:"text-2xl font-semibold tracking-tight md:text-3xl",children:"QWEN + WAN"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:g?"Loading models...":`${a.length} QWEN and WAN image/video models available - pick one to start`})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[(0,e.jsx)("span",{children:l?"Unlimited credits":`${c} credits available`}),l&&m===!1&&(0,e.jsxs)(W,{variant:"outline",size:"sm",onClick:()=>t("/settings"),children:[(0,e.jsx)(Q,{className:"h-4 w-4"})," API key"]})]})]}),!x&&(0,e.jsxs)(e.Fragment,{children:[!g&&(0,e.jsx)(O,{value:v,onValueChange:r=>$(r),className:"mb-5 w-full",children:(0,e.jsx)(z,{className:"h-auto w-full flex-wrap justify-start gap-2 rounded-xl bg-muted/40 p-1.5",children:A.map(r=>h[r].length>0&&(0,e.jsxs)(P,{value:r,className:"min-w-28 gap-2 rounded-lg px-4 py-2 text-sm data-[state=active]:bg-violet-600 data-[state=active]:text-white",children:[r,(0,e.jsx)("span",{className:"rounded-full bg-background/80 px-2 py-0.5 text-xs text-foreground",children:h[r].length})]},r))})}),(0,e.jsx)("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:g?Array.from({length:8}).map((r,n)=>(0,e.jsx)(re,{},n)):S.map(r=>(0,e.jsx)(ae,{m:r,onTryIt:n=>{f(n),window.scrollTo({top:0,behavior:"smooth"})}},r.uuid))})]}),x&&(0,e.jsx)("div",{className:"overflow-hidden rounded-2xl border border-border/60",children:(0,e.jsx)(U,{model:x,onBack:()=>f(null),onSelectModel:f})})]})})]})};export{fe as default};
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.