PageSourceSearch

https://intel-base.ai/assets/Onboarding-DZUnzARm.js

js intel-base.ai collected 2026-10-05 15:37:40 UTC 12,875 bytes, 1 lines download raw bytes

1import{u as ye,r as t,j as e}from"./react-vendor-BDFCGFgF.js";import{bM as be,bN as Ne,U as Ce,q as _e,p as Se,w as k,g as ke,h as u,i as p,j as g,k as j,L as i,I as l,B as o,bs as Ee,b4 as Te,l as v}from"./index-CnoOAt8u.js";import{C as E}from"./checkbox-DwpghOvO.js";import{S as T,a as R,b as w,c as M,d as F}from"./select-BBkpWt_j.js";import{b as Re}from"./useRDCompanies-B49BE5r9.js";import{u as we}from"./useRDTracks-DD8_Lfdm.js";import{u as Me}from"./useRDTeamMembers-RLBT8Y_f.js";import{B as Fe}from"./building-2-SFRXj_nQ.js";import{C as Ae}from"./chevron-left-C1VtbHb9.js";import"./supabase-Cw9ajmI9.js";import"./radix-C1DJG546.js";const G={flooring_manufacturer:"Flooring Manufacturer",software_saas:"Software / SaaS Company",flooring_contractor:"Flooring Contractor / Installer",flooring_retailer:"Flooring Retailer",custom_other:"Custom / Other"},J={c_corp:"C-Corporation",s_corp:"S-Corporation",partnership:"Partnership",llc:"LLC",sole_prop:"Sole Proprietorship"},A={product_rd:"Product R&D",process_rd:"Manufacturing Process R&D",software_rd:"Softw
1are Development R&D",custom_tooling_rd:"Custom Tooling R&D",other:"Other"},B={owner:"Owner / Admin",manager:"Manager",employee:"Employee / Researcher",contractor:"Contractor",cpa_viewer:"CPA / External Viewer"},Z=[{num:1,label:"Entity",icon:Fe},{num:2,label:"Business Type",icon:be},{num:3,label:"R&D Tracks",icon:Ne},{num:4,label:"Team",icon:Ce},{num:5,label:"Review",icon:_e}];function ze(){const ee=ye(),[n,D]=t.useState(1),[f,se]=t.useState(""),[L,re]=t.useState(""),[y,ae]=t.useState("llc"),[b,te]=t.useState("MI"),[I,ie]=t.useState(""),[P,ne]=t.useState(""),[N,le]=t.useState(""),[O,ce]=t.useState(""),[m,oe]=t.useState([]),[d,X]=t.useState([]),[C,Y]=t.useState(""),[q,de]=t.useState("product_rd"),[U,me]=t.useState(!0),[h,V]=t.useState([]),[_,z]=t.useState(""),[$,H]=t.useState(""),[K,he]=t.useState("employee"),[Q,W]=t.useState(!1),S=Re(),xe=we(),ue=Me(),pe=s=>{oe(r=>r.includes(s)?r.filter(a=>a!==s):[...r,s])},ge=()=>{if(!C.trim())return v.error("Track name required");X(s=>[...s,{name:C.trim(),track_type:q,is_michigan_based:U}]),Y("")},je=()=>{if(!_.trim())return v.error("Name required");V(s=>[...s,{full_name:_.trim(),email:$.trim(),role:K,is_officer:Q}]),z(""),H(""),W(!1)},fe=()=>n===1?f.trim().length>0:n===2?m.length>0:n===3?d.length>0:!0,ve=async()=>{try{const s=parseFloat(I||"0"),r=await S.mutateAsync({legal_name:f.trim(),ein:L.trim()||null,entity_type:y,state_of_formation:b.trim()||null,prior_year_gross_receipts_cents:Math.round(s*100),years_in_existence:parseInt(P||"0",10),employee_count:parseInt(N||"0",10),business_types:m,cpa_email:O.trim()||null});await Promise.all(d.map(a=>xe.mutateAsync({company_id:r.id,name:a.name,track_type:a.track_type,is_michigan_based:a.is_michigan_based}))),await Promise.all(h.map(a=>ue.mutateAsync({company_id:r.id,full_name:a.full_name,email:a.email||void 0,role:a.role,is_officer:a.is_officer}))),v.success("R&D Compliance Buddy is ready"),ee("/rd-tax",{replace:!0})}catch(s){console.error(s),v.error(s instanceof Error?s.message:"Setup failed")}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Set up your R&D entity"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"5 quick steps to configure tracking for federal IRC §41 and Michigan R&D credits."})]}),e.jsx("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 p-3",children:Z.map((s,r)=>{const a=s.icon,x=n>s.num,c=n===s.num;return e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:k("flex h-10 w-10 shrink-0 items-center justify-center rounded-full border-2 transition-colors",x&&"border-emerald-500 bg-emerald-500 text-white",c&&"border-amber-500 bg-amber-500/10 text-amber-500",!x&&!c&&"border-border text-muted-foreground"),children:x?e.jsx(Se,{className:"h-5 w-5"}):e.jsx(a,{className:"h-5 w-5"})}),e.jsxs("div",{className:"ml-2 hidden md:block",children:[e.jsxs("div",{className:k("text-xs font-medium",c?"text-foreground":"text-muted-foreground"),children:["Step ",s.num]}),e.jsx("div",{className:"text-sm",children:s.label})]}),r<Z.length-1&&e.jsx("div",{className:"mx-2 h-px flex-1 bg-border"})]},s.num)})}),e.jsxs(ke,{children:[n===1&&e.jsxs(e.Fragment,{children:[e.jsxs(u,{children:[e.jsx(p,{children:"Entity information"}),e.jsx(g,{children:"Required for IRS Form 6765 and Michigan Treasury filings."})]}),e.jsx(j,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"legal-name",children:"Legal entity name *"}),e.jsx(l,{id:"legal-name",placeholder:"Acme Flooring, LLC",value:f,onChange:s=>se(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"ein",children:"EIN"}),e.jsx(l,{id:"ein",placeholder:"XX-XXXXXXX",value:L,onChange:s=>re(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Entity type"}),e.jsxs(T,{value:y,onValueChange:s=>ae(s),children:[e.jsx(R,{children:e.jsx(w,{})}),e.jsx(M,{children:Object.entries(J).map(([s,r])=>e.jsx(F,{value:s,children:r},s))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"state",children:"State of formation"}),e.jsx(l,{id:"state",placeholder:"MI",value:b,onChange:s=>te(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"rev",children:"Prior year gross receipts (USD)"}),e.jsx(l,{id:"rev",type:"number",inputMode:"decimal",placeholder:"0",value:I,onChange:s=>ie(s.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Used to determine payroll-offset eligibility (<$5M)."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"years",children:"Years in existence"}),e.jsx(l,{id:"years",type:"number",placeholder:"0",value:P,onChange:s=>ne(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"emp",children:"Employee count"}),e.jsx(l,{id:"emp",type:"number",placeholder:"0",value:N,onChange:s=>le(s.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Under 250 = 15% Michigan rate; 250+ = 10%."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"cpa",children:"CPA email (optional)"}),e.jsx(l,{id:"cpa",type:"email",placeholder:"[email protected]",value:O,onChange:s=>ce(s.target.value)})]})]})})]}),n===2&&e.jsxs(e.Fragment,{children:[e.jsxs(u,{children:[e.jsx(p,{children:"Business type"}),e.jsx(g,{children:"This drives your pre-built activity library. Select all that apply."})]}),e.jsx(j,{className:"space-y-3",children:Object.entries(G).map(([s,r])=>{const a=m.includes(s);return e.jsxs("button",{type:"button",onClick:()=>pe(s),className:k("flex w-full items-start gap-3 rounded-lg border p-4 text-left transition-colors",a?"border-amber-500 bg-amber-500/5":"border-border hover:border-amber-500/50 hover:bg-muted/40"),children:[e.jsx(E,{checked:a,className:"mt-0.5 pointer-events-none"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-foreground",children:r}),(s==="flooring_contractor"||s==="flooring_retailer")&&e.jsx("div",{className:"mt-1 text-xs text-amber-600 dar
1k:text-amber-400",children:"Note: Standard installation/retail work generally does not qualify. Activities must involve genuine technical uncertainty."})]})]},s)})})]}),n===3&&e.jsxs(e.Fragment,{children:[e.jsxs(u,{children:[e.jsx(p,{children:"R&D tracks"}),e.jsx(g,{children:"A track is a distinct category of R&D within your entity. Add at least one."})]}),e.jsxs(j,{className:"space-y-4",children:[d.length>0&&e.jsx("div",{className:"space-y-2",children:d.map((s,r)=>e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border bg-muted/30 p-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-foreground",children:s.name}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[A[s.track_type]," · ",s.is_michigan_based?"Michigan-based":"Non-Michigan"]})]}),e.jsx(o,{variant:"ghost",size:"sm",onClick:()=>X(a=>a.filter((x,c)=>c!==r)),children:"Remove"})]},r))}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-dashed border-border p-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Track name"}),e.jsx(l,{placeholder:"e.g. Product R&D",value:C,onChange:s=>Y(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Track type"}),e.jsxs(T,{value:q,onValueChange:s=>de(s),children:[e.jsx(R,{children:e.jsx(w,{})}),e.jsx(M,{children:Object.entries(A).map(([s,r])=>e.jsx(F,{value:s,children:r},s))})]})]})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx(E,{checked:U,onCheckedChange:s=>me(s===!0)}),"Conducted in Michigan (required for Michigan credit eligibility)"]}),e.jsx(o,{onClick:ge,variant:"secondary",size:"sm",children:"Add track"})]})]})]}),n===4&&e.jsxs(e.Fragment,{children:[e.jsxs(u,{children:[e.jsx(p,{children:"Team members (optional)"}),e.jsx(g,{children:"Add the people who will log time or be tracked as QRE participants. You can add more later."})]}),e.jsxs(j,{className:"space-y-4",children:[h.length>0&&e.jsx("div",{className:"space-y-2",children:h.map((s,r)=>e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border bg-muted/30 p-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-foreground",children:s.full_name}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[B[s.role],s.is_officer&&" · Officer",s.email&&` · ${s.email}`]})]}),e.jsx(o,{variant:"ghost",size:"sm",onClick:()=>V(a=>a.filter((x,c)=>c!==r)),children:"Remove"})]},r))}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-dashed border-border p-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Full legal name"}),e.jsx(l,{placeholder:"As shown on W-2",value:_,onChange:s=>z(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Email"}),e.jsx(l,{type:"email",placeholder:"optional",value:$,onChange:s=>H(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Role"}),e.jsxs(T,{value:K,onValueChange:s=>he(s),children:[e.jsx(R,{children:e.jsx(w,{})}),e.jsx(M,{children:Object.entries(B).map(([s,r])=>e.jsx(F,{value:s,children:r},s))})]})]}),e.jsx("div",{className:"flex items-end",children:e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx(E,{checked:Q,onCheckedChange:s=>W(s===!0)}),"Is an officer (Form 6765 Section E)"]})})]}),e.jsx(o,{onClick:je,variant:"secondary",size:"sm",children:"Add team member"})]})]})]}),n===5&&e.jsxs(e.Fragment,{children:[e.jsxs(u,{children:[e.jsx(p,{children:"Review & finish"}),e.jsx(g,{children:"Confirm your setup. You can change anything later in Settings."})]}),e.jsxs(j,{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Entity"}),e.jsx("div",{className:"font-medium text-foreground",children:f||"—"}),e.jsxs("div",{className:"text-muted-foreground",children:[J[y]," · ",b||"—"," · ",N||0," employees"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Business types"}),e.jsx("div",{className:"font-medium text-foreground",children:m.length===0?"—":m.map(s=>G[s]).join(", ")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:["Tracks (",d.length,")"]}),e.jsx("ul",{className:"mt-1 list-inside list-disc text-foreground",children:d.map((s,r)=>e.jsxs("li",{children:[s.name," ",e.jsxs("span",{className:"text-muted-foreground",children:["(",A[s.track_type],")"]})]},r))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:["Team (",h.length,")"]}),e.jsx("ul",{className:"mt-1 list-inside list-disc text-foreground",children:h.map((s,r)=>e.jsxs("li",{children:[s.full_name," ",e.jsxs("span",{className:"text-muted-foreground",children:["(",B[s.role],")"]})]},r))})]})]})]}),e.jsxs(Ee,{className:"flex justify-between border-t border-border pt-4",children:[e.jsxs(o,{variant:"ghost",onClick:()=>D(s=>Math.max(1,s-1)),disabled:n===1,children:[e.jsx(Ae,{className:"mr-1 h-4 w-4"})," Back"]}),n<5?e.jsxs(o,{onClick:()=>D(s=>s+1),disabled:!fe(),children:["Next ",e.jsx(Te,{className:"ml-1 h-4 w-4"})]}):e.jsx(o,{onClick:ve,disabled:S.isPending,children:S.isPending?"Creating...":"Finish setup"})]})]})]})}export{ze 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.