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 ke,u as st,U as at,a as f,r as c,H as $e,aS as ot,w as Q,h as _e,g as Se,R as lt,aT as it,v as nt,b as rt,j as u,o as i,s as _,l as a,E,p as m,m as B,al as ut,q as re,F as O,x as D,k as $,Q as Y,ay as ue,K as Ie,aU as dt,aM as ct,c as de,ae as we,A as pt,aV as mt,W as gt,T as vt,f as ft,_ as ht}from"./DZ7mik94.js";import{_ as bt}from"./D7bbJmtS.js";import{G as yt,S as xt,_ as _t,a as wt}from"./DUS9Z8S1.js";import{T as kt}from"./DB7NpyPD.js";import{M as $t}from"./CfokIUfS.js";import{u as St}from"./RJDv4jit.js";import It from"./CfI3uaTg.js";import{W as Ut}from"./BDBxKVhw.js";import{I as Tt}from"./uWVYgc1G.js";import{d as Ct}from"./CIZylvxh.js";import{u as Rt}from"./D1AKMsRP.js";import{g as Mt}from"./Lmt8mlL8.js";import{P as Pt}from"./BYy7MCXC.js";import"./GefESYmt.js";import"./0J-1uiXP.js";import"./Ci2gcBr-.js";import"./Y2uuUinc.js";import"./Du7nxuHz.js";import"./BDcM2FMb.js";import"./DXDH8whQ.js";import"./BciGH192.js";import"./CFmxRTIl.js";import"./Cu8igjOL.js";import"./BETpJ00V.js";const Lt={class:"h-full w-full flex flex-col bg-slate-50 relative overflow-hidden"},zt={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"},Ft={class:"flex-1 overflow-hidden"},jt={class:"flex w-full h-full"},Et={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"},At={class:"p-4 md:p-6 overflow-y-auto flex-1 space-y-5 md:space-y-6"},Vt={class:"flex items-center gap-3 mb-2"},Wt={class:"text-xl font-bold text-slate-900"},Bt={key:0,class:"p-4 bg-red-50 border border-red-100 rounded-xl flex items-start gap-3 text-red-700"},Ot={class:"flex-1 text-sm font-medium"},Dt={class:"space-y-2 pt-2"},Nt={class:"flex p-1 bg-slate-100 rounded-xl"},Ht=["disabled"],Gt=["disabled"],qt={key:1,class:"space-y-2"},Xt={class:"text-sm font-bold text-slate-700"},Jt={class:"space-y-3"},Kt={class:"flex flex-col items-center gap-2 text-slate-500"},Zt={class:"text-sm font-medium"},Qt={key:1,class:"grid grid-cols-3 gap-3"},Yt={class:"text-xs font-bold"},es={class:"space-y-2"},ts={class:"text-sm font-bold text-slate-700"},ss={class:"grid grid-cols-2 gap-3"},as={key:0,class:"space-y-2"},os={class:"text-sm font-bold text-slate-700"},ls=["disabled"],is=["value"],ns={key:1,class:"space-y-2"},rs={class:"text-sm font-bold text-slate-700"},us=["disabled"],ds=["value"],cs={key:2,class:"space-y-2"},ps={class:"text-sm font-bold text-slate-700 flex items-center gap-1"},ms={class:"pi pi-info-circle text-xs text-slate-400 cursor-help"},gs=["disabled"],vs=["value"],fs={class:"space-y-2 flex flex-col"},hs={class:"text-sm font-bold text-slate-700"},bs={class:"p-6 border-t border-slate-200 bg-white"},ys={key:0,class:"flex-1 h-full overflow-hidden bg-slate-50 relative"},xs={class:"max-w-7xl mx-auto"},_s={class:"space-y-6 px-6 pb-8"},ws={key:0,class:"flex min-h-[60vh] items-center justify-center"},ks={key:1,class:"py-20 text-center text-red-500"},$s={class:"mb-2 font-bold"},Ss={key:2,class:"relative"},Is={key:0,class:"py-20 text-center text-slate-500"},Us={class:"inline-flex items-center gap-2 rounded-2xl border border-slate-200 bg-white px-4 py-3 shadow-sm"},Ts={class:"text-sm font-semibold"},Cs={class:"bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden group hover:shadow-lg transition-all duration-300 cursor-pointer h-full flex flex-col"},Rs={key:1,class:"w-full h-48 flex items-center justify-center text-slate-300"},Ms={class:"absolute inset-0 bg-gradient-to-t from-black/60 via-trans
2parent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-end p-4"},Ps={class:"text-white text-xs font-bold"},Ls={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"},zs={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-2"},Fs={class:"p-4 flex-1 flex flex-col"},js={class:"text-sm font-bold text-slate-900 line-clamp-2 mb-2"},Es={class:"flex gap-3"},As={key:0,class:"flex-shrink-0 relative w-12 h-12 mr-2 group/stack"},Vs=["src"],Ws={class:"text-xs text-slate-500 line-clamp-3 leading-relaxed flex-1"},Bs={key:1,class:"py-12 flex items-center justify-center"},Os=ke({__name:"ImageWorkarea",setup(Ue){const{t:M}=st();at(f(()=>Mt(M).studioImage));const S=c(""),h=c("text-to-image"),d=c([]),A=c(null),x=c("16:9"),I=c("2K"),P=c(!1),T=c(null),y=c(!1),w=c(null);c(!1);const ee=$e(),ce=f(()=>ee.isMobile);c("inspiration");const Te=()=>{R.push(V("/studio/image/history"))},pe=ot(),Ce={"text-to-image":"txt2img","image-to-image":"img2img"},L=f(()=>{const e=Ce[h.value];return pe.imageOptions.filter(t=>!t.modes||t.modes.length===0||t.modes.includes(e))}),k=c(""),N=f(()=>{const e=L.value;return!e||e.length===0?{value:k.value,label:k.value}:e.find(t=>t.value===k.value)||e[0]}),H=f(()=>N.value?.value||k.value),z=f(()=>{const e=N.value;return e?.aspect_ratios&&e.aspect_ratios.length>0?e.aspect_ratios:[]}),C=f(()=>{const e=N.value;return e?.resolutions&&e.resolutions.length>0?e.resolutions:[]}),me=f(()=>C.value.find(e=>e.value===I.value)),te=f(()=>{const e=me.value;return e?.sizes?.[x.value]?e.sizes[x.value]:e?.value||I.value}),Re=f(()=>{const e=me.value,t=te.value;return!!e?.sizes?.[x.value]||/^(\d+\s*[x*]\s*\d+|auto)$/i.test(t)});Q(h,()=>{L.value.length>0&&!L.value.some(e=>e.value===k.value)&&(k.value=L.value[0].value)}),Q(H,()=>{z.value.length>0&&!z.value.some(e=>e.value===x.value)&&(x.value=z.value[0]?.value||""),C.value.length>0&&!C.value.some(e=>e.value===I.value)&&(I.value=C.value[0]?.value||"")});const U=_e(),Me=Rt(),Pe=ct(),R=ut(),V=Se(),G=lt(),{triggerFirstCall:Le}=it(),se=c([]),q=c(!1),X=c(1),ze=[1,2,3,4,5];f(()=>{const e=U.info;return(e&&typeof e.plan_name=="string"?e.plan_name:"Free").toLowerCase().includes("free")});const ae=f(()=>{const e=U.info;return(e&&typeof e.plan_name=="string"?e.plan_name:"Free").toLowerCase().includes("premium")}),F=c([]),oe=c(1),ge=c(20),le=c(!0),J=c(!1),j=c("all"),Fe=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),[]}},je=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:Fe(e.input_resource),author:e.author,sourceUrl:e.source_url}),K=async(e=1,t=!1)=>{try{e===1?P.value=!0:J.value=!0,T.value=null;const l=await dt({p:e,page_size:ge.value,types:["text-to-image","image-to-image"].join(","),industry:j.value});if(l.items){const o=l.items.map(s=>je(s));t?F.value=[...F.value,...o]:F.value=o,le.value=l.items.length===ge.value,oe.value=e}}catch(l){console.error("Failed to load prompt templates:",l),T.value="Failed to load prompt templates"}finally{P.value=!1,J.value=!1}},ve=Ct(async()=>{if(!le.value||J.value)return;const e=oe.value+1;await K(e,!0)},300),Ee=e=>{const t=e.target||e.currentTarget;if(!t)return;const{scrollTop:l,scrollHeight:o,clientHeight:s}=t;l+s>=o-400&&ve()};nt(async()=>{try{await pe.loadCatalog()}catch{}const e=L.value;if(k.value||(k.value=e&&e.length>0?e[0].value:""),!U.isLogin)try{await U.getUserInfo()}catch{}if(U.isLogin)try{const t=await G.getModelsCached();se.value=Array.isArray(t)?t:[]}catch{se.value=[]}finally{q.value=!0}else q.value=!0;K()}),rt(()=>{const e=()=>{};window.removeEventListener("resize",e)}),c([]);const Z=c(null),Ae=e=>{const t=e.target,l=t.files;if(l&&l.length>0){let s=d.value.reduce((n,r)=>n+(r.file?.size||0),0);if(Z.value){const n=l[0];if(n&&(n.type==="image/png"||n.type==="image/jpeg"||n.type==="image/jpg")){const r=d.value.findIndex(v=>v.id===Z.value);if(r!==-1){const v=d.value[r]?.file?.size||0;if(s-v+n.size>20971520){w.value=M("studio.image.total_size_exceeded",{size:"20MB"}),t&&(t.value="");return}const p=new FileReader;p.onload=g=>{const b=d.value[r];d.value[r]={id:b.id,file:n,url:g.target?.result,name:n.name,loading:!1}},p.readAsDataURL(n)}Z.value=null}}else{let n=0;const r=[];if(Array.from(l).forEach(v=>{(v.type==="image/png"||v.type==="image/jpeg"||v.type==="image/jpg")&&(n+=v.size,r.push(v))}),s+n>20971520){w.value=M("studio.image.total_size_exceeded",{size:"20MB"}),t&&(t.value="");return}r.forEach(v=>{const p=new FileReader;p.onload=g=>{const b={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:v,url:g.target?.result,name:v.name};d.value.push(b)},p.readAsDataURL(v)})}}t&&(t.value="")},ie=e=>{Z.value=e||null,A.value?.click()},Ve=e=>{d.value=d.value.filter(t=>t.id!==e)},We=Pt,fe=f(()=>j.value==="all"?F.value:F.value.filter(e=>e.industry===j.value));Q(j,async()=>{ve.cancel(),oe.value=1,le.value=!0,F.value=[],await K(1,!1)});const Be=async e=>new Promise((t,l)=>{const o=new Image;o.onload=()=>{const s=document.createElement("canvas");s.width=o.width,s.height=o.height;const n=s.getContext("2d");if(!n){l(new Error("Failed to get canvas context"));return}n.fillStyle="#FFFFFF",n.fillRect(0,0,s.width,s.height),n.drawImage(o,0,0),s.toBlob(r=>{r?t(r):l(new Error("Canvas to Blob conversion failed"))},"image/jpeg",.95)},o.onerror=s=>l(s),o.src=URL.createObjectURL(e)}),Oe=async(e,t)=>{let l;if(e.startsWith("data:"))l=await(await fetch(e)).blob();else try{const o=new URL(e,window.location.origin);o.searchParams.append("t",Date.now().toString());const s=await fetch(o.toString(),{mode:"cors",cache:"no-cache"});if(!s.ok)throw new Error(`Failed to fetch image: ${s.status} ${s.statusText}`);l=await s.blob()}catch(o){console.warn("First fetch attempt failed, retrying raw URL",o);const s=await fetch(e,{mode:"cors"});if(!s.ok)throw new Error(`Fallback fetch failed: ${s.status} ${s.statusText}`);l=await s.blob()}if(l.type==="image/webp"||t.toLowerCase().endsWith(".webp"))try{l=await Be(l),t=t.replace(/\.webp$/i,".jpg"),t.toLowerCase().endsWith(".jpg")||(t+=".jpg")}catch(o){console.error("WebP to JPG conversion failed, using original",o)}return new File([l],t,{type:l.type})},{triggerUseTemplate:he}
2=St(),be=()=>V("/studio/image"),ye=()=>V("/studio/image/history"),De=()=>V("/studio/image/inspiration"),Ne=e=>V(`/studio/image/inspiration/${e}`),He=async()=>{Pe.path!==be()&&await R.replace(be())},Ge=async()=>{await R.push(De())},qe=async e=>{const t=e.key||e.id;await R.push(Ne(t))};Q(he,e=>{e&&(Xe(e),he.value=null)});const Xe=async e=>{if(await He(),S.value=e.prompt,e.inputResources&&e.inputResources.length>0){h.value="image-to-image";const t=e.inputResources.map((l,o)=>({id:Date.now().toString()+Math.random().toString(36).substr(2,9)+o,name:`Loading ${o}`,url:"",loading:!0}));d.value=t;try{const l=e.inputResources.map(async(o,s)=>{try{let n=`image-${s}.png`;try{if(!o.startsWith("data:")){const b=o.split("/"),W=b[b.length-1];W&&(n=W)}}catch{}const r=await Oe(o,n),v=URL.createObjectURL(r),p=t[s]?.id,g=d.value.findIndex(b=>b.id===p);if(g!==-1){const b=d.value[g];d.value[g]={id:b.id,file:r,url:v,name:n,loading:!1}}}catch(n){console.error("Failed to load template image:",o,n);const r=t[s]?.id;r&&(d.value=d.value.filter(v=>v.id!==r))}});await Promise.all(l)}catch(l){console.error("Failed to load source images from template",l),d.value=d.value.filter(o=>!o.loading)}}else h.value=e.type},Je=async()=>{w.value=null;const e=_e();if(!e.isLogin)try{await e.getUserInfo()}catch{e.login();return}if(!S.value.trim()){w.value="Please enter a prompt";return}if(h.value==="image-to-image"&&d.value.length===0){w.value="Please upload at least one reference image";return}y.value=!0;try{const t=[];if(h.value==="image-to-image"&&d.value.length>0){const p=d.value.map(g=>g.file).filter(g=>!!g);p.length===0&&d.value.length>0;for(const g of p){const b=await g.arrayBuffer(),W=new Uint8Array(b);let xe="";for(let ne=0;ne<W.byteLength;ne++)xe+=String.fromCharCode(W[ne]);const tt=btoa(xe);t.push(`data:${g.type};base64,${tt}`)}}const{submitUserTask:l}=await pt(async()=>{const{submitUserTask:p}=await import("./DZ7mik94.js").then(g=>g.e$);return{submitUserTask:p}},__vite__mapDeps([0,1]),import.meta.url),o={};z.value.length>0&&x.value&&(o.aspect_ratio=x.value),C.value.length>0&&I.value&&(o.image_size=te.value,Re.value&&(o.size=te.value));try{const p=await mt(),g=p.count??p.data?.count??0,b=ae.value?X.value:1;if(g+b>10){w.value=M("studio.history.active_tasks_limit",{count:g,limit:10,new:b}),y.value=!1;return}}catch(p){console.error("Failed to check active tasks",p)}const s=ae.value?X.value:1,n=[];for(let p=0;p<s;p++)n.push((async()=>{const g=await l({task_type:"image",model:H.value,prompt:S.value,images:t,options:o,is_shared:!0});return g.data?.data||g.data||g})());const r=await Promise.all(n),v=r[r.length-1];if(v&&v.id)r.forEach(p=>{p&&p.id&&Me.updateTask(p)}),await R.push(ye()),Le();else throw new Error("Failed to create task")}catch(t){console.error("Image generation error:",t),w.value=`Generation failed: ${t.message||"Unknown error"}`}finally{y.value=!1;try{await G.loadDailyQuotas(!0)}catch{}}},Ke=f(()=>{if(!U.isLogin||!q.value)return!0;const e=N.value?.value||k.value;return se.value.includes(e)}),Ze=f(()=>U.isLogin&&q.value&&!Ke.value),Qe=f(()=>{const e=G.quotaByModel(H.value);return e?{enabled:G.quotasEnabled,limit:e.limit,remain:e.remain}:{enabled:!1,limit:0,remain:0}}),Ye=f(()=>!S.value.trim()||h.value==="image-to-image"&&d.value.length===0),et=()=>{Je()};return c(!1),(e,t)=>{const l=_t,o=kt;return i(),u("div",Lt,[ce.value?(i(),u("div",zt,[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=>B(R).push(ye()))},[t[15]||(t[15]=a("i",{class:"pi pi-images text-indigo-500"},null,-1)),E(" "+m(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:Ge},[t[16]||(t[16]=a("i",{class:"pi pi-list text-indigo-500"},null,-1)),E(" "+m(e.$t("studio.image.inspiration")),1)])])):_("",!0),a("section",Ft,[a("div",jt,[a("div",Et,[a("div",At,[a("div",Vt,[t[17]||(t[17]=a("div",{class:"size-10 rounded-xl bg-indigo-50 flex items-center justify-center"},[a("i",{class:"pi pi-palette text-indigo-600 text-xl"})],-1)),a("h2",Wt,m(e.$t("studio.image.title")),1)]),w.value?(i(),u("div",Bt,[t[19]||(t[19]=a("i",{class:"pi pi-exclamation-circle mt
2-0.5"},null,-1)),a("div",Ot,m(w.value),1),a("button",{onClick:t[1]||(t[1]=s=>w.value=null),class:"text-red-400 hover:text-red-700"},[...t[18]||(t[18]=[a("i",{class:"pi pi-times"},null,-1)])])])):_("",!0),a("div",Dt,[a("div",Nt,[a("button",{class:re(["flex-1 py-2 px-2 rounded-lg text-sm font-bold transition-all flex items-center justify-center gap-2",h.value==="text-to-image"?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"]),onClick:t[2]||(t[2]=s=>h.value="text-to-image"),disabled:y.value},[t[20]||(t[20]=a("i",{class:"pi pi-file-edit"},null,-1)),E(" "+m(e.$t("studio.image.text_to_image")),1)],10,Ht),a("button",{class:re(["flex-1 py-2 px-2 rounded-lg text-sm font-bold transition-all flex items-center justify-center gap-2",h.value==="image-to-image"?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"]),onClick:t[3]||(t[3]=s=>h.value="image-to-image"),disabled:y.value},[t[21]||(t[21]=a("i",{class:"pi pi-images"},null,-1)),E(" "+m(e.$t("studio.image.image_to_image")),1)],10,Gt)])]),h.value==="image-to-image"?(i(),u("div",qt,[a("label",Xt,m(e.$t("studio.image.source_images")),1),a("div",Jt,[a("input",{ref_key:"fileInput",ref:A,type:"file",accept:"image/png, image/jpeg, image/jpg",multiple:"",onChange:Ae,style:{display:"none"}},null,544),d.value.length===0?(i(),u("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[4]||(t[4]=s=>ie())},[a("div",Kt,[t[22]||(t[22]=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",Zt,m(e.$t("studio.image.upload_placeholder")),1)])])):(i(),u("div",Qt,[(i(!0),u(O,null,D(d.value,s=>(i(),de(wt,{key:s.id,image:s,loading:s.loading,onReplace:n=>ie(s.id),onRemove:n=>Ve(s.id)},null,8,["image","loading","onReplace","onRemove"]))),128)),d.value.length<9?(i(),u("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[5]||(t[5]=s=>ie())},[t[23]||(t[23]=a("i",{class:"pi pi-plus text-lg mb-1"},null,-1)),a("span",Yt,m(e.$t("studio.common.add")),1)])):_("",!0)]))])])):_("",!0),a("div",es,[a("label",ts,m(e.$t("studio.common.ai_model")),1),$($t,{options:L.value,selectedValue:k.value,"onUpdate:selectedValue":t[6]||(t[6]=s=>k.value=s),disabled:y.value,placeholder:"Select a vision model",class:"w-full","badge-text":"Nano Banana 2 Is Avaliable"},null,8,["options","selectedValue","disabled"])]),a("div",ss,[z.value.length>0?(i(),u("div",as,[a("label",os,m(e.$t("studio.image.aspect_ratio")),1),Y(a("select",{"onUpdate:modelValue":t[7]||(t[7]=s=>x.value=s),disabled:y.value,class:"w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-sm font-medium text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 transition-all appearance-none cursor-pointer"},[(i(!0),u(O,null,D(z.value,s=>(i(),u("option",{key:s.value,value:s.value},m(s.label||s.value),9,is))),128))],8,ls),[[ue,x.value]])])):_("",!0),C.value.length>0?(i(),u("div",ns,[a("label",rs,m(e.$t("studio.image.resolution")),1),Y(a("select",{"onUpdate:modelValue":t[8]||(t[8]=s=>I.value=s),disabled:y.value,class:"w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-sm font-medium text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 transition-all appearance-none cursor-pointer"},[(i(!0),u(O,null,D(C.value,s=>(i(),u("option",{key:s.value,value:s.value},m(s.label||s.value),9,ds))),128))],8,us),[[ue,I.value]])])):_("",!0),ae.value?(i(),u("div",cs,[a("label",ps,[E(m(e.$t("studio.common.batch_size"))+" ",1),Y(a("i",ms,null,512),[[o,e.$t("studio.common.batch_size_desc"),void 0,{top:!0}]])]),Y(a("select",{"onUpdate:modelValue":t[9]||(t[9]=s=>X.value=s),disabled:y.value,class:"w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-sm font-medium text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 transition-all appearance-none cursor-pointer"},[(i(),u(O,null,D(ze,s=>a("option",{key:s,value:s},m(s),9,vs)),64))],8,gs),[[ue,X.value]])])):_("",!0)]),a("div",fs,[a("label",hs,m(h.value==="text-to-image"?e.$t("studio.common.prompt"):e.$t("studio.image.trans_prompt")),1),$(B(It),{modelValue:S.value,"onUpdate:modelValue":t[10]||(t[10]=s=>S.value=s),placeholder:h.value==="text-to-image"?e.$t("studio.image.prompt_placeholder_text"):e.$t("studio.image.prompt_placeholder_image"),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",disabled:y.value},null,8,["modelValue","placeholder","disabled"])])]),a("div",bs,[$(yt,{"is-generating":y.value,"is-upgrade-state":Ze.value,prompt:S.value,"generation-type":h.value,"source-images-count":d.value.length,quota:Qe.value,"model-name":H.value,disabled:Ye.value,onGenerate:et,onLogin:t[11]||(t[11]=s=>B(U).login()),onUpgrade:t[12]||(t[12]=s=>B(R).push(e.$localePath("/pricing")))},null,8,["is-generating","is-upgrade-state","prompt","generation-type","source-images-count","quota","model-name","disabled"])])]),ce.value?_("",!0):(i(),u("div",ys,[a("div",{class:"h-full overflow-y-auto",onScroll:Ee},[a("div",xs,[$(xt,{"inspiration-label":e.$t("studio.image.inspiration"),"history-label":e.$t("studio.history.title"),categories:B(We),"selected-category":j.value,"onUpdate:selectedCategory":t[13]||(t[13]=s=>j.value=s),onOpenHistory:Te},null,8,["inspiration-label","history-label","categories","selected-category"]),a("div",_s,[P.value?(i(),u("div",ws,[$(l,{variant:"large",color:"#475569",label:"Loading inspirationâ¦"}
2)])):T.value?(i(),u("div",ks,[a("p",$s,m(T.value),1),a("button",{class:"text-sm font-bold underline hover:text-red-600",onClick:t[14]||(t[14]=()=>K())},"Retry")])):(i(),u("div",Ss,[fe.value.length===0?(i(),u("div",Is,[a("div",Us,[t[24]||(t[24]=a("i",{class:"pi pi-compass text-sm"},null,-1)),a("span",Ts,m(e.$t("studio.inspiration.empty_category")),1)])])):_("",!0),$(Ut,{items:fe.value,"min-column-width":240,"max-columns":4,gap:1.5,onItemClick:qe},{default:Ie(({item:s})=>[a("div",Cs,[a("div",{class:"bg-slate-100 relative overflow-hidden",style:we({aspectRatio:s.imageWidth&&s.imageHeight?`${s.imageWidth}/${s.imageHeight}`:"auto"})},[s.imageUrl?(i(),de(Tt,{key:0,src:s.imageUrl,alt:s.title,width:s.imageWidth,height:s.imageHeight,class:"w-full h-auto block transition-transform duration-700 group-hover:scale-110"},null,8,["src","alt","width","height"])):(i(),u("div",Rs,[...t[25]||(t[25]=[a("i",{class:"pi pi-image text-xl"},null,-1)])])),a("div",Ms,[a("span",Ps,[E(m(e.$t("studio.image.use_prompt"))+" ",1),t[26]||(t[26]=a("i",{class:"pi pi-arrow-right ml-1 text-[10px]"},null,-1))])]),a("div",Ls,m(s.type==="text-to-image"?"TXT":"IMG"),1),s.author?(i(),u("div",zs," @"+m(s.author),1)):_("",!0)],4),a("div",Fs,[a("h4",js,m(s.title),1),a("div",Es,[s.inputResources?.length?(i(),u("div",As,[(i(!0),u(O,null,D(s.inputResources.slice(0,3),(n,r)=>(i(),u("div",{key:r,class:re(["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",[r===1?"group-hover/stack:translate-x-4 group-hover/stack:rotate-6":"",r===2?"group-hover/stack:translate-x-8 group-hover/stack:rotate-12":""]]),style:we({left:`${r*5}px`,top:`${r*5}px`,zIndex:3-r,"--tw-rotate":`${r%2===0?"-3":"3"}deg`})},[a("img",{src:n,class:"w-full h-full object-cover"},null,8,Vs)],6))),128))])):_("",!0),a("p",Ws,m(s.prompt),1)])])])]),_:1},8,["items"]),J.value?(i(),u("div",Bs,[$(l,{variant:"small",color:"#94a3b8",label:"Loading moreâ¦"})])):_("",!0)]))])])],32)]))])])])}}}),Ds=Object.assign(gt(Os,[["__scopeId","data-v-7b41494a"]]),{__name:"AiImageWorkarea"}),Ns={class:"relative h-full"},Hs={key:0,class:"absolute inset-0 z-40 bg-slate-50"},Gs={class:"h-full w-full overflow-y-auto bg-gradient-to-br from-slate-50 to-gray-100"},ha=ke({name:"StudioImagePage",__name:"image",setup(Ue){const M=vt(),S=ft(),h=Se(),d=$e(),A=f(()=>d.isMobile),x=f(()=>M.path!==h("/studio/image")),I=P=>{P||S.push(h("/studio/image"))};return(P,T)=>{const y=ht,w=bt;return i(),u("div",Ns,[$(Ds),A.value&&x.value?(i(),u("div",Hs,[$(y,{keepalive:""})])):A.value?_("",!0):(i(),de(w,{key:1,open:x.value,"onUpdate:open":[T[0]||(T[0]=ee=>x.value=ee),I],direction:"right",dismissible:!1,inset:!1,handle:!1,ui:{content:"w-full md:w-[600px] lg:w-[800px]",overlay:"bg-black/20"}},{content:Ie(()=>[a("div",Gs,[$(y,{keepalive:""})])]),_:1},8,["open"]))])}}});export{ha 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.