@hotmeshio/long-tail 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/escalations/index.d.ts +1 -1
- package/build/api/escalations/index.js +2 -1
- package/build/api/escalations/list.d.ts +11 -0
- package/build/api/escalations/list.js +31 -2
- package/build/api/settings.js +2 -0
- package/build/api/users.d.ts +11 -0
- package/build/api/users.js +19 -0
- package/build/index.js +6 -0
- package/build/lib/uuid.d.ts +11 -0
- package/build/lib/uuid.js +20 -0
- package/build/modules/search.d.ts +21 -0
- package/build/modules/search.js +55 -0
- package/build/routes/escalations/list.js +10 -1
- package/build/routes/users.js +9 -0
- package/build/scripts/ortho-populate.d.ts +3 -1
- package/build/scripts/ortho-populate.js +15 -5
- package/build/sdk/index.d.ts +1 -0
- package/build/services/escalation/batch.js +3 -0
- package/build/services/escalation/bulk.js +8 -0
- package/build/services/escalation/crud.js +26 -0
- package/build/services/escalation/queries.d.ts +14 -1
- package/build/services/escalation/queries.js +49 -7
- package/build/services/escalation/sql.d.ts +4 -2
- package/build/services/escalation/sql.js +4 -0
- package/build/services/role/types.d.ts +18 -0
- package/build/services/role/types.js +6 -0
- package/build/services/user/auth.js +2 -2
- package/build/services/user/crud.d.ts +13 -0
- package/build/services/user/crud.js +26 -3
- package/build/services/user/index.d.ts +1 -1
- package/build/services/user/index.js +2 -1
- package/build/services/user/sql.d.ts +11 -5
- package/build/services/user/sql.js +18 -6
- package/build/start/adapters.js +2 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/startup.d.ts +12 -1
- package/dashboard/dist/assets/{AdminDashboard-mULAQuHV.js → AdminDashboard-DPkWtPc1.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-mULAQuHV.js.map → AdminDashboard-DPkWtPc1.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-DHdzgXcr.js → AgentConfigPage-DRfnLiQS.js} +6 -6
- package/dashboard/dist/assets/{AgentConfigPage-DHdzgXcr.js.map → AgentConfigPage-DRfnLiQS.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-Du_33U2u.js → AgentDetailPage-CufRZXnT.js} +3 -3
- package/dashboard/dist/assets/{AgentDetailPage-Du_33U2u.js.map → AgentDetailPage-CufRZXnT.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-4KkQO2Hl.js → AgentsPage-CoCWGhUd.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-4KkQO2Hl.js.map → AgentsPage-CoCWGhUd.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-BSqOctep.js +2 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-BSqOctep.js.map +1 -0
- package/dashboard/dist/assets/{BotPicker-BaFiLa-H.js → BotPicker-DMojDLlV.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-BaFiLa-H.js.map → BotPicker-DMojDLlV.js.map} +1 -1
- package/dashboard/dist/assets/BulkAssignModal-DYbM_6Or.js +2 -0
- package/dashboard/dist/assets/BulkAssignModal-DYbM_6Or.js.map +1 -0
- package/dashboard/dist/assets/CapabilitiesPage-CDQ5JHNP.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-Cewd6Uku.js.map → CapabilitiesPage-CDQ5JHNP.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-D1WIbyDa.js → CollapsibleSection-D4VlCEbD.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-D1WIbyDa.js.map → CollapsibleSection-D4VlCEbD.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-CQsJUzEa.js → ConfirmDeleteModal-DnNHjJtD.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-CQsJUzEa.js.map → ConfirmDeleteModal-DnNHjJtD.js.map} +1 -1
- package/dashboard/dist/assets/CountdownTimer-DPHMBmgz.js +2 -0
- package/dashboard/dist/assets/CountdownTimer-DPHMBmgz.js.map +1 -0
- package/dashboard/dist/assets/CredentialsPage-CSYZw-rL.js +2 -0
- package/dashboard/dist/assets/{CredentialsPage-CwtkQUG3.js.map → CredentialsPage-CSYZw-rL.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-CRC_uNuC.js → CronLabel-CpmqDrlJ.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-CRC_uNuC.js.map → CronLabel-CpmqDrlJ.js.map} +1 -1
- package/dashboard/dist/assets/{DropZone-Pv-v5RAs.js → DropZone-BbXlQnYB.js} +2 -2
- package/dashboard/dist/assets/{DropZone-Pv-v5RAs.js.map → DropZone-BbXlQnYB.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-CxAi0zN0.js → ElapsedCell-Cul22qBS.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-CxAi0zN0.js.map → ElapsedCell-Cul22qBS.js.map} +1 -1
- package/dashboard/dist/assets/EntityTimelinePanel-CtzpJ-j2.js +2 -0
- package/dashboard/dist/assets/EntityTimelinePanel-CtzpJ-j2.js.map +1 -0
- package/dashboard/dist/assets/{EscalationListSchemaPage--yZfsE8s.js → EscalationListSchemaPage-BZQ8Y_UH.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage--yZfsE8s.js.map → EscalationListSchemaPage-BZQ8Y_UH.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-CmoVqaS7.js → EscalationSchemaPage-CydTtq_A.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-CmoVqaS7.js.map → EscalationSchemaPage-CydTtq_A.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DDQTW6Jo.js → EscalationsOverview-DSYC0nI7.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DDQTW6Jo.js.map → EscalationsOverview-DSYC0nI7.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-C5jN7XT7.js → EventTable-s48cTXIw.js} +2 -2
- package/dashboard/dist/assets/{EventTable-C5jN7XT7.js.map → EventTable-s48cTXIw.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-CcIgQH9h.js → FilterBar-B61qKmFD.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-CcIgQH9h.js.map → FilterBar-B61qKmFD.js.map} +1 -1
- package/dashboard/dist/assets/GraphInvokePage-DxZv_KC2.js +2 -0
- package/dashboard/dist/assets/{GraphInvokePage-LACIxaiH.js.map → GraphInvokePage-DxZv_KC2.js.map} +1 -1
- package/dashboard/dist/assets/HomePage-zK3VP_9g.js +2 -0
- package/dashboard/dist/assets/HomePage-zK3VP_9g.js.map +1 -0
- package/dashboard/dist/assets/{ListToolbar-CLwSkmUH.js → ListToolbar-DaxloPQc.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-CLwSkmUH.js.map → ListToolbar-DaxloPQc.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-C2U1XfQw.js → McpOverview-Ciq8r6-p.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-C2U1XfQw.js.map → McpOverview-Ciq8r6-p.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-DYOK8A4D.js → McpQueryDetailPage-DIC0FEEb.js} +3 -3
- package/dashboard/dist/assets/{McpQueryDetailPage-DYOK8A4D.js.map → McpQueryDetailPage-DIC0FEEb.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryPage-BBy0NSNg.js +2 -0
- package/dashboard/dist/assets/{McpQueryPage-Ck75ikSd.js.map → McpQueryPage-BBy0NSNg.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-CA9gWQ4L.js → McpRunDetailPage-BqKNmIyW.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-CA9gWQ4L.js.map → McpRunDetailPage-BqKNmIyW.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-BhPshset.js → McpRunsPage-D0RlOpzR.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-BhPshset.js.map → McpRunsPage-D0RlOpzR.js.map} +1 -1
- package/dashboard/dist/assets/NamespacePill-Dbtm9R2T.js +2 -0
- package/dashboard/dist/assets/{NamespacePill-DONj6eUU.js.map → NamespacePill-Dbtm9R2T.js.map} +1 -1
- package/dashboard/dist/assets/OperationsPage-BX0SFizr.js +3 -0
- package/dashboard/dist/assets/OperationsPage-BX0SFizr.js.map +1 -0
- package/dashboard/dist/assets/OperatorDashboard-vXG0TjAQ.js +2 -0
- package/dashboard/dist/assets/{OperatorDashboard-DZOfHRE7.js.map → OperatorDashboard-vXG0TjAQ.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-CFVw67M6.js → PageHeader-xB92ELs3.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-CFVw67M6.js.map → PageHeader-xB92ELs3.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-D9tQxILm.js → PageHeaderWithStats-DVo_qqn1.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-D9tQxILm.js.map → PageHeaderWithStats-DVo_qqn1.js.map} +1 -1
- package/dashboard/dist/assets/PersonaDetailPage-w5TXcn4Q.js +2 -0
- package/dashboard/dist/assets/{PersonaDetailPage-eyHDupL0.js.map → PersonaDetailPage-w5TXcn4Q.js.map} +1 -1
- package/dashboard/dist/assets/PersonasPage-Dzcinl1L.js +2 -0
- package/dashboard/dist/assets/PersonasPage-Dzcinl1L.js.map +1 -0
- package/dashboard/dist/assets/{ProcessDetailPage-CKiAlpOc.js → ProcessDetailPage-BVXieFX1.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-CKiAlpOc.js.map → ProcessDetailPage-BVXieFX1.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-C4ueZJxU.js → ProcessesListPage-CKKNpk4z.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-C4ueZJxU.js.map → ProcessesListPage-CKKNpk4z.js.map} +1 -1
- package/dashboard/dist/assets/RoleDetailPage-BytSo-YE.js +8 -0
- package/dashboard/dist/assets/RoleDetailPage-BytSo-YE.js.map +1 -0
- package/dashboard/dist/assets/{RolePill-Di_5hfvw.js → RolePill-CYpL3a2d.js} +2 -2
- package/dashboard/dist/assets/{RolePill-Di_5hfvw.js.map → RolePill-CYpL3a2d.js.map} +1 -1
- package/dashboard/dist/assets/RolesPage-eayR9H4f.js +2 -0
- package/dashboard/dist/assets/{RolesPage-B3-9Ek0F.js.map → RolesPage-eayR9H4f.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-1k1J1_cv.js → RunAsSelector-D7RPwaAl.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-1k1J1_cv.js.map → RunAsSelector-D7RPwaAl.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-CeuVKnpu.js → ScanCodesPage-C8-ZBXF5.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-CeuVKnpu.js.map → ScanCodesPage-C8-ZBXF5.js.map} +1 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-tQhEgFKf.js +2 -0
- package/dashboard/dist/assets/{ScanSchemeDetailPage-BnivPUJY.js.map → ScanSchemeDetailPage-tQhEgFKf.js.map} +1 -1
- package/dashboard/dist/assets/ScanStationPage-CuhqsBKo.js +2 -0
- package/dashboard/dist/assets/{ScanStationPage-DCSA7pcV.js.map → ScanStationPage-CuhqsBKo.js.map} +1 -1
- package/dashboard/dist/assets/{ScopeBadge-CqIIeWjK.js → ScopeBadge-BmNzZlSj.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-CqIIeWjK.js.map → ScopeBadge-BmNzZlSj.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-BWuKz8uB.js → StickyPagination-BIVTAMnP.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-BWuKz8uB.js.map → StickyPagination-BIVTAMnP.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-Cq6AGhgJ.js → StreamMessageDetail-CYSC2cO1.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-Cq6AGhgJ.js.map → StreamMessageDetail-CYSC2cO1.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-DM88avgt.js → SwimlaneTimeline-BMZAs_2K.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-DM88avgt.js.map → SwimlaneTimeline-BMZAs_2K.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-BLwxTNsI.js → TagInput-D1uszNd2.js} +2 -2
- package/dashboard/dist/assets/{TagInput-BLwxTNsI.js.map → TagInput-D1uszNd2.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-Caqe3fG8.js → TaskDetailPage-CVUDUU5Q.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-Caqe3fG8.js.map → TaskDetailPage-CVUDUU5Q.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-DVgcqd-h.js → TaskQueuePill-C2H8oRfn.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-DVgcqd-h.js.map → TaskQueuePill-C2H8oRfn.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-DlQwpXOL.js → TasksListPage-DEQymbXC.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-DlQwpXOL.js.map → TasksListPage-DEQymbXC.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-BinTjiVC.js → TimeAgo-CCxP67Rb.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-BinTjiVC.js.map → TimeAgo-CCxP67Rb.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-DDcfSVeQ.js → TimestampCell-CE5ZUYhV.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-DDcfSVeQ.js.map → TimestampCell-CE5ZUYhV.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-C6hkOqPx.js → ToolPill-D-h8AoB8.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-C6hkOqPx.js.map → ToolPill-D-h8AoB8.js.map} +1 -1
- package/dashboard/dist/assets/ToolTestPanel-BHuQTyBY.js +2 -0
- package/dashboard/dist/assets/{ToolTestPanel-CZvegH_w.js.map → ToolTestPanel-BHuQTyBY.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-CShiCwz8.js → TopicDetailPage-SFuiludx.js} +3 -3
- package/dashboard/dist/assets/{TopicDetailPage-CShiCwz8.js.map → TopicDetailPage-SFuiludx.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-CAYxRRbI.js → TopicsPage-DO8pUmng.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-CAYxRRbI.js.map → TopicsPage-DO8pUmng.js.map} +1 -1
- package/dashboard/dist/assets/UserName-CsLnT75E.js +2 -0
- package/dashboard/dist/assets/UserName-CsLnT75E.js.map +1 -0
- package/dashboard/dist/assets/{WorkflowExecutionPage-DNdXEFcB.js → WorkflowExecutionPage-BttnEvOd.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-DNdXEFcB.js.map → WorkflowExecutionPage-BttnEvOd.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-CN-952iI.js → WorkflowPill-CZvBbkn4.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill-CN-952iI.js.map → WorkflowPill-CZvBbkn4.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-D7DPDeuQ.js → WorkflowsDashboard-BRboBhlK.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-D7DPDeuQ.js.map → WorkflowsDashboard-BRboBhlK.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-C7Z0SpDH.js → WorkflowsOverview-CDFTYeQo.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-C7Z0SpDH.js.map → WorkflowsOverview-CDFTYeQo.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-Bxklswko.js → YamlWorkflowDetailPage-CmnZFevp.js} +11 -11
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-Bxklswko.js.map → YamlWorkflowDetailPage-CmnZFevp.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-CkArsPbi.js → YamlWorkflowsPage-Qq1jfcrH.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-CkArsPbi.js.map → YamlWorkflowsPage-Qq1jfcrH.js.map} +1 -1
- package/dashboard/dist/assets/{agents-Ca0hOp2Y.js → agents-C7vUIO7e.js} +2 -2
- package/dashboard/dist/assets/{agents-Ca0hOp2Y.js.map → agents-C7vUIO7e.js.map} +1 -1
- package/dashboard/dist/assets/{bots-9GtbGtH9.js → bots-BaOblnW4.js} +2 -2
- package/dashboard/dist/assets/{bots-9GtbGtH9.js.map → bots-BaOblnW4.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-C0RpEvyY.js → capabilities-RZpmDWoy.js} +2 -2
- package/dashboard/dist/assets/{capabilities-C0RpEvyY.js.map → capabilities-RZpmDWoy.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-ClQiKGyQ.js → controlplane-BwGdcwXR.js} +2 -2
- package/dashboard/dist/assets/{controlplane-ClQiKGyQ.js.map → controlplane-BwGdcwXR.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-B4DG_5v8.js +2 -0
- package/dashboard/dist/assets/escalation-columns-B4DG_5v8.js.map +1 -0
- package/dashboard/dist/assets/index-8LIpvj2e.js +3 -0
- package/dashboard/dist/assets/index-8LIpvj2e.js.map +1 -0
- package/dashboard/dist/assets/index-BICLHYJJ.js +2 -0
- package/dashboard/dist/assets/{index-BLLK2mzy.js.map → index-BICLHYJJ.js.map} +1 -1
- package/dashboard/dist/assets/{index-BLCFN3YR.js → index-BQPUlmmz.js} +2 -2
- package/dashboard/dist/assets/{index-BLCFN3YR.js.map → index-BQPUlmmz.js.map} +1 -1
- package/dashboard/dist/assets/index-BaC3sbJH.js +67 -0
- package/dashboard/dist/assets/index-BaC3sbJH.js.map +1 -0
- package/dashboard/dist/assets/index-BuqpU6ow.js +2 -0
- package/dashboard/dist/assets/{index-DEr9QjVv.js.map → index-BuqpU6ow.js.map} +1 -1
- package/dashboard/dist/assets/index-CD6jtND1.css +1 -0
- package/dashboard/dist/assets/{index-Ba3UsZzz.js → index-CsIw-ZLk.js} +4 -4
- package/dashboard/dist/assets/{index-Ba3UsZzz.js.map → index-CsIw-ZLk.js.map} +1 -1
- package/dashboard/dist/assets/index-CtJkvX9e.js +5 -0
- package/dashboard/dist/assets/{index-Ct_8Tpec.js.map → index-CtJkvX9e.js.map} +1 -1
- package/dashboard/dist/assets/index-D9NtDRtp.js +2 -0
- package/dashboard/dist/assets/{index-BoQirCxt.js.map → index-D9NtDRtp.js.map} +1 -1
- package/dashboard/dist/assets/{index-CeHOGQM4.js → index-DU9-flEo.js} +2 -2
- package/dashboard/dist/assets/{index-CeHOGQM4.js.map → index-DU9-flEo.js.map} +1 -1
- package/dashboard/dist/assets/{index-P1g8r09L.js → index-G3NmdMjt.js} +2 -2
- package/dashboard/dist/assets/{index-P1g8r09L.js.map → index-G3NmdMjt.js.map} +1 -1
- package/dashboard/dist/assets/index-IWufkcH9.js +2 -0
- package/dashboard/dist/assets/{index-DlzW75L4.js.map → index-IWufkcH9.js.map} +1 -1
- package/dashboard/dist/assets/index-iegzyfMv.js +2 -0
- package/dashboard/dist/assets/{index-B-Qpr29t.js.map → index-iegzyfMv.js.map} +1 -1
- package/dashboard/dist/assets/index-xNFTmmsv.js +2 -0
- package/dashboard/dist/assets/{index-CG8oLNHo.js.map → index-xNFTmmsv.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-DzueDGkw.js → knowledge-CjwCbm3E.js} +2 -2
- package/dashboard/dist/assets/{knowledge-DzueDGkw.js.map → knowledge-CjwCbm3E.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-CCOzN8dH.js → mcp-C-DMktCT.js} +2 -2
- package/dashboard/dist/assets/{mcp-CCOzN8dH.js.map → mcp-C-DMktCT.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-UeMDiM6I.js → mcp-query-KBeBNHb4.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-UeMDiM6I.js.map → mcp-query-KBeBNHb4.js.map} +1 -1
- package/dashboard/dist/assets/{personas-CKcrzaQX.js → personas-B32sSCxm.js} +2 -2
- package/dashboard/dist/assets/{personas-CKcrzaQX.js.map → personas-B32sSCxm.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-orE-1gpj.js → pipelines-DNLwDumm.js} +2 -2
- package/dashboard/dist/assets/{pipelines-orE-1gpj.js.map → pipelines-DNLwDumm.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-ZOmzxynB.js → tasks-DrWSrjmj.js} +2 -2
- package/dashboard/dist/assets/{tasks-ZOmzxynB.js.map → tasks-DrWSrjmj.js.map} +1 -1
- package/dashboard/dist/assets/{topics-CdYaOCi_.js → topics-DgzGU-vR.js} +2 -2
- package/dashboard/dist/assets/{topics-CdYaOCi_.js.map → topics-DgzGU-vR.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-D-uGnSj5.js → useDebouncedValue-DG5JOj1F.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-D-uGnSj5.js.map → useDebouncedValue-DG5JOj1F.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-DMrjlrJJ.js → useNamespace-CdgF7Jxo.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-DMrjlrJJ.js.map → useNamespace-CdgF7Jxo.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-ByyQgu8S.js → useYamlActivityEvents-BEaOtgSZ.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-ByyQgu8S.js.map → useYamlActivityEvents-BEaOtgSZ.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-h-jlRSb9.js → vendor-icons-BCWsItQ7.js} +138 -133
- package/dashboard/dist/assets/{vendor-icons-h-jlRSb9.js.map → vendor-icons-BCWsItQ7.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-CLn05FRV.js → workflows-CX_oarls.js} +2 -2
- package/dashboard/dist/assets/{workflows-CLn05FRV.js.map → workflows-CX_oarls.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-DFD_HO__.js → yaml-workflows-YASUDPo0.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-DFD_HO__.js.map → yaml-workflows-YASUDPo0.js.map} +1 -1
- package/dashboard/dist/index.html +3 -3
- package/docs/dashboard.md +164 -69
- package/docs/faceted-routing.md +38 -0
- package/docs/hitl/x-lt-list-schema.md +3 -0
- package/docs/operations.md +61 -60
- package/docs/scan-codes.md +18 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-CjcAIm-d.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-CjcAIm-d.js.map +0 -1
- package/dashboard/dist/assets/BulkAssignModal-DNmji4l-.js +0 -2
- package/dashboard/dist/assets/BulkAssignModal-DNmji4l-.js.map +0 -1
- package/dashboard/dist/assets/CapabilitiesPage-Cewd6Uku.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-BKMmFie6.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-BKMmFie6.js.map +0 -1
- package/dashboard/dist/assets/CredentialsPage-CwtkQUG3.js +0 -2
- package/dashboard/dist/assets/EntityTimelinePanel-DzMuV7ZX.js +0 -2
- package/dashboard/dist/assets/EntityTimelinePanel-DzMuV7ZX.js.map +0 -1
- package/dashboard/dist/assets/GraphInvokePage-LACIxaiH.js +0 -2
- package/dashboard/dist/assets/HomePage-DP9Q-x4a.js +0 -2
- package/dashboard/dist/assets/HomePage-DP9Q-x4a.js.map +0 -1
- package/dashboard/dist/assets/McpQueryPage-Ck75ikSd.js +0 -2
- package/dashboard/dist/assets/Modal-BU7No9NH.js +0 -2
- package/dashboard/dist/assets/Modal-BU7No9NH.js.map +0 -1
- package/dashboard/dist/assets/NamespacePill-DONj6eUU.js +0 -2
- package/dashboard/dist/assets/OperationsPage-MlMzl0Bf.js +0 -3
- package/dashboard/dist/assets/OperationsPage-MlMzl0Bf.js.map +0 -1
- package/dashboard/dist/assets/OperatorDashboard-DZOfHRE7.js +0 -2
- package/dashboard/dist/assets/PersonaDetailPage-eyHDupL0.js +0 -2
- package/dashboard/dist/assets/PersonasPage-CCtRkWiP.js +0 -2
- package/dashboard/dist/assets/PersonasPage-CCtRkWiP.js.map +0 -1
- package/dashboard/dist/assets/RoleDetailPage-BOccQCkx.js +0 -8
- package/dashboard/dist/assets/RoleDetailPage-BOccQCkx.js.map +0 -1
- package/dashboard/dist/assets/RolesPage-B3-9Ek0F.js +0 -2
- package/dashboard/dist/assets/ScanSchemeDetailPage-BnivPUJY.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-DCSA7pcV.js +0 -2
- package/dashboard/dist/assets/ToolTestPanel-CZvegH_w.js +0 -2
- package/dashboard/dist/assets/UserName-BovQxdSY.js +0 -2
- package/dashboard/dist/assets/UserName-BovQxdSY.js.map +0 -1
- package/dashboard/dist/assets/escalation-columns-CZ12_oQF.js +0 -2
- package/dashboard/dist/assets/escalation-columns-CZ12_oQF.js.map +0 -1
- package/dashboard/dist/assets/index-B-Qpr29t.js +0 -2
- package/dashboard/dist/assets/index-BLLK2mzy.js +0 -2
- package/dashboard/dist/assets/index-BoQirCxt.js +0 -2
- package/dashboard/dist/assets/index-C1oOLjdF.js +0 -3
- package/dashboard/dist/assets/index-C1oOLjdF.js.map +0 -1
- package/dashboard/dist/assets/index-CG8oLNHo.js +0 -2
- package/dashboard/dist/assets/index-CdavRyaX.js +0 -67
- package/dashboard/dist/assets/index-CdavRyaX.js.map +0 -1
- package/dashboard/dist/assets/index-Ct_8Tpec.js +0 -5
- package/dashboard/dist/assets/index-DEr9QjVv.js +0 -2
- package/dashboard/dist/assets/index-DlzW75L4.js +0 -2
- package/dashboard/dist/assets/index-fUqvRHOe.css +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l,j as e}from"./vendor-query-RUZdMvN6.js";import{d as L,e as A,b as I,c as T,u as U}from"./personas-CKcrzaQX.js";import{F as K,a as D}from"./FilterBar-CcIgQH9h.js";import{P as q}from"./PageHeader-CFVw67M6.js";import{R as O}from"./RolePill-Di_5hfvw.js";import{aj as F,e as M,a5 as H}from"./index-CdavRyaX.js";import{M as V}from"./Modal-BU7No9NH.js";import{u as R}from"./vendor-react-CdqEC2zv.js";import{u as W}from"./useDebouncedValue-D-uGnSj5.js";import{X as z,a7 as G}from"./vendor-icons-h-jlRSb9.js";function Y({open:s,onClose:u}){const r=R(),t=L(),[o,c]=l.useState(""),[n,a]=l.useState(""),[d,i]=l.useState(""),[f,h]=l.useState(s);s!==f&&(h(s),s&&(c(""),a(""),i(""),t.reset()));const g=()=>{const m=o.trim().toLowerCase();m&&t.mutate({key:m,title:n.trim()||void 0,description:d.trim()||void 0},{onSuccess:()=>{u(),r(`/admin/personas/${encodeURIComponent(m)}`)}})};return e.jsx(V,{open:s,onClose:u,title:"Create Persona",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Key (required)"}),e.jsx("input",{type:"text",value:o,onChange:m=>c(m.target.value),placeholder:"e.g., floor-manager",className:"input text-xs w-full font-mono",onKeyDown:m=>{m.key==="Enter"&&g()}}),e.jsx("p",{className:"text-2xs text-text-tertiary mt-1",children:"Lowercase letters, numbers, hyphens, and underscores only. Stable — it names the persona everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Title"}),e.jsx("input",{type:"text",value:n,onChange:m=>a(m.target.value),placeholder:"e.g., Floor Manager",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("textarea",{value:d,onChange:m=>i(m.target.value),placeholder:"The day in the life, one paragraph.",rows:3,className:"input text-xs w-full resize-y"})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:u,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:g,disabled:!o.trim()||t.isPending,className:"btn-primary text-xs",children:t.isPending?"Creating...":"Create"})]})]})})}function X({selected:s,onSelect:u,excludeIds:r=[],placeholder:t="Search users…"}){const[o,c]=l.useState(!1),[n,a]=l.useState(""),d=l.useRef(null),i=W(n),f=20,{data:h,isFetching:g}=F({search:i.trim()||void 0,limit:f});l.useEffect(()=>{if(!o)return;function x(v){d.current&&!d.current.contains(v.target)&&c(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]);const m=l.useMemo(()=>new Set(r),[r]),y=((h==null?void 0:h.users)??[]).filter(x=>!m.has(x.id)),p=(h==null?void 0:h.total)??0,b=p>((h==null?void 0:h.users.length)??0),j=(s==null?void 0:s.label)??"",N=o?n:j;return e.jsxs("div",{ref:d,className:"relative",children:[e.jsx("input",{type:"text",value:N,onFocus:()=>{c(!0),a("")},onChange:x=>{a(x.target.value),x.target.value||u(null),o||c(!0)},placeholder:t,className:"input text-xs w-full min-w-0","aria-label":"User"}),o&&e.jsxs("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:[y.map(x=>{const v=x.display_name||x.external_id;return e.jsxs("button",{type:"button",onClick:()=>{u({id:x.id,label:v}),a(""),c(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 min-w-0 ${(s==null?void 0:s.id)===x.id?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-xs text-text-primary truncate",children:v}),x.email&&e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:x.email})]},x.id)}),y.length===0&&e.jsx("p",{className:"px-3 py-4 text-center text-2xs text-text-quaternary",children:g?"Searching…":n?`No users match "${n}"`:"No users available"}),b&&e.jsxs("p",{className:"px-3 py-1.5 text-2xs text-text-quaternary border-t border-surface-border/60 tabular-nums",children:[y.length," of ",p," — type to narrow"]})]})]})}const S="text-2xs font-semibold uppercase tracking-widest text-text-tertiary";function B({personaKey:s,onClose:u}){const{data:r}=A(s??""),t=I(),o=T(),[c,n]=l.useState(null),a=(r==null?void 0:r.assignees)??[],d=()=>{!r||!c||t.mutate({userId:c.id,key:r.key},{onSuccess:()=>n(null)})};return e.jsxs("div",{className:"h-full overflow-y-auto px-5 pt-4 pb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("p",{className:S,children:"Assignees"}),u&&e.jsx("button",{onClick:u,className:"icon-link",title:"Close","aria-label":"Close",children:e.jsx(z,{className:"w-4 h-4"})})]}),r?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-text-primary",children:r.title||r.key}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-0.5",children:[r.roles.length," role",r.roles.length===1?"":"s"," per assignment"]})]}),a.length===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Assign a user to compose their whole surface in one step."}):e.jsx("div",{className:"flex flex-col gap-2",children:a.map(i=>e.jsxs("span",{className:"flex items-center gap-2.5 w-full min-w-0 pl-2.5 pr-2 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate",title:i.external_id,children:i.display_name||i.external_id}),e.jsx("span",{className:"shrink-0 text-2xs text-text-tertiary",children:e.jsx(M,{date:i.assigned_at})}),e.jsx("button",{onClick:()=>o.mutate({userId:i.id,key:r.key}),className:"shrink-0 text-text-tertiary hover:text-status-error transition-colors ml-1",title:`Unassign ${i.display_name||i.external_id}`,children:"×"})]},i.id))}),e.jsxs("div",{className:"pt-3 border-t border-surface-border space-y-2",children:[e.jsx("p",{className:S,children:"Assign User"}),e.jsx(X,{selected:c,onSelect:n,excludeIds:a.map(i=>i.id)}),e.jsx("div",{className:"flex justify-end pt-1",children:e.jsx("button",{onClick:d,disabled:!c||t.isPending,className:"btn-primary text-xs",children:t.isPending?"...":"Assign"})}),(t.error||o.error)&&e.jsx("p",{className:"text-2xs text-status-error",children:(t.error||o.error).message})]})]}):e.jsx("p",{className:"text-xs text-text-tertiary",children:"Select a persona to assign users. An assignee joins every linked role at its scope — sidebar pins and forms compose from the roles."})]})}const $="persona-assignees",_="180px 140px 1fr 220px 56px 40px",E="text-text-secondary transition-colors group-hover/row:text-text-primary",P="text-2xs font-semibold uppercase tracking-widest text-text-quaternary",w="py-2",C="py-2.5";function k(s){return s.title?s.title:s.key.replace(/[-_]+/g," ").replace(/\b\w/g,u=>u.toUpperCase())}function J(){return e.jsxs("div",{className:"grid gap-4 px-3 border-b border-surface-border bg-surface",style:{gridTemplateColumns:_},children:[e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Persona"}),e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Key"}),e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Description"}),e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Roles"}),e.jsx("span",{className:`${P} ${w} flex items-center justify-end`,children:"Users"}),e.jsx("span",{className:w})]})}const Q=3;function Z({persona:s,active:u,onClick:r,onConfigure:t}){const o=s.roles??[],c=o.slice(0,Q),n=o.length-c.length;return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&r()},className:`grid gap-4 px-3 cursor-pointer group/row transition-colors ${u?"bg-surface-hover/60":"hover:bg-surface-hover/30"}`,style:{gridTemplateColumns:_},children:[e.jsx("span",{className:`flex items-center min-w-0 text-sm truncate ${C} ${E}`,children:k(s)}),e.jsx("span",{className:`flex items-center text-xs font-mono truncate ${C} text-text-tertiary transition-colors group-hover/row:text-text-secondary`,children:s.key}),e.jsx("span",{className:`flex items-center min-w-0 text-xs text-text-tertiary truncate ${C} transition-colors group-hover/row:text-text-secondary`,children:s.description??""}),e.jsxs("div",{className:`flex items-center flex-wrap gap-x-2.5 gap-y-0.5 min-w-0 ${C}`,children:[c.map(a=>e.jsx("span",{className:"min-w-0 truncate text-text-secondary",children:e.jsx(O,{role:a.role,tone:"inherit"})},a.role)),n>0&&e.jsxs("span",{className:"text-2xs text-text-quaternary tabular-nums",children:["+",n]})]}),e.jsx("span",{className:`flex items-center justify-end text-sm tabular-nums ${C} transition-colors ${E}`,children:s.user_count>0?s.user_count:""}),e.jsx("span",{className:`flex items-center justify-end ${C}`,children:e.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-text-quaternary/70 hover:text-accent transition-colors",title:`Configure ${k(s)}`,"aria-label":`Configure ${k(s)}`,children:e.jsx(G,{className:"w-3.5 h-3.5",strokeWidth:1.5})})})]})}function xe(){const s=R(),{data:u,isLoading:r}=U(),t=H(),[o,c]=l.useState(!1),[n,a]=l.useState(""),[d,i]=l.useState(null),f=(u==null?void 0:u.personas)??[],h=l.useRef(null),g=l.useRef(!1);l.useEffect(()=>{t&&d!==h.current&&(h.current=d,d?t.setPanel(e.jsx(B,{personaKey:d,onClose:()=>i(null)}),{key:$,width:360}):(g.current=!1,t.closePanel($)))},[d,t]),l.useEffect(()=>{if(!(!t||!d)){if(t.open&&t.ownerKey===$){g.current=!0;return}g.current&&(g.current=!1,i(null))}},[t,d]);const m=l.useRef(t);m.current=t,l.useEffect(()=>()=>{var p;h.current&&((p=m.current)==null||p.closePanel($))},[]);const y=l.useMemo(()=>{const p=[...f].sort((j,N)=>k(j).localeCompare(k(N)));if(!n.trim())return p;const b=n.toLowerCase();return p.filter(j=>{var N,x;return j.key.toLowerCase().includes(b)||k(j).toLowerCase().includes(b)||((N=j.description)==null?void 0:N.toLowerCase().includes(b))||((x=j.roles)==null?void 0:x.some(v=>v.role.toLowerCase().includes(b)))})},[f,n]);return e.jsxs("div",{children:[e.jsx(q,{title:"Personas",docsHash:"#docs:dashboard.md:personas",actions:e.jsx("button",{onClick:()=>c(!0),className:"btn-primary text-xs flex items-center gap-1.5",children:"+ Add Persona"})}),!r&&f.length>0&&e.jsxs(K,{children:[e.jsx(D,{label:"Search",value:n,onChange:a,placeholder:`${f.length} personas…`}),n&&y.length!==f.length&&e.jsxs("span",{className:"text-2xs text-text-quaternary tabular-nums shrink-0",children:[y.length," of ",f.length]})]}),e.jsxs("div",{className:"overflow-x-clip",children:[!r&&f.length>0&&y.length>0&&e.jsx("div",{className:"sticky top-[60px] z-10 bg-surface",children:e.jsx(J,{})}),r?e.jsx("div",{className:"animate-pulse space-y-3 mt-6",children:[1,2,3].map(p=>e.jsx("div",{className:"h-10 bg-surface-sunken rounded w-full"},p))}):y.length===0?e.jsx("p",{className:"text-sm text-text-tertiary mt-8",children:n?"Clear the search to see all personas.":"Create a persona to bundle roles into a one-step assignment."}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:y.map(p=>e.jsx(Z,{persona:p,active:p.key===d,onClick:()=>i(p.key),onConfigure:()=>s(`/admin/personas/${encodeURIComponent(p.key)}`)},p.key))})]}),e.jsx(Y,{open:o,onClose:()=>c(!1)})]})}export{xe as PersonasPage};
|
|
2
|
-
//# sourceMappingURL=PersonasPage-CCtRkWiP.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PersonasPage-CCtRkWiP.js","sources":["../../src/pages/admin/personas/CreatePersonaModal.tsx","../../src/components/common/form/UserCombobox.tsx","../../src/pages/admin/personas/AssigneesPanel.tsx","../../src/pages/admin/personas/PersonasPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useCreatePersona } from '../../../api/personas';\nimport { Modal } from '../../../components/common/modal/Modal';\n\nexport function CreatePersonaModal({\n open,\n onClose,\n}: {\n open: boolean;\n onClose: () => void;\n}) {\n const navigate = useNavigate();\n const createPersona = useCreatePersona();\n const [key, setKey] = useState('');\n const [title, setTitle] = useState('');\n const [description, setDescription] = useState('');\n\n const [prevOpen, setPrevOpen] = useState(open);\n if (open !== prevOpen) {\n setPrevOpen(open);\n if (open) {\n setKey('');\n setTitle('');\n setDescription('');\n createPersona.reset();\n }\n }\n\n const handleCreate = () => {\n const trimmed = key.trim().toLowerCase();\n if (!trimmed) return;\n createPersona.mutate(\n {\n key: trimmed,\n title: title.trim() || undefined,\n description: description.trim() || undefined,\n },\n {\n onSuccess: () => {\n onClose();\n // Land on the detail page to link roles right away.\n navigate(`/admin/personas/${encodeURIComponent(trimmed)}`);\n },\n },\n );\n };\n\n return (\n <Modal open={open} onClose={onClose} title=\"Create Persona\">\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1\">\n Key (required)\n </label>\n <input\n type=\"text\"\n value={key}\n onChange={(e) => setKey(e.target.value)}\n placeholder=\"e.g., floor-manager\"\n className=\"input text-xs w-full font-mono\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleCreate();\n }}\n />\n <p className=\"text-2xs text-text-tertiary mt-1\">\n Lowercase letters, numbers, hyphens, and underscores only. Stable — it names the persona everywhere.\n </p>\n </div>\n\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1\">\n Title\n </label>\n <input\n type=\"text\"\n value={title}\n onChange={(e) => setTitle(e.target.value)}\n placeholder=\"e.g., Floor Manager\"\n className=\"input text-xs w-full\"\n />\n </div>\n\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1\">\n Description\n </label>\n <textarea\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n placeholder=\"The day in the life, one paragraph.\"\n rows={3}\n className=\"input text-xs w-full resize-y\"\n />\n </div>\n\n {createPersona.error && (\n <p className=\"text-xs text-status-error\">{(createPersona.error as Error).message}</p>\n )}\n\n <div className=\"flex justify-end gap-3 pt-2\">\n <button onClick={onClose} className=\"btn-secondary text-xs\">\n Cancel\n </button>\n <button\n onClick={handleCreate}\n disabled={!key.trim() || createPersona.isPending}\n className=\"btn-primary text-xs\"\n >\n {createPersona.isPending ? 'Creating...' : 'Create'}\n </button>\n </div>\n </div>\n </Modal>\n );\n}\n","import { useState, useRef, useEffect, useMemo } from 'react';\nimport { useUsers } from '../../../api/users';\nimport { useDebouncedValue } from '../../../hooks/useDebouncedValue';\n\nexport interface UserComboboxSelection {\n id: string;\n label: string;\n}\n\n/**\n * Searchable inline combobox for picking a user account. The filter drives the\n * server-side account search (name, email, external_id), so the list stays\n * bounded no matter how many accounts exist; a footer line discloses when more\n * matches remain than the page shows. Styled to match CapabilityCombobox.\n */\nexport function UserCombobox({ selected, onSelect, excludeIds = [], placeholder = 'Search users…' }: {\n selected: UserComboboxSelection | null;\n onSelect: (user: UserComboboxSelection | null) => void;\n /** Accounts to hide from the results (e.g. already assigned). */\n excludeIds?: string[];\n placeholder?: string;\n}) {\n const [open, setOpen] = useState(false);\n const [filter, setFilter] = useState('');\n const containerRef = useRef<HTMLDivElement>(null);\n\n const debounced = useDebouncedValue(filter);\n const PAGE = 20;\n const { data, isFetching } = useUsers({\n search: debounced.trim() || undefined,\n limit: PAGE,\n });\n\n // Close on outside click\n useEffect(() => {\n if (!open) return;\n function handleClick(e: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setOpen(false);\n }\n }\n document.addEventListener('mousedown', handleClick);\n return () => document.removeEventListener('mousedown', handleClick);\n }, [open]);\n\n const excluded = useMemo(() => new Set(excludeIds), [excludeIds]);\n const users = (data?.users ?? []).filter((u) => !excluded.has(u.id));\n const total = data?.total ?? 0;\n const truncated = total > (data?.users.length ?? 0);\n\n const displayValue = selected?.label ?? '';\n const filterText = open ? filter : displayValue;\n\n return (\n <div ref={containerRef} className=\"relative\">\n <input\n type=\"text\"\n value={filterText}\n onFocus={() => { setOpen(true); setFilter(''); }}\n onChange={(e) => {\n setFilter(e.target.value);\n if (!e.target.value) onSelect(null);\n if (!open) setOpen(true);\n }}\n placeholder={placeholder}\n className=\"input text-xs w-full min-w-0\"\n aria-label=\"User\"\n />\n\n {open && (\n <div className=\"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg\">\n {users.map((u) => {\n const label = u.display_name || u.external_id;\n return (\n <button\n key={u.id}\n type=\"button\"\n onClick={() => {\n onSelect({ id: u.id, label });\n setFilter('');\n setOpen(false);\n }}\n className={`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 min-w-0 ${\n selected?.id === u.id ? 'bg-accent/5' : ''\n }`}\n >\n <span className=\"text-xs text-text-primary truncate\">{label}</span>\n {u.email && (\n <span className=\"text-2xs text-text-quaternary truncate\">{u.email}</span>\n )}\n </button>\n );\n })}\n\n {users.length === 0 && (\n <p className=\"px-3 py-4 text-center text-2xs text-text-quaternary\">\n {isFetching ? 'Searching…' : filter ? `No users match \"${filter}\"` : 'No users available'}\n </p>\n )}\n\n {truncated && (\n <p className=\"px-3 py-1.5 text-2xs text-text-quaternary border-t border-surface-border/60 tabular-nums\">\n {users.length} of {total} — type to narrow\n </p>\n )}\n </div>\n )}\n </div>\n );\n}\n","import { useState } from 'react';\nimport { X } from 'lucide-react';\nimport { usePersona, useAssignPersona, useUnassignPersona } from '../../../api/personas';\nimport { DateValue } from '../../../components/common/display/DateValue';\nimport { UserCombobox, type UserComboboxSelection } from '../../../components/common/form/UserCombobox';\n\nconst SECTION_HDR = 'text-2xs font-semibold uppercase tracking-widest text-text-tertiary';\n\n/**\n * The 90% surface: pick a persona in the list, assign a user, and they get\n * every linked role — pins, list schemas, and forms compose from the roles.\n * Rendered in the global shell right panel (key 'persona-assignees').\n */\nexport function AssigneesPanel({\n personaKey,\n onClose,\n}: {\n personaKey: string | null;\n onClose?: () => void;\n}) {\n const { data: persona } = usePersona(personaKey ?? '');\n const assign = useAssignPersona();\n const unassign = useUnassignPersona();\n const [pendingUser, setPendingUser] = useState<UserComboboxSelection | null>(null);\n\n const assignees = persona?.assignees ?? [];\n\n const handleAssign = () => {\n if (!persona || !pendingUser) return;\n assign.mutate(\n { userId: pendingUser.id, key: persona.key },\n { onSuccess: () => setPendingUser(null) },\n );\n };\n\n return (\n <div className=\"h-full overflow-y-auto px-5 pt-4 pb-6\">\n <div className=\"flex items-center justify-between mb-4\">\n <p className={SECTION_HDR}>Assignees</p>\n {onClose && (\n <button onClick={onClose} className=\"icon-link\" title=\"Close\" aria-label=\"Close\">\n <X className=\"w-4 h-4\" />\n </button>\n )}\n </div>\n\n {!persona ? (\n <p className=\"text-xs text-text-tertiary\">\n Select a persona to assign users. An assignee joins every linked role\n at its scope — sidebar pins and forms compose from the roles.\n </p>\n ) : (\n <div className=\"space-y-4\">\n <div>\n <p className=\"text-sm text-text-primary\">{persona.title || persona.key}</p>\n <p className=\"text-2xs text-text-tertiary mt-0.5\">\n {persona.roles.length} role{persona.roles.length === 1 ? '' : 's'} per assignment\n </p>\n </div>\n\n {assignees.length === 0 ? (\n <p className=\"text-xs text-text-tertiary\">\n Assign a user to compose their whole surface in one step.\n </p>\n ) : (\n <div className=\"flex flex-col gap-2\">\n {assignees.map((a) => (\n <span\n key={a.id}\n className=\"flex items-center gap-2.5 w-full min-w-0 pl-2.5 pr-2 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary\"\n >\n <span className=\"flex-1 min-w-0 truncate\" title={a.external_id}>\n {a.display_name || a.external_id}\n </span>\n <span className=\"shrink-0 text-2xs text-text-tertiary\">\n <DateValue date={a.assigned_at} />\n </span>\n <button\n onClick={() => unassign.mutate({ userId: a.id, key: persona.key })}\n className=\"shrink-0 text-text-tertiary hover:text-status-error transition-colors ml-1\"\n title={`Unassign ${a.display_name || a.external_id}`}\n >\n ×\n </button>\n </span>\n ))}\n </div>\n )}\n\n <div className=\"pt-3 border-t border-surface-border space-y-2\">\n <p className={SECTION_HDR}>Assign User</p>\n <UserCombobox\n selected={pendingUser}\n onSelect={setPendingUser}\n excludeIds={assignees.map((a) => a.id)}\n />\n <div className=\"flex justify-end pt-1\">\n <button\n onClick={handleAssign}\n disabled={!pendingUser || assign.isPending}\n className=\"btn-primary text-xs\"\n >\n {assign.isPending ? '...' : 'Assign'}\n </button>\n </div>\n {(assign.error || unassign.error) && (\n <p className=\"text-2xs text-status-error\">\n {((assign.error || unassign.error) as Error).message}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n );\n}\n","import { useState, useMemo, useEffect, useRef } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { Pencil } from 'lucide-react';\nimport { usePersonas } from '../../../api/personas';\nimport { FilterBar, FilterInput } from '../../../components/common/data/FilterBar';\nimport type { LTPersonaRecord } from '../../../api/types';\nimport { PageHeader } from '../../../components/common/layout/PageHeader';\nimport { RolePill } from '../../../components/common/display/RolePill';\nimport { useShellPanelOptional } from '../../../hooks/useShellPanel';\nimport { CreatePersonaModal } from './CreatePersonaModal';\nimport { AssigneesPanel } from './AssigneesPanel';\n\n// Shell-panel ownership key — the Assignees panel claims/releases this slot.\nconst ASSIGNEES_PANEL_KEY = 'persona-assignees';\n\n// ── Grid columns ──────────────────────────────────────────────────────────────\n// PERSONA(title, 180px) | KEY(140px) | DESCRIPTION(1fr) | ROLES(220px) | USERS(56px) | CONFIGURE(40px)\n// Mirrors the Roles list: display title leads, exact key is the secondary\n// field, the bundle's role pills preview on the right. Clicking a row selects\n// it for the Assignees panel (the 90% path); the pencil opens configuration.\nconst GRID = '180px 140px 1fr 220px 56px 40px';\n\nconst CELL_TEXT = 'text-text-secondary transition-colors group-hover/row:text-text-primary';\nconst HDR = 'text-2xs font-semibold uppercase tracking-widest text-text-quaternary';\nconst CELL_PY = 'py-2';\nconst ROW_PY = 'py-2.5';\n\n/** Title Case fallback derived from the key, same convention as roles. */\nfunction displayPersonaTitle(p: LTPersonaRecord): string {\n if (p.title) return p.title;\n return p.key.replace(/[-_]+/g, ' ').replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\nfunction TableHead() {\n return (\n <div\n className=\"grid gap-4 px-3 border-b border-surface-border bg-surface\"\n style={{ gridTemplateColumns: GRID }}\n >\n <span className={`${HDR} ${CELL_PY} flex items-center`}>Persona</span>\n <span className={`${HDR} ${CELL_PY} flex items-center`}>Key</span>\n <span className={`${HDR} ${CELL_PY} flex items-center`}>Description</span>\n <span className={`${HDR} ${CELL_PY} flex items-center`}>Roles</span>\n <span className={`${HDR} ${CELL_PY} flex items-center justify-end`}>Users</span>\n <span className={CELL_PY} />\n </div>\n );\n}\n\nconst ROLE_PREVIEW_LIMIT = 3;\n\nfunction PersonaRow({ persona, active, onClick, onConfigure }: {\n persona: LTPersonaRecord;\n active: boolean;\n onClick: () => void;\n onConfigure: () => void;\n}) {\n const roles = persona.roles ?? [];\n const preview = roles.slice(0, ROLE_PREVIEW_LIMIT);\n const overflow = roles.length - preview.length;\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') onClick(); }}\n className={`grid gap-4 px-3 cursor-pointer group/row transition-colors ${active ? 'bg-surface-hover/60' : 'hover:bg-surface-hover/30'}`}\n style={{ gridTemplateColumns: GRID }}\n >\n <span className={`flex items-center min-w-0 text-sm truncate ${ROW_PY} ${CELL_TEXT}`}>\n {displayPersonaTitle(persona)}\n </span>\n\n <span className={`flex items-center text-xs font-mono truncate ${ROW_PY} text-text-tertiary transition-colors group-hover/row:text-text-secondary`}>\n {persona.key}\n </span>\n\n <span className={`flex items-center min-w-0 text-xs text-text-tertiary truncate ${ROW_PY} transition-colors group-hover/row:text-text-secondary`}>\n {persona.description ?? ''}\n </span>\n\n <div className={`flex items-center flex-wrap gap-x-2.5 gap-y-0.5 min-w-0 ${ROW_PY}`}>\n {preview.map((r) => (\n <span key={r.role} className=\"min-w-0 truncate text-text-secondary\">\n <RolePill role={r.role} tone=\"inherit\" />\n </span>\n ))}\n {overflow > 0 && (\n <span className=\"text-2xs text-text-quaternary tabular-nums\">+{overflow}</span>\n )}\n </div>\n\n <span className={`flex items-center justify-end text-sm tabular-nums ${ROW_PY} transition-colors ${CELL_TEXT}`}>\n {persona.user_count > 0 ? persona.user_count : ''}\n </span>\n\n <span className={`flex items-center justify-end ${ROW_PY}`}>\n <button\n onClick={(e) => { e.stopPropagation(); onConfigure(); }}\n className=\"text-text-quaternary/70 hover:text-accent transition-colors\"\n title={`Configure ${displayPersonaTitle(persona)}`}\n aria-label={`Configure ${displayPersonaTitle(persona)}`}\n >\n <Pencil className=\"w-3.5 h-3.5\" strokeWidth={1.5} />\n </button>\n </span>\n </div>\n );\n}\n\n// ── Page ──────────────────────────────────────────────────────────────────────\n\nexport function PersonasPage() {\n const navigate = useNavigate();\n const { data, isLoading } = usePersonas();\n const shell = useShellPanelOptional();\n const [showCreate, setShowCreate] = useState(false);\n const [search, setSearch] = useState('');\n const [selectedKey, setSelectedKey] = useState<string | null>(null);\n\n const personas = data?.personas ?? [];\n\n // ── Selection ↔ shell panel sync ────────────────────────────────────────────\n // Clicking a row opens the Assignees panel in the shell's right slot; an\n // external close (the panel's X, slot takeover) clears the selection. The\n // applied-key ref guards against re-setting the panel on unrelated renders.\n const appliedKey = useRef<string | null>(null);\n const panelWasOpen = useRef(false);\n useEffect(() => {\n if (!shell) return;\n if (selectedKey === appliedKey.current) return;\n appliedKey.current = selectedKey;\n if (selectedKey) {\n shell.setPanel(\n <AssigneesPanel personaKey={selectedKey} onClose={() => setSelectedKey(null)} />,\n { key: ASSIGNEES_PANEL_KEY, width: 360 },\n );\n } else {\n panelWasOpen.current = false;\n shell.closePanel(ASSIGNEES_PANEL_KEY);\n }\n }, [selectedKey, shell]);\n useEffect(() => {\n if (!shell || !selectedKey) return;\n if (shell.open && shell.ownerKey === ASSIGNEES_PANEL_KEY) {\n panelWasOpen.current = true;\n return;\n }\n if (panelWasOpen.current) {\n panelWasOpen.current = false;\n setSelectedKey(null);\n }\n }, [shell, selectedKey]);\n // Unmount with the panel open releases the slot (keyed — never yanks\n // another claimant's panel).\n const shellRef = useRef(shell);\n shellRef.current = shell;\n useEffect(\n () => () => {\n if (appliedKey.current) shellRef.current?.closePanel(ASSIGNEES_PANEL_KEY);\n },\n [],\n );\n\n const filtered = useMemo(() => {\n const sorted = [...personas].sort((a, b) =>\n displayPersonaTitle(a).localeCompare(displayPersonaTitle(b)),\n );\n if (!search.trim()) return sorted;\n const q = search.toLowerCase();\n return sorted.filter(\n (p) =>\n p.key.toLowerCase().includes(q) ||\n displayPersonaTitle(p).toLowerCase().includes(q) ||\n p.description?.toLowerCase().includes(q) ||\n p.roles?.some((r) => r.role.toLowerCase().includes(q)),\n );\n }, [personas, search]);\n\n return (\n <div>\n <PageHeader\n title=\"Personas\"\n docsHash=\"#docs:dashboard.md:personas\"\n actions={\n <button\n onClick={() => setShowCreate(true)}\n className=\"btn-primary text-xs flex items-center gap-1.5\"\n >\n + Add Persona\n </button>\n }\n />\n\n {/* The standard full-width sticky filter band — above the split. */}\n {!isLoading && personas.length > 0 && (\n <FilterBar>\n <FilterInput\n label=\"Search\"\n value={search}\n onChange={setSearch}\n placeholder={`${personas.length} personas…`}\n />\n {search && filtered.length !== personas.length && (\n <span className=\"text-2xs text-text-quaternary tabular-nums shrink-0\">\n {filtered.length} of {personas.length}\n </span>\n )}\n </FilterBar>\n )}\n\n {/* The table IS the page — selecting a row opens the Assignees panel in\n the shell's right panel; the row pencil opens the persona's config. */}\n <div className=\"overflow-x-clip\">\n {!isLoading && personas.length > 0 && filtered.length > 0 && (\n <div className=\"sticky top-[60px] z-10 bg-surface\">\n <TableHead />\n </div>\n )}\n\n {isLoading ? (\n <div className=\"animate-pulse space-y-3 mt-6\">\n {[1, 2, 3].map((i) => (\n <div key={i} className=\"h-10 bg-surface-sunken rounded w-full\" />\n ))}\n </div>\n ) : filtered.length === 0 ? (\n <p className=\"text-sm text-text-tertiary mt-8\">\n {search\n ? 'Clear the search to see all personas.'\n : 'Create a persona to bundle roles into a one-step assignment.'}\n </p>\n ) : (\n <div className=\"divide-y divide-surface-border/30\">\n {filtered.map((persona) => (\n <PersonaRow\n key={persona.key}\n persona={persona}\n active={persona.key === selectedKey}\n onClick={() => setSelectedKey(persona.key)}\n onConfigure={() => navigate(`/admin/personas/${encodeURIComponent(persona.key)}`)}\n />\n ))}\n </div>\n )}\n </div>\n\n <CreatePersonaModal open={showCreate} onClose={() => setShowCreate(false)} />\n </div>\n );\n}\n"],"names":["CreatePersonaModal","open","onClose","navigate","useNavigate","createPersona","useCreatePersona","key","setKey","useState","title","setTitle","description","setDescription","prevOpen","setPrevOpen","handleCreate","trimmed","jsx","Modal","jsxs","e","UserCombobox","selected","onSelect","excludeIds","placeholder","setOpen","filter","setFilter","containerRef","useRef","debounced","useDebouncedValue","PAGE","data","isFetching","useUsers","useEffect","handleClick","excluded","useMemo","users","u","total","truncated","displayValue","filterText","label","SECTION_HDR","AssigneesPanel","personaKey","persona","usePersona","assign","useAssignPersona","unassign","useUnassignPersona","pendingUser","setPendingUser","assignees","handleAssign","X","a","DateValue","ASSIGNEES_PANEL_KEY","GRID","CELL_TEXT","HDR","CELL_PY","ROW_PY","displayPersonaTitle","p","c","TableHead","ROLE_PREVIEW_LIMIT","PersonaRow","active","onClick","onConfigure","roles","preview","overflow","r","RolePill","Pencil","PersonasPage","isLoading","usePersonas","shell","useShellPanelOptional","showCreate","setShowCreate","search","setSearch","selectedKey","setSelectedKey","personas","appliedKey","panelWasOpen","shellRef","_a","filtered","sorted","b","q","_b","PageHeader","FilterBar","FilterInput","i"],"mappings":"kgBAKO,SAASA,EAAmB,CACjC,KAAAC,EACA,QAAAC,CACF,EAGG,CACD,MAAMC,EAAWC,EAAA,EACXC,EAAgBC,EAAA,EAChB,CAACC,EAAKC,CAAM,EAAIC,EAAAA,SAAS,EAAE,EAC3B,CAACC,EAAOC,CAAQ,EAAIF,EAAAA,SAAS,EAAE,EAC/B,CAACG,EAAaC,CAAc,EAAIJ,EAAAA,SAAS,EAAE,EAE3C,CAACK,EAAUC,CAAW,EAAIN,EAAAA,SAASR,CAAI,EACzCA,IAASa,IACXC,EAAYd,CAAI,EACZA,IACFO,EAAO,EAAE,EACTG,EAAS,EAAE,EACXE,EAAe,EAAE,EACjBR,EAAc,MAAA,I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,EACH,EACER,EAAS,SAAW,QACrB,IAAA,CAAE,UAAU,kCACV,SAAAT,EACG,wCACA,8DAAA,CACN,QAEC,MAAA,CAAI,UAAU,oCACZ,SAAAS,EAAS,IAAKlD,GACblC,EAAAA,IAAC0D,EAAA,CAEC,QAAAxB,EACA,OAAQA,EAAQ,MAAQ2C,EACxB,QAAS,IAAMC,EAAe5C,EAAQ,GAAG,EACzC,YAAa,IAAMjD,EAAS,mBAAmB,mBAAmBiD,EAAQ,GAAG,CAAC,EAAE,CAAA,EAJ3EA,EAAQ,GAAA,CAMhB,CAAA,CACH,CAAA,EAEJ,EAEAlC,MAAClB,GAAmB,KAAM2F,EAAY,QAAS,IAAMC,EAAc,EAAK,CAAA,CAAG,CAAA,EAC7E,CAEJ"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{j as e,a as u}from"./vendor-query-RUZdMvN6.js";import{aj as X,ax as ee,ay as E,J as te,V as se}from"./index-CdavRyaX.js";import{A as ae}from"./AutoGrowTextarea-DgEQeRQw.js";import{C as ne}from"./ConfirmDeleteModal-CQsJUzEa.js";import{aN as U,T as re,L as J,aO as B,aP as ie,Y as K,aE as oe,n as L,am as le,P as W,I as F,B as ce,o as V,a8 as de,aQ as xe}from"./vendor-icons-h-jlRSb9.js";import{u as me,L as I,e as he,f as ue}from"./vendor-react-CdqEC2zv.js";import"./Modal-BU7No9NH.js";function pe({role:t}){const{data:a}=X({role:t,limit:100}),s=(a==null?void 0:a.users)??[];return s.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Assign users to this role to staff its queue. Members see and resolve escalations here according to their read/write scope; admins manage the role itself."}):e.jsx("div",{className:"divide-y divide-surface-border/40",children:s.map(i=>{const c=i.roles.find(n=>n.role===t);return c?e.jsxs("div",{className:"flex items-center justify-between py-1.5 gap-2",children:[e.jsx("span",{className:"text-xs text-text-secondary truncate",children:i.display_name||i.external_id}),e.jsx("span",{className:"text-2xs text-text-quaternary font-mono shrink-0",children:fe(c)})]},i.id):null})})}function fe(t){return t.type==="superadmin"||t.type==="admin"?t.type:`member · read ${t.read_scope} · write ${t.write_scope}`}function T(t){return t==null?"":JSON.stringify(t,null,2)}function S(t){const a=t.trim();if(!a)return{ok:!0,value:void 0};try{const s=JSON.parse(a);return typeof s!="object"||Array.isArray(s)||s===null?{ok:!1}:{ok:!0,value:s}}catch{return{ok:!1}}}const M=/^[a-zA-Z0-9_]+$/;function be(t){var s;const a=S(t);return a.ok&&((s=a.value)==null?void 0:s.kiosk)===!0}function je(t){const a=S(t);if(!a.ok)return null;const s={...a.value??{}};return s.kiosk===!0?delete s.kiosk:s.kiosk=!0,JSON.stringify(s,null,2)}const ve={title:"",description:"",ops_visible:!1,ops_home_default:!1,enforce_schema:!1,parent_role:"",metadata_schema:"",properties:"{}",sla_minutes:"",target_per_hour:"",worker_count:"",priority_threshold_minutes:"",priority_facet:"",entity_facet:"",entity_state_source:"role"};function ye(t){return{title:t.title??"",description:t.description??"",ops_visible:t.ops_visible,ops_home_default:t.ops_home_default,enforce_schema:t.enforce_schema,parent_role:t.parent_role??"",metadata_schema:T(t.metadata_schema),properties:T(t.properties)||"{}",sla_minutes:t.sla_minutes!=null?String(t.sla_minutes):"",target_per_hour:t.target_per_hour!=null?String(t.target_per_hour):"",worker_count:t.worker_count!=null?String(t.worker_count):"",priority_threshold_minutes:t.priority_threshold_minutes!=null?String(t.priority_threshold_minutes):"",priority_facet:t.priority_facet??"",entity_facet:t.entity_facet??"",entity_state_source:t.entity_state_source??"role"}}function p({icon:t,label:a,annotation:s,aside:i,accent:c=!1,children:n}){const r=c?"text-accent":"text-text-tertiary";return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(t,{className:`w-3 h-3 ${r} shrink-0`,strokeWidth:1.5}),e.jsx("span",{className:`text-2xs font-semibold uppercase tracking-widest ${r}`,children:a}),s&&e.jsxs("span",{className:"text-2xs text-text-quaternary truncate",children:["— ",s]})]}),i]}),e.jsx("div",{className:`border-l-2 pl-5 ${c?"border-accent/15":"border-surface-border/60"}`,children:n})]})}function G(){return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-success"}),e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-status-success",children:"Live"})]})}function q({checked:t,onChange:a,title:s}){return e.jsx("button",{onClick:a,title:s,className:`w-9 h-5 rounded-full transition-colors relative shrink-0 ${t?"bg-accent":"bg-surface-border"}`,children:e.jsx("span",{className:`absolute top-[3px] left-0 w-3.5 h-3.5 rounded-full bg-text-inverse transition-transform shadow ${t?"translate-x-[18px]":"translate-x-[3px]"}`})})}function ge({items:t,empty:a,onRemove:s}){return t.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:a}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(i=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-2xs bg-accent/10 rounded-sm font-mono text-accent",children:[i,e.jsx("button",{onClick:()=>s(i),className:"text-accent/50 hover:text-status-error transition-colors leading-none ml-0.5",children:"×"})]},i))})}function _e({role:t,draft:a,update:s}){const i=me(),c=ee(),[n,r]=u.useState(!1),m=t.user_count>0||t.chain_count>0||t.workflow_count>0;return e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:U,label:"Identity",annotation:"name and description",accent:!0,children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Display Name"}),e.jsx("input",{type:"text",value:a.title,onChange:o=>s({title:o.target.value}),placeholder:`e.g., ${t.role.charAt(0).toUpperCase()+t.role.slice(1)}`,className:"input text-sm w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Description"}),e.jsx(ae,{value:a.description,onChange:o=>s({description:o}),placeholder:"A short description shown on role cards and in the operations view.",rows:2})]})]})}),e.jsx("div",{className:"border-t border-surface-border/40 pt-6",children:m?e.jsxs("p",{className:"text-2xs text-text-quaternary leading-relaxed",children:["This role is referenced by"," ",[t.user_count>0?`${t.user_count} member${t.user_count===1?"":"s"}`:null,t.workflow_count>0?`${t.workflow_count} workflow${t.workflow_count===1?"":"s"}`:null,t.chain_count>0?"routing config":null].filter(Boolean).join(", ")," ","and cannot be deleted."]}):e.jsxs("button",{onClick:()=>r(!0),className:"px-3 py-1.5 text-xs rounded-md text-status-error/60 hover:text-status-error hover:bg-status-error/10 transition-colors flex items-center gap-1",children:[e.jsx(re,{className:"w-3 h-3"})," Delete this role"]})}),e.jsx(ne,{open:n,onClose:()=>r(!1),onConfirm:()=>c.mutate(t.role,{onSuccess:()=>i("/admin/roles")}),title:"Delete Role",description:e.jsxs(e.Fragment,{children:["Delete role ",e.jsx("span",{className:"font-medium font-mono text-text-primary",children:t.role}),"? This cannot be undone."]}),isPending:c.isPending,error:c.error})]})}function Ne({role:t,allRoles:a,draft:s,update:i,errors:c}){const n=parseFloat(s.sla_minutes),r=parseFloat(s.target_per_hour),m=parseFloat(s.worker_count),o=!isNaN(n)&&n>0,f=!isNaN(r)&&r>0,y=!isNaN(m)&&m>0,d=o&&y&&!f?`→ target ≈ ${(m/(n/60)).toFixed(1)}/h`:o&&f&&!y?`→ workers ≈ ${(r*(n/60)).toFixed(1)}`:f&&y&&!o?`→ SLA ≈ ${(m/r*60).toFixed(0)}m`:null,j=u.useMemo(()=>a.filter(l=>{if(l.role===t.role)return!1;let h=l;const v=new Set;for(;h!=null&&h.parent_role;){if(h.parent_role===t.role)return!1;if(v.has(h.parent_role))break;v.add(h.parent_role),h=a.find(w=>w.role===h.parent_role)}return!0}),[a,t]);return e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:J,label:"Station",annotation:"this role on the Pace Board",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Show as a station on the Pace Board"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Stations appear on the Operations chart and table with live counts, pace, and the time-in-state mix."})]}),e.jsx(q,{checked:s.ops_visible,onChange:()=>i({ops_visible:!s.ops_visible}),title:"Show as a station on the Pace Board"})]})}),e.jsx(p,{icon:B,label:"Capacity",annotation:"throughput = workers / (sla / 60)",children:e.jsxs("div",{className:"flex items-end gap-6",children:[[{key:"sla_minutes",label:"SLA",unit:"min",placeholder:"30"},{key:"target_per_hour",label:"Target",unit:"/h",placeholder:"20"},{key:"worker_count",label:"Workers",unit:"",placeholder:"4"}].map(({key:l,label:h,unit:v,placeholder:w})=>e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:[h,v&&e.jsx("span",{className:"normal-case font-normal ml-1",children:v})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:s[l],onChange:$=>i({[l]:$.target.value}),placeholder:w,className:"input text-xs w-20 font-mono"})]},l)),d&&e.jsx("span",{className:"text-2xs text-accent font-mono whitespace-nowrap pb-2",children:d})]})}),e.jsxs(p,{icon:B,label:"Priority",annotation:"when a pending item counts as overdue",children:[e.jsxs("div",{className:"flex items-end gap-6",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:["Threshold",e.jsx("span",{className:"normal-case font-normal ml-1",children:"min"})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:s.priority_threshold_minutes,onChange:l=>i({priority_threshold_minutes:l.target.value}),placeholder:s.sla_minutes||"60",className:"input text-xs w-20 font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:"Age Facet"}),e.jsx("input",{type:"text",value:s.priority_facet,onChange:l=>i({priority_facet:l.target.value}),placeholder:"created_at",className:"input text-xs w-36 font-mono"}),c.priority_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:c.priority_facet})]})]}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["Pending unclaimed items older than the threshold count as priority. Age is measured from the metadata facet (an ISO 8601 UTC timestamp, e.g. ",e.jsx("code",{className:"font-mono",children:"authorized_at"}),") or from"," ",e.jsx("code",{className:"font-mono",children:"created_at"})," when blank; the threshold falls back to SLA when blank."]})]}),e.jsxs(p,{icon:ie,label:"Entity",annotation:"what moves through this station",accent:!0,children:[e.jsx("input",{type:"text",value:s.entity_facet,onChange:l=>i({entity_facet:l.target.value}),placeholder:"serialNumber",className:"input text-xs w-44 font-mono"}),c.entity_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:c.entity_facet}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["The metadata key naming the entity that moves through this station —"," ",e.jsx("code",{className:"font-mono",children:"serialNumber"}),","," ",e.jsx("code",{className:"font-mono",children:"orderId"}),". Roles sharing a key form that entity's system: its state mix, per-entity dwell, and timelines all derive from it. Blank = the role has no entity notion."]}),s.entity_facet.trim()!==""&&e.jsxs("div",{className:"mt-5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1.5",children:"States from"}),e.jsx("div",{className:"flex items-center gap-1",children:[{value:"role",label:"Station"},{value:"subtype",label:"Subtypes"}].map(({value:l,label:h})=>e.jsx("button",{onClick:()=>i({entity_state_source:l}),className:`px-2.5 py-1 text-2xs rounded transition-colors ${s.entity_state_source===l?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:h},l))}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:["How this station names the entity's state. ",e.jsx("strong",{children:"Station"}),": being here is one state (a servicing or harvesting queue)."," ",e.jsx("strong",{children:"Subtypes"}),": this one role holds several states, named by each escalation's subtype (a fleet role parking"," ",e.jsx("code",{className:"font-mono",children:"ready"})," /"," ",e.jsx("code",{className:"font-mono",children:"printing"}),")."]})]})]}),e.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-out ${s.ops_visible?"opacity-100 max-h-[900px]":"opacity-0 max-h-0 pointer-events-none"}`,"aria-hidden":!s.ops_visible,children:e.jsx(p,{icon:K,label:"Sequence",annotation:"where this station sits on the floor",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Prior Step"}),e.jsxs("select",{value:s.parent_role,onChange:l=>i({parent_role:l.target.value}),className:"select text-sm w-full font-mono",children:[e.jsx("option",{value:"",children:"None — root process"}),j.map(l=>e.jsx("option",{value:l.role,children:l.title?`${l.role} — ${l.title}`:l.role},l.role))]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Places this role in one Pace Board sequence. A role with no prior step starts its own sequence."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Upstream Inputs"}),e.jsx(G,{})]}),e.jsx(we,{role:t,allRoles:a})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Home Segment"}),e.jsx(q,{checked:s.ops_home_default,onChange:()=>i({ops_home_default:!s.ops_home_default}),title:"Lead the home Pace Board with this role's sequence"})]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Lead the home page's Pace Board with this role's sequence. One role holds this — saving it here releases the previous holder. Unset everywhere, the board opens on its first sequence."})]})]})})})]})}function we({role:t,allRoles:a}){const s=E(),[i,c]=u.useState(""),n=t.upstream_roles??[],r=u.useMemo(()=>a.map(o=>o.role).filter(o=>o!==t.role&&o!=="superadmin"&&!n.includes(o)),[a,t.role,n]),m=o=>s.mutate({role:t.role,upstream_roles:o},{onSuccess:()=>c("")});return e.jsxs("div",{className:"space-y-2",children:[r.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:i,onChange:o=>c(o.target.value),className:"select text-xs font-mono flex-1",children:[e.jsx("option",{value:"",children:"Add upstream input…"}),r.map(o=>e.jsx("option",{value:o,children:o},o))]}),e.jsx("button",{onClick:()=>{i&&m([...n,i])},disabled:!i||s.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:s.isPending?"…":"Add"})]}),e.jsx(ge,{items:n,empty:"Roles from other sequences this station draws input from. Add one above and it lands here.",onRemove:o=>m(n.filter(f=>f!==o))}),s.error&&e.jsx("p",{className:"text-2xs text-status-error",children:s.error.message})]})}function ke({role:t,draft:a,update:s,errors:i,editingJson:c,startEditingJson:n,setMetadataSchemaError:r}){return e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:oe,label:"Enforcement",annotation:"server-side resolver validation",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Enforce the escalation form schema"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Every resolve surface — API, MCP, CLI — validates submitted payloads against this role's form schema and rejects violations with field-level errors before any state changes."})]}),e.jsx(q,{checked:a.enforce_schema,onChange:()=>s({enforce_schema:!a.enforce_schema}),title:"Validate every resolve payload against this role's form schema"})]})}),e.jsxs(p,{icon:L,label:"Escalation Schema",annotation:"the resolve form",accent:!0,aside:t.current_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_schema_version," in use"]}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["The form a person completes to resolve this role's escalations. Versioned — each save adds one; workflows pin any version via"," ",e.jsx("code",{className:"font-mono",children:"schemaVersion"}),"."]}),e.jsx(I,{to:`/admin/roles/${encodeURIComponent(t.role)}/schema`,className:"text-xs text-accent hover:underline",children:t.form_schema?`Open schema editor — v${t.current_schema_version??1} in use →`:"Define the escalation form →"})]}),e.jsxs(p,{icon:le,label:"Escalations List Schema",annotation:"rich list view",aside:t.current_list_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_list_schema_version," in use"]}):void 0,children:[e.jsx("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:"Richly formats the escalation list when it's scoped to just this role. Versioned on its own timeline — separate from the resolve form."}),e.jsx(I,{to:`/admin/roles/${encodeURIComponent(t.role)}/list-schema`,className:"text-xs text-accent hover:underline",children:t.list_schema?`Open list schema editor — v${t.current_list_schema_version??1} in use →`:"Define the list view →"})]}),e.jsxs(p,{icon:L,label:"Metadata Schema",annotation:"validates metadata at creation",aside:!c.has("metadata_schema")&&t.metadata_schema?e.jsx("button",{onClick:()=>n("metadata_schema"),className:"text-2xs text-accent hover:underline",children:"Edit"}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["Validates ",e.jsx("code",{className:"font-mono",children:"metadata"})," at creation time. Keys appear in faceted search autocomplete."]}),!c.has("metadata_schema")&&t.metadata_schema?e.jsx(te,{data:t.metadata_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:a.metadata_schema,onChange:m=>{const o=m.target.value;s({metadata_schema:o}),r(S(o).ok?void 0:"Invalid JSON")},rows:10,spellCheck:!1,className:"input text-xs font-mono w-full resize-y",placeholder:`{
|
|
2
|
-
"type": "object",
|
|
3
|
-
"properties": {
|
|
4
|
-
"order_id": { "type": "string" }
|
|
5
|
-
},
|
|
6
|
-
"required": ["order_id"]
|
|
7
|
-
}`}),i.metadata_schema&&e.jsx("p",{className:"text-2xs text-status-error mt-1",children:i.metadata_schema})]})]})]})}function Se({role:t}){return e.jsx(p,{icon:W,label:"Default Pins",annotation:"pinned views every member starts with",aside:e.jsx(G,{}),accent:!0,children:e.jsx(Ce,{role:t})})}function Ce({role:t}){const a=E(),[s,i]=u.useState(""),[c,n]=u.useState(""),[r,m]=u.useState(!0),o=t.default_pins??[],f=d=>a.mutate({role:t.role,default_pins:d.length?d:null},{onSuccess:()=>{i(""),n(""),m(!0)}}),y=s.trim()!==""&&c.trim().startsWith("/");return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:s,onChange:d=>i(d.target.value),placeholder:"Label — e.g. Needs harvesting",className:"input text-xs w-40 shrink-0"}),e.jsx("input",{type:"text",value:c,onChange:d=>n(d.target.value),placeholder:"/escalations/available?role=…",className:"input text-xs font-mono flex-1"}),e.jsxs("label",{className:"flex items-center gap-1 text-2xs text-text-tertiary shrink-0",title:"Show a live count beside the label",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:d=>m(d.target.checked),className:"w-3 h-3 accent-accent"}),"count"]}),e.jsx("button",{onClick:()=>{y&&f([...o,{label:s.trim(),url:c.trim(),badge:r}])},disabled:!y||a.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:a.isPending?"…":"Add"})]}),o.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"Pinned views every member starts with — the persona's exact queries. Add one above and it lands here."}):e.jsx("div",{className:"space-y-1",children:o.map(d=>e.jsxs("div",{className:"flex items-baseline gap-2 text-2xs",children:[e.jsx("span",{className:"font-medium text-text-secondary shrink-0",children:d.label}),d.badge&&e.jsx("span",{className:"text-2xs text-accent shrink-0",title:"Shows a live count",children:"count"}),e.jsx("span",{className:"font-mono text-text-quaternary truncate flex-1",title:d.url,children:d.url}),e.jsx("button",{onClick:()=>f(o.filter(j=>j.label!==d.label)),className:"text-text-quaternary hover:text-status-error transition-colors leading-none shrink-0","aria-label":`Remove pin ${d.label}`,children:"×"})]},d.label))}),a.error&&e.jsx("p",{className:"text-2xs text-status-error",children:a.error.message})]})}const z=[{key:"identity",label:"Identity",icon:U},{key:"pace-board",label:"Pace Board",icon:J},{key:"schemas",label:"Schemas",icon:L},{key:"members",label:"Members",icon:V},{key:"pins",label:"Pins",icon:W}],Pe=t=>z.some(a=>a.key===t);function De(){const{role:t}=he(),{data:a,isLoading:s}=se(),i=E(),c=(a==null?void 0:a.roles)??[],n=c.find(x=>x.role===t),[r,m]=u.useState(ve),[o,f]=u.useState(!1),[y,d]=u.useState(!1),[j,l]=u.useState({}),[h,v]=u.useState(new Set),w=x=>v(b=>new Set([...b,x])),[$,R]=ue(),D=$.get("section"),_=Pe(D)?D:"identity",H=u.useCallback(x=>{R(b=>{const g=new URLSearchParams(b);return g.set("section",x),g},{replace:!0})},[R]);u.useEffect(()=>{n&&(m(ye(n)),f(!1),d(!1),l({}),v(new Set))},[t,n==null?void 0:n.role]);const C=x=>{m(b=>({...b,...x})),f(!0),d(!1)},Y=()=>{if(!n)return;const x=S(r.metadata_schema),b=S(r.properties),g=r.priority_facet.trim(),A=r.entity_facet.trim(),N={};if(x.ok||(N.metadata_schema="Invalid JSON"),b.ok||(N.properties="Invalid JSON"),g&&!M.test(g)&&(N.priority_facet="Letters, numbers, underscores only"),A&&!M.test(A)&&(N.entity_facet="Letters, numbers, underscores only"),l(N),Object.keys(N).length)return;const P=O=>{const k=parseFloat(O);return isNaN(k)?null:k},Z=O=>{const k=P(O);return k==null?null:Math.round(k)};i.mutate({role:n.role,title:r.title.trim()||null,description:r.description.trim()||null,ops_visible:r.ops_visible,ops_home_default:r.ops_home_default,enforce_schema:r.enforce_schema,parent_role:r.parent_role||null,metadata_schema:x.value??null,properties:b.value??{},sla_minutes:P(r.sla_minutes),target_per_hour:P(r.target_per_hour),worker_count:Z(r.worker_count),priority_threshold_minutes:P(r.priority_threshold_minutes),priority_facet:g||null,entity_facet:A||null,entity_state_source:r.entity_state_source},{onSuccess:()=>{f(!1),d(!0),v(new Set),window.setTimeout(()=>d(!1),2500)}})};if(s)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-4 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-64 bg-surface-sunken rounded"})]});if(!n)return e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx(F,{className:"w-12 h-12 text-text-quaternary mb-4",strokeWidth:1}),e.jsx("h2",{className:"heading-3 mb-2",children:"Role not found"})]});const Q=o&&!Object.values(j).some(Boolean);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-10 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx(F,{className:"w-5 h-5 text-accent",strokeWidth:1.5}),e.jsx("h1",{className:"text-lg font-mono font-medium text-text-primary",children:n.role}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:dashboard.md:role-detail"},className:"text-text-quaternary hover:text-accent transition-colors",title:"Open docs for this page",children:e.jsx(ce,{className:"w-4 h-4",strokeWidth:1.5})}),n.parent_role&&e.jsxs("span",{className:"flex items-center gap-1 text-2xs text-text-quaternary font-mono",children:[e.jsx(K,{className:"w-3 h-3"})," ",n.parent_role]})]}),n.title&&e.jsx("p",{className:"text-sm text-text-secondary pl-8",children:n.title})]}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:z.map(x=>{const b=x.icon,g=_===x.key;return e.jsxs("button",{onClick:()=>H(x.key),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${g?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(b,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:x.label})]},x.key)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:Y,disabled:!Q||i.isPending,className:"w-full px-3 py-1.5 text-xs rounded-md bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:i.isPending?"Saving…":o?"Save changes":"Save"}),y&&e.jsxs("span",{className:"flex items-center justify-center gap-1 text-xs text-status-success animate-page-enter",children:[e.jsx(de,{className:"w-3 h-3"})," Saved"]}),i.error&&e.jsx("p",{className:"text-2xs text-status-error leading-relaxed",children:i.error.message}),Object.values(j).some(Boolean)&&e.jsx("p",{className:"text-2xs text-status-error leading-relaxed",children:"Fix the highlighted fields before saving."})]})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2 max-w-3xl",children:[_==="identity"&&e.jsx(_e,{role:n,draft:r,update:C,errors:j}),_==="pace-board"&&e.jsx(Ne,{role:n,allRoles:c,draft:r,update:C,errors:j}),_==="schemas"&&e.jsx(ke,{role:n,draft:r,update:C,errors:j,editingJson:h,startEditingJson:w,setMetadataSchemaError:x=>l(b=>({...b,metadata_schema:x}))}),_==="members"&&e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:V,label:"Members",annotation:"read = what appears · write = what they can act on",accent:!0,children:e.jsx(pe,{role:n.role})}),e.jsx(p,{icon:xe,label:"Station Kiosk",annotation:"the locked viewport for single-role logins",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Lock single-role members to this queue"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"A member who holds only this role signs in to a locked viewport: no side navigation, this queue as home, held to the list, the item detail, and the scan screens. Members with other roles keep the full dashboard."})]}),e.jsx(q,{checked:be(r.properties),onChange:()=>{const x=je(r.properties);x!==null&&C({properties:x})},title:"Kiosk station viewport"})]})})]}),_==="pins"&&e.jsx(Se,{role:n})]})]})]})}export{De as RoleDetailPage};
|
|
8
|
-
//# sourceMappingURL=RoleDetailPage-BOccQCkx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RoleDetailPage-BOccQCkx.js","sources":["../../src/pages/admin/roles/RoleMembersSection.tsx","../../src/pages/admin/roles/role-detail-shared.tsx","../../src/pages/admin/roles/sections/IdentitySection.tsx","../../src/pages/admin/roles/sections/PaceBoardSection.tsx","../../src/pages/admin/roles/sections/SchemasSection.tsx","../../src/pages/admin/roles/sections/PinsSection.tsx","../../src/pages/admin/roles/RoleDetailPage.tsx"],"sourcesContent":["import { useUsers } from '../../../api/users';\nimport type { LTUserRole } from '../../../api/types/users';\n\n/**\n * Who can see through this role's window, and how far. Membership is admin or\n * member; a member's reach over the queue is two axes — read (which\n * escalations appear: their own, or the whole queue) and write (which they can\n * claim and resolve: none, their own, or the whole queue).\n */\nexport function RoleMembersSection({ role }: { role: string }) {\n const { data } = useUsers({ role, limit: 100 });\n const users = data?.users ?? [];\n\n if (users.length === 0) {\n return (\n <p className=\"text-2xs text-text-tertiary\">\n Assign users to this role to staff its queue. Members see and resolve\n escalations here according to their read/write scope; admins manage the\n role itself.\n </p>\n );\n }\n\n return (\n <div className=\"divide-y divide-surface-border/40\">\n {users.map((u) => {\n const membership = u.roles.find((r) => r.role === role);\n if (!membership) return null;\n return (\n <div key={u.id} className=\"flex items-center justify-between py-1.5 gap-2\">\n <span className=\"text-xs text-text-secondary truncate\">\n {u.display_name || u.external_id}\n </span>\n <span className=\"text-2xs text-text-quaternary font-mono shrink-0\">\n {describeMembership(membership)}\n </span>\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction describeMembership(m: LTUserRole): string {\n if (m.type === 'superadmin' || m.type === 'admin') return m.type;\n return `member · read ${m.read_scope} · write ${m.write_scope}`;\n}\n","import type { RoleDetail } from '../../../api/roles';\n\n// ── Shared helpers for the role detail page and its sections ─────────────────\n\nexport function safePrettyPrint(value: unknown): string {\n if (value == null) return '';\n return JSON.stringify(value, null, 2);\n}\n\nexport function safeParseJson(text: string): { ok: boolean; value?: Record<string, unknown> } {\n const trimmed = text.trim();\n if (!trimmed) return { ok: true, value: undefined };\n try {\n const parsed = JSON.parse(trimmed);\n if (typeof parsed !== 'object' || Array.isArray(parsed) || parsed === null) return { ok: false };\n return { ok: true, value: parsed };\n } catch {\n return { ok: false };\n }\n}\n\n// Mirrors the server-side facet key rule (metadata keys are interpolated as a\n// JSON path, so they are strictly validated).\nexport const FACET_KEY = /^[a-zA-Z0-9_]+$/;\n\n// ── Kiosk flag — the reserved `kiosk` key in the role's properties bag ────────\n// The draft keeps properties as a JSON string; these read/flip the one key\n// without disturbing the rest of the bag.\n\nexport function readKioskFlag(properties: string): boolean {\n const parsed = safeParseJson(properties);\n return parsed.ok && parsed.value?.kiosk === true;\n}\n\n/** Flip the kiosk key; returns the updated JSON string, or null when the bag\n * is unparseable (leave it untouched rather than destroy user data). */\nexport function toggleKioskFlag(properties: string): string | null {\n const parsed = safeParseJson(properties);\n if (!parsed.ok) return null;\n const bag: Record<string, unknown> = { ...(parsed.value ?? {}) };\n if (bag.kiosk === true) delete bag.kiosk;\n else bag.kiosk = true;\n return JSON.stringify(bag, null, 2);\n}\n\n// ── Draft state — one draft across every section; the shell owns it ──────────\n\nexport interface Draft {\n title: string;\n description: string;\n ops_visible: boolean;\n ops_home_default: boolean;\n enforce_schema: boolean;\n parent_role: string;\n metadata_schema: string;\n properties: string;\n sla_minutes: string;\n target_per_hour: string;\n worker_count: string;\n priority_threshold_minutes: string;\n priority_facet: string;\n entity_facet: string;\n entity_state_source: 'role' | 'subtype';\n}\n\nexport interface DraftErrors {\n metadata_schema?: string;\n properties?: string;\n priority_facet?: string;\n entity_facet?: string;\n}\n\nexport const EMPTY_DRAFT: Draft = {\n title: '', description: '', ops_visible: false, ops_home_default: false, enforce_schema: false, parent_role: '',\n metadata_schema: '', properties: '{}',\n sla_minutes: '', target_per_hour: '', worker_count: '',\n priority_threshold_minutes: '', priority_facet: '', entity_facet: '', entity_state_source: 'role',\n};\n\nexport function draftFrom(role: RoleDetail): Draft {\n return {\n title: role.title ?? '',\n description: role.description ?? '',\n ops_visible: role.ops_visible,\n ops_home_default: role.ops_home_default,\n enforce_schema: role.enforce_schema,\n parent_role: role.parent_role ?? '',\n metadata_schema: safePrettyPrint(role.metadata_schema),\n properties: safePrettyPrint(role.properties) || '{}',\n sla_minutes: role.sla_minutes != null ? String(role.sla_minutes) : '',\n target_per_hour: role.target_per_hour != null ? String(role.target_per_hour) : '',\n worker_count: role.worker_count != null ? String(role.worker_count) : '',\n priority_threshold_minutes: role.priority_threshold_minutes != null ? String(role.priority_threshold_minutes) : '',\n priority_facet: role.priority_facet ?? '',\n entity_facet: role.entity_facet ?? '',\n entity_state_source: role.entity_state_source ?? 'role',\n };\n}\n\n/** Props every draft-backed section receives from the shell. */\nexport interface SectionProps {\n role: RoleDetail;\n draft: Draft;\n update: (changes: Partial<Draft>) => void;\n errors: DraftErrors;\n}\n\n// ── Section group — eyebrow (icon + tiny title + annotation) over a left-ruled\n// body. The page's single grouping treatment; fields inside a group use plain\n// form-field labels, never a second heading tier. ──────────────────────────\n\nexport function SectionGroup({\n icon: Icon,\n label,\n annotation,\n aside,\n accent = false,\n children,\n}: {\n icon: React.ElementType;\n label: string;\n annotation?: string;\n aside?: React.ReactNode;\n accent?: boolean;\n children: React.ReactNode;\n}) {\n const hue = accent ? 'text-accent' : 'text-text-tertiary';\n return (\n <div>\n <div className=\"flex items-center justify-between mb-5\">\n <div className=\"flex items-center gap-1.5 min-w-0\">\n <Icon className={`w-3 h-3 ${hue} shrink-0`} strokeWidth={1.5} />\n <span className={`text-2xs font-semibold uppercase tracking-widest ${hue}`}>{label}</span>\n {annotation && (\n <span className=\"text-2xs text-text-quaternary truncate\">— {annotation}</span>\n )}\n </div>\n {aside}\n </div>\n <div className={`border-l-2 pl-5 ${accent ? 'border-accent/15' : 'border-surface-border/60'}`}>\n {children}\n </div>\n </div>\n );\n}\n\n/** Live-save indicator shown in a group's eyebrow. */\nexport function LiveBadge() {\n return (\n <div className=\"flex items-center gap-1\">\n <span className=\"w-2.5 h-2.5 rounded-full dot-ring bg-status-success\" />\n <span className=\"text-2xs font-semibold uppercase tracking-widest text-status-success\">Live</span>\n </div>\n );\n}\n\n/** The page's one switch treatment — identical markup everywhere it appears. */\nexport function Toggle({\n checked,\n onChange,\n title,\n}: {\n checked: boolean;\n onChange: () => void;\n title?: string;\n}) {\n return (\n <button\n onClick={onChange}\n title={title}\n className={`w-9 h-5 rounded-full transition-colors relative shrink-0 ${\n checked ? 'bg-accent' : 'bg-surface-border'\n }`}\n >\n <span\n className={`absolute top-[3px] left-0 w-3.5 h-3.5 rounded-full bg-text-inverse transition-transform shadow ${\n checked ? 'translate-x-[18px]' : 'translate-x-[3px]'\n }`}\n />\n </button>\n );\n}\n\n/**\n * Where chosen pills land — no enclosing box. Empty, it shows the instruction\n * (which doubles as the hint); filled, it shows the pills and drops the text.\n * The instruction is sized to occupy about the same height a pill row would, so\n * the control barely changes size as items come and go.\n */\nexport function PillWell({ items, empty, onRemove }: { items: string[]; empty: string; onRemove: (item: string) => void }) {\n if (items.length === 0) {\n return <p className=\"text-2xs text-text-tertiary leading-relaxed\">{empty}</p>;\n }\n return (\n <div className=\"flex flex-wrap gap-1.5\">\n {items.map((item) => (\n <span\n key={item}\n className=\"inline-flex items-center gap-1 px-2 py-0.5 text-2xs bg-accent/10 rounded-sm font-mono text-accent\"\n >\n {item}\n <button\n onClick={() => onRemove(item)}\n className=\"text-accent/50 hover:text-status-error transition-colors leading-none ml-0.5\"\n >\n ×\n </button>\n </span>\n ))}\n </div>\n );\n}\n","import { useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { Tag, Trash2 } from 'lucide-react';\nimport { useDeleteRole } from '../../../../api/roles';\nimport { AutoGrowTextarea } from '../../../../components/common/form/AutoGrowTextarea';\nimport { ConfirmDeleteModal } from '../../../../components/common/modal/ConfirmDeleteModal';\nimport { SectionGroup, type SectionProps } from '../role-detail-shared';\n\n/**\n * Identity — what the role is called and says about itself, and (when nothing\n * references it) the place it can be deleted. Deletion is an identity-level\n * act, so the danger zone lives here rather than in the always-visible footer.\n */\nexport function IdentitySection({ role, draft, update }: SectionProps) {\n const navigate = useNavigate();\n const deleteRole = useDeleteRole();\n const [confirmDelete, setConfirmDelete] = useState(false);\n\n const inUse = role.user_count > 0 || role.chain_count > 0 || role.workflow_count > 0;\n\n return (\n <div className=\"space-y-14\">\n <SectionGroup icon={Tag} label=\"Identity\" annotation=\"name and description\" accent>\n <div className=\"space-y-8\">\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5\">\n Display Name\n </label>\n <input\n type=\"text\"\n value={draft.title}\n onChange={(e) => update({ title: e.target.value })}\n placeholder={`e.g., ${role.role.charAt(0).toUpperCase() + role.role.slice(1)}`}\n className=\"input text-sm w-full\"\n />\n </div>\n\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5\">\n Description\n </label>\n <AutoGrowTextarea\n value={draft.description}\n onChange={(v) => update({ description: v })}\n placeholder=\"A short description shown on role cards and in the operations view.\"\n rows={2}\n />\n </div>\n </div>\n </SectionGroup>\n\n {/* Danger zone — only when nothing references the role */}\n <div className=\"border-t border-surface-border/40 pt-6\">\n {inUse ? (\n <p className=\"text-2xs text-text-quaternary leading-relaxed\">\n This role is referenced by{' '}\n {[\n role.user_count > 0 ? `${role.user_count} member${role.user_count === 1 ? '' : 's'}` : null,\n role.workflow_count > 0 ? `${role.workflow_count} workflow${role.workflow_count === 1 ? '' : 's'}` : null,\n role.chain_count > 0 ? 'routing config' : null,\n ].filter(Boolean).join(', ')}{' '}\n and cannot be deleted.\n </p>\n ) : (\n <button\n onClick={() => setConfirmDelete(true)}\n className=\"px-3 py-1.5 text-xs rounded-md text-status-error/60 hover:text-status-error hover:bg-status-error/10 transition-colors flex items-center gap-1\"\n >\n <Trash2 className=\"w-3 h-3\" /> Delete this role\n </button>\n )}\n </div>\n\n <ConfirmDeleteModal\n open={confirmDelete}\n onClose={() => setConfirmDelete(false)}\n onConfirm={() => deleteRole.mutate(role.role, { onSuccess: () => navigate('/admin/roles') })}\n title=\"Delete Role\"\n description={\n <>\n Delete role <span className=\"font-medium font-mono text-text-primary\">{role.role}</span>? This cannot be undone.\n </>\n }\n isPending={deleteRole.isPending}\n error={deleteRole.error as Error | null}\n />\n </div>\n );\n}\n","import { useState, useMemo } from 'react';\nimport { LayoutDashboard, Gauge, Fingerprint, GitBranch } from 'lucide-react';\nimport { useUpdateRole, type RoleDetail } from '../../../../api/roles';\nimport {\n SectionGroup,\n LiveBadge,\n Toggle,\n PillWell,\n type SectionProps,\n} from '../role-detail-shared';\n\n/**\n * Pace Board — everything the board consumes about this role, in one column:\n * station visibility, the capacity triangle, the priority dials, the entity\n * declaration, and the sequence placement. The dials stay editable even while\n * the station is hidden (they also drive jeopardy in the queues); only the\n * sequence placement collapses with visibility, since it is board geometry.\n */\nexport function PaceBoardSection({\n role,\n allRoles,\n draft,\n update,\n errors,\n}: SectionProps & { allRoles: RoleDetail[] }) {\n // Any two capacity settings derive the third — hint the missing one.\n const sla = parseFloat(draft.sla_minutes);\n const tph = parseFloat(draft.target_per_hour);\n const wc = parseFloat(draft.worker_count);\n const slaOk = !isNaN(sla) && sla > 0;\n const tphOk = !isNaN(tph) && tph > 0;\n const wcOk = !isNaN(wc) && wc > 0;\n const derivedCapacityHint =\n slaOk && wcOk && !tphOk ? `→ target ≈ ${(wc / (sla / 60)).toFixed(1)}/h` :\n slaOk && tphOk && !wcOk ? `→ workers ≈ ${(tph * (sla / 60)).toFixed(1)}` :\n tphOk && wcOk && !slaOk ? `→ SLA ≈ ${(wc / tph * 60).toFixed(0)}m` : null;\n\n const availableParents = useMemo(\n () => allRoles.filter((r) => {\n if (r.role === role.role) return false;\n let cur: RoleDetail | undefined = r;\n const seen = new Set<string>();\n while (cur?.parent_role) {\n if (cur.parent_role === role.role) return false;\n if (seen.has(cur.parent_role)) break;\n seen.add(cur.parent_role);\n cur = allRoles.find((x) => x.role === cur!.parent_role);\n }\n return true;\n }),\n [allRoles, role],\n );\n\n return (\n <div className=\"space-y-14\">\n {/* Station visibility leads — the section's headline decision */}\n <SectionGroup icon={LayoutDashboard} label=\"Station\" annotation=\"this role on the Pace Board\" accent>\n <div className=\"flex items-center justify-between gap-4\">\n <div>\n <p className=\"text-xs text-text-secondary\">Show as a station on the Pace Board</p>\n <p className=\"text-2xs text-text-tertiary leading-relaxed mt-1\">\n Stations appear on the Operations chart and table with live counts,\n pace, and the time-in-state mix.\n </p>\n </div>\n <Toggle\n checked={draft.ops_visible}\n onChange={() => update({ ops_visible: !draft.ops_visible })}\n title=\"Show as a station on the Pace Board\"\n />\n </div>\n </SectionGroup>\n\n {/* Capacity triangle — any two derive the third */}\n <SectionGroup\n icon={Gauge}\n label=\"Capacity\"\n annotation=\"throughput = workers / (sla / 60)\"\n >\n <div className=\"flex items-end gap-6\">\n {[\n { key: 'sla_minutes' as const, label: 'SLA', unit: 'min', placeholder: '30' },\n { key: 'target_per_hour' as const, label: 'Target', unit: '/h', placeholder: '20' },\n { key: 'worker_count' as const, label: 'Workers', unit: '', placeholder: '4' },\n ].map(({ key, label, unit, placeholder }) => (\n <div key={key}>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1\">\n {label}\n {unit && <span className=\"normal-case font-normal ml-1\">{unit}</span>}\n </label>\n <input\n type=\"number\"\n min=\"0\"\n step=\"any\"\n value={draft[key]}\n onChange={(e) => update({ [key]: e.target.value })}\n placeholder={placeholder}\n className=\"input text-xs w-20 font-mono\"\n />\n </div>\n ))}\n {derivedCapacityHint && (\n <span className=\"text-2xs text-accent font-mono whitespace-nowrap pb-2\">\n {derivedCapacityHint}\n </span>\n )}\n </div>\n </SectionGroup>\n\n {/* Priority dials — feed the board's priority count and the jeopardy filter */}\n <SectionGroup icon={Gauge} label=\"Priority\" annotation=\"when a pending item counts as overdue\">\n <div className=\"flex items-end gap-6\">\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1\">\n Threshold\n <span className=\"normal-case font-normal ml-1\">min</span>\n </label>\n <input\n type=\"number\"\n min=\"0\"\n step=\"any\"\n value={draft.priority_threshold_minutes}\n onChange={(e) => update({ priority_threshold_minutes: e.target.value })}\n placeholder={draft.sla_minutes || '60'}\n className=\"input text-xs w-20 font-mono\"\n />\n </div>\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1\">\n Age Facet\n </label>\n <input\n type=\"text\"\n value={draft.priority_facet}\n onChange={(e) => update({ priority_facet: e.target.value })}\n placeholder=\"created_at\"\n className=\"input text-xs w-36 font-mono\"\n />\n {errors.priority_facet && (\n <p className=\"text-2xs text-status-error mt-0.5\">{errors.priority_facet}</p>\n )}\n </div>\n </div>\n <p className=\"text-2xs text-text-tertiary leading-relaxed mt-3\">\n Pending unclaimed items older than the threshold count as priority.\n Age is measured from the metadata facet (an ISO 8601 UTC timestamp,\n e.g. <code className=\"font-mono\">authorized_at</code>) or from{' '}\n <code className=\"font-mono\">created_at</code> when blank; the\n threshold falls back to SLA when blank.\n </p>\n </SectionGroup>\n\n {/* Entity — the analytics unlock, given the room it earns */}\n <SectionGroup icon={Fingerprint} label=\"Entity\" annotation=\"what moves through this station\" accent>\n <input\n type=\"text\"\n value={draft.entity_facet}\n onChange={(e) => update({ entity_facet: e.target.value })}\n placeholder=\"serialNumber\"\n className=\"input text-xs w-44 font-mono\"\n />\n {errors.entity_facet && (\n <p className=\"text-2xs text-status-error mt-0.5\">{errors.entity_facet}</p>\n )}\n <p className=\"text-2xs text-text-tertiary leading-relaxed mt-3\">\n The metadata key naming the entity that moves through this station —{' '}\n <code className=\"font-mono\">serialNumber</code>,{' '}\n <code className=\"font-mono\">orderId</code>. Roles sharing a key form\n that entity's system: its state mix, per-entity dwell, and timelines\n all derive from it. Blank = the role has no entity notion.\n </p>\n\n {draft.entity_facet.trim() !== '' && (\n <div className=\"mt-5\">\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1.5\">\n States from\n </label>\n <div className=\"flex items-center gap-1\">\n {([\n { value: 'role' as const, label: 'Station' },\n { value: 'subtype' as const, label: 'Subtypes' },\n ]).map(({ value, label }) => (\n <button\n key={value}\n onClick={() => update({ entity_state_source: value })}\n className={`px-2.5 py-1 text-2xs rounded transition-colors ${\n draft.entity_state_source === value\n ? 'bg-accent/10 text-accent font-semibold'\n : 'icon-link'\n }`}\n >\n {label}\n </button>\n ))}\n </div>\n <p className=\"text-2xs text-text-tertiary leading-relaxed mt-1.5\">\n How this station names the entity's state. <strong>Station</strong>:\n being here is one state (a servicing or harvesting queue).{' '}\n <strong>Subtypes</strong>: this one role holds several states,\n named by each escalation's subtype (a fleet role parking{' '}\n <code className=\"font-mono\">ready</code> /{' '}\n <code className=\"font-mono\">printing</code>).\n </p>\n </div>\n )}\n </SectionGroup>\n\n {/* Sequence placement — board geometry, so it eases with visibility. */}\n <div\n className={`overflow-hidden transition-all duration-300 ease-out ${\n draft.ops_visible ? 'opacity-100 max-h-[900px]' : 'opacity-0 max-h-0 pointer-events-none'\n }`}\n aria-hidden={!draft.ops_visible}\n >\n <SectionGroup icon={GitBranch} label=\"Sequence\" annotation=\"where this station sits on the floor\">\n <div className=\"space-y-8\">\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5\">\n Prior Step\n </label>\n <select\n value={draft.parent_role}\n onChange={(e) => update({ parent_role: e.target.value })}\n className=\"select text-sm w-full font-mono\"\n >\n <option value=\"\">None — root process</option>\n {availableParents.map((r) => (\n <option key={r.role} value={r.role}>\n {r.title ? `${r.role} — ${r.title}` : r.role}\n </option>\n ))}\n </select>\n <p className=\"text-2xs text-text-tertiary leading-relaxed mt-1.5\">\n Places this role in one Pace Board sequence. A role with no prior\n step starts its own sequence.\n </p>\n </div>\n\n <div>\n <div className=\"flex items-center justify-between mb-1.5\">\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary\">\n Upstream Inputs\n </label>\n <LiveBadge />\n </div>\n <UpstreamSection role={role} allRoles={allRoles} />\n </div>\n\n <div>\n <div className=\"flex items-center justify-between gap-4\">\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary\">\n Home Segment\n </label>\n <Toggle\n checked={draft.ops_home_default}\n onChange={() => update({ ops_home_default: !draft.ops_home_default })}\n title=\"Lead the home Pace Board with this role's sequence\"\n />\n </div>\n <p className=\"text-2xs text-text-tertiary leading-relaxed mt-1.5\">\n Lead the home page's Pace Board with this role's sequence.\n One role holds this — saving it here releases the previous\n holder. Unset everywhere, the board opens on its first\n sequence.\n </p>\n </div>\n </div>\n </SectionGroup>\n </div>\n </div>\n );\n}\n\n/**\n * The graph edges that don't fit the line. Prior Step (parent_role) places\n * this role in ONE sequence on the Operations page; upstream inputs declare\n * the roles it also draws from in OTHER sequences — mixin-like, many allowed.\n * The chart shows them as a merge glyph on the station, never as a bend in\n * the sequence. Live-save.\n */\nfunction UpstreamSection({ role, allRoles }: { role: RoleDetail; allRoles: RoleDetail[] }) {\n const updateRole = useUpdateRole();\n const [newUpstream, setNewUpstream] = useState('');\n\n const upstreams = role.upstream_roles ?? [];\n const available = useMemo(\n () => allRoles\n .map((r) => r.role)\n .filter((r) => r !== role.role && r !== 'superadmin' && !upstreams.includes(r)),\n [allRoles, role.role, upstreams],\n );\n\n const save = (next: string[]) =>\n updateRole.mutate({ role: role.role, upstream_roles: next }, { onSuccess: () => setNewUpstream('') });\n\n return (\n <div className=\"space-y-2\">\n {available.length > 0 && (\n <div className=\"flex items-center gap-2\">\n <select\n value={newUpstream}\n onChange={(e) => setNewUpstream(e.target.value)}\n className=\"select text-xs font-mono flex-1\"\n >\n <option value=\"\">Add upstream input…</option>\n {available.map((r) => <option key={r} value={r}>{r}</option>)}\n </select>\n <button\n onClick={() => { if (newUpstream) save([...upstreams, newUpstream]); }}\n disabled={!newUpstream || updateRole.isPending}\n className=\"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0\"\n >\n {updateRole.isPending ? '…' : 'Add'}\n </button>\n </div>\n )}\n <PillWell\n items={upstreams}\n empty=\"Roles from other sequences this station draws input from. Add one above and it lands here.\"\n onRemove={(u) => save(upstreams.filter((x) => x !== u))}\n />\n {updateRole.error && (\n <p className=\"text-2xs text-status-error\">{(updateRole.error as Error).message}</p>\n )}\n </div>\n );\n}\n","import { Link } from 'react-router-dom';\nimport { Braces, LayoutList, ShieldCheck } from 'lucide-react';\nimport { JsonViewer } from '../../../../components/common/data/JsonViewer';\nimport {\n SectionGroup,\n Toggle,\n safeParseJson,\n type SectionProps,\n} from '../role-detail-shared';\n\n/**\n * Schemas — the role's three contracts: the resolve form (versioned, edited on\n * its own page), the list view (versioned independently), and the metadata\n * validator (inline). Enforcement leads: it decides whether the form schema is\n * advisory or a server-side gate.\n */\nexport function SchemasSection({\n role,\n draft,\n update,\n errors,\n editingJson,\n startEditingJson,\n setMetadataSchemaError,\n}: SectionProps & {\n editingJson: Set<string>;\n startEditingJson: (field: string) => void;\n setMetadataSchemaError: (msg?: string) => void;\n}) {\n return (\n <div className=\"space-y-14\">\n {/* Enforcement — whether the form schema is a server-side gate */}\n <SectionGroup icon={ShieldCheck} label=\"Enforcement\" annotation=\"server-side resolver validation\" accent>\n <div className=\"flex items-center justify-between gap-4\">\n <div>\n <p className=\"text-xs text-text-secondary\">Enforce the escalation form schema</p>\n <p className=\"text-2xs text-text-tertiary leading-relaxed mt-1\">\n Every resolve surface — API, MCP, CLI — validates submitted\n payloads against this role's form schema and rejects violations\n with field-level errors before any state changes.\n </p>\n </div>\n <Toggle\n checked={draft.enforce_schema}\n onChange={() => update({ enforce_schema: !draft.enforce_schema })}\n title=\"Validate every resolve payload against this role's form schema\"\n />\n </div>\n </SectionGroup>\n\n {/* Escalation Schema — versioned, edited on its own page */}\n <SectionGroup\n icon={Braces}\n label=\"Escalation Schema\"\n annotation=\"the resolve form\"\n accent\n aside={\n role.current_schema_version != null ? (\n <span className=\"text-2xs font-mono text-text-quaternary\">v{role.current_schema_version} in use</span>\n ) : undefined\n }\n >\n <p className=\"text-2xs text-text-tertiary mb-3 leading-relaxed\">\n The form a person completes to resolve this role's escalations.\n Versioned — each save adds one; workflows pin any version via{' '}\n <code className=\"font-mono\">schemaVersion</code>.\n </p>\n <Link\n to={`/admin/roles/${encodeURIComponent(role.role)}/schema`}\n className=\"text-xs text-accent hover:underline\"\n >\n {role.form_schema\n ? `Open schema editor — v${role.current_schema_version ?? 1} in use →`\n : 'Define the escalation form →'}\n </Link>\n </SectionGroup>\n\n {/* Escalations List Schema — versioned independently, edited on its own page */}\n <SectionGroup\n icon={LayoutList}\n label=\"Escalations List Schema\"\n annotation=\"rich list view\"\n aside={\n role.current_list_schema_version != null ? (\n <span className=\"text-2xs font-mono text-text-quaternary\">v{role.current_list_schema_version} in use</span>\n ) : undefined\n }\n >\n <p className=\"text-2xs text-text-tertiary mb-3 leading-relaxed\">\n Richly formats the escalation list when it's scoped to just this role.\n Versioned on its own timeline — separate from the resolve form.\n </p>\n <Link\n to={`/admin/roles/${encodeURIComponent(role.role)}/list-schema`}\n className=\"text-xs text-accent hover:underline\"\n >\n {role.list_schema\n ? `Open list schema editor — v${role.current_list_schema_version ?? 1} in use →`\n : 'Define the list view →'}\n </Link>\n </SectionGroup>\n\n {/* Metadata Schema — inline editor */}\n <SectionGroup\n icon={Braces}\n label=\"Metadata Schema\"\n annotation=\"validates metadata at creation\"\n aside={\n !editingJson.has('metadata_schema') && role.metadata_schema ? (\n <button onClick={() => startEditingJson('metadata_schema')} className=\"text-2xs text-accent hover:underline\">Edit</button>\n ) : undefined\n }\n >\n <p className=\"text-2xs text-text-tertiary mb-3 leading-relaxed\">\n Validates <code className=\"font-mono\">metadata</code> at creation time. Keys appear in faceted search autocomplete.\n </p>\n {!editingJson.has('metadata_schema') && role.metadata_schema ? (\n <JsonViewer data={role.metadata_schema} />\n ) : (\n <>\n <textarea\n value={draft.metadata_schema}\n onChange={(e) => {\n const val = e.target.value;\n update({ metadata_schema: val });\n setMetadataSchemaError(safeParseJson(val).ok ? undefined : 'Invalid JSON');\n }}\n rows={10}\n spellCheck={false}\n className=\"input text-xs font-mono w-full resize-y\"\n placeholder={'{\\n \"type\": \"object\",\\n \"properties\": {\\n \"order_id\": { \"type\": \"string\" }\\n },\\n \"required\": [\"order_id\"]\\n}'}\n />\n {errors.metadata_schema && <p className=\"text-2xs text-status-error mt-1\">{errors.metadata_schema}</p>}\n </>\n )}\n </SectionGroup>\n\n {/* Properties (free custom-JSON bag) is intentionally not rendered:\n nothing consumes it yet. The draft still round-trips the stored\n value on save, so existing data is kept. */}\n </div>\n );\n}\n","import { useState } from 'react';\nimport { Pin as PinIcon } from 'lucide-react';\nimport { useUpdateRole, type RoleDetail } from '../../../../api/roles';\nimport { SectionGroup, LiveBadge } from '../role-detail-shared';\n\n/**\n * Default pins — the pinned-view seeds this role hands its members:\n * [{ label, url, badge? }]. Members see them in their Pinned nav section from\n * first login (marked role-provided) and may promote, hide, or reorder them\n * via preferences. Live-save.\n */\nexport function PinsSection({ role }: { role: RoleDetail }) {\n return (\n <SectionGroup\n icon={PinIcon}\n label=\"Default Pins\"\n annotation=\"pinned views every member starts with\"\n aside={<LiveBadge />}\n accent\n >\n <DefaultPinsEditor role={role} />\n </SectionGroup>\n );\n}\n\nfunction DefaultPinsEditor({ role }: { role: RoleDetail }) {\n const updateRole = useUpdateRole();\n const [label, setLabel] = useState('');\n const [url, setUrl] = useState('');\n const [badge, setBadge] = useState(true);\n\n const pins = role.default_pins ?? [];\n const save = (next: { label: string; url: string; badge?: boolean }[]) =>\n updateRole.mutate(\n { role: role.role, default_pins: next.length ? next : null },\n { onSuccess: () => { setLabel(''); setUrl(''); setBadge(true); } },\n );\n const canAdd = label.trim() !== '' && url.trim().startsWith('/');\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center gap-2\">\n <input\n type=\"text\"\n value={label}\n onChange={(e) => setLabel(e.target.value)}\n placeholder=\"Label — e.g. Needs harvesting\"\n className=\"input text-xs w-40 shrink-0\"\n />\n <input\n type=\"text\"\n value={url}\n onChange={(e) => setUrl(e.target.value)}\n placeholder=\"/escalations/available?role=…\"\n className=\"input text-xs font-mono flex-1\"\n />\n <label className=\"flex items-center gap-1 text-2xs text-text-tertiary shrink-0\" title=\"Show a live count beside the label\">\n <input type=\"checkbox\" checked={badge} onChange={(e) => setBadge(e.target.checked)} className=\"w-3 h-3 accent-accent\" />\n count\n </label>\n <button\n onClick={() => { if (canAdd) save([...pins, { label: label.trim(), url: url.trim(), badge }]); }}\n disabled={!canAdd || updateRole.isPending}\n className=\"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0\"\n >\n {updateRole.isPending ? '…' : 'Add'}\n </button>\n </div>\n {pins.length === 0 ? (\n <p className=\"text-2xs text-text-tertiary leading-relaxed\">\n Pinned views every member starts with — the persona's exact queries.\n Add one above and it lands here.\n </p>\n ) : (\n <div className=\"space-y-1\">\n {pins.map((p) => (\n <div key={p.label} className=\"flex items-baseline gap-2 text-2xs\">\n <span className=\"font-medium text-text-secondary shrink-0\">{p.label}</span>\n {p.badge && <span className=\"text-2xs text-accent shrink-0\" title=\"Shows a live count\">count</span>}\n <span className=\"font-mono text-text-quaternary truncate flex-1\" title={p.url}>{p.url}</span>\n <button\n onClick={() => save(pins.filter((x) => x.label !== p.label))}\n className=\"text-text-quaternary hover:text-status-error transition-colors leading-none shrink-0\"\n aria-label={`Remove pin ${p.label}`}\n >\n ×\n </button>\n </div>\n ))}\n </div>\n )}\n {updateRole.error && (\n <p className=\"text-2xs text-status-error\">{(updateRole.error as Error).message}</p>\n )}\n </div>\n );\n}\n","import { useState, useEffect, useCallback } from 'react';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport {\n Tag, Inbox, GitBranch, Check, Braces, Users, BookOpen, LayoutDashboard, Pin as PinIcon,\n MonitorSmartphone,\n} from 'lucide-react';\nimport { useRoleDetails, useUpdateRole } from '../../../api/roles';\nimport { RoleMembersSection } from './RoleMembersSection';\nimport {\n EMPTY_DRAFT,\n FACET_KEY,\n SectionGroup,\n Toggle,\n draftFrom,\n safeParseJson,\n readKioskFlag,\n toggleKioskFlag,\n type Draft,\n type DraftErrors,\n} from './role-detail-shared';\nimport { IdentitySection } from './sections/IdentitySection';\nimport { PaceBoardSection } from './sections/PaceBoardSection';\nimport { SchemasSection } from './sections/SchemasSection';\nimport { PinsSection } from './sections/PinsSection';\n\n// ── Sub-nav sections — the role's configuration, organized by concern ─────────\n\nconst SECTIONS = [\n { key: 'identity', label: 'Identity', icon: Tag },\n { key: 'pace-board', label: 'Pace Board', icon: LayoutDashboard },\n { key: 'schemas', label: 'Schemas', icon: Braces },\n { key: 'members', label: 'Members', icon: Users },\n { key: 'pins', label: 'Pins', icon: PinIcon },\n] as const;\n\ntype SectionKey = (typeof SECTIONS)[number]['key'];\n\nconst isSectionKey = (s: string | null): s is SectionKey =>\n SECTIONS.some((x) => x.key === s);\n\n// ── Page ──────────────────────────────────────────────────────────────────────\n\nexport function RoleDetailPage() {\n const { role: roleKey } = useParams<{ role: string }>();\n const { data, isLoading } = useRoleDetails();\n const updateRole = useUpdateRole();\n\n const roles = data?.roles ?? [];\n const role = roles.find((r) => r.role === roleKey);\n\n // ONE draft across every section — switching sections never loses edits.\n const [draft, setDraft] = useState<Draft>(EMPTY_DRAFT);\n const [dirty, setDirty] = useState(false);\n const [savedOk, setSavedOk] = useState(false);\n const [errors, setErrors] = useState<DraftErrors>({});\n const [editingJson, setEditingJson] = useState(new Set<string>());\n\n const startEditingJson = (field: string) => setEditingJson((prev) => new Set([...prev, field]));\n\n // Active section rides the URL (?section=pace-board) so deep links land on\n // the exact concern — the Operations gear opens straight to the board dials.\n const [searchParams, setSearchParams] = useSearchParams();\n const sectionParam = searchParams.get('section');\n const section: SectionKey = isSectionKey(sectionParam) ? sectionParam : 'identity';\n const setSection = useCallback((s: SectionKey) => {\n setSearchParams((prev) => {\n const next = new URLSearchParams(prev);\n next.set('section', s);\n return next;\n }, { replace: true });\n }, [setSearchParams]);\n\n useEffect(() => {\n if (!role) return;\n setDraft(draftFrom(role));\n setDirty(false);\n setSavedOk(false);\n setErrors({});\n setEditingJson(new Set());\n }, [roleKey, role?.role]);\n\n const update = (changes: Partial<Draft>) => {\n setDraft((d) => ({ ...d, ...changes }));\n setDirty(true);\n setSavedOk(false);\n };\n\n const handleSave = () => {\n if (!role) return;\n const metaResult = safeParseJson(draft.metadata_schema);\n const propsResult = safeParseJson(draft.properties);\n const facet = draft.priority_facet.trim();\n const entityFacet = draft.entity_facet.trim();\n const newErrors: DraftErrors = {};\n if (!metaResult.ok) newErrors.metadata_schema = 'Invalid JSON';\n if (!propsResult.ok) newErrors.properties = 'Invalid JSON';\n if (facet && !FACET_KEY.test(facet)) newErrors.priority_facet = 'Letters, numbers, underscores only';\n if (entityFacet && !FACET_KEY.test(entityFacet)) newErrors.entity_facet = 'Letters, numbers, underscores only';\n setErrors(newErrors);\n if (Object.keys(newErrors).length) return;\n\n const parseNum = (s: string) => { const v = parseFloat(s); return isNaN(v) ? null : v; };\n // Staff counts are whole people/machines — round rather than persist 2.5 workers.\n const parseCount = (s: string) => { const v = parseNum(s); return v == null ? null : Math.round(v); };\n\n updateRole.mutate(\n {\n role: role.role,\n title: draft.title.trim() || null,\n description: draft.description.trim() || null,\n ops_visible: draft.ops_visible,\n ops_home_default: draft.ops_home_default,\n enforce_schema: draft.enforce_schema,\n parent_role: draft.parent_role || null,\n metadata_schema: metaResult.value ?? null,\n properties: propsResult.value ?? {},\n sla_minutes: parseNum(draft.sla_minutes),\n target_per_hour: parseNum(draft.target_per_hour),\n worker_count: parseCount(draft.worker_count),\n priority_threshold_minutes: parseNum(draft.priority_threshold_minutes),\n priority_facet: facet || null,\n entity_facet: entityFacet || null,\n entity_state_source: draft.entity_state_source,\n },\n {\n onSuccess: () => {\n setDirty(false);\n setSavedOk(true);\n setEditingJson(new Set());\n window.setTimeout(() => setSavedOk(false), 2500);\n },\n },\n );\n };\n\n // ── Loading / not found ───────────────────────────────────────────────────\n\n if (isLoading) {\n return (\n <div className=\"animate-pulse space-y-4\">\n <div className=\"h-8 bg-surface-sunken rounded w-48\" />\n <div className=\"h-4 bg-surface-sunken rounded w-64\" />\n <div className=\"h-64 bg-surface-sunken rounded\" />\n </div>\n );\n }\n\n if (!role) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center\">\n <Inbox className=\"w-12 h-12 text-text-quaternary mb-4\" strokeWidth={1} />\n <h2 className=\"heading-3 mb-2\">Role not found</h2>\n </div>\n );\n }\n\n const canSave = dirty && !Object.values(errors).some(Boolean);\n\n return (\n <div>\n {/* ── Header: identity only — every control lives in a section ── */}\n <div className=\"mb-10 min-w-0\">\n <div className=\"flex items-center gap-3 mb-1\">\n <Inbox className=\"w-5 h-5 text-accent\" strokeWidth={1.5} />\n <h1 className=\"text-lg font-mono font-medium text-text-primary\">{role.role}</h1>\n <button\n onClick={() => { window.location.hash = '#docs:dashboard.md:role-detail'; }}\n className=\"text-text-quaternary hover:text-accent transition-colors\"\n title=\"Open docs for this page\"\n >\n <BookOpen className=\"w-4 h-4\" strokeWidth={1.5} />\n </button>\n {role.parent_role && (\n <span className=\"flex items-center gap-1 text-2xs text-text-quaternary font-mono\">\n <GitBranch className=\"w-3 h-3\" /> {role.parent_role}\n </span>\n )}\n </div>\n {role.title && <p className=\"text-sm text-text-secondary pl-8\">{role.title}</p>}\n </div>\n\n <div className=\"flex gap-10\">\n {/* Section nav — sticky left sidebar; Save is always in view */}\n <nav className=\"w-44 shrink-0 sticky top-0 self-start pt-2\">\n <div className=\"space-y-0.5\">\n {SECTIONS.map((s) => {\n const Icon = s.icon;\n const active = section === s.key;\n return (\n <button\n key={s.key}\n onClick={() => setSection(s.key)}\n className={`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${\n active\n ? 'bg-accent/10 text-accent'\n : 'text-text-tertiary hover:text-text-primary hover:bg-surface-hover'\n }`}\n >\n <Icon className=\"w-3.5 h-3.5 shrink-0\" strokeWidth={1.5} />\n <span className=\"text-xs font-medium\">{s.label}</span>\n </button>\n );\n })}\n </div>\n\n {/* Save — one draft, one save, visible from every section */}\n <div className=\"mt-8 pt-4 border-t border-surface-border space-y-2\">\n <button\n onClick={handleSave}\n disabled={!canSave || updateRole.isPending}\n className=\"w-full px-3 py-1.5 text-xs rounded-md bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed\"\n >\n {updateRole.isPending ? 'Saving…' : dirty ? 'Save changes' : 'Save'}\n </button>\n {savedOk && (\n <span className=\"flex items-center justify-center gap-1 text-xs text-status-success animate-page-enter\">\n <Check className=\"w-3 h-3\" /> Saved\n </span>\n )}\n {updateRole.error && (\n <p className=\"text-2xs text-status-error leading-relaxed\">\n {(updateRole.error as Error).message}\n </p>\n )}\n {Object.values(errors).some(Boolean) && (\n <p className=\"text-2xs text-status-error leading-relaxed\">\n Fix the highlighted fields before saving.\n </p>\n )}\n </div>\n </nav>\n\n {/* Section content — readable single-column measure */}\n <div className=\"flex-1 min-w-0 pt-2 max-w-3xl\">\n {section === 'identity' && (\n <IdentitySection role={role} draft={draft} update={update} errors={errors} />\n )}\n {section === 'pace-board' && (\n <PaceBoardSection role={role} allRoles={roles} draft={draft} update={update} errors={errors} />\n )}\n {section === 'schemas' && (\n <SchemasSection\n role={role}\n draft={draft}\n update={update}\n errors={errors}\n editingJson={editingJson}\n startEditingJson={startEditingJson}\n setMetadataSchemaError={(msg) => setErrors((prev) => ({ ...prev, metadata_schema: msg }))}\n />\n )}\n {section === 'members' && (\n <div className=\"space-y-14\">\n <SectionGroup\n icon={Users}\n label=\"Members\"\n annotation=\"read = what appears · write = what they can act on\"\n accent\n >\n <RoleMembersSection role={role.role} />\n </SectionGroup>\n\n {/* Kiosk — how single-role members experience the dashboard */}\n <SectionGroup\n icon={MonitorSmartphone}\n label=\"Station Kiosk\"\n annotation=\"the locked viewport for single-role logins\"\n >\n <div className=\"flex items-center justify-between gap-4\">\n <div>\n <p className=\"text-xs text-text-secondary\">Lock single-role members to this queue</p>\n <p className=\"text-2xs text-text-tertiary leading-relaxed mt-1\">\n A member who holds only this role signs in to a locked viewport:\n no side navigation, this queue as home, held to the list, the\n item detail, and the scan screens. Members with other roles keep\n the full dashboard.\n </p>\n </div>\n <Toggle\n checked={readKioskFlag(draft.properties)}\n onChange={() => {\n const next = toggleKioskFlag(draft.properties);\n if (next !== null) update({ properties: next });\n }}\n title=\"Kiosk station viewport\"\n />\n </div>\n </SectionGroup>\n </div>\n )}\n {section === 'pins' && <PinsSection role={role} />}\n </div>\n </div>\n </div>\n );\n}\n"],"names":["RoleMembersSection","role","data","useUsers","users","jsx","u","membership","r","jsxs","describeMembership","m","safePrettyPrint","value","safeParseJson","text","trimmed","parsed","FACET_KEY","readKioskFlag","properties","_a","toggleKioskFlag","bag","EMPTY_DRAFT","draftFrom","SectionGroup","Icon","label","annotation","aside","accent","children","hue","LiveBadge","Toggle","checked","onChange","title","PillWell","items","empty","onRemove","item","IdentitySection","draft","update","navigate","useNavigate","deleteRole","useDeleteRole","confirmDelete","setConfirmDelete","useState","inUse","Tag","e","AutoGrowTextarea","v","Trash2","ConfirmDeleteModal","Fragment","PaceBoardSection","allRoles","errors","sla","tph","wc","slaOk","tphOk","wcOk","derivedCapacityHint","availableParents","useMemo","cur","seen","x","LayoutDashboard","Gauge","key","unit","placeholder","Fingerprint","GitBranch","UpstreamSection","updateRole","useUpdateRole","newUpstream","setNewUpstream","upstreams","available","save","next","SchemasSection","editingJson","startEditingJson","setMetadataSchemaError","ShieldCheck","Braces","Link","LayoutList","JsonViewer","val","PinsSection","PinIcon","DefaultPinsEditor","setLabel","url","setUrl","badge","setBadge","pins","canAdd","p","SECTIONS","Users","isSectionKey","s","RoleDetailPage","roleKey","useParams","isLoading","useRoleDetails","roles","setDraft","dirty","setDirty","savedOk","setSavedOk","setErrors","setEditingJson","field","prev","searchParams","setSearchParams","useSearchParams","sectionParam","section","setSection","useCallback","useEffect","changes","d","handleSave","metaResult","propsResult","facet","entityFacet","newErrors","parseNum","parseCount","Inbox","canSave","BookOpen","active","Check","msg","MonitorSmartphone"],"mappings":"4eASO,SAASA,GAAmB,CAAE,KAAAC,GAA0B,CAC7D,KAAM,CAAE,KAAAC,GAASC,EAAS,CAAE,KAAAF,EAAM,MAAO,IAAK,EACxCG,GAAQF,GAAA,YAAAA,EAAM,QAAS,CAAA,EAE7B,OAAIE,EAAM,SAAW,EAEjBC,EAAAA,IAAC,IAAA,CAAE,UAAU,8BAA8B,SAAA,6JAI3C,QAKD,MAAA,CAAI,UAAU,oCACZ,SAAAD,EAAM,IAAKE,GAAM,CAChB,MAAMC,EAAaD,EAAE,MAAM,KAAME,GAAMA,EAAE,OAASP,CAAI,EACtD,OAAKM,EAEHE,EAAAA,KAAC,MAAA,CAAe,UAAU,iDACxB,SAAA,CAAAJ,MAAC,QAAK,UAAU,uCACb,SAAAC,EAAE,cAAgBA,EAAE,YACvB,QACC,OAAA,CAAK,UAAU,mDACb,SAAAI,GAAmBH,CAAU,CAAA,CAChC,CAAA,CAAA,EANQD,EAAE,EAOZ,EATsB,IAW1B,CAAC,CAAA,CACH,CAEJ,CAEA,SAASI,GAAmBC,EAAuB,CACjD,OAAIA,EAAE,OAAS,cAAgBA,EAAE,OAAS,QAAgBA,EAAE,KACrD,iBAAiBA,EAAE,UAAU,YAAYA,EAAE,WAAW,EAC/D,CC1CO,SAASC,EAAgBC,EAAwB,CACtD,OAAIA,GAAS,KAAa,GACnB,KAAK,UAAUA,EAAO,KAAM,CAAC,CACtC,CAEO,SAASC,EAAcC,EAAgE,CAC5F,MAAMC,EAAUD,EAAK,KAAA,EACrB,GAAI,CAACC,EAAS,MAAO,CAAE,GAAI,GAAM,MAAO,MAAA,EACxC,GAAI,CACF,M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W,qDACX,OAAM,GAEN,SAAA9G,EAAAA,IAACL,GAAA,CAAmB,KAAMC,EAAK,IAAA,CAAM,CAAA,CAAA,EAIvCI,EAAAA,IAACqB,EAAA,CACC,KAAMmI,GACN,MAAM,gBACN,WAAW,6CAEX,SAAApJ,EAAAA,KAAC,MAAA,CAAI,UAAU,0CACb,SAAA,CAAAA,OAAC,MAAA,CACC,SAAA,CAAAJ,EAAAA,IAAC,IAAA,CAAE,UAAU,8BAA8B,SAAA,yCAAsC,EACjFA,EAAAA,IAAC,IAAA,CAAE,UAAU,mDAAmD,SAAA,qNAAA,CAKhE,CAAA,EACF,EACAA,EAAAA,IAAC8B,EAAA,CACC,QAAShB,GAAc0B,EAAM,UAAU,EACvC,SAAU,IAAM,CACd,MAAM+C,EAAOtE,GAAgBuB,EAAM,UAAU,EACzC+C,IAAS,MAAM9C,EAAO,CAAE,WAAY8C,EAAM,CAChD,EACA,MAAM,wBAAA,CAAA,CACR,CAAA,CACF,CAAA,CAAA,CACF,EACF,EAED6C,IAAY,QAAUpI,EAAAA,IAACkG,GAAA,CAAY,KAAAtG,CAAA,CAAY,CAAA,CAAA,CAClD,CAAA,CAAA,CACF,CAAA,EACF,CAEJ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as h,j as e}from"./vendor-query-RUZdMvN6.js";import{aw as v,V as w,Y as g}from"./index-CdavRyaX.js";import{F as $,a as R}from"./FilterBar-CcIgQH9h.js";import{P as L}from"./PageHeader-CFVw67M6.js";import{R as k}from"./RolePill-Di_5hfvw.js";import{M as _}from"./Modal-BU7No9NH.js";import{u as P,L as S}from"./vendor-react-CdqEC2zv.js";import"./vendor-icons-h-jlRSb9.js";function E({open:s,onClose:a}){const t=v(),[c,x]=h.useState(""),[i,j]=h.useState(s);s!==i&&(j(s),s&&(x(""),t.reset()));const n=()=>{const r=c.trim().toLowerCase();r&&t.mutate(r,{onSuccess:a})};return e.jsx(_,{open:s,onClose:a,title:"Create Role",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Role Name (required)"}),e.jsx("input",{type:"text",value:c,onChange:r=>x(r.target.value),placeholder:"e.g., reviewer",className:"input text-xs w-full",onKeyDown:r=>{r.key==="Enter"&&n()}}),e.jsx("p",{className:"text-2xs text-text-tertiary mt-1",children:"Lowercase letters, numbers, hyphens, and underscores only."})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:a,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:n,disabled:!c.trim()||t.isPending,className:"btn-primary text-xs",children:t.isPending?"Creating...":"Create"})]})]})})}const C="200px 160px 1fr 130px 88px 204px",m="text-text-secondary transition-colors group-hover/row:text-text-primary",o="text-2xs font-semibold uppercase tracking-widest text-text-quaternary",b=`${o} text-right flex-1 min-w-0`,p="py-2",u="py-2.5";function T(){return e.jsxs("div",{className:"grid gap-4 px-3 border-b border-surface-border bg-surface",style:{gridTemplateColumns:C},children:[e.jsx("span",{className:`${o} ${p} flex items-center pl-[18px]`,children:"Role"}),e.jsx("span",{className:`${o} ${p} flex items-center`,children:"Key"}),e.jsx("span",{className:`${o} ${p} flex items-center`,children:"Description"}),e.jsx("span",{className:`${o} ${p} flex items-center`,children:"Preceded By"}),e.jsx("span",{className:`${o} ${p} flex items-center justify-end`,children:"Members"}),e.jsxs("div",{className:"flex gap-3 items-center bg-surface-sunken px-3",children:[e.jsx("span",{className:b,children:"SLA/M"}),e.jsx("span",{className:b,children:"Target/h"}),e.jsx("span",{className:b,children:"Staff"})]})]})}const y="text-xs tabular-nums text-right flex-1 min-w-0 transition-colors";function A({role:s,onClick:a}){return e.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&a()},className:"grid gap-4 px-3 cursor-pointer group/row",style:{gridTemplateColumns:C},children:[e.jsxs("div",{className:`flex items-center gap-2.5 min-w-0 ${u}`,children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${s.ops_visible?"bg-status-success":"bg-surface-border"}`,title:s.ops_visible?"Visible in Operations":"Enable in role settings to show in Operations"}),e.jsx("span",{className:`text-sm truncate ${m}`,children:g(s)})]}),e.jsx("span",{className:`flex items-center text-xs font-mono truncate ${u} text-text-tertiary transition-colors group-hover/row:text-text-secondary`,children:s.role}),e.jsx("span",{className:`flex items-center min-w-0 text-xs text-text-tertiary truncate ${u} transition-colors group-hover/row:text-text-secondary`,children:s.description??""}),e.jsx("div",{className:`flex items-center min-w-0 ${u}`,onClick:t=>t.stopPropagation(),children:s.parent_role&&e.jsx(S,{to:`/admin/roles/${encodeURIComponent(s.parent_role)}`,className:"min-w-0 truncate text-text-secondary transition-colors hover:text-accent",children:e.jsx(k,{role:s.parent_role,tone:"inherit"})})}),e.jsx("span",{className:`flex items-center justify-end text-sm tabular-nums ${u} transition-colors ${m}`,children:s.user_count>0?s.user_count:""}),e.jsxs("div",{className:"flex gap-3 items-center bg-surface-sunken px-3",children:[e.jsx("span",{className:`${y} ${m}`,children:s.sla_minutes??""}),e.jsx("span",{className:`${y} ${m}`,children:s.target_per_hour??""}),e.jsx("span",{className:`${y} ${m}`,children:s.worker_count??""})]})]})}function B(){const s=P(),{data:a,isLoading:t}=w(),[c,x]=h.useState(!1),[i,j]=h.useState(""),n=(a==null?void 0:a.roles)??[],r=h.useMemo(()=>{const l=[...n].sort((d,f)=>g(d).localeCompare(g(f)));if(!i.trim())return l;const N=i.toLowerCase();return l.filter(d=>{var f;return d.role.toLowerCase().includes(N)||g(d).toLowerCase().includes(N)||((f=d.description)==null?void 0:f.toLowerCase().includes(N))})},[n,i]);return e.jsxs("div",{children:[e.jsx(L,{title:"Roles",docsHash:"#docs:dashboard.md:roles",actions:e.jsx("button",{onClick:()=>x(!0),className:"btn-primary text-xs flex items-center gap-1.5",children:"+ Add Role"})}),!t&&n.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs($,{children:[e.jsx(R,{label:"Search",value:i,onChange:j,placeholder:`${n.length} roles…`}),i&&r.length!==n.length&&e.jsxs("span",{className:"text-2xs text-text-quaternary tabular-nums shrink-0",children:[r.length," of ",n.length]})]}),r.length>0&&e.jsx("div",{className:"sticky top-[60px] z-10 bg-surface",children:e.jsx(T,{})})]}),t?e.jsx("div",{className:"animate-pulse space-y-3 mt-6",children:[1,2,3,4,5].map(l=>e.jsx("div",{className:"h-10 bg-surface-sunken rounded w-full"},l))}):r.length===0?e.jsx("p",{className:"text-sm text-text-tertiary mt-8",children:i?"Clear the search to see all roles.":"Create a role to get started."}):e.jsx(e.Fragment,{children:e.jsx("div",{className:"divide-y divide-surface-border/30",children:r.map(l=>e.jsx(A,{role:l,onClick:()=>s(`/admin/roles/${encodeURIComponent(l.role)}`)},l.role))})}),e.jsx(E,{open:c,onClose:()=>x(!1)})]})}export{B as RolesPage};
|
|
2
|
-
//# sourceMappingURL=RolesPage-B3-9Ek0F.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,a as g}from"./vendor-query-RUZdMvN6.js";import{a7 as d,aJ as W,aK as J,aL as B,V as F,aH as _,aM as V,aI as U,aN as G}from"./index-CdavRyaX.js";import{C as K}from"./ConfirmDeleteModal-CQsJUzEa.js";import{P as Y}from"./PageHeader-CFVw67M6.js";import{f as O,T as q,ah as z,ag as Q,j as X,a as $,h as Z}from"./vendor-icons-h-jlRSb9.js";import{e as ee,f as te,u as se}from"./vendor-react-CdqEC2zv.js";import"./Modal-BU7No9NH.js";const ae=[d.SHOW_DETAIL,d.CLAIM,d.CLAIM_SHOW_DETAIL,d.RELEASE,d.RESOLVE,d.ESCALATE,d.CANCEL],ne=()=>({label:"",verb:d.RESOLVE});function le({choices:s,onChange:t}){const x=(o,m)=>t(s.map((c,u)=>u===o?{...c,...m}:c)),l=o=>t(s.filter((m,c)=>c!==o));return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("span",{className:"block text-xs text-text-secondary",children:["Choices ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary",children:"The buttons the station screen offers under the item's reality. A code makes a choice double-scannable — scan the item, then the printed action card."}),e.jsx("div",{className:"divide-y divide-surface-border border-y border-surface-border",children:s.map((o,m)=>e.jsx(re,{index:m,choice:o,onPatch:c=>x(m,c),onRemove:()=>l(m)},m))}),e.jsxs("button",{type:"button",onClick:()=>t([...s,ne()]),className:"flex items-center gap-1.5 text-sm text-accent hover:text-accent-hover pt-2",children:[e.jsx(O,{className:"w-3.5 h-3.5"})," Add a choice"]})]})}function re({index:s,choice:t,onPatch:x,onRemove:l}){var p;const[o,m]=g.useState(t.params?JSON.stringify(t.params,null,2):""),[c,u]=g.useState(null),i=n=>{if(m(n),!n.trim()){u(null),x({params:void 0});return}try{x({params:JSON.parse(n)}),u(null)}catch{u("Fix the JSON to save these params.")}};return e.jsxs("div",{className:"pt-8 pb-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-semibold uppercase tracking-widest text-text-tertiary",children:["Choice ",s+1]}),e.jsx("button",{type:"button",onClick:l,className:"icon-link ml-auto",title:"Remove choice",children:e.jsx(q,{className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsxs("label",{className:"block flex-1 min-w-[12rem]",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Label ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Button text — what the associate reads."}),e.jsx("input",{value:t.label,onChange:n=>x({label:n.target.value}),className:"input w-full",placeholder:"Collected"})]}),e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Runs ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The action this choice performs."}),e.jsx("select",{value:t.verb,onChange:n=>x({verb:n.target.value}),className:"select",children:ae.map(n=>e.jsx("option",{value:n,children:n},n))})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Code"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Short token for double-scan selection."}),e.jsx("input",{value:t.code??"",onChange:n=>x({code:n.target.value||void 0}),className:"input w-[10rem] font-mono",placeholder:"COLLECT"})]}),e.jsxs("label",{className:"block flex-1 min-w-[14rem]",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Confirmation"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Ask before running — empty runs on tap."}),e.jsx("input",{value:((p=t.confirm)==null?void 0:p.prompt)??"",onChange:n=>x({confirm:n.target.value?{prompt:n.target.value}:void 0}),className:"input w-full",placeholder:"Run without asking"})]}),e.jsxs("label",{className:"flex items-end gap-2 pb-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.requireActingIdentity,onChange:n=>x({requireActingIdentity:n.target.checked||void 0})}),e.jsx("span",{className:"text-xs text-text-secondary",title:"This choice runs only for a badged (or write-capable) user.",children:"Requires acting identity"})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Params (JSON)"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The verb's parameters — resolverPayload, targetRole, metadata, durationMinutes."}),e.jsx("textarea",{value:o,onChange:n=>i(n.target.value),rows:3,className:"textarea w-full font-mono text-sm",placeholder:'{ "resolverPayload": { "outcome": "collected" } }'}),c&&e.jsx("span",{className:"block text-2xs text-status-error mt-1",children:c})]})]})}const ce={[d.SHOW_DETAIL]:"Show the item",[d.SHOW_LIST]:"Show all matches as a list",[d.CLAIM]:"Claim",[d.CLAIM_SHOW_DETAIL]:"Claim and show the item",[d.RELEASE]:"Release my claim",[d.RESOLVE]:"Resolve with a canned payload",[d.ESCALATE]:"Send to another queue",[d.CANCEL]:"Cancel",[d.PRESENT]:"Show reality + choices"};function oe({index:s,step:t,roleKeys:x,isLast:l,onPatch:o,onMove:m,onRemove:c}){var T,N,A,L,j,I;const[u,i]=g.useState((T=t.params)!=null&&T.resolverPayload?JSON.stringify(t.params.resolverPayload,null,2):""),[p,n]=g.useState(null),b=a=>o({query:{...t.query,...a}}),k=a=>o({params:{...t.params,...a}}),v=a=>{if(i(a),!a.trim()){n(null),k({resolverPayload:void 0});return}try{k({resolverPayload:JSON.parse(a)}),n(null)}catch{n("Fix the JSON to save this payload.")}},y=t.query.roles??[],r=t.verb===d.PRESENT,w=t.verb===d.ESCALATE,C=t.verb===d.RESOLVE||t.verb===d.ESCALATE&&((N=t.params)==null?void 0:N.closeCurrent)==="resolve";return e.jsxs("div",{className:"py-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-2xs font-semibold uppercase tracking-widest text-text-quaternary",children:["Step ",s+1]}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>m(-1),disabled:s===0,className:"icon-link disabled:opacity-30",title:"Move up",children:e.jsx(z,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>m(1),disabled:l,className:"icon-link disabled:opacity-30",title:"Move down",children:e.jsx(Q,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:c,className:"icon-link",title:"Remove step",children:e.jsx(q,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsxs("div",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Look in"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The queues the item is expected in — empty means any."}),e.jsx(W,{values:y,options:x,onChange:a=>b({roles:a.length?a:void 0}),addLabel:"Add a queue…",emptyText:"Any queue I can see",ariaLabel:"Add a queue"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Held by"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Narrow to claimed, unclaimed, or my items."}),e.jsxs("select",{value:t.query.availability??"any",onChange:a=>b({availability:a.target.value==="any"?void 0:a.target.value}),className:"select",children:[e.jsx("option",{value:"any",children:"Anyone / unheld"}),e.jsx("option",{value:"available",children:"Unclaimed only"}),e.jsx("option",{value:"claimed",children:"Claimed only"}),e.jsx("option",{value:"mine",children:"Mine only"})]})]}),e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Then ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The action this step performs on a match."}),e.jsx("select",{value:t.verb,onChange:a=>o({verb:a.target.value,params:void 0,confirm:void 0,choices:void 0,autoSelectSingle:void 0}),className:"select",children:Object.entries(ce).map(([a,P])=>e.jsx("option",{value:a,children:P},a))})]}),w&&e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Send to ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The queue the item re-homes to."}),e.jsxs("select",{value:((A=t.params)==null?void 0:A.targetRole)??"",onChange:a=>k({targetRole:a.target.value||void 0}),className:"select font-mono",children:[e.jsx("option",{value:"",disabled:!0,children:"Choose…"}),x.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),w&&e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Current item"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Close out the located item first."}),e.jsxs("select",{value:((L=t.params)==null?void 0:L.closeCurrent)??"",onChange:a=>k({closeCurrent:a.target.value||void 0}),className:"select",children:[e.jsx("option",{value:"",children:"Leave it open"}),e.jsx("option",{value:"resolve",children:"Resolve it"}),e.jsx("option",{value:"cancel",children:"Cancel it"})]})]}),!r&&e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Confirmation"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Ask before acting — the prompt shows on the item."}),e.jsx("input",{value:((j=t.confirm)==null?void 0:j.prompt)??"",onChange:a=>o({confirm:a.target.value?{prompt:a.target.value}:void 0}),className:"input w-full min-w-[16rem]",placeholder:"Run without asking"})]}),e.jsxs("label",{className:"flex items-end gap-2 pb-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.requireActingIdentity,onChange:a=>o({requireActingIdentity:a.target.checked||void 0})}),e.jsx("span",{className:"text-xs text-text-secondary",title:"This step runs only for a badged (or write-capable) user.",children:"Requires acting identity"})]}),r&&((I=t.choices)==null?void 0:I.length)===1&&e.jsxs("label",{className:"flex items-end gap-2 pb-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.autoSelectSingle,onChange:a=>o({autoSelectSingle:a.target.checked||void 0})}),e.jsx("span",{className:"text-xs text-text-secondary",title:"With one choice, the scan runs it directly instead of presenting; a badge is still collected first when required.",children:"Auto-select the single choice"})]})]}),C&&e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Resolver payload ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsxs("span",{className:"block text-2xs text-text-tertiary mb-1",children:["JSON submitted as the resolution. ","{scan.target}",", ","{scan.category}"," and ","{scan.scannedAt}"," fill in from the scan."]}),e.jsx("textarea",{value:u,onChange:a=>v(a.target.value),rows:3,className:"textarea w-full font-mono text-sm",placeholder:'{ "outcome": "collected", "serial": "{scan.target}" }'}),p&&e.jsx("span",{className:"block text-2xs text-status-error mt-1",children:p})]}),r&&e.jsx(le,{choices:t.choices??[],onChange:a=>o({choices:a.length?a:void 0,...a.length===1?{}:{autoSelectSingle:void 0}})})]})}const H=()=>({query:{},verb:d.SHOW_DETAIL});function ie({schemeVersion:s,schemeKind:t,category:x,rule:l,codePreview:o,onDeleted:m}){var P,M;const c=J(),u=B(),{data:i}=F(),p=((i==null?void 0:i.roles)??[]).map(h=>h.role),n=t===_.IDENTITY,[b,k]=g.useState((l==null?void 0:l.name)??""),[v,y]=g.useState((l==null?void 0:l.steps)??(n?[]:[H()])),[r,w]=g.useState(((P=l==null?void 0:l.fallback)==null?void 0:P.markdown)??""),[C,T]=g.useState(((M=l==null?void 0:l.notPrimed)==null?void 0:M.markdown)??""),[N,A]=g.useState((l==null?void 0:l.enabled)??!0),L=(h,f)=>y(E=>E.map((S,R)=>R===h?{...S,...f}:S)),j=(h,f)=>y(E=>{const S=[...E],R=h+f;return R<0||R>=S.length?E:([S[h],S[R]]=[S[R],S[h]],S)}),I=h=>y(f=>f.filter((E,S)=>S!==h)),a=()=>c.mutate({scheme_version:s,category:x,name:b,steps:n?[]:v,fallback:{markdown:r||void 0},notPrimed:{markdown:C||void 0},enabled:N});return e.jsxs("div",{className:"space-y-8 max-w-form",children:[e.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["1 · Friendly name ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:n?'Name the badge population — "Associate badge".':'Print this beside the code — "Send Printer to Servicing".'}),e.jsx("input",{value:b,onChange:h=>k(h.target.value),className:"input w-full"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Status"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Disabled rules report unconfigured."}),e.jsxs("select",{value:N?"enabled":"disabled",onChange:h=>A(h.target.value==="enabled"),className:"select",children:[e.jsx("option",{value:"enabled",children:"Enabled"}),e.jsx("option",{value:"disabled",children:"Disabled"})]})]})]}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("span",{className:"block text-xs text-text-secondary",children:["2 · Conditions and actions ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary",children:'Scanning walks the steps in order — the first query that finds the item runs its action. Put the expected state first and a broad "show the item" last so a misplaced item still reports where it is.'})]}),e.jsx("div",{className:"divide-y divide-surface-border border-y border-surface-border",children:v.map((h,f)=>e.jsx(oe,{index:f,step:h,roleKeys:p,isLast:f===v.length-1,onPatch:E=>L(f,E),onMove:E=>j(f,E),onRemove:()=>I(f)},f))}),e.jsxs("button",{type:"button",onClick:()=>y(h=>[...h,H()]),className:"flex items-center gap-1.5 text-sm text-accent hover:text-accent-hover",children:[e.jsx(O,{className:"w-3.5 h-3.5"})," Add a step"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:n?"2 · When the badge is unknown":"3 · When nothing matches"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:n?"Markdown shown when a scanned badge matches no user.":"Markdown shown to the scanner operator when no step finds the item."}),e.jsx("textarea",{value:r,onChange:h=>w(h.target.value),rows:3,className:"textarea w-full font-mono text-sm",placeholder:n?"**Badge not recognized.** See your lead to get it registered.":"**Nothing here.** The item this code points at is not in any queue."})]}),!n&&e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"When a badge is required"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Markdown shown when a step or choice needs an acting identity and none is primed."}),e.jsx("textarea",{value:C,onChange:h=>T(h.target.value),rows:3,className:"textarea w-full font-mono text-sm",placeholder:"**Scan your badge** to run this action."})]})]}),c.error&&e.jsx("p",{className:"text-xs text-status-error",children:c.error.message}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:a,disabled:!b||!n&&v.length===0||c.isPending,className:"btn-primary text-xs",children:l?"Save rule":`Create rule ${s}:${x}`}),e.jsx("span",{className:"text-2xs text-text-quaternary font-mono",children:o}),l&&e.jsxs("button",{type:"button",onClick:()=>u.mutate({scheme_version:s,category:x},{onSuccess:m}),className:"ml-auto flex items-center gap-1 text-xs text-status-error/80 hover:text-status-error",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Delete rule"]})]})]})}function xe(s){for(let t=0;t<=9;t++)if(!s.has(String(t)))return String(t);return null}function D({icon:s,label:t,annotation:x,aside:l,children:o}){return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(s,{className:"w-3 h-3 text-text-tertiary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:t}),x&&e.jsxs("span",{className:"text-2xs text-text-quaternary truncate",children:["— ",x]})]}),l]}),e.jsx("div",{className:"border-l-2 pl-5 border-surface-border/60",children:o})]})}function Ne(){const{version:s}=ee(),t=Number(s),[x,l]=te(),{data:o,isLoading:m}=V(Number.isInteger(t)?t:null),c=x.get("category"),u=r=>{l(w=>{const C=new URLSearchParams(w);return r?C.set("category",r):C.delete("category"),C})};if(m)return e.jsx("div",{className:"text-sm text-text-tertiary",children:"Loading…"});if(!o)return e.jsxs("div",{className:"text-sm text-text-tertiary",children:["No scheme for version ",s,"."]});const{scheme:i,rules:p}=o,n=new Map(p.map(r=>[r.category,r])),b=c?n.get(c)??null:null,k=xe(new Set(p.map(r=>r.category))),v=i.encoding==="fixed"?"7".repeat(i.target_length??8):"SN-1234",y=r=>i.encoding==="fixed"?`${i.version}${r}${v}`:`${i.version}${i.delimiter}${r}${i.delimiter}${v}`;return e.jsxs("div",{className:"space-y-10",children:[e.jsx(Y,{title:i.name}),e.jsxs("p",{className:"text-sm text-text-secondary max-w-form -mt-4",children:["Codes for this scheme start with ",e.jsx("span",{className:"font-mono text-text-primary",children:i.version}),".",i.kind===_.IDENTITY?" Scanning a badge primes who acts next; each slot names the badge and its unknown-badge message.":" Add an action, name it, and configure what a scan does — each action gets its own slot automatically."]}),e.jsx(de,{scheme:i,ruleCount:p.length},i.version),e.jsx(D,{icon:X,label:"Actions",annotation:i.kind===_.IDENTITY?"named badge slots — each carries its unknown-badge message":"what a scan of this scheme does — named, in the order you add them",children:e.jsxs("div",{className:"divide-y divide-surface-border border-y border-surface-border max-w-form",children:[p.map(r=>{const w=c===r.category;return e.jsxs("button",{type:"button",onClick:()=>u(w?null:r.category),className:`w-full flex items-center gap-4 py-3 px-2 text-left transition-colors ${w?"bg-accent/10":"hover:bg-surface-sunken"}`,children:[e.jsx("span",{className:"w-9 h-8 flex items-center justify-center text-xs font-mono text-accent border border-surface-border rounded shrink-0",children:r.category}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-text-primary truncate",children:r.name}),e.jsx("div",{className:"text-2xs text-text-tertiary font-mono truncate",children:y(r.category)})]})]},r.category)}),e.jsxs("div",{className:"flex items-center gap-4 py-3 px-2",children:[e.jsx("span",{className:"w-9 h-8 flex items-center justify-center text-text-quaternary shrink-0",children:e.jsx($,{className:"w-4 h-4",strokeWidth:1.5})}),k==null?e.jsx("span",{className:"text-2xs text-text-quaternary",children:"All 10 action slots are in use."}):e.jsxs("button",{type:"button",onClick:()=>u(k),className:"flex items-center gap-1.5 text-sm text-accent hover:text-accent-hover",children:[e.jsx(O,{className:"w-3.5 h-3.5"})," Add an action"]})]})]})}),c&&e.jsx(D,{icon:$,label:b?b.name:"New action",annotation:`this label prints beside the code — e.g. ${y(c)}`,children:e.jsx(ie,{schemeVersion:i.version,schemeKind:i.kind,category:c,rule:b,codePreview:y(c),onDeleted:()=>u(null)},`${i.version}:${c}`)})]})}function de({scheme:s,ruleCount:t}){const x=se(),l=U(),o=G(),[m,c]=g.useState(s.name),[u,i]=g.useState(s.kind),[p,n]=g.useState(s.target_facet),[b,k]=g.useState(s.grant_ttl_seconds??3600),[v,y]=g.useState(s.grant_max_uses??0),[r,w]=g.useState(s.enabled),[C,T]=g.useState(!1),N=u===_.IDENTITY,A=!N||b>=1&&b<=86400,L=m!==s.name||p!==s.target_facet||r!==s.enabled||u!==s.kind||N&&(b!==s.grant_ttl_seconds||v!==s.grant_max_uses);return e.jsxs(D,{icon:Z,label:"Scheme",annotation:`version digit ${s.version}`,aside:e.jsxs("button",{type:"button",onClick:()=>T(!0),className:"flex items-center gap-1 text-xs text-status-error/80 hover:text-status-error",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Delete scheme"]}),children:[e.jsxs("div",{className:"flex flex-wrap items-end gap-4 max-w-form",children:[e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Kind ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:N?"A badge — scanning it primes who acts next.":"An item code — scanning it acts on the item."}),e.jsxs("select",{value:u,onChange:j=>i(j.target.value),className:"select",children:[e.jsx("option",{value:_.ACTION,children:"Action"}),e.jsx("option",{value:_.IDENTITY,children:"Identity"})]})]}),e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Name ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:N?"Say who the badge identifies.":"Say what the target identifies."}),e.jsx("input",{value:m,onChange:j=>c(j.target.value),className:"input w-full"})]}),e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Target facet ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:N?"The user-metadata key the badge matches (e.g. badge_id).":"The metadata key the scanned value matches."}),e.jsx("input",{value:p,onChange:j=>n(j.target.value),className:"input w-full font-mono"})]}),N&&e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Grant TTL (seconds) ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"How long a badge scan stays primed (1–86400)."}),e.jsx("input",{type:"number",min:1,max:86400,value:b,onChange:j=>k(Number(j.target.value)),className:"input w-[12rem]"}),!A&&e.jsx("span",{className:"block text-2xs text-status-error mt-1",children:"Enter 1–86400 seconds."})]}),N&&e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Grant max uses"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"0 = TTL-bound; n = the grant covers n scans."}),e.jsx("input",{type:"number",min:0,value:v,onChange:j=>y(Number(j.target.value)),className:"input w-[12rem]"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Status"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Disable to reject every scan of this version."}),e.jsxs("select",{value:r?"enabled":"disabled",onChange:j=>w(j.target.value==="enabled"),className:"select",children:[e.jsx("option",{value:"enabled",children:"Enabled"}),e.jsx("option",{value:"disabled",children:"Disabled"})]})]}),L&&e.jsx("button",{type:"button",disabled:l.isPending||!m||!p||!A,onClick:()=>l.mutate({version:s.version,name:m,description:s.description,target_facet:p,encoding:s.encoding,delimiter:s.delimiter,target_length:s.target_length,kind:u,grant_ttl_seconds:N?b:null,grant_max_uses:N?v:0,enabled:r}),className:"btn-primary text-xs",children:"Save"})]}),l.error&&e.jsx("p",{className:"text-xs text-status-error mt-2",children:l.error.message}),e.jsx(K,{open:C,onClose:()=>T(!1),onConfirm:()=>o.mutate(s.version,{onSuccess:()=>x("/admin/scan-codes")}),title:`Delete scheme ${s.version}`,description:t>0?`This deletes "${s.name}" and its ${t} ${t===1?"rule":"rules"}. Codes starting with ${s.version} stop resolving, and labels already printed with them report unconfigured.`:`This deletes "${s.name}". Codes starting with ${s.version} stop resolving.`,isPending:o.isPending,error:o.error})]})}export{Ne as ScanSchemeDetailPage};
|
|
2
|
-
//# sourceMappingURL=ScanSchemeDetailPage-BnivPUJY.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,a as o}from"./vendor-query-RUZdMvN6.js";import{ab as E,aO as O,aP as R,a9 as A,X as B,aQ as L,aR as P,aS as C,a7 as v}from"./index-CdavRyaX.js";import{a as _,aV as W,aW as F}from"./vendor-icons-h-jlRSb9.js";import{M as D}from"./Modal-BU7No9NH.js";import{d as V}from"./metadata-display--TzK0REC.js";import{a as U,u as $}from"./vendor-react-CdqEC2zv.js";function q({stationName:t}){return e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center py-24",children:[e.jsx(_,{className:"w-10 h-10 text-accent-muted mb-8",strokeWidth:1}),e.jsx("h1",{className:"text-3xl font-light text-text-primary tracking-tight",children:t}),e.jsx("div",{className:"w-16 border-t border-surface-border my-8"}),e.jsx("p",{className:"text-lg text-text-secondary",children:"Scan your badge to begin"}),e.jsx("p",{className:"text-sm text-text-tertiary mt-2",children:"or scan an item"})]})}function H(t){const r=Math.floor(t/60),c=t%60;return`${r}:${String(c).padStart(2,"0")}`}function Y(){const{identity:t,remainingSeconds:r}=E(),[,c]=o.useState(0);return o.useEffect(()=>{if(!(t!=null&&t.expiresAt))return;const a=setInterval(()=>c(f=>f+1),1e3);return()=>clearInterval(a)},[t]),t?e.jsxs("div",{className:"flex items-center gap-2.5 pb-3 mb-6 border-b border-surface-border",children:[e.jsx(W,{className:"w-4 h-4 text-status-success shrink-0",strokeWidth:1.5}),e.jsxs("span",{className:"text-sm font-medium text-text-primary",children:["Hi ",t.displayName]}),t.expiresAt&&e.jsx("span",{className:"ml-auto text-sm font-mono tabular-nums text-text-tertiary",children:H(r())})]}):null}function M(t,r){return!t.withheld||r}function X(t,r,c){return t.find(a=>!!a.code&&a.code===c&&M(a,r))??null}function G(t){return t==null||t===""?"—":typeof t=="boolean"?t?"Yes":"No":typeof t=="object"?JSON.stringify(t):String(t)}function J({label:t,value:r}){return e.jsxs("div",{className:"flex items-baseline gap-4 py-2",children:[e.jsx("span",{className:"w-32 shrink-0 text-2xs uppercase tracking-wide text-text-quaternary",children:t}),e.jsx("span",{className:"text-sm text-text-primary break-words",children:r})]})}function I(){return e.jsx("span",{className:"text-text-quaternary select-none",children:"·"})}function Q({response:t,hasActingIdentity:r,selfId:c,busy:a,onExecute:f,onWithheldSelect:n}){var i,m;const{setCodeInterceptor:h}=O(),[x,d]=o.useState(null),l=t.escalation??{},u=t.choices??[],S=l.metadata??{},b=s=>{s.confirm?d(s):f(s)},j=o.useRef({choices:u,hasActingIdentity:r,select:b});j.current={choices:u,hasActingIdentity:r,select:b},o.useEffect(()=>(h(s=>{const p=j.current,T=X(p.choices,p.hasActingIdentity,s);return T?(p.select(T),!0):!1}),()=>h(null)),[h]);const g=l.assigned_to??null,k=g?g===c?"Claimed by you":"Claimed":"Unclaimed",w=g===c?"text-accent":"text-text-secondary",N=[l.type,l.subtype].filter(Boolean).join(" · "),y=V(S);return e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col max-w-form",children:[e.jsxs("div",{children:[((i=t.rule)==null?void 0:i.name)&&e.jsx("div",{className:"text-2xs font-semibold uppercase tracking-widest text-accent mb-2",children:t.rule.name}),e.jsx("h2",{className:"text-2xl font-medium leading-tight text-text-primary mb-2",children:l.description||N||"Located item"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-text-secondary mb-5",children:[e.jsx("span",{children:String(l.role??"—")}),N&&e.jsxs(e.Fragment,{children:[e.jsx(I,{}),e.jsx("span",{children:N})]}),e.jsx(I,{}),e.jsx("span",{className:w,children:k}),typeof l.created_at=="string"&&e.jsxs(e.Fragment,{children:[e.jsx(I,{}),e.jsx("span",{children:R(l.created_at)})]})]}),y.length>0&&e.jsx("div",{className:"divide-y divide-surface-border border-t border-surface-border",children:y.map(([s,p])=>e.jsx(J,{label:s,value:G(p)},s))})]}),e.jsx("div",{className:"mt-8 space-y-3",children:u.map(s=>{const p=M(s,r);return e.jsx("div",{children:e.jsx("button",{type:"button",disabled:a,onClick:()=>p?b(s):n(s),className:"w-full text-left px-5 py-4 text-lg text-text-primary border border-surface-border rounded hover:bg-surface-sunken transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:e.jsxs("span",{className:"flex items-baseline gap-3",children:[s.label,s.code&&e.jsx("span",{className:"ml-auto text-2xs font-mono text-text-quaternary",children:s.code})]})})},s.index)})}),x&&e.jsx(D,{open:!0,onClose:()=>d(null),title:x.label,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-secondary",children:(m=x.confirm)==null?void 0:m.prompt}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:()=>d(null),disabled:a,className:"btn-secondary text-xs",children:"No, go back"}),e.jsx("button",{type:"button",onClick:()=>{const s=x;d(null),f(s)},disabled:a,className:"btn-primary text-xs",children:"Yes, continue"})]})]})})]})}function z({choice:t,notPrimedMarkdown:r,primed:c,busy:a,onExecute:f,onCancel:n}){var l;const[h,x]=o.useState(!1),d=o.useRef(!1);return o.useEffect(()=>{if(!c){d.current=!1;return}d.current||(d.current=!0,t.confirm?x(!0):f(t))},[c,t,f]),e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center py-24",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[e.jsx(_,{className:"w-8 h-8 text-text-quaternary",strokeWidth:1}),e.jsx(F,{className:"w-10 h-10 text-accent-muted",strokeWidth:1})]}),e.jsx("h2",{className:"text-2xl font-light text-text-primary tracking-tight",children:"Scan your badge to continue"}),e.jsxs("p",{className:"text-lg text-text-secondary mt-2",children:["to ",t.label]}),r&&e.jsx("div",{className:"text-sm text-text-tertiary mt-6 max-w-prose",children:e.jsx(A,{content:r,compact:!0})}),e.jsx("div",{className:"w-16 border-t border-surface-border my-8"}),e.jsx("button",{type:"button",onClick:n,disabled:a,className:"text-sm text-text-tertiary hover:text-text-secondary hover:underline",children:"Cancel"}),h&&e.jsx(D,{open:!0,onClose:n,title:t.label,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-secondary",children:(l=t.confirm)==null?void 0:l.prompt}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:n,disabled:a,className:"btn-secondary text-xs",children:"No, go back"}),e.jsx("button",{type:"button",onClick:()=>{x(!1),f(t)},disabled:a,className:"btn-primary text-xs",children:"Yes, continue"})]})]})})]})}const K=8e3,Z=[v.SHOW_DETAIL,v.CLAIM,v.CLAIM_SHOW_DETAIL];function ce(){var y;const t=U(),r=$(),{user:c}=B(),{identity:a,clear:f}=E(),[n,h]=o.useState(null),[x,d]=o.useState(null),[l,u]=o.useState(null),[S,b]=o.useState(!1);o.useEffect(()=>{var s,p;const i=(s=t.state)==null?void 0:s[L];if(!i)return;h(i),u(null);const m=((p=i.choices)==null?void 0:p.length)===1?i.choices[0]:void 0;d(i.autoSelect&&m?{choice:m,returnTo:"idle"}:null),r(t.pathname,{replace:!0,state:null})},[t,r]),o.useEffect(()=>{if(!l)return;const i=setTimeout(()=>u(null),K);return()=>clearTimeout(i)},[l]);const j=o.useCallback(async i=>{if(!(!(n!=null&&n.rule)||!n.escalation)){b(!0);try{const m=await P({schemeVersion:n.rule.schemeVersion,category:n.rule.category,stepIndex:n.stepIndex??0,choiceIndex:i.index,escalationId:String(n.escalation.id),actingToken:a==null?void 0:a.actingToken});switch(m.outcome){case C.EXECUTED:if(h(null),d(null),Z.includes(i.verb)&&m.escalation){r(`/escalations/detail/${m.escalation.id}`);break}u({at:Date.now(),tone:"text-status-success",text:`${i.label} — done`});break;case C.CONFLICT:h(null),d(null),u({at:Date.now(),tone:"text-status-warning",text:m.error||"The item changed since it was scanned — scan it again."});break;case C.UNCONFIGURED:h(null),d(null),u({at:Date.now(),tone:"text-status-warning",text:m.error||"This choice is no longer configured."});break;case C.NOT_PRIMED:f(),u(null),d(s=>({choice:i,returnTo:(s==null?void 0:s.returnTo)??"choices"}));break;default:u({at:Date.now(),tone:"text-status-error",text:m.error||"The choice did not run."})}}catch(m){u({at:Date.now(),tone:"text-status-error",text:m.message})}finally{b(!1)}}},[n,a,r,f]),g=o.useCallback(i=>{d({choice:i,returnTo:"choices"})},[]),k=o.useCallback(()=>{(x==null?void 0:x.returnTo)==="idle"&&h(null),d(null)},[x]),w=(c==null?void 0:c.displayName)||(c==null?void 0:c.username)||"Scan station",N=!!(n!=null&&n.choices&&n.escalation);return e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[e.jsx(Y,{}),x&&n?e.jsx(z,{choice:x.choice,notPrimedMarkdown:(y=n.notPrimed)==null?void 0:y.markdown,primed:!!a,busy:S,onExecute:j,onCancel:k}):N?e.jsx(Q,{response:n,hasActingIdentity:!!a,selfId:(a==null?void 0:a.actorId)??(c==null?void 0:c.userId)??null,busy:S,onExecute:j,onWithheldSelect:g},String(n.escalation.id)):e.jsx(q,{stationName:w}),l&&e.jsxs("div",{role:"status",className:"mt-8 pt-3 border-t border-surface-border",children:[e.jsx("span",{className:`text-sm font-medium ${l.tone}`,children:l.text}),l.markdown&&e.jsx("div",{className:"text-sm text-text-secondary mt-1",children:e.jsx(A,{content:l.markdown,compact:!0})})]})]})}export{ce as ScanStationPage};
|
|
2
|
-
//# sourceMappingURL=ScanStationPage-DCSA7pcV.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,a as m}from"./vendor-query-RUZdMvN6.js";import{h as P}from"./mcp-CCOzN8dH.js";import{J as z}from"./index-CdavRyaX.js";import{R as L}from"./RunAsSelector-1k1J1_cv.js";import{T as B}from"./ToolPill-C6hkOqPx.js";import{A as k,ax as S,X as F,aB as M,i as W,az as _}from"./vendor-icons-h-jlRSb9.js";import{u as $,L as E}from"./vendor-react-CdqEC2zv.js";import{b as D}from"./helpers-DzO-OGPe.js";function I({name:t,serverId:n,short:a=!0}){const x=$(),r=a?t.replace(/^long-tail-/,""):t;return n?e.jsxs("button",{onClick:c=>{c.stopPropagation(),x(`/mcp/servers/${n}`)},className:"group/srv inline-flex items-center gap-1 text-2xs font-mono text-text-tertiary hover:text-accent transition-colors",title:t,children:[e.jsx(k,{className:"w-2.5 h-2.5 shrink-0 text-text-quaternary group-hover/srv:text-accent",strokeWidth:1.5}),r,e.jsx(S,{className:"w-2 h-2 shrink-0 invisible group-hover/srv:visible text-accent",strokeWidth:1.5})]}):e.jsxs("span",{className:"inline-flex items-center gap-1 text-2xs font-mono text-text-tertiary",title:t,children:[e.jsx(k,{className:"w-2.5 h-2.5 shrink-0 text-text-quaternary",strokeWidth:1.5}),r]})}function U({error:t}){const n=t instanceof Error?t.message:"";return n.startsWith("No credential found for provider")?e.jsxs("div",{className:"bg-status-warning/10 border border-status-warning/30 rounded-md px-3 py-2 flex items-start gap-2",children:[e.jsx(_,{size:14,className:"text-status-warning mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-medium text-text-primary mb-0.5",children:"Credential required"}),e.jsx("p",{className:"text-2xs text-text-secondary mb-1",children:n}),e.jsxs(E,{to:"/credentials",className:"text-2xs text-accent hover:underline inline-flex items-center gap-1",children:["Go to Credentials ",e.jsx(S,{size:10})]})]})]}):e.jsx("div",{className:"bg-status-error/10 border border-status-error/20 rounded-md px-3 py-2",children:e.jsx("p",{className:"text-2xs text-status-error",children:n||"Tool call failed"})})}function K({data:t}){const n=t==null?void 0:t.result,a=n==null?void 0:n.job_id,x=(n==null?void 0:n.namespace)||"";return a?e.jsxs(E,{to:`/mcp/executions/${encodeURIComponent(a)}?namespace=${encodeURIComponent(x)}`,className:"inline-flex items-center gap-1.5 text-xs text-accent hover:underline",children:[e.jsx(S,{size:12}),"View Execution"]}):null}const N="input text-xs",J="label";function V({value:t,onChange:n,className:a}){const[x,r]=m.useState(t.join(", ")),c=()=>n(x.split(",").map(o=>o.trim()).filter(Boolean));return m.useEffect(()=>{r(t.join(", "))},[JSON.stringify(t)]),e.jsx("input",{type:"text",value:x,onChange:o=>r(o.target.value),onBlur:c,onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),c())},placeholder:"comma-separated values",className:a})}function te({serverId:t,serverName:n,tool:a,onClose:x}){const r=P(),[c,o]=m.useState(!1),[d,p]=m.useState({}),[g,b]=m.useState(""),[C,y]=m.useState(""),[v,q]=m.useState("");m.useEffect(()=>{const s=D(a.inputSchema);p(s),b(JSON.stringify(s,null,2)),o(!1),y(""),r.reset()},[a.name,t]);const O=!!r.data||!!r.error,T=()=>{if(!c)b(JSON.stringify(d,null,2));else try{p(JSON.parse(g))}catch{}o(!c)},A=()=>{y(""),r.reset();let s;if(c)try{s=JSON.parse(g)}catch{y("Invalid JSON");return}else s={...d};r.mutate({serverId:t,toolName:a.name,arguments:s,...v?{execute_as:v}:{}})};return e.jsxs("div",{className:"border-l border-surface-border bg-surface-raised",children:[e.jsxs("div",{className:"flex items-start justify-between px-4 py-3 border-b border-surface-border/50 shrink-0",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx(I,{name:n,serverId:t,short:!1}),e.jsx("div",{children:e.jsx(B,{name:a.name,size:"md"})})]}),e.jsx("button",{onClick:x,className:"p-1 text-text-quaternary hover:text-text-primary shrink-0 ml-2",children:e.jsx(F,{className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{className:"px-4 py-4 space-y-5",children:[a.description&&e.jsx("div",{className:"border-l-2 border-accent/30 pl-3 py-1",children:e.jsx("p",{className:"text-2xs text-text-secondary leading-relaxed italic",children:a.description})}),e.jsxs("div",{children:[e.jsx("label",{className:J,children:"run as"}),e.jsx(L,{selected:v,onChange:q})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-2xs text-text-quaternary",children:"Parameters"}),e.jsx("button",{onClick:T,className:"text-2xs text-accent/70 hover:text-accent transition-colors",children:c?"Form view":"JSON view"})]}),c?e.jsx("textarea",{value:g,onChange:s=>b(s.target.value),className:"input-json w-full",rows:6,spellCheck:!1}):e.jsxs("div",{className:"space-y-3",children:[Object.entries(d).sort(([s],[i])=>{var f;const l=((f=a.inputSchema)==null?void 0:f.required)??[],h=l.indexOf(s),j=l.indexOf(i);return h!==-1&&j!==-1?h-j:h!==-1?-1:j!==-1?1:s.localeCompare(i)}).map(([s,i])=>{var f,w,R;const l=(w=(f=a.inputSchema)==null?void 0:f.properties)==null?void 0:w[s],h=l==null?void 0:l.description,j=(((R=a.inputSchema)==null?void 0:R.required)??[]).includes(s);return e.jsxs("div",{children:[e.jsxs("label",{className:J,children:[s,j&&e.jsx("span",{className:"text-accent/50 ml-0.5",children:"*"})]}),typeof i=="boolean"?e.jsxs("select",{value:String(i),onChange:u=>p({...d,[s]:u.target.value==="true"}),className:N,children:[e.jsx("option",{value:"true",children:"true"}),e.jsx("option",{value:"false",children:"false"})]}):Array.isArray(i)?e.jsx(V,{value:i,onChange:u=>p({...d,[s]:u}),className:N}):typeof i=="object"&&i!==null?e.jsx("textarea",{value:JSON.stringify(i,null,2),onChange:u=>{try{p({...d,[s]:JSON.parse(u.target.value)})}catch{}},className:`${N} min-h-[48px] font-mono resize-y`}):e.jsx("input",{type:typeof i=="number"?"number":"text",value:String(i??""),onChange:u=>p({...d,[s]:typeof i=="number"?Number(u.target.value):u.target.value}),className:N,placeholder:(l==null?void 0:l.type)==="string"&&(l==null?void 0:l.example)||""}),h&&e.jsx("p",{className:"text-2xs text-text-quaternary/70 mt-0.5 leading-snug",children:h})]},s)}),Object.keys(d).length===0&&e.jsx("p",{className:"text-2xs text-text-quaternary",children:"No parameters"})]}),C&&e.jsx("p",{className:"text-2xs text-status-error mt-1",children:C})]}),e.jsx("button",{onClick:A,disabled:r.isPending,className:"btn-primary text-xs disabled:opacity-50 inline-flex items-center gap-1.5",children:r.isPending?"Running...":O?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:12})," Re-run"]}):e.jsxs(e.Fragment,{children:[e.jsx(W,{size:12})," Run"]})}),r.isPending&&e.jsxs("div",{className:"animate-pulse",children:[e.jsx("p",{className:"text-2xs text-text-quaternary mb-1",children:"Response"}),e.jsx("div",{className:"h-20 bg-surface-sunken/50 rounded-md"})]}),r.data?e.jsxs("div",{className:"space-y-2",children:[e.jsx(z,{data:r.data,label:"Response",defaultCollapsed:!0}),e.jsx(K,{data:r.data})]}):null,r.error?e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-text-quaternary mb-1",children:"Response"}),e.jsx(U,{error:r.error})]}):null]})]})}export{I as S,te as T};
|
|
2
|
-
//# sourceMappingURL=ToolTestPanel-CZvegH_w.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./vendor-query-RUZdMvN6.js";import{ai as t}from"./index-CdavRyaX.js";function m({userId:a,fallback:s}){const{data:e}=t(a);return e?r.jsx(r.Fragment,{children:e.display_name||e.email||e.external_id}):r.jsx(r.Fragment,{children:s??`${a.slice(0,8)}…`})}export{m as U};
|
|
2
|
-
//# sourceMappingURL=UserName-BovQxdSY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserName-BovQxdSY.js","sources":["../../src/components/common/display/UserName.tsx"],"sourcesContent":["import { useUser } from '../../../api/users';\n\n/**\n * Resolves a user ID to their display name (or email, or truncated ID as fallback).\n * Renders inline — suitable for use inside <span>, <p>, etc.\n */\nexport function UserName({ userId, fallback }: { userId: string; fallback?: string }) {\n const { data: resolved } = useUser(userId);\n\n if (resolved) {\n return <>{resolved.display_name || resolved.email || resolved.external_id}</>;\n }\n\n // Still loading or no record — show fallback or truncated ID\n return <>{fallback ?? `${userId.slice(0, 8)}…`}</>;\n}\n"],"names":["UserName","userId","fallback","resolved","useUser","jsx","Fragment"],"mappings":"wFAMO,SAASA,EAAS,CAAE,OAAAC,EAAQ,SAAAC,GAAmD,CACpF,KAAM,CAAE,KAAMC,GAAaC,EAAQH,CAAM,EAEzC,OAAIE,oBACQ,SAAAA,EAAS,cAAgBA,EAAS,OAASA,EAAS,YAAY,EAIrEE,EAAAA,IAAAC,EAAAA,SAAA,CAAG,YAAY,GAAGL,EAAO,MAAM,EAAG,CAAC,CAAC,GAAA,CAAI,CACjD"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as w,j as e}from"./vendor-query-RUZdMvN6.js";import{a3 as k,a4 as C,a5 as E,v as b}from"./index-CdavRyaX.js";import{s as P,aq as S,ar as T,as as y,ai as $,aj as L,at as O}from"./vendor-icons-h-jlRSb9.js";import{E as _}from"./EntityTimelinePanel-DzMuV7ZX.js";import{F,b as v,c as f,a as R}from"./FilterBar-CcIgQH9h.js";import{P as A}from"./PriorityBadge-BETdj4M-.js";import{R as W}from"./RolePill-Di_5hfvw.js";import{W as I}from"./WorkflowPill-CN-952iI.js";import{C as q,a as B,i as K}from"./CountdownTimer-BKMmFie6.js";import{L as g}from"./vendor-react-CdqEC2zv.js";function ae({role:t,options:s,onChange:d,emptyLabel:x="All Escalations",locked:p=!1}){var a;const[i,n]=w.useState(!1),o=w.useRef(null);w.useEffect(()=>{if(!i)return;const l=h=>{o.current&&!o.current.contains(h.target)&&n(!1)},u=h=>{h.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",l),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",u)}},[i]);const m=t?((a=s.find(l=>l.value===t))==null?void 0:a.label)??k(t):x,r=l=>`w-full text-left px-3 py-1.5 text-sm flex items-baseline gap-2 transition-colors ${l?"text-accent bg-accent/5":"text-text-primary hover:bg-surface-hover"}`;return p?e.jsx("h1",{className:"heading-1 min-w-0 truncate","data-testid":"escalation-title-locked",children:m}):e.jsxs("div",{ref:o,className:"relative min-w-0",children:[e.jsxs("button",{type:"button",onClick:()=>n(l=>!l),className:"group flex items-center gap-2 min-w-0 heading-1 hover:text-accent transition-colors",children:[e.jsx("span",{className:"truncate",children:m}),e.jsx(P,{className:`w-6 h-6 shrink-0 text-text-tertiary group-hover:text-accent transition-transform ${i?"rotate-180":""}`,strokeWidth:1.5})]}),i&&e.jsxs("div",{className:"absolute z-[100] top-full left-0 mt-2 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("button",{type:"button",onClick:()=>{d(""),n(!1)},className:r(!t),children:x}),s.length>0&&e.jsx("div",{className:"h-px bg-surface-border my-1"}),s.map(l=>e.jsxs("button",{type:"button",onClick:()=>{d(l.value),n(!1)},className:r(t===l.value),children:[e.jsx("span",{className:"truncate",children:l.label}),l.label!==l.value&&e.jsx("span",{className:"text-2xs font-mono text-text-quaternary shrink-0",children:l.value})]},l.value))]})]})}const j="text-text-secondary transition-colors group-hover/row:text-text-primary";function M({row:t}){if(B(t)){const s=t.status==="resolved"?"text-status-success":"text-text-tertiary";return e.jsx(T,{className:`w-3 h-3 shrink-0 ${s}`})}return t.status==="resolved"?e.jsx(y,{className:"w-2.5 h-2.5 shrink-0 text-status-success",strokeWidth:2.5}):t.status==="cancelled"?e.jsx(y,{className:"w-2.5 h-2.5 shrink-0 text-status-error",strokeWidth:2.5}):K(t)?e.jsx(y,{className:"w-2.5 h-2.5 shrink-0 text-status-warning",strokeWidth:2.5}):e.jsx(y,{className:"w-2.5 h-2.5 shrink-0 text-status-active",strokeWidth:2.5})}function D({metadata:t,role:s,highlightKeys:d}){const[x,p]=w.useState(!1),i=E();if(!t||Object.keys(t).length===0)return e.jsx("span",{className:"text-2xs text-text-tertiary",children:"—"});const n=d??[],o=[...n.filter(a=>a in t),...Object.keys(t).filter(a=>!n.includes(a))],m=x?o:o.slice(0,1),r=o.length-1;return e.jsx("div",{className:"w-full",onClick:a=>a.stopPropagation(),children:e.jsx("div",{className:"space-y-px",children:m.map((a,l)=>{const u=typeof t[a]=="object"&&t[a]!==null?JSON.stringify(t[a]):String(t[a]),h=n.includes(a),N=l===m.length-1;return e.jsxs("div",{className:"group/mrow flex items-center gap-1 min-w-0",children:[e.jsx("span",{className:`shrink-0 w-14 text-2xs font-mono uppercase tracking-wide truncate ${h?"text-accent":"text-text-tertiary"}`,title:a,children:a}),e.jsx("span",{className:`flex-1 min-w-0 text-2xs font-medium truncate ${h?"text-text-primary":"text-text-secondary"}`,title:u,children:u}),e.jsxs("span",{className:"flex items-center gap-px shrink-0 opacity-50 group-hover/mrow:opacity-100 transition-opacity",children:[e.jsx(g,{to:b(a,t[a],s),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Filter ${s}: ${a} = ${u}`,onClick:c=>c.stopPropagation(),children:e.jsx($,{className:"w-3 h-3"})}),e.jsx(g,{to:b(a,t[a]),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Search all: ${a} = ${u}`,onClick:c=>c.stopPropagation(),children:e.jsx(L,{className:"w-3 h-3"})}),i&&typeof t[a]=="string"&&e.jsx("button",{className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Timeline: every station ${u} has moved through`,onClick:c=>{c.stopPropagation(),i.setPanel(e.jsx(_,{facetKey:a,value:t[a],role:s}),{key:"entity-timeline",width:420})},children:e.jsx(O,{className:"w-3 h-3"})})]}),!x&&r>0&&e.jsxs("button",{onClick:c=>{c.stopPropagation(),p(!0)},className:"shrink-0 text-2xs text-text-quaternary hover:text-accent transition-colors font-mono",title:`Show ${r} more fields`,children:["+",r]}),x&&N&&r>0&&e.jsx("button",{onClick:c=>{c.stopPropagation(),p(!1)},className:"shrink-0 text-2xs text-text-quaternary hover:text-accent transition-colors",title:"Show less",children:"↑"})]},a)})})})}function U(t={}){return[{key:"description",label:"Summary",priority:1,render:s=>e.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[e.jsx("span",{className:"shrink-0",children:e.jsx(M,{row:s})}),e.jsx("span",{className:`truncate text-xs ${j}`,children:s.description||s.type})]}),className:"max-w-0"},{key:"role",label:"Role",priority:2,render:s=>e.jsx("span",{className:j,children:e.jsx(W,{role:s.role,size:"md",tone:"inherit"})}),className:"w-44 min-w-[11rem]"},{key:"priority",label:"Pri",priority:2,render:s=>e.jsx("span",{className:j,children:e.jsx(A,{priority:s.priority,size:"sm",tone:"inherit"})}),className:"w-10"},{key:"workflow_type",label:"Workflow",priority:2,showFrom:"split",render:s=>e.jsx(I,{type:s.workflow_type||s.type}),className:"w-40 whitespace-nowrap"},{key:"metadata",label:"Metadata",priority:2,showFrom:"wall",render:s=>e.jsx(D,{metadata:s.metadata,role:s.role,highlightKeys:t.highlightKeys}),className:"w-80 max-w-[19rem] align-top"},{key:"created_at",label:"Ago",priority:1,render:s=>e.jsx("span",{className:`text-xs tabular-nums ${j}`,title:s.created_at,children:C(s.created_at)}),className:"w-14 whitespace-nowrap"}]}const re=U(),le={key:"expires",label:e.jsx(S,{className:"w-3.5 h-3.5 text-text-tertiary"}),render:t=>t.assigned_until?e.jsx(q,{until:t.assigned_until}):e.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-16 whitespace-nowrap",priority:1},z=[{value:"1",label:"P1"},{value:"2",label:"P2"},{value:"3",label:"P3"},{value:"4",label:"P4"}],H=[{value:"all",label:"All"},{value:"available",label:"Available"},{value:"claimed",label:"Claimed"},{value:"resolved",label:"Resolved"},{value:"cancelled",label:"Cancelled"},{value:"expired",label:"Expired"}];function ne({filters:t,setFilter:s,roles:d,types:x,showStatus:p=!1,showSearch:i=!0,showRole:n=!0,actions:o}){const m=[t.role,t.type,t.priority,t.status&&t.status!=="all"?t.status:"",t.search??""].filter(Boolean).length;return e.jsxs(F,{actions:o,activeFilterCount:m,children:[p&&e.jsxs(e.Fragment,{children:[e.jsx(v,{label:"Status",value:t.status??"",onChange:r=>s("status",r),options:H}),e.jsx(f,{})]}),n&&e.jsxs(e.Fragment,{children:[e.jsx(v,{label:"Role",value:t.role,onChange:r=>s("role",r),options:d.map(r=>({value:r,label:r}))}),e.jsx(f,{})]}),e.jsx(v,{label:"Priority",value:t.priority,onChange:r=>s("priority",r),options:z}),e.jsx(f,{}),e.jsx(v,{label:"Workflow Type",value:t.type,onChange:r=>s("type",r),options:x.map(r=>({value:r,label:r}))}),i&&e.jsxs(e.Fragment,{children:[e.jsx(f,{}),e.jsx(R,{label:"Search",value:t.search??"",onChange:r=>s("search",r),placeholder:"ID, workflow, origin…"})]})]})}export{ae as E,le as T,ne as a,re as b,U as m};
|
|
2
|
-
//# sourceMappingURL=escalation-columns-CZ12_oQF.js.map
|