@hotmeshio/long-tail 0.10.11 → 0.10.13
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.
- package/build/api/escalations/list.d.ts +1 -0
- package/build/api/escalations/list.js +1 -0
- package/build/api/escalations/metadata.d.ts +11 -0
- package/build/api/escalations/metadata.js +27 -7
- package/build/api/scan-codes/config.d.ts +22 -0
- package/build/api/scan-codes/config.js +136 -0
- package/build/api/scan-codes/execute.d.ts +9 -0
- package/build/api/scan-codes/execute.js +372 -0
- package/build/api/scan-codes/index.d.ts +2 -0
- package/build/api/scan-codes/index.js +14 -0
- package/build/lib/db/schemas/026_scan_codes.sql +51 -0
- package/build/lib/db/schemas/027_scan_codes_reindex.sql +23 -0
- package/build/lib/events/system-events.js +4 -0
- package/build/modules/features.d.ts +8 -0
- package/build/modules/features.js +1 -0
- package/build/routes/escalations/list.js +1 -0
- package/build/routes/index.js +2 -0
- package/build/routes/scan-codes.d.ts +2 -0
- package/build/routes/scan-codes.js +138 -0
- package/build/sdk/index.d.ts +4 -0
- package/build/services/escalation/crud.d.ts +1 -1
- package/build/services/escalation/crud.js +4 -2
- package/build/services/escalation/queries.d.ts +1 -0
- package/build/services/escalation/queries.js +2 -0
- package/build/services/escalation/sql.d.ts +11 -6
- package/build/services/escalation/sql.js +20 -20
- package/build/services/scan-code/index.d.ts +4 -0
- package/build/services/scan-code/index.js +21 -0
- package/build/services/scan-code/parse.d.ts +35 -0
- package/build/services/scan-code/parse.js +108 -0
- package/build/services/scan-code/read.d.ts +5 -0
- package/build/services/scan-code/read.js +50 -0
- package/build/services/scan-code/sql.d.ts +10 -0
- package/build/services/scan-code/sql.js +57 -0
- package/build/services/scan-code/validate.d.ts +12 -0
- package/build/services/scan-code/validate.js +78 -0
- package/build/services/scan-code/write.d.ts +26 -0
- package/build/services/scan-code/write.js +71 -0
- package/build/shared/form-validation/index.d.ts +1 -0
- package/build/shared/form-validation/index.js +1 -0
- package/build/shared/form-validation/x-lt-transition.d.ts +47 -0
- package/build/shared/form-validation/x-lt-transition.js +65 -0
- package/build/system/mcp-servers/admin/index.d.ts +1 -0
- package/build/system/mcp-servers/admin/index.js +5 -2
- package/build/system/mcp-servers/admin/scan-codes.d.ts +10 -0
- package/build/system/mcp-servers/admin/scan-codes.js +111 -0
- package/build/system/mcp-servers/admin/schemas.d.ts +232 -14
- package/build/system/mcp-servers/admin/schemas.js +50 -0
- package/build/system/seed/tool-manifests-admin.d.ts +1380 -0
- package/build/system/seed/tool-manifests-admin.js +6 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/events.d.ts +9 -0
- package/build/types/index.d.ts +2 -0
- package/build/types/index.js +10 -1
- package/build/types/scan-code.d.ts +183 -0
- package/build/types/scan-code.js +80 -0
- package/build/types/startup.d.ts +6 -0
- package/dashboard/dist/assets/{AdminDashboard-CkTbRfY9.js → AdminDashboard-Bv3pHBzn.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-CkTbRfY9.js.map → AdminDashboard-Bv3pHBzn.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-Cm8FRpXi.js → AgentConfigPage-Dk2zlvDb.js} +6 -6
- package/dashboard/dist/assets/{AgentConfigPage-Cm8FRpXi.js.map → AgentConfigPage-Dk2zlvDb.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-sQ1-UT46.js → AgentDetailPage-DUno6EGs.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-sQ1-UT46.js.map → AgentDetailPage-DUno6EGs.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-bSx_mdae.js → AgentsPage-CToVu1qj.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-bSx_mdae.js.map → AgentsPage-CToVu1qj.js.map} +1 -1
- package/dashboard/dist/assets/{AutoGrowTextarea-y-oNY51_.js → AutoGrowTextarea-DgEQeRQw.js} +2 -2
- package/dashboard/dist/assets/{AutoGrowTextarea-y-oNY51_.js.map → AutoGrowTextarea-DgEQeRQw.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-8pMC7Xv6.js → AvailableEscalationsPage-DldboL4W.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-8pMC7Xv6.js.map → AvailableEscalationsPage-DldboL4W.js.map} +1 -1
- package/dashboard/dist/assets/BotPicker-DQOpVB4M.js +2 -0
- package/dashboard/dist/assets/{BotPicker-C4uGH2x9.js.map → BotPicker-DQOpVB4M.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-BRoOeKcc.js → CapabilitiesPage-Dmf46PUJ.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-BRoOeKcc.js.map → CapabilitiesPage-Dmf46PUJ.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-CIj8Adc9.js → CollapsibleSection-CDADefUY.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-CIj8Adc9.js.map → CollapsibleSection-CDADefUY.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-Ugi_9Ukq.js → ConfirmDeleteModal-CQsJUzEa.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-Ugi_9Ukq.js.map → ConfirmDeleteModal-CQsJUzEa.js.map} +1 -1
- package/dashboard/dist/assets/{CopyableId-GUEdiiL5.js → CopyableId-4Lqlc5cU.js} +2 -2
- package/dashboard/dist/assets/{CopyableId-GUEdiiL5.js.map → CopyableId-4Lqlc5cU.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-D3t0XMhE.js → CountdownTimer-DPjIkerB.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-D3t0XMhE.js.map → CountdownTimer-DPjIkerB.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-B73Si6K1.js → CredentialsPage-8LIEvomi.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-B73Si6K1.js.map → CredentialsPage-8LIEvomi.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-Ca1aHolt.js → CronLabel-CK3WSsM5.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-Ca1aHolt.js.map → CronLabel-CK3WSsM5.js.map} +1 -1
- package/dashboard/dist/assets/{CustomDurationPicker-_9E9x1YN.js → CustomDurationPicker-FPmlA6cE.js} +2 -2
- package/dashboard/dist/assets/{CustomDurationPicker-_9E9x1YN.js.map → CustomDurationPicker-FPmlA6cE.js.map} +1 -1
- package/dashboard/dist/assets/{DataTable-BTu2AaEl.js → DataTable-Bir0Xs1p.js} +2 -2
- package/dashboard/dist/assets/{DataTable-BTu2AaEl.js.map → DataTable-Bir0Xs1p.js.map} +1 -1
- package/dashboard/dist/assets/{DropZone-NYn6TWHz.js → DropZone-CL9gA7pu.js} +2 -2
- package/dashboard/dist/assets/{DropZone-NYn6TWHz.js.map → DropZone-CL9gA7pu.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-karxia93.js → ElapsedCell-BZVkVxE0.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-karxia93.js.map → ElapsedCell-BZVkVxE0.js.map} +1 -1
- package/dashboard/dist/assets/{EmptyState-BcsfPq9T.js → EmptyState-lpUFYfun.js} +2 -2
- package/dashboard/dist/assets/{EmptyState-BcsfPq9T.js.map → EmptyState-lpUFYfun.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-CDaNmbUA.js → EscalationListSchemaPage-kYLdUtZX.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-CDaNmbUA.js.map → EscalationListSchemaPage-kYLdUtZX.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-k-2hFT2t.js → EscalationSchemaPage-kUmCDivo.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-k-2hFT2t.js.map → EscalationSchemaPage-kUmCDivo.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-C1e7IPn_.js → EscalationsOverview-D17auO-m.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-C1e7IPn_.js.map → EscalationsOverview-D17auO-m.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-CIrrtL7_.js → EventTable-CwPWl163.js} +2 -2
- package/dashboard/dist/assets/{EventTable-CIrrtL7_.js.map → EventTable-CwPWl163.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-CzjtH74v.js → FilterBar-D7GghUsU.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-CzjtH74v.js.map → FilterBar-D7GghUsU.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-LMpWw8z1.js → GraphInvokePage-D11uOnZi.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-LMpWw8z1.js.map → GraphInvokePage-D11uOnZi.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-Kl2DBG6l.js → HomePage-Bcq10Bxx.js} +2 -2
- package/dashboard/dist/assets/{HomePage-Kl2DBG6l.js.map → HomePage-Bcq10Bxx.js.map} +1 -1
- package/dashboard/dist/assets/ListToolbar-IPXsTb3Q.js +2 -0
- package/dashboard/dist/assets/{ListToolbar-B2fub0DY.js.map → ListToolbar-IPXsTb3Q.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-odYnCZCC.js → McpOverview-Dx2j0KkF.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-odYnCZCC.js.map → McpOverview-Dx2j0KkF.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-BtqwHUAg.js → McpQueryDetailPage-CzF_bna8.js} +3 -3
- package/dashboard/dist/assets/{McpQueryDetailPage-BtqwHUAg.js.map → McpQueryDetailPage-CzF_bna8.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-CPkVwNIK.js → McpQueryPage-CNsuiw_q.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-CPkVwNIK.js.map → McpQueryPage-CNsuiw_q.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-D-Rz9MRw.js → McpRunDetailPage-BJguEMS0.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-D-Rz9MRw.js.map → McpRunDetailPage-BJguEMS0.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-rdpZ2yMh.js → McpRunsPage-CK96s3Nt.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-rdpZ2yMh.js.map → McpRunsPage-CK96s3Nt.js.map} +1 -1
- package/dashboard/dist/assets/{Modal-Dr1Xy0j0.js → Modal-BU7No9NH.js} +2 -2
- package/dashboard/dist/assets/{Modal-Dr1Xy0j0.js.map → Modal-BU7No9NH.js.map} +1 -1
- package/dashboard/dist/assets/{NamespacePill-GwO-WfhX.js → NamespacePill-B9Vc_Pz2.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-GwO-WfhX.js.map → NamespacePill-B9Vc_Pz2.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-DlyGLPAs.js → OperationsPage-DvWrLuH6.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-DlyGLPAs.js.map → OperationsPage-DvWrLuH6.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-Csei5vj-.js → OperatorDashboard-C-jE0IRA.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-Csei5vj-.js.map → OperatorDashboard-C-jE0IRA.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-Bo9BU9pK.js → PageHeader-Ce4GcIYo.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-Bo9BU9pK.js.map → PageHeader-Ce4GcIYo.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-8_5cOSKL.js → PageHeaderWithStats-Ck0KZvXD.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-8_5cOSKL.js.map → PageHeaderWithStats-Ck0KZvXD.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage--ZL6Or6v.js → PersonaDetailPage-CJ6jqo7h.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage--ZL6Or6v.js.map → PersonaDetailPage-CJ6jqo7h.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-Bdcoay3P.js → PersonasPage-D8hL3kL5.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-Bdcoay3P.js.map → PersonasPage-D8hL3kL5.js.map} +1 -1
- package/dashboard/dist/assets/{PriorityBadge-CCERr9vQ.js → PriorityBadge-BETdj4M-.js} +2 -2
- package/dashboard/dist/assets/{PriorityBadge-CCERr9vQ.js.map → PriorityBadge-BETdj4M-.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-HrmVQq7S.js → ProcessDetailPage-Vnx8Z5_y.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-HrmVQq7S.js.map → ProcessDetailPage-Vnx8Z5_y.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-_xmj6Bo-.js → ProcessesListPage-DRYtvS3N.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-_xmj6Bo-.js.map → ProcessesListPage-DRYtvS3N.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-C0ju2-4K.js → RoleDetailPage-BKkUvTO-.js} +3 -3
- package/dashboard/dist/assets/{RoleDetailPage-C0ju2-4K.js.map → RoleDetailPage-BKkUvTO-.js.map} +1 -1
- package/dashboard/dist/assets/{RolePill-CQlnEWkK.js → RolePill-CnuBPhPw.js} +2 -2
- package/dashboard/dist/assets/{RolePill-CQlnEWkK.js.map → RolePill-CnuBPhPw.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-CKluVSpB.js → RolesPage-BHzWK9n6.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-CKluVSpB.js.map → RolesPage-BHzWK9n6.js.map} +1 -1
- package/dashboard/dist/assets/{RowActions-BA9L9djf.js → RowActions-eYrzgQSj.js} +2 -2
- package/dashboard/dist/assets/{RowActions-BA9L9djf.js.map → RowActions-eYrzgQSj.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-DdfecQ1U.js → RunAsSelector-CS3KQ-BF.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-DdfecQ1U.js.map → RunAsSelector-CS3KQ-BF.js.map} +1 -1
- package/dashboard/dist/assets/ScanCodesPage-BW4P4zWf.js +2 -0
- package/dashboard/dist/assets/ScanCodesPage-BW4P4zWf.js.map +1 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-BLykA4j-.js +2 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-BLykA4j-.js.map +1 -0
- package/dashboard/dist/assets/{ScopeBadge-BBYkevuR.js → ScopeBadge-BUpYpS3x.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-BBYkevuR.js.map → ScopeBadge-BUpYpS3x.js.map} +1 -1
- package/dashboard/dist/assets/{StatCard-Ca-ngCaD.js → StatCard-BXQ8dD9Y.js} +2 -2
- package/dashboard/dist/assets/{StatCard-Ca-ngCaD.js.map → StatCard-BXQ8dD9Y.js.map} +1 -1
- package/dashboard/dist/assets/{StatusBadge-BwUvykDo.js → StatusBadge-DkgllZHv.js} +2 -2
- package/dashboard/dist/assets/{StatusBadge-BwUvykDo.js.map → StatusBadge-DkgllZHv.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-cLddIdtT.js → StickyPagination-hMrnLXde.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-cLddIdtT.js.map → StickyPagination-hMrnLXde.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-CZXWDawC.js → StreamMessageDetail-DyJyZwBl.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-CZXWDawC.js.map → StreamMessageDetail-DyJyZwBl.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-fWY0gaf3.js → SwimlaneTimeline-BlzV74V5.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-fWY0gaf3.js.map → SwimlaneTimeline-BlzV74V5.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-CDKbslLx.js → TagInput-BbZ25nNe.js} +2 -2
- package/dashboard/dist/assets/{TagInput-CDKbslLx.js.map → TagInput-BbZ25nNe.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-BjE4G2yn.js → TaskDetailPage-B0p_Z4J_.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-BjE4G2yn.js.map → TaskDetailPage-B0p_Z4J_.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-G3RuYRNZ.js → TaskQueuePill-D0QKBrN3.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-G3RuYRNZ.js.map → TaskQueuePill-D0QKBrN3.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-KAhmCWB2.js → TasksListPage-CiGR2QiQ.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-KAhmCWB2.js.map → TasksListPage-CiGR2QiQ.js.map} +1 -1
- package/dashboard/dist/assets/TimeAgo-D_DA9ucC.js +2 -0
- package/dashboard/dist/assets/{TimeAgo-C_H2TyZw.js.map → TimeAgo-D_DA9ucC.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-COG_4Flg.js → TimestampCell-C7rkC9nh.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-COG_4Flg.js.map → TimestampCell-C7rkC9nh.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-ChSyRJZC.js → ToolPill-8xY9rkoc.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-ChSyRJZC.js.map → ToolPill-8xY9rkoc.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-BPdJECW0.js → ToolTestPanel-E8efYGYs.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-BPdJECW0.js.map → ToolTestPanel-E8efYGYs.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-DAqx5JqA.js → TopicDetailPage-B455XrRc.js} +3 -3
- package/dashboard/dist/assets/{TopicDetailPage-DAqx5JqA.js.map → TopicDetailPage-B455XrRc.js.map} +1 -1
- package/dashboard/dist/assets/TopicsPage-1VAc29Qw.js +2 -0
- package/dashboard/dist/assets/{TopicsPage-DoGqAdPm.js.map → TopicsPage-1VAc29Qw.js.map} +1 -1
- package/dashboard/dist/assets/UserName-DikzjQHJ.js +2 -0
- package/dashboard/dist/assets/{UserName-CKO_rk1R.js.map → UserName-DikzjQHJ.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-D3VQ9iQV.js → WorkflowExecutionPage-C15GSAoe.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-D3VQ9iQV.js.map → WorkflowExecutionPage-C15GSAoe.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-CNbwug5p.js → WorkflowPill-Da406nEj.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill-CNbwug5p.js.map → WorkflowPill-Da406nEj.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-DdJ86We6.js → WorkflowsDashboard-BMQd_0tW.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DdJ86We6.js.map → WorkflowsDashboard-BMQd_0tW.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-ZfFBzePp.js → WorkflowsOverview-CdxjVifp.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-ZfFBzePp.js.map → WorkflowsOverview-CdxjVifp.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-4bd5yXdA.js → YamlWorkflowDetailPage-DNVffIXa.js} +13 -13
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-4bd5yXdA.js.map → YamlWorkflowDetailPage-DNVffIXa.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-iHPNXjQj.js → YamlWorkflowsPage-BGP8wuos.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-iHPNXjQj.js.map → YamlWorkflowsPage-BGP8wuos.js.map} +1 -1
- package/dashboard/dist/assets/{agents-DjD5U3Wb.js → agents-BZJLIJ4h.js} +2 -2
- package/dashboard/dist/assets/{agents-DjD5U3Wb.js.map → agents-BZJLIJ4h.js.map} +1 -1
- package/dashboard/dist/assets/{bots-DiljVapH.js → bots-ClLcDGJb.js} +2 -2
- package/dashboard/dist/assets/{bots-DiljVapH.js.map → bots-ClLcDGJb.js.map} +1 -1
- package/dashboard/dist/assets/capabilities-IaCcS7ge.js +2 -0
- package/dashboard/dist/assets/{capabilities-DV_5ghHT.js.map → capabilities-IaCcS7ge.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-BKMvfWCB.js → controlplane-Zi4m_MSx.js} +2 -2
- package/dashboard/dist/assets/{controlplane-BKMvfWCB.js.map → controlplane-Zi4m_MSx.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-BQpCaJId.js → escalation-columns-BY2mg9DY.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-BQpCaJId.js.map → escalation-columns-BY2mg9DY.js.map} +1 -1
- package/dashboard/dist/assets/{index-Tx_ETzcH.js → index-BqGnhkh0.js} +2 -2
- package/dashboard/dist/assets/{index-Tx_ETzcH.js.map → index-BqGnhkh0.js.map} +1 -1
- package/dashboard/dist/assets/index-BzkE48xJ.js +6 -0
- package/dashboard/dist/assets/index-BzkE48xJ.js.map +1 -0
- package/dashboard/dist/assets/{index-CI8rrKjx.js → index-C3o4OisO.js} +2 -2
- package/dashboard/dist/assets/{index-CI8rrKjx.js.map → index-C3o4OisO.js.map} +1 -1
- package/dashboard/dist/assets/{index-BO-7S9Xw.js → index-CJu2PBNx.js} +2 -2
- package/dashboard/dist/assets/{index-BO-7S9Xw.js.map → index-CJu2PBNx.js.map} +1 -1
- package/dashboard/dist/assets/{index-CItsikDw.js → index-CLmZaNTK.js} +2 -2
- package/dashboard/dist/assets/{index-CItsikDw.js.map → index-CLmZaNTK.js.map} +1 -1
- package/dashboard/dist/assets/index-CfAi1OsI.js +65 -0
- package/dashboard/dist/assets/index-CfAi1OsI.js.map +1 -0
- package/dashboard/dist/assets/{index-BaV3l0UE.js → index-CmnNqpWg.js} +2 -2
- package/dashboard/dist/assets/{index-BaV3l0UE.js.map → index-CmnNqpWg.js.map} +1 -1
- package/dashboard/dist/assets/{index-nIrYejxe.js → index-CvNBdkB1.js} +3 -3
- package/dashboard/dist/assets/{index-nIrYejxe.js.map → index-CvNBdkB1.js.map} +1 -1
- package/dashboard/dist/assets/{index-xZqQxqu2.js → index-D0zFReGL.js} +2 -2
- package/dashboard/dist/assets/{index-xZqQxqu2.js.map → index-D0zFReGL.js.map} +1 -1
- package/dashboard/dist/assets/{index-CStR4uIU.js → index-Dldi3Q3M.js} +2 -2
- package/dashboard/dist/assets/{index-CStR4uIU.js.map → index-Dldi3Q3M.js.map} +1 -1
- package/dashboard/dist/assets/{index-DhATO1cS.js → index-kiKZresb.js} +2 -2
- package/dashboard/dist/assets/{index-DhATO1cS.js.map → index-kiKZresb.js.map} +1 -1
- package/dashboard/dist/assets/index-mKcQGi2B.js +3 -0
- package/dashboard/dist/assets/index-mKcQGi2B.js.map +1 -0
- package/dashboard/dist/assets/{index-BsOxMMmb.js → index-yGNt29V9.js} +2 -2
- package/dashboard/dist/assets/{index-BsOxMMmb.js.map → index-yGNt29V9.js.map} +1 -1
- package/dashboard/dist/assets/index-zQiUPfxA.css +1 -0
- package/dashboard/dist/assets/{knowledge-BocTnSiA.js → knowledge-DWLxGTib.js} +2 -2
- package/dashboard/dist/assets/{knowledge-BocTnSiA.js.map → knowledge-DWLxGTib.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-C1KBjKQ_.js → mcp-B6AARZ2I.js} +2 -2
- package/dashboard/dist/assets/{mcp-C1KBjKQ_.js.map → mcp-B6AARZ2I.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-B3cjukkA.js → mcp-query-DrkvBU3a.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-B3cjukkA.js.map → mcp-query-DrkvBU3a.js.map} +1 -1
- package/dashboard/dist/assets/{personas-DiA2bJaX.js → personas-Cmz2SAEU.js} +2 -2
- package/dashboard/dist/assets/{personas-DiA2bJaX.js.map → personas-Cmz2SAEU.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-Dt2d2EFR.js → pipelines-CSgfVCMy.js} +2 -2
- package/dashboard/dist/assets/{pipelines-Dt2d2EFR.js.map → pipelines-CSgfVCMy.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-cDh2hNml.js → tasks-UOtUkDk-.js} +2 -2
- package/dashboard/dist/assets/{tasks-cDh2hNml.js.map → tasks-UOtUkDk-.js.map} +1 -1
- package/dashboard/dist/assets/{topics-yFlGF-u1.js → topics-Df5hGh6o.js} +2 -2
- package/dashboard/dist/assets/{topics-yFlGF-u1.js.map → topics-Df5hGh6o.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-BA5S7V54.js → useDebouncedValue-C4P2jQuh.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-BA5S7V54.js.map → useDebouncedValue-C4P2jQuh.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-D2R_ckS8.js → useEventHooks-PDbuSJ12.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-D2R_ckS8.js.map → useEventHooks-PDbuSJ12.js.map} +1 -1
- package/dashboard/dist/assets/{useFilterParams-B7suPsIK.js → useFilterParams-crmlBw_l.js} +2 -2
- package/dashboard/dist/assets/{useFilterParams-B7suPsIK.js.map → useFilterParams-crmlBw_l.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-u-V1GVUD.js → useNamespace-tZSOlge3.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-u-V1GVUD.js.map → useNamespace-tZSOlge3.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-BhOZeqgE.js → useYamlActivityEvents-CINLzE32.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-BhOZeqgE.js.map → useYamlActivityEvents-CINLzE32.js.map} +1 -1
- package/dashboard/dist/assets/{users-BoXPwdee.js → users-G8qwyZKS.js} +2 -2
- package/dashboard/dist/assets/{users-BoXPwdee.js.map → users-G8qwyZKS.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-D71XjkNy.js → vendor-icons-BpZiWH2f.js} +135 -130
- package/dashboard/dist/assets/vendor-icons-BpZiWH2f.js.map +1 -0
- package/dashboard/dist/assets/{vendor-query-B2UbickB.js → vendor-query-RUZdMvN6.js} +2 -2
- package/dashboard/dist/assets/{vendor-query-B2UbickB.js.map → vendor-query-RUZdMvN6.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-react-C1YOyCSV.js → vendor-react-CdqEC2zv.js} +2 -2
- package/dashboard/dist/assets/{vendor-react-C1YOyCSV.js.map → vendor-react-CdqEC2zv.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-mCoyKuLZ.js → workflows-DbPqi1TW.js} +2 -2
- package/dashboard/dist/assets/{workflows-mCoyKuLZ.js.map → workflows-DbPqi1TW.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-CWxXGDpn.js → yaml-workflows-DozD8hpR.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-CWxXGDpn.js.map → yaml-workflows-DozD8hpR.js.map} +1 -1
- package/dashboard/dist/index.html +5 -5
- package/docs/hitl/x-lt-transition.md +105 -0
- package/docs/scan-codes.md +243 -0
- package/package.json +2 -2
- package/dashboard/dist/assets/BotPicker-C4uGH2x9.js +0 -2
- package/dashboard/dist/assets/ListToolbar-B2fub0DY.js +0 -2
- package/dashboard/dist/assets/TimeAgo-C_H2TyZw.js +0 -2
- package/dashboard/dist/assets/TopicsPage-DoGqAdPm.js +0 -2
- package/dashboard/dist/assets/UserName-CKO_rk1R.js +0 -2
- package/dashboard/dist/assets/capabilities-DV_5ghHT.js +0 -2
- package/dashboard/dist/assets/index-B-WkiNRN.js +0 -6
- package/dashboard/dist/assets/index-B-WkiNRN.js.map +0 -1
- package/dashboard/dist/assets/index-DbTD-dio.js +0 -63
- package/dashboard/dist/assets/index-DbTD-dio.js.map +0 -1
- package/dashboard/dist/assets/index-DnlsDaAw.css +0 -1
- package/dashboard/dist/assets/index-kzIIeVbx.js +0 -5
- package/dashboard/dist/assets/index-kzIIeVbx.js.map +0 -1
- package/dashboard/dist/assets/vendor-icons-D71XjkNy.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as b,j as e}from"./vendor-query-B2UbickB.js";import{I as re,ak as Re,G as Ie,a6 as De,t as Be}from"./index-DbTD-dio.js";import{i as ze}from"./useEventHooks-D2R_ckS8.js";import{P as He}from"./PageHeader-Bo9BU9pK.js";import{X as Ue,ar as Ye,aN as Ge,r as Ke,aP as Ve,E as Qe,O as Xe,ai as Le}from"./vendor-icons-D71XjkNy.js";import{L as A,f as Ze,u as Je}from"./vendor-react-C1YOyCSV.js";const Me=800,Pe=270,F=28,et=60,he=24,tt=72,pe=Me-F-et,fe=Pe-he-tt,L=he+fe,me=F+pe,k="0.5s cubic-bezier(0.4, 0, 0.2, 1)",ve=9;function st(t){return`M ${(t.x-ve).toFixed(1)} ${t.y.toFixed(1)} L ${(t.x+ve).toFixed(1)} ${t.y.toFixed(1)}`}function H(t){if(t.length===0)return"";if(t.length===1)return st(t[0]);const n=[];for(let r=0;r<t.length-1;r++){const x=t[Math.max(0,r-1)],c=t[r],p=t[r+1],a=t[Math.min(t.length-1,r+2)],d=(c.x+(p.x-x.x)/6).toFixed(1),u=(c.y+(p.y-x.y)/6).toFixed(1),o=(p.x-(a.x-c.x)/6).toFixed(1),l=(p.y-(a.y-c.y)/6).toFixed(1);r===0&&n.push(`M ${c.x.toFixed(1)} ${c.y.toFixed(1)}`),n.push(`C ${d} ${u}, ${o} ${l}, ${p.x.toFixed(1)} ${p.y.toFixed(1)}`)}return n.join(" ")}function nt(t,n){if(t.length<2||n.length<2)return"";const r=H(t),x=[...n].reverse(),c=H(x),p=c.slice(c.indexOf("C"));return`${r} L ${x[0].x.toFixed(1)} ${x[0].y.toFixed(1)} ${p} Z`}function ke(t){return t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function de(t){return t.length>0?t[t.length-1]:void 0}function at(t){return[1,2,5,10,20,50,100,200,500,1e3,2e3,5e3,1e4,2e4,5e4].filter(r=>r>0&&r<t*.98)}function rt(t){return[.25,.5,.75].map(r=>Math.round(r*t)).filter(r=>r>0)}const W="rgb(var(--lt-status-claimed-graphic))",U="rgb(var(--lt-status-queued-graphic))",E="rgb(var(--lt-status-success-graphic))",T="rgb(var(--lt-text-quaternary))",Y="rgb(var(--lt-status-error))";function G(t,n){return t.replace(/\)$/,` / ${n})`)}const ot=13;function lt(t,n){const r=[...t].sort((a,d)=>a.y-d.y);let x=-1/0;const c=r.map(a=>{const d=Math.max(a.y+3,x+ot);return x=d,{...a,labelY:d}}),p=c.length>0?c[c.length-1].labelY-n:0;if(p>0)for(const a of c)a.labelY-=p;return c}function it({stations:t,selectedRole:n,onSelect:r,onUpstreamSelect:x,onCmdClick:c,periodHours:p,logScale:a=!1,fill:d=!1}){const[u,o]=b.useState(null),l=t.length;if(l===0)return null;const f=s=>l===1?F+pe/2:F+s/(l-1)*pe,q=new Map(t.map((s,h)=>[s.role,f(h)])),g=t.map((s,h)=>{var C,te,se,ne;const y=s.target_per_hour??null,O=y!=null?y*p:null;return{idx:h,x:f(h),expected:O,actual:((C=s.metric)==null?void 0:C.resolved)??0,active:((te=s.metric)==null?void 0:te.claimed)??0,pending:((se=s.metric)==null?void 0:se.pending)??0,priorityCount:((ne=s.metric)==null?void 0:ne.priority_count)??0}}),M=g.some(s=>s.expected!=null),N=Math.max(1,...g.map(s=>s.expected??0),...g.map(s=>s.actual),...g.map(s=>s.expected!=null?s.pending:0))*1.15,j=a?s=>{const h=Math.log(1+N);return he+fe*(1-Math.log(1+Math.max(0,s))/h)}:s=>he+fe*(1-Math.max(0,Math.min(s,N))/N),K=a?at(N):rt(N),$=g.filter(s=>s.expected!=null),m=$.map(s=>({...s,y:j(s.expected)})),R=$.map(s=>({...s,y:j(s.actual)})),P=$.map(s=>({...s,y:j(s.active)})),S=$.map(s=>({...s,y:j(s.pending)})),V=H(m),Q=H(R),X=H(P),oe=H(S),D=de(R),le=de(m),B=de(P),ie=de(S),Z=R.length>=2&&D?`${Q} L ${D.x.toFixed(1)} ${L} L ${R[0].x.toFixed(1)} ${L} Z`:"",J=$.some(s=>s.pending>0||s.active>0),ee=J&&P.length>=2&&B?`${X} L ${B.x.toFixed(1)} ${L} L ${P[0].x.toFixed(1)} ${L} Z`:"",i=J?nt(S,P):"",v=$.some(s=>s.active>0),_=$.some(s=>s.pending>s.active),z=lt([le?{key:"target",text:"Target",color:T,y:le.y}:null,D?{key:"actual",text:"Resolved",color:E,y:D.y}:null,v&&B?{key:"active",text:"Claimed",color:W,y:B.y}:null,_&&ie?{key:"queued",text:"Pending",color:U,y:ie.y}:null].filter(Boolean),L+4);return e.jsxs("svg",{viewBox:`0 0 ${Me} ${Pe}`,className:d?"w-full h-full":"w-full",preserveAspectRatio:"xMidYMid meet",style:{display:"block",...d?{}:{height:"auto"}},children:[K.map(s=>{const h=j(s);return e.jsxs("g",{children:[e.jsx("line",{x1:F,y1:h,x2:me,y2:h,className:"stroke-surface-border",strokeWidth:.5,opacity:a?.45:.3,strokeDasharray:a?"2 5":void 0,style:{transition:`y1 ${k}, y2 ${k}`}}),e.jsx("text",{x:F-4,y:h+2.5,textAnchor:"end",fontSize:6,fontFamily:"ui-monospace, monospace",opacity:.35,className:"fill-text-quaternary",children:ke(s)})]},`grid-${s}`)}),t.map(s=>{if(!s.parent_role)return null;const h=q.get(s.parent_role);if(h==null)return null;const y=f(t.findIndex(O=>O.role===s.role));return e.jsx("line",{x1:h,y1:L,x2:y,y2:L,className:"stroke-surface-border",strokeWidth:.75},`dep-${s.role}`)}),Z&&e.jsx("path",{d:Z,opacity:.05,style:{fill:E,transition:`d ${k}`}}),ee&&e.jsx("path",{d:ee,opacity:.12,style:{fill:W,transition:`d ${k}`}}),i&&e.jsx("path",{d:i,opacity:.12,style:{fill:U,transition:`d ${k}`}}),V&&e.jsx("path",{d:V,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.7,style:{stroke:T,transition:`d ${k}`}}),m.map(s=>e.jsxs("g",{transform:`translate(${s.x} ${s.y})`,style:{transition:`transform ${k}`},children:[e.jsx("circle",{r:2,opacity:.8,style:{fill:T}}),e.jsx("text",{y:-5,textAnchor:"middle",fontSize:6.5,fontFamily:"ui-monospace, monospace",fontWeight:"500",opacity:.7,style:{fill:T},children:Math.round(s.expected)})]},`tval-${s.idx}`)),J&&oe&&e.jsx("path",{d:oe,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.55,style:{stroke:U,transition:`d ${k}`}}),X&&e.jsx("path",{d:X,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.5,style:{stroke:W,transition:`d ${k}`}}),Q&&e.jsx("path",{d:Q,fill:"none",strokeWidth:.6,strokeLinejoin:"round",strokeLinecap:"round",opacity:.65,style:{stroke:E,transition:`d ${k}`}}),P.map((s,h)=>{if(s.pending<=0&&s.active<=0)return null;const y=Math.max(2.5,Math.min(5,2.5+s.active/10)),O=s.pending>s.active,C=Math.min(S[h].y-4,s.y-y-4);return e.jsxs("g",{children:[s.pending>0&&e.jsx("text",{x:s.x,y:C,textAnchor:"middle",fontSize:7.5,fontFamily:"ui-monospace, monospace",fontWeight:"600",style:{fill:O?U:"rgb(var(--lt-text-tertiary))",transition:`y ${k}`},children:s.pending}),e.jsxs("g",{transform:`translate(${s.x} ${s.y})`,style:{transition:`transform ${k}`},children:[e.jsx("circle",{r:y,opacity:.85,style:{fill:W}}),s.active>0&&e.jsx("text",{y:y+9,textAnchor:"middle",fontSize:7.5,fontFamily:"ui-monospace, monospace",fontWeight:"600",style:{fill:W},children:s.active})]})]},`active-${s.idx}`)}),g.map(s=>{var Ne;const h=t[s.idx],y=s.x,O=s.expected!=null?j(s.actual):L,C=Math.max(2.25,Math.min(4,2.25+s.actual/160)),te=h.role===n,se=u===s.idx,ne=s.expected==null?"idle · set a target rate to plot pace":`${s.actual} resolved · target ${Math.round(s.expected)}`+(s.pending>s.active?` · ${s.pending-s.active} pending`:"")+(s.active>0?` · ${s.active} claimed`:"")+(s.priorityCount>0?` · ${s.priorityCount} in jeopardy`:""),ce=ne.length*5.5+20,je=Math.max(F+ce/2+4,Math.min(me-ce/2-4,y)),be=O-C-10;return e.jsxs("g",{onClick:ae=>{ae.metaKey||ae.ctrlKey?(ae.stopPropagation(),c==null||c(h.role)):r(h.role)},onMouseEnter:()=>o(s.idx),onMouseLeave:()=>o(null),style:{cursor:"pointer"},children:[e.jsxs("g",{transform:`translate(${y} ${O})`,style:{transition:`transform ${k}`},children:[e.jsx("circle",{r:22,fill:"transparent"}),e.jsx("circle",{r:C,opacity:.9,style:{fill:E,transition:`r ${k}`}}),s.expected!=null&&e.jsx("text",{y:-C-5,textAnchor:"middle",fontSize:9.5,fontFamily:"ui-monospace, monospace",fontWeight:"500",style:{fill:E},children:ke(s.actual)}),se&&!te&&e.jsx("circle",{r:C+3,fill:"none",strokeWidth:1,opacity:.4,style:{stroke:E}}),te&&e.jsx("circle",{r:C+4,fill:"none",className:"stroke-accent",strokeWidth:2})]}),(((Ne=h.upstream_roles)==null?void 0:Ne.length)??0)>0&&e.jsxs("g",{transform:`translate(${y-20} ${L})`,onClick:ae=>{ae.stopPropagation(),x==null||x(h.upstream_roles[0])},style:{cursor:"pointer"},children:[e.jsx("title",{children:`Fed by ${h.upstream_roles.join(", ")} — click to view that sequence`}),e.jsx("circle",{r:9,cy:-6,fill:"transparent"}),e.jsx("path",{d:"M -7 -14 C -3 -14 -1 -9 0 -2",fill:"none",className:"stroke-text-quaternary",strokeWidth:1,strokeDasharray:"2 2",strokeLinecap:"round"}),e.jsx("path",{d:"M 0 -2 L 8 -2",className:"stroke-text-quaternary",strokeWidth:1,strokeLinecap:"round"}),e.jsx("path",{d:"M 8 -2 l -3.5 -2 v 4 z",className:"fill-text-quaternary"})]}),e.jsx("text",{x:y,y:L+(s.idx%2===0?14:27),textAnchor:"middle",fontSize:9.5,className:"fill-text-tertiary",fontFamily:"ui-sans-serif, sans-serif",fontWeight:"500",children:re(h)}),se&&e.jsxs("g",{children:[e.jsx("rect",{x:je-ce/2,y:be-16,width:ce,height:19,rx:3,className:"fill-text-primary",opacity:.88}),e.jsx("text",{x:je,y:be-3,textAnchor:"middle",fontSize:8.5,className:"fill-surface",fontFamily:"ui-monospace, monospace",children:ne})]})]},h.role)}),!M&&e.jsx("text",{x:F+pe/2,y:L+48,textAnchor:"middle",fontSize:8.5,className:"fill-text-quaternary",fontFamily:"ui-sans-serif, sans-serif",children:"Set target_per_hour on each role in Admin → Roles to enable the pace chart"}),z.map(s=>e.jsx("text",{x:me+6,y:s.labelY,fontSize:8,fontFamily:"ui-sans-serif, sans-serif",fontWeight:s.key==="actual"?700:500,opacity:s.key==="active"?.85:1,style:{fill:s.color,transition:`y ${k}`},children:s.text},s.key))]})}function Ce(t){const n=t.priority_facet?`metadata.${t.priority_facet}`:"created_at",r=JSON.stringify([{field:n,direction:"asc"}]);return`/escalations/available?role=${encodeURIComponent(t.role)}&jeopardy=1&view=table&orderBy=${encodeURIComponent(r)}`}const qe=["15m","1h","24h","7d","30d"],ct=t=>qe.includes(t);function xe(t){if(t==null)return"—";if(t<1){const n=Math.round(t*60);return n<=0?"< 1s":`${n}s`}return t<60?`${t.toFixed(0)}m`:`${(t/60).toFixed(1)}h`}function ue({label:t,value:n}){return e.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[e.jsx("span",{className:"text-2xs text-text-tertiary uppercase tracking-wider",children:t}),e.jsx("span",{className:"text-xs font-mono font-medium text-text-primary tabular-nums",children:n})]})}function dt({period:t,onChange:n}){return e.jsx("div",{className:"flex items-center gap-1 mb-4",children:qe.map(r=>e.jsx("button",{onClick:()=>n(r),className:`px-2 py-0.5 text-2xs font-mono rounded transition-colors ${t===r?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:r},r))})}function xt({role:t,globalPeriod:n,onClose:r}){const[x,c]=b.useState(ct(n)?n:"24h"),{data:p}=Re(x),a=p==null?void 0:p.stations.find(l=>l.role===t.role),d=t.sla_minutes??void 0,u=t.target_per_hour??void 0,o=t.worker_count??void 0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[e.jsx("span",{className:"text-sm font-bold text-text-primary",children:re(t)}),e.jsx("span",{className:"text-2xs font-mono text-text-secondary",children:t.role})]}),t.description&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-1 line-clamp-2 leading-relaxed",children:t.description})]}),e.jsx("button",{onClick:r,className:"icon-link mt-0.5 shrink-0 ml-2",children:e.jsx(Ue,{className:"w-4 h-4"})})]}),a&&a.priority_count>0&&e.jsxs(A,{to:Ce(t),className:"flex items-center justify-between group mb-4",children:[e.jsxs("span",{className:"text-2xs",style:{color:Y},children:[a.priority_count," in jeopardy — pull oldest first"]}),e.jsx(Ye,{className:"w-3 h-3 transition-colors",style:{color:Y}})]}),e.jsx(dt,{period:x,onChange:c}),(u||d||o)&&e.jsxs("div",{className:"flex items-center gap-6 mb-6 text-2xs border-b border-surface-border/30 pb-5",children:[u&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-mono font-semibold text-text-primary text-sm",children:[u,"/h"]}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"target"})]}),d&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-mono font-semibold text-text-primary text-sm",children:[d,"m"]}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"SLA"})]}),o&&e.jsxs("div",{children:[e.jsx("div",{className:"font-mono font-semibold text-text-primary text-sm",children:o}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"workers"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 mb-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-text-quaternary uppercase tracking-wider mb-2",children:"Wait (queue)"}),e.jsx(ue,{label:"P99",value:xe((a==null?void 0:a.wait.p99)??null)}),e.jsx(ue,{label:"avg",value:xe((a==null?void 0:a.wait.avg)??null)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-text-quaternary uppercase tracking-wider mb-2",children:"Work (proc.)"}),e.jsx(ue,{label:"P99",value:xe((a==null?void 0:a.work.p99)??null)}),e.jsx(ue,{label:"avg",value:xe((a==null?void 0:a.work.avg)??null)})]})]}),d&&e.jsx("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs text-text-tertiary",children:"SLA target"}),e.jsxs("span",{className:"text-xs font-mono text-text-secondary",children:[d,"m"]})]})})]})}function ut({allMetrics:t,orderedRoles:n,period:r}){const x=t.reduce((o,l)=>o+l.pending,0),c=t.reduce((o,l)=>o+l.resolved,0),p=t.reduce((o,l)=>o+l.priority_count,0),a=new Map(t.map(o=>[o.role,o])),d=t.filter(o=>o.priority_count>0).length,u=t.filter(o=>o.pending>0).length;return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-2xs text-text-quaternary uppercase tracking-wider mb-3",children:["Pipeline · ",r]}),e.jsx("div",{className:"mb-4",children:d>0?e.jsxs("p",{className:"text-2xs",style:{color:Y},children:[d," station",d>1?"s":""," with items in jeopardy"]}):u>0?e.jsxs("p",{className:"text-2xs text-status-warning",children:[u," station",u>1?"s":""," with backlog"]}):c>0?e.jsx("p",{className:"text-2xs text-status-success",children:"Flowing — queue clear"}):e.jsx("p",{className:"text-2xs text-text-quaternary",children:"Quiet — awaiting work"})}),e.jsxs("div",{className:"space-y-1.5 mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider",children:"Pending"}),e.jsx("span",{className:`text-xs font-mono tabular-nums ${x>0?"text-text-primary font-semibold":"text-text-quaternary"}`,children:x})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider",children:["Resolved · ",r]}),e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-secondary",children:c})]}),p>0&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider",children:"Priority"}),e.jsx("span",{className:"text-xs font-mono tabular-nums font-semibold",style:{color:Y},children:p})]})]}),e.jsx("div",{className:"border-t border-surface-border/40 pt-2 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider flex-1",children:"Station"}),e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider w-8 text-right shrink-0",children:"pend"}),e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider w-8 text-right shrink-0",children:"clmd"}),e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider w-8 text-right shrink-0",children:"res"})]})}),e.jsx("div",{className:"space-y-0.5",children:n.map(o=>{const l=a.get(o.role),f=(l==null?void 0:l.pending)??0,q=(l==null?void 0:l.claimed)??0,g=(l==null?void 0:l.resolved)??0,M=(l==null?void 0:l.priority_count)??0,w=o.title||o.role,N=M>0,j=f>0;return e.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[e.jsx("span",{className:`text-2xs font-mono flex-1 truncate ${j?"text-text-primary":"text-text-quaternary"}`,title:w,children:w}),e.jsx("span",{className:"text-[0.625rem] leading-none font-semibold tabular-nums w-4 text-right shrink-0",style:{color:Y},title:N?`${M} priority — pull oldest first`:void 0,children:N?M:""}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${j?"text-text-primary font-semibold":"text-text-quaternary"}`,children:f>0?f:"—"}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${q>0?"text-accent font-semibold":"text-text-quaternary"}`,children:q>0?q:"—"}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${g>0?"text-text-secondary":"text-text-quaternary"}`,children:g>0?g:"—"})]},o.role)})}),e.jsx("p",{className:"text-2xs text-text-quaternary mt-5",children:"Select a station for queue detail."})]})}function pt({role:t,allMetrics:n,orderedRoles:r,globalPeriod:x,onClose:c}){return e.jsx("div",{className:"w-[280px] shrink-0 px-7 py-10 flex flex-col overflow-y-auto min-h-0",children:t?e.jsx(xt,{role:t,globalPeriod:x,onClose:c}):e.jsx(ut,{allMetrics:n,orderedRoles:r,period:x})})}const ht=T,ge="rgb(var(--lt-accent))",Ee=G(T,.09),Oe=G(T,.09),Ae=G(ge,.07),Fe=G(U,.08),We=G(W,.08),Te=G(E,.08),mt=["15m","1h","24h","7d","30d"],we={"15m":.25,"1h":1,"24h":24,"7d":168,"30d":720};function ye(t){const n=t.filter(a=>a.ops_visible),r=new Map(n.map(a=>[a.role,a])),x=new Set,p=n.filter(a=>!a.parent_role||!r.has(a.parent_role)).map(a=>{const d=[],u=[{role:a,depth:0}];for(;u.length>0;){const o=u.shift();x.has(o.role.role)||(x.add(o.role.role),d.push(o),n.filter(l=>l.parent_role===o.role.role&&!x.has(l.role)).forEach(l=>u.push({role:l,depth:o.depth+1})))}return{origin:a,stations:d}});return n.filter(a=>!x.has(a.role)).forEach(a=>p.push({origin:a,stations:[{role:a,depth:0}]})),p.sort((a,d)=>d.stations.length-a.stations.length||a.origin.role.localeCompare(d.origin.role))}function $e(t){if(t==null)return"—";if(t<1){const n=Math.round(t*60);return n<=0?"< 1s":`${n}s`}return t<60?`${t.toFixed(0)}m`:`${(t/60).toFixed(1)}h`}function ft(t,n){if(!n||t===0)return{pct:null,color:"bg-surface-border"};const r=t/n,x=Math.round(r*100),c=r>1?"bg-status-warning":r<.2?"bg-status-draft":"bg-status-success";return{pct:x,color:c}}function _e({value:t,onSave:n}){const[r,x]=b.useState(t!=null?String(t):""),c=b.useRef(void 0),p=a=>{const d=parseInt(a,10);n(!a.trim()||isNaN(d)||d<0?null:d)};return e.jsx("input",{type:"number",min:0,step:1,value:r,onChange:a=>{const d=a.target.value;x(d),clearTimeout(c.current),c.current=setTimeout(()=>p(d),400)},onBlur:a=>{clearTimeout(c.current),p(a.target.value)},onClick:a=>a.stopPropagation(),onKeyDown:a=>a.stopPropagation(),className:"w-full bg-transparent text-xs font-mono tabular-nums text-right focus:outline-none"})}function yt({role:t,metric:n,selected:r,periodHours:x,onClick:c}){var $;const p=De(),{isBuilder:a,isOps:d}=Be(),u=(n==null?void 0:n.pending)??0,o=(n==null?void 0:n.claimed)??0,l=(n==null?void 0:n.resolved)??0,f=(n==null?void 0:n.priority_count)??0,q=t.target_per_hour??null,{pct:g,color:M}=ft(u,q),w=g!=null?Math.min(100,g):0,N=bt(t.target_per_hour??null,t.sla_minutes??null,u,x),j=m=>p.mutate({role:t.role,target_per_hour:m}),K=m=>p.mutate({role:t.role,sla_minutes:m});return e.jsxs("tr",{tabIndex:0,onClick:c,onKeyDown:m=>{m.key==="Enter"&&c()},className:`cursor-pointer border-b border-surface-border/30 last:border-b-0 transition-colors ${r?"border-l-2 !border-l-accent":""}`,children:[e.jsx("td",{className:"pl-3 pr-2 py-1.5 overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"font-bold text-text-primary truncate text-xs",children:re(t)}),((($=t.upstream_roles)==null?void 0:$.length)??0)>0&&e.jsx("span",{title:`Fed by ${t.upstream_roles.join(", ")}`,className:"shrink-0 leading-none",children:e.jsx(Ve,{className:"w-3 h-3 text-text-quaternary"})})]})}),e.jsx("td",{className:"hidden xl:table-cell pr-2 py-1.5 overflow-hidden",children:e.jsx("span",{className:"block font-mono text-2xs text-text-tertiary truncate",children:t.role})}),e.jsx("td",{className:"px-2 py-1.5",style:{backgroundColor:Ee},children:e.jsx(_e,{value:t.target_per_hour??null,onSave:j})}),e.jsx("td",{className:"px-2 py-1.5",style:{backgroundColor:Oe},children:e.jsx(_e,{value:t.sla_minutes??null,onSave:K})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:Ae},title:N!=null?`~${N} concurrent worker${N===1?"":"s"} to sustain ${t.target_per_hour}/h within ${t.sla_minutes}m SLA`:void 0,children:e.jsx("span",{className:`text-xs font-mono tabular-nums ${N!=null?"":"text-text-quaternary"}`,style:N!=null?{color:ge}:void 0,children:N??"—"})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:Fe},children:e.jsx(A,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=available`,className:`text-xs font-mono tabular-nums hover:underline ${u>0?"text-text-primary font-semibold":"text-text-quaternary"}`,onClick:m=>m.stopPropagation(),children:u})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:We},children:e.jsx(A,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=claimed`,className:`text-xs font-mono tabular-nums hover:underline ${o>0?"font-semibold":"text-text-quaternary"}`,style:o>0?{color:W}:void 0,onClick:m=>m.stopPropagation(),children:o})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:Te},children:e.jsx(A,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=resolved`,className:`text-xs font-mono tabular-nums hover:underline ${l>0?"text-text-secondary":"text-text-quaternary"}`,style:l>0?{color:E}:void 0,onClick:m=>m.stopPropagation(),children:l})}),e.jsx("td",{className:"hidden xl:table-cell px-2 py-1.5 text-right",children:e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-secondary",children:$e((n==null?void 0:n.wait.p99)??null)})}),e.jsx("td",{className:"hidden xl:table-cell px-2 py-1.5 text-right",children:e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-secondary",children:$e((n==null?void 0:n.work.p99)??null)})}),e.jsx("td",{className:"hidden lg:table-cell px-2 py-1.5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-12 h-1.5 bg-surface-sunken rounded-full overflow-hidden shrink-0",children:e.jsx("div",{className:`h-full rounded-full ${M}`,style:{width:`${w}%`}})}),e.jsx("span",{className:`text-2xs font-mono tabular-nums ${g!=null&&g>100?"text-status-warning font-semibold":"text-text-quaternary"}`,children:g!=null?`${g}%`:"—"})]})}),e.jsx("td",{className:"py-1.5",children:e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[e.jsx(A,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=all`,className:"icon-link",title:"View all items in queue",onClick:m=>m.stopPropagation(),children:e.jsx(Qe,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"w-3.5 flex items-center justify-center",children:(a||d)&&e.jsx(A,{to:`/admin/roles/${encodeURIComponent(t.role)}`,className:"icon-link",title:"Configure this role",onClick:m=>m.stopPropagation(),children:e.jsx(Xe,{className:"w-3.5 h-3.5"})})}),e.jsx("span",{className:"w-3.5 flex items-center justify-center",children:f>0&&e.jsx(A,{to:Ce(t),className:"text-status-error hover:opacity-70 transition-opacity",title:`${f} item${f===1?"":"s"} in jeopardy — pull oldest first`,onClick:m=>m.stopPropagation(),children:e.jsx(Le,{className:"w-3.5 h-3.5",strokeWidth:2})})})]})})]})}function Se({n:t}){return t<=0?null:e.jsxs("span",{className:"inline-flex items-center gap-0.5 font-semibold tabular-nums",style:{color:Y},title:`${t} in jeopardy`,children:[e.jsx(Le,{className:"w-3 h-3",strokeWidth:2.25}),t>9?"9+":t]})}function gt({fragments:t,aggregates:n,activeOrigin:r,onSelect:x}){const[c,p]=b.useState(!1),a=b.useRef(null);b.useEffect(()=>{if(!c)return;const o=f=>{a.current&&!a.current.contains(f.target)&&p(!1)},l=f=>{f.key==="Escape"&&p(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",l)}},[c]);const d=t.find(o=>o.origin.role===r)??t[0];if(!d)return null;const u=n.get(d.origin.role);return e.jsxs("div",{ref:a,className:"relative px-4 pt-2",children:[e.jsxs("button",{type:"button",onClick:()=>p(o=>!o),className:"group flex items-baseline gap-2.5","aria-expanded":c,"aria-haspopup":"listbox",children:[e.jsx("span",{className:"text-sm font-medium text-text-primary group-hover:text-accent transition-colors",children:re(d.origin)}),e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary tabular-nums",children:[(u==null?void 0:u.stations)??d.stations.length," station",((u==null?void 0:u.stations)??d.stations.length)===1?"":"s"," · ",(u==null?void 0:u.pending)??0," pending"]}),e.jsx(Se,{n:(u==null?void 0:u.jeopardy)??0}),e.jsx(Ke,{className:`w-3.5 h-3.5 self-center shrink-0 text-text-tertiary group-hover:text-accent transition-transform ${c?"rotate-180":""}`,strokeWidth:1.5})]}),c&&e.jsx("div",{role:"listbox",className:"absolute z-[100] top-full left-4 mt-1.5 min-w-[20rem] max-h-80 overflow-y-auto bg-surface-raised border border-surface-border rounded-md shadow-lg py-1",children:t.map(o=>{const l=n.get(o.origin.role),f=o.origin.role===d.origin.role;return e.jsxs("button",{type:"button",role:"option","aria-selected":f,onClick:()=>{x(o.origin.role),p(!1)},className:`w-full text-left px-3 py-1.5 flex items-baseline gap-2.5 transition-colors ${f?"text-accent bg-accent/5":"text-text-primary hover:bg-surface-hover"}`,children:[e.jsx("span",{className:"text-xs font-medium truncate",children:re(o.origin)}),e.jsxs("span",{className:"ml-auto text-2xs font-mono text-text-quaternary tabular-nums shrink-0",children:[(l==null?void 0:l.stations)??o.stations.length," st · ",(l==null?void 0:l.pending)??0," pending"]}),e.jsx("span",{className:"w-12 shrink-0 text-left text-2xs",children:e.jsx(Se,{n:(l==null?void 0:l.jeopardy)??0})})]},o.origin.role)})})]})}const jt=[{label:"TARGET/H",band:Ee,hue:T,w:"w-[8%]"},{label:"SLA/M",band:Oe,hue:ht,w:"w-[7%]"},{label:"WORKERS",band:Ae,hue:ge,w:"w-[8%]"},{label:"PENDING",band:Fe,hue:U,w:"w-[8%]"},{label:"CLAIMED",band:We,hue:W,w:"w-[8%]"},{label:"RESOLVED",band:Te,hue:E,w:"w-[8%]"}];function bt(t,n,r,x){if(!t||!n)return null;const c=t*n/60,p=r>0?r*n/(60*x):0;return Math.ceil(c+p)}const I="sticky top-0 z-10 bg-surface border-b border-surface-border py-1.5 text-2xs font-semibold uppercase tracking-wider whitespace-nowrap";function Nt(){return e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:`${I} pl-3 pr-2 text-left text-text-quaternary`,children:"NAME"}),e.jsx("th",{className:`${I} hidden xl:table-cell w-[12%] pr-2 text-left text-text-quaternary`,children:"ROLE"}),jt.map(t=>e.jsx("th",{className:`${I} ${t.w} px-2 text-right`,style:{color:t.hue,backgroundImage:`linear-gradient(${t.band}, ${t.band})`},children:t.label},t.label)),e.jsx("th",{className:`${I} hidden xl:table-cell w-[8%] px-2 text-right text-text-quaternary`,children:"P99 WAIT"}),e.jsx("th",{className:`${I} hidden xl:table-cell w-[8%] px-2 text-right text-text-quaternary`,children:"P99 WORK"}),e.jsx("th",{className:`${I} hidden lg:table-cell w-[11%] px-2 text-left text-text-quaternary`,children:"TREND"}),e.jsx("th",{className:`${I} w-20 px-1 text-center text-text-quaternary`,children:"ACTIONS"})]})})}function vt(){var ee;const[t,n]=b.useState("1h"),[r,x]=b.useState(null),[c,p]=b.useState(!1),[a,d]=b.useState(!0);ze();const{data:u,isLoading:o,refetch:l}=Ie(),{data:f,isLoading:q,refetch:g}=Re(t),M=(u==null?void 0:u.roles)??[],w=(f==null?void 0:f.stations)??[],N=b.useMemo(()=>{const i=new Map(w.map(_=>[_.role,_])),v=new Map;for(const _ of ye((u==null?void 0:u.roles)??[])){let z=0,s=0;for(const h of _.stations){const y=i.get(h.role.role);z+=(y==null?void 0:y.pending)??0,s+=(y==null?void 0:y.priority_count)??0}v.set(_.origin.role,{stations:_.stations.length,pending:z,jeopardy:s})}return v},[w,u]),j=b.useMemo(()=>ye(M),[M]),[K,$]=Ze(),m=K.get("fragment"),R=j.find(i=>i.origin.role===m)??j[0]??null,P=b.useCallback(i=>{x(null),$(v=>{const _=new URLSearchParams(v);return _.set("fragment",i),_})},[$]),S=(R==null?void 0:R.stations)??[],V=b.useMemo(()=>new Set(S.map(({role:i})=>i.role)),[S]),Q=b.useMemo(()=>w.filter(i=>V.has(i.role)),[w,V]),X=b.useMemo(()=>S.map(({role:i})=>({role:i.role,title:i.title,parent_role:i.parent_role,target_per_hour:i.target_per_hour??null,upstream_roles:i.upstream_roles??[],metric:w.find(v=>v.role===i.role)})),[S,w]),oe=b.useCallback(i=>{const v=j.find(_=>_.stations.some(({role:z})=>z.role===i));v&&P(v.origin.role)},[j,P]),D=Je(),le=((ee=S.find(({role:i})=>i.role===r))==null?void 0:ee.role)??null,B=o||q,ie=async()=>{p(!0),await Promise.all([l(),g()]),p(!1)},Z=i=>x(v=>v===i?null:i),J=e.jsx("div",{className:"flex items-center gap-0.5",children:mt.map(i=>e.jsx("button",{onClick:()=>n(i),className:`px-2.5 py-1 text-2xs font-mono rounded transition-colors ${t===i?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:i},i))});return e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx(He,{title:"Pace Board",docsHash:"#docs:dashboard.md:pace-board",center:J,actions:e.jsx("button",{onClick:ie,disabled:c,className:"icon-link disabled:opacity-40",children:e.jsx(Ge,{className:`w-3.5 h-3.5 ${c?"animate-spin":""}`})})}),B?e.jsxs("div",{className:"animate-pulse space-y-6 mt-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-64 bg-surface-sunken rounded w-full"}),e.jsx("div",{className:"space-y-3",children:[1,2,3].map(i=>e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-full"},i))})]}):j.length===0?e.jsxs("div",{className:"mt-8",children:[e.jsx("p",{className:"text-sm text-text-secondary mb-2",children:"Stations appear here once roles are marked visible in Operations."}),e.jsxs("p",{className:"text-xs text-text-tertiary",children:["Go to"," ",e.jsx(A,{to:"/admin/roles",className:"text-accent hover:underline",children:"Roles"})," ","and enable ",e.jsx("strong",{children:"Visible in Operations"})," on roles that represent pipeline stations."]})]}):e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("div",{className:"flex-1",children:j.length>1&&e.jsx(gt,{fragments:j,aggregates:N,activeOrigin:(R==null?void 0:R.origin.role)??null,onSelect:P})}),e.jsx("div",{className:"flex items-center gap-0.5 px-4 pt-2 pb-0.5",children:["lin","log"].map(i=>e.jsx("button",{onClick:()=>d(i==="log"),className:`px-2 py-0.5 text-2xs font-mono rounded transition-colors ${(a?"log":"lin")===i?"text-accent font-semibold":"icon-link"}`,title:i==="lin"?"Linear Y axis":"Logarithmic Y axis — reveals shape across wide value ranges",children:i},i))})]}),e.jsxs("div",{className:"flex-1 min-h-[40vh] flex items-stretch overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-w-0 min-h-0 flex flex-col justify-center overflow-hidden px-2 py-4",children:e.jsx(it,{stations:X,selectedRole:r,onSelect:Z,onUpstreamSelect:oe,onCmdClick:i=>D(`/escalations/available?role=${encodeURIComponent(i)}`),periodHours:we[t],logScale:a})}),e.jsx("div",{className:"w-px bg-surface-border shrink-0 self-stretch"}),e.jsx(pt,{role:le,allMetrics:Q,orderedRoles:S.map(i=>i.role),globalPeriod:t,onClose:()=>x(null)})]}),e.jsx("div",{className:"max-h-[30vh] flex-none overflow-y-auto border-t border-surface-border",children:e.jsxs("table",{className:"w-full table-fixed",children:[e.jsx(Nt,{}),e.jsx("tbody",{children:S.map(({role:i})=>e.jsx(yt,{role:i,metric:w.find(v=>v.role===i.role),selected:r===i.role,periodHours:we[t],onClick:()=>Z(i.role)},i.role))})]})})]})]})}const Lt=Object.freeze(Object.defineProperty({__proto__:null,OperationsPage:vt,buildFragments:ye},Symbol.toStringTag,{value:"Module"}));export{Lt as O,it as P,ye as b,Ce as j};
|
|
2
|
-
//# sourceMappingURL=OperationsPage-
|
|
1
|
+
import{a as b,j as e}from"./vendor-query-RUZdMvN6.js";import{I as re,at as Re,G as Ie,a9 as De,t as Be}from"./index-CfAi1OsI.js";import{i as ze}from"./useEventHooks-PDbuSJ12.js";import{P as He}from"./PageHeader-Ce4GcIYo.js";import{X as Ue,as as Ye,aO as Ge,s as Ke,aQ as Ve,E as Qe,Q as Xe,aj as Le}from"./vendor-icons-BpZiWH2f.js";import{L as A,f as Ze,u as Je}from"./vendor-react-CdqEC2zv.js";const Me=800,Pe=270,F=28,et=60,he=24,tt=72,pe=Me-F-et,fe=Pe-he-tt,L=he+fe,me=F+pe,k="0.5s cubic-bezier(0.4, 0, 0.2, 1)",ve=9;function st(t){return`M ${(t.x-ve).toFixed(1)} ${t.y.toFixed(1)} L ${(t.x+ve).toFixed(1)} ${t.y.toFixed(1)}`}function H(t){if(t.length===0)return"";if(t.length===1)return st(t[0]);const n=[];for(let r=0;r<t.length-1;r++){const x=t[Math.max(0,r-1)],c=t[r],p=t[r+1],a=t[Math.min(t.length-1,r+2)],d=(c.x+(p.x-x.x)/6).toFixed(1),u=(c.y+(p.y-x.y)/6).toFixed(1),o=(p.x-(a.x-c.x)/6).toFixed(1),l=(p.y-(a.y-c.y)/6).toFixed(1);r===0&&n.push(`M ${c.x.toFixed(1)} ${c.y.toFixed(1)}`),n.push(`C ${d} ${u}, ${o} ${l}, ${p.x.toFixed(1)} ${p.y.toFixed(1)}`)}return n.join(" ")}function nt(t,n){if(t.length<2||n.length<2)return"";const r=H(t),x=[...n].reverse(),c=H(x),p=c.slice(c.indexOf("C"));return`${r} L ${x[0].x.toFixed(1)} ${x[0].y.toFixed(1)} ${p} Z`}function ke(t){return t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function de(t){return t.length>0?t[t.length-1]:void 0}function at(t){return[1,2,5,10,20,50,100,200,500,1e3,2e3,5e3,1e4,2e4,5e4].filter(r=>r>0&&r<t*.98)}function rt(t){return[.25,.5,.75].map(r=>Math.round(r*t)).filter(r=>r>0)}const W="rgb(var(--lt-status-claimed-graphic))",U="rgb(var(--lt-status-queued-graphic))",E="rgb(var(--lt-status-success-graphic))",T="rgb(var(--lt-text-quaternary))",Y="rgb(var(--lt-status-error))";function G(t,n){return t.replace(/\)$/,` / ${n})`)}const ot=13;function lt(t,n){const r=[...t].sort((a,d)=>a.y-d.y);let x=-1/0;const c=r.map(a=>{const d=Math.max(a.y+3,x+ot);return x=d,{...a,labelY:d}}),p=c.length>0?c[c.length-1].labelY-n:0;if(p>0)for(const a of c)a.labelY-=p;return c}function it({stations:t,selectedRole:n,onSelect:r,onUpstreamSelect:x,onCmdClick:c,periodHours:p,logScale:a=!1,fill:d=!1}){const[u,o]=b.useState(null),l=t.length;if(l===0)return null;const f=s=>l===1?F+pe/2:F+s/(l-1)*pe,q=new Map(t.map((s,h)=>[s.role,f(h)])),g=t.map((s,h)=>{var C,te,se,ne;const y=s.target_per_hour??null,O=y!=null?y*p:null;return{idx:h,x:f(h),expected:O,actual:((C=s.metric)==null?void 0:C.resolved)??0,active:((te=s.metric)==null?void 0:te.claimed)??0,pending:((se=s.metric)==null?void 0:se.pending)??0,priorityCount:((ne=s.metric)==null?void 0:ne.priority_count)??0}}),M=g.some(s=>s.expected!=null),N=Math.max(1,...g.map(s=>s.expected??0),...g.map(s=>s.actual),...g.map(s=>s.expected!=null?s.pending:0))*1.15,j=a?s=>{const h=Math.log(1+N);return he+fe*(1-Math.log(1+Math.max(0,s))/h)}:s=>he+fe*(1-Math.max(0,Math.min(s,N))/N),K=a?at(N):rt(N),$=g.filter(s=>s.expected!=null),m=$.map(s=>({...s,y:j(s.expected)})),R=$.map(s=>({...s,y:j(s.actual)})),P=$.map(s=>({...s,y:j(s.active)})),S=$.map(s=>({...s,y:j(s.pending)})),V=H(m),Q=H(R),X=H(P),oe=H(S),D=de(R),le=de(m),B=de(P),ie=de(S),Z=R.length>=2&&D?`${Q} L ${D.x.toFixed(1)} ${L} L ${R[0].x.toFixed(1)} ${L} Z`:"",J=$.some(s=>s.pending>0||s.active>0),ee=J&&P.length>=2&&B?`${X} L ${B.x.toFixed(1)} ${L} L ${P[0].x.toFixed(1)} ${L} Z`:"",i=J?nt(S,P):"",v=$.some(s=>s.active>0),_=$.some(s=>s.pending>s.active),z=lt([le?{key:"target",text:"Target",color:T,y:le.y}:null,D?{key:"actual",text:"Resolved",color:E,y:D.y}:null,v&&B?{key:"active",text:"Claimed",color:W,y:B.y}:null,_&&ie?{key:"queued",text:"Pending",color:U,y:ie.y}:null].filter(Boolean),L+4);return e.jsxs("svg",{viewBox:`0 0 ${Me} ${Pe}`,className:d?"w-full h-full":"w-full",preserveAspectRatio:"xMidYMid meet",style:{display:"block",...d?{}:{height:"auto"}},children:[K.map(s=>{const h=j(s);return e.jsxs("g",{children:[e.jsx("line",{x1:F,y1:h,x2:me,y2:h,className:"stroke-surface-border",strokeWidth:.5,opacity:a?.45:.3,strokeDasharray:a?"2 5":void 0,style:{transition:`y1 ${k}, y2 ${k}`}}),e.jsx("text",{x:F-4,y:h+2.5,textAnchor:"end",fontSize:6,fontFamily:"ui-monospace, monospace",opacity:.35,className:"fill-text-quaternary",children:ke(s)})]},`grid-${s}`)}),t.map(s=>{if(!s.parent_role)return null;const h=q.get(s.parent_role);if(h==null)return null;const y=f(t.findIndex(O=>O.role===s.role));return e.jsx("line",{x1:h,y1:L,x2:y,y2:L,className:"stroke-surface-border",strokeWidth:.75},`dep-${s.role}`)}),Z&&e.jsx("path",{d:Z,opacity:.05,style:{fill:E,transition:`d ${k}`}}),ee&&e.jsx("path",{d:ee,opacity:.12,style:{fill:W,transition:`d ${k}`}}),i&&e.jsx("path",{d:i,opacity:.12,style:{fill:U,transition:`d ${k}`}}),V&&e.jsx("path",{d:V,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.7,style:{stroke:T,transition:`d ${k}`}}),m.map(s=>e.jsxs("g",{transform:`translate(${s.x} ${s.y})`,style:{transition:`transform ${k}`},children:[e.jsx("circle",{r:2,opacity:.8,style:{fill:T}}),e.jsx("text",{y:-5,textAnchor:"middle",fontSize:6.5,fontFamily:"ui-monospace, monospace",fontWeight:"500",opacity:.7,style:{fill:T},children:Math.round(s.expected)})]},`tval-${s.idx}`)),J&&oe&&e.jsx("path",{d:oe,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.55,style:{stroke:U,transition:`d ${k}`}}),X&&e.jsx("path",{d:X,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.5,style:{stroke:W,transition:`d ${k}`}}),Q&&e.jsx("path",{d:Q,fill:"none",strokeWidth:.6,strokeLinejoin:"round",strokeLinecap:"round",opacity:.65,style:{stroke:E,transition:`d ${k}`}}),P.map((s,h)=>{if(s.pending<=0&&s.active<=0)return null;const y=Math.max(2.5,Math.min(5,2.5+s.active/10)),O=s.pending>s.active,C=Math.min(S[h].y-4,s.y-y-4);return e.jsxs("g",{children:[s.pending>0&&e.jsx("text",{x:s.x,y:C,textAnchor:"middle",fontSize:7.5,fontFamily:"ui-monospace, monospace",fontWeight:"600",style:{fill:O?U:"rgb(var(--lt-text-tertiary))",transition:`y ${k}`},children:s.pending}),e.jsxs("g",{transform:`translate(${s.x} ${s.y})`,style:{transition:`transform ${k}`},children:[e.jsx("circle",{r:y,opacity:.85,style:{fill:W}}),s.active>0&&e.jsx("text",{y:y+9,textAnchor:"middle",fontSize:7.5,fontFamily:"ui-monospace, monospace",fontWeight:"600",style:{fill:W},children:s.active})]})]},`active-${s.idx}`)}),g.map(s=>{var Ne;const h=t[s.idx],y=s.x,O=s.expected!=null?j(s.actual):L,C=Math.max(2.25,Math.min(4,2.25+s.actual/160)),te=h.role===n,se=u===s.idx,ne=s.expected==null?"idle · set a target rate to plot pace":`${s.actual} resolved · target ${Math.round(s.expected)}`+(s.pending>s.active?` · ${s.pending-s.active} pending`:"")+(s.active>0?` · ${s.active} claimed`:"")+(s.priorityCount>0?` · ${s.priorityCount} in jeopardy`:""),ce=ne.length*5.5+20,je=Math.max(F+ce/2+4,Math.min(me-ce/2-4,y)),be=O-C-10;return e.jsxs("g",{onClick:ae=>{ae.metaKey||ae.ctrlKey?(ae.stopPropagation(),c==null||c(h.role)):r(h.role)},onMouseEnter:()=>o(s.idx),onMouseLeave:()=>o(null),style:{cursor:"pointer"},children:[e.jsxs("g",{transform:`translate(${y} ${O})`,style:{transition:`transform ${k}`},children:[e.jsx("circle",{r:22,fill:"transparent"}),e.jsx("circle",{r:C,opacity:.9,style:{fill:E,transition:`r ${k}`}}),s.expected!=null&&e.jsx("text",{y:-C-5,textAnchor:"middle",fontSize:9.5,fontFamily:"ui-monospace, monospace",fontWeight:"500",style:{fill:E},children:ke(s.actual)}),se&&!te&&e.jsx("circle",{r:C+3,fill:"none",strokeWidth:1,opacity:.4,style:{stroke:E}}),te&&e.jsx("circle",{r:C+4,fill:"none",className:"stroke-accent",strokeWidth:2})]}),(((Ne=h.upstream_roles)==null?void 0:Ne.length)??0)>0&&e.jsxs("g",{transform:`translate(${y-20} ${L})`,onClick:ae=>{ae.stopPropagation(),x==null||x(h.upstream_roles[0])},style:{cursor:"pointer"},children:[e.jsx("title",{children:`Fed by ${h.upstream_roles.join(", ")} — click to view that sequence`}),e.jsx("circle",{r:9,cy:-6,fill:"transparent"}),e.jsx("path",{d:"M -7 -14 C -3 -14 -1 -9 0 -2",fill:"none",className:"stroke-text-quaternary",strokeWidth:1,strokeDasharray:"2 2",strokeLinecap:"round"}),e.jsx("path",{d:"M 0 -2 L 8 -2",className:"stroke-text-quaternary",strokeWidth:1,strokeLinecap:"round"}),e.jsx("path",{d:"M 8 -2 l -3.5 -2 v 4 z",className:"fill-text-quaternary"})]}),e.jsx("text",{x:y,y:L+(s.idx%2===0?14:27),textAnchor:"middle",fontSize:9.5,className:"fill-text-tertiary",fontFamily:"ui-sans-serif, sans-serif",fontWeight:"500",children:re(h)}),se&&e.jsxs("g",{children:[e.jsx("rect",{x:je-ce/2,y:be-16,width:ce,height:19,rx:3,className:"fill-text-primary",opacity:.88}),e.jsx("text",{x:je,y:be-3,textAnchor:"middle",fontSize:8.5,className:"fill-surface",fontFamily:"ui-monospace, monospace",children:ne})]})]},h.role)}),!M&&e.jsx("text",{x:F+pe/2,y:L+48,textAnchor:"middle",fontSize:8.5,className:"fill-text-quaternary",fontFamily:"ui-sans-serif, sans-serif",children:"Set target_per_hour on each role in Admin → Roles to enable the pace chart"}),z.map(s=>e.jsx("text",{x:me+6,y:s.labelY,fontSize:8,fontFamily:"ui-sans-serif, sans-serif",fontWeight:s.key==="actual"?700:500,opacity:s.key==="active"?.85:1,style:{fill:s.color,transition:`y ${k}`},children:s.text},s.key))]})}function Ce(t){const n=t.priority_facet?`metadata.${t.priority_facet}`:"created_at",r=JSON.stringify([{field:n,direction:"asc"}]);return`/escalations/available?role=${encodeURIComponent(t.role)}&jeopardy=1&view=table&orderBy=${encodeURIComponent(r)}`}const qe=["15m","1h","24h","7d","30d"],ct=t=>qe.includes(t);function xe(t){if(t==null)return"—";if(t<1){const n=Math.round(t*60);return n<=0?"< 1s":`${n}s`}return t<60?`${t.toFixed(0)}m`:`${(t/60).toFixed(1)}h`}function ue({label:t,value:n}){return e.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[e.jsx("span",{className:"text-2xs text-text-tertiary uppercase tracking-wider",children:t}),e.jsx("span",{className:"text-xs font-mono font-medium text-text-primary tabular-nums",children:n})]})}function dt({period:t,onChange:n}){return e.jsx("div",{className:"flex items-center gap-1 mb-4",children:qe.map(r=>e.jsx("button",{onClick:()=>n(r),className:`px-2 py-0.5 text-2xs font-mono rounded transition-colors ${t===r?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:r},r))})}function xt({role:t,globalPeriod:n,onClose:r}){const[x,c]=b.useState(ct(n)?n:"24h"),{data:p}=Re(x),a=p==null?void 0:p.stations.find(l=>l.role===t.role),d=t.sla_minutes??void 0,u=t.target_per_hour??void 0,o=t.worker_count??void 0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[e.jsx("span",{className:"text-sm font-bold text-text-primary",children:re(t)}),e.jsx("span",{className:"text-2xs font-mono text-text-secondary",children:t.role})]}),t.description&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-1 line-clamp-2 leading-relaxed",children:t.description})]}),e.jsx("button",{onClick:r,className:"icon-link mt-0.5 shrink-0 ml-2",children:e.jsx(Ue,{className:"w-4 h-4"})})]}),a&&a.priority_count>0&&e.jsxs(A,{to:Ce(t),className:"flex items-center justify-between group mb-4",children:[e.jsxs("span",{className:"text-2xs",style:{color:Y},children:[a.priority_count," in jeopardy — pull oldest first"]}),e.jsx(Ye,{className:"w-3 h-3 transition-colors",style:{color:Y}})]}),e.jsx(dt,{period:x,onChange:c}),(u||d||o)&&e.jsxs("div",{className:"flex items-center gap-6 mb-6 text-2xs border-b border-surface-border/30 pb-5",children:[u&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-mono font-semibold text-text-primary text-sm",children:[u,"/h"]}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"target"})]}),d&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-mono font-semibold text-text-primary text-sm",children:[d,"m"]}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"SLA"})]}),o&&e.jsxs("div",{children:[e.jsx("div",{className:"font-mono font-semibold text-text-primary text-sm",children:o}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"workers"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 mb-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-text-quaternary uppercase tracking-wider mb-2",children:"Wait (queue)"}),e.jsx(ue,{label:"P99",value:xe((a==null?void 0:a.wait.p99)??null)}),e.jsx(ue,{label:"avg",value:xe((a==null?void 0:a.wait.avg)??null)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-text-quaternary uppercase tracking-wider mb-2",children:"Work (proc.)"}),e.jsx(ue,{label:"P99",value:xe((a==null?void 0:a.work.p99)??null)}),e.jsx(ue,{label:"avg",value:xe((a==null?void 0:a.work.avg)??null)})]})]}),d&&e.jsx("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs text-text-tertiary",children:"SLA target"}),e.jsxs("span",{className:"text-xs font-mono text-text-secondary",children:[d,"m"]})]})})]})}function ut({allMetrics:t,orderedRoles:n,period:r}){const x=t.reduce((o,l)=>o+l.pending,0),c=t.reduce((o,l)=>o+l.resolved,0),p=t.reduce((o,l)=>o+l.priority_count,0),a=new Map(t.map(o=>[o.role,o])),d=t.filter(o=>o.priority_count>0).length,u=t.filter(o=>o.pending>0).length;return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-2xs text-text-quaternary uppercase tracking-wider mb-3",children:["Pipeline · ",r]}),e.jsx("div",{className:"mb-4",children:d>0?e.jsxs("p",{className:"text-2xs",style:{color:Y},children:[d," station",d>1?"s":""," with items in jeopardy"]}):u>0?e.jsxs("p",{className:"text-2xs text-status-warning",children:[u," station",u>1?"s":""," with backlog"]}):c>0?e.jsx("p",{className:"text-2xs text-status-success",children:"Flowing — queue clear"}):e.jsx("p",{className:"text-2xs text-text-quaternary",children:"Quiet — awaiting work"})}),e.jsxs("div",{className:"space-y-1.5 mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider",children:"Pending"}),e.jsx("span",{className:`text-xs font-mono tabular-nums ${x>0?"text-text-primary font-semibold":"text-text-quaternary"}`,children:x})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider",children:["Resolved · ",r]}),e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-secondary",children:c})]}),p>0&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider",children:"Priority"}),e.jsx("span",{className:"text-xs font-mono tabular-nums font-semibold",style:{color:Y},children:p})]})]}),e.jsx("div",{className:"border-t border-surface-border/40 pt-2 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider flex-1",children:"Station"}),e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider w-8 text-right shrink-0",children:"pend"}),e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider w-8 text-right shrink-0",children:"clmd"}),e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider w-8 text-right shrink-0",children:"res"})]})}),e.jsx("div",{className:"space-y-0.5",children:n.map(o=>{const l=a.get(o.role),f=(l==null?void 0:l.pending)??0,q=(l==null?void 0:l.claimed)??0,g=(l==null?void 0:l.resolved)??0,M=(l==null?void 0:l.priority_count)??0,w=o.title||o.role,N=M>0,j=f>0;return e.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[e.jsx("span",{className:`text-2xs font-mono flex-1 truncate ${j?"text-text-primary":"text-text-quaternary"}`,title:w,children:w}),e.jsx("span",{className:"text-[0.625rem] leading-none font-semibold tabular-nums w-4 text-right shrink-0",style:{color:Y},title:N?`${M} priority — pull oldest first`:void 0,children:N?M:""}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${j?"text-text-primary font-semibold":"text-text-quaternary"}`,children:f>0?f:"—"}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${q>0?"text-accent font-semibold":"text-text-quaternary"}`,children:q>0?q:"—"}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${g>0?"text-text-secondary":"text-text-quaternary"}`,children:g>0?g:"—"})]},o.role)})}),e.jsx("p",{className:"text-2xs text-text-quaternary mt-5",children:"Select a station for queue detail."})]})}function pt({role:t,allMetrics:n,orderedRoles:r,globalPeriod:x,onClose:c}){return e.jsx("div",{className:"w-[280px] shrink-0 px-7 py-10 flex flex-col overflow-y-auto min-h-0",children:t?e.jsx(xt,{role:t,globalPeriod:x,onClose:c}):e.jsx(ut,{allMetrics:n,orderedRoles:r,period:x})})}const ht=T,ge="rgb(var(--lt-accent))",Ee=G(T,.09),Oe=G(T,.09),Ae=G(ge,.07),Fe=G(U,.08),We=G(W,.08),Te=G(E,.08),mt=["15m","1h","24h","7d","30d"],we={"15m":.25,"1h":1,"24h":24,"7d":168,"30d":720};function ye(t){const n=t.filter(a=>a.ops_visible),r=new Map(n.map(a=>[a.role,a])),x=new Set,p=n.filter(a=>!a.parent_role||!r.has(a.parent_role)).map(a=>{const d=[],u=[{role:a,depth:0}];for(;u.length>0;){const o=u.shift();x.has(o.role.role)||(x.add(o.role.role),d.push(o),n.filter(l=>l.parent_role===o.role.role&&!x.has(l.role)).forEach(l=>u.push({role:l,depth:o.depth+1})))}return{origin:a,stations:d}});return n.filter(a=>!x.has(a.role)).forEach(a=>p.push({origin:a,stations:[{role:a,depth:0}]})),p.sort((a,d)=>d.stations.length-a.stations.length||a.origin.role.localeCompare(d.origin.role))}function $e(t){if(t==null)return"—";if(t<1){const n=Math.round(t*60);return n<=0?"< 1s":`${n}s`}return t<60?`${t.toFixed(0)}m`:`${(t/60).toFixed(1)}h`}function ft(t,n){if(!n||t===0)return{pct:null,color:"bg-surface-border"};const r=t/n,x=Math.round(r*100),c=r>1?"bg-status-warning":r<.2?"bg-status-draft":"bg-status-success";return{pct:x,color:c}}function _e({value:t,onSave:n}){const[r,x]=b.useState(t!=null?String(t):""),c=b.useRef(void 0),p=a=>{const d=parseInt(a,10);n(!a.trim()||isNaN(d)||d<0?null:d)};return e.jsx("input",{type:"number",min:0,step:1,value:r,onChange:a=>{const d=a.target.value;x(d),clearTimeout(c.current),c.current=setTimeout(()=>p(d),400)},onBlur:a=>{clearTimeout(c.current),p(a.target.value)},onClick:a=>a.stopPropagation(),onKeyDown:a=>a.stopPropagation(),className:"w-full bg-transparent text-xs font-mono tabular-nums text-right focus:outline-none"})}function yt({role:t,metric:n,selected:r,periodHours:x,onClick:c}){var $;const p=De(),{isBuilder:a,isOps:d}=Be(),u=(n==null?void 0:n.pending)??0,o=(n==null?void 0:n.claimed)??0,l=(n==null?void 0:n.resolved)??0,f=(n==null?void 0:n.priority_count)??0,q=t.target_per_hour??null,{pct:g,color:M}=ft(u,q),w=g!=null?Math.min(100,g):0,N=bt(t.target_per_hour??null,t.sla_minutes??null,u,x),j=m=>p.mutate({role:t.role,target_per_hour:m}),K=m=>p.mutate({role:t.role,sla_minutes:m});return e.jsxs("tr",{tabIndex:0,onClick:c,onKeyDown:m=>{m.key==="Enter"&&c()},className:`cursor-pointer border-b border-surface-border/30 last:border-b-0 transition-colors ${r?"border-l-2 !border-l-accent":""}`,children:[e.jsx("td",{className:"pl-3 pr-2 py-1.5 overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"font-bold text-text-primary truncate text-xs",children:re(t)}),((($=t.upstream_roles)==null?void 0:$.length)??0)>0&&e.jsx("span",{title:`Fed by ${t.upstream_roles.join(", ")}`,className:"shrink-0 leading-none",children:e.jsx(Ve,{className:"w-3 h-3 text-text-quaternary"})})]})}),e.jsx("td",{className:"hidden xl:table-cell pr-2 py-1.5 overflow-hidden",children:e.jsx("span",{className:"block font-mono text-2xs text-text-tertiary truncate",children:t.role})}),e.jsx("td",{className:"px-2 py-1.5",style:{backgroundColor:Ee},children:e.jsx(_e,{value:t.target_per_hour??null,onSave:j})}),e.jsx("td",{className:"px-2 py-1.5",style:{backgroundColor:Oe},children:e.jsx(_e,{value:t.sla_minutes??null,onSave:K})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:Ae},title:N!=null?`~${N} concurrent worker${N===1?"":"s"} to sustain ${t.target_per_hour}/h within ${t.sla_minutes}m SLA`:void 0,children:e.jsx("span",{className:`text-xs font-mono tabular-nums ${N!=null?"":"text-text-quaternary"}`,style:N!=null?{color:ge}:void 0,children:N??"—"})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:Fe},children:e.jsx(A,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=available`,className:`text-xs font-mono tabular-nums hover:underline ${u>0?"text-text-primary font-semibold":"text-text-quaternary"}`,onClick:m=>m.stopPropagation(),children:u})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:We},children:e.jsx(A,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=claimed`,className:`text-xs font-mono tabular-nums hover:underline ${o>0?"font-semibold":"text-text-quaternary"}`,style:o>0?{color:W}:void 0,onClick:m=>m.stopPropagation(),children:o})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:Te},children:e.jsx(A,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=resolved`,className:`text-xs font-mono tabular-nums hover:underline ${l>0?"text-text-secondary":"text-text-quaternary"}`,style:l>0?{color:E}:void 0,onClick:m=>m.stopPropagation(),children:l})}),e.jsx("td",{className:"hidden xl:table-cell px-2 py-1.5 text-right",children:e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-secondary",children:$e((n==null?void 0:n.wait.p99)??null)})}),e.jsx("td",{className:"hidden xl:table-cell px-2 py-1.5 text-right",children:e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-secondary",children:$e((n==null?void 0:n.work.p99)??null)})}),e.jsx("td",{className:"hidden lg:table-cell px-2 py-1.5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-12 h-1.5 bg-surface-sunken rounded-full overflow-hidden shrink-0",children:e.jsx("div",{className:`h-full rounded-full ${M}`,style:{width:`${w}%`}})}),e.jsx("span",{className:`text-2xs font-mono tabular-nums ${g!=null&&g>100?"text-status-warning font-semibold":"text-text-quaternary"}`,children:g!=null?`${g}%`:"—"})]})}),e.jsx("td",{className:"py-1.5",children:e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[e.jsx(A,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=all`,className:"icon-link",title:"View all items in queue",onClick:m=>m.stopPropagation(),children:e.jsx(Qe,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"w-3.5 flex items-center justify-center",children:(a||d)&&e.jsx(A,{to:`/admin/roles/${encodeURIComponent(t.role)}`,className:"icon-link",title:"Configure this role",onClick:m=>m.stopPropagation(),children:e.jsx(Xe,{className:"w-3.5 h-3.5"})})}),e.jsx("span",{className:"w-3.5 flex items-center justify-center",children:f>0&&e.jsx(A,{to:Ce(t),className:"text-status-error hover:opacity-70 transition-opacity",title:`${f} item${f===1?"":"s"} in jeopardy — pull oldest first`,onClick:m=>m.stopPropagation(),children:e.jsx(Le,{className:"w-3.5 h-3.5",strokeWidth:2})})})]})})]})}function Se({n:t}){return t<=0?null:e.jsxs("span",{className:"inline-flex items-center gap-0.5 font-semibold tabular-nums",style:{color:Y},title:`${t} in jeopardy`,children:[e.jsx(Le,{className:"w-3 h-3",strokeWidth:2.25}),t>9?"9+":t]})}function gt({fragments:t,aggregates:n,activeOrigin:r,onSelect:x}){const[c,p]=b.useState(!1),a=b.useRef(null);b.useEffect(()=>{if(!c)return;const o=f=>{a.current&&!a.current.contains(f.target)&&p(!1)},l=f=>{f.key==="Escape"&&p(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",l)}},[c]);const d=t.find(o=>o.origin.role===r)??t[0];if(!d)return null;const u=n.get(d.origin.role);return e.jsxs("div",{ref:a,className:"relative px-4 pt-2",children:[e.jsxs("button",{type:"button",onClick:()=>p(o=>!o),className:"group flex items-baseline gap-2.5","aria-expanded":c,"aria-haspopup":"listbox",children:[e.jsx("span",{className:"text-sm font-medium text-text-primary group-hover:text-accent transition-colors",children:re(d.origin)}),e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary tabular-nums",children:[(u==null?void 0:u.stations)??d.stations.length," station",((u==null?void 0:u.stations)??d.stations.length)===1?"":"s"," · ",(u==null?void 0:u.pending)??0," pending"]}),e.jsx(Se,{n:(u==null?void 0:u.jeopardy)??0}),e.jsx(Ke,{className:`w-3.5 h-3.5 self-center shrink-0 text-text-tertiary group-hover:text-accent transition-transform ${c?"rotate-180":""}`,strokeWidth:1.5})]}),c&&e.jsx("div",{role:"listbox",className:"absolute z-[100] top-full left-4 mt-1.5 min-w-[20rem] max-h-80 overflow-y-auto bg-surface-raised border border-surface-border rounded-md shadow-lg py-1",children:t.map(o=>{const l=n.get(o.origin.role),f=o.origin.role===d.origin.role;return e.jsxs("button",{type:"button",role:"option","aria-selected":f,onClick:()=>{x(o.origin.role),p(!1)},className:`w-full text-left px-3 py-1.5 flex items-baseline gap-2.5 transition-colors ${f?"text-accent bg-accent/5":"text-text-primary hover:bg-surface-hover"}`,children:[e.jsx("span",{className:"text-xs font-medium truncate",children:re(o.origin)}),e.jsxs("span",{className:"ml-auto text-2xs font-mono text-text-quaternary tabular-nums shrink-0",children:[(l==null?void 0:l.stations)??o.stations.length," st · ",(l==null?void 0:l.pending)??0," pending"]}),e.jsx("span",{className:"w-12 shrink-0 text-left text-2xs",children:e.jsx(Se,{n:(l==null?void 0:l.jeopardy)??0})})]},o.origin.role)})})]})}const jt=[{label:"TARGET/H",band:Ee,hue:T,w:"w-[8%]"},{label:"SLA/M",band:Oe,hue:ht,w:"w-[7%]"},{label:"WORKERS",band:Ae,hue:ge,w:"w-[8%]"},{label:"PENDING",band:Fe,hue:U,w:"w-[8%]"},{label:"CLAIMED",band:We,hue:W,w:"w-[8%]"},{label:"RESOLVED",band:Te,hue:E,w:"w-[8%]"}];function bt(t,n,r,x){if(!t||!n)return null;const c=t*n/60,p=r>0?r*n/(60*x):0;return Math.ceil(c+p)}const I="sticky top-0 z-10 bg-surface border-b border-surface-border py-1.5 text-2xs font-semibold uppercase tracking-wider whitespace-nowrap";function Nt(){return e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:`${I} pl-3 pr-2 text-left text-text-quaternary`,children:"NAME"}),e.jsx("th",{className:`${I} hidden xl:table-cell w-[12%] pr-2 text-left text-text-quaternary`,children:"ROLE"}),jt.map(t=>e.jsx("th",{className:`${I} ${t.w} px-2 text-right`,style:{color:t.hue,backgroundImage:`linear-gradient(${t.band}, ${t.band})`},children:t.label},t.label)),e.jsx("th",{className:`${I} hidden xl:table-cell w-[8%] px-2 text-right text-text-quaternary`,children:"P99 WAIT"}),e.jsx("th",{className:`${I} hidden xl:table-cell w-[8%] px-2 text-right text-text-quaternary`,children:"P99 WORK"}),e.jsx("th",{className:`${I} hidden lg:table-cell w-[11%] px-2 text-left text-text-quaternary`,children:"TREND"}),e.jsx("th",{className:`${I} w-20 px-1 text-center text-text-quaternary`,children:"ACTIONS"})]})})}function vt(){var ee;const[t,n]=b.useState("1h"),[r,x]=b.useState(null),[c,p]=b.useState(!1),[a,d]=b.useState(!0);ze();const{data:u,isLoading:o,refetch:l}=Ie(),{data:f,isLoading:q,refetch:g}=Re(t),M=(u==null?void 0:u.roles)??[],w=(f==null?void 0:f.stations)??[],N=b.useMemo(()=>{const i=new Map(w.map(_=>[_.role,_])),v=new Map;for(const _ of ye((u==null?void 0:u.roles)??[])){let z=0,s=0;for(const h of _.stations){const y=i.get(h.role.role);z+=(y==null?void 0:y.pending)??0,s+=(y==null?void 0:y.priority_count)??0}v.set(_.origin.role,{stations:_.stations.length,pending:z,jeopardy:s})}return v},[w,u]),j=b.useMemo(()=>ye(M),[M]),[K,$]=Ze(),m=K.get("fragment"),R=j.find(i=>i.origin.role===m)??j[0]??null,P=b.useCallback(i=>{x(null),$(v=>{const _=new URLSearchParams(v);return _.set("fragment",i),_})},[$]),S=(R==null?void 0:R.stations)??[],V=b.useMemo(()=>new Set(S.map(({role:i})=>i.role)),[S]),Q=b.useMemo(()=>w.filter(i=>V.has(i.role)),[w,V]),X=b.useMemo(()=>S.map(({role:i})=>({role:i.role,title:i.title,parent_role:i.parent_role,target_per_hour:i.target_per_hour??null,upstream_roles:i.upstream_roles??[],metric:w.find(v=>v.role===i.role)})),[S,w]),oe=b.useCallback(i=>{const v=j.find(_=>_.stations.some(({role:z})=>z.role===i));v&&P(v.origin.role)},[j,P]),D=Je(),le=((ee=S.find(({role:i})=>i.role===r))==null?void 0:ee.role)??null,B=o||q,ie=async()=>{p(!0),await Promise.all([l(),g()]),p(!1)},Z=i=>x(v=>v===i?null:i),J=e.jsx("div",{className:"flex items-center gap-0.5",children:mt.map(i=>e.jsx("button",{onClick:()=>n(i),className:`px-2.5 py-1 text-2xs font-mono rounded transition-colors ${t===i?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:i},i))});return e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx(He,{title:"Pace Board",docsHash:"#docs:dashboard.md:pace-board",center:J,actions:e.jsx("button",{onClick:ie,disabled:c,className:"icon-link disabled:opacity-40",children:e.jsx(Ge,{className:`w-3.5 h-3.5 ${c?"animate-spin":""}`})})}),B?e.jsxs("div",{className:"animate-pulse space-y-6 mt-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-64 bg-surface-sunken rounded w-full"}),e.jsx("div",{className:"space-y-3",children:[1,2,3].map(i=>e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-full"},i))})]}):j.length===0?e.jsxs("div",{className:"mt-8",children:[e.jsx("p",{className:"text-sm text-text-secondary mb-2",children:"Stations appear here once roles are marked visible in Operations."}),e.jsxs("p",{className:"text-xs text-text-tertiary",children:["Go to"," ",e.jsx(A,{to:"/admin/roles",className:"text-accent hover:underline",children:"Roles"})," ","and enable ",e.jsx("strong",{children:"Visible in Operations"})," on roles that represent pipeline stations."]})]}):e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("div",{className:"flex-1",children:j.length>1&&e.jsx(gt,{fragments:j,aggregates:N,activeOrigin:(R==null?void 0:R.origin.role)??null,onSelect:P})}),e.jsx("div",{className:"flex items-center gap-0.5 px-4 pt-2 pb-0.5",children:["lin","log"].map(i=>e.jsx("button",{onClick:()=>d(i==="log"),className:`px-2 py-0.5 text-2xs font-mono rounded transition-colors ${(a?"log":"lin")===i?"text-accent font-semibold":"icon-link"}`,title:i==="lin"?"Linear Y axis":"Logarithmic Y axis — reveals shape across wide value ranges",children:i},i))})]}),e.jsxs("div",{className:"flex-1 min-h-[40vh] flex items-stretch overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-w-0 min-h-0 flex flex-col justify-center overflow-hidden px-2 py-4",children:e.jsx(it,{stations:X,selectedRole:r,onSelect:Z,onUpstreamSelect:oe,onCmdClick:i=>D(`/escalations/available?role=${encodeURIComponent(i)}`),periodHours:we[t],logScale:a})}),e.jsx("div",{className:"w-px bg-surface-border shrink-0 self-stretch"}),e.jsx(pt,{role:le,allMetrics:Q,orderedRoles:S.map(i=>i.role),globalPeriod:t,onClose:()=>x(null)})]}),e.jsx("div",{className:"max-h-[30vh] flex-none overflow-y-auto border-t border-surface-border",children:e.jsxs("table",{className:"w-full table-fixed",children:[e.jsx(Nt,{}),e.jsx("tbody",{children:S.map(({role:i})=>e.jsx(yt,{role:i,metric:w.find(v=>v.role===i.role),selected:r===i.role,periodHours:we[t],onClick:()=>Z(i.role)},i.role))})]})})]})]})}const Lt=Object.freeze(Object.defineProperty({__proto__:null,OperationsPage:vt,buildFragments:ye},Symbol.toStringTag,{value:"Module"}));export{Lt as O,it as P,ye as b,Ce as j};
|
|
2
|
+
//# sourceMappingURL=OperationsPage-DvWrLuH6.js.map
|