PageSourceSearch

https://bullionmarketcap.com/assets/CoverGenerator-BqFvTjuX.js

js bullionmarketcap.com collected 2026-10-07 19:13:09 UTC 7,575 bytes, 1 lines download raw bytes

1import{k as n,j as t,_ as z}from"./main-CMUma0Uu.js";const R=[{value:"explorer",label:"Explorer",desc:"Solo male — analysis, contemplative"},{value:"navigator",label:"Navigator",desc:"Solo female — discovery, deep dives"},{value:"both",label:"Duo",desc:"Both — debates, comparisons"}],H=["Standing on a sunlit hilltop overlooking a vast open-pit gold mine at sunrise, two paths diverging ahead","In a warm wood-paneled study examining old market charts and gold coins on an oak desk, morning light streaming in","At the entrance of a grand vault with stacks of gold bars glowing inside, soft amber light","On a balcony overlooking a bustling historical gold trading marketplace at golden hour","At a crossroads in a golden wheat field, one path leading toward distant snowy mountains","In an old library discovering an ancient nautical map with gold-mining routes inked across it","Climbing a rocky ridge above a misty valley, a glinting silver river winding far below","Crossing a wooden suspension bridge over a canyon at dawn, eagle soaring overhead","Sitting on the rim of a stone fountain in a sunlit plaza, gold-trimmed buildings around","Walking through tall pine forest at dawn, sunbeams catching in the mist, hint of gold leaves on the floor"];function W({slug:T,onPick:A,title:g,excerpt:G,content:m,tags:O}){const[b,P]=n.useState(!1),[o,B]=n.useState("explorer"),[i,I]=n.useState([]),[l,D]=n.useState(""),[f,v]=n.useState(!1),[y,j]=n.useState([]),[N,d]=n.useState(null),[S,w]=n.useState(null),[c,_]=n.useState([]),[k,C]=n.useState(!1),[x,p]=n.useState(null),u=!!(g&&g.trim()||m&&m.trim());function E(e){I(s=>s.includes(e)?s.filter(r=>r!==e):s.length>=4?s:[...s,e])}async function J(){if(u){p(null),C(!0);try{const e=await fetch("/api/admin/suggest-scenes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:g??"",excerpt:G??"",content:m??"",tags:O??[],character:o,count:5})}),s=await e.json();if(!e.ok||!s.scenes){p(s.error||"Suggestion failed");return}_(s.scenes)}catch{p("Network error during suggestion")}finally{C(!1)}}}async function U(){const e=[...i];if(l.trim()&&e.push(l.trim()),e.length===0){d("Pick at least one scene or write a custom one.");return}d(null),j([]),v(!0);try{const s=o==="both"?["explorer","navigator"]:[o],r=await fetch("/api/admin/generate-cover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenes:e.slice(0,4),characters:s,slug:T})}),h=await r.json();if(!r.ok||!h.images){d(h.error||"Generation failed");return}j(h.images)}catch{d("Network error during generation")}finally{v(!1)}}function q(e){A(e),w(e),setTimeout(()=>w(null),2e3)}const a=i.length+(l.trim()?1:0),$=R.find(e=>e.value===o)?.desc;return t.jsxs("div",{className:"rounded-lg border bg-card overflow-hidden",children:[t.jsxs("button",{type:"button",onClick:()=>P(e=>!e),className:"flex w-full items-center justify-between px-4 py-3 hover:bg-muted/50 transition-colors",children:[t.jsx("h2",{className:"text-sm font-semibold",children:"✨ Cover generator"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:b?"−":"+"})]}),b&&t.jsxs("div",{className:"border-t px-4 pb-4 pt-3 space-y-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:"Recurring character"}),t.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:R.map(e=>t.jsx("button",{type:"button",onClick:()=>B(e.value),className:`rounded-md border px-2 py-2 text-center text-[11px] transition-colors ${o===e.value?"border-amber-500/60 bg-amber-500/10 text-amber-600 dark:text-amber-400":"border-input hover:bg-muted text-muted-foreground"}`,children:t.jsx("div",{className:"font-semibold",children:e.label})},e.value))}),$&&t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:$})]}),t.jsxs("div",{children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:["Scenes (",a,"/4)"]}),t.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto pr-1",children:H.map(e=>{const s=i.includes(e),r=!s&&a>=4;return t.jsxs("button",{type:"button",onClick:()=>E(e),disabled:r,className:`flex w-full items-start gap-2 rounded-md border px-2 py-1.5 text-left text-[11px] leading-tight transition-colors ${s?"border-amber-500/60 bg-amber-500/10 text-foreground":"border-input text-muted-foreground hover:bg-muted disabled:opacity-40"}`,children:[t.jsx("span",{className:"mt-0.5",children:s?"✓":"·"}),t.jsx("span",{className:"flex-1",children:e})]},e)})})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"✨ Suggested from this article"}),t.jsx("button",{type:"button",onClick:J,disabled:!u||k,className:"rounded-md border border-input px-2 py-0.5 text-[10px] font-medium text-muted-foreground hover:bg-muted disabled:opacity-40",title:u?"Generate scene ideas based on the current draft":"Save some content first",children:k?"Thinking…":c.length>0?"Regenerate":"Suggest"})]}),x&&t.jsx("p",{className:"mb-1.5 rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1 text-[10px] text-destructive",children:x}),c.length===0&&!x&&t.jsx("p",{className:"text-[10px] text-muted-foreground italic mb-1.5",children:u?"Click Suggest to pull 5 sce
1ne ideas tailored to the draft.":"Save a title or some content first, then click Suggest."}),c.length>0&&t.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto pr-1",children:c.map(e=>{const s=i.includes(e),r=!s&&a>=4;return t.jsxs("button",{type:"button",onClick:()=>E(e),disabled:r,className:`flex w-full items-start gap-2 rounded-md border px-2 py-1.5 text-left text-[11px] leading-tight transition-colors ${s?"border-amber-500/60 bg-amber-500/10 text-foreground":"border-input text-muted-foreground hover:bg-muted disabled:opacity-40"}`,children:[t.jsx("span",{className:"mt-0.5",children:s?"✓":"✨"}),t.jsx("span",{className:"flex-1",children:e})]},e)})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Custom scene (optional)"}),t.jsx("textarea",{value:l,onChange:e=>D(e.target.value),rows:2,placeholder:"Describe a unique scene…",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-xs"})]}),t.jsx(z,{onClick:U,disabled:f||a===0,className:"w-full",children:f?`Generating ${a} image${a>1?"s":""}…`:`Generate ${a||""} cover${a===1?"":"s"}`}),N&&t.jsx("p",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:N}),y.length>0&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Click an image to use as cover"}),t.jsx("div",{className:"grid grid-cols-2 gap-2",children:y.map(e=>t.jsxs("button",{type:"button",onClick:()=>q(e.url),className:`group relative overflow-hidden rounded-md border transition-all ${S===e.url?"border-green-500 ring-2 ring-green-500/40":"border-input hover:border-amber-500/60"}`,title:e.scene,children:[t.jsx("img",{src:e.url,alt:e.scene,className:"w-full h-auto aspect-video object-cover"}),S===e.url&&t.jsx("span",{className:"absolute inset-x-0 bottom-0 bg-green-500/90 py-1 text-center text-[10px] font-semibold text-white",children:"✓ Applied"})]},e.url))})]}),t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Powered by Imagen 4 via Google. Each image ~$0.03. Same recurring character across all generated scenes."})]})]})}export{W 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.