@hotmeshio/long-tail 0.9.2 → 0.9.3
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/dashboard/dist/assets/{AdminDashboard-JobmypiO.js → AdminDashboard-BONGlQva.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-JobmypiO.js.map → AdminDashboard-BONGlQva.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-D_HuaRN9.js → AgentConfigPage-C_NJ4-pr.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-D_HuaRN9.js.map → AgentConfigPage-C_NJ4-pr.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-Cj22NZLI.js → AgentDetailPage-MSCS6bFD.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-Cj22NZLI.js.map → AgentDetailPage-MSCS6bFD.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-DTKto-gL.js → AgentsPage-PfSvedS-.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-DTKto-gL.js.map → AgentsPage-PfSvedS-.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-CUvrKkgS.js → AvailableEscalationsPage-DBeBLNWW.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-CUvrKkgS.js.map → AvailableEscalationsPage-DBeBLNWW.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-AwKouk26.js → BotPicker-DmCdoim8.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-AwKouk26.js.map → BotPicker-DmCdoim8.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-1ZMO_0UU.js → CapabilitiesPage-DVf4zIMZ.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-1ZMO_0UU.js.map → CapabilitiesPage-DVf4zIMZ.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-D6kUTrq4.js → CollapsibleSection-7ACdYUZy.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-D6kUTrq4.js.map → CollapsibleSection-7ACdYUZy.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-Bj9YbInO.js → CountdownTimer-Gbp6RHav.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-Bj9YbInO.js.map → CountdownTimer-Gbp6RHav.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-D5H_kyRL.js → CredentialsPage-JWCUgQMi.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-D5H_kyRL.js.map → CredentialsPage-JWCUgQMi.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-DvmJ0EFz.js → CronLabel-9GtrGEDe.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-DvmJ0EFz.js.map → CronLabel-9GtrGEDe.js.map} +1 -1
- package/dashboard/dist/assets/{CustomDurationPicker-DT_g8Hr4.js → CustomDurationPicker-xNJMIvjL.js} +2 -2
- package/dashboard/dist/assets/{CustomDurationPicker-DT_g8Hr4.js.map → CustomDurationPicker-xNJMIvjL.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-7_8YpC3D.js → ElapsedCell-rRiChKDm.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-7_8YpC3D.js.map → ElapsedCell-rRiChKDm.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-ClFRLeKV.js → EscalationListSchemaPage-B7PHz5CB.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-ClFRLeKV.js.map → EscalationListSchemaPage-B7PHz5CB.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-BcYcj-b8.js → EscalationSchemaPage-_CbayTDk.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-BcYcj-b8.js.map → EscalationSchemaPage-_CbayTDk.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-uHb8ni_5.js → EscalationsOverview-C5bVdGf2.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-uHb8ni_5.js.map → EscalationsOverview-C5bVdGf2.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-CkdWqmEL.js → EventTable-DGaRYVnB.js} +2 -2
- package/dashboard/dist/assets/{EventTable-CkdWqmEL.js.map → EventTable-DGaRYVnB.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-C6sfPjSc.js → GraphInvokePage-R6_p2Sy7.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-C6sfPjSc.js.map → GraphInvokePage-R6_p2Sy7.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-CUHZxihq.js → HomePage-DHxtqRkD.js} +2 -2
- package/dashboard/dist/assets/{HomePage-CUHZxihq.js.map → HomePage-DHxtqRkD.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-nWxpujpH.js → ListToolbar-BhXp7clK.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-nWxpujpH.js.map → ListToolbar-BhXp7clK.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-DXrkDkU-.js → McpOverview-COgIIWkK.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-DXrkDkU-.js.map → McpOverview-COgIIWkK.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-CnLYE26v.js → McpQueryDetailPage-4LEqQZax.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-CnLYE26v.js.map → McpQueryDetailPage-4LEqQZax.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-oE9eWAus.js → McpQueryPage-DWAcSqF-.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-oE9eWAus.js.map → McpQueryPage-DWAcSqF-.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-B7e6AVl1.js → McpRunDetailPage-BNjhOPLp.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-B7e6AVl1.js.map → McpRunDetailPage-BNjhOPLp.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-Bx5DiGk7.js → McpRunsPage-DAjYKqqt.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-Bx5DiGk7.js.map → McpRunsPage-DAjYKqqt.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-BmG3qzdR.js → OperationsPage-5RkfIbtT.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-BmG3qzdR.js.map → OperationsPage-5RkfIbtT.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-r6hQ57eO.js → OperatorDashboard-B-2dIbj4.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-r6hQ57eO.js.map → OperatorDashboard-B-2dIbj4.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-C3gE4OHq.js → ProcessDetailPage-Bx7sF-vV.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-C3gE4OHq.js.map → ProcessDetailPage-Bx7sF-vV.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-DSsIGmBB.js → ProcessesListPage-Dsfc-DX_.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-DSsIGmBB.js.map → ProcessesListPage-Dsfc-DX_.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-DiFISbnq.js → RoleDetailPage-DF-ov9E9.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-DiFISbnq.js.map → RoleDetailPage-DF-ov9E9.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-CE5fui18.js → RolesPage-DIlde9bw.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-CE5fui18.js.map → RolesPage-DIlde9bw.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-Ct8NNadu.js → RunAsSelector-DOYUYXcD.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-Ct8NNadu.js.map → RunAsSelector-DOYUYXcD.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-BfgBtP_B.js → StickyPagination-BwXLmDc-.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-BfgBtP_B.js.map → StickyPagination-BwXLmDc-.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-2rwp7Ynx.js → StreamMessageDetail-CCez20kE.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-2rwp7Ynx.js.map → StreamMessageDetail-CCez20kE.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-BwWyYBCo.js → SwimlaneTimeline-hcWBunXb.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-BwWyYBCo.js.map → SwimlaneTimeline-hcWBunXb.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-BUKHu2oD.js → TaskDetailPage-CIarmoAk.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-BUKHu2oD.js.map → TaskDetailPage-CIarmoAk.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-C_PwExQC.js → TasksListPage-CFqMwhLE.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-C_PwExQC.js.map → TasksListPage-CFqMwhLE.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-Bagm-L2o.js → TimeAgo-CuI-66Kw.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-Bagm-L2o.js.map → TimeAgo-CuI-66Kw.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-BwDo7knq.js → TimestampCell-BI3Uptj8.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-BwDo7knq.js.map → TimestampCell-BI3Uptj8.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-CVZ2M1yv.js → ToolTestPanel-QwGyWRfG.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-CVZ2M1yv.js.map → ToolTestPanel-QwGyWRfG.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-DKAvbkxD.js → TopicDetailPage-CGCiqQGf.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-DKAvbkxD.js.map → TopicDetailPage-CGCiqQGf.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-BZknsApe.js → TopicsPage-Bk8-inSO.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-BZknsApe.js.map → TopicsPage-Bk8-inSO.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-ByDxLHPZ.js → UserName-BOaihCFP.js} +2 -2
- package/dashboard/dist/assets/{UserName-ByDxLHPZ.js.map → UserName-BOaihCFP.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-DrwKB2x8.js → WorkflowExecutionPage-CE0QzhIt.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-DrwKB2x8.js.map → WorkflowExecutionPage-CE0QzhIt.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-DEq9fkhl.js → WorkflowsDashboard-wgWRZOnB.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DEq9fkhl.js.map → WorkflowsDashboard-wgWRZOnB.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-l-0KYP7Y.js → WorkflowsOverview-CLyitES7.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-l-0KYP7Y.js.map → WorkflowsOverview-CLyitES7.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-BgimL3VT.js → YamlWorkflowDetailPage-pP2i1ptj.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-BgimL3VT.js.map → YamlWorkflowDetailPage-pP2i1ptj.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-CabXXA9r.js → YamlWorkflowsPage-BwQSMfYw.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-CabXXA9r.js.map → YamlWorkflowsPage-BwQSMfYw.js.map} +1 -1
- package/dashboard/dist/assets/{agents-D_L6lV0f.js → agents-CRtBacrZ.js} +2 -2
- package/dashboard/dist/assets/{agents-D_L6lV0f.js.map → agents-CRtBacrZ.js.map} +1 -1
- package/dashboard/dist/assets/{bots-wdZz1nJw.js → bots-FjzeqLzA.js} +2 -2
- package/dashboard/dist/assets/{bots-wdZz1nJw.js.map → bots-FjzeqLzA.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-C35_V8eu.js → capabilities-CB0y1ZCx.js} +2 -2
- package/dashboard/dist/assets/{capabilities-C35_V8eu.js.map → capabilities-CB0y1ZCx.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-kR2P6zYv.js → controlplane-ZJtfQopv.js} +2 -2
- package/dashboard/dist/assets/{controlplane-kR2P6zYv.js.map → controlplane-ZJtfQopv.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-BVj16HuR.js → escalation-columns-735GLlEN.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-BVj16HuR.js.map → escalation-columns-735GLlEN.js.map} +1 -1
- package/dashboard/dist/assets/{index-CJFA7aLp.js → index-AUrwksY_.js} +2 -2
- package/dashboard/dist/assets/{index-CJFA7aLp.js.map → index-AUrwksY_.js.map} +1 -1
- package/dashboard/dist/assets/{index-C75E0-Wd.js → index-BH0BQHF-.js} +2 -2
- package/dashboard/dist/assets/{index-C75E0-Wd.js.map → index-BH0BQHF-.js.map} +1 -1
- package/dashboard/dist/assets/{index-DIrYjyRG.js → index-BTrN5iqE.js} +3 -3
- package/dashboard/dist/assets/{index-DIrYjyRG.js.map → index-BTrN5iqE.js.map} +1 -1
- package/dashboard/dist/assets/{index-wZzl3bcK.js → index-B_pZXTTp.js} +2 -2
- package/dashboard/dist/assets/{index-wZzl3bcK.js.map → index-B_pZXTTp.js.map} +1 -1
- package/dashboard/dist/assets/{index-BMQopgAx.js → index-Bho1kYrO.js} +2 -2
- package/dashboard/dist/assets/{index-BMQopgAx.js.map → index-Bho1kYrO.js.map} +1 -1
- package/dashboard/dist/assets/{index-1WCiN-pF.js → index-CzYOxahh.js} +2 -2
- package/dashboard/dist/assets/{index-1WCiN-pF.js.map → index-CzYOxahh.js.map} +1 -1
- package/dashboard/dist/assets/{index-B4zWCfQr.js → index-D4z4fzW5.js} +2 -2
- package/dashboard/dist/assets/{index-B4zWCfQr.js.map → index-D4z4fzW5.js.map} +1 -1
- package/dashboard/dist/assets/{index-BZfX_ziz.js → index-DiCp9bmR.js} +2 -2
- package/dashboard/dist/assets/{index-BZfX_ziz.js.map → index-DiCp9bmR.js.map} +1 -1
- package/dashboard/dist/assets/{index-BmbO85oT.js → index-DlrsXckY.js} +2 -2
- package/dashboard/dist/assets/{index-BmbO85oT.js.map → index-DlrsXckY.js.map} +1 -1
- package/dashboard/dist/assets/{index-so192yXP.js → index-DpGeD89g.js} +3 -3
- package/dashboard/dist/assets/{index-so192yXP.js.map → index-DpGeD89g.js.map} +1 -1
- package/dashboard/dist/assets/{index-xBNf5aFb.js → index-DzIB5CaR.js} +2 -2
- package/dashboard/dist/assets/{index-xBNf5aFb.js.map → index-DzIB5CaR.js.map} +1 -1
- package/dashboard/dist/assets/{index-BfDn7j4K.js → index-GRckVBX1.js} +2 -2
- package/dashboard/dist/assets/{index-BfDn7j4K.js.map → index-GRckVBX1.js.map} +1 -1
- package/dashboard/dist/assets/{index-QOTnrFd1.js → index-iEn58vjL.js} +2 -2
- package/dashboard/dist/assets/{index-QOTnrFd1.js.map → index-iEn58vjL.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-DDt599ea.js → knowledge-Bw51BCX9.js} +2 -2
- package/dashboard/dist/assets/{knowledge-DDt599ea.js.map → knowledge-Bw51BCX9.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-BPXRXEje.js → mcp-D4KRVy2a.js} +2 -2
- package/dashboard/dist/assets/{mcp-BPXRXEje.js.map → mcp-D4KRVy2a.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-HUZuboi-.js → mcp-query-0Zo3GwTv.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-HUZuboi-.js.map → mcp-query-0Zo3GwTv.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-CH8q3ok_.js → pipelines-B8sOpeCD.js} +2 -2
- package/dashboard/dist/assets/{pipelines-CH8q3ok_.js.map → pipelines-B8sOpeCD.js.map} +1 -1
- package/dashboard/dist/assets/{roles-B7rzw8wD.js → roles-Bs6hUrQJ.js} +2 -2
- package/dashboard/dist/assets/{roles-B7rzw8wD.js.map → roles-Bs6hUrQJ.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-j-mVt2EA.js → tasks-KDV3bflF.js} +2 -2
- package/dashboard/dist/assets/{tasks-j-mVt2EA.js.map → tasks-KDV3bflF.js.map} +1 -1
- package/dashboard/dist/assets/{topics-DATyaYWW.js → topics-BS_n738l.js} +2 -2
- package/dashboard/dist/assets/{topics-DATyaYWW.js.map → topics-BS_n738l.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-CwIAhqJk.js → useEventHooks-RbAigCWV.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-CwIAhqJk.js.map → useEventHooks-RbAigCWV.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-hV7rcAfa.js → useNamespace-ChDZWKAd.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-hV7rcAfa.js.map → useNamespace-ChDZWKAd.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-Dwuuu3F0.js → useYamlActivityEvents-6xNaRNAc.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-Dwuuu3F0.js.map → useYamlActivityEvents-6xNaRNAc.js.map} +1 -1
- package/dashboard/dist/assets/{users-DS9yeHe4.js → users-BPt2YERY.js} +2 -2
- package/dashboard/dist/assets/{users-DS9yeHe4.js.map → users-BPt2YERY.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-FF8WUHaC.js → workflows-BaSjfNsd.js} +2 -2
- package/dashboard/dist/assets/{workflows-FF8WUHaC.js.map → workflows-BaSjfNsd.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-y-eo6Rwj.js → yaml-workflows-Be3rM5i2.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-y-eo6Rwj.js.map → yaml-workflows-Be3rM5i2.js.map} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as e,a as h,b as at}from"./vendor-query-B2UbickB.js";import{A as he,M as ye,J as re,b as fe,l as nt,B as rt,g as lt,h as it,E as ot,G as ct,u as dt,n as xt,k as ut}from"./index-
|
|
1
|
+
import{j as e,a as h,b as at}from"./vendor-query-B2UbickB.js";import{A as he,M as ye,J as re,b as fe,l as nt,B as rt,g as lt,h as it,E as ot,G as ct,u as dt,n as xt,k as ut}from"./index-DpGeD89g.js";import{b as mt,d as pt,u as ht,C as ft,m as gt,c as Le,a as jt}from"./CustomDurationPicker-xNJMIvjL.js";import{b as bt}from"./roles-Bs6hUrQJ.js";import{P as yt}from"./PageHeader-Ji1AtA4f.js";import{L as wt}from"./ListToolbar-BhXp7clK.js";import{i as We,C as Fe}from"./CountdownTimer-Gbp6RHav.js";import{u as Nt}from"./workflows-BaSjfNsd.js";import{g as vt}from"./useEventHooks-RbAigCWV.js";import{S as kt,a as Ct,P as B}from"./SlidePanel-BzeKveus.js";import{S as _t}from"./StatusBadge-CEQMRmSQ.js";import{R as Et}from"./RolePill-ColM_ynA.js";import{C as G}from"./CopyableId-uot2mE_g.js";import{U as Ve}from"./UserName-BOaihCFP.js";import{A as Tt,ah as Rt,ai as St,aj as At,w as $t,g as Pt,U as Mt,a5 as It,a6 as Dt,ak as Se,al as Ot,am as Ae,an as $e,ao as Lt,X as Wt}from"./vendor-icons-BX2Vih4L.js";import{c as Je,L as ce,e as Ft}from"./vendor-react-CXumBFUA.js";import"./Modal-CSrxpXeM.js";import"./constants-BHkpVaqx.js";import"./users-BPt2YERY.js";const ie={pending:"#0ea5e9",claimed:"#f97316",resolved:"#16a34a",cancelled:"#ef4444"},ge=5;function Pe({pct:t,place:n,label:i,title:a,emphasis:s}){const l=e.jsx("span",{className:"w-px h-1.5 bg-slate-300","aria-hidden":!0}),u=e.jsx("span",{className:`whitespace-nowrap leading-none tabular-nums ${s?"text-text-secondary":"text-text-tertiary"}`,children:i});return e.jsx("div",{title:a,className:`absolute ${n==="above"?"bottom-0":"top-0"} flex flex-col items-center gap-0 -translate-x-1/2 cursor-help`,style:{left:`${t}%`},children:n==="above"?e.jsxs(e.Fragment,{children:[u,l]}):e.jsxs(e.Fragment,{children:[l,u]})})}function Vt({esc:t,className:n=""}){const i=new Date(t.created_at).getTime(),a=t.claimed_at?new Date(t.claimed_at).getTime():null,s=t.status==="resolved",l=t.status==="cancelled"||t.status==="expired",u=s||l,d=We(t),r=!!a&&(d||u),o=s&&t.resolved_at?new Date(t.resolved_at).getTime():l?new Date(t.updated_at).getTime():Date.now(),c=Math.max(o-i,1),j=r&&a?Math.max(a-i,0):c,p=r&&a?Math.max(o-a,0):0,f=Math.min(100,Math.max(0,j/c*100)),x=r?Math.max(0,100-f):0,m=s?ie.resolved:l?ie.cancelled:ie.claimed,g=s?"Resolved after":l?"Cancelled after":"In progress",k=he(j),b=he(c),A=s?`Resolved in ${b} total`:l?`Cancelled after ${b}`:`Open ${b} so far`,E=`Lifecycle bar: blue = time waiting to be claimed, ${s?"green":l?"red":"orange"} = ${g.toLowerCase()} the claim.`;return e.jsxs("div",{className:n,title:E,children:[e.jsx("div",{className:"relative h-3 text-[9px] font-mono",children:r&&e.jsx(Pe,{pct:f,place:"above",label:k,title:`Time to claim: ${k}`})}),e.jsxs("div",{className:"flex w-full rounded-full overflow-hidden",style:{height:ge,backgroundColor:"#e2e8f0"},title:E,children:[e.jsx("div",{style:{width:`${f}%`,minWidth:ge,backgroundColor:ie.pending,opacity:.75},title:`Waiting ${k} — created → claimed`}),r&&x>0&&e.jsx("div",{style:{width:`${x}%`,minWidth:ge,backgroundColor:m,opacity:.75},title:`${g} ${he(p)}`})]}),e.jsx("div",{className:"relative h-3 text-[9px] font-mono",children:e.jsx(Pe,{pct:100,place:"below",emphasis:!0,label:b,title:A})})]})}function Jt({triage:t,payload:n}){const i=t.confidence??0,a=i>=.8?"text-status-success":i>=.5?"text-status-pending":"text-status-error",s=Ut(t.originalData,n);return e.jsxs("div",{className:"space-y-5",children:[t.diagnosis&&e.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:t.diagnosis}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-tertiary",children:[t.tool_calls_made!=null&&e.jsxs("span",{children:[t.tool_calls_made," tool call",t.tool_calls_made!==1?"s":""]}),t.tool_calls_made!=null&&e.jsx("span",{className:"text-text-quaternary",children:"·"}),e.jsxs("span",{className:`font-medium ${a}`,children:[Math.round(i*100),"% confidence"]})]}),t.actions_taken&&t.actions_taken.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.actions_taken.map((l,u)=>e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px]
|
|
2
2
|
text-text-secondary`,children:[e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),l]},u))}),t.recommendation&&e.jsx("p",{className:"text-[11px] text-text-tertiary italic",children:t.recommendation}),s.length>0&&e.jsx("div",{className:"space-y-4 pt-2",children:s.map(l=>e.jsx(Ht,{diff:l},l.key))})]})}function Ut(t,n){if(!t)return[];const i=[];for(const a of Object.keys(t)){if(a.startsWith("_"))continue;const s=t[a],l=n[a];l!==void 0&&JSON.stringify(s)!==JSON.stringify(l)&&i.push({key:a,label:a.replace(/[_-]/g," "),original:s,corrected:l})}return i}function Ht({diff:t}){const n=Me(t.original),i=Me(t.corrected);return n!==null&&i!==null?e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal",children:"(original)"})]}),e.jsx("p",{className:"text-sm text-text-tertiary leading-relaxed line-through decoration-text-tertiary/30",children:n})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal text-status-success",children:"(corrected)"})]}),e.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:i})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal",children:"(original)"})]}),e.jsx("pre",{className:"text-xs text-text-tertiary font-mono whitespace-pre-wrap leading-relaxed",children:typeof t.original=="object"?JSON.stringify(t.original,null,2):String(t.original)})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal text-status-success",children:"(corrected)"})]}),e.jsx("pre",{className:"text-xs text-text-primary font-mono whitespace-pre-wrap leading-relaxed",children:typeof t.corrected=="object"?JSON.stringify(t.corrected,null,2):String(t.corrected)})]})]})}function Me(t){return t==null?"null":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):null}const Y={HELP:"help",DETAILS:"details",TRIAGE:"triage",METADATA:"metadata",CONTEXT:"context",RECORD:"record"},Ue="lt:escalation:panel:view";function qt(t){try{const n=localStorage.getItem(Ue);if(n&&t.includes(n))return n}catch{}return Y.HELP}const zt=new Set(["form_schema"]);function Bt({metadata:t,role:n}){const i=Object.entries(t??{}).filter(([a])=>!a.startsWith("_")&&!zt.has(a));return i.length===0?e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No metadata on this escalation."}):e.jsx("dl",{className:"space-y-3.5",children:i.map(([a,s])=>{const l=typeof s=="object"&&s!==null?JSON.stringify(s):String(s),u=encodeURIComponent(JSON.stringify({[a]:l})),d=`/escalations/available?role=${encodeURIComponent(n)}&facets=${u}&status=all`,r=`/escalations/available?facets=${u}&status=all`;return e.jsxs("div",{className:"group relative",children:[e.jsx("dt",{className:"text-[11px] font-medium text-text-secondary uppercase tracking-wide",children:a.replace(/[_-]/g," ")}),e.jsxs("dd",{className:"mt-0.5 flex items-center gap-1",children:[e.jsx("span",{className:"text-[12px] text-text-primary font-mono break-all flex-1",children:l}),e.jsx(ce,{to:d,title:`Filter this queue: ${a} = ${l}`,className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 p-0.5 text-text-quaternary hover:text-accent",children:e.jsx(It,{className:"w-3 h-3"})}),e.jsx(ce,{to:r,title:`Search all queues: ${a} = ${l}`,className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 p-0.5 text-text-quaternary hover:text-accent",children:e.jsx(Dt,{className:"w-3 h-3"})})]})]},a)})})}function Kt({esc:t,claimed:n,isTerminal:i,isBuilder:a,traceUrl:s}){return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("dl",{className:"space-y-3.5",children:[e.jsx(B,{label:"Status",children:e.jsx(_t,{status:t.status})}),e.jsx(B,{label:"Assigned to Role",children:e.jsx(Et,{role:t.role,size:"md"})}),e.jsxs(B,{label:"Priority",children:["P",t.priority]}),(n||i)&&t.assigned_to&&e.jsx(B,{label:"Claimed By",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 font-medium text-text-primary",children:[e.jsx(Mt,{className:"w-3 h-3 shrink-0 text-accent/75"}),e.jsx(Ve,{userId:t.assigned_to})]})}),e.jsx(B,{label:"Created",children:e.jsx(fe,{date:t.created_at})}),(n||i)&&t.claimed_at&&e.jsx(B,{label:"Claimed",children:e.jsx(fe,{date:t.claimed_at})}),n&&!i&&t.assigned_until&&e.jsx(B,{label:"Time Remaining",children:e.jsx(Fe,{until:t.assigned_until})}),t.resolved_at&&e.jsx(B,{label:"Completed",children:e.jsx("span",{className:"text-status-success",children:e.jsx(fe,{date:t.resolved_at})})})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"border-surface-border/60"}),e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(G,{label:"Escalation ID",value:t.id}),t.task_id&&e.jsx(G,{label:"Task ID",value:t.task_id,href:`/workflows/tasks/detail/${t.task_id}`}),t.workflow_type&&e.jsx(G,{label:"Workflow Name",value:t.workflow_type,href:`/workflows/executions?entity=${encodeURIComponent(t.workflow_type)}`}),t.workflow_id&&e.jsx(G,{label:"Workflow ID",value:t.workflow_id,href:`/workflows/executions/${t.workflow_id}`}),t.task_queue&&e.jsx(G,{label:"Task Queue",value:t.task_queue,href:`/admin/controlplane?queue=${encodeURIComponent(t.task_queue)}`}),t.origin_id&&t.origin_id!==t.workflow_id&&e.jsx(G,{label:"Origin",value:t.origin_id,href:`/processes/detail/${t.origin_id}`}),t.trace_id&&e.jsx(G,{label:"Trace",value:t.trace_id,href:s?s.replace("{traceId}",t.trace_id):void 0,external:!0})]})]})]})}function Yt({esc:t,schema:n,envelope:i,payload:a,resolver:s,triage:l,hasAI:u,claimed:d,claimedByMe:r,isTerminal:o,isBuilder:c,traceUrl:j,open:p,noGutter:f}){const x=Je(),m=Object.values(Y),[g,k]=h.useState(()=>qt(m)),b=h.useCallback(T=>{try{localStorage.setItem(Ue,T)}catch{}k(T)},[]),A=h.useMemo(()=>mt(n,{escalation:t,metadata:t.metadata??null,envelope:i,payload:a,resolver:s})??pt({isTerminal:o,status:t.status,claimed:d,claimedByMe:r}),[n,t,i,a,s,o,d,r]),E=h.useCallback(T=>{const R=T.target.closest("a"),_=R==null?void 0:R.getAttribute("href");_!=null&&_.startsWith("/")&&(T.preventDefault(),x(_))},[x]),M=[{id:Y.HELP,icon:Tt,label:"Instructions",content:e.jsx(ye,{content:A,onClick:E})},{id:Y.DETAILS,icon:Rt,label:"Details",content:e.jsx(Kt,{esc:t,claimed:d,isTerminal:o,isBuilder:c,traceUrl:j})},...u&&l?[{id:Y.TRIAGE,icon:St,label:"AI Analysis",content:e.jsx(Jt,{triage:l,payload:a??{}})}]:[],{id:Y.METADATA,icon:At,label:"Metadata",content:e.jsx(Bt,{metadata:t.metadata,role:t.role})},{id:Y.CONTEXT,icon:$t,label:"Context",content:e.jsxs("div",{className:"space-y-5",children:[i!=null&&e.jsx(re,{data:i,label:"Input Envelope"}),a!=null&&e.jsx(re,{data:a,label:"Escalation Context"}),s!=null&&e.jsx(re,{data:s,label:"Resolver Payload"}),i==null&&a==null&&s==null&&e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No context on this escalation."})]})},...c?[{id:Y.RECORD,icon:Pt,label:"Record",content:e.jsx(re,{data:t,label:"Escalation Record"})}]:[]];return e.jsx(kt,{open:p,width:384,className:"h-full",children:e.jsx("div",{className:`h-full${f?"":" pl-6"}`,children:e.jsxs("div",{className:"h-full flex flex-col bg-surface-hover",children:[e.jsx("div",{className:"shrink-0 pt-1.5 pb-0.5 flex justify-center",children:e.jsx(Vt,{esc:t,className:"w-[80%]"})}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Ct,{views:M,activeId:g,onViewChange:b,stickyClassName:"h-full min-h-0"})})]})})})}function Gt(t){const{mode:n,activeView:i,onActiveViewChange:a,onClaim:s,claimPending:l,workflowType:u,json:d,onResolve:r,resolvePending:o,resolveError:c,requestTriage:j,triageNotes:p,currentRole:f,escalationTargets:x,onEscalate:m,escalatePending:g,escalateError:k,onRelease:b,releasePending:A,onCancel:E,assignedTo:M,assignedUntil:T,onSubmitAttempt:R}=t,_=ht(),[y,v]=h.useState("30"),[C,P]=h.useState(0),[V,J]=h.useState(""),[U,I]=h.useState(""),$=y==="custom",S=h.useCallback(w=>P(w),[]);if(n==="terminal")return null;const te=()=>{const w=$?C:parseInt(y);!w||w<=0||s(w)},de=()=>{if(J(""),j){const W={_lt:{needsTriage:!0}};p.trim()&&(W.notes=p.trim()),r(W);return}let w;try{w=JSON.parse(d)}catch{J("Invalid JSON");return}const X=w._form_schema,L=X==null?void 0:X.required;if(L!=null&&L.length){const W=L.filter(D=>{const O=w[D];return O==null||typeof O=="string"&&O.trim()===""});if(W.length>0){R==null||R();const D=W.map(xe=>xe.replace(/[_-]/g," ")),O=D.length<=2?D.join(", "):`${D.slice(0,2).join(", ")}...`;J(`Required: ${O}`);return}}const{_form_schema:q,...se}=w;r(gt(se,X))},H=w=>`text-xs transition-colors ${w?"text-accent font-medium":"text-text-tertiary hover:text-accent"}`;return e.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:[n==="available"&&e.jsxs("div",{"data-testid":"claim-bar",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[_.map(w=>e.jsx("button",{onClick:()=>{v(w.value),P(0)},className:H(!$&&y===w.value),children:w.label},w.value)),e.jsx("button",{onClick:()=>v("custom"),className:H($),children:"Other"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:E,className:"text-xs text-text-tertiary hover:text-status-error transition-colors",children:"Cancel escalation"}),e.jsx("div",{className:"flex-1"}),$&&e.jsx(ft,{onChange:S,compact:!0,autoFocus:!0}),e.jsx("button",{onClick:te,disabled:l||$&&C<=0,className:"btn-primary text-xs",children:l?"Claiming...":"Claim"})]})]}),n==="claimed_by_other"&&e.jsxs("div",{className:"flex items-center gap-4","data-testid":"claimed-other-bar",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Claimed by ",e.jsx("span",{className:"font-medium text-text-primary",children:M?e.jsx(Ve,{userId:M}):"unknown"})]}),T&&e.jsx(Fe,{until:T})]}),n==="claimed_by_me"&&e.jsxs("div",{"data-testid":"action-bar",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[e.jsx("button",{onClick:()=>a("resolve"),className:H(i==="resolve"),children:u?"Resolve":"Acknowledge"}),x.length>0&&e.jsx("button",{onClick:()=>a("escalate"),className:H(i==="escalate"),children:"Escalate"}),e.jsx("button",{onClick:()=>a("release"),className:`text-xs transition-colors ${i==="release"?"text-status-error font-medium":"text-text-tertiary hover:text-status-error"}`,children:"Release"}),e.jsx("button",{onClick:E,className:"text-xs transition-colors text-text-tertiary hover:text-status-error",children:"Cancel"})]}),i==="resolve"&&(u?e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1"}),V&&e.jsx("span",{className:"text-xs text-status-error",children:V}),c&&e.jsx("span",{className:"text-xs text-status-error",children:c.message}),e.jsx("button",{onClick:de,disabled:o,className:"btn-primary text-xs",children:o?"Submitting...":j?"Send to Triage":"Submit"})]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:"Notification — acknowledge to resolve"}),e.jsx("div",{className:"flex-1"}),c&&e.jsx("span",{className:"text-xs text-status-error mr-3",children:c.message}),e.jsx("button",{onClick:()=>r({acknowledged:!0}),disabled:o,className:"btn-primary text-xs",children:o?"Acknowledging...":"Acknowledge"})]})),i==="escalate"&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-text-secondary",children:["From ",e.jsx("span",{className:"font-medium text-text-primary",children:f})," to"]}),e.jsxs("select",{value:U,onChange:w=>I(w.target.value),className:"select text-xs","data-testid":"escalate-select",children:[e.jsx("option",{value:"",children:"Select role..."}),x.map(w=>e.jsx("option",{value:w,children:w},w))]}),e.jsx("div",{className:"flex-1"}),k&&e.jsx("span",{className:"text-xs text-status-error",children:k.message}),e.jsx("button",{onClick:()=>m(U),disabled:!U||g,className:"btn-primary text-xs",children:g?"Escalating...":"Escalate"})]}),i==="release"&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:"Release back to pool?"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>a("resolve"),className:"btn-secondary text-xs",children:"Back"}),e.jsx("button",{onClick:b,disabled:A,className:"btn-primary text-xs bg-status-error hover:bg-status-error/80",children:A?"Releasing...":"Yes, Release"})]})]})]})}function K(t){return t.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 je({content:t,compact:n}){const i=[],a=/^```(\w*)\n([\s\S]*?)^```$/gm;let s=0,l;for(;(l=a.exec(t))!==null;)l.index>s&&i.push({type:"text",text:t.slice(s,l.index)}),i.push({type:"code",lang:l[1],code:l[2].replace(/\n$/,"")}),s=l.index+l[0].length;s<t.length&&i.push({type:"text",text:t.slice(s)});const u=n?{text:"text-xs",heading:"text-xs",list:"text-xs",code:"text-[11px]"}:{text:"text-sm",heading:"text-sm",list:"text-sm",code:"text-xs"},d=[];for(const r of i){if(r.type==="code"){const o=r.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");d.push(`<pre class="my-2 p-2.5 bg-surface-sunken rounded-md overflow-x-auto"><code class="${u.code} font-mono text-text-secondary leading-relaxed">${o}</code></pre>`);continue}d.push(...Qt(r.text,u))}return e.jsx("div",{className:"prose-sm",dangerouslySetInnerHTML:{__html:d.join(`
|
|
3
3
|
`)}})}function Qt(t,n){const i=t.split(`
|
|
4
|
-
`),a=[];let s=!1,l=!1,u=[];for(const d of i){const r=d.trim();if(r.startsWith("|")&&r.endsWith("|")){const o=r.slice(1,-1).split("|").map(c=>c.trim());if(o.every(c=>/^[-:]+$/.test(c)))continue;l||(l=!0,u=[]),u.push(o);continue}if(l){l=!1;const[o,...c]=u;a.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const j of o)a.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${K(j)}</th>`);a.push("</tr></thead><tbody>");for(const j of c){a.push("<tr>");for(const p of j)a.push(`<td class="py-1 px-2 border-b border-border/50">${K(p)}</td>`);a.push("</tr>")}a.push("</tbody></table></div>"),u=[]}if(!r){s&&(a.push("</ul>"),s=!1);continue}if(r.startsWith("### ")){s&&(a.push("</ul>"),s=!1),a.push(`<h4 class="${n.heading} font-semibold text-text-primary mt-3 mb-1">${K(r.slice(4))}</h4>`);continue}if(r.startsWith("## ")){s&&(a.push("</ul>"),s=!1),a.push(`<h3 class="${n.heading} font-semibold text-text-primary mt-3 mb-1">${K(r.slice(3))}</h3>`);continue}if(/^[-*_]{3,}$/.test(r)){s&&(a.push("</ul>"),s=!1),a.push('<hr class="border-border my-3" />');continue}if(/^[-*] /.test(r)){s||(a.push('<ul class="space-y-1 my-1">'),s=!0),a.push(`<li class="${n.list} text-text-secondary flex gap-2"><span class="text-text-tertiary shrink-0">-</span><span>${K(r.slice(2))}</span></li>`);continue}s&&(a.push("</ul>"),s=!1),a.push(`<p class="${n.text} text-text-secondary my-1">${K(r)}</p>`)}if(l&&u.length){const[d,...r]=u;a.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const o of d)a.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${K(o)}</th>`);a.push("</tr></thead><tbody>");for(const o of r){a.push("<tr>");for(const c of o)a.push(`<td class="py-1 px-2 border-b border-border/50">${K(c)}</td>`);a.push("</tr>")}a.push("</tbody></table></div>")}return s&&a.push("</ul>"),a}function be({children:t}){return e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:t})}function Xt({payload:t,isTerminal:n,resolverPayload:i,onRetryTriage:a,isRetrying:s}){const l=t.title,u=t.summary,d=t.diagnosis,r=t.tool_calls_made,o=t.result,c=i==null?void 0:i._lt,j=(c==null?void 0:c.triaged)===!0,p=c==null?void 0:c.triageWorkflowId,f=n&&j,[x,m]=h.useState(!1);return f?e.jsxs("div",{className:"rounded-md border border-status-success/30 bg-surface-raised",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-status-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:e.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"})}),e.jsx("span",{className:"text-xs font-medium text-status-success",children:"Resolved by AI Triage"})]}),typeof r=="number"&&e.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-status-success/10 text-status-success",children:[r," tool calls used"]})]}),e.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l&&e.jsx("p",{className:"text-sm font-medium text-text-primary",children:l}),d&&e.jsxs("div",{children:[e.jsx(be,{children:"Triage diagnosis"}),e.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:e.jsx(je,{content:d})})]}),e.jsx("div",{className:"flex items-center gap-3",children:p&&e.jsx(ce,{to:`/workflows/executions/${p}`,className:"text-[10px] text-accent hover:underline",children:"View triage execution"})})]})]}):e.jsxs("div",{className:"rounded-md border border-status-warning/30 bg-surface-raised",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-status-warning shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:e.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"})}),e.jsx("span",{className:"text-xs font-medium text-status-warning",children:"Tool Rounds Exhausted"})]}),typeof r=="number"&&e.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-status-warning/10 text-status-warning",children:[r," tool calls used"]})]}),e.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l&&e.jsx("p",{className:"text-sm font-medium text-text-primary",children:l}),u&&e.jsxs("div",{children:[e.jsx(be,{children:"What happened"}),e.jsx("div",{className:"text-xs text-text-secondary leading-relaxed",children:e.jsx(je,{content:u})})]}),d&&e.jsxs("div",{children:[e.jsx(be,{children:"What went wrong"}),e.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:e.jsx(je,{content:d})})]}),o!=null&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>m(!x),className:"flex items-center gap-1 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary hover:text-text-secondary transition-colors",children:[e.jsx("svg",{className:`w-3 h-3 transition-transform ${x?"rotate-90":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:e.jsx("path",{d:"M4.5 2l4 4-4 4"})}),"Partial results"]}),x&&e.jsx("div",{className:"mt-2",children:e.jsx(re,{data:o,defaultMode:"tree"})})]}),a&&!n&&e.jsx("div",{className:"pt-2",children:e.jsxs("button",{onClick:a,disabled:s,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:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"currentColor",children:e.jsx("path",{d:"M7 1a6 6 0 100 12A6 6 0 007 1zm2.5 6.5l-3.5 2V5.5l3.5 2z"})}),s?"Sending to triage...":"Retry with AI Triage"]})})]})]})}function Ie(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}function He({src:t,escalation:n,schema:i,onResolve:a,onEscalate:s,submitAttempted:l,fill:u}){const d=h.useRef(null),r=h.useRef("");h.useEffect(()=>{try{const c=new URL(t);r.current=c.origin}catch{r.current=""}},[t]);const o=h.useCallback(()=>{const c=d.current;if(!(c!=null&&c.contentWindow)||!r.current)return;const p={type:"lt:init",escalation:{id:n.id,type:n.type,subtype:n.subtype,description:n.description,status:n.status,priority:n.priority,role:n.role,workflow_type:n.workflow_type,envelope:Ie(n.envelope),metadata:n.metadata??null,escalation_payload:Ie(n.escalation_payload)},schema:i};c.contentWindow.postMessage(p,r.current)},[n,i]);return h.useEffect(()=>{const c=j=>{if(j.origin!==r.current)return;const p=j.data;if(!(!p||typeof p!="object"||typeof p.type!="string"))switch(p.type){case"lt:ready":o();break;case"lt:submit":p.payload&&typeof p.payload=="object"&&a(p.payload);break;case"lt:escalate":typeof p.target=="string"&&p.target&&s(p.target);break;case"lt:resize":{const f=d.current;f&&typeof p.height=="number"&&p.height>0&&(f.style.height=`${Math.min(p.height,2e3)}px`);break}}};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[o,a,s]),h.useEffect(()=>{if(!l)return;const c=d.current;c!=null&&c.contentWindow&&r.current&&c.contentWindow.postMessage({type:"lt:validate"},r.current)},[l]),u?e.jsx("div",{className:"absolute inset-0 overflow-hidden",children:e.jsx("iframe",{ref:d,src:t,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:o})}):e.jsx("div",{className:"rounded-md border border-surface-border overflow-hidden bg-white",children:e.jsx("iframe",{ref:d,src:t,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:o})})}function Zt({fieldKey:t,value:n,onChange:i,schema:a}){const s=h.useRef(null),l=(a==null?void 0:a.accept)??void 0,u=t.replace(/[_-]/g," "),d=a==null?void 0:a.description,r=h.useCallback(c=>{var f;const j=(f=c.target.files)==null?void 0:f[0];if(!j)return;const p=new FileReader;p.onload=()=>{typeof p.result=="string"&&i(p.result)},p.readAsDataURL(j)},[i]),o=n.startsWith("data:");return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:u}),d&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:d}),e.jsxs("div",{className:"mt-1",children:[e.jsx("input",{ref:s,type:"file",accept:l,onChange:r,className:"hidden"}),e.jsx("button",{type:"button",onClick:()=>{var c;return(c=s.current)==null?void 0:c.click()},className:"btn-secondary text-xs px-3 py-1.5",children:o?"Replace file":"Choose file"}),o&&e.jsx("span",{className:"ml-2 text-xs text-status-success",children:"File attached"})]})]})}function es({fieldKey:t,value:n,onChange:i,schema:a}){const s=t.replace(/[_-]/g," "),l=a==null?void 0:a.description,u=(a==null?void 0:a["x-lt-language"])??"",d=h.useCallback(r=>{if(r.key==="Tab"){r.preventDefault();const o=r.currentTarget,c=o.selectionStart,j=o.selectionEnd,p=n.substring(0,c)+" "+n.substring(j);i(p),requestAnimationFrame(()=>{o.selectionStart=o.selectionEnd=c+2})}},[n,i]);return e.jsxs("div",{children:[e.jsxs("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:[s,u&&e.jsx("span",{className:"ml-2 text-text-tertiary/60 normal-case font-normal",children:u})]}),l&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:l}),e.jsx("textarea",{value:n,onChange:r=>i(r.target.value),onKeyDown:d,className:"input w-full mt-1 font-mono text-xs leading-relaxed",rows:10,spellCheck:!1})]})}function ts({fieldKey:t,value:n,onChange:i,schema:a}){const s=h.useRef(null),[l,u]=h.useState(!1),d=t.replace(/[_-]/g," "),r=a==null?void 0:a.description;h.useEffect(()=>{const x=s.current;if(!x)return;const m=x.getContext("2d");if(m&&(m.lineWidth=2,m.lineCap="round",m.strokeStyle="#1E1535",n&&n.startsWith("data:"))){const g=new Image;g.onload=()=>m.drawImage(g,0,0),g.src=n}},[]);const o=h.useCallback(x=>{const g=s.current.getBoundingClientRect();return"touches"in x?{x:x.touches[0].clientX-g.left,y:x.touches[0].clientY-g.top}:{x:x.clientX-g.left,y:x.clientY-g.top}},[]),c=h.useCallback(x=>{var k;u(!0);const m=(k=s.current)==null?void 0:k.getContext("2d");if(!m)return;const g=o(x);m.beginPath(),m.moveTo(g.x,g.y)},[o]),j=h.useCallback(x=>{var k;if(!l)return;const m=(k=s.current)==null?void 0:k.getContext("2d");if(!m)return;const g=o(x);m.lineTo(g.x,g.y),m.stroke()},[l,o]),p=h.useCallback(()=>{u(!1);const x=s.current;x&&i(x.toDataURL("image/png"))},[i]),f=h.useCallback(()=>{const x=s.current;if(!x)return;const m=x.getContext("2d");m&&(m.clearRect(0,0,x.width,x.height),i(""))},[i]);return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:d}),r&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:r}),e.jsx("div",{className:"mt-1 border border-surface-border rounded-md overflow-hidden bg-white",children:e.jsx("canvas",{ref:s,width:400,height:150,className:"w-full cursor-crosshair touch-none",onMouseDown:c,onMouseMove:j,onMouseUp:p,onMouseLeave:p,onTouchStart:c,onTouchMove:j,onTouchEnd:p})}),e.jsx("button",{type:"button",onClick:f,className:"mt-1 text-[10px] text-text-tertiary hover:text-accent transition-colors",children:"Clear"})]})}function ss({fieldKey:t,value:n,onChange:i,schema:a}){const s=t.replace(/[_-]/g," "),l=a==null?void 0:a.description;return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:s}),l&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:l}),e.jsx("textarea",{value:n,onChange:u=>i(u.target.value),className:"input w-full mt-1 text-sm leading-relaxed",rows:8,placeholder:"Supports plain text. Markdown formatting is preserved."})]})}function as({fieldKey:t,value:n,onChange:i,schema:a}){const[s,l]=h.useState("write"),u=t.replace(/[_-]/g," "),d=a==null?void 0:a.description;return(a==null?void 0:a.readOnly)===!0?e.jsx(ye,{content:n,className:"my-1"}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:u}),e.jsx("div",{className:"flex items-center gap-0.5",children:["write","preview"].map(o=>e.jsx("button",{type:"button",onClick:()=>l(o),className:`px-2 py-0.5 text-[10px] rounded transition-colors ${s===o?"bg-accent/10 text-accent font-semibold":"text-text-quaternary hover:text-text-secondary"}`,children:o==="write"?"Write":"Preview"},o))})]}),d&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:d}),s==="write"?e.jsx("textarea",{value:n,onChange:o=>i(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."}):e.jsx("div",{className:"mt-1 px-3 py-2 border border-surface-border rounded min-h-[120px]",children:n.trim()?e.jsx(ye,{content:n}):e.jsx("p",{className:"text-xs text-text-quaternary italic",children:"Nothing to preview."})})]})}const De={"file-upload":Zt,"code-editor":es,signature:ts,"rich-text":ss,markdown:as};function qe({value:t,onChange:n,disabled:i,submitAttempted:a}){const[s,l]=h.useState({}),[u,d]=h.useState({}),[r,o]=h.useState(null),[c,j]=h.useState(!1),[p,f]=h.useState(new Set);h.useEffect(()=>{try{const y=JSON.parse(t);if(typeof y=="object"&&y!==null&&!Array.isArray(y)){const v={},C={};for(const[P,V]of Object.entries(y))P.startsWith("_")?C[P]=V:v[P]=V;l(v),d(C),o(C._form_schema&&typeof C._form_schema=="object"?C._form_schema:null),j(!1)}}catch{j(!0)}},[t]);const x=h.useCallback(y=>{l(y),n(JSON.stringify({...y,...u},null,2))},[u,n]),m=h.useCallback((y,v)=>{x({...s,[y]:v})},[s,x]),g=h.useCallback(y=>{f(v=>{if(v.has(y))return v;const C=new Set(v);return C.add(y),C})},[]);if(c)return e.jsx("p",{className:"text-xs text-status-error",children:"Unable to parse resolver data as form. Use the JSON editor below."});const k=Object.entries(s);if(k.length===0)return e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No resolver fields defined."});const b=r==null?void 0:r["x-lt-order"],A=b?[...k].sort((y,v)=>{const C=b.indexOf(y[0]),P=b.indexOf(v[0]);return(C===-1?1/0:C)-(P===-1?1/0:P)}):k,E=new Set((r==null?void 0:r.required)??[]),M=r==null?void 0:r["x-lt-layout"],T=r==null?void 0:r.title,R=r==null?void 0:r.description,_=A.map(([y,v])=>{var $;const C=($=r==null?void 0:r.properties)==null?void 0:$[y],P=(C==null?void 0:C.readOnly)===!0,V=(C==null?void 0:C["x-lt-span"])??1,J=E.has(y),U=p.has(y)||!!a;let I;if(J&&U&&(v==null||typeof v=="string"&&v.trim()==="")&&(I="Required"),U&&typeof v=="string"&&v.trim()!==""&&C){const S=C.format;S==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v)&&(I="Enter a valid email address"),S==="uri"&&!/^https?:\/\/.+/.test(v)&&(I="Enter a valid URL")}return e.jsx("div",{className:M==="two-column"&&V>=2?"col-span-2":"",children:e.jsx(ze,{fieldKey:y,value:v,onChange:S=>m(y,S),onBlur:()=>g(y),schema:r,isRequired:J,isReadOnly:P,error:I})},y)});return e.jsxs("div",{className:`pb-8 ${i?"opacity-60 pointer-events-none":""}`,children:[T&&e.jsx("h3",{className:"text-lg font-light text-text-primary mb-1",children:T}),R&&e.jsx("p",{className:"text-sm text-text-secondary leading-relaxed mb-6",children:R}),M==="two-column"?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-14 gap-y-6",children:_}):e.jsx("div",{className:"space-y-6",children:_})]})}function ze({fieldKey:t,value:n,onChange:i,onBlur:a,schema:s,isRequired:l,isReadOnly:u,error:d}){var p;const r=t.replace(/[_-]/g," "),o=(p=s==null?void 0:s.properties)==null?void 0:p[t],c=o==null?void 0:o["x-lt-widget"];if(u&&!(c==="markdown"&&typeof n=="string")){const f=n===null?"null":typeof n=="object"?JSON.stringify(n,null,2):String(n);return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("p",{className:"text-sm text-text-secondary mt-0.5 whitespace-pre-wrap",children:f})]})}if(c&&c in De&&typeof n=="string"){const f=De[c];return e.jsx(f,{fieldKey:t,value:n,onChange:x=>i(x),schema:o})}if(typeof n=="boolean")return e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:n,onChange:f=>{i(f.target.checked),a==null||a()},className:"w-3.5 h-3.5 rounded accent-accent"}),e.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[r,l&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})]}),e.jsx(Q,{error:d})]});if(typeof n=="number")return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("input",{type:"number",value:n,onChange:f=>i(parseFloat(f.target.value)||0),onBlur:a,step:"any",className:ee(!!d)}),e.jsx(Q,{error:d})]});if(typeof n=="string"){const f=(o==null?void 0:o.format)==="password",x=o==null?void 0:o.enum,m=o==null?void 0:o.description;if(x!=null&&x.length)return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("select",{value:n,onChange:b=>i(b.target.value),onBlur:a,className:ee(!!d),children:x.map(b=>e.jsx("option",{value:b,children:b},b))}),e.jsx(Q,{error:d})]});if(f)return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("input",{type:"password",value:n,onChange:b=>i(b.target.value),onBlur:a,className:ee(!!d),autoComplete:"off"}),e.jsx(Q,{error:d})]});const g=o==null?void 0:o.format,k={date:"date","date-time":"datetime-local",email:"email",uri:"url"};return g&&g in k?e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("input",{type:k[g],value:n,onChange:b=>i(b.target.value),onBlur:a,className:ee(!!d)}),e.jsx(Q,{error:d})]}):g==="textarea"||n.length>80?e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("textarea",{value:n,onChange:b=>i(b.target.value),onBlur:a,className:`${ee(!!d)} leading-relaxed`,rows:Math.min(6,Math.max(3,Math.ceil(n.length/60)))}),e.jsx(Q,{error:d})]}):e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("input",{type:"text",value:n,onChange:b=>i(b.target.value),onBlur:a,className:ee(!!d)}),e.jsx(Q,{error:d})]})}if(n===null)return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("p",{className:"text-xs text-text-tertiary italic mt-1",children:"null"})]});if(Array.isArray(n))return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:n.map((f,x)=>e.jsx("span",{className:"px-2 py-0.5 text-[11px] font-mono bg-surface-sunken rounded text-text-secondary",children:String(f)},x))})]});if(typeof n=="object"){const f=Object.entries(n);return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("div",{className:"ml-4 mt-2 pl-4 border-l border-accent-faint space-y-3",children:f.map(([x,m])=>e.jsx(ze,{fieldKey:x,value:m,onChange:g=>i({...n,[x]:g})},x))})]})}return null}function F({children:t,isRequired:n}){return e.jsxs("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[t,n&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})}function Q({error:t}){return t?e.jsx("p",{className:"text-[10px] text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:t}):null}function ee(t){return t?"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 ns({json:t,onJsonChange:n,requestTriage:i,onRequestTriageChange:a,triageNotes:s,onTriageNotesChange:l,disabled:u=!1,submitAttempted:d=!1,showTriage:r=!1}){return e.jsxs(e.Fragment,{children:[r&&e.jsx("div",{className:"flex items-center justify-between mb-3",children:i?e.jsxs("button",{onClick:()=>a(!1),className:"group flex items-center gap-2 text-left","data-testid":"triage-cancel",children:[e.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-accent/10 text-accent shrink-0",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("span",{className:"text-xs text-text-secondary group-hover:text-text-primary transition-colors",children:["AI Triage active."," ",e.jsx("span",{className:"text-accent group-hover:underline",children:"Cancel"})]})]}):e.jsxs("button",{onClick:()=>a(!0),className:"group flex items-center gap-2.5 text-left my-4","data-testid":"triage-callout",children:[e.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:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.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"})})}),e.jsxs("span",{className:"text-[13px] text-text-secondary group-hover:text-text-primary transition-colors",children:["This form doesn't capture the issue?"," ",e.jsx("span",{className:"text-accent group-hover:underline",children:"Request AI Triage"})]})]})}),e.jsxs("div",{className:"relative min-h-[200px]",children:[e.jsx("div",{className:i?"pointer-events-none select-none":"",children:e.jsx(qe,{value:t,onChange:n,disabled:u,submitAttempted:d})}),i&&e.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:[e.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."}),e.jsx("textarea",{value:s,onChange:o=>l(o.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 Be(t,n){if(!t.includes("{"))return t;try{const i=s=>{if(!s)return{};try{return JSON.parse(s)}catch{return{}}},a={...i(n.metadata),...i(n.envelope),...i(n.escalation_payload)};return t.replace(/\{([^}]+)\}/g,(s,l)=>Object.prototype.hasOwnProperty.call(a,l)?String(a[l]):`{${l}}`)}catch{return t}}function rs({isRoundsExhausted:t,payloadObj:n,isTerminal:i,resolverPayload:a,onRetryTriage:s,isRetrying:l}){return e.jsxs(e.Fragment,{children:[t&&n&&e.jsx("div",{className:"mt-8",children:e.jsx(Xt,{payload:n,isTerminal:i,resolverPayload:a,onRetryTriage:s,isRetrying:l})}),(n==null?void 0:n.category)==="missing_credential"&&e.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:[e.jsx(Se,{size:20,className:"text-status-warning mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text-primary mb-1",children:"Missing Credential"}),e.jsxs("p",{className:"text-xs text-text-secondary mb-3",children:["This workflow requires a ",e.jsx("span",{className:"font-medium capitalize",children:String(n.provider)})," credential to continue. Register one and then resolve this escalation to retry."]}),e.jsxs(ce,{to:"/credentials",className:"btn-primary text-xs inline-flex items-center gap-1.5",children:[e.jsx(Se,{size:12}),"Go to Credentials"]})]})]})]})}function ls({esc:t,resolverPayload:n,isTerminal:i,claimedByMe:a,activeView:s,metadataFormSchema:l,effectiveSchema:u,json:d,onJsonChange:r,requestTriage:o,onRequestTriageChange:c,triageNotes:j,onTriageNotesChange:p,onResolve:f,onEscalate:x,onClaim:m,submitAttempted:g,isCertified:k,hasAI:b}){const A=u;if(i){if(n==null)return null;const R=typeof n=="object"&&n!==null?n:{},_=u??l,y=_!=null&&_.properties?{...Le(R,_),_form_schema:_}:R;return e.jsx("div",{className:"mt-8 pt-6",children:e.jsx(qe,{value:JSON.stringify(y,null,2),onChange:()=>{},disabled:!0})})}if(s!=="resolve"||!(t.workflow_type||u))return null;const E=A==null?void 0:A["x-lt-viewport"],M=(E==null?void 0:E.type)==="iframe"&&!!E.src&&f&&x;if(M&&!a)return e.jsxs("button",{onClick:()=>m==null?void 0:m(),disabled:!m,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:[e.jsx(Ot,{className:"w-10 h-10 text-text-tertiary group-hover:text-accent transition-colors",strokeWidth:1}),e.jsx("p",{className:"text-base font-medium text-text-primary group-hover:text-accent transition-colors",children:"Claim to launch the editor"})]});const T=M?Be(E.src,t):"";return e.jsx("div",{className:"mt-8 pt-6",children:M?e.jsx(He,{src:T,escalation:t,schema:A,onResolve:f,onEscalate:x,submitAttempted:g}):e.jsx(ns,{json:d,onJsonChange:r,requestTriage:o,onRequestTriageChange:c,triageNotes:j,onTriageNotesChange:p,disabled:!a,submitAttempted:g,showTriage:!!k&&!!b})})}const Ke="lt:escalation:panel:open";function is(){try{const t=localStorage.getItem(Ke);return t===null?!0:t==="true"}catch{return!0}}function Oe(t){try{localStorage.setItem(Ke,String(t))}catch{}}function oe(t){if(!t)return null;try{return JSON.parse(t)}catch{return t}}function Es(){var Ce,_e,Ee,Te;const{id:t}=Ft(),{user:n}=nt(),i=Je(),a=at(),{data:s,isLoading:l,refetch:u,isFetching:d}=rt(t);vt(t);const r=lt(),o=it(),c=ot(),j=ct(),[p,f]=h.useState(!1),{data:x}=bt((s==null?void 0:s.role)??""),{data:m}=Nt(),{data:g}=dt(),{isBuilder:k}=xt(),b=m==null?void 0:m.find(N=>N.workflow_type===(s==null?void 0:s.workflow_type)),A=((Ce=g==null?void 0:g.telemetry)==null?void 0:Ce.traceUrl)??null,[E,M]=h.useState("resolve"),[T,R]=h.useState("{}"),[_,y]=h.useState(is),[v,C]=h.useState(!1),[P,V]=h.useState(""),[J,U]=h.useState(!1),I=((_e=s==null?void 0:s.metadata)==null?void 0:_e.form_schema)??null,$=(s==null?void 0:s.form_schema)??(b==null?void 0:b.resolver_schema)??null,S=I??$,te=h.useRef(!1);h.useEffect(()=>{if(te.current)return;const N=I??($!=null&&$.properties?$:null);if(N!=null&&N.properties){te.current=!0;const ne=oe(s==null?void 0:s.envelope),Z=ne==null?void 0:ne.formDefaults,pe=Z&&typeof Z=="object"?Le(Z,N):{},le={_form_schema:N};for(const[Re,tt]of Object.entries(N.properties)){const st=tt;le[Re]=pe[Re]??st.default??""}R(JSON.stringify(le,null,2))}else S&&(te.current=!0,R(JSON.stringify(S,null,2)))},[S,I,$,s==null?void 0:s.envelope]);const de=(s==null?void 0:s.subtype)==="rounds_exhausted";if(l)return e.jsxs("div",{className:"animate-pulse space-y-8",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-32 bg-surface-sunken rounded w-full"})]});if(!s)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Escalation not found."});const H=We(s),w=H&&s.assigned_to===(n==null?void 0:n.userId),X=H&&!w,L=s.status==="resolved"||s.status==="cancelled",q=S==null?void 0:S["x-lt-viewport"],se=(q==null?void 0:q.type)==="iframe"&&!!(q!=null&&q.src)&&w&&!L,W=oe(s.escalation_payload),D=oe(s.resolver_payload),O=oe(s.envelope),xe=!!((Ee=O==null?void 0:O.metadata)!=null&&Ee.certified),we=ut(),Ne=we!==null?we:!!((Te=g==null?void 0:g.ai)!=null&&Te.enabled),z=typeof W=="object"&&W!==null&&!Array.isArray(W)?W:null,Ye=z==null?void 0:z._triage,Ge=typeof D=="object"&&D!==null&&!Array.isArray(D)?D:null,Qe=L?"terminal":w?"claimed_by_me":X?"claimed_by_other":"available",ve=N=>{r.mutate({id:s.id,durationMinutes:N})},ae=()=>{a.resetQueries({queryKey:["escalations"]}),a.resetQueries({queryKey:["escalationStats"]}),i(-1)},ue=async N=>{await o.mutateAsync({id:s.id,resolverPayload:N}),ae()},me=async N=>{N&&(await c.mutateAsync({id:s.id,targetRole:N}),ae())},Xe=async()=>{w||await r.mutateAsync({id:s.id,durationMinutes:30});const N=(z==null?void 0:z.diagnosis)||s.description||"";await o.mutateAsync({id:s.id,resolverPayload:{_lt:{needsTriage:!0},notes:N}}),ae()},ke=async()=>{await r.mutateAsync({id:s.id,durationMinutes:0}),ae()},Ze=async()=>{await j.mutateAsync(s.id),f(!1),ae()},et=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wt,{onRefresh:()=>u(),isFetching:d,apiPath:`/escalations/${s.id}`}),e.jsx("button",{onClick:()=>y(N=>(Oe(!N),!N)),className:"ml-2 text-text-tertiary hover:text-accent transition-colors",title:_?"Hide side panel":"Show side panel",children:_?e.jsx(Ae,{className:"w-5 h-5",strokeWidth:1.5}):e.jsx($e,{className:"w-5 h-5",strokeWidth:1.5})})]});return e.jsxs("div",{className:"flex-1 min-h-0 min-w-0 flex items-stretch -mt-10 -mr-10 -mb-16",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col min-h-0",children:[se?e.jsxs("div",{className:"relative flex-1 min-h-0 -ml-10",children:[e.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:ke,disabled:r.isPending,label:"Release",hoverClass:"hover:text-accent",icon:e.jsx(Lt,{className:"w-4 h-4",strokeWidth:1.5})},{onClick:()=>f(!0),disabled:!1,label:"Cancel",hoverClass:"hover:text-status-error",icon:e.jsx(Wt,{className:"w-4 h-4",strokeWidth:1.5})},{onClick:()=>y(N=>(Oe(!N),!N)),disabled:!1,label:_?"Hide panel":"Show panel",hoverClass:"hover:text-accent",icon:_?e.jsx(Ae,{className:"w-4 h-4",strokeWidth:1.5}):e.jsx($e,{className:"w-4 h-4",strokeWidth:1.5})}].map(({onClick:N,disabled:ne,label:Z,hoverClass:pe,icon:le})=>e.jsxs("div",{className:"relative group/tip",children:[e.jsx("button",{onClick:N,disabled:ne,className:`text-text-tertiary ${pe} transition-colors disabled:opacity-40 disabled:cursor-default p-1.5 rounded-md`,children:le}),e.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-[11px] bg-surface-sunken text-text-primary whitespace-nowrap opacity-0 group-hover/tip:opacity-100 transition-opacity",children:Z})]},Z))}),e.jsx(He,{src:Be(q.src,s),escalation:s,schema:S,onResolve:ue,onEscalate:me,submitAttempted:J,fill:!0})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"shrink-0 pt-10 pr-10",children:e.jsx(yt,{title:s.description||"Escalation",actions:et})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pr-10",children:[e.jsx(rs,{isRoundsExhausted:de,payloadObj:z,isTerminal:L,resolverPayload:D,onRetryTriage:Xe,isRetrying:r.isPending||o.isPending}),e.jsx(ls,{esc:s,resolverPayload:D,isTerminal:L,claimedByMe:w,activeView:E,metadataFormSchema:I,effectiveSchema:S,json:T,onJsonChange:R,requestTriage:v,onRequestTriageChange:C,triageNotes:P,onTriageNotesChange:V,onResolve:ue,onEscalate:me,onClaim:()=>ve(30),submitAttempted:J,isCertified:xe,hasAI:Ne}),e.jsx("div",{className:"h-10"})]})]}),!se&&e.jsx(Gt,{mode:Qe,activeView:E,onActiveViewChange:M,onClaim:ve,claimPending:r.isPending,workflowType:s.workflow_type,json:T,onResolve:ue,resolvePending:o.isPending,resolveError:o.error,requestTriage:v,triageNotes:P,currentRole:s.role,escalationTargets:((x==null?void 0:x.targets)??[]).filter(N=>N!==s.role),onEscalate:me,escalatePending:c.isPending,escalateError:c.error,onRelease:ke,releasePending:r.isPending,onCancel:()=>f(!0),assignedTo:s.assigned_to,assignedUntil:s.assigned_until,onSubmitAttempt:()=>U(!0)})]}),e.jsx(Yt,{esc:s,schema:S,envelope:O,payload:z,resolver:Ge,triage:Ye??null,hasAI:Ne,claimed:H,claimedByMe:w,isTerminal:L,isBuilder:k,traceUrl:A,open:_,noGutter:se}),e.jsx(jt,{open:p,onClose:()=>f(!1),onConfirm:Ze,isPending:j.isPending,error:j.error})]})}export{Es as EscalationDetailPage};
|
|
5
|
-
//# sourceMappingURL=index-
|
|
4
|
+
`),a=[];let s=!1,l=!1,u=[];for(const d of i){const r=d.trim();if(r.startsWith("|")&&r.endsWith("|")){const o=r.slice(1,-1).split("|").map(c=>c.trim());if(o.every(c=>/^[-:]+$/.test(c)))continue;l||(l=!0,u=[]),u.push(o);continue}if(l){l=!1;const[o,...c]=u;a.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const j of o)a.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${K(j)}</th>`);a.push("</tr></thead><tbody>");for(const j of c){a.push("<tr>");for(const p of j)a.push(`<td class="py-1 px-2 border-b border-border/50">${K(p)}</td>`);a.push("</tr>")}a.push("</tbody></table></div>"),u=[]}if(!r){s&&(a.push("</ul>"),s=!1);continue}if(r.startsWith("### ")){s&&(a.push("</ul>"),s=!1),a.push(`<h4 class="${n.heading} font-semibold text-text-primary mt-3 mb-1">${K(r.slice(4))}</h4>`);continue}if(r.startsWith("## ")){s&&(a.push("</ul>"),s=!1),a.push(`<h3 class="${n.heading} font-semibold text-text-primary mt-3 mb-1">${K(r.slice(3))}</h3>`);continue}if(/^[-*_]{3,}$/.test(r)){s&&(a.push("</ul>"),s=!1),a.push('<hr class="border-border my-3" />');continue}if(/^[-*] /.test(r)){s||(a.push('<ul class="space-y-1 my-1">'),s=!0),a.push(`<li class="${n.list} text-text-secondary flex gap-2"><span class="text-text-tertiary shrink-0">-</span><span>${K(r.slice(2))}</span></li>`);continue}s&&(a.push("</ul>"),s=!1),a.push(`<p class="${n.text} text-text-secondary my-1">${K(r)}</p>`)}if(l&&u.length){const[d,...r]=u;a.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const o of d)a.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${K(o)}</th>`);a.push("</tr></thead><tbody>");for(const o of r){a.push("<tr>");for(const c of o)a.push(`<td class="py-1 px-2 border-b border-border/50">${K(c)}</td>`);a.push("</tr>")}a.push("</tbody></table></div>")}return s&&a.push("</ul>"),a}function be({children:t}){return e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:t})}function Xt({payload:t,isTerminal:n,resolverPayload:i,onRetryTriage:a,isRetrying:s}){const l=t.title,u=t.summary,d=t.diagnosis,r=t.tool_calls_made,o=t.result,c=i==null?void 0:i._lt,j=(c==null?void 0:c.triaged)===!0,p=c==null?void 0:c.triageWorkflowId,f=n&&j,[x,m]=h.useState(!1);return f?e.jsxs("div",{className:"rounded-md border border-status-success/30 bg-surface-raised",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-status-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:e.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"})}),e.jsx("span",{className:"text-xs font-medium text-status-success",children:"Resolved by AI Triage"})]}),typeof r=="number"&&e.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-status-success/10 text-status-success",children:[r," tool calls used"]})]}),e.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l&&e.jsx("p",{className:"text-sm font-medium text-text-primary",children:l}),d&&e.jsxs("div",{children:[e.jsx(be,{children:"Triage diagnosis"}),e.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:e.jsx(je,{content:d})})]}),e.jsx("div",{className:"flex items-center gap-3",children:p&&e.jsx(ce,{to:`/workflows/executions/${p}`,className:"text-[10px] text-accent hover:underline",children:"View triage execution"})})]})]}):e.jsxs("div",{className:"rounded-md border border-status-warning/30 bg-surface-raised",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-status-warning shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:e.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"})}),e.jsx("span",{className:"text-xs font-medium text-status-warning",children:"Tool Rounds Exhausted"})]}),typeof r=="number"&&e.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-status-warning/10 text-status-warning",children:[r," tool calls used"]})]}),e.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l&&e.jsx("p",{className:"text-sm font-medium text-text-primary",children:l}),u&&e.jsxs("div",{children:[e.jsx(be,{children:"What happened"}),e.jsx("div",{className:"text-xs text-text-secondary leading-relaxed",children:e.jsx(je,{content:u})})]}),d&&e.jsxs("div",{children:[e.jsx(be,{children:"What went wrong"}),e.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:e.jsx(je,{content:d})})]}),o!=null&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>m(!x),className:"flex items-center gap-1 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary hover:text-text-secondary transition-colors",children:[e.jsx("svg",{className:`w-3 h-3 transition-transform ${x?"rotate-90":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:e.jsx("path",{d:"M4.5 2l4 4-4 4"})}),"Partial results"]}),x&&e.jsx("div",{className:"mt-2",children:e.jsx(re,{data:o,defaultMode:"tree"})})]}),a&&!n&&e.jsx("div",{className:"pt-2",children:e.jsxs("button",{onClick:a,disabled:s,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:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"currentColor",children:e.jsx("path",{d:"M7 1a6 6 0 100 12A6 6 0 007 1zm2.5 6.5l-3.5 2V5.5l3.5 2z"})}),s?"Sending to triage...":"Retry with AI Triage"]})})]})]})}function Ie(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}function He({src:t,escalation:n,schema:i,onResolve:a,onEscalate:s,submitAttempted:l,fill:u}){const d=h.useRef(null),r=h.useRef("");h.useEffect(()=>{try{const c=new URL(t);r.current=c.origin}catch{r.current=""}},[t]);const o=h.useCallback(()=>{const c=d.current;if(!(c!=null&&c.contentWindow)||!r.current)return;const p={type:"lt:init",escalation:{id:n.id,type:n.type,subtype:n.subtype,description:n.description,status:n.status,priority:n.priority,role:n.role,workflow_type:n.workflow_type,envelope:Ie(n.envelope),metadata:n.metadata??null,escalation_payload:Ie(n.escalation_payload)},schema:i};c.contentWindow.postMessage(p,r.current)},[n,i]);return h.useEffect(()=>{const c=j=>{if(j.origin!==r.current)return;const p=j.data;if(!(!p||typeof p!="object"||typeof p.type!="string"))switch(p.type){case"lt:ready":o();break;case"lt:submit":p.payload&&typeof p.payload=="object"&&a(p.payload);break;case"lt:escalate":typeof p.target=="string"&&p.target&&s(p.target);break;case"lt:resize":{const f=d.current;f&&typeof p.height=="number"&&p.height>0&&(f.style.height=`${Math.min(p.height,2e3)}px`);break}}};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[o,a,s]),h.useEffect(()=>{if(!l)return;const c=d.current;c!=null&&c.contentWindow&&r.current&&c.contentWindow.postMessage({type:"lt:validate"},r.current)},[l]),u?e.jsx("div",{className:"absolute inset-0 overflow-hidden",children:e.jsx("iframe",{ref:d,src:t,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:o})}):e.jsx("div",{className:"rounded-md border border-surface-border overflow-hidden bg-white",children:e.jsx("iframe",{ref:d,src:t,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:o})})}function Zt({fieldKey:t,value:n,onChange:i,schema:a}){const s=h.useRef(null),l=(a==null?void 0:a.accept)??void 0,u=t.replace(/[_-]/g," "),d=a==null?void 0:a.description,r=h.useCallback(c=>{var f;const j=(f=c.target.files)==null?void 0:f[0];if(!j)return;const p=new FileReader;p.onload=()=>{typeof p.result=="string"&&i(p.result)},p.readAsDataURL(j)},[i]),o=n.startsWith("data:");return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:u}),d&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:d}),e.jsxs("div",{className:"mt-1",children:[e.jsx("input",{ref:s,type:"file",accept:l,onChange:r,className:"hidden"}),e.jsx("button",{type:"button",onClick:()=>{var c;return(c=s.current)==null?void 0:c.click()},className:"btn-secondary text-xs px-3 py-1.5",children:o?"Replace file":"Choose file"}),o&&e.jsx("span",{className:"ml-2 text-xs text-status-success",children:"File attached"})]})]})}function es({fieldKey:t,value:n,onChange:i,schema:a}){const s=t.replace(/[_-]/g," "),l=a==null?void 0:a.description,u=(a==null?void 0:a["x-lt-language"])??"",d=h.useCallback(r=>{if(r.key==="Tab"){r.preventDefault();const o=r.currentTarget,c=o.selectionStart,j=o.selectionEnd,p=n.substring(0,c)+" "+n.substring(j);i(p),requestAnimationFrame(()=>{o.selectionStart=o.selectionEnd=c+2})}},[n,i]);return e.jsxs("div",{children:[e.jsxs("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:[s,u&&e.jsx("span",{className:"ml-2 text-text-tertiary/60 normal-case font-normal",children:u})]}),l&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:l}),e.jsx("textarea",{value:n,onChange:r=>i(r.target.value),onKeyDown:d,className:"input w-full mt-1 font-mono text-xs leading-relaxed",rows:10,spellCheck:!1})]})}function ts({fieldKey:t,value:n,onChange:i,schema:a}){const s=h.useRef(null),[l,u]=h.useState(!1),d=t.replace(/[_-]/g," "),r=a==null?void 0:a.description;h.useEffect(()=>{const x=s.current;if(!x)return;const m=x.getContext("2d");if(m&&(m.lineWidth=2,m.lineCap="round",m.strokeStyle="#1E1535",n&&n.startsWith("data:"))){const g=new Image;g.onload=()=>m.drawImage(g,0,0),g.src=n}},[]);const o=h.useCallback(x=>{const g=s.current.getBoundingClientRect();return"touches"in x?{x:x.touches[0].clientX-g.left,y:x.touches[0].clientY-g.top}:{x:x.clientX-g.left,y:x.clientY-g.top}},[]),c=h.useCallback(x=>{var k;u(!0);const m=(k=s.current)==null?void 0:k.getContext("2d");if(!m)return;const g=o(x);m.beginPath(),m.moveTo(g.x,g.y)},[o]),j=h.useCallback(x=>{var k;if(!l)return;const m=(k=s.current)==null?void 0:k.getContext("2d");if(!m)return;const g=o(x);m.lineTo(g.x,g.y),m.stroke()},[l,o]),p=h.useCallback(()=>{u(!1);const x=s.current;x&&i(x.toDataURL("image/png"))},[i]),f=h.useCallback(()=>{const x=s.current;if(!x)return;const m=x.getContext("2d");m&&(m.clearRect(0,0,x.width,x.height),i(""))},[i]);return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:d}),r&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:r}),e.jsx("div",{className:"mt-1 border border-surface-border rounded-md overflow-hidden bg-white",children:e.jsx("canvas",{ref:s,width:400,height:150,className:"w-full cursor-crosshair touch-none",onMouseDown:c,onMouseMove:j,onMouseUp:p,onMouseLeave:p,onTouchStart:c,onTouchMove:j,onTouchEnd:p})}),e.jsx("button",{type:"button",onClick:f,className:"mt-1 text-[10px] text-text-tertiary hover:text-accent transition-colors",children:"Clear"})]})}function ss({fieldKey:t,value:n,onChange:i,schema:a}){const s=t.replace(/[_-]/g," "),l=a==null?void 0:a.description;return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:s}),l&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:l}),e.jsx("textarea",{value:n,onChange:u=>i(u.target.value),className:"input w-full mt-1 text-sm leading-relaxed",rows:8,placeholder:"Supports plain text. Markdown formatting is preserved."})]})}function as({fieldKey:t,value:n,onChange:i,schema:a}){const[s,l]=h.useState("write"),u=t.replace(/[_-]/g," "),d=a==null?void 0:a.description;return(a==null?void 0:a.readOnly)===!0?e.jsx(ye,{content:n,className:"my-1"}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:u}),e.jsx("div",{className:"flex items-center gap-0.5",children:["write","preview"].map(o=>e.jsx("button",{type:"button",onClick:()=>l(o),className:`px-2 py-0.5 text-[10px] rounded transition-colors ${s===o?"bg-accent/10 text-accent font-semibold":"text-text-quaternary hover:text-text-secondary"}`,children:o==="write"?"Write":"Preview"},o))})]}),d&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:d}),s==="write"?e.jsx("textarea",{value:n,onChange:o=>i(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."}):e.jsx("div",{className:"mt-1 px-3 py-2 border border-surface-border rounded min-h-[120px]",children:n.trim()?e.jsx(ye,{content:n}):e.jsx("p",{className:"text-xs text-text-quaternary italic",children:"Nothing to preview."})})]})}const De={"file-upload":Zt,"code-editor":es,signature:ts,"rich-text":ss,markdown:as};function qe({value:t,onChange:n,disabled:i,submitAttempted:a}){const[s,l]=h.useState({}),[u,d]=h.useState({}),[r,o]=h.useState(null),[c,j]=h.useState(!1),[p,f]=h.useState(new Set);h.useEffect(()=>{try{const y=JSON.parse(t);if(typeof y=="object"&&y!==null&&!Array.isArray(y)){const v={},C={};for(const[P,V]of Object.entries(y))P.startsWith("_")?C[P]=V:v[P]=V;l(v),d(C),o(C._form_schema&&typeof C._form_schema=="object"?C._form_schema:null),j(!1)}}catch{j(!0)}},[t]);const x=h.useCallback(y=>{l(y),n(JSON.stringify({...y,...u},null,2))},[u,n]),m=h.useCallback((y,v)=>{x({...s,[y]:v})},[s,x]),g=h.useCallback(y=>{f(v=>{if(v.has(y))return v;const C=new Set(v);return C.add(y),C})},[]);if(c)return e.jsx("p",{className:"text-xs text-status-error",children:"Unable to parse resolver data as form. Use the JSON editor below."});const k=Object.entries(s);if(k.length===0)return e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No resolver fields defined."});const b=r==null?void 0:r["x-lt-order"],A=b?[...k].sort((y,v)=>{const C=b.indexOf(y[0]),P=b.indexOf(v[0]);return(C===-1?1/0:C)-(P===-1?1/0:P)}):k,E=new Set((r==null?void 0:r.required)??[]),M=r==null?void 0:r["x-lt-layout"],T=r==null?void 0:r.title,R=r==null?void 0:r.description,_=A.map(([y,v])=>{var $;const C=($=r==null?void 0:r.properties)==null?void 0:$[y],P=(C==null?void 0:C.readOnly)===!0,V=(C==null?void 0:C["x-lt-span"])??1,J=E.has(y),U=p.has(y)||!!a;let I;if(J&&U&&(v==null||typeof v=="string"&&v.trim()==="")&&(I="Required"),U&&typeof v=="string"&&v.trim()!==""&&C){const S=C.format;S==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v)&&(I="Enter a valid email address"),S==="uri"&&!/^https?:\/\/.+/.test(v)&&(I="Enter a valid URL")}return e.jsx("div",{className:M==="two-column"&&V>=2?"col-span-2":"",children:e.jsx(ze,{fieldKey:y,value:v,onChange:S=>m(y,S),onBlur:()=>g(y),schema:r,isRequired:J,isReadOnly:P,error:I})},y)});return e.jsxs("div",{className:`pb-8 ${i?"opacity-60 pointer-events-none":""}`,children:[T&&e.jsx("h3",{className:"text-lg font-light text-text-primary mb-1",children:T}),R&&e.jsx("p",{className:"text-sm text-text-secondary leading-relaxed mb-6",children:R}),M==="two-column"?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-14 gap-y-6",children:_}):e.jsx("div",{className:"space-y-6",children:_})]})}function ze({fieldKey:t,value:n,onChange:i,onBlur:a,schema:s,isRequired:l,isReadOnly:u,error:d}){var p;const r=t.replace(/[_-]/g," "),o=(p=s==null?void 0:s.properties)==null?void 0:p[t],c=o==null?void 0:o["x-lt-widget"];if(u&&!(c==="markdown"&&typeof n=="string")){const f=n===null?"null":typeof n=="object"?JSON.stringify(n,null,2):String(n);return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("p",{className:"text-sm text-text-secondary mt-0.5 whitespace-pre-wrap",children:f})]})}if(c&&c in De&&typeof n=="string"){const f=De[c];return e.jsx(f,{fieldKey:t,value:n,onChange:x=>i(x),schema:o})}if(typeof n=="boolean")return e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:n,onChange:f=>{i(f.target.checked),a==null||a()},className:"w-3.5 h-3.5 rounded accent-accent"}),e.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[r,l&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})]}),e.jsx(Q,{error:d})]});if(typeof n=="number")return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("input",{type:"number",value:n,onChange:f=>i(parseFloat(f.target.value)||0),onBlur:a,step:"any",className:ee(!!d)}),e.jsx(Q,{error:d})]});if(typeof n=="string"){const f=(o==null?void 0:o.format)==="password",x=o==null?void 0:o.enum,m=o==null?void 0:o.description;if(x!=null&&x.length)return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("select",{value:n,onChange:b=>i(b.target.value),onBlur:a,className:ee(!!d),children:x.map(b=>e.jsx("option",{value:b,children:b},b))}),e.jsx(Q,{error:d})]});if(f)return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("input",{type:"password",value:n,onChange:b=>i(b.target.value),onBlur:a,className:ee(!!d),autoComplete:"off"}),e.jsx(Q,{error:d})]});const g=o==null?void 0:o.format,k={date:"date","date-time":"datetime-local",email:"email",uri:"url"};return g&&g in k?e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("input",{type:k[g],value:n,onChange:b=>i(b.target.value),onBlur:a,className:ee(!!d)}),e.jsx(Q,{error:d})]}):g==="textarea"||n.length>80?e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("textarea",{value:n,onChange:b=>i(b.target.value),onBlur:a,className:`${ee(!!d)} leading-relaxed`,rows:Math.min(6,Math.max(3,Math.ceil(n.length/60)))}),e.jsx(Q,{error:d})]}):e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("input",{type:"text",value:n,onChange:b=>i(b.target.value),onBlur:a,className:ee(!!d)}),e.jsx(Q,{error:d})]})}if(n===null)return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("p",{className:"text-xs text-text-tertiary italic mt-1",children:"null"})]});if(Array.isArray(n))return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:n.map((f,x)=>e.jsx("span",{className:"px-2 py-0.5 text-[11px] font-mono bg-surface-sunken rounded text-text-secondary",children:String(f)},x))})]});if(typeof n=="object"){const f=Object.entries(n);return e.jsxs("div",{children:[e.jsx(F,{isRequired:l,children:r}),e.jsx("div",{className:"ml-4 mt-2 pl-4 border-l border-accent-faint space-y-3",children:f.map(([x,m])=>e.jsx(ze,{fieldKey:x,value:m,onChange:g=>i({...n,[x]:g})},x))})]})}return null}function F({children:t,isRequired:n}){return e.jsxs("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[t,n&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})}function Q({error:t}){return t?e.jsx("p",{className:"text-[10px] text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:t}):null}function ee(t){return t?"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 ns({json:t,onJsonChange:n,requestTriage:i,onRequestTriageChange:a,triageNotes:s,onTriageNotesChange:l,disabled:u=!1,submitAttempted:d=!1,showTriage:r=!1}){return e.jsxs(e.Fragment,{children:[r&&e.jsx("div",{className:"flex items-center justify-between mb-3",children:i?e.jsxs("button",{onClick:()=>a(!1),className:"group flex items-center gap-2 text-left","data-testid":"triage-cancel",children:[e.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-accent/10 text-accent shrink-0",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("span",{className:"text-xs text-text-secondary group-hover:text-text-primary transition-colors",children:["AI Triage active."," ",e.jsx("span",{className:"text-accent group-hover:underline",children:"Cancel"})]})]}):e.jsxs("button",{onClick:()=>a(!0),className:"group flex items-center gap-2.5 text-left my-4","data-testid":"triage-callout",children:[e.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:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.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"})})}),e.jsxs("span",{className:"text-[13px] text-text-secondary group-hover:text-text-primary transition-colors",children:["This form doesn't capture the issue?"," ",e.jsx("span",{className:"text-accent group-hover:underline",children:"Request AI Triage"})]})]})}),e.jsxs("div",{className:"relative min-h-[200px]",children:[e.jsx("div",{className:i?"pointer-events-none select-none":"",children:e.jsx(qe,{value:t,onChange:n,disabled:u,submitAttempted:d})}),i&&e.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:[e.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."}),e.jsx("textarea",{value:s,onChange:o=>l(o.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 Be(t,n){if(!t.includes("{"))return t;try{const i=s=>{if(!s)return{};try{return JSON.parse(s)}catch{return{}}},a={...n.metadata??{},...i(n.envelope),...i(n.escalation_payload)};return t.replace(/\{([^}]+)\}/g,(s,l)=>Object.prototype.hasOwnProperty.call(a,l)?String(a[l]):`{${l}}`)}catch{return t}}function rs({isRoundsExhausted:t,payloadObj:n,isTerminal:i,resolverPayload:a,onRetryTriage:s,isRetrying:l}){return e.jsxs(e.Fragment,{children:[t&&n&&e.jsx("div",{className:"mt-8",children:e.jsx(Xt,{payload:n,isTerminal:i,resolverPayload:a,onRetryTriage:s,isRetrying:l})}),(n==null?void 0:n.category)==="missing_credential"&&e.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:[e.jsx(Se,{size:20,className:"text-status-warning mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text-primary mb-1",children:"Missing Credential"}),e.jsxs("p",{className:"text-xs text-text-secondary mb-3",children:["This workflow requires a ",e.jsx("span",{className:"font-medium capitalize",children:String(n.provider)})," credential to continue. Register one and then resolve this escalation to retry."]}),e.jsxs(ce,{to:"/credentials",className:"btn-primary text-xs inline-flex items-center gap-1.5",children:[e.jsx(Se,{size:12}),"Go to Credentials"]})]})]})]})}function ls({esc:t,resolverPayload:n,isTerminal:i,claimedByMe:a,activeView:s,metadataFormSchema:l,effectiveSchema:u,json:d,onJsonChange:r,requestTriage:o,onRequestTriageChange:c,triageNotes:j,onTriageNotesChange:p,onResolve:f,onEscalate:x,onClaim:m,submitAttempted:g,isCertified:k,hasAI:b}){const A=u;if(i){if(n==null)return null;const R=typeof n=="object"&&n!==null?n:{},_=u??l,y=_!=null&&_.properties?{...Le(R,_),_form_schema:_}:R;return e.jsx("div",{className:"mt-8 pt-6",children:e.jsx(qe,{value:JSON.stringify(y,null,2),onChange:()=>{},disabled:!0})})}if(s!=="resolve"||!(t.workflow_type||u))return null;const E=A==null?void 0:A["x-lt-viewport"],M=(E==null?void 0:E.type)==="iframe"&&!!E.src&&f&&x;if(M&&!a)return e.jsxs("button",{onClick:()=>m==null?void 0:m(),disabled:!m,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:[e.jsx(Ot,{className:"w-10 h-10 text-text-tertiary group-hover:text-accent transition-colors",strokeWidth:1}),e.jsx("p",{className:"text-base font-medium text-text-primary group-hover:text-accent transition-colors",children:"Claim to launch the editor"})]});const T=M?Be(E.src,t):"";return e.jsx("div",{className:"mt-8 pt-6",children:M?e.jsx(He,{src:T,escalation:t,schema:A,onResolve:f,onEscalate:x,submitAttempted:g}):e.jsx(ns,{json:d,onJsonChange:r,requestTriage:o,onRequestTriageChange:c,triageNotes:j,onTriageNotesChange:p,disabled:!a,submitAttempted:g,showTriage:!!k&&!!b})})}const Ke="lt:escalation:panel:open";function is(){try{const t=localStorage.getItem(Ke);return t===null?!0:t==="true"}catch{return!0}}function Oe(t){try{localStorage.setItem(Ke,String(t))}catch{}}function oe(t){if(!t)return null;try{return JSON.parse(t)}catch{return t}}function Es(){var Ce,_e,Ee,Te;const{id:t}=Ft(),{user:n}=nt(),i=Je(),a=at(),{data:s,isLoading:l,refetch:u,isFetching:d}=rt(t);vt(t);const r=lt(),o=it(),c=ot(),j=ct(),[p,f]=h.useState(!1),{data:x}=bt((s==null?void 0:s.role)??""),{data:m}=Nt(),{data:g}=dt(),{isBuilder:k}=xt(),b=m==null?void 0:m.find(N=>N.workflow_type===(s==null?void 0:s.workflow_type)),A=((Ce=g==null?void 0:g.telemetry)==null?void 0:Ce.traceUrl)??null,[E,M]=h.useState("resolve"),[T,R]=h.useState("{}"),[_,y]=h.useState(is),[v,C]=h.useState(!1),[P,V]=h.useState(""),[J,U]=h.useState(!1),I=((_e=s==null?void 0:s.metadata)==null?void 0:_e.form_schema)??null,$=(s==null?void 0:s.form_schema)??(b==null?void 0:b.resolver_schema)??null,S=I??$,te=h.useRef(!1);h.useEffect(()=>{if(te.current)return;const N=I??($!=null&&$.properties?$:null);if(N!=null&&N.properties){te.current=!0;const ne=oe(s==null?void 0:s.envelope),Z=ne==null?void 0:ne.formDefaults,pe=Z&&typeof Z=="object"?Le(Z,N):{},le={_form_schema:N};for(const[Re,tt]of Object.entries(N.properties)){const st=tt;le[Re]=pe[Re]??st.default??""}R(JSON.stringify(le,null,2))}else S&&(te.current=!0,R(JSON.stringify(S,null,2)))},[S,I,$,s==null?void 0:s.envelope]);const de=(s==null?void 0:s.subtype)==="rounds_exhausted";if(l)return e.jsxs("div",{className:"animate-pulse space-y-8",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-32 bg-surface-sunken rounded w-full"})]});if(!s)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Escalation not found."});const H=We(s),w=H&&s.assigned_to===(n==null?void 0:n.userId),X=H&&!w,L=s.status==="resolved"||s.status==="cancelled",q=S==null?void 0:S["x-lt-viewport"],se=(q==null?void 0:q.type)==="iframe"&&!!(q!=null&&q.src)&&w&&!L,W=oe(s.escalation_payload),D=oe(s.resolver_payload),O=oe(s.envelope),xe=!!((Ee=O==null?void 0:O.metadata)!=null&&Ee.certified),we=ut(),Ne=we!==null?we:!!((Te=g==null?void 0:g.ai)!=null&&Te.enabled),z=typeof W=="object"&&W!==null&&!Array.isArray(W)?W:null,Ye=z==null?void 0:z._triage,Ge=typeof D=="object"&&D!==null&&!Array.isArray(D)?D:null,Qe=L?"terminal":w?"claimed_by_me":X?"claimed_by_other":"available",ve=N=>{r.mutate({id:s.id,durationMinutes:N})},ae=()=>{a.resetQueries({queryKey:["escalations"]}),a.resetQueries({queryKey:["escalationStats"]}),i(-1)},ue=async N=>{await o.mutateAsync({id:s.id,resolverPayload:N}),ae()},me=async N=>{N&&(await c.mutateAsync({id:s.id,targetRole:N}),ae())},Xe=async()=>{w||await r.mutateAsync({id:s.id,durationMinutes:30});const N=(z==null?void 0:z.diagnosis)||s.description||"";await o.mutateAsync({id:s.id,resolverPayload:{_lt:{needsTriage:!0},notes:N}}),ae()},ke=async()=>{await r.mutateAsync({id:s.id,durationMinutes:0}),ae()},Ze=async()=>{await j.mutateAsync(s.id),f(!1),ae()},et=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wt,{onRefresh:()=>u(),isFetching:d,apiPath:`/escalations/${s.id}`}),e.jsx("button",{onClick:()=>y(N=>(Oe(!N),!N)),className:"ml-2 text-text-tertiary hover:text-accent transition-colors",title:_?"Hide side panel":"Show side panel",children:_?e.jsx(Ae,{className:"w-5 h-5",strokeWidth:1.5}):e.jsx($e,{className:"w-5 h-5",strokeWidth:1.5})})]});return e.jsxs("div",{className:"flex-1 min-h-0 min-w-0 flex items-stretch -mt-10 -mr-10 -mb-16",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col min-h-0",children:[se?e.jsxs("div",{className:"relative flex-1 min-h-0 -ml-10",children:[e.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:ke,disabled:r.isPending,label:"Release",hoverClass:"hover:text-accent",icon:e.jsx(Lt,{className:"w-4 h-4",strokeWidth:1.5})},{onClick:()=>f(!0),disabled:!1,label:"Cancel",hoverClass:"hover:text-status-error",icon:e.jsx(Wt,{className:"w-4 h-4",strokeWidth:1.5})},{onClick:()=>y(N=>(Oe(!N),!N)),disabled:!1,label:_?"Hide panel":"Show panel",hoverClass:"hover:text-accent",icon:_?e.jsx(Ae,{className:"w-4 h-4",strokeWidth:1.5}):e.jsx($e,{className:"w-4 h-4",strokeWidth:1.5})}].map(({onClick:N,disabled:ne,label:Z,hoverClass:pe,icon:le})=>e.jsxs("div",{className:"relative group/tip",children:[e.jsx("button",{onClick:N,disabled:ne,className:`text-text-tertiary ${pe} transition-colors disabled:opacity-40 disabled:cursor-default p-1.5 rounded-md`,children:le}),e.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-[11px] bg-surface-sunken text-text-primary whitespace-nowrap opacity-0 group-hover/tip:opacity-100 transition-opacity",children:Z})]},Z))}),e.jsx(He,{src:Be(q.src,s),escalation:s,schema:S,onResolve:ue,onEscalate:me,submitAttempted:J,fill:!0})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"shrink-0 pt-10 pr-10",children:e.jsx(yt,{title:s.description||"Escalation",actions:et})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pr-10",children:[e.jsx(rs,{isRoundsExhausted:de,payloadObj:z,isTerminal:L,resolverPayload:D,onRetryTriage:Xe,isRetrying:r.isPending||o.isPending}),e.jsx(ls,{esc:s,resolverPayload:D,isTerminal:L,claimedByMe:w,activeView:E,metadataFormSchema:I,effectiveSchema:S,json:T,onJsonChange:R,requestTriage:v,onRequestTriageChange:C,triageNotes:P,onTriageNotesChange:V,onResolve:ue,onEscalate:me,onClaim:()=>ve(30),submitAttempted:J,isCertified:xe,hasAI:Ne}),e.jsx("div",{className:"h-10"})]})]}),!se&&e.jsx(Gt,{mode:Qe,activeView:E,onActiveViewChange:M,onClaim:ve,claimPending:r.isPending,workflowType:s.workflow_type,json:T,onResolve:ue,resolvePending:o.isPending,resolveError:o.error,requestTriage:v,triageNotes:P,currentRole:s.role,escalationTargets:((x==null?void 0:x.targets)??[]).filter(N=>N!==s.role),onEscalate:me,escalatePending:c.isPending,escalateError:c.error,onRelease:ke,releasePending:r.isPending,onCancel:()=>f(!0),assignedTo:s.assigned_to,assignedUntil:s.assigned_until,onSubmitAttempt:()=>U(!0)})]}),e.jsx(Yt,{esc:s,schema:S,envelope:O,payload:z,resolver:Ge,triage:Ye??null,hasAI:Ne,claimed:H,claimedByMe:w,isTerminal:L,isBuilder:k,traceUrl:A,open:_,noGutter:se}),e.jsx(jt,{open:p,onClose:()=>f(!1),onConfirm:Ze,isPending:j.isPending,error:j.error})]})}export{Es as EscalationDetailPage};
|
|
5
|
+
//# sourceMappingURL=index-BTrN5iqE.js.map
|