PageSourceSearch

https://xterns.ai/assets/ClientAcceleratorSetup-06UxDYRN.js

js xterns.ai collected 2026-10-05 13:24:34 UTC 9,800 bytes, 1 lines download raw bytes

1import{j as e,a8 as V,u as M,r as n,B as o,L as x,a7 as O,br as z,U as G,h as v,i as N,k as _,m as w,I as g,n as H,J,ae as d}from"./index-DLd_kDlx.js";import{C as K}from"./ClientBusinessGate-CKL9R3zX.js";import{L as m}from"./label-D4-ENrYn.js";import{S as Q,a as W,b as X,c as Y,d as C}from"./select-RSrodAEw.js";import{T as Z,a as ee,b as h,c as y}from"./tabs-DKw2ItQa.js";import{T as ae}from"./textarea-C6X-I43k.js";import{g as se,a as te,u as re,c as ie,r as le}from"./acceleratorManagement-jGdrPuKl.js";import{s as ce}from"./businessManagement-BTTXtuIj.js";import{L as b}from"./loader-circle-D2miE2xB.js";import{A as ne}from"./arrow-left-BXtn7MCa.js";import{S as oe}from"./settings-2-DN7526sA.js";import{E as de}from"./earth-tODT83zM.js";import{S as B}from"./save-DnzFMk1L.js";import"./timer-CZhDpZys.js";import"./briefcase-business-CphIeAJd.js";import"./index-BdQq_4o_.js";import"./index-Deh-4PO1.js";import"./chevron-down-DpJJsCer.js";import"./chevron-up-M4SAwIjf.js";import"./index-lTaZyIGy.js";const pe={name:"",description:"",application_open_date:"",application_close_date:"",accelerator_start_date:"",status:"draft"},Ee=()=>e.jsx(K,{requireAccelerator:!0,children:({business:l})=>e.jsx(me,{businessId:l.id})}),me=({businessId:l})=>{const{programmeId:r}=V(),j=M(),c=!r,[s,A]=n.useState(pe),[P,I]=n.useState([]),[S,L]=n.useState([]),[D,k]=n.useState(!c),[F,T]=n.useState(!1),[E,q]=n.useState(!1);n.useEffect(()=>{(async()=>{try{k(!0);const t=await ce(l);if(I(t),r){const[i,f]=await Promise.all([se(l,r),te(l,r)]);A({name:i.name,description:i.description,application_open_date:i.application_open_date,application_close_date:i.application_close_date,accelerator_start_date:i.accelerator_start_date,status:i.status}),L(f)}}catch(t){d({title:"Unable to load accelerator setup",description:t instanceof Error?t.message:"Please try again.",variant:"destructive"}),j("/client/accelerator")}finally{k(!1)}})()},[l,j,r]);const u=n.useMemo(()=>s.application_close_date<s.application_open_date?"Application close date must be on or after the open date.":s.accelerator_start_date<s.application_close_date?"Accelerator start date must be on or after the application close date.":null,[s.accelerator_start_date,s.application_close_date,s.application_open_date]),p=(a,t)=>A(i=>({...i,[a]:t})),U=async a=>{if(a.preventDefault(),u){d({title:"Invalid programme dates",description:u,variant:"destructive"});return}try{if(T(!0),r)await re(l,r,s),d({title:"Programme settings saved"});else{const t=await ie(l,s);d({title:"Accelerator created",description:"Continue with the remaining programme setup stages."}),j(`/client/accelerator/${t.id}/setup`,{replace:!0})}}catch(t){d({title:"Unable to save programme",description:t instanceof Error?t.message:"Please try again.",variant:"destructive"})}finally{T(!1)}},$=(a,t)=>{L(i=>t?[...new Set([...i,a])]:i.filter(f=>f!==a))},R=async()=>{if(r)try{q(!0),await le(l,r,S),d({title:"Accelerator pods updated"})}catch(a){d({title:"Unable to link pods",description:a instanceof Error?a.message:"Please try again.",variant:"destructive"})}finally{q(!1)}};return D?e.jsx("div",{className:"flex justify-center py-24",children:e.jsx(b,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(o,{asChild:!0,variant:"ghost",className:"gap-2",children:e.jsxs(x,{to:"/client/accelerator",children:[e.jsx(ne,{className:"h-4 w-4"}),"Back to accelerators"]})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:c?"Create Accelerator":s.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c?"Add the programme information applicants will see.":"Complete each stage before opening applications."})]}),e.jsxs(Z,{defaultValue:"settings",className:"space-y-4",children:[e.jsxs(ee,{className:"h-auto w-full justify-start overflow-x-auto p-1",children:[e.jsxs(h,{value:"settings",className:"gap-2",children:[e.jsx(oe,{className:"h-4 w-4"})," Programme Settings"]}),e.jsxs(h,{value:"landing",disabled:c,className:"gap-2",children:[e.jsx(de,{className:"h-4 w-4"})," Landing Page"]}
1),e.jsxs(h,{value:"form",disabled:c,className:"gap-2",children:[e.jsx(O,{className:"h-4 w-4"})," Application Form"]}),e.jsxs(h,{value:"review",disabled:c,className:"gap-2",children:[e.jsx(z,{className:"h-4 w-4"})," Application Review"]}),e.jsxs(h,{value:"pods",disabled:c,className:"gap-2",children:[e.jsx(G,{className:"h-4 w-4"})," Link Pods"]})]}),e.jsx(y,{value:"settings",children:e.jsxs(v,{children:[e.jsx(N,{children:e.jsx(_,{children:"Programme Settings"})}),e.jsx(w,{children:e.jsxs("form",{onSubmit:U,className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"accelerator-name",children:"Accelerator Name"}),e.jsx(g,{id:"accelerator-name",value:s.name,onChange:a=>p("name",a.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"accelerator-description",children:"Description"}),e.jsx(ae,{id:"accelerator-description",value:s.description,onChange:a=>p("description",a.target.value),rows:6,required:!0})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"application-open-date",children:"Application Open Date"}),e.jsx(g,{id:"application-open-date",type:"date",value:s.application_open_date,onChange:a=>p("application_open_date",a.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"application-close-date",children:"Application Close Date"}),e.jsx(g,{id:"application-close-date",type:"date",min:s.application_open_date,value:s.application_close_date,onChange:a=>p("application_close_date",a.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"accelerator-start-date",children:"Accelerator Start Date"}),e.jsx(g,{id:"accelerator-start-date",type:"date",min:s.application_close_date,value:s.accelerator_start_date,onChange:a=>p("accelerator_start_date",a.target.value),required:!0})]})]}),e.jsxs("div",{className:"max-w-xs space-y-2",children:[e.jsx(m,{children:"Programme Status"}),e.jsxs(Q,{value:s.status,onValueChange:a=>p("status",a),children:[e.jsx(W,{children:e.jsx(X,{})}),e.jsxs(Y,{children:[e.jsx(C,{value:"draft",children:"Draft"}),e.jsx(C,{value:"open",children:"Open"}),e.jsx(C,{value:"closed",children:"Closed"})]})]})]}),u&&e.jsx("p",{className:"text-sm text-destructive",children:u}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(o,{type:"submit",disabled:F||!!u,className:"gap-2",children:[F?e.jsx(b,{className:"h-4 w-4 animate-spin"}):e.jsx(B,{className:"h-4 w-4"}),c?"Create and Continue":"Save Settings"]})})]})})]})}),["landing","form","review"].map(a=>{const t={landing:"Landing Page",form:"Application Form",review:"Application Review"};return e.jsx(y,{value:a,children:e.jsxs(v,{children:[e.jsx(N,{children:e.jsx(_,{children:t[a]})}),e.jsx(w,{children:a==="landing"?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Personalise the fixed public landing page template and publish it when ready."}),e.jsx(o,{asChild:!0,className:"gap-2",children:e.jsx(x,{to:`/client/accelerator/${r}/landing-page`,children:"Configure Landing Page"})})]}):a==="form"?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure eligible industries and pathways, then add programme-specific questions."}),e.jsx(o,{asChild:!0,className:"gap-2",children:e.jsx(x,{to:`/client/accelerator/${r}/application-form`,children:"Configure Application Form"})})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"View automatic rubric scores, AI review insights, and application recommendations."}),e.jsx(o,{asChild:!0,className:"gap-2",children:e.jsx(x,{to:`/client/accelerator/${r}/application-review`,children:"Review Applications"})})]})})]})},a)}),e.jsx(y,{value:"pods",children:e.jsxs(v,{children:[e.jsxs(N,{children:[e.jsx(_,{children:"Link Business Pods"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Associate existing business-owned pods with this accelerator for programme reporting."})]}),e.jsxs(w,{className:"space-y-4",children:[!c&&e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl border bg-muted/30 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Applicant Pod Assignment"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Assign accepted applicants manually or run intelligent Auto Assignment."})]}),e.jsx(o,{asChild:!0,children:e.jsx(x,{to:`/client/accelerator/${r}/pod-assignments`,children:"Manage Assignments"})})]}),P.length===0?e.jsx("p",{className:"rounded-lg border p-6 text-center text-sm text-muted-foreground",children:"This business has no pods available to link."}):e.jsx("div",{className:"space-y-2",children:P.map(a=>{var t;return e.jsxs("label",{className:"flex cursor-pointer items-center gap-3 rounded-lg border p-3",children:[e.jsx(H,{checked:S.includes(a.id),onCheckedChange:i=>$(a.id,i===!0)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate font-medium",children:a.pod_name}),e.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:[((t=a.projects)==null?void 0:t.t
1itle)||"Unlinked project"," · ",a.current_members,"/",a.max_members," participants"]})]}),e.jsx(J,{variant:"outline",className:"capitalize",children:a.status})]},a.id)})}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(o,{onClick:R,disabled:E,className:"gap-2",children:[E?e.jsx(b,{className:"h-4 w-4 animate-spin"}):e.jsx(B,{className:"h-4 w-4"}),"Save Linked Pods"]})})]})]})})]})]})};export{Ee 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.