PageSourceSearch

https://deliverimates-production.up.railway.app/assets/OpsLayout-CFCtCRvp.js

js deliverimates-production.up.railway.app collected 2026-10-03 12:13:35 UTC 10,444 bytes, 1 lines download raw bytes

1import{r,j as e,J as y,M as w,N as S,a as p,c4 as E,E as C,u as O,ba as D,X as A,cN as _,bd as g,aJ as L,be as P,cD as I,d2 as v}from"./index-Db4qfLtJ.js";import{a as T,b as R}from"./use-ops-console-CokN9iVW.js";import{u as $}from"./use-server-environment-CPUIoBYS.js";import{I as B,A as F}from"./overlays-DOpP7ZKe.js";import{u as M}from"./use-admin-companies-BVcqu1QY.js";import{S as J}from"./channels-D__5dkZ8.js";import{f as K}from"./format-Dq8rYvSD.js";const U=[{kind:"page",label:"Inbox",hint:"everything that needs a human",href:"/admin/ops"},{kind:"page",label:"DSPs",hint:"list · pipeline · channels",href:"/admin/ops/dsps"},{kind:"page",label:"Executor",hint:"the shared hosted worker",href:"/admin/ops/executor"},{kind:"page",label:"Rollouts",hint:"flag × DSP",href:"/admin/ops/rollouts"},{kind:"page",label:"Environments",hint:"prod ↔ staging",href:"/admin/ops/environments"},{kind:"page",label:"Analytics",hint:"adoption and module activity",href:"/admin/ops/analytics"},{kind:"page",label:"SMS compliance",hint:"kept as-is",href:"/admin/sms-compliance"},{kind:"page",label:"Forecast accuracy",hint:"kept as-is",href:"/admin/forecast-accuracy"},{kind:"page",label:"Team",hint:"kept as-is",href:"/admin/users"}];function V({open:s,onOpenChange:i,onNavigate:n}){const[x,d]=r.useState(""),o=r.useId(),{data:c,isPending:f,isError:u}=M({enabled:s}),t=r.useMemo(()=>{const a=(c||[]).map(m=>({kind:"dsp",label:m.name,hint:m.short_code||"no short code",href:`/admin/ops/dsps/${m.id}`})),b=Object.entries(J).map(([m,k])=>({kind:"channel",label:k,hint:m,href:`/admin/ops/dsps?view=channels&channel=${m}`}));return[...a,...b,...U]},[c]),l=x.trim().toLowerCase(),h=l?t.filter(a=>`${a.label} ${a.hint}`.toLowerCase().includes(l)).slice(0,8):t.filter(a=>a.kind==="page").slice(0,6);return e.jsx(y,{open:s,onOpenChange:i,children:e.jsxs(B,{"aria-describedby":o,className:"max-w-xl",children:[e.jsxs("div",{children:[e.jsx(w,{className:"text-s2 text-ink",children:"Jump"}),e.jsx(S,{id:o,className:"mt-1 text-s4 font-normal text-subtle",children:"A DSP opens its hub · a channel opens the Channels grid · Enter takes the first match."})]}),e.jsx("form",{onSubmit:a=>{a.preventDefault(),h[0]&&n(h[0].href)},children:e.jsx("input",{autoFocus:!0,value:x,onChange:a=>d(a.target.value),placeholder:"pono · rescue_poll · rollouts…","aria-label":"Search DSPs, channels and pages",className:"w-full rounded-[9px] border border-hairline bg-surface px-2.5 py-2 font-ink-mono text-m2 text-ink"})}),e.jsxs("div",{className:"max-h-72 overflow-y-auto",children:[u&&e.jsx("p",{className:"px-1 py-2 text-s4 font-normal text-danger-deep",children:"The DSP list failed to load — channels and pages below are still searchable, but tenants are missing from these results."}),f&&!u&&e.jsx("p",{className:"px-1 py-2 text-s4 font-normal text-subtle",children:"Loading tenants — channels and pages are searchable now."}),h.length===0?e.jsxs("p",{className:"px-1 py-3 text-s3 text-subtle",children:["Nothing matches ",e.jsx("span",{className:"font-ink-mono text-m2",children:x}),". This searches DSPs, channels and pages — not incidents by id."]}):e.jsx("ul",{children:h.map((a,b)=>e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>n(a.href),className:p("flex w-full min-h-11 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left hover:bg-sunk","focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ink",b===0&&l&&"bg-sunk"),children:[e.jsx("span",{className:"w-16 flex-none font-ink-mono text-m3 uppercase text-faint",children:a.kind}),e.jsx("span",{className:"min-w-0 flex-1 text-s3 text-ink",children:a.label}),e.jsx("span",{className:"font-ink-mono text-m2 text-subtle",children:a.hint})]})},`${a.kind}:${a.href}`))})]}),e.jsx("div",{className:"flex justify-end gap-2.5",children:e.jsx(E,{asChild:!0,children:e.jsx(F,{variant:"default",children:"Close"})})})]})})}const G=[{to:"/admin/ops",label:"Inbox",end:!0,badge:"inbox"},{to:"/admin/ops/dsps",label:"DSPs",end:!1,badge:"tenants"}],q=[{to:"/admin/ops/hosted-sync",label:"Hosted Sync",external:!1},{to:"/admin/ops/executor",label:"Executor",external:!1},{to:"/admin/ops/rollouts",label:"Rollouts",external:!1},{to:"/admin/ops/environments",label:"Environments",external:!1},{to:"/admin/ops/analytics",label:"Analytics",external:!1},{to:"/admin/sms-compliance",label:"SMS compliance",external:!0},{to:"/admin/sms-health",label:"SMS health",external:!0},{to:"/admin/forecast-accuracy",label:"Forecast accuracy",external:!0},{to:"/admin/users",label:"Team",external:!0}];function z(){r.useEffect(()=>{const s=I()==="v2";return v(!0),()=>v(s)},[])}function H(){const s=$(),i=s.state==="production"?"border-[#5A2B26] text-[#FCA9A4]":s.state==="non_production"?"border-rail-edge text-rail-text":"border-rail-edge text-rail-label",n=s.state==="production"?(s.env??"production").toUpperCase():s.state==="non_production"?(s.env??"").toUpperCase():s.state==="unreachable"?"ENV UNREADABLE":"ENV UNKNOWN";return e.jsx("span",{className:p("mx-2.5 mb-2 inline-flex self-start rounded-[5px] border px-1.5 py-0.5 font-ink-mono text-m3 font-medium",i),title:s.isResolved?`Asserted by GET /health · env=${s.env}`:"GET /health has not answered — gated as non-production until it does",children:n})}function j({count:s,tone:i}){return s===null?e.jsx("span",{className:"ml-auto rounded-full bg-rail-hover px-1.5 py-px font-ink-mono text-m2 text-rail-label",children:"—"}):e.jsx("span",{className:p("ml-auto rounded-full px-1.5 py-px font-ink-mono text-m2 font-medium",i==="alarm"&&s>0?"bg-danger-tint text-danger-deep":"bg-rail-hover text-rail-text"),children:s})}function N(s){return p("flex min-h-11 items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-s3 font-medium text-rail-text","hover:bg-rail-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-rail-active",s&&"bg-rail-hover font-semibold text-rail-active shadow-[inset_2px_0_0_theme(colors.rail.active)]")}function ne(){z();const{actNow:s,tenants:i}=T(),{data:n}
1=C(),[x,d]=r.useState(!1),[o,c]=r.useState(!1),f=O(),u=D();return r.useEffect(()=>{function t(l){(l.metaKey||l.ctrlKey)&&l.key.toLowerCase()==="k"&&(l.preventDefault(),d(!0))}return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),e.jsxs("div",{"data-testid":"ops-shell",className:"grid min-h-screen grid-cols-1 bg-paper text-ink md:grid-cols-[232px_1fr]",children:[e.jsxs("nav",{"aria-label":"Sortd Ops navigation",className:"relative top-0 z-30 flex h-auto flex-col gap-0.5 overflow-y-auto bg-rail px-2.5 py-2.5 md:sticky md:h-screen md:pb-3 md:pt-3.5",children:[e.jsxs("div",{className:"flex min-h-11 items-center gap-2 px-2.5 text-s2 font-bold text-rail-active md:min-h-0 md:pb-2.5 md:pt-1",children:[e.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-[7px] bg-paper text-s4 font-bold text-ink",children:"S"}),"Sortd Ops",e.jsx("button",{type:"button","aria-label":`${o?"Close":"Open"} Sortd Ops navigation`,"aria-expanded":o,onClick:()=>c(t=>!t),className:"ml-auto flex h-9 w-9 items-center justify-center rounded-lg text-rail-text hover:bg-rail-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-rail-active md:hidden",children:o?e.jsx(A,{className:"h-4 w-4","aria-hidden":!0}):e.jsx(_,{className:"h-4 w-4","aria-hidden":!0})})]}),e.jsxs("div",{"data-testid":"ops-rail-links",className:p("min-h-0 flex-1 flex-col",o?"flex":"hidden","md:flex"),children:[e.jsx(H,{}),e.jsx("div",{className:"mt-2.5 flex flex-col gap-0.5",children:G.map(t=>e.jsxs(g,{to:t.to,end:t.end,onClick:()=>c(!1),className:({isActive:l})=>N(l),children:[t.label,t.badge==="inbox"?e.jsx(j,{count:s,tone:"alarm"}):e.jsx(j,{count:i,tone:"neutral"})]},t.to))}),e.jsx("div",{className:"mt-3 px-2.5 pb-1 font-ink-mono text-m3 font-semibold uppercase text-rail-label",children:"Platform"}),e.jsx("div",{className:"flex flex-col gap-0.5",children:q.map(t=>e.jsxs(g,{to:t.to,onClick:()=>c(!1),className:({isActive:l})=>N(l&&!t.external),title:t.external?"Kept as-is — opens the existing admin page":void 0,children:[t.label,t.external&&e.jsx("span",{className:"ml-auto font-ink-mono text-m3 text-rail-label","aria-hidden":!0,children:"↗"})]},t.to))}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"mt-2 flex items-center gap-2 border-t border-rail-edge px-2.5 pb-0.5 pt-2.5 text-s4 font-normal text-rail-text",children:[e.jsx("b",{className:"font-semibold text-rail-active",children:n?.fullName||n?.email||"Signed in"}),e.jsxs("span",{className:"font-ink-mono text-m2",children:["· ",n?.role||"super_admin"]})]})]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"sticky top-0 z-20 flex items-center gap-2.5 border-b border-hairline bg-paper px-4 py-2.5 md:pl-7 md:pr-8",children:[e.jsx(Q,{}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex min-h-11 min-w-0 max-w-full flex-1 items-center gap-2 overflow-hidden rounded-[9px] border border-hairline bg-surface px-3 py-1.5 text-s3 text-faint hover:bg-sunk focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ink sm:min-w-60 sm:flex-none",children:[e.jsx(L,{className:"h-3.5 w-3.5","aria-hidden":!0}),e.jsx("span",{className:"truncate",children:"Jump to a DSP, channel, incident…"}),e.jsx("span",{className:"ml-auto rounded-[5px] border border-hairline px-1.5 py-px font-ink-mono text-m3 text-subtle",children:"⌘K"})]})]}),e.jsx("main",{className:"max-w-[1320px] px-4 pb-20 pt-6 md:px-7",children:e.jsx(P,{})})]}),e.jsx(V,{open:x,onOpenChange:d,onNavigate:t=>{d(!1),t!==u.pathname&&f(t)}})]})}function Q(){const{data:s,isFetching:i,isError:n}=W();return n?e.jsxs("span",{className:"flex items-center gap-1.5 text-s4 font-normal text-danger-deep",children:[e.jsx("span",{className:"h-[7px] w-[7px] rounded-full bg-danger-solid","aria-hidden":!0}),"board read failed"]}):e.jsxs("span",{className:"flex items-center gap-1.5 text-s4 font-normal text-subtle",children:[e.jsx("span",{className:p("h-[7px] w-[7px] rounded-full",i?"bg-warning-solid":"bg-success-solid"),"aria-hidden":!0}),s?"board loaded":"loading board",s&&e.jsx("span",{className:"font-ink-mono text-m2",children:K(s)})]})}function W(){const{data:s,isFetching:i,isError:n}=R();return{data:s?.as_of??null,isFetching:i,isError:n}}export{ne 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.