PageSourceSearch

https://www.getdarby.com/_next/static/chunks/56145-5ac2b2346f56bce5.js?dpl=dpl_8jkdVgTMcKnfKLYtwCq35MXqnPbZ

js getdarby.com collected 2026-10-04 05:50:44 UTC 24,102 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56145],{32419:(e,t,r)=>{r.d(t,{A:()=>n});var s=r(68987);let a={start:{fill:"#EEF2F5",stroke:"#64748B",text:"#1F2937"},step:{fill:"#F1F5F9",stroke:"#64748B",text:"#1F2937"},decision:{fill:"#EAEAFB",stroke:"#534AB7",text:"#312E81"},exception:{fill:"#FBEAE2",stroke:"#993C1D",text:"#7C2D12"},terminal:{fill:"#DDF3EB",stroke:"#0F6E56",text:"#065F46"}};function l(e,t,r){let s=t-e.x,a=r-e.y;if(0===s&&0===a)return{x:e.x,y:e.y};let l=Math.min(0!==s?92/Math.abs(s):1/0,0!==a?28/Math.abs(a):1/0);return{x:e.x+s*l,y:e.y+a*l}}function n(e){let{nodes:t=[],edges:r=[],lit:n=!1,scale:i=1,currentNodeId:d=null,selectedNodeId:o=null,onNodeSelect:c=null,ruleBadges:x=null}=e;if(!t.length)return(0,s.jsx)("div",{className:"text-[12px] text-gray-500 py-6 text-center",children:"No workflow graph to display."});let h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.map(e=>({...e})),s=t.map(e=>({...e}));if(!r.length)return{nodes:r,edges:s,viewBox:{minX:0,minY:0,width:1,height:1},NODE_W:184,NODE_H:56};let a={};r.forEach(e=>{a[e.id]=e});let l=function(e,t){let r={};return e.forEach(e=>{r[e.id]=[]}),t.forEach(e=>{r[e.to_node_id]&&r[e.to_node_id].push(e)}),r}(r,s);r.forEach(e=>{e._branch=function(e,t){if("exception"===e.node_type)return!0;if("terminal"===e.node_type){let r=t[e.id]||[];if(r.length&&r.every(e=>"skip"===e.edge_type))return!0}return!1}(e,l)});let n=new Set(r.filter(e=>!e._branch).map(e=>e.id)),i=s.filter(e=>"loopback"!==e.edge_type&&n.has(e.from_node_id)&&n.has(e.to_node_id)),d={};r.forEach(e=>{e._branch||(d[e.id]=0)});let o=!0,c=0;for(;o&&c++<2e3;)for(let e of(o=!1,i)){let t=Math.min((d[e.from_node_id]||0)+1,r.length);t>(d[e.to_node_id]||0)&&(d[e.to_node_id]=t,o=!0)}let x={};r.filter(e=>!e._branch).forEach(e=>{(x[d[e.id]]=x[d[e.id]]||[]).push(e)}),Object.keys(x).forEach(e=>{x[e].sort((e,t)=>(e.sort_order||0)-(t.sort_order||0)).forEach((t,r)=>{t.x=320+324*r,t.y=38+108*Number(e)+28})});let h={};r.filter(e=>e._branch).forEach(e=>{let t=(l[e.id]||[]).filter(e=>"loopback"!==e.edge_type&&n.has(e.from_node_id)),r=t.length?a[t[0].from_node_id]:null,s=r?r.id:"none";(h[s]=h[s]||[]).push({n:e,anchor:r})});let p=r.filter(e=>!e._branch);Object.values(h).forEach(e=>{e.forEach((e,t)=>{let{n:r,anchor:s}=e,a=s?s.x:320,l=s?s.y:66;r.x=a+324,r.y=l+0+90*t;let n=0;for(;n++<20&&p.some(e=>184>Math.abs(e.x-r.x)&&56>Math.abs(e.y-r.y));)r.x+=324;p.push(r)})});let m=0,u=Math.min(...r.filter(e=>!e._branch).map(e=>e.x))-92;s.forEach(e=>{let t=a[e.from_node_id],r=a[e.to_node_id];if(e._route="straight",!t||!r)return;if("loopback"===e.edge_type){e._route="loopback";return}if(t._branch||r._branch){e._route="branch";return}let s=12>Math.abs(t.x-r.x),l=Math.abs((d[r.id]||0)-(d[t.id]||0));if(s&&l>1){e._route="bypass",e._laneX=u-38-46*m,m+=1;let s=t.x-92,a=r.x-92;e._points=[[s,t.y],[e._laneX,t.y],[e._laneX,r.y],[a,r.y]],e._labelX=e._laneX-8,e._labelY=(t.y+r.y)/2}});let g=Math.min(...r.map(e=>e.x-92)),f=Math.max(...r.map(e=>e.x+92)),y=s.filter(e=>"bypass"===e._route).reduce((e,t)=>Math.min(e,t._laneX),1/0),b=Math.min(g,isFinite(y)?y-58:1/0)-8,j=Math.min(...r.map(e=>e.y-28))-38,v=Math.max(...r.map(e=>e.y+28))+36;return{nodes:r,edges:s,viewBox:{minX:b,minY:j,width:Math.max(1,f+44-b),height:Math.max(1,v-j)},NODE_W:184,NODE_H:56}}(t,r),p=h.nodes,m=h.edges,u=h.viewBox,g={};return p.forEach(e=>{g[e.id]=e}),(0,s.jsxs)("svg",{viewBox:u.minX+" "+u.minY+" "+u.width+" "+u.height,width:Math.round(u.width*i),height:Math.round(u.height*i),role:"img","aria-label":"Workflow diagram",children:[(0,s.jsx)("defs",{children:(0,s.jsx)("marker",{id:"wf-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6.5",markerHeight:"6.5",orient:"auto-start-reverse",children:(0,s.jsx)("path",{d:"M2 1L8 5L2 9",fill:"none",stroke:"#64748B",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),m.map((e,t)=>{let r=g[e.from_node_id],a=g[e.to_node_id];if(!r||!a)return null;let n=l(r,a.x,a.y),i=l(a,r.x,r.y),d,o,c,x="middle";if("loopback"===e._route){let e={x:r.x-33.12,y:r.y-28},t={x:a.x+55.199999999999996,y:a.y-28},s=(e.x+t.x)/2,l=Math.min(e.y,t.y)-42;d="M"+e.x+" "+e.y+" Q"+s+" "+l+" "+t.x+" "+t.y,o=s,c=l-3}else"bypass"===e._route&&Array.isArray(e._points)?(d="M"+e._points.map(e=>e[0]+" "+e[1]).join(" L"),o=e._labelX,c=e._labelY,x="end"):"branch"===e._route?(d="M"+n.x+" "+n.y+" L"+i.x+" "+i.y,o=(n.x+i.x)/2,c=Math.min(n.y,i.y)-9):(d="M"+n.x+" "+n.y+" L"+i.x+" "+i.y,o=(n.x+i.x)/2,c=(n.y+i.y)/2+4);let h="loopback"===e._route;return(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d:d,fill:"none",stroke:h?"#B9A79E":"#8794A6",strokeWidth:"1.6",strokeDasharray:h?"5 3":"0",markerEnd:"url(#wf-arrow)"}),e.label&&(0,s.jsx)("text",{x:o,y:c,textAnchor:x,fontSize:"11.5",fontWeight:"600",fill:"#334155",stroke:"#ffffff",strokeWidth:"3.5",paintOrder:"stroke",strokeLinejoin:"round",children:e.label})]},"e"+t)}),p.map(e=>{let t=a[e.node_type]||a.step,r=n&&0===(e.order_count||0),l=d&&e.id===d||o&&e.id===o,i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:22,r=(e||"").toString();if(r.length<=t)return[r];let s=r.lastIndexOf(" ",t);return s<=0?[r.slice(0,t),r.slice(t)]:[r.slice(0,s),r.slice(s+1)]}(e.label),h=e.x-92,p=e.y-28;return(0,s.jsxs)("g",{onClick:c?()=>c(e):void 0,style:{cursor:c?"pointer":"default",opacity:r?.6:1},children:[(0,s.jsx)("title",{children:e.label+(e.owner_role?" ("+e.owner_role+")":"")}
1),(0,s.jsx)("rect",{x:h,y:p,width:184,height:56,rx:"10",fill:t.fill,stroke:l?"#0F6E56":t.stroke,strokeWidth:l?2.8:1.2}),i.map((r,a)=>(0,s.jsx)("text",{x:e.x,y:e.y+(1===i.length?5:0===a?-4:13),textAnchor:"middle",fontSize:"13",fontWeight:"600",fill:t.text,children:r},a)),n&&(e.order_count||0)>0&&(0,s.jsxs)("g",{children:[(0,s.jsx)("circle",{cx:h+184-2,cy:p+2,r:"12.5",fill:"#0F6E56",stroke:"#ffffff",strokeWidth:"1.5"}),(0,s.jsx)("text",{x:h+184-2,y:p+6,textAnchor:"middle",fontSize:"12.5",fontWeight:"700",fill:"#fff",children:e.order_count})]}),x&&x[e.id]&&x[e.id].count>0&&(0,s.jsxs)("g",{children:[(0,s.jsx)("title",{children:x[e.id].count+" org rule"+(1===x[e.id].count?"":"s")+" bound"+(x[e.id].gate?" (gate: can hold advances while enforcement is on)":"")}),x[e.id].gate&&(0,s.jsx)("circle",{cx:h+2,cy:p+56-2,r:"14.5",fill:"none",stroke:"#DC2626",strokeWidth:"1.4",opacity:"0.45"}),(0,s.jsx)("circle",{cx:h+2,cy:p+56-2,r:"10.5",fill:x[e.id].gate?"#DC2626":"#0D9488",stroke:"#ffffff",strokeWidth:"1.5"}),(0,s.jsx)("text",{x:h+2,y:p+56+1.5,textAnchor:"middle",fontSize:"10.5",fontWeight:"700",fill:"#fff",children:"R"+(x[e.id].count>1?x[e.id].count:"")})]})]},e.id)})]})}},56145:(e,t,r)=>{r.d(t,{A:()=>o});var s=r(68987),a=r(2315),l=r(32419),n=r(75653);let i={CRT:"Complex rehab",op_repair:"O&P repair",fulfillment:"Fulfillment"},d={start:"#64748B",step:"#64748B",decision:"#534AB7",exception:"#993C1D",terminal:"#0F6E56"};function o(e){let t,{workflowType:r="CRT",lit:o=!1,title:c="Workflow",types:x=null,split:h=!1,defaultOpen:p=!0}=e,[m,u]=(0,a.useState)(r),[g,f]=(0,a.useState)(null),[y,b]=(0,a.useState)([]),[j,v]=(0,a.useState)(!0),[_,w]=(0,a.useState)(null),[N,k]=(0,a.useState)(p),[E,S]=(0,a.useState)(null),[A,C]=(0,a.useState)(null),[M,F]=(0,a.useState)(1),[D,O]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!N)return;let e=!1;return(async()=>{v(!0),w(null),S(null);try{let t=(o?"/api/workflow/board?workflowType=":"/api/workflow/diagram?workflowType=")+encodeURIComponent(m),r=await fetch(t),s=await r.json();if(e)return;if(s&&s.ok?f({nodes:s.nodes||[],edges:s.edges||[]}):(f(null),w(s&&s.error||"No workflow graph yet")),O(null),s&&s.ok&&s.version&&s.version.id)try{let t=await fetch("/api/workflow/bindings?versionId="+encodeURIComponent(s.version.id)),r=await t.json();if(!e&&r&&r.ok&&Array.isArray(r.bindings)&&r.bindings.length){let e={};for(let t of r.bindings){if(!t.node_id)continue;let r=e[t.node_id]||{count:0,gate:!1};r.count+=1,"gate"===t.role&&(r.gate=!0),e[t.node_id]=r}O(e)}}catch(e){}if(o&&h)try{let t=await fetch("/api/workflow?status=active&workflowType="+encodeURIComponent(m)),r=await t.json();e||b(r&&r.ok&&r.workflows||[])}catch(t){e||b([])}}catch(t){e||(w(t.message),f(null))}finally{e||v(!1)}})(),()=>{e=!0}},[N,m,o,h]);let R=g&&g.nodes||[],W=o?R.reduce((e,t)=>e+(t.order_count||0),0):null,B=y.filter(e=>e.stall&&e.stall.stalled).length,L=e=>({background:e+"22",border:"1px solid "+e});(0,a.useEffect)(()=>{if(!E)return void C(null);let e=y.filter(e=>e.current_stage_key===E.node_key);C(e.length?e[0].order_id:null)},[E,y]);let I=(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("button",{onClick:()=>F(e=>Math.max(.6,+(e-.2).toFixed(2))),className:"w-6 h-6 rounded border border-gray-200 text-gray-600 hover:bg-gray-50 text-[13px] leading-none",children:"-"}),(0,s.jsxs)("span",{className:"text-[10.5px] text-gray-500 w-9 text-center",children:[Math.round(100*M),"%"]}),(0,s.jsx)("button",{onClick:()=>F(e=>Math.min(1.8,+(e+.2).toFixed(2))),className:"w-6 h-6 rounded border border-gray-200 text-gray-600 hover:bg-gray-50 text-[13px] leading-none",children:"+"})]}),T=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-[10.5px] text-gray-500",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm align-middle mr-1",style:L(d.step)}),"Step"]}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm align-middle mr-1",style:L(d.decision)}),"Decision"]}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm align-middle mr-1",style:L(d.exception)}),"Exception"]}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm align-middle mr-1",style:L(d.terminal)}),"Terminal"]}),D&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-full align-middle mr-1",style:{background:"#0D9488"}}),"Rule bound"]}
1),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-full align-middle mr-1",style:{background:"#DC2626"}}),"Gate rule"]})]})]}),P=(0,s.jsx)("div",{className:"rounded-lg border border-gray-200 bg-gray-50/60 overflow-auto",style:{maxHeight:h?620:560},children:(0,s.jsx)("div",{className:"p-3 min-w-min",children:(0,s.jsx)(l.A,{nodes:R,edges:g?g.edges:[],lit:o,scale:M,selectedNodeId:E?E.id:null,onNodeSelect:h?e=>S(e):null,ruleBadges:D})})}),X=(0,s.jsxs)("div",{className:"w-full md:w-[340px] shrink-0 flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,s.jsx)("span",{className:"text-[12px] font-semibold text-gray-800",children:"Active orders"}),(0,s.jsx)("span",{className:"text-[18px] font-bold text-gray-900",children:W||0})]}),B>0&&(0,s.jsxs)("div",{className:"text-[11px] text-amber-700 mt-0.5",children:[B," stalled"]})]}),(0,s.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-2 overflow-auto",style:{maxHeight:320},children:[(0,s.jsx)("div",{className:"text-[10.5px] uppercase tracking-wide text-gray-400 px-1 pb-1",children:"Steps"}),R.map(e=>{let t=e.order_count||0,r=E&&E.id===e.id;return(0,s.jsxs)("button",{onClick:()=>S(e),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded text-left "+(r?"bg-slate-100":"hover:bg-gray-50"),children:[(0,s.jsx)("span",{className:"inline-block w-2 h-2 rounded-sm shrink-0",style:L(d[e.node_type]||d.step)}),(0,s.jsx)("span",{className:"text-[11.5px] text-gray-700 flex-1 truncate",children:e.label}),t>0&&(0,s.jsx)("span",{className:"text-[10.5px] font-semibold text-white bg-teal-700 rounded-full px-1.5 min-w-[18px] text-center",children:t})]},e.id)})]}),E&&(0,s.jsx)("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:(0,s.jsx)(n.A,{workflowType:m,nodeId:E.id,orderId:A,orderOptions:(t=E.node_key,y.filter(e=>e.current_stage_key===t)).map(e=>({order_id:e.order_id,label:"Order "+String(e.order_id||"").slice(0,8)})),onPickOrder:C})})]});return(0,s.jsxs)("div",{className:"rounded-xl border border-gray-200 bg-white p-4 mb-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[14px] font-semibold text-gray-800",children:c}),o&&null!=W&&(0,s.jsxs)("span",{className:"text-[11px] text-gray-500",children:[W," active order",1===W?"":"s"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[x&&x.map(e=>(0,s.jsx)("button",{onClick:()=>{u(e),S(null)},className:"text-[11px] rounded-full px-2.5 py-1 "+(m===e?"bg-slate-800 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:i[e]||e},e)),N&&g&&I,(0,s.jsx)("button",{onClick:()=>k(e=>!e),className:"text-[11px] text-gray-500 hover:text-gray-700",children:N?"Hide":"Show"})]})]}),N&&(0,s.jsxs)(s.Fragment,{children:[j&&(0,s.jsx)("div",{className:"text-[12px] text-gray-400 py-8 text-center",children:"Loading workflow..."}),!j&&_&&(0,s.jsx)("div",{className:"text-[12px] text-gray-500 py-8 text-center",children:_}),!j&&g&&(0,s.jsxs)(s.Fragment,{children:[h?(0,s.jsxs)("div",{className:"flex flex-col md:flex-row gap-4 items-start",children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:P}),X]}):P,(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[T,o&&(0,s.jsx)("span",{className:"text-[10.5px] text-gray-500",children:"The number on a step is how many active orders sit there now."})]})]})]})]})}},75653:(e,t,r)=>{r.d(t,{A:()=>d});var s=r(68987),a=r(2315);let l={human_verification:"Human verified",payer_echo:"Payer echo",cross_document:"Cross document",single_document:"Single document",model_inference:"Model inference",manual:"Manual"},n={pass:{text:"PASS",cls:"text-green-700 bg-green-50 border-green-100"},fail:{text:"HOLD",cls:"text-red-700 bg-red-50 border-red-100"},cannot_determine:{text:"NEEDS A PERSON",cls:"text-gray-600 bg-gray-50 border-gray-200"}};function i(e){return String(e||"").slice(0,8)}function d(e){let{workflowType:t="CRT",nodeId:r=null,nodeKey:d=null,versionId:o=null,orderId:c=null,orderOptions:x=[],onPickOrder:h=null}=e,[p,m]=(0,a.useState)(null),[u,g]=(0,a.useState)(!0),[f,y]=(0,a.useState)(null);if((0,a.useEffect)(()=>
1{if(!r&&!d)return;let e=!1;return(async()=>{g(!0),y(null);try{let s=new URLSearchParams;s.set("workflowType",t),r&&s.set("nodeId",r),d&&s.set("nodeKey",d),o&&s.set("versionId",o),c&&s.set("orderId",c);let a=await fetch("/api/workflow/explain?"+s.toString()),l=await a.json();if(e)return;l&&l.ok?m(l):(m(null),y(l&&l.error||"Could not explain this step"))}catch(t){e||(y("Could not explain this step"),m(null))}finally{e||g(!1)}})(),()=>{e=!0}},[t,r,d,o,c]),u)return(0,s.jsx)("div",{className:"text-[11px] text-gray-400 py-3",children:"Reading this step..."});if(f)return(0,s.jsx)("div",{className:"text-[11px] text-gray-500 py-3",children:f});if(!p)return null;let b=p.decision,j=p.authority&&p.authority.tier,v=b&&b.verdict?n[b.verdict]:null,_=p.coverage,w=p.orgRules||[];return(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,s.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-wide text-slate-600 bg-slate-100 rounded-full px-2 py-0.5",children:p.node.node_type}),j&&(0,s.jsx)("span",{className:"text-[10px] font-bold rounded-full px-2 py-0.5 bg-blue-50 text-blue-800 border border-blue-100",children:l[j]||j})]}),(0,s.jsx)("div",{className:"text-[13px] font-semibold text-gray-900",children:p.node.label}),(0,s.jsx)("div",{className:"text-[11.5px] text-gray-600 leading-relaxed",children:p.plain}),(p.node.owner_role||null!=p.node.expected_days)&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[p.node.owner_role&&(0,s.jsxs)("span",{className:"text-[10.5px] rounded-full px-2 py-0.5 bg-gray-50 text-gray-700 border border-gray-200",children:["Owner: ",p.node.owner_role]}),null!=p.node.expected_days&&(0,s.jsxs)("span",{className:"text-[10.5px] rounded-full px-2 py-0.5 bg-gray-50 text-gray-700 border border-gray-200",children:["Target: ",p.node.expected_days," day",1===p.node.expected_days?"":"s"]})]}),p.routes&&(p.routes.out||[]).length>0&&(0,s.jsxs)("div",{className:"text-[10.5px] text-gray-600",children:[(0,s.jsx)("span",{className:"text-gray-400",children:"Routes: "}),p.routes.out.map((e,t)=>(0,s.jsxs)("span",{children:[t>0?" \xb7 ":"",e.label,e.to_label?" → "+e.to_label:""]},t))]}),p.routes&&(p.routes.in||[]).length>0&&(0,s.jsxs)("div",{className:"text-[10px] text-gray-400",children:["Reached from ",p.routes.in.map(e=>e.from_label).filter(Boolean).join(", ")||"the workflow start","."]}),b&&b.manual&&(0,s.jsx)("div",{className:"text-[11px] text-gray-500 bg-gray-50 border border-gray-200 rounded p-2",children:"This decision is a manual choice. There is no automatic suggestion."}),b&&!b.manual&&(0,s.jsxs)(s.Fragment,{children:[x&&x.length>0&&(0,s.jsxs)("div",{className:"flex items-center gap-2 bg-gray-50 border border-gray-200 rounded px-2 py-1.5",children:[(0,s.jsx)("span",{className:"text-[10.5px] text-gray-500",children:"On order"}),(0,s.jsxs)("select",{value:c||"",onChange:e=>h&&h(e.target.value),className:"text-[11px] border border-gray-300 rounded px-1.5 py-0.5 bg-white flex-1",children:[!c&&(0,s.jsx)("option",{value:"",children:"Choose an order..."}),x.map(e=>(0,s.jsx)("option",{value:e.order_id,children:e.label||i(e.order_id)},e.order_id))]})]}),v?(0,s.jsxs)("div",{className:"rounded-lg border p-2 text-center "+v.cls,children:[(0,s.jsx)("div",{className:"text-[15px] font-bold",children:v.text}),b.branch&&b.branch.to_label&&(0,s.jsxs)("div",{className:"text-[10.5px] mt-0.5 opacity-90",children:["Would go to ",b.branch.to_label]})]}):(0,s.jsx)("div",{className:"text-[11px] text-gray-500",children:"Pick an order to see the result on it."}),b.evidence&&b.evidence.summary&&(0,s.jsxs)("div",{className:"text-[11px] text-gray-700",children:[(0,s.jsx)("span",{className:"text-gray-400",children:"Evidence: "}),b.evidence.summary]}),Array.isArray(b.reads)&&b.reads.length>0&&(0,s.jsxs)("div",{className:"text-[10.5px] text-gray-500",children:["Reads ",b.reads.join("; "),"."]})]}),p.authority&&Array.isArray(p.authority.anchors)&&p.authority.anchors.length>0&&(0,s.jsx)("div",{className:"text-[10.5px] text-gray-600",children:p.authority.anchors.map((e,t)=>(0,s.jsxs)("div",{className:"flex gap-1.5",children:[(0,s.jsx)("span",{className:"text-teal-600",children:"✓"}),(0,s.jsx)("span",{children:e.text})]},t))}),(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[p.definition&&p.definition_editable&&(0,s.jsx)("a",{href:"/?tab=settings&wf_def="+encodeURIComponent(p.definition.id),className:"inline-block text-[10.5px] font-semibold text-slate-700 hover:text-slate-900 hover:underline",children:"Edit this step in the builder →"}),p.definition&&!p.definition_editable&&p.version&&p.version.id&&(0,s.jsx)("a",{href:"/?tab=settings&wf_clone="+encodeURIComponent(p.version.id)+"&wf_name="+encodeURIComponent((p.definition.name||"Workflow")+" (custom)"),className:"inline-block text-[10.5px] font-semibold text-slate-700 hover:text-slate-900 hover:underline",title:"Darby templates cannot be edited directly. This copies the workflow into your own custom version and opens the editor.",children:"Tweak as a new custom workflow →"}),"decision"===p.node.node_type&&(0,s.jsx)("a",{href:"/logic-studio?pane=author",className:"inline-block text-[10.5px] font-semibold text-slate-700 hover:text-slate-900 hover:underline",children:"Author a rule for this step in Logic Studio →"})]}),(0,s.jsxs)("div",{className:"border-t border-gray-100 pt-2",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-gray-400 mb-1",children:"Orders held here"}),(0,s.jsx)("div",{className:"text-[12px] font-semibold text-gray-800",children:p.held.count}),p.held.sample&&p.held.sample.length>0&&(0,s.jsx)("div",{className:"mt-1 space-y-0.5",children:p.held.sample.map(e=>(0,s.jsxs)("button",{onClick:()=>h&&h(e.order_id),className:"block text-[10.5px] text-gray-600 hover:text-teal-700",children:["Order ",i(e.order_id)]},e.order_id))})]}),b&&!b.manual&&p.track&&(0,s.jsxs)("div",{className:"border-t border-gray-100 pt-2",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-gray-400 mb-1",children:"Decisions recorded here"}),(0,s.jsxs)("div",{className:"text-[11px] text-gray-700",children:[p.track.recorded," total \xb7 ",p.track.outcome_mix.pass," advanced \xb7 ",p.track.outcome_mix.fail," held \xb7 ",p.track.outcome_mix.cannot_determine," to a person"]})]}),b&&!b.manual&&Array.isArray(b.sources)&&b.sources.length>0&&(0,s.jsxs)("div",{className:"border-t border-gray-100 pt-2",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-gray-400 mb-1",children:"Sources"}),b.sources.map((e,t)=>(0,s.jsx)("div",{className:"text-[10.5px] text-gray-500 leading-snug",children:e.text},t))]}),Array.isArray(w)&&w.length>0&&(0,s.jsxs)("div",{className:"border-t border-gray-100 pt-2",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-gray-400 mb-1",children:"Org rules on this step"}),w.map(e=>(0,s.jsxs)("div",{className:"text-[11px] text-gray-700 flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"truncate",children:e.rule?e.rule.name:e.rqe_rule_id}),(0,s.jsx)("span",{className:"text-[9.5px] font-bold uppercase shrink-0 "+("gate"===e.role?"text-red-700":"text-teal-700"),children:e.role})]},e.id)),p.gate&&p.gate.enabled?(0,s.jsxs)("div",{className:"mt-1.5 rounded border border-gray-200 bg-gray-50 p-2",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-gray-400 mb-1",children:"Routing gate on this order"}),0===(p.gate.verdicts||[]).length?(0,s.jsx)("div",{className:"text-[10.5px] text-gray-500",children:"No published gate rules; nothing blocks."}):(p.gate.verdicts||[]).map((e,t)=>(0,s.jsxs)("div",{className:"text-[10.5px] flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-gray-700 truncate",children:e.name||e.rule_id}),(0,s.jsx)("span",{className:"font-bold shrink-0 "+("PASS"===e.verdict?"text-green-700":"FAIL"===e.verdict?"text-red-700":"text-gray-500"),children:"PASS"===e.verdict?"ALLOWS":"FAIL"===e.verdict?"HOLDS":"NEEDS A PERSON"})]},t)),(0,s.jsx)("div",{className:"text-[9.5px] text-gray-400 mt-1",children:"A holding gate blocks advancing moves only; exception and loopback routes stay open."})]}):(0,s.jsx)("div",{className:"text-[10px] text-gray-400 mt-1",children:"Gate bindings enforce when the enforcement master switch is on; suggest and advisory bindings only surface here."})]}),_&&_.evaluated&&(0,s.jsxs)("div",{className:"border-t border-gray-100 pt-2",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-gray-400 mb-1",children:"Coverage rules for this order"}),(0,s.jsxs)("div",{className:"text-[11px] text-gray-700 mb-1.5",children:[(0,s.jsx)("span",{className:"font-semibold",children:_.status}),(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",_.summary.passed," pass \xb7 ",_.summary.failed," fail \xb7 ",_.summary.skipped," skip"]})]}),(0,s.jsx)("div",{className:"space-y-1 max-h-48 overflow-auto",children:_.rules.slice(0,12).map((e,t)=>(0,s.jsxs)("div",{className:"text-[10.5px]",children:[(0,s.jsx)("span",{className:"font-bold "+("PASS"===e.result?"text-green-700":"FAIL"===e.result?"text-red-700":"text-gray-500"),children:e.result}),(0,s.jsxs)("span",{className:"text-gray-700",children:[" ",e.rule_id]}),e.evidence&&(0,s.jsxs)("span",{className:"text-gray-500",children:[" \xb7 ",e.evidence]}),e.citation&&(0,s.jsx)("div",{className:"text-teal-700 text-[9.5px]",children:e.citation})]},t))}),_.rules.length>12&&(0,s.jsxs)("div",{className:"text-[10px] text-gray-400 mt-1",children:["Showing 12 of ",_.rules.length," rules."]})]})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.