ai-ebm-assistant-v4 1.3.0 → 1.4.0
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/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -77236,7 +77236,7 @@ Evidence: ` + ua.evidence : ""}
|
|
|
77236
77236
|
disabled: fn === _n.length - 1 && (_n.length === 2 ? Tn : Sn)
|
|
77237
77237
|
}
|
|
77238
77238
|
),
|
|
77239
|
-
fn === 1 && _n.length
|
|
77239
|
+
fn === 1 && _n.length > 1 && /* @__PURE__ */ jsx$3(Tooltip$2, { title: "Download as Excel", children: /* @__PURE__ */ jsx$3(
|
|
77240
77240
|
IconButton,
|
|
77241
77241
|
{
|
|
77242
77242
|
onClick: Aa,
|
package/dist/index.umd.js
CHANGED
|
@@ -722,7 +722,7 @@ Ref: `+dr.reference:""}
|
|
|
722
722
|
Evidence: `+dr.evidence:""}
|
|
723
723
|
${dr.purpose?`
|
|
724
724
|
`+dr.purpose:""}`])}),Jn.push(["",""])),Array.isArray(xr.patientEducationLifestyle)&&(Jn.push(["Patient Education / Lifestyle",""]),xr.patientEducationLifestyle.forEach(dr=>{Jn.push(["",`${dr.educationTopic||""}${dr.description?`
|
|
725
|
-
`+dr.description:""}`])}),Jn.push(["",""])),Jn},Br=utils$1.book_new(),Rr=wn?.diagnosesData??wn?.diagnoses??wn??[];let hr=[];hr.push(["Diagnosis Findings",""]),hr.push(["Field","Actual Result"]),Rr.forEach((Pr,wr)=>{wr>0&&hr.push(["",""]);const xr=Qr(Pr);hr.push(["diagnosiscode",xr.diagnosiscode||""]),hr.push(["diagnosisdescription",xr.diagnosisdescription||""]),hr.push(["diagnosisclass",xr.diagnosisclass||""]),hr.push(["action",xr.action||""]),hr.push(["verificationStatus",xr.verificationStatus||""]);let Jn=xr.justification?Or(xr.justification):"";hr.push(["justification",Jn])});const Dr=utils$1.aoa_to_sheet(hr);Dr["!cols"]=[{wch:40},{wch:100}],utils$1.book_append_sheet(Br,Dr,"Diagnosis Findings");const $r=Cn??{};Object.keys($r).forEach(Pr=>{const wr=$r[Pr],xr=Zr(wr,`Recommendations - ${Pr}`),Jn=utils$1.aoa_to_sheet(xr);Jn["!cols"]=[{wch:40},{wch:100}];const Er=ar(`Recommendations - ${Pr}`);utils$1.book_append_sheet(Br,Jn,Er)});const vr=writeSync(Br,{bookType:"xlsx",type:"array"});FileSaver_minExports.saveAs(new Blob([vr],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),"diagnoses_and_recommendations.xlsx")}catch(Qr){console.error("Excel Export Error:",Qr),alert("Failed to download Excel.")}},yr=React__namespace.useMemo(()=>{const Qr=_n?.length===2?Cn:kn;return{patientData:$n,potentialDiagnosis:wn?.diagnoses,diagnosisCodes:Qn,ragResponse:Qr}},[$n,wn?.diagnosesData,wn?.diagnoses,Qn,_n?.length,Cn,kn]);return React__namespace.useEffect(()=>{!!(yr?.patientData||yr?.potentialDiagnosis&&yr?.potentialDiagnosis.length>0||yr?.diagnosisCodes&&yr?.diagnosisCodes.length>0||yr?.ragResponse&&Object.keys(yr?.ragResponse||{}).length>0)&&mn(yr)},[yr,mn]),require$$2$1.jsxs(Box,{sx:{width:"100%"},children:[require$$2$1.jsxs(Box,{sx:{position:"sticky",mb:"16px",top:0,zIndex:1,padding:"12px 16px",borderRadius:2,backgroundColor:"#fff",display:"flex",width:"100%",gap:2,alignItems:"center"},children:[require$$2$1.jsx(ActionButton,{text:"Previous",onClick:Ar,sx:{minWidth:"120px"},color:"white",disabled:!dn?.step1&&hn===0,startIcon:require$$2$1.jsx(ArrowLeft,{color:"#555E68",width:"20px",height:"24px"})}),require$$2$1.jsx(Stepper,{activeStep:hn,sx:{width:"100%",marginLeft:"24px",marginRight:"24px"},children:_n.map((Qr,cr)=>{const Or={},Ir={};return require$$2$1.jsx(Step$1,{...Or,children:require$$2$1.jsx(StepLabel,{onClick:()=>sr(cr),...Ir,sx:{"& .MuiStepLabel-label":{color:cr===hn?"#32383E":"#6A7888"},"& .MuiStepIcon-root":{color:cr===hn?"#32383E":"#EDF1F5"},"& .MuiStepIcon-text":{fill:cr===hn?"#fff":"#6A7888"}},children:Qr})},Qr)})}),hn<_n.length-1?require$$2$1.jsx(ActionButton,{text:"Next",sx:{border:"none"},onClick:rr,disabled:!dn?.step1&&(hn===0&&Dn||hn===1&&Tn||hn===2&&Sn),endIcon:require$$2$1.jsx(ArrowRight,{color:!dn?.step1&&(hn===0&&Dn||hn===1&&Tn||hn===2&&Sn)?"#555E68":"#ffff",width:"20px",height:"24px"})}):require$$2$1.jsx(ActionButton,{text:"Generate Order",onClick:()=>rn(_n.length===2?Cn:kn),sx:{border:"none",minWidth:"170px"},disabled:hn===_n.length-1&&(_n.length===2?Tn:Sn)}),hn===1&&_n.length===3&&require$$2$1.jsx(Tooltip$2,{title:"Download as Excel",children:require$$2$1.jsx(IconButton,{onClick:ur,sx:{padding:"8px",color:"#0B74DE","&:hover":{backgroundColor:"#F3FAFF"}},children:require$$2$1.jsx(DownloadFileIcon,{width:20,height:20})})})]}),require$$2$1.jsx("div",{children:require$$2$1.jsx(Box,{sx:{maxHeight:"calc(100vh - 237px)",overflowY:"auto","&::-webkit-scrollbar":{width:"6px",background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#c9ced6",borderRadius:"6px"},"&::-webkit-scrollbar-track":{backgroundColor:"transparent"}},children:hn===0?require$$2$1.jsx(Grid,{container:!0,justifyContent:"space-between",flexDirection:"column",children:wn?.diagnosesData?.length>0?require$$2$1.jsx(require$$2$1.Fragment,{children:require$$2$1.jsx(Grid,{container:!0,justifyContent:"space-between",flexDirection:"column",children:require$$2$1.jsx(Grid,{item:!0,container:!0,children:(()=>{if(!wn?.diagnosesData?.length)return null;const Qr=[];wn.diagnosesData.forEach(Or=>{`${Or?.verificationStatus?Or?.verificationStatus:" "} ${Or?.verificationStatus&&Or?.action?" - ":""} ${Or?.action?Or?.action:" "}`.trim()==="LACK EVIDENCE"||Qr.push(Or)});const cr=Or=>Or.map((Ir,Yr)=>{const na=Object.values(Ir?.justification??{}).join("|| "),Zr=[...new Set(Ir?.graph_evidence?.nodes?.map(Br=>Br?.reference).filter(Boolean))].join("|| ");return require$$2$1.jsx(SingleLineOrderCard,{orderTitle:`${Ir?.diagnosiscode} - ${Ir?.diagnosisdescription}`,orderDescription:`${Ir?.verificationStatus?Ir?.verificationStatus:" "} ${Ir?.verificationStatus&&Ir?.action?" - ":""} ${Ir?.action?Ir?.action:" "}`,evidence:na,reference:Zr,feedbackMode:!1,params:Ye,checked:Ir?.checked,index:Yr,setChecked:or,diagnosisconfirmation:Ir?.diagnosisconfirmation,diagnosisAction:Ir?.action??"",setAccepted:pr,allowed:Ir.allowed,activeStep:hn,hideSelectionCheckbox:!0,isFromDiagnosisStep:!0},Yr)});return require$$2$1.jsxs(require$$2$1.Fragment,{children:[Qr.length>0&&require$$2$1.jsx(Grid,{item:!0,xs:12,children:cr(Qr)}),gn]})})()})})}):require$$2$1.jsx(require$$2$1.Fragment,{children:require$$2$1.jsx(LoadingAiOutput,{animationJson:findingDiagnosisJson,loadingsentance:Mn})})}):hn===1?require$$2$1.jsx(require$$2$1.Fragment,{children:require$$2$1.jsx(Grid,{container:!0,children:Object.keys(Cn).length!==0?require$$2$1.jsxs(require$$2$1.Fragment,{children:[Object.keys(Cn).length>1&&require$$2$1.jsx(Grid,{item:!0,xs:12,container:!0,children:require$$2$1.jsx(ToggleButton,{activeTab:Object.keys(Cn)[bn],setActiveTab:Qr=>{const cr=Object.keys(Cn).indexOf(Qr);cr!==-1&&yn(cr)},leftButtonLabel:Object.keys(Cn)[0],rightButtonLabel:Object.keys(Cn)[1],leftButtonValue:Object.keys(Cn)[0],rightButtonValue:Object.keys(Cn)[1]})}),require$$2$1.jsx(Grid,{item:!0,xs:12,mt:"16px",container:!0,children:Object.values(Cn).map((Qr,cr)=>(Object.keys(Cn).length===1||bn===cr)&&require$$2$1.jsxs("div",{children:[require$$2$1.jsx(Summary,{data:Qr?.summary}),require$$2$1.jsx(SuggestedOrders,{data:Qr,setData:tn,loadingData:nn,params:Ye,setOrderData:pn,selectedTab:Object.keys(Cn)[bn]})]},cr))})]}):require$$2$1.jsx(LoadingAiOutput,{animationJson:singleGuidelineJson,loadingsentance:jn})})}):require$$2$1.jsx(Grid,{container:!0,children:Object.keys(kn).length!==0?require$$2$1.jsxs(Grid,{container:!0,xs:12,children:[kn?.summary&&require$$2$1.jsx(Grid,{children:require$$2$1.jsx(Summary,{data:kn?.summary})}),require$$2$1.jsx(Grid,{xs:12,m:1,children:require$$2$1.jsx(SuggestedOrders,{data:kn,setData:tn,loadingData:nn,params:Ye,setOrderData:pn})}),kn?.lifeStyleAdvices?.length>0&&require$$2$1.jsx(Grid,{m:1,children:require$$2$1.jsx(EducationDescription,{data:kn,setData:tn})})]}):require$$2$1.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",flexGrow:1},children:require$$2$1.jsx(LoadingAiOutput,{animationJson:multiGuidelineJson,loadingsentance:Pn})})})})})]})}function ChiefComplaintsIcn(en){const Ye=en.width?en.width:"24",tn=en.height?en.height:"24";return require$$2$1.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Ye,height:tn,viewBox:"0 0 96 96",children:[require$$2$1.jsx("circle",{cx:48,cy:48,r:46,fill:"#eaeaea"}),require$$2$1.jsx("path",{d:"M48 2c-1.35 0-2.68.07-4 .18a46 46 0 010 91.63c1.32.11 2.65.18 4 .18A46 46 0 0048 2z",fill:"#bacece"}),require$$2$1.jsx("circle",{cx:48,cy:48,r:46,fill:"none",stroke:"#281a3b",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4px"}),require$$2$1.jsx("path",{d:"M57 58h14.63A3.38 3.38 0 0075 54.63V43.38A3.38 3.38 0 0071.63 40H57V25.38A3.38 3.38 0 0053.63 22H42.38A3.38 3.38 0 0039 25.38V40H24.37A3.38 3.38 0 0021 43.38v11.25A3.38 3.38 0 0024.37 58H39v14.63A3.38 3.38 0 0042.37 76h11.25A3.38 3.38 0 0057 72.63z",fill:"#575072"}),require$$2$1.jsx("path",{d:"M57 58h14.63A3.38 3.38 0 0075 54.63V43.38A3.38 3.38 0 0071.63 40H57V25.38A3.38 3.38 0 0053.63 22H42.38A3.38 3.38 0 0039 25.38V40H24.37A3.38 3.38 0 0021 43.38v11.25A3.38 3.38 0 0024.37 58H39v14.63A3.38 3.38 0 0042.37 76h11.25A3.38 3.38 0 0057 72.63z",fill:"#f47c6d"}),require$$2$1.jsx("path",{d:"M57 58h14.63A3.38 3.38 0 0075 54.63V43.38A3.38 3.38 0 0071.63 40H57V25.38A3.38 3.38 0 0053.63 22H42.38A3.38 3.38 0 0039 25.38V40H24.37A3.38 3.38 0 0021 43.38v11.25A3.38 3.38 0 0024.37 58H39v14.63A3.38 3.38 0 0042.37 76h11.25A3.38 3.38 0 0057 72.63z",fill:"none",stroke:"#281a3b",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4px"})]})}const InfoChiefComplaints=({data:en})=>{const Ye=useTheme$1(),[tn,nn]=React.useState(!1),rn=()=>{nn(!tn)};return require$$2$1.jsxs(Paper,{elevation:0,sx:{borderRadius:3,paddingBottom:.1},style:{backgroundColor:"#fbfbfb"},children:[require$$2$1.jsxs(Grid,{container:!0,justifyContent:"space-between",alignItems:"center",gap:1,px:2,pt:1,sx:{cursor:"pointer"},onClick:rn,children:[require$$2$1.jsx(Grid,{item:!0,children:require$$2$1.jsxs(Grid,{container:!0,alignItems:"center",gap:1,children:[require$$2$1.jsx(ChiefComplaintsIcn,{}),require$$2$1.jsx(Typography,{variant:"head2",fontSize:"14px",color:Ye?.palette?.primaryText,children:"Chief Complaints"})]})}),require$$2$1.jsx(Grid,{item:!0,bgcolor:"#ffffff",sx:{px:1.5,borderRadius:"20px",py:.5},children:require$$2$1.jsxs("p",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"12px",color:"#6A7888"},children:["All",require$$2$1.jsx(SharpFilterIcon,{})]})})]}),require$$2$1.jsx(Box,{children:en?.length>0?require$$2$1.jsx(Grid,{py:1,direction:"column",gap:2,bgcolor:"#ffffff",my:1,mx:1,borderRadius:2,children:en.map((an,on)=>require$$2$1.jsxs(Grid,{container:!0,direction:"column",gap:1,px:2,py:1.5,children:[require$$2$1.jsxs(Grid,{item:!0,container:!0,alignItems:"flex-start",gap:1,display:"flex",children:[require$$2$1.jsx(Grid,{item:!0,sx:{display:"flex",alignItems:"flex-start",mt:"6px",flex:"none"},children:require$$2$1.jsx(DotIcon,{})}),require$$2$1.jsx(Grid,{item:!0,xs:!0,sx:{minWidth:0},children:require$$2$1.jsx(Typography,{variant:"content1",color:Ye?.palette?.primaryText,sx:{whiteSpace:"normal",overflowWrap:"anywhere",wordBreak:"break-word",display:"block"},children:an?.chiefcomplaints||"No complaint specified"})})]}),require$$2$1.jsxs(Grid,{item:!0,container:!0,spacing:2,pl:2,children:[require$$2$1.jsx(Grid,{item:!0,xs:12,sm:6,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Body Site:"})," ",an?.bodysite||"Not specified"]})})}),require$$2$1.jsx(Grid,{item:!0,xs:12,sm:6,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Severity:"})," ",an?.severity||"Not specified"]})})}),require$$2$1.jsx(Grid,{item:!0,xs:12,sm:6,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Verification:"})," ",an?.verification||"Not specified"]})})}),require$$2$1.jsx(Grid,{item:!0,xs:12,sm:6,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Duration:"})," ",an?.duration||"Not specified"]})})}),an?.remarks&&require$$2$1.jsx(Grid,{item:!0,xs:12,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Remarks:"})," ",an.remarks]})})})]})]},on))}):require$$2$1.jsx(Grid,{container:!0,p:1,justifyContent:"center",alignItems:"center",bgcolor:"#ffffff",m:1,borderRadius:2,width:"95%",children:require$$2$1.jsx(Typography,{variant:"content1",color:Ye?.palette?.primaryText,children:"No data found"})})})]})},ListWithIcon=({title:en,icon:Ye,items:tn})=>{const nn=useTheme$1();return require$$2$1.jsxs(Paper,{elevation:0,sx:{borderRadius:3,paddingBottom:.1},style:{backgroundColor:"#fbfbfb"},children:[require$$2$1.jsxs(Grid,{container:!0,alignItems:"center",gap:1,display:"flex",justifyContent:"space-between",px:2,pt:1,children:[require$$2$1.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[Ye,require$$2$1.jsx(Typography,{variant:"head2",fontSize:"14px",color:nn.palette.primaryText,children:en})]}),require$$2$1.jsx(Grid,{item:!0,bgcolor:"#ffffff",sx:{px:1.5,borderRadius:"20px",py:.5},children:require$$2$1.jsxs("p",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"12px",color:"#6A7888"},children:["All",require$$2$1.jsx(SharpFilterIcon,{})]})})]}),require$$2$1.jsx(Grid,{children:tn?.length>0?require$$2$1.jsx(require$$2$1.Fragment,{children:tn.map((rn,an)=>require$$2$1.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"15px"},children:[require$$2$1.jsx("div",{children:require$$2$1.jsx(DotIcon,{})}),require$$2$1.jsx(Typography,{variant:"content1",color:nn?.palette?.primaryText,children:rn})]},an))}):require$$2$1.jsx(Grid,{container:!0,p:1,justifyContent:"center",alignItems:"center",bgcolor:"#ffffff",m:1,borderRadius:2,width:"95%",children:require$$2$1.jsx(Typography,{variant:"content1",color:nn?.palette?.primaryText,children:"No data found"})})})]})};function HistoryIcon(en){const Ye=en.width?en.width:24,tn=en.height?en.height:24;return require$$2$1.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 484 484",xmlSpace:"preserve",style:{width:Ye,height:tn},...en,children:[require$$2$1.jsx("path",{d:"M239.292 10c61.97 0 120.23 24.132 164.049 67.951S471.292 180.031 471.292 242s-24.132 120.229-67.951 164.049C359.522 449.868 301.261 474 239.292 474c-66.522 0-129.939-28.623-173.989-78.53-14.619-16.563-13.043-41.84 3.52-56.459s41.84-13.042 56.459 3.52C154.152 375.24 195.707 394 239.292 394c83.813 0 152-68.187 152-152s-68.187-152-152-152c-27.375 0-53.716 7.225-76.777 20.759L105.6 52.361C144.474 24.856 190.818 10 239.292 10z",fill:"#c7ebff"}),require$$2$1.jsx("path",{d:"M13.993 153.493l27.023-95.928c6.941-24.641 37.955-32.526 55.822-14.193l8.761 8.99 56.915 58.398 3.891 3.992c17.868 18.333 9.188 49.133-15.623 55.439l-96.591 24.548c-24.807 6.304-47.138-16.609-40.198-41.246z",fill:"#50a5dc"}),require$$2$1.jsx("path",{d:"M410.412 70.88C364.705 25.172 303.933 0 239.292 0c-47.493 0-93.076 13.591-132.383 39.378L104 36.393C93.085 25.194 77.52 20.808 62.365 24.662S35.63 39.802 31.39 54.854L4.368 150.781c-4.239 15.05-.255 30.72 10.658 41.917 8.308 8.524 19.31 13.101 30.775 13.101 3.595 0 7.236-.45 10.854-1.37l96.591-24.548c15.156-3.852 26.736-15.137 30.978-30.189 3.54-12.562 1.331-25.547-5.836-36.012 18.898-8.967 39.718-13.68 60.904-13.68 78.299 0 142 63.701 142 142s-63.701 142-142 142c-40.717 0-79.54-17.527-106.514-48.087-18.243-20.667-49.903-22.642-70.573-4.399-10.013 8.838-15.985 21.046-16.816 34.376-.831 13.329 3.579 26.185 12.417 36.198C103.752 454.144 169.902 484 239.292 484c64.641 0 125.414-25.172 171.121-70.88 45.708-45.708 70.88-106.479 70.88-171.12S456.12 116.588 410.412 70.88zm-245.438 73.389c-2.28 8.092-8.506 14.159-16.654 16.23l-96.591 24.547c-8.146 2.072-16.513-.287-22.38-6.307s-8.009-14.444-5.73-22.536l27.023-95.928c2.279-8.092 8.504-14.16 16.652-16.231 8.15-2.071 16.516.286 22.383 6.307l33.072 33.933 32.604 33.454.009.008 3.883 3.984c5.867 6.021 8.009 14.447 5.729 22.539zM396.27 398.978C354.34 440.908 298.591 464 239.292 464c-63.656 0-124.34-27.39-166.492-75.147-5.303-6.008-7.948-13.722-7.45-21.719s4.082-15.323 10.089-20.625c5.695-5.026 12.777-7.494 19.835-7.494 8.313 0 16.589 3.427 22.51 10.133C148.552 384.007 192.84 404 239.292 404c89.328 0 162-72.673 162-162s-72.673-162-162-162c-26.21 0-51.956 6.312-74.942 18.314l-11.509-11.809-31.691-32.517C156.438 31.715 197.036 20 239.292 20c59.299 0 115.048 23.092 156.978 65.022 41.931 41.93 65.022 97.679 65.022 156.978S438.2 357.047 396.27 398.978z"}),require$$2$1.jsx("g",{children:require$$2$1.jsx("path",{d:"M420.201 336.007a9.962 9.962 0 01-4.17-.916c-5.019-2.306-7.217-8.244-4.911-13.262 11.395-24.793 17.172-51.315 17.172-78.829 0-35.76-10.031-70.57-29.01-100.666-2.945-4.672-1.547-10.847 3.125-13.792 4.672-2.948 10.846-1.547 13.793 3.125 20.994 33.294 32.092 71.793 32.092 111.334 0 30.417-6.392 59.749-18.999 87.18a10 10 0 01-9.092 5.826z"})}),require$$2$1.jsx("g",{children:require$$2$1.jsx("path",{d:"M375.29 107.724a9.97 9.97 0 01-6.834-2.701 189.163 189.163 0 00-46.542-32.057c-4.966-2.418-7.031-8.403-4.614-13.369 2.417-4.965 8.403-7.031 13.368-4.614a209.198 209.198 0 0151.46 35.442c4.031 3.775 4.238 10.104.463 14.135a9.974 9.974 0 01-7.301 3.164z"})}),require$$2$1.jsxs("g",{children:[require$$2$1.jsx("path",{d:"M298.144 284.858l-38.643-38.643V151c0-11.046-8.954-20-20-20s-20 8.954-20 20v103c0 .082.011.161.012.243-.067 5.204 1.875 10.428 5.846 14.399l44.499 44.5c3.905 3.905 9.024 5.858 14.143 5.858s10.237-1.953 14.143-5.858c7.809-7.81 7.809-20.474 0-28.284z",fill:"#50a5dc"}),require$$2$1.jsx("path",{d:"M284.001 329c-8.014 0-15.548-3.121-21.214-8.787l-44.499-44.5c-5.675-5.675-8.784-13.202-8.776-21.228a11.139 11.139 0 01-.011-.485V151c0-16.542 13.458-30 30-30s30 13.458 30 30v91.073l35.714 35.713c11.695 11.697 11.695 30.729 0 42.426-5.666 5.667-13.2 8.788-21.214 8.788zm-54.5-75.271c.006.132.01.263.012.396v.248a9.914 9.914 0 002.918 7.199l44.499 44.5c1.889 1.889 4.4 2.929 7.071 2.929s5.183-1.04 7.071-2.929c3.898-3.898 3.898-10.243 0-14.142l-38.643-38.642a10.001 10.001 0 01-2.929-7.071V151c0-5.514-4.486-10-10-10s-10 4.486-10 10l.001 102.729z"})]})]})}function DocumentationIcon(en){const Ye=en.width?en.width:24,tn=en.height?en.height:24;return require$$2$1.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",xmlSpace:"preserve",style:{width:Ye,height:tn},...en,children:[require$$2$1.jsx("path",{d:"M928.415 352.319l-.193-.391v432.097c0 20.877-17.03 37.903-37.907 37.903H667.97v70.658c0 20.877-16.962 37.904-37.903 37.904H131.163c-20.911 0-37.903-17.027-37.903-37.904v-650.72c0-24.4 26.746-37.906 45.211-37.906h215.003v-70.655c0-24.401 26.75-37.907 45.212-37.907h259.5l10.439.067c32.034 0 71.046 7.697 163.104 99.884l7.044 6.914c31.317 30.731 89.642 87.948 89.642 150.056z",fill:"#27323A"}),require$$2$1.jsx("path",{d:"M749.458 187.325c9.2 30.14 12.46 61.587 13.506 79.791 24.855 1.043 52.063 3 77.767 10.175-13.245-15.787-27.272-29.683-37.059-39.273l-7.372-7.242c-18.07-18.139-33.467-32.231-46.842-43.451z",fill:"#FFF"}),require$$2$1.jsx("path",{d:"M618.062 460.88c0-6.981-1.827-14.22-4.373-21.461-30.531-27.338-81.421-29.296-122.327-30.862l-5.415-.26c-8.938-.328-16.08-7.7-16.08-16.635 0-38.364-9.59-104.975-36.47-131.464l-1.957-2.021c-10.766-3.982-23.226-4.046-23.226-4.046H143.365v626.253h474.5V460.489l.197.391z",fill:"#F4CE73"}),require$$2$1.jsx("path",{d:"M502.715 375.678c24.856 1.042 52.064 3 77.834 10.174-13.311-15.786-27.274-29.682-37.058-39.273l-7.372-7.242c-18.138-18.138-33.535-32.23-46.846-43.452 9.137 30.142 12.397 61.588 13.442 79.793z",fill:"#FFF"}),require$$2$1.jsx("path",{d:"M878.31 352.319c0-6.982-1.89-14.22-4.369-21.462-30.6-27.337-81.421-29.295-122.33-30.862l-5.415-.26c-9.002-.327-16.047-7.7-16.047-16.635 0-38.364-9.657-104.975-36.47-131.464l-1.957-2.02c-10.767-3.983-17.878-4.046-23.293-4.046l-10.372-.067s-244.037.588-254.476.588v57.936h4.763c32.098 0 71.08 7.696 163.137 99.884l7.044 6.914c31.383 30.73 89.642 87.949 89.642 150.057l-.198-.392v311.333h210.147V351.93l.194.39z",fill:"#79CCBF"}),require$$2$1.jsx("path",{d:"M533.053 509.423c11.09 0 20.03 9.002 20.03 20.093 0 11.026-8.94 20.029-20.03 20.029H240.737c-11.026 0-19.996-9.002-19.996-20.03 0-11.09 8.97-20.092 19.996-20.092h292.316zm-292.316 91.86c-11.026 0-19.996 9.002-19.996 20.093 0 11.026 8.97 20.029 19.996 20.029h292.316c11.09 0 20.03-9.002 20.03-20.03 0-11.09-8.94-20.092-20.03-20.092H240.737z",fill:"#27323A"})]})}var marker="vercel.ai.error",symbol=Symbol.for(marker),_a,_AISDKError=class bm extends Error{constructor({name:Ye,message:tn,cause:nn}){super(tn),this[_a]=!0,this.name=Ye,this.cause=nn}static isInstance(Ye){return bm.hasMarker(Ye,marker)}static hasMarker(Ye,tn){const nn=Symbol.for(tn);return Ye!=null&&typeof Ye=="object"&&nn in Ye&&typeof Ye[nn]=="boolean"&&Ye[nn]===!0}};_a=symbol;var AISDKError=_AISDKError;function getErrorMessage(en){return en==null?"unknown error":typeof en=="string"?en:en instanceof Error?en.message:JSON.stringify(en)}var name3="AI_InvalidArgumentError",marker4=`vercel.ai.error.${name3}`,symbol4=Symbol.for(marker4),_a4,InvalidArgumentError=class extends AISDKError{constructor({message:en,cause:Ye,argument:tn}){super({name:name3,message:en,cause:Ye}),this[_a4]=!0,this.argument=tn}static isInstance(en){return AISDKError.hasMarker(en,marker4)}};_a4=symbol4;var name6="AI_JSONParseError",marker7$1=`vercel.ai.error.${name6}`,symbol7$1=Symbol.for(marker7$1),_a7$1,JSONParseError=class extends AISDKError{constructor({text:en,cause:Ye}){super({name:name6,message:`JSON parsing failed: Text: ${en}.
|
|
725
|
+
`+dr.description:""}`])}),Jn.push(["",""])),Jn},Br=utils$1.book_new(),Rr=wn?.diagnosesData??wn?.diagnoses??wn??[];let hr=[];hr.push(["Diagnosis Findings",""]),hr.push(["Field","Actual Result"]),Rr.forEach((Pr,wr)=>{wr>0&&hr.push(["",""]);const xr=Qr(Pr);hr.push(["diagnosiscode",xr.diagnosiscode||""]),hr.push(["diagnosisdescription",xr.diagnosisdescription||""]),hr.push(["diagnosisclass",xr.diagnosisclass||""]),hr.push(["action",xr.action||""]),hr.push(["verificationStatus",xr.verificationStatus||""]);let Jn=xr.justification?Or(xr.justification):"";hr.push(["justification",Jn])});const Dr=utils$1.aoa_to_sheet(hr);Dr["!cols"]=[{wch:40},{wch:100}],utils$1.book_append_sheet(Br,Dr,"Diagnosis Findings");const $r=Cn??{};Object.keys($r).forEach(Pr=>{const wr=$r[Pr],xr=Zr(wr,`Recommendations - ${Pr}`),Jn=utils$1.aoa_to_sheet(xr);Jn["!cols"]=[{wch:40},{wch:100}];const Er=ar(`Recommendations - ${Pr}`);utils$1.book_append_sheet(Br,Jn,Er)});const vr=writeSync(Br,{bookType:"xlsx",type:"array"});FileSaver_minExports.saveAs(new Blob([vr],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),"diagnoses_and_recommendations.xlsx")}catch(Qr){console.error("Excel Export Error:",Qr),alert("Failed to download Excel.")}},yr=React__namespace.useMemo(()=>{const Qr=_n?.length===2?Cn:kn;return{patientData:$n,potentialDiagnosis:wn?.diagnoses,diagnosisCodes:Qn,ragResponse:Qr}},[$n,wn?.diagnosesData,wn?.diagnoses,Qn,_n?.length,Cn,kn]);return React__namespace.useEffect(()=>{!!(yr?.patientData||yr?.potentialDiagnosis&&yr?.potentialDiagnosis.length>0||yr?.diagnosisCodes&&yr?.diagnosisCodes.length>0||yr?.ragResponse&&Object.keys(yr?.ragResponse||{}).length>0)&&mn(yr)},[yr,mn]),require$$2$1.jsxs(Box,{sx:{width:"100%"},children:[require$$2$1.jsxs(Box,{sx:{position:"sticky",mb:"16px",top:0,zIndex:1,padding:"12px 16px",borderRadius:2,backgroundColor:"#fff",display:"flex",width:"100%",gap:2,alignItems:"center"},children:[require$$2$1.jsx(ActionButton,{text:"Previous",onClick:Ar,sx:{minWidth:"120px"},color:"white",disabled:!dn?.step1&&hn===0,startIcon:require$$2$1.jsx(ArrowLeft,{color:"#555E68",width:"20px",height:"24px"})}),require$$2$1.jsx(Stepper,{activeStep:hn,sx:{width:"100%",marginLeft:"24px",marginRight:"24px"},children:_n.map((Qr,cr)=>{const Or={},Ir={};return require$$2$1.jsx(Step$1,{...Or,children:require$$2$1.jsx(StepLabel,{onClick:()=>sr(cr),...Ir,sx:{"& .MuiStepLabel-label":{color:cr===hn?"#32383E":"#6A7888"},"& .MuiStepIcon-root":{color:cr===hn?"#32383E":"#EDF1F5"},"& .MuiStepIcon-text":{fill:cr===hn?"#fff":"#6A7888"}},children:Qr})},Qr)})}),hn<_n.length-1?require$$2$1.jsx(ActionButton,{text:"Next",sx:{border:"none"},onClick:rr,disabled:!dn?.step1&&(hn===0&&Dn||hn===1&&Tn||hn===2&&Sn),endIcon:require$$2$1.jsx(ArrowRight,{color:!dn?.step1&&(hn===0&&Dn||hn===1&&Tn||hn===2&&Sn)?"#555E68":"#ffff",width:"20px",height:"24px"})}):require$$2$1.jsx(ActionButton,{text:"Generate Order",onClick:()=>rn(_n.length===2?Cn:kn),sx:{border:"none",minWidth:"170px"},disabled:hn===_n.length-1&&(_n.length===2?Tn:Sn)}),hn===1&&_n.length>1&&require$$2$1.jsx(Tooltip$2,{title:"Download as Excel",children:require$$2$1.jsx(IconButton,{onClick:ur,sx:{padding:"8px",color:"#0B74DE","&:hover":{backgroundColor:"#F3FAFF"}},children:require$$2$1.jsx(DownloadFileIcon,{width:20,height:20})})})]}),require$$2$1.jsx("div",{children:require$$2$1.jsx(Box,{sx:{maxHeight:"calc(100vh - 237px)",overflowY:"auto","&::-webkit-scrollbar":{width:"6px",background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#c9ced6",borderRadius:"6px"},"&::-webkit-scrollbar-track":{backgroundColor:"transparent"}},children:hn===0?require$$2$1.jsx(Grid,{container:!0,justifyContent:"space-between",flexDirection:"column",children:wn?.diagnosesData?.length>0?require$$2$1.jsx(require$$2$1.Fragment,{children:require$$2$1.jsx(Grid,{container:!0,justifyContent:"space-between",flexDirection:"column",children:require$$2$1.jsx(Grid,{item:!0,container:!0,children:(()=>{if(!wn?.diagnosesData?.length)return null;const Qr=[];wn.diagnosesData.forEach(Or=>{`${Or?.verificationStatus?Or?.verificationStatus:" "} ${Or?.verificationStatus&&Or?.action?" - ":""} ${Or?.action?Or?.action:" "}`.trim()==="LACK EVIDENCE"||Qr.push(Or)});const cr=Or=>Or.map((Ir,Yr)=>{const na=Object.values(Ir?.justification??{}).join("|| "),Zr=[...new Set(Ir?.graph_evidence?.nodes?.map(Br=>Br?.reference).filter(Boolean))].join("|| ");return require$$2$1.jsx(SingleLineOrderCard,{orderTitle:`${Ir?.diagnosiscode} - ${Ir?.diagnosisdescription}`,orderDescription:`${Ir?.verificationStatus?Ir?.verificationStatus:" "} ${Ir?.verificationStatus&&Ir?.action?" - ":""} ${Ir?.action?Ir?.action:" "}`,evidence:na,reference:Zr,feedbackMode:!1,params:Ye,checked:Ir?.checked,index:Yr,setChecked:or,diagnosisconfirmation:Ir?.diagnosisconfirmation,diagnosisAction:Ir?.action??"",setAccepted:pr,allowed:Ir.allowed,activeStep:hn,hideSelectionCheckbox:!0,isFromDiagnosisStep:!0},Yr)});return require$$2$1.jsxs(require$$2$1.Fragment,{children:[Qr.length>0&&require$$2$1.jsx(Grid,{item:!0,xs:12,children:cr(Qr)}),gn]})})()})})}):require$$2$1.jsx(require$$2$1.Fragment,{children:require$$2$1.jsx(LoadingAiOutput,{animationJson:findingDiagnosisJson,loadingsentance:Mn})})}):hn===1?require$$2$1.jsx(require$$2$1.Fragment,{children:require$$2$1.jsx(Grid,{container:!0,children:Object.keys(Cn).length!==0?require$$2$1.jsxs(require$$2$1.Fragment,{children:[Object.keys(Cn).length>1&&require$$2$1.jsx(Grid,{item:!0,xs:12,container:!0,children:require$$2$1.jsx(ToggleButton,{activeTab:Object.keys(Cn)[bn],setActiveTab:Qr=>{const cr=Object.keys(Cn).indexOf(Qr);cr!==-1&&yn(cr)},leftButtonLabel:Object.keys(Cn)[0],rightButtonLabel:Object.keys(Cn)[1],leftButtonValue:Object.keys(Cn)[0],rightButtonValue:Object.keys(Cn)[1]})}),require$$2$1.jsx(Grid,{item:!0,xs:12,mt:"16px",container:!0,children:Object.values(Cn).map((Qr,cr)=>(Object.keys(Cn).length===1||bn===cr)&&require$$2$1.jsxs("div",{children:[require$$2$1.jsx(Summary,{data:Qr?.summary}),require$$2$1.jsx(SuggestedOrders,{data:Qr,setData:tn,loadingData:nn,params:Ye,setOrderData:pn,selectedTab:Object.keys(Cn)[bn]})]},cr))})]}):require$$2$1.jsx(LoadingAiOutput,{animationJson:singleGuidelineJson,loadingsentance:jn})})}):require$$2$1.jsx(Grid,{container:!0,children:Object.keys(kn).length!==0?require$$2$1.jsxs(Grid,{container:!0,xs:12,children:[kn?.summary&&require$$2$1.jsx(Grid,{children:require$$2$1.jsx(Summary,{data:kn?.summary})}),require$$2$1.jsx(Grid,{xs:12,m:1,children:require$$2$1.jsx(SuggestedOrders,{data:kn,setData:tn,loadingData:nn,params:Ye,setOrderData:pn})}),kn?.lifeStyleAdvices?.length>0&&require$$2$1.jsx(Grid,{m:1,children:require$$2$1.jsx(EducationDescription,{data:kn,setData:tn})})]}):require$$2$1.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",flexGrow:1},children:require$$2$1.jsx(LoadingAiOutput,{animationJson:multiGuidelineJson,loadingsentance:Pn})})})})})]})}function ChiefComplaintsIcn(en){const Ye=en.width?en.width:"24",tn=en.height?en.height:"24";return require$$2$1.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Ye,height:tn,viewBox:"0 0 96 96",children:[require$$2$1.jsx("circle",{cx:48,cy:48,r:46,fill:"#eaeaea"}),require$$2$1.jsx("path",{d:"M48 2c-1.35 0-2.68.07-4 .18a46 46 0 010 91.63c1.32.11 2.65.18 4 .18A46 46 0 0048 2z",fill:"#bacece"}),require$$2$1.jsx("circle",{cx:48,cy:48,r:46,fill:"none",stroke:"#281a3b",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4px"}),require$$2$1.jsx("path",{d:"M57 58h14.63A3.38 3.38 0 0075 54.63V43.38A3.38 3.38 0 0071.63 40H57V25.38A3.38 3.38 0 0053.63 22H42.38A3.38 3.38 0 0039 25.38V40H24.37A3.38 3.38 0 0021 43.38v11.25A3.38 3.38 0 0024.37 58H39v14.63A3.38 3.38 0 0042.37 76h11.25A3.38 3.38 0 0057 72.63z",fill:"#575072"}),require$$2$1.jsx("path",{d:"M57 58h14.63A3.38 3.38 0 0075 54.63V43.38A3.38 3.38 0 0071.63 40H57V25.38A3.38 3.38 0 0053.63 22H42.38A3.38 3.38 0 0039 25.38V40H24.37A3.38 3.38 0 0021 43.38v11.25A3.38 3.38 0 0024.37 58H39v14.63A3.38 3.38 0 0042.37 76h11.25A3.38 3.38 0 0057 72.63z",fill:"#f47c6d"}),require$$2$1.jsx("path",{d:"M57 58h14.63A3.38 3.38 0 0075 54.63V43.38A3.38 3.38 0 0071.63 40H57V25.38A3.38 3.38 0 0053.63 22H42.38A3.38 3.38 0 0039 25.38V40H24.37A3.38 3.38 0 0021 43.38v11.25A3.38 3.38 0 0024.37 58H39v14.63A3.38 3.38 0 0042.37 76h11.25A3.38 3.38 0 0057 72.63z",fill:"none",stroke:"#281a3b",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4px"})]})}const InfoChiefComplaints=({data:en})=>{const Ye=useTheme$1(),[tn,nn]=React.useState(!1),rn=()=>{nn(!tn)};return require$$2$1.jsxs(Paper,{elevation:0,sx:{borderRadius:3,paddingBottom:.1},style:{backgroundColor:"#fbfbfb"},children:[require$$2$1.jsxs(Grid,{container:!0,justifyContent:"space-between",alignItems:"center",gap:1,px:2,pt:1,sx:{cursor:"pointer"},onClick:rn,children:[require$$2$1.jsx(Grid,{item:!0,children:require$$2$1.jsxs(Grid,{container:!0,alignItems:"center",gap:1,children:[require$$2$1.jsx(ChiefComplaintsIcn,{}),require$$2$1.jsx(Typography,{variant:"head2",fontSize:"14px",color:Ye?.palette?.primaryText,children:"Chief Complaints"})]})}),require$$2$1.jsx(Grid,{item:!0,bgcolor:"#ffffff",sx:{px:1.5,borderRadius:"20px",py:.5},children:require$$2$1.jsxs("p",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"12px",color:"#6A7888"},children:["All",require$$2$1.jsx(SharpFilterIcon,{})]})})]}),require$$2$1.jsx(Box,{children:en?.length>0?require$$2$1.jsx(Grid,{py:1,direction:"column",gap:2,bgcolor:"#ffffff",my:1,mx:1,borderRadius:2,children:en.map((an,on)=>require$$2$1.jsxs(Grid,{container:!0,direction:"column",gap:1,px:2,py:1.5,children:[require$$2$1.jsxs(Grid,{item:!0,container:!0,alignItems:"flex-start",gap:1,display:"flex",children:[require$$2$1.jsx(Grid,{item:!0,sx:{display:"flex",alignItems:"flex-start",mt:"6px",flex:"none"},children:require$$2$1.jsx(DotIcon,{})}),require$$2$1.jsx(Grid,{item:!0,xs:!0,sx:{minWidth:0},children:require$$2$1.jsx(Typography,{variant:"content1",color:Ye?.palette?.primaryText,sx:{whiteSpace:"normal",overflowWrap:"anywhere",wordBreak:"break-word",display:"block"},children:an?.chiefcomplaints||"No complaint specified"})})]}),require$$2$1.jsxs(Grid,{item:!0,container:!0,spacing:2,pl:2,children:[require$$2$1.jsx(Grid,{item:!0,xs:12,sm:6,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Body Site:"})," ",an?.bodysite||"Not specified"]})})}),require$$2$1.jsx(Grid,{item:!0,xs:12,sm:6,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Severity:"})," ",an?.severity||"Not specified"]})})}),require$$2$1.jsx(Grid,{item:!0,xs:12,sm:6,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Verification:"})," ",an?.verification||"Not specified"]})})}),require$$2$1.jsx(Grid,{item:!0,xs:12,sm:6,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Duration:"})," ",an?.duration||"Not specified"]})})}),an?.remarks&&require$$2$1.jsx(Grid,{item:!0,xs:12,children:require$$2$1.jsx(Grid,{container:!0,children:require$$2$1.jsxs(Typography,{variant:"content2",color:Ye?.palette?.tertieryText,children:[require$$2$1.jsx("strong",{children:"Remarks:"})," ",an.remarks]})})})]})]},on))}):require$$2$1.jsx(Grid,{container:!0,p:1,justifyContent:"center",alignItems:"center",bgcolor:"#ffffff",m:1,borderRadius:2,width:"95%",children:require$$2$1.jsx(Typography,{variant:"content1",color:Ye?.palette?.primaryText,children:"No data found"})})})]})},ListWithIcon=({title:en,icon:Ye,items:tn})=>{const nn=useTheme$1();return require$$2$1.jsxs(Paper,{elevation:0,sx:{borderRadius:3,paddingBottom:.1},style:{backgroundColor:"#fbfbfb"},children:[require$$2$1.jsxs(Grid,{container:!0,alignItems:"center",gap:1,display:"flex",justifyContent:"space-between",px:2,pt:1,children:[require$$2$1.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[Ye,require$$2$1.jsx(Typography,{variant:"head2",fontSize:"14px",color:nn.palette.primaryText,children:en})]}),require$$2$1.jsx(Grid,{item:!0,bgcolor:"#ffffff",sx:{px:1.5,borderRadius:"20px",py:.5},children:require$$2$1.jsxs("p",{style:{display:"flex",alignItems:"center",gap:5,fontSize:"12px",color:"#6A7888"},children:["All",require$$2$1.jsx(SharpFilterIcon,{})]})})]}),require$$2$1.jsx(Grid,{children:tn?.length>0?require$$2$1.jsx(require$$2$1.Fragment,{children:tn.map((rn,an)=>require$$2$1.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"15px"},children:[require$$2$1.jsx("div",{children:require$$2$1.jsx(DotIcon,{})}),require$$2$1.jsx(Typography,{variant:"content1",color:nn?.palette?.primaryText,children:rn})]},an))}):require$$2$1.jsx(Grid,{container:!0,p:1,justifyContent:"center",alignItems:"center",bgcolor:"#ffffff",m:1,borderRadius:2,width:"95%",children:require$$2$1.jsx(Typography,{variant:"content1",color:nn?.palette?.primaryText,children:"No data found"})})})]})};function HistoryIcon(en){const Ye=en.width?en.width:24,tn=en.height?en.height:24;return require$$2$1.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 484 484",xmlSpace:"preserve",style:{width:Ye,height:tn},...en,children:[require$$2$1.jsx("path",{d:"M239.292 10c61.97 0 120.23 24.132 164.049 67.951S471.292 180.031 471.292 242s-24.132 120.229-67.951 164.049C359.522 449.868 301.261 474 239.292 474c-66.522 0-129.939-28.623-173.989-78.53-14.619-16.563-13.043-41.84 3.52-56.459s41.84-13.042 56.459 3.52C154.152 375.24 195.707 394 239.292 394c83.813 0 152-68.187 152-152s-68.187-152-152-152c-27.375 0-53.716 7.225-76.777 20.759L105.6 52.361C144.474 24.856 190.818 10 239.292 10z",fill:"#c7ebff"}),require$$2$1.jsx("path",{d:"M13.993 153.493l27.023-95.928c6.941-24.641 37.955-32.526 55.822-14.193l8.761 8.99 56.915 58.398 3.891 3.992c17.868 18.333 9.188 49.133-15.623 55.439l-96.591 24.548c-24.807 6.304-47.138-16.609-40.198-41.246z",fill:"#50a5dc"}),require$$2$1.jsx("path",{d:"M410.412 70.88C364.705 25.172 303.933 0 239.292 0c-47.493 0-93.076 13.591-132.383 39.378L104 36.393C93.085 25.194 77.52 20.808 62.365 24.662S35.63 39.802 31.39 54.854L4.368 150.781c-4.239 15.05-.255 30.72 10.658 41.917 8.308 8.524 19.31 13.101 30.775 13.101 3.595 0 7.236-.45 10.854-1.37l96.591-24.548c15.156-3.852 26.736-15.137 30.978-30.189 3.54-12.562 1.331-25.547-5.836-36.012 18.898-8.967 39.718-13.68 60.904-13.68 78.299 0 142 63.701 142 142s-63.701 142-142 142c-40.717 0-79.54-17.527-106.514-48.087-18.243-20.667-49.903-22.642-70.573-4.399-10.013 8.838-15.985 21.046-16.816 34.376-.831 13.329 3.579 26.185 12.417 36.198C103.752 454.144 169.902 484 239.292 484c64.641 0 125.414-25.172 171.121-70.88 45.708-45.708 70.88-106.479 70.88-171.12S456.12 116.588 410.412 70.88zm-245.438 73.389c-2.28 8.092-8.506 14.159-16.654 16.23l-96.591 24.547c-8.146 2.072-16.513-.287-22.38-6.307s-8.009-14.444-5.73-22.536l27.023-95.928c2.279-8.092 8.504-14.16 16.652-16.231 8.15-2.071 16.516.286 22.383 6.307l33.072 33.933 32.604 33.454.009.008 3.883 3.984c5.867 6.021 8.009 14.447 5.729 22.539zM396.27 398.978C354.34 440.908 298.591 464 239.292 464c-63.656 0-124.34-27.39-166.492-75.147-5.303-6.008-7.948-13.722-7.45-21.719s4.082-15.323 10.089-20.625c5.695-5.026 12.777-7.494 19.835-7.494 8.313 0 16.589 3.427 22.51 10.133C148.552 384.007 192.84 404 239.292 404c89.328 0 162-72.673 162-162s-72.673-162-162-162c-26.21 0-51.956 6.312-74.942 18.314l-11.509-11.809-31.691-32.517C156.438 31.715 197.036 20 239.292 20c59.299 0 115.048 23.092 156.978 65.022 41.931 41.93 65.022 97.679 65.022 156.978S438.2 357.047 396.27 398.978z"}),require$$2$1.jsx("g",{children:require$$2$1.jsx("path",{d:"M420.201 336.007a9.962 9.962 0 01-4.17-.916c-5.019-2.306-7.217-8.244-4.911-13.262 11.395-24.793 17.172-51.315 17.172-78.829 0-35.76-10.031-70.57-29.01-100.666-2.945-4.672-1.547-10.847 3.125-13.792 4.672-2.948 10.846-1.547 13.793 3.125 20.994 33.294 32.092 71.793 32.092 111.334 0 30.417-6.392 59.749-18.999 87.18a10 10 0 01-9.092 5.826z"})}),require$$2$1.jsx("g",{children:require$$2$1.jsx("path",{d:"M375.29 107.724a9.97 9.97 0 01-6.834-2.701 189.163 189.163 0 00-46.542-32.057c-4.966-2.418-7.031-8.403-4.614-13.369 2.417-4.965 8.403-7.031 13.368-4.614a209.198 209.198 0 0151.46 35.442c4.031 3.775 4.238 10.104.463 14.135a9.974 9.974 0 01-7.301 3.164z"})}),require$$2$1.jsxs("g",{children:[require$$2$1.jsx("path",{d:"M298.144 284.858l-38.643-38.643V151c0-11.046-8.954-20-20-20s-20 8.954-20 20v103c0 .082.011.161.012.243-.067 5.204 1.875 10.428 5.846 14.399l44.499 44.5c3.905 3.905 9.024 5.858 14.143 5.858s10.237-1.953 14.143-5.858c7.809-7.81 7.809-20.474 0-28.284z",fill:"#50a5dc"}),require$$2$1.jsx("path",{d:"M284.001 329c-8.014 0-15.548-3.121-21.214-8.787l-44.499-44.5c-5.675-5.675-8.784-13.202-8.776-21.228a11.139 11.139 0 01-.011-.485V151c0-16.542 13.458-30 30-30s30 13.458 30 30v91.073l35.714 35.713c11.695 11.697 11.695 30.729 0 42.426-5.666 5.667-13.2 8.788-21.214 8.788zm-54.5-75.271c.006.132.01.263.012.396v.248a9.914 9.914 0 002.918 7.199l44.499 44.5c1.889 1.889 4.4 2.929 7.071 2.929s5.183-1.04 7.071-2.929c3.898-3.898 3.898-10.243 0-14.142l-38.643-38.642a10.001 10.001 0 01-2.929-7.071V151c0-5.514-4.486-10-10-10s-10 4.486-10 10l.001 102.729z"})]})]})}function DocumentationIcon(en){const Ye=en.width?en.width:24,tn=en.height?en.height:24;return require$$2$1.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",xmlSpace:"preserve",style:{width:Ye,height:tn},...en,children:[require$$2$1.jsx("path",{d:"M928.415 352.319l-.193-.391v432.097c0 20.877-17.03 37.903-37.907 37.903H667.97v70.658c0 20.877-16.962 37.904-37.903 37.904H131.163c-20.911 0-37.903-17.027-37.903-37.904v-650.72c0-24.4 26.746-37.906 45.211-37.906h215.003v-70.655c0-24.401 26.75-37.907 45.212-37.907h259.5l10.439.067c32.034 0 71.046 7.697 163.104 99.884l7.044 6.914c31.317 30.731 89.642 87.948 89.642 150.056z",fill:"#27323A"}),require$$2$1.jsx("path",{d:"M749.458 187.325c9.2 30.14 12.46 61.587 13.506 79.791 24.855 1.043 52.063 3 77.767 10.175-13.245-15.787-27.272-29.683-37.059-39.273l-7.372-7.242c-18.07-18.139-33.467-32.231-46.842-43.451z",fill:"#FFF"}),require$$2$1.jsx("path",{d:"M618.062 460.88c0-6.981-1.827-14.22-4.373-21.461-30.531-27.338-81.421-29.296-122.327-30.862l-5.415-.26c-8.938-.328-16.08-7.7-16.08-16.635 0-38.364-9.59-104.975-36.47-131.464l-1.957-2.021c-10.766-3.982-23.226-4.046-23.226-4.046H143.365v626.253h474.5V460.489l.197.391z",fill:"#F4CE73"}),require$$2$1.jsx("path",{d:"M502.715 375.678c24.856 1.042 52.064 3 77.834 10.174-13.311-15.786-27.274-29.682-37.058-39.273l-7.372-7.242c-18.138-18.138-33.535-32.23-46.846-43.452 9.137 30.142 12.397 61.588 13.442 79.793z",fill:"#FFF"}),require$$2$1.jsx("path",{d:"M878.31 352.319c0-6.982-1.89-14.22-4.369-21.462-30.6-27.337-81.421-29.295-122.33-30.862l-5.415-.26c-9.002-.327-16.047-7.7-16.047-16.635 0-38.364-9.657-104.975-36.47-131.464l-1.957-2.02c-10.767-3.983-17.878-4.046-23.293-4.046l-10.372-.067s-244.037.588-254.476.588v57.936h4.763c32.098 0 71.08 7.696 163.137 99.884l7.044 6.914c31.383 30.73 89.642 87.949 89.642 150.057l-.198-.392v311.333h210.147V351.93l.194.39z",fill:"#79CCBF"}),require$$2$1.jsx("path",{d:"M533.053 509.423c11.09 0 20.03 9.002 20.03 20.093 0 11.026-8.94 20.029-20.03 20.029H240.737c-11.026 0-19.996-9.002-19.996-20.03 0-11.09 8.97-20.092 19.996-20.092h292.316zm-292.316 91.86c-11.026 0-19.996 9.002-19.996 20.093 0 11.026 8.97 20.029 19.996 20.029h292.316c11.09 0 20.03-9.002 20.03-20.03 0-11.09-8.94-20.092-20.03-20.092H240.737z",fill:"#27323A"})]})}var marker="vercel.ai.error",symbol=Symbol.for(marker),_a,_AISDKError=class bm extends Error{constructor({name:Ye,message:tn,cause:nn}){super(tn),this[_a]=!0,this.name=Ye,this.cause=nn}static isInstance(Ye){return bm.hasMarker(Ye,marker)}static hasMarker(Ye,tn){const nn=Symbol.for(tn);return Ye!=null&&typeof Ye=="object"&&nn in Ye&&typeof Ye[nn]=="boolean"&&Ye[nn]===!0}};_a=symbol;var AISDKError=_AISDKError;function getErrorMessage(en){return en==null?"unknown error":typeof en=="string"?en:en instanceof Error?en.message:JSON.stringify(en)}var name3="AI_InvalidArgumentError",marker4=`vercel.ai.error.${name3}`,symbol4=Symbol.for(marker4),_a4,InvalidArgumentError=class extends AISDKError{constructor({message:en,cause:Ye,argument:tn}){super({name:name3,message:en,cause:Ye}),this[_a4]=!0,this.argument=tn}static isInstance(en){return AISDKError.hasMarker(en,marker4)}};_a4=symbol4;var name6="AI_JSONParseError",marker7$1=`vercel.ai.error.${name6}`,symbol7$1=Symbol.for(marker7$1),_a7$1,JSONParseError=class extends AISDKError{constructor({text:en,cause:Ye}){super({name:name6,message:`JSON parsing failed: Text: ${en}.
|
|
726
726
|
Error message: ${getErrorMessage(Ye)}`,cause:Ye}),this[_a7$1]=!0,this.text=en}static isInstance(en){return AISDKError.hasMarker(en,marker7$1)}};_a7$1=symbol7$1;var name12="AI_TypeValidationError",marker13=`vercel.ai.error.${name12}`,symbol13=Symbol.for(marker13),_a13,_TypeValidationError=class kp extends AISDKError{constructor({value:Ye,cause:tn}){super({name:name12,message:`Type validation failed: Value: ${JSON.stringify(Ye)}.
|
|
727
727
|
Error message: ${getErrorMessage(tn)}`,cause:tn}),this[_a13]=!0,this.value=Ye}static isInstance(Ye){return AISDKError.hasMarker(Ye,marker13)}static wrap({value:Ye,cause:tn}){return kp.isInstance(tn)&&tn.value===Ye?tn:new kp({value:Ye,cause:tn})}};_a13=symbol13;var TypeValidationError=_TypeValidationError;let ParseError$1=class extends Error{constructor(Ye,tn){super(Ye),this.name="ParseError",this.type=tn.type,this.field=tn.field,this.value=tn.value,this.line=tn.line}};function noop$5(en){}function createParser$1(en){if(typeof en=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:Ye=noop$5,onError:tn=noop$5,onRetry:nn=noop$5,onComment:rn}=en;let an="",on=!0,sn,An="",un="";function dn(fn){const bn=on?fn.replace(/^\xEF\xBB\xBF/,""):fn,[yn,wn]=splitLines$1(`${an}${bn}`);for(const vn of yn)pn(vn);an=wn,on=!1}function pn(fn){if(fn===""){gn();return}if(fn.startsWith(":")){rn&&rn(fn.slice(fn.startsWith(": ")?2:1));return}const bn=fn.indexOf(":");if(bn!==-1){const yn=fn.slice(0,bn),wn=fn[bn+1]===" "?2:1,vn=fn.slice(bn+wn);mn(yn,vn,fn);return}mn(fn,"",fn)}function mn(fn,bn,yn){switch(fn){case"event":un=bn;break;case"data":An=`${An}${bn}
|
|
728
728
|
`;break;case"id":sn=bn.includes("\0")?void 0:bn;break;case"retry":/^\d+$/.test(bn)?nn(parseInt(bn,10)):tn(new ParseError$1(`Invalid \`retry\` value: "${bn}"`,{type:"invalid-retry",value:bn,line:yn}));break;default:tn(new ParseError$1(`Unknown field "${fn.length>20?`${fn.slice(0,20)}…`:fn}"`,{type:"unknown-field",field:fn,value:bn,line:yn}));break}}function gn(){An.length>0&&Ye({id:sn,event:un||void 0,data:An.endsWith(`
|