@hotmeshio/long-tail 0.11.0 → 0.11.1
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/routes/mcp-endpoint.js +4 -1
- package/build/services/escalation/aggregate-validate.js +6 -0
- package/build/services/escalation/facet-sql.js +10 -0
- package/build/services/mcp/external-server.js +34 -26
- package/build/system/index.js +17 -0
- package/build/system/mcp-servers/admin/index.js +2 -4
- package/build/system/seed/tool-manifests-admin.d.ts +0 -1137
- package/build/system/seed/tool-manifests-admin.js +0 -5
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/facets.d.ts +8 -0
- package/dashboard/dist/assets/{AdminDashboard-DJ3LJQ09.js → AdminDashboard-D4ebrcNR.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-DJ3LJQ09.js.map → AdminDashboard-D4ebrcNR.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-BMMvaD0z.js → AgentConfigPage-DP4KUuCX.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-BMMvaD0z.js.map → AgentConfigPage-DP4KUuCX.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-C6wfsnRe.js → AgentDetailPage-ktYiR1kq.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-C6wfsnRe.js.map → AgentDetailPage-ktYiR1kq.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-Cwqka7nE.js → AgentsPage-B4iqm4-h.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-Cwqka7nE.js.map → AgentsPage-B4iqm4-h.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-tL3mM1RG.js +2 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-tL3mM1RG.js.map +1 -0
- package/dashboard/dist/assets/{BotPicker-BBkJBXZB.js → BotPicker-CLrJuHnW.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-BBkJBXZB.js.map → BotPicker-CLrJuHnW.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-DG5V0tMT.js +2 -0
- package/dashboard/dist/assets/CapabilitiesPage-DG5V0tMT.js.map +1 -0
- package/dashboard/dist/assets/{CollapsibleSection-B3FsrHwH.js → CollapsibleSection-CvLHvVfU.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-B3FsrHwH.js.map → CollapsibleSection-CvLHvVfU.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-B3nCqJdC.js → CountdownTimer-Co57-iLY.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-B3nCqJdC.js.map → CountdownTimer-Co57-iLY.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-Bv875IHe.js → CredentialsPage-qCJZ3rdi.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-Bv875IHe.js.map → CredentialsPage-qCJZ3rdi.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-CSzjWuwj.js → CronLabel-C3iKifDN.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-CSzjWuwj.js.map → CronLabel-C3iKifDN.js.map} +1 -1
- package/dashboard/dist/assets/{CustomDurationPicker-CCpqf3e4.js → CustomDurationPicker-C-Szl4rU.js} +2 -2
- package/dashboard/dist/assets/{CustomDurationPicker-CCpqf3e4.js.map → CustomDurationPicker-C-Szl4rU.js.map} +1 -1
- package/dashboard/dist/assets/{DropZone-CJkk-U3o.js → DropZone-BWD9aGOz.js} +2 -2
- package/dashboard/dist/assets/{DropZone-CJkk-U3o.js.map → DropZone-BWD9aGOz.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-WV6pUaKo.js → ElapsedCell-CamZk5o1.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-WV6pUaKo.js.map → ElapsedCell-CamZk5o1.js.map} +1 -1
- package/dashboard/dist/assets/EntityTimelinePanel-CABCW2dS.js +2 -0
- package/dashboard/dist/assets/EntityTimelinePanel-CABCW2dS.js.map +1 -0
- package/dashboard/dist/assets/{EscalationListSchemaPage-CTQCALw4.js → EscalationListSchemaPage-BddDSfjl.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-CTQCALw4.js.map → EscalationListSchemaPage-BddDSfjl.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-D_UgP0pv.js → EscalationSchemaPage-BRyCtw9R.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-D_UgP0pv.js.map → EscalationSchemaPage-BRyCtw9R.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DuIUyxr0.js → EscalationsOverview-DUWYxJyD.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DuIUyxr0.js.map → EscalationsOverview-DUWYxJyD.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-BV6unphX.js → EventTable-CtVuCgq6.js} +2 -2
- package/dashboard/dist/assets/{EventTable-BV6unphX.js.map → EventTable-CtVuCgq6.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-DYFgzXNB.js → FilterBar-BYsBgOiE.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-DYFgzXNB.js.map → FilterBar-BYsBgOiE.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-BGHVUipJ.js → GraphInvokePage-CA4skPN2.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-BGHVUipJ.js.map → GraphInvokePage-CA4skPN2.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-B-S2cK3E.js → HomePage-DwG-AnjQ.js} +2 -2
- package/dashboard/dist/assets/{HomePage-B-S2cK3E.js.map → HomePage-DwG-AnjQ.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-Bl7F3A28.js → ListToolbar-D86IN_hQ.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-Bl7F3A28.js.map → ListToolbar-D86IN_hQ.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-_T9IsCD_.js → McpOverview-CoEHGseD.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-_T9IsCD_.js.map → McpOverview-CoEHGseD.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-DtsVqKPw.js → McpQueryDetailPage-C9hMgJe1.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-DtsVqKPw.js.map → McpQueryDetailPage-C9hMgJe1.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-DX5u-1bx.js → McpQueryPage-B20Zn4QX.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-DX5u-1bx.js.map → McpQueryPage-B20Zn4QX.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-BhcqqtYS.js → McpRunDetailPage-DDKHf-3R.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-BhcqqtYS.js.map → McpRunDetailPage-DDKHf-3R.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-L-1y8wnX.js → McpRunsPage-Puyn3iJr.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-L-1y8wnX.js.map → McpRunsPage-Puyn3iJr.js.map} +1 -1
- package/dashboard/dist/assets/{NamespacePill-in1SLd0W.js → NamespacePill-C09QuOEz.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-in1SLd0W.js.map → NamespacePill-C09QuOEz.js.map} +1 -1
- package/dashboard/dist/assets/OperationsPage-Bsrt4XTL.js +3 -0
- package/dashboard/dist/assets/OperationsPage-Bsrt4XTL.js.map +1 -0
- package/dashboard/dist/assets/{OperatorDashboard-CIbDzOlh.js → OperatorDashboard-CXBbFLAL.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-CIbDzOlh.js.map → OperatorDashboard-CXBbFLAL.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-BJgWMZtw.js → PageHeader-B7YJxa4o.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-BJgWMZtw.js.map → PageHeader-B7YJxa4o.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-Ccio4vyG.js → PageHeaderWithStats-gT-5ovJh.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-Ccio4vyG.js.map → PageHeaderWithStats-gT-5ovJh.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-BOaf0TW1.js → PersonaDetailPage-BN5xNDDX.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-BOaf0TW1.js.map → PersonaDetailPage-BN5xNDDX.js.map} +1 -1
- package/dashboard/dist/assets/PersonasPage-Bdtv6HPZ.js +2 -0
- package/dashboard/dist/assets/PersonasPage-Bdtv6HPZ.js.map +1 -0
- package/dashboard/dist/assets/{ProcessDetailPage-DN9NqfeP.js → ProcessDetailPage-BMg70ZAJ.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-DN9NqfeP.js.map → ProcessDetailPage-BMg70ZAJ.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-CfQEWaD4.js → ProcessesListPage-_KvdxGhL.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-CfQEWaD4.js.map → ProcessesListPage-_KvdxGhL.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-BC5HL7ls.js → RoleDetailPage-BM5BXc7j.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-BC5HL7ls.js.map → RoleDetailPage-BM5BXc7j.js.map} +1 -1
- package/dashboard/dist/assets/{RolePill-BNAP-uK6.js → RolePill-CtYI1_k1.js} +2 -2
- package/dashboard/dist/assets/{RolePill-BNAP-uK6.js.map → RolePill-CtYI1_k1.js.map} +1 -1
- package/dashboard/dist/assets/RolesPage-Bv23VmUi.js +2 -0
- package/dashboard/dist/assets/RolesPage-Bv23VmUi.js.map +1 -0
- package/dashboard/dist/assets/{RunAsSelector-twbuX7fB.js → RunAsSelector-D-Sjr7uB.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-twbuX7fB.js.map → RunAsSelector-D-Sjr7uB.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-CPNg6K--.js → ScanCodesPage-s3OEMJno.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-CPNg6K--.js.map → ScanCodesPage-s3OEMJno.js.map} +1 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-D8WQkZmw.js +2 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-D8WQkZmw.js.map +1 -0
- package/dashboard/dist/assets/ScanStationPage-CkRQaH5G.js +2 -0
- package/dashboard/dist/assets/ScanStationPage-CkRQaH5G.js.map +1 -0
- package/dashboard/dist/assets/{ScopeBadge-BG7KkZ8Q.js → ScopeBadge-B76rOtA0.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-BG7KkZ8Q.js.map → ScopeBadge-B76rOtA0.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-DIeYMPPd.js → StickyPagination-BpTIMOL5.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-DIeYMPPd.js.map → StickyPagination-BpTIMOL5.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-gU4CUeQI.js → StreamMessageDetail-ChoWrZzO.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-gU4CUeQI.js.map → StreamMessageDetail-ChoWrZzO.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-Br-nBA4l.js → SwimlaneTimeline-nmIqEuEH.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-Br-nBA4l.js.map → SwimlaneTimeline-nmIqEuEH.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-CvM5n6ww.js → TagInput-BQAPOp17.js} +2 -2
- package/dashboard/dist/assets/{TagInput-CvM5n6ww.js.map → TagInput-BQAPOp17.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-_9cr_R0u.js → TaskDetailPage-KajZD2Cp.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-_9cr_R0u.js.map → TaskDetailPage-KajZD2Cp.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-D4JPHXOq.js → TaskQueuePill-C2NImrwl.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-D4JPHXOq.js.map → TaskQueuePill-C2NImrwl.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-DVENC9Jp.js → TasksListPage-CiqSfapP.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-DVENC9Jp.js.map → TasksListPage-CiqSfapP.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-C9yYnOui.js → TimeAgo-ClauexJj.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-C9yYnOui.js.map → TimeAgo-ClauexJj.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-DoB8cYgw.js → TimestampCell-CXmbCnAJ.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-DoB8cYgw.js.map → TimestampCell-CXmbCnAJ.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-BUjbC-Tj.js → ToolPill-FOZm67TS.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-BUjbC-Tj.js.map → ToolPill-FOZm67TS.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-CBtsIP8K.js → ToolTestPanel-DFUU0zGv.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-CBtsIP8K.js.map → ToolTestPanel-DFUU0zGv.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-mR4Jaz83.js → TopicDetailPage-DuN5BrsI.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-mR4Jaz83.js.map → TopicDetailPage-DuN5BrsI.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-CP7HFxIC.js → TopicsPage-DZ1NQdYG.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-CP7HFxIC.js.map → TopicsPage-DZ1NQdYG.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-BnLF6yhz.js → UserName-BPHG_MQs.js} +2 -2
- package/dashboard/dist/assets/{UserName-BnLF6yhz.js.map → UserName-BPHG_MQs.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-xL956RZi.js → WorkflowExecutionPage-D_Z-tIjR.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-xL956RZi.js.map → WorkflowExecutionPage-D_Z-tIjR.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-tXU0-eXu.js → WorkflowPill-C5TEWlfO.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill-tXU0-eXu.js.map → WorkflowPill-C5TEWlfO.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-B-u7zFKM.js → WorkflowsDashboard-VMBW1WuR.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-B-u7zFKM.js.map → WorkflowsDashboard-VMBW1WuR.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-CqZVarK-.js → WorkflowsOverview-CUOXXcpg.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-CqZVarK-.js.map → WorkflowsOverview-CUOXXcpg.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DiFLavW0.js → YamlWorkflowDetailPage-CsfzbboC.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DiFLavW0.js.map → YamlWorkflowDetailPage-CsfzbboC.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-BuQM6uZA.js → YamlWorkflowsPage-BpgKLSGT.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-BuQM6uZA.js.map → YamlWorkflowsPage-BpgKLSGT.js.map} +1 -1
- package/dashboard/dist/assets/{agents-DU9GPovp.js → agents-Cg2FVYQP.js} +2 -2
- package/dashboard/dist/assets/{agents-DU9GPovp.js.map → agents-Cg2FVYQP.js.map} +1 -1
- package/dashboard/dist/assets/{bots-Cy-Hmg7w.js → bots-vtVLRKGt.js} +2 -2
- package/dashboard/dist/assets/{bots-Cy-Hmg7w.js.map → bots-vtVLRKGt.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-sSJJqrp-.js → capabilities-DLsXhwlD.js} +2 -2
- package/dashboard/dist/assets/{capabilities-sSJJqrp-.js.map → capabilities-DLsXhwlD.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-TVCjDHQ-.js → controlplane-Js7dxpX4.js} +2 -2
- package/dashboard/dist/assets/{controlplane-TVCjDHQ-.js.map → controlplane-Js7dxpX4.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-BpkjKYGd.js → escalation-columns-h0NLAJss.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-BpkjKYGd.js.map → escalation-columns-h0NLAJss.js.map} +1 -1
- package/dashboard/dist/assets/{index-DOai950R.js → index-7c7FEe5S.js} +2 -2
- package/dashboard/dist/assets/{index-DOai950R.js.map → index-7c7FEe5S.js.map} +1 -1
- package/dashboard/dist/assets/{index-7BP6FaCZ.js → index-BTzhV9ST.js} +2 -2
- package/dashboard/dist/assets/{index-7BP6FaCZ.js.map → index-BTzhV9ST.js.map} +1 -1
- package/dashboard/dist/assets/{index-fgBDhnI6.js → index-Bcv5k8Dw.js} +2 -2
- package/dashboard/dist/assets/{index-fgBDhnI6.js.map → index-Bcv5k8Dw.js.map} +1 -1
- package/dashboard/dist/assets/{index-BE0phFw0.js → index-BjfoWzJL.js} +2 -2
- package/dashboard/dist/assets/{index-BE0phFw0.js.map → index-BjfoWzJL.js.map} +1 -1
- package/dashboard/dist/assets/{index-BYNN9N1T.js → index-BvVJ538E.js} +2 -2
- package/dashboard/dist/assets/{index-BYNN9N1T.js.map → index-BvVJ538E.js.map} +1 -1
- package/dashboard/dist/assets/{index-Cfv86_L9.js → index-CSpTj5DB.js} +2 -2
- package/dashboard/dist/assets/{index-Cfv86_L9.js.map → index-CSpTj5DB.js.map} +1 -1
- package/dashboard/dist/assets/{index-errgQT5x.js → index-CcjdA7jA.js} +23 -23
- package/dashboard/dist/assets/index-CcjdA7jA.js.map +1 -0
- package/dashboard/dist/assets/{index-CLPVqbVY.js → index-DQi6CjqF.js} +2 -2
- package/dashboard/dist/assets/{index-CLPVqbVY.js.map → index-DQi6CjqF.js.map} +1 -1
- package/dashboard/dist/assets/index-DglcqBHn.js +6 -0
- package/dashboard/dist/assets/index-DglcqBHn.js.map +1 -0
- package/dashboard/dist/assets/{index-Dy-MMYti.js → index-DlO3bCfu.js} +2 -2
- package/dashboard/dist/assets/{index-Dy-MMYti.js.map → index-DlO3bCfu.js.map} +1 -1
- package/dashboard/dist/assets/{index-CtwbQ_-m.js → index-FYQ9yPhO.js} +2 -2
- package/dashboard/dist/assets/{index-CtwbQ_-m.js.map → index-FYQ9yPhO.js.map} +1 -1
- package/dashboard/dist/assets/{index-DTtHNC-D.js → index-KcaVfpWn.js} +2 -2
- package/dashboard/dist/assets/{index-DTtHNC-D.js.map → index-KcaVfpWn.js.map} +1 -1
- package/dashboard/dist/assets/index-cFHoANSG.css +1 -0
- package/dashboard/dist/assets/{index-DsWnVyVN.js → index-vAkZ5dZe.js} +2 -2
- package/dashboard/dist/assets/{index-DsWnVyVN.js.map → index-vAkZ5dZe.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-arh4NfmL.js → knowledge-Bkvl3cIz.js} +2 -2
- package/dashboard/dist/assets/{knowledge-arh4NfmL.js.map → knowledge-Bkvl3cIz.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-QGf5jHCo.js → mcp-DEtDLeIQ.js} +2 -2
- package/dashboard/dist/assets/{mcp-QGf5jHCo.js.map → mcp-DEtDLeIQ.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-BEJN1nMZ.js → mcp-query-BCRgnt0K.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-BEJN1nMZ.js.map → mcp-query-BCRgnt0K.js.map} +1 -1
- package/dashboard/dist/assets/{personas-DYtw1COf.js → personas-CABKq-0L.js} +2 -2
- package/dashboard/dist/assets/{personas-DYtw1COf.js.map → personas-CABKq-0L.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-Byi6PnbE.js → pipelines-fuN8dVNl.js} +2 -2
- package/dashboard/dist/assets/{pipelines-Byi6PnbE.js.map → pipelines-fuN8dVNl.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-D0SQdENz.js → tasks-u3YPNJBo.js} +2 -2
- package/dashboard/dist/assets/{tasks-D0SQdENz.js.map → tasks-u3YPNJBo.js.map} +1 -1
- package/dashboard/dist/assets/{topics-DgDv5ZXP.js → topics-D37_RAIT.js} +2 -2
- package/dashboard/dist/assets/{topics-DgDv5ZXP.js.map → topics-D37_RAIT.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-DZaYzE7s.js → useEventHooks-BbXfrFbq.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-DZaYzE7s.js.map → useEventHooks-BbXfrFbq.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-C1OqiNXN.js → useNamespace-DvuoFTda.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-C1OqiNXN.js.map → useNamespace-DvuoFTda.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-CkmXDm-Z.js → useYamlActivityEvents-CL-Uf2cb.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-CkmXDm-Z.js.map → useYamlActivityEvents-CL-Uf2cb.js.map} +1 -1
- package/dashboard/dist/assets/{users-D4DCFPH1.js → users-CMxw_HzK.js} +2 -2
- package/dashboard/dist/assets/{users-D4DCFPH1.js.map → users-CMxw_HzK.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-BxuyFxH2.js → vendor-icons-Aw7bzBxa.js} +142 -137
- package/dashboard/dist/assets/vendor-icons-Aw7bzBxa.js.map +1 -0
- package/dashboard/dist/assets/{workflows-qyc0ku_5.js → workflows-Bez-o6fu.js} +2 -2
- package/dashboard/dist/assets/{workflows-qyc0ku_5.js.map → workflows-Bez-o6fu.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-DWFww9Xn.js → yaml-workflows-NrXcLsNm.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-DWFww9Xn.js.map → yaml-workflows-NrXcLsNm.js.map} +1 -1
- package/dashboard/dist/index.html +3 -3
- package/package.json +1 -1
- package/build/system/mcp-servers/admin/ortho.d.ts +0 -10
- package/build/system/mcp-servers/admin/ortho.js +0 -242
- package/dashboard/dist/assets/AvailableEscalationsPage-CVlG_AVC.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-CVlG_AVC.js.map +0 -1
- package/dashboard/dist/assets/CapabilitiesPage-wxmE4917.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-wxmE4917.js.map +0 -1
- package/dashboard/dist/assets/EntityTimelinePanel-DrL86Yrf.js +0 -2
- package/dashboard/dist/assets/EntityTimelinePanel-DrL86Yrf.js.map +0 -1
- package/dashboard/dist/assets/OperationsPage-i8KcDpKo.js +0 -3
- package/dashboard/dist/assets/OperationsPage-i8KcDpKo.js.map +0 -1
- package/dashboard/dist/assets/PersonasPage-DSdRb90f.js +0 -2
- package/dashboard/dist/assets/PersonasPage-DSdRb90f.js.map +0 -1
- package/dashboard/dist/assets/RolesPage-DCnW0VmD.js +0 -2
- package/dashboard/dist/assets/RolesPage-DCnW0VmD.js.map +0 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-DyLmCamO.js +0 -2
- package/dashboard/dist/assets/ScanSchemeDetailPage-DyLmCamO.js.map +0 -1
- package/dashboard/dist/assets/ScanStationPage-DoZccU5B.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-DoZccU5B.js.map +0 -1
- package/dashboard/dist/assets/index-5TblaCXQ.css +0 -1
- package/dashboard/dist/assets/index-B7IaBPBg.js +0 -6
- package/dashboard/dist/assets/index-B7IaBPBg.js.map +0 -1
- package/dashboard/dist/assets/index-errgQT5x.js.map +0 -1
- package/dashboard/dist/assets/vendor-icons-BxuyFxH2.js.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as h,j as e}from"./vendor-query-RUZdMvN6.js";import{Q as te,V as tt,K as we,o as kt,ax as st,H as $t,aa as St,x as qt}from"./index-CcjdA7jA.js";import{j as Mt,i as Ct}from"./useEventHooks-BbXfrFbq.js";import{s as Le,a as he,u as B,b as Ue,E as Te,c as nt,i as Ee,d as at}from"./EntityTimelinePanel-CABCW2dS.js";import{ap as _t,aX as Rt,as as rt,C as Pt,s as ze,ax as Lt,b as Et,X as Ot,aw as At,aS as Bt,aY as Ft,E as It,a0 as Tt,an as ot}from"./vendor-icons-Aw7bzBxa.js";import{P as Wt}from"./PageHeader-B7YJxa4o.js";import{f as lt,L as le,u as Dt}from"./vendor-react-CdqEC2zv.js";function Ut({groups:t,colors:s}){const r=h.useMemo(()=>{const a=(t??[]).filter(n=>(n.dwellSeconds??0)>0),c=a.reduce((n,o)=>n+(o.dwellSeconds??0),0);return c?a.map(n=>({key:he(n.subtype),label:Le(n.subtype),seconds:n.dwellSeconds??0,pct:(n.dwellSeconds??0)/c})).sort((n,o)=>o.seconds-n.seconds):null},[t]);if(!r)return e.jsx("span",{className:"text-2xs text-text-quaternary",children:"—"});const i=r.map(a=>`${a.label} ${te(a.seconds*1e3)} · ${Math.round(a.pct*100)}%`).join(`
|
|
2
|
+
`);return e.jsxs("div",{className:"flex items-center gap-1.5",title:i,children:[e.jsx("div",{className:"w-16 h-1.5 bg-surface-sunken rounded-full overflow-hidden flex shrink-0",children:r.map(a=>e.jsx("div",{style:{width:`${a.pct*100}%`,backgroundColor:s.get(a.key)}},a.key))}),e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary tabular-nums",children:[Math.round(r[0].pct*100),"%"]})]})}function Oe(t){return t.reduce((s,r)=>s+(r.dwellSeconds??0),0)||1}function it(t,s){const r=[];for(const i of t){const a=i.facets[s];a==null||(i.dwellSeconds??0)<=0||r.push(a)}return r}function ct(t,s,r,i){const a=new Map;for(const o of s){const d=o.facets[i];if(d==null||(o.dwellSeconds??0)<=0)continue;const x=a.get(d)??[];x.push(o),a.set(d,x)}const c=new Map;for(const o of r){const d=o.facets[i];d==null||(o.count??0)<=0||o.state==null||c.has(d)||c.set(d,o.state)}const n=[];for(const o of t){const d=o.facets[i];if(d==null||(o.dwellSeconds??0)<=0)continue;const x=[...a.get(d)??[]].sort((p,w)=>(w.dwellSeconds??0)-(p.dwellSeconds??0));n.push({value:d,groups:x,total:o.dwellSeconds??0,nowState:c.get(d)??null})}return n}function zt(t,s,r=12){const i=new Map;for(const a of t){if((a.dwellSeconds??0)<=0)continue;const c=a.facets[s]??"no value",n=i.get(c)??[];n.push(a),i.set(c,n)}return[...i.entries()].map(([a,c])=>({value:a,groups:[...c].sort((n,o)=>(o.dwellSeconds??0)-(n.dwellSeconds??0)),total:Oe(c)})).sort((a,c)=>c.total-a.total).slice(0,r)}function Ae({groups:t,colors:s,height:r,className:i=""}){const a=Oe(t),c=new Map([...s.keys()].map((o,d)=>[o,d])),n=[...t].sort((o,d)=>(c.get(o.state??"—")??1/0)-(c.get(d.state??"—")??1/0));return e.jsx("div",{className:`${r} flex rounded-full overflow-hidden bg-surface-sunken ${i}`,children:n.map(o=>e.jsx("div",{title:`${o.state??"—"} · ${te((o.dwellSeconds??0)*1e3)}`,style:{width:`${(o.dwellSeconds??0)/a*100}%`,backgroundColor:s.get(o.state??"—")}},o.state??"—"))})}function dt({text:t,tail:s=6,className:r=""}){if(t.length<=s+1)return e.jsx("span",{className:`truncate ${r}`,title:t,children:t});const i=t.slice(0,t.length-s),a=t.slice(t.length-s);return e.jsxs("span",{className:`flex items-baseline min-w-0 ${r}`,title:t,children:[e.jsx("span",{className:"truncate min-w-0",children:i}),e.jsx("span",{className:"shrink-0",children:a})]})}const Ve=15,xt="grid grid-cols-[0.6rem_7rem_minmax(2rem,1fr)_1rem] items-center gap-2.5",Ht=[25,50,100],Gt=50;function Vt({row:t,colors:s,stateLabel:r,onOpen:i}){return e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>i(t.value),onKeyDown:a=>{a.key==="Enter"&&i(t.value)},className:`${xt} text-2xs cursor-pointer group py-0.5`,children:[e.jsx("span",{className:"w-2 h-2 rounded-full dot-ring justify-self-center",style:{backgroundColor:t.nowState?s.get(t.nowState):"transparent"},title:t.nowState?r(t.nowState):"no current state"}),e.jsx(dt,{text:t.value,className:"font-mono text-text-secondary group-hover:text-accent transition-colors"}),e.jsx(Ae,{groups:t.groups,colors:s,height:"h-1.5",className:"min-w-[2rem]"}),e.jsx("button",{className:"icon-link justify-self-center",title:`${te(t.total*1e3)} tracked · open timeline`,onClick:a=>{a.stopPropagation(),i(t.value)},children:e.jsx(rt,{className:"w-3 h-3"})})]})}function ut({sliced:t,header:s,rows:r,colors:i,stateLabel:a,onOpen:c,onTarget:n,hasMore:o,emptyText:d}){return e.jsxs("div",{className:t?"w-72 shrink-0":"flex-1 max-w-3xl",children:[s&&e.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n(s.value),className:`${xt} w-full text-left mb-2 group`,children:[e.jsx("span",{"aria-hidden":!0}),e.jsx(dt,{text:s.value,className:"font-mono text-xs font-medium text-text-primary group-hover:text-accent transition-colors"}),e.jsx(Ae,{groups:s.groups,colors:i,height:"h-2.5",className:"min-w-[2rem]"}),e.jsx("span",{className:"icon-link justify-self-center",title:`${te(s.total*1e3)} total in ${s.value} — the band shows the state split`,children:e.jsx(_t,{className:"w-3 h-3"})})]}),r.length===0?e.jsx("p",{className:"text-2xs text-text-quaternary",children:d??"No entities on this page."}):e.jsx("div",{className:"space-y-0.5",children:r.map(x=>e.jsx(Vt,{row:x,colors:i,stateLabel:a,onOpen:c},x.value))}),o&&s&&n&&e.jsxs("button",{type:"button",onClick:()=>n(s.value),className:"mt-2 inline-flex items-center gap-1 text-2xs text-accent hover:text-accent-hover transition-colors",children:["More ",e.jsx(Rt,{className:"w-3 h-3"})]})]})}function Yt({entityKey:t,sliceKey:s,value:r,headerGroups:i,headerTotal:a,window:c,find:n,colors:o,stateLabel:d,onOpen:x,onTarget:p}){var M;const w={entity:t,equals:{[s]:r}},j=B({query:{...w,...n?{prefix:{[t]:n}}:{}},groupBy:{facets:[t]},measure:{kind:"dwell",window:c},orderBy:[{field:"dwellSeconds",direction:"desc"}],limit:Ve}),f=h.useMemo(()=>{var b;return it(((b=j.data)==null?void 0:b.groups)??[],t)},[j.data,t]),q=f.map(b=>({[t]:b})),k=B(f.length?{query:{entity:t,anyOf:q},groupBy:{state:!0,facets:[t]},measure:{kind:"dwell",window:c},limit:Ve*4}:null),R=B(f.length?{query:{entity:t,anyOf:q},groupBy:{state:!0,facets:[t]},measure:{kind:"membership"}}:null),$=h.useMemo(()=>{var b,F,P;return ct(((b=j.data)==null?void 0:b.groups)??[],((F=k.data)==null?void 0:F.groups)??[],((P=R.data)==null?void 0:P.groups)??[],t)},[j.data,k.data,R.data,t]);return e.jsx(ut,{sliced:!0,header:{value:r,groups:i,total:a},rows:$,colors:o,stateLabel:d,onOpen:x,onTarget:p,hasMore:((M=j.data)==null?void 0:M.overflow)??!1})}function Qt({rows:t,colors:s,stateLabel:r,onOpen:i,emptyText:a}){return e.jsx(ut,{sliced:!1,rows:t,colors:s,stateLabel:r,onOpen:i,emptyText:a})}const qe="entity-timeline",Xt=300,Fe=12;function Zt({entityKey:t,periodHours:s,roles:r,find:i,onFindChange:a,entityValue:c,onEntityChange:n,sliceKey:o=null,onSliceKeyChange:d,sliceValue:x=null,onSliceValueChange:p}){var pe,$e,Se,K,Ge;const w=Ue(s),j=tt(),f=o??"",q=!!f,k=q&&!!x,R=q&&!x,[$,M]=h.useState(0),[b,F]=h.useState(Gt);h.useEffect(()=>{M(0)},[i,w.from,w.to,t,f,x,b]);const[P,v]=h.useState(i??""),L=h.useRef(void 0);h.useEffect(()=>()=>clearTimeout(L.current),[]),h.useEffect(()=>{v(i??"")},[i]);const V=m=>{v(m),clearTimeout(L.current),L.current=setTimeout(()=>{const E=m.trim();a(E||null)},Xt)},g=h.useMemo(()=>{const m=new Map;for(const E of r)m.set(E.role,we(E));return m},[r]),C=m=>m==null?"—":g.get(m)??m,z=B({query:{entity:t},groupBy:{state:!0},measure:{kind:"dwell",window:w},orderBy:[{field:"dwellSeconds",direction:"desc"}]}),H=B({query:{entity:t},groupBy:{state:!0},measure:{kind:"membership"}}),fe=B({query:{entity:t},groupBy:{},measure:{kind:"membership"},distinctBy:t}),T=B(q?{query:{entity:t},groupBy:{state:!0,facets:[f]},measure:{kind:"dwell",window:w},limit:200}:null),_=B(!R?{query:{entity:t,...k?{equals:{[f]:x}}:{},...i?{prefix:{[t]:i}}:{}},groupBy:{facets:[t]},measure:{kind:"dwell",window:w},orderBy:[{field:"dwellSeconds",direction:"desc"}],limit:b,offset:$*b}:null),se=h.useMemo(()=>{var m;return it(((m=_==null?void 0:_.data)==null?void 0:m.groups)??[],t)},[_==null?void 0:_.data,t]),X=se.length?{entity:t,anyOf:se.map(m=>({[t]:m}))}:null,xe=B(X?{query:X,groupBy:{state:!0,facets:[t]},measure:{kind:"dwell",window:w},limit:b*10}:null),ne=B(X?{query:X,groupBy:{state:!0,facets:[t]},measure:{kind:"membership"}}:null),ue=h.useMemo(()=>{var m,E,re;return ct(((m=_==null?void 0:_.data)==null?void 0:m.groups)??[],((E=xe.data)==null?void 0:E.groups)??[],((re=ne.data)==null?void 0:re.groups)??[],t)},[_==null?void 0:_.data,xe.data,ne.data,t]),Y=h.useRef(()=>{}),l=h.useRef(m=>Y.current(m)).current,S=h.useRef(null),O=h.useRef(!1);h.useEffect(()=>{j&&c!==S.current&&(S.current=c,c?j.setPanel(e.jsx(Te,{facetKey:t,value:c,entity:t,intervalColor:l}),{key:qe,width:420}):(O.current=!1,j.closePanel(qe)))},[c,t,j]),h.useEffect(()=>{if(!(!j||!c)){if(j.open&&j.ownerKey===qe){O.current=!0;return}O.current&&(O.current=!1,n(null))}},[j,c,n]);const U=h.useRef(j);U.current=j,h.useEffect(()=>()=>{var m;S.current&&((m=U.current)==null||m.closePanel(qe))},[]);const{data:A}=kt(),Z=h.useMemo(()=>((A==null?void 0:A.keys)??[]).filter(m=>m!==t),[A,t]),W=(((pe=z.data)==null?void 0:pe.groups)??[]).filter(m=>(m.dwellSeconds??0)>0),D=h.useMemo(()=>{var m;return nt([...W,...((m=H.data)==null?void 0:m.groups)??[]].map(E=>({label:E.state??"—",weight:E.dwellSeconds??E.count??0})))},[W,H.data]),J=new Map(((($e=H.data)==null?void 0:$e.groups)??[]).map(m=>[m.state??"—",m.count??0])),me=((K=(Se=fe.data)==null?void 0:Se.groups[0])==null?void 0:K.count)??null,ye=h.useMemo(()=>new Set(r.filter(m=>m.entity_state_source==="subtype").map(m=>m.role)),[r]);Y.current=m=>{const E=ye.has(m.role)?m.subtype??m.role:m.role;return D.get(E)};const ae=h.useMemo(()=>{var m;return q?zt(((m=T.data)==null?void 0:m.groups)??[],f,Fe):[]},[q,T.data,f]),Q=h.useMemo(()=>{var E;const m=new Set;for(const re of((E=T.data)==null?void 0:E.groups)??[])(re.dwellSeconds??0)>0&&re.facets[f]!=null&&m.add(re.facets[f]);return m.size},[T.data,f]),ke=h.useMemo(()=>{var E;if(!k)return{groups:[],total:0};const m=(((E=T.data)==null?void 0:E.groups)??[]).filter(re=>re.facets[f]===x);return{groups:m,total:Oe(m)}},[k,T.data,f,x]),u=((Ge=_==null?void 0:_.data)==null?void 0:Ge.overflow)??!1,N=Ee(_==null?void 0:_.error),y=q&&Ee(T.error);return e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 px-2 pt-4 pb-3 flex items-start gap-6 border-b border-surface-border/40",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4 mb-2.5",children:[e.jsxs("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:["Where the time went · ",e.jsx("span",{className:"normal-case font-mono",children:t})," system"]}),me!=null&&e.jsxs("p",{className:"text-2xs text-text-quaternary whitespace-nowrap",children:[e.jsx("span",{className:"text-xs font-mono font-semibold text-text-primary tabular-nums",children:me})," ",e.jsx("span",{className:"font-mono",children:t})," in queue now"]})]}),W.length>0?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{groups:W,colors:D,height:"h-3"}),e.jsx("div",{className:"flex flex-wrap gap-x-6 gap-y-1 mt-2.5",children:W.map(m=>e.jsxs("span",{className:"flex items-center gap-1.5 text-2xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:D.get(m.state??"—")}}),e.jsx("span",{className:"font-mono text-text-secondary",children:C(m.state)}),e.jsx("span",{className:"font-mono tabular-nums text-text-tertiary",children:te((m.dwellSeconds??0)*1e3)}),e.jsxs("span",{className:"font-mono tabular-nums text-text-quaternary",children:[Math.round((m.dwellSeconds??0)/Oe(W)*100),"%"]}),(J.get(m.state??"—")??0)>0&&e.jsxs("span",{className:"text-text-quaternary",children:["· ",J.get(m.state??"—")," now"]})]},m.state))})]}):e.jsx("p",{className:"text-2xs text-text-quaternary",children:"No tracked time in this window."})]}),e.jsxs("div",{className:"shrink-0 w-56 space-y-2.5",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Slice by"}),e.jsxs("select",{value:f,onChange:m=>d==null?void 0:d(m.target.value||null),className:"select text-xs font-mono w-full",children:[e.jsx("option",{value:"",children:"— none —"}),Z.map(m=>e.jsx("option",{value:m,children:m},m))]})]}),e.jsx("input",{type:"text",value:P,onChange:m=>V(m.target.value),placeholder:`Find by ${t}…`,"aria-label":`Find by ${t}`,className:"w-full bg-transparent border-b border-surface-border/60 focus:border-accent focus:outline-none text-xs font-mono text-text-primary placeholder:text-text-quaternary pb-0.5 transition-colors"})]})]}),k&&e.jsxs("div",{className:"shrink-0 px-2 pt-3 flex items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:()=>p==null?void 0:p(null),className:"inline-flex items-center gap-1 text-2xs text-accent hover:text-accent-hover transition-colors shrink-0",children:[e.jsx(Pt,{className:"w-3 h-3"})," all ",f]}),e.jsx("span",{className:"font-mono text-xs text-text-primary shrink-0",children:x}),e.jsx(Ae,{groups:ke.groups,colors:D,height:"h-2",className:"flex-1 max-w-md"}),e.jsx("span",{className:"font-mono tabular-nums text-2xs text-text-tertiary shrink-0",children:te(ke.total*1e3)})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-2 py-4",children:R?y?e.jsx("p",{className:"text-2xs text-text-quaternary",children:"Slicing requires full read access to the system's queues."}):ae.length===0?e.jsx("p",{className:"text-2xs text-text-quaternary",children:"No tracked time for this slice in the window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex gap-6 min-w-max",children:ae.map(m=>e.jsx(Yt,{entityKey:t,sliceKey:f,value:m.value,headerGroups:m.groups,headerTotal:m.total,window:w,find:i,colors:D,stateLabel:C,onOpen:n,onTarget:E=>p==null?void 0:p(E)},m.value))}),Q>Fe&&e.jsxs("p",{className:"text-2xs text-text-quaternary pt-4",children:["Showing the top ",Fe," of ",Q," ",e.jsx("span",{className:"font-mono",children:f})," values — a facet this wide isn't a good slice dimension."]})]}):N?e.jsx("p",{className:"text-2xs text-text-quaternary",children:"The per-entity view requires full read access to the system's queues."}):e.jsx(Qt,{rows:ue,colors:D,stateLabel:C,onOpen:n,emptyText:i?`No ${t} starts with “${i}” in this window.`:"No entities tracked in this window."})}),!R&&e.jsxs("div",{className:"shrink-0 border-t border-surface-border bg-surface/95 px-2 pt-2 pb-3 flex items-center gap-3 text-2xs",children:[e.jsx("button",{disabled:$===0,onClick:()=>M($-1),className:"text-text-tertiary hover:text-accent transition-colors disabled:opacity-40 disabled:hover:text-text-tertiary",children:"Prev"}),e.jsxs("span",{className:"font-mono tabular-nums text-text-quaternary",children:["page ",$+1]}),e.jsx("button",{disabled:!u,onClick:()=>M($+1),className:"text-text-tertiary hover:text-accent transition-colors disabled:opacity-40 disabled:hover:text-text-tertiary",children:"Next"}),e.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-text-quaternary",children:[e.jsx("span",{children:"per page"}),e.jsx("select",{value:b,onChange:m=>F(Number(m.target.value)),"aria-label":"Results per page",className:"select text-2xs font-mono py-0.5",children:Ht.map(m=>e.jsx("option",{value:m,children:m},m))})]})]})]})}function Jt({lenses:t,activeLens:s,stationCount:r,onSelect:i}){const[a,c]=h.useState(!1),n=h.useRef(null);h.useEffect(()=>{if(!a)return;const d=p=>{n.current&&!n.current.contains(p.target)&&c(!1)},x=p=>{p.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",d),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",x)}},[a]);const o=d=>{i(d),c(!1)};return e.jsxs("div",{ref:n,className:"relative",title:"View: the board station-first, or an entity system (roles sharing an entity facet) entity-first",children:[e.jsxs("button",{type:"button",onClick:()=>c(d=>!d),className:"group flex items-baseline gap-1.5","aria-expanded":a,"aria-haspopup":"listbox","aria-label":"Board view",children:[e.jsx("span",{className:"text-2xs uppercase tracking-widest text-text-quaternary",children:"View"}),e.jsx("span",{className:"text-xs font-medium text-text-primary group-hover:text-accent transition-colors",children:s?e.jsxs(e.Fragment,{children:["by ",e.jsx("span",{className:"font-mono",children:s})]}):"Stations"}),e.jsx(ze,{className:`w-3 h-3 self-center shrink-0 text-text-tertiary group-hover:text-accent transition-transform ${a?"rotate-180":""}`,strokeWidth:1.5})]}),a&&e.jsxs("div",{role:"listbox",className:"absolute z-[100] top-full right-0 mt-1.5 min-w-[16rem] max-h-80 overflow-y-auto bg-surface-raised border border-surface-border rounded-md shadow-lg py-1",children:[e.jsx(mt,{label:"Stations",note:`${r} station${r===1?"":"s"}`,active:s===null,onClick:()=>o(null)}),t.map(d=>e.jsx(Kt,{lens:d,active:s===d,fetchCount:a,onClick:()=>o(d)},d))]})]})}function mt({label:t,note:s,active:r,onClick:i,mono:a}){return e.jsxs("button",{type:"button",role:"option","aria-selected":r,onClick:i,className:`w-full text-left px-3 py-1.5 flex items-baseline gap-2.5 transition-colors ${r?"text-accent bg-accent/5":"text-text-primary hover:bg-surface-hover"}`,children:[e.jsx("span",{className:`text-xs font-medium truncate ${a?"font-mono":""}`,children:t}),s&&e.jsx("span",{className:"ml-auto text-2xs font-mono text-text-quaternary tabular-nums shrink-0",children:s})]})}function Kt({lens:t,active:s,fetchCount:r,onClick:i}){var n,o;const c=(o=(n=B({query:{entity:t},groupBy:{},measure:{kind:"membership"},distinctBy:t},{enabled:r}).data)==null?void 0:n.groups[0])==null?void 0:o.count;return e.jsx(mt,{label:`by ${t}`,mono:!0,note:c!=null?`${c} in queue`:null,active:s,onClick:i})}const pt=800,ht=270,ie=28,es=60,Be=24,ts=72,Pe=pt-ie-es,We=ht-Be-ts,G=Be+We,Ie=ie+Pe,I="0.5s cubic-bezier(0.4, 0, 0.2, 1)",Ye=9;function ss(t){return`M ${(t.x-Ye).toFixed(1)} ${t.y.toFixed(1)} L ${(t.x+Ye).toFixed(1)} ${t.y.toFixed(1)}`}function ge(t){if(t.length===0)return"";if(t.length===1)return ss(t[0]);const s=[];for(let r=0;r<t.length-1;r++){const i=t[Math.max(0,r-1)],a=t[r],c=t[r+1],n=t[Math.min(t.length-1,r+2)],o=(a.x+(c.x-i.x)/6).toFixed(1),d=(a.y+(c.y-i.y)/6).toFixed(1),x=(c.x-(n.x-a.x)/6).toFixed(1),p=(c.y-(n.y-a.y)/6).toFixed(1);r===0&&s.push(`M ${a.x.toFixed(1)} ${a.y.toFixed(1)}`),s.push(`C ${o} ${d}, ${x} ${p}, ${c.x.toFixed(1)} ${c.y.toFixed(1)}`)}return s.join(" ")}function ns(t,s){if(t.length<2||s.length<2)return"";const r=ge(t),i=[...s].reverse(),a=ge(i),c=a.slice(a.indexOf("C"));return`${r} L ${i[0].x.toFixed(1)} ${i[0].y.toFixed(1)} ${c} Z`}function Qe(t){return t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Me(t){return t.length>0?t[t.length-1]:void 0}function as(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 rs(t){return[.25,.5,.75].map(r=>Math.round(r*t)).filter(r=>r>0)}const ce="rgb(var(--lt-status-claimed-graphic))",je="rgb(var(--lt-status-queued-graphic))",ee="rgb(var(--lt-status-success-graphic))",de="rgb(var(--lt-text-quaternary))",be="rgb(var(--lt-status-error))";function Ne(t,s){return t.replace(/\)$/,` / ${s})`)}const os=13;function ls(t,s){const r=[...t].sort((n,o)=>n.y-o.y);let i=-1/0;const a=r.map(n=>{const o=Math.max(n.y+3,i+os);return i=o,{...n,labelY:o}}),c=a.length>0?a[a.length-1].labelY-s:0;if(c>0)for(const n of a)n.labelY-=c;return a}function is({stations:t,selectedRole:s,onSelect:r,onUpstreamSelect:i,onCmdClick:a,periodHours:c,logScale:n=!1,fill:o=!1}){const[d,x]=h.useState(null),p=t.length;if(p===0)return null;const w=l=>p===1?ie+Pe/2:ie+l/(p-1)*Pe,j=new Map(t.map((l,S)=>[l.role,w(S)])),f=t.map((l,S)=>{var A,Z,W,D;const O=l.target_per_hour??null,U=O!=null?O*c:null;return{idx:S,x:w(S),expected:U,actual:((A=l.metric)==null?void 0:A.resolved)??0,active:((Z=l.metric)==null?void 0:Z.claimed)??0,pending:((W=l.metric)==null?void 0:W.pending)??0,priorityCount:((D=l.metric)==null?void 0:D.priority_count)??0}}),q=f.some(l=>l.expected!=null),R=Math.max(1,...f.map(l=>l.expected??0),...f.map(l=>l.actual),...f.map(l=>l.expected!=null?l.pending:0))*1.15,$=n?l=>{const S=Math.log(1+R);return Be+We*(1-Math.log(1+Math.max(0,l))/S)}:l=>Be+We*(1-Math.max(0,Math.min(l,R))/R),M=n?as(R):rs(R),b=f.filter(l=>l.expected!=null),F=b.map(l=>({...l,y:$(l.expected)})),P=b.map(l=>({...l,y:$(l.actual)})),v=b.map(l=>({...l,y:$(l.active)})),L=b.map(l=>({...l,y:$(l.pending)})),V=ge(F),g=ge(P),C=ge(v),z=ge(L),H=Me(P),fe=Me(F),T=Me(v),ve=Me(L),_=P.length>=2&&H?`${g} L ${H.x.toFixed(1)} ${G} L ${P[0].x.toFixed(1)} ${G} Z`:"",se=b.some(l=>l.pending>0||l.active>0),X=se&&v.length>=2&&T?`${C} L ${T.x.toFixed(1)} ${G} L ${v[0].x.toFixed(1)} ${G} Z`:"",xe=se?ns(L,v):"",ne=b.some(l=>l.active>0),ue=b.some(l=>l.pending>l.active),Y=ls([fe?{key:"target",text:"Target",color:de,y:fe.y}:null,H?{key:"actual",text:"Resolved",color:ee,y:H.y}:null,ne&&T?{key:"active",text:"Claimed",color:ce,y:T.y}:null,ue&&ve?{key:"queued",text:"Pending",color:je,y:ve.y}:null].filter(Boolean),G+4);return e.jsxs("svg",{viewBox:`0 0 ${pt} ${ht}`,className:o?"w-full h-full":"w-full",preserveAspectRatio:"xMidYMid meet",style:{display:"block",...o?{}:{height:"auto"}},children:[M.map(l=>{const S=$(l);return e.jsxs("g",{children:[e.jsx("line",{x1:ie,y1:S,x2:Ie,y2:S,className:"stroke-surface-border",strokeWidth:.5,opacity:n?.45:.3,strokeDasharray:n?"2 5":void 0,style:{transition:`y1 ${I}, y2 ${I}`}}),e.jsx("text",{x:ie-4,y:S+2.5,textAnchor:"end",fontSize:6,fontFamily:"ui-monospace, monospace",opacity:.35,className:"fill-text-quaternary",children:Qe(l)})]},`grid-${l}`)}),t.map(l=>{if(!l.parent_role)return null;const S=j.get(l.parent_role);if(S==null)return null;const O=w(t.findIndex(U=>U.role===l.role));return e.jsx("line",{x1:S,y1:G,x2:O,y2:G,className:"stroke-surface-border",strokeWidth:.75},`dep-${l.role}`)}),_&&e.jsx("path",{d:_,opacity:.05,style:{fill:ee,transition:`d ${I}`}}),X&&e.jsx("path",{d:X,opacity:.12,style:{fill:ce,transition:`d ${I}`}}),xe&&e.jsx("path",{d:xe,opacity:.12,style:{fill:je,transition:`d ${I}`}}),V&&e.jsx("path",{d:V,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.7,style:{stroke:de,transition:`d ${I}`}}),F.map(l=>e.jsxs("g",{transform:`translate(${l.x} ${l.y})`,style:{transition:`transform ${I}`},children:[e.jsx("circle",{r:2,opacity:.8,style:{fill:de}}),e.jsx("text",{y:-5,textAnchor:"middle",fontSize:6.5,fontFamily:"ui-monospace, monospace",fontWeight:"500",opacity:.7,style:{fill:de},children:Math.round(l.expected)})]},`tval-${l.idx}`)),se&&z&&e.jsx("path",{d:z,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.55,style:{stroke:je,transition:`d ${I}`}}),C&&e.jsx("path",{d:C,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.5,style:{stroke:ce,transition:`d ${I}`}}),g&&e.jsx("path",{d:g,fill:"none",strokeWidth:.6,strokeLinejoin:"round",strokeLinecap:"round",opacity:.65,style:{stroke:ee,transition:`d ${I}`}}),v.map((l,S)=>{if(l.pending<=0&&l.active<=0)return null;const O=Math.max(2.5,Math.min(5,2.5+l.active/10)),U=l.pending>l.active,A=Math.min(L[S].y-4,l.y-O-4);return e.jsxs("g",{children:[l.pending>0&&e.jsx("text",{x:l.x,y:A,textAnchor:"middle",fontSize:7.5,fontFamily:"ui-monospace, monospace",fontWeight:"600",style:{fill:U?je:"rgb(var(--lt-text-tertiary))",transition:`y ${I}`},children:l.pending}),e.jsxs("g",{transform:`translate(${l.x} ${l.y})`,style:{transition:`transform ${I}`},children:[e.jsx("circle",{r:O,opacity:.85,style:{fill:ce}}),l.active>0&&e.jsx("text",{y:O+9,textAnchor:"middle",fontSize:7.5,fontFamily:"ui-monospace, monospace",fontWeight:"600",style:{fill:ce},children:l.active})]})]},`active-${l.idx}`)}),f.map(l=>{var ae;const S=t[l.idx],O=l.x,U=l.expected!=null?$(l.actual):G,A=Math.max(2.25,Math.min(4,2.25+l.actual/160)),Z=S.role===s,W=d===l.idx,D=l.expected==null?"idle · set a target rate to plot pace":`${l.actual} resolved · target ${Math.round(l.expected)}`+(l.pending>l.active?` · ${l.pending-l.active} pending`:"")+(l.active>0?` · ${l.active} claimed`:"")+(l.priorityCount>0?` · ${l.priorityCount} in jeopardy`:""),J=D.length*5.5+20,me=Math.max(ie+J/2+4,Math.min(Ie-J/2-4,O)),ye=U-A-10;return e.jsxs("g",{onClick:Q=>{Q.metaKey||Q.ctrlKey?(Q.stopPropagation(),a==null||a(S.role)):r(S.role)},onMouseEnter:()=>x(l.idx),onMouseLeave:()=>x(null),style:{cursor:"pointer"},children:[e.jsxs("g",{transform:`translate(${O} ${U})`,style:{transition:`transform ${I}`},children:[e.jsx("circle",{r:22,fill:"transparent"}),e.jsx("circle",{r:A,opacity:.9,style:{fill:ee,transition:`r ${I}`}}),l.expected!=null&&e.jsx("text",{y:-A-5,textAnchor:"middle",fontSize:9.5,fontFamily:"ui-monospace, monospace",fontWeight:"500",style:{fill:ee},children:Qe(l.actual)}),W&&!Z&&e.jsx("circle",{r:A+3,fill:"none",strokeWidth:1,opacity:.4,style:{stroke:ee}}),Z&&e.jsx("circle",{r:A+4,fill:"none",className:"stroke-accent",strokeWidth:2})]}),(((ae=S.upstream_roles)==null?void 0:ae.length)??0)>0&&e.jsxs("g",{transform:`translate(${O-20} ${G})`,onClick:Q=>{Q.stopPropagation(),i==null||i(S.upstream_roles[0])},style:{cursor:"pointer"},children:[e.jsx("title",{children:`Fed by ${S.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:O,y:G+(l.idx%2===0?14:27),textAnchor:"middle",fontSize:9.5,className:"fill-text-tertiary",fontFamily:"ui-sans-serif, sans-serif",fontWeight:"500",children:we(S)}),W&&e.jsxs("g",{children:[e.jsx("rect",{x:me-J/2,y:ye-16,width:J,height:19,rx:3,className:"fill-text-primary",opacity:.88}),e.jsx("text",{x:me,y:ye-3,textAnchor:"middle",fontSize:8.5,className:"fill-surface",fontFamily:"ui-monospace, monospace",children:D})]})]},S.role)}),!q&&e.jsx("text",{x:ie+Pe/2,y:G+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"}),Y.map(l=>e.jsx("text",{x:Ie+6,y:l.labelY,fontSize:8,fontFamily:"ui-sans-serif, sans-serif",fontWeight:l.key==="actual"?700:500,opacity:l.key==="active"?.85:1,style:{fill:l.color,transition:`y ${I}`},children:l.text},l.key))]})}function ft(t){const s=t.priority_facet?`metadata.${t.priority_facet}`:"created_at",r=JSON.stringify([{field:s,direction:"asc"}]);return`/escalations/available?role=${encodeURIComponent(t.role)}&jeopardy=1&view=table&orderBy=${encodeURIComponent(r)}`}function cs({role:t,periodHours:s,onOpenEntity:r}){var M,b,F,P,v,L,V;const i=Ue(s),a=t.entity_facet,[c,n]=h.useState(!1),[,o]=lt(),d=()=>{a&&o(g=>{const C=new URLSearchParams(g);return C.set("lens",a),C})},x=B({query:{roles:[t.role]},groupBy:{columns:["subtype"]},measure:{kind:"dwell",window:i},orderBy:[{field:"dwellSeconds",direction:"desc"}]}),p=B({query:{roles:[t.role]},groupBy:{columns:["subtype"]},measure:{kind:"membership"},orderBy:[{field:"count",direction:"desc"}]}),w=B(a?{query:{roles:[t.role]},groupBy:{},measure:{kind:"membership"},distinctBy:a}:null),j=B(a&&c?{query:{roles:[t.role],exists:[a]},groupBy:{facets:[a]},measure:{kind:"dwell",window:i},orderBy:[{field:"dwellSeconds",direction:"desc"}],limit:8}:null),f=h.useMemo(()=>{var g,C;return at([...((g=x.data)==null?void 0:g.groups)??[],...((C=p.data)==null?void 0:C.groups)??[]])},[x.data,p.data]);if(Ee(x.error))return e.jsx("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:e.jsx("p",{className:"text-2xs text-text-quaternary",children:"Analytics require full read access to this station's queue."})});const q=(((M=x.data)==null?void 0:M.groups)??[]).filter(g=>(g.dwellSeconds??0)>0),k=q.reduce((g,C)=>g+(C.dwellSeconds??0),0),R=(((b=p.data)==null?void 0:b.groups)??[]).filter(g=>(g.count??0)>0),$=((P=(F=w.data)==null?void 0:F.groups[0])==null?void 0:P.count)??null;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2.5",children:"Where the time went"}),k>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 flex rounded-full overflow-hidden bg-surface-sunken mb-2.5",children:q.map(g=>e.jsx("div",{style:{width:`${(g.dwellSeconds??0)/k*100}%`,backgroundColor:f.get(he(g.subtype))}},he(g.subtype)))}),e.jsx("div",{className:"space-y-1",children:q.map(g=>e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:f.get(he(g.subtype))}}),e.jsx("span",{className:`font-mono truncate flex-1 ${g.subtype?"text-text-secondary":"text-text-tertiary"}`,children:Le(g.subtype)}),e.jsx("span",{className:"font-mono tabular-nums text-text-secondary shrink-0",children:te((g.dwellSeconds??0)*1e3)}),e.jsxs("span",{className:"font-mono tabular-nums text-text-quaternary w-8 text-right shrink-0",children:[Math.round((g.dwellSeconds??0)/k*100),"%"]})]},he(g.subtype)))}),((v=x.data)==null?void 0:v.overflow)&&e.jsx("p",{className:"text-2xs text-text-quaternary mt-1.5",children:"more groups exist — narrow the window"})]}):e.jsx("p",{className:"text-2xs text-text-quaternary",children:"No tracked time in this window."})]}),e.jsxs("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2.5",children:"In queue now"}),a&&$!=null&&e.jsxs("button",{onClick:d,className:"group flex items-center gap-1 text-2xs mb-2 text-left",title:`Open the ${a} lens — the whole system, entity-first`,children:[e.jsx("span",{className:"text-xs font-mono font-semibold text-text-primary tabular-nums",children:$})," ",e.jsx("span",{className:"font-mono text-text-tertiary group-hover:text-accent transition-colors",children:a}),e.jsx("span",{className:"text-text-quaternary",children:" in queue"}),e.jsx(Lt,{className:"w-3 h-3 text-text-quaternary group-hover:text-accent transition-colors"})]}),R.length>0?e.jsx("div",{className:"space-y-1",children:R.map(g=>e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:f.get(he(g.subtype))}}),e.jsx("span",{className:`font-mono truncate flex-1 ${g.subtype?"text-text-secondary":"text-text-tertiary"}`,children:Le(g.subtype)}),e.jsx("span",{className:"font-mono tabular-nums text-text-primary shrink-0",children:g.count})]},he(g.subtype)))}):e.jsx("p",{className:"text-2xs text-text-quaternary",children:"Queue clear."}),a&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{onClick:()=>n(g=>!g),className:"flex items-center gap-1 text-2xs text-text-tertiary hover:text-accent transition-colors",children:[c?e.jsx(ze,{className:"w-3 h-3"}):e.jsx(Et,{className:"w-3 h-3"}),"By entity"]}),c&&(Ee(j.error)?e.jsx("p",{className:"text-2xs text-text-quaternary mt-1.5",children:"Requires full read access to this station's queue."}):e.jsxs("div",{className:"space-y-1 mt-1.5",children:[(((L=j.data)==null?void 0:L.groups)??[]).map(g=>{const C=g.facets[a];return C==null?null:e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsx("span",{className:"font-mono truncate flex-1 text-text-secondary",title:C,children:C}),e.jsx("span",{className:"font-mono tabular-nums text-text-secondary shrink-0",children:te((g.dwellSeconds??0)*1e3)}),e.jsx("button",{className:"icon-link shrink-0",title:"Open timeline",onClick:()=>r(a,C),children:e.jsx(rt,{className:"w-3 h-3"})})]},C)}),j.data&&j.data.groups.length===0&&e.jsx("p",{className:"text-2xs text-text-quaternary",children:"No entities in this window."}),((V=j.data)==null?void 0:V.overflow)&&e.jsx("p",{className:"text-2xs text-text-quaternary",children:"top 8 by dwell"})]}))]})]})]})}const yt=["15m","1h","24h","7d","30d"],ds=t=>yt.includes(t),xs={"15m":.25,"1h":1,"24h":24,"7d":168,"30d":720};function Ce(t){if(t==null)return"—";if(t<1){const s=Math.round(t*60);return s<=0?"< 1s":`${s}s`}return t<60?`${t.toFixed(0)}m`:`${(t/60).toFixed(1)}h`}function _e({label:t,value:s}){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:s})]})}function us({period:t,onChange:s}){return e.jsx("div",{className:"flex items-center gap-1 mb-4",children:yt.map(r=>e.jsx("button",{onClick:()=>s(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 ms({role:t,globalPeriod:s,onClose:r}){const[i,a]=h.useState(ds(s)?s:"24h"),{data:c}=st(i),n=c==null?void 0:c.stations.find(j=>j.role===t.role),o=t.sla_minutes??void 0,d=t.target_per_hour??void 0,x=t.worker_count??void 0,p=tt(),w=h.useCallback((j,f)=>{p==null||p.setPanel(t.entity_facet?e.jsx(Te,{facetKey:j,value:f,entity:t.entity_facet}):e.jsx(Te,{facetKey:j,value:f,role:t.role}),{key:"entity-timeline",width:420})},[p,t.role,t.entity_facet]);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:we(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(Ot,{className:"w-4 h-4"})})]}),n&&n.priority_count>0&&e.jsxs(le,{to:ft(t),className:"flex items-center justify-between group mb-4",children:[e.jsxs("span",{className:"text-2xs",style:{color:be},children:[n.priority_count," in jeopardy — pull oldest first"]}),e.jsx(At,{className:"w-3 h-3 transition-colors",style:{color:be}})]}),e.jsx(us,{period:i,onChange:a}),(d||o||x)&&e.jsxs("div",{className:"flex items-center gap-6 mb-6 text-2xs border-b border-surface-border/30 pb-5",children:[d&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-mono font-semibold text-text-primary text-sm",children:[d,"/h"]}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"target"})]}),o&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-mono font-semibold text-text-primary text-sm",children:[o,"m"]}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"SLA"})]}),x&&e.jsxs("div",{children:[e.jsx("div",{className:"font-mono font-semibold text-text-primary text-sm",children:x}),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(_e,{label:"P99",value:Ce((n==null?void 0:n.wait.p99)??null)}),e.jsx(_e,{label:"avg",value:Ce((n==null?void 0:n.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(_e,{label:"P99",value:Ce((n==null?void 0:n.work.p99)??null)}),e.jsx(_e,{label:"avg",value:Ce((n==null?void 0:n.work.avg)??null)})]})]}),o&&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:[o,"m"]})]})}),e.jsx(cs,{role:t,periodHours:xs[i],onOpenEntity:w})]})}function ps({allMetrics:t,orderedRoles:s,period:r}){const i=t.reduce((x,p)=>x+p.pending,0),a=t.reduce((x,p)=>x+p.resolved,0),c=t.reduce((x,p)=>x+p.priority_count,0),n=new Map(t.map(x=>[x.role,x])),o=t.filter(x=>x.priority_count>0).length,d=t.filter(x=>x.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:o>0?e.jsxs("p",{className:"text-2xs",style:{color:be},children:[o," station",o>1?"s":""," with items in jeopardy"]}):d>0?e.jsxs("p",{className:"text-2xs text-status-warning",children:[d," station",d>1?"s":""," with backlog"]}):a>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 ${i>0?"text-text-primary font-semibold":"text-text-quaternary"}`,children:i})]}),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:a})]}),c>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:be},children:c})]})]}),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:s.map(x=>{const p=n.get(x.role),w=(p==null?void 0:p.pending)??0,j=(p==null?void 0:p.claimed)??0,f=(p==null?void 0:p.resolved)??0,q=(p==null?void 0:p.priority_count)??0,k=x.title||x.role,R=q>0,$=w>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 ${$?"text-text-primary":"text-text-quaternary"}`,title:k,children:k}),e.jsx("span",{className:"text-[0.625rem] leading-none font-semibold tabular-nums w-4 text-right shrink-0",style:{color:be},title:R?`${q} priority — pull oldest first`:void 0,children:R?q:""}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${$?"text-text-primary font-semibold":"text-text-quaternary"}`,children:w>0?w:"—"}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${j>0?"text-accent font-semibold":"text-text-quaternary"}`,children:j>0?j:"—"}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${f>0?"text-text-secondary":"text-text-quaternary"}`,children:f>0?f:"—"})]},x.role)})}),e.jsx("p",{className:"text-2xs text-text-quaternary mt-5",children:"Select a station for queue detail."})]})}function hs({role:t,allMetrics:s,orderedRoles:r,globalPeriod:i,mixGroups:a,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(ms,{role:t,globalPeriod:i,onClose:c}):e.jsxs(e.Fragment,{children:[e.jsx(ps,{allMetrics:s,orderedRoles:r,period:i}),e.jsx(fs,{mixGroups:a,orderedRoles:r})]})})}function fs({mixGroups:t,orderedRoles:s}){const r=new Set(s.map(o=>o.role)),i=(t??[]).filter(o=>o.role&&r.has(o.role)&&(o.dwellSeconds??0)>0);if(i.length===0)return null;const a=new Map(s.map(o=>[o.role,o.title||o.role])),c=Xe(i,o=>o.role),n=Xe(i,o=>Le(o.subtype));return e.jsxs(e.Fragment,{children:[e.jsx(Ze,{label:"Time by station",entries:c,display:o=>a.get(o)??o}),e.jsx(Ze,{label:"Time by subtype",entries:n,display:o=>o})]})}function Xe(t,s){const r=new Map;for(const i of t){const a=s(i);r.set(a,(r.get(a)??0)+(i.dwellSeconds??0))}return[...r.entries()].sort(([,i],[,a])=>a-i)}function Ze({label:t,entries:s,display:r}){const i=nt(s.map(([c,n])=>({label:c,weight:n}))),a=s.reduce((c,[,n])=>c+n,0)||1;return e.jsxs("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2.5",children:t}),e.jsx("div",{className:"h-2 flex rounded-full overflow-hidden bg-surface-sunken mb-2",children:s.map(([c,n])=>e.jsx("div",{style:{width:`${n/a*100}%`,backgroundColor:i.get(c)}},c))}),e.jsxs("div",{className:"space-y-0.5",children:[s.slice(0,6).map(([c,n])=>e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.get(c)}}),e.jsx("span",{className:"font-mono text-text-secondary truncate flex-1",children:r(c)}),e.jsx("span",{className:"font-mono tabular-nums text-text-tertiary shrink-0",children:te(n*1e3)}),e.jsxs("span",{className:"font-mono tabular-nums text-text-quaternary w-8 text-right shrink-0",children:[Math.round(n/a*100),"%"]})]},c)),s.length>6&&e.jsxs("p",{className:"text-2xs text-text-quaternary",children:["+",s.length-6," more"]})]})]})}const ys=de,He="rgb(var(--lt-accent))",gt=Ne(de,.09),jt=Ne(de,.09),bt=Ne(He,.07),wt=Ne(je,.08),Nt=Ne(ce,.08),vt=Ne(ee,.08),gs=["15m","1h","24h","7d","30d"],Re={"15m":.25,"1h":1,"24h":24,"7d":168,"30d":720};function De(t){const s=t.filter(n=>n.ops_visible),r=new Map(s.map(n=>[n.role,n])),i=new Set,c=s.filter(n=>!n.parent_role||!r.has(n.parent_role)).map(n=>{const o=[],d=[{role:n,depth:0}];for(;d.length>0;){const x=d.shift();i.has(x.role.role)||(i.add(x.role.role),o.push(x),s.filter(p=>p.parent_role===x.role.role&&!i.has(p.role)).forEach(p=>d.push({role:p,depth:x.depth+1})))}return{origin:n,stations:o}});return s.filter(n=>!i.has(n.role)).forEach(n=>c.push({origin:n,stations:[{role:n,depth:0}]})),c.sort((n,o)=>o.stations.length-n.stations.length||n.origin.role.localeCompare(o.origin.role))}function Je(t){if(t==null)return"—";if(t<1){const s=Math.round(t*60);return s<=0?"< 1s":`${s}s`}return t<60?`${t.toFixed(0)}m`:`${(t/60).toFixed(1)}h`}function js(t,s){if(!s||t===0)return{pct:null,color:"bg-surface-border"};const r=t/s,i=Math.round(r*100),a=r>1?"bg-status-warning":r<.2?"bg-status-draft":"bg-status-success";return{pct:i,color:a}}function Ke({value:t,onSave:s}){const[r,i]=h.useState(t!=null?String(t):""),a=h.useRef(void 0),c=n=>{const o=parseInt(n,10);s(!n.trim()||isNaN(o)||o<0?null:o)};return e.jsx("input",{type:"number",min:0,step:1,value:r,onChange:n=>{const o=n.target.value;i(o),clearTimeout(a.current),a.current=setTimeout(()=>c(o),400)},onBlur:n=>{clearTimeout(a.current),c(n.target.value)},onClick:n=>n.stopPropagation(),onKeyDown:n=>n.stopPropagation(),className:"w-full bg-transparent text-xs font-mono tabular-nums text-right focus:outline-none"})}function bs({role:t,metric:s,mixGroups:r,mixColors:i,selected:a,periodHours:c,onClick:n}){var P;const o=St(),{isBuilder:d,isOps:x}=qt(),p=(s==null?void 0:s.pending)??0,w=(s==null?void 0:s.claimed)??0,j=(s==null?void 0:s.resolved)??0,f=(s==null?void 0:s.priority_count)??0,q=t.target_per_hour??null,{pct:k,color:R}=js(p,q),$=k!=null?Math.min(100,k):0,M=vs(t.target_per_hour??null,t.sla_minutes??null,p,c),b=v=>o.mutate({role:t.role,target_per_hour:v}),F=v=>o.mutate({role:t.role,sla_minutes:v});return e.jsxs("tr",{tabIndex:0,onClick:n,onKeyDown:v=>{v.key==="Enter"&&n()},className:`cursor-pointer border-b border-surface-border/30 last:border-b-0 transition-colors ${a?"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:we(t)}),(((P=t.upstream_roles)==null?void 0:P.length)??0)>0&&e.jsx("span",{title:`Fed by ${t.upstream_roles.join(", ")}`,className:"shrink-0 leading-none",children:e.jsx(Ft,{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:gt},children:e.jsx(Ke,{value:t.target_per_hour??null,onSave:b})}),e.jsx("td",{className:"px-2 py-1.5",style:{backgroundColor:jt},children:e.jsx(Ke,{value:t.sla_minutes??null,onSave:F})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:bt},title:M!=null?`~${M} concurrent worker${M===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 ${M!=null?"":"text-text-quaternary"}`,style:M!=null?{color:He}:void 0,children:M??"—"})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:wt},children:e.jsx(le,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=available`,className:`text-xs font-mono tabular-nums hover:underline ${p>0?"text-text-primary font-semibold":"text-text-quaternary"}`,onClick:v=>v.stopPropagation(),children:p})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:Nt},children:e.jsx(le,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=claimed`,className:`text-xs font-mono tabular-nums hover:underline ${w>0?"font-semibold":"text-text-quaternary"}`,style:w>0?{color:ce}:void 0,onClick:v=>v.stopPropagation(),children:w})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:vt},children:e.jsx(le,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=resolved`,className:`text-xs font-mono tabular-nums hover:underline ${j>0?"text-text-secondary":"text-text-quaternary"}`,style:j>0?{color:ee}:void 0,onClick:v=>v.stopPropagation(),children:j})}),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:Je((s==null?void 0:s.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:Je((s==null?void 0:s.work.p99)??null)})}),e.jsx("td",{className:"hidden lg:table-cell px-2 py-1.5",children:e.jsx(Ut,{groups:r,colors:i})}),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 ${R}`,style:{width:`${$}%`}})}),e.jsx("span",{className:`text-2xs font-mono tabular-nums ${k!=null&&k>100?"text-status-warning font-semibold":"text-text-quaternary"}`,children:k!=null?`${k}%`:"—"})]})}),e.jsx("td",{className:"py-1.5",children:e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[e.jsx(le,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=all`,className:"icon-link",title:"View all items in queue",onClick:v=>v.stopPropagation(),children:e.jsx(It,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"w-3.5 flex items-center justify-center",children:(d||x)&&e.jsx(le,{to:`/admin/roles/${encodeURIComponent(t.role)}?section=pace-board`,className:"icon-link",title:"Configure this station",onClick:v=>v.stopPropagation(),children:e.jsx(Tt,{className:"w-3.5 h-3.5"})})}),e.jsx("span",{className:"w-3.5 flex items-center justify-center",children:f>0&&e.jsx(le,{to:ft(t),className:"text-status-error hover:opacity-70 transition-opacity",title:`${f} item${f===1?"":"s"} in jeopardy — pull oldest first`,onClick:v=>v.stopPropagation(),children:e.jsx(ot,{className:"w-3.5 h-3.5",strokeWidth:2})})})]})})]})}function et({n:t}){return t<=0?null:e.jsxs("span",{className:"inline-flex items-center gap-0.5 font-semibold tabular-nums",style:{color:be},title:`${t} in jeopardy`,children:[e.jsx(ot,{className:"w-3 h-3",strokeWidth:2.25}),t>9?"9+":t]})}function ws({fragments:t,aggregates:s,activeOrigin:r,onSelect:i}){const[a,c]=h.useState(!1),n=h.useRef(null);h.useEffect(()=>{if(!a)return;const x=w=>{n.current&&!n.current.contains(w.target)&&c(!1)},p=w=>{w.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",x),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",p)}},[a]);const o=t.find(x=>x.origin.role===r)??t[0];if(!o)return null;const d=s.get(o.origin.role);return e.jsxs("div",{ref:n,className:"relative px-4 pt-2",children:[e.jsxs("button",{type:"button",onClick:()=>c(x=>!x),className:"group flex items-baseline gap-2.5","aria-expanded":a,"aria-haspopup":"listbox",children:[e.jsx("span",{className:"text-sm font-medium text-text-primary group-hover:text-accent transition-colors",children:we(o.origin)}),e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary tabular-nums",children:[(d==null?void 0:d.stations)??o.stations.length," station",((d==null?void 0:d.stations)??o.stations.length)===1?"":"s"," · ",(d==null?void 0:d.pending)??0," pending"]}),e.jsx(et,{n:(d==null?void 0:d.jeopardy)??0}),e.jsx(ze,{className:`w-3.5 h-3.5 self-center shrink-0 text-text-tertiary group-hover:text-accent transition-transform ${a?"rotate-180":""}`,strokeWidth:1.5})]}),a&&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(x=>{const p=s.get(x.origin.role),w=x.origin.role===o.origin.role;return e.jsxs("button",{type:"button",role:"option","aria-selected":w,onClick:()=>{i(x.origin.role),c(!1)},className:`w-full text-left px-3 py-1.5 flex items-baseline gap-2.5 transition-colors ${w?"text-accent bg-accent/5":"text-text-primary hover:bg-surface-hover"}`,children:[e.jsx("span",{className:"text-xs font-medium truncate",children:we(x.origin)}),e.jsxs("span",{className:"ml-auto text-2xs font-mono text-text-quaternary tabular-nums shrink-0",children:[(p==null?void 0:p.stations)??x.stations.length," st · ",(p==null?void 0:p.pending)??0," pending"]}),e.jsx("span",{className:"w-12 shrink-0 text-left text-2xs",children:e.jsx(et,{n:(p==null?void 0:p.jeopardy)??0})})]},x.origin.role)})})]})}const Ns=[{label:"TARGET/H",band:gt,hue:de,w:"w-[8%]"},{label:"SLA/M",band:jt,hue:ys,w:"w-[7%]"},{label:"WORKERS",band:bt,hue:He,w:"w-[8%]"},{label:"PENDING",band:wt,hue:je,w:"w-[8%]"},{label:"CLAIMED",band:Nt,hue:ce,w:"w-[8%]"},{label:"RESOLVED",band:vt,hue:ee,w:"w-[8%]"}];function vs(t,s,r,i){if(!t||!s)return null;const a=t*s/60,c=r>0?r*s/(60*i):0;return Math.ceil(a+c)}const oe="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 ks(){return e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:`${oe} pl-3 pr-2 text-left text-text-quaternary`,children:"NAME"}),e.jsx("th",{className:`${oe} hidden xl:table-cell w-[12%] pr-2 text-left text-text-quaternary`,children:"ROLE"}),Ns.map(t=>e.jsx("th",{className:`${oe} ${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:`${oe} hidden xl:table-cell w-[8%] px-2 text-right text-text-quaternary`,children:"P99 WAIT"}),e.jsx("th",{className:`${oe} hidden xl:table-cell w-[8%] px-2 text-right text-text-quaternary`,children:"P99 WORK"}),e.jsx("th",{className:`${oe} hidden lg:table-cell w-[10%] px-2 text-left text-text-quaternary`,children:"MIX"}),e.jsx("th",{className:`${oe} hidden lg:table-cell w-[11%] px-2 text-left text-text-quaternary`,children:"TREND"}),e.jsx("th",{className:`${oe} w-20 px-1 text-center text-text-quaternary`,children:"ACTIONS"})]})})}function $s(){var ke;const[t,s]=h.useState("1h"),[r,i]=h.useState(null),[a,c]=h.useState(!1),[n,o]=h.useState(!0);Mt(),Ct();const{data:d,isLoading:x,refetch:p}=$t(),{data:w,isLoading:j,refetch:f}=st(t),q=(d==null?void 0:d.roles)??[],k=(w==null?void 0:w.stations)??[],R=h.useMemo(()=>{const u=new Map(k.map(y=>[y.role,y])),N=new Map;for(const y of De((d==null?void 0:d.roles)??[])){let pe=0,$e=0;for(const Se of y.stations){const K=u.get(Se.role.role);pe+=(K==null?void 0:K.pending)??0,$e+=(K==null?void 0:K.priority_count)??0}N.set(y.origin.role,{stations:y.stations.length,pending:pe,jeopardy:$e})}return N},[k,d]),$=h.useMemo(()=>De(q),[q]),[M,b]=lt(),F=M.get("fragment"),P=$.find(u=>u.origin.role===F)??$[0]??null,v=h.useCallback(u=>{i(null),b(N=>{const y=new URLSearchParams(N);return y.set("fragment",u),y})},[b]),L=(P==null?void 0:P.stations)??[],V=h.useMemo(()=>new Set(L.map(({role:u})=>u.role)),[L]),g=Ue(Re[t]),C=h.useMemo(()=>L.map(({role:u})=>u.role),[L]),{data:z}=B(C.length?{query:{roles:C},groupBy:{columns:["role","subtype"]},measure:{kind:"dwell",window:g}}:null),H=h.useMemo(()=>{const u=new Map;for(const N of(z==null?void 0:z.groups)??[]){if(!N.role)continue;const y=u.get(N.role)??[];y.push(N),u.set(N.role,y)}return u},[z]),fe=h.useMemo(()=>{const u=new Map;for(const[N,y]of H)u.set(N,at(y));return u},[H]),T=h.useMemo(()=>new Map,[]),ve=h.useMemo(()=>k.filter(u=>V.has(u.role)),[k,V]),_=h.useMemo(()=>L.map(({role:u})=>({role:u.role,title:u.title,parent_role:u.parent_role,target_per_hour:u.target_per_hour??null,upstream_roles:u.upstream_roles??[],metric:k.find(N=>N.role===u.role)})),[L,k]),se=h.useCallback(u=>{const N=$.find(y=>y.stations.some(({role:pe})=>pe.role===u));N&&v(N.origin.role)},[$,v]),X=Dt(),xe=((ke=L.find(({role:u})=>u.role===r))==null?void 0:ke.role)??null,ne=h.useMemo(()=>{const u=new Set;for(const N of q)N.ops_visible&&N.entity_facet&&u.add(N.entity_facet);return[...u].sort()},[q]),ue=M.get("lens"),Y=ue&&ne.includes(ue)?ue:null,l=h.useCallback(u=>{i(null),b(N=>{const y=new URLSearchParams(N);return u?y.set("lens",u):y.delete("lens"),y.delete("entity"),y.delete("find"),y.delete("slice"),y.delete("sliceValue"),y})},[b]),S=M.get("entity"),O=M.get("find"),U=h.useCallback(u=>{b(N=>{const y=new URLSearchParams(N);return u?y.set("entity",u):y.delete("entity"),y})},[b]),A=h.useCallback(u=>{b(N=>{const y=new URLSearchParams(N);return u?y.set("find",u):y.delete("find"),y},{replace:!0})},[b]),Z=M.get("slice"),W=M.get("sliceValue"),D=h.useCallback(u=>{b(N=>{const y=new URLSearchParams(N);return u?y.set("slice",u):y.delete("slice"),y.delete("sliceValue"),y})},[b]),J=h.useCallback(u=>{b(N=>{const y=new URLSearchParams(N);return u?y.set("sliceValue",u):y.delete("sliceValue"),y})},[b]),me=x||j,ye=async()=>{c(!0),await Promise.all([p(),f()]),c(!1)},ae=u=>i(N=>N===u?null:u),Q=e.jsx("div",{className:"flex items-center gap-0.5",children:gs.map(u=>e.jsx("button",{onClick:()=>s(u),className:`px-2.5 py-1 text-2xs font-mono rounded transition-colors ${t===u?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:u},u))});return e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx(Wt,{title:"Pace Board",docsHash:"#docs:dashboard.md:pace-board",center:Q,actions:e.jsx("button",{onClick:ye,disabled:a,className:"icon-link disabled:opacity-40",children:e.jsx(Bt,{className:`w-3.5 h-3.5 ${a?"animate-spin":""}`})})}),me?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(u=>e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-full"},u))})]}):$.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(le,{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:!Y&&$.length>1&&e.jsx(ws,{fragments:$,aggregates:R,activeOrigin:(P==null?void 0:P.origin.role)??null,onSelect:v})}),ne.length>0&&e.jsx("div",{className:"px-4 pt-2 pb-0.5",children:e.jsx(Jt,{lenses:ne,activeLens:Y,stationCount:L.length,onSelect:l})})]}),Y?e.jsx(Zt,{entityKey:Y,periodHours:Re[t],roles:q,find:O,onFindChange:A,entityValue:S,onEntityChange:U,sliceKey:Z,onSliceKeyChange:D,sliceValue:W,onSliceValueChange:J},Y):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 min-h-[40vh] flex items-stretch overflow-hidden",children:[e.jsxs("div",{className:"flex-1 min-w-0 min-h-0 flex flex-col overflow-hidden px-2 py-4",children:[e.jsx("div",{className:"flex items-center justify-center gap-0.5 pb-2 shrink-0",children:["lin","log"].map(u=>e.jsx("button",{onClick:()=>o(u==="log"),className:`px-2 py-0.5 text-2xs font-mono rounded transition-colors ${(n?"log":"lin")===u?"text-accent font-semibold":"icon-link"}`,title:u==="lin"?"Linear Y axis":"Logarithmic Y axis — reveals shape across wide value ranges",children:u},u))}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col justify-center overflow-hidden",children:e.jsx(is,{stations:_,selectedRole:r,onSelect:ae,onUpstreamSelect:se,onCmdClick:u=>X(`/escalations/available?role=${encodeURIComponent(u)}`),periodHours:Re[t],logScale:n})})]}),e.jsx("div",{className:"w-px bg-surface-border shrink-0 self-stretch"}),e.jsx(hs,{role:xe,allMetrics:ve,orderedRoles:L.map(u=>u.role),globalPeriod:t,mixGroups:z==null?void 0:z.groups,onClose:()=>i(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(ks,{}),e.jsx("tbody",{children:L.map(({role:u})=>e.jsx(bs,{role:u,metric:k.find(N=>N.role===u.role),mixGroups:H.get(u.role),mixColors:fe.get(u.role)??T,selected:r===u.role,periodHours:Re[t],onClick:()=>ae(u.role)},u.role))})]})})]})]})]})}const Ls=Object.freeze(Object.defineProperty({__proto__:null,OperationsPage:$s,buildFragments:De},Symbol.toStringTag,{value:"Module"}));export{Ls as O,is as P,De as b,ft as j};
|
|
3
|
+
//# sourceMappingURL=OperationsPage-Bsrt4XTL.js.map
|