1import{j as e}from"./app-C1iegf7Q.js";import{b as s,f as b,L as R}from"./inertia-BpyZy4w-.js";import{S as B}from"./seo-meta-BiuXzdeE.js";import{A as I}from"./app-layout-N5SYko6V.js";import{L as O}from"./loader-circle-C_KBZAGS.js";import{A as V}from"./arrow-left-DCX0fhKH.js";import{C as q}from"./chevron-down-B1YaU0K5.js";import{S as J}from"./sparkles-C0aC1RHI.js";/* empty css */import"./case-shell-EPUgGCr1.js";import"./mobile-chrome-C0ug21w9.js";import"./shield-alert-CGX6PHoz.js";import"./createLucideIcon-wqc1LSWg.js";import"./menu-BR3Nc3Gr.js";import"./x-DQSeRCcH.js";import"./message-circle-c43k_fjC.js";import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./site-announcement-fVSM8f3a.js";import"./use-funnel-tracking-DZvQDmiU.js";import"./journey-labels-D75PCX0v.js";import"./bell-BvDZckLh.js";import"./plus-BJl-aJiX.js";import"./guest-nav-Dk8jWUwY.js";function X(){return document.querySelector('meta[name="csrf-token"]')?.content??""}function Se({case:r,what_wins:f,sectors:L,idea:n,has_cv:F,is_proposing_strategy:o,has_strategy:g,generate_url:z,save_url:K}){const[c,a]=s.useState(n?"write":"choose"),[m,U]=s.useState(!n),[x,k]=s.useState(n?.summary??""),[y,j]=s.useState(n?.sector??""),[N,v]=s.useState(n?.innovation??""),[u,w]=s.useState(!1),[d,P]=s.useState(""),[S,Y]=s.useState(""),[C,T]=s.useState(!1),[W,h]=s.useState(null),[p,A]=s.useState([]),D=u||o;s.useEffect(()=>{if(!o)return;const t=window.setInterval(()=>{b.reload({only:["is_proposing_strategy","has_strategy"]})},3e3);return()=>window.clearInterval(t)},[o]),s.useEffect(()=>{g&&!o&&b.visit(`/cases/${r.uuid}?tab=overview#strategy`)},[g,o,r.uuid]);function E(t,i){w(!0),b.post(K,{...t,source:i},{preserveScroll:!0,onFinish:()=>w(!1)})}async function H(){T(!0),h(null),A([]);try{const t=await fetch(z,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":X()},body:JSON.stringify({sector:d,steer:S})}),i=await t.json().catch(()=>({}));!t.ok||!Array.isArray(i.ideas)?h(i.error??"Could not suggest ideas just now. Try again."):A(i.ideas)}catch{h("Something went wrong. Try again.")}finally{T(!1)}}const $=(t,i,M)=>e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-xs font-medium text-ink-2",children:M}),e.jsxs("select",{value:t,onChange:l=>i(l.target.value),className:"w-full rounded-md border border-line bg-bg px-3 py-2 text-sm text-ink focus:ring-1 focus:ring-ink/20 focus:outline-none",children:[e.jsx("option",{value:"",children:"Pick one, or leave it"}),L.map(l=>e.jsx("option",{value:l,children:l},l))]})]});return D?e.jsxs(I,{children:[e.jsx(B,{title:"Your business idea",description:"Tell us the business you want to build in the UK.",url:`/cases/${r.uuid}/business-idea`}),e.jsxs("div",{className:"mx-auto mt-16 max-w-xl px-4 text-center",children:[e.jsx(O,{className:"mx-auto h-5 w-5 animate-spin text-ink"}),e.jsx("h1",{className:"mt-4 font-serif text-2xl leading-tight font-normal tracking-display text-ink",children:"Building your strategy"}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-ink-2",children:"We are working out which endorsing body fits your idea and where your strongest claim is. Usually 30 to 60 seconds. This page moves on by itself when it is ready."})]})]}):e.jsxs(I,{children:[e.jsx(B,{title:"Your business idea",description:"Tell us the business you want to build in the UK.",url:`/cases/${r.uuid}/business-idea`}),e.jsxs("div",{className:"mx-auto max-w-3xl px-4 pt-6 pb-16",children:[e.jsxs(R,{href:`/cases/${r.uuid}?tab=overview`,className:"inline-flex items-center gap-1.5 text-xs font-medium text-ink-2 no-underline hover:text-ink",children:[e.jsx(V,{size:14}),"Back to your case"]}),e.jsx("p",{className:"mt-6 text-2xs font-semibold tracking-eyebrow text-ink-3 uppercase",children:"Where your case starts"}),e.jsx("h1",{className:"mt-1 font-serif text-3xl leading-tight font-normal tracking-display text-ink",children:"Your business idea"}),e.jsx("p",{className:"mt-2 max-w-xl text-sm leading-relaxed text-ink-2",children:"Everything else is built on this: which endorsing body fits, what your plan argues, what your evidence has to prove. Tell us the business, and we build the rest around it."}),f.length>0&&e.jsxs("div",{className:"mt-6 overflow-hidden rounded-card border border-line bg-surface",children:[e.jsxs("button",{type:"button",onClick:()=>U(t=>!t),"aria-expanded":m,className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[e.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-lime"}),e.jsx("span",{className:"flex-1 text-2xs font-semibold tracking-eyebrow text-ink-3 uppercase",children:"What wins endorsement: the three tests"}),e.jsx(q,{size:14,className:`shrink-0 text-ink-3 transition-transform ${m?"rotate-180":""}`})]}),m&&e.jsx("div",{className:"flex flex-col gap-3 border-t border-line-2 px-4 pt-3 pb-4",children:f.map(t=>e.jsxs("div",{children:[e.jsx("p",{className:"m-0 text-sm font-semibold text-ink",children:t.title}),e.jsx("p",{className:"m-0 mt-0.5 text-xs leading-relaxed text-ink-2",children:t.text})]},t.code))})]}),c==="choose"&&e.jsxs("div",{className:"mt-6 grid gap-3 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>a("write"),className:"rounded-card border border-line bg-surface p-5 text-left hover:border-ink",children:[e.jsx("p",{className:"m-0 text-sm font-semibold text-ink",children:"I know what I want to build"}),e.jsx("p",{className:"m-0 mt-1 text-xs leading-relaxed text-ink-2",children:"Describe it in your own words. A few sentences is enough to start."})]}),e.jsxs("button",{type:"button",onClick:()=>a("find"),className:"rounded-card border border-line bg-surface p-5 text-left hover:border-ink",children:[e.jsx("p",{className:"m-0 text-sm font-semibold text-ink",children:"Help me find one"}),e.jsx("p",{className:"m-0 mt-1 text-xs leading-relaxed text-ink-2",children:F?"We read your CV and suggest ventures you could credibly build, written against the three tests.":"We suggest ventures written against the three tests. Add your CV first and they get closer to you."})]})]}),c==="write"&&e.jsxs("div",{className:"mt-6 rounded-card border border-line bg-surface p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h2",{className:"m-0 text-base font-semibold text-ink",children:"Tell us the business"}),!n&&e.jsx("button",{type:"button",onClick:()=>a("choose"),className:"shrink-0 text-xs font-medium text-ink-2 underline hover:text-ink",children:"Back"})]}),e.jsxs("label",{className:"mt-4 block",children:[e.jsx("span",{className:"mb-1.5 block text-xs font-medium text-ink-2",children:"What is the business, and who is it for?"}),e.jsx("textarea",{value:x,onChange:t=>k(t.target.value),rows:5,placeholder:"We are building a scheduling tool for independent physiotherapy clinics in the UK. Clinics lose bookings to phone tag; we take bookings and rebooking automatically.",className:"w-full rounded-md border border-line bg-bg px-3 py-2 text-sm leading-relaxed text-ink placeholder:text-ink-3 focus:ring-1 focus:ring-ink/20 focus:outline-none"})]}),e.jsx("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:$(y,j,"Sector")}
1),e.jsxs("label",{className:"mt-3 block",children:[e.jsx("span",{className:"mb-1.5 block text-xs font-medium text-ink-2",children:"What is genuinely new about it?"}),e.jsx("textarea",{value:N,onChange:t=>v(t.target.value),rows:3,placeholder:"Nobody else prices per recovered booking rather than per seat, so a clinic pays only when it works.",className:"w-full rounded-md border border-line bg-bg px-3 py-2 text-sm leading-relaxed text-ink placeholder:text-ink-3 focus:ring-1 focus:ring-ink/20 focus:outline-none"}),e.jsx("span",{className:"mt-1 block text-2xs text-ink-3",children:"Optional, and worth a line. Innovation is the first of the three tests."})]}),e.jsx("button",{type:"button",disabled:x.trim()===""||u,onClick:()=>E({summary:x,sector:y,innovation:N},"written"),className:"mt-5 rounded-md bg-ink px-4 py-2 text-sm font-medium text-white hover:opacity-90 disabled:opacity-50",children:n?"Save this":"Save and build my strategy"})]}),c==="find"&&e.jsxs("div",{className:"mt-6 rounded-card border border-line bg-surface p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h2",{className:"m-0 text-base font-semibold text-ink",children:"Ideas that could win endorsement"}),e.jsx("button",{type:"button",onClick:()=>a("choose"),className:"shrink-0 text-xs font-medium text-ink-2 underline hover:text-ink",children:"Back"})]}),e.jsx("p",{className:"m-0 mt-1 text-xs leading-relaxed text-ink-2",children:"Written against the three tests, and against your background where we have it. Starting points to react to, not a shortlist to accept."}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[$(d,P,"Sector to explore"),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-1.5 block text-xs font-medium text-ink-2",children:"Anything to steer us"}),e.jsx("input",{value:S,onChange:t=>Y(t.target.value),placeholder:"Ten years in logistics ops, want something B2B",className:"w-full rounded-md border border-line bg-bg px-3 py-2 text-sm text-ink placeholder:text-ink-3 focus:ring-1 focus:ring-ink/20 focus:outline-none"})]})]}),e.jsxs("button",{type:"button",onClick:H,disabled:C,className:"mt-4 inline-flex items-center gap-1.5 rounded-md bg-ink px-4 py-2 text-sm font-medium text-white hover:opacity-90 disabled:opacity-50",children:[C?e.jsx(O,{size:14,className:"animate-spin"}):e.jsx(J,{size:14}),p.length>0?"Suggest more":"Suggest ideas"]}),W&&e.jsxs("div",{className:"mt-4 rounded-card border border-red/30 bg-red/8 px-4 py-3",children:[e.jsx("p",{className:"m-0 text-sm text-ink",children:W}),e.jsx("button",{type:"button",onClick:()=>a("write"),className:"mt-1.5 text-xs font-medium text-ink-2 underline hover:text-ink",children:"Write it yourself instead"})]}),p.length>0&&e.jsx("div",{className:"mt-5 flex flex-col gap-3",children:p.map(t=>e.jsxs("div",{className:"rounded-card border border-line bg-bg p-4",children:[e.jsx("p",{className:"m-0 text-sm font-semibold text-ink",children:t.title}),e.jsx("p",{className:"m-0 mt-1 text-xs leading-relaxed text-ink-2",children:t.summary}),e.jsxs("dl",{className:"mt-2.5 flex flex-col gap-1.5",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-2xs font-semibold tracking-eyebrow text-ink-3 uppercase",children:"What is new"}),e.jsx("dd",{className:"m-0 text-xs leading-relaxed text-ink-2",children:t.innovation})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-2xs font-semibold tracking-eyebrow text-ink-3 uppercase",children:"How it scales"}),e.jsx("dd",{className:"m-0 text-xs leading-relaxed text-ink-2",children:t.scalability})]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",disabled:u,onClick:()=>E({summary:`${t.title}. ${t.summary}`,sector:d,innovation:t.innovation},"generated"),className:"rounded-md bg-ink px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:"Build my case on this"}),e.jsx("button",{type:"button",onClick:()=>{k(`${t.title}. ${t.summary}`),v(t.innovation),j(d),a("write")},className:"text-xs font-medium text-ink-2 underline hover:text-ink",children:"Edit it first"}),t.best_fit_body&&e.jsxs("span",{className:"text-2xs text-ink-3",children:["Often a fit for"," ",t.best_fit_body]})]})]},t.title))})]})]})]})}export{Se 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.