@hotmeshio/long-tail 0.10.7 → 0.10.8
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/types/index.d.ts +1 -1
- package/dashboard/dist/assets/{AdminDashboard-CYlm0_J0.js → AdminDashboard-D0HdEkT9.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-CYlm0_J0.js.map → AdminDashboard-D0HdEkT9.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-BttOMcj_.js → AgentConfigPage-CtURUMOV.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-BttOMcj_.js.map → AgentConfigPage-CtURUMOV.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-D9JdkWV8.js → AgentDetailPage-C5AnjpD9.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-D9JdkWV8.js.map → AgentDetailPage-C5AnjpD9.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-AqGtEOL1.js → AgentsPage-DBequneI.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-AqGtEOL1.js.map → AgentsPage-DBequneI.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-rKbrcY8Y.js → AvailableEscalationsPage-Bk7fFV2e.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-rKbrcY8Y.js.map → AvailableEscalationsPage-Bk7fFV2e.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-Bj4MB_so.js → BotPicker-BMXokkH7.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-Bj4MB_so.js.map → BotPicker-BMXokkH7.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-DzLP5-ad.js → CapabilitiesPage-w-D6xraE.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-DzLP5-ad.js.map → CapabilitiesPage-w-D6xraE.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-CReMhtzK.js → CollapsibleSection-IPL1H1bQ.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-CReMhtzK.js.map → CollapsibleSection-IPL1H1bQ.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-Z8N8ccJ1.js → CountdownTimer-D-CpxYDO.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-Z8N8ccJ1.js.map → CountdownTimer-D-CpxYDO.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-D_2T6vSb.js → CredentialsPage-DR48hDES.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-D_2T6vSb.js.map → CredentialsPage-DR48hDES.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-DBmKrLvL.js → CronLabel-KQEj0cDS.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-DBmKrLvL.js.map → CronLabel-KQEj0cDS.js.map} +1 -1
- package/dashboard/dist/assets/CustomDurationPicker-_KceggR9.js +2 -0
- package/dashboard/dist/assets/CustomDurationPicker-_KceggR9.js.map +1 -0
- package/dashboard/dist/assets/{ElapsedCell-C0LbM8o2.js → ElapsedCell-Cflz7Pb5.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-C0LbM8o2.js.map → ElapsedCell-Cflz7Pb5.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-CkEJnFKd.js → EscalationListSchemaPage-BTBZ8OBY.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-CkEJnFKd.js.map → EscalationListSchemaPage-BTBZ8OBY.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-CnlwGAIE.js → EscalationSchemaPage-Cd9fR2EA.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-CnlwGAIE.js.map → EscalationSchemaPage-Cd9fR2EA.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DFM-f7do.js → EscalationsOverview-BzNFcA0i.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DFM-f7do.js.map → EscalationsOverview-BzNFcA0i.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-Q3iICRf_.js → EventTable-S2BJqOt2.js} +2 -2
- package/dashboard/dist/assets/{EventTable-Q3iICRf_.js.map → EventTable-S2BJqOt2.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-B0taDH7I.js → FilterBar-CeXwNVn6.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-B0taDH7I.js.map → FilterBar-CeXwNVn6.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-B_P3pJeA.js → GraphInvokePage-CBjXjOLX.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-B_P3pJeA.js.map → GraphInvokePage-CBjXjOLX.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-lu88PzQH.js → HomePage-NMLaXTvf.js} +2 -2
- package/dashboard/dist/assets/{HomePage-lu88PzQH.js.map → HomePage-NMLaXTvf.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-ueCQtu5C.js → ListToolbar-Dx6DuFdR.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-ueCQtu5C.js.map → ListToolbar-Dx6DuFdR.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-DMaRUXnA.js → McpOverview-Cj8_UyWJ.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-DMaRUXnA.js.map → McpOverview-Cj8_UyWJ.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-D6YSD94n.js → McpQueryDetailPage-Bqh8GChr.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-D6YSD94n.js.map → McpQueryDetailPage-Bqh8GChr.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-CNGNB59o.js → McpQueryPage-CqFkBwBR.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-CNGNB59o.js.map → McpQueryPage-CqFkBwBR.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-CJ9hDTNs.js → McpRunDetailPage-BqhRwkGk.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-CJ9hDTNs.js.map → McpRunDetailPage-BqhRwkGk.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-_UaoIwzX.js → McpRunsPage-CNXYU4iX.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-_UaoIwzX.js.map → McpRunsPage-CNXYU4iX.js.map} +1 -1
- package/dashboard/dist/assets/OperationsPage-C7UB_d-X.js +2 -0
- package/dashboard/dist/assets/OperationsPage-C7UB_d-X.js.map +1 -0
- package/dashboard/dist/assets/OperatorDashboard-DwbPAPaf.js +2 -0
- package/dashboard/dist/assets/OperatorDashboard-DwbPAPaf.js.map +1 -0
- package/dashboard/dist/assets/{ProcessDetailPage-CxJ5BSDk.js → ProcessDetailPage-ChGWcwSp.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-CxJ5BSDk.js.map → ProcessDetailPage-ChGWcwSp.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-GQMOo5Wo.js → ProcessesListPage-DatKHVkd.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-GQMOo5Wo.js.map → ProcessesListPage-DatKHVkd.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-Bh5qdI0w.js → RoleDetailPage-GJ_coHsM.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-Bh5qdI0w.js.map → RoleDetailPage-GJ_coHsM.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-BIg3_Em6.js → RolesPage-CPKw336d.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-BIg3_Em6.js.map → RolesPage-CPKw336d.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-DQp_keSD.js → RunAsSelector-VbBn0o7s.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-DQp_keSD.js.map → RunAsSelector-VbBn0o7s.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-qLaLa33X.js → StickyPagination-BI8tDf2V.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-qLaLa33X.js.map → StickyPagination-BI8tDf2V.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-Bi37x95H.js → StreamMessageDetail-BObbEz7P.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-Bi37x95H.js.map → StreamMessageDetail-BObbEz7P.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-BdNhoiW8.js → SwimlaneTimeline-BHjAtOGC.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-BdNhoiW8.js.map → SwimlaneTimeline-BHjAtOGC.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-ngdXRgQp.js → TaskDetailPage-B-E1dqUw.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-ngdXRgQp.js.map → TaskDetailPage-B-E1dqUw.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-BIE7nrdE.js → TasksListPage-urJ4XiUi.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-BIE7nrdE.js.map → TasksListPage-urJ4XiUi.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-C6FZSNZp.js → TimeAgo-D6Dg0SQs.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-C6FZSNZp.js.map → TimeAgo-D6Dg0SQs.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-DI5zPUgV.js → TimestampCell-DG__Gr-e.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-DI5zPUgV.js.map → TimestampCell-DG__Gr-e.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-Dli94RPI.js → ToolTestPanel-D-hGLf95.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-Dli94RPI.js.map → ToolTestPanel-D-hGLf95.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-vPtXb7gD.js → TopicDetailPage-B10i4xV2.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-vPtXb7gD.js.map → TopicDetailPage-B10i4xV2.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-BwiEX0pU.js → TopicsPage-C5THflVQ.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-BwiEX0pU.js.map → TopicsPage-C5THflVQ.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-YozoXJA1.js → UserName-CZTpouta.js} +2 -2
- package/dashboard/dist/assets/{UserName-YozoXJA1.js.map → UserName-CZTpouta.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-Bce8g08l.js → WorkflowExecutionPage-mbnj6saI.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-Bce8g08l.js.map → WorkflowExecutionPage-mbnj6saI.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-DpVAH35I.js → WorkflowsDashboard-DC_9GrpY.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DpVAH35I.js.map → WorkflowsDashboard-DC_9GrpY.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-Bp2pxXJO.js → WorkflowsOverview-ClSH1UwG.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-Bp2pxXJO.js.map → WorkflowsOverview-ClSH1UwG.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-CL_kD0mX.js → YamlWorkflowDetailPage-BkgoB7oD.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-CL_kD0mX.js.map → YamlWorkflowDetailPage-BkgoB7oD.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-Dtt3x3_T.js → YamlWorkflowsPage-Db_REA2f.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-Dtt3x3_T.js.map → YamlWorkflowsPage-Db_REA2f.js.map} +1 -1
- package/dashboard/dist/assets/{agents-xhtLVBwq.js → agents-Dvb8j9AB.js} +2 -2
- package/dashboard/dist/assets/{agents-xhtLVBwq.js.map → agents-Dvb8j9AB.js.map} +1 -1
- package/dashboard/dist/assets/{bots-DZ1MQUms.js → bots-D9jYHjBM.js} +2 -2
- package/dashboard/dist/assets/{bots-DZ1MQUms.js.map → bots-D9jYHjBM.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-B8j2h7Jn.js → capabilities-BAto9JcQ.js} +2 -2
- package/dashboard/dist/assets/{capabilities-B8j2h7Jn.js.map → capabilities-BAto9JcQ.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-DKijNA6h.js → controlplane-2Aic2Tfm.js} +2 -2
- package/dashboard/dist/assets/{controlplane-DKijNA6h.js.map → controlplane-2Aic2Tfm.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-DjoZ4dDb.js → escalation-columns-DPKPJtw3.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-DjoZ4dDb.js.map → escalation-columns-DPKPJtw3.js.map} +1 -1
- package/dashboard/dist/assets/{index-DrPWIFSv.js → index-4zRmxPwA.js} +2 -2
- package/dashboard/dist/assets/{index-DrPWIFSv.js.map → index-4zRmxPwA.js.map} +1 -1
- package/dashboard/dist/assets/{index-BqeQGQ4K.js → index-B5JgykZD.js} +2 -2
- package/dashboard/dist/assets/{index-BqeQGQ4K.js.map → index-B5JgykZD.js.map} +1 -1
- package/dashboard/dist/assets/{index-BCIJE--_.js → index-BW7-Q9Qf.js} +2 -2
- package/dashboard/dist/assets/{index-BCIJE--_.js.map → index-BW7-Q9Qf.js.map} +1 -1
- package/dashboard/dist/assets/{index-DYCCUmSM.js → index-BZbDwh_Y.js} +2 -2
- package/dashboard/dist/assets/{index-DYCCUmSM.js.map → index-BZbDwh_Y.js.map} +1 -1
- package/dashboard/dist/assets/{index-CMv6YMJY.js → index-BzQIzZfd.js} +2 -2
- package/dashboard/dist/assets/{index-CMv6YMJY.js.map → index-BzQIzZfd.js.map} +1 -1
- package/dashboard/dist/assets/{index-DcDEJ6b_.js → index-C-T1Wq0Z.js} +2 -2
- package/dashboard/dist/assets/{index-DcDEJ6b_.js.map → index-C-T1Wq0Z.js.map} +1 -1
- package/dashboard/dist/assets/{index-C6UuVkz7.js → index-CKxFjMtw.js} +4 -4
- package/dashboard/dist/assets/{index-C6UuVkz7.js.map → index-CKxFjMtw.js.map} +1 -1
- package/dashboard/dist/assets/{index-0SzWFShg.js → index-CeM012DJ.js} +2 -2
- package/dashboard/dist/assets/{index-0SzWFShg.js.map → index-CeM012DJ.js.map} +1 -1
- package/dashboard/dist/assets/{index-ChHD9p_I.js → index-KkikDsJ2.js} +2 -2
- package/dashboard/dist/assets/{index-ChHD9p_I.js.map → index-KkikDsJ2.js.map} +1 -1
- package/dashboard/dist/assets/index-Pmvw74oY.css +1 -0
- package/dashboard/dist/assets/{index-B0ktIiOY.js → index-_Q1Wf2A8.js} +2 -2
- package/dashboard/dist/assets/{index-B0ktIiOY.js.map → index-_Q1Wf2A8.js.map} +1 -1
- package/dashboard/dist/assets/index-jkVeGCkD.js +5 -0
- package/dashboard/dist/assets/index-jkVeGCkD.js.map +1 -0
- package/dashboard/dist/assets/{index-Cp1jJHm1.js → index-oHU-ramT.js} +2 -2
- package/dashboard/dist/assets/{index-Cp1jJHm1.js.map → index-oHU-ramT.js.map} +1 -1
- package/dashboard/dist/assets/{index-DWDEa8jS.js → index-peRHL38z.js} +2 -2
- package/dashboard/dist/assets/{index-DWDEa8jS.js.map → index-peRHL38z.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-Dl3cOfFR.js → knowledge-DO8idX0e.js} +2 -2
- package/dashboard/dist/assets/{knowledge-Dl3cOfFR.js.map → knowledge-DO8idX0e.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-BwjeqkHn.js → mcp-BGpQlkFp.js} +2 -2
- package/dashboard/dist/assets/{mcp-BwjeqkHn.js.map → mcp-BGpQlkFp.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-C1Rlt4az.js → mcp-query-DT0SCB9l.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-C1Rlt4az.js.map → mcp-query-DT0SCB9l.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-BGIUgIH_.js → pipelines-CYk7cN6-.js} +2 -2
- package/dashboard/dist/assets/{pipelines-BGIUgIH_.js.map → pipelines-CYk7cN6-.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-CnC1xEaD.js → tasks-B4Y5xbF0.js} +2 -2
- package/dashboard/dist/assets/{tasks-CnC1xEaD.js.map → tasks-B4Y5xbF0.js.map} +1 -1
- package/dashboard/dist/assets/{topics-C6EcHi07.js → topics-CVnqDw3B.js} +2 -2
- package/dashboard/dist/assets/{topics-C6EcHi07.js.map → topics-CVnqDw3B.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-Cyq4DiQA.js → useEventHooks-D8bVEx-w.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-Cyq4DiQA.js.map → useEventHooks-D8bVEx-w.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-Ci_oA5Tq.js → useNamespace-B1t3hsGf.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-Ci_oA5Tq.js.map → useNamespace-B1t3hsGf.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-u8RUiMma.js → useYamlActivityEvents-B8Ru07xQ.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-u8RUiMma.js.map → useYamlActivityEvents-B8Ru07xQ.js.map} +1 -1
- package/dashboard/dist/assets/{users-DtiYvg8z.js → users-C8H4jjTq.js} +2 -2
- package/dashboard/dist/assets/{users-DtiYvg8z.js.map → users-C8H4jjTq.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-BysPDsh9.js → workflows-BAdI5k--.js} +2 -2
- package/dashboard/dist/assets/{workflows-BysPDsh9.js.map → workflows-BAdI5k--.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-31qtxg5W.js → yaml-workflows-Bf2aQS-M.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-31qtxg5W.js.map → yaml-workflows-Bf2aQS-M.js.map} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/docs/api/http/escalations.md +1 -1
- package/docs/hitl/escalation.md +1 -1
- package/docs/hitl/x-lt-embed.md +41 -12
- package/docs/hitl/x-lt-list-schema.md +15 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/CustomDurationPicker-BTmpAQOL.js +0 -2
- package/dashboard/dist/assets/CustomDurationPicker-BTmpAQOL.js.map +0 -1
- package/dashboard/dist/assets/OperationsPage-CTfwuWXR.js +0 -2
- package/dashboard/dist/assets/OperationsPage-CTfwuWXR.js.map +0 -1
- package/dashboard/dist/assets/OperatorDashboard-DMPJmgP_.js +0 -2
- package/dashboard/dist/assets/OperatorDashboard-DMPJmgP_.js.map +0 -1
- package/dashboard/dist/assets/index-Dh5Y3hq7.js +0 -5
- package/dashboard/dist/assets/index-Dh5Y3hq7.js.map +0 -1
- package/dashboard/dist/assets/index-WSGppNeK.css +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as t,a as h,b as Xe}from"./vendor-query-B2UbickB.js";import{M as Tt,Q as Pt,J as gt,R as Qe,T as Ze,U as et,b as $t,m as re,K as ge,V as je,P as qt,h as be,k as Ke,g as ts,W as es,X as ss,Y as ns,u as rs,t as as,j as is,Z as os}from"./index-C6UuVkz7.js";import{b as ls,d as cs,H as ds,g as Vt,i as lt,u as ye,C as Ne,m as xs,r as Jt,c as ve,a as us}from"./CustomDurationPicker-BTmpAQOL.js";import{P as ps}from"./PageHeader-DlcE3U5L.js";import{L as ms}from"./ListToolbar-ueCQtu5C.js";import{i as we,C as Ht}from"./CountdownTimer-Z8N8ccJ1.js";import{u as fs}from"./workflows-BysPDsh9.js";import{g as hs}from"./useEventHooks-Cyq4DiQA.js";import{S as ke}from"./StatusBadge-BbqghFMi.js";import{R as gs}from"./RolePill-dzo14hB_.js";import{C as at}from"./CopyableId-BpB-NvDh.js";import{U as Ce}from"./UserName-YozoXJA1.js";import{Q as Ut,am as js,S as bs,an as ys,H as _e,n as Ns,a8 as Ee,U as vs,ab as ws,ac as ks,a1 as Cs,ao as _s,ap as Es,aq as Wt,ar as As,as as ae,at as Ts,au as ie,av as oe,aw as $s,X as Rs}from"./vendor-icons-BE_WrH2z.js";import{a as Ae,L as ot,e as Os}from"./vendor-react-BpdAFEQc.js";import{M as Is}from"./Modal-CA2Iv02H.js";import"./StickyPagination-qLaLa33X.js";import"./constants-BHkpVaqx.js";import"./users-DtiYvg8z.js";const Ds={SCHEMA_VALIDATION:"schema_validation"};function Ms(e){return typeof e=="object"&&e!==null&&e.code===Ds.SCHEMA_VALIDATION&&Array.isArray(e.violations)}const vt={pending:"rgb(var(--lt-status-queued-graphic))",claimed:"rgb(var(--lt-status-claimed-graphic))",resolved:"rgb(var(--lt-status-success-graphic))",cancelled:"rgb(var(--lt-status-error))"},Rt=5;function le({pct:e,place:s,label:a,title:r,emphasis:n}){const i=t.jsx("span",{className:"w-px h-1.5 bg-text-quaternary","aria-hidden":!0}),d=t.jsx("span",{className:`whitespace-nowrap leading-none tabular-nums ${n?"text-text-secondary":"text-text-tertiary"}`,children:a});return t.jsx("div",{title:r,className:`absolute ${s==="above"?"bottom-0":"top-0"} flex flex-col items-center gap-0 -translate-x-1/2 cursor-help`,style:{left:`${e}%`},children:s==="above"?t.jsxs(t.Fragment,{children:[d,i]}):t.jsxs(t.Fragment,{children:[i,d]})})}function Ls({esc:e,className:s=""}){const a=new Date(e.created_at).getTime(),r=e.claimed_at?new Date(e.claimed_at).getTime():null,n=e.status==="resolved",i=e.status==="cancelled"||e.status==="expired",d=n||i,l=we(e),c=!!r&&(l||d),x=n&&e.resolved_at?new Date(e.resolved_at).getTime():i?new Date(e.updated_at).getTime():Date.now(),o=Math.max(x-a,1),u=c&&r?Math.max(r-a,0):o,m=c&&r?Math.max(x-r,0):0,g=Math.min(100,Math.max(0,u/o*100)),N=c?Math.max(0,100-g):0,j=n?vt.resolved:i?vt.cancelled:vt.claimed,f=n?"Resolved after":i?"Cancelled after":"In progress",y=Tt(u),_=Tt(o),p=n?`Resolved in ${_} total`:i?`Cancelled after ${_}`:`Open ${_} so far`,w=`Lifecycle bar: blue = time waiting to be claimed, ${n?"green":i?"red":"orange"} = ${f.toLowerCase()} the claim.`;return t.jsxs("div",{className:s,title:w,children:[t.jsx("div",{className:"relative h-3 text-2xs font-mono",children:c&&t.jsx(le,{pct:g,place:"above",label:y,title:`Time to claim: ${y}`})}),t.jsxs("div",{className:"flex w-full rounded-full overflow-hidden",style:{height:Rt,backgroundColor:"rgb(var(--lt-surface-sunken))"},title:w,children:[t.jsx("div",{style:{width:`${g}%`,minWidth:Rt,backgroundColor:vt.pending,opacity:.75},title:`Waiting ${y} — created → claimed`}),c&&N>0&&t.jsx("div",{style:{width:`${N}%`,minWidth:Rt,backgroundColor:j,opacity:.75},title:`${f} ${Tt(m)}`})]}),t.jsx("div",{className:"relative h-3 text-2xs font-mono",children:t.jsx(le,{pct:100,place:"below",emphasis:!0,label:_,title:p})})]})}function Ps({triage:e,payload:s}){const a=e.confidence??0,r=a>=.8?"text-status-success":a>=.5?"text-status-pending":"text-status-error",n=Ws(e.originalData,s);return t.jsxs("div",{className:"space-y-5",children:[e.diagnosis&&t.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:e.diagnosis}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-tertiary",children:[e.tool_calls_made!=null&&t.jsxs("span",{children:[e.tool_calls_made," tool call",e.tool_calls_made!==1?"s":""]}),e.tool_calls_made!=null&&t.jsx("span",{className:"text-text-quaternary",children:"·"}),t.jsxs("span",{className:`font-medium ${r}`,children:[Math.round(a*100),"% confidence"]})]}),e.actions_taken&&e.actions_taken.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.actions_taken.map((i,d)=>t.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-2xs
|
|
2
|
-
text-text-secondary`,children:[t.jsx("svg",{className:"w-3 h-3 text-status-success shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),i]},d))}),e.recommendation&&t.jsx("p",{className:"text-2xs text-text-tertiary italic",children:e.recommendation}),n.length>0&&t.jsx("div",{className:"space-y-4 pt-2",children:n.map(i=>t.jsx(Fs,{diff:i},i.key))})]})}function Ws(e,s){if(!e)return[];const a=[];for(const r of Object.keys(e)){if(r.startsWith("_"))continue;const n=e[r],i=s[r];i!==void 0&&JSON.stringify(n)!==JSON.stringify(i)&&a.push({key:r,label:r.replace(/[_-]/g," "),original:n,corrected:i})}return a}function Fs({diff:e}){const s=ce(e.original),a=ce(e.corrected);return s!==null&&a!==null?t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @form-cols:grid-cols-2 gap-x-8 gap-y-3",children:[t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[e.label," ",t.jsx("span",{className:"normal-case font-normal",children:"(original)"})]}),t.jsx("p",{className:"text-sm text-text-tertiary leading-relaxed line-through decoration-text-tertiary/30",children:s})]}),t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[e.label," ",t.jsx("span",{className:"normal-case font-normal text-status-success",children:"(corrected)"})]}),t.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:a})]})]})}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[e.label," ",t.jsx("span",{className:"normal-case font-normal",children:"(original)"})]}),t.jsx("pre",{className:"text-xs text-text-tertiary font-mono whitespace-pre-wrap leading-relaxed",children:typeof e.original=="object"?JSON.stringify(e.original,null,2):String(e.original)})]}),t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[e.label," ",t.jsx("span",{className:"normal-case font-normal text-status-success",children:"(corrected)"})]}),t.jsx("pre",{className:"text-xs text-text-primary font-mono whitespace-pre-wrap leading-relaxed",children:typeof e.corrected=="object"?JSON.stringify(e.corrected,null,2):String(e.corrected)})]})]})}function ce(e){return e==null?"null":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):null}function G(e,s){const a=s==null?void 0:s.title;if(typeof a=="string"&&a.trim().length>0)return a.trim();const r=e.split(/[_-]+/).filter(Boolean);return r.length<=1?e:r.map(n=>Ss(n)?n:n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function Ss(e){return e.length>1&&e===e.toUpperCase()&&/[A-Z]/.test(e)}const H={HELP:"help",DETAILS:"details",TRIAGE:"triage",METADATA:"metadata",CONTEXT:"context",RECORD:"record",ERRORS:"errors"},Te="lt:escalation:panel:view";function qs(e){try{const s=localStorage.getItem(Te);if(s&&e.includes(s))return s}catch{}return H.HELP}const Vs=new Set(["form_schema"]);function Js({metadata:e,role:s}){const a=Object.entries(e??{}).filter(([r])=>!r.startsWith("_")&&!Vs.has(r));return a.length===0?t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No metadata on this escalation."}):t.jsx("dl",{className:"space-y-3.5",children:a.map(([r,n])=>{const i=typeof n=="object"&&n!==null?JSON.stringify(n):String(n),d=re(r,n,s),l=re(r,n);return t.jsxs("div",{className:"group relative",children:[t.jsx("dt",{className:"text-2xs font-medium text-text-secondary uppercase tracking-wide",children:G(r)}),t.jsxs("dd",{className:"mt-0.5 flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-text-primary font-mono break-all flex-1",children:i}),t.jsx(ot,{to:d,title:`Filter this queue: ${r} = ${i}`,className:"opacity-50 group-hover:opacity-100 transition-opacity shrink-0 p-0.5 text-text-quaternary hover:text-accent",children:t.jsx(ws,{className:"w-3 h-3"})}),t.jsx(ot,{to:l,title:`Search all queues: ${r} = ${i}`,className:"opacity-50 group-hover:opacity-100 transition-opacity shrink-0 p-0.5 text-text-quaternary hover:text-accent",children:t.jsx(ks,{className:"w-3 h-3"})})]})]},r)})})}function Hs({esc:e,claimed:s,isTerminal:a,isBuilder:r,traceUrl:n}){return t.jsxs("div",{className:"space-y-5",children:[t.jsxs("dl",{className:"space-y-3.5",children:[t.jsx(et,{label:"Status",children:t.jsx(ke,{status:e.status})}),t.jsx(et,{label:"Assigned to Role",children:t.jsx(gs,{role:e.role,size:"md"})}),t.jsxs(et,{label:"Priority",children:["P",e.priority]}),(s||a)&&e.assigned_to&&t.jsx(et,{label:"Claimed By",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5 font-medium text-text-primary",children:[t.jsx(vs,{className:"w-3 h-3 shrink-0 text-accent/75"}),t.jsx(Ce,{userId:e.assigned_to})]})}),t.jsx(et,{label:"Created",children:t.jsx($t,{date:e.created_at})}),(s||a)&&e.claimed_at&&t.jsx(et,{label:"Claimed",children:t.jsx($t,{date:e.claimed_at})}),s&&!a&&e.assigned_until&&t.jsx(et,{label:"Time Remaining",children:t.jsx(Ht,{until:e.assigned_until})}),e.resolved_at&&t.jsx(et,{label:"Completed",children:t.jsx("span",{className:"text-status-success",children:t.jsx($t,{date:e.resolved_at})})})]}),r&&t.jsxs(t.Fragment,{children:[t.jsx("hr",{className:"border-surface-border/60"}),t.jsxs("div",{className:"space-y-3.5",children:[t.jsx(at,{label:"Escalation ID",value:e.id}),e.task_id&&t.jsx(at,{label:"Task ID",value:e.task_id,href:`/workflows/tasks/detail/${e.task_id}`}),e.workflow_type&&t.jsx(at,{label:"Workflow Name",value:e.workflow_type,href:`/workflows/executions?entity=${encodeURIComponent(e.workflow_type)}`}),e.workflow_id&&t.jsx(at,{label:"Workflow ID",value:e.workflow_id,href:`/workflows/executions/${e.workflow_id}`}),e.task_queue&&t.jsx(at,{label:"Task Queue",value:e.task_queue,href:`/admin/controlplane?queue=${encodeURIComponent(e.task_queue)}`}),e.origin_id&&e.origin_id!==e.workflow_id&&t.jsx(at,{label:"Origin",value:e.origin_id,href:`/processes/detail/${e.origin_id}`}),e.trace_id&&t.jsx(at,{label:"Trace",value:e.trace_id,href:n?n.replace("{traceId}",e.trace_id):void 0,external:!0})]})]})]})}function Us({errors:e,schema:s}){const a=r=>{const n=document.querySelector(`[data-field-key="${r}"]`);n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),n.focus({preventScroll:!0}))};return e.length===0?t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No errors to display."}):t.jsxs("div",{className:"space-y-1",role:"alert","aria-live":"polite",children:[t.jsxs("p",{className:"text-2xs font-semibold uppercase tracking-wider text-status-error mb-4",children:[e.length," ",e.length===1?"issue":"issues"," to resolve"]}),t.jsx("div",{className:"space-y-1.5",children:e.map(({field:r,message:n})=>{var i;return t.jsxs("button",{onClick:()=>a(r),className:"w-full text-left flex items-start gap-3 px-3 py-2.5 rounded hover:bg-status-error/5 transition-colors group",children:[t.jsx(Ee,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-status-error/60 group-hover:text-status-error transition-colors"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-2xs font-semibold text-text-primary leading-snug",children:G(r,(i=s==null?void 0:s.properties)==null?void 0:i[r])}),t.jsx("p",{className:"text-2xs text-text-tertiary group-hover:text-text-secondary transition-colors leading-snug mt-0.5",children:n})]})]},r)})}),t.jsx("p",{className:"text-2xs text-text-quaternary mt-4 px-3",children:"Click an issue to scroll to and focus the field."})]})}function zs({esc:e,schema:s,envelope:a,payload:r,resolver:n,triage:i,hasAI:d,claimed:l,claimedByMe:c,isTerminal:x,isBuilder:o,traceUrl:u,open:m,noGutter:g,formErrors:N,activePanel:j,onPanelChange:f}){const y=Ae(),_=Object.values(H),[p,w]=h.useState(()=>qs(_)),I=j??p,E=h.useCallback(C=>{try{localStorage.setItem(Te,C)}catch{}w(C),f==null||f(C)},[f]);h.useEffect(()=>{j&&j!==p&&w(j)},[j]);const M=h.useMemo(()=>ls(s,{escalation:e,metadata:e.metadata??null,envelope:a,payload:r,resolver:n})??cs({isTerminal:x,status:e.status,claimed:l,claimedByMe:c}),[s,e,a,r,n,x,l,c]),A=h.useCallback(C=>{const O=C.target.closest("a"),q=O==null?void 0:O.getAttribute("href");q!=null&&q.startsWith("/")&&(C.preventDefault(),y(q))},[y]),$=[{id:H.HELP,icon:Ut,label:"Instructions",content:t.jsx(Pt,{content:M,onClick:A})},{id:H.DETAILS,icon:js,label:"Details",content:t.jsx(Hs,{esc:e,claimed:l,isTerminal:x,isBuilder:o,traceUrl:u})},...d&&i?[{id:H.TRIAGE,icon:bs,label:"AI Analysis",content:t.jsx(Ps,{triage:i,payload:r??{}})}]:[],{id:H.METADATA,icon:ys,label:"Metadata",content:t.jsx(Js,{metadata:e.metadata,role:e.role})},{id:H.CONTEXT,icon:_e,label:"Context",content:t.jsxs("div",{className:"space-y-5",children:[a!=null&&t.jsx(gt,{data:a,label:"Input Envelope"}),r!=null&&t.jsx(gt,{data:r,label:"Escalation Context"}),n!=null&&t.jsx(gt,{data:n,label:"Resolver Payload"}),a==null&&r==null&&n==null&&t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No context on this escalation."})]})},...o?[{id:H.RECORD,icon:Ns,label:"Record",content:t.jsx(gt,{data:e,label:"Escalation Record"})}]:[],...N&&N.length>0?[{id:H.ERRORS,icon:(({className:C})=>t.jsx(Ee,{className:`${C??""} text-status-error`})),label:"Errors",content:t.jsx(Us,{errors:N,schema:s})}]:[]];return t.jsx(Qe,{open:m,width:384,className:"h-full",children:t.jsx("div",{className:`h-full${g?"":" pl-6"}`,children:t.jsxs("div",{className:"h-full flex flex-col bg-surface-hover",children:[t.jsx("div",{className:"shrink-0 pt-1.5 pb-0.5 flex justify-center",children:t.jsx(Ls,{esc:e,className:"w-[80%]"})}),t.jsx("div",{className:"flex-1 min-h-0",children:t.jsx(Ze,{views:$,activeId:I,onViewChange:E,stickyClassName:"h-full min-h-0"})})]})})})}function Ys(e,s){if(typeof e!="string"||!s)return[];const a=e.indexOf(".");if(a===-1)return[];const r=s[e.slice(0,a)];if(!r||typeof r!="object")return[];let n=r;for(const i of e.slice(a+1).split("."))if(n=n[i],n===void 0)return[];return Array.isArray(n)?n:[]}function Bs(e,s,a){if((s==null?void 0:s["x-lt-widget"])!=="checklist"||s["x-lt-require-all"]!==!0)return;const n=Ys(s["x-lt-source"],a).filter(l=>l.required!==!1);if(n.length===0)return;const i=typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{},d=n.filter(l=>!i[l.id]).length;if(d!==0)return`${d} of ${n.length} checks incomplete`}function Gs(e,s){const a=s==null?void 0:s.type;if(typeof a=="string"&&!(e==null||e===""))switch(a){case"string":return typeof e=="string"?void 0:"Expected text";case"number":return typeof e=="number"&&Number.isFinite(e)?void 0:"Expected a number";case"integer":return typeof e=="number"&&Number.isInteger(e)?void 0:"Expected a whole number";case"boolean":return typeof e=="boolean"?void 0:"Expected true or false";case"array":return Array.isArray(e)?void 0:"Expected a list";case"object":return typeof e=="object"&&!Array.isArray(e)?void 0:"Expected an object";default:return}}function Xs(e,s,a){if(!s)return;const r=s.enum;if(Array.isArray(r)&&r.length>0&&e!==void 0&&e!==null&&e!==""&&!r.includes(e))return`Must be one of: ${r.map(n=>String(n)).join(", ")}`;if(typeof e=="string"){const n=e.trim();if(n==="")return;const i=ut(s.minLength,s["x-lt-min-length"],a);if(i!==void 0&&n.length<i)return`Minimum ${i} character${i===1?"":"s"}`;const d=ut(s.maxLength,s["x-lt-max-length"],a);if(d!==void 0&&n.length>d)return`Maximum ${d} characters (${n.length} entered)`;const l=s.pattern;if(l)try{if(!new RegExp(l).test(n))return s["x-lt-pattern-error"]??"Invalid format"}catch{}const c=s.format;if(c==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n))return"Enter a valid email address";if(c==="uri"&&!/^https?:\/\/.+/.test(n))return"Enter a valid URL"}if(typeof e=="number"){const n=ut(s.minimum,s["x-lt-minimum"],a),i=ut(s.exclusiveMinimum,void 0,a),d=ut(s.maximum,s["x-lt-maximum"],a),l=ut(s.exclusiveMaximum,void 0,a);if(n!==void 0&&e<n)return`Minimum value is ${n}`;if(i!==void 0&&e<=i)return`Must be greater than ${i}`;if(d!==void 0&&e>d)return`Maximum value is ${d}`;if(l!==void 0&&e>=l)return`Must be less than ${l}`}}function ut(e,s,a){if(typeof e=="number")return e;if(typeof s=="string"&&a){const r=s.indexOf(".");if(r!==-1){const n=s.slice(0,r),i=s.slice(r+1),d=a[n];if(d&&typeof d=="object"){const l=i.split(".");let c=d;for(const x of l)if(c=c[x],c===void 0)break;if(typeof c=="number")return c;if(typeof c=="string"){const x=Number(c);if(!Number.isNaN(x))return x}}}}}function $e(e,s,a,r,n){if(!r)return;if(a){if(e==null||typeof e=="boolean"&&!e||typeof e=="string"&&e.trim()==="")return"Required";if(typeof e=="object"&&!Array.isArray(e)&&e!==null){const l=Object.values(e);if(l.length===0||l.every(c=>!c))return"Required"}}const i=Gs(e,s);if(i)return i;const d=Bs(e,s,n);return d||Xs(e,s,n)}function de(e){return e!=null&&e!==""&&e!==!1&&e!==0}function Qs(e){return e==null?"":typeof e=="object"?JSON.stringify(e):String(e)}function xe(e,s){const a=e.indexOf("."),r=a===-1?e:e.slice(0,a);if(!ds.includes(r))return{known:!1,value:void 0};const n=s[r];if(a===-1)return{known:!0,value:n};try{return{known:!0,value:Vt(n,e.slice(a+1))}}catch{return{known:!0,value:void 0}}}function Re(e,s){if(typeof e!="string"||e.length===0||!s)return!0;const a=e.startsWith("!"),r=a?e.slice(1):e,n=r.indexOf("!="),i=r.indexOf("=");if(n!==-1||i!==-1&&i!==n+1){const c=n!==-1&&(i===-1||n<i),x=c?n:i,o=r.slice(0,x).trim(),u=r.slice(x+(c?2:1)).trim(),{known:m,value:g}=xe(o,s);if(!m)return!0;const N=Qs(g)===u,j=c?!N:N;return a?!j:j}const{known:d,value:l}=xe(r,s);return d?a?!de(l):de(l):!0}function Oe(e,s,a){if(!e)return[];const r=e.properties??{},n=new Set(e.required??[]),i={...a??{},resolver:s},d=[];for(const[l,c]of Object.entries(r)){if(!Re(c["x-lt-showIf"],i))continue;const x=$e(s[l],c,n.has(l),!0,i);x&&d.push({field:l,message:x})}return d}function Ie(e,s){if(!e)return{};const a={};for(const[r,n]of Object.entries(e))a[r]=typeof n=="string"?lt(n,s):n;return a}const Zs="{{count}} related items are still pending";function Ks(e,s){const a=e==null?void 0:e.query,r=Ie(a==null?void 0:a.facets,s??{}),{data:n}=ge({role:a==null?void 0:a.role,status:(a==null?void 0:a.status)??"pending",facets:r,limit:1,enabled:!!e&&!!(a!=null&&a.role||Object.keys(r).length)}),i=(n==null?void 0:n.total)??0,d=!!e&&e.mustBeEmpty!==!1&&i>0,l=(e==null?void 0:e.message)??Zs,c=d?lt(l.replace(/\{\{count\}\}/g,String(i)),s??{}):"";return{blocked:d,count:i,message:c}}function tn(e){const{mode:s,activeView:a,onActiveViewChange:r,onClaim:n,claimPending:i,workflowType:d,json:l,onResolve:c,resolvePending:x,resolveError:o,requestTriage:u,triageNotes:m,currentRole:g,escalationTargets:N,onEscalate:j,escalatePending:f,escalateError:y,onRelease:_,releasePending:p,onCancel:w,assignedTo:I,assignedUntil:E,onSubmitAttempt:M,onValidationErrors:A,escalationContext:$}=e,C=ye(),[O,q]=h.useState("30"),[F,P]=h.useState(0),[V,X]=h.useState(""),[b,R]=h.useState(""),v=O==="custom",D=h.useCallback(T=>P(T),[]),L=h.useMemo(()=>{var T;try{const Z=(T=JSON.parse(l))==null?void 0:T._form_schema;return Z==null?void 0:Z["x-lt-submit-guard"]}catch{return}},[l]),U=Ks(L,$),Q=U.blocked&&!u;if(s==="terminal")return null;const B=()=>{const T=v?F:parseInt(O);!T||T<=0||n(T)},W=()=>{if(X(""),u){const nt={_lt:{needsTriage:!0}};m.trim()&&(nt.notes=m.trim()),c(nt);return}let T;try{T=JSON.parse(l)}catch{X("Invalid JSON");return}const Z=T._form_schema;if(Z){const nt=Oe(Z,T,$);if(nt.length>0){M==null||M(),A==null||A(nt);return}}const{_form_schema:jt,...K}=T;c(xs(K,Z))},z=T=>`text-xs transition-colors ${T?"text-accent font-medium":"text-text-tertiary hover:text-accent"}`;return t.jsxs("div",{className:"shrink-0 h-[80px] bg-surface/95 backdrop-blur-sm border-t border-surface-border -ml-10 pl-10 pr-10 pt-3 pb-5","data-testid":"escalation-action-bar",children:[s==="available"&&t.jsxs("div",{"data-testid":"claim-bar",children:[t.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[C.map(T=>t.jsx("button",{onClick:()=>{q(T.value),P(0)},className:z(!v&&O===T.value),children:T.label},T.value)),t.jsx("button",{onClick:()=>q("custom"),className:z(v),children:"Other"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:w,className:"text-xs text-text-tertiary hover:text-status-error transition-colors",children:"Cancel escalation"}),t.jsx("div",{className:"flex-1"}),v&&t.jsx(Ne,{onChange:D,compact:!0,autoFocus:!0}),t.jsx("button",{onClick:B,disabled:i||v&&F<=0,className:"btn-primary text-xs",children:i?"Claiming...":"Claim"})]})]}),s==="claimed_by_other"&&t.jsxs("div",{className:"flex items-center gap-4","data-testid":"claimed-other-bar",children:[t.jsxs("p",{className:"text-sm text-text-secondary",children:["Claimed by ",t.jsx("span",{className:"font-medium text-text-primary",children:I?t.jsx(Ce,{userId:I}):"unknown"})]}),E&&t.jsx(Ht,{until:E})]}),s==="claimed_by_me"&&t.jsxs("div",{"data-testid":"action-bar",children:[t.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[t.jsx("button",{onClick:()=>r("resolve"),className:z(a==="resolve"),children:d?"Resolve":"Acknowledge"}),N.length>0&&t.jsx("button",{onClick:()=>r("escalate"),className:z(a==="escalate"),children:"Escalate"}),t.jsx("button",{onClick:()=>r("release"),className:`text-xs transition-colors ${a==="release"?"text-status-error font-medium":"text-text-tertiary hover:text-status-error"}`,children:"Release"}),t.jsx("button",{onClick:w,className:"text-xs transition-colors text-text-tertiary hover:text-status-error",children:"Cancel"})]}),a==="resolve"&&t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"flex-1"}),V&&t.jsx("span",{className:"text-xs text-status-error",children:V}),o&&t.jsx("span",{className:"text-xs text-status-error",children:o.message}),Q&&t.jsx("span",{className:"text-xs text-status-pending","data-testid":"submit-guard-message",children:U.message}),t.jsx("button",{onClick:W,disabled:x||Q,className:"btn-primary text-xs",children:x?d?"Submitting...":"Acknowledging...":u?"Send to Triage":d?"Submit":"Acknowledge"})]}),a==="escalate"&&t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-text-secondary",children:["From ",t.jsx("span",{className:"font-medium text-text-primary",children:g})," to"]}),t.jsxs("select",{value:b,onChange:T=>R(T.target.value),className:"select text-xs","data-testid":"escalate-select",children:[t.jsx("option",{value:"",children:"Select role..."}),N.map(T=>t.jsx("option",{value:T,children:T},T))]}),t.jsx("div",{className:"flex-1"}),y&&t.jsx("span",{className:"text-xs text-status-error",children:y.message}),t.jsx("button",{onClick:()=>j(b),disabled:!b||f,className:"btn-primary text-xs",children:f?"Escalating...":"Escalate"})]}),a==="release"&&t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-xs text-text-secondary",children:"Release back to pool?"}),t.jsx("div",{className:"flex-1"}),t.jsx("button",{onClick:()=>r("resolve"),className:"btn-secondary text-xs",children:"Back"}),t.jsx("button",{onClick:_,disabled:p,className:"btn-primary text-xs bg-status-error hover:bg-status-error/80",children:p?"Releasing...":"Yes, Release"})]})]})]})}function st(e){return e.replace(/`([^`]+)`/g,'<code class="px-1 py-0.5 bg-surface-sunken rounded text-xs font-mono">$1</code>').replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="text-accent-primary hover:underline" target="_blank" rel="noopener noreferrer">$1</a>')}function Ot({content:e,compact:s}){const a=[],r=/^```(\w*)\n([\s\S]*?)^```$/gm;let n=0,i;for(;(i=r.exec(e))!==null;)i.index>n&&a.push({type:"text",text:e.slice(n,i.index)}),a.push({type:"code",lang:i[1],code:i[2].replace(/\n$/,"")}),n=i.index+i[0].length;n<e.length&&a.push({type:"text",text:e.slice(n)});const d=s?{text:"text-xs",heading:"text-xs",list:"text-xs",code:"text-2xs"}:{text:"text-sm",heading:"text-sm",list:"text-sm",code:"text-xs"},l=[];for(const c of a){if(c.type==="code"){const x=c.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");l.push(`<pre class="my-2 p-2.5 bg-surface-sunken rounded-md overflow-x-auto"><code class="${d.code} font-mono text-text-secondary leading-relaxed">${x}</code></pre>`);continue}l.push(...en(c.text,d))}return t.jsx("div",{className:"prose-sm",dangerouslySetInnerHTML:{__html:l.join(`
|
|
3
|
-
`)}})}function en(e,s){const a=e.split(`
|
|
4
|
-
`),r=[];let n=!1,i=!1,d=[];for(const l of a){const c=l.trim();if(c.startsWith("|")&&c.endsWith("|")){const x=c.slice(1,-1).split("|").map(o=>o.trim());if(x.every(o=>/^[-:]+$/.test(o)))continue;i||(i=!0,d=[]),d.push(x);continue}if(i){i=!1;const[x,...o]=d;r.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const u of x)r.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${st(u)}</th>`);r.push("</tr></thead><tbody>");for(const u of o){r.push("<tr>");for(const m of u)r.push(`<td class="py-1 px-2 border-b border-border/50">${st(m)}</td>`);r.push("</tr>")}r.push("</tbody></table></div>"),d=[]}if(!c){n&&(r.push("</ul>"),n=!1);continue}if(c.startsWith("### ")){n&&(r.push("</ul>"),n=!1),r.push(`<h4 class="${s.heading} font-semibold text-text-primary mt-3 mb-1">${st(c.slice(4))}</h4>`);continue}if(c.startsWith("## ")){n&&(r.push("</ul>"),n=!1),r.push(`<h3 class="${s.heading} font-semibold text-text-primary mt-3 mb-1">${st(c.slice(3))}</h3>`);continue}if(/^[-*_]{3,}$/.test(c)){n&&(r.push("</ul>"),n=!1),r.push('<hr class="border-border my-3" />');continue}if(/^[-*] /.test(c)){n||(r.push('<ul class="space-y-1 my-1">'),n=!0),r.push(`<li class="${s.list} text-text-secondary flex gap-2"><span class="text-text-tertiary shrink-0">-</span><span>${st(c.slice(2))}</span></li>`);continue}n&&(r.push("</ul>"),n=!1),r.push(`<p class="${s.text} text-text-secondary my-1">${st(c)}</p>`)}if(i&&d.length){const[l,...c]=d;r.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const x of l)r.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${st(x)}</th>`);r.push("</tr></thead><tbody>");for(const x of c){r.push("<tr>");for(const o of x)r.push(`<td class="py-1 px-2 border-b border-border/50">${st(o)}</td>`);r.push("</tr>")}r.push("</tbody></table></div>")}return n&&r.push("</ul>"),r}function It({children:e}){return t.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:e})}function sn({payload:e,isTerminal:s,resolverPayload:a,onRetryTriage:r,isRetrying:n}){const i=e.title,d=e.summary,l=e.diagnosis,c=e.tool_calls_made,x=e.result,o=a==null?void 0:a._lt,u=(o==null?void 0:o.triaged)===!0,m=o==null?void 0:o.triageWorkflowId,g=s&&u,[N,j]=h.useState(!1);return g?t.jsxs("div",{className:"rounded-md border border-status-success/30 bg-surface-raised",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-status-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M8 1a7 7 0 110 14A7 7 0 018 1zm3.36 4.65a.5.5 0 00-.72 0L7 9.29 5.36 7.65a.5.5 0 10-.72.7l2 2a.5.5 0 00.72 0l4-4a.5.5 0 000-.7z"})}),t.jsx("span",{className:"text-xs font-medium text-status-success",children:"Resolved by AI Triage"})]}),typeof c=="number"&&t.jsxs("span",{className:"text-2xs font-mono px-2 py-0.5 rounded-full bg-status-success/10 text-status-success",children:[c," tool calls used"]})]}),t.jsxs("div",{className:"px-4 py-4 space-y-4",children:[i&&t.jsx("p",{className:"text-sm font-medium text-text-primary",children:i}),l&&t.jsxs("div",{children:[t.jsx(It,{children:"Triage diagnosis"}),t.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:t.jsx(Ot,{content:l})})]}),t.jsx("div",{className:"flex items-center gap-3",children:m&&t.jsx(ot,{to:`/workflows/executions/${m}`,className:"text-2xs text-accent hover:underline",children:"View triage execution"})})]})]}):t.jsxs("div",{className:"rounded-md border border-status-warning/30 bg-surface-raised",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-status-warning shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M8 1a7 7 0 110 14A7 7 0 018 1zm0 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 4zm0 7a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),t.jsx("span",{className:"text-xs font-medium text-status-warning",children:"Tool Rounds Exhausted"})]}),typeof c=="number"&&t.jsxs("span",{className:"text-2xs font-mono px-2 py-0.5 rounded-full bg-status-warning/10 text-status-warning",children:[c," tool calls used"]})]}),t.jsxs("div",{className:"px-4 py-4 space-y-4",children:[i&&t.jsx("p",{className:"text-sm font-medium text-text-primary",children:i}),d&&t.jsxs("div",{children:[t.jsx(It,{children:"What happened"}),t.jsx("div",{className:"text-xs text-text-secondary leading-relaxed",children:t.jsx(Ot,{content:d})})]}),l&&t.jsxs("div",{children:[t.jsx(It,{children:"What went wrong"}),t.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:t.jsx(Ot,{content:l})})]}),x!=null&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>j(!N),className:"flex items-center gap-1 text-2xs font-semibold uppercase tracking-widest text-text-tertiary hover:text-text-secondary transition-colors",children:[t.jsx("svg",{className:`w-3 h-3 transition-transform ${N?"rotate-90":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:t.jsx("path",{d:"M4.5 2l4 4-4 4"})}),"Partial results"]}),N&&t.jsx("div",{className:"mt-2",children:t.jsx(gt,{data:x,defaultMode:"tree"})})]}),r&&!s&&t.jsx("div",{className:"pt-2",children:t.jsxs("button",{onClick:r,disabled:n,className:"inline-flex items-center gap-2 px-4 py-2 text-xs font-medium bg-accent text-text-inverse rounded-md hover:bg-accent/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[t.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"currentColor",children:t.jsx("path",{d:"M7 1a6 6 0 100 12A6 6 0 007 1zm2.5 6.5l-3.5 2V5.5l3.5 2z"})}),n?"Sending to triage...":"Retry with AI Triage"]})})]})]})}function ue(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function De({src:e,escalation:s,schema:a,onResolve:r,onEscalate:n,submitAttempted:i,fill:d}){const l=h.useRef(null),c=h.useRef("");h.useEffect(()=>{try{const o=new URL(e);c.current=o.origin}catch{c.current=""}},[e]);const x=h.useCallback(()=>{const o=l.current;if(!(o!=null&&o.contentWindow)||!c.current)return;const m={type:"lt:init",escalation:{id:s.id,type:s.type,subtype:s.subtype,description:s.description,status:s.status,priority:s.priority,role:s.role,workflow_type:s.workflow_type,envelope:ue(s.envelope),metadata:s.metadata??null,escalation_payload:ue(s.escalation_payload)},schema:a};o.contentWindow.postMessage(m,c.current)},[s,a]);return h.useEffect(()=>{const o=u=>{if(u.origin!==c.current)return;const m=u.data;if(!(!m||typeof m!="object"||typeof m.type!="string"))switch(m.type){case"lt:ready":x();break;case"lt:submit":m.payload&&typeof m.payload=="object"&&r(m.payload);break;case"lt:escalate":typeof m.target=="string"&&m.target&&n(m.target);break;case"lt:resize":{const g=l.current;g&&typeof m.height=="number"&&m.height>0&&(g.style.height=`${Math.min(m.height,2e3)}px`);break}}};return window.addEventListener("message",o),()=>window.removeEventListener("message",o)},[x,r,n]),h.useEffect(()=>{if(!i)return;const o=l.current;o!=null&&o.contentWindow&&c.current&&o.contentWindow.postMessage({type:"lt:validate"},c.current)},[i]),d?t.jsx("div",{className:"absolute inset-0 overflow-hidden",children:t.jsx("iframe",{ref:l,src:e,sandbox:"allow-scripts allow-same-origin allow-forms allow-pointer-lock allow-downloads",className:"w-full h-full border-0 block",title:"HITL Viewport",onLoad:x})}):t.jsx("div",{className:"rounded-md border border-surface-border overflow-hidden bg-white",children:t.jsx("iframe",{ref:l,src:e,sandbox:"allow-scripts allow-same-origin allow-forms allow-pointer-lock allow-downloads",className:"w-full border-0",style:{minHeight:"600px"},title:"HITL Viewport",onLoad:x})})}function S({children:e,isRequired:s,htmlFor:a}){return t.jsxs("label",{htmlFor:a,className:"block text-2xs font-semibold uppercase tracking-wider text-text-secondary",children:[e,s&&t.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})}function Y({id:e,children:s}){return t.jsx("p",{id:e,className:"text-2xs text-text-tertiary mt-0.5 leading-snug",children:s})}function it({error:e,id:s}){return e?t.jsx("p",{id:s,role:"alert",className:"text-2xs text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:e}):null}function mt(e){return e?"input text-sm w-full mt-1 border-status-error/50 focus:border-status-error animate-[field-shake_0.4s_ease-in-out]":"input text-sm w-full mt-1"}function nn(e){return e?"select text-sm mt-1 min-w-[min(16rem,100%)] max-w-full border-status-error/50 focus:border-status-error animate-[field-shake_0.4s_ease-in-out]":"select text-sm mt-1 min-w-[min(16rem,100%)] max-w-full"}function rn({fieldKey:e,value:s,onChange:a,schema:r,isRequired:n}){const i=h.useRef(null),d=(r==null?void 0:r.accept)??void 0,l=G(e,r),c=r==null?void 0:r.description,x=h.useCallback(u=>{var N;const m=(N=u.target.files)==null?void 0:N[0];if(!m)return;const g=new FileReader;g.onload=()=>{typeof g.result=="string"&&a(g.result)},g.readAsDataURL(m)},[a]),o=s.startsWith("data:");return t.jsxs("div",{children:[t.jsx(S,{isRequired:n,children:l}),c&&t.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:c}),t.jsxs("div",{className:"mt-1",children:[t.jsx("input",{ref:i,type:"file",accept:d,onChange:x,className:"hidden"}),t.jsx("button",{type:"button",onClick:()=>{var u;return(u=i.current)==null?void 0:u.click()},className:"btn-secondary text-xs px-3 py-1.5",children:o?"Replace file":"Choose file"}),o&&t.jsx("span",{className:"ml-2 text-xs text-status-success",children:"File attached"})]})]})}function an({fieldKey:e,value:s,onChange:a,schema:r,isRequired:n}){const i=G(e,r),d=r==null?void 0:r.description,l=(r==null?void 0:r["x-lt-language"])??"",c=h.useCallback(x=>{if(x.key==="Tab"){x.preventDefault();const o=x.currentTarget,u=o.selectionStart,m=o.selectionEnd,g=s.substring(0,u)+" "+s.substring(m);a(g),requestAnimationFrame(()=>{o.selectionStart=o.selectionEnd=u+2})}},[s,a]);return t.jsxs("div",{children:[t.jsxs(S,{isRequired:n,children:[i,l&&t.jsx("span",{className:"ml-2 text-text-tertiary/60 normal-case font-normal",children:l})]}),d&&t.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:d}),t.jsx("textarea",{value:s,onChange:x=>a(x.target.value),onKeyDown:c,className:"input w-full mt-1 font-mono text-xs leading-relaxed",rows:10,spellCheck:!1})]})}function on({fieldKey:e,value:s,onChange:a,schema:r,isRequired:n}){const i=h.useRef(null),[d,l]=h.useState(!1),c=G(e,r),x=r==null?void 0:r.description;h.useEffect(()=>{const j=i.current;if(!j)return;const f=j.getContext("2d");if(f&&(f.lineWidth=2,f.lineCap="round",f.strokeStyle="#1E1535",s&&s.startsWith("data:"))){const y=new Image;y.onload=()=>f.drawImage(y,0,0),y.src=s}},[]);const o=h.useCallback(j=>{const f=i.current,y=f.getBoundingClientRect(),_=y.width>0?f.width/y.width:1,p=y.height>0?f.height/y.height:1;return"touches"in j?{x:(j.touches[0].clientX-y.left)*_,y:(j.touches[0].clientY-y.top)*p}:{x:(j.clientX-y.left)*_,y:(j.clientY-y.top)*p}},[]),u=h.useCallback(j=>{var _;l(!0);const f=(_=i.current)==null?void 0:_.getContext("2d");if(!f)return;const y=o(j);f.beginPath(),f.moveTo(y.x,y.y)},[o]),m=h.useCallback(j=>{var _;if(!d)return;const f=(_=i.current)==null?void 0:_.getContext("2d");if(!f)return;const y=o(j);f.lineTo(y.x,y.y),f.stroke()},[d,o]),g=h.useCallback(()=>{l(!1);const j=i.current;j&&a(j.toDataURL("image/png"))},[a]),N=h.useCallback(()=>{const j=i.current;if(!j)return;const f=j.getContext("2d");f&&(f.clearRect(0,0,j.width,j.height),a(""))},[a]);return t.jsxs("div",{children:[t.jsx(S,{isRequired:n,children:c}),x&&t.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:x}),t.jsx("div",{className:"mt-1 max-w-[25rem] border border-surface-border rounded-md overflow-hidden bg-white",children:t.jsx("canvas",{ref:i,width:400,height:150,className:"w-full cursor-crosshair touch-none",onMouseDown:u,onMouseMove:m,onMouseUp:g,onMouseLeave:g,onTouchStart:u,onTouchMove:m,onTouchEnd:g})}),t.jsx("button",{type:"button",onClick:N,className:"mt-1 text-2xs text-text-tertiary hover:text-accent transition-colors",children:"Clear"})]})}function ln({fieldKey:e,value:s,onChange:a,schema:r,isRequired:n}){const i=G(e,r),d=r==null?void 0:r.description;return t.jsxs("div",{children:[t.jsx(S,{isRequired:n,children:i}),d&&t.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:d}),t.jsx("textarea",{value:s,onChange:l=>a(l.target.value),className:"input w-full mt-1 text-sm leading-relaxed",rows:8,placeholder:"Supports plain text. Markdown formatting is preserved."})]})}function cn({fieldKey:e,value:s,onChange:a,schema:r,isRequired:n}){const[i,d]=h.useState("write"),l=G(e,r),c=r==null?void 0:r.description;return(r==null?void 0:r.readOnly)===!0?t.jsx(Pt,{content:s,className:"my-1"}):t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(S,{isRequired:n,children:l}),t.jsx("div",{className:"flex items-center gap-0.5",children:["write","preview"].map(o=>t.jsx("button",{type:"button",onClick:()=>d(o),className:`px-2 py-0.5 text-2xs rounded transition-colors ${i===o?"bg-accent/10 text-accent font-semibold":"text-text-quaternary hover:text-text-secondary"}`,children:o==="write"?"Write":"Preview"},o))})]}),c&&t.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:c}),i==="write"?t.jsx("textarea",{value:s,onChange:o=>a(o.target.value),className:"input w-full mt-1 text-sm font-mono leading-relaxed",rows:10,placeholder:"Write markdown — headings, lists, tables, code blocks, and links all render."}):t.jsx("div",{className:"mt-1 px-3 py-2 border border-surface-border rounded min-h-[120px]",children:s.trim()?t.jsx(Pt,{content:s}):t.jsx("p",{className:"text-xs text-text-quaternary italic",children:"Nothing to preview."})})]})}const dn=28;function xn({fieldKey:e,value:s,onChange:a,schema:r,escalationContext:n,isRequired:i,submitAttempted:d,error:l}){const c=r==null?void 0:r["x-lt-source"],x=(r==null?void 0:r["x-lt-require-all"])===!0,o=[];if(c&&n){const p=c.indexOf(".");if(p!==-1){const w=c.slice(0,p),I=c.slice(p+1);try{const E=Vt(n[w],I);Array.isArray(E)&&o.push(...E)}catch{}}}let u={};try{s&&(u=JSON.parse(s))}catch{}const m=p=>a(JSON.stringify({...u,[p]:!u[p]})),g=G(e,r),N=r==null?void 0:r.description;if(o.length===0)return t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs text-text-tertiary italic mt-1",children:"No checklist items. Provide checklist_items in the escalation envelope or metadata."}),l&&t.jsx("p",{className:"text-2xs text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:l})]});const j=r==null?void 0:r["x-lt-variant"],f=j==="chips"||j==="rows"?j:x||o.some(p=>p.label.length>dn)?"rows":"chips",y=o.filter(p=>u[p.id]).length,_=(o.find(p=>!u[p.id]&&p.required!==!1)??o[0]).id;return t.jsxs("div",{role:"group","aria-label":g,"aria-required":i||void 0,"aria-invalid":l?!0:void 0,children:[t.jsx(S,{isRequired:i,children:g}),N&&t.jsx(Y,{children:N}),f==="chips"?t.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:o.map(p=>{const w=u[p.id]??!1,I=!w&&!!d&&y===0&&(p.required||i);return t.jsxs("label",{className:`inline-flex items-center gap-1.5 cursor-pointer select-none px-3.5 py-2 text-sm border transition-colors rounded-[var(--lt-radius-field)] ${w?"bg-accent border-accent text-text-inverse":I?"bg-surface-field border-status-error/60 text-status-error":"bg-surface-field border-surface-field-border text-text-secondary hover:border-accent hover:text-text-primary"}`,children:[t.jsx("input",{type:"checkbox",checked:w,onChange:()=>m(p.id),className:"sr-only","data-testid":`checklist-item-${p.id}`,...p.id===_?{"data-field-key":e}:{}}),w&&t.jsx(Cs,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:2.5}),p.label]},p.id)})}):t.jsx("div",{className:"space-y-2.5 mt-2",children:o.map(p=>{const w=u[p.id]??!1,I=!w&&!!d&&(x?p.required!==!1:y===0&&(p.required||i));return t.jsxs("label",{className:`flex items-start gap-3 cursor-pointer group select-none rounded px-2 py-1 -mx-2 transition-colors ${I?"bg-status-error/5":"hover:bg-surface-hover"}`,children:[t.jsx("input",{type:"checkbox",checked:w,onChange:()=>m(p.id),className:`mt-0.5 w-3.5 h-3.5 shrink-0 rounded ${I?"accent-status-error":"accent-accent"}`,"data-testid":`checklist-item-${p.id}`,...p.id===_?{"data-field-key":e}:{}}),t.jsxs("span",{className:`text-sm leading-snug transition-colors ${I?"text-status-error":"text-text-secondary group-hover:text-text-primary"}`,children:[p.label,p.required&&t.jsx("span",{className:`ml-0.5 text-2xs ${I?"text-status-error":"text-text-quaternary"}`,children:"*"})]})]},p.id)})}),t.jsx("p",{className:"text-2xs text-text-quaternary mt-3 tabular-nums",children:f==="chips"?t.jsxs(t.Fragment,{children:[y," selected",i&&y===0&&!!d&&t.jsx("span",{className:"ml-1 text-text-quaternary/60",children:"(check at least one)"})]}):t.jsxs(t.Fragment,{children:[y," / ",o.length," confirmed",x?t.jsxs("span",{className:"ml-1 text-text-quaternary/60",children:["(all required",o.some(p=>p.required===!1)?" except optional":"",")"]}):i&&y===0&&!!d&&t.jsx("span",{className:"ml-1 text-text-quaternary/60",children:"(at least one required)"})]})}),l&&t.jsx("p",{role:"alert",className:"text-2xs text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:l})]})}const un=/\.(png|jpe?g|gif|webp|avif|bmp|svg)(\?.*)?$/i;function pn(e){var r,n,i,d;const s=e.trim();if(!s)return{kind:"none"};const a=(n=(r=/^data:([^;,]+)[;,]/.exec(s))==null?void 0:r[1])==null?void 0:n.toLowerCase();if(a)return a.startsWith("image/")?{kind:"image",src:s}:{kind:"file",href:s,label:a==="application/pdf"?"PDF":a,isData:!0};if(/^https?:\/\//i.test(s)){if(un.test(s))return{kind:"image",src:s};const l=(d=(i=/\.([a-z0-9]{2,5})(\?.*)?$/i.exec(s))==null?void 0:i[1])==null?void 0:d.toUpperCase();return{kind:"file",href:s,label:l??"attachment",isData:!1}}return{kind:"none"}}function pe({fieldKey:e,value:s,schema:a}){const[r,n]=h.useState(!1),i=pn(s??""),d=e.replace(/[_-]/g," "),l=a==null?void 0:a.description,c=t.jsxs(t.Fragment,{children:[t.jsx("label",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:d}),l&&t.jsx("p",{className:"text-2xs text-text-tertiary mt-0.5",children:l})]});return i.kind==="none"?t.jsxs("div",{children:[c,t.jsx("p",{className:"text-xs text-text-quaternary italic mt-1",children:"No attachment"})]}):i.kind==="image"?t.jsxs("div",{children:[c,t.jsxs("div",{className:"mt-1",children:[t.jsx("button",{type:"button",onClick:()=>n(!0),className:"block rounded-[0.125em] border border-surface-border overflow-hidden hover:border-accent transition-colors",title:"View full size",children:t.jsx("img",{src:i.src,alt:e.replace(/[_-]/g," "),className:"max-h-48 max-w-full object-contain","data-testid":`attachment-image-${e}`})}),r&&t.jsx("div",{className:"fixed inset-0 z-[100] bg-text-primary/60 backdrop-blur-sm flex items-center justify-center p-8 cursor-zoom-out",onClick:()=>n(!1),role:"dialog","aria-modal":"true","aria-label":`${d} — full size`,children:t.jsx("img",{src:i.src,alt:d,className:"max-h-[90vh] max-w-[90vw] object-contain"})})]})]}):t.jsxs("div",{children:[c,t.jsx("div",{className:"mt-1",children:t.jsxs("a",{href:i.href,...i.isData?{download:`${e}.${i.label==="PDF"?"pdf":"bin"}`}:{target:"_blank",rel:"noopener noreferrer"},className:"inline-flex items-center gap-1.5 text-xs text-accent hover:text-accent-hover transition-colors","data-testid":`attachment-link-${e}`,children:[t.jsx(_s,{className:"w-3.5 h-3.5",strokeWidth:1.5}),i.isData?`Download ${i.label}`:`Open ${i.label}`,i.isData?t.jsx(Es,{className:"w-3 h-3",strokeWidth:1.5}):t.jsx(Wt,{className:"w-3 h-3",strokeWidth:1.5})]})})]})}function mn({fieldKey:e,schema:s,escalationContext:a}){const r=(s==null?void 0:s["x-lt-href"])??"",n=r&&a?lt(r,a):r,i=(s==null?void 0:s.title)??(s==null?void 0:s.description)??"Open",d=s==null?void 0:s.description,l=n.startsWith("/"),c=!n.trim();return t.jsxs("div",{"data-field-key":e,children:[t.jsx(S,{children:i}),d&&t.jsx(Y,{children:d}),t.jsx("div",{className:"mt-1",children:c?t.jsx("span",{className:"text-xs text-text-quaternary italic",children:"No link configured"}):l?t.jsxs(ot,{to:n,className:"inline-flex items-center gap-1 text-xs text-accent hover:text-accent-hover transition-colors","data-testid":`link-widget-${e}`,children:[i,t.jsx(Wt,{className:"w-3 h-3 shrink-0",strokeWidth:1.5})]}):t.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:text-accent-hover transition-colors","data-testid":`link-widget-${e}`,children:[i,t.jsx(Wt,{className:"w-3 h-3 shrink-0",strokeWidth:1.5})]})})]})}const me="—";function fn(e,s){if(!e||!s)return"";const a=e.indexOf(".");if(a===-1)return"";const r=e.slice(0,a),n=e.slice(a+1);try{const i=Vt(s[r],n);return typeof i=="string"?i:""}catch{return""}}function hn(e,s){if(!e||e===me)return me;if(s==="age"){const a=new Date(e);return Number.isNaN(a.getTime())?e:qt(e)}return e}function gn({fieldKey:e,schema:s,escalationContext:a}){const r=s==null?void 0:s["x-lt-source"],n=(s==null?void 0:s["x-lt-fields"])??[],i=(s==null?void 0:s.title)??"Linked escalation",d=s==null?void 0:s.description,l=fn(r,a),{data:c,isLoading:x,isError:o}=je(l);return t.jsxs("div",{"data-field-key":e,children:[t.jsx(S,{children:i}),d&&t.jsx(Y,{children:d}),t.jsx("div",{className:"mt-1",children:!l||o?t.jsx("p",{className:"text-xs text-text-quaternary italic","data-testid":`escalation-widget-empty-${e}`,children:"No linked record"}):x?t.jsx(bn,{}):c?t.jsx(jn,{esc:c,fields:n,fieldKey:e}):t.jsx("p",{className:"text-xs text-text-quaternary italic",children:"No linked record"})})]})}function jn({esc:e,fields:s,fieldKey:a}){if(!e)return null;const r=Jt(e);return t.jsxs("div",{className:"border-l-2 border-accent-faint pl-3 py-2 space-y-2","data-testid":`escalation-widget-card-${a}`,children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsxs("span",{className:"text-2xs font-semibold uppercase tracking-wider text-text-secondary",children:[e.type,e.subtype&&e.subtype!==e.type?` · ${e.subtype}`:""]}),t.jsx(ke,{status:e.status})]}),e.description&&t.jsx("p",{className:"text-xs text-text-primary leading-snug",children:e.description}),s.length>0&&t.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-0.5",children:s.map(n=>{const i=lt(n.value,r),d=hn(i,n.format);return t.jsxs("div",{className:"contents",children:[t.jsx("dt",{className:"text-2xs text-text-tertiary whitespace-nowrap",children:n.label}),t.jsx("dd",{className:"text-2xs text-text-primary",children:d})]},n.label)})}),t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("span",{className:"text-2xs text-text-quaternary",children:[e.role," · ",qt(e.created_at)]}),t.jsxs(ot,{to:`/escalations/detail/${e.id}`,className:"inline-flex items-center gap-0.5 text-2xs text-accent hover:text-accent-hover transition-colors",title:"Open escalation detail",children:["Detail",t.jsx(As,{className:"w-3 h-3 shrink-0",strokeWidth:1.5})]})]})]})}function bn(){return t.jsxs("div",{className:"border-l-2 border-accent-faint pl-3 py-2 space-y-2 animate-pulse",children:[t.jsx("div",{className:"h-3 w-32 bg-surface-sunken rounded"}),t.jsx("div",{className:"h-3 w-48 bg-surface-sunken rounded"}),t.jsx("div",{className:"h-3 w-24 bg-surface-sunken rounded"})]})}const yn=[{label:"Description",value:"{{escalation.description}}"},{label:"Role",value:"{{escalation.role}}"},{label:"Age",value:"{{escalation.created_at}}",format:"age"}],fe="—";function Nn(e,s){if(!e||e===fe)return fe;if(s==="age"){const a=new Date(e);return Number.isNaN(a.getTime())?e:qt(e)}return e}function Ft(e,s){return typeof e=="string"?lt(e,s):Array.isArray(e)?e.map(a=>Ft(a,s)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,r])=>[a,Ft(r,s)])):e}function vn({fieldKey:e,schema:s,escalationContext:a}){const r=(s==null?void 0:s["x-lt-query"])??{},n=(s==null?void 0:s["x-lt-columns"])??yn,i=(s==null?void 0:s["x-lt-actions"])??[],d=(s==null?void 0:s.title)??"Related items",l=s==null?void 0:s.description,c=a??{},x=Ie(r.facets,c),{data:o,isLoading:u}=ge({role:r.role,status:r.status,facets:x,available:r.available,limit:r.limit??5,enabled:!!(r.role||Object.keys(x).length)}),m=(o==null?void 0:o.escalations)??[],g=be(),[N,j]=h.useState({}),[f,y]=h.useState(null),_=async(p,w)=>{const I=Jt(p);if(!(w.confirm&&!window.confirm(lt(w.confirm,I)))){y(p.id),j(E=>({...E,[p.id]:""}));try{await g.mutateAsync({id:p.id,resolverPayload:Ft(w.resolverPayload,I)})}catch(E){j(M=>({...M,[p.id]:E.message}))}finally{y(null)}}};return t.jsxs("div",{"data-field-key":e,children:[t.jsx(S,{children:d}),l&&t.jsx(Y,{children:l}),t.jsx("div",{className:"mt-1","data-testid":`escalation-list-widget-${e}`,children:u?t.jsx(kn,{columns:n.length}):t.jsx(wn,{escalations:m,columns:n,fieldKey:e,actions:i,onAction:_,pendingRow:f,rowErrors:N})})]})}function wn({escalations:e,columns:s,fieldKey:a,actions:r,onAction:n,pendingRow:i,rowErrors:d}){return e.length===0?t.jsx("p",{className:"text-xs text-text-quaternary italic py-1","data-testid":`escalation-list-empty-${a}`,children:"No items found"}):t.jsxs("table",{className:"w-full text-xs border-collapse","data-testid":`escalation-list-table-${a}`,children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-surface-border",children:[s.map(l=>t.jsx("th",{className:"text-left text-2xs font-semibold uppercase tracking-wider text-text-tertiary pb-1 pr-3 last:pr-0",children:l.label},l.label)),r.length>0&&t.jsx("th",{className:"w-px"}),t.jsx("th",{className:"w-4"})]})}),t.jsx("tbody",{children:e.map(l=>{const c=Jt(l),x=d[l.id];return t.jsxs("tr",{className:"border-b border-surface-border/50 last:border-0 hover:bg-surface-sunken/50 transition-colors",children:[s.map(o=>{const u=lt(o.value,c),m=Nn(u,o.format);return t.jsx("td",{className:"py-1 pr-3 last:pr-0 text-text-primary align-top",children:m},o.label)}),r.length>0&&t.jsxs("td",{className:"py-1 pr-2 align-top whitespace-nowrap",children:[r.map(o=>t.jsx("button",{type:"button",onClick:()=>n(l,o),disabled:i===l.id,className:"px-2 py-0.5 text-2xs font-medium text-accent border border-accent/40 rounded hover:bg-accent/10 disabled:opacity-40 disabled:cursor-default transition-colors ml-1 first:ml-0","data-testid":`escalation-list-action-${l.id}`,children:o.label},o.label)),x&&t.jsx("p",{className:"text-2xs text-status-error mt-0.5 whitespace-normal max-w-[16rem]","data-testid":`escalation-list-action-error-${l.id}`,children:x})]}),t.jsx("td",{className:"py-1 align-top",children:t.jsx(ot,{to:`/escalations/detail/${l.id}`,className:"text-accent hover:text-accent-hover transition-colors",title:"Open escalation detail",tabIndex:-1,children:"→"})})]},l.id)})})]})}function kn({columns:e}){return t.jsx("div",{className:"space-y-1.5 animate-pulse",children:[0,1,2].map(s=>t.jsx("div",{className:"flex gap-4",children:Array.from({length:e},(a,r)=>t.jsx("div",{className:"h-3 bg-surface-sunken rounded flex-1"},r))},s))})}const Dt={"file-upload":rn,"code-editor":an,signature:on,"rich-text":ln,markdown:cn,checklist:xn,attachment:pe,image:pe,link:mn,escalation:gn,"escalation-list":vn};function Me({fieldKey:e,value:s,onChange:a,onBlur:r,schema:n,isRequired:i,isReadOnly:d,error:l,escalationContext:c,submitAttempted:x}){var M;const o=(M=n==null?void 0:n.properties)==null?void 0:M[e],u=G(e,o),m=o==null?void 0:o["x-lt-widget"],g=`lt-field-${e}`,N=`${g}-error`,j=`${g}-help`,f=typeof(o==null?void 0:o.description)=="string"&&o.description.length>0?o.description:void 0,p={id:g,"aria-required":i||void 0,"aria-invalid":l?!0:void 0,"aria-describedby":l?N:f!==void 0?j:void 0},w=m==="markdown"&&typeof s=="string",I=(m==="attachment"||m==="image")&&typeof s=="string",E=!!(m&&m in Dt);if(d&&!w&&!I&&!E){const A=s===null?"null":typeof s=="object"?JSON.stringify(s,null,2):String(s);return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,children:u}),t.jsx("p",{className:"text-sm text-text-secondary mt-0.5 whitespace-pre-wrap",children:A})]})}if(m&&m in Dt){const A=Dt[m],$=i||(o==null?void 0:o["x-lt-require-all"])===!0,C={fieldKey:e,schema:o,escalationContext:c,isRequired:$,submitAttempted:x,error:l};if((o==null?void 0:o.type)==="object"){const O=typeof s=="string"?s:typeof s=="object"&&s!==null&&!Array.isArray(s)?JSON.stringify(s):"";return t.jsx(A,{...C,value:O,onChange:q=>{try{a(JSON.parse(q))}catch{a(q)}}})}if(typeof s=="string")return t.jsx(A,{...C,value:s,onChange:O=>a(O)});if(typeof s=="object"&&s!==null&&!Array.isArray(s))return t.jsx(A,{...C,value:JSON.stringify(s),onChange:O=>{try{a(JSON.parse(O))}catch{a(O)}}})}if(typeof s=="boolean")return t.jsxs("div",{children:[t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:s,onChange:A=>{a(A.target.checked),r==null||r()},className:"w-3.5 h-3.5 rounded accent-accent","data-field-key":e,...p}),t.jsxs("span",{className:"text-2xs font-semibold uppercase tracking-wider text-text-secondary",children:[u,i&&t.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})]}),f&&t.jsx(Y,{id:j,children:f}),t.jsx(it,{error:l,id:N})]});if(typeof s=="number")return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,htmlFor:g,children:u}),f&&t.jsx(Y,{id:j,children:f}),t.jsx("input",{type:"number",value:s,onChange:A=>a(parseFloat(A.target.value)||0),onBlur:r,step:"any","data-field-key":e,className:`${mt(!!l)} max-w-48`,...p}),t.jsx(it,{error:l,id:N})]});if(typeof s=="string"){const A=(o==null?void 0:o.format)==="password",$=o==null?void 0:o.enum;if($!=null&&$.length){const F=s===""&&!$.includes("");return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,htmlFor:g,children:u}),f&&t.jsx(Y,{id:j,children:f}),t.jsxs("select",{value:s,onChange:P=>a(P.target.value),onBlur:r,"data-field-key":e,className:nn(!!l),...p,children:[F&&t.jsx("option",{value:"",disabled:!0,children:"Choose…"}),$.map(P=>t.jsx("option",{value:P,children:P},P))]}),t.jsx(it,{error:l,id:N})]})}if(A)return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,htmlFor:g,children:u}),f&&t.jsx(Y,{id:j,children:f}),t.jsx("input",{type:"password",value:s,onChange:F=>a(F.target.value),onBlur:r,"data-field-key":e,className:mt(!!l),autoComplete:"off",...p}),t.jsx(it,{error:l,id:N})]});const C=o==null?void 0:o.format,O={date:"date","date-time":"datetime-local",email:"email",uri:"url"},q={date:"max-w-48","date-time":"max-w-64"};if(C&&C in O)return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,htmlFor:g,children:u}),f&&t.jsx(Y,{id:j,children:f}),t.jsx("input",{type:O[C],value:s,onChange:F=>a(F.target.value),onBlur:r,"data-field-key":e,className:`${mt(!!l)} ${q[C]??""}`,...p}),t.jsx(it,{error:l,id:N})]});if(C==="textarea"||s.length>80){const F=o==null?void 0:o.maxLength,P=o==null?void 0:o["x-lt-max-length"];let V=F;if(V===void 0&&P&&c){const b=P.indexOf(".");if(b!==-1){const R=P.slice(0,b),v=P.slice(b+1),D=c[R];if(D&&typeof D=="object"){let L=D;for(const U of v.split("."))if(L=L[U],L===void 0)break;if(typeof L=="number")V=L;else if(typeof L=="string"){const U=Number(L);Number.isNaN(U)||(V=U)}}}}const X=V!==void 0&&s.length>V;return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,htmlFor:g,children:u}),f&&t.jsx(Y,{id:j,children:f}),t.jsx("textarea",{value:s,onChange:b=>{a(b.target.value),r==null||r()},onBlur:r,"data-field-key":e,className:`${mt(!!l)} leading-relaxed`,rows:Math.min(6,Math.max(3,Math.ceil(s.length/60))),...p}),V!==void 0&&t.jsxs("p",{className:`text-2xs mt-0.5 text-right tabular-nums ${X?"text-status-error font-medium":"text-text-quaternary"}`,children:[s.length," / ",V]}),t.jsx(it,{error:l,id:N})]})}return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,htmlFor:g,children:u}),f&&t.jsx(Y,{id:j,children:f}),t.jsx("input",{type:"text",value:s,onChange:F=>a(F.target.value),onBlur:r,"data-field-key":e,className:mt(!!l),...p}),t.jsx(it,{error:l,id:N})]})}if(s===null)return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,children:u}),t.jsx("p",{className:"text-xs text-text-tertiary italic mt-1",children:"null"})]});if(Array.isArray(s))return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,children:u}),t.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:s.map((A,$)=>t.jsx("span",{className:"px-2 py-0.5 text-2xs font-mono bg-surface-sunken rounded text-text-secondary",children:String(A)},$))})]});if(typeof s=="object"){const A=Object.entries(s);return t.jsxs("div",{children:[t.jsx(S,{isRequired:i,children:u}),t.jsx("div",{className:"ml-4 mt-2 pl-4 border-l border-accent-faint space-y-3",children:A.map(([$,C])=>t.jsx(Me,{fieldKey:$,value:C,onChange:O=>a({...s,[$]:O})},$))})]})}return null}function Cn({items:e,columns:s=1}){if(e.length===0)return null;const a=s>=2&&e.length>1?"grid-cols-1 @dict-inline:grid-cols-[max-content_1fr] @dict-pairs:grid-cols-[max-content_1fr_max-content_1fr]":"grid-cols-1 @dict-inline:grid-cols-[max-content_1fr]";return t.jsx("div",{className:"@container",children:t.jsx("dl",{className:`grid ${a} items-baseline gap-x-6 @dict-pairs:gap-x-8 gap-y-1.5`,children:e.map(({key:r,label:n,value:i})=>t.jsxs(h.Fragment,{children:[t.jsx("dt",{className:"text-2xs font-semibold uppercase tracking-wide text-text-secondary mt-2 first:mt-0 @dict-inline:mt-0",children:n}),t.jsx("dd",{className:"text-sm text-text-primary break-words min-w-0","data-field-key":r,children:_n(i)})]},r))})})}function _n(e){return e==null||e===""?"—":typeof e=="boolean"?e?"Yes":"No":typeof e=="object"?JSON.stringify(e):String(e)}const Mt="dictionary",En=new Set(["markdown","attachment","image"]);function Le(e,s){if(!s)return;const a=e==null?void 0:e["x-lt-section-options"],r=a==null?void 0:a[s];return r&&typeof r=="object"?r:void 0}function An(e,s,a){var l,c;const r=(l=e==null?void 0:e.properties)==null?void 0:l[a];if((r==null?void 0:r.readOnly)!==!0)return!1;const n=r==null?void 0:r["x-lt-widget"];if(typeof n=="string"&&En.has(n))return!1;const i=r==null?void 0:r["x-lt-display"];if(typeof i=="string")return i===Mt;const d=(c=Le(e,s))==null?void 0:c.display;return typeof d=="string"?d===Mt:(e==null?void 0:e["x-lt-display"])===Mt}function Tn(e,s,a,r){var i;const n=[];for(const d of e){const[l]=d,c=n[n.length-1];if(An(s,a,l)){(c==null?void 0:c.kind)==="dictionary"?c.entries.push(d):n.push({kind:"dictionary",entries:[d]});continue}const x=(i=s==null?void 0:s.properties)==null?void 0:i[l],o=x==null?void 0:x["x-lt-column-group"];if(r==="two-column"&&typeof o=="string"&&o.trim()){(c==null?void 0:c.kind)==="column-group"&&c.name===o?c.entries.push(d):n.push({kind:"column-group",name:o,entries:[d]});continue}n.push({kind:"field",entry:d})}return n}function $n({name:e,entries:s,formSchema:a,layout:r,renderField:n}){const i=Tn(s,a,e,r),d=Le(a,e),l=(d==null?void 0:d.columns)??(r==="two-column"?2:1),c=o=>o.map(([u,m])=>{var g;return{key:u,label:G(u,(g=a==null?void 0:a.properties)==null?void 0:g[u]),value:m}}),x=()=>i.map((o,u)=>o.kind==="dictionary"?t.jsx("div",{className:r==="two-column"?"col-span-full":"",children:t.jsx(Cn,{items:c(o.entries),columns:l})},`dict-${u}`):o.kind==="column-group"?t.jsx("div",{className:"@container",children:t.jsx("div",{className:"grid grid-cols-1 @grp-cols:grid-cols-2 gap-x-4 gap-y-5",children:o.entries.map(m=>n(m))})},`group-${o.name}-${u}`):n(o.entry));return t.jsxs("div",{className:e?"border border-surface-border/60 border-l-2 border-l-accent/30 bg-surface-sunken rounded-[0.125em] p-4 animate-[section-enter_0.25s_ease-out]":"",children:[e&&t.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[t.jsx(_e,{className:"w-5 h-5 text-accent/60 shrink-0",strokeWidth:1.5}),t.jsx("p",{className:"text-[1.40625rem] font-semibold tracking-wider text-heading [font-variant-caps:small-caps]",children:e})]}),r==="two-column"?t.jsx("div",{className:"@container",children:t.jsx("div",{className:"grid grid-cols-1 @form-cols:grid-cols-2 gap-x-col-gap gap-y-5",children:x()})}):t.jsx("div",{className:"space-y-5",children:x()})]})}function Pe({value:e,onChange:s,disabled:a,submitAttempted:r,escalationContext:n,onOpenHelp:i}){var V,X;const[d,l]=h.useState({}),[c,x]=h.useState({}),[o,u]=h.useState(null),[m,g]=h.useState(!1),[N,j]=h.useState(new Set);h.useEffect(()=>{try{const b=JSON.parse(e);if(typeof b=="object"&&b!==null&&!Array.isArray(b)){const R={},v={};for(const[D,L]of Object.entries(b))D.startsWith("_")?v[D]=L:R[D]=L;l(R),x(v),u(v._form_schema&&typeof v._form_schema=="object"?v._form_schema:null),g(!1)}}catch{g(!0)}},[e]);const f=h.useCallback(b=>{l(b),s(JSON.stringify({...b,...c},null,2))},[c,s]),y=h.useCallback((b,R)=>{f({...d,[b]:R})},[d,f]),_=h.useCallback(b=>{j(R=>{if(R.has(b))return R;const v=new Set(R);return v.add(b),v})},[]);if(m)return t.jsx("p",{className:"text-xs text-status-error",children:"Unable to parse resolver data as form. Use the JSON editor below."});const p=Object.entries(d);if(p.length===0)return t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No resolver fields defined."});const w=o==null?void 0:o["x-lt-order"],I=w?[...p].sort((b,R)=>{const v=w.indexOf(b[0]),D=w.indexOf(R[0]);return(v===-1?1/0:v)-(D===-1?1/0:D)}):p,E={...n??{},resolver:d},M=I.filter(([b,R])=>{var D;const v=(D=o==null?void 0:o.properties)==null?void 0:D[b];return!(!Re(v==null?void 0:v["x-lt-showIf"],E)||(v==null?void 0:v["x-lt-hide-if-empty"])===!0&&(R==null||R===""||R===!1||R===0))}),A=new Set((o==null?void 0:o.required)??[]),$=o==null?void 0:o["x-lt-layout"],C=o==null?void 0:o.title,O=o==null?void 0:o.description,q=typeof(o==null?void 0:o["x-lt-help"])=="string"||typeof(o==null?void 0:o["x-lt-context"])=="string",F=[];for(const b of M){const[R]=b,v=(V=o==null?void 0:o.properties)==null?void 0:V[R],D=((X=v==null?void 0:v["x-lt-section"])==null?void 0:X.trim())||null,L=F[F.length-1];!L||L.name!==D?F.push({name:D,entries:[b]}):L.entries.push(b)}const P=([b,R])=>{var W;const v=(W=o==null?void 0:o.properties)==null?void 0:W[b],D=(v==null?void 0:v.readOnly)===!0,L=(v==null?void 0:v["x-lt-span"])??1,U=A.has(b),Q=N.has(b)||!!r,B=$e(R,v,U,Q,E);return t.jsx("div",{className:`animate-[field-enter_0.2s_ease-out] ${$==="two-column"&&L>=2?"col-span-full":""}`,children:t.jsx(Me,{fieldKey:b,value:R,onChange:z=>y(b,z),onBlur:()=>_(b),schema:o,isRequired:U,isReadOnly:D,error:B,escalationContext:E,submitAttempted:!!r})},b)};return t.jsxs("div",{className:`pb-8 max-w-form ${a?"opacity-60 pointer-events-none":""}`,inert:a||void 0,"aria-disabled":a||void 0,children:[C&&t.jsxs("div",{className:"mb-1 flex items-center gap-1.5",children:[t.jsx("h3",{className:"heading-3",children:C}),q&&i&&t.jsx("button",{type:"button",onClick:i,title:"Open instructions","aria-label":"Open instructions",className:"p-1 rounded-md text-text-tertiary hover:text-accent hover:bg-surface-hover transition-colors",children:t.jsx(Ut,{className:"w-4 h-4",strokeWidth:1.5})})]}),O&&t.jsx("p",{className:"text-sm text-text-secondary leading-relaxed mb-6",children:O}),t.jsx("div",{className:"space-y-8",children:F.map((b,R)=>t.jsx($n,{name:b.name,entries:b.entries,formSchema:o,layout:$,renderField:P},b.name??`__s${R}`))})]})}function Rn({json:e,onJsonChange:s,requestTriage:a,onRequestTriageChange:r,triageNotes:n,onTriageNotesChange:i,disabled:d=!1,submitAttempted:l=!1,showTriage:c=!1,escalationContext:x,onOpenHelp:o}){return t.jsxs(t.Fragment,{children:[c&&t.jsx("div",{className:"flex items-center justify-between mb-3",children:a?t.jsxs("button",{onClick:()=>r(!1),className:"group flex items-center gap-2 text-left","data-testid":"triage-cancel",children:[t.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-accent/10 text-accent shrink-0",children:t.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),t.jsxs("span",{className:"text-xs text-text-secondary group-hover:text-text-primary transition-colors",children:["AI Triage active."," ",t.jsx("span",{className:"text-accent group-hover:underline",children:"Cancel"})]})]}):t.jsxs("button",{onClick:()=>r(!0),className:"group flex items-center gap-2.5 text-left my-4","data-testid":"triage-callout",children:[t.jsx("span",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-accent/10 text-accent shrink-0 animate-[triage-glow_6s_ease-in-out_infinite]",children:t.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.674M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})}),t.jsxs("span",{className:"text-sm text-text-secondary group-hover:text-text-primary transition-colors",children:["This form doesn't capture the issue?"," ",t.jsx("span",{className:"text-accent group-hover:underline",children:"Request AI Triage"})]})]})}),t.jsxs("div",{className:"relative min-h-[200px]",children:[t.jsx("div",{className:a?"pointer-events-none select-none":"",children:t.jsx(Pe,{value:e,onChange:s,disabled:d,submitAttempted:l,escalationContext:x,onOpenHelp:o})}),a&&t.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col bg-surface/90 backdrop-blur-[2px] rounded-md border border-accent/20 p-5","data-testid":"triage-overlay",children:[t.jsx("p",{className:"text-xs text-text-secondary mb-3 leading-relaxed",children:"The resolution form will not be submitted. Describe the issue so AI triage can diagnose and fix it using available tools. The corrected result will come back as a new escalation for your review."}),t.jsx("textarea",{value:n,onChange:u=>i(u.target.value),placeholder:"e.g. Content is in Spanish — needs translation to English before review...",className:"input text-xs w-full flex-1 min-h-[80px] resize-none",autoFocus:!0,"data-testid":"triage-notes"})]})]})]})}function We(e,s){if(!e.includes("{"))return e;try{const a=n=>{if(!n)return{};try{return JSON.parse(n)}catch{return{}}},r={...s.metadata??{},...a(s.envelope),...a(s.escalation_payload)};return e.replace(/\{([^}]+)\}/g,(n,i)=>Object.prototype.hasOwnProperty.call(r,i)?String(r[i]):`{${i}}`)}catch{return e}}function he(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function St(e){return{escalation:e,metadata:e.metadata??null,envelope:he(e.envelope),payload:he(e.escalation_payload),resolver:null}}function On({isRoundsExhausted:e,payloadObj:s,isTerminal:a,resolverPayload:r,onRetryTriage:n,isRetrying:i}){return t.jsxs(t.Fragment,{children:[e&&s&&t.jsx("div",{className:"mt-8",children:t.jsx(sn,{payload:s,isTerminal:a,resolverPayload:r,onRetryTriage:n,isRetrying:i})}),(s==null?void 0:s.category)==="missing_credential"&&t.jsxs("div",{className:"mt-8 bg-status-warning/10 border border-status-warning/30 rounded-md px-5 py-4 flex items-start gap-3",children:[t.jsx(ae,{size:20,className:"text-status-warning mt-0.5 shrink-0"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-text-primary mb-1",children:"Missing Credential"}),t.jsxs("p",{className:"text-xs text-text-secondary mb-3",children:["This workflow requires a ",t.jsx("span",{className:"font-medium capitalize",children:String(s.provider)})," credential to continue. Register one and then resolve this escalation to retry."]}),t.jsxs(ot,{to:"/credentials",className:"btn-primary text-xs inline-flex items-center gap-1.5",children:[t.jsx(ae,{size:12}),"Go to Credentials"]})]})]})]})}function In({esc:e,resolverPayload:s,isTerminal:a,claimedByMe:r,activeView:n,metadataFormSchema:i,effectiveSchema:d,json:l,onJsonChange:c,requestTriage:x,onRequestTriageChange:o,triageNotes:u,onTriageNotesChange:m,onResolve:g,onEscalate:N,onClaim:j,submitAttempted:f,isCertified:y,hasAI:_,onOpenHelp:p}){const w=d,I=St(e);if(a){if(s==null)return null;const $=typeof s=="object"&&s!==null?s:{},C=d??i,O=C!=null&&C.properties?{...ve($,C),_form_schema:C}:$;return t.jsx("div",{className:"mt-3",children:t.jsx(Pe,{value:JSON.stringify(O,null,2),onChange:()=>{},disabled:!0,escalationContext:I})})}if(n!=="resolve"||!(e.workflow_type||d))return null;const E=w==null?void 0:w["x-lt-viewport"],M=(E==null?void 0:E.type)==="iframe"&&!!E.src&&g&&N;if(M&&!r)return t.jsxs("button",{onClick:()=>j==null?void 0:j(),disabled:!j,className:"flex flex-col items-center justify-center min-h-[55vh] w-full gap-3 text-center group disabled:opacity-50 disabled:cursor-default",children:[t.jsx(Ts,{className:"w-10 h-10 text-text-tertiary group-hover:text-accent transition-colors",strokeWidth:1}),t.jsx("p",{className:"text-base font-medium text-text-primary group-hover:text-accent transition-colors",children:"Claim to launch the editor"})]});const A=M?We(E.src,e):"";return t.jsx("div",{className:"mt-3",children:M?t.jsx(De,{src:A,escalation:e,schema:w,onResolve:g,onEscalate:N,submitAttempted:f}):t.jsx(Rn,{json:l,onJsonChange:c,requestTriage:x,onRequestTriageChange:o,triageNotes:u,onTriageNotesChange:m,disabled:!r,submitAttempted:f,showTriage:!!y&&!!_,escalationContext:I,onOpenHelp:p})})}function Dn({open:e,assignedUntil:s,onClose:a,onExtend:r,isPending:n}){const i=ye(),[d,l]=h.useState("30"),[c,x]=h.useState(0),o=d==="custom",u=o?c:parseInt(d),m=h.useCallback(g=>x(g),[]);return t.jsx(Is,{open:e,onClose:a,title:"Claim Expiring",children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-sm text-text-secondary",children:["Your claim on this escalation expires in"," ",t.jsx(Ht,{until:s}),". When it lapses, the form locks and the item returns to the queue — your edits are kept as a draft. Extend to keep working."]}),t.jsxs("select",{value:d,onChange:g=>{l(g.target.value),x(0)},className:"select w-full text-sm","aria-label":"Extension duration",children:[i.map(g=>t.jsx("option",{value:g.value,children:g.label},g.value)),t.jsx("option",{value:"custom",children:"Other..."})]}),o&&t.jsx(Ne,{onChange:m,autoFocus:!0}),t.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[t.jsx("button",{onClick:a,className:"btn-secondary text-xs",children:"Dismiss"}),t.jsx("button",{onClick:()=>r(u),className:"btn-primary text-xs",disabled:n||!u||u<=0,children:n?"Extending...":"Extend Claim"})]})]})})}const Mn=9e4;function Ln(e,s=Mn){const[,a]=h.useState(0);if(h.useEffect(()=>{if(!e)return;const n=new Date(e).getTime()-Date.now();if(n<=0)return;const i=()=>a(c=>c+1),d=[],l=n-s;return l>0&&d.push(window.setTimeout(i,l)),d.push(window.setTimeout(i,n)),()=>d.forEach(c=>window.clearTimeout(c))},[e,s]),!e)return{expired:!1,expiringSoon:!1,msRemaining:0};const r=Math.max(0,new Date(e).getTime()-Date.now());return{expired:r<=0,expiringSoon:r>0&&r<=s,msRemaining:r}}const Pn="lt:escalation:draft:";function zt(e){return`${Pn}${e}`}function Wn(e){try{return localStorage.getItem(zt(e))}catch{return null}}function Fn(e,s){try{localStorage.setItem(zt(e),s)}catch{}}function Lt(e){try{localStorage.removeItem(zt(e))}catch{}}const Fe="lt:escalation:panel:open";function Sn(){try{const e=localStorage.getItem(Fe);return e===null?!0:e==="true"}catch{return!0}}function ft(e){try{localStorage.setItem(Fe,String(e))}catch{}}function ht(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function ir(){var Xt,Qt,Zt,Kt;const{id:e}=Os(),{user:s}=Ke(),a=Ae(),r=Xe(),{data:n,isLoading:i,refetch:d,isFetching:l}=je(e);hs(e);const c=ts(),x=be(),o=es(),u=ss(),[m,g]=h.useState(!1),{data:N}=ns((n==null?void 0:n.role)??""),{data:j}=fs(),{data:f}=rs(),{isBuilder:y}=as(),_=j==null?void 0:j.find(k=>k.workflow_type===(n==null?void 0:n.workflow_type)),p=((Xt=f==null?void 0:f.telemetry)==null?void 0:Xt.traceUrl)??null,[w,I]=h.useState("resolve"),[E,M]=h.useState("{}"),[A,$]=h.useState(Sn),[C,O]=h.useState(!1),[q,F]=h.useState(""),[P,V]=h.useState(!1),[X,b]=h.useState([]),[R,v]=h.useState(void 0),D=Ln(n==null?void 0:n.assigned_until),[L,U]=h.useState(null);h.useEffect(()=>{if(!(!P||!n))try{const k=JSON.parse(E),J=k._form_schema;if(!J){b([]);return}b(Oe(J,k,St(n)))}catch{}},[E,P,n]);const Q=((Qt=n==null?void 0:n.metadata)==null?void 0:Qt.form_schema)??null,B=(n==null?void 0:n.form_schema)??(_==null?void 0:_.resolver_schema)??null,W=Q??B,z=h.useRef(!1),T=h.useRef(null);h.useEffect(()=>{if(z.current)return;const k=Q??(B!=null&&B.properties?B:null);if(k!=null&&k.properties){z.current=!0;const J=ht(n==null?void 0:n.envelope),xt=J==null?void 0:J.formDefaults,Et={...(n==null?void 0:n.metadata)??{},...typeof xt=="object"&&xt!==null?xt:{}},At=ve(Et,k),te={_form_schema:k};for(const[se,Be]of Object.entries(k.properties)){const ne=Be,Ge=ne.type==="object"?{}:"";te[se]=At[se]??ne.default??Ge}T.current=JSON.stringify(te,null,2);const ee=!((n==null?void 0:n.status)==="resolved"||(n==null?void 0:n.status)==="cancelled")&&(n!=null&&n.id)?Wn(n.id):null,Nt=ee?ht(ee):null;Nt&&typeof Nt=="object"&&!Array.isArray(Nt)?M(JSON.stringify({...Nt,_form_schema:k},null,2)):M(T.current)}else W&&(z.current=!0,M(JSON.stringify(W,null,2)))},[W,Q,B,n==null?void 0:n.envelope,n==null?void 0:n.metadata,n==null?void 0:n.id,n==null?void 0:n.status]),h.useEffect(()=>{if(!z.current||T.current===null||!(n!=null&&n.id)||n.status!=="pending")return;const k=n.id,J=window.setTimeout(()=>{E===T.current?Lt(k):Fn(k,E)},400);return()=>window.clearTimeout(J)},[E,n==null?void 0:n.id,n==null?void 0:n.status]);const Z=(n==null?void 0:n.subtype)==="rounds_exhausted";if(i)return t.jsxs("div",{className:"animate-pulse space-y-8",children:[t.jsx("div",{className:"h-8 bg-surface-sunken rounded w-64"}),t.jsx("div",{className:"h-32 bg-surface-sunken rounded w-full"})]});if(!n)return t.jsx("p",{className:"text-sm text-text-secondary",children:"Escalation not found."});const jt=we(n),K=jt&&n.assigned_to===(s==null?void 0:s.userId),nt=jt&&!K,ct=n.status==="resolved"||n.status==="cancelled",rt=W==null?void 0:W["x-lt-viewport"],wt=(rt==null?void 0:rt.type)==="iframe"&&!!(rt!=null&&rt.src)&&K&&!ct,bt=ht(n.escalation_payload),dt=ht(n.resolver_payload),yt=ht(n.envelope),Se=!!((Zt=yt==null?void 0:yt.metadata)!=null&&Zt.certified),Yt=is(),Bt=Yt!==null?Yt:!!((Kt=f==null?void 0:f.ai)!=null&&Kt.enabled),tt=typeof bt=="object"&&bt!==null&&!Array.isArray(bt)?bt:null,qe=tt==null?void 0:tt._triage,Ve=typeof dt=="object"&&dt!==null&&!Array.isArray(dt)?dt:null,Je=ct?"terminal":K?"claimed_by_me":nt?"claimed_by_other":"available",kt=k=>{c.mutate({id:n.id,durationMinutes:k})},pt=()=>{r.resetQueries({queryKey:["escalations"]}),r.resetQueries({queryKey:["escalationStats"]}),a(-1)},Ct=async k=>{try{await x.mutateAsync({id:n.id,resolverPayload:k})}catch(J){if(J instanceof os&&Ms(J.body)){V(!0),b(J.body.violations),v(H.ERRORS);return}throw J}Lt(n.id),pt()},_t=async k=>{k&&(await o.mutateAsync({id:n.id,targetRole:k}),pt())},He=async()=>{K||await c.mutateAsync({id:n.id,durationMinutes:30});const k=(tt==null?void 0:tt.diagnosis)||n.description||"";await x.mutateAsync({id:n.id,resolverPayload:{_lt:{needsTriage:!0},notes:k}}),pt()},Gt=async()=>{await c.mutateAsync({id:n.id,durationMinutes:0}),pt()},Ue=async()=>{await u.mutateAsync(n.id),Lt(n.id),g(!1),pt()},ze=typeof(W==null?void 0:W["x-lt-help"])=="string"||typeof(W==null?void 0:W["x-lt-context"])=="string",Ye=t.jsxs("div",{className:"flex items-center gap-2",children:[ze&&t.jsx("button",{onClick:()=>{$(!0),ft(!0),v(H.HELP)},className:"text-text-tertiary hover:text-accent transition-colors",title:"Open instructions",children:t.jsx(Ut,{className:"w-5 h-5",strokeWidth:1.5})}),t.jsx(ms,{onRefresh:()=>d(),isFetching:l,apiPath:`/escalations/${n.id}`,standalone:!0}),t.jsx("button",{onClick:()=>$(k=>(ft(!k),!k)),className:"ml-2 text-text-tertiary hover:text-accent transition-colors",title:A?"Hide side panel":"Show side panel",children:A?t.jsx(ie,{className:"w-5 h-5",strokeWidth:1.5}):t.jsx(oe,{className:"w-5 h-5",strokeWidth:1.5})})]});return t.jsxs("div",{className:"flex-1 min-h-0 min-w-0 flex items-stretch -mt-8 -mr-page-x -mb-16",children:[t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col min-h-0",children:[wt?t.jsxs("div",{className:"relative flex-1 min-h-0 -ml-page-x",children:[t.jsx("div",{className:"absolute top-3 right-3 z-50 flex items-center gap-0.5 bg-surface/90 backdrop-blur-sm rounded-lg px-1.5 py-1 shadow-sm border border-surface-border/40",children:[{onClick:Gt,disabled:c.isPending,label:"Release",hoverClass:"hover:text-accent",icon:t.jsx($s,{className:"w-4 h-4",strokeWidth:1.5})},{onClick:()=>g(!0),disabled:!1,label:"Cancel",hoverClass:"hover:text-status-error",icon:t.jsx(Rs,{className:"w-4 h-4",strokeWidth:1.5})},{onClick:()=>$(k=>(ft(!k),!k)),disabled:!1,label:A?"Hide panel":"Show panel",hoverClass:"hover:text-accent",icon:A?t.jsx(ie,{className:"w-4 h-4",strokeWidth:1.5}):t.jsx(oe,{className:"w-4 h-4",strokeWidth:1.5})}].map(({onClick:k,disabled:J,label:xt,hoverClass:Et,icon:At})=>t.jsxs("div",{className:"relative group/tip",children:[t.jsx("button",{onClick:k,disabled:J,className:`text-text-tertiary ${Et} transition-colors disabled:opacity-40 disabled:cursor-default p-1.5 rounded-md`,children:At}),t.jsx("span",{className:"pointer-events-none absolute top-full left-1/2 -translate-x-1/2 mt-1.5 px-2 py-0.5 rounded text-2xs bg-surface-sunken text-text-primary whitespace-nowrap opacity-0 group-hover/tip:opacity-100 transition-opacity",children:xt})]},xt))}),t.jsx(De,{src:We(rt.src,n),escalation:n,schema:W,onResolve:Ct,onEscalate:_t,submitAttempted:P,fill:!0})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"shrink-0 pt-8 pr-page-x",children:t.jsx(ps,{title:n.description||"Escalation",actions:Ye})}),t.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pr-page-x",children:[t.jsx(On,{isRoundsExhausted:Z,payloadObj:tt,isTerminal:ct,resolverPayload:dt,onRetryTriage:He,isRetrying:c.isPending||x.isPending}),t.jsx(In,{esc:n,resolverPayload:dt,isTerminal:ct,claimedByMe:K,activeView:w,metadataFormSchema:Q,effectiveSchema:W,json:E,onJsonChange:M,requestTriage:C,onRequestTriageChange:O,triageNotes:q,onTriageNotesChange:F,onResolve:Ct,onEscalate:_t,onClaim:()=>kt(30),submitAttempted:P,isCertified:Se,hasAI:Bt,onOpenHelp:()=>{$(!0),ft(!0),v(H.HELP)}}),t.jsx("div",{className:"h-10"})]})]}),!wt&&t.jsx(tn,{escalationContext:St(n),mode:Je,activeView:w,onActiveViewChange:I,onClaim:kt,claimPending:c.isPending,workflowType:n.workflow_type,json:E,onResolve:Ct,resolvePending:x.isPending,resolveError:x.error,requestTriage:C,triageNotes:q,currentRole:n.role,escalationTargets:((N==null?void 0:N.targets)??[]).filter(k=>k!==n.role),onEscalate:_t,escalatePending:o.isPending,escalateError:o.error,onRelease:Gt,releasePending:c.isPending,onCancel:()=>g(!0),assignedTo:n.assigned_to,assignedUntil:n.assigned_until,onSubmitAttempt:()=>V(!0),onValidationErrors:k=>{b(k),$(!0),ft(!0),v(H.ERRORS)}})]}),t.jsx(zs,{esc:n,schema:W,envelope:yt,payload:tt,resolver:Ve,triage:qe??null,hasAI:Bt,claimed:jt,claimedByMe:K,isTerminal:ct,isBuilder:y,traceUrl:p,open:A,noGutter:wt,formErrors:X,activePanel:R,onPanelChange:v}),t.jsx(us,{open:m,onClose:()=>g(!1),onConfirm:Ue,isPending:u.isPending,error:u.error}),K&&!ct&&n.assigned_until&&t.jsx(Dn,{open:D.expiringSoon&&n.assigned_until!==L,assignedUntil:n.assigned_until,onClose:()=>U(n.assigned_until??null),onExtend:kt,isPending:c.isPending})]})}export{ir as EscalationDetailPage};
|
|
5
|
-
//# sourceMappingURL=index-Dh5Y3hq7.js.map
|