oneshot-gtm-server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/bin.mjs +6915 -0
  2. package/dist/bin.mjs.map +1 -0
  3. package/dist/web/assets/Button-DPVQuma9.js +2 -0
  4. package/dist/web/assets/Button-DPVQuma9.js.map +1 -0
  5. package/dist/web/assets/EmptyNote-C4quX2dg.js +2 -0
  6. package/dist/web/assets/EmptyNote-C4quX2dg.js.map +1 -0
  7. package/dist/web/assets/Field-D9WpcA8z.js +2 -0
  8. package/dist/web/assets/Field-D9WpcA8z.js.map +1 -0
  9. package/dist/web/assets/Modal-BVbdN0gj.js +2 -0
  10. package/dist/web/assets/Modal-BVbdN0gj.js.map +1 -0
  11. package/dist/web/assets/Skeleton-D7Z-VTMo.js +2 -0
  12. package/dist/web/assets/Skeleton-D7Z-VTMo.js.map +1 -0
  13. package/dist/web/assets/cadences-B8mwchUk.js +2 -0
  14. package/dist/web/assets/cadences-B8mwchUk.js.map +1 -0
  15. package/dist/web/assets/host-grotesk-latin-ext-wght-normal-B8jkyusk.woff2 +0 -0
  16. package/dist/web/assets/host-grotesk-latin-wght-normal-CBa0fl4q.woff2 +0 -0
  17. package/dist/web/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  18. package/dist/web/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  19. package/dist/web/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  20. package/dist/web/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  21. package/dist/web/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
  22. package/dist/web/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
  23. package/dist/web/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  24. package/dist/web/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  25. package/dist/web/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  26. package/dist/web/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  27. package/dist/web/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
  28. package/dist/web/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
  29. package/dist/web/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  30. package/dist/web/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  31. package/dist/web/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  32. package/dist/web/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  33. package/dist/web/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  34. package/dist/web/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
  35. package/dist/web/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  36. package/dist/web/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  37. package/dist/web/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  38. package/dist/web/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  39. package/dist/web/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
  40. package/dist/web/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
  41. package/dist/web/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  42. package/dist/web/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  43. package/dist/web/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  44. package/dist/web/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  45. package/dist/web/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
  46. package/dist/web/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
  47. package/dist/web/assets/ibm-plex-sans-cyrillic-400-normal-BTotfTJu.woff +0 -0
  48. package/dist/web/assets/ibm-plex-sans-cyrillic-400-normal-DZqxrq2p.woff2 +0 -0
  49. package/dist/web/assets/ibm-plex-sans-cyrillic-500-normal-ByOcLdNv.woff +0 -0
  50. package/dist/web/assets/ibm-plex-sans-cyrillic-500-normal-CocWQlwt.woff2 +0 -0
  51. package/dist/web/assets/ibm-plex-sans-cyrillic-600-normal-71GNu3SW.woff2 +0 -0
  52. package/dist/web/assets/ibm-plex-sans-cyrillic-600-normal-BGq0mW3O.woff +0 -0
  53. package/dist/web/assets/ibm-plex-sans-cyrillic-700-normal-D_uavGvn.woff2 +0 -0
  54. package/dist/web/assets/ibm-plex-sans-cyrillic-700-normal-RFb1v-CK.woff +0 -0
  55. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-400-normal-Dsrv2Tcn.woff +0 -0
  56. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-400-normal-g30qAdWV.woff2 +0 -0
  57. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-500-normal-Cs5J6C77.woff2 +0 -0
  58. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-500-normal-DB5PtV2g.woff +0 -0
  59. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-600-normal-Bz0x94Yp.woff +0 -0
  60. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-600-normal-DUMzJB7m.woff2 +0 -0
  61. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-700-normal-BmRLXWpJ.woff2 +0 -0
  62. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-700-normal-DCQwxkRk.woff +0 -0
  63. package/dist/web/assets/ibm-plex-sans-greek-400-normal-D9ESIMu3.woff +0 -0
  64. package/dist/web/assets/ibm-plex-sans-greek-400-normal-_efipK4i.woff2 +0 -0
  65. package/dist/web/assets/ibm-plex-sans-greek-500-normal-CuWXN6rf.woff +0 -0
  66. package/dist/web/assets/ibm-plex-sans-greek-500-normal-JMMifIXV.woff2 +0 -0
  67. package/dist/web/assets/ibm-plex-sans-greek-600-normal-D-CqTdkO.woff +0 -0
  68. package/dist/web/assets/ibm-plex-sans-greek-600-normal-DzTrcv_p.woff2 +0 -0
  69. package/dist/web/assets/ibm-plex-sans-greek-700-normal-CkZN0sRy.woff +0 -0
  70. package/dist/web/assets/ibm-plex-sans-greek-700-normal-wyJ6jzdA.woff2 +0 -0
  71. package/dist/web/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
  72. package/dist/web/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
  73. package/dist/web/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
  74. package/dist/web/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
  75. package/dist/web/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
  76. package/dist/web/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
  77. package/dist/web/assets/ibm-plex-sans-latin-700-normal-Bth3BMcD.woff +0 -0
  78. package/dist/web/assets/ibm-plex-sans-latin-700-normal-Bxkt5Cjx.woff2 +0 -0
  79. package/dist/web/assets/ibm-plex-sans-latin-ext-400-normal-C5H60-Va.woff2 +0 -0
  80. package/dist/web/assets/ibm-plex-sans-latin-ext-400-normal-RBey6euL.woff +0 -0
  81. package/dist/web/assets/ibm-plex-sans-latin-ext-500-normal-D0aIdm-b.woff +0 -0
  82. package/dist/web/assets/ibm-plex-sans-latin-ext-500-normal-DakdToA3.woff2 +0 -0
  83. package/dist/web/assets/ibm-plex-sans-latin-ext-600-normal-DIrixKbi.woff +0 -0
  84. package/dist/web/assets/ibm-plex-sans-latin-ext-600-normal-DOrvGEcy.woff2 +0 -0
  85. package/dist/web/assets/ibm-plex-sans-latin-ext-700-normal-DZH6Xh-4.woff +0 -0
  86. package/dist/web/assets/ibm-plex-sans-latin-ext-700-normal-aMgXseD4.woff2 +0 -0
  87. package/dist/web/assets/ibm-plex-sans-vietnamese-400-normal-DG4YqDda.woff2 +0 -0
  88. package/dist/web/assets/ibm-plex-sans-vietnamese-400-normal-fK1oJ5dG.woff +0 -0
  89. package/dist/web/assets/ibm-plex-sans-vietnamese-500-normal-BEb3_waV.woff +0 -0
  90. package/dist/web/assets/ibm-plex-sans-vietnamese-500-normal-e4dixQRQ.woff2 +0 -0
  91. package/dist/web/assets/ibm-plex-sans-vietnamese-600-normal-DgdngZtN.woff +0 -0
  92. package/dist/web/assets/ibm-plex-sans-vietnamese-600-normal-DpPYBSTl.woff2 +0 -0
  93. package/dist/web/assets/ibm-plex-sans-vietnamese-700-normal-BV5B8Are.woff +0 -0
  94. package/dist/web/assets/ibm-plex-sans-vietnamese-700-normal-CkEo6LDy.woff2 +0 -0
  95. package/dist/web/assets/index-DkobhtBa.js +60 -0
  96. package/dist/web/assets/index-DkobhtBa.js.map +1 -0
  97. package/dist/web/assets/index-Dovjfyuq.css +2 -0
  98. package/dist/web/assets/measure-DLFAK1ZQ.js +2 -0
  99. package/dist/web/assets/measure-DLFAK1ZQ.js.map +1 -0
  100. package/dist/web/assets/plays-BUfo3QKZ.js +2 -0
  101. package/dist/web/assets/plays-BUfo3QKZ.js.map +1 -0
  102. package/dist/web/assets/queue-0mKz6GO1.js +2 -0
  103. package/dist/web/assets/queue-0mKz6GO1.js.map +1 -0
  104. package/dist/web/assets/receipts-CzIfb6zY.js +2 -0
  105. package/dist/web/assets/receipts-CzIfb6zY.js.map +1 -0
  106. package/dist/web/assets/routes-BEYqVix5.js +2 -0
  107. package/dist/web/assets/routes-BEYqVix5.js.map +1 -0
  108. package/dist/web/assets/run._playName-CJIjxoPb.js +5 -0
  109. package/dist/web/assets/run._playName-CJIjxoPb.js.map +1 -0
  110. package/dist/web/assets/setup-CFmdIoj0.js +2 -0
  111. package/dist/web/assets/setup-CFmdIoj0.js.map +1 -0
  112. package/dist/web/index.html +14 -0
  113. package/package.json +46 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-0mKz6GO1.js","names":["__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","useMutation","useQuery","useQueryClient","Link","Check","ChevronDown","ChevronRight","Loader2","Pencil","Play","Send","Target","X","useEffect","useRef","useState","toast","api","Badge","Button","EmptyNote","Field","Input","Textarea","Modal","SkeletonRow","Toggle","cn","timeAgo","buildSignalDays","clearTriggerRunning","hasAnyRunningTrigger","humanDuration","markTriggerRunning","useRunningTriggers","STATUSES","Array","QueueStatusView","DRAINABLE_PLAYS","statusTone","status","RejectModalState","id","email","DrainModalState","playName","approvedCount","EditingState","name","text","defaultConfig","Record","QueuePage","qc","statusFilter","setStatusFilter","playFilter","setPlayFilter","expanded","setExpanded","selected","setSelected","Set","rejectModal","setRejectModal","rejectReason","setRejectReason","drainModal","setDrainModal","drainLimit","setDrainLimit","drainSenderCohort","setDrainSenderCohort","drainOffer","setDrainOffer","drainDryRun","setDrainDryRun","queueQuery","queryKey","queryFn","queue","play","limit","refetchInterval","invalidate","invalidateQueries","approve","mutationFn","approveQueue","onSuccess","onError","err","error","message","reject","vars","reason","rejectQueue","approveAll","approveAllQueue","data","success","approved","bulkApprove","ids","ok","total","length","bulkReject","drain","Error","drainQueue","dryRun","senderCohort","freeForCohortOffer","counts","pending","rejected","sent","expired","rows","playList","from","map","r","toSorted","someSelected","size","allSelected","fontFamily","fontSize","fontWeight","letterSpacing","lineHeight","Object","entries","k","v","join","s","p","isPending","mutate","undefined","some","filter","isLoading","_","i","el","indeterminate","e","target","checked","row","has","prev","next","delete","add","emailFor","payload","value","Math","max","Number","parseInt","isError","drained","errors","QueueRow","zebra","anySelected","onToggleSelect","onToggle","onApprove","onReject","busy","QueueRowView","nameFor","company","companyFor","linkedinUrl","linkedinUrlFor","phone","phoneFor","stopPropagation","source","foundAt","notes","JSON","stringify","SignalStrip","days","d","count","reduce","a","h","round","label","height","TriggersCard","triggersQuery","triggers","query","state","t","running","setEnabled","enabled","setTriggerEnabled","setConfig","config","setTriggerConfig","setEditing","runTrigger","description","result","parts","candidates","enqueued","droppedIcp","droppedDuplicate","droppedEnrichment","costUsd","toFixed","halted","Boolean","includes","info","editing","editError","setEditError","runningKey","prevRunningRef","current","prevNames","split","nowNames","stillRunning","n","lastPolledByName","Map","lastPolledAt","serverRunningSinceByName","runningSince","runningByName","summary","summarizeRun","lastRunSummary","inProcess","variables","tracked","get","elapsedMs","isEditing","parsed","parse","TriggerRowProps","trigger","TriggerView","onToggleEnabled","onRun","onStartEdit","onCancelEdit","onChangeEditText","onResetDefaults","onSaveEdit","setEnabledPending","setConfigPending","TriggerRowFragment","props","notReady","ready","notReadyReason","toggleDisabled","runDisabled","humanInterval","intervalMs","defaultIntervalMs","IcpBanner","setupQuery","setupStatus","icp","cfg","icpOneLiner","trim","color","EmptyQueueHelp","filterActive","slice","push","ms","hours","repoUrl","m","match","postUrl","host","URL","hostname","replace","test","component"],"sources":["../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/chevron-down.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/chevron-right.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/loader-circle.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/pencil.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/send.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/target.mjs","../../src/lib/signalDays.ts","../../src/lib/triggerRunState.ts","../../src/routes/queue.tsx?tsr-split=component"],"sourcesContent":["/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]];\nconst ChevronDown = createLucideIcon(\"chevron-down\", __iconNode);\n\nexport { __iconNode, ChevronDown as default };\n//# sourceMappingURL=chevron-down.mjs.map\n","/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [[\"path\", { d: \"m9 18 6-6-6-6\", key: \"mthhwq\" }]];\nconst ChevronRight = createLucideIcon(\"chevron-right\", __iconNode);\n\nexport { __iconNode, ChevronRight as default };\n//# sourceMappingURL=chevron-right.mjs.map\n","/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [[\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]];\nconst LoaderCircle = createLucideIcon(\"loader-circle\", __iconNode);\n\nexport { __iconNode, LoaderCircle as default };\n//# sourceMappingURL=loader-circle.mjs.map\n","/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\",\n key: \"1a8usu\"\n }\n ],\n [\"path\", { d: \"m15 5 4 4\", key: \"1mk7zo\" }]\n];\nconst Pencil = createLucideIcon(\"pencil\", __iconNode);\n\nexport { __iconNode, Pencil as default };\n//# sourceMappingURL=pencil.mjs.map\n","/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\",\n key: \"1ffxy3\"\n }\n ],\n [\"path\", { d: \"m21.854 2.147-10.94 10.939\", key: \"12cjpa\" }]\n];\nconst Send = createLucideIcon(\"send\", __iconNode);\n\nexport { __iconNode, Send as default };\n//# sourceMappingURL=send.mjs.map\n","/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"6\", key: \"1vlfrh\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"2\", key: \"1c9p78\" }]\n];\nconst Target = createLucideIcon(\"target\", __iconNode);\n\nexport { __iconNode, Target as default };\n//# sourceMappingURL=target.mjs.map\n","import type { QueueRowView } from \"@oneshot-gtm/shared-types\";\n\nexport interface SignalDay {\n /** Local-formatted day label, e.g. \"Mon · Apr 21\". */\n label: string;\n count: number;\n /** ms epoch at the start of this calendar day in local time. */\n startMs: number;\n}\n\n/**\n * 7-day histogram (oldest → newest) of queue enqueues, bucketed by LOCAL\n * calendar day. Each bar's count is the number of rows whose `foundAt`\n * falls inside that day's local-midnight-to-midnight window.\n *\n * Why calendar buckets, not rolling 24h windows: the labels say \"Mon Apr 21\"\n * etc, so the bars must mean the same thing. The previous version used\n * `Math.floor((now - ts) / 24h)` which drifted — a row from yesterday at\n * 18:00 viewed at noon today (18h diff = 0.75 days = floor 0) landed in\n * the \"today\" bucket even though it's clearly yesterday by any calendar.\n *\n * `now` is injected so tests can pin time without faking Date globally.\n * Math.round on the day-diff handles DST transitions where a \"day\" is\n * 23 or 25 hours of wall-clock time but still one calendar day.\n */\nexport function buildSignalDays(rows: QueueRowView[], now: Date = new Date()): SignalDay[] {\n const todayStart = startOfLocalDay(now);\n const days: SignalDay[] = [];\n for (let i = 6; i >= 0; i--) {\n const d = new Date(todayStart);\n d.setDate(d.getDate() - i);\n days.push({\n label: d.toLocaleDateString(undefined, { weekday: \"short\", month: \"short\", day: \"numeric\" }),\n count: 0,\n startMs: d.getTime(),\n });\n }\n const cutoffMs = days[0]!.startMs;\n for (const r of rows) {\n const ts = new Date(r.foundAt);\n if (Number.isNaN(ts.getTime())) continue;\n const tsStart = startOfLocalDay(ts);\n if (tsStart.getTime() < cutoffMs) continue;\n const dayDiff = Math.round((todayStart.getTime() - tsStart.getTime()) / (24 * 3600 * 1000));\n const idx = 6 - dayDiff;\n if (idx >= 0 && idx < 7) {\n days[idx]!.count += 1;\n }\n }\n return days;\n}\n\nfunction startOfLocalDay(d: Date): Date {\n const out = new Date(d);\n out.setHours(0, 0, 0, 0);\n return out;\n}\n","import { useEffect, useState } from \"react\";\n\n/**\n * Per-trigger \"is running\" tracker persisted to localStorage, so a mid-run\n * refresh preserves the spinner. Entries are cleared when the server\n * confirms completion (lastPolledAt > startedAt and MIN_VISIBLE_MS has\n * elapsed), or when MAX_RUNTIME_MS zombie-cleans them.\n *\n * Storage: localStorage[\"oneshot-gtm:trigger-running:<name>\"] = \"<unix-ms>\"\n */\nconst KEY_PREFIX = \"oneshot-gtm:trigger-running:\";\n/**\n * Client-side zombie cleanup for the localStorage spinner marker. Set to\n * 4h to match `MAX_RUN_AGE_MS` in @oneshot-gtm/find — generous headroom\n * over realistic finder runtimes (github-topics with concurrency=3 typically\n * completes in 5-15 min; the deepResearchPerson tier sets the upper bound\n * at 2-5 min per call). The spinner shouldn't disappear mid-run on a\n * genuinely-long execution.\n */\nconst MAX_RUNTIME_MS = 4 * 60 * 60 * 1000;\n/**\n * Minimum visible duration after a click. Without this floor the\n * unconfigured-halt + ledger-only finders complete in <10ms, flipping the\n * button back to \"run now\" before the user perceives the spinner.\n */\nconst MIN_VISIBLE_MS = 1500;\n\nexport function markTriggerRunning(name: string): void {\n try {\n localStorage.setItem(KEY_PREFIX + name, String(Date.now()));\n } catch {\n // private mode / SSR — no-op\n }\n}\n\nexport function clearTriggerRunning(name: string): void {\n try {\n localStorage.removeItem(KEY_PREFIX + name);\n } catch {\n // ignore\n }\n}\n\nexport function hasAnyRunningTrigger(): boolean {\n try {\n for (let i = 0; i < localStorage.length; i++) {\n const k = localStorage.key(i);\n if (k && k.startsWith(KEY_PREFIX)) return true;\n }\n return false;\n } catch {\n return false;\n }\n}\n\nfunction readStartedAt(name: string): number | null {\n try {\n const raw = localStorage.getItem(KEY_PREFIX + name);\n if (!raw) return null;\n const n = Number.parseInt(raw, 10);\n return Number.isFinite(n) ? n : null;\n } catch {\n return null;\n }\n}\n\ninterface RunningInfo {\n startedAt: number;\n elapsedMs: number;\n}\n\n/**\n * Merge local (localStorage) + server (`runningSince` from the triggers\n * poll) start times into a per-name running map with a live-ticking\n * elapsedMs. Local wins when both are present; server fills in for fresh\n * tabs that never set a marker.\n */\nexport function useRunningTriggers(\n names: string[],\n lastPolledByName: Map<string, string | null>,\n serverRunningSinceByName: Map<string, string | null>,\n): Map<string, RunningInfo> {\n const [tick, setTick] = useState(0);\n useEffect(() => {\n const t = setInterval(() => setTick((n) => n + 1), 1000);\n return () => clearInterval(t);\n }, []);\n\n const out = new Map<string, RunningInfo>();\n const now = Date.now();\n for (const name of names) {\n const localStartedAt = readStartedAt(name);\n const serverSinceIso = serverRunningSinceByName.get(name);\n const serverStartedAt = serverSinceIso ? new Date(serverSinceIso).getTime() : null;\n const startedAt = localStartedAt ?? serverStartedAt;\n if (startedAt == null) continue;\n\n if (localStartedAt != null) {\n const polledIso = lastPolledByName.get(name);\n const polledMs = polledIso ? new Date(polledIso).getTime() : 0;\n const visibleFor = now - localStartedAt;\n if (polledMs > localStartedAt && visibleFor >= MIN_VISIBLE_MS) {\n clearTriggerRunning(name);\n if (serverStartedAt != null && serverStartedAt > polledMs) {\n out.set(name, { startedAt: serverStartedAt, elapsedMs: now - serverStartedAt });\n }\n continue;\n }\n if (visibleFor > MAX_RUNTIME_MS) {\n clearTriggerRunning(name);\n continue;\n }\n }\n\n out.set(name, { startedAt, elapsedMs: now - startedAt });\n }\n // Ref `tick` so the elapsed counter re-computes on the interval.\n void tick;\n return out;\n}\n\nexport function humanDuration(ms: number): string {\n const s = Math.floor(ms / 1000);\n if (s < 60) return `${s}s`;\n const m = Math.floor(s / 60);\n const r = s % 60;\n return `${m}m ${r}s`;\n}\n","import { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { createFileRoute, Link } from \"@tanstack/react-router\";\nimport {\n Check,\n ChevronDown,\n ChevronRight,\n Loader2,\n Pencil,\n Play,\n Send,\n Target,\n X,\n} from \"lucide-react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { toast } from \"sonner\";\nimport type { QueueRowView, QueueStatusView, TriggerView } from \"@oneshot-gtm/shared-types\";\nimport { api } from \"../api/client.ts\";\nimport { Badge } from \"../components/primitives/Badge.tsx\";\nimport { Button } from \"../components/primitives/Button.tsx\";\nimport { EmptyNote } from \"../components/primitives/EmptyNote.tsx\";\nimport { Field, Input, Textarea } from \"../components/primitives/Field.tsx\";\nimport { Modal } from \"../components/primitives/Modal.tsx\";\nimport { SkeletonRow } from \"../components/primitives/Skeleton.tsx\";\nimport { Toggle } from \"../components/primitives/Toggle.tsx\";\nimport { cn, timeAgo } from \"../lib/cn.ts\";\nimport { buildSignalDays } from \"../lib/signalDays.ts\";\nimport {\n clearTriggerRunning,\n hasAnyRunningTrigger,\n humanDuration,\n markTriggerRunning,\n useRunningTriggers,\n} from \"../lib/triggerRunState.ts\";\n\nexport const Route = createFileRoute(\"/queue\")({\n component: QueuePage,\n});\n\nconst STATUSES: Array<QueueStatusView | \"all\"> = [\n \"all\",\n \"pending\",\n \"approved\",\n \"rejected\",\n \"sent\",\n \"expired\",\n];\n\nconst DRAINABLE_PLAYS = [\n \"show-hn\",\n \"job-change\",\n \"post-funding\",\n \"accelerator-batch\",\n \"hiring-signal\",\n \"podcast-guest\",\n \"competitor-switch\",\n];\n\nfunction statusTone(\n status: QueueStatusView,\n): \"receipt\" | \"spend\" | \"blocked\" | \"signal\" | \"neutral\" {\n switch (status) {\n case \"pending\":\n return \"spend\";\n case \"approved\":\n return \"receipt\";\n case \"rejected\":\n return \"blocked\";\n case \"sent\":\n return \"signal\";\n case \"expired\":\n return \"neutral\";\n }\n}\n\ninterface RejectModalState {\n id: number;\n email: string;\n}\n\ninterface DrainModalState {\n playName: string;\n approvedCount: number;\n}\n\ninterface EditingState {\n name: string;\n text: string;\n defaultConfig: Record<string, unknown> | null;\n}\n\nfunction QueuePage() {\n const qc = useQueryClient();\n const [statusFilter, setStatusFilter] = useState<QueueStatusView | \"all\">(\"pending\");\n const [playFilter, setPlayFilter] = useState<string>(\"all\");\n const [expanded, setExpanded] = useState<number | null>(null);\n const [selected, setSelected] = useState<Set<number>>(new Set());\n const [rejectModal, setRejectModal] = useState<RejectModalState | null>(null);\n const [rejectReason, setRejectReason] = useState(\"\");\n const [drainModal, setDrainModal] = useState<DrainModalState | null>(null);\n const [drainLimit, setDrainLimit] = useState(10);\n const [drainSenderCohort, setDrainSenderCohort] = useState(\"\");\n const [drainOffer, setDrainOffer] = useState(\"\");\n const [drainDryRun, setDrainDryRun] = useState(true);\n\n const queueQuery = useQuery({\n queryKey: [\"queue\", statusFilter, playFilter],\n queryFn: () =>\n api.queue({\n ...(statusFilter !== \"all\" ? { status: statusFilter } : {}),\n ...(playFilter !== \"all\" ? { play: playFilter } : {}),\n limit: 200,\n }),\n refetchInterval: 20_000,\n });\n\n const invalidate = (): void => {\n void qc.invalidateQueries({ queryKey: [\"queue\"] });\n void qc.invalidateQueries({ queryKey: [\"home\"] });\n };\n\n const approve = useMutation({\n mutationFn: (id: number) => api.approveQueue(id),\n onSuccess: invalidate,\n onError: (err) => toast.error(`couldn't approve · ${err.message}`),\n });\n const reject = useMutation({\n mutationFn: (vars: { id: number; reason?: string }) => api.rejectQueue(vars.id, vars.reason),\n onSuccess: () => {\n setRejectModal(null);\n setRejectReason(\"\");\n invalidate();\n },\n onError: (err) => toast.error(`couldn't reject · ${err.message}`),\n });\n const approveAll = useMutation({\n mutationFn: (play?: string) => api.approveAllQueue(play),\n onSuccess: (data) => {\n invalidate();\n toast.success(`approved ${data.approved} pending`);\n },\n onError: (err) => toast.error(`couldn't approve all · ${err.message}`),\n });\n\n // Bulk selection mutations — operate over the current `selected` set.\n const bulkApprove = useMutation({\n mutationFn: async (ids: number[]) => {\n let ok = 0;\n for (const id of ids) {\n try {\n await api.approveQueue(id);\n ok++;\n } catch {\n // continue the batch; surface the count at the end\n }\n }\n return { ok, total: ids.length };\n },\n onSuccess: ({ ok, total }) => {\n setSelected(new Set());\n invalidate();\n toast.success(`approved ${ok} of ${total}`);\n },\n });\n const bulkReject = useMutation({\n mutationFn: async (ids: number[]) => {\n let ok = 0;\n for (const id of ids) {\n try {\n await api.rejectQueue(id);\n ok++;\n } catch {\n /* ignore */\n }\n }\n return { ok, total: ids.length };\n },\n onSuccess: ({ ok, total }) => {\n setSelected(new Set());\n invalidate();\n toast.success(`rejected ${ok} of ${total}`);\n },\n });\n const drain = useMutation({\n mutationFn: () => {\n if (!drainModal) throw new Error(\"no drain modal open\");\n return api.drainQueue({\n playName: drainModal.playName,\n limit: drainLimit,\n dryRun: drainDryRun,\n ...(drainSenderCohort ? { senderCohort: drainSenderCohort } : {}),\n ...(drainOffer ? { freeForCohortOffer: drainOffer } : {}),\n });\n },\n onSuccess: () => {\n setDrainModal(null);\n setDrainSenderCohort(\"\");\n setDrainOffer(\"\");\n void qc.invalidateQueries({ queryKey: [\"queue\"] });\n void qc.invalidateQueries({ queryKey: [\"receipts\"] });\n void qc.invalidateQueries({ queryKey: [\"cadences\"] });\n void qc.invalidateQueries({ queryKey: [\"home\"] });\n },\n });\n\n const counts = queueQuery.data?.counts ?? {\n pending: 0,\n approved: 0,\n rejected: 0,\n sent: 0,\n expired: 0,\n };\n const rows = queueQuery.data?.rows ?? [];\n\n const playList = Array.from(new Set(rows.map((r) => r.playName))).toSorted();\n\n // Selection derived state — stable across renders even if rows refetch.\n const someSelected = selected.size > 0;\n const allSelected = rows.length > 0 && selected.size === rows.length;\n\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n {/* Masthead */}\n <section className=\"flex items-end justify-between gap-4 border-b border-ink-rule px-6 pb-5 pt-6\">\n <div>\n <div className=\"ln-eyebrow\">The Ledger · Queue</div>\n <h1\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 44,\n fontWeight: 600,\n letterSpacing: \"-0.025em\",\n lineHeight: 0.98,\n }}\n >\n Candidates, for review.\n </h1>\n </div>\n <div className=\"font-mono text-[11px] text-ink-faint\">\n {Object.entries(counts)\n .map(([k, v]) => `${k} ${v}`)\n .join(\" · \")}\n </div>\n </section>\n\n <IcpBanner />\n\n <TriggersCard />\n\n {/* Target Queue — the candidates themselves. A heavier rule + explicit\n section header separates this from the Triggers table above (which\n was reading as a seamless continuation of the same list). Play\n filter lives inline here: it narrows the rows in this table\n specifically, so it belongs next to them, not in the global bar. */}\n <section className=\"border-t-2 border-ink-rule\">\n <div className=\"flex flex-wrap items-center justify-between gap-3 px-6 pb-3 pt-5\">\n <div className=\"flex items-baseline gap-3\">\n <div className=\"ln-eyebrow\">\n Target Queue{\" \"}\n <span className=\"text-ink-faint\">\n · {queueQuery.data ? rows.length : \"…\"} row{rows.length === 1 ? \"\" : \"s\"}\n </span>\n </div>\n </div>\n <div className=\"font-mono text-[11px] text-ink-faint\">refresh · 20s</div>\n </div>\n\n {/* Status + play filters, inline with the table they scope. Status\n is first (it narrows far more rows than play) and the two are\n visually separated by a thin rule for scannability. */}\n <div className=\"flex flex-wrap items-center gap-2 border-b border-ink-rule/60 px-6 pb-3\">\n <span className=\"ln-eyebrow\">status</span>\n {STATUSES.map((s) => (\n <Button\n key={s}\n variant={statusFilter === s ? \"primary\" : \"ghost\"}\n size=\"sm\"\n onClick={() => setStatusFilter(s)}\n >\n {s}\n </Button>\n ))}\n <span className=\"mx-2 h-4 w-px bg-ink-rule\" />\n <span className=\"ln-eyebrow\">play</span>\n <Button\n variant={playFilter === \"all\" ? \"primary\" : \"ghost\"}\n size=\"sm\"\n onClick={() => setPlayFilter(\"all\")}\n >\n all\n </Button>\n {playList.map((p) => (\n <Button\n key={p}\n variant={playFilter === p ? \"primary\" : \"ghost\"}\n size=\"sm\"\n onClick={() => setPlayFilter(p)}\n >\n {p}\n </Button>\n ))}\n </div>\n\n {/* Bulk actions — approve-all + per-play drain. Colocated with the\n table they act on; respects the current play filter so clicking\n \"approve all pending\" while a play is selected scopes down. */}\n <div className=\"flex flex-wrap items-center gap-2 border-b border-ink-rule/60 bg-ink-surface/30 px-6 py-3\">\n <Button\n variant=\"secondary\"\n size=\"sm\"\n disabled={approveAll.isPending || counts.pending === 0}\n onClick={() => approveAll.mutate(playFilter === \"all\" ? undefined : playFilter)}\n >\n <Check size={12} /> approve all pending\n {playFilter !== \"all\" ? ` (${playFilter})` : \"\"}\n </Button>\n {DRAINABLE_PLAYS.map((p) => (\n <Button\n key={p}\n variant=\"ghost\"\n size=\"sm\"\n disabled={\n counts.approved === 0 ||\n (playFilter !== \"all\" && playFilter !== p) ||\n !rows.some((r) => r.playName === p && r.status === \"approved\")\n }\n onClick={() =>\n setDrainModal({\n playName: p,\n approvedCount: rows.filter((r) => r.playName === p && r.status === \"approved\")\n .length,\n })\n }\n >\n <Send size={12} /> drain {p}\n </Button>\n ))}\n </div>\n\n {/* 7-day signal strip — enqueues per day from the rows in memory. */}\n {rows.length > 0 && <SignalStrip rows={rows} />}\n\n {queueQuery.isLoading ? (\n Array.from({ length: 5 }, (_, i) => <SkeletonRow key={i} />)\n ) : rows.length === 0 ? (\n <EmptyQueueHelp filterActive={statusFilter !== \"pending\" || playFilter !== \"all\"} />\n ) : (\n <table className=\"w-full text-[13px]\">\n <thead className=\"sticky top-0 z-10 bg-ink-bg\">\n <tr className=\"border-b border-ink-rule text-[10px] uppercase tracking-[0.14em] text-ink-faint\">\n <th className=\"w-6 py-2\" />\n <th className=\"w-6 py-2\">\n <label className=\"inline-flex cursor-pointer items-center\">\n <input\n type=\"checkbox\"\n className=\"h-[13px] w-[13px] rounded-[var(--radius-xs)] border border-ink-rule bg-ink-bg-deep accent-[color:var(--ink-signal)]\"\n checked={allSelected}\n ref={(el) => {\n if (el) el.indeterminate = someSelected && !allSelected;\n }}\n onChange={(e) =>\n setSelected(e.target.checked ? new Set(rows.map((r) => r.id)) : new Set())\n }\n aria-label={allSelected ? \"deselect all\" : \"select all\"}\n />\n </label>\n </th>\n <th className=\"px-6 py-2 text-left font-medium\">id</th>\n <th className=\"py-2 text-left font-medium\">prospect</th>\n <th className=\"py-2 text-left font-medium\">play</th>\n <th className=\"py-2 text-left font-medium\">status</th>\n <th className=\"py-2 text-left font-medium\">source</th>\n <th className=\"py-2 text-right font-medium\">found</th>\n <th className=\"px-6 py-2 text-right font-medium\">actions</th>\n </tr>\n </thead>\n <tbody>\n {rows.map((row, i) => (\n <QueueRow\n key={row.id}\n row={row}\n zebra={i % 2 === 1}\n expanded={expanded === row.id}\n selected={selected.has(row.id)}\n anySelected={someSelected}\n onToggleSelect={() => {\n setSelected((prev) => {\n const next = new Set(prev);\n if (next.has(row.id)) next.delete(row.id);\n else next.add(row.id);\n return next;\n });\n }}\n onToggle={() => setExpanded(expanded === row.id ? null : row.id)}\n onApprove={() => approve.mutate(row.id)}\n onReject={() =>\n setRejectModal({ id: row.id, email: emailFor(row.payload) ?? `#${row.id}` })\n }\n busy={approve.isPending || reject.isPending}\n />\n ))}\n </tbody>\n </table>\n )}\n </section>\n\n {/* Sticky bulk-action bar — only when something is selected */}\n {someSelected && (\n <div className=\"sticky bottom-0 z-20 flex items-center justify-between gap-4 border-b border-t border-ink-rule bg-ink-bg/95 px-6 py-3 backdrop-blur-[2px]\">\n <div className=\"flex items-center gap-3\">\n <span className=\"inline-flex h-6 min-w-[24px] items-center justify-center rounded-full bg-[color:var(--ink-signal)]/20 px-2 font-mono text-[12px] text-[color:var(--ink-signal-2)]\">\n {selected.size}\n </span>\n <span className=\"text-[13px] text-ink-cream-2\">\n {selected.size === 1 ? \"row selected\" : \"rows selected\"}\n </span>\n <button\n type=\"button\"\n onClick={() => setSelected(new Set())}\n className=\"font-mono text-[11px] text-ink-faint underline decoration-ink-rule underline-offset-2 hover:text-ink-cream hover:decoration-ink-cream-2\"\n >\n clear\n </button>\n </div>\n <div className=\"flex items-center gap-1.5\">\n <Button\n variant=\"secondary\"\n size=\"sm\"\n disabled={bulkApprove.isPending || selected.size === 0}\n onClick={() => bulkApprove.mutate([...selected])}\n >\n <Check size={12} /> approve {selected.size}\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n disabled={bulkReject.isPending || selected.size === 0}\n onClick={() => bulkReject.mutate([...selected])}\n >\n <X size={12} /> reject {selected.size}\n </Button>\n </div>\n </div>\n )}\n\n <Modal\n open={rejectModal != null}\n onClose={() => setRejectModal(null)}\n title={`Reject #${rejectModal?.id} — ${rejectModal?.email ?? \"\"}`}\n footer={\n <>\n <Button variant=\"ghost\" onClick={() => setRejectModal(null)}>\n Cancel\n </Button>\n <Button\n variant=\"danger\"\n onClick={() =>\n rejectModal &&\n reject.mutate({ id: rejectModal.id, reason: rejectReason || undefined })\n }\n disabled={reject.isPending}\n >\n {reject.isPending ? \"Rejecting…\" : \"Reject\"}\n </Button>\n </>\n }\n >\n <Field label=\"Reason (optional, logged for ICP-filter learning)\">\n <Textarea\n rows={3}\n value={rejectReason}\n onChange={(e) => setRejectReason(e.target.value)}\n placeholder=\"e.g. wrong stage, wrong industry, already a customer\"\n />\n </Field>\n </Modal>\n\n <Modal\n open={drainModal != null}\n onClose={() => setDrainModal(null)}\n title={`Drain ${drainModal?.playName ?? \"\"} (${drainModal?.approvedCount ?? 0} approved)`}\n footer={\n <>\n <Button variant=\"ghost\" onClick={() => setDrainModal(null)}>\n Cancel\n </Button>\n <Button onClick={() => drain.mutate()} disabled={drain.isPending}>\n <Send size={12} />\n {drain.isPending\n ? \"Draining…\"\n : drainDryRun\n ? \"Preview drain (no send)\"\n : `Send up to ${drainLimit}`}\n </Button>\n </>\n }\n >\n <div className=\"flex flex-col gap-3\">\n <Field label=\"Limit\">\n <Input\n type=\"number\"\n min={1}\n value={drainLimit}\n onChange={(e) => setDrainLimit(Math.max(1, Number.parseInt(e.target.value, 10) || 1))}\n />\n </Field>\n {drainModal?.playName === \"accelerator-batch\" && (\n <>\n <Field\n label=\"Sender cohort (required)\"\n hint=\"Your accelerator/cohort tag, e.g. yc-w23\"\n >\n <Input\n value={drainSenderCohort}\n onChange={(e) => setDrainSenderCohort(e.target.value)}\n placeholder=\"yc-w23\"\n required\n />\n </Field>\n <Field label=\"Free-for-cohort offer (optional)\">\n <Input\n value={drainOffer}\n onChange={(e) => setDrainOffer(e.target.value)}\n placeholder=\"Free for current YC W26 through demo day, just reply with your batch.\"\n />\n </Field>\n </>\n )}\n <label className=\"inline-flex cursor-pointer items-center gap-2.5 text-[13px] text-ink-cream-2 hover:text-ink-cream\">\n <Toggle checked={drainDryRun} onChange={setDrainDryRun} label=\"dry run\" />\n <span>Dry run — preview drafts, no send, no spend</span>\n </label>\n {drain.isError && (\n <div className=\"font-mono text-[11.5px] text-[color:var(--ink-blocked-2)]\">\n {drain.error.message}\n </div>\n )}\n {drain.data && (\n <div className=\"font-mono text-[11.5px] text-[color:var(--ink-receipt-2)]\">\n {drainDryRun\n ? `would send ${drain.data.sent} of ${drain.data.drained}`\n : `sent ${drain.data.sent} of ${drain.data.drained}`}\n {drain.data.errors.length > 0 && (\n <div className=\"mt-1 text-[color:var(--ink-blocked-2)]\">\n {drain.data.errors.length} error(s) ·{\" \"}\n {drain.data.errors.map((e) => e.message).join(\" · \")}\n </div>\n )}\n </div>\n )}\n </div>\n </Modal>\n </div>\n );\n}\n\nfunction QueueRow({\n row,\n zebra,\n expanded,\n selected,\n anySelected,\n onToggleSelect,\n onToggle,\n onApprove,\n onReject,\n busy,\n}: {\n row: QueueRowView;\n zebra: boolean;\n expanded: boolean;\n selected: boolean;\n anySelected: boolean;\n onToggleSelect: () => void;\n onToggle: () => void;\n onApprove: () => void;\n onReject: () => void;\n busy: boolean;\n}) {\n const email = emailFor(row.payload);\n const name = nameFor(row.payload);\n const company = companyFor(row.payload);\n const linkedinUrl = linkedinUrlFor(row.payload);\n const phone = phoneFor(row.payload);\n return (\n <>\n <tr\n className={cn(\n \"group cursor-pointer border-b border-ink-rule/60\",\n \"transition-colors duration-[var(--dur-stamp)]\",\n \"hover:bg-ink-surface/60\",\n zebra && \"bg-ink-surface/20\",\n selected && \"bg-[color:var(--ink-signal)]/8\",\n )}\n onClick={onToggle}\n >\n <td className=\"w-6 py-2 pl-4 pr-0 text-ink-faint\">\n {expanded ? <ChevronDown size={12} /> : <ChevronRight size={12} />}\n </td>\n <td className=\"w-6 py-2\" onClick={(e) => e.stopPropagation()}>\n <label className=\"inline-flex cursor-pointer items-center\">\n <input\n type=\"checkbox\"\n className={cn(\n \"h-[13px] w-[13px] rounded-[var(--radius-xs)]\",\n \"border border-ink-rule bg-ink-bg-deep accent-[color:var(--ink-signal)]\",\n // Hide until the row is hovered OR any other row is selected —\n // so the default look stays clean, but once you start selecting\n // the checkboxes stay visible for rapid batch picking.\n \"transition-opacity duration-[var(--dur-stamp)]\",\n selected || anySelected\n ? \"opacity-100\"\n : \"opacity-0 group-hover:opacity-100 focus:opacity-100\",\n )}\n checked={selected}\n onChange={onToggleSelect}\n aria-label={selected ? `deselect #${row.id}` : `select #${row.id}`}\n />\n </label>\n </td>\n <td className=\"px-6 py-2 font-mono text-[11px] text-ink-faint\">#{row.id}</td>\n <td className=\"py-2\">\n <div className=\"text-ink-cream\">{name ?? \"(unknown)\"}</div>\n <div className=\"font-mono text-[11px] text-ink-faint\">\n {email ?? \"—\"}\n {company ? ` · ${company}` : \"\"}\n {linkedinUrl ? (\n <a\n href={linkedinUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"ml-1 text-ink-cream-2 underline decoration-ink-rule underline-offset-2 hover:text-ink-cream hover:decoration-ink-cream-2\"\n onClick={(e) => e.stopPropagation()}\n >\n [in]\n </a>\n ) : null}\n {phone ? <span className=\"ml-1 text-ink-faint\">· {phone}</span> : null}\n </div>\n </td>\n <td className=\"py-2 text-ink-cream-2\">{row.playName}</td>\n <td className=\"py-2\">\n <Badge tone={statusTone(row.status)}>{row.status}</Badge>\n </td>\n <td className=\"py-2 font-mono text-[11px] text-ink-faint\">{row.source}</td>\n <td className=\"py-2 text-right font-mono text-[12px] text-ink-muted\">\n {timeAgo(row.foundAt)}\n </td>\n <td className=\"px-6 py-2 text-right\" onClick={(e) => e.stopPropagation()}>\n <div className=\"flex items-center justify-end gap-1\">\n {row.status === \"pending\" && (\n <>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n title=\"approve\"\n disabled={busy}\n onClick={onApprove}\n >\n <Check size={12} />\n </Button>\n <Button variant=\"ghost\" size=\"sm\" title=\"reject\" disabled={busy} onClick={onReject}>\n <X size={12} />\n </Button>\n </>\n )}\n </div>\n </td>\n </tr>\n {expanded && (\n <tr className=\"border-b border-ink-rule/60 bg-ink-bg-deep/50\">\n <td colSpan={9} className=\"px-6 py-3\">\n <div className=\"text-[12px] text-ink-muted\">\n {row.notes ? <div className=\"mb-2 ln-note\">{row.notes}</div> : null}\n <pre className=\"max-h-[300px] overflow-auto rounded-[var(--radius-sm)] border border-ink-rule bg-ink-bg-deep p-3 font-mono text-[11.5px] leading-[1.55] text-ink-cream-2\">\n {JSON.stringify(row.payload, null, 2)}\n </pre>\n </div>\n </td>\n </tr>\n )}\n </>\n );\n}\n\n/**\n * 7-day signal strip — renders a tight row of daily-enqueue bars computed\n * client-side from `rows`. It's an approximate readout (limited to the\n * rows currently in memory) but gives a quick visual pulse without any\n * new API.\n */\nfunction SignalStrip({ rows }: { rows: QueueRowView[] }) {\n const days = buildSignalDays(rows);\n const max = Math.max(1, ...days.map((d) => d.count));\n const total = days.reduce((a, d) => a + d.count, 0);\n\n return (\n <div className=\"flex items-center gap-4 border-b border-ink-rule/60 bg-ink-bg-deep/40 px-6 py-2.5\">\n <div className=\"ln-eyebrow\" style={{ fontSize: 10 }}>\n last 7d\n </div>\n <div className=\"flex items-end gap-1\" aria-hidden=\"true\">\n {days.map((d) => {\n const h = Math.round((d.count / max) * 20);\n return (\n <span\n key={d.label}\n title={`${d.label} · ${d.count} enqueued`}\n className={cn(\n \"w-[10px] rounded-[1px]\",\n d.count === 0 ? \"bg-ink-rule\" : \"bg-[color:var(--ink-signal)]/70\",\n )}\n style={{ height: Math.max(2, h) }}\n />\n );\n })}\n </div>\n <div className=\"font-mono text-[11px] text-ink-muted\">\n {total} enqueued\n <span className=\"ml-2 text-ink-faint\">\n · <span className=\"text-ink-cream-2\">{days[days.length - 1]?.count ?? 0}</span>{\" \"}\n today\n </span>\n </div>\n </div>\n );\n}\n\nfunction TriggersCard() {\n const qc = useQueryClient();\n const triggersQuery = useQuery({\n queryKey: [\"triggers\"],\n queryFn: () => api.triggers(),\n // Poll 5s while anything is running (local marker OR server `running`), 30s otherwise.\n refetchInterval: (query) => {\n if (hasAnyRunningTrigger()) return 5_000;\n const data = query.state.data;\n if (data?.triggers.some((t) => t.running)) return 5_000;\n return 30_000;\n },\n });\n const setEnabled = useMutation({\n mutationFn: (vars: { name: string; enabled: boolean }) =>\n api.setTriggerEnabled(vars.name, vars.enabled),\n onSuccess: () => void qc.invalidateQueries({ queryKey: [\"triggers\"] }),\n onError: (err) => toast.error(err.message),\n });\n const setConfig = useMutation({\n mutationFn: (vars: { name: string; config: unknown }) =>\n api.setTriggerConfig(vars.name, vars.config),\n onSuccess: () => {\n setEditing(null);\n void qc.invalidateQueries({ queryKey: [\"triggers\"] });\n },\n onError: (err) => toast.error(err.message),\n });\n const runTrigger = useMutation({\n mutationFn: (name: string) => {\n markTriggerRunning(name);\n return api.runTrigger(name);\n },\n onSuccess: (data, name) => {\n void qc.invalidateQueries({ queryKey: [\"triggers\"] });\n if (data.pending) {\n toast.success(`${name} · started`, {\n description: \"polling for results\",\n });\n return;\n }\n clearTriggerRunning(name);\n void qc.invalidateQueries({ queryKey: [\"queue\"] });\n void qc.invalidateQueries({ queryKey: [\"home\"] });\n if (data.error) {\n toast.error(`${name} · ${data.error}`);\n return;\n }\n const r = data.result;\n if (!r) {\n toast.success(`${name} · ran`);\n return;\n }\n const parts = [\n `${r.candidates} candidates`,\n `${r.enqueued} kept`,\n r.droppedIcp ? `${r.droppedIcp} icp-drop` : null,\n r.droppedDuplicate ? `${r.droppedDuplicate} dup` : null,\n r.droppedEnrichment ? `${r.droppedEnrichment} enrich-fail` : null,\n `$${r.costUsd.toFixed(2)}`,\n r.halted ? `halted: ${r.halted}` : null,\n ].filter(Boolean);\n toast.success(`${name} · ${parts.join(\" · \")}`);\n },\n onError: (err, name) => {\n // 409 = server already running it — keep the local marker so the\n // spinner stays lit until the authoritative `running` flag clears.\n if (err.message.includes(\"already running\")) {\n void qc.invalidateQueries({ queryKey: [\"triggers\"] });\n toast.info(`${name} · already running`);\n return;\n }\n clearTriggerRunning(name);\n toast.error(`${name} · ${err.message}`);\n },\n });\n\n const [editing, setEditing] = useState<EditingState | null>(null);\n const [editError, setEditError] = useState<string | null>(null);\n\n const triggers = triggersQuery.data?.triggers ?? [];\n\n // Invalidate queue/home the moment any trigger's `running` flips true → false.\n const runningKey = triggers\n .filter((t) => t.running)\n .map((t) => t.name)\n .toSorted()\n .join(\",\");\n const prevRunningRef = useRef<string>(\"\");\n useEffect(() => {\n const prev = prevRunningRef.current;\n prevRunningRef.current = runningKey;\n const prevNames = prev ? prev.split(\",\") : [];\n const nowNames = runningKey ? runningKey.split(\",\") : [];\n const stillRunning = new Set(nowNames);\n if (prevNames.some((n) => !stillRunning.has(n))) {\n void qc.invalidateQueries({ queryKey: [\"queue\"] });\n void qc.invalidateQueries({ queryKey: [\"home\"] });\n }\n }, [runningKey, qc]);\n\n const lastPolledByName = new Map<string, string | null>(\n triggers.map((t) => [t.name, t.lastPolledAt]),\n );\n const serverRunningSinceByName = new Map<string, string | null>(\n triggers.map((t) => [t.name, t.runningSince]),\n );\n const runningByName = useRunningTriggers(\n triggers.map((t) => t.name),\n lastPolledByName,\n serverRunningSinceByName,\n );\n\n return (\n <>\n <section className=\"border-b border-ink-rule\">\n <div className=\"flex items-baseline justify-between px-6 pb-2 pt-5\">\n <div className=\"ln-eyebrow\">\n Triggers <span className=\"text-ink-faint\">· {triggers.length}</span>\n </div>\n <div className=\"font-mono text-[11px] text-ink-faint\">refresh · 30s</div>\n </div>\n {triggersQuery.isLoading ? (\n Array.from({ length: 3 }, (_, i) => <SkeletonRow key={i} />)\n ) : triggers.length === 0 ? (\n <div className=\"px-6 pb-6\">\n <EmptyNote\n note=\"No triggers stored yet. Enable one below and it bootstraps itself on the next watch tick — or run the watch loop once to initialise.\"\n cli=\"oneshot-gtm find watch --once\"\n />\n </div>\n ) : (\n <table className=\"w-full text-[13px]\">\n <thead>\n <tr className=\"border-b border-ink-rule/60 text-[10px] uppercase tracking-[0.14em] text-ink-faint\">\n <th className=\"px-6 py-2 text-left font-medium\">name</th>\n <th className=\"py-2 text-left font-medium\">enabled</th>\n <th className=\"py-2 text-left font-medium\">interval</th>\n <th className=\"py-2 text-left font-medium\">last polled</th>\n <th className=\"py-2 text-left font-medium\">last run</th>\n <th className=\"px-6 py-2 text-right font-medium\">actions</th>\n </tr>\n </thead>\n <tbody>\n {triggers.map((t, i) => {\n const summary = summarizeRun(t.lastRunSummary);\n // `inProcess` covers the sub-millisecond window before the 202 lands;\n // `tracked` takes over via localStorage + server `runningSince`.\n const inProcess = runTrigger.isPending && runTrigger.variables === t.name;\n const tracked = runningByName.get(t.name);\n const running = inProcess || tracked != null;\n const elapsedMs = tracked?.elapsedMs ?? null;\n const isEditing = editing?.name === t.name;\n return (\n <TriggerRowFragment\n key={t.name}\n trigger={t}\n zebra={i % 2 === 1}\n running={running}\n elapsedMs={elapsedMs}\n summary={summary}\n isEditing={Boolean(isEditing)}\n editing={isEditing ? editing : null}\n editError={isEditing ? editError : null}\n onToggleEnabled={(next) => setEnabled.mutate({ name: t.name, enabled: next })}\n onRun={() => runTrigger.mutate(t.name)}\n onStartEdit={() => {\n setEditing({\n name: t.name,\n text: JSON.stringify(t.config ?? {}, null, 2),\n defaultConfig: t.defaultConfig,\n });\n setEditError(null);\n }}\n onCancelEdit={() => {\n setEditing(null);\n setEditError(null);\n }}\n onChangeEditText={(text) =>\n setEditing((prev) => (prev ? { ...prev, text } : prev))\n }\n onResetDefaults={() =>\n setEditing((prev) =>\n prev\n ? {\n ...prev,\n text: JSON.stringify(prev.defaultConfig ?? {}, null, 2),\n }\n : prev,\n )\n }\n onSaveEdit={() => {\n if (!editing) return;\n let parsed: unknown;\n try {\n parsed = JSON.parse(editing.text);\n } catch (err) {\n setEditError(`invalid JSON: ${(err as Error).message}`);\n return;\n }\n if (!parsed || typeof parsed !== \"object\") {\n setEditError(\"config must be a JSON object\");\n return;\n }\n setEditError(null);\n setConfig.mutate({ name: editing.name, config: parsed });\n }}\n setEnabledPending={setEnabled.isPending}\n setConfigPending={setConfig.isPending}\n />\n );\n })}\n </tbody>\n </table>\n )}\n </section>\n </>\n );\n}\n\ninterface TriggerRowProps {\n trigger: TriggerView;\n zebra: boolean;\n running: boolean;\n /** ms elapsed since the cross-refresh start; null when only in-process. */\n elapsedMs: number | null;\n summary: string;\n isEditing: boolean;\n editing: EditingState | null;\n editError: string | null;\n onToggleEnabled: (next: boolean) => void;\n onRun: () => void;\n onStartEdit: () => void;\n onCancelEdit: () => void;\n onChangeEditText: (text: string) => void;\n onResetDefaults: () => void;\n onSaveEdit: () => void;\n setEnabledPending: boolean;\n setConfigPending: boolean;\n}\n\nfunction TriggerRowFragment(props: TriggerRowProps) {\n const t = props.trigger;\n // Missing `ready` field = treat as ready (tolerate older servers).\n const notReady = t.ready === false;\n const notReadyReason = t.notReadyReason ?? \"missing required config\";\n // Block enabling an unready trigger but still allow disabling.\n const toggleDisabled = props.setEnabledPending || (notReady && !t.enabled);\n const runDisabled = props.running || notReady;\n return (\n <>\n <tr\n className={cn(\n \"group relative border-b border-ink-rule/60\",\n \"transition-colors duration-[var(--dur-stamp)]\",\n props.zebra && \"bg-ink-surface/20\",\n !t.enabled && \"opacity-65\",\n \"hover:bg-ink-surface/50\",\n props.isEditing && \"bg-ink-surface/50\",\n props.running && \"bg-[color:var(--ink-signal)]/[0.08]\",\n )}\n >\n <td className=\"relative px-6 py-2 font-mono text-[12px]\">\n {props.running ? (\n <span\n aria-hidden=\"true\"\n className=\"absolute inset-y-0 left-0 w-[2px] bg-[color:var(--ink-signal)] animate-pulse\"\n />\n ) : (\n t.enabled && (\n <span\n aria-hidden=\"true\"\n className=\"absolute inset-y-0 left-0 w-[2px] bg-[color:var(--ink-signal)]/60\"\n />\n )\n )}\n <span className={t.enabled ? \"text-ink-cream\" : \"text-ink-muted\"}>{t.name}</span>\n </td>\n <td\n className=\"py-2\"\n title={notReady && !t.enabled ? `not ready · ${notReadyReason}` : undefined}\n >\n <Toggle\n checked={t.enabled}\n disabled={toggleDisabled}\n label={`${t.enabled ? \"disable\" : \"enable\"} ${t.name}`}\n onChange={props.onToggleEnabled}\n />\n </td>\n <td className=\"py-2 font-mono text-[12px] text-ink-muted\">\n {humanInterval(t.intervalMs)}\n {t.intervalMs !== t.defaultIntervalMs && (\n <span className=\"ml-1 text-ink-faint\">\n · default {humanInterval(t.defaultIntervalMs)}\n </span>\n )}\n </td>\n <td className=\"py-2 font-mono text-[12px] text-ink-muted\">\n {t.lastPolledAt ? timeAgo(t.lastPolledAt) : \"never\"}\n </td>\n <td\n className={cn(\n \"py-2 font-mono text-[11.5px]\",\n notReady ? \"text-[color:var(--ink-blocked-2)]\" : \"text-ink-muted\",\n )}\n >\n {notReady ? `not ready · ${notReadyReason}` : props.summary}\n </td>\n <td className=\"px-6 py-2 text-right\">\n <div className=\"flex items-center justify-end gap-1\">\n <Button\n variant={props.running ? \"accent\" : \"ghost\"}\n size=\"sm\"\n // `aria-disabled` (not `disabled`) so accent colors stay vivid;\n // clicks are gated by the `onClick` guard + pointer-events-none.\n aria-disabled={runDisabled || undefined}\n onClick={runDisabled ? undefined : props.onRun}\n className={cn(runDisabled && \"cursor-not-allowed pointer-events-none\")}\n title={\n props.running\n ? `Running for ${props.elapsedMs != null ? humanDuration(props.elapsedMs) : \"a moment\"} — click won't re-fire`\n : notReady\n ? `not ready · ${notReadyReason}`\n : \"Run this finder now — ignores schedule, spends OneShot $\"\n }\n >\n {props.running ? (\n <Loader2 size={12} className=\"animate-spin\" aria-hidden=\"true\" />\n ) : (\n <Play size={12} aria-hidden=\"true\" />\n )}\n {props.running\n ? props.elapsedMs != null\n ? `running · ${humanDuration(props.elapsedMs)}`\n : \"running…\"\n : \"run now\"}\n </Button>\n <Button\n variant={props.isEditing ? \"secondary\" : \"ghost\"}\n size=\"sm\"\n title={props.isEditing ? \"close config\" : \"edit config\"}\n aria-label={`${props.isEditing ? \"close\" : \"edit\"} ${t.name} config`}\n onClick={props.isEditing ? props.onCancelEdit : props.onStartEdit}\n >\n <Pencil size={12} />\n </Button>\n </div>\n </td>\n </tr>\n {props.isEditing && props.editing && (\n <tr className=\"border-b border-ink-rule/60 bg-ink-bg-deep/60\">\n <td colSpan={6} className=\"px-6 py-4\">\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <div className=\"ln-eyebrow\">\n config ·{\" \"}\n <span className=\"text-ink-cream-2 normal-case font-mono tracking-normal\">\n {t.name}\n </span>\n </div>\n <div className=\"ln-note text-[12px] text-ink-cream-2\">\n add{\" \"}\n <code className=\"ln-mono text-[11.5px] text-[color:var(--ink-signal-2)]\">\n \"intervalMs\"\n </code>{\" \"}\n to override the watch cadence · min 60000\n </div>\n </div>\n <Textarea\n rows={8}\n value={props.editing.text}\n onChange={(e) => props.onChangeEditText(e.target.value)}\n className=\"font-mono text-[12px]\"\n spellCheck={false}\n />\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"font-mono text-[11.5px] text-[color:var(--ink-blocked-2)]\">\n {props.editError ?? \"\"}\n </div>\n <div className=\"flex items-center gap-1.5\">\n {props.editing.defaultConfig && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={props.onResetDefaults}\n disabled={props.setConfigPending}\n title=\"Replace the textarea with the registry default config\"\n >\n reset\n </Button>\n )}\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={props.onCancelEdit}\n disabled={props.setConfigPending}\n >\n cancel\n </Button>\n <Button\n variant=\"primary\"\n size=\"sm\"\n onClick={props.onSaveEdit}\n disabled={props.setConfigPending}\n >\n {props.setConfigPending ? \"saving…\" : \"save\"}\n </Button>\n </div>\n </div>\n </div>\n </td>\n </tr>\n )}\n </>\n );\n}\n\nfunction IcpBanner() {\n const setupQuery = useQuery({ queryKey: [\"setup\"], queryFn: () => api.setupStatus() });\n const icp = setupQuery.data?.cfg.icpOneLiner ?? null;\n if (setupQuery.isLoading) return null;\n\n if (!icp || icp.trim().length === 0) {\n return (\n <section className=\"flex items-start gap-3 border-b border-ink-rule bg-[color:var(--ink-spend)]/6 px-6 py-4\">\n <Target size={14} className=\"mt-[3px] shrink-0 text-[color:var(--ink-spend-2)]\" />\n <div className=\"flex-1\">\n <div className=\"ln-eyebrow\" style={{ color: \"var(--ink-spend-2)\" }}>\n Set your ICP first\n </div>\n <div className=\"ln-note mt-0.5 text-[13px] text-ink-cream-2\">\n The find layer needs a free-text ICP one-liner to filter candidates. Without it, every\n result passes through and you'll review more noise than signal.\n </div>\n </div>\n <Link to=\"/setup\">\n <Button size=\"sm\">Open setup</Button>\n </Link>\n </section>\n );\n }\n\n return (\n <section className=\"flex items-start gap-3 border-b border-ink-rule px-6 py-3\">\n <Target size={14} className=\"mt-[3px] shrink-0 text-[color:var(--ink-receipt-2)]\" />\n <div className=\"flex-1 min-w-0\">\n <div className=\"ln-eyebrow\">ICP</div>\n <div className=\"mt-0.5 truncate text-[13px] text-ink-cream-2\">{icp}</div>\n </div>\n <Link to=\"/setup\">\n <Button variant=\"ghost\" size=\"sm\">\n edit\n </Button>\n </Link>\n </section>\n );\n}\n\nfunction EmptyQueueHelp({ filterActive }: { filterActive: boolean }) {\n if (filterActive) {\n return (\n <div className=\"p-5\">\n <EmptyNote note=\"No queue rows match this filter. Try a different status or play above to see other rows.\" />\n </div>\n );\n }\n return (\n <div className=\"p-5\">\n <EmptyNote\n note=\"No targets yet. Pick a finder from the Triggers panel and run it — candidates land here for review before any send.\"\n cli=\"oneshot-gtm find watch\"\n />\n </div>\n );\n}\n\nfunction summarizeRun(summary: unknown): string {\n if (!summary || typeof summary !== \"object\") return \"—\";\n const s = summary as Record<string, unknown>;\n if (typeof s[\"error\"] === \"string\") return `error: ${(s[\"error\"] as string).slice(0, 60)}`;\n if (typeof s[\"halted\"] === \"string\" && s[\"halted\"]) {\n return `halted · ${(s[\"halted\"] as string).slice(0, 80)}`;\n }\n const parts: string[] = [];\n if (typeof s[\"candidates\"] === \"number\") parts.push(`cand=${s[\"candidates\"]}`);\n if (typeof s[\"enqueued\"] === \"number\") parts.push(`kept=${s[\"enqueued\"]}`);\n if (typeof s[\"droppedIcp\"] === \"number\") parts.push(`icp=${s[\"droppedIcp\"]}`);\n if (typeof s[\"droppedLowSignal\"] === \"number\" && (s[\"droppedLowSignal\"] as number) > 0) {\n parts.push(`low=${s[\"droppedLowSignal\"]}`);\n }\n if (typeof s[\"costUsd\"] === \"number\") {\n parts.push(`$${(s[\"costUsd\"] as number).toFixed(2)}`);\n }\n return parts.length > 0 ? parts.join(\" · \") : \"—\";\n}\n\nfunction humanInterval(ms: number): string {\n if (ms < 60_000) return `${Math.round(ms / 1000)}s`;\n if (ms < 3600_000) return `${Math.round(ms / 60_000)}m`;\n const hours = ms / 3600_000;\n if (hours >= 48) return `${(hours / 24).toFixed(hours % 24 === 0 ? 0 : 1)}d`;\n return `${hours.toFixed(hours % 1 === 0 ? 0 : 1)}h`;\n}\n\nfunction emailFor(payload: unknown): string | null {\n if (!payload || typeof payload !== \"object\") return null;\n const p = payload as Record<string, unknown>;\n if (typeof p[\"email\"] === \"string\") return p[\"email\"] as string;\n if (typeof p[\"founderEmail\"] === \"string\") return p[\"founderEmail\"] as string;\n return null;\n}\n\nfunction nameFor(payload: unknown): string | null {\n if (!payload || typeof payload !== \"object\") return null;\n const p = payload as Record<string, unknown>;\n if (typeof p[\"name\"] === \"string\") return p[\"name\"] as string;\n if (typeof p[\"founderName\"] === \"string\") return p[\"founderName\"] as string;\n // Pre-enrichment rejected rows only carry a source URL — derive a handle.\n const repoUrl = typeof p[\"repoUrl\"] === \"string\" ? (p[\"repoUrl\"] as string) : null;\n if (repoUrl) {\n const m = repoUrl.match(/github\\.com\\/([^/]+)\\/([^/?#]+)/);\n if (m) return `${m[1]}/${m[2]}`;\n }\n const postUrl = typeof p[\"postUrl\"] === \"string\" ? (p[\"postUrl\"] as string) : null;\n if (postUrl) {\n try {\n const host = new URL(postUrl).hostname.replace(/^www\\./, \"\");\n if (host) return host;\n } catch {\n // fall through\n }\n }\n return null;\n}\n\nfunction companyFor(payload: unknown): string | null {\n if (!payload || typeof payload !== \"object\") return null;\n const p = payload as Record<string, unknown>;\n if (typeof p[\"company\"] === \"string\") return p[\"company\"] as string;\n return null;\n}\n\nfunction linkedinUrlFor(payload: unknown): string | null {\n if (!payload || typeof payload !== \"object\") return null;\n const p = payload as Record<string, unknown>;\n const v = p[\"linkedinUrl\"];\n if (typeof v !== \"string\" || v.length === 0) return null;\n // Defense in depth — payload comes from sqlite but a stale/garbage row should\n // never render as a clickable javascript:// or data:// link.\n return /^https?:\\/\\/(?:[a-z0-9-]+\\.)*linkedin\\.com\\/in\\//i.test(v) ? v : null;\n}\n\nfunction phoneFor(payload: unknown): string | null {\n if (!payload || typeof payload !== \"object\") return null;\n const p = payload as Record<string, unknown>;\n const v = p[\"phone\"];\n if (typeof v === \"string\" && v.length > 0) return v;\n return null;\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":"4WAUA,IAAM,EAAc,EAAiB,eAAgBA,CADjC,CAAC,OAAQ,CAAE,EAAG,eAAgB,IAAK,SAAU,CAAC,CACbA,CAAW,CCA1D,EAAe,EAAiB,gBAAiBC,CADnC,CAAC,OAAQ,CAAE,EAAG,gBAAiB,IAAK,SAAU,CAAC,CACZA,CAAW,CCA5D,EAAe,EAAiB,gBAAiBC,CADnC,CAAC,OAAQ,CAAE,EAAG,8BAA+B,IAAK,SAAU,CAAC,CAC1BA,CAAW,CCS5D,EAAS,EAAiB,SAAUC,CATxC,CACE,OACA,CACE,EAAG,mIACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,YAAa,IAAK,SAAU,CAAC,CAEHA,CAAW,CCA/C,EAAO,EAAiB,OAAQC,CATpC,CACE,OACA,CACE,EAAG,kIACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,6BAA8B,IAAK,SAAU,CAAC,CAExBA,CAAW,CCL3C,EAAS,EAAiB,SAAU,CAJxC,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,KAAM,IAAK,SAAU,CAAC,CAC1D,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,SAAU,CAAC,CACzD,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,SAAU,CAAC,CAEjB,CAAW,YCWrD,SAAA,EAAA,EAA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AAWpB,EAAiC,CACnD,GAAI,CAACA,GAAW,OAAOA,GAAY,SAAU,OAAO,KACpD,IAAMrB,EAAIqB,EAEV,OADI,OAAOrB,EAAE,SAAe,SAAiBA,EAAE,QACxC,KAGT,SAAS2C,EAAetB,EAAiC,CACvD,GAAI,CAACA,GAAW,OAAOA,GAAY,SAAU,OAAO,KAEpD,IAAMxB,EAAIG,EAAE,YAIZ,OAHI,OAAOH,GAAM,UAAYA,EAAE9B,SAAW,EAAU,KAG7C,oDAAoDoM,KAAKtK,EAAE,CAAGA,EAAI,KAG3E,SAASgD,EAASxB,EAAiC,CACjD,GAAI,CAACA,GAAW,OAAOA,GAAY,SAAU,OAAO,KAEpD,IAAMxB,EAAIG,EAAE,MAEZ,OADI,OAAOH,GAAM,UAAYA,EAAE9B,OAAS,EAAU8B,EAC3C"}
@@ -0,0 +1,2 @@
1
+ import{c as e,i as t,n,r,s as i,u as a}from"./Button-DPVQuma9.js";import{f as o,n as s}from"./index-DkobhtBa.js";import{t as c}from"./EmptyNote-C4quX2dg.js";import{t as l}from"./Modal-BVbdN0gj.js";import{n as u,t as d}from"./Skeleton-D7Z-VTMo.js";var f=a(e()),p=i();function m(){let[e,t]=(0,f.useState)(null),n=o({queryKey:[`receipts`,`list`],queryFn:()=>s.receipts({limit:200}),refetchInterval:2e4}),i=o({queryKey:[`receipts`,`detail`,e],queryFn:()=>e==null?Promise.resolve(null):s.receipt(e),enabled:e!=null}),a=(0,f.useMemo)(()=>g(n.data?.receipts??[]),[n.data]),m=(0,f.useMemo)(()=>(n.data?.receipts??[]).reduce((e,t)=>e+(t.costUsd??0),0),[n.data]);return(0,p.jsxs)(`div`,{className:`-mx-6 -my-6 flex flex-col`,children:[(0,p.jsxs)(`section`,{className:`flex items-end justify-between gap-4 border-b border-ink-rule px-6 pb-5 pt-6`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`ln-eyebrow`,children:`The Ledger · Receipts`}),(0,p.jsx)(`h1`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:44,fontWeight:600,letterSpacing:`-0.025em`,lineHeight:.98},children:`Signed, most recent first.`})]}),(0,p.jsx)(`div`,{className:`text-right font-mono text-[11px] text-ink-faint`,children:n.data?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`span`,{className:`text-ink-cream-2`,children:n.data.receipts.length}),` `,(0,p.jsx)(`span`,{className:`text-ink-muted`,children:`shown`})]}),(0,p.jsxs)(`div`,{className:`mt-0.5`,children:[(0,p.jsx)(`span`,{className:`text-[color:var(--ink-spend-2)]`,children:r(m)}),` `,(0,p.jsx)(`span`,{className:`text-ink-muted`,children:`total`})]})]}):(0,p.jsx)(d,{lines:2,widths:[`96px`,`64px`]})})]}),(0,p.jsx)(`section`,{children:n.isLoading?(0,p.jsx)(`div`,{children:Array.from({length:8},(e,t)=>(0,p.jsx)(u,{},t))}):n.data?.receipts.length===0?(0,p.jsx)(`div`,{className:`px-6 py-8`,children:(0,p.jsx)(c,{note:`No receipts yet. Every call the agent makes leaves one; one always beats zero.`,cli:`oneshot-gtm motion show-hn`})}):(0,p.jsx)(`div`,{children:a.map(e=>(0,p.jsx)(h,{group:e,onClickRow:e=>t(e)},e.key))})}),(0,p.jsx)(l,{open:e!=null,title:i.data?.receipt.playName??`receipt`,subtitle:i.data?`#${e} · ${i.data.receipt.callType}`:`#${e}`,onClose:()=>t(null),width:720,children:i.isLoading?(0,p.jsx)(d,{lines:8}):(0,p.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto rounded-[var(--radius-md)] border border-ink-rule bg-ink-bg-deep p-3 font-mono text-[12px] leading-[1.55] text-ink-cream-2`,children:JSON.stringify(i.data?.receipt.signedReceipt??{},null,2)})})]})}function h({group:e,onClickRow:i}){return(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-baseline justify-between border-b border-ink-rule/80 bg-ink-bg/95 px-6 py-2.5 backdrop-blur-[2px]`,children:[(0,p.jsx)(`div`,{className:`ln-eyebrow text-ink-cream-2`,children:e.label}),(0,p.jsxs)(`div`,{className:`font-mono text-[11px] text-ink-faint`,children:[(0,p.jsx)(`span`,{className:`text-ink-cream-2`,children:e.count}),` call`,e.count===1?``:`s`,e.totalCost>0&&(0,p.jsxs)(p.Fragment,{children:[` · `,(0,p.jsx)(`span`,{className:`text-[color:var(--ink-spend-2)]`,children:r(e.totalCost)})]})]})]}),(0,p.jsx)(`table`,{className:`w-full text-[13px]`,children:(0,p.jsx)(`tbody`,{children:e.rows.map((e,a)=>(0,p.jsxs)(`tr`,{onClick:()=>i(e.id),className:n(`cursor-pointer border-b border-ink-rule/50`,`transition-colors duration-[var(--dur-stamp)]`,`hover:bg-ink-surface/60`,a%2==1&&`bg-ink-surface/15`),children:[(0,p.jsxs)(`td`,{className:`w-[72px] px-6 py-2 font-mono text-[11px] text-ink-faint`,children:[`#`,e.id]}),(0,p.jsx)(`td`,{className:`py-2 text-ink-cream`,children:e.playName}),(0,p.jsx)(`td`,{className:`py-2 font-mono text-[12px] text-ink-muted`,children:e.callType}),(0,p.jsx)(`td`,{className:`w-[88px] py-2 text-right font-mono text-ink-cream`,children:e.costUsd==null?(0,p.jsx)(`span`,{className:`text-ink-faint`,children:`—`}):r(e.costUsd)}),(0,p.jsx)(`td`,{className:`w-[72px] py-2 text-right font-mono text-[12px] text-ink-muted`,children:t(e.createdAt)}),(0,p.jsx)(`td`,{className:`w-[200px] px-6 py-2 text-right font-mono text-[11px] text-ink-faint truncate`,children:e.oneshotRequestId??`—`})]},e.id))})})]})}function g(e){let t=new Date,n=_(t),r=(()=>{let e=new Date(t);return e.setDate(e.getDate()-1),_(e)})(),i=[],a=new Map;for(let t of e){let e=new Date(t.createdAt);if(Number.isNaN(e.getTime()))continue;let o=_(e),s=a.get(o);s||(s={key:o,label:v(e,o,n,r),count:0,totalCost:0,rows:[]},a.set(o,s),i.push(s)),s.rows.push(t),s.count++,s.totalCost+=t.costUsd??0}return i}function _(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function v(e,t,n,r){return t===n?`Today`:t===r?`Yesterday`:e.toLocaleDateString(void 0,{weekday:`long`,month:`long`,day:`numeric`})}export{m as component};
2
+ //# sourceMappingURL=receipts-CzIfb6zY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receipts-CzIfb6zY.js","names":["useQuery","useMemo","useState","api","EmptyNote","Modal","Skeleton","SkeletonRow","cn","formatUsd","timeAgo","DayGroup","key","label","count","totalCost","rows","ReceiptView","ReceiptsPage","activeId","setActiveId","receipts","queryKey","queryFn","limit","refetchInterval","detail","Promise","resolve","receipt","enabled","groups","groupByDay","data","reduce","a","r","costUsd","fontFamily","fontSize","fontWeight","letterSpacing","lineHeight","length","isLoading","Array","from","_","i","map","g","id","playName","callType","JSON","stringify","signedReceipt","DaySection","group","onClickRow","createdAt","oneshotRequestId","now","Date","today","dayKey","yesterday","d","setDate","getDate","byKey","Map","Number","isNaN","getTime","get","formatDayLabel","set","push","getFullYear","String","getMonth","padStart","toLocaleDateString","undefined","weekday","month","day","component"],"sources":["../../src/routes/receipts.tsx?tsr-split=component"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { useMemo, useState } from \"react\";\nimport type { ReceiptView } from \"@oneshot-gtm/shared-types\";\nimport { api } from \"../api/client.ts\";\nimport { EmptyNote } from \"../components/primitives/EmptyNote.tsx\";\nimport { Modal } from \"../components/primitives/Modal.tsx\";\nimport { Skeleton, SkeletonRow } from \"../components/primitives/Skeleton.tsx\";\nimport { cn, formatUsd, timeAgo } from \"../lib/cn.ts\";\n\nexport const Route = createFileRoute(\"/receipts\")({\n component: ReceiptsPage,\n});\n\ninterface DayGroup {\n key: string;\n label: string;\n count: number;\n totalCost: number;\n rows: ReceiptView[];\n}\n\nfunction ReceiptsPage() {\n const [activeId, setActiveId] = useState<number | null>(null);\n const receipts = useQuery({\n queryKey: [\"receipts\", \"list\"],\n queryFn: () => api.receipts({ limit: 200 }),\n refetchInterval: 20_000,\n });\n const detail = useQuery({\n queryKey: [\"receipts\", \"detail\", activeId],\n queryFn: () => (activeId == null ? Promise.resolve(null) : api.receipt(activeId)),\n enabled: activeId != null,\n });\n\n const groups = useMemo(() => groupByDay(receipts.data?.receipts ?? []), [receipts.data]);\n const totalCost = useMemo(\n () => (receipts.data?.receipts ?? []).reduce((a, r) => a + (r.costUsd ?? 0), 0),\n [receipts.data],\n );\n\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n {/* Masthead */}\n <section className=\"flex items-end justify-between gap-4 border-b border-ink-rule px-6 pb-5 pt-6\">\n <div>\n <div className=\"ln-eyebrow\">The Ledger · Receipts</div>\n <h1\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 44,\n fontWeight: 600,\n letterSpacing: \"-0.025em\",\n lineHeight: 0.98,\n }}\n >\n Signed, most recent first.\n </h1>\n </div>\n <div className=\"text-right font-mono text-[11px] text-ink-faint\">\n {receipts.data ? (\n <>\n <div>\n <span className=\"text-ink-cream-2\">{receipts.data.receipts.length}</span>{\" \"}\n <span className=\"text-ink-muted\">shown</span>\n </div>\n <div className=\"mt-0.5\">\n <span className=\"text-[color:var(--ink-spend-2)]\">{formatUsd(totalCost)}</span>{\" \"}\n <span className=\"text-ink-muted\">total</span>\n </div>\n </>\n ) : (\n <Skeleton lines={2} widths={[\"96px\", \"64px\"]} />\n )}\n </div>\n </section>\n\n {/* Receipts timeline — grouped by day, newest day first */}\n <section>\n {receipts.isLoading ? (\n <div>\n {Array.from({ length: 8 }, (_, i) => (\n <SkeletonRow key={i} />\n ))}\n </div>\n ) : receipts.data?.receipts.length === 0 ? (\n <div className=\"px-6 py-8\">\n <EmptyNote\n note=\"No receipts yet. Every call the agent makes leaves one; one always beats zero.\"\n cli=\"oneshot-gtm motion show-hn\"\n />\n </div>\n ) : (\n <div>\n {groups.map((g) => (\n <DaySection key={g.key} group={g} onClickRow={(id) => setActiveId(id)} />\n ))}\n </div>\n )}\n </section>\n\n <Modal\n open={activeId != null}\n title={detail.data?.receipt.playName ?? \"receipt\"}\n subtitle={detail.data ? `#${activeId} · ${detail.data.receipt.callType}` : `#${activeId}`}\n onClose={() => setActiveId(null)}\n width={720}\n >\n {detail.isLoading ? (\n <Skeleton lines={8} />\n ) : (\n <pre className=\"max-h-[60vh] overflow-auto rounded-[var(--radius-md)] border border-ink-rule bg-ink-bg-deep p-3 font-mono text-[12px] leading-[1.55] text-ink-cream-2\">\n {JSON.stringify(detail.data?.receipt.signedReceipt ?? {}, null, 2)}\n </pre>\n )}\n </Modal>\n </div>\n );\n}\n\nfunction DaySection({ group, onClickRow }: { group: DayGroup; onClickRow: (id: number) => void }) {\n return (\n <div>\n {/* Day header — sticky so you always know which day you're scrolling through. */}\n <div className=\"sticky top-0 z-10 flex items-baseline justify-between border-b border-ink-rule/80 bg-ink-bg/95 px-6 py-2.5 backdrop-blur-[2px]\">\n <div className=\"ln-eyebrow text-ink-cream-2\">{group.label}</div>\n <div className=\"font-mono text-[11px] text-ink-faint\">\n <span className=\"text-ink-cream-2\">{group.count}</span> call\n {group.count === 1 ? \"\" : \"s\"}\n {group.totalCost > 0 && (\n <>\n {\" · \"}\n <span className=\"text-[color:var(--ink-spend-2)]\">{formatUsd(group.totalCost)}</span>\n </>\n )}\n </div>\n </div>\n <table className=\"w-full text-[13px]\">\n <tbody>\n {group.rows.map((r, i) => (\n <tr\n key={r.id}\n onClick={() => onClickRow(r.id)}\n className={cn(\n \"cursor-pointer border-b border-ink-rule/50\",\n \"transition-colors duration-[var(--dur-stamp)]\",\n \"hover:bg-ink-surface/60\",\n i % 2 === 1 && \"bg-ink-surface/15\",\n )}\n >\n <td className=\"w-[72px] px-6 py-2 font-mono text-[11px] text-ink-faint\">#{r.id}</td>\n <td className=\"py-2 text-ink-cream\">{r.playName}</td>\n <td className=\"py-2 font-mono text-[12px] text-ink-muted\">{r.callType}</td>\n <td className=\"w-[88px] py-2 text-right font-mono text-ink-cream\">\n {r.costUsd != null ? (\n formatUsd(r.costUsd)\n ) : (\n <span className=\"text-ink-faint\">—</span>\n )}\n </td>\n <td className=\"w-[72px] py-2 text-right font-mono text-[12px] text-ink-muted\">\n {timeAgo(r.createdAt)}\n </td>\n <td className=\"w-[200px] px-6 py-2 text-right font-mono text-[11px] text-ink-faint truncate\">\n {r.oneshotRequestId ?? \"—\"}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\n/**\n * Bucket receipts by local-calendar day. Assumes `receipts` is already in\n * reverse-chron order from the server; within a bucket we preserve that\n * order so the first row is the most recent.\n */\nfunction groupByDay(receipts: ReceiptView[]): DayGroup[] {\n const now = new Date();\n const today = dayKey(now);\n const yesterday = (() => {\n const d = new Date(now);\n d.setDate(d.getDate() - 1);\n return dayKey(d);\n })();\n\n const groups: DayGroup[] = [];\n const byKey = new Map<string, DayGroup>();\n\n for (const r of receipts) {\n const d = new Date(r.createdAt);\n if (Number.isNaN(d.getTime())) continue;\n const key = dayKey(d);\n let g = byKey.get(key);\n if (!g) {\n g = {\n key,\n label: formatDayLabel(d, key, today, yesterday),\n count: 0,\n totalCost: 0,\n rows: [],\n };\n byKey.set(key, g);\n groups.push(g);\n }\n g.rows.push(r);\n g.count++;\n g.totalCost += r.costUsd ?? 0;\n }\n return groups;\n}\n\nfunction dayKey(d: Date): string {\n return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, \"0\")}-${String(d.getDate()).padStart(2, \"0\")}`;\n}\n\nfunction formatDayLabel(d: Date, key: string, today: string, yesterday: string): string {\n if (key === today) return \"Today\";\n if (key === yesterday) return \"Yesterday\";\n return d.toLocaleDateString(undefined, {\n weekday: \"long\",\n month: \"long\",\n day: \"numeric\",\n });\n}\n"],"mappings":"0QAsBA,SAASkB,GAAe,CACtB,GAAM,CAACC,EAAUC,IAAAA,EAA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AS,EAAG,IAAI,CAAA,GAAIF,OAAOb,EAAEE,SAAS,CAAC,CAACa,SAAS,EAAG,IAAI,GAGhH,SAASN,EAAeT,EAASvD,EAAaoD,EAAeE,EAA2B,CAGtF,OAFItD,IAAQoD,EAAc,QACtBpD,IAAQsD,EAAkB,YACvBC,EAAEgB,mBAAmBC,IAAAA,GAAW,CACrCC,QAAS,OACTC,MAAO,OACPC,IAAK,UACN,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{c as e,i as t,n,o as r,r as i,s as a,t as o,u as s}from"./Button-DPVQuma9.js";import{a as c,f as l,n as u,s as d,u as f}from"./index-DkobhtBa.js";import{t as p}from"./EmptyNote-C4quX2dg.js";import{n as m}from"./Skeleton-D7Z-VTMo.js";var h=r(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),g=s(e(),1);function _(e,t=!1){let[n,r]=(0,g.useState)(t);return(0,g.useEffect)(()=>{try{let t=localStorage.getItem(e);(t===`1`||t===`true`)&&r(!0)}catch{}},[e]),[n,t=>{r(t);try{localStorage.setItem(e,t?`1`:`0`)}catch{}}]}var v=a(),y=[{id:`icp`,title:`Set your ICP`,lede:`The find layer's classifier drops candidates that don't match. Without one, every result passes through and you'll review more noise than signal.`,cta:`Open ICP setup`,href:`/setup`},{id:`find`,title:`Run your first finder`,lede:`Pick a trigger (Show HN is cheapest) and click Run now. Results land in the queue for your review before anything sends.`,cta:`Open the queue`,href:`/queue`},{id:`drain`,title:`Approve a target and drain`,lede:`Approve a queued row, then click drain to send. The cadence engine takes over from there.`,cta:`Open the queue`,href:`/queue`}],b=`oneshot-gtm:onboarding-skipped`;function x(){let[e,t]=_(b),n=l({queryKey:[`setup`],queryFn:u.setupStatus}),r=l({queryKey:[`triggers`],queryFn:u.triggers}),i=l({queryKey:[`queue`,`recent`,`home`],queryFn:()=>u.queue({limit:16})});if(e||n.isLoading||r.isLoading||i.isLoading)return null;let a={icp:(n.data?.cfg.icpOneLiner??``).trim().length>0,find:(r.data?.triggers??[]).some(e=>e.lastPolledAt!==null)||(i.data?.counts.pending??0)+(i.data?.counts.sent??0)>0,drain:(i.data?.counts.sent??0)>0},s=y.findIndex(e=>!a[e.id]);if(s===-1)return null;let c=y[s];return(0,v.jsx)(`section`,{className:`border-b border-ink-rule bg-ink-bg-deep px-6 py-6`,children:(0,v.jsxs)(`div`,{className:`flex items-start justify-between gap-6 rounded-[var(--radius-lg)] border border-ink-rule bg-ink-surface px-6 py-5 shadow-[var(--shadow-inset)]`,children:[(0,v.jsxs)(`div`,{className:`flex-1`,children:[(0,v.jsxs)(`div`,{className:`ln-eyebrow`,children:[`Next step · `,s+1,` of `,y.length]}),(0,v.jsx)(`h2`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:26,fontWeight:600,letterSpacing:`-0.02em`,lineHeight:1.05},children:c.title}),(0,v.jsx)(`p`,{className:`mt-1.5 max-w-2xl text-sm leading-relaxed text-ink-cream-2`,children:c.lede})]}),(0,v.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,v.jsx)(f,{to:c.href,children:(0,v.jsxs)(o,{size:`sm`,variant:`primary`,children:[c.cta,` `,(0,v.jsx)(h,{size:12})]})}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:`font-mono text-[11px] text-ink-faint transition-colors hover:text-ink-muted`,children:`Skip`})]})]})})}function S({receipts:e,queue:t,loading:n,limit:r=10}){let i=w(e,t,r);return(0,v.jsxs)(`section`,{className:`flex flex-col border-b border-ink-rule`,children:[(0,v.jsxs)(`div`,{className:`flex items-baseline justify-between px-6 pb-2 pt-5`,children:[(0,v.jsx)(`div`,{className:`ln-eyebrow`,children:`Signal feed`}),(0,v.jsx)(`div`,{className:`font-mono text-[11px] text-ink-faint`,children:`newest first · refresh · 30s`})]}),n?(0,v.jsx)(`div`,{className:`px-6 pb-5 font-mono text-[11.5px] text-ink-faint`,children:`…`}):i.length===0?(0,v.jsx)(`div`,{className:`px-6 pb-5`,children:(0,v.jsx)(`p`,{className:`ln-note max-w-[56ch] text-[13.5px] text-ink-cream-2`,children:`Nothing on the wire yet. Send a play or run a trigger — events stream in here as they happen.`})}):(0,v.jsx)(`ol`,{className:`flex flex-col`,children:i.map(e=>(0,v.jsx)(C,{event:e},e.id))})]})}function C({event:e}){let r=e.kind===`receipt`?c:d,i=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`span`,{"aria-hidden":`true`,className:n(`inline-flex h-[18px] w-[18px] items-center justify-center`,`rounded-[var(--radius-xs)] border border-ink-rule bg-ink-bg-deep shrink-0`,e.kind===`receipt`?`text-[color:var(--ink-receipt-2)]`:`text-[color:var(--ink-signal-2)]`),children:(0,v.jsx)(r,{size:10})}),(0,v.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,v.jsx)(`span`,{className:`truncate text-ink-cream`,children:e.headline}),(0,v.jsxs)(`span`,{className:`truncate font-mono text-[11.5px] text-ink-faint`,children:[`· `,e.meta]})]}),(0,v.jsx)(`time`,{className:`shrink-0 font-mono text-[11.5px] text-ink-muted`,dateTime:e.at,children:t(e.at)}),e.href&&(0,v.jsx)(h,{size:11,className:`shrink-0 text-ink-faint transition-colors group-hover:text-ink-cream-2`})]}),a=n(`group flex items-center gap-3 border-t border-ink-rule/60 px-6 py-2`,`transition-colors duration-[var(--dur-stamp)]`,e.href&&`hover:bg-ink-surface/60 cursor-pointer`);return e.href?(0,v.jsx)(`li`,{children:(0,v.jsx)(f,{to:e.href,className:n(a,`no-underline`),children:i})}):(0,v.jsx)(`li`,{className:a,children:i})}function w(e,t,n){let r=[];for(let t of e)r.push({id:`r-${t.id}`,kind:`receipt`,at:t.createdAt,headline:`${t.playName} · ${t.callType}`,meta:t.costUsd==null?`no cost on record`:`$${t.costUsd.toFixed(2)}`,href:`/receipts`});for(let e of t){let t=T(e.payload);r.push({id:`q-${e.id}`,kind:`queue`,at:e.foundAt,headline:`${e.playName} · ${t??`(no email)`}`,meta:`from ${e.source}`,href:`/queue`})}return r.sort((e,t)=>new Date(t.at).getTime()-new Date(e.at).getTime()),r.slice(0,n)}function T(e){if(!e||typeof e!=`object`)return null;let t=e,n=t.email??t.founderEmail;return typeof n==`string`?n:null}function E(){let e=l({queryKey:[`home`],queryFn:u.home,refetchInterval:3e4}),r=l({queryKey:[`receipts`,`recent`],queryFn:()=>u.receipts({limit:16}),refetchInterval:15e3}),a=l({queryKey:[`queue`,`recent`,`home`],queryFn:()=>u.queue({limit:16}),refetchInterval:3e4}),o=e.data;return(0,v.jsxs)(`div`,{className:`-mx-6 -my-6 flex flex-col`,children:[(0,v.jsx)(`section`,{className:`border-b border-ink-rule px-6 pb-5 pt-6`,children:(0,v.jsxs)(`div`,{className:`flex items-end justify-between gap-6`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`div`,{className:`ln-eyebrow`,children:`The Ledger · Today`}),(0,v.jsx)(`h1`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:44,letterSpacing:`-0.025em`,lineHeight:.98,fontWeight:600},children:`Signed, in ink.`})]}),(0,v.jsxs)(`div`,{className:`hidden text-right font-mono text-[11px] text-ink-faint md:block`,children:[new Date().toLocaleDateString(void 0,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`}),(0,v.jsx)(`div`,{className:`mt-0.5`,children:`refresh · 30s`})]})]})}),(0,v.jsx)(x,{}),(0,v.jsxs)(`section`,{className:`grid grid-cols-2 divide-x divide-ink-rule border-b border-ink-rule lg:grid-cols-4`,children:[(0,v.jsx)(D,{label:`Replied · 7d`,value:o?String(o.repliedLast7d):void 0,caption:`reply · the only metric that matters`,tone:`receipt`}),(0,v.jsx)(D,{label:`Sent · 7d`,value:o?String(o.sentLast7d):void 0,caption:`drafts, linted, stamped`}),(0,v.jsx)(D,{label:`Spend · 7d`,value:o?i(o.spendUsd7d):void 0,caption:o?`${o.callsLast7d} OneShot calls`:void 0,tone:`spend`}),(0,v.jsx)(D,{label:`Active cadences`,value:o?String(o.activeCadences):void 0,caption:`in flight, awaiting reply`})]}),(0,v.jsx)(S,{receipts:r.data?.receipts??[],queue:a.data?.rows??[],loading:r.isLoading||a.isLoading,limit:10}),(0,v.jsxs)(`section`,{className:`flex flex-col border-b border-ink-rule`,children:[(0,v.jsxs)(`div`,{className:`flex items-baseline justify-between px-6 pb-2 pt-5`,children:[(0,v.jsx)(`div`,{className:`ln-eyebrow`,children:`Recent receipts`}),(0,v.jsxs)(f,{to:`/receipts`,className:`flex items-center gap-1 font-mono text-[11px] text-ink-muted transition-colors hover:text-ink-cream`,children:[`all `,(0,v.jsx)(h,{size:10})]})]}),r.isLoading?(0,v.jsx)(`div`,{children:Array.from({length:5},(e,t)=>(0,v.jsx)(m,{},t))}):r.data?.receipts.length===0?(0,v.jsx)(`div`,{className:`px-6 pb-6`,children:(0,v.jsx)(p,{note:`No receipts yet. Every call the agent makes leaves one — a short ledger is an honest ledger.`,cli:`oneshot-gtm motion show-hn`})}):(0,v.jsxs)(`table`,{className:`w-full text-[13px]`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{className:`text-[10px] uppercase tracking-[0.14em] text-ink-faint`,children:[(0,v.jsx)(`th`,{className:`px-6 py-2 text-left font-medium`,children:`id`}),(0,v.jsx)(`th`,{className:`py-2 text-left font-medium`,children:`play`}),(0,v.jsx)(`th`,{className:`py-2 text-left font-medium`,children:`type`}),(0,v.jsx)(`th`,{className:`py-2 text-right font-medium`,children:`cost`}),(0,v.jsx)(`th`,{className:`px-6 py-2 text-right font-medium`,children:`when`})]})}),(0,v.jsx)(`tbody`,{children:r.data?.receipts.map((e,r)=>(0,v.jsxs)(`tr`,{className:n(`border-t border-ink-rule/60 transition-colors duration-[var(--dur-stamp)]`,`hover:bg-ink-surface/50`,r%2==1&&`bg-ink-surface/20`),children:[(0,v.jsxs)(`td`,{className:`px-6 py-2 font-mono text-[11px] text-ink-faint`,children:[`#`,e.id]}),(0,v.jsx)(`td`,{className:`py-2 text-ink-cream`,children:e.playName}),(0,v.jsx)(`td`,{className:`py-2 font-mono text-[12px] text-ink-muted`,children:e.callType}),(0,v.jsx)(`td`,{className:`py-2 text-right font-mono text-ink-cream`,children:e.costUsd==null?(0,v.jsx)(`span`,{className:`text-ink-faint`,children:`—`}):i(e.costUsd)}),(0,v.jsx)(`td`,{className:`px-6 py-2 text-right font-mono text-[12px] text-ink-faint`,children:t(e.createdAt)})]},e.id))})]})]}),(0,v.jsxs)(`section`,{className:`grid grid-cols-1 gap-8 px-6 py-8 lg:grid-cols-[1fr_280px]`,children:[(0,v.jsxs)(`div`,{className:`max-w-[58ch]`,children:[(0,v.jsx)(`div`,{className:`ln-eyebrow`,children:`Editor's note`}),(0,v.jsx)(`p`,{className:`ln-prose mt-2 max-w-[58ch] text-[14.5px] text-ink-cream-2`,children:`Spend is the cost of proof. Every send came with a signed receipt; every receipt keeps you honest with yourself. A short ledger is an honest ledger — one send always beats zero.`})]}),(0,v.jsxs)(`div`,{className:`border-l border-ink-rule pl-6`,children:[(0,v.jsx)(`div`,{className:`ln-eyebrow`,children:`Spend · 30d`}),(0,v.jsx)(`div`,{className:`mt-1 text-ink-cream ln-numeral`,style:{fontSize:36,lineHeight:1},children:o?i(o.spendUsd30d):(0,v.jsx)(`span`,{className:`text-ink-faint`,children:`$—`})}),(0,v.jsx)(`div`,{className:`mt-2 font-mono text-[11px] text-ink-muted`,children:o?`${o.callsLast7d} calls this week`:`…`})]})]})]})}function D({label:e,value:t,caption:n,tone:r=`neutral`}){return(0,v.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,v.jsx)(`div`,{className:`ln-eyebrow`,children:e}),(0,v.jsx)(`div`,{className:`mt-1 truncate text-ink-cream ln-numeral`,style:{fontSize:44,lineHeight:1},children:t??(0,v.jsx)(`span`,{className:`text-ink-faint`,children:`—`})}),n&&(0,v.jsx)(`div`,{className:`mt-2 truncate font-mono text-[11px]`,style:{color:r===`spend`?`var(--ink-spend-2)`:r===`receipt`?`var(--ink-receipt-2)`:`var(--ink-faint)`},children:n})]})}export{E as component};
2
+ //# sourceMappingURL=routes-BEYqVix5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes-BEYqVix5.js","names":["useQuery","Link","ArrowRight","api","NextStep","SignalFeed","EmptyNote","SkeletonRow","cn","formatUsd","timeAgo","HomePage","home","queryKey","queryFn","refetchInterval","recent","receipts","limit","queueRecent","queue","d","data","fontFamily","fontSize","letterSpacing","lineHeight","fontWeight","Date","toLocaleDateString","undefined","weekday","year","month","day","String","repliedLast7d","sentLast7d","spendUsd7d","callsLast7d","activeCadences","rows","isLoading","Array","from","length","_","i","map","r","id","playName","callType","costUsd","createdAt","spendUsd30d","LedgerNumber","label","value","caption","tone","captionColor","color","component"],"sources":["../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/arrow-right.mjs","../../src/lib/useLocalStorage.ts","../../src/components/home/NextStep.tsx","../../src/components/home/SignalFeed.tsx","../../src/routes/index.tsx?tsr-split=component"],"sourcesContent":["/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n];\nconst ArrowRight = createLucideIcon(\"arrow-right\", __iconNode);\n\nexport { __iconNode, ArrowRight as default };\n//# sourceMappingURL=arrow-right.mjs.map\n","import { useEffect, useState } from \"react\";\n\n/**\n * Boolean-flag persistence to localStorage. SSR-safe (initial render uses\n * `initial`; the actual stored value is hydrated in an effect). Swallows\n * errors from private mode / disabled storage so the UI never crashes.\n *\n * First localStorage usage in the web app — kept intentionally minimal.\n * Generalize only when a second consumer appears.\n */\nexport function useLocalStorage(key: string, initial = false): [boolean, (v: boolean) => void] {\n const [value, setValue] = useState<boolean>(initial);\n useEffect(() => {\n try {\n const raw = localStorage.getItem(key);\n if (raw === \"1\" || raw === \"true\") setValue(true);\n } catch {\n // private mode / SSR — ignore\n }\n }, [key]);\n const set = (v: boolean): void => {\n setValue(v);\n try {\n localStorage.setItem(key, v ? \"1\" : \"0\");\n } catch {\n // ignore\n }\n };\n return [value, set];\n}\n","import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { ArrowRight } from \"lucide-react\";\nimport { api } from \"../../api/client.ts\";\nimport { Button } from \"../primitives/Button.tsx\";\nimport { useLocalStorage } from \"../../lib/useLocalStorage.ts\";\n\ninterface Step {\n id: \"icp\" | \"find\" | \"drain\";\n title: string;\n lede: string;\n cta: string;\n href: \"/setup\" | \"/queue\";\n}\n\nconst STEPS: Step[] = [\n {\n id: \"icp\",\n title: \"Set your ICP\",\n lede: \"The find layer's classifier drops candidates that don't match. Without one, every result passes through and you'll review more noise than signal.\",\n cta: \"Open ICP setup\",\n href: \"/setup\",\n },\n {\n id: \"find\",\n title: \"Run your first finder\",\n lede: \"Pick a trigger (Show HN is cheapest) and click Run now. Results land in the queue for your review before anything sends.\",\n cta: \"Open the queue\",\n href: \"/queue\",\n },\n {\n id: \"drain\",\n title: \"Approve a target and drain\",\n lede: \"Approve a queued row, then click drain to send. The cadence engine takes over from there.\",\n cta: \"Open the queue\",\n href: \"/queue\",\n },\n];\n\nconst SKIP_KEY = \"oneshot-gtm:onboarding-skipped\";\n\nexport function NextStep() {\n const [skipped, setSkipped] = useLocalStorage(SKIP_KEY);\n\n const setup = useQuery({ queryKey: [\"setup\"], queryFn: api.setupStatus });\n const triggers = useQuery({ queryKey: [\"triggers\"], queryFn: api.triggers });\n // Reuses the cache key from index.tsx's home queue query.\n const queue = useQuery({\n queryKey: [\"queue\", \"recent\", \"home\"],\n queryFn: () => api.queue({ limit: 16 }),\n });\n\n if (skipped) return null;\n if (setup.isLoading || triggers.isLoading || queue.isLoading) return null;\n\n const icpDone = (setup.data?.cfg.icpOneLiner ?? \"\").trim().length > 0;\n const findDone =\n (triggers.data?.triggers ?? []).some((t) => t.lastPolledAt !== null) ||\n (queue.data?.counts.pending ?? 0) + (queue.data?.counts.sent ?? 0) > 0;\n const drainDone = (queue.data?.counts.sent ?? 0) > 0;\n\n const done: Record<Step[\"id\"], boolean> = { icp: icpDone, find: findDone, drain: drainDone };\n const ix = STEPS.findIndex((s) => !done[s.id]);\n if (ix === -1) return null;\n\n const step = STEPS[ix]!;\n\n return (\n <section className=\"border-b border-ink-rule bg-ink-bg-deep px-6 py-6\">\n <div className=\"flex items-start justify-between gap-6 rounded-[var(--radius-lg)] border border-ink-rule bg-ink-surface px-6 py-5 shadow-[var(--shadow-inset)]\">\n <div className=\"flex-1\">\n <div className=\"ln-eyebrow\">\n Next step · {ix + 1} of {STEPS.length}\n </div>\n <h2\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 26,\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.05,\n }}\n >\n {step.title}\n </h2>\n <p className=\"mt-1.5 max-w-2xl text-sm leading-relaxed text-ink-cream-2\">{step.lede}</p>\n </div>\n <div className=\"flex flex-col items-end gap-2\">\n <Link to={step.href}>\n <Button size=\"sm\" variant=\"primary\">\n {step.cta} <ArrowRight size={12} />\n </Button>\n </Link>\n <button\n type=\"button\"\n onClick={() => setSkipped(true)}\n className=\"font-mono text-[11px] text-ink-faint transition-colors hover:text-ink-muted\"\n >\n Skip\n </button>\n </div>\n </div>\n </section>\n );\n}\n","import { Link } from \"@tanstack/react-router\";\nimport { ArrowRight, Inbox, Receipt } from \"lucide-react\";\nimport type { QueueRowView, ReceiptView } from \"@oneshot-gtm/shared-types\";\nimport { cn, timeAgo } from \"../../lib/cn.ts\";\n\n/**\n * A reverse-chron signal feed — the \"what's happening right now\" list\n * the founder checks first thing in the morning. Merges two event\n * streams (receipts + queue rows) into one ruled timeline.\n *\n * ● signed receipt — something was sent, spent, or searched\n * ◉ queued candidate — a trigger or finder landed a new target\n *\n * Each event links to its canonical source (receipt id / queue row) so\n * you can drill down. Pure client-side — no new API.\n */\n\ninterface FeedEvent {\n id: string;\n kind: \"receipt\" | \"queue\";\n at: string; // iso\n headline: string;\n meta: string;\n href?: string;\n}\n\nexport function SignalFeed({\n receipts,\n queue,\n loading,\n limit = 10,\n}: {\n receipts: ReceiptView[];\n queue: QueueRowView[];\n loading: boolean;\n limit?: number;\n}) {\n const events = merge(receipts, queue, limit);\n\n return (\n <section className=\"flex flex-col border-b border-ink-rule\">\n <div className=\"flex items-baseline justify-between px-6 pb-2 pt-5\">\n <div className=\"ln-eyebrow\">Signal feed</div>\n <div className=\"font-mono text-[11px] text-ink-faint\">newest first · refresh · 30s</div>\n </div>\n {loading ? (\n <div className=\"px-6 pb-5 font-mono text-[11.5px] text-ink-faint\">…</div>\n ) : events.length === 0 ? (\n <div className=\"px-6 pb-5\">\n <p className=\"ln-note max-w-[56ch] text-[13.5px] text-ink-cream-2\">\n Nothing on the wire yet. Send a play or run a trigger — events stream in here as they\n happen.\n </p>\n </div>\n ) : (\n <ol className=\"flex flex-col\">\n {events.map((e) => (\n <FeedLine key={e.id} event={e} />\n ))}\n </ol>\n )}\n </section>\n );\n}\n\nfunction FeedLine({ event }: { event: FeedEvent }) {\n const Icon = event.kind === \"receipt\" ? Receipt : Inbox;\n const tone =\n event.kind === \"receipt\"\n ? \"text-[color:var(--ink-receipt-2)]\"\n : \"text-[color:var(--ink-signal-2)]\";\n const body = (\n <>\n <span\n aria-hidden=\"true\"\n className={cn(\n \"inline-flex h-[18px] w-[18px] items-center justify-center\",\n \"rounded-[var(--radius-xs)] border border-ink-rule bg-ink-bg-deep shrink-0\",\n tone,\n )}\n >\n <Icon size={10} />\n </span>\n <span className=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span className=\"truncate text-ink-cream\">{event.headline}</span>\n <span className=\"truncate font-mono text-[11.5px] text-ink-faint\">· {event.meta}</span>\n </span>\n <time className=\"shrink-0 font-mono text-[11.5px] text-ink-muted\" dateTime={event.at}>\n {timeAgo(event.at)}\n </time>\n {event.href && (\n <ArrowRight\n size={11}\n className=\"shrink-0 text-ink-faint transition-colors group-hover:text-ink-cream-2\"\n />\n )}\n </>\n );\n\n const classes = cn(\n \"group flex items-center gap-3 border-t border-ink-rule/60 px-6 py-2\",\n \"transition-colors duration-[var(--dur-stamp)]\",\n event.href && \"hover:bg-ink-surface/60 cursor-pointer\",\n );\n\n if (event.href) {\n return (\n <li>\n <Link to={event.href} className={cn(classes, \"no-underline\")}>\n {body}\n </Link>\n </li>\n );\n }\n return <li className={classes}>{body}</li>;\n}\n\nfunction merge(receipts: ReceiptView[], queue: QueueRowView[], limit: number): FeedEvent[] {\n const events: FeedEvent[] = [];\n\n for (const r of receipts) {\n events.push({\n id: `r-${r.id}`,\n kind: \"receipt\",\n at: r.createdAt,\n headline: `${r.playName} · ${r.callType}`,\n meta: r.costUsd != null ? `$${r.costUsd.toFixed(2)}` : \"no cost on record\",\n href: \"/receipts\",\n });\n }\n\n for (const q of queue) {\n const email = extractEmail(q.payload);\n events.push({\n id: `q-${q.id}`,\n kind: \"queue\",\n at: q.foundAt,\n headline: `${q.playName} · ${email ?? \"(no email)\"}`,\n meta: `from ${q.source}`,\n href: \"/queue\",\n });\n }\n\n events.sort((a, b) => new Date(b.at).getTime() - new Date(a.at).getTime());\n return events.slice(0, limit);\n}\n\nfunction extractEmail(payload: unknown): string | null {\n if (!payload || typeof payload !== \"object\") return null;\n const p = payload as Record<string, unknown>;\n const email = p[\"email\"] ?? p[\"founderEmail\"];\n return typeof email === \"string\" ? email : null;\n}\n","import { useQuery } from \"@tanstack/react-query\";\nimport { createFileRoute, Link } from \"@tanstack/react-router\";\nimport { ArrowRight } from \"lucide-react\";\nimport { api } from \"../api/client.ts\";\nimport { NextStep } from \"../components/home/NextStep.tsx\";\nimport { SignalFeed } from \"../components/home/SignalFeed.tsx\";\nimport { EmptyNote } from \"../components/primitives/EmptyNote.tsx\";\nimport { SkeletonRow } from \"../components/primitives/Skeleton.tsx\";\nimport { cn, formatUsd, timeAgo } from \"../lib/cn.ts\";\n\nexport const Route = createFileRoute(\"/\")({\n component: HomePage,\n});\n\nfunction HomePage() {\n const home = useQuery({ queryKey: [\"home\"], queryFn: api.home, refetchInterval: 30_000 });\n const recent = useQuery({\n queryKey: [\"receipts\", \"recent\"],\n queryFn: () => api.receipts({ limit: 16 }),\n refetchInterval: 15_000,\n });\n const queueRecent = useQuery({\n queryKey: [\"queue\", \"recent\", \"home\"],\n queryFn: () => api.queue({ limit: 16 }),\n refetchInterval: 30_000,\n });\n const d = home.data;\n\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n {/* Masthead — newspaper-style, no card */}\n <section className=\"border-b border-ink-rule px-6 pb-5 pt-6\">\n <div className=\"flex items-end justify-between gap-6\">\n <div>\n <div className=\"ln-eyebrow\">The Ledger · Today</div>\n <h1\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 44,\n letterSpacing: \"-0.025em\",\n lineHeight: 0.98,\n fontWeight: 600,\n }}\n >\n Signed, in ink.\n </h1>\n </div>\n <div className=\"hidden text-right font-mono text-[11px] text-ink-faint md:block\">\n {new Date().toLocaleDateString(undefined, {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n })}\n <div className=\"mt-0.5\">refresh · 30s</div>\n </div>\n </div>\n </section>\n\n {/* Onboarding nudge — disappears when ICP set + finder run + drain done. */}\n <NextStep />\n\n {/* KPI strip — 4 columns divided by vertical hairlines. No cards. */}\n <section className=\"grid grid-cols-2 divide-x divide-ink-rule border-b border-ink-rule lg:grid-cols-4\">\n <LedgerNumber\n label=\"Replied · 7d\"\n value={d ? String(d.repliedLast7d) : undefined}\n caption=\"reply · the only metric that matters\"\n tone=\"receipt\"\n />\n <LedgerNumber\n label=\"Sent · 7d\"\n value={d ? String(d.sentLast7d) : undefined}\n caption=\"drafts, linted, stamped\"\n />\n <LedgerNumber\n label=\"Spend · 7d\"\n value={d ? formatUsd(d.spendUsd7d) : undefined}\n caption={d ? `${d.callsLast7d} OneShot calls` : undefined}\n tone=\"spend\"\n />\n <LedgerNumber\n label=\"Active cadences\"\n value={d ? String(d.activeCadences) : undefined}\n caption=\"in flight, awaiting reply\"\n />\n </section>\n\n {/* Signal feed — reverse-chron timeline mixing receipts and queue events */}\n <SignalFeed\n receipts={recent.data?.receipts ?? []}\n queue={queueRecent.data?.rows ?? []}\n loading={recent.isLoading || queueRecent.isLoading}\n limit={10}\n />\n\n {/* Receipts ledger — full-bleed table, no card, newspaper-style */}\n <section className=\"flex flex-col border-b border-ink-rule\">\n <div className=\"flex items-baseline justify-between px-6 pb-2 pt-5\">\n <div className=\"ln-eyebrow\">Recent receipts</div>\n <Link\n to=\"/receipts\"\n className=\"flex items-center gap-1 font-mono text-[11px] text-ink-muted transition-colors hover:text-ink-cream\"\n >\n all <ArrowRight size={10} />\n </Link>\n </div>\n {recent.isLoading ? (\n <div>\n {Array.from({ length: 5 }, (_, i) => (\n <SkeletonRow key={i} />\n ))}\n </div>\n ) : recent.data?.receipts.length === 0 ? (\n <div className=\"px-6 pb-6\">\n <EmptyNote\n note=\"No receipts yet. Every call the agent makes leaves one — a short ledger is an honest ledger.\"\n cli=\"oneshot-gtm motion show-hn\"\n />\n </div>\n ) : (\n <table className=\"w-full text-[13px]\">\n <thead>\n <tr className=\"text-[10px] uppercase tracking-[0.14em] text-ink-faint\">\n <th className=\"px-6 py-2 text-left font-medium\">id</th>\n <th className=\"py-2 text-left font-medium\">play</th>\n <th className=\"py-2 text-left font-medium\">type</th>\n <th className=\"py-2 text-right font-medium\">cost</th>\n <th className=\"px-6 py-2 text-right font-medium\">when</th>\n </tr>\n </thead>\n <tbody>\n {recent.data?.receipts.map((r, i) => (\n <tr\n key={r.id}\n className={cn(\n \"border-t border-ink-rule/60 transition-colors duration-[var(--dur-stamp)]\",\n \"hover:bg-ink-surface/50\",\n i % 2 === 1 && \"bg-ink-surface/20\",\n )}\n >\n <td className=\"px-6 py-2 font-mono text-[11px] text-ink-faint\">#{r.id}</td>\n <td className=\"py-2 text-ink-cream\">{r.playName}</td>\n <td className=\"py-2 font-mono text-[12px] text-ink-muted\">{r.callType}</td>\n <td className=\"py-2 text-right font-mono text-ink-cream\">\n {r.costUsd != null ? (\n formatUsd(r.costUsd)\n ) : (\n <span className=\"text-ink-faint\">—</span>\n )}\n </td>\n <td className=\"px-6 py-2 text-right font-mono text-[12px] text-ink-faint\">\n {timeAgo(r.createdAt)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n </section>\n\n {/* Editorial footnote — the \"why\" of spend, no card */}\n <section className=\"grid grid-cols-1 gap-8 px-6 py-8 lg:grid-cols-[1fr_280px]\">\n <div className=\"max-w-[58ch]\">\n <div className=\"ln-eyebrow\">Editor's note</div>\n <p className=\"ln-prose mt-2 max-w-[58ch] text-[14.5px] text-ink-cream-2\">\n Spend is the cost of proof. Every send came with a signed receipt; every receipt keeps\n you honest with yourself. A short ledger is an honest ledger — one send always beats\n zero.\n </p>\n </div>\n <div className=\"border-l border-ink-rule pl-6\">\n <div className=\"ln-eyebrow\">Spend · 30d</div>\n <div className=\"mt-1 text-ink-cream ln-numeral\" style={{ fontSize: 36, lineHeight: 1 }}>\n {d ? formatUsd(d.spendUsd30d) : <span className=\"text-ink-faint\">$—</span>}\n </div>\n <div className=\"mt-2 font-mono text-[11px] text-ink-muted\">\n {d ? `${d.callsLast7d} calls this week` : \"…\"}\n </div>\n </div>\n </section>\n </div>\n );\n}\n\n/**\n * A single KPI in ledger-column style. No card chrome — just a column of\n * eyebrow label, big numeral, and caption underneath, separated from\n * neighbours by the vertical hairline on the parent grid.\n */\nfunction LedgerNumber({\n label,\n value,\n caption,\n tone = \"neutral\",\n}: {\n label: string;\n value: string | undefined;\n caption?: string;\n /** A subtle caption tint — the number itself stays cream. */\n tone?: \"neutral\" | \"spend\" | \"receipt\";\n}) {\n const captionColor =\n tone === \"spend\"\n ? \"var(--ink-spend-2)\"\n : tone === \"receipt\"\n ? \"var(--ink-receipt-2)\"\n : \"var(--ink-faint)\";\n return (\n <div className=\"px-5 py-4\">\n <div className=\"ln-eyebrow\">{label}</div>\n <div\n className=\"mt-1 truncate text-ink-cream ln-numeral\"\n style={{ fontSize: 44, lineHeight: 1 }}\n >\n {value ?? <span className=\"text-ink-faint\">—</span>}\n </div>\n {caption && (\n <div className=\"mt-2 truncate font-mono text-[11px]\" style={{ color: captionColor }}>\n {caption}\n </div>\n )}\n </div>\n );\n}\n"],"x_google_ignoreList":[0],"mappings":"gPAaA,IAAM,EAAa,EAAiB,cAAe,CAHjD,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,gBAAiB,IAAK,SAAU,CAAC,CAEE,CAAW,YCH9D,SAAgB,EAAgB,EAAa,EAAU,GAAwC,CAC7F,GAAM,CAAC,EAAO,IAAA,EAAA,EAAA,UAA8B,EAAQ,CAiBpD,OAhBA,EAAA,EAAA,eAAgB,CACd,GAAI,CACF,IAAM,EAAM,aAAa,QAAQ,EAAI,EACjC,IAAQ,KAAO,IAAQ,SAAQ,EAAS,GAAK,MAC3C,IAGP,CAAC,EAAI,CAAC,CASF,CAAC,EARK,GAAqB,CAChC,EAAS,EAAE,CACX,GAAI,CACF,aAAa,QAAQ,EAAK,EAAI,IAAM,IAAI,MAClC,IAIS,WCbf,EAAgB,CACpB,CACE,GAAI,MACJ,MAAO,eACP,KAAM,oJACN,IAAK,iBACL,KAAM,SACP,CACD,CACE,GAAI,OACJ,MAAO,wBACP,KAAM,2HACN,IAAK,iBACL,KAAM,SACP,CACD,CACE,GAAI,QACJ,MAAO,6BACP,KAAM,4FACN,IAAK,iBACL,KAAM,SACP,CACF,CAEK,EAAW,iCAEjB,SAAgB,GAAW,CACzB,GAAM,CAAC,EAAS,GAAc,EAAg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A,EAAA,KAAC,OAAD,CAAM,UAAU,0BAAiB,IAAQ,CAAA,CAChD,CAAA,CACJC,IACC,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,sCAAsC,MAAO,CAAEG,MAflEF,IAAS,QACL,qBACAA,IAAS,UACP,uBACA,mBAWiF,UAChFD,EAEJ,CAAA,CACG"}
@@ -0,0 +1,5 @@
1
+ import{c as e,n as t,o as n,s as r,t as i,u as a}from"./Button-DPVQuma9.js";import{o,t as s,u as c}from"./index-DkobhtBa.js";import{a as l,n as u,r as d,s as f,t as p}from"./Field-D9WpcA8z.js";var m=n(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),h=n(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),g=n(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),_=a(e()),v=r(),y={"show-hn":{description:`One-touch founder-to-founder reply to a recent Show HN post. References a specific comment thread.`,fields:[{key:`founderName`,label:`Founder name`,type:`text`,required:!0},{key:`founderEmail`,label:`Founder email`,type:`email`,required:!0},{key:`postTitle`,label:`Show HN title`,type:`text`,required:!0,placeholder:`Show HN: Acme — open-source durable workflows`},{key:`postUrl`,label:`Show HN URL`,type:`url`,required:!0},{key:`hookSummary`,label:`Hook (specific comment thread / detail to reference)`,type:`textarea`,required:!0}],defaultRow:{founderName:``,founderEmail:``,postTitle:``,postUrl:``,hookSummary:``}},"job-change":{description:`Triggered by a prospect starting a new role at a target company. Day-0 only here; cadence engine fires the day-5 follow-up automatically.`,fields:[{key:`name`,label:`Prospect name`,type:`text`,required:!0},{key:`email`,label:`Prospect email`,type:`email`,required:!0},{key:`newRole`,label:`New role`,type:`text`,required:!0},{key:`newCompany`,label:`New company`,type:`text`,required:!0},{key:`previousRole`,label:`Previous role`,type:`text`},{key:`previousCompany`,label:`Previous company`,type:`text`},{key:`linkedinUrl`,label:`LinkedIn URL (optional)`,type:`url`}],defaultRow:{name:``,email:``,newRole:``,newCompany:``,previousRole:``,previousCompany:``,linkedinUrl:``}},"accelerator-batch":{description:`Founder-to-founder outreach within or across accelerator batches (YC, On Deck, SPC, Antler, Techstars).`,fields:[{key:`name`,label:`Prospect name`,type:`text`,required:!0},{key:`email`,label:`Prospect email`,type:`email`,required:!0},{key:`company`,label:`Company`,type:`text`,required:!0},{key:`cohort`,label:`Cohort tag`,type:`text`,required:!0,placeholder:`yc-w26`},{key:`launchUrl`,label:`Launch URL (optional)`,type:`url`},{key:`productOneLiner`,label:`Their product one-liner`,type:`text`},{key:`linkedinUrl`,label:`LinkedIn URL (optional)`,type:`url`}],defaultRow:{name:``,email:``,company:``,cohort:``,launchUrl:``,productOneLiner:``,linkedinUrl:``},extras:[{key:`senderCohort`,label:`Your cohort tag (sender)`,type:`text`,required:!0,placeholder:`yc-w23`},{key:`freeForCohortOffer`,label:`Free-for-cohort offer (optional)`,type:`text`,placeholder:`Free for current YC W26 through demo day, just reply with your batch.`}]},"post-funding":{description:`Triggered by a recent funding announcement. Day-0 here; cadence engine fires the day-9 follow-up and day-18 breakup automatically.`,fields:[{key:`name`,label:`Founder name`,type:`text`,required:!0},{key:`email`,label:`Founder email`,type:`email`,required:!0},{key:`company`,label:`Company`,type:`text`,required:!0},{key:`round`,label:`Round`,type:`text`,required:!0,placeholder:`Seed / Series A / Series B`},{key:`amountUsd`,label:`Amount (USD)`,type:`number`,required:!0,placeholder:`5000000`},{key:`leadInvestor`,label:`Lead investor (optional)`,type:`text`},{key:`sourceUrl`,label:`Announcement URL`,type:`url`,required:!0},{key:`linkedinUrl`,label:`LinkedIn URL (optional)`,type:`url`}],defaultRow:{name:``,email:``,company:``,round:``,amountUsd:``,leadInvestor:``,sourceUrl:``,linkedinUrl:``}},"hiring-signal":{description:`Triggered by a job post at a target company. One-touch email to the hiring manager with your ramp-time claim.`,fields:[{key:`name`,label:`Hiring manager name`,type:`text`,required:!0},{key:`email`,label:`Hiring manager email`,type:`email`,required:!0},{key:`company`,label:`Company`,type:`text`,required:!0},{key:`jobTitle`,label:`Job title they're hiring for`,type:`text`,required:!0},{key:`jobPostUrl`,label:`Job post URL (optional)`,type:`url`},{key:`yourClaim`,label:`Your ramp-time claim`,type:`textarea`,required:!0,placeholder:`We cut new-hire ramp time by ~30% on the team they're hiring for — happy to share how.`}],defaultRow:{name:``,email:``,company:``,jobTitle:``,jobPostUrl:``,yourClaim:``}},"podcast-guest":{description:`One-touch reply to a recent podcast guest referencing a specific moment from the episode.`,fields:[{key:`name`,label:`Guest name`,type:`text`,required:!0},{key:`email`,label:`Guest email`,type:`email`,required:!0},{key:`company`,label:`Guest company`,type:`text`,required:!0},{key:`podcast`,label:`Podcast`,type:`text`,required:!0,placeholder:`Latent Space`},{key:`episodeTitle`,label:`Episode title`,type:`text`,required:!0},{key:`hookQuote`,label:`Specific quote or moment`,type:`textarea`,required:!0},{key:`bridge`,label:`Why the moment matters to your work (one sentence)`,type:`text`}],defaultRow:{name:``,email:``,company:``,podcast:``,episodeTitle:``,hookQuote:``,bridge:``}}};function b(){let{playName:e}=s.useParams(),n=y[e],[r,a]=(0,_.useState)(n?[{...n.defaultRow}]:[]),[b,C]=(0,_.useState)({}),[w,T]=(0,_.useState)(!0),[E,D]=(0,_.useState)(!1),[O,k]=(0,_.useState)([]),[A,j]=(0,_.useState)(null),M=(0,_.useMemo)(()=>{let e=new Map;for(let t of O)if(t.kind===`draft`)e.set(t.index,{subject:t.subject,body:t.body,flags:t.flags});else if(t.kind===`send`){let n=e.get(t.index);n&&e.set(t.index,{...n,receiptIds:t.receiptIds})}return e},[O]),N=O.find(e=>e.kind===`done`),P=O.filter(e=>e.kind===`error`),F=(0,_.useMemo)(()=>{let e=M.size,t=0,n=0;for(let e of M.values())e.receiptIds&&e.receiptIds.length>0&&t++,e.flags.length>0&&n++;return{drafts:e,sent:t,flagged:n}},[M]);if(!n)return(0,v.jsx)(`div`,{className:`-mx-6 -my-6 flex flex-col`,children:(0,v.jsxs)(`section`,{className:`border-b border-ink-rule px-6 pb-5 pt-6`,children:[(0,v.jsxs)(c,{to:`/plays`,className:`inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream`,children:[(0,v.jsx)(m,{size:11}),` back to plays`]}),(0,v.jsx)(`div`,{className:`ln-eyebrow mt-3`,children:`The Ledger · Run`}),(0,v.jsx)(`h1`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:36,fontWeight:400,letterSpacing:`-0.02em`,lineHeight:1},children:`CLI-only play.`}),(0,v.jsxs)(`p`,{className:`ln-note mt-3 max-w-[64ch] text-[14px] text-ink-cream-2`,children:[(0,v.jsx)(`code`,{className:`font-mono text-[color:var(--ink-spend-2)]`,children:e}),` isn't exposed in the dashboard yet. Run it from the CLI; the copy-CLI button is on the`,` `,(0,v.jsx)(c,{to:`/plays`,className:`text-ink-cream underline decoration-ink-faint decoration-1 underline-offset-2`,children:`Plays page`}),`.`]})]})});let I=(e,t,r)=>{a(i=>{let a=i.slice();return a[e]={...a[e]??n.defaultRow,[t]:r},a})},L=()=>{a(e=>[...e,{...n.defaultRow}])},R=e=>{a(t=>t.filter((t,n)=>n!==e))};return(0,v.jsxs)(`div`,{className:`-mx-6 -my-6 flex flex-col`,children:[(0,v.jsxs)(`section`,{className:`border-b border-ink-rule px-6 pb-5 pt-6`,children:[(0,v.jsxs)(c,{to:`/plays`,className:`inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream`,children:[(0,v.jsx)(m,{size:11}),` back to plays`]}),(0,v.jsxs)(`div`,{className:`mt-3 flex items-baseline gap-3`,children:[(0,v.jsx)(`div`,{className:`ln-eyebrow`,children:`The Ledger · Run`}),(0,v.jsx)(`code`,{className:`font-mono text-[13px] text-[color:var(--ink-spend-2)]`,style:{fontFeatureSettings:`"zero"`},children:e})]}),(0,v.jsx)(`h1`,{className:`mt-1 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:44,fontWeight:600,letterSpacing:`-0.025em`,lineHeight:.98},children:`Draft in dry-run, then send.`}),(0,v.jsx)(`p`,{className:`ln-note mt-3 max-w-[72ch] text-[14px] text-ink-cream-2`,children:n.description})]}),n.extras&&(0,v.jsx)(x,{eyebrow:`Run options`,children:(0,v.jsx)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:n.extras.map(e=>(0,v.jsx)(u,{label:e.label,hint:e.hint??``,children:(0,v.jsx)(d,{type:e.type===`textarea`?`text`:e.type,required:!!e.required,placeholder:e.placeholder??``,value:b[e.key]??``,onChange:t=>C(n=>({...n,[e.key]:t.target.value}))})},e.key))})}),(0,v.jsx)(x,{eyebrow:`Targets · ${r.length}`,action:(0,v.jsxs)(i,{variant:`secondary`,size:`sm`,onClick:L,children:[(0,v.jsx)(h,{size:12}),` add row`]}),children:(0,v.jsx)(`div`,{className:`flex flex-col gap-5`,children:r.map((e,t)=>(0,v.jsxs)(`div`,{className:`border-l-2 border-ink-rule pl-4`,children:[(0,v.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,v.jsxs)(`span`,{className:`font-mono text-[11px] text-ink-faint`,children:[`target #`,t+1]}),r.length>1&&(0,v.jsx)(i,{variant:`ghost`,size:`sm`,onClick:()=>R(t),children:(0,v.jsx)(g,{size:12})})]}),(0,v.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:n.fields.map(n=>n.type===`textarea`?(0,v.jsx)(u,{label:n.label+(n.required?` *`:``),hint:n.hint??``,className:`md:col-span-2`,children:(0,v.jsx)(l,{required:!!n.required,placeholder:n.placeholder??``,value:e[n.key]??``,onChange:e=>I(t,n.key,e.target.value),rows:3})},n.key):(0,v.jsx)(u,{label:n.label+(n.required?` *`:``),hint:n.hint??``,children:(0,v.jsx)(d,{type:n.type,required:!!n.required,placeholder:n.placeholder??``,value:e[n.key]??``,onChange:e=>I(t,n.key,e.target.value)})},n.key))})]},`row-${t}`))})}),(0,v.jsxs)(`section`,{className:`sticky bottom-0 z-10 flex flex-wrap items-center justify-between gap-3 border-b border-t border-ink-rule bg-ink-bg/90 px-6 py-3 backdrop-blur-[2px]`,children:[(0,v.jsx)(p,{label:`Dry run — draft only, no send, no spend`,checked:w,onChange:e=>T(e.target.checked)}),(0,v.jsxs)(`div`,{className:`flex items-center gap-4 font-mono text-[11.5px] text-ink-faint`,children:[F.drafts>0&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`span`,{children:[(0,v.jsx)(`span`,{className:`text-ink-cream-2`,children:F.drafts}),` drafted`]}),F.flagged>0&&(0,v.jsxs)(`span`,{className:`text-[color:var(--ink-blocked-2)]`,children:[`· `,F.flagged,` lint`]}),(0,v.jsxs)(`span`,{children:[`·`,` `,(0,v.jsx)(`span`,{className:F.sent>0?`text-[color:var(--ink-receipt-2)]`:`text-ink-muted`,children:F.sent}),` `,`sent`]}),N?.kind===`done`&&(0,v.jsx)(`span`,{className:`text-ink-muted`,children:`· done`})]}),E&&F.drafts===0&&(0,v.jsx)(`span`,{children:`preparing…`})]}),(0,v.jsxs)(i,{onClick:async()=>{j(null),k([]),D(!0);let t={dryRun:w,targets:r.map(e=>S(e)),...b.senderCohort?{senderCohort:b.senderCohort}:{},...b.freeForCohortOffer?{freeForCohortOffer:b.freeForCohortOffer}:{}};try{let n=await fetch(`/api/run/${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`,accept:`text/event-stream`},body:JSON.stringify(t)});if(!n.ok||!n.body){let e=await n.text();throw Error(`${n.status}: ${e.slice(0,200)}`)}let r=n.body.getReader(),i=new TextDecoder,a=``;for(;;){let{value:e,done:t}=await r.read();if(t)break;a+=i.decode(e,{stream:!0});let n=a.split(`
2
+
3
+ `);a=n.pop()??``;for(let e of n){let t=e.split(`
4
+ `).find(e=>e.startsWith(`data:`));if(t)try{let e=JSON.parse(t.slice(5).trim());k(t=>[...t,e])}catch{}}}}catch(e){j(e.message)}finally{D(!1)}},disabled:E,children:[(0,v.jsx)(o,{size:14}),E?`Running…`:w?`Generate drafts`:`Send for real`]})]}),A&&(0,v.jsx)(`section`,{className:`border-b border-ink-rule border-l-2 border-l-[color:var(--ink-blocked)] bg-[color:var(--ink-blocked)]/8 px-6 py-3`,children:(0,v.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,v.jsx)(f,{tone:`blocked`,children:`error`}),(0,v.jsx)(`span`,{className:`font-mono text-[12px] text-[color:var(--ink-blocked-2)]`,children:A})]})}),(O.length>0||E)&&(0,v.jsx)(x,{eyebrow:`Output`,children:(0,v.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[Array.from(M.entries()).toSorted((e,t)=>e[0]-t[0]).map(([e,n])=>(0,v.jsxs)(`div`,{className:t(`relative border-l-2 pl-4`,n.flags.length>0?`border-[color:var(--ink-blocked)]`:n.receiptIds?`border-[color:var(--ink-receipt)]`:`border-ink-rule`),children:[n.receiptIds&&n.receiptIds.length>0&&(0,v.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-1 -rotate-[8deg] select-none font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-receipt-2)]`,children:(0,v.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-[var(--radius-xs)] border border-[color:var(--ink-receipt)]/50 px-1.5 py-0.5`,children:`✓ signed`})}),(0,v.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,v.jsxs)(`span`,{className:`font-mono text-[11px] text-ink-faint`,children:[`#`,e+1]}),n.flags.length===0&&n.receiptIds&&(0,v.jsx)(f,{tone:`receipt`,children:`sent`}),n.flags.length===0&&!n.receiptIds&&w&&(0,v.jsx)(f,{children:`dry-run`}),n.flags.length>0&&(0,v.jsx)(f,{tone:`blocked`,children:`lint`})]}),(0,v.jsx)(`div`,{className:`ln-eyebrow mt-1`,style:{fontSize:10},children:`subject`}),(0,v.jsx)(`div`,{className:`mt-0.5 text-ink-cream`,style:{fontFamily:`var(--font-display)`,fontSize:18,fontWeight:400,letterSpacing:`-0.005em`},children:n.subject}),(0,v.jsx)(`div`,{className:`ln-eyebrow mt-3`,style:{fontSize:10},children:`body`}),(0,v.jsx)(`pre`,{className:`mt-0.5 ln-prose whitespace-pre-wrap text-[13.5px] text-ink-cream-2`,children:n.body}),n.flags.length>0&&(0,v.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:n.flags.map(e=>(0,v.jsx)(`span`,{className:`rounded-[var(--radius-xs)] border border-[color:var(--ink-blocked)]/40 bg-[color:var(--ink-blocked)]/10 px-1.5 py-0.5 font-mono text-[10.5px] text-[color:var(--ink-blocked-2)]`,children:e},e))}),n.receiptIds&&n.receiptIds.length>0&&(0,v.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 font-mono text-[11px]`,children:[(0,v.jsx)(`span`,{className:`text-ink-faint`,children:`receipts`}),n.receiptIds.map(e=>(0,v.jsxs)(c,{to:`/receipts`,className:`text-[color:var(--ink-receipt-2)] hover:underline`,children:[`#`,e]},e))]})]},e)),P.map(e=>e.kind===`error`?(0,v.jsxs)(`div`,{className:`font-mono text-[11.5px] text-[color:var(--ink-blocked-2)]`,children:[`error · `,e.message]},`${e.index}-${e.message}`):null),N&&N.kind===`done`&&(0,v.jsxs)(`div`,{className:`font-mono text-[11.5px] text-ink-muted`,children:[`done · `,N.sent,` of `,N.total,` sent`]})]})})]})}function x({eyebrow:e,action:t,children:n}){return(0,v.jsxs)(`section`,{className:`border-b border-ink-rule px-6 py-6`,children:[(0,v.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,v.jsx)(`div`,{className:`ln-eyebrow`,children:e}),t]}),n]})}function S(e){let t={};for(let[n,r]of Object.entries(e))r.trim().length>0&&(t[n]=r.trim());return t}export{b as component};
5
+ //# sourceMappingURL=run._playName-CJIjxoPb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run._playName-CJIjxoPb.js","names":["__iconNode","__iconNode","Link","ArrowLeft","Play","Plus","Trash2","useMemo","useState","Badge","Button","Checkbox","Field","Input","Textarea","cn","Route","FieldSpec","key","label","type","required","placeholder","hint","PlaySchema","fields","defaultRow","Record","description","extras","PLAY_SCHEMAS","founderName","founderEmail","postTitle","postUrl","hookSummary","name","email","newRole","newCompany","previousRole","previousCompany","linkedinUrl","company","cohort","launchUrl","productOneLiner","round","amountUsd","leadInvestor","sourceUrl","jobTitle","jobPostUrl","yourClaim","podcast","episodeTitle","hookQuote","bridge","RunPage","playName","useParams","schema","rows","setRows","setExtras","dryRun","setDryRun","running","setRunning","events","setEvents","RunPlayEvent","error","setError","draftedByIndex","m","Map","subject","body","flags","receiptIds","e","kind","set","index","cur","get","doneEvent","find","errorEvents","filter","aggregate","drafts","size","sent","flagged","d","values","length","fontFamily","fontSize","fontWeight","letterSpacing","lineHeight","updateRow","rowIdx","fieldKey","value","prev","next","slice","addRow","removeRow","_","i","submit","Promise","targets","map","r","stripEmpty","RunPlayRequest","senderCohort","freeForCohortOffer","res","fetch","encodeURIComponent","method","headers","accept","JSON","stringify","ok","text","Error","status","reader","getReader","decoder","TextDecoder","buf","done","read","decode","stream","frames","split","pop","frame","line","l","startsWith","ev","parse","trim","err","message","fontFeatureSettings","f","s","target","row","checked","Array","from","entries","toSorted","a","b","idx","rid","total","RunLedgerSection","eyebrow","action","children","React","ReactNode","out","k","v","Object","component"],"sources":["../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/arrow-left.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/plus.mjs","../../../../node_modules/.bun/lucide-react@1.9.0+3f10a4be4e334a9b/node_modules/lucide-react/dist/esm/icons/trash-2.mjs","../../src/routes/run.$playName.tsx?tsr-split=component"],"sourcesContent":["/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"m12 19-7-7 7-7\", key: \"1l729n\" }],\n [\"path\", { d: \"M19 12H5\", key: \"x3x0zl\" }]\n];\nconst ArrowLeft = createLucideIcon(\"arrow-left\", __iconNode);\n\nexport { __iconNode, ArrowLeft as default };\n//# sourceMappingURL=arrow-left.mjs.map\n","/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }]\n];\nconst Plus = createLucideIcon(\"plus\", __iconNode);\n\nexport { __iconNode, Plus as default };\n//# sourceMappingURL=plus.mjs.map\n","/**\n * @license lucide-react v1.9.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M10 11v6\", key: \"nco0om\" }],\n [\"path\", { d: \"M14 11v6\", key: \"outv1u\" }],\n [\"path\", { d: \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\", key: \"miytrc\" }],\n [\"path\", { d: \"M3 6h18\", key: \"d0wm0j\" }],\n [\"path\", { d: \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\", key: \"e791ji\" }]\n];\nconst Trash2 = createLucideIcon(\"trash-2\", __iconNode);\n\nexport { __iconNode, Trash2 as default };\n//# sourceMappingURL=trash-2.mjs.map\n","import { createFileRoute, Link } from \"@tanstack/react-router\";\nimport { ArrowLeft, Play, Plus, Trash2 } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\nimport type { RunPlayEvent, RunPlayRequest } from \"@oneshot-gtm/shared-types\";\nimport { Badge } from \"../components/primitives/Badge.tsx\";\nimport { Button } from \"../components/primitives/Button.tsx\";\nimport { Checkbox, Field, Input, Textarea } from \"../components/primitives/Field.tsx\";\nimport { cn } from \"../lib/cn.ts\";\n\nexport const Route = createFileRoute(\"/run/$playName\")({\n component: RunPage,\n});\n\ninterface FieldSpec {\n key: string;\n label: string;\n type: \"text\" | \"email\" | \"number\" | \"url\" | \"textarea\";\n required?: boolean;\n placeholder?: string;\n hint?: string;\n}\n\ninterface PlaySchema {\n fields: FieldSpec[];\n defaultRow: Record<string, string>;\n description: string;\n /** Extra non-target options surfaced as form fields above the rows. */\n extras?: FieldSpec[];\n}\n\nconst PLAY_SCHEMAS: Record<string, PlaySchema> = {\n \"show-hn\": {\n description:\n \"One-touch founder-to-founder reply to a recent Show HN post. References a specific comment thread.\",\n fields: [\n { key: \"founderName\", label: \"Founder name\", type: \"text\", required: true },\n { key: \"founderEmail\", label: \"Founder email\", type: \"email\", required: true },\n {\n key: \"postTitle\",\n label: \"Show HN title\",\n type: \"text\",\n required: true,\n placeholder: \"Show HN: Acme — open-source durable workflows\",\n },\n { key: \"postUrl\", label: \"Show HN URL\", type: \"url\", required: true },\n {\n key: \"hookSummary\",\n label: \"Hook (specific comment thread / detail to reference)\",\n type: \"textarea\",\n required: true,\n },\n ],\n defaultRow: {\n founderName: \"\",\n founderEmail: \"\",\n postTitle: \"\",\n postUrl: \"\",\n hookSummary: \"\",\n },\n },\n \"job-change\": {\n description:\n \"Triggered by a prospect starting a new role at a target company. Day-0 only here; cadence engine fires the day-5 follow-up automatically.\",\n fields: [\n { key: \"name\", label: \"Prospect name\", type: \"text\", required: true },\n { key: \"email\", label: \"Prospect email\", type: \"email\", required: true },\n { key: \"newRole\", label: \"New role\", type: \"text\", required: true },\n { key: \"newCompany\", label: \"New company\", type: \"text\", required: true },\n { key: \"previousRole\", label: \"Previous role\", type: \"text\" },\n { key: \"previousCompany\", label: \"Previous company\", type: \"text\" },\n { key: \"linkedinUrl\", label: \"LinkedIn URL (optional)\", type: \"url\" },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n newRole: \"\",\n newCompany: \"\",\n previousRole: \"\",\n previousCompany: \"\",\n linkedinUrl: \"\",\n },\n },\n \"accelerator-batch\": {\n description:\n \"Founder-to-founder outreach within or across accelerator batches (YC, On Deck, SPC, Antler, Techstars).\",\n fields: [\n { key: \"name\", label: \"Prospect name\", type: \"text\", required: true },\n { key: \"email\", label: \"Prospect email\", type: \"email\", required: true },\n { key: \"company\", label: \"Company\", type: \"text\", required: true },\n {\n key: \"cohort\",\n label: \"Cohort tag\",\n type: \"text\",\n required: true,\n placeholder: \"yc-w26\",\n },\n { key: \"launchUrl\", label: \"Launch URL (optional)\", type: \"url\" },\n { key: \"productOneLiner\", label: \"Their product one-liner\", type: \"text\" },\n { key: \"linkedinUrl\", label: \"LinkedIn URL (optional)\", type: \"url\" },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n cohort: \"\",\n launchUrl: \"\",\n productOneLiner: \"\",\n linkedinUrl: \"\",\n },\n extras: [\n {\n key: \"senderCohort\",\n label: \"Your cohort tag (sender)\",\n type: \"text\",\n required: true,\n placeholder: \"yc-w23\",\n },\n {\n key: \"freeForCohortOffer\",\n label: \"Free-for-cohort offer (optional)\",\n type: \"text\",\n placeholder: \"Free for current YC W26 through demo day, just reply with your batch.\",\n },\n ],\n },\n \"post-funding\": {\n description:\n \"Triggered by a recent funding announcement. Day-0 here; cadence engine fires the day-9 follow-up and day-18 breakup automatically.\",\n fields: [\n { key: \"name\", label: \"Founder name\", type: \"text\", required: true },\n { key: \"email\", label: \"Founder email\", type: \"email\", required: true },\n { key: \"company\", label: \"Company\", type: \"text\", required: true },\n {\n key: \"round\",\n label: \"Round\",\n type: \"text\",\n required: true,\n placeholder: \"Seed / Series A / Series B\",\n },\n {\n key: \"amountUsd\",\n label: \"Amount (USD)\",\n type: \"number\",\n required: true,\n placeholder: \"5000000\",\n },\n { key: \"leadInvestor\", label: \"Lead investor (optional)\", type: \"text\" },\n { key: \"sourceUrl\", label: \"Announcement URL\", type: \"url\", required: true },\n { key: \"linkedinUrl\", label: \"LinkedIn URL (optional)\", type: \"url\" },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n round: \"\",\n amountUsd: \"\",\n leadInvestor: \"\",\n sourceUrl: \"\",\n linkedinUrl: \"\",\n },\n },\n \"hiring-signal\": {\n description:\n \"Triggered by a job post at a target company. One-touch email to the hiring manager with your ramp-time claim.\",\n fields: [\n { key: \"name\", label: \"Hiring manager name\", type: \"text\", required: true },\n { key: \"email\", label: \"Hiring manager email\", type: \"email\", required: true },\n { key: \"company\", label: \"Company\", type: \"text\", required: true },\n { key: \"jobTitle\", label: \"Job title they're hiring for\", type: \"text\", required: true },\n { key: \"jobPostUrl\", label: \"Job post URL (optional)\", type: \"url\" },\n {\n key: \"yourClaim\",\n label: \"Your ramp-time claim\",\n type: \"textarea\",\n required: true,\n placeholder:\n \"We cut new-hire ramp time by ~30% on the team they're hiring for — happy to share how.\",\n },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n jobTitle: \"\",\n jobPostUrl: \"\",\n yourClaim: \"\",\n },\n },\n \"podcast-guest\": {\n description:\n \"One-touch reply to a recent podcast guest referencing a specific moment from the episode.\",\n fields: [\n { key: \"name\", label: \"Guest name\", type: \"text\", required: true },\n { key: \"email\", label: \"Guest email\", type: \"email\", required: true },\n { key: \"company\", label: \"Guest company\", type: \"text\", required: true },\n {\n key: \"podcast\",\n label: \"Podcast\",\n type: \"text\",\n required: true,\n placeholder: \"Latent Space\",\n },\n { key: \"episodeTitle\", label: \"Episode title\", type: \"text\", required: true },\n {\n key: \"hookQuote\",\n label: \"Specific quote or moment\",\n type: \"textarea\",\n required: true,\n },\n {\n key: \"bridge\",\n label: \"Why the moment matters to your work (one sentence)\",\n type: \"text\",\n },\n ],\n defaultRow: {\n name: \"\",\n email: \"\",\n company: \"\",\n podcast: \"\",\n episodeTitle: \"\",\n hookQuote: \"\",\n bridge: \"\",\n },\n },\n};\n\nfunction RunPage() {\n const { playName } = Route.useParams();\n const schema = PLAY_SCHEMAS[playName];\n\n const [rows, setRows] = useState<Record<string, string>[]>(\n schema ? [{ ...schema.defaultRow }] : [],\n );\n const [extras, setExtras] = useState<Record<string, string>>({});\n const [dryRun, setDryRun] = useState(true);\n const [running, setRunning] = useState(false);\n const [events, setEvents] = useState<RunPlayEvent[]>([]);\n const [error, setError] = useState<string | null>(null);\n\n const draftedByIndex = useMemo(() => {\n const m = new Map<\n number,\n { subject: string; body: string; flags: string[]; receiptIds?: number[] }\n >();\n for (const e of events) {\n if (e.kind === \"draft\") {\n m.set(e.index, { subject: e.subject, body: e.body, flags: e.flags });\n } else if (e.kind === \"send\") {\n const cur = m.get(e.index);\n if (cur) m.set(e.index, { ...cur, receiptIds: e.receiptIds });\n }\n }\n return m;\n }, [events]);\n\n const doneEvent = events.find((e) => e.kind === \"done\");\n const errorEvents = events.filter((e) => e.kind === \"error\");\n\n const aggregate = useMemo(() => {\n const drafts = draftedByIndex.size;\n let sent = 0;\n let flagged = 0;\n for (const d of draftedByIndex.values()) {\n if (d.receiptIds && d.receiptIds.length > 0) sent++;\n if (d.flags.length > 0) flagged++;\n }\n return { drafts, sent, flagged };\n }, [draftedByIndex]);\n\n if (!schema) {\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n <section className=\"border-b border-ink-rule px-6 pb-5 pt-6\">\n <Link\n to=\"/plays\"\n className=\"inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream\"\n >\n <ArrowLeft size={11} /> back to plays\n </Link>\n <div className=\"ln-eyebrow mt-3\">The Ledger · Run</div>\n <h1\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 36,\n fontWeight: 400,\n letterSpacing: \"-0.02em\",\n lineHeight: 1,\n }}\n >\n CLI-only play.\n </h1>\n <p className=\"ln-note mt-3 max-w-[64ch] text-[14px] text-ink-cream-2\">\n <code className=\"font-mono text-[color:var(--ink-spend-2)]\">{playName}</code> isn&apos;t\n exposed in the dashboard yet. Run it from the CLI; the copy-CLI button is on the{\" \"}\n <Link\n to=\"/plays\"\n className=\"text-ink-cream underline decoration-ink-faint decoration-1 underline-offset-2\"\n >\n Plays page\n </Link>\n .\n </p>\n </section>\n </div>\n );\n }\n\n const updateRow = (rowIdx: number, fieldKey: string, value: string): void => {\n setRows((prev) => {\n const next = prev.slice();\n next[rowIdx] = { ...(next[rowIdx] ?? schema.defaultRow), [fieldKey]: value };\n return next;\n });\n };\n\n const addRow = (): void => {\n setRows((prev) => [...prev, { ...schema.defaultRow }]);\n };\n\n const removeRow = (rowIdx: number): void => {\n setRows((prev) => prev.filter((_, i) => i !== rowIdx));\n };\n\n const submit = async (): Promise<void> => {\n setError(null);\n setEvents([]);\n setRunning(true);\n\n const targets = rows.map((r) => stripEmpty(r));\n const body: RunPlayRequest = {\n dryRun,\n targets,\n ...(extras[\"senderCohort\"] ? { senderCohort: extras[\"senderCohort\"] } : {}),\n ...(extras[\"freeForCohortOffer\"] ? { freeForCohortOffer: extras[\"freeForCohortOffer\"] } : {}),\n };\n\n try {\n const res = await fetch(`/api/run/${encodeURIComponent(playName)}`, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", accept: \"text/event-stream\" },\n body: JSON.stringify(body),\n });\n if (!res.ok || !res.body) {\n const text = await res.text();\n throw new Error(`${res.status}: ${text.slice(0, 200)}`);\n }\n const reader = res.body.getReader();\n const decoder = new TextDecoder();\n let buf = \"\";\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n buf += decoder.decode(value, { stream: true });\n const frames = buf.split(\"\\n\\n\");\n buf = frames.pop() ?? \"\";\n for (const frame of frames) {\n const line = frame.split(\"\\n\").find((l) => l.startsWith(\"data:\"));\n if (!line) continue;\n try {\n const ev = JSON.parse(line.slice(5).trim()) as RunPlayEvent;\n setEvents((prev) => [...prev, ev]);\n } catch {\n // ignore parse errors\n }\n }\n }\n } catch (err) {\n setError((err as Error).message);\n } finally {\n setRunning(false);\n }\n };\n\n return (\n <div className=\"-mx-6 -my-6 flex flex-col\">\n {/* Masthead */}\n <section className=\"border-b border-ink-rule px-6 pb-5 pt-6\">\n <Link\n to=\"/plays\"\n className=\"inline-flex items-center gap-1 font-mono text-[11px] text-ink-muted hover:text-ink-cream\"\n >\n <ArrowLeft size={11} /> back to plays\n </Link>\n <div className=\"mt-3 flex items-baseline gap-3\">\n <div className=\"ln-eyebrow\">The Ledger · Run</div>\n <code\n className=\"font-mono text-[13px] text-[color:var(--ink-spend-2)]\"\n style={{ fontFeatureSettings: '\"zero\"' }}\n >\n {playName}\n </code>\n </div>\n <h1\n className=\"mt-1 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 44,\n fontWeight: 600,\n letterSpacing: \"-0.025em\",\n lineHeight: 0.98,\n }}\n >\n Draft in dry-run, then send.\n </h1>\n <p className=\"ln-note mt-3 max-w-[72ch] text-[14px] text-ink-cream-2\">\n {schema.description}\n </p>\n </section>\n\n {schema.extras && (\n <RunLedgerSection eyebrow=\"Run options\">\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n {schema.extras.map((f) => (\n <Field key={f.key} label={f.label} hint={f.hint ?? \"\"}>\n <Input\n type={f.type === \"textarea\" ? \"text\" : f.type}\n required={!!f.required}\n placeholder={f.placeholder ?? \"\"}\n value={extras[f.key] ?? \"\"}\n onChange={(e) => setExtras((s) => ({ ...s, [f.key]: e.target.value }))}\n />\n </Field>\n ))}\n </div>\n </RunLedgerSection>\n )}\n\n <RunLedgerSection\n eyebrow={`Targets · ${rows.length}`}\n action={\n <Button variant=\"secondary\" size=\"sm\" onClick={addRow}>\n <Plus size={12} /> add row\n </Button>\n }\n >\n <div className=\"flex flex-col gap-5\">\n {rows.map((row, rowIdx) => (\n <div\n // eslint-disable-next-line react/no-array-index-key\n key={`row-${rowIdx}`}\n className=\"border-l-2 border-ink-rule pl-4\"\n >\n <div className=\"mb-3 flex items-center justify-between\">\n <span className=\"font-mono text-[11px] text-ink-faint\">target #{rowIdx + 1}</span>\n {rows.length > 1 && (\n <Button variant=\"ghost\" size=\"sm\" onClick={() => removeRow(rowIdx)}>\n <Trash2 size={12} />\n </Button>\n )}\n </div>\n <div className=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n {schema.fields.map((f) =>\n f.type === \"textarea\" ? (\n <Field\n key={f.key}\n label={f.label + (f.required ? \" *\" : \"\")}\n hint={f.hint ?? \"\"}\n className=\"md:col-span-2\"\n >\n <Textarea\n required={!!f.required}\n placeholder={f.placeholder ?? \"\"}\n value={row[f.key] ?? \"\"}\n onChange={(e) => updateRow(rowIdx, f.key, e.target.value)}\n rows={3}\n />\n </Field>\n ) : (\n <Field\n key={f.key}\n label={f.label + (f.required ? \" *\" : \"\")}\n hint={f.hint ?? \"\"}\n >\n <Input\n type={f.type}\n required={!!f.required}\n placeholder={f.placeholder ?? \"\"}\n value={row[f.key] ?? \"\"}\n onChange={(e) => updateRow(rowIdx, f.key, e.target.value)}\n />\n </Field>\n ),\n )}\n </div>\n </div>\n ))}\n </div>\n </RunLedgerSection>\n\n {/* Action bar — sticky. Live aggregates appear in the middle once drafts land. */}\n <section className=\"sticky bottom-0 z-10 flex flex-wrap items-center justify-between gap-3 border-b border-t border-ink-rule bg-ink-bg/90 px-6 py-3 backdrop-blur-[2px]\">\n <Checkbox\n label=\"Dry run — draft only, no send, no spend\"\n checked={dryRun}\n onChange={(e) => setDryRun(e.target.checked)}\n />\n <div className=\"flex items-center gap-4 font-mono text-[11.5px] text-ink-faint\">\n {aggregate.drafts > 0 && (\n <>\n <span>\n <span className=\"text-ink-cream-2\">{aggregate.drafts}</span> drafted\n </span>\n {aggregate.flagged > 0 && (\n <span className=\"text-[color:var(--ink-blocked-2)]\">\n · {aggregate.flagged} lint\n </span>\n )}\n <span>\n ·{\" \"}\n <span\n className={\n aggregate.sent > 0 ? \"text-[color:var(--ink-receipt-2)]\" : \"text-ink-muted\"\n }\n >\n {aggregate.sent}\n </span>{\" \"}\n sent\n </span>\n {doneEvent?.kind === \"done\" && <span className=\"text-ink-muted\">· done</span>}\n </>\n )}\n {running && aggregate.drafts === 0 && <span>preparing…</span>}\n </div>\n <Button onClick={submit} disabled={running}>\n <Play size={14} />\n {running ? \"Running…\" : dryRun ? \"Generate drafts\" : \"Send for real\"}\n </Button>\n </section>\n\n {error && (\n <section className=\"border-b border-ink-rule border-l-2 border-l-[color:var(--ink-blocked)] bg-[color:var(--ink-blocked)]/8 px-6 py-3\">\n <div className=\"flex items-start gap-2\">\n <Badge tone=\"blocked\">error</Badge>\n <span className=\"font-mono text-[12px] text-[color:var(--ink-blocked-2)]\">{error}</span>\n </div>\n </section>\n )}\n\n {(events.length > 0 || running) && (\n <RunLedgerSection eyebrow=\"Output\">\n <div className=\"flex flex-col gap-4\">\n {Array.from(draftedByIndex.entries())\n .toSorted((a, b) => a[0] - b[0])\n .map(([idx, d]) => (\n <div\n key={idx}\n className={cn(\n \"relative border-l-2 pl-4\",\n d.flags.length > 0\n ? \"border-[color:var(--ink-blocked)]\"\n : d.receiptIds\n ? \"border-[color:var(--ink-receipt)]\"\n : \"border-ink-rule\",\n )}\n >\n {/* Receipt seal — appears only on successfully sent drafts. */}\n {d.receiptIds && d.receiptIds.length > 0 && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute right-0 top-1 -rotate-[8deg] select-none font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-receipt-2)]\"\n >\n <span className=\"inline-flex items-center gap-1 rounded-[var(--radius-xs)] border border-[color:var(--ink-receipt)]/50 px-1.5 py-0.5\">\n ✓ signed\n </span>\n </span>\n )}\n <div className=\"mb-1 flex items-center gap-2\">\n <span className=\"font-mono text-[11px] text-ink-faint\">#{idx + 1}</span>\n {d.flags.length === 0 && d.receiptIds && <Badge tone=\"receipt\">sent</Badge>}\n {d.flags.length === 0 && !d.receiptIds && dryRun && <Badge>dry-run</Badge>}\n {d.flags.length > 0 && <Badge tone=\"blocked\">lint</Badge>}\n </div>\n <div className=\"ln-eyebrow mt-1\" style={{ fontSize: 10 }}>\n subject\n </div>\n <div\n className=\"mt-0.5 text-ink-cream\"\n style={{\n fontFamily: \"var(--font-display)\",\n fontSize: 18,\n fontWeight: 400,\n letterSpacing: \"-0.005em\",\n }}\n >\n {d.subject}\n </div>\n <div className=\"ln-eyebrow mt-3\" style={{ fontSize: 10 }}>\n body\n </div>\n <pre className=\"mt-0.5 ln-prose whitespace-pre-wrap text-[13.5px] text-ink-cream-2\">\n {d.body}\n </pre>\n {d.flags.length > 0 && (\n <div className=\"mt-2 flex flex-wrap gap-1\">\n {d.flags.map((f) => (\n <span\n key={f}\n className=\"rounded-[var(--radius-xs)] border border-[color:var(--ink-blocked)]/40 bg-[color:var(--ink-blocked)]/10 px-1.5 py-0.5 font-mono text-[10.5px] text-[color:var(--ink-blocked-2)]\"\n >\n {f}\n </span>\n ))}\n </div>\n )}\n {d.receiptIds && d.receiptIds.length > 0 && (\n <div className=\"mt-2 flex items-center gap-2 font-mono text-[11px]\">\n <span className=\"text-ink-faint\">receipts</span>\n {d.receiptIds.map((rid) => (\n <Link\n key={rid}\n to=\"/receipts\"\n className=\"text-[color:var(--ink-receipt-2)] hover:underline\"\n >\n #{rid}\n </Link>\n ))}\n </div>\n )}\n </div>\n ))}\n {errorEvents.map((e) =>\n e.kind === \"error\" ? (\n <div\n key={`${e.index}-${e.message}`}\n className=\"font-mono text-[11.5px] text-[color:var(--ink-blocked-2)]\"\n >\n error · {e.message}\n </div>\n ) : null,\n )}\n {doneEvent && doneEvent.kind === \"done\" && (\n <div className=\"font-mono text-[11.5px] text-ink-muted\">\n done · {doneEvent.sent} of {doneEvent.total} sent\n </div>\n )}\n </div>\n </RunLedgerSection>\n )}\n </div>\n );\n}\n\nfunction RunLedgerSection({\n eyebrow,\n action,\n children,\n}: {\n eyebrow: string;\n action?: React.ReactNode;\n children: React.ReactNode;\n}) {\n return (\n <section className=\"border-b border-ink-rule px-6 py-6\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"ln-eyebrow\">{eyebrow}</div>\n {action}\n </div>\n {children}\n </section>\n );\n}\n\nfunction stripEmpty(row: Record<string, string>): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(row)) {\n if (v.trim().length > 0) out[k] = v.trim();\n }\n return out;\n}\n"],"x_google_ignoreList":[0,1,2],"mappings":"iMAaA,IAAM,EAAY,EAAiB,aAAcA,CAH/C,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,SAAU,CAAC,CAChD,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAEKA,CAAW,CCAtD,EAAO,EAAiB,OAAQC,CAHpC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAENA,CAAW,CCG3C,EAAS,EAAiB,UAAW,CANzC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,2CAA4C,IAAK,SAAU,CAAC,CAC1E,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,SAAU,CAAC,CACzC,CAAC,OAAQ,CAAE,EAAG,yCAA0C,IAAK,SAAU,CAAC,CAE/B,CAAW,gBCchD6B,EAA2C,CAC/C,UAAW,CACTF,YACE,qGACFH,OAAQ,CACN,CAAEP,IAAK,cAAeC,MAAO,eAAgBC,KAAM,OAAQC,SAAU,GAAM,CAC3E,CAAEH,IAAK,eAAgB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