PageSourceSearch

https://cdn.wisgate.ai/wisgate/_nuxt/DI1y0K5K.js

js wisgate.ai collected 2026-10-04 13:25:54 UTC 28,961 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DZ7mik94.js","./entry.u4ANfTEG.css"])))=>i.map(i=>d[i]);
2import{d as Oe,u as bt,U as xt,a as g,r as v,h as _t,g as De,R as yt,aT as wt,aS as kt,w as F,v as Fe,b as St,j as r,o as i,s as m,l as a,E as P,p,m as be,al as $t,F as R,x as U,k as L,Q as le,ay as Pe,Y as It,K as Ve,aU as Rt,aM as Tt,q as z,c as ie,ae as ze,A as Ct,aV as Mt,W as Ut,T as Lt,f as Ft,H as Pt,_ as zt}from"./DZ7mik94.js";import{_ as jt}from"./D7bbJmtS.js";import{G as Ot,S as Dt,_ as Vt,a as je}from"./DUS9Z8S1.js";import{T as Et}from"./DB7NpyPD.js";import{W as At}from"./BDBxKVhw.js";import{I as Wt}from"./uWVYgc1G.js";import{u as Gt}from"./RJDv4jit.js";import"./DjTfAQrD.js";import{M as Nt}from"./CfokIUfS.js";import{d as Bt}from"./CIZylvxh.js";import{u as qt}from"./D1AKMsRP.js";import{g as Ht}from"./Lmt8mlL8.js";import"./GefESYmt.js";import"./0J-1uiXP.js";import"./Ci2gcBr-.js";import"./Y2uuUinc.js";import"./Du7nxuHz.js";import"./BETpJ00V.js";import"./BDcM2FMb.js";import"./DXDH8whQ.js";import"./BciGH192.js";const Jt={class:"h-full w-full flex flex-col bg-slate-50 relative overflow-hidden"},Kt={key:0,class:"sticky top-0 left-0 right-0 flex-shrink-0 px-4 py-3 flex gap-3 border-b border-slate-100 bg-white/90 z-30"},Xt={class:"flex-1 overflow-hidden"},Zt={class:"h-full flex flex-col md:flex-row"},Yt={class:"w-full md:w-[380px] lg:w-[420px] bg-white border-r border-slate-200 flex flex-col h-full shadow-sm z-10"},Qt={class:"p-4 md:p-6 overflow-y-auto flex-1 space-y-5 md:space-y-6"},es={class:"flex items-center gap-3 mb-2"},ts={class:"text-xl font-bold text-slate-900"},ss={key:0,class:"p-4 bg-red-50 border border-red-100 rounded-xl flex items-start gap-3 text-red-700"},as={class:"flex-1 text-sm font-medium"},os={class:"space-y-2 pt-2"},ls={class:"flex p-1 bg-slate-100 rounded-xl"},is=["onClick","disabled"],ns={key:1,class:"space-y-2"},rs={class:"flex p-1 bg-slate-100 rounded-xl"},us=["onClick","disabled"],ds={key:2,class:"space-y-2 animate-fade-in"},cs={class:"text-sm font-bold text-slate-700"},vs={key:0,class:"text-xs font-normal text-slate-500"},ps={class:"space-y-3"},gs=["multiple"],ms={class:"flex flex-col items-center gap-2 text-slate-500"},fs={class:"text-sm font-medium"},hs={key:1,class:"grid grid-cols-1 md:grid-cols-2 gap-3"},bs={class:"px-1 text-xs font-semibold text-slate-600"},xs={class:"text-xs font-bold"},_s={key:2,class:"grid grid-cols-3 gap-3"},ys={class:"text-xs font-bold"},ws={class:"space-y-2"},ks={class:"text-sm font-bold text-slate-700"},Ss={key:3,class:"space-y-2"},$s={class:"text-sm font-bold text-slate-700"},Is={class:"grid grid-cols-2 gap-4 mt-1"},Rs={key:0,class:"space-y-1"},Ts=["value"],Cs={key:1,class:"space-y-1"},Ms={class:"flex bg-slate-50 p-1 rounded-xl border border-slate-200 h-[42px]"},Us={key:0,class:"w-px bg-slate-200 my-2"},Ls=["onClick"],Fs={key:2,class:"col-span-2 space-y-1"},Ps={class:"text-[10px] font-bold text-slate-500 uppercase tracking-wider ml-1"},zs={class:"flex bg-slate-50 p-1 rounded-xl border border-slate-200 h-[42px]"},js={key:0,class:"w-px bg-slate-200 my-2"},Os=["onClick"],Ds={key:3,class:"col-span-2 space-y-1"},Vs={class:"text-[10px] font-bold text-slate-500 uppercase tracking-wider ml-1 flex items-center gap-1"},Es={class:"pi pi-info-circle text-[10px] cursor-help"},As=["disabled"],Ws=["value"],Gs={class:"space-y-2 flex flex-col"},Ns={class:"flex items-center justify-between"},Bs={class:"text-sm font-bold text-slate-700"},qs={class:"text-xs font-bold text-slate-400"},Hs={class:"relative group flex flex-col"},Js=["placeholder","disabled"],Ks={class:"absolute bottom-3 right-3 flex gap-2"},Xs={class:"p-6 border-t border-slate-200 bg-white"},Zs={key:0,class:"flex-1 h-full overflow-hidden bg-slate-50 relative"},Ys={class:"max-w-7xl mx-auto"},Qs={class:"space-y-6 px-6 pb-8"},ea={key:0,class:"flex min-h-[60vh] items-center justify-center"},ta={key:1,class:"relative"},sa={key:0,class:"py-20 text-center text-slate-500"},aa={class:"inline-flex items-center gap-2 rounded-2xl border border-slate-200 bg-white px-4 py-3 shadow-sm"},oa={class:"text-sm font-semibold"},la={class:"bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden group hover:shadow-lg hover:-translate-y-1 transition-all duration-300 cursor-pointer h-full flex flex-col"},ia={key:1,class:"w-full h-full flex items-center justify-center text-slate-300"},na={class:"absolute top-3 right-3 px-2 py-1 rounded-lg bg-black/50 backdrop-blur-md text-white text-[10px] font-bold uppercase tracking-wider border border-white/10"},ra={key:2,class:"absolute bottom-3 right-3 px-2 py-1 rounded-lg bg-black/50 backdrop-blur-md text-white text-[10px] font-bold border border-white/10 flex items-center gap-1 z-10"},ua={class:"p-4 flex-1 flex flex-col"},da={class:"text-sm font-bold text-slate-900 line-clamp-1 mb-2"},ca={class:"flex gap-3"},va={key:0,class:"flex-shrink-0 relative w-12 h-12 mr-2 group/stack"},pa=["src"],ga={class:"text-xs text-slate-500 line-clamp-3 leading-relaxed flex-1"},ma={key:1,class:"py-12 flex items-center justify-center"},fa=Oe({__name:"VideoWorkarea",setup(Ee){const{t:b}=bt();xt(g(()=>Ht(b).studioVideo));
2const x=v(""),f=v("text-to-video"),_=v("img2vid"),h=v("veo-3.1"),n=v([]),D=v(null),G=v(),$=v(10),y=v("16:9"),I=v("720p");v(!1);const X=v(null),C=v(!1),T=v(null);v(!1);const V=v([]),E=v("all"),ne=v(!1),Ae=()=>{j.push(N("/studio/video/history"))},re=v(1),xe=v(20),ue=v(!1),de=v(!0),Z=v(!1),w=_t(),We=Tt(),j=$t(),N=De(),ce=yt(),{triggerFirstCall:Ge}=wt(),ve=v([]),Y=v(!1),Q=v(1),Ne=[1,2,3,4,5];g(()=>{const e=w.info;return(e&&typeof e.plan_name=="string"?e.plan_name:"Free").toLowerCase().includes("free")});const pe=g(()=>{const e=w.info;return(e&&typeof e.plan_name=="string"?e.plan_name:"Free").toLowerCase().includes("premium")}),_e=[{value:"text-to-video",labelKey:"studio.video.text_to_video",icon:"pi-file-edit"},{value:"image-to-video",labelKey:"studio.video.image_to_video",icon:"pi-image"}],ge=kt(),Be=qt(),ye={"text-to-video":["txt2vid"],"image-to-video":["img2vid","firstTailGenerate"]},ee=g(()=>{const e=ge.videoOptions;return _e.filter(t=>e.length===0||e.some(o=>!o.modes||o.modes.length===0||ye[t.value].some(u=>o.modes?.includes(u)))).map(t=>({value:t.value,label:b(t.labelKey),icon:t.icon}))}),A=g(()=>{const e=ye[f.value];return ge.videoOptions.filter(t=>!t.modes||t.modes.length===0||e.some(o=>t.modes?.includes(o)))}),B=g(()=>A.value.find(e=>e.value===h.value)),q=g(()=>{const e=B.value;return e?.durations&&e.durations.length>0?e.durations:[]}),H=g(()=>{const e=B.value;return e?.aspect_ratios&&e.aspect_ratios.length>0?e.aspect_ratios:[]}),W=g(()=>{const e=B.value;return e?.resolutions&&e.resolutions.length>0?e.resolutions:[]}),qe=g(()=>{const e=W.value.find(t=>t.value===I.value);return e?.sizes?.[y.value]?e.sizes[y.value]:e?.value||I.value}),S=g(()=>{const e=B.value;return _.value==="firstTailGenerate"?2:e?.max_source_images!==void 0&&e.max_source_images!==null?e.max_source_images:1}),me=g(()=>{const e=B.value?.modes,t=o=>!e||e.length===0||e.includes(o);return[{value:"img2vid",label:b("studio.video.image_to_video"),icon:"pi-image"},{value:"firstTailGenerate",label:b("studio.video.first_tail_to_video"),icon:"pi-images"}].filter(o=>t(o.value))}),te=g(()=>f.value==="text-to-video"?0:(_.value==="firstTailGenerate",1)),se=g(()=>te.value>0),He=g(()=>_.value==="firstTailGenerate"?b("studio.video.first_tail_upload"):b("studio.video.source_image_upload")),we=g(()=>se.value?_.value==="firstTailGenerate"?`${n.value.length}/2`:S.value>1?`${n.value.length}/${S.value}`:"":""),Je=g(()=>f.value==="image-to-video"&&_.value==="firstTailGenerate"),Ke=g(()=>[{label:b("studio.video.first_frame"),image:n.value[0]},{label:b("studio.video.last_frame"),image:n.value[1]}]);(()=>{const e=q.value;if(e.length>0){const u=e.find(s=>s.default);$.value=u?u.value:e[0].value}const t=H.value;t.length>0&&(y.value=t[0].value);const o=W.value;o.length>0&&(I.value=o[0].value)})();const Xe=e=>{if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(t){return console.warn("Failed to parse prompt input resources",t),[]}},Ze=e=>({id:e.id.toString(),key:e.key,title:e.title,prompt:e.prompt,industry:e.industry||"all",type:e.prompt_type,imageUrl:e.head_image||"/images/templates/default.jpg",imageWidth:e.head_image_width,imageHeight:e.head_image_height,description:e.description||e.title,inputResources:Xe(e.input_resource),author:e.author,sourceUrl:e.source_url}),fe=async(e=1,t=!1)=>{try{e===1?ue.value=!0:Z.value=!0,X.value=null;const o=await Rt({p:e,page_size:xe.value,types:_e.map(u=>u.value).join(","),industry:E.value});if(o.items){const u=o.items.map(s=>Ze(s));t?V.value=[...V.value,...u]:V.value=u,de.value=o.items.length===xe.value,re.value=e}}catch(o){console.error("Failed to load prompt templates:",o),X.value="Failed to load prompt templates"}finally{ue.value=!1,Z.value=!1}},ke=Bt(async()=>{if(!de.value||Z.value)return;const e=re.value+1;await fe(e,!0)},300),Ye=e=>{const t=e.target||e.currentTarget;if(!t)return;const{scrollTop:o,scrollHeight:u,clientHeight:s}=t;o+s>=u-50&&ke()},Qe=v(),et=["all"],Se=g(()=>E.value==="all"?V.value:V.value.filter(e=>e.industry===E.value));F(E,async()=>{ke.cancel(),re.value=1,de.value=!0,V.value=[],await fe(1,!1)}),g(()=>y.value.replace(":","/"));const he=()=>
2{if(f.value!=="image-to-video")return;const e=me.value;e.length>0&&!e.some(t=>t.value===_.value)&&(_.value=e[0].value)};F(f,()=>{A.value.length>0&&!A.value.some(e=>e.value===h.value)&&(h.value=A.value[0].value),he(),n.value.length>S.value&&(n.value=n.value.slice(0,S.value))}),F(_,()=>{n.value.length>S.value&&(n.value=n.value.slice(0,S.value))}),F(h,()=>{const e=q.value;if(e.length>0){const u=e.find(s=>s.default);$.value=u?u.value:e[0].value}const t=W.value;t.length>0&&!t.some(u=>u.value===I.value)&&(I.value=t[0].value);const o=H.value;o.length>0&&!o.some(u=>u.value===y.value)&&(y.value=o[0].value),oe(),he(),n.value.length>S.value&&(n.value=n.value.slice(0,S.value))}),Fe(async()=>{try{await ge.loadCatalog()}catch{}ee.value.length>0&&!ee.value.some(t=>t.value===f.value)&&(f.value=ee.value[0].value);const e=A.value;e&&e.length>0&&!e.find(t=>t.value===h.value)&&(h.value=e[0].value),he()}),F(y,()=>{oe()}),F($,()=>{oe()}),F(I,()=>{oe()});const tt=async e=>new Promise((t,o)=>{const u=new Image;u.onload=()=>{const s=document.createElement("canvas");s.width=u.width,s.height=u.height;const l=s.getContext("2d");if(!l){o(new Error("Failed to get canvas context"));return}l.fillStyle="#FFFFFF",l.fillRect(0,0,s.width,s.height),l.drawImage(u,0,0),s.toBlob(d=>{d?t(d):o(new Error("Canvas to Blob conversion failed"))},"image/jpeg",.95)},u.onerror=s=>o(s),u.src=URL.createObjectURL(e)}),st=async(e,t)=>{let o;if(e.startsWith("data:"))o=await(await fetch(e)).blob();else try{const u=new URL(e,window.location.origin);u.searchParams.append("t",Date.now().toString());const s=await fetch(u.toString(),{mode:"cors",cache:"no-cache"});if(!s.ok)throw new Error(`Failed to fetch image: ${s.status} ${s.statusText}`);o=await s.blob()}catch(u){console.warn("First fetch attempt failed, retrying raw URL",u);const s=await fetch(e,{mode:"cors"});if(!s.ok)throw new Error(`Fallback fetch failed: ${s.status} ${s.statusText}`);o=await s.blob()}if(o.type==="image/webp"||t.toLowerCase().endsWith(".webp"))try{o=await tt(o),t=t.replace(/\.webp$/i,".jpg"),t.toLowerCase().endsWith(".jpg")||(t+=".jpg")}catch(u){console.error("WebP to JPG conversion failed, using original",u)}return new File([o],t,{type:o.type})},{triggerUseTemplate:$e}=Gt(),Ie=()=>N("/studio/video"),Re=()=>N("/studio/video/history"),at=()=>N("/studio/video/inspiration"),ot=e=>N(`/studio/video/inspiration/${e}`),lt=async()=>{We.path!==Ie()&&await j.replace(Ie())},it=async()=>{await j.push(at())},nt=async e=>{const t=e.key||e.id;await j.push(ot(t))};F($e,e=>{e&&(rt(e),$e.value=null)});const rt=async e=>{if(await lt(),x.value=e.prompt,e.inputResources&&e.inputResources.length>0){f.value="image-to-video",_.value="img2vid";const t=e.inputResources.slice(0,S.value),o=e.inputResources.map((u,s)=>({id:`input-${Date.now()}-${s}`,file:null,url:u,status:"success",progress:100}));n.value=o;try{const u=t.map(async(s,l)=>{try{let d=`source-image-${l}.png`;try{if(!s.startsWith("data:")){const K=s.split("/"),Le=K[K.length-1];Le&&(d=Le)}}catch{}const c=await st(s,d),k=URL.createObjectURL(c),O=o[l].id,M=n.value.findIndex(K=>K.id===O);n.value[M]={...n.value[M],file:c,url:k,name:d,loading:!1,id:n.value[M].id}}catch(d){console.error("Failed to load template image:",s,d);const c=o[l].id;n.value=n.value.filter(k=>k.id!==c)}});await Promise.all(u)}catch(u){console.error("Failed to load source images",u),n.value=n.value.filter(s=>!s.loading)}}else f.value=e.type==="text-to-video"?"text-to-video":"image-to-video"};Fe(async()=>{if(!w.isLogin)try{await w.getUserInfo()}catch{console.log("User not logged in")}if(w.isLogin)try{const t=await ce.getModelsCached();ve.value=Array.isArray(t)?t:[]}catch{ve.value=[]}finally{Y.value=!0}else Y.value=!0;fe(),dt(),Me(),Me();const e=()=>{ne.value=window.innerWidth<=768};e(),window.addEventListener("resize",e)}),St(()=>{const e=()=>{};window.removeEventListener("resize",e)});const ae=v([]);g(()=>ae.value);const Te=()=>`videoLibrary_${w?.info?.id??w?.info?.username??"guest"}`,Ce=()=>`videoSettings_${w?.info?.id??w?.info?.username??"guest"}`,ut=()=>{try{const e=ae.value.map(t=>({...t,timestamp:t.timestamp instanceof Date?t.timestamp.toISOString():t.timestamp}));localStorage.setItem(Te(),JSON.stringify(e))}catch(e){console.error("Failed to save video library:",e)}},oe=()=>{try{const e={videoAspectRatio:y.value,selectedModel:h.value,videoDuration:$.value,videoRes
2olution:I.value};localStorage.setItem(Ce(),JSON.stringify(e))}catch(e){console.error("Failed to save video settings:",e)}},dt=()=>{try{const e=localStorage.getItem(Ce());if(!e)return;const t=JSON.parse(e);t.videoAspectRatio&&(y.value=t.videoAspectRatio),t.selectedModel&&(h.value=t.selectedModel),t.videoDuration&&($.value=t.videoDuration),t.videoResolution&&(I.value=t.videoResolution)}catch(e){console.error("Failed to load video settings:",e)}},Me=()=>{try{const e=localStorage.getItem(Te());if(!e)return;const t=JSON.parse(e);ae.value=t.map(o=>({...o,timestamp:new Date(o.timestamp)}))}catch(e){console.error("Failed to load video library:",e)}};g(()=>se.value?n.value.length>=te.value&&x.value.trim().length>0:x.value.trim().length>0);const ct=e=>{const t=e.target,o=t.files;if(o&&o.length>0){let s=n.value.reduce((l,d)=>l+(d.file?.size||0),0);if(D.value){const l=o[0];if(l&&(l.type==="image/png"||l.type==="image/jpeg"||l.type==="image/jpg")){const d=n.value.findIndex(c=>c.id===D.value);if(d!==-1){const c=n.value[d]?.file?.size||0;if(s-c+l.size>20971520){T.value=b("studio.image.total_size_exceeded",{size:"20MB"}),t&&(t.value="");return}const k=new FileReader;k.onload=O=>{n.value[d]={...n.value[d],file:l,url:O.target?.result,name:l.name,id:n.value[d].id}},l&&k.readAsDataURL(l)}D.value=null}}else{let l=0;const d=[];if(Array.from(o).forEach(c=>{n.value.length>=S.value||(c.type==="image/png"||c.type==="image/jpeg"||c.type==="image/jpg")&&(l+=c.size,d.push(c))}),s+l>20971520){T.value=b("studio.image.total_size_exceeded",{size:"20MB"}),t&&(t.value="");return}d.forEach(c=>{const k=new FileReader;k.onload=O=>{const M={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:c,url:O.target?.result,name:c.name};n.value.length<S.value&&n.value.push(M)},k.readAsDataURL(c)})}}t&&(t.value="")},Ue=e=>{n.value=n.value.filter(t=>t.id!==e)},J=e=>{D.value=e||null,G.value?.click()},vt=async()=>{if(T.value=null,!w.isLogin)try{await w.getUserInfo()}catch{w.login();return}if(!x.value.trim()){T.value="Please enter a prompt";return}if(n.value.length<te.value){T.value=_.value==="firstTailGenerate"?b("studio.video.first_tail_required"):b("studio.video.source_image_required");return}C.value=!0;try{const e=[];if(se.value&&n.value.length>0)for(const l of n.value)if(l.file){const d=await l.file.arrayBuffer(),c=new Uint8Array(d);let k="";for(let M=0;M<c.byteLength;M++)k+=String.fromCharCode(c[M]);const O=btoa(k);l.file&&e.push(`data:${l.file.type};base64,${O}`)}else l.url&&!l.url.startsWith("blob:")&&e.push(l.url);const{submitUserTask:t}=await Ct(async()=>{const{submitUserTask:l}=await import("./DZ7mik94.js").then(d=>d.e$);return{submitUserTask:l}},__vite__mapDeps([0,1]),import.meta.url);try{const l=await Mt(),d=l.count??l.data?.count??0,c=pe.value?Q.value:1;if(d+c>10){T.value=b("studio.history.active_tasks_limit",{count:d,limit:10,new:c}),C.value=!1;return}}catch(l){console.error("Failed to check active tasks",l)}const o=pe.value?Q.value:1,u=[],s=f.value==="image-to-video"&&_.value==="firstTailGenerate"?"i2v":void 0;for(let l=0;l<o;l++)u.push((async()=>{const d=await t({task_type:"video",model:h.value,prompt:x.value.trim(),images:e,options:{size:qe.value,seconds:$.value||10,...s?{mode:s}:{}},is_shared:!0}),c=d.data?.data||d.data||d;if(!c||!c.id)throw new Error("Failed to create video task");const k={id:Date.now().toString()+Math.random().toString(36).substr(2,5),taskId:c.id,prompt:x.value,timestamp:new Date,duration:$.value,type:f.value,model:h.value,sourceImage:n.value.length>0?n.value[0].url:void 0,status:"queued",progress:0,aspectRatio:y.value};ae.value.unshift(k),ut(),Be.updateTask(c)})());await Promise.all(u),await j.push(Re()),Ge()}catch(e){console.error("Video generation error:",e),T.value=`Generation failed: ${e.message||"Unknown error"}`}finally{C.value=!1}},pt=g(()=>!w.isLogin||!Y.value?!0:ve.value.includes(h.value)),gt=g(()=>w.isLogin&&Y.value&&!pt.value),mt=g(()=>{const e=ce.quotaByModel(h.value);return e?{enabled:ce.quotasEnabled,limit:e.limit,remain:e.remain}:{enabled:!1,limit:0,remain:0}}),ft=g(()=>!x.value.trim()||n.value.length<te.value),ht=()=>{vt()};return v(!1),(e,t)=>{const o=Vt,u=Et;return i(),r("div",Jt,[ne.value?(i(),r("div",Kt,[a("button",{class:"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-slate-700 font-bold text-sm hover:bg-slate-100 active:scale-95 transition-all",onClick:t[0]||(t[0]=s=>be(j).push(Re()))},[t[13]||(t[13]=a("i",{class:"pi pi-video text-indigo-500"},null,-1)),P(" "+p(e.$t("studio.history.title")),1)]),a("button",{class:"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-slate-700 font-bold text-sm hover:bg-slate-100 active:scale-95 transition-all",onClick:it},[t[14]||(t[14]=a("i",{class:"pi pi-list text-indigo-500"},null,-1)),P(" "+p(e.$t("studio.video.inspiration")),1)])])):m("",!0),a("div",Xt,[a("div",Zt,[a("div",Yt,[a("div",Qt,[a("div",es,[t[15]||(t[15]=a("div",{class:"size-10 rounded-xl bg-indigo-50 flex items-center justify-center"},[a("i",{class:"pi pi-video text-indigo-600 text-xl"})],-1)),a("h2",ts,p(e.$t("studio.video.title")),1)]),T.value?(i(),r("div",ss,[t[17]||(t[17]=a("i",{class:"pi pi-exclamation-circle mt
2-0.5"},null,-1)),a("div",as,p(T.value),1),a("button",{onClick:t[1]||(t[1]=s=>T.value=null),class:"text-red-400 hover:text-red-700"},[...t[16]||(t[16]=[a("i",{class:"pi pi-times"},null,-1)])])])):m("",!0),a("div",os,[a("div",ls,[(i(!0),r(R,null,U(ee.value,s=>(i(),r("button",{key:s.value,class:z(["flex-1 py-2 px-2 rounded-lg text-sm font-bold transition-all flex items-center justify-center gap-2",f.value===s.value?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"]),onClick:l=>f.value=s.value,disabled:C.value},[a("i",{class:z(["pi",s.icon])},null,2),P(" "+p(s.label),1)],10,is))),128))])]),f.value==="image-to-video"&&me.value.length>1?(i(),r("div",ns,[a("div",rs,[(i(!0),r(R,null,U(me.value,s=>(i(),r("button",{key:s.value,class:z(["flex-1 py-2 px-2 rounded-lg text-xs font-bold transition-all flex items-center justify-center gap-1.5",_.value===s.value?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"]),onClick:l=>_.value=s.value,disabled:C.value},[a("i",{class:z(["pi",s.icon])},null,2),P(" "+p(s.label),1)],10,us))),128))])])):m("",!0),se.value?(i(),r("div",ds,[a("label",cs,[P(p(e.$t("studio.image.source_images"))+" ",1),we.value?(i(),r("span",vs,"("+p(we.value)+")",1)):m("",!0)]),a("div",ps,[a("input",{ref_key:"imageInput",ref:G,type:"file",accept:"image/png, image/jpeg, image/jpg",multiple:S.value>1,onChange:ct,class:"hidden"},null,40,gs),n.value.length===0?(i(),r("div",{key:0,class:"border-2 border-dashed border-slate-200 rounded-2xl p-6 cursor-pointer hover:border-slate-400 hover:bg-slate-50 transition-all text-center",onClick:t[2]||(t[2]=s=>J())},[a("div",ms,[t[18]||(t[18]=a("div",{class:"size-12 rounded-full bg-slate-100 flex items-center justify-center"},[a("i",{class:"pi pi-cloud-upload text-xl"})],-1)),a("span",fs,p(He.value),1)])])):Je.value?(i(),r("div",hs,[(i(!0),r(R,null,U(Ke.value,s=>(i(),r("div",{key:s.label,class:"space-y-2"},[a("div",bs,p(s.label),1),s.image?(i(),ie(je,{key:0,image:s.image,loading:s.image.loading,"aspect-class":"aspect-video",onReplace:l=>J(s.image.id),onRemove:l=>Ue(s.image.id)},null,8,["image","loading","onReplace","onRemove"])):(i(),r("div",{key:1,class:"aspect-video rounded-xl border-2 border-dashed border-slate-200 bg-slate-50/70 flex flex-col items-center justify-center cursor-pointer hover:bg-slate-50 hover:border-slate-400 transition-all text-slate-400 hover:text-slate-600",onClick:t[3]||(t[3]=l=>J())},[t[19]||(t[19]=a("i",{class:"pi pi-plus text-lg mb-1"},null,-1)),a("span",xs,p(s.label),1)]))]))),128))])):(i(),r("div",_s,[(i(!0),r(R,null,U(n.value,s=>(i(),ie(je,{key:s.id,image:s,loading:s.loading,onReplace:l=>J(s.id),onRemove:l=>Ue(s.id)},null,8,["image","loading","onReplace","onRemove"]))),128)),n.value.length<S.value?(i(),r("div",{key:0,class:"aspect-square rounded-xl border-2 border-dashed border-slate-200 flex flex-col items-center justify-center cursor-pointer hover:bg-slate-50 hover:border-slate-400 transition-all text-slate-400 hover:text-slate-600",onClick:t[4]||(t[4]=s=>J())},[t[20]||(t[20]=a("i",{class:"pi pi-plus text-lg mb-1"},null,-1)),a("span",ys,p(e.$t("studio.common.add")),1)])):m("",!0)]))])])):m("",!0),a("div",ws,[a("label",ks,p(e.$t("studio.common.ai_model")),1),L(Nt,{options:A.value,selectedValue:h.value,"onUpdate:selectedValue":t[5]||(t[5]=s=>h.value=s),disabled:C.value,placeholder:"Select a video model",class:"w-full"},null,8,["options","selectedValue","disabled"])]),q.value.length>0||H.value.length>0||W.value.length>1?(i(),r("div",Ss,[a("label",$s,p(e.$t("studio.video.settings")),1),a("div",Is,[q.value.length>0?(i(),r("div",Rs,[le(a("select",{"onUpdate:modelValue":t[6]||(t[6]=s=>$.value=s),class:"w-full px-3 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-sm font-bold text-slate-700 focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900 transition-all appearance-none cursor-pointer"},[(i(!0),r(R,null,U(q.value,s=>(i(),r("option",{key:s.value,value:s.value},p(s.label),9,Ts))),128))],512),[[Pe,$.value]])])):m("",!0),H.value.length>0?(i(),r("div",Cs,[a("div",Ms,[(i(!0),r(R,null,U(H.value,(s,l)=>(i(),r(R,{key:s.value},[l>0?(i(),r("div",Us)):m("",!0),a("button",{class:z(["flex-1 py-1.5 rounded-lg text-xs font-bold transition-all flex items-center justify-center gap-1.5",y.value===s.value?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"]),onClick:d=>y.value=s.value},[s.icon?(i(),r("i",{key:0,class:z("pi "+s.icon)},null,2)):m("",!0),P(" "+p(s.label||s.value),1)],10,Ls)],64))),128))])])):m("",!0),W.value.length>1?(i(),r("div",Fs,[a("label",Ps,p(e.$t("studio.image.resolution")),1),a("div",zs,[(i(!0),r(R,null,U(W.value,(s,l)=>(i(),r(R,{key:s.value},[l>0?(i(),r("div",js)):m("",!0),a("button",{class:z(["flex-1 py-1.5 rounded-lg text-xs font-bold transition-all flex items-center justify-center gap-1.5",I.value===s.value?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"]),onClick:d=>I.value=s.value},p(s.label||s.value),11,Os)],64))),128))])])):m("",!0),pe.value?(i(),r("div",Ds,[a("label",Vs,[P(p(e.$t("studio.common.batch_size"))+" ",1),le(a("i",Es,null,512),[[u,e.$t("studio.common.batch_size_desc"),void 0,{top:!0}]])]),le(a("select",{"onUpdate:modelValue":t[7]||(t[7]=s=>Q.value=s),disabled:C.value,class:"w-full px-3 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-sm font-bold text-slate-700 focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900 transition-all appearance-none cursor-pointer"},[(i(),r(R,null,U(Ne,s=>a("option",{key:s,value:s},p(s),9,Ws)),64))],8,As),[[Pe,Q.value]])])):m("",!0)])])):m("",!0),a("div",Gs,[a("div",Ns,[a("label",Bs,p(e.$t("studio.common.prompt")),1),a("span",qs,p(x.value.length)+" "+p(e.$t("studio.video.chars")),1)]),a("div",Hs,[le(a("textarea",{"onUpdate:modelValue":t[8]||(t[8]=s=>x.value=s),class:"resize-y w-full p-4 border border-slate-200 rounded-2xl focus:ring-2 focus:ring-slate-900 focus:border-transparent min-h-[120px] text-slate-700 placeholder:text-slate-400",placeholder:e.$t("studio.video.prompt_placeholder"),disabled:C.value},null,8,Js),[[It,x.value]]),a("div",Ks,[x.value?(i(),r("button",{key:0,onClick:t[9]||(t[9]=s=>x.value=""),class:"p-1.5 text-slate-400 hover:text-slate-600 hover:bg-slate-200 rounded-lg transition-colors",title:"Clear prompt"},[...t[21]||(t[21]=[a("i",{class:"pi pi-times text-xs"},null,-1)])])):m("",!0)])])])]),a("div",Xs,[L(Ot,{"is-generating":C.value,"is-upgrade-state":gt.value,prompt:x.value,"generation-type":f.value,"source-images-count":n.value.length,quota:mt.value,"model-name":h.value,disabled:ft.value,onGenerate:ht,onLogin:t[10]||(t[10]=s=>be(w).login()),onUpgrade:t[11]||(t[11]=s=>be(j).push(e.$localePath("/pricing")))},null,8,["is-generating","is-upgrade-state","prompt","generation-type","source-images-count","quota","model-name","disabled"])])]),ne.value?m("",!0):(i(),r("div",Zs,[a("div",{class:"h-full overflow-y-auto",onScroll:Ye},[a("div",Ys,[L(Dt,{"inspiration-label":e.$t("studio.video.inspiration"),"history-label":e.$t("studio.history.title"),categories:et,"selected-category":E.value,"onUpdate:selectedCategory":t[12]||(t[12]=s=>E.value=s),onOpenHistory:Ae},null,8,["inspiration-label","history-label","selected-category"]),a("div",Qs,[ue.value?(i(),r("div",ea,[L(o,{variant:"large",color:"#475569",label:"Loading inspiration…"}
2)])):(i(),r("div",ta,[Se.value.length===0?(i(),r("div",sa,[a("div",aa,[t[22]||(t[22]=a("i",{class:"pi pi-compass text-sm"},null,-1)),a("span",oa,p(e.$t("studio.inspiration.empty_category")),1)])])):m("",!0),L(At,{ref_key:"templatesWaterfallRef",ref:Qe,items:Se.value,"min-column-width":240,"max-columns":4,gap:1.5,onItemClick:nt},{default:Ve(({item:s})=>[a("div",la,[a("div",{class:"relative overflow-hidden aspect-auto bg-slate-100",style:ze({aspectRatio:s.imageWidth&&s.imageHeight?`${s.imageWidth}/${s.imageHeight}`:"auto"})},[s.imageUrl?(i(),ie(Wt,{key:0,src:s.imageUrl,alt:s.title,width:s.imageWidth,height:s.imageHeight,class:"w-full h-auto object-cover transition-transform duration-700 group-hover:scale-110"},null,8,["src","alt","width","height"])):(i(),r("div",ia,[...t[23]||(t[23]=[a("i",{class:"pi pi-video text-3xl"},null,-1)])])),a("div",na,p(s.type==="text-to-video"?"TXT":"IMG"),1),s.author?(i(),r("div",ra,[t[24]||(t[24]=a("i",{class:"pi pi-user text-[10px]"},null,-1)),P(" "+p(s.author),1)])):m("",!0)],4),a("div",ua,[a("h4",da,p(s.title),1),a("div",ca,[s.inputResources?.length?(i(),r("div",va,[(i(!0),r(R,null,U(s.inputResources.slice(0,3),(l,d)=>(i(),r("div",{key:d,class:z(["absolute w-12 h-12 rounded-lg border-2 border-white shadow-sm bg-slate-200 overflow-hidden transform transition-all duration-300 ease-out origin-bottom-left",[d===1?"group-hover/stack:translate-x-4 group-hover/stack:rotate-6":"",d===2?"group-hover/stack:translate-x-8 group-hover/stack:rotate-12":""]]),style:ze({left:`${d*5}px`,top:`${d*5}px`,zIndex:3-d,"--tw-rotate":`${d%2===0?"-3":"3"}deg`})},[a("img",{src:l,class:"w-full h-full object-cover"},null,8,pa)],6))),128))])):m("",!0),a("p",ga,p(s.prompt),1)])])])]),_:1},8,["items"]),Z.value?(i(),r("div",ma,[L(o,{variant:"small",color:"#94a3b8",label:"Loading more…"})])):m("",!0)]))])])],32)]))])])])}}}),ha=Object.assign(Ut(fa,[["__scopeId","data-v-a6e55948"]]),{__name:"AiVideoWorkarea"}),ba={class:"relative h-full"},xa={key:0,class:"absolute inset-0 z-40 bg-slate-50"},_a={class:"h-full w-full overflow-y-auto bg-gradient-to-br from-slate-50 to-gray-100"},Ga=Oe({name:"StudioVideoPage",__name:"video",setup(Ee){const b=Lt(),x=Ft(),f=De(),_=Pt(),h=g(()=>_.isMobile),n=g(()=>b.path!==f("/studio/video")),D=G=>{G||x.push(f("/studio/video"))};return(G,$)=>{const y=zt,I=jt;return i(),r("div",ba,[L(ha),h.value&&n.value?(i(),r("div",xa,[L(y,{keepalive:""})])):h.value?m("",!0):(i(),ie(I,{key:1,open:n.value,"onUpdate:open":[$[0]||($[0]=X=>n.value=X),D],direction:"right",dismissible:!1,inset:!1,handle:!1,ui:{content:"w-full md:w-[600px] lg:w-[800px]",overlay:"bg-black/20"}},{content:Ve(()=>[a("div",_a,[L(y,{keepalive:""})])]),_:1},8,["open"]))])}}});export{Ga 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.