promptfoo 0.68.1 → 0.68.2

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.
Files changed (27) hide show
  1. package/dist/package.json +5 -2
  2. package/dist/src/web/nextui/404/index.html +1 -1
  3. package/dist/src/web/nextui/404.html +1 -1
  4. package/dist/src/web/nextui/_next/static/chunks/{2-c749131e7095aef3.js → 2-4b5beeb15b816213.js} +1 -1
  5. package/dist/src/web/nextui/_next/static/chunks/app/setup/page-8774494ce5143c0b.js +1 -0
  6. package/dist/src/web/nextui/auth/login/index.html +1 -1
  7. package/dist/src/web/nextui/auth/login/index.txt +1 -1
  8. package/dist/src/web/nextui/auth/signup/index.html +1 -1
  9. package/dist/src/web/nextui/auth/signup/index.txt +1 -1
  10. package/dist/src/web/nextui/datasets/index.html +1 -1
  11. package/dist/src/web/nextui/datasets/index.txt +1 -1
  12. package/dist/src/web/nextui/eval/index.html +1 -1
  13. package/dist/src/web/nextui/eval/index.txt +2 -2
  14. package/dist/src/web/nextui/index.html +1 -1
  15. package/dist/src/web/nextui/index.txt +1 -1
  16. package/dist/src/web/nextui/progress/index.html +1 -1
  17. package/dist/src/web/nextui/progress/index.txt +1 -1
  18. package/dist/src/web/nextui/prompts/index.html +1 -1
  19. package/dist/src/web/nextui/prompts/index.txt +1 -1
  20. package/dist/src/web/nextui/report/index.html +1 -1
  21. package/dist/src/web/nextui/report/index.txt +1 -1
  22. package/dist/src/web/nextui/setup/index.html +1 -1
  23. package/dist/src/web/nextui/setup/index.txt +2 -2
  24. package/package.json +5 -2
  25. package/dist/src/web/nextui/_next/static/chunks/app/setup/page-6cd68647af1a20aa.js +0 -1
  26. /package/dist/src/web/nextui/_next/static/{tUB-fEjoICDbTDdLhchKo → oG1bS6tprqvmq8_YgsAS8}/_buildManifest.js +0 -0
  27. /package/dist/src/web/nextui/_next/static/{tUB-fEjoICDbTDdLhchKo → oG1bS6tprqvmq8_YgsAS8}/_ssgManifest.js +0 -0
package/dist/package.json CHANGED
@@ -2,10 +2,13 @@
2
2
  "name": "promptfoo",
3
3
  "description": "LLM eval & testing toolkit",
4
4
  "author": "Ian Webster",
5
- "version": "0.68.1",
5
+ "version": "0.68.2",
6
6
  "license": "MIT",
7
7
  "type": "commonjs",
8
- "repository": "promptfoo/promptfoo",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/promptfoo/promptfoo.git"
11
+ },
9
12
  "main": "dist/src/index.js",
10
13
  "exports": {
11
14
  ".": {
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-ac7a3125017b92ed.js" defer=""></script><script src="/_next/static/chunks/framework-c3d480eb9ad30ba5.js" defer=""></script><script src="/_next/static/chunks/main-853e5508e37bbe4c.js" defer=""></script><script src="/_next/static/chunks/pages/_app-998b254a061422d4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94f0db477e27e000.js" defer=""></script><script src="/_next/static/tUB-fEjoICDbTDdLhchKo/_buildManifest.js" defer=""></script><script src="/_next/static/tUB-fEjoICDbTDdLhchKo/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"tUB-fEjoICDbTDdLhchKo","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-ac7a3125017b92ed.js" defer=""></script><script src="/_next/static/chunks/framework-c3d480eb9ad30ba5.js" defer=""></script><script src="/_next/static/chunks/main-853e5508e37bbe4c.js" defer=""></script><script src="/_next/static/chunks/pages/_app-998b254a061422d4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94f0db477e27e000.js" defer=""></script><script src="/_next/static/oG1bS6tprqvmq8_YgsAS8/_buildManifest.js" defer=""></script><script src="/_next/static/oG1bS6tprqvmq8_YgsAS8/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"oG1bS6tprqvmq8_YgsAS8","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-ac7a3125017b92ed.js" defer=""></script><script src="/_next/static/chunks/framework-c3d480eb9ad30ba5.js" defer=""></script><script src="/_next/static/chunks/main-853e5508e37bbe4c.js" defer=""></script><script src="/_next/static/chunks/pages/_app-998b254a061422d4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94f0db477e27e000.js" defer=""></script><script src="/_next/static/tUB-fEjoICDbTDdLhchKo/_buildManifest.js" defer=""></script><script src="/_next/static/tUB-fEjoICDbTDdLhchKo/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"tUB-fEjoICDbTDdLhchKo","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-ac7a3125017b92ed.js" defer=""></script><script src="/_next/static/chunks/framework-c3d480eb9ad30ba5.js" defer=""></script><script src="/_next/static/chunks/main-853e5508e37bbe4c.js" defer=""></script><script src="/_next/static/chunks/pages/_app-998b254a061422d4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94f0db477e27e000.js" defer=""></script><script src="/_next/static/oG1bS6tprqvmq8_YgsAS8/_buildManifest.js" defer=""></script><script src="/_next/static/oG1bS6tprqvmq8_YgsAS8/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"oG1bS6tprqvmq8_YgsAS8","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2],{49532:function(e,t,s){"use strict";let n,l;async function a(){if(n||(l||(l=fetch("/api/config").then(e=>e.json()).then(e=>n=e.apiBaseUrl)),await l),void 0===n)throw Error("API base URL is undefined");return n}s.d(t,{b:function(){return a}})},72002:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return e2}});var n=s(24004),l=s(14978),a=s(77580);let r=a.env.NEXT_PUBLIC_PROMPTFOO_REMOTE_API_BASE_URL||a.env.NEXT_PUBLIC_PROMPTFOO_BASE_URL||a.env.PROMPTFOO_REMOTE_API_BASE_URL||"https://api.promptfoo.dev",i=a.env.NEXT_PUBLIC_PROMPTFOO_BASE_URL||a.env.PROMPTFOO_REMOTE_APP_BASE_URL||"https://app.promptfoo.dev";a?.stdout?.columns&&a?.stdout?.columns>10&&a?.stdout?.columns;var o=s(49532);let c=(0,l.createContext)(void 0),d=e=>{let{children:t}=e,[s,a]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=e=>{"Shift"===e.key&&a(!0)},t=e=>{"Shift"===e.key&&a(!1)};return window.addEventListener("keydown",e),window.addEventListener("keyup",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t)}},[]),(0,n.jsx)(c.Provider,{value:s,children:t})};var u=s(52428),p=s(11615),h=s(12594),m=s(28891),x=s(74997),g=s(93179),j=s(47887),v=s(43205),f=s(5592),b=s(14931),y=s(75307),Z=s(17178),w=s(42610),C=s(68873),k=s(49567),S=s(40982),N=s(24362),R=s(39813),I=s(1852),P=s(57027),E=s(94941),F=s(36273),O=s(96976),T=s(8508),M=s(34304),D=s(32414),L=s(67339),A=s(65969),U=s(63147),W=s(14059),_=s(23223),z=s(26110),V=s(48931),B=s(99645),J=s(29794),H=s(22701),G=s(51956),X=s(82669),Y=s(77656),q=s(37204),$=s(79685),K=s(74595);let Q={getItem:async e=>await (0,q.U2)(e)||null,setItem:async(e,t)=>{await (0,q.t8)(e,t)},removeItem:async e=>{await (0,q.IV)(e)}},ee=(0,$.Ue)()((0,K.tJ)((e,t)=>({evalId:null,setEvalId:t=>e(()=>({evalId:t})),table:null,setTable:t=>e(()=>({table:t})),config:null,setConfig:t=>e(()=>({config:t})),maxTextLength:250,setMaxTextLength:t=>e(()=>({maxTextLength:t})),wordBreak:"break-word",setWordBreak:t=>e(()=>({wordBreak:t})),showInferenceDetails:!0,setShowInferenceDetails:t=>e(()=>({showInferenceDetails:t})),renderMarkdown:!1,setRenderMarkdown:t=>e(()=>({renderMarkdown:t})),prettifyJson:!1,setPrettifyJson:t=>e(()=>({prettifyJson:t})),showPrompts:!1,setShowPrompts:t=>e(()=>({showPrompts:t})),showPassFail:!0,setShowPassFail:t=>e(()=>({showPassFail:t}))}),{name:"ResultsViewStorage",storage:(0,K.FL)(()=>Q)}));function et(e){let{open:t,onClose:a}=e,{config:r}=ee(),i=l.useRef(null),[o,c]=l.useState(!1),[d,u]=l.useState("");l.useEffect(()=>{t&&(async()=>{let{default:e}=await Promise.resolve().then(s.bind(s,34235));u(e.dump(r))})()},[t,r]);let p=()=>{c(!1),a()};return(0,n.jsxs)(J.Z,{open:t,onClose:p,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[(0,n.jsx)(X.Z,{id:"config-dialog-title",children:(0,n.jsxs)(k.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(U.Z,{variant:"h6",style:{flexGrow:1},children:"Config"}),(0,n.jsxs)(k.Z,{children:[(0,n.jsx)(A.Z,{title:"Copy to clipboard",children:(0,n.jsx)(Y.Z,{onClick:()=>{i.current&&(i.current.select(),document.execCommand("copy"),c(!0))},children:o?(0,n.jsx)(z.Z,{}):(0,n.jsx)(B.Z,{})})}),(0,n.jsx)(A.Z,{title:"Download .yaml",children:(0,n.jsx)(Y.Z,{onClick:()=>{let e=new Blob([d],{type:"text/yaml;charset=utf-8"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download="config.yaml",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(t)},children:(0,n.jsx)(V.Z,{})})})]})]})}),(0,n.jsx)(G.Z,{children:(0,n.jsx)(U.Z,{variant:"body1",component:"div",children:(0,n.jsx)("textarea",{ref:i,readOnly:!0,value:d,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:p,color:"primary",children:"Close"})})]})}var es=s(79715),en=s(34235),el=function(){let{table:e,config:t,evalId:s}=ee(),[a,r]=l.useState(!1),i=(e,t)=>{let s=URL.createObjectURL(e),n=document.createElement("a");n.href=s,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(s)},o=()=>{r(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(O.Z,{onClick:()=>{r(!0)},children:[(0,n.jsx)(P.Z,{children:(0,n.jsx)(V.Z,{fontSize:"small"})}),(0,n.jsx)(E.Z,{children:"Download"})]}),(0,n.jsx)(J.Z,{onClose:o,open:a,children:(0,n.jsx)(G.Z,{children:(0,n.jsxs)(D.Z,{direction:"column",spacing:2,sx:{width:"100%"},children:[(0,n.jsx)(S.Z,{onClick:()=>{let e=en.default.dump(t),s=new Blob([e],{type:"text/yaml;charset=utf-8"});i(s,"promptfooconfig.yaml"),o()},startIcon:(0,n.jsx)(V.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download YAML Config"}),(0,n.jsx)(S.Z,{onClick:()=>{if(!e){alert("No table data");return}let t=[],n=[...e.head.vars,...e.head.prompts.map(e=>"[".concat(e.provider,"] ").concat(e.label))];t.push(n),e.body.forEach(e=>{let s=[...e.vars,...e.outputs.map(e=>{let{pass:t,text:s}=e;return(t?"[PASS] ":"[FAIL] ")+s})];t.push(s)});let l=(0,es.P)(t),a=new Blob([l],{type:"text/csv;charset=utf-8;"});i(a,"".concat(s,"-table.csv")),o()},startIcon:(0,n.jsx)(V.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download Table CSV"}),(0,n.jsx)(S.Z,{onClick:()=>{if(!e){alert("No table data");return}let t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"});i(t,"".concat(s,"-table.json")),o()},startIcon:(0,n.jsx)(V.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download Table JSON"}),(0,n.jsx)(S.Z,{onClick:()=>{if(!e){alert("No table data");return}let t=e.body.map((t,s)=>({chosen:t.outputs.filter(e=>e.pass).map(e=>e.text),rejected:t.outputs.filter(e=>!e.pass).map(e=>e.text),vars:t.test.vars,providers:e.head.prompts.map(e=>e.provider),prompts:e.head.prompts.map(e=>e.label||e.display||e.raw)})),n=new Blob([JSON.stringify(t,null,2)],{type:"application/json"});i(n,"".concat(s,"-dpo.json")),o()},startIcon:(0,n.jsx)(V.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download DPO JSON"})]})})})]})},ea=s(69179),er=s(92715),ei=s(37803),eo=s(92863),ec=s(36001);let ed=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];function eu(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;a.current&&a.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=(Math.ceil(Math.max(...e))-Math.floor(n))/10,r=Array.from({length:11},(e,t)=>parseFloat((Math.floor(n)+t*l).toFixed(2))),i=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s].score),a=r.map(e=>n.filter(t=>t>=e&&t<e+l).length);return{label:"Column ".concat(s+1),data:a,backgroundColor:ed[s%ed.length]}});a.current=new ec.kL(s.current,{type:"bar",data:{labels:r,datasets:i},options:{animation:!1,plugins:{title:{display:!0,text:"Score Distribution"},legend:{display:!1},tooltip:{callbacks:{title:function(e){let t=e[0].datasetIndex;return"Column ".concat(t+1)},label:function(e){let t=e.dataIndex,s=r[t],n=r[t+1];return n?"".concat(s," <= score < ").concat(n):"".concat(s," <= score")}}}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function ep(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;a.current&&a.current.destroy();let e=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s]),l=n.filter(e=>e.pass).length,a=l/n.length*100;return{label:"Column ".concat(s+1),data:[a],backgroundColor:ed[s%ed.length]}});a.current=new ec.kL(s.current,{type:"bar",data:{labels:["Pass Rate (%)"],datasets:e},options:{animation:!1,plugins:{title:{display:!0,text:"Pass rate"},legend:{display:!0}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function eh(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null),[r,i]=(0,l.useState)(0),[o,c]=(0,l.useState)(1),[d,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!s.current)return;a.current&&a.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=Math.max(...e),i=t.body.map(e=>{let t=e.outputs[r].score,s=e.outputs[o].score;return{x:t,y:s,backgroundColor:s>t?"green":s<t?"red":"gray"}});a.current=new ec.kL(s.current,{type:"scatter",data:{datasets:[{data:i,backgroundColor:i.map(e=>e.backgroundColor)},{type:"line",data:[{x:n,y:n},{x:l,y:l}],borderColor:"gray",borderWidth:1,borderDash:[5,5],pointRadius:0}]},options:{animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){let s=t.body[e.dataIndex],n=s.outputs[0].text,l=s.outputs[1].text;return n.length>30&&(n=n.substring(0,30)+"..."),l.length>30&&(l=l.substring(0,30)+"..."),"Output 1: ".concat(n,"\nOutput 2: ").concat(l)}}}},scales:{x:{title:{display:!0,text:"Prompt ".concat(r+1," Score")},ticks:{callback:function(e,t,s){let n=String(Math.round(100*Number(e)));return t===s.length-1&&(n+="%"),n}}},y:{title:{display:!0,text:"Prompt ".concat(o+1," Score")},ticks:{callback:function(e,t,s){let n=String(Math.round(100*Number(e)));return t===s.length-1&&(n+="%"),n}}}}}})},[t,r,o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(J.Z,{open:d,onClose:()=>u(!1),children:[(0,n.jsx)(X.Z,{children:"Compare prompt outputs"}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(R.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(M.Z,{value:r,onChange:e=>i(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(O.Z,{value:t,children:["Prompt ",t+1]},t))})}),(0,n.jsx)(R.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(M.Z,{value:o,onChange:e=>c(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(O.Z,{value:t,children:["Prompt ",t+1]},t))})})]})]}),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>u(!0)})]})}function em(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{var e;if(!s.current)return;a.current&&a.current.destroy();let n=Object.keys((null===(e=t.head.prompts[0].metrics)||void 0===e?void 0:e.namedScores)||{}),l=t.head.prompts.map((e,s)=>{let l=n.map(s=>{var n;let l=(null===(n=e.metrics)||void 0===n?void 0:n.namedScores[s])||0,a=Math.max(...t.head.prompts.map(e=>{var t;return(null===(t=e.metrics)||void 0===t?void 0:t.namedScores[s])||0}));return l/a});return{label:"".concat(t.head.prompts[s].provider),data:l,backgroundColor:ed[s%ed.length]}});a.current=new ec.kL(s.current,{type:"bar",data:{labels:n,datasets:l},options:{scales:{x:{grid:{display:!1}},y:{ticks:{callback:function(e,t,s){let n=String(Math.round(100*Number(e)));return t===s.length-1&&(n+="%"),n}}}},plugins:{tooltip:{callbacks:{title:function(e){return e[0].dataset.label},label:function(e){let t=e.parsed.y;return"".concat(n[e.dataIndex],": ").concat((100*t).toFixed(2),"% pass rate")}}}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}ec.kL.register(ec.vn,ec.ST,ec.ho,ec.uw,ec.f$,ec.ZL,ec.jn,ec.od,ec.u,ec.wL);var ex=l.memo(function(e){var t;let{columnVisibility:s}=e,a=(0,eo.Z)();ec.kL.defaults.color="dark"===a.palette.mode?"#aaa":"#666";let[r,i]=(0,l.useState)(!0),{table:o}=ee();if(!o||!r||o.head.prompts.length<2)return null;let c=o.body.flatMap(e=>e.outputs.map(e=>e.score)),d=new Set(c);return 1===d.size?null:(0,n.jsx)(ea.SV,{fallback:null,children:(0,n.jsxs)(ei.Z,{style:{position:"relative",padding:a.spacing(3)},children:[(0,n.jsx)(Y.Z,{style:{position:"absolute",right:0,top:0},onClick:()=>i(!1),children:(0,n.jsx)(er.Z,{})}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(ep,{table:o})}),(0,n.jsx)("div",{style:{width:"33%"},children:d.size<=3&&Object.keys((null===(t=o.head.prompts[0].metrics)||void 0===t?void 0:t.namedScores)||{}).length>1?(0,n.jsx)(em,{table:o}):(0,n.jsx)(eu,{table:o})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(eh,{table:o})})]})]})})}),eg=s(36128),ej=s(9317),ev=s(20286);s(55974);var ef=e=>{let{lookup:t,onSearchTextChange:s}=e;return t&&Object.keys(t).length?(0,n.jsx)("div",{className:"custom-metric-container",children:Object.entries(t).map(e=>{let[t,l]=e;return t&&void 0!==l?(0,n.jsxs)("span",{onClick:()=>s&&s("metric=".concat(t,":[^0]")),className:s?"clickable":"",children:[t,": ",l.toFixed(2)]},t):null})}):null},eb=s(35185),ey=s(65068),eZ=s(70417),ew=s(21303),eC=s(61451),ek=s(26485),eS=s(30021),eN=s(613);function eR(e){let{gradingResults:t}=e;return t?(0,n.jsxs)(k.Z,{mt:2,children:[(0,n.jsx)(U.Z,{variant:"subtitle1",children:"Assertions"}),(0,n.jsx)(eC.Z,{children:(0,n.jsxs)(ey.Z,{children:[(0,n.jsx)(ek.Z,{children:(0,n.jsxs)(eS.Z,{children:[(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Pass"}),(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Score"}),(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Type"}),(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Value"}),(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Reason"})]})}),(0,n.jsx)(eZ.Z,{children:t.map((e,t)=>{var s,l;return e?(0,n.jsxs)(eS.Z,{children:[(0,n.jsx)(ew.Z,{children:e.pass?"✅":"❌"}),(0,n.jsx)(ew.Z,{children:e.score.toFixed(2)}),(0,n.jsx)(ew.Z,{children:(null===(s=e.assertion)||void 0===s?void 0:s.type)||""}),(0,n.jsx)(ew.Z,{style:{whiteSpace:"pre-wrap"},children:(null===(l=e.assertion)||void 0===l?void 0:l.value)?String(e.assertion.value):"-"}),(0,n.jsx)(ew.Z,{style:{whiteSpace:"pre-wrap"},children:e.reason})]},t):null})})]})})]}):null}function eI(e){let{open:t,onClose:s,prompt:a,provider:r,output:i,gradingResults:o,metadata:c}=e,[d,u]=(0,l.useState)(!1);(0,l.useEffect)(()=>{u(!1)},[a]);let p=async e=>{await navigator.clipboard.writeText(e),u(!0)};return(0,n.jsxs)(J.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(X.Z,{children:["Details",r&&": ".concat(r)]}),(0,n.jsxs)(G.Z,{children:[(0,n.jsxs)(k.Z,{mb:2,children:[(0,n.jsx)(U.Z,{variant:"subtitle1",style:{marginBottom:"1rem"},children:"Prompt"}),(0,n.jsx)(eN.u,{readOnly:!0,value:a,style:{width:"100%",padding:"0.75rem"},maxRows:20}),(0,n.jsx)(Y.Z,{onClick:()=>p(a),style:{position:"absolute",right:"10px",top:"10px"},children:d?(0,n.jsx)(z.Z,{}):(0,n.jsx)(eb.Z,{})})]}),(null==c?void 0:c.redteamFinalPrompt)&&(0,n.jsxs)(k.Z,{my:2,children:[(0,n.jsx)(U.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Modified Prompt (Red Team)"}),(0,n.jsx)(eN.u,{readOnly:!0,maxRows:20,value:c.redteamFinalPrompt,style:{width:"100%",padding:"0.75rem"}})]}),i&&(0,n.jsxs)(k.Z,{my:2,children:[(0,n.jsx)(U.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Output"}),(0,n.jsx)(eN.u,{readOnly:!0,maxRows:20,value:i,style:{width:"100%",padding:"0.75rem"}})]}),(0,n.jsx)(eR,{gradingResults:o})]}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:s,children:"Close"})})]})}var eP=s(12431),eE=s(8541),eF=function(){let e=(0,eo.Z)(),[t,s]=l.useState(!1),a=()=>{s(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{textAlign:"center",marginTop:20,marginBottom:40},children:(0,n.jsx)(S.Z,{variant:"text",color:"primary",startIcon:(0,n.jsx)(eP.Z,{}),onClick:()=>{s(!0)},children:"Generate test cases"})}),(0,n.jsxs)(J.Z,{open:t,onClose:a,children:[(0,n.jsx)(X.Z,{children:"Run on Command Line"}),(0,n.jsx)(G.Z,{children:(0,n.jsxs)(eE.Z,{children:[(0,n.jsx)("p",{children:"This feature is in beta. UI coming soon."}),(0,n.jsxs)("p",{children:["Run"," ",(0,n.jsx)(k.Z,{component:"code",sx:{backgroundColor:"dark"===e.palette.mode?"#424242":"#f0f0f0",padding:"2px 4px",borderRadius:"4px"},children:"promptfoo generate dataset"}),"to generate test cases on the command line."]})]})}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:a,color:"primary",children:"Close"})})]})]})};function eO(e){return"string"==typeof e||"number"==typeof e?e.toString().length:Array.isArray(e)?e.reduce((e,t)=>e+eO(t),0):l.isValidElement(e)&&e.props.children?l.Children.toArray(e.props.children).reduce((e,t)=>e+eO(t),0):0}let eT=l.memo(function(e){let t,{text:s,maxLength:a}=e,[r,i]=l.useState(!0),o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("string"==typeof e||"number"==typeof e){let s=e.toString();return s.slice(0,a-t)}if(Array.isArray(e)){let s=[],n=t;for(let t of e){let e=eO(t);if(n+e>a){s.push(o(t,n));break}s.push(t),n+=e}return s}if(l.isValidElement(e)&&e.props.children){let s=eO(e.props.children);if(s>a-t)return l.cloneElement(e,{...e.props,children:o(e.props.children,t)})}return e};t=l.isValidElement(s)||"string"==typeof s?s:JSON.stringify(s);let c=r?o(t):t,d=eO(t)>a;return(0,n.jsxs)("div",{style:{cursor:d?"pointer":"normal"},onClick:()=>{i(!r)},children:[c,r&&eO(t)>a&&(0,n.jsx)("span",{children:"..."})]})});var eM=s(59682),eD=s(62268),eL=s(38640),eA=s.n(eL),eU=s(33352),eW=s(73490),e_=s(24495);s(16658);var ez=e=>{let{failReasons:t}=e,[s,a]=(0,l.useState)(0);return t.length<1?null:(0,n.jsxs)("div",{className:"fail-reason",children:[t.length>1&&(0,n.jsxs)("span",{className:"fail-reason-carousel-controls",children:[(0,n.jsx)(Y.Z,{onClick:()=>{a(e=>e>0?e-1:t.length-1)},children:(0,n.jsx)(eW.Z,{sx:{fontSize:12}})}),(0,n.jsxs)("span",{children:[s+1,"/",t.length]}),(0,n.jsx)(Y.Z,{onClick:()=>{a(e=>e<t.length-1?e+1:0)},children:(0,n.jsx)(e_.Z,{sx:{fontSize:12}})})]}),t[s].trim().split("\n").map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[e,(0,n.jsx)("br",{})]},t))]})},eV=e=>{let{open:t,contextText:s,commentText:l,onClose:a,onSave:r,onChange:i}=e;return(0,n.jsxs)(J.Z,{open:t,onClose:a,fullWidth:!0,maxWidth:"sm",children:[(0,n.jsx)(X.Z,{children:"Edit Comment"}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(k.Z,{sx:{backgroundColor:"#f0f0f0",padding:2,marginBottom:2},children:s}),(0,n.jsx)(L.Z,{autoFocus:!0,margin:"dense",type:"text",fullWidth:!0,multiline:!0,rows:4,value:l,onChange:e=>i(e.target.value)})]}),(0,n.jsxs)(H.Z,{children:[(0,n.jsx)(S.Z,{onClick:r,color:"primary",variant:"contained",children:"Save"}),(0,n.jsx)(S.Z,{onClick:a,color:"primary",children:"Cancel"})]})]})};let eB=()=>{let e=(0,l.useContext)(c);if(void 0===e)throw Error("useShiftKey must be used within a ShiftKeyProvider");return e};var eJ=s(19116);let eH=l.memo(function(e){var t,s,a,r,i,o,c,d,u,p,h,m,x;let g,j,v,f,b,y,{output:Z,maxTextLength:w,rowIndex:C,promptIndex:k,onRating:S,firstOutput:N,showDiffs:R,searchText:I,showStats:P}=e,{renderMarkdown:E,prettifyJson:F,showPrompts:O,showPassFail:T}=ee(),[M,D]=l.useState(!1),[L,U]=l.useState(!1),[W,_]=l.useState(null),z=e=>{_(e||null),U(!L)},[V,B]=l.useState(!1),[J,H]=l.useState((null===(t=Z.gradingResult)||void 0===t?void 0:t.comment)||""),G=()=>{B(!0)},X="string"==typeof Z.text?Z.text:JSON.stringify(Z.text),Y=[];if(!Z.pass&&X.includes("---")&&(Y=((null===(p=Z.gradingResult)||void 0===p?void 0:p.componentResults)||[]).filter(e=>!!e&&!e.pass).map(e=>e.reason),X=X.split("---").slice(1).join("---")),R&&N){let e,t="string"==typeof N.text?N.text:JSON.stringify(N.text);t.includes("---")&&(t=t.split("---").slice(1).join("---"));try{JSON.parse(t),JSON.parse(X),e=(0,eJ.CT)(t,X)}catch(s){e=t.includes(". ")&&X.includes(". ")?(0,eJ.SY)(t,X):(0,eJ.NV)(t,X)}g=(0,n.jsx)(n.Fragment,{children:e.map((e,t)=>e.added?(0,n.jsx)("ins",{children:e.value},t):e.removed?(0,n.jsx)("del",{children:e.value},t):(0,n.jsx)("span",{children:e.value},t))})}if(I)try{let e;let t=RegExp(I,"gi"),s=[];for(;null!==(e=t.exec(X));)s.push({start:e.index,end:t.lastIndex});g=(0,n.jsx)(n.Fragment,{children:s.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:X.substring(0,s[0].start)},"text-before"),s.map((e,t)=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"search-highlight",children:X.substring(e.start,e.end)},"match-"+t),(0,n.jsx)("span",{children:X.substring(e.end,s[t+1]?s[t+1].start:X.length)},"text-after-"+t)]}))]}):(0,n.jsx)("span",{children:X},"no-match")})}catch(e){console.error("Invalid regular expression:",e.message)}else if(E)g=(0,n.jsx)(ev.U,{remarkPlugins:[eU.Z],components:{img:e=>{let{src:t,alt:s}=e;return(0,n.jsx)("img",{loading:"lazy",src:t,alt:s,onClick:()=>z(t),style:{cursor:"pointer"}})}},children:X});else if(F)try{g=(0,n.jsx)("pre",{children:JSON.stringify(JSON.parse(X),null,2)})}catch(e){}let q=l.useCallback(e=>{var t;S(e,void 0,null===(t=Z.gradingResult)||void 0===t?void 0:t.comment)},[S,null===(s=Z.gradingResult)||void 0===s?void 0:s.comment]),$=l.useCallback(()=>{let e=prompt("Set test score (0.0 - 1.0):",String(Z.score));if(null!==e){let s=parseFloat(e);if(!isNaN(s)&&s>=0&&s<=1){var t;S(void 0,s,null===(t=Z.gradingResult)||void 0===t?void 0:t.comment)}else alert("Invalid score. Please enter a value between 0.0 and 1.0.")}},[S,Z.score,null===(a=Z.gradingResult)||void 0===a?void 0:a.comment]),[K,Q]=l.useState(!1),et=l.useCallback(()=>{navigator.clipboard.writeText(Z.text),Q(!0)},[Z.text]);if(Z.latencyMs&&(v=(0,n.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(Z.latencyMs)," ms"]})),null===(r=Z.tokenUsage)||void 0===r?void 0:r.completion){let e=Z.tokenUsage.completion/(Z.latencyMs/1e3);f=(0,n.jsx)("span",{children:Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e)})}if(Z.cost&&(b=(0,n.jsxs)("span",{children:["$",Z.cost.toPrecision(2)]})),null===(i=Z.tokenUsage)||void 0===i?void 0:i.cached)j=(0,n.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(Z.tokenUsage.cached)," ","(cached)"]});else if(null===(o=Z.tokenUsage)||void 0===o?void 0:o.total){let e=Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(null!==(h=Z.tokenUsage.prompt)&&void 0!==h?h:0),t=Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(null!==(m=Z.tokenUsage.completion)&&void 0!==m?m:0),s=Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(Z.tokenUsage.total);j=(0,n.jsx)(A.Z,{title:"".concat(e," prompt tokens + ").concat(t," completion tokens = ").concat(s," total"),children:(0,n.jsxs)("span",{children:[s,("0"!==e||"0"!==t)&&" (".concat(e,"+").concat(t,")")]})})}let es=(null===(c=Z.gradingResult)||void 0===c?void 0:c.comment)&&"!highlight"!==Z.gradingResult.comment?(0,n.jsx)("div",{className:"comment",onClick:G,children:Z.gradingResult.comment}):null,en=P?(0,n.jsxs)("div",{className:"cell-detail",children:[j&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Tokens:"})," ",j]}),v&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Latency:"})," ",v]}),f&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Tokens/Sec:"})," ",f]}),b&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Cost:"})," ",b]})]}):null,el=eB(),ea=(0,n.jsxs)("div",{className:"cell-actions",children:[el&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:et,onMouseDown:e=>e.preventDefault(),children:(0,n.jsx)(A.Z,{title:"Copy output to clipboard",children:(0,n.jsx)("span",{children:K?"✅":"\uD83D\uDCCB"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>{let e;J.startsWith("!highlight")?S(void 0,void 0,e=J.slice(10).trim()):S(void 0,void 0,e=("!highlight "+J).trim()),H(e)},onMouseDown:e=>e.preventDefault(),children:(0,n.jsx)(A.Z,{title:"Toggle test highlight",children:(0,n.jsx)("span",{children:"\uD83C\uDF1F"})})})]}),Z.prompt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:()=>{D(!0)},children:(0,n.jsx)(A.Z,{title:"View ouput and test details",children:(0,n.jsx)("span",{children:"\uD83D\uDD0E"})})}),(0,n.jsx)(eI,{open:M,onClose:()=>{D(!1)},prompt:Z.prompt,provider:Z.provider,gradingResults:null===(d=Z.gradingResult)||void 0===d?void 0:d.componentResults,output:X,metadata:Z.metadata})]}),(0,n.jsx)("span",{className:"action",onClick:()=>q(!0),children:(0,n.jsx)(A.Z,{title:"Mark test passed (score 1.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4D"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>q(!1),children:(0,n.jsx)(A.Z,{title:"Mark test failed (score 0.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4E"})})}),(0,n.jsx)("span",{className:"action",onClick:$,children:(0,n.jsx)(A.Z,{title:"Set test score",children:(0,n.jsx)("span",{children:"\uD83D\uDD22"})})}),(0,n.jsx)("span",{className:"action",onClick:G,children:(0,n.jsx)(A.Z,{title:"Edit comment",children:(0,n.jsx)("span",{children:"✏️"})})})]}),er={};(null===(u=Z.gradingResult)||void 0===u?void 0:u.comment)==="!highlight"&&(er.backgroundColor="#ffffeb");let ei=0,eo=0,ec=Z.gradingResult;if(ec?ec.componentResults?ec.componentResults.forEach(e=>{(null==e?void 0:e.pass)?ei++:eo++}):(ei=ec.pass?1:0,eo=ec.pass?0:1):Z.pass?ei=1:Z.pass||(eo=1),1===eo&&1===ei)y=(0,n.jsxs)(n.Fragment,{children:["".concat(eo," FAIL")," ","".concat(ei," PASS")]});else{let e="";eo>1||ei>1&&eo>0?e="".concat(eo," FAIL"):1===eo&&(e="FAIL");let t="";ei>1||eo>1&&ei>0?t="".concat(ei," PASS"):1===ei&&0===eo&&(t="PASS");let s=e&&t?" ":"";y=(0,n.jsxs)(n.Fragment,{children:[e,s,t]})}let ed=null===(x=Z.score)||0===x||1===x?"":"(".concat(x.toFixed(2),")");return(0,n.jsxs)("div",{className:"cell",style:er,children:[T&&(0,n.jsx)(n.Fragment,{children:Z.pass?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"status pass",children:[(0,n.jsxs)("div",{className:"pill",children:[y,ed&&(0,n.jsxs)("span",{className:"score",children:[" ",ed]})]}),(0,n.jsx)(ef,{lookup:Z.namedScores})]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"status fail",children:[(0,n.jsxs)("div",{className:"pill",children:[y,ed&&(0,n.jsxs)("span",{className:"score",children:[" ",ed]})]}),(0,n.jsx)(ef,{lookup:Z.namedScores}),(0,n.jsx)("span",{className:"fail-reason",children:(0,n.jsx)(ez,{failReasons:Y})})]})})}),O&&N.prompt&&(0,n.jsxs)("div",{className:"prompt",children:[(0,n.jsx)("span",{className:"pill",children:"Prompt"}),Z.prompt]}),(0,n.jsx)(eT,{text:g||X,maxLength:w}),es,en,ea,L&&W&&(0,n.jsx)("div",{className:"lightbox",onClick:()=>z(),children:(0,n.jsx)("img",{src:W,alt:"Lightbox"})}),(0,n.jsx)(eV,{open:V,contextText:Z.text,commentText:J,onClose:()=>{B(!1)},onSave:()=>{S(void 0,void 0,J),B(!1)},onChange:H})]})});function eG(e){let{text:t,maxLength:s,expandedText:a,resourceId:r,className:i}=e,[o,c]=l.useState(!1);return(0,n.jsxs)("div",{className:"".concat(i||""),children:[(0,n.jsx)(eT,{text:t,maxLength:s}),a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A.Z,{title:"View prompt",children:(0,n.jsx)("span",{className:"action",onClick:()=>{c(!0)},children:"\uD83D\uDD0E"})}),(0,n.jsx)(eI,{open:o,onClose:()=>{c(!1)},prompt:a}),r&&(0,n.jsx)(A.Z,{title:"View other evals and datasets for this prompt",children:(0,n.jsx)("span",{className:"action",children:(0,n.jsx)(eA(),{href:"/prompts/?id=".concat(r),target:"_blank",children:(0,n.jsx)(eM.Z,{fontSize:"small"})})})})]})]})}s(93207);var eX=l.memo(function(e){let{maxTextLength:t,columnVisibility:s,wordBreak:a,filterMode:r,failureFilter:i,searchText:c,showStats:d,onFailureFilterToggle:u,onSearchTextChange:p}=e,{evalId:h,table:m,setTable:x}=ee();(0,g.Z)(m,"Table should be defined");let{head:j,body:v}=m,f=l.useCallback(async(e,t,s,n,l)=>{var a,r;let i=[...v],c={...i[e]},d=[...c.outputs],u=null!=s?s:d[t].pass,p=void 0===n?s?1:0:n||0;d[t].pass=u,d[t].score=p;let m=(null===(a=d[t].gradingResult)||void 0===a?void 0:a.componentResults)||[];if(void 0!==s){let e=m.findIndex(e=>{var t;return(null===(t=e.assertion)||void 0===t?void 0:t.type)==="human"}),t={pass:u,score:p,reason:"Manual result (overrides all other grading results)",comment:l,assertion:{type:"human"}};-1!==e?m[e]=t:m.push(t)}let g={...d[t].gradingResult||{},pass:u,score:p,reason:"Manual result (overrides all other grading results)",comment:l,assertion:(null===(r=d[t].gradingResult)||void 0===r?void 0:r.assertion)||null,componentResults:m};d[t].gradingResult=g,c.outputs=d,i[e]=c;let f={head:j,body:i};x(f);try{let e=await fetch("".concat(await (0,o.b)(),"/api/eval/").concat(h),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({table:f})});if(!e.ok)throw Error("Network response was not ok")}catch(e){console.error("Failed to update table:",e)}},[v,j,x,h]),b=Object.keys(s).length>0,y=l.useMemo(()=>{try{return RegExp(c,"i")}catch(e){return console.error("Invalid regular expression:",e.message),null}},[c]),Z=l.useMemo(()=>{try{return v.map((e,t)=>({...e,outputs:e.outputs.map((e,s)=>({...e,originalRowIndex:t,originalPromptIndex:s}))})).filter(e=>{let t=!0;return"failures"===r?t=e.outputs.some((e,t)=>{let n="Prompt ".concat(t+1);return i[n]&&!e.pass&&(!b||s[n])}):"different"===r?t=!e.outputs.every(t=>t.text===e.outputs[0].text):"highlights"===r&&(console.log(e.outputs[0].text),t=e.outputs.some(e=>{var t,s;return null===(s=e.gradingResult)||void 0===s?void 0:null===(t=s.comment)||void 0===t?void 0:t.startsWith("!highlight")})),!!t&&(!c||!y||e.outputs.some(t=>{var s,n;let l=e.vars.map(e=>"var=".concat(e)).join(" "),a="".concat(t.text," ").concat(Object.keys(t.namedScores).map(e=>"metric=".concat(e,":").concat(t.namedScores[e])).join(" ")," ").concat((null===(s=t.gradingResult)||void 0===s?void 0:s.reason)||""," ").concat((null===(n=t.gradingResult)||void 0===n?void 0:n.comment)||""),r="".concat(l," ").concat(a);return y.test(r)}))})}catch(e){return console.error("Invalid regular expression:",e.message),v}},[v,i,r,c,s,b,y]),[w,C]=l.useState({pageIndex:0,pageSize:50});l.useEffect(()=>{C(e=>({...e,pageIndex:0}))},[i,r,c]);let R=l.useMemo(()=>j.prompts.map((e,t)=>v.reduce((e,s)=>e+(s.outputs[t].pass?1:0),0)),[j.prompts,v]),I=l.useMemo(()=>j.prompts.map((e,t)=>v.reduce((e,s)=>{var n,l;return e+((null===(l=s.outputs[t].gradingResult)||void 0===l?void 0:null===(n=l.componentResults)||void 0===n?void 0:n.length)||0)},0)),[j.prompts,v]),P=l.useMemo(()=>j.prompts.map((e,t)=>v.reduce((e,s)=>{var n;let l=null===(n=s.outputs[t].gradingResult)||void 0===n?void 0:n.componentResults;return e+(l?l.filter(e=>null==e?void 0:e.pass).length:0)},0)),[j.prompts,v]),E=l.useMemo(()=>R.reduce((e,t,s,n)=>t>n[e]?s:e,0),[R]),F=R[E],T=l.useMemo(()=>(0,eg.Cl)(),[]),{renderMarkdown:D}=ee(),A=l.useMemo(()=>j.vars.length>0?[T.group({id:"vars",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Variables"}),columns:j.vars.map((e,s)=>T.accessor(e=>e.vars[s],{id:"Variable ".concat(s+1),header:()=>(0,n.jsx)(eG,{text:e,maxLength:t,className:"font-bold"}),cell:e=>{let s=e.getValue();return(0,n.jsx)("div",{className:"cell",children:D?(0,n.jsx)(ev.U,{remarkPlugins:[eU.Z],children:s}):(0,n.jsx)(eT,{text:s,maxLength:t})})},size:50}))})]:[],[T,j.vars,t,D]),W=l.useCallback((e,t)=>Z[e].outputs[t],[Z]),_=l.useCallback(e=>Z[e].outputs[0],[Z]),z=l.useMemo(()=>[T.group({id:"prompts",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Outputs"}),columns:j.prompts.map((e,s)=>T.accessor(e=>(function(e){if("string"==typeof e){let t=e.startsWith("[PASS]"),s=e;return e.startsWith("[PASS]")?s=s.slice(6):e.startsWith("[FAIL]")&&(s=s.slice(6)),{text:s,pass:t,score:t?1:0}}return e})(e.outputs[s]),{id:"Prompt ".concat(s+1),header:()=>{var l,a,o,c,h,m,x,g;let j=R[s]&&v.length?(R[s]/v.length*100).toFixed(2):"0.00",f=R[s]===F&&0!==F,b="Prompt ".concat(s+1),y=i[b]||!1,Z=d?(0,n.jsxs)("div",{className:"prompt-detail",children:[I[s]?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Asserts:"})," ",P[s],"/",I[s]," passed"]}):null,(null===(l=e.metrics)||void 0===l?void 0:l.totalLatencyMs)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Avg Latency:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.totalLatencyMs/v.length)," ","ms"]}):null,(null===(o=e.metrics)||void 0===o?void 0:null===(a=o.tokenUsage)||void 0===a?void 0:a.total)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Avg Tokens:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.total/v.length)]}):null,(null===(c=e.metrics)||void 0===c?void 0:c.totalLatencyMs)&&(null===(m=e.metrics)||void 0===m?void 0:null===(h=m.tokenUsage)||void 0===h?void 0:h.completion)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Tokens/Sec:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.completion/(e.metrics.totalLatencyMs/1e3))]}):null,(null===(x=e.metrics)||void 0===x?void 0:x.cost)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Cost:"})," $",e.metrics.cost.toPrecision(2)]}):null]}):null,w=e.provider?e.provider.split(":"):[],C=w.length>1?(0,n.jsxs)(n.Fragment,{children:[w[0],":",(0,n.jsx)("strong",{children:w.slice(1).join(":")})]}):(0,n.jsx)("strong",{children:e.provider});return(0,n.jsxs)("div",{className:"output-header",children:[(0,n.jsxs)("div",{className:"pills",children:[e.provider?(0,n.jsx)("div",{className:"provider",children:C}):null,(0,n.jsx)("div",{className:"summary",children:(0,n.jsxs)("div",{className:"highlight ".concat(f?"success":""),children:[(0,n.jsxs)("strong",{children:[j,"% passing"]})," (",R[s],"/",v.length," cases)"]})}),(null===(g=e.metrics)||void 0===g?void 0:g.namedScores)&&Object.keys(e.metrics.namedScores).length>0?(0,n.jsx)(ef,{lookup:e.metrics.namedScores,onSearchTextChange:p}):null]}),(0,n.jsx)(eG,{className:"prompt-container",text:e.label||e.display||e.raw,expandedText:e.raw,maxLength:t,resourceId:e.id}),Z,"failures"===r&&(0,n.jsx)(eD.Z,{sx:{"& .MuiFormControlLabel-label":{fontSize:"0.75rem"}},control:(0,n.jsx)(N.Z,{checked:y,onChange:e=>u(b,e.target.checked)}),label:"Show failures"})]})},cell:e=>{var l,a;let i=W(e.row.index,s);return(0,n.jsx)(eH,{output:i,maxTextLength:t,rowIndex:e.row.index,promptIndex:s,onRating:f.bind(null,null!==(l=i.originalRowIndex)&&void 0!==l?l:e.row.index,null!==(a=i.originalPromptIndex)&&void 0!==a?a:s),firstOutput:_(e.row.index),showDiffs:"different"===r,searchText:c,showStats:d})}}))})],[T,j.prompts,R,v.length,F,i,d,I,P,t,u,r,c,W,_,f,p]),V=l.useMemo(()=>{let e=v.some(e=>e.description);return e?{accessorFn:e=>e.description||"",id:"description",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Description"}),cell:e=>(0,n.jsx)("div",{className:"cell",children:(0,n.jsx)(eT,{text:String(e.getValue()),maxLength:t})}),size:50}:null},[v,t]),B=l.useMemo(()=>{let e=[];return V&&e.push(V),e.push(...A,...z),e},[V,A,z]),J=(0,ej.b7)({data:Z,columns:B,columnResizeMode:"onChange",getCoreRowModel:(0,eg.sC)(),getPaginationRowModel:(0,eg.G_)(),state:{columnVisibility:s,pagination:w}});return(0,n.jsxs)("div",{children:[(0,n.jsxs)("table",{className:"results-table firefox-fix ".concat(t<=25?"compact":""),style:{wordBreak:a},children:[(0,n.jsx)("thead",{children:J.getHeaderGroups().map(e=>(0,n.jsx)("tr",{className:"header",children:e.headers.map(e=>(0,n.jsxs)("th",{colSpan:e.colSpan,style:{width:e.getSize()},children:[e.isPlaceholder?null:(0,ej.ie)(e.column.columnDef.header,e.getContext()),(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")})]},e.id))},e.id))}),(0,n.jsx)("tbody",{children:J.getRowModel().rows.map((e,t)=>{let s=!1;return(0,n.jsx)("tr",{children:e.getVisibleCells().map(e=>{let l=e.column.id.startsWith("Variable")||"description"===e.column.id,a=!l&&!s;return a&&(s=!0),(0,n.jsx)("td",{style:{width:e.column.getSize()},className:"".concat(l?"variable":""," ").concat(0!==t||l?"":"first-prompt-row"," ").concat(a?"first-prompt-col":""),children:(0,ej.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]}),J.getPageCount()>1&&(0,n.jsxs)(k.Z,{className:"pagination",sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(S.Z,{onClick:()=>{C(e=>({...e,pageIndex:Math.max(e.pageIndex-1,0)})),window.scrollTo(0,0)},disabled:0===J.getState().pagination.pageIndex,variant:"contained",children:"Previous"}),(0,n.jsxs)(U.Z,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:["Page",(0,n.jsx)(L.Z,{size:"small",type:"number",value:J.getState().pagination.pageIndex+1,onChange:e=>{let t=e.target.value?Number(e.target.value)-1:0;C(e=>({...e,pageIndex:Math.min(Math.max(t,0),J.getPageCount()-1)}))},InputProps:{style:{width:"60px",textAlign:"center"}},variant:"outlined"}),(0,n.jsxs)("span",{children:["of ",J.getPageCount()]})]}),(0,n.jsx)(S.Z,{onClick:()=>{C(e=>({...e,pageIndex:Math.min(e.pageIndex+1,J.getPageCount()-1)})),window.scrollTo(0,0)},disabled:J.getState().pagination.pageIndex+1>=J.getPageCount(),variant:"contained",children:"Next"}),(0,n.jsxs)(U.Z,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsxs)(M.Z,{value:w.pageSize,onChange:e=>{C({pageIndex:0,pageSize:Number(e.target.value)}),window.scrollTo(0,0)},displayEmpty:!0,inputProps:{"aria-label":"Results per page"},size:"small",sx:{m:1,minWidth:80},children:[(0,n.jsx)(O.Z,{value:10,children:"10"}),(0,n.jsx)(O.Z,{value:50,children:"50"}),(0,n.jsx)(O.Z,{value:100,children:"100"}),(0,n.jsx)(O.Z,{value:500,children:"500"}),(0,n.jsx)(O.Z,{value:1e3,children:"1000"})]}),(0,n.jsx)("span",{children:"results per page"})]})]}),(0,n.jsx)(eF,{})]})}),eY=s(22695),eq=e=>{let{open:t,onClose:s}=e,{maxTextLength:l,setMaxTextLength:a,wordBreak:r,setWordBreak:i,showInferenceDetails:o,setShowInferenceDetails:c,renderMarkdown:d,setRenderMarkdown:u,prettifyJson:p,setPrettifyJson:h,showPrompts:m,setShowPrompts:x,showPassFail:g,setShowPassFail:j}=ee();return(0,n.jsxs)(J.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"sm",children:[(0,n.jsx)(X.Z,{children:"Table View Settings"}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(k.Z,{children:(0,n.jsx)(A.Z,{title:"Forcing line breaks makes it easier to adjust column widths to your liking",placement:"right",children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:"break-all"===r,onChange:e=>i(e.target.checked?"break-all":"break-word")}),label:"Force line breaks"})})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:d,onChange:e=>u(e.target.checked)}),label:"Render model outputs as Markdown"})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:p,onChange:e=>h(e.target.checked)}),label:"Prettify JSON outputs"})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(A.Z,{title:"Show the final prompt that produced the output in each cell.",placement:"right",children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:m,onChange:e=>x(e.target.checked)}),label:"Show full prompt in output cell"})})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(A.Z,{title:"Show pass/fail status for each output.",placement:"right",children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:g,onChange:e=>j(e.target.checked)}),label:"Show pass/fail status"})})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(A.Z,{title:"Show detailed inference statistics such as latency, tokens used, cost, etc.",placement:"right",children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:o,onChange:e=>c(e.target.checked)}),label:"Show inference details"})})}),(0,n.jsxs)(k.Z,{maxWidth:"sm",children:[(0,n.jsxs)(U.Z,{mt:2,children:["Max text length: ",l]}),(0,n.jsx)(eY.ZP,{min:25,max:1e3,value:l,onChange:(e,t)=>a(t)})]})]}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:s,children:"Close"})})]})},e$=e=>{let{open:t,onClose:s,shareUrl:a}=e,r=(0,l.useRef)(null),[i,o]=(0,l.useState)(!1),c=()=>{s(),o(!1)};return(0,n.jsxs)(J.Z,{open:t,onClose:c,PaperProps:{style:{minWidth:"min(660px, 100%)"}},children:[(0,n.jsx)(X.Z,{children:"Your eval is ready to share"}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(L.Z,{inputRef:r,value:a,fullWidth:!0,InputProps:{readOnly:!0,endAdornment:(0,n.jsx)(Y.Z,{onClick:()=>{r.current&&(r.current.select(),document.execCommand("copy"),o(!0))},children:i?(0,n.jsx)(z.Z,{}):(0,n.jsx)(B.Z,{})})}}),(0,n.jsx)(eE.Z,{sx:{fontSize:"0.75rem"},children:"Shared URLs are deleted after 2 weeks."})]}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:c,color:"primary",children:"Close"})})]})};s(58022);let eK=(0,W.Z)(D.Z)(e=>{let{theme:t}=e;return{maxWidth:"100%",flexWrap:"wrap",[t.breakpoints.down("sm")]:{flexDirection:"column"}}});function eQ(e){var t;let{recentEvals:s,onRecentEvalSelected:a,defaultEvalId:c}=e,d=(0,m.useRouter)(),u=(0,m.useSearchParams)(),{table:h,config:x,setConfig:D,maxTextLength:W,wordBreak:z,showInferenceDetails:V,evalId:B}=ee(),{setStateFromConfig:J}=(0,j.o)(),[H,G]=l.useState((null==u?void 0:u.get("search"))||""),[X]=(0,_.Nr)(H,1e3),Y=e=>{G(e)},[q,$]=l.useState({}),K=l.useCallback((e,t)=>{$(s=>({...s,[e]:t}))},[$]);(0,g.Z)(h,"Table data must be loaded before rendering ResultsView");let{head:Q}=h,[es,en]=l.useState("all"),[ea,er]=l.useState(!1),[ei,eo]=l.useState(""),[ec,ed]=l.useState(!1),eu=async()=>{ed(!0);try{let e=await fetch("".concat(r,"/api/eval"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{version:2,createdAt:new Date().toISOString(),results:{table:h},config:x}})}),{id:t}=await e.json(),s="".concat(i,"/eval/").concat(t);eo(s),er(!0)}catch(e){alert("Sorry, something went wrong.")}finally{ed(!1)}},ep=l.useMemo(()=>[...Q.vars.map((e,t)=>({value:"Variable ".concat(t+1),label:"Var ".concat(t+1,": ").concat(Q.vars[t].length>100?Q.vars[t].slice(0,97)+"...":Q.vars[t]),group:"Variables"})),...Q.prompts.map((e,t)=>{let s=Q.prompts[t],n=s.label||s.display||s.raw;return{value:"Prompt ".concat(t+1),label:"Prompt ".concat(t+1,": ").concat(n.length>100?n.slice(0,97)+"...":n),group:"Prompts"}})],[Q.vars,Q.prompts]),[eh,em]=l.useState(!1),[eg,ej]=l.useState(!1),[ev,ef]=l.useState({}),[eb,ey]=l.useState(ep.map(e=>e.value)),eZ=async()=>{(0,g.Z)(x,"Config must be loaded before clicking its description");let e=window.prompt("Enter new description:",x.description);if(null!==e&&e!==x.description){let t={...x,description:e};try{let e=await fetch("".concat(await (0,o.b)(),"/api/eval/").concat(B),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:t})});if(!e.ok)throw Error("Network response was not ok");D(t)}catch(e){console.error("Failed to update table:",e)}}},ew=async()=>{if(window.confirm("Are you sure you want to delete this evaluation?"))try{let e=await fetch("".concat(await (0,o.b)(),"/api/eval/").concat(B),{method:"DELETE"});if(!e.ok)throw Error("Network response was not ok");d.push("/")}catch(e){console.error("Failed to delete evaluation:",e),alert("Failed to delete evaluation")}},[eC,ek]=l.useState(null);return(0,n.jsxs)("div",{style:{marginLeft:"1rem",marginRight:"1rem"},children:[(0,n.jsx)(k.Z,{mb:2,sx:{display:"flex",alignItems:"center"},children:(0,n.jsxs)(U.Z,{variant:"h5",sx:{flexGrow:1},children:[(0,n.jsx)("span",{className:"description",onClick:eZ,children:(null==x?void 0:x.description)||B})," ",(null==x?void 0:x.description)&&(0,n.jsx)("span",{className:"description-filepath",children:B})]})}),(0,n.jsx)(k.Z,{py:"md",children:(0,n.jsxs)(eK,{direction:"row",spacing:4,alignItems:"center",children:[(0,n.jsx)(k.Z,{children:s&&s.length>0&&(0,n.jsx)(R.Z,{sx:{m:1,minWidth:200},size:"small",children:(0,n.jsx)(C.Z,{size:"small",options:s,renderOption:(e,t)=>(0,l.createElement)("li",{...e,key:t.id},t.label),style:{width:350},renderInput:e=>(0,n.jsx)(L.Z,{...e,label:"Eval run",variant:"outlined"}),defaultValue:s.find(e=>e.id===c)||s[0],onChange:(e,t)=>{t&&t.id&&a(t.id)},disableClearable:!0})})}),(0,n.jsx)(k.Z,{children:(0,n.jsxs)(R.Z,{sx:{m:1,minWidth:200,maxWidth:350},size:"small",children:[(0,n.jsx)(I.Z,{id:"visible-columns-label",children:"Columns"}),(0,n.jsx)(M.Z,{labelId:"visible-columns-label",id:"visible-columns",multiple:!0,value:eb,onChange:e=>{let{target:{value:t}}=e;ey("string"==typeof t?t.split(","):t);let s=[...Q.vars.map((e,t)=>"Variable ".concat(t+1)),...Q.prompts.map((e,t)=>"Prompt ".concat(t+1))],n={};s.forEach(e=>{n[e]=("string"==typeof t?t.split(","):t).includes(e)}),ef(n)},input:(0,n.jsx)(T.Z,{label:"Visible columns"}),renderValue:e=>e.join(", "),children:ep.map(e=>(0,n.jsxs)(O.Z,{dense:!0,value:e.value,children:[(0,n.jsx)(N.Z,{checked:eb.indexOf(e.value)>-1}),(0,n.jsx)(E.Z,{primary:e.label})]},e.value))})]})}),(0,n.jsx)(k.Z,{children:(0,n.jsxs)(R.Z,{sx:{minWidth:180},size:"small",children:[(0,n.jsx)(I.Z,{id:"failure-filter-mode-label",children:"Display"}),(0,n.jsxs)(M.Z,{labelId:"filter-mode-label",id:"filter-mode",value:es,onChange:e=>{let t=e.target.value;en(t);let s={};Q.prompts.forEach((e,n)=>{s["Prompt ".concat(n+1)]="failures"===t}),$(s)},label:"Filter",children:[(0,n.jsx)(O.Z,{value:"all",children:"Show all results"}),(0,n.jsx)(O.Z,{value:"failures",children:"Show failures only"}),(0,n.jsx)(O.Z,{value:"different",children:"Show different only"}),(0,n.jsx)(O.Z,{value:"highlights",children:"Show highlights only"})]})]})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(L.Z,{sx:{minWidth:180},size:"small",label:"Search",placeholder:"Text or regex",value:H,onChange:e=>Y(e.target.value)})}),(0,n.jsx)(k.Z,{flexGrow:1}),(0,n.jsx)(k.Z,{display:"flex",justifyContent:"flex-end",children:(0,n.jsxs)(eK,{direction:"row",spacing:2,children:[(0,n.jsx)(S.Z,{color:"primary",onClick:e=>{ek(e.currentTarget)},startIcon:(0,n.jsx)(v.Z,{}),children:"Eval actions"}),x&&(0,n.jsxs)(F.Z,{id:"eval-actions-menu",anchorEl:eC,keepMounted:!0,open:!!eC,onClose:()=>{ek(null)},children:[(0,n.jsx)(A.Z,{title:"View the configuration that defines this eval",placement:"left",children:(0,n.jsxs)(O.Z,{onClick:()=>em(!0),children:[(0,n.jsx)(P.Z,{children:(0,n.jsx)(w.Z,{fontSize:"small"})}),"View YAML"]})}),(0,n.jsx)(A.Z,{title:"Edit this eval in the web UI",placement:"left",children:(0,n.jsxs)(O.Z,{onClick:()=>{J(x),d.push("/setup/")},children:[(0,n.jsx)(P.Z,{children:(0,n.jsx)(b.Z,{fontSize:"small"})}),"Edit Eval"]})}),(0,n.jsx)(el,{}),(null==x?void 0:x.sharing)&&(0,n.jsx)(A.Z,{title:"Generate a unique URL that others can access",placement:"left",children:(0,n.jsxs)(O.Z,{onClick:eu,disabled:ec,children:[(0,n.jsx)(P.Z,{children:ec?(0,n.jsx)(p.Z,{size:16}):(0,n.jsx)(Z.Z,{fontSize:"small"})}),"Share"]})}),(0,n.jsx)(A.Z,{title:"Delete this eval",placement:"left",children:(0,n.jsxs)(O.Z,{onClick:ew,children:[(0,n.jsx)(P.Z,{children:(0,n.jsx)(f.Z,{fontSize:"small"})}),"Delete"]})})]}),(0,n.jsx)(A.Z,{title:"Edit table view settings",placement:"bottom",children:(0,n.jsx)(S.Z,{color:"primary",onClick:()=>ej(!0),startIcon:(0,n.jsx)(y.Z,{}),children:"Table Settings"})}),(null==x?void 0:null===(t=x.metadata)||void 0===t?void 0:t.redteam)&&(0,n.jsx)(A.Z,{title:"View vulnerability scan report",placement:"bottom",children:(0,n.jsx)(S.Z,{color:"primary",startIcon:(0,n.jsx)(w.Z,{}),onClick:()=>d.push("/report/?evalId=".concat(B)),children:"Vulnerability Report"})})]})})]})}),(0,n.jsx)(ex,{columnVisibility:ev}),(0,n.jsx)(eX,{maxTextLength:W,columnVisibility:ev,wordBreak:z,showStats:V,filterMode:es,failureFilter:q,searchText:X,onFailureFilterToggle:K,onSearchTextChange:Y}),(0,n.jsx)(et,{open:eh,onClose:()=>em(!1)}),(0,n.jsx)(e$,{open:ea,onClose:()=>er(!1),shareUrl:ei}),(0,n.jsx)(eq,{open:eg,onClose:()=>ej(!1)})]})}async function e0(){let e=(0,h.createClientComponentClient)(),{data:{user:t}}=await e.auth.getUser();(0,g.Z)(t,"User not logged in");let{data:s,error:n}=await e.from("EvaluationResult").select("id, createdAt").eq("user_id",t.id).order("createdAt",{ascending:!1}).limit(100);return s||[]}async function e1(e){let t=(0,h.createClientComponentClient)(),{data:s,error:n}=await t.from("EvaluationResult").select("*").eq("id",e).single();return s}function e2(e){var t;let{fetchId:s,preloadedData:a,recentEvals:i,defaultEvalId:c}=e,h=(0,m.useRouter)(),{table:j,setTable:v,setConfig:f,setEvalId:b}=ee(),[y,Z]=l.useState(!1),[w,C]=l.useState(!1),[k,S]=l.useState(i||[]),N=async()=>{let e=await fetch("".concat(await (0,o.b)(),"/api/results"),{cache:"no-store"}),t=await e.json();return S(t.data),t.data},R=l.useCallback(async e=>{let t=await fetch("".concat(await (0,o.b)(),"/api/results/").concat(e),{cache:"no-store"}),s=await t.json();v(s.data.results.table),f(s.data.config),b(e)},[v,f,b]),I=async e=>{u.Ox?(Z(!1),h.push("/eval/remote:".concat(encodeURIComponent(e)))):h.push("/eval/?evalId=".concat(encodeURIComponent(e)))},[P,E]=l.useState(c||(null===(t=k[0])||void 0===t?void 0:t.id)),F=(0,m.useSearchParams)(),O=F?F.get("evalId"):null;return(l.useEffect(()=>{if(O){let e=async()=>{await R(O),Z(!0),E(O),N()};e()}else if(a){var e;v(null===(e=a.data.results)||void 0===e?void 0:e.table),f(a.data.config),Z(!0)}else if(s){let e=async()=>{var e;let t="".concat(r,"/api/eval/").concat(s);console.log("Fetching eval from remote server",t);let n=await fetch(t);if(!n.ok){C(!0);return}let l=await n.json();v(null===(e=l.data.results)||void 0===e?void 0:e.table),f(l.data.config),Z(!0)};e()}else if(u.T8)(0,o.b)().then(e=>{let t=(0,x.io)(e);return t.on("init",e=>{console.log("Initialized socket connection",e),Z(!0),v(null==e?void 0:e.results.table),f(null==e?void 0:e.config),N().then(e=>{var t,s;E(null===(t=e[0])||void 0===t?void 0:t.id),b(null===(s=e[0])||void 0===s?void 0:s.id)})}),t.on("update",e=>{console.log("Received data update",e),v(e.results.table),f(e.config),N().then(e=>{var t;let s=null===(t=e[0])||void 0===t?void 0:t.id;s&&(E(s),b(s))})}),()=>{t.disconnect()}});else if(u.Ox)e0().then(e=>{S(e.map(e=>({id:e.id,label:e.createdAt}))),e.length>0&&e1(e[0].id).then(t=>{(0,g.Z)(t,"Eval not found");let s=t.results,n=t.config;E(e[0].id),v(s.table),f(n),Z(!0)})});else{let e=async()=>{let e=await N();if(!(e.length>0))return(0,n.jsx)("div",{className:"notice",children:"No evals yet. Share some evals to this server and they will appear here."});{let t=await (0,o.b)(),s=e[0].id,n=await fetch("".concat(t,"/api/results/").concat(s)),l=await n.json();v(l.data.results.table),f(l.data.config),Z(!0),E(s),b(s)}};e()}},[s,v,f,b,R,a,E,O]),w)?(0,n.jsx)("div",{className:"notice",children:"404 Eval not found"}):y&&j?(0,n.jsx)(d,{children:(0,n.jsx)(eQ,{defaultEvalId:P,recentEvals:k,onRecentEvalSelected:I})}):(0,n.jsxs)("div",{className:"notice",children:[(0,n.jsx)("div",{children:(0,n.jsx)(p.Z,{size:22})}),(0,n.jsx)("div",{children:"Waiting for eval data"})]})}s(94455)},52428:function(e,t,s){"use strict";s.d(t,{Ox:function(){return a},T8:function(){return l},eA:function(){return r}});var n=s(77580);let l=!n.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,a=!!n.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,r=""},47887:function(e,t,s){"use strict";s.d(t,{o:function(){return a}});var n=s(79685),l=s(74595);let a=(0,n.Ue)()((0,l.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],defaultTest:{},evaluateOptions:{},setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setDefaultTest:t=>e({defaultTest:t}),setEvaluateOptions:t=>e({evaluateOptions:t}),setStateFromConfig:t=>{let s={};t.description&&(s.description=t.description||""),t.tests&&(s.testCases=t.tests),t.providers&&(s.providers=t.providers),t.prompts&&("string"==typeof t.prompts?s.prompts=[t.prompts]:Array.isArray(t.prompts)?s.prompts=t.prompts.filter(e=>"string"==typeof e&&!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),t.defaultTest&&(s.defaultTest=t.defaultTest),t.evaluateOptions&&(s.evaluateOptions=t.evaluateOptions),e(s)},getTestSuite:()=>{let{description:e,testCases:s,providers:n,prompts:l,env:a}=t();return{env:a,description:e,providers:n,prompts:l,tests:s}}}),{name:"promptfoo",skipHydration:!0}))},55974:function(){},94455:function(){},16658:function(){},93207:function(){},58022:function(){}}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2],{49532:function(e,t,s){"use strict";let n,l;async function a(){if(n||(l||(l=fetch("/api/config").then(e=>e.json()).then(e=>n=e.apiBaseUrl)),await l),void 0===n)throw Error("API base URL is undefined");return n}s.d(t,{b:function(){return a}})},72002:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return e2}});var n=s(24004),l=s(14978),a=s(77580);let r=a.env.NEXT_PUBLIC_PROMPTFOO_REMOTE_API_BASE_URL||a.env.NEXT_PUBLIC_PROMPTFOO_BASE_URL||a.env.PROMPTFOO_REMOTE_API_BASE_URL||"https://api.promptfoo.dev",i=a.env.NEXT_PUBLIC_PROMPTFOO_BASE_URL||a.env.PROMPTFOO_REMOTE_APP_BASE_URL||"https://app.promptfoo.dev";a?.stdout?.columns&&a?.stdout?.columns>10&&a?.stdout?.columns;var o=s(49532);let c=(0,l.createContext)(void 0),d=e=>{let{children:t}=e,[s,a]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=e=>{"Shift"===e.key&&a(!0)},t=e=>{"Shift"===e.key&&a(!1)};return window.addEventListener("keydown",e),window.addEventListener("keyup",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t)}},[]),(0,n.jsx)(c.Provider,{value:s,children:t})};var u=s(52428),p=s(11615),h=s(12594),m=s(28891),x=s(74997),g=s(93179),j=s(47887),v=s(43205),f=s(5592),b=s(14931),y=s(75307),Z=s(17178),w=s(42610),C=s(68873),k=s(49567),S=s(40982),N=s(24362),R=s(39813),I=s(1852),P=s(57027),E=s(94941),F=s(36273),O=s(96976),T=s(8508),M=s(34304),D=s(32414),L=s(67339),A=s(65969),U=s(63147),W=s(14059),_=s(23223),z=s(26110),V=s(48931),B=s(99645),J=s(29794),H=s(22701),G=s(51956),X=s(82669),Y=s(77656),q=s(37204),$=s(79685),K=s(74595);let Q={getItem:async e=>await (0,q.U2)(e)||null,setItem:async(e,t)=>{await (0,q.t8)(e,t)},removeItem:async e=>{await (0,q.IV)(e)}},ee=(0,$.Ue)()((0,K.tJ)((e,t)=>({evalId:null,setEvalId:t=>e(()=>({evalId:t})),table:null,setTable:t=>e(()=>({table:t})),config:null,setConfig:t=>e(()=>({config:t})),maxTextLength:250,setMaxTextLength:t=>e(()=>({maxTextLength:t})),wordBreak:"break-word",setWordBreak:t=>e(()=>({wordBreak:t})),showInferenceDetails:!0,setShowInferenceDetails:t=>e(()=>({showInferenceDetails:t})),renderMarkdown:!1,setRenderMarkdown:t=>e(()=>({renderMarkdown:t})),prettifyJson:!1,setPrettifyJson:t=>e(()=>({prettifyJson:t})),showPrompts:!1,setShowPrompts:t=>e(()=>({showPrompts:t})),showPassFail:!0,setShowPassFail:t=>e(()=>({showPassFail:t}))}),{name:"ResultsViewStorage",storage:(0,K.FL)(()=>Q)}));function et(e){let{open:t,onClose:a}=e,{config:r}=ee(),i=l.useRef(null),[o,c]=l.useState(!1),[d,u]=l.useState("");l.useEffect(()=>{t&&(async()=>{let{default:e}=await Promise.resolve().then(s.bind(s,34235));u(e.dump(r))})()},[t,r]);let p=()=>{c(!1),a()};return(0,n.jsxs)(J.Z,{open:t,onClose:p,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[(0,n.jsx)(X.Z,{id:"config-dialog-title",children:(0,n.jsxs)(k.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(U.Z,{variant:"h6",style:{flexGrow:1},children:"Config"}),(0,n.jsxs)(k.Z,{children:[(0,n.jsx)(A.Z,{title:"Copy to clipboard",children:(0,n.jsx)(Y.Z,{onClick:()=>{i.current&&(i.current.select(),document.execCommand("copy"),c(!0))},children:o?(0,n.jsx)(z.Z,{}):(0,n.jsx)(B.Z,{})})}),(0,n.jsx)(A.Z,{title:"Download .yaml",children:(0,n.jsx)(Y.Z,{onClick:()=>{let e=new Blob([d],{type:"text/yaml;charset=utf-8"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download="config.yaml",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(t)},children:(0,n.jsx)(V.Z,{})})})]})]})}),(0,n.jsx)(G.Z,{children:(0,n.jsx)(U.Z,{variant:"body1",component:"div",children:(0,n.jsx)("textarea",{ref:i,readOnly:!0,value:d,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:p,color:"primary",children:"Close"})})]})}var es=s(79715),en=s(34235),el=function(){let{table:e,config:t,evalId:s}=ee(),[a,r]=l.useState(!1),i=(e,t)=>{let s=URL.createObjectURL(e),n=document.createElement("a");n.href=s,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(s)},o=()=>{r(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(O.Z,{onClick:()=>{r(!0)},children:[(0,n.jsx)(P.Z,{children:(0,n.jsx)(V.Z,{fontSize:"small"})}),(0,n.jsx)(E.Z,{children:"Download"})]}),(0,n.jsx)(J.Z,{onClose:o,open:a,children:(0,n.jsx)(G.Z,{children:(0,n.jsxs)(D.Z,{direction:"column",spacing:2,sx:{width:"100%"},children:[(0,n.jsx)(S.Z,{onClick:()=>{let e=en.default.dump(t),s=new Blob([e],{type:"text/yaml;charset=utf-8"});i(s,"promptfooconfig.yaml"),o()},startIcon:(0,n.jsx)(V.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download YAML Config"}),(0,n.jsx)(S.Z,{onClick:()=>{if(!e){alert("No table data");return}let t=[],n=[...e.head.vars,...e.head.prompts.map(e=>"[".concat(e.provider,"] ").concat(e.label))];t.push(n),e.body.forEach(e=>{let s=[...e.vars,...e.outputs.map(e=>{let{pass:t,text:s}=e;return(t?"[PASS] ":"[FAIL] ")+s})];t.push(s)});let l=(0,es.P)(t),a=new Blob([l],{type:"text/csv;charset=utf-8;"});i(a,"".concat(s,"-table.csv")),o()},startIcon:(0,n.jsx)(V.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download Table CSV"}),(0,n.jsx)(S.Z,{onClick:()=>{if(!e){alert("No table data");return}let t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"});i(t,"".concat(s,"-table.json")),o()},startIcon:(0,n.jsx)(V.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download Table JSON"}),(0,n.jsx)(S.Z,{onClick:()=>{if(!e){alert("No table data");return}let t=e.body.map((t,s)=>({chosen:t.outputs.filter(e=>e.pass).map(e=>e.text),rejected:t.outputs.filter(e=>!e.pass).map(e=>e.text),vars:t.test.vars,providers:e.head.prompts.map(e=>e.provider),prompts:e.head.prompts.map(e=>e.label||e.display||e.raw)})),n=new Blob([JSON.stringify(t,null,2)],{type:"application/json"});i(n,"".concat(s,"-dpo.json")),o()},startIcon:(0,n.jsx)(V.Z,{}),fullWidth:!0,sx:{justifyContent:"flex-start"},children:"Download DPO JSON"})]})})})]})},ea=s(69179),er=s(92715),ei=s(37803),eo=s(92863),ec=s(36001);let ed=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];function eu(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;a.current&&a.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=(Math.ceil(Math.max(...e))-Math.floor(n))/10,r=Array.from({length:11},(e,t)=>parseFloat((Math.floor(n)+t*l).toFixed(2))),i=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s].score),a=r.map(e=>n.filter(t=>t>=e&&t<e+l).length);return{label:"Column ".concat(s+1),data:a,backgroundColor:ed[s%ed.length]}});a.current=new ec.kL(s.current,{type:"bar",data:{labels:r,datasets:i},options:{animation:!1,plugins:{title:{display:!0,text:"Score Distribution"},legend:{display:!1},tooltip:{callbacks:{title:function(e){let t=e[0].datasetIndex;return"Column ".concat(t+1)},label:function(e){let t=e.dataIndex,s=r[t],n=r[t+1];return n?"".concat(s," <= score < ").concat(n):"".concat(s," <= score")}}}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function ep(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;a.current&&a.current.destroy();let e=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s]),l=n.filter(e=>e.pass).length,a=l/n.length*100;return{label:"Column ".concat(s+1),data:[a],backgroundColor:ed[s%ed.length]}});a.current=new ec.kL(s.current,{type:"bar",data:{labels:["Pass Rate (%)"],datasets:e},options:{animation:!1,plugins:{title:{display:!0,text:"Pass rate"},legend:{display:!0}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function eh(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null),[r,i]=(0,l.useState)(0),[o,c]=(0,l.useState)(1),[d,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!s.current)return;a.current&&a.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=Math.max(...e),i=t.body.map(e=>{let t=e.outputs[r].score,s=e.outputs[o].score;return{x:t,y:s,backgroundColor:s>t?"green":s<t?"red":"gray"}});a.current=new ec.kL(s.current,{type:"scatter",data:{datasets:[{data:i,backgroundColor:i.map(e=>e.backgroundColor)},{type:"line",data:[{x:n,y:n},{x:l,y:l}],borderColor:"gray",borderWidth:1,borderDash:[5,5],pointRadius:0}]},options:{animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){let s=t.body[e.dataIndex],n=s.outputs[0].text,l=s.outputs[1].text;return n.length>30&&(n=n.substring(0,30)+"..."),l.length>30&&(l=l.substring(0,30)+"..."),"Output 1: ".concat(n,"\nOutput 2: ").concat(l)}}}},scales:{x:{title:{display:!0,text:"Prompt ".concat(r+1," Score")},ticks:{callback:function(e,t,s){let n=String(Math.round(100*Number(e)));return t===s.length-1&&(n+="%"),n}}},y:{title:{display:!0,text:"Prompt ".concat(o+1," Score")},ticks:{callback:function(e,t,s){let n=String(Math.round(100*Number(e)));return t===s.length-1&&(n+="%"),n}}}}}})},[t,r,o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(J.Z,{open:d,onClose:()=>u(!1),children:[(0,n.jsx)(X.Z,{children:"Compare prompt outputs"}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(R.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(M.Z,{value:r,onChange:e=>i(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(O.Z,{value:t,children:["Prompt ",t+1]},t))})}),(0,n.jsx)(R.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(M.Z,{value:o,onChange:e=>c(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(O.Z,{value:t,children:["Prompt ",t+1]},t))})})]})]}),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>u(!0)})]})}function em(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{var e;if(!s.current)return;a.current&&a.current.destroy();let n=Object.keys((null===(e=t.head.prompts[0].metrics)||void 0===e?void 0:e.namedScores)||{}),l=t.head.prompts.map((e,s)=>{let l=n.map(s=>{var n;let l=(null===(n=e.metrics)||void 0===n?void 0:n.namedScores[s])||0,a=Math.max(...t.head.prompts.map(e=>{var t;return(null===(t=e.metrics)||void 0===t?void 0:t.namedScores[s])||0}));return l/a});return{label:"".concat(t.head.prompts[s].provider),data:l,backgroundColor:ed[s%ed.length]}});a.current=new ec.kL(s.current,{type:"bar",data:{labels:n,datasets:l},options:{scales:{x:{grid:{display:!1}},y:{ticks:{callback:function(e,t,s){let n=String(Math.round(100*Number(e)));return t===s.length-1&&(n+="%"),n}}}},plugins:{tooltip:{callbacks:{title:function(e){return e[0].dataset.label},label:function(e){let t=e.parsed.y;return"".concat(n[e.dataIndex],": ").concat((100*t).toFixed(2),"% pass rate")}}}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}ec.kL.register(ec.vn,ec.ST,ec.ho,ec.uw,ec.f$,ec.ZL,ec.jn,ec.od,ec.u,ec.wL);var ex=l.memo(function(e){var t;let{columnVisibility:s}=e,a=(0,eo.Z)();ec.kL.defaults.color="dark"===a.palette.mode?"#aaa":"#666";let[r,i]=(0,l.useState)(!0),{table:o}=ee();if(!o||!r||o.head.prompts.length<2)return null;let c=o.body.flatMap(e=>e.outputs.map(e=>e.score)),d=new Set(c);return 1===d.size?null:(0,n.jsx)(ea.SV,{fallback:null,children:(0,n.jsxs)(ei.Z,{style:{position:"relative",padding:a.spacing(3)},children:[(0,n.jsx)(Y.Z,{style:{position:"absolute",right:0,top:0},onClick:()=>i(!1),children:(0,n.jsx)(er.Z,{})}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(ep,{table:o})}),(0,n.jsx)("div",{style:{width:"33%"},children:d.size<=3&&Object.keys((null===(t=o.head.prompts[0].metrics)||void 0===t?void 0:t.namedScores)||{}).length>1?(0,n.jsx)(em,{table:o}):(0,n.jsx)(eu,{table:o})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(eh,{table:o})})]})]})})}),eg=s(36128),ej=s(9317),ev=s(20286);s(55974);var ef=e=>{let{lookup:t,onSearchTextChange:s}=e;return t&&Object.keys(t).length?(0,n.jsx)("div",{className:"custom-metric-container",children:Object.entries(t).map(e=>{let[t,l]=e;return t&&void 0!==l?(0,n.jsxs)("span",{onClick:()=>s&&s("metric=".concat(t,":[^0]")),className:s?"clickable":"",children:[t,": ",l.toFixed(2)]},t):null})}):null},eb=s(35185),ey=s(65068),eZ=s(70417),ew=s(21303),eC=s(61451),ek=s(26485),eS=s(30021),eN=s(613);function eR(e){let{gradingResults:t}=e;return t?(0,n.jsxs)(k.Z,{mt:2,children:[(0,n.jsx)(U.Z,{variant:"subtitle1",children:"Assertions"}),(0,n.jsx)(eC.Z,{children:(0,n.jsxs)(ey.Z,{children:[(0,n.jsx)(ek.Z,{children:(0,n.jsxs)(eS.Z,{children:[(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Pass"}),(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Score"}),(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Type"}),(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Value"}),(0,n.jsx)(ew.Z,{style:{fontWeight:"bold"},children:"Reason"})]})}),(0,n.jsx)(eZ.Z,{children:t.map((e,t)=>{var s,l;return e?(0,n.jsxs)(eS.Z,{children:[(0,n.jsx)(ew.Z,{children:e.pass?"✅":"❌"}),(0,n.jsx)(ew.Z,{children:e.score.toFixed(2)}),(0,n.jsx)(ew.Z,{children:(null===(s=e.assertion)||void 0===s?void 0:s.type)||""}),(0,n.jsx)(ew.Z,{style:{whiteSpace:"pre-wrap"},children:(null===(l=e.assertion)||void 0===l?void 0:l.value)?String(e.assertion.value):"-"}),(0,n.jsx)(ew.Z,{style:{whiteSpace:"pre-wrap"},children:e.reason})]},t):null})})]})})]}):null}function eI(e){let{open:t,onClose:s,prompt:a,provider:r,output:i,gradingResults:o,metadata:c}=e,[d,u]=(0,l.useState)(!1);(0,l.useEffect)(()=>{u(!1)},[a]);let p=async e=>{await navigator.clipboard.writeText(e),u(!0)};return(0,n.jsxs)(J.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(X.Z,{children:["Details",r&&": ".concat(r)]}),(0,n.jsxs)(G.Z,{children:[(0,n.jsxs)(k.Z,{mb:2,children:[(0,n.jsx)(U.Z,{variant:"subtitle1",style:{marginBottom:"1rem"},children:"Prompt"}),(0,n.jsx)(eN.u,{readOnly:!0,value:a,style:{width:"100%",padding:"0.75rem"},maxRows:20}),(0,n.jsx)(Y.Z,{onClick:()=>p(a),style:{position:"absolute",right:"10px",top:"10px"},children:d?(0,n.jsx)(z.Z,{}):(0,n.jsx)(eb.Z,{})})]}),(null==c?void 0:c.redteamFinalPrompt)&&(0,n.jsxs)(k.Z,{my:2,children:[(0,n.jsx)(U.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Modified Prompt (Red Team)"}),(0,n.jsx)(eN.u,{readOnly:!0,maxRows:20,value:c.redteamFinalPrompt,style:{width:"100%",padding:"0.75rem"}})]}),i&&(0,n.jsxs)(k.Z,{my:2,children:[(0,n.jsx)(U.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Output"}),(0,n.jsx)(eN.u,{readOnly:!0,maxRows:20,value:i,style:{width:"100%",padding:"0.75rem"}})]}),(0,n.jsx)(eR,{gradingResults:o})]}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:s,children:"Close"})})]})}var eP=s(12431),eE=s(8541),eF=function(){let e=(0,eo.Z)(),[t,s]=l.useState(!1),a=()=>{s(!1)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{textAlign:"center",marginTop:20,marginBottom:40},children:(0,n.jsx)(S.Z,{variant:"text",color:"primary",startIcon:(0,n.jsx)(eP.Z,{}),onClick:()=>{s(!0)},children:"Generate test cases"})}),(0,n.jsxs)(J.Z,{open:t,onClose:a,children:[(0,n.jsx)(X.Z,{children:"Run on Command Line"}),(0,n.jsx)(G.Z,{children:(0,n.jsxs)(eE.Z,{children:[(0,n.jsx)("p",{children:"This feature is in beta. UI coming soon."}),(0,n.jsxs)("p",{children:["Run"," ",(0,n.jsx)(k.Z,{component:"code",sx:{backgroundColor:"dark"===e.palette.mode?"#424242":"#f0f0f0",padding:"2px 4px",borderRadius:"4px"},children:"promptfoo generate dataset"}),"to generate test cases on the command line."]})]})}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:a,color:"primary",children:"Close"})})]})]})};function eO(e){return"string"==typeof e||"number"==typeof e?e.toString().length:Array.isArray(e)?e.reduce((e,t)=>e+eO(t),0):l.isValidElement(e)&&e.props.children?l.Children.toArray(e.props.children).reduce((e,t)=>e+eO(t),0):0}let eT=l.memo(function(e){let t,{text:s,maxLength:a}=e,[r,i]=l.useState(!0),o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("string"==typeof e||"number"==typeof e){let s=e.toString();return s.slice(0,a-t)}if(Array.isArray(e)){let s=[],n=t;for(let t of e){let e=eO(t);if(n+e>a){s.push(o(t,n));break}s.push(t),n+=e}return s}if(l.isValidElement(e)&&e.props.children){let s=eO(e.props.children);if(s>a-t)return l.cloneElement(e,{...e.props,children:o(e.props.children,t)})}return e};t=l.isValidElement(s)||"string"==typeof s?s:JSON.stringify(s);let c=r?o(t):t,d=eO(t)>a;return(0,n.jsxs)("div",{style:{cursor:d?"pointer":"normal"},onClick:()=>{i(!r)},children:[c,r&&eO(t)>a&&(0,n.jsx)("span",{children:"..."})]})});var eM=s(59682),eD=s(62268),eL=s(38640),eA=s.n(eL),eU=s(33352),eW=s(73490),e_=s(24495);s(16658);var ez=e=>{let{failReasons:t}=e,[s,a]=(0,l.useState)(0);return t.length<1?null:(0,n.jsxs)("div",{className:"fail-reason",children:[t.length>1&&(0,n.jsxs)("span",{className:"fail-reason-carousel-controls",children:[(0,n.jsx)(Y.Z,{onClick:()=>{a(e=>e>0?e-1:t.length-1)},children:(0,n.jsx)(eW.Z,{sx:{fontSize:12}})}),(0,n.jsxs)("span",{children:[s+1,"/",t.length]}),(0,n.jsx)(Y.Z,{onClick:()=>{a(e=>e<t.length-1?e+1:0)},children:(0,n.jsx)(e_.Z,{sx:{fontSize:12}})})]}),t[s].trim().split("\n").map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[e,(0,n.jsx)("br",{})]},t))]})},eV=e=>{let{open:t,contextText:s,commentText:l,onClose:a,onSave:r,onChange:i}=e;return(0,n.jsxs)(J.Z,{open:t,onClose:a,fullWidth:!0,maxWidth:"sm",children:[(0,n.jsx)(X.Z,{children:"Edit Comment"}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(k.Z,{sx:{backgroundColor:"#f0f0f0",padding:2,marginBottom:2},children:s}),(0,n.jsx)(L.Z,{autoFocus:!0,margin:"dense",type:"text",fullWidth:!0,multiline:!0,rows:4,value:l,onChange:e=>i(e.target.value)})]}),(0,n.jsxs)(H.Z,{children:[(0,n.jsx)(S.Z,{onClick:r,color:"primary",variant:"contained",children:"Save"}),(0,n.jsx)(S.Z,{onClick:a,color:"primary",children:"Cancel"})]})]})};let eB=()=>{let e=(0,l.useContext)(c);if(void 0===e)throw Error("useShiftKey must be used within a ShiftKeyProvider");return e};var eJ=s(19116);let eH=l.memo(function(e){var t,s,a,r,i,o,c,d,u,p,h,m,x;let g,j,v,f,b,y,{output:Z,maxTextLength:w,rowIndex:C,promptIndex:k,onRating:S,firstOutput:N,showDiffs:R,searchText:I,showStats:P}=e,{renderMarkdown:E,prettifyJson:F,showPrompts:O,showPassFail:T}=ee(),[M,D]=l.useState(!1),[L,U]=l.useState(!1),[W,_]=l.useState(null),z=e=>{_(e||null),U(!L)},[V,B]=l.useState(!1),[J,H]=l.useState((null===(t=Z.gradingResult)||void 0===t?void 0:t.comment)||""),G=()=>{B(!0)},X="string"==typeof Z.text?Z.text:JSON.stringify(Z.text),Y=[];if(!Z.pass&&X.includes("---")&&(Y=((null===(p=Z.gradingResult)||void 0===p?void 0:p.componentResults)||[]).filter(e=>!!e&&!e.pass).map(e=>e.reason),X=X.split("---").slice(1).join("---")),R&&N){let e,t="string"==typeof N.text?N.text:JSON.stringify(N.text);t.includes("---")&&(t=t.split("---").slice(1).join("---"));try{JSON.parse(t),JSON.parse(X),e=(0,eJ.CT)(t,X)}catch(s){e=t.includes(". ")&&X.includes(". ")?(0,eJ.SY)(t,X):(0,eJ.NV)(t,X)}g=(0,n.jsx)(n.Fragment,{children:e.map((e,t)=>e.added?(0,n.jsx)("ins",{children:e.value},t):e.removed?(0,n.jsx)("del",{children:e.value},t):(0,n.jsx)("span",{children:e.value},t))})}if(I)try{let e;let t=RegExp(I,"gi"),s=[];for(;null!==(e=t.exec(X));)s.push({start:e.index,end:t.lastIndex});g=(0,n.jsx)(n.Fragment,{children:s.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:X.substring(0,s[0].start)},"text-before"),s.map((e,t)=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"search-highlight",children:X.substring(e.start,e.end)},"match-"+t),(0,n.jsx)("span",{children:X.substring(e.end,s[t+1]?s[t+1].start:X.length)},"text-after-"+t)]}))]}):(0,n.jsx)("span",{children:X},"no-match")})}catch(e){console.error("Invalid regular expression:",e.message)}else if(E)g=(0,n.jsx)(ev.U,{remarkPlugins:[eU.Z],components:{img:e=>{let{src:t,alt:s}=e;return(0,n.jsx)("img",{loading:"lazy",src:t,alt:s,onClick:()=>z(t),style:{cursor:"pointer"}})}},children:X});else if(F)try{g=(0,n.jsx)("pre",{children:JSON.stringify(JSON.parse(X),null,2)})}catch(e){}let q=l.useCallback(e=>{var t;S(e,void 0,null===(t=Z.gradingResult)||void 0===t?void 0:t.comment)},[S,null===(s=Z.gradingResult)||void 0===s?void 0:s.comment]),$=l.useCallback(()=>{let e=prompt("Set test score (0.0 - 1.0):",String(Z.score));if(null!==e){let s=parseFloat(e);if(!isNaN(s)&&s>=0&&s<=1){var t;S(void 0,s,null===(t=Z.gradingResult)||void 0===t?void 0:t.comment)}else alert("Invalid score. Please enter a value between 0.0 and 1.0.")}},[S,Z.score,null===(a=Z.gradingResult)||void 0===a?void 0:a.comment]),[K,Q]=l.useState(!1),et=l.useCallback(()=>{navigator.clipboard.writeText(Z.text),Q(!0)},[Z.text]);if(Z.latencyMs&&(v=(0,n.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(Z.latencyMs)," ms"]})),null===(r=Z.tokenUsage)||void 0===r?void 0:r.completion){let e=Z.tokenUsage.completion/(Z.latencyMs/1e3);f=(0,n.jsx)("span",{children:Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e)})}if(Z.cost&&(b=(0,n.jsxs)("span",{children:["$",Z.cost.toPrecision(2)]})),null===(i=Z.tokenUsage)||void 0===i?void 0:i.cached)j=(0,n.jsxs)("span",{children:[Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(Z.tokenUsage.cached)," ","(cached)"]});else if(null===(o=Z.tokenUsage)||void 0===o?void 0:o.total){let e=Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(null!==(h=Z.tokenUsage.prompt)&&void 0!==h?h:0),t=Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(null!==(m=Z.tokenUsage.completion)&&void 0!==m?m:0),s=Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(Z.tokenUsage.total);j=(0,n.jsx)(A.Z,{title:"".concat(e," prompt tokens + ").concat(t," completion tokens = ").concat(s," total"),children:(0,n.jsxs)("span",{children:[s,("0"!==e||"0"!==t)&&" (".concat(e,"+").concat(t,")")]})})}let es=(null===(c=Z.gradingResult)||void 0===c?void 0:c.comment)&&"!highlight"!==Z.gradingResult.comment?(0,n.jsx)("div",{className:"comment",onClick:G,children:Z.gradingResult.comment}):null,en=P?(0,n.jsxs)("div",{className:"cell-detail",children:[j&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Tokens:"})," ",j]}),v&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Latency:"})," ",v]}),f&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Tokens/Sec:"})," ",f]}),b&&(0,n.jsxs)("div",{className:"stat-item",children:[(0,n.jsx)("strong",{children:"Cost:"})," ",b]})]}):null,el=eB(),ea=(0,n.jsxs)("div",{className:"cell-actions",children:[el&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:et,onMouseDown:e=>e.preventDefault(),children:(0,n.jsx)(A.Z,{title:"Copy output to clipboard",children:(0,n.jsx)("span",{children:K?"✅":"\uD83D\uDCCB"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>{let e;J.startsWith("!highlight")?S(void 0,void 0,e=J.slice(10).trim()):S(void 0,void 0,e=("!highlight "+J).trim()),H(e)},onMouseDown:e=>e.preventDefault(),children:(0,n.jsx)(A.Z,{title:"Toggle test highlight",children:(0,n.jsx)("span",{children:"\uD83C\uDF1F"})})})]}),Z.prompt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:()=>{D(!0)},children:(0,n.jsx)(A.Z,{title:"View ouput and test details",children:(0,n.jsx)("span",{children:"\uD83D\uDD0E"})})}),(0,n.jsx)(eI,{open:M,onClose:()=>{D(!1)},prompt:Z.prompt,provider:Z.provider,gradingResults:null===(d=Z.gradingResult)||void 0===d?void 0:d.componentResults,output:X,metadata:Z.metadata})]}),(0,n.jsx)("span",{className:"action",onClick:()=>q(!0),children:(0,n.jsx)(A.Z,{title:"Mark test passed (score 1.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4D"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>q(!1),children:(0,n.jsx)(A.Z,{title:"Mark test failed (score 0.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4E"})})}),(0,n.jsx)("span",{className:"action",onClick:$,children:(0,n.jsx)(A.Z,{title:"Set test score",children:(0,n.jsx)("span",{children:"\uD83D\uDD22"})})}),(0,n.jsx)("span",{className:"action",onClick:G,children:(0,n.jsx)(A.Z,{title:"Edit comment",children:(0,n.jsx)("span",{children:"✏️"})})})]}),er={};(null===(u=Z.gradingResult)||void 0===u?void 0:u.comment)==="!highlight"&&(er.backgroundColor="#ffffeb");let ei=0,eo=0,ec=Z.gradingResult;if(ec?ec.componentResults?ec.componentResults.forEach(e=>{(null==e?void 0:e.pass)?ei++:eo++}):(ei=ec.pass?1:0,eo=ec.pass?0:1):Z.pass?ei=1:Z.pass||(eo=1),1===eo&&1===ei)y=(0,n.jsxs)(n.Fragment,{children:["".concat(eo," FAIL")," ","".concat(ei," PASS")]});else{let e="";eo>1||ei>1&&eo>0?e="".concat(eo," FAIL"):1===eo&&(e="FAIL");let t="";ei>1||eo>1&&ei>0?t="".concat(ei," PASS"):1===ei&&0===eo&&(t="PASS");let s=e&&t?" ":"";y=(0,n.jsxs)(n.Fragment,{children:[e,s,t]})}let ed=null===(x=Z.score)||0===x||1===x?"":"(".concat(x.toFixed(2),")");return(0,n.jsxs)("div",{className:"cell",style:er,children:[T&&(0,n.jsx)(n.Fragment,{children:Z.pass?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"status pass",children:[(0,n.jsxs)("div",{className:"pill",children:[y,ed&&(0,n.jsxs)("span",{className:"score",children:[" ",ed]})]}),(0,n.jsx)(ef,{lookup:Z.namedScores})]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"status fail",children:[(0,n.jsxs)("div",{className:"pill",children:[y,ed&&(0,n.jsxs)("span",{className:"score",children:[" ",ed]})]}),(0,n.jsx)(ef,{lookup:Z.namedScores}),(0,n.jsx)("span",{className:"fail-reason",children:(0,n.jsx)(ez,{failReasons:Y})})]})})}),O&&N.prompt&&(0,n.jsxs)("div",{className:"prompt",children:[(0,n.jsx)("span",{className:"pill",children:"Prompt"}),Z.prompt]}),(0,n.jsx)(eT,{text:g||X,maxLength:w}),es,en,ea,L&&W&&(0,n.jsx)("div",{className:"lightbox",onClick:()=>z(),children:(0,n.jsx)("img",{src:W,alt:"Lightbox"})}),(0,n.jsx)(eV,{open:V,contextText:Z.text,commentText:J,onClose:()=>{B(!1)},onSave:()=>{S(void 0,void 0,J),B(!1)},onChange:H})]})});function eG(e){let{text:t,maxLength:s,expandedText:a,resourceId:r,className:i}=e,[o,c]=l.useState(!1);return(0,n.jsxs)("div",{className:"".concat(i||""),children:[(0,n.jsx)(eT,{text:t,maxLength:s}),a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A.Z,{title:"View prompt",children:(0,n.jsx)("span",{className:"action",onClick:()=>{c(!0)},children:"\uD83D\uDD0E"})}),(0,n.jsx)(eI,{open:o,onClose:()=>{c(!1)},prompt:a}),r&&(0,n.jsx)(A.Z,{title:"View other evals and datasets for this prompt",children:(0,n.jsx)("span",{className:"action",children:(0,n.jsx)(eA(),{href:"/prompts/?id=".concat(r),target:"_blank",children:(0,n.jsx)(eM.Z,{fontSize:"small"})})})})]})]})}s(93207);var eX=l.memo(function(e){let{maxTextLength:t,columnVisibility:s,wordBreak:a,filterMode:r,failureFilter:i,searchText:c,showStats:d,onFailureFilterToggle:u,onSearchTextChange:p}=e,{evalId:h,table:m,setTable:x}=ee();(0,g.Z)(m,"Table should be defined");let{head:j,body:v}=m,f=l.useCallback(async(e,t,s,n,l)=>{var a,r;let i=[...v],c={...i[e]},d=[...c.outputs],u=null!=s?s:d[t].pass,p=void 0===n?s?1:0:n||0;d[t].pass=u,d[t].score=p;let m=(null===(a=d[t].gradingResult)||void 0===a?void 0:a.componentResults)||[];if(void 0!==s){let e=m.findIndex(e=>{var t;return(null===(t=e.assertion)||void 0===t?void 0:t.type)==="human"}),t={pass:u,score:p,reason:"Manual result (overrides all other grading results)",comment:l,assertion:{type:"human"}};-1!==e?m[e]=t:m.push(t)}let g={...d[t].gradingResult||{},pass:u,score:p,reason:"Manual result (overrides all other grading results)",comment:l,assertion:(null===(r=d[t].gradingResult)||void 0===r?void 0:r.assertion)||null,componentResults:m};d[t].gradingResult=g,c.outputs=d,i[e]=c;let f={head:j,body:i};x(f);try{let e=await fetch("".concat(await (0,o.b)(),"/api/eval/").concat(h),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({table:f})});if(!e.ok)throw Error("Network response was not ok")}catch(e){console.error("Failed to update table:",e)}},[v,j,x,h]),b=Object.keys(s).length>0,y=l.useMemo(()=>{try{return RegExp(c,"i")}catch(e){return console.error("Invalid regular expression:",e.message),null}},[c]),Z=l.useMemo(()=>{try{return v.map((e,t)=>({...e,outputs:e.outputs.map((e,s)=>({...e,originalRowIndex:t,originalPromptIndex:s}))})).filter(e=>{let t=!0;return"failures"===r?t=e.outputs.some((e,t)=>{let n="Prompt ".concat(t+1);return i[n]&&!e.pass&&(!b||s[n])}):"different"===r?t=!e.outputs.every(t=>t.text===e.outputs[0].text):"highlights"===r&&(console.log(e.outputs[0].text),t=e.outputs.some(e=>{var t,s;return null===(s=e.gradingResult)||void 0===s?void 0:null===(t=s.comment)||void 0===t?void 0:t.startsWith("!highlight")})),!!t&&(!c||!y||e.outputs.some(t=>{var s,n;let l=e.vars.map(e=>"var=".concat(e)).join(" "),a="".concat(t.text," ").concat(Object.keys(t.namedScores).map(e=>"metric=".concat(e,":").concat(t.namedScores[e])).join(" ")," ").concat((null===(s=t.gradingResult)||void 0===s?void 0:s.reason)||""," ").concat((null===(n=t.gradingResult)||void 0===n?void 0:n.comment)||""),r="".concat(l," ").concat(a);return y.test(r)}))})}catch(e){return console.error("Invalid regular expression:",e.message),v}},[v,i,r,c,s,b,y]),[w,C]=l.useState({pageIndex:0,pageSize:50});l.useEffect(()=>{C(e=>({...e,pageIndex:0}))},[i,r,c]);let R=l.useMemo(()=>j.prompts.map((e,t)=>v.reduce((e,s)=>e+(s.outputs[t].pass?1:0),0)),[j.prompts,v]),I=l.useMemo(()=>j.prompts.map((e,t)=>v.reduce((e,s)=>{var n,l;return e+((null===(l=s.outputs[t].gradingResult)||void 0===l?void 0:null===(n=l.componentResults)||void 0===n?void 0:n.length)||0)},0)),[j.prompts,v]),P=l.useMemo(()=>j.prompts.map((e,t)=>v.reduce((e,s)=>{var n;let l=null===(n=s.outputs[t].gradingResult)||void 0===n?void 0:n.componentResults;return e+(l?l.filter(e=>null==e?void 0:e.pass).length:0)},0)),[j.prompts,v]),E=l.useMemo(()=>R.reduce((e,t,s,n)=>t>n[e]?s:e,0),[R]),F=R[E],T=l.useMemo(()=>(0,eg.Cl)(),[]),{renderMarkdown:D}=ee(),A=l.useMemo(()=>j.vars.length>0?[T.group({id:"vars",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Variables"}),columns:j.vars.map((e,s)=>T.accessor(e=>e.vars[s],{id:"Variable ".concat(s+1),header:()=>(0,n.jsx)(eG,{text:e,maxLength:t,className:"font-bold"}),cell:e=>{let s=e.getValue();return(0,n.jsx)("div",{className:"cell",children:D?(0,n.jsx)(ev.U,{remarkPlugins:[eU.Z],children:s}):(0,n.jsx)(eT,{text:s,maxLength:t})})},size:50}))})]:[],[T,j.vars,t,D]),W=l.useCallback((e,t)=>Z[e].outputs[t],[Z]),_=l.useCallback(e=>Z[e].outputs[0],[Z]),z=l.useMemo(()=>[T.group({id:"prompts",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Outputs"}),columns:j.prompts.map((e,s)=>T.accessor(e=>(function(e){if("string"==typeof e){let t=e.startsWith("[PASS]"),s=e;return e.startsWith("[PASS]")?s=s.slice(6):e.startsWith("[FAIL]")&&(s=s.slice(6)),{text:s,pass:t,score:t?1:0}}return e})(e.outputs[s]),{id:"Prompt ".concat(s+1),header:()=>{var l,a,o,c,h,m,x,g;let j=R[s]&&v.length?(R[s]/v.length*100).toFixed(2):"0.00",f=R[s]===F&&0!==F,b="Prompt ".concat(s+1),y=i[b]||!1,Z=d?(0,n.jsxs)("div",{className:"prompt-detail",children:[I[s]?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Asserts:"})," ",P[s],"/",I[s]," passed"]}):null,(null===(l=e.metrics)||void 0===l?void 0:l.totalLatencyMs)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Avg Latency:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.totalLatencyMs/v.length)," ","ms"]}):null,(null===(o=e.metrics)||void 0===o?void 0:null===(a=o.tokenUsage)||void 0===a?void 0:a.total)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Avg Tokens:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.total/v.length)]}):null,(null===(c=e.metrics)||void 0===c?void 0:c.totalLatencyMs)&&(null===(m=e.metrics)||void 0===m?void 0:null===(h=m.tokenUsage)||void 0===h?void 0:h.completion)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Tokens/Sec:"})," ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.completion/(e.metrics.totalLatencyMs/1e3))]}):null,(null===(x=e.metrics)||void 0===x?void 0:x.cost)?(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"Cost:"})," $",e.metrics.cost.toPrecision(2)]}):null]}):null,w=e.provider?e.provider.split(":"):[],C=w.length>1?(0,n.jsxs)(n.Fragment,{children:[w[0],":",(0,n.jsx)("strong",{children:w.slice(1).join(":")})]}):(0,n.jsx)("strong",{children:e.provider});return(0,n.jsxs)("div",{className:"output-header",children:[(0,n.jsxs)("div",{className:"pills",children:[e.provider?(0,n.jsx)("div",{className:"provider",children:C}):null,(0,n.jsx)("div",{className:"summary",children:(0,n.jsxs)("div",{className:"highlight ".concat(f?"success":""),children:[(0,n.jsxs)("strong",{children:[j,"% passing"]})," (",R[s],"/",v.length," cases)"]})}),(null===(g=e.metrics)||void 0===g?void 0:g.namedScores)&&Object.keys(e.metrics.namedScores).length>0?(0,n.jsx)(ef,{lookup:e.metrics.namedScores,onSearchTextChange:p}):null]}),(0,n.jsx)(eG,{className:"prompt-container",text:e.label||e.display||e.raw,expandedText:e.raw,maxLength:t,resourceId:e.id}),Z,"failures"===r&&(0,n.jsx)(eD.Z,{sx:{"& .MuiFormControlLabel-label":{fontSize:"0.75rem"}},control:(0,n.jsx)(N.Z,{checked:y,onChange:e=>u(b,e.target.checked)}),label:"Show failures"})]})},cell:e=>{var l,a;let i=W(e.row.index,s);return(0,n.jsx)(eH,{output:i,maxTextLength:t,rowIndex:e.row.index,promptIndex:s,onRating:f.bind(null,null!==(l=i.originalRowIndex)&&void 0!==l?l:e.row.index,null!==(a=i.originalPromptIndex)&&void 0!==a?a:s),firstOutput:_(e.row.index),showDiffs:"different"===r,searchText:c,showStats:d})}}))})],[T,j.prompts,R,v.length,F,i,d,I,P,t,u,r,c,W,_,f,p]),V=l.useMemo(()=>{let e=v.some(e=>e.description);return e?{accessorFn:e=>e.description||"",id:"description",header:()=>(0,n.jsx)("span",{className:"font-bold",children:"Description"}),cell:e=>(0,n.jsx)("div",{className:"cell",children:(0,n.jsx)(eT,{text:String(e.getValue()),maxLength:t})}),size:50}:null},[v,t]),B=l.useMemo(()=>{let e=[];return V&&e.push(V),e.push(...A,...z),e},[V,A,z]),J=(0,ej.b7)({data:Z,columns:B,columnResizeMode:"onChange",getCoreRowModel:(0,eg.sC)(),getPaginationRowModel:(0,eg.G_)(),state:{columnVisibility:s,pagination:w}});return(0,n.jsxs)("div",{children:[(0,n.jsxs)("table",{className:"results-table firefox-fix ".concat(t<=25?"compact":""),style:{wordBreak:a},children:[(0,n.jsx)("thead",{children:J.getHeaderGroups().map(e=>(0,n.jsx)("tr",{className:"header",children:e.headers.map(e=>(0,n.jsxs)("th",{colSpan:e.colSpan,style:{width:e.getSize()},children:[e.isPlaceholder?null:(0,ej.ie)(e.column.columnDef.header,e.getContext()),(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")})]},e.id))},e.id))}),(0,n.jsx)("tbody",{children:J.getRowModel().rows.map((e,t)=>{let s=!1;return(0,n.jsx)("tr",{children:e.getVisibleCells().map(e=>{let l=e.column.id.startsWith("Variable")||"description"===e.column.id,a=!l&&!s;return a&&(s=!0),(0,n.jsx)("td",{style:{width:e.column.getSize()},className:"".concat(l?"variable":""," ").concat(0!==t||l?"":"first-prompt-row"," ").concat(a?"first-prompt-col":""),children:(0,ej.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]}),J.getPageCount()>1&&(0,n.jsxs)(k.Z,{className:"pagination",sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(S.Z,{onClick:()=>{C(e=>({...e,pageIndex:Math.max(e.pageIndex-1,0)})),window.scrollTo(0,0)},disabled:0===J.getState().pagination.pageIndex,variant:"contained",children:"Previous"}),(0,n.jsxs)(U.Z,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:["Page",(0,n.jsx)(L.Z,{size:"small",type:"number",value:J.getState().pagination.pageIndex+1,onChange:e=>{let t=e.target.value?Number(e.target.value)-1:0;C(e=>({...e,pageIndex:Math.min(Math.max(t,0),J.getPageCount()-1)}))},InputProps:{style:{width:"60px",textAlign:"center"}},variant:"outlined"}),(0,n.jsxs)("span",{children:["of ",J.getPageCount()]})]}),(0,n.jsx)(S.Z,{onClick:()=>{C(e=>({...e,pageIndex:Math.min(e.pageIndex+1,J.getPageCount()-1)})),window.scrollTo(0,0)},disabled:J.getState().pagination.pageIndex+1>=J.getPageCount(),variant:"contained",children:"Next"}),(0,n.jsxs)(U.Z,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsxs)(M.Z,{value:w.pageSize,onChange:e=>{C({pageIndex:0,pageSize:Number(e.target.value)}),window.scrollTo(0,0)},displayEmpty:!0,inputProps:{"aria-label":"Results per page"},size:"small",sx:{m:1,minWidth:80},children:[(0,n.jsx)(O.Z,{value:10,children:"10"}),(0,n.jsx)(O.Z,{value:50,children:"50"}),(0,n.jsx)(O.Z,{value:100,children:"100"}),(0,n.jsx)(O.Z,{value:500,children:"500"}),(0,n.jsx)(O.Z,{value:1e3,children:"1000"})]}),(0,n.jsx)("span",{children:"results per page"})]})]}),(0,n.jsx)(eF,{})]})}),eY=s(22695),eq=e=>{let{open:t,onClose:s}=e,{maxTextLength:l,setMaxTextLength:a,wordBreak:r,setWordBreak:i,showInferenceDetails:o,setShowInferenceDetails:c,renderMarkdown:d,setRenderMarkdown:u,prettifyJson:p,setPrettifyJson:h,showPrompts:m,setShowPrompts:x,showPassFail:g,setShowPassFail:j}=ee();return(0,n.jsxs)(J.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"sm",children:[(0,n.jsx)(X.Z,{children:"Table View Settings"}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(k.Z,{children:(0,n.jsx)(A.Z,{title:"Forcing line breaks makes it easier to adjust column widths to your liking",placement:"right",children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:"break-all"===r,onChange:e=>i(e.target.checked?"break-all":"break-word")}),label:"Force line breaks"})})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:d,onChange:e=>u(e.target.checked)}),label:"Render model outputs as Markdown"})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:p,onChange:e=>h(e.target.checked)}),label:"Prettify JSON outputs"})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(A.Z,{title:"Show the final prompt that produced the output in each cell.",placement:"right",children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:m,onChange:e=>x(e.target.checked)}),label:"Show full prompt in output cell"})})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(A.Z,{title:"Show pass/fail status for each output.",placement:"right",children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:g,onChange:e=>j(e.target.checked)}),label:"Show pass/fail status"})})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(A.Z,{title:"Show detailed inference statistics such as latency, tokens used, cost, etc.",placement:"right",children:(0,n.jsx)(eD.Z,{control:(0,n.jsx)(N.Z,{checked:o,onChange:e=>c(e.target.checked)}),label:"Show inference details"})})}),(0,n.jsxs)(k.Z,{maxWidth:"sm",children:[(0,n.jsxs)(U.Z,{mt:2,children:["Max text length: ",l]}),(0,n.jsx)(eY.ZP,{min:25,max:1e3,value:l,onChange:(e,t)=>a(t)})]})]}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:s,children:"Close"})})]})},e$=e=>{let{open:t,onClose:s,shareUrl:a}=e,r=(0,l.useRef)(null),[i,o]=(0,l.useState)(!1),c=()=>{s(),o(!1)};return(0,n.jsxs)(J.Z,{open:t,onClose:c,PaperProps:{style:{minWidth:"min(660px, 100%)"}},children:[(0,n.jsx)(X.Z,{children:"Your eval is ready to share"}),(0,n.jsxs)(G.Z,{children:[(0,n.jsx)(L.Z,{inputRef:r,value:a,fullWidth:!0,InputProps:{readOnly:!0,endAdornment:(0,n.jsx)(Y.Z,{onClick:()=>{r.current&&(r.current.select(),document.execCommand("copy"),o(!0))},children:i?(0,n.jsx)(z.Z,{}):(0,n.jsx)(B.Z,{})})}}),(0,n.jsx)(eE.Z,{sx:{fontSize:"0.75rem"},children:"Shared URLs are deleted after 2 weeks."})]}),(0,n.jsx)(H.Z,{children:(0,n.jsx)(S.Z,{onClick:c,color:"primary",children:"Close"})})]})};s(58022);let eK=(0,W.Z)(D.Z)(e=>{let{theme:t}=e;return{maxWidth:"100%",flexWrap:"wrap",[t.breakpoints.down("sm")]:{flexDirection:"column"}}});function eQ(e){var t;let{recentEvals:s,onRecentEvalSelected:a,defaultEvalId:c}=e,d=(0,m.useRouter)(),u=(0,m.useSearchParams)(),{table:h,config:x,setConfig:D,maxTextLength:W,wordBreak:z,showInferenceDetails:V,evalId:B}=ee(),{setStateFromConfig:J}=(0,j.o)(),[H,G]=l.useState((null==u?void 0:u.get("search"))||""),[X]=(0,_.Nr)(H,1e3),Y=e=>{G(e)},[q,$]=l.useState({}),K=l.useCallback((e,t)=>{$(s=>({...s,[e]:t}))},[$]);(0,g.Z)(h,"Table data must be loaded before rendering ResultsView");let{head:Q}=h,[es,en]=l.useState("all"),[ea,er]=l.useState(!1),[ei,eo]=l.useState(""),[ec,ed]=l.useState(!1),eu=async()=>{ed(!0);try{let e=await fetch("".concat(r,"/api/eval"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{version:2,createdAt:new Date().toISOString(),results:{table:h},config:x}})}),{id:t}=await e.json(),s="".concat(i,"/eval/").concat(t);eo(s),er(!0)}catch(e){alert("Sorry, something went wrong.")}finally{ed(!1)}},ep=l.useMemo(()=>[...Q.vars.map((e,t)=>({value:"Variable ".concat(t+1),label:"Var ".concat(t+1,": ").concat(Q.vars[t].length>100?Q.vars[t].slice(0,97)+"...":Q.vars[t]),group:"Variables"})),...Q.prompts.map((e,t)=>{let s=Q.prompts[t],n=s.label||s.display||s.raw;return{value:"Prompt ".concat(t+1),label:"Prompt ".concat(t+1,": ").concat(n.length>100?n.slice(0,97)+"...":n),group:"Prompts"}})],[Q.vars,Q.prompts]),[eh,em]=l.useState(!1),[eg,ej]=l.useState(!1),[ev,ef]=l.useState({}),[eb,ey]=l.useState(ep.map(e=>e.value)),eZ=async()=>{(0,g.Z)(x,"Config must be loaded before clicking its description");let e=window.prompt("Enter new description:",x.description);if(null!==e&&e!==x.description){let t={...x,description:e};try{let e=await fetch("".concat(await (0,o.b)(),"/api/eval/").concat(B),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:t})});if(!e.ok)throw Error("Network response was not ok");D(t)}catch(e){console.error("Failed to update table:",e)}}},ew=async()=>{if(window.confirm("Are you sure you want to delete this evaluation?"))try{let e=await fetch("".concat(await (0,o.b)(),"/api/eval/").concat(B),{method:"DELETE"});if(!e.ok)throw Error("Network response was not ok");d.push("/")}catch(e){console.error("Failed to delete evaluation:",e),alert("Failed to delete evaluation")}},[eC,ek]=l.useState(null);return(0,n.jsxs)("div",{style:{marginLeft:"1rem",marginRight:"1rem"},children:[(0,n.jsx)(k.Z,{mb:2,sx:{display:"flex",alignItems:"center"},children:(0,n.jsxs)(U.Z,{variant:"h5",sx:{flexGrow:1},children:[(0,n.jsx)("span",{className:"description",onClick:eZ,children:(null==x?void 0:x.description)||B})," ",(null==x?void 0:x.description)&&(0,n.jsx)("span",{className:"description-filepath",children:B})]})}),(0,n.jsx)(k.Z,{py:"md",children:(0,n.jsxs)(eK,{direction:"row",spacing:4,alignItems:"center",children:[(0,n.jsx)(k.Z,{children:s&&s.length>0&&(0,n.jsx)(R.Z,{sx:{m:1,minWidth:200},size:"small",children:(0,n.jsx)(C.Z,{size:"small",options:s,renderOption:(e,t)=>(0,l.createElement)("li",{...e,key:t.id},t.label),style:{width:350},renderInput:e=>(0,n.jsx)(L.Z,{...e,label:"Eval run",variant:"outlined"}),defaultValue:s.find(e=>e.id===c)||s[0],onChange:(e,t)=>{t&&t.id&&a(t.id)},disableClearable:!0})})}),(0,n.jsx)(k.Z,{children:(0,n.jsxs)(R.Z,{sx:{m:1,minWidth:200,maxWidth:350},size:"small",children:[(0,n.jsx)(I.Z,{id:"visible-columns-label",children:"Columns"}),(0,n.jsx)(M.Z,{labelId:"visible-columns-label",id:"visible-columns",multiple:!0,value:eb,onChange:e=>{let{target:{value:t}}=e;ey("string"==typeof t?t.split(","):t);let s=[...Q.vars.map((e,t)=>"Variable ".concat(t+1)),...Q.prompts.map((e,t)=>"Prompt ".concat(t+1))],n={};s.forEach(e=>{n[e]=("string"==typeof t?t.split(","):t).includes(e)}),ef(n)},input:(0,n.jsx)(T.Z,{label:"Visible columns"}),renderValue:e=>e.join(", "),children:ep.map(e=>(0,n.jsxs)(O.Z,{dense:!0,value:e.value,children:[(0,n.jsx)(N.Z,{checked:eb.indexOf(e.value)>-1}),(0,n.jsx)(E.Z,{primary:e.label})]},e.value))})]})}),(0,n.jsx)(k.Z,{children:(0,n.jsxs)(R.Z,{sx:{minWidth:180},size:"small",children:[(0,n.jsx)(I.Z,{id:"failure-filter-mode-label",children:"Display"}),(0,n.jsxs)(M.Z,{labelId:"filter-mode-label",id:"filter-mode",value:es,onChange:e=>{let t=e.target.value;en(t);let s={};Q.prompts.forEach((e,n)=>{s["Prompt ".concat(n+1)]="failures"===t}),$(s)},label:"Filter",children:[(0,n.jsx)(O.Z,{value:"all",children:"Show all results"}),(0,n.jsx)(O.Z,{value:"failures",children:"Show failures only"}),(0,n.jsx)(O.Z,{value:"different",children:"Show different only"}),(0,n.jsx)(O.Z,{value:"highlights",children:"Show highlights only"})]})]})}),(0,n.jsx)(k.Z,{children:(0,n.jsx)(L.Z,{sx:{minWidth:180},size:"small",label:"Search",placeholder:"Text or regex",value:H,onChange:e=>Y(e.target.value)})}),(0,n.jsx)(k.Z,{flexGrow:1}),(0,n.jsx)(k.Z,{display:"flex",justifyContent:"flex-end",children:(0,n.jsxs)(eK,{direction:"row",spacing:2,children:[(0,n.jsx)(S.Z,{color:"primary",onClick:e=>{ek(e.currentTarget)},startIcon:(0,n.jsx)(v.Z,{}),children:"Eval actions"}),x&&(0,n.jsxs)(F.Z,{id:"eval-actions-menu",anchorEl:eC,keepMounted:!0,open:!!eC,onClose:()=>{ek(null)},children:[(0,n.jsx)(A.Z,{title:"View the configuration that defines this eval",placement:"left",children:(0,n.jsxs)(O.Z,{onClick:()=>em(!0),children:[(0,n.jsx)(P.Z,{children:(0,n.jsx)(w.Z,{fontSize:"small"})}),"View YAML"]})}),(0,n.jsx)(A.Z,{title:"Edit this eval in the web UI",placement:"left",children:(0,n.jsxs)(O.Z,{onClick:()=>{J(x),d.push("/setup/")},children:[(0,n.jsx)(P.Z,{children:(0,n.jsx)(b.Z,{fontSize:"small"})}),"Edit Eval"]})}),(0,n.jsx)(el,{}),(null==x?void 0:x.sharing)&&(0,n.jsx)(A.Z,{title:"Generate a unique URL that others can access",placement:"left",children:(0,n.jsxs)(O.Z,{onClick:eu,disabled:ec,children:[(0,n.jsx)(P.Z,{children:ec?(0,n.jsx)(p.Z,{size:16}):(0,n.jsx)(Z.Z,{fontSize:"small"})}),"Share"]})}),(0,n.jsx)(A.Z,{title:"Delete this eval",placement:"left",children:(0,n.jsxs)(O.Z,{onClick:ew,children:[(0,n.jsx)(P.Z,{children:(0,n.jsx)(f.Z,{fontSize:"small"})}),"Delete"]})})]}),(0,n.jsx)(A.Z,{title:"Edit table view settings",placement:"bottom",children:(0,n.jsx)(S.Z,{color:"primary",onClick:()=>ej(!0),startIcon:(0,n.jsx)(y.Z,{}),children:"Table Settings"})}),(null==x?void 0:null===(t=x.metadata)||void 0===t?void 0:t.redteam)&&(0,n.jsx)(A.Z,{title:"View vulnerability scan report",placement:"bottom",children:(0,n.jsx)(S.Z,{color:"primary",startIcon:(0,n.jsx)(w.Z,{}),onClick:()=>d.push("/report/?evalId=".concat(B)),children:"Vulnerability Report"})})]})})]})}),(0,n.jsx)(ex,{columnVisibility:ev}),(0,n.jsx)(eX,{maxTextLength:W,columnVisibility:ev,wordBreak:z,showStats:V,filterMode:es,failureFilter:q,searchText:X,onFailureFilterToggle:K,onSearchTextChange:Y}),(0,n.jsx)(et,{open:eh,onClose:()=>em(!1)}),(0,n.jsx)(e$,{open:ea,onClose:()=>er(!1),shareUrl:ei}),(0,n.jsx)(eq,{open:eg,onClose:()=>ej(!1)})]})}async function e0(){let e=(0,h.createClientComponentClient)(),{data:{user:t}}=await e.auth.getUser();(0,g.Z)(t,"User not logged in");let{data:s,error:n}=await e.from("EvaluationResult").select("id, createdAt").eq("user_id",t.id).order("createdAt",{ascending:!1}).limit(100);return s||[]}async function e1(e){let t=(0,h.createClientComponentClient)(),{data:s,error:n}=await t.from("EvaluationResult").select("*").eq("id",e).single();return s}function e2(e){var t;let{fetchId:s,preloadedData:a,recentEvals:i,defaultEvalId:c}=e,h=(0,m.useRouter)(),{table:j,setTable:v,setConfig:f,setEvalId:b}=ee(),[y,Z]=l.useState(!1),[w,C]=l.useState(!1),[k,S]=l.useState(i||[]),N=async()=>{let e=await fetch("".concat(await (0,o.b)(),"/api/results"),{cache:"no-store"}),t=await e.json();return S(t.data),t.data},R=l.useCallback(async e=>{let t=await fetch("".concat(await (0,o.b)(),"/api/results/").concat(e),{cache:"no-store"}),s=await t.json();v(s.data.results.table),f(s.data.config),b(e)},[v,f,b]),I=async e=>{u.Ox?(Z(!1),h.push("/eval/remote:".concat(encodeURIComponent(e)))):h.push("/eval/?evalId=".concat(encodeURIComponent(e)))},[P,E]=l.useState(c||(null===(t=k[0])||void 0===t?void 0:t.id)),F=(0,m.useSearchParams)(),O=F?F.get("evalId"):null;return(l.useEffect(()=>{if(O){let e=async()=>{await R(O),Z(!0),E(O),N()};e()}else if(a){var e;v(null===(e=a.data.results)||void 0===e?void 0:e.table),f(a.data.config),Z(!0)}else if(s){let e=async()=>{var e;let t="".concat(r,"/api/eval/").concat(s);console.log("Fetching eval from remote server",t);let n=await fetch(t);if(!n.ok){C(!0);return}let l=await n.json();v(null===(e=l.data.results)||void 0===e?void 0:e.table),f(l.data.config),Z(!0)};e()}else if(u.T8)(0,o.b)().then(e=>{let t=(0,x.io)(e);return t.on("init",e=>{console.log("Initialized socket connection",e),Z(!0),v(null==e?void 0:e.results.table),f(null==e?void 0:e.config),N().then(e=>{var t,s;E(null===(t=e[0])||void 0===t?void 0:t.id),b(null===(s=e[0])||void 0===s?void 0:s.id)})}),t.on("update",e=>{console.log("Received data update",e),v(e.results.table),f(e.config),N().then(e=>{var t;let s=null===(t=e[0])||void 0===t?void 0:t.id;s&&(E(s),b(s))})}),()=>{t.disconnect()}});else if(u.Ox)e0().then(e=>{S(e.map(e=>({id:e.id,label:e.createdAt}))),e.length>0&&e1(e[0].id).then(t=>{(0,g.Z)(t,"Eval not found");let s=t.results,n=t.config;E(e[0].id),v(s.table),f(n),Z(!0)})});else{let e=async()=>{let e=await N();if(!(e.length>0))return(0,n.jsx)("div",{className:"notice",children:"No evals yet. Share some evals to this server and they will appear here."});{let t=await (0,o.b)(),s=e[0].id,n=await fetch("".concat(t,"/api/results/").concat(s)),l=await n.json();v(l.data.results.table),f(l.data.config),Z(!0),E(s),b(s)}};e()}},[s,v,f,b,R,a,E,O]),w)?(0,n.jsx)("div",{className:"notice",children:"404 Eval not found"}):y&&j?(0,n.jsx)(d,{children:(0,n.jsx)(eQ,{defaultEvalId:P,recentEvals:k,onRecentEvalSelected:I})}):(0,n.jsxs)("div",{className:"notice",children:[(0,n.jsx)("div",{children:(0,n.jsx)(p.Z,{size:22})}),(0,n.jsx)("div",{children:"Waiting for eval data"})]})}s(94455)},52428:function(e,t,s){"use strict";s.d(t,{Ox:function(){return a},T8:function(){return l},eA:function(){return r}});var n=s(77580);let l=!n.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,a=!!n.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,r=""},47887:function(e,t,s){"use strict";s.d(t,{o:function(){return a}});var n=s(79685),l=s(74595);let a=(0,n.Ue)()((0,l.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],defaultTest:{},evaluateOptions:{},scenarios:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setDefaultTest:t=>e({defaultTest:t}),setEvaluateOptions:t=>e({evaluateOptions:t}),setScenarios:t=>e({scenarios:t}),setStateFromConfig:t=>{let s={};t.description&&(s.description=t.description||""),t.tests&&(s.testCases=t.tests),t.providers&&(s.providers=t.providers),t.prompts&&("string"==typeof t.prompts?s.prompts=[t.prompts]:Array.isArray(t.prompts)?s.prompts=t.prompts.filter(e=>"string"==typeof e&&!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),t.defaultTest&&(s.defaultTest=t.defaultTest),t.evaluateOptions&&(s.evaluateOptions=t.evaluateOptions),t.scenarios&&(s.scenarios=t.scenarios),e(s)},getTestSuite:()=>{let{description:e,testCases:s,providers:n,prompts:l,env:a,scenarios:r}=t();return{env:a,description:e,providers:n,prompts:l,tests:s,scenarios:r}}}),{name:"promptfoo",skipHydration:!0}))},55974:function(){},94455:function(){},16658:function(){},93207:function(){},58022:function(){}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[413],{72846:function(e,t,n){Promise.resolve().then(n.bind(n,83013))},83013:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ed}});var a=n(24004),i=n(14978),r=n(69179),l=n(47887),s=n(49567),o=n(40982),c=n(11520),d=n(29794),p=n(22701),u=n(51956),h=n(8541),x=n(82669),m=n(32414),f=n(63147),g=n(75307),j=n(63346),v=n(89235),Z=n(4078),b=n(67339),y=()=>{let{env:e,setEnv:t}=(0,l.o)(),[n,r]=(0,i.useState)(!1),[s,c]=(0,i.useState)(e),h=()=>{r(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Z,{variant:"outlined",startIcon:(0,a.jsx)(g.Z,{}),onClick:()=>{r(!0)},children:"API keys"}),(0,a.jsxs)(d.Z,{open:n,onClose:h,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Provider settings"}),(0,a.jsxs)(u.Z,{children:[(0,a.jsxs)(j.Z,{defaultExpanded:!0,children:[(0,a.jsx)(Z.Z,{children:"OpenAI"}),(0,a.jsxs)(v.Z,{children:[(0,a.jsx)(b.Z,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:s.OPENAI_API_KEY,onChange:e=>c({...s,OPENAI_API_KEY:e.target.value})}),(0,a.jsx)(b.Z,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:s.OPENAI_API_HOST,onChange:e=>c({...s,OPENAI_API_HOST:e.target.value})}),(0,a.jsx)(b.Z,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:s.OPENAI_ORGANIZATION,onChange:e=>c({...s,OPENAI_ORGANIZATION:e.target.value})})]})]}),(0,a.jsxs)(j.Z,{children:[(0,a.jsx)(Z.Z,{children:"Azure"}),(0,a.jsx)(v.Z,{children:(0,a.jsx)(b.Z,{label:"Azure API key",fullWidth:!0,margin:"normal",value:s.AZURE_OPENAI_API_KEY,onChange:e=>c({...s,AZURE_OPENAI_API_KEY:e.target.value})})})]}),(0,a.jsxs)(j.Z,{children:[(0,a.jsx)(Z.Z,{children:"Amazon Bedrock"}),(0,a.jsx)(v.Z,{children:(0,a.jsx)(b.Z,{label:"Bedrock Region",fullWidth:!0,margin:"normal",value:s.AWS_BEDROCK_REGION,onChange:e=>c({...s,AWS_BEDROCK_REGION:e.target.value})})})]}),(0,a.jsxs)(j.Z,{children:[(0,a.jsx)(Z.Z,{children:"Anthropic"}),(0,a.jsx)(v.Z,{children:(0,a.jsx)(b.Z,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:s.ANTHROPIC_API_KEY,onChange:e=>c({...s,ANTHROPIC_API_KEY:e.target.value})})})]}),(0,a.jsxs)(j.Z,{children:[(0,a.jsx)(Z.Z,{children:"Google Vertex AI"}),(0,a.jsx)(v.Z,{children:(0,a.jsx)(b.Z,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:s.VERTEX_API_KEY,onChange:e=>c({...s,VERTEX_API_KEY:e.target.value})})}),(0,a.jsx)(v.Z,{children:(0,a.jsx)(b.Z,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:s.VERTEX_PROJECT_ID,onChange:e=>c({...s,VERTEX_PROJECT_ID:e.target.value})})}),(0,a.jsx)(v.Z,{children:(0,a.jsx)(b.Z,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:s.VERTEX_REGION,onChange:e=>c({...s,VERTEX_REGION:e.target.value})})})]}),(0,a.jsxs)(j.Z,{children:[(0,a.jsx)(Z.Z,{children:"Replicate"}),(0,a.jsx)(v.Z,{children:(0,a.jsx)(b.Z,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:s.REPLICATE_API_KEY,onChange:e=>c({...s,REPLICATE_API_KEY:e.target.value})})})]})]}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(o.Z,{onClick:h,color:"primary",children:"Cancel"}),(0,a.jsx)(o.Z,{onClick:()=>{t(s),h()},color:"primary",variant:"contained",children:"Save"})]})]})]})},_=n(35185),C=n(5592),k=n(14931),A=n(2185),E=n(77656),I=n(65068),O=n(70417),S=n(21303),P=n(61451),T=n(30021),w=n(65969),R=e=>{let{open:t,prompt:n,index:r,onAdd:l,onCancel:s}=e,[c,h]=i.useState(n),m=i.useRef(null);i.useEffect(()=>{h(n)},[n]);let f=e=>{l(c),h(""),e?s():m.current&&m.current.focus()};return(0,a.jsxs)(d.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:"Edit Prompt ".concat(r+1)}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(b.Z,{value:c,onChange:e=>h(e.target.value),fullWidth:!0,margin:"normal",multiline:!0,placeholder:"The quick brown {{animal1}} jumps over the lazy {{animal2}}.",helperText:"Tip: use the {{varname}} syntax to add variables to your prompt.",inputRef:m})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(o.Z,{onClick:f.bind(null,!0),color:"primary",variant:"contained",disabled:!c.length,children:"Add"}),(0,a.jsx)(o.Z,{onClick:f.bind(null,!1),color:"primary",variant:"contained",disabled:!c.length,children:"Add Another"}),(0,a.jsx)(o.Z,{onClick:s,color:"secondary",children:"Cancel"})]})]})};n(94499);var W=()=>{let[e,t]=(0,i.useState)(!1),[n,r]=(0,i.useState)(null),{prompts:s,setPrompts:c}=(0,l.o)(),d=(0,i.useRef)(null);(0,i.useEffect)(()=>{null!==n&&n>0&&d.current&&d.current.focus()},[n]);let p=e=>{r(e),t(!0)},u=(e,t)=>{e.stopPropagation();let n=s[t];c([...s,n])},h=(e,t)=>{c(s.map((n,a)=>a===e?t:n))},x=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to remove this prompt?")&&c(s.filter((e,n)=>n!==t))};return(0,a.jsxs)("div",{children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h5",children:"Prompts"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-prompt",children:(0,a.jsx)(w.Z,{title:"Upload prompt from file",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(A.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-prompt",type:"file",accept:".txt,.md",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(n){let e=new FileReader;e.onload=e=>{var t,n;let a=null===(n=e.target)||void 0===n?void 0:null===(t=n.result)||void 0===t?void 0:t.toString();a&&c([...s,a])},e.readAsText(n)}},style:{display:"none"}})]})})}),(0,a.jsx)(o.Z,{color:"primary",onClick:()=>{t(!0)},variant:"contained",children:"Add Prompt"})]})]}),(0,a.jsx)(P.Z,{children:(0,a.jsx)(I.Z,{children:(0,a.jsx)(O.Z,{children:0===s.length?(0,a.jsx)(T.Z,{children:(0,a.jsx)(S.Z,{colSpan:2,align:"center",children:"No prompts added yet."})}):s.map((e,t)=>(0,a.jsxs)(T.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>p(t),children:[(0,a.jsx)(S.Z,{children:(0,a.jsxs)(f.Z,{variant:"body2",children:["Prompt #".concat(t+1,": "),(e.length>250?e.slice(0,250)+" ...":e).split(/({{\w+}})/g).map((e,t)=>/{{\s*(\w+)\s*}}/g.test(e)?(0,a.jsx)("span",{className:"prompt-var-highlight",children:e},t):e)]})}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>p(t),size:"small",children:(0,a.jsx)(k.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>u(e,t),size:"small",children:(0,a.jsx)(_.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(C.Z,{})})]})]},t))})})}),(0,a.jsx)(R,{open:e,prompt:null!==n?s[n]:"",index:null!==n?n:0,onAdd:e=>{null!==n?h(n,e):c([...s,e]),r(null)},onCancel:()=>{r(null),t(!1)}})]})},N=n(68873),z=n(885),F=e=>{let{onChange:t,...n}=e,[r,l]=i.useState(""),[s,o]=i.useState(!1);return(0,a.jsx)(b.Z,{...n,error:s,helperText:s?"Invalid JSON":"",value:r,onChange:e=>{let n=e.target.value;try{let e=JSON.parse(n);l(n),o(!1),t&&t(e)}catch(e){l(n),o(!0)}}})},V=e=>{let{open:t,providerId:n,config:r,onClose:l,onSave:c}=e,[h,m]=i.useState(r);return i.useEffect(()=>{m(r)},[r]),(0,a.jsxs)(d.Z,{open:t,onClose:l,fullWidth:!0,maxWidth:"md",children:[(0,a.jsxs)(x.Z,{children:["Edit ",n.length>50?n.slice(0,50)+"...":n]}),(0,a.jsx)(u.Z,{children:Object.keys(h).map(e=>{let t;let n=h[e];return"number"==typeof n||"boolean"==typeof n||"string"==typeof n?(t="number"==typeof n?t=>m({...h,[e]:parseFloat(t.target.value)}):"boolean"==typeof n?t=>m({...h,[e]:"true"===t.target.value}):t=>{let n=t.target.value.trim();if(n.startsWith("{")||n.startsWith("["))try{m({...h,[e]:JSON.parse(n)})}catch(t){m({...h,[e]:n})}else"null"===n?m({...h,[e]:null}):"undefined"===n?m({...h,[e]:void 0}):m({...h,[e]:n})},(0,a.jsx)(s.Z,{my:2,children:(0,a.jsx)(b.Z,{label:e,value:n,onChange:t,fullWidth:!0,InputLabelProps:{shrink:!0},type:"number"==typeof n?"number":"text"})},e)):(0,a.jsx)(s.Z,{my:2,children:(0,a.jsx)(F,{label:e,defaultValue:JSON.stringify(n),onChange:t=>{m({...h,[e]:t})},fullWidth:!0,multiline:!0,minRows:2,InputLabelProps:{shrink:!0}})},e)})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(o.Z,{onClick:l,children:"Cancel"}),(0,a.jsx)(o.Z,{onClick:()=>{c(h)},children:"Save"})]})]})};let L=[].concat(["replicate:replicate/flan-t5-small:69716ad8c34274043bf4a135b7315c7c569ec931d8f23d6826e249e1c142a264"].map(e=>({id:e,config:{temperature:.5,max_length:1024,repetition_penality:1}}))).concat(["replicate:replicate/codellama-7b-instruct:0103579e86fc75ba0d65912890fa19ef03c84a68554635319accf2e0ba93d3ae","replicate:replicate/codellama-13b-instruct:da5676342de1a5a335b848383af297f592b816b950a43d251a0a9edd0113604b","replicate:replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf"].map(e=>({id:e,config:{system_prompt:"",temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:replicate/codellama-7b:6880b103613a9cd23950c5fd6c140197e519905bd0dd00e448c4858bdd06090a","replicate:replicate/codellama-13b-python:09b87c02dfa403e0c3289166dece62286b3bce49bae39a9c9204713cf94b8b7d","replicate:replicate/codellama-13b:1c914d844307b0588599b8393480a3ba917b660c7e9dfae681542b5325f228db","replicate:replicate/codellama-34b-python:9048743d22a7b19cd0abb018066809ea6af4f2b4717bef9aad3c5ae21ceac00d","replicate:replicate/codellama-34b:0666717e5ead8557dff55ee8f11924b5c0309f5f1ca52f64bb8eec405fdb38a7"].map(e=>({id:e,config:{temperature:.75,top_p:.9,top_k:50,max_new_tokens:128,min_new_tokens:-1}}))).concat(["replicate:a16z-infra/llama-2-7b-chat:7b0bfc9aff140d5b75bacbed23e91fd3c34b01a1e958d32132de6e0a19796e2c","replicate:a16z-infra/llama-2-13b-chat:2a7f981751ec7fdf87b5b91ad4db53683a98082e9ff7bfd12c8cd5ea85980a52"].map(e=>({id:e,config:{temperature:.95,top_p:.95,top_k:250,max_new_tokens:500,min_new_tokens:-1,repetition_penalty:1,system_prompt:""}}))).concat(["replicate:mistralai/mistral-7b-v0.1","replicate:mistralai/mistral-7b-instruct-v0.2","replicate:mistralai/mixtral-8x7b-instruct-v0.1"].map(e=>({id:e,config:{temperature:.7,top_p:.9,top_k:-1,max_new_tokens:128,min_new_tokens:-1,repetition_penalty:1.15,prompt_template:"{prompt}"}}))).concat(["anthropic:claude-1","anthropic:claude-1-100k","anthropic:claude-instant-1","anthropic:claude-instant-1-100k"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["anthropic:messages:claude-instant-1.2","anthropic:messages:claude-2.0","anthropic:messages:claude-2.1","anthropic:messages:claude-3-haiku-20240307","anthropic:messages:claude-3-sonnet-20240229","anthropic:messages:claude-3-opus-20240229"].map(e=>({id:e,config:{max_tokens:1024,temperature:.5}}))).concat(["bedrock:anthropic.claude-instant-v1","bedrock:anthropic.claude-v1","bedrock:anthropic.claude-v2"].map(e=>({id:e,config:{max_tokens_to_sample:256,temperature:.5}}))).concat(["openai:gpt-3.5-turbo","openai:gpt-3.5-turbo-0301","openai:gpt-3.5-turbo-0613","openai:gpt-3.5-turbo-16k","openai:gpt-3.5-turbo-16k-0613","openai:gpt-4","openai:gpt-4-0314","openai:gpt-4-0613","openai:gpt-4-32k","openai:gpt-4-32k-0314"].map(e=>({id:e,config:{organization:"",temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["azureopenai:gpt-3.5-turbo","azureopenai:gpt-3.5-turbo-0301","azureopenai:gpt-3.5-turbo-0613","azureopenai:gpt-3.5-turbo-16k","azureopenai:gpt-3.5-turbo-16k-0613","azureopenai:gpt-4","azureopenai:gpt-4-0314","azureopenai:gpt-4-0613","azureopenai:gpt-4-32k","azureopenai:gpt-4-32k-0314"].map(e=>({id:e,config:{temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0,function_call:void 0,functions:void 0,stop:void 0}}))).concat(["vertex:chat-bison@001","vertex:chat-bison","vertex:chat-bison-32k","vertex:chat-bison-32k@001"].map(e=>({id:e,config:{context:void 0,examples:void 0,temperature:0,maxOutputTokens:1024,topP:.95,topK:40,safetySettings:void 0,stopSequence:void 0}}))).sort((e,t)=>e.id.localeCompare(t.id)),U={anthropic:"Anthropic",bedrock:"Amazon Web Services",azureopenai:"Azure",openai:"OpenAI",replicate:"Replicate"};var q=e=>{let{providers:t,onChange:n}=e,[r,l]=i.useState(null),o=e=>"string"==typeof e?e:e.id||"Unknown provider",c=(e,t)=>"string"==typeof e?e:e.id||t,d=e=>{"string"==typeof e?alert("Cannot edit custom providers"):e.config?l(e):alert("There is no config for this provider")};return(0,a.jsxs)(s.Z,{mt:2,children:[(0,a.jsx)(N.Z,{multiple:!0,freeSolo:!0,options:L,value:t,groupBy:e=>(function(e){if(!e)return"Other";let t=e.split(":")[0];return U[t]||t})(e.id),onChange:(e,t)=>{n(t.map(e=>"string"==typeof e?{id:e}:e))},getOptionLabel:e=>{if(!e)return"";let t="";"string"==typeof e&&(t=e),e.id&&"string"==typeof e.id&&(t=e.id);let n=t.split(":");return n.length>1?n.length>2&&"anthropic"===n[0]?n[2]:n[1]:"Unknown provider"},renderTags:(e,t)=>e.map((e,n)=>{let a=o(e),r=c(e,n);return(0,i.createElement)(z.Z,{variant:"outlined",label:a,...t({index:n}),key:r,onClick:()=>d(e)})}),renderInput:e=>(0,a.jsx)(b.Z,{...e,variant:"outlined",placeholder:"Select LLM providers",helperText:t.length>0?"Click a provider to configure its settings.":null})}),r&&r.id&&(0,a.jsx)(V,{open:!!r,providerId:r.id,config:r.config,onClose:()=>l(null),onSave:e=>{if(r){let a=t.map(t=>t.id===r.id?{...t,config:e}:t);n(a),l(null)}}})]})},B=n(52428),K=n(11615),D=n(28891),Y=()=>{let e=(0,D.useRouter)(),{defaultTest:t,description:n,env:r,evaluateOptions:s,prompts:c,providers:d,scenarios:p,testCases:u}=(0,l.o)(),[h,x]=(0,i.useState)(!1),[m,f]=(0,i.useState)(0),g=async()=>{x(!0);try{let a=await fetch("".concat(B.eA,"/api/eval/job/"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultTest:t,description:n,env:r,evaluateOptions:s,prompts:c,providers:d,scenarios:p,tests:u})});if(!a.ok)throw Error("HTTP error! status: ".concat(a.status));let i=await a.json(),l=setInterval(async()=>{let t=await fetch("".concat(B.eA,"/api/eval/job/").concat(i.id,"/"));if(!t.ok)throw clearInterval(l),Error("HTTP error! status: ".concat(t.status));let n=await t.json();if("complete"===n.status)clearInterval(l),x(!1),B.Ox?e.push("/eval/remote:".concat(encodeURIComponent(i.id))):e.push("/eval");else if("failed"===n.status)throw clearInterval(l),x(!1),Error("Job failed");else{let e=0===n.total?0:Math.round(n.progress/n.total*100);f(e)}},1e3)}catch(e){console.error(e),x(!1),alert("An error occurred: ".concat(e.message))}};return(0,a.jsx)(o.Z,{variant:"contained",color:"primary",onClick:g,disabled:h,children:h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K.Z,{size:24,sx:{marginRight:2}}),m.toFixed(0),"% complete"]}):"Run Evaluation"})},J=n(15320),X=n(26485);let G=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","is-sql","contains-sql","similar","llm-rubric","model-graded-closedqa","factuality","webhook","rouge-n","rouge-s","rouge-l","not-equals","not-contains","not-icontains","not-contains-all","not-contains-any","not-starts-with","not-regex","not-is-json","not-contains-json","not-similar","not-webhook","not-rouge-n","not-rouge-s","not-rouge-l","is-valid-openai-function-call","is-valid-openai-tools-call","latency","perplexity","perplexity-score","cost","answer-relevance","context-faithfulness","context-recall","context-relevance","select-best","moderation"];var H=e=>{let{onAdd:t,initialValues:n}=e,[r,l]=(0,i.useState)(n||[]),c=e=>{let n=r.filter((t,n)=>n!==e);l(n),t(n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Z,{variant:"h6",children:"Asserts"}),(0,a.jsx)(s.Z,{my:r.length>0?2:0,children:(0,a.jsx)(m.Z,{direction:"column",spacing:2,children:r.map((e,n)=>(0,a.jsxs)(m.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,a.jsx)(N.Z,{value:e.type,options:G,sx:{minWidth:200},onChange:(e,a)=>{let i=r.map((e,t)=>t===n?{...e,type:a}:e);l(i),t(i)},renderInput:e=>(0,a.jsx)(b.Z,{...e,label:"Type"})}),(0,a.jsx)(b.Z,{label:"Value",value:e.value,fullWidth:!0,onChange:e=>{let a=e.target.value,i=r.map((e,t)=>t===n?{...e,value:a}:e);l(i),t(i)}}),(0,a.jsx)(E.Z,{onClick:()=>c(n),size:"small",children:(0,a.jsx)(C.Z,{})})]},n))})}),(0,a.jsx)(o.Z,{color:"primary",onClick:()=>{let e=[...r,{type:"equals",value:""}];l(e),t(e)},children:"Add Assert"})]})},M=e=>{let{onAdd:t,varsList:n,initialValues:r}=e,[l,o]=i.useState(r||{});return(0,i.useEffect)(()=>{let e={};n.forEach(t=>{e[t]=(null==r?void 0:r[t])||""}),o(e)},[n,r]),(0,a.jsxs)(s.Z,{my:2,children:[(0,a.jsx)(f.Z,{variant:"h6",mb:2,children:"Vars"}),n.length>0?(0,a.jsx)(m.Z,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(l).map((e,n)=>(0,a.jsx)(m.Z,{direction:"row",spacing:2,alignItems:"center",children:(0,a.jsx)(b.Z,{placeholder:e,label:e,value:l[e],fullWidth:!0,onChange:n=>{let a=n.target.value,i={...l,[e]:a};o(i),t(i)}})},n))}):(0,a.jsxs)(f.Z,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},$=e=>{let{open:t,onAdd:n,varsList:r,initialValues:l,onCancel:c}=e,[h,m]=(0,i.useState)((null==l?void 0:l.description)||""),[f,g]=(0,i.useState)((null==l?void 0:l.vars)||{}),[j,v]=(0,i.useState)((null==l?void 0:l.assert)||[]),[Z,b]=(0,i.useState)(0);i.useEffect(()=>{l?(m(l.description||""),g(l.vars||{}),v(l.assert||[])):(m(""),g({}),v([]))},[l]);let y=e=>{n({description:h,vars:f,assert:j},e),e&&c(),m(""),g({}),v([]),b(e=>e+1)};return(0,a.jsxs)(d.Z,{open:t,onClose:c,fullWidth:!0,maxWidth:"md",children:[(0,a.jsx)(x.Z,{children:l?"Edit Test Case":"Add Test Case"}),(0,a.jsx)(u.Z,{children:(0,a.jsxs)(s.Z,{children:[(0,a.jsx)(M,{onAdd:e=>g(e),varsList:r,initialValues:null==l?void 0:l.vars}),(0,a.jsx)(H,{onAdd:e=>v(e),initialValues:((null==l?void 0:l.assert)||[]).filter(e=>"assert-set"!==e.type)||[]},Z)]})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(o.Z,{onClick:y.bind(void 0,!0),color:"primary",variant:"contained",children:l?"Update Test Case":"Add Test Case"}),!l&&(0,a.jsx)(o.Z,{onClick:y.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),(0,a.jsx)(o.Z,{onClick:c,color:"secondary",children:"Cancel"})]})]})},Q=e=>{let{varsList:t}=e,{testCases:r,setTestCases:s}=(0,l.o)(),[c,d]=i.useState(null),[p,u]=i.useState(!1),h=(e,t)=>{e.stopPropagation(),confirm("Are you sure you want to delete this test case?")&&s(r.filter((e,n)=>n!==t))},x=(e,t)=>{e.stopPropagation();let n=JSON.parse(JSON.stringify(r[t]));s([...r,n])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h5",children:"Test Cases"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"file-input-add-test-case",children:(0,a.jsx)(w.Z,{title:"Upload test cases from csv",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(E.Z,{component:"span",children:(0,a.jsx)(A.Z,{})}),(0,a.jsx)("input",{id:"file-input-add-test-case",type:"file",accept:".csv",onChange:e=>{var t;e.stopPropagation(),e.preventDefault();let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a){let e=new FileReader;e.onload=async e=>{var t,a;let i=null===(a=e.target)||void 0===a?void 0:null===(t=a.result)||void 0===t?void 0:t.toString();if(i){let{parse:e}=await Promise.all([n.e(631),n.e(887)]).then(n.bind(n,83887)),t=e(i,{columns:!0});s([...r,...t.map(e=>(0,J.It)(e))])}},e.readAsText(a)}},style:{display:"none"}})]})})}),(0,a.jsx)(o.Z,{color:"primary",onClick:()=>u(!0),variant:"contained",children:"Add Test Case"})]})]}),(0,a.jsx)(P.Z,{children:(0,a.jsxs)(I.Z,{children:[(0,a.jsx)(X.Z,{children:(0,a.jsxs)(T.Z,{children:[(0,a.jsx)(S.Z,{children:"Description"}),(0,a.jsx)(S.Z,{children:"Assertions"}),(0,a.jsx)(S.Z,{children:"Variables"}),(0,a.jsx)(S.Z,{align:"right"})]})}),(0,a.jsx)(O.Z,{children:0===r.length?(0,a.jsx)(T.Z,{children:(0,a.jsx)(S.Z,{colSpan:4,align:"center",children:"No test cases added yet."})}):r.map((e,t)=>{var n;return(0,a.jsxs)(T.Z,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>{d(t),u(!0)},children:[(0,a.jsx)(S.Z,{children:(0,a.jsx)(f.Z,{variant:"body2",children:e.description||"Test Case #".concat(t+1)})}),(0,a.jsxs)(S.Z,{children:[(null===(n=e.assert)||void 0===n?void 0:n.length)||0," assertions"]}),(0,a.jsx)(S.Z,{children:Object.entries(e.vars||{}).map(e=>{let[t,n]=e;return t+"="+n}).join(", ")}),(0,a.jsxs)(S.Z,{align:"right",sx:{minWidth:150},children:[(0,a.jsx)(E.Z,{onClick:()=>{d(t),u(!0)},size:"small",children:(0,a.jsx)(k.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>x(e,t),size:"small",children:(0,a.jsx)(_.Z,{})}),(0,a.jsx)(E.Z,{onClick:e=>h(e,t),size:"small",children:(0,a.jsx)(C.Z,{})})]})]},t)})})]})}),(0,a.jsx)($,{open:p,onAdd:(e,t)=>{if(null===c)s([...r,e]);else{let t=r.map((t,n)=>n===c?e:t);s(t),d(null)}t&&u(!1)},varsList:t,initialValues:null!==c?r[c]:void 0,onCancel:()=>{d(null),u(!1)}})]})},ee=n(71911),et=n.n(ee),en=n(93522),ea=n(34235),ei=n(38640),er=n.n(ei),el=n(29270);n(54492),n(55096),n(93486);var es=()=>{let{defaultTest:e,setDefaultTest:t,description:n,setDescription:r,env:c,setEnv:d,evaluateOptions:p,setEvaluateOptions:u,prompts:h,setPrompts:x,providers:m,setProviders:g,scenarios:j,setScenarios:v,testCases:Z,setTestCases:b}=(0,l.o)(),[y,_]=i.useState(""),[C,A]=i.useState(!0),E=e=>{t(e.defaultTest||{}),r(e.description||""),d(e.env||{}),u(e.evaluateOptions||{}),x(e.prompts||[]),g(e.providers||[]),v(e.scenarios||[]),b(e.tests||[])};return i.useEffect(()=>{_(ea.default.dump({defaultTest:e,description:n,env:c,evaluateOptions:p,prompts:h,providers:m,scenarios:j,tests:Z}))},[e,n,c,p,h,m,j,Z]),(0,a.jsxs)(s.Z,{mt:4,children:[(0,a.jsx)(f.Z,{variant:"h5",gutterBottom:!0,children:"Configuration"}),(0,a.jsxs)(f.Z,{variant:"body1",gutterBottom:!0,children:["This is the YAML config that defines the evaluation and is processed by promptfoo. See"," ",(0,a.jsx)(er(),{target:"_blank",href:"https://promptfoo.dev/docs/configuration/guide",children:"configuration docs"})," ","to learn more."]}),(0,a.jsx)(o.Z,{variant:"text",color:"primary",startIcon:C?(0,a.jsx)(k.Z,{}):(0,a.jsx)(en.Z,{}),onClick:()=>{if(!C)try{let e=ea.default.load(y,{json:!0});E(e)}catch(e){}A(!C)},children:C?"Edit YAML":"Save"}),(0,a.jsx)(et(),{autoCapitalize:"off",value:y,onValueChange:e=>{C||_(e)},highlight:e=>(0,el.highlight)(e,el.languages.yaml),padding:10,style:{fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14},disabled:C,className:C?"":"glowing-border"})]})};n(7517);var eo=n(77580);function ec(e){let{error:t,resetErrorBoundary:n}=e;return(0,a.jsxs)("div",{role:"alert",children:[(0,a.jsx)("p",{children:"Something went wrong:"}),(0,a.jsx)("pre",{children:t.message}),(0,a.jsx)("button",{onClick:n,children:"Try again"})]})}var ed=()=>{let[e,t]=(0,i.useState)(!1),{description:n,setDescription:g,providers:j,setProviders:v,prompts:Z,setPrompts:b,testCases:_,setTestCases:C}=(0,l.o)();if((0,i.useEffect)(()=>{l.o.persist.rehydrate()},[]),eo.env.NEXT_PUBLIC_NO_BROWSING)return null;let k=(e=>{let t=/{{\s*(\w+)\s*}}/g,n=new Set;return e.forEach(e=>{let a;for(;null!==(a=t.exec(e));)n.add(a[1])}),Array.from(n)})(Z);return(0,a.jsxs)(c.Z,{maxWidth:"lg",sx:{marginTop:"2rem"},children:[(0,a.jsxs)(m.Z,{direction:"row",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h4",children:"Set up an evaluation"}),(0,a.jsxs)(m.Z,{direction:"row",spacing:2,children:[(0,a.jsx)(Y,{}),(0,a.jsx)(y,{}),(0,a.jsx)(o.Z,{variant:"outlined",color:"primary",onClick:()=>t(!0),children:"Reset"})]})]}),(0,a.jsx)(s.Z,{mt:4}),(0,a.jsx)(s.Z,{mt:2,children:(0,a.jsx)(r.SV,{FallbackComponent:ec,onReset:()=>{v([])},children:(0,a.jsxs)(m.Z,{direction:"column",spacing:2,justifyContent:"space-between",children:[(0,a.jsx)(f.Z,{variant:"h5",children:"Providers"}),(0,a.jsx)(q,{providers:j,onChange:v})]})})}),(0,a.jsx)(s.Z,{mt:4}),(0,a.jsx)(r.SV,{FallbackComponent:ec,onReset:()=>{b([])},children:(0,a.jsx)(W,{})}),(0,a.jsx)(s.Z,{mt:6}),(0,a.jsx)(r.SV,{FallbackComponent:ec,onReset:()=>{C([])},children:(0,a.jsx)(Q,{varsList:k})}),(0,a.jsx)(es,{}),(0,a.jsxs)(d.Z,{open:e,onClose:()=>t(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,a.jsx)(x.Z,{id:"alert-dialog-title",children:"Confirm Reset"}),(0,a.jsx)(u.Z,{children:(0,a.jsx)(h.Z,{id:"alert-dialog-description",children:"Are you sure you want to reset all the fields? This action cannot be undone."})}),(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(o.Z,{onClick:()=>t(!1),children:"Cancel"}),(0,a.jsx)(o.Z,{onClick:()=>{g(""),v([]),b([]),C([]),t(!1)},autoFocus:!0,children:"Reset"})]})]})]})}},52428:function(e,t,n){"use strict";n.d(t,{Ox:function(){return r},T8:function(){return i},eA:function(){return l}});var a=n(77580);let i=!a.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,r=!!a.env.NEXT_PUBLIC_PROMPTFOO_USE_SUPABASE,l=""},47887:function(e,t,n){"use strict";n.d(t,{o:function(){return r}});var a=n(79685),i=n(74595);let r=(0,a.Ue)()((0,i.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],defaultTest:{},evaluateOptions:{},scenarios:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setDefaultTest:t=>e({defaultTest:t}),setEvaluateOptions:t=>e({evaluateOptions:t}),setScenarios:t=>e({scenarios:t}),setStateFromConfig:t=>{let n={};t.description&&(n.description=t.description||""),t.tests&&(n.testCases=t.tests),t.providers&&(n.providers=t.providers),t.prompts&&("string"==typeof t.prompts?n.prompts=[t.prompts]:Array.isArray(t.prompts)?n.prompts=t.prompts.filter(e=>"string"==typeof e&&!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),t.defaultTest&&(n.defaultTest=t.defaultTest),t.evaluateOptions&&(n.evaluateOptions=t.evaluateOptions),t.scenarios&&(n.scenarios=t.scenarios),e(n)},getTestSuite:()=>{let{description:e,testCases:n,providers:a,prompts:i,env:r,scenarios:l}=t();return{env:r,description:e,providers:a,prompts:i,tests:n,scenarios:l}}}),{name:"promptfoo",skipHydration:!0}))},94499:function(){},55096:function(){},7517:function(){},15320:function(e,t){"use strict";t.It=void 0,t.It=function(e){let t,n,a,i;let r={},l=[],s={};for(let[o,c]of Object.entries(e))o.startsWith("__expected")?""!==c.trim()&&l.push(function(e){if(e.startsWith("javascript:")||e.startsWith("fn:")||e.startsWith("eval:")){let t;e.startsWith("javascript:")&&(t=11),e.startsWith("fn:")&&(t=3),e.startsWith("eval:")&&(t=5);let n=e.slice(t).trim();return{type:"javascript",value:n}}if(e.startsWith("grade:")||e.startsWith("llm-rubric:"))return{type:"llm-rubric",value:e.slice(6)};if(e.startsWith("python:")){let t=e.slice(7).trim();return{type:"python",value:t}}let t=e.match(/^(not-)?(equals|contains-any|contains-all|icontains-any|icontains-all|contains-json|is-json|is-sql|regex|icontains|contains|webhook|rouge-n|similar|starts-with|levenshtein|classifier|model-graded-factuality|factuality|model-graded-closedqa|answer-relevance|context-recall|context-relevance|context-faithfulness|is-valid-openai-function-call|is-valid-openai-tools-call|latency|perplexity|perplexity-score|cost)(?:\((\d+(?:\.\d+)?)\))?(?::([\s\S]*))?$/);if(t){let[e,n,a,i,r]=t,l=n?`not-${a}`:a,s=parseFloat(i);return"contains-any"===a||"contains-all"===a||"icontains-any"===a||"icontains-all"===a?{type:l,value:r.split(",").map(e=>e.trim())}:"contains-json"===a||"is-json"===a?{type:l,value:r}:"rouge-n"===a||"similar"===a||"starts-with"===a||"levenshtein"===a||"classifier"===a||"answer-relevance"===a||"context-recall"===a||"context-relevance"===a||"context-faithfulness"===a||"latency"===a||"perplexity"===a||"perplexity-score"===a||"cost"===a?{type:l,value:r,threshold:s||("similar"===a?.8:.75)}:{type:l,value:r}}return{type:"equals",value:e}}(c)):"__prefix"===o?s.prefix=c:"__suffix"===o?s.suffix=c:"__description"===o?n=c:"__providerOutput"===o?t=c:"__metric"===o?a=c:"__threshold"===o?i=parseFloat(c):r[o]=c;for(let e of l)e.metric=a;return{vars:r,assert:l,options:s,...n?{description:n}:{},...t?{providerOutput:t}:{},...i?{threshold:i}:{}}}}},function(e){e.O(0,[540,640,215,620,770,304,339,995,378,374,235,873,106,258,470,730,744],function(){return e(e.s=72846)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><link rel="preload" as="font" href="/_next/static/media/0e4fe491bf84089c-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/3a04115668d8070d-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/3a18fc8da1cdcd01-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/627622453ef56b0d-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/699512af39861afa-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/934c4b7cb736f2a3-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/b76f1739b5a14901.css" data-precedence="next"/><link rel="preload" href="/_next/static/chunks/webpack-ac7a3125017b92ed.js" as="script"/><link rel="preload" href="/_next/static/chunks/b6261da7-e9d81a4364ddd0c0.js" as="script"/><link rel="preload" href="/_next/static/chunks/730-3eb7255cd813a727.js" as="script"/><link rel="preload" href="/_next/static/chunks/main-app-345c3eca7e5cf432.js" as="script"/><title>promptfoo</title><meta name="description" content="LLM testing and evaluation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_c5054f"><div><style data-emotion="css jj2ztu">.css-jj2ztu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.css-jj2ztu>:not(style):not(style){margin:0;}.css-jj2ztu>:not(style)~:not(style){margin-left:16px;}</style><div class="MuiStack-root nav css-jj2ztu"><div class="logo MuiBox-root css-0"><img alt="Promptfoo logo" loading="lazy" width="25" height="25" decoding="async" data-nimg="1" style="color:transparent" src="/logo.svg"/> <span>promptfoo</span></div><a class="" href="/setup/">New Eval</a><a class="" href="/eval/">Evals</a><a class="" href="/prompts/">Prompts</a><a class="" href="/datasets/">Datasets</a><a class="" href="/progress/">Progress</a><div class="right-aligned"><div class="dark-mode-toggle"><style data-emotion="css vubbuv">.css-vubbuv{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:1em;height:1em;display:inline-block;fill:currentColor;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-transition:fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;font-size:1.5rem;}</style><svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="LightModeIcon"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"></path></svg></div></div></div><div><style data-emotion="css hltdia">.css-hltdia{width:100%;margin-left:auto;box-sizing:border-box;margin-right:auto;display:block;padding-left:16px;padding-right:16px;}@media (min-width:600px){.css-hltdia{padding-left:24px;padding-right:24px;}}@media (min-width:0px){.css-hltdia{max-width:444px;}}</style><main class="MuiContainer-root MuiContainer-maxWidthXs css-hltdia"><style data-emotion="css 1d79rw6">.css-1d79rw6{margin:0;font-family:inherit;font-weight:400;font-size:1.5rem;line-height:1.334;}</style><h1 class="MuiTypography-root MuiTypography-h5 css-1d79rw6">Sign in</h1><form><style data-emotion="css 1u0h3mu">.css-1u0h3mu{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;position:relative;min-width:0;padding:0;margin:0;border:0;vertical-align:top;margin-top:16px;margin-bottom:8px;width:100%;}</style><div class="MuiFormControl-root MuiFormControl-marginNormal MuiFormControl-fullWidth MuiTextField-root css-1u0h3mu"><style data-emotion="css nd1nwr">.css-nd1nwr{display:block;transform-origin:top left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);position:absolute;left:0;top:0;-webkit-transform:translate(14px, 16px) scale(1);-moz-transform:translate(14px, 16px) scale(1);-ms-transform:translate(14px, 16px) scale(1);transform:translate(14px, 16px) scale(1);-webkit-transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,-webkit-transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;z-index:1;pointer-events:none;}</style><style data-emotion="css jzaigm">.css-jzaigm{color:rgba(0, 0, 0, 0.6);font-family:inherit;font-weight:400;font-size:1rem;line-height:1.4375em;padding:0;position:relative;display:block;transform-origin:top left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);position:absolute;left:0;top:0;-webkit-transform:translate(14px, 16px) scale(1);-moz-transform:translate(14px, 16px) scale(1);-ms-transform:translate(14px, 16px) scale(1);transform:translate(14px, 16px) scale(1);-webkit-transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,-webkit-transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;z-index:1;pointer-events:none;}.css-jzaigm.Mui-focused{color:#1976d2;}.css-jzaigm.Mui-disabled{color:rgba(0, 0, 0, 0.38);}.css-jzaigm.Mui-error{color:#d32f2f;}</style><label class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-jzaigm" data-shrink="false" for="email" id="email-label">Email Address<style data-emotion="css sp68t1">.css-sp68t1.Mui-error{color:#d32f2f;}</style><span aria-hidden="true" class="MuiFormLabel-asterisk MuiInputLabel-asterisk css-sp68t1"> <!-- -->*</span></label><style data-emotion="css-global 1prfaxn">@-webkit-keyframes mui-auto-fill{from{display:block;}}@keyframes mui-auto-fill{from{display:block;}}@-webkit-keyframes mui-auto-fill-cancel{from{display:block;}}@keyframes mui-auto-fill-cancel{from{display:block;}}</style><style data-emotion="css 18bxsfn">.css-18bxsfn{font-family:inherit;font-weight:400;font-size:1rem;line-height:1.4375em;color:rgba(0, 0, 0, 0.87);box-sizing:border-box;position:relative;cursor:text;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;position:relative;border-radius:4px;}.css-18bxsfn.Mui-disabled{color:rgba(0, 0, 0, 0.38);cursor:default;}.css-18bxsfn:hover .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.87);}@media (hover: none){.css-18bxsfn:hover .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.23);}}.css-18bxsfn.Mui-focused .MuiOutlinedInput-notchedOutline{border-color:#1976d2;border-width:2px;}.css-18bxsfn.Mui-error .MuiOutlinedInput-notchedOutline{border-color:#d32f2f;}.css-18bxsfn.Mui-disabled .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.26);}</style><div class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-18bxsfn"><style data-emotion="css 1x5jdmq">.css-1x5jdmq{font:inherit;letter-spacing:inherit;color:currentColor;padding:4px 0 5px;border:0;box-sizing:content-box;background:none;height:1.4375em;margin:0;-webkit-tap-highlight-color:transparent;display:block;min-width:0;width:100%;-webkit-animation-name:mui-auto-fill-cancel;animation-name:mui-auto-fill-cancel;-webkit-animation-duration:10ms;animation-duration:10ms;padding:16.5px 14px;}.css-1x5jdmq::-webkit-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq::-moz-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq:-ms-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq::-ms-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq:focus{outline:0;}.css-1x5jdmq:invalid{box-shadow:none;}.css-1x5jdmq::-webkit-search-decoration{-webkit-appearance:none;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-webkit-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-moz-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:-ms-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-ms-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-webkit-input-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-moz-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus:-ms-input-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-ms-input-placeholder{opacity:0.42;}.css-1x5jdmq.Mui-disabled{opacity:1;-webkit-text-fill-color:rgba(0, 0, 0, 0.38);}.css-1x5jdmq:-webkit-autofill{-webkit-animation-duration:5000s;animation-duration:5000s;-webkit-animation-name:mui-auto-fill;animation-name:mui-auto-fill;}.css-1x5jdmq:-webkit-autofill{border-radius:inherit;}</style><input aria-invalid="false" autoComplete="email" autofocus="" id="email" required="" type="text" class="MuiInputBase-input MuiOutlinedInput-input css-1x5jdmq" name="email" value=""/><style data-emotion="css 19w1uun">.css-19w1uun{border-color:rgba(0, 0, 0, 0.23);}</style><style data-emotion="css igs3ac">.css-igs3ac{text-align:left;position:absolute;bottom:0;right:0;top:-5px;left:0;margin:0;padding:0 8px;pointer-events:none;border-radius:inherit;border-style:solid;border-width:1px;overflow:hidden;min-width:0%;border-color:rgba(0, 0, 0, 0.23);}</style><fieldset aria-hidden="true" class="MuiOutlinedInput-notchedOutline css-igs3ac"><style data-emotion="css yjsfm1">.css-yjsfm1{float:unset;width:auto;overflow:hidden;display:block;padding:0;height:11px;font-size:0.75em;visibility:hidden;max-width:0.01px;-webkit-transition:max-width 50ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:max-width 50ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;white-space:nowrap;}.css-yjsfm1>span{padding-left:5px;padding-right:5px;display:inline-block;opacity:0;visibility:visible;}</style><legend class="css-yjsfm1"><span>Email Address<!-- --> <!-- -->*</span></legend></fieldset></div></div><div class="MuiFormControl-root MuiFormControl-marginNormal MuiFormControl-fullWidth MuiTextField-root css-1u0h3mu"><label class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-jzaigm" data-shrink="false" for="password" id="password-label">Password<span aria-hidden="true" class="MuiFormLabel-asterisk MuiInputLabel-asterisk css-sp68t1"> <!-- -->*</span></label><style data-emotion="css-global 1prfaxn">@-webkit-keyframes mui-auto-fill{from{display:block;}}@keyframes mui-auto-fill{from{display:block;}}@-webkit-keyframes mui-auto-fill-cancel{from{display:block;}}@keyframes mui-auto-fill-cancel{from{display:block;}}</style><div class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-18bxsfn"><input aria-invalid="false" autoComplete="current-password" id="password" required="" type="password" class="MuiInputBase-input MuiOutlinedInput-input css-1x5jdmq" name="password" value=""/><fieldset aria-hidden="true" class="MuiOutlinedInput-notchedOutline css-igs3ac"><legend class="css-yjsfm1"><span>Password<!-- --> <!-- -->*</span></legend></fieldset></div></div><style data-emotion="css 1pz372j">.css-1pz372j{font-family:inherit;font-weight:500;font-size:0.875rem;line-height:1.75;text-transform:uppercase;min-width:64px;padding:6px 16px;border-radius:4px;-webkit-transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;color:#fff;background-color:#1976d2;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);width:100%;margin-top:1em;}.css-1pz372j:hover{-webkit-text-decoration:none;text-decoration:none;background-color:#1565c0;box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);}@media (hover: none){.css-1pz372j:hover{background-color:#1976d2;}}.css-1pz372j:active{box-shadow:0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);}.css-1pz372j.Mui-focusVisible{box-shadow:0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12);}.css-1pz372j.Mui-disabled{color:rgba(0, 0, 0, 0.26);box-shadow:none;background-color:rgba(0, 0, 0, 0.12);}</style><style data-emotion="css 1j0w7x1">.css-1j0w7x1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;background-color:transparent;outline:0;border:0;margin:0;border-radius:0;padding:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-moz-appearance:none;-webkit-appearance:none;-webkit-text-decoration:none;text-decoration:none;color:inherit;font-family:inherit;font-weight:500;font-size:0.875rem;line-height:1.75;text-transform:uppercase;min-width:64px;padding:6px 16px;border-radius:4px;-webkit-transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;color:#fff;background-color:#1976d2;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);width:100%;margin-top:1em;}.css-1j0w7x1::-moz-focus-inner{border-style:none;}.css-1j0w7x1.Mui-disabled{pointer-events:none;cursor:default;}@media print{.css-1j0w7x1{-webkit-print-color-adjust:exact;color-adjust:exact;}}.css-1j0w7x1:hover{-webkit-text-decoration:none;text-decoration:none;background-color:#1565c0;box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);}@media (hover: none){.css-1j0w7x1:hover{background-color:#1976d2;}}.css-1j0w7x1:active{box-shadow:0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);}.css-1j0w7x1.Mui-focusVisible{box-shadow:0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12);}.css-1j0w7x1.Mui-disabled{color:rgba(0, 0, 0, 0.26);box-shadow:none;background-color:rgba(0, 0, 0, 0.12);}</style><button class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-fullWidth MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-fullWidth css-1j0w7x1" tabindex="0" type="submit">Sign In</button><p>Don&#x27;t have an account yet? <a href="/auth/signup/">Sign up</a></p></form></main></div></div><script src="/_next/static/chunks/webpack-ac7a3125017b92ed.js" async=""></script><script src="/_next/static/chunks/b6261da7-e9d81a4364ddd0c0.js" async=""></script><script src="/_next/static/chunks/730-3eb7255cd813a727.js" async=""></script><script src="/_next/static/chunks/main-app-345c3eca7e5cf432.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e4fe491bf84089c-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/3a04115668d8070d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/3a18fc8da1cdcd01-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/627622453ef56b0d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/699512af39861afa-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/934c4b7cb736f2a3-s.p.woff2\",{\"as\":\"font\","])</script><script>self.__next_f.push([1,"\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/css/b76f1739b5a14901.css\",{\"as\":\"style\"}]\n0:\"$L8\"\n"])</script><script>self.__next_f.push([1,"9:I{\"id\":83507,\"chunks\":[\"272:static/chunks/webpack-ac7a3125017b92ed.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\nb:I{\"id\":6020,\"chunks\":[\"272:static/chunks/webpack-ac7a3125017b92ed.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"\",\"async\":false}\nc:I{\"id\":30224,\"chunks\":[\"540:static/chunks/540-378a20144435cec6.js\",\"640:static/chunks/640-0f757e2fe135173d.js\",\"620:stat"])</script><script>self.__next_f.push([1,"ic/chunks/620-1e779bd81b43dafb.js\",\"954:static/chunks/954-58788165fb1e9563.js\",\"166:static/chunks/166-157bfb431b68d949.js\",\"185:static/chunks/app/layout-aab36608271969ed.js\"],\"name\":\"PageShell\",\"async\":false}\nd:I{\"id\":27883,\"chunks\":[\"272:static/chunks/webpack-ac7a3125017b92ed.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\ne:I{\"id\":46785,\"chunks\":[\"272:static/chunks/webpack-ac7a3125017b92ed.js\",\"470:static/chunks/b6261da7-e9d"])</script><script>self.__next_f.push([1,"81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\n10:I{\"id\":92030,\"chunks\":[\"540:static/chunks/540-378a20144435cec6.js\",\"640:static/chunks/640-0f757e2fe135173d.js\",\"215:static/chunks/215-7d83203d614bcd6a.js\",\"620:static/chunks/620-1e779bd81b43dafb.js\",\"304:static/chunks/304-37065d54ff218f46.js\",\"339:static/chunks/339-f38253669d469118.js\",\"954:static/chunks/954-58788165fb1e9563.js\",\"716:static/chunks/app/auth/login/page-ee73165dd261f3ca.js\"],\"name\":\"\",\"async\":fals"])</script><script>self.__next_f.push([1,"e}\n"])</script><script>self.__next_f.push([1,"8:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b76f1739b5a14901.css\",\"precedence\":\"next\"}]],[\"$\",\"$L9\",null,{\"buildId\":\"tUB-fEjoICDbTDdLhchKo\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/auth/login/\",\"initialTree\":[\"\",{\"children\":[\"auth\",{\"children\":[\"login\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$La\",\"globalErrorComponent\":\"$b\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_c5054f\",\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$Ld\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$Ld\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"auth\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$Ld\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"auth\",\"children\",\"login\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$Lf\",[\"$\",\"$L10\",null,{}],null],\"segment\":\"__PAGE__\"},\"styles\":[]}],\"segment\":\"login\"},\"styles\":[]}],\"segment\":\"auth\"},\"styles\":[]}]}]}]}],null]}]]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"1\",{\"children\":\"promptfoo\"}],[\"$\",\"meta\",\"2\",{\"name\":\"description\",\"content\":\"LLM testing and evaluation\"}],[\"$\",\"meta\",\"3\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"4\",{\"property\":\"og:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"5\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"6\",{\"name\":\"twitter:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"7\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"f:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><link rel="preload" as="font" href="/_next/static/media/0e4fe491bf84089c-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/3a04115668d8070d-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/3a18fc8da1cdcd01-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/627622453ef56b0d-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/699512af39861afa-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="preload" as="font" href="/_next/static/media/934c4b7cb736f2a3-s.p.woff2" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/b76f1739b5a14901.css" data-precedence="next"/><link rel="preload" href="/_next/static/chunks/webpack-ac7a3125017b92ed.js" as="script"/><link rel="preload" href="/_next/static/chunks/b6261da7-e9d81a4364ddd0c0.js" as="script"/><link rel="preload" href="/_next/static/chunks/730-3eb7255cd813a727.js" as="script"/><link rel="preload" href="/_next/static/chunks/main-app-345c3eca7e5cf432.js" as="script"/><title>promptfoo</title><meta name="description" content="LLM testing and evaluation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://www.promptfoo.dev/img/thumbnail.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_c5054f"><div><style data-emotion="css jj2ztu">.css-jj2ztu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.css-jj2ztu>:not(style):not(style){margin:0;}.css-jj2ztu>:not(style)~:not(style){margin-left:16px;}</style><div class="MuiStack-root nav css-jj2ztu"><div class="logo MuiBox-root css-0"><img alt="Promptfoo logo" loading="lazy" width="25" height="25" decoding="async" data-nimg="1" style="color:transparent" src="/logo.svg"/> <span>promptfoo</span></div><a class="" href="/setup/">New Eval</a><a class="" href="/eval/">Evals</a><a class="" href="/prompts/">Prompts</a><a class="" href="/datasets/">Datasets</a><a class="" href="/progress/">Progress</a><div class="right-aligned"><div class="dark-mode-toggle"><style data-emotion="css vubbuv">.css-vubbuv{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:1em;height:1em;display:inline-block;fill:currentColor;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-transition:fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;font-size:1.5rem;}</style><svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="LightModeIcon"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"></path></svg></div></div></div><div><style data-emotion="css hltdia">.css-hltdia{width:100%;margin-left:auto;box-sizing:border-box;margin-right:auto;display:block;padding-left:16px;padding-right:16px;}@media (min-width:600px){.css-hltdia{padding-left:24px;padding-right:24px;}}@media (min-width:0px){.css-hltdia{max-width:444px;}}</style><main class="MuiContainer-root MuiContainer-maxWidthXs css-hltdia"><style data-emotion="css 1d79rw6">.css-1d79rw6{margin:0;font-family:inherit;font-weight:400;font-size:1.5rem;line-height:1.334;}</style><h1 class="MuiTypography-root MuiTypography-h5 css-1d79rw6">Sign in</h1><form><style data-emotion="css 1u0h3mu">.css-1u0h3mu{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;position:relative;min-width:0;padding:0;margin:0;border:0;vertical-align:top;margin-top:16px;margin-bottom:8px;width:100%;}</style><div class="MuiFormControl-root MuiFormControl-marginNormal MuiFormControl-fullWidth MuiTextField-root css-1u0h3mu"><style data-emotion="css nd1nwr">.css-nd1nwr{display:block;transform-origin:top left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);position:absolute;left:0;top:0;-webkit-transform:translate(14px, 16px) scale(1);-moz-transform:translate(14px, 16px) scale(1);-ms-transform:translate(14px, 16px) scale(1);transform:translate(14px, 16px) scale(1);-webkit-transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,-webkit-transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;z-index:1;pointer-events:none;}</style><style data-emotion="css jzaigm">.css-jzaigm{color:rgba(0, 0, 0, 0.6);font-family:inherit;font-weight:400;font-size:1rem;line-height:1.4375em;padding:0;position:relative;display:block;transform-origin:top left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);position:absolute;left:0;top:0;-webkit-transform:translate(14px, 16px) scale(1);-moz-transform:translate(14px, 16px) scale(1);-ms-transform:translate(14px, 16px) scale(1);transform:translate(14px, 16px) scale(1);-webkit-transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,-webkit-transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;z-index:1;pointer-events:none;}.css-jzaigm.Mui-focused{color:#1976d2;}.css-jzaigm.Mui-disabled{color:rgba(0, 0, 0, 0.38);}.css-jzaigm.Mui-error{color:#d32f2f;}</style><label class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-jzaigm" data-shrink="false" for="email" id="email-label">Email Address<style data-emotion="css sp68t1">.css-sp68t1.Mui-error{color:#d32f2f;}</style><span aria-hidden="true" class="MuiFormLabel-asterisk MuiInputLabel-asterisk css-sp68t1"> <!-- -->*</span></label><style data-emotion="css-global 1prfaxn">@-webkit-keyframes mui-auto-fill{from{display:block;}}@keyframes mui-auto-fill{from{display:block;}}@-webkit-keyframes mui-auto-fill-cancel{from{display:block;}}@keyframes mui-auto-fill-cancel{from{display:block;}}</style><style data-emotion="css 18bxsfn">.css-18bxsfn{font-family:inherit;font-weight:400;font-size:1rem;line-height:1.4375em;color:rgba(0, 0, 0, 0.87);box-sizing:border-box;position:relative;cursor:text;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;position:relative;border-radius:4px;}.css-18bxsfn.Mui-disabled{color:rgba(0, 0, 0, 0.38);cursor:default;}.css-18bxsfn:hover .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.87);}@media (hover: none){.css-18bxsfn:hover .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.23);}}.css-18bxsfn.Mui-focused .MuiOutlinedInput-notchedOutline{border-color:#1976d2;border-width:2px;}.css-18bxsfn.Mui-error .MuiOutlinedInput-notchedOutline{border-color:#d32f2f;}.css-18bxsfn.Mui-disabled .MuiOutlinedInput-notchedOutline{border-color:rgba(0, 0, 0, 0.26);}</style><div class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-18bxsfn"><style data-emotion="css 1x5jdmq">.css-1x5jdmq{font:inherit;letter-spacing:inherit;color:currentColor;padding:4px 0 5px;border:0;box-sizing:content-box;background:none;height:1.4375em;margin:0;-webkit-tap-highlight-color:transparent;display:block;min-width:0;width:100%;-webkit-animation-name:mui-auto-fill-cancel;animation-name:mui-auto-fill-cancel;-webkit-animation-duration:10ms;animation-duration:10ms;padding:16.5px 14px;}.css-1x5jdmq::-webkit-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq::-moz-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq:-ms-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq::-ms-input-placeholder{color:currentColor;opacity:0.42;-webkit-transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.css-1x5jdmq:focus{outline:0;}.css-1x5jdmq:invalid{box-shadow:none;}.css-1x5jdmq::-webkit-search-decoration{-webkit-appearance:none;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-webkit-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-moz-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:-ms-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq::-ms-input-placeholder{opacity:0!important;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-webkit-input-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-moz-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus:-ms-input-placeholder{opacity:0.42;}label[data-shrink=false]+.MuiInputBase-formControl .css-1x5jdmq:focus::-ms-input-placeholder{opacity:0.42;}.css-1x5jdmq.Mui-disabled{opacity:1;-webkit-text-fill-color:rgba(0, 0, 0, 0.38);}.css-1x5jdmq:-webkit-autofill{-webkit-animation-duration:5000s;animation-duration:5000s;-webkit-animation-name:mui-auto-fill;animation-name:mui-auto-fill;}.css-1x5jdmq:-webkit-autofill{border-radius:inherit;}</style><input aria-invalid="false" autoComplete="email" autofocus="" id="email" required="" type="text" class="MuiInputBase-input MuiOutlinedInput-input css-1x5jdmq" name="email" value=""/><style data-emotion="css 19w1uun">.css-19w1uun{border-color:rgba(0, 0, 0, 0.23);}</style><style data-emotion="css igs3ac">.css-igs3ac{text-align:left;position:absolute;bottom:0;right:0;top:-5px;left:0;margin:0;padding:0 8px;pointer-events:none;border-radius:inherit;border-style:solid;border-width:1px;overflow:hidden;min-width:0%;border-color:rgba(0, 0, 0, 0.23);}</style><fieldset aria-hidden="true" class="MuiOutlinedInput-notchedOutline css-igs3ac"><style data-emotion="css yjsfm1">.css-yjsfm1{float:unset;width:auto;overflow:hidden;display:block;padding:0;height:11px;font-size:0.75em;visibility:hidden;max-width:0.01px;-webkit-transition:max-width 50ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;transition:max-width 50ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;white-space:nowrap;}.css-yjsfm1>span{padding-left:5px;padding-right:5px;display:inline-block;opacity:0;visibility:visible;}</style><legend class="css-yjsfm1"><span>Email Address<!-- --> <!-- -->*</span></legend></fieldset></div></div><div class="MuiFormControl-root MuiFormControl-marginNormal MuiFormControl-fullWidth MuiTextField-root css-1u0h3mu"><label class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-jzaigm" data-shrink="false" for="password" id="password-label">Password<span aria-hidden="true" class="MuiFormLabel-asterisk MuiInputLabel-asterisk css-sp68t1"> <!-- -->*</span></label><style data-emotion="css-global 1prfaxn">@-webkit-keyframes mui-auto-fill{from{display:block;}}@keyframes mui-auto-fill{from{display:block;}}@-webkit-keyframes mui-auto-fill-cancel{from{display:block;}}@keyframes mui-auto-fill-cancel{from{display:block;}}</style><div class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-18bxsfn"><input aria-invalid="false" autoComplete="current-password" id="password" required="" type="password" class="MuiInputBase-input MuiOutlinedInput-input css-1x5jdmq" name="password" value=""/><fieldset aria-hidden="true" class="MuiOutlinedInput-notchedOutline css-igs3ac"><legend class="css-yjsfm1"><span>Password<!-- --> <!-- -->*</span></legend></fieldset></div></div><style data-emotion="css 1pz372j">.css-1pz372j{font-family:inherit;font-weight:500;font-size:0.875rem;line-height:1.75;text-transform:uppercase;min-width:64px;padding:6px 16px;border-radius:4px;-webkit-transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;color:#fff;background-color:#1976d2;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);width:100%;margin-top:1em;}.css-1pz372j:hover{-webkit-text-decoration:none;text-decoration:none;background-color:#1565c0;box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);}@media (hover: none){.css-1pz372j:hover{background-color:#1976d2;}}.css-1pz372j:active{box-shadow:0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);}.css-1pz372j.Mui-focusVisible{box-shadow:0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12);}.css-1pz372j.Mui-disabled{color:rgba(0, 0, 0, 0.26);box-shadow:none;background-color:rgba(0, 0, 0, 0.12);}</style><style data-emotion="css 1j0w7x1">.css-1j0w7x1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;background-color:transparent;outline:0;border:0;margin:0;border-radius:0;padding:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-moz-appearance:none;-webkit-appearance:none;-webkit-text-decoration:none;text-decoration:none;color:inherit;font-family:inherit;font-weight:500;font-size:0.875rem;line-height:1.75;text-transform:uppercase;min-width:64px;padding:6px 16px;border-radius:4px;-webkit-transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;color:#fff;background-color:#1976d2;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);width:100%;margin-top:1em;}.css-1j0w7x1::-moz-focus-inner{border-style:none;}.css-1j0w7x1.Mui-disabled{pointer-events:none;cursor:default;}@media print{.css-1j0w7x1{-webkit-print-color-adjust:exact;color-adjust:exact;}}.css-1j0w7x1:hover{-webkit-text-decoration:none;text-decoration:none;background-color:#1565c0;box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);}@media (hover: none){.css-1j0w7x1:hover{background-color:#1976d2;}}.css-1j0w7x1:active{box-shadow:0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);}.css-1j0w7x1.Mui-focusVisible{box-shadow:0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12);}.css-1j0w7x1.Mui-disabled{color:rgba(0, 0, 0, 0.26);box-shadow:none;background-color:rgba(0, 0, 0, 0.12);}</style><button class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-fullWidth MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-fullWidth css-1j0w7x1" tabindex="0" type="submit">Sign In</button><p>Don&#x27;t have an account yet? <a href="/auth/signup/">Sign up</a></p></form></main></div></div><script src="/_next/static/chunks/webpack-ac7a3125017b92ed.js" async=""></script><script src="/_next/static/chunks/b6261da7-e9d81a4364ddd0c0.js" async=""></script><script src="/_next/static/chunks/730-3eb7255cd813a727.js" async=""></script><script src="/_next/static/chunks/main-app-345c3eca7e5cf432.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e4fe491bf84089c-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/3a04115668d8070d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/3a18fc8da1cdcd01-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/627622453ef56b0d-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/699512af39861afa-s.p.woff2\",{\"as\":\"font\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/934c4b7cb736f2a3-s.p.woff2\",{\"as\":\"font\","])</script><script>self.__next_f.push([1,"\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/css/b76f1739b5a14901.css\",{\"as\":\"style\"}]\n0:\"$L8\"\n"])</script><script>self.__next_f.push([1,"9:I{\"id\":83507,\"chunks\":[\"272:static/chunks/webpack-ac7a3125017b92ed.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\nb:I{\"id\":6020,\"chunks\":[\"272:static/chunks/webpack-ac7a3125017b92ed.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"\",\"async\":false}\nc:I{\"id\":30224,\"chunks\":[\"540:static/chunks/540-378a20144435cec6.js\",\"640:static/chunks/640-0f757e2fe135173d.js\",\"620:stat"])</script><script>self.__next_f.push([1,"ic/chunks/620-1e779bd81b43dafb.js\",\"954:static/chunks/954-58788165fb1e9563.js\",\"166:static/chunks/166-157bfb431b68d949.js\",\"185:static/chunks/app/layout-aab36608271969ed.js\"],\"name\":\"PageShell\",\"async\":false}\nd:I{\"id\":27883,\"chunks\":[\"272:static/chunks/webpack-ac7a3125017b92ed.js\",\"470:static/chunks/b6261da7-e9d81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\ne:I{\"id\":46785,\"chunks\":[\"272:static/chunks/webpack-ac7a3125017b92ed.js\",\"470:static/chunks/b6261da7-e9d"])</script><script>self.__next_f.push([1,"81a4364ddd0c0.js\",\"730:static/chunks/730-3eb7255cd813a727.js\"],\"name\":\"default\",\"async\":false}\n10:I{\"id\":92030,\"chunks\":[\"540:static/chunks/540-378a20144435cec6.js\",\"640:static/chunks/640-0f757e2fe135173d.js\",\"215:static/chunks/215-7d83203d614bcd6a.js\",\"620:static/chunks/620-1e779bd81b43dafb.js\",\"304:static/chunks/304-37065d54ff218f46.js\",\"339:static/chunks/339-f38253669d469118.js\",\"954:static/chunks/954-58788165fb1e9563.js\",\"716:static/chunks/app/auth/login/page-ee73165dd261f3ca.js\"],\"name\":\"\",\"async\":fals"])</script><script>self.__next_f.push([1,"e}\n"])</script><script>self.__next_f.push([1,"8:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b76f1739b5a14901.css\",\"precedence\":\"next\"}]],[\"$\",\"$L9\",null,{\"buildId\":\"oG1bS6tprqvmq8_YgsAS8\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/auth/login/\",\"initialTree\":[\"\",{\"children\":[\"auth\",{\"children\":[\"login\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialHead\":\"$La\",\"globalErrorComponent\":\"$b\",\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_c5054f\",\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$Ld\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$Ld\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"auth\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$\",\"$Ld\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"auth\",\"children\",\"login\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"loading\":\"$undefined\",\"loadingStyles\":\"$undefined\",\"hasLoading\":false,\"template\":[\"$\",\"$Le\",null,{}],\"templateStyles\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"childProp\":{\"current\":[\"$Lf\",[\"$\",\"$L10\",null,{}],null],\"segment\":\"__PAGE__\"},\"styles\":[]}],\"segment\":\"login\"},\"styles\":[]}],\"segment\":\"auth\"},\"styles\":[]}]}]}]}],null]}]]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"1\",{\"children\":\"promptfoo\"}],[\"$\",\"meta\",\"2\",{\"name\":\"description\",\"content\":\"LLM testing and evaluation\"}],[\"$\",\"meta\",\"3\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"4\",{\"property\":\"og:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"5\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"6\",{\"name\":\"twitter:image\",\"content\":\"https://www.promptfoo.dev/img/thumbnail.png\"}],[\"$\",\"meta\",\"7\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"f:null\n"])</script></body></html>
@@ -5,7 +5,7 @@
5
5
  5:HL["/_next/static/media/699512af39861afa-s.p.woff2",{"as":"font","type":"font/woff2"}]
6
6
  6:HL["/_next/static/media/934c4b7cb736f2a3-s.p.woff2",{"as":"font","type":"font/woff2"}]
7
7
  7:HL["/_next/static/css/b76f1739b5a14901.css",{"as":"style"}]
8
- 0:["tUB-fEjoICDbTDdLhchKo",[[["",{"children":["auth",{"children":["login",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L8",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/b76f1739b5a14901.css","precedence":"next"}]],"$L9"]]]]
8
+ 0:["oG1bS6tprqvmq8_YgsAS8",[[["",{"children":["auth",{"children":["login",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L8",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/b76f1739b5a14901.css","precedence":"next"}]],"$L9"]]]]
9
9
  a:I{"id":30224,"chunks":["540:static/chunks/540-378a20144435cec6.js","640:static/chunks/640-0f757e2fe135173d.js","620:static/chunks/620-1e779bd81b43dafb.js","954:static/chunks/954-58788165fb1e9563.js","166:static/chunks/166-157bfb431b68d949.js","185:static/chunks/app/layout-aab36608271969ed.js"],"name":"PageShell","async":false}
10
10
  b:I{"id":27883,"chunks":["272:static/chunks/webpack-ac7a3125017b92ed.js","470:static/chunks/b6261da7-e9d81a4364ddd0c0.js","730:static/chunks/730-3eb7255cd813a727.js"],"name":"default","async":false}
11
11
  c:I{"id":46785,"chunks":["272:static/chunks/webpack-ac7a3125017b92ed.js","470:static/chunks/b6261da7-e9d81a4364ddd0c0.js","730:static/chunks/730-3eb7255cd813a727.js"],"name":"default","async":false}