1import{d as K,u as X,g as Y,f as q,r as u,a as f,v as Q,a5 as Z,bn as ee,bR as te,c as b,o as l,K as _,m as c,aU as se,l as e,j as p,s as v,F as W,x as R,k as d,n as oe,p as o,ae,y as L,E as x,bT as le,J as ie}from"./DZ7mik94.js";import{_ as re}from"./CvFJ8Mle.js";import{I as N}from"./uWVYgc1G.js";import{W as ne}from"./BDBxKVhw.js";import"./BETpJ00V.js";import"./CIZylvxh.js";const ce={class:"inline-flex items-center gap-3"},pe={class:"flex items-center gap-3"},de={class:"space-y-6"},ue={key:0,class:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4"},_e={key:1,class:"rounded-[28px] border border-red-100 bg-red-50 px-6 py-10 text-center text-red-600"},me={class:"mt-3 text-sm font-bold"},ge={key:2,class:"rounded-[28px] border border-slate-200 bg-white px-6 py-14 text-center shadow-sm"},he={class:"mt-4 text-sm font-bold text-slate-500"},xe={class:"group overflow-hidden rounded-[24px] border border-slate-200/80 bg-white shadow-sm transition-all duration-300 hover:-translate-y-1 hover:shadow-[0_24px_60px_-36px_rgba(15,23,42,0.5)]"},fe={key:1,class:"flex h-full w-full items-center justify-center bg-slate-100 text-slate-300"},be={class:"absolute left-3 top-3 rounded-full bg-black/55 px-2.5 py-1 text-[10px] font-black text-white backdrop-blur"},ve={class:"space-y-4 p-4"},ye={class:"space-y-2"},we={class:"line-clamp-2 text-base font-black leading-6 text-slate-950"},ke={class:"line-clamp-4 text-sm leading-6 text-slate-500"},ze={class:"flex items-center justify-between gap-3"},Te={class:"min-w-0 truncate text-xs font-bold text-slate-400"},Ie=["title","onClick"],Me={key:0,class:"inline-flex items-center justify-center gap-2 rounded-2xl border border-slate-200 bg-white px-5 py-3 text-sm font-bold text-slate-500 shadow-sm"},je={key:2,class:"text-sm font-bold text-slate-400"},Ce={class:"mx-auto flex h-full max-w-6xl flex-col overflow-hidden rounded-[28px] bg-white shadow-[0_40px_100px_-40px_rgba(15,23,42,0.65)] lg:flex-row"},Pe={class:"relative flex min-h-[38vh] flex-1 items-center justify-center bg-slate-100 p-4 lg:min-h-0 lg:p-8"},Ge={key:1,class:"flex size-32 items-center justify-center rounded-[24px] bg-white text-slate-300"},Se={class:"flex max-h-[62vh] w-full flex-col border-t border-slate-200 bg-white lg:max-h-none lg:w-[420px] lg:border-l lg:border-t-0"},Ue={class:"flex items-center justify-between gap-3 border-b border-slate-100 p-5"},$e={class:"min-w-0"},We={class:"mb-2 flex items-center gap-2"},Re={class:"rounded-full bg-slate-900 px-2.5 py-1 text-[10px] font-black text-white"},Le={key:0,class:"truncate text-xs font-bold text-slate-400"},Ne={class:"line-clamp-2 text-xl font-black leading-7 text-slate-950"},Ae={class:"min-h-0 flex-1 space-y-6 overflow-y-auto p-5"},Be={key:0,class:"space-y-3"},He={class:"text-[11px] font-black uppercase text-slate-400"},Ve={class:"flex gap-2 overflow-x-auto pb-1"},Fe=["src"],Oe={class:"space-y-3"},De={class:"flex items-center justify-between gap-3"},Ee={class:"text-[11px] font-black uppercase text-slate-400"},Je={class:"rounded-[20px] bg-slate-950 p-4 text-sm leading-7 text-slate-200"},Ke={class:"whitespace-pre-wrap break-words font-mono"},Xe=["href"],Ye={class:"flex shrink-0 gap-3 border-t border-slate-100 p-5"},qe="gpt-image-2-prompts",Qe="text-to-image,image-to-image",A=30,it=K({__name:"gpt-image-2-prompts",setup(Ze){const{t:s}=X(),B=Y(),H=q(),m=u([]),a=u(null),y=u(!1),w=u(!1),k=u(""),g=u(""),P=u(1),T=u(!0),I=u(null);let z=null;f(()=>[{value:"GPT Image 2",label:s("topics.gpt_image_2_prompts.stats.model")},{value:String(m.value.length),label:s("topics.gpt_image_2_prompts.stats.loaded")},{value:"TXT2IMG + IMG2IMG",label:s("topics.gpt_image_2_prompts.stats.types")}]);const V=t=>{if(!t)return[];try{const r=JSON.parse(t);return Array.isArray(r)?r:[]}catch{return[]}},F=t=>({id:String(t.id),key:t.key,title:t.title||"",prompt:t.prompt||"",type:t.prompt_type,imageUrl:t.head_image||"",imageWidth:t.head_image_width,imageHeight:t.head_image_height,description:t.description||t.title||"",inputResources:V(t.input_resource),author:t.author,sourceUrl:t.source_url}),M=async(t=1,r=!1)=>{try{t===1?y.value=!0:w.value=!0,k.value="";const n=await se({p:t,page_size:A,campaign:qe,types:Qe}),h=Array.isArray(n.items)?n.items.map(C=>F(C)):[];m.value=r?[...m.value,...h]:h,T.value=h.length===A,P.value=t}catch(n){console.error("Failed to load GPT Image 2 prompts:",n),k.value=s("topics.gpt_image_2_prompts.error")}finally{y.value=!1,w.value=!1}},G=async()=>{!T.value||y.value||w.value||await M(P.value+1,!0)},O=()=>{typeof window>"u"||!I.value||(z?.disconnect(),z=new IntersectionObserver(t=>{t.some(r=>r.isIntersecting)&&G()},{rootMargin:"720px 0px",threshold:0}),z.observe(I.value))},S=t=>t.type==="image-to-image"?"IMG2IMG":"TXT2IMG",D=t=>t.imageWidth&&t.imageHeight?`${t.imageWidth} / ${t.imageHeight}`:t.type==="image-to-image"?"1 / 1":"4 / 5",U=async t=>{if(t.prompt)try{await navigator.clipboard.writeText(t.prompt),g.value=t.id,setTimeout(()=>{g.value===t.id&&(g.value="")},1600)}catch(r){console.error("Failed to copy prompt:",r)}},E=t=>{a.value=t},j=()=>{a.value=null},J=async t=>{const r=t.key||t.id;await H.push(B(`/studio/image/inspiration/${r}`))};return Q(async()=>{await M(),await Z(),O()}),ee(()=>{z?.disconnect()}),te({title:f(()=>s("topics.gpt_image_2_prompts.seo_title")),description:f(()=>
1s("topics.gpt_image_2_prompts.seo_desc")),ogTitle:f(()=>s("topics.gpt_image_2_prompts.seo_title")),ogDescription:f(()=>s("topics.gpt_image_2_prompts.seo_desc")),twitterCard:"summary_large_image"}),(t,r)=>{const n=oe,h=ie,C=re;return l(),b(C,{title:c(s)("topics.gpt_image_2_prompts.title"),subtitle:c(s)("topics.gpt_image_2_prompts.hero.subtitle"),"max-content-width":"max-w-[1600px]","content-padding":"px-4 sm:px-6 lg:px-8 py-8"},{"header-extra":_(()=>[d(h,{to:t.$localePath("/topics"),class:"inline-flex items-center gap-2 rounded-full border border-slate-200 bg-white/80 px-4 py-2 text-sm font-bold text-slate-600 shadow-sm transition-colors hover:border-slate-300 hover:text-slate-950"},{default:_(()=>[d(n,{name:"lucide:arrow-left",class:"size-4"}),x(" "+o(c(s)("topics.back_to_topics")),1)]),_:1},8,["to"])]),title:_(()=>[e("span",ce,[e("span",null,o(c(s)("topics.gpt_image_2_prompts.hero.title")),1)])]),"header-bottom":_(()=>[e("div",pe,[d(h,{to:t.$localePath("/studio/image"),class:"inline-flex items-center gap-2 rounded-full bg-slate-900 px-5 py-2.5 text-sm font-bold text-white transition-transform hover:bg-slate-800"},{default:_(()=>[d(n,{name:"lucide:sparkles",class:"size-4"}),x(" "+o(c(s)("topics.gpt_image_2_prompts.create_free")),1)]),_:1},8,["to"])])]),default:_(()=>[e("section",de,[y.value?(l(),p("div",ue,[(l(),p(W,null,R(8,i=>e("div",{key:i,class:"rounded-[24px] border border-slate-200 bg-white p-3 shadow-sm"},[...r[3]||(r[3]=[e("div",{class:"aspect-[4/5] rounded-[18px] bg-slate-200 animate-pulse"},null,-1),e("div",{class:"mt-4 h-4 w-2/3 rounded bg-slate-200 animate-pulse"},null,-1),e("div",{class:"mt-3 h-3 w-full rounded bg-slate-100 animate-pulse"},null,-1),e("div",{class:"mt-2 h-3 w-4/5 rounded bg-slate-100 animate-pulse"},null,-1)])])),64))])):k.value?(l(),p("div",_e,[d(n,{name:"lucide:server-crash",class:"mx-auto size-9"}),e("p",me,o(k.value),1),e("button",{class:"mt-4 rounded-xl bg-red-600 px-4 py-2 text-sm font-bold text-white",onClick:r[0]||(r[0]=i=>M(1,!1))},o(c(s)("topics.gpt_image_2_prompts.retry")),1)])):m.value.length===0?(l(),p("div",ge,[d(n,{name:"lucide:image",class:"mx-auto size-10 text-slate-300"}),e("p",he,o(c(s)("topics.gpt_image_2_prompts.empty")),1)])):(l(),b(ne,{key:3,items:m.value,"min-column-width":260,gap:18,"max-columns":5,onItemClick:E},{default:_(({item:i})=>[e("article",xe,[e("div",{class:"relative overflow-hidden bg-slate-100",style:ae({aspectRatio:D(i)})},[i.imageUrl?(l(),b(N,{key:0,src:i.imageUrl,alt:i.title,width:i.imageWidth,height:i.imageHeight,class:"block h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"},null,8,["src","alt","width","height"])):(l(),p("div",fe,[d(n,{name:"lucide:image",class:"size-8"})])),e("div",be,o(S(i)),1)],4),e("div",ve,[e("div",ye,[e("h3",we,o(i.title),1),e("p",ke,o(i.prompt),1)]),e("div",ze,[e("span",Te,o(i.author?`@${i.author}`:"WisGate"),1),e("button",{class:"flex size-9 shrink-0 items-center justify-center rounded-full bg-slate-100 text-slate-600 transition-colors hover:bg-slate-900 hover:text-white",title:c(s)("topics.gpt_image_2_prompts.copy"),onClick:L($=>U(i),["stop"])},[d(n,{name:g.value===i.id?"lucide:check":"lucide:copy",class:"size-4"},null,8,["name"])],8,Ie)])])])]),_:1},8,["items"])),m.value.length>0?(l(),p("div",{key:4,ref_key:"loadMoreSentinel",ref:I,class:"flex justify-center py-8"},[w.value?(l(),p("div",Me,[d(n,{name:"lucide:loader-2",class:"size-4 animate-spin"}),x(" "+o(c(s)("topics.gpt_image_2_prompts.load_more")),1)])):T.value?(l(),p("button",{key:1,class:"inline-flex items-center justify-center gap-2 rounded-2xl bg-slate-900 px-5 py-3 text-sm font-bold text-white shadow-[0_16px_36px_-24px_rgba(15,23,42,0.9)] transition-colors hover:bg-slate-800 disabled:cursor-not-allowed disabled:bg-slate-300",onClick:G},[d(n,{name:"lucide:chevrons-down",class:"size-4"}),e("span",null,o(c(s)("topics.gpt_image_2_prompts.load_more")),1)])):(l(),p("div",je,o(c(s)("topics.gpt_image_2_prompts.no_more")),1))],512)):v("",!0)]),(l(),b(le,{to:"body"},[a.value?(l(),p("div",{key:0,class:"fixed inset-0 z-[80] bg-slate-950/55 p-3 backdrop-blur-sm sm:p-6",onClick:L(j,["self"])},[e("div",Ce,[e("div",Pe,[e("button",{class:"absolute right-4 top-4 z-10 flex size-10 items-center justify-center rounded-full bg-white/90 text-slate-700 shadow-sm backdrop-blur transition-colors hover:bg-white hover:text-slate-950 lg:hidden",onClick:j},[d(n,{name:"lucide:x",class:"size-4"})]),a.value.imageUrl?(l(),b(N,{key:0,src:a.value.imageUrl,alt:a.value.title,width:a.value.imageWidth,height:a.value.imageHeight,class:"max-h-full max-w-full rounded-[20px] object-contain shadow-[0_24px_80px_-42px_rgba(15,23,42,0.8)]"},null,8,["src","alt","width","height"])):(l(),p("div",Ge,[d(n,{name:"lucide:image",class:"size-10"})]))]),e("aside",Se,[e("div",Ue,[e("div",$e,[e("div",We,[e("span",Re,o(S(a.value)),1),a.value.author?(l(),p("span",Le," @"+o(a.value.author),1)):v("",!0)]),e("h3",Ne,o(a.value.title),
11)]),e("button",{class:"hidden size-10 shrink-0 items-center justify-center rounded-full bg-slate-100 text-slate-600 transition-colors hover:bg-slate-200 lg:flex",onClick:j},[d(n,{name:"lucide:x",class:"size-4"})])]),e("div",Ae,[a.value.inputResources?.length?(l(),p("div",Be,[e("div",He,o(c(s)("topics.gpt_image_2_prompts.detail.input_resources")),1),e("div",Ve,[(l(!0),p(W,null,R(a.value.inputResources,(i,$)=>(l(),p("img",{key:$,src:i,class:"size-16 shrink-0 rounded-2xl border border-slate-200 object-cover",alt:""},null,8,Fe))),128))])])):v("",!0),e("div",Oe,[e("div",De,[e("div",Ee,o(c(s)("topics.gpt_image_2_prompts.detail.prompt")),1),e("button",{class:"inline-flex items-center gap-1.5 rounded-full bg-slate-100 px-3 py-1.5 text-xs font-bold text-slate-700 transition-colors hover:bg-slate-200",onClick:r[1]||(r[1]=i=>U(a.value))},[d(n,{name:g.value===a.value.id?"lucide:check":"lucide:copy",class:"size-3.5"},null,8,["name"]),x(" "+o(g.value===a.value.id?c(s)("topics.gpt_image_2_prompts.copied"):c(s)("topics.gpt_image_2_prompts.copy")),1)])]),e("div",Je,[e("pre",Ke,o(a.value.prompt),1)])]),a.value.sourceUrl?(l(),p("a",{key:1,href:a.value.sourceUrl,target:"_blank",class:"inline-flex items-center gap-2 text-sm font-bold text-slate-500 transition-colors hover:text-slate-950"},[x(o(c(s)("topics.gpt_image_2_prompts.detail.source"))+" ",1),d(n,{name:"lucide:external-link",class:"size-4"})],8,Xe)):v("",!0)]),e("div",Ye,[e("button",{class:"flex flex-1 items-center justify-center gap-2 rounded-2xl bg-slate-900 px-4 py-3 text-sm font-bold text-white transition-colors hover:bg-slate-800",onClick:r[2]||(r[2]=i=>J(a.value))},[d(n,{name:"lucide:sparkles",class:"size-4"}),x(" "+o(c(s)("topics.gpt_image_2_prompts.detail.use")),1)])])])])])):v("",!0)]))]),_:1},8,["title","subtitle"])}}});export{it 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.