PageSourceSearch

https://kapwork.com/app/assets/Projects-BT4QO1hE.js

js kapwork.com collected 2026-10-08 10:31:04 UTC 9,678 bytes, 3 lines download raw bytes

1import{g as B,u as W,p as e,X as z,L as P}from"./posthogConfig-lBZGbLih.js";import{U as I,V,e as F,W as Y,a as X,u as H,X as _,Y as J,Z as K,f as C,m as L,l as Q,i as U,_ as Z,w as ee,D as O,P as te,Q as se,$ as ae,T as re,G as D,v as ne,a0 as oe,a1 as le}from"./index-K0ZKRV1W.js";import{F as ie,S as ce,R as de,P as me}from"./FindTabs-D7OV1jbP.js";import{r as xe,T as he,S as x,c as $,a as pe,b as i,n as ue}from"./sort-BEN2hc4F.js";import{S as je,P as ge}from"./PageFooter-CGPZSkky.js";import{S as fe}from"./ShareButton-S5kZ6aE6.js";import{S as be}from"./search-zBuu6agt.js";import{D as we}from"./download-BIy2Q7VO.js";import"./user-round-DcZpLtGl.js";import"./map-L8SVNhRy.js";import"./package-YJEbt7v2.js";import"./circle-question-mark-DfK9VQif.js";import"./trash-2-B76Frt_2.js";import"./WorkspacePageHeader-CFyCS42D.js";import"./UnlockPanel-BCRqhKoi.js";import"./arrow-up-YMFKS8Cg.js";import"./external-link-BfGO6LJ3.js";import"./share-2-Dfi28N9Q.js";function ve(s){const r=String(s??"");return`"${(/^[\s]*[=+@-]/.test(r)&&typeof s!="number"?`'${r}`:r).replace(/"/g,'""')}"`}function Se(s){return[["Project","State","Subgrantee","Award status","Awarded dollars","Planned locations"],...s.map(r=>[r.code,r.state,r.subgrantee,I[V(r)],r.awarded,r.locations_planned])].map(r=>r.map(ve).join(",")).join(`\r
2`)+`\r
3`}function Ne(s,r){const b=new Blob([r],{type:"text/csv;charset=utf-8"}),p=URL.createObjectURL(b),c=document.createElement("a");c.href=p,c.download=s,document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(p)}const v=50,ke=new Set(["code","state","status","awarded","locations","start","end"]),Ae=new Set(["awarded","locations","start","end"]),Pe={col:"awarded",dir:"desc"},Ce=[0,[],{states:{},statuses:{},techs:{}},null,[]];function Ve(){const[s,r]=B(),b=W(),p=F(()=>ne(),[]),c=p.data??[],y=s.get("firm"),S=parseFloat(s.get("min")??""),N=parseFloat(s.get("max")??""),a={state:s.get("state")??void 0,status:Y(s.get("status")),tech:s.get("tech")??void 0,search:s.get("q")??void 0,firmId:y?parseInt(y,10):void 0,minAwarded:isFinite(S)&&S>0?S:void 0,maxAwarded:isFinite(N)&&N>0?N:void 0},h=Math.max(1,parseInt(s.get("page")??"1",10)),n=xe(s,Pe,ke),u=F(async()=>{const[t,l]=await Promise.all([oe(a,n,h,v),a.firmId?le(a.firmId):Promise.resolve(null)]);return[t.total,t.rows,t.facets,l,t.allRows]},[s]),k=u.data,[j,A,g,f,R]=k??Ce,w=X()==="lite",M=H(),d=(t,l)=>{const o=new URLSearchParams(s);l?o.set(t,l):o.delete(t),t!=="page"&&o.delete("page"),r(o)},T=["state","status","tech","q","firm","min","max"],q=T.some(t=>!!s.get(t)),G=()=>{const t=new URLSearchParams(s);for(const l of T)t.delete(l);t.delete("page"),r(t)},E=q?e.jsx("button",{type:"button",onClick:G,className:"kw-btn kw-btn-ghost h-11 px-4 text-sm",children:"Clear filters"}):void 0,m=t=>{const l=ue(n,t,Ae),o=new URLSearchParams(s);o.set("sort",l.col),o.set("dir",l.dir),o.delete("page"),r(o)};return e.jsxs("div",{className:"space-y-5",children:[e.jsx(ie,{title:"BEAD awards",subtitle:f?`Awarded builds for ${f.name}.`:"Awarded broadband projects by state, technology and stage.",gate:"projects"}),e.jsx("section",{"aria-label":"Filters",className:"find-filters lg-card p-3 sm:p-4",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("label",{className:"relative block w-full md:w-72",children:[e.jsx(be,{size:16,"aria-hidden":"true",className:"pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-sec"}),e.jsx("input",{type:"search","aria-label":"Project name or code",value:a.search??"",onChange:t=>d("q",t.target.value||null),placeholder:"Project name or code",className:"kw-input h-11 pl-10 font-mono placeholder:font-sans sm:text-sm"})]}),e.jsxs(_,{"aria-label":"State or territory",value:a.state??"",onChange:t=>d("state",t.target.value||null),locked:w,title:w?"Michigan is open. A free account opens all 56 states.":void 0,children:[e.jsx("option",{value:"",children:"All states"}),c.filter(t=>(g.states[t.code]??0)>0||t.code===a.state).map(t=>e.jsxs("option",{value:t.code,children:[t.name," (",g.states[t.code]??0,")"]},t.code))]}),e.jsxs(_,{"aria-label":"Technology",value:a.tech??"",onChange:t=>d("tech",t.target.value||null),children:[e.jsx("option",{value:"",children:"All technologies"}
3),Object.keys(J).filter(t=>(g.techs[t]??0)>0||t===a.tech).map(t=>e.jsxs("option",{value:t,children:[t," (",g.techs[t]??0,")"]},t))]}),K.map(t=>{const l=g.statuses[t]??0,o=a.status===t;return e.jsxs("button",{onClick:()=>d("status",o?null:t),"aria-pressed":o,disabled:l===0&&!o,className:"kw-chip",children:[I[t]," ",e.jsx("span",{className:"font-mono",children:l})]},t)}),(a.minAwarded||a.maxAwarded)&&e.jsxs("button",{onClick:()=>{const t=new URLSearchParams(s);t.delete("min"),t.delete("max"),t.delete("page"),r(t)},className:"kw-chip","data-active":"true",title:"Clear amount filter",children:[a.minAwarded?`over ${C(a.minAwarded)}`:"",a.minAwarded&&a.maxAwarded?" · ":"",a.maxAwarded?`under ${C(a.maxAwarded)}`:""," ✕"]}),E]})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[k!==void 0&&e.jsxs("p",{className:"text-sm text-sec",children:[L(j)," matching ",j===1?"project":"projects",w?" · Michigan preview":" · full edition"]}),e.jsx(Q,{chip:!0}),e.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[e.jsx(ce,{variant:"link"}),!U()&&e.jsx("span",{"aria-hidden":"true",className:"text-[13px] text-sec",children:"·"}),e.jsx(fe,{variant:"link"}),M&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",className:"text-[13px] text-sec",children:"·"}),e.jsxs("button",{disabled:u.loading||!!u.error||!R.length,className:"inline-flex min-h-11 items-center gap-1 text-[13px] text-sec hover:text-ink hover:underline disabled:pointer-events-none disabled:text-mut",onClick:()=>{Ne("bead-awards.csv",Se(R))},children:[e.jsx(we,{size:14,"aria-hidden":"true"})," Export CSV"]})]})]})]}),e.jsx("p",{className:"text-xs text-sec",children:Z}),f&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full bg-wash-purple px-3 py-1 font-medium text-kw-purple",children:[f.name,a.state?` · ${a.state}`:"",e.jsx("button",{onClick:()=>d("firm",null),className:"inline-flex h-11 w-11 items-center justify-center rounded-full text-kw-purple hover:bg-kw-purple/10 focus-visible:outline-2 focus-visible:outline-kw-purple","aria-label":"Clear company filter",title:"Clear company filter",children:e.jsx(z,{size:14,strokeWidth:2.5,"aria-hidden":"true"})})]}),e.jsx(P,{to:ee(f),className:"font-medium text-kw-purple hover:underline",children:"Company profile"})]}),e.jsx(O,{request:u}),e.jsx(O,{request:p,subject:"state filters"}),k===void 0?u.error?null:e.jsx(te,{label:"Loading projects…",contentOnly:!0}):A.length===0?e.jsx(se,{message:w&&!U()?`No projects match. Try a different search or clear your filters. Michigan is open. ${ae}`:"No projects match. Try a different search or clear your filters.",action:E}):e.jsxs(e.Fragment,{children:[e.jsx(de,{kind:"work",col:n.col,dir:n.dir}),e.jsx(me,{rows:A}),e.jsxs(he,{className:"hidden md:block",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(x,{label:"Project",col:"code",sort:n.col,dir:n.dir,onSort:m}),e.jsx($,{children:"Subgrantee"}),e.jsx(x,{label:"State",col:"state",sort:n.col,dir:n.dir,onSort:m}),e.jsx(x,{label:"Status",col:"status",sort:n.col,dir:n.dir,onSort:m}),e.jsx($,{children:"Technology"}),e.jsx(x,{label:"Awarded",col:"awarded",sort:n.col,dir:n.dir,onSort:m,align:"right"}),e.jsx(x,{label:"Locations",col:"locations",sort:n.col,dir:n.dir,onSort:m,align:"right"}),e.jsx(x,{label:"Start",col:"start",sort:n.col,dir:n.dir,onSort:m,align:"right"}),e.jsx(x,{label:"End",col:"end",sort:n.col,dir:n.dir,onSort:m,align:"right"})]})}),e.jsx("tbody",{children:A.map(t=>{const l=t.techs?JSON.parse(t.techs):[];return e.jsxs(pe,{onClick:()=>b(`/bead/records/projects/${t.project_id}`),children:[e.jsx(i,{className:"font-mono text-xs font-medium text-ink",children:e.jsx(P,{to:`/bead/records/projects/${t.project_id}`,onClick:o=>o.stopPropagation(),className:"hover:text-kw-purple hover:underline",children:t.code})}),e.jsxs(i,{className:"max-w-[18rem]",children:[e.jsx("span",{className:"block truncate",title:t.subgrantee??void 0,children:t.subgrantee??"Unreported"}),(t.subgrantee_n??0)>1&&e.jsxs("span",{className:"text-xs text-sec",children:["+",(t.subgrantee_n??1)-1," more"]})]}),e.jsx(i,{children:t.state}),e.jsx(i,{children:e.jsx(je,{pill:re(t)})}),e.jsx(i,{className:"text-xs",children:l.slice(0,2).map(o=>o.tech).join(", ")||","}),e.jsx(i,{className:"text-right font-mono",children:C(t.awarded)}),e.jsx(i,{className:"text-right font-mono",children:t.locations_planned?L(t.locations_planned):"Unreported"}),e.jsx(i,{className:"text-right font-mono",children:D(t.start)}),e.jsx(i,{className:"text-right font-mono",children:D(t.end)})]},t.project_id)})})]})]}),j>v&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("span",{className:"text-sec",children:["Page ",h," of ",Math.
3ceil(j/v)]}),e.jsxs("div",{className:"flex gap-2",children:[h>1&&e.jsx("button",{onClick:()=>d("page",String(h-1)),className:"kw-btn kw-btn-ghost h-11 px-4 text-sm",children:"Previous"}),h*v<j&&e.jsx("button",{onClick:()=>d("page",String(h+1)),className:"kw-btn kw-btn-ghost h-11 px-4 text-sm",children:"Next"})]})]}),a.state&&e.jsxs(P,{to:`/bead/states/${a.state}`,className:"inline-block text-sm font-medium text-kw-purple hover:underline",children:["Back to ",a.state," overview"]}),e.jsx(ge,{terms:["awarded","locations","code","tech","project_status","churn","vintage"]})]})}export{Ve as Projects};

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.