"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),i=require("@mui/material"),r=require("lucide-react");exports.GapExplanationAccordion=function(s){var t=s.explanation,l=s.onProceed,p=s.isSelected,a=s.proceedIcon,c=o.useState(!0),x=c[0],d=c[1],u=o.useState(!1),g=u[0],h=u[1],f=Array.isArray(t)?t:"string"==typeof t&&""!==t.trim()?[t]:[],_=f.length>2,y=g?f:f.slice(0,2);return n.jsxs(i.Box,e.__assign({sx:{bgcolor:"#FFFFFF"}},{children:[n.jsxs(i.Box,e.__assign({onClick:function(){return d(!x)},sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:"16px",pb:"12px",cursor:"pointer"}},{children:[n.jsx(i.Typography,e.__assign({sx:{fontWeight:500,fontSize:"14px",color:"#101828"}},{children:"Explanation"})),x?n.jsx(r.ChevronUp,{size:16,color:"#667085"}):n.jsx(r.ChevronDown,{size:16,color:"#667085"})]})),n.jsx(i.Collapse,e.__assign({in:x},{children:n.jsxs(i.Box,e.__assign({sx:{px:"16px",pb:"16px"}},{children:[n.jsx(i.Box,e.__assign({component:"ol",sx:{m:0,pl:"20px",display:"flex",flexDirection:"column",gap:"8px"}},{children:(y||[]).map(function(o,r){return n.jsx(i.Box,e.__assign({component:"li",sx:{fontSize:"14px",color:"#475467",lineHeight:"1.5",fontWeight:400}},{children:o}),r)})})),_&&n.jsx(i.Typography,e.__assign({onClick:function(){return h(!g)},sx:{fontSize:"13px",color:"#5925DC",cursor:"pointer",mt:1,fontWeight:500,display:"inline-block"}},{children:g?"show less...":"more..."})),n.jsxs("button",e.__assign({onClick:function(e){e.stopPropagation(),p||l()},disabled:p,style:{marginTop:"16px",display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",backgroundColor:p?"#F2F4F7":"#F4F3FF",color:p?"#667085":"#5925DC",border:"none",borderRadius:"8px",fontWeight:500,fontSize:"12px",cursor:p?"default":"pointer",transition:"all 0.2s"}},{children:[p?"Option is already selected":"Proceed with this option",a]}))]}))}))]}))};
//# sourceMappingURL=GapExplanationAccordion.js.map
