import{t as e}from"./vendor-react-CAGJwf-T.js";import{T as t,w as n}from"./index-Z_bdWDpJ.js";import{t as r}from"./Checkbox-UUky2spk.js";import{n as i}from"./Field-DvjOkvYd.js";var a=e(),o=[{value:`manual`,label:`Manual`},{value:`automatic`,label:`Automatic`},{value:`scheduled`,label:`Scheduled`},{value:`event_based`,label:`Event Based`}];function s({title:e,children:t}){return(0,a.jsxs)(`section`,{className:`py-4 first:pt-0 last:pb-0`,children:[(0,a.jsx)(`h3`,{className:`mb-3 text-[12px] font-semibold uppercase tracking-[0.04em] text-[var(--color-text-secondary)]`,children:e}),t]})}function c({value:e,onChange:c,errors:l={},modelOptions:u,modelsLoading:d,codeMode:f=`hidden`}){return(0,a.jsxs)(`div`,{className:`divide-y divide-[var(--color-border-light)]`,children:[(0,a.jsx)(s,{title:`Basics`,children:(0,a.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,a.jsx)(t,{label:`Workflow Name *`,value:e.workflow_name,onChange:e=>c(`workflow_name`,e.target.value),placeholder:`e.g. Loan Application Approval`,error:l.workflow_name}),f===`readonly`&&(0,a.jsx)(t,{label:`Workflow Code`,value:e.workflow_code,disabled:!0,hint:`Auto-generated; cannot be changed.`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(i,{htmlFor:`content_type`,children:`Business Object *`}),(0,a.jsx)(n,{id:`content_type`,value:e.content_type,onChange:e=>c(`content_type`,e),options:u,placeholder:d?`Loading…`:`Select business object`,searchable:!0,error:l.content_type,hint:`The model this workflow applies to.`})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(i,{htmlFor:`trigger_type`,children:`Trigger Type`}),(0,a.jsx)(n,{id:`trigger_type`,value:e.trigger_type,onChange:e=>c(`trigger_type`,e),options:o})]})]})}),(0,a.jsx)(s,{title:`SLA & Escalation`,children:(0,a.jsxs)(`div`,{className:`grid grid-cols-1 items-end gap-4 md:grid-cols-3`,children:[(0,a.jsx)(t,{label:`SLA (hours)`,type:`number`,value:e.sla_hours,onChange:e=>c(`sla_hours`,e.target.value),placeholder:`e.g. 24`}),(0,a.jsx)(t,{label:`Escalate after (hours)`,type:`number`,value:e.escalation_hours,onChange:e=>c(`escalation_hours`,e.target.value),placeholder:`e.g. 8`,disabled:!e.enable_escalation}),(0,a.jsx)(`div`,{className:`pb-2.5`,children:(0,a.jsx)(r,{label:`Enable escalation`,checked:e.enable_escalation,onChange:e=>c(`enable_escalation`,e.target.checked)})})]})})]})}export{c as t};