import{__assign as e}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import r from"react";import{FileText as o,ChevronUp as t,ChevronDown as l}from"lucide-react";import{CognitiveDecisioningCard as a}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as p}from"./_svg/ButtonCognitiveIcon.js";var d=function(d){var s=d.data,c=d.cardMdComponents,g=r.useState(!0),x=g[0],m=g[1],u=r.useState({}),f=u[0],h=u[1];return i("span",e({style:{display:"inline",verticalAlign:"middle",marginLeft:"4px"}},{children:[i("button",e({onClick:function(){return m(!x)},style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px 4px",borderRadius:"8px",border:"none",backgroundColor:"#F5F3FF",color:"#6D28D9",fontWeight:500,fontSize:"14px",cursor:"pointer"}},{children:[n(o,{size:15}),n("span",{children:"View Identified Details"}),n(x?t:l,{size:16})]})),x&&i("div",e({style:{position:"relative",zIndex:10,marginTop:"8px",marginBottom:"8px",width:"100%",minWidth:"300px",border:"1px solid #F1F5F9",borderRadius:"8px",backgroundColor:"#FFFFFF",padding:"12px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}},{children:[n("div",e({style:{fontSize:"14px",fontWeight:600,color:"#475569",marginBottom:"4px"}},{children:s.title})),n("div",e({style:{backgroundColor:"#F8FAFC",borderRadius:"8px",padding:"12px",display:"flex",flexDirection:"column",gap:"12px"}},{children:s.fields.map(function(r,o){var d=f[o];return i("div",e({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:[i("div",e({style:{fontSize:"14px",color:"#1E293B",lineHeight:"1.6",fontWeight:400}},{children:[i("span",{children:[o+1,". ",r.label]}),r.reasoning&&i("span",e({onClick:function(i){i.stopPropagation(),h(function(i){var n;return e(e({},i),((n={})[o]=!i[o],n))})},style:{display:"inline-flex",alignItems:"center",gap:"2px",marginLeft:"6px",cursor:"pointer",verticalAlign:"middle"}},{children:[n(p,{size:18}),n(d?t:l,{size:12,color:"#667085"})]}))]})),r.reasoning&&d&&n("div",e({style:{width:"100%"}},{children:n(a,{headerIcon:n(p,{}),reasoning:r.reasoning.reason.replace(/\\n/g,"\n"),gap:r.reasoning.gap,score:r.reasoning.score,isOpen:!0,onToggle:function(){return h(function(i){var n;return e(e({},i),((n={})[o]=!1,n))})},hideTrigger:!0,mdComponents:c,styles:{pill:{gap:"2px",border:"none",backgroundColor:"transparent"}}})}))]}),o)})}))]}))]}))};export{d as ViewIdentifiedFieldsCard};
//# sourceMappingURL=ViewIdentifiedFieldsCard.js.map
