PageSourceSearch

https://psywar.ai/assets/StudioPlanning-BHWN-hYP.js

js psywar.ai collected 2026-10-05 14:01:10 UTC 46,536 bytes, 59 lines download raw bytes

1import{r as b,j as t,bK as Y,a2 as j,M as R,at as G,aj as O,X as J,F as M,al as P,I as A,q as $,ar as V,a0 as W,aS as U,ad as D,n as C,Z as q,Y as X,aH as Z,w as Q}from"./react-vendor-DBDodRiA.js";import{j as S}from"./index-Bj2_i3b1.js";import{a as g,s as ee,V as te,t as L,B as K,M as ne,b as ie}from"./StudioEditor-BJ0MkoNb.js";import"./socket-vendor-C9Ahsz4C.js";import"./ui-vendor-CMMvbYmQ.js";import"./studioStore-CrFG3q3Y.js";import"./audioMixer-B759iu1v.js";import"./glEffects-sTzzT5IO.js";import"./compositorPlayer-B0ABYjXH.js";import"./beatDetection-CiDdlIJK.js";import"./index-C16mZ9dP.js";import"./exportPresets-CocP9LVg.js";import"./dissectorBlueprintIDB-BO-9Rsth.js";const e={bg:"#050110",panel:"rgba(12, 6, 24, 0.72)",panelElev:"rgba(18, 9, 32, 0.78)",surface:"rgba(23, 13, 38, 0.85)",hair:"rgba(255,255,255,0.04)",line:"rgba(255,255,255,0.08)",text:"#f5eefb",textDim:"#b4acc0",textMuted:"#7a7388",textFaint:"#4f4a5e",dopamine:"#cc00ff",dopamineHi:"#f472ff",oxytocin:"#00ddff",oxytocinHi:"#7eecff",serotonin:"#ff66aa",serotoninHi:"#ff9ac6",norepinephrine:"#ffaa00",cortisol:"#ff3366",brand:"#e879f9",brandHi:"#f5d0fe",brandSoft:"rgba(204,0,255,0.10)",brandLine:"rgba(204,0,255,0.32)",ok:"#00ff99",warn:"#ffaa00",bad:"#ff3366",mono:"'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace",ui:"Georgia, 'Inter, system-ui, sans-serif', 'Palatino Linotype', 'Book Antiqua', Palatino, serif"},oe=`
2  @keyframes psywar-breathe {
3    0%, 100% { box-shadow: 0 0 0 0 rgba(232,121,249,0.45), 0 0 16px 2px rgba(204,0,255,0.12); }
4    50%      { box-shadow: 0 0 0 6px rgba(232,121,249,0.06), 0 0 32px 8px rgba(204,0,255,0.40); }
5  }
6  @keyframes psywar-synapse {
7    0%,100% { opacity: 0.55; transform: scale(1); }
8    50%     { opacity: 1; transform: scale(1.4); }
9  }
10  @keyframes psywar-shimmer {
11    0%   { background-position: -200% 0; }
12    100% { background-position:  200% 0; }
13  }
14  @keyframes psywar-halo {
15    0%,100% { box-shadow: 0 0 0 1px rgba(232,121,249,0.35), 0 0 28px 2px rgba(204,0,255,0.12), 0 0 48px 6px rgba(0,221,255,0.04); }
16    50%     { box-shadow: 0 0 0 1px rgba(232,121,249,0.55), 0 0 48px 10px rgba(204,0,255,0.32), 0 0 80px 18px rgba(0,221,255,0.08); }
17  }
18  @keyframes psywar-dendrite {
19    0%,100% { opacity: 0.35; }
20    50%     { opacity: 0.85; }
21  }
22  @keyframes psywar-fadein {
23    from { opacity: 0; transform: translateY(4px); }
24    to   { opacity: 1; transform: translateY(0); }
25  }
26  @keyframes psywar-border-flow {
27    0%   { background-position: 0% 0%; }
28    100% { background-position: 300% 0%; }
29  }
30  @keyframes psywar-neural-pulse {
31    0%,100% { opacity: 0.35; filter: brightness(1.0); }
32    50%     { opacity: 0.75; filter: brightness(1.6); }
33  }
34  @keyframes psywar-neural-pulse-fast {
35    0%,100% { opacity: 0.55; filter: brightness(1.2); }
36    50%     { opacity: 1;    filter: brightness(2.1); }
37  }
38  @keyframes psywar-drift {
39    0%   { transform: translate3d(0,0,0); }
40    50%  { transform: translate3d(12px,-8px,0); }
41    100% { transform: translate3d(0,0,0); }
42  }
43  @keyframes psywar-score-fill {
44    from { transform: scaleX(0); }
45    to   { transform: scaleX(1); }
46  }
47  .psywar-border-flow {
48    background-image: linear-gradient(90deg,
49      rgba(204,0,255,0) 0%,
50      rgba(204,0,255,0.55) 18%,
51      rgba(232,121,249,0.70) 32%,
52      rgba(0,221,255,0.55) 50%,
53      rgba(232,121,249,0.70) 68%,
54      rgba(204,0,255,0.55) 82%,
55      rgba(204,0,255,0) 100%);
56    background-size: 300% 100%;
57    animation: psywar-border-flow 3.2s linear infinite;
58  }
59`,se={retention:"#00ddff",emotion:"#ff66aa",dopamine:"#cc00ff",oxytocin:"#00ddff",cvr:"#ffaa00",upsell:"#ff66aa"},ae={retention:{label:"Retention",tagline:"Keep them watching"},emotion:{label:"Emotion",tagline:"Felt, not thought"},dopamine:{label:"Dopamine",tagline:"Anticipation & reveal"},oxytocin:{label:"Oxytocin",tagline:"Trust & tribe"},cvr:{label:"Conversion",tagline:"Close the sale"},upsell:{label:"Upsell",tagline:"Stack the cart"}};function De(){const n=g(d=>d.brief),o=g(d=>d.updateBrief),i=g(d=>d.currentRun),r=g(d=>d.startRun),a=g(d=>d.cancelRun),[s,x]=b.useState(3),[l,c]=b.useState(7.5),[u,p]=b.useState("forge"),m=!!i?.phase&&i.phase!=="done"&&i.phase!=="error",h=!m&&n.creativeAngle.trim().length>10,f=async()=>{try{await r(s,l)}catch(d){S.error("Forge failed",{description:d.message})}};return t.jsxs("div",{className:"w-full h-full flex relative",style:{background:e.bg,fontFamily:e.ui,color:e.text},children:[t.jsx("style",{children:oe}),t.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:0,background:"radial-gradient(1100px 540px at 88% -6%, rgba(204,0,255,0.08), transparent 60%), radial-gradient(860px 480px at -6% 108%, rgba(0,221,255,0.05), transparent 60%), radial-gradient(700px 420px at 50% 50%, rgba(255,102,170,0.03), transparent 65%)"}}),t.jsx(Se,{}),t.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:0,backgroundImage:"repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px)",mixBlendMode:"overlay"}}),t.jsxs("div",{className:"overflow-y-auto flex-shrink-0 relative",style:{width:"40%",minWidth:440,maxWidth:580,borderRight:`1px solid ${e.line}`,background:e.panel,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",zIndex:1},children:[t.jsx(we,{title:"Brief",subtitle:ee(n),right:t.jsx(re,{disabled:!h,running:m,onClick:f})}),t.jsxs(y,{title:"Creative angle",note:"The hook, promise, or mechanism in one sentence.",children:[t.jsx("textarea",{value:n.creativeAngle,onChange:d=>o({creativeAngle:d.target.value}),placeholder:"The 3-minute morning ritual that reversed my sleep debt without caffeine or melatonin, discovered by accident during a military deployment.",rows:3,maxLength:500,style:{width:"100%",padding:"10px 12px",fontSize:13.5,lineHeight:1.55,color:e.text,background:e.surface,border:`1px solid ${e.line}`,borderRadius:3,outline:"none",resize:"vertical",fontFamily:e.ui}}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-2",children:[t.jsx(F,{label:"Niche",children:t.jsx("input",{value:n.niche,onChange:d=>o({niche:d.target.value}),placeholder:"sleep optimization",style:z})}),t.jsx(F,{label:"Core offer",children:t.jsx("input",{value:n.offer,onChange:d=>
59o({offer:d.target.value}),placeholder:"$97 course + coaching",style:z})})]})]}),t.jsx(y,{title:"VSL type",note:"Shapes the default booster set.",children:t.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:te.map(d=>t.jsx(T,{active:n.vslType===d.id,label:d.label,note:d.note,onClick:()=>{if(o({vslType:d.id}),L(n.boosters)===0&&d.recommendedBoosters){const k={...n.boosters};for(const[N,H]of Object.entries(d.recommendedBoosters))k[N]=H;o({boosters:k}),S.success(`${d.label} defaults applied`)}}},d.id))})}),t.jsx(y,{title:"Pace",note:"DR weight ↔ Story weight.",children:t.jsx(le,{value:n.pace,onChange:d=>o({pace:d})})}),t.jsx(y,{title:"Editing style",children:t.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:[{id:"normal",label:"Normal",note:"Standard cuts, 2–4s shots"},{id:"hybrid",label:"Hybrid",note:"Mixed cadence, selective zooms"},{id:"edit-like",label:"Edit-Like",note:"Hyper-cut, text stabs, whips"}].map(d=>t.jsx(T,{active:n.editingStyle===d.id,label:d.label,note:d.note,onClick:()=>o({editingStyle:d.id})},d.id))})}),t.jsx(y,{title:"Reference VSLs",note:n.referenceVSLs.length?`${n.referenceVSLs.length} uploaded`:"Upload clips to anchor the forge aesthetic.",children:t.jsx(de,{})}),t.jsx(y,{title:"Music & theme",children:t.jsx(ce,{})}),t.jsx(y,{title:"Boosters",note:`${L(n.boosters)} selected, be surgical; too many breaks the VSL.`,children:t.jsx("div",{className:"flex flex-col gap-1.5",children:Object.keys(K).map(d=>t.jsx(xe,{category:d},d))})}),t.jsx(y,{title:"Notes for Kimi",note:"Tone, banned words, must-haves.",children:t.jsx("textarea",{value:n.notes,onChange:d=>o({notes:d.target.value}),placeholder:"Must mention 20-year warranty. Avoid the word incredible. Founder is 52, speaks like a mechanic.",rows:3,style:{width:"100%",padding:"10px 12px",fontSize:13,lineHeight:1.55,color:e.text,background:e.surface,border:`1px solid ${e.line}`,borderRadius:3,outline:"none",resize:"vertical",fontFamily:e.ui}})}),t.jsx(y,{title:"Battle-test",note:`${s} candidates · pass ≥ ${l.toFixed(1)}/10`,children:t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(F,{label:`Candidates · ${s}`,children:t.jsx("input",{type:"range",min:1,max:5,step:1,value:s,onChange:d=>x(parseInt(d.target.value)),style:I(e.brand,s,1,5)})}),t.jsx(F,{label:`Pass threshold · ${l.toFixed(1)}`,children:t.jsx("input",{type:"range",min:5,max:9.5,step:.1,value:l,onChange:d=>c(parseFloat(d.target.value)),style:I(e.warn,l,5,9.5)})}),t.jsxs("p",{style:{fontSize:12,color:e.textMuted,lineHeight:1.55},children:["Candidates are scored by Kimi across six axes. If the best overall falls below the threshold, the pipeline triggers a targeted ",t.jsx("em",{style:{color:e.textDim},children:"re-forge"}),"."]})]})}),t.jsx("div",{style:{height:32}})]}),t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative",style:{zIndex:1,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[t.jsxs("div",{className:"flex items-center justify-between px-5",style:{height:52,borderBottom:`1px solid ${e.line}`,background:e.panel,flexShrink:0},children:[t.jsx("div",{className:"flex items-center gap-5",children:[{id:"forge",label:"Forge"},{id:"history",label:"History"}].map(d=>{const v=u===d.id;return t.jsxs("button",{onClick:()=>p(d.id),className:"relative cursor-pointer focus-visible:outline-none",style:{padding:"16px 0",fontSize:13.5,fontWeight:400,color:v?e.text:e.textMuted,background:"transparent",border:"none",fontFamily:e.ui},children:[d.label,v&&t.jsx("span",{"aria-hidden":!0,style:{position:"absolute",left:0,right:0,bottom:0,height:1.5,background:e.brand}})]},d.id)})}),m&&t.jsxs("button",{onClick:a,className:"flex items-center gap-1.5 cursor-pointer focus-visible:outline-none",style:{padding:"6px 12px",fontSize:11.5,color:e.bad,background:"transparent",border:`1px solid ${e.bad}40`,borderRadius:3,fontFamily:e.ui},children:[t.jsx(Y,{className:"w-2.5 h-2.5"}),"Cancel run"]})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",children:u==="forge"?t.jsx(pe,{}):t.jsx(ve,{})})]})]})}function re({disabled:n,running:o,onClick:i}){const r=!!o;return t.jsxs("button",{disabled:n,onClick:i,className:"relative flex items-center gap-2 cursor-pointer focus-visible:outline-none disabled:opacity-40 disabled:cursor-not-allowed transition-all group overflow-hidden",style:{padding:"10px 22px",fontSize:13.5,fontWeight:400,color:n?e.textMuted:r?e.brandHi:"#12002a",background:n?"transparent":r?"rgba(204,0,255,0.12)":"linear-gradient(135deg, #f472ff 0%, #cc00ff 60%, #00ddff 140%)",border:`1px solid ${n?e.line:r?e.dopamine:"transparent"}`,borderRadius:4,fontFamily:e.ui,letterSpacing:"-0.005em",boxShadow:n?"none":r?`0 0 0 1px ${e.dopamine}66, 0 0 24px -2px ${e.dopamine}66`:`0 6px 24px -6px ${e.dopamine}AA, 0 2px 10px -2px ${e.oxytocin}55, 0 0 0 1px rgba(255,255,255,0.10) inset`,animation:r?"psywar-breathe 2s ease-in-out infinite":void 0}
59,children:[!n&&!r&&t.jsx("span",{"aria-hidden":!0,className:"psywar-border-flow",style:{position:"absolute",inset:0,opacity:0,pointerEvents:"none",mixBlendMode:"overlay"}}),r?t.jsxs(t.Fragment,{children:[t.jsx(j,{className:"w-3.5 h-3.5 animate-spin"}),"Forging"]}):t.jsxs(t.Fragment,{children:[t.jsx(R,{className:"w-3.5 h-3.5"}),"Forge VSL"]})]})}function le({value:n,onChange:o}){const i=[{id:"dr-heavy",label:"DR Heavy",body:"Pattern break every 3–5s, proof stacks, rapid urgency, aggressive CTAs. Cortisol-dominant."},{id:"balanced",label:"Balanced",body:"Standard 8-phase arc. Story hooks into mechanism, proof gated to mid-roll."},{id:"story-heavy",label:"Story Heavy",body:"Long origin, metaphor stacks, slow reveal of mechanism, emotion-first. Oxytocin-dominant."}],r=i.find(a=>a.id===n)??i[1];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:i.map(a=>t.jsx(T,{active:n===a.id,label:a.label,note:"",onClick:()=>o(a.id)},a.id))}),t.jsx("p",{style:{fontSize:12,color:e.textMuted,lineHeight:1.55},children:r.body})]})}function T({active:n,label:o,note:i,onClick:r}){return t.jsxs("button",{onClick:r,className:"relative flex flex-col gap-0.5 text-left cursor-pointer focus-visible:outline-none transition-all overflow-hidden",style:{padding:"10px 12px",background:n?"rgba(204,0,255,0.10)":e.surface,border:`1px solid ${n?"transparent":e.line}`,borderRadius:4,fontFamily:e.ui,boxShadow:n?`0 0 0 1px ${e.dopamine}60, 0 6px 24px -6px ${e.dopamine}55, 0 0 0 1px rgba(0,221,255,0.10) inset`:"none"},children:[n&&t.jsx("span",{"aria-hidden":!0,className:"psywar-border-flow",style:{position:"absolute",left:0,top:0,height:1.5,width:"100%",opacity:.9}}),t.jsx("span",{style:{fontSize:13.5,fontWeight:400,color:n?e.brandHi:e.text,letterSpacing:"-0.005em",textShadow:n?`0 0 12px ${e.dopamine}55`:"none"},children:o}),i&&t.jsx("span",{style:{fontSize:11,color:e.textMuted,lineHeight:1.35},children:i})]})}function de(){const n=g(s=>s.brief),o=g(s=>s.addReferenceVSL),i=g(s=>s.removeReferenceVSL),r=b.useRef(null),a=b.useCallback(s=>{s&&(Array.from(s).forEach(x=>{const l={id:Math.random().toString(36).slice(2,10),name:x.name,size:x.size,blobUrl:URL.createObjectURL(x)};o(l)}),S.success(`${s.length} reference${s.length===1?"":"s"} added`))},[o]);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("button",{onClick:()=>r.current?.click(),onDragOver:s=>{s.preventDefault(),s.dataTransfer.dropEffect="copy"},onDrop:s=>{s.preventDefault(),a(s.dataTransfer.files)},className:"flex flex-col items-center justify-center gap-2 cursor-pointer focus-visible:outline-none",style:{padding:"22px 12px",background:e.surface,border:`1px dashed ${e.brandLine}`,fontSize:13,color:e.brand,borderRadius:3,fontFamily:e.ui},children:[t.jsx(G,{className:"w-4 h-4"}),t.jsx("span",{children:"Drop video files or click to upload"}),t.jsx("span",{style:{fontSize:11,color:e.textMuted,fontFamily:e.mono},children:".mp4 · .mov · .webm, up to 200MB"})]}),t.jsx("input",{ref:r,type:"file",accept:"video/*",multiple:!0,className:"hidden",onChange:s=>a(s.target.files)}),n.referenceVSLs.map(s=>t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",style:{background:e.panelElev,border:`1px solid ${e.line}`,borderRadius:3},children:[t.jsx(O,{className:"w-3.5 h-3.5",style:{color:e.brand,flexShrink:0}}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{style:{fontSize:12.5,color:e.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.name}),s.size!=null&&t.jsxs("div",{style:{fontSize:10.5,color:e.textFaint,fontFamily:e.mono},children:[(s.size/1024/1024).toFixed(1)," MB"]})]}),t.jsx("button",{onClick:()=>i(s.id),className:"cursor-pointer focus-visible:outline-none",style:{color:e.textMuted,background:"transparent",border:"none",padding:2},children:t.jsx(J,{className:"w-3.5 h-3.5"})})]},s.id))]})}function ce(){const n=g(r=>r.brief.music),o=g(r=>r.updateBrief),i=(r,a)=>{const s=n[r],x=s.includes(a)?s.filter(l=>l!==a):[...s,a];o({music:{...n,[r]:x}})};return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:11,color:e.textMuted,marginBottom:6},children:"Genres"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:ne.map(r=>
59t.jsx(_,{active:n.genres.includes(r),onClick:()=>i("genres",r),children:r},r))})]}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:11,color:e.textMuted,marginBottom:6},children:"Moods"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:ie.map(r=>t.jsx(_,{active:n.moods.includes(r),onClick:()=>i("moods",r),children:r},r))})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("select",{value:n.tempo,onChange:r=>o({music:{...n,tempo:r.target.value}}),style:{...z,flex:1},children:[t.jsx("option",{value:"",children:"Any tempo"}),t.jsx("option",{value:"slow",children:"Slow (60–90 BPM)"}),t.jsx("option",{value:"mid",children:"Mid (90–120 BPM)"}),t.jsx("option",{value:"fast",children:"Fast (120+ BPM)"})]}),t.jsx("input",{placeholder:"Reference tracks or artists",value:n.references.join(", "),onChange:r=>o({music:{...n,references:r.target.value.split(",").map(a=>a.trim()).filter(Boolean)}}),style:{...z,flex:2}})]})]})}function _({active:n,onClick:o,children:i}){return t.jsx("button",{onClick:o,className:"cursor-pointer focus-visible:outline-none transition-colors",style:{padding:"4px 10px",fontSize:12,color:n?e.brandHi:e.textDim,background:n?e.brandSoft:"transparent",border:`1px solid ${n?e.brandLine:e.line}`,borderRadius:999,fontFamily:e.ui},children:i})}function xe({category:n}){const o=g(p=>p.brief.boosters[n]),i=g(p=>p.updateBoosters),[r,a]=b.useState(o.length>0),s=ae[n],x=K[n],l=o.length>0,c=se[n]??e.dopamine,u=p=>{const m=o.includes(p)?o.filter(h=>h!==p):[...o,p];i(n,m)};return t.jsxs("div",{style:{background:e.panelElev,border:`1px solid ${l?c+"32":e.line}`,borderRadius:4,boxShadow:l?`0 0 0 1px ${c}12 inset, 0 0 22px -4px ${c}22`:"none",position:"relative",overflow:"hidden"},children:[t.jsx("div",{"aria-hidden":!0,style:{position:"absolute",left:0,top:10,bottom:10,width:2,background:l?`linear-gradient(180deg, transparent, ${c}, transparent)`:`linear-gradient(180deg, transparent, ${e.line}, transparent)`,animation:l?"psywar-neural-pulse 3s ease-in-out infinite":void 0}}),t.jsxs("button",{onClick:()=>a(!r),className:"w-full flex items-center gap-3 px-4 py-2.5 cursor-pointer focus-visible:outline-none",style:{background:"transparent",border:"none",fontFamily:e.ui},children:[t.jsx("span",{"aria-hidden":!0,className:"rounded-full flex-none",style:{width:8,height:8,background:c,boxShadow:l?`0 0 10px ${c}, 0 0 2px ${c}`:`0 0 0 1px ${c}
5980`,opacity:l?1:.55,animation:l?"psywar-synapse 2.2s ease-in-out infinite":void 0}}),t.jsxs("div",{className:"flex flex-col flex-1 text-left gap-0.5",children:[t.jsx("span",{style:{fontSize:13,fontWeight:400,color:l?e.text:e.textDim,letterSpacing:"-0.005em"},children:s.label}),t.jsx("span",{style:{fontSize:11,color:e.textMuted},children:s.tagline})]}),t.jsxs("span",{style:{fontSize:11,fontFamily:e.mono,fontVariantNumeric:"tabular-nums",color:l?c:e.textFaint,textShadow:l?`0 0 10px ${c}80`:"none"},children:[o.length,"/",x.length]}),r?t.jsx(M,{className:"w-3.5 h-3.5",style:{color:e.textMuted}}):t.jsx(P,{className:"w-3.5 h-3.5",style:{color:e.textMuted}})]}),r&&t.jsx("div",{className:"px-2 pb-2 flex flex-col gap-1",style:{borderTop:`1px solid ${e.hair}`,paddingTop:6},children:x.map((p,m)=>{const h=o.includes(p.id);return t.jsxs("button",{onClick:()=>u(p.id),className:"flex items-start gap-2.5 px-2.5 py-1.5 text-left cursor-pointer focus-visible:outline-none transition-all",style:{background:h?c+"10":"transparent",border:`1px solid ${h?c+"40":"transparent"}`,borderRadius:3,fontFamily:e.ui,animation:"psywar-fadein 0.3s ease-out both",animationDelay:`${m*30}ms`},children:[t.jsx("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:14,height:14,marginTop:2,background:h?c:"transparent",border:`1px solid ${h?c:e.line}`,borderRadius:2,color:e.bg,boxShadow:h?`0 0 10px ${c}80`:"none"},children:h&&t.jsx(A,{className:"w-2.5 h-2.5",strokeWidth:3})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{style:{fontSize:12.5,color:h?e.text:e.textDim,letterSpacing:"-0.003em"},children:p.label}),t.jsx("div",{style:{fontSize:11,color:e.textMuted,lineHeight:1.4},children:p.note})]}),t.jsx("span",{style:{fontSize:10,fontFamily:e.mono,color:h?c:e.textFaint,flexShrink:0,fontVariantNumeric:"tabular-nums"},children:p.weight.toFixed(2)})]},p.id)})})]})}function pe(){const n=g(a=>a.currentRun);if(!n)return t.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-8 text-center gap-5 relative",children:[t.jsxs("div",{className:"relative",style:{width:76,height:76},children:[t.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,borderRadius:"50%",background:`radial-gradient(circle, ${e.dopamine}44 0%, transparent 70%)`,animation:"psywar-neural-pulse 3s ease-in-out infinite"}}),t.jsxs("svg",{viewBox:"0 0 76 76",width:"76",height:"76",style:{position:"relative"},children:[t.jsx("line",{x1:"20",y1:"20",x2:"56",y2:"56",stroke:e.dopamine+"70",strokeWidth:"1",strokeDasharray:"2 3",children:t.jsx("animate",{attributeName:"stroke-dashoffset",from:"0",to:"-10",dur:"1.2s",repeatCount:"indefinite"})}),t.jsx("line",{x1:"56",y1:"20",x2:"20",y2:"56",stroke:e.oxytocin+"70",strokeWidth:"1",strokeDasharray:"2 3",children:t.jsx("animate",{attributeName:"stroke-dashoffset",from:"0",to:"10",dur:"1.6s",repeatCount:"indefinite"})}),t.jsx("line",{x1:"38",y1:"12",x2:"38",y2:"64",stroke:e.serotonin+"60",strokeWidth:"1",strokeDasharray:"2 3",children:t.jsx("animate",{attributeName:"stroke-dashoffset",from:"0",to:"-8",dur:"2s",repeatCount:"indefinite"})}),t.jsx("circle",{cx:"20",cy:"20",r:"4",fill:e.dopamine,children:t.jsx("animate",{attributeName:"r",values:"3.5;5;3.5",dur:"2.4s",repeatCount:"indefinite"})}),t.jsx("circle",{cx:"56",cy:"20",r:"4",fill:e.oxytocin,children:t.jsx("animate",{attributeName:"r",values:"3.5;5;3.5",dur:"2.8s",begin:"0.3s",repeatCount:"indefinite"})}),t.jsx("circle",{cx:"20",cy:"56",r:"4",fill:e.serotonin,children:t.jsx("animate",{attributeName:"r",values:"3.5;5;3.5",dur:"2.2s",begin:"0.6s",repeatCount:"indefinite"})}),t.jsx("circle",{cx:"56",cy:"56",r:"4",fill:e.norepinephrine,children:t.jsx("animate",{attributeName:"r",values:"3.5;5;3.5",dur:"2.6s",begin:"0.9s",repeatCount:"indefinite"})}),t.jsx("circle",{cx:"38",cy:"38",r:"5",fill:e.brand,children:t.jsx("animate",{attributeName:"r",values:"4.5;6.5;4.5",dur:"2s",repeatCount:"indefinite"})})]})]}),t.jsx("div",{style:{fontSize:24,fontWeight:400,color:e.text,fontFamily:e.ui,letterSpacing:"-0.015em"},children:"Battle-test forge"}),t.jsxs("div",{style:{fontSize:14,color:e.textDim,maxWidth:480,lineHeight:1.7,fontFamily:e.ui},children:["Fill in the brief on the left, then press ",t.jsx("span",{style:{color:e.brandHi,textShadow:`0 0 10px ${e.dopamine}80`},children:"Forge VSL"}),". The pipeline drafts several candidates, audits each against a six-axis rubric, and re-forges any that miss the threshold."]}),t.jsxs("div",{className:"flex items-center gap-6 mt-2",style:{fontSize:12,color:e.textMuted,fontFamily:e.ui},children:[t.jsx(E,{icon:$,label:"6-axis audit",tone:e.serotonin}),t.jsx(E,{icon:V,label:"Re-forge loop",tone:e.oxytocin}),t.jsx(E,{icon:W,label:"Winner to Studio",tone:e.dopamine})]})]});const o=[...n.candidates].filter(a=>a.audit).sort((a,s)=>s.audit.overall-a.audit.overall),i=o[0]?.audit?.overall??0,r=i>=n.threshold;return t.jsxs("div",{className:"p-5 flex flex-col gap-4",children:[t.jsx(fe,{run:n}
59),n.marketIntel&&t.jsx(je,{intel:n.marketIntel}),n.variants.length>0&&t.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2.5",style:{background:e.panelElev,border:`1px solid ${e.line}`,borderRadius:3},children:[t.jsx("span",{style:{fontSize:11,color:e.textMuted,fontFamily:e.ui},children:"Angle variants"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.variants.map((a,s)=>t.jsxs("span",{style:{padding:"3px 10px",fontSize:12,color:e.brandHi,background:e.brandSoft,border:`1px solid ${e.brandLine}`,borderRadius:3,fontFamily:e.ui},children:[s+1,". ",a]},s))})]}),n.phase==="done"&&o.length>0&&t.jsxs("div",{className:"flex items-center gap-3 px-3 py-3",style:{background:"transparent",border:`1px solid ${r?e.ok+"48":e.warn+"48"}`,borderRadius:3},children:[r?t.jsx(U,{className:"w-5 h-5",style:{color:e.ok}}):t.jsx(D,{className:"w-5 h-5",style:{color:e.warn}}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{style:{fontSize:13.5,fontWeight:400,color:r?e.ok:e.warn,fontFamily:e.ui},children:r?"Audit passed":"Best candidate below threshold"}),t.jsxs("div",{style:{fontSize:11.5,color:e.textDim,marginTop:2,fontFamily:e.ui},children:["Top ",t.jsxs("span",{style:{fontFamily:e.mono,color:e.text},children:[i.toFixed(2),"/10"]}),t.jsx("span",{style:{color:e.textFaint},children:" · threshold "}),t.jsx("span",{style:{fontFamily:e.mono},children:n.threshold.toFixed(1)}),t.jsxs("span",{style:{color:e.textFaint},children:[" · ",o.length," audited"]})]})]})]}),n.candidates.length===0&&n.phase!=="error"&&t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",style:{background:e.panelElev,border:`1px solid ${e.line}`,borderRadius:3},children:[t.jsx(j,{className:"w-3.5 h-3.5 animate-spin",style:{color:e.dopamineHi}}),t.jsxs("span",{style:{fontSize:12.5,color:e.textDim,fontFamily:e.ui},children:[n.phase==="research"&&"Researching niche psychology, objections, proof vectors…",n.phase==="angle_derive"&&"Deriving creative angle variations…",n.phase==="generating"&&"Drafting candidate VSLs in parallel…",(n.phase==="auditing"||n.phase==="reforging")&&"Chamber jury at work…",n.phase==="idle"&&"Starting pipeline…"]})]}),n.phase==="error"&&t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",style:{background:"transparent",border:`1px solid ${e.bad}48`,borderRadius:3},children:[t.jsx(C,{className:"w-3.5 h-3.5",style:{color:e.bad}}),t.jsx("span",{style:{fontSize:12.5,color:e.bad,fontFamily:e.ui},children:n.error??"Forge failed"})]}),t.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fit, minmax(360px, 1fr))"},children:n.candidates.map(a=>t.jsx(he,{candidate:a,isWinner:a.id===n.winnerId},a.id))})]})}function fe({run:n}){const o=[{id:"research",label:"Research"},{id:"angle_derive",label:"Derive"},{id:"generating",label:"Generate"},{id:"auditing",label:"Audit"},{id:"reforging",label:"Re-forge"},{id:"done",label:"Done"}],i=["idle","research","angle_derive","generating","auditing","reforging","done"],r=i.indexOf(n.phase),a=Math.max(0,Math.min(1,(r-1)/(o.length-1)))*100;return t.jsxs("div",{className:"relative",children:[t.jsx("div",{"aria-hidden":!0,style:{position:"absolute",left:0,right:0,bottom:-6,height:1,background:e.line,borderRadius:999}}),t.jsx("div",{"aria-hidden":!0,style:{position:"absolute",left:0,bottom:-6,height:1,width:`${a}%`,background:`linear-gradient(90deg, transparent, ${e.dopamineHi}, ${e.oxytocin})`,backgroundSize:"200% 100%",animation:n.phase!=="done"&&n.phase!=="error"?"psywar-shimmer 2.5s linear infinite":void 0,borderRadius:999,transition:"width 0.4s ease"}}),t.jsx("div",{className:"flex items-center gap-3",children:o.map(s=>{const x=i.indexOf(s.id),l=n.phase===s.id,c=r>x,u=l?e.brandHi:c?e.ok:e.textFaint;return t.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",style:{fontSize:12,fontFamily:e.ui,color:u},children:[l&&t.jsx(j,{className:"w-3 h-3 animate-spin flex-none"}),c&&!l&&t.jsx(A,{className:"w-3 h-3 flex-none"}),!l&&!c&&t.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-none",style:{background:e.line}}),t.jsx("span",{className:"truncate",style:l?{textShadow:"0 0 12px rgba(232,121,249,0.40)"}:void 0,children:s.label})]},s.id)})})]})}function he({candidate:n,isWinner:o}){const[i,r]=b.useState(o),a=n.audit,s=a&&n.script,x=n.status,l=a?a.overall>=7.5?e.ok:a.overall>=5.5?e.warn:e.bad:e.textFaint,c=()=>{try{navigator.clipboard.writeText(n.script),S.success("Script copied to clipboard",{description:"Paste into Studio script editor"})}catch{S.error("Copy failed")}};return t.jsxs("div",{className:"relative flex flex-col overflow-hidden",style:{background:e.panelElev,border:`1px solid ${o?"transparent":e.line}`,borderRadius:5,animation:o?"psywar-halo 3.5s ease-in-out infinite, psywar-fadein 0.4s ease-out both":"psywar-fadein 0.35s ease-out both"}
59,children:[o&&t.jsx("span",{"aria-hidden":!0,className:"psywar-border-flow",style:{position:"absolute",left:0,top:0,height:2,width:"100%",zIndex:1}}),t.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",style:{borderBottom:`1px solid ${e.hair}`},children:[o&&t.jsx(W,{className:"w-3.5 h-3.5 flex-none",style:{color:e.brand}}),t.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("span",{style:{fontSize:10.5,color:e.textFaint,fontFamily:e.mono},children:["#",n.index+1]}),t.jsx("span",{style:{fontSize:13,fontWeight:400,color:o?e.brandHi:e.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:e.ui},children:n.variant})]}),t.jsx(ue,{status:x})]}),a&&t.jsxs("div",{className:"flex items-baseline gap-0.5",children:[t.jsx("span",{style:{fontSize:22,fontWeight:500,color:l,fontFamily:e.mono,lineHeight:1},children:a.overall.toFixed(2)}),t.jsx("span",{style:{fontSize:10,color:e.textFaint,fontFamily:e.mono},children:"/10"})]})]}),a&&t.jsx("div",{className:"px-3.5 py-3",style:{borderBottom:`1px solid ${e.hair}`},children:t.jsx(me,{audit:a})}),a?.weaknesses?.length>0&&t.jsxs("div",{className:"px-3.5 py-2.5",style:{borderBottom:`1px solid ${e.hair}`},children:[t.jsx("div",{style:{fontSize:11,color:e.bad,marginBottom:4,fontFamily:e.ui},children:"Weaknesses"}),a.weaknesses.slice(0,3).map((u,p)=>t.jsxs("div",{style:{fontSize:12,color:e.textDim,lineHeight:1.55,fontFamily:e.ui},children:[", ",u]},p))]}),a?.strengths?.length>0&&t.jsxs("div",{className:"px-3.5 py-2.5",style:{borderBottom:`1px solid ${e.hair}`},children:[t.jsx("div",{style:{fontSize:11,color:e.ok,marginBottom:4,fontFamily:e.ui},children:"Strengths"}),a.strengths.slice(0,3).map((u,p)=>t.jsxs("div",{style:{fontSize:12,color:e.textDim,lineHeight:1.55,fontFamily:e.ui},children:[", ",u]},p))]}),a?.jury?.length>0&&t.jsx(ye,{jury:a.jury,synthesis:a.synthesis}),n.reforgeHistory?.length>0&&t.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-1.5",style:{fontSize:10.5,color:e.oxytocin,fontFamily:e.mono,borderBottom:`1px solid ${e.hair}`,background:e.oxytocin+"08",textShadow:`0 0 6px ${e.oxytocin}40`},children:[t.jsx(R,{className:"w-2.5 h-2.5"}),"reforged ×",n.reforgeHistory.length," ·"," ",n.reforgeHistory[0]?.audit?.overall!=null?`${n.reforgeHistory[0].audit.overall.toFixed(2)} → ${a?.overall?.toFixed(2)??","}`:"iterative lift"]}),n.script&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>r(!i),className:"flex items-center gap-2 px-3.5 py-2 cursor-pointer focus-visible:outline-none w-full text-left",style:{fontSize:12,color:e.textDim,background:"transparent",border:"none",fontFamily:e.ui},children:[i?t.jsx(M,{className:"w-3 h-3"}):t.jsx(P,{className:"w-3 h-3"}),i?"Hide script":"Show script",t.jsxs("span",{style:{color:e.textFaint,marginLeft:"auto",fontFamily:e.mono,fontSize:10.5},children:[n.script.length.toLocaleString()," chars"]})]}),i&&t.jsx("div",{className:"px-3.5 py-3 overflow-y-auto",style:{maxHeight:360,fontSize:12.5,lineHeight:1.7,fontFamily:e.mono,color:e.textDim,whiteSpace:"pre-wrap",borderTop:`1px solid ${e.hair}`},children:n.script})]}),s&&t.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",style:{background:e.panelElev,borderTop:`1px solid ${e.hair}`},children:[t.jsxs("button",{onClick:c,className:"flex items-center gap-1.5 cursor-pointer focus-visible:outline-none",style:{padding:"6px 12px",fontSize:12,fontWeight:400,color:o?e.bg:e.brandHi,background:o?e.brand:"transparent",border:`1px solid ${o?e.brand:e.brandLine}`,borderRadius:3,fontFamily:e.ui},children:[t.jsx(X,{className:"w-3 h-3"}),"Copy to Studio"]}),t.jsx(ge,{})]}),n.error&&t.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2",style:{background:"transparent",borderTop:`1px solid ${e.hair}`},children:[t.jsx(C,{className:"w-3 h-3",style:{color:e.bad,flexShrink:0}}),t.jsx("span",{style:{fontSize:12,color:e.bad,fontFamily:e.ui},children:n.error})]})]})}function ue({status:n}){const o={generating:{label:"Generating",color:e.brand,icon:j},auditing:{label:"Auditing",color:e.warn,icon:j},reforging:{label:"Re-forging",color:e.brandHi,icon:j},done:{label:"Done",color:e.ok,icon:A},error:{label:"Error",color:e.bad,icon:C}},i=o[n]??o.done,r=i.icon,a=n==="generating"||n==="auditing"||n==="reforging";return t.jsxs("div",{className:"flex items-center gap-1.5",style:{fontSize:11,color:i.color,fontFamily:e.ui},children:[t.jsx(r,{className:`w-2.5 h-2.5 ${a?"animate-spin":""}`}),i.label]})}function me({audit:n}){const o=[{key:"hook_strength",label:"Hook",tone:e.dopamine},{key:"belief_coverage",label:"Beliefs",tone:e.oxytocin},{key:"neurochem_balance",label:"Neurochem",tone:e.serotonin}
59,{key:"pace_coherence",label:"Pace",tone:e.norepinephrine},{key:"booster_fit",label:"Boosters",tone:e.dopamine},{key:"brief_fidelity",label:"Fidelity",tone:e.oxytocin}];return t.jsx("div",{className:"flex flex-col gap-2",children:o.map((i,r)=>{const a=n[i.key]??0,s=a<5.5,x=a>=5.5&&a<7.5,l=s?e.bad:x?e.warn:i.tone,c=a/10*100;return t.jsxs("div",{className:"flex items-center gap-3",style:{animation:"psywar-fadein 0.35s ease-out both",animationDelay:`${r*60}ms`},children:[t.jsx("span",{style:{fontSize:11,color:e.textDim,width:70,fontFamily:e.ui,letterSpacing:"-0.003em"},children:i.label}),t.jsx("div",{className:"flex-1 relative",style:{height:3,background:"rgba(255,255,255,0.05)",borderRadius:999,overflow:"hidden"},children:t.jsx("div",{style:{width:`${c}%`,height:"100%",background:`linear-gradient(90deg, ${l}88, ${l})`,boxShadow:`0 0 8px ${l}88`,transition:"width 0.4s cubic-bezier(0.2, 0.6, 0.2, 1)",transformOrigin:"left",animation:"psywar-score-fill 0.5s cubic-bezier(0.2, 0.6, 0.2, 1) both",animationDelay:`${r*60}ms`}})}),t.jsx("span",{style:{fontSize:11,fontFamily:e.mono,color:l,minWidth:30,textAlign:"right",fontVariantNumeric:"tabular-nums",textShadow:`0 0 10px ${l}60`},children:a.toFixed(1)})]},i.key)})})}function ge(){const n=g(o=>o.setView);return t.jsxs("button",{onClick:()=>n("editor"),className:"flex items-center gap-1.5 cursor-pointer focus-visible:outline-none",style:{padding:"6px 12px",fontSize:12,color:e.textDim,background:"transparent",border:`1px solid ${e.line}`,borderRadius:3,fontFamily:e.ui},children:[t.jsx(Q,{className:"w-3 h-3"}),"Jump to Editor"]})}const be={DR_VETERAN:{label:"Direct-response veteran",tone:e.norepinephrine,toneHi:e.warn,icon:V,blurb:"Bencivenga / Halbert lens"},EMOTIONAL_FILMMAKER:{label:"Emotional filmmaker",tone:e.serotonin,toneHi:e.serotoninHi,icon:O,blurb:"Damasio / Murch lens"},SKEPTICAL_CONSUMER:{label:"Skeptical consumer",tone:e.oxytocin,toneHi:e.oxytocinHi,icon:D,blurb:"Real-buyer lens"}},w=[{key:"hook_strength",label:"Hook",short:"HOK"},{key:"belief_coverage",label:"Belief",short:"BLF"},{key:"neurochem_balance",label:"Neuro",short:"NEU"},{key:"pace_coherence",label:"Pace",short:"PCE"},{key:"booster_fit",label:"Booster",short:"BST"},{key:"brief_fidelity",label:"Fidelity",short:"FID"}];function B(n){return Number.isFinite(n)?n>=.75?e.ok:n>=.55?e.warn:n>=.35?e.serotonin:e.bad:e.textFaint}function ye({jury:n,synthesis:o}){const[i,r]=b.useState(!0);if(!Array.isArray(n)||n.length===0)return null;const a=n.reduce((s,x)=>{const l=w.reduce((c,u)=>c+(Number(x[u.key])||0),0);return s+l/w.length},0)/n.length;return t.jsxs("div",{className:"flex flex-col gap-2 px-3.5 py-2.5 relative overflow-hidden",style:{background:`linear-gradient(135deg, ${e.norepinephrine}06, ${e.serotonin}06 50%, ${e.oxytocin}06)`,borderBottom:`1px solid ${e.hair}`,animation:"psywar-fadein 0.35s ease-out both"},children:[t.jsx("span",{"aria-hidden":!0,style:{position:"absolute",left:0,top:0,bottom:0,width:2,background:`linear-gradient(180deg, ${e.norepinephrine} 0%, ${e.serotonin} 50%, ${e.oxytocin} 100%)`,opacity:.75}}),t.jsxs("button",{type:"button",onClick:()=>r(s=>!s),className:"flex items-center gap-2 text-left w-full",style:{color:e.text,fontFamily:e.ui,background:"transparent",border:"none"},children:[t.jsx(Z,{className:"w-3 h-3",style:{color:e.brandHi,filter:`drop-shadow(0 0 4px ${e.brand}60)`}}),t.jsx("span",{style:{fontSize:12,color:e.text,textShadow:`0 0 8px ${e.brand}25`},children:"Audit chamber"}),t.jsxs("span",{style:{fontSize:10.5,color:e.textMuted,fontFamily:e.mono,marginLeft:4},children:[n.length," jurors · avg ",a.toFixed(2)]}),t.jsx(M,{className:"w-3 h-3 ml-auto transition-transform",style:{color:e.textMuted,transform:i?"rotate(180deg)":"rotate(0)"}})]}),i&&t.jsxs("div",{className:"flex flex-col gap-2 pt-1",style:{animation:"psywar-fadein 0.3s ease-out both"},children:[n.map((s,x)=>{const l=be[s.persona]??{label:s.persona||"Juror",tone:e.brand,toneHi:e.brandHi,icon:$,blurb:""},c=l.icon,u=w.reduce((p,m)=>p+(Number(s[m.key])||0),0)/w.length;return t.jsxs("div",{className:"flex flex-col gap-1 px-2 py-1.5",style:{background:l.tone+"0A",border:`1px solid ${l.tone}22`,borderLeft:`2px solid ${l.tone}`,borderRadius:3},children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(c,{className:"w-2.5 h-2.5",style:{color:l.toneHi,filter:`drop-shadow(0 0 3px ${l.tone}90)`}}),t.jsx("span",{style:{fontSize:11,color:l.toneHi,fontFamily:e.ui,textShadow:`0 0 5px ${l.tone}50`},children:l.label}
59),l.blurb&&t.jsx("span",{style:{fontSize:10,color:e.textFaint,fontFamily:e.mono,marginLeft:2},children:l.blurb}),t.jsx("span",{style:{marginLeft:"auto",fontSize:10.5,fontFamily:e.mono,color:B(u),textShadow:`0 0 6px ${B(u)}60`},children:u.toFixed(2)})]}),t.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:w.map(p=>{const m=Math.max(0,Math.min(1,Number(s[p.key])||0)),h=B(m);return t.jsxs("div",{title:`${p.label}: ${m.toFixed(2)}`,className:"flex items-center gap-1",style:{padding:"1px 5px",background:h+"10",border:`1px solid ${h}30`,borderRadius:2},children:[t.jsx("span",{style:{fontSize:9,color:e.textFaint,fontFamily:e.mono,letterSpacing:.4},children:p.short}),t.jsx("div",{style:{width:28,height:3,borderRadius:1.5,background:e.line,position:"relative",overflow:"hidden"},children:t.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:`${m*100}%`,background:`linear-gradient(90deg, ${h}aa, ${h})`,boxShadow:`0 0 4px ${h}80`,transition:"width 0.4s ease"}})}),t.jsx("span",{style:{fontSize:9.5,color:h,fontFamily:e.mono},children:m.toFixed(2)})]},p.key)})}),s.verdict&&t.jsxs("div",{style:{fontSize:12,color:e.textDim,fontFamily:e.ui,lineHeight:1.55,paddingLeft:2,marginTop:2},children:["“",s.verdict,"”"]})]},x)}),o&&t.jsxs("div",{className:"flex gap-2 px-2.5 py-2",style:{background:e.panelElev,border:`1px solid ${e.brandLine}`,borderRadius:3,marginTop:2},children:[t.jsx(R,{className:"w-3 h-3 flex-shrink-0 mt-0.5",style:{color:e.brandHi,filter:`drop-shadow(0 0 4px ${e.brand}80)`}}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontSize:10.5,color:e.brandHi,fontFamily:e.mono,letterSpacing:.4},children:"CHAMBER SYNTHESIS"}),t.jsx("span",{style:{fontSize:12,color:e.text,fontFamily:e.ui,lineHeight:1.65},children:o})]})]})]})]})}function je({intel:n}){const[o,i]=b.useState(!1),r=[{key:"core_pain_points",label:"Core pains",tone:e.cortisol,icon:C},{key:"objections",label:"Objections",tone:e.norepinephrine,icon:D},{key:"identity_tensions",label:"Identity tensions",tone:e.serotonin,icon:$},{key:"emotional_triggers",label:"Emotional triggers",tone:e.dopamine,icon:q},{key:"proof_vectors",label:"Proof vectors",tone:e.oxytocin,icon:U},{key:"competitor_hooks",label:"Competitor hooks",tone:e.dopamineHi,icon:R}];return t.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2.5 relative overflow-hidden",style:{background:e.panelElev,border:`1px solid ${e.oxytocin}28`,borderRadius:3,animation:"psywar-fadein 0.35s ease-out both"},children:[t.jsx("span",{"aria-hidden":!0,style:{position:"absolute",left:0,top:0,bottom:0,width:2,background:`linear-gradient(180deg, ${e.oxytocin}, ${e.dopamine}, ${e.serotonin})`,opacity:.7}}),t.jsxs("button",{type:"button",onClick:()=>i(a=>!a),className:"flex items-center gap-2 text-left",style:{color:e.text,fontFamily:e.ui},children:[t.jsx($,{className:"w-3.5 h-3.5",style:{color:e.oxytocinHi,filter:`drop-shadow(0 0 6px ${e.oxytocin}80)`}}),t.jsx("span",{style:{fontSize:13,color:e.text,textShadow:`0 0 10px ${e.oxytocin}30`},children:"Market intelligence"}),t.jsxs("span",{style:{fontSize:10.5,color:e.textMuted,fontFamily:e.mono,marginLeft:6},children:[Array.isArray(n.core_pain_points)?n.core_pain_points.length:0," pains ·"," ",Array.isArray(n.objections)?n.objections.length:0," objections"]}),t.jsx(M,{className:"w-3 h-3 ml-auto transition-transform",style:{color:e.textMuted,transform:o?"rotate(180deg)":"rotate(0)"}})]}),n.synthesis&&t.jsxs("div",{style:{fontSize:12,color:e.textDim,fontFamily:e.ui,lineHeight:1.65,padding:"4px 2px 0"},children:["“",n.synthesis,"”"]}),o&&t.jsx("div",{className:"flex flex-col gap-2.5 pt-2",style:{animation:"psywar-fadein 0.3s ease-out both"},children:r.map(({key:a,label:s,tone:x,icon:l})=>{const c=n[a]||[];return!Array.isArray(c)||c.length===0?null:t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[t.jsx(l,{className:"w-2.5 h-2.5",style:{color:x,filter:`drop-shadow(0 0 3px ${x}80)`}}),t.jsx("span",{style:{fontSize:11,color:x,fontFamily:e.ui,textShadow:`0 0 6px ${x}30`},children:s})]}),t.jsx("ul",{className:"flex flex-col gap-0.5",style:{marginLeft:14},children:c.map((u,p)=>t.jsxs("li",{style:{fontSize:12,color:e.textDim,fontFamily:e.ui,lineHeight:1.55},children:[t.jsx("span",{style:{color:x,marginRight:6,textShadow:`0 0 4px ${x}80`},children:"•"}),u]},p))})]},String(a))})})]})}function ve(){const n=g(i=>i.history),o=g(i=>i.clearHistory);return n.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("span",{style:{fontSize:13,color:e.textMuted,fontFamily:e.ui},children:"No past runs"})}):t.jsxs("div",{className:"p-5 flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center justify-between mb-1",children:[t.jsxs("span",{style:{fontSize:12,color:e.textDim,fontFamily:e.ui},children:[n.length," run",n.length===1?"":"s"]}),t.jsx("button",{onClick:o,style:{fontSize:12,color:e.bad,background:"transparent",border:`1px solid ${e.bad}30`,padding:"4px 10px",borderRadius:3,cursor:"pointer",fontFamily:e.ui},children:"Clear history"})]}),n.map(i=>{const a=[...i.candidates].filter(s=>s.audit).sort((s,x)=>x.audit.overall-s.audit.overall)[0];return t.jsxs("div",{className:"flex items-center gap-4 p-3",style:{background:e.panel,border:`1px solid ${e.line}`,borderRadius:3},children:[t.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[t.jsx("span",{style:{fontSize:13,color:e.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:e.ui},children:i.brief.creativeAngle.slice(0,82)||"Untitled brief"}),t.jsxs("span",{style:{fontSize:11,color:e.textMuted,fontFamily:e.mono},children:[i.brief.vslType," · ",i.brief.pace," · ",new Date(i.startedAt).toLocaleStr
59ing()]})]}),t.jsxs("div",{className:"flex flex-col items-end",children:[t.jsx("span",{style:{fontSize:18,fontWeight:500,color:a&&a.audit.overall>=7.5?e.ok:e.warn,fontFamily:e.mono},children:a?.audit?.overall?.toFixed(1)??","}),t.jsxs("span",{style:{fontSize:10,color:e.textFaint,fontFamily:e.ui},children:[i.candidates.length," cand"]})]})]},i.id)})]})}function we({title:n,subtitle:o,right:i}){return t.jsxs("div",{className:"flex items-start justify-between gap-4 px-5 pt-5 pb-4",style:{borderBottom:`1px solid ${e.line}`,background:e.panel,position:"sticky",top:0,zIndex:5},children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h1",{style:{fontSize:22,fontWeight:400,color:e.text,fontFamily:e.ui,letterSpacing:"-0.01em",lineHeight:1},children:n}),o&&t.jsx("span",{style:{fontSize:11.5,color:e.textMuted,fontFamily:e.mono},children:o})]}),i]})}function y({title:n,note:o,children:i}){return t.jsxs("section",{className:"px-5 py-4 flex flex-col gap-3",style:{borderBottom:`1px solid ${e.hair}`},children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h2",{style:{fontSize:14,fontWeight:400,color:e.text,fontFamily:e.ui,letterSpacing:"-0.005em"},children:n}),o&&t.jsx("span",{style:{fontSize:11.5,color:e.textMuted,lineHeight:1.5,fontFamily:e.ui},children:o})]}),i]})}function F({label:n,children:o}){return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{style:{fontSize:11,color:e.textMuted,fontFamily:e.ui},children:n}),o]})}function E({icon:n,label:o,tone:i=e.brand}){return t.jsxs("div",{className:"flex items-center gap-1.5",style:{fontSize:12,color:e.textDim,fontFamily:e.ui,padding:"3px 8px",background:i+"10",border:`1px solid ${i}30`,borderRadius:999},children:[t.jsx(n,{className:"w-3 h-3",style:{color:i,filter:`drop-shadow(0 0 4px ${i}80)`}}),t.jsx("span",{style:{textShadow:`0 0 8px ${i}40`},children:o})]})}const z={width:"100%",padding:"7px 10px",fontSize:13,color:e.text,background:e.surface,border:`1px solid ${e.line}`,borderRadius:3,outline:"none",fontFamily:e.ui};function Se(){const n=b.useRef(null);return b.useEffect(()=>{const o=n.current;if(!o)return;const i=o.getContext("2d");if(!i)return;const r=["#cc00ff","#00ddff","#ff66aa","#e879f9"],a=48,s=[];let x=0,l=0;const c=Math.min(window.devicePixelRatio||1,2),u=()=>{x=o.offsetWidth,l=o.offsetHeight,o.width=Math.floor(x*c),o.height=Math.floor(l*c),i.setTransform(1,0,0,1,0,0),i.scale(c,c)};u();for(let f=0;f<a;f++)s.push({x:Math.random()*x,y:Math.random()*l,vx:(Math.random()-.5)*.18,vy:(Math.random()-.5)*.18,r:.9+Math.random()*1.5,c:r[Math.floor(Math.random()*r.length)],pulse:Math.random()*Math.PI*2});let p=0;const m=()=>{i.clearRect(0,0,x,l);for(let f=0;f<a;f++)for(let d=f+1;d<a;d++){const v=s[f].x-s[d].x,k=s[f].y-s[d].y,N=Math.hypot(v,k);if(N<150){const H=.08*(1-N/150);i.strokeStyle=`rgba(204,0,255,${H})`,i.lineWidth=.5,i.beginPath(),i.moveTo(s[f].x,s[f].y),i.lineTo(s[d].x,s[d].y),i.stroke()}}for(const f of s){f.x+=f.vx,f.y+=f.vy,f.pulse+=.012,f.x<-10&&(f.x=x+10),f.x>x+10&&(f.x=-10),f.y<-10&&(f.y=l+10),f.y>l+10&&(f.y=-10);const d=.35+.4*Math.sin(f.pulse);i.shadowBlur=10,i.shadowColor=f.c,i.fillStyle=f.c+Math.round(Math.max(0,Math.min(1,d))*255).toString(16).padStart(2,"0"),i.beginPath(),i.arc(f.x,f.y,f.r,0,Math.PI*2),i.fill()}i.shadowBlur=0,p=requestAnimationFrame(m)};m();const h=new ResizeObserver(u);return h.observe(o),()=>{cancelAnimationFrame(p),h.disconnect()}},[]),t.jsx("canvas",{ref:n,"aria-hidden":!0,style:{position:"absolute",inset:0,width:"100%",height:"100%",pointerEvents:"none",opacity:.55,zIndex:0}})}function I(n,o,i,r){const a=r===i?0:(o-i)/(r-i)*100;return{WebkitAppearance:"none",width:"100%",accentColor:n,background:`linear-gradient(90deg, ${n} 0%, ${n} ${a}%, rgba(255,255,255,0.06) ${a}%, rgba(255,255,255,0.06) 100%)`,height:2,borderRadius:999,outline:"none",cursor:"pointer"}}export{De 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.