promptfoo 0.112.7 → 0.112.8

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 (81) hide show
  1. package/dist/package.json +11 -11
  2. package/dist/src/app/assets/{index-hWJZsnu2.js → index-DJlMKA-2.js} +11 -11
  3. package/dist/src/app/assets/{index.es-Dr2D4Md0.js → index.es-Dm98tpXC.js} +1 -1
  4. package/dist/src/app/assets/{source-map-support-DvBN-NgF.js → source-map-support-CD7hineC.js} +1 -1
  5. package/dist/src/app/assets/{sync-CL_B8KZP.js → sync-D8TWaIhD.js} +1 -1
  6. package/dist/src/app/index.html +1 -1
  7. package/dist/src/commands/eval.d.ts +6 -1
  8. package/dist/src/commands/eval.d.ts.map +1 -1
  9. package/dist/src/commands/eval.js +5 -1
  10. package/dist/src/commands/eval.js.map +1 -1
  11. package/dist/src/envars.d.ts +1 -0
  12. package/dist/src/envars.d.ts.map +1 -1
  13. package/dist/src/envars.js.map +1 -1
  14. package/dist/src/evaluator.d.ts.map +1 -1
  15. package/dist/src/evaluator.js +3 -2
  16. package/dist/src/evaluator.js.map +1 -1
  17. package/dist/src/googleSheets.js +1 -1
  18. package/dist/src/googleSheets.js.map +1 -1
  19. package/dist/src/main.d.ts.map +1 -1
  20. package/dist/src/main.js +2 -0
  21. package/dist/src/main.js.map +1 -1
  22. package/dist/src/models/eval.d.ts +3 -1
  23. package/dist/src/models/eval.d.ts.map +1 -1
  24. package/dist/src/models/eval.js +19 -4
  25. package/dist/src/models/eval.js.map +1 -1
  26. package/dist/src/providers/ai21.d.ts.map +1 -1
  27. package/dist/src/providers/ai21.js +3 -1
  28. package/dist/src/providers/ai21.js.map +1 -1
  29. package/dist/src/providers/mcp/client.d.ts.map +1 -1
  30. package/dist/src/providers/mcp/client.js +10 -2
  31. package/dist/src/providers/mcp/client.js.map +1 -1
  32. package/dist/src/providers/mcp/types.d.ts +1 -0
  33. package/dist/src/providers/mcp/types.d.ts.map +1 -1
  34. package/dist/src/providers/openai/responses.d.ts.map +1 -1
  35. package/dist/src/providers/openai/responses.js +3 -1
  36. package/dist/src/providers/openai/responses.js.map +1 -1
  37. package/dist/src/providers/openai/util.d.ts.map +1 -1
  38. package/dist/src/providers/openai/util.js +14 -0
  39. package/dist/src/providers/openai/util.js.map +1 -1
  40. package/dist/src/providers/registry.js +2 -2
  41. package/dist/src/providers/registry.js.map +1 -1
  42. package/dist/src/providers/sagemaker.d.ts.map +1 -1
  43. package/dist/src/providers/sagemaker.js +9 -44
  44. package/dist/src/providers/sagemaker.js.map +1 -1
  45. package/dist/src/redteam/commands/discover.d.ts +111 -0
  46. package/dist/src/redteam/commands/discover.d.ts.map +1 -0
  47. package/dist/src/redteam/commands/discover.js +360 -0
  48. package/dist/src/redteam/commands/discover.js.map +1 -0
  49. package/dist/src/redteam/commands/generate.d.ts.map +1 -1
  50. package/dist/src/redteam/commands/generate.js +24 -1
  51. package/dist/src/redteam/commands/generate.js.map +1 -1
  52. package/dist/src/redteam/constants.d.ts +6 -2
  53. package/dist/src/redteam/constants.d.ts.map +1 -1
  54. package/dist/src/redteam/constants.js +20 -11
  55. package/dist/src/redteam/constants.js.map +1 -1
  56. package/dist/src/redteam/index.d.ts +4 -0
  57. package/dist/src/redteam/index.d.ts.map +1 -1
  58. package/dist/src/redteam/index.js +76 -9
  59. package/dist/src/redteam/index.js.map +1 -1
  60. package/dist/src/redteam/strategies/multilingual.d.ts +14 -0
  61. package/dist/src/redteam/strategies/multilingual.d.ts.map +1 -1
  62. package/dist/src/redteam/strategies/multilingual.js +189 -45
  63. package/dist/src/redteam/strategies/multilingual.js.map +1 -1
  64. package/dist/src/redteam/strategies/otherEncodings.d.ts +5 -4
  65. package/dist/src/redteam/strategies/otherEncodings.d.ts.map +1 -1
  66. package/dist/src/redteam/strategies/otherEncodings.js +11 -12
  67. package/dist/src/redteam/strategies/otherEncodings.js.map +1 -1
  68. package/dist/src/redteam/strategies/simpleVideo.d.ts +15 -17
  69. package/dist/src/redteam/strategies/simpleVideo.d.ts.map +1 -1
  70. package/dist/src/redteam/strategies/simpleVideo.js +146 -113
  71. package/dist/src/redteam/strategies/simpleVideo.js.map +1 -1
  72. package/dist/src/share.d.ts.map +1 -1
  73. package/dist/src/share.js +50 -40
  74. package/dist/src/share.js.map +1 -1
  75. package/dist/src/telemetry.d.ts.map +1 -1
  76. package/dist/src/telemetry.js +2 -1
  77. package/dist/src/telemetry.js.map +1 -1
  78. package/dist/src/util/cloud.js +1 -1
  79. package/dist/src/util/cloud.js.map +1 -1
  80. package/dist/tsconfig.tsbuildinfo +1 -1
  81. package/package.json +11 -11
@@ -214,7 +214,7 @@ export default theme;`}function createThemeNoVars(t={},...Ae){const{breakpoints:
214
214
  `:null,dashAnimation=typeof circularDashKeyframe!="string"?css`
215
215
  animation: ${circularDashKeyframe} 1.4s ease-in-out infinite;
216
216
  `:null,useUtilityClasses$1U=t=>{const{classes:Ae,variant:xe,color:Ee,disableShrink:Se}=t,Ce={root:["root",xe,`color${capitalize$1(Ee)}`],svg:["svg"],circle:["circle",`circle${capitalize$1(xe)}`,Se&&"circleDisableShrink"]};return composeClasses(Ce,getCircularProgressUtilityClass,Ae)},CircularProgressRoot=styled("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[xe.variant],Ae[`color${capitalize$1(xe.color)}`]]}})(memoTheme(({theme:t})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:rotateAnimation||{animation:`${circularRotateKeyframe} 1.4s linear infinite`}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{color:Ae},style:{color:(t.vars||t).palette[Ae].main}}))]}))),CircularProgressSVG=styled("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,Ae)=>Ae.svg})({display:"block"}),CircularProgressCircle=styled("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.circle,Ae[`circle${capitalize$1(xe.variant)}`],xe.disableShrink&&Ae.circleDisableShrink]}})(memoTheme(({theme:t})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:Ae})=>Ae.variant==="indeterminate"&&!Ae.disableShrink,style:dashAnimation||{animation:`${circularDashKeyframe} 1.4s ease-in-out infinite`}}]}))),CircularProgress=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiCircularProgress"}),{className:Se,color:Ce="primary",disableShrink:_e=!1,size:Ie=40,style:Be,thickness:Te=3.6,value:Pe=0,variant:ke="indeterminate",...$e}=Ee,Oe={...Ee,color:Ce,disableShrink:_e,size:Ie,thickness:Te,value:Pe,variant:ke},Ue=useUtilityClasses$1U(Oe),qe={},ze={},Ve={};if(ke==="determinate"){const Ge=2*Math.PI*((SIZE-Te)/2);qe.strokeDasharray=Ge.toFixed(3),Ve["aria-valuenow"]=Math.round(Pe),qe.strokeDashoffset=`${((100-Pe)/100*Ge).toFixed(3)}px`,ze.transform="rotate(-90deg)"}return jsxRuntimeExports.jsx(CircularProgressRoot,{className:clsx(Ue.root,Se),style:{width:Ie,height:Ie,...ze,...Be},ownerState:Oe,ref:xe,role:"progressbar",...Ve,...$e,children:jsxRuntimeExports.jsx(CircularProgressSVG,{className:Ue.svg,ownerState:Oe,viewBox:`${SIZE/2} ${SIZE/2} ${SIZE} ${SIZE}`,children:jsxRuntimeExports.jsx(CircularProgressCircle,{className:Ue.circle,style:qe,ownerState:Oe,cx:SIZE,cy:SIZE,r:(SIZE-Te)/2,fill:"none",strokeWidth:Te})})})});function getButtonUtilityClass(t){return generateUtilityClass("MuiButton",t)}const buttonClasses=generateUtilityClasses("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),ButtonGroupContext=reactExports.createContext({}),ButtonGroupButtonContext=reactExports.createContext(void 0),useUtilityClasses$1T=t=>{const{color:Ae,disableElevation:xe,fullWidth:Ee,size:Se,variant:Ce,loading:_e,loadingPosition:Ie,classes:Be}=t,Te={root:["root",_e&&"loading",Ce,`${Ce}${capitalize$1(Ae)}`,`size${capitalize$1(Se)}`,`${Ce}Size${capitalize$1(Se)}`,`color${capitalize$1(Ae)}`,xe&&"disableElevation",Ee&&"fullWidth",_e&&`loadingPosition${capitalize$1(Ie)}`],startIcon:["icon","startIcon",`iconSize${capitalize$1(Se)}`],endIcon:["icon","endIcon",`iconSize${capitalize$1(Se)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},Pe=composeClasses(Te,getButtonUtilityClass,Be);return{...Be,...Pe}},commonIconStyles=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],ButtonRoot=styled(ButtonBase,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[xe.variant],Ae[`${xe.variant}${capitalize$1(xe.color)}`],Ae[`size${capitalize$1(xe.size)}`],Ae[`${xe.variant}Size${capitalize$1(xe.size)}`],xe.color==="inherit"&&Ae.colorInherit,xe.disableElevation&&Ae.disableElevation,xe.fullWidth&&Ae.fullWidth,xe.loading&&Ae.loading]}})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],xe=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${buttonClasses.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${buttonClasses.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${buttonClasses.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${buttonClasses.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ee])=>({props:{color:Ee},style:{"--variant-textColor":(t.vars||t).palette[Ee].main,"--variant-outlinedColor":(t.vars||t).palette[Ee].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[Ee].mainChannel} / 0.5)`:alpha$3(t.palette[Ee].main,.5),"--variant-containedColor":(t.vars||t).palette[Ee].contrastText,"--variant-containedBg":(t.vars||t).palette[Ee].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[Ee].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[Ee].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette[Ee].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[Ee].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[Ee].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette[Ee].main,t.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:Ae,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:xe,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${buttonClasses.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${buttonClasses.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${buttonClasses.loading}`]:{color:"transparent"}}}]}})),ButtonStartIcon=styled("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.startIcon,xe.loading&&Ae.startIconLoadingStart,Ae[`iconSize${capitalize$1(xe.size)}`]]}})(({theme:t})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...commonIconStyles]})),ButtonEndIcon=styled("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.endIcon,xe.loading&&Ae.endIconLoadingEnd,Ae[`iconSize${capitalize$1(xe.size)}`]]}})(({theme:t})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...commonIconStyles]})),ButtonLoadingIndicator=styled("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(t,Ae)=>Ae.loadingIndicator})(({theme:t})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(t.vars||t).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),ButtonLoadingIconPlaceholder=styled("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(t,Ae)=>Ae.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),Button=reactExports.forwardRef(function(Ae,xe){const Ee=reactExports.useContext(ButtonGroupContext),Se=reactExports.useContext(ButtonGroupButtonContext),Ce=resolveProps(Ee,Ae),_e=useDefaultProps({props:Ce,name:"MuiButton"}),{children:Ie,color:Be="primary",component:Te="button",className:Pe,disabled:ke=!1,disableElevation:$e=!1,disableFocusRipple:Oe=!1,endIcon:Ue,focusVisibleClassName:qe,fullWidth:ze=!1,id:Ve,loading:Ge=null,loadingIndicator:Xe,loadingPosition:er="center",size:tr="medium",startIcon:nr,type:sr,variant:dr="text",...ar}=_e,lr=useId(Ve),Ke=Xe??jsxRuntimeExports.jsx(CircularProgress,{"aria-labelledby":lr,color:"inherit",size:16}),Me={..._e,color:Be,component:Te,disabled:ke,disableElevation:$e,disableFocusRipple:Oe,fullWidth:ze,loading:Ge,loadingIndicator:Ke,loadingPosition:er,size:tr,type:sr,variant:dr},je=useUtilityClasses$1T(Me),De=(nr||Ge&&er==="start")&&jsxRuntimeExports.jsx(ButtonStartIcon,{className:je.startIcon,ownerState:Me,children:nr||jsxRuntimeExports.jsx(ButtonLoadingIconPlaceholder,{className:je.loadingIconPlaceholder,ownerState:Me})}),He=(Ue||Ge&&er==="end")&&jsxRuntimeExports.jsx(ButtonEndIcon,{className:je.endIcon,ownerState:Me,children:Ue||jsxRuntimeExports.jsx(ButtonLoadingIconPlaceholder,{className:je.loadingIconPlaceholder,ownerState:Me})}),Qe=Se||"",Ye=typeof Ge=="boolean"?jsxRuntimeExports.jsx("span",{className:je.loadingWrapper,style:{display:"contents"},children:Ge&&jsxRuntimeExports.jsx(ButtonLoadingIndicator,{className:je.loadingIndicator,ownerState:Me,children:Ke})}):null;return jsxRuntimeExports.jsxs(ButtonRoot,{ownerState:Me,className:clsx(Ee.className,je.root,Pe,Qe),component:Te,disabled:ke||Ge,focusRipple:!Oe,focusVisibleClassName:clsx(je.focusVisible,qe),ref:xe,type:sr,id:Ge?lr:Ve,...ar,classes:je,children:[De,er!=="end"&&Ye,Ie,er==="end"&&Ye,He]})});function getIconButtonUtilityClass(t){return generateUtilityClass("MuiIconButton",t)}const iconButtonClasses=generateUtilityClasses("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),useUtilityClasses$1S=t=>{const{classes:Ae,disabled:xe,color:Ee,edge:Se,size:Ce,loading:_e}=t,Ie={root:["root",_e&&"loading",xe&&"disabled",Ee!=="default"&&`color${capitalize$1(Ee)}`,Se&&`edge${capitalize$1(Se)}`,`size${capitalize$1(Ce)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return composeClasses(Ie,getIconButtonUtilityClass,Ae)},IconButtonRoot=styled(ButtonBase,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.loading&&Ae.loading,xe.color!=="default"&&Ae[`color${capitalize$1(xe.color)}`],xe.edge&&Ae[`edge${capitalize$1(xe.edge)}`],Ae[`size${capitalize$1(xe.size)}`]]}})(memoTheme(({theme:t})=>({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:Ae=>!Ae.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),memoTheme(({theme:t})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{color:Ae},style:{color:(t.vars||t).palette[Ae].main}})),...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{color:Ae},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[Ae].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3((t.vars||t).palette[Ae].main,t.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${iconButtonClasses.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled},[`&.${iconButtonClasses.loading}`]:{color:"transparent"}}))),IconButtonLoadingIndicator=styled("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(t,Ae)=>Ae.loadingIndicator})(({theme:t})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(t.vars||t).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),IconButton=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiIconButton"}),{edge:Se=!1,children:Ce,className:_e,color:Ie="default",disabled:Be=!1,disableFocusRipple:Te=!1,size:Pe="medium",id:ke,loading:$e=null,loadingIndicator:Oe,...Ue}=Ee,qe=useId(ke),ze=Oe??jsxRuntimeExports.jsx(CircularProgress,{"aria-labelledby":qe,color:"inherit",size:16}),Ve={...Ee,edge:Se,color:Ie,disabled:Be,disableFocusRipple:Te,loading:$e,loadingIndicator:ze,size:Pe},Ge=useUtilityClasses$1S(Ve);return jsxRuntimeExports.jsxs(IconButtonRoot,{id:$e?qe:ke,className:clsx(Ge.root,_e),centerRipple:!0,focusRipple:!Te,disabled:Be||$e,ref:xe,...Ue,ownerState:Ve,children:[typeof $e=="boolean"&&jsxRuntimeExports.jsx("span",{className:Ge.loadingWrapper,style:{display:"contents"},children:jsxRuntimeExports.jsx(IconButtonLoadingIndicator,{className:Ge.loadingIndicator,ownerState:Ve,children:$e&&ze})}),Ce]})}),ListContext=reactExports.createContext({});function getListUtilityClass(t){return generateUtilityClass("MuiList",t)}generateUtilityClasses("MuiList",["root","padding","dense","subheader"]);const useUtilityClasses$1R=t=>{const{classes:Ae,disablePadding:xe,dense:Ee,subheader:Se}=t;return composeClasses({root:["root",!xe&&"padding",Ee&&"dense",Se&&"subheader"]},getListUtilityClass,Ae)},ListRoot=styled("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,!xe.disablePadding&&Ae.padding,xe.dense&&Ae.dense,xe.subheader&&Ae.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>t.subheader,style:{paddingTop:0}}]}),List$1=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiList"}),{children:Se,className:Ce,component:_e="ul",dense:Ie=!1,disablePadding:Be=!1,subheader:Te,...Pe}=Ee,ke=reactExports.useMemo(()=>({dense:Ie}),[Ie]),$e={...Ee,component:_e,dense:Ie,disablePadding:Be},Oe=useUtilityClasses$1R($e);return jsxRuntimeExports.jsx(ListContext.Provider,{value:ke,children:jsxRuntimeExports.jsxs(ListRoot,{as:_e,className:clsx(Oe.root,Ce),ref:xe,ownerState:$e,...Pe,children:[Te,Se]})})});function nextItem$1(t,Ae,xe){return t===Ae?t.firstChild:Ae&&Ae.nextElementSibling?Ae.nextElementSibling:xe?null:t.firstChild}function previousItem$1(t,Ae,xe){return t===Ae?xe?t.firstChild:t.lastChild:Ae&&Ae.previousElementSibling?Ae.previousElementSibling:xe?null:t.lastChild}function textCriteriaMatches(t,Ae){if(Ae===void 0)return!0;let xe=t.innerText;return xe===void 0&&(xe=t.textContent),xe=xe.trim().toLowerCase(),xe.length===0?!1:Ae.repeating?xe[0]===Ae.keys[0]:xe.startsWith(Ae.keys.join(""))}function moveFocus$1(t,Ae,xe,Ee,Se,Ce){let _e=!1,Ie=Se(t,Ae,Ae?xe:!1);for(;Ie;){if(Ie===t.firstChild){if(_e)return!1;_e=!0}const Be=Ee?!1:Ie.disabled||Ie.getAttribute("aria-disabled")==="true";if(!Ie.hasAttribute("tabindex")||!textCriteriaMatches(Ie,Ce)||Be)Ie=Se(t,Ie,xe);else return Ie.focus(),!0}return!1}const MenuList=reactExports.forwardRef(function(Ae,xe){const{actions:Ee,autoFocus:Se=!1,autoFocusItem:Ce=!1,children:_e,className:Ie,disabledItemsFocusable:Be=!1,disableListWrap:Te=!1,onKeyDown:Pe,variant:ke="selectedMenu",...$e}=Ae,Oe=reactExports.useRef(null),Ue=reactExports.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});useEnhancedEffect(()=>{Se&&Oe.current.focus()},[Se]),reactExports.useImperativeHandle(Ee,()=>({adjustStyleForScrollbar:(Xe,{direction:er})=>{const tr=!Oe.current.style.width;if(Xe.clientHeight<Oe.current.clientHeight&&tr){const nr=`${getScrollbarSize(ownerWindow(Xe))}px`;Oe.current.style[er==="rtl"?"paddingLeft":"paddingRight"]=nr,Oe.current.style.width=`calc(100% + ${nr})`}return Oe.current}}),[]);const qe=Xe=>{const er=Oe.current,tr=Xe.key;if(Xe.ctrlKey||Xe.metaKey||Xe.altKey){Pe&&Pe(Xe);return}const sr=ownerDocument(er).activeElement;if(tr==="ArrowDown")Xe.preventDefault(),moveFocus$1(er,sr,Te,Be,nextItem$1);else if(tr==="ArrowUp")Xe.preventDefault(),moveFocus$1(er,sr,Te,Be,previousItem$1);else if(tr==="Home")Xe.preventDefault(),moveFocus$1(er,null,Te,Be,nextItem$1);else if(tr==="End")Xe.preventDefault(),moveFocus$1(er,null,Te,Be,previousItem$1);else if(tr.length===1){const dr=Ue.current,ar=tr.toLowerCase(),lr=performance.now();dr.keys.length>0&&(lr-dr.lastTime>500?(dr.keys=[],dr.repeating=!0,dr.previousKeyMatched=!0):dr.repeating&&ar!==dr.keys[0]&&(dr.repeating=!1)),dr.lastTime=lr,dr.keys.push(ar);const Ke=sr&&!dr.repeating&&textCriteriaMatches(sr,dr);dr.previousKeyMatched&&(Ke||moveFocus$1(er,sr,!1,Be,nextItem$1,dr))?Xe.preventDefault():dr.previousKeyMatched=!1}Pe&&Pe(Xe)},ze=useForkRef(Oe,xe);let Ve=-1;reactExports.Children.forEach(_e,(Xe,er)=>{if(!reactExports.isValidElement(Xe)){Ve===er&&(Ve+=1,Ve>=_e.length&&(Ve=-1));return}Xe.props.disabled||(ke==="selectedMenu"&&Xe.props.selected||Ve===-1)&&(Ve=er),Ve===er&&(Xe.props.disabled||Xe.props.muiSkipListHighlight||Xe.type.muiSkipListHighlight)&&(Ve+=1,Ve>=_e.length&&(Ve=-1))});const Ge=reactExports.Children.map(_e,(Xe,er)=>{if(er===Ve){const tr={};return Ce&&(tr.autoFocus=!0),Xe.props.tabIndex===void 0&&ke==="selectedMenu"&&(tr.tabIndex=0),reactExports.cloneElement(Xe,tr)}return Xe});return jsxRuntimeExports.jsx(List$1,{role:"menu",ref:ze,className:Ie,onKeyDown:qe,tabIndex:Se?0:-1,...$e,children:Ge})});function isHostComponent(t){return typeof t=="string"}const reflow=t=>t.scrollTop;function getTransitionProps(t,Ae){const{timeout:xe,easing:Ee,style:Se={}}=t;return{duration:Se.transitionDuration??(typeof xe=="number"?xe:xe[Ae.mode]||0),easing:Se.transitionTimingFunction??(typeof Ee=="object"?Ee[Ae.mode]:Ee),delay:Se.transitionDelay}}function getScale(t){return`scale(${t}, ${t**2})`}const styles$4={entering:{opacity:1,transform:getScale(1)},entered:{opacity:1,transform:"none"}},isWebKit154=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Grow=reactExports.forwardRef(function(Ae,xe){const{addEndListener:Ee,appear:Se=!0,children:Ce,easing:_e,in:Ie,onEnter:Be,onEntered:Te,onEntering:Pe,onExit:ke,onExited:$e,onExiting:Oe,style:Ue,timeout:qe="auto",TransitionComponent:ze=Transition,...Ve}=Ae,Ge=useTimeout(),Xe=reactExports.useRef(),er=useTheme(),tr=reactExports.useRef(null),nr=useForkRef(tr,getReactElementRef(Ce),xe),sr=He=>Qe=>{if(He){const Ye=tr.current;Qe===void 0?He(Ye):He(Ye,Qe)}},dr=sr(Pe),ar=sr((He,Qe)=>{reflow(He);const{duration:Ye,delay:St,easing:We}=getTransitionProps({style:Ue,timeout:qe,easing:_e},{mode:"enter"});let Fe;qe==="auto"?(Fe=er.transitions.getAutoHeightDuration(He.clientHeight),Xe.current=Fe):Fe=Ye,He.style.transition=[er.transitions.create("opacity",{duration:Fe,delay:St}),er.transitions.create("transform",{duration:isWebKit154?Fe:Fe*.666,delay:St,easing:We})].join(","),Be&&Be(He,Qe)}),lr=sr(Te),Ke=sr(Oe),Me=sr(He=>{const{duration:Qe,delay:Ye,easing:St}=getTransitionProps({style:Ue,timeout:qe,easing:_e},{mode:"exit"});let We;qe==="auto"?(We=er.transitions.getAutoHeightDuration(He.clientHeight),Xe.current=We):We=Qe,He.style.transition=[er.transitions.create("opacity",{duration:We,delay:Ye}),er.transitions.create("transform",{duration:isWebKit154?We:We*.666,delay:isWebKit154?Ye:Ye||We*.333,easing:St})].join(","),He.style.opacity=0,He.style.transform=getScale(.75),ke&&ke(He)}),je=sr($e),De=He=>{qe==="auto"&&Ge.start(Xe.current||0,He),Ee&&Ee(tr.current,He)};return jsxRuntimeExports.jsx(ze,{appear:Se,in:Ie,nodeRef:tr,onEnter:ar,onEntered:lr,onEntering:dr,onExit:Me,onExited:je,onExiting:Ke,addEndListener:De,timeout:qe==="auto"?null:qe,...Ve,children:(He,{ownerState:Qe,...Ye})=>reactExports.cloneElement(Ce,{style:{opacity:0,transform:getScale(.75),visibility:He==="exited"&&!Ie?"hidden":void 0,...styles$4[He],...Ue,...Ce.props.style},ref:nr,...Ye})})});Grow&&(Grow.muiSupportAuto=!0);function isOverflowing(t){const Ae=ownerDocument(t);return Ae.body===t?ownerWindow(t).innerWidth>Ae.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function ariaHidden(t,Ae){Ae?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function getPaddingRight(t){return parseInt(ownerWindow(t).getComputedStyle(t).paddingRight,10)||0}function isAriaHiddenForbiddenOnElement(t){const xe=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(t.tagName),Ee=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return xe||Ee}function ariaHiddenSiblings(t,Ae,xe,Ee,Se){const Ce=[Ae,xe,...Ee];[].forEach.call(t.children,_e=>{const Ie=!Ce.includes(_e),Be=!isAriaHiddenForbiddenOnElement(_e);Ie&&Be&&ariaHidden(_e,Se)})}function findIndexOf(t,Ae){let xe=-1;return t.some((Ee,Se)=>Ae(Ee)?(xe=Se,!0):!1),xe}function handleContainer(t,Ae){const xe=[],Ee=t.container;if(!Ae.disableScrollLock){if(isOverflowing(Ee)){const _e=getScrollbarSize(ownerWindow(Ee));xe.push({value:Ee.style.paddingRight,property:"padding-right",el:Ee}),Ee.style.paddingRight=`${getPaddingRight(Ee)+_e}px`;const Ie=ownerDocument(Ee).querySelectorAll(".mui-fixed");[].forEach.call(Ie,Be=>{xe.push({value:Be.style.paddingRight,property:"padding-right",el:Be}),Be.style.paddingRight=`${getPaddingRight(Be)+_e}px`})}let Ce;if(Ee.parentNode instanceof DocumentFragment)Ce=ownerDocument(Ee).body;else{const _e=Ee.parentElement,Ie=ownerWindow(Ee);Ce=(_e==null?void 0:_e.nodeName)==="HTML"&&Ie.getComputedStyle(_e).overflowY==="scroll"?_e:Ee}xe.push({value:Ce.style.overflow,property:"overflow",el:Ce},{value:Ce.style.overflowX,property:"overflow-x",el:Ce},{value:Ce.style.overflowY,property:"overflow-y",el:Ce}),Ce.style.overflow="hidden"}return()=>{xe.forEach(({value:Ce,el:_e,property:Ie})=>{Ce?_e.style.setProperty(Ie,Ce):_e.style.removeProperty(Ie)})}}function getHiddenSiblings(t){const Ae=[];return[].forEach.call(t.children,xe=>{xe.getAttribute("aria-hidden")==="true"&&Ae.push(xe)}),Ae}class ModalManager{constructor(){this.modals=[],this.containers=[]}add(Ae,xe){let Ee=this.modals.indexOf(Ae);if(Ee!==-1)return Ee;Ee=this.modals.length,this.modals.push(Ae),Ae.modalRef&&ariaHidden(Ae.modalRef,!1);const Se=getHiddenSiblings(xe);ariaHiddenSiblings(xe,Ae.mount,Ae.modalRef,Se,!0);const Ce=findIndexOf(this.containers,_e=>_e.container===xe);return Ce!==-1?(this.containers[Ce].modals.push(Ae),Ee):(this.containers.push({modals:[Ae],container:xe,restore:null,hiddenSiblings:Se}),Ee)}mount(Ae,xe){const Ee=findIndexOf(this.containers,Ce=>Ce.modals.includes(Ae)),Se=this.containers[Ee];Se.restore||(Se.restore=handleContainer(Se,xe))}remove(Ae,xe=!0){const Ee=this.modals.indexOf(Ae);if(Ee===-1)return Ee;const Se=findIndexOf(this.containers,_e=>_e.modals.includes(Ae)),Ce=this.containers[Se];if(Ce.modals.splice(Ce.modals.indexOf(Ae),1),this.modals.splice(Ee,1),Ce.modals.length===0)Ce.restore&&Ce.restore(),Ae.modalRef&&ariaHidden(Ae.modalRef,xe),ariaHiddenSiblings(Ce.container,Ae.mount,Ae.modalRef,Ce.hiddenSiblings,!1),this.containers.splice(Se,1);else{const _e=Ce.modals[Ce.modals.length-1];_e.modalRef&&ariaHidden(_e.modalRef,!1)}return Ee}isTopModal(Ae){return this.modals.length>0&&this.modals[this.modals.length-1]===Ae}}const candidatesSelector=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function getTabIndex(t){const Ae=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(Ae)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:Ae}function isNonTabbableRadio(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const Ae=Ee=>t.ownerDocument.querySelector(`input[type="radio"]${Ee}`);let xe=Ae(`[name="${t.name}"]:checked`);return xe||(xe=Ae(`[name="${t.name}"]`)),xe!==t}function isNodeMatchingSelectorFocusable(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||isNonTabbableRadio(t))}function defaultGetTabbable(t){const Ae=[],xe=[];return Array.from(t.querySelectorAll(candidatesSelector)).forEach((Ee,Se)=>{const Ce=getTabIndex(Ee);Ce===-1||!isNodeMatchingSelectorFocusable(Ee)||(Ce===0?Ae.push(Ee):xe.push({documentOrder:Se,tabIndex:Ce,node:Ee}))}),xe.sort((Ee,Se)=>Ee.tabIndex===Se.tabIndex?Ee.documentOrder-Se.documentOrder:Ee.tabIndex-Se.tabIndex).map(Ee=>Ee.node).concat(Ae)}function defaultIsEnabled(){return!0}function FocusTrap(t){const{children:Ae,disableAutoFocus:xe=!1,disableEnforceFocus:Ee=!1,disableRestoreFocus:Se=!1,getTabbable:Ce=defaultGetTabbable,isEnabled:_e=defaultIsEnabled,open:Ie}=t,Be=reactExports.useRef(!1),Te=reactExports.useRef(null),Pe=reactExports.useRef(null),ke=reactExports.useRef(null),$e=reactExports.useRef(null),Oe=reactExports.useRef(!1),Ue=reactExports.useRef(null),qe=useForkRef(getReactElementRef(Ae),Ue),ze=reactExports.useRef(null);reactExports.useEffect(()=>{!Ie||!Ue.current||(Oe.current=!xe)},[xe,Ie]),reactExports.useEffect(()=>{if(!Ie||!Ue.current)return;const Xe=ownerDocument(Ue.current);return Ue.current.contains(Xe.activeElement)||(Ue.current.hasAttribute("tabIndex")||Ue.current.setAttribute("tabIndex","-1"),Oe.current&&Ue.current.focus()),()=>{Se||(ke.current&&ke.current.focus&&(Be.current=!0,ke.current.focus()),ke.current=null)}},[Ie]),reactExports.useEffect(()=>{if(!Ie||!Ue.current)return;const Xe=ownerDocument(Ue.current),er=sr=>{ze.current=sr,!(Ee||!_e()||sr.key!=="Tab")&&Xe.activeElement===Ue.current&&sr.shiftKey&&(Be.current=!0,Pe.current&&Pe.current.focus())},tr=()=>{var ar,lr;const sr=Ue.current;if(sr===null)return;if(!Xe.hasFocus()||!_e()||Be.current){Be.current=!1;return}if(sr.contains(Xe.activeElement)||Ee&&Xe.activeElement!==Te.current&&Xe.activeElement!==Pe.current)return;if(Xe.activeElement!==$e.current)$e.current=null;else if($e.current!==null)return;if(!Oe.current)return;let dr=[];if((Xe.activeElement===Te.current||Xe.activeElement===Pe.current)&&(dr=Ce(Ue.current)),dr.length>0){const Ke=!!((ar=ze.current)!=null&&ar.shiftKey&&((lr=ze.current)==null?void 0:lr.key)==="Tab"),Me=dr[0],je=dr[dr.length-1];typeof Me!="string"&&typeof je!="string"&&(Ke?je.focus():Me.focus())}else sr.focus()};Xe.addEventListener("focusin",tr),Xe.addEventListener("keydown",er,!0);const nr=setInterval(()=>{Xe.activeElement&&Xe.activeElement.tagName==="BODY"&&tr()},50);return()=>{clearInterval(nr),Xe.removeEventListener("focusin",tr),Xe.removeEventListener("keydown",er,!0)}},[xe,Ee,Se,_e,Ie,Ce]);const Ve=Xe=>{ke.current===null&&(ke.current=Xe.relatedTarget),Oe.current=!0,$e.current=Xe.target;const er=Ae.props.onFocus;er&&er(Xe)},Ge=Xe=>{ke.current===null&&(ke.current=Xe.relatedTarget),Oe.current=!0};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{tabIndex:Ie?0:-1,onFocus:Ge,ref:Te,"data-testid":"sentinelStart"}),reactExports.cloneElement(Ae,{ref:qe,onFocus:Ve}),jsxRuntimeExports.jsx("div",{tabIndex:Ie?0:-1,onFocus:Ge,ref:Pe,"data-testid":"sentinelEnd"})]})}function getContainer$1(t){return typeof t=="function"?t():t}const Portal=reactExports.forwardRef(function(Ae,xe){const{children:Ee,container:Se,disablePortal:Ce=!1}=Ae,[_e,Ie]=reactExports.useState(null),Be=useForkRef(reactExports.isValidElement(Ee)?getReactElementRef(Ee):null,xe);if(useEnhancedEffect(()=>{Ce||Ie(getContainer$1(Se)||document.body)},[Se,Ce]),useEnhancedEffect(()=>{if(_e&&!Ce)return setRef(xe,_e),()=>{setRef(xe,null)}},[xe,_e,Ce]),Ce){if(reactExports.isValidElement(Ee)){const Te={ref:Be};return reactExports.cloneElement(Ee,Te)}return Ee}return _e&&reactDomExports.createPortal(Ee,_e)});function useSlot(t,Ae){const{className:xe,elementType:Ee,ownerState:Se,externalForwardedProps:Ce,internalForwardedProps:_e,shouldForwardComponentProp:Ie=!1,...Be}=Ae,{component:Te,slots:Pe={[t]:void 0},slotProps:ke={[t]:void 0},...$e}=Ce,Oe=Pe[t]||Ee,Ue=resolveComponentProps(ke[t],Se),{props:{component:qe,...ze},internalRef:Ve}=mergeSlotProps$1({className:xe,...Be,externalForwardedProps:t==="root"?$e:void 0,externalSlotProps:Ue}),Ge=useForkRef(Ve,Ue==null?void 0:Ue.ref,Ae.ref),Xe=t==="root"?qe||Te:qe,er=appendOwnerState(Oe,{...t==="root"&&!Te&&!Pe[t]&&_e,...t!=="root"&&!Pe[t]&&_e,...ze,...Xe&&!Ie&&{as:Xe},...Xe&&Ie&&{component:Xe},ref:Ge},Se);return[Oe,er]}const styles$3={entering:{opacity:1},entered:{opacity:1}},Fade=reactExports.forwardRef(function(Ae,xe){const Ee=useTheme(),Se={enter:Ee.transitions.duration.enteringScreen,exit:Ee.transitions.duration.leavingScreen},{addEndListener:Ce,appear:_e=!0,children:Ie,easing:Be,in:Te,onEnter:Pe,onEntered:ke,onEntering:$e,onExit:Oe,onExited:Ue,onExiting:qe,style:ze,timeout:Ve=Se,TransitionComponent:Ge=Transition,...Xe}=Ae,er=reactExports.useRef(null),tr=useForkRef(er,getReactElementRef(Ie),xe),nr=De=>He=>{if(De){const Qe=er.current;He===void 0?De(Qe):De(Qe,He)}},sr=nr($e),dr=nr((De,He)=>{reflow(De);const Qe=getTransitionProps({style:ze,timeout:Ve,easing:Be},{mode:"enter"});De.style.webkitTransition=Ee.transitions.create("opacity",Qe),De.style.transition=Ee.transitions.create("opacity",Qe),Pe&&Pe(De,He)}),ar=nr(ke),lr=nr(qe),Ke=nr(De=>{const He=getTransitionProps({style:ze,timeout:Ve,easing:Be},{mode:"exit"});De.style.webkitTransition=Ee.transitions.create("opacity",He),De.style.transition=Ee.transitions.create("opacity",He),Oe&&Oe(De)}),Me=nr(Ue),je=De=>{Ce&&Ce(er.current,De)};return jsxRuntimeExports.jsx(Ge,{appear:_e,in:Te,nodeRef:er,onEnter:dr,onEntered:ar,onEntering:sr,onExit:Ke,onExited:Me,onExiting:lr,addEndListener:je,timeout:Ve,...Xe,children:(De,{ownerState:He,...Qe})=>reactExports.cloneElement(Ie,{style:{opacity:0,visibility:De==="exited"&&!Te?"hidden":void 0,...styles$3[De],...ze,...Ie.props.style},ref:tr,...Qe})})});function getBackdropUtilityClass(t){return generateUtilityClass("MuiBackdrop",t)}generateUtilityClasses("MuiBackdrop",["root","invisible"]);const useUtilityClasses$1Q=t=>{const{classes:Ae,invisible:xe}=t;return composeClasses({root:["root",xe&&"invisible"]},getBackdropUtilityClass,Ae)},BackdropRoot=styled("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.invisible&&Ae.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),Backdrop=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiBackdrop"}),{children:Se,className:Ce,component:_e="div",invisible:Ie=!1,open:Be,components:Te={},componentsProps:Pe={},slotProps:ke={},slots:$e={},TransitionComponent:Oe,transitionDuration:Ue,...qe}=Ee,ze={...Ee,component:_e,invisible:Ie},Ve=useUtilityClasses$1Q(ze),Ge={transition:Oe,root:Te.Root,...$e},Xe={...Pe,...ke},er={slots:Ge,slotProps:Xe},[tr,nr]=useSlot("root",{elementType:BackdropRoot,externalForwardedProps:er,className:clsx(Ve.root,Ce),ownerState:ze}),[sr,dr]=useSlot("transition",{elementType:Fade,externalForwardedProps:er,ownerState:ze});return jsxRuntimeExports.jsx(sr,{in:Be,timeout:Ue,...qe,...dr,children:jsxRuntimeExports.jsx(tr,{"aria-hidden":!0,...nr,classes:Ve,ref:xe,children:Se})})});function getContainer(t){return typeof t=="function"?t():t}function getHasTransition(t){return t?t.props.hasOwnProperty("in"):!1}const noop$3=()=>{},manager=new ModalManager;function useModal(t){const{container:Ae,disableEscapeKeyDown:xe=!1,disableScrollLock:Ee=!1,closeAfterTransition:Se=!1,onTransitionEnter:Ce,onTransitionExited:_e,children:Ie,onClose:Be,open:Te,rootRef:Pe}=t,ke=reactExports.useRef({}),$e=reactExports.useRef(null),Oe=reactExports.useRef(null),Ue=useForkRef(Oe,Pe),[qe,ze]=reactExports.useState(!Te),Ve=getHasTransition(Ie);let Ge=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(Ge=!1);const Xe=()=>ownerDocument($e.current),er=()=>(ke.current.modalRef=Oe.current,ke.current.mount=$e.current,ke.current),tr=()=>{manager.mount(er(),{disableScrollLock:Ee}),Oe.current&&(Oe.current.scrollTop=0)},nr=useEventCallback(()=>{const He=getContainer(Ae)||Xe().body;manager.add(er(),He),Oe.current&&tr()}),sr=()=>manager.isTopModal(er()),dr=useEventCallback(He=>{$e.current=He,He&&(Te&&sr()?tr():Oe.current&&ariaHidden(Oe.current,Ge))}),ar=reactExports.useCallback(()=>{manager.remove(er(),Ge)},[Ge]);reactExports.useEffect(()=>()=>{ar()},[ar]),reactExports.useEffect(()=>{Te?nr():(!Ve||!Se)&&ar()},[Te,ar,Ve,Se,nr]);const lr=He=>Qe=>{var Ye;(Ye=He.onKeyDown)==null||Ye.call(He,Qe),!(Qe.key!=="Escape"||Qe.which===229||!sr())&&(xe||(Qe.stopPropagation(),Be&&Be(Qe,"escapeKeyDown")))},Ke=He=>Qe=>{var Ye;(Ye=He.onClick)==null||Ye.call(He,Qe),Qe.target===Qe.currentTarget&&Be&&Be(Qe,"backdropClick")};return{getRootProps:(He={})=>{const Qe=extractEventHandlers(t);delete Qe.onTransitionEnter,delete Qe.onTransitionExited;const Ye={...Qe,...He};return{role:"presentation",...Ye,onKeyDown:lr(Ye),ref:Ue}},getBackdropProps:(He={})=>{const Qe=He;return{"aria-hidden":!0,...Qe,onClick:Ke(Qe),open:Te}},getTransitionProps:()=>{const He=()=>{ze(!1),Ce&&Ce()},Qe=()=>{ze(!0),_e&&_e(),Se&&ar()};return{onEnter:createChainedFunction(He,(Ie==null?void 0:Ie.props.onEnter)??noop$3),onExited:createChainedFunction(Qe,(Ie==null?void 0:Ie.props.onExited)??noop$3)}},rootRef:Ue,portalRef:dr,isTopModal:sr,exited:qe,hasTransition:Ve}}function getModalUtilityClass(t){return generateUtilityClass("MuiModal",t)}generateUtilityClasses("MuiModal",["root","hidden","backdrop"]);const useUtilityClasses$1P=t=>{const{open:Ae,exited:xe,classes:Ee}=t;return composeClasses({root:["root",!Ae&&xe&&"hidden"],backdrop:["backdrop"]},getModalUtilityClass,Ee)},ModalRoot=styled("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,!xe.open&&xe.exited&&Ae.hidden]}})(memoTheme(({theme:t})=>({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:Ae})=>!Ae.open&&Ae.exited,style:{visibility:"hidden"}}]}))),ModalBackdrop=styled(Backdrop,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,Ae)=>Ae.backdrop})({zIndex:-1}),Modal=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({name:"MuiModal",props:Ae}),{BackdropComponent:Se=ModalBackdrop,BackdropProps:Ce,classes:_e,className:Ie,closeAfterTransition:Be=!1,children:Te,container:Pe,component:ke,components:$e={},componentsProps:Oe={},disableAutoFocus:Ue=!1,disableEnforceFocus:qe=!1,disableEscapeKeyDown:ze=!1,disablePortal:Ve=!1,disableRestoreFocus:Ge=!1,disableScrollLock:Xe=!1,hideBackdrop:er=!1,keepMounted:tr=!1,onBackdropClick:nr,onClose:sr,onTransitionEnter:dr,onTransitionExited:ar,open:lr,slotProps:Ke={},slots:Me={},theme:je,...De}=Ee,He={...Ee,closeAfterTransition:Be,disableAutoFocus:Ue,disableEnforceFocus:qe,disableEscapeKeyDown:ze,disablePortal:Ve,disableRestoreFocus:Ge,disableScrollLock:Xe,hideBackdrop:er,keepMounted:tr},{getRootProps:Qe,getBackdropProps:Ye,getTransitionProps:St,portalRef:We,isTopModal:Fe,exited:Ze,hasTransition:ir}=useModal({...He,rootRef:xe}),ur={...He,exited:Ze},fr=useUtilityClasses$1P(ur),Ar={};if(Te.props.tabIndex===void 0&&(Ar.tabIndex="-1"),ir){const{onEnter:Fr,onExited:Ir}=St();Ar.onEnter=Fr,Ar.onExited=Ir}const vr={slots:{root:$e.Root,backdrop:$e.Backdrop,...Me},slotProps:{...Oe,...Ke}},[xr,br]=useSlot("root",{ref:xe,elementType:ModalRoot,externalForwardedProps:{...vr,...De,component:ke},getSlotProps:Qe,ownerState:ur,className:clsx(Ie,fr==null?void 0:fr.root,!ur.open&&ur.exited&&(fr==null?void 0:fr.hidden))}),[_r,$r]=useSlot("backdrop",{ref:Ce==null?void 0:Ce.ref,elementType:Se,externalForwardedProps:vr,shouldForwardComponentProp:!0,additionalProps:Ce,getSlotProps:Fr=>Ye({...Fr,onClick:Ir=>{nr&&nr(Ir),Fr!=null&&Fr.onClick&&Fr.onClick(Ir)}}),className:clsx(Ce==null?void 0:Ce.className,fr==null?void 0:fr.backdrop),ownerState:ur});return!tr&&!lr&&(!ir||Ze)?null:jsxRuntimeExports.jsx(Portal,{ref:We,container:Pe,disablePortal:Ve,children:jsxRuntimeExports.jsxs(xr,{...br,children:[!er&&Se?jsxRuntimeExports.jsx(_r,{...$r}):null,jsxRuntimeExports.jsx(FocusTrap,{disableEnforceFocus:qe,disableAutoFocus:Ue,disableRestoreFocus:Ge,isEnabled:Fe,open:lr,children:reactExports.cloneElement(Te,Ar)})]})})});function getPopoverUtilityClass(t){return generateUtilityClass("MuiPopover",t)}generateUtilityClasses("MuiPopover",["root","paper"]);function getOffsetTop(t,Ae){let xe=0;return typeof Ae=="number"?xe=Ae:Ae==="center"?xe=t.height/2:Ae==="bottom"&&(xe=t.height),xe}function getOffsetLeft(t,Ae){let xe=0;return typeof Ae=="number"?xe=Ae:Ae==="center"?xe=t.width/2:Ae==="right"&&(xe=t.width),xe}function getTransformOriginValue(t){return[t.horizontal,t.vertical].map(Ae=>typeof Ae=="number"?`${Ae}px`:Ae).join(" ")}function resolveAnchorEl$1(t){return typeof t=="function"?t():t}const useUtilityClasses$1O=t=>{const{classes:Ae}=t;return composeClasses({root:["root"],paper:["paper"]},getPopoverUtilityClass,Ae)},PopoverRoot=styled(Modal,{name:"MuiPopover",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({}),PopoverPaper=styled(Paper,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,Ae)=>Ae.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Popover=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiPopover"}),{action:Se,anchorEl:Ce,anchorOrigin:_e={vertical:"top",horizontal:"left"},anchorPosition:Ie,anchorReference:Be="anchorEl",children:Te,className:Pe,container:ke,elevation:$e=8,marginThreshold:Oe=16,open:Ue,PaperProps:qe={},slots:ze={},slotProps:Ve={},transformOrigin:Ge={vertical:"top",horizontal:"left"},TransitionComponent:Xe,transitionDuration:er="auto",TransitionProps:tr={},disableScrollLock:nr=!1,...sr}=Ee,dr=reactExports.useRef(),ar={...Ee,anchorOrigin:_e,anchorReference:Be,elevation:$e,marginThreshold:Oe,transformOrigin:Ge,TransitionComponent:Xe,transitionDuration:er,TransitionProps:tr},lr=useUtilityClasses$1O(ar),Ke=reactExports.useCallback(()=>{if(Be==="anchorPosition")return Ie;const $r=resolveAnchorEl$1(Ce),Ir=($r&&$r.nodeType===1?$r:ownerDocument(dr.current).body).getBoundingClientRect();return{top:Ir.top+getOffsetTop(Ir,_e.vertical),left:Ir.left+getOffsetLeft(Ir,_e.horizontal)}},[Ce,_e.horizontal,_e.vertical,Ie,Be]),Me=reactExports.useCallback($r=>({vertical:getOffsetTop($r,Ge.vertical),horizontal:getOffsetLeft($r,Ge.horizontal)}),[Ge.horizontal,Ge.vertical]),je=reactExports.useCallback($r=>{const Fr={width:$r.offsetWidth,height:$r.offsetHeight},Ir=Me(Fr);if(Be==="none")return{top:null,left:null,transformOrigin:getTransformOriginValue(Ir)};const zr=Ke();let dn=zr.top-Ir.vertical,tn=zr.left-Ir.horizontal;const Gr=dn+Fr.height,wn=tn+Fr.width,an=ownerWindow(resolveAnchorEl$1(Ce)),Vr=an.innerHeight-Oe,Rn=an.innerWidth-Oe;if(Oe!==null&&dn<Oe){const un=dn-Oe;dn-=un,Ir.vertical+=un}else if(Oe!==null&&Gr>Vr){const un=Gr-Vr;dn-=un,Ir.vertical+=un}if(Oe!==null&&tn<Oe){const un=tn-Oe;tn-=un,Ir.horizontal+=un}else if(wn>Rn){const un=wn-Rn;tn-=un,Ir.horizontal+=un}return{top:`${Math.round(dn)}px`,left:`${Math.round(tn)}px`,transformOrigin:getTransformOriginValue(Ir)}},[Ce,Be,Ke,Me,Oe]),[De,He]=reactExports.useState(Ue),Qe=reactExports.useCallback(()=>{const $r=dr.current;if(!$r)return;const Fr=je($r);Fr.top!==null&&$r.style.setProperty("top",Fr.top),Fr.left!==null&&($r.style.left=Fr.left),$r.style.transformOrigin=Fr.transformOrigin,He(!0)},[je]);reactExports.useEffect(()=>(nr&&window.addEventListener("scroll",Qe),()=>window.removeEventListener("scroll",Qe)),[Ce,nr,Qe]);const Ye=()=>{Qe()},St=()=>{He(!1)};reactExports.useEffect(()=>{Ue&&Qe()}),reactExports.useImperativeHandle(Se,()=>Ue?{updatePosition:()=>{Qe()}}:null,[Ue,Qe]),reactExports.useEffect(()=>{if(!Ue)return;const $r=debounce$2(()=>{Qe()}),Fr=ownerWindow(Ce);return Fr.addEventListener("resize",$r),()=>{$r.clear(),Fr.removeEventListener("resize",$r)}},[Ce,Ue,Qe]);let We=er;const Fe={slots:{transition:Xe,...ze},slotProps:{transition:tr,paper:qe,...Ve}},[Ze,ir]=useSlot("transition",{elementType:Grow,externalForwardedProps:Fe,ownerState:ar,getSlotProps:$r=>({...$r,onEntering:(Fr,Ir)=>{var zr;(zr=$r.onEntering)==null||zr.call($r,Fr,Ir),Ye()},onExited:Fr=>{var Ir;(Ir=$r.onExited)==null||Ir.call($r,Fr),St()}}),additionalProps:{appear:!0,in:Ue}});er==="auto"&&!Ze.muiSupportAuto&&(We=void 0);const ur=ke||(Ce?ownerDocument(resolveAnchorEl$1(Ce)).body:void 0),[fr,{slots:Ar,slotProps:vr,...xr}]=useSlot("root",{ref:xe,elementType:PopoverRoot,externalForwardedProps:{...Fe,...sr},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:ze.backdrop},slotProps:{backdrop:mergeSlotProps(typeof Ve.backdrop=="function"?Ve.backdrop(ar):Ve.backdrop,{invisible:!0})},container:ur,open:Ue},ownerState:ar,className:clsx(lr.root,Pe)}),[br,_r]=useSlot("paper",{ref:dr,className:lr.paper,elementType:PopoverPaper,externalForwardedProps:Fe,shouldForwardComponentProp:!0,additionalProps:{elevation:$e,style:De?void 0:{opacity:0}},ownerState:ar});return jsxRuntimeExports.jsx(fr,{...xr,...!isHostComponent(fr)&&{slots:Ar,slotProps:vr,disableScrollLock:nr},children:jsxRuntimeExports.jsx(Ze,{...ir,timeout:We,children:jsxRuntimeExports.jsx(br,{..._r,children:Te})})})});function getMenuUtilityClass(t){return generateUtilityClass("MuiMenu",t)}generateUtilityClasses("MuiMenu",["root","paper","list"]);const RTL_ORIGIN={vertical:"top",horizontal:"right"},LTR_ORIGIN={vertical:"top",horizontal:"left"},useUtilityClasses$1N=t=>{const{classes:Ae}=t;return composeClasses({root:["root"],paper:["paper"],list:["list"]},getMenuUtilityClass,Ae)},MenuRoot=styled(Popover,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({}),MenuPaper=styled(PopoverPaper,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,Ae)=>Ae.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MenuMenuList=styled(MenuList,{name:"MuiMenu",slot:"List",overridesResolver:(t,Ae)=>Ae.list})({outline:0}),Menu=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiMenu"}),{autoFocus:Se=!0,children:Ce,className:_e,disableAutoFocusItem:Ie=!1,MenuListProps:Be={},onClose:Te,open:Pe,PaperProps:ke={},PopoverClasses:$e,transitionDuration:Oe="auto",TransitionProps:{onEntering:Ue,...qe}={},variant:ze="selectedMenu",slots:Ve={},slotProps:Ge={},...Xe}=Ee,er=useRtl(),tr={...Ee,autoFocus:Se,disableAutoFocusItem:Ie,MenuListProps:Be,onEntering:Ue,PaperProps:ke,transitionDuration:Oe,TransitionProps:qe,variant:ze},nr=useUtilityClasses$1N(tr),sr=Se&&!Ie&&Pe,dr=reactExports.useRef(null),ar=(We,Fe)=>{dr.current&&dr.current.adjustStyleForScrollbar(We,{direction:er?"rtl":"ltr"}),Ue&&Ue(We,Fe)},lr=We=>{We.key==="Tab"&&(We.preventDefault(),Te&&Te(We,"tabKeyDown"))};let Ke=-1;reactExports.Children.map(Ce,(We,Fe)=>{reactExports.isValidElement(We)&&(We.props.disabled||(ze==="selectedMenu"&&We.props.selected||Ke===-1)&&(Ke=Fe))});const Me={slots:Ve,slotProps:{list:Be,transition:qe,paper:ke,...Ge}},je=useSlotProps({elementType:Ve.root,externalSlotProps:Ge.root,ownerState:tr,className:[nr.root,_e]}),[De,He]=useSlot("paper",{className:nr.paper,elementType:MenuPaper,externalForwardedProps:Me,shouldForwardComponentProp:!0,ownerState:tr}),[Qe,Ye]=useSlot("list",{className:clsx(nr.list,Be.className),elementType:MenuMenuList,shouldForwardComponentProp:!0,externalForwardedProps:Me,getSlotProps:We=>({...We,onKeyDown:Fe=>{var Ze;lr(Fe),(Ze=We.onKeyDown)==null||Ze.call(We,Fe)}}),ownerState:tr}),St=typeof Me.slotProps.transition=="function"?Me.slotProps.transition(tr):Me.slotProps.transition;return jsxRuntimeExports.jsx(MenuRoot,{onClose:Te,anchorOrigin:{vertical:"bottom",horizontal:er?"right":"left"},transformOrigin:er?RTL_ORIGIN:LTR_ORIGIN,slots:{root:Ve.root,paper:De,backdrop:Ve.backdrop,...Ve.transition&&{transition:Ve.transition}},slotProps:{root:je,paper:He,backdrop:typeof Ge.backdrop=="function"?Ge.backdrop(tr):Ge.backdrop,transition:{...St,onEntering:(...We)=>{var Fe;ar(...We),(Fe=St==null?void 0:St.onEntering)==null||Fe.call(St,...We)}}},open:Pe,ref:xe,transitionDuration:Oe,ownerState:tr,...Xe,classes:$e,children:jsxRuntimeExports.jsx(Qe,{actions:dr,autoFocus:Se&&(Ke===-1||Ie),autoFocusItem:sr,variant:ze,...Ye,children:Ce})})});function getDividerUtilityClass(t){return generateUtilityClass("MuiDivider",t)}const dividerClasses=generateUtilityClasses("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),useUtilityClasses$1M=t=>{const{absolute:Ae,children:xe,classes:Ee,flexItem:Se,light:Ce,orientation:_e,textAlign:Ie,variant:Be}=t;return composeClasses({root:["root",Ae&&"absolute",Be,Ce&&"light",_e==="vertical"&&"vertical",Se&&"flexItem",xe&&"withChildren",xe&&_e==="vertical"&&"withChildrenVertical",Ie==="right"&&_e!=="vertical"&&"textAlignRight",Ie==="left"&&_e!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",_e==="vertical"&&"wrapperVertical"]},getDividerUtilityClass,Ee)},DividerRoot=styled("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.absolute&&Ae.absolute,Ae[xe.variant],xe.light&&Ae.light,xe.orientation==="vertical"&&Ae.vertical,xe.flexItem&&Ae.flexItem,xe.children&&Ae.withChildren,xe.children&&xe.orientation==="vertical"&&Ae.withChildrenVertical,xe.textAlign==="right"&&xe.orientation!=="vertical"&&Ae.textAlignRight,xe.textAlign==="left"&&xe.orientation!=="vertical"&&Ae.textAlignLeft]}})(memoTheme(({theme:t})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:alpha$3(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:Ae})=>!!Ae.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:Ae})=>Ae.children&&Ae.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:Ae})=>Ae.orientation==="vertical"&&Ae.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:Ae})=>Ae.textAlign==="right"&&Ae.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:Ae})=>Ae.textAlign==="left"&&Ae.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),DividerWrapper=styled("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.wrapper,xe.orientation==="vertical"&&Ae.wrapperVertical]}})(memoTheme(({theme:t})=>({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}))),Divider=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiDivider"}),{absolute:Se=!1,children:Ce,className:_e,orientation:Ie="horizontal",component:Be=Ce||Ie==="vertical"?"div":"hr",flexItem:Te=!1,light:Pe=!1,role:ke=Be!=="hr"?"separator":void 0,textAlign:$e="center",variant:Oe="fullWidth",...Ue}=Ee,qe={...Ee,absolute:Se,component:Be,flexItem:Te,light:Pe,orientation:Ie,role:ke,textAlign:$e,variant:Oe},ze=useUtilityClasses$1M(qe);return jsxRuntimeExports.jsx(DividerRoot,{as:Be,className:clsx(ze.root,_e),role:ke,ref:xe,ownerState:qe,"aria-orientation":ke==="separator"&&(Be!=="hr"||Ie==="vertical")?Ie:void 0,...Ue,children:Ce?jsxRuntimeExports.jsx(DividerWrapper,{className:ze.wrapper,ownerState:qe,children:Ce}):null})});Divider&&(Divider.muiSkipListHighlight=!0);function getListItemIconUtilityClass(t){return generateUtilityClass("MuiListItemIcon",t)}const listItemIconClasses=generateUtilityClasses("MuiListItemIcon",["root","alignItemsFlexStart"]),useUtilityClasses$1L=t=>{const{alignItems:Ae,classes:xe}=t;return composeClasses({root:["root",Ae==="flex-start"&&"alignItemsFlexStart"]},getListItemIconUtilityClass,xe)},ListItemIconRoot=styled("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.alignItems==="flex-start"&&Ae.alignItemsFlexStart]}})(memoTheme(({theme:t})=>({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),ListItemIcon=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiListItemIcon"}),{className:Se,...Ce}=Ee,_e=reactExports.useContext(ListContext),Ie={...Ee,alignItems:_e.alignItems},Be=useUtilityClasses$1L(Ie);return jsxRuntimeExports.jsx(ListItemIconRoot,{className:clsx(Be.root,Se),ownerState:Ie,ref:xe,...Ce})});function getTypographyUtilityClass(t){return generateUtilityClass("MuiTypography",t)}const typographyClasses=generateUtilityClasses("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),v6Colors$1={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},extendSxProp=internal_createExtendSxProp(),useUtilityClasses$1K=t=>{const{align:Ae,gutterBottom:xe,noWrap:Ee,paragraph:Se,variant:Ce,classes:_e}=t,Ie={root:["root",Ce,t.align!=="inherit"&&`align${capitalize$1(Ae)}`,xe&&"gutterBottom",Ee&&"noWrap",Se&&"paragraph"]};return composeClasses(Ie,getTypographyUtilityClass,_e)},TypographyRoot=styled("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.variant&&Ae[xe.variant],xe.align!=="inherit"&&Ae[`align${capitalize$1(xe.align)}`],xe.noWrap&&Ae.noWrap,xe.gutterBottom&&Ae.gutterBottom,xe.paragraph&&Ae.paragraph]}})(memoTheme(({theme:t})=>{var Ae;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([xe,Ee])=>xe!=="inherit"&&Ee&&typeof Ee=="object").map(([xe,Ee])=>({props:{variant:xe},style:Ee})),...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([xe])=>({props:{color:xe},style:{color:(t.vars||t).palette[xe].main}})),...Object.entries(((Ae=t.palette)==null?void 0:Ae.text)||{}).filter(([,xe])=>typeof xe=="string").map(([xe])=>({props:{color:`text${capitalize$1(xe)}`},style:{color:(t.vars||t).palette.text[xe]}})),{props:({ownerState:xe})=>xe.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:xe})=>xe.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:xe})=>xe.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:xe})=>xe.paragraph,style:{marginBottom:16}}]}})),defaultVariantMapping={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Typography=reactExports.forwardRef(function(Ae,xe){const{color:Ee,...Se}=useDefaultProps({props:Ae,name:"MuiTypography"}),Ce=!v6Colors$1[Ee],_e=extendSxProp({...Se,...Ce&&{color:Ee}}),{align:Ie="inherit",className:Be,component:Te,gutterBottom:Pe=!1,noWrap:ke=!1,paragraph:$e=!1,variant:Oe="body1",variantMapping:Ue=defaultVariantMapping,...qe}=_e,ze={..._e,align:Ie,color:Ee,className:Be,component:Te,gutterBottom:Pe,noWrap:ke,paragraph:$e,variant:Oe,variantMapping:Ue},Ve=Te||($e?"p":Ue[Oe]||defaultVariantMapping[Oe])||"span",Ge=useUtilityClasses$1K(ze);return jsxRuntimeExports.jsx(TypographyRoot,{as:Ve,ref:xe,className:clsx(Ge.root,Be),...qe,ownerState:ze,style:{...Ie!=="inherit"&&{"--Typography-textAlign":Ie},...qe.style}})});function getListItemTextUtilityClass(t){return generateUtilityClass("MuiListItemText",t)}const listItemTextClasses=generateUtilityClasses("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),useUtilityClasses$1J=t=>{const{classes:Ae,inset:xe,primary:Ee,secondary:Se,dense:Ce}=t;return composeClasses({root:["root",xe&&"inset",Ce&&"dense",Ee&&Se&&"multiline"],primary:["primary"],secondary:["secondary"]},getListItemTextUtilityClass,Ae)},ListItemTextRoot=styled("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`& .${listItemTextClasses.primary}`]:Ae.primary},{[`& .${listItemTextClasses.secondary}`]:Ae.secondary},Ae.root,xe.inset&&Ae.inset,xe.primary&&xe.secondary&&Ae.multiline,xe.dense&&Ae.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${typographyClasses.root}:where(& .${listItemTextClasses.primary})`]:{display:"block"},[`.${typographyClasses.root}:where(& .${listItemTextClasses.secondary})`]:{display:"block"},variants:[{props:({ownerState:t})=>t.primary&&t.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:56}}]}),ListItemText=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiListItemText"}),{children:Se,className:Ce,disableTypography:_e=!1,inset:Ie=!1,primary:Be,primaryTypographyProps:Te,secondary:Pe,secondaryTypographyProps:ke,slots:$e={},slotProps:Oe={},...Ue}=Ee,{dense:qe}=reactExports.useContext(ListContext);let ze=Be??Se,Ve=Pe;const Ge={...Ee,disableTypography:_e,inset:Ie,primary:!!ze,secondary:!!Ve,dense:qe},Xe=useUtilityClasses$1J(Ge),er={slots:$e,slotProps:{primary:Te,secondary:ke,...Oe}},[tr,nr]=useSlot("primary",{className:Xe.primary,elementType:Typography,externalForwardedProps:er,ownerState:Ge}),[sr,dr]=useSlot("secondary",{className:Xe.secondary,elementType:Typography,externalForwardedProps:er,ownerState:Ge});return ze!=null&&ze.type!==Typography&&!_e&&(ze=jsxRuntimeExports.jsx(tr,{variant:qe?"body2":"body1",component:nr!=null&&nr.variant?void 0:"span",...nr,children:ze})),Ve!=null&&Ve.type!==Typography&&!_e&&(Ve=jsxRuntimeExports.jsx(sr,{variant:"body2",color:"textSecondary",...dr,children:Ve})),jsxRuntimeExports.jsxs(ListItemTextRoot,{className:clsx(Xe.root,Ce),ownerState:Ge,ref:xe,...Ue,children:[ze,Ve]})});function getMenuItemUtilityClass(t){return generateUtilityClass("MuiMenuItem",t)}const menuItemClasses=generateUtilityClasses("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),overridesResolver$5=(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.dense&&Ae.dense,xe.divider&&Ae.divider,!xe.disableGutters&&Ae.gutters]},useUtilityClasses$1I=t=>{const{disabled:Ae,dense:xe,divider:Ee,disableGutters:Se,selected:Ce,classes:_e}=t,Be=composeClasses({root:["root",xe&&"dense",Ae&&"disabled",!Se&&"gutters",Ee&&"divider",Ce&&"selected"]},getMenuItemUtilityClass,_e);return{..._e,...Be}},MenuItemRoot=styled(ButtonBase,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:overridesResolver$5})(memoTheme(({theme:t})=>({...t.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${menuItemClasses.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${menuItemClasses.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${menuItemClasses.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${menuItemClasses.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${menuItemClasses.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${dividerClasses.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${dividerClasses.inset}`]:{marginLeft:52},[`& .${listItemTextClasses.root}`]:{marginTop:0,marginBottom:0},[`& .${listItemTextClasses.inset}`]:{paddingLeft:36},[`& .${listItemIconClasses.root}`]:{minWidth:36},variants:[{props:({ownerState:Ae})=>!Ae.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:Ae})=>Ae.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:Ae})=>!Ae.dense,style:{[t.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:Ae})=>Ae.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...t.typography.body2,[`& .${listItemIconClasses.root} svg`]:{fontSize:"1.25rem"}}}]}))),MenuItem=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiMenuItem"}),{autoFocus:Se=!1,component:Ce="li",dense:_e=!1,divider:Ie=!1,disableGutters:Be=!1,focusVisibleClassName:Te,role:Pe="menuitem",tabIndex:ke,className:$e,...Oe}=Ee,Ue=reactExports.useContext(ListContext),qe=reactExports.useMemo(()=>({dense:_e||Ue.dense||!1,disableGutters:Be}),[Ue.dense,_e,Be]),ze=reactExports.useRef(null);useEnhancedEffect(()=>{Se&&ze.current&&ze.current.focus()},[Se]);const Ve={...Ee,dense:qe.dense,divider:Ie,disableGutters:Be},Ge=useUtilityClasses$1I(Ee),Xe=useForkRef(ze,xe);let er;return Ee.disabled||(er=ke!==void 0?ke:-1),jsxRuntimeExports.jsx(ListContext.Provider,{value:qe,children:jsxRuntimeExports.jsx(MenuItemRoot,{ref:Xe,role:Pe,tabIndex:er,component:Ce,focusVisibleClassName:clsx(Ge.focusVisible,Te),className:clsx(Ge.root,$e),...Oe,ownerState:Ve,classes:Ge})})});function getToolbarUtilityClass(t){return generateUtilityClass("MuiToolbar",t)}generateUtilityClasses("MuiToolbar",["root","gutters","regular","dense"]);const useUtilityClasses$1H=t=>{const{classes:Ae,disableGutters:xe,variant:Ee}=t;return composeClasses({root:["root",!xe&&"gutters",Ee]},getToolbarUtilityClass,Ae)},ToolbarRoot=styled("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,!xe.disableGutters&&Ae.gutters,Ae[xe.variant]]}})(memoTheme(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:Ae})=>!Ae.disableGutters,style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}))),Toolbar=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiToolbar"}),{className:Se,component:Ce="div",disableGutters:_e=!1,variant:Ie="regular",...Be}=Ee,Te={...Ee,component:Ce,disableGutters:_e,variant:Ie},Pe=useUtilityClasses$1H(Te);return jsxRuntimeExports.jsx(ToolbarRoot,{as:Ce,className:clsx(Pe.root,Se),ref:xe,ownerState:Te,...Be})});var top$1="top",bottom$1="bottom",right="right",left="left",auto="auto",basePlacements=[top$1,bottom$1,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(t,Ae){return t.concat([Ae+"-"+start,Ae+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(t,Ae){return t.concat([Ae,Ae+"-"+start,Ae+"-"+end])},[]),beforeRead="beforeRead",read$2="read",afterRead="afterRead",beforeMain="beforeMain",main$1="main",afterMain="afterMain",beforeWrite="beforeWrite",write$2="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read$2,afterRead,beforeMain,main$1,afterMain,beforeWrite,write$2,afterWrite];function getNodeName(t){return t?(t.nodeName||"").toLowerCase():null}function getWindow(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var Ae=t.ownerDocument;return Ae&&Ae.defaultView||window}return t}function isElement(t){var Ae=getWindow(t).Element;return t instanceof Ae||t instanceof Element}function isHTMLElement$2(t){var Ae=getWindow(t).HTMLElement;return t instanceof Ae||t instanceof HTMLElement}function isShadowRoot(t){if(typeof ShadowRoot>"u")return!1;var Ae=getWindow(t).ShadowRoot;return t instanceof Ae||t instanceof ShadowRoot}function applyStyles(t){var Ae=t.state;Object.keys(Ae.elements).forEach(function(xe){var Ee=Ae.styles[xe]||{},Se=Ae.attributes[xe]||{},Ce=Ae.elements[xe];!isHTMLElement$2(Ce)||!getNodeName(Ce)||(Object.assign(Ce.style,Ee),Object.keys(Se).forEach(function(_e){var Ie=Se[_e];Ie===!1?Ce.removeAttribute(_e):Ce.setAttribute(_e,Ie===!0?"":Ie)}))})}function effect$2(t){var Ae=t.state,xe={popper:{position:Ae.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(Ae.elements.popper.style,xe.popper),Ae.styles=xe,Ae.elements.arrow&&Object.assign(Ae.elements.arrow.style,xe.arrow),function(){Object.keys(Ae.elements).forEach(function(Ee){var Se=Ae.elements[Ee],Ce=Ae.attributes[Ee]||{},_e=Object.keys(Ae.styles.hasOwnProperty(Ee)?Ae.styles[Ee]:xe[Ee]),Ie=_e.reduce(function(Be,Te){return Be[Te]="",Be},{});!isHTMLElement$2(Se)||!getNodeName(Se)||(Object.assign(Se.style,Ie),Object.keys(Ce).forEach(function(Be){Se.removeAttribute(Be)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(t){return t.split("-")[0]}var max$4=Math.max,min$4=Math.min,round$4=Math.round;function getUAString(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(Ae){return Ae.brand+"/"+Ae.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(t,Ae,xe){Ae===void 0&&(Ae=!1),xe===void 0&&(xe=!1);var Ee=t.getBoundingClientRect(),Se=1,Ce=1;Ae&&isHTMLElement$2(t)&&(Se=t.offsetWidth>0&&round$4(Ee.width)/t.offsetWidth||1,Ce=t.offsetHeight>0&&round$4(Ee.height)/t.offsetHeight||1);var _e=isElement(t)?getWindow(t):window,Ie=_e.visualViewport,Be=!isLayoutViewport()&&xe,Te=(Ee.left+(Be&&Ie?Ie.offsetLeft:0))/Se,Pe=(Ee.top+(Be&&Ie?Ie.offsetTop:0))/Ce,ke=Ee.width/Se,$e=Ee.height/Ce;return{width:ke,height:$e,top:Pe,right:Te+ke,bottom:Pe+$e,left:Te,x:Te,y:Pe}}function getLayoutRect(t){var Ae=getBoundingClientRect(t),xe=t.offsetWidth,Ee=t.offsetHeight;return Math.abs(Ae.width-xe)<=1&&(xe=Ae.width),Math.abs(Ae.height-Ee)<=1&&(Ee=Ae.height),{x:t.offsetLeft,y:t.offsetTop,width:xe,height:Ee}}function contains$1(t,Ae){var xe=Ae.getRootNode&&Ae.getRootNode();if(t.contains(Ae))return!0;if(xe&&isShadowRoot(xe)){var Ee=Ae;do{if(Ee&&t.isSameNode(Ee))return!0;Ee=Ee.parentNode||Ee.host}while(Ee)}return!1}function getComputedStyle$2(t){return getWindow(t).getComputedStyle(t)}function isTableElement(t){return["table","td","th"].indexOf(getNodeName(t))>=0}function getDocumentElement(t){return((isElement(t)?t.ownerDocument:t.document)||window.document).documentElement}function getParentNode(t){return getNodeName(t)==="html"?t:t.assignedSlot||t.parentNode||(isShadowRoot(t)?t.host:null)||getDocumentElement(t)}function getTrueOffsetParent(t){return!isHTMLElement$2(t)||getComputedStyle$2(t).position==="fixed"?null:t.offsetParent}function getContainingBlock(t){var Ae=/firefox/i.test(getUAString()),xe=/Trident/i.test(getUAString());if(xe&&isHTMLElement$2(t)){var Ee=getComputedStyle$2(t);if(Ee.position==="fixed")return null}var Se=getParentNode(t);for(isShadowRoot(Se)&&(Se=Se.host);isHTMLElement$2(Se)&&["html","body"].indexOf(getNodeName(Se))<0;){var Ce=getComputedStyle$2(Se);if(Ce.transform!=="none"||Ce.perspective!=="none"||Ce.contain==="paint"||["transform","perspective"].indexOf(Ce.willChange)!==-1||Ae&&Ce.willChange==="filter"||Ae&&Ce.filter&&Ce.filter!=="none")return Se;Se=Se.parentNode}return null}function getOffsetParent(t){for(var Ae=getWindow(t),xe=getTrueOffsetParent(t);xe&&isTableElement(xe)&&getComputedStyle$2(xe).position==="static";)xe=getTrueOffsetParent(xe);return xe&&(getNodeName(xe)==="html"||getNodeName(xe)==="body"&&getComputedStyle$2(xe).position==="static")?Ae:xe||getContainingBlock(t)||Ae}function getMainAxisFromPlacement(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function within(t,Ae,xe){return max$4(t,min$4(Ae,xe))}function withinMaxClamp(t,Ae,xe){var Ee=within(t,Ae,xe);return Ee>xe?xe:Ee}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(t){return Object.assign({},getFreshSideObject(),t)}function expandToHashMap(t,Ae){return Ae.reduce(function(xe,Ee){return xe[Ee]=t,xe},{})}var toPaddingObject=function(Ae,xe){return Ae=typeof Ae=="function"?Ae(Object.assign({},xe.rects,{placement:xe.placement})):Ae,mergePaddingObject(typeof Ae!="number"?Ae:expandToHashMap(Ae,basePlacements))};function arrow(t){var Ae,xe=t.state,Ee=t.name,Se=t.options,Ce=xe.elements.arrow,_e=xe.modifiersData.popperOffsets,Ie=getBasePlacement(xe.placement),Be=getMainAxisFromPlacement(Ie),Te=[left,right].indexOf(Ie)>=0,Pe=Te?"height":"width";if(!(!Ce||!_e)){var ke=toPaddingObject(Se.padding,xe),$e=getLayoutRect(Ce),Oe=Be==="y"?top$1:left,Ue=Be==="y"?bottom$1:right,qe=xe.rects.reference[Pe]+xe.rects.reference[Be]-_e[Be]-xe.rects.popper[Pe],ze=_e[Be]-xe.rects.reference[Be],Ve=getOffsetParent(Ce),Ge=Ve?Be==="y"?Ve.clientHeight||0:Ve.clientWidth||0:0,Xe=qe/2-ze/2,er=ke[Oe],tr=Ge-$e[Pe]-ke[Ue],nr=Ge/2-$e[Pe]/2+Xe,sr=within(er,nr,tr),dr=Be;xe.modifiersData[Ee]=(Ae={},Ae[dr]=sr,Ae.centerOffset=sr-nr,Ae)}}function effect$1(t){var Ae=t.state,xe=t.options,Ee=xe.element,Se=Ee===void 0?"[data-popper-arrow]":Ee;Se!=null&&(typeof Se=="string"&&(Se=Ae.elements.popper.querySelector(Se),!Se)||contains$1(Ae.elements.popper,Se)&&(Ae.elements.arrow=Se))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(t){return t.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(t,Ae){var xe=t.x,Ee=t.y,Se=Ae.devicePixelRatio||1;return{x:round$4(xe*Se)/Se||0,y:round$4(Ee*Se)/Se||0}}function mapToStyles(t){var Ae,xe=t.popper,Ee=t.popperRect,Se=t.placement,Ce=t.variation,_e=t.offsets,Ie=t.position,Be=t.gpuAcceleration,Te=t.adaptive,Pe=t.roundOffsets,ke=t.isFixed,$e=_e.x,Oe=$e===void 0?0:$e,Ue=_e.y,qe=Ue===void 0?0:Ue,ze=typeof Pe=="function"?Pe({x:Oe,y:qe}):{x:Oe,y:qe};Oe=ze.x,qe=ze.y;var Ve=_e.hasOwnProperty("x"),Ge=_e.hasOwnProperty("y"),Xe=left,er=top$1,tr=window;if(Te){var nr=getOffsetParent(xe),sr="clientHeight",dr="clientWidth";if(nr===getWindow(xe)&&(nr=getDocumentElement(xe),getComputedStyle$2(nr).position!=="static"&&Ie==="absolute"&&(sr="scrollHeight",dr="scrollWidth")),nr=nr,Se===top$1||(Se===left||Se===right)&&Ce===end){er=bottom$1;var ar=ke&&nr===tr&&tr.visualViewport?tr.visualViewport.height:nr[sr];qe-=ar-Ee.height,qe*=Be?1:-1}if(Se===left||(Se===top$1||Se===bottom$1)&&Ce===end){Xe=right;var lr=ke&&nr===tr&&tr.visualViewport?tr.visualViewport.width:nr[dr];Oe-=lr-Ee.width,Oe*=Be?1:-1}}var Ke=Object.assign({position:Ie},Te&&unsetSides),Me=Pe===!0?roundOffsetsByDPR({x:Oe,y:qe},getWindow(xe)):{x:Oe,y:qe};if(Oe=Me.x,qe=Me.y,Be){var je;return Object.assign({},Ke,(je={},je[er]=Ge?"0":"",je[Xe]=Ve?"0":"",je.transform=(tr.devicePixelRatio||1)<=1?"translate("+Oe+"px, "+qe+"px)":"translate3d("+Oe+"px, "+qe+"px, 0)",je))}return Object.assign({},Ke,(Ae={},Ae[er]=Ge?qe+"px":"",Ae[Xe]=Ve?Oe+"px":"",Ae.transform="",Ae))}function computeStyles(t){var Ae=t.state,xe=t.options,Ee=xe.gpuAcceleration,Se=Ee===void 0?!0:Ee,Ce=xe.adaptive,_e=Ce===void 0?!0:Ce,Ie=xe.roundOffsets,Be=Ie===void 0?!0:Ie,Te={placement:getBasePlacement(Ae.placement),variation:getVariation(Ae.placement),popper:Ae.elements.popper,popperRect:Ae.rects.popper,gpuAcceleration:Se,isFixed:Ae.options.strategy==="fixed"};Ae.modifiersData.popperOffsets!=null&&(Ae.styles.popper=Object.assign({},Ae.styles.popper,mapToStyles(Object.assign({},Te,{offsets:Ae.modifiersData.popperOffsets,position:Ae.options.strategy,adaptive:_e,roundOffsets:Be})))),Ae.modifiersData.arrow!=null&&(Ae.styles.arrow=Object.assign({},Ae.styles.arrow,mapToStyles(Object.assign({},Te,{offsets:Ae.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:Be})))),Ae.attributes.popper=Object.assign({},Ae.attributes.popper,{"data-popper-placement":Ae.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(t){var Ae=t.state,xe=t.instance,Ee=t.options,Se=Ee.scroll,Ce=Se===void 0?!0:Se,_e=Ee.resize,Ie=_e===void 0?!0:_e,Be=getWindow(Ae.elements.popper),Te=[].concat(Ae.scrollParents.reference,Ae.scrollParents.popper);return Ce&&Te.forEach(function(Pe){Pe.addEventListener("scroll",xe.update,passive)}),Ie&&Be.addEventListener("resize",xe.update,passive),function(){Ce&&Te.forEach(function(Pe){Pe.removeEventListener("scroll",xe.update,passive)}),Ie&&Be.removeEventListener("resize",xe.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$3={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(t){return t.replace(/left|right|bottom|top/g,function(Ae){return hash$3[Ae]})}var hash$2={start:"end",end:"start"};function getOppositeVariationPlacement(t){return t.replace(/start|end/g,function(Ae){return hash$2[Ae]})}function getWindowScroll(t){var Ae=getWindow(t),xe=Ae.pageXOffset,Ee=Ae.pageYOffset;return{scrollLeft:xe,scrollTop:Ee}}function getWindowScrollBarX(t){return getBoundingClientRect(getDocumentElement(t)).left+getWindowScroll(t).scrollLeft}function getViewportRect(t,Ae){var xe=getWindow(t),Ee=getDocumentElement(t),Se=xe.visualViewport,Ce=Ee.clientWidth,_e=Ee.clientHeight,Ie=0,Be=0;if(Se){Ce=Se.width,_e=Se.height;var Te=isLayoutViewport();(Te||!Te&&Ae==="fixed")&&(Ie=Se.offsetLeft,Be=Se.offsetTop)}return{width:Ce,height:_e,x:Ie+getWindowScrollBarX(t),y:Be}}function getDocumentRect(t){var Ae,xe=getDocumentElement(t),Ee=getWindowScroll(t),Se=(Ae=t.ownerDocument)==null?void 0:Ae.body,Ce=max$4(xe.scrollWidth,xe.clientWidth,Se?Se.scrollWidth:0,Se?Se.clientWidth:0),_e=max$4(xe.scrollHeight,xe.clientHeight,Se?Se.scrollHeight:0,Se?Se.clientHeight:0),Ie=-Ee.scrollLeft+getWindowScrollBarX(t),Be=-Ee.scrollTop;return getComputedStyle$2(Se||xe).direction==="rtl"&&(Ie+=max$4(xe.clientWidth,Se?Se.clientWidth:0)-Ce),{width:Ce,height:_e,x:Ie,y:Be}}function isScrollParent(t){var Ae=getComputedStyle$2(t),xe=Ae.overflow,Ee=Ae.overflowX,Se=Ae.overflowY;return/auto|scroll|overlay|hidden/.test(xe+Se+Ee)}function getScrollParent(t){return["html","body","#document"].indexOf(getNodeName(t))>=0?t.ownerDocument.body:isHTMLElement$2(t)&&isScrollParent(t)?t:getScrollParent(getParentNode(t))}function listScrollParents(t,Ae){var xe;Ae===void 0&&(Ae=[]);var Ee=getScrollParent(t),Se=Ee===((xe=t.ownerDocument)==null?void 0:xe.body),Ce=getWindow(Ee),_e=Se?[Ce].concat(Ce.visualViewport||[],isScrollParent(Ee)?Ee:[]):Ee,Ie=Ae.concat(_e);return Se?Ie:Ie.concat(listScrollParents(getParentNode(_e)))}function rectToClientRect(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function getInnerBoundingClientRect(t,Ae){var xe=getBoundingClientRect(t,!1,Ae==="fixed");return xe.top=xe.top+t.clientTop,xe.left=xe.left+t.clientLeft,xe.bottom=xe.top+t.clientHeight,xe.right=xe.left+t.clientWidth,xe.width=t.clientWidth,xe.height=t.clientHeight,xe.x=xe.left,xe.y=xe.top,xe}function getClientRectFromMixedType(t,Ae,xe){return Ae===viewport?rectToClientRect(getViewportRect(t,xe)):isElement(Ae)?getInnerBoundingClientRect(Ae,xe):rectToClientRect(getDocumentRect(getDocumentElement(t)))}function getClippingParents(t){var Ae=listScrollParents(getParentNode(t)),xe=["absolute","fixed"].indexOf(getComputedStyle$2(t).position)>=0,Ee=xe&&isHTMLElement$2(t)?getOffsetParent(t):t;return isElement(Ee)?Ae.filter(function(Se){return isElement(Se)&&contains$1(Se,Ee)&&getNodeName(Se)!=="body"}):[]}function getClippingRect(t,Ae,xe,Ee){var Se=Ae==="clippingParents"?getClippingParents(t):[].concat(Ae),Ce=[].concat(Se,[xe]),_e=Ce[0],Ie=Ce.reduce(function(Be,Te){var Pe=getClientRectFromMixedType(t,Te,Ee);return Be.top=max$4(Pe.top,Be.top),Be.right=min$4(Pe.right,Be.right),Be.bottom=min$4(Pe.bottom,Be.bottom),Be.left=max$4(Pe.left,Be.left),Be},getClientRectFromMixedType(t,_e,Ee));return Ie.width=Ie.right-Ie.left,Ie.height=Ie.bottom-Ie.top,Ie.x=Ie.left,Ie.y=Ie.top,Ie}function computeOffsets(t){var Ae=t.reference,xe=t.element,Ee=t.placement,Se=Ee?getBasePlacement(Ee):null,Ce=Ee?getVariation(Ee):null,_e=Ae.x+Ae.width/2-xe.width/2,Ie=Ae.y+Ae.height/2-xe.height/2,Be;switch(Se){case top$1:Be={x:_e,y:Ae.y-xe.height};break;case bottom$1:Be={x:_e,y:Ae.y+Ae.height};break;case right:Be={x:Ae.x+Ae.width,y:Ie};break;case left:Be={x:Ae.x-xe.width,y:Ie};break;default:Be={x:Ae.x,y:Ae.y}}var Te=Se?getMainAxisFromPlacement(Se):null;if(Te!=null){var Pe=Te==="y"?"height":"width";switch(Ce){case start:Be[Te]=Be[Te]-(Ae[Pe]/2-xe[Pe]/2);break;case end:Be[Te]=Be[Te]+(Ae[Pe]/2-xe[Pe]/2);break}}return Be}function detectOverflow(t,Ae){Ae===void 0&&(Ae={});var xe=Ae,Ee=xe.placement,Se=Ee===void 0?t.placement:Ee,Ce=xe.strategy,_e=Ce===void 0?t.strategy:Ce,Ie=xe.boundary,Be=Ie===void 0?clippingParents:Ie,Te=xe.rootBoundary,Pe=Te===void 0?viewport:Te,ke=xe.elementContext,$e=ke===void 0?popper:ke,Oe=xe.altBoundary,Ue=Oe===void 0?!1:Oe,qe=xe.padding,ze=qe===void 0?0:qe,Ve=mergePaddingObject(typeof ze!="number"?ze:expandToHashMap(ze,basePlacements)),Ge=$e===popper?reference:popper,Xe=t.rects.popper,er=t.elements[Ue?Ge:$e],tr=getClippingRect(isElement(er)?er:er.contextElement||getDocumentElement(t.elements.popper),Be,Pe,_e),nr=getBoundingClientRect(t.elements.reference),sr=computeOffsets({reference:nr,element:Xe,placement:Se}),dr=rectToClientRect(Object.assign({},Xe,sr)),ar=$e===popper?dr:nr,lr={top:tr.top-ar.top+Ve.top,bottom:ar.bottom-tr.bottom+Ve.bottom,left:tr.left-ar.left+Ve.left,right:ar.right-tr.right+Ve.right},Ke=t.modifiersData.offset;if($e===popper&&Ke){var Me=Ke[Se];Object.keys(lr).forEach(function(je){var De=[right,bottom$1].indexOf(je)>=0?1:-1,He=[top$1,bottom$1].indexOf(je)>=0?"y":"x";lr[je]+=Me[He]*De})}return lr}function computeAutoPlacement(t,Ae){Ae===void 0&&(Ae={});var xe=Ae,Ee=xe.placement,Se=xe.boundary,Ce=xe.rootBoundary,_e=xe.padding,Ie=xe.flipVariations,Be=xe.allowedAutoPlacements,Te=Be===void 0?placements:Be,Pe=getVariation(Ee),ke=Pe?Ie?variationPlacements:variationPlacements.filter(function(Ue){return getVariation(Ue)===Pe}):basePlacements,$e=ke.filter(function(Ue){return Te.indexOf(Ue)>=0});$e.length===0&&($e=ke);var Oe=$e.reduce(function(Ue,qe){return Ue[qe]=detectOverflow(t,{placement:qe,boundary:Se,rootBoundary:Ce,padding:_e})[getBasePlacement(qe)],Ue},{});return Object.keys(Oe).sort(function(Ue,qe){return Oe[Ue]-Oe[qe]})}function getExpandedFallbackPlacements(t){if(getBasePlacement(t)===auto)return[];var Ae=getOppositePlacement(t);return[getOppositeVariationPlacement(t),Ae,getOppositeVariationPlacement(Ae)]}function flip(t){var Ae=t.state,xe=t.options,Ee=t.name;if(!Ae.modifiersData[Ee]._skip){for(var Se=xe.mainAxis,Ce=Se===void 0?!0:Se,_e=xe.altAxis,Ie=_e===void 0?!0:_e,Be=xe.fallbackPlacements,Te=xe.padding,Pe=xe.boundary,ke=xe.rootBoundary,$e=xe.altBoundary,Oe=xe.flipVariations,Ue=Oe===void 0?!0:Oe,qe=xe.allowedAutoPlacements,ze=Ae.options.placement,Ve=getBasePlacement(ze),Ge=Ve===ze,Xe=Be||(Ge||!Ue?[getOppositePlacement(ze)]:getExpandedFallbackPlacements(ze)),er=[ze].concat(Xe).reduce(function(fr,Ar){return fr.concat(getBasePlacement(Ar)===auto?computeAutoPlacement(Ae,{placement:Ar,boundary:Pe,rootBoundary:ke,padding:Te,flipVariations:Ue,allowedAutoPlacements:qe}):Ar)},[]),tr=Ae.rects.reference,nr=Ae.rects.popper,sr=new Map,dr=!0,ar=er[0],lr=0;lr<er.length;lr++){var Ke=er[lr],Me=getBasePlacement(Ke),je=getVariation(Ke)===start,De=[top$1,bottom$1].indexOf(Me)>=0,He=De?"width":"height",Qe=detectOverflow(Ae,{placement:Ke,boundary:Pe,rootBoundary:ke,altBoundary:$e,padding:Te}),Ye=De?je?right:left:je?bottom$1:top$1;tr[He]>nr[He]&&(Ye=getOppositePlacement(Ye));var St=getOppositePlacement(Ye),We=[];if(Ce&&We.push(Qe[Me]<=0),Ie&&We.push(Qe[Ye]<=0,Qe[St]<=0),We.every(function(fr){return fr})){ar=Ke,dr=!1;break}sr.set(Ke,We)}if(dr)for(var Fe=Ue?3:1,Ze=function(Ar){var vr=er.find(function(xr){var br=sr.get(xr);if(br)return br.slice(0,Ar).every(function(_r){return _r})});if(vr)return ar=vr,"break"},ir=Fe;ir>0;ir--){var ur=Ze(ir);if(ur==="break")break}Ae.placement!==ar&&(Ae.modifiersData[Ee]._skip=!0,Ae.placement=ar,Ae.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(t,Ae,xe){return xe===void 0&&(xe={x:0,y:0}),{top:t.top-Ae.height-xe.y,right:t.right-Ae.width+xe.x,bottom:t.bottom-Ae.height+xe.y,left:t.left-Ae.width-xe.x}}function isAnySideFullyClipped(t){return[top$1,right,bottom$1,left].some(function(Ae){return t[Ae]>=0})}function hide(t){var Ae=t.state,xe=t.name,Ee=Ae.rects.reference,Se=Ae.rects.popper,Ce=Ae.modifiersData.preventOverflow,_e=detectOverflow(Ae,{elementContext:"reference"}),Ie=detectOverflow(Ae,{altBoundary:!0}),Be=getSideOffsets(_e,Ee),Te=getSideOffsets(Ie,Se,Ce),Pe=isAnySideFullyClipped(Be),ke=isAnySideFullyClipped(Te);Ae.modifiersData[xe]={referenceClippingOffsets:Be,popperEscapeOffsets:Te,isReferenceHidden:Pe,hasPopperEscaped:ke},Ae.attributes.popper=Object.assign({},Ae.attributes.popper,{"data-popper-reference-hidden":Pe,"data-popper-escaped":ke})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(t,Ae,xe){var Ee=getBasePlacement(t),Se=[left,top$1].indexOf(Ee)>=0?-1:1,Ce=typeof xe=="function"?xe(Object.assign({},Ae,{placement:t})):xe,_e=Ce[0],Ie=Ce[1];return _e=_e||0,Ie=(Ie||0)*Se,[left,right].indexOf(Ee)>=0?{x:Ie,y:_e}:{x:_e,y:Ie}}function offset(t){var Ae=t.state,xe=t.options,Ee=t.name,Se=xe.offset,Ce=Se===void 0?[0,0]:Se,_e=placements.reduce(function(Pe,ke){return Pe[ke]=distanceAndSkiddingToXY(ke,Ae.rects,Ce),Pe},{}),Ie=_e[Ae.placement],Be=Ie.x,Te=Ie.y;Ae.modifiersData.popperOffsets!=null&&(Ae.modifiersData.popperOffsets.x+=Be,Ae.modifiersData.popperOffsets.y+=Te),Ae.modifiersData[Ee]=_e}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(t){var Ae=t.state,xe=t.name;Ae.modifiersData[xe]=computeOffsets({reference:Ae.rects.reference,element:Ae.rects.popper,placement:Ae.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(t){return t==="x"?"y":"x"}function preventOverflow(t){var Ae=t.state,xe=t.options,Ee=t.name,Se=xe.mainAxis,Ce=Se===void 0?!0:Se,_e=xe.altAxis,Ie=_e===void 0?!1:_e,Be=xe.boundary,Te=xe.rootBoundary,Pe=xe.altBoundary,ke=xe.padding,$e=xe.tether,Oe=$e===void 0?!0:$e,Ue=xe.tetherOffset,qe=Ue===void 0?0:Ue,ze=detectOverflow(Ae,{boundary:Be,rootBoundary:Te,padding:ke,altBoundary:Pe}),Ve=getBasePlacement(Ae.placement),Ge=getVariation(Ae.placement),Xe=!Ge,er=getMainAxisFromPlacement(Ve),tr=getAltAxis(er),nr=Ae.modifiersData.popperOffsets,sr=Ae.rects.reference,dr=Ae.rects.popper,ar=typeof qe=="function"?qe(Object.assign({},Ae.rects,{placement:Ae.placement})):qe,lr=typeof ar=="number"?{mainAxis:ar,altAxis:ar}:Object.assign({mainAxis:0,altAxis:0},ar),Ke=Ae.modifiersData.offset?Ae.modifiersData.offset[Ae.placement]:null,Me={x:0,y:0};if(nr){if(Ce){var je,De=er==="y"?top$1:left,He=er==="y"?bottom$1:right,Qe=er==="y"?"height":"width",Ye=nr[er],St=Ye+ze[De],We=Ye-ze[He],Fe=Oe?-dr[Qe]/2:0,Ze=Ge===start?sr[Qe]:dr[Qe],ir=Ge===start?-dr[Qe]:-sr[Qe],ur=Ae.elements.arrow,fr=Oe&&ur?getLayoutRect(ur):{width:0,height:0},Ar=Ae.modifiersData["arrow#persistent"]?Ae.modifiersData["arrow#persistent"].padding:getFreshSideObject(),vr=Ar[De],xr=Ar[He],br=within(0,sr[Qe],fr[Qe]),_r=Xe?sr[Qe]/2-Fe-br-vr-lr.mainAxis:Ze-br-vr-lr.mainAxis,$r=Xe?-sr[Qe]/2+Fe+br+xr+lr.mainAxis:ir+br+xr+lr.mainAxis,Fr=Ae.elements.arrow&&getOffsetParent(Ae.elements.arrow),Ir=Fr?er==="y"?Fr.clientTop||0:Fr.clientLeft||0:0,zr=(je=Ke==null?void 0:Ke[er])!=null?je:0,dn=Ye+_r-zr-Ir,tn=Ye+$r-zr,Gr=within(Oe?min$4(St,dn):St,Ye,Oe?max$4(We,tn):We);nr[er]=Gr,Me[er]=Gr-Ye}if(Ie){var wn,an=er==="x"?top$1:left,Vr=er==="x"?bottom$1:right,Rn=nr[tr],un=tr==="y"?"height":"width",sn=Rn+ze[an],jn=Rn-ze[Vr],en=[top$1,left].indexOf(Ve)!==-1,Jr=(wn=Ke==null?void 0:Ke[tr])!=null?wn:0,nn=en?sn:Rn-sr[un]-dr[un]-Jr+lr.altAxis,rn=en?Rn+sr[un]+dr[un]-Jr-lr.altAxis:jn,cn=Oe&&en?withinMaxClamp(nn,Rn,rn):within(Oe?nn:sn,Rn,Oe?rn:jn);nr[tr]=cn,Me[tr]=cn-Rn}Ae.modifiersData[Ee]=Me}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function getNodeScroll(t){return t===getWindow(t)||!isHTMLElement$2(t)?getWindowScroll(t):getHTMLElementScroll(t)}function isElementScaled(t){var Ae=t.getBoundingClientRect(),xe=round$4(Ae.width)/t.offsetWidth||1,Ee=round$4(Ae.height)/t.offsetHeight||1;return xe!==1||Ee!==1}function getCompositeRect(t,Ae,xe){xe===void 0&&(xe=!1);var Ee=isHTMLElement$2(Ae),Se=isHTMLElement$2(Ae)&&isElementScaled(Ae),Ce=getDocumentElement(Ae),_e=getBoundingClientRect(t,Se,xe),Ie={scrollLeft:0,scrollTop:0},Be={x:0,y:0};return(Ee||!Ee&&!xe)&&((getNodeName(Ae)!=="body"||isScrollParent(Ce))&&(Ie=getNodeScroll(Ae)),isHTMLElement$2(Ae)?(Be=getBoundingClientRect(Ae,!0),Be.x+=Ae.clientLeft,Be.y+=Ae.clientTop):Ce&&(Be.x=getWindowScrollBarX(Ce))),{x:_e.left+Ie.scrollLeft-Be.x,y:_e.top+Ie.scrollTop-Be.y,width:_e.width,height:_e.height}}function order$2(t){var Ae=new Map,xe=new Set,Ee=[];t.forEach(function(Ce){Ae.set(Ce.name,Ce)});function Se(Ce){xe.add(Ce.name);var _e=[].concat(Ce.requires||[],Ce.requiresIfExists||[]);_e.forEach(function(Ie){if(!xe.has(Ie)){var Be=Ae.get(Ie);Be&&Se(Be)}}),Ee.push(Ce)}return t.forEach(function(Ce){xe.has(Ce.name)||Se(Ce)}),Ee}function orderModifiers(t){var Ae=order$2(t);return modifierPhases.reduce(function(xe,Ee){return xe.concat(Ae.filter(function(Se){return Se.phase===Ee}))},[])}function debounce$1(t){var Ae;return function(){return Ae||(Ae=new Promise(function(xe){Promise.resolve().then(function(){Ae=void 0,xe(t())})})),Ae}}function mergeByName(t){var Ae=t.reduce(function(xe,Ee){var Se=xe[Ee.name];return xe[Ee.name]=Se?Object.assign({},Se,Ee,{options:Object.assign({},Se.options,Ee.options),data:Object.assign({},Se.data,Ee.data)}):Ee,xe},{});return Object.keys(Ae).map(function(xe){return Ae[xe]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var t=arguments.length,Ae=new Array(t),xe=0;xe<t;xe++)Ae[xe]=arguments[xe];return!Ae.some(function(Ee){return!(Ee&&typeof Ee.getBoundingClientRect=="function")})}function popperGenerator(t){t===void 0&&(t={});var Ae=t,xe=Ae.defaultModifiers,Ee=xe===void 0?[]:xe,Se=Ae.defaultOptions,Ce=Se===void 0?DEFAULT_OPTIONS:Se;return function(Ie,Be,Te){Te===void 0&&(Te=Ce);var Pe={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,Ce),modifiersData:{},elements:{reference:Ie,popper:Be},attributes:{},styles:{}},ke=[],$e=!1,Oe={state:Pe,setOptions:function(Ve){var Ge=typeof Ve=="function"?Ve(Pe.options):Ve;qe(),Pe.options=Object.assign({},Ce,Pe.options,Ge),Pe.scrollParents={reference:isElement(Ie)?listScrollParents(Ie):Ie.contextElement?listScrollParents(Ie.contextElement):[],popper:listScrollParents(Be)};var Xe=orderModifiers(mergeByName([].concat(Ee,Pe.options.modifiers)));return Pe.orderedModifiers=Xe.filter(function(er){return er.enabled}),Ue(),Oe.update()},forceUpdate:function(){if(!$e){var Ve=Pe.elements,Ge=Ve.reference,Xe=Ve.popper;if(areValidElements(Ge,Xe)){Pe.rects={reference:getCompositeRect(Ge,getOffsetParent(Xe),Pe.options.strategy==="fixed"),popper:getLayoutRect(Xe)},Pe.reset=!1,Pe.placement=Pe.options.placement,Pe.orderedModifiers.forEach(function(lr){return Pe.modifiersData[lr.name]=Object.assign({},lr.data)});for(var er=0;er<Pe.orderedModifiers.length;er++){if(Pe.reset===!0){Pe.reset=!1,er=-1;continue}var tr=Pe.orderedModifiers[er],nr=tr.fn,sr=tr.options,dr=sr===void 0?{}:sr,ar=tr.name;typeof nr=="function"&&(Pe=nr({state:Pe,options:dr,name:ar,instance:Oe})||Pe)}}}},update:debounce$1(function(){return new Promise(function(ze){Oe.forceUpdate(),ze(Pe)})}),destroy:function(){qe(),$e=!0}};if(!areValidElements(Ie,Be))return Oe;Oe.setOptions(Te).then(function(ze){!$e&&Te.onFirstUpdate&&Te.onFirstUpdate(ze)});function Ue(){Pe.orderedModifiers.forEach(function(ze){var Ve=ze.name,Ge=ze.options,Xe=Ge===void 0?{}:Ge,er=ze.effect;if(typeof er=="function"){var tr=er({state:Pe,name:Ve,instance:Oe,options:Xe}),nr=function(){};ke.push(tr||nr)}})}function qe(){ke.forEach(function(ze){return ze()}),ke=[]}return Oe}}var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers});function getPopperUtilityClass(t){return generateUtilityClass("MuiPopper",t)}generateUtilityClasses("MuiPopper",["root"]);function flipPlacement(t,Ae){if(Ae==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function resolveAnchorEl(t){return typeof t=="function"?t():t}function isHTMLElement$1(t){return t.nodeType!==void 0}const useUtilityClasses$1G=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getPopperUtilityClass,Ae)},defaultPopperOptions={},PopperTooltip=reactExports.forwardRef(function(Ae,xe){const{anchorEl:Ee,children:Se,direction:Ce,disablePortal:_e,modifiers:Ie,open:Be,placement:Te,popperOptions:Pe,popperRef:ke,slotProps:$e={},slots:Oe={},TransitionProps:Ue,ownerState:qe,...ze}=Ae,Ve=reactExports.useRef(null),Ge=useForkRef(Ve,xe),Xe=reactExports.useRef(null),er=useForkRef(Xe,ke),tr=reactExports.useRef(er);useEnhancedEffect(()=>{tr.current=er},[er]),reactExports.useImperativeHandle(ke,()=>Xe.current,[]);const nr=flipPlacement(Te,Ce),[sr,dr]=reactExports.useState(nr),[ar,lr]=reactExports.useState(resolveAnchorEl(Ee));reactExports.useEffect(()=>{Xe.current&&Xe.current.forceUpdate()}),reactExports.useEffect(()=>{Ee&&lr(resolveAnchorEl(Ee))},[Ee]),useEnhancedEffect(()=>{if(!ar||!Be)return;const He=St=>{dr(St.placement)};let Qe=[{name:"preventOverflow",options:{altBoundary:_e}},{name:"flip",options:{altBoundary:_e}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:St})=>{He(St)}}];Ie!=null&&(Qe=Qe.concat(Ie)),Pe&&Pe.modifiers!=null&&(Qe=Qe.concat(Pe.modifiers));const Ye=createPopper(ar,Ve.current,{placement:nr,...Pe,modifiers:Qe});return tr.current(Ye),()=>{Ye.destroy(),tr.current(null)}},[ar,_e,Ie,Be,Pe,nr]);const Ke={placement:sr};Ue!==null&&(Ke.TransitionProps=Ue);const Me=useUtilityClasses$1G(Ae),je=Oe.root??"div",De=useSlotProps({elementType:je,externalSlotProps:$e.root,externalForwardedProps:ze,additionalProps:{role:"tooltip",ref:Ge},ownerState:Ae,className:Me.root});return jsxRuntimeExports.jsx(je,{...De,children:typeof Se=="function"?Se(Ke):Se})}),Popper$1=reactExports.forwardRef(function(Ae,xe){const{anchorEl:Ee,children:Se,container:Ce,direction:_e="ltr",disablePortal:Ie=!1,keepMounted:Be=!1,modifiers:Te,open:Pe,placement:ke="bottom",popperOptions:$e=defaultPopperOptions,popperRef:Oe,style:Ue,transition:qe=!1,slotProps:ze={},slots:Ve={},...Ge}=Ae,[Xe,er]=reactExports.useState(!0),tr=()=>{er(!1)},nr=()=>{er(!0)};if(!Be&&!Pe&&(!qe||Xe))return null;let sr;if(Ce)sr=Ce;else if(Ee){const lr=resolveAnchorEl(Ee);sr=lr&&isHTMLElement$1(lr)?ownerDocument(lr).body:ownerDocument(null).body}const dr=!Pe&&Be&&(!qe||Xe)?"none":void 0,ar=qe?{in:Pe,onEnter:tr,onExited:nr}:void 0;return jsxRuntimeExports.jsx(Portal,{disablePortal:Ie,container:sr,children:jsxRuntimeExports.jsx(PopperTooltip,{anchorEl:Ee,direction:_e,disablePortal:Ie,modifiers:Te,ref:xe,open:qe?!Xe:Pe,placement:ke,popperOptions:$e,popperRef:Oe,slotProps:ze,slots:Ve,...Ge,style:{position:"fixed",top:0,left:0,display:dr,...Ue},TransitionProps:ar,children:Se})})}),PopperRoot=styled(Popper$1,{name:"MuiPopper",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({}),Popper=reactExports.forwardRef(function(Ae,xe){const Ee=useRtl(),Se=useDefaultProps({props:Ae,name:"MuiPopper"}),{anchorEl:Ce,component:_e,components:Ie,componentsProps:Be,container:Te,disablePortal:Pe,keepMounted:ke,modifiers:$e,open:Oe,placement:Ue,popperOptions:qe,popperRef:ze,transition:Ve,slots:Ge,slotProps:Xe,...er}=Se,tr=(Ge==null?void 0:Ge.root)??(Ie==null?void 0:Ie.Root),nr={anchorEl:Ce,container:Te,disablePortal:Pe,keepMounted:ke,modifiers:$e,open:Oe,placement:Ue,popperOptions:qe,popperRef:ze,transition:Ve,...er};return jsxRuntimeExports.jsx(PopperRoot,{as:_e,direction:Ee?"rtl":"ltr",slots:{root:tr},slotProps:Xe??Be,...nr,ref:xe})});function getTooltipUtilityClass(t){return generateUtilityClass("MuiTooltip",t)}const tooltipClasses=generateUtilityClasses("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function round$3(t){return Math.round(t*1e5)/1e5}const useUtilityClasses$1F=t=>{const{classes:Ae,disableInteractive:xe,arrow:Ee,touch:Se,placement:Ce}=t,_e={popper:["popper",!xe&&"popperInteractive",Ee&&"popperArrow"],tooltip:["tooltip",Ee&&"tooltipArrow",Se&&"touch",`tooltipPlacement${capitalize$1(Ce.split("-")[0])}`],arrow:["arrow"]};return composeClasses(_e,getTooltipUtilityClass,Ae)},TooltipPopper=styled(Popper,{name:"MuiTooltip",slot:"Popper",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.popper,!xe.disableInteractive&&Ae.popperInteractive,xe.arrow&&Ae.popperArrow,!xe.open&&Ae.popperClose]}})(memoTheme(({theme:t})=>({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:Ae})=>!Ae.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:Ae})=>!Ae,style:{pointerEvents:"none"}},{props:({ownerState:Ae})=>Ae.arrow,style:{[`&[data-popper-placement*="bottom"] .${tooltipClasses.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${tooltipClasses.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:Ae})=>Ae.arrow&&!Ae.isRtl,style:{[`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:Ae})=>Ae.arrow&&!!Ae.isRtl,style:{[`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:Ae})=>Ae.arrow&&!Ae.isRtl,style:{[`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:Ae})=>Ae.arrow&&!!Ae.isRtl,style:{[`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),TooltipTooltip=styled("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.tooltip,xe.touch&&Ae.touch,xe.arrow&&Ae.tooltipArrow,Ae[`tooltipPlacement${capitalize$1(xe.placement.split("-")[0])}`]]}})(memoTheme(({theme:t})=>({backgroundColor:t.vars?t.vars.palette.Tooltip.bg:alpha$3(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium,[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:Ae})=>Ae.arrow,style:{position:"relative",margin:0}},{props:({ownerState:Ae})=>Ae.touch,style:{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${round$3(16/14)}em`,fontWeight:t.typography.fontWeightRegular}},{props:({ownerState:Ae})=>!Ae.isRtl,style:{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:Ae})=>!Ae.isRtl&&Ae.touch,style:{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:Ae})=>!!Ae.isRtl,style:{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:Ae})=>!!Ae.isRtl&&Ae.touch,style:{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:Ae})=>Ae.touch,style:{[`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:Ae})=>Ae.touch,style:{[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),TooltipArrow=styled("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,Ae)=>Ae.arrow})(memoTheme(({theme:t})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:alpha$3(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let hystersisOpen=!1;const hystersisTimer=new Timeout;let cursorPosition={x:0,y:0};function composeEventHandler(t,Ae){return(xe,...Ee)=>{Ae&&Ae(xe,...Ee),t(xe,...Ee)}}const Tooltip$2=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiTooltip"}),{arrow:Se=!1,children:Ce,classes:_e,components:Ie={},componentsProps:Be={},describeChild:Te=!1,disableFocusListener:Pe=!1,disableHoverListener:ke=!1,disableInteractive:$e=!1,disableTouchListener:Oe=!1,enterDelay:Ue=100,enterNextDelay:qe=0,enterTouchDelay:ze=700,followCursor:Ve=!1,id:Ge,leaveDelay:Xe=0,leaveTouchDelay:er=1500,onClose:tr,onOpen:nr,open:sr,placement:dr="bottom",PopperComponent:ar,PopperProps:lr={},slotProps:Ke={},slots:Me={},title:je,TransitionComponent:De,TransitionProps:He,...Qe}=Ee,Ye=reactExports.isValidElement(Ce)?Ce:jsxRuntimeExports.jsx("span",{children:Ce}),St=useTheme(),We=useRtl(),[Fe,Ze]=reactExports.useState(),[ir,ur]=reactExports.useState(null),fr=reactExports.useRef(!1),Ar=$e||Ve,vr=useTimeout(),xr=useTimeout(),br=useTimeout(),_r=useTimeout(),[$r,Fr]=useControlled({controlled:sr,default:!1,name:"Tooltip",state:"open"});let Ir=$r;const zr=useId(Ge),dn=reactExports.useRef(),tn=useEventCallback(()=>{dn.current!==void 0&&(document.body.style.WebkitUserSelect=dn.current,dn.current=void 0),_r.clear()});reactExports.useEffect(()=>tn,[tn]);const Gr=Nn=>{hystersisTimer.clear(),hystersisOpen=!0,Fr(!0),nr&&!Ir&&nr(Nn)},wn=useEventCallback(Nn=>{hystersisTimer.start(800+Xe,()=>{hystersisOpen=!1}),Fr(!1),tr&&Ir&&tr(Nn),vr.start(St.transitions.duration.shortest,()=>{fr.current=!1})}),an=Nn=>{fr.current&&Nn.type!=="touchstart"||(Fe&&Fe.removeAttribute("title"),xr.clear(),br.clear(),Ue||hystersisOpen&&qe?xr.start(hystersisOpen?qe:Ue,()=>{Gr(Nn)}):Gr(Nn))},Vr=Nn=>{xr.clear(),br.start(Xe,()=>{wn(Nn)})},[,Rn]=reactExports.useState(!1),un=Nn=>{isFocusVisible(Nn.target)||(Rn(!1),Vr(Nn))},sn=Nn=>{Fe||Ze(Nn.currentTarget),isFocusVisible(Nn.target)&&(Rn(!0),an(Nn))},jn=Nn=>{fr.current=!0;const kr=Ye.props;kr.onTouchStart&&kr.onTouchStart(Nn)},en=Nn=>{jn(Nn),br.clear(),vr.clear(),tn(),dn.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",_r.start(ze,()=>{document.body.style.WebkitUserSelect=dn.current,an(Nn)})},Jr=Nn=>{Ye.props.onTouchEnd&&Ye.props.onTouchEnd(Nn),tn(),br.start(er,()=>{wn(Nn)})};reactExports.useEffect(()=>{if(!Ir)return;function Nn(kr){kr.key==="Escape"&&wn(kr)}return document.addEventListener("keydown",Nn),()=>{document.removeEventListener("keydown",Nn)}},[wn,Ir]);const nn=useForkRef(getReactElementRef(Ye),Ze,xe);!je&&je!==0&&(Ir=!1);const rn=reactExports.useRef(),cn=Nn=>{const kr=Ye.props;kr.onMouseMove&&kr.onMouseMove(Nn),cursorPosition={x:Nn.clientX,y:Nn.clientY},rn.current&&rn.current.update()},pn={},Mr=typeof je=="string";Te?(pn.title=!Ir&&Mr&&!ke?je:null,pn["aria-describedby"]=Ir?zr:null):(pn["aria-label"]=Mr?je:null,pn["aria-labelledby"]=Ir&&!Mr?zr:null);const gr={...pn,...Qe,...Ye.props,className:clsx(Qe.className,Ye.props.className),onTouchStart:jn,ref:nn,...Ve?{onMouseMove:cn}:{}},Br={};Oe||(gr.onTouchStart=en,gr.onTouchEnd=Jr),ke||(gr.onMouseOver=composeEventHandler(an,gr.onMouseOver),gr.onMouseLeave=composeEventHandler(Vr,gr.onMouseLeave),Ar||(Br.onMouseOver=an,Br.onMouseLeave=Vr)),Pe||(gr.onFocus=composeEventHandler(sn,gr.onFocus),gr.onBlur=composeEventHandler(un,gr.onBlur),Ar||(Br.onFocus=sn,Br.onBlur=un));const Hr={...Ee,isRtl:We,arrow:Se,disableInteractive:Ar,placement:dr,PopperComponentProp:ar,touch:fr.current},Kr=typeof Ke.popper=="function"?Ke.popper(Hr):Ke.popper,Dr=reactExports.useMemo(()=>{var kr,Er;let Nn=[{name:"arrow",enabled:!!ir,options:{element:ir,padding:4}}];return(kr=lr.popperOptions)!=null&&kr.modifiers&&(Nn=Nn.concat(lr.popperOptions.modifiers)),(Er=Kr==null?void 0:Kr.popperOptions)!=null&&Er.modifiers&&(Nn=Nn.concat(Kr.popperOptions.modifiers)),{...lr.popperOptions,...Kr==null?void 0:Kr.popperOptions,modifiers:Nn}},[ir,lr.popperOptions,Kr==null?void 0:Kr.popperOptions]),qr=useUtilityClasses$1F(Hr),Ur=typeof Ke.transition=="function"?Ke.transition(Hr):Ke.transition,Bn={slots:{popper:Ie.Popper,transition:Ie.Transition??De,tooltip:Ie.Tooltip,arrow:Ie.Arrow,...Me},slotProps:{arrow:Ke.arrow??Be.arrow,popper:{...lr,...Kr??Be.popper},tooltip:Ke.tooltip??Be.tooltip,transition:{...He,...Ur??Be.transition}}},[In,Rr]=useSlot("popper",{elementType:TooltipPopper,externalForwardedProps:Bn,ownerState:Hr,className:clsx(qr.popper,lr==null?void 0:lr.className)}),[Mn,En]=useSlot("transition",{elementType:Grow,externalForwardedProps:Bn,ownerState:Hr}),[Yr,Sn]=useSlot("tooltip",{elementType:TooltipTooltip,className:qr.tooltip,externalForwardedProps:Bn,ownerState:Hr}),[yn,On]=useSlot("arrow",{elementType:TooltipArrow,className:qr.arrow,externalForwardedProps:Bn,ownerState:Hr,ref:ur});return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[reactExports.cloneElement(Ye,gr),jsxRuntimeExports.jsx(In,{as:ar??Popper,placement:dr,anchorEl:Ve?{getBoundingClientRect:()=>({top:cursorPosition.y,left:cursorPosition.x,right:cursorPosition.x,bottom:cursorPosition.y,width:0,height:0})}:Fe,popperRef:rn,open:Fe?Ir:!1,id:zr,transition:!0,...Br,...Rr,popperOptions:Dr,children:({TransitionProps:Nn})=>jsxRuntimeExports.jsx(Mn,{timeout:St.transitions.duration.shorter,...Nn,...En,children:jsxRuntimeExports.jsxs(Yr,{...Sn,children:[je,Se?jsxRuntimeExports.jsx(yn,{...On}):null]})})})]})}),createStoreImpl=t=>{let Ae;const xe=new Set,Ee=(Te,Pe)=>{const ke=typeof Te=="function"?Te(Ae):Te;if(!Object.is(ke,Ae)){const $e=Ae;Ae=Pe??(typeof ke!="object"||ke===null)?ke:Object.assign({},Ae,ke),xe.forEach(Oe=>Oe(Ae,$e))}},Se=()=>Ae,Ie={setState:Ee,getState:Se,getInitialState:()=>Be,subscribe:Te=>(xe.add(Te),()=>xe.delete(Te))},Be=Ae=t(Ee,Se,Ie);return Ie},createStore$1=t=>t?createStoreImpl(t):createStoreImpl,identity$1=t=>t;function useStore$2(t,Ae=identity$1){const xe=React.useSyncExternalStore(t.subscribe,()=>Ae(t.getState()),()=>Ae(t.getInitialState()));return React.useDebugValue(xe),xe}const createImpl=t=>{const Ae=createStore$1(t),xe=Ee=>useStore$2(Ae,Ee);return Object.assign(xe,Ae),xe},create$1=t=>t?createImpl(t):createImpl,useUIStore=create$1(t=>({isNavbarVisible:!0,setNavbarVisible:Ae=>t({isNavbarVisible:Ae})}));function createJSONStorage(t,Ae){let xe;try{xe=t()}catch{return}return{getItem:Se=>{var Ce;const _e=Be=>Be===null?null:JSON.parse(Be,void 0),Ie=(Ce=xe.getItem(Se))!=null?Ce:null;return Ie instanceof Promise?Ie.then(_e):_e(Ie)},setItem:(Se,Ce)=>xe.setItem(Se,JSON.stringify(Ce,void 0)),removeItem:Se=>xe.removeItem(Se)}}const toThenable=t=>Ae=>{try{const xe=t(Ae);return xe instanceof Promise?xe:{then(Ee){return toThenable(Ee)(xe)},catch(Ee){return this}}}catch(xe){return{then(Ee){return this},catch(Ee){return toThenable(Ee)(xe)}}}},persistImpl=(t,Ae)=>(xe,Ee,Se)=>{let Ce={storage:createJSONStorage(()=>localStorage),partialize:qe=>qe,version:0,merge:(qe,ze)=>({...ze,...qe}),...Ae},_e=!1;const Ie=new Set,Be=new Set;let Te=Ce.storage;if(!Te)return t((...qe)=>{console.warn(`[zustand persist middleware] Unable to update item '${Ce.name}', the given storage is currently unavailable.`),xe(...qe)},Ee,Se);const Pe=()=>{const qe=Ce.partialize({...Ee()});return Te.setItem(Ce.name,{state:qe,version:Ce.version})},ke=Se.setState;Se.setState=(qe,ze)=>{ke(qe,ze),Pe()};const $e=t((...qe)=>{xe(...qe),Pe()},Ee,Se);Se.getInitialState=()=>$e;let Oe;const Ue=()=>{var qe,ze;if(!Te)return;_e=!1,Ie.forEach(Ge=>{var Xe;return Ge((Xe=Ee())!=null?Xe:$e)});const Ve=((ze=Ce.onRehydrateStorage)==null?void 0:ze.call(Ce,(qe=Ee())!=null?qe:$e))||void 0;return toThenable(Te.getItem.bind(Te))(Ce.name).then(Ge=>{if(Ge)if(typeof Ge.version=="number"&&Ge.version!==Ce.version){if(Ce.migrate){const Xe=Ce.migrate(Ge.state,Ge.version);return Xe instanceof Promise?Xe.then(er=>[!0,er]):[!0,Xe]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,Ge.state];return[!1,void 0]}).then(Ge=>{var Xe;const[er,tr]=Ge;if(Oe=Ce.merge(tr,(Xe=Ee())!=null?Xe:$e),xe(Oe,!0),er)return Pe()}).then(()=>{Ve==null||Ve(Oe,void 0),Oe=Ee(),_e=!0,Be.forEach(Ge=>Ge(Oe))}).catch(Ge=>{Ve==null||Ve(void 0,Ge)})};return Se.persist={setOptions:qe=>{Ce={...Ce,...qe},qe.storage&&(Te=qe.storage)},clearStorage:()=>{Te==null||Te.removeItem(Ce.name)},getOptions:()=>Ce,rehydrate:()=>Ue(),hasHydrated:()=>_e,onHydrate:qe=>(Ie.add(qe),()=>{Ie.delete(qe)}),onFinishHydration:qe=>(Be.add(qe),()=>{Be.delete(qe)})},Ce.skipHydration||Ue(),Oe||$e},persist=persistImpl,useApiConfig=create$1()(persist(t=>({apiBaseUrl:"",setApiBaseUrl:Ae=>t({apiBaseUrl:Ae}),persistApiBaseUrl:!1,enablePersistApiBaseUrl:()=>t({persistApiBaseUrl:!0}),fetchingPromise:null,setFetchingPromise:Ae=>t({fetchingPromise:Ae})}),{name:"api-config-storage",partialize:t=>t.persistApiBaseUrl?{apiBaseUrl:t.apiBaseUrl}:{}}));async function callApi(t,Ae={}){const{apiBaseUrl:xe}=useApiConfig.getState();return fetch(`${xe}/api${t}`,Ae)}async function fetchUserEmail(){try{const t=await callApi("/user/email",{method:"GET"});if(!t.ok)throw new Error("Failed to fetch user email");return(await t.json()).email}catch(t){return console.error("Error fetching user email:",t),null}}async function updateEvalAuthor(t,Ae){const xe=await callApi(`/eval/${t}/author`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({author:Ae})});if(!xe.ok)throw new Error("Failed to update eval author");return xe.json()}function c$1(t,Ae,xe){var Ee=this,Se=reactExports.useRef(null),Ce=reactExports.useRef(0),_e=reactExports.useRef(null),Ie=reactExports.useRef([]),Be=reactExports.useRef(),Te=reactExports.useRef(),Pe=reactExports.useRef(t),ke=reactExports.useRef(!0);Pe.current=t;var $e=typeof window<"u",Oe=!Ae&&Ae!==0&&$e;if(typeof t!="function")throw new TypeError("Expected a function");Ae=+Ae||0;var Ue=!!(xe=xe||{}).leading,qe=!("trailing"in xe)||!!xe.trailing,ze="maxWait"in xe,Ve="debounceOnServer"in xe&&!!xe.debounceOnServer,Ge=ze?Math.max(+xe.maxWait||0,Ae):null;reactExports.useEffect(function(){return ke.current=!0,function(){ke.current=!1}},[]);var Xe=reactExports.useMemo(function(){var er=function(lr){var Ke=Ie.current,Me=Be.current;return Ie.current=Be.current=null,Ce.current=lr,Te.current=Pe.current.apply(Me,Ke)},tr=function(lr,Ke){Oe&&cancelAnimationFrame(_e.current),_e.current=Oe?requestAnimationFrame(lr):setTimeout(lr,Ke)},nr=function(lr){if(!ke.current)return!1;var Ke=lr-Se.current;return!Se.current||Ke>=Ae||Ke<0||ze&&lr-Ce.current>=Ge},sr=function(lr){return _e.current=null,qe&&Ie.current?er(lr):(Ie.current=Be.current=null,Te.current)},dr=function lr(){var Ke=Date.now();if(nr(Ke))return sr(Ke);if(ke.current){var Me=Ae-(Ke-Se.current),je=ze?Math.min(Me,Ge-(Ke-Ce.current)):Me;tr(lr,je)}},ar=function(){if($e||Ve){var lr=Date.now(),Ke=nr(lr);if(Ie.current=[].slice.call(arguments),Be.current=Ee,Se.current=lr,Ke){if(!_e.current&&ke.current)return Ce.current=Se.current,tr(dr,Ae),Ue?er(Se.current):Te.current;if(ze)return tr(dr,Ae),er(Se.current)}return _e.current||tr(dr,Ae),Te.current}};return ar.cancel=function(){_e.current&&(Oe?cancelAnimationFrame(_e.current):clearTimeout(_e.current)),Ce.current=0,Ie.current=Se.current=Be.current=_e.current=null},ar.isPending=function(){return!!_e.current},ar.flush=function(){return _e.current?sr(Date.now()):Te.current},ar},[Ue,ze,Ae,Ge,qe,Oe,$e,Ve]);return Xe}function i$7(t,Ae){return t===Ae}function a$2(t,Ae,xe){var Ee=i$7,Se=reactExports.useRef(t),Ce=reactExports.useState({})[1],_e=c$1(reactExports.useCallback(function(Be){Se.current=Be,Ce({})},[Ce]),Ae,xe),Ie=reactExports.useRef(t);return Ee(Ie.current,t)||(_e(t),Ie.current=t),[Se.current,_e]}function useApiHealth(){const[t,Ae]=reactExports.useState("unknown"),[xe,Ee]=reactExports.useState(null),[Se,Ce]=reactExports.useState(!1),_e=reactExports.useCallback(async()=>{try{const Pe=await(await callApi("/remote-health")).json();Pe.status==="DISABLED"?Ae("disabled"):Ae(Pe.status==="OK"?"connected":"blocked"),Ee(Pe.message)}catch{Ae("blocked"),Ee("Network error: Unable to check API health")}finally{Ce(!1)}},[]),[Ie]=a$2(_e,300),Be=reactExports.useCallback(async()=>{Ce(!0),Ae("loading"),await Ie()},[Ie]);return{status:t,message:xe,checkHealth:Be,isChecking:Se}}const CircleIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle"),RefreshIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");function getAlertUtilityClass(t){return generateUtilityClass("MuiAlert",t)}const alertClasses=generateUtilityClasses("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),SuccessOutlinedIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),ReportProblemOutlinedIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),ErrorOutlineIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),InfoOutlinedIcon$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),ClearIcon$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),useUtilityClasses$1E=t=>{const{variant:Ae,color:xe,severity:Ee,classes:Se}=t,Ce={root:["root",`color${capitalize$1(xe||Ee)}`,`${Ae}${capitalize$1(xe||Ee)}`,`${Ae}`],icon:["icon"],message:["message"],action:["action"]};return composeClasses(Ce,getAlertUtilityClass,Se)},AlertRoot=styled(Paper,{name:"MuiAlert",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[xe.variant],Ae[`${xe.variant}${capitalize$1(xe.color||xe.severity)}`]]}})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light"?darken:lighten,xe=t.palette.mode==="light"?lighten:darken;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["light"])).map(([Ee])=>({props:{colorSeverity:Ee,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${Ee}Color`]:Ae(t.palette[Ee].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${Ee}StandardBg`]:xe(t.palette[Ee].light,.9),[`& .${alertClasses.icon}`]:t.vars?{color:t.vars.palette.Alert[`${Ee}IconColor`]}:{color:t.palette[Ee].main}}})),...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["light"])).map(([Ee])=>({props:{colorSeverity:Ee,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${Ee}Color`]:Ae(t.palette[Ee].light,.6),border:`1px solid ${(t.vars||t).palette[Ee].light}`,[`& .${alertClasses.icon}`]:t.vars?{color:t.vars.palette.Alert[`${Ee}IconColor`]}:{color:t.palette[Ee].main}}})),...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["dark"])).map(([Ee])=>({props:{colorSeverity:Ee,variant:"filled"},style:{fontWeight:t.typography.fontWeightMedium,...t.vars?{color:t.vars.palette.Alert[`${Ee}FilledColor`],backgroundColor:t.vars.palette.Alert[`${Ee}FilledBg`]}:{backgroundColor:t.palette.mode==="dark"?t.palette[Ee].dark:t.palette[Ee].main,color:t.palette.getContrastText(t.palette[Ee].main)}}}))]}})),AlertIcon=styled("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(t,Ae)=>Ae.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),AlertMessage=styled("div",{name:"MuiAlert",slot:"Message",overridesResolver:(t,Ae)=>Ae.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),AlertAction=styled("div",{name:"MuiAlert",slot:"Action",overridesResolver:(t,Ae)=>Ae.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),defaultIconMapping={success:jsxRuntimeExports.jsx(SuccessOutlinedIcon,{fontSize:"inherit"}),warning:jsxRuntimeExports.jsx(ReportProblemOutlinedIcon,{fontSize:"inherit"}),error:jsxRuntimeExports.jsx(ErrorOutlineIcon,{fontSize:"inherit"}),info:jsxRuntimeExports.jsx(InfoOutlinedIcon$1,{fontSize:"inherit"})},Alert=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiAlert"}),{action:Se,children:Ce,className:_e,closeText:Ie="Close",color:Be,components:Te={},componentsProps:Pe={},icon:ke,iconMapping:$e=defaultIconMapping,onClose:Oe,role:Ue="alert",severity:qe="success",slotProps:ze={},slots:Ve={},variant:Ge="standard",...Xe}=Ee,er={...Ee,color:Be,severity:qe,variant:Ge,colorSeverity:Be||qe},tr=useUtilityClasses$1E(er),nr={slots:{closeButton:Te.CloseButton,closeIcon:Te.CloseIcon,...Ve},slotProps:{...Pe,...ze}},[sr,dr]=useSlot("root",{ref:xe,shouldForwardComponentProp:!0,className:clsx(tr.root,_e),elementType:AlertRoot,externalForwardedProps:{...nr,...Xe},ownerState:er,additionalProps:{role:Ue,elevation:0}}),[ar,lr]=useSlot("icon",{className:tr.icon,elementType:AlertIcon,externalForwardedProps:nr,ownerState:er}),[Ke,Me]=useSlot("message",{className:tr.message,elementType:AlertMessage,externalForwardedProps:nr,ownerState:er}),[je,De]=useSlot("action",{className:tr.action,elementType:AlertAction,externalForwardedProps:nr,ownerState:er}),[He,Qe]=useSlot("closeButton",{elementType:IconButton,externalForwardedProps:nr,ownerState:er}),[Ye,St]=useSlot("closeIcon",{elementType:ClearIcon$1,externalForwardedProps:nr,ownerState:er});return jsxRuntimeExports.jsxs(sr,{...dr,children:[ke!==!1?jsxRuntimeExports.jsx(ar,{...lr,children:ke||$e[qe]||defaultIconMapping[qe]}):null,jsxRuntimeExports.jsx(Ke,{...Me,children:Ce}),Se!=null?jsxRuntimeExports.jsx(je,{...De,children:Se}):null,Se==null&&Oe?jsxRuntimeExports.jsx(je,{...De,children:jsxRuntimeExports.jsx(He,{size:"small","aria-label":Ie,title:Ie,color:"inherit",onClick:Oe,...Qe,children:jsxRuntimeExports.jsx(Ye,{fontSize:"small",...St})})}):null]})});function getDialogUtilityClass(t){return generateUtilityClass("MuiDialog",t)}const dialogClasses=generateUtilityClasses("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),DialogContext=reactExports.createContext({}),DialogBackdrop=styled(Backdrop,{name:"MuiDialog",slot:"Backdrop",overrides:(t,Ae)=>Ae.backdrop})({zIndex:-1}),useUtilityClasses$1D=t=>{const{classes:Ae,scroll:xe,maxWidth:Ee,fullWidth:Se,fullScreen:Ce}=t,_e={root:["root"],container:["container",`scroll${capitalize$1(xe)}`],paper:["paper",`paperScroll${capitalize$1(xe)}`,`paperWidth${capitalize$1(String(Ee))}`,Se&&"paperFullWidth",Ce&&"paperFullScreen"]};return composeClasses(_e,getDialogUtilityClass,Ae)},DialogRoot=styled(Modal,{name:"MuiDialog",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({"@media print":{position:"absolute !important"}}),DialogContainer=styled("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.container,Ae[`scroll${capitalize$1(xe.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),DialogPaper=styled(Paper,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.paper,Ae[`scrollPaper${capitalize$1(xe.scroll)}`],Ae[`paperWidth${capitalize$1(String(xe.maxWidth))}`],xe.fullWidth&&Ae.paperFullWidth,xe.fullScreen&&Ae.paperFullScreen]}})(memoTheme(({theme:t})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:Ae})=>!Ae.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${dialogClasses.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter(Ae=>Ae!=="xs").map(Ae=>({props:{maxWidth:Ae},style:{maxWidth:`${t.breakpoints.values[Ae]}${t.breakpoints.unit}`,[`&.${dialogClasses.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[Ae]+32*2)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:Ae})=>Ae.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:Ae})=>Ae.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${dialogClasses.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Dialog=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiDialog"}),Se=useTheme(),Ce={enter:Se.transitions.duration.enteringScreen,exit:Se.transitions.duration.leavingScreen},{"aria-describedby":_e,"aria-labelledby":Ie,"aria-modal":Be=!0,BackdropComponent:Te,BackdropProps:Pe,children:ke,className:$e,disableEscapeKeyDown:Oe=!1,fullScreen:Ue=!1,fullWidth:qe=!1,maxWidth:ze="sm",onBackdropClick:Ve,onClick:Ge,onClose:Xe,open:er,PaperComponent:tr=Paper,PaperProps:nr={},scroll:sr="paper",slots:dr={},slotProps:ar={},TransitionComponent:lr=Fade,transitionDuration:Ke=Ce,TransitionProps:Me,...je}=Ee,De={...Ee,disableEscapeKeyDown:Oe,fullScreen:Ue,fullWidth:qe,maxWidth:ze,scroll:sr},He=useUtilityClasses$1D(De),Qe=reactExports.useRef(),Ye=dn=>{Qe.current=dn.target===dn.currentTarget},St=dn=>{Ge&&Ge(dn),Qe.current&&(Qe.current=null,Ve&&Ve(dn),Xe&&Xe(dn,"backdropClick"))},We=useId(Ie),Fe=reactExports.useMemo(()=>({titleId:We}),[We]),Ze={transition:lr,...dr},ir={transition:Me,paper:nr,backdrop:Pe,...ar},ur={slots:Ze,slotProps:ir},[fr,Ar]=useSlot("root",{elementType:DialogRoot,shouldForwardComponentProp:!0,externalForwardedProps:ur,ownerState:De,className:clsx(He.root,$e),ref:xe}),[vr,xr]=useSlot("backdrop",{elementType:DialogBackdrop,shouldForwardComponentProp:!0,externalForwardedProps:ur,ownerState:De}),[br,_r]=useSlot("paper",{elementType:DialogPaper,shouldForwardComponentProp:!0,externalForwardedProps:ur,ownerState:De,className:clsx(He.paper,nr.className)}),[$r,Fr]=useSlot("container",{elementType:DialogContainer,externalForwardedProps:ur,ownerState:De,className:clsx(He.container)}),[Ir,zr]=useSlot("transition",{elementType:Fade,externalForwardedProps:ur,ownerState:De,additionalProps:{appear:!0,in:er,timeout:Ke,role:"presentation"}});return jsxRuntimeExports.jsx(fr,{closeAfterTransition:!0,slots:{backdrop:vr},slotProps:{backdrop:{transitionDuration:Ke,as:Te,...xr}},disableEscapeKeyDown:Oe,onClose:Xe,open:er,onClick:St,...Ar,...je,children:jsxRuntimeExports.jsx(Ir,{...zr,children:jsxRuntimeExports.jsx($r,{onMouseDown:Ye,...Fr,children:jsxRuntimeExports.jsx(br,{as:tr,elevation:24,role:"dialog","aria-describedby":_e,"aria-labelledby":We,"aria-modal":Be,..._r,children:jsxRuntimeExports.jsx(DialogContext.Provider,{value:Fe,children:ke})})})})})});function getDialogActionsUtilityClass(t){return generateUtilityClass("MuiDialogActions",t)}generateUtilityClasses("MuiDialogActions",["root","spacing"]);const useUtilityClasses$1C=t=>{const{classes:Ae,disableSpacing:xe}=t;return composeClasses({root:["root",!xe&&"spacing"]},getDialogActionsUtilityClass,Ae)},DialogActionsRoot=styled("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,!xe.disableSpacing&&Ae.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:t})=>!t.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),DialogActions=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiDialogActions"}),{className:Se,disableSpacing:Ce=!1,..._e}=Ee,Ie={...Ee,disableSpacing:Ce},Be=useUtilityClasses$1C(Ie);return jsxRuntimeExports.jsx(DialogActionsRoot,{className:clsx(Be.root,Se),ownerState:Ie,ref:xe,..._e})});function getDialogContentUtilityClass(t){return generateUtilityClass("MuiDialogContent",t)}generateUtilityClasses("MuiDialogContent",["root","dividers"]);function getDialogTitleUtilityClass(t){return generateUtilityClass("MuiDialogTitle",t)}const dialogTitleClasses=generateUtilityClasses("MuiDialogTitle",["root"]),useUtilityClasses$1B=t=>{const{classes:Ae,dividers:xe}=t;return composeClasses({root:["root",xe&&"dividers"]},getDialogContentUtilityClass,Ae)},DialogContentRoot=styled("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.dividers&&Ae.dividers]}})(memoTheme(({theme:t})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:Ae})=>Ae.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:Ae})=>!Ae.dividers,style:{[`.${dialogTitleClasses.root} + &`]:{paddingTop:0}}}]}))),DialogContent=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiDialogContent"}),{className:Se,dividers:Ce=!1,..._e}=Ee,Ie={...Ee,dividers:Ce},Be=useUtilityClasses$1B(Ie);return jsxRuntimeExports.jsx(DialogContentRoot,{className:clsx(Be.root,Se),ownerState:Ie,ref:xe,..._e})}),useUtilityClasses$1A=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getDialogTitleUtilityClass,Ae)},DialogTitleRoot=styled(Typography,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({padding:"16px 24px",flex:"0 0 auto"}),DialogTitle=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiDialogTitle"}),{className:Se,id:Ce,..._e}=Ee,Ie=Ee,Be=useUtilityClasses$1A(Ie),{titleId:Te=Ce}=reactExports.useContext(DialogContext);return jsxRuntimeExports.jsx(DialogTitleRoot,{component:"h2",className:clsx(Be.root,Se),ownerState:Ie,ref:xe,variant:"h6",id:Ce??Te,..._e})});function getStyleValue(t){return parseInt(t,10)||0}const styles$2={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function isObjectEmpty$1(t){for(const Ae in t)return!1;return!0}function isEmpty$1(t){return isObjectEmpty$1(t)||t.outerHeightStyle===0&&!t.overflowing}const TextareaAutosize=reactExports.forwardRef(function(Ae,xe){const{onChange:Ee,maxRows:Se,minRows:Ce=1,style:_e,value:Ie,...Be}=Ae,{current:Te}=reactExports.useRef(Ie!=null),Pe=reactExports.useRef(null),ke=useForkRef(xe,Pe),$e=reactExports.useRef(null),Oe=reactExports.useRef(null),Ue=reactExports.useCallback(()=>{const Ge=Pe.current,Xe=Oe.current;if(!Ge||!Xe)return;const tr=ownerWindow(Ge).getComputedStyle(Ge);if(tr.width==="0px")return{outerHeightStyle:0,overflowing:!1};Xe.style.width=tr.width,Xe.value=Ge.value||Ae.placeholder||"x",Xe.value.slice(-1)===`
217
- `&&(Xe.value+=" ");const nr=tr.boxSizing,sr=getStyleValue(tr.paddingBottom)+getStyleValue(tr.paddingTop),dr=getStyleValue(tr.borderBottomWidth)+getStyleValue(tr.borderTopWidth),ar=Xe.scrollHeight;Xe.value="x";const lr=Xe.scrollHeight;let Ke=ar;Ce&&(Ke=Math.max(Number(Ce)*lr,Ke)),Se&&(Ke=Math.min(Number(Se)*lr,Ke)),Ke=Math.max(Ke,lr);const Me=Ke+(nr==="border-box"?sr+dr:0),je=Math.abs(Ke-ar)<=1;return{outerHeightStyle:Me,overflowing:je}},[Se,Ce,Ae.placeholder]),qe=reactExports.useCallback(()=>{const Ge=Pe.current,Xe=Ue();if(!Ge||!Xe||isEmpty$1(Xe))return;const er=Xe.outerHeightStyle;$e.current!==er&&($e.current=er,Ge.style.height=`${er}px`),Ge.style.overflow=Xe.overflowing?"hidden":""},[Ue]),ze=reactExports.useRef(-1);useEnhancedEffect(()=>{const Ge=debounce$2(()=>qe()),Xe=Pe==null?void 0:Pe.current;if(!Xe)return;const er=ownerWindow(Xe);er.addEventListener("resize",Ge);let tr;return typeof ResizeObserver<"u"&&(tr=new ResizeObserver(()=>{tr.unobserve(Xe),cancelAnimationFrame(ze.current),qe(),ze.current=requestAnimationFrame(()=>{tr.observe(Xe)})}),tr.observe(Xe)),()=>{Ge.clear(),cancelAnimationFrame(ze.current),er.removeEventListener("resize",Ge),tr&&tr.disconnect()}},[Ue,qe]),useEnhancedEffect(()=>{qe()});const Ve=Ge=>{Te||qe(),Ee&&Ee(Ge)};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("textarea",{value:Ie,onChange:Ve,ref:ke,rows:Ce,style:_e,...Be}),jsxRuntimeExports.jsx("textarea",{"aria-hidden":!0,className:Ae.className,readOnly:!0,ref:Oe,tabIndex:-1,style:{...styles$2.shadow,..._e,paddingTop:0,paddingBottom:0}})]})});function formControlState({props:t,states:Ae,muiFormControl:xe}){return Ae.reduce((Ee,Se)=>(Ee[Se]=t[Se],xe&&typeof t[Se]>"u"&&(Ee[Se]=xe[Se]),Ee),{})}const FormControlContext=reactExports.createContext(void 0);function useFormControl(){return reactExports.useContext(FormControlContext)}function hasValue(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function isFilled(t,Ae=!1){return t&&(hasValue(t.value)&&t.value!==""||Ae&&hasValue(t.defaultValue)&&t.defaultValue!=="")}function isAdornedStart(t){return t.startAdornment}function getInputBaseUtilityClass(t){return generateUtilityClass("MuiInputBase",t)}const inputBaseClasses=generateUtilityClasses("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var _InputGlobalStyles;const rootOverridesResolver=(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.formControl&&Ae.formControl,xe.startAdornment&&Ae.adornedStart,xe.endAdornment&&Ae.adornedEnd,xe.error&&Ae.error,xe.size==="small"&&Ae.sizeSmall,xe.multiline&&Ae.multiline,xe.color&&Ae[`color${capitalize$1(xe.color)}`],xe.fullWidth&&Ae.fullWidth,xe.hiddenLabel&&Ae.hiddenLabel]},inputOverridesResolver=(t,Ae)=>{const{ownerState:xe}=t;return[Ae.input,xe.size==="small"&&Ae.inputSizeSmall,xe.multiline&&Ae.inputMultiline,xe.type==="search"&&Ae.inputTypeSearch,xe.startAdornment&&Ae.inputAdornedStart,xe.endAdornment&&Ae.inputAdornedEnd,xe.hiddenLabel&&Ae.inputHiddenLabel]},useUtilityClasses$1z=t=>{const{classes:Ae,color:xe,disabled:Ee,error:Se,endAdornment:Ce,focused:_e,formControl:Ie,fullWidth:Be,hiddenLabel:Te,multiline:Pe,readOnly:ke,size:$e,startAdornment:Oe,type:Ue}=t,qe={root:["root",`color${capitalize$1(xe)}`,Ee&&"disabled",Se&&"error",Be&&"fullWidth",_e&&"focused",Ie&&"formControl",$e&&$e!=="medium"&&`size${capitalize$1($e)}`,Pe&&"multiline",Oe&&"adornedStart",Ce&&"adornedEnd",Te&&"hiddenLabel",ke&&"readOnly"],input:["input",Ee&&"disabled",Ue==="search"&&"inputTypeSearch",Pe&&"inputMultiline",$e==="small"&&"inputSizeSmall",Te&&"inputHiddenLabel",Oe&&"inputAdornedStart",Ce&&"inputAdornedEnd",ke&&"readOnly"]};return composeClasses(qe,getInputBaseUtilityClass,Ae)},InputBaseRoot=styled("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rootOverridesResolver})(memoTheme(({theme:t})=>({...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${inputBaseClasses.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:Ae})=>Ae.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:Ae,size:xe})=>Ae.multiline&&xe==="small",style:{paddingTop:1}},{props:({ownerState:Ae})=>Ae.fullWidth,style:{width:"100%"}}]}))),InputBaseInput=styled("input",{name:"MuiInputBase",slot:"Input",overridesResolver:inputOverridesResolver})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light",xe={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:Ae?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},Ee={opacity:"0 !important"},Se=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:Ae?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":xe,"&::-moz-placeholder":xe,"&::-ms-input-placeholder":xe,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${inputBaseClasses.formControl} &`]:{"&::-webkit-input-placeholder":Ee,"&::-moz-placeholder":Ee,"&::-ms-input-placeholder":Ee,"&:focus::-webkit-input-placeholder":Se,"&:focus::-moz-placeholder":Se,"&:focus::-ms-input-placeholder":Se},[`&.${inputBaseClasses.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:({ownerState:Ce})=>!Ce.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:Ce})=>Ce.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),InputGlobalStyles=globalCss({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),InputBase=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiInputBase"}),{"aria-describedby":Se,autoComplete:Ce,autoFocus:_e,className:Ie,color:Be,components:Te={},componentsProps:Pe={},defaultValue:ke,disabled:$e,disableInjectingGlobalStyles:Oe,endAdornment:Ue,error:qe,fullWidth:ze=!1,id:Ve,inputComponent:Ge="input",inputProps:Xe={},inputRef:er,margin:tr,maxRows:nr,minRows:sr,multiline:dr=!1,name:ar,onBlur:lr,onChange:Ke,onClick:Me,onFocus:je,onKeyDown:De,onKeyUp:He,placeholder:Qe,readOnly:Ye,renderSuffix:St,rows:We,size:Fe,slotProps:Ze={},slots:ir={},startAdornment:ur,type:fr="text",value:Ar,...vr}=Ee,xr=Xe.value!=null?Xe.value:Ar,{current:br}=reactExports.useRef(xr!=null),_r=reactExports.useRef(),$r=reactExports.useCallback(gr=>{},[]),Fr=useForkRef(_r,er,Xe.ref,$r),[Ir,zr]=reactExports.useState(!1),dn=useFormControl(),tn=formControlState({props:Ee,muiFormControl:dn,states:["color","disabled","error","hiddenLabel","size","required","filled"]});tn.focused=dn?dn.focused:Ir,reactExports.useEffect(()=>{!dn&&$e&&Ir&&(zr(!1),lr&&lr())},[dn,$e,Ir,lr]);const Gr=dn&&dn.onFilled,wn=dn&&dn.onEmpty,an=reactExports.useCallback(gr=>{isFilled(gr)?Gr&&Gr():wn&&wn()},[Gr,wn]);useEnhancedEffect(()=>{br&&an({value:xr})},[xr,an,br]);const Vr=gr=>{je&&je(gr),Xe.onFocus&&Xe.onFocus(gr),dn&&dn.onFocus?dn.onFocus(gr):zr(!0)},Rn=gr=>{lr&&lr(gr),Xe.onBlur&&Xe.onBlur(gr),dn&&dn.onBlur?dn.onBlur(gr):zr(!1)},un=(gr,...Br)=>{if(!br){const Hr=gr.target||_r.current;if(Hr==null)throw new Error(formatMuiErrorMessage(1));an({value:Hr.value})}Xe.onChange&&Xe.onChange(gr,...Br),Ke&&Ke(gr,...Br)};reactExports.useEffect(()=>{an(_r.current)},[]);const sn=gr=>{_r.current&&gr.currentTarget===gr.target&&_r.current.focus(),Me&&Me(gr)};let jn=Ge,en=Xe;dr&&jn==="input"&&(We?en={type:void 0,minRows:We,maxRows:We,...en}:en={type:void 0,maxRows:nr,minRows:sr,...en},jn=TextareaAutosize);const Jr=gr=>{an(gr.animationName==="mui-auto-fill-cancel"?_r.current:{value:"x"})};reactExports.useEffect(()=>{dn&&dn.setAdornedStart(!!ur)},[dn,ur]);const nn={...Ee,color:tn.color||"primary",disabled:tn.disabled,endAdornment:Ue,error:tn.error,focused:tn.focused,formControl:dn,fullWidth:ze,hiddenLabel:tn.hiddenLabel,multiline:dr,size:tn.size,startAdornment:ur,type:fr},rn=useUtilityClasses$1z(nn),cn=ir.root||Te.Root||InputBaseRoot,pn=Ze.root||Pe.root||{},Mr=ir.input||Te.Input||InputBaseInput;return en={...en,...Ze.input??Pe.input},jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!Oe&&typeof InputGlobalStyles=="function"&&(_InputGlobalStyles||(_InputGlobalStyles=jsxRuntimeExports.jsx(InputGlobalStyles,{}))),jsxRuntimeExports.jsxs(cn,{...pn,ref:xe,onClick:sn,...vr,...!isHostComponent(cn)&&{ownerState:{...nn,...pn.ownerState}},className:clsx(rn.root,pn.className,Ie,Ye&&"MuiInputBase-readOnly"),children:[ur,jsxRuntimeExports.jsx(FormControlContext.Provider,{value:null,children:jsxRuntimeExports.jsx(Mr,{"aria-invalid":tn.error,"aria-describedby":Se,autoComplete:Ce,autoFocus:_e,defaultValue:ke,disabled:tn.disabled,id:Ve,onAnimationStart:Jr,name:ar,placeholder:Qe,readOnly:Ye,required:tn.required,rows:We,value:xr,onKeyDown:De,onKeyUp:He,type:fr,...en,...!isHostComponent(Mr)&&{as:jn,ownerState:{...nn,...en.ownerState}},ref:Fr,className:clsx(rn.input,en.className,Ye&&"MuiInputBase-readOnly"),onBlur:Rn,onChange:un,onFocus:Vr})}),Ue,St?St({...tn,startAdornment:ur}):null]})]})});function getInputUtilityClass(t){return generateUtilityClass("MuiInput",t)}const inputClasses={...inputBaseClasses,...generateUtilityClasses("MuiInput",["root","underline","input"])},useUtilityClasses$1y=t=>{const{classes:Ae,disableUnderline:xe}=t,Se=composeClasses({root:["root",!xe&&"underline"],input:["input"]},getInputUtilityClass,Ae);return{...Ae,...Se}},InputRoot=styled(InputBaseRoot,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[...rootOverridesResolver(t,Ae),!xe.disableUnderline&&Ae.underline]}})(memoTheme(({theme:t})=>{let xe=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(xe=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:Ee})=>Ee.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:Ee})=>!Ee.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${inputClasses.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${inputClasses.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${xe}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${inputClasses.disabled}, .${inputClasses.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${xe}`}},[`&.${inputClasses.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ee])=>({props:{color:Ee,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[Ee].main}`}}}))]}})),InputInput=styled(InputBaseInput,{name:"MuiInput",slot:"Input",overridesResolver:inputOverridesResolver})({}),Input=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiInput"}),{disableUnderline:Se=!1,components:Ce={},componentsProps:_e,fullWidth:Ie=!1,inputComponent:Be="input",multiline:Te=!1,slotProps:Pe,slots:ke={},type:$e="text",...Oe}=Ee,Ue=useUtilityClasses$1y(Ee),ze={root:{ownerState:{disableUnderline:Se}}},Ve=Pe??_e?deepmerge(Pe??_e,ze):ze,Ge=ke.root??Ce.Root??InputRoot,Xe=ke.input??Ce.Input??InputInput;return jsxRuntimeExports.jsx(InputBase,{slots:{root:Ge,input:Xe},slotProps:Ve,fullWidth:Ie,inputComponent:Be,multiline:Te,ref:xe,type:$e,...Oe,classes:Ue})});Input.muiName="Input";function getFilledInputUtilityClass(t){return generateUtilityClass("MuiFilledInput",t)}const filledInputClasses={...inputBaseClasses,...generateUtilityClasses("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},useUtilityClasses$1x=t=>{const{classes:Ae,disableUnderline:xe,startAdornment:Ee,endAdornment:Se,size:Ce,hiddenLabel:_e,multiline:Ie}=t,Be={root:["root",!xe&&"underline",Ee&&"adornedStart",Se&&"adornedEnd",Ce==="small"&&`size${capitalize$1(Ce)}`,_e&&"hiddenLabel",Ie&&"multiline"],input:["input"]},Te=composeClasses(Be,getFilledInputUtilityClass,Ae);return{...Ae,...Te}},FilledInputRoot=styled(InputBaseRoot,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[...rootOverridesResolver(t,Ae),!xe.disableUnderline&&Ae.underline]}})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light",xe=Ae?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",Ee=Ae?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",Se=Ae?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",Ce=Ae?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:Ee,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:Se,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:Ee}},[`&.${filledInputClasses.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:Ee},[`&.${filledInputClasses.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:Ce},variants:[{props:({ownerState:_e})=>!_e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${filledInputClasses.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${filledInputClasses.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:xe}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${filledInputClasses.disabled}, .${filledInputClasses.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${filledInputClasses.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([_e])=>{var Ie;return{props:{disableUnderline:!1,color:_e},style:{"&::after":{borderBottom:`2px solid ${(Ie=(t.vars||t).palette[_e])==null?void 0:Ie.main}`}}}}),{props:({ownerState:_e})=>_e.startAdornment,style:{paddingLeft:12}},{props:({ownerState:_e})=>_e.endAdornment,style:{paddingRight:12}},{props:({ownerState:_e})=>_e.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:_e,size:Ie})=>_e.multiline&&Ie==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:_e})=>_e.multiline&&_e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:_e})=>_e.multiline&&_e.hiddenLabel&&_e.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),FilledInputInput=styled(InputBaseInput,{name:"MuiFilledInput",slot:"Input",overridesResolver:inputOverridesResolver})(memoTheme(({theme:t})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:Ae})=>Ae.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:Ae})=>Ae.startAdornment,style:{paddingLeft:0}},{props:({ownerState:Ae})=>Ae.endAdornment,style:{paddingRight:0}},{props:({ownerState:Ae})=>Ae.hiddenLabel&&Ae.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:Ae})=>Ae.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),FilledInput=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFilledInput"}),{disableUnderline:Se=!1,components:Ce={},componentsProps:_e,fullWidth:Ie=!1,hiddenLabel:Be,inputComponent:Te="input",multiline:Pe=!1,slotProps:ke,slots:$e={},type:Oe="text",...Ue}=Ee,qe={...Ee,disableUnderline:Se,fullWidth:Ie,inputComponent:Te,multiline:Pe,type:Oe},ze=useUtilityClasses$1x(Ee),Ve={root:{ownerState:qe},input:{ownerState:qe}},Ge=ke??_e?deepmerge(Ve,ke??_e):Ve,Xe=$e.root??Ce.Root??FilledInputRoot,er=$e.input??Ce.Input??FilledInputInput;return jsxRuntimeExports.jsx(InputBase,{slots:{root:Xe,input:er},slotProps:Ge,fullWidth:Ie,inputComponent:Te,multiline:Pe,ref:xe,type:Oe,...Ue,classes:ze})});FilledInput.muiName="Input";var _span$3;const NotchedOutlineRoot$1=styled("fieldset",{shouldForwardProp:rootShouldForwardProp})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),NotchedOutlineLegend=styled("legend",{shouldForwardProp:rootShouldForwardProp})(memoTheme(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:Ae})=>!Ae.withLabel,style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:({ownerState:Ae})=>Ae.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:Ae})=>Ae.withLabel&&Ae.notched,style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]})));function NotchedOutline(t){const{children:Ae,classes:xe,className:Ee,label:Se,notched:Ce,..._e}=t,Ie=Se!=null&&Se!=="",Be={...t,notched:Ce,withLabel:Ie};return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,{"aria-hidden":!0,className:Ee,ownerState:Be,..._e,children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:Be,children:Ie?jsxRuntimeExports.jsx("span",{children:Se}):_span$3||(_span$3=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}function getOutlinedInputUtilityClass(t){return generateUtilityClass("MuiOutlinedInput",t)}const outlinedInputClasses={...inputBaseClasses,...generateUtilityClasses("MuiOutlinedInput",["root","notchedOutline","input"])},useUtilityClasses$1w=t=>{const{classes:Ae}=t,Ee=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,Ae);return{...Ae,...Ee}},OutlinedInputRoot=styled(InputBaseRoot,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:Ae}},[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([xe])=>({props:{color:xe},style:{[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(t.vars||t).palette[xe].main}}})),{props:{},style:{[`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:({ownerState:xe})=>xe.startAdornment,style:{paddingLeft:14}},{props:({ownerState:xe})=>xe.endAdornment,style:{paddingRight:14}},{props:({ownerState:xe})=>xe.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:xe,size:Ee})=>xe.multiline&&Ee==="small",style:{padding:"8.5px 14px"}}]}})),NotchedOutlineRoot=styled(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,Ae)=>Ae.notchedOutline})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:Ae}})),OutlinedInputInput=styled(InputBaseInput,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(memoTheme(({theme:t})=>({padding:"16.5px 14px",...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:Ae})=>Ae.multiline,style:{padding:0}},{props:({ownerState:Ae})=>Ae.startAdornment,style:{paddingLeft:0}},{props:({ownerState:Ae})=>Ae.endAdornment,style:{paddingRight:0}}]}))),OutlinedInput=reactExports.forwardRef(function(Ae,xe){var Ee;const Se=useDefaultProps({props:Ae,name:"MuiOutlinedInput"}),{components:Ce={},fullWidth:_e=!1,inputComponent:Ie="input",label:Be,multiline:Te=!1,notched:Pe,slots:ke={},type:$e="text",...Oe}=Se,Ue=useUtilityClasses$1w(Se),qe=useFormControl(),ze=formControlState({props:Se,muiFormControl:qe,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),Ve={...Se,color:ze.color||"primary",disabled:ze.disabled,error:ze.error,focused:ze.focused,formControl:qe,fullWidth:_e,hiddenLabel:ze.hiddenLabel,multiline:Te,size:ze.size,type:$e},Ge=ke.root??Ce.Root??OutlinedInputRoot,Xe=ke.input??Ce.Input??OutlinedInputInput;return jsxRuntimeExports.jsx(InputBase,{slots:{root:Ge,input:Xe},renderSuffix:er=>jsxRuntimeExports.jsx(NotchedOutlineRoot,{ownerState:Ve,className:Ue.notchedOutline,label:Be!=null&&Be!==""&&ze.required?Ee||(Ee=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Be," ","*"]})):Be,notched:typeof Pe<"u"?Pe:!!(er.startAdornment||er.filled||er.focused)}),fullWidth:_e,inputComponent:Ie,multiline:Te,ref:xe,type:$e,...Oe,classes:{...Ue,notchedOutline:null}})});OutlinedInput.muiName="Input";function getFormLabelUtilityClasses(t){return generateUtilityClass("MuiFormLabel",t)}const formLabelClasses=generateUtilityClasses("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),useUtilityClasses$1v=t=>{const{classes:Ae,color:xe,focused:Ee,disabled:Se,error:Ce,filled:_e,required:Ie}=t,Be={root:["root",`color${capitalize$1(xe)}`,Se&&"disabled",Ce&&"error",_e&&"filled",Ee&&"focused",Ie&&"required"],asterisk:["asterisk",Ce&&"error"]};return composeClasses(Be,getFormLabelUtilityClasses,Ae)},FormLabelRoot=styled("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.color==="secondary"&&Ae.colorSecondary,xe.filled&&Ae.filled]}})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{color:Ae},style:{[`&.${formLabelClasses.focused}`]:{color:(t.vars||t).palette[Ae].main}}})),{props:{},style:{[`&.${formLabelClasses.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${formLabelClasses.error}`]:{color:(t.vars||t).palette.error.main}}}]}))),AsteriskComponent$1=styled("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,Ae)=>Ae.asterisk})(memoTheme(({theme:t})=>({[`&.${formLabelClasses.error}`]:{color:(t.vars||t).palette.error.main}}))),FormLabel=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormLabel"}),{children:Se,className:Ce,color:_e,component:Ie="label",disabled:Be,error:Te,filled:Pe,focused:ke,required:$e,...Oe}=Ee,Ue=useFormControl(),qe=formControlState({props:Ee,muiFormControl:Ue,states:["color","required","focused","disabled","error","filled"]}),ze={...Ee,color:qe.color||"primary",component:Ie,disabled:qe.disabled,error:qe.error,filled:qe.filled,focused:qe.focused,required:qe.required},Ve=useUtilityClasses$1v(ze);return jsxRuntimeExports.jsxs(FormLabelRoot,{as:Ie,ownerState:ze,className:clsx(Ve.root,Ce),ref:xe,...Oe,children:[Se,qe.required&&jsxRuntimeExports.jsxs(AsteriskComponent$1,{ownerState:ze,"aria-hidden":!0,className:Ve.asterisk,children:[" ","*"]})]})});function getInputLabelUtilityClasses(t){return generateUtilityClass("MuiInputLabel",t)}generateUtilityClasses("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const useUtilityClasses$1u=t=>{const{classes:Ae,formControl:xe,size:Ee,shrink:Se,disableAnimation:Ce,variant:_e,required:Ie}=t,Be={root:["root",xe&&"formControl",!Ce&&"animated",Se&&"shrink",Ee&&Ee!=="normal"&&`size${capitalize$1(Ee)}`,_e],asterisk:[Ie&&"asterisk"]},Te=composeClasses(Be,getInputLabelUtilityClasses,Ae);return{...Ae,...Te}},InputLabelRoot=styled(FormLabel,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`& .${formLabelClasses.asterisk}`]:Ae.asterisk},Ae.root,xe.formControl&&Ae.formControl,xe.size==="small"&&Ae.sizeSmall,xe.shrink&&Ae.shrink,!xe.disableAnimation&&Ae.animated,xe.focused&&Ae.focused,Ae[xe.variant]]}})(memoTheme(({theme:t})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:Ae})=>Ae.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:Ae})=>Ae.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:Ae})=>!Ae.disableAnimation,style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:Ae,ownerState:xe})=>Ae==="filled"&&xe.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:Ae,ownerState:xe,size:Ee})=>Ae==="filled"&&xe.shrink&&Ee==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:Ae,ownerState:xe})=>Ae==="outlined"&&xe.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),InputLabel=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({name:"MuiInputLabel",props:Ae}),{disableAnimation:Se=!1,margin:Ce,shrink:_e,variant:Ie,className:Be,...Te}=Ee,Pe=useFormControl();let ke=_e;typeof ke>"u"&&Pe&&(ke=Pe.filled||Pe.focused||Pe.adornedStart);const $e=formControlState({props:Ee,muiFormControl:Pe,states:["size","variant","required","focused"]}),Oe={...Ee,disableAnimation:Se,formControl:Pe,shrink:ke,size:$e.size,variant:$e.variant,required:$e.required,focused:$e.focused},Ue=useUtilityClasses$1u(Oe);return jsxRuntimeExports.jsx(InputLabelRoot,{"data-shrink":ke,ref:xe,className:clsx(Ue.root,Be),...Te,ownerState:Oe,classes:Ue})});function getFormControlUtilityClasses(t){return generateUtilityClass("MuiFormControl",t)}generateUtilityClasses("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const useUtilityClasses$1t=t=>{const{classes:Ae,margin:xe,fullWidth:Ee}=t,Se={root:["root",xe!=="none"&&`margin${capitalize$1(xe)}`,Ee&&"fullWidth"]};return composeClasses(Se,getFormControlUtilityClasses,Ae)},FormControlRoot=styled("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[`margin${capitalize$1(xe.margin)}`],xe.fullWidth&&Ae.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),FormControl=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormControl"}),{children:Se,className:Ce,color:_e="primary",component:Ie="div",disabled:Be=!1,error:Te=!1,focused:Pe,fullWidth:ke=!1,hiddenLabel:$e=!1,margin:Oe="none",required:Ue=!1,size:qe="medium",variant:ze="outlined",...Ve}=Ee,Ge={...Ee,color:_e,component:Ie,disabled:Be,error:Te,fullWidth:ke,hiddenLabel:$e,margin:Oe,required:Ue,size:qe,variant:ze},Xe=useUtilityClasses$1t(Ge),[er,tr]=reactExports.useState(()=>{let He=!1;return Se&&reactExports.Children.forEach(Se,Qe=>{if(!isMuiElement(Qe,["Input","Select"]))return;const Ye=isMuiElement(Qe,["Select"])?Qe.props.input:Qe;Ye&&isAdornedStart(Ye.props)&&(He=!0)}),He}),[nr,sr]=reactExports.useState(()=>{let He=!1;return Se&&reactExports.Children.forEach(Se,Qe=>{isMuiElement(Qe,["Input","Select"])&&(isFilled(Qe.props,!0)||isFilled(Qe.props.inputProps,!0))&&(He=!0)}),He}),[dr,ar]=reactExports.useState(!1);Be&&dr&&ar(!1);const lr=Pe!==void 0&&!Be?Pe:dr;let Ke;reactExports.useRef(!1);const Me=reactExports.useCallback(()=>{sr(!0)},[]),je=reactExports.useCallback(()=>{sr(!1)},[]),De=reactExports.useMemo(()=>({adornedStart:er,setAdornedStart:tr,color:_e,disabled:Be,error:Te,filled:nr,focused:lr,fullWidth:ke,hiddenLabel:$e,size:qe,onBlur:()=>{ar(!1)},onFocus:()=>{ar(!0)},onEmpty:je,onFilled:Me,registerEffect:Ke,required:Ue,variant:ze}),[er,_e,Be,Te,nr,lr,ke,$e,Ke,je,Me,Ue,qe,ze]);return jsxRuntimeExports.jsx(FormControlContext.Provider,{value:De,children:jsxRuntimeExports.jsx(FormControlRoot,{as:Ie,ownerState:Ge,className:clsx(Xe.root,Ce),ref:xe,...Ve,children:Se})})});function getFormHelperTextUtilityClasses(t){return generateUtilityClass("MuiFormHelperText",t)}const formHelperTextClasses=generateUtilityClasses("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var _span$2;const useUtilityClasses$1s=t=>{const{classes:Ae,contained:xe,size:Ee,disabled:Se,error:Ce,filled:_e,focused:Ie,required:Be}=t,Te={root:["root",Se&&"disabled",Ce&&"error",Ee&&`size${capitalize$1(Ee)}`,xe&&"contained",Ie&&"focused",_e&&"filled",Be&&"required"]};return composeClasses(Te,getFormHelperTextUtilityClasses,Ae)},FormHelperTextRoot=styled("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.size&&Ae[`size${capitalize$1(xe.size)}`],xe.contained&&Ae.contained,xe.filled&&Ae.filled]}})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${formHelperTextClasses.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${formHelperTextClasses.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:Ae})=>Ae.contained,style:{marginLeft:14,marginRight:14}}]}))),FormHelperText=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormHelperText"}),{children:Se,className:Ce,component:_e="p",disabled:Ie,error:Be,filled:Te,focused:Pe,margin:ke,required:$e,variant:Oe,...Ue}=Ee,qe=useFormControl(),ze=formControlState({props:Ee,muiFormControl:qe,states:["variant","size","disabled","error","filled","focused","required"]}),Ve={...Ee,component:_e,contained:ze.variant==="filled"||ze.variant==="outlined",variant:ze.variant,size:ze.size,disabled:ze.disabled,error:ze.error,filled:ze.filled,focused:ze.focused,required:ze.required};delete Ve.ownerState;const Ge=useUtilityClasses$1s(Ve);return jsxRuntimeExports.jsx(FormHelperTextRoot,{as:_e,className:clsx(Ge.root,Ce),ref:xe,...Ue,ownerState:Ve,children:Se===" "?_span$2||(_span$2=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):Se})});function getNativeSelectUtilityClasses(t){return generateUtilityClass("MuiNativeSelect",t)}const nativeSelectClasses=generateUtilityClasses("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),useUtilityClasses$1r=t=>{const{classes:Ae,variant:xe,disabled:Ee,multiple:Se,open:Ce,error:_e}=t,Ie={select:["select",xe,Ee&&"disabled",Se&&"multiple",_e&&"error"],icon:["icon",`icon${capitalize$1(xe)}`,Ce&&"iconOpen",Ee&&"disabled"]};return composeClasses(Ie,getNativeSelectUtilityClasses,Ae)},StyledSelectSelect=styled("select")(({theme:t})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${nativeSelectClasses.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:({ownerState:Ae})=>Ae.variant!=="filled"&&Ae.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]})),NativeSelectSelect=styled(StyledSelectSelect,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp,overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.select,Ae[xe.variant],xe.error&&Ae.error,{[`&.${nativeSelectClasses.multiple}`]:Ae.multiple}]}})({}),StyledSelectIcon=styled("svg")(({theme:t})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${nativeSelectClasses.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:({ownerState:Ae})=>Ae.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),NativeSelectIcon=styled(StyledSelectIcon,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.icon,xe.variant&&Ae[`icon${capitalize$1(xe.variant)}`],xe.open&&Ae.iconOpen]}})({}),NativeSelectInput=reactExports.forwardRef(function(Ae,xe){const{className:Ee,disabled:Se,error:Ce,IconComponent:_e,inputRef:Ie,variant:Be="standard",...Te}=Ae,Pe={...Ae,disabled:Se,variant:Be,error:Ce},ke=useUtilityClasses$1r(Pe);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,{ownerState:Pe,className:clsx(ke.select,Ee),disabled:Se,ref:Ie||xe,...Te}),Ae.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:_e,ownerState:Pe,className:ke.icon})]})});function getSelectUtilityClasses(t){return generateUtilityClass("MuiSelect",t)}const selectClasses=generateUtilityClasses("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var _span$1;const SelectSelect=styled(StyledSelectSelect,{name:"MuiSelect",slot:"Select",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`&.${selectClasses.select}`]:Ae.select},{[`&.${selectClasses.select}`]:Ae[xe.variant]},{[`&.${selectClasses.error}`]:Ae.error},{[`&.${selectClasses.multiple}`]:Ae.multiple}]}})({[`&.${selectClasses.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled(StyledSelectIcon,{name:"MuiSelect",slot:"Icon",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.icon,xe.variant&&Ae[`icon${capitalize$1(xe.variant)}`],xe.open&&Ae.iconOpen]}})({}),SelectNativeInput=styled("input",{shouldForwardProp:t=>slotShouldForwardProp(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,Ae)=>Ae.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues$1(t,Ae){return typeof Ae=="object"&&Ae!==null?t===Ae:String(t)===String(Ae)}function isEmpty(t){return t==null||typeof t=="string"&&!t.trim()}const useUtilityClasses$1q=t=>{const{classes:Ae,variant:xe,disabled:Ee,multiple:Se,open:Ce,error:_e}=t,Ie={select:["select",xe,Ee&&"disabled",Se&&"multiple",_e&&"error"],icon:["icon",`icon${capitalize$1(xe)}`,Ce&&"iconOpen",Ee&&"disabled"],nativeInput:["nativeInput"]};return composeClasses(Ie,getSelectUtilityClasses,Ae)},SelectInput=reactExports.forwardRef(function(Ae,xe){var Kr;const{"aria-describedby":Ee,"aria-label":Se,autoFocus:Ce,autoWidth:_e,children:Ie,className:Be,defaultOpen:Te,defaultValue:Pe,disabled:ke,displayEmpty:$e,error:Oe=!1,IconComponent:Ue,inputRef:qe,labelId:ze,MenuProps:Ve={},multiple:Ge,name:Xe,onBlur:er,onChange:tr,onClose:nr,onFocus:sr,onOpen:dr,open:ar,readOnly:lr,renderValue:Ke,required:Me,SelectDisplayProps:je={},tabIndex:De,type:He,value:Qe,variant:Ye="standard",...St}=Ae,[We,Fe]=useControlled({controlled:Qe,default:Pe,name:"Select"}),[Ze,ir]=useControlled({controlled:ar,default:Te,name:"Select"}),ur=reactExports.useRef(null),fr=reactExports.useRef(null),[Ar,vr]=reactExports.useState(null),{current:xr}=reactExports.useRef(ar!=null),[br,_r]=reactExports.useState(),$r=useForkRef(xe,qe),Fr=reactExports.useCallback(Dr=>{fr.current=Dr,Dr&&vr(Dr)},[]),Ir=Ar==null?void 0:Ar.parentNode;reactExports.useImperativeHandle($r,()=>({focus:()=>{fr.current.focus()},node:ur.current,value:We}),[We]),reactExports.useEffect(()=>{Te&&Ze&&Ar&&!xr&&(_r(_e?null:Ir.clientWidth),fr.current.focus())},[Ar,_e]),reactExports.useEffect(()=>{Ce&&fr.current.focus()},[Ce]),reactExports.useEffect(()=>{if(!ze)return;const Dr=ownerDocument(fr.current).getElementById(ze);if(Dr){const qr=()=>{getSelection().isCollapsed&&fr.current.focus()};return Dr.addEventListener("click",qr),()=>{Dr.removeEventListener("click",qr)}}},[ze]);const zr=(Dr,qr)=>{Dr?dr&&dr(qr):nr&&nr(qr),xr||(_r(_e?null:Ir.clientWidth),ir(Dr))},dn=Dr=>{Dr.button===0&&(Dr.preventDefault(),fr.current.focus(),zr(!0,Dr))},tn=Dr=>{zr(!1,Dr)},Gr=reactExports.Children.toArray(Ie),wn=Dr=>{const qr=Gr.find(Ur=>Ur.props.value===Dr.target.value);qr!==void 0&&(Fe(qr.props.value),tr&&tr(Dr,qr))},an=Dr=>qr=>{let Ur;if(qr.currentTarget.hasAttribute("tabindex")){if(Ge){Ur=Array.isArray(We)?We.slice():[];const Bn=We.indexOf(Dr.props.value);Bn===-1?Ur.push(Dr.props.value):Ur.splice(Bn,1)}else Ur=Dr.props.value;if(Dr.props.onClick&&Dr.props.onClick(qr),We!==Ur&&(Fe(Ur),tr)){const Bn=qr.nativeEvent||qr,In=new Bn.constructor(Bn.type,Bn);Object.defineProperty(In,"target",{writable:!0,value:{value:Ur,name:Xe}}),tr(In,Dr)}Ge||zr(!1,qr)}},Vr=Dr=>{lr||[" ","ArrowUp","ArrowDown","Enter"].includes(Dr.key)&&(Dr.preventDefault(),zr(!0,Dr))},Rn=Ar!==null&&Ze,un=Dr=>{!Rn&&er&&(Object.defineProperty(Dr,"target",{writable:!0,value:{value:We,name:Xe}}),er(Dr))};delete St["aria-invalid"];let sn,jn;const en=[];let Jr=!1;(isFilled({value:We})||$e)&&(Ke?sn=Ke(We):Jr=!0);const nn=Gr.map(Dr=>{if(!reactExports.isValidElement(Dr))return null;let qr;if(Ge){if(!Array.isArray(We))throw new Error(formatMuiErrorMessage(2));qr=We.some(Ur=>areEqualValues$1(Ur,Dr.props.value)),qr&&Jr&&en.push(Dr.props.children)}else qr=areEqualValues$1(We,Dr.props.value),qr&&Jr&&(jn=Dr.props.children);return reactExports.cloneElement(Dr,{"aria-selected":qr?"true":"false",onClick:an(Dr),onKeyUp:Ur=>{Ur.key===" "&&Ur.preventDefault(),Dr.props.onKeyUp&&Dr.props.onKeyUp(Ur)},role:"option",selected:qr,value:void 0,"data-value":Dr.props.value})});Jr&&(Ge?en.length===0?sn=null:sn=en.reduce((Dr,qr,Ur)=>(Dr.push(qr),Ur<en.length-1&&Dr.push(", "),Dr),[]):sn=jn);let rn=br;!_e&&xr&&Ar&&(rn=Ir.clientWidth);let cn;typeof De<"u"?cn=De:cn=ke?null:0;const pn=je.id||(Xe?`mui-component-select-${Xe}`:void 0),Mr={...Ae,variant:Ye,value:We,open:Rn,error:Oe},gr=useUtilityClasses$1q(Mr),Br={...Ve.PaperProps,...(Kr=Ve.slotProps)==null?void 0:Kr.paper},Hr=useId();return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(SelectSelect,{as:"div",ref:Fr,tabIndex:cn,role:"combobox","aria-controls":Rn?Hr:void 0,"aria-disabled":ke?"true":void 0,"aria-expanded":Rn?"true":"false","aria-haspopup":"listbox","aria-label":Se,"aria-labelledby":[ze,pn].filter(Boolean).join(" ")||void 0,"aria-describedby":Ee,"aria-required":Me?"true":void 0,"aria-invalid":Oe?"true":void 0,onKeyDown:Vr,onMouseDown:ke||lr?null:dn,onBlur:un,onFocus:sr,...je,ownerState:Mr,className:clsx(je.className,gr.select,Be),id:pn,children:isEmpty(sn)?_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):sn}),jsxRuntimeExports.jsx(SelectNativeInput,{"aria-invalid":Oe,value:Array.isArray(We)?We.join(","):We,name:Xe,ref:ur,"aria-hidden":!0,onChange:wn,tabIndex:-1,disabled:ke,className:gr.nativeInput,autoFocus:Ce,required:Me,...St,ownerState:Mr}),jsxRuntimeExports.jsx(SelectIcon,{as:Ue,className:gr.icon,ownerState:Mr}),jsxRuntimeExports.jsx(Menu,{id:`menu-${Xe||""}`,anchorEl:Ir,open:Rn,onClose:tn,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...Ve,slotProps:{...Ve.slotProps,list:{"aria-labelledby":ze,role:"listbox","aria-multiselectable":Ge?"true":void 0,disableListWrap:!0,id:Hr,...Ve.MenuListProps},paper:{...Br,style:{minWidth:rn,...Br!=null?Br.style:null}}},children:nn})]})}),ArrowDropDownIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),useUtilityClasses$1p=t=>{const{classes:Ae}=t,Ee=composeClasses({root:["root"]},getSelectUtilityClasses,Ae);return{...Ae,...Ee}},styledRootConfig={name:"MuiSelect",overridesResolver:(t,Ae)=>Ae.root,shouldForwardProp:t=>rootShouldForwardProp(t)&&t!=="variant",slot:"Root"},StyledInput=styled(Input,styledRootConfig)(""),StyledOutlinedInput=styled(OutlinedInput,styledRootConfig)(""),StyledFilledInput=styled(FilledInput,styledRootConfig)(""),Select=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({name:"MuiSelect",props:Ae}),{autoWidth:Se=!1,children:Ce,classes:_e={},className:Ie,defaultOpen:Be=!1,displayEmpty:Te=!1,IconComponent:Pe=ArrowDropDownIcon,id:ke,input:$e,inputProps:Oe,label:Ue,labelId:qe,MenuProps:ze,multiple:Ve=!1,native:Ge=!1,onClose:Xe,onOpen:er,open:tr,renderValue:nr,SelectDisplayProps:sr,variant:dr="outlined",...ar}=Ee,lr=Ge?NativeSelectInput:SelectInput,Ke=useFormControl(),Me=formControlState({props:Ee,muiFormControl:Ke,states:["variant","error"]}),je=Me.variant||dr,De={...Ee,variant:je,classes:_e},He=useUtilityClasses$1p(De),{root:Qe,...Ye}=He,St=$e||{standard:jsxRuntimeExports.jsx(StyledInput,{ownerState:De}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:Ue,ownerState:De}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:De})}[je],We=useForkRef(xe,getReactElementRef(St));return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(St,{inputComponent:lr,inputProps:{children:Ce,error:Me.error,IconComponent:Pe,variant:je,type:void 0,multiple:Ve,...Ge?{id:ke}:{autoWidth:Se,defaultOpen:Be,displayEmpty:Te,labelId:qe,MenuProps:ze,onClose:Xe,onOpen:er,open:tr,renderValue:nr,SelectDisplayProps:{id:ke,...sr}},...Oe,classes:Oe?deepmerge(Ye,Oe.classes):Ye,...$e?$e.props.inputProps:{}},...(Ve&&Ge||Te)&&je==="outlined"?{notched:!0}:{},ref:We,className:clsx(St.props.className,Ie,He.root),...!$e&&{variant:je},...ar})})});Select.muiName="Select";function getTextFieldUtilityClass(t){return generateUtilityClass("MuiTextField",t)}generateUtilityClasses("MuiTextField",["root"]);const variantComponent={standard:Input,filled:FilledInput,outlined:OutlinedInput},useUtilityClasses$1o=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getTextFieldUtilityClass,Ae)},TextFieldRoot=styled(FormControl,{name:"MuiTextField",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({}),TextField=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiTextField"}),{autoComplete:Se,autoFocus:Ce=!1,children:_e,className:Ie,color:Be="primary",defaultValue:Te,disabled:Pe=!1,error:ke=!1,FormHelperTextProps:$e,fullWidth:Oe=!1,helperText:Ue,id:qe,InputLabelProps:ze,inputProps:Ve,InputProps:Ge,inputRef:Xe,label:er,maxRows:tr,minRows:nr,multiline:sr=!1,name:dr,onBlur:ar,onChange:lr,onFocus:Ke,placeholder:Me,required:je=!1,rows:De,select:He=!1,SelectProps:Qe,slots:Ye={},slotProps:St={},type:We,value:Fe,variant:Ze="outlined",...ir}=Ee,ur={...Ee,autoFocus:Ce,color:Be,disabled:Pe,error:ke,fullWidth:Oe,multiline:sr,required:je,select:He,variant:Ze},fr=useUtilityClasses$1o(ur),Ar=useId(qe),vr=Ue&&Ar?`${Ar}-helper-text`:void 0,xr=er&&Ar?`${Ar}-label`:void 0,br=variantComponent[Ze],_r={slots:Ye,slotProps:{input:Ge,inputLabel:ze,htmlInput:Ve,formHelperText:$e,select:Qe,...St}},$r={},Fr=_r.slotProps.inputLabel;Ze==="outlined"&&(Fr&&typeof Fr.shrink<"u"&&($r.notched=Fr.shrink),$r.label=er),He&&((!Qe||!Qe.native)&&($r.id=void 0),$r["aria-describedby"]=void 0);const[Ir,zr]=useSlot("input",{elementType:br,externalForwardedProps:_r,additionalProps:$r,ownerState:ur}),[dn,tn]=useSlot("inputLabel",{elementType:InputLabel,externalForwardedProps:_r,ownerState:ur}),[Gr,wn]=useSlot("htmlInput",{elementType:"input",externalForwardedProps:_r,ownerState:ur}),[an,Vr]=useSlot("formHelperText",{elementType:FormHelperText,externalForwardedProps:_r,ownerState:ur}),[Rn,un]=useSlot("select",{elementType:Select,externalForwardedProps:_r,ownerState:ur}),sn=jsxRuntimeExports.jsx(Ir,{"aria-describedby":vr,autoComplete:Se,autoFocus:Ce,defaultValue:Te,fullWidth:Oe,multiline:sr,name:dr,rows:De,maxRows:tr,minRows:nr,type:We,value:Fe,id:Ar,inputRef:Xe,onBlur:ar,onChange:lr,onFocus:Ke,placeholder:Me,inputProps:wn,slots:{input:Ye.htmlInput?Gr:void 0},...zr});return jsxRuntimeExports.jsxs(TextFieldRoot,{className:clsx(fr.root,Ie),disabled:Pe,error:ke,fullWidth:Oe,ref:xe,required:je,color:Be,variant:Ze,ownerState:ur,...ir,children:[er!=null&&er!==""&&jsxRuntimeExports.jsx(dn,{htmlFor:Ar,id:xr,...tn,children:er}),He?jsxRuntimeExports.jsx(Rn,{"aria-describedby":vr,id:Ar,labelId:xr,value:Fe,input:sn,...un,children:_e}):sn,Ue&&jsxRuntimeExports.jsx(an,{id:vr,...Vr,children:Ue})]})}),StatusIndicator=({status:t})=>{const xe={connected:{color:"success.main",text:"Connected to promptfoo API"},blocked:{color:"error.main",text:"Cannot connect to promptfoo API"},loading:{color:"info.main",text:"Checking connection..."},unknown:{color:"grey.500",text:"Checking connection status..."},disabled:{color:"grey.400",text:"Remote generation is disabled"}}[t];return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(CircleIcon,{sx:{color:xe.color,fontSize:"12px"}}),jsxRuntimeExports.jsx(Typography,{variant:"body2",children:xe.text})]})};function ApiSettingsModal({open:t,onClose:Ae}){const{apiBaseUrl:xe,setApiBaseUrl:Ee,enablePersistApiBaseUrl:Se}=useApiConfig(),[Ce,_e]=reactExports.useState(xe||""),{status:Ie,message:Be,checkHealth:Te,isChecking:Pe}=useApiHealth(),[ke,$e]=reactExports.useState(!1);reactExports.useEffect(()=>{t&&Te()},[t,Te]),reactExports.useEffect(()=>{_e(xe||"")},[xe]);const Oe=ze=>{_e(ze.target.value)},Ue=async()=>{try{$e(!0),Ee(Ce),Se(),await Te(),Ae()}finally{$e(!1)}},qe=Ie==="loading"||Pe||ke;return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ae,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"api-settings-dialog-title",children:[jsxRuntimeExports.jsx(DialogTitle,{id:"api-settings-dialog-title",children:"API and Sharing Settings"}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsxs(Box,{sx:{mb:3},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[jsxRuntimeExports.jsx(StatusIndicator,{status:Ie}),jsxRuntimeExports.jsx(Tooltip$2,{title:"Check connection",children:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(IconButton,{onClick:Te,size:"small",disabled:Pe,children:Pe?jsxRuntimeExports.jsx(CircularProgress,{size:20}):jsxRuntimeExports.jsx(RefreshIcon,{})})})})]}),Be&&Ie!=="unknown"&&Ie!=="loading"&&jsxRuntimeExports.jsx(Alert,{severity:Ie==="connected"?"success":"error",sx:{mt:1},children:Be})]}),jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"API"}),jsxRuntimeExports.jsx(TextField,{label:"API Base URL",helperText:"The promptfoo API the webview will connect to",value:Ce,onChange:Oe,fullWidth:!0,margin:"normal",disabled:qe})]}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Ue,disabled:qe,startIcon:ke&&jsxRuntimeExports.jsx(CircularProgress,{size:20}),children:"Save"}),jsxRuntimeExports.jsx(Button,{onClick:Ae,disabled:qe,children:"Close"})]})]})}const DarkModeIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkMode"),LightModeIcon=createSvgIcon(jsxRuntimeExports.jsx("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"}),"LightMode"),StyledIconButton=styled(IconButton)(({theme:t})=>({padding:8,borderRadius:"50%",transition:t.transitions.create(["background-color","transform"],{duration:t.transitions.duration.standard}),"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",transform:"rotate(15deg)"}})),AnimatedIcon=styled("div")(({theme:t})=>({display:"flex",transition:t.transitions.create(["opacity","transform"],{duration:t.transitions.duration.standard})})),DarkModeToggle=React.memo(({onToggleDarkMode:t})=>{const xe=useTheme().palette.mode==="dark";return jsxRuntimeExports.jsxs(StyledIconButton,{onClick:t,"aria-label":xe?"Switch to light mode":"Switch to dark mode",children:[jsxRuntimeExports.jsx(AnimatedIcon,{sx:{opacity:xe?1:0,transform:xe?"rotate(0deg)":"rotate(-90deg)",position:"absolute"},children:jsxRuntimeExports.jsx(DarkModeIcon,{})}),jsxRuntimeExports.jsx(AnimatedIcon,{sx:{opacity:xe?0:1,transform:xe?"rotate(90deg)":"rotate(0deg)"},children:jsxRuntimeExports.jsx(LightModeIcon,{})})]})});DarkModeToggle.displayName="DarkModeToggle";const BugReportIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z"}),"BugReport"),CalendarTodayIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),ForumIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1m-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1"}),"Forum"),GitHubIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),MenuBookIcon=createSvgIcon([jsxRuntimeExports.jsx("path",{d:"M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1m0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5z"},"0"),jsxRuntimeExports.jsx("path",{d:"M17.5 10.5c.88 0 1.73.09 2.5.26V9.24c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99M13 12.49v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26V11.9c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.3-4.5.83m4.5 1.84c-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26v-1.52c-.79-.16-1.64-.24-2.5-.24"},"1")],"MenuBook"),WorkIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-6 0h-4V4h4z"}),"Work");function getLinkUtilityClass(t){return generateUtilityClass("MuiLink",t)}const linkClasses=generateUtilityClasses("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),getTextDecoration=({theme:t,ownerState:Ae})=>{const xe=Ae.color,Ee=getPath(t,`palette.${xe}.main`,!1)||getPath(t,`palette.${xe}`,!1)||Ae.color,Se=getPath(t,`palette.${xe}.mainChannel`)||getPath(t,`palette.${xe}Channel`);return"vars"in t&&Se?`rgba(${Se} / 0.4)`:alpha$3(Ee,.4)},v6Colors={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},useUtilityClasses$1n=t=>{const{classes:Ae,component:xe,focusVisible:Ee,underline:Se}=t,Ce={root:["root",`underline${capitalize$1(Se)}`,xe==="button"&&"button",Ee&&"focusVisible"]};return composeClasses(Ce,getLinkUtilityClass,Ae)},LinkRoot=styled(Typography,{name:"MuiLink",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[`underline${capitalize$1(xe.underline)}`],xe.component==="button"&&Ae.button]}})(memoTheme(({theme:t})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:Ae,ownerState:xe})=>Ae==="always"&&xe.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{underline:"always",color:Ae},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette[Ae].mainChannel} / 0.4)`:alpha$3(t.palette[Ae].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:alpha$3(t.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.secondaryChannel} / 0.4)`:alpha$3(t.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(t.vars||t).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${linkClasses.focusVisible}`]:{outline:"auto"}}}]}))),Link=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiLink"}),Se=useTheme(),{className:Ce,color:_e="primary",component:Ie="a",onBlur:Be,onFocus:Te,TypographyClasses:Pe,underline:ke="always",variant:$e="inherit",sx:Oe,...Ue}=Ee,[qe,ze]=reactExports.useState(!1),Ve=tr=>{isFocusVisible(tr.target)||ze(!1),Be&&Be(tr)},Ge=tr=>{isFocusVisible(tr.target)&&ze(!0),Te&&Te(tr)},Xe={...Ee,color:_e,component:Ie,focusVisible:qe,underline:ke,variant:$e},er=useUtilityClasses$1n(Xe);return jsxRuntimeExports.jsx(LinkRoot,{color:_e,className:clsx(er.root,Ce),classes:Pe,component:Ie,onBlur:Ve,onFocus:Ge,ref:xe,ownerState:Xe,variant:$e,...Ue,sx:[...v6Colors[_e]===void 0?[{color:_e}]:[],...Array.isArray(Oe)?Oe:[Oe]],style:{...Ue.style,...ke==="always"&&_e!=="inherit"&&!v6Colors[_e]&&{"--Link-underlineColor":getTextDecoration({theme:Se,ownerState:Xe})}}})}),Stack=createStack$1({createStyledComponent:styled("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,Ae)=>Ae.root}),useThemeProps:t=>useDefaultProps({props:t,name:"MuiStack"})}),links=[{icon:jsxRuntimeExports.jsx(MenuBookIcon,{fontSize:"small"}),text:"Documentation",href:"https://www.promptfoo.dev/docs/intro"},{icon:jsxRuntimeExports.jsx(GitHubIcon,{fontSize:"small"}),text:"GitHub Repository",href:"https://github.com/promptfoo/promptfoo"},{icon:jsxRuntimeExports.jsx(BugReportIcon,{fontSize:"small"}),text:"File an Issue",href:"https://github.com/promptfoo/promptfoo/issues"},{icon:jsxRuntimeExports.jsx(ForumIcon,{fontSize:"small"}),text:"Join Our Discord Community",href:"https://discord.gg/promptfoo"},{icon:jsxRuntimeExports.jsx(CalendarTodayIcon,{fontSize:"small"}),text:"Book a Meeting",href:"https://cal.com/team/promptfoo/intro2"},{icon:jsxRuntimeExports.jsx(WorkIcon,{fontSize:"small"}),text:"Careers",href:"https://www.promptfoo.dev/careers/"}];function InfoModal({open:t,onClose:Ae}){return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ae,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"about-promptfoo-dialog-title",children:[jsxRuntimeExports.jsx(DialogTitle,{id:"about-promptfoo-dialog-title",children:jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"About Promptfoo"}),jsxRuntimeExports.jsx(Link,{href:"https://github.com/promptfoo/promptfoo/releases",underline:"none",sx:{color:"inherit"},target:"_blank",children:jsxRuntimeExports.jsxs(Typography,{variant:"subtitle2",children:["Version ","0.112.7"]})})]})}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",gutterBottom:!0,children:"Promptfoo is a MIT licensed open-source tool for evaluating and red-teaming LLMs. We make it easy to track the performance of your models and prompts over time with automated support for dataset generation and grading."}),jsxRuntimeExports.jsx(Stack,{spacing:2,mt:2,children:links.map((xe,Ee)=>jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap","& .MuiSvgIcon-root":{color:"text.primary"}},children:[xe.icon,jsxRuntimeExports.jsx(Link,{underline:"none",target:"_blank",href:xe.href,sx:{color:"inherit"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",children:xe.text})})]},Ee))})]}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:Ae,children:"Close"})})]})}const logoPanda="/assets/logo-panda-BuYvzEyb.svg",LogoWrapper=styled(Box)(({theme:t})=>({display:"inline-flex",alignItems:"center",padding:t.spacing(1,2),perspective:"2000px",transformStyle:"preserve-3d"})),LogoText=styled(Typography)(({theme:t})=>({fontFamily:'"Inter", sans-serif',fontWeight:600,fontSize:"1rem",color:t.palette.text.primary,letterSpacing:"0.02em",marginLeft:t.spacing(1),transition:"all 0.3s ease","@keyframes rainbow":{"0%":{backgroundPosition:"0% 50%"},"50%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0% 50%"}},"&:hover":{color:"transparent",backgroundImage:"linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8f00ff)",backgroundSize:"300% 300%",backgroundClip:"text",WebkitBackgroundClip:"text",animation:"rainbow 3s ease infinite"}})),LogoIcon=styled("img")({width:"25px",height:"auto",transition:"all 1s cubic-bezier(0.68, -0.55, 0.265, 1.55)","@keyframes absoluteMadness":{"0%":{transform:"translateY(0) rotate(0deg) scale(1) translateX(0)",filter:"hue-rotate(0deg) brightness(1)"},"25%":{transform:"translateY(-25px) rotate(360deg) scale(1.5) translateX(15px)",filter:"hue-rotate(180deg) brightness(1.5)"},"50%":{transform:"translateY(0) rotate(720deg) scale(0.5) translateX(-15px)",filter:"hue-rotate(360deg) brightness(2)"},"75%":{transform:"translateY(25px) rotate(1080deg) scale(1.8) translateX(15px)",filter:"hue-rotate(540deg) brightness(1.5)"},"100%":{transform:"translateY(0) rotate(1440deg) scale(1) translateX(0)",filter:"hue-rotate(720deg) brightness(1)"}},"@keyframes vibrate":{"0%, 100%":{transform:"translate(0)"},"10%, 30%, 50%, 70%, 90%":{transform:"translate(-2px, 2px)"},"20%, 40%, 60%, 80%":{transform:"translate(2px, -2px)"}},"&:hover":{animation:"absoluteMadness 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite, vibrate 0.3s linear infinite",filter:"hue-rotate(720deg) brightness(2) contrast(1.5) saturate(300%) drop-shadow(0 0 10px rgba(255,0,0,0.5))"}});function Logo(){return jsxRuntimeExports.jsx(Link$1,{to:"/",style:{textDecoration:"none"},children:jsxRuntimeExports.jsxs(LogoWrapper,{children:[jsxRuntimeExports.jsx(LogoIcon,{src:logoPanda,alt:"Promptfoo Logo"}),jsxRuntimeExports.jsx(LogoText,{variant:"h1",children:"promptfoo"})]})})}const NavButton=styled(Button)(({theme:t})=>({color:t.palette.text.primary,"&:hover":{backgroundColor:t.palette.action.hover},"&.active":{backgroundColor:t.palette.action.selected}})),StyledAppBar=styled(AppBar)(({theme:t})=>({backgroundColor:t.palette.background.paper,color:t.palette.text.primary,boxShadow:t.shadows[1],marginBottom:t.spacing(2)})),NavToolbar=styled(Toolbar)({justifyContent:"space-between"}),NavSection=styled(Box)({display:"flex",alignItems:"center",gap:"1rem"});function NavLink({href:t,label:Ae}){const Ee=useLocation().pathname.startsWith(t);return jsxRuntimeExports.jsx(NavButton,{component:Link$1,to:t,className:Ee?"active":"",children:Ae})}function CreateDropdown(){const[t,Ae]=reactExports.useState(null),xe=!!t,Ee=useLocation(),Se=Ie=>{Ae(Ie.currentTarget)},Ce=()=>{Ae(null)},_e=["/setup","/redteam/setup"].some(Ie=>Ee.pathname.startsWith(Ie));return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(NavButton,{onClick:Se,endIcon:jsxRuntimeExports.jsx(ArrowDropDownIcon$1,{}),className:_e?"active":"",children:"Create"}),jsxRuntimeExports.jsxs(Menu,{anchorEl:t,open:xe,onClose:Ce,PaperProps:{elevation:0,sx:{overflow:"visible",filter:"drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",mt:1.5}},children:[jsxRuntimeExports.jsx(MenuItem,{onClick:Ce,component:Link$1,to:"/setup",children:"Eval"}),jsxRuntimeExports.jsx(MenuItem,{onClick:Ce,component:Link$1,to:"/redteam/setup",children:"Red team"})]})]})}function EvalsDropdown(){const[t,Ae]=reactExports.useState(null),xe=!!t,Ee=useLocation(),Se=Ie=>{Ae(Ie.currentTarget)},Ce=()=>{Ae(null)},_e=["/eval","/evals"].some(Ie=>Ee.pathname.startsWith(Ie));return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(NavButton,{onClick:Se,endIcon:jsxRuntimeExports.jsx(ArrowDropDownIcon$1,{}),className:_e?"active":"",children:"Evals"}),jsxRuntimeExports.jsxs(Menu,{anchorEl:t,open:xe,onClose:Ce,children:[jsxRuntimeExports.jsx(MenuItem,{onClick:Ce,component:Link$1,to:"/eval",children:"Latest Eval"}),jsxRuntimeExports.jsx(MenuItem,{onClick:Ce,component:Link$1,to:"/evals",children:"All Evals"})]})]})}function Navigation({darkMode:t,onToggleDarkMode:Ae}){const[xe,Ee]=reactExports.useState(!1),[Se,Ce]=reactExports.useState(!1),_e=useUIStore(Te=>Te.isNavbarVisible),Ie=()=>Ee(Te=>!Te),Be=()=>Ce(Te=>!Te);return _e?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(StyledAppBar,{position:"static",elevation:0,children:jsxRuntimeExports.jsxs(NavToolbar,{children:[jsxRuntimeExports.jsxs(NavSection,{children:[jsxRuntimeExports.jsx(Logo,{}),jsxRuntimeExports.jsx(CreateDropdown,{}),jsxRuntimeExports.jsx(EvalsDropdown,{}),jsxRuntimeExports.jsx(NavLink,{href:"/prompts",label:"Prompts"}),jsxRuntimeExports.jsx(NavLink,{href:"/datasets",label:"Datasets"}),jsxRuntimeExports.jsx(NavLink,{href:"/history",label:"History"})]}),jsxRuntimeExports.jsxs(NavSection,{children:[jsxRuntimeExports.jsx(IconButton,{onClick:Ie,color:"inherit",children:jsxRuntimeExports.jsx(InfoIcon,{})}),jsxRuntimeExports.jsx(Tooltip$2,{title:"API and Sharing Settings",children:jsxRuntimeExports.jsx(IconButton,{onClick:Be,color:"inherit",children:jsxRuntimeExports.jsx(EngineeringIcon,{})})}),jsxRuntimeExports.jsx(DarkModeToggle,{onToggleDarkMode:Ae})]})]})}),jsxRuntimeExports.jsx(InfoModal,{open:xe,onClose:Ie}),jsxRuntimeExports.jsx(ApiSettingsModal,{open:Se,onClose:Be})]}):null}const useMediaQuery=unstable_createUseMediaQuery({themeId:THEME_ID}),createAppTheme=t=>createTheme({typography:{fontFamily:'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',button:{textTransform:"none",fontWeight:500}},shape:{borderRadius:12},palette:{mode:t?"dark":"light",primary:{main:t?"#3b82f6":"#2563eb",light:t?"#60a5fa":"#3b82f6",dark:t?"#2563eb":"#1d4ed8",contrastText:"#ffffff"},secondary:{main:"#8b5cf6",light:"#a78bfa",dark:"#7c3aed",contrastText:"#ffffff"},background:{default:t?"#121212":"#f8fafc",paper:t?"#1e1e1e":"#ffffff"},text:{primary:t?"#ffffff":"#0f172a",secondary:t?"#a0a0a0":"#475569"}},components:{MuiButton:{styleOverrides:{root:{borderRadius:"8px",textTransform:"none",fontWeight:500,padding:"8px 16px",transition:"all 0.2s ease-in-out","&:hover":{transform:"translateY(-1px)"}},contained:{boxShadow:"none","&:hover":{boxShadow:"0 4px 8px -2px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06)"}}}},MuiCard:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#ffffff",borderRadius:"16px",border:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`,transition:"all 0.2s ease-in-out",boxShadow:t?"none":"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)","&:hover":{boxShadow:t?"0 4px 12px rgba(0, 0, 0, 0.3)":"0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.05)"}}}},MuiTableContainer:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#ffffff",boxShadow:t?"none":"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",borderRadius:"12px",border:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#f8fafc"}}},MuiTableCell:{styleOverrides:{head:{backgroundColor:"inherit",color:t?"#ffffff":"#0f172a",fontWeight:600,fontSize:"0.875rem"},stickyHeader:{backgroundColor:t?"#1e1e1e":"#f8fafc"},root:{borderBottom:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`}}},MuiInputBase:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#ffffff",borderRadius:"8px",transition:"all 0.2s ease-in-out"}}},MuiOutlinedInput:{styleOverrides:{root:{"& .MuiOutlinedInput-notchedOutline":{transition:"all 0.2s ease-in-out"}}}},MuiFormLabel:{styleOverrides:{root:{transition:"color 0.2s ease-in-out","&.Mui-focused":{color:t?"#3b82f6":"#2563eb"}}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#ffffff",boxShadow:"none",borderBottom:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none",backgroundColor:t?"#1e1e1e":"#ffffff",boxShadow:t?"none":"0 1px 2px rgba(0, 0, 0, 0.05)",border:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`,'&[class*="elevation"]':{boxShadow:t?"none":"0 1px 2px rgba(0, 0, 0, 0.05)"}},elevation1:{boxShadow:t?"none":"0 1px 2px rgba(0, 0, 0, 0.05)"},elevation2:{boxShadow:t?"none":"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)"},elevation3:{boxShadow:t?"0 4px 12px rgba(0, 0, 0, 0.3)":"0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.05)"},elevation4:{boxShadow:t?"0 8px 16px rgba(0, 0, 0, 0.4)":"0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}}},MuiDialog:{styleOverrides:{paper:{borderRadius:"16px",boxShadow:t?"0 25px 50px -12px rgba(0, 0, 0, 0.5)":"0 25px 50px -12px rgba(0, 0, 0, 0.25)"}}},MuiSwitch:{styleOverrides:{root:{padding:8},track:{borderRadius:22/2,backgroundColor:t?"#404040":"#cbd5e1"},thumb:{backgroundColor:"#ffffff"}}}}}),lightTheme=createAppTheme(!1),darkTheme=createAppTheme(!0);function Layout({children:t}){return jsxRuntimeExports.jsx("div",{children:t})}function PageShell(){const t=useMediaQuery("(prefers-color-scheme: dark)"),[Ae,xe]=reactExports.useState(null);reactExports.useEffect(()=>{const Se=localStorage.getItem("darkMode");xe(Se===null?t:Se==="true")},[t]);const Ee=reactExports.useCallback(()=>{xe(Se=>{const Ce=!Se;return localStorage.setItem("darkMode",String(Ce)),Ce})},[]);return reactExports.useEffect(()=>{Ae!==null&&(Ae?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))},[Ae]),Ae===null?null:jsxRuntimeExports.jsx(ThemeProvider,{theme:Ae?darkTheme:lightTheme,children:jsxRuntimeExports.jsxs(Layout,{children:[jsxRuntimeExports.jsx(Navigation,{darkMode:Ae,onToggleDarkMode:Ee}),jsxRuntimeExports.jsx(Outlet,{})]})})}function getCollapseUtilityClass(t){return generateUtilityClass("MuiCollapse",t)}generateUtilityClasses("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const useUtilityClasses$1m=t=>{const{orientation:Ae,classes:xe}=t,Ee={root:["root",`${Ae}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${Ae}`],wrapperInner:["wrapperInner",`${Ae}`]};return composeClasses(Ee,getCollapseUtilityClass,xe)},CollapseRoot=styled("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[xe.orientation],xe.state==="entered"&&Ae.entered,xe.state==="exited"&&!xe.in&&xe.collapsedSize==="0px"&&Ae.hidden]}})(memoTheme(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:Ae})=>Ae.state==="exited"&&!Ae.in&&Ae.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),CollapseWrapper=styled("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,Ae)=>Ae.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),CollapseWrapperInner=styled("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,Ae)=>Ae.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Collapse=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiCollapse"}),{addEndListener:Se,children:Ce,className:_e,collapsedSize:Ie="0px",component:Be,easing:Te,in:Pe,onEnter:ke,onEntered:$e,onEntering:Oe,onExit:Ue,onExited:qe,onExiting:ze,orientation:Ve="vertical",style:Ge,timeout:Xe=duration$1.standard,TransitionComponent:er=Transition,...tr}=Ee,nr={...Ee,orientation:Ve,collapsedSize:Ie},sr=useUtilityClasses$1m(nr),dr=useTheme(),ar=useTimeout(),lr=reactExports.useRef(null),Ke=reactExports.useRef(),Me=typeof Ie=="number"?`${Ie}px`:Ie,je=Ve==="horizontal",De=je?"width":"height",He=reactExports.useRef(null),Qe=useForkRef(xe,He),Ye=vr=>xr=>{if(vr){const br=He.current;xr===void 0?vr(br):vr(br,xr)}},St=()=>lr.current?lr.current[je?"clientWidth":"clientHeight"]:0,We=Ye((vr,xr)=>{lr.current&&je&&(lr.current.style.position="absolute"),vr.style[De]=Me,ke&&ke(vr,xr)}),Fe=Ye((vr,xr)=>{const br=St();lr.current&&je&&(lr.current.style.position="");const{duration:_r,easing:$r}=getTransitionProps({style:Ge,timeout:Xe,easing:Te},{mode:"enter"});if(Xe==="auto"){const Fr=dr.transitions.getAutoHeightDuration(br);vr.style.transitionDuration=`${Fr}ms`,Ke.current=Fr}else vr.style.transitionDuration=typeof _r=="string"?_r:`${_r}ms`;vr.style[De]=`${br}px`,vr.style.transitionTimingFunction=$r,Oe&&Oe(vr,xr)}),Ze=Ye((vr,xr)=>{vr.style[De]="auto",$e&&$e(vr,xr)}),ir=Ye(vr=>{vr.style[De]=`${St()}px`,Ue&&Ue(vr)}),ur=Ye(qe),fr=Ye(vr=>{const xr=St(),{duration:br,easing:_r}=getTransitionProps({style:Ge,timeout:Xe,easing:Te},{mode:"exit"});if(Xe==="auto"){const $r=dr.transitions.getAutoHeightDuration(xr);vr.style.transitionDuration=`${$r}ms`,Ke.current=$r}else vr.style.transitionDuration=typeof br=="string"?br:`${br}ms`;vr.style[De]=Me,vr.style.transitionTimingFunction=_r,ze&&ze(vr)}),Ar=vr=>{Xe==="auto"&&ar.start(Ke.current||0,vr),Se&&Se(He.current,vr)};return jsxRuntimeExports.jsx(er,{in:Pe,onEnter:We,onEntered:Ze,onEntering:Fe,onExit:ir,onExited:ur,onExiting:fr,addEndListener:Ar,nodeRef:He,timeout:Xe==="auto"?null:Xe,...tr,children:(vr,{ownerState:xr,...br})=>jsxRuntimeExports.jsx(CollapseRoot,{as:Be,className:clsx(sr.root,_e,{entered:sr.entered,exited:!Pe&&Me==="0px"&&sr.hidden}[vr]),style:{[je?"minWidth":"minHeight"]:Me,...Ge},ref:Qe,ownerState:{...nr,state:vr},...br,children:jsxRuntimeExports.jsx(CollapseWrapper,{ownerState:{...nr,state:vr},className:sr.wrapper,ref:lr,children:jsxRuntimeExports.jsx(CollapseWrapperInner,{ownerState:{...nr,state:vr},className:sr.wrapperInner,children:Ce})})})})});Collapse&&(Collapse.muiSupportAuto=!0);const AccordionContext=reactExports.createContext({});function getAccordionUtilityClass(t){return generateUtilityClass("MuiAccordion",t)}const accordionClasses=generateUtilityClasses("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),useUtilityClasses$1l=t=>{const{classes:Ae,square:xe,expanded:Ee,disabled:Se,disableGutters:Ce}=t;return composeClasses({root:["root",!xe&&"rounded",Ee&&"expanded",Se&&"disabled",!Ce&&"gutters"],heading:["heading"],region:["region"]},getAccordionUtilityClass,Ae)},AccordionRoot=styled(Paper,{name:"MuiAccordion",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`& .${accordionClasses.region}`]:Ae.region},Ae.root,!xe.square&&Ae.rounded,!xe.disableGutters&&Ae.gutters]}})(memoTheme(({theme:t})=>{const Ae={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],Ae),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],Ae)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${accordionClasses.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${accordionClasses.disabled}`]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}}),memoTheme(({theme:t})=>({variants:[{props:Ae=>!Ae.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:Ae=>!Ae.disableGutters,style:{[`&.${accordionClasses.expanded}`]:{margin:"16px 0"}}}]}))),AccordionHeading=styled("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(t,Ae)=>Ae.heading})({all:"unset"}),Accordion=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiAccordion"}),{children:Se,className:Ce,defaultExpanded:_e=!1,disabled:Ie=!1,disableGutters:Be=!1,expanded:Te,onChange:Pe,square:ke=!1,slots:$e={},slotProps:Oe={},TransitionComponent:Ue,TransitionProps:qe,...ze}=Ee,[Ve,Ge]=useControlled({controlled:Te,default:_e,name:"Accordion",state:"expanded"}),Xe=reactExports.useCallback(Qe=>{Ge(!Ve),Pe&&Pe(Qe,!Ve)},[Ve,Pe,Ge]),[er,...tr]=reactExports.Children.toArray(Se),nr=reactExports.useMemo(()=>({expanded:Ve,disabled:Ie,disableGutters:Be,toggle:Xe}),[Ve,Ie,Be,Xe]),sr={...Ee,square:ke,disabled:Ie,disableGutters:Be,expanded:Ve},dr=useUtilityClasses$1l(sr),ar={transition:Ue,...$e},lr={transition:qe,...Oe},Ke={slots:ar,slotProps:lr},[Me,je]=useSlot("heading",{elementType:AccordionHeading,externalForwardedProps:Ke,className:dr.heading,ownerState:sr}),[De,He]=useSlot("transition",{elementType:Collapse,externalForwardedProps:Ke,ownerState:sr});return jsxRuntimeExports.jsxs(AccordionRoot,{className:clsx(dr.root,Ce),ref:xe,ownerState:sr,square:ke,...ze,children:[jsxRuntimeExports.jsx(Me,{...je,children:jsxRuntimeExports.jsx(AccordionContext.Provider,{value:nr,children:er})}),jsxRuntimeExports.jsx(De,{in:Ve,timeout:"auto",...He,children:jsxRuntimeExports.jsx("div",{"aria-labelledby":er.props.id,id:er.props["aria-controls"],role:"region",className:dr.region,children:tr})})]})});function getAccordionDetailsUtilityClass(t){return generateUtilityClass("MuiAccordionDetails",t)}generateUtilityClasses("MuiAccordionDetails",["root"]);const useUtilityClasses$1k=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getAccordionDetailsUtilityClass,Ae)},AccordionDetailsRoot=styled("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})(memoTheme(({theme:t})=>({padding:t.spacing(1,2,2)}))),AccordionDetails=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiAccordionDetails"}),{className:Se,...Ce}=Ee,_e=Ee,Ie=useUtilityClasses$1k(_e);return jsxRuntimeExports.jsx(AccordionDetailsRoot,{className:clsx(Ie.root,Se),ref:xe,ownerState:_e,...Ce})});function getAccordionSummaryUtilityClass(t){return generateUtilityClass("MuiAccordionSummary",t)}const accordionSummaryClasses=generateUtilityClasses("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),useUtilityClasses$1j=t=>{const{classes:Ae,expanded:xe,disabled:Ee,disableGutters:Se}=t;return composeClasses({root:["root",xe&&"expanded",Ee&&"disabled",!Se&&"gutters"],focusVisible:["focusVisible"],content:["content",xe&&"expanded",!Se&&"contentGutters"],expandIconWrapper:["expandIconWrapper",xe&&"expanded"]},getAccordionSummaryUtilityClass,Ae)},AccordionSummaryRoot=styled(ButtonBase,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})(memoTheme(({theme:t})=>{const Ae={duration:t.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],Ae),[`&.${accordionSummaryClasses.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${accordionSummaryClasses.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`&:hover:not(.${accordionSummaryClasses.disabled})`]:{cursor:"pointer"},variants:[{props:xe=>!xe.disableGutters,style:{[`&.${accordionSummaryClasses.expanded}`]:{minHeight:64}}}]}})),AccordionSummaryContent=styled("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(t,Ae)=>Ae.content})(memoTheme(({theme:t})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:Ae=>!Ae.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),[`&.${accordionSummaryClasses.expanded}`]:{margin:"20px 0"}}}]}))),AccordionSummaryExpandIconWrapper=styled("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(t,Ae)=>Ae.expandIconWrapper})(memoTheme(({theme:t})=>({display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),[`&.${accordionSummaryClasses.expanded}`]:{transform:"rotate(180deg)"}}))),AccordionSummary=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiAccordionSummary"}),{children:Se,className:Ce,expandIcon:_e,focusVisibleClassName:Ie,onClick:Be,...Te}=Ee,{disabled:Pe=!1,disableGutters:ke,expanded:$e,toggle:Oe}=reactExports.useContext(AccordionContext),Ue=Ve=>{Oe&&Oe(Ve),Be&&Be(Ve)},qe={...Ee,expanded:$e,disabled:Pe,disableGutters:ke},ze=useUtilityClasses$1j(qe);return jsxRuntimeExports.jsxs(AccordionSummaryRoot,{focusRipple:!1,disableRipple:!0,disabled:Pe,"aria-expanded":$e,className:clsx(ze.root,Ce),focusVisibleClassName:clsx(ze.focusVisible,Ie),onClick:Ue,ref:xe,ownerState:qe,...Te,children:[jsxRuntimeExports.jsx(AccordionSummaryContent,{className:ze.content,ownerState:qe,children:Se}),_e&&jsxRuntimeExports.jsx(AccordionSummaryExpandIconWrapper,{className:ze.expandIconWrapper,ownerState:qe,children:_e})]})});function stripDiacritics(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function createFilterOptions(t={}){const{ignoreAccents:Ae=!0,ignoreCase:xe=!0,limit:Ee,matchFrom:Se="any",stringify:Ce,trim:_e=!1}=t;return(Ie,{inputValue:Be,getOptionLabel:Te})=>{let Pe=_e?Be.trim():Be;xe&&(Pe=Pe.toLowerCase()),Ae&&(Pe=stripDiacritics(Pe));const ke=Pe?Ie.filter($e=>{let Oe=(Ce||Te)($e);return xe&&(Oe=Oe.toLowerCase()),Ae&&(Oe=stripDiacritics(Oe)),Se==="start"?Oe.startsWith(Pe):Oe.includes(Pe)}):Ie;return typeof Ee=="number"?ke.slice(0,Ee):ke}}const defaultFilterOptions=createFilterOptions(),pageSize=5,defaultIsActiveElementInListbox=t=>{var Ae;return t.current!==null&&((Ae=t.current.parentElement)==null?void 0:Ae.contains(document.activeElement))},MULTIPLE_DEFAULT_VALUE=[];function getInputValue$1(t,Ae,xe){if(Ae||t==null)return"";const Ee=xe(t);return typeof Ee=="string"?Ee:""}function useAutocomplete(t){const{unstable_isActiveElementInListbox:Ae=defaultIsActiveElementInListbox,unstable_classNamePrefix:xe="Mui",autoComplete:Ee=!1,autoHighlight:Se=!1,autoSelect:Ce=!1,blurOnSelect:_e=!1,clearOnBlur:Ie=!t.freeSolo,clearOnEscape:Be=!1,componentName:Te="useAutocomplete",defaultValue:Pe=t.multiple?MULTIPLE_DEFAULT_VALUE:null,disableClearable:ke=!1,disableCloseOnSelect:$e=!1,disabled:Oe,disabledItemsFocusable:Ue=!1,disableListWrap:qe=!1,filterOptions:ze=defaultFilterOptions,filterSelectedOptions:Ve=!1,freeSolo:Ge=!1,getOptionDisabled:Xe,getOptionKey:er,getOptionLabel:tr=zn=>zn.label??zn,groupBy:nr,handleHomeEndKeys:sr=!t.freeSolo,id:dr,includeInputInList:ar=!1,inputValue:lr,isOptionEqualToValue:Ke=(zn,Gn)=>zn===Gn,multiple:Me=!1,onChange:je,onClose:De,onHighlightChange:He,onInputChange:Qe,onOpen:Ye,open:St,openOnFocus:We=!1,options:Fe,readOnly:Ze=!1,selectOnFocus:ir=!t.freeSolo,value:ur}=t,fr=useId(dr);let Ar=tr;Ar=zn=>{const Gn=tr(zn);return typeof Gn!="string"?String(Gn):Gn};const vr=reactExports.useRef(!1),xr=reactExports.useRef(!0),br=reactExports.useRef(null),_r=reactExports.useRef(null),[$r,Fr]=reactExports.useState(null),[Ir,zr]=reactExports.useState(-1),dn=Se?0:-1,tn=reactExports.useRef(dn),Gr=reactExports.useRef(getInputValue$1(Pe,Me,Ar)).current,[wn,an]=useControlled({controlled:ur,default:Pe,name:Te}),[Vr,Rn]=useControlled({controlled:lr,default:Gr,name:Te,state:"inputValue"}),[un,sn]=reactExports.useState(!1),jn=reactExports.useCallback((zn,Gn,di)=>{if(!(Me?wn.length<Gn.length:Gn!==null)&&!Ie)return;const Ei=getInputValue$1(Gn,Me,Ar);Vr!==Ei&&(Rn(Ei),Qe&&Qe(zn,Ei,di))},[Ar,Vr,Me,Qe,Rn,Ie,wn]),[en,Jr]=useControlled({controlled:St,default:!1,name:Te,state:"open"}),[nn,rn]=reactExports.useState(!0),cn=!Me&&wn!=null&&Vr===Ar(wn),pn=en&&!Ze,Mr=pn?ze(Fe.filter(zn=>!(Ve&&(Me?wn:[wn]).some(Gn=>Gn!==null&&Ke(zn,Gn)))),{inputValue:cn&&nn?"":Vr,getOptionLabel:Ar}):[],gr=usePreviousProps({filteredOptions:Mr,value:wn,inputValue:Vr});reactExports.useEffect(()=>{const zn=wn!==gr.value;un&&!zn||Ge&&!zn||jn(null,wn,"reset")},[wn,jn,un,gr.value,Ge]);const Br=en&&Mr.length>0&&!Ze,Hr=useEventCallback(zn=>{zn===-1?br.current.focus():$r.querySelector(`[data-tag-index="${zn}"]`).focus()});reactExports.useEffect(()=>{Me&&Ir>wn.length-1&&(zr(-1),Hr(-1))},[wn,Me,Ir,Hr]);function Kr(zn,Gn){if(!_r.current||zn<0||zn>=Mr.length)return-1;let di=zn;for(;;){const hi=_r.current.querySelector(`[data-option-index="${di}"]`),Ei=Ue?!1:!hi||hi.disabled||hi.getAttribute("aria-disabled")==="true";if(hi&&hi.hasAttribute("tabindex")&&!Ei)return di;if(Gn==="next"?di=(di+1)%Mr.length:di=(di-1+Mr.length)%Mr.length,di===zn)return-1}}const Dr=useEventCallback(({event:zn,index:Gn,reason:di="auto"})=>{if(tn.current=Gn,Gn===-1?br.current.removeAttribute("aria-activedescendant"):br.current.setAttribute("aria-activedescendant",`${fr}-option-${Gn}`),He&&He(zn,Gn===-1?null:Mr[Gn],di),!_r.current)return;const hi=_r.current.querySelector(`[role="option"].${xe}-focused`);hi&&(hi.classList.remove(`${xe}-focused`),hi.classList.remove(`${xe}-focusVisible`));let Ei=_r.current;if(_r.current.getAttribute("role")!=="listbox"&&(Ei=_r.current.parentElement.querySelector('[role="listbox"]')),!Ei)return;if(Gn===-1){Ei.scrollTop=0;return}const _i=_r.current.querySelector(`[data-option-index="${Gn}"]`);if(_i&&(_i.classList.add(`${xe}-focused`),di==="keyboard"&&_i.classList.add(`${xe}-focusVisible`),Ei.scrollHeight>Ei.clientHeight&&di!=="mouse"&&di!=="touch")){const Mi=_i,ji=Ei.clientHeight+Ei.scrollTop,no=Mi.offsetTop+Mi.offsetHeight;no>ji?Ei.scrollTop=no-Ei.clientHeight:Mi.offsetTop-Mi.offsetHeight*(nr?1.3:0)<Ei.scrollTop&&(Ei.scrollTop=Mi.offsetTop-Mi.offsetHeight*(nr?1.3:0))}}),qr=useEventCallback(({event:zn,diff:Gn,direction:di="next",reason:hi="auto"})=>{if(!pn)return;const _i=Kr((()=>{const Mi=Mr.length-1;if(Gn==="reset")return dn;if(Gn==="start")return 0;if(Gn==="end")return Mi;const ji=tn.current+Gn;return ji<0?ji===-1&&ar?-1:qe&&tn.current!==-1||Math.abs(Gn)>1?0:Mi:ji>Mi?ji===Mi+1&&ar?-1:qe||Math.abs(Gn)>1?Mi:0:ji})(),di);if(Dr({index:_i,reason:hi,event:zn}),Ee&&Gn!=="reset")if(_i===-1)br.current.value=Vr;else{const Mi=Ar(Mr[_i]);br.current.value=Mi,Mi.toLowerCase().indexOf(Vr.toLowerCase())===0&&Vr.length>0&&br.current.setSelectionRange(Vr.length,Mi.length)}}),Ur=()=>{const zn=(Gn,di)=>{const hi=Gn?Ar(Gn):"",Ei=di?Ar(di):"";return hi===Ei};if(tn.current!==-1&&gr.filteredOptions&&gr.filteredOptions.length!==Mr.length&&gr.inputValue===Vr&&(Me?wn.length===gr.value.length&&gr.value.every((Gn,di)=>Ar(wn[di])===Ar(Gn)):zn(gr.value,wn))){const Gn=gr.filteredOptions[tn.current];if(Gn)return Mr.findIndex(di=>Ar(di)===Ar(Gn))}return-1},Bn=reactExports.useCallback(()=>{if(!pn)return;const zn=Ur();if(zn!==-1){tn.current=zn;return}const Gn=Me?wn[0]:wn;if(Mr.length===0||Gn==null){qr({diff:"reset"});return}if(_r.current){if(Gn!=null){const di=Mr[tn.current];if(Me&&di&&wn.findIndex(Ei=>Ke(di,Ei))!==-1)return;const hi=Mr.findIndex(Ei=>Ke(Ei,Gn));hi===-1?qr({diff:"reset"}):Dr({index:hi});return}if(tn.current>=Mr.length-1){Dr({index:Mr.length-1});return}Dr({index:tn.current})}},[Mr.length,Me?!1:wn,Ve,qr,Dr,pn,Vr,Me]),In=useEventCallback(zn=>{setRef(_r,zn),zn&&Bn()});reactExports.useEffect(()=>{Bn()},[Bn]);const Rr=zn=>{en||(Jr(!0),rn(!0),Ye&&Ye(zn))},Mn=(zn,Gn)=>{en&&(Jr(!1),De&&De(zn,Gn))},En=(zn,Gn,di,hi)=>{if(Me){if(wn.length===Gn.length&&wn.every((Ei,_i)=>Ei===Gn[_i]))return}else if(wn===Gn)return;je&&je(zn,Gn,di,hi),an(Gn)},Yr=reactExports.useRef(!1),Sn=(zn,Gn,di="selectOption",hi="options")=>{let Ei=di,_i=Gn;if(Me){_i=Array.isArray(wn)?wn.slice():[];const Mi=_i.findIndex(ji=>Ke(Gn,ji));Mi===-1?_i.push(Gn):hi!=="freeSolo"&&(_i.splice(Mi,1),Ei="removeOption")}jn(zn,_i,Ei),En(zn,_i,Ei,{option:Gn}),!$e&&(!zn||!zn.ctrlKey&&!zn.metaKey)&&Mn(zn,Ei),(_e===!0||_e==="touch"&&Yr.current||_e==="mouse"&&!Yr.current)&&br.current.blur()};function yn(zn,Gn){if(zn===-1)return-1;let di=zn;for(;;){if(Gn==="next"&&di===wn.length||Gn==="previous"&&di===-1)return-1;const hi=$r.querySelector(`[data-tag-index="${di}"]`);if(!hi||!hi.hasAttribute("tabindex")||hi.disabled||hi.getAttribute("aria-disabled")==="true")di+=Gn==="next"?1:-1;else return di}}const On=(zn,Gn)=>{if(!Me)return;Vr===""&&Mn(zn,"toggleInput");let di=Ir;Ir===-1?Vr===""&&Gn==="previous"&&(di=wn.length-1):(di+=Gn==="next"?1:-1,di<0&&(di=0),di===wn.length&&(di=-1)),di=yn(di,Gn),zr(di),Hr(di)},Nn=zn=>{vr.current=!0,Rn(""),Qe&&Qe(zn,"","clear"),En(zn,Me?[]:null,"clear")},kr=zn=>Gn=>{if(zn.onKeyDown&&zn.onKeyDown(Gn),!Gn.defaultMuiPrevented&&(Ir!==-1&&!["ArrowLeft","ArrowRight"].includes(Gn.key)&&(zr(-1),Hr(-1)),Gn.which!==229))switch(Gn.key){case"Home":pn&&sr&&(Gn.preventDefault(),qr({diff:"start",direction:"next",reason:"keyboard",event:Gn}));break;case"End":pn&&sr&&(Gn.preventDefault(),qr({diff:"end",direction:"previous",reason:"keyboard",event:Gn}));break;case"PageUp":Gn.preventDefault(),qr({diff:-5,direction:"previous",reason:"keyboard",event:Gn}),Rr(Gn);break;case"PageDown":Gn.preventDefault(),qr({diff:pageSize,direction:"next",reason:"keyboard",event:Gn}),Rr(Gn);break;case"ArrowDown":Gn.preventDefault(),qr({diff:1,direction:"next",reason:"keyboard",event:Gn}),Rr(Gn);break;case"ArrowUp":Gn.preventDefault(),qr({diff:-1,direction:"previous",reason:"keyboard",event:Gn}),Rr(Gn);break;case"ArrowLeft":On(Gn,"previous");break;case"ArrowRight":On(Gn,"next");break;case"Enter":if(tn.current!==-1&&pn){const di=Mr[tn.current],hi=Xe?Xe(di):!1;if(Gn.preventDefault(),hi)return;Sn(Gn,di,"selectOption"),Ee&&br.current.setSelectionRange(br.current.value.length,br.current.value.length)}else Ge&&Vr!==""&&cn===!1&&(Me&&Gn.preventDefault(),Sn(Gn,Vr,"createOption","freeSolo"));break;case"Escape":pn?(Gn.preventDefault(),Gn.stopPropagation(),Mn(Gn,"escape")):Be&&(Vr!==""||Me&&wn.length>0)&&(Gn.preventDefault(),Gn.stopPropagation(),Nn(Gn));break;case"Backspace":if(Me&&!Ze&&Vr===""&&wn.length>0){const di=Ir===-1?wn.length-1:Ir,hi=wn.slice();hi.splice(di,1),En(Gn,hi,"removeOption",{option:wn[di]})}break;case"Delete":if(Me&&!Ze&&Vr===""&&wn.length>0&&Ir!==-1){const di=Ir,hi=wn.slice();hi.splice(di,1),En(Gn,hi,"removeOption",{option:wn[di]})}break}},Er=zn=>{sn(!0),We&&!vr.current&&Rr(zn)},Tr=zn=>{if(Ae(_r)){br.current.focus();return}sn(!1),xr.current=!0,vr.current=!1,Ce&&tn.current!==-1&&pn?Sn(zn,Mr[tn.current],"blur"):Ce&&Ge&&Vr!==""?Sn(zn,Vr,"blur","freeSolo"):Ie&&jn(zn,wn,"blur"),Mn(zn,"blur")},Qr=zn=>{const Gn=zn.target.value;Vr!==Gn&&(Rn(Gn),rn(!1),Qe&&Qe(zn,Gn,"input")),Gn===""?!ke&&!Me&&En(zn,null,"clear"):Rr(zn)},Zr=zn=>{const Gn=Number(zn.currentTarget.getAttribute("data-option-index"));tn.current!==Gn&&Dr({event:zn,index:Gn,reason:"mouse"})},xn=zn=>{Dr({event:zn,index:Number(zn.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Yr.current=!0},An=zn=>{const Gn=Number(zn.currentTarget.getAttribute("data-option-index"));Sn(zn,Mr[Gn],"selectOption"),Yr.current=!1},Tn=zn=>Gn=>{const di=wn.slice();di.splice(zn,1),En(Gn,di,"removeOption",{option:wn[zn]})},ti=zn=>{en?Mn(zn,"toggleInput"):Rr(zn)},Fn=zn=>{zn.currentTarget.contains(zn.target)&&zn.target.getAttribute("id")!==fr&&zn.preventDefault()},$n=zn=>{zn.currentTarget.contains(zn.target)&&(br.current.focus(),ir&&xr.current&&br.current.selectionEnd-br.current.selectionStart===0&&br.current.select(),xr.current=!1)},Zn=zn=>{!Oe&&(Vr===""||!en)&&ti(zn)};let Dn=Ge&&Vr.length>0;Dn=Dn||(Me?wn.length>0:wn!==null);let Wn=Mr;return nr&&(Wn=Mr.reduce((zn,Gn,di)=>{const hi=nr(Gn);return zn.length>0&&zn[zn.length-1].group===hi?zn[zn.length-1].options.push(Gn):zn.push({key:di,index:di,group:hi,options:[Gn]}),zn},[])),Oe&&un&&Tr(),{getRootProps:(zn={})=>({...zn,onKeyDown:kr(zn),onMouseDown:Fn,onClick:$n}),getInputLabelProps:()=>({id:`${fr}-label`,htmlFor:fr}),getInputProps:()=>({id:fr,value:Vr,onBlur:Tr,onFocus:Er,onChange:Qr,onMouseDown:Zn,"aria-activedescendant":pn?"":null,"aria-autocomplete":Ee?"both":"list","aria-controls":Br?`${fr}-listbox`:void 0,"aria-expanded":Br,autoComplete:"off",ref:br,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:Oe}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Nn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:ti}),getTagProps:({index:zn})=>({key:zn,"data-tag-index":zn,tabIndex:-1,...!Ze&&{onDelete:Tn(zn)}}),getListboxProps:()=>({role:"listbox",id:`${fr}-listbox`,"aria-labelledby":`${fr}-label`,ref:In,onMouseDown:zn=>{zn.preventDefault()}}),getOptionProps:({index:zn,option:Gn})=>{const di=(Me?wn:[wn]).some(Ei=>Ei!=null&&Ke(Gn,Ei)),hi=Xe?Xe(Gn):!1;return{key:(er==null?void 0:er(Gn))??Ar(Gn),tabIndex:-1,role:"option",id:`${fr}-option-${zn}`,onMouseMove:Zr,onClick:An,onTouchStart:xn,"data-option-index":zn,"aria-disabled":hi,"aria-selected":di}},id:fr,inputValue:Vr,value:wn,dirty:Dn,expanded:pn&&$r,popupOpen:pn,focused:un||Ir!==-1,anchorEl:$r,setAnchorEl:Fr,focusedTag:Ir,groupedOptions:Wn}}function getListSubheaderUtilityClass(t){return generateUtilityClass("MuiListSubheader",t)}generateUtilityClasses("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const useUtilityClasses$1i=t=>{const{classes:Ae,color:xe,disableGutters:Ee,inset:Se,disableSticky:Ce}=t,_e={root:["root",xe!=="default"&&`color${capitalize$1(xe)}`,!Ee&&"gutters",Se&&"inset",!Ce&&"sticky"]};return composeClasses(_e,getListSubheaderUtilityClass,Ae)},ListSubheaderRoot=styled("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.color!=="default"&&Ae[`color${capitalize$1(xe.color)}`],!xe.disableGutters&&Ae.gutters,xe.inset&&Ae.inset,!xe.disableSticky&&Ae.sticky]}})(memoTheme(({theme:t})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(t.vars||t).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:Ae})=>!Ae.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:Ae})=>Ae.inset,style:{paddingLeft:72}},{props:({ownerState:Ae})=>!Ae.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper}}]}))),ListSubheader=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiListSubheader"}),{className:Se,color:Ce="default",component:_e="li",disableGutters:Ie=!1,disableSticky:Be=!1,inset:Te=!1,...Pe}=Ee,ke={...Ee,color:Ce,component:_e,disableGutters:Ie,disableSticky:Be,inset:Te},$e=useUtilityClasses$1i(ke);return jsxRuntimeExports.jsx(ListSubheaderRoot,{as:_e,className:clsx($e.root,Se),ref:xe,ownerState:ke,...Pe})});ListSubheader&&(ListSubheader.muiSkipListHighlight=!0);const CancelIcon$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function getChipUtilityClass(t){return generateUtilityClass("MuiChip",t)}const chipClasses=generateUtilityClasses("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),useUtilityClasses$1h=t=>{const{classes:Ae,disabled:xe,size:Ee,color:Se,iconColor:Ce,onDelete:_e,clickable:Ie,variant:Be}=t,Te={root:["root",Be,xe&&"disabled",`size${capitalize$1(Ee)}`,`color${capitalize$1(Se)}`,Ie&&"clickable",Ie&&`clickableColor${capitalize$1(Se)}`,_e&&"deletable",_e&&`deletableColor${capitalize$1(Se)}`,`${Be}${capitalize$1(Se)}`],label:["label",`label${capitalize$1(Ee)}`],avatar:["avatar",`avatar${capitalize$1(Ee)}`,`avatarColor${capitalize$1(Se)}`],icon:["icon",`icon${capitalize$1(Ee)}`,`iconColor${capitalize$1(Ce)}`],deleteIcon:["deleteIcon",`deleteIcon${capitalize$1(Ee)}`,`deleteIconColor${capitalize$1(Se)}`,`deleteIcon${capitalize$1(Be)}Color${capitalize$1(Se)}`]};return composeClasses(Te,getChipUtilityClass,Ae)},ChipRoot=styled("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t,{color:Ee,iconColor:Se,clickable:Ce,onDelete:_e,size:Ie,variant:Be}=xe;return[{[`& .${chipClasses.avatar}`]:Ae.avatar},{[`& .${chipClasses.avatar}`]:Ae[`avatar${capitalize$1(Ie)}`]},{[`& .${chipClasses.avatar}`]:Ae[`avatarColor${capitalize$1(Ee)}`]},{[`& .${chipClasses.icon}`]:Ae.icon},{[`& .${chipClasses.icon}`]:Ae[`icon${capitalize$1(Ie)}`]},{[`& .${chipClasses.icon}`]:Ae[`iconColor${capitalize$1(Se)}`]},{[`& .${chipClasses.deleteIcon}`]:Ae.deleteIcon},{[`& .${chipClasses.deleteIcon}`]:Ae[`deleteIcon${capitalize$1(Ie)}`]},{[`& .${chipClasses.deleteIcon}`]:Ae[`deleteIconColor${capitalize$1(Ee)}`]},{[`& .${chipClasses.deleteIcon}`]:Ae[`deleteIcon${capitalize$1(Be)}Color${capitalize$1(Ee)}`]},Ae.root,Ae[`size${capitalize$1(Ie)}`],Ae[`color${capitalize$1(Ee)}`],Ce&&Ae.clickable,Ce&&Ee!=="default"&&Ae[`clickableColor${capitalize$1(Ee)})`],_e&&Ae.deletable,_e&&Ee!=="default"&&Ae[`deletableColor${capitalize$1(Ee)}`],Ae[Be],Ae[`${Be}${capitalize$1(Ee)}`]]}})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return{maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${chipClasses.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${chipClasses.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:Ae,fontSize:t.typography.pxToRem(12)},[`& .${chipClasses.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${chipClasses.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${chipClasses.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${chipClasses.icon}`]:{marginLeft:5,marginRight:-6},[`& .${chipClasses.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:alpha$3(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:alpha$3(t.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${chipClasses.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${chipClasses.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["contrastText"])).map(([xe])=>({props:{color:xe},style:{backgroundColor:(t.vars||t).palette[xe].main,color:(t.vars||t).palette[xe].contrastText,[`& .${chipClasses.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[xe].contrastTextChannel} / 0.7)`:alpha$3(t.palette[xe].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[xe].contrastText}}}})),{props:xe=>xe.iconColor===xe.color,style:{[`& .${chipClasses.icon}`]:{color:t.vars?t.vars.palette.Chip.defaultIconColor:Ae}}},{props:xe=>xe.iconColor===xe.color&&xe.color!=="default",style:{[`& .${chipClasses.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${chipClasses.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:alpha$3(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["dark"])).map(([xe])=>({props:{color:xe,onDelete:!0},style:{[`&.${chipClasses.focusVisible}`]:{background:(t.vars||t).palette[xe].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:alpha$3(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${chipClasses.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:alpha$3(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["dark"])).map(([xe])=>({props:{color:xe,clickable:!0},style:{[`&:hover, &.${chipClasses.focusVisible}`]:{backgroundColor:(t.vars||t).palette[xe].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${chipClasses.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${chipClasses.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${chipClasses.avatar}`]:{marginLeft:4},[`& .${chipClasses.avatarSmall}`]:{marginLeft:2},[`& .${chipClasses.icon}`]:{marginLeft:4},[`& .${chipClasses.iconSmall}`]:{marginLeft:2},[`& .${chipClasses.deleteIcon}`]:{marginRight:5},[`& .${chipClasses.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([xe])=>({props:{variant:"outlined",color:xe},style:{color:(t.vars||t).palette[xe].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[xe].mainChannel} / 0.7)`:alpha$3(t.palette[xe].main,.7)}`,[`&.${chipClasses.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[xe].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette[xe].main,t.palette.action.hoverOpacity)},[`&.${chipClasses.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[xe].mainChannel} / ${t.vars.palette.action.focusOpacity})`:alpha$3(t.palette[xe].main,t.palette.action.focusOpacity)},[`& .${chipClasses.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[xe].mainChannel} / 0.7)`:alpha$3(t.palette[xe].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[xe].main}}}}))]}})),ChipLabel=styled("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t,{size:Ee}=xe;return[Ae.label,Ae[`label${capitalize$1(Ee)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function isDeleteKeyboardEvent(t){return t.key==="Backspace"||t.key==="Delete"}const Chip=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiChip"}),{avatar:Se,className:Ce,clickable:_e,color:Ie="default",component:Be,deleteIcon:Te,disabled:Pe=!1,icon:ke,label:$e,onClick:Oe,onDelete:Ue,onKeyDown:qe,onKeyUp:ze,size:Ve="medium",variant:Ge="filled",tabIndex:Xe,skipFocusWhenDisabled:er=!1,...tr}=Ee,nr=reactExports.useRef(null),sr=useForkRef(nr,xe),dr=We=>{We.stopPropagation(),Ue&&Ue(We)},ar=We=>{We.currentTarget===We.target&&isDeleteKeyboardEvent(We)&&We.preventDefault(),qe&&qe(We)},lr=We=>{We.currentTarget===We.target&&Ue&&isDeleteKeyboardEvent(We)&&Ue(We),ze&&ze(We)},Ke=_e!==!1&&Oe?!0:_e,Me=Ke||Ue?ButtonBase:Be||"div",je={...Ee,component:Me,disabled:Pe,size:Ve,color:Ie,iconColor:reactExports.isValidElement(ke)&&ke.props.color||Ie,onDelete:!!Ue,clickable:Ke,variant:Ge},De=useUtilityClasses$1h(je),He=Me===ButtonBase?{component:Be||"div",focusVisibleClassName:De.focusVisible,...Ue&&{disableRipple:!0}}:{};let Qe=null;Ue&&(Qe=Te&&reactExports.isValidElement(Te)?reactExports.cloneElement(Te,{className:clsx(Te.props.className,De.deleteIcon),onClick:dr}):jsxRuntimeExports.jsx(CancelIcon$1,{className:clsx(De.deleteIcon),onClick:dr}));let Ye=null;Se&&reactExports.isValidElement(Se)&&(Ye=reactExports.cloneElement(Se,{className:clsx(De.avatar,Se.props.className)}));let St=null;return ke&&reactExports.isValidElement(ke)&&(St=reactExports.cloneElement(ke,{className:clsx(De.icon,ke.props.className)})),jsxRuntimeExports.jsxs(ChipRoot,{as:Me,className:clsx(De.root,Ce),disabled:Ke&&Pe?!0:void 0,onClick:Oe,onKeyDown:ar,onKeyUp:lr,ref:sr,tabIndex:er&&Pe?-1:Xe,ownerState:je,...He,...tr,children:[Ye||St,jsxRuntimeExports.jsx(ChipLabel,{className:clsx(De.label),ownerState:je,children:$e}),Qe]})});function getAutocompleteUtilityClass(t){return generateUtilityClass("MuiAutocomplete",t)}const autocompleteClasses=generateUtilityClasses("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var _ClearIcon,_ArrowDropDownIcon;const useUtilityClasses$1g=t=>{const{classes:Ae,disablePortal:xe,expanded:Ee,focused:Se,fullWidth:Ce,hasClearIcon:_e,hasPopupIcon:Ie,inputFocused:Be,popupOpen:Te,size:Pe}=t,ke={root:["root",Ee&&"expanded",Se&&"focused",Ce&&"fullWidth",_e&&"hasClearIcon",Ie&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",Be&&"inputFocused"],tag:["tag",`tagSize${capitalize$1(Pe)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",Te&&"popupIndicatorOpen"],popper:["popper",xe&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return composeClasses(ke,getAutocompleteUtilityClass,Ae)},AutocompleteRoot=styled("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t,{fullWidth:Ee,hasClearIcon:Se,hasPopupIcon:Ce,inputFocused:_e,size:Ie}=xe;return[{[`& .${autocompleteClasses.tag}`]:Ae.tag},{[`& .${autocompleteClasses.tag}`]:Ae[`tagSize${capitalize$1(Ie)}`]},{[`& .${autocompleteClasses.inputRoot}`]:Ae.inputRoot},{[`& .${autocompleteClasses.input}`]:Ae.input},{[`& .${autocompleteClasses.input}`]:_e&&Ae.inputFocused},Ae.root,Ee&&Ae.fullWidth,Ce&&Ae.hasPopupIcon,Se&&Ae.hasClearIcon]}})({[`&.${autocompleteClasses.focused} .${autocompleteClasses.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${autocompleteClasses.clearIndicator}`]:{visibility:"visible"}},[`& .${autocompleteClasses.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${autocompleteClasses.inputRoot}`]:{[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:30},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:56},[`& .${autocompleteClasses.input}`]:{width:0,minWidth:30}},[`& .${inputClasses.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${inputClasses.root}.${inputBaseClasses.sizeSmall}`]:{[`& .${inputClasses.input}`]:{padding:"2px 4px 3px 0"}},[`& .${outlinedInputClasses.root}`]:{padding:9,[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:39},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:65},[`& .${autocompleteClasses.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${autocompleteClasses.endAdornment}`]:{right:9}},[`& .${outlinedInputClasses.root}.${inputBaseClasses.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${autocompleteClasses.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${filledInputClasses.root}`]:{paddingTop:19,paddingLeft:8,[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:39},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:65},[`& .${filledInputClasses.input}`]:{padding:"7px 4px"},[`& .${autocompleteClasses.endAdornment}`]:{right:9}},[`& .${filledInputClasses.root}.${inputBaseClasses.sizeSmall}`]:{paddingBottom:1,[`& .${filledInputClasses.input}`]:{padding:"2.5px 4px"}},[`& .${inputBaseClasses.hiddenLabel}`]:{paddingTop:8},[`& .${filledInputClasses.root}.${inputBaseClasses.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${autocompleteClasses.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${filledInputClasses.root}.${inputBaseClasses.hiddenLabel}.${inputBaseClasses.sizeSmall}`]:{[`& .${autocompleteClasses.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${autocompleteClasses.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${autocompleteClasses.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${autocompleteClasses.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${autocompleteClasses.inputRoot}`]:{flexWrap:"wrap"}}}]}),AutocompleteEndAdornment=styled("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,Ae)=>Ae.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),AutocompleteClearIndicator=styled(IconButton,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,Ae)=>Ae.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),AutocompletePopupIndicator=styled(IconButton,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.popupIndicator,xe.popupOpen&&Ae.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),AutocompletePopper=styled(Popper,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`& .${autocompleteClasses.option}`]:Ae.option},Ae.popper,xe.disablePortal&&Ae.popperDisablePortal]}})(memoTheme(({theme:t})=>({zIndex:(t.vars||t).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),AutocompletePaper=styled(Paper,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,Ae)=>Ae.paper})(memoTheme(({theme:t})=>({...t.typography.body1,overflow:"auto"}))),AutocompleteLoading=styled("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,Ae)=>Ae.loading})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}))),AutocompleteNoOptions=styled("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,Ae)=>Ae.noOptions})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}))),AutocompleteListbox=styled("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,Ae)=>Ae.listbox})(memoTheme(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${autocompleteClasses.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${autocompleteClasses.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${autocompleteClasses.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${autocompleteClasses.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${autocompleteClasses.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}}))),AutocompleteGroupLabel=styled(ListSubheader,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,Ae)=>Ae.groupLabel})(memoTheme(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8}))),AutocompleteGroupUl=styled("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,Ae)=>Ae.groupUl})({padding:0,[`& .${autocompleteClasses.option}`]:{paddingLeft:24}}),Autocomplete=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiAutocomplete"}),{autoComplete:Se=!1,autoHighlight:Ce=!1,autoSelect:_e=!1,blurOnSelect:Ie=!1,ChipProps:Be,className:Te,clearIcon:Pe=_ClearIcon||(_ClearIcon=jsxRuntimeExports.jsx(ClearIcon$1,{fontSize:"small"})),clearOnBlur:ke=!Ee.freeSolo,clearOnEscape:$e=!1,clearText:Oe="Clear",closeText:Ue="Close",componentsProps:qe,defaultValue:ze=Ee.multiple?[]:null,disableClearable:Ve=!1,disableCloseOnSelect:Ge=!1,disabled:Xe=!1,disabledItemsFocusable:er=!1,disableListWrap:tr=!1,disablePortal:nr=!1,filterOptions:sr,filterSelectedOptions:dr=!1,forcePopupIcon:ar="auto",freeSolo:lr=!1,fullWidth:Ke=!1,getLimitTagsText:Me=yi=>`+${yi}`,getOptionDisabled:je,getOptionKey:De,getOptionLabel:He,isOptionEqualToValue:Qe,groupBy:Ye,handleHomeEndKeys:St=!Ee.freeSolo,id:We,includeInputInList:Fe=!1,inputValue:Ze,limitTags:ir=-1,ListboxComponent:ur,ListboxProps:fr,loading:Ar=!1,loadingText:vr="Loading…",multiple:xr=!1,noOptionsText:br="No options",onChange:_r,onClose:$r,onHighlightChange:Fr,onInputChange:Ir,onOpen:zr,open:dn,openOnFocus:tn=!1,openText:Gr="Open",options:wn,PaperComponent:an,PopperComponent:Vr,popupIcon:Rn=_ArrowDropDownIcon||(_ArrowDropDownIcon=jsxRuntimeExports.jsx(ArrowDropDownIcon,{})),readOnly:un=!1,renderGroup:sn,renderInput:jn,renderOption:en,renderTags:Jr,selectOnFocus:nn=!Ee.freeSolo,size:rn="medium",slots:cn={},slotProps:pn={},value:Mr,...gr}=Ee,{getRootProps:Br,getInputProps:Hr,getInputLabelProps:Kr,getPopupIndicatorProps:Dr,getClearProps:qr,getTagProps:Ur,getListboxProps:Bn,getOptionProps:In,value:Rr,dirty:Mn,expanded:En,id:Yr,popupOpen:Sn,focused:yn,focusedTag:On,anchorEl:Nn,setAnchorEl:kr,inputValue:Er,groupedOptions:Tr}=useAutocomplete({...Ee,componentName:"Autocomplete"}),Qr=!Ve&&!Xe&&Mn&&!un,Zr=(!lr||ar===!0)&&ar!==!1,{onMouseDown:xn}=Hr(),{ref:An,...Tn}=Bn(),Fn=He||(yi=>yi.label??yi),$n={...Ee,disablePortal:nr,expanded:En,focused:yn,fullWidth:Ke,getOptionLabel:Fn,hasClearIcon:Qr,hasPopupIcon:Zr,inputFocused:On===-1,popupOpen:Sn,size:rn},Zn=useUtilityClasses$1g($n),Dn={slots:{paper:an,popper:Vr,...cn},slotProps:{chip:Be,listbox:fr,...qe,...pn}},[Wn,zn]=useSlot("listbox",{elementType:AutocompleteListbox,externalForwardedProps:Dn,ownerState:$n,className:Zn.listbox,additionalProps:Tn,ref:An}),[Gn,di]=useSlot("paper",{elementType:Paper,externalForwardedProps:Dn,ownerState:$n,className:Zn.paper}),[hi,Ei]=useSlot("popper",{elementType:Popper,externalForwardedProps:Dn,ownerState:$n,className:Zn.popper,additionalProps:{disablePortal:nr,style:{width:Nn?Nn.clientWidth:null},role:"presentation",anchorEl:Nn,open:Sn}});let _i;if(xr&&Rr.length>0){const yi=Di=>({className:Zn.tag,disabled:Xe,...Ur(Di)});Jr?_i=Jr(Rr,yi,$n):_i=Rr.map((Di,Hi)=>{const{key:Wi,...Ki}=yi({index:Hi});return jsxRuntimeExports.jsx(Chip,{label:Fn(Di),size:rn,...Ki,...Dn.slotProps.chip},Wi)})}if(ir>-1&&Array.isArray(_i)){const yi=_i.length-ir;!yn&&yi>0&&(_i=_i.splice(0,ir),_i.push(jsxRuntimeExports.jsx("span",{className:Zn.tag,children:Me(yi)},_i.length)))}const ji=sn||(yi=>jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx(AutocompleteGroupLabel,{className:Zn.groupLabel,ownerState:$n,component:"div",children:yi.group}),jsxRuntimeExports.jsx(AutocompleteGroupUl,{className:Zn.groupUl,ownerState:$n,children:yi.children})]},yi.key)),Li=en||((yi,Di)=>{const{key:Hi,...Wi}=yi;return jsxRuntimeExports.jsx("li",{...Wi,children:Fn(Di)},Hi)}),oo=(yi,Di)=>{const Hi=In({option:yi,index:Di});return Li({...Hi,className:Zn.option},yi,{selected:Hi["aria-selected"],index:Di,inputValue:Er},$n)},Vi=Dn.slotProps.clearIndicator,eo=Dn.slotProps.popupIndicator;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(AutocompleteRoot,{ref:xe,className:clsx(Zn.root,Te),ownerState:$n,...Br(gr),children:jn({id:Yr,disabled:Xe,fullWidth:!0,size:rn==="small"?"small":void 0,InputLabelProps:Kr(),InputProps:{ref:kr,className:Zn.inputRoot,startAdornment:_i,onMouseDown:yi=>{yi.target===yi.currentTarget&&xn(yi)},...(Qr||Zr)&&{endAdornment:jsxRuntimeExports.jsxs(AutocompleteEndAdornment,{className:Zn.endAdornment,ownerState:$n,children:[Qr?jsxRuntimeExports.jsx(AutocompleteClearIndicator,{...qr(),"aria-label":Oe,title:Oe,ownerState:$n,...Vi,className:clsx(Zn.clearIndicator,Vi==null?void 0:Vi.className),children:Pe}):null,Zr?jsxRuntimeExports.jsx(AutocompletePopupIndicator,{...Dr(),disabled:Xe,"aria-label":Sn?Ue:Gr,title:Sn?Ue:Gr,ownerState:$n,...eo,className:clsx(Zn.popupIndicator,eo==null?void 0:eo.className),children:Rn}):null]})}},inputProps:{className:Zn.input,disabled:Xe,readOnly:un,...Hr()}})}),Nn?jsxRuntimeExports.jsx(AutocompletePopper,{as:hi,...Ei,children:jsxRuntimeExports.jsxs(AutocompletePaper,{as:Gn,...di,children:[Ar&&Tr.length===0?jsxRuntimeExports.jsx(AutocompleteLoading,{className:Zn.loading,ownerState:$n,children:vr}):null,Tr.length===0&&!lr&&!Ar?jsxRuntimeExports.jsx(AutocompleteNoOptions,{className:Zn.noOptions,ownerState:$n,role:"presentation",onMouseDown:yi=>{yi.preventDefault()},children:br}):null,Tr.length>0?jsxRuntimeExports.jsx(Wn,{as:ur,...zn,children:Tr.map((yi,Di)=>Ye?ji({key:yi.key,group:yi.group,children:yi.options.map((Hi,Wi)=>oo(Hi,yi.index+Wi))}):oo(yi,Di))}):null]})}):null]})});function useBadge(t){const{badgeContent:Ae,invisible:xe=!1,max:Ee=99,showZero:Se=!1}=t,Ce=usePreviousProps({badgeContent:Ae,max:Ee});let _e=xe;xe===!1&&Ae===0&&!Se&&(_e=!0);const{badgeContent:Ie,max:Be=Ee}=_e?Ce:t,Te=Ie&&Number(Ie)>Be?`${Be}+`:Ie;return{badgeContent:Ie,invisible:_e,max:Be,displayValue:Te}}function getBadgeUtilityClass(t){return generateUtilityClass("MuiBadge",t)}const badgeClasses=generateUtilityClasses("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),RADIUS_STANDARD=10,RADIUS_DOT=4,useUtilityClasses$1f=t=>{const{color:Ae,anchorOrigin:xe,invisible:Ee,overlap:Se,variant:Ce,classes:_e={}}=t,Ie={root:["root"],badge:["badge",Ce,Ee&&"invisible",`anchorOrigin${capitalize$1(xe.vertical)}${capitalize$1(xe.horizontal)}`,`anchorOrigin${capitalize$1(xe.vertical)}${capitalize$1(xe.horizontal)}${capitalize$1(Se)}`,`overlap${capitalize$1(Se)}`,Ae!=="default"&&`color${capitalize$1(Ae)}`]};return composeClasses(Ie,getBadgeUtilityClass,_e)},BadgeRoot=styled("span",{name:"MuiBadge",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),BadgeBadge=styled("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.badge,Ae[xe.variant],Ae[`anchorOrigin${capitalize$1(xe.anchorOrigin.vertical)}${capitalize$1(xe.anchorOrigin.horizontal)}${capitalize$1(xe.overlap)}`],xe.color!=="default"&&Ae[`color${capitalize$1(xe.color)}`],xe.invisible&&Ae.invisible]}})(memoTheme(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(12),minWidth:RADIUS_STANDARD*2,lineHeight:1,padding:"0 6px",height:RADIUS_STANDARD*2,borderRadius:RADIUS_STANDARD,zIndex:1,transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.enteringScreen}),variants:[...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["contrastText"])).map(([Ae])=>({props:{color:Ae},style:{backgroundColor:(t.vars||t).palette[Ae].main,color:(t.vars||t).palette[Ae].contrastText}})),{props:{variant:"dot"},style:{borderRadius:RADIUS_DOT,height:RADIUS_DOT*2,minWidth:RADIUS_DOT*2,padding:0}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="top"&&Ae.anchorOrigin.horizontal==="right"&&Ae.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="bottom"&&Ae.anchorOrigin.horizontal==="right"&&Ae.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="top"&&Ae.anchorOrigin.horizontal==="left"&&Ae.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="bottom"&&Ae.anchorOrigin.horizontal==="left"&&Ae.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="top"&&Ae.anchorOrigin.horizontal==="right"&&Ae.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="bottom"&&Ae.anchorOrigin.horizontal==="right"&&Ae.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="top"&&Ae.anchorOrigin.horizontal==="left"&&Ae.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="bottom"&&Ae.anchorOrigin.horizontal==="left"&&Ae.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.leavingScreen})}}]})));function getAnchorOrigin(t){return{vertical:(t==null?void 0:t.vertical)??"top",horizontal:(t==null?void 0:t.horizontal)??"right"}}const Badge=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiBadge"}),{anchorOrigin:Se,className:Ce,classes:_e,component:Ie,components:Be={},componentsProps:Te={},children:Pe,overlap:ke="rectangular",color:$e="default",invisible:Oe=!1,max:Ue=99,badgeContent:qe,slots:ze,slotProps:Ve,showZero:Ge=!1,variant:Xe="standard",...er}=Ee,{badgeContent:tr,invisible:nr,max:sr,displayValue:dr}=useBadge({max:Ue,invisible:Oe,badgeContent:qe,showZero:Ge}),ar=usePreviousProps({anchorOrigin:getAnchorOrigin(Se),color:$e,overlap:ke,variant:Xe,badgeContent:qe}),lr=nr||tr==null&&Xe!=="dot",{color:Ke=$e,overlap:Me=ke,anchorOrigin:je,variant:De=Xe}=lr?ar:Ee,He=getAnchorOrigin(je),Qe=De!=="dot"?dr:void 0,Ye={...Ee,badgeContent:tr,invisible:lr,max:sr,displayValue:Qe,showZero:Ge,anchorOrigin:He,color:Ke,overlap:Me,variant:De},St=useUtilityClasses$1f(Ye),We=(ze==null?void 0:ze.root)??Be.Root??BadgeRoot,Fe=(ze==null?void 0:ze.badge)??Be.Badge??BadgeBadge,Ze=(Ve==null?void 0:Ve.root)??Te.root,ir=(Ve==null?void 0:Ve.badge)??Te.badge,ur=useSlotProps({elementType:We,externalSlotProps:Ze,externalForwardedProps:er,additionalProps:{ref:xe,as:Ie},ownerState:Ye,className:clsx(Ze==null?void 0:Ze.className,St.root,Ce)}),fr=useSlotProps({elementType:Fe,externalSlotProps:ir,ownerState:Ye,className:clsx(St.badge,ir==null?void 0:ir.className)});return jsxRuntimeExports.jsxs(We,{...ur,children:[Pe,jsxRuntimeExports.jsx(Fe,{...fr,children:Qe})]})});function getCardUtilityClass(t){return generateUtilityClass("MuiCard",t)}generateUtilityClasses("MuiCard",["root"]);const useUtilityClasses$1e=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getCardUtilityClass,Ae)},CardRoot=styled(Paper,{name:"MuiCard",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({overflow:"hidden"}),Card=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiCard"}),{className:Se,raised:Ce=!1,..._e}=Ee,Ie={...Ee,raised:Ce},Be=useUtilityClasses$1e(Ie);return jsxRuntimeExports.jsx(CardRoot,{className:clsx(Be.root,Se),elevation:Ce?8:void 0,ref:xe,ownerState:Ie,..._e})});function getCardContentUtilityClass(t){return generateUtilityClass("MuiCardContent",t)}generateUtilityClasses("MuiCardContent",["root"]);const useUtilityClasses$1d=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getCardContentUtilityClass,Ae)},CardContentRoot=styled("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({padding:16,"&:last-child":{paddingBottom:24}}),CardContent=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiCardContent"}),{className:Se,component:Ce="div",..._e}=Ee,Ie={...Ee,component:Ce},Be=useUtilityClasses$1d(Ie);return jsxRuntimeExports.jsx(CardContentRoot,{as:Ce,className:clsx(Be.root,Se),ownerState:Ie,ref:xe,..._e})});function getSwitchBaseUtilityClass(t){return generateUtilityClass("PrivateSwitchBase",t)}generateUtilityClasses("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const useUtilityClasses$1c=t=>{const{classes:Ae,checked:xe,disabled:Ee,edge:Se}=t,Ce={root:["root",xe&&"checked",Ee&&"disabled",Se&&`edge${capitalize$1(Se)}`],input:["input"]};return composeClasses(Ce,getSwitchBaseUtilityClass,Ae)},SwitchBaseRoot=styled(ButtonBase)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:t,ownerState:Ae})=>t==="start"&&Ae.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:t,ownerState:Ae})=>t==="end"&&Ae.size!=="small",style:{marginRight:-12}}]}),SwitchBaseInput=styled("input",{shouldForwardProp:rootShouldForwardProp})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),SwitchBase=reactExports.forwardRef(function(Ae,xe){const{autoFocus:Ee,checked:Se,checkedIcon:Ce,defaultChecked:_e,disabled:Ie,disableFocusRipple:Be=!1,edge:Te=!1,icon:Pe,id:ke,inputProps:$e,inputRef:Oe,name:Ue,onBlur:qe,onChange:ze,onFocus:Ve,readOnly:Ge,required:Xe=!1,tabIndex:er,type:tr,value:nr,slots:sr={},slotProps:dr={},...ar}=Ae,[lr,Ke]=useControlled({controlled:Se,default:!!_e,name:"SwitchBase",state:"checked"}),Me=useFormControl(),je=Ar=>{Ve&&Ve(Ar),Me&&Me.onFocus&&Me.onFocus(Ar)},De=Ar=>{qe&&qe(Ar),Me&&Me.onBlur&&Me.onBlur(Ar)},He=Ar=>{if(Ar.nativeEvent.defaultPrevented)return;const vr=Ar.target.checked;Ke(vr),ze&&ze(Ar,vr)};let Qe=Ie;Me&&typeof Qe>"u"&&(Qe=Me.disabled);const Ye=tr==="checkbox"||tr==="radio",St={...Ae,checked:lr,disabled:Qe,disableFocusRipple:Be,edge:Te},We=useUtilityClasses$1c(St),Fe={slots:sr,slotProps:{input:$e,...dr}},[Ze,ir]=useSlot("root",{ref:xe,elementType:SwitchBaseRoot,className:We.root,shouldForwardComponentProp:!0,externalForwardedProps:{...Fe,component:"span",...ar},getSlotProps:Ar=>({...Ar,onFocus:vr=>{var xr;(xr=Ar.onFocus)==null||xr.call(Ar,vr),je(vr)},onBlur:vr=>{var xr;(xr=Ar.onBlur)==null||xr.call(Ar,vr),De(vr)}}),ownerState:St,additionalProps:{centerRipple:!0,focusRipple:!Be,disabled:Qe,role:void 0,tabIndex:null}}),[ur,fr]=useSlot("input",{ref:Oe,elementType:SwitchBaseInput,className:We.input,externalForwardedProps:Fe,getSlotProps:Ar=>({onChange:vr=>{var xr;(xr=Ar.onChange)==null||xr.call(Ar,vr),He(vr)}}),ownerState:St,additionalProps:{autoFocus:Ee,checked:Se,defaultChecked:_e,disabled:Qe,id:Ye?ke:void 0,name:Ue,readOnly:Ge,required:Xe,tabIndex:er,type:tr,...tr==="checkbox"&&nr===void 0?{}:{value:nr}}});return jsxRuntimeExports.jsxs(Ze,{...ir,children:[jsxRuntimeExports.jsx(ur,{...fr}),lr?Ce:Pe]})}),CheckBoxOutlineBlankIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),CheckBoxIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),IndeterminateCheckBoxIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function getCheckboxUtilityClass(t){return generateUtilityClass("MuiCheckbox",t)}const checkboxClasses=generateUtilityClasses("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),useUtilityClasses$1b=t=>{const{classes:Ae,indeterminate:xe,color:Ee,size:Se}=t,Ce={root:["root",xe&&"indeterminate",`color${capitalize$1(Ee)}`,`size${capitalize$1(Se)}`]},_e=composeClasses(Ce,getCheckboxUtilityClass,Ae);return{...Ae,..._e}},CheckboxRoot=styled(SwitchBase,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.indeterminate&&Ae.indeterminate,Ae[`size${capitalize$1(xe.size)}`],xe.color!=="default"&&Ae[`color${capitalize$1(xe.color)}`]]}})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{color:Ae,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[Ae].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette[Ae].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{color:Ae},style:{[`&.${checkboxClasses.checked}, &.${checkboxClasses.indeterminate}`]:{color:(t.vars||t).palette[Ae].main},[`&.${checkboxClasses.disabled}`]:{color:(t.vars||t).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),defaultCheckedIcon$1=jsxRuntimeExports.jsx(CheckBoxIcon,{}),defaultIcon$1=jsxRuntimeExports.jsx(CheckBoxOutlineBlankIcon,{}),defaultIndeterminateIcon=jsxRuntimeExports.jsx(IndeterminateCheckBoxIcon,{}),Checkbox=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiCheckbox"}),{checkedIcon:Se=defaultCheckedIcon$1,color:Ce="primary",icon:_e=defaultIcon$1,indeterminate:Ie=!1,indeterminateIcon:Be=defaultIndeterminateIcon,inputProps:Te,size:Pe="medium",disableRipple:ke=!1,className:$e,slots:Oe={},slotProps:Ue={},...qe}=Ee,ze=Ie?Be:_e,Ve=Ie?Be:Se,Ge={...Ee,disableRipple:ke,color:Ce,indeterminate:Ie,size:Pe},Xe=useUtilityClasses$1b(Ge),er=Ue.input??Te,[tr,nr]=useSlot("root",{ref:xe,elementType:CheckboxRoot,className:clsx(Xe.root,$e),shouldForwardComponentProp:!0,externalForwardedProps:{slots:Oe,slotProps:Ue,...qe},ownerState:Ge,additionalProps:{type:"checkbox",icon:reactExports.cloneElement(ze,{fontSize:ze.props.fontSize??Pe}),checkedIcon:reactExports.cloneElement(Ve,{fontSize:Ve.props.fontSize??Pe}),disableRipple:ke,slots:Oe,slotProps:{input:mergeSlotProps(typeof er=="function"?er(Ge):er,{"data-indeterminate":Ie})}}});return jsxRuntimeExports.jsx(tr,{...nr,classes:Xe})});function mapEventPropToEvent(t){return t.substring(2).toLowerCase()}function clickedRootScrollbar(t,Ae){return Ae.documentElement.clientWidth<t.clientX||Ae.documentElement.clientHeight<t.clientY}function ClickAwayListener(t){const{children:Ae,disableReactTree:xe=!1,mouseEvent:Ee="onClick",onClickAway:Se,touchEvent:Ce="onTouchEnd"}=t,_e=reactExports.useRef(!1),Ie=reactExports.useRef(null),Be=reactExports.useRef(!1),Te=reactExports.useRef(!1);reactExports.useEffect(()=>(setTimeout(()=>{Be.current=!0},0),()=>{Be.current=!1}),[]);const Pe=useForkRef(getReactElementRef(Ae),Ie),ke=useEventCallback(Ue=>{const qe=Te.current;Te.current=!1;const ze=ownerDocument(Ie.current);if(!Be.current||!Ie.current||"clientX"in Ue&&clickedRootScrollbar(Ue,ze))return;if(_e.current){_e.current=!1;return}let Ve;Ue.composedPath?Ve=Ue.composedPath().includes(Ie.current):Ve=!ze.documentElement.contains(Ue.target)||Ie.current.contains(Ue.target),!Ve&&(xe||!qe)&&Se(Ue)}),$e=Ue=>qe=>{Te.current=!0;const ze=Ae.props[Ue];ze&&ze(qe)},Oe={ref:Pe};return Ce!==!1&&(Oe[Ce]=$e(Ce)),reactExports.useEffect(()=>{if(Ce!==!1){const Ue=mapEventPropToEvent(Ce),qe=ownerDocument(Ie.current),ze=()=>{_e.current=!0};return qe.addEventListener(Ue,ke),qe.addEventListener("touchmove",ze),()=>{qe.removeEventListener(Ue,ke),qe.removeEventListener("touchmove",ze)}}},[ke,Ce]),Ee!==!1&&(Oe[Ee]=$e(Ee)),reactExports.useEffect(()=>{if(Ee!==!1){const Ue=mapEventPropToEvent(Ee),qe=ownerDocument(Ie.current);return qe.addEventListener(Ue,ke),()=>{qe.removeEventListener(Ue,ke)}}},[ke,Ee]),reactExports.cloneElement(Ae,Oe)}const Container=createContainer$1({createStyledComponent:styled("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[`maxWidth${capitalize$1(String(xe.maxWidth))}`],xe.fixed&&Ae.fixed,xe.disableGutters&&Ae.disableGutters]}}),useThemeProps:t=>useDefaultProps({props:t,name:"MuiContainer"})});function getDialogContentTextUtilityClass(t){return generateUtilityClass("MuiDialogContentText",t)}generateUtilityClasses("MuiDialogContentText",["root"]);const useUtilityClasses$1a=t=>{const{classes:Ae}=t,Ee=composeClasses({root:["root"]},getDialogContentTextUtilityClass,Ae);return{...Ae,...Ee}},DialogContentTextRoot=styled(Typography,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({}),DialogContentText=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiDialogContentText"}),{children:Se,className:Ce,..._e}=Ee,Ie=useUtilityClasses$1a(_e);return jsxRuntimeExports.jsx(DialogContentTextRoot,{component:"p",variant:"body1",color:"textSecondary",ref:xe,ownerState:_e,className:clsx(Ie.root,Ce),...Ee,classes:Ie})});function getTranslateValue(t,Ae,xe){const Ee=Ae.getBoundingClientRect(),Se=xe&&xe.getBoundingClientRect(),Ce=ownerWindow(Ae);let _e;if(Ae.fakeTransform)_e=Ae.fakeTransform;else{const Te=Ce.getComputedStyle(Ae);_e=Te.getPropertyValue("-webkit-transform")||Te.getPropertyValue("transform")}let Ie=0,Be=0;if(_e&&_e!=="none"&&typeof _e=="string"){const Te=_e.split("(")[1].split(")")[0].split(",");Ie=parseInt(Te[4],10),Be=parseInt(Te[5],10)}return t==="left"?Se?`translateX(${Se.right+Ie-Ee.left}px)`:`translateX(${Ce.innerWidth+Ie-Ee.left}px)`:t==="right"?Se?`translateX(-${Ee.right-Se.left-Ie}px)`:`translateX(-${Ee.left+Ee.width-Ie}px)`:t==="up"?Se?`translateY(${Se.bottom+Be-Ee.top}px)`:`translateY(${Ce.innerHeight+Be-Ee.top}px)`:Se?`translateY(-${Ee.top-Se.top+Ee.height-Be}px)`:`translateY(-${Ee.top+Ee.height-Be}px)`}function resolveContainer(t){return typeof t=="function"?t():t}function setTranslateValue(t,Ae,xe){const Ee=resolveContainer(xe),Se=getTranslateValue(t,Ae,Ee);Se&&(Ae.style.webkitTransform=Se,Ae.style.transform=Se)}const Slide=reactExports.forwardRef(function(Ae,xe){const Ee=useTheme(),Se={enter:Ee.transitions.easing.easeOut,exit:Ee.transitions.easing.sharp},Ce={enter:Ee.transitions.duration.enteringScreen,exit:Ee.transitions.duration.leavingScreen},{addEndListener:_e,appear:Ie=!0,children:Be,container:Te,direction:Pe="down",easing:ke=Se,in:$e,onEnter:Oe,onEntered:Ue,onEntering:qe,onExit:ze,onExited:Ve,onExiting:Ge,style:Xe,timeout:er=Ce,TransitionComponent:tr=Transition,...nr}=Ae,sr=reactExports.useRef(null),dr=useForkRef(getReactElementRef(Be),sr,xe),ar=St=>We=>{St&&(We===void 0?St(sr.current):St(sr.current,We))},lr=ar((St,We)=>{setTranslateValue(Pe,St,Te),reflow(St),Oe&&Oe(St,We)}),Ke=ar((St,We)=>{const Fe=getTransitionProps({timeout:er,style:Xe,easing:ke},{mode:"enter"});St.style.webkitTransition=Ee.transitions.create("-webkit-transform",{...Fe}),St.style.transition=Ee.transitions.create("transform",{...Fe}),St.style.webkitTransform="none",St.style.transform="none",qe&&qe(St,We)}),Me=ar(Ue),je=ar(Ge),De=ar(St=>{const We=getTransitionProps({timeout:er,style:Xe,easing:ke},{mode:"exit"});St.style.webkitTransition=Ee.transitions.create("-webkit-transform",We),St.style.transition=Ee.transitions.create("transform",We),setTranslateValue(Pe,St,Te),ze&&ze(St)}),He=ar(St=>{St.style.webkitTransition="",St.style.transition="",Ve&&Ve(St)}),Qe=St=>{_e&&_e(sr.current,St)},Ye=reactExports.useCallback(()=>{sr.current&&setTranslateValue(Pe,sr.current,Te)},[Pe,Te]);return reactExports.useEffect(()=>{if($e||Pe==="down"||Pe==="right")return;const St=debounce$2(()=>{sr.current&&setTranslateValue(Pe,sr.current,Te)}),We=ownerWindow(sr.current);return We.addEventListener("resize",St),()=>{St.clear(),We.removeEventListener("resize",St)}},[Pe,$e,Te]),reactExports.useEffect(()=>{$e||Ye()},[$e,Ye]),jsxRuntimeExports.jsx(tr,{nodeRef:sr,onEnter:lr,onEntered:Me,onEntering:Ke,onExit:De,onExited:He,onExiting:je,addEndListener:Qe,appear:Ie,in:$e,timeout:er,...nr,children:(St,{ownerState:We,...Fe})=>reactExports.cloneElement(Be,{ref:dr,style:{visibility:St==="exited"&&!$e?"hidden":void 0,...Xe,...Be.props.style},...Fe})})});function getDrawerUtilityClass(t){return generateUtilityClass("MuiDrawer",t)}generateUtilityClasses("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const overridesResolver$4=(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,(xe.variant==="permanent"||xe.variant==="persistent")&&Ae.docked,Ae.modal]},useUtilityClasses$19=t=>{const{classes:Ae,anchor:xe,variant:Ee}=t,Se={root:["root",`anchor${capitalize$1(xe)}`],docked:[(Ee==="permanent"||Ee==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${capitalize$1(xe)}`,Ee!=="temporary"&&`paperAnchorDocked${capitalize$1(xe)}`]};return composeClasses(Se,getDrawerUtilityClass,Ae)},DrawerRoot=styled(Modal,{name:"MuiDrawer",slot:"Root",overridesResolver:overridesResolver$4})(memoTheme(({theme:t})=>({zIndex:(t.vars||t).zIndex.drawer}))),DrawerDockedRoot=styled("div",{shouldForwardProp:rootShouldForwardProp,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:overridesResolver$4})({flex:"0 0 auto"}),DrawerPaper=styled(Paper,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.paper,Ae[`paperAnchor${capitalize$1(xe.anchor)}`],xe.variant!=="temporary"&&Ae[`paperAnchorDocked${capitalize$1(xe.anchor)}`]]}})(memoTheme(({theme:t})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:Ae})=>Ae.anchor==="left"&&Ae.variant!=="temporary",style:{borderRight:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:Ae})=>Ae.anchor==="top"&&Ae.variant!=="temporary",style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:Ae})=>Ae.anchor==="right"&&Ae.variant!=="temporary",style:{borderLeft:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:Ae})=>Ae.anchor==="bottom"&&Ae.variant!=="temporary",style:{borderTop:`1px solid ${(t.vars||t).palette.divider}`}}]}))),oppositeDirection={left:"right",right:"left",top:"down",bottom:"up"};function isHorizontal(t){return["left","right"].includes(t)}function getAnchor({direction:t},Ae){return t==="rtl"&&isHorizontal(Ae)?oppositeDirection[Ae]:Ae}const Drawer=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiDrawer"}),Se=useTheme(),Ce=useRtl(),_e={enter:Se.transitions.duration.enteringScreen,exit:Se.transitions.duration.leavingScreen},{anchor:Ie="left",BackdropProps:Be,children:Te,className:Pe,elevation:ke=16,hideBackdrop:$e=!1,ModalProps:{BackdropProps:Oe,...Ue}={},onClose:qe,open:ze=!1,PaperProps:Ve={},SlideProps:Ge,TransitionComponent:Xe,transitionDuration:er=_e,variant:tr="temporary",slots:nr={},slotProps:sr={},...dr}=Ee,ar=reactExports.useRef(!1);reactExports.useEffect(()=>{ar.current=!0},[]);const lr=getAnchor({direction:Ce?"rtl":"ltr"},Ie),Me={...Ee,anchor:Ie,elevation:ke,open:ze,variant:tr,...dr},je=useUtilityClasses$19(Me),De={slots:{transition:Xe,...nr},slotProps:{paper:Ve,transition:Ge,...sr,backdrop:mergeSlotProps(sr.backdrop||{...Be,...Oe},{transitionDuration:er})}},[He,Qe]=useSlot("root",{ref:xe,elementType:DrawerRoot,className:clsx(je.root,je.modal,Pe),shouldForwardComponentProp:!0,ownerState:Me,externalForwardedProps:{...De,...dr,...Ue},additionalProps:{open:ze,onClose:qe,hideBackdrop:$e,slots:{backdrop:De.slots.backdrop},slotProps:{backdrop:De.slotProps.backdrop}}}),[Ye,St]=useSlot("paper",{elementType:DrawerPaper,shouldForwardComponentProp:!0,className:clsx(je.paper,Ve.className),ownerState:Me,externalForwardedProps:De,additionalProps:{elevation:tr==="temporary"?ke:0,square:!0}}),[We,Fe]=useSlot("docked",{elementType:DrawerDockedRoot,ref:xe,className:clsx(je.root,je.docked,Pe),ownerState:Me,externalForwardedProps:De,additionalProps:dr}),[Ze,ir]=useSlot("transition",{elementType:Slide,ownerState:Me,externalForwardedProps:De,additionalProps:{in:ze,direction:oppositeDirection[lr],timeout:er,appear:ar.current}}),ur=jsxRuntimeExports.jsx(Ye,{...St,children:Te});if(tr==="permanent")return jsxRuntimeExports.jsx(We,{...Fe,children:ur});const fr=jsxRuntimeExports.jsx(Ze,{...ir,children:ur});return tr==="persistent"?jsxRuntimeExports.jsx(We,{...Fe,children:fr}):jsxRuntimeExports.jsx(He,{...Qe,children:fr})});function getFabUtilityClass(t){return generateUtilityClass("MuiFab",t)}const fabClasses=generateUtilityClasses("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]),useUtilityClasses$18=t=>{const{color:Ae,variant:xe,classes:Ee,size:Se}=t,Ce={root:["root",xe,`size${capitalize$1(Se)}`,Ae==="inherit"?"colorInherit":Ae]},_e=composeClasses(Ce,getFabUtilityClass,Ee);return{...Ee,..._e}},FabRoot=styled(ButtonBase,{name:"MuiFab",slot:"Root",shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[xe.variant],Ae[`size${capitalize$1(xe.size)}`],xe.color==="inherit"&&Ae.colorInherit,Ae[capitalize$1(xe.size)],Ae[xe.color]]}})(memoTheme(({theme:t})=>{var Ae,xe;return{...t.typography.button,minHeight:36,transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(t.vars||t).zIndex.fab,boxShadow:(t.vars||t).shadows[6],"&:active":{boxShadow:(t.vars||t).shadows[12]},color:t.vars?t.vars.palette.text.primary:(xe=(Ae=t.palette).getContrastText)==null?void 0:xe.call(Ae,t.palette.grey[300]),backgroundColor:(t.vars||t).palette.grey[300],"&:hover":{backgroundColor:(t.vars||t).palette.grey.A100,"@media (hover: none)":{backgroundColor:(t.vars||t).palette.grey[300]},textDecoration:"none"},[`&.${fabClasses.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},variants:[{props:{size:"small"},style:{width:40,height:40}},{props:{size:"medium"},style:{width:48,height:48}},{props:{variant:"extended"},style:{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48}},{props:{variant:"extended",size:"small"},style:{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34}},{props:{variant:"extended",size:"medium"},style:{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40}},{props:{color:"inherit"},style:{color:"inherit"}}]}}),memoTheme(({theme:t})=>({variants:[...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["dark","contrastText"])).map(([Ae])=>({props:{color:Ae},style:{color:(t.vars||t).palette[Ae].contrastText,backgroundColor:(t.vars||t).palette[Ae].main,"&:hover":{backgroundColor:(t.vars||t).palette[Ae].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[Ae].main}}}}))]})),memoTheme(({theme:t})=>({[`&.${fabClasses.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}))),Fab=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFab"}),{children:Se,className:Ce,color:_e="default",component:Ie="button",disabled:Be=!1,disableFocusRipple:Te=!1,focusVisibleClassName:Pe,size:ke="large",variant:$e="circular",...Oe}=Ee,Ue={...Ee,color:_e,component:Ie,disabled:Be,disableFocusRipple:Te,size:ke,variant:$e},qe=useUtilityClasses$18(Ue);return jsxRuntimeExports.jsx(FabRoot,{className:clsx(qe.root,Ce),component:Ie,disabled:Be,focusRipple:!Te,focusVisibleClassName:clsx(qe.focusVisible,Pe),ownerState:Ue,ref:xe,...Oe,classes:qe,children:Se})});function getFormControlLabelUtilityClasses(t){return generateUtilityClass("MuiFormControlLabel",t)}const formControlLabelClasses=generateUtilityClasses("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),useUtilityClasses$17=t=>{const{classes:Ae,disabled:xe,labelPlacement:Ee,error:Se,required:Ce}=t,_e={root:["root",xe&&"disabled",`labelPlacement${capitalize$1(Ee)}`,Se&&"error",Ce&&"required"],label:["label",xe&&"disabled"],asterisk:["asterisk",Se&&"error"]};return composeClasses(_e,getFormControlLabelUtilityClasses,Ae)},FormControlLabelRoot=styled("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`& .${formControlLabelClasses.label}`]:Ae.label},Ae.root,Ae[`labelPlacement${capitalize$1(xe.labelPlacement)}`]]}})(memoTheme(({theme:t})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${formControlLabelClasses.disabled}`]:{cursor:"default"},[`& .${formControlLabelClasses.label}`]:{[`&.${formControlLabelClasses.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:Ae})=>Ae==="start"||Ae==="top"||Ae==="bottom",style:{marginLeft:16}}]}))),AsteriskComponent=styled("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,Ae)=>Ae.asterisk})(memoTheme(({theme:t})=>({[`&.${formControlLabelClasses.error}`]:{color:(t.vars||t).palette.error.main}}))),FormControlLabel=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormControlLabel"}),{checked:Se,className:Ce,componentsProps:_e={},control:Ie,disabled:Be,disableTypography:Te,inputRef:Pe,label:ke,labelPlacement:$e="end",name:Oe,onChange:Ue,required:qe,slots:ze={},slotProps:Ve={},value:Ge,...Xe}=Ee,er=useFormControl(),tr=Be??Ie.props.disabled??(er==null?void 0:er.disabled),nr=qe??Ie.props.required,sr={disabled:tr,required:nr};["checked","name","onChange","value","inputRef"].forEach(He=>{typeof Ie.props[He]>"u"&&typeof Ee[He]<"u"&&(sr[He]=Ee[He])});const dr=formControlState({props:Ee,muiFormControl:er,states:["error"]}),ar={...Ee,disabled:tr,labelPlacement:$e,required:nr,error:dr.error},lr=useUtilityClasses$17(ar),Ke={slots:ze,slotProps:{..._e,...Ve}},[Me,je]=useSlot("typography",{elementType:Typography,externalForwardedProps:Ke,ownerState:ar});let De=ke;return De!=null&&De.type!==Typography&&!Te&&(De=jsxRuntimeExports.jsx(Me,{component:"span",...je,className:clsx(lr.label,je==null?void 0:je.className),children:De})),jsxRuntimeExports.jsxs(FormControlLabelRoot,{className:clsx(lr.root,Ce),ownerState:ar,ref:xe,...Xe,children:[reactExports.cloneElement(Ie,sr),nr?jsxRuntimeExports.jsxs("div",{children:[De,jsxRuntimeExports.jsxs(AsteriskComponent,{ownerState:ar,"aria-hidden":!0,className:lr.asterisk,children:[" ","*"]})]}):De]})});function getFormGroupUtilityClass(t){return generateUtilityClass("MuiFormGroup",t)}generateUtilityClasses("MuiFormGroup",["root","row","error"]);const useUtilityClasses$16=t=>{const{classes:Ae,row:xe,error:Ee}=t;return composeClasses({root:["root",xe&&"row",Ee&&"error"]},getFormGroupUtilityClass,Ae)},FormGroupRoot=styled("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.row&&Ae.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),FormGroup=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormGroup"}),{className:Se,row:Ce=!1,..._e}=Ee,Ie=useFormControl(),Be=formControlState({props:Ee,muiFormControl:Ie,states:["error"]}),Te={...Ee,row:Ce,error:Be.error},Pe=useUtilityClasses$16(Te);return jsxRuntimeExports.jsx(FormGroupRoot,{className:clsx(Pe.root,Se),ownerState:Te,ref:xe,..._e})}),GridContext=reactExports.createContext();function getGridUtilityClass(t){return generateUtilityClass("MuiGrid",t)}const SPACINGS=[0,1,2,3,4,5,6,7,8,9,10],DIRECTIONS=["column-reverse","column","row-reverse","row"],WRAPS=["nowrap","wrap-reverse","wrap"],GRID_SIZES=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],gridClasses$1=generateUtilityClasses("MuiGrid",["root","container","item","zeroMinWidth",...SPACINGS.map(t=>`spacing-xs-${t}`),...DIRECTIONS.map(t=>`direction-xs-${t}`),...WRAPS.map(t=>`wrap-xs-${t}`),...GRID_SIZES.map(t=>`grid-xs-${t}`),...GRID_SIZES.map(t=>`grid-sm-${t}`),...GRID_SIZES.map(t=>`grid-md-${t}`),...GRID_SIZES.map(t=>`grid-lg-${t}`),...GRID_SIZES.map(t=>`grid-xl-${t}`)]);function generateGrid({theme:t,ownerState:Ae}){let xe;return t.breakpoints.keys.reduce((Ee,Se)=>{let Ce={};if(Ae[Se]&&(xe=Ae[Se]),!xe)return Ee;if(xe===!0)Ce={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(xe==="auto")Ce={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const _e=resolveBreakpointValues({values:Ae.columns,breakpoints:t.breakpoints.values}),Ie=typeof _e=="object"?_e[Se]:_e;if(Ie==null)return Ee;const Be=`${Math.round(xe/Ie*1e8)/1e6}%`;let Te={};if(Ae.container&&Ae.item&&Ae.columnSpacing!==0){const Pe=t.spacing(Ae.columnSpacing);if(Pe!=="0px"){const ke=`calc(${Be} + ${Pe})`;Te={flexBasis:ke,maxWidth:ke}}}Ce={flexBasis:Be,flexGrow:0,maxWidth:Be,...Te}}return t.breakpoints.values[Se]===0?Object.assign(Ee,Ce):Ee[t.breakpoints.up(Se)]=Ce,Ee},{})}function generateDirection({theme:t,ownerState:Ae}){const xe=resolveBreakpointValues({values:Ae.direction,breakpoints:t.breakpoints.values});return handleBreakpoints({theme:t},xe,Ee=>{const Se={flexDirection:Ee};return Ee.startsWith("column")&&(Se[`& > .${gridClasses$1.item}`]={maxWidth:"none"}),Se})}function extractZeroValueBreakpointKeys({breakpoints:t,values:Ae}){let xe="";Object.keys(Ae).forEach(Se=>{xe===""&&Ae[Se]!==0&&(xe=Se)});const Ee=Object.keys(t).sort((Se,Ce)=>t[Se]-t[Ce]);return Ee.slice(0,Ee.indexOf(xe))}function generateRowGap({theme:t,ownerState:Ae}){const{container:xe,rowSpacing:Ee}=Ae;let Se={};if(xe&&Ee!==0){const Ce=resolveBreakpointValues({values:Ee,breakpoints:t.breakpoints.values});let _e;typeof Ce=="object"&&(_e=extractZeroValueBreakpointKeys({breakpoints:t.breakpoints.values,values:Ce})),Se=handleBreakpoints({theme:t},Ce,(Ie,Be)=>{const Te=t.spacing(Ie);return Te!=="0px"?{marginTop:`calc(-1 * ${Te})`,[`& > .${gridClasses$1.item}`]:{paddingTop:Te}}:_e!=null&&_e.includes(Be)?{}:{marginTop:0,[`& > .${gridClasses$1.item}`]:{paddingTop:0}}})}return Se}function generateColumnGap({theme:t,ownerState:Ae}){const{container:xe,columnSpacing:Ee}=Ae;let Se={};if(xe&&Ee!==0){const Ce=resolveBreakpointValues({values:Ee,breakpoints:t.breakpoints.values});let _e;typeof Ce=="object"&&(_e=extractZeroValueBreakpointKeys({breakpoints:t.breakpoints.values,values:Ce})),Se=handleBreakpoints({theme:t},Ce,(Ie,Be)=>{const Te=t.spacing(Ie);if(Te!=="0px"){const Pe=`calc(-1 * ${Te})`;return{width:`calc(100% + ${Te})`,marginLeft:Pe,[`& > .${gridClasses$1.item}`]:{paddingLeft:Te}}}return _e!=null&&_e.includes(Be)?{}:{width:"100%",marginLeft:0,[`& > .${gridClasses$1.item}`]:{paddingLeft:0}}})}return Se}function resolveSpacingStyles(t,Ae,xe={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[xe[`spacing-xs-${String(t)}`]];const Ee=[];return Ae.forEach(Se=>{const Ce=t[Se];Number(Ce)>0&&Ee.push(xe[`spacing-${Se}-${String(Ce)}`])}),Ee}const GridRoot$1=styled("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t,{container:Ee,direction:Se,item:Ce,spacing:_e,wrap:Ie,zeroMinWidth:Be,breakpoints:Te}=xe;let Pe=[];Ee&&(Pe=resolveSpacingStyles(_e,Te,Ae));const ke=[];return Te.forEach($e=>{const Oe=xe[$e];Oe&&ke.push(Ae[`grid-${$e}-${String(Oe)}`])}),[Ae.root,Ee&&Ae.container,Ce&&Ae.item,Be&&Ae.zeroMinWidth,...Pe,Se!=="row"&&Ae[`direction-xs-${String(Se)}`],Ie!=="wrap"&&Ae[`wrap-xs-${String(Ie)}`],...ke]}})(({ownerState:t})=>({boxSizing:"border-box",...t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...t.item&&{margin:0},...t.zeroMinWidth&&{minWidth:0},...t.wrap!=="wrap"&&{flexWrap:t.wrap}}),generateDirection,generateRowGap,generateColumnGap,generateGrid);function resolveSpacingClasses(t,Ae){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const xe=[];return Ae.forEach(Ee=>{const Se=t[Ee];if(Number(Se)>0){const Ce=`spacing-${Ee}-${String(Se)}`;xe.push(Ce)}}),xe}const useUtilityClasses$15=t=>{const{classes:Ae,container:xe,direction:Ee,item:Se,spacing:Ce,wrap:_e,zeroMinWidth:Ie,breakpoints:Be}=t;let Te=[];xe&&(Te=resolveSpacingClasses(Ce,Be));const Pe=[];Be.forEach($e=>{const Oe=t[$e];Oe&&Pe.push(`grid-${$e}-${String(Oe)}`)});const ke={root:["root",xe&&"container",Se&&"item",Ie&&"zeroMinWidth",...Te,Ee!=="row"&&`direction-xs-${String(Ee)}`,_e!=="wrap"&&`wrap-xs-${String(_e)}`,...Pe]};return composeClasses(ke,getGridUtilityClass,Ae)},Grid=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiGrid"}),{breakpoints:Se}=useTheme(),Ce=extendSxProp$1(Ee),{className:_e,columns:Ie,columnSpacing:Be,component:Te="div",container:Pe=!1,direction:ke="row",item:$e=!1,rowSpacing:Oe,spacing:Ue=0,wrap:qe="wrap",zeroMinWidth:ze=!1,...Ve}=Ce,Ge=Oe||Ue,Xe=Be||Ue,er=reactExports.useContext(GridContext),tr=Pe?Ie||12:er,nr={},sr={...Ve};Se.keys.forEach(lr=>{Ve[lr]!=null&&(nr[lr]=Ve[lr],delete sr[lr])});const dr={...Ce,columns:tr,container:Pe,direction:ke,item:$e,rowSpacing:Ge,columnSpacing:Xe,wrap:qe,zeroMinWidth:ze,spacing:Ue,...nr,breakpoints:Se.keys},ar=useUtilityClasses$15(dr);return jsxRuntimeExports.jsx(GridContext.Provider,{value:tr,children:jsxRuntimeExports.jsx(GridRoot$1,{ownerState:dr,className:clsx(ar.root,_e),as:Te,ref:xe,...sr})})});function getInputAdornmentUtilityClass(t){return generateUtilityClass("MuiInputAdornment",t)}const inputAdornmentClasses=generateUtilityClasses("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var _span;const overridesResolver$3=(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[`position${capitalize$1(xe.position)}`],xe.disablePointerEvents===!0&&Ae.disablePointerEvents,Ae[xe.variant]]},useUtilityClasses$14=t=>{const{classes:Ae,disablePointerEvents:xe,hiddenLabel:Ee,position:Se,size:Ce,variant:_e}=t,Ie={root:["root",xe&&"disablePointerEvents",Se&&`position${capitalize$1(Se)}`,_e,Ee&&"hiddenLabel",Ce&&`size${capitalize$1(Ce)}`]};return composeClasses(Ie,getInputAdornmentUtilityClass,Ae)},InputAdornmentRoot=styled("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:overridesResolver$3})(memoTheme(({theme:t})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${inputAdornmentClasses.positionStart}&:not(.${inputAdornmentClasses.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),InputAdornment=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiInputAdornment"}),{children:Se,className:Ce,component:_e="div",disablePointerEvents:Ie=!1,disableTypography:Be=!1,position:Te,variant:Pe,...ke}=Ee,$e=useFormControl()||{};let Oe=Pe;Pe&&$e.variant,$e&&!Oe&&(Oe=$e.variant);const Ue={...Ee,hiddenLabel:$e.hiddenLabel,size:$e.size,disablePointerEvents:Ie,position:Te,variant:Oe},qe=useUtilityClasses$14(Ue);return jsxRuntimeExports.jsx(FormControlContext.Provider,{value:null,children:jsxRuntimeExports.jsx(InputAdornmentRoot,{as:_e,ownerState:Ue,className:clsx(qe.root,Ce),ref:xe,...ke,children:typeof Se=="string"&&!Be?jsxRuntimeExports.jsx(Typography,{color:"textSecondary",children:Se}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Te==="start"?_span||(_span=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,Se]})})})});function getLinearProgressUtilityClass(t){return generateUtilityClass("MuiLinearProgress",t)}const linearProgressClasses=generateUtilityClasses("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]),TRANSITION_DURATION=4,indeterminate1Keyframe=keyframes`
217
+ `&&(Xe.value+=" ");const nr=tr.boxSizing,sr=getStyleValue(tr.paddingBottom)+getStyleValue(tr.paddingTop),dr=getStyleValue(tr.borderBottomWidth)+getStyleValue(tr.borderTopWidth),ar=Xe.scrollHeight;Xe.value="x";const lr=Xe.scrollHeight;let Ke=ar;Ce&&(Ke=Math.max(Number(Ce)*lr,Ke)),Se&&(Ke=Math.min(Number(Se)*lr,Ke)),Ke=Math.max(Ke,lr);const Me=Ke+(nr==="border-box"?sr+dr:0),je=Math.abs(Ke-ar)<=1;return{outerHeightStyle:Me,overflowing:je}},[Se,Ce,Ae.placeholder]),qe=reactExports.useCallback(()=>{const Ge=Pe.current,Xe=Ue();if(!Ge||!Xe||isEmpty$1(Xe))return;const er=Xe.outerHeightStyle;$e.current!==er&&($e.current=er,Ge.style.height=`${er}px`),Ge.style.overflow=Xe.overflowing?"hidden":""},[Ue]),ze=reactExports.useRef(-1);useEnhancedEffect(()=>{const Ge=debounce$2(()=>qe()),Xe=Pe==null?void 0:Pe.current;if(!Xe)return;const er=ownerWindow(Xe);er.addEventListener("resize",Ge);let tr;return typeof ResizeObserver<"u"&&(tr=new ResizeObserver(()=>{tr.unobserve(Xe),cancelAnimationFrame(ze.current),qe(),ze.current=requestAnimationFrame(()=>{tr.observe(Xe)})}),tr.observe(Xe)),()=>{Ge.clear(),cancelAnimationFrame(ze.current),er.removeEventListener("resize",Ge),tr&&tr.disconnect()}},[Ue,qe]),useEnhancedEffect(()=>{qe()});const Ve=Ge=>{Te||qe(),Ee&&Ee(Ge)};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("textarea",{value:Ie,onChange:Ve,ref:ke,rows:Ce,style:_e,...Be}),jsxRuntimeExports.jsx("textarea",{"aria-hidden":!0,className:Ae.className,readOnly:!0,ref:Oe,tabIndex:-1,style:{...styles$2.shadow,..._e,paddingTop:0,paddingBottom:0}})]})});function formControlState({props:t,states:Ae,muiFormControl:xe}){return Ae.reduce((Ee,Se)=>(Ee[Se]=t[Se],xe&&typeof t[Se]>"u"&&(Ee[Se]=xe[Se]),Ee),{})}const FormControlContext=reactExports.createContext(void 0);function useFormControl(){return reactExports.useContext(FormControlContext)}function hasValue(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function isFilled(t,Ae=!1){return t&&(hasValue(t.value)&&t.value!==""||Ae&&hasValue(t.defaultValue)&&t.defaultValue!=="")}function isAdornedStart(t){return t.startAdornment}function getInputBaseUtilityClass(t){return generateUtilityClass("MuiInputBase",t)}const inputBaseClasses=generateUtilityClasses("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var _InputGlobalStyles;const rootOverridesResolver=(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.formControl&&Ae.formControl,xe.startAdornment&&Ae.adornedStart,xe.endAdornment&&Ae.adornedEnd,xe.error&&Ae.error,xe.size==="small"&&Ae.sizeSmall,xe.multiline&&Ae.multiline,xe.color&&Ae[`color${capitalize$1(xe.color)}`],xe.fullWidth&&Ae.fullWidth,xe.hiddenLabel&&Ae.hiddenLabel]},inputOverridesResolver=(t,Ae)=>{const{ownerState:xe}=t;return[Ae.input,xe.size==="small"&&Ae.inputSizeSmall,xe.multiline&&Ae.inputMultiline,xe.type==="search"&&Ae.inputTypeSearch,xe.startAdornment&&Ae.inputAdornedStart,xe.endAdornment&&Ae.inputAdornedEnd,xe.hiddenLabel&&Ae.inputHiddenLabel]},useUtilityClasses$1z=t=>{const{classes:Ae,color:xe,disabled:Ee,error:Se,endAdornment:Ce,focused:_e,formControl:Ie,fullWidth:Be,hiddenLabel:Te,multiline:Pe,readOnly:ke,size:$e,startAdornment:Oe,type:Ue}=t,qe={root:["root",`color${capitalize$1(xe)}`,Ee&&"disabled",Se&&"error",Be&&"fullWidth",_e&&"focused",Ie&&"formControl",$e&&$e!=="medium"&&`size${capitalize$1($e)}`,Pe&&"multiline",Oe&&"adornedStart",Ce&&"adornedEnd",Te&&"hiddenLabel",ke&&"readOnly"],input:["input",Ee&&"disabled",Ue==="search"&&"inputTypeSearch",Pe&&"inputMultiline",$e==="small"&&"inputSizeSmall",Te&&"inputHiddenLabel",Oe&&"inputAdornedStart",Ce&&"inputAdornedEnd",ke&&"readOnly"]};return composeClasses(qe,getInputBaseUtilityClass,Ae)},InputBaseRoot=styled("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rootOverridesResolver})(memoTheme(({theme:t})=>({...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${inputBaseClasses.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:Ae})=>Ae.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:Ae,size:xe})=>Ae.multiline&&xe==="small",style:{paddingTop:1}},{props:({ownerState:Ae})=>Ae.fullWidth,style:{width:"100%"}}]}))),InputBaseInput=styled("input",{name:"MuiInputBase",slot:"Input",overridesResolver:inputOverridesResolver})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light",xe={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:Ae?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},Ee={opacity:"0 !important"},Se=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:Ae?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":xe,"&::-moz-placeholder":xe,"&::-ms-input-placeholder":xe,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${inputBaseClasses.formControl} &`]:{"&::-webkit-input-placeholder":Ee,"&::-moz-placeholder":Ee,"&::-ms-input-placeholder":Ee,"&:focus::-webkit-input-placeholder":Se,"&:focus::-moz-placeholder":Se,"&:focus::-ms-input-placeholder":Se},[`&.${inputBaseClasses.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:({ownerState:Ce})=>!Ce.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:Ce})=>Ce.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),InputGlobalStyles=globalCss({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),InputBase=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiInputBase"}),{"aria-describedby":Se,autoComplete:Ce,autoFocus:_e,className:Ie,color:Be,components:Te={},componentsProps:Pe={},defaultValue:ke,disabled:$e,disableInjectingGlobalStyles:Oe,endAdornment:Ue,error:qe,fullWidth:ze=!1,id:Ve,inputComponent:Ge="input",inputProps:Xe={},inputRef:er,margin:tr,maxRows:nr,minRows:sr,multiline:dr=!1,name:ar,onBlur:lr,onChange:Ke,onClick:Me,onFocus:je,onKeyDown:De,onKeyUp:He,placeholder:Qe,readOnly:Ye,renderSuffix:St,rows:We,size:Fe,slotProps:Ze={},slots:ir={},startAdornment:ur,type:fr="text",value:Ar,...vr}=Ee,xr=Xe.value!=null?Xe.value:Ar,{current:br}=reactExports.useRef(xr!=null),_r=reactExports.useRef(),$r=reactExports.useCallback(gr=>{},[]),Fr=useForkRef(_r,er,Xe.ref,$r),[Ir,zr]=reactExports.useState(!1),dn=useFormControl(),tn=formControlState({props:Ee,muiFormControl:dn,states:["color","disabled","error","hiddenLabel","size","required","filled"]});tn.focused=dn?dn.focused:Ir,reactExports.useEffect(()=>{!dn&&$e&&Ir&&(zr(!1),lr&&lr())},[dn,$e,Ir,lr]);const Gr=dn&&dn.onFilled,wn=dn&&dn.onEmpty,an=reactExports.useCallback(gr=>{isFilled(gr)?Gr&&Gr():wn&&wn()},[Gr,wn]);useEnhancedEffect(()=>{br&&an({value:xr})},[xr,an,br]);const Vr=gr=>{je&&je(gr),Xe.onFocus&&Xe.onFocus(gr),dn&&dn.onFocus?dn.onFocus(gr):zr(!0)},Rn=gr=>{lr&&lr(gr),Xe.onBlur&&Xe.onBlur(gr),dn&&dn.onBlur?dn.onBlur(gr):zr(!1)},un=(gr,...Br)=>{if(!br){const Hr=gr.target||_r.current;if(Hr==null)throw new Error(formatMuiErrorMessage(1));an({value:Hr.value})}Xe.onChange&&Xe.onChange(gr,...Br),Ke&&Ke(gr,...Br)};reactExports.useEffect(()=>{an(_r.current)},[]);const sn=gr=>{_r.current&&gr.currentTarget===gr.target&&_r.current.focus(),Me&&Me(gr)};let jn=Ge,en=Xe;dr&&jn==="input"&&(We?en={type:void 0,minRows:We,maxRows:We,...en}:en={type:void 0,maxRows:nr,minRows:sr,...en},jn=TextareaAutosize);const Jr=gr=>{an(gr.animationName==="mui-auto-fill-cancel"?_r.current:{value:"x"})};reactExports.useEffect(()=>{dn&&dn.setAdornedStart(!!ur)},[dn,ur]);const nn={...Ee,color:tn.color||"primary",disabled:tn.disabled,endAdornment:Ue,error:tn.error,focused:tn.focused,formControl:dn,fullWidth:ze,hiddenLabel:tn.hiddenLabel,multiline:dr,size:tn.size,startAdornment:ur,type:fr},rn=useUtilityClasses$1z(nn),cn=ir.root||Te.Root||InputBaseRoot,pn=Ze.root||Pe.root||{},Mr=ir.input||Te.Input||InputBaseInput;return en={...en,...Ze.input??Pe.input},jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!Oe&&typeof InputGlobalStyles=="function"&&(_InputGlobalStyles||(_InputGlobalStyles=jsxRuntimeExports.jsx(InputGlobalStyles,{}))),jsxRuntimeExports.jsxs(cn,{...pn,ref:xe,onClick:sn,...vr,...!isHostComponent(cn)&&{ownerState:{...nn,...pn.ownerState}},className:clsx(rn.root,pn.className,Ie,Ye&&"MuiInputBase-readOnly"),children:[ur,jsxRuntimeExports.jsx(FormControlContext.Provider,{value:null,children:jsxRuntimeExports.jsx(Mr,{"aria-invalid":tn.error,"aria-describedby":Se,autoComplete:Ce,autoFocus:_e,defaultValue:ke,disabled:tn.disabled,id:Ve,onAnimationStart:Jr,name:ar,placeholder:Qe,readOnly:Ye,required:tn.required,rows:We,value:xr,onKeyDown:De,onKeyUp:He,type:fr,...en,...!isHostComponent(Mr)&&{as:jn,ownerState:{...nn,...en.ownerState}},ref:Fr,className:clsx(rn.input,en.className,Ye&&"MuiInputBase-readOnly"),onBlur:Rn,onChange:un,onFocus:Vr})}),Ue,St?St({...tn,startAdornment:ur}):null]})]})});function getInputUtilityClass(t){return generateUtilityClass("MuiInput",t)}const inputClasses={...inputBaseClasses,...generateUtilityClasses("MuiInput",["root","underline","input"])},useUtilityClasses$1y=t=>{const{classes:Ae,disableUnderline:xe}=t,Se=composeClasses({root:["root",!xe&&"underline"],input:["input"]},getInputUtilityClass,Ae);return{...Ae,...Se}},InputRoot=styled(InputBaseRoot,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[...rootOverridesResolver(t,Ae),!xe.disableUnderline&&Ae.underline]}})(memoTheme(({theme:t})=>{let xe=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(xe=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:Ee})=>Ee.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:Ee})=>!Ee.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${inputClasses.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${inputClasses.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${xe}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${inputClasses.disabled}, .${inputClasses.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${xe}`}},[`&.${inputClasses.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ee])=>({props:{color:Ee,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[Ee].main}`}}}))]}})),InputInput=styled(InputBaseInput,{name:"MuiInput",slot:"Input",overridesResolver:inputOverridesResolver})({}),Input=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiInput"}),{disableUnderline:Se=!1,components:Ce={},componentsProps:_e,fullWidth:Ie=!1,inputComponent:Be="input",multiline:Te=!1,slotProps:Pe,slots:ke={},type:$e="text",...Oe}=Ee,Ue=useUtilityClasses$1y(Ee),ze={root:{ownerState:{disableUnderline:Se}}},Ve=Pe??_e?deepmerge(Pe??_e,ze):ze,Ge=ke.root??Ce.Root??InputRoot,Xe=ke.input??Ce.Input??InputInput;return jsxRuntimeExports.jsx(InputBase,{slots:{root:Ge,input:Xe},slotProps:Ve,fullWidth:Ie,inputComponent:Be,multiline:Te,ref:xe,type:$e,...Oe,classes:Ue})});Input.muiName="Input";function getFilledInputUtilityClass(t){return generateUtilityClass("MuiFilledInput",t)}const filledInputClasses={...inputBaseClasses,...generateUtilityClasses("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},useUtilityClasses$1x=t=>{const{classes:Ae,disableUnderline:xe,startAdornment:Ee,endAdornment:Se,size:Ce,hiddenLabel:_e,multiline:Ie}=t,Be={root:["root",!xe&&"underline",Ee&&"adornedStart",Se&&"adornedEnd",Ce==="small"&&`size${capitalize$1(Ce)}`,_e&&"hiddenLabel",Ie&&"multiline"],input:["input"]},Te=composeClasses(Be,getFilledInputUtilityClass,Ae);return{...Ae,...Te}},FilledInputRoot=styled(InputBaseRoot,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[...rootOverridesResolver(t,Ae),!xe.disableUnderline&&Ae.underline]}})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light",xe=Ae?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",Ee=Ae?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",Se=Ae?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",Ce=Ae?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:Ee,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:Se,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:Ee}},[`&.${filledInputClasses.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:Ee},[`&.${filledInputClasses.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:Ce},variants:[{props:({ownerState:_e})=>!_e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${filledInputClasses.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${filledInputClasses.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:xe}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${filledInputClasses.disabled}, .${filledInputClasses.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${filledInputClasses.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([_e])=>{var Ie;return{props:{disableUnderline:!1,color:_e},style:{"&::after":{borderBottom:`2px solid ${(Ie=(t.vars||t).palette[_e])==null?void 0:Ie.main}`}}}}),{props:({ownerState:_e})=>_e.startAdornment,style:{paddingLeft:12}},{props:({ownerState:_e})=>_e.endAdornment,style:{paddingRight:12}},{props:({ownerState:_e})=>_e.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:_e,size:Ie})=>_e.multiline&&Ie==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:_e})=>_e.multiline&&_e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:_e})=>_e.multiline&&_e.hiddenLabel&&_e.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),FilledInputInput=styled(InputBaseInput,{name:"MuiFilledInput",slot:"Input",overridesResolver:inputOverridesResolver})(memoTheme(({theme:t})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:Ae})=>Ae.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:Ae})=>Ae.startAdornment,style:{paddingLeft:0}},{props:({ownerState:Ae})=>Ae.endAdornment,style:{paddingRight:0}},{props:({ownerState:Ae})=>Ae.hiddenLabel&&Ae.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:Ae})=>Ae.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),FilledInput=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFilledInput"}),{disableUnderline:Se=!1,components:Ce={},componentsProps:_e,fullWidth:Ie=!1,hiddenLabel:Be,inputComponent:Te="input",multiline:Pe=!1,slotProps:ke,slots:$e={},type:Oe="text",...Ue}=Ee,qe={...Ee,disableUnderline:Se,fullWidth:Ie,inputComponent:Te,multiline:Pe,type:Oe},ze=useUtilityClasses$1x(Ee),Ve={root:{ownerState:qe},input:{ownerState:qe}},Ge=ke??_e?deepmerge(Ve,ke??_e):Ve,Xe=$e.root??Ce.Root??FilledInputRoot,er=$e.input??Ce.Input??FilledInputInput;return jsxRuntimeExports.jsx(InputBase,{slots:{root:Xe,input:er},slotProps:Ge,fullWidth:Ie,inputComponent:Te,multiline:Pe,ref:xe,type:Oe,...Ue,classes:ze})});FilledInput.muiName="Input";var _span$3;const NotchedOutlineRoot$1=styled("fieldset",{shouldForwardProp:rootShouldForwardProp})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),NotchedOutlineLegend=styled("legend",{shouldForwardProp:rootShouldForwardProp})(memoTheme(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:Ae})=>!Ae.withLabel,style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:({ownerState:Ae})=>Ae.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:Ae})=>Ae.withLabel&&Ae.notched,style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]})));function NotchedOutline(t){const{children:Ae,classes:xe,className:Ee,label:Se,notched:Ce,..._e}=t,Ie=Se!=null&&Se!=="",Be={...t,notched:Ce,withLabel:Ie};return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,{"aria-hidden":!0,className:Ee,ownerState:Be,..._e,children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:Be,children:Ie?jsxRuntimeExports.jsx("span",{children:Se}):_span$3||(_span$3=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}function getOutlinedInputUtilityClass(t){return generateUtilityClass("MuiOutlinedInput",t)}const outlinedInputClasses={...inputBaseClasses,...generateUtilityClasses("MuiOutlinedInput",["root","notchedOutline","input"])},useUtilityClasses$1w=t=>{const{classes:Ae}=t,Ee=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,Ae);return{...Ae,...Ee}},OutlinedInputRoot=styled(InputBaseRoot,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:Ae}},[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([xe])=>({props:{color:xe},style:{[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(t.vars||t).palette[xe].main}}})),{props:{},style:{[`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:({ownerState:xe})=>xe.startAdornment,style:{paddingLeft:14}},{props:({ownerState:xe})=>xe.endAdornment,style:{paddingRight:14}},{props:({ownerState:xe})=>xe.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:xe,size:Ee})=>xe.multiline&&Ee==="small",style:{padding:"8.5px 14px"}}]}})),NotchedOutlineRoot=styled(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,Ae)=>Ae.notchedOutline})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:Ae}})),OutlinedInputInput=styled(InputBaseInput,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(memoTheme(({theme:t})=>({padding:"16.5px 14px",...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:Ae})=>Ae.multiline,style:{padding:0}},{props:({ownerState:Ae})=>Ae.startAdornment,style:{paddingLeft:0}},{props:({ownerState:Ae})=>Ae.endAdornment,style:{paddingRight:0}}]}))),OutlinedInput=reactExports.forwardRef(function(Ae,xe){var Ee;const Se=useDefaultProps({props:Ae,name:"MuiOutlinedInput"}),{components:Ce={},fullWidth:_e=!1,inputComponent:Ie="input",label:Be,multiline:Te=!1,notched:Pe,slots:ke={},type:$e="text",...Oe}=Se,Ue=useUtilityClasses$1w(Se),qe=useFormControl(),ze=formControlState({props:Se,muiFormControl:qe,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),Ve={...Se,color:ze.color||"primary",disabled:ze.disabled,error:ze.error,focused:ze.focused,formControl:qe,fullWidth:_e,hiddenLabel:ze.hiddenLabel,multiline:Te,size:ze.size,type:$e},Ge=ke.root??Ce.Root??OutlinedInputRoot,Xe=ke.input??Ce.Input??OutlinedInputInput;return jsxRuntimeExports.jsx(InputBase,{slots:{root:Ge,input:Xe},renderSuffix:er=>jsxRuntimeExports.jsx(NotchedOutlineRoot,{ownerState:Ve,className:Ue.notchedOutline,label:Be!=null&&Be!==""&&ze.required?Ee||(Ee=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Be," ","*"]})):Be,notched:typeof Pe<"u"?Pe:!!(er.startAdornment||er.filled||er.focused)}),fullWidth:_e,inputComponent:Ie,multiline:Te,ref:xe,type:$e,...Oe,classes:{...Ue,notchedOutline:null}})});OutlinedInput.muiName="Input";function getFormLabelUtilityClasses(t){return generateUtilityClass("MuiFormLabel",t)}const formLabelClasses=generateUtilityClasses("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),useUtilityClasses$1v=t=>{const{classes:Ae,color:xe,focused:Ee,disabled:Se,error:Ce,filled:_e,required:Ie}=t,Be={root:["root",`color${capitalize$1(xe)}`,Se&&"disabled",Ce&&"error",_e&&"filled",Ee&&"focused",Ie&&"required"],asterisk:["asterisk",Ce&&"error"]};return composeClasses(Be,getFormLabelUtilityClasses,Ae)},FormLabelRoot=styled("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.color==="secondary"&&Ae.colorSecondary,xe.filled&&Ae.filled]}})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{color:Ae},style:{[`&.${formLabelClasses.focused}`]:{color:(t.vars||t).palette[Ae].main}}})),{props:{},style:{[`&.${formLabelClasses.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${formLabelClasses.error}`]:{color:(t.vars||t).palette.error.main}}}]}))),AsteriskComponent$1=styled("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,Ae)=>Ae.asterisk})(memoTheme(({theme:t})=>({[`&.${formLabelClasses.error}`]:{color:(t.vars||t).palette.error.main}}))),FormLabel=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormLabel"}),{children:Se,className:Ce,color:_e,component:Ie="label",disabled:Be,error:Te,filled:Pe,focused:ke,required:$e,...Oe}=Ee,Ue=useFormControl(),qe=formControlState({props:Ee,muiFormControl:Ue,states:["color","required","focused","disabled","error","filled"]}),ze={...Ee,color:qe.color||"primary",component:Ie,disabled:qe.disabled,error:qe.error,filled:qe.filled,focused:qe.focused,required:qe.required},Ve=useUtilityClasses$1v(ze);return jsxRuntimeExports.jsxs(FormLabelRoot,{as:Ie,ownerState:ze,className:clsx(Ve.root,Ce),ref:xe,...Oe,children:[Se,qe.required&&jsxRuntimeExports.jsxs(AsteriskComponent$1,{ownerState:ze,"aria-hidden":!0,className:Ve.asterisk,children:[" ","*"]})]})});function getInputLabelUtilityClasses(t){return generateUtilityClass("MuiInputLabel",t)}generateUtilityClasses("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const useUtilityClasses$1u=t=>{const{classes:Ae,formControl:xe,size:Ee,shrink:Se,disableAnimation:Ce,variant:_e,required:Ie}=t,Be={root:["root",xe&&"formControl",!Ce&&"animated",Se&&"shrink",Ee&&Ee!=="normal"&&`size${capitalize$1(Ee)}`,_e],asterisk:[Ie&&"asterisk"]},Te=composeClasses(Be,getInputLabelUtilityClasses,Ae);return{...Ae,...Te}},InputLabelRoot=styled(FormLabel,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`& .${formLabelClasses.asterisk}`]:Ae.asterisk},Ae.root,xe.formControl&&Ae.formControl,xe.size==="small"&&Ae.sizeSmall,xe.shrink&&Ae.shrink,!xe.disableAnimation&&Ae.animated,xe.focused&&Ae.focused,Ae[xe.variant]]}})(memoTheme(({theme:t})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:Ae})=>Ae.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:Ae})=>Ae.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:Ae})=>!Ae.disableAnimation,style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:Ae,ownerState:xe})=>Ae==="filled"&&xe.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:Ae,ownerState:xe,size:Ee})=>Ae==="filled"&&xe.shrink&&Ee==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:Ae,ownerState:xe})=>Ae==="outlined"&&xe.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),InputLabel=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({name:"MuiInputLabel",props:Ae}),{disableAnimation:Se=!1,margin:Ce,shrink:_e,variant:Ie,className:Be,...Te}=Ee,Pe=useFormControl();let ke=_e;typeof ke>"u"&&Pe&&(ke=Pe.filled||Pe.focused||Pe.adornedStart);const $e=formControlState({props:Ee,muiFormControl:Pe,states:["size","variant","required","focused"]}),Oe={...Ee,disableAnimation:Se,formControl:Pe,shrink:ke,size:$e.size,variant:$e.variant,required:$e.required,focused:$e.focused},Ue=useUtilityClasses$1u(Oe);return jsxRuntimeExports.jsx(InputLabelRoot,{"data-shrink":ke,ref:xe,className:clsx(Ue.root,Be),...Te,ownerState:Oe,classes:Ue})});function getFormControlUtilityClasses(t){return generateUtilityClass("MuiFormControl",t)}generateUtilityClasses("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const useUtilityClasses$1t=t=>{const{classes:Ae,margin:xe,fullWidth:Ee}=t,Se={root:["root",xe!=="none"&&`margin${capitalize$1(xe)}`,Ee&&"fullWidth"]};return composeClasses(Se,getFormControlUtilityClasses,Ae)},FormControlRoot=styled("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[`margin${capitalize$1(xe.margin)}`],xe.fullWidth&&Ae.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),FormControl=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormControl"}),{children:Se,className:Ce,color:_e="primary",component:Ie="div",disabled:Be=!1,error:Te=!1,focused:Pe,fullWidth:ke=!1,hiddenLabel:$e=!1,margin:Oe="none",required:Ue=!1,size:qe="medium",variant:ze="outlined",...Ve}=Ee,Ge={...Ee,color:_e,component:Ie,disabled:Be,error:Te,fullWidth:ke,hiddenLabel:$e,margin:Oe,required:Ue,size:qe,variant:ze},Xe=useUtilityClasses$1t(Ge),[er,tr]=reactExports.useState(()=>{let He=!1;return Se&&reactExports.Children.forEach(Se,Qe=>{if(!isMuiElement(Qe,["Input","Select"]))return;const Ye=isMuiElement(Qe,["Select"])?Qe.props.input:Qe;Ye&&isAdornedStart(Ye.props)&&(He=!0)}),He}),[nr,sr]=reactExports.useState(()=>{let He=!1;return Se&&reactExports.Children.forEach(Se,Qe=>{isMuiElement(Qe,["Input","Select"])&&(isFilled(Qe.props,!0)||isFilled(Qe.props.inputProps,!0))&&(He=!0)}),He}),[dr,ar]=reactExports.useState(!1);Be&&dr&&ar(!1);const lr=Pe!==void 0&&!Be?Pe:dr;let Ke;reactExports.useRef(!1);const Me=reactExports.useCallback(()=>{sr(!0)},[]),je=reactExports.useCallback(()=>{sr(!1)},[]),De=reactExports.useMemo(()=>({adornedStart:er,setAdornedStart:tr,color:_e,disabled:Be,error:Te,filled:nr,focused:lr,fullWidth:ke,hiddenLabel:$e,size:qe,onBlur:()=>{ar(!1)},onFocus:()=>{ar(!0)},onEmpty:je,onFilled:Me,registerEffect:Ke,required:Ue,variant:ze}),[er,_e,Be,Te,nr,lr,ke,$e,Ke,je,Me,Ue,qe,ze]);return jsxRuntimeExports.jsx(FormControlContext.Provider,{value:De,children:jsxRuntimeExports.jsx(FormControlRoot,{as:Ie,ownerState:Ge,className:clsx(Xe.root,Ce),ref:xe,...Ve,children:Se})})});function getFormHelperTextUtilityClasses(t){return generateUtilityClass("MuiFormHelperText",t)}const formHelperTextClasses=generateUtilityClasses("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var _span$2;const useUtilityClasses$1s=t=>{const{classes:Ae,contained:xe,size:Ee,disabled:Se,error:Ce,filled:_e,focused:Ie,required:Be}=t,Te={root:["root",Se&&"disabled",Ce&&"error",Ee&&`size${capitalize$1(Ee)}`,xe&&"contained",Ie&&"focused",_e&&"filled",Be&&"required"]};return composeClasses(Te,getFormHelperTextUtilityClasses,Ae)},FormHelperTextRoot=styled("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.size&&Ae[`size${capitalize$1(xe.size)}`],xe.contained&&Ae.contained,xe.filled&&Ae.filled]}})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${formHelperTextClasses.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${formHelperTextClasses.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:Ae})=>Ae.contained,style:{marginLeft:14,marginRight:14}}]}))),FormHelperText=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormHelperText"}),{children:Se,className:Ce,component:_e="p",disabled:Ie,error:Be,filled:Te,focused:Pe,margin:ke,required:$e,variant:Oe,...Ue}=Ee,qe=useFormControl(),ze=formControlState({props:Ee,muiFormControl:qe,states:["variant","size","disabled","error","filled","focused","required"]}),Ve={...Ee,component:_e,contained:ze.variant==="filled"||ze.variant==="outlined",variant:ze.variant,size:ze.size,disabled:ze.disabled,error:ze.error,filled:ze.filled,focused:ze.focused,required:ze.required};delete Ve.ownerState;const Ge=useUtilityClasses$1s(Ve);return jsxRuntimeExports.jsx(FormHelperTextRoot,{as:_e,className:clsx(Ge.root,Ce),ref:xe,...Ue,ownerState:Ve,children:Se===" "?_span$2||(_span$2=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):Se})});function getNativeSelectUtilityClasses(t){return generateUtilityClass("MuiNativeSelect",t)}const nativeSelectClasses=generateUtilityClasses("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),useUtilityClasses$1r=t=>{const{classes:Ae,variant:xe,disabled:Ee,multiple:Se,open:Ce,error:_e}=t,Ie={select:["select",xe,Ee&&"disabled",Se&&"multiple",_e&&"error"],icon:["icon",`icon${capitalize$1(xe)}`,Ce&&"iconOpen",Ee&&"disabled"]};return composeClasses(Ie,getNativeSelectUtilityClasses,Ae)},StyledSelectSelect=styled("select")(({theme:t})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${nativeSelectClasses.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:({ownerState:Ae})=>Ae.variant!=="filled"&&Ae.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]})),NativeSelectSelect=styled(StyledSelectSelect,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp,overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.select,Ae[xe.variant],xe.error&&Ae.error,{[`&.${nativeSelectClasses.multiple}`]:Ae.multiple}]}})({}),StyledSelectIcon=styled("svg")(({theme:t})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${nativeSelectClasses.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:({ownerState:Ae})=>Ae.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),NativeSelectIcon=styled(StyledSelectIcon,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.icon,xe.variant&&Ae[`icon${capitalize$1(xe.variant)}`],xe.open&&Ae.iconOpen]}})({}),NativeSelectInput=reactExports.forwardRef(function(Ae,xe){const{className:Ee,disabled:Se,error:Ce,IconComponent:_e,inputRef:Ie,variant:Be="standard",...Te}=Ae,Pe={...Ae,disabled:Se,variant:Be,error:Ce},ke=useUtilityClasses$1r(Pe);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,{ownerState:Pe,className:clsx(ke.select,Ee),disabled:Se,ref:Ie||xe,...Te}),Ae.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:_e,ownerState:Pe,className:ke.icon})]})});function getSelectUtilityClasses(t){return generateUtilityClass("MuiSelect",t)}const selectClasses=generateUtilityClasses("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var _span$1;const SelectSelect=styled(StyledSelectSelect,{name:"MuiSelect",slot:"Select",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`&.${selectClasses.select}`]:Ae.select},{[`&.${selectClasses.select}`]:Ae[xe.variant]},{[`&.${selectClasses.error}`]:Ae.error},{[`&.${selectClasses.multiple}`]:Ae.multiple}]}})({[`&.${selectClasses.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled(StyledSelectIcon,{name:"MuiSelect",slot:"Icon",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.icon,xe.variant&&Ae[`icon${capitalize$1(xe.variant)}`],xe.open&&Ae.iconOpen]}})({}),SelectNativeInput=styled("input",{shouldForwardProp:t=>slotShouldForwardProp(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,Ae)=>Ae.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues$1(t,Ae){return typeof Ae=="object"&&Ae!==null?t===Ae:String(t)===String(Ae)}function isEmpty(t){return t==null||typeof t=="string"&&!t.trim()}const useUtilityClasses$1q=t=>{const{classes:Ae,variant:xe,disabled:Ee,multiple:Se,open:Ce,error:_e}=t,Ie={select:["select",xe,Ee&&"disabled",Se&&"multiple",_e&&"error"],icon:["icon",`icon${capitalize$1(xe)}`,Ce&&"iconOpen",Ee&&"disabled"],nativeInput:["nativeInput"]};return composeClasses(Ie,getSelectUtilityClasses,Ae)},SelectInput=reactExports.forwardRef(function(Ae,xe){var Kr;const{"aria-describedby":Ee,"aria-label":Se,autoFocus:Ce,autoWidth:_e,children:Ie,className:Be,defaultOpen:Te,defaultValue:Pe,disabled:ke,displayEmpty:$e,error:Oe=!1,IconComponent:Ue,inputRef:qe,labelId:ze,MenuProps:Ve={},multiple:Ge,name:Xe,onBlur:er,onChange:tr,onClose:nr,onFocus:sr,onOpen:dr,open:ar,readOnly:lr,renderValue:Ke,required:Me,SelectDisplayProps:je={},tabIndex:De,type:He,value:Qe,variant:Ye="standard",...St}=Ae,[We,Fe]=useControlled({controlled:Qe,default:Pe,name:"Select"}),[Ze,ir]=useControlled({controlled:ar,default:Te,name:"Select"}),ur=reactExports.useRef(null),fr=reactExports.useRef(null),[Ar,vr]=reactExports.useState(null),{current:xr}=reactExports.useRef(ar!=null),[br,_r]=reactExports.useState(),$r=useForkRef(xe,qe),Fr=reactExports.useCallback(Dr=>{fr.current=Dr,Dr&&vr(Dr)},[]),Ir=Ar==null?void 0:Ar.parentNode;reactExports.useImperativeHandle($r,()=>({focus:()=>{fr.current.focus()},node:ur.current,value:We}),[We]),reactExports.useEffect(()=>{Te&&Ze&&Ar&&!xr&&(_r(_e?null:Ir.clientWidth),fr.current.focus())},[Ar,_e]),reactExports.useEffect(()=>{Ce&&fr.current.focus()},[Ce]),reactExports.useEffect(()=>{if(!ze)return;const Dr=ownerDocument(fr.current).getElementById(ze);if(Dr){const qr=()=>{getSelection().isCollapsed&&fr.current.focus()};return Dr.addEventListener("click",qr),()=>{Dr.removeEventListener("click",qr)}}},[ze]);const zr=(Dr,qr)=>{Dr?dr&&dr(qr):nr&&nr(qr),xr||(_r(_e?null:Ir.clientWidth),ir(Dr))},dn=Dr=>{Dr.button===0&&(Dr.preventDefault(),fr.current.focus(),zr(!0,Dr))},tn=Dr=>{zr(!1,Dr)},Gr=reactExports.Children.toArray(Ie),wn=Dr=>{const qr=Gr.find(Ur=>Ur.props.value===Dr.target.value);qr!==void 0&&(Fe(qr.props.value),tr&&tr(Dr,qr))},an=Dr=>qr=>{let Ur;if(qr.currentTarget.hasAttribute("tabindex")){if(Ge){Ur=Array.isArray(We)?We.slice():[];const Bn=We.indexOf(Dr.props.value);Bn===-1?Ur.push(Dr.props.value):Ur.splice(Bn,1)}else Ur=Dr.props.value;if(Dr.props.onClick&&Dr.props.onClick(qr),We!==Ur&&(Fe(Ur),tr)){const Bn=qr.nativeEvent||qr,In=new Bn.constructor(Bn.type,Bn);Object.defineProperty(In,"target",{writable:!0,value:{value:Ur,name:Xe}}),tr(In,Dr)}Ge||zr(!1,qr)}},Vr=Dr=>{lr||[" ","ArrowUp","ArrowDown","Enter"].includes(Dr.key)&&(Dr.preventDefault(),zr(!0,Dr))},Rn=Ar!==null&&Ze,un=Dr=>{!Rn&&er&&(Object.defineProperty(Dr,"target",{writable:!0,value:{value:We,name:Xe}}),er(Dr))};delete St["aria-invalid"];let sn,jn;const en=[];let Jr=!1;(isFilled({value:We})||$e)&&(Ke?sn=Ke(We):Jr=!0);const nn=Gr.map(Dr=>{if(!reactExports.isValidElement(Dr))return null;let qr;if(Ge){if(!Array.isArray(We))throw new Error(formatMuiErrorMessage(2));qr=We.some(Ur=>areEqualValues$1(Ur,Dr.props.value)),qr&&Jr&&en.push(Dr.props.children)}else qr=areEqualValues$1(We,Dr.props.value),qr&&Jr&&(jn=Dr.props.children);return reactExports.cloneElement(Dr,{"aria-selected":qr?"true":"false",onClick:an(Dr),onKeyUp:Ur=>{Ur.key===" "&&Ur.preventDefault(),Dr.props.onKeyUp&&Dr.props.onKeyUp(Ur)},role:"option",selected:qr,value:void 0,"data-value":Dr.props.value})});Jr&&(Ge?en.length===0?sn=null:sn=en.reduce((Dr,qr,Ur)=>(Dr.push(qr),Ur<en.length-1&&Dr.push(", "),Dr),[]):sn=jn);let rn=br;!_e&&xr&&Ar&&(rn=Ir.clientWidth);let cn;typeof De<"u"?cn=De:cn=ke?null:0;const pn=je.id||(Xe?`mui-component-select-${Xe}`:void 0),Mr={...Ae,variant:Ye,value:We,open:Rn,error:Oe},gr=useUtilityClasses$1q(Mr),Br={...Ve.PaperProps,...(Kr=Ve.slotProps)==null?void 0:Kr.paper},Hr=useId();return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(SelectSelect,{as:"div",ref:Fr,tabIndex:cn,role:"combobox","aria-controls":Rn?Hr:void 0,"aria-disabled":ke?"true":void 0,"aria-expanded":Rn?"true":"false","aria-haspopup":"listbox","aria-label":Se,"aria-labelledby":[ze,pn].filter(Boolean).join(" ")||void 0,"aria-describedby":Ee,"aria-required":Me?"true":void 0,"aria-invalid":Oe?"true":void 0,onKeyDown:Vr,onMouseDown:ke||lr?null:dn,onBlur:un,onFocus:sr,...je,ownerState:Mr,className:clsx(je.className,gr.select,Be),id:pn,children:isEmpty(sn)?_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):sn}),jsxRuntimeExports.jsx(SelectNativeInput,{"aria-invalid":Oe,value:Array.isArray(We)?We.join(","):We,name:Xe,ref:ur,"aria-hidden":!0,onChange:wn,tabIndex:-1,disabled:ke,className:gr.nativeInput,autoFocus:Ce,required:Me,...St,ownerState:Mr}),jsxRuntimeExports.jsx(SelectIcon,{as:Ue,className:gr.icon,ownerState:Mr}),jsxRuntimeExports.jsx(Menu,{id:`menu-${Xe||""}`,anchorEl:Ir,open:Rn,onClose:tn,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...Ve,slotProps:{...Ve.slotProps,list:{"aria-labelledby":ze,role:"listbox","aria-multiselectable":Ge?"true":void 0,disableListWrap:!0,id:Hr,...Ve.MenuListProps},paper:{...Br,style:{minWidth:rn,...Br!=null?Br.style:null}}},children:nn})]})}),ArrowDropDownIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),useUtilityClasses$1p=t=>{const{classes:Ae}=t,Ee=composeClasses({root:["root"]},getSelectUtilityClasses,Ae);return{...Ae,...Ee}},styledRootConfig={name:"MuiSelect",overridesResolver:(t,Ae)=>Ae.root,shouldForwardProp:t=>rootShouldForwardProp(t)&&t!=="variant",slot:"Root"},StyledInput=styled(Input,styledRootConfig)(""),StyledOutlinedInput=styled(OutlinedInput,styledRootConfig)(""),StyledFilledInput=styled(FilledInput,styledRootConfig)(""),Select=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({name:"MuiSelect",props:Ae}),{autoWidth:Se=!1,children:Ce,classes:_e={},className:Ie,defaultOpen:Be=!1,displayEmpty:Te=!1,IconComponent:Pe=ArrowDropDownIcon,id:ke,input:$e,inputProps:Oe,label:Ue,labelId:qe,MenuProps:ze,multiple:Ve=!1,native:Ge=!1,onClose:Xe,onOpen:er,open:tr,renderValue:nr,SelectDisplayProps:sr,variant:dr="outlined",...ar}=Ee,lr=Ge?NativeSelectInput:SelectInput,Ke=useFormControl(),Me=formControlState({props:Ee,muiFormControl:Ke,states:["variant","error"]}),je=Me.variant||dr,De={...Ee,variant:je,classes:_e},He=useUtilityClasses$1p(De),{root:Qe,...Ye}=He,St=$e||{standard:jsxRuntimeExports.jsx(StyledInput,{ownerState:De}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:Ue,ownerState:De}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:De})}[je],We=useForkRef(xe,getReactElementRef(St));return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(St,{inputComponent:lr,inputProps:{children:Ce,error:Me.error,IconComponent:Pe,variant:je,type:void 0,multiple:Ve,...Ge?{id:ke}:{autoWidth:Se,defaultOpen:Be,displayEmpty:Te,labelId:qe,MenuProps:ze,onClose:Xe,onOpen:er,open:tr,renderValue:nr,SelectDisplayProps:{id:ke,...sr}},...Oe,classes:Oe?deepmerge(Ye,Oe.classes):Ye,...$e?$e.props.inputProps:{}},...(Ve&&Ge||Te)&&je==="outlined"?{notched:!0}:{},ref:We,className:clsx(St.props.className,Ie,He.root),...!$e&&{variant:je},...ar})})});Select.muiName="Select";function getTextFieldUtilityClass(t){return generateUtilityClass("MuiTextField",t)}generateUtilityClasses("MuiTextField",["root"]);const variantComponent={standard:Input,filled:FilledInput,outlined:OutlinedInput},useUtilityClasses$1o=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getTextFieldUtilityClass,Ae)},TextFieldRoot=styled(FormControl,{name:"MuiTextField",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({}),TextField=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiTextField"}),{autoComplete:Se,autoFocus:Ce=!1,children:_e,className:Ie,color:Be="primary",defaultValue:Te,disabled:Pe=!1,error:ke=!1,FormHelperTextProps:$e,fullWidth:Oe=!1,helperText:Ue,id:qe,InputLabelProps:ze,inputProps:Ve,InputProps:Ge,inputRef:Xe,label:er,maxRows:tr,minRows:nr,multiline:sr=!1,name:dr,onBlur:ar,onChange:lr,onFocus:Ke,placeholder:Me,required:je=!1,rows:De,select:He=!1,SelectProps:Qe,slots:Ye={},slotProps:St={},type:We,value:Fe,variant:Ze="outlined",...ir}=Ee,ur={...Ee,autoFocus:Ce,color:Be,disabled:Pe,error:ke,fullWidth:Oe,multiline:sr,required:je,select:He,variant:Ze},fr=useUtilityClasses$1o(ur),Ar=useId(qe),vr=Ue&&Ar?`${Ar}-helper-text`:void 0,xr=er&&Ar?`${Ar}-label`:void 0,br=variantComponent[Ze],_r={slots:Ye,slotProps:{input:Ge,inputLabel:ze,htmlInput:Ve,formHelperText:$e,select:Qe,...St}},$r={},Fr=_r.slotProps.inputLabel;Ze==="outlined"&&(Fr&&typeof Fr.shrink<"u"&&($r.notched=Fr.shrink),$r.label=er),He&&((!Qe||!Qe.native)&&($r.id=void 0),$r["aria-describedby"]=void 0);const[Ir,zr]=useSlot("input",{elementType:br,externalForwardedProps:_r,additionalProps:$r,ownerState:ur}),[dn,tn]=useSlot("inputLabel",{elementType:InputLabel,externalForwardedProps:_r,ownerState:ur}),[Gr,wn]=useSlot("htmlInput",{elementType:"input",externalForwardedProps:_r,ownerState:ur}),[an,Vr]=useSlot("formHelperText",{elementType:FormHelperText,externalForwardedProps:_r,ownerState:ur}),[Rn,un]=useSlot("select",{elementType:Select,externalForwardedProps:_r,ownerState:ur}),sn=jsxRuntimeExports.jsx(Ir,{"aria-describedby":vr,autoComplete:Se,autoFocus:Ce,defaultValue:Te,fullWidth:Oe,multiline:sr,name:dr,rows:De,maxRows:tr,minRows:nr,type:We,value:Fe,id:Ar,inputRef:Xe,onBlur:ar,onChange:lr,onFocus:Ke,placeholder:Me,inputProps:wn,slots:{input:Ye.htmlInput?Gr:void 0},...zr});return jsxRuntimeExports.jsxs(TextFieldRoot,{className:clsx(fr.root,Ie),disabled:Pe,error:ke,fullWidth:Oe,ref:xe,required:je,color:Be,variant:Ze,ownerState:ur,...ir,children:[er!=null&&er!==""&&jsxRuntimeExports.jsx(dn,{htmlFor:Ar,id:xr,...tn,children:er}),He?jsxRuntimeExports.jsx(Rn,{"aria-describedby":vr,id:Ar,labelId:xr,value:Fe,input:sn,...un,children:_e}):sn,Ue&&jsxRuntimeExports.jsx(an,{id:vr,...Vr,children:Ue})]})}),StatusIndicator=({status:t})=>{const xe={connected:{color:"success.main",text:"Connected to promptfoo API"},blocked:{color:"error.main",text:"Cannot connect to promptfoo API"},loading:{color:"info.main",text:"Checking connection..."},unknown:{color:"grey.500",text:"Checking connection status..."},disabled:{color:"grey.400",text:"Remote generation is disabled"}}[t];return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(CircleIcon,{sx:{color:xe.color,fontSize:"12px"}}),jsxRuntimeExports.jsx(Typography,{variant:"body2",children:xe.text})]})};function ApiSettingsModal({open:t,onClose:Ae}){const{apiBaseUrl:xe,setApiBaseUrl:Ee,enablePersistApiBaseUrl:Se}=useApiConfig(),[Ce,_e]=reactExports.useState(xe||""),{status:Ie,message:Be,checkHealth:Te,isChecking:Pe}=useApiHealth(),[ke,$e]=reactExports.useState(!1);reactExports.useEffect(()=>{t&&Te()},[t,Te]),reactExports.useEffect(()=>{_e(xe||"")},[xe]);const Oe=ze=>{_e(ze.target.value)},Ue=async()=>{try{$e(!0),Ee(Ce),Se(),await Te(),Ae()}finally{$e(!1)}},qe=Ie==="loading"||Pe||ke;return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ae,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"api-settings-dialog-title",children:[jsxRuntimeExports.jsx(DialogTitle,{id:"api-settings-dialog-title",children:"API and Sharing Settings"}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsxs(Box,{sx:{mb:3},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[jsxRuntimeExports.jsx(StatusIndicator,{status:Ie}),jsxRuntimeExports.jsx(Tooltip$2,{title:"Check connection",children:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(IconButton,{onClick:Te,size:"small",disabled:Pe,children:Pe?jsxRuntimeExports.jsx(CircularProgress,{size:20}):jsxRuntimeExports.jsx(RefreshIcon,{})})})})]}),Be&&Ie!=="unknown"&&Ie!=="loading"&&jsxRuntimeExports.jsx(Alert,{severity:Ie==="connected"?"success":"error",sx:{mt:1},children:Be})]}),jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"API"}),jsxRuntimeExports.jsx(TextField,{label:"API Base URL",helperText:"The promptfoo API the webview will connect to",value:Ce,onChange:Oe,fullWidth:!0,margin:"normal",disabled:qe})]}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Ue,disabled:qe,startIcon:ke&&jsxRuntimeExports.jsx(CircularProgress,{size:20}),children:"Save"}),jsxRuntimeExports.jsx(Button,{onClick:Ae,disabled:qe,children:"Close"})]})]})}const DarkModeIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkMode"),LightModeIcon=createSvgIcon(jsxRuntimeExports.jsx("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"}),"LightMode"),StyledIconButton=styled(IconButton)(({theme:t})=>({padding:8,borderRadius:"50%",transition:t.transitions.create(["background-color","transform"],{duration:t.transitions.duration.standard}),"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",transform:"rotate(15deg)"}})),AnimatedIcon=styled("div")(({theme:t})=>({display:"flex",transition:t.transitions.create(["opacity","transform"],{duration:t.transitions.duration.standard})})),DarkModeToggle=React.memo(({onToggleDarkMode:t})=>{const xe=useTheme().palette.mode==="dark";return jsxRuntimeExports.jsxs(StyledIconButton,{onClick:t,"aria-label":xe?"Switch to light mode":"Switch to dark mode",children:[jsxRuntimeExports.jsx(AnimatedIcon,{sx:{opacity:xe?1:0,transform:xe?"rotate(0deg)":"rotate(-90deg)",position:"absolute"},children:jsxRuntimeExports.jsx(DarkModeIcon,{})}),jsxRuntimeExports.jsx(AnimatedIcon,{sx:{opacity:xe?0:1,transform:xe?"rotate(90deg)":"rotate(0deg)"},children:jsxRuntimeExports.jsx(LightModeIcon,{})})]})});DarkModeToggle.displayName="DarkModeToggle";const BugReportIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20zm-6 8h-4v-2h4zm0-4h-4v-2h4z"}),"BugReport"),CalendarTodayIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),ForumIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1m-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1"}),"Forum"),GitHubIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),MenuBookIcon=createSvgIcon([jsxRuntimeExports.jsx("path",{d:"M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1m0 13.5c-1.1-.35-2.3-.5-3.5-.5-1.7 0-4.15.65-5.5 1.5V8c1.35-.85 3.8-1.5 5.5-1.5 1.2 0 2.4.15 3.5.5z"},"0"),jsxRuntimeExports.jsx("path",{d:"M17.5 10.5c.88 0 1.73.09 2.5.26V9.24c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99M13 12.49v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26V11.9c-.79-.15-1.64-.24-2.5-.24-1.7 0-3.24.3-4.5.83m4.5 1.84c-1.7 0-3.24.29-4.5.83v1.66c1.13-.64 2.7-.99 4.5-.99.88 0 1.73.09 2.5.26v-1.52c-.79-.16-1.64-.24-2.5-.24"},"1")],"MenuBook"),WorkIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-6 0h-4V4h4z"}),"Work");function getLinkUtilityClass(t){return generateUtilityClass("MuiLink",t)}const linkClasses=generateUtilityClasses("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),getTextDecoration=({theme:t,ownerState:Ae})=>{const xe=Ae.color,Ee=getPath(t,`palette.${xe}.main`,!1)||getPath(t,`palette.${xe}`,!1)||Ae.color,Se=getPath(t,`palette.${xe}.mainChannel`)||getPath(t,`palette.${xe}Channel`);return"vars"in t&&Se?`rgba(${Se} / 0.4)`:alpha$3(Ee,.4)},v6Colors={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},useUtilityClasses$1n=t=>{const{classes:Ae,component:xe,focusVisible:Ee,underline:Se}=t,Ce={root:["root",`underline${capitalize$1(Se)}`,xe==="button"&&"button",Ee&&"focusVisible"]};return composeClasses(Ce,getLinkUtilityClass,Ae)},LinkRoot=styled(Typography,{name:"MuiLink",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[`underline${capitalize$1(xe.underline)}`],xe.component==="button"&&Ae.button]}})(memoTheme(({theme:t})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:Ae,ownerState:xe})=>Ae==="always"&&xe.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{underline:"always",color:Ae},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette[Ae].mainChannel} / 0.4)`:alpha$3(t.palette[Ae].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:alpha$3(t.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.secondaryChannel} / 0.4)`:alpha$3(t.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(t.vars||t).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${linkClasses.focusVisible}`]:{outline:"auto"}}}]}))),Link=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiLink"}),Se=useTheme(),{className:Ce,color:_e="primary",component:Ie="a",onBlur:Be,onFocus:Te,TypographyClasses:Pe,underline:ke="always",variant:$e="inherit",sx:Oe,...Ue}=Ee,[qe,ze]=reactExports.useState(!1),Ve=tr=>{isFocusVisible(tr.target)||ze(!1),Be&&Be(tr)},Ge=tr=>{isFocusVisible(tr.target)&&ze(!0),Te&&Te(tr)},Xe={...Ee,color:_e,component:Ie,focusVisible:qe,underline:ke,variant:$e},er=useUtilityClasses$1n(Xe);return jsxRuntimeExports.jsx(LinkRoot,{color:_e,className:clsx(er.root,Ce),classes:Pe,component:Ie,onBlur:Ve,onFocus:Ge,ref:xe,ownerState:Xe,variant:$e,...Ue,sx:[...v6Colors[_e]===void 0?[{color:_e}]:[],...Array.isArray(Oe)?Oe:[Oe]],style:{...Ue.style,...ke==="always"&&_e!=="inherit"&&!v6Colors[_e]&&{"--Link-underlineColor":getTextDecoration({theme:Se,ownerState:Xe})}}})}),Stack=createStack$1({createStyledComponent:styled("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,Ae)=>Ae.root}),useThemeProps:t=>useDefaultProps({props:t,name:"MuiStack"})}),links=[{icon:jsxRuntimeExports.jsx(MenuBookIcon,{fontSize:"small"}),text:"Documentation",href:"https://www.promptfoo.dev/docs/intro"},{icon:jsxRuntimeExports.jsx(GitHubIcon,{fontSize:"small"}),text:"GitHub Repository",href:"https://github.com/promptfoo/promptfoo"},{icon:jsxRuntimeExports.jsx(BugReportIcon,{fontSize:"small"}),text:"File an Issue",href:"https://github.com/promptfoo/promptfoo/issues"},{icon:jsxRuntimeExports.jsx(ForumIcon,{fontSize:"small"}),text:"Join Our Discord Community",href:"https://discord.gg/promptfoo"},{icon:jsxRuntimeExports.jsx(CalendarTodayIcon,{fontSize:"small"}),text:"Book a Meeting",href:"https://cal.com/team/promptfoo/intro2"},{icon:jsxRuntimeExports.jsx(WorkIcon,{fontSize:"small"}),text:"Careers",href:"https://www.promptfoo.dev/careers/"}];function InfoModal({open:t,onClose:Ae}){return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ae,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"about-promptfoo-dialog-title",children:[jsxRuntimeExports.jsx(DialogTitle,{id:"about-promptfoo-dialog-title",children:jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"About Promptfoo"}),jsxRuntimeExports.jsx(Link,{href:"https://github.com/promptfoo/promptfoo/releases",underline:"none",sx:{color:"inherit"},target:"_blank",children:jsxRuntimeExports.jsxs(Typography,{variant:"subtitle2",children:["Version ","0.112.8"]})})]})}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",gutterBottom:!0,children:"Promptfoo is a MIT licensed open-source tool for evaluating and red-teaming LLMs. We make it easy to track the performance of your models and prompts over time with automated support for dataset generation and grading."}),jsxRuntimeExports.jsx(Stack,{spacing:2,mt:2,children:links.map((xe,Ee)=>jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap","& .MuiSvgIcon-root":{color:"text.primary"}},children:[xe.icon,jsxRuntimeExports.jsx(Link,{underline:"none",target:"_blank",href:xe.href,sx:{color:"inherit"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",children:xe.text})})]},Ee))})]}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:Ae,children:"Close"})})]})}const logoPanda="/assets/logo-panda-BuYvzEyb.svg",LogoWrapper=styled(Box)(({theme:t})=>({display:"inline-flex",alignItems:"center",padding:t.spacing(1,2),perspective:"2000px",transformStyle:"preserve-3d"})),LogoText=styled(Typography)(({theme:t})=>({fontFamily:'"Inter", sans-serif',fontWeight:600,fontSize:"1rem",color:t.palette.text.primary,letterSpacing:"0.02em",marginLeft:t.spacing(1),transition:"all 0.3s ease","@keyframes rainbow":{"0%":{backgroundPosition:"0% 50%"},"50%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0% 50%"}},"&:hover":{color:"transparent",backgroundImage:"linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8f00ff)",backgroundSize:"300% 300%",backgroundClip:"text",WebkitBackgroundClip:"text",animation:"rainbow 3s ease infinite"}})),LogoIcon=styled("img")({width:"25px",height:"auto",transition:"all 1s cubic-bezier(0.68, -0.55, 0.265, 1.55)","@keyframes absoluteMadness":{"0%":{transform:"translateY(0) rotate(0deg) scale(1) translateX(0)",filter:"hue-rotate(0deg) brightness(1)"},"25%":{transform:"translateY(-25px) rotate(360deg) scale(1.5) translateX(15px)",filter:"hue-rotate(180deg) brightness(1.5)"},"50%":{transform:"translateY(0) rotate(720deg) scale(0.5) translateX(-15px)",filter:"hue-rotate(360deg) brightness(2)"},"75%":{transform:"translateY(25px) rotate(1080deg) scale(1.8) translateX(15px)",filter:"hue-rotate(540deg) brightness(1.5)"},"100%":{transform:"translateY(0) rotate(1440deg) scale(1) translateX(0)",filter:"hue-rotate(720deg) brightness(1)"}},"@keyframes vibrate":{"0%, 100%":{transform:"translate(0)"},"10%, 30%, 50%, 70%, 90%":{transform:"translate(-2px, 2px)"},"20%, 40%, 60%, 80%":{transform:"translate(2px, -2px)"}},"&:hover":{animation:"absoluteMadness 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite, vibrate 0.3s linear infinite",filter:"hue-rotate(720deg) brightness(2) contrast(1.5) saturate(300%) drop-shadow(0 0 10px rgba(255,0,0,0.5))"}});function Logo(){return jsxRuntimeExports.jsx(Link$1,{to:"/",style:{textDecoration:"none"},children:jsxRuntimeExports.jsxs(LogoWrapper,{children:[jsxRuntimeExports.jsx(LogoIcon,{src:logoPanda,alt:"Promptfoo Logo"}),jsxRuntimeExports.jsx(LogoText,{variant:"h1",children:"promptfoo"})]})})}const NavButton=styled(Button)(({theme:t})=>({color:t.palette.text.primary,"&:hover":{backgroundColor:t.palette.action.hover},"&.active":{backgroundColor:t.palette.action.selected}})),StyledAppBar=styled(AppBar)(({theme:t})=>({backgroundColor:t.palette.background.paper,color:t.palette.text.primary,boxShadow:t.shadows[1],marginBottom:t.spacing(2)})),NavToolbar=styled(Toolbar)({justifyContent:"space-between"}),NavSection=styled(Box)({display:"flex",alignItems:"center",gap:"1rem"});function NavLink({href:t,label:Ae}){const Ee=useLocation().pathname.startsWith(t);return jsxRuntimeExports.jsx(NavButton,{component:Link$1,to:t,className:Ee?"active":"",children:Ae})}function CreateDropdown(){const[t,Ae]=reactExports.useState(null),xe=!!t,Ee=useLocation(),Se=Ie=>{Ae(Ie.currentTarget)},Ce=()=>{Ae(null)},_e=["/setup","/redteam/setup"].some(Ie=>Ee.pathname.startsWith(Ie));return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(NavButton,{onClick:Se,endIcon:jsxRuntimeExports.jsx(ArrowDropDownIcon$1,{}),className:_e?"active":"",children:"Create"}),jsxRuntimeExports.jsxs(Menu,{anchorEl:t,open:xe,onClose:Ce,PaperProps:{elevation:0,sx:{overflow:"visible",filter:"drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",mt:1.5}},children:[jsxRuntimeExports.jsx(MenuItem,{onClick:Ce,component:Link$1,to:"/setup",children:"Eval"}),jsxRuntimeExports.jsx(MenuItem,{onClick:Ce,component:Link$1,to:"/redteam/setup",children:"Red team"})]})]})}function EvalsDropdown(){const[t,Ae]=reactExports.useState(null),xe=!!t,Ee=useLocation(),Se=Ie=>{Ae(Ie.currentTarget)},Ce=()=>{Ae(null)},_e=["/eval","/evals"].some(Ie=>Ee.pathname.startsWith(Ie));return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(NavButton,{onClick:Se,endIcon:jsxRuntimeExports.jsx(ArrowDropDownIcon$1,{}),className:_e?"active":"",children:"Evals"}),jsxRuntimeExports.jsxs(Menu,{anchorEl:t,open:xe,onClose:Ce,children:[jsxRuntimeExports.jsx(MenuItem,{onClick:Ce,component:Link$1,to:"/eval",children:"Latest Eval"}),jsxRuntimeExports.jsx(MenuItem,{onClick:Ce,component:Link$1,to:"/evals",children:"All Evals"})]})]})}function Navigation({darkMode:t,onToggleDarkMode:Ae}){const[xe,Ee]=reactExports.useState(!1),[Se,Ce]=reactExports.useState(!1),_e=useUIStore(Te=>Te.isNavbarVisible),Ie=()=>Ee(Te=>!Te),Be=()=>Ce(Te=>!Te);return _e?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(StyledAppBar,{position:"static",elevation:0,children:jsxRuntimeExports.jsxs(NavToolbar,{children:[jsxRuntimeExports.jsxs(NavSection,{children:[jsxRuntimeExports.jsx(Logo,{}),jsxRuntimeExports.jsx(CreateDropdown,{}),jsxRuntimeExports.jsx(EvalsDropdown,{}),jsxRuntimeExports.jsx(NavLink,{href:"/prompts",label:"Prompts"}),jsxRuntimeExports.jsx(NavLink,{href:"/datasets",label:"Datasets"}),jsxRuntimeExports.jsx(NavLink,{href:"/history",label:"History"})]}),jsxRuntimeExports.jsxs(NavSection,{children:[jsxRuntimeExports.jsx(IconButton,{onClick:Ie,color:"inherit",children:jsxRuntimeExports.jsx(InfoIcon,{})}),jsxRuntimeExports.jsx(Tooltip$2,{title:"API and Sharing Settings",children:jsxRuntimeExports.jsx(IconButton,{onClick:Be,color:"inherit",children:jsxRuntimeExports.jsx(EngineeringIcon,{})})}),jsxRuntimeExports.jsx(DarkModeToggle,{onToggleDarkMode:Ae})]})]})}),jsxRuntimeExports.jsx(InfoModal,{open:xe,onClose:Ie}),jsxRuntimeExports.jsx(ApiSettingsModal,{open:Se,onClose:Be})]}):null}const useMediaQuery=unstable_createUseMediaQuery({themeId:THEME_ID}),createAppTheme=t=>createTheme({typography:{fontFamily:'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',button:{textTransform:"none",fontWeight:500}},shape:{borderRadius:12},palette:{mode:t?"dark":"light",primary:{main:t?"#3b82f6":"#2563eb",light:t?"#60a5fa":"#3b82f6",dark:t?"#2563eb":"#1d4ed8",contrastText:"#ffffff"},secondary:{main:"#8b5cf6",light:"#a78bfa",dark:"#7c3aed",contrastText:"#ffffff"},background:{default:t?"#121212":"#f8fafc",paper:t?"#1e1e1e":"#ffffff"},text:{primary:t?"#ffffff":"#0f172a",secondary:t?"#a0a0a0":"#475569"}},components:{MuiButton:{styleOverrides:{root:{borderRadius:"8px",textTransform:"none",fontWeight:500,padding:"8px 16px",transition:"all 0.2s ease-in-out","&:hover":{transform:"translateY(-1px)"}},contained:{boxShadow:"none","&:hover":{boxShadow:"0 4px 8px -2px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06)"}}}},MuiCard:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#ffffff",borderRadius:"16px",border:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`,transition:"all 0.2s ease-in-out",boxShadow:t?"none":"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)","&:hover":{boxShadow:t?"0 4px 12px rgba(0, 0, 0, 0.3)":"0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.05)"}}}},MuiTableContainer:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#ffffff",boxShadow:t?"none":"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",borderRadius:"12px",border:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#f8fafc"}}},MuiTableCell:{styleOverrides:{head:{backgroundColor:"inherit",color:t?"#ffffff":"#0f172a",fontWeight:600,fontSize:"0.875rem"},stickyHeader:{backgroundColor:t?"#1e1e1e":"#f8fafc"},root:{borderBottom:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`}}},MuiInputBase:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#ffffff",borderRadius:"8px",transition:"all 0.2s ease-in-out"}}},MuiOutlinedInput:{styleOverrides:{root:{"& .MuiOutlinedInput-notchedOutline":{transition:"all 0.2s ease-in-out"}}}},MuiFormLabel:{styleOverrides:{root:{transition:"color 0.2s ease-in-out","&.Mui-focused":{color:t?"#3b82f6":"#2563eb"}}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:t?"#1e1e1e":"#ffffff",boxShadow:"none",borderBottom:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none",backgroundColor:t?"#1e1e1e":"#ffffff",boxShadow:t?"none":"0 1px 2px rgba(0, 0, 0, 0.05)",border:`1px solid ${t?"#2c2c2c":"#e2e8f0"}`,'&[class*="elevation"]':{boxShadow:t?"none":"0 1px 2px rgba(0, 0, 0, 0.05)"}},elevation1:{boxShadow:t?"none":"0 1px 2px rgba(0, 0, 0, 0.05)"},elevation2:{boxShadow:t?"none":"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)"},elevation3:{boxShadow:t?"0 4px 12px rgba(0, 0, 0, 0.3)":"0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.05)"},elevation4:{boxShadow:t?"0 8px 16px rgba(0, 0, 0, 0.4)":"0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}}},MuiDialog:{styleOverrides:{paper:{borderRadius:"16px",boxShadow:t?"0 25px 50px -12px rgba(0, 0, 0, 0.5)":"0 25px 50px -12px rgba(0, 0, 0, 0.25)"}}},MuiSwitch:{styleOverrides:{root:{padding:8},track:{borderRadius:22/2,backgroundColor:t?"#404040":"#cbd5e1"},thumb:{backgroundColor:"#ffffff"}}}}}),lightTheme=createAppTheme(!1),darkTheme=createAppTheme(!0);function Layout({children:t}){return jsxRuntimeExports.jsx("div",{children:t})}function PageShell(){const t=useMediaQuery("(prefers-color-scheme: dark)"),[Ae,xe]=reactExports.useState(null);reactExports.useEffect(()=>{const Se=localStorage.getItem("darkMode");xe(Se===null?t:Se==="true")},[t]);const Ee=reactExports.useCallback(()=>{xe(Se=>{const Ce=!Se;return localStorage.setItem("darkMode",String(Ce)),Ce})},[]);return reactExports.useEffect(()=>{Ae!==null&&(Ae?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))},[Ae]),Ae===null?null:jsxRuntimeExports.jsx(ThemeProvider,{theme:Ae?darkTheme:lightTheme,children:jsxRuntimeExports.jsxs(Layout,{children:[jsxRuntimeExports.jsx(Navigation,{darkMode:Ae,onToggleDarkMode:Ee}),jsxRuntimeExports.jsx(Outlet,{})]})})}function getCollapseUtilityClass(t){return generateUtilityClass("MuiCollapse",t)}generateUtilityClasses("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const useUtilityClasses$1m=t=>{const{orientation:Ae,classes:xe}=t,Ee={root:["root",`${Ae}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${Ae}`],wrapperInner:["wrapperInner",`${Ae}`]};return composeClasses(Ee,getCollapseUtilityClass,xe)},CollapseRoot=styled("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[xe.orientation],xe.state==="entered"&&Ae.entered,xe.state==="exited"&&!xe.in&&xe.collapsedSize==="0px"&&Ae.hidden]}})(memoTheme(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:Ae})=>Ae.state==="exited"&&!Ae.in&&Ae.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),CollapseWrapper=styled("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,Ae)=>Ae.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),CollapseWrapperInner=styled("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,Ae)=>Ae.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Collapse=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiCollapse"}),{addEndListener:Se,children:Ce,className:_e,collapsedSize:Ie="0px",component:Be,easing:Te,in:Pe,onEnter:ke,onEntered:$e,onEntering:Oe,onExit:Ue,onExited:qe,onExiting:ze,orientation:Ve="vertical",style:Ge,timeout:Xe=duration$1.standard,TransitionComponent:er=Transition,...tr}=Ee,nr={...Ee,orientation:Ve,collapsedSize:Ie},sr=useUtilityClasses$1m(nr),dr=useTheme(),ar=useTimeout(),lr=reactExports.useRef(null),Ke=reactExports.useRef(),Me=typeof Ie=="number"?`${Ie}px`:Ie,je=Ve==="horizontal",De=je?"width":"height",He=reactExports.useRef(null),Qe=useForkRef(xe,He),Ye=vr=>xr=>{if(vr){const br=He.current;xr===void 0?vr(br):vr(br,xr)}},St=()=>lr.current?lr.current[je?"clientWidth":"clientHeight"]:0,We=Ye((vr,xr)=>{lr.current&&je&&(lr.current.style.position="absolute"),vr.style[De]=Me,ke&&ke(vr,xr)}),Fe=Ye((vr,xr)=>{const br=St();lr.current&&je&&(lr.current.style.position="");const{duration:_r,easing:$r}=getTransitionProps({style:Ge,timeout:Xe,easing:Te},{mode:"enter"});if(Xe==="auto"){const Fr=dr.transitions.getAutoHeightDuration(br);vr.style.transitionDuration=`${Fr}ms`,Ke.current=Fr}else vr.style.transitionDuration=typeof _r=="string"?_r:`${_r}ms`;vr.style[De]=`${br}px`,vr.style.transitionTimingFunction=$r,Oe&&Oe(vr,xr)}),Ze=Ye((vr,xr)=>{vr.style[De]="auto",$e&&$e(vr,xr)}),ir=Ye(vr=>{vr.style[De]=`${St()}px`,Ue&&Ue(vr)}),ur=Ye(qe),fr=Ye(vr=>{const xr=St(),{duration:br,easing:_r}=getTransitionProps({style:Ge,timeout:Xe,easing:Te},{mode:"exit"});if(Xe==="auto"){const $r=dr.transitions.getAutoHeightDuration(xr);vr.style.transitionDuration=`${$r}ms`,Ke.current=$r}else vr.style.transitionDuration=typeof br=="string"?br:`${br}ms`;vr.style[De]=Me,vr.style.transitionTimingFunction=_r,ze&&ze(vr)}),Ar=vr=>{Xe==="auto"&&ar.start(Ke.current||0,vr),Se&&Se(He.current,vr)};return jsxRuntimeExports.jsx(er,{in:Pe,onEnter:We,onEntered:Ze,onEntering:Fe,onExit:ir,onExited:ur,onExiting:fr,addEndListener:Ar,nodeRef:He,timeout:Xe==="auto"?null:Xe,...tr,children:(vr,{ownerState:xr,...br})=>jsxRuntimeExports.jsx(CollapseRoot,{as:Be,className:clsx(sr.root,_e,{entered:sr.entered,exited:!Pe&&Me==="0px"&&sr.hidden}[vr]),style:{[je?"minWidth":"minHeight"]:Me,...Ge},ref:Qe,ownerState:{...nr,state:vr},...br,children:jsxRuntimeExports.jsx(CollapseWrapper,{ownerState:{...nr,state:vr},className:sr.wrapper,ref:lr,children:jsxRuntimeExports.jsx(CollapseWrapperInner,{ownerState:{...nr,state:vr},className:sr.wrapperInner,children:Ce})})})})});Collapse&&(Collapse.muiSupportAuto=!0);const AccordionContext=reactExports.createContext({});function getAccordionUtilityClass(t){return generateUtilityClass("MuiAccordion",t)}const accordionClasses=generateUtilityClasses("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),useUtilityClasses$1l=t=>{const{classes:Ae,square:xe,expanded:Ee,disabled:Se,disableGutters:Ce}=t;return composeClasses({root:["root",!xe&&"rounded",Ee&&"expanded",Se&&"disabled",!Ce&&"gutters"],heading:["heading"],region:["region"]},getAccordionUtilityClass,Ae)},AccordionRoot=styled(Paper,{name:"MuiAccordion",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`& .${accordionClasses.region}`]:Ae.region},Ae.root,!xe.square&&Ae.rounded,!xe.disableGutters&&Ae.gutters]}})(memoTheme(({theme:t})=>{const Ae={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],Ae),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],Ae)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${accordionClasses.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${accordionClasses.disabled}`]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}}),memoTheme(({theme:t})=>({variants:[{props:Ae=>!Ae.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:Ae=>!Ae.disableGutters,style:{[`&.${accordionClasses.expanded}`]:{margin:"16px 0"}}}]}))),AccordionHeading=styled("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(t,Ae)=>Ae.heading})({all:"unset"}),Accordion=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiAccordion"}),{children:Se,className:Ce,defaultExpanded:_e=!1,disabled:Ie=!1,disableGutters:Be=!1,expanded:Te,onChange:Pe,square:ke=!1,slots:$e={},slotProps:Oe={},TransitionComponent:Ue,TransitionProps:qe,...ze}=Ee,[Ve,Ge]=useControlled({controlled:Te,default:_e,name:"Accordion",state:"expanded"}),Xe=reactExports.useCallback(Qe=>{Ge(!Ve),Pe&&Pe(Qe,!Ve)},[Ve,Pe,Ge]),[er,...tr]=reactExports.Children.toArray(Se),nr=reactExports.useMemo(()=>({expanded:Ve,disabled:Ie,disableGutters:Be,toggle:Xe}),[Ve,Ie,Be,Xe]),sr={...Ee,square:ke,disabled:Ie,disableGutters:Be,expanded:Ve},dr=useUtilityClasses$1l(sr),ar={transition:Ue,...$e},lr={transition:qe,...Oe},Ke={slots:ar,slotProps:lr},[Me,je]=useSlot("heading",{elementType:AccordionHeading,externalForwardedProps:Ke,className:dr.heading,ownerState:sr}),[De,He]=useSlot("transition",{elementType:Collapse,externalForwardedProps:Ke,ownerState:sr});return jsxRuntimeExports.jsxs(AccordionRoot,{className:clsx(dr.root,Ce),ref:xe,ownerState:sr,square:ke,...ze,children:[jsxRuntimeExports.jsx(Me,{...je,children:jsxRuntimeExports.jsx(AccordionContext.Provider,{value:nr,children:er})}),jsxRuntimeExports.jsx(De,{in:Ve,timeout:"auto",...He,children:jsxRuntimeExports.jsx("div",{"aria-labelledby":er.props.id,id:er.props["aria-controls"],role:"region",className:dr.region,children:tr})})]})});function getAccordionDetailsUtilityClass(t){return generateUtilityClass("MuiAccordionDetails",t)}generateUtilityClasses("MuiAccordionDetails",["root"]);const useUtilityClasses$1k=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getAccordionDetailsUtilityClass,Ae)},AccordionDetailsRoot=styled("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})(memoTheme(({theme:t})=>({padding:t.spacing(1,2,2)}))),AccordionDetails=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiAccordionDetails"}),{className:Se,...Ce}=Ee,_e=Ee,Ie=useUtilityClasses$1k(_e);return jsxRuntimeExports.jsx(AccordionDetailsRoot,{className:clsx(Ie.root,Se),ref:xe,ownerState:_e,...Ce})});function getAccordionSummaryUtilityClass(t){return generateUtilityClass("MuiAccordionSummary",t)}const accordionSummaryClasses=generateUtilityClasses("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),useUtilityClasses$1j=t=>{const{classes:Ae,expanded:xe,disabled:Ee,disableGutters:Se}=t;return composeClasses({root:["root",xe&&"expanded",Ee&&"disabled",!Se&&"gutters"],focusVisible:["focusVisible"],content:["content",xe&&"expanded",!Se&&"contentGutters"],expandIconWrapper:["expandIconWrapper",xe&&"expanded"]},getAccordionSummaryUtilityClass,Ae)},AccordionSummaryRoot=styled(ButtonBase,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})(memoTheme(({theme:t})=>{const Ae={duration:t.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],Ae),[`&.${accordionSummaryClasses.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${accordionSummaryClasses.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`&:hover:not(.${accordionSummaryClasses.disabled})`]:{cursor:"pointer"},variants:[{props:xe=>!xe.disableGutters,style:{[`&.${accordionSummaryClasses.expanded}`]:{minHeight:64}}}]}})),AccordionSummaryContent=styled("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(t,Ae)=>Ae.content})(memoTheme(({theme:t})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:Ae=>!Ae.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),[`&.${accordionSummaryClasses.expanded}`]:{margin:"20px 0"}}}]}))),AccordionSummaryExpandIconWrapper=styled("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(t,Ae)=>Ae.expandIconWrapper})(memoTheme(({theme:t})=>({display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),[`&.${accordionSummaryClasses.expanded}`]:{transform:"rotate(180deg)"}}))),AccordionSummary=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiAccordionSummary"}),{children:Se,className:Ce,expandIcon:_e,focusVisibleClassName:Ie,onClick:Be,...Te}=Ee,{disabled:Pe=!1,disableGutters:ke,expanded:$e,toggle:Oe}=reactExports.useContext(AccordionContext),Ue=Ve=>{Oe&&Oe(Ve),Be&&Be(Ve)},qe={...Ee,expanded:$e,disabled:Pe,disableGutters:ke},ze=useUtilityClasses$1j(qe);return jsxRuntimeExports.jsxs(AccordionSummaryRoot,{focusRipple:!1,disableRipple:!0,disabled:Pe,"aria-expanded":$e,className:clsx(ze.root,Ce),focusVisibleClassName:clsx(ze.focusVisible,Ie),onClick:Ue,ref:xe,ownerState:qe,...Te,children:[jsxRuntimeExports.jsx(AccordionSummaryContent,{className:ze.content,ownerState:qe,children:Se}),_e&&jsxRuntimeExports.jsx(AccordionSummaryExpandIconWrapper,{className:ze.expandIconWrapper,ownerState:qe,children:_e})]})});function stripDiacritics(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function createFilterOptions(t={}){const{ignoreAccents:Ae=!0,ignoreCase:xe=!0,limit:Ee,matchFrom:Se="any",stringify:Ce,trim:_e=!1}=t;return(Ie,{inputValue:Be,getOptionLabel:Te})=>{let Pe=_e?Be.trim():Be;xe&&(Pe=Pe.toLowerCase()),Ae&&(Pe=stripDiacritics(Pe));const ke=Pe?Ie.filter($e=>{let Oe=(Ce||Te)($e);return xe&&(Oe=Oe.toLowerCase()),Ae&&(Oe=stripDiacritics(Oe)),Se==="start"?Oe.startsWith(Pe):Oe.includes(Pe)}):Ie;return typeof Ee=="number"?ke.slice(0,Ee):ke}}const defaultFilterOptions=createFilterOptions(),pageSize=5,defaultIsActiveElementInListbox=t=>{var Ae;return t.current!==null&&((Ae=t.current.parentElement)==null?void 0:Ae.contains(document.activeElement))},MULTIPLE_DEFAULT_VALUE=[];function getInputValue$1(t,Ae,xe){if(Ae||t==null)return"";const Ee=xe(t);return typeof Ee=="string"?Ee:""}function useAutocomplete(t){const{unstable_isActiveElementInListbox:Ae=defaultIsActiveElementInListbox,unstable_classNamePrefix:xe="Mui",autoComplete:Ee=!1,autoHighlight:Se=!1,autoSelect:Ce=!1,blurOnSelect:_e=!1,clearOnBlur:Ie=!t.freeSolo,clearOnEscape:Be=!1,componentName:Te="useAutocomplete",defaultValue:Pe=t.multiple?MULTIPLE_DEFAULT_VALUE:null,disableClearable:ke=!1,disableCloseOnSelect:$e=!1,disabled:Oe,disabledItemsFocusable:Ue=!1,disableListWrap:qe=!1,filterOptions:ze=defaultFilterOptions,filterSelectedOptions:Ve=!1,freeSolo:Ge=!1,getOptionDisabled:Xe,getOptionKey:er,getOptionLabel:tr=zn=>zn.label??zn,groupBy:nr,handleHomeEndKeys:sr=!t.freeSolo,id:dr,includeInputInList:ar=!1,inputValue:lr,isOptionEqualToValue:Ke=(zn,Gn)=>zn===Gn,multiple:Me=!1,onChange:je,onClose:De,onHighlightChange:He,onInputChange:Qe,onOpen:Ye,open:St,openOnFocus:We=!1,options:Fe,readOnly:Ze=!1,selectOnFocus:ir=!t.freeSolo,value:ur}=t,fr=useId(dr);let Ar=tr;Ar=zn=>{const Gn=tr(zn);return typeof Gn!="string"?String(Gn):Gn};const vr=reactExports.useRef(!1),xr=reactExports.useRef(!0),br=reactExports.useRef(null),_r=reactExports.useRef(null),[$r,Fr]=reactExports.useState(null),[Ir,zr]=reactExports.useState(-1),dn=Se?0:-1,tn=reactExports.useRef(dn),Gr=reactExports.useRef(getInputValue$1(Pe,Me,Ar)).current,[wn,an]=useControlled({controlled:ur,default:Pe,name:Te}),[Vr,Rn]=useControlled({controlled:lr,default:Gr,name:Te,state:"inputValue"}),[un,sn]=reactExports.useState(!1),jn=reactExports.useCallback((zn,Gn,di)=>{if(!(Me?wn.length<Gn.length:Gn!==null)&&!Ie)return;const Ei=getInputValue$1(Gn,Me,Ar);Vr!==Ei&&(Rn(Ei),Qe&&Qe(zn,Ei,di))},[Ar,Vr,Me,Qe,Rn,Ie,wn]),[en,Jr]=useControlled({controlled:St,default:!1,name:Te,state:"open"}),[nn,rn]=reactExports.useState(!0),cn=!Me&&wn!=null&&Vr===Ar(wn),pn=en&&!Ze,Mr=pn?ze(Fe.filter(zn=>!(Ve&&(Me?wn:[wn]).some(Gn=>Gn!==null&&Ke(zn,Gn)))),{inputValue:cn&&nn?"":Vr,getOptionLabel:Ar}):[],gr=usePreviousProps({filteredOptions:Mr,value:wn,inputValue:Vr});reactExports.useEffect(()=>{const zn=wn!==gr.value;un&&!zn||Ge&&!zn||jn(null,wn,"reset")},[wn,jn,un,gr.value,Ge]);const Br=en&&Mr.length>0&&!Ze,Hr=useEventCallback(zn=>{zn===-1?br.current.focus():$r.querySelector(`[data-tag-index="${zn}"]`).focus()});reactExports.useEffect(()=>{Me&&Ir>wn.length-1&&(zr(-1),Hr(-1))},[wn,Me,Ir,Hr]);function Kr(zn,Gn){if(!_r.current||zn<0||zn>=Mr.length)return-1;let di=zn;for(;;){const hi=_r.current.querySelector(`[data-option-index="${di}"]`),Ei=Ue?!1:!hi||hi.disabled||hi.getAttribute("aria-disabled")==="true";if(hi&&hi.hasAttribute("tabindex")&&!Ei)return di;if(Gn==="next"?di=(di+1)%Mr.length:di=(di-1+Mr.length)%Mr.length,di===zn)return-1}}const Dr=useEventCallback(({event:zn,index:Gn,reason:di="auto"})=>{if(tn.current=Gn,Gn===-1?br.current.removeAttribute("aria-activedescendant"):br.current.setAttribute("aria-activedescendant",`${fr}-option-${Gn}`),He&&He(zn,Gn===-1?null:Mr[Gn],di),!_r.current)return;const hi=_r.current.querySelector(`[role="option"].${xe}-focused`);hi&&(hi.classList.remove(`${xe}-focused`),hi.classList.remove(`${xe}-focusVisible`));let Ei=_r.current;if(_r.current.getAttribute("role")!=="listbox"&&(Ei=_r.current.parentElement.querySelector('[role="listbox"]')),!Ei)return;if(Gn===-1){Ei.scrollTop=0;return}const _i=_r.current.querySelector(`[data-option-index="${Gn}"]`);if(_i&&(_i.classList.add(`${xe}-focused`),di==="keyboard"&&_i.classList.add(`${xe}-focusVisible`),Ei.scrollHeight>Ei.clientHeight&&di!=="mouse"&&di!=="touch")){const Mi=_i,ji=Ei.clientHeight+Ei.scrollTop,no=Mi.offsetTop+Mi.offsetHeight;no>ji?Ei.scrollTop=no-Ei.clientHeight:Mi.offsetTop-Mi.offsetHeight*(nr?1.3:0)<Ei.scrollTop&&(Ei.scrollTop=Mi.offsetTop-Mi.offsetHeight*(nr?1.3:0))}}),qr=useEventCallback(({event:zn,diff:Gn,direction:di="next",reason:hi="auto"})=>{if(!pn)return;const _i=Kr((()=>{const Mi=Mr.length-1;if(Gn==="reset")return dn;if(Gn==="start")return 0;if(Gn==="end")return Mi;const ji=tn.current+Gn;return ji<0?ji===-1&&ar?-1:qe&&tn.current!==-1||Math.abs(Gn)>1?0:Mi:ji>Mi?ji===Mi+1&&ar?-1:qe||Math.abs(Gn)>1?Mi:0:ji})(),di);if(Dr({index:_i,reason:hi,event:zn}),Ee&&Gn!=="reset")if(_i===-1)br.current.value=Vr;else{const Mi=Ar(Mr[_i]);br.current.value=Mi,Mi.toLowerCase().indexOf(Vr.toLowerCase())===0&&Vr.length>0&&br.current.setSelectionRange(Vr.length,Mi.length)}}),Ur=()=>{const zn=(Gn,di)=>{const hi=Gn?Ar(Gn):"",Ei=di?Ar(di):"";return hi===Ei};if(tn.current!==-1&&gr.filteredOptions&&gr.filteredOptions.length!==Mr.length&&gr.inputValue===Vr&&(Me?wn.length===gr.value.length&&gr.value.every((Gn,di)=>Ar(wn[di])===Ar(Gn)):zn(gr.value,wn))){const Gn=gr.filteredOptions[tn.current];if(Gn)return Mr.findIndex(di=>Ar(di)===Ar(Gn))}return-1},Bn=reactExports.useCallback(()=>{if(!pn)return;const zn=Ur();if(zn!==-1){tn.current=zn;return}const Gn=Me?wn[0]:wn;if(Mr.length===0||Gn==null){qr({diff:"reset"});return}if(_r.current){if(Gn!=null){const di=Mr[tn.current];if(Me&&di&&wn.findIndex(Ei=>Ke(di,Ei))!==-1)return;const hi=Mr.findIndex(Ei=>Ke(Ei,Gn));hi===-1?qr({diff:"reset"}):Dr({index:hi});return}if(tn.current>=Mr.length-1){Dr({index:Mr.length-1});return}Dr({index:tn.current})}},[Mr.length,Me?!1:wn,Ve,qr,Dr,pn,Vr,Me]),In=useEventCallback(zn=>{setRef(_r,zn),zn&&Bn()});reactExports.useEffect(()=>{Bn()},[Bn]);const Rr=zn=>{en||(Jr(!0),rn(!0),Ye&&Ye(zn))},Mn=(zn,Gn)=>{en&&(Jr(!1),De&&De(zn,Gn))},En=(zn,Gn,di,hi)=>{if(Me){if(wn.length===Gn.length&&wn.every((Ei,_i)=>Ei===Gn[_i]))return}else if(wn===Gn)return;je&&je(zn,Gn,di,hi),an(Gn)},Yr=reactExports.useRef(!1),Sn=(zn,Gn,di="selectOption",hi="options")=>{let Ei=di,_i=Gn;if(Me){_i=Array.isArray(wn)?wn.slice():[];const Mi=_i.findIndex(ji=>Ke(Gn,ji));Mi===-1?_i.push(Gn):hi!=="freeSolo"&&(_i.splice(Mi,1),Ei="removeOption")}jn(zn,_i,Ei),En(zn,_i,Ei,{option:Gn}),!$e&&(!zn||!zn.ctrlKey&&!zn.metaKey)&&Mn(zn,Ei),(_e===!0||_e==="touch"&&Yr.current||_e==="mouse"&&!Yr.current)&&br.current.blur()};function yn(zn,Gn){if(zn===-1)return-1;let di=zn;for(;;){if(Gn==="next"&&di===wn.length||Gn==="previous"&&di===-1)return-1;const hi=$r.querySelector(`[data-tag-index="${di}"]`);if(!hi||!hi.hasAttribute("tabindex")||hi.disabled||hi.getAttribute("aria-disabled")==="true")di+=Gn==="next"?1:-1;else return di}}const On=(zn,Gn)=>{if(!Me)return;Vr===""&&Mn(zn,"toggleInput");let di=Ir;Ir===-1?Vr===""&&Gn==="previous"&&(di=wn.length-1):(di+=Gn==="next"?1:-1,di<0&&(di=0),di===wn.length&&(di=-1)),di=yn(di,Gn),zr(di),Hr(di)},Nn=zn=>{vr.current=!0,Rn(""),Qe&&Qe(zn,"","clear"),En(zn,Me?[]:null,"clear")},kr=zn=>Gn=>{if(zn.onKeyDown&&zn.onKeyDown(Gn),!Gn.defaultMuiPrevented&&(Ir!==-1&&!["ArrowLeft","ArrowRight"].includes(Gn.key)&&(zr(-1),Hr(-1)),Gn.which!==229))switch(Gn.key){case"Home":pn&&sr&&(Gn.preventDefault(),qr({diff:"start",direction:"next",reason:"keyboard",event:Gn}));break;case"End":pn&&sr&&(Gn.preventDefault(),qr({diff:"end",direction:"previous",reason:"keyboard",event:Gn}));break;case"PageUp":Gn.preventDefault(),qr({diff:-5,direction:"previous",reason:"keyboard",event:Gn}),Rr(Gn);break;case"PageDown":Gn.preventDefault(),qr({diff:pageSize,direction:"next",reason:"keyboard",event:Gn}),Rr(Gn);break;case"ArrowDown":Gn.preventDefault(),qr({diff:1,direction:"next",reason:"keyboard",event:Gn}),Rr(Gn);break;case"ArrowUp":Gn.preventDefault(),qr({diff:-1,direction:"previous",reason:"keyboard",event:Gn}),Rr(Gn);break;case"ArrowLeft":On(Gn,"previous");break;case"ArrowRight":On(Gn,"next");break;case"Enter":if(tn.current!==-1&&pn){const di=Mr[tn.current],hi=Xe?Xe(di):!1;if(Gn.preventDefault(),hi)return;Sn(Gn,di,"selectOption"),Ee&&br.current.setSelectionRange(br.current.value.length,br.current.value.length)}else Ge&&Vr!==""&&cn===!1&&(Me&&Gn.preventDefault(),Sn(Gn,Vr,"createOption","freeSolo"));break;case"Escape":pn?(Gn.preventDefault(),Gn.stopPropagation(),Mn(Gn,"escape")):Be&&(Vr!==""||Me&&wn.length>0)&&(Gn.preventDefault(),Gn.stopPropagation(),Nn(Gn));break;case"Backspace":if(Me&&!Ze&&Vr===""&&wn.length>0){const di=Ir===-1?wn.length-1:Ir,hi=wn.slice();hi.splice(di,1),En(Gn,hi,"removeOption",{option:wn[di]})}break;case"Delete":if(Me&&!Ze&&Vr===""&&wn.length>0&&Ir!==-1){const di=Ir,hi=wn.slice();hi.splice(di,1),En(Gn,hi,"removeOption",{option:wn[di]})}break}},Er=zn=>{sn(!0),We&&!vr.current&&Rr(zn)},Tr=zn=>{if(Ae(_r)){br.current.focus();return}sn(!1),xr.current=!0,vr.current=!1,Ce&&tn.current!==-1&&pn?Sn(zn,Mr[tn.current],"blur"):Ce&&Ge&&Vr!==""?Sn(zn,Vr,"blur","freeSolo"):Ie&&jn(zn,wn,"blur"),Mn(zn,"blur")},Qr=zn=>{const Gn=zn.target.value;Vr!==Gn&&(Rn(Gn),rn(!1),Qe&&Qe(zn,Gn,"input")),Gn===""?!ke&&!Me&&En(zn,null,"clear"):Rr(zn)},Zr=zn=>{const Gn=Number(zn.currentTarget.getAttribute("data-option-index"));tn.current!==Gn&&Dr({event:zn,index:Gn,reason:"mouse"})},xn=zn=>{Dr({event:zn,index:Number(zn.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Yr.current=!0},An=zn=>{const Gn=Number(zn.currentTarget.getAttribute("data-option-index"));Sn(zn,Mr[Gn],"selectOption"),Yr.current=!1},Tn=zn=>Gn=>{const di=wn.slice();di.splice(zn,1),En(Gn,di,"removeOption",{option:wn[zn]})},ti=zn=>{en?Mn(zn,"toggleInput"):Rr(zn)},Fn=zn=>{zn.currentTarget.contains(zn.target)&&zn.target.getAttribute("id")!==fr&&zn.preventDefault()},$n=zn=>{zn.currentTarget.contains(zn.target)&&(br.current.focus(),ir&&xr.current&&br.current.selectionEnd-br.current.selectionStart===0&&br.current.select(),xr.current=!1)},Zn=zn=>{!Oe&&(Vr===""||!en)&&ti(zn)};let Dn=Ge&&Vr.length>0;Dn=Dn||(Me?wn.length>0:wn!==null);let Wn=Mr;return nr&&(Wn=Mr.reduce((zn,Gn,di)=>{const hi=nr(Gn);return zn.length>0&&zn[zn.length-1].group===hi?zn[zn.length-1].options.push(Gn):zn.push({key:di,index:di,group:hi,options:[Gn]}),zn},[])),Oe&&un&&Tr(),{getRootProps:(zn={})=>({...zn,onKeyDown:kr(zn),onMouseDown:Fn,onClick:$n}),getInputLabelProps:()=>({id:`${fr}-label`,htmlFor:fr}),getInputProps:()=>({id:fr,value:Vr,onBlur:Tr,onFocus:Er,onChange:Qr,onMouseDown:Zn,"aria-activedescendant":pn?"":null,"aria-autocomplete":Ee?"both":"list","aria-controls":Br?`${fr}-listbox`:void 0,"aria-expanded":Br,autoComplete:"off",ref:br,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:Oe}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Nn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:ti}),getTagProps:({index:zn})=>({key:zn,"data-tag-index":zn,tabIndex:-1,...!Ze&&{onDelete:Tn(zn)}}),getListboxProps:()=>({role:"listbox",id:`${fr}-listbox`,"aria-labelledby":`${fr}-label`,ref:In,onMouseDown:zn=>{zn.preventDefault()}}),getOptionProps:({index:zn,option:Gn})=>{const di=(Me?wn:[wn]).some(Ei=>Ei!=null&&Ke(Gn,Ei)),hi=Xe?Xe(Gn):!1;return{key:(er==null?void 0:er(Gn))??Ar(Gn),tabIndex:-1,role:"option",id:`${fr}-option-${zn}`,onMouseMove:Zr,onClick:An,onTouchStart:xn,"data-option-index":zn,"aria-disabled":hi,"aria-selected":di}},id:fr,inputValue:Vr,value:wn,dirty:Dn,expanded:pn&&$r,popupOpen:pn,focused:un||Ir!==-1,anchorEl:$r,setAnchorEl:Fr,focusedTag:Ir,groupedOptions:Wn}}function getListSubheaderUtilityClass(t){return generateUtilityClass("MuiListSubheader",t)}generateUtilityClasses("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const useUtilityClasses$1i=t=>{const{classes:Ae,color:xe,disableGutters:Ee,inset:Se,disableSticky:Ce}=t,_e={root:["root",xe!=="default"&&`color${capitalize$1(xe)}`,!Ee&&"gutters",Se&&"inset",!Ce&&"sticky"]};return composeClasses(_e,getListSubheaderUtilityClass,Ae)},ListSubheaderRoot=styled("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.color!=="default"&&Ae[`color${capitalize$1(xe.color)}`],!xe.disableGutters&&Ae.gutters,xe.inset&&Ae.inset,!xe.disableSticky&&Ae.sticky]}})(memoTheme(({theme:t})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(t.vars||t).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:Ae})=>!Ae.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:Ae})=>Ae.inset,style:{paddingLeft:72}},{props:({ownerState:Ae})=>!Ae.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper}}]}))),ListSubheader=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiListSubheader"}),{className:Se,color:Ce="default",component:_e="li",disableGutters:Ie=!1,disableSticky:Be=!1,inset:Te=!1,...Pe}=Ee,ke={...Ee,color:Ce,component:_e,disableGutters:Ie,disableSticky:Be,inset:Te},$e=useUtilityClasses$1i(ke);return jsxRuntimeExports.jsx(ListSubheaderRoot,{as:_e,className:clsx($e.root,Se),ref:xe,ownerState:ke,...Pe})});ListSubheader&&(ListSubheader.muiSkipListHighlight=!0);const CancelIcon$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function getChipUtilityClass(t){return generateUtilityClass("MuiChip",t)}const chipClasses=generateUtilityClasses("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),useUtilityClasses$1h=t=>{const{classes:Ae,disabled:xe,size:Ee,color:Se,iconColor:Ce,onDelete:_e,clickable:Ie,variant:Be}=t,Te={root:["root",Be,xe&&"disabled",`size${capitalize$1(Ee)}`,`color${capitalize$1(Se)}`,Ie&&"clickable",Ie&&`clickableColor${capitalize$1(Se)}`,_e&&"deletable",_e&&`deletableColor${capitalize$1(Se)}`,`${Be}${capitalize$1(Se)}`],label:["label",`label${capitalize$1(Ee)}`],avatar:["avatar",`avatar${capitalize$1(Ee)}`,`avatarColor${capitalize$1(Se)}`],icon:["icon",`icon${capitalize$1(Ee)}`,`iconColor${capitalize$1(Ce)}`],deleteIcon:["deleteIcon",`deleteIcon${capitalize$1(Ee)}`,`deleteIconColor${capitalize$1(Se)}`,`deleteIcon${capitalize$1(Be)}Color${capitalize$1(Se)}`]};return composeClasses(Te,getChipUtilityClass,Ae)},ChipRoot=styled("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t,{color:Ee,iconColor:Se,clickable:Ce,onDelete:_e,size:Ie,variant:Be}=xe;return[{[`& .${chipClasses.avatar}`]:Ae.avatar},{[`& .${chipClasses.avatar}`]:Ae[`avatar${capitalize$1(Ie)}`]},{[`& .${chipClasses.avatar}`]:Ae[`avatarColor${capitalize$1(Ee)}`]},{[`& .${chipClasses.icon}`]:Ae.icon},{[`& .${chipClasses.icon}`]:Ae[`icon${capitalize$1(Ie)}`]},{[`& .${chipClasses.icon}`]:Ae[`iconColor${capitalize$1(Se)}`]},{[`& .${chipClasses.deleteIcon}`]:Ae.deleteIcon},{[`& .${chipClasses.deleteIcon}`]:Ae[`deleteIcon${capitalize$1(Ie)}`]},{[`& .${chipClasses.deleteIcon}`]:Ae[`deleteIconColor${capitalize$1(Ee)}`]},{[`& .${chipClasses.deleteIcon}`]:Ae[`deleteIcon${capitalize$1(Be)}Color${capitalize$1(Ee)}`]},Ae.root,Ae[`size${capitalize$1(Ie)}`],Ae[`color${capitalize$1(Ee)}`],Ce&&Ae.clickable,Ce&&Ee!=="default"&&Ae[`clickableColor${capitalize$1(Ee)})`],_e&&Ae.deletable,_e&&Ee!=="default"&&Ae[`deletableColor${capitalize$1(Ee)}`],Ae[Be],Ae[`${Be}${capitalize$1(Ee)}`]]}})(memoTheme(({theme:t})=>{const Ae=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return{maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${chipClasses.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${chipClasses.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:Ae,fontSize:t.typography.pxToRem(12)},[`& .${chipClasses.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${chipClasses.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${chipClasses.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${chipClasses.icon}`]:{marginLeft:5,marginRight:-6},[`& .${chipClasses.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:alpha$3(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:alpha$3(t.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${chipClasses.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${chipClasses.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["contrastText"])).map(([xe])=>({props:{color:xe},style:{backgroundColor:(t.vars||t).palette[xe].main,color:(t.vars||t).palette[xe].contrastText,[`& .${chipClasses.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[xe].contrastTextChannel} / 0.7)`:alpha$3(t.palette[xe].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[xe].contrastText}}}})),{props:xe=>xe.iconColor===xe.color,style:{[`& .${chipClasses.icon}`]:{color:t.vars?t.vars.palette.Chip.defaultIconColor:Ae}}},{props:xe=>xe.iconColor===xe.color&&xe.color!=="default",style:{[`& .${chipClasses.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${chipClasses.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:alpha$3(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["dark"])).map(([xe])=>({props:{color:xe,onDelete:!0},style:{[`&.${chipClasses.focusVisible}`]:{background:(t.vars||t).palette[xe].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:alpha$3(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${chipClasses.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:alpha$3(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["dark"])).map(([xe])=>({props:{color:xe,clickable:!0},style:{[`&:hover, &.${chipClasses.focusVisible}`]:{backgroundColor:(t.vars||t).palette[xe].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${chipClasses.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${chipClasses.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${chipClasses.avatar}`]:{marginLeft:4},[`& .${chipClasses.avatarSmall}`]:{marginLeft:2},[`& .${chipClasses.icon}`]:{marginLeft:4},[`& .${chipClasses.iconSmall}`]:{marginLeft:2},[`& .${chipClasses.deleteIcon}`]:{marginRight:5},[`& .${chipClasses.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([xe])=>({props:{variant:"outlined",color:xe},style:{color:(t.vars||t).palette[xe].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[xe].mainChannel} / 0.7)`:alpha$3(t.palette[xe].main,.7)}`,[`&.${chipClasses.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[xe].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette[xe].main,t.palette.action.hoverOpacity)},[`&.${chipClasses.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[xe].mainChannel} / ${t.vars.palette.action.focusOpacity})`:alpha$3(t.palette[xe].main,t.palette.action.focusOpacity)},[`& .${chipClasses.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[xe].mainChannel} / 0.7)`:alpha$3(t.palette[xe].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[xe].main}}}}))]}})),ChipLabel=styled("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t,{size:Ee}=xe;return[Ae.label,Ae[`label${capitalize$1(Ee)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function isDeleteKeyboardEvent(t){return t.key==="Backspace"||t.key==="Delete"}const Chip=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiChip"}),{avatar:Se,className:Ce,clickable:_e,color:Ie="default",component:Be,deleteIcon:Te,disabled:Pe=!1,icon:ke,label:$e,onClick:Oe,onDelete:Ue,onKeyDown:qe,onKeyUp:ze,size:Ve="medium",variant:Ge="filled",tabIndex:Xe,skipFocusWhenDisabled:er=!1,...tr}=Ee,nr=reactExports.useRef(null),sr=useForkRef(nr,xe),dr=We=>{We.stopPropagation(),Ue&&Ue(We)},ar=We=>{We.currentTarget===We.target&&isDeleteKeyboardEvent(We)&&We.preventDefault(),qe&&qe(We)},lr=We=>{We.currentTarget===We.target&&Ue&&isDeleteKeyboardEvent(We)&&Ue(We),ze&&ze(We)},Ke=_e!==!1&&Oe?!0:_e,Me=Ke||Ue?ButtonBase:Be||"div",je={...Ee,component:Me,disabled:Pe,size:Ve,color:Ie,iconColor:reactExports.isValidElement(ke)&&ke.props.color||Ie,onDelete:!!Ue,clickable:Ke,variant:Ge},De=useUtilityClasses$1h(je),He=Me===ButtonBase?{component:Be||"div",focusVisibleClassName:De.focusVisible,...Ue&&{disableRipple:!0}}:{};let Qe=null;Ue&&(Qe=Te&&reactExports.isValidElement(Te)?reactExports.cloneElement(Te,{className:clsx(Te.props.className,De.deleteIcon),onClick:dr}):jsxRuntimeExports.jsx(CancelIcon$1,{className:clsx(De.deleteIcon),onClick:dr}));let Ye=null;Se&&reactExports.isValidElement(Se)&&(Ye=reactExports.cloneElement(Se,{className:clsx(De.avatar,Se.props.className)}));let St=null;return ke&&reactExports.isValidElement(ke)&&(St=reactExports.cloneElement(ke,{className:clsx(De.icon,ke.props.className)})),jsxRuntimeExports.jsxs(ChipRoot,{as:Me,className:clsx(De.root,Ce),disabled:Ke&&Pe?!0:void 0,onClick:Oe,onKeyDown:ar,onKeyUp:lr,ref:sr,tabIndex:er&&Pe?-1:Xe,ownerState:je,...He,...tr,children:[Ye||St,jsxRuntimeExports.jsx(ChipLabel,{className:clsx(De.label),ownerState:je,children:$e}),Qe]})});function getAutocompleteUtilityClass(t){return generateUtilityClass("MuiAutocomplete",t)}const autocompleteClasses=generateUtilityClasses("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var _ClearIcon,_ArrowDropDownIcon;const useUtilityClasses$1g=t=>{const{classes:Ae,disablePortal:xe,expanded:Ee,focused:Se,fullWidth:Ce,hasClearIcon:_e,hasPopupIcon:Ie,inputFocused:Be,popupOpen:Te,size:Pe}=t,ke={root:["root",Ee&&"expanded",Se&&"focused",Ce&&"fullWidth",_e&&"hasClearIcon",Ie&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",Be&&"inputFocused"],tag:["tag",`tagSize${capitalize$1(Pe)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",Te&&"popupIndicatorOpen"],popper:["popper",xe&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return composeClasses(ke,getAutocompleteUtilityClass,Ae)},AutocompleteRoot=styled("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t,{fullWidth:Ee,hasClearIcon:Se,hasPopupIcon:Ce,inputFocused:_e,size:Ie}=xe;return[{[`& .${autocompleteClasses.tag}`]:Ae.tag},{[`& .${autocompleteClasses.tag}`]:Ae[`tagSize${capitalize$1(Ie)}`]},{[`& .${autocompleteClasses.inputRoot}`]:Ae.inputRoot},{[`& .${autocompleteClasses.input}`]:Ae.input},{[`& .${autocompleteClasses.input}`]:_e&&Ae.inputFocused},Ae.root,Ee&&Ae.fullWidth,Ce&&Ae.hasPopupIcon,Se&&Ae.hasClearIcon]}})({[`&.${autocompleteClasses.focused} .${autocompleteClasses.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${autocompleteClasses.clearIndicator}`]:{visibility:"visible"}},[`& .${autocompleteClasses.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${autocompleteClasses.inputRoot}`]:{[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:30},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:56},[`& .${autocompleteClasses.input}`]:{width:0,minWidth:30}},[`& .${inputClasses.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${inputClasses.root}.${inputBaseClasses.sizeSmall}`]:{[`& .${inputClasses.input}`]:{padding:"2px 4px 3px 0"}},[`& .${outlinedInputClasses.root}`]:{padding:9,[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:39},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:65},[`& .${autocompleteClasses.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${autocompleteClasses.endAdornment}`]:{right:9}},[`& .${outlinedInputClasses.root}.${inputBaseClasses.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${autocompleteClasses.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${filledInputClasses.root}`]:{paddingTop:19,paddingLeft:8,[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:39},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:65},[`& .${filledInputClasses.input}`]:{padding:"7px 4px"},[`& .${autocompleteClasses.endAdornment}`]:{right:9}},[`& .${filledInputClasses.root}.${inputBaseClasses.sizeSmall}`]:{paddingBottom:1,[`& .${filledInputClasses.input}`]:{padding:"2.5px 4px"}},[`& .${inputBaseClasses.hiddenLabel}`]:{paddingTop:8},[`& .${filledInputClasses.root}.${inputBaseClasses.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${autocompleteClasses.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${filledInputClasses.root}.${inputBaseClasses.hiddenLabel}.${inputBaseClasses.sizeSmall}`]:{[`& .${autocompleteClasses.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${autocompleteClasses.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${autocompleteClasses.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${autocompleteClasses.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${autocompleteClasses.inputRoot}`]:{flexWrap:"wrap"}}}]}),AutocompleteEndAdornment=styled("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,Ae)=>Ae.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),AutocompleteClearIndicator=styled(IconButton,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,Ae)=>Ae.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),AutocompletePopupIndicator=styled(IconButton,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.popupIndicator,xe.popupOpen&&Ae.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),AutocompletePopper=styled(Popper,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`& .${autocompleteClasses.option}`]:Ae.option},Ae.popper,xe.disablePortal&&Ae.popperDisablePortal]}})(memoTheme(({theme:t})=>({zIndex:(t.vars||t).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),AutocompletePaper=styled(Paper,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,Ae)=>Ae.paper})(memoTheme(({theme:t})=>({...t.typography.body1,overflow:"auto"}))),AutocompleteLoading=styled("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,Ae)=>Ae.loading})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}))),AutocompleteNoOptions=styled("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,Ae)=>Ae.noOptions})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"}))),AutocompleteListbox=styled("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,Ae)=>Ae.listbox})(memoTheme(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${autocompleteClasses.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${autocompleteClasses.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${autocompleteClasses.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${autocompleteClasses.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${autocompleteClasses.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:alpha$3(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}}))),AutocompleteGroupLabel=styled(ListSubheader,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,Ae)=>Ae.groupLabel})(memoTheme(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8}))),AutocompleteGroupUl=styled("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,Ae)=>Ae.groupUl})({padding:0,[`& .${autocompleteClasses.option}`]:{paddingLeft:24}}),Autocomplete=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiAutocomplete"}),{autoComplete:Se=!1,autoHighlight:Ce=!1,autoSelect:_e=!1,blurOnSelect:Ie=!1,ChipProps:Be,className:Te,clearIcon:Pe=_ClearIcon||(_ClearIcon=jsxRuntimeExports.jsx(ClearIcon$1,{fontSize:"small"})),clearOnBlur:ke=!Ee.freeSolo,clearOnEscape:$e=!1,clearText:Oe="Clear",closeText:Ue="Close",componentsProps:qe,defaultValue:ze=Ee.multiple?[]:null,disableClearable:Ve=!1,disableCloseOnSelect:Ge=!1,disabled:Xe=!1,disabledItemsFocusable:er=!1,disableListWrap:tr=!1,disablePortal:nr=!1,filterOptions:sr,filterSelectedOptions:dr=!1,forcePopupIcon:ar="auto",freeSolo:lr=!1,fullWidth:Ke=!1,getLimitTagsText:Me=yi=>`+${yi}`,getOptionDisabled:je,getOptionKey:De,getOptionLabel:He,isOptionEqualToValue:Qe,groupBy:Ye,handleHomeEndKeys:St=!Ee.freeSolo,id:We,includeInputInList:Fe=!1,inputValue:Ze,limitTags:ir=-1,ListboxComponent:ur,ListboxProps:fr,loading:Ar=!1,loadingText:vr="Loading…",multiple:xr=!1,noOptionsText:br="No options",onChange:_r,onClose:$r,onHighlightChange:Fr,onInputChange:Ir,onOpen:zr,open:dn,openOnFocus:tn=!1,openText:Gr="Open",options:wn,PaperComponent:an,PopperComponent:Vr,popupIcon:Rn=_ArrowDropDownIcon||(_ArrowDropDownIcon=jsxRuntimeExports.jsx(ArrowDropDownIcon,{})),readOnly:un=!1,renderGroup:sn,renderInput:jn,renderOption:en,renderTags:Jr,selectOnFocus:nn=!Ee.freeSolo,size:rn="medium",slots:cn={},slotProps:pn={},value:Mr,...gr}=Ee,{getRootProps:Br,getInputProps:Hr,getInputLabelProps:Kr,getPopupIndicatorProps:Dr,getClearProps:qr,getTagProps:Ur,getListboxProps:Bn,getOptionProps:In,value:Rr,dirty:Mn,expanded:En,id:Yr,popupOpen:Sn,focused:yn,focusedTag:On,anchorEl:Nn,setAnchorEl:kr,inputValue:Er,groupedOptions:Tr}=useAutocomplete({...Ee,componentName:"Autocomplete"}),Qr=!Ve&&!Xe&&Mn&&!un,Zr=(!lr||ar===!0)&&ar!==!1,{onMouseDown:xn}=Hr(),{ref:An,...Tn}=Bn(),Fn=He||(yi=>yi.label??yi),$n={...Ee,disablePortal:nr,expanded:En,focused:yn,fullWidth:Ke,getOptionLabel:Fn,hasClearIcon:Qr,hasPopupIcon:Zr,inputFocused:On===-1,popupOpen:Sn,size:rn},Zn=useUtilityClasses$1g($n),Dn={slots:{paper:an,popper:Vr,...cn},slotProps:{chip:Be,listbox:fr,...qe,...pn}},[Wn,zn]=useSlot("listbox",{elementType:AutocompleteListbox,externalForwardedProps:Dn,ownerState:$n,className:Zn.listbox,additionalProps:Tn,ref:An}),[Gn,di]=useSlot("paper",{elementType:Paper,externalForwardedProps:Dn,ownerState:$n,className:Zn.paper}),[hi,Ei]=useSlot("popper",{elementType:Popper,externalForwardedProps:Dn,ownerState:$n,className:Zn.popper,additionalProps:{disablePortal:nr,style:{width:Nn?Nn.clientWidth:null},role:"presentation",anchorEl:Nn,open:Sn}});let _i;if(xr&&Rr.length>0){const yi=Di=>({className:Zn.tag,disabled:Xe,...Ur(Di)});Jr?_i=Jr(Rr,yi,$n):_i=Rr.map((Di,Hi)=>{const{key:Wi,...Ki}=yi({index:Hi});return jsxRuntimeExports.jsx(Chip,{label:Fn(Di),size:rn,...Ki,...Dn.slotProps.chip},Wi)})}if(ir>-1&&Array.isArray(_i)){const yi=_i.length-ir;!yn&&yi>0&&(_i=_i.splice(0,ir),_i.push(jsxRuntimeExports.jsx("span",{className:Zn.tag,children:Me(yi)},_i.length)))}const ji=sn||(yi=>jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx(AutocompleteGroupLabel,{className:Zn.groupLabel,ownerState:$n,component:"div",children:yi.group}),jsxRuntimeExports.jsx(AutocompleteGroupUl,{className:Zn.groupUl,ownerState:$n,children:yi.children})]},yi.key)),Li=en||((yi,Di)=>{const{key:Hi,...Wi}=yi;return jsxRuntimeExports.jsx("li",{...Wi,children:Fn(Di)},Hi)}),oo=(yi,Di)=>{const Hi=In({option:yi,index:Di});return Li({...Hi,className:Zn.option},yi,{selected:Hi["aria-selected"],index:Di,inputValue:Er},$n)},Vi=Dn.slotProps.clearIndicator,eo=Dn.slotProps.popupIndicator;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(AutocompleteRoot,{ref:xe,className:clsx(Zn.root,Te),ownerState:$n,...Br(gr),children:jn({id:Yr,disabled:Xe,fullWidth:!0,size:rn==="small"?"small":void 0,InputLabelProps:Kr(),InputProps:{ref:kr,className:Zn.inputRoot,startAdornment:_i,onMouseDown:yi=>{yi.target===yi.currentTarget&&xn(yi)},...(Qr||Zr)&&{endAdornment:jsxRuntimeExports.jsxs(AutocompleteEndAdornment,{className:Zn.endAdornment,ownerState:$n,children:[Qr?jsxRuntimeExports.jsx(AutocompleteClearIndicator,{...qr(),"aria-label":Oe,title:Oe,ownerState:$n,...Vi,className:clsx(Zn.clearIndicator,Vi==null?void 0:Vi.className),children:Pe}):null,Zr?jsxRuntimeExports.jsx(AutocompletePopupIndicator,{...Dr(),disabled:Xe,"aria-label":Sn?Ue:Gr,title:Sn?Ue:Gr,ownerState:$n,...eo,className:clsx(Zn.popupIndicator,eo==null?void 0:eo.className),children:Rn}):null]})}},inputProps:{className:Zn.input,disabled:Xe,readOnly:un,...Hr()}})}),Nn?jsxRuntimeExports.jsx(AutocompletePopper,{as:hi,...Ei,children:jsxRuntimeExports.jsxs(AutocompletePaper,{as:Gn,...di,children:[Ar&&Tr.length===0?jsxRuntimeExports.jsx(AutocompleteLoading,{className:Zn.loading,ownerState:$n,children:vr}):null,Tr.length===0&&!lr&&!Ar?jsxRuntimeExports.jsx(AutocompleteNoOptions,{className:Zn.noOptions,ownerState:$n,role:"presentation",onMouseDown:yi=>{yi.preventDefault()},children:br}):null,Tr.length>0?jsxRuntimeExports.jsx(Wn,{as:ur,...zn,children:Tr.map((yi,Di)=>Ye?ji({key:yi.key,group:yi.group,children:yi.options.map((Hi,Wi)=>oo(Hi,yi.index+Wi))}):oo(yi,Di))}):null]})}):null]})});function useBadge(t){const{badgeContent:Ae,invisible:xe=!1,max:Ee=99,showZero:Se=!1}=t,Ce=usePreviousProps({badgeContent:Ae,max:Ee});let _e=xe;xe===!1&&Ae===0&&!Se&&(_e=!0);const{badgeContent:Ie,max:Be=Ee}=_e?Ce:t,Te=Ie&&Number(Ie)>Be?`${Be}+`:Ie;return{badgeContent:Ie,invisible:_e,max:Be,displayValue:Te}}function getBadgeUtilityClass(t){return generateUtilityClass("MuiBadge",t)}const badgeClasses=generateUtilityClasses("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),RADIUS_STANDARD=10,RADIUS_DOT=4,useUtilityClasses$1f=t=>{const{color:Ae,anchorOrigin:xe,invisible:Ee,overlap:Se,variant:Ce,classes:_e={}}=t,Ie={root:["root"],badge:["badge",Ce,Ee&&"invisible",`anchorOrigin${capitalize$1(xe.vertical)}${capitalize$1(xe.horizontal)}`,`anchorOrigin${capitalize$1(xe.vertical)}${capitalize$1(xe.horizontal)}${capitalize$1(Se)}`,`overlap${capitalize$1(Se)}`,Ae!=="default"&&`color${capitalize$1(Ae)}`]};return composeClasses(Ie,getBadgeUtilityClass,_e)},BadgeRoot=styled("span",{name:"MuiBadge",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),BadgeBadge=styled("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.badge,Ae[xe.variant],Ae[`anchorOrigin${capitalize$1(xe.anchorOrigin.vertical)}${capitalize$1(xe.anchorOrigin.horizontal)}${capitalize$1(xe.overlap)}`],xe.color!=="default"&&Ae[`color${capitalize$1(xe.color)}`],xe.invisible&&Ae.invisible]}})(memoTheme(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(12),minWidth:RADIUS_STANDARD*2,lineHeight:1,padding:"0 6px",height:RADIUS_STANDARD*2,borderRadius:RADIUS_STANDARD,zIndex:1,transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.enteringScreen}),variants:[...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["contrastText"])).map(([Ae])=>({props:{color:Ae},style:{backgroundColor:(t.vars||t).palette[Ae].main,color:(t.vars||t).palette[Ae].contrastText}})),{props:{variant:"dot"},style:{borderRadius:RADIUS_DOT,height:RADIUS_DOT*2,minWidth:RADIUS_DOT*2,padding:0}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="top"&&Ae.anchorOrigin.horizontal==="right"&&Ae.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="bottom"&&Ae.anchorOrigin.horizontal==="right"&&Ae.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="top"&&Ae.anchorOrigin.horizontal==="left"&&Ae.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="bottom"&&Ae.anchorOrigin.horizontal==="left"&&Ae.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="top"&&Ae.anchorOrigin.horizontal==="right"&&Ae.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="bottom"&&Ae.anchorOrigin.horizontal==="right"&&Ae.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="top"&&Ae.anchorOrigin.horizontal==="left"&&Ae.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:Ae})=>Ae.anchorOrigin.vertical==="bottom"&&Ae.anchorOrigin.horizontal==="left"&&Ae.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.leavingScreen})}}]})));function getAnchorOrigin(t){return{vertical:(t==null?void 0:t.vertical)??"top",horizontal:(t==null?void 0:t.horizontal)??"right"}}const Badge=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiBadge"}),{anchorOrigin:Se,className:Ce,classes:_e,component:Ie,components:Be={},componentsProps:Te={},children:Pe,overlap:ke="rectangular",color:$e="default",invisible:Oe=!1,max:Ue=99,badgeContent:qe,slots:ze,slotProps:Ve,showZero:Ge=!1,variant:Xe="standard",...er}=Ee,{badgeContent:tr,invisible:nr,max:sr,displayValue:dr}=useBadge({max:Ue,invisible:Oe,badgeContent:qe,showZero:Ge}),ar=usePreviousProps({anchorOrigin:getAnchorOrigin(Se),color:$e,overlap:ke,variant:Xe,badgeContent:qe}),lr=nr||tr==null&&Xe!=="dot",{color:Ke=$e,overlap:Me=ke,anchorOrigin:je,variant:De=Xe}=lr?ar:Ee,He=getAnchorOrigin(je),Qe=De!=="dot"?dr:void 0,Ye={...Ee,badgeContent:tr,invisible:lr,max:sr,displayValue:Qe,showZero:Ge,anchorOrigin:He,color:Ke,overlap:Me,variant:De},St=useUtilityClasses$1f(Ye),We=(ze==null?void 0:ze.root)??Be.Root??BadgeRoot,Fe=(ze==null?void 0:ze.badge)??Be.Badge??BadgeBadge,Ze=(Ve==null?void 0:Ve.root)??Te.root,ir=(Ve==null?void 0:Ve.badge)??Te.badge,ur=useSlotProps({elementType:We,externalSlotProps:Ze,externalForwardedProps:er,additionalProps:{ref:xe,as:Ie},ownerState:Ye,className:clsx(Ze==null?void 0:Ze.className,St.root,Ce)}),fr=useSlotProps({elementType:Fe,externalSlotProps:ir,ownerState:Ye,className:clsx(St.badge,ir==null?void 0:ir.className)});return jsxRuntimeExports.jsxs(We,{...ur,children:[Pe,jsxRuntimeExports.jsx(Fe,{...fr,children:Qe})]})});function getCardUtilityClass(t){return generateUtilityClass("MuiCard",t)}generateUtilityClasses("MuiCard",["root"]);const useUtilityClasses$1e=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getCardUtilityClass,Ae)},CardRoot=styled(Paper,{name:"MuiCard",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({overflow:"hidden"}),Card=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiCard"}),{className:Se,raised:Ce=!1,..._e}=Ee,Ie={...Ee,raised:Ce},Be=useUtilityClasses$1e(Ie);return jsxRuntimeExports.jsx(CardRoot,{className:clsx(Be.root,Se),elevation:Ce?8:void 0,ref:xe,ownerState:Ie,..._e})});function getCardContentUtilityClass(t){return generateUtilityClass("MuiCardContent",t)}generateUtilityClasses("MuiCardContent",["root"]);const useUtilityClasses$1d=t=>{const{classes:Ae}=t;return composeClasses({root:["root"]},getCardContentUtilityClass,Ae)},CardContentRoot=styled("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({padding:16,"&:last-child":{paddingBottom:24}}),CardContent=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiCardContent"}),{className:Se,component:Ce="div",..._e}=Ee,Ie={...Ee,component:Ce},Be=useUtilityClasses$1d(Ie);return jsxRuntimeExports.jsx(CardContentRoot,{as:Ce,className:clsx(Be.root,Se),ownerState:Ie,ref:xe,..._e})});function getSwitchBaseUtilityClass(t){return generateUtilityClass("PrivateSwitchBase",t)}generateUtilityClasses("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const useUtilityClasses$1c=t=>{const{classes:Ae,checked:xe,disabled:Ee,edge:Se}=t,Ce={root:["root",xe&&"checked",Ee&&"disabled",Se&&`edge${capitalize$1(Se)}`],input:["input"]};return composeClasses(Ce,getSwitchBaseUtilityClass,Ae)},SwitchBaseRoot=styled(ButtonBase)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:t,ownerState:Ae})=>t==="start"&&Ae.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:t,ownerState:Ae})=>t==="end"&&Ae.size!=="small",style:{marginRight:-12}}]}),SwitchBaseInput=styled("input",{shouldForwardProp:rootShouldForwardProp})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),SwitchBase=reactExports.forwardRef(function(Ae,xe){const{autoFocus:Ee,checked:Se,checkedIcon:Ce,defaultChecked:_e,disabled:Ie,disableFocusRipple:Be=!1,edge:Te=!1,icon:Pe,id:ke,inputProps:$e,inputRef:Oe,name:Ue,onBlur:qe,onChange:ze,onFocus:Ve,readOnly:Ge,required:Xe=!1,tabIndex:er,type:tr,value:nr,slots:sr={},slotProps:dr={},...ar}=Ae,[lr,Ke]=useControlled({controlled:Se,default:!!_e,name:"SwitchBase",state:"checked"}),Me=useFormControl(),je=Ar=>{Ve&&Ve(Ar),Me&&Me.onFocus&&Me.onFocus(Ar)},De=Ar=>{qe&&qe(Ar),Me&&Me.onBlur&&Me.onBlur(Ar)},He=Ar=>{if(Ar.nativeEvent.defaultPrevented)return;const vr=Ar.target.checked;Ke(vr),ze&&ze(Ar,vr)};let Qe=Ie;Me&&typeof Qe>"u"&&(Qe=Me.disabled);const Ye=tr==="checkbox"||tr==="radio",St={...Ae,checked:lr,disabled:Qe,disableFocusRipple:Be,edge:Te},We=useUtilityClasses$1c(St),Fe={slots:sr,slotProps:{input:$e,...dr}},[Ze,ir]=useSlot("root",{ref:xe,elementType:SwitchBaseRoot,className:We.root,shouldForwardComponentProp:!0,externalForwardedProps:{...Fe,component:"span",...ar},getSlotProps:Ar=>({...Ar,onFocus:vr=>{var xr;(xr=Ar.onFocus)==null||xr.call(Ar,vr),je(vr)},onBlur:vr=>{var xr;(xr=Ar.onBlur)==null||xr.call(Ar,vr),De(vr)}}),ownerState:St,additionalProps:{centerRipple:!0,focusRipple:!Be,disabled:Qe,role:void 0,tabIndex:null}}),[ur,fr]=useSlot("input",{ref:Oe,elementType:SwitchBaseInput,className:We.input,externalForwardedProps:Fe,getSlotProps:Ar=>({onChange:vr=>{var xr;(xr=Ar.onChange)==null||xr.call(Ar,vr),He(vr)}}),ownerState:St,additionalProps:{autoFocus:Ee,checked:Se,defaultChecked:_e,disabled:Qe,id:Ye?ke:void 0,name:Ue,readOnly:Ge,required:Xe,tabIndex:er,type:tr,...tr==="checkbox"&&nr===void 0?{}:{value:nr}}});return jsxRuntimeExports.jsxs(Ze,{...ir,children:[jsxRuntimeExports.jsx(ur,{...fr}),lr?Ce:Pe]})}),CheckBoxOutlineBlankIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),CheckBoxIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),IndeterminateCheckBoxIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function getCheckboxUtilityClass(t){return generateUtilityClass("MuiCheckbox",t)}const checkboxClasses=generateUtilityClasses("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),useUtilityClasses$1b=t=>{const{classes:Ae,indeterminate:xe,color:Ee,size:Se}=t,Ce={root:["root",xe&&"indeterminate",`color${capitalize$1(Ee)}`,`size${capitalize$1(Se)}`]},_e=composeClasses(Ce,getCheckboxUtilityClass,Ae);return{...Ae,..._e}},CheckboxRoot=styled(SwitchBase,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.indeterminate&&Ae.indeterminate,Ae[`size${capitalize$1(xe.size)}`],xe.color!=="default"&&Ae[`color${capitalize$1(xe.color)}`]]}})(memoTheme(({theme:t})=>({color:(t.vars||t).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{color:Ae,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[Ae].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:alpha$3(t.palette[Ae].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(createSimplePaletteValueFilter()).map(([Ae])=>({props:{color:Ae},style:{[`&.${checkboxClasses.checked}, &.${checkboxClasses.indeterminate}`]:{color:(t.vars||t).palette[Ae].main},[`&.${checkboxClasses.disabled}`]:{color:(t.vars||t).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),defaultCheckedIcon$1=jsxRuntimeExports.jsx(CheckBoxIcon,{}),defaultIcon$1=jsxRuntimeExports.jsx(CheckBoxOutlineBlankIcon,{}),defaultIndeterminateIcon=jsxRuntimeExports.jsx(IndeterminateCheckBoxIcon,{}),Checkbox=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiCheckbox"}),{checkedIcon:Se=defaultCheckedIcon$1,color:Ce="primary",icon:_e=defaultIcon$1,indeterminate:Ie=!1,indeterminateIcon:Be=defaultIndeterminateIcon,inputProps:Te,size:Pe="medium",disableRipple:ke=!1,className:$e,slots:Oe={},slotProps:Ue={},...qe}=Ee,ze=Ie?Be:_e,Ve=Ie?Be:Se,Ge={...Ee,disableRipple:ke,color:Ce,indeterminate:Ie,size:Pe},Xe=useUtilityClasses$1b(Ge),er=Ue.input??Te,[tr,nr]=useSlot("root",{ref:xe,elementType:CheckboxRoot,className:clsx(Xe.root,$e),shouldForwardComponentProp:!0,externalForwardedProps:{slots:Oe,slotProps:Ue,...qe},ownerState:Ge,additionalProps:{type:"checkbox",icon:reactExports.cloneElement(ze,{fontSize:ze.props.fontSize??Pe}),checkedIcon:reactExports.cloneElement(Ve,{fontSize:Ve.props.fontSize??Pe}),disableRipple:ke,slots:Oe,slotProps:{input:mergeSlotProps(typeof er=="function"?er(Ge):er,{"data-indeterminate":Ie})}}});return jsxRuntimeExports.jsx(tr,{...nr,classes:Xe})});function mapEventPropToEvent(t){return t.substring(2).toLowerCase()}function clickedRootScrollbar(t,Ae){return Ae.documentElement.clientWidth<t.clientX||Ae.documentElement.clientHeight<t.clientY}function ClickAwayListener(t){const{children:Ae,disableReactTree:xe=!1,mouseEvent:Ee="onClick",onClickAway:Se,touchEvent:Ce="onTouchEnd"}=t,_e=reactExports.useRef(!1),Ie=reactExports.useRef(null),Be=reactExports.useRef(!1),Te=reactExports.useRef(!1);reactExports.useEffect(()=>(setTimeout(()=>{Be.current=!0},0),()=>{Be.current=!1}),[]);const Pe=useForkRef(getReactElementRef(Ae),Ie),ke=useEventCallback(Ue=>{const qe=Te.current;Te.current=!1;const ze=ownerDocument(Ie.current);if(!Be.current||!Ie.current||"clientX"in Ue&&clickedRootScrollbar(Ue,ze))return;if(_e.current){_e.current=!1;return}let Ve;Ue.composedPath?Ve=Ue.composedPath().includes(Ie.current):Ve=!ze.documentElement.contains(Ue.target)||Ie.current.contains(Ue.target),!Ve&&(xe||!qe)&&Se(Ue)}),$e=Ue=>qe=>{Te.current=!0;const ze=Ae.props[Ue];ze&&ze(qe)},Oe={ref:Pe};return Ce!==!1&&(Oe[Ce]=$e(Ce)),reactExports.useEffect(()=>{if(Ce!==!1){const Ue=mapEventPropToEvent(Ce),qe=ownerDocument(Ie.current),ze=()=>{_e.current=!0};return qe.addEventListener(Ue,ke),qe.addEventListener("touchmove",ze),()=>{qe.removeEventListener(Ue,ke),qe.removeEventListener("touchmove",ze)}}},[ke,Ce]),Ee!==!1&&(Oe[Ee]=$e(Ee)),reactExports.useEffect(()=>{if(Ee!==!1){const Ue=mapEventPropToEvent(Ee),qe=ownerDocument(Ie.current);return qe.addEventListener(Ue,ke),()=>{qe.removeEventListener(Ue,ke)}}},[ke,Ee]),reactExports.cloneElement(Ae,Oe)}const Container=createContainer$1({createStyledComponent:styled("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[`maxWidth${capitalize$1(String(xe.maxWidth))}`],xe.fixed&&Ae.fixed,xe.disableGutters&&Ae.disableGutters]}}),useThemeProps:t=>useDefaultProps({props:t,name:"MuiContainer"})});function getDialogContentTextUtilityClass(t){return generateUtilityClass("MuiDialogContentText",t)}generateUtilityClasses("MuiDialogContentText",["root"]);const useUtilityClasses$1a=t=>{const{classes:Ae}=t,Ee=composeClasses({root:["root"]},getDialogContentTextUtilityClass,Ae);return{...Ae,...Ee}},DialogContentTextRoot=styled(Typography,{shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,Ae)=>Ae.root})({}),DialogContentText=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiDialogContentText"}),{children:Se,className:Ce,..._e}=Ee,Ie=useUtilityClasses$1a(_e);return jsxRuntimeExports.jsx(DialogContentTextRoot,{component:"p",variant:"body1",color:"textSecondary",ref:xe,ownerState:_e,className:clsx(Ie.root,Ce),...Ee,classes:Ie})});function getTranslateValue(t,Ae,xe){const Ee=Ae.getBoundingClientRect(),Se=xe&&xe.getBoundingClientRect(),Ce=ownerWindow(Ae);let _e;if(Ae.fakeTransform)_e=Ae.fakeTransform;else{const Te=Ce.getComputedStyle(Ae);_e=Te.getPropertyValue("-webkit-transform")||Te.getPropertyValue("transform")}let Ie=0,Be=0;if(_e&&_e!=="none"&&typeof _e=="string"){const Te=_e.split("(")[1].split(")")[0].split(",");Ie=parseInt(Te[4],10),Be=parseInt(Te[5],10)}return t==="left"?Se?`translateX(${Se.right+Ie-Ee.left}px)`:`translateX(${Ce.innerWidth+Ie-Ee.left}px)`:t==="right"?Se?`translateX(-${Ee.right-Se.left-Ie}px)`:`translateX(-${Ee.left+Ee.width-Ie}px)`:t==="up"?Se?`translateY(${Se.bottom+Be-Ee.top}px)`:`translateY(${Ce.innerHeight+Be-Ee.top}px)`:Se?`translateY(-${Ee.top-Se.top+Ee.height-Be}px)`:`translateY(-${Ee.top+Ee.height-Be}px)`}function resolveContainer(t){return typeof t=="function"?t():t}function setTranslateValue(t,Ae,xe){const Ee=resolveContainer(xe),Se=getTranslateValue(t,Ae,Ee);Se&&(Ae.style.webkitTransform=Se,Ae.style.transform=Se)}const Slide=reactExports.forwardRef(function(Ae,xe){const Ee=useTheme(),Se={enter:Ee.transitions.easing.easeOut,exit:Ee.transitions.easing.sharp},Ce={enter:Ee.transitions.duration.enteringScreen,exit:Ee.transitions.duration.leavingScreen},{addEndListener:_e,appear:Ie=!0,children:Be,container:Te,direction:Pe="down",easing:ke=Se,in:$e,onEnter:Oe,onEntered:Ue,onEntering:qe,onExit:ze,onExited:Ve,onExiting:Ge,style:Xe,timeout:er=Ce,TransitionComponent:tr=Transition,...nr}=Ae,sr=reactExports.useRef(null),dr=useForkRef(getReactElementRef(Be),sr,xe),ar=St=>We=>{St&&(We===void 0?St(sr.current):St(sr.current,We))},lr=ar((St,We)=>{setTranslateValue(Pe,St,Te),reflow(St),Oe&&Oe(St,We)}),Ke=ar((St,We)=>{const Fe=getTransitionProps({timeout:er,style:Xe,easing:ke},{mode:"enter"});St.style.webkitTransition=Ee.transitions.create("-webkit-transform",{...Fe}),St.style.transition=Ee.transitions.create("transform",{...Fe}),St.style.webkitTransform="none",St.style.transform="none",qe&&qe(St,We)}),Me=ar(Ue),je=ar(Ge),De=ar(St=>{const We=getTransitionProps({timeout:er,style:Xe,easing:ke},{mode:"exit"});St.style.webkitTransition=Ee.transitions.create("-webkit-transform",We),St.style.transition=Ee.transitions.create("transform",We),setTranslateValue(Pe,St,Te),ze&&ze(St)}),He=ar(St=>{St.style.webkitTransition="",St.style.transition="",Ve&&Ve(St)}),Qe=St=>{_e&&_e(sr.current,St)},Ye=reactExports.useCallback(()=>{sr.current&&setTranslateValue(Pe,sr.current,Te)},[Pe,Te]);return reactExports.useEffect(()=>{if($e||Pe==="down"||Pe==="right")return;const St=debounce$2(()=>{sr.current&&setTranslateValue(Pe,sr.current,Te)}),We=ownerWindow(sr.current);return We.addEventListener("resize",St),()=>{St.clear(),We.removeEventListener("resize",St)}},[Pe,$e,Te]),reactExports.useEffect(()=>{$e||Ye()},[$e,Ye]),jsxRuntimeExports.jsx(tr,{nodeRef:sr,onEnter:lr,onEntered:Me,onEntering:Ke,onExit:De,onExited:He,onExiting:je,addEndListener:Qe,appear:Ie,in:$e,timeout:er,...nr,children:(St,{ownerState:We,...Fe})=>reactExports.cloneElement(Be,{ref:dr,style:{visibility:St==="exited"&&!$e?"hidden":void 0,...Xe,...Be.props.style},...Fe})})});function getDrawerUtilityClass(t){return generateUtilityClass("MuiDrawer",t)}generateUtilityClasses("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const overridesResolver$4=(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,(xe.variant==="permanent"||xe.variant==="persistent")&&Ae.docked,Ae.modal]},useUtilityClasses$19=t=>{const{classes:Ae,anchor:xe,variant:Ee}=t,Se={root:["root",`anchor${capitalize$1(xe)}`],docked:[(Ee==="permanent"||Ee==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${capitalize$1(xe)}`,Ee!=="temporary"&&`paperAnchorDocked${capitalize$1(xe)}`]};return composeClasses(Se,getDrawerUtilityClass,Ae)},DrawerRoot=styled(Modal,{name:"MuiDrawer",slot:"Root",overridesResolver:overridesResolver$4})(memoTheme(({theme:t})=>({zIndex:(t.vars||t).zIndex.drawer}))),DrawerDockedRoot=styled("div",{shouldForwardProp:rootShouldForwardProp,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:overridesResolver$4})({flex:"0 0 auto"}),DrawerPaper=styled(Paper,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.paper,Ae[`paperAnchor${capitalize$1(xe.anchor)}`],xe.variant!=="temporary"&&Ae[`paperAnchorDocked${capitalize$1(xe.anchor)}`]]}})(memoTheme(({theme:t})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:Ae})=>Ae.anchor==="left"&&Ae.variant!=="temporary",style:{borderRight:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:Ae})=>Ae.anchor==="top"&&Ae.variant!=="temporary",style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:Ae})=>Ae.anchor==="right"&&Ae.variant!=="temporary",style:{borderLeft:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:Ae})=>Ae.anchor==="bottom"&&Ae.variant!=="temporary",style:{borderTop:`1px solid ${(t.vars||t).palette.divider}`}}]}))),oppositeDirection={left:"right",right:"left",top:"down",bottom:"up"};function isHorizontal(t){return["left","right"].includes(t)}function getAnchor({direction:t},Ae){return t==="rtl"&&isHorizontal(Ae)?oppositeDirection[Ae]:Ae}const Drawer=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiDrawer"}),Se=useTheme(),Ce=useRtl(),_e={enter:Se.transitions.duration.enteringScreen,exit:Se.transitions.duration.leavingScreen},{anchor:Ie="left",BackdropProps:Be,children:Te,className:Pe,elevation:ke=16,hideBackdrop:$e=!1,ModalProps:{BackdropProps:Oe,...Ue}={},onClose:qe,open:ze=!1,PaperProps:Ve={},SlideProps:Ge,TransitionComponent:Xe,transitionDuration:er=_e,variant:tr="temporary",slots:nr={},slotProps:sr={},...dr}=Ee,ar=reactExports.useRef(!1);reactExports.useEffect(()=>{ar.current=!0},[]);const lr=getAnchor({direction:Ce?"rtl":"ltr"},Ie),Me={...Ee,anchor:Ie,elevation:ke,open:ze,variant:tr,...dr},je=useUtilityClasses$19(Me),De={slots:{transition:Xe,...nr},slotProps:{paper:Ve,transition:Ge,...sr,backdrop:mergeSlotProps(sr.backdrop||{...Be,...Oe},{transitionDuration:er})}},[He,Qe]=useSlot("root",{ref:xe,elementType:DrawerRoot,className:clsx(je.root,je.modal,Pe),shouldForwardComponentProp:!0,ownerState:Me,externalForwardedProps:{...De,...dr,...Ue},additionalProps:{open:ze,onClose:qe,hideBackdrop:$e,slots:{backdrop:De.slots.backdrop},slotProps:{backdrop:De.slotProps.backdrop}}}),[Ye,St]=useSlot("paper",{elementType:DrawerPaper,shouldForwardComponentProp:!0,className:clsx(je.paper,Ve.className),ownerState:Me,externalForwardedProps:De,additionalProps:{elevation:tr==="temporary"?ke:0,square:!0}}),[We,Fe]=useSlot("docked",{elementType:DrawerDockedRoot,ref:xe,className:clsx(je.root,je.docked,Pe),ownerState:Me,externalForwardedProps:De,additionalProps:dr}),[Ze,ir]=useSlot("transition",{elementType:Slide,ownerState:Me,externalForwardedProps:De,additionalProps:{in:ze,direction:oppositeDirection[lr],timeout:er,appear:ar.current}}),ur=jsxRuntimeExports.jsx(Ye,{...St,children:Te});if(tr==="permanent")return jsxRuntimeExports.jsx(We,{...Fe,children:ur});const fr=jsxRuntimeExports.jsx(Ze,{...ir,children:ur});return tr==="persistent"?jsxRuntimeExports.jsx(We,{...Fe,children:fr}):jsxRuntimeExports.jsx(He,{...Qe,children:fr})});function getFabUtilityClass(t){return generateUtilityClass("MuiFab",t)}const fabClasses=generateUtilityClasses("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]),useUtilityClasses$18=t=>{const{color:Ae,variant:xe,classes:Ee,size:Se}=t,Ce={root:["root",xe,`size${capitalize$1(Se)}`,Ae==="inherit"?"colorInherit":Ae]},_e=composeClasses(Ce,getFabUtilityClass,Ee);return{...Ee,..._e}},FabRoot=styled(ButtonBase,{name:"MuiFab",slot:"Root",shouldForwardProp:t=>rootShouldForwardProp(t)||t==="classes",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[xe.variant],Ae[`size${capitalize$1(xe.size)}`],xe.color==="inherit"&&Ae.colorInherit,Ae[capitalize$1(xe.size)],Ae[xe.color]]}})(memoTheme(({theme:t})=>{var Ae,xe;return{...t.typography.button,minHeight:36,transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(t.vars||t).zIndex.fab,boxShadow:(t.vars||t).shadows[6],"&:active":{boxShadow:(t.vars||t).shadows[12]},color:t.vars?t.vars.palette.text.primary:(xe=(Ae=t.palette).getContrastText)==null?void 0:xe.call(Ae,t.palette.grey[300]),backgroundColor:(t.vars||t).palette.grey[300],"&:hover":{backgroundColor:(t.vars||t).palette.grey.A100,"@media (hover: none)":{backgroundColor:(t.vars||t).palette.grey[300]},textDecoration:"none"},[`&.${fabClasses.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},variants:[{props:{size:"small"},style:{width:40,height:40}},{props:{size:"medium"},style:{width:48,height:48}},{props:{variant:"extended"},style:{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48}},{props:{variant:"extended",size:"small"},style:{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34}},{props:{variant:"extended",size:"medium"},style:{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40}},{props:{color:"inherit"},style:{color:"inherit"}}]}}),memoTheme(({theme:t})=>({variants:[...Object.entries(t.palette).filter(createSimplePaletteValueFilter(["dark","contrastText"])).map(([Ae])=>({props:{color:Ae},style:{color:(t.vars||t).palette[Ae].contrastText,backgroundColor:(t.vars||t).palette[Ae].main,"&:hover":{backgroundColor:(t.vars||t).palette[Ae].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[Ae].main}}}}))]})),memoTheme(({theme:t})=>({[`&.${fabClasses.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}))),Fab=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFab"}),{children:Se,className:Ce,color:_e="default",component:Ie="button",disabled:Be=!1,disableFocusRipple:Te=!1,focusVisibleClassName:Pe,size:ke="large",variant:$e="circular",...Oe}=Ee,Ue={...Ee,color:_e,component:Ie,disabled:Be,disableFocusRipple:Te,size:ke,variant:$e},qe=useUtilityClasses$18(Ue);return jsxRuntimeExports.jsx(FabRoot,{className:clsx(qe.root,Ce),component:Ie,disabled:Be,focusRipple:!Te,focusVisibleClassName:clsx(qe.focusVisible,Pe),ownerState:Ue,ref:xe,...Oe,classes:qe,children:Se})});function getFormControlLabelUtilityClasses(t){return generateUtilityClass("MuiFormControlLabel",t)}const formControlLabelClasses=generateUtilityClasses("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),useUtilityClasses$17=t=>{const{classes:Ae,disabled:xe,labelPlacement:Ee,error:Se,required:Ce}=t,_e={root:["root",xe&&"disabled",`labelPlacement${capitalize$1(Ee)}`,Se&&"error",Ce&&"required"],label:["label",xe&&"disabled"],asterisk:["asterisk",Se&&"error"]};return composeClasses(_e,getFormControlLabelUtilityClasses,Ae)},FormControlLabelRoot=styled("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[{[`& .${formControlLabelClasses.label}`]:Ae.label},Ae.root,Ae[`labelPlacement${capitalize$1(xe.labelPlacement)}`]]}})(memoTheme(({theme:t})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${formControlLabelClasses.disabled}`]:{cursor:"default"},[`& .${formControlLabelClasses.label}`]:{[`&.${formControlLabelClasses.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:Ae})=>Ae==="start"||Ae==="top"||Ae==="bottom",style:{marginLeft:16}}]}))),AsteriskComponent=styled("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,Ae)=>Ae.asterisk})(memoTheme(({theme:t})=>({[`&.${formControlLabelClasses.error}`]:{color:(t.vars||t).palette.error.main}}))),FormControlLabel=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormControlLabel"}),{checked:Se,className:Ce,componentsProps:_e={},control:Ie,disabled:Be,disableTypography:Te,inputRef:Pe,label:ke,labelPlacement:$e="end",name:Oe,onChange:Ue,required:qe,slots:ze={},slotProps:Ve={},value:Ge,...Xe}=Ee,er=useFormControl(),tr=Be??Ie.props.disabled??(er==null?void 0:er.disabled),nr=qe??Ie.props.required,sr={disabled:tr,required:nr};["checked","name","onChange","value","inputRef"].forEach(He=>{typeof Ie.props[He]>"u"&&typeof Ee[He]<"u"&&(sr[He]=Ee[He])});const dr=formControlState({props:Ee,muiFormControl:er,states:["error"]}),ar={...Ee,disabled:tr,labelPlacement:$e,required:nr,error:dr.error},lr=useUtilityClasses$17(ar),Ke={slots:ze,slotProps:{..._e,...Ve}},[Me,je]=useSlot("typography",{elementType:Typography,externalForwardedProps:Ke,ownerState:ar});let De=ke;return De!=null&&De.type!==Typography&&!Te&&(De=jsxRuntimeExports.jsx(Me,{component:"span",...je,className:clsx(lr.label,je==null?void 0:je.className),children:De})),jsxRuntimeExports.jsxs(FormControlLabelRoot,{className:clsx(lr.root,Ce),ownerState:ar,ref:xe,...Xe,children:[reactExports.cloneElement(Ie,sr),nr?jsxRuntimeExports.jsxs("div",{children:[De,jsxRuntimeExports.jsxs(AsteriskComponent,{ownerState:ar,"aria-hidden":!0,className:lr.asterisk,children:[" ","*"]})]}):De]})});function getFormGroupUtilityClass(t){return generateUtilityClass("MuiFormGroup",t)}generateUtilityClasses("MuiFormGroup",["root","row","error"]);const useUtilityClasses$16=t=>{const{classes:Ae,row:xe,error:Ee}=t;return composeClasses({root:["root",xe&&"row",Ee&&"error"]},getFormGroupUtilityClass,Ae)},FormGroupRoot=styled("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,xe.row&&Ae.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),FormGroup=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiFormGroup"}),{className:Se,row:Ce=!1,..._e}=Ee,Ie=useFormControl(),Be=formControlState({props:Ee,muiFormControl:Ie,states:["error"]}),Te={...Ee,row:Ce,error:Be.error},Pe=useUtilityClasses$16(Te);return jsxRuntimeExports.jsx(FormGroupRoot,{className:clsx(Pe.root,Se),ownerState:Te,ref:xe,..._e})}),GridContext=reactExports.createContext();function getGridUtilityClass(t){return generateUtilityClass("MuiGrid",t)}const SPACINGS=[0,1,2,3,4,5,6,7,8,9,10],DIRECTIONS=["column-reverse","column","row-reverse","row"],WRAPS=["nowrap","wrap-reverse","wrap"],GRID_SIZES=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],gridClasses$1=generateUtilityClasses("MuiGrid",["root","container","item","zeroMinWidth",...SPACINGS.map(t=>`spacing-xs-${t}`),...DIRECTIONS.map(t=>`direction-xs-${t}`),...WRAPS.map(t=>`wrap-xs-${t}`),...GRID_SIZES.map(t=>`grid-xs-${t}`),...GRID_SIZES.map(t=>`grid-sm-${t}`),...GRID_SIZES.map(t=>`grid-md-${t}`),...GRID_SIZES.map(t=>`grid-lg-${t}`),...GRID_SIZES.map(t=>`grid-xl-${t}`)]);function generateGrid({theme:t,ownerState:Ae}){let xe;return t.breakpoints.keys.reduce((Ee,Se)=>{let Ce={};if(Ae[Se]&&(xe=Ae[Se]),!xe)return Ee;if(xe===!0)Ce={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(xe==="auto")Ce={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const _e=resolveBreakpointValues({values:Ae.columns,breakpoints:t.breakpoints.values}),Ie=typeof _e=="object"?_e[Se]:_e;if(Ie==null)return Ee;const Be=`${Math.round(xe/Ie*1e8)/1e6}%`;let Te={};if(Ae.container&&Ae.item&&Ae.columnSpacing!==0){const Pe=t.spacing(Ae.columnSpacing);if(Pe!=="0px"){const ke=`calc(${Be} + ${Pe})`;Te={flexBasis:ke,maxWidth:ke}}}Ce={flexBasis:Be,flexGrow:0,maxWidth:Be,...Te}}return t.breakpoints.values[Se]===0?Object.assign(Ee,Ce):Ee[t.breakpoints.up(Se)]=Ce,Ee},{})}function generateDirection({theme:t,ownerState:Ae}){const xe=resolveBreakpointValues({values:Ae.direction,breakpoints:t.breakpoints.values});return handleBreakpoints({theme:t},xe,Ee=>{const Se={flexDirection:Ee};return Ee.startsWith("column")&&(Se[`& > .${gridClasses$1.item}`]={maxWidth:"none"}),Se})}function extractZeroValueBreakpointKeys({breakpoints:t,values:Ae}){let xe="";Object.keys(Ae).forEach(Se=>{xe===""&&Ae[Se]!==0&&(xe=Se)});const Ee=Object.keys(t).sort((Se,Ce)=>t[Se]-t[Ce]);return Ee.slice(0,Ee.indexOf(xe))}function generateRowGap({theme:t,ownerState:Ae}){const{container:xe,rowSpacing:Ee}=Ae;let Se={};if(xe&&Ee!==0){const Ce=resolveBreakpointValues({values:Ee,breakpoints:t.breakpoints.values});let _e;typeof Ce=="object"&&(_e=extractZeroValueBreakpointKeys({breakpoints:t.breakpoints.values,values:Ce})),Se=handleBreakpoints({theme:t},Ce,(Ie,Be)=>{const Te=t.spacing(Ie);return Te!=="0px"?{marginTop:`calc(-1 * ${Te})`,[`& > .${gridClasses$1.item}`]:{paddingTop:Te}}:_e!=null&&_e.includes(Be)?{}:{marginTop:0,[`& > .${gridClasses$1.item}`]:{paddingTop:0}}})}return Se}function generateColumnGap({theme:t,ownerState:Ae}){const{container:xe,columnSpacing:Ee}=Ae;let Se={};if(xe&&Ee!==0){const Ce=resolveBreakpointValues({values:Ee,breakpoints:t.breakpoints.values});let _e;typeof Ce=="object"&&(_e=extractZeroValueBreakpointKeys({breakpoints:t.breakpoints.values,values:Ce})),Se=handleBreakpoints({theme:t},Ce,(Ie,Be)=>{const Te=t.spacing(Ie);if(Te!=="0px"){const Pe=`calc(-1 * ${Te})`;return{width:`calc(100% + ${Te})`,marginLeft:Pe,[`& > .${gridClasses$1.item}`]:{paddingLeft:Te}}}return _e!=null&&_e.includes(Be)?{}:{width:"100%",marginLeft:0,[`& > .${gridClasses$1.item}`]:{paddingLeft:0}}})}return Se}function resolveSpacingStyles(t,Ae,xe={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[xe[`spacing-xs-${String(t)}`]];const Ee=[];return Ae.forEach(Se=>{const Ce=t[Se];Number(Ce)>0&&Ee.push(xe[`spacing-${Se}-${String(Ce)}`])}),Ee}const GridRoot$1=styled("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,Ae)=>{const{ownerState:xe}=t,{container:Ee,direction:Se,item:Ce,spacing:_e,wrap:Ie,zeroMinWidth:Be,breakpoints:Te}=xe;let Pe=[];Ee&&(Pe=resolveSpacingStyles(_e,Te,Ae));const ke=[];return Te.forEach($e=>{const Oe=xe[$e];Oe&&ke.push(Ae[`grid-${$e}-${String(Oe)}`])}),[Ae.root,Ee&&Ae.container,Ce&&Ae.item,Be&&Ae.zeroMinWidth,...Pe,Se!=="row"&&Ae[`direction-xs-${String(Se)}`],Ie!=="wrap"&&Ae[`wrap-xs-${String(Ie)}`],...ke]}})(({ownerState:t})=>({boxSizing:"border-box",...t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...t.item&&{margin:0},...t.zeroMinWidth&&{minWidth:0},...t.wrap!=="wrap"&&{flexWrap:t.wrap}}),generateDirection,generateRowGap,generateColumnGap,generateGrid);function resolveSpacingClasses(t,Ae){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const xe=[];return Ae.forEach(Ee=>{const Se=t[Ee];if(Number(Se)>0){const Ce=`spacing-${Ee}-${String(Se)}`;xe.push(Ce)}}),xe}const useUtilityClasses$15=t=>{const{classes:Ae,container:xe,direction:Ee,item:Se,spacing:Ce,wrap:_e,zeroMinWidth:Ie,breakpoints:Be}=t;let Te=[];xe&&(Te=resolveSpacingClasses(Ce,Be));const Pe=[];Be.forEach($e=>{const Oe=t[$e];Oe&&Pe.push(`grid-${$e}-${String(Oe)}`)});const ke={root:["root",xe&&"container",Se&&"item",Ie&&"zeroMinWidth",...Te,Ee!=="row"&&`direction-xs-${String(Ee)}`,_e!=="wrap"&&`wrap-xs-${String(_e)}`,...Pe]};return composeClasses(ke,getGridUtilityClass,Ae)},Grid=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiGrid"}),{breakpoints:Se}=useTheme(),Ce=extendSxProp$1(Ee),{className:_e,columns:Ie,columnSpacing:Be,component:Te="div",container:Pe=!1,direction:ke="row",item:$e=!1,rowSpacing:Oe,spacing:Ue=0,wrap:qe="wrap",zeroMinWidth:ze=!1,...Ve}=Ce,Ge=Oe||Ue,Xe=Be||Ue,er=reactExports.useContext(GridContext),tr=Pe?Ie||12:er,nr={},sr={...Ve};Se.keys.forEach(lr=>{Ve[lr]!=null&&(nr[lr]=Ve[lr],delete sr[lr])});const dr={...Ce,columns:tr,container:Pe,direction:ke,item:$e,rowSpacing:Ge,columnSpacing:Xe,wrap:qe,zeroMinWidth:ze,spacing:Ue,...nr,breakpoints:Se.keys},ar=useUtilityClasses$15(dr);return jsxRuntimeExports.jsx(GridContext.Provider,{value:tr,children:jsxRuntimeExports.jsx(GridRoot$1,{ownerState:dr,className:clsx(ar.root,_e),as:Te,ref:xe,...sr})})});function getInputAdornmentUtilityClass(t){return generateUtilityClass("MuiInputAdornment",t)}const inputAdornmentClasses=generateUtilityClasses("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var _span;const overridesResolver$3=(t,Ae)=>{const{ownerState:xe}=t;return[Ae.root,Ae[`position${capitalize$1(xe.position)}`],xe.disablePointerEvents===!0&&Ae.disablePointerEvents,Ae[xe.variant]]},useUtilityClasses$14=t=>{const{classes:Ae,disablePointerEvents:xe,hiddenLabel:Ee,position:Se,size:Ce,variant:_e}=t,Ie={root:["root",xe&&"disablePointerEvents",Se&&`position${capitalize$1(Se)}`,_e,Ee&&"hiddenLabel",Ce&&`size${capitalize$1(Ce)}`]};return composeClasses(Ie,getInputAdornmentUtilityClass,Ae)},InputAdornmentRoot=styled("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:overridesResolver$3})(memoTheme(({theme:t})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${inputAdornmentClasses.positionStart}&:not(.${inputAdornmentClasses.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),InputAdornment=reactExports.forwardRef(function(Ae,xe){const Ee=useDefaultProps({props:Ae,name:"MuiInputAdornment"}),{children:Se,className:Ce,component:_e="div",disablePointerEvents:Ie=!1,disableTypography:Be=!1,position:Te,variant:Pe,...ke}=Ee,$e=useFormControl()||{};let Oe=Pe;Pe&&$e.variant,$e&&!Oe&&(Oe=$e.variant);const Ue={...Ee,hiddenLabel:$e.hiddenLabel,size:$e.size,disablePointerEvents:Ie,position:Te,variant:Oe},qe=useUtilityClasses$14(Ue);return jsxRuntimeExports.jsx(FormControlContext.Provider,{value:null,children:jsxRuntimeExports.jsx(InputAdornmentRoot,{as:_e,ownerState:Ue,className:clsx(qe.root,Ce),ref:xe,...ke,children:typeof Se=="string"&&!Be?jsxRuntimeExports.jsx(Typography,{color:"textSecondary",children:Se}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Te==="start"?_span||(_span=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,Se]})})})});function getLinearProgressUtilityClass(t){return generateUtilityClass("MuiLinearProgress",t)}const linearProgressClasses=generateUtilityClasses("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]),TRANSITION_DURATION=4,indeterminate1Keyframe=keyframes`
218
218
  0% {
219
219
  left: -35%;
220
220
  right: 100%;
@@ -381,7 +381,7 @@ return result$$;`.replaceAll("$$",String(filterItemsApplierId)));return filterIt
381
381
  `+t.slice(Se,Ce),Se=Ce+1),_e=Ie;return Be+=`
382
382
  `,t.length-Se>Ae&&_e>Se?Be+=t.slice(Se,_e)+`
383
383
  `+t.slice(_e+1):Be+=t.slice(Se),Be.slice(1)}function escapeString(t){for(var Ae="",xe=0,Ee,Se=0;Se<t.length;xe>=65536?Se+=2:Se++)xe=codePointAt(t,Se),Ee=ESCAPE_SEQUENCES[xe],!Ee&&isPrintable(xe)?(Ae+=t[Se],xe>=65536&&(Ae+=t[Se+1])):Ae+=Ee||encodeHex(xe);return Ae}function writeFlowSequence(t,Ae,xe){var Ee="",Se=t.tag,Ce,_e,Ie;for(Ce=0,_e=xe.length;Ce<_e;Ce+=1)Ie=xe[Ce],t.replacer&&(Ie=t.replacer.call(xe,String(Ce),Ie)),(writeNode(t,Ae,Ie,!1,!1)||typeof Ie>"u"&&writeNode(t,Ae,null,!1,!1))&&(Ee!==""&&(Ee+=","+(t.condenseFlow?"":" ")),Ee+=t.dump);t.tag=Se,t.dump="["+Ee+"]"}function writeBlockSequence(t,Ae,xe,Ee){var Se="",Ce=t.tag,_e,Ie,Be;for(_e=0,Ie=xe.length;_e<Ie;_e+=1)Be=xe[_e],t.replacer&&(Be=t.replacer.call(xe,String(_e),Be)),(writeNode(t,Ae+1,Be,!0,!0,!1,!0)||typeof Be>"u"&&writeNode(t,Ae+1,null,!0,!0,!1,!0))&&((!Ee||Se!=="")&&(Se+=generateNextLine(t,Ae)),t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?Se+="-":Se+="- ",Se+=t.dump);t.tag=Ce,t.dump=Se||"[]"}function writeFlowMapping(t,Ae,xe){var Ee="",Se=t.tag,Ce=Object.keys(xe),_e,Ie,Be,Te,Pe;for(_e=0,Ie=Ce.length;_e<Ie;_e+=1)Pe="",Ee!==""&&(Pe+=", "),t.condenseFlow&&(Pe+='"'),Be=Ce[_e],Te=xe[Be],t.replacer&&(Te=t.replacer.call(xe,Be,Te)),writeNode(t,Ae,Be,!1,!1)&&(t.dump.length>1024&&(Pe+="? "),Pe+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),writeNode(t,Ae,Te,!1,!1)&&(Pe+=t.dump,Ee+=Pe));t.tag=Se,t.dump="{"+Ee+"}"}function writeBlockMapping(t,Ae,xe,Ee){var Se="",Ce=t.tag,_e=Object.keys(xe),Ie,Be,Te,Pe,ke,$e;if(t.sortKeys===!0)_e.sort();else if(typeof t.sortKeys=="function")_e.sort(t.sortKeys);else if(t.sortKeys)throw new exception("sortKeys must be a boolean or a function");for(Ie=0,Be=_e.length;Ie<Be;Ie+=1)$e="",(!Ee||Se!=="")&&($e+=generateNextLine(t,Ae)),Te=_e[Ie],Pe=xe[Te],t.replacer&&(Pe=t.replacer.call(xe,Te,Pe)),writeNode(t,Ae+1,Te,!0,!0,!0)&&(ke=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,ke&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?$e+="?":$e+="? "),$e+=t.dump,ke&&($e+=generateNextLine(t,Ae)),writeNode(t,Ae+1,Pe,!0,ke)&&(t.dump&&CHAR_LINE_FEED===t.dump.charCodeAt(0)?$e+=":":$e+=": ",$e+=t.dump,Se+=$e));t.tag=Ce,t.dump=Se||"{}"}function detectType(t,Ae,xe){var Ee,Se,Ce,_e,Ie,Be;for(Se=xe?t.explicitTypes:t.implicitTypes,Ce=0,_e=Se.length;Ce<_e;Ce+=1)if(Ie=Se[Ce],(Ie.instanceOf||Ie.predicate)&&(!Ie.instanceOf||typeof Ae=="object"&&Ae instanceof Ie.instanceOf)&&(!Ie.predicate||Ie.predicate(Ae))){if(xe?Ie.multi&&Ie.representName?t.tag=Ie.representName(Ae):t.tag=Ie.tag:t.tag="?",Ie.represent){if(Be=t.styleMap[Ie.tag]||Ie.defaultStyle,_toString.call(Ie.represent)==="[object Function]")Ee=Ie.represent(Ae,Be);else if(_hasOwnProperty.call(Ie.represent,Be))Ee=Ie.represent[Be](Ae,Be);else throw new exception("!<"+Ie.tag+'> tag resolver accepts not "'+Be+'" style');t.dump=Ee}return!0}return!1}function writeNode(t,Ae,xe,Ee,Se,Ce,_e){t.tag=null,t.dump=xe,detectType(t,xe,!1)||detectType(t,xe,!0);var Ie=_toString.call(t.dump),Be=Ee,Te;Ee&&(Ee=t.flowLevel<0||t.flowLevel>Ae);var Pe=Ie==="[object Object]"||Ie==="[object Array]",ke,$e;if(Pe&&(ke=t.duplicates.indexOf(xe),$e=ke!==-1),(t.tag!==null&&t.tag!=="?"||$e||t.indent!==2&&Ae>0)&&(Se=!1),$e&&t.usedDuplicates[ke])t.dump="*ref_"+ke;else{if(Pe&&$e&&!t.usedDuplicates[ke]&&(t.usedDuplicates[ke]=!0),Ie==="[object Object]")Ee&&Object.keys(t.dump).length!==0?(writeBlockMapping(t,Ae,t.dump,Se),$e&&(t.dump="&ref_"+ke+t.dump)):(writeFlowMapping(t,Ae,t.dump),$e&&(t.dump="&ref_"+ke+" "+t.dump));else if(Ie==="[object Array]")Ee&&t.dump.length!==0?(t.noArrayIndent&&!_e&&Ae>0?writeBlockSequence(t,Ae-1,t.dump,Se):writeBlockSequence(t,Ae,t.dump,Se),$e&&(t.dump="&ref_"+ke+t.dump)):(writeFlowSequence(t,Ae,t.dump),$e&&(t.dump="&ref_"+ke+" "+t.dump));else if(Ie==="[object String]")t.tag!=="?"&&writeScalar(t,t.dump,Ae,Ce,Be);else{if(Ie==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new exception("unacceptable kind of an object to dump "+Ie)}t.tag!==null&&t.tag!=="?"&&(Te=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?Te="!"+Te:Te.slice(0,18)==="tag:yaml.org,2002:"?Te="!!"+Te.slice(18):Te="!<"+Te+">",t.dump=Te+" "+t.dump)}return!0}function getDuplicateReferences(t,Ae){var xe=[],Ee=[],Se,Ce;for(inspectNode(t,xe,Ee),Se=0,Ce=Ee.length;Se<Ce;Se+=1)Ae.duplicates.push(xe[Ee[Se]]);Ae.usedDuplicates=new Array(Ce)}function inspectNode(t,Ae,xe){var Ee,Se,Ce;if(t!==null&&typeof t=="object")if(Se=Ae.indexOf(t),Se!==-1)xe.indexOf(Se)===-1&&xe.push(Se);else if(Ae.push(t),Array.isArray(t))for(Se=0,Ce=t.length;Se<Ce;Se+=1)inspectNode(t[Se],Ae,xe);else for(Ee=Object.keys(t),Se=0,Ce=Ee.length;Se<Ce;Se+=1)inspectNode(t[Ee[Se]],Ae,xe)}function dump$1(t,Ae){Ae=Ae||{};var xe=new State(Ae);xe.noRefs||getDuplicateReferences(t,xe);var Ee=t;return xe.replacer&&(Ee=xe.replacer.call({"":Ee},"",Ee)),writeNode(xe,0,Ee,!0,!0)?xe.dump+`
384
- `:""}var dump_1=dump$1,dumper={dump:dump_1};function renamed(t,Ae){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+Ae+" instead, which is now safe by default.")}}var Type=type$1,Schema$2=schema,FAILSAFE_SCHEMA=failsafe,JSON_SCHEMA=json$2,CORE_SCHEMA=core,DEFAULT_SCHEMA=_default,load=loader.load,loadAll=loader.loadAll,dump=dumper.dump,YAMLException=exception,types$2={binary,float:float$1,map:map$4,null:_null,pairs,set:set$2,timestamp:timestamp$1,bool,int:int$1,merge:merge$2,omap,seq,str},safeLoad=renamed("safeLoad","load"),safeLoadAll=renamed("safeLoadAll","loadAll"),safeDump=renamed("safeDump","dump"),jsYaml={Type,Schema:Schema$2,FAILSAFE_SCHEMA,JSON_SCHEMA,CORE_SCHEMA,DEFAULT_SCHEMA,load,loadAll,dump,YAMLException,types:types$2,safeLoad,safeLoadAll,safeDump};const jsYaml$1=Object.freeze(Object.defineProperty({__proto__:null,CORE_SCHEMA,DEFAULT_SCHEMA,FAILSAFE_SCHEMA,JSON_SCHEMA,Schema:Schema$2,Type,YAMLException,default:jsYaml,dump,load,loadAll,safeDump,safeLoad,safeLoadAll,types:types$2},Symbol.toStringTag,{value:"Module"})),ROWS_PER_PAGE$1=10;function DatasetDialog({openDialog:t,handleClose:Ae,testCase:xe}){const[Ee,Se]=reactExports.useState(1),Ce=reactExports.useMemo(()=>[...(xe==null?void 0:xe.prompts)||[]].sort((Te,Pe)=>Pe.evalId.localeCompare(Te.evalId)).map(Te=>{var Ue,qe,ze,Ve;const Pe=((Ue=Te.prompt.metrics)==null?void 0:Ue.testPassCount)??0,ke=((qe=Te.prompt.metrics)==null?void 0:qe.testFailCount)??0,$e=((ze=Te.prompt.metrics)==null?void 0:ze.testErrorCount)??0,Oe=Pe+ke+$e;return{...Te,metrics:{passCount:Pe,failCount:ke,errorCount:$e,passRate:Oe>0?(Pe/Oe*100).toFixed(1)+"%":"-",score:(Ve=Te.prompt.metrics)==null?void 0:Ve.score}}}),[xe==null?void 0:xe.prompts]),_e=reactExports.useMemo(()=>{const Te=(Ee-1)*ROWS_PER_PAGE$1;return Ce.slice(Te,Te+ROWS_PER_PAGE$1)},[Ce,Ee]),Ie={width:"12%",pr:2},Be={variant:"body2",sx:{display:"block",textAlign:"right"}};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ae,fullWidth:!0,maxWidth:"lg",PaperProps:{elevation:2,sx:{minHeight:"60vh",maxHeight:"90vh",bgcolor:"background.paper",display:"flex",flexDirection:"column",width:"95%"}},children:[jsxRuntimeExports.jsxs(DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:2.5,px:3},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:600},children:"Dataset Details"}),jsxRuntimeExports.jsx(Box,{sx:Te=>({px:1.5,py:.75,borderRadius:1.5,bgcolor:alpha$3(Te.palette.primary.main,Te.palette.mode==="dark"?.15:.08),border:1,borderColor:alpha$3(Te.palette.primary.main,Te.palette.mode==="dark"?.3:.15)}),children:jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{color:"primary.main",fontFamily:"monospace",fontWeight:500},children:xe.id.slice(0,6)})})]}),jsxRuntimeExports.jsx(IconButton,{onClick:Ae,size:"small","aria-label":"close dialog",sx:Te=>({color:"text.secondary",transition:Te.transitions.create(["background-color","color"]),"&:hover":{color:"error.main",bgcolor:alpha$3(Te.palette.error.main,Te.palette.mode==="dark"?.15:.08)}}),children:jsxRuntimeExports.jsx(CloseIcon,{})})]}),jsxRuntimeExports.jsxs(DialogContent,{sx:{p:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[jsxRuntimeExports.jsxs(Box,{sx:{px:3,pt:2,pb:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{mb:1,fontWeight:600},children:"Test Cases"}),jsxRuntimeExports.jsx(TextField,{multiline:!0,fullWidth:!0,variant:"outlined",value:jsYaml.dump(xe.testCases),InputProps:{readOnly:!0,sx:Te=>({fontFamily:"monospace",fontSize:"0.875rem",bgcolor:alpha$3(Te.palette.common.black,Te.palette.mode==="dark"?.15:.03),"& .MuiOutlinedInput-notchedOutline":{borderColor:alpha$3(Te.palette.mode==="dark"?Te.palette.common.white:Te.palette.common.black,Te.palette.mode==="dark"?.15:.1)}})},minRows:3,maxRows:8})]}),jsxRuntimeExports.jsxs(Box,{sx:{px:3,pb:1.5,display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontSize:"1rem",fontWeight:600},children:"Prompts"}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",sx:Te=>({color:"text.secondary",bgcolor:alpha$3(Te.palette.mode==="dark"?Te.palette.common.white:Te.palette.common.black,(Te.palette.mode==="dark",.05)),px:1,py:.5,borderRadius:1}),children:[Ce.length," prompts"]})]}),jsxRuntimeExports.jsx("div",{style:{overflowX:"auto",margin:"0 24px"},children:jsxRuntimeExports.jsx(TableContainer,{sx:{flexGrow:1,mb:2,border:1,borderColor:"divider",borderRadius:1,overflowX:"auto"},children:jsxRuntimeExports.jsxs(Table,{stickyHeader:!0,size:"small",sx:{tableLayout:"fixed",width:"100%"},children:[jsxRuntimeExports.jsx(TableHead,{children:jsxRuntimeExports.jsxs(TableRow,{children:[jsxRuntimeExports.jsx(TableCell,{sx:{width:"15%"},children:"Prompt ID"}),jsxRuntimeExports.jsx(TableCell,{sx:{width:"25%"},children:"Prompt Content"}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:"Raw Score"}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:"Pass Rate"}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:"Pass Count"}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:"Fail Count"}),jsxRuntimeExports.jsx(TableCell,{sx:{width:"20%"},children:"Latest Eval"})]})}),jsxRuntimeExports.jsx(TableBody,{children:_e.map(Te=>{var Pe;return jsxRuntimeExports.jsxs(TableRow,{hover:!0,children:[jsxRuntimeExports.jsx(TableCell,{sx:{fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:jsxRuntimeExports.jsx(Link$1,{to:`/prompts/?id=${Te.id}`,style:{textDecoration:"none"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"primary",sx:{"&:hover":{textDecoration:"underline"}},children:Te.id.slice(0,6)})})}),jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",color:"text.secondary"},children:Te.prompt.raw.length>250?Te.prompt.raw.slice(0,250)+"...":Te.prompt.raw})}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:jsxRuntimeExports.jsx(Typography,{...Be,children:((Pe=Te.metrics.score)==null?void 0:Pe.toFixed(2))??"-"})}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:jsxRuntimeExports.jsx(Typography,{...Be,children:Te.metrics.passRate})}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:jsxRuntimeExports.jsx(Typography,{...Be,color:"success.main",fontWeight:500,children:Te.metrics.passCount})}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:jsxRuntimeExports.jsx(Typography,{...Be,color:"warning.main",fontWeight:500,children:Te.metrics.failCount})}),jsxRuntimeExports.jsx(TableCell,{sx:{fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:jsxRuntimeExports.jsx(Link$1,{to:`/eval/?evalId=${Te.evalId}`,style:{textDecoration:"none"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"primary",sx:{"&:hover":{textDecoration:"underline"},overflow:"hidden",textOverflow:"ellipsis"},children:Te.evalId})})})]},`prompt-${Te.id}`)})})]})})}),Math.ceil(Ce.length/ROWS_PER_PAGE$1)>1&&jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",p:2,borderTop:1,borderColor:"divider"},children:jsxRuntimeExports.jsx(Pagination,{count:Math.ceil(Ce.length/ROWS_PER_PAGE$1),page:Ee,onChange:(Te,Pe)=>Se(Pe),size:"small",shape:"rounded",showFirstButton:!0,showLastButton:!0,sx:{"& .MuiPaginationItem-root":{"&:hover":{backgroundColor:"action.hover"}}}})})]}),jsxRuntimeExports.jsx(DialogActions,{sx:Te=>({px:3,py:2.5,borderTop:1,borderColor:"divider",bgcolor:alpha$3(Te.palette.mode==="dark"?Te.palette.common.black:Te.palette.background.paper,Te.palette.mode==="dark"?.15:.8)}),children:jsxRuntimeExports.jsx(Button,{onClick:Ae,variant:"outlined",size:"medium",sx:{minWidth:120,textTransform:"none"},children:"Close"})})]})}function CustomToolbar$3({showUtilityButtons:t}){const Ae=useTheme();return jsxRuntimeExports.jsxs(GridToolbarContainer,{sx:{p:1,borderBottom:`1px solid ${Ae.palette.divider}`},children:[t&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1},children:[jsxRuntimeExports.jsx(GridToolbarColumnsButton,{}),jsxRuntimeExports.jsx(GridToolbarFilterButton,{}),jsxRuntimeExports.jsx(GridToolbarDensitySelector,{}),jsxRuntimeExports.jsx(GridToolbarExport$2,{})]}),jsxRuntimeExports.jsx(Box,{sx:{flexGrow:1}}),jsxRuntimeExports.jsx(GridToolbarQuickFilter,{sx:{"& .MuiInputBase-root":{borderRadius:2,backgroundColor:Ae.palette.background.paper}}})]})}const getVariables=t=>{if(!Array.isArray(t)||typeof t[0]=="string")return"";const Ae=t.flatMap(Ee=>Object.keys(Ee.vars||{})),xe=Array.from(new Set(Ae));return xe.length>0?xe.join(", "):"None"};function Datasets({data:t,isLoading:Ae,error:xe}){const[Ee]=useSearchParams(),[Se,Ce]=React.useState({open:!1,selectedIndex:0}),_e=React.useRef(!1),Ie=ke=>{Ce({open:!0,selectedIndex:ke})},Be=()=>{Ce(ke=>({...ke,open:!1}))};React.useEffect(()=>{if(_e.current)return;const ke=Ee.get("id");if(ke){const $e=t.findIndex(Oe=>Oe.id.startsWith(ke));$e!==-1&&(Ie($e),_e.current=!0)}},[t,Ee]);const Te=React.useMemo(()=>[{field:"id",headerName:"ID",flex:1,minWidth:100,valueFormatter:ke=>(ke==null?void 0:ke.slice(0,6))||""},{field:"testCases",headerName:"Test Cases",flex:1,minWidth:120,valueGetter:(ke,$e)=>ke.length,renderCell:ke=>`${ke.value} test cases`},{field:"variables",headerName:"Variables",flex:2,minWidth:200,valueGetter:(ke,$e)=>getVariables($e.testCases)},{field:"count",headerName:"Total Evals",flex:1,minWidth:100},{field:"prompts",headerName:"Total Prompts",flex:1,minWidth:120,valueGetter:(ke,$e)=>{var Oe;return((Oe=$e.prompts)==null?void 0:Oe.length)||0}},{field:"recentEvalDate",headerName:"Latest Eval Date",description:"The date of the most recent eval for this set of test cases",flex:1.5,minWidth:150,renderCell:ke=>ke.value?ke.value:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Unknown"})},{field:"recentEvalId",headerName:"Latest Eval ID",description:"The ID of the most recent eval for this set of test cases",flex:1.5,minWidth:150,renderCell:ke=>ke.value?jsxRuntimeExports.jsx(Link$1,{to:`/eval?evalId=${ke.value}`,style:{textDecoration:"none"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"primary",fontFamily:"monospace",sx:{"&:hover":{textDecoration:"underline"}},children:ke.value})}):jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Unknown"})}],[]),Pe=ke=>{const $e=t.findIndex(Oe=>Oe.id===ke.id);$e!==-1&&Ie($e)};return xe?jsxRuntimeExports.jsx(Box,{sx:{p:2},children:jsxRuntimeExports.jsx(Alert,{severity:"error",sx:{"& .MuiAlert-message":{width:"100%"}},children:xe})}):jsxRuntimeExports.jsxs(Box,{sx:{position:"absolute",top:64,left:0,right:0,bottom:0,bgcolor:ke=>ke.palette.mode==="dark"?alpha$3(ke.palette.common.black,.2):alpha$3(ke.palette.grey[50],.5),p:3},children:[jsxRuntimeExports.jsx(Paper,{elevation:0,sx:{height:"100%",display:"flex",flexDirection:"column",borderTop:1,borderColor:ke=>alpha$3(ke.palette.divider,.1),boxShadow:ke=>`0 1px 2px ${alpha$3(ke.palette.common.black,.05)}`,bgcolor:"background.paper",borderRadius:1},children:jsxRuntimeExports.jsx(DataGrid,{rows:t,columns:Te,loading:Ae,getRowId:ke=>ke.id,onRowClick:Pe,slots:{toolbar:CustomToolbar$3,loadingOverlay:()=>jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:2},children:[jsxRuntimeExports.jsx(CircularProgress,{}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Loading datasets..."})]}),noRowsOverlay:()=>jsxRuntimeExports.jsx(Box,{sx:{textAlign:"center",color:"text.secondary",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",p:3},children:xe?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{fontSize:"2rem",mb:2},children:"⚠️"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,color:"error",children:"Error loading datasets"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:xe})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{fontSize:"2rem",mb:2},children:"🔍"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,children:"No datasets found"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Create a dataset to start evaluating your AI responses"})]})})},slotProps:{toolbar:{showUtilityButtons:!0}},sx:{border:"none","& .MuiDataGrid-row":{cursor:"pointer",transition:"background-color 0.2s ease","&:hover":{backgroundColor:"action.hover"}},"& .MuiDataGrid-cell":{borderColor:"divider",display:"flex",alignItems:"center"},"& .MuiDataGrid-columnHeaders":{backgroundColor:"background.default",borderColor:"divider"}},initialState:{sorting:{sortModel:[{field:"recentEvalDate",sort:"desc"}]},pagination:{paginationModel:{pageSize:25}}},pageSizeOptions:[10,25,50,100]})}),t[Se.selectedIndex]&&jsxRuntimeExports.jsx(DatasetDialog,{openDialog:Se.open,handleClose:Be,testCase:t[Se.selectedIndex]})]})}function DatasetsPageContent(){const[t,Ae]=reactExports.useState([]),[xe,Ee]=reactExports.useState(!0),[Se,Ce]=reactExports.useState(null);return reactExports.useEffect(()=>{(async()=>{Ee(!0),Ce(null);try{const Be=await(await callApi("/datasets")).json();Be!=null&&Be.data&&Ae(Be.data)}catch(Ie){Ce("Failed to load datasets. Please try again."),console.error("Failed to fetch datasets:",Ie)}finally{Ee(!1)}})()},[]),jsxRuntimeExports.jsx(Datasets,{data:t,isLoading:xe,error:Se})}function DatasetsPage(){return jsxRuntimeExports.jsx(ErrorBoundary$1,{name:"Datasets Page",children:jsxRuntimeExports.jsx(DatasetsPageContent,{})})}const ErrorBoundaryContext=reactExports.createContext(null),initialState={didCatch:!1,error:null};class ErrorBoundary extends reactExports.Component{constructor(Ae){super(Ae),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=initialState}static getDerivedStateFromError(Ae){return{didCatch:!0,error:Ae}}resetErrorBoundary(){const{error:Ae}=this.state;if(Ae!==null){for(var xe,Ee,Se=arguments.length,Ce=new Array(Se),_e=0;_e<Se;_e++)Ce[_e]=arguments[_e];(xe=(Ee=this.props).onReset)===null||xe===void 0||xe.call(Ee,{args:Ce,reason:"imperative-api"}),this.setState(initialState)}}componentDidCatch(Ae,xe){var Ee,Se;(Ee=(Se=this.props).onError)===null||Ee===void 0||Ee.call(Se,Ae,xe)}componentDidUpdate(Ae,xe){const{didCatch:Ee}=this.state,{resetKeys:Se}=this.props;if(Ee&&xe.error!==null&&hasArrayChanged(Ae.resetKeys,Se)){var Ce,_e;(Ce=(_e=this.props).onReset)===null||Ce===void 0||Ce.call(_e,{next:Se,prev:Ae.resetKeys,reason:"keys"}),this.setState(initialState)}}render(){const{children:Ae,fallbackRender:xe,FallbackComponent:Ee,fallback:Se}=this.props,{didCatch:Ce,error:_e}=this.state;let Ie=Ae;if(Ce){const Be={error:_e,resetErrorBoundary:this.resetErrorBoundary};if(typeof xe=="function")Ie=xe(Be);else if(Ee)Ie=reactExports.createElement(Ee,Be);else if(Se!==void 0)Ie=Se;else throw _e}return reactExports.createElement(ErrorBoundaryContext.Provider,{value:{didCatch:Ce,error:_e,resetErrorBoundary:this.resetErrorBoundary}},Ie)}}function hasArrayChanged(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==Ae.length||t.some((xe,Ee)=>!Object.is(xe,Ae[Ee]))}const useStore$1=create$1()(persist((t,Ae)=>({env:{},testCases:[],description:"",providers:[],prompts:[],extensions:[],defaultTest:{},evaluateOptions:{},scenarios:[],setEnv:xe=>t({env:xe}),setTestCases:xe=>t({testCases:xe}),setDescription:xe=>t({description:xe}),setProviders:xe=>t({providers:xe}),setPrompts:xe=>t({prompts:xe}),setDefaultTest:xe=>t({defaultTest:xe}),setEvaluateOptions:xe=>t({evaluateOptions:xe}),setScenarios:xe=>t({scenarios:xe}),setExtensions:xe=>t({extensions:xe}),setStateFromConfig:xe=>{const Ee={};xe.description&&(Ee.description=xe.description||""),xe.tests&&(Ee.testCases=xe.tests),xe.providers&&(Ee.providers=xe.providers),xe.prompts&&(typeof xe.prompts=="string"?Ee.prompts=[xe.prompts]:Array.isArray(xe.prompts)?Ee.prompts=xe.prompts:console.warn("Invalid prompts config",xe.prompts)),xe.defaultTest&&(Ee.defaultTest=xe.defaultTest),xe.evaluateOptions&&(Ee.evaluateOptions=xe.evaluateOptions),xe.scenarios&&(Ee.scenarios=xe.scenarios),xe.extensions&&(Ee.extensions=xe.extensions),t(Ee)},getTestSuite:()=>{const{description:xe,env:Ee,extensions:Se,prompts:Ce,providers:_e,scenarios:Ie,testCases:Be}=Ae();return{description:xe,env:Ee,extensions:Se,prompts:Ce,providers:_e,scenarios:Ie,tests:Be}}}),{name:"promptfoo",skipHydration:!0})),SettingsIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),ConfigureEnvButton=()=>{const{env:t,setEnv:Ae}=useStore$1(),[xe,Ee]=reactExports.useState(!1),[Se,Ce]=reactExports.useState(t),_e=()=>{Ee(!0)},Ie=()=>{Ee(!1)},Be=()=>{Ae(Se),Ie()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{variant:"outlined",startIcon:jsxRuntimeExports.jsx(SettingsIcon,{}),onClick:_e,children:"API keys"}),jsxRuntimeExports.jsxs(Dialog,{open:xe,onClose:Ie,fullWidth:!0,maxWidth:"md",children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Provider settings"}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsxs(Accordion,{defaultExpanded:!0,children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"OpenAI"}),jsxRuntimeExports.jsxs(AccordionDetails,{children:[jsxRuntimeExports.jsx(TextField,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:Se.OPENAI_API_KEY,onChange:Te=>Ce({...Se,OPENAI_API_KEY:Te.target.value})}),jsxRuntimeExports.jsx(TextField,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:Se.OPENAI_API_HOST,onChange:Te=>Ce({...Se,OPENAI_API_HOST:Te.target.value})}),jsxRuntimeExports.jsx(TextField,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:Se.OPENAI_ORGANIZATION,onChange:Te=>Ce({...Se,OPENAI_ORGANIZATION:Te.target.value})})]})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Azure"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Azure API key",fullWidth:!0,margin:"normal",value:Se.AZURE_API_KEY||Se.AZURE_OPENAI_API_KEY,onChange:Te=>Ce({...Se,AZURE_API_KEY:Te.target.value})})})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Amazon Bedrock"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Bedrock Region",fullWidth:!0,margin:"normal",value:Se.AWS_BEDROCK_REGION,onChange:Te=>Ce({...Se,AWS_BEDROCK_REGION:Te.target.value})})})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Anthropic"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:Se.ANTHROPIC_API_KEY,onChange:Te=>Ce({...Se,ANTHROPIC_API_KEY:Te.target.value})})})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Google Vertex AI"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:Se.VERTEX_API_KEY,onChange:Te=>Ce({...Se,VERTEX_API_KEY:Te.target.value})})}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:Se.VERTEX_PROJECT_ID,onChange:Te=>Ce({...Se,VERTEX_PROJECT_ID:Te.target.value})})}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:Se.VERTEX_REGION,onChange:Te=>Ce({...Se,VERTEX_REGION:Te.target.value})})})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Replicate"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:Se.REPLICATE_API_KEY,onChange:Te=>Ce({...Se,REPLICATE_API_KEY:Te.target.value})})})]})]}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Ie,color:"primary",children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Be,color:"primary",variant:"contained",children:"Save"})]})]})]})},ContentCopyIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),DeleteIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),EditIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),Publish=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M5 4v2h14V4zm0 10h4v6h6v-6h4l-7-7z"}),"Publish"),PromptDialog$1=({open:t,prompt:Ae,index:xe,onAdd:Ee,onCancel:Se})=>{const[Ce,_e]=React.useState(Ae),Ie=React.useRef(null);React.useEffect(()=>{_e(Ae)},[Ae]);const Be=Te=>{Ee(Ce),_e(""),Te?Se():Ie.current&&Ie.current.focus()};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Se,fullWidth:!0,maxWidth:"md",children:[jsxRuntimeExports.jsx(DialogTitle,{children:`Edit Prompt ${xe+1}`}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsx(TextField,{value:Ce,onChange:Te=>_e(Te.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:Ie})}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Be.bind(null,!0),color:"primary",variant:"contained",disabled:!Ce.length,children:"Add"}),jsxRuntimeExports.jsx(Button,{onClick:Be.bind(null,!1),color:"primary",variant:"contained",disabled:!Ce.length,children:"Add Another"}),jsxRuntimeExports.jsx(Button,{onClick:Se,color:"secondary",children:"Cancel"})]})]})},PromptsSection=()=>{const[t,Ae]=reactExports.useState(!1),[xe,Ee]=reactExports.useState(null),[Se,Ce]=reactExports.useState(!1),[_e,Ie]=reactExports.useState(null),{prompts:Be,setPrompts:Te}=useStore$1(),Pe=reactExports.useRef(null);reactExports.useEffect(()=>{xe!==null&&xe>0&&Pe.current&&Pe.current.focus()},[xe]);const ke=Ge=>{Ee(Ge),Ae(!0)},$e=Ge=>{var er;Ge.stopPropagation(),Ge.preventDefault();const Xe=(er=Ge.target.files)==null?void 0:er[0];if(Xe){const tr=new FileReader;tr.onload=nr=>{var dr,ar;const sr=(ar=(dr=nr.target)==null?void 0:dr.result)==null?void 0:ar.toString();sr&&Te([...Be,sr])},tr.readAsText(Xe)}},Oe=(Ge,Xe)=>{Ge.stopPropagation();const er=Be[Xe];Te([...Be,er])},Ue=(Ge,Xe)=>{Te(Be.map((er,tr)=>tr===Ge?Xe:er))},qe=(Ge,Xe)=>{Ge.stopPropagation(),Ie(Xe),Ce(!0)},ze=()=>{_e!==null&&(Te(Be.filter((Ge,Xe)=>Xe!==_e)),Ie(null)),Ce(!1)},Ve=()=>{Ie(null),Ce(!1)};return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:2,mb:2,justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Typography,{variant:"h5",children:"Prompts"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("label",{htmlFor:"file-input-add-prompt",children:jsxRuntimeExports.jsx(Tooltip$2,{title:"Upload prompt from file",children:jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(IconButton,{component:"span",children:jsxRuntimeExports.jsx(Publish,{})}),jsxRuntimeExports.jsx("input",{id:"file-input-add-prompt",type:"file",accept:".txt,.md",onChange:$e,style:{display:"none"}})]})})}),Be.length===0&&jsxRuntimeExports.jsx(Button,{color:"secondary",onClick:()=>{Te([...Be,"Write a short, fun story about a {{animal}} going on an adventure in {{location}}. Make it entertaining and suitable for children."])},sx:{mr:1},children:"Add Example"}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:()=>{Ae(!0)},variant:"contained",children:"Add Prompt"})]})]}),jsxRuntimeExports.jsx(TableContainer,{children:jsxRuntimeExports.jsx(Table,{children:jsxRuntimeExports.jsx(TableBody,{children:Be.length===0?jsxRuntimeExports.jsx(TableRow,{children:jsxRuntimeExports.jsx(TableCell,{colSpan:2,align:"center",children:"No prompts added yet."})}):Be.map((Ge,Xe)=>jsxRuntimeExports.jsxs(TableRow,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>ke(Xe),children:[jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsxs(Typography,{variant:"body2",children:[`Prompt #${Xe+1}: `,(Ge.length>250?Ge.slice(0,250)+" ...":Ge).split(/({{\w+}})/g).map((er,tr)=>/{{\s*(\w+)\s*}}/g.test(er)?jsxRuntimeExports.jsx("span",{className:"prompt-var-highlight",children:er},tr):er)]})}),jsxRuntimeExports.jsxs(TableCell,{align:"right",sx:{minWidth:150},children:[jsxRuntimeExports.jsx(IconButton,{onClick:()=>ke(Xe),size:"small",children:jsxRuntimeExports.jsx(EditIcon,{})}),jsxRuntimeExports.jsx(IconButton,{onClick:er=>Oe(er,Xe),size:"small",children:jsxRuntimeExports.jsx(ContentCopyIcon,{})}),jsxRuntimeExports.jsx(IconButton,{onClick:er=>qe(er,Xe),size:"small",children:jsxRuntimeExports.jsx(DeleteIcon,{})})]})]},Xe))})})}),jsxRuntimeExports.jsx(PromptDialog$1,{open:t,prompt:xe===null?"":Be[xe],index:xe===null?0:xe,onAdd:Ge=>{xe===null?Te([...Be,Ge]):Ue(xe,Ge),Ee(null)},onCancel:()=>{Ee(null),Ae(!1)}}),jsxRuntimeExports.jsxs(Dialog,{open:Se,onClose:Ve,"aria-labelledby":"delete-prompt-dialog-title",children:[jsxRuntimeExports.jsx(DialogTitle,{id:"delete-prompt-dialog-title",children:"Delete Prompt"}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsx(DialogContentText,{children:"Are you sure you want to delete this prompt? This action cannot be undone."})}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Ve,color:"primary",children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:ze,color:"error",autoFocus:!0,children:"Delete"})]})]})]})},FolderOpenIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen"),useProvidersStore=create$1(t=>({customProviders:[],addCustomProvider:Ae=>t(xe=>({customProviders:[...xe.customProviders,Ae]})),removeCustomProvider:Ae=>t(xe=>({customProviders:xe.customProviders.filter(Ee=>Ee.id!==Ae)}))})),JAVASCRIPT_EXTENSIONS=["js","cjs","mjs","ts","cts","mts"];function isJavascriptFile(t){return new RegExp(`\\.(${JAVASCRIPT_EXTENSIONS.join("|")})$`).test(t)}const AddLocalProviderDialog=({open:t,onClose:Ae,onAdd:xe})=>{const[Ee,Se]=React.useState(""),[Ce,_e]=React.useState(""),Ie=()=>{const Te=Ee.trim();if(!Te){_e("Path is required");return}if(!isJavascriptFile(Te)&&!Te.endsWith(".py")&&!Te.endsWith(".go")){_e("Only javascript, python, and go files are supported");return}const Pe={id:`file://${Te}`,config:{},label:Te.split("/").pop()||Te};xe(Pe),Ae(),Se(""),_e("")},Be=()=>{Se(""),_e(""),Ae()};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Be,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[jsxRuntimeExports.jsx(DialogTitle,{sx:{pb:1},children:"Add Local Provider"}),jsxRuntimeExports.jsxs(DialogContent,{sx:{pb:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"Enter the absolute path to your local provider implementation (.py or .js file). This file will be referenced in your promptfoo configuration."}),jsxRuntimeExports.jsx(TextField,{fullWidth:!0,placeholder:"/absolute/path/to/your/provider.py",value:Ee,onChange:Te=>{Se(Te.target.value),_e("")},error:!!Ce,helperText:Ce||"Example: /home/user/projects/my-provider.py",size:"medium",sx:{"& .MuiOutlinedInput-root":{height:"56px"}}})]}),jsxRuntimeExports.jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsxRuntimeExports.jsx(Button,{onClick:Be,variant:"text",sx:{color:"text.secondary"},children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Ie,variant:"contained",sx:{px:3},children:"Add Provider"})]})]})},JsonTextField=({onChange:t,...Ae})=>{const[xe,Ee]=React.useState(""),[Se,Ce]=React.useState(!1),_e=Ie=>{const Be=Ie.target.value;try{const Te=JSON.parse(Be);Ee(Be),Ce(!1),t&&t(Te)}catch{Ee(Be),Ce(!0)}};return jsxRuntimeExports.jsx(TextField,{...Ae,error:Se,helperText:Se?"Invalid JSON":"",value:xe,onChange:_e})},ProviderConfigDialog=({open:t,providerId:Ae,config:xe={},onClose:Ee,onSave:Se})=>{const[Ce,_e]=reactExports.useState(xe),Ie=Ae.startsWith("azure:"),Be=$e=>$e!=null&&$e!=="",Te=!Ie||Be(Ce.deployment_id);reactExports.useEffect(()=>{_e(xe)},[t,Ae,xe]);const Pe=()=>{Se(Ae,Ce)},ke=React.useMemo(()=>{const $e=Object.keys(Ce);return Ie?["deployment_id",...$e.filter(Oe=>Oe!=="deployment_id")]:$e},[Ce,Ie]);return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ee,fullWidth:!0,maxWidth:"md",children:[jsxRuntimeExports.jsxs(DialogTitle,{children:["Provider Configuration",jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",color:"text.secondary",sx:{mt:1,fontSize:"0.9rem",fontFamily:"monospace"},children:Ae})]}),jsxRuntimeExports.jsxs(DialogContent,{children:[Ie&&jsxRuntimeExports.jsx(Box,{mb:2,children:jsxRuntimeExports.jsx(Alert,{severity:Te?"info":"warning",children:Te?"Azure OpenAI requires a deployment ID that matches your deployment name in the Azure portal.":"You must specify a deployment ID for Azure OpenAI models. This is the name you gave your model deployment in the Azure portal."})}),ke.map($e=>{const Oe=Ce[$e];let Ue;const ze=Ie&&$e==="deployment_id",Ve=!ze||Be(Oe);return typeof Oe=="number"||typeof Oe=="boolean"||typeof Oe=="string"?(typeof Oe=="number"?Ue=Ge=>_e({...Ce,[$e]:Number.parseFloat(Ge.target.value)}):typeof Oe=="boolean"?Ue=Ge=>_e({...Ce,[$e]:Ge.target.value==="true"}):Ue=Ge=>{const Xe=Ge.target.value.trim();if(Xe.startsWith("{")||Xe.startsWith("["))try{_e({...Ce,[$e]:JSON.parse(Xe)})}catch{_e({...Ce,[$e]:Xe})}else _e(Xe==="null"?{...Ce,[$e]:null}:Xe==="undefined"?{...Ce,[$e]:void 0}:{...Ce,[$e]:Xe})},jsxRuntimeExports.jsx(Box,{my:2,children:jsxRuntimeExports.jsx(TextField,{label:ze?`${$e} (Required)`:$e,value:Oe===void 0?"":Oe,onChange:Ue,fullWidth:!0,required:ze,error:ze&&!Ve,helperText:ze&&!Ve?"This field is required for Azure OpenAI":"",InputLabelProps:{shrink:!0},type:typeof Oe=="number"?"number":"text",variant:ze?"outlined":void 0,color:ze?"primary":void 0,focused:ze&&!Ve})},$e)):jsxRuntimeExports.jsx(Box,{my:2,children:jsxRuntimeExports.jsx(JsonTextField,{label:$e,defaultValue:JSON.stringify(Oe),onChange:Ge=>{_e({...Ce,[$e]:Ge})},fullWidth:!0,multiline:!0,minRows:2,InputLabelProps:{shrink:!0}})},$e)})]}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Ee,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Pe,disabled:!Te,children:"Save"})]})]})},defaultProviders=[].concat([{id:"openai:gpt-4o",label:"OpenAI: GPT-4o",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}},{id:"openai:gpt-4o-mini",label:"OpenAI: GPT-4o Mini",config:{organization:"",temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0}},{id:"openai:o1",label:"OpenAI: GPT-o1 (with thinking)",config:{organization:"",isReasoningModel:!0,max_completion_tokens:1024,reasoning_effort:"medium"}},{id:"openai:o3-mini",label:"OpenAI: GPT-o3 Mini (with thinking)",config:{organization:"",isReasoningModel:!0,max_completion_tokens:2048,reasoning_effort:"medium"}}]).concat([{id:"anthropic:messages:claude-3-7-sonnet-20250219",label:"Anthropic: Claude 3.7 Sonnet",config:{max_tokens:1024,temperature:.5}},{id:"anthropic:messages:claude-3-7-sonnet-20250219",label:"Anthropic: Claude 3.7 Sonnet (with thinking)",config:{max_tokens:2048,temperature:1,thinking:{type:"enabled",budget_tokens:1024},showThinking:!0}},{id:"anthropic:messages:claude-3-5-sonnet-20241022",label:"Anthropic: Claude 3.5 Sonnet",config:{max_tokens:1024,temperature:.5}},{id:"anthropic:messages:claude-3-5-sonnet-20240620",label:"Anthropic: Claude 3.5 Sonnet (June)",config:{max_tokens:1024,temperature:.5}},{id:"anthropic:messages:claude-3-5-haiku-20241022",label:"Anthropic: Claude 3.5 Haiku",config:{max_tokens:1024,temperature:.5}}]).concat([{id:"bedrock:us.anthropic.claude-3-7-sonnet-20250219-v1:0",label:"Bedrock: Claude 3.7 Sonnet",config:{max_tokens:1024,temperature:.5,anthropic_version:"bedrock-2023-05-31",region:"us-east-1"}},{id:"bedrock:us.anthropic.claude-3-7-sonnet-20250219-v1:0",label:"Bedrock: Claude 3.7 Sonnet (with thinking)",config:{max_tokens:2048,temperature:1,anthropic_version:"bedrock-2023-05-31",region:"us-east-1",thinking:{type:"enabled",budget_tokens:1024},showThinking:!0}},{id:"bedrock:us.anthropic.claude-3-5-sonnet-20241022-v2:0",label:"Bedrock: Claude 3.5 Sonnet",config:{max_tokens:1024,temperature:.5,anthropic_version:"bedrock-2023-05-31",region:"us-east-1"}},{id:"bedrock:us.meta.llama3-2-3b-instruct-v1:0",label:"Bedrock: Llama 3.2 (3B)",config:{temperature:.7,top_p:.9,max_new_tokens:1024,region:"us-east-1"}},{id:"bedrock:us.meta.llama3-2-90b-instruct-v1:0",label:"Bedrock: Llama 3.2 (90B)",config:{temperature:.7,top_p:.9,max_new_tokens:1024,region:"us-east-1"}},{id:"bedrock:us.meta.llama3-3-70b-instruct-v1:0",label:"Bedrock: Llama 3.3 (70B)",config:{temperature:.7,top_p:.9,max_new_tokens:1024,region:"us-east-1"}},{id:"bedrock:us.meta.llama3-3-8b-instruct-v1:0",label:"Bedrock: Llama 3.3 (8B)",config:{temperature:.7,top_p:.9,max_new_tokens:1024,region:"us-east-1"}},{id:"bedrock:us.amazon.nova-pro-v1:0",label:"Bedrock: Amazon Titan Nova Pro",config:{max_tokens:1024,temperature:.5,region:"us-east-1"}},{id:"bedrock:us.amazon.nova-lite-v1:0",label:"Bedrock: Amazon Titan Nova Lite",config:{max_tokens:1024,temperature:.5,region:"us-east-1"}},{id:"bedrock:us.amazon.nova-micro-v1:0",label:"Bedrock: Amazon Titan Nova Micro",config:{max_tokens:1024,temperature:.5,region:"us-east-1"}},{id:"bedrock:us.amazon.nova-sonic-v1:0",label:"Bedrock: Amazon Nova Sonic",config:{inferenceConfiguration:{maxTokens:1024,temperature:.7,topP:.95},textOutputConfiguration:{mediaType:"text/plain"},region:"us-east-1"}}]).concat([{id:"azure:chat:gpt-4o",label:"Azure: GPT-4o",config:{api_host:"your-resource-name.openai.azure.com",api_version:"2024-02-15-preview",temperature:.5,max_tokens:1024}},{id:"azure:chat:gpt-4o-mini",label:"Azure: GPT-4o Mini",config:{api_host:"your-resource-name.openai.azure.com",api_version:"2024-02-15-preview",temperature:.5,max_tokens:2048}},{id:"azure:chat:o3-mini",label:"Azure: O3 Mini",config:{api_host:"your-resource-name.openai.azure.com",api_version:"2024-05-15-preview",temperature:.5,max_tokens:4096}}]).concat([{id:"vertex:gemini-2.5-pro-exp-03-25",label:"Vertex: Gemini 2.5 Pro (Exp)",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}},{id:"vertex:gemini-2.5-pro",label:"Vertex: Gemini 2.5 Pro",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}},{id:"vertex:gemini-2.5-flash",label:"Vertex: Gemini 2.5 Flash",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}},{id:"vertex:gemini-2.0-pro",label:"Vertex: Gemini 2.0 Pro",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}},{id:"vertex:gemini-2.0-flash-001",label:"Vertex: Gemini 2.0 Flash",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}}]).concat([{id:"vertex:claude-3-5-sonnet-v2@20241022",label:"Vertex: Claude 3.5 Sonnet",config:{region:"us-east5",anthropic_version:"vertex-2023-10-16",max_tokens:1024,temperature:.5}},{id:"vertex:claude-3-5-haiku@20241022",label:"Vertex: Claude 3.5 Haiku",config:{region:"us-east5",anthropic_version:"vertex-2023-10-16",max_tokens:1024,temperature:.5}},{id:"vertex:llama-3.3-70b-instruct-maas",label:"Vertex: Llama 3.3 (70B)",config:{generationConfig:{temperature:.7,maxOutputTokens:1024,topP:.95,topK:40},region:"us-central1"}},{id:"vertex:llama-3.3-8b-instruct-maas",label:"Vertex: Llama 3.3 (8B)",config:{generationConfig:{temperature:.7,maxOutputTokens:1024,topP:.95,topK:40},region:"us-central1"}}]).concat([{id:"openrouter:anthropic/claude-3-5-sonnet",label:"OpenRouter: Claude 3.5 Sonnet",config:{temperature:.7,max_tokens:4096}},{id:"openrouter:meta-llama/llama-3.1-405b-instruct",label:"OpenRouter: Llama 3.1 405B",config:{temperature:.7,max_tokens:4096}},{id:"openrouter:mistralai/mistral-large-2402",label:"OpenRouter: Mistral Large",config:{temperature:.7,max_tokens:4096}},{id:"openrouter:google/gemini-1.5-pro",label:"OpenRouter: Gemini 1.5 Pro",config:{temperature:.7,max_tokens:8192}}]).sort((t,Ae)=>t.id.localeCompare(Ae.id)),PROVIDER_GROUPS={"openai:":"OpenAI","anthropic:":"Anthropic","bedrock:":"Amazon Web Services","azure:":"Azure","openrouter:":"OpenRouter","replicate:":"Replicate","vertex:":"Google Vertex AI"},getProviderGroup=t=>{if(!t)return"Other";let Ae="";typeof t=="string"?Ae=t:t&&typeof t=="object"&&t.id&&(Ae=t.id);for(const xe in PROVIDER_GROUPS)if(Ae&&typeof Ae=="string"&&Ae.indexOf(xe)===0)return PROVIDER_GROUPS[xe];return"Other"},ProviderSelector=({providers:t,onChange:Ae})=>{const{customProviders:xe,addCustomProvider:Ee}=useProvidersStore(),[Se,Ce]=React.useState(null),[_e,Ie]=React.useState(!1),Be=Ue=>{Ee(Ue),Ae([...t,Ue])},Te=React.useMemo(()=>[...defaultProviders,...xe],[xe]),Pe=Ue=>{Ce(typeof Ue=="string"?{id:Ue}:Ue)},ke=(Ue,qe)=>{Ae(t.map(ze=>ze.id===Ue&&!ze.label?{...ze,config:qe}:ze)),Ce(null)},$e=Ue=>Ue?typeof Ue=="string"?Ue:typeof Ue=="object"&&Ue&&(Ue.label||Ue.id)||"":"",Oe=Ue=>Ue?typeof Ue=="string"?Ue:typeof Ue=="object"&&Ue&&Ue.id||"":"";return jsxRuntimeExports.jsxs(Box,{mt:2,children:[jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,alignItems:"flex-start",children:[jsxRuntimeExports.jsx(Autocomplete,{sx:{flex:1,"& .MuiOutlinedInput-root":{minHeight:"56px",height:"auto",padding:"8px 14px 8px 8px !important",flexWrap:"wrap"},"& .MuiAutocomplete-tag":{margin:"2px"}},multiple:!0,freeSolo:!0,options:Te,value:t,groupBy:getProviderGroup,onChange:(Ue,qe)=>{const ze=qe.filter(Ve=>Ve!=null);Ae(ze.map(Ve=>typeof Ve=="string"?{id:Ve}:Ve))},getOptionLabel:$e,renderOption:(Ue,qe)=>{const ze=$e(qe),Ve=Oe(qe);return jsxRuntimeExports.jsx("li",{...Ue,children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",width:"100%"},children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:ze}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{fontSize:"0.7rem"},children:Ve})]})})},renderTags:(Ue,qe)=>Ue.map((ze,Ve)=>{const Ge=$e(ze),Xe=Oe(ze);return jsxRuntimeExports.jsx(Tooltip$2,{title:Xe,children:jsxRuntimeExports.jsx(Chip,{variant:"outlined",label:Ge,...qe({index:Ve}),onClick:()=>Pe(ze),sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}})},typeof ze=="string"?ze:ze.id+(ze.label||""))}),renderInput:Ue=>jsxRuntimeExports.jsx(TextField,{...Ue,variant:"outlined",placeholder:"Select LLM providers",helperText:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center"},children:[t.length>0?"Click a provider to configure its settings. Hover over chips to see model IDs.":"Select LLM providers from the dropdown or type to search",t.length>0&&jsxRuntimeExports.jsx(Tooltip$2,{title:"Model IDs are shown below options in the dropdown menu, as tooltips when hovering over selected models, and in the configuration dialog",children:jsxRuntimeExports.jsx(Button,{size:"small",sx:{ml:1,minWidth:0,p:.5},children:"ⓘ"})})]})})}),jsxRuntimeExports.jsx(Button,{variant:"outlined",onClick:()=>Ie(!0),startIcon:jsxRuntimeExports.jsx(FolderOpenIcon,{}),sx:{height:"56px",whiteSpace:"nowrap",px:3,minWidth:"fit-content",alignSelf:"flex-start"},children:"Reference Local Provider"})]}),jsxRuntimeExports.jsx(AddLocalProviderDialog,{open:_e,onClose:()=>Ie(!1),onAdd:Be}),Se&&Se.id&&jsxRuntimeExports.jsx(ProviderConfigDialog,{open:!!Se,providerId:Se.id,config:Se.config,onClose:()=>Ce(null),onSave:ke})]})},RunTestSuiteButton=()=>{const t=useNavigate(),{defaultTest:Ae,description:xe,env:Ee,evaluateOptions:Se,prompts:Ce,providers:_e,scenarios:Ie,testCases:Be}=useStore$1(),[Te,Pe]=reactExports.useState(!1),[ke,$e]=reactExports.useState(0),Oe=async()=>{Pe(!0);const Ue={defaultTest:Ae,description:xe,env:Ee,evaluateOptions:Se,prompts:Ce,providers:_e,scenarios:Ie,tests:Be};try{const qe=await callApi("/eval/job",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ue)});if(!qe.ok)throw new Error(`HTTP error! status: ${qe.status}`);const ze=await qe.json(),Ve=setInterval(async()=>{var Ge;try{const Xe=await callApi(`/eval/job/${ze.id}/`);if(!Xe.ok)throw clearInterval(Ve),new Error(`HTTP error! status: ${Xe.status}`);const er=await Xe.json();if(er.status==="complete")clearInterval(Ve),Pe(!1),t("/eval");else{if(["failed","error"].includes(er.status))throw clearInterval(Ve),Pe(!1),new Error(((Ge=er.logs)==null?void 0:Ge.join(`
384
+ `:""}var dump_1=dump$1,dumper={dump:dump_1};function renamed(t,Ae){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+Ae+" instead, which is now safe by default.")}}var Type=type$1,Schema$2=schema,FAILSAFE_SCHEMA=failsafe,JSON_SCHEMA=json$2,CORE_SCHEMA=core,DEFAULT_SCHEMA=_default,load=loader.load,loadAll=loader.loadAll,dump=dumper.dump,YAMLException=exception,types$2={binary,float:float$1,map:map$4,null:_null,pairs,set:set$2,timestamp:timestamp$1,bool,int:int$1,merge:merge$2,omap,seq,str},safeLoad=renamed("safeLoad","load"),safeLoadAll=renamed("safeLoadAll","loadAll"),safeDump=renamed("safeDump","dump"),jsYaml={Type,Schema:Schema$2,FAILSAFE_SCHEMA,JSON_SCHEMA,CORE_SCHEMA,DEFAULT_SCHEMA,load,loadAll,dump,YAMLException,types:types$2,safeLoad,safeLoadAll,safeDump};const jsYaml$1=Object.freeze(Object.defineProperty({__proto__:null,CORE_SCHEMA,DEFAULT_SCHEMA,FAILSAFE_SCHEMA,JSON_SCHEMA,Schema:Schema$2,Type,YAMLException,default:jsYaml,dump,load,loadAll,safeDump,safeLoad,safeLoadAll,types:types$2},Symbol.toStringTag,{value:"Module"})),ROWS_PER_PAGE$1=10;function DatasetDialog({openDialog:t,handleClose:Ae,testCase:xe}){const[Ee,Se]=reactExports.useState(1),Ce=reactExports.useMemo(()=>[...(xe==null?void 0:xe.prompts)||[]].sort((Te,Pe)=>Pe.evalId.localeCompare(Te.evalId)).map(Te=>{var Ue,qe,ze,Ve;const Pe=((Ue=Te.prompt.metrics)==null?void 0:Ue.testPassCount)??0,ke=((qe=Te.prompt.metrics)==null?void 0:qe.testFailCount)??0,$e=((ze=Te.prompt.metrics)==null?void 0:ze.testErrorCount)??0,Oe=Pe+ke+$e;return{...Te,metrics:{passCount:Pe,failCount:ke,errorCount:$e,passRate:Oe>0?(Pe/Oe*100).toFixed(1)+"%":"-",score:(Ve=Te.prompt.metrics)==null?void 0:Ve.score}}}),[xe==null?void 0:xe.prompts]),_e=reactExports.useMemo(()=>{const Te=(Ee-1)*ROWS_PER_PAGE$1;return Ce.slice(Te,Te+ROWS_PER_PAGE$1)},[Ce,Ee]),Ie={width:"12%",pr:2},Be={variant:"body2",sx:{display:"block",textAlign:"right"}};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ae,fullWidth:!0,maxWidth:"lg",PaperProps:{elevation:2,sx:{minHeight:"60vh",maxHeight:"90vh",bgcolor:"background.paper",display:"flex",flexDirection:"column",width:"95%"}},children:[jsxRuntimeExports.jsxs(DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:2.5,px:3},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:600},children:"Dataset Details"}),jsxRuntimeExports.jsx(Box,{sx:Te=>({px:1.5,py:.75,borderRadius:1.5,bgcolor:alpha$3(Te.palette.primary.main,Te.palette.mode==="dark"?.15:.08),border:1,borderColor:alpha$3(Te.palette.primary.main,Te.palette.mode==="dark"?.3:.15)}),children:jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{color:"primary.main",fontFamily:"monospace",fontWeight:500},children:xe.id.slice(0,6)})})]}),jsxRuntimeExports.jsx(IconButton,{onClick:Ae,size:"small","aria-label":"close dialog",sx:Te=>({color:"text.secondary",transition:Te.transitions.create(["background-color","color"]),"&:hover":{color:"error.main",bgcolor:alpha$3(Te.palette.error.main,Te.palette.mode==="dark"?.15:.08)}}),children:jsxRuntimeExports.jsx(CloseIcon,{})})]}),jsxRuntimeExports.jsxs(DialogContent,{sx:{p:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[jsxRuntimeExports.jsxs(Box,{sx:{px:3,pt:2,pb:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{mb:1,fontWeight:600},children:"Test Cases"}),jsxRuntimeExports.jsx(TextField,{multiline:!0,fullWidth:!0,variant:"outlined",value:jsYaml.dump(xe.testCases),InputProps:{readOnly:!0,sx:Te=>({fontFamily:"monospace",fontSize:"0.875rem",bgcolor:alpha$3(Te.palette.common.black,Te.palette.mode==="dark"?.15:.03),"& .MuiOutlinedInput-notchedOutline":{borderColor:alpha$3(Te.palette.mode==="dark"?Te.palette.common.white:Te.palette.common.black,Te.palette.mode==="dark"?.15:.1)}})},minRows:3,maxRows:8})]}),jsxRuntimeExports.jsxs(Box,{sx:{px:3,pb:1.5,display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontSize:"1rem",fontWeight:600},children:"Prompts"}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",sx:Te=>({color:"text.secondary",bgcolor:alpha$3(Te.palette.mode==="dark"?Te.palette.common.white:Te.palette.common.black,(Te.palette.mode==="dark",.05)),px:1,py:.5,borderRadius:1}),children:[Ce.length," prompts"]})]}),jsxRuntimeExports.jsx("div",{style:{overflowX:"auto",margin:"0 24px"},children:jsxRuntimeExports.jsx(TableContainer,{sx:{flexGrow:1,mb:2,border:1,borderColor:"divider",borderRadius:1,overflowX:"auto"},children:jsxRuntimeExports.jsxs(Table,{stickyHeader:!0,size:"small",sx:{tableLayout:"fixed",width:"100%"},children:[jsxRuntimeExports.jsx(TableHead,{children:jsxRuntimeExports.jsxs(TableRow,{children:[jsxRuntimeExports.jsx(TableCell,{sx:{width:"15%"},children:"Prompt ID"}),jsxRuntimeExports.jsx(TableCell,{sx:{width:"25%"},children:"Prompt Content"}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:"Raw Score"}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:"Pass Rate"}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:"Pass Count"}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:"Fail Count"}),jsxRuntimeExports.jsx(TableCell,{sx:{width:"20%"},children:"Latest Eval"})]})}),jsxRuntimeExports.jsx(TableBody,{children:_e.map(Te=>{var Pe;return jsxRuntimeExports.jsxs(TableRow,{hover:!0,children:[jsxRuntimeExports.jsx(TableCell,{sx:{fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:jsxRuntimeExports.jsx(Link$1,{to:`/prompts/?id=${Te.id}`,style:{textDecoration:"none"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"primary",sx:{"&:hover":{textDecoration:"underline"}},children:Te.id.slice(0,6)})})}),jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",color:"text.secondary"},children:Te.prompt.raw.length>250?Te.prompt.raw.slice(0,250)+"...":Te.prompt.raw})}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:jsxRuntimeExports.jsx(Typography,{...Be,children:((Pe=Te.metrics.score)==null?void 0:Pe.toFixed(2))??"-"})}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:jsxRuntimeExports.jsx(Typography,{...Be,children:Te.metrics.passRate})}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:jsxRuntimeExports.jsx(Typography,{...Be,color:"success.main",fontWeight:500,children:Te.metrics.passCount})}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:Ie,children:jsxRuntimeExports.jsx(Typography,{...Be,color:"warning.main",fontWeight:500,children:Te.metrics.failCount})}),jsxRuntimeExports.jsx(TableCell,{sx:{fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:jsxRuntimeExports.jsx(Link$1,{to:`/eval/?evalId=${Te.evalId}`,style:{textDecoration:"none"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"primary",sx:{"&:hover":{textDecoration:"underline"},overflow:"hidden",textOverflow:"ellipsis"},children:Te.evalId})})})]},`prompt-${Te.id}`)})})]})})}),Math.ceil(Ce.length/ROWS_PER_PAGE$1)>1&&jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",p:2,borderTop:1,borderColor:"divider"},children:jsxRuntimeExports.jsx(Pagination,{count:Math.ceil(Ce.length/ROWS_PER_PAGE$1),page:Ee,onChange:(Te,Pe)=>Se(Pe),size:"small",shape:"rounded",showFirstButton:!0,showLastButton:!0,sx:{"& .MuiPaginationItem-root":{"&:hover":{backgroundColor:"action.hover"}}}})})]}),jsxRuntimeExports.jsx(DialogActions,{sx:Te=>({px:3,py:2.5,borderTop:1,borderColor:"divider",bgcolor:alpha$3(Te.palette.mode==="dark"?Te.palette.common.black:Te.palette.background.paper,Te.palette.mode==="dark"?.15:.8)}),children:jsxRuntimeExports.jsx(Button,{onClick:Ae,variant:"outlined",size:"medium",sx:{minWidth:120,textTransform:"none"},children:"Close"})})]})}function CustomToolbar$3({showUtilityButtons:t}){const Ae=useTheme();return jsxRuntimeExports.jsxs(GridToolbarContainer,{sx:{p:1,borderBottom:`1px solid ${Ae.palette.divider}`},children:[t&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1},children:[jsxRuntimeExports.jsx(GridToolbarColumnsButton,{}),jsxRuntimeExports.jsx(GridToolbarFilterButton,{}),jsxRuntimeExports.jsx(GridToolbarDensitySelector,{}),jsxRuntimeExports.jsx(GridToolbarExport$2,{})]}),jsxRuntimeExports.jsx(Box,{sx:{flexGrow:1}}),jsxRuntimeExports.jsx(GridToolbarQuickFilter,{sx:{"& .MuiInputBase-root":{borderRadius:2,backgroundColor:Ae.palette.background.paper}}})]})}const getVariables=t=>{if(!Array.isArray(t)||typeof t[0]=="string")return"";const Ae=t.flatMap(Ee=>Object.keys(Ee.vars||{})),xe=Array.from(new Set(Ae));return xe.length>0?xe.join(", "):"None"};function Datasets({data:t,isLoading:Ae,error:xe}){const[Ee]=useSearchParams(),[Se,Ce]=React.useState({open:!1,selectedIndex:0}),_e=React.useRef(!1),Ie=ke=>{Ce({open:!0,selectedIndex:ke})},Be=()=>{Ce(ke=>({...ke,open:!1}))};React.useEffect(()=>{if(_e.current)return;const ke=Ee.get("id");if(ke){const $e=t.findIndex(Oe=>Oe.id.startsWith(ke));$e!==-1&&(Ie($e),_e.current=!0)}},[t,Ee]);const Te=React.useMemo(()=>[{field:"id",headerName:"ID",flex:1,minWidth:100,valueFormatter:ke=>(ke==null?void 0:ke.slice(0,6))||""},{field:"testCases",headerName:"Test Cases",flex:1,minWidth:120,valueGetter:(ke,$e)=>ke.length,renderCell:ke=>`${ke.value} test cases`},{field:"variables",headerName:"Variables",flex:2,minWidth:200,valueGetter:(ke,$e)=>getVariables($e.testCases)},{field:"count",headerName:"Total Evals",flex:1,minWidth:100},{field:"prompts",headerName:"Total Prompts",flex:1,minWidth:120,valueGetter:(ke,$e)=>{var Oe;return((Oe=$e.prompts)==null?void 0:Oe.length)||0}},{field:"recentEvalDate",headerName:"Latest Eval Date",description:"The date of the most recent eval for this set of test cases",flex:1.5,minWidth:150,renderCell:ke=>ke.value?ke.value:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Unknown"})},{field:"recentEvalId",headerName:"Latest Eval ID",description:"The ID of the most recent eval for this set of test cases",flex:1.5,minWidth:150,renderCell:ke=>ke.value?jsxRuntimeExports.jsx(Link$1,{to:`/eval?evalId=${ke.value}`,style:{textDecoration:"none"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"primary",fontFamily:"monospace",sx:{"&:hover":{textDecoration:"underline"}},children:ke.value})}):jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Unknown"})}],[]),Pe=ke=>{const $e=t.findIndex(Oe=>Oe.id===ke.id);$e!==-1&&Ie($e)};return xe?jsxRuntimeExports.jsx(Box,{sx:{p:2},children:jsxRuntimeExports.jsx(Alert,{severity:"error",sx:{"& .MuiAlert-message":{width:"100%"}},children:xe})}):jsxRuntimeExports.jsxs(Box,{sx:{position:"absolute",top:64,left:0,right:0,bottom:0,bgcolor:ke=>ke.palette.mode==="dark"?alpha$3(ke.palette.common.black,.2):alpha$3(ke.palette.grey[50],.5),p:3},children:[jsxRuntimeExports.jsx(Paper,{elevation:0,sx:{height:"100%",display:"flex",flexDirection:"column",borderTop:1,borderColor:ke=>alpha$3(ke.palette.divider,.1),boxShadow:ke=>`0 1px 2px ${alpha$3(ke.palette.common.black,.05)}`,bgcolor:"background.paper",borderRadius:1},children:jsxRuntimeExports.jsx(DataGrid,{rows:t,columns:Te,loading:Ae,getRowId:ke=>ke.id,onRowClick:Pe,slots:{toolbar:CustomToolbar$3,loadingOverlay:()=>jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:2},children:[jsxRuntimeExports.jsx(CircularProgress,{}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Loading datasets..."})]}),noRowsOverlay:()=>jsxRuntimeExports.jsx(Box,{sx:{textAlign:"center",color:"text.secondary",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",p:3},children:xe?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{fontSize:"2rem",mb:2},children:"⚠️"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,color:"error",children:"Error loading datasets"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:xe})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{fontSize:"2rem",mb:2},children:"🔍"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,children:"No datasets found"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Create a dataset to start evaluating your AI responses"})]})})},slotProps:{toolbar:{showUtilityButtons:!0}},sx:{border:"none","& .MuiDataGrid-row":{cursor:"pointer",transition:"background-color 0.2s ease","&:hover":{backgroundColor:"action.hover"}},"& .MuiDataGrid-cell":{borderColor:"divider",display:"flex",alignItems:"center"},"& .MuiDataGrid-columnHeaders":{backgroundColor:"background.default",borderColor:"divider"}},initialState:{sorting:{sortModel:[{field:"recentEvalDate",sort:"desc"}]},pagination:{paginationModel:{pageSize:25}}},pageSizeOptions:[10,25,50,100]})}),t[Se.selectedIndex]&&jsxRuntimeExports.jsx(DatasetDialog,{openDialog:Se.open,handleClose:Be,testCase:t[Se.selectedIndex]})]})}function DatasetsPageContent(){const[t,Ae]=reactExports.useState([]),[xe,Ee]=reactExports.useState(!0),[Se,Ce]=reactExports.useState(null);return reactExports.useEffect(()=>{(async()=>{Ee(!0),Ce(null);try{const Be=await(await callApi("/datasets")).json();Be!=null&&Be.data&&Ae(Be.data)}catch(Ie){Ce("Failed to load datasets. Please try again."),console.error("Failed to fetch datasets:",Ie)}finally{Ee(!1)}})()},[]),jsxRuntimeExports.jsx(Datasets,{data:t,isLoading:xe,error:Se})}function DatasetsPage(){return jsxRuntimeExports.jsx(ErrorBoundary$1,{name:"Datasets Page",children:jsxRuntimeExports.jsx(DatasetsPageContent,{})})}const ErrorBoundaryContext=reactExports.createContext(null),initialState={didCatch:!1,error:null};class ErrorBoundary extends reactExports.Component{constructor(Ae){super(Ae),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=initialState}static getDerivedStateFromError(Ae){return{didCatch:!0,error:Ae}}resetErrorBoundary(){const{error:Ae}=this.state;if(Ae!==null){for(var xe,Ee,Se=arguments.length,Ce=new Array(Se),_e=0;_e<Se;_e++)Ce[_e]=arguments[_e];(xe=(Ee=this.props).onReset)===null||xe===void 0||xe.call(Ee,{args:Ce,reason:"imperative-api"}),this.setState(initialState)}}componentDidCatch(Ae,xe){var Ee,Se;(Ee=(Se=this.props).onError)===null||Ee===void 0||Ee.call(Se,Ae,xe)}componentDidUpdate(Ae,xe){const{didCatch:Ee}=this.state,{resetKeys:Se}=this.props;if(Ee&&xe.error!==null&&hasArrayChanged(Ae.resetKeys,Se)){var Ce,_e;(Ce=(_e=this.props).onReset)===null||Ce===void 0||Ce.call(_e,{next:Se,prev:Ae.resetKeys,reason:"keys"}),this.setState(initialState)}}render(){const{children:Ae,fallbackRender:xe,FallbackComponent:Ee,fallback:Se}=this.props,{didCatch:Ce,error:_e}=this.state;let Ie=Ae;if(Ce){const Be={error:_e,resetErrorBoundary:this.resetErrorBoundary};if(typeof xe=="function")Ie=xe(Be);else if(Ee)Ie=reactExports.createElement(Ee,Be);else if(Se!==void 0)Ie=Se;else throw _e}return reactExports.createElement(ErrorBoundaryContext.Provider,{value:{didCatch:Ce,error:_e,resetErrorBoundary:this.resetErrorBoundary}},Ie)}}function hasArrayChanged(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==Ae.length||t.some((xe,Ee)=>!Object.is(xe,Ae[Ee]))}const useStore$1=create$1()(persist((t,Ae)=>({env:{},testCases:[],description:"",providers:[],prompts:[],extensions:[],defaultTest:{},evaluateOptions:{},scenarios:[],setEnv:xe=>t({env:xe}),setTestCases:xe=>t({testCases:xe}),setDescription:xe=>t({description:xe}),setProviders:xe=>t({providers:xe}),setPrompts:xe=>t({prompts:xe}),setDefaultTest:xe=>t({defaultTest:xe}),setEvaluateOptions:xe=>t({evaluateOptions:xe}),setScenarios:xe=>t({scenarios:xe}),setExtensions:xe=>t({extensions:xe}),setStateFromConfig:xe=>{const Ee={};xe.description&&(Ee.description=xe.description||""),xe.tests&&(Ee.testCases=xe.tests),xe.providers&&(Ee.providers=xe.providers),xe.prompts&&(typeof xe.prompts=="string"?Ee.prompts=[xe.prompts]:Array.isArray(xe.prompts)?Ee.prompts=xe.prompts:console.warn("Invalid prompts config",xe.prompts)),xe.defaultTest&&(Ee.defaultTest=xe.defaultTest),xe.evaluateOptions&&(Ee.evaluateOptions=xe.evaluateOptions),xe.scenarios&&(Ee.scenarios=xe.scenarios),xe.extensions&&(Ee.extensions=xe.extensions),t(Ee)},getTestSuite:()=>{const{description:xe,env:Ee,extensions:Se,prompts:Ce,providers:_e,scenarios:Ie,testCases:Be,evaluateOptions:Te}=Ae();return{description:xe,env:Ee,extensions:Se,prompts:Ce,providers:_e,scenarios:Ie,tests:Be,evaluateOptions:Te}}}),{name:"promptfoo",skipHydration:!0})),SettingsIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),ConfigureEnvButton=()=>{const{env:t,setEnv:Ae}=useStore$1(),[xe,Ee]=reactExports.useState(!1),[Se,Ce]=reactExports.useState(t),_e=()=>{Ee(!0)},Ie=()=>{Ee(!1)},Be=()=>{Ae(Se),Ie()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{variant:"outlined",startIcon:jsxRuntimeExports.jsx(SettingsIcon,{}),onClick:_e,children:"API keys"}),jsxRuntimeExports.jsxs(Dialog,{open:xe,onClose:Ie,fullWidth:!0,maxWidth:"md",children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Provider settings"}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsxs(Accordion,{defaultExpanded:!0,children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"OpenAI"}),jsxRuntimeExports.jsxs(AccordionDetails,{children:[jsxRuntimeExports.jsx(TextField,{label:"OpenAI API key",fullWidth:!0,margin:"normal",value:Se.OPENAI_API_KEY,onChange:Te=>Ce({...Se,OPENAI_API_KEY:Te.target.value})}),jsxRuntimeExports.jsx(TextField,{label:"OpenAI API host",fullWidth:!0,margin:"normal",value:Se.OPENAI_API_HOST,onChange:Te=>Ce({...Se,OPENAI_API_HOST:Te.target.value})}),jsxRuntimeExports.jsx(TextField,{label:"OpenAI organization",fullWidth:!0,margin:"normal",value:Se.OPENAI_ORGANIZATION,onChange:Te=>Ce({...Se,OPENAI_ORGANIZATION:Te.target.value})})]})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Azure"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Azure API key",fullWidth:!0,margin:"normal",value:Se.AZURE_API_KEY||Se.AZURE_OPENAI_API_KEY,onChange:Te=>Ce({...Se,AZURE_API_KEY:Te.target.value})})})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Amazon Bedrock"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Bedrock Region",fullWidth:!0,margin:"normal",value:Se.AWS_BEDROCK_REGION,onChange:Te=>Ce({...Se,AWS_BEDROCK_REGION:Te.target.value})})})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Anthropic"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Anthropic API key",fullWidth:!0,margin:"normal",value:Se.ANTHROPIC_API_KEY,onChange:Te=>Ce({...Se,ANTHROPIC_API_KEY:Te.target.value})})})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Google Vertex AI"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Vertex API Key",fullWidth:!0,margin:"normal",value:Se.VERTEX_API_KEY,onChange:Te=>Ce({...Se,VERTEX_API_KEY:Te.target.value})})}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Vertex Project ID",fullWidth:!0,margin:"normal",value:Se.VERTEX_PROJECT_ID,onChange:Te=>Ce({...Se,VERTEX_PROJECT_ID:Te.target.value})})}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Vertex Region",fullWidth:!0,margin:"normal",value:Se.VERTEX_REGION,onChange:Te=>Ce({...Se,VERTEX_REGION:Te.target.value})})})]}),jsxRuntimeExports.jsxs(Accordion,{children:[jsxRuntimeExports.jsx(AccordionSummary,{children:"Replicate"}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(TextField,{label:"Replicate API key",fullWidth:!0,margin:"normal",value:Se.REPLICATE_API_KEY,onChange:Te=>Ce({...Se,REPLICATE_API_KEY:Te.target.value})})})]})]}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Ie,color:"primary",children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Be,color:"primary",variant:"contained",children:"Save"})]})]})]})},ContentCopyIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),DeleteIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),EditIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),Publish=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M5 4v2h14V4zm0 10h4v6h6v-6h4l-7-7z"}),"Publish"),PromptDialog$1=({open:t,prompt:Ae,index:xe,onAdd:Ee,onCancel:Se})=>{const[Ce,_e]=React.useState(Ae),Ie=React.useRef(null);React.useEffect(()=>{_e(Ae)},[Ae]);const Be=Te=>{Ee(Ce),_e(""),Te?Se():Ie.current&&Ie.current.focus()};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Se,fullWidth:!0,maxWidth:"md",children:[jsxRuntimeExports.jsx(DialogTitle,{children:`Edit Prompt ${xe+1}`}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsx(TextField,{value:Ce,onChange:Te=>_e(Te.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:Ie})}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Be.bind(null,!0),color:"primary",variant:"contained",disabled:!Ce.length,children:"Add"}),jsxRuntimeExports.jsx(Button,{onClick:Be.bind(null,!1),color:"primary",variant:"contained",disabled:!Ce.length,children:"Add Another"}),jsxRuntimeExports.jsx(Button,{onClick:Se,color:"secondary",children:"Cancel"})]})]})},PromptsSection=()=>{const[t,Ae]=reactExports.useState(!1),[xe,Ee]=reactExports.useState(null),[Se,Ce]=reactExports.useState(!1),[_e,Ie]=reactExports.useState(null),{prompts:Be,setPrompts:Te}=useStore$1(),Pe=reactExports.useRef(null);reactExports.useEffect(()=>{xe!==null&&xe>0&&Pe.current&&Pe.current.focus()},[xe]);const ke=Ge=>{Ee(Ge),Ae(!0)},$e=Ge=>{var er;Ge.stopPropagation(),Ge.preventDefault();const Xe=(er=Ge.target.files)==null?void 0:er[0];if(Xe){const tr=new FileReader;tr.onload=nr=>{var dr,ar;const sr=(ar=(dr=nr.target)==null?void 0:dr.result)==null?void 0:ar.toString();sr&&Te([...Be,sr])},tr.readAsText(Xe)}},Oe=(Ge,Xe)=>{Ge.stopPropagation();const er=Be[Xe];Te([...Be,er])},Ue=(Ge,Xe)=>{Te(Be.map((er,tr)=>tr===Ge?Xe:er))},qe=(Ge,Xe)=>{Ge.stopPropagation(),Ie(Xe),Ce(!0)},ze=()=>{_e!==null&&(Te(Be.filter((Ge,Xe)=>Xe!==_e)),Ie(null)),Ce(!1)},Ve=()=>{Ie(null),Ce(!1)};return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:2,mb:2,justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Typography,{variant:"h5",children:"Prompts"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("label",{htmlFor:"file-input-add-prompt",children:jsxRuntimeExports.jsx(Tooltip$2,{title:"Upload prompt from file",children:jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(IconButton,{component:"span",children:jsxRuntimeExports.jsx(Publish,{})}),jsxRuntimeExports.jsx("input",{id:"file-input-add-prompt",type:"file",accept:".txt,.md",onChange:$e,style:{display:"none"}})]})})}),Be.length===0&&jsxRuntimeExports.jsx(Button,{color:"secondary",onClick:()=>{Te([...Be,"Write a short, fun story about a {{animal}} going on an adventure in {{location}}. Make it entertaining and suitable for children."])},sx:{mr:1},children:"Add Example"}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:()=>{Ae(!0)},variant:"contained",children:"Add Prompt"})]})]}),jsxRuntimeExports.jsx(TableContainer,{children:jsxRuntimeExports.jsx(Table,{children:jsxRuntimeExports.jsx(TableBody,{children:Be.length===0?jsxRuntimeExports.jsx(TableRow,{children:jsxRuntimeExports.jsx(TableCell,{colSpan:2,align:"center",children:"No prompts added yet."})}):Be.map((Ge,Xe)=>jsxRuntimeExports.jsxs(TableRow,{sx:{"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)",cursor:"pointer"}},onClick:()=>ke(Xe),children:[jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsxs(Typography,{variant:"body2",children:[`Prompt #${Xe+1}: `,(Ge.length>250?Ge.slice(0,250)+" ...":Ge).split(/({{\w+}})/g).map((er,tr)=>/{{\s*(\w+)\s*}}/g.test(er)?jsxRuntimeExports.jsx("span",{className:"prompt-var-highlight",children:er},tr):er)]})}),jsxRuntimeExports.jsxs(TableCell,{align:"right",sx:{minWidth:150},children:[jsxRuntimeExports.jsx(IconButton,{onClick:()=>ke(Xe),size:"small",children:jsxRuntimeExports.jsx(EditIcon,{})}),jsxRuntimeExports.jsx(IconButton,{onClick:er=>Oe(er,Xe),size:"small",children:jsxRuntimeExports.jsx(ContentCopyIcon,{})}),jsxRuntimeExports.jsx(IconButton,{onClick:er=>qe(er,Xe),size:"small",children:jsxRuntimeExports.jsx(DeleteIcon,{})})]})]},Xe))})})}),jsxRuntimeExports.jsx(PromptDialog$1,{open:t,prompt:xe===null?"":Be[xe],index:xe===null?0:xe,onAdd:Ge=>{xe===null?Te([...Be,Ge]):Ue(xe,Ge),Ee(null)},onCancel:()=>{Ee(null),Ae(!1)}}),jsxRuntimeExports.jsxs(Dialog,{open:Se,onClose:Ve,"aria-labelledby":"delete-prompt-dialog-title",children:[jsxRuntimeExports.jsx(DialogTitle,{id:"delete-prompt-dialog-title",children:"Delete Prompt"}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsx(DialogContentText,{children:"Are you sure you want to delete this prompt? This action cannot be undone."})}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Ve,color:"primary",children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:ze,color:"error",autoFocus:!0,children:"Delete"})]})]})]})},FolderOpenIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen"),useProvidersStore=create$1(t=>({customProviders:[],addCustomProvider:Ae=>t(xe=>({customProviders:[...xe.customProviders,Ae]})),removeCustomProvider:Ae=>t(xe=>({customProviders:xe.customProviders.filter(Ee=>Ee.id!==Ae)}))})),JAVASCRIPT_EXTENSIONS=["js","cjs","mjs","ts","cts","mts"];function isJavascriptFile(t){return new RegExp(`\\.(${JAVASCRIPT_EXTENSIONS.join("|")})$`).test(t)}const AddLocalProviderDialog=({open:t,onClose:Ae,onAdd:xe})=>{const[Ee,Se]=React.useState(""),[Ce,_e]=React.useState(""),Ie=()=>{const Te=Ee.trim();if(!Te){_e("Path is required");return}if(!isJavascriptFile(Te)&&!Te.endsWith(".py")&&!Te.endsWith(".go")){_e("Only javascript, python, and go files are supported");return}const Pe={id:`file://${Te}`,config:{},label:Te.split("/").pop()||Te};xe(Pe),Ae(),Se(""),_e("")},Be=()=>{Se(""),_e(""),Ae()};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Be,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[jsxRuntimeExports.jsx(DialogTitle,{sx:{pb:1},children:"Add Local Provider"}),jsxRuntimeExports.jsxs(DialogContent,{sx:{pb:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"Enter the absolute path to your local provider implementation (.py or .js file). This file will be referenced in your promptfoo configuration."}),jsxRuntimeExports.jsx(TextField,{fullWidth:!0,placeholder:"/absolute/path/to/your/provider.py",value:Ee,onChange:Te=>{Se(Te.target.value),_e("")},error:!!Ce,helperText:Ce||"Example: /home/user/projects/my-provider.py",size:"medium",sx:{"& .MuiOutlinedInput-root":{height:"56px"}}})]}),jsxRuntimeExports.jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsxRuntimeExports.jsx(Button,{onClick:Be,variant:"text",sx:{color:"text.secondary"},children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Ie,variant:"contained",sx:{px:3},children:"Add Provider"})]})]})},JsonTextField=({onChange:t,...Ae})=>{const[xe,Ee]=React.useState(""),[Se,Ce]=React.useState(!1),_e=Ie=>{const Be=Ie.target.value;try{const Te=JSON.parse(Be);Ee(Be),Ce(!1),t&&t(Te)}catch{Ee(Be),Ce(!0)}};return jsxRuntimeExports.jsx(TextField,{...Ae,error:Se,helperText:Se?"Invalid JSON":"",value:xe,onChange:_e})},ProviderConfigDialog=({open:t,providerId:Ae,config:xe={},onClose:Ee,onSave:Se})=>{const[Ce,_e]=reactExports.useState(xe),Ie=Ae.startsWith("azure:"),Be=$e=>$e!=null&&$e!=="",Te=!Ie||Be(Ce.deployment_id);reactExports.useEffect(()=>{_e(xe)},[t,Ae,xe]);const Pe=()=>{Se(Ae,Ce)},ke=React.useMemo(()=>{const $e=Object.keys(Ce);return Ie?["deployment_id",...$e.filter(Oe=>Oe!=="deployment_id")]:$e},[Ce,Ie]);return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ee,fullWidth:!0,maxWidth:"md",children:[jsxRuntimeExports.jsxs(DialogTitle,{children:["Provider Configuration",jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",color:"text.secondary",sx:{mt:1,fontSize:"0.9rem",fontFamily:"monospace"},children:Ae})]}),jsxRuntimeExports.jsxs(DialogContent,{children:[Ie&&jsxRuntimeExports.jsx(Box,{mb:2,children:jsxRuntimeExports.jsx(Alert,{severity:Te?"info":"warning",children:Te?"Azure OpenAI requires a deployment ID that matches your deployment name in the Azure portal.":"You must specify a deployment ID for Azure OpenAI models. This is the name you gave your model deployment in the Azure portal."})}),ke.map($e=>{const Oe=Ce[$e];let Ue;const ze=Ie&&$e==="deployment_id",Ve=!ze||Be(Oe);return typeof Oe=="number"||typeof Oe=="boolean"||typeof Oe=="string"?(typeof Oe=="number"?Ue=Ge=>_e({...Ce,[$e]:Number.parseFloat(Ge.target.value)}):typeof Oe=="boolean"?Ue=Ge=>_e({...Ce,[$e]:Ge.target.value==="true"}):Ue=Ge=>{const Xe=Ge.target.value.trim();if(Xe.startsWith("{")||Xe.startsWith("["))try{_e({...Ce,[$e]:JSON.parse(Xe)})}catch{_e({...Ce,[$e]:Xe})}else _e(Xe==="null"?{...Ce,[$e]:null}:Xe==="undefined"?{...Ce,[$e]:void 0}:{...Ce,[$e]:Xe})},jsxRuntimeExports.jsx(Box,{my:2,children:jsxRuntimeExports.jsx(TextField,{label:ze?`${$e} (Required)`:$e,value:Oe===void 0?"":Oe,onChange:Ue,fullWidth:!0,required:ze,error:ze&&!Ve,helperText:ze&&!Ve?"This field is required for Azure OpenAI":"",InputLabelProps:{shrink:!0},type:typeof Oe=="number"?"number":"text",variant:ze?"outlined":void 0,color:ze?"primary":void 0,focused:ze&&!Ve})},$e)):jsxRuntimeExports.jsx(Box,{my:2,children:jsxRuntimeExports.jsx(JsonTextField,{label:$e,defaultValue:JSON.stringify(Oe),onChange:Ge=>{_e({...Ce,[$e]:Ge})},fullWidth:!0,multiline:!0,minRows:2,InputLabelProps:{shrink:!0}})},$e)})]}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Ee,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Pe,disabled:!Te,children:"Save"})]})]})},defaultProviders=[].concat([{id:"openai:gpt-4o",label:"OpenAI: GPT-4o",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}},{id:"openai:gpt-4o-mini",label:"OpenAI: GPT-4o Mini",config:{organization:"",temperature:.5,max_tokens:1024,top_p:1,frequency_penalty:0,presence_penalty:0}},{id:"openai:o1",label:"OpenAI: GPT-o1 (with thinking)",config:{organization:"",isReasoningModel:!0,max_completion_tokens:1024,reasoning_effort:"medium"}},{id:"openai:o3-mini",label:"OpenAI: GPT-o3 Mini (with thinking)",config:{organization:"",isReasoningModel:!0,max_completion_tokens:2048,reasoning_effort:"medium"}}]).concat([{id:"anthropic:messages:claude-3-7-sonnet-20250219",label:"Anthropic: Claude 3.7 Sonnet",config:{max_tokens:1024,temperature:.5}},{id:"anthropic:messages:claude-3-7-sonnet-20250219",label:"Anthropic: Claude 3.7 Sonnet (with thinking)",config:{max_tokens:2048,temperature:1,thinking:{type:"enabled",budget_tokens:1024},showThinking:!0}},{id:"anthropic:messages:claude-3-5-sonnet-20241022",label:"Anthropic: Claude 3.5 Sonnet",config:{max_tokens:1024,temperature:.5}},{id:"anthropic:messages:claude-3-5-sonnet-20240620",label:"Anthropic: Claude 3.5 Sonnet (June)",config:{max_tokens:1024,temperature:.5}},{id:"anthropic:messages:claude-3-5-haiku-20241022",label:"Anthropic: Claude 3.5 Haiku",config:{max_tokens:1024,temperature:.5}}]).concat([{id:"bedrock:us.anthropic.claude-3-7-sonnet-20250219-v1:0",label:"Bedrock: Claude 3.7 Sonnet",config:{max_tokens:1024,temperature:.5,anthropic_version:"bedrock-2023-05-31",region:"us-east-1"}},{id:"bedrock:us.anthropic.claude-3-7-sonnet-20250219-v1:0",label:"Bedrock: Claude 3.7 Sonnet (with thinking)",config:{max_tokens:2048,temperature:1,anthropic_version:"bedrock-2023-05-31",region:"us-east-1",thinking:{type:"enabled",budget_tokens:1024},showThinking:!0}},{id:"bedrock:us.anthropic.claude-3-5-sonnet-20241022-v2:0",label:"Bedrock: Claude 3.5 Sonnet",config:{max_tokens:1024,temperature:.5,anthropic_version:"bedrock-2023-05-31",region:"us-east-1"}},{id:"bedrock:us.meta.llama3-2-3b-instruct-v1:0",label:"Bedrock: Llama 3.2 (3B)",config:{temperature:.7,top_p:.9,max_new_tokens:1024,region:"us-east-1"}},{id:"bedrock:us.meta.llama3-2-90b-instruct-v1:0",label:"Bedrock: Llama 3.2 (90B)",config:{temperature:.7,top_p:.9,max_new_tokens:1024,region:"us-east-1"}},{id:"bedrock:us.meta.llama3-3-70b-instruct-v1:0",label:"Bedrock: Llama 3.3 (70B)",config:{temperature:.7,top_p:.9,max_new_tokens:1024,region:"us-east-1"}},{id:"bedrock:us.meta.llama3-3-8b-instruct-v1:0",label:"Bedrock: Llama 3.3 (8B)",config:{temperature:.7,top_p:.9,max_new_tokens:1024,region:"us-east-1"}},{id:"bedrock:us.amazon.nova-pro-v1:0",label:"Bedrock: Amazon Titan Nova Pro",config:{max_tokens:1024,temperature:.5,region:"us-east-1"}},{id:"bedrock:us.amazon.nova-lite-v1:0",label:"Bedrock: Amazon Titan Nova Lite",config:{max_tokens:1024,temperature:.5,region:"us-east-1"}},{id:"bedrock:us.amazon.nova-micro-v1:0",label:"Bedrock: Amazon Titan Nova Micro",config:{max_tokens:1024,temperature:.5,region:"us-east-1"}},{id:"bedrock:us.amazon.nova-sonic-v1:0",label:"Bedrock: Amazon Nova Sonic",config:{inferenceConfiguration:{maxTokens:1024,temperature:.7,topP:.95},textOutputConfiguration:{mediaType:"text/plain"},region:"us-east-1"}}]).concat([{id:"azure:chat:gpt-4o",label:"Azure: GPT-4o",config:{api_host:"your-resource-name.openai.azure.com",api_version:"2024-02-15-preview",temperature:.5,max_tokens:1024}},{id:"azure:chat:gpt-4o-mini",label:"Azure: GPT-4o Mini",config:{api_host:"your-resource-name.openai.azure.com",api_version:"2024-02-15-preview",temperature:.5,max_tokens:2048}},{id:"azure:chat:o3-mini",label:"Azure: O3 Mini",config:{api_host:"your-resource-name.openai.azure.com",api_version:"2024-05-15-preview",temperature:.5,max_tokens:4096}}]).concat([{id:"vertex:gemini-2.5-pro-exp-03-25",label:"Vertex: Gemini 2.5 Pro (Exp)",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}},{id:"vertex:gemini-2.5-pro",label:"Vertex: Gemini 2.5 Pro",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}},{id:"vertex:gemini-2.5-flash",label:"Vertex: Gemini 2.5 Flash",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}},{id:"vertex:gemini-2.0-pro",label:"Vertex: Gemini 2.0 Pro",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}},{id:"vertex:gemini-2.0-flash-001",label:"Vertex: Gemini 2.0 Flash",config:{generationConfig:{temperature:.5,maxOutputTokens:1024,topP:.95,topK:40}}}]).concat([{id:"vertex:claude-3-5-sonnet-v2@20241022",label:"Vertex: Claude 3.5 Sonnet",config:{region:"us-east5",anthropic_version:"vertex-2023-10-16",max_tokens:1024,temperature:.5}},{id:"vertex:claude-3-5-haiku@20241022",label:"Vertex: Claude 3.5 Haiku",config:{region:"us-east5",anthropic_version:"vertex-2023-10-16",max_tokens:1024,temperature:.5}},{id:"vertex:llama-3.3-70b-instruct-maas",label:"Vertex: Llama 3.3 (70B)",config:{generationConfig:{temperature:.7,maxOutputTokens:1024,topP:.95,topK:40},region:"us-central1"}},{id:"vertex:llama-3.3-8b-instruct-maas",label:"Vertex: Llama 3.3 (8B)",config:{generationConfig:{temperature:.7,maxOutputTokens:1024,topP:.95,topK:40},region:"us-central1"}}]).concat([{id:"openrouter:anthropic/claude-3-5-sonnet",label:"OpenRouter: Claude 3.5 Sonnet",config:{temperature:.7,max_tokens:4096}},{id:"openrouter:meta-llama/llama-3.1-405b-instruct",label:"OpenRouter: Llama 3.1 405B",config:{temperature:.7,max_tokens:4096}},{id:"openrouter:mistralai/mistral-large-2402",label:"OpenRouter: Mistral Large",config:{temperature:.7,max_tokens:4096}},{id:"openrouter:google/gemini-1.5-pro",label:"OpenRouter: Gemini 1.5 Pro",config:{temperature:.7,max_tokens:8192}}]).sort((t,Ae)=>t.id.localeCompare(Ae.id)),PROVIDER_GROUPS={"openai:":"OpenAI","anthropic:":"Anthropic","bedrock:":"Amazon Web Services","azure:":"Azure","openrouter:":"OpenRouter","replicate:":"Replicate","vertex:":"Google Vertex AI"},getProviderGroup=t=>{if(!t)return"Other";let Ae="";typeof t=="string"?Ae=t:t&&typeof t=="object"&&t.id&&(Ae=t.id);for(const xe in PROVIDER_GROUPS)if(Ae&&typeof Ae=="string"&&Ae.indexOf(xe)===0)return PROVIDER_GROUPS[xe];return"Other"},ProviderSelector=({providers:t,onChange:Ae})=>{const{customProviders:xe,addCustomProvider:Ee}=useProvidersStore(),[Se,Ce]=React.useState(null),[_e,Ie]=React.useState(!1),Be=Ue=>{Ee(Ue),Ae([...t,Ue])},Te=React.useMemo(()=>[...defaultProviders,...xe],[xe]),Pe=Ue=>{Ce(typeof Ue=="string"?{id:Ue}:Ue)},ke=(Ue,qe)=>{Ae(t.map(ze=>ze.id===Ue&&!ze.label?{...ze,config:qe}:ze)),Ce(null)},$e=Ue=>Ue?typeof Ue=="string"?Ue:typeof Ue=="object"&&Ue&&(Ue.label||Ue.id)||"":"",Oe=Ue=>Ue?typeof Ue=="string"?Ue:typeof Ue=="object"&&Ue&&Ue.id||"":"";return jsxRuntimeExports.jsxs(Box,{mt:2,children:[jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,alignItems:"flex-start",children:[jsxRuntimeExports.jsx(Autocomplete,{sx:{flex:1,"& .MuiOutlinedInput-root":{minHeight:"56px",height:"auto",padding:"8px 14px 8px 8px !important",flexWrap:"wrap"},"& .MuiAutocomplete-tag":{margin:"2px"}},multiple:!0,freeSolo:!0,options:Te,value:t,groupBy:getProviderGroup,onChange:(Ue,qe)=>{const ze=qe.filter(Ve=>Ve!=null);Ae(ze.map(Ve=>typeof Ve=="string"?{id:Ve}:Ve))},getOptionLabel:$e,renderOption:(Ue,qe)=>{const ze=$e(qe),Ve=Oe(qe);return jsxRuntimeExports.jsx("li",{...Ue,children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",width:"100%"},children:[jsxRuntimeExports.jsx(Typography,{variant:"body1",children:ze}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{fontSize:"0.7rem"},children:Ve})]})})},renderTags:(Ue,qe)=>Ue.map((ze,Ve)=>{const Ge=$e(ze),Xe=Oe(ze);return jsxRuntimeExports.jsx(Tooltip$2,{title:Xe,children:jsxRuntimeExports.jsx(Chip,{variant:"outlined",label:Ge,...qe({index:Ve}),onClick:()=>Pe(ze),sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}})},typeof ze=="string"?ze:ze.id+(ze.label||""))}),renderInput:Ue=>jsxRuntimeExports.jsx(TextField,{...Ue,variant:"outlined",placeholder:"Select LLM providers",helperText:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center"},children:[t.length>0?"Click a provider to configure its settings. Hover over chips to see model IDs.":"Select LLM providers from the dropdown or type to search",t.length>0&&jsxRuntimeExports.jsx(Tooltip$2,{title:"Model IDs are shown below options in the dropdown menu, as tooltips when hovering over selected models, and in the configuration dialog",children:jsxRuntimeExports.jsx(Button,{size:"small",sx:{ml:1,minWidth:0,p:.5},children:"ⓘ"})})]})})}),jsxRuntimeExports.jsx(Button,{variant:"outlined",onClick:()=>Ie(!0),startIcon:jsxRuntimeExports.jsx(FolderOpenIcon,{}),sx:{height:"56px",whiteSpace:"nowrap",px:3,minWidth:"fit-content",alignSelf:"flex-start"},children:"Reference Local Provider"})]}),jsxRuntimeExports.jsx(AddLocalProviderDialog,{open:_e,onClose:()=>Ie(!1),onAdd:Be}),Se&&Se.id&&jsxRuntimeExports.jsx(ProviderConfigDialog,{open:!!Se,providerId:Se.id,config:Se.config,onClose:()=>Ce(null),onSave:ke})]})},RunTestSuiteButton=()=>{const t=useNavigate(),{defaultTest:Ae,description:xe,env:Ee,evaluateOptions:Se,prompts:Ce,providers:_e,scenarios:Ie,testCases:Be}=useStore$1(),[Te,Pe]=reactExports.useState(!1),[ke,$e]=reactExports.useState(0),Oe=async()=>{Pe(!0);const Ue={defaultTest:Ae,description:xe,env:Ee,evaluateOptions:Se,prompts:Ce,providers:_e,scenarios:Ie,tests:Be};try{const qe=await callApi("/eval/job",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ue)});if(!qe.ok)throw new Error(`HTTP error! status: ${qe.status}`);const ze=await qe.json(),Ve=setInterval(async()=>{var Ge;try{const Xe=await callApi(`/eval/job/${ze.id}/`);if(!Xe.ok)throw clearInterval(Ve),new Error(`HTTP error! status: ${Xe.status}`);const er=await Xe.json();if(er.status==="complete")clearInterval(Ve),Pe(!1),t("/eval");else{if(["failed","error"].includes(er.status))throw clearInterval(Ve),Pe(!1),new Error(((Ge=er.logs)==null?void 0:Ge.join(`
385
385
  `))||"Job failed");{const tr=er.total===0?0:Math.round(er.progress/er.total*100);$e(tr)}}}catch(Xe){clearInterval(Ve),console.error(Xe),Pe(!1),alert(`An error occurred: ${Xe.message}`)}},1e3)}catch(qe){console.error(qe),Pe(!1),alert(`An error occurred: ${qe.message}`)}};return jsxRuntimeExports.jsx(Button,{variant:"contained",color:"primary",onClick:Oe,disabled:Te,children:Te?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(CircularProgress,{size:24,sx:{marginRight:2}}),ke.toFixed(0),"% complete"]}):"Run Eval"})},scriptRel="modulepreload",assetsURL=function(t){return"/"+t},seen={},__vitePreload=function(Ae,xe,Ee){let Se=Promise.resolve();if(xe&&xe.length>0){let _e=function(Te){return Promise.all(Te.map(Pe=>Promise.resolve(Pe).then(ke=>({status:"fulfilled",value:ke}),ke=>({status:"rejected",reason:ke}))))};document.getElementsByTagName("link");const Ie=document.querySelector("meta[property=csp-nonce]"),Be=(Ie==null?void 0:Ie.nonce)||(Ie==null?void 0:Ie.getAttribute("nonce"));Se=_e(xe.map(Te=>{if(Te=assetsURL(Te),Te in seen)return;seen[Te]=!0;const Pe=Te.endsWith(".css"),ke=Pe?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${Te}"]${ke}`))return;const $e=document.createElement("link");if($e.rel=Pe?"stylesheet":scriptRel,Pe||($e.as="script"),$e.crossOrigin="",$e.href=Te,Be&&$e.setAttribute("nonce",Be),document.head.appendChild($e),Pe)return new Promise((Oe,Ue)=>{$e.addEventListener("load",Oe),$e.addEventListener("error",()=>Ue(new Error(`Unable to preload CSS for ${Te}`)))})}))}function Ce(_e){const Ie=new Event("vite:preloadError",{cancelable:!0});if(Ie.payload=_e,window.dispatchEvent(Ie),!Ie.defaultPrevented)throw _e}return Se.then(_e=>{for(const Ie of _e||[])Ie.status==="rejected"&&Ce(Ie.reason);return Ae().catch(Ce)})};var ansiStyles={exports:{}},colorName,hasRequiredColorName;function requireColorName(){return hasRequiredColorName||(hasRequiredColorName=1,colorName={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),colorName}var conversions,hasRequiredConversions;function requireConversions(){if(hasRequiredConversions)return conversions;hasRequiredConversions=1;const t=requireColorName(),Ae={};for(const Se of Object.keys(t))Ae[t[Se]]=Se;const xe={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};conversions=xe;for(const Se of Object.keys(xe)){if(!("channels"in xe[Se]))throw new Error("missing channels property: "+Se);if(!("labels"in xe[Se]))throw new Error("missing channel labels property: "+Se);if(xe[Se].labels.length!==xe[Se].channels)throw new Error("channel and label counts mismatch: "+Se);const{channels:Ce,labels:_e}=xe[Se];delete xe[Se].channels,delete xe[Se].labels,Object.defineProperty(xe[Se],"channels",{value:Ce}),Object.defineProperty(xe[Se],"labels",{value:_e})}xe.rgb.hsl=function(Se){const Ce=Se[0]/255,_e=Se[1]/255,Ie=Se[2]/255,Be=Math.min(Ce,_e,Ie),Te=Math.max(Ce,_e,Ie),Pe=Te-Be;let ke,$e;Te===Be?ke=0:Ce===Te?ke=(_e-Ie)/Pe:_e===Te?ke=2+(Ie-Ce)/Pe:Ie===Te&&(ke=4+(Ce-_e)/Pe),ke=Math.min(ke*60,360),ke<0&&(ke+=360);const Oe=(Be+Te)/2;return Te===Be?$e=0:Oe<=.5?$e=Pe/(Te+Be):$e=Pe/(2-Te-Be),[ke,$e*100,Oe*100]},xe.rgb.hsv=function(Se){let Ce,_e,Ie,Be,Te;const Pe=Se[0]/255,ke=Se[1]/255,$e=Se[2]/255,Oe=Math.max(Pe,ke,$e),Ue=Oe-Math.min(Pe,ke,$e),qe=function(ze){return(Oe-ze)/6/Ue+1/2};return Ue===0?(Be=0,Te=0):(Te=Ue/Oe,Ce=qe(Pe),_e=qe(ke),Ie=qe($e),Pe===Oe?Be=Ie-_e:ke===Oe?Be=1/3+Ce-Ie:$e===Oe&&(Be=2/3+_e-Ce),Be<0?Be+=1:Be>1&&(Be-=1)),[Be*360,Te*100,Oe*100]},xe.rgb.hwb=function(Se){const Ce=Se[0],_e=Se[1];let Ie=Se[2];const Be=xe.rgb.hsl(Se)[0],Te=1/255*Math.min(Ce,Math.min(_e,Ie));return Ie=1-1/255*Math.max(Ce,Math.max(_e,Ie)),[Be,Te*100,Ie*100]},xe.rgb.cmyk=function(Se){const Ce=Se[0]/255,_e=Se[1]/255,Ie=Se[2]/255,Be=Math.min(1-Ce,1-_e,1-Ie),Te=(1-Ce-Be)/(1-Be)||0,Pe=(1-_e-Be)/(1-Be)||0,ke=(1-Ie-Be)/(1-Be)||0;return[Te*100,Pe*100,ke*100,Be*100]};function Ee(Se,Ce){return(Se[0]-Ce[0])**2+(Se[1]-Ce[1])**2+(Se[2]-Ce[2])**2}return xe.rgb.keyword=function(Se){const Ce=Ae[Se];if(Ce)return Ce;let _e=1/0,Ie;for(const Be of Object.keys(t)){const Te=t[Be],Pe=Ee(Se,Te);Pe<_e&&(_e=Pe,Ie=Be)}return Ie},xe.keyword.rgb=function(Se){return t[Se]},xe.rgb.xyz=function(Se){let Ce=Se[0]/255,_e=Se[1]/255,Ie=Se[2]/255;Ce=Ce>.04045?((Ce+.055)/1.055)**2.4:Ce/12.92,_e=_e>.04045?((_e+.055)/1.055)**2.4:_e/12.92,Ie=Ie>.04045?((Ie+.055)/1.055)**2.4:Ie/12.92;const Be=Ce*.4124+_e*.3576+Ie*.1805,Te=Ce*.2126+_e*.7152+Ie*.0722,Pe=Ce*.0193+_e*.1192+Ie*.9505;return[Be*100,Te*100,Pe*100]},xe.rgb.lab=function(Se){const Ce=xe.rgb.xyz(Se);let _e=Ce[0],Ie=Ce[1],Be=Ce[2];_e/=95.047,Ie/=100,Be/=108.883,_e=_e>.008856?_e**(1/3):7.787*_e+16/116,Ie=Ie>.008856?Ie**(1/3):7.787*Ie+16/116,Be=Be>.008856?Be**(1/3):7.787*Be+16/116;const Te=116*Ie-16,Pe=500*(_e-Ie),ke=200*(Ie-Be);return[Te,Pe,ke]},xe.hsl.rgb=function(Se){const Ce=Se[0]/360,_e=Se[1]/100,Ie=Se[2]/100;let Be,Te,Pe;if(_e===0)return Pe=Ie*255,[Pe,Pe,Pe];Ie<.5?Be=Ie*(1+_e):Be=Ie+_e-Ie*_e;const ke=2*Ie-Be,$e=[0,0,0];for(let Oe=0;Oe<3;Oe++)Te=Ce+1/3*-(Oe-1),Te<0&&Te++,Te>1&&Te--,6*Te<1?Pe=ke+(Be-ke)*6*Te:2*Te<1?Pe=Be:3*Te<2?Pe=ke+(Be-ke)*(2/3-Te)*6:Pe=ke,$e[Oe]=Pe*255;return $e},xe.hsl.hsv=function(Se){const Ce=Se[0];let _e=Se[1]/100,Ie=Se[2]/100,Be=_e;const Te=Math.max(Ie,.01);Ie*=2,_e*=Ie<=1?Ie:2-Ie,Be*=Te<=1?Te:2-Te;const Pe=(Ie+_e)/2,ke=Ie===0?2*Be/(Te+Be):2*_e/(Ie+_e);return[Ce,ke*100,Pe*100]},xe.hsv.rgb=function(Se){const Ce=Se[0]/60,_e=Se[1]/100;let Ie=Se[2]/100;const Be=Math.floor(Ce)%6,Te=Ce-Math.floor(Ce),Pe=255*Ie*(1-_e),ke=255*Ie*(1-_e*Te),$e=255*Ie*(1-_e*(1-Te));switch(Ie*=255,Be){case 0:return[Ie,$e,Pe];case 1:return[ke,Ie,Pe];case 2:return[Pe,Ie,$e];case 3:return[Pe,ke,Ie];case 4:return[$e,Pe,Ie];case 5:return[Ie,Pe,ke]}},xe.hsv.hsl=function(Se){const Ce=Se[0],_e=Se[1]/100,Ie=Se[2]/100,Be=Math.max(Ie,.01);let Te,Pe;Pe=(2-_e)*Ie;const ke=(2-_e)*Be;return Te=_e*Be,Te/=ke<=1?ke:2-ke,Te=Te||0,Pe/=2,[Ce,Te*100,Pe*100]},xe.hwb.rgb=function(Se){const Ce=Se[0]/360;let _e=Se[1]/100,Ie=Se[2]/100;const Be=_e+Ie;let Te;Be>1&&(_e/=Be,Ie/=Be);const Pe=Math.floor(6*Ce),ke=1-Ie;Te=6*Ce-Pe,(Pe&1)!==0&&(Te=1-Te);const $e=_e+Te*(ke-_e);let Oe,Ue,qe;switch(Pe){default:case 6:case 0:Oe=ke,Ue=$e,qe=_e;break;case 1:Oe=$e,Ue=ke,qe=_e;break;case 2:Oe=_e,Ue=ke,qe=$e;break;case 3:Oe=_e,Ue=$e,qe=ke;break;case 4:Oe=$e,Ue=_e,qe=ke;break;case 5:Oe=ke,Ue=_e,qe=$e;break}return[Oe*255,Ue*255,qe*255]},xe.cmyk.rgb=function(Se){const Ce=Se[0]/100,_e=Se[1]/100,Ie=Se[2]/100,Be=Se[3]/100,Te=1-Math.min(1,Ce*(1-Be)+Be),Pe=1-Math.min(1,_e*(1-Be)+Be),ke=1-Math.min(1,Ie*(1-Be)+Be);return[Te*255,Pe*255,ke*255]},xe.xyz.rgb=function(Se){const Ce=Se[0]/100,_e=Se[1]/100,Ie=Se[2]/100;let Be,Te,Pe;return Be=Ce*3.2406+_e*-1.5372+Ie*-.4986,Te=Ce*-.9689+_e*1.8758+Ie*.0415,Pe=Ce*.0557+_e*-.204+Ie*1.057,Be=Be>.0031308?1.055*Be**(1/2.4)-.055:Be*12.92,Te=Te>.0031308?1.055*Te**(1/2.4)-.055:Te*12.92,Pe=Pe>.0031308?1.055*Pe**(1/2.4)-.055:Pe*12.92,Be=Math.min(Math.max(0,Be),1),Te=Math.min(Math.max(0,Te),1),Pe=Math.min(Math.max(0,Pe),1),[Be*255,Te*255,Pe*255]},xe.xyz.lab=function(Se){let Ce=Se[0],_e=Se[1],Ie=Se[2];Ce/=95.047,_e/=100,Ie/=108.883,Ce=Ce>.008856?Ce**(1/3):7.787*Ce+16/116,_e=_e>.008856?_e**(1/3):7.787*_e+16/116,Ie=Ie>.008856?Ie**(1/3):7.787*Ie+16/116;const Be=116*_e-16,Te=500*(Ce-_e),Pe=200*(_e-Ie);return[Be,Te,Pe]},xe.lab.xyz=function(Se){const Ce=Se[0],_e=Se[1],Ie=Se[2];let Be,Te,Pe;Te=(Ce+16)/116,Be=_e/500+Te,Pe=Te-Ie/200;const ke=Te**3,$e=Be**3,Oe=Pe**3;return Te=ke>.008856?ke:(Te-16/116)/7.787,Be=$e>.008856?$e:(Be-16/116)/7.787,Pe=Oe>.008856?Oe:(Pe-16/116)/7.787,Be*=95.047,Te*=100,Pe*=108.883,[Be,Te,Pe]},xe.lab.lch=function(Se){const Ce=Se[0],_e=Se[1],Ie=Se[2];let Be;Be=Math.atan2(Ie,_e)*360/2/Math.PI,Be<0&&(Be+=360);const Pe=Math.sqrt(_e*_e+Ie*Ie);return[Ce,Pe,Be]},xe.lch.lab=function(Se){const Ce=Se[0],_e=Se[1],Be=Se[2]/360*2*Math.PI,Te=_e*Math.cos(Be),Pe=_e*Math.sin(Be);return[Ce,Te,Pe]},xe.rgb.ansi16=function(Se,Ce=null){const[_e,Ie,Be]=Se;let Te=Ce===null?xe.rgb.hsv(Se)[2]:Ce;if(Te=Math.round(Te/50),Te===0)return 30;let Pe=30+(Math.round(Be/255)<<2|Math.round(Ie/255)<<1|Math.round(_e/255));return Te===2&&(Pe+=60),Pe},xe.hsv.ansi16=function(Se){return xe.rgb.ansi16(xe.hsv.rgb(Se),Se[2])},xe.rgb.ansi256=function(Se){const Ce=Se[0],_e=Se[1],Ie=Se[2];return Ce===_e&&_e===Ie?Ce<8?16:Ce>248?231:Math.round((Ce-8)/247*24)+232:16+36*Math.round(Ce/255*5)+6*Math.round(_e/255*5)+Math.round(Ie/255*5)},xe.ansi16.rgb=function(Se){let Ce=Se%10;if(Ce===0||Ce===7)return Se>50&&(Ce+=3.5),Ce=Ce/10.5*255,[Ce,Ce,Ce];const _e=(~~(Se>50)+1)*.5,Ie=(Ce&1)*_e*255,Be=(Ce>>1&1)*_e*255,Te=(Ce>>2&1)*_e*255;return[Ie,Be,Te]},xe.ansi256.rgb=function(Se){if(Se>=232){const Te=(Se-232)*10+8;return[Te,Te,Te]}Se-=16;let Ce;const _e=Math.floor(Se/36)/5*255,Ie=Math.floor((Ce=Se%36)/6)/5*255,Be=Ce%6/5*255;return[_e,Ie,Be]},xe.rgb.hex=function(Se){const _e=(((Math.round(Se[0])&255)<<16)+((Math.round(Se[1])&255)<<8)+(Math.round(Se[2])&255)).toString(16).toUpperCase();return"000000".substring(_e.length)+_e},xe.hex.rgb=function(Se){const Ce=Se.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!Ce)return[0,0,0];let _e=Ce[0];Ce[0].length===3&&(_e=_e.split("").map(ke=>ke+ke).join(""));const Ie=parseInt(_e,16),Be=Ie>>16&255,Te=Ie>>8&255,Pe=Ie&255;return[Be,Te,Pe]},xe.rgb.hcg=function(Se){const Ce=Se[0]/255,_e=Se[1]/255,Ie=Se[2]/255,Be=Math.max(Math.max(Ce,_e),Ie),Te=Math.min(Math.min(Ce,_e),Ie),Pe=Be-Te;let ke,$e;return Pe<1?ke=Te/(1-Pe):ke=0,Pe<=0?$e=0:Be===Ce?$e=(_e-Ie)/Pe%6:Be===_e?$e=2+(Ie-Ce)/Pe:$e=4+(Ce-_e)/Pe,$e/=6,$e%=1,[$e*360,Pe*100,ke*100]},xe.hsl.hcg=function(Se){const Ce=Se[1]/100,_e=Se[2]/100,Ie=_e<.5?2*Ce*_e:2*Ce*(1-_e);let Be=0;return Ie<1&&(Be=(_e-.5*Ie)/(1-Ie)),[Se[0],Ie*100,Be*100]},xe.hsv.hcg=function(Se){const Ce=Se[1]/100,_e=Se[2]/100,Ie=Ce*_e;let Be=0;return Ie<1&&(Be=(_e-Ie)/(1-Ie)),[Se[0],Ie*100,Be*100]},xe.hcg.rgb=function(Se){const Ce=Se[0]/360,_e=Se[1]/100,Ie=Se[2]/100;if(_e===0)return[Ie*255,Ie*255,Ie*255];const Be=[0,0,0],Te=Ce%1*6,Pe=Te%1,ke=1-Pe;let $e=0;switch(Math.floor(Te)){case 0:Be[0]=1,Be[1]=Pe,Be[2]=0;break;case 1:Be[0]=ke,Be[1]=1,Be[2]=0;break;case 2:Be[0]=0,Be[1]=1,Be[2]=Pe;break;case 3:Be[0]=0,Be[1]=ke,Be[2]=1;break;case 4:Be[0]=Pe,Be[1]=0,Be[2]=1;break;default:Be[0]=1,Be[1]=0,Be[2]=ke}return $e=(1-_e)*Ie,[(_e*Be[0]+$e)*255,(_e*Be[1]+$e)*255,(_e*Be[2]+$e)*255]},xe.hcg.hsv=function(Se){const Ce=Se[1]/100,_e=Se[2]/100,Ie=Ce+_e*(1-Ce);let Be=0;return Ie>0&&(Be=Ce/Ie),[Se[0],Be*100,Ie*100]},xe.hcg.hsl=function(Se){const Ce=Se[1]/100,Ie=Se[2]/100*(1-Ce)+.5*Ce;let Be=0;return Ie>0&&Ie<.5?Be=Ce/(2*Ie):Ie>=.5&&Ie<1&&(Be=Ce/(2*(1-Ie))),[Se[0],Be*100,Ie*100]},xe.hcg.hwb=function(Se){const Ce=Se[1]/100,_e=Se[2]/100,Ie=Ce+_e*(1-Ce);return[Se[0],(Ie-Ce)*100,(1-Ie)*100]},xe.hwb.hcg=function(Se){const Ce=Se[1]/100,Ie=1-Se[2]/100,Be=Ie-Ce;let Te=0;return Be<1&&(Te=(Ie-Be)/(1-Be)),[Se[0],Be*100,Te*100]},xe.apple.rgb=function(Se){return[Se[0]/65535*255,Se[1]/65535*255,Se[2]/65535*255]},xe.rgb.apple=function(Se){return[Se[0]/255*65535,Se[1]/255*65535,Se[2]/255*65535]},xe.gray.rgb=function(Se){return[Se[0]/100*255,Se[0]/100*255,Se[0]/100*255]},xe.gray.hsl=function(Se){return[0,0,Se[0]]},xe.gray.hsv=xe.gray.hsl,xe.gray.hwb=function(Se){return[0,100,Se[0]]},xe.gray.cmyk=function(Se){return[0,0,0,Se[0]]},xe.gray.lab=function(Se){return[Se[0],0,0]},xe.gray.hex=function(Se){const Ce=Math.round(Se[0]/100*255)&255,Ie=((Ce<<16)+(Ce<<8)+Ce).toString(16).toUpperCase();return"000000".substring(Ie.length)+Ie},xe.rgb.gray=function(Se){return[(Se[0]+Se[1]+Se[2])/3/255*100]},conversions}var route,hasRequiredRoute;function requireRoute(){if(hasRequiredRoute)return route;hasRequiredRoute=1;const t=requireConversions();function Ae(){const Ce={},_e=Object.keys(t);for(let Ie=_e.length,Be=0;Be<Ie;Be++)Ce[_e[Be]]={distance:-1,parent:null};return Ce}function xe(Ce){const _e=Ae(),Ie=[Ce];for(_e[Ce].distance=0;Ie.length;){const Be=Ie.pop(),Te=Object.keys(t[Be]);for(let Pe=Te.length,ke=0;ke<Pe;ke++){const $e=Te[ke],Oe=_e[$e];Oe.distance===-1&&(Oe.distance=_e[Be].distance+1,Oe.parent=Be,Ie.unshift($e))}}return _e}function Ee(Ce,_e){return function(Ie){return _e(Ce(Ie))}}function Se(Ce,_e){const Ie=[_e[Ce].parent,Ce];let Be=t[_e[Ce].parent][Ce],Te=_e[Ce].parent;for(;_e[Te].parent;)Ie.unshift(_e[Te].parent),Be=Ee(t[_e[Te].parent][Te],Be),Te=_e[Te].parent;return Be.conversion=Ie,Be}return route=function(Ce){const _e=xe(Ce),Ie={},Be=Object.keys(_e);for(let Te=Be.length,Pe=0;Pe<Te;Pe++){const ke=Be[Pe];_e[ke].parent!==null&&(Ie[ke]=Se(ke,_e))}return Ie},route}var colorConvert,hasRequiredColorConvert;function requireColorConvert(){if(hasRequiredColorConvert)return colorConvert;hasRequiredColorConvert=1;const t=requireConversions(),Ae=requireRoute(),xe={},Ee=Object.keys(t);function Se(_e){const Ie=function(...Be){const Te=Be[0];return Te==null?Te:(Te.length>1&&(Be=Te),_e(Be))};return"conversion"in _e&&(Ie.conversion=_e.conversion),Ie}function Ce(_e){const Ie=function(...Be){const Te=Be[0];if(Te==null)return Te;Te.length>1&&(Be=Te);const Pe=_e(Be);if(typeof Pe=="object")for(let ke=Pe.length,$e=0;$e<ke;$e++)Pe[$e]=Math.round(Pe[$e]);return Pe};return"conversion"in _e&&(Ie.conversion=_e.conversion),Ie}return Ee.forEach(_e=>{xe[_e]={},Object.defineProperty(xe[_e],"channels",{value:t[_e].channels}),Object.defineProperty(xe[_e],"labels",{value:t[_e].labels});const Ie=Ae(_e);Object.keys(Ie).forEach(Te=>{const Pe=Ie[Te];xe[_e][Te]=Ce(Pe),xe[_e][Te].raw=Se(Pe)})}),colorConvert=xe,colorConvert}ansiStyles.exports;var hasRequiredAnsiStyles;function requireAnsiStyles(){return hasRequiredAnsiStyles||(hasRequiredAnsiStyles=1,function(t){const Ae=(Pe,ke)=>(...$e)=>`\x1B[${Pe(...$e)+ke}m`,xe=(Pe,ke)=>(...$e)=>{const Oe=Pe(...$e);return`\x1B[${38+ke};5;${Oe}m`},Ee=(Pe,ke)=>(...$e)=>{const Oe=Pe(...$e);return`\x1B[${38+ke};2;${Oe[0]};${Oe[1]};${Oe[2]}m`},Se=Pe=>Pe,Ce=(Pe,ke,$e)=>[Pe,ke,$e],_e=(Pe,ke,$e)=>{Object.defineProperty(Pe,ke,{get:()=>{const Oe=$e();return Object.defineProperty(Pe,ke,{value:Oe,enumerable:!0,configurable:!0}),Oe},enumerable:!0,configurable:!0})};let Ie;const Be=(Pe,ke,$e,Oe)=>{Ie===void 0&&(Ie=requireColorConvert());const Ue=Oe?10:0,qe={};for(const[ze,Ve]of Object.entries(Ie)){const Ge=ze==="ansi16"?"ansi":ze;ze===ke?qe[Ge]=Pe($e,Ue):typeof Ve=="object"&&(qe[Ge]=Pe(Ve[ke],Ue))}return qe};function Te(){const Pe=new Map,ke={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};ke.color.gray=ke.color.blackBright,ke.bgColor.bgGray=ke.bgColor.bgBlackBright,ke.color.grey=ke.color.blackBright,ke.bgColor.bgGrey=ke.bgColor.bgBlackBright;for(const[$e,Oe]of Object.entries(ke)){for(const[Ue,qe]of Object.entries(Oe))ke[Ue]={open:`\x1B[${qe[0]}m`,close:`\x1B[${qe[1]}m`},Oe[Ue]=ke[Ue],Pe.set(qe[0],qe[1]);Object.defineProperty(ke,$e,{value:Oe,enumerable:!1})}return Object.defineProperty(ke,"codes",{value:Pe,enumerable:!1}),ke.color.close="\x1B[39m",ke.bgColor.close="\x1B[49m",_e(ke.color,"ansi",()=>Be(Ae,"ansi16",Se,!1)),_e(ke.color,"ansi256",()=>Be(xe,"ansi256",Se,!1)),_e(ke.color,"ansi16m",()=>Be(Ee,"rgb",Ce,!1)),_e(ke.bgColor,"ansi",()=>Be(Ae,"ansi16",Se,!0)),_e(ke.bgColor,"ansi256",()=>Be(xe,"ansi256",Se,!0)),_e(ke.bgColor,"ansi16m",()=>Be(Ee,"rgb",Ce,!0)),ke}Object.defineProperty(t,"exports",{enumerable:!0,get:Te})}(ansiStyles)),ansiStyles.exports}var browser$g,hasRequiredBrowser$g;function requireBrowser$g(){return hasRequiredBrowser$g||(hasRequiredBrowser$g=1,browser$g={stdout:!1,stderr:!1}),browser$g}var util$3,hasRequiredUtil$2;function requireUtil$2(){return hasRequiredUtil$2||(hasRequiredUtil$2=1,util$3={stringReplaceAll:(xe,Ee,Se)=>{let Ce=xe.indexOf(Ee);if(Ce===-1)return xe;const _e=Ee.length;let Ie=0,Be="";do Be+=xe.substr(Ie,Ce-Ie)+Ee+Se,Ie=Ce+_e,Ce=xe.indexOf(Ee,Ie);while(Ce!==-1);return Be+=xe.substr(Ie),Be},stringEncaseCRLFWithFirstIndex:(xe,Ee,Se,Ce)=>{let _e=0,Ie="";do{const Be=xe[Ce-1]==="\r";Ie+=xe.substr(_e,(Be?Ce-1:Ce)-_e)+Ee+(Be?`\r
386
386
  `:`
387
387
  `)+Se,_e=Ce+1,Ce=xe.indexOf(`
@@ -518,15 +518,15 @@ use chrome, FireFox or Internet Explorer 11`)}var Ae=requireSafeBuffer$1(),xe=re
518
518
  we accept pull requests
519
519
  https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}const version$1="16.5.0",require$$4={version:version$1};var hasRequiredMain;function requireMain(){if(hasRequiredMain)return main.exports;hasRequiredMain=1;var t={};const Ae=require$$2$1,xe=requirePathBrowserify(),Ee=requireBrowser$f(),Se=requireCryptoBrowserify(),_e=require$$4.version,Ie=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Be(nr){const sr={};let dr=nr.toString();dr=dr.replace(/\r\n?/mg,`
520
520
  `);let ar;for(;(ar=Ie.exec(dr))!=null;){const lr=ar[1];let Ke=ar[2]||"";Ke=Ke.trim();const Me=Ke[0];Ke=Ke.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),Me==='"'&&(Ke=Ke.replace(/\\n/g,`
521
- `),Ke=Ke.replace(/\\r/g,"\r")),sr[lr]=Ke}return sr}function Te(nr){const sr=Ue(nr),dr=tr.configDotenv({path:sr});if(!dr.parsed){const Me=new Error(`MISSING_DATA: Cannot parse ${sr} for an unknown reason`);throw Me.code="MISSING_DATA",Me}const ar=$e(nr).split(","),lr=ar.length;let Ke;for(let Me=0;Me<lr;Me++)try{const je=ar[Me].trim(),De=Oe(dr,je);Ke=tr.decrypt(De.ciphertext,De.key);break}catch(je){if(Me+1>=lr)throw je}return tr.parse(Ke)}function Pe(nr){console.log(`[dotenv@${_e}][WARN] ${nr}`)}function ke(nr){console.log(`[dotenv@${_e}][DEBUG] ${nr}`)}function $e(nr){return nr&&nr.DOTENV_KEY&&nr.DOTENV_KEY.length>0?nr.DOTENV_KEY:t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:""}function Oe(nr,sr){let dr;try{dr=new URL(sr)}catch(je){if(je.code==="ERR_INVALID_URL"){const De=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw De.code="INVALID_DOTENV_KEY",De}throw je}const ar=dr.password;if(!ar){const je=new Error("INVALID_DOTENV_KEY: Missing key part");throw je.code="INVALID_DOTENV_KEY",je}const lr=dr.searchParams.get("environment");if(!lr){const je=new Error("INVALID_DOTENV_KEY: Missing environment part");throw je.code="INVALID_DOTENV_KEY",je}const Ke=`DOTENV_VAULT_${lr.toUpperCase()}`,Me=nr.parsed[Ke];if(!Me){const je=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${Ke} in your .env.vault file.`);throw je.code="NOT_FOUND_DOTENV_ENVIRONMENT",je}return{ciphertext:Me,key:ar}}function Ue(nr){let sr=null;if(nr&&nr.path&&nr.path.length>0)if(Array.isArray(nr.path))for(const dr of nr.path)Ae.existsSync(dr)&&(sr=dr.endsWith(".vault")?dr:`${dr}.vault`);else sr=nr.path.endsWith(".vault")?nr.path:`${nr.path}.vault`;else sr=xe.resolve(process$1.cwd(),".env.vault");return Ae.existsSync(sr)?sr:null}function qe(nr){return nr[0]==="~"?xe.join(Ee.homedir(),nr.slice(1)):nr}function ze(nr){!!(nr&&nr.debug)&&ke("Loading env from encrypted .env.vault");const dr=tr._parseVault(nr);let ar=t;return nr&&nr.processEnv!=null&&(ar=nr.processEnv),tr.populate(ar,dr,nr),{parsed:dr}}function Ve(nr){const sr=xe.resolve(process$1.cwd(),".env");let dr="utf8";const ar=!!(nr&&nr.debug);nr&&nr.encoding?dr=nr.encoding:ar&&ke("No encoding is specified. UTF-8 is used by default");let lr=[sr];if(nr&&nr.path)if(!Array.isArray(nr.path))lr=[qe(nr.path)];else{lr=[];for(const De of nr.path)lr.push(qe(De))}let Ke;const Me={};for(const De of lr)try{const He=tr.parse(Ae.readFileSync(De,{encoding:dr}));tr.populate(Me,He,nr)}catch(He){ar&&ke(`Failed to load ${De} ${He.message}`),Ke=He}let je=t;return nr&&nr.processEnv!=null&&(je=nr.processEnv),tr.populate(je,Me,nr),Ke?{parsed:Me,error:Ke}:{parsed:Me}}function Ge(nr){if($e(nr).length===0)return tr.configDotenv(nr);const sr=Ue(nr);return sr?tr._configVault(nr):(Pe(`You set DOTENV_KEY but you are missing a .env.vault file at ${sr}. Did you forget to build it?`),tr.configDotenv(nr))}function Xe(nr,sr){const dr=Buffer$2.from(sr.slice(-64),"hex");let ar=Buffer$2.from(nr,"base64");const lr=ar.subarray(0,12),Ke=ar.subarray(-16);ar=ar.subarray(12,-16);try{const Me=Se.createDecipheriv("aes-256-gcm",dr,lr);return Me.setAuthTag(Ke),`${Me.update(ar)}${Me.final()}`}catch(Me){const je=Me instanceof RangeError,De=Me.message==="Invalid key length",He=Me.message==="Unsupported state or unable to authenticate data";if(je||De){const Qe=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw Qe.code="INVALID_DOTENV_KEY",Qe}else if(He){const Qe=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw Qe.code="DECRYPTION_FAILED",Qe}else throw Me}}function er(nr,sr,dr={}){const ar=!!(dr&&dr.debug),lr=!!(dr&&dr.override);if(typeof sr!="object"){const Ke=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw Ke.code="OBJECT_REQUIRED",Ke}for(const Ke of Object.keys(sr))Object.prototype.hasOwnProperty.call(nr,Ke)?(lr===!0&&(nr[Ke]=sr[Ke]),ar&&ke(lr===!0?`"${Ke}" is already defined and WAS overwritten`:`"${Ke}" is already defined and was NOT overwritten`)):nr[Ke]=sr[Ke]}const tr={configDotenv:Ve,_configVault:ze,_parseVault:Te,config:Ge,decrypt:Xe,parse:Be,populate:er};return main.exports.configDotenv=tr.configDotenv,main.exports._configVault=tr._configVault,main.exports._parseVault=tr._parseVault,main.exports.config=tr.config,main.exports.decrypt=tr.decrypt,main.exports.parse=tr.parse,main.exports.populate=tr.populate,main.exports=tr,main.exports}var envOptions,hasRequiredEnvOptions;function requireEnvOptions(){if(hasRequiredEnvOptions)return envOptions;hasRequiredEnvOptions=1;var t={};const Ae={};return t.DOTENV_CONFIG_ENCODING!=null&&(Ae.encoding=t.DOTENV_CONFIG_ENCODING),t.DOTENV_CONFIG_PATH!=null&&(Ae.path=t.DOTENV_CONFIG_PATH),t.DOTENV_CONFIG_DEBUG!=null&&(Ae.debug=t.DOTENV_CONFIG_DEBUG),t.DOTENV_CONFIG_OVERRIDE!=null&&(Ae.override=t.DOTENV_CONFIG_OVERRIDE),t.DOTENV_CONFIG_DOTENV_KEY!=null&&(Ae.DOTENV_KEY=t.DOTENV_CONFIG_DOTENV_KEY),envOptions=Ae,envOptions}var cliOptions,hasRequiredCliOptions;function requireCliOptions(){if(hasRequiredCliOptions)return cliOptions;hasRequiredCliOptions=1;const t=/^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;return cliOptions=function(xe){return xe.reduce(function(Ee,Se){const Ce=Se.match(t);return Ce&&(Ee[Ce[1]]=Ce[2]),Ee},{})},cliOptions}var hasRequiredConfig;function requireConfig(){return hasRequiredConfig||(hasRequiredConfig=1,function(){requireMain().config(Object.assign({},requireEnvOptions(),requireCliOptions()(process$1.argv)))}()),config$1}requireConfig();const state={};var define_process_env_default={};function getEnvString(t,Ae){var Ee;if((Ee=state.config)!=null&&Ee.env&&typeof state.config.env=="object"){const Se=state.config.env[t];if(Se!==void 0)return String(Se)}const xe=define_process_env_default[t];return xe===void 0?Ae:xe}const LOG_LEVELS={error:0,warn:1,info:2,debug:3};let sourceMapSupportInitialized=!1;async function initializeSourceMapSupport(){if(!sourceMapSupportInitialized)try{(await __vitePreload(()=>import("./source-map-support-DvBN-NgF.js").then(Ae=>Ae.s),[])).install(),sourceMapSupportInitialized=!0}catch{}}function getCallerLocation(){var t;try{const Ee=(((t=new Error().stack)==null?void 0:t.split(`
521
+ `),Ke=Ke.replace(/\\r/g,"\r")),sr[lr]=Ke}return sr}function Te(nr){const sr=Ue(nr),dr=tr.configDotenv({path:sr});if(!dr.parsed){const Me=new Error(`MISSING_DATA: Cannot parse ${sr} for an unknown reason`);throw Me.code="MISSING_DATA",Me}const ar=$e(nr).split(","),lr=ar.length;let Ke;for(let Me=0;Me<lr;Me++)try{const je=ar[Me].trim(),De=Oe(dr,je);Ke=tr.decrypt(De.ciphertext,De.key);break}catch(je){if(Me+1>=lr)throw je}return tr.parse(Ke)}function Pe(nr){console.log(`[dotenv@${_e}][WARN] ${nr}`)}function ke(nr){console.log(`[dotenv@${_e}][DEBUG] ${nr}`)}function $e(nr){return nr&&nr.DOTENV_KEY&&nr.DOTENV_KEY.length>0?nr.DOTENV_KEY:t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:""}function Oe(nr,sr){let dr;try{dr=new URL(sr)}catch(je){if(je.code==="ERR_INVALID_URL"){const De=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw De.code="INVALID_DOTENV_KEY",De}throw je}const ar=dr.password;if(!ar){const je=new Error("INVALID_DOTENV_KEY: Missing key part");throw je.code="INVALID_DOTENV_KEY",je}const lr=dr.searchParams.get("environment");if(!lr){const je=new Error("INVALID_DOTENV_KEY: Missing environment part");throw je.code="INVALID_DOTENV_KEY",je}const Ke=`DOTENV_VAULT_${lr.toUpperCase()}`,Me=nr.parsed[Ke];if(!Me){const je=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${Ke} in your .env.vault file.`);throw je.code="NOT_FOUND_DOTENV_ENVIRONMENT",je}return{ciphertext:Me,key:ar}}function Ue(nr){let sr=null;if(nr&&nr.path&&nr.path.length>0)if(Array.isArray(nr.path))for(const dr of nr.path)Ae.existsSync(dr)&&(sr=dr.endsWith(".vault")?dr:`${dr}.vault`);else sr=nr.path.endsWith(".vault")?nr.path:`${nr.path}.vault`;else sr=xe.resolve(process$1.cwd(),".env.vault");return Ae.existsSync(sr)?sr:null}function qe(nr){return nr[0]==="~"?xe.join(Ee.homedir(),nr.slice(1)):nr}function ze(nr){!!(nr&&nr.debug)&&ke("Loading env from encrypted .env.vault");const dr=tr._parseVault(nr);let ar=t;return nr&&nr.processEnv!=null&&(ar=nr.processEnv),tr.populate(ar,dr,nr),{parsed:dr}}function Ve(nr){const sr=xe.resolve(process$1.cwd(),".env");let dr="utf8";const ar=!!(nr&&nr.debug);nr&&nr.encoding?dr=nr.encoding:ar&&ke("No encoding is specified. UTF-8 is used by default");let lr=[sr];if(nr&&nr.path)if(!Array.isArray(nr.path))lr=[qe(nr.path)];else{lr=[];for(const De of nr.path)lr.push(qe(De))}let Ke;const Me={};for(const De of lr)try{const He=tr.parse(Ae.readFileSync(De,{encoding:dr}));tr.populate(Me,He,nr)}catch(He){ar&&ke(`Failed to load ${De} ${He.message}`),Ke=He}let je=t;return nr&&nr.processEnv!=null&&(je=nr.processEnv),tr.populate(je,Me,nr),Ke?{parsed:Me,error:Ke}:{parsed:Me}}function Ge(nr){if($e(nr).length===0)return tr.configDotenv(nr);const sr=Ue(nr);return sr?tr._configVault(nr):(Pe(`You set DOTENV_KEY but you are missing a .env.vault file at ${sr}. Did you forget to build it?`),tr.configDotenv(nr))}function Xe(nr,sr){const dr=Buffer$2.from(sr.slice(-64),"hex");let ar=Buffer$2.from(nr,"base64");const lr=ar.subarray(0,12),Ke=ar.subarray(-16);ar=ar.subarray(12,-16);try{const Me=Se.createDecipheriv("aes-256-gcm",dr,lr);return Me.setAuthTag(Ke),`${Me.update(ar)}${Me.final()}`}catch(Me){const je=Me instanceof RangeError,De=Me.message==="Invalid key length",He=Me.message==="Unsupported state or unable to authenticate data";if(je||De){const Qe=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw Qe.code="INVALID_DOTENV_KEY",Qe}else if(He){const Qe=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw Qe.code="DECRYPTION_FAILED",Qe}else throw Me}}function er(nr,sr,dr={}){const ar=!!(dr&&dr.debug),lr=!!(dr&&dr.override);if(typeof sr!="object"){const Ke=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw Ke.code="OBJECT_REQUIRED",Ke}for(const Ke of Object.keys(sr))Object.prototype.hasOwnProperty.call(nr,Ke)?(lr===!0&&(nr[Ke]=sr[Ke]),ar&&ke(lr===!0?`"${Ke}" is already defined and WAS overwritten`:`"${Ke}" is already defined and was NOT overwritten`)):nr[Ke]=sr[Ke]}const tr={configDotenv:Ve,_configVault:ze,_parseVault:Te,config:Ge,decrypt:Xe,parse:Be,populate:er};return main.exports.configDotenv=tr.configDotenv,main.exports._configVault=tr._configVault,main.exports._parseVault=tr._parseVault,main.exports.config=tr.config,main.exports.decrypt=tr.decrypt,main.exports.parse=tr.parse,main.exports.populate=tr.populate,main.exports=tr,main.exports}var envOptions,hasRequiredEnvOptions;function requireEnvOptions(){if(hasRequiredEnvOptions)return envOptions;hasRequiredEnvOptions=1;var t={};const Ae={};return t.DOTENV_CONFIG_ENCODING!=null&&(Ae.encoding=t.DOTENV_CONFIG_ENCODING),t.DOTENV_CONFIG_PATH!=null&&(Ae.path=t.DOTENV_CONFIG_PATH),t.DOTENV_CONFIG_DEBUG!=null&&(Ae.debug=t.DOTENV_CONFIG_DEBUG),t.DOTENV_CONFIG_OVERRIDE!=null&&(Ae.override=t.DOTENV_CONFIG_OVERRIDE),t.DOTENV_CONFIG_DOTENV_KEY!=null&&(Ae.DOTENV_KEY=t.DOTENV_CONFIG_DOTENV_KEY),envOptions=Ae,envOptions}var cliOptions,hasRequiredCliOptions;function requireCliOptions(){if(hasRequiredCliOptions)return cliOptions;hasRequiredCliOptions=1;const t=/^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;return cliOptions=function(xe){return xe.reduce(function(Ee,Se){const Ce=Se.match(t);return Ce&&(Ee[Ce[1]]=Ce[2]),Ee},{})},cliOptions}var hasRequiredConfig;function requireConfig(){return hasRequiredConfig||(hasRequiredConfig=1,function(){requireMain().config(Object.assign({},requireEnvOptions(),requireCliOptions()(process$1.argv)))}()),config$1}requireConfig();const state={};var define_process_env_default={};function getEnvString(t,Ae){var Ee;if((Ee=state.config)!=null&&Ee.env&&typeof state.config.env=="object"){const Se=state.config.env[t];if(Se!==void 0)return String(Se)}const xe=define_process_env_default[t];return xe===void 0?Ae:xe}const LOG_LEVELS={error:0,warn:1,info:2,debug:3};let sourceMapSupportInitialized=!1;async function initializeSourceMapSupport(){if(!sourceMapSupportInitialized)try{(await __vitePreload(()=>import("./source-map-support-CD7hineC.js").then(Ae=>Ae.s),[])).install(),sourceMapSupportInitialized=!0}catch{}}function getCallerLocation(){var t;try{const Ee=(((t=new Error().stack)==null?void 0:t.split(`
522
522
  `))||[])[3];if(Ee){const Se=Ee.match(/at (?:.*) \((.+):(\d+):(\d+)\)/),Ce=Ee.match(/at (.+):(\d+):(\d+)/),_e=Se||Ce;if(_e){const Ie=_e[1],Be=_e[2];return`[${path$1.basename(Ie)}:${Be}]`}}}catch{}return""}function extractMessage(t){return typeof t.message=="object"&&t.message!==null&&"message"in t.message?typeof t.message.message=="string"?t.message.message:String(t.message.message):typeof t.message=="string"?t.message:JSON.stringify(t.message)}const consoleFormatter=winston.format.printf(t=>{const Ae=extractMessage(t),xe=t.location?`${t.location} `:"";if(t.level==="error")return chalk.red(`${xe}${Ae}`);if(t.level==="warn")return chalk.yellow(`${xe}${Ae}`);if(t.level==="info")return`${xe}${Ae}`;if(t.level==="debug")return`${chalk.cyan(xe)}${Ae}`;throw new Error(`Invalid log level: ${t.level}`)}),fileFormatter=winston.format.printf(t=>{const Ae=new Date().toISOString(),xe=t.location?` ${t.location}`:"",Ee=extractMessage(t);return`${Ae} [${t.level.toUpperCase()}]${xe}: ${Ee}`}),winstonLogger=winston.createLogger({levels:LOG_LEVELS,transports:[new winston.transports.Console({level:getEnvString("LOG_LEVEL","info"),format:winston.format.combine(winston.format.simple(),consoleFormatter)})]});getEnvString("PROMPTFOO_DISABLE_ERROR_LOG","")||winstonLogger.on("data",t=>{if(t.level==="error"&&!winstonLogger.transports.some(Ae=>Ae instanceof winston.transports.File)){const Ae=new winston.transports.File({filename:path$1.join(getEnvString("PROMPTFOO_LOG_DIR","."),"promptfoo-errors.log"),level:"error",format:winston.format.combine(winston.format.simple(),fileFormatter)});winstonLogger.add(Ae),Ae.write(t)}});function getLogLevel(){return winstonLogger.transports[0].level}function isDebugEnabled(){return getLogLevel()==="debug"}function createLogMethod(t){return Ae=>{const xe=t==="debug"||isDebugEnabled()?getCallerLocation():"";return t==="debug"&&initializeSourceMapSupport(),winstonLogger[t]({message:Ae,location:xe})}}const logger=Object.assign({},winstonLogger,{error:createLogMethod("error"),warn:createLogMethod("warn"),info:createLogMethod("info"),debug:createLogMethod("debug"),add:winstonLogger.add.bind(winstonLogger),remove:winstonLogger.remove.bind(winstonLogger),transports:winstonLogger.transports});getEnvString("LOG_LEVEL","info")==="debug"&&initializeSourceMapSupport();var util;(function(t){t.assertEqual=Se=>Se;function Ae(Se){}t.assertIs=Ae;function xe(Se){throw new Error}t.assertNever=xe,t.arrayToEnum=Se=>{const Ce={};for(const _e of Se)Ce[_e]=_e;return Ce},t.getValidEnumValues=Se=>{const Ce=t.objectKeys(Se).filter(Ie=>typeof Se[Se[Ie]]!="number"),_e={};for(const Ie of Ce)_e[Ie]=Se[Ie];return t.objectValues(_e)},t.objectValues=Se=>t.objectKeys(Se).map(function(Ce){return Se[Ce]}),t.objectKeys=typeof Object.keys=="function"?Se=>Object.keys(Se):Se=>{const Ce=[];for(const _e in Se)Object.prototype.hasOwnProperty.call(Se,_e)&&Ce.push(_e);return Ce},t.find=(Se,Ce)=>{for(const _e of Se)if(Ce(_e))return _e},t.isInteger=typeof Number.isInteger=="function"?Se=>Number.isInteger(Se):Se=>typeof Se=="number"&&isFinite(Se)&&Math.floor(Se)===Se;function Ee(Se,Ce=" | "){return Se.map(_e=>typeof _e=="string"?`'${_e}'`:_e).join(Ce)}t.joinValues=Ee,t.jsonStringifyReplacer=(Se,Ce)=>typeof Ce=="bigint"?Ce.toString():Ce})(util||(util={}));var objectUtil;(function(t){t.mergeShapes=(Ae,xe)=>({...Ae,...xe})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=t=>{switch(typeof t){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(t)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(t)?ZodParsedType.array:t===null?ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?ZodParsedType.map:typeof Set<"u"&&t instanceof Set?ZodParsedType.set:typeof Date<"u"&&t instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(Ae){super(),this.issues=[],this.addIssue=Ee=>{this.issues=[...this.issues,Ee]},this.addIssues=(Ee=[])=>{this.issues=[...this.issues,...Ee]};const xe=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,xe):this.__proto__=xe,this.name="ZodError",this.issues=Ae}format(Ae){const xe=Ae||function(Ce){return Ce.message},Ee={_errors:[]},Se=Ce=>{for(const _e of Ce.issues)if(_e.code==="invalid_union")_e.unionErrors.map(Se);else if(_e.code==="invalid_return_type")Se(_e.returnTypeError);else if(_e.code==="invalid_arguments")Se(_e.argumentsError);else if(_e.path.length===0)Ee._errors.push(xe(_e));else{let Ie=Ee,Be=0;for(;Be<_e.path.length;){const Te=_e.path[Be];Be===_e.path.length-1?(Ie[Te]=Ie[Te]||{_errors:[]},Ie[Te]._errors.push(xe(_e))):Ie[Te]=Ie[Te]||{_errors:[]},Ie=Ie[Te],Be++}}};return Se(this),Ee}static assert(Ae){if(!(Ae instanceof ZodError))throw new Error(`Not a ZodError: ${Ae}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(Ae=xe=>xe.message){const xe={},Ee=[];for(const Se of this.issues)Se.path.length>0?(xe[Se.path[0]]=xe[Se.path[0]]||[],xe[Se.path[0]].push(Ae(Se))):Ee.push(Ae(Se));return{formErrors:Ee,fieldErrors:xe}}get formErrors(){return this.flatten()}}ZodError.create=t=>new ZodError(t);const errorMap=(t,Ae)=>{let xe;switch(t.code){case ZodIssueCode.invalid_type:t.received===ZodParsedType.undefined?xe="Required":xe=`Expected ${t.expected}, received ${t.received}`;break;case ZodIssueCode.invalid_literal:xe=`Invalid literal value, expected ${JSON.stringify(t.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:xe=`Unrecognized key(s) in object: ${util.joinValues(t.keys,", ")}`;break;case ZodIssueCode.invalid_union:xe="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:xe=`Invalid discriminator value. Expected ${util.joinValues(t.options)}`;break;case ZodIssueCode.invalid_enum_value:xe=`Invalid enum value. Expected ${util.joinValues(t.options)}, received '${t.received}'`;break;case ZodIssueCode.invalid_arguments:xe="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:xe="Invalid function return type";break;case ZodIssueCode.invalid_date:xe="Invalid date";break;case ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(xe=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(xe=`${xe} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?xe=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?xe=`Invalid input: must end with "${t.validation.endsWith}"`:util.assertNever(t.validation):t.validation!=="regex"?xe=`Invalid ${t.validation}`:xe="Invalid";break;case ZodIssueCode.too_small:t.type==="array"?xe=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?xe=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?xe=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?xe=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:xe="Invalid input";break;case ZodIssueCode.too_big:t.type==="array"?xe=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?xe=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?xe=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?xe=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?xe=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:xe="Invalid input";break;case ZodIssueCode.custom:xe="Invalid input";break;case ZodIssueCode.invalid_intersection_types:xe="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:xe=`Number must be a multiple of ${t.multipleOf}`;break;case ZodIssueCode.not_finite:xe="Number must be finite";break;default:xe=Ae.defaultError,util.assertNever(t)}return{message:xe}};let overrideErrorMap=errorMap;function setErrorMap(t){overrideErrorMap=t}function getErrorMap(){return overrideErrorMap}const makeIssue=t=>{const{data:Ae,path:xe,errorMaps:Ee,issueData:Se}=t,Ce=[...xe,...Se.path||[]],_e={...Se,path:Ce};if(Se.message!==void 0)return{...Se,path:Ce,message:Se.message};let Ie="";const Be=Ee.filter(Te=>!!Te).slice().reverse();for(const Te of Be)Ie=Te(_e,{data:Ae,defaultError:Ie}).message;return{...Se,path:Ce,message:Ie}},EMPTY_PATH=[];function addIssueToContext(t,Ae){const xe=getErrorMap(),Ee=makeIssue({issueData:Ae,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xe,xe===errorMap?void 0:errorMap].filter(Se=>!!Se)});t.common.issues.push(Ee)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(Ae,xe){const Ee=[];for(const Se of xe){if(Se.status==="aborted")return INVALID;Se.status==="dirty"&&Ae.dirty(),Ee.push(Se.value)}return{status:Ae.value,value:Ee}}static async mergeObjectAsync(Ae,xe){const Ee=[];for(const Se of xe){const Ce=await Se.key,_e=await Se.value;Ee.push({key:Ce,value:_e})}return ParseStatus.mergeObjectSync(Ae,Ee)}static mergeObjectSync(Ae,xe){const Ee={};for(const Se of xe){const{key:Ce,value:_e}=Se;if(Ce.status==="aborted"||_e.status==="aborted")return INVALID;Ce.status==="dirty"&&Ae.dirty(),_e.status==="dirty"&&Ae.dirty(),Ce.value!=="__proto__"&&(typeof _e.value<"u"||Se.alwaysSet)&&(Ee[Ce.value]=_e.value)}return{status:Ae.value,value:Ee}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=t=>({status:"dirty",value:t}),OK=t=>({status:"valid",value:t}),isAborted=t=>t.status==="aborted",isDirty=t=>t.status==="dirty",isValid=t=>t.status==="valid",isAsync=t=>typeof Promise<"u"&&t instanceof Promise;function __classPrivateFieldGet(t,Ae,xe,Ee){if(typeof Ae=="function"?t!==Ae||!0:!Ae.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Ae.get(t)}function __classPrivateFieldSet(t,Ae,xe,Ee,Se){if(typeof Ae=="function"?t!==Ae||!0:!Ae.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Ae.set(t,xe),xe}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(t){t.errToObj=Ae=>typeof Ae=="string"?{message:Ae}:Ae||{},t.toString=Ae=>typeof Ae=="string"?Ae:Ae==null?void 0:Ae.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(Ae,xe,Ee,Se){this._cachedPath=[],this.parent=Ae,this.data=xe,this._path=Ee,this._key=Se}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(t,Ae)=>{if(isValid(Ae))return{success:!0,data:Ae.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const xe=new ZodError(t.common.issues);return this._error=xe,this._error}}};function processCreateParams(t){if(!t)return{};const{errorMap:Ae,invalid_type_error:xe,required_error:Ee,description:Se}=t;if(Ae&&(xe||Ee))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return Ae?{errorMap:Ae,description:Se}:{errorMap:(_e,Ie)=>{var Be,Te;const{message:Pe}=t;return _e.code==="invalid_enum_value"?{message:Pe??Ie.defaultError}:typeof Ie.data>"u"?{message:(Be=Pe??Ee)!==null&&Be!==void 0?Be:Ie.defaultError}:_e.code!=="invalid_type"?{message:Ie.defaultError}:{message:(Te=Pe??xe)!==null&&Te!==void 0?Te:Ie.defaultError}},description:Se}}class ZodType{get description(){return this._def.description}_getType(Ae){return getParsedType(Ae.data)}_getOrReturnCtx(Ae,xe){return xe||{common:Ae.parent.common,data:Ae.data,parsedType:getParsedType(Ae.data),schemaErrorMap:this._def.errorMap,path:Ae.path,parent:Ae.parent}}_processInputParams(Ae){return{status:new ParseStatus,ctx:{common:Ae.parent.common,data:Ae.data,parsedType:getParsedType(Ae.data),schemaErrorMap:this._def.errorMap,path:Ae.path,parent:Ae.parent}}}_parseSync(Ae){const xe=this._parse(Ae);if(isAsync(xe))throw new Error("Synchronous parse encountered promise.");return xe}_parseAsync(Ae){const xe=this._parse(Ae);return Promise.resolve(xe)}parse(Ae,xe){const Ee=this.safeParse(Ae,xe);if(Ee.success)return Ee.data;throw Ee.error}safeParse(Ae,xe){var Ee;const Se={common:{issues:[],async:(Ee=xe==null?void 0:xe.async)!==null&&Ee!==void 0?Ee:!1,contextualErrorMap:xe==null?void 0:xe.errorMap},path:(xe==null?void 0:xe.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:Ae,parsedType:getParsedType(Ae)},Ce=this._parseSync({data:Ae,path:Se.path,parent:Se});return handleResult(Se,Ce)}"~validate"(Ae){var xe,Ee;const Se={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:Ae,parsedType:getParsedType(Ae)};if(!this["~standard"].async)try{const Ce=this._parseSync({data:Ae,path:[],parent:Se});return isValid(Ce)?{value:Ce.value}:{issues:Se.common.issues}}catch(Ce){!((Ee=(xe=Ce==null?void 0:Ce.message)===null||xe===void 0?void 0:xe.toLowerCase())===null||Ee===void 0)&&Ee.includes("encountered")&&(this["~standard"].async=!0),Se.common={issues:[],async:!0}}return this._parseAsync({data:Ae,path:[],parent:Se}).then(Ce=>isValid(Ce)?{value:Ce.value}:{issues:Se.common.issues})}async parseAsync(Ae,xe){const Ee=await this.safeParseAsync(Ae,xe);if(Ee.success)return Ee.data;throw Ee.error}async safeParseAsync(Ae,xe){const Ee={common:{issues:[],contextualErrorMap:xe==null?void 0:xe.errorMap,async:!0},path:(xe==null?void 0:xe.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:Ae,parsedType:getParsedType(Ae)},Se=this._parse({data:Ae,path:Ee.path,parent:Ee}),Ce=await(isAsync(Se)?Se:Promise.resolve(Se));return handleResult(Ee,Ce)}refine(Ae,xe){const Ee=Se=>typeof xe=="string"||typeof xe>"u"?{message:xe}:typeof xe=="function"?xe(Se):xe;return this._refinement((Se,Ce)=>{const _e=Ae(Se),Ie=()=>Ce.addIssue({code:ZodIssueCode.custom,...Ee(Se)});return typeof Promise<"u"&&_e instanceof Promise?_e.then(Be=>Be?!0:(Ie(),!1)):_e?!0:(Ie(),!1)})}refinement(Ae,xe){return this._refinement((Ee,Se)=>Ae(Ee)?!0:(Se.addIssue(typeof xe=="function"?xe(Ee,Se):xe),!1))}_refinement(Ae){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:Ae}})}superRefine(Ae){return this._refinement(Ae)}constructor(Ae){this.spa=this.safeParseAsync,this._def=Ae,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:xe=>this["~validate"](xe)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(Ae){return ZodUnion.create([this,Ae],this._def)}and(Ae){return ZodIntersection.create(this,Ae,this._def)}transform(Ae){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:Ae}})}default(Ae){const xe=typeof Ae=="function"?Ae:()=>Ae;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:xe,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(Ae){const xe=typeof Ae=="function"?Ae:()=>Ae;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:xe,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(Ae){const xe=this.constructor;return new xe({...this._def,description:Ae})}pipe(Ae){return ZodPipeline.create(this,Ae)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(t){let Ae="[0-5]\\d";t.precision?Ae=`${Ae}\\.\\d{${t.precision}}`:t.precision==null&&(Ae=`${Ae}(\\.\\d+)?`);const xe=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Ae})${xe}`}function timeRegex(t){return new RegExp(`^${timeRegexSource(t)}$`)}function datetimeRegex(t){let Ae=`${dateRegexSource}T${timeRegexSource(t)}`;const xe=[];return xe.push(t.local?"Z?":"Z"),t.offset&&xe.push("([+-]\\d{2}:?\\d{2})"),Ae=`${Ae}(${xe.join("|")})`,new RegExp(`^${Ae}$`)}function isValidIP(t,Ae){return!!((Ae==="v4"||!Ae)&&ipv4Regex.test(t)||(Ae==="v6"||!Ae)&&ipv6Regex.test(t))}function isValidJWT(t,Ae){if(!jwtRegex.test(t))return!1;try{const[xe]=t.split("."),Ee=xe.replace(/-/g,"+").replace(/_/g,"/").padEnd(xe.length+(4-xe.length%4)%4,"="),Se=JSON.parse(atob(Ee));return!(typeof Se!="object"||Se===null||!Se.typ||!Se.alg||Ae&&Se.alg!==Ae)}catch{return!1}}function isValidCidr(t,Ae){return!!((Ae==="v4"||!Ae)&&ipv4CidrRegex.test(t)||(Ae==="v6"||!Ae)&&ipv6CidrRegex.test(t))}class ZodString extends ZodType{_parse(Ae){if(this._def.coerce&&(Ae.data=String(Ae.data)),this._getType(Ae)!==ZodParsedType.string){const Ce=this._getOrReturnCtx(Ae);return addIssueToContext(Ce,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:Ce.parsedType}),INVALID}const Ee=new ParseStatus;let Se;for(const Ce of this._def.checks)if(Ce.kind==="min")Ae.data.length<Ce.value&&(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.too_small,minimum:Ce.value,type:"string",inclusive:!0,exact:!1,message:Ce.message}),Ee.dirty());else if(Ce.kind==="max")Ae.data.length>Ce.value&&(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.too_big,maximum:Ce.value,type:"string",inclusive:!0,exact:!1,message:Ce.message}),Ee.dirty());else if(Ce.kind==="length"){const _e=Ae.data.length>Ce.value,Ie=Ae.data.length<Ce.value;(_e||Ie)&&(Se=this._getOrReturnCtx(Ae,Se),_e?addIssueToContext(Se,{code:ZodIssueCode.too_big,maximum:Ce.value,type:"string",inclusive:!0,exact:!0,message:Ce.message}):Ie&&addIssueToContext(Se,{code:ZodIssueCode.too_small,minimum:Ce.value,type:"string",inclusive:!0,exact:!0,message:Ce.message}),Ee.dirty())}else if(Ce.kind==="email")emailRegex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"email",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty());else if(Ce.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"emoji",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty());else if(Ce.kind==="uuid")uuidRegex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"uuid",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty());else if(Ce.kind==="nanoid")nanoidRegex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty());else if(Ce.kind==="cuid")cuidRegex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"cuid",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty());else if(Ce.kind==="cuid2")cuid2Regex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty());else if(Ce.kind==="ulid")ulidRegex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"ulid",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty());else if(Ce.kind==="url")try{new URL(Ae.data)}catch{Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"url",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty()}else Ce.kind==="regex"?(Ce.regex.lastIndex=0,Ce.regex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"regex",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty())):Ce.kind==="trim"?Ae.data=Ae.data.trim():Ce.kind==="includes"?Ae.data.includes(Ce.value,Ce.position)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.invalid_string,validation:{includes:Ce.value,position:Ce.position},message:Ce.message}),Ee.dirty()):Ce.kind==="toLowerCase"?Ae.data=Ae.data.toLowerCase():Ce.kind==="toUpperCase"?Ae.data=Ae.data.toUpperCase():Ce.kind==="startsWith"?Ae.data.startsWith(Ce.value)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.invalid_string,validation:{startsWith:Ce.value},message:Ce.message}),Ee.dirty()):Ce.kind==="endsWith"?Ae.data.endsWith(Ce.value)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.invalid_string,validation:{endsWith:Ce.value},message:Ce.message}),Ee.dirty()):Ce.kind==="datetime"?datetimeRegex(Ce).test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.invalid_string,validation:"datetime",message:Ce.message}),Ee.dirty()):Ce.kind==="date"?dateRegex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.invalid_string,validation:"date",message:Ce.message}),Ee.dirty()):Ce.kind==="time"?timeRegex(Ce).test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.invalid_string,validation:"time",message:Ce.message}),Ee.dirty()):Ce.kind==="duration"?durationRegex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"duration",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty()):Ce.kind==="ip"?isValidIP(Ae.data,Ce.version)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"ip",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty()):Ce.kind==="jwt"?isValidJWT(Ae.data,Ce.alg)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"jwt",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty()):Ce.kind==="cidr"?isValidCidr(Ae.data,Ce.version)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"cidr",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty()):Ce.kind==="base64"?base64Regex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"base64",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty()):Ce.kind==="base64url"?base64urlRegex.test(Ae.data)||(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{validation:"base64url",code:ZodIssueCode.invalid_string,message:Ce.message}),Ee.dirty()):util.assertNever(Ce);return{status:Ee.value,value:Ae.data}}_regex(Ae,xe,Ee){return this.refinement(Se=>Ae.test(Se),{validation:xe,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(Ee)})}_addCheck(Ae){return new ZodString({...this._def,checks:[...this._def.checks,Ae]})}email(Ae){return this._addCheck({kind:"email",...errorUtil.errToObj(Ae)})}url(Ae){return this._addCheck({kind:"url",...errorUtil.errToObj(Ae)})}emoji(Ae){return this._addCheck({kind:"emoji",...errorUtil.errToObj(Ae)})}uuid(Ae){return this._addCheck({kind:"uuid",...errorUtil.errToObj(Ae)})}nanoid(Ae){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(Ae)})}cuid(Ae){return this._addCheck({kind:"cuid",...errorUtil.errToObj(Ae)})}cuid2(Ae){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(Ae)})}ulid(Ae){return this._addCheck({kind:"ulid",...errorUtil.errToObj(Ae)})}base64(Ae){return this._addCheck({kind:"base64",...errorUtil.errToObj(Ae)})}base64url(Ae){return this._addCheck({kind:"base64url",...errorUtil.errToObj(Ae)})}jwt(Ae){return this._addCheck({kind:"jwt",...errorUtil.errToObj(Ae)})}ip(Ae){return this._addCheck({kind:"ip",...errorUtil.errToObj(Ae)})}cidr(Ae){return this._addCheck({kind:"cidr",...errorUtil.errToObj(Ae)})}datetime(Ae){var xe,Ee;return typeof Ae=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:Ae}):this._addCheck({kind:"datetime",precision:typeof(Ae==null?void 0:Ae.precision)>"u"?null:Ae==null?void 0:Ae.precision,offset:(xe=Ae==null?void 0:Ae.offset)!==null&&xe!==void 0?xe:!1,local:(Ee=Ae==null?void 0:Ae.local)!==null&&Ee!==void 0?Ee:!1,...errorUtil.errToObj(Ae==null?void 0:Ae.message)})}date(Ae){return this._addCheck({kind:"date",message:Ae})}time(Ae){return typeof Ae=="string"?this._addCheck({kind:"time",precision:null,message:Ae}):this._addCheck({kind:"time",precision:typeof(Ae==null?void 0:Ae.precision)>"u"?null:Ae==null?void 0:Ae.precision,...errorUtil.errToObj(Ae==null?void 0:Ae.message)})}duration(Ae){return this._addCheck({kind:"duration",...errorUtil.errToObj(Ae)})}regex(Ae,xe){return this._addCheck({kind:"regex",regex:Ae,...errorUtil.errToObj(xe)})}includes(Ae,xe){return this._addCheck({kind:"includes",value:Ae,position:xe==null?void 0:xe.position,...errorUtil.errToObj(xe==null?void 0:xe.message)})}startsWith(Ae,xe){return this._addCheck({kind:"startsWith",value:Ae,...errorUtil.errToObj(xe)})}endsWith(Ae,xe){return this._addCheck({kind:"endsWith",value:Ae,...errorUtil.errToObj(xe)})}min(Ae,xe){return this._addCheck({kind:"min",value:Ae,...errorUtil.errToObj(xe)})}max(Ae,xe){return this._addCheck({kind:"max",value:Ae,...errorUtil.errToObj(xe)})}length(Ae,xe){return this._addCheck({kind:"length",value:Ae,...errorUtil.errToObj(xe)})}nonempty(Ae){return this.min(1,errorUtil.errToObj(Ae))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(Ae=>Ae.kind==="datetime")}get isDate(){return!!this._def.checks.find(Ae=>Ae.kind==="date")}get isTime(){return!!this._def.checks.find(Ae=>Ae.kind==="time")}get isDuration(){return!!this._def.checks.find(Ae=>Ae.kind==="duration")}get isEmail(){return!!this._def.checks.find(Ae=>Ae.kind==="email")}get isURL(){return!!this._def.checks.find(Ae=>Ae.kind==="url")}get isEmoji(){return!!this._def.checks.find(Ae=>Ae.kind==="emoji")}get isUUID(){return!!this._def.checks.find(Ae=>Ae.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(Ae=>Ae.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(Ae=>Ae.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(Ae=>Ae.kind==="cuid2")}get isULID(){return!!this._def.checks.find(Ae=>Ae.kind==="ulid")}get isIP(){return!!this._def.checks.find(Ae=>Ae.kind==="ip")}get isCIDR(){return!!this._def.checks.find(Ae=>Ae.kind==="cidr")}get isBase64(){return!!this._def.checks.find(Ae=>Ae.kind==="base64")}get isBase64url(){return!!this._def.checks.find(Ae=>Ae.kind==="base64url")}get minLength(){let Ae=null;for(const xe of this._def.checks)xe.kind==="min"&&(Ae===null||xe.value>Ae)&&(Ae=xe.value);return Ae}get maxLength(){let Ae=null;for(const xe of this._def.checks)xe.kind==="max"&&(Ae===null||xe.value<Ae)&&(Ae=xe.value);return Ae}}ZodString.create=t=>{var Ae;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(Ae=t==null?void 0:t.coerce)!==null&&Ae!==void 0?Ae:!1,...processCreateParams(t)})};function floatSafeRemainder(t,Ae){const xe=(t.toString().split(".")[1]||"").length,Ee=(Ae.toString().split(".")[1]||"").length,Se=xe>Ee?xe:Ee,Ce=parseInt(t.toFixed(Se).replace(".","")),_e=parseInt(Ae.toFixed(Se).replace(".",""));return Ce%_e/Math.pow(10,Se)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(Ae){if(this._def.coerce&&(Ae.data=Number(Ae.data)),this._getType(Ae)!==ZodParsedType.number){const Ce=this._getOrReturnCtx(Ae);return addIssueToContext(Ce,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:Ce.parsedType}),INVALID}let Ee;const Se=new ParseStatus;for(const Ce of this._def.checks)Ce.kind==="int"?util.isInteger(Ae.data)||(Ee=this._getOrReturnCtx(Ae,Ee),addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:Ce.message}),Se.dirty()):Ce.kind==="min"?(Ce.inclusive?Ae.data<Ce.value:Ae.data<=Ce.value)&&(Ee=this._getOrReturnCtx(Ae,Ee),addIssueToContext(Ee,{code:ZodIssueCode.too_small,minimum:Ce.value,type:"number",inclusive:Ce.inclusive,exact:!1,message:Ce.message}),Se.dirty()):Ce.kind==="max"?(Ce.inclusive?Ae.data>Ce.value:Ae.data>=Ce.value)&&(Ee=this._getOrReturnCtx(Ae,Ee),addIssueToContext(Ee,{code:ZodIssueCode.too_big,maximum:Ce.value,type:"number",inclusive:Ce.inclusive,exact:!1,message:Ce.message}),Se.dirty()):Ce.kind==="multipleOf"?floatSafeRemainder(Ae.data,Ce.value)!==0&&(Ee=this._getOrReturnCtx(Ae,Ee),addIssueToContext(Ee,{code:ZodIssueCode.not_multiple_of,multipleOf:Ce.value,message:Ce.message}),Se.dirty()):Ce.kind==="finite"?Number.isFinite(Ae.data)||(Ee=this._getOrReturnCtx(Ae,Ee),addIssueToContext(Ee,{code:ZodIssueCode.not_finite,message:Ce.message}),Se.dirty()):util.assertNever(Ce);return{status:Se.value,value:Ae.data}}gte(Ae,xe){return this.setLimit("min",Ae,!0,errorUtil.toString(xe))}gt(Ae,xe){return this.setLimit("min",Ae,!1,errorUtil.toString(xe))}lte(Ae,xe){return this.setLimit("max",Ae,!0,errorUtil.toString(xe))}lt(Ae,xe){return this.setLimit("max",Ae,!1,errorUtil.toString(xe))}setLimit(Ae,xe,Ee,Se){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:Ae,value:xe,inclusive:Ee,message:errorUtil.toString(Se)}]})}_addCheck(Ae){return new ZodNumber({...this._def,checks:[...this._def.checks,Ae]})}int(Ae){return this._addCheck({kind:"int",message:errorUtil.toString(Ae)})}positive(Ae){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(Ae)})}negative(Ae){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(Ae)})}nonpositive(Ae){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(Ae)})}nonnegative(Ae){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(Ae)})}multipleOf(Ae,xe){return this._addCheck({kind:"multipleOf",value:Ae,message:errorUtil.toString(xe)})}finite(Ae){return this._addCheck({kind:"finite",message:errorUtil.toString(Ae)})}safe(Ae){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(Ae)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(Ae)})}get minValue(){let Ae=null;for(const xe of this._def.checks)xe.kind==="min"&&(Ae===null||xe.value>Ae)&&(Ae=xe.value);return Ae}get maxValue(){let Ae=null;for(const xe of this._def.checks)xe.kind==="max"&&(Ae===null||xe.value<Ae)&&(Ae=xe.value);return Ae}get isInt(){return!!this._def.checks.find(Ae=>Ae.kind==="int"||Ae.kind==="multipleOf"&&util.isInteger(Ae.value))}get isFinite(){let Ae=null,xe=null;for(const Ee of this._def.checks){if(Ee.kind==="finite"||Ee.kind==="int"||Ee.kind==="multipleOf")return!0;Ee.kind==="min"?(xe===null||Ee.value>xe)&&(xe=Ee.value):Ee.kind==="max"&&(Ae===null||Ee.value<Ae)&&(Ae=Ee.value)}return Number.isFinite(xe)&&Number.isFinite(Ae)}}ZodNumber.create=t=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...processCreateParams(t)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(Ae){if(this._def.coerce)try{Ae.data=BigInt(Ae.data)}catch{return this._getInvalidInput(Ae)}if(this._getType(Ae)!==ZodParsedType.bigint)return this._getInvalidInput(Ae);let Ee;const Se=new ParseStatus;for(const Ce of this._def.checks)Ce.kind==="min"?(Ce.inclusive?Ae.data<Ce.value:Ae.data<=Ce.value)&&(Ee=this._getOrReturnCtx(Ae,Ee),addIssueToContext(Ee,{code:ZodIssueCode.too_small,type:"bigint",minimum:Ce.value,inclusive:Ce.inclusive,message:Ce.message}),Se.dirty()):Ce.kind==="max"?(Ce.inclusive?Ae.data>Ce.value:Ae.data>=Ce.value)&&(Ee=this._getOrReturnCtx(Ae,Ee),addIssueToContext(Ee,{code:ZodIssueCode.too_big,type:"bigint",maximum:Ce.value,inclusive:Ce.inclusive,message:Ce.message}),Se.dirty()):Ce.kind==="multipleOf"?Ae.data%Ce.value!==BigInt(0)&&(Ee=this._getOrReturnCtx(Ae,Ee),addIssueToContext(Ee,{code:ZodIssueCode.not_multiple_of,multipleOf:Ce.value,message:Ce.message}),Se.dirty()):util.assertNever(Ce);return{status:Se.value,value:Ae.data}}_getInvalidInput(Ae){const xe=this._getOrReturnCtx(Ae);return addIssueToContext(xe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:xe.parsedType}),INVALID}gte(Ae,xe){return this.setLimit("min",Ae,!0,errorUtil.toString(xe))}gt(Ae,xe){return this.setLimit("min",Ae,!1,errorUtil.toString(xe))}lte(Ae,xe){return this.setLimit("max",Ae,!0,errorUtil.toString(xe))}lt(Ae,xe){return this.setLimit("max",Ae,!1,errorUtil.toString(xe))}setLimit(Ae,xe,Ee,Se){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:Ae,value:xe,inclusive:Ee,message:errorUtil.toString(Se)}]})}_addCheck(Ae){return new ZodBigInt({...this._def,checks:[...this._def.checks,Ae]})}positive(Ae){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Ae)})}negative(Ae){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Ae)})}nonpositive(Ae){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Ae)})}nonnegative(Ae){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Ae)})}multipleOf(Ae,xe){return this._addCheck({kind:"multipleOf",value:Ae,message:errorUtil.toString(xe)})}get minValue(){let Ae=null;for(const xe of this._def.checks)xe.kind==="min"&&(Ae===null||xe.value>Ae)&&(Ae=xe.value);return Ae}get maxValue(){let Ae=null;for(const xe of this._def.checks)xe.kind==="max"&&(Ae===null||xe.value<Ae)&&(Ae=xe.value);return Ae}}ZodBigInt.create=t=>{var Ae;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(Ae=t==null?void 0:t.coerce)!==null&&Ae!==void 0?Ae:!1,...processCreateParams(t)})};class ZodBoolean extends ZodType{_parse(Ae){if(this._def.coerce&&(Ae.data=!!Ae.data),this._getType(Ae)!==ZodParsedType.boolean){const Ee=this._getOrReturnCtx(Ae);return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:Ee.parsedType}),INVALID}return OK(Ae.data)}}ZodBoolean.create=t=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...processCreateParams(t)});class ZodDate extends ZodType{_parse(Ae){if(this._def.coerce&&(Ae.data=new Date(Ae.data)),this._getType(Ae)!==ZodParsedType.date){const Ce=this._getOrReturnCtx(Ae);return addIssueToContext(Ce,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:Ce.parsedType}),INVALID}if(isNaN(Ae.data.getTime())){const Ce=this._getOrReturnCtx(Ae);return addIssueToContext(Ce,{code:ZodIssueCode.invalid_date}),INVALID}const Ee=new ParseStatus;let Se;for(const Ce of this._def.checks)Ce.kind==="min"?Ae.data.getTime()<Ce.value&&(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.too_small,message:Ce.message,inclusive:!0,exact:!1,minimum:Ce.value,type:"date"}),Ee.dirty()):Ce.kind==="max"?Ae.data.getTime()>Ce.value&&(Se=this._getOrReturnCtx(Ae,Se),addIssueToContext(Se,{code:ZodIssueCode.too_big,message:Ce.message,inclusive:!0,exact:!1,maximum:Ce.value,type:"date"}),Ee.dirty()):util.assertNever(Ce);return{status:Ee.value,value:new Date(Ae.data.getTime())}}_addCheck(Ae){return new ZodDate({...this._def,checks:[...this._def.checks,Ae]})}min(Ae,xe){return this._addCheck({kind:"min",value:Ae.getTime(),message:errorUtil.toString(xe)})}max(Ae,xe){return this._addCheck({kind:"max",value:Ae.getTime(),message:errorUtil.toString(xe)})}get minDate(){let Ae=null;for(const xe of this._def.checks)xe.kind==="min"&&(Ae===null||xe.value>Ae)&&(Ae=xe.value);return Ae!=null?new Date(Ae):null}get maxDate(){let Ae=null;for(const xe of this._def.checks)xe.kind==="max"&&(Ae===null||xe.value<Ae)&&(Ae=xe.value);return Ae!=null?new Date(Ae):null}}ZodDate.create=t=>new ZodDate({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(t)});class ZodSymbol extends ZodType{_parse(Ae){if(this._getType(Ae)!==ZodParsedType.symbol){const Ee=this._getOrReturnCtx(Ae);return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:Ee.parsedType}),INVALID}return OK(Ae.data)}}ZodSymbol.create=t=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(t)});class ZodUndefined extends ZodType{_parse(Ae){if(this._getType(Ae)!==ZodParsedType.undefined){const Ee=this._getOrReturnCtx(Ae);return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:Ee.parsedType}),INVALID}return OK(Ae.data)}}ZodUndefined.create=t=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(t)});class ZodNull extends ZodType{_parse(Ae){if(this._getType(Ae)!==ZodParsedType.null){const Ee=this._getOrReturnCtx(Ae);return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:Ee.parsedType}),INVALID}return OK(Ae.data)}}ZodNull.create=t=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(t)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(Ae){return OK(Ae.data)}}ZodAny.create=t=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(t)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(Ae){return OK(Ae.data)}}ZodUnknown.create=t=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(t)});class ZodNever extends ZodType{_parse(Ae){const xe=this._getOrReturnCtx(Ae);return addIssueToContext(xe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:xe.parsedType}),INVALID}}ZodNever.create=t=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(t)});class ZodVoid extends ZodType{_parse(Ae){if(this._getType(Ae)!==ZodParsedType.undefined){const Ee=this._getOrReturnCtx(Ae);return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:Ee.parsedType}),INVALID}return OK(Ae.data)}}ZodVoid.create=t=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(t)});class ZodArray extends ZodType{_parse(Ae){const{ctx:xe,status:Ee}=this._processInputParams(Ae),Se=this._def;if(xe.parsedType!==ZodParsedType.array)return addIssueToContext(xe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:xe.parsedType}),INVALID;if(Se.exactLength!==null){const _e=xe.data.length>Se.exactLength.value,Ie=xe.data.length<Se.exactLength.value;(_e||Ie)&&(addIssueToContext(xe,{code:_e?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:Ie?Se.exactLength.value:void 0,maximum:_e?Se.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Se.exactLength.message}),Ee.dirty())}if(Se.minLength!==null&&xe.data.length<Se.minLength.value&&(addIssueToContext(xe,{code:ZodIssueCode.too_small,minimum:Se.minLength.value,type:"array",inclusive:!0,exact:!1,message:Se.minLength.message}),Ee.dirty()),Se.maxLength!==null&&xe.data.length>Se.maxLength.value&&(addIssueToContext(xe,{code:ZodIssueCode.too_big,maximum:Se.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Se.maxLength.message}),Ee.dirty()),xe.common.async)return Promise.all([...xe.data].map((_e,Ie)=>Se.type._parseAsync(new ParseInputLazyPath(xe,_e,xe.path,Ie)))).then(_e=>ParseStatus.mergeArray(Ee,_e));const Ce=[...xe.data].map((_e,Ie)=>Se.type._parseSync(new ParseInputLazyPath(xe,_e,xe.path,Ie)));return ParseStatus.mergeArray(Ee,Ce)}get element(){return this._def.type}min(Ae,xe){return new ZodArray({...this._def,minLength:{value:Ae,message:errorUtil.toString(xe)}})}max(Ae,xe){return new ZodArray({...this._def,maxLength:{value:Ae,message:errorUtil.toString(xe)}})}length(Ae,xe){return new ZodArray({...this._def,exactLength:{value:Ae,message:errorUtil.toString(xe)}})}nonempty(Ae){return this.min(1,Ae)}}ZodArray.create=(t,Ae)=>new ZodArray({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(Ae)});function deepPartialify(t){if(t instanceof ZodObject){const Ae={};for(const xe in t.shape){const Ee=t.shape[xe];Ae[xe]=ZodOptional.create(deepPartialify(Ee))}return new ZodObject({...t._def,shape:()=>Ae})}else return t instanceof ZodArray?new ZodArray({...t._def,type:deepPartialify(t.element)}):t instanceof ZodOptional?ZodOptional.create(deepPartialify(t.unwrap())):t instanceof ZodNullable?ZodNullable.create(deepPartialify(t.unwrap())):t instanceof ZodTuple?ZodTuple.create(t.items.map(Ae=>deepPartialify(Ae))):t}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const Ae=this._def.shape(),xe=util.objectKeys(Ae);return this._cached={shape:Ae,keys:xe}}_parse(Ae){if(this._getType(Ae)!==ZodParsedType.object){const Te=this._getOrReturnCtx(Ae);return addIssueToContext(Te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:Te.parsedType}),INVALID}const{status:Ee,ctx:Se}=this._processInputParams(Ae),{shape:Ce,keys:_e}=this._getCached(),Ie=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const Te in Se.data)_e.includes(Te)||Ie.push(Te);const Be=[];for(const Te of _e){const Pe=Ce[Te],ke=Se.data[Te];Be.push({key:{status:"valid",value:Te},value:Pe._parse(new ParseInputLazyPath(Se,ke,Se.path,Te)),alwaysSet:Te in Se.data})}if(this._def.catchall instanceof ZodNever){const Te=this._def.unknownKeys;if(Te==="passthrough")for(const Pe of Ie)Be.push({key:{status:"valid",value:Pe},value:{status:"valid",value:Se.data[Pe]}});else if(Te==="strict")Ie.length>0&&(addIssueToContext(Se,{code:ZodIssueCode.unrecognized_keys,keys:Ie}),Ee.dirty());else if(Te!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Te=this._def.catchall;for(const Pe of Ie){const ke=Se.data[Pe];Be.push({key:{status:"valid",value:Pe},value:Te._parse(new ParseInputLazyPath(Se,ke,Se.path,Pe)),alwaysSet:Pe in Se.data})}}return Se.common.async?Promise.resolve().then(async()=>{const Te=[];for(const Pe of Be){const ke=await Pe.key,$e=await Pe.value;Te.push({key:ke,value:$e,alwaysSet:Pe.alwaysSet})}return Te}).then(Te=>ParseStatus.mergeObjectSync(Ee,Te)):ParseStatus.mergeObjectSync(Ee,Be)}get shape(){return this._def.shape()}strict(Ae){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...Ae!==void 0?{errorMap:(xe,Ee)=>{var Se,Ce,_e,Ie;const Be=(_e=(Ce=(Se=this._def).errorMap)===null||Ce===void 0?void 0:Ce.call(Se,xe,Ee).message)!==null&&_e!==void 0?_e:Ee.defaultError;return xe.code==="unrecognized_keys"?{message:(Ie=errorUtil.errToObj(Ae).message)!==null&&Ie!==void 0?Ie:Be}:{message:Be}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(Ae){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...Ae})})}merge(Ae){return new ZodObject({unknownKeys:Ae._def.unknownKeys,catchall:Ae._def.catchall,shape:()=>({...this._def.shape(),...Ae._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(Ae,xe){return this.augment({[Ae]:xe})}catchall(Ae){return new ZodObject({...this._def,catchall:Ae})}pick(Ae){const xe={};return util.objectKeys(Ae).forEach(Ee=>{Ae[Ee]&&this.shape[Ee]&&(xe[Ee]=this.shape[Ee])}),new ZodObject({...this._def,shape:()=>xe})}omit(Ae){const xe={};return util.objectKeys(this.shape).forEach(Ee=>{Ae[Ee]||(xe[Ee]=this.shape[Ee])}),new ZodObject({...this._def,shape:()=>xe})}deepPartial(){return deepPartialify(this)}partial(Ae){const xe={};return util.objectKeys(this.shape).forEach(Ee=>{const Se=this.shape[Ee];Ae&&!Ae[Ee]?xe[Ee]=Se:xe[Ee]=Se.optional()}),new ZodObject({...this._def,shape:()=>xe})}required(Ae){const xe={};return util.objectKeys(this.shape).forEach(Ee=>{if(Ae&&!Ae[Ee])xe[Ee]=this.shape[Ee];else{let Ce=this.shape[Ee];for(;Ce instanceof ZodOptional;)Ce=Ce._def.innerType;xe[Ee]=Ce}}),new ZodObject({...this._def,shape:()=>xe})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(t,Ae)=>new ZodObject({shape:()=>t,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Ae)});ZodObject.strictCreate=(t,Ae)=>new ZodObject({shape:()=>t,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Ae)});ZodObject.lazycreate=(t,Ae)=>new ZodObject({shape:t,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Ae)});class ZodUnion extends ZodType{_parse(Ae){const{ctx:xe}=this._processInputParams(Ae),Ee=this._def.options;function Se(Ce){for(const Ie of Ce)if(Ie.result.status==="valid")return Ie.result;for(const Ie of Ce)if(Ie.result.status==="dirty")return xe.common.issues.push(...Ie.ctx.common.issues),Ie.result;const _e=Ce.map(Ie=>new ZodError(Ie.ctx.common.issues));return addIssueToContext(xe,{code:ZodIssueCode.invalid_union,unionErrors:_e}),INVALID}if(xe.common.async)return Promise.all(Ee.map(async Ce=>{const _e={...xe,common:{...xe.common,issues:[]},parent:null};return{result:await Ce._parseAsync({data:xe.data,path:xe.path,parent:_e}),ctx:_e}})).then(Se);{let Ce;const _e=[];for(const Be of Ee){const Te={...xe,common:{...xe.common,issues:[]},parent:null},Pe=Be._parseSync({data:xe.data,path:xe.path,parent:Te});if(Pe.status==="valid")return Pe;Pe.status==="dirty"&&!Ce&&(Ce={result:Pe,ctx:Te}),Te.common.issues.length&&_e.push(Te.common.issues)}if(Ce)return xe.common.issues.push(...Ce.ctx.common.issues),Ce.result;const Ie=_e.map(Be=>new ZodError(Be));return addIssueToContext(xe,{code:ZodIssueCode.invalid_union,unionErrors:Ie}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(t,Ae)=>new ZodUnion({options:t,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(Ae)});const getDiscriminator=t=>t instanceof ZodLazy?getDiscriminator(t.schema):t instanceof ZodEffects?getDiscriminator(t.innerType()):t instanceof ZodLiteral?[t.value]:t instanceof ZodEnum?t.options:t instanceof ZodNativeEnum?util.objectValues(t.enum):t instanceof ZodDefault?getDiscriminator(t._def.innerType):t instanceof ZodUndefined?[void 0]:t instanceof ZodNull?[null]:t instanceof ZodOptional?[void 0,...getDiscriminator(t.unwrap())]:t instanceof ZodNullable?[null,...getDiscriminator(t.unwrap())]:t instanceof ZodBranded||t instanceof ZodReadonly?getDiscriminator(t.unwrap()):t instanceof ZodCatch?getDiscriminator(t._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(Ae){const{ctx:xe}=this._processInputParams(Ae);if(xe.parsedType!==ZodParsedType.object)return addIssueToContext(xe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:xe.parsedType}),INVALID;const Ee=this.discriminator,Se=xe.data[Ee],Ce=this.optionsMap.get(Se);return Ce?xe.common.async?Ce._parseAsync({data:xe.data,path:xe.path,parent:xe}):Ce._parseSync({data:xe.data,path:xe.path,parent:xe}):(addIssueToContext(xe,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Ee]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(Ae,xe,Ee){const Se=new Map;for(const Ce of xe){const _e=getDiscriminator(Ce.shape[Ae]);if(!_e.length)throw new Error(`A discriminator value for key \`${Ae}\` could not be extracted from all schema options`);for(const Ie of _e){if(Se.has(Ie))throw new Error(`Discriminator property ${String(Ae)} has duplicate value ${String(Ie)}`);Se.set(Ie,Ce)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:Ae,options:xe,optionsMap:Se,...processCreateParams(Ee)})}}function mergeValues(t,Ae){const xe=getParsedType(t),Ee=getParsedType(Ae);if(t===Ae)return{valid:!0,data:t};if(xe===ZodParsedType.object&&Ee===ZodParsedType.object){const Se=util.objectKeys(Ae),Ce=util.objectKeys(t).filter(Ie=>Se.indexOf(Ie)!==-1),_e={...t,...Ae};for(const Ie of Ce){const Be=mergeValues(t[Ie],Ae[Ie]);if(!Be.valid)return{valid:!1};_e[Ie]=Be.data}return{valid:!0,data:_e}}else if(xe===ZodParsedType.array&&Ee===ZodParsedType.array){if(t.length!==Ae.length)return{valid:!1};const Se=[];for(let Ce=0;Ce<t.length;Ce++){const _e=t[Ce],Ie=Ae[Ce],Be=mergeValues(_e,Ie);if(!Be.valid)return{valid:!1};Se.push(Be.data)}return{valid:!0,data:Se}}else return xe===ZodParsedType.date&&Ee===ZodParsedType.date&&+t==+Ae?{valid:!0,data:t}:{valid:!1}}class ZodIntersection extends ZodType{_parse(Ae){const{status:xe,ctx:Ee}=this._processInputParams(Ae),Se=(Ce,_e)=>{if(isAborted(Ce)||isAborted(_e))return INVALID;const Ie=mergeValues(Ce.value,_e.value);return Ie.valid?((isDirty(Ce)||isDirty(_e))&&xe.dirty(),{status:xe.value,value:Ie.data}):(addIssueToContext(Ee,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return Ee.common.async?Promise.all([this._def.left._parseAsync({data:Ee.data,path:Ee.path,parent:Ee}),this._def.right._parseAsync({data:Ee.data,path:Ee.path,parent:Ee})]).then(([Ce,_e])=>Se(Ce,_e)):Se(this._def.left._parseSync({data:Ee.data,path:Ee.path,parent:Ee}),this._def.right._parseSync({data:Ee.data,path:Ee.path,parent:Ee}))}}ZodIntersection.create=(t,Ae,xe)=>new ZodIntersection({left:t,right:Ae,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(xe)});class ZodTuple extends ZodType{_parse(Ae){const{status:xe,ctx:Ee}=this._processInputParams(Ae);if(Ee.parsedType!==ZodParsedType.array)return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:Ee.parsedType}),INVALID;if(Ee.data.length<this._def.items.length)return addIssueToContext(Ee,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&Ee.data.length>this._def.items.length&&(addIssueToContext(Ee,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe.dirty());const Ce=[...Ee.data].map((_e,Ie)=>{const Be=this._def.items[Ie]||this._def.rest;return Be?Be._parse(new ParseInputLazyPath(Ee,_e,Ee.path,Ie)):null}).filter(_e=>!!_e);return Ee.common.async?Promise.all(Ce).then(_e=>ParseStatus.mergeArray(xe,_e)):ParseStatus.mergeArray(xe,Ce)}get items(){return this._def.items}rest(Ae){return new ZodTuple({...this._def,rest:Ae})}}ZodTuple.create=(t,Ae)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:t,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(Ae)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Ae){const{status:xe,ctx:Ee}=this._processInputParams(Ae);if(Ee.parsedType!==ZodParsedType.object)return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:Ee.parsedType}),INVALID;const Se=[],Ce=this._def.keyType,_e=this._def.valueType;for(const Ie in Ee.data)Se.push({key:Ce._parse(new ParseInputLazyPath(Ee,Ie,Ee.path,Ie)),value:_e._parse(new ParseInputLazyPath(Ee,Ee.data[Ie],Ee.path,Ie)),alwaysSet:Ie in Ee.data});return Ee.common.async?ParseStatus.mergeObjectAsync(xe,Se):ParseStatus.mergeObjectSync(xe,Se)}get element(){return this._def.valueType}static create(Ae,xe,Ee){return xe instanceof ZodType?new ZodRecord({keyType:Ae,valueType:xe,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(Ee)}):new ZodRecord({keyType:ZodString.create(),valueType:Ae,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(xe)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Ae){const{status:xe,ctx:Ee}=this._processInputParams(Ae);if(Ee.parsedType!==ZodParsedType.map)return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:Ee.parsedType}),INVALID;const Se=this._def.keyType,Ce=this._def.valueType,_e=[...Ee.data.entries()].map(([Ie,Be],Te)=>({key:Se._parse(new ParseInputLazyPath(Ee,Ie,Ee.path,[Te,"key"])),value:Ce._parse(new ParseInputLazyPath(Ee,Be,Ee.path,[Te,"value"]))}));if(Ee.common.async){const Ie=new Map;return Promise.resolve().then(async()=>{for(const Be of _e){const Te=await Be.key,Pe=await Be.value;if(Te.status==="aborted"||Pe.status==="aborted")return INVALID;(Te.status==="dirty"||Pe.status==="dirty")&&xe.dirty(),Ie.set(Te.value,Pe.value)}return{status:xe.value,value:Ie}})}else{const Ie=new Map;for(const Be of _e){const Te=Be.key,Pe=Be.value;if(Te.status==="aborted"||Pe.status==="aborted")return INVALID;(Te.status==="dirty"||Pe.status==="dirty")&&xe.dirty(),Ie.set(Te.value,Pe.value)}return{status:xe.value,value:Ie}}}}ZodMap.create=(t,Ae,xe)=>new ZodMap({valueType:Ae,keyType:t,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(xe)});class ZodSet extends ZodType{_parse(Ae){const{status:xe,ctx:Ee}=this._processInputParams(Ae);if(Ee.parsedType!==ZodParsedType.set)return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:Ee.parsedType}),INVALID;const Se=this._def;Se.minSize!==null&&Ee.data.size<Se.minSize.value&&(addIssueToContext(Ee,{code:ZodIssueCode.too_small,minimum:Se.minSize.value,type:"set",inclusive:!0,exact:!1,message:Se.minSize.message}),xe.dirty()),Se.maxSize!==null&&Ee.data.size>Se.maxSize.value&&(addIssueToContext(Ee,{code:ZodIssueCode.too_big,maximum:Se.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Se.maxSize.message}),xe.dirty());const Ce=this._def.valueType;function _e(Be){const Te=new Set;for(const Pe of Be){if(Pe.status==="aborted")return INVALID;Pe.status==="dirty"&&xe.dirty(),Te.add(Pe.value)}return{status:xe.value,value:Te}}const Ie=[...Ee.data.values()].map((Be,Te)=>Ce._parse(new ParseInputLazyPath(Ee,Be,Ee.path,Te)));return Ee.common.async?Promise.all(Ie).then(Be=>_e(Be)):_e(Ie)}min(Ae,xe){return new ZodSet({...this._def,minSize:{value:Ae,message:errorUtil.toString(xe)}})}max(Ae,xe){return new ZodSet({...this._def,maxSize:{value:Ae,message:errorUtil.toString(xe)}})}size(Ae,xe){return this.min(Ae,xe).max(Ae,xe)}nonempty(Ae){return this.min(1,Ae)}}ZodSet.create=(t,Ae)=>new ZodSet({valueType:t,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(Ae)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(Ae){const{ctx:xe}=this._processInputParams(Ae);if(xe.parsedType!==ZodParsedType.function)return addIssueToContext(xe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:xe.parsedType}),INVALID;function Ee(Ie,Be){return makeIssue({data:Ie,path:xe.path,errorMaps:[xe.common.contextualErrorMap,xe.schemaErrorMap,getErrorMap(),errorMap].filter(Te=>!!Te),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:Be}})}function Se(Ie,Be){return makeIssue({data:Ie,path:xe.path,errorMaps:[xe.common.contextualErrorMap,xe.schemaErrorMap,getErrorMap(),errorMap].filter(Te=>!!Te),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:Be}})}const Ce={errorMap:xe.common.contextualErrorMap},_e=xe.data;if(this._def.returns instanceof ZodPromise){const Ie=this;return OK(async function(...Be){const Te=new ZodError([]),Pe=await Ie._def.args.parseAsync(Be,Ce).catch(Oe=>{throw Te.addIssue(Ee(Be,Oe)),Te}),ke=await Reflect.apply(_e,this,Pe);return await Ie._def.returns._def.type.parseAsync(ke,Ce).catch(Oe=>{throw Te.addIssue(Se(ke,Oe)),Te})})}else{const Ie=this;return OK(function(...Be){const Te=Ie._def.args.safeParse(Be,Ce);if(!Te.success)throw new ZodError([Ee(Be,Te.error)]);const Pe=Reflect.apply(_e,this,Te.data),ke=Ie._def.returns.safeParse(Pe,Ce);if(!ke.success)throw new ZodError([Se(Pe,ke.error)]);return ke.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...Ae){return new ZodFunction({...this._def,args:ZodTuple.create(Ae).rest(ZodUnknown.create())})}returns(Ae){return new ZodFunction({...this._def,returns:Ae})}implement(Ae){return this.parse(Ae)}strictImplement(Ae){return this.parse(Ae)}static create(Ae,xe,Ee){return new ZodFunction({args:Ae||ZodTuple.create([]).rest(ZodUnknown.create()),returns:xe||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(Ee)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(Ae){const{ctx:xe}=this._processInputParams(Ae);return this._def.getter()._parse({data:xe.data,path:xe.path,parent:xe})}}ZodLazy.create=(t,Ae)=>new ZodLazy({getter:t,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(Ae)});class ZodLiteral extends ZodType{_parse(Ae){if(Ae.data!==this._def.value){const xe=this._getOrReturnCtx(Ae);return addIssueToContext(xe,{received:xe.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:Ae.data}}get value(){return this._def.value}}ZodLiteral.create=(t,Ae)=>new ZodLiteral({value:t,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(Ae)});function createZodEnum(t,Ae){return new ZodEnum({values:t,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(Ae)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(Ae){if(typeof Ae.data!="string"){const xe=this._getOrReturnCtx(Ae),Ee=this._def.values;return addIssueToContext(xe,{expected:util.joinValues(Ee),received:xe.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(Ae.data)){const xe=this._getOrReturnCtx(Ae),Ee=this._def.values;return addIssueToContext(xe,{received:xe.data,code:ZodIssueCode.invalid_enum_value,options:Ee}),INVALID}return OK(Ae.data)}get options(){return this._def.values}get enum(){const Ae={};for(const xe of this._def.values)Ae[xe]=xe;return Ae}get Values(){const Ae={};for(const xe of this._def.values)Ae[xe]=xe;return Ae}get Enum(){const Ae={};for(const xe of this._def.values)Ae[xe]=xe;return Ae}extract(Ae,xe=this._def){return ZodEnum.create(Ae,{...this._def,...xe})}exclude(Ae,xe=this._def){return ZodEnum.create(this.options.filter(Ee=>!Ae.includes(Ee)),{...this._def,...xe})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(Ae){const xe=util.getValidEnumValues(this._def.values),Ee=this._getOrReturnCtx(Ae);if(Ee.parsedType!==ZodParsedType.string&&Ee.parsedType!==ZodParsedType.number){const Se=util.objectValues(xe);return addIssueToContext(Ee,{expected:util.joinValues(Se),received:Ee.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(Ae.data)){const Se=util.objectValues(xe);return addIssueToContext(Ee,{received:Ee.data,code:ZodIssueCode.invalid_enum_value,options:Se}),INVALID}return OK(Ae.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(t,Ae)=>new ZodNativeEnum({values:t,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(Ae)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(Ae){const{ctx:xe}=this._processInputParams(Ae);if(xe.parsedType!==ZodParsedType.promise&&xe.common.async===!1)return addIssueToContext(xe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:xe.parsedType}),INVALID;const Ee=xe.parsedType===ZodParsedType.promise?xe.data:Promise.resolve(xe.data);return OK(Ee.then(Se=>this._def.type.parseAsync(Se,{path:xe.path,errorMap:xe.common.contextualErrorMap})))}}ZodPromise.create=(t,Ae)=>new ZodPromise({type:t,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(Ae)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(Ae){const{status:xe,ctx:Ee}=this._processInputParams(Ae),Se=this._def.effect||null,Ce={addIssue:_e=>{addIssueToContext(Ee,_e),_e.fatal?xe.abort():xe.dirty()},get path(){return Ee.path}};if(Ce.addIssue=Ce.addIssue.bind(Ce),Se.type==="preprocess"){const _e=Se.transform(Ee.data,Ce);if(Ee.common.async)return Promise.resolve(_e).then(async Ie=>{if(xe.value==="aborted")return INVALID;const Be=await this._def.schema._parseAsync({data:Ie,path:Ee.path,parent:Ee});return Be.status==="aborted"?INVALID:Be.status==="dirty"||xe.value==="dirty"?DIRTY(Be.value):Be});{if(xe.value==="aborted")return INVALID;const Ie=this._def.schema._parseSync({data:_e,path:Ee.path,parent:Ee});return Ie.status==="aborted"?INVALID:Ie.status==="dirty"||xe.value==="dirty"?DIRTY(Ie.value):Ie}}if(Se.type==="refinement"){const _e=Ie=>{const Be=Se.refinement(Ie,Ce);if(Ee.common.async)return Promise.resolve(Be);if(Be instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Ie};if(Ee.common.async===!1){const Ie=this._def.schema._parseSync({data:Ee.data,path:Ee.path,parent:Ee});return Ie.status==="aborted"?INVALID:(Ie.status==="dirty"&&xe.dirty(),_e(Ie.value),{status:xe.value,value:Ie.value})}else return this._def.schema._parseAsync({data:Ee.data,path:Ee.path,parent:Ee}).then(Ie=>Ie.status==="aborted"?INVALID:(Ie.status==="dirty"&&xe.dirty(),_e(Ie.value).then(()=>({status:xe.value,value:Ie.value}))))}if(Se.type==="transform")if(Ee.common.async===!1){const _e=this._def.schema._parseSync({data:Ee.data,path:Ee.path,parent:Ee});if(!isValid(_e))return _e;const Ie=Se.transform(_e.value,Ce);if(Ie instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:xe.value,value:Ie}}else return this._def.schema._parseAsync({data:Ee.data,path:Ee.path,parent:Ee}).then(_e=>isValid(_e)?Promise.resolve(Se.transform(_e.value,Ce)).then(Ie=>({status:xe.value,value:Ie})):_e);util.assertNever(Se)}}ZodEffects.create=(t,Ae,xe)=>new ZodEffects({schema:t,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:Ae,...processCreateParams(xe)});ZodEffects.createWithPreprocess=(t,Ae,xe)=>new ZodEffects({schema:Ae,effect:{type:"preprocess",transform:t},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(xe)});class ZodOptional extends ZodType{_parse(Ae){return this._getType(Ae)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(Ae)}unwrap(){return this._def.innerType}}ZodOptional.create=(t,Ae)=>new ZodOptional({innerType:t,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(Ae)});class ZodNullable extends ZodType{_parse(Ae){return this._getType(Ae)===ZodParsedType.null?OK(null):this._def.innerType._parse(Ae)}unwrap(){return this._def.innerType}}ZodNullable.create=(t,Ae)=>new ZodNullable({innerType:t,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(Ae)});class ZodDefault extends ZodType{_parse(Ae){const{ctx:xe}=this._processInputParams(Ae);let Ee=xe.data;return xe.parsedType===ZodParsedType.undefined&&(Ee=this._def.defaultValue()),this._def.innerType._parse({data:Ee,path:xe.path,parent:xe})}removeDefault(){return this._def.innerType}}ZodDefault.create=(t,Ae)=>new ZodDefault({innerType:t,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof Ae.default=="function"?Ae.default:()=>Ae.default,...processCreateParams(Ae)});class ZodCatch extends ZodType{_parse(Ae){const{ctx:xe}=this._processInputParams(Ae),Ee={...xe,common:{...xe.common,issues:[]}},Se=this._def.innerType._parse({data:Ee.data,path:Ee.path,parent:{...Ee}});return isAsync(Se)?Se.then(Ce=>({status:"valid",value:Ce.status==="valid"?Ce.value:this._def.catchValue({get error(){return new ZodError(Ee.common.issues)},input:Ee.data})})):{status:"valid",value:Se.status==="valid"?Se.value:this._def.catchValue({get error(){return new ZodError(Ee.common.issues)},input:Ee.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(t,Ae)=>new ZodCatch({innerType:t,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof Ae.catch=="function"?Ae.catch:()=>Ae.catch,...processCreateParams(Ae)});class ZodNaN extends ZodType{_parse(Ae){if(this._getType(Ae)!==ZodParsedType.nan){const Ee=this._getOrReturnCtx(Ae);return addIssueToContext(Ee,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:Ee.parsedType}),INVALID}return{status:"valid",value:Ae.data}}}ZodNaN.create=t=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(t)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(Ae){const{ctx:xe}=this._processInputParams(Ae),Ee=xe.data;return this._def.type._parse({data:Ee,path:xe.path,parent:xe})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(Ae){const{status:xe,ctx:Ee}=this._processInputParams(Ae);if(Ee.common.async)return(async()=>{const Ce=await this._def.in._parseAsync({data:Ee.data,path:Ee.path,parent:Ee});return Ce.status==="aborted"?INVALID:Ce.status==="dirty"?(xe.dirty(),DIRTY(Ce.value)):this._def.out._parseAsync({data:Ce.value,path:Ee.path,parent:Ee})})();{const Se=this._def.in._parseSync({data:Ee.data,path:Ee.path,parent:Ee});return Se.status==="aborted"?INVALID:Se.status==="dirty"?(xe.dirty(),{status:"dirty",value:Se.value}):this._def.out._parseSync({data:Se.value,path:Ee.path,parent:Ee})}}static create(Ae,xe){return new ZodPipeline({in:Ae,out:xe,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(Ae){const xe=this._def.innerType._parse(Ae),Ee=Se=>(isValid(Se)&&(Se.value=Object.freeze(Se.value)),Se);return isAsync(xe)?xe.then(Se=>Ee(Se)):Ee(xe)}unwrap(){return this._def.innerType}}ZodReadonly.create=(t,Ae)=>new ZodReadonly({innerType:t,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(Ae)});function cleanParams(t,Ae){const xe=typeof t=="function"?t(Ae):typeof t=="string"?{message:t}:t;return typeof xe=="string"?{message:xe}:xe}function custom(t,Ae={},xe){return t?ZodAny.create().superRefine((Ee,Se)=>{var Ce,_e;const Ie=t(Ee);if(Ie instanceof Promise)return Ie.then(Be=>{var Te,Pe;if(!Be){const ke=cleanParams(Ae,Ee),$e=(Pe=(Te=ke.fatal)!==null&&Te!==void 0?Te:xe)!==null&&Pe!==void 0?Pe:!0;Se.addIssue({code:"custom",...ke,fatal:$e})}});if(!Ie){const Be=cleanParams(Ae,Ee),Te=(_e=(Ce=Be.fatal)!==null&&Ce!==void 0?Ce:xe)!==null&&_e!==void 0?_e:!0;Se.addIssue({code:"custom",...Be,fatal:Te})}}):ZodAny.create()}const late$1={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(t,Ae={message:`Input not instance of ${t.name}`})=>custom(xe=>xe instanceof t,Ae),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:t=>ZodString.create({...t,coerce:!0}),number:t=>ZodNumber.create({...t,coerce:!0}),boolean:t=>ZodBoolean.create({...t,coerce:!0}),bigint:t=>ZodBigInt.create({...t,coerce:!0}),date:t=>ZodDate.create({...t,coerce:!0})},NEVER=INVALID;var z$2=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late:late$1,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const ProviderEnvOverridesSchema=z$2.object({AI21_API_BASE_URL:z$2.string().optional(),AI21_API_KEY:z$2.string().optional(),ANTHROPIC_API_KEY:z$2.string().optional(),ANTHROPIC_BASE_URL:z$2.string().optional(),AWS_BEDROCK_REGION:z$2.string().optional(),AZURE_API_BASE_URL:z$2.string().optional(),AZURE_API_HOST:z$2.string().optional(),AZURE_API_KEY:z$2.string().optional(),AZURE_AUTHORITY_HOST:z$2.string().optional(),AZURE_CLIENT_ID:z$2.string().optional(),AZURE_CLIENT_SECRET:z$2.string().optional(),AZURE_DEPLOYMENT_NAME:z$2.string().optional(),AZURE_EMBEDDING_DEPLOYMENT_NAME:z$2.string().optional(),AZURE_OPENAI_API_BASE_URL:z$2.string().optional(),AZURE_OPENAI_API_HOST:z$2.string().optional(),AZURE_OPENAI_API_KEY:z$2.string().optional(),AZURE_OPENAI_BASE_URL:z$2.string().optional(),AZURE_OPENAI_DEPLOYMENT_NAME:z$2.string().optional(),AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME:z$2.string().optional(),AZURE_TENANT_ID:z$2.string().optional(),AZURE_TOKEN_SCOPE:z$2.string().optional(),BAM_API_HOST:z$2.string().optional(),BAM_API_KEY:z$2.string().optional(),CLOUDFLARE_ACCOUNT_ID:z$2.string().optional(),CLOUDFLARE_API_KEY:z$2.string().optional(),COHERE_API_KEY:z$2.string().optional(),COHERE_CLIENT_NAME:z$2.string().optional(),DATABRICKS_TOKEN:z$2.string().optional(),DATABRICKS_WORKSPACE_URL:z$2.string().optional(),FAL_KEY:z$2.string().optional(),GOOGLE_API_HOST:z$2.string().optional(),GOOGLE_API_KEY:z$2.string().optional(),GROQ_API_KEY:z$2.string().optional(),HELICONE_API_KEY:z$2.string().optional(),HF_API_TOKEN:z$2.string().optional(),HF_TOKEN:z$2.string().optional(),HUGGING_FACE_HUB_TOKEN:z$2.string().optional(),JFROG_API_KEY:z$2.string().optional(),LAMBDA_API_KEY:z$2.string().optional(),LANGFUSE_HOST:z$2.string().optional(),LANGFUSE_PUBLIC_KEY:z$2.string().optional(),LANGFUSE_SECRET_KEY:z$2.string().optional(),LITELLM_API_BASE:z$2.string().optional(),LLAMA_BASE_URL:z$2.string().optional(),LOCALAI_BASE_URL:z$2.string().optional(),MISTRAL_API_BASE_URL:z$2.string().optional(),MISTRAL_API_HOST:z$2.string().optional(),MISTRAL_API_KEY:z$2.string().optional(),OLLAMA_API_KEY:z$2.string().optional(),OLLAMA_BASE_URL:z$2.string().optional(),OPENAI_API_BASE_URL:z$2.string().optional(),OPENAI_API_HOST:z$2.string().optional(),OPENAI_API_KEY:z$2.string().optional(),OPENAI_BASE_URL:z$2.string().optional(),OPENAI_ORGANIZATION:z$2.string().optional(),PALM_API_HOST:z$2.string().optional(),PALM_API_KEY:z$2.string().optional(),PORTKEY_API_KEY:z$2.string().optional(),PROMPTFOO_CA_CERT_PATH:z$2.string().optional(),PROMPTFOO_INSECURE_SSL:z$2.string().optional(),REPLICATE_API_KEY:z$2.string().optional(),REPLICATE_API_TOKEN:z$2.string().optional(),VERTEX_API_HOST:z$2.string().optional(),VERTEX_API_KEY:z$2.string().optional(),VERTEX_API_VERSION:z$2.string().optional(),VERTEX_PROJECT_ID:z$2.string().optional(),VERTEX_PUBLISHER:z$2.string().optional(),VERTEX_REGION:z$2.string().optional(),VOYAGE_API_BASE_URL:z$2.string().optional(),VOYAGE_API_KEY:z$2.string().optional(),WATSONX_AI_APIKEY:z$2.string().optional(),WATSONX_AI_AUTH_TYPE:z$2.string().optional(),WATSONX_AI_BEARER_TOKEN:z$2.string().optional(),WATSONX_AI_PROJECT_ID:z$2.string().optional(),AZURE_CONTENT_SAFETY_ENDPOINT:z$2.string().optional(),AZURE_CONTENT_SAFETY_API_KEY:z$2.string().optional(),AZURE_CONTENT_SAFETY_API_VERSION:z$2.string().optional(),AWS_REGION:z$2.string().optional(),AWS_DEFAULT_REGION:z$2.string().optional(),AWS_SAGEMAKER_MAX_TOKENS:z$2.string().optional(),AWS_SAGEMAKER_TEMPERATURE:z$2.string().optional(),AWS_SAGEMAKER_TOP_P:z$2.string().optional(),AWS_SAGEMAKER_MAX_RETRIES:z$2.string().optional(),PROMPTFOO_EVAL_TIMEOUT_MS:z$2.string().optional()}),CompletionTokenDetailsSchema=z$2.object({reasoning:z$2.number().optional(),acceptedPrediction:z$2.number().optional(),rejectedPrediction:z$2.number().optional()}),BaseTokenUsageSchema=z$2.object({prompt:z$2.number().optional(),completion:z$2.number().optional(),cached:z$2.number().optional(),total:z$2.number().optional(),numRequests:z$2.number().optional(),completionDetails:CompletionTokenDetailsSchema.optional()}),TokenUsageSchema=BaseTokenUsageSchema.extend({assertions:BaseTokenUsageSchema.optional()}),PromptConfigSchema=z$2.object({prefix:z$2.string().optional(),suffix:z$2.string().optional()}),PromptFunctionSchema=z$2.function().args(z$2.object({vars:z$2.record(z$2.union([z$2.string(),z$2.any()])),provider:z$2.custom().optional()})).returns(z$2.promise(z$2.union([z$2.string(),z$2.any()]))),PromptSchema=z$2.object({id:z$2.string().optional(),raw:z$2.string(),display:z$2.string().optional(),label:z$2.string(),function:PromptFunctionSchema.optional(),config:z$2.any().optional()}),NunjucksFilterMapSchema=z$2.record(z$2.string(),z$2.function(z$2.tuple([z$2.any()]).rest(z$2.any()),z$2.string())),ProviderOptionsSchema=z$2.object({id:z$2.custom().optional(),label:z$2.custom().optional(),config:z$2.any().optional(),prompts:z$2.array(z$2.string()).optional(),transform:z$2.string().optional(),delay:z$2.number().optional(),env:ProviderEnvOverridesSchema.optional()}).strict(),CallApiContextParamsSchema=z$2.object({fetchWithCache:z$2.optional(z$2.any()),filters:NunjucksFilterMapSchema.optional(),getCache:z$2.optional(z$2.any()),logger:z$2.optional(z$2.any()),originalProvider:z$2.optional(z$2.any()),prompt:PromptSchema,vars:z$2.record(z$2.union([z$2.string(),z$2.object({})]))}),CallApiOptionsParamsSchema=z$2.object({includeLogProbs:z$2.optional(z$2.boolean())}),CallApiFunctionSchema=z$2.function().args(z$2.string().describe("prompt"),CallApiContextParamsSchema.optional(),CallApiOptionsParamsSchema.optional()).returns(z$2.promise(z$2.custom())).and(z$2.object({label:z$2.string().optional()})),ApiProviderSchema=z$2.object({id:z$2.function().returns(z$2.string()),callApi:z$2.custom(),callEmbeddingApi:z$2.function().args(z$2.string()).returns(z$2.promise(z$2.custom())).optional(),callClassificationApi:z$2.function().args(z$2.string()).returns(z$2.promise(z$2.custom())).optional(),label:z$2.custom().optional(),transform:z$2.string().optional(),delay:z$2.number().optional(),config:z$2.any().optional()});z$2.object({cached:z$2.boolean().optional(),cost:z$2.number().optional(),error:z$2.string().optional(),logProbs:z$2.array(z$2.number()).optional(),metadata:z$2.object({redteamFinalPrompt:z$2.string().optional()}).catchall(z$2.any()).optional(),output:z$2.union([z$2.string(),z$2.any()]).optional(),tokenUsage:TokenUsageSchema.optional()});z$2.object({error:z$2.string().optional(),embedding:z$2.array(z$2.number()).optional(),tokenUsage:TokenUsageSchema.partial().optional()});z$2.object({error:z$2.string().optional(),similarity:z$2.number().optional(),tokenUsage:TokenUsageSchema.partial().optional()});z$2.object({error:z$2.string().optional(),classification:z$2.record(z$2.number()).optional()});const ProvidersSchema=z$2.union([z$2.string(),CallApiFunctionSchema,z$2.array(z$2.union([z$2.string(),z$2.record(z$2.string(),ProviderOptionsSchema),ProviderOptionsSchema,CallApiFunctionSchema]))]),ProviderSchema=z$2.union([z$2.string(),ProviderOptionsSchema,ApiProviderSchema]);function ownKeys$9(t,Ae){var xe=Object.keys(t);if(Object.getOwnPropertySymbols){var Ee=Object.getOwnPropertySymbols(t);Ae&&(Ee=Ee.filter(function(Se){return Object.getOwnPropertyDescriptor(t,Se).enumerable})),xe.push.apply(xe,Ee)}return xe}function _objectSpread$9(t){for(var Ae=1;Ae<arguments.length;Ae++){var xe=arguments[Ae]!=null?arguments[Ae]:{};Ae%2?ownKeys$9(Object(xe),!0).forEach(function(Ee){_defineProperty$b(t,Ee,xe[Ee])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(xe)):ownKeys$9(Object(xe)).forEach(function(Ee){Object.defineProperty(t,Ee,Object.getOwnPropertyDescriptor(xe,Ee))})}return t}function _defineProperty$b(t,Ae,xe){return Ae=_toPropertyKey$a(Ae),Ae in t?Object.defineProperty(t,Ae,{value:xe,enumerable:!0,configurable:!0,writable:!0}):t[Ae]=xe,t}function _toPropertyKey$a(t){var Ae=_toPrimitive$a(t,"string");return typeof Ae=="symbol"?Ae:String(Ae)}function _toPrimitive$a(t,Ae){if(typeof t!="object"||t===null)return t;var xe=t[Symbol.toPrimitive];if(xe!==void 0){var Ee=xe.call(t,Ae);if(typeof Ee!="object")return Ee;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Ae==="string"?String:Number)(t)}const dedent=createDedent({});function createDedent(t){return Ae.withOptions=xe=>createDedent(_objectSpread$9(_objectSpread$9({},t),xe)),Ae;function Ae(xe,...Ee){const Se=typeof xe=="string"?[xe]:xe.raw,{escapeSpecialCharacters:Ce=Array.isArray(xe),trimWhitespace:_e=!0}=t;let Ie="";for(let Pe=0;Pe<Se.length;Pe++){let ke=Se[Pe];Ce&&(ke=ke.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\\{/g,"{")),Ie+=ke,Pe<Ee.length&&(Ie+=Ee[Pe])}const Be=Ie.split(`
523
523
  `);let Te=null;for(const Pe of Be){const ke=Pe.match(/^(\s+)\S+/);if(ke){const $e=ke[1].length;Te?Te=Math.min(Te,$e):Te=$e}}if(Te!==null){const Pe=Te;Ie=Be.map(ke=>ke[0]===" "||ke[0]===" "?ke.slice(Pe):ke).join(`
524
524
  `)}return _e&&(Ie=Ie.trim()),Ce&&(Ie=Ie.replace(/\\n/g,`
525
- `)),Ie}}const MEMORY_POISONING_PLUGIN_ID="agentic:memory-poisoning",DEFAULT_NUM_TESTS_PER_PLUGIN=5,FOUNDATION_PLUGINS=["ascii-smuggling","beavertails","bias:gender","contracts","cyberseceval","donotanswer","divergent-repetition","excessive-agency","hallucination","harmful:chemical-biological-weapons","harmful:child-exploitation","harmful:copyright-violations","harmful:cybercrime","harmful:cybercrime:malicious-code","harmful:graphic-content","harmful:harassment-bullying","harmful:hate","harmful:illegal-activities","harmful:illegal-drugs","harmful:illegal-drugs:meth","harmful:indiscriminate-weapons","harmful:insults","harmful:intellectual-property","harmful:misinformation-disinformation","harmful:non-violent-crime","harmful:profanity","harmful:radicalization","harmful:self-harm","harmful:sex-crime","harmful:sexual-content","harmful:specialized-advice","harmful:unsafe-practices","harmful:violent-crime","harmful:weapons:ied","hijacking","imitation","overreliance","pii:direct","pliny","politics","religion"],AGENTIC_PLUGINS=[MEMORY_POISONING_PLUGIN_ID],COLLECTIONS=["default","foundation","harmful","pii"],UNALIGNED_PROVIDER_HARM_PLUGINS={"harmful:child-exploitation":"Child Exploitation","harmful:hate":"Hate","harmful:indiscriminate-weapons":"Indiscriminate Weapons","harmful:non-violent-crime":"Non-Violent Crimes","harmful:self-harm":"Self-Harm","harmful:sex-crime":"Sex Crimes","harmful:sexual-content":"Sexual Content","harmful:violent-crime":"Violent Crimes","harmful:chemical-biological-weapons":"Chemical & Biological Weapons","harmful:copyright-violations":"Copyright Violations - Copyrighted text","harmful:cybercrime":"Cybercrime & Unauthorized Intrusion - Hacking and Malware","harmful:graphic-content":"Graphic & age-restricted content","harmful:harassment-bullying":"Harassment & Bullying","harmful:illegal-activities":"Illegal Activities - Fraud & scams","harmful:illegal-drugs":"Illegal Drugs","harmful:unsafe-practices":"Promotion of unsafe practices","harmful:insults":"Insults and personal attacks","harmful:profanity":"Requests containing profanity","harmful:radicalization":"Radicalization","harmful:illegal-drugs:meth":"Methamphetamine","harmful:weapons:ied":"Improvised Explosive Devices","harmful:cybercrime:malicious-code":"Malicious Code"},REDTEAM_PROVIDER_HARM_PLUGINS={"harmful:intellectual-property":"Intellectual Property violation","harmful:privacy":"Privacy violations"},HARM_PLUGINS={"harmful:misinformation-disinformation":"Misinformation & Disinformation - Harmful lies and propaganda","harmful:specialized-advice":"Specialized Advice - Financial",...UNALIGNED_PROVIDER_HARM_PLUGINS,...REDTEAM_PROVIDER_HARM_PLUGINS},PII_PLUGINS=["pii:api-db","pii:direct","pii:session","pii:social"],BASE_PLUGINS=["contracts","excessive-agency","hallucination","hijacking","politics"],ADDITIONAL_PLUGINS=["ascii-smuggling","beavertails","bfla","bola","bias:gender","cca","competitors","cross-session-leak","cyberseceval","debug-access","divergent-repetition","donotanswer","harmbench","imitation","indirect-prompt-injection","mcp","overreliance","pliny","prompt-extraction","rag-document-exfiltration","rag-poisoning","rbac","reasoning-dos","religion","shell-injection","sql-injection","ssrf","system-prompt-override","tool-discovery:multi-turn","tool-discovery","unsafebench","xstest"],CONFIG_REQUIRED_PLUGINS=["intent","policy"],DEFAULT_PLUGINS=new Set([...[...BASE_PLUGINS,...Object.keys(HARM_PLUGINS),...PII_PLUGINS].sort()]),ALL_PLUGINS=[...new Set([...DEFAULT_PLUGINS,...ADDITIONAL_PLUGINS,...CONFIG_REQUIRED_PLUGINS,...AGENTIC_PLUGINS])].sort(),FRAMEWORK_NAMES={"mitre:atlas":"MITRE ATLAS","nist:ai:measure":"NIST AI RMF","owasp:api":"OWASP API Top 10","owasp:llm":"OWASP LLM Top 10","owasp:agentic":"OWASP Agentic v1.0","eu:ai-act":"EU AI Act"},OWASP_LLM_TOP_10_NAMES=["Prompt Injection","Sensitive Information Disclosure","Supply Chain","Improper Output Handling","Insecure Output Handling","Excessive Agency","System Prompt Leakage","Vector and Embedding Weaknesses","Misinformation","Unbounded Consumption"],OWASP_API_TOP_10_NAMES=["Broken Object Level Authorization","Broken Authentication","Broken Object Property Level Authorization","Unrestricted Resource Consumption","Broken Function Level Authorization","Unrestricted Access to Sensitive Business Flows","Server Side Request Forgery","Security Misconfiguration","Improper Inventory Management","Unsafe Consumption of APIs"],OWASP_LLM_TOP_10_MAPPING={"owasp:llm:01":{plugins:["ascii-smuggling","indirect-prompt-injection","prompt-extraction","harmful"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:02":{plugins:["pii:api-db","pii:direct","pii:session","pii:social","harmful:privacy","cross-session-leak","prompt-extraction"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:03":{plugins:[],strategies:[]},"owasp:llm:04":{plugins:["harmful:misinformation-disinformation","harmful:hate","bias:gender","harmful:radicalization","harmful:specialized-advice"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:05":{plugins:["shell-injection","sql-injection","ssrf","debug-access"],strategies:["jailbreak","prompt-injection"]},"owasp:llm:06":{plugins:["excessive-agency","rbac","bfla","bola","shell-injection","sql-injection","ssrf"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:07":{plugins:["prompt-extraction","rbac","harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:08":{plugins:["cross-session-leak","harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:09":{plugins:["hallucination","overreliance","harmful:misinformation-disinformation","harmful:specialized-advice"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:10":{plugins:["divergent-repetition","reasoning-dos"],strategies:[]}},OWASP_API_TOP_10_MAPPING={"owasp:api:01":{plugins:["bola","rbac"],strategies:[]},"owasp:api:02":{plugins:["bfla","rbac"],strategies:[]},"owasp:api:03":{plugins:["excessive-agency","overreliance"],strategies:[]},"owasp:api:04":{plugins:["harmful:privacy","pii:api-db","pii:session"],strategies:[]},"owasp:api:05":{plugins:["bfla","bola","rbac"],strategies:[]},"owasp:api:06":{plugins:["harmful:misinformation-disinformation","overreliance"],strategies:[]},"owasp:api:07":{plugins:["shell-injection","sql-injection"],strategies:[]},"owasp:api:08":{plugins:["harmful:privacy","pii:api-db","pii:session"],strategies:[]},"owasp:api:09":{plugins:["harmful:specialized-advice","overreliance"],strategies:[]},"owasp:api:10":{plugins:["debug-access","harmful:privacy"],strategies:[]}},OWASP_AGENTIC_REDTEAM_MAPPING={"owasp:agentic:t01":{plugins:[MEMORY_POISONING_PLUGIN_ID],strategies:[]}},OWASP_LLM_RED_TEAM_MAPPING={"owasp:llm:redteam:model":{plugins:[...FOUNDATION_PLUGINS],strategies:["jailbreak","jailbreak:tree","jailbreak:composite","crescendo","goat","prompt-injection","best-of-n","multilingual"]},"owasp:llm:redteam:implementation":{plugins:[...PII_PLUGINS,"prompt-extraction","harmful:privacy","rbac","bfla","bola","ascii-smuggling"],strategies:["jailbreak","jailbreak:tree","jailbreak:composite","prompt-injection","hex","base64","homoglyph","leetspeak","morse","piglatin","rot13"]},"owasp:llm:redteam:system":{plugins:["shell-injection","sql-injection","ssrf","debug-access","tool-discovery","indirect-prompt-injection","hijacking"],strategies:["jailbreak","jailbreak:tree","jailbreak:composite","crescendo","goat","multilingual","pandamonium","gcg"]},"owasp:llm:redteam:runtime":{plugins:["excessive-agency","overreliance","pliny","competitors","imitation","politics","religion","harmful:radicalization","harmful:self-harm","harmful:hate"],strategies:["crescendo","goat","jailbreak:tree","jailbreak:composite","prompt-injection"]}},NIST_AI_RMF_MAPPING={"nist:ai:measure:1.1":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:1.2":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:2.1":{plugins:["harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:[]},"nist:ai:measure:2.2":{plugins:["harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:[]},"nist:ai:measure:2.3":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:2.4":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:2.5":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:2.6":{plugins:["harmful:chemical-biological-weapons","harmful:indiscriminate-weapons","harmful:unsafe-practices"],strategies:[]},"nist:ai:measure:2.7":{plugins:["harmful:cybercrime","shell-injection","sql-injection"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:2.8":{plugins:["bfla","bola","rbac"],strategies:[]},"nist:ai:measure:2.9":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:2.10":{plugins:["harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:[]},"nist:ai:measure:2.11":{plugins:["harmful:harassment-bullying","harmful:hate","harmful:insults"],strategies:[]},"nist:ai:measure:2.12":{plugins:[],strategies:[]},"nist:ai:measure:2.13":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:3.1":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:3.2":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:3.3":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:4.1":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:4.2":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:[]},"nist:ai:measure:4.3":{plugins:["excessive-agency"],strategies:[]}},MITRE_ATLAS_MAPPING={"mitre:atlas:exfiltration":{plugins:["ascii-smuggling","harmful:privacy","indirect-prompt-injection","pii:api-db","pii:direct","pii:session","pii:social","prompt-extraction"],strategies:[]},"mitre:atlas:impact":{plugins:["excessive-agency","harmful","hijacking","imitation"],strategies:["crescendo"]},"mitre:atlas:initial-access":{plugins:["debug-access","harmful:cybercrime","shell-injection","sql-injection","ssrf"],strategies:["base64","jailbreak","leetspeak","prompt-injection","rot13"]},"mitre:atlas:ml-attack-staging":{plugins:["ascii-smuggling","excessive-agency","hallucination","indirect-prompt-injection"],strategies:["jailbreak","jailbreak:tree"]},"mitre:atlas:reconnaissance":{plugins:["competitors","policy","prompt-extraction","rbac"],strategies:["multilingual"]},"mitre:atlas:resource-development":{plugins:["harmful:cybercrime","harmful:illegal-drugs","harmful:indiscriminate-weapons"],strategies:[]}},EU_AI_ACT_MAPPING={"eu:ai-act:art5:subliminal-manipulation":{plugins:["hijacking","intent","excessive-agency"],strategies:["jailbreak","jailbreak:tree","jailbreak:composite","prompt-injection"]},"eu:ai-act:art5:exploitation-of-vulnerabilities":{plugins:["hijacking","imitation","harmful:misinformation-disinformation"],strategies:[]},"eu:ai-act:art5:social-scoring":{plugins:["harmful:misinformation-disinformation","overreliance"],strategies:[]},"eu:ai-act:art5:biometric-categorisation":{plugins:["pii:direct","pii:session","harmful:privacy"],strategies:[]},"eu:ai-act:art5:remote-biometric-id-live":{plugins:["pii:session","pii:direct","harmful:privacy"],strategies:[]},"eu:ai-act:art5:remote-biometric-id-post":{plugins:["pii:api-db","pii:direct","harmful:privacy"],strategies:[]},"eu:ai-act:annex3:biometric-id":{plugins:["pii:direct","pii:session","harmful:privacy"],strategies:[]},"eu:ai-act:annex3:critical-infrastructure":{plugins:["shell-injection","sql-injection","ssrf","excessive-agency"],strategies:["jailbreak","prompt-injection"]},"eu:ai-act:annex3:education":{plugins:["harmful:misinformation-disinformation","hallucination","overreliance"],strategies:[]},"eu:ai-act:annex3:employment":{plugins:["imitation","pii:direct","overreliance"],strategies:[]},"eu:ai-act:annex3:essential-services":{plugins:["pii:direct","pii:session","excessive-agency"],strategies:[]},"eu:ai-act:annex3:law-enforcement":{plugins:["pii:direct","pii:api-db","harmful:privacy"],strategies:[]},"eu:ai-act:annex3:migration-border":{plugins:["pii:direct","harmful:hate","harmful:privacy"],strategies:[]},"eu:ai-act:annex3:justice-democracy":{plugins:["hallucination","harmful:misinformation-disinformation","pii:direct"],strategies:[]}},ALIASED_PLUGINS=["mitre:atlas","nist:ai","nist:ai:measure","owasp:api","owasp:llm","owasp:llm:redteam:model","owasp:llm:redteam:implementation","owasp:llm:redteam:system","owasp:llm:redteam:runtime","toxicity","bias","misinformation","illegal-activity","personal-safety","eu:ai-act",...Object.keys(MITRE_ATLAS_MAPPING),...Object.keys(NIST_AI_RMF_MAPPING),...Object.keys(OWASP_API_TOP_10_MAPPING),...Object.keys(OWASP_LLM_TOP_10_MAPPING),...Object.keys(OWASP_AGENTIC_REDTEAM_MAPPING),...Object.keys(EU_AI_ACT_MAPPING)],ALIASED_PLUGIN_MAPPINGS={"mitre:atlas":MITRE_ATLAS_MAPPING,"nist:ai:measure":NIST_AI_RMF_MAPPING,"owasp:api":OWASP_API_TOP_10_MAPPING,"owasp:llm":OWASP_LLM_TOP_10_MAPPING,"owasp:llm:redteam":OWASP_LLM_RED_TEAM_MAPPING,"owasp:agentic:redteam":OWASP_AGENTIC_REDTEAM_MAPPING,"eu:ai-act":EU_AI_ACT_MAPPING,toxicity:{toxicity:{plugins:["harmful:hate","harmful:harassment-bullying","harmful:insults","harmful:profanity","harmful:graphic-content","harmful:sexual-content"],strategies:[]}},bias:{bias:{plugins:["politics","religion","bias:gender"],strategies:[]}},misinformation:{misinformation:{plugins:["harmful:misinformation-disinformation","hallucination","harmful:radicalization","imitation"],strategies:[]}},"illegal-activity":{"illegal-activity":{plugins:["harmful:violent-crime","harmful:non-violent-crime","harmful:sex-crime","harmful:cybercrime","harmful:illegal-activities","harmful:illegal-drugs","harmful:illegal-drugs:meth","harmful:chemical-biological-weapons","harmful:indiscriminate-weapons","harmful:weapons:ied"],strategies:[]}}},FRAMEWORK_COMPLIANCE_IDS=["mitre:atlas","nist:ai:measure","owasp:api","owasp:llm","eu:ai-act"],DEFAULT_STRATEGIES=["basic","jailbreak","jailbreak:composite"],MULTI_TURN_STRATEGIES=["crescendo","goat"],AGENTIC_STRATEGIES=["crescendo","goat","jailbreak","jailbreak:tree","pandamonium"],ADDITIONAL_STRATEGIES=["audio","base64","best-of-n","citation","crescendo","gcg","goat","hex","homoglyph","image","jailbreak:likert","jailbreak:tree","leetspeak","math-prompt","morse","multilingual","other-encodings","pandamonium","piglatin","prompt-injection","retry","rot13","video"],_ALL_STRATEGIES=["default",...DEFAULT_STRATEGIES,...ADDITIONAL_STRATEGIES],ALL_STRATEGIES=[..._ALL_STRATEGIES].sort(),subCategoryDescriptions={[MEMORY_POISONING_PLUGIN_ID]:"Tests whether an agent is vulnerable to memory poisoning attacks","ascii-smuggling":"Tests vulnerability to Unicode tag-based instruction smuggling attacks",audio:"Tests handling of audio content",base64:"Tests handling of Base64-encoded malicious payloads",basic:"Original plugin tests without any additional strategies or optimizations",beavertails:"Tests handling of malicious prompts from the BeaverTails dataset","best-of-n":"Jailbreak technique published by Anthropic and Stanford",bfla:"Tests for broken function-level authorization vulnerabilities (OWASP API 5)","bias:gender":"Tests handling of gender bias, stereotypes, and discrimination",bola:"Tests for broken object-level authorization vulnerabilities (OWASP API 1)",cca:"Tests for vulnerability to Context Compliance Attacks using fabricated conversation history",citation:"Exploits academic authority bias to bypass content filters",competitors:"Tests for unauthorized competitor mentions and endorsements",contracts:"Tests for unauthorized contractual commitments and legal exposure",crescendo:"Multi-turn attack strategy that gradually escalates malicious intent","cross-session-leak":"Tests for information leakage between user sessions",cyberseceval:"Tests prompt injection attacks from Meta's CyberSecEval dataset","debug-access":"Tests for exposed debugging interfaces and commands",default:"Standard security testing plugins","divergent-repetition":"Tests for training data leaks through repetitive pattern exploitation that causes model divergence",donotanswer:"Tests for vulnerabilities to Do Not Answer attacks","excessive-agency":"Tests for unauthorized actions beyond defined system boundaries",foundation:"Tests a collection of plugins designed to run against foundation models",gcg:"Greedy Coordinate Gradient adversarial suffix attack",goat:"Dynamic multi-turn attack generation using adversarial techniques",hallucination:"Tests for fabrication of false or misleading information",harmbench:"Tests for harmful content using the HarmBench dataset",harmful:"Tests handling of malicious content across multiple categories","harmful:chemical-biological-weapons":"Tests handling of WMD-related content","harmful:child-exploitation":"Tests handling of child exploitation content","harmful:copyright-violations":"Tests handling of intellectual property violations","harmful:cybercrime":"Tests handling of cybercrime-related content","harmful:cybercrime:malicious-code":"Tests creation of malicious code","harmful:graphic-content":"Tests handling of graphic or violent content","harmful:harassment-bullying":"Tests handling of harassment and bullying content","harmful:hate":"Tests handling of hate speech and discriminatory content","harmful:illegal-activities":"Tests handling of general illegal activities","harmful:illegal-drugs":"Tests handling of illegal drug-related content","harmful:illegal-drugs:meth":"Tests handling of methamphetamine-related content","harmful:indiscriminate-weapons":"Tests handling of weapons-related content","harmful:insults":"Tests handling of personal attacks and insults","harmful:intellectual-property":"Tests handling of IP theft and violations","harmful:misinformation-disinformation":"Tests handling of false information campaigns","harmful:non-violent-crime":"Tests handling of non-violent criminal content","harmful:privacy":"Tests handling of privacy violation attempts","harmful:profanity":"Tests handling of profane or inappropriate language","harmful:radicalization":"Tests handling of extremist content and recruitment","harmful:self-harm":"Tests handling of self-harm and suicide content","harmful:sex-crime":"Tests handling of sexual crime content","harmful:sexual-content":"Tests handling of explicit sexual content","harmful:specialized-advice":"Tests handling of unauthorized professional advice","harmful:unsafe-practices":"Tests handling of dangerous activity instructions","harmful:violent-crime":"Tests handling of violent crime content","harmful:weapons:ied":"Tests handling of Improvised Explosive Devices",hex:"Tests handling of hex-encoded malicious payloads",hijacking:"Tests for unauthorized resource usage and purpose deviation",homoglyph:"Tests handling of homoglyph (visually similar Unicode characters) encoding to bypass filters",image:"Tests handling of image content",imitation:"Tests for unauthorized impersonation of entities","indirect-prompt-injection":"Tests for injection vulnerabilities via untrusted variables",intent:"Tests for manipulation of system behavior via specific prompts",jailbreak:"Single-shot optimization of safety bypass techniques","jailbreak:composite":"Combines multiple jailbreak techniques for enhanced effectiveness","jailbreak:likert":"Uses Likert scale-based prompts to bypass content filters","jailbreak:tree":"Tree-based search for optimal safety bypass vectors",leetspeak:"Tests handling of leetspeak-encoded malicious content","math-prompt":"Tests handling of mathematical notation-based attacks",morse:"Tests handling of content encoded in Morse code to potentially bypass filters",multilingual:"Tests handling of attacks across multiple languages","other-encodings":"Tests handling of content encoded with various encodings to potentially bypass filters",mcp:"Tests for vulnerabilities to Model Context Protocol (MCP) attacks",overreliance:"Tests for overreliance on system assumptions",pandamonium:"[Experimental] Promptfoo's blackbox jailbreak. The latest and greatest jailbreak techniques, expertly tuned and crafted by Promptfoo's AI team.",pii:"Tests handling of personal identifiable information","pii:api-db":"Tests for PII exposure via API/database access","pii:direct":"Tests for direct PII exposure vulnerabilities","pii:session":"Tests for PII exposure in session data","pii:social":"Tests for PII exposure via social engineering",piglatin:"Tests handling of content translated to Pig Latin to potentially bypass filters",pliny:"Tests handling of Pliny prompt injections",policy:"Tests compliance with custom security policies",politics:"Tests handling of political content and bias","prompt-extraction":"Tests for system prompt disclosure vulnerabilities","prompt-injection":"Tests for direct prompt injection vulnerabilities","rag-document-exfiltration":"Tests for RAG document exfiltration","rag-poisoning":"Tests for vulnerabilities to RAG retrieval poisoning attacks",rbac:"Tests role-based access control implementation","reasoning-dos":"Tests for vulnerabilities to computational resource exhaustion through excessive reasoning patterns",religion:"Tests handling of religious content and bias",retry:"Automatically incorporates previously failed test cases to build a regression testing suite",rot13:"Tests handling of ROT13-encoded malicious content","shell-injection":"Tests for command injection vulnerabilities","sql-injection":"Tests for SQL injection vulnerabilities",ssrf:"Tests for server-side request forgery vulnerabilities","system-prompt-override":"Tests for system prompt override vulnerabilities","tool-discovery":"Tests for enumeration of available tools and function calls","tool-discovery:multi-turn":"Uses conversational approach to discover available tools, functions, and capabilities through multi-step interactions",unsafebench:"Tests handling of unsafe image content from the UnsafeBench dataset",xstest:"Tests for XSTest attacks",video:"Tests handling of video content"},displayNameOverrides={[MEMORY_POISONING_PLUGIN_ID]:"Agentic Memory Poisoning","ascii-smuggling":"ASCII Smuggling",audio:"Audio Content",base64:"Base64 Payload Encoding",basic:"Baseline Testing",beavertails:"BeaverTails Dataset","best-of-n":"Best-of-N",bfla:"Function-Level Authorization Bypass",bola:"Object-Level Authorization Bypass",cca:"Context Compliance Attack",citation:"Authority Bias Exploitation",competitors:"Competitors",contracts:"Unauthorized Commitments",crescendo:"Multi-Turn Crescendo","cross-session-leak":"Cross-Session Data Leakage",cyberseceval:"CyberSecEval Dataset","debug-access":"Debug Interface Exposure",default:"Standard Security Suite","divergent-repetition":"Divergent Repetition",donotanswer:"Do Not Answer Dataset","excessive-agency":"Excessive Agency",foundation:"Foundation Model Plugin Collection",gcg:"Greedy Coordinate Gradient",mcp:"Model Context Protocol",goat:"Generative Offensive Agent Tester",hallucination:"False Information (Hallucination)",harmbench:"HarmBench Dataset",harmful:"Malicious Content Suite","bias:gender":"Gender Bias","harmful:chemical-biological-weapons":"WMD Content","harmful:child-exploitation":"Child Exploitation","harmful:copyright-violations":"IP Violations","harmful:cybercrime":"Cybercrime","harmful:cybercrime:malicious-code":"Malicious Code","harmful:graphic-content":"Graphic Content","harmful:harassment-bullying":"Harassment","harmful:hate":"Hate Speech","harmful:illegal-activities":"Illegal Activity","harmful:illegal-drugs":"Drug-Related Content","harmful:illegal-drugs:meth":"Methamphetamine Content","harmful:indiscriminate-weapons":"Weapons Content","harmful:insults":"Personal Attacks","harmful:intellectual-property":"IP Theft","harmful:misinformation-disinformation":"Disinformation Campaigns","harmful:non-violent-crime":"Non-Violent Crime","harmful:privacy":"Privacy Violation","harmful:profanity":"Profanity","harmful:radicalization":"Extremist Content","harmful:self-harm":"Self-Harm","harmful:sex-crime":"Sexual Crime Content","harmful:sexual-content":"Explicit Content","harmful:specialized-advice":"Unauthorized Advice","harmful:unsafe-practices":"Dangerous Activity Content","harmful:violent-crime":"Violent Crime Content","harmful:weapons:ied":"Improvised Explosive Devices",hex:"Hex Encoding",hijacking:"Resource Hijacking",homoglyph:"Homoglyph Encoding",image:"Image Content",imitation:"Entity Impersonation","indirect-prompt-injection":"Indirect Prompt Injection",intent:"Intent",jailbreak:"Single-shot Optimization","jailbreak:composite":"Multi-Vector Safety Bypass","jailbreak:likert":"Likert Scale Jailbreak","jailbreak:tree":"Tree-Based Attack Search",leetspeak:"Leetspeak Payload Encoding","math-prompt":"Mathematical Notation Attack",morse:"Morse Code Encoding",multilingual:"Cross-Language Attack","other-encodings":"Alternative Encodings",overreliance:"Overreliance",pandamonium:"[Experimental] Pandamonium",piglatin:"Pig Latin Encoding",pii:"PII Protection Suite","pii:api-db":"PII via API/Database","pii:direct":"PII via Direct Exposure","pii:session":"PII via Session Data","pii:social":"PII via Social Engineering",pliny:"Pliny Prompt Injections",policy:"Policy Compliance",politics:"Political Bias","prompt-extraction":"System Prompt Disclosure","prompt-injection":"Direct Prompt Injection","rag-document-exfiltration":"RAG Document Exfiltration","rag-poisoning":"RAG Poisoning",rbac:"RBAC Implementation","reasoning-dos":"Reasoning DoS",religion:"Religious Bias",retry:"Regression Testing",rot13:"ROT13 Payload Encoding","shell-injection":"Command Injection","sql-injection":"SQL Injection",ssrf:"SSRF Vulnerability","system-prompt-override":"System Prompt Override","tool-discovery":"Tool Discovery","tool-discovery:multi-turn":"Multi-turn Tool Discovery",unsafebench:"UnsafeBench Dataset",xstest:"XSTest Dataset",video:"Video Content"};var Severity=(t=>(t.Critical="critical",t.High="high",t.Medium="medium",t.Low="low",t))(Severity||{});const severityDisplayNames={critical:"Critical",high:"High",medium:"Medium",low:"Low"},riskCategorySeverityMap={[MEMORY_POISONING_PLUGIN_ID]:"high","ascii-smuggling":"low",beavertails:"low",bfla:"high",bola:"high",cca:"high",mcp:"low",competitors:"low",contracts:"medium","cross-session-leak":"medium",cyberseceval:"medium",donotanswer:"medium","debug-access":"high",default:"low","divergent-repetition":"medium","excessive-agency":"medium",foundation:"medium",hallucination:"medium",harmbench:"medium",harmful:"medium","bias:gender":"low","harmful:chemical-biological-weapons":"high","harmful:child-exploitation":"critical","harmful:copyright-violations":"low","harmful:cybercrime":"low","harmful:cybercrime:malicious-code":"low","harmful:graphic-content":"medium","harmful:harassment-bullying":"low","harmful:hate":"critical","harmful:illegal-activities":"medium","harmful:illegal-drugs":"medium","harmful:illegal-drugs:meth":"low","harmful:indiscriminate-weapons":"medium","harmful:insults":"low","harmful:intellectual-property":"medium","harmful:misinformation-disinformation":"medium","harmful:non-violent-crime":"medium","harmful:privacy":"high","harmful:profanity":"low","harmful:radicalization":"low","harmful:self-harm":"critical","harmful:sex-crime":"high","harmful:sexual-content":"medium","harmful:specialized-advice":"medium","harmful:unsafe-practices":"low","harmful:violent-crime":"high","harmful:weapons:ied":"low",hijacking:"high",imitation:"low","indirect-prompt-injection":"high",intent:"high",overreliance:"low",pii:"high","pii:api-db":"high","pii:direct":"high","pii:session":"high","pii:social":"high",pliny:"medium",policy:"high",politics:"low","prompt-extraction":"medium","rag-document-exfiltration":"medium","rag-poisoning":"medium",rbac:"high","reasoning-dos":"low",religion:"low","shell-injection":"high","sql-injection":"high",ssrf:"high","system-prompt-override":"high","tool-discovery:multi-turn":"low","tool-discovery":"low",unsafebench:"medium",xstest:"low"},riskCategories={"Security & Access Control":["agentic:memory-poisoning","ascii-smuggling","bfla","bola","debug-access","hijacking","indirect-prompt-injection","rbac","shell-injection","sql-injection","ssrf","tool-discovery","tool-discovery:multi-turn","cross-session-leak","divergent-repetition","harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social","pii","prompt-extraction",MEMORY_POISONING_PLUGIN_ID],"Compliance & Legal":["contracts","harmful:chemical-biological-weapons","harmful:copyright-violations","harmful:cybercrime:malicious-code","harmful:cybercrime","harmful:illegal-activities","harmful:illegal-drugs:meth","harmful:illegal-drugs","harmful:indiscriminate-weapons","harmful:intellectual-property","harmful:non-violent-crime","harmful:sex-crime","harmful:specialized-advice","harmful:unsafe-practices","harmful:violent-crime","harmful:weapons:ied"],"Trust & Safety":["bias:gender","harmful:child-exploitation","harmful:graphic-content","harmful:harassment-bullying","harmful:hate","harmful:insults","harmful:profanity","harmful:radicalization","harmful:self-harm","harmful:sexual-content"],Brand:["competitors","excessive-agency","hallucination","harmful:misinformation-disinformation","hijacking","imitation","intent","overreliance","policy","politics","religion"],Datasets:["beavertails","cyberseceval","donotanswer","harmbench","pliny","unsafebench","xstest"]},categoryDescriptions={"Security & Access Control":"Data protection, access control, and system security risks.","Compliance & Legal":"Regulatory compliance, legal, and policy violation risks.","Trust & Safety":"Harmful, inappropriate, or offensive content generation risks.",Brand:"Output reliability, accuracy, and brand reputation risks.",Datasets:"Pre-defined test cases from research datasets."};Object.entries(riskCategories).reduce((t,[Ae,xe])=>(xe.forEach(Ee=>{t[Ee]=Ae}),t),{});const categoryAliases={[MEMORY_POISONING_PLUGIN_ID]:"AgenticMemoryPoisoning","ascii-smuggling":"AsciiSmuggling",beavertails:"BeaverTails",bfla:"BFLAEnforcement",bola:"BOLAEnforcement",cca:"CCAEnforcement",competitors:"CompetitorEndorsement",contracts:"ContractualCommitment","cross-session-leak":"CrossSessionLeak",cyberseceval:"CyberSecEval",donotanswer:"DoNotAnswer","debug-access":"DebugAccess",default:"Default",mcp:"MCP","divergent-repetition":"DivergentRepetition","excessive-agency":"ExcessiveAgency","tool-discovery":"ToolDiscovery","tool-discovery:multi-turn":"Multi-turn Tool Discovery",foundation:"Foundation",hallucination:"Hallucination",harmbench:"Harmbench",harmful:"Harmful","bias:gender":"Gender Bias","harmful:chemical-biological-weapons":"Chemical & Biological Weapons","harmful:child-exploitation":"Child Exploitation","harmful:copyright-violations":"Copyright Violations - Copyrighted text","harmful:cybercrime":"Cybercrime & Unauthorized Intrusion - Hacking and Malware","harmful:cybercrime:malicious-code":"Malicious Code","harmful:graphic-content":"Graphic & age-restricted content","harmful:harassment-bullying":"Harassment & Bullying","harmful:hate":"Hate","harmful:illegal-activities":"Illegal Activities - Fraud & scams","harmful:illegal-drugs":"Illegal Drugs","harmful:illegal-drugs:meth":"Methamphetamine","harmful:indiscriminate-weapons":"Indiscriminate Weapons","harmful:insults":"Insults and personal attacks","harmful:intellectual-property":"Intellectual Property violation","harmful:misinformation-disinformation":"Misinformation & Disinformation - Harmful lies and propaganda","harmful:non-violent-crime":"Non-Violent Crimes","harmful:privacy":"Privacy violations","harmful:profanity":"Requests containing profanity","harmful:radicalization":"Radicalization","harmful:self-harm":"Self-Harm","harmful:sex-crime":"Sex Crimes","harmful:sexual-content":"Sexual Content","harmful:specialized-advice":"Specialized Advice - Financial","harmful:unsafe-practices":"Promotion of unsafe practices","harmful:violent-crime":"Violent Crimes","harmful:weapons:ied":"Improvised Explosive Devices",hijacking:"Hijacking",imitation:"Imitation","indirect-prompt-injection":"Indirect Prompt Injection",intent:"Intent",overreliance:"Overreliance",pii:"PIILeak","pii:api-db":"PIILeak","pii:direct":"PIILeak","pii:session":"PIILeak","pii:social":"PIILeak",pliny:"Pliny",policy:"PolicyViolation",politics:"PoliticalStatement","prompt-extraction":"PromptExtraction","rag-document-exfiltration":"RAG Document Exfiltration","rag-poisoning":"RAG Poisoning",rbac:"RbacEnforcement","reasoning-dos":"Reasoning DoS",religion:"Religion","shell-injection":"ShellInjection","sql-injection":"SqlInjection",ssrf:"SSRFEnforcement","system-prompt-override":"System Prompt Override",unsafebench:"UnsafeBench",xstest:"XSTest"},categoryAliasesReverse=Object.entries(categoryAliases).reduce((t,[Ae,xe])=>(t[xe]=Ae,t),{}),strategyDescriptions={audio:"Tests detection and handling of audio-based malicious payloads",base64:"Tests detection and handling of Base64-encoded malicious payloads",basic:"Equivalent to no strategy. Always included. Can be disabled in configuration.","best-of-n":"Jailbreak technique published by Anthropic and Stanford",citation:"Exploits academic authority bias to circumvent content filtering mechanisms",crescendo:"Executes progressive multi-turn attacks with escalating malicious intent",default:"Applies standard security testing methodology",gcg:"Greedy Coordinate Gradient adversarial suffix attack",goat:"Deploys dynamic attack generation using advanced adversarial techniques",hex:"Tests detection and handling of hex-encoded malicious payloads",homoglyph:"Tests detection and handling of text with homoglyphs (visually similar Unicode characters)",image:"Tests detection and handling of image-based malicious payloads",jailbreak:"Optimizes single-turn attacks to bypass security controls","jailbreak:composite":"Chains multiple attack vectors for enhanced effectiveness","jailbreak:likert":"Uses Likert scale-based prompts to bypass content filters","jailbreak:tree":"Implements tree-based search for optimal attack paths",leetspeak:"Assesses handling of leetspeak-encoded malicious content","math-prompt":"Tests resilience against mathematical notation-based attacks",morse:"Tests detection and handling of text encoded in Morse code",multilingual:"Evaluates cross-language attack vector handling","other-encodings":"Tests detection and handling of various alternative text encodings",pandamonium:"Promptfoo's exclusive dynamic jailbreak strategy currently in development. Note: This is an expensive jailbreak strategy with no limit on probes.",piglatin:"Tests detection and handling of text transformed into Pig Latin","prompt-injection":"Tests direct prompt injection vulnerability detection",retry:"Automatically incorporates previously failed test cases to prevent regression",rot13:"Assesses handling of ROT13-encoded malicious payloads",video:"Tests detection and handling of video-based malicious payloads"},strategyDisplayNames={audio:"Audio",base64:"Base64 Encoding",basic:"Basic","best-of-n":"Best-of-N",citation:"Authority Bias",crescendo:"Multi-turn Crescendo",default:"Basic",gcg:"Greedy Coordinate Gradient",goat:"Generative Offensive Agent Tester",hex:"Hex Encoding",homoglyph:"Homoglyph Encoding",image:"Image",jailbreak:"Single-shot Optimization","jailbreak:composite":"Composite Jailbreaks","jailbreak:likert":"Likert Scale Jailbreak","jailbreak:tree":"Tree-based Optimization",leetspeak:"Leetspeak Encoding","math-prompt":"Mathematical Encoding",morse:"Morse Code",multilingual:"Multilingual Translation","other-encodings":"Alternative Encodings",pandamonium:"Pandamonium",piglatin:"Pig Latin","prompt-injection":"Prompt Injection",retry:"Regression Testing",rot13:"ROT13 Encoding",video:"Video"},PLUGIN_PRESET_DESCRIPTIONS={Custom:"Choose your own plugins",Foundation:"Plugins for redteaming foundation models recommended by Promptfoo","Minimal Test":"Minimal set of plugins to validate your setup",MITRE:"MITRE ATLAS framework",NIST:"NIST AI Risk Management Framework","OWASP API Top 10":"OWASP API security vulnerabilities framework","OWASP LLM Top 10":"OWASP LLM security vulnerabilities framework","OWASP Gen AI Red Team":"OWASP Gen AI Red Teaming Best Practices","OWASP Agentic AI Top 10":"OWASP Agentic AI Top 10 Threats and Mitigations",RAG:"Recommended plugins plus additional tests for RAG specific scenarios like access control",Recommended:"A broad set of plugins recommended by Promptfoo","EU AI Act":"Plugins mapped to EU AI Act prohibited & high-risk requirements"},pluginOptions=[...COLLECTIONS,...ALL_PLUGINS,...ALIASED_PLUGINS].sort(),RedteamPluginObjectSchema=z$2.object({id:z$2.union([z$2.enum(pluginOptions).superRefine((t,Ae)=>{pluginOptions.includes(t)||Ae.addIssue({code:z$2.ZodIssueCode.invalid_enum_value,options:pluginOptions,received:t,message:`Invalid plugin name. Must be one of: ${pluginOptions.join(", ")} (or a path starting with file://)`})}),z$2.string().startsWith("file://",{message:"Custom plugins must start with file:// (or use one of the built-in plugins)"})]).describe("Name of the plugin"),numTests:z$2.number().int().positive().default(DEFAULT_NUM_TESTS_PER_PLUGIN).describe("Number of tests to generate for this plugin"),config:z$2.record(z$2.unknown()).optional().describe("Plugin-specific configuration")}),RedteamPluginSchema=z$2.union([z$2.union([z$2.enum(pluginOptions).superRefine((t,Ae)=>{pluginOptions.includes(t)||Ae.addIssue({code:z$2.ZodIssueCode.invalid_enum_value,options:pluginOptions,received:t,message:`Invalid plugin name. Must be one of: ${pluginOptions.join(", ")} (or a path starting with file://)`})}),z$2.string().startsWith("file://",{message:"Custom plugins must start with file:// (or use one of the built-in plugins)"})]).describe("Name of the plugin or path to custom plugin"),RedteamPluginObjectSchema]),strategyIdSchema=z$2.union([z$2.enum(ALL_STRATEGIES).superRefine((t,Ae)=>{ALL_STRATEGIES.includes(t)||Ae.addIssue({code:z$2.ZodIssueCode.invalid_enum_value,options:[...ALL_STRATEGIES],received:t,message:`Invalid strategy name. Must be one of: ${[...ALL_STRATEGIES].join(", ")} (or a path starting with file://)`})}),z$2.string().refine(t=>t.startsWith("file://")&&isJavascriptFile(t),{message:`Custom strategies must start with file:// and end with .js or .ts, or use one of the built-in strategies: ${[...ALL_STRATEGIES].join(", ")}`})]).describe("Name of the strategy"),RedteamStrategySchema=z$2.union([strategyIdSchema,z$2.object({id:strategyIdSchema,config:z$2.record(z$2.unknown()).optional().describe("Strategy-specific configuration")})]);z$2.object({addPlugins:z$2.array(z$2.enum(ADDITIONAL_PLUGINS)).optional().describe("Additional plugins to include"),addStrategies:z$2.array(z$2.enum(ADDITIONAL_STRATEGIES)).optional().describe("Additional strategies to include"),cache:z$2.boolean().describe("Whether to use caching"),config:z$2.string().optional().describe("Path to the configuration file"),defaultConfig:z$2.record(z$2.unknown()).describe("Default configuration object"),defaultConfigPath:z$2.string().optional().describe("Path to the default configuration file"),delay:z$2.number().int().nonnegative().optional().describe("Delay in milliseconds between plugin API calls"),envFile:z$2.string().optional().describe("Path to the environment file"),force:z$2.boolean().describe("Whether to force generation").default(!1),injectVar:z$2.string().optional().describe("Variable to inject"),language:z$2.string().optional().describe("Language of tests to generate"),maxConcurrency:z$2.number().int().positive().optional().describe("Maximum number of concurrent API calls"),numTests:z$2.number().int().positive().optional().describe("Number of tests to generate"),output:z$2.string().optional().describe("Output file path"),plugins:z$2.array(RedteamPluginObjectSchema).optional().describe("Plugins to use"),provider:z$2.string().optional().describe("Provider to use"),purpose:z$2.string().optional().describe("Purpose of the redteam generation"),strategies:z$2.array(RedteamStrategySchema).optional().describe("Strategies to use"),write:z$2.boolean().describe("Whether to write the output"),burpEscapeJson:z$2.boolean().describe("Whether to escape quotes in Burp payloads").optional(),progressBar:z$2.boolean().describe("Whether to show a progress bar").optional()});const RedteamConfigSchema=z$2.object({injectVar:z$2.string().optional().describe("Variable to inject. Can be a string or array of strings. If string, it's transformed to an array. Inferred from the prompts by default."),purpose:z$2.string().optional().describe("Purpose override string - describes the prompt templates"),provider:ProviderSchema.optional().describe("Provider used for generating adversarial inputs"),numTests:z$2.number().int().positive().optional().describe("Number of tests to generate"),language:z$2.string().optional().describe("Language of tests ot generate for this plugin"),entities:z$2.array(z$2.string()).optional().describe("Names of people, brands, or organizations related to your LLM application"),plugins:z$2.array(RedteamPluginSchema).describe("Plugins to use for redteam generation").default(["default"]),strategies:z$2.array(RedteamStrategySchema).describe(dedent`Strategies to use for redteam generation.
525
+ `)),Ie}}const MEMORY_POISONING_PLUGIN_ID="agentic:memory-poisoning",DEFAULT_NUM_TESTS_PER_PLUGIN=5,FOUNDATION_PLUGINS=["ascii-smuggling","beavertails","bias:gender","contracts","cyberseceval","donotanswer","divergent-repetition","excessive-agency","hallucination","harmful:chemical-biological-weapons","harmful:child-exploitation","harmful:copyright-violations","harmful:cybercrime","harmful:cybercrime:malicious-code","harmful:graphic-content","harmful:harassment-bullying","harmful:hate","harmful:illegal-activities","harmful:illegal-drugs","harmful:illegal-drugs:meth","harmful:indiscriminate-weapons","harmful:insults","harmful:intellectual-property","harmful:misinformation-disinformation","harmful:non-violent-crime","harmful:profanity","harmful:radicalization","harmful:self-harm","harmful:sex-crime","harmful:sexual-content","harmful:specialized-advice","harmful:unsafe-practices","harmful:violent-crime","harmful:weapons:ied","hijacking","imitation","overreliance","pii:direct","pliny","politics","religion"],AGENTIC_PLUGINS=[MEMORY_POISONING_PLUGIN_ID],COLLECTIONS=["default","foundation","harmful","pii"],UNALIGNED_PROVIDER_HARM_PLUGINS={"harmful:child-exploitation":"Child Exploitation","harmful:hate":"Hate","harmful:indiscriminate-weapons":"Indiscriminate Weapons","harmful:non-violent-crime":"Non-Violent Crimes","harmful:self-harm":"Self-Harm","harmful:sex-crime":"Sex Crimes","harmful:sexual-content":"Sexual Content","harmful:violent-crime":"Violent Crimes","harmful:chemical-biological-weapons":"Chemical & Biological Weapons","harmful:copyright-violations":"Copyright Violations - Copyrighted text","harmful:cybercrime":"Cybercrime & Unauthorized Intrusion - Hacking and Malware","harmful:graphic-content":"Graphic & age-restricted content","harmful:harassment-bullying":"Harassment & Bullying","harmful:illegal-activities":"Illegal Activities - Fraud & scams","harmful:illegal-drugs":"Illegal Drugs","harmful:unsafe-practices":"Promotion of unsafe practices","harmful:insults":"Insults and personal attacks","harmful:profanity":"Requests containing profanity","harmful:radicalization":"Radicalization","harmful:illegal-drugs:meth":"Methamphetamine","harmful:weapons:ied":"Improvised Explosive Devices","harmful:cybercrime:malicious-code":"Malicious Code"},REDTEAM_PROVIDER_HARM_PLUGINS={"harmful:intellectual-property":"Intellectual Property violation","harmful:privacy":"Privacy violations"},HARM_PLUGINS={"harmful:misinformation-disinformation":"Misinformation & Disinformation - Harmful lies and propaganda","harmful:specialized-advice":"Specialized Advice - Financial",...UNALIGNED_PROVIDER_HARM_PLUGINS,...REDTEAM_PROVIDER_HARM_PLUGINS},PII_PLUGINS=["pii:api-db","pii:direct","pii:session","pii:social"],BASE_PLUGINS=["contracts","excessive-agency","hallucination","hijacking","politics"],ADDITIONAL_PLUGINS=["ascii-smuggling","beavertails","bfla","bola","bias:gender","cca","competitors","cross-session-leak","cyberseceval","debug-access","divergent-repetition","donotanswer","harmbench","imitation","indirect-prompt-injection","mcp","overreliance","pliny","prompt-extraction","rag-document-exfiltration","rag-poisoning","rbac","reasoning-dos","religion","shell-injection","sql-injection","ssrf","system-prompt-override","tool-discovery:multi-turn","tool-discovery","unsafebench","xstest"],CONFIG_REQUIRED_PLUGINS=["intent","policy"],DEFAULT_PLUGINS=new Set([...[...BASE_PLUGINS,...Object.keys(HARM_PLUGINS),...PII_PLUGINS].sort()]),ALL_PLUGINS=[...new Set([...DEFAULT_PLUGINS,...ADDITIONAL_PLUGINS,...CONFIG_REQUIRED_PLUGINS,...AGENTIC_PLUGINS])].sort(),FRAMEWORK_NAMES={"mitre:atlas":"MITRE ATLAS","nist:ai:measure":"NIST AI RMF","owasp:api":"OWASP API Top 10","owasp:llm":"OWASP LLM Top 10","owasp:agentic":"OWASP Agentic v1.0","eu:ai-act":"EU AI Act"},OWASP_LLM_TOP_10_NAMES=["Prompt Injection","Sensitive Information Disclosure","Supply Chain","Improper Output Handling","Insecure Output Handling","Excessive Agency","System Prompt Leakage","Vector and Embedding Weaknesses","Misinformation","Unbounded Consumption"],OWASP_API_TOP_10_NAMES=["Broken Object Level Authorization","Broken Authentication","Broken Object Property Level Authorization","Unrestricted Resource Consumption","Broken Function Level Authorization","Unrestricted Access to Sensitive Business Flows","Server Side Request Forgery","Security Misconfiguration","Improper Inventory Management","Unsafe Consumption of APIs"],OWASP_LLM_TOP_10_MAPPING={"owasp:llm:01":{plugins:["ascii-smuggling","indirect-prompt-injection","prompt-extraction","harmful"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:02":{plugins:["pii:api-db","pii:direct","pii:session","pii:social","harmful:privacy","cross-session-leak","prompt-extraction"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:03":{plugins:[],strategies:[]},"owasp:llm:04":{plugins:["harmful:misinformation-disinformation","harmful:hate","bias:gender","harmful:radicalization","harmful:specialized-advice"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:05":{plugins:["shell-injection","sql-injection","ssrf","debug-access"],strategies:["jailbreak","prompt-injection"]},"owasp:llm:06":{plugins:["excessive-agency","rbac","bfla","bola","shell-injection","sql-injection","ssrf"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:07":{plugins:["prompt-extraction","rbac","harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:08":{plugins:["cross-session-leak","harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:09":{plugins:["hallucination","overreliance","harmful:misinformation-disinformation","harmful:specialized-advice"],strategies:["jailbreak","prompt-injection","jailbreak:composite"]},"owasp:llm:10":{plugins:["divergent-repetition","reasoning-dos"],strategies:[]}},OWASP_API_TOP_10_MAPPING={"owasp:api:01":{plugins:["bola","rbac"],strategies:[]},"owasp:api:02":{plugins:["bfla","rbac"],strategies:[]},"owasp:api:03":{plugins:["excessive-agency","overreliance"],strategies:[]},"owasp:api:04":{plugins:["harmful:privacy","pii:api-db","pii:session"],strategies:[]},"owasp:api:05":{plugins:["bfla","bola","rbac"],strategies:[]},"owasp:api:06":{plugins:["harmful:misinformation-disinformation","overreliance"],strategies:[]},"owasp:api:07":{plugins:["shell-injection","sql-injection"],strategies:[]},"owasp:api:08":{plugins:["harmful:privacy","pii:api-db","pii:session"],strategies:[]},"owasp:api:09":{plugins:["harmful:specialized-advice","overreliance"],strategies:[]},"owasp:api:10":{plugins:["debug-access","harmful:privacy"],strategies:[]}},OWASP_AGENTIC_REDTEAM_MAPPING={"owasp:agentic:t01":{plugins:[MEMORY_POISONING_PLUGIN_ID],strategies:[]}},OWASP_LLM_RED_TEAM_MAPPING={"owasp:llm:redteam:model":{plugins:[...FOUNDATION_PLUGINS],strategies:["jailbreak","jailbreak:tree","jailbreak:composite","crescendo","goat","prompt-injection","best-of-n","multilingual"]},"owasp:llm:redteam:implementation":{plugins:[...PII_PLUGINS,"prompt-extraction","harmful:privacy","rbac","bfla","bola","ascii-smuggling"],strategies:["jailbreak","jailbreak:tree","jailbreak:composite","prompt-injection","hex","base64","homoglyph","leetspeak","morse","piglatin","rot13"]},"owasp:llm:redteam:system":{plugins:["shell-injection","sql-injection","ssrf","debug-access","tool-discovery","indirect-prompt-injection","hijacking"],strategies:["jailbreak","jailbreak:tree","jailbreak:composite","crescendo","goat","multilingual","pandamonium","gcg"]},"owasp:llm:redteam:runtime":{plugins:["excessive-agency","overreliance","pliny","competitors","imitation","politics","religion","harmful:radicalization","harmful:self-harm","harmful:hate"],strategies:["crescendo","goat","jailbreak:tree","jailbreak:composite","prompt-injection"]}},NIST_AI_RMF_MAPPING={"nist:ai:measure:1.1":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:1.2":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:2.1":{plugins:["harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:[]},"nist:ai:measure:2.2":{plugins:["harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:[]},"nist:ai:measure:2.3":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:2.4":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:2.5":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:2.6":{plugins:["harmful:chemical-biological-weapons","harmful:indiscriminate-weapons","harmful:unsafe-practices"],strategies:[]},"nist:ai:measure:2.7":{plugins:["harmful:cybercrime","shell-injection","sql-injection"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:2.8":{plugins:["bfla","bola","rbac"],strategies:[]},"nist:ai:measure:2.9":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:2.10":{plugins:["harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social"],strategies:[]},"nist:ai:measure:2.11":{plugins:["harmful:harassment-bullying","harmful:hate","harmful:insults"],strategies:[]},"nist:ai:measure:2.12":{plugins:[],strategies:[]},"nist:ai:measure:2.13":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:3.1":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:["jailbreak","prompt-injection"]},"nist:ai:measure:3.2":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:3.3":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:4.1":{plugins:["excessive-agency"],strategies:[]},"nist:ai:measure:4.2":{plugins:["excessive-agency","harmful:misinformation-disinformation"],strategies:[]},"nist:ai:measure:4.3":{plugins:["excessive-agency"],strategies:[]}},MITRE_ATLAS_MAPPING={"mitre:atlas:exfiltration":{plugins:["ascii-smuggling","harmful:privacy","indirect-prompt-injection","pii:api-db","pii:direct","pii:session","pii:social","prompt-extraction"],strategies:[]},"mitre:atlas:impact":{plugins:["excessive-agency","harmful","hijacking","imitation"],strategies:["crescendo"]},"mitre:atlas:initial-access":{plugins:["debug-access","harmful:cybercrime","shell-injection","sql-injection","ssrf"],strategies:["base64","jailbreak","leetspeak","prompt-injection","rot13"]},"mitre:atlas:ml-attack-staging":{plugins:["ascii-smuggling","excessive-agency","hallucination","indirect-prompt-injection"],strategies:["jailbreak","jailbreak:tree"]},"mitre:atlas:reconnaissance":{plugins:["competitors","policy","prompt-extraction","rbac"],strategies:["multilingual"]},"mitre:atlas:resource-development":{plugins:["harmful:cybercrime","harmful:illegal-drugs","harmful:indiscriminate-weapons"],strategies:[]}},EU_AI_ACT_MAPPING={"eu:ai-act:art5:subliminal-manipulation":{plugins:["hijacking","intent","excessive-agency"],strategies:["jailbreak","jailbreak:tree","jailbreak:composite","prompt-injection"]},"eu:ai-act:art5:exploitation-of-vulnerabilities":{plugins:["hijacking","imitation","harmful:misinformation-disinformation"],strategies:[]},"eu:ai-act:art5:social-scoring":{plugins:["harmful:misinformation-disinformation","overreliance"],strategies:[]},"eu:ai-act:art5:biometric-categorisation":{plugins:["pii:direct","pii:session","harmful:privacy"],strategies:[]},"eu:ai-act:art5:remote-biometric-id-live":{plugins:["pii:session","pii:direct","harmful:privacy"],strategies:[]},"eu:ai-act:art5:remote-biometric-id-post":{plugins:["pii:api-db","pii:direct","harmful:privacy"],strategies:[]},"eu:ai-act:annex3:biometric-id":{plugins:["pii:direct","pii:session","harmful:privacy"],strategies:[]},"eu:ai-act:annex3:critical-infrastructure":{plugins:["shell-injection","sql-injection","ssrf","excessive-agency"],strategies:["jailbreak","prompt-injection"]},"eu:ai-act:annex3:education":{plugins:["harmful:misinformation-disinformation","hallucination","overreliance"],strategies:[]},"eu:ai-act:annex3:employment":{plugins:["imitation","pii:direct","overreliance"],strategies:[]},"eu:ai-act:annex3:essential-services":{plugins:["pii:direct","pii:session","excessive-agency"],strategies:[]},"eu:ai-act:annex3:law-enforcement":{plugins:["pii:direct","pii:api-db","harmful:privacy"],strategies:[]},"eu:ai-act:annex3:migration-border":{plugins:["pii:direct","harmful:hate","harmful:privacy"],strategies:[]},"eu:ai-act:annex3:justice-democracy":{plugins:["hallucination","harmful:misinformation-disinformation","pii:direct"],strategies:[]}},ALIASED_PLUGINS=["mitre:atlas","nist:ai","nist:ai:measure","owasp:api","owasp:llm","owasp:llm:redteam:model","owasp:llm:redteam:implementation","owasp:llm:redteam:system","owasp:llm:redteam:runtime","toxicity","bias","misinformation","illegal-activity","personal-safety","eu:ai-act",...Object.keys(MITRE_ATLAS_MAPPING),...Object.keys(NIST_AI_RMF_MAPPING),...Object.keys(OWASP_API_TOP_10_MAPPING),...Object.keys(OWASP_LLM_TOP_10_MAPPING),...Object.keys(OWASP_AGENTIC_REDTEAM_MAPPING),...Object.keys(EU_AI_ACT_MAPPING)],ALIASED_PLUGIN_MAPPINGS={"mitre:atlas":MITRE_ATLAS_MAPPING,"nist:ai:measure":NIST_AI_RMF_MAPPING,"owasp:api":OWASP_API_TOP_10_MAPPING,"owasp:llm":OWASP_LLM_TOP_10_MAPPING,"owasp:llm:redteam":OWASP_LLM_RED_TEAM_MAPPING,"owasp:agentic:redteam":OWASP_AGENTIC_REDTEAM_MAPPING,"eu:ai-act":EU_AI_ACT_MAPPING,toxicity:{toxicity:{plugins:["harmful:hate","harmful:harassment-bullying","harmful:insults","harmful:profanity","harmful:graphic-content","harmful:sexual-content"],strategies:[]}},bias:{bias:{plugins:["politics","religion","bias:gender"],strategies:[]}},misinformation:{misinformation:{plugins:["harmful:misinformation-disinformation","hallucination","harmful:radicalization","imitation"],strategies:[]}},"illegal-activity":{"illegal-activity":{plugins:["harmful:violent-crime","harmful:non-violent-crime","harmful:sex-crime","harmful:cybercrime","harmful:illegal-activities","harmful:illegal-drugs","harmful:illegal-drugs:meth","harmful:chemical-biological-weapons","harmful:indiscriminate-weapons","harmful:weapons:ied"],strategies:[]}}},FRAMEWORK_COMPLIANCE_IDS=["mitre:atlas","nist:ai:measure","owasp:api","owasp:llm","eu:ai-act"],DEFAULT_STRATEGIES=["basic","jailbreak","jailbreak:composite"],MULTI_TURN_STRATEGIES=["crescendo","goat"],AGENTIC_STRATEGIES=["crescendo","goat","jailbreak","jailbreak:tree","pandamonium"],ADDITIONAL_STRATEGIES=["audio","base64","best-of-n","citation","crescendo","gcg","goat","hex","homoglyph","image","jailbreak:likert","jailbreak:tree","leetspeak","math-prompt","morse","multilingual","pandamonium","piglatin","prompt-injection","retry","rot13","video"],STRATEGY_COLLECTIONS=["other-encodings"],_ALL_STRATEGIES=["default",...DEFAULT_STRATEGIES,...ADDITIONAL_STRATEGIES,...STRATEGY_COLLECTIONS],ALL_STRATEGIES=[..._ALL_STRATEGIES].sort(),subCategoryDescriptions={[MEMORY_POISONING_PLUGIN_ID]:"Tests whether an agent is vulnerable to memory poisoning attacks","ascii-smuggling":"Tests vulnerability to Unicode tag-based instruction smuggling attacks",audio:"Tests handling of audio content",base64:"Tests handling of Base64-encoded malicious payloads",basic:"Original plugin tests without any additional strategies or optimizations",beavertails:"Tests handling of malicious prompts from the BeaverTails dataset","best-of-n":"Jailbreak technique published by Anthropic and Stanford",bfla:"Tests for broken function-level authorization vulnerabilities (OWASP API 5)","bias:gender":"Tests handling of gender bias, stereotypes, and discrimination",bola:"Tests for broken object-level authorization vulnerabilities (OWASP API 1)",cca:"Tests for vulnerability to Context Compliance Attacks using fabricated conversation history",citation:"Exploits academic authority bias to bypass content filters",competitors:"Tests for unauthorized competitor mentions and endorsements",contracts:"Tests for unauthorized contractual commitments and legal exposure",crescendo:"Multi-turn attack strategy that gradually escalates malicious intent","cross-session-leak":"Tests for information leakage between user sessions",cyberseceval:"Tests prompt injection attacks from Meta's CyberSecEval dataset","debug-access":"Tests for exposed debugging interfaces and commands",default:"Standard security testing plugins","divergent-repetition":"Tests for training data leaks through repetitive pattern exploitation that causes model divergence",donotanswer:"Tests for vulnerabilities to Do Not Answer attacks","excessive-agency":"Tests for unauthorized actions beyond defined system boundaries",foundation:"Tests a collection of plugins designed to run against foundation models",gcg:"Greedy Coordinate Gradient adversarial suffix attack",goat:"Dynamic multi-turn attack generation using adversarial techniques",hallucination:"Tests for fabrication of false or misleading information",harmbench:"Tests for harmful content using the HarmBench dataset",harmful:"Tests handling of malicious content across multiple categories","harmful:chemical-biological-weapons":"Tests handling of WMD-related content","harmful:child-exploitation":"Tests handling of child exploitation content","harmful:copyright-violations":"Tests handling of intellectual property violations","harmful:cybercrime":"Tests handling of cybercrime-related content","harmful:cybercrime:malicious-code":"Tests creation of malicious code","harmful:graphic-content":"Tests handling of graphic or violent content","harmful:harassment-bullying":"Tests handling of harassment and bullying content","harmful:hate":"Tests handling of hate speech and discriminatory content","harmful:illegal-activities":"Tests handling of general illegal activities","harmful:illegal-drugs":"Tests handling of illegal drug-related content","harmful:illegal-drugs:meth":"Tests handling of methamphetamine-related content","harmful:indiscriminate-weapons":"Tests handling of weapons-related content","harmful:insults":"Tests handling of personal attacks and insults","harmful:intellectual-property":"Tests handling of IP theft and violations","harmful:misinformation-disinformation":"Tests handling of false information campaigns","harmful:non-violent-crime":"Tests handling of non-violent criminal content","harmful:privacy":"Tests handling of privacy violation attempts","harmful:profanity":"Tests handling of profane or inappropriate language","harmful:radicalization":"Tests handling of extremist content and recruitment","harmful:self-harm":"Tests handling of self-harm and suicide content","harmful:sex-crime":"Tests handling of sexual crime content","harmful:sexual-content":"Tests handling of explicit sexual content","harmful:specialized-advice":"Tests handling of unauthorized professional advice","harmful:unsafe-practices":"Tests handling of dangerous activity instructions","harmful:violent-crime":"Tests handling of violent crime content","harmful:weapons:ied":"Tests handling of Improvised Explosive Devices",hex:"Tests handling of hex-encoded malicious payloads",hijacking:"Tests for unauthorized resource usage and purpose deviation",homoglyph:"Tests handling of homoglyph (visually similar Unicode characters) encoding to bypass filters",image:"Tests handling of image content",imitation:"Tests for unauthorized impersonation of entities","indirect-prompt-injection":"Tests for injection vulnerabilities via untrusted variables",intent:"Tests for manipulation of system behavior via specific prompts",jailbreak:"Single-shot optimization of safety bypass techniques","jailbreak:composite":"Combines multiple jailbreak techniques for enhanced effectiveness","jailbreak:likert":"Uses Likert scale-based prompts to bypass content filters","jailbreak:tree":"Tree-based search for optimal safety bypass vectors",leetspeak:"Tests handling of leetspeak-encoded malicious content","math-prompt":"Tests handling of mathematical notation-based attacks",morse:"Tests handling of content encoded in Morse code to potentially bypass filters",multilingual:"Tests handling of attacks across multiple languages",mcp:"Tests for vulnerabilities to Model Context Protocol (MCP) attacks",overreliance:"Tests for overreliance on system assumptions",pandamonium:"[Experimental] Promptfoo's blackbox jailbreak. The latest and greatest jailbreak techniques, expertly tuned and crafted by Promptfoo's AI team.",pii:"Tests handling of personal identifiable information","pii:api-db":"Tests for PII exposure via API/database access","pii:direct":"Tests for direct PII exposure vulnerabilities","pii:session":"Tests for PII exposure in session data","pii:social":"Tests for PII exposure via social engineering",piglatin:"Tests handling of content translated to Pig Latin to potentially bypass filters",pliny:"Tests handling of Pliny prompt injections",policy:"Tests compliance with custom security policies",politics:"Tests handling of political content and bias","prompt-extraction":"Tests for system prompt disclosure vulnerabilities","prompt-injection":"Tests for direct prompt injection vulnerabilities","rag-document-exfiltration":"Tests for RAG document exfiltration","rag-poisoning":"Tests for vulnerabilities to RAG retrieval poisoning attacks",rbac:"Tests role-based access control implementation","reasoning-dos":"Tests for vulnerabilities to computational resource exhaustion through excessive reasoning patterns",religion:"Tests handling of religious content and bias",retry:"Automatically incorporates previously failed test cases to build a regression testing suite",rot13:"Tests handling of ROT13-encoded malicious content","shell-injection":"Tests for command injection vulnerabilities","sql-injection":"Tests for SQL injection vulnerabilities",ssrf:"Tests for server-side request forgery vulnerabilities","system-prompt-override":"Tests for system prompt override vulnerabilities","tool-discovery":"Tests for enumeration of available tools and function calls","tool-discovery:multi-turn":"Uses conversational approach to discover available tools, functions, and capabilities through multi-step interactions",unsafebench:"Tests handling of unsafe image content from the UnsafeBench dataset",xstest:"Tests for XSTest attacks",video:"Tests handling of video content","other-encodings":"Collection of alternative text transformation strategies (Morse code and Pig Latin) for testing evasion techniques"},displayNameOverrides={[MEMORY_POISONING_PLUGIN_ID]:"Agentic Memory Poisoning","ascii-smuggling":"ASCII Smuggling",audio:"Audio Content",base64:"Base64 Payload Encoding",basic:"Baseline Testing",beavertails:"BeaverTails Dataset","best-of-n":"Best-of-N",bfla:"Function-Level Authorization Bypass",bola:"Object-Level Authorization Bypass",cca:"Context Compliance Attack",citation:"Authority Bias Exploitation",competitors:"Competitors",contracts:"Unauthorized Commitments",crescendo:"Multi-Turn Crescendo","cross-session-leak":"Cross-Session Data Leakage",cyberseceval:"CyberSecEval Dataset","debug-access":"Debug Interface Exposure",default:"Standard Security Suite","divergent-repetition":"Divergent Repetition",donotanswer:"Do Not Answer Dataset","excessive-agency":"Excessive Agency",foundation:"Foundation Model Plugin Collection",gcg:"Greedy Coordinate Gradient",mcp:"Model Context Protocol",goat:"Generative Offensive Agent Tester",hallucination:"False Information (Hallucination)",harmbench:"HarmBench Dataset",harmful:"Malicious Content Suite","bias:gender":"Gender Bias","harmful:chemical-biological-weapons":"WMD Content","harmful:child-exploitation":"Child Exploitation","harmful:copyright-violations":"IP Violations","harmful:cybercrime":"Cybercrime","harmful:cybercrime:malicious-code":"Malicious Code","harmful:graphic-content":"Graphic Content","harmful:harassment-bullying":"Harassment","harmful:hate":"Hate Speech","harmful:illegal-activities":"Illegal Activity","harmful:illegal-drugs":"Drug-Related Content","harmful:illegal-drugs:meth":"Methamphetamine Content","harmful:indiscriminate-weapons":"Weapons Content","harmful:insults":"Personal Attacks","harmful:intellectual-property":"IP Theft","harmful:misinformation-disinformation":"Disinformation Campaigns","harmful:non-violent-crime":"Non-Violent Crime","harmful:privacy":"Privacy Violation","harmful:profanity":"Profanity","harmful:radicalization":"Extremist Content","harmful:self-harm":"Self-Harm","harmful:sex-crime":"Sexual Crime Content","harmful:sexual-content":"Explicit Content","harmful:specialized-advice":"Unauthorized Advice","harmful:unsafe-practices":"Dangerous Activity Content","harmful:violent-crime":"Violent Crime Content","harmful:weapons:ied":"Improvised Explosive Devices",hex:"Hex Encoding",hijacking:"Resource Hijacking",homoglyph:"Homoglyph Encoding",image:"Image Content",imitation:"Entity Impersonation","indirect-prompt-injection":"Indirect Prompt Injection",intent:"Intent",jailbreak:"Single-shot Optimization","jailbreak:composite":"Multi-Vector Safety Bypass","jailbreak:likert":"Likert Scale Jailbreak","jailbreak:tree":"Tree-Based Attack Search",leetspeak:"Leetspeak Payload Encoding","math-prompt":"Mathematical Notation Attack",morse:"Morse Code Encoding",multilingual:"Cross-Language Attack","other-encodings":"Collection of Text Encodings",overreliance:"Overreliance",pandamonium:"[Experimental] Pandamonium",piglatin:"Pig Latin Encoding",pii:"PII Protection Suite","pii:api-db":"PII via API/Database","pii:direct":"PII via Direct Exposure","pii:session":"PII via Session Data","pii:social":"PII via Social Engineering",pliny:"Pliny Prompt Injections",policy:"Policy Compliance",politics:"Political Bias","prompt-extraction":"System Prompt Disclosure","prompt-injection":"Direct Prompt Injection","rag-document-exfiltration":"RAG Document Exfiltration","rag-poisoning":"RAG Poisoning",rbac:"RBAC Implementation","reasoning-dos":"Reasoning DoS",religion:"Religious Bias",retry:"Regression Testing",rot13:"ROT13 Payload Encoding","shell-injection":"Command Injection","sql-injection":"SQL Injection",ssrf:"SSRF Vulnerability","system-prompt-override":"System Prompt Override","tool-discovery":"Tool Discovery","tool-discovery:multi-turn":"Multi-turn Tool Discovery",unsafebench:"UnsafeBench Dataset",xstest:"XSTest Dataset",video:"Video Content"};var Severity=(t=>(t.Critical="critical",t.High="high",t.Medium="medium",t.Low="low",t))(Severity||{});const severityDisplayNames={critical:"Critical",high:"High",medium:"Medium",low:"Low"},riskCategorySeverityMap={[MEMORY_POISONING_PLUGIN_ID]:"high","ascii-smuggling":"low",beavertails:"low",bfla:"high",bola:"high",cca:"high",mcp:"high",competitors:"low",contracts:"medium","cross-session-leak":"medium",cyberseceval:"medium",donotanswer:"medium","debug-access":"high",default:"low","divergent-repetition":"medium","excessive-agency":"medium",foundation:"medium",hallucination:"medium",harmbench:"medium",harmful:"medium","bias:gender":"low","harmful:chemical-biological-weapons":"high","harmful:child-exploitation":"critical","harmful:copyright-violations":"low","harmful:cybercrime":"low","harmful:cybercrime:malicious-code":"low","harmful:graphic-content":"medium","harmful:harassment-bullying":"low","harmful:hate":"critical","harmful:illegal-activities":"medium","harmful:illegal-drugs":"medium","harmful:illegal-drugs:meth":"low","harmful:indiscriminate-weapons":"medium","harmful:insults":"low","harmful:intellectual-property":"medium","harmful:misinformation-disinformation":"medium","harmful:non-violent-crime":"medium","harmful:privacy":"high","harmful:profanity":"low","harmful:radicalization":"low","harmful:self-harm":"critical","harmful:sex-crime":"high","harmful:sexual-content":"medium","harmful:specialized-advice":"medium","harmful:unsafe-practices":"low","harmful:violent-crime":"high","harmful:weapons:ied":"low",hijacking:"high",imitation:"low","indirect-prompt-injection":"high",intent:"high",overreliance:"low",pii:"high","pii:api-db":"high","pii:direct":"high","pii:session":"high","pii:social":"high",pliny:"medium",policy:"high",politics:"low","prompt-extraction":"medium","rag-document-exfiltration":"medium","rag-poisoning":"medium",rbac:"high","reasoning-dos":"low",religion:"low","shell-injection":"high","sql-injection":"high",ssrf:"high","system-prompt-override":"high","tool-discovery:multi-turn":"low","tool-discovery":"low",unsafebench:"medium",xstest:"low"},riskCategories={"Security & Access Control":["agentic:memory-poisoning","ascii-smuggling","bfla","bola","debug-access","hijacking","indirect-prompt-injection","rbac","shell-injection","sql-injection","ssrf","tool-discovery","tool-discovery:multi-turn","cross-session-leak","divergent-repetition","harmful:privacy","pii:api-db","pii:direct","pii:session","pii:social","pii","prompt-extraction",MEMORY_POISONING_PLUGIN_ID],"Compliance & Legal":["contracts","harmful:chemical-biological-weapons","harmful:copyright-violations","harmful:cybercrime:malicious-code","harmful:cybercrime","harmful:illegal-activities","harmful:illegal-drugs:meth","harmful:illegal-drugs","harmful:indiscriminate-weapons","harmful:intellectual-property","harmful:non-violent-crime","harmful:sex-crime","harmful:specialized-advice","harmful:unsafe-practices","harmful:violent-crime","harmful:weapons:ied"],"Trust & Safety":["bias:gender","harmful:child-exploitation","harmful:graphic-content","harmful:harassment-bullying","harmful:hate","harmful:insults","harmful:profanity","harmful:radicalization","harmful:self-harm","harmful:sexual-content"],Brand:["competitors","excessive-agency","hallucination","harmful:misinformation-disinformation","hijacking","imitation","intent","overreliance","policy","politics","religion"],Datasets:["beavertails","cyberseceval","donotanswer","harmbench","pliny","unsafebench","xstest"]},categoryDescriptions={"Security & Access Control":"Data protection, access control, and system security risks.","Compliance & Legal":"Regulatory compliance, legal, and policy violation risks.","Trust & Safety":"Harmful, inappropriate, or offensive content generation risks.",Brand:"Output reliability, accuracy, and brand reputation risks.",Datasets:"Pre-defined test cases from research datasets."};Object.entries(riskCategories).reduce((t,[Ae,xe])=>(xe.forEach(Ee=>{t[Ee]=Ae}),t),{});const categoryAliases={[MEMORY_POISONING_PLUGIN_ID]:"AgenticMemoryPoisoning","ascii-smuggling":"AsciiSmuggling",beavertails:"BeaverTails",bfla:"BFLAEnforcement",bola:"BOLAEnforcement",cca:"CCAEnforcement",competitors:"CompetitorEndorsement",contracts:"ContractualCommitment","cross-session-leak":"CrossSessionLeak",cyberseceval:"CyberSecEval",donotanswer:"DoNotAnswer","debug-access":"DebugAccess",default:"Default",mcp:"MCP","divergent-repetition":"DivergentRepetition","excessive-agency":"ExcessiveAgency","tool-discovery":"ToolDiscovery","tool-discovery:multi-turn":"Multi-turn Tool Discovery",foundation:"Foundation",hallucination:"Hallucination",harmbench:"Harmbench",harmful:"Harmful","bias:gender":"Gender Bias","harmful:chemical-biological-weapons":"Chemical & Biological Weapons","harmful:child-exploitation":"Child Exploitation","harmful:copyright-violations":"Copyright Violations - Copyrighted text","harmful:cybercrime":"Cybercrime & Unauthorized Intrusion - Hacking and Malware","harmful:cybercrime:malicious-code":"Malicious Code","harmful:graphic-content":"Graphic & age-restricted content","harmful:harassment-bullying":"Harassment & Bullying","harmful:hate":"Hate","harmful:illegal-activities":"Illegal Activities - Fraud & scams","harmful:illegal-drugs":"Illegal Drugs","harmful:illegal-drugs:meth":"Methamphetamine","harmful:indiscriminate-weapons":"Indiscriminate Weapons","harmful:insults":"Insults and personal attacks","harmful:intellectual-property":"Intellectual Property violation","harmful:misinformation-disinformation":"Misinformation & Disinformation - Harmful lies and propaganda","harmful:non-violent-crime":"Non-Violent Crimes","harmful:privacy":"Privacy violations","harmful:profanity":"Requests containing profanity","harmful:radicalization":"Radicalization","harmful:self-harm":"Self-Harm","harmful:sex-crime":"Sex Crimes","harmful:sexual-content":"Sexual Content","harmful:specialized-advice":"Specialized Advice - Financial","harmful:unsafe-practices":"Promotion of unsafe practices","harmful:violent-crime":"Violent Crimes","harmful:weapons:ied":"Improvised Explosive Devices",hijacking:"Hijacking",imitation:"Imitation","indirect-prompt-injection":"Indirect Prompt Injection",intent:"Intent",overreliance:"Overreliance",pii:"PIILeak","pii:api-db":"PIILeak","pii:direct":"PIILeak","pii:session":"PIILeak","pii:social":"PIILeak",pliny:"Pliny",policy:"PolicyViolation",politics:"PoliticalStatement","prompt-extraction":"PromptExtraction","rag-document-exfiltration":"RAG Document Exfiltration","rag-poisoning":"RAG Poisoning",rbac:"RbacEnforcement","reasoning-dos":"Reasoning DoS",religion:"Religion","shell-injection":"ShellInjection","sql-injection":"SqlInjection",ssrf:"SSRFEnforcement","system-prompt-override":"System Prompt Override",unsafebench:"UnsafeBench",xstest:"XSTest"},categoryAliasesReverse=Object.entries(categoryAliases).reduce((t,[Ae,xe])=>(t[xe]=Ae,t),{}),strategyDescriptions={audio:"Tests detection and handling of audio-based malicious payloads",base64:"Tests detection and handling of Base64-encoded malicious payloads",basic:"Equivalent to no strategy. Always included. Can be disabled in configuration.","best-of-n":"Jailbreak technique published by Anthropic and Stanford",citation:"Exploits academic authority bias to circumvent content filtering mechanisms",crescendo:"Executes progressive multi-turn attacks with escalating malicious intent",default:"Applies standard security testing methodology",gcg:"Greedy Coordinate Gradient adversarial suffix attack",goat:"Deploys dynamic attack generation using advanced adversarial techniques",hex:"Tests detection and handling of hex-encoded malicious payloads",homoglyph:"Tests detection and handling of text with homoglyphs (visually similar Unicode characters)",image:"Tests detection and handling of image-based malicious payloads",jailbreak:"Optimizes single-turn attacks to bypass security controls","jailbreak:composite":"Chains multiple attack vectors for enhanced effectiveness","jailbreak:likert":"Uses Likert scale-based prompts to bypass content filters","jailbreak:tree":"Implements tree-based search for optimal attack paths",leetspeak:"Assesses handling of leetspeak-encoded malicious content","math-prompt":"Tests resilience against mathematical notation-based attacks",morse:"Tests detection and handling of text encoded in Morse code where letters are converted to dots and dashes to potentially bypass content filters",multilingual:"Evaluates cross-language attack vector handling","other-encodings":"Collection of alternative text transformation strategies (Morse code and Pig Latin) for testing evasion techniques",pandamonium:"Promptfoo's exclusive dynamic jailbreak strategy currently in development. Note: This is an expensive jailbreak strategy with no limit on probes.",piglatin:'Tests detection and handling of text transformed into Pig Latin, a language game where initial consonant clusters are moved to the end of words with "ay" added',"prompt-injection":"Tests direct prompt injection vulnerability detection",retry:"Automatically incorporates previously failed test cases to prevent regression",rot13:"Assesses handling of ROT13-encoded malicious payloads",video:"Tests detection and handling of video-based malicious payloads"},strategyDisplayNames={audio:"Audio",base64:"Base64 Encoding",basic:"Basic","best-of-n":"Best-of-N",citation:"Authority Bias",crescendo:"Multi-turn Crescendo",default:"Basic",gcg:"Greedy Coordinate Gradient",goat:"Generative Offensive Agent Tester",hex:"Hex Encoding",homoglyph:"Homoglyph Encoding",image:"Image",jailbreak:"Single-shot Optimization","jailbreak:composite":"Composite Jailbreaks","jailbreak:likert":"Likert Scale Jailbreak","jailbreak:tree":"Tree-based Optimization",leetspeak:"Leetspeak Encoding","math-prompt":"Mathematical Encoding",morse:"Morse Code",multilingual:"Multilingual Translation","other-encodings":"Collection of Text Encodings",pandamonium:"Pandamonium",piglatin:"Pig Latin","prompt-injection":"Prompt Injection",retry:"Regression Testing",rot13:"ROT13 Encoding",video:"Video"},PLUGIN_PRESET_DESCRIPTIONS={Custom:"Choose your own plugins",Foundation:"Plugins for redteaming foundation models recommended by Promptfoo","Minimal Test":"Minimal set of plugins to validate your setup",MITRE:"MITRE ATLAS framework",NIST:"NIST AI Risk Management Framework","OWASP API Top 10":"OWASP API security vulnerabilities framework","OWASP LLM Top 10":"OWASP LLM security vulnerabilities framework","OWASP Gen AI Red Team":"OWASP Gen AI Red Teaming Best Practices","OWASP Agentic AI Top 10":"OWASP Agentic AI Top 10 Threats and Mitigations",RAG:"Recommended plugins plus additional tests for RAG specific scenarios like access control",Recommended:"A broad set of plugins recommended by Promptfoo","EU AI Act":"Plugins mapped to EU AI Act prohibited & high-risk requirements"},pluginOptions=[...COLLECTIONS,...ALL_PLUGINS,...ALIASED_PLUGINS].sort(),RedteamPluginObjectSchema=z$2.object({id:z$2.union([z$2.enum(pluginOptions).superRefine((t,Ae)=>{pluginOptions.includes(t)||Ae.addIssue({code:z$2.ZodIssueCode.invalid_enum_value,options:pluginOptions,received:t,message:`Invalid plugin name. Must be one of: ${pluginOptions.join(", ")} (or a path starting with file://)`})}),z$2.string().startsWith("file://",{message:"Custom plugins must start with file:// (or use one of the built-in plugins)"})]).describe("Name of the plugin"),numTests:z$2.number().int().positive().default(DEFAULT_NUM_TESTS_PER_PLUGIN).describe("Number of tests to generate for this plugin"),config:z$2.record(z$2.unknown()).optional().describe("Plugin-specific configuration")}),RedteamPluginSchema=z$2.union([z$2.union([z$2.enum(pluginOptions).superRefine((t,Ae)=>{pluginOptions.includes(t)||Ae.addIssue({code:z$2.ZodIssueCode.invalid_enum_value,options:pluginOptions,received:t,message:`Invalid plugin name. Must be one of: ${pluginOptions.join(", ")} (or a path starting with file://)`})}),z$2.string().startsWith("file://",{message:"Custom plugins must start with file:// (or use one of the built-in plugins)"})]).describe("Name of the plugin or path to custom plugin"),RedteamPluginObjectSchema]),strategyIdSchema=z$2.union([z$2.enum(ALL_STRATEGIES).superRefine((t,Ae)=>{ALL_STRATEGIES.includes(t)||Ae.addIssue({code:z$2.ZodIssueCode.invalid_enum_value,options:[...ALL_STRATEGIES],received:t,message:`Invalid strategy name. Must be one of: ${[...ALL_STRATEGIES].join(", ")} (or a path starting with file://)`})}),z$2.string().refine(t=>t.startsWith("file://")&&isJavascriptFile(t),{message:`Custom strategies must start with file:// and end with .js or .ts, or use one of the built-in strategies: ${[...ALL_STRATEGIES].join(", ")}`})]).describe("Name of the strategy"),RedteamStrategySchema=z$2.union([strategyIdSchema,z$2.object({id:strategyIdSchema,config:z$2.record(z$2.unknown()).optional().describe("Strategy-specific configuration")})]);z$2.object({addPlugins:z$2.array(z$2.enum(ADDITIONAL_PLUGINS)).optional().describe("Additional plugins to include"),addStrategies:z$2.array(z$2.enum(ADDITIONAL_STRATEGIES)).optional().describe("Additional strategies to include"),cache:z$2.boolean().describe("Whether to use caching"),config:z$2.string().optional().describe("Path to the configuration file"),defaultConfig:z$2.record(z$2.unknown()).describe("Default configuration object"),defaultConfigPath:z$2.string().optional().describe("Path to the default configuration file"),delay:z$2.number().int().nonnegative().optional().describe("Delay in milliseconds between plugin API calls"),envFile:z$2.string().optional().describe("Path to the environment file"),force:z$2.boolean().describe("Whether to force generation").default(!1),injectVar:z$2.string().optional().describe("Variable to inject"),language:z$2.string().optional().describe("Language of tests to generate"),maxConcurrency:z$2.number().int().positive().optional().describe("Maximum number of concurrent API calls"),numTests:z$2.number().int().positive().optional().describe("Number of tests to generate"),output:z$2.string().optional().describe("Output file path"),plugins:z$2.array(RedteamPluginObjectSchema).optional().describe("Plugins to use"),provider:z$2.string().optional().describe("Provider to use"),purpose:z$2.string().optional().describe("Purpose of the redteam generation"),strategies:z$2.array(RedteamStrategySchema).optional().describe("Strategies to use"),write:z$2.boolean().describe("Whether to write the output"),burpEscapeJson:z$2.boolean().describe("Whether to escape quotes in Burp payloads").optional(),progressBar:z$2.boolean().describe("Whether to show a progress bar").optional()});const RedteamConfigSchema=z$2.object({injectVar:z$2.string().optional().describe("Variable to inject. Can be a string or array of strings. If string, it's transformed to an array. Inferred from the prompts by default."),purpose:z$2.string().optional().describe("Purpose override string - describes the prompt templates"),provider:ProviderSchema.optional().describe("Provider used for generating adversarial inputs"),numTests:z$2.number().int().positive().optional().describe("Number of tests to generate"),language:z$2.string().optional().describe("Language of tests ot generate for this plugin"),entities:z$2.array(z$2.string()).optional().describe("Names of people, brands, or organizations related to your LLM application"),plugins:z$2.array(RedteamPluginSchema).describe("Plugins to use for redteam generation").default(["default"]),strategies:z$2.array(RedteamStrategySchema).describe(dedent`Strategies to use for redteam generation.
526
526
 
527
527
  Defaults to ${DEFAULT_STRATEGIES.join(", ")}
528
528
  Supports ${ALL_STRATEGIES.join(", ")}
529
- `).optional().default(["default"]),maxConcurrency:z$2.number().int().positive().optional().describe("Maximum number of concurrent API calls"),delay:z$2.number().int().nonnegative().optional().describe("Delay in milliseconds between plugin API calls"),excludeTargetOutputFromAgenticAttackGeneration:z$2.boolean().optional().describe("Whether to exclude target output from the agentific attack generation process")}).transform(t=>{const Ae=new Map,xe=new Set,Ee=(Te,Pe,ke)=>{const $e=`${Te}:${JSON.stringify(Pe)}`,Oe={id:Te};(ke!==void 0||t.numTests!==void 0)&&(Oe.numTests=ke??t.numTests),Pe!==void 0&&(Oe.config=Pe),Ae.set($e,Oe)},Se=(Te,Pe,ke)=>{(Array.isArray(Te)?Te:Array.from(Te)).forEach($e=>{const Oe=Ae.get(`${$e}:${JSON.stringify(Pe)}`);(!Oe||Oe.numTests===void 0)&&Ee($e,Pe,ke)})},Ce=(Te,Pe,ke)=>{Te==="foundation"?Se([...FOUNDATION_PLUGINS],Pe,ke):Te==="harmful"?Se(Object.keys(HARM_PLUGINS),Pe,ke):Te==="pii"?Se([...PII_PLUGINS],Pe,ke):Te==="default"&&Se([...DEFAULT_PLUGINS],Pe,ke)},_e=Te=>{const Pe=typeof Te=="string"?{id:Te,numTests:t.numTests,config:void 0}:{...Te,numTests:Te.numTests??t.numTests};if(ALIASED_PLUGIN_MAPPINGS[Pe.id])Object.values(ALIASED_PLUGIN_MAPPINGS[Pe.id]).forEach(({plugins:ke,strategies:$e})=>{ke.forEach(Oe=>{COLLECTIONS.includes(Oe)?Ce(Oe,Pe.config,Pe.numTests):Ee(Oe,Pe.config,Pe.numTests)}),$e.forEach(Oe=>xe.add(Oe))});else if(COLLECTIONS.includes(Pe.id))Ce(Pe.id,Pe.config,Pe.numTests);else{const ke=Object.entries(ALIASED_PLUGIN_MAPPINGS).find(([,$e])=>Object.keys($e).includes(Pe.id));if(ke){const[,$e]=ke;$e[Pe.id].plugins.forEach(Oe=>{COLLECTIONS.includes(Oe)?Ce(Oe,Pe.config,Pe.numTests):Ee(Oe,Pe.config,Pe.numTests)}),$e[Pe.id].strategies.forEach(Oe=>xe.add(Oe))}else Ee(Pe.id,Pe.config,Pe.numTests)}};t.plugins.forEach(_e);const Ie=Array.from(Ae.values()).filter(Te=>!COLLECTIONS.includes(Te.id)).sort((Te,Pe)=>Te.id!==Pe.id?Te.id.localeCompare(Pe.id):JSON.stringify(Te.config||{}).localeCompare(JSON.stringify(Pe.config||{}))),Be=Array.from(new Map([...t.strategies||[],...Array.from(xe)].flatMap(Te=>typeof Te=="string"?Te==="basic"?[]:Te==="default"?DEFAULT_STRATEGIES.map(Pe=>[Pe,{id:Pe}]):[[Te,{id:Te}]]:[[Te.id,Te]])).values()).sort((Te,Pe)=>{const ke=typeof Te=="string"?Te:Te.id,$e=typeof Pe=="string"?Pe:Pe.id;return ke.localeCompare($e)});return{numTests:t.numTests,plugins:Ie,strategies:Be,...t.delay?{delay:t.delay}:{},...t.entities?{entities:t.entities}:{},...t.injectVar?{injectVar:t.injectVar}:{},...t.language?{language:t.language}:{},...t.provider?{provider:t.provider}:{},...t.purpose?{purpose:t.purpose}:{},...t.excludeTargetOutputFromAgenticAttackGeneration?{excludeTargetOutputFromAgenticAttackGeneration:t.excludeTargetOutputFromAgenticAttackGeneration}:{}}});function isProviderOptions(t){return typeof t=="object"&&t!=null&&"id"in t&&typeof t.id=="string"}const CommandLineOptionsSchema=z$2.object({description:z$2.string().optional(),prompts:z$2.array(z$2.string()).optional(),providers:z$2.array(z$2.string()),output:z$2.array(z$2.string()),maxConcurrency:z$2.coerce.number().int().positive().optional(),repeat:z$2.coerce.number().int().positive().optional(),delay:z$2.coerce.number().int().nonnegative().default(0),vars:z$2.string().optional(),tests:z$2.string().optional(),config:z$2.array(z$2.string()).optional(),assertions:z$2.string().optional(),modelOutputs:z$2.string().optional(),verbose:z$2.boolean().optional(),grader:z$2.string().optional(),tableCellMaxLength:z$2.coerce.number().int().positive().optional(),write:z$2.boolean().optional(),cache:z$2.boolean().optional(),table:z$2.boolean().optional(),share:z$2.boolean().optional(),progressBar:z$2.boolean().optional(),watch:z$2.boolean().optional(),filterErrorsOnly:z$2.string().optional(),filterFailing:z$2.string().optional(),filterFirstN:z$2.coerce.number().int().positive().optional(),filterMetadata:z$2.string().optional(),filterPattern:z$2.string().optional(),filterProviders:z$2.string().optional(),filterSample:z$2.coerce.number().int().positive().optional(),filterTargets:z$2.string().optional(),var:z$2.record(z$2.string()).optional(),generateSuggestions:z$2.boolean().optional(),promptPrefix:z$2.string().optional(),promptSuffix:z$2.string().optional(),envPath:z$2.string().optional()}),GradingConfigSchema=z$2.object({rubricPrompt:z$2.union([z$2.string(),z$2.array(z$2.string()),z$2.array(z$2.object({role:z$2.string(),content:z$2.string()}))]).optional(),provider:z$2.union([z$2.string(),z$2.any(),z$2.record(z$2.string(),z$2.union([z$2.string(),z$2.any()])).optional()]).optional(),factuality:z$2.object({subset:z$2.number().optional(),superset:z$2.number().optional(),agree:z$2.number().optional(),disagree:z$2.number().optional(),differButFactual:z$2.number().optional()}).optional()}),OutputConfigSchema=z$2.object({postprocess:z$2.string().optional(),transform:z$2.string().optional(),transformVars:z$2.string().optional(),storeOutputAs:z$2.string().optional()}),EvaluateOptionsSchema=z$2.object({cache:z$2.boolean().optional(),delay:z$2.number().optional(),eventSource:z$2.string().optional(),generateSuggestions:z$2.boolean().optional(),interactiveProviders:z$2.boolean().optional(),maxConcurrency:z$2.number().optional(),progressCallback:z$2.function(z$2.tuple([z$2.number(),z$2.number(),z$2.number(),z$2.custom(),z$2.custom()]),z$2.void()).optional(),repeat:z$2.number().optional(),showProgressBar:z$2.boolean().optional(),timeoutMs:z$2.number().optional()}),PromptMetricsSchema=z$2.object({score:z$2.number(),testPassCount:z$2.number(),testFailCount:z$2.number(),testErrorCount:z$2.number(),assertPassCount:z$2.number(),assertFailCount:z$2.number(),totalLatencyMs:z$2.number(),tokenUsage:TokenUsageSchema,namedScores:z$2.record(z$2.string(),z$2.number()),namedScoresCount:z$2.record(z$2.string(),z$2.number()),redteam:z$2.object({pluginPassCount:z$2.record(z$2.string(),z$2.number()),pluginFailCount:z$2.record(z$2.string(),z$2.number()),strategyPassCount:z$2.record(z$2.string(),z$2.number()),strategyFailCount:z$2.record(z$2.string(),z$2.number())}).optional(),cost:z$2.number()}),CompletedPromptSchema=PromptSchema.extend({provider:z$2.string(),metrics:PromptMetricsSchema.optional()});var ResultFailureReason=(t=>(t[t.NONE=0]="NONE",t[t.ASSERT=1]="ASSERT",t[t.ERROR=2]="ERROR",t))(ResultFailureReason||{});const BaseAssertionTypesSchema=z$2.enum(["answer-relevance","bleu","classifier","contains","contains-all","contains-any","contains-json","contains-sql","contains-xml","context-faithfulness","context-recall","context-relevance","cost","equals","factuality","g-eval","gleu","guardrails","icontains","icontains-all","icontains-any","is-json","is-refusal","is-sql","is-valid-function-call","is-valid-openai-function-call","is-valid-openai-tools-call","is-xml","javascript","latency","levenshtein","llm-rubric","pi","meteor","model-graded-closedqa","model-graded-factuality","moderation","perplexity","perplexity-score","python","regex","rouge-n","similar","starts-with","webhook"]),SpecialAssertionTypesSchema=z$2.enum(["select-best","human"]),NotPrefixedAssertionTypesSchema=BaseAssertionTypesSchema.transform(t=>`not-${t}`),AssertionTypeSchema=z$2.union([BaseAssertionTypesSchema,NotPrefixedAssertionTypesSchema,SpecialAssertionTypesSchema,z$2.custom()]),AssertionSetSchema=z$2.object({type:z$2.literal("assert-set"),assert:z$2.array(z$2.lazy(()=>AssertionSchema)),weight:z$2.number().optional(),metric:z$2.string().optional(),threshold:z$2.number().optional(),config:z$2.record(z$2.string(),z$2.any()).optional()}),AssertionSchema=z$2.object({type:AssertionTypeSchema,value:z$2.custom().optional(),config:z$2.record(z$2.string(),z$2.any()).optional(),threshold:z$2.number().optional(),weight:z$2.number().optional(),provider:z$2.custom().optional(),rubricPrompt:z$2.custom().optional(),metric:z$2.string().optional(),transform:z$2.string().optional()}),TestCasesWithMetadataPromptSchema=z$2.object({prompt:CompletedPromptSchema,id:z$2.string(),evalId:z$2.string()}),ProviderPromptMapSchema=z$2.record(z$2.string(),z$2.union([z$2.string().transform(t=>[t]),z$2.array(z$2.string())])),MetadataSchema=z$2.record(z$2.string(),z$2.any()),VarsSchema=z$2.record(z$2.union([z$2.string(),z$2.number(),z$2.boolean(),z$2.array(z$2.union([z$2.string(),z$2.number(),z$2.boolean()])),z$2.record(z$2.string(),z$2.any()),z$2.array(z$2.any())])),TestCaseSchema=z$2.object({description:z$2.string().optional(),vars:VarsSchema.optional(),provider:z$2.union([z$2.string(),ProviderOptionsSchema,ApiProviderSchema]).optional(),providerOutput:z$2.union([z$2.string(),z$2.object({})]).optional(),assert:z$2.array(z$2.union([AssertionSetSchema,AssertionSchema])).optional(),assertScoringFunction:z$2.union([z$2.string().regex(new RegExp(`^file://.*\\.(${JAVASCRIPT_EXTENSIONS.join("|")}|py)(?::[\\w.]+)?$`)),z$2.custom()]).optional(),options:z$2.intersection(z$2.intersection(PromptConfigSchema,OutputConfigSchema),z$2.intersection(GradingConfigSchema,z$2.object({disableVarExpansion:z$2.boolean().optional(),disableConversationVar:z$2.boolean().optional(),runSerially:z$2.boolean().optional()}))).optional(),threshold:z$2.number().optional(),metadata:z$2.intersection(MetadataSchema,z$2.object({pluginConfig:z$2.custom().optional(),strategyConfig:z$2.custom().optional()})).optional()});TestCaseSchema.extend({vars:z$2.union([VarsSchema,z$2.string(),z$2.array(z$2.string())]).optional()});z$2.object({id:z$2.string(),testCases:z$2.union([z$2.string(),z$2.array(z$2.union([z$2.string(),TestCaseSchema]))]),recentEvalDate:z$2.date(),recentEvalId:z$2.string(),count:z$2.number(),prompts:z$2.array(TestCasesWithMetadataPromptSchema)});const ScenarioSchema=z$2.object({description:z$2.string().optional(),config:z$2.array(TestCaseSchema.partial()),tests:z$2.array(TestCaseSchema)});TestCaseSchema.extend({vars:z$2.record(z$2.union([z$2.string(),z$2.object({})])).optional()}).strict();const DerivedMetricSchema=z$2.object({name:z$2.string(),value:z$2.union([z$2.string(),z$2.function().args(z$2.record(z$2.string(),z$2.number()),z$2.custom()).returns(z$2.number())])});z$2.object({tags:z$2.record(z$2.string(),z$2.string()).optional(),description:z$2.string().optional(),providers:z$2.array(ApiProviderSchema),prompts:z$2.array(PromptSchema),providerPromptMap:ProviderPromptMapSchema.optional(),tests:z$2.array(TestCaseSchema).optional(),scenarios:z$2.array(ScenarioSchema).optional(),defaultTest:TestCaseSchema.partial().optional(),nunjucksFilters:NunjucksFilterMapSchema.optional(),env:ProviderEnvOverridesSchema.optional(),derivedMetrics:z$2.array(DerivedMetricSchema).optional(),extensions:z$2.array(z$2.string().refine(t=>t.startsWith("file://"),{message:"Extension must start with file://"}).refine(t=>{const Ae=t.split(":");return Ae.length===3&&Ae.every(xe=>xe.trim()!=="")},{message:"Extension must be of the form file://path/to/file.py:function_name"}).refine(t=>{const Ae=t.split(":");return(Ae[1].endsWith(".py")||isJavascriptFile(Ae[1]))&&(Ae.length===3||Ae.length===2)},{message:"Extension must be a python (.py) or javascript (.js, .ts, .mjs, .cjs, etc.) file followed by a colon and function name"})).nullable().optional(),redteam:z$2.custom().optional()});const TestSuiteConfigSchema=z$2.object({tags:z$2.record(z$2.string(),z$2.string()).optional(),description:z$2.string().optional(),providers:ProvidersSchema,prompts:z$2.union([z$2.string(),z$2.array(z$2.union([z$2.string(),z$2.object({id:z$2.string(),label:z$2.string().optional(),raw:z$2.string().optional()}),PromptSchema])),z$2.record(z$2.string(),z$2.string())]),tests:z$2.union([z$2.string(),z$2.array(z$2.union([z$2.string(),TestCaseSchema]))]).optional(),scenarios:z$2.array(z$2.union([z$2.string(),ScenarioSchema])).optional(),defaultTest:TestCaseSchema.partial().omit({description:!0}).optional(),outputPath:z$2.union([z$2.string(),z$2.array(z$2.string())]).optional(),sharing:z$2.union([z$2.boolean(),z$2.object({apiBaseUrl:z$2.string().optional(),appBaseUrl:z$2.string().optional()})]).optional(),nunjucksFilters:z$2.record(z$2.string(),z$2.string()).optional(),env:z$2.union([ProviderEnvOverridesSchema,z$2.record(z$2.string(),z$2.union([z$2.string(),z$2.number().transform(t=>String(t)),z$2.boolean().transform(t=>String(t))]))]).optional(),derivedMetrics:z$2.array(DerivedMetricSchema).optional(),extensions:z$2.array(z$2.string()).nullable().optional(),metadata:MetadataSchema.optional(),redteam:RedteamConfigSchema.optional(),writeLatestResults:z$2.boolean().optional()});TestSuiteConfigSchema.extend({evaluateOptions:EvaluateOptionsSchema.optional(),commandLineOptions:CommandLineOptionsSchema.partial().optional(),providers:ProvidersSchema.optional(),targets:ProvidersSchema.optional()}).refine(t=>{const Ae=!!t.targets,xe=!!t.providers;return Ae&&!xe||!Ae&&xe},{message:"Exactly one of 'targets' or 'providers' must be provided, but not both"}).transform(t=>(t.targets&&!t.providers&&(t.providers=t.targets,delete t.targets),(t.extensions===null||t.extensions===void 0||Array.isArray(t.extensions)&&t.extensions.length===0)&&delete t.extensions,t));z$2.enum(["csv","html","json","jsonl","txt","yaml","yml"]);function invariant(t,Ae){if(t)return;const xe="Invariant failed",Ee=typeof Ae=="function"?Ae():Ae,Se=Ee?`${xe}: ${Ee}`:xe;throw new Error(Se)}const DEFAULT_SEMANTIC_SIMILARITY_THRESHOLD=.8;let _assertionRegex=null;function getAssertionRegex(){if(!_assertionRegex){const t=BaseAssertionTypesSchema.options.join("|");_assertionRegex=new RegExp(`^(not-)?(${t})(?:\\((\\d+(?:\\.\\d+)?)\\))?(?::([\\s\\S]*))?$`)}return _assertionRegex}function assertionFromString(t){var xe,Ee;if(t.startsWith("javascript:")||t.startsWith("fn:")||t.startsWith("eval:")||t.startsWith("file://")&&isJavascriptFile(t.slice(7))){let Se=0;return t.startsWith("javascript:")&&(Se=11),t.startsWith("fn:")&&(Se=3),t.startsWith("eval:")&&(Se=5),{type:"javascript",value:t.slice(Se).trim()}}if(t.startsWith("grade:")||t.startsWith("llm-rubric:"))return{type:"llm-rubric",value:t.slice(t.startsWith("grade:")?6:11)};if(t.startsWith("python:")||t.startsWith("file://")&&(t.endsWith(".py")||t.includes(".py:"))){const Se=(t.startsWith("python:"),7);return{type:"python",value:t.slice(Se).trim()}}const Ae=t.match(getAssertionRegex());if(Ae){const[Se,Ce,_e,Ie,Be]=Ae,Te=Ce?`not-${_e}`:_e,Pe=Ie?Number.parseFloat(Ie):Number.NaN,ke=Number.isFinite(Pe)?Pe:void 0;if(_e==="contains-all"||_e==="contains-any"||_e==="icontains-all"||_e==="icontains-any")return{type:Te,value:Be&&Be.split(",").map($e=>$e.trim())};if(_e==="contains-json"||_e==="is-json")return{type:Te,value:Be};if(_e==="answer-relevance"||_e==="classifier"||_e==="context-faithfulness"||_e==="context-recall"||_e==="context-relevance"||_e==="cost"||_e==="latency"||_e==="levenshtein"||_e==="perplexity-score"||_e==="perplexity"||_e==="rouge-n"||_e==="similar"||_e==="starts-with"){const $e=_e==="similar"?DEFAULT_SEMANTIC_SIMILARITY_THRESHOLD:.75;return{type:Te,value:(xe=Be==null?void 0:Be.trim)==null?void 0:xe.call(Be),threshold:ke??$e}}else return{type:Te,value:(Ee=Be==null?void 0:Be.trim)==null?void 0:Ee.call(Be)}}return{type:"equals",value:t}}const uniqueErrorMessages=new Set;function testCaseFromCsvRow(t){const Ae={},xe=[],Ee={},Se={};let Ce,_e,Ie,Be;const Te=["expected","prefix","suffix","description","providerOutput","metric","threshold","metadata"].map(ke=>`_${ke}`),Pe=Object.entries(t).map(([ke,$e])=>[ke.trim(),$e]);for(const[ke,$e]of Pe){if(!ke.startsWith("__")&&Te.some(Oe=>ke.startsWith(Oe))&&!uniqueErrorMessages.has(ke)){const Oe=`You used a single underscore for the key "${ke}". Did you mean to use "${ke.replace("_","__")}" instead?`;uniqueErrorMessages.add(ke),logger.warn(Oe)}if(ke.startsWith("__expected"))$e.trim()!==""&&xe.push(assertionFromString($e.trim()));else if(ke==="__prefix")Ee.prefix=$e;else if(ke==="__suffix")Ee.suffix=$e;else if(ke==="__description")_e=$e;else if(ke==="__providerOutput")Ce=$e;else if(ke==="__metric")Ie=$e;else if(ke==="__threshold")Be=Number.parseFloat($e);else if(ke.startsWith("__metadata:")){const Oe=ke.slice(11);if(Oe.endsWith("[]")){const Ue=Oe.slice(0,-2);if($e.trim()!==""){const qe=$e.split(new RegExp("(?<!\\\\),")).map(ze=>ze.trim()).map(ze=>ze.replace("\\,",","));Se[Ue]=qe}}else $e.trim()!==""&&(Se[Oe]=$e)}else Ae[ke]=$e}for(const ke of xe)ke.metric=Ie;return{vars:Ae,assert:xe,options:Ee,..._e?{description:_e}:{},...Ce?{providerOutput:Ce}:{},...Be?{threshold:Be}:{},...Object.keys(Se).length>0?{metadata:Se}:{}}}const assertTypes=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","is-xml","contains-xml","is-sql","contains-sql","similar","llm-rubric","pi","model-graded-closedqa","factuality","webhook","bleu","rouge-n","g-eval","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","is-valid-function-call","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"],AssertsForm=({onAdd:t,initialValues:Ae})=>{const[xe,Ee]=reactExports.useState(Ae||[]),Se=()=>{const _e=[...xe,{type:"equals",value:""}];Ee(_e),t(_e)},Ce=_e=>{const Ie=xe.filter((Be,Te)=>Te!==_e);Ee(Ie),t(Ie)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Asserts"}),jsxRuntimeExports.jsx(Box,{my:xe.length>0?2:0,children:jsxRuntimeExports.jsx(Stack,{direction:"column",spacing:2,children:xe.map((_e,Ie)=>jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:2,alignItems:"center",children:[jsxRuntimeExports.jsx(Autocomplete,{value:_e.type,options:assertTypes,sx:{minWidth:200},onChange:(Be,Te)=>{const Pe=Te,ke=xe.map(($e,Oe)=>Oe===Ie?{...$e,type:Pe}:$e);Ee(ke),t(ke)},renderInput:Be=>jsxRuntimeExports.jsx(TextField,{...Be,label:"Type"})}),jsxRuntimeExports.jsx(TextField,{label:"Value",value:_e.value,fullWidth:!0,onChange:Be=>{const Te=Be.target.value,Pe=xe.map((ke,$e)=>$e===Ie?{...ke,value:Te}:ke);Ee(Pe),t(Pe)}}),jsxRuntimeExports.jsx(IconButton,{onClick:()=>Ce(Ie),size:"small",children:jsxRuntimeExports.jsx(DeleteIcon,{})})]},Ie))})}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:Se,children:"Add Assert"})]})},VarsForm=({onAdd:t,varsList:Ae,initialValues:xe})=>{const[Ee,Se]=React.useState(xe||{});return reactExports.useEffect(()=>{const Ce={};Ae.forEach(_e=>{Ce[_e]=(xe==null?void 0:xe[_e])||""}),Se(Ce)},[Ae,xe]),jsxRuntimeExports.jsxs(Box,{my:2,children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",mb:2,children:"Vars"}),Ae.length>0?jsxRuntimeExports.jsx(Stack,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(Ee).map((Ce,_e)=>jsxRuntimeExports.jsx(Stack,{direction:"row",spacing:2,alignItems:"center",children:jsxRuntimeExports.jsx(TextField,{placeholder:Ce,label:Ce,value:Ee[Ce],fullWidth:!0,onChange:Ie=>{const Be=Ie.target.value,Te={...Ee,[Ce]:Be};Se(Te),t(Te)}})},_e))}):jsxRuntimeExports.jsxs(Typography,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},TestCaseForm=({open:t,onAdd:Ae,varsList:xe,initialValues:Ee,onCancel:Se})=>{const[Ce,_e]=reactExports.useState((Ee==null?void 0:Ee.description)||""),[Ie,Be]=reactExports.useState((Ee==null?void 0:Ee.vars)||{}),[Te,Pe]=reactExports.useState((Ee==null?void 0:Ee.assert)||[]),[ke,$e]=reactExports.useState(0);React.useEffect(()=>{Ee?(_e(Ee.description||""),Be(Ee.vars||{}),Pe(Ee.assert||[])):(_e(""),Be({}),Pe([]))},[Ee]);const Oe=Ue=>{Ae({description:Ce,vars:Ie,assert:Te},Ue),Ue&&Se(),_e(""),Be({}),Pe([]),$e(qe=>qe+1)};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Se,fullWidth:!0,maxWidth:"md",children:[jsxRuntimeExports.jsx(DialogTitle,{children:Ee?"Edit Test Case":"Add Test Case"}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(VarsForm,{onAdd:Ue=>Be(Ue),varsList:xe,initialValues:Ee==null?void 0:Ee.vars}),jsxRuntimeExports.jsx(AssertsForm,{onAdd:Ue=>Pe(Ue),initialValues:((Ee==null?void 0:Ee.assert)||[]).filter(Ue=>Ue.type!=="assert-set")||[]},ke)]})}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Oe.bind(void 0,!0),color:"primary",variant:"contained",children:Ee?"Update Test Case":"Add Test Case"}),!Ee&&jsxRuntimeExports.jsx(Button,{onClick:Oe.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),jsxRuntimeExports.jsx(Button,{onClick:Se,color:"secondary",children:"Cancel"})]})]})},TestCasesSection=({varsList:t})=>{const{testCases:Ae,setTestCases:xe}=useStore$1(),[Ee,Se]=React.useState(null),[Ce,_e]=React.useState(!1),[Ie,Be]=React.useState(!1),[Te,Pe]=React.useState(null),ke=(Ve,Ge)=>{if(Ee===null)xe([...Ae,Ve]);else{const Xe=Ae.map((er,tr)=>tr===Ee?Ve:er);xe(Xe),Se(null)}Ge&&_e(!1)},$e=Ve=>{var Xe;Ve.stopPropagation(),Ve.preventDefault();const Ge=(Xe=Ve.target.files)==null?void 0:Xe[0];if(Ge){const er=new FileReader;er.onload=async tr=>{var sr,dr;const nr=(dr=(sr=tr.target)==null?void 0:sr.result)==null?void 0:dr.toString();if(nr){const{parse:ar}=await __vitePreload(async()=>{const{parse:Me}=await import("./sync-CL_B8KZP.js");return{parse:Me}},[]),Ke=ar(nr,{columns:!0}).map(Me=>testCaseFromCsvRow(Me));xe([...Ae,...Ke])}},er.readAsText(Ge)}},Oe=(Ve,Ge)=>{Ve.stopPropagation(),Pe(Ge),Be(!0)},Ue=()=>{Te!==null&&(xe(Ae.filter((Ve,Ge)=>Ge!==Te)),Pe(null)),Be(!1)},qe=()=>{Pe(null),Be(!1)},ze=(Ve,Ge)=>{Ve.stopPropagation();const Xe=JSON.parse(JSON.stringify(Ae[Ge]));xe([...Ae,Xe])};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:2,mb:2,justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Typography,{variant:"h5",children:"Test Cases"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("label",{htmlFor:"file-input-add-test-case",children:jsxRuntimeExports.jsx(Tooltip$2,{title:"Upload test cases from csv",children:jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(IconButton,{component:"span",children:jsxRuntimeExports.jsx(Publish,{})}),jsxRuntimeExports.jsx("input",{id:"file-input-add-test-case",type:"file",accept:".csv",onChange:$e,style:{display:"none"}})]})})}),Ae.length===0&&jsxRuntimeExports.jsx(Button,{color:"secondary",onClick:()=>{const Ve={description:"Fun animal adventure story",vars:{animal:"penguin",location:"tropical island"},assert:[{type:"contains-any",value:["penguin","adventure","tropical","island"]},{type:"llm-rubric",value:`Is this a fun, child-friendly story featuring a penguin on a tropical island adventure?
529
+ `).optional().default(["default"]),maxConcurrency:z$2.number().int().positive().optional().describe("Maximum number of concurrent API calls"),delay:z$2.number().int().nonnegative().optional().describe("Delay in milliseconds between plugin API calls"),excludeTargetOutputFromAgenticAttackGeneration:z$2.boolean().optional().describe("Whether to exclude target output from the agentific attack generation process")}).transform(t=>{const Ae=new Map,xe=new Set,Ee=(Te,Pe,ke)=>{const $e=`${Te}:${JSON.stringify(Pe)}`,Oe={id:Te};(ke!==void 0||t.numTests!==void 0)&&(Oe.numTests=ke??t.numTests),Pe!==void 0&&(Oe.config=Pe),Ae.set($e,Oe)},Se=(Te,Pe,ke)=>{(Array.isArray(Te)?Te:Array.from(Te)).forEach($e=>{const Oe=Ae.get(`${$e}:${JSON.stringify(Pe)}`);(!Oe||Oe.numTests===void 0)&&Ee($e,Pe,ke)})},Ce=(Te,Pe,ke)=>{Te==="foundation"?Se([...FOUNDATION_PLUGINS],Pe,ke):Te==="harmful"?Se(Object.keys(HARM_PLUGINS),Pe,ke):Te==="pii"?Se([...PII_PLUGINS],Pe,ke):Te==="default"&&Se([...DEFAULT_PLUGINS],Pe,ke)},_e=Te=>{const Pe=typeof Te=="string"?{id:Te,numTests:t.numTests,config:void 0}:{...Te,numTests:Te.numTests??t.numTests};if(ALIASED_PLUGIN_MAPPINGS[Pe.id])Object.values(ALIASED_PLUGIN_MAPPINGS[Pe.id]).forEach(({plugins:ke,strategies:$e})=>{ke.forEach(Oe=>{COLLECTIONS.includes(Oe)?Ce(Oe,Pe.config,Pe.numTests):Ee(Oe,Pe.config,Pe.numTests)}),$e.forEach(Oe=>xe.add(Oe))});else if(COLLECTIONS.includes(Pe.id))Ce(Pe.id,Pe.config,Pe.numTests);else{const ke=Object.entries(ALIASED_PLUGIN_MAPPINGS).find(([,$e])=>Object.keys($e).includes(Pe.id));if(ke){const[,$e]=ke;$e[Pe.id].plugins.forEach(Oe=>{COLLECTIONS.includes(Oe)?Ce(Oe,Pe.config,Pe.numTests):Ee(Oe,Pe.config,Pe.numTests)}),$e[Pe.id].strategies.forEach(Oe=>xe.add(Oe))}else Ee(Pe.id,Pe.config,Pe.numTests)}};t.plugins.forEach(_e);const Ie=Array.from(Ae.values()).filter(Te=>!COLLECTIONS.includes(Te.id)).sort((Te,Pe)=>Te.id!==Pe.id?Te.id.localeCompare(Pe.id):JSON.stringify(Te.config||{}).localeCompare(JSON.stringify(Pe.config||{}))),Be=Array.from(new Map([...t.strategies||[],...Array.from(xe)].flatMap(Te=>typeof Te=="string"?Te==="basic"?[]:Te==="default"?DEFAULT_STRATEGIES.map(Pe=>[Pe,{id:Pe}]):[[Te,{id:Te}]]:[[Te.id,Te]])).values()).sort((Te,Pe)=>{const ke=typeof Te=="string"?Te:Te.id,$e=typeof Pe=="string"?Pe:Pe.id;return ke.localeCompare($e)});return{numTests:t.numTests,plugins:Ie,strategies:Be,...t.delay?{delay:t.delay}:{},...t.entities?{entities:t.entities}:{},...t.injectVar?{injectVar:t.injectVar}:{},...t.language?{language:t.language}:{},...t.provider?{provider:t.provider}:{},...t.purpose?{purpose:t.purpose}:{},...t.excludeTargetOutputFromAgenticAttackGeneration?{excludeTargetOutputFromAgenticAttackGeneration:t.excludeTargetOutputFromAgenticAttackGeneration}:{}}});function isProviderOptions(t){return typeof t=="object"&&t!=null&&"id"in t&&typeof t.id=="string"}const CommandLineOptionsSchema=z$2.object({description:z$2.string().optional(),prompts:z$2.array(z$2.string()).optional(),providers:z$2.array(z$2.string()),output:z$2.array(z$2.string()),maxConcurrency:z$2.coerce.number().int().positive().optional(),repeat:z$2.coerce.number().int().positive().optional(),delay:z$2.coerce.number().int().nonnegative().default(0),vars:z$2.string().optional(),tests:z$2.string().optional(),config:z$2.array(z$2.string()).optional(),assertions:z$2.string().optional(),modelOutputs:z$2.string().optional(),verbose:z$2.boolean().optional(),grader:z$2.string().optional(),tableCellMaxLength:z$2.coerce.number().int().positive().optional(),write:z$2.boolean().optional(),cache:z$2.boolean().optional(),table:z$2.boolean().optional(),share:z$2.boolean().optional(),progressBar:z$2.boolean().optional(),watch:z$2.boolean().optional(),filterErrorsOnly:z$2.string().optional(),filterFailing:z$2.string().optional(),filterFirstN:z$2.coerce.number().int().positive().optional(),filterMetadata:z$2.string().optional(),filterPattern:z$2.string().optional(),filterProviders:z$2.string().optional(),filterSample:z$2.coerce.number().int().positive().optional(),filterTargets:z$2.string().optional(),var:z$2.record(z$2.string()).optional(),generateSuggestions:z$2.boolean().optional(),promptPrefix:z$2.string().optional(),promptSuffix:z$2.string().optional(),envPath:z$2.string().optional()}),GradingConfigSchema=z$2.object({rubricPrompt:z$2.union([z$2.string(),z$2.array(z$2.string()),z$2.array(z$2.object({role:z$2.string(),content:z$2.string()}))]).optional(),provider:z$2.union([z$2.string(),z$2.any(),z$2.record(z$2.string(),z$2.union([z$2.string(),z$2.any()])).optional()]).optional(),factuality:z$2.object({subset:z$2.number().optional(),superset:z$2.number().optional(),agree:z$2.number().optional(),disagree:z$2.number().optional(),differButFactual:z$2.number().optional()}).optional()}),OutputConfigSchema=z$2.object({postprocess:z$2.string().optional(),transform:z$2.string().optional(),transformVars:z$2.string().optional(),storeOutputAs:z$2.string().optional()}),EvaluateOptionsSchema=z$2.object({cache:z$2.boolean().optional(),delay:z$2.number().optional(),eventSource:z$2.string().optional(),generateSuggestions:z$2.boolean().optional(),interactiveProviders:z$2.boolean().optional(),maxConcurrency:z$2.number().optional(),progressCallback:z$2.function(z$2.tuple([z$2.number(),z$2.number(),z$2.number(),z$2.custom(),z$2.custom()]),z$2.void()).optional(),repeat:z$2.number().optional(),showProgressBar:z$2.boolean().optional(),timeoutMs:z$2.number().optional()}),PromptMetricsSchema=z$2.object({score:z$2.number(),testPassCount:z$2.number(),testFailCount:z$2.number(),testErrorCount:z$2.number(),assertPassCount:z$2.number(),assertFailCount:z$2.number(),totalLatencyMs:z$2.number(),tokenUsage:TokenUsageSchema,namedScores:z$2.record(z$2.string(),z$2.number()),namedScoresCount:z$2.record(z$2.string(),z$2.number()),redteam:z$2.object({pluginPassCount:z$2.record(z$2.string(),z$2.number()),pluginFailCount:z$2.record(z$2.string(),z$2.number()),strategyPassCount:z$2.record(z$2.string(),z$2.number()),strategyFailCount:z$2.record(z$2.string(),z$2.number())}).optional(),cost:z$2.number()}),CompletedPromptSchema=PromptSchema.extend({provider:z$2.string(),metrics:PromptMetricsSchema.optional()});var ResultFailureReason=(t=>(t[t.NONE=0]="NONE",t[t.ASSERT=1]="ASSERT",t[t.ERROR=2]="ERROR",t))(ResultFailureReason||{});const BaseAssertionTypesSchema=z$2.enum(["answer-relevance","bleu","classifier","contains","contains-all","contains-any","contains-json","contains-sql","contains-xml","context-faithfulness","context-recall","context-relevance","cost","equals","factuality","g-eval","gleu","guardrails","icontains","icontains-all","icontains-any","is-json","is-refusal","is-sql","is-valid-function-call","is-valid-openai-function-call","is-valid-openai-tools-call","is-xml","javascript","latency","levenshtein","llm-rubric","pi","meteor","model-graded-closedqa","model-graded-factuality","moderation","perplexity","perplexity-score","python","regex","rouge-n","similar","starts-with","webhook"]),SpecialAssertionTypesSchema=z$2.enum(["select-best","human"]),NotPrefixedAssertionTypesSchema=BaseAssertionTypesSchema.transform(t=>`not-${t}`),AssertionTypeSchema=z$2.union([BaseAssertionTypesSchema,NotPrefixedAssertionTypesSchema,SpecialAssertionTypesSchema,z$2.custom()]),AssertionSetSchema=z$2.object({type:z$2.literal("assert-set"),assert:z$2.array(z$2.lazy(()=>AssertionSchema)),weight:z$2.number().optional(),metric:z$2.string().optional(),threshold:z$2.number().optional(),config:z$2.record(z$2.string(),z$2.any()).optional()}),AssertionSchema=z$2.object({type:AssertionTypeSchema,value:z$2.custom().optional(),config:z$2.record(z$2.string(),z$2.any()).optional(),threshold:z$2.number().optional(),weight:z$2.number().optional(),provider:z$2.custom().optional(),rubricPrompt:z$2.custom().optional(),metric:z$2.string().optional(),transform:z$2.string().optional()}),TestCasesWithMetadataPromptSchema=z$2.object({prompt:CompletedPromptSchema,id:z$2.string(),evalId:z$2.string()}),ProviderPromptMapSchema=z$2.record(z$2.string(),z$2.union([z$2.string().transform(t=>[t]),z$2.array(z$2.string())])),MetadataSchema=z$2.record(z$2.string(),z$2.any()),VarsSchema=z$2.record(z$2.union([z$2.string(),z$2.number(),z$2.boolean(),z$2.array(z$2.union([z$2.string(),z$2.number(),z$2.boolean()])),z$2.record(z$2.string(),z$2.any()),z$2.array(z$2.any())])),TestCaseSchema=z$2.object({description:z$2.string().optional(),vars:VarsSchema.optional(),provider:z$2.union([z$2.string(),ProviderOptionsSchema,ApiProviderSchema]).optional(),providerOutput:z$2.union([z$2.string(),z$2.object({})]).optional(),assert:z$2.array(z$2.union([AssertionSetSchema,AssertionSchema])).optional(),assertScoringFunction:z$2.union([z$2.string().regex(new RegExp(`^file://.*\\.(${JAVASCRIPT_EXTENSIONS.join("|")}|py)(?::[\\w.]+)?$`)),z$2.custom()]).optional(),options:z$2.intersection(z$2.intersection(PromptConfigSchema,OutputConfigSchema),z$2.intersection(GradingConfigSchema,z$2.object({disableVarExpansion:z$2.boolean().optional(),disableConversationVar:z$2.boolean().optional(),runSerially:z$2.boolean().optional()}))).optional(),threshold:z$2.number().optional(),metadata:z$2.intersection(MetadataSchema,z$2.object({pluginConfig:z$2.custom().optional(),strategyConfig:z$2.custom().optional()})).optional()});TestCaseSchema.extend({vars:z$2.union([VarsSchema,z$2.string(),z$2.array(z$2.string())]).optional()});z$2.object({id:z$2.string(),testCases:z$2.union([z$2.string(),z$2.array(z$2.union([z$2.string(),TestCaseSchema]))]),recentEvalDate:z$2.date(),recentEvalId:z$2.string(),count:z$2.number(),prompts:z$2.array(TestCasesWithMetadataPromptSchema)});const ScenarioSchema=z$2.object({description:z$2.string().optional(),config:z$2.array(TestCaseSchema.partial()),tests:z$2.array(TestCaseSchema)});TestCaseSchema.extend({vars:z$2.record(z$2.union([z$2.string(),z$2.object({})])).optional()}).strict();const DerivedMetricSchema=z$2.object({name:z$2.string(),value:z$2.union([z$2.string(),z$2.function().args(z$2.record(z$2.string(),z$2.number()),z$2.custom()).returns(z$2.number())])});z$2.object({tags:z$2.record(z$2.string(),z$2.string()).optional(),description:z$2.string().optional(),providers:z$2.array(ApiProviderSchema),prompts:z$2.array(PromptSchema),providerPromptMap:ProviderPromptMapSchema.optional(),tests:z$2.array(TestCaseSchema).optional(),scenarios:z$2.array(ScenarioSchema).optional(),defaultTest:TestCaseSchema.partial().optional(),nunjucksFilters:NunjucksFilterMapSchema.optional(),env:ProviderEnvOverridesSchema.optional(),derivedMetrics:z$2.array(DerivedMetricSchema).optional(),extensions:z$2.array(z$2.string().refine(t=>t.startsWith("file://"),{message:"Extension must start with file://"}).refine(t=>{const Ae=t.split(":");return Ae.length===3&&Ae.every(xe=>xe.trim()!=="")},{message:"Extension must be of the form file://path/to/file.py:function_name"}).refine(t=>{const Ae=t.split(":");return(Ae[1].endsWith(".py")||isJavascriptFile(Ae[1]))&&(Ae.length===3||Ae.length===2)},{message:"Extension must be a python (.py) or javascript (.js, .ts, .mjs, .cjs, etc.) file followed by a colon and function name"})).nullable().optional(),redteam:z$2.custom().optional()});const TestSuiteConfigSchema=z$2.object({tags:z$2.record(z$2.string(),z$2.string()).optional(),description:z$2.string().optional(),providers:ProvidersSchema,prompts:z$2.union([z$2.string(),z$2.array(z$2.union([z$2.string(),z$2.object({id:z$2.string(),label:z$2.string().optional(),raw:z$2.string().optional()}),PromptSchema])),z$2.record(z$2.string(),z$2.string())]),tests:z$2.union([z$2.string(),z$2.array(z$2.union([z$2.string(),TestCaseSchema]))]).optional(),scenarios:z$2.array(z$2.union([z$2.string(),ScenarioSchema])).optional(),defaultTest:TestCaseSchema.partial().omit({description:!0}).optional(),outputPath:z$2.union([z$2.string(),z$2.array(z$2.string())]).optional(),sharing:z$2.union([z$2.boolean(),z$2.object({apiBaseUrl:z$2.string().optional(),appBaseUrl:z$2.string().optional()})]).optional(),nunjucksFilters:z$2.record(z$2.string(),z$2.string()).optional(),env:z$2.union([ProviderEnvOverridesSchema,z$2.record(z$2.string(),z$2.union([z$2.string(),z$2.number().transform(t=>String(t)),z$2.boolean().transform(t=>String(t))]))]).optional(),derivedMetrics:z$2.array(DerivedMetricSchema).optional(),extensions:z$2.array(z$2.string()).nullable().optional(),metadata:MetadataSchema.optional(),redteam:RedteamConfigSchema.optional(),writeLatestResults:z$2.boolean().optional()});TestSuiteConfigSchema.extend({evaluateOptions:EvaluateOptionsSchema.optional(),commandLineOptions:CommandLineOptionsSchema.partial().optional(),providers:ProvidersSchema.optional(),targets:ProvidersSchema.optional()}).refine(t=>{const Ae=!!t.targets,xe=!!t.providers;return Ae&&!xe||!Ae&&xe},{message:"Exactly one of 'targets' or 'providers' must be provided, but not both"}).transform(t=>(t.targets&&!t.providers&&(t.providers=t.targets,delete t.targets),(t.extensions===null||t.extensions===void 0||Array.isArray(t.extensions)&&t.extensions.length===0)&&delete t.extensions,t));z$2.enum(["csv","html","json","jsonl","txt","yaml","yml"]);function invariant(t,Ae){if(t)return;const xe="Invariant failed",Ee=typeof Ae=="function"?Ae():Ae,Se=Ee?`${xe}: ${Ee}`:xe;throw new Error(Se)}const DEFAULT_SEMANTIC_SIMILARITY_THRESHOLD=.8;let _assertionRegex=null;function getAssertionRegex(){if(!_assertionRegex){const t=BaseAssertionTypesSchema.options.join("|");_assertionRegex=new RegExp(`^(not-)?(${t})(?:\\((\\d+(?:\\.\\d+)?)\\))?(?::([\\s\\S]*))?$`)}return _assertionRegex}function assertionFromString(t){var xe,Ee;if(t.startsWith("javascript:")||t.startsWith("fn:")||t.startsWith("eval:")||t.startsWith("file://")&&isJavascriptFile(t.slice(7))){let Se=0;return t.startsWith("javascript:")&&(Se=11),t.startsWith("fn:")&&(Se=3),t.startsWith("eval:")&&(Se=5),{type:"javascript",value:t.slice(Se).trim()}}if(t.startsWith("grade:")||t.startsWith("llm-rubric:"))return{type:"llm-rubric",value:t.slice(t.startsWith("grade:")?6:11)};if(t.startsWith("python:")||t.startsWith("file://")&&(t.endsWith(".py")||t.includes(".py:"))){const Se=(t.startsWith("python:"),7);return{type:"python",value:t.slice(Se).trim()}}const Ae=t.match(getAssertionRegex());if(Ae){const[Se,Ce,_e,Ie,Be]=Ae,Te=Ce?`not-${_e}`:_e,Pe=Ie?Number.parseFloat(Ie):Number.NaN,ke=Number.isFinite(Pe)?Pe:void 0;if(_e==="contains-all"||_e==="contains-any"||_e==="icontains-all"||_e==="icontains-any")return{type:Te,value:Be&&Be.split(",").map($e=>$e.trim())};if(_e==="contains-json"||_e==="is-json")return{type:Te,value:Be};if(_e==="answer-relevance"||_e==="classifier"||_e==="context-faithfulness"||_e==="context-recall"||_e==="context-relevance"||_e==="cost"||_e==="latency"||_e==="levenshtein"||_e==="perplexity-score"||_e==="perplexity"||_e==="rouge-n"||_e==="similar"||_e==="starts-with"){const $e=_e==="similar"?DEFAULT_SEMANTIC_SIMILARITY_THRESHOLD:.75;return{type:Te,value:(xe=Be==null?void 0:Be.trim)==null?void 0:xe.call(Be),threshold:ke??$e}}else return{type:Te,value:(Ee=Be==null?void 0:Be.trim)==null?void 0:Ee.call(Be)}}return{type:"equals",value:t}}const uniqueErrorMessages=new Set;function testCaseFromCsvRow(t){const Ae={},xe=[],Ee={},Se={};let Ce,_e,Ie,Be;const Te=["expected","prefix","suffix","description","providerOutput","metric","threshold","metadata"].map(ke=>`_${ke}`),Pe=Object.entries(t).map(([ke,$e])=>[ke.trim(),$e]);for(const[ke,$e]of Pe){if(!ke.startsWith("__")&&Te.some(Oe=>ke.startsWith(Oe))&&!uniqueErrorMessages.has(ke)){const Oe=`You used a single underscore for the key "${ke}". Did you mean to use "${ke.replace("_","__")}" instead?`;uniqueErrorMessages.add(ke),logger.warn(Oe)}if(ke.startsWith("__expected"))$e.trim()!==""&&xe.push(assertionFromString($e.trim()));else if(ke==="__prefix")Ee.prefix=$e;else if(ke==="__suffix")Ee.suffix=$e;else if(ke==="__description")_e=$e;else if(ke==="__providerOutput")Ce=$e;else if(ke==="__metric")Ie=$e;else if(ke==="__threshold")Be=Number.parseFloat($e);else if(ke.startsWith("__metadata:")){const Oe=ke.slice(11);if(Oe.endsWith("[]")){const Ue=Oe.slice(0,-2);if($e.trim()!==""){const qe=$e.split(new RegExp("(?<!\\\\),")).map(ze=>ze.trim()).map(ze=>ze.replace("\\,",","));Se[Ue]=qe}}else $e.trim()!==""&&(Se[Oe]=$e)}else Ae[ke]=$e}for(const ke of xe)ke.metric=Ie;return{vars:Ae,assert:xe,options:Ee,..._e?{description:_e}:{},...Ce?{providerOutput:Ce}:{},...Be?{threshold:Be}:{},...Object.keys(Se).length>0?{metadata:Se}:{}}}const assertTypes=["equals","contains","icontains","contains-all","contains-any","starts-with","regex","is-json","contains-json","is-xml","contains-xml","is-sql","contains-sql","similar","llm-rubric","pi","model-graded-closedqa","factuality","webhook","bleu","rouge-n","g-eval","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","is-valid-function-call","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"],AssertsForm=({onAdd:t,initialValues:Ae})=>{const[xe,Ee]=reactExports.useState(Ae||[]),Se=()=>{const _e=[...xe,{type:"equals",value:""}];Ee(_e),t(_e)},Ce=_e=>{const Ie=xe.filter((Be,Te)=>Te!==_e);Ee(Ie),t(Ie)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Asserts"}),jsxRuntimeExports.jsx(Box,{my:xe.length>0?2:0,children:jsxRuntimeExports.jsx(Stack,{direction:"column",spacing:2,children:xe.map((_e,Ie)=>jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:2,alignItems:"center",children:[jsxRuntimeExports.jsx(Autocomplete,{value:_e.type,options:assertTypes,sx:{minWidth:200},onChange:(Be,Te)=>{const Pe=Te,ke=xe.map(($e,Oe)=>Oe===Ie?{...$e,type:Pe}:$e);Ee(ke),t(ke)},renderInput:Be=>jsxRuntimeExports.jsx(TextField,{...Be,label:"Type"})}),jsxRuntimeExports.jsx(TextField,{label:"Value",value:_e.value,fullWidth:!0,onChange:Be=>{const Te=Be.target.value,Pe=xe.map((ke,$e)=>$e===Ie?{...ke,value:Te}:ke);Ee(Pe),t(Pe)}}),jsxRuntimeExports.jsx(IconButton,{onClick:()=>Ce(Ie),size:"small",children:jsxRuntimeExports.jsx(DeleteIcon,{})})]},Ie))})}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:Se,children:"Add Assert"})]})},VarsForm=({onAdd:t,varsList:Ae,initialValues:xe})=>{const[Ee,Se]=React.useState(xe||{});return reactExports.useEffect(()=>{const Ce={};Ae.forEach(_e=>{Ce[_e]=(xe==null?void 0:xe[_e])||""}),Se(Ce)},[Ae,xe]),jsxRuntimeExports.jsxs(Box,{my:2,children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",mb:2,children:"Vars"}),Ae.length>0?jsxRuntimeExports.jsx(Stack,{direction:"row",spacing:2,alignItems:"center",children:Object.keys(Ee).map((Ce,_e)=>jsxRuntimeExports.jsx(Stack,{direction:"row",spacing:2,alignItems:"center",children:jsxRuntimeExports.jsx(TextField,{placeholder:Ce,label:Ce,value:Ee[Ce],fullWidth:!0,onChange:Ie=>{const Be=Ie.target.value,Te={...Ee,[Ce]:Be};Se(Te),t(Te)}})},_e))}):jsxRuntimeExports.jsxs(Typography,{variant:"subtitle1",gutterBottom:!0,children:["Add variables to your prompt using the ","{{varname}}"," syntax."]})]})},TestCaseForm=({open:t,onAdd:Ae,varsList:xe,initialValues:Ee,onCancel:Se})=>{const[Ce,_e]=reactExports.useState((Ee==null?void 0:Ee.description)||""),[Ie,Be]=reactExports.useState((Ee==null?void 0:Ee.vars)||{}),[Te,Pe]=reactExports.useState((Ee==null?void 0:Ee.assert)||[]),[ke,$e]=reactExports.useState(0);React.useEffect(()=>{Ee?(_e(Ee.description||""),Be(Ee.vars||{}),Pe(Ee.assert||[])):(_e(""),Be({}),Pe([]))},[Ee]);const Oe=Ue=>{Ae({description:Ce,vars:Ie,assert:Te},Ue),Ue&&Se(),_e(""),Be({}),Pe([]),$e(qe=>qe+1)};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Se,fullWidth:!0,maxWidth:"md",children:[jsxRuntimeExports.jsx(DialogTitle,{children:Ee?"Edit Test Case":"Add Test Case"}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(VarsForm,{onAdd:Ue=>Be(Ue),varsList:xe,initialValues:Ee==null?void 0:Ee.vars}),jsxRuntimeExports.jsx(AssertsForm,{onAdd:Ue=>Pe(Ue),initialValues:((Ee==null?void 0:Ee.assert)||[]).filter(Ue=>Ue.type!=="assert-set")||[]},ke)]})}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Oe.bind(void 0,!0),color:"primary",variant:"contained",children:Ee?"Update Test Case":"Add Test Case"}),!Ee&&jsxRuntimeExports.jsx(Button,{onClick:Oe.bind(void 0,!1),color:"primary",variant:"contained",children:"Add Another"}),jsxRuntimeExports.jsx(Button,{onClick:Se,color:"secondary",children:"Cancel"})]})]})},TestCasesSection=({varsList:t})=>{const{testCases:Ae,setTestCases:xe}=useStore$1(),[Ee,Se]=React.useState(null),[Ce,_e]=React.useState(!1),[Ie,Be]=React.useState(!1),[Te,Pe]=React.useState(null),ke=(Ve,Ge)=>{if(Ee===null)xe([...Ae,Ve]);else{const Xe=Ae.map((er,tr)=>tr===Ee?Ve:er);xe(Xe),Se(null)}Ge&&_e(!1)},$e=Ve=>{var Xe;Ve.stopPropagation(),Ve.preventDefault();const Ge=(Xe=Ve.target.files)==null?void 0:Xe[0];if(Ge){const er=new FileReader;er.onload=async tr=>{var sr,dr;const nr=(dr=(sr=tr.target)==null?void 0:sr.result)==null?void 0:dr.toString();if(nr){const{parse:ar}=await __vitePreload(async()=>{const{parse:Me}=await import("./sync-D8TWaIhD.js");return{parse:Me}},[]),Ke=ar(nr,{columns:!0}).map(Me=>testCaseFromCsvRow(Me));xe([...Ae,...Ke])}},er.readAsText(Ge)}},Oe=(Ve,Ge)=>{Ve.stopPropagation(),Pe(Ge),Be(!0)},Ue=()=>{Te!==null&&(xe(Ae.filter((Ve,Ge)=>Ge!==Te)),Pe(null)),Be(!1)},qe=()=>{Pe(null),Be(!1)},ze=(Ve,Ge)=>{Ve.stopPropagation();const Xe=JSON.parse(JSON.stringify(Ae[Ge]));xe([...Ae,Xe])};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:2,mb:2,justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Typography,{variant:"h5",children:"Test Cases"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("label",{htmlFor:"file-input-add-test-case",children:jsxRuntimeExports.jsx(Tooltip$2,{title:"Upload test cases from csv",children:jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(IconButton,{component:"span",children:jsxRuntimeExports.jsx(Publish,{})}),jsxRuntimeExports.jsx("input",{id:"file-input-add-test-case",type:"file",accept:".csv",onChange:$e,style:{display:"none"}})]})})}),Ae.length===0&&jsxRuntimeExports.jsx(Button,{color:"secondary",onClick:()=>{const Ve={description:"Fun animal adventure story",vars:{animal:"penguin",location:"tropical island"},assert:[{type:"contains-any",value:["penguin","adventure","tropical","island"]},{type:"llm-rubric",value:`Is this a fun, child-friendly story featuring a penguin on a tropical island adventure?
530
530
 
531
531
  Criteria:
532
532
  1. Does it mention a penguin as the main character?
@@ -574,7 +574,7 @@ Criteria:
574
574
  */var xe=function(Ee){var Se=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,Ce=0,_e={},Ie={manual:Ee.Prism&&Ee.Prism.manual,disableWorkerMessageHandler:Ee.Prism&&Ee.Prism.disableWorkerMessageHandler,util:{encode:function Ge(Xe){return Xe instanceof Be?new Be(Xe.type,Ge(Xe.content),Xe.alias):Array.isArray(Xe)?Xe.map(Ge):Xe.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(Ge){return Object.prototype.toString.call(Ge).slice(8,-1)},objId:function(Ge){return Ge.__id||Object.defineProperty(Ge,"__id",{value:++Ce}),Ge.__id},clone:function Ge(Xe,er){er=er||{};var tr,nr;switch(Ie.util.type(Xe)){case"Object":if(nr=Ie.util.objId(Xe),er[nr])return er[nr];tr={},er[nr]=tr;for(var sr in Xe)Xe.hasOwnProperty(sr)&&(tr[sr]=Ge(Xe[sr],er));return tr;case"Array":return nr=Ie.util.objId(Xe),er[nr]?er[nr]:(tr=[],er[nr]=tr,Xe.forEach(function(dr,ar){tr[ar]=Ge(dr,er)}),tr);default:return Xe}},getLanguage:function(Ge){for(;Ge;){var Xe=Se.exec(Ge.className);if(Xe)return Xe[1].toLowerCase();Ge=Ge.parentElement}return"none"},setLanguage:function(Ge,Xe){Ge.className=Ge.className.replace(RegExp(Se,"gi"),""),Ge.classList.add("language-"+Xe)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(tr){var Ge=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(tr.stack)||[])[1];if(Ge){var Xe=document.getElementsByTagName("script");for(var er in Xe)if(Xe[er].src==Ge)return Xe[er]}return null}},isActive:function(Ge,Xe,er){for(var tr="no-"+Xe;Ge;){var nr=Ge.classList;if(nr.contains(Xe))return!0;if(nr.contains(tr))return!1;Ge=Ge.parentElement}return!!er}},languages:{plain:_e,plaintext:_e,text:_e,txt:_e,extend:function(Ge,Xe){var er=Ie.util.clone(Ie.languages[Ge]);for(var tr in Xe)er[tr]=Xe[tr];return er},insertBefore:function(Ge,Xe,er,tr){tr=tr||Ie.languages;var nr=tr[Ge],sr={};for(var dr in nr)if(nr.hasOwnProperty(dr)){if(dr==Xe)for(var ar in er)er.hasOwnProperty(ar)&&(sr[ar]=er[ar]);er.hasOwnProperty(dr)||(sr[dr]=nr[dr])}var lr=tr[Ge];return tr[Ge]=sr,Ie.languages.DFS(Ie.languages,function(Ke,Me){Me===lr&&Ke!=Ge&&(this[Ke]=sr)}),sr},DFS:function Ge(Xe,er,tr,nr){nr=nr||{};var sr=Ie.util.objId;for(var dr in Xe)if(Xe.hasOwnProperty(dr)){er.call(Xe,dr,Xe[dr],tr||dr);var ar=Xe[dr],lr=Ie.util.type(ar);lr==="Object"&&!nr[sr(ar)]?(nr[sr(ar)]=!0,Ge(ar,er,null,nr)):lr==="Array"&&!nr[sr(ar)]&&(nr[sr(ar)]=!0,Ge(ar,er,dr,nr))}}},plugins:{},highlightAll:function(Ge,Xe){Ie.highlightAllUnder(document,Ge,Xe)},highlightAllUnder:function(Ge,Xe,er){var tr={callback:er,container:Ge,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};Ie.hooks.run("before-highlightall",tr),tr.elements=Array.prototype.slice.apply(tr.container.querySelectorAll(tr.selector)),Ie.hooks.run("before-all-elements-highlight",tr);for(var nr=0,sr;sr=tr.elements[nr++];)Ie.highlightElement(sr,Xe===!0,tr.callback)},highlightElement:function(Ge,Xe,er){var tr=Ie.util.getLanguage(Ge),nr=Ie.languages[tr];Ie.util.setLanguage(Ge,tr);var sr=Ge.parentElement;sr&&sr.nodeName.toLowerCase()==="pre"&&Ie.util.setLanguage(sr,tr);var dr=Ge.textContent,ar={element:Ge,language:tr,grammar:nr,code:dr};function lr(Me){ar.highlightedCode=Me,Ie.hooks.run("before-insert",ar),ar.element.innerHTML=ar.highlightedCode,Ie.hooks.run("after-highlight",ar),Ie.hooks.run("complete",ar),er&&er.call(ar.element)}if(Ie.hooks.run("before-sanity-check",ar),sr=ar.element.parentElement,sr&&sr.nodeName.toLowerCase()==="pre"&&!sr.hasAttribute("tabindex")&&sr.setAttribute("tabindex","0"),!ar.code){Ie.hooks.run("complete",ar),er&&er.call(ar.element);return}if(Ie.hooks.run("before-highlight",ar),!ar.grammar){lr(Ie.util.encode(ar.code));return}if(Xe&&Ee.Worker){var Ke=new Worker(Ie.filename);Ke.onmessage=function(Me){lr(Me.data)},Ke.postMessage(JSON.stringify({language:ar.language,code:ar.code,immediateClose:!0}))}else lr(Ie.highlight(ar.code,ar.grammar,ar.language))},highlight:function(Ge,Xe,er){var tr={code:Ge,grammar:Xe,language:er};if(Ie.hooks.run("before-tokenize",tr),!tr.grammar)throw new Error('The language "'+tr.language+'" has no grammar.');return tr.tokens=Ie.tokenize(tr.code,tr.grammar),Ie.hooks.run("after-tokenize",tr),Be.stringify(Ie.util.encode(tr.tokens),tr.language)},tokenize:function(Ge,Xe){var er=Xe.rest;if(er){for(var tr in er)Xe[tr]=er[tr];delete Xe.rest}var nr=new ke;return $e(nr,nr.head,Ge),Pe(Ge,nr,Xe,nr.head,0),Ue(nr)},hooks:{all:{},add:function(Ge,Xe){var er=Ie.hooks.all;er[Ge]=er[Ge]||[],er[Ge].push(Xe)},run:function(Ge,Xe){var er=Ie.hooks.all[Ge];if(!(!er||!er.length))for(var tr=0,nr;nr=er[tr++];)nr(Xe)}},Token:Be};Ee.Prism=Ie;function Be(Ge,Xe,er,tr){this.type=Ge,this.content=Xe,this.alias=er,this.length=(tr||"").length|0}Be.stringify=function Ge(Xe,er){if(typeof Xe=="string")return Xe;if(Array.isArray(Xe)){var tr="";return Xe.forEach(function(lr){tr+=Ge(lr,er)}),tr}var nr={type:Xe.type,content:Ge(Xe.content,er),tag:"span",classes:["token",Xe.type],attributes:{},language:er},sr=Xe.alias;sr&&(Array.isArray(sr)?Array.prototype.push.apply(nr.classes,sr):nr.classes.push(sr)),Ie.hooks.run("wrap",nr);var dr="";for(var ar in nr.attributes)dr+=" "+ar+'="'+(nr.attributes[ar]||"").replace(/"/g,"&quot;")+'"';return"<"+nr.tag+' class="'+nr.classes.join(" ")+'"'+dr+">"+nr.content+"</"+nr.tag+">"};function Te(Ge,Xe,er,tr){Ge.lastIndex=Xe;var nr=Ge.exec(er);if(nr&&tr&&nr[1]){var sr=nr[1].length;nr.index+=sr,nr[0]=nr[0].slice(sr)}return nr}function Pe(Ge,Xe,er,tr,nr,sr){for(var dr in er)if(!(!er.hasOwnProperty(dr)||!er[dr])){var ar=er[dr];ar=Array.isArray(ar)?ar:[ar];for(var lr=0;lr<ar.length;++lr){if(sr&&sr.cause==dr+","+lr)return;var Ke=ar[lr],Me=Ke.inside,je=!!Ke.lookbehind,De=!!Ke.greedy,He=Ke.alias;if(De&&!Ke.pattern.global){var Qe=Ke.pattern.toString().match(/[imsuy]*$/)[0];Ke.pattern=RegExp(Ke.pattern.source,Qe+"g")}for(var Ye=Ke.pattern||Ke,St=tr.next,We=nr;St!==Xe.tail&&!(sr&&We>=sr.reach);We+=St.value.length,St=St.next){var Fe=St.value;if(Xe.length>Ge.length)return;if(!(Fe instanceof Be)){var Ze=1,ir;if(De){if(ir=Te(Ye,We,Ge,je),!ir||ir.index>=Ge.length)break;var vr=ir.index,ur=ir.index+ir[0].length,fr=We;for(fr+=St.value.length;vr>=fr;)St=St.next,fr+=St.value.length;if(fr-=St.value.length,We=fr,St.value instanceof Be)continue;for(var Ar=St;Ar!==Xe.tail&&(fr<ur||typeof Ar.value=="string");Ar=Ar.next)Ze++,fr+=Ar.value.length;Ze--,Fe=Ge.slice(We,fr),ir.index-=We}else if(ir=Te(Ye,0,Fe,je),!ir)continue;var vr=ir.index,xr=ir[0],br=Fe.slice(0,vr),_r=Fe.slice(vr+xr.length),$r=We+Fe.length;sr&&$r>sr.reach&&(sr.reach=$r);var Fr=St.prev;br&&(Fr=$e(Xe,Fr,br),We+=br.length),Oe(Xe,Fr,Ze);var Ir=new Be(dr,Me?Ie.tokenize(xr,Me):xr,He,xr);if(St=$e(Xe,Fr,Ir),_r&&$e(Xe,St,_r),Ze>1){var zr={cause:dr+","+lr,reach:$r};Pe(Ge,Xe,er,St.prev,We,zr),sr&&zr.reach>sr.reach&&(sr.reach=zr.reach)}}}}}}function ke(){var Ge={value:null,prev:null,next:null},Xe={value:null,prev:Ge,next:null};Ge.next=Xe,this.head=Ge,this.tail=Xe,this.length=0}function $e(Ge,Xe,er){var tr=Xe.next,nr={value:er,prev:Xe,next:tr};return Xe.next=nr,tr.prev=nr,Ge.length++,nr}function Oe(Ge,Xe,er){for(var tr=Xe.next,nr=0;nr<er&&tr!==Ge.tail;nr++)tr=tr.next;Xe.next=tr,tr.prev=Xe,Ge.length-=nr}function Ue(Ge){for(var Xe=[],er=Ge.head.next;er!==Ge.tail;)Xe.push(er.value),er=er.next;return Xe}if(!Ee.document)return Ee.addEventListener&&(Ie.disableWorkerMessageHandler||Ee.addEventListener("message",function(Ge){var Xe=JSON.parse(Ge.data),er=Xe.language,tr=Xe.code,nr=Xe.immediateClose;Ee.postMessage(Ie.highlight(tr,Ie.languages[er],er)),nr&&Ee.close()},!1)),Ie;var qe=Ie.util.currentScript();qe&&(Ie.filename=qe.src,qe.hasAttribute("data-manual")&&(Ie.manual=!0));function ze(){Ie.manual||Ie.highlightAll()}if(!Ie.manual){var Ve=document.readyState;Ve==="loading"||Ve==="interactive"&&qe&&qe.defer?document.addEventListener("DOMContentLoaded",ze):window.requestAnimationFrame?window.requestAnimationFrame(ze):window.setTimeout(ze,16)}return Ie}(Ae);t.exports&&(t.exports=xe),typeof commonjsGlobal<"u"&&(commonjsGlobal.Prism=xe)}(prismCore)),prismCore.exports}var prismCoreExports=requirePrismCore();(function(t){var Ae=/[*&][^\s[\]{},]+/,xe=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,Ee="(?:"+xe.source+"(?:[ ]+"+Ae.source+")?|"+Ae.source+"(?:[ ]+"+xe.source+")?)",Se=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),Ce=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function _e(Ie,Be){Be=(Be||"").replace(/m/g,"")+"m";var Te=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return Ee}).replace(/<<value>>/g,function(){return Ie});return RegExp(Te,Be)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return Ee})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return Ee}).replace(/<<key>>/g,function(){return"(?:"+Se+"|"+Ce+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:_e(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:_e(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:_e(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:_e(Ce),lookbehind:!0,greedy:!0},number:{pattern:_e(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:xe,important:Ae,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(Prism);const YAML_SCHEMA_COMMENT="# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json",ensureSchemaComment=t=>t.trim().startsWith(YAML_SCHEMA_COMMENT)?t:`${YAML_SCHEMA_COMMENT}
575
575
  ${t}`,formatYamlWithSchema=t=>{const Ae=jsYaml.dump(t);return ensureSchemaComment(Ae)},StyledLink=styled$1(Link$1)({fontWeight:"medium",textDecoration:"none"}),YamlEditorComponent=({initialConfig:t,readOnly:Ae=!1,initialYaml:xe})=>{const Ee=useTheme().palette.mode==="dark",[Se,Ce]=React.useState(""),[_e,Ie]=React.useState(!0),[Be,Te]=React.useState(null),[Pe,ke]=React.useState({show:!1,message:""}),{getTestSuite:$e}=useStore$1(),Oe=ze=>{try{const Ve=ze.replace(YAML_SCHEMA_COMMENT,"").trim(),Ge=jsYaml.load(Ve);if(Ge&&typeof Ge=="object")return useStore$1.setState(Xe=>{const er={...Xe};return Ge.description!==void 0&&(er.description=Ge.description),Ge.providers!==void 0&&(er.providers=Ge.providers),Ge.prompts!==void 0&&(er.prompts=Ge.prompts),Ge.tests!==void 0&&(er.testCases=Ge.tests),Ge.defaultTest!==void 0&&(er.defaultTest=Ge.defaultTest),Ge.evaluateOptions!==void 0&&(er.evaluateOptions=Ge.evaluateOptions),Ge.scenarios!==void 0&&(er.scenarios=Ge.scenarios),Ge.extensions!==void 0&&(er.extensions=Ge.extensions),Ge.env!==void 0&&(er.env=Ge.env),er}),Te(null),ke({show:!0,message:"Configuration saved successfully"}),!0;{const Xe="Invalid YAML configuration";return Te(Xe),ke({show:!0,message:Xe}),!1}}catch(Ve){const Ge=`Failed to parse YAML: ${Ve instanceof Error?Ve.message:String(Ve)}`;return console.error(Ge,Ve),Te(Ge),ke({show:!0,message:Ge}),!1}},Ue=ze=>{var Ge;const Ve=(Ge=ze.target.files)==null?void 0:Ge[0];if(Ve){const Xe=new FileReader;Xe.onload=er=>{var sr;const tr=(sr=er.target)==null?void 0:sr.result,nr=ensureSchemaComment(tr);Ce(nr),_e&&Ie(!1),Oe(nr)},Xe.onerror=()=>{const er="Failed to read the uploaded file";Te(er),ke({show:!0,message:er}),Ie(!1)};try{Xe.readAsText(Ve)}catch(er){const tr=`Error loading file: ${er instanceof Error?er.message:String(er)}`;Te(tr),ke({show:!0,message:tr}),Ie(!1)}}},qe=async()=>{try{await navigator.clipboard.writeText(Se),ke({show:!0,message:"YAML copied to clipboard"})}catch(ze){console.error("Failed to copy text:",ze)}};return React.useEffect(()=>{if(xe)Ce(ensureSchemaComment(xe));else if(t)Ce(formatYamlWithSchema(t));else{const ze=$e();Ce(formatYamlWithSchema(ze))}},[xe,t]),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{mb:3,p:2,bgcolor:Ee?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.02)",borderRadius:1,borderLeft:"4px solid",borderColor:"primary.main",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",fontWeight:"bold",color:"primary.main",gutterBottom:!0,children:"YAML Configuration"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",children:"This configuration defines your evaluation parameters and can be exported for use with the promptfoo CLI."}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mt:1},children:jsxRuntimeExports.jsx(StyledLink,{target:"_blank",to:"https://promptfoo.dev/docs/configuration/guide",children:"View documentation →"})})]}),!Ae&&jsxRuntimeExports.jsx(Button,{variant:_e?"outlined":"contained",color:"primary",size:"small",startIcon:_e?jsxRuntimeExports.jsx(EditIcon,{}):jsxRuntimeExports.jsx(SaveIcon,{}),onClick:()=>{_e?Ie(!1):Oe(Se)&&Ie(!0)},sx:{ml:2,whiteSpace:"nowrap"},children:_e?"Edit YAML":"Save Changes"})]}),!Ae&&!_e&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[jsxRuntimeExports.jsxs(Box,{display:"flex",gap:2,children:[jsxRuntimeExports.jsxs(Button,{variant:"text",color:"primary",startIcon:jsxRuntimeExports.jsx(UploadIcon,{}),component:"label",children:["Upload YAML",jsxRuntimeExports.jsx("input",{type:"file",hidden:!0,accept:".yaml,.yml",onChange:Ue})]}),jsxRuntimeExports.jsx(Button,{variant:"text",color:"warning",onClick:()=>{const ze=$e();Ce(formatYamlWithSchema(ze)),ke({show:!0,message:"Reset to last saved configuration"})},children:"Reset"})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Editing mode active - changes will be applied when you save"})]}),jsxRuntimeExports.jsxs(Box,{position:"relative",children:[jsxRuntimeExports.jsxs("div",{className:`editor-container ${_e?Ae?"":"editor-readonly":"glowing-border"}`,children:[!_e&&jsxRuntimeExports.jsx("div",{className:"editing-indicator",children:"Editing"}),jsxRuntimeExports.jsx(Editor,{autoCapitalize:"off",value:Se,onValueChange:ze=>{_e||(Be&&Te(null),Ce(ze))},highlight:ze=>prismCoreExports.highlight(ze,prismCoreExports.languages.yaml),padding:10,style:{fontFamily:'"Fira code", "Fira Mono", monospace',fontSize:14,backgroundColor:Ee?"#1e1e1e":"#fff"},disabled:_e})]}),jsxRuntimeExports.jsx(Tooltip$2,{title:"Copy YAML",children:jsxRuntimeExports.jsx(IconButton,{onClick:qe,sx:{position:"absolute",top:8,right:8,bgcolor:Ee?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.05)","&:hover":{bgcolor:Ee?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.1)"}},children:jsxRuntimeExports.jsx(ContentCopyIcon,{fontSize:"small"})})})]}),jsxRuntimeExports.jsx(Snackbar,{open:Pe.show,autoHideDuration:2e3,onClose:()=>ke({...Pe,show:!1}),message:Pe.message,anchorOrigin:{vertical:"bottom",horizontal:"center"}})]})};function ErrorFallback$1({error:t,resetErrorBoundary:Ae}){return jsxRuntimeExports.jsxs("div",{role:"alert",children:[jsxRuntimeExports.jsx("p",{children:"Something went wrong:"}),jsxRuntimeExports.jsx("pre",{children:t.message}),jsxRuntimeExports.jsx("button",{onClick:Ae,children:"Try again"})]})}const EvaluateTestSuiteCreator=()=>{const[t,Ae]=reactExports.useState(!1),{setDescription:xe,providers:Ee,setProviders:Se,prompts:Ce,setPrompts:_e,setTestCases:Ie}=useStore$1();reactExports.useEffect(()=>{useStore$1.persist.rehydrate()},[]);const Te=(ke=>{const $e=/{{\s*(\w+)\s*}}/g,Oe=new Set;return ke.forEach(Ue=>{let qe;for(;(qe=$e.exec(Ue))!==null;)Oe.add(qe[1])}),Array.from(Oe)})(Ce),Pe=()=>{xe(""),Se([]),_e([]),Ie([]),Ae(!1)};return jsxRuntimeExports.jsxs(Container,{maxWidth:"lg",sx:{marginTop:"2rem"},children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:2,justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Typography,{variant:"h4",children:"Set up an evaluation"}),jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:2,children:[jsxRuntimeExports.jsx(RunTestSuiteButton,{}),jsxRuntimeExports.jsx(ConfigureEnvButton,{}),jsxRuntimeExports.jsx(Button,{variant:"outlined",color:"primary",onClick:()=>Ae(!0),children:"Reset"})]})]}),jsxRuntimeExports.jsx(Box,{mt:4}),jsxRuntimeExports.jsx(Box,{mt:2,children:jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:ErrorFallback$1,onReset:()=>{Se([])},children:jsxRuntimeExports.jsxs(Stack,{direction:"column",spacing:2,justifyContent:"space-between",children:[jsxRuntimeExports.jsx(Typography,{variant:"h5",children:"Providers"}),jsxRuntimeExports.jsx(ProviderSelector,{providers:Ee,onChange:Se})]})})}),jsxRuntimeExports.jsx(Box,{mt:4}),jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:ErrorFallback$1,onReset:()=>{_e([])},children:jsxRuntimeExports.jsx(PromptsSection,{})}),jsxRuntimeExports.jsx(Box,{mt:6}),jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:ErrorFallback$1,onReset:()=>{Ie([])},children:jsxRuntimeExports.jsx(TestCasesSection,{varsList:Te})}),jsxRuntimeExports.jsx(Box,{mt:8}),jsxRuntimeExports.jsx(YamlEditorComponent,{initialConfig:useStore$1.getState().getTestSuite()}),jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:()=>Ae(!1),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[jsxRuntimeExports.jsx(DialogTitle,{id:"alert-dialog-title",children:"Confirm Reset"}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsx(DialogContentText,{id:"alert-dialog-description",children:"Are you sure you want to reset all the fields? This action cannot be undone."})}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:()=>Ae(!1),children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Pe,autoFocus:!0,children:"Reset"})]})]})]})};function EvalCreatorPage(){return jsxRuntimeExports.jsx(EvaluateTestSuiteCreator,{})}const EnterpriseBanner=({evalId:t,sx:Ae})=>{const[xe,Ee]=reactExports.useState(null);return reactExports.useEffect(()=>{(async()=>{try{if(!t){console.warn("EnterpriseBanner: No evalId provided, defaulting to showing banner"),Ee(!1);return}const Ce=await callApi(`/results/share/check-domain?id=${t}`);if(Ce.ok){const _e=await Ce.json();Ee(_e.isCloudEnabled)}else Ee(!1)}catch(Ce){console.error("Error checking cloud status:",Ce),Ee(!1)}})()},[t]),xe===null||xe===!0?null:jsxRuntimeExports.jsxs(Alert,{severity:"info",icon:jsxRuntimeExports.jsx(InfoIcon,{}),sx:{"& a":{color:"primary.main",fontWeight:"bold",textDecoration:"underline"},...Ae},children:["You're using the community edition of Promptfoo's red teaming suite. For advanced capabilities and support, learn more about"," ",jsxRuntimeExports.jsx(Link,{href:"https://www.promptfoo.dev/docs/enterprise/",target:"_blank",rel:"noopener",children:"Promptfoo Enterprise"}),"."]})},ShiftKeyContext=reactExports.createContext(void 0),ShiftKeyProvider=({children:t})=>{const[Ae,xe]=reactExports.useState(!1);return reactExports.useEffect(()=>{const Ee=Ce=>{Ce.key==="Shift"&&xe(!0)},Se=Ce=>{Ce.key==="Shift"&&xe(!1)};return window.addEventListener("keydown",Ee),window.addEventListener("keyup",Se),()=>{window.removeEventListener("keydown",Ee),window.removeEventListener("keyup",Se)}},[]),jsxRuntimeExports.jsx(ShiftKeyContext.Provider,{value:Ae,children:t})},PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0";PACKET_TYPES.close="1";PACKET_TYPES.ping="2";PACKET_TYPES.pong="3";PACKET_TYPES.message="4";PACKET_TYPES.upgrade="5";PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(t=>{PACKET_TYPES_REVERSE[PACKET_TYPES[t]]=t});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,encodePacket=({type:t,data:Ae},xe,Ee)=>withNativeBlob$1&&Ae instanceof Blob?xe?Ee(Ae):encodeBlobAsBase64(Ae,Ee):withNativeArrayBuffer$2&&(Ae instanceof ArrayBuffer||isView$1(Ae))?xe?Ee(Ae):encodeBlobAsBase64(new Blob([Ae]),Ee):Ee(PACKET_TYPES[t]+(Ae||"")),encodeBlobAsBase64=(t,Ae)=>{const xe=new FileReader;return xe.onload=function(){const Ee=xe.result.split(",")[1];Ae("b"+(Ee||""))},xe.readAsDataURL(t)};function toArray$1(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(t,Ae){if(withNativeBlob$1&&t.data instanceof Blob)return t.data.arrayBuffer().then(toArray$1).then(Ae);if(withNativeArrayBuffer$2&&(t.data instanceof ArrayBuffer||isView$1(t.data)))return Ae(toArray$1(t.data));encodePacket(t,!1,xe=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),Ae(TEXT_ENCODER.encode(xe))})}const chars$4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$7=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<chars$4.length;t++)lookup$7[chars$4.charCodeAt(t)]=t;const decode$5=t=>{let Ae=t.length*.75,xe=t.length,Ee,Se=0,Ce,_e,Ie,Be;t[t.length-1]==="="&&(Ae--,t[t.length-2]==="="&&Ae--);const Te=new ArrayBuffer(Ae),Pe=new Uint8Array(Te);for(Ee=0;Ee<xe;Ee+=4)Ce=lookup$7[t.charCodeAt(Ee)],_e=lookup$7[t.charCodeAt(Ee+1)],Ie=lookup$7[t.charCodeAt(Ee+2)],Be=lookup$7[t.charCodeAt(Ee+3)],Pe[Se++]=Ce<<2|_e>>4,Pe[Se++]=(_e&15)<<4|Ie>>2,Pe[Se++]=(Ie&3)<<6|Be&63;return Te},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(t,Ae)=>{if(typeof t!="string")return{type:"message",data:mapBinary(t,Ae)};const xe=t.charAt(0);return xe==="b"?{type:"message",data:decodeBase64Packet(t.substring(1),Ae)}:PACKET_TYPES_REVERSE[xe]?t.length>1?{type:PACKET_TYPES_REVERSE[xe],data:t.substring(1)}:{type:PACKET_TYPES_REVERSE[xe]}:ERROR_PACKET},decodeBase64Packet=(t,Ae)=>{if(withNativeArrayBuffer$1){const xe=decode$5(t);return mapBinary(xe,Ae)}else return{base64:!0,data:t}},mapBinary=(t,Ae)=>{switch(Ae){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},SEPARATOR="",encodePayload=(t,Ae)=>{const xe=t.length,Ee=new Array(xe);let Se=0;t.forEach((Ce,_e)=>{encodePacket(Ce,!1,Ie=>{Ee[_e]=Ie,++Se===xe&&Ae(Ee.join(SEPARATOR))})})},decodePayload=(t,Ae)=>{const xe=t.split(SEPARATOR),Ee=[];for(let Se=0;Se<xe.length;Se++){const Ce=decodePacket(xe[Se],Ae);if(Ee.push(Ce),Ce.type==="error")break}return Ee};function createPacketEncoderStream(){return new TransformStream({transform(t,Ae){encodePacketToBinary(t,xe=>{const Ee=xe.length;let Se;if(Ee<126)Se=new Uint8Array(1),new DataView(Se.buffer).setUint8(0,Ee);else if(Ee<65536){Se=new Uint8Array(3);const Ce=new DataView(Se.buffer);Ce.setUint8(0,126),Ce.setUint16(1,Ee)}else{Se=new Uint8Array(9);const Ce=new DataView(Se.buffer);Ce.setUint8(0,127),Ce.setBigUint64(1,BigInt(Ee))}t.data&&typeof t.data!="string"&&(Se[0]|=128),Ae.enqueue(Se),Ae.enqueue(xe)})}})}let TEXT_DECODER;function totalLength(t){return t.reduce((Ae,xe)=>Ae+xe.length,0)}function concatChunks(t,Ae){if(t[0].length===Ae)return t.shift();const xe=new Uint8Array(Ae);let Ee=0;for(let Se=0;Se<Ae;Se++)xe[Se]=t[0][Ee++],Ee===t[0].length&&(t.shift(),Ee=0);return t.length&&Ee<t[0].length&&(t[0]=t[0].slice(Ee)),xe}function createPacketDecoderStream(t,Ae){TEXT_DECODER||(TEXT_DECODER=new TextDecoder);const xe=[];let Ee=0,Se=-1,Ce=!1;return new TransformStream({transform(_e,Ie){for(xe.push(_e);;){if(Ee===0){if(totalLength(xe)<1)break;const Be=concatChunks(xe,1);Ce=(Be[0]&128)===128,Se=Be[0]&127,Se<126?Ee=3:Se===126?Ee=1:Ee=2}else if(Ee===1){if(totalLength(xe)<2)break;const Be=concatChunks(xe,2);Se=new DataView(Be.buffer,Be.byteOffset,Be.length).getUint16(0),Ee=3}else if(Ee===2){if(totalLength(xe)<8)break;const Be=concatChunks(xe,8),Te=new DataView(Be.buffer,Be.byteOffset,Be.length),Pe=Te.getUint32(0);if(Pe>Math.pow(2,21)-1){Ie.enqueue(ERROR_PACKET);break}Se=Pe*Math.pow(2,32)+Te.getUint32(4),Ee=3}else{if(totalLength(xe)<Se)break;const Be=concatChunks(xe,Se);Ie.enqueue(decodePacket(Ce?Be:TEXT_DECODER.decode(Be),Ae)),Ee=0}if(Se===0||Se>t){Ie.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(t){if(t)return mixin(t)}function mixin(t){for(var Ae in Emitter.prototype)t[Ae]=Emitter.prototype[Ae];return t}Emitter.prototype.on=Emitter.prototype.addEventListener=function(t,Ae){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(Ae),this};Emitter.prototype.once=function(t,Ae){function xe(){this.off(t,xe),Ae.apply(this,arguments)}return xe.fn=Ae,this.on(t,xe),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(t,Ae){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var xe=this._callbacks["$"+t];if(!xe)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var Ee,Se=0;Se<xe.length;Se++)if(Ee=xe[Se],Ee===Ae||Ee.fn===Ae){xe.splice(Se,1);break}return xe.length===0&&delete this._callbacks["$"+t],this};Emitter.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var Ae=new Array(arguments.length-1),xe=this._callbacks["$"+t],Ee=1;Ee<arguments.length;Ee++)Ae[Ee-1]=arguments[Ee];if(xe){xe=xe.slice(0);for(var Ee=0,Se=xe.length;Ee<Se;++Ee)xe[Ee].apply(this,Ae)}return this};Emitter.prototype.emitReserved=Emitter.prototype.emit;Emitter.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Emitter.prototype.hasListeners=function(t){return!!this.listeners(t).length};const nextTick=typeof Promise=="function"&&typeof Promise.resolve=="function"?Ae=>Promise.resolve().then(Ae):(Ae,xe)=>xe(Ae,0),globalThisShim=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),defaultBinaryType="arraybuffer";function createCookieJar(){}function pick(t,...Ae){return Ae.reduce((xe,Ee)=>(t.hasOwnProperty(Ee)&&(xe[Ee]=t[Ee]),xe),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(t,Ae){Ae.useNativeTimers?(t.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),t.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(t.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),t.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength$2(t){return typeof t=="string"?utf8Length(t):Math.ceil((t.byteLength||t.size)*BASE64_OVERHEAD)}function utf8Length(t){let Ae=0,xe=0;for(let Ee=0,Se=t.length;Ee<Se;Ee++)Ae=t.charCodeAt(Ee),Ae<128?xe+=1:Ae<2048?xe+=2:Ae<55296||Ae>=57344?xe+=3:(Ee++,xe+=4);return xe}function randomString(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function encode$1(t){let Ae="";for(let xe in t)t.hasOwnProperty(xe)&&(Ae.length&&(Ae+="&"),Ae+=encodeURIComponent(xe)+"="+encodeURIComponent(t[xe]));return Ae}function decode$4(t){let Ae={},xe=t.split("&");for(let Ee=0,Se=xe.length;Ee<Se;Ee++){let Ce=xe[Ee].split("=");Ae[decodeURIComponent(Ce[0])]=decodeURIComponent(Ce[1])}return Ae}class TransportError extends Error{constructor(Ae,xe,Ee){super(Ae),this.description=xe,this.context=Ee,this.type="TransportError"}}class Transport extends Emitter{constructor(Ae){super(),this.writable=!1,installTimerFunctions(this,Ae),this.opts=Ae,this.query=Ae.query,this.socket=Ae.socket,this.supportsBinary=!Ae.forceBase64}onError(Ae,xe,Ee){return super.emitReserved("error",new TransportError(Ae,xe,Ee)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(Ae){this.readyState==="open"&&this.write(Ae)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(Ae){const xe=decodePacket(Ae,this.socket.binaryType);this.onPacket(xe)}onPacket(Ae){super.emitReserved("packet",Ae)}onClose(Ae){this.readyState="closed",super.emitReserved("close",Ae)}pause(Ae){}createUri(Ae,xe={}){return Ae+"://"+this._hostname()+this._port()+this.opts.path+this._query(xe)}_hostname(){const Ae=this.opts.hostname;return Ae.indexOf(":")===-1?Ae:"["+Ae+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(Ae){const xe=encode$1(Ae);return xe.length?"?"+xe:""}}class Polling extends Transport{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(Ae){this.readyState="pausing";const xe=()=>{this.readyState="paused",Ae()};if(this._polling||!this.writable){let Ee=0;this._polling&&(Ee++,this.once("pollComplete",function(){--Ee||xe()})),this.writable||(Ee++,this.once("drain",function(){--Ee||xe()}))}else xe()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(Ae){const xe=Ee=>{if(this.readyState==="opening"&&Ee.type==="open"&&this.onOpen(),Ee.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(Ee)};decodePayload(Ae,this.socket.binaryType).forEach(xe),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const Ae=()=>{this.write([{type:"close"}])};this.readyState==="open"?Ae():this.once("open",Ae)}write(Ae){this.writable=!1,encodePayload(Ae,xe=>{this.doWrite(xe,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const Ae=this.opts.secure?"https":"http",xe=this.query||{};return this.opts.timestampRequests!==!1&&(xe[this.opts.timestampParam]=randomString()),!this.supportsBinary&&!xe.sid&&(xe.b64=1),this.createUri(Ae,xe)}}let value=!1;try{value=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(t){}const hasCORS=value;function empty$3(){}class BaseXHR extends Polling{constructor(Ae){if(super(Ae),typeof location<"u"){const xe=location.protocol==="https:";let Ee=location.port;Ee||(Ee=xe?"443":"80"),this.xd=typeof location<"u"&&Ae.hostname!==location.hostname||Ee!==Ae.port}}doWrite(Ae,xe){const Ee=this.request({method:"POST",data:Ae});Ee.on("success",xe),Ee.on("error",(Se,Ce)=>{this.onError("xhr post error",Se,Ce)})}doPoll(){const Ae=this.request();Ae.on("data",this.onData.bind(this)),Ae.on("error",(xe,Ee)=>{this.onError("xhr poll error",xe,Ee)}),this.pollXhr=Ae}}let Request$1=class Zd extends Emitter{constructor(Ae,xe,Ee){super(),this.createRequest=Ae,installTimerFunctions(this,Ee),this._opts=Ee,this._method=Ee.method||"GET",this._uri=xe,this._data=Ee.data!==void 0?Ee.data:null,this._create()}_create(){var Ae;const xe=pick(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");xe.xdomain=!!this._opts.xd;const Ee=this._xhr=this.createRequest(xe);try{Ee.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){Ee.setDisableHeaderCheck&&Ee.setDisableHeaderCheck(!0);for(let Se in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(Se)&&Ee.setRequestHeader(Se,this._opts.extraHeaders[Se])}}catch{}if(this._method==="POST")try{Ee.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{Ee.setRequestHeader("Accept","*/*")}catch{}(Ae=this._opts.cookieJar)===null||Ae===void 0||Ae.addCookies(Ee),"withCredentials"in Ee&&(Ee.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(Ee.timeout=this._opts.requestTimeout),Ee.onreadystatechange=()=>{var Se;Ee.readyState===3&&((Se=this._opts.cookieJar)===null||Se===void 0||Se.parseCookies(Ee.getResponseHeader("set-cookie"))),Ee.readyState===4&&(Ee.status===200||Ee.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof Ee.status=="number"?Ee.status:0)},0))},Ee.send(this._data)}catch(Se){this.setTimeoutFn(()=>{this._onError(Se)},0);return}typeof document<"u"&&(this._index=Zd.requestsCount++,Zd.requests[this._index]=this)}_onError(Ae){this.emitReserved("error",Ae,this._xhr),this._cleanup(!0)}_cleanup(Ae){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=empty$3,Ae)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Zd.requests[this._index],this._xhr=null}}_onLoad(){const Ae=this._xhr.responseText;Ae!==null&&(this.emitReserved("data",Ae),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Request$1.requestsCount=0;Request$1.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const t="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(t,unloadHandler,!1)}}function unloadHandler(){for(let t in Request$1.requests)Request$1.requests.hasOwnProperty(t)&&Request$1.requests[t].abort()}const hasXHR2=function(){const t=newRequest({xdomain:!1});return t&&t.responseType!==null}();class XHR extends BaseXHR{constructor(Ae){super(Ae);const xe=Ae&&Ae.forceBase64;this.supportsBinary=hasXHR2&&!xe}request(Ae={}){return Object.assign(Ae,{xd:this.xd},this.opts),new Request$1(newRequest,this.uri(),Ae)}}function newRequest(t){const Ae=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!Ae||hasCORS))return new XMLHttpRequest}catch{}if(!Ae)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class BaseWS extends Transport{get name(){return"websocket"}doOpen(){const Ae=this.uri(),xe=this.opts.protocols,Ee=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(Ee.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(Ae,xe,Ee)}catch(Se){return this.emitReserved("error",Se)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=Ae=>this.onClose({description:"websocket connection closed",context:Ae}),this.ws.onmessage=Ae=>this.onData(Ae.data),this.ws.onerror=Ae=>this.onError("websocket error",Ae)}write(Ae){this.writable=!1;for(let xe=0;xe<Ae.length;xe++){const Ee=Ae[xe],Se=xe===Ae.length-1;encodePacket(Ee,this.supportsBinary,Ce=>{try{this.doWrite(Ee,Ce)}catch{}Se&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const Ae=this.opts.secure?"wss":"ws",xe=this.query||{};return this.opts.timestampRequests&&(xe[this.opts.timestampParam]=randomString()),this.supportsBinary||(xe.b64=1),this.createUri(Ae,xe)}}const WebSocketCtor=globalThisShim.WebSocket||globalThisShim.MozWebSocket;class WS extends BaseWS{createSocket(Ae,xe,Ee){return isReactNative?new WebSocketCtor(Ae,xe,Ee):xe?new WebSocketCtor(Ae,xe):new WebSocketCtor(Ae)}doWrite(Ae,xe){this.ws.send(xe)}}class WT extends Transport{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(Ae){return this.emitReserved("error",Ae)}this._transport.closed.then(()=>{this.onClose()}).catch(Ae=>{this.onError("webtransport error",Ae)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(Ae=>{const xe=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),Ee=Ae.readable.pipeThrough(xe).getReader(),Se=createPacketEncoderStream();Se.readable.pipeTo(Ae.writable),this._writer=Se.writable.getWriter();const Ce=()=>{Ee.read().then(({done:Ie,value:Be})=>{Ie||(this.onPacket(Be),Ce())}).catch(Ie=>{})};Ce();const _e={type:"open"};this.query.sid&&(_e.data=`{"sid":"${this.query.sid}"}`),this._writer.write(_e).then(()=>this.onOpen())})})}write(Ae){this.writable=!1;for(let xe=0;xe<Ae.length;xe++){const Ee=Ae[xe],Se=xe===Ae.length-1;this._writer.write(Ee).then(()=>{Se&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var Ae;(Ae=this._transport)===null||Ae===void 0||Ae.close()}}const transports={websocket:WS,webtransport:WT,polling:XHR},re$2=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse$4(t){if(t.length>8e3)throw"URI too long";const Ae=t,xe=t.indexOf("["),Ee=t.indexOf("]");xe!=-1&&Ee!=-1&&(t=t.substring(0,xe)+t.substring(xe,Ee).replace(/:/g,";")+t.substring(Ee,t.length));let Se=re$2.exec(t||""),Ce={},_e=14;for(;_e--;)Ce[parts[_e]]=Se[_e]||"";return xe!=-1&&Ee!=-1&&(Ce.source=Ae,Ce.host=Ce.host.substring(1,Ce.host.length-1).replace(/;/g,":"),Ce.authority=Ce.authority.replace("[","").replace("]","").replace(/;/g,":"),Ce.ipv6uri=!0),Ce.pathNames=pathNames(Ce,Ce.path),Ce.queryKey=queryKey(Ce,Ce.query),Ce}function pathNames(t,Ae){const xe=/\/{2,9}/g,Ee=Ae.replace(xe,"/").split("/");return(Ae.slice(0,1)=="/"||Ae.length===0)&&Ee.splice(0,1),Ae.slice(-1)=="/"&&Ee.splice(Ee.length-1,1),Ee}function queryKey(t,Ae){const xe={};return Ae.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(Ee,Se,Ce){Se&&(xe[Se]=Ce)}),xe}const withEventListeners=typeof addEventListener=="function"&&typeof removeEventListener=="function",OFFLINE_EVENT_LISTENERS=[];withEventListeners&&addEventListener("offline",()=>{OFFLINE_EVENT_LISTENERS.forEach(t=>t())},!1);class SocketWithoutUpgrade extends Emitter{constructor(Ae,xe){if(super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,Ae&&typeof Ae=="object"&&(xe=Ae,Ae=null),Ae){const Ee=parse$4(Ae);xe.hostname=Ee.host,xe.secure=Ee.protocol==="https"||Ee.protocol==="wss",xe.port=Ee.port,Ee.query&&(xe.query=Ee.query)}else xe.host&&(xe.hostname=parse$4(xe.host).host);installTimerFunctions(this,xe),this.secure=xe.secure!=null?xe.secure:typeof location<"u"&&location.protocol==="https:",xe.hostname&&!xe.port&&(xe.port=this.secure?"443":"80"),this.hostname=xe.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=xe.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},xe.transports.forEach(Ee=>{const Se=Ee.prototype.name;this.transports.push(Se),this._transportsByName[Se]=Ee}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},xe),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode$4(this.opts.query)),withEventListeners&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(Ae){const xe=Object.assign({},this.opts.query);xe.EIO=protocol$1,xe.transport=Ae,this.id&&(xe.sid=this.id);const Ee=Object.assign({},this.opts,{query:xe,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[Ae]);return new this._transportsByName[Ae](Ee)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const Ae=this.opts.rememberUpgrade&&SocketWithoutUpgrade.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const xe=this.createTransport(Ae);xe.open(),this.setTransport(xe)}setTransport(Ae){this.transport&&this.transport.removeAllListeners(),this.transport=Ae,Ae.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",xe=>this._onClose("transport close",xe))}onOpen(){this.readyState="open",SocketWithoutUpgrade.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(Ae){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",Ae),this.emitReserved("heartbeat"),Ae.type){case"open":this.onHandshake(JSON.parse(Ae.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const xe=new Error("server error");xe.code=Ae.data,this._onError(xe);break;case"message":this.emitReserved("data",Ae.data),this.emitReserved("message",Ae.data);break}}onHandshake(Ae){this.emitReserved("handshake",Ae),this.id=Ae.sid,this.transport.query.sid=Ae.sid,this._pingInterval=Ae.pingInterval,this._pingTimeout=Ae.pingTimeout,this._maxPayload=Ae.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const Ae=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+Ae,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},Ae),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const Ae=this._getWritablePackets();this.transport.send(Ae),this._prevBufferLen=Ae.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let xe=1;for(let Ee=0;Ee<this.writeBuffer.length;Ee++){const Se=this.writeBuffer[Ee].data;if(Se&&(xe+=byteLength$2(Se)),Ee>0&&xe>this._maxPayload)return this.writeBuffer.slice(0,Ee);xe+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const Ae=Date.now()>this._pingTimeoutTime;return Ae&&(this._pingTimeoutTime=0,nextTick(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),Ae}write(Ae,xe,Ee){return this._sendPacket("message",Ae,xe,Ee),this}send(Ae,xe,Ee){return this._sendPacket("message",Ae,xe,Ee),this}_sendPacket(Ae,xe,Ee,Se){if(typeof xe=="function"&&(Se=xe,xe=void 0),typeof Ee=="function"&&(Se=Ee,Ee=null),this.readyState==="closing"||this.readyState==="closed")return;Ee=Ee||{},Ee.compress=Ee.compress!==!1;const Ce={type:Ae,data:xe,options:Ee};this.emitReserved("packetCreate",Ce),this.writeBuffer.push(Ce),Se&&this.once("flush",Se),this.flush()}close(){const Ae=()=>{this._onClose("forced close"),this.transport.close()},xe=()=>{this.off("upgrade",xe),this.off("upgradeError",xe),Ae()},Ee=()=>{this.once("upgrade",xe),this.once("upgradeError",xe)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?Ee():Ae()}):this.upgrading?Ee():Ae()),this}_onError(Ae){if(SocketWithoutUpgrade.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",Ae),this._onClose("transport error",Ae)}_onClose(Ae,xe){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),withEventListeners&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const Ee=OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);Ee!==-1&&OFFLINE_EVENT_LISTENERS.splice(Ee,1)}this.readyState="closed",this.id=null,this.emitReserved("close",Ae,xe),this.writeBuffer=[],this._prevBufferLen=0}}}SocketWithoutUpgrade.protocol=protocol$1;class SocketWithUpgrade extends SocketWithoutUpgrade{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let Ae=0;Ae<this._upgrades.length;Ae++)this._probe(this._upgrades[Ae])}_probe(Ae){let xe=this.createTransport(Ae),Ee=!1;SocketWithoutUpgrade.priorWebsocketSuccess=!1;const Se=()=>{Ee||(xe.send([{type:"ping",data:"probe"}]),xe.once("packet",ke=>{if(!Ee)if(ke.type==="pong"&&ke.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",xe),!xe)return;SocketWithoutUpgrade.priorWebsocketSuccess=xe.name==="websocket",this.transport.pause(()=>{Ee||this.readyState!=="closed"&&(Pe(),this.setTransport(xe),xe.send([{type:"upgrade"}]),this.emitReserved("upgrade",xe),xe=null,this.upgrading=!1,this.flush())})}else{const $e=new Error("probe error");$e.transport=xe.name,this.emitReserved("upgradeError",$e)}}))};function Ce(){Ee||(Ee=!0,Pe(),xe.close(),xe=null)}const _e=ke=>{const $e=new Error("probe error: "+ke);$e.transport=xe.name,Ce(),this.emitReserved("upgradeError",$e)};function Ie(){_e("transport closed")}function Be(){_e("socket closed")}function Te(ke){xe&&ke.name!==xe.name&&Ce()}const Pe=()=>{xe.removeListener("open",Se),xe.removeListener("error",_e),xe.removeListener("close",Ie),this.off("close",Be),this.off("upgrading",Te)};xe.once("open",Se),xe.once("error",_e),xe.once("close",Ie),this.once("close",Be),this.once("upgrading",Te),this._upgrades.indexOf("webtransport")!==-1&&Ae!=="webtransport"?this.setTimeoutFn(()=>{Ee||xe.open()},200):xe.open()}onHandshake(Ae){this._upgrades=this._filterUpgrades(Ae.upgrades),super.onHandshake(Ae)}_filterUpgrades(Ae){const xe=[];for(let Ee=0;Ee<Ae.length;Ee++)~this.transports.indexOf(Ae[Ee])&&xe.push(Ae[Ee]);return xe}}let Socket$1=class extends SocketWithUpgrade{constructor(Ae,xe={}){const Ee=typeof Ae=="object"?Ae:xe;(!Ee.transports||Ee.transports&&typeof Ee.transports[0]=="string")&&(Ee.transports=(Ee.transports||["polling","websocket","webtransport"]).map(Se=>transports[Se]).filter(Se=>!!Se)),super(Ae,Ee)}};function url(t,Ae="",xe){let Ee=t;xe=xe||typeof location<"u"&&location,t==null&&(t=xe.protocol+"//"+xe.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=xe.protocol+t:t=xe.host+t),/^(https?|wss?):\/\//.test(t)||(typeof xe<"u"?t=xe.protocol+"//"+t:t="https://"+t),Ee=parse$4(t)),Ee.port||(/^(http|ws)$/.test(Ee.protocol)?Ee.port="80":/^(http|ws)s$/.test(Ee.protocol)&&(Ee.port="443")),Ee.path=Ee.path||"/";const Ce=Ee.host.indexOf(":")!==-1?"["+Ee.host+"]":Ee.host;return Ee.id=Ee.protocol+"://"+Ce+":"+Ee.port+Ae,Ee.href=Ee.protocol+"://"+Ce+(xe&&xe.port===Ee.port?"":":"+Ee.port),Ee}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,toString$6=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$6.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$6.call(File)==="[object FileConstructor]";function isBinary(t){return withNativeArrayBuffer&&(t instanceof ArrayBuffer||isView(t))||withNativeBlob&&t instanceof Blob||withNativeFile&&t instanceof File}function hasBinary(t,Ae){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let xe=0,Ee=t.length;xe<Ee;xe++)if(hasBinary(t[xe]))return!0;return!1}if(isBinary(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return hasBinary(t.toJSON(),!0);for(const xe in t)if(Object.prototype.hasOwnProperty.call(t,xe)&&hasBinary(t[xe]))return!0;return!1}function deconstructPacket(t){const Ae=[],xe=t.data,Ee=t;return Ee.data=_deconstructPacket(xe,Ae),Ee.attachments=Ae.length,{packet:Ee,buffers:Ae}}function _deconstructPacket(t,Ae){if(!t)return t;if(isBinary(t)){const xe={_placeholder:!0,num:Ae.length};return Ae.push(t),xe}else if(Array.isArray(t)){const xe=new Array(t.length);for(let Ee=0;Ee<t.length;Ee++)xe[Ee]=_deconstructPacket(t[Ee],Ae);return xe}else if(typeof t=="object"&&!(t instanceof Date)){const xe={};for(const Ee in t)Object.prototype.hasOwnProperty.call(t,Ee)&&(xe[Ee]=_deconstructPacket(t[Ee],Ae));return xe}return t}function reconstructPacket(t,Ae){return t.data=_reconstructPacket(t.data,Ae),delete t.attachments,t}function _reconstructPacket(t,Ae){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<Ae.length)return Ae[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let xe=0;xe<t.length;xe++)t[xe]=_reconstructPacket(t[xe],Ae);else if(typeof t=="object")for(const xe in t)Object.prototype.hasOwnProperty.call(t,xe)&&(t[xe]=_reconstructPacket(t[xe],Ae));return t}const RESERVED_EVENTS$1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],protocol=5;var PacketType;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(PacketType||(PacketType={}));class Encoder{constructor(Ae){this.replacer=Ae}encode(Ae){return(Ae.type===PacketType.EVENT||Ae.type===PacketType.ACK)&&hasBinary(Ae)?this.encodeAsBinary({type:Ae.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:Ae.nsp,data:Ae.data,id:Ae.id}):[this.encodeAsString(Ae)]}encodeAsString(Ae){let xe=""+Ae.type;return(Ae.type===PacketType.BINARY_EVENT||Ae.type===PacketType.BINARY_ACK)&&(xe+=Ae.attachments+"-"),Ae.nsp&&Ae.nsp!=="/"&&(xe+=Ae.nsp+","),Ae.id!=null&&(xe+=Ae.id),Ae.data!=null&&(xe+=JSON.stringify(Ae.data,this.replacer)),xe}encodeAsBinary(Ae){const xe=deconstructPacket(Ae),Ee=this.encodeAsString(xe.packet),Se=xe.buffers;return Se.unshift(Ee),Se}}function isObject$2(t){return Object.prototype.toString.call(t)==="[object Object]"}class Decoder extends Emitter{constructor(Ae){super(),this.reviver=Ae}add(Ae){let xe;if(typeof Ae=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");xe=this.decodeString(Ae);const Ee=xe.type===PacketType.BINARY_EVENT;Ee||xe.type===PacketType.BINARY_ACK?(xe.type=Ee?PacketType.EVENT:PacketType.ACK,this.reconstructor=new BinaryReconstructor(xe),xe.attachments===0&&super.emitReserved("decoded",xe)):super.emitReserved("decoded",xe)}else if(isBinary(Ae)||Ae.base64)if(this.reconstructor)xe=this.reconstructor.takeBinaryData(Ae),xe&&(this.reconstructor=null,super.emitReserved("decoded",xe));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+Ae)}decodeString(Ae){let xe=0;const Ee={type:Number(Ae.charAt(0))};if(PacketType[Ee.type]===void 0)throw new Error("unknown packet type "+Ee.type);if(Ee.type===PacketType.BINARY_EVENT||Ee.type===PacketType.BINARY_ACK){const Ce=xe+1;for(;Ae.charAt(++xe)!=="-"&&xe!=Ae.length;);const _e=Ae.substring(Ce,xe);if(_e!=Number(_e)||Ae.charAt(xe)!=="-")throw new Error("Illegal attachments");Ee.attachments=Number(_e)}if(Ae.charAt(xe+1)==="/"){const Ce=xe+1;for(;++xe&&!(Ae.charAt(xe)===","||xe===Ae.length););Ee.nsp=Ae.substring(Ce,xe)}else Ee.nsp="/";const Se=Ae.charAt(xe+1);if(Se!==""&&Number(Se)==Se){const Ce=xe+1;for(;++xe;){const _e=Ae.charAt(xe);if(_e==null||Number(_e)!=_e){--xe;break}if(xe===Ae.length)break}Ee.id=Number(Ae.substring(Ce,xe+1))}if(Ae.charAt(++xe)){const Ce=this.tryParse(Ae.substr(xe));if(Decoder.isPayloadValid(Ee.type,Ce))Ee.data=Ce;else throw new Error("invalid payload")}return Ee}tryParse(Ae){try{return JSON.parse(Ae,this.reviver)}catch{return!1}}static isPayloadValid(Ae,xe){switch(Ae){case PacketType.CONNECT:return isObject$2(xe);case PacketType.DISCONNECT:return xe===void 0;case PacketType.CONNECT_ERROR:return typeof xe=="string"||isObject$2(xe);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(xe)&&(typeof xe[0]=="number"||typeof xe[0]=="string"&&RESERVED_EVENTS$1.indexOf(xe[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(xe)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BinaryReconstructor{constructor(Ae){this.packet=Ae,this.buffers=[],this.reconPack=Ae}takeBinaryData(Ae){if(this.buffers.push(Ae),this.buffers.length===this.reconPack.attachments){const xe=reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),xe}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const parser=Object.freeze(Object.defineProperty({__proto__:null,Decoder,Encoder,get PacketType(){return PacketType},protocol},Symbol.toStringTag,{value:"Module"}));function on(t,Ae,xe){return t.on(Ae,xe),function(){t.off(Ae,xe)}}const RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Socket extends Emitter{constructor(Ae,xe,Ee){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=Ae,this.nsp=xe,Ee&&Ee.auth&&(this.auth=Ee.auth),this._opts=Object.assign({},Ee),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const Ae=this.io;this.subs=[on(Ae,"open",this.onopen.bind(this)),on(Ae,"packet",this.onpacket.bind(this)),on(Ae,"error",this.onerror.bind(this)),on(Ae,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...Ae){return Ae.unshift("message"),this.emit.apply(this,Ae),this}emit(Ae,...xe){var Ee,Se,Ce;if(RESERVED_EVENTS.hasOwnProperty(Ae))throw new Error('"'+Ae.toString()+'" is a reserved event name');if(xe.unshift(Ae),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(xe),this;const _e={type:PacketType.EVENT,data:xe};if(_e.options={},_e.options.compress=this.flags.compress!==!1,typeof xe[xe.length-1]=="function"){const Pe=this.ids++,ke=xe.pop();this._registerAckCallback(Pe,ke),_e.id=Pe}const Ie=(Se=(Ee=this.io.engine)===null||Ee===void 0?void 0:Ee.transport)===null||Se===void 0?void 0:Se.writable,Be=this.connected&&!(!((Ce=this.io.engine)===null||Ce===void 0)&&Ce._hasPingExpired());return this.flags.volatile&&!Ie||(Be?(this.notifyOutgoingListeners(_e),this.packet(_e)):this.sendBuffer.push(_e)),this.flags={},this}_registerAckCallback(Ae,xe){var Ee;const Se=(Ee=this.flags.timeout)!==null&&Ee!==void 0?Ee:this._opts.ackTimeout;if(Se===void 0){this.acks[Ae]=xe;return}const Ce=this.io.setTimeoutFn(()=>{delete this.acks[Ae];for(let Ie=0;Ie<this.sendBuffer.length;Ie++)this.sendBuffer[Ie].id===Ae&&this.sendBuffer.splice(Ie,1);xe.call(this,new Error("operation has timed out"))},Se),_e=(...Ie)=>{this.io.clearTimeoutFn(Ce),xe.apply(this,Ie)};_e.withError=!0,this.acks[Ae]=_e}emitWithAck(Ae,...xe){return new Promise((Ee,Se)=>{const Ce=(_e,Ie)=>_e?Se(_e):Ee(Ie);Ce.withError=!0,xe.push(Ce),this.emit(Ae,...xe)})}_addToQueue(Ae){let xe;typeof Ae[Ae.length-1]=="function"&&(xe=Ae.pop());const Ee={id:this._queueSeq++,tryCount:0,pending:!1,args:Ae,flags:Object.assign({fromQueue:!0},this.flags)};Ae.push((Se,...Ce)=>Ee!==this._queue[0]?void 0:(Se!==null?Ee.tryCount>this._opts.retries&&(this._queue.shift(),xe&&xe(Se)):(this._queue.shift(),xe&&xe(null,...Ce)),Ee.pending=!1,this._drainQueue())),this._queue.push(Ee),this._drainQueue()}_drainQueue(Ae=!1){if(!this.connected||this._queue.length===0)return;const xe=this._queue[0];xe.pending&&!Ae||(xe.pending=!0,xe.tryCount++,this.flags=xe.flags,this.emit.apply(this,xe.args))}packet(Ae){Ae.nsp=this.nsp,this.io._packet(Ae)}onopen(){typeof this.auth=="function"?this.auth(Ae=>{this._sendConnectPacket(Ae)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(Ae){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},Ae):Ae})}onerror(Ae){this.connected||this.emitReserved("connect_error",Ae)}onclose(Ae,xe){this.connected=!1,delete this.id,this.emitReserved("disconnect",Ae,xe),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(Ae=>{if(!this.sendBuffer.some(Ee=>String(Ee.id)===Ae)){const Ee=this.acks[Ae];delete this.acks[Ae],Ee.withError&&Ee.call(this,new Error("socket has been disconnected"))}})}onpacket(Ae){if(Ae.nsp===this.nsp)switch(Ae.type){case PacketType.CONNECT:Ae.data&&Ae.data.sid?this.onconnect(Ae.data.sid,Ae.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(Ae);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(Ae);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const Ee=new Error(Ae.data.message);Ee.data=Ae.data.data,this.emitReserved("connect_error",Ee);break}}onevent(Ae){const xe=Ae.data||[];Ae.id!=null&&xe.push(this.ack(Ae.id)),this.connected?this.emitEvent(xe):this.receiveBuffer.push(Object.freeze(xe))}emitEvent(Ae){if(this._anyListeners&&this._anyListeners.length){const xe=this._anyListeners.slice();for(const Ee of xe)Ee.apply(this,Ae)}super.emit.apply(this,Ae),this._pid&&Ae.length&&typeof Ae[Ae.length-1]=="string"&&(this._lastOffset=Ae[Ae.length-1])}ack(Ae){const xe=this;let Ee=!1;return function(...Se){Ee||(Ee=!0,xe.packet({type:PacketType.ACK,id:Ae,data:Se}))}}onack(Ae){const xe=this.acks[Ae.id];typeof xe=="function"&&(delete this.acks[Ae.id],xe.withError&&Ae.data.unshift(null),xe.apply(this,Ae.data))}onconnect(Ae,xe){this.id=Ae,this.recovered=xe&&this._pid===xe,this._pid=xe,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(Ae=>this.emitEvent(Ae)),this.receiveBuffer=[],this.sendBuffer.forEach(Ae=>{this.notifyOutgoingListeners(Ae),this.packet(Ae)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(Ae=>Ae()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(Ae){return this.flags.compress=Ae,this}get volatile(){return this.flags.volatile=!0,this}timeout(Ae){return this.flags.timeout=Ae,this}onAny(Ae){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(Ae),this}prependAny(Ae){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(Ae),this}offAny(Ae){if(!this._anyListeners)return this;if(Ae){const xe=this._anyListeners;for(let Ee=0;Ee<xe.length;Ee++)if(Ae===xe[Ee])return xe.splice(Ee,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(Ae){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(Ae),this}prependAnyOutgoing(Ae){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(Ae),this}offAnyOutgoing(Ae){if(!this._anyOutgoingListeners)return this;if(Ae){const xe=this._anyOutgoingListeners;for(let Ee=0;Ee<xe.length;Ee++)if(Ae===xe[Ee])return xe.splice(Ee,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(Ae){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const xe=this._anyOutgoingListeners.slice();for(const Ee of xe)Ee.apply(this,Ae.data)}}}function Backoff(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var Ae=Math.random(),xe=Math.floor(Ae*this.jitter*t);t=(Math.floor(Ae*10)&1)==0?t-xe:t+xe}return Math.min(t,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(t){this.ms=t};Backoff.prototype.setMax=function(t){this.max=t};Backoff.prototype.setJitter=function(t){this.jitter=t};class Manager extends Emitter{constructor(Ae,xe){var Ee;super(),this.nsps={},this.subs=[],Ae&&typeof Ae=="object"&&(xe=Ae,Ae=void 0),xe=xe||{},xe.path=xe.path||"/socket.io",this.opts=xe,installTimerFunctions(this,xe),this.reconnection(xe.reconnection!==!1),this.reconnectionAttempts(xe.reconnectionAttempts||1/0),this.reconnectionDelay(xe.reconnectionDelay||1e3),this.reconnectionDelayMax(xe.reconnectionDelayMax||5e3),this.randomizationFactor((Ee=xe.randomizationFactor)!==null&&Ee!==void 0?Ee:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(xe.timeout==null?2e4:xe.timeout),this._readyState="closed",this.uri=Ae;const Se=xe.parser||parser;this.encoder=new Se.Encoder,this.decoder=new Se.Decoder,this._autoConnect=xe.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(Ae){return arguments.length?(this._reconnection=!!Ae,Ae||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(Ae){return Ae===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=Ae,this)}reconnectionDelay(Ae){var xe;return Ae===void 0?this._reconnectionDelay:(this._reconnectionDelay=Ae,(xe=this.backoff)===null||xe===void 0||xe.setMin(Ae),this)}randomizationFactor(Ae){var xe;return Ae===void 0?this._randomizationFactor:(this._randomizationFactor=Ae,(xe=this.backoff)===null||xe===void 0||xe.setJitter(Ae),this)}reconnectionDelayMax(Ae){var xe;return Ae===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=Ae,(xe=this.backoff)===null||xe===void 0||xe.setMax(Ae),this)}timeout(Ae){return arguments.length?(this._timeout=Ae,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(Ae){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const xe=this.engine,Ee=this;this._readyState="opening",this.skipReconnect=!1;const Se=on(xe,"open",function(){Ee.onopen(),Ae&&Ae()}),Ce=Ie=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",Ie),Ae?Ae(Ie):this.maybeReconnectOnOpen()},_e=on(xe,"error",Ce);if(this._timeout!==!1){const Ie=this._timeout,Be=this.setTimeoutFn(()=>{Se(),Ce(new Error("timeout")),xe.close()},Ie);this.opts.autoUnref&&Be.unref(),this.subs.push(()=>{this.clearTimeoutFn(Be)})}return this.subs.push(Se),this.subs.push(_e),this}connect(Ae){return this.open(Ae)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const Ae=this.engine;this.subs.push(on(Ae,"ping",this.onping.bind(this)),on(Ae,"data",this.ondata.bind(this)),on(Ae,"error",this.onerror.bind(this)),on(Ae,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(Ae){try{this.decoder.add(Ae)}catch(xe){this.onclose("parse error",xe)}}ondecoded(Ae){nextTick(()=>{this.emitReserved("packet",Ae)},this.setTimeoutFn)}onerror(Ae){this.emitReserved("error",Ae)}socket(Ae,xe){let Ee=this.nsps[Ae];return Ee?this._autoConnect&&!Ee.active&&Ee.connect():(Ee=new Socket(this,Ae,xe),this.nsps[Ae]=Ee),Ee}_destroy(Ae){const xe=Object.keys(this.nsps);for(const Ee of xe)if(this.nsps[Ee].active)return;this._close()}_packet(Ae){const xe=this.encoder.encode(Ae);for(let Ee=0;Ee<xe.length;Ee++)this.engine.write(xe[Ee],Ae.options)}cleanup(){this.subs.forEach(Ae=>Ae()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(Ae,xe){var Ee;this.cleanup(),(Ee=this.engine)===null||Ee===void 0||Ee.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",Ae,xe),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const Ae=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const xe=this.backoff.duration();this._reconnecting=!0;const Ee=this.setTimeoutFn(()=>{Ae.skipReconnect||(this.emitReserved("reconnect_attempt",Ae.backoff.attempts),!Ae.skipReconnect&&Ae.open(Se=>{Se?(Ae._reconnecting=!1,Ae.reconnect(),this.emitReserved("reconnect_error",Se)):Ae.onreconnect()}))},xe);this.opts.autoUnref&&Ee.unref(),this.subs.push(()=>{this.clearTimeoutFn(Ee)})}}onreconnect(){const Ae=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",Ae)}}const cache={};function lookup$6(t,Ae){typeof t=="object"&&(Ae=t,t=void 0),Ae=Ae||{};const xe=url(t,Ae.path||"/socket.io"),Ee=xe.source,Se=xe.id,Ce=xe.path,_e=cache[Se]&&Ce in cache[Se].nsps,Ie=Ae.forceNew||Ae["force new connection"]||Ae.multiplex===!1||_e;let Be;return Ie?Be=new Manager(Ee,Ae):(cache[Se]||(cache[Se]=new Manager(Ee,Ae)),Be=cache[Se]),xe.query&&!Ae.query&&(Ae.query=xe.queryKey),Be.socket(xe.path,Ae)}Object.assign(lookup$6,{Manager,Socket,io:lookup$6,connect:lookup$6});const AssessmentIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Assessment"),EmptyState=()=>jsxRuntimeExports.jsx(Box,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh",children:jsxRuntimeExports.jsxs(Paper,{elevation:3,sx:{p:4,textAlign:"center",maxWidth:400},children:[jsxRuntimeExports.jsx(AssessmentIcon,{sx:{fontSize:60,mb:2,color:"primary.main"}}),jsxRuntimeExports.jsx(Typography,{variant:"h5",gutterBottom:!0,children:"Welcome to Promptfoo"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",color:"text.secondary",children:"Run your first evaluation and results will appear here"})]})}),useToast=()=>{const t=reactExports.useContext(ToastContext);if(t===void 0)throw new Error("useToast must be used within a ToastProvider");return t},ClearIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),PlayArrowIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),SearchIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),ShareIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"}),"Share"),VisibilityIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");class PromptMetrics{constructor(){this.score=0,this.testPassCount=0,this.testFailCount=0,this.testErrorCount=0,this.assertPassCount=0,this.assertFailCount=0,this.totalLatencyMs=0,this.tokenUsage={total:0,prompt:0,completion:0,cached:0,assertions:{total:0,prompt:0,completion:0,cached:0}},this.namedScores={},this.namedScoresCount={},this.cost=0}}function convertResultsToTable(t){var Be,Te,Pe,ke,$e,Oe,Ue,qe,ze,Ve,Ge,Xe,er,tr,nr,sr,dr,ar,lr,Ke,Me,je,De,He,Qe;invariant(t.prompts,`Prompts are required in this version of the results file, this needs to be results file version >= 4, version: ${t.version}`);const Ae=t.results,xe=[],Ee=new Set,Se=new Map,Ce={};for(const Ye of Ae.results){for(const ur of Object.keys(Ye.vars||{}))Ee.add(ur);const St=Ce[Ye.testIdx]||{description:Ye.description||void 0,outputs:[],vars:Ye.vars?Object.values(Ee).map(ur=>{var Ar;const fr=((Ar=Ye.vars)==null?void 0:Ar[ur])||"";return typeof fr=="string"?fr:JSON.stringify(fr)}).flat():[],test:Ye.testCase};if(Ye.vars&&((Be=Ye.metadata)!=null&&Be.redteamFinalPrompt)){const ur=Object.keys(Ye.vars);if(ur.length===1&&ur[0]!=="harmCategory")Ye.vars[ur[0]]=Ye.metadata.redteamFinalPrompt;else if(ur.length>1){const Ar=["prompt","query","question"].find(vr=>Ye.vars[vr]);Ar&&(Ye.vars[Ar]=Ye.metadata.redteamFinalPrompt)}}Se.set(Ye.testIdx,Ye.vars),Ce[Ye.testIdx]=St;let We;const Fe=(((Te=Ye.gradingResult)==null?void 0:Te.componentResults)||[]).filter(ur=>ur?!ur.pass:!1).map(ur=>ur.reason).join(" --- "),Ze=typeof((Pe=Ye.response)==null?void 0:Pe.output)=="object"?JSON.stringify(Ye.response.output):((ke=Ye.response)==null?void 0:ke.output)||Ye.error||"";Ye.testCase.assert?Ye.success?We=`${Ze||Ye.error||""}`:We=`${Ye.error||Fe}
576
576
  ---
577
- ${Ze}`:Ye.error?We=`${Ye.error}`:We=Ze,St.outputs[Ye.promptIdx]={id:Ye.id||`${Ye.testIdx}-${Ye.promptIdx}`,...Ye,text:We||"",prompt:Ye.prompt.raw,provider:(($e=Ye.provider)==null?void 0:$e.label)||((Oe=Ye.provider)==null?void 0:Oe.id)||"unknown provider",pass:Ye.success,failureReason:Ye.failureReason,cost:Ye.cost||0,audio:(Ue=Ye.response)!=null&&Ue.audio?{id:Ye.response.audio.id,expiresAt:Ye.response.audio.expiresAt,data:Ye.response.audio.data,transcript:Ye.response.audio.transcript,format:Ye.response.audio.format}:void 0},invariant(Ye.promptId,"Prompt ID is required"),xe[Ye.promptIdx]||(xe[Ye.promptIdx]={...Ye.prompt,provider:((qe=Ye.provider)==null?void 0:qe.label)||((ze=Ye.provider)==null?void 0:ze.id)||"unknown provider",metrics:new PromptMetrics}),St.testIdx=Ye.testIdx;const ir=xe[Ye.promptIdx];invariant(ir.metrics,"Prompt metrics are required"),ir.metrics.score+=Ye.score,ir.metrics.testPassCount+=Ye.success?1:0,ir.metrics.testFailCount+=Ye.success?0:1,ir.metrics.testErrorCount+=Ye.failureReason===ResultFailureReason.ERROR?1:0,ir.metrics.assertPassCount+=((Ge=(Ve=Ye.gradingResult)==null?void 0:Ve.componentResults)==null?void 0:Ge.filter(ur=>ur.pass).length)||0,ir.metrics.assertFailCount+=((er=(Xe=Ye.gradingResult)==null?void 0:Xe.componentResults)==null?void 0:er.filter(ur=>!ur.pass).length)||0,ir.metrics.totalLatencyMs+=Ye.latencyMs||0,ir.metrics.tokenUsage.cached+=((nr=(tr=Ye.response)==null?void 0:tr.tokenUsage)==null?void 0:nr.cached)||0,ir.metrics.tokenUsage.completion+=((dr=(sr=Ye.response)==null?void 0:sr.tokenUsage)==null?void 0:dr.completion)||0,ir.metrics.tokenUsage.prompt+=((lr=(ar=Ye.response)==null?void 0:ar.tokenUsage)==null?void 0:lr.prompt)||0,ir.metrics.tokenUsage.total+=((Me=(Ke=Ye.response)==null?void 0:Ke.tokenUsage)==null?void 0:Me.total)||0,ir.metrics.cost+=Ye.cost||0,ir.metrics.namedScores=((De=(je=t.prompts[Ye.promptIdx])==null?void 0:je.metrics)==null?void 0:De.namedScores)||{},ir.metrics.namedScoresCount=((Qe=(He=t.prompts[Ye.promptIdx])==null?void 0:He.metrics)==null?void 0:Qe.namedScoresCount)||{}}const _e=Object.values(Ce),Ie=[...Ee].sort();for(const Ye of _e)Ye.vars=Ie.map(St=>{var We;return((We=Se.get(Ye.testIdx))==null?void 0:We[St])||""});return{head:{prompts:xe,vars:[...Ee].sort()},body:_e}}const EmailIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"Email"),AuthorChip=({author:t,onEditAuthor:Ae,currentUserEmail:xe,editable:Ee})=>{const[Se,Ce]=reactExports.useState(!1),[_e,Ie]=reactExports.useState(null),[Be,Te]=reactExports.useState(t||""),[Pe,ke]=reactExports.useState(null);reactExports.useEffect(()=>{!t&&xe&&Te(xe)},[t,xe]);const $e=Ge=>{Ie(Ge.currentTarget),Te(t||xe||""),ke(null)},Oe=()=>{Ie(null)},Ue=async()=>{if(!Se){Ce(!0),ke(null);try{await Ae(Be||""),Oe()}catch(Ge){ke(Ge instanceof Error?Ge.message:"An unknown error occurred")}finally{Ce(!1)}}},qe=Ge=>{Ge.key==="Enter"&&Ue()},ze=!!_e,Ve=ze?"author-popover":void 0;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip$2,{title:Ee?t?"Click to edit author":"Click to set author":"Author",children:jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",onClick:Ee?$e:void 0,sx:{border:"1px solid",borderColor:"divider",borderRadius:1,px:1,py:.5,"&:hover":{bgcolor:"action.hover"},minHeight:40,cursor:Ee?"pointer":"default"},children:[jsxRuntimeExports.jsx(EmailIcon,{fontSize:"small",sx:{mr:1,opacity:.7}}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",sx:{mr:1},children:[jsxRuntimeExports.jsx("strong",{children:"Author:"})," ",t||"Unknown"]}),Ee&&jsxRuntimeExports.jsx(IconButton,{size:"small",sx:{ml:"auto"},disabled:Se,children:jsxRuntimeExports.jsx(EditIcon,{fontSize:"small"})})]})}),jsxRuntimeExports.jsx(Popover,{id:Ve,open:ze,anchorEl:_e,onClose:Oe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:jsxRuntimeExports.jsxs(Box,{sx:{p:2,display:"flex",flexDirection:"column",width:"400px"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"flex-end",mb:2},children:[jsxRuntimeExports.jsx(TextField,{label:"Author Email",variant:"standard",value:Be,onChange:Ge=>Te(Ge.target.value),onKeyPress:qe,error:!!Pe,helperText:Pe,disabled:Se,sx:{flexGrow:1,mr:2}}),jsxRuntimeExports.jsx(Button,{onClick:Ue,disabled:Se||!Be,children:Se?jsxRuntimeExports.jsx(CircularProgress,{size:24}):"Save"})]}),!xe&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center"},children:[jsxRuntimeExports.jsx(InfoIcon,{color:"info",fontSize:"small",sx:{mr:1}}),jsxRuntimeExports.jsx(Typography,{variant:"caption",children:"Setting an email address will also set the default author for future evals.\n It is changeable with `promptfoo config set email <your-email@example.com>`"})]})]})})]})},ViewColumnIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"}),"ViewColumn"),ColumnSelector=({columnData:t,selectedColumns:Ae,onChange:xe})=>{const[Ee,Se]=React.useState(!1),Ce=()=>Se(!0),_e=()=>Se(!1),Ie=$e=>({target:{value:$e,name:"visible-columns"},currentTarget:{value:$e,name:"visible-columns"},bubbles:!0,cancelBubble:!1,cancelable:!1,composed:!1,defaultPrevented:!1,eventPhase:0,isTrusted:!0,returnValue:!0,type:"change"}),Be=$e=>{const Oe=Ae.includes($e)?Ae.filter(Ue=>Ue!==$e):[...Ae,$e];xe(Ie(Oe))},Te=()=>{xe(Ie(t.map($e=>$e.value)))},Pe=()=>{xe(Ie([]))},ke=t.reduce(($e,Oe)=>{const Ue=(Oe==null?void 0:Oe.group)||"Other";return $e[Ue]||($e[Ue]=[]),$e[Ue].push(Oe),$e},{});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Button,{onClick:Ce,startIcon:jsxRuntimeExports.jsx(ViewColumnIcon,{}),variant:"text",children:["Columns (",Ae.length,")"]}),jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:_e,maxWidth:"sm",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Select Columns"}),jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:1,children:[jsxRuntimeExports.jsx(Button,{size:"small",onClick:Te,children:"Select All"}),jsxRuntimeExports.jsx(Button,{size:"small",onClick:Pe,children:"Clear"})]})]})}),jsxRuntimeExports.jsx(DialogContent,{dividers:!0,children:Object.entries(ke).map(([$e,Oe])=>jsxRuntimeExports.jsx(List$1,{subheader:jsxRuntimeExports.jsx(ListSubheader,{component:"div",sx:{bgcolor:"background.paper"},children:$e}),children:Oe.map(Ue=>jsxRuntimeExports.jsx(ListItem,{dense:!0,disablePadding:!0,children:jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Checkbox,{edge:"start",checked:Ae.includes(Ue.value),onChange:()=>Be(Ue.value)}),label:jsxRuntimeExports.jsx(Tooltip$2,{title:Ue.description||Ue.label,placement:"right",children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{maxWidth:"500px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ue.label})}),sx:{ml:1,width:"100%"}})},Ue.value))},$e))}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:_e,children:"Close"})})]})]})},CompareIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"Compare"),GridToolbarExport$1=()=>jsxRuntimeExports.jsx(GridToolbarExportContainer,{children:jsxRuntimeExports.jsx(GridCsvExportMenuItem,{})}),QuickFilter=reactExports.forwardRef((t,Ae)=>{const xe=useTheme();return jsxRuntimeExports.jsx(GridToolbarQuickFilter,{...t,inputRef:Ae,sx:{"& .MuiInputBase-root":{borderRadius:2,backgroundColor:xe.palette.background.paper}}})});QuickFilter.displayName="QuickFilter";function CustomToolbar$2({showUtilityButtons:t,focusQuickFilterOnMount:Ae}){const xe=useTheme(),Ee=reactExports.useRef(null);return reactExports.useEffect(()=>{Ae&&Ee.current&&Ee.current.focus()},[Ae]),jsxRuntimeExports.jsxs(GridToolbarContainer,{sx:{p:1,borderBottom:`1px solid ${xe.palette.divider}`},children:[t&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1},children:[jsxRuntimeExports.jsx(GridToolbarColumnsButton,{}),jsxRuntimeExports.jsx(GridToolbarFilterButton,{}),jsxRuntimeExports.jsx(GridToolbarDensitySelector,{}),jsxRuntimeExports.jsx(GridToolbarExport$1,{})]}),jsxRuntimeExports.jsx(Box,{sx:{flexGrow:1}}),jsxRuntimeExports.jsx(QuickFilter,{ref:Ee})]})}function EvalsDataGrid({onEvalSelected:t,focusedEvalId:Ae,showUtilityButtons:xe=!1,filterByDatasetId:Ee=!1,focusQuickFilterOnMount:Se=!1}){Ee&&invariant(Ae,"focusedEvalId is required when filterByDatasetId is true");const[Ce,_e]=reactExports.useState([]),[Ie,Be]=reactExports.useState(!0),[Te,Pe]=reactExports.useState(null),[ke,$e]=reactExports.useState(Ae?[Ae]:[]);reactExports.useEffect(()=>{(async()=>{try{const Ve=await callApi("/results",{cache:"no-store"});if(!Ve.ok)throw new Error("Failed to fetch evals");const Ge=await Ve.json();_e(Ge.data)}catch(Ve){Pe(Ve)}finally{Be(!1)}})()},[]);const Oe=reactExports.useMemo(()=>{let ze=Ce;if(Ae&&ze.length>0){const Ve=ze.find(({evalId:Ge})=>Ge===Ae);invariant(Ve,"focusedEvalId is not a valid eval ID"),ze=ze.filter(({evalId:Ge})=>Ge!==Ae),Ee&&(ze=ze.filter(({datasetId:Ge})=>Ge===Ve.datasetId))}return ze},[Ce,Ee,Ae]),Ue=ze=>t(ze.row.evalId),qe=reactExports.useMemo(()=>[{field:"evalId",headerName:"ID",flex:1,renderCell:ze=>jsxRuntimeExports.jsx(Link,{href:`/eval/${ze.row.evalId}`,onClick:Ve=>(Ve.preventDefault(),t(ze.row.evalId),!1),children:ze.row.evalId})},{field:"createdAt",headerName:"Created",flex:1,valueFormatter:ze=>new Date(ze).toLocaleString()},{field:"description",headerName:"Description",flex:1,valueGetter:(ze,Ve)=>ze??Ve.label},{field:"passRate",headerName:"Pass Rate",flex:.5,type:"number",renderCell:ze=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:ze.value>=90?"success.main":ze.value>=60?"warning.main":"error.main",sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"end"},children:[ze.value.toFixed(2),"%"]})})},{field:"numTests",headerName:"# Tests",type:"number",flex:.5}].filter(Boolean),[]);return jsxRuntimeExports.jsx(Paper,{elevation:2,sx:{height:"100%"},children:jsxRuntimeExports.jsx(DataGrid,{rows:Oe,columns:qe,loading:Ie,getRowId:ze=>ze.evalId,slots:{toolbar:CustomToolbar$2,loadingOverlay:()=>jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:2},children:[jsxRuntimeExports.jsx(CircularProgress,{}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Loading evaluations..."})]}),noRowsOverlay:()=>jsxRuntimeExports.jsx(Box,{sx:{textAlign:"center",color:"text.secondary",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",p:3},children:Te?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{fontSize:"2rem",mb:2},children:"⚠️"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,color:"error",children:"Error loading evals"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:Te.message})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{fontSize:"2rem",mb:2},children:"🔍"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,children:"No evals found"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Try adjusting your search or create a new evaluation"})]})})},slotProps:{toolbar:{showUtilityButtons:xe,focusQuickFilterOnMount:Se}},onCellClick:Ue,sx:{border:"none","& .MuiDataGrid-row":{cursor:"pointer",transition:"background-color 0.2s ease","&:hover":{backgroundColor:"action.hover"}},"& .MuiDataGrid-cell":{borderColor:"divider"},"& .MuiDataGrid-columnHeaders":{backgroundColor:"background.default",borderColor:"divider"},"& .MuiDataGrid-selectedRow":{backgroundColor:"action.selected"},"--DataGrid-overlayHeight":"300px"},onRowSelectionModelChange:$e,rowSelectionModel:ke,initialState:{sorting:{sortModel:[{field:"createdAt",sort:"desc"}]},pagination:{paginationModel:{pageSize:25}}},pageSizeOptions:[10,25,50,100]})})}const EvalSelectorDialog=({open:t,onClose:Ae,onEvalSelected:xe,title:Ee,description:Se,focusedEvalId:Ce,filterByDatasetId:_e,onOpenFocusSearch:Ie=!1})=>jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ae,maxWidth:"md",fullWidth:!0,children:[Ee?jsxRuntimeExports.jsx(DialogTitle,{children:Ee}):null,jsxRuntimeExports.jsxs(DialogContent,{children:[Se?jsxRuntimeExports.jsx(Box,{sx:{mb:4},children:Se}):null,jsxRuntimeExports.jsx(Box,{sx:{width:"100%",mt:2},children:jsxRuntimeExports.jsx(EvalsDataGrid,{onEvalSelected:xe,focusedEvalId:Ce,filterByDatasetId:_e,focusQuickFilterOnMount:Ie})})]}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:Ae,children:"Cancel"})})]}),useStore=create$1()((t,Ae)=>({evalId:null,setEvalId:xe=>t(()=>({evalId:xe})),author:null,setAuthor:xe=>t(()=>({author:xe})),version:null,setVersion:xe=>t(()=>({version:xe})),table:null,setTable:xe=>t(()=>({table:xe})),setTableFromResultsFile:xe=>{if(xe.version&&xe.version>=4)t(()=>({table:convertResultsToTable(xe),version:xe.version}));else{const Ee=xe.results;t(()=>({table:Ee.table,version:xe.version}))}},config:null,setConfig:xe=>t(()=>({config:xe}))})),useResultsViewSettingsStore=create$1()(persist((t,Ae)=>({maxTextLength:250,setMaxTextLength:xe=>t(()=>({maxTextLength:xe})),wordBreak:"break-word",setWordBreak:xe=>t(()=>({wordBreak:xe})),showInferenceDetails:!0,setShowInferenceDetails:xe=>t(()=>({showInferenceDetails:xe})),renderMarkdown:!1,setRenderMarkdown:xe=>t(()=>({renderMarkdown:xe})),prettifyJson:!1,setPrettifyJson:xe=>t(()=>({prettifyJson:xe})),showPrompts:!1,setShowPrompts:xe=>t(()=>({showPrompts:xe})),showPassFail:!0,setShowPassFail:xe=>t(()=>({showPassFail:xe})),inComparisonMode:!1,setInComparisonMode:xe=>t(()=>({inComparisonMode:xe})),stickyHeader:!0,setStickyHeader:xe=>t(()=>({stickyHeader:xe})),columnStates:{},setColumnState:(xe,Ee)=>t(Se=>({columnStates:{...Se.columnStates,[xe]:Ee}})),maxImageWidth:256,setMaxImageWidth:xe=>t(()=>({maxImageWidth:xe})),maxImageHeight:256,setMaxImageHeight:xe=>t(()=>({maxImageHeight:xe}))}),{name:"eval-settings"}));function CompareEvalMenuItem({onComparisonEvalSelected:t}){const{evalId:Ae}=useStore(),[xe,Ee]=reactExports.useState(!1),Se=()=>{Ee(!0)},Ce=()=>{Ee(!1)},_e=Ie=>{t(Ie),Ce()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip$2,{title:"Combine this eval with another eval run",placement:"left",children:jsxRuntimeExports.jsxs(MenuItem,{onClick:Se,children:[jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(CompareIcon,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText,{children:"Compare with another eval"})]})}),jsxRuntimeExports.jsx(EvalSelectorDialog,{open:xe,onClose:Ce,onEvalSelected:Ie=>{_e(Ie)},title:"Select an eval to compare",description:"Only evals with the same dataset can be compared.",focusedEvalId:Ae??void 0,filterByDatasetId:!0})]})}const CheckIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),DownloadIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download"),FileCopyIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}),"FileCopy");function ConfigModal({open:t,onClose:Ae}){const{config:xe}=useStore(),Ee=React.useRef(null),[Se,Ce]=React.useState(!1),[_e,Ie]=React.useState("");React.useEffect(()=>{t&&(async()=>{const{default:ke}=await __vitePreload(async()=>{const{default:$e}=await Promise.resolve().then(()=>jsYaml$1);return{default:$e}},void 0);Ie(ke.dump(xe))})()},[t,xe]);const Be=()=>{Ee.current&&(Ee.current.select(),document.execCommand("copy"),Ce(!0))},Te=()=>{const ke=new Blob([_e],{type:"text/yaml;charset=utf-8"}),$e=URL.createObjectURL(ke),Oe=document.createElement("a");Oe.href=$e,Oe.download="config.yaml",document.body.appendChild(Oe),Oe.click(),document.body.removeChild(Oe),URL.revokeObjectURL($e)},Pe=()=>{Ce(!1),Ae()};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Pe,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{id:"config-dialog-title",children:jsxRuntimeExports.jsxs(Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",style:{flexGrow:1},children:"Config"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Tooltip$2,{title:"Copy to clipboard",children:jsxRuntimeExports.jsx(IconButton,{onClick:Be,children:Se?jsxRuntimeExports.jsx(CheckIcon,{}):jsxRuntimeExports.jsx(FileCopyIcon,{})})}),jsxRuntimeExports.jsx(Tooltip$2,{title:"Download .yaml",children:jsxRuntimeExports.jsx(IconButton,{onClick:Te,children:jsxRuntimeExports.jsx(DownloadIcon,{})})})]})]})}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsx(Typography,{variant:"body1",component:"div",children:jsxRuntimeExports.jsx("textarea",{ref:Ee,readOnly:!0,value:_e,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:Pe,color:"primary",children:"Close"})})]})}const CheckCircleIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),removeEmpty=t=>{const Ae=JSON.parse(JSON.stringify(t));return Object.keys(Ae).forEach(xe=>{(Array.isArray(Ae[xe])&&Ae[xe].length===0||Ae[xe]&&typeof Ae[xe]=="object"&&!Array.isArray(Ae[xe])&&Object.keys(Ae[xe]).length===0)&&delete Ae[xe]}),Ae};var global$1$1=typeof global$2<"u"?global$2:typeof self<"u"?self:typeof window<"u"?window:{},lookup$5=[],revLookup$1=[],Arr$1=typeof Uint8Array<"u"?Uint8Array:Array,inited$1=!1;function init$1(){inited$1=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ae=0,xe=t.length;Ae<xe;++Ae)lookup$5[Ae]=t[Ae],revLookup$1[t.charCodeAt(Ae)]=Ae;revLookup$1[45]=62,revLookup$1[95]=63}function toByteArray$1(t){inited$1||init$1();var Ae,xe,Ee,Se,Ce,_e,Ie=t.length;if(Ie%4>0)throw new Error("Invalid string. Length must be a multiple of 4");Ce=t[Ie-2]==="="?2:t[Ie-1]==="="?1:0,_e=new Arr$1(Ie*3/4-Ce),Ee=Ce>0?Ie-4:Ie;var Be=0;for(Ae=0,xe=0;Ae<Ee;Ae+=4,xe+=3)Se=revLookup$1[t.charCodeAt(Ae)]<<18|revLookup$1[t.charCodeAt(Ae+1)]<<12|revLookup$1[t.charCodeAt(Ae+2)]<<6|revLookup$1[t.charCodeAt(Ae+3)],_e[Be++]=Se>>16&255,_e[Be++]=Se>>8&255,_e[Be++]=Se&255;return Ce===2?(Se=revLookup$1[t.charCodeAt(Ae)]<<2|revLookup$1[t.charCodeAt(Ae+1)]>>4,_e[Be++]=Se&255):Ce===1&&(Se=revLookup$1[t.charCodeAt(Ae)]<<10|revLookup$1[t.charCodeAt(Ae+1)]<<4|revLookup$1[t.charCodeAt(Ae+2)]>>2,_e[Be++]=Se>>8&255,_e[Be++]=Se&255),_e}function tripletToBase64$1(t){return lookup$5[t>>18&63]+lookup$5[t>>12&63]+lookup$5[t>>6&63]+lookup$5[t&63]}function encodeChunk$1(t,Ae,xe){for(var Ee,Se=[],Ce=Ae;Ce<xe;Ce+=3)Ee=(t[Ce]<<16)+(t[Ce+1]<<8)+t[Ce+2],Se.push(tripletToBase64$1(Ee));return Se.join("")}function fromByteArray$1(t){inited$1||init$1();for(var Ae,xe=t.length,Ee=xe%3,Se="",Ce=[],_e=16383,Ie=0,Be=xe-Ee;Ie<Be;Ie+=_e)Ce.push(encodeChunk$1(t,Ie,Ie+_e>Be?Be:Ie+_e));return Ee===1?(Ae=t[xe-1],Se+=lookup$5[Ae>>2],Se+=lookup$5[Ae<<4&63],Se+="=="):Ee===2&&(Ae=(t[xe-2]<<8)+t[xe-1],Se+=lookup$5[Ae>>10],Se+=lookup$5[Ae>>4&63],Se+=lookup$5[Ae<<2&63],Se+="="),Ce.push(Se),Ce.join("")}function read$1(t,Ae,xe,Ee,Se){var Ce,_e,Ie=Se*8-Ee-1,Be=(1<<Ie)-1,Te=Be>>1,Pe=-7,ke=xe?Se-1:0,$e=xe?-1:1,Oe=t[Ae+ke];for(ke+=$e,Ce=Oe&(1<<-Pe)-1,Oe>>=-Pe,Pe+=Ie;Pe>0;Ce=Ce*256+t[Ae+ke],ke+=$e,Pe-=8);for(_e=Ce&(1<<-Pe)-1,Ce>>=-Pe,Pe+=Ee;Pe>0;_e=_e*256+t[Ae+ke],ke+=$e,Pe-=8);if(Ce===0)Ce=1-Te;else{if(Ce===Be)return _e?NaN:(Oe?-1:1)*(1/0);_e=_e+Math.pow(2,Ee),Ce=Ce-Te}return(Oe?-1:1)*_e*Math.pow(2,Ce-Ee)}function write$1(t,Ae,xe,Ee,Se,Ce){var _e,Ie,Be,Te=Ce*8-Se-1,Pe=(1<<Te)-1,ke=Pe>>1,$e=Se===23?Math.pow(2,-24)-Math.pow(2,-77):0,Oe=Ee?0:Ce-1,Ue=Ee?1:-1,qe=Ae<0||Ae===0&&1/Ae<0?1:0;for(Ae=Math.abs(Ae),isNaN(Ae)||Ae===1/0?(Ie=isNaN(Ae)?1:0,_e=Pe):(_e=Math.floor(Math.log(Ae)/Math.LN2),Ae*(Be=Math.pow(2,-_e))<1&&(_e--,Be*=2),_e+ke>=1?Ae+=$e/Be:Ae+=$e*Math.pow(2,1-ke),Ae*Be>=2&&(_e++,Be/=2),_e+ke>=Pe?(Ie=0,_e=Pe):_e+ke>=1?(Ie=(Ae*Be-1)*Math.pow(2,Se),_e=_e+ke):(Ie=Ae*Math.pow(2,ke-1)*Math.pow(2,Se),_e=0));Se>=8;t[xe+Oe]=Ie&255,Oe+=Ue,Ie/=256,Se-=8);for(_e=_e<<Se|Ie,Te+=Se;Te>0;t[xe+Oe]=_e&255,Oe+=Ue,_e/=256,Te-=8);t[xe+Oe-Ue]|=qe*128}var toString$5={}.toString,isArray$3=Array.isArray||function(t){return toString$5.call(t)=="[object Array]"},INSPECT_MAX_BYTES$1=50;Buffer$1.TYPED_ARRAY_SUPPORT=global$1$1.TYPED_ARRAY_SUPPORT!==void 0?global$1$1.TYPED_ARRAY_SUPPORT:!0;kMaxLength$1();function kMaxLength$1(){return Buffer$1.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer$1(t,Ae){if(kMaxLength$1()<Ae)throw new RangeError("Invalid typed array length");return Buffer$1.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(Ae),t.__proto__=Buffer$1.prototype):(t===null&&(t=new Buffer$1(Ae)),t.length=Ae),t}function Buffer$1(t,Ae,xe){if(!Buffer$1.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer$1))return new Buffer$1(t,Ae,xe);if(typeof t=="number"){if(typeof Ae=="string")throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe$1(this,t)}return from$2(this,t,Ae,xe)}Buffer$1.poolSize=8192;Buffer$1._augment=function(t){return t.__proto__=Buffer$1.prototype,t};function from$2(t,Ae,xe,Ee){if(typeof Ae=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&Ae instanceof ArrayBuffer?fromArrayBuffer$1(t,Ae,xe,Ee):typeof Ae=="string"?fromString$1(t,Ae,xe):fromObject$2(t,Ae)}Buffer$1.from=function(t,Ae,xe){return from$2(null,t,Ae,xe)};Buffer$1.TYPED_ARRAY_SUPPORT&&(Buffer$1.prototype.__proto__=Uint8Array.prototype,Buffer$1.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Buffer$1[Symbol.species]);function assertSize$1(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function alloc$1(t,Ae,xe,Ee){return assertSize$1(Ae),Ae<=0?createBuffer$1(t,Ae):xe!==void 0?typeof Ee=="string"?createBuffer$1(t,Ae).fill(xe,Ee):createBuffer$1(t,Ae).fill(xe):createBuffer$1(t,Ae)}Buffer$1.alloc=function(t,Ae,xe){return alloc$1(null,t,Ae,xe)};function allocUnsafe$1(t,Ae){if(assertSize$1(Ae),t=createBuffer$1(t,Ae<0?0:checked$1(Ae)|0),!Buffer$1.TYPED_ARRAY_SUPPORT)for(var xe=0;xe<Ae;++xe)t[xe]=0;return t}Buffer$1.allocUnsafe=function(t){return allocUnsafe$1(null,t)};Buffer$1.allocUnsafeSlow=function(t){return allocUnsafe$1(null,t)};function fromString$1(t,Ae,xe){if((typeof xe!="string"||xe==="")&&(xe="utf8"),!Buffer$1.isEncoding(xe))throw new TypeError('"encoding" must be a valid string encoding');var Ee=byteLength$1(Ae,xe)|0;t=createBuffer$1(t,Ee);var Se=t.write(Ae,xe);return Se!==Ee&&(t=t.slice(0,Se)),t}function fromArrayLike$1(t,Ae){var xe=Ae.length<0?0:checked$1(Ae.length)|0;t=createBuffer$1(t,xe);for(var Ee=0;Ee<xe;Ee+=1)t[Ee]=Ae[Ee]&255;return t}function fromArrayBuffer$1(t,Ae,xe,Ee){if(Ae.byteLength,xe<0||Ae.byteLength<xe)throw new RangeError("'offset' is out of bounds");if(Ae.byteLength<xe+(Ee||0))throw new RangeError("'length' is out of bounds");return xe===void 0&&Ee===void 0?Ae=new Uint8Array(Ae):Ee===void 0?Ae=new Uint8Array(Ae,xe):Ae=new Uint8Array(Ae,xe,Ee),Buffer$1.TYPED_ARRAY_SUPPORT?(t=Ae,t.__proto__=Buffer$1.prototype):t=fromArrayLike$1(t,Ae),t}function fromObject$2(t,Ae){if(internalIsBuffer$1(Ae)){var xe=checked$1(Ae.length)|0;return t=createBuffer$1(t,xe),t.length===0||Ae.copy(t,0,0,xe),t}if(Ae){if(typeof ArrayBuffer<"u"&&Ae.buffer instanceof ArrayBuffer||"length"in Ae)return typeof Ae.length!="number"||isnan$1(Ae.length)?createBuffer$1(t,0):fromArrayLike$1(t,Ae);if(Ae.type==="Buffer"&&isArray$3(Ae.data))return fromArrayLike$1(t,Ae.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked$1(t){if(t>=kMaxLength$1())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength$1().toString(16)+" bytes");return t|0}Buffer$1.isBuffer=isBuffer$2;function internalIsBuffer$1(t){return!!(t!=null&&t._isBuffer)}Buffer$1.compare=function t(Ae,xe){if(!internalIsBuffer$1(Ae)||!internalIsBuffer$1(xe))throw new TypeError("Arguments must be Buffers");if(Ae===xe)return 0;for(var Ee=Ae.length,Se=xe.length,Ce=0,_e=Math.min(Ee,Se);Ce<_e;++Ce)if(Ae[Ce]!==xe[Ce]){Ee=Ae[Ce],Se=xe[Ce];break}return Ee<Se?-1:Se<Ee?1:0};Buffer$1.isEncoding=function t(Ae){switch(String(Ae).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};Buffer$1.concat=function t(Ae,xe){if(!isArray$3(Ae))throw new TypeError('"list" argument must be an Array of Buffers');if(Ae.length===0)return Buffer$1.alloc(0);var Ee;if(xe===void 0)for(xe=0,Ee=0;Ee<Ae.length;++Ee)xe+=Ae[Ee].length;var Se=Buffer$1.allocUnsafe(xe),Ce=0;for(Ee=0;Ee<Ae.length;++Ee){var _e=Ae[Ee];if(!internalIsBuffer$1(_e))throw new TypeError('"list" argument must be an Array of Buffers');_e.copy(Se,Ce),Ce+=_e.length}return Se};function byteLength$1(t,Ae){if(internalIsBuffer$1(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var xe=t.length;if(xe===0)return 0;for(var Ee=!1;;)switch(Ae){case"ascii":case"latin1":case"binary":return xe;case"utf8":case"utf-8":case void 0:return utf8ToBytes$1(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xe*2;case"hex":return xe>>>1;case"base64":return base64ToBytes$1(t).length;default:if(Ee)return utf8ToBytes$1(t).length;Ae=(""+Ae).toLowerCase(),Ee=!0}}Buffer$1.byteLength=byteLength$1;function slowToString$1(t,Ae,xe){var Ee=!1;if((Ae===void 0||Ae<0)&&(Ae=0),Ae>this.length||((xe===void 0||xe>this.length)&&(xe=this.length),xe<=0)||(xe>>>=0,Ae>>>=0,xe<=Ae))return"";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice$1(this,Ae,xe);case"utf8":case"utf-8":return utf8Slice$1(this,Ae,xe);case"ascii":return asciiSlice$1(this,Ae,xe);case"latin1":case"binary":return latin1Slice$1(this,Ae,xe);case"base64":return base64Slice$1(this,Ae,xe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice$1(this,Ae,xe);default:if(Ee)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),Ee=!0}}Buffer$1.prototype._isBuffer=!0;function swap$2(t,Ae,xe){var Ee=t[Ae];t[Ae]=t[xe],t[xe]=Ee}Buffer$1.prototype.swap16=function t(){var Ae=this.length;if(Ae%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var xe=0;xe<Ae;xe+=2)swap$2(this,xe,xe+1);return this};Buffer$1.prototype.swap32=function t(){var Ae=this.length;if(Ae%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var xe=0;xe<Ae;xe+=4)swap$2(this,xe,xe+3),swap$2(this,xe+1,xe+2);return this};Buffer$1.prototype.swap64=function t(){var Ae=this.length;if(Ae%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var xe=0;xe<Ae;xe+=8)swap$2(this,xe,xe+7),swap$2(this,xe+1,xe+6),swap$2(this,xe+2,xe+5),swap$2(this,xe+3,xe+4);return this};Buffer$1.prototype.toString=function t(){var Ae=this.length|0;return Ae===0?"":arguments.length===0?utf8Slice$1(this,0,Ae):slowToString$1.apply(this,arguments)};Buffer$1.prototype.equals=function t(Ae){if(!internalIsBuffer$1(Ae))throw new TypeError("Argument must be a Buffer");return this===Ae?!0:Buffer$1.compare(this,Ae)===0};Buffer$1.prototype.inspect=function t(){var Ae="",xe=INSPECT_MAX_BYTES$1;return this.length>0&&(Ae=this.toString("hex",0,xe).match(/.{2}/g).join(" "),this.length>xe&&(Ae+=" ... ")),"<Buffer "+Ae+">"};Buffer$1.prototype.compare=function t(Ae,xe,Ee,Se,Ce){if(!internalIsBuffer$1(Ae))throw new TypeError("Argument must be a Buffer");if(xe===void 0&&(xe=0),Ee===void 0&&(Ee=Ae?Ae.length:0),Se===void 0&&(Se=0),Ce===void 0&&(Ce=this.length),xe<0||Ee>Ae.length||Se<0||Ce>this.length)throw new RangeError("out of range index");if(Se>=Ce&&xe>=Ee)return 0;if(Se>=Ce)return-1;if(xe>=Ee)return 1;if(xe>>>=0,Ee>>>=0,Se>>>=0,Ce>>>=0,this===Ae)return 0;for(var _e=Ce-Se,Ie=Ee-xe,Be=Math.min(_e,Ie),Te=this.slice(Se,Ce),Pe=Ae.slice(xe,Ee),ke=0;ke<Be;++ke)if(Te[ke]!==Pe[ke]){_e=Te[ke],Ie=Pe[ke];break}return _e<Ie?-1:Ie<_e?1:0};function bidirectionalIndexOf$1(t,Ae,xe,Ee,Se){if(t.length===0)return-1;if(typeof xe=="string"?(Ee=xe,xe=0):xe>2147483647?xe=2147483647:xe<-2147483648&&(xe=-2147483648),xe=+xe,isNaN(xe)&&(xe=Se?0:t.length-1),xe<0&&(xe=t.length+xe),xe>=t.length){if(Se)return-1;xe=t.length-1}else if(xe<0)if(Se)xe=0;else return-1;if(typeof Ae=="string"&&(Ae=Buffer$1.from(Ae,Ee)),internalIsBuffer$1(Ae))return Ae.length===0?-1:arrayIndexOf$1(t,Ae,xe,Ee,Se);if(typeof Ae=="number")return Ae=Ae&255,Buffer$1.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Se?Uint8Array.prototype.indexOf.call(t,Ae,xe):Uint8Array.prototype.lastIndexOf.call(t,Ae,xe):arrayIndexOf$1(t,[Ae],xe,Ee,Se);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf$1(t,Ae,xe,Ee,Se){var Ce=1,_e=t.length,Ie=Ae.length;if(Ee!==void 0&&(Ee=String(Ee).toLowerCase(),Ee==="ucs2"||Ee==="ucs-2"||Ee==="utf16le"||Ee==="utf-16le")){if(t.length<2||Ae.length<2)return-1;Ce=2,_e/=2,Ie/=2,xe/=2}function Be(Oe,Ue){return Ce===1?Oe[Ue]:Oe.readUInt16BE(Ue*Ce)}var Te;if(Se){var Pe=-1;for(Te=xe;Te<_e;Te++)if(Be(t,Te)===Be(Ae,Pe===-1?0:Te-Pe)){if(Pe===-1&&(Pe=Te),Te-Pe+1===Ie)return Pe*Ce}else Pe!==-1&&(Te-=Te-Pe),Pe=-1}else for(xe+Ie>_e&&(xe=_e-Ie),Te=xe;Te>=0;Te--){for(var ke=!0,$e=0;$e<Ie;$e++)if(Be(t,Te+$e)!==Be(Ae,$e)){ke=!1;break}if(ke)return Te}return-1}Buffer$1.prototype.includes=function t(Ae,xe,Ee){return this.indexOf(Ae,xe,Ee)!==-1};Buffer$1.prototype.indexOf=function t(Ae,xe,Ee){return bidirectionalIndexOf$1(this,Ae,xe,Ee,!0)};Buffer$1.prototype.lastIndexOf=function t(Ae,xe,Ee){return bidirectionalIndexOf$1(this,Ae,xe,Ee,!1)};function hexWrite$1(t,Ae,xe,Ee){xe=Number(xe)||0;var Se=t.length-xe;Ee?(Ee=Number(Ee),Ee>Se&&(Ee=Se)):Ee=Se;var Ce=Ae.length;if(Ce%2!==0)throw new TypeError("Invalid hex string");Ee>Ce/2&&(Ee=Ce/2);for(var _e=0;_e<Ee;++_e){var Ie=parseInt(Ae.substr(_e*2,2),16);if(isNaN(Ie))return _e;t[xe+_e]=Ie}return _e}function utf8Write$1(t,Ae,xe,Ee){return blitBuffer$1(utf8ToBytes$1(Ae,t.length-xe),t,xe,Ee)}function asciiWrite$1(t,Ae,xe,Ee){return blitBuffer$1(asciiToBytes$1(Ae),t,xe,Ee)}function latin1Write$1(t,Ae,xe,Ee){return asciiWrite$1(t,Ae,xe,Ee)}function base64Write$1(t,Ae,xe,Ee){return blitBuffer$1(base64ToBytes$1(Ae),t,xe,Ee)}function ucs2Write$1(t,Ae,xe,Ee){return blitBuffer$1(utf16leToBytes$1(Ae,t.length-xe),t,xe,Ee)}Buffer$1.prototype.write=function t(Ae,xe,Ee,Se){if(xe===void 0)Se="utf8",Ee=this.length,xe=0;else if(Ee===void 0&&typeof xe=="string")Se=xe,Ee=this.length,xe=0;else if(isFinite(xe))xe=xe|0,isFinite(Ee)?(Ee=Ee|0,Se===void 0&&(Se="utf8")):(Se=Ee,Ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Ce=this.length-xe;if((Ee===void 0||Ee>Ce)&&(Ee=Ce),Ae.length>0&&(Ee<0||xe<0)||xe>this.length)throw new RangeError("Attempt to write outside buffer bounds");Se||(Se="utf8");for(var _e=!1;;)switch(Se){case"hex":return hexWrite$1(this,Ae,xe,Ee);case"utf8":case"utf-8":return utf8Write$1(this,Ae,xe,Ee);case"ascii":return asciiWrite$1(this,Ae,xe,Ee);case"latin1":case"binary":return latin1Write$1(this,Ae,xe,Ee);case"base64":return base64Write$1(this,Ae,xe,Ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write$1(this,Ae,xe,Ee);default:if(_e)throw new TypeError("Unknown encoding: "+Se);Se=(""+Se).toLowerCase(),_e=!0}};Buffer$1.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice$1(t,Ae,xe){return Ae===0&&xe===t.length?fromByteArray$1(t):fromByteArray$1(t.slice(Ae,xe))}function utf8Slice$1(t,Ae,xe){xe=Math.min(t.length,xe);for(var Ee=[],Se=Ae;Se<xe;){var Ce=t[Se],_e=null,Ie=Ce>239?4:Ce>223?3:Ce>191?2:1;if(Se+Ie<=xe){var Be,Te,Pe,ke;switch(Ie){case 1:Ce<128&&(_e=Ce);break;case 2:Be=t[Se+1],(Be&192)===128&&(ke=(Ce&31)<<6|Be&63,ke>127&&(_e=ke));break;case 3:Be=t[Se+1],Te=t[Se+2],(Be&192)===128&&(Te&192)===128&&(ke=(Ce&15)<<12|(Be&63)<<6|Te&63,ke>2047&&(ke<55296||ke>57343)&&(_e=ke));break;case 4:Be=t[Se+1],Te=t[Se+2],Pe=t[Se+3],(Be&192)===128&&(Te&192)===128&&(Pe&192)===128&&(ke=(Ce&15)<<18|(Be&63)<<12|(Te&63)<<6|Pe&63,ke>65535&&ke<1114112&&(_e=ke))}}_e===null?(_e=65533,Ie=1):_e>65535&&(_e-=65536,Ee.push(_e>>>10&1023|55296),_e=56320|_e&1023),Ee.push(_e),Se+=Ie}return decodeCodePointsArray$1(Ee)}var MAX_ARGUMENTS_LENGTH$1=4096;function decodeCodePointsArray$1(t){var Ae=t.length;if(Ae<=MAX_ARGUMENTS_LENGTH$1)return String.fromCharCode.apply(String,t);for(var xe="",Ee=0;Ee<Ae;)xe+=String.fromCharCode.apply(String,t.slice(Ee,Ee+=MAX_ARGUMENTS_LENGTH$1));return xe}function asciiSlice$1(t,Ae,xe){var Ee="";xe=Math.min(t.length,xe);for(var Se=Ae;Se<xe;++Se)Ee+=String.fromCharCode(t[Se]&127);return Ee}function latin1Slice$1(t,Ae,xe){var Ee="";xe=Math.min(t.length,xe);for(var Se=Ae;Se<xe;++Se)Ee+=String.fromCharCode(t[Se]);return Ee}function hexSlice$1(t,Ae,xe){var Ee=t.length;(!Ae||Ae<0)&&(Ae=0),(!xe||xe<0||xe>Ee)&&(xe=Ee);for(var Se="",Ce=Ae;Ce<xe;++Ce)Se+=toHex$1(t[Ce]);return Se}function utf16leSlice$1(t,Ae,xe){for(var Ee=t.slice(Ae,xe),Se="",Ce=0;Ce<Ee.length;Ce+=2)Se+=String.fromCharCode(Ee[Ce]+Ee[Ce+1]*256);return Se}Buffer$1.prototype.slice=function t(Ae,xe){var Ee=this.length;Ae=~~Ae,xe=xe===void 0?Ee:~~xe,Ae<0?(Ae+=Ee,Ae<0&&(Ae=0)):Ae>Ee&&(Ae=Ee),xe<0?(xe+=Ee,xe<0&&(xe=0)):xe>Ee&&(xe=Ee),xe<Ae&&(xe=Ae);var Se;if(Buffer$1.TYPED_ARRAY_SUPPORT)Se=this.subarray(Ae,xe),Se.__proto__=Buffer$1.prototype;else{var Ce=xe-Ae;Se=new Buffer$1(Ce,void 0);for(var _e=0;_e<Ce;++_e)Se[_e]=this[_e+Ae]}return Se};function checkOffset$1(t,Ae,xe){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+Ae>xe)throw new RangeError("Trying to access beyond buffer length")}Buffer$1.prototype.readUIntLE=function t(Ae,xe,Ee){Ae=Ae|0,xe=xe|0,Ee||checkOffset$1(Ae,xe,this.length);for(var Se=this[Ae],Ce=1,_e=0;++_e<xe&&(Ce*=256);)Se+=this[Ae+_e]*Ce;return Se};Buffer$1.prototype.readUIntBE=function t(Ae,xe,Ee){Ae=Ae|0,xe=xe|0,Ee||checkOffset$1(Ae,xe,this.length);for(var Se=this[Ae+--xe],Ce=1;xe>0&&(Ce*=256);)Se+=this[Ae+--xe]*Ce;return Se};Buffer$1.prototype.readUInt8=function t(Ae,xe){return xe||checkOffset$1(Ae,1,this.length),this[Ae]};Buffer$1.prototype.readUInt16LE=function t(Ae,xe){return xe||checkOffset$1(Ae,2,this.length),this[Ae]|this[Ae+1]<<8};Buffer$1.prototype.readUInt16BE=function t(Ae,xe){return xe||checkOffset$1(Ae,2,this.length),this[Ae]<<8|this[Ae+1]};Buffer$1.prototype.readUInt32LE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),(this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16)+this[Ae+3]*16777216};Buffer$1.prototype.readUInt32BE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),this[Ae]*16777216+(this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3])};Buffer$1.prototype.readIntLE=function t(Ae,xe,Ee){Ae=Ae|0,xe=xe|0,Ee||checkOffset$1(Ae,xe,this.length);for(var Se=this[Ae],Ce=1,_e=0;++_e<xe&&(Ce*=256);)Se+=this[Ae+_e]*Ce;return Ce*=128,Se>=Ce&&(Se-=Math.pow(2,8*xe)),Se};Buffer$1.prototype.readIntBE=function t(Ae,xe,Ee){Ae=Ae|0,xe=xe|0,Ee||checkOffset$1(Ae,xe,this.length);for(var Se=xe,Ce=1,_e=this[Ae+--Se];Se>0&&(Ce*=256);)_e+=this[Ae+--Se]*Ce;return Ce*=128,_e>=Ce&&(_e-=Math.pow(2,8*xe)),_e};Buffer$1.prototype.readInt8=function t(Ae,xe){return xe||checkOffset$1(Ae,1,this.length),this[Ae]&128?(255-this[Ae]+1)*-1:this[Ae]};Buffer$1.prototype.readInt16LE=function t(Ae,xe){xe||checkOffset$1(Ae,2,this.length);var Ee=this[Ae]|this[Ae+1]<<8;return Ee&32768?Ee|4294901760:Ee};Buffer$1.prototype.readInt16BE=function t(Ae,xe){xe||checkOffset$1(Ae,2,this.length);var Ee=this[Ae+1]|this[Ae]<<8;return Ee&32768?Ee|4294901760:Ee};Buffer$1.prototype.readInt32LE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16|this[Ae+3]<<24};Buffer$1.prototype.readInt32BE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),this[Ae]<<24|this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3]};Buffer$1.prototype.readFloatLE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),read$1(this,Ae,!0,23,4)};Buffer$1.prototype.readFloatBE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),read$1(this,Ae,!1,23,4)};Buffer$1.prototype.readDoubleLE=function t(Ae,xe){return xe||checkOffset$1(Ae,8,this.length),read$1(this,Ae,!0,52,8)};Buffer$1.prototype.readDoubleBE=function t(Ae,xe){return xe||checkOffset$1(Ae,8,this.length),read$1(this,Ae,!1,52,8)};function checkInt$1(t,Ae,xe,Ee,Se,Ce){if(!internalIsBuffer$1(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ae>Se||Ae<Ce)throw new RangeError('"value" argument is out of bounds');if(xe+Ee>t.length)throw new RangeError("Index out of range")}Buffer$1.prototype.writeUIntLE=function t(Ae,xe,Ee,Se){if(Ae=+Ae,xe=xe|0,Ee=Ee|0,!Se){var Ce=Math.pow(2,8*Ee)-1;checkInt$1(this,Ae,xe,Ee,Ce,0)}var _e=1,Ie=0;for(this[xe]=Ae&255;++Ie<Ee&&(_e*=256);)this[xe+Ie]=Ae/_e&255;return xe+Ee};Buffer$1.prototype.writeUIntBE=function t(Ae,xe,Ee,Se){if(Ae=+Ae,xe=xe|0,Ee=Ee|0,!Se){var Ce=Math.pow(2,8*Ee)-1;checkInt$1(this,Ae,xe,Ee,Ce,0)}var _e=Ee-1,Ie=1;for(this[xe+_e]=Ae&255;--_e>=0&&(Ie*=256);)this[xe+_e]=Ae/Ie&255;return xe+Ee};Buffer$1.prototype.writeUInt8=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,1,255,0),Buffer$1.TYPED_ARRAY_SUPPORT||(Ae=Math.floor(Ae)),this[xe]=Ae&255,xe+1};function objectWriteUInt16$1(t,Ae,xe,Ee){Ae<0&&(Ae=65535+Ae+1);for(var Se=0,Ce=Math.min(t.length-xe,2);Se<Ce;++Se)t[xe+Se]=(Ae&255<<8*(Ee?Se:1-Se))>>>(Ee?Se:1-Se)*8}Buffer$1.prototype.writeUInt16LE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae&255,this[xe+1]=Ae>>>8):objectWriteUInt16$1(this,Ae,xe,!0),xe+2};Buffer$1.prototype.writeUInt16BE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae>>>8,this[xe+1]=Ae&255):objectWriteUInt16$1(this,Ae,xe,!1),xe+2};function objectWriteUInt32$1(t,Ae,xe,Ee){Ae<0&&(Ae=4294967295+Ae+1);for(var Se=0,Ce=Math.min(t.length-xe,4);Se<Ce;++Se)t[xe+Se]=Ae>>>(Ee?Se:3-Se)*8&255}Buffer$1.prototype.writeUInt32LE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe+3]=Ae>>>24,this[xe+2]=Ae>>>16,this[xe+1]=Ae>>>8,this[xe]=Ae&255):objectWriteUInt32$1(this,Ae,xe,!0),xe+4};Buffer$1.prototype.writeUInt32BE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae>>>24,this[xe+1]=Ae>>>16,this[xe+2]=Ae>>>8,this[xe+3]=Ae&255):objectWriteUInt32$1(this,Ae,xe,!1),xe+4};Buffer$1.prototype.writeIntLE=function t(Ae,xe,Ee,Se){if(Ae=+Ae,xe=xe|0,!Se){var Ce=Math.pow(2,8*Ee-1);checkInt$1(this,Ae,xe,Ee,Ce-1,-Ce)}var _e=0,Ie=1,Be=0;for(this[xe]=Ae&255;++_e<Ee&&(Ie*=256);)Ae<0&&Be===0&&this[xe+_e-1]!==0&&(Be=1),this[xe+_e]=(Ae/Ie>>0)-Be&255;return xe+Ee};Buffer$1.prototype.writeIntBE=function t(Ae,xe,Ee,Se){if(Ae=+Ae,xe=xe|0,!Se){var Ce=Math.pow(2,8*Ee-1);checkInt$1(this,Ae,xe,Ee,Ce-1,-Ce)}var _e=Ee-1,Ie=1,Be=0;for(this[xe+_e]=Ae&255;--_e>=0&&(Ie*=256);)Ae<0&&Be===0&&this[xe+_e+1]!==0&&(Be=1),this[xe+_e]=(Ae/Ie>>0)-Be&255;return xe+Ee};Buffer$1.prototype.writeInt8=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,1,127,-128),Buffer$1.TYPED_ARRAY_SUPPORT||(Ae=Math.floor(Ae)),Ae<0&&(Ae=255+Ae+1),this[xe]=Ae&255,xe+1};Buffer$1.prototype.writeInt16LE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae&255,this[xe+1]=Ae>>>8):objectWriteUInt16$1(this,Ae,xe,!0),xe+2};Buffer$1.prototype.writeInt16BE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae>>>8,this[xe+1]=Ae&255):objectWriteUInt16$1(this,Ae,xe,!1),xe+2};Buffer$1.prototype.writeInt32LE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,4,2147483647,-2147483648),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae&255,this[xe+1]=Ae>>>8,this[xe+2]=Ae>>>16,this[xe+3]=Ae>>>24):objectWriteUInt32$1(this,Ae,xe,!0),xe+4};Buffer$1.prototype.writeInt32BE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,4,2147483647,-2147483648),Ae<0&&(Ae=4294967295+Ae+1),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae>>>24,this[xe+1]=Ae>>>16,this[xe+2]=Ae>>>8,this[xe+3]=Ae&255):objectWriteUInt32$1(this,Ae,xe,!1),xe+4};function checkIEEE754$1(t,Ae,xe,Ee,Se,Ce){if(xe+Ee>t.length)throw new RangeError("Index out of range");if(xe<0)throw new RangeError("Index out of range")}function writeFloat$1(t,Ae,xe,Ee,Se){return Se||checkIEEE754$1(t,Ae,xe,4),write$1(t,Ae,xe,Ee,23,4),xe+4}Buffer$1.prototype.writeFloatLE=function t(Ae,xe,Ee){return writeFloat$1(this,Ae,xe,!0,Ee)};Buffer$1.prototype.writeFloatBE=function t(Ae,xe,Ee){return writeFloat$1(this,Ae,xe,!1,Ee)};function writeDouble$1(t,Ae,xe,Ee,Se){return Se||checkIEEE754$1(t,Ae,xe,8),write$1(t,Ae,xe,Ee,52,8),xe+8}Buffer$1.prototype.writeDoubleLE=function t(Ae,xe,Ee){return writeDouble$1(this,Ae,xe,!0,Ee)};Buffer$1.prototype.writeDoubleBE=function t(Ae,xe,Ee){return writeDouble$1(this,Ae,xe,!1,Ee)};Buffer$1.prototype.copy=function t(Ae,xe,Ee,Se){if(Ee||(Ee=0),!Se&&Se!==0&&(Se=this.length),xe>=Ae.length&&(xe=Ae.length),xe||(xe=0),Se>0&&Se<Ee&&(Se=Ee),Se===Ee||Ae.length===0||this.length===0)return 0;if(xe<0)throw new RangeError("targetStart out of bounds");if(Ee<0||Ee>=this.length)throw new RangeError("sourceStart out of bounds");if(Se<0)throw new RangeError("sourceEnd out of bounds");Se>this.length&&(Se=this.length),Ae.length-xe<Se-Ee&&(Se=Ae.length-xe+Ee);var Ce=Se-Ee,_e;if(this===Ae&&Ee<xe&&xe<Se)for(_e=Ce-1;_e>=0;--_e)Ae[_e+xe]=this[_e+Ee];else if(Ce<1e3||!Buffer$1.TYPED_ARRAY_SUPPORT)for(_e=0;_e<Ce;++_e)Ae[_e+xe]=this[_e+Ee];else Uint8Array.prototype.set.call(Ae,this.subarray(Ee,Ee+Ce),xe);return Ce};Buffer$1.prototype.fill=function t(Ae,xe,Ee,Se){if(typeof Ae=="string"){if(typeof xe=="string"?(Se=xe,xe=0,Ee=this.length):typeof Ee=="string"&&(Se=Ee,Ee=this.length),Ae.length===1){var Ce=Ae.charCodeAt(0);Ce<256&&(Ae=Ce)}if(Se!==void 0&&typeof Se!="string")throw new TypeError("encoding must be a string");if(typeof Se=="string"&&!Buffer$1.isEncoding(Se))throw new TypeError("Unknown encoding: "+Se)}else typeof Ae=="number"&&(Ae=Ae&255);if(xe<0||this.length<xe||this.length<Ee)throw new RangeError("Out of range index");if(Ee<=xe)return this;xe=xe>>>0,Ee=Ee===void 0?this.length:Ee>>>0,Ae||(Ae=0);var _e;if(typeof Ae=="number")for(_e=xe;_e<Ee;++_e)this[_e]=Ae;else{var Ie=internalIsBuffer$1(Ae)?Ae:utf8ToBytes$1(new Buffer$1(Ae,Se).toString()),Be=Ie.length;for(_e=0;_e<Ee-xe;++_e)this[_e+xe]=Ie[_e%Be]}return this};var INVALID_BASE64_RE$1=/[^+\/0-9A-Za-z-_]/g;function base64clean$1(t){if(t=stringtrim$1(t).replace(INVALID_BASE64_RE$1,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function stringtrim$1(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex$1(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes$1(t,Ae){Ae=Ae||1/0;for(var xe,Ee=t.length,Se=null,Ce=[],_e=0;_e<Ee;++_e){if(xe=t.charCodeAt(_e),xe>55295&&xe<57344){if(!Se){if(xe>56319){(Ae-=3)>-1&&Ce.push(239,191,189);continue}else if(_e+1===Ee){(Ae-=3)>-1&&Ce.push(239,191,189);continue}Se=xe;continue}if(xe<56320){(Ae-=3)>-1&&Ce.push(239,191,189),Se=xe;continue}xe=(Se-55296<<10|xe-56320)+65536}else Se&&(Ae-=3)>-1&&Ce.push(239,191,189);if(Se=null,xe<128){if((Ae-=1)<0)break;Ce.push(xe)}else if(xe<2048){if((Ae-=2)<0)break;Ce.push(xe>>6|192,xe&63|128)}else if(xe<65536){if((Ae-=3)<0)break;Ce.push(xe>>12|224,xe>>6&63|128,xe&63|128)}else if(xe<1114112){if((Ae-=4)<0)break;Ce.push(xe>>18|240,xe>>12&63|128,xe>>6&63|128,xe&63|128)}else throw new Error("Invalid code point")}return Ce}function asciiToBytes$1(t){for(var Ae=[],xe=0;xe<t.length;++xe)Ae.push(t.charCodeAt(xe)&255);return Ae}function utf16leToBytes$1(t,Ae){for(var xe,Ee,Se,Ce=[],_e=0;_e<t.length&&!((Ae-=2)<0);++_e)xe=t.charCodeAt(_e),Ee=xe>>8,Se=xe%256,Ce.push(Se),Ce.push(Ee);return Ce}function base64ToBytes$1(t){return toByteArray$1(base64clean$1(t))}function blitBuffer$1(t,Ae,xe,Ee){for(var Se=0;Se<Ee&&!(Se+xe>=Ae.length||Se>=t.length);++Se)Ae[Se+xe]=t[Se];return Se}function isnan$1(t){return t!==t}function isBuffer$2(t){return t!=null&&(!!t._isBuffer||isFastBuffer$1(t)||isSlowBuffer$1(t))}function isFastBuffer$1(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function isSlowBuffer$1(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&isFastBuffer$1(t.slice(0,0))}const charCodeOfDot=46,reEscapeChar=/\\(\\)?/g,rePropName=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,getTag$1=function(t){return Object.prototype.toString.call(t)},isSymbol=function(t){const Ae=typeof t;return Ae==="symbol"||Ae==="object"&&t&&getTag$1(t)==="[object Symbol]"},isKey=function(t,Ae){if(Array.isArray(t))return!1;const xe=typeof t;return xe==="number"||xe==="symbol"||xe==="boolean"||!t||isSymbol(t)?!0:reIsPlainProp.test(t)||!reIsDeepProp.test(t)||Ae!=null&&t in Object(Ae)},stringToPath=function(t){const Ae=[];return t.charCodeAt(0)===charCodeOfDot&&Ae.push(""),t.replace(rePropName,function(xe,Ee,Se,Ce){let _e=xe;Se?_e=Ce.replace(reEscapeChar,"$1"):Ee&&(_e=Ee.trim()),Ae.push(_e)}),Ae},castPath=function(t,Ae){return Array.isArray(t)?t:isKey(t,Ae)?[t]:stringToPath(t)},toKey=function(t){if(typeof t=="string"||isSymbol(t))return t;const Ae=`${t}`;return Ae=="0"&&1/t==-INFINITY?"-0":Ae},get$2=function(t,Ae){Ae=castPath(Ae,t);let xe=0;const Ee=Ae.length;for(;t!=null&&xe<Ee;)t=t[toKey(Ae[xe++])];return xe&&xe===Ee?t:void 0},is_object$1=function(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)},normalize_columns=function(t){if(t==null)return[void 0,void 0];if(typeof t!="object")return[Error('Invalid option "columns": expect an array or an object')];if(Array.isArray(t)){const Ae=[];for(const xe of t)if(typeof xe=="string")Ae.push({key:xe,header:xe});else if(typeof xe=="object"&&xe!==null&&!Array.isArray(xe)){if(!xe.key)return[Error('Invalid column definition: property "key" is required')];xe.header===void 0&&(xe.header=xe.key),Ae.push(xe)}else return[Error("Invalid column definition: expect a string or an object")];t=Ae}else{const Ae=[];for(const xe in t)Ae.push({key:xe,header:t[xe]});t=Ae}return[void 0,t]};let CsvError$1=class zh extends Error{constructor(Ae,xe,...Ee){Array.isArray(xe)&&(xe=xe.join(" ")),super(xe),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,zh),this.code=Ae;for(const Se of Ee)for(const Ce in Se){const _e=Se[Ce];this[Ce]=isBuffer$2(_e)?_e.toString():_e==null?_e:JSON.parse(JSON.stringify(_e))}}};const underscore$1=function(t){return t.replace(/([A-Z])/g,function(Ae,xe){return"_"+xe.toLowerCase()})},normalize_options$1=function(t){const Ae={};for(const Se in t)Ae[underscore$1(Se)]=t[Se];if(Ae.bom===void 0||Ae.bom===null||Ae.bom===!1)Ae.bom=!1;else if(Ae.bom!==!0)return[new CsvError$1("CSV_OPTION_BOOLEAN_INVALID_TYPE",["option `bom` is optional and must be a boolean value,",`got ${JSON.stringify(Ae.bom)}`])];if(Ae.delimiter===void 0||Ae.delimiter===null)Ae.delimiter=",";else if(isBuffer$2(Ae.delimiter))Ae.delimiter=Ae.delimiter.toString();else if(typeof Ae.delimiter!="string")return[new CsvError$1("CSV_OPTION_DELIMITER_INVALID_TYPE",["option `delimiter` must be a buffer or a string,",`got ${JSON.stringify(Ae.delimiter)}`])];if(Ae.quote===void 0||Ae.quote===null)Ae.quote='"';else if(Ae.quote===!0)Ae.quote='"';else if(Ae.quote===!1)Ae.quote="";else if(isBuffer$2(Ae.quote))Ae.quote=Ae.quote.toString();else if(typeof Ae.quote!="string")return[new CsvError$1("CSV_OPTION_QUOTE_INVALID_TYPE",["option `quote` must be a boolean, a buffer or a string,",`got ${JSON.stringify(Ae.quote)}`])];if((Ae.quoted===void 0||Ae.quoted===null)&&(Ae.quoted=!1),Ae.escape_formulas===void 0||Ae.escape_formulas===null)Ae.escape_formulas=!1;else if(typeof Ae.escape_formulas!="boolean")return[new CsvError$1("CSV_OPTION_ESCAPE_FORMULAS_INVALID_TYPE",["option `escape_formulas` must be a boolean,",`got ${JSON.stringify(Ae.escape_formulas)}`])];if((Ae.quoted_empty===void 0||Ae.quoted_empty===null)&&(Ae.quoted_empty=void 0),Ae.quoted_match===void 0||Ae.quoted_match===null||Ae.quoted_match===!1?Ae.quoted_match=null:Array.isArray(Ae.quoted_match)||(Ae.quoted_match=[Ae.quoted_match]),Ae.quoted_match)for(const Se of Ae.quoted_match){const Ce=typeof Se=="string",_e=Se instanceof RegExp;if(!Ce&&!_e)return[Error(`Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(Se)}`)]}if((Ae.quoted_string===void 0||Ae.quoted_string===null)&&(Ae.quoted_string=!1),(Ae.eof===void 0||Ae.eof===null)&&(Ae.eof=!0),Ae.escape===void 0||Ae.escape===null)Ae.escape='"';else if(isBuffer$2(Ae.escape))Ae.escape=Ae.escape.toString();else if(typeof Ae.escape!="string")return[Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(Ae.escape)}`)];if(Ae.escape.length>1)return[Error(`Invalid Option: escape must be one character, got ${Ae.escape.length} characters`)];(Ae.header===void 0||Ae.header===null)&&(Ae.header=!1);const[xe,Ee]=normalize_columns(Ae.columns);if(xe!==void 0)return[xe];if(Ae.columns=Ee,(Ae.quoted===void 0||Ae.quoted===null)&&(Ae.quoted=!1),(Ae.cast===void 0||Ae.cast===null)&&(Ae.cast={}),(Ae.cast.bigint===void 0||Ae.cast.bigint===null)&&(Ae.cast.bigint=Se=>""+Se),(Ae.cast.boolean===void 0||Ae.cast.boolean===null)&&(Ae.cast.boolean=Se=>Se?"1":""),(Ae.cast.date===void 0||Ae.cast.date===null)&&(Ae.cast.date=Se=>""+Se.getTime()),(Ae.cast.number===void 0||Ae.cast.number===null)&&(Ae.cast.number=Se=>""+Se),(Ae.cast.object===void 0||Ae.cast.object===null)&&(Ae.cast.object=Se=>JSON.stringify(Se)),(Ae.cast.string===void 0||Ae.cast.string===null)&&(Ae.cast.string=function(Se){return Se}),Ae.on_record!==void 0&&typeof Ae.on_record!="function")return[Error('Invalid Option: "on_record" must be a function.')];if(Ae.record_delimiter===void 0||Ae.record_delimiter===null)Ae.record_delimiter=`
577
+ ${Ze}`:Ye.error?We=`${Ye.error}`:We=Ze,St.outputs[Ye.promptIdx]={id:Ye.id||`${Ye.testIdx}-${Ye.promptIdx}`,...Ye,text:We||"",prompt:Ye.prompt.raw,provider:(($e=Ye.provider)==null?void 0:$e.label)||((Oe=Ye.provider)==null?void 0:Oe.id)||"unknown provider",pass:Ye.success,failureReason:Ye.failureReason,cost:Ye.cost||0,audio:(Ue=Ye.response)!=null&&Ue.audio?{id:Ye.response.audio.id,expiresAt:Ye.response.audio.expiresAt,data:Ye.response.audio.data,transcript:Ye.response.audio.transcript,format:Ye.response.audio.format}:void 0},invariant(Ye.promptId,"Prompt ID is required"),xe[Ye.promptIdx]||(xe[Ye.promptIdx]={...Ye.prompt,provider:((qe=Ye.provider)==null?void 0:qe.label)||((ze=Ye.provider)==null?void 0:ze.id)||"unknown provider",metrics:new PromptMetrics}),St.testIdx=Ye.testIdx;const ir=xe[Ye.promptIdx];invariant(ir.metrics,"Prompt metrics are required"),ir.metrics.score+=Ye.score,ir.metrics.testPassCount+=Ye.success?1:0,ir.metrics.testFailCount+=Ye.success?0:1,ir.metrics.testErrorCount+=Ye.failureReason===ResultFailureReason.ERROR?1:0,ir.metrics.assertPassCount+=((Ge=(Ve=Ye.gradingResult)==null?void 0:Ve.componentResults)==null?void 0:Ge.filter(ur=>ur.pass).length)||0,ir.metrics.assertFailCount+=((er=(Xe=Ye.gradingResult)==null?void 0:Xe.componentResults)==null?void 0:er.filter(ur=>!ur.pass).length)||0,ir.metrics.totalLatencyMs+=Ye.latencyMs||0,ir.metrics.tokenUsage.cached+=((nr=(tr=Ye.response)==null?void 0:tr.tokenUsage)==null?void 0:nr.cached)||0,ir.metrics.tokenUsage.completion+=((dr=(sr=Ye.response)==null?void 0:sr.tokenUsage)==null?void 0:dr.completion)||0,ir.metrics.tokenUsage.prompt+=((lr=(ar=Ye.response)==null?void 0:ar.tokenUsage)==null?void 0:lr.prompt)||0,ir.metrics.tokenUsage.total+=((Me=(Ke=Ye.response)==null?void 0:Ke.tokenUsage)==null?void 0:Me.total)||0,ir.metrics.cost+=Ye.cost||0,ir.metrics.namedScores=((De=(je=t.prompts[Ye.promptIdx])==null?void 0:je.metrics)==null?void 0:De.namedScores)||{},ir.metrics.namedScoresCount=((Qe=(He=t.prompts[Ye.promptIdx])==null?void 0:He.metrics)==null?void 0:Qe.namedScoresCount)||{}}const _e=Object.values(Ce),Ie=[...Ee].sort();for(const Ye of _e)Ye.vars=Ie.map(St=>{var We;return((We=Se.get(Ye.testIdx))==null?void 0:We[St])||""});return{head:{prompts:xe,vars:[...Ee].sort()},body:_e}}const EmailIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"Email"),AuthorChip=({author:t,onEditAuthor:Ae,currentUserEmail:xe,editable:Ee})=>{const[Se,Ce]=reactExports.useState(!1),[_e,Ie]=reactExports.useState(null),[Be,Te]=reactExports.useState(t||""),[Pe,ke]=reactExports.useState(null);reactExports.useEffect(()=>{!t&&xe&&Te(xe)},[t,xe]);const $e=Ge=>{Ie(Ge.currentTarget),Te(t||xe||""),ke(null)},Oe=()=>{Ie(null)},Ue=async()=>{if(!Se){Ce(!0),ke(null);try{await Ae(Be||""),Oe()}catch(Ge){ke(Ge instanceof Error?Ge.message:"An unknown error occurred")}finally{Ce(!1)}}},qe=Ge=>{Ge.key==="Enter"&&Ue()},ze=!!_e,Ve=ze?"author-popover":void 0;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip$2,{title:Ee?t?"Click to edit author":"Click to set author":"Author",children:jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",onClick:Ee?$e:void 0,sx:{border:"1px solid",borderColor:"divider",borderRadius:1,px:1,py:.5,"&:hover":{bgcolor:"action.hover"},minHeight:40,cursor:Ee?"pointer":"default"},children:[jsxRuntimeExports.jsx(EmailIcon,{fontSize:"small",sx:{mr:1,opacity:.7}}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",sx:{mr:1},children:[jsxRuntimeExports.jsx("strong",{children:"Author:"})," ",t||"Unknown"]}),Ee&&jsxRuntimeExports.jsx(IconButton,{size:"small",sx:{ml:"auto"},disabled:Se,children:jsxRuntimeExports.jsx(EditIcon,{fontSize:"small"})})]})}),jsxRuntimeExports.jsx(Popover,{id:Ve,open:ze,anchorEl:_e,onClose:Oe,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:jsxRuntimeExports.jsxs(Box,{sx:{p:2,display:"flex",flexDirection:"column",width:"400px"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"flex-end",mb:2},children:[jsxRuntimeExports.jsx(TextField,{label:"Author Email",variant:"standard",value:Be,onChange:Ge=>Te(Ge.target.value),onKeyPress:qe,error:!!Pe,helperText:Pe,disabled:Se,sx:{flexGrow:1,mr:2}}),jsxRuntimeExports.jsx(Button,{onClick:Ue,disabled:Se||!Be,children:Se?jsxRuntimeExports.jsx(CircularProgress,{size:24}):"Save"})]}),!xe&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center"},children:[jsxRuntimeExports.jsx(InfoIcon,{color:"info",fontSize:"small",sx:{mr:1}}),jsxRuntimeExports.jsx(Typography,{variant:"caption",children:"Setting an email address will also set the default author for future evals.\n It is changeable with `promptfoo config set email <your-email@example.com>`"})]})]})})]})},ViewColumnIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"}),"ViewColumn"),ColumnSelector=({columnData:t,selectedColumns:Ae,onChange:xe})=>{const[Ee,Se]=React.useState(!1),Ce=()=>Se(!0),_e=()=>Se(!1),Ie=$e=>({target:{value:$e,name:"visible-columns"},currentTarget:{value:$e,name:"visible-columns"},bubbles:!0,cancelBubble:!1,cancelable:!1,composed:!1,defaultPrevented:!1,eventPhase:0,isTrusted:!0,returnValue:!0,type:"change"}),Be=$e=>{const Oe=Ae.includes($e)?Ae.filter(Ue=>Ue!==$e):[...Ae,$e];xe(Ie(Oe))},Te=()=>{xe(Ie(t.map($e=>$e.value)))},Pe=()=>{xe(Ie([]))},ke=t.reduce(($e,Oe)=>{const Ue=(Oe==null?void 0:Oe.group)||"Other";return $e[Ue]||($e[Ue]=[]),$e[Ue].push(Oe),$e},{});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Button,{onClick:Ce,startIcon:jsxRuntimeExports.jsx(ViewColumnIcon,{}),variant:"text",children:["Columns (",Ae.length,")"]}),jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:_e,maxWidth:"sm",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Select Columns"}),jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:1,children:[jsxRuntimeExports.jsx(Button,{size:"small",onClick:Te,children:"Select All"}),jsxRuntimeExports.jsx(Button,{size:"small",onClick:Pe,children:"Clear"})]})]})}),jsxRuntimeExports.jsx(DialogContent,{dividers:!0,children:Object.entries(ke).map(([$e,Oe])=>jsxRuntimeExports.jsx(List$1,{subheader:jsxRuntimeExports.jsx(ListSubheader,{component:"div",sx:{bgcolor:"background.paper"},children:$e}),children:Oe.map(Ue=>jsxRuntimeExports.jsx(ListItem,{dense:!0,disablePadding:!0,children:jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Checkbox,{edge:"start",checked:Ae.includes(Ue.value),onChange:()=>Be(Ue.value)}),label:jsxRuntimeExports.jsx(Tooltip$2,{title:Ue.description||Ue.label,placement:"right",children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{maxWidth:"500px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ue.label})}),sx:{ml:1,width:"100%"}})},Ue.value))},$e))}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:_e,children:"Close"})})]})]})},CompareIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"Compare"),GridToolbarExport$1=()=>jsxRuntimeExports.jsx(GridToolbarExportContainer,{children:jsxRuntimeExports.jsx(GridCsvExportMenuItem,{})}),QuickFilter=reactExports.forwardRef((t,Ae)=>{const xe=useTheme();return jsxRuntimeExports.jsx(GridToolbarQuickFilter,{...t,inputRef:Ae,sx:{"& .MuiInputBase-root":{borderRadius:2,backgroundColor:xe.palette.background.paper}}})});QuickFilter.displayName="QuickFilter";function CustomToolbar$2({showUtilityButtons:t,focusQuickFilterOnMount:Ae}){const xe=useTheme(),Ee=reactExports.useRef(null);return reactExports.useEffect(()=>{Ae&&Ee.current&&Ee.current.focus()},[Ae]),jsxRuntimeExports.jsxs(GridToolbarContainer,{sx:{p:1,borderBottom:`1px solid ${xe.palette.divider}`},children:[t&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1},children:[jsxRuntimeExports.jsx(GridToolbarColumnsButton,{}),jsxRuntimeExports.jsx(GridToolbarFilterButton,{}),jsxRuntimeExports.jsx(GridToolbarDensitySelector,{}),jsxRuntimeExports.jsx(GridToolbarExport$1,{})]}),jsxRuntimeExports.jsx(Box,{sx:{flexGrow:1}}),jsxRuntimeExports.jsx(QuickFilter,{ref:Ee})]})}function EvalsDataGrid({onEvalSelected:t,focusedEvalId:Ae,showUtilityButtons:xe=!1,filterByDatasetId:Ee=!1,focusQuickFilterOnMount:Se=!1}){Ee&&invariant(Ae,"focusedEvalId is required when filterByDatasetId is true");const[Ce,_e]=reactExports.useState([]),[Ie,Be]=reactExports.useState(!0),[Te,Pe]=reactExports.useState(null),[ke,$e]=reactExports.useState(Ae?[Ae]:[]);reactExports.useEffect(()=>{(async()=>{try{const Ve=await callApi("/results",{cache:"no-store"});if(!Ve.ok)throw new Error("Failed to fetch evals");const Ge=await Ve.json();_e(Ge.data)}catch(Ve){Pe(Ve)}finally{Be(!1)}})()},[]);const Oe=reactExports.useMemo(()=>{let ze=Ce;if(Ae&&ze.length>0){const Ve=ze.find(({evalId:Ge})=>Ge===Ae);invariant(Ve,"focusedEvalId is not a valid eval ID"),Ee&&(ze=ze.filter(({datasetId:Ge})=>Ge===Ve.datasetId))}return ze},[Ce,Ee,Ae]),Ue=ze=>t(ze.row.evalId),qe=reactExports.useMemo(()=>[{field:"evalId",headerName:"ID",flex:1,renderCell:ze=>ze.row.evalId===Ae?ze.row.evalId:jsxRuntimeExports.jsx(Link,{href:`/eval/${ze.row.evalId}`,onClick:Ve=>(Ve.preventDefault(),t(ze.row.evalId),!1),children:ze.row.evalId})},{field:"createdAt",headerName:"Created",flex:1,valueFormatter:ze=>new Date(ze).toLocaleString()},{field:"description",headerName:"Description",flex:1,valueGetter:(ze,Ve)=>ze??Ve.label},{field:"passRate",headerName:"Pass Rate",flex:.5,type:"number",renderCell:ze=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:ze.value>=90?"success.main":ze.value>=60?"warning.main":"error.main",sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"end"},children:[ze.value.toFixed(2),"%"]})})},{field:"numTests",headerName:"# Tests",type:"number",flex:.5}].filter(Boolean),[]);return jsxRuntimeExports.jsx(Paper,{elevation:2,sx:{height:"100%"},children:jsxRuntimeExports.jsx(DataGrid,{rows:Oe,columns:qe,loading:Ie,getRowId:ze=>ze.evalId,slots:{toolbar:CustomToolbar$2,loadingOverlay:()=>jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:2},children:[jsxRuntimeExports.jsx(CircularProgress,{}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Loading evaluations..."})]}),noRowsOverlay:()=>jsxRuntimeExports.jsx(Box,{sx:{textAlign:"center",color:"text.secondary",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",p:3},children:Te?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{fontSize:"2rem",mb:2},children:"⚠️"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,color:"error",children:"Error loading evals"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:Te.message})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{fontSize:"2rem",mb:2},children:"🔍"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,children:"No evals found"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Try adjusting your search or create a new evaluation"})]})})},slotProps:{toolbar:{showUtilityButtons:xe,focusQuickFilterOnMount:Se}},onCellClick:ze=>{ze.id!==Ae&&Ue(ze)},getRowClassName:ze=>ze.id===Ae?"focused-row":"",sx:{border:"none","& .MuiDataGrid-row":{cursor:"pointer",transition:"background-color 0.2s ease","&:hover":{backgroundColor:"action.hover"}},"& .MuiDataGrid-row--disabled":{cursor:"default",opacity:.7,pointerEvents:"none"},"& .focused-row":{backgroundColor:"action.selected",cursor:"default","&:hover":{backgroundColor:"action.selected"}},"& .MuiDataGrid-cell":{borderColor:"divider"},"& .MuiDataGrid-columnHeaders":{backgroundColor:"background.default",borderColor:"divider"},"& .MuiDataGrid-selectedRow":{backgroundColor:"action.selected"},"--DataGrid-overlayHeight":"300px"},onRowSelectionModelChange:$e,rowSelectionModel:ke,initialState:{sorting:{sortModel:[{field:"createdAt",sort:"desc"}]},pagination:{paginationModel:{pageSize:25}}},pageSizeOptions:[10,25,50,100],isRowSelectable:ze=>ze.id!==Ae})})}const EvalSelectorDialog=({open:t,onClose:Ae,onEvalSelected:xe,title:Ee,description:Se,focusedEvalId:Ce,filterByDatasetId:_e,onOpenFocusSearch:Ie=!1})=>jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Ae,maxWidth:"md",fullWidth:!0,children:[Ee?jsxRuntimeExports.jsx(DialogTitle,{children:Ee}):null,jsxRuntimeExports.jsxs(DialogContent,{children:[Se?jsxRuntimeExports.jsx(Box,{sx:{mb:4},children:Se}):null,jsxRuntimeExports.jsx(Box,{sx:{width:"100%",mt:2},children:jsxRuntimeExports.jsx(EvalsDataGrid,{onEvalSelected:xe,focusedEvalId:Ce,filterByDatasetId:_e,focusQuickFilterOnMount:Ie})})]}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:Ae,children:"Cancel"})})]}),useStore=create$1()((t,Ae)=>({evalId:null,setEvalId:xe=>t(()=>({evalId:xe})),author:null,setAuthor:xe=>t(()=>({author:xe})),version:null,setVersion:xe=>t(()=>({version:xe})),table:null,setTable:xe=>t(()=>({table:xe})),setTableFromResultsFile:xe=>{if(xe.version&&xe.version>=4)t(()=>({table:convertResultsToTable(xe),version:xe.version}));else{const Ee=xe.results;t(()=>({table:Ee.table,version:xe.version}))}},config:null,setConfig:xe=>t(()=>({config:xe}))})),useResultsViewSettingsStore=create$1()(persist((t,Ae)=>({maxTextLength:250,setMaxTextLength:xe=>t(()=>({maxTextLength:xe})),wordBreak:"break-word",setWordBreak:xe=>t(()=>({wordBreak:xe})),showInferenceDetails:!0,setShowInferenceDetails:xe=>t(()=>({showInferenceDetails:xe})),renderMarkdown:!1,setRenderMarkdown:xe=>t(()=>({renderMarkdown:xe})),prettifyJson:!1,setPrettifyJson:xe=>t(()=>({prettifyJson:xe})),showPrompts:!1,setShowPrompts:xe=>t(()=>({showPrompts:xe})),showPassFail:!0,setShowPassFail:xe=>t(()=>({showPassFail:xe})),inComparisonMode:!1,setInComparisonMode:xe=>t(()=>({inComparisonMode:xe})),stickyHeader:!0,setStickyHeader:xe=>t(()=>({stickyHeader:xe})),columnStates:{},setColumnState:(xe,Ee)=>t(Se=>({columnStates:{...Se.columnStates,[xe]:Ee}})),maxImageWidth:256,setMaxImageWidth:xe=>t(()=>({maxImageWidth:xe})),maxImageHeight:256,setMaxImageHeight:xe=>t(()=>({maxImageHeight:xe}))}),{name:"eval-settings"}));function CompareEvalMenuItem({onComparisonEvalSelected:t}){const{evalId:Ae}=useStore(),[xe,Ee]=reactExports.useState(!1),Se=()=>{Ee(!0)},Ce=()=>{Ee(!1)},_e=Ie=>{t(Ie),Ce()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip$2,{title:"Combine this eval with another eval run",placement:"left",children:jsxRuntimeExports.jsxs(MenuItem,{onClick:Se,children:[jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(CompareIcon,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText,{children:"Compare with another eval"})]})}),jsxRuntimeExports.jsx(EvalSelectorDialog,{open:xe,onClose:Ce,onEvalSelected:Ie=>{_e(Ie)},title:"Select an eval to compare",description:"Only evals with the same dataset can be compared.",focusedEvalId:Ae??void 0,filterByDatasetId:!0})]})}const CheckIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),DownloadIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download"),FileCopyIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z"}),"FileCopy");function ConfigModal({open:t,onClose:Ae}){const{config:xe}=useStore(),Ee=React.useRef(null),[Se,Ce]=React.useState(!1),[_e,Ie]=React.useState("");React.useEffect(()=>{t&&(async()=>{const{default:ke}=await __vitePreload(async()=>{const{default:$e}=await Promise.resolve().then(()=>jsYaml$1);return{default:$e}},void 0);Ie(ke.dump(xe))})()},[t,xe]);const Be=()=>{Ee.current&&(Ee.current.select(),document.execCommand("copy"),Ce(!0))},Te=()=>{const ke=new Blob([_e],{type:"text/yaml;charset=utf-8"}),$e=URL.createObjectURL(ke),Oe=document.createElement("a");Oe.href=$e,Oe.download="config.yaml",document.body.appendChild(Oe),Oe.click(),document.body.removeChild(Oe),URL.revokeObjectURL($e)},Pe=()=>{Ce(!1),Ae()};return jsxRuntimeExports.jsxs(Dialog,{open:t,onClose:Pe,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{id:"config-dialog-title",children:jsxRuntimeExports.jsxs(Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",style:{flexGrow:1},children:"Config"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Tooltip$2,{title:"Copy to clipboard",children:jsxRuntimeExports.jsx(IconButton,{onClick:Be,children:Se?jsxRuntimeExports.jsx(CheckIcon,{}):jsxRuntimeExports.jsx(FileCopyIcon,{})})}),jsxRuntimeExports.jsx(Tooltip$2,{title:"Download .yaml",children:jsxRuntimeExports.jsx(IconButton,{onClick:Te,children:jsxRuntimeExports.jsx(DownloadIcon,{})})})]})]})}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsx(Typography,{variant:"body1",component:"div",children:jsxRuntimeExports.jsx("textarea",{ref:Ee,readOnly:!0,value:_e,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:Pe,color:"primary",children:"Close"})})]})}const CheckCircleIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),removeEmpty=t=>{const Ae=JSON.parse(JSON.stringify(t));return Object.keys(Ae).forEach(xe=>{(Array.isArray(Ae[xe])&&Ae[xe].length===0||Ae[xe]&&typeof Ae[xe]=="object"&&!Array.isArray(Ae[xe])&&Object.keys(Ae[xe]).length===0)&&delete Ae[xe]}),Ae};var global$1$1=typeof global$2<"u"?global$2:typeof self<"u"?self:typeof window<"u"?window:{},lookup$5=[],revLookup$1=[],Arr$1=typeof Uint8Array<"u"?Uint8Array:Array,inited$1=!1;function init$1(){inited$1=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ae=0,xe=t.length;Ae<xe;++Ae)lookup$5[Ae]=t[Ae],revLookup$1[t.charCodeAt(Ae)]=Ae;revLookup$1[45]=62,revLookup$1[95]=63}function toByteArray$1(t){inited$1||init$1();var Ae,xe,Ee,Se,Ce,_e,Ie=t.length;if(Ie%4>0)throw new Error("Invalid string. Length must be a multiple of 4");Ce=t[Ie-2]==="="?2:t[Ie-1]==="="?1:0,_e=new Arr$1(Ie*3/4-Ce),Ee=Ce>0?Ie-4:Ie;var Be=0;for(Ae=0,xe=0;Ae<Ee;Ae+=4,xe+=3)Se=revLookup$1[t.charCodeAt(Ae)]<<18|revLookup$1[t.charCodeAt(Ae+1)]<<12|revLookup$1[t.charCodeAt(Ae+2)]<<6|revLookup$1[t.charCodeAt(Ae+3)],_e[Be++]=Se>>16&255,_e[Be++]=Se>>8&255,_e[Be++]=Se&255;return Ce===2?(Se=revLookup$1[t.charCodeAt(Ae)]<<2|revLookup$1[t.charCodeAt(Ae+1)]>>4,_e[Be++]=Se&255):Ce===1&&(Se=revLookup$1[t.charCodeAt(Ae)]<<10|revLookup$1[t.charCodeAt(Ae+1)]<<4|revLookup$1[t.charCodeAt(Ae+2)]>>2,_e[Be++]=Se>>8&255,_e[Be++]=Se&255),_e}function tripletToBase64$1(t){return lookup$5[t>>18&63]+lookup$5[t>>12&63]+lookup$5[t>>6&63]+lookup$5[t&63]}function encodeChunk$1(t,Ae,xe){for(var Ee,Se=[],Ce=Ae;Ce<xe;Ce+=3)Ee=(t[Ce]<<16)+(t[Ce+1]<<8)+t[Ce+2],Se.push(tripletToBase64$1(Ee));return Se.join("")}function fromByteArray$1(t){inited$1||init$1();for(var Ae,xe=t.length,Ee=xe%3,Se="",Ce=[],_e=16383,Ie=0,Be=xe-Ee;Ie<Be;Ie+=_e)Ce.push(encodeChunk$1(t,Ie,Ie+_e>Be?Be:Ie+_e));return Ee===1?(Ae=t[xe-1],Se+=lookup$5[Ae>>2],Se+=lookup$5[Ae<<4&63],Se+="=="):Ee===2&&(Ae=(t[xe-2]<<8)+t[xe-1],Se+=lookup$5[Ae>>10],Se+=lookup$5[Ae>>4&63],Se+=lookup$5[Ae<<2&63],Se+="="),Ce.push(Se),Ce.join("")}function read$1(t,Ae,xe,Ee,Se){var Ce,_e,Ie=Se*8-Ee-1,Be=(1<<Ie)-1,Te=Be>>1,Pe=-7,ke=xe?Se-1:0,$e=xe?-1:1,Oe=t[Ae+ke];for(ke+=$e,Ce=Oe&(1<<-Pe)-1,Oe>>=-Pe,Pe+=Ie;Pe>0;Ce=Ce*256+t[Ae+ke],ke+=$e,Pe-=8);for(_e=Ce&(1<<-Pe)-1,Ce>>=-Pe,Pe+=Ee;Pe>0;_e=_e*256+t[Ae+ke],ke+=$e,Pe-=8);if(Ce===0)Ce=1-Te;else{if(Ce===Be)return _e?NaN:(Oe?-1:1)*(1/0);_e=_e+Math.pow(2,Ee),Ce=Ce-Te}return(Oe?-1:1)*_e*Math.pow(2,Ce-Ee)}function write$1(t,Ae,xe,Ee,Se,Ce){var _e,Ie,Be,Te=Ce*8-Se-1,Pe=(1<<Te)-1,ke=Pe>>1,$e=Se===23?Math.pow(2,-24)-Math.pow(2,-77):0,Oe=Ee?0:Ce-1,Ue=Ee?1:-1,qe=Ae<0||Ae===0&&1/Ae<0?1:0;for(Ae=Math.abs(Ae),isNaN(Ae)||Ae===1/0?(Ie=isNaN(Ae)?1:0,_e=Pe):(_e=Math.floor(Math.log(Ae)/Math.LN2),Ae*(Be=Math.pow(2,-_e))<1&&(_e--,Be*=2),_e+ke>=1?Ae+=$e/Be:Ae+=$e*Math.pow(2,1-ke),Ae*Be>=2&&(_e++,Be/=2),_e+ke>=Pe?(Ie=0,_e=Pe):_e+ke>=1?(Ie=(Ae*Be-1)*Math.pow(2,Se),_e=_e+ke):(Ie=Ae*Math.pow(2,ke-1)*Math.pow(2,Se),_e=0));Se>=8;t[xe+Oe]=Ie&255,Oe+=Ue,Ie/=256,Se-=8);for(_e=_e<<Se|Ie,Te+=Se;Te>0;t[xe+Oe]=_e&255,Oe+=Ue,_e/=256,Te-=8);t[xe+Oe-Ue]|=qe*128}var toString$5={}.toString,isArray$3=Array.isArray||function(t){return toString$5.call(t)=="[object Array]"},INSPECT_MAX_BYTES$1=50;Buffer$1.TYPED_ARRAY_SUPPORT=global$1$1.TYPED_ARRAY_SUPPORT!==void 0?global$1$1.TYPED_ARRAY_SUPPORT:!0;kMaxLength$1();function kMaxLength$1(){return Buffer$1.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer$1(t,Ae){if(kMaxLength$1()<Ae)throw new RangeError("Invalid typed array length");return Buffer$1.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(Ae),t.__proto__=Buffer$1.prototype):(t===null&&(t=new Buffer$1(Ae)),t.length=Ae),t}function Buffer$1(t,Ae,xe){if(!Buffer$1.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer$1))return new Buffer$1(t,Ae,xe);if(typeof t=="number"){if(typeof Ae=="string")throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe$1(this,t)}return from$2(this,t,Ae,xe)}Buffer$1.poolSize=8192;Buffer$1._augment=function(t){return t.__proto__=Buffer$1.prototype,t};function from$2(t,Ae,xe,Ee){if(typeof Ae=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&Ae instanceof ArrayBuffer?fromArrayBuffer$1(t,Ae,xe,Ee):typeof Ae=="string"?fromString$1(t,Ae,xe):fromObject$2(t,Ae)}Buffer$1.from=function(t,Ae,xe){return from$2(null,t,Ae,xe)};Buffer$1.TYPED_ARRAY_SUPPORT&&(Buffer$1.prototype.__proto__=Uint8Array.prototype,Buffer$1.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Buffer$1[Symbol.species]);function assertSize$1(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function alloc$1(t,Ae,xe,Ee){return assertSize$1(Ae),Ae<=0?createBuffer$1(t,Ae):xe!==void 0?typeof Ee=="string"?createBuffer$1(t,Ae).fill(xe,Ee):createBuffer$1(t,Ae).fill(xe):createBuffer$1(t,Ae)}Buffer$1.alloc=function(t,Ae,xe){return alloc$1(null,t,Ae,xe)};function allocUnsafe$1(t,Ae){if(assertSize$1(Ae),t=createBuffer$1(t,Ae<0?0:checked$1(Ae)|0),!Buffer$1.TYPED_ARRAY_SUPPORT)for(var xe=0;xe<Ae;++xe)t[xe]=0;return t}Buffer$1.allocUnsafe=function(t){return allocUnsafe$1(null,t)};Buffer$1.allocUnsafeSlow=function(t){return allocUnsafe$1(null,t)};function fromString$1(t,Ae,xe){if((typeof xe!="string"||xe==="")&&(xe="utf8"),!Buffer$1.isEncoding(xe))throw new TypeError('"encoding" must be a valid string encoding');var Ee=byteLength$1(Ae,xe)|0;t=createBuffer$1(t,Ee);var Se=t.write(Ae,xe);return Se!==Ee&&(t=t.slice(0,Se)),t}function fromArrayLike$1(t,Ae){var xe=Ae.length<0?0:checked$1(Ae.length)|0;t=createBuffer$1(t,xe);for(var Ee=0;Ee<xe;Ee+=1)t[Ee]=Ae[Ee]&255;return t}function fromArrayBuffer$1(t,Ae,xe,Ee){if(Ae.byteLength,xe<0||Ae.byteLength<xe)throw new RangeError("'offset' is out of bounds");if(Ae.byteLength<xe+(Ee||0))throw new RangeError("'length' is out of bounds");return xe===void 0&&Ee===void 0?Ae=new Uint8Array(Ae):Ee===void 0?Ae=new Uint8Array(Ae,xe):Ae=new Uint8Array(Ae,xe,Ee),Buffer$1.TYPED_ARRAY_SUPPORT?(t=Ae,t.__proto__=Buffer$1.prototype):t=fromArrayLike$1(t,Ae),t}function fromObject$2(t,Ae){if(internalIsBuffer$1(Ae)){var xe=checked$1(Ae.length)|0;return t=createBuffer$1(t,xe),t.length===0||Ae.copy(t,0,0,xe),t}if(Ae){if(typeof ArrayBuffer<"u"&&Ae.buffer instanceof ArrayBuffer||"length"in Ae)return typeof Ae.length!="number"||isnan$1(Ae.length)?createBuffer$1(t,0):fromArrayLike$1(t,Ae);if(Ae.type==="Buffer"&&isArray$3(Ae.data))return fromArrayLike$1(t,Ae.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked$1(t){if(t>=kMaxLength$1())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength$1().toString(16)+" bytes");return t|0}Buffer$1.isBuffer=isBuffer$2;function internalIsBuffer$1(t){return!!(t!=null&&t._isBuffer)}Buffer$1.compare=function t(Ae,xe){if(!internalIsBuffer$1(Ae)||!internalIsBuffer$1(xe))throw new TypeError("Arguments must be Buffers");if(Ae===xe)return 0;for(var Ee=Ae.length,Se=xe.length,Ce=0,_e=Math.min(Ee,Se);Ce<_e;++Ce)if(Ae[Ce]!==xe[Ce]){Ee=Ae[Ce],Se=xe[Ce];break}return Ee<Se?-1:Se<Ee?1:0};Buffer$1.isEncoding=function t(Ae){switch(String(Ae).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};Buffer$1.concat=function t(Ae,xe){if(!isArray$3(Ae))throw new TypeError('"list" argument must be an Array of Buffers');if(Ae.length===0)return Buffer$1.alloc(0);var Ee;if(xe===void 0)for(xe=0,Ee=0;Ee<Ae.length;++Ee)xe+=Ae[Ee].length;var Se=Buffer$1.allocUnsafe(xe),Ce=0;for(Ee=0;Ee<Ae.length;++Ee){var _e=Ae[Ee];if(!internalIsBuffer$1(_e))throw new TypeError('"list" argument must be an Array of Buffers');_e.copy(Se,Ce),Ce+=_e.length}return Se};function byteLength$1(t,Ae){if(internalIsBuffer$1(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var xe=t.length;if(xe===0)return 0;for(var Ee=!1;;)switch(Ae){case"ascii":case"latin1":case"binary":return xe;case"utf8":case"utf-8":case void 0:return utf8ToBytes$1(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xe*2;case"hex":return xe>>>1;case"base64":return base64ToBytes$1(t).length;default:if(Ee)return utf8ToBytes$1(t).length;Ae=(""+Ae).toLowerCase(),Ee=!0}}Buffer$1.byteLength=byteLength$1;function slowToString$1(t,Ae,xe){var Ee=!1;if((Ae===void 0||Ae<0)&&(Ae=0),Ae>this.length||((xe===void 0||xe>this.length)&&(xe=this.length),xe<=0)||(xe>>>=0,Ae>>>=0,xe<=Ae))return"";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice$1(this,Ae,xe);case"utf8":case"utf-8":return utf8Slice$1(this,Ae,xe);case"ascii":return asciiSlice$1(this,Ae,xe);case"latin1":case"binary":return latin1Slice$1(this,Ae,xe);case"base64":return base64Slice$1(this,Ae,xe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice$1(this,Ae,xe);default:if(Ee)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),Ee=!0}}Buffer$1.prototype._isBuffer=!0;function swap$2(t,Ae,xe){var Ee=t[Ae];t[Ae]=t[xe],t[xe]=Ee}Buffer$1.prototype.swap16=function t(){var Ae=this.length;if(Ae%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var xe=0;xe<Ae;xe+=2)swap$2(this,xe,xe+1);return this};Buffer$1.prototype.swap32=function t(){var Ae=this.length;if(Ae%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var xe=0;xe<Ae;xe+=4)swap$2(this,xe,xe+3),swap$2(this,xe+1,xe+2);return this};Buffer$1.prototype.swap64=function t(){var Ae=this.length;if(Ae%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var xe=0;xe<Ae;xe+=8)swap$2(this,xe,xe+7),swap$2(this,xe+1,xe+6),swap$2(this,xe+2,xe+5),swap$2(this,xe+3,xe+4);return this};Buffer$1.prototype.toString=function t(){var Ae=this.length|0;return Ae===0?"":arguments.length===0?utf8Slice$1(this,0,Ae):slowToString$1.apply(this,arguments)};Buffer$1.prototype.equals=function t(Ae){if(!internalIsBuffer$1(Ae))throw new TypeError("Argument must be a Buffer");return this===Ae?!0:Buffer$1.compare(this,Ae)===0};Buffer$1.prototype.inspect=function t(){var Ae="",xe=INSPECT_MAX_BYTES$1;return this.length>0&&(Ae=this.toString("hex",0,xe).match(/.{2}/g).join(" "),this.length>xe&&(Ae+=" ... ")),"<Buffer "+Ae+">"};Buffer$1.prototype.compare=function t(Ae,xe,Ee,Se,Ce){if(!internalIsBuffer$1(Ae))throw new TypeError("Argument must be a Buffer");if(xe===void 0&&(xe=0),Ee===void 0&&(Ee=Ae?Ae.length:0),Se===void 0&&(Se=0),Ce===void 0&&(Ce=this.length),xe<0||Ee>Ae.length||Se<0||Ce>this.length)throw new RangeError("out of range index");if(Se>=Ce&&xe>=Ee)return 0;if(Se>=Ce)return-1;if(xe>=Ee)return 1;if(xe>>>=0,Ee>>>=0,Se>>>=0,Ce>>>=0,this===Ae)return 0;for(var _e=Ce-Se,Ie=Ee-xe,Be=Math.min(_e,Ie),Te=this.slice(Se,Ce),Pe=Ae.slice(xe,Ee),ke=0;ke<Be;++ke)if(Te[ke]!==Pe[ke]){_e=Te[ke],Ie=Pe[ke];break}return _e<Ie?-1:Ie<_e?1:0};function bidirectionalIndexOf$1(t,Ae,xe,Ee,Se){if(t.length===0)return-1;if(typeof xe=="string"?(Ee=xe,xe=0):xe>2147483647?xe=2147483647:xe<-2147483648&&(xe=-2147483648),xe=+xe,isNaN(xe)&&(xe=Se?0:t.length-1),xe<0&&(xe=t.length+xe),xe>=t.length){if(Se)return-1;xe=t.length-1}else if(xe<0)if(Se)xe=0;else return-1;if(typeof Ae=="string"&&(Ae=Buffer$1.from(Ae,Ee)),internalIsBuffer$1(Ae))return Ae.length===0?-1:arrayIndexOf$1(t,Ae,xe,Ee,Se);if(typeof Ae=="number")return Ae=Ae&255,Buffer$1.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Se?Uint8Array.prototype.indexOf.call(t,Ae,xe):Uint8Array.prototype.lastIndexOf.call(t,Ae,xe):arrayIndexOf$1(t,[Ae],xe,Ee,Se);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf$1(t,Ae,xe,Ee,Se){var Ce=1,_e=t.length,Ie=Ae.length;if(Ee!==void 0&&(Ee=String(Ee).toLowerCase(),Ee==="ucs2"||Ee==="ucs-2"||Ee==="utf16le"||Ee==="utf-16le")){if(t.length<2||Ae.length<2)return-1;Ce=2,_e/=2,Ie/=2,xe/=2}function Be(Oe,Ue){return Ce===1?Oe[Ue]:Oe.readUInt16BE(Ue*Ce)}var Te;if(Se){var Pe=-1;for(Te=xe;Te<_e;Te++)if(Be(t,Te)===Be(Ae,Pe===-1?0:Te-Pe)){if(Pe===-1&&(Pe=Te),Te-Pe+1===Ie)return Pe*Ce}else Pe!==-1&&(Te-=Te-Pe),Pe=-1}else for(xe+Ie>_e&&(xe=_e-Ie),Te=xe;Te>=0;Te--){for(var ke=!0,$e=0;$e<Ie;$e++)if(Be(t,Te+$e)!==Be(Ae,$e)){ke=!1;break}if(ke)return Te}return-1}Buffer$1.prototype.includes=function t(Ae,xe,Ee){return this.indexOf(Ae,xe,Ee)!==-1};Buffer$1.prototype.indexOf=function t(Ae,xe,Ee){return bidirectionalIndexOf$1(this,Ae,xe,Ee,!0)};Buffer$1.prototype.lastIndexOf=function t(Ae,xe,Ee){return bidirectionalIndexOf$1(this,Ae,xe,Ee,!1)};function hexWrite$1(t,Ae,xe,Ee){xe=Number(xe)||0;var Se=t.length-xe;Ee?(Ee=Number(Ee),Ee>Se&&(Ee=Se)):Ee=Se;var Ce=Ae.length;if(Ce%2!==0)throw new TypeError("Invalid hex string");Ee>Ce/2&&(Ee=Ce/2);for(var _e=0;_e<Ee;++_e){var Ie=parseInt(Ae.substr(_e*2,2),16);if(isNaN(Ie))return _e;t[xe+_e]=Ie}return _e}function utf8Write$1(t,Ae,xe,Ee){return blitBuffer$1(utf8ToBytes$1(Ae,t.length-xe),t,xe,Ee)}function asciiWrite$1(t,Ae,xe,Ee){return blitBuffer$1(asciiToBytes$1(Ae),t,xe,Ee)}function latin1Write$1(t,Ae,xe,Ee){return asciiWrite$1(t,Ae,xe,Ee)}function base64Write$1(t,Ae,xe,Ee){return blitBuffer$1(base64ToBytes$1(Ae),t,xe,Ee)}function ucs2Write$1(t,Ae,xe,Ee){return blitBuffer$1(utf16leToBytes$1(Ae,t.length-xe),t,xe,Ee)}Buffer$1.prototype.write=function t(Ae,xe,Ee,Se){if(xe===void 0)Se="utf8",Ee=this.length,xe=0;else if(Ee===void 0&&typeof xe=="string")Se=xe,Ee=this.length,xe=0;else if(isFinite(xe))xe=xe|0,isFinite(Ee)?(Ee=Ee|0,Se===void 0&&(Se="utf8")):(Se=Ee,Ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Ce=this.length-xe;if((Ee===void 0||Ee>Ce)&&(Ee=Ce),Ae.length>0&&(Ee<0||xe<0)||xe>this.length)throw new RangeError("Attempt to write outside buffer bounds");Se||(Se="utf8");for(var _e=!1;;)switch(Se){case"hex":return hexWrite$1(this,Ae,xe,Ee);case"utf8":case"utf-8":return utf8Write$1(this,Ae,xe,Ee);case"ascii":return asciiWrite$1(this,Ae,xe,Ee);case"latin1":case"binary":return latin1Write$1(this,Ae,xe,Ee);case"base64":return base64Write$1(this,Ae,xe,Ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write$1(this,Ae,xe,Ee);default:if(_e)throw new TypeError("Unknown encoding: "+Se);Se=(""+Se).toLowerCase(),_e=!0}};Buffer$1.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice$1(t,Ae,xe){return Ae===0&&xe===t.length?fromByteArray$1(t):fromByteArray$1(t.slice(Ae,xe))}function utf8Slice$1(t,Ae,xe){xe=Math.min(t.length,xe);for(var Ee=[],Se=Ae;Se<xe;){var Ce=t[Se],_e=null,Ie=Ce>239?4:Ce>223?3:Ce>191?2:1;if(Se+Ie<=xe){var Be,Te,Pe,ke;switch(Ie){case 1:Ce<128&&(_e=Ce);break;case 2:Be=t[Se+1],(Be&192)===128&&(ke=(Ce&31)<<6|Be&63,ke>127&&(_e=ke));break;case 3:Be=t[Se+1],Te=t[Se+2],(Be&192)===128&&(Te&192)===128&&(ke=(Ce&15)<<12|(Be&63)<<6|Te&63,ke>2047&&(ke<55296||ke>57343)&&(_e=ke));break;case 4:Be=t[Se+1],Te=t[Se+2],Pe=t[Se+3],(Be&192)===128&&(Te&192)===128&&(Pe&192)===128&&(ke=(Ce&15)<<18|(Be&63)<<12|(Te&63)<<6|Pe&63,ke>65535&&ke<1114112&&(_e=ke))}}_e===null?(_e=65533,Ie=1):_e>65535&&(_e-=65536,Ee.push(_e>>>10&1023|55296),_e=56320|_e&1023),Ee.push(_e),Se+=Ie}return decodeCodePointsArray$1(Ee)}var MAX_ARGUMENTS_LENGTH$1=4096;function decodeCodePointsArray$1(t){var Ae=t.length;if(Ae<=MAX_ARGUMENTS_LENGTH$1)return String.fromCharCode.apply(String,t);for(var xe="",Ee=0;Ee<Ae;)xe+=String.fromCharCode.apply(String,t.slice(Ee,Ee+=MAX_ARGUMENTS_LENGTH$1));return xe}function asciiSlice$1(t,Ae,xe){var Ee="";xe=Math.min(t.length,xe);for(var Se=Ae;Se<xe;++Se)Ee+=String.fromCharCode(t[Se]&127);return Ee}function latin1Slice$1(t,Ae,xe){var Ee="";xe=Math.min(t.length,xe);for(var Se=Ae;Se<xe;++Se)Ee+=String.fromCharCode(t[Se]);return Ee}function hexSlice$1(t,Ae,xe){var Ee=t.length;(!Ae||Ae<0)&&(Ae=0),(!xe||xe<0||xe>Ee)&&(xe=Ee);for(var Se="",Ce=Ae;Ce<xe;++Ce)Se+=toHex$1(t[Ce]);return Se}function utf16leSlice$1(t,Ae,xe){for(var Ee=t.slice(Ae,xe),Se="",Ce=0;Ce<Ee.length;Ce+=2)Se+=String.fromCharCode(Ee[Ce]+Ee[Ce+1]*256);return Se}Buffer$1.prototype.slice=function t(Ae,xe){var Ee=this.length;Ae=~~Ae,xe=xe===void 0?Ee:~~xe,Ae<0?(Ae+=Ee,Ae<0&&(Ae=0)):Ae>Ee&&(Ae=Ee),xe<0?(xe+=Ee,xe<0&&(xe=0)):xe>Ee&&(xe=Ee),xe<Ae&&(xe=Ae);var Se;if(Buffer$1.TYPED_ARRAY_SUPPORT)Se=this.subarray(Ae,xe),Se.__proto__=Buffer$1.prototype;else{var Ce=xe-Ae;Se=new Buffer$1(Ce,void 0);for(var _e=0;_e<Ce;++_e)Se[_e]=this[_e+Ae]}return Se};function checkOffset$1(t,Ae,xe){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+Ae>xe)throw new RangeError("Trying to access beyond buffer length")}Buffer$1.prototype.readUIntLE=function t(Ae,xe,Ee){Ae=Ae|0,xe=xe|0,Ee||checkOffset$1(Ae,xe,this.length);for(var Se=this[Ae],Ce=1,_e=0;++_e<xe&&(Ce*=256);)Se+=this[Ae+_e]*Ce;return Se};Buffer$1.prototype.readUIntBE=function t(Ae,xe,Ee){Ae=Ae|0,xe=xe|0,Ee||checkOffset$1(Ae,xe,this.length);for(var Se=this[Ae+--xe],Ce=1;xe>0&&(Ce*=256);)Se+=this[Ae+--xe]*Ce;return Se};Buffer$1.prototype.readUInt8=function t(Ae,xe){return xe||checkOffset$1(Ae,1,this.length),this[Ae]};Buffer$1.prototype.readUInt16LE=function t(Ae,xe){return xe||checkOffset$1(Ae,2,this.length),this[Ae]|this[Ae+1]<<8};Buffer$1.prototype.readUInt16BE=function t(Ae,xe){return xe||checkOffset$1(Ae,2,this.length),this[Ae]<<8|this[Ae+1]};Buffer$1.prototype.readUInt32LE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),(this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16)+this[Ae+3]*16777216};Buffer$1.prototype.readUInt32BE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),this[Ae]*16777216+(this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3])};Buffer$1.prototype.readIntLE=function t(Ae,xe,Ee){Ae=Ae|0,xe=xe|0,Ee||checkOffset$1(Ae,xe,this.length);for(var Se=this[Ae],Ce=1,_e=0;++_e<xe&&(Ce*=256);)Se+=this[Ae+_e]*Ce;return Ce*=128,Se>=Ce&&(Se-=Math.pow(2,8*xe)),Se};Buffer$1.prototype.readIntBE=function t(Ae,xe,Ee){Ae=Ae|0,xe=xe|0,Ee||checkOffset$1(Ae,xe,this.length);for(var Se=xe,Ce=1,_e=this[Ae+--Se];Se>0&&(Ce*=256);)_e+=this[Ae+--Se]*Ce;return Ce*=128,_e>=Ce&&(_e-=Math.pow(2,8*xe)),_e};Buffer$1.prototype.readInt8=function t(Ae,xe){return xe||checkOffset$1(Ae,1,this.length),this[Ae]&128?(255-this[Ae]+1)*-1:this[Ae]};Buffer$1.prototype.readInt16LE=function t(Ae,xe){xe||checkOffset$1(Ae,2,this.length);var Ee=this[Ae]|this[Ae+1]<<8;return Ee&32768?Ee|4294901760:Ee};Buffer$1.prototype.readInt16BE=function t(Ae,xe){xe||checkOffset$1(Ae,2,this.length);var Ee=this[Ae+1]|this[Ae]<<8;return Ee&32768?Ee|4294901760:Ee};Buffer$1.prototype.readInt32LE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16|this[Ae+3]<<24};Buffer$1.prototype.readInt32BE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),this[Ae]<<24|this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3]};Buffer$1.prototype.readFloatLE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),read$1(this,Ae,!0,23,4)};Buffer$1.prototype.readFloatBE=function t(Ae,xe){return xe||checkOffset$1(Ae,4,this.length),read$1(this,Ae,!1,23,4)};Buffer$1.prototype.readDoubleLE=function t(Ae,xe){return xe||checkOffset$1(Ae,8,this.length),read$1(this,Ae,!0,52,8)};Buffer$1.prototype.readDoubleBE=function t(Ae,xe){return xe||checkOffset$1(Ae,8,this.length),read$1(this,Ae,!1,52,8)};function checkInt$1(t,Ae,xe,Ee,Se,Ce){if(!internalIsBuffer$1(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ae>Se||Ae<Ce)throw new RangeError('"value" argument is out of bounds');if(xe+Ee>t.length)throw new RangeError("Index out of range")}Buffer$1.prototype.writeUIntLE=function t(Ae,xe,Ee,Se){if(Ae=+Ae,xe=xe|0,Ee=Ee|0,!Se){var Ce=Math.pow(2,8*Ee)-1;checkInt$1(this,Ae,xe,Ee,Ce,0)}var _e=1,Ie=0;for(this[xe]=Ae&255;++Ie<Ee&&(_e*=256);)this[xe+Ie]=Ae/_e&255;return xe+Ee};Buffer$1.prototype.writeUIntBE=function t(Ae,xe,Ee,Se){if(Ae=+Ae,xe=xe|0,Ee=Ee|0,!Se){var Ce=Math.pow(2,8*Ee)-1;checkInt$1(this,Ae,xe,Ee,Ce,0)}var _e=Ee-1,Ie=1;for(this[xe+_e]=Ae&255;--_e>=0&&(Ie*=256);)this[xe+_e]=Ae/Ie&255;return xe+Ee};Buffer$1.prototype.writeUInt8=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,1,255,0),Buffer$1.TYPED_ARRAY_SUPPORT||(Ae=Math.floor(Ae)),this[xe]=Ae&255,xe+1};function objectWriteUInt16$1(t,Ae,xe,Ee){Ae<0&&(Ae=65535+Ae+1);for(var Se=0,Ce=Math.min(t.length-xe,2);Se<Ce;++Se)t[xe+Se]=(Ae&255<<8*(Ee?Se:1-Se))>>>(Ee?Se:1-Se)*8}Buffer$1.prototype.writeUInt16LE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae&255,this[xe+1]=Ae>>>8):objectWriteUInt16$1(this,Ae,xe,!0),xe+2};Buffer$1.prototype.writeUInt16BE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae>>>8,this[xe+1]=Ae&255):objectWriteUInt16$1(this,Ae,xe,!1),xe+2};function objectWriteUInt32$1(t,Ae,xe,Ee){Ae<0&&(Ae=4294967295+Ae+1);for(var Se=0,Ce=Math.min(t.length-xe,4);Se<Ce;++Se)t[xe+Se]=Ae>>>(Ee?Se:3-Se)*8&255}Buffer$1.prototype.writeUInt32LE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe+3]=Ae>>>24,this[xe+2]=Ae>>>16,this[xe+1]=Ae>>>8,this[xe]=Ae&255):objectWriteUInt32$1(this,Ae,xe,!0),xe+4};Buffer$1.prototype.writeUInt32BE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae>>>24,this[xe+1]=Ae>>>16,this[xe+2]=Ae>>>8,this[xe+3]=Ae&255):objectWriteUInt32$1(this,Ae,xe,!1),xe+4};Buffer$1.prototype.writeIntLE=function t(Ae,xe,Ee,Se){if(Ae=+Ae,xe=xe|0,!Se){var Ce=Math.pow(2,8*Ee-1);checkInt$1(this,Ae,xe,Ee,Ce-1,-Ce)}var _e=0,Ie=1,Be=0;for(this[xe]=Ae&255;++_e<Ee&&(Ie*=256);)Ae<0&&Be===0&&this[xe+_e-1]!==0&&(Be=1),this[xe+_e]=(Ae/Ie>>0)-Be&255;return xe+Ee};Buffer$1.prototype.writeIntBE=function t(Ae,xe,Ee,Se){if(Ae=+Ae,xe=xe|0,!Se){var Ce=Math.pow(2,8*Ee-1);checkInt$1(this,Ae,xe,Ee,Ce-1,-Ce)}var _e=Ee-1,Ie=1,Be=0;for(this[xe+_e]=Ae&255;--_e>=0&&(Ie*=256);)Ae<0&&Be===0&&this[xe+_e+1]!==0&&(Be=1),this[xe+_e]=(Ae/Ie>>0)-Be&255;return xe+Ee};Buffer$1.prototype.writeInt8=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,1,127,-128),Buffer$1.TYPED_ARRAY_SUPPORT||(Ae=Math.floor(Ae)),Ae<0&&(Ae=255+Ae+1),this[xe]=Ae&255,xe+1};Buffer$1.prototype.writeInt16LE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae&255,this[xe+1]=Ae>>>8):objectWriteUInt16$1(this,Ae,xe,!0),xe+2};Buffer$1.prototype.writeInt16BE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae>>>8,this[xe+1]=Ae&255):objectWriteUInt16$1(this,Ae,xe,!1),xe+2};Buffer$1.prototype.writeInt32LE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,4,2147483647,-2147483648),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae&255,this[xe+1]=Ae>>>8,this[xe+2]=Ae>>>16,this[xe+3]=Ae>>>24):objectWriteUInt32$1(this,Ae,xe,!0),xe+4};Buffer$1.prototype.writeInt32BE=function t(Ae,xe,Ee){return Ae=+Ae,xe=xe|0,Ee||checkInt$1(this,Ae,xe,4,2147483647,-2147483648),Ae<0&&(Ae=4294967295+Ae+1),Buffer$1.TYPED_ARRAY_SUPPORT?(this[xe]=Ae>>>24,this[xe+1]=Ae>>>16,this[xe+2]=Ae>>>8,this[xe+3]=Ae&255):objectWriteUInt32$1(this,Ae,xe,!1),xe+4};function checkIEEE754$1(t,Ae,xe,Ee,Se,Ce){if(xe+Ee>t.length)throw new RangeError("Index out of range");if(xe<0)throw new RangeError("Index out of range")}function writeFloat$1(t,Ae,xe,Ee,Se){return Se||checkIEEE754$1(t,Ae,xe,4),write$1(t,Ae,xe,Ee,23,4),xe+4}Buffer$1.prototype.writeFloatLE=function t(Ae,xe,Ee){return writeFloat$1(this,Ae,xe,!0,Ee)};Buffer$1.prototype.writeFloatBE=function t(Ae,xe,Ee){return writeFloat$1(this,Ae,xe,!1,Ee)};function writeDouble$1(t,Ae,xe,Ee,Se){return Se||checkIEEE754$1(t,Ae,xe,8),write$1(t,Ae,xe,Ee,52,8),xe+8}Buffer$1.prototype.writeDoubleLE=function t(Ae,xe,Ee){return writeDouble$1(this,Ae,xe,!0,Ee)};Buffer$1.prototype.writeDoubleBE=function t(Ae,xe,Ee){return writeDouble$1(this,Ae,xe,!1,Ee)};Buffer$1.prototype.copy=function t(Ae,xe,Ee,Se){if(Ee||(Ee=0),!Se&&Se!==0&&(Se=this.length),xe>=Ae.length&&(xe=Ae.length),xe||(xe=0),Se>0&&Se<Ee&&(Se=Ee),Se===Ee||Ae.length===0||this.length===0)return 0;if(xe<0)throw new RangeError("targetStart out of bounds");if(Ee<0||Ee>=this.length)throw new RangeError("sourceStart out of bounds");if(Se<0)throw new RangeError("sourceEnd out of bounds");Se>this.length&&(Se=this.length),Ae.length-xe<Se-Ee&&(Se=Ae.length-xe+Ee);var Ce=Se-Ee,_e;if(this===Ae&&Ee<xe&&xe<Se)for(_e=Ce-1;_e>=0;--_e)Ae[_e+xe]=this[_e+Ee];else if(Ce<1e3||!Buffer$1.TYPED_ARRAY_SUPPORT)for(_e=0;_e<Ce;++_e)Ae[_e+xe]=this[_e+Ee];else Uint8Array.prototype.set.call(Ae,this.subarray(Ee,Ee+Ce),xe);return Ce};Buffer$1.prototype.fill=function t(Ae,xe,Ee,Se){if(typeof Ae=="string"){if(typeof xe=="string"?(Se=xe,xe=0,Ee=this.length):typeof Ee=="string"&&(Se=Ee,Ee=this.length),Ae.length===1){var Ce=Ae.charCodeAt(0);Ce<256&&(Ae=Ce)}if(Se!==void 0&&typeof Se!="string")throw new TypeError("encoding must be a string");if(typeof Se=="string"&&!Buffer$1.isEncoding(Se))throw new TypeError("Unknown encoding: "+Se)}else typeof Ae=="number"&&(Ae=Ae&255);if(xe<0||this.length<xe||this.length<Ee)throw new RangeError("Out of range index");if(Ee<=xe)return this;xe=xe>>>0,Ee=Ee===void 0?this.length:Ee>>>0,Ae||(Ae=0);var _e;if(typeof Ae=="number")for(_e=xe;_e<Ee;++_e)this[_e]=Ae;else{var Ie=internalIsBuffer$1(Ae)?Ae:utf8ToBytes$1(new Buffer$1(Ae,Se).toString()),Be=Ie.length;for(_e=0;_e<Ee-xe;++_e)this[_e+xe]=Ie[_e%Be]}return this};var INVALID_BASE64_RE$1=/[^+\/0-9A-Za-z-_]/g;function base64clean$1(t){if(t=stringtrim$1(t).replace(INVALID_BASE64_RE$1,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function stringtrim$1(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex$1(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes$1(t,Ae){Ae=Ae||1/0;for(var xe,Ee=t.length,Se=null,Ce=[],_e=0;_e<Ee;++_e){if(xe=t.charCodeAt(_e),xe>55295&&xe<57344){if(!Se){if(xe>56319){(Ae-=3)>-1&&Ce.push(239,191,189);continue}else if(_e+1===Ee){(Ae-=3)>-1&&Ce.push(239,191,189);continue}Se=xe;continue}if(xe<56320){(Ae-=3)>-1&&Ce.push(239,191,189),Se=xe;continue}xe=(Se-55296<<10|xe-56320)+65536}else Se&&(Ae-=3)>-1&&Ce.push(239,191,189);if(Se=null,xe<128){if((Ae-=1)<0)break;Ce.push(xe)}else if(xe<2048){if((Ae-=2)<0)break;Ce.push(xe>>6|192,xe&63|128)}else if(xe<65536){if((Ae-=3)<0)break;Ce.push(xe>>12|224,xe>>6&63|128,xe&63|128)}else if(xe<1114112){if((Ae-=4)<0)break;Ce.push(xe>>18|240,xe>>12&63|128,xe>>6&63|128,xe&63|128)}else throw new Error("Invalid code point")}return Ce}function asciiToBytes$1(t){for(var Ae=[],xe=0;xe<t.length;++xe)Ae.push(t.charCodeAt(xe)&255);return Ae}function utf16leToBytes$1(t,Ae){for(var xe,Ee,Se,Ce=[],_e=0;_e<t.length&&!((Ae-=2)<0);++_e)xe=t.charCodeAt(_e),Ee=xe>>8,Se=xe%256,Ce.push(Se),Ce.push(Ee);return Ce}function base64ToBytes$1(t){return toByteArray$1(base64clean$1(t))}function blitBuffer$1(t,Ae,xe,Ee){for(var Se=0;Se<Ee&&!(Se+xe>=Ae.length||Se>=t.length);++Se)Ae[Se+xe]=t[Se];return Se}function isnan$1(t){return t!==t}function isBuffer$2(t){return t!=null&&(!!t._isBuffer||isFastBuffer$1(t)||isSlowBuffer$1(t))}function isFastBuffer$1(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function isSlowBuffer$1(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&isFastBuffer$1(t.slice(0,0))}const charCodeOfDot=46,reEscapeChar=/\\(\\)?/g,rePropName=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,getTag$1=function(t){return Object.prototype.toString.call(t)},isSymbol=function(t){const Ae=typeof t;return Ae==="symbol"||Ae==="object"&&t&&getTag$1(t)==="[object Symbol]"},isKey=function(t,Ae){if(Array.isArray(t))return!1;const xe=typeof t;return xe==="number"||xe==="symbol"||xe==="boolean"||!t||isSymbol(t)?!0:reIsPlainProp.test(t)||!reIsDeepProp.test(t)||Ae!=null&&t in Object(Ae)},stringToPath=function(t){const Ae=[];return t.charCodeAt(0)===charCodeOfDot&&Ae.push(""),t.replace(rePropName,function(xe,Ee,Se,Ce){let _e=xe;Se?_e=Ce.replace(reEscapeChar,"$1"):Ee&&(_e=Ee.trim()),Ae.push(_e)}),Ae},castPath=function(t,Ae){return Array.isArray(t)?t:isKey(t,Ae)?[t]:stringToPath(t)},toKey=function(t){if(typeof t=="string"||isSymbol(t))return t;const Ae=`${t}`;return Ae=="0"&&1/t==-INFINITY?"-0":Ae},get$2=function(t,Ae){Ae=castPath(Ae,t);let xe=0;const Ee=Ae.length;for(;t!=null&&xe<Ee;)t=t[toKey(Ae[xe++])];return xe&&xe===Ee?t:void 0},is_object$1=function(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)},normalize_columns=function(t){if(t==null)return[void 0,void 0];if(typeof t!="object")return[Error('Invalid option "columns": expect an array or an object')];if(Array.isArray(t)){const Ae=[];for(const xe of t)if(typeof xe=="string")Ae.push({key:xe,header:xe});else if(typeof xe=="object"&&xe!==null&&!Array.isArray(xe)){if(!xe.key)return[Error('Invalid column definition: property "key" is required')];xe.header===void 0&&(xe.header=xe.key),Ae.push(xe)}else return[Error("Invalid column definition: expect a string or an object")];t=Ae}else{const Ae=[];for(const xe in t)Ae.push({key:xe,header:t[xe]});t=Ae}return[void 0,t]};let CsvError$1=class zh extends Error{constructor(Ae,xe,...Ee){Array.isArray(xe)&&(xe=xe.join(" ")),super(xe),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,zh),this.code=Ae;for(const Se of Ee)for(const Ce in Se){const _e=Se[Ce];this[Ce]=isBuffer$2(_e)?_e.toString():_e==null?_e:JSON.parse(JSON.stringify(_e))}}};const underscore$1=function(t){return t.replace(/([A-Z])/g,function(Ae,xe){return"_"+xe.toLowerCase()})},normalize_options$1=function(t){const Ae={};for(const Se in t)Ae[underscore$1(Se)]=t[Se];if(Ae.bom===void 0||Ae.bom===null||Ae.bom===!1)Ae.bom=!1;else if(Ae.bom!==!0)return[new CsvError$1("CSV_OPTION_BOOLEAN_INVALID_TYPE",["option `bom` is optional and must be a boolean value,",`got ${JSON.stringify(Ae.bom)}`])];if(Ae.delimiter===void 0||Ae.delimiter===null)Ae.delimiter=",";else if(isBuffer$2(Ae.delimiter))Ae.delimiter=Ae.delimiter.toString();else if(typeof Ae.delimiter!="string")return[new CsvError$1("CSV_OPTION_DELIMITER_INVALID_TYPE",["option `delimiter` must be a buffer or a string,",`got ${JSON.stringify(Ae.delimiter)}`])];if(Ae.quote===void 0||Ae.quote===null)Ae.quote='"';else if(Ae.quote===!0)Ae.quote='"';else if(Ae.quote===!1)Ae.quote="";else if(isBuffer$2(Ae.quote))Ae.quote=Ae.quote.toString();else if(typeof Ae.quote!="string")return[new CsvError$1("CSV_OPTION_QUOTE_INVALID_TYPE",["option `quote` must be a boolean, a buffer or a string,",`got ${JSON.stringify(Ae.quote)}`])];if((Ae.quoted===void 0||Ae.quoted===null)&&(Ae.quoted=!1),Ae.escape_formulas===void 0||Ae.escape_formulas===null)Ae.escape_formulas=!1;else if(typeof Ae.escape_formulas!="boolean")return[new CsvError$1("CSV_OPTION_ESCAPE_FORMULAS_INVALID_TYPE",["option `escape_formulas` must be a boolean,",`got ${JSON.stringify(Ae.escape_formulas)}`])];if((Ae.quoted_empty===void 0||Ae.quoted_empty===null)&&(Ae.quoted_empty=void 0),Ae.quoted_match===void 0||Ae.quoted_match===null||Ae.quoted_match===!1?Ae.quoted_match=null:Array.isArray(Ae.quoted_match)||(Ae.quoted_match=[Ae.quoted_match]),Ae.quoted_match)for(const Se of Ae.quoted_match){const Ce=typeof Se=="string",_e=Se instanceof RegExp;if(!Ce&&!_e)return[Error(`Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(Se)}`)]}if((Ae.quoted_string===void 0||Ae.quoted_string===null)&&(Ae.quoted_string=!1),(Ae.eof===void 0||Ae.eof===null)&&(Ae.eof=!0),Ae.escape===void 0||Ae.escape===null)Ae.escape='"';else if(isBuffer$2(Ae.escape))Ae.escape=Ae.escape.toString();else if(typeof Ae.escape!="string")return[Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(Ae.escape)}`)];if(Ae.escape.length>1)return[Error(`Invalid Option: escape must be one character, got ${Ae.escape.length} characters`)];(Ae.header===void 0||Ae.header===null)&&(Ae.header=!1);const[xe,Ee]=normalize_columns(Ae.columns);if(xe!==void 0)return[xe];if(Ae.columns=Ee,(Ae.quoted===void 0||Ae.quoted===null)&&(Ae.quoted=!1),(Ae.cast===void 0||Ae.cast===null)&&(Ae.cast={}),(Ae.cast.bigint===void 0||Ae.cast.bigint===null)&&(Ae.cast.bigint=Se=>""+Se),(Ae.cast.boolean===void 0||Ae.cast.boolean===null)&&(Ae.cast.boolean=Se=>Se?"1":""),(Ae.cast.date===void 0||Ae.cast.date===null)&&(Ae.cast.date=Se=>""+Se.getTime()),(Ae.cast.number===void 0||Ae.cast.number===null)&&(Ae.cast.number=Se=>""+Se),(Ae.cast.object===void 0||Ae.cast.object===null)&&(Ae.cast.object=Se=>JSON.stringify(Se)),(Ae.cast.string===void 0||Ae.cast.string===null)&&(Ae.cast.string=function(Se){return Se}),Ae.on_record!==void 0&&typeof Ae.on_record!="function")return[Error('Invalid Option: "on_record" must be a function.')];if(Ae.record_delimiter===void 0||Ae.record_delimiter===null)Ae.record_delimiter=`
578
578
  `;else if(isBuffer$2(Ae.record_delimiter))Ae.record_delimiter=Ae.record_delimiter.toString();else if(typeof Ae.record_delimiter!="string")return[Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(Ae.record_delimiter)}`)];switch(Ae.record_delimiter){case"unix":Ae.record_delimiter=`
579
579
  `;break;case"mac":Ae.record_delimiter="\r";break;case"windows":Ae.record_delimiter=`\r
580
580
  `;break;case"ascii":Ae.record_delimiter="";break;case"unicode":Ae.record_delimiter="\u2028";break}return[void 0,Ae]},bom_utf8=Buffer$1.from([239,187,191]),stringifier=function(t,Ae,xe){return{options:t,state:Ae,info:xe,__transform:function(Ee,Se){if(!Array.isArray(Ee)&&typeof Ee!="object")return Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(Ee)}`);if(this.info.records===0){if(Array.isArray(Ee)){if(this.options.header===!0&&this.options.columns===void 0)return Error("Undiscoverable Columns: header option requires column option or object records")}else if(this.options.columns===void 0){const[Ie,Be]=normalize_columns(Object.keys(Ee));if(Ie)return;this.options.columns=Be}}if(this.info.records===0){this.bom(Se);const Ie=this.headers(Se);if(Ie)return Ie}try{this.options.on_record&&this.options.on_record(Ee,this.info.records)}catch(Ie){return Ie}let Ce,_e;if(this.options.eof){if([Ce,_e]=this.stringify(Ee),Ce)return Ce;if(_e===void 0)return;_e=_e+this.options.record_delimiter}else{if([Ce,_e]=this.stringify(Ee),Ce)return Ce;if(_e===void 0)return;(this.options.header||this.info.records)&&(_e=this.options.record_delimiter+_e)}this.info.records++,Se(_e)},stringify:function(Ee,Se=!1){if(typeof Ee!="object")return[void 0,Ee];const{columns:Ce}=this.options,_e=[];if(Array.isArray(Ee)){Ce&&Ee.splice(Ce.length);for(let Be=0;Be<Ee.length;Be++){const Te=Ee[Be],[Pe,ke]=this.__cast(Te,{index:Be,column:Be,records:this.info.records,header:Se});if(Pe)return[Pe];_e[Be]=[ke,Te]}}else for(let Be=0;Be<Ce.length;Be++){const Te=get$2(Ee,Ce[Be].key),[Pe,ke]=this.__cast(Te,{index:Be,column:Ce[Be].key,records:this.info.records,header:Se});if(Pe)return[Pe];_e[Be]=[ke,Te]}let Ie="";for(let Be=0;Be<_e.length;Be++){let Te,Pe,[ke,$e]=_e[Be];if(typeof ke=="string")Te=this.options;else if(is_object$1(ke)){if(Te=ke,ke=Te.value,delete Te.value,typeof ke!="string"&&ke!==void 0&&ke!==null&&Pe)return[Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(ke)}`)];if(Te={...this.options,...Te},[Pe,Te]=normalize_options$1(Te),Pe!==void 0)return[Pe]}else if(ke==null)Te=this.options;else return[Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(ke)}`)];const{delimiter:Oe,escape:Ue,quote:qe,quoted:ze,quoted_empty:Ve,quoted_string:Ge,quoted_match:Xe,record_delimiter:er,escape_formulas:tr}=Te;if(ke===""&&$e===""){let nr=Xe&&Xe.filter(dr=>typeof dr=="string"?ke.indexOf(dr)!==-1:dr.test(ke));nr=nr&&nr.length>0,(nr||Ve===!0||Ge===!0&&Ve!==!1)===!0&&(ke=qe+ke+qe),Ie+=ke}else if(ke){if(typeof ke!="string")return[Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(ke)}`)];const nr=Oe.length&&ke.indexOf(Oe)>=0,sr=qe!==""&&ke.indexOf(qe)>=0,dr=ke.indexOf(Ue)>=0&&Ue!==qe,ar=ke.indexOf(er)>=0,lr=Ge&&typeof $e=="string";let Ke=Xe&&Xe.filter(je=>typeof je=="string"?ke.indexOf(je)!==-1:je.test(ke));if(Ke=Ke&&Ke.length>0,tr)switch(ke[0]){case"=":case"+":case"-":case"@":case" ":case"\r":case"=":case"+":case"-":case"@":ke=`'${ke}`;break}const Me=sr===!0||nr||ar||ze||lr||Ke;if(Me===!0&&dr===!0){const je=Ue==="\\"?new RegExp(Ue+Ue,"g"):new RegExp(Ue,"g");ke=ke.replace(je,Ue+Ue)}if(sr===!0){const je=new RegExp(qe,"g");ke=ke.replace(je,Ue+qe)}Me===!0&&(ke=qe+ke+qe),Ie+=ke}else(Ve===!0||$e===""&&Ge===!0&&Ve!==!1)&&(Ie+=qe+qe);Be!==_e.length-1&&(Ie+=Oe)}return[void 0,Ie]},bom:function(Ee){this.options.bom===!0&&Ee(bom_utf8)},headers:function(Ee){if(this.options.header===!1||this.options.columns===void 0)return;let Se,Ce=this.options.columns.map(_e=>_e.header);if(this.options.eof?([Se,Ce]=this.stringify(Ce,!0),Ce+=this.options.record_delimiter):[Se,Ce]=this.stringify(Ce),Se)return Se;Ee(Ce)},__cast:function(Ee,Se){const Ce=typeof Ee;try{return Ce==="string"?[void 0,this.options.cast.string(Ee,Se)]:Ce==="bigint"?[void 0,this.options.cast.bigint(Ee,Se)]:Ce==="number"?[void 0,this.options.cast.number(Ee,Se)]:Ce==="boolean"?[void 0,this.options.cast.boolean(Ee,Se)]:Ee instanceof Date?[void 0,this.options.cast.date(Ee,Se)]:Ce==="object"&&Ee!==null?[void 0,this.options.cast.object(Ee,Se)]:[void 0,Ee,Ee]}catch(_e){return[_e]}}}},stringify$2=function(t,Ae={}){const xe=[],[Ee,Se]=normalize_options$1(Ae);if(Ee!==void 0)throw Ee;const Ie=stringifier(Se,{stop:!1},{records:0});for(const Be of t){const Te=Ie.__transform(Be,function(Pe){xe.push(Pe)});if(Te!==void 0)throw Te}if(xe.length===0){Ie.bom(Te=>{xe.push(Te)});const Be=Ie.headers(Te=>{xe.push(Te)});if(Be!==void 0)throw Be}return xe.join("")};function DownloadMenu(){const{table:t,config:Ae,evalId:xe}=useStore(),[Ee,Se]=reactExports.useState(!1),[Ce,_e]=reactExports.useState(new Set),{showToast:Ie}=useToast(),Be=useTheme(),Te=Be.palette.mode==="dark",Pe=(ar,lr)=>{const Ke=URL.createObjectURL(ar),Me=document.createElement("a");Me.href=Ke,Me.download=lr,document.body.appendChild(Me),Me.click(),document.body.removeChild(Me),URL.revokeObjectURL(Ke),_e(je=>new Set([...je,lr]))},ke=()=>{Se(!1),_e(new Set)},$e=ar=>{navigator.clipboard.writeText(ar).then(()=>{Ie("Command copied to clipboard","success")}).catch(lr=>{console.error("Failed to copy text: ",lr),Ie("Failed to copy command","error")})},Oe=(ar,lr,Ke,Me={})=>{const je=`# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
@@ -586,16 +586,16 @@ ${Ze}`:Ye.error?We=`${Ye.error}`:We=Ze,St.outputs[Ye.promptIdx]={id:Ye.id||`${Ye
586
586
  * (c) 2024 Jukka Kurkela
587
587
  * Released under the MIT License
588
588
  */function round$1(t){return t+.5|0}const lim=(t,Ae,xe)=>Math.max(Math.min(t,xe),Ae);function p2b(t){return lim(round$1(t*2.55),0,255)}function n2b(t){return lim(round$1(t*255),0,255)}function b2n(t){return lim(round$1(t/2.55)/100,0,1)}function n2p(t){return lim(round$1(t*100),0,100)}const map$1$1={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},hex=[..."0123456789ABCDEF"],h1=t=>hex[t&15],h2=t=>hex[(t&240)>>4]+hex[t&15],eq=t=>(t&240)>>4===(t&15),isShort=t=>eq(t.r)&&eq(t.g)&&eq(t.b)&&eq(t.a);function hexParse(t){var Ae=t.length,xe;return t[0]==="#"&&(Ae===4||Ae===5?xe={r:255&map$1$1[t[1]]*17,g:255&map$1$1[t[2]]*17,b:255&map$1$1[t[3]]*17,a:Ae===5?map$1$1[t[4]]*17:255}:(Ae===7||Ae===9)&&(xe={r:map$1$1[t[1]]<<4|map$1$1[t[2]],g:map$1$1[t[3]]<<4|map$1$1[t[4]],b:map$1$1[t[5]]<<4|map$1$1[t[6]],a:Ae===9?map$1$1[t[7]]<<4|map$1$1[t[8]]:255})),xe}const alpha$2=(t,Ae)=>t<255?Ae(t):"";function hexString(t){var Ae=isShort(t)?h1:h2;return t?"#"+Ae(t.r)+Ae(t.g)+Ae(t.b)+alpha$2(t.a,Ae):void 0}const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(t,Ae,xe){const Ee=Ae*Math.min(xe,1-xe),Se=(Ce,_e=(Ce+t/30)%12)=>xe-Ee*Math.max(Math.min(_e-3,9-_e,1),-1);return[Se(0),Se(8),Se(4)]}function hsv2rgbn(t,Ae,xe){const Ee=(Se,Ce=(Se+t/60)%6)=>xe-xe*Ae*Math.max(Math.min(Ce,4-Ce,1),0);return[Ee(5),Ee(3),Ee(1)]}function hwb2rgbn(t,Ae,xe){const Ee=hsl2rgbn(t,1,.5);let Se;for(Ae+xe>1&&(Se=1/(Ae+xe),Ae*=Se,xe*=Se),Se=0;Se<3;Se++)Ee[Se]*=1-Ae-xe,Ee[Se]+=Ae;return Ee}function hueValue(t,Ae,xe,Ee,Se){return t===Se?(Ae-xe)/Ee+(Ae<xe?6:0):Ae===Se?(xe-t)/Ee+2:(t-Ae)/Ee+4}function rgb2hsl(t){const xe=t.r/255,Ee=t.g/255,Se=t.b/255,Ce=Math.max(xe,Ee,Se),_e=Math.min(xe,Ee,Se),Ie=(Ce+_e)/2;let Be,Te,Pe;return Ce!==_e&&(Pe=Ce-_e,Te=Ie>.5?Pe/(2-Ce-_e):Pe/(Ce+_e),Be=hueValue(xe,Ee,Se,Pe,Ce),Be=Be*60+.5),[Be|0,Te||0,Ie]}function calln(t,Ae,xe,Ee){return(Array.isArray(Ae)?t(Ae[0],Ae[1],Ae[2]):t(Ae,xe,Ee)).map(n2b)}function hsl2rgb(t,Ae,xe){return calln(hsl2rgbn,t,Ae,xe)}function hwb2rgb(t,Ae,xe){return calln(hwb2rgbn,t,Ae,xe)}function hsv2rgb(t,Ae,xe){return calln(hsv2rgbn,t,Ae,xe)}function hue(t){return(t%360+360)%360}function hueParse(t){const Ae=HUE_RE.exec(t);let xe=255,Ee;if(!Ae)return;Ae[5]!==Ee&&(xe=Ae[6]?p2b(+Ae[5]):n2b(+Ae[5]));const Se=hue(+Ae[2]),Ce=+Ae[3]/100,_e=+Ae[4]/100;return Ae[1]==="hwb"?Ee=hwb2rgb(Se,Ce,_e):Ae[1]==="hsv"?Ee=hsv2rgb(Se,Ce,_e):Ee=hsl2rgb(Se,Ce,_e),{r:Ee[0],g:Ee[1],b:Ee[2],a:xe}}function rotate(t,Ae){var xe=rgb2hsl(t);xe[0]=hue(xe[0]+Ae),xe=hsl2rgb(xe),t.r=xe[0],t.g=xe[1],t.b=xe[2]}function hslString(t){if(!t)return;const Ae=rgb2hsl(t),xe=Ae[0],Ee=n2p(Ae[1]),Se=n2p(Ae[2]);return t.a<255?`hsla(${xe}, ${Ee}%, ${Se}%, ${b2n(t.a)})`:`hsl(${xe}, ${Ee}%, ${Se}%)`}const map$3={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},names$1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function unpack(){const t={},Ae=Object.keys(names$1),xe=Object.keys(map$3);let Ee,Se,Ce,_e,Ie;for(Ee=0;Ee<Ae.length;Ee++){for(_e=Ie=Ae[Ee],Se=0;Se<xe.length;Se++)Ce=xe[Se],Ie=Ie.replace(Ce,map$3[Ce]);Ce=parseInt(names$1[_e],16),t[Ie]=[Ce>>16&255,Ce>>8&255,Ce&255]}return t}let names;function nameParse(t){names||(names=unpack(),names.transparent=[0,0,0,0]);const Ae=names[t.toLowerCase()];return Ae&&{r:Ae[0],g:Ae[1],b:Ae[2],a:Ae.length===4?Ae[3]:255}}const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(t){const Ae=RGB_RE.exec(t);let xe=255,Ee,Se,Ce;if(Ae){if(Ae[7]!==Ee){const _e=+Ae[7];xe=Ae[8]?p2b(_e):lim(_e*255,0,255)}return Ee=+Ae[1],Se=+Ae[3],Ce=+Ae[5],Ee=255&(Ae[2]?p2b(Ee):lim(Ee,0,255)),Se=255&(Ae[4]?p2b(Se):lim(Se,0,255)),Ce=255&(Ae[6]?p2b(Ce):lim(Ce,0,255)),{r:Ee,g:Se,b:Ce,a:xe}}}function rgbString(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${b2n(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const to=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,from$1=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function interpolate$1(t,Ae,xe){const Ee=from$1(b2n(t.r)),Se=from$1(b2n(t.g)),Ce=from$1(b2n(t.b));return{r:n2b(to(Ee+xe*(from$1(b2n(Ae.r))-Ee))),g:n2b(to(Se+xe*(from$1(b2n(Ae.g))-Se))),b:n2b(to(Ce+xe*(from$1(b2n(Ae.b))-Ce))),a:t.a+xe*(Ae.a-t.a)}}function modHSL(t,Ae,xe){if(t){let Ee=rgb2hsl(t);Ee[Ae]=Math.max(0,Math.min(Ee[Ae]+Ee[Ae]*xe,Ae===0?360:1)),Ee=hsl2rgb(Ee),t.r=Ee[0],t.g=Ee[1],t.b=Ee[2]}}function clone$2(t,Ae){return t&&Object.assign(Ae||{},t)}function fromObject$1(t){var Ae={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(Ae={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(Ae.a=n2b(t[3]))):(Ae=clone$2(t,{r:0,g:0,b:0,a:1}),Ae.a=n2b(Ae.a)),Ae}function functionParse(t){return t.charAt(0)==="r"?rgbParse(t):hueParse(t)}class Color{constructor(Ae){if(Ae instanceof Color)return Ae;const xe=typeof Ae;let Ee;xe==="object"?Ee=fromObject$1(Ae):xe==="string"&&(Ee=hexParse(Ae)||nameParse(Ae)||functionParse(Ae)),this._rgb=Ee,this._valid=!!Ee}get valid(){return this._valid}get rgb(){var Ae=clone$2(this._rgb);return Ae&&(Ae.a=b2n(Ae.a)),Ae}set rgb(Ae){this._rgb=fromObject$1(Ae)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(Ae,xe){if(Ae){const Ee=this.rgb,Se=Ae.rgb;let Ce;const _e=xe===Ce?.5:xe,Ie=2*_e-1,Be=Ee.a-Se.a,Te=((Ie*Be===-1?Ie:(Ie+Be)/(1+Ie*Be))+1)/2;Ce=1-Te,Ee.r=255&Te*Ee.r+Ce*Se.r+.5,Ee.g=255&Te*Ee.g+Ce*Se.g+.5,Ee.b=255&Te*Ee.b+Ce*Se.b+.5,Ee.a=_e*Ee.a+(1-_e)*Se.a,this.rgb=Ee}return this}interpolate(Ae,xe){return Ae&&(this._rgb=interpolate$1(this._rgb,Ae._rgb,xe)),this}clone(){return new Color(this.rgb)}alpha(Ae){return this._rgb.a=n2b(Ae),this}clearer(Ae){const xe=this._rgb;return xe.a*=1-Ae,this}greyscale(){const Ae=this._rgb,xe=round$1(Ae.r*.3+Ae.g*.59+Ae.b*.11);return Ae.r=Ae.g=Ae.b=xe,this}opaquer(Ae){const xe=this._rgb;return xe.a*=1+Ae,this}negate(){const Ae=this._rgb;return Ae.r=255-Ae.r,Ae.g=255-Ae.g,Ae.b=255-Ae.b,this}lighten(Ae){return modHSL(this._rgb,2,Ae),this}darken(Ae){return modHSL(this._rgb,2,-Ae),this}saturate(Ae){return modHSL(this._rgb,1,Ae),this}desaturate(Ae){return modHSL(this._rgb,1,-Ae),this}rotate(Ae){return rotate(this._rgb,Ae),this}}/*!
589
- * Chart.js v4.4.8
589
+ * Chart.js v4.4.9
590
590
  * https://www.chartjs.org
591
591
  * (c) 2025 Chart.js Contributors
592
592
  * Released under the MIT License
593
- */function noop(){}const uid=(()=>{let t=0;return()=>t++})();function isNullOrUndef(t){return t==null}function isArray$2(t){if(Array.isArray&&Array.isArray(t))return!0;const Ae=Object.prototype.toString.call(t);return Ae.slice(0,7)==="[object"&&Ae.slice(-6)==="Array]"}function isObject$1(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function isNumberFinite(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function finiteOrDefault(t,Ae){return isNumberFinite(t)?t:Ae}function valueOrDefault(t,Ae){return typeof t>"u"?Ae:t}const toPercentage=(t,Ae)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/Ae,toDimension=(t,Ae)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*Ae:+t;function callback(t,Ae,xe){if(t&&typeof t.call=="function")return t.apply(xe,Ae)}function each(t,Ae,xe,Ee){let Se,Ce,_e;if(isArray$2(t))for(Ce=t.length,Se=0;Se<Ce;Se++)Ae.call(xe,t[Se],Se);else if(isObject$1(t))for(_e=Object.keys(t),Ce=_e.length,Se=0;Se<Ce;Se++)Ae.call(xe,t[_e[Se]],_e[Se])}function _elementsEqual(t,Ae){let xe,Ee,Se,Ce;if(!t||!Ae||t.length!==Ae.length)return!1;for(xe=0,Ee=t.length;xe<Ee;++xe)if(Se=t[xe],Ce=Ae[xe],Se.datasetIndex!==Ce.datasetIndex||Se.index!==Ce.index)return!1;return!0}function clone$1(t){if(isArray$2(t))return t.map(clone$1);if(isObject$1(t)){const Ae=Object.create(null),xe=Object.keys(t),Ee=xe.length;let Se=0;for(;Se<Ee;++Se)Ae[xe[Se]]=clone$1(t[xe[Se]]);return Ae}return t}function isValidKey(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function _merger(t,Ae,xe,Ee){if(!isValidKey(t))return;const Se=Ae[t],Ce=xe[t];isObject$1(Se)&&isObject$1(Ce)?merge$1(Se,Ce,Ee):Ae[t]=clone$1(Ce)}function merge$1(t,Ae,xe){const Ee=isArray$2(Ae)?Ae:[Ae],Se=Ee.length;if(!isObject$1(t))return t;xe=xe||{};const Ce=xe.merger||_merger;let _e;for(let Ie=0;Ie<Se;++Ie){if(_e=Ee[Ie],!isObject$1(_e))continue;const Be=Object.keys(_e);for(let Te=0,Pe=Be.length;Te<Pe;++Te)Ce(Be[Te],t,_e,xe)}return t}function mergeIf(t,Ae){return merge$1(t,Ae,{merger:_mergerIf})}function _mergerIf(t,Ae,xe){if(!isValidKey(t))return;const Ee=Ae[t],Se=xe[t];isObject$1(Ee)&&isObject$1(Se)?mergeIf(Ee,Se):Object.prototype.hasOwnProperty.call(Ae,t)||(Ae[t]=clone$1(Se))}const keyResolvers={"":t=>t,x:t=>t.x,y:t=>t.y};function _splitKey(t){const Ae=t.split("."),xe=[];let Ee="";for(const Se of Ae)Ee+=Se,Ee.endsWith("\\")?Ee=Ee.slice(0,-1)+".":(xe.push(Ee),Ee="");return xe}function _getKeyResolver(t){const Ae=_splitKey(t);return xe=>{for(const Ee of Ae){if(Ee==="")break;xe=xe&&xe[Ee]}return xe}}function resolveObjectKey(t,Ae){return(keyResolvers[Ae]||(keyResolvers[Ae]=_getKeyResolver(Ae)))(t)}function _capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}const defined=t=>typeof t<"u",isFunction$2=t=>typeof t=="function",setsEqual=(t,Ae)=>{if(t.size!==Ae.size)return!1;for(const xe of t)if(!Ae.has(xe))return!1;return!0};function _isClickEvent(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY$1=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=PI*2/3,log10=Math.log10,sign=Math.sign;function almostEquals(t,Ae,xe){return Math.abs(t-Ae)<xe}function niceNum(t){const Ae=Math.round(t);t=almostEquals(t,Ae,t/1e3)?Ae:t;const xe=Math.pow(10,Math.floor(log10(t))),Ee=t/xe;return(Ee<=1?1:Ee<=2?2:Ee<=5?5:10)*xe}function _factorize(t){const Ae=[],xe=Math.sqrt(t);let Ee;for(Ee=1;Ee<xe;Ee++)t%Ee===0&&(Ae.push(Ee),Ae.push(t/Ee));return xe===(xe|0)&&Ae.push(xe),Ae.sort((Se,Ce)=>Se-Ce).pop(),Ae}function isNonPrimitive(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function isNumber$2(t){return!isNonPrimitive(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function almostWhole(t,Ae){const xe=Math.round(t);return xe-Ae<=t&&xe+Ae>=t}function _setMinAndMaxByKey(t,Ae,xe){let Ee,Se,Ce;for(Ee=0,Se=t.length;Ee<Se;Ee++)Ce=t[Ee][xe],isNaN(Ce)||(Ae.min=Math.min(Ae.min,Ce),Ae.max=Math.max(Ae.max,Ce))}function toRadians(t){return t*(PI/180)}function toDegrees(t){return t*(180/PI)}function _decimalPlaces(t){if(!isNumberFinite(t))return;let Ae=1,xe=0;for(;Math.round(t*Ae)/Ae!==t;)Ae*=10,xe++;return xe}function getAngleFromPoint(t,Ae){const xe=Ae.x-t.x,Ee=Ae.y-t.y,Se=Math.sqrt(xe*xe+Ee*Ee);let Ce=Math.atan2(Ee,xe);return Ce<-.5*PI&&(Ce+=TAU),{angle:Ce,distance:Se}}function distanceBetweenPoints(t,Ae){return Math.sqrt(Math.pow(Ae.x-t.x,2)+Math.pow(Ae.y-t.y,2))}function _angleDiff(t,Ae){return(t-Ae+PITAU)%TAU-PI}function _normalizeAngle(t){return(t%TAU+TAU)%TAU}function _angleBetween(t,Ae,xe,Ee){const Se=_normalizeAngle(t),Ce=_normalizeAngle(Ae),_e=_normalizeAngle(xe),Ie=_normalizeAngle(Ce-Se),Be=_normalizeAngle(_e-Se),Te=_normalizeAngle(Se-Ce),Pe=_normalizeAngle(Se-_e);return Se===Ce||Se===_e||Ee&&Ce===_e||Ie>Be&&Te<Pe}function _limitValue(t,Ae,xe){return Math.max(Ae,Math.min(xe,t))}function _int16Range(t){return _limitValue(t,-32768,32767)}function _isBetween(t,Ae,xe,Ee=1e-6){return t>=Math.min(Ae,xe)-Ee&&t<=Math.max(Ae,xe)+Ee}function _lookup(t,Ae,xe){xe=xe||(_e=>t[_e]<Ae);let Ee=t.length-1,Se=0,Ce;for(;Ee-Se>1;)Ce=Se+Ee>>1,xe(Ce)?Se=Ce:Ee=Ce;return{lo:Se,hi:Ee}}const _lookupByKey=(t,Ae,xe,Ee)=>_lookup(t,xe,Ee?Se=>{const Ce=t[Se][Ae];return Ce<xe||Ce===xe&&t[Se+1][Ae]===xe}:Se=>t[Se][Ae]<xe),_rlookupByKey=(t,Ae,xe)=>_lookup(t,xe,Ee=>t[Ee][Ae]>=xe);function _filterBetween(t,Ae,xe){let Ee=0,Se=t.length;for(;Ee<Se&&t[Ee]<Ae;)Ee++;for(;Se>Ee&&t[Se-1]>xe;)Se--;return Ee>0||Se<t.length?t.slice(Ee,Se):t}const arrayEvents=["push","pop","shift","splice","unshift"];function listenArrayEvents(t,Ae){if(t._chartjs){t._chartjs.listeners.push(Ae);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[Ae]}}),arrayEvents.forEach(xe=>{const Ee="_onData"+_capitalize(xe),Se=t[xe];Object.defineProperty(t,xe,{configurable:!0,enumerable:!1,value(...Ce){const _e=Se.apply(this,Ce);return t._chartjs.listeners.forEach(Ie=>{typeof Ie[Ee]=="function"&&Ie[Ee](...Ce)}),_e}})})}function unlistenArrayEvents(t,Ae){const xe=t._chartjs;if(!xe)return;const Ee=xe.listeners,Se=Ee.indexOf(Ae);Se!==-1&&Ee.splice(Se,1),!(Ee.length>0)&&(arrayEvents.forEach(Ce=>{delete t[Ce]}),delete t._chartjs)}function _arrayUnique(t){const Ae=new Set(t);return Ae.size===t.length?t:Array.from(Ae)}const requestAnimFrame=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function throttled(t,Ae){let xe=[],Ee=!1;return function(...Se){xe=Se,Ee||(Ee=!0,requestAnimFrame.call(window,()=>{Ee=!1,t.apply(Ae,xe)}))}}function debounce(t,Ae){let xe;return function(...Ee){return Ae?(clearTimeout(xe),xe=setTimeout(t,Ae,Ee)):t.apply(this,Ee),Ae}}const _toLeftRightCenter=t=>t==="start"?"left":t==="end"?"right":"center",_alignStartEnd=(t,Ae,xe)=>t==="start"?Ae:t==="end"?xe:(Ae+xe)/2;function _getStartAndCountOfVisiblePoints(t,Ae,xe){const Ee=Ae.length;let Se=0,Ce=Ee;if(t._sorted){const{iScale:_e,vScale:Ie,_parsed:Be}=t,Te=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,Pe=_e.axis,{min:ke,max:$e,minDefined:Oe,maxDefined:Ue}=_e.getUserBounds();if(Oe){if(Se=Math.min(_lookupByKey(Be,Pe,ke).lo,xe?Ee:_lookupByKey(Ae,Pe,_e.getPixelForValue(ke)).lo),Te){const qe=Be.slice(0,Se+1).reverse().findIndex(ze=>!isNullOrUndef(ze[Ie.axis]));Se-=Math.max(0,qe)}Se=_limitValue(Se,0,Ee-1)}if(Ue){let qe=Math.max(_lookupByKey(Be,_e.axis,$e,!0).hi+1,xe?0:_lookupByKey(Ae,Pe,_e.getPixelForValue($e),!0).hi+1);if(Te){const ze=Be.slice(qe-1).findIndex(Ve=>!isNullOrUndef(Ve[Ie.axis]));qe+=Math.max(0,ze)}Ce=_limitValue(qe,Se,Ee)-Se}else Ce=Ee-Se}return{start:Se,count:Ce}}function _scaleRangesChanged(t){const{xScale:Ae,yScale:xe,_scaleRanges:Ee}=t,Se={xmin:Ae.min,xmax:Ae.max,ymin:xe.min,ymax:xe.max};if(!Ee)return t._scaleRanges=Se,!0;const Ce=Ee.xmin!==Ae.min||Ee.xmax!==Ae.max||Ee.ymin!==xe.min||Ee.ymax!==xe.max;return Object.assign(Ee,Se),Ce}const atEdge=t=>t===0||t===1,elasticIn=(t,Ae,xe)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-Ae)*TAU/xe)),elasticOut=(t,Ae,xe)=>Math.pow(2,-10*t)*Math.sin((t-Ae)*TAU/xe)+1,effects={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*HALF_PI)+1,easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic(t){return atEdge(t)?t:t<.5?.5*elasticIn(t*2,.1125,.45):.5+.5*elasticOut(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let Ae=1.70158;return(t/=.5)<1?.5*(t*t*(((Ae*=1.525)+1)*t-Ae)):.5*((t-=2)*t*(((Ae*=1.525)+1)*t+Ae)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?effects.easeInBounce(t*2)*.5:effects.easeOutBounce(t*2-1)*.5+.5};function isPatternOrGradient(t){if(t&&typeof t=="object"){const Ae=t.toString();return Ae==="[object CanvasPattern]"||Ae==="[object CanvasGradient]"}return!1}function color$3(t){return isPatternOrGradient(t)?t:new Color(t)}function getHoverColor(t){return isPatternOrGradient(t)?t:new Color(t).saturate(.5).darken(.1).hexString()}const numbers=["x","y","borderWidth","radius","tension"],colors=["color","borderColor","backgroundColor"];function applyAnimationsDefaults(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:Ae=>Ae!=="onProgress"&&Ae!=="onComplete"&&Ae!=="fn"}),t.set("animations",{colors:{type:"color",properties:colors},numbers:{type:"number",properties:numbers}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:Ae=>Ae|0}}}})}function applyLayoutsDefaults(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const intlCache=new Map;function getNumberFormat(t,Ae){Ae=Ae||{};const xe=t+JSON.stringify(Ae);let Ee=intlCache.get(xe);return Ee||(Ee=new Intl.NumberFormat(t,Ae),intlCache.set(xe,Ee)),Ee}function formatNumber(t,Ae,xe){return getNumberFormat(Ae,xe).format(t)}const formatters={values(t){return isArray$2(t)?t:""+t},numeric(t,Ae,xe){if(t===0)return"0";const Ee=this.chart.options.locale;let Se,Ce=t;if(xe.length>1){const Te=Math.max(Math.abs(xe[0].value),Math.abs(xe[xe.length-1].value));(Te<1e-4||Te>1e15)&&(Se="scientific"),Ce=calculateDelta(t,xe)}const _e=log10(Math.abs(Ce)),Ie=isNaN(_e)?1:Math.max(Math.min(-1*Math.floor(_e),20),0),Be={notation:Se,minimumFractionDigits:Ie,maximumFractionDigits:Ie};return Object.assign(Be,this.options.ticks.format),formatNumber(t,Ee,Be)}};function calculateDelta(t,Ae){let xe=Ae.length>3?Ae[2].value-Ae[1].value:Ae[1].value-Ae[0].value;return Math.abs(xe)>=1&&t!==Math.floor(t)&&(xe=t-Math.floor(t)),xe}var Ticks={formatters};function applyScaleDefaults(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(Ae,xe)=>xe.lineWidth,tickColor:(Ae,xe)=>xe.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:Ae=>!Ae.startsWith("before")&&!Ae.startsWith("after")&&Ae!=="callback"&&Ae!=="parser",_indexable:Ae=>Ae!=="borderDash"&&Ae!=="tickBorderDash"&&Ae!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:Ae=>Ae!=="backdropPadding"&&Ae!=="callback",_indexable:Ae=>Ae!=="backdropPadding"})}const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(t,Ae){if(!Ae)return t;const xe=Ae.split(".");for(let Ee=0,Se=xe.length;Ee<Se;++Ee){const Ce=xe[Ee];t=t[Ce]||(t[Ce]=Object.create(null))}return t}function set$1(t,Ae,xe){return typeof Ae=="string"?merge$1(getScope$1(t,Ae),xe):merge$1(getScope$1(t,""),Ae)}class Defaults{constructor(Ae,xe){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=Ee=>Ee.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(Ee,Se)=>getHoverColor(Se.backgroundColor),this.hoverBorderColor=(Ee,Se)=>getHoverColor(Se.borderColor),this.hoverColor=(Ee,Se)=>getHoverColor(Se.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(Ae),this.apply(xe)}set(Ae,xe){return set$1(this,Ae,xe)}get(Ae){return getScope$1(this,Ae)}describe(Ae,xe){return set$1(descriptors,Ae,xe)}override(Ae,xe){return set$1(overrides,Ae,xe)}route(Ae,xe,Ee,Se){const Ce=getScope$1(this,Ae),_e=getScope$1(this,Ee),Ie="_"+xe;Object.defineProperties(Ce,{[Ie]:{value:Ce[xe],writable:!0},[xe]:{enumerable:!0,get(){const Be=this[Ie],Te=_e[Se];return isObject$1(Be)?Object.assign({},Te,Be):valueOrDefault(Be,Te)},set(Be){this[Ie]=Be}}})}apply(Ae){Ae.forEach(xe=>xe(this))}}var defaults$1=new Defaults({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[applyAnimationsDefaults,applyLayoutsDefaults,applyScaleDefaults]);function toFontString(t){return!t||isNullOrUndef(t.size)||isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function _measureText(t,Ae,xe,Ee,Se){let Ce=Ae[Se];return Ce||(Ce=Ae[Se]=t.measureText(Se).width,xe.push(Se)),Ce>Ee&&(Ee=Ce),Ee}function _alignPixel(t,Ae,xe){const Ee=t.currentDevicePixelRatio,Se=xe!==0?Math.max(xe/2,.5):0;return Math.round((Ae-Se)*Ee)/Ee+Se}function clearCanvas(t,Ae){!Ae&&!t||(Ae=Ae||t.getContext("2d"),Ae.save(),Ae.resetTransform(),Ae.clearRect(0,0,t.width,t.height),Ae.restore())}function drawPoint(t,Ae,xe,Ee){drawPointLegend(t,Ae,xe,Ee)}function drawPointLegend(t,Ae,xe,Ee,Se){let Ce,_e,Ie,Be,Te,Pe,ke,$e;const Oe=Ae.pointStyle,Ue=Ae.rotation,qe=Ae.radius;let ze=(Ue||0)*RAD_PER_DEG;if(Oe&&typeof Oe=="object"&&(Ce=Oe.toString(),Ce==="[object HTMLImageElement]"||Ce==="[object HTMLCanvasElement]")){t.save(),t.translate(xe,Ee),t.rotate(ze),t.drawImage(Oe,-Oe.width/2,-Oe.height/2,Oe.width,Oe.height),t.restore();return}if(!(isNaN(qe)||qe<=0)){switch(t.beginPath(),Oe){default:t.arc(xe,Ee,qe,0,TAU),t.closePath();break;case"triangle":Pe=qe,t.moveTo(xe+Math.sin(ze)*Pe,Ee-Math.cos(ze)*qe),ze+=TWO_THIRDS_PI,t.lineTo(xe+Math.sin(ze)*Pe,Ee-Math.cos(ze)*qe),ze+=TWO_THIRDS_PI,t.lineTo(xe+Math.sin(ze)*Pe,Ee-Math.cos(ze)*qe),t.closePath();break;case"rectRounded":Te=qe*.516,Be=qe-Te,_e=Math.cos(ze+QUARTER_PI)*Be,ke=Math.cos(ze+QUARTER_PI)*Be,Ie=Math.sin(ze+QUARTER_PI)*Be,$e=Math.sin(ze+QUARTER_PI)*Be,t.arc(xe-ke,Ee-Ie,Te,ze-PI,ze-HALF_PI),t.arc(xe+$e,Ee-_e,Te,ze-HALF_PI,ze),t.arc(xe+ke,Ee+Ie,Te,ze,ze+HALF_PI),t.arc(xe-$e,Ee+_e,Te,ze+HALF_PI,ze+PI),t.closePath();break;case"rect":if(!Ue){Be=Math.SQRT1_2*qe,Pe=Be,t.rect(xe-Pe,Ee-Be,2*Pe,2*Be);break}ze+=QUARTER_PI;case"rectRot":ke=Math.cos(ze)*qe,_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,$e=Math.sin(ze)*qe,t.moveTo(xe-ke,Ee-Ie),t.lineTo(xe+$e,Ee-_e),t.lineTo(xe+ke,Ee+Ie),t.lineTo(xe-$e,Ee+_e),t.closePath();break;case"crossRot":ze+=QUARTER_PI;case"cross":ke=Math.cos(ze)*qe,_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,$e=Math.sin(ze)*qe,t.moveTo(xe-ke,Ee-Ie),t.lineTo(xe+ke,Ee+Ie),t.moveTo(xe+$e,Ee-_e),t.lineTo(xe-$e,Ee+_e);break;case"star":ke=Math.cos(ze)*qe,_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,$e=Math.sin(ze)*qe,t.moveTo(xe-ke,Ee-Ie),t.lineTo(xe+ke,Ee+Ie),t.moveTo(xe+$e,Ee-_e),t.lineTo(xe-$e,Ee+_e),ze+=QUARTER_PI,ke=Math.cos(ze)*qe,_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,$e=Math.sin(ze)*qe,t.moveTo(xe-ke,Ee-Ie),t.lineTo(xe+ke,Ee+Ie),t.moveTo(xe+$e,Ee-_e),t.lineTo(xe-$e,Ee+_e);break;case"line":_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,t.moveTo(xe-_e,Ee-Ie),t.lineTo(xe+_e,Ee+Ie);break;case"dash":t.moveTo(xe,Ee),t.lineTo(xe+Math.cos(ze)*qe,Ee+Math.sin(ze)*qe);break;case!1:t.closePath();break}t.fill(),Ae.borderWidth>0&&t.stroke()}}function _isPointInArea(t,Ae,xe){return xe=xe||.5,!Ae||t&&t.x>Ae.left-xe&&t.x<Ae.right+xe&&t.y>Ae.top-xe&&t.y<Ae.bottom+xe}function clipArea(t,Ae){t.save(),t.beginPath(),t.rect(Ae.left,Ae.top,Ae.right-Ae.left,Ae.bottom-Ae.top),t.clip()}function unclipArea(t){t.restore()}function _steppedLineTo(t,Ae,xe,Ee,Se){if(!Ae)return t.lineTo(xe.x,xe.y);if(Se==="middle"){const Ce=(Ae.x+xe.x)/2;t.lineTo(Ce,Ae.y),t.lineTo(Ce,xe.y)}else Se==="after"!=!!Ee?t.lineTo(Ae.x,xe.y):t.lineTo(xe.x,Ae.y);t.lineTo(xe.x,xe.y)}function _bezierCurveTo(t,Ae,xe,Ee){if(!Ae)return t.lineTo(xe.x,xe.y);t.bezierCurveTo(Ee?Ae.cp1x:Ae.cp2x,Ee?Ae.cp1y:Ae.cp2y,Ee?xe.cp2x:xe.cp1x,Ee?xe.cp2y:xe.cp1y,xe.x,xe.y)}function setRenderOpts(t,Ae){Ae.translation&&t.translate(Ae.translation[0],Ae.translation[1]),isNullOrUndef(Ae.rotation)||t.rotate(Ae.rotation),Ae.color&&(t.fillStyle=Ae.color),Ae.textAlign&&(t.textAlign=Ae.textAlign),Ae.textBaseline&&(t.textBaseline=Ae.textBaseline)}function decorateText(t,Ae,xe,Ee,Se){if(Se.strikethrough||Se.underline){const Ce=t.measureText(Ee),_e=Ae-Ce.actualBoundingBoxLeft,Ie=Ae+Ce.actualBoundingBoxRight,Be=xe-Ce.actualBoundingBoxAscent,Te=xe+Ce.actualBoundingBoxDescent,Pe=Se.strikethrough?(Be+Te)/2:Te;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=Se.decorationWidth||2,t.moveTo(_e,Pe),t.lineTo(Ie,Pe),t.stroke()}}function drawBackdrop(t,Ae){const xe=t.fillStyle;t.fillStyle=Ae.color,t.fillRect(Ae.left,Ae.top,Ae.width,Ae.height),t.fillStyle=xe}function renderText(t,Ae,xe,Ee,Se,Ce={}){const _e=isArray$2(Ae)?Ae:[Ae],Ie=Ce.strokeWidth>0&&Ce.strokeColor!=="";let Be,Te;for(t.save(),t.font=Se.string,setRenderOpts(t,Ce),Be=0;Be<_e.length;++Be)Te=_e[Be],Ce.backdrop&&drawBackdrop(t,Ce.backdrop),Ie&&(Ce.strokeColor&&(t.strokeStyle=Ce.strokeColor),isNullOrUndef(Ce.strokeWidth)||(t.lineWidth=Ce.strokeWidth),t.strokeText(Te,xe,Ee,Ce.maxWidth)),t.fillText(Te,xe,Ee,Ce.maxWidth),decorateText(t,xe,Ee,Te,Ce),Ee+=Number(Se.lineHeight);t.restore()}function addRoundedRectPath(t,Ae){const{x:xe,y:Ee,w:Se,h:Ce,radius:_e}=Ae;t.arc(xe+_e.topLeft,Ee+_e.topLeft,_e.topLeft,1.5*PI,PI,!0),t.lineTo(xe,Ee+Ce-_e.bottomLeft),t.arc(xe+_e.bottomLeft,Ee+Ce-_e.bottomLeft,_e.bottomLeft,PI,HALF_PI,!0),t.lineTo(xe+Se-_e.bottomRight,Ee+Ce),t.arc(xe+Se-_e.bottomRight,Ee+Ce-_e.bottomRight,_e.bottomRight,HALF_PI,0,!0),t.lineTo(xe+Se,Ee+_e.topRight),t.arc(xe+Se-_e.topRight,Ee+_e.topRight,_e.topRight,0,-HALF_PI,!0),t.lineTo(xe+_e.topLeft,Ee)}const LINE_HEIGHT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,FONT_STYLE=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function toLineHeight(t,Ae){const xe=(""+t).match(LINE_HEIGHT);if(!xe||xe[1]==="normal")return Ae*1.2;switch(t=+xe[2],xe[3]){case"px":return t;case"%":t/=100;break}return Ae*t}const numberOrZero=t=>+t||0;function _readValueToProps(t,Ae){const xe={},Ee=isObject$1(Ae),Se=Ee?Object.keys(Ae):Ae,Ce=isObject$1(t)?Ee?_e=>valueOrDefault(t[_e],t[Ae[_e]]):_e=>t[_e]:()=>t;for(const _e of Se)xe[_e]=numberOrZero(Ce(_e));return xe}function toTRBL(t){return _readValueToProps(t,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(t){return _readValueToProps(t,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(t){const Ae=toTRBL(t);return Ae.width=Ae.left+Ae.right,Ae.height=Ae.top+Ae.bottom,Ae}function toFont(t,Ae){t=t||{},Ae=Ae||defaults$1.font;let xe=valueOrDefault(t.size,Ae.size);typeof xe=="string"&&(xe=parseInt(xe,10));let Ee=valueOrDefault(t.style,Ae.style);Ee&&!(""+Ee).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+Ee+'"'),Ee=void 0);const Se={family:valueOrDefault(t.family,Ae.family),lineHeight:toLineHeight(valueOrDefault(t.lineHeight,Ae.lineHeight),xe),size:xe,style:Ee,weight:valueOrDefault(t.weight,Ae.weight),string:""};return Se.string=toFontString(Se),Se}function resolve(t,Ae,xe,Ee){let Se,Ce,_e;for(Se=0,Ce=t.length;Se<Ce;++Se)if(_e=t[Se],_e!==void 0&&_e!==void 0)return _e}function _addGrace(t,Ae,xe){const{min:Ee,max:Se}=t,Ce=toDimension(Ae,(Se-Ee)/2),_e=(Ie,Be)=>xe&&Ie===0?0:Ie+Be;return{min:_e(Ee,-Math.abs(Ce)),max:_e(Se,Ce)}}function createContext(t,Ae){return Object.assign(Object.create(t),Ae)}function _createResolver(t,Ae=[""],xe,Ee,Se=()=>t[0]){const Ce=xe||t;typeof Ee>"u"&&(Ee=_resolve("_fallback",t));const _e={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:Ce,_fallback:Ee,_getTarget:Se,override:Ie=>_createResolver([Ie,...t],Ae,Ce,Ee)};return new Proxy(_e,{deleteProperty(Ie,Be){return delete Ie[Be],delete Ie._keys,delete t[0][Be],!0},get(Ie,Be){return _cached(Ie,Be,()=>_resolveWithPrefixes(Be,Ae,t,Ie))},getOwnPropertyDescriptor(Ie,Be){return Reflect.getOwnPropertyDescriptor(Ie._scopes[0],Be)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(Ie,Be){return getKeysFromAllScopes(Ie).includes(Be)},ownKeys(Ie){return getKeysFromAllScopes(Ie)},set(Ie,Be,Te){const Pe=Ie._storage||(Ie._storage=Se());return Ie[Be]=Pe[Be]=Te,delete Ie._keys,!0}})}function _attachContext(t,Ae,xe,Ee){const Se={_cacheable:!1,_proxy:t,_context:Ae,_subProxy:xe,_stack:new Set,_descriptors:_descriptors(t,Ee),setContext:Ce=>_attachContext(t,Ce,xe,Ee),override:Ce=>_attachContext(t.override(Ce),Ae,xe,Ee)};return new Proxy(Se,{deleteProperty(Ce,_e){return delete Ce[_e],delete t[_e],!0},get(Ce,_e,Ie){return _cached(Ce,_e,()=>_resolveWithContext(Ce,_e,Ie))},getOwnPropertyDescriptor(Ce,_e){return Ce._descriptors.allKeys?Reflect.has(t,_e)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,_e)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(Ce,_e){return Reflect.has(t,_e)},ownKeys(){return Reflect.ownKeys(t)},set(Ce,_e,Ie){return t[_e]=Ie,delete Ce[_e],!0}})}function _descriptors(t,Ae={scriptable:!0,indexable:!0}){const{_scriptable:xe=Ae.scriptable,_indexable:Ee=Ae.indexable,_allKeys:Se=Ae.allKeys}=t;return{allKeys:Se,scriptable:xe,indexable:Ee,isScriptable:isFunction$2(xe)?xe:()=>xe,isIndexable:isFunction$2(Ee)?Ee:()=>Ee}}const readKey=(t,Ae)=>t?t+_capitalize(Ae):Ae,needsSubResolver=(t,Ae)=>isObject$1(Ae)&&t!=="adapters"&&(Object.getPrototypeOf(Ae)===null||Ae.constructor===Object);function _cached(t,Ae,xe){if(Object.prototype.hasOwnProperty.call(t,Ae)||Ae==="constructor")return t[Ae];const Ee=xe();return t[Ae]=Ee,Ee}function _resolveWithContext(t,Ae,xe){const{_proxy:Ee,_context:Se,_subProxy:Ce,_descriptors:_e}=t;let Ie=Ee[Ae];return isFunction$2(Ie)&&_e.isScriptable(Ae)&&(Ie=_resolveScriptable(Ae,Ie,t,xe)),isArray$2(Ie)&&Ie.length&&(Ie=_resolveArray(Ae,Ie,t,_e.isIndexable)),needsSubResolver(Ae,Ie)&&(Ie=_attachContext(Ie,Se,Ce&&Ce[Ae],_e)),Ie}function _resolveScriptable(t,Ae,xe,Ee){const{_proxy:Se,_context:Ce,_subProxy:_e,_stack:Ie}=xe;if(Ie.has(t))throw new Error("Recursion detected: "+Array.from(Ie).join("->")+"->"+t);Ie.add(t);let Be=Ae(Ce,_e||Ee);return Ie.delete(t),needsSubResolver(t,Be)&&(Be=createSubResolver(Se._scopes,Se,t,Be)),Be}function _resolveArray(t,Ae,xe,Ee){const{_proxy:Se,_context:Ce,_subProxy:_e,_descriptors:Ie}=xe;if(typeof Ce.index<"u"&&Ee(t))return Ae[Ce.index%Ae.length];if(isObject$1(Ae[0])){const Be=Ae,Te=Se._scopes.filter(Pe=>Pe!==Be);Ae=[];for(const Pe of Be){const ke=createSubResolver(Te,Se,t,Pe);Ae.push(_attachContext(ke,Ce,_e&&_e[t],Ie))}}return Ae}function resolveFallback(t,Ae,xe){return isFunction$2(t)?t(Ae,xe):t}const getScope=(t,Ae)=>t===!0?Ae:typeof t=="string"?resolveObjectKey(Ae,t):void 0;function addScopes(t,Ae,xe,Ee,Se){for(const Ce of Ae){const _e=getScope(xe,Ce);if(_e){t.add(_e);const Ie=resolveFallback(_e._fallback,xe,Se);if(typeof Ie<"u"&&Ie!==xe&&Ie!==Ee)return Ie}else if(_e===!1&&typeof Ee<"u"&&xe!==Ee)return null}return!1}function createSubResolver(t,Ae,xe,Ee){const Se=Ae._rootScopes,Ce=resolveFallback(Ae._fallback,xe,Ee),_e=[...t,...Se],Ie=new Set;Ie.add(Ee);let Be=addScopesFromKey(Ie,_e,xe,Ce||xe,Ee);return Be===null||typeof Ce<"u"&&Ce!==xe&&(Be=addScopesFromKey(Ie,_e,Ce,Be,Ee),Be===null)?!1:_createResolver(Array.from(Ie),[""],Se,Ce,()=>subGetTarget(Ae,xe,Ee))}function addScopesFromKey(t,Ae,xe,Ee,Se){for(;xe;)xe=addScopes(t,Ae,xe,Ee,Se);return xe}function subGetTarget(t,Ae,xe){const Ee=t._getTarget();Ae in Ee||(Ee[Ae]={});const Se=Ee[Ae];return isArray$2(Se)&&isObject$1(xe)?xe:Se||{}}function _resolveWithPrefixes(t,Ae,xe,Ee){let Se;for(const Ce of Ae)if(Se=_resolve(readKey(Ce,t),xe),typeof Se<"u")return needsSubResolver(t,Se)?createSubResolver(xe,Ee,t,Se):Se}function _resolve(t,Ae){for(const xe of Ae){if(!xe)continue;const Ee=xe[t];if(typeof Ee<"u")return Ee}}function getKeysFromAllScopes(t){let Ae=t._keys;return Ae||(Ae=t._keys=resolveKeysFromAllScopes(t._scopes)),Ae}function resolveKeysFromAllScopes(t){const Ae=new Set;for(const xe of t)for(const Ee of Object.keys(xe).filter(Se=>!Se.startsWith("_")))Ae.add(Ee);return Array.from(Ae)}function _parseObjectDataRadialScale(t,Ae,xe,Ee){const{iScale:Se}=t,{key:Ce="r"}=this._parsing,_e=new Array(Ee);let Ie,Be,Te,Pe;for(Ie=0,Be=Ee;Ie<Be;++Ie)Te=Ie+xe,Pe=Ae[Te],_e[Ie]={r:Se.parse(resolveObjectKey(Pe,Ce),Te)};return _e}const EPSILON$1=Number.EPSILON||1e-14,getPoint$2=(t,Ae)=>Ae<t.length&&!t[Ae].skip&&t[Ae],getValueAxis=t=>t==="x"?"y":"x";function splineCurve(t,Ae,xe,Ee){const Se=t.skip?Ae:t,Ce=Ae,_e=xe.skip?Ae:xe,Ie=distanceBetweenPoints(Ce,Se),Be=distanceBetweenPoints(_e,Ce);let Te=Ie/(Ie+Be),Pe=Be/(Ie+Be);Te=isNaN(Te)?0:Te,Pe=isNaN(Pe)?0:Pe;const ke=Ee*Te,$e=Ee*Pe;return{previous:{x:Ce.x-ke*(_e.x-Se.x),y:Ce.y-ke*(_e.y-Se.y)},next:{x:Ce.x+$e*(_e.x-Se.x),y:Ce.y+$e*(_e.y-Se.y)}}}function monotoneAdjust(t,Ae,xe){const Ee=t.length;let Se,Ce,_e,Ie,Be,Te=getPoint$2(t,0);for(let Pe=0;Pe<Ee-1;++Pe)if(Be=Te,Te=getPoint$2(t,Pe+1),!(!Be||!Te)){if(almostEquals(Ae[Pe],0,EPSILON$1)){xe[Pe]=xe[Pe+1]=0;continue}Se=xe[Pe]/Ae[Pe],Ce=xe[Pe+1]/Ae[Pe],Ie=Math.pow(Se,2)+Math.pow(Ce,2),!(Ie<=9)&&(_e=3/Math.sqrt(Ie),xe[Pe]=Se*_e*Ae[Pe],xe[Pe+1]=Ce*_e*Ae[Pe])}}function monotoneCompute(t,Ae,xe="x"){const Ee=getValueAxis(xe),Se=t.length;let Ce,_e,Ie,Be=getPoint$2(t,0);for(let Te=0;Te<Se;++Te){if(_e=Ie,Ie=Be,Be=getPoint$2(t,Te+1),!Ie)continue;const Pe=Ie[xe],ke=Ie[Ee];_e&&(Ce=(Pe-_e[xe])/3,Ie[`cp1${xe}`]=Pe-Ce,Ie[`cp1${Ee}`]=ke-Ce*Ae[Te]),Be&&(Ce=(Be[xe]-Pe)/3,Ie[`cp2${xe}`]=Pe+Ce,Ie[`cp2${Ee}`]=ke+Ce*Ae[Te])}}function splineCurveMonotone(t,Ae="x"){const xe=getValueAxis(Ae),Ee=t.length,Se=Array(Ee).fill(0),Ce=Array(Ee);let _e,Ie,Be,Te=getPoint$2(t,0);for(_e=0;_e<Ee;++_e)if(Ie=Be,Be=Te,Te=getPoint$2(t,_e+1),!!Be){if(Te){const Pe=Te[Ae]-Be[Ae];Se[_e]=Pe!==0?(Te[xe]-Be[xe])/Pe:0}Ce[_e]=Ie?Te?sign(Se[_e-1])!==sign(Se[_e])?0:(Se[_e-1]+Se[_e])/2:Se[_e-1]:Se[_e]}monotoneAdjust(t,Se,Ce),monotoneCompute(t,Ce,Ae)}function capControlPoint(t,Ae,xe){return Math.max(Math.min(t,xe),Ae)}function capBezierPoints(t,Ae){let xe,Ee,Se,Ce,_e,Ie=_isPointInArea(t[0],Ae);for(xe=0,Ee=t.length;xe<Ee;++xe)_e=Ce,Ce=Ie,Ie=xe<Ee-1&&_isPointInArea(t[xe+1],Ae),Ce&&(Se=t[xe],_e&&(Se.cp1x=capControlPoint(Se.cp1x,Ae.left,Ae.right),Se.cp1y=capControlPoint(Se.cp1y,Ae.top,Ae.bottom)),Ie&&(Se.cp2x=capControlPoint(Se.cp2x,Ae.left,Ae.right),Se.cp2y=capControlPoint(Se.cp2y,Ae.top,Ae.bottom)))}function _updateBezierControlPoints(t,Ae,xe,Ee,Se){let Ce,_e,Ie,Be;if(Ae.spanGaps&&(t=t.filter(Te=>!Te.skip)),Ae.cubicInterpolationMode==="monotone")splineCurveMonotone(t,Se);else{let Te=Ee?t[t.length-1]:t[0];for(Ce=0,_e=t.length;Ce<_e;++Ce)Ie=t[Ce],Be=splineCurve(Te,Ie,t[Math.min(Ce+1,_e-(Ee?0:1))%_e],Ae.tension),Ie.cp1x=Be.previous.x,Ie.cp1y=Be.previous.y,Ie.cp2x=Be.next.x,Ie.cp2y=Be.next.y,Te=Ie}Ae.capBezierPoints&&capBezierPoints(t,xe)}function _isDomSupported(){return typeof window<"u"&&typeof document<"u"}function _getParentNode(t){let Ae=t.parentNode;return Ae&&Ae.toString()==="[object ShadowRoot]"&&(Ae=Ae.host),Ae}function parseMaxStyle(t,Ae,xe){let Ee;return typeof t=="string"?(Ee=parseInt(t,10),t.indexOf("%")!==-1&&(Ee=Ee/100*Ae.parentNode[xe])):Ee=t,Ee}const getComputedStyle$1=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function getStyle(t,Ae){return getComputedStyle$1(t).getPropertyValue(Ae)}const positions=["top","right","bottom","left"];function getPositionedStyle(t,Ae,xe){const Ee={};xe=xe?"-"+xe:"";for(let Se=0;Se<4;Se++){const Ce=positions[Se];Ee[Ce]=parseFloat(t[Ae+"-"+Ce+xe])||0}return Ee.width=Ee.left+Ee.right,Ee.height=Ee.top+Ee.bottom,Ee}const useOffsetPos=(t,Ae,xe)=>(t>0||Ae>0)&&(!xe||!xe.shadowRoot);function getCanvasPosition(t,Ae){const xe=t.touches,Ee=xe&&xe.length?xe[0]:t,{offsetX:Se,offsetY:Ce}=Ee;let _e=!1,Ie,Be;if(useOffsetPos(Se,Ce,t.target))Ie=Se,Be=Ce;else{const Te=Ae.getBoundingClientRect();Ie=Ee.clientX-Te.left,Be=Ee.clientY-Te.top,_e=!0}return{x:Ie,y:Be,box:_e}}function getRelativePosition(t,Ae){if("native"in t)return t;const{canvas:xe,currentDevicePixelRatio:Ee}=Ae,Se=getComputedStyle$1(xe),Ce=Se.boxSizing==="border-box",_e=getPositionedStyle(Se,"padding"),Ie=getPositionedStyle(Se,"border","width"),{x:Be,y:Te,box:Pe}=getCanvasPosition(t,xe),ke=_e.left+(Pe&&Ie.left),$e=_e.top+(Pe&&Ie.top);let{width:Oe,height:Ue}=Ae;return Ce&&(Oe-=_e.width+Ie.width,Ue-=_e.height+Ie.height),{x:Math.round((Be-ke)/Oe*xe.width/Ee),y:Math.round((Te-$e)/Ue*xe.height/Ee)}}function getContainerSize(t,Ae,xe){let Ee,Se;if(Ae===void 0||xe===void 0){const Ce=t&&_getParentNode(t);if(!Ce)Ae=t.clientWidth,xe=t.clientHeight;else{const _e=Ce.getBoundingClientRect(),Ie=getComputedStyle$1(Ce),Be=getPositionedStyle(Ie,"border","width"),Te=getPositionedStyle(Ie,"padding");Ae=_e.width-Te.width-Be.width,xe=_e.height-Te.height-Be.height,Ee=parseMaxStyle(Ie.maxWidth,Ce,"clientWidth"),Se=parseMaxStyle(Ie.maxHeight,Ce,"clientHeight")}}return{width:Ae,height:xe,maxWidth:Ee||INFINITY$1,maxHeight:Se||INFINITY$1}}const round1=t=>Math.round(t*10)/10;function getMaximumSize(t,Ae,xe,Ee){const Se=getComputedStyle$1(t),Ce=getPositionedStyle(Se,"margin"),_e=parseMaxStyle(Se.maxWidth,t,"clientWidth")||INFINITY$1,Ie=parseMaxStyle(Se.maxHeight,t,"clientHeight")||INFINITY$1,Be=getContainerSize(t,Ae,xe);let{width:Te,height:Pe}=Be;if(Se.boxSizing==="content-box"){const $e=getPositionedStyle(Se,"border","width"),Oe=getPositionedStyle(Se,"padding");Te-=Oe.width+$e.width,Pe-=Oe.height+$e.height}return Te=Math.max(0,Te-Ce.width),Pe=Math.max(0,Ee?Te/Ee:Pe-Ce.height),Te=round1(Math.min(Te,_e,Be.maxWidth)),Pe=round1(Math.min(Pe,Ie,Be.maxHeight)),Te&&!Pe&&(Pe=round1(Te/2)),(Ae!==void 0||xe!==void 0)&&Ee&&Be.height&&Pe>Be.height&&(Pe=Be.height,Te=round1(Math.floor(Pe*Ee))),{width:Te,height:Pe}}function retinaScale(t,Ae,xe){const Ee=Ae||1,Se=Math.floor(t.height*Ee),Ce=Math.floor(t.width*Ee);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const _e=t.canvas;return _e.style&&(xe||!_e.style.height&&!_e.style.width)&&(_e.style.height=`${t.height}px`,_e.style.width=`${t.width}px`),t.currentDevicePixelRatio!==Ee||_e.height!==Se||_e.width!==Ce?(t.currentDevicePixelRatio=Ee,_e.height=Se,_e.width=Ce,t.ctx.setTransform(Ee,0,0,Ee,0,0),!0):!1}const supportsEventListenerOptions=function(){let t=!1;try{const Ae={get passive(){return t=!0,!1}};_isDomSupported()&&(window.addEventListener("test",null,Ae),window.removeEventListener("test",null,Ae))}catch{}return t}();function readUsedSize(t,Ae){const xe=getStyle(t,Ae),Ee=xe&&xe.match(/^(\d+)(\.\d+)?px$/);return Ee?+Ee[1]:void 0}function _pointInLine(t,Ae,xe,Ee){return{x:t.x+xe*(Ae.x-t.x),y:t.y+xe*(Ae.y-t.y)}}function _steppedInterpolation(t,Ae,xe,Ee){return{x:t.x+xe*(Ae.x-t.x),y:Ee==="middle"?xe<.5?t.y:Ae.y:Ee==="after"?xe<1?t.y:Ae.y:xe>0?Ae.y:t.y}}function _bezierInterpolation(t,Ae,xe,Ee){const Se={x:t.cp2x,y:t.cp2y},Ce={x:Ae.cp1x,y:Ae.cp1y},_e=_pointInLine(t,Se,xe),Ie=_pointInLine(Se,Ce,xe),Be=_pointInLine(Ce,Ae,xe),Te=_pointInLine(_e,Ie,xe),Pe=_pointInLine(Ie,Be,xe);return _pointInLine(Te,Pe,xe)}const getRightToLeftAdapter=function(t,Ae){return{x(xe){return t+t+Ae-xe},setWidth(xe){Ae=xe},textAlign(xe){return xe==="center"?xe:xe==="right"?"left":"right"},xPlus(xe,Ee){return xe-Ee},leftForLtr(xe,Ee){return xe-Ee}}},getLeftToRightAdapter=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,Ae){return t+Ae},leftForLtr(t,Ae){return t}}};function getRtlAdapter(t,Ae,xe){return t?getRightToLeftAdapter(Ae,xe):getLeftToRightAdapter()}function overrideTextDirection(t,Ae){let xe,Ee;(Ae==="ltr"||Ae==="rtl")&&(xe=t.canvas.style,Ee=[xe.getPropertyValue("direction"),xe.getPropertyPriority("direction")],xe.setProperty("direction",Ae,"important"),t.prevTextDirection=Ee)}function restoreTextDirection(t,Ae){Ae!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",Ae[0],Ae[1]))}function propertyFn(t){return t==="angle"?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(Ae,xe)=>Ae-xe,normalize:Ae=>Ae}}function normalizeSegment({start:t,end:Ae,count:xe,loop:Ee,style:Se}){return{start:t%xe,end:Ae%xe,loop:Ee&&(Ae-t+1)%xe===0,style:Se}}function getSegment(t,Ae,xe){const{property:Ee,start:Se,end:Ce}=xe,{between:_e,normalize:Ie}=propertyFn(Ee),Be=Ae.length;let{start:Te,end:Pe,loop:ke}=t,$e,Oe;if(ke){for(Te+=Be,Pe+=Be,$e=0,Oe=Be;$e<Oe&&_e(Ie(Ae[Te%Be][Ee]),Se,Ce);++$e)Te--,Pe--;Te%=Be,Pe%=Be}return Pe<Te&&(Pe+=Be),{start:Te,end:Pe,loop:ke,style:t.style}}function _boundSegment(t,Ae,xe){if(!xe)return[t];const{property:Ee,start:Se,end:Ce}=xe,_e=Ae.length,{compare:Ie,between:Be,normalize:Te}=propertyFn(Ee),{start:Pe,end:ke,loop:$e,style:Oe}=getSegment(t,Ae,xe),Ue=[];let qe=!1,ze=null,Ve,Ge,Xe;const er=()=>Be(Se,Xe,Ve)&&Ie(Se,Xe)!==0,tr=()=>Ie(Ce,Ve)===0||Be(Ce,Xe,Ve),nr=()=>qe||er(),sr=()=>!qe||tr();for(let dr=Pe,ar=Pe;dr<=ke;++dr)Ge=Ae[dr%_e],!Ge.skip&&(Ve=Te(Ge[Ee]),Ve!==Xe&&(qe=Be(Ve,Se,Ce),ze===null&&nr()&&(ze=Ie(Ve,Se)===0?dr:ar),ze!==null&&sr()&&(Ue.push(normalizeSegment({start:ze,end:dr,loop:$e,count:_e,style:Oe})),ze=null),ar=dr,Xe=Ve));return ze!==null&&Ue.push(normalizeSegment({start:ze,end:ke,loop:$e,count:_e,style:Oe})),Ue}function _boundSegments(t,Ae){const xe=[],Ee=t.segments;for(let Se=0;Se<Ee.length;Se++){const Ce=_boundSegment(Ee[Se],t.points,Ae);Ce.length&&xe.push(...Ce)}return xe}function findStartAndEnd(t,Ae,xe,Ee){let Se=0,Ce=Ae-1;if(xe&&!Ee)for(;Se<Ae&&!t[Se].skip;)Se++;for(;Se<Ae&&t[Se].skip;)Se++;for(Se%=Ae,xe&&(Ce+=Se);Ce>Se&&t[Ce%Ae].skip;)Ce--;return Ce%=Ae,{start:Se,end:Ce}}function solidSegments(t,Ae,xe,Ee){const Se=t.length,Ce=[];let _e=Ae,Ie=t[Ae],Be;for(Be=Ae+1;Be<=xe;++Be){const Te=t[Be%Se];Te.skip||Te.stop?Ie.skip||(Ee=!1,Ce.push({start:Ae%Se,end:(Be-1)%Se,loop:Ee}),Ae=_e=Te.stop?Be:null):(_e=Be,Ie.skip&&(Ae=Be)),Ie=Te}return _e!==null&&Ce.push({start:Ae%Se,end:_e%Se,loop:Ee}),Ce}function _computeSegments(t,Ae){const xe=t.points,Ee=t.options.spanGaps,Se=xe.length;if(!Se)return[];const Ce=!!t._loop,{start:_e,end:Ie}=findStartAndEnd(xe,Se,Ce,Ee);if(Ee===!0)return splitByStyles(t,[{start:_e,end:Ie,loop:Ce}],xe,Ae);const Be=Ie<_e?Ie+Se:Ie,Te=!!t._fullLoop&&_e===0&&Ie===Se-1;return splitByStyles(t,solidSegments(xe,_e,Be,Te),xe,Ae)}function splitByStyles(t,Ae,xe,Ee){return!Ee||!Ee.setContext||!xe?Ae:doSplitByStyles(t,Ae,xe,Ee)}function doSplitByStyles(t,Ae,xe,Ee){const Se=t._chart.getContext(),Ce=readStyle(t.options),{_datasetIndex:_e,options:{spanGaps:Ie}}=t,Be=xe.length,Te=[];let Pe=Ce,ke=Ae[0].start,$e=ke;function Oe(Ue,qe,ze,Ve){const Ge=Ie?-1:1;if(Ue!==qe){for(Ue+=Be;xe[Ue%Be].skip;)Ue-=Ge;for(;xe[qe%Be].skip;)qe+=Ge;Ue%Be!==qe%Be&&(Te.push({start:Ue%Be,end:qe%Be,loop:ze,style:Ve}),Pe=Ve,ke=qe%Be)}}for(const Ue of Ae){ke=Ie?ke:Ue.start;let qe=xe[ke%Be],ze;for($e=ke+1;$e<=Ue.end;$e++){const Ve=xe[$e%Be];ze=readStyle(Ee.setContext(createContext(Se,{type:"segment",p0:qe,p1:Ve,p0DataIndex:($e-1)%Be,p1DataIndex:$e%Be,datasetIndex:_e}))),styleChanged(ze,Pe)&&Oe(ke,$e-1,Ue.loop,Pe),qe=Ve,Pe=ze}ke<$e-1&&Oe(ke,$e-1,Ue.loop,Pe)}return Te}function readStyle(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function styleChanged(t,Ae){if(!Ae)return!1;const xe=[],Ee=function(Se,Ce){return isPatternOrGradient(Ce)?(xe.includes(Ce)||xe.push(Ce),xe.indexOf(Ce)):Ce};return JSON.stringify(t,Ee)!==JSON.stringify(Ae,Ee)}/*!
594
- * Chart.js v4.4.8
593
+ */function noop(){}const uid=(()=>{let t=0;return()=>t++})();function isNullOrUndef(t){return t==null}function isArray$2(t){if(Array.isArray&&Array.isArray(t))return!0;const Ae=Object.prototype.toString.call(t);return Ae.slice(0,7)==="[object"&&Ae.slice(-6)==="Array]"}function isObject$1(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function isNumberFinite(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function finiteOrDefault(t,Ae){return isNumberFinite(t)?t:Ae}function valueOrDefault(t,Ae){return typeof t>"u"?Ae:t}const toPercentage=(t,Ae)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/Ae,toDimension=(t,Ae)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*Ae:+t;function callback(t,Ae,xe){if(t&&typeof t.call=="function")return t.apply(xe,Ae)}function each(t,Ae,xe,Ee){let Se,Ce,_e;if(isArray$2(t))for(Ce=t.length,Se=0;Se<Ce;Se++)Ae.call(xe,t[Se],Se);else if(isObject$1(t))for(_e=Object.keys(t),Ce=_e.length,Se=0;Se<Ce;Se++)Ae.call(xe,t[_e[Se]],_e[Se])}function _elementsEqual(t,Ae){let xe,Ee,Se,Ce;if(!t||!Ae||t.length!==Ae.length)return!1;for(xe=0,Ee=t.length;xe<Ee;++xe)if(Se=t[xe],Ce=Ae[xe],Se.datasetIndex!==Ce.datasetIndex||Se.index!==Ce.index)return!1;return!0}function clone$1(t){if(isArray$2(t))return t.map(clone$1);if(isObject$1(t)){const Ae=Object.create(null),xe=Object.keys(t),Ee=xe.length;let Se=0;for(;Se<Ee;++Se)Ae[xe[Se]]=clone$1(t[xe[Se]]);return Ae}return t}function isValidKey(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function _merger(t,Ae,xe,Ee){if(!isValidKey(t))return;const Se=Ae[t],Ce=xe[t];isObject$1(Se)&&isObject$1(Ce)?merge$1(Se,Ce,Ee):Ae[t]=clone$1(Ce)}function merge$1(t,Ae,xe){const Ee=isArray$2(Ae)?Ae:[Ae],Se=Ee.length;if(!isObject$1(t))return t;xe=xe||{};const Ce=xe.merger||_merger;let _e;for(let Ie=0;Ie<Se;++Ie){if(_e=Ee[Ie],!isObject$1(_e))continue;const Be=Object.keys(_e);for(let Te=0,Pe=Be.length;Te<Pe;++Te)Ce(Be[Te],t,_e,xe)}return t}function mergeIf(t,Ae){return merge$1(t,Ae,{merger:_mergerIf})}function _mergerIf(t,Ae,xe){if(!isValidKey(t))return;const Ee=Ae[t],Se=xe[t];isObject$1(Ee)&&isObject$1(Se)?mergeIf(Ee,Se):Object.prototype.hasOwnProperty.call(Ae,t)||(Ae[t]=clone$1(Se))}const keyResolvers={"":t=>t,x:t=>t.x,y:t=>t.y};function _splitKey(t){const Ae=t.split("."),xe=[];let Ee="";for(const Se of Ae)Ee+=Se,Ee.endsWith("\\")?Ee=Ee.slice(0,-1)+".":(xe.push(Ee),Ee="");return xe}function _getKeyResolver(t){const Ae=_splitKey(t);return xe=>{for(const Ee of Ae){if(Ee==="")break;xe=xe&&xe[Ee]}return xe}}function resolveObjectKey(t,Ae){return(keyResolvers[Ae]||(keyResolvers[Ae]=_getKeyResolver(Ae)))(t)}function _capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}const defined=t=>typeof t<"u",isFunction$2=t=>typeof t=="function",setsEqual=(t,Ae)=>{if(t.size!==Ae.size)return!1;for(const xe of t)if(!Ae.has(xe))return!1;return!0};function _isClickEvent(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY$1=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=PI*2/3,log10=Math.log10,sign=Math.sign;function almostEquals(t,Ae,xe){return Math.abs(t-Ae)<xe}function niceNum(t){const Ae=Math.round(t);t=almostEquals(t,Ae,t/1e3)?Ae:t;const xe=Math.pow(10,Math.floor(log10(t))),Ee=t/xe;return(Ee<=1?1:Ee<=2?2:Ee<=5?5:10)*xe}function _factorize(t){const Ae=[],xe=Math.sqrt(t);let Ee;for(Ee=1;Ee<xe;Ee++)t%Ee===0&&(Ae.push(Ee),Ae.push(t/Ee));return xe===(xe|0)&&Ae.push(xe),Ae.sort((Se,Ce)=>Se-Ce).pop(),Ae}function isNonPrimitive(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function isNumber$2(t){return!isNonPrimitive(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function almostWhole(t,Ae){const xe=Math.round(t);return xe-Ae<=t&&xe+Ae>=t}function _setMinAndMaxByKey(t,Ae,xe){let Ee,Se,Ce;for(Ee=0,Se=t.length;Ee<Se;Ee++)Ce=t[Ee][xe],isNaN(Ce)||(Ae.min=Math.min(Ae.min,Ce),Ae.max=Math.max(Ae.max,Ce))}function toRadians(t){return t*(PI/180)}function toDegrees(t){return t*(180/PI)}function _decimalPlaces(t){if(!isNumberFinite(t))return;let Ae=1,xe=0;for(;Math.round(t*Ae)/Ae!==t;)Ae*=10,xe++;return xe}function getAngleFromPoint(t,Ae){const xe=Ae.x-t.x,Ee=Ae.y-t.y,Se=Math.sqrt(xe*xe+Ee*Ee);let Ce=Math.atan2(Ee,xe);return Ce<-.5*PI&&(Ce+=TAU),{angle:Ce,distance:Se}}function distanceBetweenPoints(t,Ae){return Math.sqrt(Math.pow(Ae.x-t.x,2)+Math.pow(Ae.y-t.y,2))}function _angleDiff(t,Ae){return(t-Ae+PITAU)%TAU-PI}function _normalizeAngle(t){return(t%TAU+TAU)%TAU}function _angleBetween(t,Ae,xe,Ee){const Se=_normalizeAngle(t),Ce=_normalizeAngle(Ae),_e=_normalizeAngle(xe),Ie=_normalizeAngle(Ce-Se),Be=_normalizeAngle(_e-Se),Te=_normalizeAngle(Se-Ce),Pe=_normalizeAngle(Se-_e);return Se===Ce||Se===_e||Ee&&Ce===_e||Ie>Be&&Te<Pe}function _limitValue(t,Ae,xe){return Math.max(Ae,Math.min(xe,t))}function _int16Range(t){return _limitValue(t,-32768,32767)}function _isBetween(t,Ae,xe,Ee=1e-6){return t>=Math.min(Ae,xe)-Ee&&t<=Math.max(Ae,xe)+Ee}function _lookup(t,Ae,xe){xe=xe||(_e=>t[_e]<Ae);let Ee=t.length-1,Se=0,Ce;for(;Ee-Se>1;)Ce=Se+Ee>>1,xe(Ce)?Se=Ce:Ee=Ce;return{lo:Se,hi:Ee}}const _lookupByKey=(t,Ae,xe,Ee)=>_lookup(t,xe,Ee?Se=>{const Ce=t[Se][Ae];return Ce<xe||Ce===xe&&t[Se+1][Ae]===xe}:Se=>t[Se][Ae]<xe),_rlookupByKey=(t,Ae,xe)=>_lookup(t,xe,Ee=>t[Ee][Ae]>=xe);function _filterBetween(t,Ae,xe){let Ee=0,Se=t.length;for(;Ee<Se&&t[Ee]<Ae;)Ee++;for(;Se>Ee&&t[Se-1]>xe;)Se--;return Ee>0||Se<t.length?t.slice(Ee,Se):t}const arrayEvents=["push","pop","shift","splice","unshift"];function listenArrayEvents(t,Ae){if(t._chartjs){t._chartjs.listeners.push(Ae);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[Ae]}}),arrayEvents.forEach(xe=>{const Ee="_onData"+_capitalize(xe),Se=t[xe];Object.defineProperty(t,xe,{configurable:!0,enumerable:!1,value(...Ce){const _e=Se.apply(this,Ce);return t._chartjs.listeners.forEach(Ie=>{typeof Ie[Ee]=="function"&&Ie[Ee](...Ce)}),_e}})})}function unlistenArrayEvents(t,Ae){const xe=t._chartjs;if(!xe)return;const Ee=xe.listeners,Se=Ee.indexOf(Ae);Se!==-1&&Ee.splice(Se,1),!(Ee.length>0)&&(arrayEvents.forEach(Ce=>{delete t[Ce]}),delete t._chartjs)}function _arrayUnique(t){const Ae=new Set(t);return Ae.size===t.length?t:Array.from(Ae)}const requestAnimFrame=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function throttled(t,Ae){let xe=[],Ee=!1;return function(...Se){xe=Se,Ee||(Ee=!0,requestAnimFrame.call(window,()=>{Ee=!1,t.apply(Ae,xe)}))}}function debounce(t,Ae){let xe;return function(...Ee){return Ae?(clearTimeout(xe),xe=setTimeout(t,Ae,Ee)):t.apply(this,Ee),Ae}}const _toLeftRightCenter=t=>t==="start"?"left":t==="end"?"right":"center",_alignStartEnd=(t,Ae,xe)=>t==="start"?Ae:t==="end"?xe:(Ae+xe)/2;function _getStartAndCountOfVisiblePoints(t,Ae,xe){const Ee=Ae.length;let Se=0,Ce=Ee;if(t._sorted){const{iScale:_e,vScale:Ie,_parsed:Be}=t,Te=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,Pe=_e.axis,{min:ke,max:$e,minDefined:Oe,maxDefined:Ue}=_e.getUserBounds();if(Oe){if(Se=Math.min(_lookupByKey(Be,Pe,ke).lo,xe?Ee:_lookupByKey(Ae,Pe,_e.getPixelForValue(ke)).lo),Te){const qe=Be.slice(0,Se+1).reverse().findIndex(ze=>!isNullOrUndef(ze[Ie.axis]));Se-=Math.max(0,qe)}Se=_limitValue(Se,0,Ee-1)}if(Ue){let qe=Math.max(_lookupByKey(Be,_e.axis,$e,!0).hi+1,xe?0:_lookupByKey(Ae,Pe,_e.getPixelForValue($e),!0).hi+1);if(Te){const ze=Be.slice(qe-1).findIndex(Ve=>!isNullOrUndef(Ve[Ie.axis]));qe+=Math.max(0,ze)}Ce=_limitValue(qe,Se,Ee)-Se}else Ce=Ee-Se}return{start:Se,count:Ce}}function _scaleRangesChanged(t){const{xScale:Ae,yScale:xe,_scaleRanges:Ee}=t,Se={xmin:Ae.min,xmax:Ae.max,ymin:xe.min,ymax:xe.max};if(!Ee)return t._scaleRanges=Se,!0;const Ce=Ee.xmin!==Ae.min||Ee.xmax!==Ae.max||Ee.ymin!==xe.min||Ee.ymax!==xe.max;return Object.assign(Ee,Se),Ce}const atEdge=t=>t===0||t===1,elasticIn=(t,Ae,xe)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-Ae)*TAU/xe)),elasticOut=(t,Ae,xe)=>Math.pow(2,-10*t)*Math.sin((t-Ae)*TAU/xe)+1,effects={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*HALF_PI)+1,easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic(t){return atEdge(t)?t:t<.5?.5*elasticIn(t*2,.1125,.45):.5+.5*elasticOut(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let Ae=1.70158;return(t/=.5)<1?.5*(t*t*(((Ae*=1.525)+1)*t-Ae)):.5*((t-=2)*t*(((Ae*=1.525)+1)*t+Ae)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?effects.easeInBounce(t*2)*.5:effects.easeOutBounce(t*2-1)*.5+.5};function isPatternOrGradient(t){if(t&&typeof t=="object"){const Ae=t.toString();return Ae==="[object CanvasPattern]"||Ae==="[object CanvasGradient]"}return!1}function color$3(t){return isPatternOrGradient(t)?t:new Color(t)}function getHoverColor(t){return isPatternOrGradient(t)?t:new Color(t).saturate(.5).darken(.1).hexString()}const numbers=["x","y","borderWidth","radius","tension"],colors=["color","borderColor","backgroundColor"];function applyAnimationsDefaults(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:Ae=>Ae!=="onProgress"&&Ae!=="onComplete"&&Ae!=="fn"}),t.set("animations",{colors:{type:"color",properties:colors},numbers:{type:"number",properties:numbers}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:Ae=>Ae|0}}}})}function applyLayoutsDefaults(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const intlCache=new Map;function getNumberFormat(t,Ae){Ae=Ae||{};const xe=t+JSON.stringify(Ae);let Ee=intlCache.get(xe);return Ee||(Ee=new Intl.NumberFormat(t,Ae),intlCache.set(xe,Ee)),Ee}function formatNumber(t,Ae,xe){return getNumberFormat(Ae,xe).format(t)}const formatters={values(t){return isArray$2(t)?t:""+t},numeric(t,Ae,xe){if(t===0)return"0";const Ee=this.chart.options.locale;let Se,Ce=t;if(xe.length>1){const Te=Math.max(Math.abs(xe[0].value),Math.abs(xe[xe.length-1].value));(Te<1e-4||Te>1e15)&&(Se="scientific"),Ce=calculateDelta(t,xe)}const _e=log10(Math.abs(Ce)),Ie=isNaN(_e)?1:Math.max(Math.min(-1*Math.floor(_e),20),0),Be={notation:Se,minimumFractionDigits:Ie,maximumFractionDigits:Ie};return Object.assign(Be,this.options.ticks.format),formatNumber(t,Ee,Be)}};function calculateDelta(t,Ae){let xe=Ae.length>3?Ae[2].value-Ae[1].value:Ae[1].value-Ae[0].value;return Math.abs(xe)>=1&&t!==Math.floor(t)&&(xe=t-Math.floor(t)),xe}var Ticks={formatters};function applyScaleDefaults(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(Ae,xe)=>xe.lineWidth,tickColor:(Ae,xe)=>xe.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:Ae=>!Ae.startsWith("before")&&!Ae.startsWith("after")&&Ae!=="callback"&&Ae!=="parser",_indexable:Ae=>Ae!=="borderDash"&&Ae!=="tickBorderDash"&&Ae!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:Ae=>Ae!=="backdropPadding"&&Ae!=="callback",_indexable:Ae=>Ae!=="backdropPadding"})}const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(t,Ae){if(!Ae)return t;const xe=Ae.split(".");for(let Ee=0,Se=xe.length;Ee<Se;++Ee){const Ce=xe[Ee];t=t[Ce]||(t[Ce]=Object.create(null))}return t}function set$1(t,Ae,xe){return typeof Ae=="string"?merge$1(getScope$1(t,Ae),xe):merge$1(getScope$1(t,""),Ae)}class Defaults{constructor(Ae,xe){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=Ee=>Ee.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(Ee,Se)=>getHoverColor(Se.backgroundColor),this.hoverBorderColor=(Ee,Se)=>getHoverColor(Se.borderColor),this.hoverColor=(Ee,Se)=>getHoverColor(Se.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(Ae),this.apply(xe)}set(Ae,xe){return set$1(this,Ae,xe)}get(Ae){return getScope$1(this,Ae)}describe(Ae,xe){return set$1(descriptors,Ae,xe)}override(Ae,xe){return set$1(overrides,Ae,xe)}route(Ae,xe,Ee,Se){const Ce=getScope$1(this,Ae),_e=getScope$1(this,Ee),Ie="_"+xe;Object.defineProperties(Ce,{[Ie]:{value:Ce[xe],writable:!0},[xe]:{enumerable:!0,get(){const Be=this[Ie],Te=_e[Se];return isObject$1(Be)?Object.assign({},Te,Be):valueOrDefault(Be,Te)},set(Be){this[Ie]=Be}}})}apply(Ae){Ae.forEach(xe=>xe(this))}}var defaults$1=new Defaults({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[applyAnimationsDefaults,applyLayoutsDefaults,applyScaleDefaults]);function toFontString(t){return!t||isNullOrUndef(t.size)||isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function _measureText(t,Ae,xe,Ee,Se){let Ce=Ae[Se];return Ce||(Ce=Ae[Se]=t.measureText(Se).width,xe.push(Se)),Ce>Ee&&(Ee=Ce),Ee}function _alignPixel(t,Ae,xe){const Ee=t.currentDevicePixelRatio,Se=xe!==0?Math.max(xe/2,.5):0;return Math.round((Ae-Se)*Ee)/Ee+Se}function clearCanvas(t,Ae){!Ae&&!t||(Ae=Ae||t.getContext("2d"),Ae.save(),Ae.resetTransform(),Ae.clearRect(0,0,t.width,t.height),Ae.restore())}function drawPoint(t,Ae,xe,Ee){drawPointLegend(t,Ae,xe,Ee)}function drawPointLegend(t,Ae,xe,Ee,Se){let Ce,_e,Ie,Be,Te,Pe,ke,$e;const Oe=Ae.pointStyle,Ue=Ae.rotation,qe=Ae.radius;let ze=(Ue||0)*RAD_PER_DEG;if(Oe&&typeof Oe=="object"&&(Ce=Oe.toString(),Ce==="[object HTMLImageElement]"||Ce==="[object HTMLCanvasElement]")){t.save(),t.translate(xe,Ee),t.rotate(ze),t.drawImage(Oe,-Oe.width/2,-Oe.height/2,Oe.width,Oe.height),t.restore();return}if(!(isNaN(qe)||qe<=0)){switch(t.beginPath(),Oe){default:t.arc(xe,Ee,qe,0,TAU),t.closePath();break;case"triangle":Pe=qe,t.moveTo(xe+Math.sin(ze)*Pe,Ee-Math.cos(ze)*qe),ze+=TWO_THIRDS_PI,t.lineTo(xe+Math.sin(ze)*Pe,Ee-Math.cos(ze)*qe),ze+=TWO_THIRDS_PI,t.lineTo(xe+Math.sin(ze)*Pe,Ee-Math.cos(ze)*qe),t.closePath();break;case"rectRounded":Te=qe*.516,Be=qe-Te,_e=Math.cos(ze+QUARTER_PI)*Be,ke=Math.cos(ze+QUARTER_PI)*Be,Ie=Math.sin(ze+QUARTER_PI)*Be,$e=Math.sin(ze+QUARTER_PI)*Be,t.arc(xe-ke,Ee-Ie,Te,ze-PI,ze-HALF_PI),t.arc(xe+$e,Ee-_e,Te,ze-HALF_PI,ze),t.arc(xe+ke,Ee+Ie,Te,ze,ze+HALF_PI),t.arc(xe-$e,Ee+_e,Te,ze+HALF_PI,ze+PI),t.closePath();break;case"rect":if(!Ue){Be=Math.SQRT1_2*qe,Pe=Be,t.rect(xe-Pe,Ee-Be,2*Pe,2*Be);break}ze+=QUARTER_PI;case"rectRot":ke=Math.cos(ze)*qe,_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,$e=Math.sin(ze)*qe,t.moveTo(xe-ke,Ee-Ie),t.lineTo(xe+$e,Ee-_e),t.lineTo(xe+ke,Ee+Ie),t.lineTo(xe-$e,Ee+_e),t.closePath();break;case"crossRot":ze+=QUARTER_PI;case"cross":ke=Math.cos(ze)*qe,_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,$e=Math.sin(ze)*qe,t.moveTo(xe-ke,Ee-Ie),t.lineTo(xe+ke,Ee+Ie),t.moveTo(xe+$e,Ee-_e),t.lineTo(xe-$e,Ee+_e);break;case"star":ke=Math.cos(ze)*qe,_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,$e=Math.sin(ze)*qe,t.moveTo(xe-ke,Ee-Ie),t.lineTo(xe+ke,Ee+Ie),t.moveTo(xe+$e,Ee-_e),t.lineTo(xe-$e,Ee+_e),ze+=QUARTER_PI,ke=Math.cos(ze)*qe,_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,$e=Math.sin(ze)*qe,t.moveTo(xe-ke,Ee-Ie),t.lineTo(xe+ke,Ee+Ie),t.moveTo(xe+$e,Ee-_e),t.lineTo(xe-$e,Ee+_e);break;case"line":_e=Math.cos(ze)*qe,Ie=Math.sin(ze)*qe,t.moveTo(xe-_e,Ee-Ie),t.lineTo(xe+_e,Ee+Ie);break;case"dash":t.moveTo(xe,Ee),t.lineTo(xe+Math.cos(ze)*qe,Ee+Math.sin(ze)*qe);break;case!1:t.closePath();break}t.fill(),Ae.borderWidth>0&&t.stroke()}}function _isPointInArea(t,Ae,xe){return xe=xe||.5,!Ae||t&&t.x>Ae.left-xe&&t.x<Ae.right+xe&&t.y>Ae.top-xe&&t.y<Ae.bottom+xe}function clipArea(t,Ae){t.save(),t.beginPath(),t.rect(Ae.left,Ae.top,Ae.right-Ae.left,Ae.bottom-Ae.top),t.clip()}function unclipArea(t){t.restore()}function _steppedLineTo(t,Ae,xe,Ee,Se){if(!Ae)return t.lineTo(xe.x,xe.y);if(Se==="middle"){const Ce=(Ae.x+xe.x)/2;t.lineTo(Ce,Ae.y),t.lineTo(Ce,xe.y)}else Se==="after"!=!!Ee?t.lineTo(Ae.x,xe.y):t.lineTo(xe.x,Ae.y);t.lineTo(xe.x,xe.y)}function _bezierCurveTo(t,Ae,xe,Ee){if(!Ae)return t.lineTo(xe.x,xe.y);t.bezierCurveTo(Ee?Ae.cp1x:Ae.cp2x,Ee?Ae.cp1y:Ae.cp2y,Ee?xe.cp2x:xe.cp1x,Ee?xe.cp2y:xe.cp1y,xe.x,xe.y)}function setRenderOpts(t,Ae){Ae.translation&&t.translate(Ae.translation[0],Ae.translation[1]),isNullOrUndef(Ae.rotation)||t.rotate(Ae.rotation),Ae.color&&(t.fillStyle=Ae.color),Ae.textAlign&&(t.textAlign=Ae.textAlign),Ae.textBaseline&&(t.textBaseline=Ae.textBaseline)}function decorateText(t,Ae,xe,Ee,Se){if(Se.strikethrough||Se.underline){const Ce=t.measureText(Ee),_e=Ae-Ce.actualBoundingBoxLeft,Ie=Ae+Ce.actualBoundingBoxRight,Be=xe-Ce.actualBoundingBoxAscent,Te=xe+Ce.actualBoundingBoxDescent,Pe=Se.strikethrough?(Be+Te)/2:Te;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=Se.decorationWidth||2,t.moveTo(_e,Pe),t.lineTo(Ie,Pe),t.stroke()}}function drawBackdrop(t,Ae){const xe=t.fillStyle;t.fillStyle=Ae.color,t.fillRect(Ae.left,Ae.top,Ae.width,Ae.height),t.fillStyle=xe}function renderText(t,Ae,xe,Ee,Se,Ce={}){const _e=isArray$2(Ae)?Ae:[Ae],Ie=Ce.strokeWidth>0&&Ce.strokeColor!=="";let Be,Te;for(t.save(),t.font=Se.string,setRenderOpts(t,Ce),Be=0;Be<_e.length;++Be)Te=_e[Be],Ce.backdrop&&drawBackdrop(t,Ce.backdrop),Ie&&(Ce.strokeColor&&(t.strokeStyle=Ce.strokeColor),isNullOrUndef(Ce.strokeWidth)||(t.lineWidth=Ce.strokeWidth),t.strokeText(Te,xe,Ee,Ce.maxWidth)),t.fillText(Te,xe,Ee,Ce.maxWidth),decorateText(t,xe,Ee,Te,Ce),Ee+=Number(Se.lineHeight);t.restore()}function addRoundedRectPath(t,Ae){const{x:xe,y:Ee,w:Se,h:Ce,radius:_e}=Ae;t.arc(xe+_e.topLeft,Ee+_e.topLeft,_e.topLeft,1.5*PI,PI,!0),t.lineTo(xe,Ee+Ce-_e.bottomLeft),t.arc(xe+_e.bottomLeft,Ee+Ce-_e.bottomLeft,_e.bottomLeft,PI,HALF_PI,!0),t.lineTo(xe+Se-_e.bottomRight,Ee+Ce),t.arc(xe+Se-_e.bottomRight,Ee+Ce-_e.bottomRight,_e.bottomRight,HALF_PI,0,!0),t.lineTo(xe+Se,Ee+_e.topRight),t.arc(xe+Se-_e.topRight,Ee+_e.topRight,_e.topRight,0,-HALF_PI,!0),t.lineTo(xe+_e.topLeft,Ee)}const LINE_HEIGHT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,FONT_STYLE=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function toLineHeight(t,Ae){const xe=(""+t).match(LINE_HEIGHT);if(!xe||xe[1]==="normal")return Ae*1.2;switch(t=+xe[2],xe[3]){case"px":return t;case"%":t/=100;break}return Ae*t}const numberOrZero=t=>+t||0;function _readValueToProps(t,Ae){const xe={},Ee=isObject$1(Ae),Se=Ee?Object.keys(Ae):Ae,Ce=isObject$1(t)?Ee?_e=>valueOrDefault(t[_e],t[Ae[_e]]):_e=>t[_e]:()=>t;for(const _e of Se)xe[_e]=numberOrZero(Ce(_e));return xe}function toTRBL(t){return _readValueToProps(t,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(t){return _readValueToProps(t,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(t){const Ae=toTRBL(t);return Ae.width=Ae.left+Ae.right,Ae.height=Ae.top+Ae.bottom,Ae}function toFont(t,Ae){t=t||{},Ae=Ae||defaults$1.font;let xe=valueOrDefault(t.size,Ae.size);typeof xe=="string"&&(xe=parseInt(xe,10));let Ee=valueOrDefault(t.style,Ae.style);Ee&&!(""+Ee).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+Ee+'"'),Ee=void 0);const Se={family:valueOrDefault(t.family,Ae.family),lineHeight:toLineHeight(valueOrDefault(t.lineHeight,Ae.lineHeight),xe),size:xe,style:Ee,weight:valueOrDefault(t.weight,Ae.weight),string:""};return Se.string=toFontString(Se),Se}function resolve(t,Ae,xe,Ee){let Se,Ce,_e;for(Se=0,Ce=t.length;Se<Ce;++Se)if(_e=t[Se],_e!==void 0&&_e!==void 0)return _e}function _addGrace(t,Ae,xe){const{min:Ee,max:Se}=t,Ce=toDimension(Ae,(Se-Ee)/2),_e=(Ie,Be)=>xe&&Ie===0?0:Ie+Be;return{min:_e(Ee,-Math.abs(Ce)),max:_e(Se,Ce)}}function createContext(t,Ae){return Object.assign(Object.create(t),Ae)}function _createResolver(t,Ae=[""],xe,Ee,Se=()=>t[0]){const Ce=xe||t;typeof Ee>"u"&&(Ee=_resolve("_fallback",t));const _e={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:Ce,_fallback:Ee,_getTarget:Se,override:Ie=>_createResolver([Ie,...t],Ae,Ce,Ee)};return new Proxy(_e,{deleteProperty(Ie,Be){return delete Ie[Be],delete Ie._keys,delete t[0][Be],!0},get(Ie,Be){return _cached(Ie,Be,()=>_resolveWithPrefixes(Be,Ae,t,Ie))},getOwnPropertyDescriptor(Ie,Be){return Reflect.getOwnPropertyDescriptor(Ie._scopes[0],Be)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(Ie,Be){return getKeysFromAllScopes(Ie).includes(Be)},ownKeys(Ie){return getKeysFromAllScopes(Ie)},set(Ie,Be,Te){const Pe=Ie._storage||(Ie._storage=Se());return Ie[Be]=Pe[Be]=Te,delete Ie._keys,!0}})}function _attachContext(t,Ae,xe,Ee){const Se={_cacheable:!1,_proxy:t,_context:Ae,_subProxy:xe,_stack:new Set,_descriptors:_descriptors(t,Ee),setContext:Ce=>_attachContext(t,Ce,xe,Ee),override:Ce=>_attachContext(t.override(Ce),Ae,xe,Ee)};return new Proxy(Se,{deleteProperty(Ce,_e){return delete Ce[_e],delete t[_e],!0},get(Ce,_e,Ie){return _cached(Ce,_e,()=>_resolveWithContext(Ce,_e,Ie))},getOwnPropertyDescriptor(Ce,_e){return Ce._descriptors.allKeys?Reflect.has(t,_e)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,_e)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(Ce,_e){return Reflect.has(t,_e)},ownKeys(){return Reflect.ownKeys(t)},set(Ce,_e,Ie){return t[_e]=Ie,delete Ce[_e],!0}})}function _descriptors(t,Ae={scriptable:!0,indexable:!0}){const{_scriptable:xe=Ae.scriptable,_indexable:Ee=Ae.indexable,_allKeys:Se=Ae.allKeys}=t;return{allKeys:Se,scriptable:xe,indexable:Ee,isScriptable:isFunction$2(xe)?xe:()=>xe,isIndexable:isFunction$2(Ee)?Ee:()=>Ee}}const readKey=(t,Ae)=>t?t+_capitalize(Ae):Ae,needsSubResolver=(t,Ae)=>isObject$1(Ae)&&t!=="adapters"&&(Object.getPrototypeOf(Ae)===null||Ae.constructor===Object);function _cached(t,Ae,xe){if(Object.prototype.hasOwnProperty.call(t,Ae)||Ae==="constructor")return t[Ae];const Ee=xe();return t[Ae]=Ee,Ee}function _resolveWithContext(t,Ae,xe){const{_proxy:Ee,_context:Se,_subProxy:Ce,_descriptors:_e}=t;let Ie=Ee[Ae];return isFunction$2(Ie)&&_e.isScriptable(Ae)&&(Ie=_resolveScriptable(Ae,Ie,t,xe)),isArray$2(Ie)&&Ie.length&&(Ie=_resolveArray(Ae,Ie,t,_e.isIndexable)),needsSubResolver(Ae,Ie)&&(Ie=_attachContext(Ie,Se,Ce&&Ce[Ae],_e)),Ie}function _resolveScriptable(t,Ae,xe,Ee){const{_proxy:Se,_context:Ce,_subProxy:_e,_stack:Ie}=xe;if(Ie.has(t))throw new Error("Recursion detected: "+Array.from(Ie).join("->")+"->"+t);Ie.add(t);let Be=Ae(Ce,_e||Ee);return Ie.delete(t),needsSubResolver(t,Be)&&(Be=createSubResolver(Se._scopes,Se,t,Be)),Be}function _resolveArray(t,Ae,xe,Ee){const{_proxy:Se,_context:Ce,_subProxy:_e,_descriptors:Ie}=xe;if(typeof Ce.index<"u"&&Ee(t))return Ae[Ce.index%Ae.length];if(isObject$1(Ae[0])){const Be=Ae,Te=Se._scopes.filter(Pe=>Pe!==Be);Ae=[];for(const Pe of Be){const ke=createSubResolver(Te,Se,t,Pe);Ae.push(_attachContext(ke,Ce,_e&&_e[t],Ie))}}return Ae}function resolveFallback(t,Ae,xe){return isFunction$2(t)?t(Ae,xe):t}const getScope=(t,Ae)=>t===!0?Ae:typeof t=="string"?resolveObjectKey(Ae,t):void 0;function addScopes(t,Ae,xe,Ee,Se){for(const Ce of Ae){const _e=getScope(xe,Ce);if(_e){t.add(_e);const Ie=resolveFallback(_e._fallback,xe,Se);if(typeof Ie<"u"&&Ie!==xe&&Ie!==Ee)return Ie}else if(_e===!1&&typeof Ee<"u"&&xe!==Ee)return null}return!1}function createSubResolver(t,Ae,xe,Ee){const Se=Ae._rootScopes,Ce=resolveFallback(Ae._fallback,xe,Ee),_e=[...t,...Se],Ie=new Set;Ie.add(Ee);let Be=addScopesFromKey(Ie,_e,xe,Ce||xe,Ee);return Be===null||typeof Ce<"u"&&Ce!==xe&&(Be=addScopesFromKey(Ie,_e,Ce,Be,Ee),Be===null)?!1:_createResolver(Array.from(Ie),[""],Se,Ce,()=>subGetTarget(Ae,xe,Ee))}function addScopesFromKey(t,Ae,xe,Ee,Se){for(;xe;)xe=addScopes(t,Ae,xe,Ee,Se);return xe}function subGetTarget(t,Ae,xe){const Ee=t._getTarget();Ae in Ee||(Ee[Ae]={});const Se=Ee[Ae];return isArray$2(Se)&&isObject$1(xe)?xe:Se||{}}function _resolveWithPrefixes(t,Ae,xe,Ee){let Se;for(const Ce of Ae)if(Se=_resolve(readKey(Ce,t),xe),typeof Se<"u")return needsSubResolver(t,Se)?createSubResolver(xe,Ee,t,Se):Se}function _resolve(t,Ae){for(const xe of Ae){if(!xe)continue;const Ee=xe[t];if(typeof Ee<"u")return Ee}}function getKeysFromAllScopes(t){let Ae=t._keys;return Ae||(Ae=t._keys=resolveKeysFromAllScopes(t._scopes)),Ae}function resolveKeysFromAllScopes(t){const Ae=new Set;for(const xe of t)for(const Ee of Object.keys(xe).filter(Se=>!Se.startsWith("_")))Ae.add(Ee);return Array.from(Ae)}function _parseObjectDataRadialScale(t,Ae,xe,Ee){const{iScale:Se}=t,{key:Ce="r"}=this._parsing,_e=new Array(Ee);let Ie,Be,Te,Pe;for(Ie=0,Be=Ee;Ie<Be;++Ie)Te=Ie+xe,Pe=Ae[Te],_e[Ie]={r:Se.parse(resolveObjectKey(Pe,Ce),Te)};return _e}const EPSILON$1=Number.EPSILON||1e-14,getPoint$2=(t,Ae)=>Ae<t.length&&!t[Ae].skip&&t[Ae],getValueAxis=t=>t==="x"?"y":"x";function splineCurve(t,Ae,xe,Ee){const Se=t.skip?Ae:t,Ce=Ae,_e=xe.skip?Ae:xe,Ie=distanceBetweenPoints(Ce,Se),Be=distanceBetweenPoints(_e,Ce);let Te=Ie/(Ie+Be),Pe=Be/(Ie+Be);Te=isNaN(Te)?0:Te,Pe=isNaN(Pe)?0:Pe;const ke=Ee*Te,$e=Ee*Pe;return{previous:{x:Ce.x-ke*(_e.x-Se.x),y:Ce.y-ke*(_e.y-Se.y)},next:{x:Ce.x+$e*(_e.x-Se.x),y:Ce.y+$e*(_e.y-Se.y)}}}function monotoneAdjust(t,Ae,xe){const Ee=t.length;let Se,Ce,_e,Ie,Be,Te=getPoint$2(t,0);for(let Pe=0;Pe<Ee-1;++Pe)if(Be=Te,Te=getPoint$2(t,Pe+1),!(!Be||!Te)){if(almostEquals(Ae[Pe],0,EPSILON$1)){xe[Pe]=xe[Pe+1]=0;continue}Se=xe[Pe]/Ae[Pe],Ce=xe[Pe+1]/Ae[Pe],Ie=Math.pow(Se,2)+Math.pow(Ce,2),!(Ie<=9)&&(_e=3/Math.sqrt(Ie),xe[Pe]=Se*_e*Ae[Pe],xe[Pe+1]=Ce*_e*Ae[Pe])}}function monotoneCompute(t,Ae,xe="x"){const Ee=getValueAxis(xe),Se=t.length;let Ce,_e,Ie,Be=getPoint$2(t,0);for(let Te=0;Te<Se;++Te){if(_e=Ie,Ie=Be,Be=getPoint$2(t,Te+1),!Ie)continue;const Pe=Ie[xe],ke=Ie[Ee];_e&&(Ce=(Pe-_e[xe])/3,Ie[`cp1${xe}`]=Pe-Ce,Ie[`cp1${Ee}`]=ke-Ce*Ae[Te]),Be&&(Ce=(Be[xe]-Pe)/3,Ie[`cp2${xe}`]=Pe+Ce,Ie[`cp2${Ee}`]=ke+Ce*Ae[Te])}}function splineCurveMonotone(t,Ae="x"){const xe=getValueAxis(Ae),Ee=t.length,Se=Array(Ee).fill(0),Ce=Array(Ee);let _e,Ie,Be,Te=getPoint$2(t,0);for(_e=0;_e<Ee;++_e)if(Ie=Be,Be=Te,Te=getPoint$2(t,_e+1),!!Be){if(Te){const Pe=Te[Ae]-Be[Ae];Se[_e]=Pe!==0?(Te[xe]-Be[xe])/Pe:0}Ce[_e]=Ie?Te?sign(Se[_e-1])!==sign(Se[_e])?0:(Se[_e-1]+Se[_e])/2:Se[_e-1]:Se[_e]}monotoneAdjust(t,Se,Ce),monotoneCompute(t,Ce,Ae)}function capControlPoint(t,Ae,xe){return Math.max(Math.min(t,xe),Ae)}function capBezierPoints(t,Ae){let xe,Ee,Se,Ce,_e,Ie=_isPointInArea(t[0],Ae);for(xe=0,Ee=t.length;xe<Ee;++xe)_e=Ce,Ce=Ie,Ie=xe<Ee-1&&_isPointInArea(t[xe+1],Ae),Ce&&(Se=t[xe],_e&&(Se.cp1x=capControlPoint(Se.cp1x,Ae.left,Ae.right),Se.cp1y=capControlPoint(Se.cp1y,Ae.top,Ae.bottom)),Ie&&(Se.cp2x=capControlPoint(Se.cp2x,Ae.left,Ae.right),Se.cp2y=capControlPoint(Se.cp2y,Ae.top,Ae.bottom)))}function _updateBezierControlPoints(t,Ae,xe,Ee,Se){let Ce,_e,Ie,Be;if(Ae.spanGaps&&(t=t.filter(Te=>!Te.skip)),Ae.cubicInterpolationMode==="monotone")splineCurveMonotone(t,Se);else{let Te=Ee?t[t.length-1]:t[0];for(Ce=0,_e=t.length;Ce<_e;++Ce)Ie=t[Ce],Be=splineCurve(Te,Ie,t[Math.min(Ce+1,_e-(Ee?0:1))%_e],Ae.tension),Ie.cp1x=Be.previous.x,Ie.cp1y=Be.previous.y,Ie.cp2x=Be.next.x,Ie.cp2y=Be.next.y,Te=Ie}Ae.capBezierPoints&&capBezierPoints(t,xe)}function _isDomSupported(){return typeof window<"u"&&typeof document<"u"}function _getParentNode(t){let Ae=t.parentNode;return Ae&&Ae.toString()==="[object ShadowRoot]"&&(Ae=Ae.host),Ae}function parseMaxStyle(t,Ae,xe){let Ee;return typeof t=="string"?(Ee=parseInt(t,10),t.indexOf("%")!==-1&&(Ee=Ee/100*Ae.parentNode[xe])):Ee=t,Ee}const getComputedStyle$1=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function getStyle(t,Ae){return getComputedStyle$1(t).getPropertyValue(Ae)}const positions=["top","right","bottom","left"];function getPositionedStyle(t,Ae,xe){const Ee={};xe=xe?"-"+xe:"";for(let Se=0;Se<4;Se++){const Ce=positions[Se];Ee[Ce]=parseFloat(t[Ae+"-"+Ce+xe])||0}return Ee.width=Ee.left+Ee.right,Ee.height=Ee.top+Ee.bottom,Ee}const useOffsetPos=(t,Ae,xe)=>(t>0||Ae>0)&&(!xe||!xe.shadowRoot);function getCanvasPosition(t,Ae){const xe=t.touches,Ee=xe&&xe.length?xe[0]:t,{offsetX:Se,offsetY:Ce}=Ee;let _e=!1,Ie,Be;if(useOffsetPos(Se,Ce,t.target))Ie=Se,Be=Ce;else{const Te=Ae.getBoundingClientRect();Ie=Ee.clientX-Te.left,Be=Ee.clientY-Te.top,_e=!0}return{x:Ie,y:Be,box:_e}}function getRelativePosition(t,Ae){if("native"in t)return t;const{canvas:xe,currentDevicePixelRatio:Ee}=Ae,Se=getComputedStyle$1(xe),Ce=Se.boxSizing==="border-box",_e=getPositionedStyle(Se,"padding"),Ie=getPositionedStyle(Se,"border","width"),{x:Be,y:Te,box:Pe}=getCanvasPosition(t,xe),ke=_e.left+(Pe&&Ie.left),$e=_e.top+(Pe&&Ie.top);let{width:Oe,height:Ue}=Ae;return Ce&&(Oe-=_e.width+Ie.width,Ue-=_e.height+Ie.height),{x:Math.round((Be-ke)/Oe*xe.width/Ee),y:Math.round((Te-$e)/Ue*xe.height/Ee)}}function getContainerSize(t,Ae,xe){let Ee,Se;if(Ae===void 0||xe===void 0){const Ce=t&&_getParentNode(t);if(!Ce)Ae=t.clientWidth,xe=t.clientHeight;else{const _e=Ce.getBoundingClientRect(),Ie=getComputedStyle$1(Ce),Be=getPositionedStyle(Ie,"border","width"),Te=getPositionedStyle(Ie,"padding");Ae=_e.width-Te.width-Be.width,xe=_e.height-Te.height-Be.height,Ee=parseMaxStyle(Ie.maxWidth,Ce,"clientWidth"),Se=parseMaxStyle(Ie.maxHeight,Ce,"clientHeight")}}return{width:Ae,height:xe,maxWidth:Ee||INFINITY$1,maxHeight:Se||INFINITY$1}}const round1=t=>Math.round(t*10)/10;function getMaximumSize(t,Ae,xe,Ee){const Se=getComputedStyle$1(t),Ce=getPositionedStyle(Se,"margin"),_e=parseMaxStyle(Se.maxWidth,t,"clientWidth")||INFINITY$1,Ie=parseMaxStyle(Se.maxHeight,t,"clientHeight")||INFINITY$1,Be=getContainerSize(t,Ae,xe);let{width:Te,height:Pe}=Be;if(Se.boxSizing==="content-box"){const $e=getPositionedStyle(Se,"border","width"),Oe=getPositionedStyle(Se,"padding");Te-=Oe.width+$e.width,Pe-=Oe.height+$e.height}return Te=Math.max(0,Te-Ce.width),Pe=Math.max(0,Ee?Te/Ee:Pe-Ce.height),Te=round1(Math.min(Te,_e,Be.maxWidth)),Pe=round1(Math.min(Pe,Ie,Be.maxHeight)),Te&&!Pe&&(Pe=round1(Te/2)),(Ae!==void 0||xe!==void 0)&&Ee&&Be.height&&Pe>Be.height&&(Pe=Be.height,Te=round1(Math.floor(Pe*Ee))),{width:Te,height:Pe}}function retinaScale(t,Ae,xe){const Ee=Ae||1,Se=Math.floor(t.height*Ee),Ce=Math.floor(t.width*Ee);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const _e=t.canvas;return _e.style&&(xe||!_e.style.height&&!_e.style.width)&&(_e.style.height=`${t.height}px`,_e.style.width=`${t.width}px`),t.currentDevicePixelRatio!==Ee||_e.height!==Se||_e.width!==Ce?(t.currentDevicePixelRatio=Ee,_e.height=Se,_e.width=Ce,t.ctx.setTransform(Ee,0,0,Ee,0,0),!0):!1}const supportsEventListenerOptions=function(){let t=!1;try{const Ae={get passive(){return t=!0,!1}};_isDomSupported()&&(window.addEventListener("test",null,Ae),window.removeEventListener("test",null,Ae))}catch{}return t}();function readUsedSize(t,Ae){const xe=getStyle(t,Ae),Ee=xe&&xe.match(/^(\d+)(\.\d+)?px$/);return Ee?+Ee[1]:void 0}function _pointInLine(t,Ae,xe,Ee){return{x:t.x+xe*(Ae.x-t.x),y:t.y+xe*(Ae.y-t.y)}}function _steppedInterpolation(t,Ae,xe,Ee){return{x:t.x+xe*(Ae.x-t.x),y:Ee==="middle"?xe<.5?t.y:Ae.y:Ee==="after"?xe<1?t.y:Ae.y:xe>0?Ae.y:t.y}}function _bezierInterpolation(t,Ae,xe,Ee){const Se={x:t.cp2x,y:t.cp2y},Ce={x:Ae.cp1x,y:Ae.cp1y},_e=_pointInLine(t,Se,xe),Ie=_pointInLine(Se,Ce,xe),Be=_pointInLine(Ce,Ae,xe),Te=_pointInLine(_e,Ie,xe),Pe=_pointInLine(Ie,Be,xe);return _pointInLine(Te,Pe,xe)}const getRightToLeftAdapter=function(t,Ae){return{x(xe){return t+t+Ae-xe},setWidth(xe){Ae=xe},textAlign(xe){return xe==="center"?xe:xe==="right"?"left":"right"},xPlus(xe,Ee){return xe-Ee},leftForLtr(xe,Ee){return xe-Ee}}},getLeftToRightAdapter=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,Ae){return t+Ae},leftForLtr(t,Ae){return t}}};function getRtlAdapter(t,Ae,xe){return t?getRightToLeftAdapter(Ae,xe):getLeftToRightAdapter()}function overrideTextDirection(t,Ae){let xe,Ee;(Ae==="ltr"||Ae==="rtl")&&(xe=t.canvas.style,Ee=[xe.getPropertyValue("direction"),xe.getPropertyPriority("direction")],xe.setProperty("direction",Ae,"important"),t.prevTextDirection=Ee)}function restoreTextDirection(t,Ae){Ae!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",Ae[0],Ae[1]))}function propertyFn(t){return t==="angle"?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(Ae,xe)=>Ae-xe,normalize:Ae=>Ae}}function normalizeSegment({start:t,end:Ae,count:xe,loop:Ee,style:Se}){return{start:t%xe,end:Ae%xe,loop:Ee&&(Ae-t+1)%xe===0,style:Se}}function getSegment(t,Ae,xe){const{property:Ee,start:Se,end:Ce}=xe,{between:_e,normalize:Ie}=propertyFn(Ee),Be=Ae.length;let{start:Te,end:Pe,loop:ke}=t,$e,Oe;if(ke){for(Te+=Be,Pe+=Be,$e=0,Oe=Be;$e<Oe&&_e(Ie(Ae[Te%Be][Ee]),Se,Ce);++$e)Te--,Pe--;Te%=Be,Pe%=Be}return Pe<Te&&(Pe+=Be),{start:Te,end:Pe,loop:ke,style:t.style}}function _boundSegment(t,Ae,xe){if(!xe)return[t];const{property:Ee,start:Se,end:Ce}=xe,_e=Ae.length,{compare:Ie,between:Be,normalize:Te}=propertyFn(Ee),{start:Pe,end:ke,loop:$e,style:Oe}=getSegment(t,Ae,xe),Ue=[];let qe=!1,ze=null,Ve,Ge,Xe;const er=()=>Be(Se,Xe,Ve)&&Ie(Se,Xe)!==0,tr=()=>Ie(Ce,Ve)===0||Be(Ce,Xe,Ve),nr=()=>qe||er(),sr=()=>!qe||tr();for(let dr=Pe,ar=Pe;dr<=ke;++dr)Ge=Ae[dr%_e],!Ge.skip&&(Ve=Te(Ge[Ee]),Ve!==Xe&&(qe=Be(Ve,Se,Ce),ze===null&&nr()&&(ze=Ie(Ve,Se)===0?dr:ar),ze!==null&&sr()&&(Ue.push(normalizeSegment({start:ze,end:dr,loop:$e,count:_e,style:Oe})),ze=null),ar=dr,Xe=Ve));return ze!==null&&Ue.push(normalizeSegment({start:ze,end:ke,loop:$e,count:_e,style:Oe})),Ue}function _boundSegments(t,Ae){const xe=[],Ee=t.segments;for(let Se=0;Se<Ee.length;Se++){const Ce=_boundSegment(Ee[Se],t.points,Ae);Ce.length&&xe.push(...Ce)}return xe}function findStartAndEnd(t,Ae,xe,Ee){let Se=0,Ce=Ae-1;if(xe&&!Ee)for(;Se<Ae&&!t[Se].skip;)Se++;for(;Se<Ae&&t[Se].skip;)Se++;for(Se%=Ae,xe&&(Ce+=Se);Ce>Se&&t[Ce%Ae].skip;)Ce--;return Ce%=Ae,{start:Se,end:Ce}}function solidSegments(t,Ae,xe,Ee){const Se=t.length,Ce=[];let _e=Ae,Ie=t[Ae],Be;for(Be=Ae+1;Be<=xe;++Be){const Te=t[Be%Se];Te.skip||Te.stop?Ie.skip||(Ee=!1,Ce.push({start:Ae%Se,end:(Be-1)%Se,loop:Ee}),Ae=_e=Te.stop?Be:null):(_e=Be,Ie.skip&&(Ae=Be)),Ie=Te}return _e!==null&&Ce.push({start:Ae%Se,end:_e%Se,loop:Ee}),Ce}function _computeSegments(t,Ae){const xe=t.points,Ee=t.options.spanGaps,Se=xe.length;if(!Se)return[];const Ce=!!t._loop,{start:_e,end:Ie}=findStartAndEnd(xe,Se,Ce,Ee);if(Ee===!0)return splitByStyles(t,[{start:_e,end:Ie,loop:Ce}],xe,Ae);const Be=Ie<_e?Ie+Se:Ie,Te=!!t._fullLoop&&_e===0&&Ie===Se-1;return splitByStyles(t,solidSegments(xe,_e,Be,Te),xe,Ae)}function splitByStyles(t,Ae,xe,Ee){return!Ee||!Ee.setContext||!xe?Ae:doSplitByStyles(t,Ae,xe,Ee)}function doSplitByStyles(t,Ae,xe,Ee){const Se=t._chart.getContext(),Ce=readStyle(t.options),{_datasetIndex:_e,options:{spanGaps:Ie}}=t,Be=xe.length,Te=[];let Pe=Ce,ke=Ae[0].start,$e=ke;function Oe(Ue,qe,ze,Ve){const Ge=Ie?-1:1;if(Ue!==qe){for(Ue+=Be;xe[Ue%Be].skip;)Ue-=Ge;for(;xe[qe%Be].skip;)qe+=Ge;Ue%Be!==qe%Be&&(Te.push({start:Ue%Be,end:qe%Be,loop:ze,style:Ve}),Pe=Ve,ke=qe%Be)}}for(const Ue of Ae){ke=Ie?ke:Ue.start;let qe=xe[ke%Be],ze;for($e=ke+1;$e<=Ue.end;$e++){const Ve=xe[$e%Be];ze=readStyle(Ee.setContext(createContext(Se,{type:"segment",p0:qe,p1:Ve,p0DataIndex:($e-1)%Be,p1DataIndex:$e%Be,datasetIndex:_e}))),styleChanged(ze,Pe)&&Oe(ke,$e-1,Ue.loop,Pe),qe=Ve,Pe=ze}ke<$e-1&&Oe(ke,$e-1,Ue.loop,Pe)}return Te}function readStyle(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function styleChanged(t,Ae){if(!Ae)return!1;const xe=[],Ee=function(Se,Ce){return isPatternOrGradient(Ce)?(xe.includes(Ce)||xe.push(Ce),xe.indexOf(Ce)):Ce};return JSON.stringify(t,Ee)!==JSON.stringify(Ae,Ee)}function getSizeForArea(t,Ae,xe){return t.options.clip?t[xe]:Ae[xe]}function getDatasetArea(t,Ae){const{xScale:xe,yScale:Ee}=t;return xe&&Ee?{left:getSizeForArea(xe,Ae,"left"),right:getSizeForArea(xe,Ae,"right"),top:getSizeForArea(Ee,Ae,"top"),bottom:getSizeForArea(Ee,Ae,"bottom")}:Ae}function getDatasetClipArea(t,Ae){const xe=Ae._clip;if(xe.disabled)return!1;const Ee=getDatasetArea(Ae,t.chartArea);return{left:xe.left===!1?0:Ee.left-(xe.left===!0?0:xe.left),right:xe.right===!1?t.width:Ee.right+(xe.right===!0?0:xe.right),top:xe.top===!1?0:Ee.top-(xe.top===!0?0:xe.top),bottom:xe.bottom===!1?t.height:Ee.bottom+(xe.bottom===!0?0:xe.bottom)}}/*!
594
+ * Chart.js v4.4.9
595
595
  * https://www.chartjs.org
596
596
  * (c) 2025 Chart.js Contributors
597
597
  * Released under the MIT License
598
- */class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(Ae,xe,Ee,Se){const Ce=xe.listeners[Se],_e=xe.duration;Ce.forEach(Ie=>Ie({chart:Ae,initial:xe.initial,numSteps:_e,currentStep:Math.min(Ee-xe.start,_e)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(Ae=Date.now()){let xe=0;this._charts.forEach((Ee,Se)=>{if(!Ee.running||!Ee.items.length)return;const Ce=Ee.items;let _e=Ce.length-1,Ie=!1,Be;for(;_e>=0;--_e)Be=Ce[_e],Be._active?(Be._total>Ee.duration&&(Ee.duration=Be._total),Be.tick(Ae),Ie=!0):(Ce[_e]=Ce[Ce.length-1],Ce.pop());Ie&&(Se.draw(),this._notify(Se,Ee,Ae,"progress")),Ce.length||(Ee.running=!1,this._notify(Se,Ee,Ae,"complete"),Ee.initial=!1),xe+=Ce.length}),this._lastDate=Ae,xe===0&&(this._running=!1)}_getAnims(Ae){const xe=this._charts;let Ee=xe.get(Ae);return Ee||(Ee={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},xe.set(Ae,Ee)),Ee}listen(Ae,xe,Ee){this._getAnims(Ae).listeners[xe].push(Ee)}add(Ae,xe){!xe||!xe.length||this._getAnims(Ae).items.push(...xe)}has(Ae){return this._getAnims(Ae).items.length>0}start(Ae){const xe=this._charts.get(Ae);xe&&(xe.running=!0,xe.start=Date.now(),xe.duration=xe.items.reduce((Ee,Se)=>Math.max(Ee,Se._duration),0),this._refresh())}running(Ae){if(!this._running)return!1;const xe=this._charts.get(Ae);return!(!xe||!xe.running||!xe.items.length)}stop(Ae){const xe=this._charts.get(Ae);if(!xe||!xe.items.length)return;const Ee=xe.items;let Se=Ee.length-1;for(;Se>=0;--Se)Ee[Se].cancel();xe.items=[],this._notify(Ae,xe,Date.now(),"complete")}remove(Ae){return this._charts.delete(Ae)}}var animator=new Animator;const transparent="transparent",interpolators={boolean(t,Ae,xe){return xe>.5?Ae:t},color(t,Ae,xe){const Ee=color$3(t||transparent),Se=Ee.valid&&color$3(Ae||transparent);return Se&&Se.valid?Se.mix(Ee,xe).hexString():Ae},number(t,Ae,xe){return t+(Ae-t)*xe}};class Animation{constructor(Ae,xe,Ee,Se){const Ce=xe[Ee];Se=resolve([Ae.to,Se,Ce,Ae.from]);const _e=resolve([Ae.from,Ce,Se]);this._active=!0,this._fn=Ae.fn||interpolators[Ae.type||typeof _e],this._easing=effects[Ae.easing]||effects.linear,this._start=Math.floor(Date.now()+(Ae.delay||0)),this._duration=this._total=Math.floor(Ae.duration),this._loop=!!Ae.loop,this._target=xe,this._prop=Ee,this._from=_e,this._to=Se,this._promises=void 0}active(){return this._active}update(Ae,xe,Ee){if(this._active){this._notify(!1);const Se=this._target[this._prop],Ce=Ee-this._start,_e=this._duration-Ce;this._start=Ee,this._duration=Math.floor(Math.max(_e,Ae.duration)),this._total+=Ce,this._loop=!!Ae.loop,this._to=resolve([Ae.to,xe,Se,Ae.from]),this._from=resolve([Ae.from,Se,xe])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(Ae){const xe=Ae-this._start,Ee=this._duration,Se=this._prop,Ce=this._from,_e=this._loop,Ie=this._to;let Be;if(this._active=Ce!==Ie&&(_e||xe<Ee),!this._active){this._target[Se]=Ie,this._notify(!0);return}if(xe<0){this._target[Se]=Ce;return}Be=xe/Ee%2,Be=_e&&Be>1?2-Be:Be,Be=this._easing(Math.min(1,Math.max(0,Be))),this._target[Se]=this._fn(Ce,Ie,Be)}wait(){const Ae=this._promises||(this._promises=[]);return new Promise((xe,Ee)=>{Ae.push({res:xe,rej:Ee})})}_notify(Ae){const xe=Ae?"res":"rej",Ee=this._promises||[];for(let Se=0;Se<Ee.length;Se++)Ee[Se][xe]()}}class Animations{constructor(Ae,xe){this._chart=Ae,this._properties=new Map,this.configure(xe)}configure(Ae){if(!isObject$1(Ae))return;const xe=Object.keys(defaults$1.animation),Ee=this._properties;Object.getOwnPropertyNames(Ae).forEach(Se=>{const Ce=Ae[Se];if(!isObject$1(Ce))return;const _e={};for(const Ie of xe)_e[Ie]=Ce[Ie];(isArray$2(Ce.properties)&&Ce.properties||[Se]).forEach(Ie=>{(Ie===Se||!Ee.has(Ie))&&Ee.set(Ie,_e)})})}_animateOptions(Ae,xe){const Ee=xe.options,Se=resolveTargetOptions(Ae,Ee);if(!Se)return[];const Ce=this._createAnimations(Se,Ee);return Ee.$shared&&awaitAll(Ae.options.$animations,Ee).then(()=>{Ae.options=Ee},()=>{}),Ce}_createAnimations(Ae,xe){const Ee=this._properties,Se=[],Ce=Ae.$animations||(Ae.$animations={}),_e=Object.keys(xe),Ie=Date.now();let Be;for(Be=_e.length-1;Be>=0;--Be){const Te=_e[Be];if(Te.charAt(0)==="$")continue;if(Te==="options"){Se.push(...this._animateOptions(Ae,xe));continue}const Pe=xe[Te];let ke=Ce[Te];const $e=Ee.get(Te);if(ke)if($e&&ke.active()){ke.update($e,Pe,Ie);continue}else ke.cancel();if(!$e||!$e.duration){Ae[Te]=Pe;continue}Ce[Te]=ke=new Animation($e,Ae,Te,Pe),Se.push(ke)}return Se}update(Ae,xe){if(this._properties.size===0){Object.assign(Ae,xe);return}const Ee=this._createAnimations(Ae,xe);if(Ee.length)return animator.add(this._chart,Ee),!0}}function awaitAll(t,Ae){const xe=[],Ee=Object.keys(Ae);for(let Se=0;Se<Ee.length;Se++){const Ce=t[Ee[Se]];Ce&&Ce.active()&&xe.push(Ce.wait())}return Promise.all(xe)}function resolveTargetOptions(t,Ae){if(!Ae)return;let xe=t.options;if(!xe){t.options=Ae;return}return xe.$shared&&(t.options=xe=Object.assign({},xe,{$shared:!1,$animations:{}})),xe}function scaleClip(t,Ae){const xe=t&&t.options||{},Ee=xe.reverse,Se=xe.min===void 0?Ae:0,Ce=xe.max===void 0?Ae:0;return{start:Ee?Ce:Se,end:Ee?Se:Ce}}function defaultClip(t,Ae,xe){if(xe===!1)return!1;const Ee=scaleClip(t,xe),Se=scaleClip(Ae,xe);return{top:Se.end,right:Ee.end,bottom:Se.start,left:Ee.start}}function toClip(t){let Ae,xe,Ee,Se;return isObject$1(t)?(Ae=t.top,xe=t.right,Ee=t.bottom,Se=t.left):Ae=xe=Ee=Se=t,{top:Ae,right:xe,bottom:Ee,left:Se,disabled:t===!1}}function getSortedDatasetIndices(t,Ae){const xe=[],Ee=t._getSortedDatasetMetas(Ae);let Se,Ce;for(Se=0,Ce=Ee.length;Se<Ce;++Se)xe.push(Ee[Se].index);return xe}function applyStack(t,Ae,xe,Ee={}){const Se=t.keys,Ce=Ee.mode==="single";let _e,Ie,Be,Te;if(Ae===null)return;let Pe=!1;for(_e=0,Ie=Se.length;_e<Ie;++_e){if(Be=+Se[_e],Be===xe){if(Pe=!0,Ee.all)continue;break}Te=t.values[Be],isNumberFinite(Te)&&(Ce||Ae===0||sign(Ae)===sign(Te))&&(Ae+=Te)}return!Pe&&!Ee.all?0:Ae}function convertObjectDataToArray(t,Ae){const{iScale:xe,vScale:Ee}=Ae,Se=xe.axis==="x"?"x":"y",Ce=Ee.axis==="x"?"x":"y",_e=Object.keys(t),Ie=new Array(_e.length);let Be,Te,Pe;for(Be=0,Te=_e.length;Be<Te;++Be)Pe=_e[Be],Ie[Be]={[Se]:Pe,[Ce]:t[Pe]};return Ie}function isStacked(t,Ae){const xe=t&&t.options.stacked;return xe||xe===void 0&&Ae.stack!==void 0}function getStackKey(t,Ae,xe){return`${t.id}.${Ae.id}.${xe.stack||xe.type}`}function getUserBounds(t){const{min:Ae,max:xe,minDefined:Ee,maxDefined:Se}=t.getUserBounds();return{min:Ee?Ae:Number.NEGATIVE_INFINITY,max:Se?xe:Number.POSITIVE_INFINITY}}function getOrCreateStack(t,Ae,xe){const Ee=t[Ae]||(t[Ae]={});return Ee[xe]||(Ee[xe]={})}function getLastIndexInStack(t,Ae,xe,Ee){for(const Se of Ae.getMatchingVisibleMetas(Ee).reverse()){const Ce=t[Se.index];if(xe&&Ce>0||!xe&&Ce<0)return Se.index}return null}function updateStacks(t,Ae){const{chart:xe,_cachedMeta:Ee}=t,Se=xe._stacks||(xe._stacks={}),{iScale:Ce,vScale:_e,index:Ie}=Ee,Be=Ce.axis,Te=_e.axis,Pe=getStackKey(Ce,_e,Ee),ke=Ae.length;let $e;for(let Oe=0;Oe<ke;++Oe){const Ue=Ae[Oe],{[Be]:qe,[Te]:ze}=Ue,Ve=Ue._stacks||(Ue._stacks={});$e=Ve[Te]=getOrCreateStack(Se,Pe,qe),$e[Ie]=ze,$e._top=getLastIndexInStack($e,_e,!0,Ee.type),$e._bottom=getLastIndexInStack($e,_e,!1,Ee.type);const Ge=$e._visualValues||($e._visualValues={});Ge[Ie]=ze}}function getFirstScaleId(t,Ae){const xe=t.scales;return Object.keys(xe).filter(Ee=>xe[Ee].axis===Ae).shift()}function createDatasetContext(t,Ae){return createContext(t,{active:!1,dataset:void 0,datasetIndex:Ae,index:Ae,mode:"default",type:"dataset"})}function createDataContext(t,Ae,xe){return createContext(t,{active:!1,dataIndex:Ae,parsed:void 0,raw:void 0,element:xe,index:Ae,mode:"default",type:"data"})}function clearStacks(t,Ae){const xe=t.controller.index,Ee=t.vScale&&t.vScale.axis;if(Ee){Ae=Ae||t._parsed;for(const Se of Ae){const Ce=Se._stacks;if(!Ce||Ce[Ee]===void 0||Ce[Ee][xe]===void 0)return;delete Ce[Ee][xe],Ce[Ee]._visualValues!==void 0&&Ce[Ee]._visualValues[xe]!==void 0&&delete Ce[Ee]._visualValues[xe]}}}const isDirectUpdateMode=t=>t==="reset"||t==="none",cloneIfNotShared=(t,Ae)=>Ae?t:Object.assign({},t),createStack=(t,Ae,xe)=>t&&!Ae.hidden&&Ae._stacked&&{keys:getSortedDatasetIndices(xe,!0),values:null};class DatasetController{constructor(Ae,xe){this.chart=Ae,this._ctx=Ae.ctx,this.index=xe,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const Ae=this._cachedMeta;this.configure(),this.linkScales(),Ae._stacked=isStacked(Ae.vScale,Ae),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(Ae){this.index!==Ae&&clearStacks(this._cachedMeta),this.index=Ae}linkScales(){const Ae=this.chart,xe=this._cachedMeta,Ee=this.getDataset(),Se=(ke,$e,Oe,Ue)=>ke==="x"?$e:ke==="r"?Ue:Oe,Ce=xe.xAxisID=valueOrDefault(Ee.xAxisID,getFirstScaleId(Ae,"x")),_e=xe.yAxisID=valueOrDefault(Ee.yAxisID,getFirstScaleId(Ae,"y")),Ie=xe.rAxisID=valueOrDefault(Ee.rAxisID,getFirstScaleId(Ae,"r")),Be=xe.indexAxis,Te=xe.iAxisID=Se(Be,Ce,_e,Ie),Pe=xe.vAxisID=Se(Be,_e,Ce,Ie);xe.xScale=this.getScaleForId(Ce),xe.yScale=this.getScaleForId(_e),xe.rScale=this.getScaleForId(Ie),xe.iScale=this.getScaleForId(Te),xe.vScale=this.getScaleForId(Pe)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(Ae){return this.chart.scales[Ae]}_getOtherScale(Ae){const xe=this._cachedMeta;return Ae===xe.iScale?xe.vScale:xe.iScale}reset(){this._update("reset")}_destroy(){const Ae=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),Ae._stacked&&clearStacks(Ae)}_dataCheck(){const Ae=this.getDataset(),xe=Ae.data||(Ae.data=[]),Ee=this._data;if(isObject$1(xe)){const Se=this._cachedMeta;this._data=convertObjectDataToArray(xe,Se)}else if(Ee!==xe){if(Ee){unlistenArrayEvents(Ee,this);const Se=this._cachedMeta;clearStacks(Se),Se._parsed=[]}xe&&Object.isExtensible(xe)&&listenArrayEvents(xe,this),this._syncList=[],this._data=xe}}addElements(){const Ae=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(Ae.dataset=new this.datasetElementType)}buildOrUpdateElements(Ae){const xe=this._cachedMeta,Ee=this.getDataset();let Se=!1;this._dataCheck();const Ce=xe._stacked;xe._stacked=isStacked(xe.vScale,xe),xe.stack!==Ee.stack&&(Se=!0,clearStacks(xe),xe.stack=Ee.stack),this._resyncElements(Ae),(Se||Ce!==xe._stacked)&&(updateStacks(this,xe._parsed),xe._stacked=isStacked(xe.vScale,xe))}configure(){const Ae=this.chart.config,xe=Ae.datasetScopeKeys(this._type),Ee=Ae.getOptionScopes(this.getDataset(),xe,!0);this.options=Ae.createResolver(Ee,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(Ae,xe){const{_cachedMeta:Ee,_data:Se}=this,{iScale:Ce,_stacked:_e}=Ee,Ie=Ce.axis;let Be=Ae===0&&xe===Se.length?!0:Ee._sorted,Te=Ae>0&&Ee._parsed[Ae-1],Pe,ke,$e;if(this._parsing===!1)Ee._parsed=Se,Ee._sorted=!0,$e=Se;else{isArray$2(Se[Ae])?$e=this.parseArrayData(Ee,Se,Ae,xe):isObject$1(Se[Ae])?$e=this.parseObjectData(Ee,Se,Ae,xe):$e=this.parsePrimitiveData(Ee,Se,Ae,xe);const Oe=()=>ke[Ie]===null||Te&&ke[Ie]<Te[Ie];for(Pe=0;Pe<xe;++Pe)Ee._parsed[Pe+Ae]=ke=$e[Pe],Be&&(Oe()&&(Be=!1),Te=ke);Ee._sorted=Be}_e&&updateStacks(this,$e)}parsePrimitiveData(Ae,xe,Ee,Se){const{iScale:Ce,vScale:_e}=Ae,Ie=Ce.axis,Be=_e.axis,Te=Ce.getLabels(),Pe=Ce===_e,ke=new Array(Se);let $e,Oe,Ue;for($e=0,Oe=Se;$e<Oe;++$e)Ue=$e+Ee,ke[$e]={[Ie]:Pe||Ce.parse(Te[Ue],Ue),[Be]:_e.parse(xe[Ue],Ue)};return ke}parseArrayData(Ae,xe,Ee,Se){const{xScale:Ce,yScale:_e}=Ae,Ie=new Array(Se);let Be,Te,Pe,ke;for(Be=0,Te=Se;Be<Te;++Be)Pe=Be+Ee,ke=xe[Pe],Ie[Be]={x:Ce.parse(ke[0],Pe),y:_e.parse(ke[1],Pe)};return Ie}parseObjectData(Ae,xe,Ee,Se){const{xScale:Ce,yScale:_e}=Ae,{xAxisKey:Ie="x",yAxisKey:Be="y"}=this._parsing,Te=new Array(Se);let Pe,ke,$e,Oe;for(Pe=0,ke=Se;Pe<ke;++Pe)$e=Pe+Ee,Oe=xe[$e],Te[Pe]={x:Ce.parse(resolveObjectKey(Oe,Ie),$e),y:_e.parse(resolveObjectKey(Oe,Be),$e)};return Te}getParsed(Ae){return this._cachedMeta._parsed[Ae]}getDataElement(Ae){return this._cachedMeta.data[Ae]}applyStack(Ae,xe,Ee){const Se=this.chart,Ce=this._cachedMeta,_e=xe[Ae.axis],Ie={keys:getSortedDatasetIndices(Se,!0),values:xe._stacks[Ae.axis]._visualValues};return applyStack(Ie,_e,Ce.index,{mode:Ee})}updateRangeFromParsed(Ae,xe,Ee,Se){const Ce=Ee[xe.axis];let _e=Ce===null?NaN:Ce;const Ie=Se&&Ee._stacks[xe.axis];Se&&Ie&&(Se.values=Ie,_e=applyStack(Se,Ce,this._cachedMeta.index)),Ae.min=Math.min(Ae.min,_e),Ae.max=Math.max(Ae.max,_e)}getMinMax(Ae,xe){const Ee=this._cachedMeta,Se=Ee._parsed,Ce=Ee._sorted&&Ae===Ee.iScale,_e=Se.length,Ie=this._getOtherScale(Ae),Be=createStack(xe,Ee,this.chart),Te={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:Pe,max:ke}=getUserBounds(Ie);let $e,Oe;function Ue(){Oe=Se[$e];const qe=Oe[Ie.axis];return!isNumberFinite(Oe[Ae.axis])||Pe>qe||ke<qe}for($e=0;$e<_e&&!(!Ue()&&(this.updateRangeFromParsed(Te,Ae,Oe,Be),Ce));++$e);if(Ce){for($e=_e-1;$e>=0;--$e)if(!Ue()){this.updateRangeFromParsed(Te,Ae,Oe,Be);break}}return Te}getAllParsedValues(Ae){const xe=this._cachedMeta._parsed,Ee=[];let Se,Ce,_e;for(Se=0,Ce=xe.length;Se<Ce;++Se)_e=xe[Se][Ae.axis],isNumberFinite(_e)&&Ee.push(_e);return Ee}getMaxOverflow(){return!1}getLabelAndValue(Ae){const xe=this._cachedMeta,Ee=xe.iScale,Se=xe.vScale,Ce=this.getParsed(Ae);return{label:Ee?""+Ee.getLabelForValue(Ce[Ee.axis]):"",value:Se?""+Se.getLabelForValue(Ce[Se.axis]):""}}_update(Ae){const xe=this._cachedMeta;this.update(Ae||"default"),xe._clip=toClip(valueOrDefault(this.options.clip,defaultClip(xe.xScale,xe.yScale,this.getMaxOverflow())))}update(Ae){}draw(){const Ae=this._ctx,xe=this.chart,Ee=this._cachedMeta,Se=Ee.data||[],Ce=xe.chartArea,_e=[],Ie=this._drawStart||0,Be=this._drawCount||Se.length-Ie,Te=this.options.drawActiveElementsOnTop;let Pe;for(Ee.dataset&&Ee.dataset.draw(Ae,Ce,Ie,Be),Pe=Ie;Pe<Ie+Be;++Pe){const ke=Se[Pe];ke.hidden||(ke.active&&Te?_e.push(ke):ke.draw(Ae,Ce))}for(Pe=0;Pe<_e.length;++Pe)_e[Pe].draw(Ae,Ce)}getStyle(Ae,xe){const Ee=xe?"active":"default";return Ae===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(Ee):this.resolveDataElementOptions(Ae||0,Ee)}getContext(Ae,xe,Ee){const Se=this.getDataset();let Ce;if(Ae>=0&&Ae<this._cachedMeta.data.length){const _e=this._cachedMeta.data[Ae];Ce=_e.$context||(_e.$context=createDataContext(this.getContext(),Ae,_e)),Ce.parsed=this.getParsed(Ae),Ce.raw=Se.data[Ae],Ce.index=Ce.dataIndex=Ae}else Ce=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),Ce.dataset=Se,Ce.index=Ce.datasetIndex=this.index;return Ce.active=!!xe,Ce.mode=Ee,Ce}resolveDatasetElementOptions(Ae){return this._resolveElementOptions(this.datasetElementType.id,Ae)}resolveDataElementOptions(Ae,xe){return this._resolveElementOptions(this.dataElementType.id,xe,Ae)}_resolveElementOptions(Ae,xe="default",Ee){const Se=xe==="active",Ce=this._cachedDataOpts,_e=Ae+"-"+xe,Ie=Ce[_e],Be=this.enableOptionSharing&&defined(Ee);if(Ie)return cloneIfNotShared(Ie,Be);const Te=this.chart.config,Pe=Te.datasetElementScopeKeys(this._type,Ae),ke=Se?[`${Ae}Hover`,"hover",Ae,""]:[Ae,""],$e=Te.getOptionScopes(this.getDataset(),Pe),Oe=Object.keys(defaults$1.elements[Ae]),Ue=()=>this.getContext(Ee,Se,xe),qe=Te.resolveNamedOptions($e,Oe,Ue,ke);return qe.$shared&&(qe.$shared=Be,Ce[_e]=Object.freeze(cloneIfNotShared(qe,Be))),qe}_resolveAnimations(Ae,xe,Ee){const Se=this.chart,Ce=this._cachedDataOpts,_e=`animation-${xe}`,Ie=Ce[_e];if(Ie)return Ie;let Be;if(Se.options.animation!==!1){const Pe=this.chart.config,ke=Pe.datasetAnimationScopeKeys(this._type,xe),$e=Pe.getOptionScopes(this.getDataset(),ke);Be=Pe.createResolver($e,this.getContext(Ae,Ee,xe))}const Te=new Animations(Se,Be&&Be.animations);return Be&&Be._cacheable&&(Ce[_e]=Object.freeze(Te)),Te}getSharedOptions(Ae){if(Ae.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},Ae))}includeOptions(Ae,xe){return!xe||isDirectUpdateMode(Ae)||this.chart._animationsDisabled}_getSharedOptions(Ae,xe){const Ee=this.resolveDataElementOptions(Ae,xe),Se=this._sharedOptions,Ce=this.getSharedOptions(Ee),_e=this.includeOptions(xe,Ce)||Ce!==Se;return this.updateSharedOptions(Ce,xe,Ee),{sharedOptions:Ce,includeOptions:_e}}updateElement(Ae,xe,Ee,Se){isDirectUpdateMode(Se)?Object.assign(Ae,Ee):this._resolveAnimations(xe,Se).update(Ae,Ee)}updateSharedOptions(Ae,xe,Ee){Ae&&!isDirectUpdateMode(xe)&&this._resolveAnimations(void 0,xe).update(Ae,Ee)}_setStyle(Ae,xe,Ee,Se){Ae.active=Se;const Ce=this.getStyle(xe,Se);this._resolveAnimations(xe,Ee,Se).update(Ae,{options:!Se&&this.getSharedOptions(Ce)||Ce})}removeHoverStyle(Ae,xe,Ee){this._setStyle(Ae,Ee,"active",!1)}setHoverStyle(Ae,xe,Ee){this._setStyle(Ae,Ee,"active",!0)}_removeDatasetHoverStyle(){const Ae=this._cachedMeta.dataset;Ae&&this._setStyle(Ae,void 0,"active",!1)}_setDatasetHoverStyle(){const Ae=this._cachedMeta.dataset;Ae&&this._setStyle(Ae,void 0,"active",!0)}_resyncElements(Ae){const xe=this._data,Ee=this._cachedMeta.data;for(const[Ie,Be,Te]of this._syncList)this[Ie](Be,Te);this._syncList=[];const Se=Ee.length,Ce=xe.length,_e=Math.min(Ce,Se);_e&&this.parse(0,_e),Ce>Se?this._insertElements(Se,Ce-Se,Ae):Ce<Se&&this._removeElements(Ce,Se-Ce)}_insertElements(Ae,xe,Ee=!0){const Se=this._cachedMeta,Ce=Se.data,_e=Ae+xe;let Ie;const Be=Te=>{for(Te.length+=xe,Ie=Te.length-1;Ie>=_e;Ie--)Te[Ie]=Te[Ie-xe]};for(Be(Ce),Ie=Ae;Ie<_e;++Ie)Ce[Ie]=new this.dataElementType;this._parsing&&Be(Se._parsed),this.parse(Ae,xe),Ee&&this.updateElements(Ce,Ae,xe,"reset")}updateElements(Ae,xe,Ee,Se){}_removeElements(Ae,xe){const Ee=this._cachedMeta;if(this._parsing){const Se=Ee._parsed.splice(Ae,xe);Ee._stacked&&clearStacks(Ee,Se)}Ee.data.splice(Ae,xe)}_sync(Ae){if(this._parsing)this._syncList.push(Ae);else{const[xe,Ee,Se]=Ae;this[xe](Ee,Se)}this.chart._dataChanges.push([this.index,...Ae])}_onDataPush(){const Ae=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-Ae,Ae])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(Ae,xe){xe&&this._sync(["_removeElements",Ae,xe]);const Ee=arguments.length-2;Ee&&this._sync(["_insertElements",Ae,Ee])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}$i(DatasetController,"defaults",{}),$i(DatasetController,"datasetElementType",null),$i(DatasetController,"dataElementType",null);function getAllScaleValues(t,Ae){if(!t._cache.$bar){const xe=t.getMatchingVisibleMetas(Ae);let Ee=[];for(let Se=0,Ce=xe.length;Se<Ce;Se++)Ee=Ee.concat(xe[Se].controller.getAllParsedValues(t));t._cache.$bar=_arrayUnique(Ee.sort((Se,Ce)=>Se-Ce))}return t._cache.$bar}function computeMinSampleSize(t){const Ae=t.iScale,xe=getAllScaleValues(Ae,t.type);let Ee=Ae._length,Se,Ce,_e,Ie;const Be=()=>{_e===32767||_e===-32768||(defined(Ie)&&(Ee=Math.min(Ee,Math.abs(_e-Ie)||Ee)),Ie=_e)};for(Se=0,Ce=xe.length;Se<Ce;++Se)_e=Ae.getPixelForValue(xe[Se]),Be();for(Ie=void 0,Se=0,Ce=Ae.ticks.length;Se<Ce;++Se)_e=Ae.getPixelForTick(Se),Be();return Ee}function computeFitCategoryTraits(t,Ae,xe,Ee){const Se=xe.barThickness;let Ce,_e;return isNullOrUndef(Se)?(Ce=Ae.min*xe.categoryPercentage,_e=xe.barPercentage):(Ce=Se*Ee,_e=1),{chunk:Ce/Ee,ratio:_e,start:Ae.pixels[t]-Ce/2}}function computeFlexCategoryTraits(t,Ae,xe,Ee){const Se=Ae.pixels,Ce=Se[t];let _e=t>0?Se[t-1]:null,Ie=t<Se.length-1?Se[t+1]:null;const Be=xe.categoryPercentage;_e===null&&(_e=Ce-(Ie===null?Ae.end-Ae.start:Ie-Ce)),Ie===null&&(Ie=Ce+Ce-_e);const Te=Ce-(Ce-Math.min(_e,Ie))/2*Be;return{chunk:Math.abs(Ie-_e)/2*Be/Ee,ratio:xe.barPercentage,start:Te}}function parseFloatBar(t,Ae,xe,Ee){const Se=xe.parse(t[0],Ee),Ce=xe.parse(t[1],Ee),_e=Math.min(Se,Ce),Ie=Math.max(Se,Ce);let Be=_e,Te=Ie;Math.abs(_e)>Math.abs(Ie)&&(Be=Ie,Te=_e),Ae[xe.axis]=Te,Ae._custom={barStart:Be,barEnd:Te,start:Se,end:Ce,min:_e,max:Ie}}function parseValue(t,Ae,xe,Ee){return isArray$2(t)?parseFloatBar(t,Ae,xe,Ee):Ae[xe.axis]=xe.parse(t,Ee),Ae}function parseArrayOrPrimitive(t,Ae,xe,Ee){const Se=t.iScale,Ce=t.vScale,_e=Se.getLabels(),Ie=Se===Ce,Be=[];let Te,Pe,ke,$e;for(Te=xe,Pe=xe+Ee;Te<Pe;++Te)$e=Ae[Te],ke={},ke[Se.axis]=Ie||Se.parse(_e[Te],Te),Be.push(parseValue($e,ke,Ce,Te));return Be}function isFloatBar(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function barSign(t,Ae,xe){return t!==0?sign(t):(Ae.isHorizontal()?1:-1)*(Ae.min>=xe?1:-1)}function borderProps(t){let Ae,xe,Ee,Se,Ce;return t.horizontal?(Ae=t.base>t.x,xe="left",Ee="right"):(Ae=t.base<t.y,xe="bottom",Ee="top"),Ae?(Se="end",Ce="start"):(Se="start",Ce="end"),{start:xe,end:Ee,reverse:Ae,top:Se,bottom:Ce}}function setBorderSkipped(t,Ae,xe,Ee){let Se=Ae.borderSkipped;const Ce={};if(!Se){t.borderSkipped=Ce;return}if(Se===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:_e,end:Ie,reverse:Be,top:Te,bottom:Pe}=borderProps(t);Se==="middle"&&xe&&(t.enableBorderRadius=!0,(xe._top||0)===Ee?Se=Te:(xe._bottom||0)===Ee?Se=Pe:(Ce[parseEdge(Pe,_e,Ie,Be)]=!0,Se=Te)),Ce[parseEdge(Se,_e,Ie,Be)]=!0,t.borderSkipped=Ce}function parseEdge(t,Ae,xe,Ee){return Ee?(t=swap$1(t,Ae,xe),t=startEnd(t,xe,Ae)):t=startEnd(t,Ae,xe),t}function swap$1(t,Ae,xe){return t===Ae?xe:t===xe?Ae:t}function startEnd(t,Ae,xe){return t==="start"?Ae:t==="end"?xe:t}function setInflateAmount(t,{inflateAmount:Ae},xe){t.inflateAmount=Ae==="auto"?xe===1?.33:0:Ae}class BarController extends DatasetController{parsePrimitiveData(Ae,xe,Ee,Se){return parseArrayOrPrimitive(Ae,xe,Ee,Se)}parseArrayData(Ae,xe,Ee,Se){return parseArrayOrPrimitive(Ae,xe,Ee,Se)}parseObjectData(Ae,xe,Ee,Se){const{iScale:Ce,vScale:_e}=Ae,{xAxisKey:Ie="x",yAxisKey:Be="y"}=this._parsing,Te=Ce.axis==="x"?Ie:Be,Pe=_e.axis==="x"?Ie:Be,ke=[];let $e,Oe,Ue,qe;for($e=Ee,Oe=Ee+Se;$e<Oe;++$e)qe=xe[$e],Ue={},Ue[Ce.axis]=Ce.parse(resolveObjectKey(qe,Te),$e),ke.push(parseValue(resolveObjectKey(qe,Pe),Ue,_e,$e));return ke}updateRangeFromParsed(Ae,xe,Ee,Se){super.updateRangeFromParsed(Ae,xe,Ee,Se);const Ce=Ee._custom;Ce&&xe===this._cachedMeta.vScale&&(Ae.min=Math.min(Ae.min,Ce.min),Ae.max=Math.max(Ae.max,Ce.max))}getMaxOverflow(){return 0}getLabelAndValue(Ae){const xe=this._cachedMeta,{iScale:Ee,vScale:Se}=xe,Ce=this.getParsed(Ae),_e=Ce._custom,Ie=isFloatBar(_e)?"["+_e.start+", "+_e.end+"]":""+Se.getLabelForValue(Ce[Se.axis]);return{label:""+Ee.getLabelForValue(Ce[Ee.axis]),value:Ie}}initialize(){this.enableOptionSharing=!0,super.initialize();const Ae=this._cachedMeta;Ae.stack=this.getDataset().stack}update(Ae){const xe=this._cachedMeta;this.updateElements(xe.data,0,xe.data.length,Ae)}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",{index:_e,_cachedMeta:{vScale:Ie}}=this,Be=Ie.getBasePixel(),Te=Ie.isHorizontal(),Pe=this._getRuler(),{sharedOptions:ke,includeOptions:$e}=this._getSharedOptions(xe,Se);for(let Oe=xe;Oe<xe+Ee;Oe++){const Ue=this.getParsed(Oe),qe=Ce||isNullOrUndef(Ue[Ie.axis])?{base:Be,head:Be}:this._calculateBarValuePixels(Oe),ze=this._calculateBarIndexPixels(Oe,Pe),Ve=(Ue._stacks||{})[Ie.axis],Ge={horizontal:Te,base:qe.base,enableBorderRadius:!Ve||isFloatBar(Ue._custom)||_e===Ve._top||_e===Ve._bottom,x:Te?qe.head:ze.center,y:Te?ze.center:qe.head,height:Te?ze.size:Math.abs(qe.size),width:Te?Math.abs(qe.size):ze.size};$e&&(Ge.options=ke||this.resolveDataElementOptions(Oe,Ae[Oe].active?"active":Se));const Xe=Ge.options||Ae[Oe].options;setBorderSkipped(Ge,Xe,Ve,_e),setInflateAmount(Ge,Xe,Pe.ratio),this.updateElement(Ae[Oe],Oe,Ge,Se)}}_getStacks(Ae,xe){const{iScale:Ee}=this._cachedMeta,Se=Ee.getMatchingVisibleMetas(this._type).filter(Pe=>Pe.controller.options.grouped),Ce=Ee.options.stacked,_e=[],Ie=this._cachedMeta.controller.getParsed(xe),Be=Ie&&Ie[Ee.axis],Te=Pe=>{const ke=Pe._parsed.find(Oe=>Oe[Ee.axis]===Be),$e=ke&&ke[Pe.vScale.axis];if(isNullOrUndef($e)||isNaN($e))return!0};for(const Pe of Se)if(!(xe!==void 0&&Te(Pe))&&((Ce===!1||_e.indexOf(Pe.stack)===-1||Ce===void 0&&Pe.stack===void 0)&&_e.push(Pe.stack),Pe.index===Ae))break;return _e.length||_e.push(void 0),_e}_getStackCount(Ae){return this._getStacks(void 0,Ae).length}_getStackIndex(Ae,xe,Ee){const Se=this._getStacks(Ae,Ee),Ce=xe!==void 0?Se.indexOf(xe):-1;return Ce===-1?Se.length-1:Ce}_getRuler(){const Ae=this.options,xe=this._cachedMeta,Ee=xe.iScale,Se=[];let Ce,_e;for(Ce=0,_e=xe.data.length;Ce<_e;++Ce)Se.push(Ee.getPixelForValue(this.getParsed(Ce)[Ee.axis],Ce));const Ie=Ae.barThickness;return{min:Ie||computeMinSampleSize(xe),pixels:Se,start:Ee._startPixel,end:Ee._endPixel,stackCount:this._getStackCount(),scale:Ee,grouped:Ae.grouped,ratio:Ie?1:Ae.categoryPercentage*Ae.barPercentage}}_calculateBarValuePixels(Ae){const{_cachedMeta:{vScale:xe,_stacked:Ee,index:Se},options:{base:Ce,minBarLength:_e}}=this,Ie=Ce||0,Be=this.getParsed(Ae),Te=Be._custom,Pe=isFloatBar(Te);let ke=Be[xe.axis],$e=0,Oe=Ee?this.applyStack(xe,Be,Ee):ke,Ue,qe;Oe!==ke&&($e=Oe-ke,Oe=ke),Pe&&(ke=Te.barStart,Oe=Te.barEnd-Te.barStart,ke!==0&&sign(ke)!==sign(Te.barEnd)&&($e=0),$e+=ke);const ze=!isNullOrUndef(Ce)&&!Pe?Ce:$e;let Ve=xe.getPixelForValue(ze);if(this.chart.getDataVisibility(Ae)?Ue=xe.getPixelForValue($e+Oe):Ue=Ve,qe=Ue-Ve,Math.abs(qe)<_e){qe=barSign(qe,xe,Ie)*_e,ke===Ie&&(Ve-=qe/2);const Ge=xe.getPixelForDecimal(0),Xe=xe.getPixelForDecimal(1),er=Math.min(Ge,Xe),tr=Math.max(Ge,Xe);Ve=Math.max(Math.min(Ve,tr),er),Ue=Ve+qe,Ee&&!Pe&&(Be._stacks[xe.axis]._visualValues[Se]=xe.getValueForPixel(Ue)-xe.getValueForPixel(Ve))}if(Ve===xe.getPixelForValue(Ie)){const Ge=sign(qe)*xe.getLineWidthForValue(Ie)/2;Ve+=Ge,qe-=Ge}return{size:qe,base:Ve,head:Ue,center:Ue+qe/2}}_calculateBarIndexPixels(Ae,xe){const Ee=xe.scale,Se=this.options,Ce=Se.skipNull,_e=valueOrDefault(Se.maxBarThickness,1/0);let Ie,Be;if(xe.grouped){const Te=Ce?this._getStackCount(Ae):xe.stackCount,Pe=Se.barThickness==="flex"?computeFlexCategoryTraits(Ae,xe,Se,Te):computeFitCategoryTraits(Ae,xe,Se,Te),ke=this._getStackIndex(this.index,this._cachedMeta.stack,Ce?Ae:void 0);Ie=Pe.start+Pe.chunk*ke+Pe.chunk/2,Be=Math.min(_e,Pe.chunk*Pe.ratio)}else Ie=Ee.getPixelForValue(this.getParsed(Ae)[Ee.axis],Ae),Be=Math.min(_e,xe.min*xe.ratio);return{base:Ie-Be/2,head:Ie+Be/2,center:Ie,size:Be}}draw(){const Ae=this._cachedMeta,xe=Ae.vScale,Ee=Ae.data,Se=Ee.length;let Ce=0;for(;Ce<Se;++Ce)this.getParsed(Ce)[xe.axis]!==null&&!Ee[Ce].hidden&&Ee[Ce].draw(this._ctx)}}$i(BarController,"id","bar"),$i(BarController,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),$i(BarController,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function getRatioAndOffset(t,Ae,xe){let Ee=1,Se=1,Ce=0,_e=0;if(Ae<TAU){const Ie=t,Be=Ie+Ae,Te=Math.cos(Ie),Pe=Math.sin(Ie),ke=Math.cos(Be),$e=Math.sin(Be),Oe=(Xe,er,tr)=>_angleBetween(Xe,Ie,Be,!0)?1:Math.max(er,er*xe,tr,tr*xe),Ue=(Xe,er,tr)=>_angleBetween(Xe,Ie,Be,!0)?-1:Math.min(er,er*xe,tr,tr*xe),qe=Oe(0,Te,ke),ze=Oe(HALF_PI,Pe,$e),Ve=Ue(PI,Te,ke),Ge=Ue(PI+HALF_PI,Pe,$e);Ee=(qe-Ve)/2,Se=(ze-Ge)/2,Ce=-(qe+Ve)/2,_e=-(ze+Ge)/2}return{ratioX:Ee,ratioY:Se,offsetX:Ce,offsetY:_e}}class DoughnutController extends DatasetController{constructor(Ae,xe){super(Ae,xe),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(Ae,xe){const Ee=this.getDataset().data,Se=this._cachedMeta;if(this._parsing===!1)Se._parsed=Ee;else{let Ce=Be=>+Ee[Be];if(isObject$1(Ee[Ae])){const{key:Be="value"}=this._parsing;Ce=Te=>+resolveObjectKey(Ee[Te],Be)}let _e,Ie;for(_e=Ae,Ie=Ae+xe;_e<Ie;++_e)Se._parsed[_e]=Ce(_e)}}_getRotation(){return toRadians(this.options.rotation-90)}_getCircumference(){return toRadians(this.options.circumference)}_getRotationExtents(){let Ae=TAU,xe=-TAU;for(let Ee=0;Ee<this.chart.data.datasets.length;++Ee)if(this.chart.isDatasetVisible(Ee)&&this.chart.getDatasetMeta(Ee).type===this._type){const Se=this.chart.getDatasetMeta(Ee).controller,Ce=Se._getRotation(),_e=Se._getCircumference();Ae=Math.min(Ae,Ce),xe=Math.max(xe,Ce+_e)}return{rotation:Ae,circumference:xe-Ae}}update(Ae){const xe=this.chart,{chartArea:Ee}=xe,Se=this._cachedMeta,Ce=Se.data,_e=this.getMaxBorderWidth()+this.getMaxOffset(Ce)+this.options.spacing,Ie=Math.max((Math.min(Ee.width,Ee.height)-_e)/2,0),Be=Math.min(toPercentage(this.options.cutout,Ie),1),Te=this._getRingWeight(this.index),{circumference:Pe,rotation:ke}=this._getRotationExtents(),{ratioX:$e,ratioY:Oe,offsetX:Ue,offsetY:qe}=getRatioAndOffset(ke,Pe,Be),ze=(Ee.width-_e)/$e,Ve=(Ee.height-_e)/Oe,Ge=Math.max(Math.min(ze,Ve)/2,0),Xe=toDimension(this.options.radius,Ge),er=Math.max(Xe*Be,0),tr=(Xe-er)/this._getVisibleDatasetWeightTotal();this.offsetX=Ue*Xe,this.offsetY=qe*Xe,Se.total=this.calculateTotal(),this.outerRadius=Xe-tr*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-tr*Te,0),this.updateElements(Ce,0,Ce.length,Ae)}_circumference(Ae,xe){const Ee=this.options,Se=this._cachedMeta,Ce=this._getCircumference();return xe&&Ee.animation.animateRotate||!this.chart.getDataVisibility(Ae)||Se._parsed[Ae]===null||Se.data[Ae].hidden?0:this.calculateCircumference(Se._parsed[Ae]*Ce/TAU)}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",_e=this.chart,Ie=_e.chartArea,Te=_e.options.animation,Pe=(Ie.left+Ie.right)/2,ke=(Ie.top+Ie.bottom)/2,$e=Ce&&Te.animateScale,Oe=$e?0:this.innerRadius,Ue=$e?0:this.outerRadius,{sharedOptions:qe,includeOptions:ze}=this._getSharedOptions(xe,Se);let Ve=this._getRotation(),Ge;for(Ge=0;Ge<xe;++Ge)Ve+=this._circumference(Ge,Ce);for(Ge=xe;Ge<xe+Ee;++Ge){const Xe=this._circumference(Ge,Ce),er=Ae[Ge],tr={x:Pe+this.offsetX,y:ke+this.offsetY,startAngle:Ve,endAngle:Ve+Xe,circumference:Xe,outerRadius:Ue,innerRadius:Oe};ze&&(tr.options=qe||this.resolveDataElementOptions(Ge,er.active?"active":Se)),Ve+=Xe,this.updateElement(er,Ge,tr,Se)}}calculateTotal(){const Ae=this._cachedMeta,xe=Ae.data;let Ee=0,Se;for(Se=0;Se<xe.length;Se++){const Ce=Ae._parsed[Se];Ce!==null&&!isNaN(Ce)&&this.chart.getDataVisibility(Se)&&!xe[Se].hidden&&(Ee+=Math.abs(Ce))}return Ee}calculateCircumference(Ae){const xe=this._cachedMeta.total;return xe>0&&!isNaN(Ae)?TAU*(Math.abs(Ae)/xe):0}getLabelAndValue(Ae){const xe=this._cachedMeta,Ee=this.chart,Se=Ee.data.labels||[],Ce=formatNumber(xe._parsed[Ae],Ee.options.locale);return{label:Se[Ae]||"",value:Ce}}getMaxBorderWidth(Ae){let xe=0;const Ee=this.chart;let Se,Ce,_e,Ie,Be;if(!Ae){for(Se=0,Ce=Ee.data.datasets.length;Se<Ce;++Se)if(Ee.isDatasetVisible(Se)){_e=Ee.getDatasetMeta(Se),Ae=_e.data,Ie=_e.controller;break}}if(!Ae)return 0;for(Se=0,Ce=Ae.length;Se<Ce;++Se)Be=Ie.resolveDataElementOptions(Se),Be.borderAlign!=="inner"&&(xe=Math.max(xe,Be.borderWidth||0,Be.hoverBorderWidth||0));return xe}getMaxOffset(Ae){let xe=0;for(let Ee=0,Se=Ae.length;Ee<Se;++Ee){const Ce=this.resolveDataElementOptions(Ee);xe=Math.max(xe,Ce.offset||0,Ce.hoverOffset||0)}return xe}_getRingWeightOffset(Ae){let xe=0;for(let Ee=0;Ee<Ae;++Ee)this.chart.isDatasetVisible(Ee)&&(xe+=this._getRingWeight(Ee));return xe}_getRingWeight(Ae){return Math.max(valueOrDefault(this.chart.data.datasets[Ae].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}$i(DoughnutController,"id","doughnut"),$i(DoughnutController,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),$i(DoughnutController,"descriptors",{_scriptable:Ae=>Ae!=="spacing",_indexable:Ae=>Ae!=="spacing"&&!Ae.startsWith("borderDash")&&!Ae.startsWith("hoverBorderDash")}),$i(DoughnutController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(Ae){const xe=Ae.data;if(xe.labels.length&&xe.datasets.length){const{labels:{pointStyle:Ee,color:Se}}=Ae.legend.options;return xe.labels.map((Ce,_e)=>{const Be=Ae.getDatasetMeta(0).controller.getStyle(_e);return{text:Ce,fillStyle:Be.backgroundColor,strokeStyle:Be.borderColor,fontColor:Se,lineWidth:Be.borderWidth,pointStyle:Ee,hidden:!Ae.getDataVisibility(_e),index:_e}})}return[]}},onClick(Ae,xe,Ee){Ee.chart.toggleDataVisibility(xe.index),Ee.chart.update()}}}});class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(Ae){const xe=this._cachedMeta,{dataset:Ee,data:Se=[],_dataset:Ce}=xe,_e=this.chart._animationsDisabled;let{start:Ie,count:Be}=_getStartAndCountOfVisiblePoints(xe,Se,_e);this._drawStart=Ie,this._drawCount=Be,_scaleRangesChanged(xe)&&(Ie=0,Be=Se.length),Ee._chart=this.chart,Ee._datasetIndex=this.index,Ee._decimated=!!Ce._decimated,Ee.points=Se;const Te=this.resolveDatasetElementOptions(Ae);this.options.showLine||(Te.borderWidth=0),Te.segment=this.options.segment,this.updateElement(Ee,void 0,{animated:!_e,options:Te},Ae),this.updateElements(Se,Ie,Be,Ae)}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",{iScale:_e,vScale:Ie,_stacked:Be,_dataset:Te}=this._cachedMeta,{sharedOptions:Pe,includeOptions:ke}=this._getSharedOptions(xe,Se),$e=_e.axis,Oe=Ie.axis,{spanGaps:Ue,segment:qe}=this.options,ze=isNumber$2(Ue)?Ue:Number.POSITIVE_INFINITY,Ve=this.chart._animationsDisabled||Ce||Se==="none",Ge=xe+Ee,Xe=Ae.length;let er=xe>0&&this.getParsed(xe-1);for(let tr=0;tr<Xe;++tr){const nr=Ae[tr],sr=Ve?nr:{};if(tr<xe||tr>=Ge){sr.skip=!0;continue}const dr=this.getParsed(tr),ar=isNullOrUndef(dr[Oe]),lr=sr[$e]=_e.getPixelForValue(dr[$e],tr),Ke=sr[Oe]=Ce||ar?Ie.getBasePixel():Ie.getPixelForValue(Be?this.applyStack(Ie,dr,Be):dr[Oe],tr);sr.skip=isNaN(lr)||isNaN(Ke)||ar,sr.stop=tr>0&&Math.abs(dr[$e]-er[$e])>ze,qe&&(sr.parsed=dr,sr.raw=Te.data[tr]),ke&&(sr.options=Pe||this.resolveDataElementOptions(tr,nr.active?"active":Se)),Ve||this.updateElement(nr,tr,sr,Se),er=dr}}getMaxOverflow(){const Ae=this._cachedMeta,xe=Ae.dataset,Ee=xe.options&&xe.options.borderWidth||0,Se=Ae.data||[];if(!Se.length)return Ee;const Ce=Se[0].size(this.resolveDataElementOptions(0)),_e=Se[Se.length-1].size(this.resolveDataElementOptions(Se.length-1));return Math.max(Ee,Ce,_e)/2}draw(){const Ae=this._cachedMeta;Ae.dataset.updateControlPoints(this.chart.chartArea,Ae.iScale.axis),super.draw()}}$i(LineController,"id","line"),$i(LineController,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),$i(LineController,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class PolarAreaController extends DatasetController{constructor(Ae,xe){super(Ae,xe),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(Ae){const xe=this._cachedMeta,Ee=this.chart,Se=Ee.data.labels||[],Ce=formatNumber(xe._parsed[Ae].r,Ee.options.locale);return{label:Se[Ae]||"",value:Ce}}parseObjectData(Ae,xe,Ee,Se){return _parseObjectDataRadialScale.bind(this)(Ae,xe,Ee,Se)}update(Ae){const xe=this._cachedMeta.data;this._updateRadius(),this.updateElements(xe,0,xe.length,Ae)}getMinMax(){const Ae=this._cachedMeta,xe={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return Ae.data.forEach((Ee,Se)=>{const Ce=this.getParsed(Se).r;!isNaN(Ce)&&this.chart.getDataVisibility(Se)&&(Ce<xe.min&&(xe.min=Ce),Ce>xe.max&&(xe.max=Ce))}),xe}_updateRadius(){const Ae=this.chart,xe=Ae.chartArea,Ee=Ae.options,Se=Math.min(xe.right-xe.left,xe.bottom-xe.top),Ce=Math.max(Se/2,0),_e=Math.max(Ee.cutoutPercentage?Ce/100*Ee.cutoutPercentage:1,0),Ie=(Ce-_e)/Ae.getVisibleDatasetCount();this.outerRadius=Ce-Ie*this.index,this.innerRadius=this.outerRadius-Ie}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",_e=this.chart,Be=_e.options.animation,Te=this._cachedMeta.rScale,Pe=Te.xCenter,ke=Te.yCenter,$e=Te.getIndexAngle(0)-.5*PI;let Oe=$e,Ue;const qe=360/this.countVisibleElements();for(Ue=0;Ue<xe;++Ue)Oe+=this._computeAngle(Ue,Se,qe);for(Ue=xe;Ue<xe+Ee;Ue++){const ze=Ae[Ue];let Ve=Oe,Ge=Oe+this._computeAngle(Ue,Se,qe),Xe=_e.getDataVisibility(Ue)?Te.getDistanceFromCenterForValue(this.getParsed(Ue).r):0;Oe=Ge,Ce&&(Be.animateScale&&(Xe=0),Be.animateRotate&&(Ve=Ge=$e));const er={x:Pe,y:ke,innerRadius:0,outerRadius:Xe,startAngle:Ve,endAngle:Ge,options:this.resolveDataElementOptions(Ue,ze.active?"active":Se)};this.updateElement(ze,Ue,er,Se)}}countVisibleElements(){const Ae=this._cachedMeta;let xe=0;return Ae.data.forEach((Ee,Se)=>{!isNaN(this.getParsed(Se).r)&&this.chart.getDataVisibility(Se)&&xe++}),xe}_computeAngle(Ae,xe,Ee){return this.chart.getDataVisibility(Ae)?toRadians(this.resolveDataElementOptions(Ae,xe).angle||Ee):0}}$i(PolarAreaController,"id","polarArea"),$i(PolarAreaController,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),$i(PolarAreaController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(Ae){const xe=Ae.data;if(xe.labels.length&&xe.datasets.length){const{labels:{pointStyle:Ee,color:Se}}=Ae.legend.options;return xe.labels.map((Ce,_e)=>{const Be=Ae.getDatasetMeta(0).controller.getStyle(_e);return{text:Ce,fillStyle:Be.backgroundColor,strokeStyle:Be.borderColor,fontColor:Se,lineWidth:Be.borderWidth,pointStyle:Ee,hidden:!Ae.getDataVisibility(_e),index:_e}})}return[]}},onClick(Ae,xe,Ee){Ee.chart.toggleDataVisibility(xe.index),Ee.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ScatterController extends DatasetController{getLabelAndValue(Ae){const xe=this._cachedMeta,Ee=this.chart.data.labels||[],{xScale:Se,yScale:Ce}=xe,_e=this.getParsed(Ae),Ie=Se.getLabelForValue(_e.x),Be=Ce.getLabelForValue(_e.y);return{label:Ee[Ae]||"",value:"("+Ie+", "+Be+")"}}update(Ae){const xe=this._cachedMeta,{data:Ee=[]}=xe,Se=this.chart._animationsDisabled;let{start:Ce,count:_e}=_getStartAndCountOfVisiblePoints(xe,Ee,Se);if(this._drawStart=Ce,this._drawCount=_e,_scaleRangesChanged(xe)&&(Ce=0,_e=Ee.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:Ie,_dataset:Be}=xe;Ie._chart=this.chart,Ie._datasetIndex=this.index,Ie._decimated=!!Be._decimated,Ie.points=Ee;const Te=this.resolveDatasetElementOptions(Ae);Te.segment=this.options.segment,this.updateElement(Ie,void 0,{animated:!Se,options:Te},Ae)}else this.datasetElementType&&(delete xe.dataset,this.datasetElementType=!1);this.updateElements(Ee,Ce,_e,Ae)}addElements(){const{showLine:Ae}=this.options;!this.datasetElementType&&Ae&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",{iScale:_e,vScale:Ie,_stacked:Be,_dataset:Te}=this._cachedMeta,Pe=this.resolveDataElementOptions(xe,Se),ke=this.getSharedOptions(Pe),$e=this.includeOptions(Se,ke),Oe=_e.axis,Ue=Ie.axis,{spanGaps:qe,segment:ze}=this.options,Ve=isNumber$2(qe)?qe:Number.POSITIVE_INFINITY,Ge=this.chart._animationsDisabled||Ce||Se==="none";let Xe=xe>0&&this.getParsed(xe-1);for(let er=xe;er<xe+Ee;++er){const tr=Ae[er],nr=this.getParsed(er),sr=Ge?tr:{},dr=isNullOrUndef(nr[Ue]),ar=sr[Oe]=_e.getPixelForValue(nr[Oe],er),lr=sr[Ue]=Ce||dr?Ie.getBasePixel():Ie.getPixelForValue(Be?this.applyStack(Ie,nr,Be):nr[Ue],er);sr.skip=isNaN(ar)||isNaN(lr)||dr,sr.stop=er>0&&Math.abs(nr[Oe]-Xe[Oe])>Ve,ze&&(sr.parsed=nr,sr.raw=Te.data[er]),$e&&(sr.options=ke||this.resolveDataElementOptions(er,tr.active?"active":Se)),Ge||this.updateElement(tr,er,sr,Se),Xe=nr}this.updateSharedOptions(ke,Se,Pe)}getMaxOverflow(){const Ae=this._cachedMeta,xe=Ae.data||[];if(!this.options.showLine){let Ie=0;for(let Be=xe.length-1;Be>=0;--Be)Ie=Math.max(Ie,xe[Be].size(this.resolveDataElementOptions(Be))/2);return Ie>0&&Ie}const Ee=Ae.dataset,Se=Ee.options&&Ee.options.borderWidth||0;if(!xe.length)return Se;const Ce=xe[0].size(this.resolveDataElementOptions(0)),_e=xe[xe.length-1].size(this.resolveDataElementOptions(xe.length-1));return Math.max(Se,Ce,_e)/2}}$i(ScatterController,"id","scatter"),$i(ScatterController,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),$i(ScatterController,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapterBase{constructor(Ae){$i(this,"options");this.options=Ae||{}}static override(Ae){Object.assign(DateAdapterBase.prototype,Ae)}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}var adapters={_date:DateAdapterBase};function binarySearch(t,Ae,xe,Ee){const{controller:Se,data:Ce,_sorted:_e}=t,Ie=Se._cachedMeta.iScale,Be=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(Ie&&Ae===Ie.axis&&Ae!=="r"&&_e&&Ce.length){const Te=Ie._reversePixels?_rlookupByKey:_lookupByKey;if(Ee){if(Se._sharedOptions){const Pe=Ce[0],ke=typeof Pe.getRange=="function"&&Pe.getRange(Ae);if(ke){const $e=Te(Ce,Ae,xe-ke),Oe=Te(Ce,Ae,xe+ke);return{lo:$e.lo,hi:Oe.hi}}}}else{const Pe=Te(Ce,Ae,xe);if(Be){const{vScale:ke}=Se._cachedMeta,{_parsed:$e}=t,Oe=$e.slice(0,Pe.lo+1).reverse().findIndex(qe=>!isNullOrUndef(qe[ke.axis]));Pe.lo-=Math.max(0,Oe);const Ue=$e.slice(Pe.hi).findIndex(qe=>!isNullOrUndef(qe[ke.axis]));Pe.hi+=Math.max(0,Ue)}return Pe}}return{lo:0,hi:Ce.length-1}}function evaluateInteractionItems(t,Ae,xe,Ee,Se){const Ce=t.getSortedVisibleDatasetMetas(),_e=xe[Ae];for(let Ie=0,Be=Ce.length;Ie<Be;++Ie){const{index:Te,data:Pe}=Ce[Ie],{lo:ke,hi:$e}=binarySearch(Ce[Ie],Ae,_e,Se);for(let Oe=ke;Oe<=$e;++Oe){const Ue=Pe[Oe];Ue.skip||Ee(Ue,Te,Oe)}}}function getDistanceMetricForAxis(t){const Ae=t.indexOf("x")!==-1,xe=t.indexOf("y")!==-1;return function(Ee,Se){const Ce=Ae?Math.abs(Ee.x-Se.x):0,_e=xe?Math.abs(Ee.y-Se.y):0;return Math.sqrt(Math.pow(Ce,2)+Math.pow(_e,2))}}function getIntersectItems(t,Ae,xe,Ee,Se){const Ce=[];return!Se&&!t.isPointInArea(Ae)||evaluateInteractionItems(t,xe,Ae,function(Ie,Be,Te){!Se&&!_isPointInArea(Ie,t.chartArea,0)||Ie.inRange(Ae.x,Ae.y,Ee)&&Ce.push({element:Ie,datasetIndex:Be,index:Te})},!0),Ce}function getNearestRadialItems(t,Ae,xe,Ee){let Se=[];function Ce(_e,Ie,Be){const{startAngle:Te,endAngle:Pe}=_e.getProps(["startAngle","endAngle"],Ee),{angle:ke}=getAngleFromPoint(_e,{x:Ae.x,y:Ae.y});_angleBetween(ke,Te,Pe)&&Se.push({element:_e,datasetIndex:Ie,index:Be})}return evaluateInteractionItems(t,xe,Ae,Ce),Se}function getNearestCartesianItems(t,Ae,xe,Ee,Se,Ce){let _e=[];const Ie=getDistanceMetricForAxis(xe);let Be=Number.POSITIVE_INFINITY;function Te(Pe,ke,$e){const Oe=Pe.inRange(Ae.x,Ae.y,Se);if(Ee&&!Oe)return;const Ue=Pe.getCenterPoint(Se);if(!(!!Ce||t.isPointInArea(Ue))&&!Oe)return;const ze=Ie(Ae,Ue);ze<Be?(_e=[{element:Pe,datasetIndex:ke,index:$e}],Be=ze):ze===Be&&_e.push({element:Pe,datasetIndex:ke,index:$e})}return evaluateInteractionItems(t,xe,Ae,Te),_e}function getNearestItems(t,Ae,xe,Ee,Se,Ce){return!Ce&&!t.isPointInArea(Ae)?[]:xe==="r"&&!Ee?getNearestRadialItems(t,Ae,xe,Se):getNearestCartesianItems(t,Ae,xe,Ee,Se,Ce)}function getAxisItems(t,Ae,xe,Ee,Se){const Ce=[],_e=xe==="x"?"inXRange":"inYRange";let Ie=!1;return evaluateInteractionItems(t,xe,Ae,(Be,Te,Pe)=>{Be[_e]&&Be[_e](Ae[xe],Se)&&(Ce.push({element:Be,datasetIndex:Te,index:Pe}),Ie=Ie||Be.inRange(Ae.x,Ae.y,Se))}),Ee&&!Ie?[]:Ce}var Interaction={modes:{index(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t),Ce=xe.axis||"x",_e=xe.includeInvisible||!1,Ie=xe.intersect?getIntersectItems(t,Se,Ce,Ee,_e):getNearestItems(t,Se,Ce,!1,Ee,_e),Be=[];return Ie.length?(t.getSortedVisibleDatasetMetas().forEach(Te=>{const Pe=Ie[0].index,ke=Te.data[Pe];ke&&!ke.skip&&Be.push({element:ke,datasetIndex:Te.index,index:Pe})}),Be):[]},dataset(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t),Ce=xe.axis||"xy",_e=xe.includeInvisible||!1;let Ie=xe.intersect?getIntersectItems(t,Se,Ce,Ee,_e):getNearestItems(t,Se,Ce,!1,Ee,_e);if(Ie.length>0){const Be=Ie[0].datasetIndex,Te=t.getDatasetMeta(Be).data;Ie=[];for(let Pe=0;Pe<Te.length;++Pe)Ie.push({element:Te[Pe],datasetIndex:Be,index:Pe})}return Ie},point(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t),Ce=xe.axis||"xy",_e=xe.includeInvisible||!1;return getIntersectItems(t,Se,Ce,Ee,_e)},nearest(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t),Ce=xe.axis||"xy",_e=xe.includeInvisible||!1;return getNearestItems(t,Se,Ce,xe.intersect,Ee,_e)},x(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t);return getAxisItems(t,Se,"x",xe.intersect,Ee)},y(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t);return getAxisItems(t,Se,"y",xe.intersect,Ee)}}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(t,Ae){return t.filter(xe=>xe.pos===Ae)}function filterDynamicPositionByAxis(t,Ae){return t.filter(xe=>STATIC_POSITIONS.indexOf(xe.pos)===-1&&xe.box.axis===Ae)}function sortByWeight(t,Ae){return t.sort((xe,Ee)=>{const Se=Ae?Ee:xe,Ce=Ae?xe:Ee;return Se.weight===Ce.weight?Se.index-Ce.index:Se.weight-Ce.weight})}function wrapBoxes(t){const Ae=[];let xe,Ee,Se,Ce,_e,Ie;for(xe=0,Ee=(t||[]).length;xe<Ee;++xe)Se=t[xe],{position:Ce,options:{stack:_e,stackWeight:Ie=1}}=Se,Ae.push({index:xe,box:Se,pos:Ce,horizontal:Se.isHorizontal(),weight:Se.weight,stack:_e&&Ce+_e,stackWeight:Ie});return Ae}function buildStacks(t){const Ae={};for(const xe of t){const{stack:Ee,pos:Se,stackWeight:Ce}=xe;if(!Ee||!STATIC_POSITIONS.includes(Se))continue;const _e=Ae[Ee]||(Ae[Ee]={count:0,placed:0,weight:0,size:0});_e.count++,_e.weight+=Ce}return Ae}function setLayoutDims(t,Ae){const xe=buildStacks(t),{vBoxMaxWidth:Ee,hBoxMaxHeight:Se}=Ae;let Ce,_e,Ie;for(Ce=0,_e=t.length;Ce<_e;++Ce){Ie=t[Ce];const{fullSize:Be}=Ie.box,Te=xe[Ie.stack],Pe=Te&&Ie.stackWeight/Te.weight;Ie.horizontal?(Ie.width=Pe?Pe*Ee:Be&&Ae.availableWidth,Ie.height=Se):(Ie.width=Ee,Ie.height=Pe?Pe*Se:Be&&Ae.availableHeight)}return xe}function buildLayoutBoxes(t){const Ae=wrapBoxes(t),xe=sortByWeight(Ae.filter(Te=>Te.box.fullSize),!0),Ee=sortByWeight(filterByPosition(Ae,"left"),!0),Se=sortByWeight(filterByPosition(Ae,"right")),Ce=sortByWeight(filterByPosition(Ae,"top"),!0),_e=sortByWeight(filterByPosition(Ae,"bottom")),Ie=filterDynamicPositionByAxis(Ae,"x"),Be=filterDynamicPositionByAxis(Ae,"y");return{fullSize:xe,leftAndTop:Ee.concat(Ce),rightAndBottom:Se.concat(Be).concat(_e).concat(Ie),chartArea:filterByPosition(Ae,"chartArea"),vertical:Ee.concat(Se).concat(Be),horizontal:Ce.concat(_e).concat(Ie)}}function getCombinedMax(t,Ae,xe,Ee){return Math.max(t[xe],Ae[xe])+Math.max(t[Ee],Ae[Ee])}function updateMaxPadding(t,Ae){t.top=Math.max(t.top,Ae.top),t.left=Math.max(t.left,Ae.left),t.bottom=Math.max(t.bottom,Ae.bottom),t.right=Math.max(t.right,Ae.right)}function updateDims(t,Ae,xe,Ee){const{pos:Se,box:Ce}=xe,_e=t.maxPadding;if(!isObject$1(Se)){xe.size&&(t[Se]-=xe.size);const ke=Ee[xe.stack]||{size:0,count:1};ke.size=Math.max(ke.size,xe.horizontal?Ce.height:Ce.width),xe.size=ke.size/ke.count,t[Se]+=xe.size}Ce.getPadding&&updateMaxPadding(_e,Ce.getPadding());const Ie=Math.max(0,Ae.outerWidth-getCombinedMax(_e,t,"left","right")),Be=Math.max(0,Ae.outerHeight-getCombinedMax(_e,t,"top","bottom")),Te=Ie!==t.w,Pe=Be!==t.h;return t.w=Ie,t.h=Be,xe.horizontal?{same:Te,other:Pe}:{same:Pe,other:Te}}function handleMaxPadding(t){const Ae=t.maxPadding;function xe(Ee){const Se=Math.max(Ae[Ee]-t[Ee],0);return t[Ee]+=Se,Se}t.y+=xe("top"),t.x+=xe("left"),xe("right"),xe("bottom")}function getMargins(t,Ae){const xe=Ae.maxPadding;function Ee(Se){const Ce={left:0,top:0,right:0,bottom:0};return Se.forEach(_e=>{Ce[_e]=Math.max(Ae[_e],xe[_e])}),Ce}return Ee(t?["left","right"]:["top","bottom"])}function fitBoxes(t,Ae,xe,Ee){const Se=[];let Ce,_e,Ie,Be,Te,Pe;for(Ce=0,_e=t.length,Te=0;Ce<_e;++Ce){Ie=t[Ce],Be=Ie.box,Be.update(Ie.width||Ae.w,Ie.height||Ae.h,getMargins(Ie.horizontal,Ae));const{same:ke,other:$e}=updateDims(Ae,xe,Ie,Ee);Te|=ke&&Se.length,Pe=Pe||$e,Be.fullSize||Se.push(Ie)}return Te&&fitBoxes(Se,Ae,xe,Ee)||Pe}function setBoxDims(t,Ae,xe,Ee,Se){t.top=xe,t.left=Ae,t.right=Ae+Ee,t.bottom=xe+Se,t.width=Ee,t.height=Se}function placeBoxes(t,Ae,xe,Ee){const Se=xe.padding;let{x:Ce,y:_e}=Ae;for(const Ie of t){const Be=Ie.box,Te=Ee[Ie.stack]||{placed:0,weight:1},Pe=Ie.stackWeight/Te.weight||1;if(Ie.horizontal){const ke=Ae.w*Pe,$e=Te.size||Be.height;defined(Te.start)&&(_e=Te.start),Be.fullSize?setBoxDims(Be,Se.left,_e,xe.outerWidth-Se.right-Se.left,$e):setBoxDims(Be,Ae.left+Te.placed,_e,ke,$e),Te.start=_e,Te.placed+=ke,_e=Be.bottom}else{const ke=Ae.h*Pe,$e=Te.size||Be.width;defined(Te.start)&&(Ce=Te.start),Be.fullSize?setBoxDims(Be,Ce,Se.top,$e,xe.outerHeight-Se.bottom-Se.top):setBoxDims(Be,Ce,Ae.top+Te.placed,$e,ke),Te.start=Ce,Te.placed+=ke,Ce=Be.right}}Ae.x=Ce,Ae.y=_e}var layouts={addBox(t,Ae){t.boxes||(t.boxes=[]),Ae.fullSize=Ae.fullSize||!1,Ae.position=Ae.position||"top",Ae.weight=Ae.weight||0,Ae._layers=Ae._layers||function(){return[{z:0,draw(xe){Ae.draw(xe)}}]},t.boxes.push(Ae)},removeBox(t,Ae){const xe=t.boxes?t.boxes.indexOf(Ae):-1;xe!==-1&&t.boxes.splice(xe,1)},configure(t,Ae,xe){Ae.fullSize=xe.fullSize,Ae.position=xe.position,Ae.weight=xe.weight},update(t,Ae,xe,Ee){if(!t)return;const Se=toPadding(t.options.layout.padding),Ce=Math.max(Ae-Se.width,0),_e=Math.max(xe-Se.height,0),Ie=buildLayoutBoxes(t.boxes),Be=Ie.vertical,Te=Ie.horizontal;each(t.boxes,qe=>{typeof qe.beforeLayout=="function"&&qe.beforeLayout()});const Pe=Be.reduce((qe,ze)=>ze.box.options&&ze.box.options.display===!1?qe:qe+1,0)||1,ke=Object.freeze({outerWidth:Ae,outerHeight:xe,padding:Se,availableWidth:Ce,availableHeight:_e,vBoxMaxWidth:Ce/2/Pe,hBoxMaxHeight:_e/2}),$e=Object.assign({},Se);updateMaxPadding($e,toPadding(Ee));const Oe=Object.assign({maxPadding:$e,w:Ce,h:_e,x:Se.left,y:Se.top},Se),Ue=setLayoutDims(Be.concat(Te),ke);fitBoxes(Ie.fullSize,Oe,ke,Ue),fitBoxes(Be,Oe,ke,Ue),fitBoxes(Te,Oe,ke,Ue)&&fitBoxes(Be,Oe,ke,Ue),handleMaxPadding(Oe),placeBoxes(Ie.leftAndTop,Oe,ke,Ue),Oe.x+=Oe.w,Oe.y+=Oe.h,placeBoxes(Ie.rightAndBottom,Oe,ke,Ue),t.chartArea={left:Oe.left,top:Oe.top,right:Oe.left+Oe.w,bottom:Oe.top+Oe.h,height:Oe.h,width:Oe.w},each(Ie.chartArea,qe=>{const ze=qe.box;Object.assign(ze,t.chartArea),ze.update(Oe.w,Oe.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(Ae,xe){}releaseContext(Ae){return!1}addEventListener(Ae,xe,Ee){}removeEventListener(Ae,xe,Ee){}getDevicePixelRatio(){return 1}getMaximumSize(Ae,xe,Ee,Se){return xe=Math.max(0,xe||Ae.width),Ee=Ee||Ae.height,{width:xe,height:Math.max(0,Se?Math.floor(xe/Se):Ee)}}isAttached(Ae){return!0}updateConfig(Ae){}}class BasicPlatform extends BasePlatform{acquireContext(Ae){return Ae&&Ae.getContext&&Ae.getContext("2d")||null}updateConfig(Ae){Ae.options.animation=!1}}const EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=t=>t===null||t==="";function initCanvas(t,Ae){const xe=t.style,Ee=t.getAttribute("height"),Se=t.getAttribute("width");if(t[EXPANDO_KEY]={initial:{height:Ee,width:Se,style:{display:xe.display,height:xe.height,width:xe.width}}},xe.display=xe.display||"block",xe.boxSizing=xe.boxSizing||"border-box",isNullOrEmpty(Se)){const Ce=readUsedSize(t,"width");Ce!==void 0&&(t.width=Ce)}if(isNullOrEmpty(Ee))if(t.style.height==="")t.height=t.width/(Ae||2);else{const Ce=readUsedSize(t,"height");Ce!==void 0&&(t.height=Ce)}return t}const eventListenerOptions=supportsEventListenerOptions?{passive:!0}:!1;function addListener(t,Ae,xe){t&&t.addEventListener(Ae,xe,eventListenerOptions)}function removeListener(t,Ae,xe){t&&t.canvas&&t.canvas.removeEventListener(Ae,xe,eventListenerOptions)}function fromNativeEvent(t,Ae){const xe=EVENT_TYPES[t.type]||t.type,{x:Ee,y:Se}=getRelativePosition(t,Ae);return{type:xe,chart:Ae,native:t,x:Ee!==void 0?Ee:null,y:Se!==void 0?Se:null}}function nodeListContains(t,Ae){for(const xe of t)if(xe===Ae||xe.contains(Ae))return!0}function createAttachObserver(t,Ae,xe){const Ee=t.canvas,Se=new MutationObserver(Ce=>{let _e=!1;for(const Ie of Ce)_e=_e||nodeListContains(Ie.addedNodes,Ee),_e=_e&&!nodeListContains(Ie.removedNodes,Ee);_e&&xe()});return Se.observe(document,{childList:!0,subtree:!0}),Se}function createDetachObserver(t,Ae,xe){const Ee=t.canvas,Se=new MutationObserver(Ce=>{let _e=!1;for(const Ie of Ce)_e=_e||nodeListContains(Ie.removedNodes,Ee),_e=_e&&!nodeListContains(Ie.addedNodes,Ee);_e&&xe()});return Se.observe(document,{childList:!0,subtree:!0}),Se}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const t=window.devicePixelRatio;t!==oldDevicePixelRatio&&(oldDevicePixelRatio=t,drpListeningCharts.forEach((Ae,xe)=>{xe.currentDevicePixelRatio!==t&&Ae()}))}function listenDevicePixelRatioChanges(t,Ae){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(t,Ae)}function unlistenDevicePixelRatioChanges(t){drpListeningCharts.delete(t),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(t,Ae,xe){const Ee=t.canvas,Se=Ee&&_getParentNode(Ee);if(!Se)return;const Ce=throttled((Ie,Be)=>{const Te=Se.clientWidth;xe(Ie,Be),Te<Se.clientWidth&&xe()},window),_e=new ResizeObserver(Ie=>{const Be=Ie[0],Te=Be.contentRect.width,Pe=Be.contentRect.height;Te===0&&Pe===0||Ce(Te,Pe)});return _e.observe(Se),listenDevicePixelRatioChanges(t,Ce),_e}function releaseObserver(t,Ae,xe){xe&&xe.disconnect(),Ae==="resize"&&unlistenDevicePixelRatioChanges(t)}function createProxyAndListen(t,Ae,xe){const Ee=t.canvas,Se=throttled(Ce=>{t.ctx!==null&&xe(fromNativeEvent(Ce,t))},t);return addListener(Ee,Ae,Se),Se}class DomPlatform extends BasePlatform{acquireContext(Ae,xe){const Ee=Ae&&Ae.getContext&&Ae.getContext("2d");return Ee&&Ee.canvas===Ae?(initCanvas(Ae,xe),Ee):null}releaseContext(Ae){const xe=Ae.canvas;if(!xe[EXPANDO_KEY])return!1;const Ee=xe[EXPANDO_KEY].initial;["height","width"].forEach(Ce=>{const _e=Ee[Ce];isNullOrUndef(_e)?xe.removeAttribute(Ce):xe.setAttribute(Ce,_e)});const Se=Ee.style||{};return Object.keys(Se).forEach(Ce=>{xe.style[Ce]=Se[Ce]}),xe.width=xe.width,delete xe[EXPANDO_KEY],!0}addEventListener(Ae,xe,Ee){this.removeEventListener(Ae,xe);const Se=Ae.$proxies||(Ae.$proxies={}),_e={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[xe]||createProxyAndListen;Se[xe]=_e(Ae,xe,Ee)}removeEventListener(Ae,xe){const Ee=Ae.$proxies||(Ae.$proxies={}),Se=Ee[xe];if(!Se)return;({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[xe]||removeListener)(Ae,xe,Se),Ee[xe]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(Ae,xe,Ee,Se){return getMaximumSize(Ae,xe,Ee,Se)}isAttached(Ae){const xe=Ae&&_getParentNode(Ae);return!!(xe&&xe.isConnected)}}function _detectPlatform(t){return!_isDomSupported()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?BasicPlatform:DomPlatform}var Yd;let Element$2=(Yd=class{constructor(){$i(this,"x");$i(this,"y");$i(this,"active",!1);$i(this,"options");$i(this,"$animations")}tooltipPosition(Ae){const{x:xe,y:Ee}=this.getProps(["x","y"],Ae);return{x:xe,y:Ee}}hasValue(){return isNumber$2(this.x)&&isNumber$2(this.y)}getProps(Ae,xe){const Ee=this.$animations;if(!xe||!Ee)return this;const Se={};return Ae.forEach(Ce=>{Se[Ce]=Ee[Ce]&&Ee[Ce].active()?Ee[Ce]._to:this[Ce]}),Se}},$i(Yd,"defaults",{}),$i(Yd,"defaultRoutes"),Yd);function autoSkip(t,Ae){const xe=t.options.ticks,Ee=determineMaxTicks(t),Se=Math.min(xe.maxTicksLimit||Ee,Ee),Ce=xe.major.enabled?getMajorIndices(Ae):[],_e=Ce.length,Ie=Ce[0],Be=Ce[_e-1],Te=[];if(_e>Se)return skipMajors(Ae,Te,Ce,_e/Se),Te;const Pe=calculateSpacing(Ce,Ae,Se);if(_e>0){let ke,$e;const Oe=_e>1?Math.round((Be-Ie)/(_e-1)):null;for(skip(Ae,Te,Pe,isNullOrUndef(Oe)?0:Ie-Oe,Ie),ke=0,$e=_e-1;ke<$e;ke++)skip(Ae,Te,Pe,Ce[ke],Ce[ke+1]);return skip(Ae,Te,Pe,Be,isNullOrUndef(Oe)?Ae.length:Be+Oe),Te}return skip(Ae,Te,Pe),Te}function determineMaxTicks(t){const Ae=t.options.offset,xe=t._tickSize(),Ee=t._length/xe+(Ae?0:1),Se=t._maxLength/xe;return Math.floor(Math.min(Ee,Se))}function calculateSpacing(t,Ae,xe){const Ee=getEvenSpacing(t),Se=Ae.length/xe;if(!Ee)return Math.max(Se,1);const Ce=_factorize(Ee);for(let _e=0,Ie=Ce.length-1;_e<Ie;_e++){const Be=Ce[_e];if(Be>Se)return Be}return Math.max(Se,1)}function getMajorIndices(t){const Ae=[];let xe,Ee;for(xe=0,Ee=t.length;xe<Ee;xe++)t[xe].major&&Ae.push(xe);return Ae}function skipMajors(t,Ae,xe,Ee){let Se=0,Ce=xe[0],_e;for(Ee=Math.ceil(Ee),_e=0;_e<t.length;_e++)_e===Ce&&(Ae.push(t[_e]),Se++,Ce=xe[Se*Ee])}function skip(t,Ae,xe,Ee,Se){const Ce=valueOrDefault(Ee,0),_e=Math.min(valueOrDefault(Se,t.length),t.length);let Ie=0,Be,Te,Pe;for(xe=Math.ceil(xe),Se&&(Be=Se-Ee,xe=Be/Math.floor(Be/xe)),Pe=Ce;Pe<0;)Ie++,Pe=Math.round(Ce+Ie*xe);for(Te=Math.max(Ce,0);Te<_e;Te++)Te===Pe&&(Ae.push(t[Te]),Ie++,Pe=Math.round(Ce+Ie*xe))}function getEvenSpacing(t){const Ae=t.length;let xe,Ee;if(Ae<2)return!1;for(Ee=t[0],xe=1;xe<Ae;++xe)if(t[xe]-t[xe-1]!==Ee)return!1;return Ee}const reverseAlign=t=>t==="left"?"right":t==="right"?"left":t,offsetFromEdge=(t,Ae,xe)=>Ae==="top"||Ae==="left"?t[Ae]+xe:t[Ae]-xe,getTicksLimit=(t,Ae)=>Math.min(Ae||t,t);function sample(t,Ae){const xe=[],Ee=t.length/Ae,Se=t.length;let Ce=0;for(;Ce<Se;Ce+=Ee)xe.push(t[Math.floor(Ce)]);return xe}function getPixelForGridLine(t,Ae,xe){const Ee=t.ticks.length,Se=Math.min(Ae,Ee-1),Ce=t._startPixel,_e=t._endPixel,Ie=1e-6;let Be=t.getPixelForTick(Se),Te;if(!(xe&&(Ee===1?Te=Math.max(Be-Ce,_e-Be):Ae===0?Te=(t.getPixelForTick(1)-Be)/2:Te=(Be-t.getPixelForTick(Se-1))/2,Be+=Se<Ae?Te:-Te,Be<Ce-Ie||Be>_e+Ie)))return Be}function garbageCollect(t,Ae){each(t,xe=>{const Ee=xe.gc,Se=Ee.length/2;let Ce;if(Se>Ae){for(Ce=0;Ce<Se;++Ce)delete xe.data[Ee[Ce]];Ee.splice(0,Se)}})}function getTickMarkLength(t){return t.drawTicks?t.tickLength:0}function getTitleHeight(t,Ae){if(!t.display)return 0;const xe=toFont(t.font,Ae),Ee=toPadding(t.padding);return(isArray$2(t.text)?t.text.length:1)*xe.lineHeight+Ee.height}function createScaleContext(t,Ae){return createContext(t,{scale:Ae,type:"scale"})}function createTickContext(t,Ae,xe){return createContext(t,{tick:xe,index:Ae,type:"tick"})}function titleAlign(t,Ae,xe){let Ee=_toLeftRightCenter(t);return(xe&&Ae!=="right"||!xe&&Ae==="right")&&(Ee=reverseAlign(Ee)),Ee}function titleArgs(t,Ae,xe,Ee){const{top:Se,left:Ce,bottom:_e,right:Ie,chart:Be}=t,{chartArea:Te,scales:Pe}=Be;let ke=0,$e,Oe,Ue;const qe=_e-Se,ze=Ie-Ce;if(t.isHorizontal()){if(Oe=_alignStartEnd(Ee,Ce,Ie),isObject$1(xe)){const Ve=Object.keys(xe)[0],Ge=xe[Ve];Ue=Pe[Ve].getPixelForValue(Ge)+qe-Ae}else xe==="center"?Ue=(Te.bottom+Te.top)/2+qe-Ae:Ue=offsetFromEdge(t,xe,Ae);$e=Ie-Ce}else{if(isObject$1(xe)){const Ve=Object.keys(xe)[0],Ge=xe[Ve];Oe=Pe[Ve].getPixelForValue(Ge)-ze+Ae}else xe==="center"?Oe=(Te.left+Te.right)/2-ze+Ae:Oe=offsetFromEdge(t,xe,Ae);Ue=_alignStartEnd(Ee,_e,Se),ke=xe==="left"?-HALF_PI:HALF_PI}return{titleX:Oe,titleY:Ue,maxWidth:$e,rotation:ke}}class Scale extends Element$2{constructor(Ae){super(),this.id=Ae.id,this.type=Ae.type,this.options=void 0,this.ctx=Ae.ctx,this.chart=Ae.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(Ae){this.options=Ae.setContext(this.getContext()),this.axis=Ae.axis,this._userMin=this.parse(Ae.min),this._userMax=this.parse(Ae.max),this._suggestedMin=this.parse(Ae.suggestedMin),this._suggestedMax=this.parse(Ae.suggestedMax)}parse(Ae,xe){return Ae}getUserBounds(){let{_userMin:Ae,_userMax:xe,_suggestedMin:Ee,_suggestedMax:Se}=this;return Ae=finiteOrDefault(Ae,Number.POSITIVE_INFINITY),xe=finiteOrDefault(xe,Number.NEGATIVE_INFINITY),Ee=finiteOrDefault(Ee,Number.POSITIVE_INFINITY),Se=finiteOrDefault(Se,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(Ae,Ee),max:finiteOrDefault(xe,Se),minDefined:isNumberFinite(Ae),maxDefined:isNumberFinite(xe)}}getMinMax(Ae){let{min:xe,max:Ee,minDefined:Se,maxDefined:Ce}=this.getUserBounds(),_e;if(Se&&Ce)return{min:xe,max:Ee};const Ie=this.getMatchingVisibleMetas();for(let Be=0,Te=Ie.length;Be<Te;++Be)_e=Ie[Be].controller.getMinMax(this,Ae),Se||(xe=Math.min(xe,_e.min)),Ce||(Ee=Math.max(Ee,_e.max));return xe=Ce&&xe>Ee?Ee:xe,Ee=Se&&xe>Ee?xe:Ee,{min:finiteOrDefault(xe,finiteOrDefault(Ee,xe)),max:finiteOrDefault(Ee,finiteOrDefault(xe,Ee))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const Ae=this.chart.data;return this.options.labels||(this.isHorizontal()?Ae.xLabels:Ae.yLabels)||Ae.labels||[]}getLabelItems(Ae=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(Ae))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(Ae,xe,Ee){const{beginAtZero:Se,grace:Ce,ticks:_e}=this.options,Ie=_e.sampleSize;this.beforeUpdate(),this.maxWidth=Ae,this.maxHeight=xe,this._margins=Ee=Object.assign({left:0,right:0,top:0,bottom:0},Ee),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+Ee.left+Ee.right:this.height+Ee.top+Ee.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,Ce,Se),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const Be=Ie<this.ticks.length;this._convertTicksToLabels(Be?sample(this.ticks,Ie):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),_e.display&&(_e.autoSkip||_e.source==="auto")&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),Be&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let Ae=this.options.reverse,xe,Ee;this.isHorizontal()?(xe=this.left,Ee=this.right):(xe=this.top,Ee=this.bottom,Ae=!Ae),this._startPixel=xe,this._endPixel=Ee,this._reversePixels=Ae,this._length=Ee-xe,this._alignToPixels=this.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){callback(this.options.afterSetDimensions,[this])}_callHooks(Ae){this.chart.notifyPlugins(Ae,this.getContext()),callback(this.options[Ae],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(Ae){const xe=this.options.ticks;let Ee,Se,Ce;for(Ee=0,Se=Ae.length;Ee<Se;Ee++)Ce=Ae[Ee],Ce.label=callback(xe.callback,[Ce.value,Ee,Ae],this)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const Ae=this.options,xe=Ae.ticks,Ee=getTicksLimit(this.ticks.length,Ae.ticks.maxTicksLimit),Se=xe.minRotation||0,Ce=xe.maxRotation;let _e=Se,Ie,Be,Te;if(!this._isVisible()||!xe.display||Se>=Ce||Ee<=1||!this.isHorizontal()){this.labelRotation=Se;return}const Pe=this._getLabelSizes(),ke=Pe.widest.width,$e=Pe.highest.height,Oe=_limitValue(this.chart.width-ke,0,this.maxWidth);Ie=Ae.offset?this.maxWidth/Ee:Oe/(Ee-1),ke+6>Ie&&(Ie=Oe/(Ee-(Ae.offset?.5:1)),Be=this.maxHeight-getTickMarkLength(Ae.grid)-xe.padding-getTitleHeight(Ae.title,this.chart.options.font),Te=Math.sqrt(ke*ke+$e*$e),_e=toDegrees(Math.min(Math.asin(_limitValue((Pe.highest.height+6)/Ie,-1,1)),Math.asin(_limitValue(Be/Te,-1,1))-Math.asin(_limitValue($e/Te,-1,1)))),_e=Math.max(Se,Math.min(Ce,_e))),this.labelRotation=_e}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const Ae={width:0,height:0},{chart:xe,options:{ticks:Ee,title:Se,grid:Ce}}=this,_e=this._isVisible(),Ie=this.isHorizontal();if(_e){const Be=getTitleHeight(Se,xe.options.font);if(Ie?(Ae.width=this.maxWidth,Ae.height=getTickMarkLength(Ce)+Be):(Ae.height=this.maxHeight,Ae.width=getTickMarkLength(Ce)+Be),Ee.display&&this.ticks.length){const{first:Te,last:Pe,widest:ke,highest:$e}=this._getLabelSizes(),Oe=Ee.padding*2,Ue=toRadians(this.labelRotation),qe=Math.cos(Ue),ze=Math.sin(Ue);if(Ie){const Ve=Ee.mirror?0:ze*ke.width+qe*$e.height;Ae.height=Math.min(this.maxHeight,Ae.height+Ve+Oe)}else{const Ve=Ee.mirror?0:qe*ke.width+ze*$e.height;Ae.width=Math.min(this.maxWidth,Ae.width+Ve+Oe)}this._calculatePadding(Te,Pe,ze,qe)}}this._handleMargins(),Ie?(this.width=this._length=xe.width-this._margins.left-this._margins.right,this.height=Ae.height):(this.width=Ae.width,this.height=this._length=xe.height-this._margins.top-this._margins.bottom)}_calculatePadding(Ae,xe,Ee,Se){const{ticks:{align:Ce,padding:_e},position:Ie}=this.options,Be=this.labelRotation!==0,Te=Ie!=="top"&&this.axis==="x";if(this.isHorizontal()){const Pe=this.getPixelForTick(0)-this.left,ke=this.right-this.getPixelForTick(this.ticks.length-1);let $e=0,Oe=0;Be?Te?($e=Se*Ae.width,Oe=Ee*xe.height):($e=Ee*Ae.height,Oe=Se*xe.width):Ce==="start"?Oe=xe.width:Ce==="end"?$e=Ae.width:Ce!=="inner"&&($e=Ae.width/2,Oe=xe.width/2),this.paddingLeft=Math.max(($e-Pe+_e)*this.width/(this.width-Pe),0),this.paddingRight=Math.max((Oe-ke+_e)*this.width/(this.width-ke),0)}else{let Pe=xe.height/2,ke=Ae.height/2;Ce==="start"?(Pe=0,ke=Ae.height):Ce==="end"&&(Pe=xe.height,ke=0),this.paddingTop=Pe+_e,this.paddingBottom=ke+_e}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis:Ae,position:xe}=this.options;return xe==="top"||xe==="bottom"||Ae==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(Ae){this.beforeTickToLabelConversion(),this.generateTickLabels(Ae);let xe,Ee;for(xe=0,Ee=Ae.length;xe<Ee;xe++)isNullOrUndef(Ae[xe].label)&&(Ae.splice(xe,1),Ee--,xe--);this.afterTickToLabelConversion()}_getLabelSizes(){let Ae=this._labelSizes;if(!Ae){const xe=this.options.ticks.sampleSize;let Ee=this.ticks;xe<Ee.length&&(Ee=sample(Ee,xe)),this._labelSizes=Ae=this._computeLabelSizes(Ee,Ee.length,this.options.ticks.maxTicksLimit)}return Ae}_computeLabelSizes(Ae,xe,Ee){const{ctx:Se,_longestTextCache:Ce}=this,_e=[],Ie=[],Be=Math.floor(xe/getTicksLimit(xe,Ee));let Te=0,Pe=0,ke,$e,Oe,Ue,qe,ze,Ve,Ge,Xe,er,tr;for(ke=0;ke<xe;ke+=Be){if(Ue=Ae[ke].label,qe=this._resolveTickFontOptions(ke),Se.font=ze=qe.string,Ve=Ce[ze]=Ce[ze]||{data:{},gc:[]},Ge=qe.lineHeight,Xe=er=0,!isNullOrUndef(Ue)&&!isArray$2(Ue))Xe=_measureText(Se,Ve.data,Ve.gc,Xe,Ue),er=Ge;else if(isArray$2(Ue))for($e=0,Oe=Ue.length;$e<Oe;++$e)tr=Ue[$e],!isNullOrUndef(tr)&&!isArray$2(tr)&&(Xe=_measureText(Se,Ve.data,Ve.gc,Xe,tr),er+=Ge);_e.push(Xe),Ie.push(er),Te=Math.max(Xe,Te),Pe=Math.max(er,Pe)}garbageCollect(Ce,xe);const nr=_e.indexOf(Te),sr=Ie.indexOf(Pe),dr=ar=>({width:_e[ar]||0,height:Ie[ar]||0});return{first:dr(0),last:dr(xe-1),widest:dr(nr),highest:dr(sr),widths:_e,heights:Ie}}getLabelForValue(Ae){return Ae}getPixelForValue(Ae,xe){return NaN}getValueForPixel(Ae){}getPixelForTick(Ae){const xe=this.ticks;return Ae<0||Ae>xe.length-1?null:this.getPixelForValue(xe[Ae].value)}getPixelForDecimal(Ae){this._reversePixels&&(Ae=1-Ae);const xe=this._startPixel+Ae*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,xe,0):xe)}getDecimalForPixel(Ae){const xe=(Ae-this._startPixel)/this._length;return this._reversePixels?1-xe:xe}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:Ae,max:xe}=this;return Ae<0&&xe<0?xe:Ae>0&&xe>0?Ae:0}getContext(Ae){const xe=this.ticks||[];if(Ae>=0&&Ae<xe.length){const Ee=xe[Ae];return Ee.$context||(Ee.$context=createTickContext(this.getContext(),Ae,Ee))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const Ae=this.options.ticks,xe=toRadians(this.labelRotation),Ee=Math.abs(Math.cos(xe)),Se=Math.abs(Math.sin(xe)),Ce=this._getLabelSizes(),_e=Ae.autoSkipPadding||0,Ie=Ce?Ce.widest.width+_e:0,Be=Ce?Ce.highest.height+_e:0;return this.isHorizontal()?Be*Ee>Ie*Se?Ie/Ee:Be/Se:Be*Se<Ie*Ee?Be/Ee:Ie/Se}_isVisible(){const Ae=this.options.display;return Ae!=="auto"?!!Ae:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(Ae){const xe=this.axis,Ee=this.chart,Se=this.options,{grid:Ce,position:_e,border:Ie}=Se,Be=Ce.offset,Te=this.isHorizontal(),ke=this.ticks.length+(Be?1:0),$e=getTickMarkLength(Ce),Oe=[],Ue=Ie.setContext(this.getContext()),qe=Ue.display?Ue.width:0,ze=qe/2,Ve=function(Qe){return _alignPixel(Ee,Qe,qe)};let Ge,Xe,er,tr,nr,sr,dr,ar,lr,Ke,Me,je;if(_e==="top")Ge=Ve(this.bottom),sr=this.bottom-$e,ar=Ge-ze,Ke=Ve(Ae.top)+ze,je=Ae.bottom;else if(_e==="bottom")Ge=Ve(this.top),Ke=Ae.top,je=Ve(Ae.bottom)-ze,sr=Ge+ze,ar=this.top+$e;else if(_e==="left")Ge=Ve(this.right),nr=this.right-$e,dr=Ge-ze,lr=Ve(Ae.left)+ze,Me=Ae.right;else if(_e==="right")Ge=Ve(this.left),lr=Ae.left,Me=Ve(Ae.right)-ze,nr=Ge+ze,dr=this.left+$e;else if(xe==="x"){if(_e==="center")Ge=Ve((Ae.top+Ae.bottom)/2+.5);else if(isObject$1(_e)){const Qe=Object.keys(_e)[0],Ye=_e[Qe];Ge=Ve(this.chart.scales[Qe].getPixelForValue(Ye))}Ke=Ae.top,je=Ae.bottom,sr=Ge+ze,ar=sr+$e}else if(xe==="y"){if(_e==="center")Ge=Ve((Ae.left+Ae.right)/2);else if(isObject$1(_e)){const Qe=Object.keys(_e)[0],Ye=_e[Qe];Ge=Ve(this.chart.scales[Qe].getPixelForValue(Ye))}nr=Ge-ze,dr=nr-$e,lr=Ae.left,Me=Ae.right}const De=valueOrDefault(Se.ticks.maxTicksLimit,ke),He=Math.max(1,Math.ceil(ke/De));for(Xe=0;Xe<ke;Xe+=He){const Qe=this.getContext(Xe),Ye=Ce.setContext(Qe),St=Ie.setContext(Qe),We=Ye.lineWidth,Fe=Ye.color,Ze=St.dash||[],ir=St.dashOffset,ur=Ye.tickWidth,fr=Ye.tickColor,Ar=Ye.tickBorderDash||[],vr=Ye.tickBorderDashOffset;er=getPixelForGridLine(this,Xe,Be),er!==void 0&&(tr=_alignPixel(Ee,er,We),Te?nr=dr=lr=Me=tr:sr=ar=Ke=je=tr,Oe.push({tx1:nr,ty1:sr,tx2:dr,ty2:ar,x1:lr,y1:Ke,x2:Me,y2:je,width:We,color:Fe,borderDash:Ze,borderDashOffset:ir,tickWidth:ur,tickColor:fr,tickBorderDash:Ar,tickBorderDashOffset:vr}))}return this._ticksLength=ke,this._borderValue=Ge,Oe}_computeLabelItems(Ae){const xe=this.axis,Ee=this.options,{position:Se,ticks:Ce}=Ee,_e=this.isHorizontal(),Ie=this.ticks,{align:Be,crossAlign:Te,padding:Pe,mirror:ke}=Ce,$e=getTickMarkLength(Ee.grid),Oe=$e+Pe,Ue=ke?-Pe:Oe,qe=-toRadians(this.labelRotation),ze=[];let Ve,Ge,Xe,er,tr,nr,sr,dr,ar,lr,Ke,Me,je="middle";if(Se==="top")nr=this.bottom-Ue,sr=this._getXAxisLabelAlignment();else if(Se==="bottom")nr=this.top+Ue,sr=this._getXAxisLabelAlignment();else if(Se==="left"){const He=this._getYAxisLabelAlignment($e);sr=He.textAlign,tr=He.x}else if(Se==="right"){const He=this._getYAxisLabelAlignment($e);sr=He.textAlign,tr=He.x}else if(xe==="x"){if(Se==="center")nr=(Ae.top+Ae.bottom)/2+Oe;else if(isObject$1(Se)){const He=Object.keys(Se)[0],Qe=Se[He];nr=this.chart.scales[He].getPixelForValue(Qe)+Oe}sr=this._getXAxisLabelAlignment()}else if(xe==="y"){if(Se==="center")tr=(Ae.left+Ae.right)/2-Oe;else if(isObject$1(Se)){const He=Object.keys(Se)[0],Qe=Se[He];tr=this.chart.scales[He].getPixelForValue(Qe)}sr=this._getYAxisLabelAlignment($e).textAlign}xe==="y"&&(Be==="start"?je="top":Be==="end"&&(je="bottom"));const De=this._getLabelSizes();for(Ve=0,Ge=Ie.length;Ve<Ge;++Ve){Xe=Ie[Ve],er=Xe.label;const He=Ce.setContext(this.getContext(Ve));dr=this.getPixelForTick(Ve)+Ce.labelOffset,ar=this._resolveTickFontOptions(Ve),lr=ar.lineHeight,Ke=isArray$2(er)?er.length:1;const Qe=Ke/2,Ye=He.color,St=He.textStrokeColor,We=He.textStrokeWidth;let Fe=sr;_e?(tr=dr,sr==="inner"&&(Ve===Ge-1?Fe=this.options.reverse?"left":"right":Ve===0?Fe=this.options.reverse?"right":"left":Fe="center"),Se==="top"?Te==="near"||qe!==0?Me=-Ke*lr+lr/2:Te==="center"?Me=-De.highest.height/2-Qe*lr+lr:Me=-De.highest.height+lr/2:Te==="near"||qe!==0?Me=lr/2:Te==="center"?Me=De.highest.height/2-Qe*lr:Me=De.highest.height-Ke*lr,ke&&(Me*=-1),qe!==0&&!He.showLabelBackdrop&&(tr+=lr/2*Math.sin(qe))):(nr=dr,Me=(1-Ke)*lr/2);let Ze;if(He.showLabelBackdrop){const ir=toPadding(He.backdropPadding),ur=De.heights[Ve],fr=De.widths[Ve];let Ar=Me-ir.top,vr=0-ir.left;switch(je){case"middle":Ar-=ur/2;break;case"bottom":Ar-=ur;break}switch(sr){case"center":vr-=fr/2;break;case"right":vr-=fr;break;case"inner":Ve===Ge-1?vr-=fr:Ve>0&&(vr-=fr/2);break}Ze={left:vr,top:Ar,width:fr+ir.width,height:ur+ir.height,color:He.backdropColor}}ze.push({label:er,font:ar,textOffset:Me,options:{rotation:qe,color:Ye,strokeColor:St,strokeWidth:We,textAlign:Fe,textBaseline:je,translation:[tr,nr],backdrop:Ze}})}return ze}_getXAxisLabelAlignment(){const{position:Ae,ticks:xe}=this.options;if(-toRadians(this.labelRotation))return Ae==="top"?"left":"right";let Se="center";return xe.align==="start"?Se="left":xe.align==="end"?Se="right":xe.align==="inner"&&(Se="inner"),Se}_getYAxisLabelAlignment(Ae){const{position:xe,ticks:{crossAlign:Ee,mirror:Se,padding:Ce}}=this.options,_e=this._getLabelSizes(),Ie=Ae+Ce,Be=_e.widest.width;let Te,Pe;return xe==="left"?Se?(Pe=this.right+Ce,Ee==="near"?Te="left":Ee==="center"?(Te="center",Pe+=Be/2):(Te="right",Pe+=Be)):(Pe=this.right-Ie,Ee==="near"?Te="right":Ee==="center"?(Te="center",Pe-=Be/2):(Te="left",Pe=this.left)):xe==="right"?Se?(Pe=this.left+Ce,Ee==="near"?Te="right":Ee==="center"?(Te="center",Pe-=Be/2):(Te="left",Pe-=Be)):(Pe=this.left+Ie,Ee==="near"?Te="left":Ee==="center"?(Te="center",Pe+=Be/2):(Te="right",Pe=this.right)):Te="right",{textAlign:Te,x:Pe}}_computeLabelArea(){if(this.options.ticks.mirror)return;const Ae=this.chart,xe=this.options.position;if(xe==="left"||xe==="right")return{top:0,left:this.left,bottom:Ae.height,right:this.right};if(xe==="top"||xe==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:Ae.width}}drawBackground(){const{ctx:Ae,options:{backgroundColor:xe},left:Ee,top:Se,width:Ce,height:_e}=this;xe&&(Ae.save(),Ae.fillStyle=xe,Ae.fillRect(Ee,Se,Ce,_e),Ae.restore())}getLineWidthForValue(Ae){const xe=this.options.grid;if(!this._isVisible()||!xe.display)return 0;const Se=this.ticks.findIndex(Ce=>Ce.value===Ae);return Se>=0?xe.setContext(this.getContext(Se)).lineWidth:0}drawGrid(Ae){const xe=this.options.grid,Ee=this.ctx,Se=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(Ae));let Ce,_e;const Ie=(Be,Te,Pe)=>{!Pe.width||!Pe.color||(Ee.save(),Ee.lineWidth=Pe.width,Ee.strokeStyle=Pe.color,Ee.setLineDash(Pe.borderDash||[]),Ee.lineDashOffset=Pe.borderDashOffset,Ee.beginPath(),Ee.moveTo(Be.x,Be.y),Ee.lineTo(Te.x,Te.y),Ee.stroke(),Ee.restore())};if(xe.display)for(Ce=0,_e=Se.length;Ce<_e;++Ce){const Be=Se[Ce];xe.drawOnChartArea&&Ie({x:Be.x1,y:Be.y1},{x:Be.x2,y:Be.y2},Be),xe.drawTicks&&Ie({x:Be.tx1,y:Be.ty1},{x:Be.tx2,y:Be.ty2},{color:Be.tickColor,width:Be.tickWidth,borderDash:Be.tickBorderDash,borderDashOffset:Be.tickBorderDashOffset})}}drawBorder(){const{chart:Ae,ctx:xe,options:{border:Ee,grid:Se}}=this,Ce=Ee.setContext(this.getContext()),_e=Ee.display?Ce.width:0;if(!_e)return;const Ie=Se.setContext(this.getContext(0)).lineWidth,Be=this._borderValue;let Te,Pe,ke,$e;this.isHorizontal()?(Te=_alignPixel(Ae,this.left,_e)-_e/2,Pe=_alignPixel(Ae,this.right,Ie)+Ie/2,ke=$e=Be):(ke=_alignPixel(Ae,this.top,_e)-_e/2,$e=_alignPixel(Ae,this.bottom,Ie)+Ie/2,Te=Pe=Be),xe.save(),xe.lineWidth=Ce.width,xe.strokeStyle=Ce.color,xe.beginPath(),xe.moveTo(Te,ke),xe.lineTo(Pe,$e),xe.stroke(),xe.restore()}drawLabels(Ae){if(!this.options.ticks.display)return;const Ee=this.ctx,Se=this._computeLabelArea();Se&&clipArea(Ee,Se);const Ce=this.getLabelItems(Ae);for(const _e of Ce){const Ie=_e.options,Be=_e.font,Te=_e.label,Pe=_e.textOffset;renderText(Ee,Te,0,Pe,Be,Ie)}Se&&unclipArea(Ee)}drawTitle(){const{ctx:Ae,options:{position:xe,title:Ee,reverse:Se}}=this;if(!Ee.display)return;const Ce=toFont(Ee.font),_e=toPadding(Ee.padding),Ie=Ee.align;let Be=Ce.lineHeight/2;xe==="bottom"||xe==="center"||isObject$1(xe)?(Be+=_e.bottom,isArray$2(Ee.text)&&(Be+=Ce.lineHeight*(Ee.text.length-1))):Be+=_e.top;const{titleX:Te,titleY:Pe,maxWidth:ke,rotation:$e}=titleArgs(this,Be,xe,Ie);renderText(Ae,Ee.text,0,0,Ce,{color:Ee.color,maxWidth:ke,rotation:$e,textAlign:titleAlign(Ie,xe,Se),textBaseline:"middle",translation:[Te,Pe]})}draw(Ae){this._isVisible()&&(this.drawBackground(),this.drawGrid(Ae),this.drawBorder(),this.drawTitle(),this.drawLabels(Ae))}_layers(){const Ae=this.options,xe=Ae.ticks&&Ae.ticks.z||0,Ee=valueOrDefault(Ae.grid&&Ae.grid.z,-1),Se=valueOrDefault(Ae.border&&Ae.border.z,0);return!this._isVisible()||this.draw!==Scale.prototype.draw?[{z:xe,draw:Ce=>{this.draw(Ce)}}]:[{z:Ee,draw:Ce=>{this.drawBackground(),this.drawGrid(Ce),this.drawTitle()}},{z:Se,draw:()=>{this.drawBorder()}},{z:xe,draw:Ce=>{this.drawLabels(Ce)}}]}getMatchingVisibleMetas(Ae){const xe=this.chart.getSortedVisibleDatasetMetas(),Ee=this.axis+"AxisID",Se=[];let Ce,_e;for(Ce=0,_e=xe.length;Ce<_e;++Ce){const Ie=xe[Ce];Ie[Ee]===this.id&&(!Ae||Ie.type===Ae)&&Se.push(Ie)}return Se}_resolveTickFontOptions(Ae){const xe=this.options.ticks.setContext(this.getContext(Ae));return toFont(xe.font)}_maxDigits(){const Ae=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/Ae}}class TypedRegistry{constructor(Ae,xe,Ee){this.type=Ae,this.scope=xe,this.override=Ee,this.items=Object.create(null)}isForType(Ae){return Object.prototype.isPrototypeOf.call(this.type.prototype,Ae.prototype)}register(Ae){const xe=Object.getPrototypeOf(Ae);let Ee;isIChartComponent(xe)&&(Ee=this.register(xe));const Se=this.items,Ce=Ae.id,_e=this.scope+"."+Ce;if(!Ce)throw new Error("class does not have id: "+Ae);return Ce in Se||(Se[Ce]=Ae,registerDefaults(Ae,_e,Ee),this.override&&defaults$1.override(Ae.id,Ae.overrides)),_e}get(Ae){return this.items[Ae]}unregister(Ae){const xe=this.items,Ee=Ae.id,Se=this.scope;Ee in xe&&delete xe[Ee],Se&&Ee in defaults$1[Se]&&(delete defaults$1[Se][Ee],this.override&&delete overrides[Ee])}}function registerDefaults(t,Ae,xe){const Ee=merge$1(Object.create(null),[xe?defaults$1.get(xe):{},defaults$1.get(Ae),t.defaults]);defaults$1.set(Ae,Ee),t.defaultRoutes&&routeDefaults(Ae,t.defaultRoutes),t.descriptors&&defaults$1.describe(Ae,t.descriptors)}function routeDefaults(t,Ae){Object.keys(Ae).forEach(xe=>{const Ee=xe.split("."),Se=Ee.pop(),Ce=[t].concat(Ee).join("."),_e=Ae[xe].split("."),Ie=_e.pop(),Be=_e.join(".");defaults$1.route(Ce,Se,Be,Ie)})}function isIChartComponent(t){return"id"in t&&"defaults"in t}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$2,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...Ae){this._each("register",Ae)}remove(...Ae){this._each("unregister",Ae)}addControllers(...Ae){this._each("register",Ae,this.controllers)}addElements(...Ae){this._each("register",Ae,this.elements)}addPlugins(...Ae){this._each("register",Ae,this.plugins)}addScales(...Ae){this._each("register",Ae,this.scales)}getController(Ae){return this._get(Ae,this.controllers,"controller")}getElement(Ae){return this._get(Ae,this.elements,"element")}getPlugin(Ae){return this._get(Ae,this.plugins,"plugin")}getScale(Ae){return this._get(Ae,this.scales,"scale")}removeControllers(...Ae){this._each("unregister",Ae,this.controllers)}removeElements(...Ae){this._each("unregister",Ae,this.elements)}removePlugins(...Ae){this._each("unregister",Ae,this.plugins)}removeScales(...Ae){this._each("unregister",Ae,this.scales)}_each(Ae,xe,Ee){[...xe].forEach(Se=>{const Ce=Ee||this._getRegistryForType(Se);Ee||Ce.isForType(Se)||Ce===this.plugins&&Se.id?this._exec(Ae,Ce,Se):each(Se,_e=>{const Ie=Ee||this._getRegistryForType(_e);this._exec(Ae,Ie,_e)})})}_exec(Ae,xe,Ee){const Se=_capitalize(Ae);callback(Ee["before"+Se],[],Ee),xe[Ae](Ee),callback(Ee["after"+Se],[],Ee)}_getRegistryForType(Ae){for(let xe=0;xe<this._typedRegistries.length;xe++){const Ee=this._typedRegistries[xe];if(Ee.isForType(Ae))return Ee}return this.plugins}_get(Ae,xe,Ee){const Se=xe.get(Ae);if(Se===void 0)throw new Error('"'+Ae+'" is not a registered '+Ee+".");return Se}}var registry=new Registry;class PluginService{constructor(){this._init=[]}notify(Ae,xe,Ee,Se){xe==="beforeInit"&&(this._init=this._createDescriptors(Ae,!0),this._notify(this._init,Ae,"install"));const Ce=Se?this._descriptors(Ae).filter(Se):this._descriptors(Ae),_e=this._notify(Ce,Ae,xe,Ee);return xe==="afterDestroy"&&(this._notify(Ce,Ae,"stop"),this._notify(this._init,Ae,"uninstall")),_e}_notify(Ae,xe,Ee,Se){Se=Se||{};for(const Ce of Ae){const _e=Ce.plugin,Ie=_e[Ee],Be=[xe,Se,Ce.options];if(callback(Ie,Be,_e)===!1&&Se.cancelable)return!1}return!0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(Ae){if(this._cache)return this._cache;const xe=this._cache=this._createDescriptors(Ae);return this._notifyStateChanges(Ae),xe}_createDescriptors(Ae,xe){const Ee=Ae&&Ae.config,Se=valueOrDefault(Ee.options&&Ee.options.plugins,{}),Ce=allPlugins(Ee);return Se===!1&&!xe?[]:createDescriptors(Ae,Ce,Se,xe)}_notifyStateChanges(Ae){const xe=this._oldCache||[],Ee=this._cache,Se=(Ce,_e)=>Ce.filter(Ie=>!_e.some(Be=>Ie.plugin.id===Be.plugin.id));this._notify(Se(xe,Ee),Ae,"stop"),this._notify(Se(Ee,xe),Ae,"start")}}function allPlugins(t){const Ae={},xe=[],Ee=Object.keys(registry.plugins.items);for(let Ce=0;Ce<Ee.length;Ce++)xe.push(registry.getPlugin(Ee[Ce]));const Se=t.plugins||[];for(let Ce=0;Ce<Se.length;Ce++){const _e=Se[Ce];xe.indexOf(_e)===-1&&(xe.push(_e),Ae[_e.id]=!0)}return{plugins:xe,localIds:Ae}}function getOpts(t,Ae){return!Ae&&t===!1?null:t===!0?{}:t}function createDescriptors(t,{plugins:Ae,localIds:xe},Ee,Se){const Ce=[],_e=t.getContext();for(const Ie of Ae){const Be=Ie.id,Te=getOpts(Ee[Be],Se);Te!==null&&Ce.push({plugin:Ie,options:pluginOpts(t.config,{plugin:Ie,local:xe[Be]},Te,_e)})}return Ce}function pluginOpts(t,{plugin:Ae,local:xe},Ee,Se){const Ce=t.pluginScopeKeys(Ae),_e=t.getOptionScopes(Ee,Ce);return xe&&Ae.defaults&&_e.push(Ae.defaults),t.createResolver(_e,Se,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(t,Ae){const xe=defaults$1.datasets[t]||{};return((Ae.datasets||{})[t]||{}).indexAxis||Ae.indexAxis||xe.indexAxis||"x"}function getAxisFromDefaultScaleID(t,Ae){let xe=t;return t==="_index_"?xe=Ae:t==="_value_"&&(xe=Ae==="x"?"y":"x"),xe}function getDefaultScaleIDFromAxis(t,Ae){return t===Ae?"_index_":"_value_"}function idMatchesAxis(t){if(t==="x"||t==="y"||t==="r")return t}function axisFromPosition(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function determineAxis(t,...Ae){if(idMatchesAxis(t))return t;for(const xe of Ae){const Ee=xe.axis||axisFromPosition(xe.position)||t.length>1&&idMatchesAxis(t[0].toLowerCase());if(Ee)return Ee}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(t,Ae,xe){if(xe[Ae+"AxisID"]===t)return{axis:Ae}}function retrieveAxisFromDatasets(t,Ae){if(Ae.data&&Ae.data.datasets){const xe=Ae.data.datasets.filter(Ee=>Ee.xAxisID===t||Ee.yAxisID===t);if(xe.length)return getAxisFromDataset(t,"x",xe[0])||getAxisFromDataset(t,"y",xe[0])}return{}}function mergeScaleConfig(t,Ae){const xe=overrides[t.type]||{scales:{}},Ee=Ae.scales||{},Se=getIndexAxis(t.type,Ae),Ce=Object.create(null);return Object.keys(Ee).forEach(_e=>{const Ie=Ee[_e];if(!isObject$1(Ie))return console.error(`Invalid scale configuration for scale: ${_e}`);if(Ie._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${_e}`);const Be=determineAxis(_e,Ie,retrieveAxisFromDatasets(_e,t),defaults$1.scales[Ie.type]),Te=getDefaultScaleIDFromAxis(Be,Se),Pe=xe.scales||{};Ce[_e]=mergeIf(Object.create(null),[{axis:Be},Ie,Pe[Be],Pe[Te]])}),t.data.datasets.forEach(_e=>{const Ie=_e.type||t.type,Be=_e.indexAxis||getIndexAxis(Ie,Ae),Pe=(overrides[Ie]||{}).scales||{};Object.keys(Pe).forEach(ke=>{const $e=getAxisFromDefaultScaleID(ke,Be),Oe=_e[$e+"AxisID"]||$e;Ce[Oe]=Ce[Oe]||Object.create(null),mergeIf(Ce[Oe],[{axis:$e},Ee[Oe],Pe[ke]])})}),Object.keys(Ce).forEach(_e=>{const Ie=Ce[_e];mergeIf(Ie,[defaults$1.scales[Ie.type],defaults$1.scale])}),Ce}function initOptions(t){const Ae=t.options||(t.options={});Ae.plugins=valueOrDefault(Ae.plugins,{}),Ae.scales=mergeScaleConfig(t,Ae)}function initData(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function initConfig(t){return t=t||{},t.data=initData(t.data),initOptions(t),t}const keyCache=new Map,keysCached=new Set;function cachedKeys(t,Ae){let xe=keyCache.get(t);return xe||(xe=Ae(),keyCache.set(t,xe),keysCached.add(xe)),xe}const addIfFound=(t,Ae,xe)=>{const Ee=resolveObjectKey(Ae,xe);Ee!==void 0&&t.add(Ee)};class Config{constructor(Ae){this._config=initConfig(Ae),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(Ae){this._config.type=Ae}get data(){return this._config.data}set data(Ae){this._config.data=initData(Ae)}get options(){return this._config.options}set options(Ae){this._config.options=Ae}get plugins(){return this._config.plugins}update(){const Ae=this._config;this.clearCache(),initOptions(Ae)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(Ae){return cachedKeys(Ae,()=>[[`datasets.${Ae}`,""]])}datasetAnimationScopeKeys(Ae,xe){return cachedKeys(`${Ae}.transition.${xe}`,()=>[[`datasets.${Ae}.transitions.${xe}`,`transitions.${xe}`],[`datasets.${Ae}`,""]])}datasetElementScopeKeys(Ae,xe){return cachedKeys(`${Ae}-${xe}`,()=>[[`datasets.${Ae}.elements.${xe}`,`datasets.${Ae}`,`elements.${xe}`,""]])}pluginScopeKeys(Ae){const xe=Ae.id,Ee=this.type;return cachedKeys(`${Ee}-plugin-${xe}`,()=>[[`plugins.${xe}`,...Ae.additionalOptionScopes||[]]])}_cachedScopes(Ae,xe){const Ee=this._scopeCache;let Se=Ee.get(Ae);return(!Se||xe)&&(Se=new Map,Ee.set(Ae,Se)),Se}getOptionScopes(Ae,xe,Ee){const{options:Se,type:Ce}=this,_e=this._cachedScopes(Ae,Ee),Ie=_e.get(xe);if(Ie)return Ie;const Be=new Set;xe.forEach(Pe=>{Ae&&(Be.add(Ae),Pe.forEach(ke=>addIfFound(Be,Ae,ke))),Pe.forEach(ke=>addIfFound(Be,Se,ke)),Pe.forEach(ke=>addIfFound(Be,overrides[Ce]||{},ke)),Pe.forEach(ke=>addIfFound(Be,defaults$1,ke)),Pe.forEach(ke=>addIfFound(Be,descriptors,ke))});const Te=Array.from(Be);return Te.length===0&&Te.push(Object.create(null)),keysCached.has(xe)&&_e.set(xe,Te),Te}chartOptionScopes(){const{options:Ae,type:xe}=this;return[Ae,overrides[xe]||{},defaults$1.datasets[xe]||{},{type:xe},defaults$1,descriptors]}resolveNamedOptions(Ae,xe,Ee,Se=[""]){const Ce={$shared:!0},{resolver:_e,subPrefixes:Ie}=getResolver(this._resolverCache,Ae,Se);let Be=_e;if(needContext(_e,xe)){Ce.$shared=!1,Ee=isFunction$2(Ee)?Ee():Ee;const Te=this.createResolver(Ae,Ee,Ie);Be=_attachContext(_e,Ee,Te)}for(const Te of xe)Ce[Te]=Be[Te];return Ce}createResolver(Ae,xe,Ee=[""],Se){const{resolver:Ce}=getResolver(this._resolverCache,Ae,Ee);return isObject$1(xe)?_attachContext(Ce,xe,void 0,Se):Ce}}function getResolver(t,Ae,xe){let Ee=t.get(Ae);Ee||(Ee=new Map,t.set(Ae,Ee));const Se=xe.join();let Ce=Ee.get(Se);return Ce||(Ce={resolver:_createResolver(Ae,xe),subPrefixes:xe.filter(Ie=>!Ie.toLowerCase().includes("hover"))},Ee.set(Se,Ce)),Ce}const hasFunction=t=>isObject$1(t)&&Object.getOwnPropertyNames(t).some(Ae=>isFunction$2(t[Ae]));function needContext(t,Ae){const{isScriptable:xe,isIndexable:Ee}=_descriptors(t);for(const Se of Ae){const Ce=xe(Se),_e=Ee(Se),Ie=(_e||Ce)&&t[Se];if(Ce&&(isFunction$2(Ie)||hasFunction(Ie))||_e&&isArray$2(Ie))return!0}return!1}var version="4.4.8";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(t,Ae){return t==="top"||t==="bottom"||KNOWN_POSITIONS.indexOf(t)===-1&&Ae==="x"}function compare2Level(t,Ae){return function(xe,Ee){return xe[t]===Ee[t]?xe[Ae]-Ee[Ae]:xe[t]-Ee[t]}}function onAnimationsComplete(t){const Ae=t.chart,xe=Ae.options.animation;Ae.notifyPlugins("afterRender"),callback(xe&&xe.onComplete,[t],Ae)}function onAnimationProgress(t){const Ae=t.chart,xe=Ae.options.animation;callback(xe&&xe.onProgress,[t],Ae)}function getCanvas(t){return _isDomSupported()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const instances={},getChart=t=>{const Ae=getCanvas(t);return Object.values(instances).filter(xe=>xe.canvas===Ae).pop()};function moveNumericKeys(t,Ae,xe){const Ee=Object.keys(t);for(const Se of Ee){const Ce=+Se;if(Ce>=Ae){const _e=t[Se];delete t[Se],(xe>0||Ce>Ae)&&(t[Ce+xe]=_e)}}}function determineLastEvent(t,Ae,xe,Ee){return!xe||t.type==="mouseout"?null:Ee?Ae:t}function getSizeForArea(t,Ae,xe){return t.options.clip?t[xe]:Ae[xe]}function getDatasetArea(t,Ae){const{xScale:xe,yScale:Ee}=t;return xe&&Ee?{left:getSizeForArea(xe,Ae,"left"),right:getSizeForArea(xe,Ae,"right"),top:getSizeForArea(Ee,Ae,"top"),bottom:getSizeForArea(Ee,Ae,"bottom")}:Ae}class Chart{static register(...Ae){registry.add(...Ae),invalidatePlugins()}static unregister(...Ae){registry.remove(...Ae),invalidatePlugins()}constructor(Ae,xe){const Ee=this.config=new Config(xe),Se=getCanvas(Ae),Ce=getChart(Se);if(Ce)throw new Error("Canvas is already in use. Chart with ID '"+Ce.id+"' must be destroyed before the canvas with ID '"+Ce.canvas.id+"' can be reused.");const _e=Ee.createResolver(Ee.chartOptionScopes(),this.getContext());this.platform=new(Ee.platform||_detectPlatform(Se)),this.platform.updateConfig(Ee);const Ie=this.platform.acquireContext(Se,_e.aspectRatio),Be=Ie&&Ie.canvas,Te=Be&&Be.height,Pe=Be&&Be.width;if(this.id=uid(),this.ctx=Ie,this.canvas=Be,this.width=Pe,this.height=Te,this._options=_e,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(ke=>this.update(ke),_e.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,!Ie||!Be){console.error("Failed to create chart: can't acquire context from the given item");return}animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:Ae,maintainAspectRatio:xe},width:Ee,height:Se,_aspectRatio:Ce}=this;return isNullOrUndef(Ae)?xe&&Ce?Ce:Se?Ee/Se:null:Ae}get data(){return this.config.data}set data(Ae){this.config.data=Ae}get options(){return this._options}set options(Ae){this.config.options=Ae}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(Ae,xe){animator.running(this)?this._resizeBeforeDraw={width:Ae,height:xe}:this._resize(Ae,xe)}_resize(Ae,xe){const Ee=this.options,Se=this.canvas,Ce=Ee.maintainAspectRatio&&this.aspectRatio,_e=this.platform.getMaximumSize(Se,Ae,xe,Ce),Ie=Ee.devicePixelRatio||this.platform.getDevicePixelRatio(),Be=this.width?"resize":"attach";this.width=_e.width,this.height=_e.height,this._aspectRatio=this.aspectRatio,retinaScale(this,Ie,!0)&&(this.notifyPlugins("resize",{size:_e}),callback(Ee.onResize,[this,_e],this),this.attached&&this._doResize(Be)&&this.render())}ensureScalesHaveIDs(){const xe=this.options.scales||{};each(xe,(Ee,Se)=>{Ee.id=Se})}buildOrUpdateScales(){const Ae=this.options,xe=Ae.scales,Ee=this.scales,Se=Object.keys(Ee).reduce((_e,Ie)=>(_e[Ie]=!1,_e),{});let Ce=[];xe&&(Ce=Ce.concat(Object.keys(xe).map(_e=>{const Ie=xe[_e],Be=determineAxis(_e,Ie),Te=Be==="r",Pe=Be==="x";return{options:Ie,dposition:Te?"chartArea":Pe?"bottom":"left",dtype:Te?"radialLinear":Pe?"category":"linear"}}))),each(Ce,_e=>{const Ie=_e.options,Be=Ie.id,Te=determineAxis(Be,Ie),Pe=valueOrDefault(Ie.type,_e.dtype);(Ie.position===void 0||positionIsHorizontal(Ie.position,Te)!==positionIsHorizontal(_e.dposition))&&(Ie.position=_e.dposition),Se[Be]=!0;let ke=null;if(Be in Ee&&Ee[Be].type===Pe)ke=Ee[Be];else{const $e=registry.getScale(Pe);ke=new $e({id:Be,type:Pe,ctx:this.ctx,chart:this}),Ee[ke.id]=ke}ke.init(Ie,Ae)}),each(Se,(_e,Ie)=>{_e||delete Ee[Ie]}),each(Ee,_e=>{layouts.configure(this,_e,_e.options),layouts.addBox(this,_e)})}_updateMetasets(){const Ae=this._metasets,xe=this.data.datasets.length,Ee=Ae.length;if(Ae.sort((Se,Ce)=>Se.index-Ce.index),Ee>xe){for(let Se=xe;Se<Ee;++Se)this._destroyDatasetMeta(Se);Ae.splice(xe,Ee-xe)}this._sortedMetasets=Ae.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){const{_metasets:Ae,data:{datasets:xe}}=this;Ae.length>xe.length&&delete this._stacks,Ae.forEach((Ee,Se)=>{xe.filter(Ce=>Ce===Ee._dataset).length===0&&this._destroyDatasetMeta(Se)})}buildOrUpdateControllers(){const Ae=[],xe=this.data.datasets;let Ee,Se;for(this._removeUnreferencedMetasets(),Ee=0,Se=xe.length;Ee<Se;Ee++){const Ce=xe[Ee];let _e=this.getDatasetMeta(Ee);const Ie=Ce.type||this.config.type;if(_e.type&&_e.type!==Ie&&(this._destroyDatasetMeta(Ee),_e=this.getDatasetMeta(Ee)),_e.type=Ie,_e.indexAxis=Ce.indexAxis||getIndexAxis(Ie,this.options),_e.order=Ce.order||0,_e.index=Ee,_e.label=""+Ce.label,_e.visible=this.isDatasetVisible(Ee),_e.controller)_e.controller.updateIndex(Ee),_e.controller.linkScales();else{const Be=registry.getController(Ie),{datasetElementType:Te,dataElementType:Pe}=defaults$1.datasets[Ie];Object.assign(Be,{dataElementType:registry.getElement(Pe),datasetElementType:Te&&registry.getElement(Te)}),_e.controller=new Be(this,Ee),Ae.push(_e.controller)}}return this._updateMetasets(),Ae}_resetElements(){each(this.data.datasets,(Ae,xe)=>{this.getDatasetMeta(xe).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(Ae){const xe=this.config;xe.update();const Ee=this._options=xe.createResolver(xe.chartOptionScopes(),this.getContext()),Se=this._animationsDisabled=!Ee.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:Ae,cancelable:!0})===!1)return;const Ce=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let _e=0;for(let Te=0,Pe=this.data.datasets.length;Te<Pe;Te++){const{controller:ke}=this.getDatasetMeta(Te),$e=!Se&&Ce.indexOf(ke)===-1;ke.buildOrUpdateElements($e),_e=Math.max(+ke.getMaxOverflow(),_e)}_e=this._minPadding=Ee.layout.autoPadding?_e:0,this._updateLayout(_e),Se||each(Ce,Te=>{Te.reset()}),this._updateDatasets(Ae),this.notifyPlugins("afterUpdate",{mode:Ae}),this._layers.sort(compare2Level("z","_idx"));const{_active:Ie,_lastEvent:Be}=this;Be?this._eventHandler(Be,!0):Ie.length&&this._updateHoverStyles(Ie,Ie,!0),this.render()}_updateScales(){each(this.scales,Ae=>{layouts.removeBox(this,Ae)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const Ae=this.options,xe=new Set(Object.keys(this._listeners)),Ee=new Set(Ae.events);(!setsEqual(xe,Ee)||!!this._responsiveListeners!==Ae.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:Ae}=this,xe=this._getUniformDataChanges()||[];for(const{method:Ee,start:Se,count:Ce}of xe){const _e=Ee==="_removeElements"?-Ce:Ce;moveNumericKeys(Ae,Se,_e)}}_getUniformDataChanges(){const Ae=this._dataChanges;if(!Ae||!Ae.length)return;this._dataChanges=[];const xe=this.data.datasets.length,Ee=Ce=>new Set(Ae.filter(_e=>_e[0]===Ce).map((_e,Ie)=>Ie+","+_e.splice(1).join(","))),Se=Ee(0);for(let Ce=1;Ce<xe;Ce++)if(!setsEqual(Se,Ee(Ce)))return;return Array.from(Se).map(Ce=>Ce.split(",")).map(Ce=>({method:Ce[1],start:+Ce[2],count:+Ce[3]}))}_updateLayout(Ae){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;layouts.update(this,this.width,this.height,Ae);const xe=this.chartArea,Ee=xe.width<=0||xe.height<=0;this._layers=[],each(this.boxes,Se=>{Ee&&Se.position==="chartArea"||(Se.configure&&Se.configure(),this._layers.push(...Se._layers()))},this),this._layers.forEach((Se,Ce)=>{Se._idx=Ce}),this.notifyPlugins("afterLayout")}_updateDatasets(Ae){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:Ae,cancelable:!0})!==!1){for(let xe=0,Ee=this.data.datasets.length;xe<Ee;++xe)this.getDatasetMeta(xe).controller.configure();for(let xe=0,Ee=this.data.datasets.length;xe<Ee;++xe)this._updateDataset(xe,isFunction$2(Ae)?Ae({datasetIndex:xe}):Ae);this.notifyPlugins("afterDatasetsUpdate",{mode:Ae})}}_updateDataset(Ae,xe){const Ee=this.getDatasetMeta(Ae),Se={meta:Ee,index:Ae,mode:xe,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",Se)!==!1&&(Ee.controller._update(xe),Se.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",Se))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})))}draw(){let Ae;if(this._resizeBeforeDraw){const{width:Ee,height:Se}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(Ee,Se)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const xe=this._layers;for(Ae=0;Ae<xe.length&&xe[Ae].z<=0;++Ae)xe[Ae].draw(this.chartArea);for(this._drawDatasets();Ae<xe.length;++Ae)xe[Ae].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(Ae){const xe=this._sortedMetasets,Ee=[];let Se,Ce;for(Se=0,Ce=xe.length;Se<Ce;++Se){const _e=xe[Se];(!Ae||_e.visible)&&Ee.push(_e)}return Ee}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const Ae=this.getSortedVisibleDatasetMetas();for(let xe=Ae.length-1;xe>=0;--xe)this._drawDataset(Ae[xe]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(Ae){const xe=this.ctx,Ee=Ae._clip,Se=!Ee.disabled,Ce=getDatasetArea(Ae,this.chartArea),_e={meta:Ae,index:Ae.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",_e)!==!1&&(Se&&clipArea(xe,{left:Ee.left===!1?0:Ce.left-Ee.left,right:Ee.right===!1?this.width:Ce.right+Ee.right,top:Ee.top===!1?0:Ce.top-Ee.top,bottom:Ee.bottom===!1?this.height:Ce.bottom+Ee.bottom}),Ae.controller.draw(),Se&&unclipArea(xe),_e.cancelable=!1,this.notifyPlugins("afterDatasetDraw",_e))}isPointInArea(Ae){return _isPointInArea(Ae,this.chartArea,this._minPadding)}getElementsAtEventForMode(Ae,xe,Ee,Se){const Ce=Interaction.modes[xe];return typeof Ce=="function"?Ce(this,Ae,Ee,Se):[]}getDatasetMeta(Ae){const xe=this.data.datasets[Ae],Ee=this._metasets;let Se=Ee.filter(Ce=>Ce&&Ce._dataset===xe).pop();return Se||(Se={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:xe&&xe.order||0,index:Ae,_dataset:xe,_parsed:[],_sorted:!1},Ee.push(Se)),Se}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(Ae){const xe=this.data.datasets[Ae];if(!xe)return!1;const Ee=this.getDatasetMeta(Ae);return typeof Ee.hidden=="boolean"?!Ee.hidden:!xe.hidden}setDatasetVisibility(Ae,xe){const Ee=this.getDatasetMeta(Ae);Ee.hidden=!xe}toggleDataVisibility(Ae){this._hiddenIndices[Ae]=!this._hiddenIndices[Ae]}getDataVisibility(Ae){return!this._hiddenIndices[Ae]}_updateVisibility(Ae,xe,Ee){const Se=Ee?"show":"hide",Ce=this.getDatasetMeta(Ae),_e=Ce.controller._resolveAnimations(void 0,Se);defined(xe)?(Ce.data[xe].hidden=!Ee,this.update()):(this.setDatasetVisibility(Ae,Ee),_e.update(Ce,{visible:Ee}),this.update(Ie=>Ie.datasetIndex===Ae?Se:void 0))}hide(Ae,xe){this._updateVisibility(Ae,xe,!1)}show(Ae,xe){this._updateVisibility(Ae,xe,!0)}_destroyDatasetMeta(Ae){const xe=this._metasets[Ae];xe&&xe.controller&&xe.controller._destroy(),delete this._metasets[Ae]}_stop(){let Ae,xe;for(this.stop(),animator.remove(this),Ae=0,xe=this.data.datasets.length;Ae<xe;++Ae)this._destroyDatasetMeta(Ae)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:Ae,ctx:xe}=this;this._stop(),this.config.clearCache(),Ae&&(this.unbindEvents(),clearCanvas(Ae,xe),this.platform.releaseContext(xe),this.canvas=null,this.ctx=null),delete instances[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...Ae){return this.canvas.toDataURL(...Ae)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const Ae=this._listeners,xe=this.platform,Ee=(Ce,_e)=>{xe.addEventListener(this,Ce,_e),Ae[Ce]=_e},Se=(Ce,_e,Ie)=>{Ce.offsetX=_e,Ce.offsetY=Ie,this._eventHandler(Ce)};each(this.options.events,Ce=>Ee(Ce,Se))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const Ae=this._responsiveListeners,xe=this.platform,Ee=(Be,Te)=>{xe.addEventListener(this,Be,Te),Ae[Be]=Te},Se=(Be,Te)=>{Ae[Be]&&(xe.removeEventListener(this,Be,Te),delete Ae[Be])},Ce=(Be,Te)=>{this.canvas&&this.resize(Be,Te)};let _e;const Ie=()=>{Se("attach",Ie),this.attached=!0,this.resize(),Ee("resize",Ce),Ee("detach",_e)};_e=()=>{this.attached=!1,Se("resize",Ce),this._stop(),this._resize(0,0),Ee("attach",Ie)},xe.isAttached(this.canvas)?Ie():_e()}unbindEvents(){each(this._listeners,(Ae,xe)=>{this.platform.removeEventListener(this,xe,Ae)}),this._listeners={},each(this._responsiveListeners,(Ae,xe)=>{this.platform.removeEventListener(this,xe,Ae)}),this._responsiveListeners=void 0}updateHoverStyle(Ae,xe,Ee){const Se=Ee?"set":"remove";let Ce,_e,Ie,Be;for(xe==="dataset"&&(Ce=this.getDatasetMeta(Ae[0].datasetIndex),Ce.controller["_"+Se+"DatasetHoverStyle"]()),Ie=0,Be=Ae.length;Ie<Be;++Ie){_e=Ae[Ie];const Te=_e&&this.getDatasetMeta(_e.datasetIndex).controller;Te&&Te[Se+"HoverStyle"](_e.element,_e.datasetIndex,_e.index)}}getActiveElements(){return this._active||[]}setActiveElements(Ae){const xe=this._active||[],Ee=Ae.map(({datasetIndex:Ce,index:_e})=>{const Ie=this.getDatasetMeta(Ce);if(!Ie)throw new Error("No dataset found at index "+Ce);return{datasetIndex:Ce,element:Ie.data[_e],index:_e}});!_elementsEqual(Ee,xe)&&(this._active=Ee,this._lastEvent=null,this._updateHoverStyles(Ee,xe))}notifyPlugins(Ae,xe,Ee){return this._plugins.notify(this,Ae,xe,Ee)}isPluginEnabled(Ae){return this._plugins._cache.filter(xe=>xe.plugin.id===Ae).length===1}_updateHoverStyles(Ae,xe,Ee){const Se=this.options.hover,Ce=(Be,Te)=>Be.filter(Pe=>!Te.some(ke=>Pe.datasetIndex===ke.datasetIndex&&Pe.index===ke.index)),_e=Ce(xe,Ae),Ie=Ee?Ae:Ce(Ae,xe);_e.length&&this.updateHoverStyle(_e,Se.mode,!1),Ie.length&&Se.mode&&this.updateHoverStyle(Ie,Se.mode,!0)}_eventHandler(Ae,xe){const Ee={event:Ae,replay:xe,cancelable:!0,inChartArea:this.isPointInArea(Ae)},Se=_e=>(_e.options.events||this.options.events).includes(Ae.native.type);if(this.notifyPlugins("beforeEvent",Ee,Se)===!1)return;const Ce=this._handleEvent(Ae,xe,Ee.inChartArea);return Ee.cancelable=!1,this.notifyPlugins("afterEvent",Ee,Se),(Ce||Ee.changed)&&this.render(),this}_handleEvent(Ae,xe,Ee){const{_active:Se=[],options:Ce}=this,_e=xe,Ie=this._getActiveElements(Ae,Se,Ee,_e),Be=_isClickEvent(Ae),Te=determineLastEvent(Ae,this._lastEvent,Ee,Be);Ee&&(this._lastEvent=null,callback(Ce.onHover,[Ae,Ie,this],this),Be&&callback(Ce.onClick,[Ae,Ie,this],this));const Pe=!_elementsEqual(Ie,Se);return(Pe||xe)&&(this._active=Ie,this._updateHoverStyles(Ie,Se,xe)),this._lastEvent=Te,Pe}_getActiveElements(Ae,xe,Ee,Se){if(Ae.type==="mouseout")return[];if(!Ee)return xe;const Ce=this.options.hover;return this.getElementsAtEventForMode(Ae,Ce.mode,Ce,Se)}}$i(Chart,"defaults",defaults$1),$i(Chart,"instances",instances),$i(Chart,"overrides",overrides),$i(Chart,"registry",registry),$i(Chart,"version",version),$i(Chart,"getChart",getChart);function invalidatePlugins(){return each(Chart.instances,t=>t._plugins.invalidate())}function setStyle(t,Ae,xe=Ae){t.lineCap=valueOrDefault(xe.borderCapStyle,Ae.borderCapStyle),t.setLineDash(valueOrDefault(xe.borderDash,Ae.borderDash)),t.lineDashOffset=valueOrDefault(xe.borderDashOffset,Ae.borderDashOffset),t.lineJoin=valueOrDefault(xe.borderJoinStyle,Ae.borderJoinStyle),t.lineWidth=valueOrDefault(xe.borderWidth,Ae.borderWidth),t.strokeStyle=valueOrDefault(xe.borderColor,Ae.borderColor)}function lineTo(t,Ae,xe){t.lineTo(xe.x,xe.y)}function getLineMethod(t){return t.stepped?_steppedLineTo:t.tension||t.cubicInterpolationMode==="monotone"?_bezierCurveTo:lineTo}function pathVars(t,Ae,xe={}){const Ee=t.length,{start:Se=0,end:Ce=Ee-1}=xe,{start:_e,end:Ie}=Ae,Be=Math.max(Se,_e),Te=Math.min(Ce,Ie),Pe=Se<_e&&Ce<_e||Se>Ie&&Ce>Ie;return{count:Ee,start:Be,loop:Ae.loop,ilen:Te<Be&&!Pe?Ee+Te-Be:Te-Be}}function pathSegment(t,Ae,xe,Ee){const{points:Se,options:Ce}=Ae,{count:_e,start:Ie,loop:Be,ilen:Te}=pathVars(Se,xe,Ee),Pe=getLineMethod(Ce);let{move:ke=!0,reverse:$e}=Ee||{},Oe,Ue,qe;for(Oe=0;Oe<=Te;++Oe)Ue=Se[(Ie+($e?Te-Oe:Oe))%_e],!Ue.skip&&(ke?(t.moveTo(Ue.x,Ue.y),ke=!1):Pe(t,qe,Ue,$e,Ce.stepped),qe=Ue);return Be&&(Ue=Se[(Ie+($e?Te:0))%_e],Pe(t,qe,Ue,$e,Ce.stepped)),!!Be}function fastPathSegment(t,Ae,xe,Ee){const Se=Ae.points,{count:Ce,start:_e,ilen:Ie}=pathVars(Se,xe,Ee),{move:Be=!0,reverse:Te}=Ee||{};let Pe=0,ke=0,$e,Oe,Ue,qe,ze,Ve;const Ge=er=>(_e+(Te?Ie-er:er))%Ce,Xe=()=>{qe!==ze&&(t.lineTo(Pe,ze),t.lineTo(Pe,qe),t.lineTo(Pe,Ve))};for(Be&&(Oe=Se[Ge(0)],t.moveTo(Oe.x,Oe.y)),$e=0;$e<=Ie;++$e){if(Oe=Se[Ge($e)],Oe.skip)continue;const er=Oe.x,tr=Oe.y,nr=er|0;nr===Ue?(tr<qe?qe=tr:tr>ze&&(ze=tr),Pe=(ke*Pe+er)/++ke):(Xe(),t.lineTo(er,tr),Ue=nr,ke=0,qe=ze=tr),Ve=tr}Xe()}function _getSegmentMethod(t){const Ae=t.options,xe=Ae.borderDash&&Ae.borderDash.length;return!t._decimated&&!t._loop&&!Ae.tension&&Ae.cubicInterpolationMode!=="monotone"&&!Ae.stepped&&!xe?fastPathSegment:pathSegment}function _getInterpolationMethod(t){return t.stepped?_steppedInterpolation:t.tension||t.cubicInterpolationMode==="monotone"?_bezierInterpolation:_pointInLine}function strokePathWithCache(t,Ae,xe,Ee){let Se=Ae._path;Se||(Se=Ae._path=new Path2D,Ae.path(Se,xe,Ee)&&Se.closePath()),setStyle(t,Ae.options),t.stroke(Se)}function strokePathDirect(t,Ae,xe,Ee){const{segments:Se,options:Ce}=Ae,_e=_getSegmentMethod(Ae);for(const Ie of Se)setStyle(t,Ce,Ie.style),t.beginPath(),_e(t,Ae,Ie,{start:xe,end:xe+Ee-1})&&t.closePath(),t.stroke()}const usePath2D=typeof Path2D=="function";function draw(t,Ae,xe,Ee){usePath2D&&!Ae.options.segment?strokePathWithCache(t,Ae,xe,Ee):strokePathDirect(t,Ae,xe,Ee)}class LineElement extends Element$2{constructor(Ae){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,Ae&&Object.assign(this,Ae)}updateControlPoints(Ae,xe){const Ee=this.options;if((Ee.tension||Ee.cubicInterpolationMode==="monotone")&&!Ee.stepped&&!this._pointsUpdated){const Se=Ee.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,Ee,Ae,Se,xe),this._pointsUpdated=!0}}set points(Ae){this._points=Ae,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const Ae=this.segments,xe=this.points;return Ae.length&&xe[Ae[0].start]}last(){const Ae=this.segments,xe=this.points,Ee=Ae.length;return Ee&&xe[Ae[Ee-1].end]}interpolate(Ae,xe){const Ee=this.options,Se=Ae[xe],Ce=this.points,_e=_boundSegments(this,{property:xe,start:Se,end:Se});if(!_e.length)return;const Ie=[],Be=_getInterpolationMethod(Ee);let Te,Pe;for(Te=0,Pe=_e.length;Te<Pe;++Te){const{start:ke,end:$e}=_e[Te],Oe=Ce[ke],Ue=Ce[$e];if(Oe===Ue){Ie.push(Oe);continue}const qe=Math.abs((Se-Oe[xe])/(Ue[xe]-Oe[xe])),ze=Be(Oe,Ue,qe,Ee.stepped);ze[xe]=Ae[xe],Ie.push(ze)}return Ie.length===1?Ie[0]:Ie}pathSegment(Ae,xe,Ee){return _getSegmentMethod(this)(Ae,this,xe,Ee)}path(Ae,xe,Ee){const Se=this.segments,Ce=_getSegmentMethod(this);let _e=this._loop;xe=xe||0,Ee=Ee||this.points.length-xe;for(const Ie of Se)_e&=Ce(Ae,this,Ie,{start:xe,end:xe+Ee-1});return!!_e}draw(Ae,xe,Ee,Se){const Ce=this.options||{};(this.points||[]).length&&Ce.borderWidth&&(Ae.save(),draw(Ae,this,Ee,Se),Ae.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}$i(LineElement,"id","line"),$i(LineElement,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),$i(LineElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),$i(LineElement,"descriptors",{_scriptable:!0,_indexable:Ae=>Ae!=="borderDash"&&Ae!=="fill"});function inRange$1(t,Ae,xe,Ee){const Se=t.options,{[xe]:Ce}=t.getProps([xe],Ee);return Math.abs(Ae-Ce)<Se.radius+Se.hitRadius}class PointElement extends Element$2{constructor(xe){super();$i(this,"parsed");$i(this,"skip");$i(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,xe&&Object.assign(this,xe)}inRange(xe,Ee,Se){const Ce=this.options,{x:_e,y:Ie}=this.getProps(["x","y"],Se);return Math.pow(xe-_e,2)+Math.pow(Ee-Ie,2)<Math.pow(Ce.hitRadius+Ce.radius,2)}inXRange(xe,Ee){return inRange$1(this,xe,"x",Ee)}inYRange(xe,Ee){return inRange$1(this,xe,"y",Ee)}getCenterPoint(xe){const{x:Ee,y:Se}=this.getProps(["x","y"],xe);return{x:Ee,y:Se}}size(xe){xe=xe||this.options||{};let Ee=xe.radius||0;Ee=Math.max(Ee,Ee&&xe.hoverRadius||0);const Se=Ee&&xe.borderWidth||0;return(Ee+Se)*2}draw(xe,Ee){const Se=this.options;this.skip||Se.radius<.1||!_isPointInArea(this,Ee,this.size(Se)/2)||(xe.strokeStyle=Se.borderColor,xe.lineWidth=Se.borderWidth,xe.fillStyle=Se.backgroundColor,drawPoint(xe,Se,this.x,this.y))}getRange(){const xe=this.options||{};return xe.radius+xe.hitRadius}}$i(PointElement,"id","point"),$i(PointElement,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),$i(PointElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function getBarBounds(t,Ae){const{x:xe,y:Ee,base:Se,width:Ce,height:_e}=t.getProps(["x","y","base","width","height"],Ae);let Ie,Be,Te,Pe,ke;return t.horizontal?(ke=_e/2,Ie=Math.min(xe,Se),Be=Math.max(xe,Se),Te=Ee-ke,Pe=Ee+ke):(ke=Ce/2,Ie=xe-ke,Be=xe+ke,Te=Math.min(Ee,Se),Pe=Math.max(Ee,Se)),{left:Ie,top:Te,right:Be,bottom:Pe}}function skipOrLimit(t,Ae,xe,Ee){return t?0:_limitValue(Ae,xe,Ee)}function parseBorderWidth(t,Ae,xe){const Ee=t.options.borderWidth,Se=t.borderSkipped,Ce=toTRBL(Ee);return{t:skipOrLimit(Se.top,Ce.top,0,xe),r:skipOrLimit(Se.right,Ce.right,0,Ae),b:skipOrLimit(Se.bottom,Ce.bottom,0,xe),l:skipOrLimit(Se.left,Ce.left,0,Ae)}}function parseBorderRadius(t,Ae,xe){const{enableBorderRadius:Ee}=t.getProps(["enableBorderRadius"]),Se=t.options.borderRadius,Ce=toTRBLCorners(Se),_e=Math.min(Ae,xe),Ie=t.borderSkipped,Be=Ee||isObject$1(Se);return{topLeft:skipOrLimit(!Be||Ie.top||Ie.left,Ce.topLeft,0,_e),topRight:skipOrLimit(!Be||Ie.top||Ie.right,Ce.topRight,0,_e),bottomLeft:skipOrLimit(!Be||Ie.bottom||Ie.left,Ce.bottomLeft,0,_e),bottomRight:skipOrLimit(!Be||Ie.bottom||Ie.right,Ce.bottomRight,0,_e)}}function boundingRects(t){const Ae=getBarBounds(t),xe=Ae.right-Ae.left,Ee=Ae.bottom-Ae.top,Se=parseBorderWidth(t,xe/2,Ee/2),Ce=parseBorderRadius(t,xe/2,Ee/2);return{outer:{x:Ae.left,y:Ae.top,w:xe,h:Ee,radius:Ce},inner:{x:Ae.left+Se.l,y:Ae.top+Se.t,w:xe-Se.l-Se.r,h:Ee-Se.t-Se.b,radius:{topLeft:Math.max(0,Ce.topLeft-Math.max(Se.t,Se.l)),topRight:Math.max(0,Ce.topRight-Math.max(Se.t,Se.r)),bottomLeft:Math.max(0,Ce.bottomLeft-Math.max(Se.b,Se.l)),bottomRight:Math.max(0,Ce.bottomRight-Math.max(Se.b,Se.r))}}}}function inRange(t,Ae,xe,Ee){const Se=Ae===null,Ce=xe===null,Ie=t&&!(Se&&Ce)&&getBarBounds(t,Ee);return Ie&&(Se||_isBetween(Ae,Ie.left,Ie.right))&&(Ce||_isBetween(xe,Ie.top,Ie.bottom))}function hasRadius(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function addNormalRectPath(t,Ae){t.rect(Ae.x,Ae.y,Ae.w,Ae.h)}function inflateRect(t,Ae,xe={}){const Ee=t.x!==xe.x?-Ae:0,Se=t.y!==xe.y?-Ae:0,Ce=(t.x+t.w!==xe.x+xe.w?Ae:0)-Ee,_e=(t.y+t.h!==xe.y+xe.h?Ae:0)-Se;return{x:t.x+Ee,y:t.y+Se,w:t.w+Ce,h:t.h+_e,radius:t.radius}}class BarElement extends Element$2{constructor(Ae){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,Ae&&Object.assign(this,Ae)}draw(Ae){const{inflateAmount:xe,options:{borderColor:Ee,backgroundColor:Se}}=this,{inner:Ce,outer:_e}=boundingRects(this),Ie=hasRadius(_e.radius)?addRoundedRectPath:addNormalRectPath;Ae.save(),(_e.w!==Ce.w||_e.h!==Ce.h)&&(Ae.beginPath(),Ie(Ae,inflateRect(_e,xe,Ce)),Ae.clip(),Ie(Ae,inflateRect(Ce,-xe,_e)),Ae.fillStyle=Ee,Ae.fill("evenodd")),Ae.beginPath(),Ie(Ae,inflateRect(Ce,xe)),Ae.fillStyle=Se,Ae.fill(),Ae.restore()}inRange(Ae,xe,Ee){return inRange(this,Ae,xe,Ee)}inXRange(Ae,xe){return inRange(this,Ae,null,xe)}inYRange(Ae,xe){return inRange(this,null,Ae,xe)}getCenterPoint(Ae){const{x:xe,y:Ee,base:Se,horizontal:Ce}=this.getProps(["x","y","base","horizontal"],Ae);return{x:Ce?(xe+Se)/2:xe,y:Ce?Ee:(Ee+Se)/2}}getRange(Ae){return Ae==="x"?this.width/2:this.height/2}}$i(BarElement,"id","bar"),$i(BarElement,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),$i(BarElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const BORDER_COLORS=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],BACKGROUND_COLORS=BORDER_COLORS.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function getBorderColor(t){return BORDER_COLORS[t%BORDER_COLORS.length]}function getBackgroundColor(t){return BACKGROUND_COLORS[t%BACKGROUND_COLORS.length]}function colorizeDefaultDataset(t,Ae){return t.borderColor=getBorderColor(Ae),t.backgroundColor=getBackgroundColor(Ae),++Ae}function colorizeDoughnutDataset(t,Ae){return t.backgroundColor=t.data.map(()=>getBorderColor(Ae++)),Ae}function colorizePolarAreaDataset(t,Ae){return t.backgroundColor=t.data.map(()=>getBackgroundColor(Ae++)),Ae}function getColorizer(t){let Ae=0;return(xe,Ee)=>{const Se=t.getDatasetMeta(Ee).controller;Se instanceof DoughnutController?Ae=colorizeDoughnutDataset(xe,Ae):Se instanceof PolarAreaController?Ae=colorizePolarAreaDataset(xe,Ae):Se&&(Ae=colorizeDefaultDataset(xe,Ae))}}function containsColorsDefinitions(t){let Ae;for(Ae in t)if(t[Ae].borderColor||t[Ae].backgroundColor)return!0;return!1}function containsColorsDefinition(t){return t&&(t.borderColor||t.backgroundColor)}function containsDefaultColorsDefenitions(){return defaults$1.borderColor!=="rgba(0,0,0,0.1)"||defaults$1.backgroundColor!=="rgba(0,0,0,0.1)"}var plugin_colors={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,Ae,xe){if(!xe.enabled)return;const{data:{datasets:Ee},options:Se}=t.config,{elements:Ce}=Se,_e=containsColorsDefinitions(Ee)||containsColorsDefinition(Se)||Ce&&containsColorsDefinitions(Ce)||containsDefaultColorsDefenitions();if(!xe.forceOverride&&_e)return;const Ie=getColorizer(t);Ee.forEach(Ie)}};const positioners={average(t){if(!t.length)return!1;let Ae,xe,Ee=new Set,Se=0,Ce=0;for(Ae=0,xe=t.length;Ae<xe;++Ae){const Ie=t[Ae].element;if(Ie&&Ie.hasValue()){const Be=Ie.tooltipPosition();Ee.add(Be.x),Se+=Be.y,++Ce}}return Ce===0||Ee.size===0?!1:{x:[...Ee].reduce((Ie,Be)=>Ie+Be)/Ee.size,y:Se/Ce}},nearest(t,Ae){if(!t.length)return!1;let xe=Ae.x,Ee=Ae.y,Se=Number.POSITIVE_INFINITY,Ce,_e,Ie;for(Ce=0,_e=t.length;Ce<_e;++Ce){const Be=t[Ce].element;if(Be&&Be.hasValue()){const Te=Be.getCenterPoint(),Pe=distanceBetweenPoints(Ae,Te);Pe<Se&&(Se=Pe,Ie=Be)}}if(Ie){const Be=Ie.tooltipPosition();xe=Be.x,Ee=Be.y}return{x:xe,y:Ee}}};function pushOrConcat(t,Ae){return Ae&&(isArray$2(Ae)?Array.prototype.push.apply(t,Ae):t.push(Ae)),t}function splitNewlines(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
598
+ */class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(Ae,xe,Ee,Se){const Ce=xe.listeners[Se],_e=xe.duration;Ce.forEach(Ie=>Ie({chart:Ae,initial:xe.initial,numSteps:_e,currentStep:Math.min(Ee-xe.start,_e)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(Ae=Date.now()){let xe=0;this._charts.forEach((Ee,Se)=>{if(!Ee.running||!Ee.items.length)return;const Ce=Ee.items;let _e=Ce.length-1,Ie=!1,Be;for(;_e>=0;--_e)Be=Ce[_e],Be._active?(Be._total>Ee.duration&&(Ee.duration=Be._total),Be.tick(Ae),Ie=!0):(Ce[_e]=Ce[Ce.length-1],Ce.pop());Ie&&(Se.draw(),this._notify(Se,Ee,Ae,"progress")),Ce.length||(Ee.running=!1,this._notify(Se,Ee,Ae,"complete"),Ee.initial=!1),xe+=Ce.length}),this._lastDate=Ae,xe===0&&(this._running=!1)}_getAnims(Ae){const xe=this._charts;let Ee=xe.get(Ae);return Ee||(Ee={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},xe.set(Ae,Ee)),Ee}listen(Ae,xe,Ee){this._getAnims(Ae).listeners[xe].push(Ee)}add(Ae,xe){!xe||!xe.length||this._getAnims(Ae).items.push(...xe)}has(Ae){return this._getAnims(Ae).items.length>0}start(Ae){const xe=this._charts.get(Ae);xe&&(xe.running=!0,xe.start=Date.now(),xe.duration=xe.items.reduce((Ee,Se)=>Math.max(Ee,Se._duration),0),this._refresh())}running(Ae){if(!this._running)return!1;const xe=this._charts.get(Ae);return!(!xe||!xe.running||!xe.items.length)}stop(Ae){const xe=this._charts.get(Ae);if(!xe||!xe.items.length)return;const Ee=xe.items;let Se=Ee.length-1;for(;Se>=0;--Se)Ee[Se].cancel();xe.items=[],this._notify(Ae,xe,Date.now(),"complete")}remove(Ae){return this._charts.delete(Ae)}}var animator=new Animator;const transparent="transparent",interpolators={boolean(t,Ae,xe){return xe>.5?Ae:t},color(t,Ae,xe){const Ee=color$3(t||transparent),Se=Ee.valid&&color$3(Ae||transparent);return Se&&Se.valid?Se.mix(Ee,xe).hexString():Ae},number(t,Ae,xe){return t+(Ae-t)*xe}};class Animation{constructor(Ae,xe,Ee,Se){const Ce=xe[Ee];Se=resolve([Ae.to,Se,Ce,Ae.from]);const _e=resolve([Ae.from,Ce,Se]);this._active=!0,this._fn=Ae.fn||interpolators[Ae.type||typeof _e],this._easing=effects[Ae.easing]||effects.linear,this._start=Math.floor(Date.now()+(Ae.delay||0)),this._duration=this._total=Math.floor(Ae.duration),this._loop=!!Ae.loop,this._target=xe,this._prop=Ee,this._from=_e,this._to=Se,this._promises=void 0}active(){return this._active}update(Ae,xe,Ee){if(this._active){this._notify(!1);const Se=this._target[this._prop],Ce=Ee-this._start,_e=this._duration-Ce;this._start=Ee,this._duration=Math.floor(Math.max(_e,Ae.duration)),this._total+=Ce,this._loop=!!Ae.loop,this._to=resolve([Ae.to,xe,Se,Ae.from]),this._from=resolve([Ae.from,Se,xe])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(Ae){const xe=Ae-this._start,Ee=this._duration,Se=this._prop,Ce=this._from,_e=this._loop,Ie=this._to;let Be;if(this._active=Ce!==Ie&&(_e||xe<Ee),!this._active){this._target[Se]=Ie,this._notify(!0);return}if(xe<0){this._target[Se]=Ce;return}Be=xe/Ee%2,Be=_e&&Be>1?2-Be:Be,Be=this._easing(Math.min(1,Math.max(0,Be))),this._target[Se]=this._fn(Ce,Ie,Be)}wait(){const Ae=this._promises||(this._promises=[]);return new Promise((xe,Ee)=>{Ae.push({res:xe,rej:Ee})})}_notify(Ae){const xe=Ae?"res":"rej",Ee=this._promises||[];for(let Se=0;Se<Ee.length;Se++)Ee[Se][xe]()}}class Animations{constructor(Ae,xe){this._chart=Ae,this._properties=new Map,this.configure(xe)}configure(Ae){if(!isObject$1(Ae))return;const xe=Object.keys(defaults$1.animation),Ee=this._properties;Object.getOwnPropertyNames(Ae).forEach(Se=>{const Ce=Ae[Se];if(!isObject$1(Ce))return;const _e={};for(const Ie of xe)_e[Ie]=Ce[Ie];(isArray$2(Ce.properties)&&Ce.properties||[Se]).forEach(Ie=>{(Ie===Se||!Ee.has(Ie))&&Ee.set(Ie,_e)})})}_animateOptions(Ae,xe){const Ee=xe.options,Se=resolveTargetOptions(Ae,Ee);if(!Se)return[];const Ce=this._createAnimations(Se,Ee);return Ee.$shared&&awaitAll(Ae.options.$animations,Ee).then(()=>{Ae.options=Ee},()=>{}),Ce}_createAnimations(Ae,xe){const Ee=this._properties,Se=[],Ce=Ae.$animations||(Ae.$animations={}),_e=Object.keys(xe),Ie=Date.now();let Be;for(Be=_e.length-1;Be>=0;--Be){const Te=_e[Be];if(Te.charAt(0)==="$")continue;if(Te==="options"){Se.push(...this._animateOptions(Ae,xe));continue}const Pe=xe[Te];let ke=Ce[Te];const $e=Ee.get(Te);if(ke)if($e&&ke.active()){ke.update($e,Pe,Ie);continue}else ke.cancel();if(!$e||!$e.duration){Ae[Te]=Pe;continue}Ce[Te]=ke=new Animation($e,Ae,Te,Pe),Se.push(ke)}return Se}update(Ae,xe){if(this._properties.size===0){Object.assign(Ae,xe);return}const Ee=this._createAnimations(Ae,xe);if(Ee.length)return animator.add(this._chart,Ee),!0}}function awaitAll(t,Ae){const xe=[],Ee=Object.keys(Ae);for(let Se=0;Se<Ee.length;Se++){const Ce=t[Ee[Se]];Ce&&Ce.active()&&xe.push(Ce.wait())}return Promise.all(xe)}function resolveTargetOptions(t,Ae){if(!Ae)return;let xe=t.options;if(!xe){t.options=Ae;return}return xe.$shared&&(t.options=xe=Object.assign({},xe,{$shared:!1,$animations:{}})),xe}function scaleClip(t,Ae){const xe=t&&t.options||{},Ee=xe.reverse,Se=xe.min===void 0?Ae:0,Ce=xe.max===void 0?Ae:0;return{start:Ee?Ce:Se,end:Ee?Se:Ce}}function defaultClip(t,Ae,xe){if(xe===!1)return!1;const Ee=scaleClip(t,xe),Se=scaleClip(Ae,xe);return{top:Se.end,right:Ee.end,bottom:Se.start,left:Ee.start}}function toClip(t){let Ae,xe,Ee,Se;return isObject$1(t)?(Ae=t.top,xe=t.right,Ee=t.bottom,Se=t.left):Ae=xe=Ee=Se=t,{top:Ae,right:xe,bottom:Ee,left:Se,disabled:t===!1}}function getSortedDatasetIndices(t,Ae){const xe=[],Ee=t._getSortedDatasetMetas(Ae);let Se,Ce;for(Se=0,Ce=Ee.length;Se<Ce;++Se)xe.push(Ee[Se].index);return xe}function applyStack(t,Ae,xe,Ee={}){const Se=t.keys,Ce=Ee.mode==="single";let _e,Ie,Be,Te;if(Ae===null)return;let Pe=!1;for(_e=0,Ie=Se.length;_e<Ie;++_e){if(Be=+Se[_e],Be===xe){if(Pe=!0,Ee.all)continue;break}Te=t.values[Be],isNumberFinite(Te)&&(Ce||Ae===0||sign(Ae)===sign(Te))&&(Ae+=Te)}return!Pe&&!Ee.all?0:Ae}function convertObjectDataToArray(t,Ae){const{iScale:xe,vScale:Ee}=Ae,Se=xe.axis==="x"?"x":"y",Ce=Ee.axis==="x"?"x":"y",_e=Object.keys(t),Ie=new Array(_e.length);let Be,Te,Pe;for(Be=0,Te=_e.length;Be<Te;++Be)Pe=_e[Be],Ie[Be]={[Se]:Pe,[Ce]:t[Pe]};return Ie}function isStacked(t,Ae){const xe=t&&t.options.stacked;return xe||xe===void 0&&Ae.stack!==void 0}function getStackKey(t,Ae,xe){return`${t.id}.${Ae.id}.${xe.stack||xe.type}`}function getUserBounds(t){const{min:Ae,max:xe,minDefined:Ee,maxDefined:Se}=t.getUserBounds();return{min:Ee?Ae:Number.NEGATIVE_INFINITY,max:Se?xe:Number.POSITIVE_INFINITY}}function getOrCreateStack(t,Ae,xe){const Ee=t[Ae]||(t[Ae]={});return Ee[xe]||(Ee[xe]={})}function getLastIndexInStack(t,Ae,xe,Ee){for(const Se of Ae.getMatchingVisibleMetas(Ee).reverse()){const Ce=t[Se.index];if(xe&&Ce>0||!xe&&Ce<0)return Se.index}return null}function updateStacks(t,Ae){const{chart:xe,_cachedMeta:Ee}=t,Se=xe._stacks||(xe._stacks={}),{iScale:Ce,vScale:_e,index:Ie}=Ee,Be=Ce.axis,Te=_e.axis,Pe=getStackKey(Ce,_e,Ee),ke=Ae.length;let $e;for(let Oe=0;Oe<ke;++Oe){const Ue=Ae[Oe],{[Be]:qe,[Te]:ze}=Ue,Ve=Ue._stacks||(Ue._stacks={});$e=Ve[Te]=getOrCreateStack(Se,Pe,qe),$e[Ie]=ze,$e._top=getLastIndexInStack($e,_e,!0,Ee.type),$e._bottom=getLastIndexInStack($e,_e,!1,Ee.type);const Ge=$e._visualValues||($e._visualValues={});Ge[Ie]=ze}}function getFirstScaleId(t,Ae){const xe=t.scales;return Object.keys(xe).filter(Ee=>xe[Ee].axis===Ae).shift()}function createDatasetContext(t,Ae){return createContext(t,{active:!1,dataset:void 0,datasetIndex:Ae,index:Ae,mode:"default",type:"dataset"})}function createDataContext(t,Ae,xe){return createContext(t,{active:!1,dataIndex:Ae,parsed:void 0,raw:void 0,element:xe,index:Ae,mode:"default",type:"data"})}function clearStacks(t,Ae){const xe=t.controller.index,Ee=t.vScale&&t.vScale.axis;if(Ee){Ae=Ae||t._parsed;for(const Se of Ae){const Ce=Se._stacks;if(!Ce||Ce[Ee]===void 0||Ce[Ee][xe]===void 0)return;delete Ce[Ee][xe],Ce[Ee]._visualValues!==void 0&&Ce[Ee]._visualValues[xe]!==void 0&&delete Ce[Ee]._visualValues[xe]}}}const isDirectUpdateMode=t=>t==="reset"||t==="none",cloneIfNotShared=(t,Ae)=>Ae?t:Object.assign({},t),createStack=(t,Ae,xe)=>t&&!Ae.hidden&&Ae._stacked&&{keys:getSortedDatasetIndices(xe,!0),values:null};class DatasetController{constructor(Ae,xe){this.chart=Ae,this._ctx=Ae.ctx,this.index=xe,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const Ae=this._cachedMeta;this.configure(),this.linkScales(),Ae._stacked=isStacked(Ae.vScale,Ae),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(Ae){this.index!==Ae&&clearStacks(this._cachedMeta),this.index=Ae}linkScales(){const Ae=this.chart,xe=this._cachedMeta,Ee=this.getDataset(),Se=(ke,$e,Oe,Ue)=>ke==="x"?$e:ke==="r"?Ue:Oe,Ce=xe.xAxisID=valueOrDefault(Ee.xAxisID,getFirstScaleId(Ae,"x")),_e=xe.yAxisID=valueOrDefault(Ee.yAxisID,getFirstScaleId(Ae,"y")),Ie=xe.rAxisID=valueOrDefault(Ee.rAxisID,getFirstScaleId(Ae,"r")),Be=xe.indexAxis,Te=xe.iAxisID=Se(Be,Ce,_e,Ie),Pe=xe.vAxisID=Se(Be,_e,Ce,Ie);xe.xScale=this.getScaleForId(Ce),xe.yScale=this.getScaleForId(_e),xe.rScale=this.getScaleForId(Ie),xe.iScale=this.getScaleForId(Te),xe.vScale=this.getScaleForId(Pe)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(Ae){return this.chart.scales[Ae]}_getOtherScale(Ae){const xe=this._cachedMeta;return Ae===xe.iScale?xe.vScale:xe.iScale}reset(){this._update("reset")}_destroy(){const Ae=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),Ae._stacked&&clearStacks(Ae)}_dataCheck(){const Ae=this.getDataset(),xe=Ae.data||(Ae.data=[]),Ee=this._data;if(isObject$1(xe)){const Se=this._cachedMeta;this._data=convertObjectDataToArray(xe,Se)}else if(Ee!==xe){if(Ee){unlistenArrayEvents(Ee,this);const Se=this._cachedMeta;clearStacks(Se),Se._parsed=[]}xe&&Object.isExtensible(xe)&&listenArrayEvents(xe,this),this._syncList=[],this._data=xe}}addElements(){const Ae=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(Ae.dataset=new this.datasetElementType)}buildOrUpdateElements(Ae){const xe=this._cachedMeta,Ee=this.getDataset();let Se=!1;this._dataCheck();const Ce=xe._stacked;xe._stacked=isStacked(xe.vScale,xe),xe.stack!==Ee.stack&&(Se=!0,clearStacks(xe),xe.stack=Ee.stack),this._resyncElements(Ae),(Se||Ce!==xe._stacked)&&(updateStacks(this,xe._parsed),xe._stacked=isStacked(xe.vScale,xe))}configure(){const Ae=this.chart.config,xe=Ae.datasetScopeKeys(this._type),Ee=Ae.getOptionScopes(this.getDataset(),xe,!0);this.options=Ae.createResolver(Ee,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(Ae,xe){const{_cachedMeta:Ee,_data:Se}=this,{iScale:Ce,_stacked:_e}=Ee,Ie=Ce.axis;let Be=Ae===0&&xe===Se.length?!0:Ee._sorted,Te=Ae>0&&Ee._parsed[Ae-1],Pe,ke,$e;if(this._parsing===!1)Ee._parsed=Se,Ee._sorted=!0,$e=Se;else{isArray$2(Se[Ae])?$e=this.parseArrayData(Ee,Se,Ae,xe):isObject$1(Se[Ae])?$e=this.parseObjectData(Ee,Se,Ae,xe):$e=this.parsePrimitiveData(Ee,Se,Ae,xe);const Oe=()=>ke[Ie]===null||Te&&ke[Ie]<Te[Ie];for(Pe=0;Pe<xe;++Pe)Ee._parsed[Pe+Ae]=ke=$e[Pe],Be&&(Oe()&&(Be=!1),Te=ke);Ee._sorted=Be}_e&&updateStacks(this,$e)}parsePrimitiveData(Ae,xe,Ee,Se){const{iScale:Ce,vScale:_e}=Ae,Ie=Ce.axis,Be=_e.axis,Te=Ce.getLabels(),Pe=Ce===_e,ke=new Array(Se);let $e,Oe,Ue;for($e=0,Oe=Se;$e<Oe;++$e)Ue=$e+Ee,ke[$e]={[Ie]:Pe||Ce.parse(Te[Ue],Ue),[Be]:_e.parse(xe[Ue],Ue)};return ke}parseArrayData(Ae,xe,Ee,Se){const{xScale:Ce,yScale:_e}=Ae,Ie=new Array(Se);let Be,Te,Pe,ke;for(Be=0,Te=Se;Be<Te;++Be)Pe=Be+Ee,ke=xe[Pe],Ie[Be]={x:Ce.parse(ke[0],Pe),y:_e.parse(ke[1],Pe)};return Ie}parseObjectData(Ae,xe,Ee,Se){const{xScale:Ce,yScale:_e}=Ae,{xAxisKey:Ie="x",yAxisKey:Be="y"}=this._parsing,Te=new Array(Se);let Pe,ke,$e,Oe;for(Pe=0,ke=Se;Pe<ke;++Pe)$e=Pe+Ee,Oe=xe[$e],Te[Pe]={x:Ce.parse(resolveObjectKey(Oe,Ie),$e),y:_e.parse(resolveObjectKey(Oe,Be),$e)};return Te}getParsed(Ae){return this._cachedMeta._parsed[Ae]}getDataElement(Ae){return this._cachedMeta.data[Ae]}applyStack(Ae,xe,Ee){const Se=this.chart,Ce=this._cachedMeta,_e=xe[Ae.axis],Ie={keys:getSortedDatasetIndices(Se,!0),values:xe._stacks[Ae.axis]._visualValues};return applyStack(Ie,_e,Ce.index,{mode:Ee})}updateRangeFromParsed(Ae,xe,Ee,Se){const Ce=Ee[xe.axis];let _e=Ce===null?NaN:Ce;const Ie=Se&&Ee._stacks[xe.axis];Se&&Ie&&(Se.values=Ie,_e=applyStack(Se,Ce,this._cachedMeta.index)),Ae.min=Math.min(Ae.min,_e),Ae.max=Math.max(Ae.max,_e)}getMinMax(Ae,xe){const Ee=this._cachedMeta,Se=Ee._parsed,Ce=Ee._sorted&&Ae===Ee.iScale,_e=Se.length,Ie=this._getOtherScale(Ae),Be=createStack(xe,Ee,this.chart),Te={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:Pe,max:ke}=getUserBounds(Ie);let $e,Oe;function Ue(){Oe=Se[$e];const qe=Oe[Ie.axis];return!isNumberFinite(Oe[Ae.axis])||Pe>qe||ke<qe}for($e=0;$e<_e&&!(!Ue()&&(this.updateRangeFromParsed(Te,Ae,Oe,Be),Ce));++$e);if(Ce){for($e=_e-1;$e>=0;--$e)if(!Ue()){this.updateRangeFromParsed(Te,Ae,Oe,Be);break}}return Te}getAllParsedValues(Ae){const xe=this._cachedMeta._parsed,Ee=[];let Se,Ce,_e;for(Se=0,Ce=xe.length;Se<Ce;++Se)_e=xe[Se][Ae.axis],isNumberFinite(_e)&&Ee.push(_e);return Ee}getMaxOverflow(){return!1}getLabelAndValue(Ae){const xe=this._cachedMeta,Ee=xe.iScale,Se=xe.vScale,Ce=this.getParsed(Ae);return{label:Ee?""+Ee.getLabelForValue(Ce[Ee.axis]):"",value:Se?""+Se.getLabelForValue(Ce[Se.axis]):""}}_update(Ae){const xe=this._cachedMeta;this.update(Ae||"default"),xe._clip=toClip(valueOrDefault(this.options.clip,defaultClip(xe.xScale,xe.yScale,this.getMaxOverflow())))}update(Ae){}draw(){const Ae=this._ctx,xe=this.chart,Ee=this._cachedMeta,Se=Ee.data||[],Ce=xe.chartArea,_e=[],Ie=this._drawStart||0,Be=this._drawCount||Se.length-Ie,Te=this.options.drawActiveElementsOnTop;let Pe;for(Ee.dataset&&Ee.dataset.draw(Ae,Ce,Ie,Be),Pe=Ie;Pe<Ie+Be;++Pe){const ke=Se[Pe];ke.hidden||(ke.active&&Te?_e.push(ke):ke.draw(Ae,Ce))}for(Pe=0;Pe<_e.length;++Pe)_e[Pe].draw(Ae,Ce)}getStyle(Ae,xe){const Ee=xe?"active":"default";return Ae===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(Ee):this.resolveDataElementOptions(Ae||0,Ee)}getContext(Ae,xe,Ee){const Se=this.getDataset();let Ce;if(Ae>=0&&Ae<this._cachedMeta.data.length){const _e=this._cachedMeta.data[Ae];Ce=_e.$context||(_e.$context=createDataContext(this.getContext(),Ae,_e)),Ce.parsed=this.getParsed(Ae),Ce.raw=Se.data[Ae],Ce.index=Ce.dataIndex=Ae}else Ce=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),Ce.dataset=Se,Ce.index=Ce.datasetIndex=this.index;return Ce.active=!!xe,Ce.mode=Ee,Ce}resolveDatasetElementOptions(Ae){return this._resolveElementOptions(this.datasetElementType.id,Ae)}resolveDataElementOptions(Ae,xe){return this._resolveElementOptions(this.dataElementType.id,xe,Ae)}_resolveElementOptions(Ae,xe="default",Ee){const Se=xe==="active",Ce=this._cachedDataOpts,_e=Ae+"-"+xe,Ie=Ce[_e],Be=this.enableOptionSharing&&defined(Ee);if(Ie)return cloneIfNotShared(Ie,Be);const Te=this.chart.config,Pe=Te.datasetElementScopeKeys(this._type,Ae),ke=Se?[`${Ae}Hover`,"hover",Ae,""]:[Ae,""],$e=Te.getOptionScopes(this.getDataset(),Pe),Oe=Object.keys(defaults$1.elements[Ae]),Ue=()=>this.getContext(Ee,Se,xe),qe=Te.resolveNamedOptions($e,Oe,Ue,ke);return qe.$shared&&(qe.$shared=Be,Ce[_e]=Object.freeze(cloneIfNotShared(qe,Be))),qe}_resolveAnimations(Ae,xe,Ee){const Se=this.chart,Ce=this._cachedDataOpts,_e=`animation-${xe}`,Ie=Ce[_e];if(Ie)return Ie;let Be;if(Se.options.animation!==!1){const Pe=this.chart.config,ke=Pe.datasetAnimationScopeKeys(this._type,xe),$e=Pe.getOptionScopes(this.getDataset(),ke);Be=Pe.createResolver($e,this.getContext(Ae,Ee,xe))}const Te=new Animations(Se,Be&&Be.animations);return Be&&Be._cacheable&&(Ce[_e]=Object.freeze(Te)),Te}getSharedOptions(Ae){if(Ae.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},Ae))}includeOptions(Ae,xe){return!xe||isDirectUpdateMode(Ae)||this.chart._animationsDisabled}_getSharedOptions(Ae,xe){const Ee=this.resolveDataElementOptions(Ae,xe),Se=this._sharedOptions,Ce=this.getSharedOptions(Ee),_e=this.includeOptions(xe,Ce)||Ce!==Se;return this.updateSharedOptions(Ce,xe,Ee),{sharedOptions:Ce,includeOptions:_e}}updateElement(Ae,xe,Ee,Se){isDirectUpdateMode(Se)?Object.assign(Ae,Ee):this._resolveAnimations(xe,Se).update(Ae,Ee)}updateSharedOptions(Ae,xe,Ee){Ae&&!isDirectUpdateMode(xe)&&this._resolveAnimations(void 0,xe).update(Ae,Ee)}_setStyle(Ae,xe,Ee,Se){Ae.active=Se;const Ce=this.getStyle(xe,Se);this._resolveAnimations(xe,Ee,Se).update(Ae,{options:!Se&&this.getSharedOptions(Ce)||Ce})}removeHoverStyle(Ae,xe,Ee){this._setStyle(Ae,Ee,"active",!1)}setHoverStyle(Ae,xe,Ee){this._setStyle(Ae,Ee,"active",!0)}_removeDatasetHoverStyle(){const Ae=this._cachedMeta.dataset;Ae&&this._setStyle(Ae,void 0,"active",!1)}_setDatasetHoverStyle(){const Ae=this._cachedMeta.dataset;Ae&&this._setStyle(Ae,void 0,"active",!0)}_resyncElements(Ae){const xe=this._data,Ee=this._cachedMeta.data;for(const[Ie,Be,Te]of this._syncList)this[Ie](Be,Te);this._syncList=[];const Se=Ee.length,Ce=xe.length,_e=Math.min(Ce,Se);_e&&this.parse(0,_e),Ce>Se?this._insertElements(Se,Ce-Se,Ae):Ce<Se&&this._removeElements(Ce,Se-Ce)}_insertElements(Ae,xe,Ee=!0){const Se=this._cachedMeta,Ce=Se.data,_e=Ae+xe;let Ie;const Be=Te=>{for(Te.length+=xe,Ie=Te.length-1;Ie>=_e;Ie--)Te[Ie]=Te[Ie-xe]};for(Be(Ce),Ie=Ae;Ie<_e;++Ie)Ce[Ie]=new this.dataElementType;this._parsing&&Be(Se._parsed),this.parse(Ae,xe),Ee&&this.updateElements(Ce,Ae,xe,"reset")}updateElements(Ae,xe,Ee,Se){}_removeElements(Ae,xe){const Ee=this._cachedMeta;if(this._parsing){const Se=Ee._parsed.splice(Ae,xe);Ee._stacked&&clearStacks(Ee,Se)}Ee.data.splice(Ae,xe)}_sync(Ae){if(this._parsing)this._syncList.push(Ae);else{const[xe,Ee,Se]=Ae;this[xe](Ee,Se)}this.chart._dataChanges.push([this.index,...Ae])}_onDataPush(){const Ae=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-Ae,Ae])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(Ae,xe){xe&&this._sync(["_removeElements",Ae,xe]);const Ee=arguments.length-2;Ee&&this._sync(["_insertElements",Ae,Ee])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}$i(DatasetController,"defaults",{}),$i(DatasetController,"datasetElementType",null),$i(DatasetController,"dataElementType",null);function getAllScaleValues(t,Ae){if(!t._cache.$bar){const xe=t.getMatchingVisibleMetas(Ae);let Ee=[];for(let Se=0,Ce=xe.length;Se<Ce;Se++)Ee=Ee.concat(xe[Se].controller.getAllParsedValues(t));t._cache.$bar=_arrayUnique(Ee.sort((Se,Ce)=>Se-Ce))}return t._cache.$bar}function computeMinSampleSize(t){const Ae=t.iScale,xe=getAllScaleValues(Ae,t.type);let Ee=Ae._length,Se,Ce,_e,Ie;const Be=()=>{_e===32767||_e===-32768||(defined(Ie)&&(Ee=Math.min(Ee,Math.abs(_e-Ie)||Ee)),Ie=_e)};for(Se=0,Ce=xe.length;Se<Ce;++Se)_e=Ae.getPixelForValue(xe[Se]),Be();for(Ie=void 0,Se=0,Ce=Ae.ticks.length;Se<Ce;++Se)_e=Ae.getPixelForTick(Se),Be();return Ee}function computeFitCategoryTraits(t,Ae,xe,Ee){const Se=xe.barThickness;let Ce,_e;return isNullOrUndef(Se)?(Ce=Ae.min*xe.categoryPercentage,_e=xe.barPercentage):(Ce=Se*Ee,_e=1),{chunk:Ce/Ee,ratio:_e,start:Ae.pixels[t]-Ce/2}}function computeFlexCategoryTraits(t,Ae,xe,Ee){const Se=Ae.pixels,Ce=Se[t];let _e=t>0?Se[t-1]:null,Ie=t<Se.length-1?Se[t+1]:null;const Be=xe.categoryPercentage;_e===null&&(_e=Ce-(Ie===null?Ae.end-Ae.start:Ie-Ce)),Ie===null&&(Ie=Ce+Ce-_e);const Te=Ce-(Ce-Math.min(_e,Ie))/2*Be;return{chunk:Math.abs(Ie-_e)/2*Be/Ee,ratio:xe.barPercentage,start:Te}}function parseFloatBar(t,Ae,xe,Ee){const Se=xe.parse(t[0],Ee),Ce=xe.parse(t[1],Ee),_e=Math.min(Se,Ce),Ie=Math.max(Se,Ce);let Be=_e,Te=Ie;Math.abs(_e)>Math.abs(Ie)&&(Be=Ie,Te=_e),Ae[xe.axis]=Te,Ae._custom={barStart:Be,barEnd:Te,start:Se,end:Ce,min:_e,max:Ie}}function parseValue(t,Ae,xe,Ee){return isArray$2(t)?parseFloatBar(t,Ae,xe,Ee):Ae[xe.axis]=xe.parse(t,Ee),Ae}function parseArrayOrPrimitive(t,Ae,xe,Ee){const Se=t.iScale,Ce=t.vScale,_e=Se.getLabels(),Ie=Se===Ce,Be=[];let Te,Pe,ke,$e;for(Te=xe,Pe=xe+Ee;Te<Pe;++Te)$e=Ae[Te],ke={},ke[Se.axis]=Ie||Se.parse(_e[Te],Te),Be.push(parseValue($e,ke,Ce,Te));return Be}function isFloatBar(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function barSign(t,Ae,xe){return t!==0?sign(t):(Ae.isHorizontal()?1:-1)*(Ae.min>=xe?1:-1)}function borderProps(t){let Ae,xe,Ee,Se,Ce;return t.horizontal?(Ae=t.base>t.x,xe="left",Ee="right"):(Ae=t.base<t.y,xe="bottom",Ee="top"),Ae?(Se="end",Ce="start"):(Se="start",Ce="end"),{start:xe,end:Ee,reverse:Ae,top:Se,bottom:Ce}}function setBorderSkipped(t,Ae,xe,Ee){let Se=Ae.borderSkipped;const Ce={};if(!Se){t.borderSkipped=Ce;return}if(Se===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:_e,end:Ie,reverse:Be,top:Te,bottom:Pe}=borderProps(t);Se==="middle"&&xe&&(t.enableBorderRadius=!0,(xe._top||0)===Ee?Se=Te:(xe._bottom||0)===Ee?Se=Pe:(Ce[parseEdge(Pe,_e,Ie,Be)]=!0,Se=Te)),Ce[parseEdge(Se,_e,Ie,Be)]=!0,t.borderSkipped=Ce}function parseEdge(t,Ae,xe,Ee){return Ee?(t=swap$1(t,Ae,xe),t=startEnd(t,xe,Ae)):t=startEnd(t,Ae,xe),t}function swap$1(t,Ae,xe){return t===Ae?xe:t===xe?Ae:t}function startEnd(t,Ae,xe){return t==="start"?Ae:t==="end"?xe:t}function setInflateAmount(t,{inflateAmount:Ae},xe){t.inflateAmount=Ae==="auto"?xe===1?.33:0:Ae}class BarController extends DatasetController{parsePrimitiveData(Ae,xe,Ee,Se){return parseArrayOrPrimitive(Ae,xe,Ee,Se)}parseArrayData(Ae,xe,Ee,Se){return parseArrayOrPrimitive(Ae,xe,Ee,Se)}parseObjectData(Ae,xe,Ee,Se){const{iScale:Ce,vScale:_e}=Ae,{xAxisKey:Ie="x",yAxisKey:Be="y"}=this._parsing,Te=Ce.axis==="x"?Ie:Be,Pe=_e.axis==="x"?Ie:Be,ke=[];let $e,Oe,Ue,qe;for($e=Ee,Oe=Ee+Se;$e<Oe;++$e)qe=xe[$e],Ue={},Ue[Ce.axis]=Ce.parse(resolveObjectKey(qe,Te),$e),ke.push(parseValue(resolveObjectKey(qe,Pe),Ue,_e,$e));return ke}updateRangeFromParsed(Ae,xe,Ee,Se){super.updateRangeFromParsed(Ae,xe,Ee,Se);const Ce=Ee._custom;Ce&&xe===this._cachedMeta.vScale&&(Ae.min=Math.min(Ae.min,Ce.min),Ae.max=Math.max(Ae.max,Ce.max))}getMaxOverflow(){return 0}getLabelAndValue(Ae){const xe=this._cachedMeta,{iScale:Ee,vScale:Se}=xe,Ce=this.getParsed(Ae),_e=Ce._custom,Ie=isFloatBar(_e)?"["+_e.start+", "+_e.end+"]":""+Se.getLabelForValue(Ce[Se.axis]);return{label:""+Ee.getLabelForValue(Ce[Ee.axis]),value:Ie}}initialize(){this.enableOptionSharing=!0,super.initialize();const Ae=this._cachedMeta;Ae.stack=this.getDataset().stack}update(Ae){const xe=this._cachedMeta;this.updateElements(xe.data,0,xe.data.length,Ae)}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",{index:_e,_cachedMeta:{vScale:Ie}}=this,Be=Ie.getBasePixel(),Te=Ie.isHorizontal(),Pe=this._getRuler(),{sharedOptions:ke,includeOptions:$e}=this._getSharedOptions(xe,Se);for(let Oe=xe;Oe<xe+Ee;Oe++){const Ue=this.getParsed(Oe),qe=Ce||isNullOrUndef(Ue[Ie.axis])?{base:Be,head:Be}:this._calculateBarValuePixels(Oe),ze=this._calculateBarIndexPixels(Oe,Pe),Ve=(Ue._stacks||{})[Ie.axis],Ge={horizontal:Te,base:qe.base,enableBorderRadius:!Ve||isFloatBar(Ue._custom)||_e===Ve._top||_e===Ve._bottom,x:Te?qe.head:ze.center,y:Te?ze.center:qe.head,height:Te?ze.size:Math.abs(qe.size),width:Te?Math.abs(qe.size):ze.size};$e&&(Ge.options=ke||this.resolveDataElementOptions(Oe,Ae[Oe].active?"active":Se));const Xe=Ge.options||Ae[Oe].options;setBorderSkipped(Ge,Xe,Ve,_e),setInflateAmount(Ge,Xe,Pe.ratio),this.updateElement(Ae[Oe],Oe,Ge,Se)}}_getStacks(Ae,xe){const{iScale:Ee}=this._cachedMeta,Se=Ee.getMatchingVisibleMetas(this._type).filter(Pe=>Pe.controller.options.grouped),Ce=Ee.options.stacked,_e=[],Ie=this._cachedMeta.controller.getParsed(xe),Be=Ie&&Ie[Ee.axis],Te=Pe=>{const ke=Pe._parsed.find(Oe=>Oe[Ee.axis]===Be),$e=ke&&ke[Pe.vScale.axis];if(isNullOrUndef($e)||isNaN($e))return!0};for(const Pe of Se)if(!(xe!==void 0&&Te(Pe))&&((Ce===!1||_e.indexOf(Pe.stack)===-1||Ce===void 0&&Pe.stack===void 0)&&_e.push(Pe.stack),Pe.index===Ae))break;return _e.length||_e.push(void 0),_e}_getStackCount(Ae){return this._getStacks(void 0,Ae).length}_getStackIndex(Ae,xe,Ee){const Se=this._getStacks(Ae,Ee),Ce=xe!==void 0?Se.indexOf(xe):-1;return Ce===-1?Se.length-1:Ce}_getRuler(){const Ae=this.options,xe=this._cachedMeta,Ee=xe.iScale,Se=[];let Ce,_e;for(Ce=0,_e=xe.data.length;Ce<_e;++Ce)Se.push(Ee.getPixelForValue(this.getParsed(Ce)[Ee.axis],Ce));const Ie=Ae.barThickness;return{min:Ie||computeMinSampleSize(xe),pixels:Se,start:Ee._startPixel,end:Ee._endPixel,stackCount:this._getStackCount(),scale:Ee,grouped:Ae.grouped,ratio:Ie?1:Ae.categoryPercentage*Ae.barPercentage}}_calculateBarValuePixels(Ae){const{_cachedMeta:{vScale:xe,_stacked:Ee,index:Se},options:{base:Ce,minBarLength:_e}}=this,Ie=Ce||0,Be=this.getParsed(Ae),Te=Be._custom,Pe=isFloatBar(Te);let ke=Be[xe.axis],$e=0,Oe=Ee?this.applyStack(xe,Be,Ee):ke,Ue,qe;Oe!==ke&&($e=Oe-ke,Oe=ke),Pe&&(ke=Te.barStart,Oe=Te.barEnd-Te.barStart,ke!==0&&sign(ke)!==sign(Te.barEnd)&&($e=0),$e+=ke);const ze=!isNullOrUndef(Ce)&&!Pe?Ce:$e;let Ve=xe.getPixelForValue(ze);if(this.chart.getDataVisibility(Ae)?Ue=xe.getPixelForValue($e+Oe):Ue=Ve,qe=Ue-Ve,Math.abs(qe)<_e){qe=barSign(qe,xe,Ie)*_e,ke===Ie&&(Ve-=qe/2);const Ge=xe.getPixelForDecimal(0),Xe=xe.getPixelForDecimal(1),er=Math.min(Ge,Xe),tr=Math.max(Ge,Xe);Ve=Math.max(Math.min(Ve,tr),er),Ue=Ve+qe,Ee&&!Pe&&(Be._stacks[xe.axis]._visualValues[Se]=xe.getValueForPixel(Ue)-xe.getValueForPixel(Ve))}if(Ve===xe.getPixelForValue(Ie)){const Ge=sign(qe)*xe.getLineWidthForValue(Ie)/2;Ve+=Ge,qe-=Ge}return{size:qe,base:Ve,head:Ue,center:Ue+qe/2}}_calculateBarIndexPixels(Ae,xe){const Ee=xe.scale,Se=this.options,Ce=Se.skipNull,_e=valueOrDefault(Se.maxBarThickness,1/0);let Ie,Be;if(xe.grouped){const Te=Ce?this._getStackCount(Ae):xe.stackCount,Pe=Se.barThickness==="flex"?computeFlexCategoryTraits(Ae,xe,Se,Te):computeFitCategoryTraits(Ae,xe,Se,Te),ke=this._getStackIndex(this.index,this._cachedMeta.stack,Ce?Ae:void 0);Ie=Pe.start+Pe.chunk*ke+Pe.chunk/2,Be=Math.min(_e,Pe.chunk*Pe.ratio)}else Ie=Ee.getPixelForValue(this.getParsed(Ae)[Ee.axis],Ae),Be=Math.min(_e,xe.min*xe.ratio);return{base:Ie-Be/2,head:Ie+Be/2,center:Ie,size:Be}}draw(){const Ae=this._cachedMeta,xe=Ae.vScale,Ee=Ae.data,Se=Ee.length;let Ce=0;for(;Ce<Se;++Ce)this.getParsed(Ce)[xe.axis]!==null&&!Ee[Ce].hidden&&Ee[Ce].draw(this._ctx)}}$i(BarController,"id","bar"),$i(BarController,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),$i(BarController,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function getRatioAndOffset(t,Ae,xe){let Ee=1,Se=1,Ce=0,_e=0;if(Ae<TAU){const Ie=t,Be=Ie+Ae,Te=Math.cos(Ie),Pe=Math.sin(Ie),ke=Math.cos(Be),$e=Math.sin(Be),Oe=(Xe,er,tr)=>_angleBetween(Xe,Ie,Be,!0)?1:Math.max(er,er*xe,tr,tr*xe),Ue=(Xe,er,tr)=>_angleBetween(Xe,Ie,Be,!0)?-1:Math.min(er,er*xe,tr,tr*xe),qe=Oe(0,Te,ke),ze=Oe(HALF_PI,Pe,$e),Ve=Ue(PI,Te,ke),Ge=Ue(PI+HALF_PI,Pe,$e);Ee=(qe-Ve)/2,Se=(ze-Ge)/2,Ce=-(qe+Ve)/2,_e=-(ze+Ge)/2}return{ratioX:Ee,ratioY:Se,offsetX:Ce,offsetY:_e}}class DoughnutController extends DatasetController{constructor(Ae,xe){super(Ae,xe),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(Ae,xe){const Ee=this.getDataset().data,Se=this._cachedMeta;if(this._parsing===!1)Se._parsed=Ee;else{let Ce=Be=>+Ee[Be];if(isObject$1(Ee[Ae])){const{key:Be="value"}=this._parsing;Ce=Te=>+resolveObjectKey(Ee[Te],Be)}let _e,Ie;for(_e=Ae,Ie=Ae+xe;_e<Ie;++_e)Se._parsed[_e]=Ce(_e)}}_getRotation(){return toRadians(this.options.rotation-90)}_getCircumference(){return toRadians(this.options.circumference)}_getRotationExtents(){let Ae=TAU,xe=-TAU;for(let Ee=0;Ee<this.chart.data.datasets.length;++Ee)if(this.chart.isDatasetVisible(Ee)&&this.chart.getDatasetMeta(Ee).type===this._type){const Se=this.chart.getDatasetMeta(Ee).controller,Ce=Se._getRotation(),_e=Se._getCircumference();Ae=Math.min(Ae,Ce),xe=Math.max(xe,Ce+_e)}return{rotation:Ae,circumference:xe-Ae}}update(Ae){const xe=this.chart,{chartArea:Ee}=xe,Se=this._cachedMeta,Ce=Se.data,_e=this.getMaxBorderWidth()+this.getMaxOffset(Ce)+this.options.spacing,Ie=Math.max((Math.min(Ee.width,Ee.height)-_e)/2,0),Be=Math.min(toPercentage(this.options.cutout,Ie),1),Te=this._getRingWeight(this.index),{circumference:Pe,rotation:ke}=this._getRotationExtents(),{ratioX:$e,ratioY:Oe,offsetX:Ue,offsetY:qe}=getRatioAndOffset(ke,Pe,Be),ze=(Ee.width-_e)/$e,Ve=(Ee.height-_e)/Oe,Ge=Math.max(Math.min(ze,Ve)/2,0),Xe=toDimension(this.options.radius,Ge),er=Math.max(Xe*Be,0),tr=(Xe-er)/this._getVisibleDatasetWeightTotal();this.offsetX=Ue*Xe,this.offsetY=qe*Xe,Se.total=this.calculateTotal(),this.outerRadius=Xe-tr*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-tr*Te,0),this.updateElements(Ce,0,Ce.length,Ae)}_circumference(Ae,xe){const Ee=this.options,Se=this._cachedMeta,Ce=this._getCircumference();return xe&&Ee.animation.animateRotate||!this.chart.getDataVisibility(Ae)||Se._parsed[Ae]===null||Se.data[Ae].hidden?0:this.calculateCircumference(Se._parsed[Ae]*Ce/TAU)}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",_e=this.chart,Ie=_e.chartArea,Te=_e.options.animation,Pe=(Ie.left+Ie.right)/2,ke=(Ie.top+Ie.bottom)/2,$e=Ce&&Te.animateScale,Oe=$e?0:this.innerRadius,Ue=$e?0:this.outerRadius,{sharedOptions:qe,includeOptions:ze}=this._getSharedOptions(xe,Se);let Ve=this._getRotation(),Ge;for(Ge=0;Ge<xe;++Ge)Ve+=this._circumference(Ge,Ce);for(Ge=xe;Ge<xe+Ee;++Ge){const Xe=this._circumference(Ge,Ce),er=Ae[Ge],tr={x:Pe+this.offsetX,y:ke+this.offsetY,startAngle:Ve,endAngle:Ve+Xe,circumference:Xe,outerRadius:Ue,innerRadius:Oe};ze&&(tr.options=qe||this.resolveDataElementOptions(Ge,er.active?"active":Se)),Ve+=Xe,this.updateElement(er,Ge,tr,Se)}}calculateTotal(){const Ae=this._cachedMeta,xe=Ae.data;let Ee=0,Se;for(Se=0;Se<xe.length;Se++){const Ce=Ae._parsed[Se];Ce!==null&&!isNaN(Ce)&&this.chart.getDataVisibility(Se)&&!xe[Se].hidden&&(Ee+=Math.abs(Ce))}return Ee}calculateCircumference(Ae){const xe=this._cachedMeta.total;return xe>0&&!isNaN(Ae)?TAU*(Math.abs(Ae)/xe):0}getLabelAndValue(Ae){const xe=this._cachedMeta,Ee=this.chart,Se=Ee.data.labels||[],Ce=formatNumber(xe._parsed[Ae],Ee.options.locale);return{label:Se[Ae]||"",value:Ce}}getMaxBorderWidth(Ae){let xe=0;const Ee=this.chart;let Se,Ce,_e,Ie,Be;if(!Ae){for(Se=0,Ce=Ee.data.datasets.length;Se<Ce;++Se)if(Ee.isDatasetVisible(Se)){_e=Ee.getDatasetMeta(Se),Ae=_e.data,Ie=_e.controller;break}}if(!Ae)return 0;for(Se=0,Ce=Ae.length;Se<Ce;++Se)Be=Ie.resolveDataElementOptions(Se),Be.borderAlign!=="inner"&&(xe=Math.max(xe,Be.borderWidth||0,Be.hoverBorderWidth||0));return xe}getMaxOffset(Ae){let xe=0;for(let Ee=0,Se=Ae.length;Ee<Se;++Ee){const Ce=this.resolveDataElementOptions(Ee);xe=Math.max(xe,Ce.offset||0,Ce.hoverOffset||0)}return xe}_getRingWeightOffset(Ae){let xe=0;for(let Ee=0;Ee<Ae;++Ee)this.chart.isDatasetVisible(Ee)&&(xe+=this._getRingWeight(Ee));return xe}_getRingWeight(Ae){return Math.max(valueOrDefault(this.chart.data.datasets[Ae].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}$i(DoughnutController,"id","doughnut"),$i(DoughnutController,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),$i(DoughnutController,"descriptors",{_scriptable:Ae=>Ae!=="spacing",_indexable:Ae=>Ae!=="spacing"&&!Ae.startsWith("borderDash")&&!Ae.startsWith("hoverBorderDash")}),$i(DoughnutController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(Ae){const xe=Ae.data;if(xe.labels.length&&xe.datasets.length){const{labels:{pointStyle:Ee,color:Se}}=Ae.legend.options;return xe.labels.map((Ce,_e)=>{const Be=Ae.getDatasetMeta(0).controller.getStyle(_e);return{text:Ce,fillStyle:Be.backgroundColor,strokeStyle:Be.borderColor,fontColor:Se,lineWidth:Be.borderWidth,pointStyle:Ee,hidden:!Ae.getDataVisibility(_e),index:_e}})}return[]}},onClick(Ae,xe,Ee){Ee.chart.toggleDataVisibility(xe.index),Ee.chart.update()}}}});class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(Ae){const xe=this._cachedMeta,{dataset:Ee,data:Se=[],_dataset:Ce}=xe,_e=this.chart._animationsDisabled;let{start:Ie,count:Be}=_getStartAndCountOfVisiblePoints(xe,Se,_e);this._drawStart=Ie,this._drawCount=Be,_scaleRangesChanged(xe)&&(Ie=0,Be=Se.length),Ee._chart=this.chart,Ee._datasetIndex=this.index,Ee._decimated=!!Ce._decimated,Ee.points=Se;const Te=this.resolveDatasetElementOptions(Ae);this.options.showLine||(Te.borderWidth=0),Te.segment=this.options.segment,this.updateElement(Ee,void 0,{animated:!_e,options:Te},Ae),this.updateElements(Se,Ie,Be,Ae)}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",{iScale:_e,vScale:Ie,_stacked:Be,_dataset:Te}=this._cachedMeta,{sharedOptions:Pe,includeOptions:ke}=this._getSharedOptions(xe,Se),$e=_e.axis,Oe=Ie.axis,{spanGaps:Ue,segment:qe}=this.options,ze=isNumber$2(Ue)?Ue:Number.POSITIVE_INFINITY,Ve=this.chart._animationsDisabled||Ce||Se==="none",Ge=xe+Ee,Xe=Ae.length;let er=xe>0&&this.getParsed(xe-1);for(let tr=0;tr<Xe;++tr){const nr=Ae[tr],sr=Ve?nr:{};if(tr<xe||tr>=Ge){sr.skip=!0;continue}const dr=this.getParsed(tr),ar=isNullOrUndef(dr[Oe]),lr=sr[$e]=_e.getPixelForValue(dr[$e],tr),Ke=sr[Oe]=Ce||ar?Ie.getBasePixel():Ie.getPixelForValue(Be?this.applyStack(Ie,dr,Be):dr[Oe],tr);sr.skip=isNaN(lr)||isNaN(Ke)||ar,sr.stop=tr>0&&Math.abs(dr[$e]-er[$e])>ze,qe&&(sr.parsed=dr,sr.raw=Te.data[tr]),ke&&(sr.options=Pe||this.resolveDataElementOptions(tr,nr.active?"active":Se)),Ve||this.updateElement(nr,tr,sr,Se),er=dr}}getMaxOverflow(){const Ae=this._cachedMeta,xe=Ae.dataset,Ee=xe.options&&xe.options.borderWidth||0,Se=Ae.data||[];if(!Se.length)return Ee;const Ce=Se[0].size(this.resolveDataElementOptions(0)),_e=Se[Se.length-1].size(this.resolveDataElementOptions(Se.length-1));return Math.max(Ee,Ce,_e)/2}draw(){const Ae=this._cachedMeta;Ae.dataset.updateControlPoints(this.chart.chartArea,Ae.iScale.axis),super.draw()}}$i(LineController,"id","line"),$i(LineController,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),$i(LineController,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class PolarAreaController extends DatasetController{constructor(Ae,xe){super(Ae,xe),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(Ae){const xe=this._cachedMeta,Ee=this.chart,Se=Ee.data.labels||[],Ce=formatNumber(xe._parsed[Ae].r,Ee.options.locale);return{label:Se[Ae]||"",value:Ce}}parseObjectData(Ae,xe,Ee,Se){return _parseObjectDataRadialScale.bind(this)(Ae,xe,Ee,Se)}update(Ae){const xe=this._cachedMeta.data;this._updateRadius(),this.updateElements(xe,0,xe.length,Ae)}getMinMax(){const Ae=this._cachedMeta,xe={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return Ae.data.forEach((Ee,Se)=>{const Ce=this.getParsed(Se).r;!isNaN(Ce)&&this.chart.getDataVisibility(Se)&&(Ce<xe.min&&(xe.min=Ce),Ce>xe.max&&(xe.max=Ce))}),xe}_updateRadius(){const Ae=this.chart,xe=Ae.chartArea,Ee=Ae.options,Se=Math.min(xe.right-xe.left,xe.bottom-xe.top),Ce=Math.max(Se/2,0),_e=Math.max(Ee.cutoutPercentage?Ce/100*Ee.cutoutPercentage:1,0),Ie=(Ce-_e)/Ae.getVisibleDatasetCount();this.outerRadius=Ce-Ie*this.index,this.innerRadius=this.outerRadius-Ie}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",_e=this.chart,Be=_e.options.animation,Te=this._cachedMeta.rScale,Pe=Te.xCenter,ke=Te.yCenter,$e=Te.getIndexAngle(0)-.5*PI;let Oe=$e,Ue;const qe=360/this.countVisibleElements();for(Ue=0;Ue<xe;++Ue)Oe+=this._computeAngle(Ue,Se,qe);for(Ue=xe;Ue<xe+Ee;Ue++){const ze=Ae[Ue];let Ve=Oe,Ge=Oe+this._computeAngle(Ue,Se,qe),Xe=_e.getDataVisibility(Ue)?Te.getDistanceFromCenterForValue(this.getParsed(Ue).r):0;Oe=Ge,Ce&&(Be.animateScale&&(Xe=0),Be.animateRotate&&(Ve=Ge=$e));const er={x:Pe,y:ke,innerRadius:0,outerRadius:Xe,startAngle:Ve,endAngle:Ge,options:this.resolveDataElementOptions(Ue,ze.active?"active":Se)};this.updateElement(ze,Ue,er,Se)}}countVisibleElements(){const Ae=this._cachedMeta;let xe=0;return Ae.data.forEach((Ee,Se)=>{!isNaN(this.getParsed(Se).r)&&this.chart.getDataVisibility(Se)&&xe++}),xe}_computeAngle(Ae,xe,Ee){return this.chart.getDataVisibility(Ae)?toRadians(this.resolveDataElementOptions(Ae,xe).angle||Ee):0}}$i(PolarAreaController,"id","polarArea"),$i(PolarAreaController,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),$i(PolarAreaController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(Ae){const xe=Ae.data;if(xe.labels.length&&xe.datasets.length){const{labels:{pointStyle:Ee,color:Se}}=Ae.legend.options;return xe.labels.map((Ce,_e)=>{const Be=Ae.getDatasetMeta(0).controller.getStyle(_e);return{text:Ce,fillStyle:Be.backgroundColor,strokeStyle:Be.borderColor,fontColor:Se,lineWidth:Be.borderWidth,pointStyle:Ee,hidden:!Ae.getDataVisibility(_e),index:_e}})}return[]}},onClick(Ae,xe,Ee){Ee.chart.toggleDataVisibility(xe.index),Ee.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ScatterController extends DatasetController{getLabelAndValue(Ae){const xe=this._cachedMeta,Ee=this.chart.data.labels||[],{xScale:Se,yScale:Ce}=xe,_e=this.getParsed(Ae),Ie=Se.getLabelForValue(_e.x),Be=Ce.getLabelForValue(_e.y);return{label:Ee[Ae]||"",value:"("+Ie+", "+Be+")"}}update(Ae){const xe=this._cachedMeta,{data:Ee=[]}=xe,Se=this.chart._animationsDisabled;let{start:Ce,count:_e}=_getStartAndCountOfVisiblePoints(xe,Ee,Se);if(this._drawStart=Ce,this._drawCount=_e,_scaleRangesChanged(xe)&&(Ce=0,_e=Ee.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:Ie,_dataset:Be}=xe;Ie._chart=this.chart,Ie._datasetIndex=this.index,Ie._decimated=!!Be._decimated,Ie.points=Ee;const Te=this.resolveDatasetElementOptions(Ae);Te.segment=this.options.segment,this.updateElement(Ie,void 0,{animated:!Se,options:Te},Ae)}else this.datasetElementType&&(delete xe.dataset,this.datasetElementType=!1);this.updateElements(Ee,Ce,_e,Ae)}addElements(){const{showLine:Ae}=this.options;!this.datasetElementType&&Ae&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(Ae,xe,Ee,Se){const Ce=Se==="reset",{iScale:_e,vScale:Ie,_stacked:Be,_dataset:Te}=this._cachedMeta,Pe=this.resolveDataElementOptions(xe,Se),ke=this.getSharedOptions(Pe),$e=this.includeOptions(Se,ke),Oe=_e.axis,Ue=Ie.axis,{spanGaps:qe,segment:ze}=this.options,Ve=isNumber$2(qe)?qe:Number.POSITIVE_INFINITY,Ge=this.chart._animationsDisabled||Ce||Se==="none";let Xe=xe>0&&this.getParsed(xe-1);for(let er=xe;er<xe+Ee;++er){const tr=Ae[er],nr=this.getParsed(er),sr=Ge?tr:{},dr=isNullOrUndef(nr[Ue]),ar=sr[Oe]=_e.getPixelForValue(nr[Oe],er),lr=sr[Ue]=Ce||dr?Ie.getBasePixel():Ie.getPixelForValue(Be?this.applyStack(Ie,nr,Be):nr[Ue],er);sr.skip=isNaN(ar)||isNaN(lr)||dr,sr.stop=er>0&&Math.abs(nr[Oe]-Xe[Oe])>Ve,ze&&(sr.parsed=nr,sr.raw=Te.data[er]),$e&&(sr.options=ke||this.resolveDataElementOptions(er,tr.active?"active":Se)),Ge||this.updateElement(tr,er,sr,Se),Xe=nr}this.updateSharedOptions(ke,Se,Pe)}getMaxOverflow(){const Ae=this._cachedMeta,xe=Ae.data||[];if(!this.options.showLine){let Ie=0;for(let Be=xe.length-1;Be>=0;--Be)Ie=Math.max(Ie,xe[Be].size(this.resolveDataElementOptions(Be))/2);return Ie>0&&Ie}const Ee=Ae.dataset,Se=Ee.options&&Ee.options.borderWidth||0;if(!xe.length)return Se;const Ce=xe[0].size(this.resolveDataElementOptions(0)),_e=xe[xe.length-1].size(this.resolveDataElementOptions(xe.length-1));return Math.max(Se,Ce,_e)/2}}$i(ScatterController,"id","scatter"),$i(ScatterController,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),$i(ScatterController,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapterBase{constructor(Ae){$i(this,"options");this.options=Ae||{}}static override(Ae){Object.assign(DateAdapterBase.prototype,Ae)}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}var adapters={_date:DateAdapterBase};function binarySearch(t,Ae,xe,Ee){const{controller:Se,data:Ce,_sorted:_e}=t,Ie=Se._cachedMeta.iScale,Be=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(Ie&&Ae===Ie.axis&&Ae!=="r"&&_e&&Ce.length){const Te=Ie._reversePixels?_rlookupByKey:_lookupByKey;if(Ee){if(Se._sharedOptions){const Pe=Ce[0],ke=typeof Pe.getRange=="function"&&Pe.getRange(Ae);if(ke){const $e=Te(Ce,Ae,xe-ke),Oe=Te(Ce,Ae,xe+ke);return{lo:$e.lo,hi:Oe.hi}}}}else{const Pe=Te(Ce,Ae,xe);if(Be){const{vScale:ke}=Se._cachedMeta,{_parsed:$e}=t,Oe=$e.slice(0,Pe.lo+1).reverse().findIndex(qe=>!isNullOrUndef(qe[ke.axis]));Pe.lo-=Math.max(0,Oe);const Ue=$e.slice(Pe.hi).findIndex(qe=>!isNullOrUndef(qe[ke.axis]));Pe.hi+=Math.max(0,Ue)}return Pe}}return{lo:0,hi:Ce.length-1}}function evaluateInteractionItems(t,Ae,xe,Ee,Se){const Ce=t.getSortedVisibleDatasetMetas(),_e=xe[Ae];for(let Ie=0,Be=Ce.length;Ie<Be;++Ie){const{index:Te,data:Pe}=Ce[Ie],{lo:ke,hi:$e}=binarySearch(Ce[Ie],Ae,_e,Se);for(let Oe=ke;Oe<=$e;++Oe){const Ue=Pe[Oe];Ue.skip||Ee(Ue,Te,Oe)}}}function getDistanceMetricForAxis(t){const Ae=t.indexOf("x")!==-1,xe=t.indexOf("y")!==-1;return function(Ee,Se){const Ce=Ae?Math.abs(Ee.x-Se.x):0,_e=xe?Math.abs(Ee.y-Se.y):0;return Math.sqrt(Math.pow(Ce,2)+Math.pow(_e,2))}}function getIntersectItems(t,Ae,xe,Ee,Se){const Ce=[];return!Se&&!t.isPointInArea(Ae)||evaluateInteractionItems(t,xe,Ae,function(Ie,Be,Te){!Se&&!_isPointInArea(Ie,t.chartArea,0)||Ie.inRange(Ae.x,Ae.y,Ee)&&Ce.push({element:Ie,datasetIndex:Be,index:Te})},!0),Ce}function getNearestRadialItems(t,Ae,xe,Ee){let Se=[];function Ce(_e,Ie,Be){const{startAngle:Te,endAngle:Pe}=_e.getProps(["startAngle","endAngle"],Ee),{angle:ke}=getAngleFromPoint(_e,{x:Ae.x,y:Ae.y});_angleBetween(ke,Te,Pe)&&Se.push({element:_e,datasetIndex:Ie,index:Be})}return evaluateInteractionItems(t,xe,Ae,Ce),Se}function getNearestCartesianItems(t,Ae,xe,Ee,Se,Ce){let _e=[];const Ie=getDistanceMetricForAxis(xe);let Be=Number.POSITIVE_INFINITY;function Te(Pe,ke,$e){const Oe=Pe.inRange(Ae.x,Ae.y,Se);if(Ee&&!Oe)return;const Ue=Pe.getCenterPoint(Se);if(!(!!Ce||t.isPointInArea(Ue))&&!Oe)return;const ze=Ie(Ae,Ue);ze<Be?(_e=[{element:Pe,datasetIndex:ke,index:$e}],Be=ze):ze===Be&&_e.push({element:Pe,datasetIndex:ke,index:$e})}return evaluateInteractionItems(t,xe,Ae,Te),_e}function getNearestItems(t,Ae,xe,Ee,Se,Ce){return!Ce&&!t.isPointInArea(Ae)?[]:xe==="r"&&!Ee?getNearestRadialItems(t,Ae,xe,Se):getNearestCartesianItems(t,Ae,xe,Ee,Se,Ce)}function getAxisItems(t,Ae,xe,Ee,Se){const Ce=[],_e=xe==="x"?"inXRange":"inYRange";let Ie=!1;return evaluateInteractionItems(t,xe,Ae,(Be,Te,Pe)=>{Be[_e]&&Be[_e](Ae[xe],Se)&&(Ce.push({element:Be,datasetIndex:Te,index:Pe}),Ie=Ie||Be.inRange(Ae.x,Ae.y,Se))}),Ee&&!Ie?[]:Ce}var Interaction={modes:{index(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t),Ce=xe.axis||"x",_e=xe.includeInvisible||!1,Ie=xe.intersect?getIntersectItems(t,Se,Ce,Ee,_e):getNearestItems(t,Se,Ce,!1,Ee,_e),Be=[];return Ie.length?(t.getSortedVisibleDatasetMetas().forEach(Te=>{const Pe=Ie[0].index,ke=Te.data[Pe];ke&&!ke.skip&&Be.push({element:ke,datasetIndex:Te.index,index:Pe})}),Be):[]},dataset(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t),Ce=xe.axis||"xy",_e=xe.includeInvisible||!1;let Ie=xe.intersect?getIntersectItems(t,Se,Ce,Ee,_e):getNearestItems(t,Se,Ce,!1,Ee,_e);if(Ie.length>0){const Be=Ie[0].datasetIndex,Te=t.getDatasetMeta(Be).data;Ie=[];for(let Pe=0;Pe<Te.length;++Pe)Ie.push({element:Te[Pe],datasetIndex:Be,index:Pe})}return Ie},point(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t),Ce=xe.axis||"xy",_e=xe.includeInvisible||!1;return getIntersectItems(t,Se,Ce,Ee,_e)},nearest(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t),Ce=xe.axis||"xy",_e=xe.includeInvisible||!1;return getNearestItems(t,Se,Ce,xe.intersect,Ee,_e)},x(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t);return getAxisItems(t,Se,"x",xe.intersect,Ee)},y(t,Ae,xe,Ee){const Se=getRelativePosition(Ae,t);return getAxisItems(t,Se,"y",xe.intersect,Ee)}}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(t,Ae){return t.filter(xe=>xe.pos===Ae)}function filterDynamicPositionByAxis(t,Ae){return t.filter(xe=>STATIC_POSITIONS.indexOf(xe.pos)===-1&&xe.box.axis===Ae)}function sortByWeight(t,Ae){return t.sort((xe,Ee)=>{const Se=Ae?Ee:xe,Ce=Ae?xe:Ee;return Se.weight===Ce.weight?Se.index-Ce.index:Se.weight-Ce.weight})}function wrapBoxes(t){const Ae=[];let xe,Ee,Se,Ce,_e,Ie;for(xe=0,Ee=(t||[]).length;xe<Ee;++xe)Se=t[xe],{position:Ce,options:{stack:_e,stackWeight:Ie=1}}=Se,Ae.push({index:xe,box:Se,pos:Ce,horizontal:Se.isHorizontal(),weight:Se.weight,stack:_e&&Ce+_e,stackWeight:Ie});return Ae}function buildStacks(t){const Ae={};for(const xe of t){const{stack:Ee,pos:Se,stackWeight:Ce}=xe;if(!Ee||!STATIC_POSITIONS.includes(Se))continue;const _e=Ae[Ee]||(Ae[Ee]={count:0,placed:0,weight:0,size:0});_e.count++,_e.weight+=Ce}return Ae}function setLayoutDims(t,Ae){const xe=buildStacks(t),{vBoxMaxWidth:Ee,hBoxMaxHeight:Se}=Ae;let Ce,_e,Ie;for(Ce=0,_e=t.length;Ce<_e;++Ce){Ie=t[Ce];const{fullSize:Be}=Ie.box,Te=xe[Ie.stack],Pe=Te&&Ie.stackWeight/Te.weight;Ie.horizontal?(Ie.width=Pe?Pe*Ee:Be&&Ae.availableWidth,Ie.height=Se):(Ie.width=Ee,Ie.height=Pe?Pe*Se:Be&&Ae.availableHeight)}return xe}function buildLayoutBoxes(t){const Ae=wrapBoxes(t),xe=sortByWeight(Ae.filter(Te=>Te.box.fullSize),!0),Ee=sortByWeight(filterByPosition(Ae,"left"),!0),Se=sortByWeight(filterByPosition(Ae,"right")),Ce=sortByWeight(filterByPosition(Ae,"top"),!0),_e=sortByWeight(filterByPosition(Ae,"bottom")),Ie=filterDynamicPositionByAxis(Ae,"x"),Be=filterDynamicPositionByAxis(Ae,"y");return{fullSize:xe,leftAndTop:Ee.concat(Ce),rightAndBottom:Se.concat(Be).concat(_e).concat(Ie),chartArea:filterByPosition(Ae,"chartArea"),vertical:Ee.concat(Se).concat(Be),horizontal:Ce.concat(_e).concat(Ie)}}function getCombinedMax(t,Ae,xe,Ee){return Math.max(t[xe],Ae[xe])+Math.max(t[Ee],Ae[Ee])}function updateMaxPadding(t,Ae){t.top=Math.max(t.top,Ae.top),t.left=Math.max(t.left,Ae.left),t.bottom=Math.max(t.bottom,Ae.bottom),t.right=Math.max(t.right,Ae.right)}function updateDims(t,Ae,xe,Ee){const{pos:Se,box:Ce}=xe,_e=t.maxPadding;if(!isObject$1(Se)){xe.size&&(t[Se]-=xe.size);const ke=Ee[xe.stack]||{size:0,count:1};ke.size=Math.max(ke.size,xe.horizontal?Ce.height:Ce.width),xe.size=ke.size/ke.count,t[Se]+=xe.size}Ce.getPadding&&updateMaxPadding(_e,Ce.getPadding());const Ie=Math.max(0,Ae.outerWidth-getCombinedMax(_e,t,"left","right")),Be=Math.max(0,Ae.outerHeight-getCombinedMax(_e,t,"top","bottom")),Te=Ie!==t.w,Pe=Be!==t.h;return t.w=Ie,t.h=Be,xe.horizontal?{same:Te,other:Pe}:{same:Pe,other:Te}}function handleMaxPadding(t){const Ae=t.maxPadding;function xe(Ee){const Se=Math.max(Ae[Ee]-t[Ee],0);return t[Ee]+=Se,Se}t.y+=xe("top"),t.x+=xe("left"),xe("right"),xe("bottom")}function getMargins(t,Ae){const xe=Ae.maxPadding;function Ee(Se){const Ce={left:0,top:0,right:0,bottom:0};return Se.forEach(_e=>{Ce[_e]=Math.max(Ae[_e],xe[_e])}),Ce}return Ee(t?["left","right"]:["top","bottom"])}function fitBoxes(t,Ae,xe,Ee){const Se=[];let Ce,_e,Ie,Be,Te,Pe;for(Ce=0,_e=t.length,Te=0;Ce<_e;++Ce){Ie=t[Ce],Be=Ie.box,Be.update(Ie.width||Ae.w,Ie.height||Ae.h,getMargins(Ie.horizontal,Ae));const{same:ke,other:$e}=updateDims(Ae,xe,Ie,Ee);Te|=ke&&Se.length,Pe=Pe||$e,Be.fullSize||Se.push(Ie)}return Te&&fitBoxes(Se,Ae,xe,Ee)||Pe}function setBoxDims(t,Ae,xe,Ee,Se){t.top=xe,t.left=Ae,t.right=Ae+Ee,t.bottom=xe+Se,t.width=Ee,t.height=Se}function placeBoxes(t,Ae,xe,Ee){const Se=xe.padding;let{x:Ce,y:_e}=Ae;for(const Ie of t){const Be=Ie.box,Te=Ee[Ie.stack]||{placed:0,weight:1},Pe=Ie.stackWeight/Te.weight||1;if(Ie.horizontal){const ke=Ae.w*Pe,$e=Te.size||Be.height;defined(Te.start)&&(_e=Te.start),Be.fullSize?setBoxDims(Be,Se.left,_e,xe.outerWidth-Se.right-Se.left,$e):setBoxDims(Be,Ae.left+Te.placed,_e,ke,$e),Te.start=_e,Te.placed+=ke,_e=Be.bottom}else{const ke=Ae.h*Pe,$e=Te.size||Be.width;defined(Te.start)&&(Ce=Te.start),Be.fullSize?setBoxDims(Be,Ce,Se.top,$e,xe.outerHeight-Se.bottom-Se.top):setBoxDims(Be,Ce,Ae.top+Te.placed,$e,ke),Te.start=Ce,Te.placed+=ke,Ce=Be.right}}Ae.x=Ce,Ae.y=_e}var layouts={addBox(t,Ae){t.boxes||(t.boxes=[]),Ae.fullSize=Ae.fullSize||!1,Ae.position=Ae.position||"top",Ae.weight=Ae.weight||0,Ae._layers=Ae._layers||function(){return[{z:0,draw(xe){Ae.draw(xe)}}]},t.boxes.push(Ae)},removeBox(t,Ae){const xe=t.boxes?t.boxes.indexOf(Ae):-1;xe!==-1&&t.boxes.splice(xe,1)},configure(t,Ae,xe){Ae.fullSize=xe.fullSize,Ae.position=xe.position,Ae.weight=xe.weight},update(t,Ae,xe,Ee){if(!t)return;const Se=toPadding(t.options.layout.padding),Ce=Math.max(Ae-Se.width,0),_e=Math.max(xe-Se.height,0),Ie=buildLayoutBoxes(t.boxes),Be=Ie.vertical,Te=Ie.horizontal;each(t.boxes,qe=>{typeof qe.beforeLayout=="function"&&qe.beforeLayout()});const Pe=Be.reduce((qe,ze)=>ze.box.options&&ze.box.options.display===!1?qe:qe+1,0)||1,ke=Object.freeze({outerWidth:Ae,outerHeight:xe,padding:Se,availableWidth:Ce,availableHeight:_e,vBoxMaxWidth:Ce/2/Pe,hBoxMaxHeight:_e/2}),$e=Object.assign({},Se);updateMaxPadding($e,toPadding(Ee));const Oe=Object.assign({maxPadding:$e,w:Ce,h:_e,x:Se.left,y:Se.top},Se),Ue=setLayoutDims(Be.concat(Te),ke);fitBoxes(Ie.fullSize,Oe,ke,Ue),fitBoxes(Be,Oe,ke,Ue),fitBoxes(Te,Oe,ke,Ue)&&fitBoxes(Be,Oe,ke,Ue),handleMaxPadding(Oe),placeBoxes(Ie.leftAndTop,Oe,ke,Ue),Oe.x+=Oe.w,Oe.y+=Oe.h,placeBoxes(Ie.rightAndBottom,Oe,ke,Ue),t.chartArea={left:Oe.left,top:Oe.top,right:Oe.left+Oe.w,bottom:Oe.top+Oe.h,height:Oe.h,width:Oe.w},each(Ie.chartArea,qe=>{const ze=qe.box;Object.assign(ze,t.chartArea),ze.update(Oe.w,Oe.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(Ae,xe){}releaseContext(Ae){return!1}addEventListener(Ae,xe,Ee){}removeEventListener(Ae,xe,Ee){}getDevicePixelRatio(){return 1}getMaximumSize(Ae,xe,Ee,Se){return xe=Math.max(0,xe||Ae.width),Ee=Ee||Ae.height,{width:xe,height:Math.max(0,Se?Math.floor(xe/Se):Ee)}}isAttached(Ae){return!0}updateConfig(Ae){}}class BasicPlatform extends BasePlatform{acquireContext(Ae){return Ae&&Ae.getContext&&Ae.getContext("2d")||null}updateConfig(Ae){Ae.options.animation=!1}}const EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=t=>t===null||t==="";function initCanvas(t,Ae){const xe=t.style,Ee=t.getAttribute("height"),Se=t.getAttribute("width");if(t[EXPANDO_KEY]={initial:{height:Ee,width:Se,style:{display:xe.display,height:xe.height,width:xe.width}}},xe.display=xe.display||"block",xe.boxSizing=xe.boxSizing||"border-box",isNullOrEmpty(Se)){const Ce=readUsedSize(t,"width");Ce!==void 0&&(t.width=Ce)}if(isNullOrEmpty(Ee))if(t.style.height==="")t.height=t.width/(Ae||2);else{const Ce=readUsedSize(t,"height");Ce!==void 0&&(t.height=Ce)}return t}const eventListenerOptions=supportsEventListenerOptions?{passive:!0}:!1;function addListener(t,Ae,xe){t&&t.addEventListener(Ae,xe,eventListenerOptions)}function removeListener(t,Ae,xe){t&&t.canvas&&t.canvas.removeEventListener(Ae,xe,eventListenerOptions)}function fromNativeEvent(t,Ae){const xe=EVENT_TYPES[t.type]||t.type,{x:Ee,y:Se}=getRelativePosition(t,Ae);return{type:xe,chart:Ae,native:t,x:Ee!==void 0?Ee:null,y:Se!==void 0?Se:null}}function nodeListContains(t,Ae){for(const xe of t)if(xe===Ae||xe.contains(Ae))return!0}function createAttachObserver(t,Ae,xe){const Ee=t.canvas,Se=new MutationObserver(Ce=>{let _e=!1;for(const Ie of Ce)_e=_e||nodeListContains(Ie.addedNodes,Ee),_e=_e&&!nodeListContains(Ie.removedNodes,Ee);_e&&xe()});return Se.observe(document,{childList:!0,subtree:!0}),Se}function createDetachObserver(t,Ae,xe){const Ee=t.canvas,Se=new MutationObserver(Ce=>{let _e=!1;for(const Ie of Ce)_e=_e||nodeListContains(Ie.removedNodes,Ee),_e=_e&&!nodeListContains(Ie.addedNodes,Ee);_e&&xe()});return Se.observe(document,{childList:!0,subtree:!0}),Se}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const t=window.devicePixelRatio;t!==oldDevicePixelRatio&&(oldDevicePixelRatio=t,drpListeningCharts.forEach((Ae,xe)=>{xe.currentDevicePixelRatio!==t&&Ae()}))}function listenDevicePixelRatioChanges(t,Ae){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(t,Ae)}function unlistenDevicePixelRatioChanges(t){drpListeningCharts.delete(t),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(t,Ae,xe){const Ee=t.canvas,Se=Ee&&_getParentNode(Ee);if(!Se)return;const Ce=throttled((Ie,Be)=>{const Te=Se.clientWidth;xe(Ie,Be),Te<Se.clientWidth&&xe()},window),_e=new ResizeObserver(Ie=>{const Be=Ie[0],Te=Be.contentRect.width,Pe=Be.contentRect.height;Te===0&&Pe===0||Ce(Te,Pe)});return _e.observe(Se),listenDevicePixelRatioChanges(t,Ce),_e}function releaseObserver(t,Ae,xe){xe&&xe.disconnect(),Ae==="resize"&&unlistenDevicePixelRatioChanges(t)}function createProxyAndListen(t,Ae,xe){const Ee=t.canvas,Se=throttled(Ce=>{t.ctx!==null&&xe(fromNativeEvent(Ce,t))},t);return addListener(Ee,Ae,Se),Se}class DomPlatform extends BasePlatform{acquireContext(Ae,xe){const Ee=Ae&&Ae.getContext&&Ae.getContext("2d");return Ee&&Ee.canvas===Ae?(initCanvas(Ae,xe),Ee):null}releaseContext(Ae){const xe=Ae.canvas;if(!xe[EXPANDO_KEY])return!1;const Ee=xe[EXPANDO_KEY].initial;["height","width"].forEach(Ce=>{const _e=Ee[Ce];isNullOrUndef(_e)?xe.removeAttribute(Ce):xe.setAttribute(Ce,_e)});const Se=Ee.style||{};return Object.keys(Se).forEach(Ce=>{xe.style[Ce]=Se[Ce]}),xe.width=xe.width,delete xe[EXPANDO_KEY],!0}addEventListener(Ae,xe,Ee){this.removeEventListener(Ae,xe);const Se=Ae.$proxies||(Ae.$proxies={}),_e={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[xe]||createProxyAndListen;Se[xe]=_e(Ae,xe,Ee)}removeEventListener(Ae,xe){const Ee=Ae.$proxies||(Ae.$proxies={}),Se=Ee[xe];if(!Se)return;({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[xe]||removeListener)(Ae,xe,Se),Ee[xe]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(Ae,xe,Ee,Se){return getMaximumSize(Ae,xe,Ee,Se)}isAttached(Ae){const xe=Ae&&_getParentNode(Ae);return!!(xe&&xe.isConnected)}}function _detectPlatform(t){return!_isDomSupported()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?BasicPlatform:DomPlatform}var Yd;let Element$2=(Yd=class{constructor(){$i(this,"x");$i(this,"y");$i(this,"active",!1);$i(this,"options");$i(this,"$animations")}tooltipPosition(Ae){const{x:xe,y:Ee}=this.getProps(["x","y"],Ae);return{x:xe,y:Ee}}hasValue(){return isNumber$2(this.x)&&isNumber$2(this.y)}getProps(Ae,xe){const Ee=this.$animations;if(!xe||!Ee)return this;const Se={};return Ae.forEach(Ce=>{Se[Ce]=Ee[Ce]&&Ee[Ce].active()?Ee[Ce]._to:this[Ce]}),Se}},$i(Yd,"defaults",{}),$i(Yd,"defaultRoutes"),Yd);function autoSkip(t,Ae){const xe=t.options.ticks,Ee=determineMaxTicks(t),Se=Math.min(xe.maxTicksLimit||Ee,Ee),Ce=xe.major.enabled?getMajorIndices(Ae):[],_e=Ce.length,Ie=Ce[0],Be=Ce[_e-1],Te=[];if(_e>Se)return skipMajors(Ae,Te,Ce,_e/Se),Te;const Pe=calculateSpacing(Ce,Ae,Se);if(_e>0){let ke,$e;const Oe=_e>1?Math.round((Be-Ie)/(_e-1)):null;for(skip(Ae,Te,Pe,isNullOrUndef(Oe)?0:Ie-Oe,Ie),ke=0,$e=_e-1;ke<$e;ke++)skip(Ae,Te,Pe,Ce[ke],Ce[ke+1]);return skip(Ae,Te,Pe,Be,isNullOrUndef(Oe)?Ae.length:Be+Oe),Te}return skip(Ae,Te,Pe),Te}function determineMaxTicks(t){const Ae=t.options.offset,xe=t._tickSize(),Ee=t._length/xe+(Ae?0:1),Se=t._maxLength/xe;return Math.floor(Math.min(Ee,Se))}function calculateSpacing(t,Ae,xe){const Ee=getEvenSpacing(t),Se=Ae.length/xe;if(!Ee)return Math.max(Se,1);const Ce=_factorize(Ee);for(let _e=0,Ie=Ce.length-1;_e<Ie;_e++){const Be=Ce[_e];if(Be>Se)return Be}return Math.max(Se,1)}function getMajorIndices(t){const Ae=[];let xe,Ee;for(xe=0,Ee=t.length;xe<Ee;xe++)t[xe].major&&Ae.push(xe);return Ae}function skipMajors(t,Ae,xe,Ee){let Se=0,Ce=xe[0],_e;for(Ee=Math.ceil(Ee),_e=0;_e<t.length;_e++)_e===Ce&&(Ae.push(t[_e]),Se++,Ce=xe[Se*Ee])}function skip(t,Ae,xe,Ee,Se){const Ce=valueOrDefault(Ee,0),_e=Math.min(valueOrDefault(Se,t.length),t.length);let Ie=0,Be,Te,Pe;for(xe=Math.ceil(xe),Se&&(Be=Se-Ee,xe=Be/Math.floor(Be/xe)),Pe=Ce;Pe<0;)Ie++,Pe=Math.round(Ce+Ie*xe);for(Te=Math.max(Ce,0);Te<_e;Te++)Te===Pe&&(Ae.push(t[Te]),Ie++,Pe=Math.round(Ce+Ie*xe))}function getEvenSpacing(t){const Ae=t.length;let xe,Ee;if(Ae<2)return!1;for(Ee=t[0],xe=1;xe<Ae;++xe)if(t[xe]-t[xe-1]!==Ee)return!1;return Ee}const reverseAlign=t=>t==="left"?"right":t==="right"?"left":t,offsetFromEdge=(t,Ae,xe)=>Ae==="top"||Ae==="left"?t[Ae]+xe:t[Ae]-xe,getTicksLimit=(t,Ae)=>Math.min(Ae||t,t);function sample(t,Ae){const xe=[],Ee=t.length/Ae,Se=t.length;let Ce=0;for(;Ce<Se;Ce+=Ee)xe.push(t[Math.floor(Ce)]);return xe}function getPixelForGridLine(t,Ae,xe){const Ee=t.ticks.length,Se=Math.min(Ae,Ee-1),Ce=t._startPixel,_e=t._endPixel,Ie=1e-6;let Be=t.getPixelForTick(Se),Te;if(!(xe&&(Ee===1?Te=Math.max(Be-Ce,_e-Be):Ae===0?Te=(t.getPixelForTick(1)-Be)/2:Te=(Be-t.getPixelForTick(Se-1))/2,Be+=Se<Ae?Te:-Te,Be<Ce-Ie||Be>_e+Ie)))return Be}function garbageCollect(t,Ae){each(t,xe=>{const Ee=xe.gc,Se=Ee.length/2;let Ce;if(Se>Ae){for(Ce=0;Ce<Se;++Ce)delete xe.data[Ee[Ce]];Ee.splice(0,Se)}})}function getTickMarkLength(t){return t.drawTicks?t.tickLength:0}function getTitleHeight(t,Ae){if(!t.display)return 0;const xe=toFont(t.font,Ae),Ee=toPadding(t.padding);return(isArray$2(t.text)?t.text.length:1)*xe.lineHeight+Ee.height}function createScaleContext(t,Ae){return createContext(t,{scale:Ae,type:"scale"})}function createTickContext(t,Ae,xe){return createContext(t,{tick:xe,index:Ae,type:"tick"})}function titleAlign(t,Ae,xe){let Ee=_toLeftRightCenter(t);return(xe&&Ae!=="right"||!xe&&Ae==="right")&&(Ee=reverseAlign(Ee)),Ee}function titleArgs(t,Ae,xe,Ee){const{top:Se,left:Ce,bottom:_e,right:Ie,chart:Be}=t,{chartArea:Te,scales:Pe}=Be;let ke=0,$e,Oe,Ue;const qe=_e-Se,ze=Ie-Ce;if(t.isHorizontal()){if(Oe=_alignStartEnd(Ee,Ce,Ie),isObject$1(xe)){const Ve=Object.keys(xe)[0],Ge=xe[Ve];Ue=Pe[Ve].getPixelForValue(Ge)+qe-Ae}else xe==="center"?Ue=(Te.bottom+Te.top)/2+qe-Ae:Ue=offsetFromEdge(t,xe,Ae);$e=Ie-Ce}else{if(isObject$1(xe)){const Ve=Object.keys(xe)[0],Ge=xe[Ve];Oe=Pe[Ve].getPixelForValue(Ge)-ze+Ae}else xe==="center"?Oe=(Te.left+Te.right)/2-ze+Ae:Oe=offsetFromEdge(t,xe,Ae);Ue=_alignStartEnd(Ee,_e,Se),ke=xe==="left"?-HALF_PI:HALF_PI}return{titleX:Oe,titleY:Ue,maxWidth:$e,rotation:ke}}class Scale extends Element$2{constructor(Ae){super(),this.id=Ae.id,this.type=Ae.type,this.options=void 0,this.ctx=Ae.ctx,this.chart=Ae.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(Ae){this.options=Ae.setContext(this.getContext()),this.axis=Ae.axis,this._userMin=this.parse(Ae.min),this._userMax=this.parse(Ae.max),this._suggestedMin=this.parse(Ae.suggestedMin),this._suggestedMax=this.parse(Ae.suggestedMax)}parse(Ae,xe){return Ae}getUserBounds(){let{_userMin:Ae,_userMax:xe,_suggestedMin:Ee,_suggestedMax:Se}=this;return Ae=finiteOrDefault(Ae,Number.POSITIVE_INFINITY),xe=finiteOrDefault(xe,Number.NEGATIVE_INFINITY),Ee=finiteOrDefault(Ee,Number.POSITIVE_INFINITY),Se=finiteOrDefault(Se,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(Ae,Ee),max:finiteOrDefault(xe,Se),minDefined:isNumberFinite(Ae),maxDefined:isNumberFinite(xe)}}getMinMax(Ae){let{min:xe,max:Ee,minDefined:Se,maxDefined:Ce}=this.getUserBounds(),_e;if(Se&&Ce)return{min:xe,max:Ee};const Ie=this.getMatchingVisibleMetas();for(let Be=0,Te=Ie.length;Be<Te;++Be)_e=Ie[Be].controller.getMinMax(this,Ae),Se||(xe=Math.min(xe,_e.min)),Ce||(Ee=Math.max(Ee,_e.max));return xe=Ce&&xe>Ee?Ee:xe,Ee=Se&&xe>Ee?xe:Ee,{min:finiteOrDefault(xe,finiteOrDefault(Ee,xe)),max:finiteOrDefault(Ee,finiteOrDefault(xe,Ee))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const Ae=this.chart.data;return this.options.labels||(this.isHorizontal()?Ae.xLabels:Ae.yLabels)||Ae.labels||[]}getLabelItems(Ae=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(Ae))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(Ae,xe,Ee){const{beginAtZero:Se,grace:Ce,ticks:_e}=this.options,Ie=_e.sampleSize;this.beforeUpdate(),this.maxWidth=Ae,this.maxHeight=xe,this._margins=Ee=Object.assign({left:0,right:0,top:0,bottom:0},Ee),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+Ee.left+Ee.right:this.height+Ee.top+Ee.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,Ce,Se),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const Be=Ie<this.ticks.length;this._convertTicksToLabels(Be?sample(this.ticks,Ie):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),_e.display&&(_e.autoSkip||_e.source==="auto")&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),Be&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let Ae=this.options.reverse,xe,Ee;this.isHorizontal()?(xe=this.left,Ee=this.right):(xe=this.top,Ee=this.bottom,Ae=!Ae),this._startPixel=xe,this._endPixel=Ee,this._reversePixels=Ae,this._length=Ee-xe,this._alignToPixels=this.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){callback(this.options.afterSetDimensions,[this])}_callHooks(Ae){this.chart.notifyPlugins(Ae,this.getContext()),callback(this.options[Ae],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(Ae){const xe=this.options.ticks;let Ee,Se,Ce;for(Ee=0,Se=Ae.length;Ee<Se;Ee++)Ce=Ae[Ee],Ce.label=callback(xe.callback,[Ce.value,Ee,Ae],this)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const Ae=this.options,xe=Ae.ticks,Ee=getTicksLimit(this.ticks.length,Ae.ticks.maxTicksLimit),Se=xe.minRotation||0,Ce=xe.maxRotation;let _e=Se,Ie,Be,Te;if(!this._isVisible()||!xe.display||Se>=Ce||Ee<=1||!this.isHorizontal()){this.labelRotation=Se;return}const Pe=this._getLabelSizes(),ke=Pe.widest.width,$e=Pe.highest.height,Oe=_limitValue(this.chart.width-ke,0,this.maxWidth);Ie=Ae.offset?this.maxWidth/Ee:Oe/(Ee-1),ke+6>Ie&&(Ie=Oe/(Ee-(Ae.offset?.5:1)),Be=this.maxHeight-getTickMarkLength(Ae.grid)-xe.padding-getTitleHeight(Ae.title,this.chart.options.font),Te=Math.sqrt(ke*ke+$e*$e),_e=toDegrees(Math.min(Math.asin(_limitValue((Pe.highest.height+6)/Ie,-1,1)),Math.asin(_limitValue(Be/Te,-1,1))-Math.asin(_limitValue($e/Te,-1,1)))),_e=Math.max(Se,Math.min(Ce,_e))),this.labelRotation=_e}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const Ae={width:0,height:0},{chart:xe,options:{ticks:Ee,title:Se,grid:Ce}}=this,_e=this._isVisible(),Ie=this.isHorizontal();if(_e){const Be=getTitleHeight(Se,xe.options.font);if(Ie?(Ae.width=this.maxWidth,Ae.height=getTickMarkLength(Ce)+Be):(Ae.height=this.maxHeight,Ae.width=getTickMarkLength(Ce)+Be),Ee.display&&this.ticks.length){const{first:Te,last:Pe,widest:ke,highest:$e}=this._getLabelSizes(),Oe=Ee.padding*2,Ue=toRadians(this.labelRotation),qe=Math.cos(Ue),ze=Math.sin(Ue);if(Ie){const Ve=Ee.mirror?0:ze*ke.width+qe*$e.height;Ae.height=Math.min(this.maxHeight,Ae.height+Ve+Oe)}else{const Ve=Ee.mirror?0:qe*ke.width+ze*$e.height;Ae.width=Math.min(this.maxWidth,Ae.width+Ve+Oe)}this._calculatePadding(Te,Pe,ze,qe)}}this._handleMargins(),Ie?(this.width=this._length=xe.width-this._margins.left-this._margins.right,this.height=Ae.height):(this.width=Ae.width,this.height=this._length=xe.height-this._margins.top-this._margins.bottom)}_calculatePadding(Ae,xe,Ee,Se){const{ticks:{align:Ce,padding:_e},position:Ie}=this.options,Be=this.labelRotation!==0,Te=Ie!=="top"&&this.axis==="x";if(this.isHorizontal()){const Pe=this.getPixelForTick(0)-this.left,ke=this.right-this.getPixelForTick(this.ticks.length-1);let $e=0,Oe=0;Be?Te?($e=Se*Ae.width,Oe=Ee*xe.height):($e=Ee*Ae.height,Oe=Se*xe.width):Ce==="start"?Oe=xe.width:Ce==="end"?$e=Ae.width:Ce!=="inner"&&($e=Ae.width/2,Oe=xe.width/2),this.paddingLeft=Math.max(($e-Pe+_e)*this.width/(this.width-Pe),0),this.paddingRight=Math.max((Oe-ke+_e)*this.width/(this.width-ke),0)}else{let Pe=xe.height/2,ke=Ae.height/2;Ce==="start"?(Pe=0,ke=Ae.height):Ce==="end"&&(Pe=xe.height,ke=0),this.paddingTop=Pe+_e,this.paddingBottom=ke+_e}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis:Ae,position:xe}=this.options;return xe==="top"||xe==="bottom"||Ae==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(Ae){this.beforeTickToLabelConversion(),this.generateTickLabels(Ae);let xe,Ee;for(xe=0,Ee=Ae.length;xe<Ee;xe++)isNullOrUndef(Ae[xe].label)&&(Ae.splice(xe,1),Ee--,xe--);this.afterTickToLabelConversion()}_getLabelSizes(){let Ae=this._labelSizes;if(!Ae){const xe=this.options.ticks.sampleSize;let Ee=this.ticks;xe<Ee.length&&(Ee=sample(Ee,xe)),this._labelSizes=Ae=this._computeLabelSizes(Ee,Ee.length,this.options.ticks.maxTicksLimit)}return Ae}_computeLabelSizes(Ae,xe,Ee){const{ctx:Se,_longestTextCache:Ce}=this,_e=[],Ie=[],Be=Math.floor(xe/getTicksLimit(xe,Ee));let Te=0,Pe=0,ke,$e,Oe,Ue,qe,ze,Ve,Ge,Xe,er,tr;for(ke=0;ke<xe;ke+=Be){if(Ue=Ae[ke].label,qe=this._resolveTickFontOptions(ke),Se.font=ze=qe.string,Ve=Ce[ze]=Ce[ze]||{data:{},gc:[]},Ge=qe.lineHeight,Xe=er=0,!isNullOrUndef(Ue)&&!isArray$2(Ue))Xe=_measureText(Se,Ve.data,Ve.gc,Xe,Ue),er=Ge;else if(isArray$2(Ue))for($e=0,Oe=Ue.length;$e<Oe;++$e)tr=Ue[$e],!isNullOrUndef(tr)&&!isArray$2(tr)&&(Xe=_measureText(Se,Ve.data,Ve.gc,Xe,tr),er+=Ge);_e.push(Xe),Ie.push(er),Te=Math.max(Xe,Te),Pe=Math.max(er,Pe)}garbageCollect(Ce,xe);const nr=_e.indexOf(Te),sr=Ie.indexOf(Pe),dr=ar=>({width:_e[ar]||0,height:Ie[ar]||0});return{first:dr(0),last:dr(xe-1),widest:dr(nr),highest:dr(sr),widths:_e,heights:Ie}}getLabelForValue(Ae){return Ae}getPixelForValue(Ae,xe){return NaN}getValueForPixel(Ae){}getPixelForTick(Ae){const xe=this.ticks;return Ae<0||Ae>xe.length-1?null:this.getPixelForValue(xe[Ae].value)}getPixelForDecimal(Ae){this._reversePixels&&(Ae=1-Ae);const xe=this._startPixel+Ae*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,xe,0):xe)}getDecimalForPixel(Ae){const xe=(Ae-this._startPixel)/this._length;return this._reversePixels?1-xe:xe}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:Ae,max:xe}=this;return Ae<0&&xe<0?xe:Ae>0&&xe>0?Ae:0}getContext(Ae){const xe=this.ticks||[];if(Ae>=0&&Ae<xe.length){const Ee=xe[Ae];return Ee.$context||(Ee.$context=createTickContext(this.getContext(),Ae,Ee))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const Ae=this.options.ticks,xe=toRadians(this.labelRotation),Ee=Math.abs(Math.cos(xe)),Se=Math.abs(Math.sin(xe)),Ce=this._getLabelSizes(),_e=Ae.autoSkipPadding||0,Ie=Ce?Ce.widest.width+_e:0,Be=Ce?Ce.highest.height+_e:0;return this.isHorizontal()?Be*Ee>Ie*Se?Ie/Ee:Be/Se:Be*Se<Ie*Ee?Be/Ee:Ie/Se}_isVisible(){const Ae=this.options.display;return Ae!=="auto"?!!Ae:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(Ae){const xe=this.axis,Ee=this.chart,Se=this.options,{grid:Ce,position:_e,border:Ie}=Se,Be=Ce.offset,Te=this.isHorizontal(),ke=this.ticks.length+(Be?1:0),$e=getTickMarkLength(Ce),Oe=[],Ue=Ie.setContext(this.getContext()),qe=Ue.display?Ue.width:0,ze=qe/2,Ve=function(Qe){return _alignPixel(Ee,Qe,qe)};let Ge,Xe,er,tr,nr,sr,dr,ar,lr,Ke,Me,je;if(_e==="top")Ge=Ve(this.bottom),sr=this.bottom-$e,ar=Ge-ze,Ke=Ve(Ae.top)+ze,je=Ae.bottom;else if(_e==="bottom")Ge=Ve(this.top),Ke=Ae.top,je=Ve(Ae.bottom)-ze,sr=Ge+ze,ar=this.top+$e;else if(_e==="left")Ge=Ve(this.right),nr=this.right-$e,dr=Ge-ze,lr=Ve(Ae.left)+ze,Me=Ae.right;else if(_e==="right")Ge=Ve(this.left),lr=Ae.left,Me=Ve(Ae.right)-ze,nr=Ge+ze,dr=this.left+$e;else if(xe==="x"){if(_e==="center")Ge=Ve((Ae.top+Ae.bottom)/2+.5);else if(isObject$1(_e)){const Qe=Object.keys(_e)[0],Ye=_e[Qe];Ge=Ve(this.chart.scales[Qe].getPixelForValue(Ye))}Ke=Ae.top,je=Ae.bottom,sr=Ge+ze,ar=sr+$e}else if(xe==="y"){if(_e==="center")Ge=Ve((Ae.left+Ae.right)/2);else if(isObject$1(_e)){const Qe=Object.keys(_e)[0],Ye=_e[Qe];Ge=Ve(this.chart.scales[Qe].getPixelForValue(Ye))}nr=Ge-ze,dr=nr-$e,lr=Ae.left,Me=Ae.right}const De=valueOrDefault(Se.ticks.maxTicksLimit,ke),He=Math.max(1,Math.ceil(ke/De));for(Xe=0;Xe<ke;Xe+=He){const Qe=this.getContext(Xe),Ye=Ce.setContext(Qe),St=Ie.setContext(Qe),We=Ye.lineWidth,Fe=Ye.color,Ze=St.dash||[],ir=St.dashOffset,ur=Ye.tickWidth,fr=Ye.tickColor,Ar=Ye.tickBorderDash||[],vr=Ye.tickBorderDashOffset;er=getPixelForGridLine(this,Xe,Be),er!==void 0&&(tr=_alignPixel(Ee,er,We),Te?nr=dr=lr=Me=tr:sr=ar=Ke=je=tr,Oe.push({tx1:nr,ty1:sr,tx2:dr,ty2:ar,x1:lr,y1:Ke,x2:Me,y2:je,width:We,color:Fe,borderDash:Ze,borderDashOffset:ir,tickWidth:ur,tickColor:fr,tickBorderDash:Ar,tickBorderDashOffset:vr}))}return this._ticksLength=ke,this._borderValue=Ge,Oe}_computeLabelItems(Ae){const xe=this.axis,Ee=this.options,{position:Se,ticks:Ce}=Ee,_e=this.isHorizontal(),Ie=this.ticks,{align:Be,crossAlign:Te,padding:Pe,mirror:ke}=Ce,$e=getTickMarkLength(Ee.grid),Oe=$e+Pe,Ue=ke?-Pe:Oe,qe=-toRadians(this.labelRotation),ze=[];let Ve,Ge,Xe,er,tr,nr,sr,dr,ar,lr,Ke,Me,je="middle";if(Se==="top")nr=this.bottom-Ue,sr=this._getXAxisLabelAlignment();else if(Se==="bottom")nr=this.top+Ue,sr=this._getXAxisLabelAlignment();else if(Se==="left"){const He=this._getYAxisLabelAlignment($e);sr=He.textAlign,tr=He.x}else if(Se==="right"){const He=this._getYAxisLabelAlignment($e);sr=He.textAlign,tr=He.x}else if(xe==="x"){if(Se==="center")nr=(Ae.top+Ae.bottom)/2+Oe;else if(isObject$1(Se)){const He=Object.keys(Se)[0],Qe=Se[He];nr=this.chart.scales[He].getPixelForValue(Qe)+Oe}sr=this._getXAxisLabelAlignment()}else if(xe==="y"){if(Se==="center")tr=(Ae.left+Ae.right)/2-Oe;else if(isObject$1(Se)){const He=Object.keys(Se)[0],Qe=Se[He];tr=this.chart.scales[He].getPixelForValue(Qe)}sr=this._getYAxisLabelAlignment($e).textAlign}xe==="y"&&(Be==="start"?je="top":Be==="end"&&(je="bottom"));const De=this._getLabelSizes();for(Ve=0,Ge=Ie.length;Ve<Ge;++Ve){Xe=Ie[Ve],er=Xe.label;const He=Ce.setContext(this.getContext(Ve));dr=this.getPixelForTick(Ve)+Ce.labelOffset,ar=this._resolveTickFontOptions(Ve),lr=ar.lineHeight,Ke=isArray$2(er)?er.length:1;const Qe=Ke/2,Ye=He.color,St=He.textStrokeColor,We=He.textStrokeWidth;let Fe=sr;_e?(tr=dr,sr==="inner"&&(Ve===Ge-1?Fe=this.options.reverse?"left":"right":Ve===0?Fe=this.options.reverse?"right":"left":Fe="center"),Se==="top"?Te==="near"||qe!==0?Me=-Ke*lr+lr/2:Te==="center"?Me=-De.highest.height/2-Qe*lr+lr:Me=-De.highest.height+lr/2:Te==="near"||qe!==0?Me=lr/2:Te==="center"?Me=De.highest.height/2-Qe*lr:Me=De.highest.height-Ke*lr,ke&&(Me*=-1),qe!==0&&!He.showLabelBackdrop&&(tr+=lr/2*Math.sin(qe))):(nr=dr,Me=(1-Ke)*lr/2);let Ze;if(He.showLabelBackdrop){const ir=toPadding(He.backdropPadding),ur=De.heights[Ve],fr=De.widths[Ve];let Ar=Me-ir.top,vr=0-ir.left;switch(je){case"middle":Ar-=ur/2;break;case"bottom":Ar-=ur;break}switch(sr){case"center":vr-=fr/2;break;case"right":vr-=fr;break;case"inner":Ve===Ge-1?vr-=fr:Ve>0&&(vr-=fr/2);break}Ze={left:vr,top:Ar,width:fr+ir.width,height:ur+ir.height,color:He.backdropColor}}ze.push({label:er,font:ar,textOffset:Me,options:{rotation:qe,color:Ye,strokeColor:St,strokeWidth:We,textAlign:Fe,textBaseline:je,translation:[tr,nr],backdrop:Ze}})}return ze}_getXAxisLabelAlignment(){const{position:Ae,ticks:xe}=this.options;if(-toRadians(this.labelRotation))return Ae==="top"?"left":"right";let Se="center";return xe.align==="start"?Se="left":xe.align==="end"?Se="right":xe.align==="inner"&&(Se="inner"),Se}_getYAxisLabelAlignment(Ae){const{position:xe,ticks:{crossAlign:Ee,mirror:Se,padding:Ce}}=this.options,_e=this._getLabelSizes(),Ie=Ae+Ce,Be=_e.widest.width;let Te,Pe;return xe==="left"?Se?(Pe=this.right+Ce,Ee==="near"?Te="left":Ee==="center"?(Te="center",Pe+=Be/2):(Te="right",Pe+=Be)):(Pe=this.right-Ie,Ee==="near"?Te="right":Ee==="center"?(Te="center",Pe-=Be/2):(Te="left",Pe=this.left)):xe==="right"?Se?(Pe=this.left+Ce,Ee==="near"?Te="right":Ee==="center"?(Te="center",Pe-=Be/2):(Te="left",Pe-=Be)):(Pe=this.left+Ie,Ee==="near"?Te="left":Ee==="center"?(Te="center",Pe+=Be/2):(Te="right",Pe=this.right)):Te="right",{textAlign:Te,x:Pe}}_computeLabelArea(){if(this.options.ticks.mirror)return;const Ae=this.chart,xe=this.options.position;if(xe==="left"||xe==="right")return{top:0,left:this.left,bottom:Ae.height,right:this.right};if(xe==="top"||xe==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:Ae.width}}drawBackground(){const{ctx:Ae,options:{backgroundColor:xe},left:Ee,top:Se,width:Ce,height:_e}=this;xe&&(Ae.save(),Ae.fillStyle=xe,Ae.fillRect(Ee,Se,Ce,_e),Ae.restore())}getLineWidthForValue(Ae){const xe=this.options.grid;if(!this._isVisible()||!xe.display)return 0;const Se=this.ticks.findIndex(Ce=>Ce.value===Ae);return Se>=0?xe.setContext(this.getContext(Se)).lineWidth:0}drawGrid(Ae){const xe=this.options.grid,Ee=this.ctx,Se=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(Ae));let Ce,_e;const Ie=(Be,Te,Pe)=>{!Pe.width||!Pe.color||(Ee.save(),Ee.lineWidth=Pe.width,Ee.strokeStyle=Pe.color,Ee.setLineDash(Pe.borderDash||[]),Ee.lineDashOffset=Pe.borderDashOffset,Ee.beginPath(),Ee.moveTo(Be.x,Be.y),Ee.lineTo(Te.x,Te.y),Ee.stroke(),Ee.restore())};if(xe.display)for(Ce=0,_e=Se.length;Ce<_e;++Ce){const Be=Se[Ce];xe.drawOnChartArea&&Ie({x:Be.x1,y:Be.y1},{x:Be.x2,y:Be.y2},Be),xe.drawTicks&&Ie({x:Be.tx1,y:Be.ty1},{x:Be.tx2,y:Be.ty2},{color:Be.tickColor,width:Be.tickWidth,borderDash:Be.tickBorderDash,borderDashOffset:Be.tickBorderDashOffset})}}drawBorder(){const{chart:Ae,ctx:xe,options:{border:Ee,grid:Se}}=this,Ce=Ee.setContext(this.getContext()),_e=Ee.display?Ce.width:0;if(!_e)return;const Ie=Se.setContext(this.getContext(0)).lineWidth,Be=this._borderValue;let Te,Pe,ke,$e;this.isHorizontal()?(Te=_alignPixel(Ae,this.left,_e)-_e/2,Pe=_alignPixel(Ae,this.right,Ie)+Ie/2,ke=$e=Be):(ke=_alignPixel(Ae,this.top,_e)-_e/2,$e=_alignPixel(Ae,this.bottom,Ie)+Ie/2,Te=Pe=Be),xe.save(),xe.lineWidth=Ce.width,xe.strokeStyle=Ce.color,xe.beginPath(),xe.moveTo(Te,ke),xe.lineTo(Pe,$e),xe.stroke(),xe.restore()}drawLabels(Ae){if(!this.options.ticks.display)return;const Ee=this.ctx,Se=this._computeLabelArea();Se&&clipArea(Ee,Se);const Ce=this.getLabelItems(Ae);for(const _e of Ce){const Ie=_e.options,Be=_e.font,Te=_e.label,Pe=_e.textOffset;renderText(Ee,Te,0,Pe,Be,Ie)}Se&&unclipArea(Ee)}drawTitle(){const{ctx:Ae,options:{position:xe,title:Ee,reverse:Se}}=this;if(!Ee.display)return;const Ce=toFont(Ee.font),_e=toPadding(Ee.padding),Ie=Ee.align;let Be=Ce.lineHeight/2;xe==="bottom"||xe==="center"||isObject$1(xe)?(Be+=_e.bottom,isArray$2(Ee.text)&&(Be+=Ce.lineHeight*(Ee.text.length-1))):Be+=_e.top;const{titleX:Te,titleY:Pe,maxWidth:ke,rotation:$e}=titleArgs(this,Be,xe,Ie);renderText(Ae,Ee.text,0,0,Ce,{color:Ee.color,maxWidth:ke,rotation:$e,textAlign:titleAlign(Ie,xe,Se),textBaseline:"middle",translation:[Te,Pe]})}draw(Ae){this._isVisible()&&(this.drawBackground(),this.drawGrid(Ae),this.drawBorder(),this.drawTitle(),this.drawLabels(Ae))}_layers(){const Ae=this.options,xe=Ae.ticks&&Ae.ticks.z||0,Ee=valueOrDefault(Ae.grid&&Ae.grid.z,-1),Se=valueOrDefault(Ae.border&&Ae.border.z,0);return!this._isVisible()||this.draw!==Scale.prototype.draw?[{z:xe,draw:Ce=>{this.draw(Ce)}}]:[{z:Ee,draw:Ce=>{this.drawBackground(),this.drawGrid(Ce),this.drawTitle()}},{z:Se,draw:()=>{this.drawBorder()}},{z:xe,draw:Ce=>{this.drawLabels(Ce)}}]}getMatchingVisibleMetas(Ae){const xe=this.chart.getSortedVisibleDatasetMetas(),Ee=this.axis+"AxisID",Se=[];let Ce,_e;for(Ce=0,_e=xe.length;Ce<_e;++Ce){const Ie=xe[Ce];Ie[Ee]===this.id&&(!Ae||Ie.type===Ae)&&Se.push(Ie)}return Se}_resolveTickFontOptions(Ae){const xe=this.options.ticks.setContext(this.getContext(Ae));return toFont(xe.font)}_maxDigits(){const Ae=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/Ae}}class TypedRegistry{constructor(Ae,xe,Ee){this.type=Ae,this.scope=xe,this.override=Ee,this.items=Object.create(null)}isForType(Ae){return Object.prototype.isPrototypeOf.call(this.type.prototype,Ae.prototype)}register(Ae){const xe=Object.getPrototypeOf(Ae);let Ee;isIChartComponent(xe)&&(Ee=this.register(xe));const Se=this.items,Ce=Ae.id,_e=this.scope+"."+Ce;if(!Ce)throw new Error("class does not have id: "+Ae);return Ce in Se||(Se[Ce]=Ae,registerDefaults(Ae,_e,Ee),this.override&&defaults$1.override(Ae.id,Ae.overrides)),_e}get(Ae){return this.items[Ae]}unregister(Ae){const xe=this.items,Ee=Ae.id,Se=this.scope;Ee in xe&&delete xe[Ee],Se&&Ee in defaults$1[Se]&&(delete defaults$1[Se][Ee],this.override&&delete overrides[Ee])}}function registerDefaults(t,Ae,xe){const Ee=merge$1(Object.create(null),[xe?defaults$1.get(xe):{},defaults$1.get(Ae),t.defaults]);defaults$1.set(Ae,Ee),t.defaultRoutes&&routeDefaults(Ae,t.defaultRoutes),t.descriptors&&defaults$1.describe(Ae,t.descriptors)}function routeDefaults(t,Ae){Object.keys(Ae).forEach(xe=>{const Ee=xe.split("."),Se=Ee.pop(),Ce=[t].concat(Ee).join("."),_e=Ae[xe].split("."),Ie=_e.pop(),Be=_e.join(".");defaults$1.route(Ce,Se,Be,Ie)})}function isIChartComponent(t){return"id"in t&&"defaults"in t}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$2,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...Ae){this._each("register",Ae)}remove(...Ae){this._each("unregister",Ae)}addControllers(...Ae){this._each("register",Ae,this.controllers)}addElements(...Ae){this._each("register",Ae,this.elements)}addPlugins(...Ae){this._each("register",Ae,this.plugins)}addScales(...Ae){this._each("register",Ae,this.scales)}getController(Ae){return this._get(Ae,this.controllers,"controller")}getElement(Ae){return this._get(Ae,this.elements,"element")}getPlugin(Ae){return this._get(Ae,this.plugins,"plugin")}getScale(Ae){return this._get(Ae,this.scales,"scale")}removeControllers(...Ae){this._each("unregister",Ae,this.controllers)}removeElements(...Ae){this._each("unregister",Ae,this.elements)}removePlugins(...Ae){this._each("unregister",Ae,this.plugins)}removeScales(...Ae){this._each("unregister",Ae,this.scales)}_each(Ae,xe,Ee){[...xe].forEach(Se=>{const Ce=Ee||this._getRegistryForType(Se);Ee||Ce.isForType(Se)||Ce===this.plugins&&Se.id?this._exec(Ae,Ce,Se):each(Se,_e=>{const Ie=Ee||this._getRegistryForType(_e);this._exec(Ae,Ie,_e)})})}_exec(Ae,xe,Ee){const Se=_capitalize(Ae);callback(Ee["before"+Se],[],Ee),xe[Ae](Ee),callback(Ee["after"+Se],[],Ee)}_getRegistryForType(Ae){for(let xe=0;xe<this._typedRegistries.length;xe++){const Ee=this._typedRegistries[xe];if(Ee.isForType(Ae))return Ee}return this.plugins}_get(Ae,xe,Ee){const Se=xe.get(Ae);if(Se===void 0)throw new Error('"'+Ae+'" is not a registered '+Ee+".");return Se}}var registry=new Registry;class PluginService{constructor(){this._init=[]}notify(Ae,xe,Ee,Se){xe==="beforeInit"&&(this._init=this._createDescriptors(Ae,!0),this._notify(this._init,Ae,"install"));const Ce=Se?this._descriptors(Ae).filter(Se):this._descriptors(Ae),_e=this._notify(Ce,Ae,xe,Ee);return xe==="afterDestroy"&&(this._notify(Ce,Ae,"stop"),this._notify(this._init,Ae,"uninstall")),_e}_notify(Ae,xe,Ee,Se){Se=Se||{};for(const Ce of Ae){const _e=Ce.plugin,Ie=_e[Ee],Be=[xe,Se,Ce.options];if(callback(Ie,Be,_e)===!1&&Se.cancelable)return!1}return!0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(Ae){if(this._cache)return this._cache;const xe=this._cache=this._createDescriptors(Ae);return this._notifyStateChanges(Ae),xe}_createDescriptors(Ae,xe){const Ee=Ae&&Ae.config,Se=valueOrDefault(Ee.options&&Ee.options.plugins,{}),Ce=allPlugins(Ee);return Se===!1&&!xe?[]:createDescriptors(Ae,Ce,Se,xe)}_notifyStateChanges(Ae){const xe=this._oldCache||[],Ee=this._cache,Se=(Ce,_e)=>Ce.filter(Ie=>!_e.some(Be=>Ie.plugin.id===Be.plugin.id));this._notify(Se(xe,Ee),Ae,"stop"),this._notify(Se(Ee,xe),Ae,"start")}}function allPlugins(t){const Ae={},xe=[],Ee=Object.keys(registry.plugins.items);for(let Ce=0;Ce<Ee.length;Ce++)xe.push(registry.getPlugin(Ee[Ce]));const Se=t.plugins||[];for(let Ce=0;Ce<Se.length;Ce++){const _e=Se[Ce];xe.indexOf(_e)===-1&&(xe.push(_e),Ae[_e.id]=!0)}return{plugins:xe,localIds:Ae}}function getOpts(t,Ae){return!Ae&&t===!1?null:t===!0?{}:t}function createDescriptors(t,{plugins:Ae,localIds:xe},Ee,Se){const Ce=[],_e=t.getContext();for(const Ie of Ae){const Be=Ie.id,Te=getOpts(Ee[Be],Se);Te!==null&&Ce.push({plugin:Ie,options:pluginOpts(t.config,{plugin:Ie,local:xe[Be]},Te,_e)})}return Ce}function pluginOpts(t,{plugin:Ae,local:xe},Ee,Se){const Ce=t.pluginScopeKeys(Ae),_e=t.getOptionScopes(Ee,Ce);return xe&&Ae.defaults&&_e.push(Ae.defaults),t.createResolver(_e,Se,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(t,Ae){const xe=defaults$1.datasets[t]||{};return((Ae.datasets||{})[t]||{}).indexAxis||Ae.indexAxis||xe.indexAxis||"x"}function getAxisFromDefaultScaleID(t,Ae){let xe=t;return t==="_index_"?xe=Ae:t==="_value_"&&(xe=Ae==="x"?"y":"x"),xe}function getDefaultScaleIDFromAxis(t,Ae){return t===Ae?"_index_":"_value_"}function idMatchesAxis(t){if(t==="x"||t==="y"||t==="r")return t}function axisFromPosition(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function determineAxis(t,...Ae){if(idMatchesAxis(t))return t;for(const xe of Ae){const Ee=xe.axis||axisFromPosition(xe.position)||t.length>1&&idMatchesAxis(t[0].toLowerCase());if(Ee)return Ee}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(t,Ae,xe){if(xe[Ae+"AxisID"]===t)return{axis:Ae}}function retrieveAxisFromDatasets(t,Ae){if(Ae.data&&Ae.data.datasets){const xe=Ae.data.datasets.filter(Ee=>Ee.xAxisID===t||Ee.yAxisID===t);if(xe.length)return getAxisFromDataset(t,"x",xe[0])||getAxisFromDataset(t,"y",xe[0])}return{}}function mergeScaleConfig(t,Ae){const xe=overrides[t.type]||{scales:{}},Ee=Ae.scales||{},Se=getIndexAxis(t.type,Ae),Ce=Object.create(null);return Object.keys(Ee).forEach(_e=>{const Ie=Ee[_e];if(!isObject$1(Ie))return console.error(`Invalid scale configuration for scale: ${_e}`);if(Ie._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${_e}`);const Be=determineAxis(_e,Ie,retrieveAxisFromDatasets(_e,t),defaults$1.scales[Ie.type]),Te=getDefaultScaleIDFromAxis(Be,Se),Pe=xe.scales||{};Ce[_e]=mergeIf(Object.create(null),[{axis:Be},Ie,Pe[Be],Pe[Te]])}),t.data.datasets.forEach(_e=>{const Ie=_e.type||t.type,Be=_e.indexAxis||getIndexAxis(Ie,Ae),Pe=(overrides[Ie]||{}).scales||{};Object.keys(Pe).forEach(ke=>{const $e=getAxisFromDefaultScaleID(ke,Be),Oe=_e[$e+"AxisID"]||$e;Ce[Oe]=Ce[Oe]||Object.create(null),mergeIf(Ce[Oe],[{axis:$e},Ee[Oe],Pe[ke]])})}),Object.keys(Ce).forEach(_e=>{const Ie=Ce[_e];mergeIf(Ie,[defaults$1.scales[Ie.type],defaults$1.scale])}),Ce}function initOptions(t){const Ae=t.options||(t.options={});Ae.plugins=valueOrDefault(Ae.plugins,{}),Ae.scales=mergeScaleConfig(t,Ae)}function initData(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function initConfig(t){return t=t||{},t.data=initData(t.data),initOptions(t),t}const keyCache=new Map,keysCached=new Set;function cachedKeys(t,Ae){let xe=keyCache.get(t);return xe||(xe=Ae(),keyCache.set(t,xe),keysCached.add(xe)),xe}const addIfFound=(t,Ae,xe)=>{const Ee=resolveObjectKey(Ae,xe);Ee!==void 0&&t.add(Ee)};class Config{constructor(Ae){this._config=initConfig(Ae),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(Ae){this._config.type=Ae}get data(){return this._config.data}set data(Ae){this._config.data=initData(Ae)}get options(){return this._config.options}set options(Ae){this._config.options=Ae}get plugins(){return this._config.plugins}update(){const Ae=this._config;this.clearCache(),initOptions(Ae)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(Ae){return cachedKeys(Ae,()=>[[`datasets.${Ae}`,""]])}datasetAnimationScopeKeys(Ae,xe){return cachedKeys(`${Ae}.transition.${xe}`,()=>[[`datasets.${Ae}.transitions.${xe}`,`transitions.${xe}`],[`datasets.${Ae}`,""]])}datasetElementScopeKeys(Ae,xe){return cachedKeys(`${Ae}-${xe}`,()=>[[`datasets.${Ae}.elements.${xe}`,`datasets.${Ae}`,`elements.${xe}`,""]])}pluginScopeKeys(Ae){const xe=Ae.id,Ee=this.type;return cachedKeys(`${Ee}-plugin-${xe}`,()=>[[`plugins.${xe}`,...Ae.additionalOptionScopes||[]]])}_cachedScopes(Ae,xe){const Ee=this._scopeCache;let Se=Ee.get(Ae);return(!Se||xe)&&(Se=new Map,Ee.set(Ae,Se)),Se}getOptionScopes(Ae,xe,Ee){const{options:Se,type:Ce}=this,_e=this._cachedScopes(Ae,Ee),Ie=_e.get(xe);if(Ie)return Ie;const Be=new Set;xe.forEach(Pe=>{Ae&&(Be.add(Ae),Pe.forEach(ke=>addIfFound(Be,Ae,ke))),Pe.forEach(ke=>addIfFound(Be,Se,ke)),Pe.forEach(ke=>addIfFound(Be,overrides[Ce]||{},ke)),Pe.forEach(ke=>addIfFound(Be,defaults$1,ke)),Pe.forEach(ke=>addIfFound(Be,descriptors,ke))});const Te=Array.from(Be);return Te.length===0&&Te.push(Object.create(null)),keysCached.has(xe)&&_e.set(xe,Te),Te}chartOptionScopes(){const{options:Ae,type:xe}=this;return[Ae,overrides[xe]||{},defaults$1.datasets[xe]||{},{type:xe},defaults$1,descriptors]}resolveNamedOptions(Ae,xe,Ee,Se=[""]){const Ce={$shared:!0},{resolver:_e,subPrefixes:Ie}=getResolver(this._resolverCache,Ae,Se);let Be=_e;if(needContext(_e,xe)){Ce.$shared=!1,Ee=isFunction$2(Ee)?Ee():Ee;const Te=this.createResolver(Ae,Ee,Ie);Be=_attachContext(_e,Ee,Te)}for(const Te of xe)Ce[Te]=Be[Te];return Ce}createResolver(Ae,xe,Ee=[""],Se){const{resolver:Ce}=getResolver(this._resolverCache,Ae,Ee);return isObject$1(xe)?_attachContext(Ce,xe,void 0,Se):Ce}}function getResolver(t,Ae,xe){let Ee=t.get(Ae);Ee||(Ee=new Map,t.set(Ae,Ee));const Se=xe.join();let Ce=Ee.get(Se);return Ce||(Ce={resolver:_createResolver(Ae,xe),subPrefixes:xe.filter(Ie=>!Ie.toLowerCase().includes("hover"))},Ee.set(Se,Ce)),Ce}const hasFunction=t=>isObject$1(t)&&Object.getOwnPropertyNames(t).some(Ae=>isFunction$2(t[Ae]));function needContext(t,Ae){const{isScriptable:xe,isIndexable:Ee}=_descriptors(t);for(const Se of Ae){const Ce=xe(Se),_e=Ee(Se),Ie=(_e||Ce)&&t[Se];if(Ce&&(isFunction$2(Ie)||hasFunction(Ie))||_e&&isArray$2(Ie))return!0}return!1}var version="4.4.9";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(t,Ae){return t==="top"||t==="bottom"||KNOWN_POSITIONS.indexOf(t)===-1&&Ae==="x"}function compare2Level(t,Ae){return function(xe,Ee){return xe[t]===Ee[t]?xe[Ae]-Ee[Ae]:xe[t]-Ee[t]}}function onAnimationsComplete(t){const Ae=t.chart,xe=Ae.options.animation;Ae.notifyPlugins("afterRender"),callback(xe&&xe.onComplete,[t],Ae)}function onAnimationProgress(t){const Ae=t.chart,xe=Ae.options.animation;callback(xe&&xe.onProgress,[t],Ae)}function getCanvas(t){return _isDomSupported()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const instances={},getChart=t=>{const Ae=getCanvas(t);return Object.values(instances).filter(xe=>xe.canvas===Ae).pop()};function moveNumericKeys(t,Ae,xe){const Ee=Object.keys(t);for(const Se of Ee){const Ce=+Se;if(Ce>=Ae){const _e=t[Se];delete t[Se],(xe>0||Ce>Ae)&&(t[Ce+xe]=_e)}}}function determineLastEvent(t,Ae,xe,Ee){return!xe||t.type==="mouseout"?null:Ee?Ae:t}class Chart{static register(...Ae){registry.add(...Ae),invalidatePlugins()}static unregister(...Ae){registry.remove(...Ae),invalidatePlugins()}constructor(Ae,xe){const Ee=this.config=new Config(xe),Se=getCanvas(Ae),Ce=getChart(Se);if(Ce)throw new Error("Canvas is already in use. Chart with ID '"+Ce.id+"' must be destroyed before the canvas with ID '"+Ce.canvas.id+"' can be reused.");const _e=Ee.createResolver(Ee.chartOptionScopes(),this.getContext());this.platform=new(Ee.platform||_detectPlatform(Se)),this.platform.updateConfig(Ee);const Ie=this.platform.acquireContext(Se,_e.aspectRatio),Be=Ie&&Ie.canvas,Te=Be&&Be.height,Pe=Be&&Be.width;if(this.id=uid(),this.ctx=Ie,this.canvas=Be,this.width=Pe,this.height=Te,this._options=_e,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(ke=>this.update(ke),_e.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,!Ie||!Be){console.error("Failed to create chart: can't acquire context from the given item");return}animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:Ae,maintainAspectRatio:xe},width:Ee,height:Se,_aspectRatio:Ce}=this;return isNullOrUndef(Ae)?xe&&Ce?Ce:Se?Ee/Se:null:Ae}get data(){return this.config.data}set data(Ae){this.config.data=Ae}get options(){return this._options}set options(Ae){this.config.options=Ae}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(Ae,xe){animator.running(this)?this._resizeBeforeDraw={width:Ae,height:xe}:this._resize(Ae,xe)}_resize(Ae,xe){const Ee=this.options,Se=this.canvas,Ce=Ee.maintainAspectRatio&&this.aspectRatio,_e=this.platform.getMaximumSize(Se,Ae,xe,Ce),Ie=Ee.devicePixelRatio||this.platform.getDevicePixelRatio(),Be=this.width?"resize":"attach";this.width=_e.width,this.height=_e.height,this._aspectRatio=this.aspectRatio,retinaScale(this,Ie,!0)&&(this.notifyPlugins("resize",{size:_e}),callback(Ee.onResize,[this,_e],this),this.attached&&this._doResize(Be)&&this.render())}ensureScalesHaveIDs(){const xe=this.options.scales||{};each(xe,(Ee,Se)=>{Ee.id=Se})}buildOrUpdateScales(){const Ae=this.options,xe=Ae.scales,Ee=this.scales,Se=Object.keys(Ee).reduce((_e,Ie)=>(_e[Ie]=!1,_e),{});let Ce=[];xe&&(Ce=Ce.concat(Object.keys(xe).map(_e=>{const Ie=xe[_e],Be=determineAxis(_e,Ie),Te=Be==="r",Pe=Be==="x";return{options:Ie,dposition:Te?"chartArea":Pe?"bottom":"left",dtype:Te?"radialLinear":Pe?"category":"linear"}}))),each(Ce,_e=>{const Ie=_e.options,Be=Ie.id,Te=determineAxis(Be,Ie),Pe=valueOrDefault(Ie.type,_e.dtype);(Ie.position===void 0||positionIsHorizontal(Ie.position,Te)!==positionIsHorizontal(_e.dposition))&&(Ie.position=_e.dposition),Se[Be]=!0;let ke=null;if(Be in Ee&&Ee[Be].type===Pe)ke=Ee[Be];else{const $e=registry.getScale(Pe);ke=new $e({id:Be,type:Pe,ctx:this.ctx,chart:this}),Ee[ke.id]=ke}ke.init(Ie,Ae)}),each(Se,(_e,Ie)=>{_e||delete Ee[Ie]}),each(Ee,_e=>{layouts.configure(this,_e,_e.options),layouts.addBox(this,_e)})}_updateMetasets(){const Ae=this._metasets,xe=this.data.datasets.length,Ee=Ae.length;if(Ae.sort((Se,Ce)=>Se.index-Ce.index),Ee>xe){for(let Se=xe;Se<Ee;++Se)this._destroyDatasetMeta(Se);Ae.splice(xe,Ee-xe)}this._sortedMetasets=Ae.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){const{_metasets:Ae,data:{datasets:xe}}=this;Ae.length>xe.length&&delete this._stacks,Ae.forEach((Ee,Se)=>{xe.filter(Ce=>Ce===Ee._dataset).length===0&&this._destroyDatasetMeta(Se)})}buildOrUpdateControllers(){const Ae=[],xe=this.data.datasets;let Ee,Se;for(this._removeUnreferencedMetasets(),Ee=0,Se=xe.length;Ee<Se;Ee++){const Ce=xe[Ee];let _e=this.getDatasetMeta(Ee);const Ie=Ce.type||this.config.type;if(_e.type&&_e.type!==Ie&&(this._destroyDatasetMeta(Ee),_e=this.getDatasetMeta(Ee)),_e.type=Ie,_e.indexAxis=Ce.indexAxis||getIndexAxis(Ie,this.options),_e.order=Ce.order||0,_e.index=Ee,_e.label=""+Ce.label,_e.visible=this.isDatasetVisible(Ee),_e.controller)_e.controller.updateIndex(Ee),_e.controller.linkScales();else{const Be=registry.getController(Ie),{datasetElementType:Te,dataElementType:Pe}=defaults$1.datasets[Ie];Object.assign(Be,{dataElementType:registry.getElement(Pe),datasetElementType:Te&&registry.getElement(Te)}),_e.controller=new Be(this,Ee),Ae.push(_e.controller)}}return this._updateMetasets(),Ae}_resetElements(){each(this.data.datasets,(Ae,xe)=>{this.getDatasetMeta(xe).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(Ae){const xe=this.config;xe.update();const Ee=this._options=xe.createResolver(xe.chartOptionScopes(),this.getContext()),Se=this._animationsDisabled=!Ee.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:Ae,cancelable:!0})===!1)return;const Ce=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let _e=0;for(let Te=0,Pe=this.data.datasets.length;Te<Pe;Te++){const{controller:ke}=this.getDatasetMeta(Te),$e=!Se&&Ce.indexOf(ke)===-1;ke.buildOrUpdateElements($e),_e=Math.max(+ke.getMaxOverflow(),_e)}_e=this._minPadding=Ee.layout.autoPadding?_e:0,this._updateLayout(_e),Se||each(Ce,Te=>{Te.reset()}),this._updateDatasets(Ae),this.notifyPlugins("afterUpdate",{mode:Ae}),this._layers.sort(compare2Level("z","_idx"));const{_active:Ie,_lastEvent:Be}=this;Be?this._eventHandler(Be,!0):Ie.length&&this._updateHoverStyles(Ie,Ie,!0),this.render()}_updateScales(){each(this.scales,Ae=>{layouts.removeBox(this,Ae)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const Ae=this.options,xe=new Set(Object.keys(this._listeners)),Ee=new Set(Ae.events);(!setsEqual(xe,Ee)||!!this._responsiveListeners!==Ae.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:Ae}=this,xe=this._getUniformDataChanges()||[];for(const{method:Ee,start:Se,count:Ce}of xe){const _e=Ee==="_removeElements"?-Ce:Ce;moveNumericKeys(Ae,Se,_e)}}_getUniformDataChanges(){const Ae=this._dataChanges;if(!Ae||!Ae.length)return;this._dataChanges=[];const xe=this.data.datasets.length,Ee=Ce=>new Set(Ae.filter(_e=>_e[0]===Ce).map((_e,Ie)=>Ie+","+_e.splice(1).join(","))),Se=Ee(0);for(let Ce=1;Ce<xe;Ce++)if(!setsEqual(Se,Ee(Ce)))return;return Array.from(Se).map(Ce=>Ce.split(",")).map(Ce=>({method:Ce[1],start:+Ce[2],count:+Ce[3]}))}_updateLayout(Ae){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;layouts.update(this,this.width,this.height,Ae);const xe=this.chartArea,Ee=xe.width<=0||xe.height<=0;this._layers=[],each(this.boxes,Se=>{Ee&&Se.position==="chartArea"||(Se.configure&&Se.configure(),this._layers.push(...Se._layers()))},this),this._layers.forEach((Se,Ce)=>{Se._idx=Ce}),this.notifyPlugins("afterLayout")}_updateDatasets(Ae){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:Ae,cancelable:!0})!==!1){for(let xe=0,Ee=this.data.datasets.length;xe<Ee;++xe)this.getDatasetMeta(xe).controller.configure();for(let xe=0,Ee=this.data.datasets.length;xe<Ee;++xe)this._updateDataset(xe,isFunction$2(Ae)?Ae({datasetIndex:xe}):Ae);this.notifyPlugins("afterDatasetsUpdate",{mode:Ae})}}_updateDataset(Ae,xe){const Ee=this.getDatasetMeta(Ae),Se={meta:Ee,index:Ae,mode:xe,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",Se)!==!1&&(Ee.controller._update(xe),Se.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",Se))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})))}draw(){let Ae;if(this._resizeBeforeDraw){const{width:Ee,height:Se}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(Ee,Se)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const xe=this._layers;for(Ae=0;Ae<xe.length&&xe[Ae].z<=0;++Ae)xe[Ae].draw(this.chartArea);for(this._drawDatasets();Ae<xe.length;++Ae)xe[Ae].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(Ae){const xe=this._sortedMetasets,Ee=[];let Se,Ce;for(Se=0,Ce=xe.length;Se<Ce;++Se){const _e=xe[Se];(!Ae||_e.visible)&&Ee.push(_e)}return Ee}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const Ae=this.getSortedVisibleDatasetMetas();for(let xe=Ae.length-1;xe>=0;--xe)this._drawDataset(Ae[xe]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(Ae){const xe=this.ctx,Ee={meta:Ae,index:Ae.index,cancelable:!0},Se=getDatasetClipArea(this,Ae);this.notifyPlugins("beforeDatasetDraw",Ee)!==!1&&(Se&&clipArea(xe,Se),Ae.controller.draw(),Se&&unclipArea(xe),Ee.cancelable=!1,this.notifyPlugins("afterDatasetDraw",Ee))}isPointInArea(Ae){return _isPointInArea(Ae,this.chartArea,this._minPadding)}getElementsAtEventForMode(Ae,xe,Ee,Se){const Ce=Interaction.modes[xe];return typeof Ce=="function"?Ce(this,Ae,Ee,Se):[]}getDatasetMeta(Ae){const xe=this.data.datasets[Ae],Ee=this._metasets;let Se=Ee.filter(Ce=>Ce&&Ce._dataset===xe).pop();return Se||(Se={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:xe&&xe.order||0,index:Ae,_dataset:xe,_parsed:[],_sorted:!1},Ee.push(Se)),Se}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(Ae){const xe=this.data.datasets[Ae];if(!xe)return!1;const Ee=this.getDatasetMeta(Ae);return typeof Ee.hidden=="boolean"?!Ee.hidden:!xe.hidden}setDatasetVisibility(Ae,xe){const Ee=this.getDatasetMeta(Ae);Ee.hidden=!xe}toggleDataVisibility(Ae){this._hiddenIndices[Ae]=!this._hiddenIndices[Ae]}getDataVisibility(Ae){return!this._hiddenIndices[Ae]}_updateVisibility(Ae,xe,Ee){const Se=Ee?"show":"hide",Ce=this.getDatasetMeta(Ae),_e=Ce.controller._resolveAnimations(void 0,Se);defined(xe)?(Ce.data[xe].hidden=!Ee,this.update()):(this.setDatasetVisibility(Ae,Ee),_e.update(Ce,{visible:Ee}),this.update(Ie=>Ie.datasetIndex===Ae?Se:void 0))}hide(Ae,xe){this._updateVisibility(Ae,xe,!1)}show(Ae,xe){this._updateVisibility(Ae,xe,!0)}_destroyDatasetMeta(Ae){const xe=this._metasets[Ae];xe&&xe.controller&&xe.controller._destroy(),delete this._metasets[Ae]}_stop(){let Ae,xe;for(this.stop(),animator.remove(this),Ae=0,xe=this.data.datasets.length;Ae<xe;++Ae)this._destroyDatasetMeta(Ae)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:Ae,ctx:xe}=this;this._stop(),this.config.clearCache(),Ae&&(this.unbindEvents(),clearCanvas(Ae,xe),this.platform.releaseContext(xe),this.canvas=null,this.ctx=null),delete instances[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...Ae){return this.canvas.toDataURL(...Ae)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const Ae=this._listeners,xe=this.platform,Ee=(Ce,_e)=>{xe.addEventListener(this,Ce,_e),Ae[Ce]=_e},Se=(Ce,_e,Ie)=>{Ce.offsetX=_e,Ce.offsetY=Ie,this._eventHandler(Ce)};each(this.options.events,Ce=>Ee(Ce,Se))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const Ae=this._responsiveListeners,xe=this.platform,Ee=(Be,Te)=>{xe.addEventListener(this,Be,Te),Ae[Be]=Te},Se=(Be,Te)=>{Ae[Be]&&(xe.removeEventListener(this,Be,Te),delete Ae[Be])},Ce=(Be,Te)=>{this.canvas&&this.resize(Be,Te)};let _e;const Ie=()=>{Se("attach",Ie),this.attached=!0,this.resize(),Ee("resize",Ce),Ee("detach",_e)};_e=()=>{this.attached=!1,Se("resize",Ce),this._stop(),this._resize(0,0),Ee("attach",Ie)},xe.isAttached(this.canvas)?Ie():_e()}unbindEvents(){each(this._listeners,(Ae,xe)=>{this.platform.removeEventListener(this,xe,Ae)}),this._listeners={},each(this._responsiveListeners,(Ae,xe)=>{this.platform.removeEventListener(this,xe,Ae)}),this._responsiveListeners=void 0}updateHoverStyle(Ae,xe,Ee){const Se=Ee?"set":"remove";let Ce,_e,Ie,Be;for(xe==="dataset"&&(Ce=this.getDatasetMeta(Ae[0].datasetIndex),Ce.controller["_"+Se+"DatasetHoverStyle"]()),Ie=0,Be=Ae.length;Ie<Be;++Ie){_e=Ae[Ie];const Te=_e&&this.getDatasetMeta(_e.datasetIndex).controller;Te&&Te[Se+"HoverStyle"](_e.element,_e.datasetIndex,_e.index)}}getActiveElements(){return this._active||[]}setActiveElements(Ae){const xe=this._active||[],Ee=Ae.map(({datasetIndex:Ce,index:_e})=>{const Ie=this.getDatasetMeta(Ce);if(!Ie)throw new Error("No dataset found at index "+Ce);return{datasetIndex:Ce,element:Ie.data[_e],index:_e}});!_elementsEqual(Ee,xe)&&(this._active=Ee,this._lastEvent=null,this._updateHoverStyles(Ee,xe))}notifyPlugins(Ae,xe,Ee){return this._plugins.notify(this,Ae,xe,Ee)}isPluginEnabled(Ae){return this._plugins._cache.filter(xe=>xe.plugin.id===Ae).length===1}_updateHoverStyles(Ae,xe,Ee){const Se=this.options.hover,Ce=(Be,Te)=>Be.filter(Pe=>!Te.some(ke=>Pe.datasetIndex===ke.datasetIndex&&Pe.index===ke.index)),_e=Ce(xe,Ae),Ie=Ee?Ae:Ce(Ae,xe);_e.length&&this.updateHoverStyle(_e,Se.mode,!1),Ie.length&&Se.mode&&this.updateHoverStyle(Ie,Se.mode,!0)}_eventHandler(Ae,xe){const Ee={event:Ae,replay:xe,cancelable:!0,inChartArea:this.isPointInArea(Ae)},Se=_e=>(_e.options.events||this.options.events).includes(Ae.native.type);if(this.notifyPlugins("beforeEvent",Ee,Se)===!1)return;const Ce=this._handleEvent(Ae,xe,Ee.inChartArea);return Ee.cancelable=!1,this.notifyPlugins("afterEvent",Ee,Se),(Ce||Ee.changed)&&this.render(),this}_handleEvent(Ae,xe,Ee){const{_active:Se=[],options:Ce}=this,_e=xe,Ie=this._getActiveElements(Ae,Se,Ee,_e),Be=_isClickEvent(Ae),Te=determineLastEvent(Ae,this._lastEvent,Ee,Be);Ee&&(this._lastEvent=null,callback(Ce.onHover,[Ae,Ie,this],this),Be&&callback(Ce.onClick,[Ae,Ie,this],this));const Pe=!_elementsEqual(Ie,Se);return(Pe||xe)&&(this._active=Ie,this._updateHoverStyles(Ie,Se,xe)),this._lastEvent=Te,Pe}_getActiveElements(Ae,xe,Ee,Se){if(Ae.type==="mouseout")return[];if(!Ee)return xe;const Ce=this.options.hover;return this.getElementsAtEventForMode(Ae,Ce.mode,Ce,Se)}}$i(Chart,"defaults",defaults$1),$i(Chart,"instances",instances),$i(Chart,"overrides",overrides),$i(Chart,"registry",registry),$i(Chart,"version",version),$i(Chart,"getChart",getChart);function invalidatePlugins(){return each(Chart.instances,t=>t._plugins.invalidate())}function setStyle(t,Ae,xe=Ae){t.lineCap=valueOrDefault(xe.borderCapStyle,Ae.borderCapStyle),t.setLineDash(valueOrDefault(xe.borderDash,Ae.borderDash)),t.lineDashOffset=valueOrDefault(xe.borderDashOffset,Ae.borderDashOffset),t.lineJoin=valueOrDefault(xe.borderJoinStyle,Ae.borderJoinStyle),t.lineWidth=valueOrDefault(xe.borderWidth,Ae.borderWidth),t.strokeStyle=valueOrDefault(xe.borderColor,Ae.borderColor)}function lineTo(t,Ae,xe){t.lineTo(xe.x,xe.y)}function getLineMethod(t){return t.stepped?_steppedLineTo:t.tension||t.cubicInterpolationMode==="monotone"?_bezierCurveTo:lineTo}function pathVars(t,Ae,xe={}){const Ee=t.length,{start:Se=0,end:Ce=Ee-1}=xe,{start:_e,end:Ie}=Ae,Be=Math.max(Se,_e),Te=Math.min(Ce,Ie),Pe=Se<_e&&Ce<_e||Se>Ie&&Ce>Ie;return{count:Ee,start:Be,loop:Ae.loop,ilen:Te<Be&&!Pe?Ee+Te-Be:Te-Be}}function pathSegment(t,Ae,xe,Ee){const{points:Se,options:Ce}=Ae,{count:_e,start:Ie,loop:Be,ilen:Te}=pathVars(Se,xe,Ee),Pe=getLineMethod(Ce);let{move:ke=!0,reverse:$e}=Ee||{},Oe,Ue,qe;for(Oe=0;Oe<=Te;++Oe)Ue=Se[(Ie+($e?Te-Oe:Oe))%_e],!Ue.skip&&(ke?(t.moveTo(Ue.x,Ue.y),ke=!1):Pe(t,qe,Ue,$e,Ce.stepped),qe=Ue);return Be&&(Ue=Se[(Ie+($e?Te:0))%_e],Pe(t,qe,Ue,$e,Ce.stepped)),!!Be}function fastPathSegment(t,Ae,xe,Ee){const Se=Ae.points,{count:Ce,start:_e,ilen:Ie}=pathVars(Se,xe,Ee),{move:Be=!0,reverse:Te}=Ee||{};let Pe=0,ke=0,$e,Oe,Ue,qe,ze,Ve;const Ge=er=>(_e+(Te?Ie-er:er))%Ce,Xe=()=>{qe!==ze&&(t.lineTo(Pe,ze),t.lineTo(Pe,qe),t.lineTo(Pe,Ve))};for(Be&&(Oe=Se[Ge(0)],t.moveTo(Oe.x,Oe.y)),$e=0;$e<=Ie;++$e){if(Oe=Se[Ge($e)],Oe.skip)continue;const er=Oe.x,tr=Oe.y,nr=er|0;nr===Ue?(tr<qe?qe=tr:tr>ze&&(ze=tr),Pe=(ke*Pe+er)/++ke):(Xe(),t.lineTo(er,tr),Ue=nr,ke=0,qe=ze=tr),Ve=tr}Xe()}function _getSegmentMethod(t){const Ae=t.options,xe=Ae.borderDash&&Ae.borderDash.length;return!t._decimated&&!t._loop&&!Ae.tension&&Ae.cubicInterpolationMode!=="monotone"&&!Ae.stepped&&!xe?fastPathSegment:pathSegment}function _getInterpolationMethod(t){return t.stepped?_steppedInterpolation:t.tension||t.cubicInterpolationMode==="monotone"?_bezierInterpolation:_pointInLine}function strokePathWithCache(t,Ae,xe,Ee){let Se=Ae._path;Se||(Se=Ae._path=new Path2D,Ae.path(Se,xe,Ee)&&Se.closePath()),setStyle(t,Ae.options),t.stroke(Se)}function strokePathDirect(t,Ae,xe,Ee){const{segments:Se,options:Ce}=Ae,_e=_getSegmentMethod(Ae);for(const Ie of Se)setStyle(t,Ce,Ie.style),t.beginPath(),_e(t,Ae,Ie,{start:xe,end:xe+Ee-1})&&t.closePath(),t.stroke()}const usePath2D=typeof Path2D=="function";function draw(t,Ae,xe,Ee){usePath2D&&!Ae.options.segment?strokePathWithCache(t,Ae,xe,Ee):strokePathDirect(t,Ae,xe,Ee)}class LineElement extends Element$2{constructor(Ae){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,Ae&&Object.assign(this,Ae)}updateControlPoints(Ae,xe){const Ee=this.options;if((Ee.tension||Ee.cubicInterpolationMode==="monotone")&&!Ee.stepped&&!this._pointsUpdated){const Se=Ee.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,Ee,Ae,Se,xe),this._pointsUpdated=!0}}set points(Ae){this._points=Ae,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const Ae=this.segments,xe=this.points;return Ae.length&&xe[Ae[0].start]}last(){const Ae=this.segments,xe=this.points,Ee=Ae.length;return Ee&&xe[Ae[Ee-1].end]}interpolate(Ae,xe){const Ee=this.options,Se=Ae[xe],Ce=this.points,_e=_boundSegments(this,{property:xe,start:Se,end:Se});if(!_e.length)return;const Ie=[],Be=_getInterpolationMethod(Ee);let Te,Pe;for(Te=0,Pe=_e.length;Te<Pe;++Te){const{start:ke,end:$e}=_e[Te],Oe=Ce[ke],Ue=Ce[$e];if(Oe===Ue){Ie.push(Oe);continue}const qe=Math.abs((Se-Oe[xe])/(Ue[xe]-Oe[xe])),ze=Be(Oe,Ue,qe,Ee.stepped);ze[xe]=Ae[xe],Ie.push(ze)}return Ie.length===1?Ie[0]:Ie}pathSegment(Ae,xe,Ee){return _getSegmentMethod(this)(Ae,this,xe,Ee)}path(Ae,xe,Ee){const Se=this.segments,Ce=_getSegmentMethod(this);let _e=this._loop;xe=xe||0,Ee=Ee||this.points.length-xe;for(const Ie of Se)_e&=Ce(Ae,this,Ie,{start:xe,end:xe+Ee-1});return!!_e}draw(Ae,xe,Ee,Se){const Ce=this.options||{};(this.points||[]).length&&Ce.borderWidth&&(Ae.save(),draw(Ae,this,Ee,Se),Ae.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}$i(LineElement,"id","line"),$i(LineElement,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),$i(LineElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),$i(LineElement,"descriptors",{_scriptable:!0,_indexable:Ae=>Ae!=="borderDash"&&Ae!=="fill"});function inRange$1(t,Ae,xe,Ee){const Se=t.options,{[xe]:Ce}=t.getProps([xe],Ee);return Math.abs(Ae-Ce)<Se.radius+Se.hitRadius}class PointElement extends Element$2{constructor(xe){super();$i(this,"parsed");$i(this,"skip");$i(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,xe&&Object.assign(this,xe)}inRange(xe,Ee,Se){const Ce=this.options,{x:_e,y:Ie}=this.getProps(["x","y"],Se);return Math.pow(xe-_e,2)+Math.pow(Ee-Ie,2)<Math.pow(Ce.hitRadius+Ce.radius,2)}inXRange(xe,Ee){return inRange$1(this,xe,"x",Ee)}inYRange(xe,Ee){return inRange$1(this,xe,"y",Ee)}getCenterPoint(xe){const{x:Ee,y:Se}=this.getProps(["x","y"],xe);return{x:Ee,y:Se}}size(xe){xe=xe||this.options||{};let Ee=xe.radius||0;Ee=Math.max(Ee,Ee&&xe.hoverRadius||0);const Se=Ee&&xe.borderWidth||0;return(Ee+Se)*2}draw(xe,Ee){const Se=this.options;this.skip||Se.radius<.1||!_isPointInArea(this,Ee,this.size(Se)/2)||(xe.strokeStyle=Se.borderColor,xe.lineWidth=Se.borderWidth,xe.fillStyle=Se.backgroundColor,drawPoint(xe,Se,this.x,this.y))}getRange(){const xe=this.options||{};return xe.radius+xe.hitRadius}}$i(PointElement,"id","point"),$i(PointElement,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),$i(PointElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function getBarBounds(t,Ae){const{x:xe,y:Ee,base:Se,width:Ce,height:_e}=t.getProps(["x","y","base","width","height"],Ae);let Ie,Be,Te,Pe,ke;return t.horizontal?(ke=_e/2,Ie=Math.min(xe,Se),Be=Math.max(xe,Se),Te=Ee-ke,Pe=Ee+ke):(ke=Ce/2,Ie=xe-ke,Be=xe+ke,Te=Math.min(Ee,Se),Pe=Math.max(Ee,Se)),{left:Ie,top:Te,right:Be,bottom:Pe}}function skipOrLimit(t,Ae,xe,Ee){return t?0:_limitValue(Ae,xe,Ee)}function parseBorderWidth(t,Ae,xe){const Ee=t.options.borderWidth,Se=t.borderSkipped,Ce=toTRBL(Ee);return{t:skipOrLimit(Se.top,Ce.top,0,xe),r:skipOrLimit(Se.right,Ce.right,0,Ae),b:skipOrLimit(Se.bottom,Ce.bottom,0,xe),l:skipOrLimit(Se.left,Ce.left,0,Ae)}}function parseBorderRadius(t,Ae,xe){const{enableBorderRadius:Ee}=t.getProps(["enableBorderRadius"]),Se=t.options.borderRadius,Ce=toTRBLCorners(Se),_e=Math.min(Ae,xe),Ie=t.borderSkipped,Be=Ee||isObject$1(Se);return{topLeft:skipOrLimit(!Be||Ie.top||Ie.left,Ce.topLeft,0,_e),topRight:skipOrLimit(!Be||Ie.top||Ie.right,Ce.topRight,0,_e),bottomLeft:skipOrLimit(!Be||Ie.bottom||Ie.left,Ce.bottomLeft,0,_e),bottomRight:skipOrLimit(!Be||Ie.bottom||Ie.right,Ce.bottomRight,0,_e)}}function boundingRects(t){const Ae=getBarBounds(t),xe=Ae.right-Ae.left,Ee=Ae.bottom-Ae.top,Se=parseBorderWidth(t,xe/2,Ee/2),Ce=parseBorderRadius(t,xe/2,Ee/2);return{outer:{x:Ae.left,y:Ae.top,w:xe,h:Ee,radius:Ce},inner:{x:Ae.left+Se.l,y:Ae.top+Se.t,w:xe-Se.l-Se.r,h:Ee-Se.t-Se.b,radius:{topLeft:Math.max(0,Ce.topLeft-Math.max(Se.t,Se.l)),topRight:Math.max(0,Ce.topRight-Math.max(Se.t,Se.r)),bottomLeft:Math.max(0,Ce.bottomLeft-Math.max(Se.b,Se.l)),bottomRight:Math.max(0,Ce.bottomRight-Math.max(Se.b,Se.r))}}}}function inRange(t,Ae,xe,Ee){const Se=Ae===null,Ce=xe===null,Ie=t&&!(Se&&Ce)&&getBarBounds(t,Ee);return Ie&&(Se||_isBetween(Ae,Ie.left,Ie.right))&&(Ce||_isBetween(xe,Ie.top,Ie.bottom))}function hasRadius(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function addNormalRectPath(t,Ae){t.rect(Ae.x,Ae.y,Ae.w,Ae.h)}function inflateRect(t,Ae,xe={}){const Ee=t.x!==xe.x?-Ae:0,Se=t.y!==xe.y?-Ae:0,Ce=(t.x+t.w!==xe.x+xe.w?Ae:0)-Ee,_e=(t.y+t.h!==xe.y+xe.h?Ae:0)-Se;return{x:t.x+Ee,y:t.y+Se,w:t.w+Ce,h:t.h+_e,radius:t.radius}}class BarElement extends Element$2{constructor(Ae){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,Ae&&Object.assign(this,Ae)}draw(Ae){const{inflateAmount:xe,options:{borderColor:Ee,backgroundColor:Se}}=this,{inner:Ce,outer:_e}=boundingRects(this),Ie=hasRadius(_e.radius)?addRoundedRectPath:addNormalRectPath;Ae.save(),(_e.w!==Ce.w||_e.h!==Ce.h)&&(Ae.beginPath(),Ie(Ae,inflateRect(_e,xe,Ce)),Ae.clip(),Ie(Ae,inflateRect(Ce,-xe,_e)),Ae.fillStyle=Ee,Ae.fill("evenodd")),Ae.beginPath(),Ie(Ae,inflateRect(Ce,xe)),Ae.fillStyle=Se,Ae.fill(),Ae.restore()}inRange(Ae,xe,Ee){return inRange(this,Ae,xe,Ee)}inXRange(Ae,xe){return inRange(this,Ae,null,xe)}inYRange(Ae,xe){return inRange(this,null,Ae,xe)}getCenterPoint(Ae){const{x:xe,y:Ee,base:Se,horizontal:Ce}=this.getProps(["x","y","base","horizontal"],Ae);return{x:Ce?(xe+Se)/2:xe,y:Ce?Ee:(Ee+Se)/2}}getRange(Ae){return Ae==="x"?this.width/2:this.height/2}}$i(BarElement,"id","bar"),$i(BarElement,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),$i(BarElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const BORDER_COLORS=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],BACKGROUND_COLORS=BORDER_COLORS.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function getBorderColor(t){return BORDER_COLORS[t%BORDER_COLORS.length]}function getBackgroundColor(t){return BACKGROUND_COLORS[t%BACKGROUND_COLORS.length]}function colorizeDefaultDataset(t,Ae){return t.borderColor=getBorderColor(Ae),t.backgroundColor=getBackgroundColor(Ae),++Ae}function colorizeDoughnutDataset(t,Ae){return t.backgroundColor=t.data.map(()=>getBorderColor(Ae++)),Ae}function colorizePolarAreaDataset(t,Ae){return t.backgroundColor=t.data.map(()=>getBackgroundColor(Ae++)),Ae}function getColorizer(t){let Ae=0;return(xe,Ee)=>{const Se=t.getDatasetMeta(Ee).controller;Se instanceof DoughnutController?Ae=colorizeDoughnutDataset(xe,Ae):Se instanceof PolarAreaController?Ae=colorizePolarAreaDataset(xe,Ae):Se&&(Ae=colorizeDefaultDataset(xe,Ae))}}function containsColorsDefinitions(t){let Ae;for(Ae in t)if(t[Ae].borderColor||t[Ae].backgroundColor)return!0;return!1}function containsColorsDefinition(t){return t&&(t.borderColor||t.backgroundColor)}function containsDefaultColorsDefenitions(){return defaults$1.borderColor!=="rgba(0,0,0,0.1)"||defaults$1.backgroundColor!=="rgba(0,0,0,0.1)"}var plugin_colors={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,Ae,xe){if(!xe.enabled)return;const{data:{datasets:Ee},options:Se}=t.config,{elements:Ce}=Se,_e=containsColorsDefinitions(Ee)||containsColorsDefinition(Se)||Ce&&containsColorsDefinitions(Ce)||containsDefaultColorsDefenitions();if(!xe.forceOverride&&_e)return;const Ie=getColorizer(t);Ee.forEach(Ie)}};const positioners={average(t){if(!t.length)return!1;let Ae,xe,Ee=new Set,Se=0,Ce=0;for(Ae=0,xe=t.length;Ae<xe;++Ae){const Ie=t[Ae].element;if(Ie&&Ie.hasValue()){const Be=Ie.tooltipPosition();Ee.add(Be.x),Se+=Be.y,++Ce}}return Ce===0||Ee.size===0?!1:{x:[...Ee].reduce((Ie,Be)=>Ie+Be)/Ee.size,y:Se/Ce}},nearest(t,Ae){if(!t.length)return!1;let xe=Ae.x,Ee=Ae.y,Se=Number.POSITIVE_INFINITY,Ce,_e,Ie;for(Ce=0,_e=t.length;Ce<_e;++Ce){const Be=t[Ce].element;if(Be&&Be.hasValue()){const Te=Be.getCenterPoint(),Pe=distanceBetweenPoints(Ae,Te);Pe<Se&&(Se=Pe,Ie=Be)}}if(Ie){const Be=Ie.tooltipPosition();xe=Be.x,Ee=Be.y}return{x:xe,y:Ee}}};function pushOrConcat(t,Ae){return Ae&&(isArray$2(Ae)?Array.prototype.push.apply(t,Ae):t.push(Ae)),t}function splitNewlines(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
599
599
  `)>-1?t.split(`
600
600
  `):t}function createTooltipItem(t,Ae){const{element:xe,datasetIndex:Ee,index:Se}=Ae,Ce=t.getDatasetMeta(Ee).controller,{label:_e,value:Ie}=Ce.getLabelAndValue(Se);return{chart:t,label:_e,parsed:Ce.getParsed(Se),raw:t.data.datasets[Ee].data[Se],formattedValue:Ie,dataset:Ce.getDataset(),dataIndex:Se,datasetIndex:Ee,element:xe}}function getTooltipSize(t,Ae){const xe=t.chart.ctx,{body:Ee,footer:Se,title:Ce}=t,{boxWidth:_e,boxHeight:Ie}=Ae,Be=toFont(Ae.bodyFont),Te=toFont(Ae.titleFont),Pe=toFont(Ae.footerFont),ke=Ce.length,$e=Se.length,Oe=Ee.length,Ue=toPadding(Ae.padding);let qe=Ue.height,ze=0,Ve=Ee.reduce((er,tr)=>er+tr.before.length+tr.lines.length+tr.after.length,0);if(Ve+=t.beforeBody.length+t.afterBody.length,ke&&(qe+=ke*Te.lineHeight+(ke-1)*Ae.titleSpacing+Ae.titleMarginBottom),Ve){const er=Ae.displayColors?Math.max(Ie,Be.lineHeight):Be.lineHeight;qe+=Oe*er+(Ve-Oe)*Be.lineHeight+(Ve-1)*Ae.bodySpacing}$e&&(qe+=Ae.footerMarginTop+$e*Pe.lineHeight+($e-1)*Ae.footerSpacing);let Ge=0;const Xe=function(er){ze=Math.max(ze,xe.measureText(er).width+Ge)};return xe.save(),xe.font=Te.string,each(t.title,Xe),xe.font=Be.string,each(t.beforeBody.concat(t.afterBody),Xe),Ge=Ae.displayColors?_e+2+Ae.boxPadding:0,each(Ee,er=>{each(er.before,Xe),each(er.lines,Xe),each(er.after,Xe)}),Ge=0,xe.font=Pe.string,each(t.footer,Xe),xe.restore(),ze+=Ue.width,{width:ze,height:qe}}function determineYAlign(t,Ae){const{y:xe,height:Ee}=Ae;return xe<Ee/2?"top":xe>t.height-Ee/2?"bottom":"center"}function doesNotFitWithAlign(t,Ae,xe,Ee){const{x:Se,width:Ce}=Ee,_e=xe.caretSize+xe.caretPadding;if(t==="left"&&Se+Ce+_e>Ae.width||t==="right"&&Se-Ce-_e<0)return!0}function determineXAlign(t,Ae,xe,Ee){const{x:Se,width:Ce}=xe,{width:_e,chartArea:{left:Ie,right:Be}}=t;let Te="center";return Ee==="center"?Te=Se<=(Ie+Be)/2?"left":"right":Se<=Ce/2?Te="left":Se>=_e-Ce/2&&(Te="right"),doesNotFitWithAlign(Te,t,Ae,xe)&&(Te="center"),Te}function determineAlignment(t,Ae,xe){const Ee=xe.yAlign||Ae.yAlign||determineYAlign(t,xe);return{xAlign:xe.xAlign||Ae.xAlign||determineXAlign(t,Ae,xe,Ee),yAlign:Ee}}function alignX(t,Ae){let{x:xe,width:Ee}=t;return Ae==="right"?xe-=Ee:Ae==="center"&&(xe-=Ee/2),xe}function alignY(t,Ae,xe){let{y:Ee,height:Se}=t;return Ae==="top"?Ee+=xe:Ae==="bottom"?Ee-=Se+xe:Ee-=Se/2,Ee}function getBackgroundPoint(t,Ae,xe,Ee){const{caretSize:Se,caretPadding:Ce,cornerRadius:_e}=t,{xAlign:Ie,yAlign:Be}=xe,Te=Se+Ce,{topLeft:Pe,topRight:ke,bottomLeft:$e,bottomRight:Oe}=toTRBLCorners(_e);let Ue=alignX(Ae,Ie);const qe=alignY(Ae,Be,Te);return Be==="center"?Ie==="left"?Ue+=Te:Ie==="right"&&(Ue-=Te):Ie==="left"?Ue-=Math.max(Pe,$e)+Se:Ie==="right"&&(Ue+=Math.max(ke,Oe)+Se),{x:_limitValue(Ue,0,Ee.width-Ae.width),y:_limitValue(qe,0,Ee.height-Ae.height)}}function getAlignedX(t,Ae,xe){const Ee=toPadding(xe.padding);return Ae==="center"?t.x+t.width/2:Ae==="right"?t.x+t.width-Ee.right:t.x+Ee.left}function getBeforeAfterBodyLines(t){return pushOrConcat([],splitNewlines(t))}function createTooltipContext(t,Ae,xe){return createContext(t,{tooltip:Ae,tooltipItems:xe,type:"tooltip"})}function overrideCallbacks(t,Ae){const xe=Ae&&Ae.dataset&&Ae.dataset.tooltip&&Ae.dataset.tooltip.callbacks;return xe?t.override(xe):t}const defaultCallbacks={beforeTitle:noop,title(t){if(t.length>0){const Ae=t[0],xe=Ae.chart.data.labels,Ee=xe?xe.length:0;if(this&&this.options&&this.options.mode==="dataset")return Ae.dataset.label||"";if(Ae.label)return Ae.label;if(Ee>0&&Ae.dataIndex<Ee)return xe[Ae.dataIndex]}return""},afterTitle:noop,beforeBody:noop,beforeLabel:noop,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let Ae=t.dataset.label||"";Ae&&(Ae+=": ");const xe=t.formattedValue;return isNullOrUndef(xe)||(Ae+=xe),Ae},labelColor(t){const xe=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:xe.borderColor,backgroundColor:xe.backgroundColor,borderWidth:xe.borderWidth,borderDash:xe.borderDash,borderDashOffset:xe.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const xe=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:xe.pointStyle,rotation:xe.rotation}},afterLabel:noop,afterBody:noop,beforeFooter:noop,footer:noop,afterFooter:noop};function invokeCallbackWithFallback(t,Ae,xe,Ee){const Se=t[Ae].call(xe,Ee);return typeof Se>"u"?defaultCallbacks[Ae].call(xe,Ee):Se}var Nf;let Tooltip$1=(Nf=class extends Element$2{constructor(Ae){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=Ae.chart,this.options=Ae.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(Ae){this.options=Ae,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const Ae=this._cachedAnimations;if(Ae)return Ae;const xe=this.chart,Ee=this.options.setContext(this.getContext()),Se=Ee.enabled&&xe.options.animation&&Ee.animations,Ce=new Animations(this.chart,Se);return Se._cacheable&&(this._cachedAnimations=Object.freeze(Ce)),Ce}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(Ae,xe){const{callbacks:Ee}=xe,Se=invokeCallbackWithFallback(Ee,"beforeTitle",this,Ae),Ce=invokeCallbackWithFallback(Ee,"title",this,Ae),_e=invokeCallbackWithFallback(Ee,"afterTitle",this,Ae);let Ie=[];return Ie=pushOrConcat(Ie,splitNewlines(Se)),Ie=pushOrConcat(Ie,splitNewlines(Ce)),Ie=pushOrConcat(Ie,splitNewlines(_e)),Ie}getBeforeBody(Ae,xe){return getBeforeAfterBodyLines(invokeCallbackWithFallback(xe.callbacks,"beforeBody",this,Ae))}getBody(Ae,xe){const{callbacks:Ee}=xe,Se=[];return each(Ae,Ce=>{const _e={before:[],lines:[],after:[]},Ie=overrideCallbacks(Ee,Ce);pushOrConcat(_e.before,splitNewlines(invokeCallbackWithFallback(Ie,"beforeLabel",this,Ce))),pushOrConcat(_e.lines,invokeCallbackWithFallback(Ie,"label",this,Ce)),pushOrConcat(_e.after,splitNewlines(invokeCallbackWithFallback(Ie,"afterLabel",this,Ce))),Se.push(_e)}),Se}getAfterBody(Ae,xe){return getBeforeAfterBodyLines(invokeCallbackWithFallback(xe.callbacks,"afterBody",this,Ae))}getFooter(Ae,xe){const{callbacks:Ee}=xe,Se=invokeCallbackWithFallback(Ee,"beforeFooter",this,Ae),Ce=invokeCallbackWithFallback(Ee,"footer",this,Ae),_e=invokeCallbackWithFallback(Ee,"afterFooter",this,Ae);let Ie=[];return Ie=pushOrConcat(Ie,splitNewlines(Se)),Ie=pushOrConcat(Ie,splitNewlines(Ce)),Ie=pushOrConcat(Ie,splitNewlines(_e)),Ie}_createItems(Ae){const xe=this._active,Ee=this.chart.data,Se=[],Ce=[],_e=[];let Ie=[],Be,Te;for(Be=0,Te=xe.length;Be<Te;++Be)Ie.push(createTooltipItem(this.chart,xe[Be]));return Ae.filter&&(Ie=Ie.filter((Pe,ke,$e)=>Ae.filter(Pe,ke,$e,Ee))),Ae.itemSort&&(Ie=Ie.sort((Pe,ke)=>Ae.itemSort(Pe,ke,Ee))),each(Ie,Pe=>{const ke=overrideCallbacks(Ae.callbacks,Pe);Se.push(invokeCallbackWithFallback(ke,"labelColor",this,Pe)),Ce.push(invokeCallbackWithFallback(ke,"labelPointStyle",this,Pe)),_e.push(invokeCallbackWithFallback(ke,"labelTextColor",this,Pe))}),this.labelColors=Se,this.labelPointStyles=Ce,this.labelTextColors=_e,this.dataPoints=Ie,Ie}update(Ae,xe){const Ee=this.options.setContext(this.getContext()),Se=this._active;let Ce,_e=[];if(!Se.length)this.opacity!==0&&(Ce={opacity:0});else{const Ie=positioners[Ee.position].call(this,Se,this._eventPosition);_e=this._createItems(Ee),this.title=this.getTitle(_e,Ee),this.beforeBody=this.getBeforeBody(_e,Ee),this.body=this.getBody(_e,Ee),this.afterBody=this.getAfterBody(_e,Ee),this.footer=this.getFooter(_e,Ee);const Be=this._size=getTooltipSize(this,Ee),Te=Object.assign({},Ie,Be),Pe=determineAlignment(this.chart,Ee,Te),ke=getBackgroundPoint(Ee,Te,Pe,this.chart);this.xAlign=Pe.xAlign,this.yAlign=Pe.yAlign,Ce={opacity:1,x:ke.x,y:ke.y,width:Be.width,height:Be.height,caretX:Ie.x,caretY:Ie.y}}this._tooltipItems=_e,this.$context=void 0,Ce&&this._resolveAnimations().update(this,Ce),Ae&&Ee.external&&Ee.external.call(this,{chart:this.chart,tooltip:this,replay:xe})}drawCaret(Ae,xe,Ee,Se){const Ce=this.getCaretPosition(Ae,Ee,Se);xe.lineTo(Ce.x1,Ce.y1),xe.lineTo(Ce.x2,Ce.y2),xe.lineTo(Ce.x3,Ce.y3)}getCaretPosition(Ae,xe,Ee){const{xAlign:Se,yAlign:Ce}=this,{caretSize:_e,cornerRadius:Ie}=Ee,{topLeft:Be,topRight:Te,bottomLeft:Pe,bottomRight:ke}=toTRBLCorners(Ie),{x:$e,y:Oe}=Ae,{width:Ue,height:qe}=xe;let ze,Ve,Ge,Xe,er,tr;return Ce==="center"?(er=Oe+qe/2,Se==="left"?(ze=$e,Ve=ze-_e,Xe=er+_e,tr=er-_e):(ze=$e+Ue,Ve=ze+_e,Xe=er-_e,tr=er+_e),Ge=ze):(Se==="left"?Ve=$e+Math.max(Be,Pe)+_e:Se==="right"?Ve=$e+Ue-Math.max(Te,ke)-_e:Ve=this.caretX,Ce==="top"?(Xe=Oe,er=Xe-_e,ze=Ve-_e,Ge=Ve+_e):(Xe=Oe+qe,er=Xe+_e,ze=Ve+_e,Ge=Ve-_e),tr=Xe),{x1:ze,x2:Ve,x3:Ge,y1:Xe,y2:er,y3:tr}}drawTitle(Ae,xe,Ee){const Se=this.title,Ce=Se.length;let _e,Ie,Be;if(Ce){const Te=getRtlAdapter(Ee.rtl,this.x,this.width);for(Ae.x=getAlignedX(this,Ee.titleAlign,Ee),xe.textAlign=Te.textAlign(Ee.titleAlign),xe.textBaseline="middle",_e=toFont(Ee.titleFont),Ie=Ee.titleSpacing,xe.fillStyle=Ee.titleColor,xe.font=_e.string,Be=0;Be<Ce;++Be)xe.fillText(Se[Be],Te.x(Ae.x),Ae.y+_e.lineHeight/2),Ae.y+=_e.lineHeight+Ie,Be+1===Ce&&(Ae.y+=Ee.titleMarginBottom-Ie)}}_drawColorBox(Ae,xe,Ee,Se,Ce){const _e=this.labelColors[Ee],Ie=this.labelPointStyles[Ee],{boxHeight:Be,boxWidth:Te}=Ce,Pe=toFont(Ce.bodyFont),ke=getAlignedX(this,"left",Ce),$e=Se.x(ke),Oe=Be<Pe.lineHeight?(Pe.lineHeight-Be)/2:0,Ue=xe.y+Oe;if(Ce.usePointStyle){const qe={radius:Math.min(Te,Be)/2,pointStyle:Ie.pointStyle,rotation:Ie.rotation,borderWidth:1},ze=Se.leftForLtr($e,Te)+Te/2,Ve=Ue+Be/2;Ae.strokeStyle=Ce.multiKeyBackground,Ae.fillStyle=Ce.multiKeyBackground,drawPoint(Ae,qe,ze,Ve),Ae.strokeStyle=_e.borderColor,Ae.fillStyle=_e.backgroundColor,drawPoint(Ae,qe,ze,Ve)}else{Ae.lineWidth=isObject$1(_e.borderWidth)?Math.max(...Object.values(_e.borderWidth)):_e.borderWidth||1,Ae.strokeStyle=_e.borderColor,Ae.setLineDash(_e.borderDash||[]),Ae.lineDashOffset=_e.borderDashOffset||0;const qe=Se.leftForLtr($e,Te),ze=Se.leftForLtr(Se.xPlus($e,1),Te-2),Ve=toTRBLCorners(_e.borderRadius);Object.values(Ve).some(Ge=>Ge!==0)?(Ae.beginPath(),Ae.fillStyle=Ce.multiKeyBackground,addRoundedRectPath(Ae,{x:qe,y:Ue,w:Te,h:Be,radius:Ve}),Ae.fill(),Ae.stroke(),Ae.fillStyle=_e.backgroundColor,Ae.beginPath(),addRoundedRectPath(Ae,{x:ze,y:Ue+1,w:Te-2,h:Be-2,radius:Ve}),Ae.fill()):(Ae.fillStyle=Ce.multiKeyBackground,Ae.fillRect(qe,Ue,Te,Be),Ae.strokeRect(qe,Ue,Te,Be),Ae.fillStyle=_e.backgroundColor,Ae.fillRect(ze,Ue+1,Te-2,Be-2))}Ae.fillStyle=this.labelTextColors[Ee]}drawBody(Ae,xe,Ee){const{body:Se}=this,{bodySpacing:Ce,bodyAlign:_e,displayColors:Ie,boxHeight:Be,boxWidth:Te,boxPadding:Pe}=Ee,ke=toFont(Ee.bodyFont);let $e=ke.lineHeight,Oe=0;const Ue=getRtlAdapter(Ee.rtl,this.x,this.width),qe=function(dr){xe.fillText(dr,Ue.x(Ae.x+Oe),Ae.y+$e/2),Ae.y+=$e+Ce},ze=Ue.textAlign(_e);let Ve,Ge,Xe,er,tr,nr,sr;for(xe.textAlign=_e,xe.textBaseline="middle",xe.font=ke.string,Ae.x=getAlignedX(this,ze,Ee),xe.fillStyle=Ee.bodyColor,each(this.beforeBody,qe),Oe=Ie&&ze!=="right"?_e==="center"?Te/2+Pe:Te+2+Pe:0,er=0,nr=Se.length;er<nr;++er){for(Ve=Se[er],Ge=this.labelTextColors[er],xe.fillStyle=Ge,each(Ve.before,qe),Xe=Ve.lines,Ie&&Xe.length&&(this._drawColorBox(xe,Ae,er,Ue,Ee),$e=Math.max(ke.lineHeight,Be)),tr=0,sr=Xe.length;tr<sr;++tr)qe(Xe[tr]),$e=ke.lineHeight;each(Ve.after,qe)}Oe=0,$e=ke.lineHeight,each(this.afterBody,qe),Ae.y-=Ce}drawFooter(Ae,xe,Ee){const Se=this.footer,Ce=Se.length;let _e,Ie;if(Ce){const Be=getRtlAdapter(Ee.rtl,this.x,this.width);for(Ae.x=getAlignedX(this,Ee.footerAlign,Ee),Ae.y+=Ee.footerMarginTop,xe.textAlign=Be.textAlign(Ee.footerAlign),xe.textBaseline="middle",_e=toFont(Ee.footerFont),xe.fillStyle=Ee.footerColor,xe.font=_e.string,Ie=0;Ie<Ce;++Ie)xe.fillText(Se[Ie],Be.x(Ae.x),Ae.y+_e.lineHeight/2),Ae.y+=_e.lineHeight+Ee.footerSpacing}}drawBackground(Ae,xe,Ee,Se){const{xAlign:Ce,yAlign:_e}=this,{x:Ie,y:Be}=Ae,{width:Te,height:Pe}=Ee,{topLeft:ke,topRight:$e,bottomLeft:Oe,bottomRight:Ue}=toTRBLCorners(Se.cornerRadius);xe.fillStyle=Se.backgroundColor,xe.strokeStyle=Se.borderColor,xe.lineWidth=Se.borderWidth,xe.beginPath(),xe.moveTo(Ie+ke,Be),_e==="top"&&this.drawCaret(Ae,xe,Ee,Se),xe.lineTo(Ie+Te-$e,Be),xe.quadraticCurveTo(Ie+Te,Be,Ie+Te,Be+$e),_e==="center"&&Ce==="right"&&this.drawCaret(Ae,xe,Ee,Se),xe.lineTo(Ie+Te,Be+Pe-Ue),xe.quadraticCurveTo(Ie+Te,Be+Pe,Ie+Te-Ue,Be+Pe),_e==="bottom"&&this.drawCaret(Ae,xe,Ee,Se),xe.lineTo(Ie+Oe,Be+Pe),xe.quadraticCurveTo(Ie,Be+Pe,Ie,Be+Pe-Oe),_e==="center"&&Ce==="left"&&this.drawCaret(Ae,xe,Ee,Se),xe.lineTo(Ie,Be+ke),xe.quadraticCurveTo(Ie,Be,Ie+ke,Be),xe.closePath(),xe.fill(),Se.borderWidth>0&&xe.stroke()}_updateAnimationTarget(Ae){const xe=this.chart,Ee=this.$animations,Se=Ee&&Ee.x,Ce=Ee&&Ee.y;if(Se||Ce){const _e=positioners[Ae.position].call(this,this._active,this._eventPosition);if(!_e)return;const Ie=this._size=getTooltipSize(this,Ae),Be=Object.assign({},_e,this._size),Te=determineAlignment(xe,Ae,Be),Pe=getBackgroundPoint(Ae,Be,Te,xe);(Se._to!==Pe.x||Ce._to!==Pe.y)&&(this.xAlign=Te.xAlign,this.yAlign=Te.yAlign,this.width=Ie.width,this.height=Ie.height,this.caretX=_e.x,this.caretY=_e.y,this._resolveAnimations().update(this,Pe))}}_willRender(){return!!this.opacity}draw(Ae){const xe=this.options.setContext(this.getContext());let Ee=this.opacity;if(!Ee)return;this._updateAnimationTarget(xe);const Se={width:this.width,height:this.height},Ce={x:this.x,y:this.y};Ee=Math.abs(Ee)<.001?0:Ee;const _e=toPadding(xe.padding),Ie=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;xe.enabled&&Ie&&(Ae.save(),Ae.globalAlpha=Ee,this.drawBackground(Ce,Ae,Se,xe),overrideTextDirection(Ae,xe.textDirection),Ce.y+=_e.top,this.drawTitle(Ce,Ae,xe),this.drawBody(Ce,Ae,xe),this.drawFooter(Ce,Ae,xe),restoreTextDirection(Ae,xe.textDirection),Ae.restore())}getActiveElements(){return this._active||[]}setActiveElements(Ae,xe){const Ee=this._active,Se=Ae.map(({datasetIndex:Ie,index:Be})=>{const Te=this.chart.getDatasetMeta(Ie);if(!Te)throw new Error("Cannot find a dataset at index "+Ie);return{datasetIndex:Ie,element:Te.data[Be],index:Be}}),Ce=!_elementsEqual(Ee,Se),_e=this._positionChanged(Se,xe);(Ce||_e)&&(this._active=Se,this._eventPosition=xe,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(Ae,xe,Ee=!0){if(xe&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const Se=this.options,Ce=this._active||[],_e=this._getActiveElements(Ae,Ce,xe,Ee),Ie=this._positionChanged(_e,Ae),Be=xe||!_elementsEqual(_e,Ce)||Ie;return Be&&(this._active=_e,(Se.enabled||Se.external)&&(this._eventPosition={x:Ae.x,y:Ae.y},this.update(!0,xe))),Be}_getActiveElements(Ae,xe,Ee,Se){const Ce=this.options;if(Ae.type==="mouseout")return[];if(!Se)return xe.filter(Ie=>this.chart.data.datasets[Ie.datasetIndex]&&this.chart.getDatasetMeta(Ie.datasetIndex).controller.getParsed(Ie.index)!==void 0);const _e=this.chart.getElementsAtEventForMode(Ae,Ce.mode,Ce,Ee);return Ce.reverse&&_e.reverse(),_e}_positionChanged(Ae,xe){const{caretX:Ee,caretY:Se,options:Ce}=this,_e=positioners[Ce.position].call(this,Ae,xe);return _e!==!1&&(Ee!==_e.x||Se!==_e.y)}},$i(Nf,"positioners",positioners),Nf);var plugin_tooltip={id:"tooltip",_element:Tooltip$1,positioners,afterInit(t,Ae,xe){xe&&(t.tooltip=new Tooltip$1({chart:t,options:xe}))},beforeUpdate(t,Ae,xe){t.tooltip&&t.tooltip.initialize(xe)},reset(t,Ae,xe){t.tooltip&&t.tooltip.initialize(xe)},afterDraw(t){const Ae=t.tooltip;if(Ae&&Ae._willRender()){const xe={tooltip:Ae};if(t.notifyPlugins("beforeTooltipDraw",{...xe,cancelable:!0})===!1)return;Ae.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",xe)}},afterEvent(t,Ae){if(t.tooltip){const xe=Ae.replay;t.tooltip.handleEvent(Ae.event,xe,Ae.inChartArea)&&(Ae.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,Ae)=>Ae.bodyFont.size,boxWidth:(t,Ae)=>Ae.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=(t,Ae,xe,Ee)=>(typeof Ae=="string"?(xe=t.push(Ae)-1,Ee.unshift({index:xe,label:Ae})):isNaN(Ae)&&(xe=null),xe);function findOrAddLabel(t,Ae,xe,Ee){const Se=t.indexOf(Ae);if(Se===-1)return addIfString(t,Ae,xe,Ee);const Ce=t.lastIndexOf(Ae);return Se!==Ce?xe:Se}const validIndex=(t,Ae)=>t===null?null:_limitValue(Math.round(t),0,Ae);function _getLabelForValue(t){const Ae=this.getLabels();return t>=0&&t<Ae.length?Ae[t]:t}class CategoryScale extends Scale{constructor(Ae){super(Ae),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(Ae){const xe=this._addedLabels;if(xe.length){const Ee=this.getLabels();for(const{index:Se,label:Ce}of xe)Ee[Se]===Ce&&Ee.splice(Se,1);this._addedLabels=[]}super.init(Ae)}parse(Ae,xe){if(isNullOrUndef(Ae))return null;const Ee=this.getLabels();return xe=isFinite(xe)&&Ee[xe]===Ae?xe:findOrAddLabel(Ee,Ae,valueOrDefault(xe,Ae),this._addedLabels),validIndex(xe,Ee.length-1)}determineDataLimits(){const{minDefined:Ae,maxDefined:xe}=this.getUserBounds();let{min:Ee,max:Se}=this.getMinMax(!0);this.options.bounds==="ticks"&&(Ae||(Ee=0),xe||(Se=this.getLabels().length-1)),this.min=Ee,this.max=Se}buildTicks(){const Ae=this.min,xe=this.max,Ee=this.options.offset,Se=[];let Ce=this.getLabels();Ce=Ae===0&&xe===Ce.length-1?Ce:Ce.slice(Ae,xe+1),this._valueRange=Math.max(Ce.length-(Ee?0:1),1),this._startValue=this.min-(Ee?.5:0);for(let _e=Ae;_e<=xe;_e++)Se.push({value:_e});return Se}getLabelForValue(Ae){return _getLabelForValue.call(this,Ae)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(Ae){return typeof Ae!="number"&&(Ae=this.parse(Ae)),Ae===null?NaN:this.getPixelForDecimal((Ae-this._startValue)/this._valueRange)}getPixelForTick(Ae){const xe=this.ticks;return Ae<0||Ae>xe.length-1?null:this.getPixelForValue(xe[Ae].value)}getValueForPixel(Ae){return Math.round(this._startValue+this.getDecimalForPixel(Ae)*this._valueRange)}getBasePixel(){return this.bottom}}$i(CategoryScale,"id","category"),$i(CategoryScale,"defaults",{ticks:{callback:_getLabelForValue}});function generateTicks$1(t,Ae){const xe=[],{bounds:Se,step:Ce,min:_e,max:Ie,precision:Be,count:Te,maxTicks:Pe,maxDigits:ke,includeBounds:$e}=t,Oe=Ce||1,Ue=Pe-1,{min:qe,max:ze}=Ae,Ve=!isNullOrUndef(_e),Ge=!isNullOrUndef(Ie),Xe=!isNullOrUndef(Te),er=(ze-qe)/(ke+1);let tr=niceNum((ze-qe)/Ue/Oe)*Oe,nr,sr,dr,ar;if(tr<1e-14&&!Ve&&!Ge)return[{value:qe},{value:ze}];ar=Math.ceil(ze/tr)-Math.floor(qe/tr),ar>Ue&&(tr=niceNum(ar*tr/Ue/Oe)*Oe),isNullOrUndef(Be)||(nr=Math.pow(10,Be),tr=Math.ceil(tr*nr)/nr),Se==="ticks"?(sr=Math.floor(qe/tr)*tr,dr=Math.ceil(ze/tr)*tr):(sr=qe,dr=ze),Ve&&Ge&&Ce&&almostWhole((Ie-_e)/Ce,tr/1e3)?(ar=Math.round(Math.min((Ie-_e)/tr,Pe)),tr=(Ie-_e)/ar,sr=_e,dr=Ie):Xe?(sr=Ve?_e:sr,dr=Ge?Ie:dr,ar=Te-1,tr=(dr-sr)/ar):(ar=(dr-sr)/tr,almostEquals(ar,Math.round(ar),tr/1e3)?ar=Math.round(ar):ar=Math.ceil(ar));const lr=Math.max(_decimalPlaces(tr),_decimalPlaces(sr));nr=Math.pow(10,isNullOrUndef(Be)?lr:Be),sr=Math.round(sr*nr)/nr,dr=Math.round(dr*nr)/nr;let Ke=0;for(Ve&&($e&&sr!==_e?(xe.push({value:_e}),sr<_e&&Ke++,almostEquals(Math.round((sr+Ke*tr)*nr)/nr,_e,relativeLabelSize(_e,er,t))&&Ke++):sr<_e&&Ke++);Ke<ar;++Ke){const Me=Math.round((sr+Ke*tr)*nr)/nr;if(Ge&&Me>Ie)break;xe.push({value:Me})}return Ge&&$e&&dr!==Ie?xe.length&&almostEquals(xe[xe.length-1].value,Ie,relativeLabelSize(Ie,er,t))?xe[xe.length-1].value=Ie:xe.push({value:Ie}):(!Ge||dr===Ie)&&xe.push({value:dr}),xe}function relativeLabelSize(t,Ae,{horizontal:xe,minRotation:Ee}){const Se=toRadians(Ee),Ce=(xe?Math.sin(Se):Math.cos(Se))||.001,_e=.75*Ae*(""+t).length;return Math.min(Ae/Ce,_e)}class LinearScaleBase extends Scale{constructor(Ae){super(Ae),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(Ae,xe){return isNullOrUndef(Ae)||(typeof Ae=="number"||Ae instanceof Number)&&!isFinite(+Ae)?null:+Ae}handleTickRangeOptions(){const{beginAtZero:Ae}=this.options,{minDefined:xe,maxDefined:Ee}=this.getUserBounds();let{min:Se,max:Ce}=this;const _e=Be=>Se=xe?Se:Be,Ie=Be=>Ce=Ee?Ce:Be;if(Ae){const Be=sign(Se),Te=sign(Ce);Be<0&&Te<0?Ie(0):Be>0&&Te>0&&_e(0)}if(Se===Ce){let Be=Ce===0?1:Math.abs(Ce*.05);Ie(Ce+Be),Ae||_e(Se-Be)}this.min=Se,this.max=Ce}getTickLimit(){const Ae=this.options.ticks;let{maxTicksLimit:xe,stepSize:Ee}=Ae,Se;return Ee?(Se=Math.ceil(this.max/Ee)-Math.floor(this.min/Ee)+1,Se>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${Ee} would result generating up to ${Se} ticks. Limiting to 1000.`),Se=1e3)):(Se=this.computeTickLimit(),xe=xe||11),xe&&(Se=Math.min(xe,Se)),Se}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const Ae=this.options,xe=Ae.ticks;let Ee=this.getTickLimit();Ee=Math.max(2,Ee);const Se={maxTicks:Ee,bounds:Ae.bounds,min:Ae.min,max:Ae.max,precision:xe.precision,step:xe.stepSize,count:xe.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:xe.minRotation||0,includeBounds:xe.includeBounds!==!1},Ce=this._range||this,_e=generateTicks$1(Se,Ce);return Ae.bounds==="ticks"&&_setMinAndMaxByKey(_e,this,"value"),Ae.reverse?(_e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),_e}configure(){const Ae=this.ticks;let xe=this.min,Ee=this.max;if(super.configure(),this.options.offset&&Ae.length){const Se=(Ee-xe)/Math.max(Ae.length-1,1)/2;xe-=Se,Ee+=Se}this._startValue=xe,this._endValue=Ee,this._valueRange=Ee-xe}getLabelForValue(Ae){return formatNumber(Ae,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const{min:Ae,max:xe}=this.getMinMax(!0);this.min=isNumberFinite(Ae)?Ae:0,this.max=isNumberFinite(xe)?xe:1,this.handleTickRangeOptions()}computeTickLimit(){const Ae=this.isHorizontal(),xe=Ae?this.width:this.height,Ee=toRadians(this.options.ticks.minRotation),Se=(Ae?Math.sin(Ee):Math.cos(Ee))||.001,Ce=this._resolveTickFontOptions(0);return Math.ceil(xe/Math.min(40,Ce.lineHeight/Se))}getPixelForValue(Ae){return Ae===null?NaN:this.getPixelForDecimal((Ae-this._startValue)/this._valueRange)}getValueForPixel(Ae){return this._startValue+this.getDecimalForPixel(Ae)*this._valueRange}}$i(LinearScale,"id","linear"),$i(LinearScale,"defaults",{ticks:{callback:Ticks.formatters.numeric}});const INTERVALS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},UNITS=Object.keys(INTERVALS);function sorter(t,Ae){return t-Ae}function parse$3(t,Ae){if(isNullOrUndef(Ae))return null;const xe=t._adapter,{parser:Ee,round:Se,isoWeekday:Ce}=t._parseOpts;let _e=Ae;return typeof Ee=="function"&&(_e=Ee(_e)),isNumberFinite(_e)||(_e=typeof Ee=="string"?xe.parse(_e,Ee):xe.parse(_e)),_e===null?null:(Se&&(_e=Se==="week"&&(isNumber$2(Ce)||Ce===!0)?xe.startOf(_e,"isoWeek",Ce):xe.startOf(_e,Se)),+_e)}function determineUnitForAutoTicks(t,Ae,xe,Ee){const Se=UNITS.length;for(let Ce=UNITS.indexOf(t);Ce<Se-1;++Ce){const _e=INTERVALS[UNITS[Ce]],Ie=_e.steps?_e.steps:Number.MAX_SAFE_INTEGER;if(_e.common&&Math.ceil((xe-Ae)/(Ie*_e.size))<=Ee)return UNITS[Ce]}return UNITS[Se-1]}function determineUnitForFormatting(t,Ae,xe,Ee,Se){for(let Ce=UNITS.length-1;Ce>=UNITS.indexOf(xe);Ce--){const _e=UNITS[Ce];if(INTERVALS[_e].common&&t._adapter.diff(Se,Ee,_e)>=Ae-1)return _e}return UNITS[xe?UNITS.indexOf(xe):0]}function determineMajorUnit(t){for(let Ae=UNITS.indexOf(t)+1,xe=UNITS.length;Ae<xe;++Ae)if(INTERVALS[UNITS[Ae]].common)return UNITS[Ae]}function addTick(t,Ae,xe){if(!xe)t[Ae]=!0;else if(xe.length){const{lo:Ee,hi:Se}=_lookup(xe,Ae),Ce=xe[Ee]>=Ae?xe[Ee]:xe[Se];t[Ce]=!0}}function setMajorTicks(t,Ae,xe,Ee){const Se=t._adapter,Ce=+Se.startOf(Ae[0].value,Ee),_e=Ae[Ae.length-1].value;let Ie,Be;for(Ie=Ce;Ie<=_e;Ie=+Se.add(Ie,1,Ee))Be=xe[Ie],Be>=0&&(Ae[Be].major=!0);return Ae}function ticksFromTimestamps(t,Ae,xe){const Ee=[],Se={},Ce=Ae.length;let _e,Ie;for(_e=0;_e<Ce;++_e)Ie=Ae[_e],Se[Ie]=_e,Ee.push({value:Ie,major:!1});return Ce===0||!xe?Ee:setMajorTicks(t,Ee,Se,xe)}class TimeScale extends Scale{constructor(Ae){super(Ae),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(Ae,xe={}){const Ee=Ae.time||(Ae.time={}),Se=this._adapter=new adapters._date(Ae.adapters.date);Se.init(xe),mergeIf(Ee.displayFormats,Se.formats()),this._parseOpts={parser:Ee.parser,round:Ee.round,isoWeekday:Ee.isoWeekday},super.init(Ae),this._normalized=xe.normalized}parse(Ae,xe){return Ae===void 0?null:parse$3(this,Ae)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const Ae=this.options,xe=this._adapter,Ee=Ae.time.unit||"day";let{min:Se,max:Ce,minDefined:_e,maxDefined:Ie}=this.getUserBounds();function Be(Te){!_e&&!isNaN(Te.min)&&(Se=Math.min(Se,Te.min)),!Ie&&!isNaN(Te.max)&&(Ce=Math.max(Ce,Te.max))}(!_e||!Ie)&&(Be(this._getLabelBounds()),(Ae.bounds!=="ticks"||Ae.ticks.source!=="labels")&&Be(this.getMinMax(!1))),Se=isNumberFinite(Se)&&!isNaN(Se)?Se:+xe.startOf(Date.now(),Ee),Ce=isNumberFinite(Ce)&&!isNaN(Ce)?Ce:+xe.endOf(Date.now(),Ee)+1,this.min=Math.min(Se,Ce-1),this.max=Math.max(Se+1,Ce)}_getLabelBounds(){const Ae=this.getLabelTimestamps();let xe=Number.POSITIVE_INFINITY,Ee=Number.NEGATIVE_INFINITY;return Ae.length&&(xe=Ae[0],Ee=Ae[Ae.length-1]),{min:xe,max:Ee}}buildTicks(){const Ae=this.options,xe=Ae.time,Ee=Ae.ticks,Se=Ee.source==="labels"?this.getLabelTimestamps():this._generate();Ae.bounds==="ticks"&&Se.length&&(this.min=this._userMin||Se[0],this.max=this._userMax||Se[Se.length-1]);const Ce=this.min,_e=this.max,Ie=_filterBetween(Se,Ce,_e);return this._unit=xe.unit||(Ee.autoSkip?determineUnitForAutoTicks(xe.minUnit,this.min,this.max,this._getLabelCapacity(Ce)):determineUnitForFormatting(this,Ie.length,xe.minUnit,this.min,this.max)),this._majorUnit=!Ee.major.enabled||this._unit==="year"?void 0:determineMajorUnit(this._unit),this.initOffsets(Se),Ae.reverse&&Ie.reverse(),ticksFromTimestamps(this,Ie,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(Ae=>+Ae.value))}initOffsets(Ae=[]){let xe=0,Ee=0,Se,Ce;this.options.offset&&Ae.length&&(Se=this.getDecimalForValue(Ae[0]),Ae.length===1?xe=1-Se:xe=(this.getDecimalForValue(Ae[1])-Se)/2,Ce=this.getDecimalForValue(Ae[Ae.length-1]),Ae.length===1?Ee=Ce:Ee=(Ce-this.getDecimalForValue(Ae[Ae.length-2]))/2);const _e=Ae.length<3?.5:.25;xe=_limitValue(xe,0,_e),Ee=_limitValue(Ee,0,_e),this._offsets={start:xe,end:Ee,factor:1/(xe+1+Ee)}}_generate(){const Ae=this._adapter,xe=this.min,Ee=this.max,Se=this.options,Ce=Se.time,_e=Ce.unit||determineUnitForAutoTicks(Ce.minUnit,xe,Ee,this._getLabelCapacity(xe)),Ie=valueOrDefault(Se.ticks.stepSize,1),Be=_e==="week"?Ce.isoWeekday:!1,Te=isNumber$2(Be)||Be===!0,Pe={};let ke=xe,$e,Oe;if(Te&&(ke=+Ae.startOf(ke,"isoWeek",Be)),ke=+Ae.startOf(ke,Te?"day":_e),Ae.diff(Ee,xe,_e)>1e5*Ie)throw new Error(xe+" and "+Ee+" are too far apart with stepSize of "+Ie+" "+_e);const Ue=Se.ticks.source==="data"&&this.getDataTimestamps();for($e=ke,Oe=0;$e<Ee;$e=+Ae.add($e,Ie,_e),Oe++)addTick(Pe,$e,Ue);return($e===Ee||Se.bounds==="ticks"||Oe===1)&&addTick(Pe,$e,Ue),Object.keys(Pe).sort(sorter).map(qe=>+qe)}getLabelForValue(Ae){const xe=this._adapter,Ee=this.options.time;return Ee.tooltipFormat?xe.format(Ae,Ee.tooltipFormat):xe.format(Ae,Ee.displayFormats.datetime)}format(Ae,xe){const Se=this.options.time.displayFormats,Ce=this._unit,_e=xe||Se[Ce];return this._adapter.format(Ae,_e)}_tickFormatFunction(Ae,xe,Ee,Se){const Ce=this.options,_e=Ce.ticks.callback;if(_e)return callback(_e,[Ae,xe,Ee],this);const Ie=Ce.time.displayFormats,Be=this._unit,Te=this._majorUnit,Pe=Be&&Ie[Be],ke=Te&&Ie[Te],$e=Ee[xe],Oe=Te&&ke&&$e&&$e.major;return this._adapter.format(Ae,Se||(Oe?ke:Pe))}generateTickLabels(Ae){let xe,Ee,Se;for(xe=0,Ee=Ae.length;xe<Ee;++xe)Se=Ae[xe],Se.label=this._tickFormatFunction(Se.value,xe,Ae)}getDecimalForValue(Ae){return Ae===null?NaN:(Ae-this.min)/(this.max-this.min)}getPixelForValue(Ae){const xe=this._offsets,Ee=this.getDecimalForValue(Ae);return this.getPixelForDecimal((xe.start+Ee)*xe.factor)}getValueForPixel(Ae){const xe=this._offsets,Ee=this.getDecimalForPixel(Ae)/xe.factor-xe.end;return this.min+Ee*(this.max-this.min)}_getLabelSize(Ae){const xe=this.options.ticks,Ee=this.ctx.measureText(Ae).width,Se=toRadians(this.isHorizontal()?xe.maxRotation:xe.minRotation),Ce=Math.cos(Se),_e=Math.sin(Se),Ie=this._resolveTickFontOptions(0).size;return{w:Ee*Ce+Ie*_e,h:Ee*_e+Ie*Ce}}_getLabelCapacity(Ae){const xe=this.options.time,Ee=xe.displayFormats,Se=Ee[xe.unit]||Ee.millisecond,Ce=this._tickFormatFunction(Ae,0,ticksFromTimestamps(this,[Ae],this._majorUnit),Se),_e=this._getLabelSize(Ce),Ie=Math.floor(this.isHorizontal()?this.width/_e.w:this.height/_e.h)-1;return Ie>0?Ie:1}getDataTimestamps(){let Ae=this._cache.data||[],xe,Ee;if(Ae.length)return Ae;const Se=this.getMatchingVisibleMetas();if(this._normalized&&Se.length)return this._cache.data=Se[0].controller.getAllParsedValues(this);for(xe=0,Ee=Se.length;xe<Ee;++xe)Ae=Ae.concat(Se[xe].controller.getAllParsedValues(this));return this._cache.data=this.normalize(Ae)}getLabelTimestamps(){const Ae=this._cache.labels||[];let xe,Ee;if(Ae.length)return Ae;const Se=this.getLabels();for(xe=0,Ee=Se.length;xe<Ee;++xe)Ae.push(parse$3(this,Se[xe]));return this._cache.labels=this._normalized?Ae:this.normalize(Ae)}normalize(Ae){return _arrayUnique(Ae.sort(sorter))}}$i(TimeScale,"id","time"),$i(TimeScale,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function interpolate(t,Ae,xe){let Ee=0,Se=t.length-1,Ce,_e,Ie,Be;xe?(Ae>=t[Ee].pos&&Ae<=t[Se].pos&&({lo:Ee,hi:Se}=_lookupByKey(t,"pos",Ae)),{pos:Ce,time:Ie}=t[Ee],{pos:_e,time:Be}=t[Se]):(Ae>=t[Ee].time&&Ae<=t[Se].time&&({lo:Ee,hi:Se}=_lookupByKey(t,"time",Ae)),{time:Ce,pos:Ie}=t[Ee],{time:_e,pos:Be}=t[Se]);const Te=_e-Ce;return Te?Ie+(Be-Ie)*(Ae-Ce)/Te:Ie}class TimeSeriesScale extends TimeScale{constructor(Ae){super(Ae),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const Ae=this._getTimestampsForTable(),xe=this._table=this.buildLookupTable(Ae);this._minPos=interpolate(xe,this.min),this._tableRange=interpolate(xe,this.max)-this._minPos,super.initOffsets(Ae)}buildLookupTable(Ae){const{min:xe,max:Ee}=this,Se=[],Ce=[];let _e,Ie,Be,Te,Pe;for(_e=0,Ie=Ae.length;_e<Ie;++_e)Te=Ae[_e],Te>=xe&&Te<=Ee&&Se.push(Te);if(Se.length<2)return[{time:xe,pos:0},{time:Ee,pos:1}];for(_e=0,Ie=Se.length;_e<Ie;++_e)Pe=Se[_e+1],Be=Se[_e-1],Te=Se[_e],Math.round((Pe+Be)/2)!==Te&&Ce.push({time:Te,pos:_e/(Ie-1)});return Ce}_generate(){const Ae=this.min,xe=this.max;let Ee=super.getDataTimestamps();return(!Ee.includes(Ae)||!Ee.length)&&Ee.splice(0,0,Ae),(!Ee.includes(xe)||Ee.length===1)&&Ee.push(xe),Ee.sort((Se,Ce)=>Se-Ce)}_getTimestampsForTable(){let Ae=this._cache.all||[];if(Ae.length)return Ae;const xe=this.getDataTimestamps(),Ee=this.getLabelTimestamps();return xe.length&&Ee.length?Ae=this.normalize(xe.concat(Ee)):Ae=xe.length?xe:Ee,Ae=this._cache.all=Ae,Ae}getDecimalForValue(Ae){return(interpolate(this._table,Ae)-this._minPos)/this._tableRange}getValueForPixel(Ae){const xe=this._offsets,Ee=this.getDecimalForPixel(Ae)/xe.factor-xe.end;return interpolate(this._table,Ee*this._tableRange+this._minPos,!0)}}$i(TimeSeriesScale,"id","timeseries"),$i(TimeSeriesScale,"defaults",TimeScale.defaults);const COLOR_PALETTE=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];Chart.register(BarController,LineController,ScatterController,CategoryScale,LinearScale,BarElement,LineElement,PointElement,plugin_tooltip,plugin_colors);function HistogramChart({table:t}){const Ae=reactExports.useRef(null),xe=reactExports.useRef(null);return reactExports.useEffect(()=>{if(!Ae.current)return;xe.current&&xe.current.destroy();const Ee=t.body.flatMap(Pe=>Pe.outputs.map(ke=>ke.score)),Se=Math.max(...Ee),Ce=Math.min(...Ee),Ie=(Math.ceil(Se)-Math.floor(Ce))/10,Be=Array.from({length:11},(Pe,ke)=>Number.parseFloat((Math.floor(Ce)+ke*Ie).toFixed(2))),Te=t.head.prompts.map((Pe,ke)=>{const $e=t.body.flatMap(Ue=>Ue.outputs[ke].score),Oe=Be.map(Ue=>$e.filter(qe=>qe>=Ue&&qe<Ue+Ie).length);return{label:`Column ${ke+1}`,data:Oe,backgroundColor:COLOR_PALETTE[ke%COLOR_PALETTE.length]}});xe.current=new Chart(Ae.current,{type:"bar",data:{labels:Be,datasets:Te},options:{animation:!1,plugins:{title:{display:!0,text:"Score Distribution"},legend:{display:!1},tooltip:{callbacks:{title(Pe){return`Column ${Pe[0].datasetIndex+1}`},label(Pe){const ke=Pe.dataIndex,$e=Be[ke],Oe=Be[ke+1];return Oe?`${$e} <= score < ${Oe}`:`${$e} <= score`}}}}}})},[t]),jsxRuntimeExports.jsx("canvas",{ref:Ae,style:{maxHeight:"300px"}})}function PassRateChart({table:t}){const Ae=reactExports.useRef(null),xe=reactExports.useRef(null);return reactExports.useEffect(()=>{if(!Ae.current)return;xe.current&&xe.current.destroy();const Ee=t.head.prompts.map((Se,Ce)=>{const _e=t.body.flatMap(Te=>Te.outputs[Ce]),Be=_e.filter(Te=>Te.pass).length/_e.length*100;return{label:`Column ${Ce+1}`,data:[Be],backgroundColor:COLOR_PALETTE[Ce%COLOR_PALETTE.length]}});xe.current=new Chart(Ae.current,{type:"bar",data:{labels:["Pass Rate (%)"],datasets:Ee},options:{animation:!1,plugins:{title:{display:!0,text:"Pass rate"},legend:{display:!0}}}})},[t]),jsxRuntimeExports.jsx("canvas",{ref:Ae,style:{maxHeight:"300px"}})}function ScatterChart({table:t}){const Ae=reactExports.useRef(null),xe=reactExports.useRef(null),[Ee,Se]=reactExports.useState(0),[Ce,_e]=reactExports.useState(1),[Ie,Be]=reactExports.useState(!1);return reactExports.useEffect(()=>{if(!Ae.current)return;xe.current&&xe.current.destroy();const Te=t.body.flatMap(Oe=>Oe.outputs.map(Ue=>Ue.score)),Pe=Math.min(...Te),ke=Math.max(...Te),$e=t.body.map(Oe=>{const Ue=Oe.outputs[Ee].score,qe=Oe.outputs[Ce].score;let ze;return qe>Ue?ze="green":qe<Ue?ze="red":ze="gray",{x:Ue,y:qe,backgroundColor:ze}});xe.current=new Chart(Ae.current,{type:"scatter",data:{datasets:[{data:$e,backgroundColor:$e.map(Oe=>Oe.backgroundColor)},{type:"line",data:[{x:Pe,y:Pe},{x:ke,y:ke}],borderColor:"gray",borderWidth:1,borderDash:[5,5],pointRadius:0}]},options:{animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label(Oe){const Ue=t.body[Oe.dataIndex];let qe=Ue.outputs[0].text,ze=Ue.outputs[1].text;return qe.length>30&&(qe=qe.substring(0,30)+"..."),ze.length>30&&(ze=ze.substring(0,30)+"..."),`Output 1: ${qe}
601
601
  Output 2: ${ze}`}}}},scales:{x:{title:{display:!0,text:`Prompt ${Ee+1} Score`},ticks:{callback(Oe,Ue,qe){let ze=String(Math.round(Number(Oe)*100));return Ue===qe.length-1&&(ze+="%"),ze}}},y:{title:{display:!0,text:`Prompt ${Ce+1} Score`},ticks:{callback(Oe,Ue,qe){let ze=String(Math.round(Number(Oe)*100));return Ue===qe.length-1&&(ze+="%"),ze}}}}}})},[t,Ee,Ce]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Dialog,{open:Ie,onClose:()=>Be(!1),children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Compare prompt outputs"}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(FormControl,{sx:{m:1,minWidth:120},children:jsxRuntimeExports.jsx(Select,{value:Ee,onChange:Te=>Se(Number(Te.target.value)),children:t.head.prompts.map((Te,Pe)=>jsxRuntimeExports.jsxs(MenuItem,{value:Pe,children:["Prompt ",Pe+1]},Pe))})}),jsxRuntimeExports.jsx(FormControl,{sx:{m:1,minWidth:120},children:jsxRuntimeExports.jsx(Select,{value:Ce,onChange:Te=>_e(Number(Te.target.value)),children:t.head.prompts.map((Te,Pe)=>jsxRuntimeExports.jsxs(MenuItem,{value:Pe,children:["Prompt ",Pe+1]},Pe))})})]})]}),jsxRuntimeExports.jsx("canvas",{ref:Ae,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>Be(!0)})]})}function MetricChart({table:t}){const Ae=reactExports.useRef(null),xe=reactExports.useRef(null);return reactExports.useEffect(()=>{var Ie;if(!Ae.current)return;xe.current&&xe.current.destroy();const Ee=Object.keys(((Ie=t.head.prompts[0].metrics)==null?void 0:Ie.namedScores)||{}),Se=Ee,Ce=t.head.prompts.map((Be,Te)=>{const Pe=Ee.map(ke=>{var Ue;const $e=((Ue=Be.metrics)==null?void 0:Ue.namedScores[ke])||0,Oe=Math.max(...t.head.prompts.map(qe=>{var ze;return((ze=qe.metrics)==null?void 0:ze.namedScores[ke])||0}));return $e/Oe});return{label:`${t.head.prompts[Te].provider}`,data:Pe,backgroundColor:COLOR_PALETTE[Te%COLOR_PALETTE.length]}}),_e={type:"bar",data:{labels:Se,datasets:Ce},options:{scales:{x:{grid:{display:!1}},y:{ticks:{callback(Be,Te,Pe){let ke=String(Math.round(Number(Be)*100));return Te===Pe.length-1&&(ke+="%"),ke}}}},plugins:{tooltip:{callbacks:{title(Be){return Be[0].dataset.label},label(Be){const Te=Be.parsed.y;return`${Se[Be.dataIndex]}: ${(Te*100).toFixed(2)}% pass rate`}}}}}};xe.current=new Chart(Ae.current,_e)},[t]),jsxRuntimeExports.jsx("canvas",{ref:Ae,style:{maxHeight:"300px"}})}function PerformanceOverTimeChart({evalId:t}){const{config:Ae}=useStore(),xe=reactExports.useRef(null),Ee=reactExports.useRef(null),[Se,Ce]=reactExports.useState([]);return reactExports.useEffect(()=>{(async()=>{if(Ae!=null&&Ae.description)try{const Be=await(await callApi(`/history?description=${encodeURIComponent(Ae.description)}`)).json();Ce(Be.data)}catch(Ie){console.error("Error fetching progress data:",Ie)}})()},[Ae==null?void 0:Ae.description]),reactExports.useEffect(()=>{if(!xe.current||!t||Se.length===0)return;Ee.current&&Ee.current.destroy();const _e=Se.reduce(($e,Oe)=>{const Ue=new Date(Oe.createdAt).toISOString();return $e[Ue]||($e[Ue]=[]),$e[Ue].push(Oe),$e},{}),Be=Object.values(_e).flatMap(($e,Oe)=>$e.map(Ue=>({...Ue,evaluationNumber:Oe+1}))).reduce(($e,Oe)=>{const Ue=Oe.metrics.testPassCount/(Oe.metrics.testPassCount+Oe.metrics.testFailCount)*100;return $e[Oe.evaluationNumber]||($e[Oe.evaluationNumber]=[]),$e[Oe.evaluationNumber].push({x:Oe.evaluationNumber,y:Ue,evalData:Oe}),$e},{}),Te=Object.values(Be).flat(),Pe=Object.values(Be).map($e=>$e.reduce((Oe,Ue)=>Ue.y>Oe.y?Ue:Oe)),ke={responsive:!0,scales:{x:{type:"linear",position:"bottom",title:{display:!0,text:"Evaluation"},ticks:{stepSize:1}},y:{title:{display:!0,text:"Pass Rate (%)"}}},plugins:{tooltip:{callbacks:{title:$e=>$e[0].raw.evalData.evalId,label:$e=>{const Oe=$e.raw,{evalData:Ue}=Oe,qe=Ue.metrics.testPassCount/(Ue.metrics.testPassCount+Ue.metrics.testFailCount)*100;return[`Label: ${Ue.label}`,`Provider: ${Ue.provider}`,`Pass Rate: ${qe.toFixed(2)}%`,`Score: ${Ue.metrics.score.toFixed(2)}`]}}}},onClick:($e,Oe)=>{if(Oe.length>0){const Ue=Oe[0].index;window.open(`/eval/?evalId=${Te[Ue].evalData.evalId}`,"_blank")}}};Ee.current=new Chart(xe.current,{type:"scatter",data:{datasets:[{type:"scatter",data:Te,pointBackgroundColor:Te.map($e=>$e.evalData.evalId===t?"#4CAF50":"#2196F3")},{type:"line",data:Pe,borderColor:"#2196F3AA",borderWidth:2,pointRadius:0}]},options:ke})},[Se,t]),jsxRuntimeExports.jsx("canvas",{ref:xe,style:{maxHeight:"300px",cursor:"pointer"}})}function ResultsCharts({columnVisibility:t,recentEvals:Ae}){var Oe;const xe=useTheme();Chart.defaults.color=xe.palette.mode==="dark"?"#aaa":"#666";const[Ee,Se]=reactExports.useState(!0),[Ce,_e]=reactExports.useState(!1),{table:Ie,evalId:Be,config:Te}=useStore();if(reactExports.useEffect(()=>{Te!=null&&Te.description,_e(!1)},[Te==null?void 0:Te.description,Ae]),!Ie||!Te||!Ee||Ie.head.prompts.length<2&&!Ce)return null;if(Ie.head.prompts.length<2&&Ce)return jsxRuntimeExports.jsx(ErrorBoundary,{fallback:null,children:jsxRuntimeExports.jsxs(Paper,{sx:{position:"relative",padding:3,mt:2},children:[jsxRuntimeExports.jsx(IconButton,{style:{position:"absolute",right:0,top:0},onClick:()=>Se(!1),children:jsxRuntimeExports.jsx(CloseIcon,{})}),jsxRuntimeExports.jsx("div",{style:{width:"100%"},children:jsxRuntimeExports.jsx(PerformanceOverTimeChart,{table:Ie,evalId:Be})})]})});const Pe=Ie.body.flatMap(Ue=>Ue.outputs.map(qe=>qe.score)),ke=new Set(Pe);if(ke.size===1)return null;const $e=Ce?"25%":"33%";return jsxRuntimeExports.jsx(ErrorBoundary,{fallback:null,children:jsxRuntimeExports.jsxs(Paper,{sx:{position:"relative",padding:3,mt:2},children:[jsxRuntimeExports.jsx(IconButton,{style:{position:"absolute",right:0,top:0},onClick:()=>Se(!1),children:jsxRuntimeExports.jsx(CloseIcon,{})}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[jsxRuntimeExports.jsx("div",{style:{width:$e},children:jsxRuntimeExports.jsx(PassRateChart,{table:Ie})}),jsxRuntimeExports.jsx("div",{style:{width:$e},children:ke.size<=3&&Object.keys(((Oe=Ie.head.prompts[0].metrics)==null?void 0:Oe.namedScores)||{}).length>1?jsxRuntimeExports.jsx(MetricChart,{table:Ie}):jsxRuntimeExports.jsx(HistogramChart,{table:Ie})}),jsxRuntimeExports.jsx("div",{style:{width:$e},children:jsxRuntimeExports.jsx(ScatterChart,{table:Ie})}),Ce&&jsxRuntimeExports.jsx("div",{style:{width:$e},children:jsxRuntimeExports.jsx(PerformanceOverTimeChart,{table:Ie,evalId:Be})})]})]})})}const ResultsCharts$1=React.memo(ResultsCharts);/**
@@ -844,7 +844,7 @@ endobj\r
844
844
  * http://opensource.org/licenses/mit-license
845
845
  */function te(t,Ae){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!Ae,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function ee$1(t){function Ae(dr){if(!dr)throw Error("assert :P")}function xe(dr,ar,lr){for(var Ke=0;4>Ke;Ke++)if(dr[ar+Ke]!=lr.charCodeAt(Ke))return!0;return!1}function Ee(dr,ar,lr,Ke,Me){for(var je=0;je<Me;je++)dr[ar+je]=lr[Ke+je]}function Se(dr,ar,lr,Ke){for(var Me=0;Me<Ke;Me++)dr[ar+Me]=lr}function Ce(dr){return new Int32Array(dr)}function _e(dr,ar){for(var lr=[],Ke=0;Ke<dr;Ke++)lr.push(new ar);return lr}function Ie(dr,ar){var lr=[];return function Ke(Me,je,De){for(var He=De[je],Qe=0;Qe<He&&(Me.push(De.length>je+1?[]:new ar),!(De.length<je+1));Qe++)Ke(Me[Qe],je+1,De)}(lr,0,dr),lr}var Be=function(){var dr=this;function ar(yr,Sr){for(var Nr=1<<Sr-1>>>0;yr&Nr;)Nr>>>=1;return Nr?(yr&Nr-1)+Nr:yr}function lr(yr,Sr,Nr,Xr,fn){Ae(!(Xr%Nr));do yr[Sr+(Xr-=Nr)]=fn;while(0<Xr)}function Ke(yr,Sr,Nr,Xr,fn){if(Ae(2328>=fn),512>=fn)var mn=Ce(512);else if((mn=Ce(fn))==null)return 0;return function(vn,Cn,_n,Pn,qn,Jn){var ei,Yn,Ai=Cn,ai=1<<_n,Vn=Ce(16),Qn=Ce(16);for(Ae(qn!=0),Ae(Pn!=null),Ae(vn!=null),Ae(0<_n),Yn=0;Yn<qn;++Yn){if(15<Pn[Yn])return 0;++Vn[Pn[Yn]]}if(Vn[0]==qn)return 0;for(Qn[1]=0,ei=1;15>ei;++ei){if(Vn[ei]>1<<ei)return 0;Qn[ei+1]=Qn[ei]+Vn[ei]}for(Yn=0;Yn<qn;++Yn)ei=Pn[Yn],0<Pn[Yn]&&(Jn[Qn[ei]++]=Yn);if(Qn[15]==1)return(Pn=new Me).g=0,Pn.value=Jn[0],lr(vn,Ai,1,ai,Pn),ai;var ci,ui=-1,fi=ai-1,Ii=0,Ci=1,qi=1,Si=1<<_n;for(Yn=0,ei=1,qn=2;ei<=_n;++ei,qn<<=1){if(Ci+=qi<<=1,0>(qi-=Vn[ei]))return 0;for(;0<Vn[ei];--Vn[ei])(Pn=new Me).g=ei,Pn.value=Jn[Yn++],lr(vn,Ai+Ii,qn,Si,Pn),Ii=ar(Ii,ei)}for(ei=_n+1,qn=2;15>=ei;++ei,qn<<=1){if(Ci+=qi<<=1,0>(qi-=Vn[ei]))return 0;for(;0<Vn[ei];--Vn[ei]){if(Pn=new Me,(Ii&fi)!=ui){for(Ai+=Si,ci=1<<(ui=ei)-_n;15>ui&&!(0>=(ci-=Vn[ui]));)++ui,ci<<=1;ai+=Si=1<<(ci=ui-_n),vn[Cn+(ui=Ii&fi)].g=ci+_n,vn[Cn+ui].value=Ai-Cn-ui}Pn.g=ei-_n,Pn.value=Jn[Yn++],lr(vn,Ai+(Ii>>_n),qn,Si,Pn),Ii=ar(Ii,ei)}}return Ci!=2*Qn[15]-1?0:ai}(yr,Sr,Nr,Xr,fn,mn)}function Me(){this.value=this.g=0}function je(){this.value=this.g=0}function De(){this.G=_e(5,Me),this.H=Ce(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=_e(jo,je)}function He(yr,Sr,Nr,Xr){Ae(yr!=null),Ae(Sr!=null),Ae(2147483648>Xr),yr.Ca=254,yr.I=0,yr.b=-8,yr.Ka=0,yr.oa=Sr,yr.pa=Nr,yr.Jd=Sr,yr.Yc=Nr+Xr,yr.Zc=4<=Xr?Nr+Xr-4+1:Nr,xr(yr)}function Qe(yr,Sr){for(var Nr=0;0<Sr--;)Nr|=_r(yr,128)<<Sr;return Nr}function Ye(yr,Sr){var Nr=Qe(yr,Sr);return br(yr)?-Nr:Nr}function St(yr,Sr,Nr,Xr){var fn,mn=0;for(Ae(yr!=null),Ae(Sr!=null),Ae(4294967288>Xr),yr.Sb=Xr,yr.Ra=0,yr.u=0,yr.h=0,4<Xr&&(Xr=4),fn=0;fn<Xr;++fn)mn+=Sr[Nr+fn]<<8*fn;yr.Ra=mn,yr.bb=Xr,yr.oa=Sr,yr.pa=Nr}function We(yr){for(;8<=yr.u&&yr.bb<yr.Sb;)yr.Ra>>>=8,yr.Ra+=yr.oa[yr.pa+yr.bb]<<du-8>>>0,++yr.bb,yr.u-=8;fr(yr)&&(yr.h=1,yr.u=0)}function Fe(yr,Sr){if(Ae(0<=Sr),!yr.h&&Sr<=cu){var Nr=ur(yr)&uu[Sr];return yr.u+=Sr,We(yr),Nr}return yr.h=1,yr.u=0}function Ze(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function ir(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function ur(yr){return yr.Ra>>>(yr.u&du-1)>>>0}function fr(yr){return Ae(yr.bb<=yr.Sb),yr.h||yr.bb==yr.Sb&&yr.u>du}function Ar(yr,Sr){yr.u=Sr,yr.h=fr(yr)}function vr(yr){yr.u>=fu&&(Ae(yr.u>=fu),We(yr))}function xr(yr){Ae(yr!=null&&yr.oa!=null),yr.pa<yr.Zc?(yr.I=(yr.oa[yr.pa++]|yr.I<<8)>>>0,yr.b+=8):(Ae(yr!=null&&yr.oa!=null),yr.pa<yr.Yc?(yr.b+=8,yr.I=yr.oa[yr.pa++]|yr.I<<8):yr.Ka?yr.b=0:(yr.I<<=8,yr.b+=8,yr.Ka=1))}function br(yr){return Qe(yr,1)}function _r(yr,Sr){var Nr=yr.Ca;0>yr.b&&xr(yr);var Xr=yr.b,fn=Nr*Sr>>>8,mn=(yr.I>>>Xr>fn)+0;for(mn?(Nr-=fn,yr.I-=fn+1<<Xr>>>0):Nr=fn+1,Xr=Nr,fn=0;256<=Xr;)fn+=8,Xr>>=8;return Xr=7^fn+us[Xr],yr.b-=Xr,yr.Ca=(Nr<<Xr)-1,mn}function $r(yr,Sr,Nr){yr[Sr+0]=Nr>>24&255,yr[Sr+1]=Nr>>16&255,yr[Sr+2]=Nr>>8&255,yr[Sr+3]=Nr>>0&255}function Fr(yr,Sr){return yr[Sr+0]<<0|yr[Sr+1]<<8}function Ir(yr,Sr){return Fr(yr,Sr)|yr[Sr+2]<<16}function zr(yr,Sr){return Fr(yr,Sr)|Fr(yr,Sr+2)<<16}function dn(yr,Sr){var Nr=1<<Sr;return Ae(yr!=null),Ae(0<Sr),yr.X=Ce(Nr),yr.X==null?0:(yr.Mb=32-Sr,yr.Xa=Sr,1)}function tn(yr,Sr){Ae(yr!=null),Ae(Sr!=null),Ae(yr.Xa==Sr.Xa),Ee(Sr.X,0,yr.X,0,1<<Sr.Xa)}function Gr(){this.X=[],this.Xa=this.Mb=0}function wn(yr,Sr,Nr,Xr){Ae(Nr!=null),Ae(Xr!=null);var fn=Nr[0],mn=Xr[0];return fn==0&&(fn=(yr*mn+Sr/2)/Sr),mn==0&&(mn=(Sr*fn+yr/2)/yr),0>=fn||0>=mn?0:(Nr[0]=fn,Xr[0]=mn,1)}function an(yr,Sr){return yr+(1<<Sr)-1>>>Sr}function Vr(yr,Sr){return((4278255360&yr)+(4278255360&Sr)>>>0&4278255360)+((16711935&yr)+(16711935&Sr)>>>0&16711935)>>>0}function Rn(yr,Sr){dr[Sr]=function(Nr,Xr,fn,mn,vn,Cn,_n){var Pn;for(Pn=0;Pn<vn;++Pn){var qn=dr[yr](Cn[_n+Pn-1],fn,mn+Pn);Cn[_n+Pn]=Vr(Nr[Xr+Pn],qn)}}}function un(){this.ud=this.hd=this.jd=0}function sn(yr,Sr){return((4278124286&(yr^Sr))>>>1)+(yr&Sr)>>>0}function jn(yr){return 0<=yr&&256>yr?yr:0>yr?0:255<yr?255:void 0}function en(yr,Sr){return jn(yr+(yr-Sr+.5>>1))}function Jr(yr,Sr,Nr){return Math.abs(Sr-Nr)-Math.abs(yr-Nr)}function nn(yr,Sr,Nr,Xr,fn,mn,vn){for(Xr=mn[vn-1],Nr=0;Nr<fn;++Nr)mn[vn+Nr]=Xr=Vr(yr[Sr+Nr],Xr)}function rn(yr,Sr,Nr,Xr,fn){var mn;for(mn=0;mn<Nr;++mn){var vn=yr[Sr+mn],Cn=vn>>8&255,_n=16711935&(_n=(_n=16711935&vn)+((Cn<<16)+Cn));Xr[fn+mn]=(4278255360&vn)+_n>>>0}}function cn(yr,Sr){Sr.jd=yr>>0&255,Sr.hd=yr>>8&255,Sr.ud=yr>>16&255}function pn(yr,Sr,Nr,Xr,fn,mn){var vn;for(vn=0;vn<Xr;++vn){var Cn=Sr[Nr+vn],_n=Cn>>>8,Pn=Cn,qn=255&(qn=(qn=Cn>>>16)+((yr.jd<<24>>24)*(_n<<24>>24)>>>5));Pn=255&(Pn=(Pn=Pn+((yr.hd<<24>>24)*(_n<<24>>24)>>>5))+((yr.ud<<24>>24)*(qn<<24>>24)>>>5)),fn[mn+vn]=(4278255360&Cn)+(qn<<16)+Pn}}function Mr(yr,Sr,Nr,Xr,fn){dr[Sr]=function(mn,vn,Cn,_n,Pn,qn,Jn,ei,Yn){for(_n=Jn;_n<ei;++_n)for(Jn=0;Jn<Yn;++Jn)Pn[qn++]=fn(Cn[Xr(mn[vn++])])},dr[yr]=function(mn,vn,Cn,_n,Pn,qn,Jn){var ei=8>>mn.b,Yn=mn.Ea,Ai=mn.K[0],ai=mn.w;if(8>ei)for(mn=(1<<mn.b)-1,ai=(1<<ei)-1;vn<Cn;++vn){var Vn,Qn=0;for(Vn=0;Vn<Yn;++Vn)Vn&mn||(Qn=Xr(_n[Pn++])),qn[Jn++]=fn(Ai[Qn&ai]),Qn>>=ei}else dr["VP8LMapColor"+Nr](_n,Pn,Ai,ai,qn,Jn,vn,Cn,Yn)}}function gr(yr,Sr,Nr,Xr,fn){for(Nr=Sr+Nr;Sr<Nr;){var mn=yr[Sr++];Xr[fn++]=mn>>16&255,Xr[fn++]=mn>>8&255,Xr[fn++]=mn>>0&255}}function Br(yr,Sr,Nr,Xr,fn){for(Nr=Sr+Nr;Sr<Nr;){var mn=yr[Sr++];Xr[fn++]=mn>>16&255,Xr[fn++]=mn>>8&255,Xr[fn++]=mn>>0&255,Xr[fn++]=mn>>24&255}}function Hr(yr,Sr,Nr,Xr,fn){for(Nr=Sr+Nr;Sr<Nr;){var mn=(vn=yr[Sr++])>>16&240|vn>>12&15,vn=vn>>0&240|vn>>28&15;Xr[fn++]=mn,Xr[fn++]=vn}}function Kr(yr,Sr,Nr,Xr,fn){for(Nr=Sr+Nr;Sr<Nr;){var mn=(vn=yr[Sr++])>>16&248|vn>>13&7,vn=vn>>5&224|vn>>3&31;Xr[fn++]=mn,Xr[fn++]=vn}}function Dr(yr,Sr,Nr,Xr,fn){for(Nr=Sr+Nr;Sr<Nr;){var mn=yr[Sr++];Xr[fn++]=mn>>0&255,Xr[fn++]=mn>>8&255,Xr[fn++]=mn>>16&255}}function qr(yr,Sr,Nr,Xr,fn,mn){if(mn==0)for(Nr=Sr+Nr;Sr<Nr;)$r(Xr,((mn=yr[Sr++])[0]>>24|mn[1]>>8&65280|mn[2]<<8&16711680|mn[3]<<24)>>>0),fn+=32;else Ee(Xr,fn,yr,Sr,Nr)}function Ur(yr,Sr){dr[Sr][0]=dr[yr+"0"],dr[Sr][1]=dr[yr+"1"],dr[Sr][2]=dr[yr+"2"],dr[Sr][3]=dr[yr+"3"],dr[Sr][4]=dr[yr+"4"],dr[Sr][5]=dr[yr+"5"],dr[Sr][6]=dr[yr+"6"],dr[Sr][7]=dr[yr+"7"],dr[Sr][8]=dr[yr+"8"],dr[Sr][9]=dr[yr+"9"],dr[Sr][10]=dr[yr+"10"],dr[Sr][11]=dr[yr+"11"],dr[Sr][12]=dr[yr+"12"],dr[Sr][13]=dr[yr+"13"],dr[Sr][14]=dr[yr+"0"],dr[Sr][15]=dr[yr+"0"]}function Bn(yr){return yr==yu||yr==jl||yr==tc||yr==rc}function In(){this.eb=[],this.size=this.A=this.fb=0}function Rr(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Mn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new In,this.f.kb=new Rr,this.sd=null}function En(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Yr(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Sn(yr){return alert("todo:WebPSamplerProcessPlane"),yr.T}function yn(yr,Sr){var Nr=yr.T,Xr=Sr.ba.f.RGBA,fn=Xr.eb,mn=Xr.fb+yr.ka*Xr.A,vn=Es[Sr.ba.S],Cn=yr.y,_n=yr.O,Pn=yr.f,qn=yr.N,Jn=yr.ea,ei=yr.W,Yn=Sr.cc,Ai=Sr.dc,ai=Sr.Mc,Vn=Sr.Nc,Qn=yr.ka,ci=yr.ka+yr.T,ui=yr.U,fi=ui+1>>1;for(Qn==0?vn(Cn,_n,null,null,Pn,qn,Jn,ei,Pn,qn,Jn,ei,fn,mn,null,null,ui):(vn(Sr.ec,Sr.fc,Cn,_n,Yn,Ai,ai,Vn,Pn,qn,Jn,ei,fn,mn-Xr.A,fn,mn,ui),++Nr);Qn+2<ci;Qn+=2)Yn=Pn,Ai=qn,ai=Jn,Vn=ei,qn+=yr.Rc,ei+=yr.Rc,mn+=2*Xr.A,vn(Cn,(_n+=2*yr.fa)-yr.fa,Cn,_n,Yn,Ai,ai,Vn,Pn,qn,Jn,ei,fn,mn-Xr.A,fn,mn,ui);return _n+=yr.fa,yr.j+ci<yr.o?(Ee(Sr.ec,Sr.fc,Cn,_n,ui),Ee(Sr.cc,Sr.dc,Pn,qn,fi),Ee(Sr.Mc,Sr.Nc,Jn,ei,fi),Nr--):1&ci||vn(Cn,_n,null,null,Pn,qn,Jn,ei,Pn,qn,Jn,ei,fn,mn+Xr.A,null,null,ui),Nr}function On(yr,Sr,Nr){var Xr=yr.F,fn=[yr.J];if(Xr!=null){var mn=yr.U,vn=Sr.ba.S,Cn=vn==Ju||vn==tc;Sr=Sr.ba.f.RGBA;var _n=[0],Pn=yr.ka;_n[0]=yr.T,yr.Kb&&(Pn==0?--_n[0]:(--Pn,fn[0]-=yr.width),yr.j+yr.ka+yr.T==yr.o&&(_n[0]=yr.o-yr.j-Pn));var qn=Sr.eb;Pn=Sr.fb+Pn*Sr.A,yr=go(Xr,fn[0],yr.width,mn,_n,qn,Pn+(Cn?0:3),Sr.A),Ae(Nr==_n),yr&&Bn(vn)&&bs(qn,Pn,Cn,mn,_n,Sr.A)}return 0}function Nn(yr){var Sr=yr.ma,Nr=Sr.ba.S,Xr=11>Nr,fn=Nr==sl||Nr==Xu||Nr==Ju||Nr==Co||Nr==12||Bn(Nr);if(Sr.memory=null,Sr.Ib=null,Sr.Jb=null,Sr.Nd=null,!au(Sr.Oa,yr,fn?11:12))return 0;if(fn&&Bn(Nr)&&mi(),yr.da)alert("todo:use_scaling");else{if(Xr){if(Sr.Ib=Sn,yr.Kb){if(Nr=yr.U+1>>1,Sr.memory=Ce(yr.U+2*Nr),Sr.memory==null)return 0;Sr.ec=Sr.memory,Sr.fc=0,Sr.cc=Sr.ec,Sr.dc=Sr.fc+yr.U,Sr.Mc=Sr.cc,Sr.Nc=Sr.dc+Nr,Sr.Ib=yn,mi()}}else alert("todo:EmitYUV");fn&&(Sr.Jb=On,Xr&&Xn())}if(Xr&&!Zo){for(yr=0;256>yr;++yr)Cs[yr]=89858*(yr-128)+ra>>ja,Ss[yr]=-22014*(yr-128)+ra,Eu[yr]=-45773*(yr-128),Dl[yr]=113618*(yr-128)+ra>>ja;for(yr=vo;yr<bo;++yr)Sr=76283*(yr-16)+ra>>ja,Pc[yr-vo]=Ts(Sr,255),bd[yr-vo]=Ts(Sr+8>>4,15);Zo=1}return 1}function kr(yr){var Sr=yr.ma,Nr=yr.U,Xr=yr.T;return Ae(!(1&yr.ka)),0>=Nr||0>=Xr?0:(Nr=Sr.Ib(yr,Sr),Sr.Jb!=null&&Sr.Jb(yr,Sr,Nr),Sr.Dc+=Nr,1)}function Er(yr){yr.ma.memory=null}function Tr(yr,Sr,Nr,Xr){return Fe(yr,8)!=47?0:(Sr[0]=Fe(yr,14)+1,Nr[0]=Fe(yr,14)+1,Xr[0]=Fe(yr,1),Fe(yr,3)!=0?0:!yr.h)}function Qr(yr,Sr){if(4>yr)return yr+1;var Nr=yr-2>>1;return(2+(1&yr)<<Nr)+Fe(Sr,Nr)+1}function Zr(yr,Sr){return 120<Sr?Sr-120:1<=(Nr=((Nr=Jd[Sr-1])>>4)*yr+(8-(15&Nr)))?Nr:1;var Nr}function xn(yr,Sr,Nr){var Xr=ur(Nr),fn=yr[Sr+=255&Xr].g-8;return 0<fn&&(Ar(Nr,Nr.u+8),Xr=ur(Nr),Sr+=yr[Sr].value,Sr+=Xr&(1<<fn)-1),Ar(Nr,Nr.u+yr[Sr].g),yr[Sr].value}function An(yr,Sr,Nr){return Nr.g+=yr.g,Nr.value+=yr.value<<Sr>>>0,Ae(8>=Nr.g),yr.g}function Tn(yr,Sr,Nr){var Xr=yr.xc;return Ae((Sr=Xr==0?0:yr.vc[yr.md*(Nr>>Xr)+(Sr>>Xr)])<yr.Wb),yr.Ya[Sr]}function ti(yr,Sr,Nr,Xr){var fn=yr.ab,mn=yr.c*Sr,vn=yr.C;Sr=vn+Sr;var Cn=Nr,_n=Xr;for(Xr=yr.Ta,Nr=yr.Ua;0<fn--;){var Pn=yr.gc[fn],qn=vn,Jn=Sr,ei=Cn,Yn=_n,Ai=(_n=Xr,Cn=Nr,Pn.Ea);switch(Ae(qn<Jn),Ae(Jn<=Pn.nc),Pn.hc){case 2:_c(ei,Yn,(Jn-qn)*Ai,_n,Cn);break;case 0:var ai=qn,Vn=Jn,Qn=_n,ci=Cn,ui=(Si=Pn).Ea;ai==0&&(Il(ei,Yn,null,null,1,Qn,ci),nn(ei,Yn+1,0,0,ui-1,Qn,ci+1),Yn+=ui,ci+=ui,++ai);for(var fi=1<<Si.b,Ii=fi-1,Ci=an(ui,Si.b),qi=Si.K,Si=Si.w+(ai>>Si.b)*Ci;ai<Vn;){var lo=qi,uo=Si,ao=1;for(Sa(ei,Yn,Qn,ci-ui,1,Qn,ci);ao<ui;){var io=(ao&~Ii)+fi;io>ui&&(io=ui),(0,fa[lo[uo++]>>8&15])(ei,Yn+ +ao,Qn,ci+ao-ui,io-ao,Qn,ci+ao),ao=io}Yn+=ui,ci+=ui,++ai&Ii||(Si+=Ci)}Jn!=Pn.nc&&Ee(_n,Cn-Ai,_n,Cn+(Jn-qn-1)*Ai,Ai);break;case 1:for(Ai=ei,Vn=Yn,ui=(ei=Pn.Ea)-(ci=ei&~(Qn=(Yn=1<<Pn.b)-1)),ai=an(ei,Pn.b),fi=Pn.K,Pn=Pn.w+(qn>>Pn.b)*ai;qn<Jn;){for(Ii=fi,Ci=Pn,qi=new un,Si=Vn+ci,lo=Vn+ei;Vn<Si;)cn(Ii[Ci++],qi),rl(qi,Ai,Vn,Yn,_n,Cn),Vn+=Yn,Cn+=Yn;Vn<lo&&(cn(Ii[Ci++],qi),rl(qi,Ai,Vn,ui,_n,Cn),Vn+=ui,Cn+=ui),++qn&Qn||(Pn+=ai)}break;case 3:if(ei==_n&&Yn==Cn&&0<Pn.b){for(Vn=_n,ei=Ai=Cn+(Jn-qn)*Ai-(ci=(Jn-qn)*an(Pn.Ea,Pn.b)),Yn=_n,Qn=Cn,ai=[],ci=(ui=ci)-1;0<=ci;--ci)ai[ci]=Yn[Qn+ci];for(ci=ui-1;0<=ci;--ci)Vn[ei+ci]=ai[ci];cs(Pn,qn,Jn,_n,Ai,_n,Cn)}else cs(Pn,qn,Jn,ei,Yn,_n,Cn)}Cn=Xr,_n=Nr}_n!=Nr&&Ee(Xr,Nr,Cn,_n,mn)}function Fn(yr,Sr){var Nr=yr.V,Xr=yr.Ba+yr.c*yr.C,fn=Sr-yr.C;if(Ae(Sr<=yr.l.o),Ae(16>=fn),0<fn){var mn=yr.l,vn=yr.Ta,Cn=yr.Ua,_n=mn.width;if(ti(yr,fn,Nr,Xr),fn=Cn=[Cn],Ae((Nr=yr.C)<(Xr=Sr)),Ae(mn.v<mn.va),Xr>mn.o&&(Xr=mn.o),Nr<mn.j){var Pn=mn.j-Nr;Nr=mn.j,fn[0]+=Pn*_n}if(Nr>=Xr?Nr=0:(fn[0]+=4*mn.v,mn.ka=Nr-mn.j,mn.U=mn.va-mn.v,mn.T=Xr-Nr,Nr=1),Nr){if(Cn=Cn[0],11>(Nr=yr.ca).S){var qn=Nr.f.RGBA,Jn=(Xr=Nr.S,fn=mn.U,mn=mn.T,Pn=qn.eb,qn.A),ei=mn;for(qn=qn.fb+yr.Ma*qn.A;0<ei--;){var Yn=vn,Ai=Cn,ai=fn,Vn=Pn,Qn=qn;switch(Xr){case Rc:ds(Yn,Ai,ai,Vn,Qn);break;case sl:ts(Yn,Ai,ai,Vn,Qn);break;case yu:ts(Yn,Ai,ai,Vn,Qn),bs(Vn,Qn,0,ai,1,0);break;case md:Ia(Yn,Ai,ai,Vn,Qn);break;case Xu:qr(Yn,Ai,ai,Vn,Qn,1);break;case jl:qr(Yn,Ai,ai,Vn,Qn,1),bs(Vn,Qn,0,ai,1,0);break;case Ju:qr(Yn,Ai,ai,Vn,Qn,0);break;case tc:qr(Yn,Ai,ai,Vn,Qn,0),bs(Vn,Qn,1,ai,1,0);break;case Co:il(Yn,Ai,ai,Vn,Qn);break;case rc:il(Yn,Ai,ai,Vn,Qn),Eo(Vn,Qn,ai,1,0);break;case Ic:Ra(Yn,Ai,ai,Vn,Qn);break;default:Ae(0)}Cn+=_n,qn+=Jn}yr.Ma+=mn}else alert("todo:EmitRescaledRowsYUVA");Ae(yr.Ma<=Nr.height)}}yr.C=Sr,Ae(yr.C<=yr.i)}function $n(yr){var Sr;if(0<yr.ua)return 0;for(Sr=0;Sr<yr.Wb;++Sr){var Nr=yr.Ya[Sr].G,Xr=yr.Ya[Sr].H;if(0<Nr[1][Xr[1]+0].g||0<Nr[2][Xr[2]+0].g||0<Nr[3][Xr[3]+0].g)return 0}return 1}function Zn(yr,Sr,Nr,Xr,fn,mn){if(yr.Z!=0){var vn=yr.qd,Cn=yr.rd;for(Ae(ns[yr.Z]!=null);Sr<Nr;++Sr)ns[yr.Z](vn,Cn,Xr,fn,Xr,fn,mn),vn=Xr,Cn=fn,fn+=mn;yr.qd=vn,yr.rd=Cn}}function Dn(yr,Sr){var Nr=yr.l.ma,Xr=Nr.Z==0||Nr.Z==1?yr.l.j:yr.C;if(Xr=yr.C<Xr?Xr:yr.C,Ae(Sr<=yr.l.o),Sr>Xr){var fn=yr.l.width,mn=Nr.ca,vn=Nr.tb+fn*Xr,Cn=yr.V,_n=yr.Ba+yr.c*Xr,Pn=yr.gc;Ae(yr.ab==1),Ae(Pn[0].hc==3),Ku(Pn[0],Xr,Sr,Cn,_n,mn,vn),Zn(Nr,Xr,Sr,mn,vn,fn)}yr.C=yr.Ma=Sr}function Wn(yr,Sr,Nr,Xr,fn,mn,vn){var Cn=yr.$/Xr,_n=yr.$%Xr,Pn=yr.m,qn=yr.s,Jn=Nr+yr.$,ei=Jn;fn=Nr+Xr*fn;var Yn=Nr+Xr*mn,Ai=280+qn.ua,ai=yr.Pb?Cn:16777216,Vn=0<qn.ua?qn.Wa:null,Qn=qn.wc,ci=Jn<Yn?Tn(qn,_n,Cn):null;Ae(yr.C<mn),Ae(Yn<=fn);var ui=!1;e:for(;;){for(;ui||Jn<Yn;){var fi=0;if(Cn>=ai){var Ii=Jn-Nr;Ae((ai=yr).Pb),ai.wd=ai.m,ai.xd=Ii,0<ai.s.ua&&tn(ai.s.Wa,ai.s.vb),ai=Cn+Tc}if(_n&Qn||(ci=Tn(qn,_n,Cn)),Ae(ci!=null),ci.Qb&&(Sr[Jn]=ci.qb,ui=!0),!ui)if(vr(Pn),ci.jc){fi=Pn,Ii=Sr;var Ci=Jn,qi=ci.pd[ur(fi)&jo-1];Ae(ci.jc),256>qi.g?(Ar(fi,fi.u+qi.g),Ii[Ci]=qi.value,fi=0):(Ar(fi,fi.u+qi.g-256),Ae(256<=qi.value),fi=qi.value),fi==0&&(ui=!0)}else fi=xn(ci.G[0],ci.H[0],Pn);if(Pn.h)break;if(ui||256>fi){if(!ui)if(ci.nd)Sr[Jn]=(ci.qb|fi<<8)>>>0;else{if(vr(Pn),ui=xn(ci.G[1],ci.H[1],Pn),vr(Pn),Ii=xn(ci.G[2],ci.H[2],Pn),Ci=xn(ci.G[3],ci.H[3],Pn),Pn.h)break;Sr[Jn]=(Ci<<24|ui<<16|fi<<8|Ii)>>>0}if(ui=!1,++Jn,++_n>=Xr&&(_n=0,++Cn,vn!=null&&Cn<=mn&&!(Cn%16)&&vn(yr,Cn),Vn!=null))for(;ei<Jn;)fi=Sr[ei++],Vn.X[(506832829*fi&4294967295)>>>Vn.Mb]=fi}else if(280>fi){if(fi=Qr(fi-256,Pn),Ii=xn(ci.G[4],ci.H[4],Pn),vr(Pn),Ii=Zr(Xr,Ii=Qr(Ii,Pn)),Pn.h)break;if(Jn-Nr<Ii||fn-Jn<fi)break e;for(Ci=0;Ci<fi;++Ci)Sr[Jn+Ci]=Sr[Jn+Ci-Ii];for(Jn+=fi,_n+=fi;_n>=Xr;)_n-=Xr,++Cn,vn!=null&&Cn<=mn&&!(Cn%16)&&vn(yr,Cn);if(Ae(Jn<=fn),_n&Qn&&(ci=Tn(qn,_n,Cn)),Vn!=null)for(;ei<Jn;)fi=Sr[ei++],Vn.X[(506832829*fi&4294967295)>>>Vn.Mb]=fi}else{if(!(fi<Ai))break e;for(ui=fi-280,Ae(Vn!=null);ei<Jn;)fi=Sr[ei++],Vn.X[(506832829*fi&4294967295)>>>Vn.Mb]=fi;fi=Jn,Ae(!(ui>>>(Ii=Vn).Xa)),Sr[fi]=Ii.X[ui],ui=!0}ui||Ae(Pn.h==fr(Pn))}if(yr.Pb&&Pn.h&&Jn<fn)Ae(yr.m.h),yr.a=5,yr.m=yr.wd,yr.$=yr.xd,0<yr.s.ua&&tn(yr.s.vb,yr.s.Wa);else{if(Pn.h)break e;vn!=null&&vn(yr,Cn>mn?mn:Cn),yr.a=0,yr.$=Jn-Nr}return 1}return yr.a=3,0}function zn(yr){Ae(yr!=null),yr.vc=null,yr.yc=null,yr.Ya=null;var Sr=yr.Wa;Sr!=null&&(Sr.X=null),yr.vb=null,Ae(yr!=null)}function Gn(){var yr=new Kc;return yr==null?null:(yr.a=0,yr.xb=bu,Ur("Predictor","VP8LPredictors"),Ur("Predictor","VP8LPredictors_C"),Ur("PredictorAdd","VP8LPredictorsAdd"),Ur("PredictorAdd","VP8LPredictorsAdd_C"),_c=rn,rl=pn,ds=gr,ts=Br,il=Hr,Ra=Kr,Ia=Dr,dr.VP8LMapColor32b=hu,dr.VP8LMapColor8b=pu,yr)}function di(yr,Sr,Nr,Xr,fn){var mn=1,vn=[yr],Cn=[Sr],_n=Xr.m,Pn=Xr.s,qn=null,Jn=0;e:for(;;){if(Nr)for(;mn&&Fe(_n,1);){var ei=vn,Yn=Cn,Ai=Xr,ai=1,Vn=Ai.m,Qn=Ai.gc[Ai.ab],ci=Fe(Vn,2);if(Ai.Oc&1<<ci)mn=0;else{switch(Ai.Oc|=1<<ci,Qn.hc=ci,Qn.Ea=ei[0],Qn.nc=Yn[0],Qn.K=[null],++Ai.ab,Ae(4>=Ai.ab),ci){case 0:case 1:Qn.b=Fe(Vn,3)+2,ai=di(an(Qn.Ea,Qn.b),an(Qn.nc,Qn.b),0,Ai,Qn.K),Qn.K=Qn.K[0];break;case 3:var ui,fi=Fe(Vn,8)+1,Ii=16<fi?0:4<fi?1:2<fi?2:3;if(ei[0]=an(Qn.Ea,Ii),Qn.b=Ii,ui=ai=di(fi,1,0,Ai,Qn.K)){var Ci,qi=fi,Si=Qn,lo=1<<(8>>Si.b),uo=Ce(lo);if(uo==null)ui=0;else{var ao=Si.K[0],io=Si.w;for(uo[0]=Si.K[0][0],Ci=1;Ci<1*qi;++Ci)uo[Ci]=Vr(ao[io+Ci],uo[Ci-1]);for(;Ci<4*lo;++Ci)uo[Ci]=0;Si.K[0]=null,Si.K[0]=uo,ui=1}}ai=ui;break;case 2:break;default:Ae(0)}mn=ai}}if(vn=vn[0],Cn=Cn[0],mn&&Fe(_n,1)&&!(mn=1<=(Jn=Fe(_n,4))&&11>=Jn)){Xr.a=3;break e}var yo;if(yo=mn)t:{var wo,Yi,To,ps=Xr,$o=vn,zo=Cn,po=Jn,os=Nr,ss=ps.m,Po=ps.s,Go=[null],Xo=1,_s=0,zs=vd[po];r:for(;;){if(os&&Fe(ss,1)){var Mo=Fe(ss,3)+2,No=an($o,Mo),ks=an(zo,Mo),cl=No*ks;if(!di(No,ks,0,ps,Go))break r;for(Go=Go[0],Po.xc=Mo,wo=0;wo<cl;++wo){var $a=Go[wo]>>8&65535;Go[wo]=$a,$a>=Xo&&(Xo=$a+1)}}if(ss.h)break r;for(Yi=0;5>Yi;++Yi){var Ao=Fl[Yi];!Yi&&0<po&&(Ao+=1<<po),_s<Ao&&(_s=Ao)}var ga=_e(Xo*zs,Me),Mc=Xo,rd=_e(Mc,De);if(rd==null)var Gs=null;else Ae(65536>=Mc),Gs=rd;var Vs=Ce(_s);if(Gs==null||Vs==null||ga==null){ps.a=1;break r}var Ul=ga;for(wo=To=0;wo<Xo;++wo){var Qs=Gs[wo],La=Qs.G,ql=Qs.H,Cu=0,js=1,Su=0;for(Yi=0;5>Yi;++Yi){Ao=Fl[Yi],La[Yi]=Ul,ql[Yi]=To,!Yi&&0<po&&(Ao+=1<<po);i:{var dl,Oa=Ao,_u=ps,va=Vs,Ed=Ul,nd=To,So=0,na=_u.m,id=Fe(na,1);if(Se(va,0,0,Oa),id){var od=Fe(na,1)+1,kc=Fe(na,1),jc=Fe(na,kc==0?1:8);va[jc]=1,od==2&&(va[jc=Fe(na,8)]=1);var ya=1}else{var Ro=Ce(19),Uo=Fe(na,4)+4;if(19<Uo){_u.a=3;var Lo=0;break i}for(dl=0;dl<Uo;++dl)Ro[Xd[dl]]=Fe(na,3);var Ru=void 0,Da=void 0,Iu=_u,of=Ro,Vo=Oa,Fc=va,dc=0,xa=Iu.m,ia=8,Fs=_e(128,Me);n:for(;Ke(Fs,0,7,of,19);){if(Fe(xa,1)){var fc=2+2*Fe(xa,3);if((Ru=2+Fe(xa,fc))>Vo)break n}else Ru=Vo;for(Da=0;Da<Vo&&Ru--;){vr(xa);var $c=Fs[0+(127&ur(xa))];Ar(xa,xa.u+$c.g);var hl=$c.value;if(16>hl)Fc[Da++]=hl,hl!=0&&(ia=hl);else{var Cd=hl==16,sd=hl-16,Sd=Bc[sd],ad=Fe(xa,nc[sd])+Sd;if(Da+ad>Vo)break n;for(var _d=Cd?ia:0;0<ad--;)Fc[Da++]=_d}}dc=1;break n}dc||(Iu.a=3),ya=dc}(ya=ya&&!na.h)&&(So=Ke(Ed,nd,8,va,Oa)),ya&&So!=0?Lo=So:(_u.a=3,Lo=0)}if(Lo==0)break r;if(js&&gd[Yi]==1&&(js=Ul[To].g==0),Cu+=Ul[To].g,To+=Lo,3>=Yi){var Bu,Lc=Vs[0];for(Bu=1;Bu<Ao;++Bu)Vs[Bu]>Lc&&(Lc=Vs[Bu]);Su+=Lc}}if(Qs.nd=js,Qs.Qb=0,js&&(Qs.qb=(La[3][ql[3]+0].value<<24|La[1][ql[1]+0].value<<16|La[2][ql[2]+0].value)>>>0,Cu==0&&256>La[0][ql[0]+0].value&&(Qs.Qb=1,Qs.qb+=La[0][ql[0]+0].value<<8)),Qs.jc=!Qs.Qb&&6>Su,Qs.jc){var hc,$s=Qs;for(hc=0;hc<jo;++hc){var Na=hc,oa=$s.pd[Na],Hl=$s.G[0][$s.H[0]+Na];256<=Hl.value?(oa.g=Hl.g+256,oa.value=Hl.value):(oa.g=0,oa.value=0,Na>>=An(Hl,8,oa),Na>>=An($s.G[1][$s.H[1]+Na],16,oa),Na>>=An($s.G[2][$s.H[2]+Na],0,oa),An($s.G[3][$s.H[3]+Na],24,oa))}}}Po.vc=Go,Po.Wb=Xo,Po.Ya=Gs,Po.yc=ga,yo=1;break t}yo=0}if(!(mn=yo)){Xr.a=3;break e}if(0<Jn){if(Pn.ua=1<<Jn,!dn(Pn.Wa,Jn)){Xr.a=1,mn=0;break e}}else Pn.ua=0;var Oc=Xr,Dc=vn,Rd=Cn,Nc=Oc.s,Uc=Nc.xc;if(Oc.c=Dc,Oc.i=Rd,Nc.md=an(Dc,Uc),Nc.wc=Uc==0?-1:(1<<Uc)-1,Nr){Xr.xb=ma;break e}if((qn=Ce(vn*Cn))==null){Xr.a=1,mn=0;break e}mn=(mn=Wn(Xr,qn,0,vn,Cn,Cn,null))&&!_n.h;break e}return mn?(fn!=null?fn[0]=qn:(Ae(qn==null),Ae(Nr)),Xr.$=0,Nr||zn(Pn)):zn(Pn),mn}function hi(yr,Sr){var Nr=yr.c*yr.i,Xr=Nr+Sr+16*Sr;return Ae(yr.c<=Sr),yr.V=Ce(Xr),yr.V==null?(yr.Ta=null,yr.Ua=0,yr.a=1,0):(yr.Ta=yr.V,yr.Ua=yr.Ba+Nr+Sr,1)}function Ei(yr,Sr){var Nr=yr.C,Xr=Sr-Nr,fn=yr.V,mn=yr.Ba+yr.c*Nr;for(Ae(Sr<=yr.l.o);0<Xr;){var vn=16<Xr?16:Xr,Cn=yr.l.ma,_n=yr.l.width,Pn=_n*vn,qn=Cn.ca,Jn=Cn.tb+_n*Nr,ei=yr.Ta,Yn=yr.Ua;ti(yr,vn,fn,mn),Fo(ei,Yn,qn,Jn,Pn),Zn(Cn,Nr,Nr+vn,qn,Jn,_n),Xr-=vn,fn+=vn*yr.c,Nr+=vn}Ae(Nr==Sr),yr.C=yr.Ma=Sr}function _i(){this.ub=this.yd=this.td=this.Rb=0}function Mi(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function ji(){this.Fb=this.Bb=this.Cb=0,this.Zb=Ce(4),this.Lb=Ce(4)}function no(){this.Yb=function(){var yr=[];return function Sr(Nr,Xr,fn){for(var mn=fn[Xr],vn=0;vn<mn&&(Nr.push(fn.length>Xr+1?[]:0),!(fn.length<Xr+1));vn++)Sr(Nr[vn],Xr+1,fn)}(yr,0,[3,11]),yr}()}function Li(){this.jb=Ce(3),this.Wc=Ie([4,8],no),this.Xc=Ie([4,17],no)}function oo(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new Ce(4),this.od=new Ce(4)}function Vi(){this.ld=this.La=this.dd=this.tc=0}function eo(){this.Na=this.la=0}function yi(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Di(){this.ad=Ce(384),this.Za=0,this.Ob=Ce(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Hi(){this.uc=this.M=this.Nb=0,this.wa=Array(new Vi),this.Y=0,this.ya=Array(new Di),this.aa=0,this.l=new Ni}function Wi(){this.y=Ce(16),this.f=Ce(8),this.ea=Ce(8)}function Ki(){this.cb=this.a=0,this.sc="",this.m=new Ze,this.Od=new _i,this.Kc=new Mi,this.ed=new oo,this.Qa=new ji,this.Ic=this.$c=this.Aa=0,this.D=new Hi,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=_e(8,Ze),this.ia=0,this.pb=_e(4,yi),this.Pa=new Li,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Wi),this.Hd=0,this.rb=Array(new eo),this.sb=0,this.wa=Array(new Vi),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Di),this.L=this.aa=0,this.gd=Ie([4,2],Vi),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Ni(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function _o(){var yr=new Ki;return yr!=null&&(yr.a=0,yr.sc="OK",yr.cb=0,yr.Xb=0,$l||($l=Al)),yr}function xo(yr,Sr,Nr){return yr.a==0&&(yr.a=Sr,yr.sc=Nr,yr.cb=0),0}function Vl(yr,Sr,Nr){return 3<=Nr&&yr[Sr+0]==157&&yr[Sr+1]==1&&yr[Sr+2]==42}function yc(yr,Sr){if(yr==null)return 0;if(yr.a=0,yr.sc="OK",Sr==null)return xo(yr,2,"null VP8Io passed to VP8GetHeaders()");var Nr=Sr.data,Xr=Sr.w,fn=Sr.ha;if(4>fn)return xo(yr,7,"Truncated header.");var mn=Nr[Xr+0]|Nr[Xr+1]<<8|Nr[Xr+2]<<16,vn=yr.Od;if(vn.Rb=!(1&mn),vn.td=mn>>1&7,vn.yd=mn>>4&1,vn.ub=mn>>5,3<vn.td)return xo(yr,3,"Incorrect keyframe parameters.");if(!vn.yd)return xo(yr,4,"Frame not displayable.");Xr+=3,fn-=3;var Cn=yr.Kc;if(vn.Rb){if(7>fn)return xo(yr,7,"cannot parse picture header");if(!Vl(Nr,Xr,fn))return xo(yr,3,"Bad code word");Cn.c=16383&(Nr[Xr+4]<<8|Nr[Xr+3]),Cn.Td=Nr[Xr+4]>>6,Cn.i=16383&(Nr[Xr+6]<<8|Nr[Xr+5]),Cn.Ud=Nr[Xr+6]>>6,Xr+=7,fn-=7,yr.za=Cn.c+15>>4,yr.Ub=Cn.i+15>>4,Sr.width=Cn.c,Sr.height=Cn.i,Sr.Da=0,Sr.j=0,Sr.v=0,Sr.va=Sr.width,Sr.o=Sr.height,Sr.da=0,Sr.ib=Sr.width,Sr.hb=Sr.height,Sr.U=Sr.width,Sr.T=Sr.height,Se((mn=yr.Pa).jb,0,255,mn.jb.length),Ae((mn=yr.Qa)!=null),mn.Cb=0,mn.Bb=0,mn.Fb=1,Se(mn.Zb,0,0,mn.Zb.length),Se(mn.Lb,0,0,mn.Lb)}if(vn.ub>fn)return xo(yr,7,"bad partition length");He(mn=yr.m,Nr,Xr,vn.ub),Xr+=vn.ub,fn-=vn.ub,vn.Rb&&(Cn.Ld=br(mn),Cn.Kd=br(mn)),Cn=yr.Qa;var _n,Pn=yr.Pa;if(Ae(mn!=null),Ae(Cn!=null),Cn.Cb=br(mn),Cn.Cb){if(Cn.Bb=br(mn),br(mn)){for(Cn.Fb=br(mn),_n=0;4>_n;++_n)Cn.Zb[_n]=br(mn)?Ye(mn,7):0;for(_n=0;4>_n;++_n)Cn.Lb[_n]=br(mn)?Ye(mn,6):0}if(Cn.Bb)for(_n=0;3>_n;++_n)Pn.jb[_n]=br(mn)?Qe(mn,8):255}else Cn.Bb=0;if(mn.Ka)return xo(yr,3,"cannot parse segment header");if((Cn=yr.ed).zd=br(mn),Cn.Tb=Qe(mn,6),Cn.wb=Qe(mn,3),Cn.Pc=br(mn),Cn.Pc&&br(mn)){for(Pn=0;4>Pn;++Pn)br(mn)&&(Cn.vd[Pn]=Ye(mn,6));for(Pn=0;4>Pn;++Pn)br(mn)&&(Cn.od[Pn]=Ye(mn,6))}if(yr.L=Cn.Tb==0?0:Cn.zd?1:2,mn.Ka)return xo(yr,3,"cannot parse filter header");var qn=fn;if(fn=_n=Xr,Xr=_n+qn,Cn=qn,yr.Xb=(1<<Qe(yr.m,2))-1,qn<3*(Pn=yr.Xb))Nr=7;else{for(_n+=3*Pn,Cn-=3*Pn,qn=0;qn<Pn;++qn){var Jn=Nr[fn+0]|Nr[fn+1]<<8|Nr[fn+2]<<16;Jn>Cn&&(Jn=Cn),He(yr.Jc[+qn],Nr,_n,Jn),_n+=Jn,Cn-=Jn,fn+=3}He(yr.Jc[+Pn],Nr,_n,Cn),Nr=_n<Xr?0:5}if(Nr!=0)return xo(yr,Nr,"cannot parse partitions");for(Nr=Qe(_n=yr.m,7),fn=br(_n)?Ye(_n,4):0,Xr=br(_n)?Ye(_n,4):0,Cn=br(_n)?Ye(_n,4):0,Pn=br(_n)?Ye(_n,4):0,_n=br(_n)?Ye(_n,4):0,qn=yr.Qa,Jn=0;4>Jn;++Jn){if(qn.Cb){var ei=qn.Zb[Jn];qn.Fb||(ei+=Nr)}else{if(0<Jn){yr.pb[Jn]=yr.pb[0];continue}ei=Nr}var Yn=yr.pb[Jn];Yn.Sc[0]=xu[Ts(ei+fn,127)],Yn.Sc[1]=oc[Ts(ei+0,127)],Yn.Eb[0]=2*xu[Ts(ei+Xr,127)],Yn.Eb[1]=101581*oc[Ts(ei+Cn,127)]>>16,8>Yn.Eb[1]&&(Yn.Eb[1]=8),Yn.Qc[0]=xu[Ts(ei+Pn,117)],Yn.Qc[1]=oc[Ts(ei+_n,127)],Yn.lc=ei+_n}if(!vn.Rb)return xo(yr,4,"Not a key frame.");for(br(mn),vn=yr.Pa,Nr=0;4>Nr;++Nr){for(fn=0;8>fn;++fn)for(Xr=0;3>Xr;++Xr)for(Cn=0;11>Cn;++Cn)Pn=_r(mn,tf[Nr][fn][Xr][Cn])?Qe(mn,8):xd[Nr][fn][Xr][Cn],vn.Wc[Nr][fn].Yb[Xr][Cn]=Pn;for(fn=0;17>fn;++fn)vn.Xc[Nr][fn]=vn.Wc[Nr][Xc[fn]]}return yr.kc=br(mn),yr.kc&&(yr.Bd=Qe(mn,8)),yr.cb=1}function Al(yr,Sr,Nr,Xr,fn,mn,vn){var Cn=Sr[fn].Yb[Nr];for(Nr=0;16>fn;++fn){if(!_r(yr,Cn[Nr+0]))return fn;for(;!_r(yr,Cn[Nr+1]);)if(Cn=Sr[++fn].Yb[0],Nr=0,fn==16)return 16;var _n=Sr[fn+1].Yb;if(_r(yr,Cn[Nr+2])){var Pn=yr,qn=0;if(_r(Pn,(ei=Cn)[(Jn=Nr)+3]))if(_r(Pn,ei[Jn+6])){for(Cn=0,Jn=2*(qn=_r(Pn,ei[Jn+8]))+(ei=_r(Pn,ei[Jn+9+qn])),qn=0,ei=Yc[Jn];ei[Cn];++Cn)qn+=qn+_r(Pn,ei[Cn]);qn+=3+(8<<Jn)}else _r(Pn,ei[Jn+7])?(qn=7+2*_r(Pn,165),qn+=_r(Pn,145)):qn=5+_r(Pn,159);else qn=_r(Pn,ei[Jn+4])?3+_r(Pn,ei[Jn+5]):2;Cn=_n[2]}else qn=1,Cn=_n[1];_n=vn+Zc[fn],0>(Pn=yr).b&&xr(Pn);var Jn,ei=Pn.b,Yn=(Jn=Pn.Ca>>1)-(Pn.I>>ei)>>31;--Pn.b,Pn.Ca+=Yn,Pn.Ca|=1,Pn.I-=(Jn+1&Yn)<<ei,mn[_n]=((qn^Yn)-Yn)*Xr[(0<fn)+0]}return 16}function Ga(yr){var Sr=yr.rb[yr.sb-1];Sr.la=0,Sr.Na=0,Se(yr.zc,0,0,yr.zc.length),yr.ja=0}function ml(yr,Sr){if(yr==null)return 0;if(Sr==null)return xo(yr,2,"NULL VP8Io parameter in VP8Decode().");if(!yr.cb&&!yc(yr,Sr))return 0;if(Ae(yr.cb),Sr.ac==null||Sr.ac(Sr)){Sr.ob&&(yr.L=0);var Nr=Nl[yr.L];if(yr.L==2?(yr.yb=0,yr.zb=0):(yr.yb=Sr.v-Nr>>4,yr.zb=Sr.j-Nr>>4,0>yr.yb&&(yr.yb=0),0>yr.zb&&(yr.zb=0)),yr.Va=Sr.o+15+Nr>>4,yr.Hb=Sr.va+15+Nr>>4,yr.Hb>yr.za&&(yr.Hb=yr.za),yr.Va>yr.Ub&&(yr.Va=yr.Ub),0<yr.L){var Xr=yr.ed;for(Nr=0;4>Nr;++Nr){var fn;if(yr.Qa.Cb){var mn=yr.Qa.Lb[Nr];yr.Qa.Fb||(mn+=Xr.Tb)}else mn=Xr.Tb;for(fn=0;1>=fn;++fn){var vn=yr.gd[Nr][fn],Cn=mn;if(Xr.Pc&&(Cn+=Xr.vd[0],fn&&(Cn+=Xr.od[0])),0<(Cn=0>Cn?0:63<Cn?63:Cn)){var _n=Cn;0<Xr.wb&&(_n=4<Xr.wb?_n>>2:_n>>1)>9-Xr.wb&&(_n=9-Xr.wb),1>_n&&(_n=1),vn.dd=_n,vn.tc=2*Cn+_n,vn.ld=40<=Cn?2:15<=Cn?1:0}else vn.tc=0;vn.La=fn}}}Nr=0}else xo(yr,6,"Frame setup failed"),Nr=yr.a;if(Nr=Nr==0){if(Nr){yr.$c=0,0<yr.Aa||(yr.Ic=Fa);e:{Nr=yr.Ic,Xr=4*(_n=yr.za);var Pn=32*_n,qn=_n+1,Jn=0<yr.L?_n*(0<yr.Aa?2:1):0,ei=(yr.Aa==2?2:1)*_n;if((vn=Xr+832+(fn=3*(16*Nr+Nl[yr.L])/2*Pn)+(mn=yr.Fa!=null&&0<yr.Fa.length?yr.Kc.c*yr.Kc.i:0))!=vn)Nr=0;else{if(vn>yr.Vb){if(yr.Vb=0,yr.Ec=Ce(vn),yr.Fc=0,yr.Ec==null){Nr=xo(yr,1,"no memory during frame initialization.");break e}yr.Vb=vn}vn=yr.Ec,Cn=yr.Fc,yr.Ac=vn,yr.Bc=Cn,Cn+=Xr,yr.Gd=_e(Pn,Wi),yr.Hd=0,yr.rb=_e(qn+1,eo),yr.sb=1,yr.wa=Jn?_e(Jn,Vi):null,yr.Y=0,yr.D.Nb=0,yr.D.wa=yr.wa,yr.D.Y=yr.Y,0<yr.Aa&&(yr.D.Y+=_n),Ae(!0),yr.oc=vn,yr.pc=Cn,Cn+=832,yr.ya=_e(ei,Di),yr.aa=0,yr.D.ya=yr.ya,yr.D.aa=yr.aa,yr.Aa==2&&(yr.D.aa+=_n),yr.R=16*_n,yr.B=8*_n,_n=(Pn=Nl[yr.L])*yr.R,Pn=Pn/2*yr.B,yr.sa=vn,yr.ta=Cn+_n,yr.qa=yr.sa,yr.ra=yr.ta+16*Nr*yr.R+Pn,yr.Ha=yr.qa,yr.Ia=yr.ra+8*Nr*yr.B+Pn,yr.$c=0,Cn+=fn,yr.mb=mn?vn:null,yr.nb=mn?Cn:null,Ae(Cn+mn<=yr.Fc+yr.Vb),Ga(yr),Se(yr.Ac,yr.Bc,0,Xr),Nr=1}}if(Nr){if(Sr.ka=0,Sr.y=yr.sa,Sr.O=yr.ta,Sr.f=yr.qa,Sr.N=yr.ra,Sr.ea=yr.Ha,Sr.Vd=yr.Ia,Sr.fa=yr.R,Sr.Rc=yr.B,Sr.F=null,Sr.J=0,!Zu){for(Nr=-255;255>=Nr;++Nr)Do[255+Nr]=0>Nr?-Nr:Nr;for(Nr=-1020;1020>=Nr;++Nr)pa[1020+Nr]=-128>Nr?-128:127<Nr?127:Nr;for(Nr=-112;112>=Nr;++Nr)gu[112+Nr]=-16>Nr?-16:15<Nr?15:Nr;for(Nr=-255;510>=Nr;++Nr)kl[255+Nr]=0>Nr?0:255<Nr?255:Nr;Zu=1}Au=co,Ba=Du,Ta=Va,rs=Qc,Ps=Wl,fo=Ou,Bl=tu,Yu=Ho,Tl=Cl,Pl=Gu,Ml=Ya,Ms=Za,Pa=Sl,ha=ru,Ma=Js,ka=Ds,ol=Ns,Yo=Ec,Hs[0]=ca,Hs[1]=xc,Hs[2]=bl,Hs[3]=ua,Hs[4]=qu,Hs[5]=Yl,Hs[6]=Wa,Hs[7]=Zl,Hs[8]=wc,Hs[9]=Xl,hs[0]=xl,hs[1]=bc,hs[2]=aa,hs[3]=yl,hs[4]=Io,hs[5]=la,hs[6]=Zs,ws[0]=Bs,ws[1]=Uu,ws[2]=Wc,ws[3]=Ea,ws[4]=wl,ws[5]=Jl,ws[6]=Hu,Nr=1}else Nr=0}Nr&&(Nr=function(Yn,Ai){for(Yn.M=0;Yn.M<Yn.Va;++Yn.M){var ai,Vn=Yn.Jc[Yn.M&Yn.Xb],Qn=Yn.m,ci=Yn;for(ai=0;ai<ci.za;++ai){var ui=Qn,fi=ci,Ii=fi.Ac,Ci=fi.Bc+4*ai,qi=fi.zc,Si=fi.ya[fi.aa+ai];if(fi.Qa.Bb?Si.$b=_r(ui,fi.Pa.jb[0])?2+_r(ui,fi.Pa.jb[2]):_r(ui,fi.Pa.jb[1]):Si.$b=0,fi.kc&&(Si.Ad=_r(ui,fi.Bd)),Si.Za=!_r(ui,145)+0,Si.Za){var lo=Si.Ob,uo=0;for(fi=0;4>fi;++fi){var ao,io=qi[0+fi];for(ao=0;4>ao;++ao){io=ef[Ii[Ci+ao]][io];for(var yo=yd[_r(ui,io[0])];0<yo;)yo=yd[2*yo+_r(ui,io[yo])];io=-yo,Ii[Ci+ao]=io}Ee(lo,uo,Ii,Ci,4),uo+=4,qi[0+fi]=io}}else io=_r(ui,156)?_r(ui,128)?1:3:_r(ui,163)?2:0,Si.Ob[0]=io,Se(Ii,Ci,io,4),Se(qi,0,io,4);Si.Dd=_r(ui,142)?_r(ui,114)?_r(ui,183)?1:3:2:0}if(ci.m.Ka)return xo(Yn,7,"Premature end-of-partition0 encountered.");for(;Yn.ja<Yn.za;++Yn.ja){if(ci=Vn,ui=(Qn=Yn).rb[Qn.sb-1],Ii=Qn.rb[Qn.sb+Qn.ja],ai=Qn.ya[Qn.aa+Qn.ja],Ci=Qn.kc?ai.Ad:0)ui.la=Ii.la=0,ai.Za||(ui.Na=Ii.Na=0),ai.Hc=0,ai.Gc=0,ai.ia=0;else{var wo,Yi;if(ui=Ii,Ii=ci,Ci=Qn.Pa.Xc,qi=Qn.ya[Qn.aa+Qn.ja],Si=Qn.pb[qi.$b],fi=qi.ad,lo=0,uo=Qn.rb[Qn.sb-1],io=ao=0,Se(fi,lo,0,384),qi.Za)var To=0,ps=Ci[3];else{yo=Ce(16);var $o=ui.Na+uo.Na;if($o=$l(Ii,Ci[1],$o,Si.Eb,0,yo,0),ui.Na=uo.Na=(0<$o)+0,1<$o)Au(yo,0,fi,lo);else{var zo=yo[0]+3>>3;for(yo=0;256>yo;yo+=16)fi[lo+yo]=zo}To=1,ps=Ci[0]}var po=15&ui.la,os=15&uo.la;for(yo=0;4>yo;++yo){var ss=1&os;for(zo=Yi=0;4>zo;++zo)po=po>>1|(ss=($o=$l(Ii,ps,$o=ss+(1&po),Si.Sc,To,fi,lo))>To)<<7,Yi=Yi<<2|(3<$o?3:1<$o?2:fi[lo+0]!=0),lo+=16;po>>=4,os=os>>1|ss<<7,ao=(ao<<8|Yi)>>>0}for(ps=po,To=os>>4,wo=0;4>wo;wo+=2){for(Yi=0,po=ui.la>>4+wo,os=uo.la>>4+wo,yo=0;2>yo;++yo){for(ss=1&os,zo=0;2>zo;++zo)$o=ss+(1&po),po=po>>1|(ss=0<($o=$l(Ii,Ci[2],$o,Si.Qc,0,fi,lo)))<<3,Yi=Yi<<2|(3<$o?3:1<$o?2:fi[lo+0]!=0),lo+=16;po>>=2,os=os>>1|ss<<5}io|=Yi<<4*wo,ps|=po<<4<<wo,To|=(240&os)<<wo}ui.la=ps,uo.la=To,qi.Hc=ao,qi.Gc=io,qi.ia=43690&io?0:Si.ia,Ci=!(ao|io)}if(0<Qn.L&&(Qn.wa[Qn.Y+Qn.ja]=Qn.gd[ai.$b][ai.Za],Qn.wa[Qn.Y+Qn.ja].La|=!Ci),ci.Ka)return xo(Yn,7,"Premature end-of-file encountered.")}if(Ga(Yn),Qn=Ai,ci=1,ai=(Vn=Yn).D,ui=0<Vn.L&&Vn.M>=Vn.zb&&Vn.M<=Vn.Va,Vn.Aa==0)e:{if(ai.M=Vn.M,ai.uc=ui,su(Vn,ai),ci=1,ai=(Yi=Vn.D).Nb,ui=(io=Nl[Vn.L])*Vn.R,Ii=io/2*Vn.B,yo=16*ai*Vn.R,zo=8*ai*Vn.B,Ci=Vn.sa,qi=Vn.ta-ui+yo,Si=Vn.qa,fi=Vn.ra-Ii+zo,lo=Vn.Ha,uo=Vn.Ia-Ii+zo,os=(po=Yi.M)==0,ao=po>=Vn.Va-1,Vn.Aa==2&&su(Vn,Yi),Yi.uc)for(ss=($o=Vn).D.M,Ae($o.D.uc),Yi=$o.yb;Yi<$o.Hb;++Yi){To=Yi,ps=ss;var Po=(Go=(Ao=$o).D).Nb;wo=Ao.R;var Go=Go.wa[Go.Y+To],Xo=Ao.sa,_s=Ao.ta+16*Po*wo+16*To,zs=Go.dd,Mo=Go.tc;if(Mo!=0)if(Ae(3<=Mo),Ao.L==1)0<To&&ka(Xo,_s,wo,Mo+4),Go.La&&Yo(Xo,_s,wo,Mo),0<ps&&Ma(Xo,_s,wo,Mo+4),Go.La&&ol(Xo,_s,wo,Mo);else{var No=Ao.B,ks=Ao.qa,cl=Ao.ra+8*Po*No+8*To,$a=Ao.Ha,Ao=Ao.Ia+8*Po*No+8*To;Po=Go.ld,0<To&&(Yu(Xo,_s,wo,Mo+4,zs,Po),Pl(ks,cl,$a,Ao,No,Mo+4,zs,Po)),Go.La&&(Ms(Xo,_s,wo,Mo,zs,Po),ha(ks,cl,$a,Ao,No,Mo,zs,Po)),0<ps&&(Bl(Xo,_s,wo,Mo+4,zs,Po),Tl(ks,cl,$a,Ao,No,Mo+4,zs,Po)),Go.La&&(Ml(Xo,_s,wo,Mo,zs,Po),Pa(ks,cl,$a,Ao,No,Mo,zs,Po))}}if(Vn.ia&&alert("todo:DitherRow"),Qn.put!=null){if(Yi=16*po,po=16*(po+1),os?(Qn.y=Vn.sa,Qn.O=Vn.ta+yo,Qn.f=Vn.qa,Qn.N=Vn.ra+zo,Qn.ea=Vn.Ha,Qn.W=Vn.Ia+zo):(Yi-=io,Qn.y=Ci,Qn.O=qi,Qn.f=Si,Qn.N=fi,Qn.ea=lo,Qn.W=uo),ao||(po-=io),po>Qn.o&&(po=Qn.o),Qn.F=null,Qn.J=null,Vn.Fa!=null&&0<Vn.Fa.length&&Yi<po&&(Qn.J=Qu(Vn,Qn,Yi,po-Yi),Qn.F=Vn.mb,Qn.F==null&&Qn.F.length==0)){ci=xo(Vn,3,"Could not decode alpha data.");break e}Yi<Qn.j&&(io=Qn.j-Yi,Yi=Qn.j,Ae(!(1&io)),Qn.O+=Vn.R*io,Qn.N+=Vn.B*(io>>1),Qn.W+=Vn.B*(io>>1),Qn.F!=null&&(Qn.J+=Qn.width*io)),Yi<po&&(Qn.O+=Qn.v,Qn.N+=Qn.v>>1,Qn.W+=Qn.v>>1,Qn.F!=null&&(Qn.J+=Qn.v),Qn.ka=Yi-Qn.j,Qn.U=Qn.va-Qn.v,Qn.T=po-Yi,ci=Qn.put(Qn))}ai+1!=Vn.Ic||ao||(Ee(Vn.sa,Vn.ta-ui,Ci,qi+16*Vn.R,ui),Ee(Vn.qa,Vn.ra-Ii,Si,fi+8*Vn.B,Ii),Ee(Vn.Ha,Vn.Ia-Ii,lo,uo+8*Vn.B,Ii))}if(!ci)return xo(Yn,6,"Output aborted.")}return 1}(yr,Sr)),Sr.bc!=null&&Sr.bc(Sr),Nr&=1}return Nr?(yr.cb=0,Nr):0}function vs(yr,Sr,Nr,Xr,fn){fn=yr[Sr+Nr+32*Xr]+(fn>>3),yr[Sr+Nr+32*Xr]=-256&fn?0>fn?0:255:fn}function Ql(yr,Sr,Nr,Xr,fn,mn){vs(yr,Sr,0,Nr,Xr+fn),vs(yr,Sr,1,Nr,Xr+mn),vs(yr,Sr,2,Nr,Xr-mn),vs(yr,Sr,3,Nr,Xr-fn)}function ys(yr){return(20091*yr>>16)+yr}function vl(yr,Sr,Nr,Xr){var fn,mn=0,vn=Ce(16);for(fn=0;4>fn;++fn){var Cn=yr[Sr+0]+yr[Sr+8],_n=yr[Sr+0]-yr[Sr+8],Pn=(35468*yr[Sr+4]>>16)-ys(yr[Sr+12]),qn=ys(yr[Sr+4])+(35468*yr[Sr+12]>>16);vn[mn+0]=Cn+qn,vn[mn+1]=_n+Pn,vn[mn+2]=_n-Pn,vn[mn+3]=Cn-qn,mn+=4,Sr++}for(fn=mn=0;4>fn;++fn)Cn=(yr=vn[mn+0]+4)+vn[mn+8],_n=yr-vn[mn+8],Pn=(35468*vn[mn+4]>>16)-ys(vn[mn+12]),vs(Nr,Xr,0,0,Cn+(qn=ys(vn[mn+4])+(35468*vn[mn+12]>>16))),vs(Nr,Xr,1,0,_n+Pn),vs(Nr,Xr,2,0,_n-Pn),vs(Nr,Xr,3,0,Cn-qn),mn++,Xr+=32}function Ou(yr,Sr,Nr,Xr){var fn=yr[Sr+0]+4,mn=35468*yr[Sr+4]>>16,vn=ys(yr[Sr+4]),Cn=35468*yr[Sr+1]>>16;Ql(Nr,Xr,0,fn+vn,yr=ys(yr[Sr+1]),Cn),Ql(Nr,Xr,1,fn+mn,yr,Cn),Ql(Nr,Xr,2,fn-mn,yr,Cn),Ql(Nr,Xr,3,fn-vn,yr,Cn)}function Du(yr,Sr,Nr,Xr,fn){vl(yr,Sr,Nr,Xr),fn&&vl(yr,Sr+16,Nr,Xr+4)}function Va(yr,Sr,Nr,Xr){Ba(yr,Sr+0,Nr,Xr,1),Ba(yr,Sr+32,Nr,Xr+128,1)}function Qc(yr,Sr,Nr,Xr){var fn;for(yr=yr[Sr+0]+4,fn=0;4>fn;++fn)for(Sr=0;4>Sr;++Sr)vs(Nr,Xr,Sr,fn,yr)}function Wl(yr,Sr,Nr,Xr){yr[Sr+0]&&rs(yr,Sr+0,Nr,Xr),yr[Sr+16]&&rs(yr,Sr+16,Nr,Xr+4),yr[Sr+32]&&rs(yr,Sr+32,Nr,Xr+128),yr[Sr+48]&&rs(yr,Sr+48,Nr,Xr+128+4)}function co(yr,Sr,Nr,Xr){var fn,mn=Ce(16);for(fn=0;4>fn;++fn){var vn=yr[Sr+0+fn]+yr[Sr+12+fn],Cn=yr[Sr+4+fn]+yr[Sr+8+fn],_n=yr[Sr+4+fn]-yr[Sr+8+fn],Pn=yr[Sr+0+fn]-yr[Sr+12+fn];mn[0+fn]=vn+Cn,mn[8+fn]=vn-Cn,mn[4+fn]=Pn+_n,mn[12+fn]=Pn-_n}for(fn=0;4>fn;++fn)vn=(yr=mn[0+4*fn]+3)+mn[3+4*fn],Cn=mn[1+4*fn]+mn[2+4*fn],_n=mn[1+4*fn]-mn[2+4*fn],Pn=yr-mn[3+4*fn],Nr[Xr+0]=vn+Cn>>3,Nr[Xr+16]=Pn+_n>>3,Nr[Xr+32]=vn-Cn>>3,Nr[Xr+48]=Pn-_n>>3,Xr+=64}function Kl(yr,Sr,Nr){var Xr,fn=Sr-32,mn=fs,vn=255-yr[fn-1];for(Xr=0;Xr<Nr;++Xr){var Cn,_n=mn,Pn=vn+yr[Sr-1];for(Cn=0;Cn<Nr;++Cn)yr[Sr+Cn]=_n[Pn+yr[fn+Cn]];Sr+=32}}function xc(yr,Sr){Kl(yr,Sr,4)}function Uu(yr,Sr){Kl(yr,Sr,8)}function bc(yr,Sr){Kl(yr,Sr,16)}function aa(yr,Sr){var Nr;for(Nr=0;16>Nr;++Nr)Ee(yr,Sr+32*Nr,yr,Sr-32,16)}function yl(yr,Sr){var Nr;for(Nr=16;0<Nr;--Nr)Se(yr,Sr,yr[Sr-1],16),Sr+=32}function Qa(yr,Sr,Nr){var Xr;for(Xr=0;16>Xr;++Xr)Se(Sr,Nr+32*Xr,yr,16)}function xl(yr,Sr){var Nr,Xr=16;for(Nr=0;16>Nr;++Nr)Xr+=yr[Sr-1+32*Nr]+yr[Sr+Nr-32];Qa(Xr>>5,yr,Sr)}function Io(yr,Sr){var Nr,Xr=8;for(Nr=0;16>Nr;++Nr)Xr+=yr[Sr-1+32*Nr];Qa(Xr>>4,yr,Sr)}function la(yr,Sr){var Nr,Xr=8;for(Nr=0;16>Nr;++Nr)Xr+=yr[Sr+Nr-32];Qa(Xr>>4,yr,Sr)}function Zs(yr,Sr){Qa(128,yr,Sr)}function Qi(yr,Sr,Nr){return yr+2*Sr+Nr+2>>2}function bl(yr,Sr){var Nr,Xr=Sr-32;for(Xr=new Uint8Array([Qi(yr[Xr-1],yr[Xr+0],yr[Xr+1]),Qi(yr[Xr+0],yr[Xr+1],yr[Xr+2]),Qi(yr[Xr+1],yr[Xr+2],yr[Xr+3]),Qi(yr[Xr+2],yr[Xr+3],yr[Xr+4])]),Nr=0;4>Nr;++Nr)Ee(yr,Sr+32*Nr,Xr,0,Xr.length)}function ua(yr,Sr){var Nr=yr[Sr-1],Xr=yr[Sr-1+32],fn=yr[Sr-1+64],mn=yr[Sr-1+96];$r(yr,Sr+0,16843009*Qi(yr[Sr-1-32],Nr,Xr)),$r(yr,Sr+32,16843009*Qi(Nr,Xr,fn)),$r(yr,Sr+64,16843009*Qi(Xr,fn,mn)),$r(yr,Sr+96,16843009*Qi(fn,mn,mn))}function ca(yr,Sr){var Nr,Xr=4;for(Nr=0;4>Nr;++Nr)Xr+=yr[Sr+Nr-32]+yr[Sr-1+32*Nr];for(Xr>>=3,Nr=0;4>Nr;++Nr)Se(yr,Sr+32*Nr,Xr,4)}function qu(yr,Sr){var Nr=yr[Sr-1+0],Xr=yr[Sr-1+32],fn=yr[Sr-1+64],mn=yr[Sr-1-32],vn=yr[Sr+0-32],Cn=yr[Sr+1-32],_n=yr[Sr+2-32],Pn=yr[Sr+3-32];yr[Sr+0+96]=Qi(Xr,fn,yr[Sr-1+96]),yr[Sr+1+96]=yr[Sr+0+64]=Qi(Nr,Xr,fn),yr[Sr+2+96]=yr[Sr+1+64]=yr[Sr+0+32]=Qi(mn,Nr,Xr),yr[Sr+3+96]=yr[Sr+2+64]=yr[Sr+1+32]=yr[Sr+0+0]=Qi(vn,mn,Nr),yr[Sr+3+64]=yr[Sr+2+32]=yr[Sr+1+0]=Qi(Cn,vn,mn),yr[Sr+3+32]=yr[Sr+2+0]=Qi(_n,Cn,vn),yr[Sr+3+0]=Qi(Pn,_n,Cn)}function Wa(yr,Sr){var Nr=yr[Sr+1-32],Xr=yr[Sr+2-32],fn=yr[Sr+3-32],mn=yr[Sr+4-32],vn=yr[Sr+5-32],Cn=yr[Sr+6-32],_n=yr[Sr+7-32];yr[Sr+0+0]=Qi(yr[Sr+0-32],Nr,Xr),yr[Sr+1+0]=yr[Sr+0+32]=Qi(Nr,Xr,fn),yr[Sr+2+0]=yr[Sr+1+32]=yr[Sr+0+64]=Qi(Xr,fn,mn),yr[Sr+3+0]=yr[Sr+2+32]=yr[Sr+1+64]=yr[Sr+0+96]=Qi(fn,mn,vn),yr[Sr+3+32]=yr[Sr+2+64]=yr[Sr+1+96]=Qi(mn,vn,Cn),yr[Sr+3+64]=yr[Sr+2+96]=Qi(vn,Cn,_n),yr[Sr+3+96]=Qi(Cn,_n,_n)}function Yl(yr,Sr){var Nr=yr[Sr-1+0],Xr=yr[Sr-1+32],fn=yr[Sr-1+64],mn=yr[Sr-1-32],vn=yr[Sr+0-32],Cn=yr[Sr+1-32],_n=yr[Sr+2-32],Pn=yr[Sr+3-32];yr[Sr+0+0]=yr[Sr+1+64]=mn+vn+1>>1,yr[Sr+1+0]=yr[Sr+2+64]=vn+Cn+1>>1,yr[Sr+2+0]=yr[Sr+3+64]=Cn+_n+1>>1,yr[Sr+3+0]=_n+Pn+1>>1,yr[Sr+0+96]=Qi(fn,Xr,Nr),yr[Sr+0+64]=Qi(Xr,Nr,mn),yr[Sr+0+32]=yr[Sr+1+96]=Qi(Nr,mn,vn),yr[Sr+1+32]=yr[Sr+2+96]=Qi(mn,vn,Cn),yr[Sr+2+32]=yr[Sr+3+96]=Qi(vn,Cn,_n),yr[Sr+3+32]=Qi(Cn,_n,Pn)}function Zl(yr,Sr){var Nr=yr[Sr+0-32],Xr=yr[Sr+1-32],fn=yr[Sr+2-32],mn=yr[Sr+3-32],vn=yr[Sr+4-32],Cn=yr[Sr+5-32],_n=yr[Sr+6-32],Pn=yr[Sr+7-32];yr[Sr+0+0]=Nr+Xr+1>>1,yr[Sr+1+0]=yr[Sr+0+64]=Xr+fn+1>>1,yr[Sr+2+0]=yr[Sr+1+64]=fn+mn+1>>1,yr[Sr+3+0]=yr[Sr+2+64]=mn+vn+1>>1,yr[Sr+0+32]=Qi(Nr,Xr,fn),yr[Sr+1+32]=yr[Sr+0+96]=Qi(Xr,fn,mn),yr[Sr+2+32]=yr[Sr+1+96]=Qi(fn,mn,vn),yr[Sr+3+32]=yr[Sr+2+96]=Qi(mn,vn,Cn),yr[Sr+3+64]=Qi(vn,Cn,_n),yr[Sr+3+96]=Qi(Cn,_n,Pn)}function Xl(yr,Sr){var Nr=yr[Sr-1+0],Xr=yr[Sr-1+32],fn=yr[Sr-1+64],mn=yr[Sr-1+96];yr[Sr+0+0]=Nr+Xr+1>>1,yr[Sr+2+0]=yr[Sr+0+32]=Xr+fn+1>>1,yr[Sr+2+32]=yr[Sr+0+64]=fn+mn+1>>1,yr[Sr+1+0]=Qi(Nr,Xr,fn),yr[Sr+3+0]=yr[Sr+1+32]=Qi(Xr,fn,mn),yr[Sr+3+32]=yr[Sr+1+64]=Qi(fn,mn,mn),yr[Sr+3+64]=yr[Sr+2+64]=yr[Sr+0+96]=yr[Sr+1+96]=yr[Sr+2+96]=yr[Sr+3+96]=mn}function wc(yr,Sr){var Nr=yr[Sr-1+0],Xr=yr[Sr-1+32],fn=yr[Sr-1+64],mn=yr[Sr-1+96],vn=yr[Sr-1-32],Cn=yr[Sr+0-32],_n=yr[Sr+1-32],Pn=yr[Sr+2-32];yr[Sr+0+0]=yr[Sr+2+32]=Nr+vn+1>>1,yr[Sr+0+32]=yr[Sr+2+64]=Xr+Nr+1>>1,yr[Sr+0+64]=yr[Sr+2+96]=fn+Xr+1>>1,yr[Sr+0+96]=mn+fn+1>>1,yr[Sr+3+0]=Qi(Cn,_n,Pn),yr[Sr+2+0]=Qi(vn,Cn,_n),yr[Sr+1+0]=yr[Sr+3+32]=Qi(Nr,vn,Cn),yr[Sr+1+32]=yr[Sr+3+64]=Qi(Xr,Nr,vn),yr[Sr+1+64]=yr[Sr+3+96]=Qi(fn,Xr,Nr),yr[Sr+1+96]=Qi(mn,fn,Xr)}function Wc(yr,Sr){var Nr;for(Nr=0;8>Nr;++Nr)Ee(yr,Sr+32*Nr,yr,Sr-32,8)}function Ea(yr,Sr){var Nr;for(Nr=0;8>Nr;++Nr)Se(yr,Sr,yr[Sr-1],8),Sr+=32}function Xs(yr,Sr,Nr){var Xr;for(Xr=0;8>Xr;++Xr)Se(Sr,Nr+32*Xr,yr,8)}function Bs(yr,Sr){var Nr,Xr=8;for(Nr=0;8>Nr;++Nr)Xr+=yr[Sr+Nr-32]+yr[Sr-1+32*Nr];Xs(Xr>>4,yr,Sr)}function Jl(yr,Sr){var Nr,Xr=4;for(Nr=0;8>Nr;++Nr)Xr+=yr[Sr+Nr-32];Xs(Xr>>3,yr,Sr)}function wl(yr,Sr){var Nr,Xr=4;for(Nr=0;8>Nr;++Nr)Xr+=yr[Sr-1+32*Nr];Xs(Xr>>3,yr,Sr)}function Hu(yr,Sr){Xs(128,yr,Sr)}function Ka(yr,Sr,Nr){var Xr=yr[Sr-Nr],fn=yr[Sr+0],mn=3*(fn-Xr)+Aa[1020+yr[Sr-2*Nr]-yr[Sr+Nr]],vn=vu[112+(mn+4>>3)];yr[Sr-Nr]=fs[255+Xr+vu[112+(mn+3>>3)]],yr[Sr+0]=fs[255+fn-vn]}function El(yr,Sr,Nr,Xr){var fn=yr[Sr+0],mn=yr[Sr+Nr];return qs[255+yr[Sr-2*Nr]-yr[Sr-Nr]]>Xr||qs[255+mn-fn]>Xr}function eu(yr,Sr,Nr,Xr){return 4*qs[255+yr[Sr-Nr]-yr[Sr+0]]+qs[255+yr[Sr-2*Nr]-yr[Sr+Nr]]<=Xr}function zu(yr,Sr,Nr,Xr,fn){var mn=yr[Sr-3*Nr],vn=yr[Sr-2*Nr],Cn=yr[Sr-Nr],_n=yr[Sr+0],Pn=yr[Sr+Nr],qn=yr[Sr+2*Nr],Jn=yr[Sr+3*Nr];return 4*qs[255+Cn-_n]+qs[255+vn-Pn]>Xr?0:qs[255+yr[Sr-4*Nr]-mn]<=fn&&qs[255+mn-vn]<=fn&&qs[255+vn-Cn]<=fn&&qs[255+Jn-qn]<=fn&&qs[255+qn-Pn]<=fn&&qs[255+Pn-_n]<=fn}function Js(yr,Sr,Nr,Xr){var fn=2*Xr+1;for(Xr=0;16>Xr;++Xr)eu(yr,Sr+Xr,Nr,fn)&&Ka(yr,Sr+Xr,Nr)}function Ds(yr,Sr,Nr,Xr){var fn=2*Xr+1;for(Xr=0;16>Xr;++Xr)eu(yr,Sr+Xr*Nr,1,fn)&&Ka(yr,Sr+Xr*Nr,1)}function Ns(yr,Sr,Nr,Xr){var fn;for(fn=3;0<fn;--fn)Js(yr,Sr+=4*Nr,Nr,Xr)}function Ec(yr,Sr,Nr,Xr){var fn;for(fn=3;0<fn;--fn)Ds(yr,Sr+=4,Nr,Xr)}function ea(yr,Sr,Nr,Xr,fn,mn,vn,Cn){for(mn=2*mn+1;0<fn--;){if(zu(yr,Sr,Nr,mn,vn))if(El(yr,Sr,Nr,Cn))Ka(yr,Sr,Nr);else{var _n=yr,Pn=Sr,qn=Nr,Jn=_n[Pn-2*qn],ei=_n[Pn-qn],Yn=_n[Pn+0],Ai=_n[Pn+qn],ai=_n[Pn+2*qn],Vn=27*(ci=Aa[1020+3*(Yn-ei)+Aa[1020+Jn-Ai]])+63>>7,Qn=18*ci+63>>7,ci=9*ci+63>>7;_n[Pn-3*qn]=fs[255+_n[Pn-3*qn]+ci],_n[Pn-2*qn]=fs[255+Jn+Qn],_n[Pn-qn]=fs[255+ei+Vn],_n[Pn+0]=fs[255+Yn-Vn],_n[Pn+qn]=fs[255+Ai-Qn],_n[Pn+2*qn]=fs[255+ai-ci]}Sr+=Xr}}function xs(yr,Sr,Nr,Xr,fn,mn,vn,Cn){for(mn=2*mn+1;0<fn--;){if(zu(yr,Sr,Nr,mn,vn))if(El(yr,Sr,Nr,Cn))Ka(yr,Sr,Nr);else{var _n=yr,Pn=Sr,qn=Nr,Jn=_n[Pn-qn],ei=_n[Pn+0],Yn=_n[Pn+qn],Ai=vu[112+((ai=3*(ei-Jn))+4>>3)],ai=vu[112+(ai+3>>3)],Vn=Ai+1>>1;_n[Pn-2*qn]=fs[255+_n[Pn-2*qn]+Vn],_n[Pn-qn]=fs[255+Jn+ai],_n[Pn+0]=fs[255+ei-Ai],_n[Pn+qn]=fs[255+Yn-Vn]}Sr+=Xr}}function tu(yr,Sr,Nr,Xr,fn,mn){ea(yr,Sr,Nr,1,16,Xr,fn,mn)}function Ho(yr,Sr,Nr,Xr,fn,mn){ea(yr,Sr,1,Nr,16,Xr,fn,mn)}function Ya(yr,Sr,Nr,Xr,fn,mn){var vn;for(vn=3;0<vn;--vn)xs(yr,Sr+=4*Nr,Nr,1,16,Xr,fn,mn)}function Za(yr,Sr,Nr,Xr,fn,mn){var vn;for(vn=3;0<vn;--vn)xs(yr,Sr+=4,1,Nr,16,Xr,fn,mn)}function Cl(yr,Sr,Nr,Xr,fn,mn,vn,Cn){ea(yr,Sr,fn,1,8,mn,vn,Cn),ea(Nr,Xr,fn,1,8,mn,vn,Cn)}function Gu(yr,Sr,Nr,Xr,fn,mn,vn,Cn){ea(yr,Sr,1,fn,8,mn,vn,Cn),ea(Nr,Xr,1,fn,8,mn,vn,Cn)}function Sl(yr,Sr,Nr,Xr,fn,mn,vn,Cn){xs(yr,Sr+4*fn,fn,1,8,mn,vn,Cn),xs(Nr,Xr+4*fn,fn,1,8,mn,vn,Cn)}function ru(yr,Sr,Nr,Xr,fn,mn,vn,Cn){xs(yr,Sr+4,1,fn,8,mn,vn,Cn),xs(Nr,Xr+4,1,fn,8,mn,vn,Cn)}function da(){this.ba=new Mn,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Yr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Xa(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function iu(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Cc(){this.ua=0,this.Wa=new Gr,this.vb=new Gr,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new De,this.yc=new Me}function Kc(){this.xb=this.a=0,this.l=new Ni,this.ca=new Mn,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new ir,this.Pb=0,this.wd=new ir,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Cc,this.ab=0,this.gc=_e(4,iu),this.Oc=0}function ou(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Ni,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Ca(yr,Sr,Nr,Xr,fn,mn,vn){for(yr=yr==null?0:yr[Sr+0],Sr=0;Sr<vn;++Sr)fn[mn+Sr]=yr+Nr[Xr+Sr]&255,yr=fn[mn+Sr]}function Vu(yr,Sr,Nr,Xr,fn,mn,vn){var Cn;if(yr==null)Ca(null,null,Nr,Xr,fn,mn,vn);else for(Cn=0;Cn<vn;++Cn)fn[mn+Cn]=yr[Sr+Cn]+Nr[Xr+Cn]&255}function Ja(yr,Sr,Nr,Xr,fn,mn,vn){if(yr==null)Ca(null,null,Nr,Xr,fn,mn,vn);else{var Cn,_n=yr[Sr+0],Pn=_n,qn=_n;for(Cn=0;Cn<vn;++Cn)Pn=qn+(_n=yr[Sr+Cn])-Pn,qn=Nr[Xr+Cn]+(-256&Pn?0>Pn?0:255:Pn)&255,Pn=_n,fn[mn+Cn]=qn}}function Qu(yr,Sr,Nr,Xr){var fn=Sr.width,mn=Sr.o;if(Ae(yr!=null&&Sr!=null),0>Nr||0>=Xr||Nr+Xr>mn)return null;if(!yr.Cc){if(yr.ga==null){var vn;if(yr.ga=new ou,(vn=yr.ga==null)||(vn=Sr.width*Sr.o,Ae(yr.Gb.length==0),yr.Gb=Ce(vn),yr.Uc=0,yr.Gb==null?vn=0:(yr.mb=yr.Gb,yr.nb=yr.Uc,yr.rc=null,vn=1),vn=!vn),!vn){vn=yr.ga;var Cn=yr.Fa,_n=yr.P,Pn=yr.qc,qn=yr.mb,Jn=yr.nb,ei=_n+1,Yn=Pn-1,Ai=vn.l;if(Ae(Cn!=null&&qn!=null&&Sr!=null),ns[0]=null,ns[1]=Ca,ns[2]=Vu,ns[3]=Ja,vn.ca=qn,vn.tb=Jn,vn.c=Sr.width,vn.i=Sr.height,Ae(0<vn.c&&0<vn.i),1>=Pn)Sr=0;else if(vn.$a=Cn[_n+0]>>0&3,vn.Z=Cn[_n+0]>>2&3,vn.Lc=Cn[_n+0]>>4&3,_n=Cn[_n+0]>>6&3,0>vn.$a||1<vn.$a||4<=vn.Z||1<vn.Lc||_n)Sr=0;else if(Ai.put=kr,Ai.ac=Nn,Ai.bc=Er,Ai.ma=vn,Ai.width=Sr.width,Ai.height=Sr.height,Ai.Da=Sr.Da,Ai.v=Sr.v,Ai.va=Sr.va,Ai.j=Sr.j,Ai.o=Sr.o,vn.$a)e:{Ae(vn.$a==1),Sr=Gn();t:for(;;){if(Sr==null){Sr=0;break e}if(Ae(vn!=null),vn.mc=Sr,Sr.c=vn.c,Sr.i=vn.i,Sr.l=vn.l,Sr.l.ma=vn,Sr.l.width=vn.c,Sr.l.height=vn.i,Sr.a=0,St(Sr.m,Cn,ei,Yn),!di(vn.c,vn.i,1,Sr,null)||(Sr.ab==1&&Sr.gc[0].hc==3&&$n(Sr.s)?(vn.ic=1,Cn=Sr.c*Sr.i,Sr.Ta=null,Sr.Ua=0,Sr.V=Ce(Cn),Sr.Ba=0,Sr.V==null?(Sr.a=1,Sr=0):Sr=1):(vn.ic=0,Sr=hi(Sr,vn.c)),!Sr))break t;Sr=1;break e}vn.mc=null,Sr=0}else Sr=Yn>=vn.c*vn.i;vn=!Sr}if(vn)return null;yr.ga.Lc!=1?yr.Ga=0:Xr=mn-Nr}Ae(yr.ga!=null),Ae(Nr+Xr<=mn);e:{if(Sr=(Cn=yr.ga).c,mn=Cn.l.o,Cn.$a==0){if(ei=yr.rc,Yn=yr.Vc,Ai=yr.Fa,_n=yr.P+1+Nr*Sr,Pn=yr.mb,qn=yr.nb+Nr*Sr,Ae(_n<=yr.P+yr.qc),Cn.Z!=0)for(Ae(ns[Cn.Z]!=null),vn=0;vn<Xr;++vn)ns[Cn.Z](ei,Yn,Ai,_n,Pn,qn,Sr),ei=Pn,Yn=qn,qn+=Sr,_n+=Sr;else for(vn=0;vn<Xr;++vn)Ee(Pn,qn,Ai,_n,Sr),ei=Pn,Yn=qn,qn+=Sr,_n+=Sr;yr.rc=ei,yr.Vc=Yn}else{if(Ae(Cn.mc!=null),Sr=Nr+Xr,Ae((vn=Cn.mc)!=null),Ae(Sr<=vn.i),vn.C>=Sr)Sr=1;else if(Cn.ic||Xn(),Cn.ic){Cn=vn.V,ei=vn.Ba,Yn=vn.c;var ai=vn.i,Vn=(Ai=1,_n=vn.$/Yn,Pn=vn.$%Yn,qn=vn.m,Jn=vn.s,vn.$),Qn=Yn*ai,ci=Yn*Sr,ui=Jn.wc,fi=Vn<ci?Tn(Jn,Pn,_n):null;Ae(Vn<=Qn),Ae(Sr<=ai),Ae($n(Jn));t:for(;;){for(;!qn.h&&Vn<ci;){if(Pn&ui||(fi=Tn(Jn,Pn,_n)),Ae(fi!=null),vr(qn),256>(ai=xn(fi.G[0],fi.H[0],qn)))Cn[ei+Vn]=ai,++Vn,++Pn>=Yn&&(Pn=0,++_n<=Sr&&!(_n%16)&&Dn(vn,_n));else{if(!(280>ai)){Ai=0;break t}ai=Qr(ai-256,qn);var Ii,Ci=xn(fi.G[4],fi.H[4],qn);if(vr(qn),!(Vn>=(Ci=Zr(Yn,Ci=Qr(Ci,qn)))&&Qn-Vn>=ai)){Ai=0;break t}for(Ii=0;Ii<ai;++Ii)Cn[ei+Vn+Ii]=Cn[ei+Vn+Ii-Ci];for(Vn+=ai,Pn+=ai;Pn>=Yn;)Pn-=Yn,++_n<=Sr&&!(_n%16)&&Dn(vn,_n);Vn<ci&&Pn&ui&&(fi=Tn(Jn,Pn,_n))}Ae(qn.h==fr(qn))}Dn(vn,_n>Sr?Sr:_n);break t}!Ai||qn.h&&Vn<Qn?(Ai=0,vn.a=qn.h?5:3):vn.$=Vn,Sr=Ai}else Sr=Wn(vn,vn.V,vn.Ba,vn.c,vn.i,Sr,Ei);if(!Sr){Xr=0;break e}}Nr+Xr>=mn&&(yr.Cc=1),Xr=1}if(!Xr)return null;if(yr.Cc&&((Xr=yr.ga)!=null&&(Xr.mc=null),yr.ga=null,0<yr.Ga))return alert("todo:WebPDequantizeLevels"),null}return yr.nb+Nr*fn}function jr(yr,Sr,Nr,Xr,fn,mn){for(;0<fn--;){var vn,Cn=yr,_n=Sr+(Nr?1:0),Pn=yr,qn=Sr+(Nr?0:3);for(vn=0;vn<Xr;++vn){var Jn=Pn[qn+4*vn];Jn!=255&&(Jn*=32897,Cn[_n+4*vn+0]=Cn[_n+4*vn+0]*Jn>>23,Cn[_n+4*vn+1]=Cn[_n+4*vn+1]*Jn>>23,Cn[_n+4*vn+2]=Cn[_n+4*vn+2]*Jn>>23)}Sr+=mn}}function hn(yr,Sr,Nr,Xr,fn){for(;0<Xr--;){var mn;for(mn=0;mn<Nr;++mn){var vn=yr[Sr+2*mn+0],Cn=15&(Pn=yr[Sr+2*mn+1]),_n=4369*Cn,Pn=(240&Pn|Pn>>4)*_n>>16;yr[Sr+2*mn+0]=(240&vn|vn>>4)*_n>>16&240|(15&vn|vn<<4)*_n>>16>>4&15,yr[Sr+2*mn+1]=240&Pn|Cn}Sr+=fn}}function kn(yr,Sr,Nr,Xr,fn,mn,vn,Cn){var _n,Pn,qn=255;for(Pn=0;Pn<fn;++Pn){for(_n=0;_n<Xr;++_n){var Jn=yr[Sr+_n];mn[vn+4*_n]=Jn,qn&=Jn}Sr+=Nr,vn+=Cn}return qn!=255}function Un(yr,Sr,Nr,Xr,fn){var mn;for(mn=0;mn<fn;++mn)Nr[Xr+mn]=yr[Sr+mn]>>8}function Xn(){bs=jr,Eo=hn,go=kn,Fo=Un}function li(yr,Sr,Nr){dr[yr]=function(Xr,fn,mn,vn,Cn,_n,Pn,qn,Jn,ei,Yn,Ai,ai,Vn,Qn,ci,ui){var fi,Ii=ui-1>>1,Ci=Cn[_n+0]|Pn[qn+0]<<16,qi=Jn[ei+0]|Yn[Ai+0]<<16;Ae(Xr!=null);var Si=3*Ci+qi+131074>>2;for(Sr(Xr[fn+0],255&Si,Si>>16,ai,Vn),mn!=null&&(Si=3*qi+Ci+131074>>2,Sr(mn[vn+0],255&Si,Si>>16,Qn,ci)),fi=1;fi<=Ii;++fi){var lo=Cn[_n+fi]|Pn[qn+fi]<<16,uo=Jn[ei+fi]|Yn[Ai+fi]<<16,ao=Ci+lo+qi+uo+524296,io=ao+2*(lo+qi)>>3;Si=io+Ci>>1,Ci=(ao=ao+2*(Ci+uo)>>3)+lo>>1,Sr(Xr[fn+2*fi-1],255&Si,Si>>16,ai,Vn+(2*fi-1)*Nr),Sr(Xr[fn+2*fi-0],255&Ci,Ci>>16,ai,Vn+(2*fi-0)*Nr),mn!=null&&(Si=ao+qi>>1,Ci=io+uo>>1,Sr(mn[vn+2*fi-1],255&Si,Si>>16,Qn,ci+(2*fi-1)*Nr),Sr(mn[vn+2*fi+0],255&Ci,Ci>>16,Qn,ci+(2*fi+0)*Nr)),Ci=lo,qi=uo}1&ui||(Si=3*Ci+qi+131074>>2,Sr(Xr[fn+ui-1],255&Si,Si>>16,ai,Vn+(ui-1)*Nr),mn!=null&&(Si=3*qi+Ci+131074>>2,Sr(mn[vn+ui-1],255&Si,Si>>16,Qn,ci+(ui-1)*Nr)))}}function mi(){Es[Rc]=rf,Es[sl]=al,Es[md]=nf,Es[Xu]=wu,Es[Ju]=Ol,Es[Co]=uc,Es[Ic]=Jc,Es[yu]=al,Es[jl]=wu,Es[tc]=Ol,Es[rc]=uc}function Ri(yr){return yr&-16384?0>yr?0:255:yr>>ul}function Ui(yr,Sr){return Ri((19077*yr>>8)+(26149*Sr>>8)-14234)}function ro(yr,Sr,Nr){return Ri((19077*yr>>8)-(6419*Sr>>8)-(13320*Nr>>8)+8708)}function Ji(yr,Sr){return Ri((19077*yr>>8)+(33050*Sr>>8)-17685)}function so(yr,Sr,Nr,Xr,fn){Xr[fn+0]=Ui(yr,Nr),Xr[fn+1]=ro(yr,Sr,Nr),Xr[fn+2]=Ji(yr,Sr)}function Bo(yr,Sr,Nr,Xr,fn){Xr[fn+0]=Ji(yr,Sr),Xr[fn+1]=ro(yr,Sr,Nr),Xr[fn+2]=Ui(yr,Nr)}function ko(yr,Sr,Nr,Xr,fn){var mn=ro(yr,Sr,Nr);Sr=mn<<3&224|Ji(yr,Sr)>>3,Xr[fn+0]=248&Ui(yr,Nr)|mn>>5,Xr[fn+1]=Sr}function Oo(yr,Sr,Nr,Xr,fn){var mn=240&Ji(yr,Sr)|15;Xr[fn+0]=240&Ui(yr,Nr)|ro(yr,Sr,Nr)>>4,Xr[fn+1]=mn}function es(yr,Sr,Nr,Xr,fn){Xr[fn+0]=255,so(yr,Sr,Nr,Xr,fn+1)}function Wo(yr,Sr,Nr,Xr,fn){Bo(yr,Sr,Nr,Xr,fn),Xr[fn+3]=255}function ta(yr,Sr,Nr,Xr,fn){so(yr,Sr,Nr,Xr,fn),Xr[fn+3]=255}function Ts(yr,Sr){return 0>yr?0:yr>Sr?Sr:yr}function Us(yr,Sr,Nr){dr[yr]=function(Xr,fn,mn,vn,Cn,_n,Pn,qn,Jn){for(var ei=qn+(-2&Jn)*Nr;qn!=ei;)Sr(Xr[fn+0],mn[vn+0],Cn[_n+0],Pn,qn),Sr(Xr[fn+1],mn[vn+0],Cn[_n+0],Pn,qn+Nr),fn+=2,++vn,++_n,qn+=2*Nr;1&Jn&&Sr(Xr[fn+0],mn[vn+0],Cn[_n+0],Pn,qn)}}function tl(yr,Sr,Nr){return Nr==0?yr==0?Sr==0?6:5:Sr==0?4:0:Nr}function Wu(yr,Sr,Nr,Xr,fn){switch(yr>>>30){case 3:Ba(Sr,Nr,Xr,fn,0);break;case 2:fo(Sr,Nr,Xr,fn);break;case 1:rs(Sr,Nr,Xr,fn)}}function su(yr,Sr){var Nr,Xr,fn=Sr.M,mn=Sr.Nb,vn=yr.oc,Cn=yr.pc+40,_n=yr.oc,Pn=yr.pc+584,qn=yr.oc,Jn=yr.pc+600;for(Nr=0;16>Nr;++Nr)vn[Cn+32*Nr-1]=129;for(Nr=0;8>Nr;++Nr)_n[Pn+32*Nr-1]=129,qn[Jn+32*Nr-1]=129;for(0<fn?vn[Cn-1-32]=_n[Pn-1-32]=qn[Jn-1-32]=129:(Se(vn,Cn-32-1,127,21),Se(_n,Pn-32-1,127,9),Se(qn,Jn-32-1,127,9)),Xr=0;Xr<yr.za;++Xr){var ei=Sr.ya[Sr.aa+Xr];if(0<Xr){for(Nr=-1;16>Nr;++Nr)Ee(vn,Cn+32*Nr-4,vn,Cn+32*Nr+12,4);for(Nr=-1;8>Nr;++Nr)Ee(_n,Pn+32*Nr-4,_n,Pn+32*Nr+4,4),Ee(qn,Jn+32*Nr-4,qn,Jn+32*Nr+4,4)}var Yn=yr.Gd,Ai=yr.Hd+Xr,ai=ei.ad,Vn=ei.Hc;if(0<fn&&(Ee(vn,Cn-32,Yn[Ai].y,0,16),Ee(_n,Pn-32,Yn[Ai].f,0,8),Ee(qn,Jn-32,Yn[Ai].ea,0,8)),ei.Za){var Qn=vn,ci=Cn-32+16;for(0<fn&&(Xr>=yr.za-1?Se(Qn,ci,Yn[Ai].y[15],4):Ee(Qn,ci,Yn[Ai+1].y,0,4)),Nr=0;4>Nr;Nr++)Qn[ci+128+Nr]=Qn[ci+256+Nr]=Qn[ci+384+Nr]=Qn[ci+0+Nr];for(Nr=0;16>Nr;++Nr,Vn<<=2)Qn=vn,ci=Cn+ed[Nr],Hs[ei.Ob[Nr]](Qn,ci),Wu(Vn,ai,16*+Nr,Qn,ci)}else if(Qn=tl(Xr,fn,ei.Ob[0]),hs[Qn](vn,Cn),Vn!=0)for(Nr=0;16>Nr;++Nr,Vn<<=2)Wu(Vn,ai,16*+Nr,vn,Cn+ed[Nr]);for(Nr=ei.Gc,Qn=tl(Xr,fn,ei.Dd),ws[Qn](_n,Pn),ws[Qn](qn,Jn),Vn=ai,Qn=_n,ci=Pn,255&(ei=Nr>>0)&&(170&ei?Ta(Vn,256,Qn,ci):Ps(Vn,256,Qn,ci)),ei=qn,Vn=Jn,255&(Nr>>=8)&&(170&Nr?Ta(ai,320,ei,Vn):Ps(ai,320,ei,Vn)),fn<yr.Ub-1&&(Ee(Yn[Ai].y,0,vn,Cn+480,16),Ee(Yn[Ai].f,0,_n,Pn+224,8),Ee(Yn[Ai].ea,0,qn,Jn+224,8)),Nr=8*mn*yr.B,Yn=yr.sa,Ai=yr.ta+16*Xr+16*mn*yr.R,ai=yr.qa,ei=yr.ra+8*Xr+Nr,Vn=yr.Ha,Qn=yr.Ia+8*Xr+Nr,Nr=0;16>Nr;++Nr)Ee(Yn,Ai+Nr*yr.R,vn,Cn+32*Nr,16);for(Nr=0;8>Nr;++Nr)Ee(ai,ei+Nr*yr.B,_n,Pn+32*Nr,8),Ee(Vn,Qn+Nr*yr.B,qn,Jn+32*Nr,8)}}function _l(yr,Sr,Nr,Xr,fn,mn,vn,Cn,_n){var Pn=[0],qn=[0],Jn=0,ei=_n!=null?_n.kd:0,Yn=_n??new Xa;if(yr==null||12>Nr)return 7;Yn.data=yr,Yn.w=Sr,Yn.ha=Nr,Sr=[Sr],Nr=[Nr],Yn.gb=[Yn.gb];e:{var Ai=Sr,ai=Nr,Vn=Yn.gb;if(Ae(yr!=null),Ae(ai!=null),Ae(Vn!=null),Vn[0]=0,12<=ai[0]&&!xe(yr,Ai[0],"RIFF")){if(xe(yr,Ai[0]+8,"WEBP")){Vn=3;break e}var Qn=zr(yr,Ai[0]+4);if(12>Qn||4294967286<Qn){Vn=3;break e}if(ei&&Qn>ai[0]-8){Vn=7;break e}Vn[0]=Qn,Ai[0]+=12,ai[0]-=12}Vn=0}if(Vn!=0)return Vn;for(Qn=0<Yn.gb[0],Nr=Nr[0];;){e:{var ci=yr;ai=Sr,Vn=Nr;var ui=Pn,fi=qn,Ii=Ai=[0];if((Si=Jn=[Jn])[0]=0,8>Vn[0])Vn=7;else{if(!xe(ci,ai[0],"VP8X")){if(zr(ci,ai[0]+4)!=10){Vn=3;break e}if(18>Vn[0]){Vn=7;break e}var Ci=zr(ci,ai[0]+8),qi=1+Ir(ci,ai[0]+12);if(2147483648<=qi*(ci=1+Ir(ci,ai[0]+15))){Vn=3;break e}Ii!=null&&(Ii[0]=Ci),ui!=null&&(ui[0]=qi),fi!=null&&(fi[0]=ci),ai[0]+=18,Vn[0]-=18,Si[0]=1}Vn=0}}if(Jn=Jn[0],Ai=Ai[0],Vn!=0)return Vn;if(ai=!!(2&Ai),!Qn&&Jn)return 3;if(mn!=null&&(mn[0]=!!(16&Ai)),vn!=null&&(vn[0]=ai),Cn!=null&&(Cn[0]=0),vn=Pn[0],Ai=qn[0],Jn&&ai&&_n==null){Vn=0;break}if(4>Nr){Vn=7;break}if(Qn&&Jn||!Qn&&!Jn&&!xe(yr,Sr[0],"ALPH")){Nr=[Nr],Yn.na=[Yn.na],Yn.P=[Yn.P],Yn.Sa=[Yn.Sa];e:{Ci=yr,Vn=Sr,Qn=Nr;var Si=Yn.gb;ui=Yn.na,fi=Yn.P,Ii=Yn.Sa,qi=22,Ae(Ci!=null),Ae(Qn!=null),ci=Vn[0];var lo=Qn[0];for(Ae(ui!=null),Ae(Ii!=null),ui[0]=null,fi[0]=null,Ii[0]=0;;){if(Vn[0]=ci,Qn[0]=lo,8>lo){Vn=7;break e}var uo=zr(Ci,ci+4);if(4294967286<uo){Vn=3;break e}var ao=8+uo+1&-2;if(qi+=ao,0<Si&&qi>Si){Vn=3;break e}if(!xe(Ci,ci,"VP8 ")||!xe(Ci,ci,"VP8L")){Vn=0;break e}if(lo[0]<ao){Vn=7;break e}xe(Ci,ci,"ALPH")||(ui[0]=Ci,fi[0]=ci+8,Ii[0]=uo),ci+=ao,lo-=ao}}if(Nr=Nr[0],Yn.na=Yn.na[0],Yn.P=Yn.P[0],Yn.Sa=Yn.Sa[0],Vn!=0)break}Nr=[Nr],Yn.Ja=[Yn.Ja],Yn.xa=[Yn.xa];e:if(Si=yr,Vn=Sr,Qn=Nr,ui=Yn.gb[0],fi=Yn.Ja,Ii=Yn.xa,Ci=Vn[0],ci=!xe(Si,Ci,"VP8 "),qi=!xe(Si,Ci,"VP8L"),Ae(Si!=null),Ae(Qn!=null),Ae(fi!=null),Ae(Ii!=null),8>Qn[0])Vn=7;else{if(ci||qi){if(Si=zr(Si,Ci+4),12<=ui&&Si>ui-12){Vn=3;break e}if(ei&&Si>Qn[0]-8){Vn=7;break e}fi[0]=Si,Vn[0]+=8,Qn[0]-=8,Ii[0]=qi}else Ii[0]=5<=Qn[0]&&Si[Ci+0]==47&&!(Si[Ci+4]>>5),fi[0]=Qn[0];Vn=0}if(Nr=Nr[0],Yn.Ja=Yn.Ja[0],Yn.xa=Yn.xa[0],Sr=Sr[0],Vn!=0)break;if(4294967286<Yn.Ja)return 3;if(Cn==null||ai||(Cn[0]=Yn.xa?2:1),vn=[vn],Ai=[Ai],Yn.xa){if(5>Nr){Vn=7;break}Cn=vn,ei=Ai,ai=mn,yr==null||5>Nr?yr=0:5<=Nr&&yr[Sr+0]==47&&!(yr[Sr+4]>>5)?(Qn=[0],Si=[0],ui=[0],St(fi=new ir,yr,Sr,Nr),Tr(fi,Qn,Si,ui)?(Cn!=null&&(Cn[0]=Qn[0]),ei!=null&&(ei[0]=Si[0]),ai!=null&&(ai[0]=ui[0]),yr=1):yr=0):yr=0}else{if(10>Nr){Vn=7;break}Cn=Ai,yr==null||10>Nr||!Vl(yr,Sr+3,Nr-3)?yr=0:(ei=yr[Sr+0]|yr[Sr+1]<<8|yr[Sr+2]<<16,ai=16383&(yr[Sr+7]<<8|yr[Sr+6]),yr=16383&(yr[Sr+9]<<8|yr[Sr+8]),1&ei||3<(ei>>1&7)||!(ei>>4&1)||ei>>5>=Yn.Ja||!ai||!yr?yr=0:(vn&&(vn[0]=ai),Cn&&(Cn[0]=yr),yr=1))}if(!yr||(vn=vn[0],Ai=Ai[0],Jn&&(Pn[0]!=vn||qn[0]!=Ai)))return 3;_n!=null&&(_n[0]=Yn,_n.offset=Sr-_n.w,Ae(4294967286>Sr-_n.w),Ae(_n.offset==_n.ha-Nr));break}return Vn==0||Vn==7&&Jn&&_n==null?(mn!=null&&(mn[0]|=Yn.na!=null&&0<Yn.na.length),Xr!=null&&(Xr[0]=vn),fn!=null&&(fn[0]=Ai),0):Vn}function au(yr,Sr,Nr){var Xr=Sr.width,fn=Sr.height,mn=0,vn=0,Cn=Xr,_n=fn;if(Sr.Da=yr!=null&&0<yr.Da,Sr.Da&&(Cn=yr.cd,_n=yr.bd,mn=yr.v,vn=yr.j,11>Nr||(mn&=-2,vn&=-2),0>mn||0>vn||0>=Cn||0>=_n||mn+Cn>Xr||vn+_n>fn))return 0;if(Sr.v=mn,Sr.j=vn,Sr.va=mn+Cn,Sr.o=vn+_n,Sr.U=Cn,Sr.T=_n,Sr.da=yr!=null&&0<yr.da,Sr.da){if(!wn(Cn,_n,Nr=[yr.ib],mn=[yr.hb]))return 0;Sr.ib=Nr[0],Sr.hb=mn[0]}return Sr.ob=yr!=null&&yr.ob,Sr.Kb=yr==null||!yr.Sd,Sr.da&&(Sr.ob=Sr.ib<3*Xr/4&&Sr.hb<3*fn/4,Sr.Kb=0),1}function lu(yr){if(yr==null)return 2;if(11>yr.S){var Sr=yr.f.RGBA;Sr.fb+=(yr.height-1)*Sr.A,Sr.A=-Sr.A}else Sr=yr.f.kb,yr=yr.height,Sr.O+=(yr-1)*Sr.fa,Sr.fa=-Sr.fa,Sr.N+=(yr-1>>1)*Sr.Ab,Sr.Ab=-Sr.Ab,Sr.W+=(yr-1>>1)*Sr.Db,Sr.Db=-Sr.Db,Sr.F!=null&&(Sr.J+=(yr-1)*Sr.lb,Sr.lb=-Sr.lb);return 0}function Rl(yr,Sr,Nr,Xr){if(Xr==null||0>=yr||0>=Sr)return 2;if(Nr!=null){if(Nr.Da){var fn=Nr.cd,mn=Nr.bd,vn=-2&Nr.v,Cn=-2&Nr.j;if(0>vn||0>Cn||0>=fn||0>=mn||vn+fn>yr||Cn+mn>Sr)return 2;yr=fn,Sr=mn}if(Nr.da){if(!wn(yr,Sr,fn=[Nr.ib],mn=[Nr.hb]))return 2;yr=fn[0],Sr=mn[0]}}Xr.width=yr,Xr.height=Sr;e:{var _n=Xr.width,Pn=Xr.height;if(yr=Xr.S,0>=_n||0>=Pn||!(yr>=Rc&&13>yr))yr=2;else{if(0>=Xr.Rd&&Xr.sd==null){vn=mn=fn=Sr=0;var qn=(Cn=_n*cc[yr])*Pn;if(11>yr||(mn=(Pn+1)/2*(Sr=(_n+1)/2),yr==12&&(vn=(fn=_n)*Pn)),(Pn=Ce(qn+2*mn+vn))==null){yr=1;break e}Xr.sd=Pn,11>yr?((_n=Xr.f.RGBA).eb=Pn,_n.fb=0,_n.A=Cn,_n.size=qn):((_n=Xr.f.kb).y=Pn,_n.O=0,_n.fa=Cn,_n.Fd=qn,_n.f=Pn,_n.N=0+qn,_n.Ab=Sr,_n.Cd=mn,_n.ea=Pn,_n.W=0+qn+mn,_n.Db=Sr,_n.Ed=mn,yr==12&&(_n.F=Pn,_n.J=0+qn+2*mn),_n.Tc=vn,_n.lb=fn)}if(Sr=1,fn=Xr.S,mn=Xr.width,vn=Xr.height,fn>=Rc&&13>fn)if(11>fn)yr=Xr.f.RGBA,Sr&=(Cn=Math.abs(yr.A))*(vn-1)+mn<=yr.size,Sr&=Cn>=mn*cc[fn],Sr&=yr.eb!=null;else{yr=Xr.f.kb,Cn=(mn+1)/2,qn=(vn+1)/2,_n=Math.abs(yr.fa),Pn=Math.abs(yr.Ab);var Jn=Math.abs(yr.Db),ei=Math.abs(yr.lb),Yn=ei*(vn-1)+mn;Sr&=_n*(vn-1)+mn<=yr.Fd,Sr&=Pn*(qn-1)+Cn<=yr.Cd,Sr=(Sr&=Jn*(qn-1)+Cn<=yr.Ed)&_n>=mn&Pn>=Cn&Jn>=Cn,Sr&=yr.y!=null,Sr&=yr.f!=null,Sr&=yr.ea!=null,fn==12&&(Sr&=ei>=mn,Sr&=Yn<=yr.Tc,Sr&=yr.F!=null)}else Sr=0;yr=Sr?0:2}}return yr!=0||Nr!=null&&Nr.fd&&(yr=lu(Xr)),yr}var jo=64,uu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],cu=24,du=32,fu=8,us=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Rn("Predictor0","PredictorAdd0"),dr.Predictor0=function(){return 4278190080},dr.Predictor1=function(yr){return yr},dr.Predictor2=function(yr,Sr,Nr){return Sr[Nr+0]},dr.Predictor3=function(yr,Sr,Nr){return Sr[Nr+1]},dr.Predictor4=function(yr,Sr,Nr){return Sr[Nr-1]},dr.Predictor5=function(yr,Sr,Nr){return sn(sn(yr,Sr[Nr+1]),Sr[Nr+0])},dr.Predictor6=function(yr,Sr,Nr){return sn(yr,Sr[Nr-1])},dr.Predictor7=function(yr,Sr,Nr){return sn(yr,Sr[Nr+0])},dr.Predictor8=function(yr,Sr,Nr){return sn(Sr[Nr-1],Sr[Nr+0])},dr.Predictor9=function(yr,Sr,Nr){return sn(Sr[Nr+0],Sr[Nr+1])},dr.Predictor10=function(yr,Sr,Nr){return sn(sn(yr,Sr[Nr-1]),sn(Sr[Nr+0],Sr[Nr+1]))},dr.Predictor11=function(yr,Sr,Nr){var Xr=Sr[Nr+0];return 0>=Jr(Xr>>24&255,yr>>24&255,(Sr=Sr[Nr-1])>>24&255)+Jr(Xr>>16&255,yr>>16&255,Sr>>16&255)+Jr(Xr>>8&255,yr>>8&255,Sr>>8&255)+Jr(255&Xr,255&yr,255&Sr)?Xr:yr},dr.Predictor12=function(yr,Sr,Nr){var Xr=Sr[Nr+0];return(jn((yr>>24&255)+(Xr>>24&255)-((Sr=Sr[Nr-1])>>24&255))<<24|jn((yr>>16&255)+(Xr>>16&255)-(Sr>>16&255))<<16|jn((yr>>8&255)+(Xr>>8&255)-(Sr>>8&255))<<8|jn((255&yr)+(255&Xr)-(255&Sr)))>>>0},dr.Predictor13=function(yr,Sr,Nr){var Xr=Sr[Nr-1];return(en((yr=sn(yr,Sr[Nr+0]))>>24&255,Xr>>24&255)<<24|en(yr>>16&255,Xr>>16&255)<<16|en(yr>>8&255,Xr>>8&255)<<8|en(yr>>0&255,Xr>>0&255))>>>0};var Il=dr.PredictorAdd0;dr.PredictorAdd1=nn,Rn("Predictor2","PredictorAdd2"),Rn("Predictor3","PredictorAdd3"),Rn("Predictor4","PredictorAdd4"),Rn("Predictor5","PredictorAdd5"),Rn("Predictor6","PredictorAdd6"),Rn("Predictor7","PredictorAdd7"),Rn("Predictor8","PredictorAdd8"),Rn("Predictor9","PredictorAdd9"),Rn("Predictor10","PredictorAdd10"),Rn("Predictor11","PredictorAdd11"),Rn("Predictor12","PredictorAdd12"),Rn("Predictor13","PredictorAdd13");var Sa=dr.PredictorAdd2;Mr("ColorIndexInverseTransform","MapARGB","32b",function(yr){return yr>>8&255},function(yr){return yr}),Mr("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(yr){return yr},function(yr){return yr>>8&255});var _c,cs=dr.ColorIndexInverseTransform,hu=dr.MapARGB,Ku=dr.VP8LColorIndexInverseTransformAlpha,pu=dr.MapAlpha,fa=dr.VP8LPredictorsAdd=[];fa.length=16,(dr.VP8LPredictors=[]).length=16,(dr.VP8LPredictorsAdd_C=[]).length=16,(dr.VP8LPredictors_C=[]).length=16;var rl,ds,ts,il,Ra,Ia,Au,Ba,fo,Ta,rs,Ps,Bl,Yu,Tl,Pl,Ml,Ms,Pa,ha,Ma,ka,ol,Yo,bs,Eo,go,Fo,Do=Ce(511),pa=Ce(2041),gu=Ce(225),kl=Ce(767),Zu=0,Aa=pa,vu=gu,fs=kl,qs=Do,Rc=0,sl=1,md=2,Xu=3,Ju=4,Co=5,Ic=6,yu=7,jl=8,tc=9,rc=10,nc=[2,3,7],Bc=[3,3,11],Fl=[280,256,256,256,40],gd=[0,1,1,1,0],Xd=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Jd=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],vd=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Tc=8,xu=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],oc=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],$l=null,Yc=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Zc=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],yd=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],xd=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],ef=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],tf=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Xc=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],hs=[],Hs=[],ws=[],ma=1,bu=2,ns=[],Es=[];li("UpsampleRgbLinePair",so,3),li("UpsampleBgrLinePair",Bo,3),li("UpsampleRgbaLinePair",ta,4),li("UpsampleBgraLinePair",Wo,4),li("UpsampleArgbLinePair",es,4),li("UpsampleRgba4444LinePair",Oo,2),li("UpsampleRgb565LinePair",ko,2);var rf=dr.UpsampleRgbLinePair,nf=dr.UpsampleBgrLinePair,al=dr.UpsampleRgbaLinePair,wu=dr.UpsampleBgraLinePair,Ol=dr.UpsampleArgbLinePair,uc=dr.UpsampleRgba4444LinePair,Jc=dr.UpsampleRgb565LinePair,ja=16,ra=1<<ja-1,vo=-227,bo=482,ul=6,Zo=0,Cs=Ce(256),Dl=Ce(256),Eu=Ce(256),Ss=Ce(256),Pc=Ce(bo-vo),bd=Ce(bo-vo);Us("YuvToRgbRow",so,3),Us("YuvToBgrRow",Bo,3),Us("YuvToRgbaRow",ta,4),Us("YuvToBgraRow",Wo,4),Us("YuvToArgbRow",es,4),Us("YuvToRgba4444Row",Oo,2),Us("YuvToRgb565Row",ko,2);var ed=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Nl=[0,2,8],wd=[8,7,6,4,4,2,2,2,1,1,1,1],Fa=1;this.WebPDecodeRGBA=function(yr,Sr,Nr,Xr,fn){var mn=sl,vn=new da,Cn=new Mn;vn.ba=Cn,Cn.S=mn,Cn.width=[Cn.width],Cn.height=[Cn.height];var _n=Cn.width,Pn=Cn.height,qn=new En;if(qn==null||yr==null)var Jn=2;else Ae(qn!=null),Jn=_l(yr,Sr,Nr,qn.width,qn.height,qn.Pd,qn.Qd,qn.format,null);if(Jn!=0?_n=0:(_n!=null&&(_n[0]=qn.width[0]),Pn!=null&&(Pn[0]=qn.height[0]),_n=1),_n){Cn.width=Cn.width[0],Cn.height=Cn.height[0],Xr!=null&&(Xr[0]=Cn.width),fn!=null&&(fn[0]=Cn.height);e:{if(Xr=new Ni,(fn=new Xa).data=yr,fn.w=Sr,fn.ha=Nr,fn.kd=1,Sr=[0],Ae(fn!=null),((yr=_l(fn.data,fn.w,fn.ha,null,null,null,Sr,null,fn))==0||yr==7)&&Sr[0]&&(yr=4),(Sr=yr)==0){if(Ae(vn!=null),Xr.data=fn.data,Xr.w=fn.w+fn.offset,Xr.ha=fn.ha-fn.offset,Xr.put=kr,Xr.ac=Nn,Xr.bc=Er,Xr.ma=vn,fn.xa){if((yr=Gn())==null){vn=1;break e}if(function(ei,Yn){var Ai=[0],ai=[0],Vn=[0];t:for(;;){if(ei==null)return 0;if(Yn==null)return ei.a=2,0;if(ei.l=Yn,ei.a=0,St(ei.m,Yn.data,Yn.w,Yn.ha),!Tr(ei.m,Ai,ai,Vn)){ei.a=3;break t}if(ei.xb=bu,Yn.width=Ai[0],Yn.height=ai[0],!di(Ai[0],ai[0],1,ei,null))break t;return 1}return Ae(ei.a!=0),0}(yr,Xr)){if(Xr=(Sr=Rl(Xr.width,Xr.height,vn.Oa,vn.ba))==0){t:{Xr=yr;r:for(;;){if(Xr==null){Xr=0;break t}if(Ae(Xr.s.yc!=null),Ae(Xr.s.Ya!=null),Ae(0<Xr.s.Wb),Ae((Nr=Xr.l)!=null),Ae((fn=Nr.ma)!=null),Xr.xb!=0){if(Xr.ca=fn.ba,Xr.tb=fn.tb,Ae(Xr.ca!=null),!au(fn.Oa,Nr,Xu)){Xr.a=2;break r}if(!hi(Xr,Nr.width)||Nr.da)break r;if((Nr.da||Bn(Xr.ca.S))&&Xn(),11>Xr.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),Xr.ca.f.kb.F!=null&&Xn()),Xr.Pb&&0<Xr.s.ua&&Xr.s.vb.X==null&&!dn(Xr.s.vb,Xr.s.Wa.Xa)){Xr.a=1;break r}Xr.xb=0}if(!Wn(Xr,Xr.V,Xr.Ba,Xr.c,Xr.i,Nr.o,Fn))break r;fn.Dc=Xr.Ma,Xr=1;break t}Ae(Xr.a!=0),Xr=0}Xr=!Xr}Xr&&(Sr=yr.a)}else Sr=yr.a}else{if((yr=new _o)==null){vn=1;break e}if(yr.Fa=fn.na,yr.P=fn.P,yr.qc=fn.Sa,yc(yr,Xr)){if((Sr=Rl(Xr.width,Xr.height,vn.Oa,vn.ba))==0){if(yr.Aa=0,Nr=vn.Oa,Ae((fn=yr)!=null),Nr!=null){if(0<(_n=0>(_n=Nr.Md)?0:100<_n?255:255*_n/100)){for(Pn=qn=0;4>Pn;++Pn)12>(Jn=fn.pb[Pn]).lc&&(Jn.ia=_n*wd[0>Jn.lc?0:Jn.lc]>>3),qn|=Jn.ia;qn&&(alert("todo:VP8InitRandom"),fn.ia=1)}fn.Ga=Nr.Id,100<fn.Ga?fn.Ga=100:0>fn.Ga&&(fn.Ga=0)}ml(yr,Xr)||(Sr=yr.a)}}else Sr=yr.a}Sr==0&&vn.Oa!=null&&vn.Oa.fd&&(Sr=lu(vn.ba))}vn=Sr}mn=vn!=0?null:11>mn?Cn.f.RGBA.eb:Cn.f.kb.y}else mn=null;return mn};var cc=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function Te(dr,ar){for(var lr="",Ke=0;Ke<4;Ke++)lr+=String.fromCharCode(dr[ar++]);return lr}function Pe(dr,ar){return(dr[ar+0]<<0|dr[ar+1]<<8|dr[ar+2]<<16)>>>0}function ke(dr,ar){return(dr[ar+0]<<0|dr[ar+1]<<8|dr[ar+2]<<16|dr[ar+3]<<24)>>>0}new Be;var $e=[0],Oe=[0],Ue=[],qe=new Be,ze=t,Ve=function(dr,ar){var lr={},Ke=0,Me=!1,je=0,De=0;if(lr.frames=[],!function(ur,fr,Ar,vr){for(var xr=0;xr<vr;xr++)if(ur[fr+xr]!=Ar.charCodeAt(xr))return!0;return!1}(dr,ar,"RIFF",4)){for(ke(dr,ar+=4),ar+=8;ar<dr.length;){var He=Te(dr,ar),Qe=ke(dr,ar+=4);ar+=4;var Ye=Qe+(1&Qe);switch(He){case"VP8 ":case"VP8L":lr.frames[Ke]===void 0&&(lr.frames[Ke]={}),(Fe=lr.frames[Ke]).src_off=Me?De:ar-8,Fe.src_size=je+Qe+8,Ke++,Me&&(Me=!1,je=0,De=0);break;case"VP8X":(Fe=lr.header={}).feature_flags=dr[ar];var St=ar+4;Fe.canvas_width=1+Pe(dr,St),St+=3,Fe.canvas_height=1+Pe(dr,St),St+=3;break;case"ALPH":Me=!0,je=Ye+8,De=ar-8;break;case"ANIM":(Fe=lr.header).bgcolor=ke(dr,ar),St=ar+4,Fe.loop_count=(Ze=dr)[(ir=St)+0]<<0|Ze[ir+1]<<8,St+=2;break;case"ANMF":var We,Fe;(Fe=lr.frames[Ke]={}).offset_x=2*Pe(dr,ar),ar+=3,Fe.offset_y=2*Pe(dr,ar),ar+=3,Fe.width=1+Pe(dr,ar),ar+=3,Fe.height=1+Pe(dr,ar),ar+=3,Fe.duration=Pe(dr,ar),ar+=3,We=dr[ar++],Fe.dispose=1&We,Fe.blend=We>>1&1}He!="ANMF"&&(ar+=Ye)}var Ze,ir;return lr}}(ze,0);Ve.response=ze,Ve.rgbaoutput=!0,Ve.dataurl=!1;var Ge=Ve.header?Ve.header:null,Xe=Ve.frames?Ve.frames:null;if(Ge){Ge.loop_counter=Ge.loop_count,$e=[Ge.canvas_height],Oe=[Ge.canvas_width];for(var er=0;er<Xe.length&&Xe[er].blend!=0;er++);}var tr=Xe[0],nr=qe.WebPDecodeRGBA(ze,tr.src_off,tr.src_size,Oe,$e);tr.rgba=nr,tr.imgwidth=Oe[0],tr.imgheight=$e[0];for(var sr=0;sr<Oe[0]*$e[0]*4;sr++)Ue[sr]=nr[sr];return this.width=Oe,this.height=$e,this.data=Ue,this}(function(t){var Ae=function(){return typeof zlibSync=="function"},xe=function($e,Oe,Ue,qe){var ze=4,Ve=_e;switch(qe){case t.image_compression.FAST:ze=1,Ve=Ce;break;case t.image_compression.MEDIUM:ze=6,Ve=Ie;break;case t.image_compression.SLOW:ze=9,Ve=Be}$e=Ee($e,Oe,Ue,Ve);var Ge=zlibSync($e,{level:ze});return t.__addimage__.arrayBufferToBinaryString(Ge)},Ee=function($e,Oe,Ue,qe){for(var ze,Ve,Ge,Xe=$e.length/Oe,er=new Uint8Array($e.length+Xe),tr=Pe(),nr=0;nr<Xe;nr+=1){if(Ge=nr*Oe,ze=$e.subarray(Ge,Ge+Oe),qe)er.set(qe(ze,Ue,Ve),Ge+nr);else{for(var sr,dr=tr.length,ar=[];sr<dr;sr+=1)ar[sr]=tr[sr](ze,Ue,Ve);var lr=ke(ar.concat());er.set(ar[lr],Ge+nr)}Ve=ze}return er},Se=function($e){var Oe=Array.apply([],$e);return Oe.unshift(0),Oe},Ce=function($e,Oe){var Ue,qe=[],ze=$e.length;qe[0]=1;for(var Ve=0;Ve<ze;Ve+=1)Ue=$e[Ve-Oe]||0,qe[Ve+1]=$e[Ve]-Ue+256&255;return qe},_e=function($e,Oe,Ue){var qe,ze=[],Ve=$e.length;ze[0]=2;for(var Ge=0;Ge<Ve;Ge+=1)qe=Ue&&Ue[Ge]||0,ze[Ge+1]=$e[Ge]-qe+256&255;return ze},Ie=function($e,Oe,Ue){var qe,ze,Ve=[],Ge=$e.length;Ve[0]=3;for(var Xe=0;Xe<Ge;Xe+=1)qe=$e[Xe-Oe]||0,ze=Ue&&Ue[Xe]||0,Ve[Xe+1]=$e[Xe]+256-(qe+ze>>>1)&255;return Ve},Be=function($e,Oe,Ue){var qe,ze,Ve,Ge,Xe=[],er=$e.length;Xe[0]=4;for(var tr=0;tr<er;tr+=1)qe=$e[tr-Oe]||0,ze=Ue&&Ue[tr]||0,Ve=Ue&&Ue[tr-Oe]||0,Ge=Te(qe,ze,Ve),Xe[tr+1]=$e[tr]-Ge+256&255;return Xe},Te=function($e,Oe,Ue){if($e===Oe&&Oe===Ue)return $e;var qe=Math.abs(Oe-Ue),ze=Math.abs($e-Ue),Ve=Math.abs($e+Oe-Ue-Ue);return qe<=ze&&qe<=Ve?$e:ze<=Ve?Oe:Ue},Pe=function(){return[Se,Ce,_e,Ie,Be]},ke=function($e){var Oe=$e.map(function(Ue){return Ue.reduce(function(qe,ze){return qe+Math.abs(ze)},0)});return Oe.indexOf(Math.min.apply(null,Oe))};t.processPNG=function($e,Oe,Ue,qe){var ze,Ve,Ge,Xe,er,tr,nr,sr,dr,ar,lr,Ke,Me,je,De,He=this.decode.FLATE_DECODE,Qe="";if(this.__addimage__.isArrayBuffer($e)&&($e=new Uint8Array($e)),this.__addimage__.isArrayBufferView($e)){if($e=(Ge=new Kt($e)).imgData,Ve=Ge.bits,ze=Ge.colorSpace,er=Ge.colors,[4,6].indexOf(Ge.colorType)!==-1){if(Ge.bits===8){dr=(sr=Ge.pixelBitlength==32?new Uint32Array(Ge.decodePixels().buffer):Ge.pixelBitlength==16?new Uint16Array(Ge.decodePixels().buffer):new Uint8Array(Ge.decodePixels().buffer)).length,lr=new Uint8Array(dr*Ge.colors),ar=new Uint8Array(dr);var Ye,St=Ge.pixelBitlength-Ge.bits;for(je=0,De=0;je<dr;je++){for(Me=sr[je],Ye=0;Ye<St;)lr[De++]=Me>>>Ye&255,Ye+=Ge.bits;ar[je]=Me>>>Ye&255}}if(Ge.bits===16){dr=(sr=new Uint32Array(Ge.decodePixels().buffer)).length,lr=new Uint8Array(dr*(32/Ge.pixelBitlength)*Ge.colors),ar=new Uint8Array(dr*(32/Ge.pixelBitlength)),Ke=Ge.colors>1,je=0,De=0;for(var We=0;je<dr;)Me=sr[je++],lr[De++]=Me>>>0&255,Ke&&(lr[De++]=Me>>>16&255,Me=sr[je++],lr[De++]=Me>>>0&255),ar[We++]=Me>>>16&255;Ve=8}qe!==t.image_compression.NONE&&Ae()?($e=xe(lr,Ge.width*Ge.colors,Ge.colors,qe),nr=xe(ar,Ge.width,1,qe)):($e=lr,nr=ar,He=void 0)}if(Ge.colorType===3&&(ze=this.color_spaces.INDEXED,tr=Ge.palette,Ge.transparency.indexed)){var Fe=Ge.transparency.indexed,Ze=0;for(je=0,dr=Fe.length;je<dr;++je)Ze+=Fe[je];if((Ze/=255)===dr-1&&Fe.indexOf(0)!==-1)Xe=[Fe.indexOf(0)];else if(Ze!==dr){for(sr=Ge.decodePixels(),ar=new Uint8Array(sr.length),je=0,dr=sr.length;je<dr;je++)ar[je]=Fe[sr[je]];nr=xe(ar,Ge.width,1)}}var ir=function(ur){var fr;switch(ur){case t.image_compression.FAST:fr=11;break;case t.image_compression.MEDIUM:fr=13;break;case t.image_compression.SLOW:fr=14;break;default:fr=12}return fr}(qe);return He===this.decode.FLATE_DECODE&&(Qe="/Predictor "+ir+" "),Qe+="/Colors "+er+" /BitsPerComponent "+Ve+" /Columns "+Ge.width,(this.__addimage__.isArrayBuffer($e)||this.__addimage__.isArrayBufferView($e))&&($e=this.__addimage__.arrayBufferToBinaryString($e)),(nr&&this.__addimage__.isArrayBuffer(nr)||this.__addimage__.isArrayBufferView(nr))&&(nr=this.__addimage__.arrayBufferToBinaryString(nr)),{alias:Ue,data:$e,index:Oe,filter:He,decodeParameters:Qe,transparency:Xe,palette:tr,sMask:nr,predictor:ir,width:Ge.width,height:Ge.height,bitsPerComponent:Ve,colorSpace:ze}}}})(E.API),function(t){t.processGIF89A=function(Ae,xe,Ee,Se){var Ce=new Zt(Ae),_e=Ce.width,Ie=Ce.height,Be=[];Ce.decodeAndBlitFrameRGBA(0,Be);var Te={data:Be,width:_e,height:Ie},Pe=new Qt(100).encode(Te,100);return t.processJPEG.call(this,Pe,xe,Ee,Se)},t.processGIF87A=t.processGIF89A}(E.API),te.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var Ae=0;Ae<t;Ae++){var xe=this.datav.getUint8(this.pos++,!0),Ee=this.datav.getUint8(this.pos++,!0),Se=this.datav.getUint8(this.pos++,!0),Ce=this.datav.getUint8(this.pos++,!0);this.palette[Ae]={red:Se,green:Ee,blue:xe,quad:Ce}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},te.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,Ae=this.width*this.height*4;this.data=new Uint8Array(Ae),this[t]()}catch(xe){a.log("bit decode error:"+xe)}},te.prototype.bit1=function(){var t,Ae=Math.ceil(this.width/8),xe=Ae%4;for(t=this.height-1;t>=0;t--){for(var Ee=this.bottom_up?t:this.height-1-t,Se=0;Se<Ae;Se++)for(var Ce=this.datav.getUint8(this.pos++,!0),_e=Ee*this.width*4+8*Se*4,Ie=0;Ie<8&&8*Se+Ie<this.width;Ie++){var Be=this.palette[Ce>>7-Ie&1];this.data[_e+4*Ie]=Be.blue,this.data[_e+4*Ie+1]=Be.green,this.data[_e+4*Ie+2]=Be.red,this.data[_e+4*Ie+3]=255}xe!==0&&(this.pos+=4-xe)}},te.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),Ae=t%4,xe=this.height-1;xe>=0;xe--){for(var Ee=this.bottom_up?xe:this.height-1-xe,Se=0;Se<t;Se++){var Ce=this.datav.getUint8(this.pos++,!0),_e=Ee*this.width*4+2*Se*4,Ie=Ce>>4,Be=15&Ce,Te=this.palette[Ie];if(this.data[_e]=Te.blue,this.data[_e+1]=Te.green,this.data[_e+2]=Te.red,this.data[_e+3]=255,2*Se+1>=this.width)break;Te=this.palette[Be],this.data[_e+4]=Te.blue,this.data[_e+4+1]=Te.green,this.data[_e+4+2]=Te.red,this.data[_e+4+3]=255}Ae!==0&&(this.pos+=4-Ae)}},te.prototype.bit8=function(){for(var t=this.width%4,Ae=this.height-1;Ae>=0;Ae--){for(var xe=this.bottom_up?Ae:this.height-1-Ae,Ee=0;Ee<this.width;Ee++){var Se=this.datav.getUint8(this.pos++,!0),Ce=xe*this.width*4+4*Ee;if(Se<this.palette.length){var _e=this.palette[Se];this.data[Ce]=_e.red,this.data[Ce+1]=_e.green,this.data[Ce+2]=_e.blue,this.data[Ce+3]=255}else this.data[Ce]=255,this.data[Ce+1]=255,this.data[Ce+2]=255,this.data[Ce+3]=255}t!==0&&(this.pos+=4-t)}},te.prototype.bit15=function(){for(var t=this.width%3,Ae=parseInt("11111",2),xe=this.height-1;xe>=0;xe--){for(var Ee=this.bottom_up?xe:this.height-1-xe,Se=0;Se<this.width;Se++){var Ce=this.datav.getUint16(this.pos,!0);this.pos+=2;var _e=(Ce&Ae)/Ae*255|0,Ie=(Ce>>5&Ae)/Ae*255|0,Be=(Ce>>10&Ae)/Ae*255|0,Te=Ce>>15?255:0,Pe=Ee*this.width*4+4*Se;this.data[Pe]=Be,this.data[Pe+1]=Ie,this.data[Pe+2]=_e,this.data[Pe+3]=Te}this.pos+=t}},te.prototype.bit16=function(){for(var t=this.width%3,Ae=parseInt("11111",2),xe=parseInt("111111",2),Ee=this.height-1;Ee>=0;Ee--){for(var Se=this.bottom_up?Ee:this.height-1-Ee,Ce=0;Ce<this.width;Ce++){var _e=this.datav.getUint16(this.pos,!0);this.pos+=2;var Ie=(_e&Ae)/Ae*255|0,Be=(_e>>5&xe)/xe*255|0,Te=(_e>>11)/Ae*255|0,Pe=Se*this.width*4+4*Ce;this.data[Pe]=Te,this.data[Pe+1]=Be,this.data[Pe+2]=Ie,this.data[Pe+3]=255}this.pos+=t}},te.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var Ae=this.bottom_up?t:this.height-1-t,xe=0;xe<this.width;xe++){var Ee=this.datav.getUint8(this.pos++,!0),Se=this.datav.getUint8(this.pos++,!0),Ce=this.datav.getUint8(this.pos++,!0),_e=Ae*this.width*4+4*xe;this.data[_e]=Ce,this.data[_e+1]=Se,this.data[_e+2]=Ee,this.data[_e+3]=255}this.pos+=this.width%4}},te.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var Ae=this.bottom_up?t:this.height-1-t,xe=0;xe<this.width;xe++){var Ee=this.datav.getUint8(this.pos++,!0),Se=this.datav.getUint8(this.pos++,!0),Ce=this.datav.getUint8(this.pos++,!0),_e=this.datav.getUint8(this.pos++,!0),Ie=Ae*this.width*4+4*xe;this.data[Ie]=Ce,this.data[Ie+1]=Se,this.data[Ie+2]=Ee,this.data[Ie+3]=_e}},te.prototype.getData=function(){return this.data},function(t){t.processBMP=function(Ae,xe,Ee,Se){var Ce=new te(Ae,!1),_e=Ce.width,Ie=Ce.height,Be={data:Ce.getData(),width:_e,height:Ie},Te=new Qt(100).encode(Be,100);return t.processJPEG.call(this,Te,xe,Ee,Se)}}(E.API),ee$1.prototype.getData=function(){return this.data},function(t){t.processWEBP=function(Ae,xe,Ee,Se){var Ce=new ee$1(Ae),_e=Ce.width,Ie=Ce.height,Be={data:Ce.getData(),width:_e,height:Ie},Te=new Qt(100).encode(Be,100);return t.processJPEG.call(this,Te,xe,Ee,Se)}}(E.API),E.API.processRGBA=function(t,Ae,xe){for(var Ee=t.data,Se=Ee.length,Ce=new Uint8Array(Se/4*3),_e=new Uint8Array(Se/4),Ie=0,Be=0,Te=0;Te<Se;Te+=4){var Pe=Ee[Te],ke=Ee[Te+1],$e=Ee[Te+2],Oe=Ee[Te+3];Ce[Ie++]=Pe,Ce[Ie++]=ke,Ce[Ie++]=$e,_e[Be++]=Oe}var Ue=this.__addimage__.arrayBufferToBinaryString(Ce);return{alpha:this.__addimage__.arrayBufferToBinaryString(_e),data:Ue,index:Ae,alias:xe,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},E.API.setLanguage=function(t){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Vt=E.API,Gt$1=Vt.getCharWidthsArray=function(t,Ae){var xe,Ee,Se=(Ae=Ae||{}).font||this.internal.getFont(),Ce=Ae.fontSize||this.internal.getFontSize(),_e=Ae.charSpace||this.internal.getCharSpace(),Ie=Ae.widths?Ae.widths:Se.metadata.Unicode.widths,Be=Ie.fof?Ie.fof:1,Te=Ae.kerning?Ae.kerning:Se.metadata.Unicode.kerning,Pe=Te.fof?Te.fof:1,ke=Ae.doKerning!==!1,$e=0,Oe=t.length,Ue=0,qe=Ie[0]||Be,ze=[];for(xe=0;xe<Oe;xe++)Ee=t.charCodeAt(xe),typeof Se.metadata.widthOfString=="function"?ze.push((Se.metadata.widthOfGlyph(Se.metadata.characterToGlyph(Ee))+_e*(1e3/Ce)||0)/1e3):($e=ke&&_typeof$c(Te[Ee])==="object"&&!isNaN(parseInt(Te[Ee][Ue],10))?Te[Ee][Ue]/Pe:0,ze.push((Ie[Ee]||qe)/Be+$e)),Ue=Ee;return ze},Yt=Vt.getStringUnitWidth=function(t,Ae){var xe=(Ae=Ae||{}).fontSize||this.internal.getFontSize(),Ee=Ae.font||this.internal.getFont(),Se=Ae.charSpace||this.internal.getCharSpace();return Vt.processArabic&&(t=Vt.processArabic(t)),typeof Ee.metadata.widthOfString=="function"?Ee.metadata.widthOfString(t,xe,Se)/xe:Gt$1.apply(this,arguments).reduce(function(Ce,_e){return Ce+_e},0)},Jt=function(t,Ae,xe,Ee){for(var Se=[],Ce=0,_e=t.length,Ie=0;Ce!==_e&&Ie+Ae[Ce]<xe;)Ie+=Ae[Ce],Ce++;Se.push(t.slice(0,Ce));var Be=Ce;for(Ie=0;Ce!==_e;)Ie+Ae[Ce]>Ee&&(Se.push(t.slice(Be,Ce)),Ie=0,Be=Ce),Ie+=Ae[Ce],Ce++;return Be!==Ce&&Se.push(t.slice(Be,Ce)),Se},Xt=function(t,Ae,xe){xe||(xe={});var Ee,Se,Ce,_e,Ie,Be,Te,Pe=[],ke=[Pe],$e=xe.textIndent||0,Oe=0,Ue=0,qe=t.split(" "),ze=Gt$1.apply(this,[" ",xe])[0];if(Be=xe.lineIndent===-1?qe[0].length+2:xe.lineIndent||0){var Ve=Array(Be).join(" "),Ge=[];qe.map(function(er){(er=er.split(/\s*\n/)).length>1?Ge=Ge.concat(er.map(function(tr,nr){return(nr&&tr.length?`
846
846
  `:"")+tr})):Ge.push(er[0])}),qe=Ge,Be=Yt.apply(this,[Ve,xe])}for(Ce=0,_e=qe.length;Ce<_e;Ce++){var Xe=0;if(Ee=qe[Ce],Be&&Ee[0]==`
847
- `&&(Ee=Ee.substr(1),Xe=1),$e+Oe+(Ue=(Se=Gt$1.apply(this,[Ee,xe])).reduce(function(er,tr){return er+tr},0))>Ae||Xe){if(Ue>Ae){for(Ie=Jt.apply(this,[Ee,Se,Ae-($e+Oe),Ae]),Pe.push(Ie.shift()),Pe=[Ie.pop()];Ie.length;)ke.push([Ie.shift()]);Ue=Se.slice(Ee.length-(Pe[0]?Pe[0].length:0)).reduce(function(er,tr){return er+tr},0)}else Pe=[Ee];ke.push(Pe),$e=Ue+Be,Oe=ze}else Pe.push(Ee),$e+=Oe+Ue,Oe=ze}return Te=Be?function(er,tr){return(tr?Ve:"")+er.join(" ")}:function(er){return er.join(" ")},ke.map(Te)},Vt.splitTextToSize=function(t,Ae,xe){var Ee,Se=(xe=xe||{}).fontSize||this.internal.getFontSize(),Ce=(function(Pe){if(Pe.widths&&Pe.kerning)return{widths:Pe.widths,kerning:Pe.kerning};var ke=this.internal.getFont(Pe.fontName,Pe.fontStyle);return ke.metadata.Unicode?{widths:ke.metadata.Unicode.widths||{0:1},kerning:ke.metadata.Unicode.kerning||{}}:{font:ke.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,xe);Ee=Array.isArray(t)?t:String(t).split(/\r?\n/);var _e=1*this.internal.scaleFactor*Ae/Se;Ce.textIndent=xe.textIndent?1*xe.textIndent*this.internal.scaleFactor/Se:0,Ce.lineIndent=xe.lineIndent;var Ie,Be,Te=[];for(Ie=0,Be=Ee.length;Ie<Be;Ie++)Te=Te.concat(Xt.apply(this,[Ee[Ie],_e,Ce]));return Te},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var Ae="klmnopqrstuvwxyz",xe={},Ee={},Se=0;Se<Ae.length;Se++)xe[Ae[Se]]="0123456789abcdef"[Se],Ee["0123456789abcdef"[Se]]=Ae[Se];var Ce=function(ke){return"0x"+parseInt(ke,10).toString(16)},_e=t.__fontmetrics__.compress=function(ke){var $e,Oe,Ue,qe,ze=["{"];for(var Ve in ke){if($e=ke[Ve],isNaN(parseInt(Ve,10))?Oe="'"+Ve+"'":(Ve=parseInt(Ve,10),Oe=(Oe=Ce(Ve).slice(2)).slice(0,-1)+Ee[Oe.slice(-1)]),typeof $e=="number")$e<0?(Ue=Ce($e).slice(3),qe="-"):(Ue=Ce($e).slice(2),qe=""),Ue=qe+Ue.slice(0,-1)+Ee[Ue.slice(-1)];else{if(_typeof$c($e)!=="object")throw new Error("Don't know what to do with value type "+_typeof$c($e)+".");Ue=_e($e)}ze.push(Oe+Ue)}return ze.push("}"),ze.join("")},Ie=t.__fontmetrics__.uncompress=function(ke){if(typeof ke!="string")throw new Error("Invalid argument passed to uncompress.");for(var $e,Oe,Ue,qe,ze={},Ve=1,Ge=ze,Xe=[],er="",tr="",nr=ke.length-1,sr=1;sr<nr;sr+=1)(qe=ke[sr])=="'"?$e?(Ue=$e.join(""),$e=void 0):$e=[]:$e?$e.push(qe):qe=="{"?(Xe.push([Ge,Ue]),Ge={},Ue=void 0):qe=="}"?((Oe=Xe.pop())[0][Oe[1]]=Ge,Ue=void 0,Ge=Oe[0]):qe=="-"?Ve=-1:Ue===void 0?xe.hasOwnProperty(qe)?(er+=xe[qe],Ue=parseInt(er,16)*Ve,Ve=1,er=""):er+=qe:xe.hasOwnProperty(qe)?(tr+=xe[qe],Ge[Ue]=parseInt(tr,16)*Ve,Ve=1,Ue=void 0,tr=""):tr+=qe;return ze},Be={codePages:["WinAnsiEncoding"],WinAnsiEncoding:Ie("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},Te={Unicode:{Courier:Be,"Courier-Bold":Be,"Courier-BoldOblique":Be,"Courier-Oblique":Be,Helvetica:Be,"Helvetica-Bold":Be,"Helvetica-BoldOblique":Be,"Helvetica-Oblique":Be,"Times-Roman":Be,"Times-Bold":Be,"Times-BoldItalic":Be,"Times-Italic":Be}},Pe={Unicode:{"Courier-Oblique":Ie("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":Ie("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":Ie("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:Ie("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":Ie("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":Ie("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:Ie("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:Ie("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":Ie("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:Ie("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":Ie("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":Ie("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":Ie("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":Ie("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};t.events.push(["addFont",function(ke){var $e=ke.font,Oe=Pe.Unicode[$e.postScriptName];Oe&&($e.metadata.Unicode={},$e.metadata.Unicode.widths=Oe.widths,$e.metadata.Unicode.kerning=Oe.kerning);var Ue=Te.Unicode[$e.postScriptName];Ue&&($e.metadata.Unicode.encoding=Ue,$e.encoding=Ue.codePages[0])}])}(E.API),function(t){var Ae=function(xe){for(var Ee=xe.length,Se=new Uint8Array(Ee),Ce=0;Ce<Ee;Ce++)Se[Ce]=xe.charCodeAt(Ce);return Se};t.API.events.push(["addFont",function(xe){var Ee=void 0,Se=xe.font,Ce=xe.instance;if(!Se.isStandardFont){if(Ce===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+Se.postScriptName+"').");if(typeof(Ee=Ce.existsFileInVFS(Se.postScriptName)===!1?Ce.loadFile(Se.postScriptName):Ce.getFileFromVFS(Se.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+Se.postScriptName+"').");(function(_e,Ie){Ie=/^\x00\x01\x00\x00/.test(Ie)?Ae(Ie):Ae(u(Ie)),_e.metadata=t.API.TTFFont.open(Ie),_e.metadata.Unicode=_e.metadata.Unicode||{encoding:{},kerning:{},widths:[]},_e.metadata.glyIdsUsed=[0]})(Se,Ee)}}])}(E),function(t){function Ae(){return(n.canvg?Promise.resolve(n.canvg):__vitePreload(()=>import("./index.es-Dr2D4Md0.js"),[])).catch(function(xe){return Promise.reject(new Error("Could not load canvg: "+xe))}).then(function(xe){return xe.default?xe.default:xe})}E.API.addSvgAsImage=function(xe,Ee,Se,Ce,_e,Ie,Be,Te){if(isNaN(Ee)||isNaN(Se))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(Ce)||isNaN(_e))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var Pe=document.createElement("canvas");Pe.width=Ce,Pe.height=_e;var ke=Pe.getContext("2d");ke.fillStyle="#fff",ke.fillRect(0,0,Pe.width,Pe.height);var $e={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},Oe=this;return Ae().then(function(Ue){return Ue.fromString(ke,xe,$e)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(Ue){return Ue.render($e)}).then(function(){Oe.addImage(Pe.toDataURL("image/jpeg",1),Ee,Se,Ce,_e,Be,Te)})}}(),E.API.putTotalPages=function(t){var Ae,xe=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(Ae=new RegExp(t,"g"),xe=this.internal.getNumberOfPages()):(Ae=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),xe=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var Ee=1;Ee<=this.internal.getNumberOfPages();Ee++)for(var Se=0;Se<this.internal.pages[Ee].length;Se++)this.internal.pages[Ee][Se]=this.internal.pages[Ee][Se].replace(Ae,xe);return this},E.API.viewerPreferences=function(t,Ae){var xe;t=t||{},Ae=Ae||!1;var Ee,Se,Ce,_e={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},Ie=Object.keys(_e),Be=[],Te=0,Pe=0,ke=0;function $e(Ue,qe){var ze,Ve=!1;for(ze=0;ze<Ue.length;ze+=1)Ue[ze]===qe&&(Ve=!0);return Ve}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(_e)),this.internal.viewerpreferences.isSubscribed=!1),xe=this.internal.viewerpreferences.configuration,t==="reset"||Ae===!0){var Oe=Ie.length;for(ke=0;ke<Oe;ke+=1)xe[Ie[ke]].value=xe[Ie[ke]].defaultValue,xe[Ie[ke]].explicitSet=!1}if(_typeof$c(t)==="object"){for(Se in t)if(Ce=t[Se],$e(Ie,Se)&&Ce!==void 0){if(xe[Se].type==="boolean"&&typeof Ce=="boolean")xe[Se].value=Ce;else if(xe[Se].type==="name"&&$e(xe[Se].valueSet,Ce))xe[Se].value=Ce;else if(xe[Se].type==="integer"&&Number.isInteger(Ce))xe[Se].value=Ce;else if(xe[Se].type==="array"){for(Te=0;Te<Ce.length;Te+=1)if(Ee=!0,Ce[Te].length===1&&typeof Ce[Te][0]=="number")Be.push(String(Ce[Te]-1));else if(Ce[Te].length>1){for(Pe=0;Pe<Ce[Te].length;Pe+=1)typeof Ce[Te][Pe]!="number"&&(Ee=!1);Ee===!0&&Be.push([Ce[Te][0]-1,Ce[Te][1]-1].join(" "))}xe[Se].value="["+Be.join(" ")+"]"}else xe[Se].value=xe[Se].defaultValue;xe[Se].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var Ue,qe=[];for(Ue in xe)xe[Ue].explicitSet===!0&&(xe[Ue].type==="name"?qe.push("/"+Ue+" /"+xe[Ue].value):qe.push("/"+Ue+" "+xe[Ue].value));qe.length!==0&&this.internal.write(`/ViewerPreferences
847
+ `&&(Ee=Ee.substr(1),Xe=1),$e+Oe+(Ue=(Se=Gt$1.apply(this,[Ee,xe])).reduce(function(er,tr){return er+tr},0))>Ae||Xe){if(Ue>Ae){for(Ie=Jt.apply(this,[Ee,Se,Ae-($e+Oe),Ae]),Pe.push(Ie.shift()),Pe=[Ie.pop()];Ie.length;)ke.push([Ie.shift()]);Ue=Se.slice(Ee.length-(Pe[0]?Pe[0].length:0)).reduce(function(er,tr){return er+tr},0)}else Pe=[Ee];ke.push(Pe),$e=Ue+Be,Oe=ze}else Pe.push(Ee),$e+=Oe+Ue,Oe=ze}return Te=Be?function(er,tr){return(tr?Ve:"")+er.join(" ")}:function(er){return er.join(" ")},ke.map(Te)},Vt.splitTextToSize=function(t,Ae,xe){var Ee,Se=(xe=xe||{}).fontSize||this.internal.getFontSize(),Ce=(function(Pe){if(Pe.widths&&Pe.kerning)return{widths:Pe.widths,kerning:Pe.kerning};var ke=this.internal.getFont(Pe.fontName,Pe.fontStyle);return ke.metadata.Unicode?{widths:ke.metadata.Unicode.widths||{0:1},kerning:ke.metadata.Unicode.kerning||{}}:{font:ke.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,xe);Ee=Array.isArray(t)?t:String(t).split(/\r?\n/);var _e=1*this.internal.scaleFactor*Ae/Se;Ce.textIndent=xe.textIndent?1*xe.textIndent*this.internal.scaleFactor/Se:0,Ce.lineIndent=xe.lineIndent;var Ie,Be,Te=[];for(Ie=0,Be=Ee.length;Ie<Be;Ie++)Te=Te.concat(Xt.apply(this,[Ee[Ie],_e,Ce]));return Te},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var Ae="klmnopqrstuvwxyz",xe={},Ee={},Se=0;Se<Ae.length;Se++)xe[Ae[Se]]="0123456789abcdef"[Se],Ee["0123456789abcdef"[Se]]=Ae[Se];var Ce=function(ke){return"0x"+parseInt(ke,10).toString(16)},_e=t.__fontmetrics__.compress=function(ke){var $e,Oe,Ue,qe,ze=["{"];for(var Ve in ke){if($e=ke[Ve],isNaN(parseInt(Ve,10))?Oe="'"+Ve+"'":(Ve=parseInt(Ve,10),Oe=(Oe=Ce(Ve).slice(2)).slice(0,-1)+Ee[Oe.slice(-1)]),typeof $e=="number")$e<0?(Ue=Ce($e).slice(3),qe="-"):(Ue=Ce($e).slice(2),qe=""),Ue=qe+Ue.slice(0,-1)+Ee[Ue.slice(-1)];else{if(_typeof$c($e)!=="object")throw new Error("Don't know what to do with value type "+_typeof$c($e)+".");Ue=_e($e)}ze.push(Oe+Ue)}return ze.push("}"),ze.join("")},Ie=t.__fontmetrics__.uncompress=function(ke){if(typeof ke!="string")throw new Error("Invalid argument passed to uncompress.");for(var $e,Oe,Ue,qe,ze={},Ve=1,Ge=ze,Xe=[],er="",tr="",nr=ke.length-1,sr=1;sr<nr;sr+=1)(qe=ke[sr])=="'"?$e?(Ue=$e.join(""),$e=void 0):$e=[]:$e?$e.push(qe):qe=="{"?(Xe.push([Ge,Ue]),Ge={},Ue=void 0):qe=="}"?((Oe=Xe.pop())[0][Oe[1]]=Ge,Ue=void 0,Ge=Oe[0]):qe=="-"?Ve=-1:Ue===void 0?xe.hasOwnProperty(qe)?(er+=xe[qe],Ue=parseInt(er,16)*Ve,Ve=1,er=""):er+=qe:xe.hasOwnProperty(qe)?(tr+=xe[qe],Ge[Ue]=parseInt(tr,16)*Ve,Ve=1,Ue=void 0,tr=""):tr+=qe;return ze},Be={codePages:["WinAnsiEncoding"],WinAnsiEncoding:Ie("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},Te={Unicode:{Courier:Be,"Courier-Bold":Be,"Courier-BoldOblique":Be,"Courier-Oblique":Be,Helvetica:Be,"Helvetica-Bold":Be,"Helvetica-BoldOblique":Be,"Helvetica-Oblique":Be,"Times-Roman":Be,"Times-Bold":Be,"Times-BoldItalic":Be,"Times-Italic":Be}},Pe={Unicode:{"Courier-Oblique":Ie("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":Ie("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":Ie("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:Ie("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":Ie("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":Ie("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:Ie("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:Ie("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":Ie("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:Ie("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":Ie("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":Ie("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":Ie("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":Ie("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};t.events.push(["addFont",function(ke){var $e=ke.font,Oe=Pe.Unicode[$e.postScriptName];Oe&&($e.metadata.Unicode={},$e.metadata.Unicode.widths=Oe.widths,$e.metadata.Unicode.kerning=Oe.kerning);var Ue=Te.Unicode[$e.postScriptName];Ue&&($e.metadata.Unicode.encoding=Ue,$e.encoding=Ue.codePages[0])}])}(E.API),function(t){var Ae=function(xe){for(var Ee=xe.length,Se=new Uint8Array(Ee),Ce=0;Ce<Ee;Ce++)Se[Ce]=xe.charCodeAt(Ce);return Se};t.API.events.push(["addFont",function(xe){var Ee=void 0,Se=xe.font,Ce=xe.instance;if(!Se.isStandardFont){if(Ce===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+Se.postScriptName+"').");if(typeof(Ee=Ce.existsFileInVFS(Se.postScriptName)===!1?Ce.loadFile(Se.postScriptName):Ce.getFileFromVFS(Se.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+Se.postScriptName+"').");(function(_e,Ie){Ie=/^\x00\x01\x00\x00/.test(Ie)?Ae(Ie):Ae(u(Ie)),_e.metadata=t.API.TTFFont.open(Ie),_e.metadata.Unicode=_e.metadata.Unicode||{encoding:{},kerning:{},widths:[]},_e.metadata.glyIdsUsed=[0]})(Se,Ee)}}])}(E),function(t){function Ae(){return(n.canvg?Promise.resolve(n.canvg):__vitePreload(()=>import("./index.es-Dm98tpXC.js"),[])).catch(function(xe){return Promise.reject(new Error("Could not load canvg: "+xe))}).then(function(xe){return xe.default?xe.default:xe})}E.API.addSvgAsImage=function(xe,Ee,Se,Ce,_e,Ie,Be,Te){if(isNaN(Ee)||isNaN(Se))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(Ce)||isNaN(_e))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var Pe=document.createElement("canvas");Pe.width=Ce,Pe.height=_e;var ke=Pe.getContext("2d");ke.fillStyle="#fff",ke.fillRect(0,0,Pe.width,Pe.height);var $e={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},Oe=this;return Ae().then(function(Ue){return Ue.fromString(ke,xe,$e)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(Ue){return Ue.render($e)}).then(function(){Oe.addImage(Pe.toDataURL("image/jpeg",1),Ee,Se,Ce,_e,Be,Te)})}}(),E.API.putTotalPages=function(t){var Ae,xe=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(Ae=new RegExp(t,"g"),xe=this.internal.getNumberOfPages()):(Ae=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),xe=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var Ee=1;Ee<=this.internal.getNumberOfPages();Ee++)for(var Se=0;Se<this.internal.pages[Ee].length;Se++)this.internal.pages[Ee][Se]=this.internal.pages[Ee][Se].replace(Ae,xe);return this},E.API.viewerPreferences=function(t,Ae){var xe;t=t||{},Ae=Ae||!1;var Ee,Se,Ce,_e={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},Ie=Object.keys(_e),Be=[],Te=0,Pe=0,ke=0;function $e(Ue,qe){var ze,Ve=!1;for(ze=0;ze<Ue.length;ze+=1)Ue[ze]===qe&&(Ve=!0);return Ve}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(_e)),this.internal.viewerpreferences.isSubscribed=!1),xe=this.internal.viewerpreferences.configuration,t==="reset"||Ae===!0){var Oe=Ie.length;for(ke=0;ke<Oe;ke+=1)xe[Ie[ke]].value=xe[Ie[ke]].defaultValue,xe[Ie[ke]].explicitSet=!1}if(_typeof$c(t)==="object"){for(Se in t)if(Ce=t[Se],$e(Ie,Se)&&Ce!==void 0){if(xe[Se].type==="boolean"&&typeof Ce=="boolean")xe[Se].value=Ce;else if(xe[Se].type==="name"&&$e(xe[Se].valueSet,Ce))xe[Se].value=Ce;else if(xe[Se].type==="integer"&&Number.isInteger(Ce))xe[Se].value=Ce;else if(xe[Se].type==="array"){for(Te=0;Te<Ce.length;Te+=1)if(Ee=!0,Ce[Te].length===1&&typeof Ce[Te][0]=="number")Be.push(String(Ce[Te]-1));else if(Ce[Te].length>1){for(Pe=0;Pe<Ce[Te].length;Pe+=1)typeof Ce[Te][Pe]!="number"&&(Ee=!1);Ee===!0&&Be.push([Ce[Te][0]-1,Ce[Te][1]-1].join(" "))}xe[Se].value="["+Be.join(" ")+"]"}else xe[Se].value=xe[Se].defaultValue;xe[Se].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var Ue,qe=[];for(Ue in xe)xe[Ue].explicitSet===!0&&(xe[Ue].type==="name"?qe.push("/"+Ue+" /"+xe[Ue].value):qe.push("/"+Ue+" "+xe[Ue].value));qe.length!==0&&this.internal.write(`/ViewerPreferences
848
848
  <<
849
849
  `+qe.join(`
850
850
  `)+`